diff --git a/build/js/flexcss.js b/build/js/flexcss.js index 4121f799..cf5222b7 100644 --- a/build/js/flexcss.js +++ b/build/js/flexcss.js @@ -4047,7 +4047,6 @@ return /******/ (function(modules) { // webpackBootstrap this.widgets.pop(); if (this.widgets.length === 0) { this._removeFixedContainer(); - resolve(); } } diff --git a/build/js/flexcss.min.js b/build/js/flexcss.min.js index f334008d..b4c8f8f5 100644 --- a/build/js/flexcss.min.js +++ b/build/js/flexcss.min.js @@ -1,4 +1,4 @@ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.FlexCss=t():e.FlexCss=t()}(this,function(){return function(e){function t(i){if(n[i])return n[i].exports;var r=n[i]={exports:{},id:i,loaded:!1};return e[i].call(r.exports,r,r.exports,t),r.loaded=!0,r.exports}var n={};return t.m=e,t.c=n,t.p="../",t(0)}([function(e,t,n){e.exports=n(17)},function(e,t){(function(e){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n0&&e.offsetHeight>0}},{key:"dashToCamelCase",value:function(e){return e.replace(/-([a-z])/g,function(e){return e[1].toUpperCase()})}},{key:"copy",value:function(e){return JSON.parse(JSON.stringify(e))}},{key:"applyOptionsFromElement",value:function(e,n){if(!e)return n;for(var i=e.attributes,r=0;rh.width,b=n.classList;b.remove(a),b.remove(o),b.remove(s);var C=void 0,T=void 0;if(y&&!_)T=c.left-h.left-d+"px",b.add(o);else{var w=p-f.width-h.left-d+"px",O=(E+c.width/2-f.width/2||0)-h.left,L=O+f.width>h.width;r&&!L?T=O+"px":(b.add(a),T=w)}return g||l&&!m?(C=v-f.height-h.top+"px",b.add(s)):C=v+c.height-h.top+"px",n.style.cssText="top:"+C+";left:"+T+";",n}},{key:"scrollToElement",value:function(e,t){e.scrollIntoView();var n=t;if(n&&("function"==typeof n&&(n=t()),n>0)){var i=window.pageYOffset;i&&window.scroll(0,i-n)}}}]),t}();t["default"]=l}).call(t,function(){return this}())},function(e,t,n){(function(e){"use strict";function i(e){return e&&e.__esModule?e:{"default":e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n0?this.widgets[this.widgets.length-1]:null}},{key:"_checkFixedNeeded",value:function(){var e=this;if(0!==this.widgets.length){var t=new Set(this.widgets),n=Array.from(t).some(function(t){var n=t.widget;return e.fixedScreenConstraints[n]&&e.fixedScreenConstraints[n](e.windowWidth)});n?this._addFixedContainer():this._removeFixedContainer()}}},{key:"_addFixedContainer",value:function(){var t=this;if(!this.isFixedWindowActive){h["default"].dispatchAndFire(e.document,g,{detail:this.getCurrentWidget()}),u["default"].get().scrollbarUpdateNodes.map(function(t){var n="paddingRight",i=1,r=t;if(t instanceof Array){var o=a(t,3),s=o[0],l=o[1],d=o[2];n=l,r=s,i=d||1}return{node:r,property:n,value:parseInt(e.getComputedStyle(r)[n],10)+(r.__fixedWindowMod__?0:u["default"].getScrollbarWidth()*i)+"px"}}).forEach(function(e){e.node.__fixedWindowMod__=!0,e.node.style[e.property]=e.value}),this.touchListener=function(e){e.preventDefault()};var n=!1;this.touchStartListener=function(e){var i=t.getCurrentWidget(),r=i.element;p["default"].isPartOfNode(e.target,r)&&(0===r.scrollTop?(r.scrollTop=1,n=!0):r.scrollHeight===r.scrollTop+r.offsetHeight&&(n=!0,r.scrollTop-=1))},e.addEventListener("touchmove",this.touchListener),e.document.body.addEventListener("touchstart",this.touchStartListener),this.touchMoveListener=function(e){var i=t.getCurrentWidget(),r=i.element;p["default"].isPartOfNode(e.target,r)&&(n||e.stopImmediatePropagation(),n=!1)},e.document.body.addEventListener("touchmove",this.touchMoveListener),e.document.documentElement.classList.add(m),this.isFixedWindowActive=!0}}},{key:"_removeFixedContainer",value:function(){this.isFixedWindowActive&&(e.removeEventListener("touchmove",this.touchListener),e.document.body.removeEventListener("touchstart",this.touchStartListener),e.document.body.removeEventListener("touchmove",this.touchMoveListener),u["default"].get().scrollbarUpdateNodes.forEach(function(e){if(e instanceof Array){var t=a(e,2),n=t[0],i=t[1];delete n.__fixedWindowMod__,n.style[i]=""}else delete e.__fixedWindowMod__,e.style.paddingRight=""}),e.document.documentElement.classList.remove(m),h["default"].dispatchAndFire(e.document,y),this.isFixedWindowActive=!1)}},{key:"resizeListener",value:function(){this.windowWidth=e.innerWidth,this._checkFixedNeeded()}},{key:"close",value:function(){this.widgets.pop(),0===this.widgets.length&&(this._removeFixedContainer(),resolve())}},{key:"open",value:function(e,t){var n=!1;if("object"===("undefined"==typeof e?"undefined":o(e))){var i=e.constructor,r=this.fixedScreenConstraints[e.constructor];i&&r&&(n=r(this.windowWidth));var a=this.widgets.length;this.widgets.push({widget:i,element:t}),0===a&&n&&this._addFixedContainer()}}}],[{key:"getInstance",value:function(){if(!E){E=new t,E.windowWidth=e.innerWidth;var n=E.resizeListener.bind(E);e.addEventListener("resize",(0,c["default"])(n,500)),e.addEventListener("orientationchange",n)}return E}}]),t}();t["default"]=_}).call(t,function(){return this}())},function(e,t,n){(function(e){"use strict";function i(e){return e&&e.__esModule?e:{"default":e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0}),t.EVENT_MODAL_ASYNC_TARGET_LOADED=t.EVENT_MODAL_INIT=t.EVENT_MODAL_OPENED=t.EVENT_MODAL_BEFORE_CLOSED=t.EVENT_MODAL_CLOSED=void 0;var o=function(){function e(e,t){for(var n=0;n-1&&(t._modalInstances.splice(n,1),p["default"].getInstance().close(),m.classList.remove(O))}},{key:"getModalContainer",value:function(){return this.modalContainer}},{key:"close",value:function(e){var n=this,i=n.currentOpen?c["default"].applyOptionsFromElement(n.currentOpen,c["default"].copy(n.options)):n.options;if(!i.closeOnEscape&&e instanceof KeyboardEvent)return!1;if(!i.closeOnBackgroundClick&&e&&e.type===s["default"].getTabEvent()&&!e.target.hasAttribute(E))return!1;if(n.loading)return!1;if(e&&e.preventDefault(),n.currentOpen){var r=u["default"].dispatchAndFire(n.currentOpen,F);if(r.defaultPrevented)return!1;if(this._finishState(n.currentOpen),n.currentOpen.prevModal)return n.switchModals(n.currentOpen.prevModal,n.currentOpen.prevModal.prevModal||null);u["default"].dispatch(n.currentOpen,x).withOriginal(e).fire()}if(n._removeModalFromStack(n.currentOpen),n.currentOpen=null,n.modalContainer){var o=t._modalInstances[t._modalInstances.length-1],a=n.modalContainer.classList;a.remove(b),a.remove(C);for(var l=0;l '+e},inputErrorClass:"invalid",containerErrorClass:"form-error",fetchOptions:{credentials:"include"},tooltipContainer:e,tooltipOptions:{containerClass:"error-tooltip"},scrollToElementDiff:0},Object.assign(i.options,t),v["default"].applyOptionsFromElement(e,i.options),e.hfWidgetInstance=i,i._validators=n.globalValidators,i._remoteValidationFunction=null,i.initFormValidation(),i}return a(n,t),s(n,[{key:"destroy",value:function(){l(Object.getPrototypeOf(n.prototype),"destroy",this).call(this),this.tooltips&&this.tooltips.destroy()}},{key:"_submitFunction",value:function(e,t){var i=e.getAttribute(b),r=e.getAttribute(C)||e.getAttribute("action")||window.location.href,o=F===i,a=this,s=f["default"].dispatch(e,P).withOriginal(t).fire();if(s.defaultPrevented)return a._formStopLoading(),!1;if(null===i)return e.submit();t.preventDefault();var l={"X-Requested-With":"XMLHttpRequest"};o&&Object.assign(l,{"Content-Type":this.options.ajaxJsonContentType});var u=Object.assign(this.options.fetchOptions,{headers:l,method:this.options.ajaxSubmitType}),d=o?fetch(r,Object.assign(u,{body:JSON.stringify(this.serialize())})):fetch(r,Object.assign(u,{body:new FormData(e)}));return f["default"].dispatch(e,V).withOriginal(t).fire(),d.then(function(i){(a._remoteValidationFunction||n.globalRemoteValidationFunction).apply(a,[i]),f["default"].dispatch(e,j).withOriginal(t).withDetail({response:i}).fire(),a._formStopLoading()})}},{key:"serialize",value:function(){var e=['input[name]:not([type="radio"]):enabled','input[type="radio"][name]:checked',"select[name]:enabled","textarea[name]:enabled"],t=this.form.querySelectorAll(e.join(",")),n={};return Array.prototype.forEach.call(t,function(e){var t=n[e.name],i=e.value;t instanceof Array?t.push(i):t?n[e.name]=[n[e.name],i]:n[e.name]=i}),n}},{key:"handleValidation",value:function(e,t){var n=this,i=e instanceof Array||e instanceof NodeList?e:[e];return this._handleValidation(i,t,!0).then(function(e){return e.foundAnyError||n.tooltips&&n.tooltips.removeTooltip(),e}.bind(this))}},{key:"_handleValidation",value:function(e,t,i){var r=this,o=n._createArrayFromInvalidFieldList(e),a=o.length>0;a&&t&&r._focusElement(o[0]);var s=i?this._customValidationsForElements(e):r.validateCustomFields();return s.then(function(n){a&&(n.foundAnyError=!0);var s=i?e:Array.from(o).concat(n.checkedFields);n.checkedFields=s;var l=r.prepareErrors(s,!1),u=l[0];return u&&(t?(r._focusElement(u),document.activeElement!==u&&r._handleTooltipHideClickAfterChange()):r._handleTooltipHideClickAfterChange(),r.showAndOrCreateTooltip(u)),n})}},{key:"_setupErrorMessages",value:function(e,t){return n.globalErrorMessageHandler?n.globalErrorMessageHandler.apply(this,[e,t]):!1}},{key:"_handleLabels",value:function(e){Object.keys(e).forEach(function(t){var n=this.getForm().querySelectorAll('[for="'+t+'"]'),i=e[t];if(n.length)for(var r=0;r0&&e.offsetHeight>0}},{key:"dashToCamelCase",value:function(e){return e.replace(/-([a-z])/g,function(e){return e[1].toUpperCase()})}},{key:"copy",value:function(e){return JSON.parse(JSON.stringify(e))}},{key:"applyOptionsFromElement",value:function(e,n){if(!e)return n;for(var i=e.attributes,r=0;rh.width,b=n.classList;b.remove(a),b.remove(o),b.remove(s);var C=void 0,T=void 0;if(y&&!_)T=c.left-h.left-d+"px",b.add(o);else{var w=p-f.width-h.left-d+"px",O=(E+c.width/2-f.width/2||0)-h.left,L=O+f.width>h.width;r&&!L?T=O+"px":(b.add(a),T=w)}return g||l&&!m?(C=v-f.height-h.top+"px",b.add(s)):C=v+c.height-h.top+"px",n.style.cssText="top:"+C+";left:"+T+";",n}},{key:"scrollToElement",value:function(e,t){e.scrollIntoView();var n=t;if(n&&("function"==typeof n&&(n=t()),n>0)){var i=window.pageYOffset;i&&window.scroll(0,i-n)}}}]),t}();t["default"]=l}).call(t,function(){return this}())},function(e,t,n){(function(e){"use strict";function i(e){return e&&e.__esModule?e:{"default":e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n0?this.widgets[this.widgets.length-1]:null}},{key:"_checkFixedNeeded",value:function(){var e=this;if(0!==this.widgets.length){var t=new Set(this.widgets),n=Array.from(t).some(function(t){var n=t.widget;return e.fixedScreenConstraints[n]&&e.fixedScreenConstraints[n](e.windowWidth)});n?this._addFixedContainer():this._removeFixedContainer()}}},{key:"_addFixedContainer",value:function(){var t=this;if(!this.isFixedWindowActive){h["default"].dispatchAndFire(e.document,g,{detail:this.getCurrentWidget()}),u["default"].get().scrollbarUpdateNodes.map(function(t){var n="paddingRight",i=1,r=t;if(t instanceof Array){var o=a(t,3),s=o[0],l=o[1],d=o[2];n=l,r=s,i=d||1}return{node:r,property:n,value:parseInt(e.getComputedStyle(r)[n],10)+(r.__fixedWindowMod__?0:u["default"].getScrollbarWidth()*i)+"px"}}).forEach(function(e){e.node.__fixedWindowMod__=!0,e.node.style[e.property]=e.value}),this.touchListener=function(e){e.preventDefault()};var n=!1;this.touchStartListener=function(e){var i=t.getCurrentWidget(),r=i.element;p["default"].isPartOfNode(e.target,r)&&(0===r.scrollTop?(r.scrollTop=1,n=!0):r.scrollHeight===r.scrollTop+r.offsetHeight&&(n=!0,r.scrollTop-=1))},e.addEventListener("touchmove",this.touchListener),e.document.body.addEventListener("touchstart",this.touchStartListener),this.touchMoveListener=function(e){var i=t.getCurrentWidget(),r=i.element;p["default"].isPartOfNode(e.target,r)&&(n||e.stopImmediatePropagation(),n=!1)},e.document.body.addEventListener("touchmove",this.touchMoveListener),e.document.documentElement.classList.add(m),this.isFixedWindowActive=!0}}},{key:"_removeFixedContainer",value:function(){this.isFixedWindowActive&&(e.removeEventListener("touchmove",this.touchListener),e.document.body.removeEventListener("touchstart",this.touchStartListener),e.document.body.removeEventListener("touchmove",this.touchMoveListener),u["default"].get().scrollbarUpdateNodes.forEach(function(e){if(e instanceof Array){var t=a(e,2),n=t[0],i=t[1];delete n.__fixedWindowMod__,n.style[i]=""}else delete e.__fixedWindowMod__,e.style.paddingRight=""}),e.document.documentElement.classList.remove(m),h["default"].dispatchAndFire(e.document,y),this.isFixedWindowActive=!1)}},{key:"resizeListener",value:function(){this.windowWidth=e.innerWidth,this._checkFixedNeeded()}},{key:"close",value:function(){this.widgets.pop(),0===this.widgets.length&&this._removeFixedContainer()}},{key:"open",value:function(e,t){var n=!1;if("object"===("undefined"==typeof e?"undefined":o(e))){var i=e.constructor,r=this.fixedScreenConstraints[e.constructor];i&&r&&(n=r(this.windowWidth));var a=this.widgets.length;this.widgets.push({widget:i,element:t}),0===a&&n&&this._addFixedContainer()}}}],[{key:"getInstance",value:function(){if(!E){E=new t,E.windowWidth=e.innerWidth;var n=E.resizeListener.bind(E);e.addEventListener("resize",(0,c["default"])(n,500)),e.addEventListener("orientationchange",n)}return E}}]),t}();t["default"]=_}).call(t,function(){return this}())},function(e,t,n){(function(e){"use strict";function i(e){return e&&e.__esModule?e:{"default":e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0}),t.EVENT_MODAL_ASYNC_TARGET_LOADED=t.EVENT_MODAL_INIT=t.EVENT_MODAL_OPENED=t.EVENT_MODAL_BEFORE_CLOSED=t.EVENT_MODAL_CLOSED=void 0;var o=function(){function e(e,t){for(var n=0;n-1&&(t._modalInstances.splice(n,1),p["default"].getInstance().close(),m.classList.remove(O))}},{key:"getModalContainer",value:function(){return this.modalContainer}},{key:"close",value:function(e){var n=this,i=n.currentOpen?c["default"].applyOptionsFromElement(n.currentOpen,c["default"].copy(n.options)):n.options;if(!i.closeOnEscape&&e instanceof KeyboardEvent)return!1;if(!i.closeOnBackgroundClick&&e&&e.type===s["default"].getTabEvent()&&!e.target.hasAttribute(E))return!1;if(n.loading)return!1;if(e&&e.preventDefault(),n.currentOpen){var r=u["default"].dispatchAndFire(n.currentOpen,F);if(r.defaultPrevented)return!1;if(this._finishState(n.currentOpen),n.currentOpen.prevModal)return n.switchModals(n.currentOpen.prevModal,n.currentOpen.prevModal.prevModal||null);u["default"].dispatch(n.currentOpen,x).withOriginal(e).fire()}if(n._removeModalFromStack(n.currentOpen),n.currentOpen=null,n.modalContainer){var o=t._modalInstances[t._modalInstances.length-1],a=n.modalContainer.classList;a.remove(b),a.remove(C);for(var l=0;l '+e},inputErrorClass:"invalid",containerErrorClass:"form-error",fetchOptions:{credentials:"include"},tooltipContainer:e,tooltipOptions:{containerClass:"error-tooltip"},scrollToElementDiff:0},Object.assign(i.options,t),v["default"].applyOptionsFromElement(e,i.options),e.hfWidgetInstance=i,i._validators=n.globalValidators,i._remoteValidationFunction=null,i.initFormValidation(),i}return a(n,t),s(n,[{key:"destroy",value:function(){l(Object.getPrototypeOf(n.prototype),"destroy",this).call(this),this.tooltips&&this.tooltips.destroy()}},{key:"_submitFunction",value:function(e,t){var i=e.getAttribute(b),r=e.getAttribute(C)||e.getAttribute("action")||window.location.href,o=F===i,a=this,s=f["default"].dispatch(e,P).withOriginal(t).fire();if(s.defaultPrevented)return a._formStopLoading(),!1;if(null===i)return e.submit();t.preventDefault();var l={"X-Requested-With":"XMLHttpRequest"};o&&Object.assign(l,{"Content-Type":this.options.ajaxJsonContentType});var u=Object.assign(this.options.fetchOptions,{headers:l,method:this.options.ajaxSubmitType}),d=o?fetch(r,Object.assign(u,{body:JSON.stringify(this.serialize())})):fetch(r,Object.assign(u,{body:new FormData(e)}));return f["default"].dispatch(e,V).withOriginal(t).fire(),d.then(function(i){(a._remoteValidationFunction||n.globalRemoteValidationFunction).apply(a,[i]),f["default"].dispatch(e,j).withOriginal(t).withDetail({response:i}).fire(),a._formStopLoading()})}},{key:"serialize",value:function(){var e=['input[name]:not([type="radio"]):enabled','input[type="radio"][name]:checked',"select[name]:enabled","textarea[name]:enabled"],t=this.form.querySelectorAll(e.join(",")),n={};return Array.prototype.forEach.call(t,function(e){var t=n[e.name],i=e.value;t instanceof Array?t.push(i):t?n[e.name]=[n[e.name],i]:n[e.name]=i}),n}},{key:"handleValidation",value:function(e,t){var n=this,i=e instanceof Array||e instanceof NodeList?e:[e];return this._handleValidation(i,t,!0).then(function(e){return e.foundAnyError||n.tooltips&&n.tooltips.removeTooltip(),e}.bind(this))}},{key:"_handleValidation",value:function(e,t,i){var r=this,o=n._createArrayFromInvalidFieldList(e),a=o.length>0;a&&t&&r._focusElement(o[0]);var s=i?this._customValidationsForElements(e):r.validateCustomFields();return s.then(function(n){a&&(n.foundAnyError=!0);var s=i?e:Array.from(o).concat(n.checkedFields);n.checkedFields=s;var l=r.prepareErrors(s,!1),u=l[0];return u&&(t?(r._focusElement(u),document.activeElement!==u&&r._handleTooltipHideClickAfterChange()):r._handleTooltipHideClickAfterChange(),r.showAndOrCreateTooltip(u)),n})}},{key:"_setupErrorMessages",value:function(e,t){return n.globalErrorMessageHandler?n.globalErrorMessageHandler.apply(this,[e,t]):!1}},{key:"_handleLabels",value:function(e){Object.keys(e).forEach(function(t){var n=this.getForm().querySelectorAll('[for="'+t+'"]'),i=e[t];if(n.length)for(var r=0;ro;o++){var a=e[o],s=a.getAttribute(O),l=a.validity;if(this._validators[s]){if(n._shouldNotValidateField(a)||l&&!l.customError&&!l.valid)continue;r.push(a),t.push(this._runValidation(s,a))}else s&&console.warn("data-validate was set but no validator was found")}return Promise.all(t).then(function(e){for(var t=e.length,n={checkedFields:r,foundAnyError:!1},i=0;t>i;i++)if(!e[i]){n.foundAnyError=!0;break}return n})}},{key:"removeErrors",value:function(){return this._removeElementErrors(this.form),this.tooltips&&this.tooltips.removeTooltip(),this}},{key:"prepareErrors",value:function(e,t){function i(e,t,n){var i=n.getAttribute(k)||n.id,r=t[i];i&&(r=r?r:e,t[i]=r)}t&&this.removeErrors();for(var r={},o=[],a=0;a'+f+""),o.push(s),s.flexFormsSavedValidationMessage=f}else this._markElementValid(l),this._markElementValid(s),delete s.flexFormsSavedValidationMessage,this._removeElementErrors(u);s.setCustomValidity("")}}if(1===e.length){var h=e[0],v=h.getAttribute(k)||h.id;if(v){var p=Array.from(this.getForm().querySelectorAll("["+k+'="'+v+'"], #'+v));p.forEach(function(e){var t=e.validity,n=t&&!t.valid&&this._isElementInvalidElement(e);i(n,r,e)}.bind(this))}}return this._handleLabels(r),o}},{key:"validateCustomFields",value:function(){return this._customValidationsForElements(this.form.querySelectorAll("[data-validate]"))}},{key:"getForm",value:function(){return this.form}},{key:"registerRemoteValidation",value:function(e){return this._remoteValidationFunction=e,this}},{key:"_formatErrorTooltip",value:function(e){return this.options.formatErrorTooltip.apply(this,[e])}},{key:"showAndOrCreateTooltip",value:function(e,t){var i=this;if(!this.tooltips&&this.options.createTooltips&&(this.tooltips=new d["default"](this.options.tooltipContainer,this.options.tooltipOptions)),!this.options.createTooltips)return!1;if(!e.flexFormsSavedValidity)return!1;var r=n._findErrorTarget(e);return!e.flexFormsSavedValidity.valid&&i._isElementInvalidElement(r)?(i.tooltips.createTooltip(r,i._formatErrorTooltip(e.flexFormsSavedValidationMessage),!1),!0):(t&&i.tooltips.removeTooltip(),!1)}},{key:"_isElementInvalidElement",value:function(e){return e.hasAttribute(_)}},{key:"_checkIsInvalid",value:function(e){e.preventDefault();var t=this.getForm().querySelectorAll(":invalid");return this._handleValidation(t,!0,!1)}},{key:"_getDependentFields",value:function(e){var t=e.getAttribute(x),n=[e];return t&&n.push.apply(n,Array.prototype.slice.apply(this.getForm().querySelectorAll(t))),n}},{key:"_handleTooltipInline",value:function(e){this.tooltips&&this.tooltips.removeTooltip(e)}},{key:"initFormValidation",value:function(){function e(e){return!e.hasAttribute(w)&&!e.hasAttribute(T)}function t(){u=!1,clearTimeout(l)}function n(e){var t=e.getAttribute("type");return"radio"!==t&&"checkbox"!==t&&"submit"!==t}function i(e){return!e.hasAttribute(T)}var r=this,o=this.getForm(),a=this,s="invalid";o.addEventListener(s,function(e){e.preventDefault()},!0),v["default"].addEventOnce(s,o,function d(e){a._formLoading();var t=a._checkIsInvalid(e);t&&(a.currentValidationFuture=new Promise(function(n){t.then(function(t){setTimeout(function(){v["default"].addEventOnce(s,o,d,!0)},0),n(t),a._formStopLoading(),t.foundAnyError||(a._formLoading(),a._handleSubmit(e))})}))},!0),this.addEventListener(o,"reset",function(){r.removeErrors()});var l,u=!1;a.options.realtime&&this.addEventListener(o,I,function(t){if(!a._formIsLoading()){var n=t.target;clearTimeout(l),u||(l=setTimeout(function(){var i=document.activeElement===t.target;if(e(n)){i&&a._handleTooltipInline(),u=!0;var r=a._getDependentFields(n);a._customValidationsForElements(r).then(function(){a.prepareErrors(r,!1),i&&a.showAndOrCreateTooltip(t.target),u=!1})}},a.options.realtimeTimeout))}},!0),this.addEventListener(o,"blur",function(e){e.target.flexcssKeepTooltips||a._handleTooltipInline(e.target),delete e.target.flexcssKeepTooltips},!0),this.addEventListener(o,"focus",function(e){a._formIsLoading()||n(e.target)&&setTimeout(function(){a.showAndOrCreateTooltip(e.target)},N)},!0),a.options.inlineValidation&&this.addEventListener(o,"change",function(e){var n=e.target;if(!a._formIsLoading()&&i(n)){t();var r=n.getAttribute("name"),s=r?o.querySelectorAll('[name="'+r+'"]'):[n];1===s.length&&(s=a._getDependentFields(n)),a._customValidationsForElements(s).then(function(){a.prepareErrors(s,!1),n.flexcssKeepTooltips=a.showAndOrCreateTooltip(n,!0),n.flexcssKeepTooltips&&a._handleTooltipHideClickAfterChange()})}}),this.addEventListener(o,"submit",function c(e){a._submitListener(e,c)}),f["default"].dispatchAndFire(o,M)}},{key:"_formLoading",value:function(){this.getForm().classList.add(E)}},{key:"_formStopLoading",value:function(){this.getForm().classList.remove(E)}},{key:"_formIsLoading",value:function(){return this.getForm().classList.contains(E)}},{key:"_handleTooltipHideClickAfterChange",value:function(){var t=this;this.options.createTooltips&&setTimeout(function(){v["default"].addEventOnce(m["default"].getTabEvent(),e.document.body,function(e){t._isElementInvalidElement(e.target)||t._handleTooltipInline()})},D)}},{key:"_focusElement",value:function(e){e.focus(),v["default"].scrollToElement(e,this.options.scrollToElementDiff)}},{key:"_submitListener",value:function(e,t){var n=this.getForm(),i=this,r="submit";return this._formIsLoading()?(e.preventDefault(),!1):(this._formLoading(),n.removeEventListener(r,t),this.removeErrors(),e.preventDefault(),void(n.checkValidity()?(n.addEventListener(r,t),i.currentValidationFuture=new Promise(function(e){var t=i.validateCustomFields();t.then(function(t){var n=i._getInvalidElements(),r=i.prepareErrors(n,!1),o=r[0];o&&(i._focusElement(o),i.showAndOrCreateTooltip(o,!0)),e(t)})}),i.currentValidationFuture.then(function(t){t.foundAnyError?i._formStopLoading():i._handleSubmit(e)})):(i._formStopLoading(),n.addEventListener(r,t))))}},{key:"_handleSubmit",value:function(e){this._submitFunction(this.form,e)}}],[{key:"_shouldNotValidateField",value:function(e){var t=n._findErrorTarget(e);return t instanceof HTMLFieldSetElement||void 0===e.validity||t.hasAttribute(S)&&!v["default"].isVisible(t)}},{key:"_createArrayFromInvalidFieldList",value:function(e){for(var t=[],i=0;i-1?t:e}function d(e,t){t=t||{};var n=t.body;if(d.prototype.isPrototypeOf(e)){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new i(e.headers)),this.method=e.method,this.mode=e.mode,n||(n=e._bodyInit,e.bodyUsed=!0)}else this.url=e;if(this.credentials=t.credentials||this.credentials||"omit",!t.headers&&this.headers||(this.headers=new i(t.headers)),this.method=u(t.method||this.method||"GET"),this.mode=t.mode||this.mode||null,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&n)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(n)}function c(e){var t=new FormData;return e.trim().split("&").forEach(function(e){if(e){var n=e.split("="),i=n.shift().replace(/\+/g," "),r=n.join("=").replace(/\+/g," ");t.append(decodeURIComponent(i),decodeURIComponent(r))}}),t}function f(e){var t=new i,n=e.getAllResponseHeaders().trim().split("\n");return n.forEach(function(e){var n=e.trim().split(":"),i=n.shift().trim(),r=n.join(":").trim();t.append(i,r)}),t}function h(e,t){t||(t={}),this.type="default",this.status=t.status,this.ok=this.status>=200&&this.status<300,this.statusText=t.statusText,this.headers=t.headers instanceof i?t.headers:new i(t.headers),this.url=t.url||"",this._initBody(e)}if(!e.fetch){i.prototype.append=function(e,i){e=t(e),i=n(i);var r=this.map[e];r||(r=[],this.map[e]=r),r.push(i)},i.prototype["delete"]=function(e){delete this.map[t(e)]},i.prototype.get=function(e){var n=this.map[t(e)];return n?n[0]:null},i.prototype.getAll=function(e){return this.map[t(e)]||[]},i.prototype.has=function(e){return this.map.hasOwnProperty(t(e))},i.prototype.set=function(e,i){this.map[t(e)]=[n(i)]},i.prototype.forEach=function(e,t){Object.getOwnPropertyNames(this.map).forEach(function(n){this.map[n].forEach(function(i){e.call(t,i,n,this)},this)},this)};var v={blob:"FileReader"in e&&"Blob"in e&&function(){try{return new Blob,!0}catch(e){return!1}}(),formData:"FormData"in e,arrayBuffer:"ArrayBuffer"in e},p=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];d.prototype.clone=function(){return new d(this)},l.call(d.prototype),l.call(h.prototype),h.prototype.clone=function(){return new h(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new i(this.headers),url:this.url})},h.error=function(){var e=new h(null,{status:0,statusText:""});return e.type="error",e};var m=[301,302,303,307,308];h.redirect=function(e,t){if(-1===m.indexOf(t))throw new RangeError("Invalid status code");return new h(null,{status:t,headers:{location:e}})},e.Headers=i,e.Request=d,e.Response=h,e.fetch=function(e,t){return new Promise(function(n,i){function r(){return"responseURL"in a?a.responseURL:/^X-Request-URL:/m.test(a.getAllResponseHeaders())?a.getResponseHeader("X-Request-URL"):void 0}var o;o=d.prototype.isPrototypeOf(e)&&!t?e:new d(e,t);var a=new XMLHttpRequest;a.onload=function(){var e=1223===a.status?204:a.status;if(100>e||e>599)return void i(new TypeError("Network request failed"));var t={status:e,statusText:a.statusText,headers:f(a),url:r()},o="response"in a?a.response:a.responseText;n(new h(o,t))},a.onerror=function(){i(new TypeError("Network request failed"))},a.open(o.method,o.url,!0),"include"===o.credentials&&(a.withCredentials=!0),"responseType"in a&&v.blob&&(a.responseType="blob"),o.headers.forEach(function(e,t){a.setRequestHeader(t,e)}),a.send("undefined"==typeof o._bodyInit?null:o._bodyInit)})},e.fetch.polyfill=!0}}("undefined"!=typeof self?self:this)},function(e,t,n){(function(e){"use strict";function i(e){return e&&e.__esModule?e:{"default":e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0}),t.EVENT_DROPDOWN_CLOSED=void 0;var o=function(){function e(e,t){for(var n=0;nl)["catch"](function(){r._runOptionalClose()})}}),r._keyboardNextEvent=function(e){if(e.keyCode===C||e.keyCode===T){if(r.isLoading())return;r.switchImageByDirection(e.keyCode===T)["catch"](function(){r._runOptionalClose()})}},e.addEventListener("keydown",r._keyboardNextEvent)):r._imageContainer.addEventListener(d["default"].getTabEvent(),function(){r._runOptionalClose()}),r.highRes(o,a)})}),i._future.then(function(){r._calculateContainer(i.img)}),r._modalContainerDiv.addEventListener(s.EVENT_MODAL_CLOSED,function(){i._modalContainerDiv.parentNode.removeChild(i._modalContainerDiv),i.options.onClose.apply(r),i._isOpen=!1,i.modal.destroy(),i._keyboardNextEvent&&e.removeEventListener("keydown",r._keyboardNextEvent),i._resizeEvent&&e.removeEventListener("resize",r._resizeEvent)}),i._future}),this._nextFuture=this._future,r._widget?(this.modal=new l["default"](this._modalAppend),this.modal.close().fromWidget(r._widget).then(function(){return r._future.then(function(){return r})})):!1)):!1}}],[{key:"_setupMaxWidthHeight",value:function(e,t,n){var i=e.getAttribute(h),r=e.getAttribute(v);i&&r?(t.style.maxWidth=i+"px",t.style.maxHeight=r+"px"):(t.style.maxWidth=n.width+"px",t.style.maxHeight=n.height+"px")}}]),t}();t["default"]=O}).call(t,function(){return this}())},function(e,t,n){(function(e){"use strict";function i(e){return e&&e.__esModule?e:{"default":e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0}),t.EVENT_TOGGLE=void 0;var o=function(){function e(e,t){for(var n=0;n=s["default"].get().smallBreakpoint};if(!h||!f)throw new Error("Could not find needed elements (Darkener and/or NavigationId)");this.darkener=h,this.darkenerClassToggle=v,this.darkenerClassToggleInstant=p,this.globalToggleClass=s["default"].get().canvasToggledClass,this.navigationContainer=f,this.navigationContainerId=f.id,this.navigationContainerId||(this.navigationContainerId=u["default"].guid(),f.id=this.navigationContainerId),a||(f.addEventListener("touchstart",function(e){m()||(c=e.touches[0].clientX,f.mustHide=!1)}),f.addEventListener("touchmove",function(e){if(!m()){var t=e.touches[0].clientX,n=f,i=n.style,r=c-t,a=n.getBoundingClientRect(),s=o>0?0>=r:r>=0;if(s){i.transition="transform 0s ease",i.webkitTransition="-webkit-transform 0s ease",n.mustHide=o>0?-1*r>a.width/y:r>a.width/y;var l="translate3d("+-1*r+"px,0,0)";i.transform=l,i.webkitTransform=l}}}),f.addEventListener("touchend",function(){if(!m()){var e=f,t=e.style;if(e.mustHide){var n=e.getBoundingClientRect().width*o;t.transition="transform .2s ease",t.webkitTransition="-webkit-transform .2s ease";var i="translate3d("+n+"px,0,0)";t.transform=i,t.webkitTransform=i,l._remove().then(function(){l.resetTransform(t)}),l._removeInstant()}else l.resetTransform(t)}}))}return o(t,[{key:"resetTransform",value:function(e){e.transform="",e.transition="",e.webkitTransform="",e.webkitTransition=""}},{key:"_remove",value:function(n){var i=this;return new Promise(function(r){u["default"].addEventOnce(s["default"].getTransitionEvent(),i.navigationContainer,function o(i){var a=this;return i.target!==this.navigationContainer?u["default"].addEventOnce(s["default"].getTransitionEvent(),this.navigationContainer,o.bind(this)):void requestAnimationFrame(function(){t.currentOpen=null;var i=e.document.documentElement.classList;i.remove(a.darkenerClassToggle),i.remove(a.globalToggleClass),n&&c["default"].dispatchAndFire(a.navigationContainer,E),r()})}.bind(i))})}},{key:"_removeInstant",value:function(){this.navigationContainer.classList.remove(g),e.document.documentElement.classList.remove(this.darkenerClassToggleInstant),this.darkener.classList.remove(m),h["default"].getInstance().close()}},{key:"toggle",value:function(n){var i=this;n&&n.preventDefault(),this.resetTransform(this.navigationContainer.style);var r=this.darkener.classList,o=this.darkenerClassToggle,a=this.darkenerClassToggleInstant,l=this.navigationContainer.classList;if(t.currentOpen)return this.close(n);u["default"].addEventOnce(s["default"].getTransitionEvent(),this.navigationContainer,function(){n&&c["default"].dispatchAndFire(i.navigationContainer,E)}),t.currentOpen=this,h["default"].getInstance().open(this,this.navigationContainer);var d=e.document.documentElement.classList;d.add(this.globalToggleClass),d.add(a),d.add(o),r.add(m),l.add(g)}},{key:"close",value:function(e){if(this.navigationContainer.classList.contains(g)){var t=this._remove(e);return this._removeInstant(),t}return new Promise(function(e){return e()})}},{key:"registerEvents",value:function(n){var i=this,r=n||e.document;h["default"].getInstance().addScreenConstraint(t,function(e){return e0&&e.offsetHeight>0}},{key:"dashToCamelCase",value:function(e){return e.replace(/-([a-z])/g,function(e){return e[1].toUpperCase()})}},{key:"copy",value:function(e){return JSON.parse(JSON.stringify(e))}},{key:"applyOptionsFromElement",value:function(e,n){if(!e)return n;for(var i=e.attributes,o=0;oh.width,C=n.classList;C.remove(a),C.remove(r),C.remove(s);var S=void 0,O=void 0;if(E&&!_)O=c.left-h.left-d+"px",C.add(r);else{var b=m-f.width-h.left-d+"px",w=(g+c.width/2-f.width/2||0)-h.left,L=w+f.width>h.width;o&&!L?O=w+"px":(C.add(a),O=b)}return y||l&&!p?(S=v-f.height-h.top+"px",C.add(s)):S=v+c.height-h.top+"px",n.style.cssText="top:"+S+";left:"+O+";",n}},{key:"scrollToElement",value:function(e,t){e.scrollIntoView();var n=t;if(n&&("function"==typeof n&&(n=t()),n>0)){var i=window.pageYOffset;i&&window.scroll(0,i-n)}}}]),t}();t["default"]=l}).call(t,function(){return this}())},function(e,t,n){(function(e){"use strict";function i(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n0?this.widgets[this.widgets.length-1]:null}},{key:"_checkFixedNeeded",value:function(){var e=this;if(0!==this.widgets.length){var t=new Set(this.widgets),n=Array.from(t).some(function(t){var n=t.widget;return e.fixedScreenConstraints[n]&&e.fixedScreenConstraints[n](e.windowWidth)});n?this._addFixedContainer():this._removeFixedContainer()}}},{key:"_addFixedContainer",value:function(){var t=this;if(!this.isFixedWindowActive){h["default"].dispatchAndFire(e.document,y,{detail:this.getCurrentWidget()}),u["default"].get().scrollbarUpdateNodes.map(function(t){var n="paddingRight",i=1,o=t;if(t instanceof Array){var r=a(t,3),s=r[0],l=r[1],d=r[2];n=l,o=s,i=d||1}return{node:o,property:n,value:parseInt(e.getComputedStyle(o)[n],10)+(o.__fixedWindowMod__?0:u["default"].getScrollbarWidth()*i)+"px"}}).forEach(function(e){e.node.__fixedWindowMod__=!0,e.node.style[e.property]=e.value}),this.touchListener=function(e){e.preventDefault()};var n=!1;this.touchStartListener=function(e){var i=t.getCurrentWidget(),o=i.element;m["default"].isPartOfNode(e.target,o)&&(0===o.scrollTop?(o.scrollTop=1,n=!0):o.scrollHeight===o.scrollTop+o.offsetHeight&&(n=!0,o.scrollTop-=1))},e.addEventListener("touchmove",this.touchListener),e.document.body.addEventListener("touchstart",this.touchStartListener),this.touchMoveListener=function(e){var i=t.getCurrentWidget(),o=i.element;m["default"].isPartOfNode(e.target,o)&&(n||e.stopImmediatePropagation(),n=!1)},e.document.body.addEventListener("touchmove",this.touchMoveListener),e.document.documentElement.classList.add(p),this.isFixedWindowActive=!0}}},{key:"_removeFixedContainer",value:function(){this.isFixedWindowActive&&(e.removeEventListener("touchmove",this.touchListener),e.document.body.removeEventListener("touchstart",this.touchStartListener),e.document.body.removeEventListener("touchmove",this.touchMoveListener),u["default"].get().scrollbarUpdateNodes.forEach(function(e){if(e instanceof Array){var t=a(e,2),n=t[0],i=t[1];delete n.__fixedWindowMod__,n.style[i]=""}else delete e.__fixedWindowMod__,e.style.paddingRight=""}),e.document.documentElement.classList.remove(p),h["default"].dispatchAndFire(e.document,E),this.isFixedWindowActive=!1)}},{key:"resizeListener",value:function(){this.windowWidth=e.innerWidth,this._checkFixedNeeded()}},{key:"close",value:function(){this.widgets.pop(),0===this.widgets.length&&(this._removeFixedContainer(),resolve())}},{key:"open",value:function(e,t){var n=!1;if("object"===("undefined"==typeof e?"undefined":r(e))){var i=e.constructor,o=this.fixedScreenConstraints[e.constructor];i&&o&&(n=o(this.windowWidth));var a=this.widgets.length;this.widgets.push({widget:i,element:t}),0===a&&n&&this._addFixedContainer()}}}],[{key:"getInstance",value:function(){if(!g){g=new t,g.windowWidth=e.innerWidth;var n=g.resizeListener.bind(g);e.addEventListener("resize",(0,c["default"])(n,500)),e.addEventListener("orientationchange",n)}return g}}]),t}();t["default"]=_}).call(t,function(){return this}())},function(e,t,n){(function(e){"use strict";function i(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0}),t.EVENT_MODAL_ASYNC_TARGET_LOADED=t.EVENT_MODAL_INIT=t.EVENT_MODAL_OPENED=t.EVENT_MODAL_BEFORE_CLOSED=t.EVENT_MODAL_CLOSED=void 0;var r=function(){function e(e,t){for(var n=0;n-1&&(t._modalInstances.splice(n,1),m["default"].getInstance().close(),p.classList.remove(w))}},{key:"getModalContainer",value:function(){return this.modalContainer}},{key:"close",value:function(e){var n=this,i=n.currentOpen?c["default"].applyOptionsFromElement(n.currentOpen,c["default"].copy(n.options)):n.options;if(!i.closeOnEscape&&e instanceof KeyboardEvent)return!1;if(!i.closeOnBackgroundClick&&e&&e.type===s["default"].getTabEvent()&&!e.target.hasAttribute(g))return!1;if(n.loading)return!1;if(e&&e.preventDefault(),n.currentOpen){var o=u["default"].dispatchAndFire(n.currentOpen,I);if(o.defaultPrevented)return!1;if(this._finishState(n.currentOpen),n.currentOpen.prevModal)return n.switchModals(n.currentOpen.prevModal,n.currentOpen.prevModal.prevModal||null);u["default"].dispatch(n.currentOpen,F).withOriginal(e).fire()}if(n._removeModalFromStack(n.currentOpen),n.currentOpen=null,n.modalContainer){var r=t._modalInstances[t._modalInstances.length-1],a=n.modalContainer.classList;a.remove(C),a.remove(S);for(var l=0;l0&&e.offsetHeight>0}},{key:"dashToCamelCase",value:function(e){return e.replace(/-([a-z])/g,function(e){return e[1].toUpperCase()})}},{key:"copy",value:function(e){return JSON.parse(JSON.stringify(e))}},{key:"applyOptionsFromElement",value:function(e,n){if(!e)return n;for(var i=e.attributes,o=0;oh.width,C=n.classList;C.remove(a),C.remove(r),C.remove(s);var S=void 0,O=void 0;if(E&&!_)O=c.left-h.left-d+"px",C.add(r);else{var b=m-f.width-h.left-d+"px",w=(g+c.width/2-f.width/2||0)-h.left,L=w+f.width>h.width;o&&!L?O=w+"px":(C.add(a),O=b)}return y||l&&!p?(S=v-f.height-h.top+"px",C.add(s)):S=v+c.height-h.top+"px",n.style.cssText="top:"+S+";left:"+O+";",n}},{key:"scrollToElement",value:function(e,t){e.scrollIntoView();var n=t;if(n&&("function"==typeof n&&(n=t()),n>0)){var i=window.pageYOffset;i&&window.scroll(0,i-n)}}}]),t}();t["default"]=l}).call(t,function(){return this}())},function(e,t,n){(function(e){"use strict";function i(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n0?this.widgets[this.widgets.length-1]:null}},{key:"_checkFixedNeeded",value:function(){var e=this;if(0!==this.widgets.length){var t=new Set(this.widgets),n=Array.from(t).some(function(t){var n=t.widget;return e.fixedScreenConstraints[n]&&e.fixedScreenConstraints[n](e.windowWidth)});n?this._addFixedContainer():this._removeFixedContainer()}}},{key:"_addFixedContainer",value:function(){var t=this;if(!this.isFixedWindowActive){h["default"].dispatchAndFire(e.document,y,{detail:this.getCurrentWidget()}),u["default"].get().scrollbarUpdateNodes.map(function(t){var n="paddingRight",i=1,o=t;if(t instanceof Array){var r=a(t,3),s=r[0],l=r[1],d=r[2];n=l,o=s,i=d||1}return{node:o,property:n,value:parseInt(e.getComputedStyle(o)[n],10)+(o.__fixedWindowMod__?0:u["default"].getScrollbarWidth()*i)+"px"}}).forEach(function(e){e.node.__fixedWindowMod__=!0,e.node.style[e.property]=e.value}),this.touchListener=function(e){e.preventDefault()};var n=!1;this.touchStartListener=function(e){var i=t.getCurrentWidget(),o=i.element;m["default"].isPartOfNode(e.target,o)&&(0===o.scrollTop?(o.scrollTop=1,n=!0):o.scrollHeight===o.scrollTop+o.offsetHeight&&(n=!0,o.scrollTop-=1))},e.addEventListener("touchmove",this.touchListener),e.document.body.addEventListener("touchstart",this.touchStartListener),this.touchMoveListener=function(e){var i=t.getCurrentWidget(),o=i.element;m["default"].isPartOfNode(e.target,o)&&(n||e.stopImmediatePropagation(),n=!1)},e.document.body.addEventListener("touchmove",this.touchMoveListener),e.document.documentElement.classList.add(p),this.isFixedWindowActive=!0}}},{key:"_removeFixedContainer",value:function(){this.isFixedWindowActive&&(e.removeEventListener("touchmove",this.touchListener),e.document.body.removeEventListener("touchstart",this.touchStartListener),e.document.body.removeEventListener("touchmove",this.touchMoveListener),u["default"].get().scrollbarUpdateNodes.forEach(function(e){if(e instanceof Array){var t=a(e,2),n=t[0],i=t[1];delete n.__fixedWindowMod__,n.style[i]=""}else delete e.__fixedWindowMod__,e.style.paddingRight=""}),e.document.documentElement.classList.remove(p),h["default"].dispatchAndFire(e.document,E),this.isFixedWindowActive=!1)}},{key:"resizeListener",value:function(){this.windowWidth=e.innerWidth,this._checkFixedNeeded()}},{key:"close",value:function(){this.widgets.pop(),0===this.widgets.length&&this._removeFixedContainer()}},{key:"open",value:function(e,t){var n=!1;if("object"===("undefined"==typeof e?"undefined":r(e))){var i=e.constructor,o=this.fixedScreenConstraints[e.constructor];i&&o&&(n=o(this.windowWidth));var a=this.widgets.length;this.widgets.push({widget:i,element:t}),0===a&&n&&this._addFixedContainer()}}}],[{key:"getInstance",value:function(){if(!g){g=new t,g.windowWidth=e.innerWidth;var n=g.resizeListener.bind(g);e.addEventListener("resize",(0,c["default"])(n,500)),e.addEventListener("orientationchange",n)}return g}}]),t}();t["default"]=_}).call(t,function(){return this}())},function(e,t,n){(function(e){"use strict";function i(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0}),t.EVENT_MODAL_ASYNC_TARGET_LOADED=t.EVENT_MODAL_INIT=t.EVENT_MODAL_OPENED=t.EVENT_MODAL_BEFORE_CLOSED=t.EVENT_MODAL_CLOSED=void 0;var r=function(){function e(e,t){for(var n=0;n-1&&(t._modalInstances.splice(n,1),m["default"].getInstance().close(),p.classList.remove(w))}},{key:"getModalContainer",value:function(){return this.modalContainer}},{key:"close",value:function(e){var n=this,i=n.currentOpen?c["default"].applyOptionsFromElement(n.currentOpen,c["default"].copy(n.options)):n.options;if(!i.closeOnEscape&&e instanceof KeyboardEvent)return!1;if(!i.closeOnBackgroundClick&&e&&e.type===s["default"].getTabEvent()&&!e.target.hasAttribute(g))return!1;if(n.loading)return!1;if(e&&e.preventDefault(),n.currentOpen){var o=u["default"].dispatchAndFire(n.currentOpen,I);if(o.defaultPrevented)return!1;if(this._finishState(n.currentOpen),n.currentOpen.prevModal)return n.switchModals(n.currentOpen.prevModal,n.currentOpen.prevModal.prevModal||null);u["default"].dispatch(n.currentOpen,F).withOriginal(e).fire()}if(n._removeModalFromStack(n.currentOpen),n.currentOpen=null,n.modalContainer){var r=t._modalInstances[t._modalInstances.length-1],a=n.modalContainer.classList;a.remove(C),a.remove(S);for(var l=0;l\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n/*!\n * FlexCss.Form\n * Licensed under the MIT License (MIT)\n * Copyright (c) 2015 David Heidrich, BowlingX \n */\n\nimport Tooltip from './Tooltip';\nimport 'isomorphic-fetch';\nimport Event from './util/Event';\nimport Util from './util/Util';\nimport Settings from './util/Settings';\nimport DestroyableWidget from './DestroyableWidget';\n\nconst LOADING_CLASS = 'loading';\nconst DATA_ELEMENT_INVALID = 'data-flexcss-invalid';\nconst REMOTE = 'data-remote';\nconst REMOTE_ACTION = 'data-remote-action';\nconst ATTR_DISABLE_INLINE = 'data-disable-inline-validation';\nconst ATTR_DISABLE_REALTIME = 'data-disable-realtime-validation';\nconst ATTR_VALIDATOR = 'data-validate';\nconst ATTR_DATA_CUSTOM_MESSAGE = 'data-validation-message';\nconst ATTR_DATA_CUSTOM_LABEL = 'data-custom-label';\nconst ATTR_VALIDATE_VISIBILITY = 'data-validate-visibility';\nconst ATTR_ERROR_TARGET_ID = 'data-error-target';\nconst ATTR_DEPENDS = 'data-depends-selector';\nconst CONST_USE_JSON = 'json';\nconst CONST_REALTIME_EVENT = 'input';\nconst FOCUS_TOOLTIP_DELAY = 20;\nconst CLICK_TOOLTIP_DELAY = 150;\n\n/**\n * Triggered when form is fully initialized and handlers are binded\n * @type {string}\n */\nexport const EVENT_FORM_READY = 'flexcss.form.ready';\n/**\n * Fires when a form is submitted, cancelable\n * @type {string}\n */\nexport const EVENT_FORM_SUBMIT = 'flexcss.form.submit';\n/**\n * Fired directly after the form has been submitted via ajax\n * @type {string}\n */\nexport const EVENT_FORM_AFTER_AJAX_SUBMIT = 'flexcss.form.afterAjaxSubmit';\n/**\n * Fired when ajax events did complete\n * @type {string}\n */\nexport const EVENT_FORM_AJAX_COMPLETED = 'flexcss.form.ajaxCompleted';\n\n/**\n * A HTML5 Form Validation replacement\n */\n\nclass Form extends DestroyableWidget {\n /**\n * @param {HTMLElement} form\n * @param [options] optional options\n */\n constructor(form, options) {\n super();\n\n if (!(form instanceof HTMLFormElement)) {\n throw 'argument {0} form needs to be an form element';\n }\n\n /**\n * The Form\n * @type {HTMLElement}\n */\n this.form = form;\n\n /**\n * @type {Tooltip}\n */\n this.tooltips = null;\n\n /**\n * @type {Promise}\n */\n this.currentValidationFuture = new Promise(() => {\n });\n\n /**\n * Default options\n * @type {Object}\n */\n this.options = {\n // if true creates tooltips above element, uses FlexCss Tooltips\n createTooltips: true,\n // if true appends error message after input element\n appendError: false,\n // type of ajax submit\n ajaxSubmitType: 'POST',\n // json content type if ajax method is set to json\n ajaxJsonContentType: 'application/json; charset=utf-8',\n // allow inline validation\n inlineValidation: true,\n // validate in realtime (on `input` event)\n realtime: true,\n // timeout when realtime event should be captured\n realtimeTimeout: 250,\n // formatting method for an error\n formatErrorTooltip: (error) => {\n return ' ' + error;\n },\n // the class that will be put on the element to mark it failed validation\n inputErrorClass: 'invalid',\n // the container class for error messages below an element\n containerErrorClass: 'form-error',\n // additional options for fetch\n fetchOptions: {\n credentials: 'include'\n },\n // the container for tooltips\n tooltipContainer: form,\n tooltipOptions: {\n containerClass: 'error-tooltip'\n },\n // if you have a fixed header, either set a number or function here\n scrollToElementDiff: 0\n };\n\n // overwrite default options\n Object.assign(this.options, options);\n\n // apply settings from attributes\n Util.applyOptionsFromElement(form, this.options);\n\n // set form class as widget\n // Forms are very different to classical widgets,\n // we will not use our base widget class for this but just self\n form.hfWidgetInstance = this;\n\n /**\n * A List of Validators\n * @type {Object}\n * @private\n */\n this._validators = Form.globalValidators;\n\n /**\n * @type {Function}\n * @private\n */\n this._remoteValidationFunction = null;\n\n this.initFormValidation();\n }\n\n destroy() {\n super.destroy();\n if (this.tooltips) {\n this.tooltips.destroy();\n }\n }\n\n /**\n * Submits this form, either via ajax or just classical (default)\n * @param {HTMLFormElement} thisForm\n * @param {Event} e\n * @private\n * @returns {Promise|boolean} returns false if submit is cancled\n */\n _submitFunction(thisForm, e) {\n var shouldUseAjax = thisForm.getAttribute(REMOTE), ajaxPostUrl =\n thisForm.getAttribute(REMOTE_ACTION) ||\n thisForm.getAttribute('action') || window.location.href,\n useJson = CONST_USE_JSON === shouldUseAjax, self = this;\n\n var ev = Event.dispatch(thisForm, EVENT_FORM_SUBMIT).withOriginal(e).fire();\n\n // abort execution is event was prevented\n if (ev.defaultPrevented) {\n self._formStopLoading();\n return false;\n }\n\n if (shouldUseAjax === null) {\n // submit\n return thisForm.submit();\n }\n // prevent form from submit normally\n e.preventDefault();\n\n // add information that this is an XMLHttpRequest request (used by some frameworks)\n let defaultHeaders = {\n 'X-Requested-With': 'XMLHttpRequest'\n };\n\n // setup default headers\n if (useJson) {\n Object.assign(defaultHeaders, {\n 'Content-Type': this.options.ajaxJsonContentType\n });\n }\n let defaultOptions = Object.assign(this.options.fetchOptions, {\n headers: defaultHeaders,\n method: this.options.ajaxSubmitType\n });\n\n // support either JSON request payload or normal payload submission\n var serverCall = useJson ? fetch(ajaxPostUrl, Object.assign(defaultOptions, {\n body: JSON.stringify(this.serialize())\n })) : fetch(ajaxPostUrl, Object.assign(defaultOptions, {\n body: new FormData(thisForm)\n }));\n\n Event.dispatch(thisForm, EVENT_FORM_AFTER_AJAX_SUBMIT).withOriginal(e).fire();\n\n return serverCall.then((r) => {\n (self._remoteValidationFunction || Form.globalRemoteValidationFunction).apply(self, [r]);\n\n Event.dispatch(thisForm, EVENT_FORM_AJAX_COMPLETED).withOriginal(e).withDetail({ response: r }).fire();\n // always remove error class\n self._formStopLoading();\n });\n }\n\n /**\n * Serializes a form to a json object\n * @returns {Object}\n */\n serialize() {\n var selectors = [\n 'input[name]:not([type=\"radio\"]):enabled',\n 'input[type=\"radio\"][name]:checked',\n 'select[name]:enabled',\n 'textarea[name]:enabled'\n ], inputs = this.form.querySelectorAll(selectors.join(',')), result = {};\n\n Array.prototype.forEach.call(inputs, function (input) {\n var exists = result[input.name], value = input.value;\n if (exists instanceof Array) {\n exists.push(value);\n } else if (exists) {\n result[input.name] = [result[input.name], value];\n } else {\n result[input.name] = value;\n }\n });\n\n return result;\n }\n\n /**\n * Handles the chain of validation on given fields\n *\n * @param {HTMLElement|Array|NodeList} field\n * @param [focus] optional focus first error\n * @returns {Promise}\n */\n handleValidation(field, focus) {\n var fields = (field instanceof Array || field instanceof NodeList) ? field : [field];\n return this._handleValidation(fields, focus, true).then(((r) => {\n if (!r.foundAnyError) {\n // remove tooltips\n if (this.tooltips) {\n this.tooltips.removeTooltip();\n }\n }\n return r;\n }).bind(this));\n }\n\n /**\n * Handles errors on given node list\n * @param {NodeList} toValidateFields\n * @param {boolean} focus\n * @param {boolean} scoped if true, will only validate the fields `invalidFields`\n * @returns {Promise}\n * @private\n */\n _handleValidation(toValidateFields, focus, scoped) {\n var self = this;\n var arr = Form._createArrayFromInvalidFieldList(toValidateFields), isLocalInvalid = arr.length > 0;\n // focus must appear in the same frame for iOS devices\n if (isLocalInvalid && focus) {\n self._focusElement(arr[0]);\n }\n var validation = scoped ? this._customValidationsForElements(toValidateFields) :\n self.validateCustomFields();\n return validation.then((r) => {\n if (isLocalInvalid) {\n // combine browser and custom validators\n r.foundAnyError = true;\n }\n // get a unique field list of all fields that need to be checked and rendered\n // it's possible that we have duplicates in non scoped mode\n let thisToValidateFields = scoped ? toValidateFields :\n Array.from(arr).concat(r.checkedFields);\n r.checkedFields = thisToValidateFields;\n let foundInvalidFields = self.prepareErrors(thisToValidateFields, false),\n firstInvalidField = foundInvalidFields[0];\n if (firstInvalidField) {\n if (focus) {\n self._focusElement(firstInvalidField);\n // if element could not be focused:\n if (document.activeElement !== firstInvalidField) {\n self._handleTooltipHideClickAfterChange();\n }\n } else {\n self._handleTooltipHideClickAfterChange();\n }\n self.showAndOrCreateTooltip(firstInvalidField);\n }\n return r;\n });\n }\n\n /**\n * @param {HTMLElement} field\n * @param {ValidityState} validity\n * @returns {*}\n * @private\n */\n\n _setupErrorMessages(field, validity) {\n return Form.globalErrorMessageHandler ?\n Form.globalErrorMessageHandler.apply(this, [field, validity]) : false;\n }\n\n /**\n * Handles class labels for elements\n * @param {Object} fields\n * @private\n */\n _handleLabels(fields) {\n Object.keys(fields).forEach(function (id) {\n let labels = this.getForm().querySelectorAll('[for=\"' + id + '\"]'), invalid = fields[id];\n if (labels.length) {\n for (let labelsIndex = 0; labelsIndex < labels.length; labelsIndex++) {\n let labelEl = labels[labelsIndex];\n // we can't use toggle attribute, not supported in IE\n if (invalid) {\n this._markElementInvalid(labelEl);\n } else {\n this._markElementValid(labelEl);\n }\n }\n }\n }.bind(this));\n }\n\n /**\n * @param el\n * @private\n */\n _markElementInvalid(el) {\n el.setAttribute(DATA_ELEMENT_INVALID, \"true\");\n el.classList.add(this.options.inputErrorClass);\n }\n\n /**\n * @param el\n * @private\n */\n _markElementValid(el) {\n el.removeAttribute(DATA_ELEMENT_INVALID);\n el.classList.remove(this.options.inputErrorClass);\n }\n\n /**\n * A List of invalid elements (:invalid)\n * @returns {Array}\n * @private\n */\n _getInvalidElements() {\n return Array.prototype.filter.call(this.getForm().querySelectorAll(\":invalid\"), function (r) {\n return !(r instanceof HTMLFieldSetElement);\n });\n }\n\n /**\n * @param {HTMLElement} thisParent\n * @private\n */\n _removeElementErrors(thisParent) {\n let errors = thisParent.querySelectorAll('.' + this.options.containerErrorClass), inputsWithErrorClasses =\n thisParent.querySelectorAll(`[${DATA_ELEMENT_INVALID}]`);\n for (let elementErrorIndex = 0; elementErrorIndex < errors.length; elementErrorIndex++) {\n errors[elementErrorIndex].parentNode.removeChild(errors[elementErrorIndex]);\n }\n for (let inputErrorIndex = 0; inputErrorIndex < inputsWithErrorClasses.length; inputErrorIndex++) {\n let el = inputsWithErrorClasses[inputErrorIndex];\n this._markElementValid(el);\n }\n }\n\n\n /**\n * Registers a custom validator\n * @param {String} name\n * @param {Function} validator a validation function should always return either a Future(true) or Future(false)\n * even when the field has been invalidated with `setCustomValidity`, because of different browser `bugs`\n * we can't rely on that\n * @returns {Form}\n */\n registerValidator(name, validator) {\n this._validators[name] = validator;\n return this;\n }\n\n /**\n * Runs async validation\n * @param {String} validationRef\n * @param {HTMLElement} field\n * @returns {Promise}\n * @private\n */\n _runValidation(validationRef, field) {\n if (!this._validators[validationRef]) {\n throw 'Could not found validator: ' + validationRef;\n }\n var cl = field.classList, future = this._validators[validationRef].apply(this, [field, this.form]);\n cl.add(LOADING_CLASS);\n future.then(() => {\n cl.remove(LOADING_CLASS);\n });\n return future;\n }\n\n\n /**\n * Run custom validations for elements, validations are done async do support XHR Requests or other stuff\n *\n * @param {Array|NodeList} fields\n * @returns {Promise} contains either true if validations passed or false if something went wrong\n * @private\n */\n _customValidationsForElements(fields) {\n var futures = [], fieldsLength = fields.length, checkedFields = [];\n for (var iVal = 0; iVal < fieldsLength; iVal++) {\n var field = fields[iVal], validationRef = field.getAttribute(ATTR_VALIDATOR), validity = field.validity;\n if (this._validators[validationRef]) {\n // use local validation first and then continue with custom validations\n if (Form._shouldNotValidateField(field) || (validity && !validity.customError && !validity.valid)) {\n continue;\n }\n checkedFields.push(field);\n futures.push(this._runValidation(validationRef, field));\n } else {\n if (validationRef) {\n console.warn('data-validate was set but no validator was found');\n }\n }\n }\n return Promise.all(futures).then(function (allFutures) {\n let l = allFutures.length;\n let result = {\n checkedFields: checkedFields,\n foundAnyError: false\n };\n for (var fI = 0; fI < l; fI++) {\n if (!allFutures[fI]) {\n result.foundAnyError = true;\n break;\n }\n }\n return result;\n });\n }\n\n /**\n * Remove all errors for this form\n * @returns {Form}\n */\n removeErrors() {\n this._removeElementErrors(this.form);\n if (this.tooltips) {\n this.tooltips.removeTooltip();\n }\n return this;\n }\n\n /**\n * Will handle errors for given fields\n * @param {Array|NodeList} fields\n * @param {Boolean} removeAllErrors\n */\n prepareErrors(fields, removeAllErrors) {\n if (removeAllErrors) {\n this.removeErrors();\n }\n let labelGroups = {}, invalidFields = [];\n\n function handleAdditionalLabels(isInvalid, thisLabelGroup, field) {\n let additionalLabels = field.getAttribute(ATTR_DATA_CUSTOM_LABEL) ||\n field.id, group = thisLabelGroup[additionalLabels];\n if (additionalLabels) {\n // check additionally if field is currently marked as invalid\n // so the label is not marked as error if no field is marked as one\n group = group ? group : isInvalid;\n thisLabelGroup[additionalLabels] = group;\n }\n }\n\n // We save all validations in an extra property because we need to reset the validity due some\n // implementation errors in other browsers then chrome\n for (let i = 0; i < fields.length; i++) {\n let field = fields[i], errorTarget = Form._findErrorTarget(field), parent = errorTarget.parentNode,\n validity = field.validity, isInvalid = validity && !validity.valid;\n if (Form._shouldNotValidateField(field)) {\n continue;\n }\n field.flexFormsSavedValidity = JSON.parse(JSON.stringify(validity));\n handleAdditionalLabels(isInvalid, labelGroups, field);\n if (isInvalid) {\n if (!removeAllErrors) {\n // Remove current errors:\n this._removeElementErrors(parent);\n }\n // setup custom error messages:\n this._setupErrorMessages(field, validity);\n let msg = field.validationMessage;\n\n // mark fields as invalid\n this._markElementInvalid(errorTarget);\n this._markElementInvalid(field);\n\n if (this.options.appendError) {\n parent.insertAdjacentHTML(\"beforeend\",\n `
${msg}
`);\n }\n invalidFields.push(field);\n field.flexFormsSavedValidationMessage = msg;\n } else {\n // restore invalid fields\n this._markElementValid(errorTarget);\n this._markElementValid(field);\n\n // cleanup\n delete field.flexFormsSavedValidationMessage;\n\n // remove error markup\n this._removeElementErrors(parent);\n }\n // We have to reset the custom validity here to allow native validations work again\n field.setCustomValidity('');\n }\n // if validates a single field we need to check the linked fields to a label:\n if (fields.length === 1) {\n let field = fields[0];\n let id = field.getAttribute(ATTR_DATA_CUSTOM_LABEL) || field.id;\n if (id) {\n let linkedFields = Array.from(\n this.getForm().querySelectorAll(`[${ATTR_DATA_CUSTOM_LABEL}=\"${id}\"], #${id}`));\n linkedFields.forEach(function (thisField) {\n let validity = thisField.validity, isInvalid = validity && !validity.valid &&\n this._isElementInvalidElement(thisField);\n handleAdditionalLabels(isInvalid, labelGroups, thisField);\n }.bind(this));\n }\n }\n this._handleLabels(labelGroups);\n return invalidFields;\n }\n\n /**\n * Validates all custom fields\n * @returns {Promise}\n */\n validateCustomFields() {\n return this._customValidationsForElements(\n this.form.querySelectorAll(\"[data-validate]\"));\n }\n\n /**\n * Tests if a field should be validated\n * @param {HTMLElement} field\n * @returns {boolean}\n * @private\n */\n static _shouldNotValidateField(field) {\n var target = Form._findErrorTarget(field);\n return target instanceof HTMLFieldSetElement || field.validity === undefined ||\n (target.hasAttribute(ATTR_VALIDATE_VISIBILITY) && !Util.isVisible(target));\n }\n\n /**\n * Creates an array from a node list with invalid items\n * This Method expicitly checks if field should not be validated so it can be used to foucs a field\n * @param list\n * @returns {Array}\n * @private\n */\n static _createArrayFromInvalidFieldList(list) {\n var arr = [];\n for (var i = 0; i < list.length; ++i) {\n var n = list[i];\n if (n.validity && !n.validity.valid) {\n if (!Form._shouldNotValidateField(n)) {\n arr.push(n);\n }\n }\n }\n return arr;\n }\n\n\n /**\n * This form\n * @returns {HTMLElement}\n */\n getForm() {\n return this.form;\n }\n\n /**\n * Registers a function that handles remote validation\n * @param {Function} func\n * @returns {Form}\n */\n registerRemoteValidation(func) {\n this._remoteValidationFunction = func;\n return this;\n }\n\n\n /**\n * Formats the error content for the tooltip\n * @param {String} error\n * @returns {String}\n * @private\n */\n _formatErrorTooltip(error) {\n return this.options.formatErrorTooltip.apply(this, [error]);\n }\n\n /**\n * Tries to find a custom error target on given target\n * @param target\n * @returns {HTMLElement}\n * @private\n */\n static _findErrorTarget(target) {\n var el = target.getAttribute(ATTR_ERROR_TARGET_ID) || target,\n foundTarget = el instanceof HTMLElement ? el : global.document.getElementById(el);\n if (!foundTarget) {\n throw 'Given error target did not exsits:' + target;\n }\n return foundTarget;\n }\n\n /**\n * Creates a tooltip at given element, will only create a new instance if not created\n * @param {HTMLElement} target\n * @param {Boolean} [remove]\n */\n showAndOrCreateTooltip(target, remove) {\n var self = this;\n if (!this.tooltips && this.options.createTooltips) {\n this.tooltips = new Tooltip(this.options.tooltipContainer, this.options.tooltipOptions);\n }\n if (!this.options.createTooltips) {\n return false;\n }\n\n if (!target.flexFormsSavedValidity) {\n return false;\n }\n var errorTarget = Form._findErrorTarget(target);\n if (!target.flexFormsSavedValidity.valid && self._isElementInvalidElement(errorTarget)) {\n self.tooltips.createTooltip(errorTarget,\n self._formatErrorTooltip(target.flexFormsSavedValidationMessage), false);\n return true;\n } else {\n if (remove) {\n self.tooltips.removeTooltip();\n }\n }\n return false;\n }\n\n /**\n * Checks if element is marked as invalid\n * @param {HTMLElement} el\n * @returns {boolean}\n * @private\n */\n _isElementInvalidElement(el) {\n return el.hasAttribute(DATA_ELEMENT_INVALID);\n }\n\n /**\n * Handles invalid event of a form\n * @param {Event} e\n * @returns {Promise|boolean}\n * @private\n */\n _checkIsInvalid(e) {\n e.preventDefault();\n var invalidFields = this.getForm().querySelectorAll(\":invalid\");\n return this._handleValidation(invalidFields, true, false);\n }\n\n /**\n * Will query dependent fields (by selector) that should be validated with given field\n * @param field\n * @returns {NodeList|[]}\n * @private\n */\n _getDependentFields(field) {\n let fieldSelector = field.getAttribute(ATTR_DEPENDS), base = [field];\n if (fieldSelector) {\n base.push.apply(base, Array.prototype.slice.apply(\n this.getForm().querySelectorAll(fieldSelector)));\n }\n return base;\n }\n\n /**\n * @private\n * @param {HTMLElement} [target]\n */\n _handleTooltipInline(target) {\n if (this.tooltips) {\n this.tooltips.removeTooltip(target);\n }\n }\n\n /**\n * Initializes validation for a given form, registers event handlers\n */\n initFormValidation() {\n // Suppress the default bubbles\n var form = this.getForm(),\n self = this,\n invalidEvent = 'invalid';\n\n /**\n * Validates if is valid realtime element\n * @param {HTMLElement} target\n * @returns {boolean}\n * @private\n */\n function _checkIsValidRealtimeElement(target) {\n return !target.hasAttribute(ATTR_DISABLE_REALTIME) && !target.hasAttribute(ATTR_DISABLE_INLINE);\n }\n\n form.addEventListener(invalidEvent, function (e) {\n e.preventDefault();\n }, true);\n\n Util.addEventOnce(invalidEvent, form, function handleInvalid(e) {\n self._formLoading();\n var result = self._checkIsInvalid(e);\n if (result) {\n self.currentValidationFuture = new Promise((resolve) => {\n result.then(function (r) {\n setTimeout(function () {\n Util.addEventOnce(invalidEvent, form, handleInvalid, true);\n }, 0);\n resolve(r);\n self._formStopLoading();\n if (!r.foundAnyError) {\n self._formLoading();\n self._handleSubmit(e);\n }\n });\n });\n }\n }, true);\n\n this.addEventListener(form, 'reset', () => {\n this.removeErrors();\n });\n\n // Timeout for keys:\n var TIMEOUT_KEYDOWN, KEYDOWN_RUNNING = false;\n\n // resets keydown events\n function clearKeyDownTimeout() {\n KEYDOWN_RUNNING = false;\n clearTimeout(TIMEOUT_KEYDOWN);\n }\n\n // setup custom realtime event if given\n if (self.options.realtime) {\n this.addEventListener(form, CONST_REALTIME_EVENT, function (e) {\n if (self._formIsLoading()) {\n return;\n }\n var target = e.target;\n clearTimeout(TIMEOUT_KEYDOWN);\n if (KEYDOWN_RUNNING) {\n return;\n }\n TIMEOUT_KEYDOWN = setTimeout(() => {\n let isStillTarget = document.activeElement === e.target;\n if (!_checkIsValidRealtimeElement(target)) {\n return;\n }\n if (isStillTarget) {\n self._handleTooltipInline();\n }\n KEYDOWN_RUNNING = true;\n let dependentFields = self._getDependentFields(target);\n self._customValidationsForElements(dependentFields).then(function () {\n self.prepareErrors(dependentFields, false);\n if (isStillTarget) {\n self.showAndOrCreateTooltip(e.target);\n }\n // future must be resolved before another event can be started\n KEYDOWN_RUNNING = false;\n });\n }, self.options.realtimeTimeout);\n }, true);\n }\n\n /**\n * Validates if target is a valid input field to check blur and focus events\n *\n * @param {HTMLElement} target\n * @returns {boolean}\n * @private\n */\n function _checkIsValidBlurFocusElement(target) {\n let attr = target.getAttribute(\"type\");\n return (attr !== \"radio\" && attr !== \"checkbox\" && attr !== \"submit\");\n }\n\n /**\n * Validates if is valid inline-check element\n * @param {HTMLElement} target\n * @returns {boolean}\n * @private\n */\n function _checkIsValidInlineCheckElement(target) {\n return !target.hasAttribute(ATTR_DISABLE_INLINE);\n }\n\n this.addEventListener(form, 'blur', function (e) {\n // do not hide tooltip after change event\n if (!e.target.flexcssKeepTooltips) {\n self._handleTooltipInline(e.target);\n }\n delete e.target.flexcssKeepTooltips;\n }, true);\n\n // handle focus on input elements\n // will show an error if field is invalid\n this.addEventListener(form, \"focus\", function (e) {\n if (self._formIsLoading()) {\n return;\n }\n // do not track errors for checkbox and radios on focus:\n if (!_checkIsValidBlurFocusElement(e.target)) {\n return;\n }\n // we need to delay this a little, because Firefox and Safari do not show a tooltip after it\n // just have been hidden (on blur). Maybe fix this with a queue later\n setTimeout(function () {\n self.showAndOrCreateTooltip(e.target);\n }, FOCUS_TOOLTIP_DELAY);\n }, true);\n\n if (self.options.inlineValidation) {\n // Handle change for checkbox, radios and selects\n this.addEventListener(form, \"change\", function (e) {\n const target = e.target;\n if (self._formIsLoading() || !_checkIsValidInlineCheckElement(target)) {\n return;\n }\n clearKeyDownTimeout();\n const name = target.getAttribute('name');\n let inputs = name ? form.querySelectorAll('[name=\"' + name + '\"]') : [target];\n // we only support dependent fields for a single widgets right now\n if (inputs.length === 1) {\n inputs = self._getDependentFields(target);\n }\n self._customValidationsForElements(inputs).then(function () {\n self.prepareErrors(inputs, false);\n target.flexcssKeepTooltips = self.showAndOrCreateTooltip(target, true);\n if (target.flexcssKeepTooltips) {\n self._handleTooltipHideClickAfterChange();\n }\n });\n });\n }\n\n // prevent default if form is invalid\n this.addEventListener(form, \"submit\", function listener(e) {\n self._submitListener(e, listener);\n });\n\n Event.dispatchAndFire(form, EVENT_FORM_READY);\n }\n\n /* Loading states, unfortunately we can't check if a promise is pending :/*/\n /* TODO: Maybe wrap promise to extend this functionality */\n\n _formLoading() {\n this.getForm().classList.add(LOADING_CLASS);\n }\n\n _formStopLoading() {\n this.getForm().classList.remove(LOADING_CLASS);\n }\n\n _formIsLoading() {\n return this.getForm().classList.contains(LOADING_CLASS);\n }\n\n // this defines the logic after a change event when a tooltip is shown\n // because we call this method inside the change event, the click would be immeditally executed with the change\n // event when not using setTimeout(). There might be another solution for this...\n _handleTooltipHideClickAfterChange() {\n const self = this;\n if (this.options.createTooltips) {\n setTimeout(function () {\n Util.addEventOnce(Settings.getTabEvent(), global.document.body, function (t) {\n if (!self._isElementInvalidElement(t.target)) {\n self._handleTooltipInline();\n }\n });\n }, CLICK_TOOLTIP_DELAY);\n }\n }\n\n _focusElement(el) {\n el.focus();\n Util.scrollToElement(el, this.options.scrollToElementDiff);\n }\n\n /**\n * Listener that is executed on form submit\n * @param e\n * @param submitListener\n * @returns {boolean}\n * @private\n */\n _submitListener(e, submitListener) {\n\n const form = this.getForm(),\n self = this,\n submitEvent = 'submit';\n\n if (this._formIsLoading()) {\n e.preventDefault();\n return false;\n }\n this._formLoading();\n form.removeEventListener(submitEvent, submitListener);\n this.removeErrors();\n e.preventDefault();\n // reset:\n if (form.checkValidity()) {\n form.addEventListener(submitEvent, submitListener);\n // It's possible that the form is valid but the custom validations need to be checked again:\n self.currentValidationFuture = new Promise((resolve) => {\n var validation = self.validateCustomFields();\n validation.then(function (r) {\n // because custom validators may mark multiple fields as invalid, we get all of them in the form\n var fields = self._getInvalidElements(),\n errors = self.prepareErrors(fields, false), firstError = errors[0];\n if (firstError) {\n self._focusElement(firstError);\n self.showAndOrCreateTooltip(firstError, true);\n }\n resolve(r);\n });\n });\n self.currentValidationFuture.then(function (r) {\n if (!r.foundAnyError) {\n // Handle submitting the form to server:\n self._handleSubmit(e);\n } else {\n self._formStopLoading();\n }\n });\n } else {\n self._formStopLoading();\n form.addEventListener(submitEvent, submitListener);\n }\n }\n\n\n /**\n * Handles submitting, optionally allows to stop submitting\n * @param e\n * @private\n */\n _handleSubmit(e) {\n this._submitFunction(this.form, e);\n }\n\n\n /**\n * Registers a global event Handler\n * @param errorFunc\n */\n static registerErrorMessageHandler(errorFunc) {\n Form.globalErrorMessageHandler = errorFunc;\n }\n\n /**\n * Initialize forms for a specific selector\n * @param {String} selector\n * @param {Object} [options]\n * @return {array.
}\n */\n static init(selector, options) {\n var forms = selector instanceof HTMLElement ? selector.querySelectorAll('form') :\n document.querySelectorAll(selector), instances = [];\n for (var i = 0; i < forms.length; i++) {\n instances.push(new Form(forms[i], options));\n }\n return instances;\n }\n\n\n /**\n * Registers a global validator that is usable on all form instances\n * @param {String} name\n * @param {Function} validator\n * @returns {Function}\n */\n static registerValidator(name, validator) {\n Form.globalValidators[name] = validator;\n return Form;\n }\n\n /**\n * Registers a global function that is called when a form should validate the response of a server\n * @param {Function} func\n * @returns {Form}\n */\n static registerGlobalRemoteValidationFunction(func) {\n Form.globalRemoteValidationFunction = func;\n return Form;\n }\n}\n\n\n/**\n * Global validators\n * @type {Array}\n */\nForm.globalValidators = [];\n\n/**\n * Global Remote validation function\n */\nForm.globalRemoteValidationFunction = function () {\n};\n\n/**\n * Handles custom error messages extracts custom message by default\n */\nForm.globalErrorMessageHandler = (field, validity) => {\n if (!validity.customError) {\n let customMsg = field.getAttribute(ATTR_DATA_CUSTOM_MESSAGE);\n if (customMsg) {\n field.setCustomValidity(customMsg);\n }\n }\n};\n\nexport default Form;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/main/Form.js\n **/","/*\n * The MIT License (MIT)\n *\n * Copyright (c) 2015 David Heidrich, BowlingX \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n/*!\n * FlexCss.Tooltip\n * Licensed under the MIT License (MIT)\n * Copyright (c) 2015 David Heidrich, BowlingX \n */\n\nimport Util from './util/Util';\nimport DestroyableWidget from './DestroyableWidget';\nimport Settings from './util/Settings';\n\n/**\n * @type {string}\n */\nconst CLASS_NAMES_TOOLTIP = 'tooltip-container';\n/**\n * @type {string}\n */\nconst CLASS_NAMES_OPEN = 'open';\n\n/**\n * @type {string}\n */\nconst ATTR_DATA_CLASSNAME = 'data-class';\n\n/**\n * @type {string}\n */\nconst ATTR_DATA_NO_TOUCH = 'data-no-touch';\n\n/**\n * @type {HTMLDocument}\n */\nconst doc = global.document;\n\n/**\n * Simple Tooltip\n */\nclass Tooltip extends DestroyableWidget {\n\n /**\n * Creates a Tooltip\n * @param {HTMLElement|String} DelegateContainer\n * @param {Object} [options]\n */\n constructor(DelegateContainer, options) {\n super();\n /**\n * The Container where possible events are captured\n */\n this.container = DelegateContainer instanceof HTMLElement ?\n DelegateContainer : doc.getElementById(DelegateContainer);\n\n if (!this.container) {\n throw new Error('Could not create Tooltip, DelegateContainer not found');\n }\n\n /**\n * The Container where tooltips are stored for this instance\n * @type {HTMLElement}\n */\n this.tooltipContainer = null;\n\n /**\n * Default Options\n */\n this.options = {\n containerClass: '',\n selectorAttribute: 'data-tooltip',\n collisionContainer: this.container\n };\n\n Object.assign(this.options, options || {});\n }\n\n /**\n * Creates and shows a tooltip\n * @param {HTMLElement} target where is this tooltip positioned\n * @param {String} text text content in tooltip, will be NOT escaped\n * @param {Boolean} [removeTitle] removes title element if given\n * @param {Node} [positionRelative]\n */\n createTooltip(target, text, removeTitle, positionRelative) {\n // abort if text is empty\n if (!text || text && text.trim() === '') {\n return;\n }\n\n if (Settings.isTouchDevice() && target && target.hasAttribute(ATTR_DATA_NO_TOUCH)) {\n return;\n }\n\n let tooltipContainer = this.tooltipContainer;\n\n if (!tooltipContainer) {\n tooltipContainer = doc.createElement('div');\n this.container.appendChild(tooltipContainer);\n this.tooltipContainer = tooltipContainer;\n }\n this._restoreClassNames(tooltipContainer, target);\n\n tooltipContainer.style.left = 'auto';\n tooltipContainer.style.top = 'auto';\n tooltipContainer.innerHTML = text;\n tooltipContainer.flexTooltipCurrentTarget = target;\n if (removeTitle) {\n target.oldTitle = text;\n target.removeAttribute('title');\n }\n\n Util.setupPositionNearby(positionRelative || target, tooltipContainer,\n this.options.collisionContainer, true, true);\n\n tooltipContainer.classList.add(CLASS_NAMES_OPEN);\n }\n\n _restoreClassNames(container, target) {\n // allow additional classname per tooltip on target element\n const classNames = [CLASS_NAMES_TOOLTIP, this.options.containerClass];\n const maybeTargetClass = target.getAttribute(ATTR_DATA_CLASSNAME);\n if (maybeTargetClass) {\n classNames.push(maybeTargetClass);\n }\n container.className = classNames.join(\" \");\n return this;\n }\n\n /**\n * @returns {HTMLElement|null}\n */\n getCurrentTarget() {\n return this.tooltipContainer ? this.tooltipContainer.flexTooltipCurrentTarget : null;\n }\n\n /**\n * Destroys this Widget\n * @returns {boolean}\n */\n destroy() {\n super.destroy();\n\n if (this.tooltipContainer) {\n this.tooltipContainer.parentNode.removeChild(this.tooltipContainer);\n return true;\n }\n return false;\n }\n\n /**\n * Removes a Tooltip on given target\n * @param {HTMLElement} [target], if not given will remove current open tooltip on this instance\n */\n removeTooltip(target) {\n let selfTarget = target;\n if (!selfTarget && this.tooltipContainer) {\n selfTarget = this.tooltipContainer.flexTooltipCurrentTarget;\n }\n if (this.tooltipContainer) {\n if (this.tooltipContainer.flexTooltipCurrentTarget !== selfTarget) {\n return;\n }\n this.tooltipContainer.classList.remove(CLASS_NAMES_OPEN);\n delete this.tooltipContainer.flexTooltipCurrentTarget;\n }\n if (selfTarget && selfTarget.oldTitle) {\n selfTarget.setAttribute('title', selfTarget.oldTitle);\n }\n }\n\n /**\n * Initilizes mouse events on container element\n */\n registerEvents() {\n const self = this;\n this.addEventListener(this.container, 'mouseover', (e) => {\n if (e.target.hasAttribute(self.options.selectorAttribute)) {\n self.createTooltip(e.target, e.target.getAttribute('title'), true);\n }\n });\n\n this.addEventListener(this.container, 'mouseout', (e) => {\n if (e.target.hasAttribute(self.options.selectorAttribute)) {\n self.removeTooltip(e.target);\n }\n });\n return this;\n }\n}\n\nexport default Tooltip;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/main/Tooltip.js\n **/","/*\n * The MIT License (MIT)\n *\n * Copyright (c) 2015 David Heidrich, BowlingX \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nconst PFX = [\"webkit\", \"moz\", \"MS\", \"o\", \"\"];\n\nconst COL_LEFT_CLASS = 'is-collision-left';\n\nconst COL_RIGHT_CLASS = 'is-collision-right';\n\nconst COL_BOTTOM_CLASS = 'is-collision-bottom';\n\n/**\n * Provides shared DOM-Utility functions\n */\nclass Util {\n\n /**\n * Will register the right animation event based on browser\n * @param element\n * @param type\n * @param callback\n */\n static prefixedAnimateEvent(element, type, callback) {\n const thisFunction = function thisFunction(e) {\n callback.apply(element, [e, thisFunction]);\n };\n\n for (let p = 0; p < PFX.length; p++) {\n let thisType = type;\n if (!PFX[p]) {\n thisType = type.toLowerCase();\n }\n const name = PFX[p] + thisType;\n element.addEventListener(name, thisFunction, true);\n }\n }\n\n /**\n * Get correct transitionend event\n * @returns {String}\n * @private\n */\n static whichTransitionEndEvent() {\n let t;\n const el = document.createElement('fake');\n\n const transitions = {\n transition: 'transitionend',\n OTransition: 'oTransitionEnd',\n MozTransition: 'transitionend',\n WebkitTransition: 'webkitTransitionEnd'\n };\n\n for (t in transitions) {\n if (el.style[t] !== undefined) {\n return transitions[t];\n }\n }\n }\n\n /**\n * Check if target is part of parent node\n * @param target\n * @param parent\n * @returns {boolean}\n */\n static isPartOfNode(target, parent) {\n if (!target || !parent) {\n return false;\n }\n let now = target;\n while (now !== parent && now !== null) {\n if (now === parent) {\n break;\n }\n now = now.parentNode;\n }\n return now !== null;\n }\n\n /**\n * Finds the closest element including itself matching a callback\n * @param {Node} el\n * @param {Function} callback\n * @returns {Node|boolean}\n */\n static closestCallback(el, callback) {\n let element = el;\n while (element !== null) {\n if (callback(element)) {\n return element;\n }\n element = element.parentNode;\n }\n return false;\n }\n\n /**\n * Walks the tree until func returns true for given argument\n * @param target\n * @param func\n * @returns {boolean|HTMLElement}\n */\n static parentsUntil(target, func) {\n if (!target) {\n return false;\n }\n let now = target;\n while (!func(now) && now !== null) {\n now = now.parentNode;\n }\n\n return now;\n }\n\n /**\n * Generates a unique id\n * @return {String}\n */\n static guid() {\n function s4() {\n return Math.floor((1 + Math.random()) * 0x10000)\n .toString(16)\n .substring(1);\n }\n\n return `${s4() + s4()}-${s4()}-${s4()}-${s4()}-${s4() + s4() + s4()}`;\n }\n\n /**\n * Detects scrollbar width\n * @see http://stackoverflow.com/questions/986937/how-can-i-get-the-browsers-scrollbar-sizes\n * @returns {number}\n */\n static getScrollBarWidth() {\n const doc = global.document;\n const inner = doc.createElement('p');\n\n inner.style.width = \"100%\";\n inner.style.height = \"200px\";\n\n const outer = doc.createElement('div');\n outer.style.position = \"absolute\";\n outer.style.top = \"0px\";\n outer.style.left = \"0px\";\n outer.style.visibility = \"hidden\";\n outer.style.width = \"200px\";\n outer.style.height = \"150px\";\n outer.style.overflow = \"hidden\";\n outer.appendChild(inner);\n\n doc.body.appendChild(outer);\n const w1 = inner.offsetWidth;\n outer.style.overflow = 'scroll';\n let w2 = inner.offsetWidth;\n if (w1 === w2) {\n w2 = outer.clientWidth;\n }\n doc.body.removeChild(outer);\n\n return (w1 - w2);\n }\n\n\n /**\n * Run an event once\n * @param {String} ev\n * @param {HTMLElement|HTMLDocument} target\n * @param {Function} func\n * @param {boolean} [capture]\n * @return Function created listener\n */\n static addEventOnce(ev, target, func, capture) {\n const thisFunction = function thisFunction(event) {\n func(event, func);\n target.removeEventListener(ev, thisFunction, capture);\n };\n target.addEventListener(ev, thisFunction, capture);\n return thisFunction;\n }\n\n /**\n * Checks if an element is visible\n * @param {HTMLElement} element\n * @returns bool\n */\n static isVisible(element) {\n return element.offsetWidth > 0 && element.offsetHeight > 0;\n }\n\n /**\n * Creates a camelCaseRepresentation of a dashed string\n * @param {String} str\n * @returns String\n */\n static dashToCamelCase(str) {\n return str.replace(/-([a-z])/g, (g) => {\n return g[1].toUpperCase();\n });\n }\n\n /**\n * Creates a copy of `input`\n * @param {*} input\n * @return *\n */\n static copy(input) {\n return JSON.parse(JSON.stringify(input));\n }\n\n /**\n * Reads options from element (data attributes) and applies to base\n * @param {HTMLElement} element\n * @param {Object} base\n * @return {Object}\n */\n static applyOptionsFromElement(element, base) {\n if (!element) {\n return base;\n }\n const attrs = element.attributes;\n for (let i = 0; i < attrs.length; i++) {\n const attr = attrs[i];\n if (attr) {\n const s = Util.dashToCamelCase(attr.nodeName.replace('data-', ''));\n const val = attr.nodeValue;\n if (base.hasOwnProperty(s)) {\n // skip functions\n if (typeof base[s] === 'function') {\n continue;\n }\n if (typeof base[s] === 'boolean') {\n base[s] = parseInt(val || 1, 10) === 1;\n } else {\n base[s] = val;\n }\n }\n }\n }\n return base;\n }\n\n /**\n * Will position an element directly at given target\n * Is aware of a given collision container to detect edges\n * Will put elementToPosition either to left, center or right edge (prefer right)\n * and either to bottom or top (prefers bottom)\n *\n * You may overwrite preferred positioned with `centerHorizontal` and `positionTop`\n *\n * @param {HTMLElement|ClientRect} target the target container to align to\n * @param {HTMLElement} elementToPosition the element to position\n * @param {HTMLElement} collisionContainer the outer container to prevent collisions\n * @param {boolean} [centerHorizontal] set true to center element, otherwise it's put on the right border by default\n * @param {boolean} [positionTop] flip top, by default element is positioned to the bottom.\n * @returns {HTMLElement}\n */\n static setupPositionNearby(target, elementToPosition, collisionContainer, centerHorizontal, positionTop) {\n // determine relative offsets\n let amountTop = 0;\n let amountLeft = 0;\n Util.parentsUntil(target.parentNode, (el) => {\n if (!(el instanceof HTMLElement)) {\n return false;\n }\n const style = window.getComputedStyle(el);\n if (Util.isPartOfNode(elementToPosition, el)) {\n if (style && style.position === 'relative') {\n amountTop += el.offsetTop || 0;\n amountLeft += el.offsetLeft || 0;\n }\n return false;\n }\n return true;\n });\n\n const targetPosition = target instanceof HTMLElement ? target.getBoundingClientRect() : target;\n const elementRect = elementToPosition.getBoundingClientRect();\n const colRect = collisionContainer.getBoundingClientRect();\n const targetTop = targetPosition.top - amountTop;\n const targetRight = targetPosition.right;\n const isCollisionTop = (targetTop - elementRect.height) <= 0;\n const isCollisionBottom =\n window.innerHeight < (targetTop + amountTop + targetPosition.height + elementRect.height);\n const isCollisionLeft = targetRight < elementRect.width;\n const targetLeft = targetPosition.left;\n const isCollisionRight = (targetLeft + elementRect.width) > colRect.width;\n const classList = elementToPosition.classList;\n\n classList.remove(COL_RIGHT_CLASS);\n classList.remove(COL_LEFT_CLASS);\n classList.remove(COL_BOTTOM_CLASS);\n\n let calcTop;\n let calcLeft;\n if (isCollisionLeft && !isCollisionRight) {\n // put element to left if collision with left\n calcLeft = `${(targetPosition.left - colRect.left - amountLeft)}px`;\n classList.add(COL_LEFT_CLASS);\n } else {\n // maybe center if no collision with either side\n const rightPosition = `${(targetRight - elementRect.width - colRect.left - amountLeft)}px`;\n const leftCentered = ((targetLeft + targetPosition.width / 2) -\n (elementRect.width / 2) || 0) - colRect.left;\n const collisionCentered = (leftCentered + elementRect.width) > colRect.width;\n if (centerHorizontal && !collisionCentered) {\n calcLeft = `${leftCentered}px`;\n } else {\n classList.add(COL_RIGHT_CLASS);\n calcLeft = rightPosition;\n }\n }\n\n if (isCollisionBottom || (positionTop && !isCollisionTop)) {\n // Put Element on top if collision\n calcTop = `${(targetTop - elementRect.height) - colRect.top}px`;\n classList.add(COL_BOTTOM_CLASS);\n } else {\n calcTop = `${(targetTop + targetPosition.height) - colRect.top}px`;\n }\n\n elementToPosition.style.cssText = `top:${calcTop};left:${calcLeft};`;\n\n return elementToPosition;\n }\n\n /**\n * Brings a given element into viewport\n * @param {HTMLElement} el\n * @param {int|function}[optionalOffset]\n */\n static scrollToElement(el, optionalOffset) {\n el.scrollIntoView();\n let thisOffset = optionalOffset;\n // optionally use a additional scrollDif\n if (thisOffset) {\n if (typeof thisOffset === 'function') {\n thisOffset = optionalOffset();\n }\n if (thisOffset > 0) {\n const scrolledY = window.pageYOffset;\n if (scrolledY) {\n window.scroll(0, scrolledY - thisOffset);\n }\n }\n }\n }\n}\n\nexport default Util;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/main/util/Util.js\n **/","/*\n * The MIT License (MIT)\n *\n * Copyright (c) 2015 David Heidrich, BowlingX \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n/**\n * Provides a Basic Widget\n */\nclass DestroyableWidget {\n\n constructor() {\n this.listeners = [];\n }\n\n /**\n * Destroys a Widget\n */\n destroy() {\n this.listeners.forEach((listener) => {\n listener.element.removeEventListener.apply(listener.element, listener.args);\n });\n this.listeners = [];\n }\n\n /**\n * Adds an event and registers it later to remove bindings\n * @param {HTMLElement} element\n * @param {String} name\n * @param {Function} listener\n * @param {boolean} [capture]\n * @returns {Function}\n */\n addEventListener(element, name, listener, capture) {\n this.listeners.push({\n element,\n args: [name, listener, capture]\n });\n\n element.addEventListener(name, listener, capture);\n return listener;\n }\n\n}\n\nexport default DestroyableWidget;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/main/DestroyableWidget.js\n **/","/*\n * The MIT License (MIT)\n *\n * Copyright (c) 2015 David Heidrich, BowlingX \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\nimport Util from './Util';\n\n// we attach global settings to global once because settings might be shared a lot of times trough the application\n// Maybe find a better way to handle that scenario\nif (!global.FLEXCSS_GLOBAL_SETTINGS) {\n global.FLEXCSS_GLOBAL_SETTINGS = {\n // defined breakpoint for small devices < n\n smallBreakpoint: 768,\n // nodes that should be updated when no scrollbar is expected\n scrollbarUpdateNodes: global.document.body !== null ? [global.document.body] : [],\n // additional Delay until darkener is fully hidden\n darkenerFadeDelay: 100,\n // class that is added if canvas has been toggled\n canvasToggledClass: 'toggled-canvas'\n };\n\n global.FLEXCSS_CONST_IS_IOS = null;\n\n global.FLEXCSS_CONST_IS_TOUCH = null;\n\n global.FLEXCSS_CONST_IS_IE = null;\n\n global.FLEXCSS_CONST_TAB_EVENT = 'click';\n\n global.FLEXCSS_IS_SMALL_SCREEN = false;\n\n const init = () => {\n // Measure scrollbar width\n global.FLEXCSS_CONST_SCROLLBAR_WIDTH = Util.getScrollBarWidth();\n // detect right transition end event\n global.FLEXCSS_CONST_TRANSITION_EVENT = Util.whichTransitionEndEvent();\n };\n\n if (global.document.readyState !== 'loading') {\n init();\n } else {\n // it's possible that global.document.body is not available if the document is not\n // loaded completely\n document.addEventListener('DOMContentLoaded', () => {\n init();\n });\n }\n}\n\n/**\n * Utility class that setups global settings\n */\nclass Settings {\n\n /**\n * Setup global settings, overwrite default values\n * @param {Object} settings\n */\n static setup(settings) {\n Object.assign(global.FLEXCSS_GLOBAL_SETTINGS, settings);\n }\n\n /**\n * Access to global settings\n * @returns {Object}\n */\n static get() {\n return global.FLEXCSS_GLOBAL_SETTINGS;\n }\n\n /**\n * Detects a IOS Device, caches subsequent calls\n * @returns {boolean}\n */\n static isIosDevice() {\n if (!global.FLEXCSS_CONST_IS_IOS) {\n global.FLEXCSS_CONST_IS_IOS = global.navigator.userAgent.match(/(iPad|iPhone|iPod)/i);\n }\n\n return global.FLEXCSS_CONST_IS_IOS;\n }\n\n /**\n * @returns {boolean}\n */\n static isSmallScreen() {\n return window.innerWidth < Settings.get().smallBreakpoint;\n }\n\n /**\n * Detects a touch device, caches subsequent calls\n * @returns {boolean}\n */\n static isTouchDevice() {\n if (!global.FLEXCSS_CONST_IS_TOUCH) {\n global.FLEXCSS_CONST_IS_TOUCH = 'ontouchstart' in window || !!(global.navigator.msMaxTouchPoints);\n }\n return global.FLEXCSS_CONST_IS_TOUCH;\n }\n\n /**\n * Checks if current browser is Internet Explorer\n * @returns {boolean|*}\n */\n static isIE() {\n if (!global.FLEXCSS_CONST_IS_IE) {\n global.FLEXCSS_CONST_IS_IE = \"ActiveXObject\" in window;\n }\n return global.FLEXCSS_CONST_IS_IE;\n }\n\n /**\n * @returns {String}\n */\n static getTransitionEvent() {\n return global.FLEXCSS_CONST_TRANSITION_EVENT;\n }\n\n /**\n * @returns {int}\n */\n static getScrollbarWidth() {\n return global.FLEXCSS_CONST_SCROLLBAR_WIDTH;\n }\n\n /**\n * @returns {String}\n */\n static getTabEvent() {\n return global.FLEXCSS_CONST_TAB_EVENT;\n }\n}\n\nexport default Settings;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/main/util/Settings.js\n **/","// the whatwg-fetch polyfill installs the fetch() function\n// on the global object (window or self)\n//\n// Return that as the export for use in Webpack, Browserify etc.\nrequire('whatwg-fetch');\nmodule.exports = self.fetch.bind(self);\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/isomorphic-fetch/fetch-npm-browserify.js\n ** module id = 12\n ** module chunks = 2 3\n **/","(function(self) {\n 'use strict';\n\n if (self.fetch) {\n return\n }\n\n function normalizeName(name) {\n if (typeof name !== 'string') {\n name = String(name)\n }\n if (/[^a-z0-9\\-#$%&'*+.\\^_`|~]/i.test(name)) {\n throw new TypeError('Invalid character in header field name')\n }\n return name.toLowerCase()\n }\n\n function normalizeValue(value) {\n if (typeof value !== 'string') {\n value = String(value)\n }\n return value\n }\n\n function Headers(headers) {\n this.map = {}\n\n if (headers instanceof Headers) {\n headers.forEach(function(value, name) {\n this.append(name, value)\n }, this)\n\n } else if (headers) {\n Object.getOwnPropertyNames(headers).forEach(function(name) {\n this.append(name, headers[name])\n }, this)\n }\n }\n\n Headers.prototype.append = function(name, value) {\n name = normalizeName(name)\n value = normalizeValue(value)\n var list = this.map[name]\n if (!list) {\n list = []\n this.map[name] = list\n }\n list.push(value)\n }\n\n Headers.prototype['delete'] = function(name) {\n delete this.map[normalizeName(name)]\n }\n\n Headers.prototype.get = function(name) {\n var values = this.map[normalizeName(name)]\n return values ? values[0] : null\n }\n\n Headers.prototype.getAll = function(name) {\n return this.map[normalizeName(name)] || []\n }\n\n Headers.prototype.has = function(name) {\n return this.map.hasOwnProperty(normalizeName(name))\n }\n\n Headers.prototype.set = function(name, value) {\n this.map[normalizeName(name)] = [normalizeValue(value)]\n }\n\n Headers.prototype.forEach = function(callback, thisArg) {\n Object.getOwnPropertyNames(this.map).forEach(function(name) {\n this.map[name].forEach(function(value) {\n callback.call(thisArg, value, name, this)\n }, this)\n }, this)\n }\n\n function consumed(body) {\n if (body.bodyUsed) {\n return Promise.reject(new TypeError('Already read'))\n }\n body.bodyUsed = true\n }\n\n function fileReaderReady(reader) {\n return new Promise(function(resolve, reject) {\n reader.onload = function() {\n resolve(reader.result)\n }\n reader.onerror = function() {\n reject(reader.error)\n }\n })\n }\n\n function readBlobAsArrayBuffer(blob) {\n var reader = new FileReader()\n reader.readAsArrayBuffer(blob)\n return fileReaderReady(reader)\n }\n\n function readBlobAsText(blob) {\n var reader = new FileReader()\n reader.readAsText(blob)\n return fileReaderReady(reader)\n }\n\n var support = {\n blob: 'FileReader' in self && 'Blob' in self && (function() {\n try {\n new Blob();\n return true\n } catch(e) {\n return false\n }\n })(),\n formData: 'FormData' in self,\n arrayBuffer: 'ArrayBuffer' in self\n }\n\n function Body() {\n this.bodyUsed = false\n\n\n this._initBody = function(body) {\n this._bodyInit = body\n if (typeof body === 'string') {\n this._bodyText = body\n } else if (support.blob && Blob.prototype.isPrototypeOf(body)) {\n this._bodyBlob = body\n } else if (support.formData && FormData.prototype.isPrototypeOf(body)) {\n this._bodyFormData = body\n } else if (!body) {\n this._bodyText = ''\n } else if (support.arrayBuffer && ArrayBuffer.prototype.isPrototypeOf(body)) {\n // Only support ArrayBuffers for POST method.\n // Receiving ArrayBuffers happens via Blobs, instead.\n } else {\n throw new Error('unsupported BodyInit type')\n }\n\n if (!this.headers.get('content-type')) {\n if (typeof body === 'string') {\n this.headers.set('content-type', 'text/plain;charset=UTF-8')\n } else if (this._bodyBlob && this._bodyBlob.type) {\n this.headers.set('content-type', this._bodyBlob.type)\n }\n }\n }\n\n if (support.blob) {\n this.blob = function() {\n var rejected = consumed(this)\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return Promise.resolve(this._bodyBlob)\n } else if (this._bodyFormData) {\n throw new Error('could not read FormData body as blob')\n } else {\n return Promise.resolve(new Blob([this._bodyText]))\n }\n }\n\n this.arrayBuffer = function() {\n return this.blob().then(readBlobAsArrayBuffer)\n }\n\n this.text = function() {\n var rejected = consumed(this)\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return readBlobAsText(this._bodyBlob)\n } else if (this._bodyFormData) {\n throw new Error('could not read FormData body as text')\n } else {\n return Promise.resolve(this._bodyText)\n }\n }\n } else {\n this.text = function() {\n var rejected = consumed(this)\n return rejected ? rejected : Promise.resolve(this._bodyText)\n }\n }\n\n if (support.formData) {\n this.formData = function() {\n return this.text().then(decode)\n }\n }\n\n this.json = function() {\n return this.text().then(JSON.parse)\n }\n\n return this\n }\n\n // HTTP methods whose capitalization should be normalized\n var methods = ['DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT']\n\n function normalizeMethod(method) {\n var upcased = method.toUpperCase()\n return (methods.indexOf(upcased) > -1) ? upcased : method\n }\n\n function Request(input, options) {\n options = options || {}\n var body = options.body\n if (Request.prototype.isPrototypeOf(input)) {\n if (input.bodyUsed) {\n throw new TypeError('Already read')\n }\n this.url = input.url\n this.credentials = input.credentials\n if (!options.headers) {\n this.headers = new Headers(input.headers)\n }\n this.method = input.method\n this.mode = input.mode\n if (!body) {\n body = input._bodyInit\n input.bodyUsed = true\n }\n } else {\n this.url = input\n }\n\n this.credentials = options.credentials || this.credentials || 'omit'\n if (options.headers || !this.headers) {\n this.headers = new Headers(options.headers)\n }\n this.method = normalizeMethod(options.method || this.method || 'GET')\n this.mode = options.mode || this.mode || null\n this.referrer = null\n\n if ((this.method === 'GET' || this.method === 'HEAD') && body) {\n throw new TypeError('Body not allowed for GET or HEAD requests')\n }\n this._initBody(body)\n }\n\n Request.prototype.clone = function() {\n return new Request(this)\n }\n\n function decode(body) {\n var form = new FormData()\n body.trim().split('&').forEach(function(bytes) {\n if (bytes) {\n var split = bytes.split('=')\n var name = split.shift().replace(/\\+/g, ' ')\n var value = split.join('=').replace(/\\+/g, ' ')\n form.append(decodeURIComponent(name), decodeURIComponent(value))\n }\n })\n return form\n }\n\n function headers(xhr) {\n var head = new Headers()\n var pairs = xhr.getAllResponseHeaders().trim().split('\\n')\n pairs.forEach(function(header) {\n var split = header.trim().split(':')\n var key = split.shift().trim()\n var value = split.join(':').trim()\n head.append(key, value)\n })\n return head\n }\n\n Body.call(Request.prototype)\n\n function Response(bodyInit, options) {\n if (!options) {\n options = {}\n }\n\n this.type = 'default'\n this.status = options.status\n this.ok = this.status >= 200 && this.status < 300\n this.statusText = options.statusText\n this.headers = options.headers instanceof Headers ? options.headers : new Headers(options.headers)\n this.url = options.url || ''\n this._initBody(bodyInit)\n }\n\n Body.call(Response.prototype)\n\n Response.prototype.clone = function() {\n return new Response(this._bodyInit, {\n status: this.status,\n statusText: this.statusText,\n headers: new Headers(this.headers),\n url: this.url\n })\n }\n\n Response.error = function() {\n var response = new Response(null, {status: 0, statusText: ''})\n response.type = 'error'\n return response\n }\n\n var redirectStatuses = [301, 302, 303, 307, 308]\n\n Response.redirect = function(url, status) {\n if (redirectStatuses.indexOf(status) === -1) {\n throw new RangeError('Invalid status code')\n }\n\n return new Response(null, {status: status, headers: {location: url}})\n }\n\n self.Headers = Headers;\n self.Request = Request;\n self.Response = Response;\n\n self.fetch = function(input, init) {\n return new Promise(function(resolve, reject) {\n var request\n if (Request.prototype.isPrototypeOf(input) && !init) {\n request = input\n } else {\n request = new Request(input, init)\n }\n\n var xhr = new XMLHttpRequest()\n\n function responseURL() {\n if ('responseURL' in xhr) {\n return xhr.responseURL\n }\n\n // Avoid security warnings on getResponseHeader when not allowed by CORS\n if (/^X-Request-URL:/m.test(xhr.getAllResponseHeaders())) {\n return xhr.getResponseHeader('X-Request-URL')\n }\n\n return;\n }\n\n xhr.onload = function() {\n var status = (xhr.status === 1223) ? 204 : xhr.status\n if (status < 100 || status > 599) {\n reject(new TypeError('Network request failed'))\n return\n }\n var options = {\n status: status,\n statusText: xhr.statusText,\n headers: headers(xhr),\n url: responseURL()\n }\n var body = 'response' in xhr ? xhr.response : xhr.responseText;\n resolve(new Response(body, options))\n }\n\n xhr.onerror = function() {\n reject(new TypeError('Network request failed'))\n }\n\n xhr.open(request.method, request.url, true)\n\n if (request.credentials === 'include') {\n xhr.withCredentials = true\n }\n\n if ('responseType' in xhr && support.blob) {\n xhr.responseType = 'blob'\n }\n\n request.headers.forEach(function(value, name) {\n xhr.setRequestHeader(name, value)\n })\n\n xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit)\n })\n }\n self.fetch.polyfill = true\n})(typeof self !== 'undefined' ? self : this);\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/whatwg-fetch/fetch.js\n ** module id = 13\n ** module chunks = 2 3\n **/","/* global CustomEvent */\n\n/*\n * The MIT License (MIT)\n *\n * Copyright (c) 2015 David Heidrich, BowlingX \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n// polyfill for custom events to make thinks work in IE\n// The needed polyfill is so small that I embedded it here\n(function poly() {\n if (!global.CustomEvent || typeof global.CustomEvent !== 'function') {\n const CustomEvent = function CustomEvent(event, params) {\n const thisParams = params ||\n {\n bubbles: false,\n cancelable: false,\n detail: undefined\n };\n const evt = document.createEvent(\"CustomEvent\");\n evt.initCustomEvent(event, thisParams.bubbles,\n thisParams.cancelable, thisParams.detail);\n return evt;\n };\n CustomEvent.prototype = global.Event.prototype;\n global.CustomEvent = CustomEvent;\n }\n})();\n/**\n * Simpler Event dispatching\n */\nclass EventHandler {\n\n /**\n * @param {HTMLElement} target\n * @param {String} name\n */\n constructor(target, name) {\n this.target = target;\n this.defaultOptions = {\n bubbles: true,\n cancelable: true\n };\n\n this.name = name;\n }\n\n /**\n * Set more options\n * @param {Object} options\n * @returns {EventHandler}\n */\n withOptions(options) {\n Object.assign(this.defaultOptions, (options || {}));\n return this;\n }\n\n /**\n * Call with the originalEvent\n * @param {Event} e\n * @returns {EventHandler}\n */\n withOriginal(e) {\n return this.withDetail({\n originalEvent: e\n });\n }\n\n /**\n * Extends the detail part of the event\n * @param {Object} o\n * @returns {EventHandler}\n */\n withDetail(o) {\n if (!this.defaultOptions.detail) {\n this.defaultOptions.detail = {};\n }\n Object.assign(this.defaultOptions.detail, o);\n return this;\n }\n\n /**\n * @returns {CustomEvent}\n */\n fire() {\n const e = new CustomEvent(this.name, this.defaultOptions);\n if (this.target) {\n this.target.dispatchEvent(e);\n }\n return e;\n }\n}\n\nclass Event {\n /**\n * Prepares to dispatch a custom event (without firing)\n * @param {HTMLElement} target\n * @param {String} name\n * @returns {EventHandler}\n */\n static dispatch(target, name) {\n return new EventHandler(target, name);\n }\n\n /**\n * Dispatches a custom event and fires it directly\n * @param {HTMLElement} target\n * @param {String} name\n * @param {Object} [options]\n * @returns {CustomEvent}\n */\n static dispatchAndFire(target, name, options) {\n return new EventHandler(target, name).withOptions(options).fire();\n }\n}\n\nexport default Event;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/main/util/Event.js\n **/","/*\n * The MIT License (MIT)\n *\n * Copyright (c) 2015 David Heidrich, BowlingX \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n/*!\n * FlexCss.Modal\n * Licensed under the MIT License (MIT)\n * Copyright (c) 2015 David Heidrich, BowlingX \n */\n\n/* global KeyboardEvent */\n\nimport Settings from './util/Settings';\nimport Event from './util/Event';\nimport Util from './util/Util';\nimport Widget from './Widget';\nimport FixedWindow from './lib/FixedWindow';\n\nconst HTML_ELEMENT = global.document.documentElement;\nconst KEY_ESC = 27;\n/* Attribute Names */\nconst ATTR_CREATE_NEW = 'data-new-instance';\nconst ATTR_CLOSE = 'data-close-modal';\nconst ATTR_NAME = 'data-modal';\n\n/* Class names */\nconst CLS_CONTAINER_CURRENT = 'front';\nconst CLS_OPEN = 'open';\nconst CLS_CURRENT = 'current';\nconst CLS_PART_OF_STACK = 'part-of-stack';\nconst CLS_MODAL_OPEN = 'modal-open';\nconst CLS_MODAL_CONTAINER = 'modal-container';\nconst CLS_ANIM_END = 'modal-anim-end';\nconst CLS_LOADER_CONTAINER = 'loader-container';\nconst CLS_LOADER = 'loader';\n\n/* Events */\n\n/**\n * Event triggered when modal is closed\n * @type {string}\n */\nexport const EVENT_MODAL_CLOSED = 'flexcss.modal.closed';\n/**\n * Event triggered before a modal is closed, cancelable\n * @type {string}\n */\nexport const EVENT_MODAL_BEFORE_CLOSED = 'flexcss.modal.beforeClose';\n/**\n * Event triggered when a modal is opened\n * @type {string}\n */\nexport const EVENT_MODAL_OPENED = 'flexcss.modal.opened';\n\n/**\n * Event triggered when modal is initilized, called on target\n * @type {string}\n */\nexport const EVENT_MODAL_INIT = 'flexcss.modal.init';\n\n/**\n * Triggered when the content of an async modal on a target is loaded, called on target\n * @type {string}\n */\nexport const EVENT_MODAL_ASYNC_TARGET_LOADED = 'flexcss.modal.asyncTargetLoaded';\n\n/**\n * A Modal Implementation\n */\nclass Modal {\n constructor(DelegateContainer, options) {\n const doc = global.document;\n const container = DelegateContainer instanceof HTMLElement ?\n DelegateContainer : doc.getElementById(DelegateContainer);\n\n // Instance vars:\n if (!container) {\n throw new Error(`Could not found container element by given ID/Element: ${DelegateContainer}`);\n }\n\n this.currentOpen = null;\n\n this.loading = false;\n\n this.container = container;\n\n /**\n * Default Options\n */\n this.options = {\n classNames: 'modal',\n closeOnEscape: true,\n closeOnBackgroundClick: true,\n destroyOnFinish: false,\n fixedContainer: true,\n containerClassNames: ''\n };\n\n Object.assign(this.options, options);\n\n // Container where events are delegated\n this.eventContainer = null;\n this.eventFunction = null;\n\n this.dataMainPageContainer = global.document.body;\n\n this.currentScrollTop = 0;\n\n this.modalContainer = null;\n\n // Destroy full modal instance when no dialogs are bind to?\n // Otherwise container is recycled\n this.destroyOnFinish = this.options.destroyOnFinish;\n }\n\n /**\n * Removes this modal from global stack\n * Will handle fixing main html element too\n * @private\n * @param n\n */\n _removeModalFromStack(n) {\n const t = Modal._modalInstances.indexOf(n);\n if (t > -1) {\n Modal._modalInstances.splice(t, 1);\n FixedWindow.getInstance().close();\n HTML_ELEMENT.classList.remove(CLS_MODAL_OPEN);\n }\n }\n\n\n /**\n * Modal container that contains all `stacked` modals for this instance\n * @returns {HTMLElement}\n */\n getModalContainer() {\n return this.modalContainer;\n }\n\n /**\n * Closes the current open modal of this stack\n * @params [e], optional event\n * @returns {*}\n */\n close(e) {\n const self = this;\n\n const options = self.currentOpen ? Util.applyOptionsFromElement(\n self.currentOpen, Util.copy(self.options)) : self.options;\n\n // close only on keyboard if instance should\n if (!options.closeOnEscape && e instanceof KeyboardEvent) {\n return false;\n }\n\n // close only on background if instance should\n if (!options.closeOnBackgroundClick && e &&\n e.type === Settings.getTabEvent() && !e.target.hasAttribute(ATTR_CLOSE)) {\n return false;\n }\n\n // if an instance is currently loading, prevent from closing\n if (self.loading) {\n return false;\n }\n\n if (e) {\n e.preventDefault();\n }\n\n if (self.currentOpen) {\n // dispatch beforeClose event, if prevented prevent modal from closing\n var ev = Event.dispatchAndFire(self.currentOpen, EVENT_MODAL_BEFORE_CLOSED);\n if (ev.defaultPrevented) {\n return false;\n }\n\n this._finishState(self.currentOpen);\n // if there is an previous modal\n if (self.currentOpen.prevModal) {\n // switch to the next modal\n return self.switchModals(self.currentOpen.prevModal,\n self.currentOpen.prevModal.prevModal || null);\n }\n\n // finally trigger closed event\n Event.dispatch(self.currentOpen, EVENT_MODAL_CLOSED).withOriginal(e).fire();\n\n }\n self._removeModalFromStack(self.currentOpen);\n\n // Full stack closed:\n self.currentOpen = null;\n if (self.modalContainer) {\n // setup next open\n var lastContainer = Modal._modalInstances[Modal._modalInstances.length - 1],\n classList = self.modalContainer.classList;\n classList.remove(CLS_CONTAINER_CURRENT);\n classList.remove(CLS_OPEN);\n // Remove all current classes from child-nodes\n for (var i = 0; i < self.modalContainer.childNodes.length; i++) {\n var node = self.modalContainer.childNodes[i], cl = node.classList;\n // remove applied styles\n self._finishState(node);\n cl.remove(CLS_CURRENT);\n cl.remove(CLS_PART_OF_STACK);\n }\n if (lastContainer) {\n lastContainer.parentNode.classList.add(CLS_CONTAINER_CURRENT);\n }\n }\n\n if (self.destroyOnFinish) {\n self.destroy();\n }\n return self;\n }\n\n /**\n * Resets a target when newly initilizes\n * @param target\n * @private\n */\n _finishState(target) {\n target.classList.remove(CLS_ANIM_END);\n }\n\n /**\n * Handler called when a Modal has finished an animation\n * @param e\n * @param self\n * @private\n */\n _finishAnim(e, self) {\n e.target.classList.add(CLS_ANIM_END);\n e.target.removeEventListener(e.type, self, true);\n }\n\n /**\n * Brings the given modal to front\n * @param co\n * @param last\n */\n switchModals(co, last) {\n co.prevModal = last;\n Modal._modalInstances.push(co);\n FixedWindow.getInstance().open(this, this.modalContainer);\n if (last) {\n this._finishState(last);\n Util.prefixedAnimateEvent(last, 'AnimationEnd', this._finishAnim);\n last.classList.add(CLS_PART_OF_STACK);\n }\n // set new currentOpen\n this.currentOpen = co;\n\n // bring current container to the front\n var instances = Modal._modalInstances;\n\n for (var m = 0; m < instances.length; m++) {\n instances[m].parentNode.classList.remove(CLS_CONTAINER_CURRENT);\n }\n this.modalContainer.classList.add(CLS_CONTAINER_CURRENT);\n // remove animations if animations has been completed, fixes various bugs:\n // - fixes nested scrolling element issue in iOS Browsers / Mobile-Safari\n Util.prefixedAnimateEvent(co, 'AnimationEnd', this._finishAnim);\n\n for (var i = 0; i < this.modalContainer.childNodes.length; i++) {\n var n = this.modalContainer.childNodes[i], isCurrent = n.classList.contains(CLS_CURRENT);\n if (n === co) {\n co.classList.add(CLS_CURRENT);\n co.classList.remove(CLS_PART_OF_STACK);\n this._finishState(co);\n } else {\n n.classList.remove(CLS_CURRENT);\n if (isCurrent) {\n this._removeModalFromStack(n);\n Event.dispatchAndFire(n, EVENT_MODAL_CLOSED);\n }\n }\n }\n }\n\n handleScrollbar() {\n if (Modal._modalInstances.length === 0) {\n HTML_ELEMENT.classList.add(CLS_MODAL_OPEN);\n }\n }\n\n /**\n * Creates a Modal and opens it (later)\n * @param e\n * @returns {Promise|boolean}\n */\n createWidget(e) {\n var self = this;\n if (this.loading) {\n return false;\n }\n\n // check if another modal has registered events on this dom path:\n if (e && e.target) {\n var foundInstance = Util.parentsUntil(e.target, function (node) {\n return node && node.flexModalInstance;\n });\n\n // if another instance has been found, abort\n if (foundInstance !== this.container) {\n return false;\n }\n }\n var targetContent, future, widget, target, hasTarget = true,\n isHtmlElement = e instanceof HTMLElement, isWidget = Widget.isWidget(e);\n if (isHtmlElement || isWidget) {\n if (isHtmlElement) {\n targetContent = e;\n } else {\n widget = e;\n targetContent = widget.element;\n }\n } else {\n target = e.target;\n if (!target) {\n throw 'Could not find target, did you pass an event, a HTMLElement or an Widget?';\n }\n hasTarget = target.hasAttribute(ATTR_NAME);\n targetContent = target.getAttribute(ATTR_NAME);\n widget = Widget.findWidget(target);\n if (target.hasAttribute(ATTR_CREATE_NEW) && !e.newInstance) {\n var newInstance = new Modal(this.container)\n .setDestroyOnFinish(true);\n e.newInstance = true;\n newInstance.fromEvent(e).then(function () {\n newInstance.registerEvents(newInstance.getModalContainer());\n });\n return false;\n }\n if (hasTarget) {\n e.stopImmediatePropagation();\n e.preventDefault();\n }\n }\n\n if (!hasTarget) {\n return false;\n }\n\n let modalContainerClasses = this.modalContainer ? this.modalContainer.classList : [];\n\n // lazy create modal container\n if (!this.modalContainer) {\n this.modalContainer = global.document.createElement('div');\n this.modalContainer.className = `${CLS_MODAL_CONTAINER} ${this.options.containerClassNames} ${CLS_OPEN}`;\n const closeModalFunction = function (ce) {\n if (self.loading) {\n return false;\n }\n if (Util.isPartOfNode(ce.target, self.currentOpen)) {\n if (!ce.target.hasAttribute(ATTR_CLOSE)) {\n return false;\n }\n }\n self.close(ce);\n };\n\n this.modalContainer.addEventListener(Settings.getTabEvent(), closeModalFunction, false);\n\n modalContainerClasses = this.modalContainer.classList;\n this.container.appendChild(this.modalContainer);\n\n } else {\n modalContainerClasses.add(CLS_OPEN);\n }\n\n let loader, doc = global.document, toggleLoader = function (show) {\n if (show) {\n loader = doc.createElement('div');\n loader.className = CLS_LOADER_CONTAINER;\n var loaderLoader = doc.createElement('div');\n loaderLoader.className = CLS_LOADER;\n loader.appendChild(loaderLoader);\n self.modalContainer.appendChild(loader);\n } else {\n loader.parentNode.removeChild(loader);\n }\n };\n\n this.handleScrollbar();\n\n modalContainerClasses.add(CLS_CONTAINER_CURRENT);\n modalContainerClasses.add('loading');\n this.loading = true;\n toggleLoader(true);\n var async = widget ? widget.getAsync() : null;\n if (Widget.isWidget(widget) && async) {\n future = async.then(function (r) {\n var result;\n if (r instanceof HTMLElement || r instanceof DocumentFragment) {\n result = r;\n } else {\n // Create container Element:\n var element = doc.createElement('div');\n element.className = self.options.classNames;\n element.innerHTML = r;\n element.id = Util.guid();\n result = element;\n }\n widget.finalContent = result;\n Event.dispatchAndFire(target, EVENT_MODAL_ASYNC_TARGET_LOADED);\n return result;\n });\n } else {\n var el = targetContent instanceof HTMLElement ||\n targetContent instanceof DocumentFragment ? targetContent : doc.getElementById(targetContent);\n if (el) {\n future = new Promise((resolve) => {\n resolve(el);\n });\n } else {\n throw 'Could not found given modal element (content) with ID: ' + targetContent;\n }\n }\n\n Event.dispatchAndFire(target, EVENT_MODAL_INIT);\n\n return future.then((thisEl) => {\n thisEl.hfWidgetInstance = self;\n self.modalContainer.appendChild(thisEl);\n modalContainerClasses.remove('loading');\n self.loading = false;\n toggleLoader(false);\n\n self.open(thisEl, true, e);\n\n return thisEl;\n });\n }\n\n /**\n * Open's an already rendered modal\n * @param {HTMLElement} modal\n * @param {Boolean} [internal], set to true to prevent container management\n * @param {Boolean} [maybeEvent], optional event-object that triggered open\n */\n open(modal, internal, maybeEvent) {\n\n\n if (!internal) {\n this.modalContainer.classList.add('open');\n this.handleScrollbar();\n }\n this.switchModals(modal, this.currentOpen);\n\n Event.dispatch(modal, EVENT_MODAL_OPENED).withOriginal(maybeEvent).fire();\n }\n\n\n registerEvents(delegate) {\n var delegateContainer = delegate || this.container, self = this;\n // Modals should always be fixed\n FixedWindow.getInstance().addScreenConstraint(Modal, (width) => true);\n // register modal instance so we can detect multiple registrars\n delegateContainer.flexModalInstance = self;\n self.eventFunction = function () {\n self.createWidget.apply(self, arguments);\n };\n delegateContainer.addEventListener(Settings.getTabEvent(), self.eventFunction, false);\n\n self.eventContainer = delegateContainer;\n return self;\n }\n\n\n /**\n * Creates a new Dialog Instance either directly from HTML Element or a Widget instance\n * @param {HTMLElement|Widget} widget instance or html element\n * @returns {Promise}\n */\n fromWidget(widget) {\n return this.createWidget(widget);\n }\n\n /**\n * Creates a Widget from event\n * @param e\n * @returns {Promise}\n */\n fromEvent(e) {\n return this.createWidget(e);\n }\n\n setDestroyOnFinish(v) {\n this.destroyOnFinish = v;\n return this;\n }\n\n /**\n * Destroy this widget instance, cleans empty DOM nodes\n * Will use fast MutationObserver if available, otherwise falls back to DOMNodeRemoved event\n */\n destroy() {\n let self = this, modalContainer = this.modalContainer;\n const isEmptyContainer = modalContainer.childNodes.length === 0;\n // Remove event listener on destroy, do not remove DOM node\n if (self.eventContainer) {\n self.eventContainer.removeEventListener(Settings.getTabEvent(), self.eventFunction, true);\n }\n\n if (isEmptyContainer) {\n if (modalContainer.parentNode) {\n modalContainer.parentNode.removeChild(modalContainer);\n }\n }\n if (global.MutationObserver) {\n var observer = new MutationObserver(function (mutations) {\n mutations.forEach(function () {\n if (isEmptyContainer) {\n modalContainer.parentNode.removeChild(modalContainer);\n observer.disconnect();\n }\n });\n });\n observer.observe(modalContainer, {childList: true});\n } else {\n modalContainer.addEventListener('DOMNodeRemoved', function (e) {\n if (e.target !== modalContainer && (modalContainer.childNodes.length - 1) === 0) {\n modalContainer.parentNode.removeChild(modalContainer);\n }\n });\n }\n }\n}\n\n\n// Static variable that keeps track of all open modals\nModal._modalInstances = [];\n\n// Global keydown listener for modal\nglobal.addEventListener('keydown', function (e) {\n if (e.keyCode === KEY_ESC) {\n var lastModal = Modal._modalInstances[Modal._modalInstances.length - 1];\n if (lastModal) {\n Widget.findWidget(lastModal).close(e);\n }\n }\n});\n\nexport default Modal;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/main/Modal.js\n **/","/*\n * The MIT License (MIT)\n *\n * Copyright (c) 2015 David Heidrich, BowlingX \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n/*!\n * FlexCss.Widget\n * Licensed under the MIT License (MIT)\n * Copyright (c) 2015 David Heidrich, BowlingX \n */\n\n/**\n * A Widget provides async content on a specific target (e.g. a modal link)\n */\nclass Widget {\n\n /**\n * Creates a new Widget\n * @param [element], optional define the content of widget\n */\n constructor(element) {\n /**\n *\n * @type {Promise}\n */\n this.asyncContent = null;\n\n /**\n * @type {boolean}\n */\n this._isWidget = true;\n\n if (element) {\n /**\n * @type {HTMLElement}\n */\n this.element = element instanceof HTMLElement ? element : global.document.getElementById(element);\n if (this.element) {\n this.element.hfWidgetInstance = this;\n this.setAsync(() => {\n return new Promise((s) => {\n s(this.element);\n });\n });\n } else {\n throw new Error(`Could not found element with ID: ${element}`);\n }\n }\n /**\n * The final resulted content that a widget did create (e.g. a modal container)\n * @type {HTMLElement}\n */\n this.finalContent = null;\n }\n\n /**\n *\n * @returns {Promise}\n */\n getAsync() {\n return this.asyncContent();\n }\n\n /**\n * @param {Function.} async\n * @returns {Widget}\n */\n setAsync(async) {\n this.asyncContent = async;\n return this;\n }\n\n /**\n * @returns {HTMLElement}\n */\n getFinalContent() {\n return this.finalContent;\n }\n\n /**\n * @param {HTMLElement} element\n * @returns {Widget}\n */\n setElement(element) {\n this.element = element;\n return this;\n }\n\n /**\n * Destroys the generated content of this widget\n * @returns {boolean}\n */\n destroy() {\n if (this.finalContent && this.finalContent.parentNode) {\n this.finalContent.parentNode.removeChild(this.finalContent);\n return true;\n }\n\n delete this.element;\n delete this.asyncContent;\n delete this.finalContent;\n\n return false;\n }\n\n /**\n * Will find a widget on an Element\n * @param {HTMLElement} element\n * @returns {Widget|undefined}\n */\n static findWidget(element) {\n return element ? element.hfWidgetInstance : undefined;\n }\n\n /**\n * Checks if a given object is an instance\n * @param {Object} self\n * @returns {boolean}\n */\n static isWidget(self) {\n return self instanceof Widget || typeof self === 'object' && self.hasOwnProperty('_isWidget');\n }\n}\n\nexport default Widget;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/main/Widget.js\n **/","import Settings from '../util/Settings';\nimport debounce from './debounce';\nimport Event from '../util/Event';\nimport Util from '../util/Util';\n\nconst CLS_FIXED_WINDOW = 'fixed-window-open';\n\nexport const EVENT_BEFORE_FIXED_ADD = 'flexcss.fixedWindow.beforeAdd';\nexport const EVENT_AFTER_FIXED_REMOVE = 'flexcss.fixedWindow.afterRemove';\n\n/**\n * @type {FixedWindow}\n */\nlet fixedWindowInstance;\n\nexport default class FixedWindow {\n\n constructor() {\n this.widgets = [];\n this.currentScrollTop = 0;\n this.fixedScreenConstraints = [];\n this.windowWidth = 0;\n this.isFixedWindowActive = false;\n this.touchListener = null;\n }\n\n /**\n * Adds a constraint to detect if the window needs to be changed when the screensize changes\n *\n * @param {Function} widget\n * @param {Function} fixedBreakpointFn gets a width argument, return true to open a window\n */\n addScreenConstraint(widget, fixedBreakpointFn) {\n this.fixedScreenConstraints[widget] = fixedBreakpointFn;\n }\n\n /**\n * @returns {null|DestroyableWidget}\n */\n getCurrentWidget() {\n return this.widgets.length > 0 ? this.widgets[this.widgets.length - 1] : null;\n }\n\n /**\n * @private\n */\n _checkFixedNeeded() {\n if (this.widgets.length === 0) {\n return;\n }\n const widgets = new Set(this.widgets);\n const widgetsThatRequireFixedWindow = Array.from(widgets).some(({ widget }) => {\n return this.fixedScreenConstraints[widget] && this.fixedScreenConstraints[widget](this.windowWidth);\n });\n if (!widgetsThatRequireFixedWindow) {\n this._removeFixedContainer();\n } else {\n this._addFixedContainer();\n }\n }\n\n /**\n * @private\n */\n _addFixedContainer() {\n if (this.isFixedWindowActive) {\n return;\n }\n Event.dispatchAndFire(global.document, EVENT_BEFORE_FIXED_ADD, {\n detail: this.getCurrentWidget()\n });\n // this causes layout and should be optimized\n // At lest we write in a batch later\n Settings.get().scrollbarUpdateNodes.map((n) => {\n let foundProperty = 'paddingRight';\n let direction = 1;\n let node = n;\n if (n instanceof Array) {\n const [whatNode, property, d] = n;\n foundProperty = property;\n node = whatNode;\n direction = d || 1;\n }\n return {\n node,\n property: foundProperty,\n value: `${parseInt(global.getComputedStyle(node)[foundProperty], 10) +\n (!node.__fixedWindowMod__ ? (Settings.getScrollbarWidth() * direction) : 0)}px`\n };\n }).forEach((d) => {\n d.node.__fixedWindowMod__ = true;\n d.node.style[d.property] = d.value;\n });\n\n this.touchListener = (e) => {\n e.preventDefault();\n };\n\n let shouldNotMove = false;\n this.touchStartListener = (e) => {\n const { element } = this.getCurrentWidget();\n if (Util.isPartOfNode(e.target, element)) {\n if (element.scrollTop === 0) {\n element.scrollTop = 1;\n shouldNotMove = true;\n } else if (element.scrollHeight === element.scrollTop + element.offsetHeight) {\n shouldNotMove = true;\n element.scrollTop -= 1;\n }\n }\n };\n\n global.addEventListener('touchmove', this.touchListener);\n global.document.body.addEventListener('touchstart', this.touchStartListener);\n\n this.touchMoveListener = (e) => {\n const { element } = this.getCurrentWidget();\n if (Util.isPartOfNode(e.target, element)) {\n if (!shouldNotMove) {\n e.stopImmediatePropagation();\n }\n shouldNotMove = false;\n }\n };\n global.document.body.addEventListener('touchmove', this.touchMoveListener);\n\n global.document.documentElement.classList.add(CLS_FIXED_WINDOW);\n this.isFixedWindowActive = true;\n }\n\n /**\n * @private\n */\n _removeFixedContainer() {\n if (this.isFixedWindowActive) {\n // cleanup event listeners\n global.removeEventListener('touchmove', this.touchListener);\n global.document.body.removeEventListener('touchstart', this.touchStartListener);\n global.document.body.removeEventListener('touchmove', this.touchMoveListener);\n\n // reset scrollbar nodes\n Settings.get().scrollbarUpdateNodes.forEach((node) => {\n if (node instanceof Array) {\n const [whatNode, property] = node;\n delete whatNode.__fixedWindowMod__;\n whatNode.style[property] = '';\n } else {\n delete node.__fixedWindowMod__;\n node.style.paddingRight = '';\n }\n });\n global.document.documentElement.classList.remove(CLS_FIXED_WINDOW);\n Event.dispatchAndFire(global.document, EVENT_AFTER_FIXED_REMOVE);\n this.isFixedWindowActive = false;\n }\n }\n\n /**\n * Will close a window when no widgets are opened that need one\n */\n resizeListener() {\n this.windowWidth = global.innerWidth;\n this._checkFixedNeeded();\n }\n\n /**\n * @returns {FixedWindow}\n */\n static getInstance() {\n if (!fixedWindowInstance) {\n fixedWindowInstance = new FixedWindow();\n fixedWindowInstance.windowWidth = global.innerWidth;\n const eventHandler = fixedWindowInstance.resizeListener.bind(fixedWindowInstance);\n global.addEventListener(\n 'resize',\n debounce(eventHandler, 500)\n );\n global.addEventListener('orientationchange', eventHandler);\n }\n return fixedWindowInstance;\n }\n\n /**\n * Request a close of the fixed window\n */\n close() {\n this.widgets.pop();\n if (this.widgets.length === 0) {\n this._removeFixedContainer();\n resolve();\n }\n }\n\n /**\n * Request to open a fixed windows\n * @param {Object|DestroyableWidget} instance\n * @param {HTMLElement} element\n */\n open(instance, element) {\n let fixed = false;\n if (typeof instance === 'object') {\n const widget = instance.constructor;\n const fixedWidget = this.fixedScreenConstraints[instance.constructor];\n if (widget && fixedWidget) {\n fixed = fixedWidget(this.windowWidth);\n }\n const length = this.widgets.length;\n this.widgets.push(\n {\n widget,\n element\n }\n );\n // open a new window if there is no window active\n if (length === 0) {\n if (fixed) {\n this._addFixedContainer();\n }\n }\n }\n }\n}\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/main/lib/FixedWindow.js\n **/","export default (fn, ms) => () => {\n clearTimeout(fn.timeout);\n fn.timeout = setTimeout(fn, ms);\n};\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/main/lib/debounce.js\n **/","/*\n * The MIT License (MIT)\n *\n * Copyright (c) 2015 David Heidrich, BowlingX \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n/*!\n * FlexCss.Toggleable\n * Licensed under the MIT License (MIT)\n * Copyright (c) 2015 David Heidrich, BowlingX \n */\n\nimport Settings from './util/Settings';\nimport Widget from './Widget';\nimport Util from './util/Util';\nimport Event from './util/Event';\n\n/**\n * Event that is fired when a tab is closed\n * @type {string}\n */\n\nexport const EVENT_TAB_CLOSED = 'flexcss.tab.closed';\n\n/**\n * Event that is fired when a tab has been opened\n * @type {string}\n */\nexport const EVENT_TAB_OPENED = 'flexcss.tab.opened';\n/**\n * @type {string}\n */\nconst ATTR_NAME = 'data-toggle';\n/**\n * @type {string}\n */\nconst ACTIVE_CLASS = 'active';\n/**\n * @type {string}\n */\nconst LOADING_CLASS = 'loading';\n\n/**\n * @type {string}\n */\nconst ATTR_TOGGLE_LIST = 'data-toggle-list';\n\n/**\n * Creates a toggleable element, either for tabs or a single toggle\n */\nclass Toggleable {\n constructor(ContainerId) {\n const doc = global.document;\n\n this.container = ContainerId instanceof HTMLElement ? ContainerId :\n doc.getElementById(ContainerId);\n\n this.loading = false;\n\n if (!this.container) {\n throw new Error(`Toggleable container with id ${ContainerId} not found`);\n }\n }\n\n /**\n * Listener\n * @param {Event} e\n * @private\n */\n _listener(e) {\n let target = e.target;\n const parent = target.parentNode;\n const doc = global.document;\n\n // support target child element to clicked\n if (!target.hasAttribute(ATTR_NAME)) {\n if (parent && parent.hasAttribute(ATTR_NAME)) {\n target = parent;\n } else {\n return;\n }\n }\n\n if (!target.hasAttribute(ATTR_NAME)) {\n return;\n }\n\n const refId = target.getAttribute(ATTR_NAME);\n const ref = doc.getElementById(refId);\n\n e.preventDefault();\n\n if (this.loading) {\n return;\n }\n\n this.toggleTarget(ref, target);\n }\n\n /**\n * Registers Events for this instance\n * @returns {Toggleable}\n */\n registerEvents() {\n this.container.addEventListener(Settings.getTabEvent(), this._listener.bind(this));\n return this;\n }\n\n /**\n * Toggles given `ref`\n * @param {HTMLElement|Node} ref\n * @param {HTMLElement|Node} [selfTarget] optional target node\n */\n toggleTarget(ref, selfTarget) {\n let target = selfTarget;\n if (!target && !ref) {\n return;\n }\n if (!target) {\n target = document.querySelector(`[${ATTR_NAME}=\"${ref.id}\"]`);\n }\n\n let future;\n const elClassList = target.classList;\n const parent = target.parentNode;\n const doc = global.document;\n\n future = new Promise((resolve, failure) => {\n if (ref) {\n resolve(ref);\n } else {\n const widget = Widget.findWidget(target);\n const async = widget ? widget.getAsync() : null;\n if (Widget.isWidget(widget) && async) {\n future = async.then((r) => {\n if (r instanceof HTMLElement) {\n const id = Util.guid();\n r.id = id;\n target.setAttribute(ATTR_NAME, id);\n resolve(r);\n } else {\n throw new Error(`Dynamically creating toggle-content is not supported right now.\n Return an HTMLElement instance`);\n }\n });\n } else {\n failure('Target not given');\n }\n }\n });\n\n if (parent) {\n const maybeToggleNode = Util.parentsUntil(target, (node) => {\n return node && node.hasAttribute && node.hasAttribute(ATTR_TOGGLE_LIST);\n });\n\n const parentClassList = parent.classList;\n // Abort if element is already active and if is part of a toggle list\n if (maybeToggleNode) {\n if (!parentClassList.contains(ACTIVE_CLASS)) {\n parentClassList.toggle(ACTIVE_CLASS);\n parentClassList.add(LOADING_CLASS);\n } else {\n return;\n }\n }\n\n if (maybeToggleNode) {\n for (let i = 0; i < maybeToggleNode.children.length; i++) {\n const n = maybeToggleNode.children[i];\n const targetRef = n.children[0];\n if (n !== parent) {\n n.classList.remove(ACTIVE_CLASS);\n if (targetRef) {\n const attr = targetRef.getAttribute(ATTR_NAME);\n const el = attr ? doc.getElementById(attr) : null;\n if (el) {\n Event.dispatchAndFire(el, EVENT_TAB_CLOSED);\n el.classList.remove(ACTIVE_CLASS);\n targetRef.classList.remove(ACTIVE_CLASS);\n }\n }\n }\n }\n }\n }\n if (elClassList) {\n elClassList.toggle(ACTIVE_CLASS);\n elClassList.add(LOADING_CLASS);\n }\n this.loading = true;\n future.then((r) => {\n Event.dispatchAndFire(r, EVENT_TAB_OPENED);\n Toggleable._handleLoaded(target);\n r.classList.toggle(ACTIVE_CLASS);\n this.loading = false;\n }).catch(() => {\n this.loading = false;\n Toggleable._handleLoaded(target);\n });\n }\n\n /**\n * @param el\n * @private\n */\n static _handleLoaded(el) {\n const parentClassList = el.parentNode.classList;\n el.classList.remove(LOADING_CLASS);\n if (parentClassList) {\n parentClassList.remove(LOADING_CLASS);\n }\n }\n}\n\nexport default Toggleable;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/main/Toggleable.js\n **/","/*\n * The MIT License (MIT)\n *\n * Copyright (c) 2015 David Heidrich, BowlingX \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n/*!\n * FlexCss.OffCanvas\n * Licensed under the MIT License (MIT)\n * Copyright (c) 2015 David Heidrich, BowlingX \n */\n\nimport Settings from './util/Settings';\nimport Util from './util/Util';\nimport Event from './util/Event';\nimport FixedWindow from './lib/FixedWindow';\n\n/**\n * @type {string}\n */\nconst ATTR_CLOSE_SIDEBAR = 'data-close-offcanvas';\n\n/**\n * @type {string}\n */\nconst ATTR_TARGET = 'data-offcanvas';\n/**\n * @type {string}\n */\nconst INIT_CLASS = 'init';\n/**\n * @type {string}\n */\nconst OPEN_CLASS = 'open';\n/**\n * @type {number}\n */\nconst HIDE_FACTOR = 3;\n\n/**\n * @type {string}\n */\nexport const EVENT_TOGGLE = 'flexcss.offcanvas.toggle';\n\n/**\n * A OffCanvas Implementation\n */\nclass OffCanvas {\n\n /**\n * Creates an off-canvas navigation\n * @param {HTMLElement|String} NavigationId\n * @param {HTMLElement|String} Darkener\n * @param {int} factor positive will expect right sidebar, positive left\n * @param {bool} [disableTouch] if true all touch events are disabled\n * @constructor\n */\n constructor(NavigationId, Darkener, factor, disableTouch) {\n const doc = global.document;\n let touchedX = 0;\n const navigationContainer = NavigationId instanceof HTMLElement ?\n NavigationId : doc.getElementById(NavigationId);\n const darkener = Darkener instanceof HTMLElement ? Darkener : doc.getElementById(Darkener);\n const DARKENER_CLASS_TOGGLE = `toggle-${darkener.id}` || 'darkener';\n const DARKENER_CLASS_INSTANT_TOGGLE = `${DARKENER_CLASS_TOGGLE}-open`;\n\n const shouldNotTouch = () => {\n return window.innerWidth >= Settings.get().smallBreakpoint;\n };\n\n if (!darkener || !navigationContainer) {\n throw new Error('Could not find needed elements (Darkener and/or NavigationId)');\n }\n\n this.darkener = darkener;\n this.darkenerClassToggle = DARKENER_CLASS_TOGGLE;\n this.darkenerClassToggleInstant = DARKENER_CLASS_INSTANT_TOGGLE;\n this.globalToggleClass = Settings.get().canvasToggledClass;\n\n this.navigationContainer = navigationContainer;\n this.navigationContainerId = navigationContainer.id;\n\n // create id if id does not exist\n if (!this.navigationContainerId) {\n this.navigationContainerId = Util.guid();\n navigationContainer.id = this.navigationContainerId;\n }\n\n if (!disableTouch) {\n navigationContainer.addEventListener('touchstart', (e) => {\n if (shouldNotTouch()) {\n return;\n }\n touchedX = e.touches[0].clientX;\n navigationContainer.mustHide = false;\n });\n navigationContainer.addEventListener('touchmove', (e) => {\n if (shouldNotTouch()) {\n return;\n }\n const { clientX } = e.touches[0];\n const target = navigationContainer;\n const style = target.style;\n const calcX = touchedX - clientX;\n const bounds = target.getBoundingClientRect();\n const compare = factor > 0 ? calcX <= 0 : calcX >= 0;\n if (compare) {\n style.transition = 'transform 0s ease';\n style.webkitTransition = '-webkit-transform 0s ease';\n target.mustHide = factor > 0 ? calcX * -1 >\n bounds.width / HIDE_FACTOR : calcX > bounds.width / HIDE_FACTOR;\n const transform = `translate3d(${calcX * -1}px,0,0)`;\n style.transform = transform;\n style.webkitTransform = transform;\n }\n });\n navigationContainer.addEventListener('touchend', () => {\n if (shouldNotTouch()) {\n return;\n }\n const target = navigationContainer;\n const style = target.style;\n if (target.mustHide) {\n const width = target.getBoundingClientRect().width * factor;\n style.transition = 'transform .2s ease';\n style.webkitTransition = '-webkit-transform .2s ease';\n const transform = `translate3d(${width}px,0,0)`;\n style.transform = transform;\n style.webkitTransform = transform;\n this._remove().then(() => {\n this.resetTransform(style);\n });\n this._removeInstant();\n } else {\n this.resetTransform(style);\n }\n });\n }\n }\n\n /**\n * @param {Object} s\n */\n resetTransform(s) {\n s.transform = '';\n s.transition = '';\n s.webkitTransform = '';\n s.webkitTransition = '';\n }\n\n /**\n * @param {Object} [event]\n * @private\n */\n _remove(event) {\n return new Promise((resolve) => {\n Util.addEventOnce(Settings.getTransitionEvent(), this.navigationContainer, function scheduler(e) {\n if (e.target !== this.navigationContainer) {\n return Util.addEventOnce(Settings.getTransitionEvent(),\n this.navigationContainer, scheduler.bind(this));\n }\n requestAnimationFrame(() => {\n OffCanvas.currentOpen = null;\n const docCls = global.document.documentElement.classList;\n docCls.remove(this.darkenerClassToggle);\n docCls.remove(this.globalToggleClass);\n if (!!event) {\n Event.dispatchAndFire(this.navigationContainer, EVENT_TOGGLE);\n }\n resolve();\n });\n }.bind(this));\n });\n }\n\n /**\n * @private\n */\n _removeInstant() {\n this.navigationContainer.classList.remove(OPEN_CLASS);\n global.document.documentElement.classList.remove(this.darkenerClassToggleInstant);\n this.darkener.classList.remove(INIT_CLASS);\n FixedWindow.getInstance().close();\n }\n\n /**\n * Toggles a an off-canvas element\n * @param [e]\n * @private\n */\n toggle(e) {\n if (e) {\n e.preventDefault();\n }\n this.resetTransform(this.navigationContainer.style);\n const darkenerClass = this.darkener.classList;\n const DARKENER_CLASS_TOGGLE = this.darkenerClassToggle;\n const DARKENER_CLASS_INSTANT_TOGGLE = this.darkenerClassToggleInstant;\n const navigationControllerClassList = this.navigationContainer.classList;\n if (!OffCanvas.currentOpen) {\n Util.addEventOnce(Settings.getTransitionEvent(), this.navigationContainer, () => {\n if (!!e) {\n Event.dispatchAndFire(this.navigationContainer, EVENT_TOGGLE);\n }\n });\n OffCanvas.currentOpen = this;\n FixedWindow.getInstance().open(this, this.navigationContainer);\n const docElementCls = global.document.documentElement.classList;\n docElementCls.add(this.globalToggleClass);\n docElementCls.add(DARKENER_CLASS_INSTANT_TOGGLE);\n docElementCls.add(DARKENER_CLASS_TOGGLE);\n darkenerClass.add(INIT_CLASS);\n navigationControllerClassList.add(OPEN_CLASS);\n } else {\n return this.close(e);\n }\n }\n\n close(event) {\n if (this.navigationContainer.classList.contains(OPEN_CLASS)) {\n const promise = this._remove(event);\n this._removeInstant();\n return promise;\n }\n return new Promise(r => r());\n }\n\n /**\n * Register events\n * @param [delegate]\n */\n registerEvents(delegate) {\n const thisDelegate = delegate || global.document;\n FixedWindow.getInstance().addScreenConstraint(OffCanvas, (width) => width < Settings.get().smallBreakpoint);\n thisDelegate.addEventListener(Settings.getTabEvent(), (e) => {\n if (OffCanvas.currentOpen && OffCanvas.currentOpen !== this) {\n return;\n }\n const id = this.navigationContainerId;\n const validTarget = e.target.getAttribute(ATTR_TARGET) === id;\n if (!Util.isPartOfNode(e.target, this.navigationContainer)) {\n if (validTarget || (OffCanvas.currentOpen === this && e.target === this.darkener)) {\n this.toggle(e);\n }\n } else {\n if (e.target.hasAttribute(ATTR_CLOSE_SIDEBAR)) {\n this.toggle(e);\n }\n }\n });\n }\n}\n\nOffCanvas.currentOpen = null;\n\nexport default OffCanvas;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/main/OffCanvas.js\n **/","/*\n * The MIT License (MIT)\n *\n * Copyright (c) 2015 David Heidrich, BowlingX \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n/*!\n * FlexCss.Dropdown\n * Licensed under the MIT License (MIT)\n * Copyright (c) 2015 David Heidrich, BowlingX \n */\n\nimport Util from './util/Util';\nimport Settings from './util/Settings';\nimport Event from './util/Event';\nimport Widget from './Widget';\nimport FixedWindow from './lib/FixedWindow';\n\n/**\n * @type {string}\n */\nconst ATTR_CC = 'data-collision-container';\n/**\n * @type {string}\n */\nconst ATTR_DARKENER = 'data-darkener-container';\n/**\n * @type {string}\n */\nconst DARKENER_INIT = 'init';\n/**\n * @type {string}\n */\nconst ATTR_DATA_TARGET = 'data-target';\n/**\n * @type {string}\n */\nconst ATTR_CLOSE_DROPDOWN = 'data-close-dropdown';\n/**\n * @type {string}\n */\nconst ATTR_NAME = 'data-dropdown';\n/**\n * @type {string}\n */\nconst STATE_LOADING = 'loading';\n\nconst CLS_DARKENER_DROPDOWN = 'darkener-dropdown';\n/**\n * @type {string}\n */\nconst CLS_OPEN = 'open';\n\n/**\n * @type {string}\n */\nconst CLS_DROPDOWN = 'dropdown';\n\n/**\n * @type {string}\n */\nexport const EVENT_DROPDOWN_CLOSED = 'flexcss.dropdown.closed';\n\n/**\n * A Dropdown\n */\nclass Dropdown {\n constructor(DelegateContainer, Darkener) {\n const doc = global.document;\n\n /**\n * Container Element\n * @type {HTMLElement}\n */\n this.container = DelegateContainer instanceof HTMLElement ?\n DelegateContainer : doc.getElementById(DelegateContainer);\n\n this.currentOpen = null;\n this.currentTarget = null;\n /**\n * @type {HTMLElement}\n */\n this.darkener = Darkener instanceof HTMLElement ? Darkener : document.getElementById(Darkener);\n\n this.destroyOnClose = false;\n\n if (!this.darkener || !this.container) {\n throw new Error('required elements not found (darkener and container element)');\n }\n }\n\n /**\n * Method that handles delegation events for dropdowns\n * @param e\n * @returns {boolean}\n * @private\n */\n _delegateFunction(e) {\n const currentOpen = this.currentOpen;\n const target = Util.closestCallback(e.target, n => n instanceof HTMLElement && n.hasAttribute(ATTR_NAME));\n const targetIsCurrent = target === this.currentTarget;\n\n if (currentOpen && !Util.isPartOfNode(e.target, currentOpen) || targetIsCurrent) {\n this.close();\n if (targetIsCurrent) {\n e.preventDefault();\n }\n return targetIsCurrent ? false : this._delegateFunction(e);\n }\n\n if (target && !currentOpen) {\n e.preventDefault();\n e.stopImmediatePropagation();\n\n if (target.isLoading) {\n return false;\n }\n this.createDropdown(target);\n } else {\n if (currentOpen) {\n if (e.target.hasAttribute(ATTR_CLOSE_DROPDOWN)) {\n e.preventDefault();\n this.close();\n }\n if (!Util.isPartOfNode(e.target, currentOpen)) {\n this.close();\n }\n }\n }\n }\n\n /**\n * Register Events for this dropdown container\n * @returns {Dropdown}\n */\n registerEvents() {\n FixedWindow.getInstance().addScreenConstraint(Dropdown, (width) => width < Settings.get().smallBreakpoint);\n this.container.addEventListener(Settings.getTabEvent(), this._delegateFunction.bind(this), true);\n return this;\n }\n\n /**\n * Destroys this instance, unbinds events\n * @returns {Dropdown}\n */\n destroy() {\n this.container.removeEventListener(Settings.getTabEvent(), this._delegateFunction.bind(this), true);\n return this;\n }\n\n\n /**\n * Destroys instance on close of dropdown\n * @param v\n * @returns {Dropdown}\n */\n setDestroyOnClose(v) {\n this.destroyOnClose = v;\n return this;\n }\n\n\n /**\n * Will add the right class to container for specific darkener id\n * @param instance\n * @param show\n */\n toggleDarkenerToggler(instance, show) {\n const cls = `toggle-${(instance.id || CLS_DARKENER_DROPDOWN)}`;\n const classList = this.container.classList;\n if (show) {\n classList.add(cls);\n } else {\n classList.remove(cls);\n }\n }\n\n /**\n * Closes Dropdown on current instance\n * @return {Boolean|Promise}\n */\n close() {\n const currentOpen = this.currentOpen;\n if (!currentOpen) {\n return false;\n }\n const darkenerInstance = currentOpen.flexDarkenerInstance || this.darkener;\n const thisCurrentOpen = currentOpen;\n\n const future = new Promise((resolve) => {\n if (window.getComputedStyle(currentOpen).position === 'fixed') {\n Util.addEventOnce(Settings.getTransitionEvent(), currentOpen, function scheduler(e) {\n if (e.srcElement !== currentOpen) {\n return Util.addEventOnce(Settings.getTransitionEvent(), currentOpen, scheduler.bind(this));\n }\n requestAnimationFrame(() => {\n Event.dispatchAndFire(thisCurrentOpen, EVENT_DROPDOWN_CLOSED);\n // if a new dropdown has been opened in the meantime, do not remove darkener\n if (this.currentOpen !== null) {\n return false;\n }\n this.toggleDarkenerToggler(darkenerInstance, false);\n resolve(true);\n });\n }.bind(this));\n } else {\n resolve(true);\n Event.dispatchAndFire(thisCurrentOpen, EVENT_DROPDOWN_CLOSED);\n }\n });\n\n FixedWindow.getInstance().close();\n currentOpen.classList.remove(CLS_OPEN);\n\n if (currentOpen.flexDarkenerInstance) {\n currentOpen.flexDarkenerInstance.classList.remove(DARKENER_INIT);\n } else {\n this.darkener.classList.remove(DARKENER_INIT);\n }\n\n this.currentOpen = null;\n this.currentTarget = null;\n\n if (this.destroyOnClose) {\n this.destroy();\n }\n\n return future;\n }\n\n /**\n * Creates a dropdown on given target and opens it\n * @param {HTMLElement} target target where this dropdown is placed\n * @param {FlexCss.Widget} [thisWidget] if given will use widget instead of widget instance\n * @return {FlexCss.Dropdown}\n */\n createDropdown(target, thisWidget) {\n const doc = global.document;\n\n if (!target) {\n throw new Error('Dropdown target not found');\n }\n\n const widget = thisWidget || Widget.findWidget(target);\n let future;\n const data = target.getAttribute(ATTR_NAME);\n const dropdownContainerElement = doc.getElementById(data);\n const async = !dropdownContainerElement && Widget.isWidget(widget) ? widget.getAsync() : false;\n\n if (async) {\n target.classList.add(STATE_LOADING);\n target.isLoading = true;\n future = async.then((r) => {\n if (r instanceof HTMLElement) {\n if (r.id) {\n target.setAttribute(ATTR_NAME, r.id);\n }\n return r;\n }\n // Create container Element:\n const element = doc.createElement('div');\n element.className = CLS_DROPDOWN;\n element.innerHTML = r;\n element.id = Util.guid();\n // Cache target for later use:\n target.setAttribute(ATTR_NAME, element.id);\n this.container.appendChild(element);\n return element;\n }).then((r) => {\n target.isLoading = false;\n target.classList.remove(STATE_LOADING);\n return r;\n });\n } else {\n if (!dropdownContainerElement) {\n throw new Error(`Could not found Dropdown container with ID \"${data}\"`);\n }\n future = new Promise((r) => {\n r(dropdownContainerElement);\n });\n }\n\n future.then((dropdownContent) => {\n if (this.currentOpen) {\n this.close();\n }\n // Skip one frame to show animation\n target.dropdownContent = dropdownContent;\n const isAbsolute = global.getComputedStyle(dropdownContent).position === 'absolute';\n dropdownContent.hfWidgetInstance = this;\n\n if (!target.flexCollisionContainer) {\n const collisionC = target.getAttribute(ATTR_CC);\n target.flexCollisionContainer = collisionC ?\n doc.getElementById(collisionC) || document.documentElement : document.documentElement;\n }\n\n dropdownContent.classList.toggle(CLS_OPEN);\n if (dropdownContent.classList.contains(CLS_OPEN)) {\n this.currentOpen = dropdownContent;\n this.currentTarget = target;\n }\n FixedWindow.getInstance().open(this, dropdownContent);\n if (isAbsolute) {\n // Check collision:\n let selfTarget = target.getAttribute(ATTR_DATA_TARGET);\n selfTarget = selfTarget ? doc.getElementById(selfTarget) : target;\n Util.setupPositionNearby(selfTarget, dropdownContent, target.flexCollisionContainer);\n } else {\n // optionally get custom darkener container for target\n const d = target.getAttribute(ATTR_DARKENER);\n if (d) {\n dropdownContent.flexDarkenerInstance = doc.getElementById(d);\n (dropdownContent.flexDarkenerInstance || this.darkener).classList.toggle(DARKENER_INIT);\n } else {\n this.darkener.classList.toggle(DARKENER_INIT);\n }\n this.toggleDarkenerToggler(dropdownContent.flexDarkenerInstance || this.darkener, true);\n\n dropdownContent.style.left = '0';\n dropdownContent.style.top = 'auto';\n }\n });\n }\n\n}\n\nexport default Dropdown;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/main/Dropdown.js\n **/","/*\n * The MIT License (MIT)\n *\n * Copyright (c) 2015 David Heidrich, BowlingX \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n/*!\n * FlexCss.LightBox\n * Licensed under the MIT License (MIT)\n * Copyright (c) 2015 David Heidrich, BowlingX \n */\n\n/* global Image, TouchEvent*/\n\nimport Modal, { EVENT_MODAL_CLOSED } from './Modal';\nimport Settings from './util/Settings';\nimport Widget from './Widget';\n\nconst ATTR_MAX_WIDTH = 'data-original-width';\nconst ATTR_MAX_HEIGHT = 'data-original-height';\nconst ATTR_SRC = 'data-src';\n\nconst CLS_HAS_PREV = 'has-prev';\nconst CLS_HAS_NEXT = 'has-next';\nconst CLS_LOADING = 'loading';\n\nconst ATTR_NO_THUMBNAIL = 'data-no-thumbnail';\nconst ATTR_DATA_HREF = 'data-href';\nconst ATTR_HREF = 'href';\n\nconst KEY_NEXT = 39;\nconst KEY_PREV = 37;\nconst ATTR_CLOSE = 'data-close-modal';\n/**\n * A Simple LightBox\n */\nclass LightBox {\n\n /**\n * Creates a new Lightbox\n * @param DelegateContainer\n * @param AttributeSelector\n * @param ModalAppend\n * @param [options]\n */\n constructor(DelegateContainer, AttributeSelector, ModalAppend, options) {\n const thisDelegateContainer = DelegateContainer instanceof HTMLElement ? DelegateContainer :\n document.getElementById(DelegateContainer);\n\n this._modalAppend = ModalAppend || DelegateContainer;\n /**\n * @type {Function}\n */\n this._resizeEvent = null;\n /**\n * @type {Function}\n */\n this._keyboardNextEvent = null;\n /**\n * @type {Promise}\n */\n this._future = null;\n /**\n * @type {Promise}\n */\n this._nextFuture = this._future;\n /**\n * @type {HTMLElement}\n */\n this._imageContainer = null;\n /**\n * @type {HTMLElement}\n */\n this._modalContainerDiv = null;\n /**\n * @type {HTMLElement}\n */\n this._contentContainer = null;\n /**\n * @type {HTMLElement}\n */\n this._closerContainerDiv = null;\n /**\n * @type {HTMLElement}\n */\n this._delegateContainer = thisDelegateContainer;\n /**\n * @type {HTMLElement}\n */\n this._attributeSelector = AttributeSelector;\n /**\n * @type {Widget}\n */\n this._widget = null;\n /**\n * @type {boolean}\n */\n this._isOpen = false;\n /**\n * @type {HTMLElement}\n */\n this.target = null;\n /**\n * @type {HTMLElement}\n */\n this.img = null;\n /**\n * @type {boolean}\n */\n this._isLoading = false;\n\n /**\n * Default options\n */\n this.options = {\n // set if prev and next should be available\n registerPrevNextEvents: true,\n // set if modal should be closed after last image\n closeOnLast: true,\n // called when next image is requested (either by keyboard or click), return false to abort\n onNext: () => {\n return true;\n },\n onClose: () => {\n },\n getNext: null,\n getPrev: null,\n // called when underlying target changed\n onSwitchImage: () => {\n }\n };\n\n Object.assign(this.options, options);\n }\n\n /**\n * @param {HTMLElement} node\n * @returns {HTMLElement|null}\n */\n findImmediateNextTarget(node) {\n if (node && node.children[0].hasAttribute(this._attributeSelector)) {\n return node.children[0];\n }\n return null;\n }\n\n /**\n * Will fetch the next element of a lightBox\n * @param {HTMLElement} target\n * @returns {null|HTMLElement}\n */\n getNext(target) {\n if (this.options.getNext) {\n return this.options.getNext.apply(this, [target]);\n }\n return this.findImmediateNextTarget(target.parentNode.nextElementSibling);\n }\n\n /**\n * Will fetch the previous element of a lightBox\n * @param {HTMLElement} target\n * @returns {null|HTMLElement}\n */\n getPrev(target) {\n if (this.options.getPrev) {\n return this.options.getPrev.apply(this, [target]);\n }\n return this.findImmediateNextTarget(target.parentNode.previousElementSibling);\n }\n\n /**\n * Registers events for delegate container\n */\n registerEvents(onOpen) {\n this._delegateContainer.addEventListener(Settings.getTabEvent(), (e) => {\n let target = e.target;\n const parent = target.parentNode;\n let validTarget = target.hasAttribute(this._attributeSelector);\n const parentIsValid = parent && parent.hasAttribute(this._attributeSelector);\n\n if (!validTarget && parentIsValid) {\n validTarget = true;\n target = parent;\n }\n if (validTarget) {\n e.preventDefault();\n this.open(target).then((r) => {\n if (onOpen) {\n onOpen.apply(this, [r, target]);\n }\n });\n }\n });\n }\n\n /**\n * @returns {HTMLElement}\n */\n getContentContainer() {\n return this._contentContainer;\n }\n\n /**\n * Setup max-width and max-height\n * @param {HTMLElement} target\n * @param {HTMLElement} img\n * @param {HTMLElement} loadedImage\n * @private\n */\n static _setupMaxWidthHeight(target, img, loadedImage) {\n const nextMaxWidth = target.getAttribute(ATTR_MAX_WIDTH);\n const nextMaxHeight = target.getAttribute(ATTR_MAX_HEIGHT);\n if (nextMaxWidth && nextMaxHeight) {\n img.style.maxWidth = nextMaxWidth + \"px\";\n img.style.maxHeight = nextMaxHeight + \"px\";\n } else {\n img.style.maxWidth = loadedImage.width + \"px\";\n img.style.maxHeight = loadedImage.height + \"px\";\n }\n }\n\n /**\n * Switches to the next image\n * @param {boolean} direction\n */\n switchImageByDirection(direction) {\n const next = direction ? this.getPrev(this.target) : this.getNext(this.target);\n if (this.options.onNext.apply(this, [next])) {\n return this.switchImage(next);\n }\n return new Promise((_, reject) => reject(next));\n }\n\n /**\n * Checks if lightbox is currently loading\n * @returns {boolean}\n */\n isLoading() {\n return this._isLoading;\n }\n\n /**\n * Checks if modal should be closed\n * @private\n */\n _runOptionalClose() {\n if (this.options.closeOnLast) {\n this.modal.close();\n }\n }\n\n _setupPrevNextStates() {\n const target = this.target;\n const hasPrev = this.getPrev(target);\n const hasNext = this.getNext(target);\n const hasPrevClass = CLS_HAS_PREV;\n const hasNextClass = CLS_HAS_NEXT;\n // because IE does not support the second toggle parameter, we need to do this manually\n if (hasPrev) {\n this._imageContainer.classList.add(hasPrevClass);\n } else {\n this._imageContainer.classList.remove(hasPrevClass);\n }\n if (hasNext) {\n this._imageContainer.classList.add(hasNextClass);\n } else {\n this._imageContainer.classList.remove(hasNextClass);\n }\n }\n\n /**\n * @param img\n * @private\n */\n _calculateContainer(img) {\n if (Settings.isIE()) {\n setTimeout(() => {\n this._imageContainer.style.height = img.offsetHeight + 'px';\n }, 0);\n }\n }\n\n /**\n * Switch to a specific image\n * @param next\n * @returns {*}\n */\n switchImage(next) {\n const self = this;\n const img = this.img;\n this._isLoading = true;\n self._nextFuture = new Promise((resolve, reject) => {\n // notify observers about image switching\n self.options.onSwitchImage.apply(self, [self._nextFuture]);\n if (next) {\n const nextThumb = next.hasAttribute(ATTR_NO_THUMBNAIL) ? next : (next.children[0] || next);\n const nextHighRes = next.getAttribute(ATTR_DATA_HREF) ||\n next.getAttribute(ATTR_HREF);\n const nextSource = nextThumb.getAttribute(ATTR_SRC) || nextThumb.src || nextHighRes;\n const nextImgObject = new Image();\n\n if (!nextSource) {\n reject(next);\n return;\n }\n // set new target to next element\n this.target = next;\n nextImgObject.src = nextSource;\n self._imageContainer.classList.add(CLS_LOADING);\n nextImgObject.addEventListener('load', () => {\n img.src = nextSource;\n self._imageContainer.style.backgroundImage = 'url(' + nextSource + ')';\n LightBox._setupMaxWidthHeight(next, img, nextImgObject);\n self._calculateContainer(img);\n self.highRes(nextThumb, nextHighRes);\n self._setupPrevNextStates();\n self._imageContainer.classList.remove(CLS_LOADING);\n this._isLoading = false;\n resolve(nextSource, this.target);\n });\n } else {\n reject(this);\n }\n });\n return self._nextFuture;\n }\n\n\n /**\n * Setup High-Resolution picture\n * @param {HTMLElement} thisThumbnail\n * @param {String} thisImgHighResolution\n */\n highRes(thisThumbnail, thisImgHighResolution) {\n if (thisImgHighResolution && thisThumbnail.src !== thisImgHighResolution) {\n const highImageObj = new Image();\n highImageObj.src = thisImgHighResolution;\n highImageObj.addEventListener('load', () => {\n // if current image is still available\n if (this._getSrc(thisThumbnail) === this.img.src) {\n this.img.src = thisImgHighResolution;\n this._imageContainer.style.backgroundImage = 'url(' + thisImgHighResolution + ')';\n }\n });\n }\n }\n\n /**\n * Extracts the source of an image\n * @param target\n * @returns {String|null}\n * @private\n */\n _getSrc(target) {\n return target.getAttribute(ATTR_SRC) || target.src;\n }\n\n /**\n * Will show a lightBox on given target\n * @param {HTMLElement} target\n * @returns {$.Deferred|*}\n */\n open(target) {\n const self = this;\n\n if (!target) {\n return false;\n }\n\n this.target = target;\n\n // if lightBox is open, we just switch to the new target image\n if (this._isOpen && target) {\n return this.switchImage(target).then(() => {\n return this;\n });\n }\n\n this._isOpen = true;\n\n /**\n * Setup Widget for modal\n * @type {Widget}\n */\n this._widget = new Widget().setAsync(() => {\n // thumbnail is either target itself or expected to be first childNode\n const thumbnail = target.hasAttribute(ATTR_NO_THUMBNAIL) ? target : (target.children[0] || target);\n\n const imgHighResolution = target.getAttribute(ATTR_DATA_HREF) || target.getAttribute(ATTR_HREF);\n const imgSrc = this._getSrc(thumbnail) || imgHighResolution;\n\n const imageObj = new Image();\n imageObj.src = imgSrc;\n this._imageContainer = document.createElement('div');\n this._modalContainerDiv = document.createElement('div');\n this._closerContainerDiv = document.createElement('i');\n this._contentContainer = document.createElement('div');\n\n this._closerContainerDiv.className = 'modal-close modal-close-lightbox icon-cancel-1';\n this._closerContainerDiv.setAttribute(ATTR_CLOSE, ATTR_CLOSE);\n\n this._modalContainerDiv.className = 'modal image-modal';\n this._modalContainerDiv.appendChild(this._imageContainer);\n this._modalContainerDiv.appendChild(this._contentContainer);\n this._modalContainerDiv.appendChild(this._closerContainerDiv);\n this._contentContainer.className = 'content-container';\n this._isLoading = true;\n this._future = new Promise((resolve) => {\n imageObj.addEventListener('load', () => {\n this._imageContainer.className = 'image-container';\n const img = document.createElement('img');\n // current image\n this.img = img;\n\n img.src = imgSrc;\n LightBox._setupMaxWidthHeight(target, img, imageObj);\n this._imageContainer.appendChild(img);\n this._imageContainer.style.backgroundImage = 'url(' + imgSrc + ')';\n\n resolve(self._modalContainerDiv);\n this._isLoading = false;\n\n if (Settings.isIE()) {\n self._resizeEvent = global.addEventListener('resize', () => {\n setTimeout(() => {\n self._imageContainer.style.height = img.offsetHeight + 'px';\n }, 0);\n });\n }\n\n if (self.options.registerPrevNextEvents) {\n self._setupPrevNextStates();\n // prev or next on touch/click\n self._imageContainer.addEventListener(Settings.getTabEvent(), (e) => {\n if (self.isLoading()) {\n return;\n }\n e.preventDefault();\n\n const ev = e;\n const pageX = global.TouchEvent && ev instanceof TouchEvent ?\n ev.changedTouches[0].pageX : ev.pageX;\n const rect = self._imageContainer.getBoundingClientRect();\n const imgX = rect.left;\n const wrapperWidth = rect.width;\n const posX = pageX - imgX;\n\n self.switchImageByDirection(wrapperWidth / 2 > posX).catch(() => {\n self._runOptionalClose();\n });\n });\n\n // register keyboard events\n self._keyboardNextEvent = (e) => {\n if (e.keyCode === KEY_NEXT || e.keyCode === KEY_PREV) {\n if (self.isLoading()) {\n return;\n }\n self.switchImageByDirection(e.keyCode === KEY_PREV).catch(() => {\n self._runOptionalClose();\n });\n }\n };\n global.addEventListener('keydown', self._keyboardNextEvent);\n } else {\n self._imageContainer.addEventListener(Settings.getTabEvent(), () => {\n self._runOptionalClose();\n });\n }\n\n self.highRes(thumbnail, imgHighResolution);\n });\n });\n\n this._future.then(() => {\n self._calculateContainer(this.img);\n });\n\n self._modalContainerDiv.addEventListener(EVENT_MODAL_CLOSED, () => {\n // cleanup:\n this._modalContainerDiv.parentNode.removeChild(this._modalContainerDiv);\n this.options.onClose.apply(self);\n this._isOpen = false;\n this.modal.destroy();\n // unbind events\n if (this._keyboardNextEvent) {\n global.removeEventListener('keydown', self._keyboardNextEvent);\n }\n if (this._resizeEvent) {\n global.removeEventListener('resize', self._resizeEvent);\n }\n });\n\n return this._future;\n });\n\n this._nextFuture = this._future;\n\n if (self._widget) {\n this.modal = new Modal(this._modalAppend);\n // make sure we close stack before\n return this.modal.close().fromWidget(self._widget).then(() => {\n return self._future.then(() => {\n return self;\n });\n });\n }\n return false;\n }\n\n}\n\nexport default LightBox;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/main/LightBox.js\n **/"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack:///webpack/universalModuleDefinition?5ca6*","webpack:///webpack/bootstrap 07d11fb01134afeef692?d78f*","webpack:///./src/main/modules/All.js","webpack:///./src/main/Form.js","webpack:///./src/main/Tooltip.js","webpack:///./src/main/util/Util.js","webpack:///./src/main/DestroyableWidget.js","webpack:///./src/main/util/Settings.js","webpack:///./~/isomorphic-fetch/fetch-npm-browserify.js","webpack:///./~/whatwg-fetch/fetch.js","webpack:///./src/main/util/Event.js","webpack:///./src/main/Modal.js","webpack:///./src/main/Widget.js","webpack:///./src/main/lib/FixedWindow.js","webpack:///./src/main/lib/debounce.js","webpack:///./src/main/Toggleable.js","webpack:///./src/main/OffCanvas.js","webpack:///./src/main/Dropdown.js","webpack:///./src/main/LightBox.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;ACVA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,uBAAe;AACf;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;SC3BS;SAAM;SAAS;SAAO;SAAQ;SAAU;SAAM;SAAY;SAAW;SAAU,8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AC4BxF,KAAM,gBAAgB,SAAhB;AACN,KAAM,uBAAuB,sBAAvB;AACN,KAAM,SAAS,aAAT;AACN,KAAM,gBAAgB,oBAAhB;AACN,KAAM,sBAAsB,gCAAtB;AACN,KAAM,wBAAwB,kCAAxB;AACN,KAAM,iBAAiB,eAAjB;AACN,KAAM,2BAA2B,yBAA3B;AACN,KAAM,yBAAyB,mBAAzB;AACN,KAAM,2BAA2B,0BAA3B;AACN,KAAM,uBAAuB,mBAAvB;AACN,KAAM,eAAe,uBAAf;AACN,KAAM,iBAAiB,MAAjB;AACN,KAAM,uBAAuB,OAAvB;AACN,KAAM,sBAAsB,EAAtB;AACN,KAAM,sBAAsB,GAAtB;;;;;;AAMC,KAAM,8CAAmB,oBAAnB;;;;;AAKN,KAAM,gDAAoB,qBAApB;;;;;AAKN,KAAM,sEAA+B,8BAA/B;;;;;AAKN,KAAM,gEAA4B,4BAA5B;;;;;;KAMP;;;;;;;;AAKF,cALE,IAKF,CAAY,IAAZ,EAAkB,OAAlB,EAA2B;+BALzB,MAK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;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,QAAO;AACP,MAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,QAAO;AACP;AACA;AACA,MAAK;AACL;AACA;AACA;;AAEA;AACA;;;AAGA;AACA;AACA;AACA;AACA,QAAO;AACP;AACA,QAAO;AACP;AACA,QAAO;AACP;AACA,QAAO;AACP;AACA;AACA,QAAO;AACP;AACA;;AAEA;AACA;AACA,wDAAuD;AACvD,UAAS;AACT;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,UAAS;AACT;AACA,UAAS;AACT;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,UAAS;AACT;AACA,UAAS;AACT;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;;AAEA;AACA,wCAAuC,0BAA0B;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AAhB,CAFS;cAAnC,MAGO;AACH,qBAAI,KAAJ,CAAU,QAAV,GAAqB,YAAY,KAAZ,GAAoB,IAApB,CADlB;AAEH,qBAAI,KAAJ,CAAU,SAAV,GAAsB,YAAY,MAAZ,GAAqB,IAArB,CAFnB;cAHP;;;;YAhLF;;;mBA4dS,S","file":"js/flexcss.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"FlexCss\"] = factory();\n\telse\n\t\troot[\"FlexCss\"] = factory();\n})(this, function() {\nreturn \n\n\n/** WEBPACK FOOTER **\n ** webpack/universalModuleDefinition\n **/"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"../\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n/** WEBPACK FOOTER **\n ** webpack/bootstrap 07d11fb01134afeef692\n **/","import Form from '../Form';\nimport Tooltip from '../Tooltip';\nimport Modal from '../Modal';\nimport Widget from '../Widget';\nimport Settings from '../util/Settings';\nimport Toggleable from '../Toggleable';\nimport OffCanvas from '../OffCanvas';\nimport Dropdown from '../Dropdown';\nimport LightBox from '../LightBox';\nimport Util from '../util/Util';\n\nexport { Form, Tooltip, Modal, Widget, Settings, Util, Toggleable, OffCanvas, Dropdown, LightBox };\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/main/modules/All.js\n **/","/*global HTMLFormElement, fetch, FormData, clearTimeout, NodeList*/\n\n/*\n * The MIT License (MIT)\n *\n * Copyright (c) 2015 David Heidrich, BowlingX \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n/*!\n * FlexCss.Form\n * Licensed under the MIT License (MIT)\n * Copyright (c) 2015 David Heidrich, BowlingX \n */\n\nimport Tooltip from './Tooltip';\nimport 'isomorphic-fetch';\nimport Event from './util/Event';\nimport Util from './util/Util';\nimport Settings from './util/Settings';\nimport DestroyableWidget from './DestroyableWidget';\n\nconst LOADING_CLASS = 'loading';\nconst DATA_ELEMENT_INVALID = 'data-flexcss-invalid';\nconst REMOTE = 'data-remote';\nconst REMOTE_ACTION = 'data-remote-action';\nconst ATTR_DISABLE_INLINE = 'data-disable-inline-validation';\nconst ATTR_DISABLE_REALTIME = 'data-disable-realtime-validation';\nconst ATTR_VALIDATOR = 'data-validate';\nconst ATTR_DATA_CUSTOM_MESSAGE = 'data-validation-message';\nconst ATTR_DATA_CUSTOM_LABEL = 'data-custom-label';\nconst ATTR_VALIDATE_VISIBILITY = 'data-validate-visibility';\nconst ATTR_ERROR_TARGET_ID = 'data-error-target';\nconst ATTR_DEPENDS = 'data-depends-selector';\nconst CONST_USE_JSON = 'json';\nconst CONST_REALTIME_EVENT = 'input';\nconst FOCUS_TOOLTIP_DELAY = 20;\nconst CLICK_TOOLTIP_DELAY = 150;\n\n/**\n * Triggered when form is fully initialized and handlers are binded\n * @type {string}\n */\nexport const EVENT_FORM_READY = 'flexcss.form.ready';\n/**\n * Fires when a form is submitted, cancelable\n * @type {string}\n */\nexport const EVENT_FORM_SUBMIT = 'flexcss.form.submit';\n/**\n * Fired directly after the form has been submitted via ajax\n * @type {string}\n */\nexport const EVENT_FORM_AFTER_AJAX_SUBMIT = 'flexcss.form.afterAjaxSubmit';\n/**\n * Fired when ajax events did complete\n * @type {string}\n */\nexport const EVENT_FORM_AJAX_COMPLETED = 'flexcss.form.ajaxCompleted';\n\n/**\n * A HTML5 Form Validation replacement\n */\n\nclass Form extends DestroyableWidget {\n /**\n * @param {HTMLElement} form\n * @param [options] optional options\n */\n constructor(form, options) {\n super();\n\n if (!(form instanceof HTMLFormElement)) {\n throw 'argument {0} form needs to be an form element';\n }\n\n /**\n * The Form\n * @type {HTMLElement}\n */\n this.form = form;\n\n /**\n * @type {Tooltip}\n */\n this.tooltips = null;\n\n /**\n * @type {Promise}\n */\n this.currentValidationFuture = new Promise(() => {\n });\n\n /**\n * Default options\n * @type {Object}\n */\n this.options = {\n // if true creates tooltips above element, uses FlexCss Tooltips\n createTooltips: true,\n // if true appends error message after input element\n appendError: false,\n // type of ajax submit\n ajaxSubmitType: 'POST',\n // json content type if ajax method is set to json\n ajaxJsonContentType: 'application/json; charset=utf-8',\n // allow inline validation\n inlineValidation: true,\n // validate in realtime (on `input` event)\n realtime: true,\n // timeout when realtime event should be captured\n realtimeTimeout: 250,\n // formatting method for an error\n formatErrorTooltip: (error) => {\n return ' ' + error;\n },\n // the class that will be put on the element to mark it failed validation\n inputErrorClass: 'invalid',\n // the container class for error messages below an element\n containerErrorClass: 'form-error',\n // additional options for fetch\n fetchOptions: {\n credentials: 'include'\n },\n // the container for tooltips\n tooltipContainer: form,\n tooltipOptions: {\n containerClass: 'error-tooltip'\n },\n // if you have a fixed header, either set a number or function here\n scrollToElementDiff: 0\n };\n\n // overwrite default options\n Object.assign(this.options, options);\n\n // apply settings from attributes\n Util.applyOptionsFromElement(form, this.options);\n\n // set form class as widget\n // Forms are very different to classical widgets,\n // we will not use our base widget class for this but just self\n form.hfWidgetInstance = this;\n\n /**\n * A List of Validators\n * @type {Object}\n * @private\n */\n this._validators = Form.globalValidators;\n\n /**\n * @type {Function}\n * @private\n */\n this._remoteValidationFunction = null;\n\n this.initFormValidation();\n }\n\n destroy() {\n super.destroy();\n if (this.tooltips) {\n this.tooltips.destroy();\n }\n }\n\n /**\n * Submits this form, either via ajax or just classical (default)\n * @param {HTMLFormElement} thisForm\n * @param {Event} e\n * @private\n * @returns {Promise|boolean} returns false if submit is cancled\n */\n _submitFunction(thisForm, e) {\n var shouldUseAjax = thisForm.getAttribute(REMOTE), ajaxPostUrl =\n thisForm.getAttribute(REMOTE_ACTION) ||\n thisForm.getAttribute('action') || window.location.href,\n useJson = CONST_USE_JSON === shouldUseAjax, self = this;\n\n var ev = Event.dispatch(thisForm, EVENT_FORM_SUBMIT).withOriginal(e).fire();\n\n // abort execution is event was prevented\n if (ev.defaultPrevented) {\n self._formStopLoading();\n return false;\n }\n\n if (shouldUseAjax === null) {\n // submit\n return thisForm.submit();\n }\n // prevent form from submit normally\n e.preventDefault();\n\n // add information that this is an XMLHttpRequest request (used by some frameworks)\n let defaultHeaders = {\n 'X-Requested-With': 'XMLHttpRequest'\n };\n\n // setup default headers\n if (useJson) {\n Object.assign(defaultHeaders, {\n 'Content-Type': this.options.ajaxJsonContentType\n });\n }\n let defaultOptions = Object.assign(this.options.fetchOptions, {\n headers: defaultHeaders,\n method: this.options.ajaxSubmitType\n });\n\n // support either JSON request payload or normal payload submission\n var serverCall = useJson ? fetch(ajaxPostUrl, Object.assign(defaultOptions, {\n body: JSON.stringify(this.serialize())\n })) : fetch(ajaxPostUrl, Object.assign(defaultOptions, {\n body: new FormData(thisForm)\n }));\n\n Event.dispatch(thisForm, EVENT_FORM_AFTER_AJAX_SUBMIT).withOriginal(e).fire();\n\n return serverCall.then((r) => {\n (self._remoteValidationFunction || Form.globalRemoteValidationFunction).apply(self, [r]);\n\n Event.dispatch(thisForm, EVENT_FORM_AJAX_COMPLETED).withOriginal(e).withDetail({ response: r }).fire();\n // always remove error class\n self._formStopLoading();\n });\n }\n\n /**\n * Serializes a form to a json object\n * @returns {Object}\n */\n serialize() {\n var selectors = [\n 'input[name]:not([type=\"radio\"]):enabled',\n 'input[type=\"radio\"][name]:checked',\n 'select[name]:enabled',\n 'textarea[name]:enabled'\n ], inputs = this.form.querySelectorAll(selectors.join(',')), result = {};\n\n Array.prototype.forEach.call(inputs, function (input) {\n var exists = result[input.name], value = input.value;\n if (exists instanceof Array) {\n exists.push(value);\n } else if (exists) {\n result[input.name] = [result[input.name], value];\n } else {\n result[input.name] = value;\n }\n });\n\n return result;\n }\n\n /**\n * Handles the chain of validation on given fields\n *\n * @param {HTMLElement|Array|NodeList} field\n * @param [focus] optional focus first error\n * @returns {Promise}\n */\n handleValidation(field, focus) {\n var fields = (field instanceof Array || field instanceof NodeList) ? field : [field];\n return this._handleValidation(fields, focus, true).then(((r) => {\n if (!r.foundAnyError) {\n // remove tooltips\n if (this.tooltips) {\n this.tooltips.removeTooltip();\n }\n }\n return r;\n }).bind(this));\n }\n\n /**\n * Handles errors on given node list\n * @param {NodeList} toValidateFields\n * @param {boolean} focus\n * @param {boolean} scoped if true, will only validate the fields `invalidFields`\n * @returns {Promise}\n * @private\n */\n _handleValidation(toValidateFields, focus, scoped) {\n var self = this;\n var arr = Form._createArrayFromInvalidFieldList(toValidateFields), isLocalInvalid = arr.length > 0;\n // focus must appear in the same frame for iOS devices\n if (isLocalInvalid && focus) {\n self._focusElement(arr[0]);\n }\n var validation = scoped ? this._customValidationsForElements(toValidateFields) :\n self.validateCustomFields();\n return validation.then((r) => {\n if (isLocalInvalid) {\n // combine browser and custom validators\n r.foundAnyError = true;\n }\n // get a unique field list of all fields that need to be checked and rendered\n // it's possible that we have duplicates in non scoped mode\n let thisToValidateFields = scoped ? toValidateFields :\n Array.from(arr).concat(r.checkedFields);\n r.checkedFields = thisToValidateFields;\n let foundInvalidFields = self.prepareErrors(thisToValidateFields, false),\n firstInvalidField = foundInvalidFields[0];\n if (firstInvalidField) {\n if (focus) {\n self._focusElement(firstInvalidField);\n // if element could not be focused:\n if (document.activeElement !== firstInvalidField) {\n self._handleTooltipHideClickAfterChange();\n }\n } else {\n self._handleTooltipHideClickAfterChange();\n }\n self.showAndOrCreateTooltip(firstInvalidField);\n }\n return r;\n });\n }\n\n /**\n * @param {HTMLElement} field\n * @param {ValidityState} validity\n * @returns {*}\n * @private\n */\n\n _setupErrorMessages(field, validity) {\n return Form.globalErrorMessageHandler ?\n Form.globalErrorMessageHandler.apply(this, [field, validity]) : false;\n }\n\n /**\n * Handles class labels for elements\n * @param {Object} fields\n * @private\n */\n _handleLabels(fields) {\n Object.keys(fields).forEach(function (id) {\n let labels = this.getForm().querySelectorAll('[for=\"' + id + '\"]'), invalid = fields[id];\n if (labels.length) {\n for (let labelsIndex = 0; labelsIndex < labels.length; labelsIndex++) {\n let labelEl = labels[labelsIndex];\n // we can't use toggle attribute, not supported in IE\n if (invalid) {\n this._markElementInvalid(labelEl);\n } else {\n this._markElementValid(labelEl);\n }\n }\n }\n }.bind(this));\n }\n\n /**\n * @param el\n * @private\n */\n _markElementInvalid(el) {\n el.setAttribute(DATA_ELEMENT_INVALID, \"true\");\n el.classList.add(this.options.inputErrorClass);\n }\n\n /**\n * @param el\n * @private\n */\n _markElementValid(el) {\n el.removeAttribute(DATA_ELEMENT_INVALID);\n el.classList.remove(this.options.inputErrorClass);\n }\n\n /**\n * A List of invalid elements (:invalid)\n * @returns {Array}\n * @private\n */\n _getInvalidElements() {\n return Array.prototype.filter.call(this.getForm().querySelectorAll(\":invalid\"), function (r) {\n return !(r instanceof HTMLFieldSetElement);\n });\n }\n\n /**\n * @param {HTMLElement} thisParent\n * @private\n */\n _removeElementErrors(thisParent) {\n let errors = thisParent.querySelectorAll('.' + this.options.containerErrorClass), inputsWithErrorClasses =\n thisParent.querySelectorAll(`[${DATA_ELEMENT_INVALID}]`);\n for (let elementErrorIndex = 0; elementErrorIndex < errors.length; elementErrorIndex++) {\n errors[elementErrorIndex].parentNode.removeChild(errors[elementErrorIndex]);\n }\n for (let inputErrorIndex = 0; inputErrorIndex < inputsWithErrorClasses.length; inputErrorIndex++) {\n let el = inputsWithErrorClasses[inputErrorIndex];\n this._markElementValid(el);\n }\n }\n\n\n /**\n * Registers a custom validator\n * @param {String} name\n * @param {Function} validator a validation function should always return either a Future(true) or Future(false)\n * even when the field has been invalidated with `setCustomValidity`, because of different browser `bugs`\n * we can't rely on that\n * @returns {Form}\n */\n registerValidator(name, validator) {\n this._validators[name] = validator;\n return this;\n }\n\n /**\n * Runs async validation\n * @param {String} validationRef\n * @param {HTMLElement} field\n * @returns {Promise}\n * @private\n */\n _runValidation(validationRef, field) {\n if (!this._validators[validationRef]) {\n throw 'Could not found validator: ' + validationRef;\n }\n var cl = field.classList, future = this._validators[validationRef].apply(this, [field, this.form]);\n cl.add(LOADING_CLASS);\n future.then(() => {\n cl.remove(LOADING_CLASS);\n });\n return future;\n }\n\n\n /**\n * Run custom validations for elements, validations are done async do support XHR Requests or other stuff\n *\n * @param {Array|NodeList} fields\n * @returns {Promise} contains either true if validations passed or false if something went wrong\n * @private\n */\n _customValidationsForElements(fields) {\n var futures = [], fieldsLength = fields.length, checkedFields = [];\n for (var iVal = 0; iVal < fieldsLength; iVal++) {\n var field = fields[iVal], validationRef = field.getAttribute(ATTR_VALIDATOR), validity = field.validity;\n if (this._validators[validationRef]) {\n // use local validation first and then continue with custom validations\n if (Form._shouldNotValidateField(field) || (validity && !validity.customError && !validity.valid)) {\n continue;\n }\n checkedFields.push(field);\n futures.push(this._runValidation(validationRef, field));\n } else {\n if (validationRef) {\n console.warn('data-validate was set but no validator was found');\n }\n }\n }\n return Promise.all(futures).then(function (allFutures) {\n let l = allFutures.length;\n let result = {\n checkedFields: checkedFields,\n foundAnyError: false\n };\n for (var fI = 0; fI < l; fI++) {\n if (!allFutures[fI]) {\n result.foundAnyError = true;\n break;\n }\n }\n return result;\n });\n }\n\n /**\n * Remove all errors for this form\n * @returns {Form}\n */\n removeErrors() {\n this._removeElementErrors(this.form);\n if (this.tooltips) {\n this.tooltips.removeTooltip();\n }\n return this;\n }\n\n /**\n * Will handle errors for given fields\n * @param {Array|NodeList} fields\n * @param {Boolean} removeAllErrors\n */\n prepareErrors(fields, removeAllErrors) {\n if (removeAllErrors) {\n this.removeErrors();\n }\n let labelGroups = {}, invalidFields = [];\n\n function handleAdditionalLabels(isInvalid, thisLabelGroup, field) {\n let additionalLabels = field.getAttribute(ATTR_DATA_CUSTOM_LABEL) ||\n field.id, group = thisLabelGroup[additionalLabels];\n if (additionalLabels) {\n // check additionally if field is currently marked as invalid\n // so the label is not marked as error if no field is marked as one\n group = group ? group : isInvalid;\n thisLabelGroup[additionalLabels] = group;\n }\n }\n\n // We save all validations in an extra property because we need to reset the validity due some\n // implementation errors in other browsers then chrome\n for (let i = 0; i < fields.length; i++) {\n let field = fields[i], errorTarget = Form._findErrorTarget(field), parent = errorTarget.parentNode,\n validity = field.validity, isInvalid = validity && !validity.valid;\n if (Form._shouldNotValidateField(field)) {\n continue;\n }\n field.flexFormsSavedValidity = JSON.parse(JSON.stringify(validity));\n handleAdditionalLabels(isInvalid, labelGroups, field);\n if (isInvalid) {\n if (!removeAllErrors) {\n // Remove current errors:\n this._removeElementErrors(parent);\n }\n // setup custom error messages:\n this._setupErrorMessages(field, validity);\n let msg = field.validationMessage;\n\n // mark fields as invalid\n this._markElementInvalid(errorTarget);\n this._markElementInvalid(field);\n\n if (this.options.appendError) {\n parent.insertAdjacentHTML(\"beforeend\",\n `
${msg}
`);\n }\n invalidFields.push(field);\n field.flexFormsSavedValidationMessage = msg;\n } else {\n // restore invalid fields\n this._markElementValid(errorTarget);\n this._markElementValid(field);\n\n // cleanup\n delete field.flexFormsSavedValidationMessage;\n\n // remove error markup\n this._removeElementErrors(parent);\n }\n // We have to reset the custom validity here to allow native validations work again\n field.setCustomValidity('');\n }\n // if validates a single field we need to check the linked fields to a label:\n if (fields.length === 1) {\n let field = fields[0];\n let id = field.getAttribute(ATTR_DATA_CUSTOM_LABEL) || field.id;\n if (id) {\n let linkedFields = Array.from(\n this.getForm().querySelectorAll(`[${ATTR_DATA_CUSTOM_LABEL}=\"${id}\"], #${id}`));\n linkedFields.forEach(function (thisField) {\n let validity = thisField.validity, isInvalid = validity && !validity.valid &&\n this._isElementInvalidElement(thisField);\n handleAdditionalLabels(isInvalid, labelGroups, thisField);\n }.bind(this));\n }\n }\n this._handleLabels(labelGroups);\n return invalidFields;\n }\n\n /**\n * Validates all custom fields\n * @returns {Promise}\n */\n validateCustomFields() {\n return this._customValidationsForElements(\n this.form.querySelectorAll(\"[data-validate]\"));\n }\n\n /**\n * Tests if a field should be validated\n * @param {HTMLElement} field\n * @returns {boolean}\n * @private\n */\n static _shouldNotValidateField(field) {\n var target = Form._findErrorTarget(field);\n return target instanceof HTMLFieldSetElement || field.validity === undefined ||\n (target.hasAttribute(ATTR_VALIDATE_VISIBILITY) && !Util.isVisible(target));\n }\n\n /**\n * Creates an array from a node list with invalid items\n * This Method expicitly checks if field should not be validated so it can be used to foucs a field\n * @param list\n * @returns {Array}\n * @private\n */\n static _createArrayFromInvalidFieldList(list) {\n var arr = [];\n for (var i = 0; i < list.length; ++i) {\n var n = list[i];\n if (n.validity && !n.validity.valid) {\n if (!Form._shouldNotValidateField(n)) {\n arr.push(n);\n }\n }\n }\n return arr;\n }\n\n\n /**\n * This form\n * @returns {HTMLElement}\n */\n getForm() {\n return this.form;\n }\n\n /**\n * Registers a function that handles remote validation\n * @param {Function} func\n * @returns {Form}\n */\n registerRemoteValidation(func) {\n this._remoteValidationFunction = func;\n return this;\n }\n\n\n /**\n * Formats the error content for the tooltip\n * @param {String} error\n * @returns {String}\n * @private\n */\n _formatErrorTooltip(error) {\n return this.options.formatErrorTooltip.apply(this, [error]);\n }\n\n /**\n * Tries to find a custom error target on given target\n * @param target\n * @returns {HTMLElement}\n * @private\n */\n static _findErrorTarget(target) {\n var el = target.getAttribute(ATTR_ERROR_TARGET_ID) || target,\n foundTarget = el instanceof HTMLElement ? el : global.document.getElementById(el);\n if (!foundTarget) {\n throw 'Given error target did not exsits:' + target;\n }\n return foundTarget;\n }\n\n /**\n * Creates a tooltip at given element, will only create a new instance if not created\n * @param {HTMLElement} target\n * @param {Boolean} [remove]\n */\n showAndOrCreateTooltip(target, remove) {\n var self = this;\n if (!this.tooltips && this.options.createTooltips) {\n this.tooltips = new Tooltip(this.options.tooltipContainer, this.options.tooltipOptions);\n }\n if (!this.options.createTooltips) {\n return false;\n }\n\n if (!target.flexFormsSavedValidity) {\n return false;\n }\n var errorTarget = Form._findErrorTarget(target);\n if (!target.flexFormsSavedValidity.valid && self._isElementInvalidElement(errorTarget)) {\n self.tooltips.createTooltip(errorTarget,\n self._formatErrorTooltip(target.flexFormsSavedValidationMessage), false);\n return true;\n } else {\n if (remove) {\n self.tooltips.removeTooltip();\n }\n }\n return false;\n }\n\n /**\n * Checks if element is marked as invalid\n * @param {HTMLElement} el\n * @returns {boolean}\n * @private\n */\n _isElementInvalidElement(el) {\n return el.hasAttribute(DATA_ELEMENT_INVALID);\n }\n\n /**\n * Handles invalid event of a form\n * @param {Event} e\n * @returns {Promise|boolean}\n * @private\n */\n _checkIsInvalid(e) {\n e.preventDefault();\n var invalidFields = this.getForm().querySelectorAll(\":invalid\");\n return this._handleValidation(invalidFields, true, false);\n }\n\n /**\n * Will query dependent fields (by selector) that should be validated with given field\n * @param field\n * @returns {NodeList|[]}\n * @private\n */\n _getDependentFields(field) {\n let fieldSelector = field.getAttribute(ATTR_DEPENDS), base = [field];\n if (fieldSelector) {\n base.push.apply(base, Array.prototype.slice.apply(\n this.getForm().querySelectorAll(fieldSelector)));\n }\n return base;\n }\n\n /**\n * @private\n * @param {HTMLElement} [target]\n */\n _handleTooltipInline(target) {\n if (this.tooltips) {\n this.tooltips.removeTooltip(target);\n }\n }\n\n /**\n * Initializes validation for a given form, registers event handlers\n */\n initFormValidation() {\n // Suppress the default bubbles\n var form = this.getForm(),\n self = this,\n invalidEvent = 'invalid';\n\n /**\n * Validates if is valid realtime element\n * @param {HTMLElement} target\n * @returns {boolean}\n * @private\n */\n function _checkIsValidRealtimeElement(target) {\n return !target.hasAttribute(ATTR_DISABLE_REALTIME) && !target.hasAttribute(ATTR_DISABLE_INLINE);\n }\n\n form.addEventListener(invalidEvent, function (e) {\n e.preventDefault();\n }, true);\n\n Util.addEventOnce(invalidEvent, form, function handleInvalid(e) {\n self._formLoading();\n var result = self._checkIsInvalid(e);\n if (result) {\n self.currentValidationFuture = new Promise((resolve) => {\n result.then(function (r) {\n setTimeout(function () {\n Util.addEventOnce(invalidEvent, form, handleInvalid, true);\n }, 0);\n resolve(r);\n self._formStopLoading();\n if (!r.foundAnyError) {\n self._formLoading();\n self._handleSubmit(e);\n }\n });\n });\n }\n }, true);\n\n this.addEventListener(form, 'reset', () => {\n this.removeErrors();\n });\n\n // Timeout for keys:\n var TIMEOUT_KEYDOWN, KEYDOWN_RUNNING = false;\n\n // resets keydown events\n function clearKeyDownTimeout() {\n KEYDOWN_RUNNING = false;\n clearTimeout(TIMEOUT_KEYDOWN);\n }\n\n // setup custom realtime event if given\n if (self.options.realtime) {\n this.addEventListener(form, CONST_REALTIME_EVENT, function (e) {\n if (self._formIsLoading()) {\n return;\n }\n var target = e.target;\n clearTimeout(TIMEOUT_KEYDOWN);\n if (KEYDOWN_RUNNING) {\n return;\n }\n TIMEOUT_KEYDOWN = setTimeout(() => {\n let isStillTarget = document.activeElement === e.target;\n if (!_checkIsValidRealtimeElement(target)) {\n return;\n }\n if (isStillTarget) {\n self._handleTooltipInline();\n }\n KEYDOWN_RUNNING = true;\n let dependentFields = self._getDependentFields(target);\n self._customValidationsForElements(dependentFields).then(function () {\n self.prepareErrors(dependentFields, false);\n if (isStillTarget) {\n self.showAndOrCreateTooltip(e.target);\n }\n // future must be resolved before another event can be started\n KEYDOWN_RUNNING = false;\n });\n }, self.options.realtimeTimeout);\n }, true);\n }\n\n /**\n * Validates if target is a valid input field to check blur and focus events\n *\n * @param {HTMLElement} target\n * @returns {boolean}\n * @private\n */\n function _checkIsValidBlurFocusElement(target) {\n let attr = target.getAttribute(\"type\");\n return (attr !== \"radio\" && attr !== \"checkbox\" && attr !== \"submit\");\n }\n\n /**\n * Validates if is valid inline-check element\n * @param {HTMLElement} target\n * @returns {boolean}\n * @private\n */\n function _checkIsValidInlineCheckElement(target) {\n return !target.hasAttribute(ATTR_DISABLE_INLINE);\n }\n\n this.addEventListener(form, 'blur', function (e) {\n // do not hide tooltip after change event\n if (!e.target.flexcssKeepTooltips) {\n self._handleTooltipInline(e.target);\n }\n delete e.target.flexcssKeepTooltips;\n }, true);\n\n // handle focus on input elements\n // will show an error if field is invalid\n this.addEventListener(form, \"focus\", function (e) {\n if (self._formIsLoading()) {\n return;\n }\n // do not track errors for checkbox and radios on focus:\n if (!_checkIsValidBlurFocusElement(e.target)) {\n return;\n }\n // we need to delay this a little, because Firefox and Safari do not show a tooltip after it\n // just have been hidden (on blur). Maybe fix this with a queue later\n setTimeout(function () {\n self.showAndOrCreateTooltip(e.target);\n }, FOCUS_TOOLTIP_DELAY);\n }, true);\n\n if (self.options.inlineValidation) {\n // Handle change for checkbox, radios and selects\n this.addEventListener(form, \"change\", function (e) {\n const target = e.target;\n if (self._formIsLoading() || !_checkIsValidInlineCheckElement(target)) {\n return;\n }\n clearKeyDownTimeout();\n const name = target.getAttribute('name');\n let inputs = name ? form.querySelectorAll('[name=\"' + name + '\"]') : [target];\n // we only support dependent fields for a single widgets right now\n if (inputs.length === 1) {\n inputs = self._getDependentFields(target);\n }\n self._customValidationsForElements(inputs).then(function () {\n self.prepareErrors(inputs, false);\n target.flexcssKeepTooltips = self.showAndOrCreateTooltip(target, true);\n if (target.flexcssKeepTooltips) {\n self._handleTooltipHideClickAfterChange();\n }\n });\n });\n }\n\n // prevent default if form is invalid\n this.addEventListener(form, \"submit\", function listener(e) {\n self._submitListener(e, listener);\n });\n\n Event.dispatchAndFire(form, EVENT_FORM_READY);\n }\n\n /* Loading states, unfortunately we can't check if a promise is pending :/*/\n /* TODO: Maybe wrap promise to extend this functionality */\n\n _formLoading() {\n this.getForm().classList.add(LOADING_CLASS);\n }\n\n _formStopLoading() {\n this.getForm().classList.remove(LOADING_CLASS);\n }\n\n _formIsLoading() {\n return this.getForm().classList.contains(LOADING_CLASS);\n }\n\n // this defines the logic after a change event when a tooltip is shown\n // because we call this method inside the change event, the click would be immeditally executed with the change\n // event when not using setTimeout(). There might be another solution for this...\n _handleTooltipHideClickAfterChange() {\n const self = this;\n if (this.options.createTooltips) {\n setTimeout(function () {\n Util.addEventOnce(Settings.getTabEvent(), global.document.body, function (t) {\n if (!self._isElementInvalidElement(t.target)) {\n self._handleTooltipInline();\n }\n });\n }, CLICK_TOOLTIP_DELAY);\n }\n }\n\n _focusElement(el) {\n el.focus();\n Util.scrollToElement(el, this.options.scrollToElementDiff);\n }\n\n /**\n * Listener that is executed on form submit\n * @param e\n * @param submitListener\n * @returns {boolean}\n * @private\n */\n _submitListener(e, submitListener) {\n\n const form = this.getForm(),\n self = this,\n submitEvent = 'submit';\n\n if (this._formIsLoading()) {\n e.preventDefault();\n return false;\n }\n this._formLoading();\n form.removeEventListener(submitEvent, submitListener);\n this.removeErrors();\n e.preventDefault();\n // reset:\n if (form.checkValidity()) {\n form.addEventListener(submitEvent, submitListener);\n // It's possible that the form is valid but the custom validations need to be checked again:\n self.currentValidationFuture = new Promise((resolve) => {\n var validation = self.validateCustomFields();\n validation.then(function (r) {\n // because custom validators may mark multiple fields as invalid, we get all of them in the form\n var fields = self._getInvalidElements(),\n errors = self.prepareErrors(fields, false), firstError = errors[0];\n if (firstError) {\n self._focusElement(firstError);\n self.showAndOrCreateTooltip(firstError, true);\n }\n resolve(r);\n });\n });\n self.currentValidationFuture.then(function (r) {\n if (!r.foundAnyError) {\n // Handle submitting the form to server:\n self._handleSubmit(e);\n } else {\n self._formStopLoading();\n }\n });\n } else {\n self._formStopLoading();\n form.addEventListener(submitEvent, submitListener);\n }\n }\n\n\n /**\n * Handles submitting, optionally allows to stop submitting\n * @param e\n * @private\n */\n _handleSubmit(e) {\n this._submitFunction(this.form, e);\n }\n\n\n /**\n * Registers a global event Handler\n * @param errorFunc\n */\n static registerErrorMessageHandler(errorFunc) {\n Form.globalErrorMessageHandler = errorFunc;\n }\n\n /**\n * Initialize forms for a specific selector\n * @param {String} selector\n * @param {Object} [options]\n * @return {array.}\n */\n static init(selector, options) {\n var forms = selector instanceof HTMLElement ? selector.querySelectorAll('form') :\n document.querySelectorAll(selector), instances = [];\n for (var i = 0; i < forms.length; i++) {\n instances.push(new Form(forms[i], options));\n }\n return instances;\n }\n\n\n /**\n * Registers a global validator that is usable on all form instances\n * @param {String} name\n * @param {Function} validator\n * @returns {Function}\n */\n static registerValidator(name, validator) {\n Form.globalValidators[name] = validator;\n return Form;\n }\n\n /**\n * Registers a global function that is called when a form should validate the response of a server\n * @param {Function} func\n * @returns {Form}\n */\n static registerGlobalRemoteValidationFunction(func) {\n Form.globalRemoteValidationFunction = func;\n return Form;\n }\n}\n\n\n/**\n * Global validators\n * @type {Array}\n */\nForm.globalValidators = [];\n\n/**\n * Global Remote validation function\n */\nForm.globalRemoteValidationFunction = function () {\n};\n\n/**\n * Handles custom error messages extracts custom message by default\n */\nForm.globalErrorMessageHandler = (field, validity) => {\n if (!validity.customError) {\n let customMsg = field.getAttribute(ATTR_DATA_CUSTOM_MESSAGE);\n if (customMsg) {\n field.setCustomValidity(customMsg);\n }\n }\n};\n\nexport default Form;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/main/Form.js\n **/","/*\n * The MIT License (MIT)\n *\n * Copyright (c) 2015 David Heidrich, BowlingX \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n/*!\n * FlexCss.Tooltip\n * Licensed under the MIT License (MIT)\n * Copyright (c) 2015 David Heidrich, BowlingX \n */\n\nimport Util from './util/Util';\nimport DestroyableWidget from './DestroyableWidget';\nimport Settings from './util/Settings';\n\n/**\n * @type {string}\n */\nconst CLASS_NAMES_TOOLTIP = 'tooltip-container';\n/**\n * @type {string}\n */\nconst CLASS_NAMES_OPEN = 'open';\n\n/**\n * @type {string}\n */\nconst ATTR_DATA_CLASSNAME = 'data-class';\n\n/**\n * @type {string}\n */\nconst ATTR_DATA_NO_TOUCH = 'data-no-touch';\n\n/**\n * @type {HTMLDocument}\n */\nconst doc = global.document;\n\n/**\n * Simple Tooltip\n */\nclass Tooltip extends DestroyableWidget {\n\n /**\n * Creates a Tooltip\n * @param {HTMLElement|String} DelegateContainer\n * @param {Object} [options]\n */\n constructor(DelegateContainer, options) {\n super();\n /**\n * The Container where possible events are captured\n */\n this.container = DelegateContainer instanceof HTMLElement ?\n DelegateContainer : doc.getElementById(DelegateContainer);\n\n if (!this.container) {\n throw new Error('Could not create Tooltip, DelegateContainer not found');\n }\n\n /**\n * The Container where tooltips are stored for this instance\n * @type {HTMLElement}\n */\n this.tooltipContainer = null;\n\n /**\n * Default Options\n */\n this.options = {\n containerClass: '',\n selectorAttribute: 'data-tooltip',\n collisionContainer: this.container\n };\n\n Object.assign(this.options, options || {});\n }\n\n /**\n * Creates and shows a tooltip\n * @param {HTMLElement} target where is this tooltip positioned\n * @param {String} text text content in tooltip, will be NOT escaped\n * @param {Boolean} [removeTitle] removes title element if given\n * @param {Node} [positionRelative]\n */\n createTooltip(target, text, removeTitle, positionRelative) {\n // abort if text is empty\n if (!text || text && text.trim() === '') {\n return;\n }\n\n if (Settings.isTouchDevice() && target && target.hasAttribute(ATTR_DATA_NO_TOUCH)) {\n return;\n }\n\n let tooltipContainer = this.tooltipContainer;\n\n if (!tooltipContainer) {\n tooltipContainer = doc.createElement('div');\n this.container.appendChild(tooltipContainer);\n this.tooltipContainer = tooltipContainer;\n }\n this._restoreClassNames(tooltipContainer, target);\n\n tooltipContainer.style.left = 'auto';\n tooltipContainer.style.top = 'auto';\n tooltipContainer.innerHTML = text;\n tooltipContainer.flexTooltipCurrentTarget = target;\n if (removeTitle) {\n target.oldTitle = text;\n target.removeAttribute('title');\n }\n\n Util.setupPositionNearby(positionRelative || target, tooltipContainer,\n this.options.collisionContainer, true, true);\n\n tooltipContainer.classList.add(CLASS_NAMES_OPEN);\n }\n\n _restoreClassNames(container, target) {\n // allow additional classname per tooltip on target element\n const classNames = [CLASS_NAMES_TOOLTIP, this.options.containerClass];\n const maybeTargetClass = target.getAttribute(ATTR_DATA_CLASSNAME);\n if (maybeTargetClass) {\n classNames.push(maybeTargetClass);\n }\n container.className = classNames.join(\" \");\n return this;\n }\n\n /**\n * @returns {HTMLElement|null}\n */\n getCurrentTarget() {\n return this.tooltipContainer ? this.tooltipContainer.flexTooltipCurrentTarget : null;\n }\n\n /**\n * Destroys this Widget\n * @returns {boolean}\n */\n destroy() {\n super.destroy();\n\n if (this.tooltipContainer) {\n this.tooltipContainer.parentNode.removeChild(this.tooltipContainer);\n return true;\n }\n return false;\n }\n\n /**\n * Removes a Tooltip on given target\n * @param {HTMLElement} [target], if not given will remove current open tooltip on this instance\n */\n removeTooltip(target) {\n let selfTarget = target;\n if (!selfTarget && this.tooltipContainer) {\n selfTarget = this.tooltipContainer.flexTooltipCurrentTarget;\n }\n if (this.tooltipContainer) {\n if (this.tooltipContainer.flexTooltipCurrentTarget !== selfTarget) {\n return;\n }\n this.tooltipContainer.classList.remove(CLASS_NAMES_OPEN);\n delete this.tooltipContainer.flexTooltipCurrentTarget;\n }\n if (selfTarget && selfTarget.oldTitle) {\n selfTarget.setAttribute('title', selfTarget.oldTitle);\n }\n }\n\n /**\n * Initilizes mouse events on container element\n */\n registerEvents() {\n const self = this;\n this.addEventListener(this.container, 'mouseover', (e) => {\n if (e.target.hasAttribute(self.options.selectorAttribute)) {\n self.createTooltip(e.target, e.target.getAttribute('title'), true);\n }\n });\n\n this.addEventListener(this.container, 'mouseout', (e) => {\n if (e.target.hasAttribute(self.options.selectorAttribute)) {\n self.removeTooltip(e.target);\n }\n });\n return this;\n }\n}\n\nexport default Tooltip;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/main/Tooltip.js\n **/","/*\n * The MIT License (MIT)\n *\n * Copyright (c) 2015 David Heidrich, BowlingX \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nconst PFX = [\"webkit\", \"moz\", \"MS\", \"o\", \"\"];\n\nconst COL_LEFT_CLASS = 'is-collision-left';\n\nconst COL_RIGHT_CLASS = 'is-collision-right';\n\nconst COL_BOTTOM_CLASS = 'is-collision-bottom';\n\n/**\n * Provides shared DOM-Utility functions\n */\nclass Util {\n\n /**\n * Will register the right animation event based on browser\n * @param element\n * @param type\n * @param callback\n */\n static prefixedAnimateEvent(element, type, callback) {\n const thisFunction = function thisFunction(e) {\n callback.apply(element, [e, thisFunction]);\n };\n\n for (let p = 0; p < PFX.length; p++) {\n let thisType = type;\n if (!PFX[p]) {\n thisType = type.toLowerCase();\n }\n const name = PFX[p] + thisType;\n element.addEventListener(name, thisFunction, true);\n }\n }\n\n /**\n * Get correct transitionend event\n * @returns {String}\n * @private\n */\n static whichTransitionEndEvent() {\n let t;\n const el = document.createElement('fake');\n\n const transitions = {\n transition: 'transitionend',\n OTransition: 'oTransitionEnd',\n MozTransition: 'transitionend',\n WebkitTransition: 'webkitTransitionEnd'\n };\n\n for (t in transitions) {\n if (el.style[t] !== undefined) {\n return transitions[t];\n }\n }\n }\n\n /**\n * Check if target is part of parent node\n * @param target\n * @param parent\n * @returns {boolean}\n */\n static isPartOfNode(target, parent) {\n if (!target || !parent) {\n return false;\n }\n let now = target;\n while (now !== parent && now !== null) {\n if (now === parent) {\n break;\n }\n now = now.parentNode;\n }\n return now !== null;\n }\n\n /**\n * Finds the closest element including itself matching a callback\n * @param {Node} el\n * @param {Function} callback\n * @returns {Node|boolean}\n */\n static closestCallback(el, callback) {\n let element = el;\n while (element !== null) {\n if (callback(element)) {\n return element;\n }\n element = element.parentNode;\n }\n return false;\n }\n\n /**\n * Walks the tree until func returns true for given argument\n * @param target\n * @param func\n * @returns {boolean|HTMLElement}\n */\n static parentsUntil(target, func) {\n if (!target) {\n return false;\n }\n let now = target;\n while (!func(now) && now !== null) {\n now = now.parentNode;\n }\n\n return now;\n }\n\n /**\n * Generates a unique id\n * @return {String}\n */\n static guid() {\n function s4() {\n return Math.floor((1 + Math.random()) * 0x10000)\n .toString(16)\n .substring(1);\n }\n\n return `${s4() + s4()}-${s4()}-${s4()}-${s4()}-${s4() + s4() + s4()}`;\n }\n\n /**\n * Detects scrollbar width\n * @see http://stackoverflow.com/questions/986937/how-can-i-get-the-browsers-scrollbar-sizes\n * @returns {number}\n */\n static getScrollBarWidth() {\n const doc = global.document;\n const inner = doc.createElement('p');\n\n inner.style.width = \"100%\";\n inner.style.height = \"200px\";\n\n const outer = doc.createElement('div');\n outer.style.position = \"absolute\";\n outer.style.top = \"0px\";\n outer.style.left = \"0px\";\n outer.style.visibility = \"hidden\";\n outer.style.width = \"200px\";\n outer.style.height = \"150px\";\n outer.style.overflow = \"hidden\";\n outer.appendChild(inner);\n\n doc.body.appendChild(outer);\n const w1 = inner.offsetWidth;\n outer.style.overflow = 'scroll';\n let w2 = inner.offsetWidth;\n if (w1 === w2) {\n w2 = outer.clientWidth;\n }\n doc.body.removeChild(outer);\n\n return (w1 - w2);\n }\n\n\n /**\n * Run an event once\n * @param {String} ev\n * @param {HTMLElement|HTMLDocument} target\n * @param {Function} func\n * @param {boolean} [capture]\n * @return Function created listener\n */\n static addEventOnce(ev, target, func, capture) {\n const thisFunction = function thisFunction(event) {\n func(event, func);\n target.removeEventListener(ev, thisFunction, capture);\n };\n target.addEventListener(ev, thisFunction, capture);\n return thisFunction;\n }\n\n /**\n * Checks if an element is visible\n * @param {HTMLElement} element\n * @returns bool\n */\n static isVisible(element) {\n return element.offsetWidth > 0 && element.offsetHeight > 0;\n }\n\n /**\n * Creates a camelCaseRepresentation of a dashed string\n * @param {String} str\n * @returns String\n */\n static dashToCamelCase(str) {\n return str.replace(/-([a-z])/g, (g) => {\n return g[1].toUpperCase();\n });\n }\n\n /**\n * Creates a copy of `input`\n * @param {*} input\n * @return *\n */\n static copy(input) {\n return JSON.parse(JSON.stringify(input));\n }\n\n /**\n * Reads options from element (data attributes) and applies to base\n * @param {HTMLElement} element\n * @param {Object} base\n * @return {Object}\n */\n static applyOptionsFromElement(element, base) {\n if (!element) {\n return base;\n }\n const attrs = element.attributes;\n for (let i = 0; i < attrs.length; i++) {\n const attr = attrs[i];\n if (attr) {\n const s = Util.dashToCamelCase(attr.nodeName.replace('data-', ''));\n const val = attr.nodeValue;\n if (base.hasOwnProperty(s)) {\n // skip functions\n if (typeof base[s] === 'function') {\n continue;\n }\n if (typeof base[s] === 'boolean') {\n base[s] = parseInt(val || 1, 10) === 1;\n } else {\n base[s] = val;\n }\n }\n }\n }\n return base;\n }\n\n /**\n * Will position an element directly at given target\n * Is aware of a given collision container to detect edges\n * Will put elementToPosition either to left, center or right edge (prefer right)\n * and either to bottom or top (prefers bottom)\n *\n * You may overwrite preferred positioned with `centerHorizontal` and `positionTop`\n *\n * @param {HTMLElement|ClientRect} target the target container to align to\n * @param {HTMLElement} elementToPosition the element to position\n * @param {HTMLElement} collisionContainer the outer container to prevent collisions\n * @param {boolean} [centerHorizontal] set true to center element, otherwise it's put on the right border by default\n * @param {boolean} [positionTop] flip top, by default element is positioned to the bottom.\n * @returns {HTMLElement}\n */\n static setupPositionNearby(target, elementToPosition, collisionContainer, centerHorizontal, positionTop) {\n // determine relative offsets\n let amountTop = 0;\n let amountLeft = 0;\n Util.parentsUntil(target.parentNode, (el) => {\n if (!(el instanceof HTMLElement)) {\n return false;\n }\n const style = window.getComputedStyle(el);\n if (Util.isPartOfNode(elementToPosition, el)) {\n if (style && style.position === 'relative') {\n amountTop += el.offsetTop || 0;\n amountLeft += el.offsetLeft || 0;\n }\n return false;\n }\n return true;\n });\n\n const targetPosition = target instanceof HTMLElement ? target.getBoundingClientRect() : target;\n const elementRect = elementToPosition.getBoundingClientRect();\n const colRect = collisionContainer.getBoundingClientRect();\n const targetTop = targetPosition.top - amountTop;\n const targetRight = targetPosition.right;\n const isCollisionTop = (targetTop - elementRect.height) <= 0;\n const isCollisionBottom =\n window.innerHeight < (targetTop + amountTop + targetPosition.height + elementRect.height);\n const isCollisionLeft = targetRight < elementRect.width;\n const targetLeft = targetPosition.left;\n const isCollisionRight = (targetLeft + elementRect.width) > colRect.width;\n const classList = elementToPosition.classList;\n\n classList.remove(COL_RIGHT_CLASS);\n classList.remove(COL_LEFT_CLASS);\n classList.remove(COL_BOTTOM_CLASS);\n\n let calcTop;\n let calcLeft;\n if (isCollisionLeft && !isCollisionRight) {\n // put element to left if collision with left\n calcLeft = `${(targetPosition.left - colRect.left - amountLeft)}px`;\n classList.add(COL_LEFT_CLASS);\n } else {\n // maybe center if no collision with either side\n const rightPosition = `${(targetRight - elementRect.width - colRect.left - amountLeft)}px`;\n const leftCentered = ((targetLeft + targetPosition.width / 2) -\n (elementRect.width / 2) || 0) - colRect.left;\n const collisionCentered = (leftCentered + elementRect.width) > colRect.width;\n if (centerHorizontal && !collisionCentered) {\n calcLeft = `${leftCentered}px`;\n } else {\n classList.add(COL_RIGHT_CLASS);\n calcLeft = rightPosition;\n }\n }\n\n if (isCollisionBottom || (positionTop && !isCollisionTop)) {\n // Put Element on top if collision\n calcTop = `${(targetTop - elementRect.height) - colRect.top}px`;\n classList.add(COL_BOTTOM_CLASS);\n } else {\n calcTop = `${(targetTop + targetPosition.height) - colRect.top}px`;\n }\n\n elementToPosition.style.cssText = `top:${calcTop};left:${calcLeft};`;\n\n return elementToPosition;\n }\n\n /**\n * Brings a given element into viewport\n * @param {HTMLElement} el\n * @param {int|function}[optionalOffset]\n */\n static scrollToElement(el, optionalOffset) {\n el.scrollIntoView();\n let thisOffset = optionalOffset;\n // optionally use a additional scrollDif\n if (thisOffset) {\n if (typeof thisOffset === 'function') {\n thisOffset = optionalOffset();\n }\n if (thisOffset > 0) {\n const scrolledY = window.pageYOffset;\n if (scrolledY) {\n window.scroll(0, scrolledY - thisOffset);\n }\n }\n }\n }\n}\n\nexport default Util;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/main/util/Util.js\n **/","/*\n * The MIT License (MIT)\n *\n * Copyright (c) 2015 David Heidrich, BowlingX \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n/**\n * Provides a Basic Widget\n */\nclass DestroyableWidget {\n\n constructor() {\n this.listeners = [];\n }\n\n /**\n * Destroys a Widget\n */\n destroy() {\n this.listeners.forEach((listener) => {\n listener.element.removeEventListener.apply(listener.element, listener.args);\n });\n this.listeners = [];\n }\n\n /**\n * Adds an event and registers it later to remove bindings\n * @param {HTMLElement} element\n * @param {String} name\n * @param {Function} listener\n * @param {boolean} [capture]\n * @returns {Function}\n */\n addEventListener(element, name, listener, capture) {\n this.listeners.push({\n element,\n args: [name, listener, capture]\n });\n\n element.addEventListener(name, listener, capture);\n return listener;\n }\n\n}\n\nexport default DestroyableWidget;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/main/DestroyableWidget.js\n **/","/*\n * The MIT License (MIT)\n *\n * Copyright (c) 2015 David Heidrich, BowlingX \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\nimport Util from './Util';\n\n// we attach global settings to global once because settings might be shared a lot of times trough the application\n// Maybe find a better way to handle that scenario\nif (!global.FLEXCSS_GLOBAL_SETTINGS) {\n global.FLEXCSS_GLOBAL_SETTINGS = {\n // defined breakpoint for small devices < n\n smallBreakpoint: 768,\n // nodes that should be updated when no scrollbar is expected\n scrollbarUpdateNodes: global.document.body !== null ? [global.document.body] : [],\n // additional Delay until darkener is fully hidden\n darkenerFadeDelay: 100,\n // class that is added if canvas has been toggled\n canvasToggledClass: 'toggled-canvas'\n };\n\n global.FLEXCSS_CONST_IS_IOS = null;\n\n global.FLEXCSS_CONST_IS_TOUCH = null;\n\n global.FLEXCSS_CONST_IS_IE = null;\n\n global.FLEXCSS_CONST_TAB_EVENT = 'click';\n\n global.FLEXCSS_IS_SMALL_SCREEN = false;\n\n const init = () => {\n // Measure scrollbar width\n global.FLEXCSS_CONST_SCROLLBAR_WIDTH = Util.getScrollBarWidth();\n // detect right transition end event\n global.FLEXCSS_CONST_TRANSITION_EVENT = Util.whichTransitionEndEvent();\n };\n\n if (global.document.readyState !== 'loading') {\n init();\n } else {\n // it's possible that global.document.body is not available if the document is not\n // loaded completely\n document.addEventListener('DOMContentLoaded', () => {\n init();\n });\n }\n}\n\n/**\n * Utility class that setups global settings\n */\nclass Settings {\n\n /**\n * Setup global settings, overwrite default values\n * @param {Object} settings\n */\n static setup(settings) {\n Object.assign(global.FLEXCSS_GLOBAL_SETTINGS, settings);\n }\n\n /**\n * Access to global settings\n * @returns {Object}\n */\n static get() {\n return global.FLEXCSS_GLOBAL_SETTINGS;\n }\n\n /**\n * Detects a IOS Device, caches subsequent calls\n * @returns {boolean}\n */\n static isIosDevice() {\n if (!global.FLEXCSS_CONST_IS_IOS) {\n global.FLEXCSS_CONST_IS_IOS = global.navigator.userAgent.match(/(iPad|iPhone|iPod)/i);\n }\n\n return global.FLEXCSS_CONST_IS_IOS;\n }\n\n /**\n * @returns {boolean}\n */\n static isSmallScreen() {\n return window.innerWidth < Settings.get().smallBreakpoint;\n }\n\n /**\n * Detects a touch device, caches subsequent calls\n * @returns {boolean}\n */\n static isTouchDevice() {\n if (!global.FLEXCSS_CONST_IS_TOUCH) {\n global.FLEXCSS_CONST_IS_TOUCH = 'ontouchstart' in window || !!(global.navigator.msMaxTouchPoints);\n }\n return global.FLEXCSS_CONST_IS_TOUCH;\n }\n\n /**\n * Checks if current browser is Internet Explorer\n * @returns {boolean|*}\n */\n static isIE() {\n if (!global.FLEXCSS_CONST_IS_IE) {\n global.FLEXCSS_CONST_IS_IE = \"ActiveXObject\" in window;\n }\n return global.FLEXCSS_CONST_IS_IE;\n }\n\n /**\n * @returns {String}\n */\n static getTransitionEvent() {\n return global.FLEXCSS_CONST_TRANSITION_EVENT;\n }\n\n /**\n * @returns {int}\n */\n static getScrollbarWidth() {\n return global.FLEXCSS_CONST_SCROLLBAR_WIDTH;\n }\n\n /**\n * @returns {String}\n */\n static getTabEvent() {\n return global.FLEXCSS_CONST_TAB_EVENT;\n }\n}\n\nexport default Settings;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/main/util/Settings.js\n **/","// the whatwg-fetch polyfill installs the fetch() function\n// on the global object (window or self)\n//\n// Return that as the export for use in Webpack, Browserify etc.\nrequire('whatwg-fetch');\nmodule.exports = self.fetch.bind(self);\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/isomorphic-fetch/fetch-npm-browserify.js\n ** module id = 12\n ** module chunks = 2 3\n **/","(function(self) {\n 'use strict';\n\n if (self.fetch) {\n return\n }\n\n function normalizeName(name) {\n if (typeof name !== 'string') {\n name = String(name)\n }\n if (/[^a-z0-9\\-#$%&'*+.\\^_`|~]/i.test(name)) {\n throw new TypeError('Invalid character in header field name')\n }\n return name.toLowerCase()\n }\n\n function normalizeValue(value) {\n if (typeof value !== 'string') {\n value = String(value)\n }\n return value\n }\n\n function Headers(headers) {\n this.map = {}\n\n if (headers instanceof Headers) {\n headers.forEach(function(value, name) {\n this.append(name, value)\n }, this)\n\n } else if (headers) {\n Object.getOwnPropertyNames(headers).forEach(function(name) {\n this.append(name, headers[name])\n }, this)\n }\n }\n\n Headers.prototype.append = function(name, value) {\n name = normalizeName(name)\n value = normalizeValue(value)\n var list = this.map[name]\n if (!list) {\n list = []\n this.map[name] = list\n }\n list.push(value)\n }\n\n Headers.prototype['delete'] = function(name) {\n delete this.map[normalizeName(name)]\n }\n\n Headers.prototype.get = function(name) {\n var values = this.map[normalizeName(name)]\n return values ? values[0] : null\n }\n\n Headers.prototype.getAll = function(name) {\n return this.map[normalizeName(name)] || []\n }\n\n Headers.prototype.has = function(name) {\n return this.map.hasOwnProperty(normalizeName(name))\n }\n\n Headers.prototype.set = function(name, value) {\n this.map[normalizeName(name)] = [normalizeValue(value)]\n }\n\n Headers.prototype.forEach = function(callback, thisArg) {\n Object.getOwnPropertyNames(this.map).forEach(function(name) {\n this.map[name].forEach(function(value) {\n callback.call(thisArg, value, name, this)\n }, this)\n }, this)\n }\n\n function consumed(body) {\n if (body.bodyUsed) {\n return Promise.reject(new TypeError('Already read'))\n }\n body.bodyUsed = true\n }\n\n function fileReaderReady(reader) {\n return new Promise(function(resolve, reject) {\n reader.onload = function() {\n resolve(reader.result)\n }\n reader.onerror = function() {\n reject(reader.error)\n }\n })\n }\n\n function readBlobAsArrayBuffer(blob) {\n var reader = new FileReader()\n reader.readAsArrayBuffer(blob)\n return fileReaderReady(reader)\n }\n\n function readBlobAsText(blob) {\n var reader = new FileReader()\n reader.readAsText(blob)\n return fileReaderReady(reader)\n }\n\n var support = {\n blob: 'FileReader' in self && 'Blob' in self && (function() {\n try {\n new Blob();\n return true\n } catch(e) {\n return false\n }\n })(),\n formData: 'FormData' in self,\n arrayBuffer: 'ArrayBuffer' in self\n }\n\n function Body() {\n this.bodyUsed = false\n\n\n this._initBody = function(body) {\n this._bodyInit = body\n if (typeof body === 'string') {\n this._bodyText = body\n } else if (support.blob && Blob.prototype.isPrototypeOf(body)) {\n this._bodyBlob = body\n } else if (support.formData && FormData.prototype.isPrototypeOf(body)) {\n this._bodyFormData = body\n } else if (!body) {\n this._bodyText = ''\n } else if (support.arrayBuffer && ArrayBuffer.prototype.isPrototypeOf(body)) {\n // Only support ArrayBuffers for POST method.\n // Receiving ArrayBuffers happens via Blobs, instead.\n } else {\n throw new Error('unsupported BodyInit type')\n }\n\n if (!this.headers.get('content-type')) {\n if (typeof body === 'string') {\n this.headers.set('content-type', 'text/plain;charset=UTF-8')\n } else if (this._bodyBlob && this._bodyBlob.type) {\n this.headers.set('content-type', this._bodyBlob.type)\n }\n }\n }\n\n if (support.blob) {\n this.blob = function() {\n var rejected = consumed(this)\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return Promise.resolve(this._bodyBlob)\n } else if (this._bodyFormData) {\n throw new Error('could not read FormData body as blob')\n } else {\n return Promise.resolve(new Blob([this._bodyText]))\n }\n }\n\n this.arrayBuffer = function() {\n return this.blob().then(readBlobAsArrayBuffer)\n }\n\n this.text = function() {\n var rejected = consumed(this)\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return readBlobAsText(this._bodyBlob)\n } else if (this._bodyFormData) {\n throw new Error('could not read FormData body as text')\n } else {\n return Promise.resolve(this._bodyText)\n }\n }\n } else {\n this.text = function() {\n var rejected = consumed(this)\n return rejected ? rejected : Promise.resolve(this._bodyText)\n }\n }\n\n if (support.formData) {\n this.formData = function() {\n return this.text().then(decode)\n }\n }\n\n this.json = function() {\n return this.text().then(JSON.parse)\n }\n\n return this\n }\n\n // HTTP methods whose capitalization should be normalized\n var methods = ['DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT']\n\n function normalizeMethod(method) {\n var upcased = method.toUpperCase()\n return (methods.indexOf(upcased) > -1) ? upcased : method\n }\n\n function Request(input, options) {\n options = options || {}\n var body = options.body\n if (Request.prototype.isPrototypeOf(input)) {\n if (input.bodyUsed) {\n throw new TypeError('Already read')\n }\n this.url = input.url\n this.credentials = input.credentials\n if (!options.headers) {\n this.headers = new Headers(input.headers)\n }\n this.method = input.method\n this.mode = input.mode\n if (!body) {\n body = input._bodyInit\n input.bodyUsed = true\n }\n } else {\n this.url = input\n }\n\n this.credentials = options.credentials || this.credentials || 'omit'\n if (options.headers || !this.headers) {\n this.headers = new Headers(options.headers)\n }\n this.method = normalizeMethod(options.method || this.method || 'GET')\n this.mode = options.mode || this.mode || null\n this.referrer = null\n\n if ((this.method === 'GET' || this.method === 'HEAD') && body) {\n throw new TypeError('Body not allowed for GET or HEAD requests')\n }\n this._initBody(body)\n }\n\n Request.prototype.clone = function() {\n return new Request(this)\n }\n\n function decode(body) {\n var form = new FormData()\n body.trim().split('&').forEach(function(bytes) {\n if (bytes) {\n var split = bytes.split('=')\n var name = split.shift().replace(/\\+/g, ' ')\n var value = split.join('=').replace(/\\+/g, ' ')\n form.append(decodeURIComponent(name), decodeURIComponent(value))\n }\n })\n return form\n }\n\n function headers(xhr) {\n var head = new Headers()\n var pairs = xhr.getAllResponseHeaders().trim().split('\\n')\n pairs.forEach(function(header) {\n var split = header.trim().split(':')\n var key = split.shift().trim()\n var value = split.join(':').trim()\n head.append(key, value)\n })\n return head\n }\n\n Body.call(Request.prototype)\n\n function Response(bodyInit, options) {\n if (!options) {\n options = {}\n }\n\n this.type = 'default'\n this.status = options.status\n this.ok = this.status >= 200 && this.status < 300\n this.statusText = options.statusText\n this.headers = options.headers instanceof Headers ? options.headers : new Headers(options.headers)\n this.url = options.url || ''\n this._initBody(bodyInit)\n }\n\n Body.call(Response.prototype)\n\n Response.prototype.clone = function() {\n return new Response(this._bodyInit, {\n status: this.status,\n statusText: this.statusText,\n headers: new Headers(this.headers),\n url: this.url\n })\n }\n\n Response.error = function() {\n var response = new Response(null, {status: 0, statusText: ''})\n response.type = 'error'\n return response\n }\n\n var redirectStatuses = [301, 302, 303, 307, 308]\n\n Response.redirect = function(url, status) {\n if (redirectStatuses.indexOf(status) === -1) {\n throw new RangeError('Invalid status code')\n }\n\n return new Response(null, {status: status, headers: {location: url}})\n }\n\n self.Headers = Headers;\n self.Request = Request;\n self.Response = Response;\n\n self.fetch = function(input, init) {\n return new Promise(function(resolve, reject) {\n var request\n if (Request.prototype.isPrototypeOf(input) && !init) {\n request = input\n } else {\n request = new Request(input, init)\n }\n\n var xhr = new XMLHttpRequest()\n\n function responseURL() {\n if ('responseURL' in xhr) {\n return xhr.responseURL\n }\n\n // Avoid security warnings on getResponseHeader when not allowed by CORS\n if (/^X-Request-URL:/m.test(xhr.getAllResponseHeaders())) {\n return xhr.getResponseHeader('X-Request-URL')\n }\n\n return;\n }\n\n xhr.onload = function() {\n var status = (xhr.status === 1223) ? 204 : xhr.status\n if (status < 100 || status > 599) {\n reject(new TypeError('Network request failed'))\n return\n }\n var options = {\n status: status,\n statusText: xhr.statusText,\n headers: headers(xhr),\n url: responseURL()\n }\n var body = 'response' in xhr ? xhr.response : xhr.responseText;\n resolve(new Response(body, options))\n }\n\n xhr.onerror = function() {\n reject(new TypeError('Network request failed'))\n }\n\n xhr.open(request.method, request.url, true)\n\n if (request.credentials === 'include') {\n xhr.withCredentials = true\n }\n\n if ('responseType' in xhr && support.blob) {\n xhr.responseType = 'blob'\n }\n\n request.headers.forEach(function(value, name) {\n xhr.setRequestHeader(name, value)\n })\n\n xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit)\n })\n }\n self.fetch.polyfill = true\n})(typeof self !== 'undefined' ? self : this);\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/whatwg-fetch/fetch.js\n ** module id = 13\n ** module chunks = 2 3\n **/","/* global CustomEvent */\n\n/*\n * The MIT License (MIT)\n *\n * Copyright (c) 2015 David Heidrich, BowlingX \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n// polyfill for custom events to make thinks work in IE\n// The needed polyfill is so small that I embedded it here\n(function poly() {\n if (!global.CustomEvent || typeof global.CustomEvent !== 'function') {\n const CustomEvent = function CustomEvent(event, params) {\n const thisParams = params ||\n {\n bubbles: false,\n cancelable: false,\n detail: undefined\n };\n const evt = document.createEvent(\"CustomEvent\");\n evt.initCustomEvent(event, thisParams.bubbles,\n thisParams.cancelable, thisParams.detail);\n return evt;\n };\n CustomEvent.prototype = global.Event.prototype;\n global.CustomEvent = CustomEvent;\n }\n})();\n/**\n * Simpler Event dispatching\n */\nclass EventHandler {\n\n /**\n * @param {HTMLElement} target\n * @param {String} name\n */\n constructor(target, name) {\n this.target = target;\n this.defaultOptions = {\n bubbles: true,\n cancelable: true\n };\n\n this.name = name;\n }\n\n /**\n * Set more options\n * @param {Object} options\n * @returns {EventHandler}\n */\n withOptions(options) {\n Object.assign(this.defaultOptions, (options || {}));\n return this;\n }\n\n /**\n * Call with the originalEvent\n * @param {Event} e\n * @returns {EventHandler}\n */\n withOriginal(e) {\n return this.withDetail({\n originalEvent: e\n });\n }\n\n /**\n * Extends the detail part of the event\n * @param {Object} o\n * @returns {EventHandler}\n */\n withDetail(o) {\n if (!this.defaultOptions.detail) {\n this.defaultOptions.detail = {};\n }\n Object.assign(this.defaultOptions.detail, o);\n return this;\n }\n\n /**\n * @returns {CustomEvent}\n */\n fire() {\n const e = new CustomEvent(this.name, this.defaultOptions);\n if (this.target) {\n this.target.dispatchEvent(e);\n }\n return e;\n }\n}\n\nclass Event {\n /**\n * Prepares to dispatch a custom event (without firing)\n * @param {HTMLElement} target\n * @param {String} name\n * @returns {EventHandler}\n */\n static dispatch(target, name) {\n return new EventHandler(target, name);\n }\n\n /**\n * Dispatches a custom event and fires it directly\n * @param {HTMLElement} target\n * @param {String} name\n * @param {Object} [options]\n * @returns {CustomEvent}\n */\n static dispatchAndFire(target, name, options) {\n return new EventHandler(target, name).withOptions(options).fire();\n }\n}\n\nexport default Event;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/main/util/Event.js\n **/","/*\n * The MIT License (MIT)\n *\n * Copyright (c) 2015 David Heidrich, BowlingX \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n/*!\n * FlexCss.Modal\n * Licensed under the MIT License (MIT)\n * Copyright (c) 2015 David Heidrich, BowlingX \n */\n\n/* global KeyboardEvent */\n\nimport Settings from './util/Settings';\nimport Event from './util/Event';\nimport Util from './util/Util';\nimport Widget from './Widget';\nimport FixedWindow from './lib/FixedWindow';\n\nconst HTML_ELEMENT = global.document.documentElement;\nconst KEY_ESC = 27;\n/* Attribute Names */\nconst ATTR_CREATE_NEW = 'data-new-instance';\nconst ATTR_CLOSE = 'data-close-modal';\nconst ATTR_NAME = 'data-modal';\n\n/* Class names */\nconst CLS_CONTAINER_CURRENT = 'front';\nconst CLS_OPEN = 'open';\nconst CLS_CURRENT = 'current';\nconst CLS_PART_OF_STACK = 'part-of-stack';\nconst CLS_MODAL_OPEN = 'modal-open';\nconst CLS_MODAL_CONTAINER = 'modal-container';\nconst CLS_ANIM_END = 'modal-anim-end';\nconst CLS_LOADER_CONTAINER = 'loader-container';\nconst CLS_LOADER = 'loader';\n\n/* Events */\n\n/**\n * Event triggered when modal is closed\n * @type {string}\n */\nexport const EVENT_MODAL_CLOSED = 'flexcss.modal.closed';\n/**\n * Event triggered before a modal is closed, cancelable\n * @type {string}\n */\nexport const EVENT_MODAL_BEFORE_CLOSED = 'flexcss.modal.beforeClose';\n/**\n * Event triggered when a modal is opened\n * @type {string}\n */\nexport const EVENT_MODAL_OPENED = 'flexcss.modal.opened';\n\n/**\n * Event triggered when modal is initilized, called on target\n * @type {string}\n */\nexport const EVENT_MODAL_INIT = 'flexcss.modal.init';\n\n/**\n * Triggered when the content of an async modal on a target is loaded, called on target\n * @type {string}\n */\nexport const EVENT_MODAL_ASYNC_TARGET_LOADED = 'flexcss.modal.asyncTargetLoaded';\n\n/**\n * A Modal Implementation\n */\nclass Modal {\n constructor(DelegateContainer, options) {\n const doc = global.document;\n const container = DelegateContainer instanceof HTMLElement ?\n DelegateContainer : doc.getElementById(DelegateContainer);\n\n // Instance vars:\n if (!container) {\n throw new Error(`Could not found container element by given ID/Element: ${DelegateContainer}`);\n }\n\n this.currentOpen = null;\n\n this.loading = false;\n\n this.container = container;\n\n /**\n * Default Options\n */\n this.options = {\n classNames: 'modal',\n closeOnEscape: true,\n closeOnBackgroundClick: true,\n destroyOnFinish: false,\n fixedContainer: true,\n containerClassNames: ''\n };\n\n Object.assign(this.options, options);\n\n // Container where events are delegated\n this.eventContainer = null;\n this.eventFunction = null;\n\n this.dataMainPageContainer = global.document.body;\n\n this.currentScrollTop = 0;\n\n this.modalContainer = null;\n\n // Destroy full modal instance when no dialogs are bind to?\n // Otherwise container is recycled\n this.destroyOnFinish = this.options.destroyOnFinish;\n }\n\n /**\n * Removes this modal from global stack\n * Will handle fixing main html element too\n * @private\n * @param n\n */\n _removeModalFromStack(n) {\n const t = Modal._modalInstances.indexOf(n);\n if (t > -1) {\n Modal._modalInstances.splice(t, 1);\n FixedWindow.getInstance().close();\n HTML_ELEMENT.classList.remove(CLS_MODAL_OPEN);\n }\n }\n\n\n /**\n * Modal container that contains all `stacked` modals for this instance\n * @returns {HTMLElement}\n */\n getModalContainer() {\n return this.modalContainer;\n }\n\n /**\n * Closes the current open modal of this stack\n * @params [e], optional event\n * @returns {*}\n */\n close(e) {\n const self = this;\n\n const options = self.currentOpen ? Util.applyOptionsFromElement(\n self.currentOpen, Util.copy(self.options)) : self.options;\n\n // close only on keyboard if instance should\n if (!options.closeOnEscape && e instanceof KeyboardEvent) {\n return false;\n }\n\n // close only on background if instance should\n if (!options.closeOnBackgroundClick && e &&\n e.type === Settings.getTabEvent() && !e.target.hasAttribute(ATTR_CLOSE)) {\n return false;\n }\n\n // if an instance is currently loading, prevent from closing\n if (self.loading) {\n return false;\n }\n\n if (e) {\n e.preventDefault();\n }\n\n if (self.currentOpen) {\n // dispatch beforeClose event, if prevented prevent modal from closing\n var ev = Event.dispatchAndFire(self.currentOpen, EVENT_MODAL_BEFORE_CLOSED);\n if (ev.defaultPrevented) {\n return false;\n }\n\n this._finishState(self.currentOpen);\n // if there is an previous modal\n if (self.currentOpen.prevModal) {\n // switch to the next modal\n return self.switchModals(self.currentOpen.prevModal,\n self.currentOpen.prevModal.prevModal || null);\n }\n\n // finally trigger closed event\n Event.dispatch(self.currentOpen, EVENT_MODAL_CLOSED).withOriginal(e).fire();\n\n }\n self._removeModalFromStack(self.currentOpen);\n\n // Full stack closed:\n self.currentOpen = null;\n if (self.modalContainer) {\n // setup next open\n var lastContainer = Modal._modalInstances[Modal._modalInstances.length - 1],\n classList = self.modalContainer.classList;\n classList.remove(CLS_CONTAINER_CURRENT);\n classList.remove(CLS_OPEN);\n // Remove all current classes from child-nodes\n for (var i = 0; i < self.modalContainer.childNodes.length; i++) {\n var node = self.modalContainer.childNodes[i], cl = node.classList;\n // remove applied styles\n self._finishState(node);\n cl.remove(CLS_CURRENT);\n cl.remove(CLS_PART_OF_STACK);\n }\n if (lastContainer) {\n lastContainer.parentNode.classList.add(CLS_CONTAINER_CURRENT);\n }\n }\n\n if (self.destroyOnFinish) {\n self.destroy();\n }\n return self;\n }\n\n /**\n * Resets a target when newly initilizes\n * @param target\n * @private\n */\n _finishState(target) {\n target.classList.remove(CLS_ANIM_END);\n }\n\n /**\n * Handler called when a Modal has finished an animation\n * @param e\n * @param self\n * @private\n */\n _finishAnim(e, self) {\n e.target.classList.add(CLS_ANIM_END);\n e.target.removeEventListener(e.type, self, true);\n }\n\n /**\n * Brings the given modal to front\n * @param co\n * @param last\n */\n switchModals(co, last) {\n co.prevModal = last;\n Modal._modalInstances.push(co);\n FixedWindow.getInstance().open(this, this.modalContainer);\n if (last) {\n this._finishState(last);\n Util.prefixedAnimateEvent(last, 'AnimationEnd', this._finishAnim);\n last.classList.add(CLS_PART_OF_STACK);\n }\n // set new currentOpen\n this.currentOpen = co;\n\n // bring current container to the front\n var instances = Modal._modalInstances;\n\n for (var m = 0; m < instances.length; m++) {\n instances[m].parentNode.classList.remove(CLS_CONTAINER_CURRENT);\n }\n this.modalContainer.classList.add(CLS_CONTAINER_CURRENT);\n // remove animations if animations has been completed, fixes various bugs:\n // - fixes nested scrolling element issue in iOS Browsers / Mobile-Safari\n Util.prefixedAnimateEvent(co, 'AnimationEnd', this._finishAnim);\n\n for (var i = 0; i < this.modalContainer.childNodes.length; i++) {\n var n = this.modalContainer.childNodes[i], isCurrent = n.classList.contains(CLS_CURRENT);\n if (n === co) {\n co.classList.add(CLS_CURRENT);\n co.classList.remove(CLS_PART_OF_STACK);\n this._finishState(co);\n } else {\n n.classList.remove(CLS_CURRENT);\n if (isCurrent) {\n this._removeModalFromStack(n);\n Event.dispatchAndFire(n, EVENT_MODAL_CLOSED);\n }\n }\n }\n }\n\n handleScrollbar() {\n if (Modal._modalInstances.length === 0) {\n HTML_ELEMENT.classList.add(CLS_MODAL_OPEN);\n }\n }\n\n /**\n * Creates a Modal and opens it (later)\n * @param e\n * @returns {Promise|boolean}\n */\n createWidget(e) {\n var self = this;\n if (this.loading) {\n return false;\n }\n\n // check if another modal has registered events on this dom path:\n if (e && e.target) {\n var foundInstance = Util.parentsUntil(e.target, function (node) {\n return node && node.flexModalInstance;\n });\n\n // if another instance has been found, abort\n if (foundInstance !== this.container) {\n return false;\n }\n }\n var targetContent, future, widget, target, hasTarget = true,\n isHtmlElement = e instanceof HTMLElement, isWidget = Widget.isWidget(e);\n if (isHtmlElement || isWidget) {\n if (isHtmlElement) {\n targetContent = e;\n } else {\n widget = e;\n targetContent = widget.element;\n }\n } else {\n target = e.target;\n if (!target) {\n throw 'Could not find target, did you pass an event, a HTMLElement or an Widget?';\n }\n hasTarget = target.hasAttribute(ATTR_NAME);\n targetContent = target.getAttribute(ATTR_NAME);\n widget = Widget.findWidget(target);\n if (target.hasAttribute(ATTR_CREATE_NEW) && !e.newInstance) {\n var newInstance = new Modal(this.container)\n .setDestroyOnFinish(true);\n e.newInstance = true;\n newInstance.fromEvent(e).then(function () {\n newInstance.registerEvents(newInstance.getModalContainer());\n });\n return false;\n }\n if (hasTarget) {\n e.stopImmediatePropagation();\n e.preventDefault();\n }\n }\n\n if (!hasTarget) {\n return false;\n }\n\n let modalContainerClasses = this.modalContainer ? this.modalContainer.classList : [];\n\n // lazy create modal container\n if (!this.modalContainer) {\n this.modalContainer = global.document.createElement('div');\n this.modalContainer.className = `${CLS_MODAL_CONTAINER} ${this.options.containerClassNames} ${CLS_OPEN}`;\n const closeModalFunction = function (ce) {\n if (self.loading) {\n return false;\n }\n if (Util.isPartOfNode(ce.target, self.currentOpen)) {\n if (!ce.target.hasAttribute(ATTR_CLOSE)) {\n return false;\n }\n }\n self.close(ce);\n };\n\n this.modalContainer.addEventListener(Settings.getTabEvent(), closeModalFunction, false);\n\n modalContainerClasses = this.modalContainer.classList;\n this.container.appendChild(this.modalContainer);\n\n } else {\n modalContainerClasses.add(CLS_OPEN);\n }\n\n let loader, doc = global.document, toggleLoader = function (show) {\n if (show) {\n loader = doc.createElement('div');\n loader.className = CLS_LOADER_CONTAINER;\n var loaderLoader = doc.createElement('div');\n loaderLoader.className = CLS_LOADER;\n loader.appendChild(loaderLoader);\n self.modalContainer.appendChild(loader);\n } else {\n loader.parentNode.removeChild(loader);\n }\n };\n\n this.handleScrollbar();\n\n modalContainerClasses.add(CLS_CONTAINER_CURRENT);\n modalContainerClasses.add('loading');\n this.loading = true;\n toggleLoader(true);\n var async = widget ? widget.getAsync() : null;\n if (Widget.isWidget(widget) && async) {\n future = async.then(function (r) {\n var result;\n if (r instanceof HTMLElement || r instanceof DocumentFragment) {\n result = r;\n } else {\n // Create container Element:\n var element = doc.createElement('div');\n element.className = self.options.classNames;\n element.innerHTML = r;\n element.id = Util.guid();\n result = element;\n }\n widget.finalContent = result;\n Event.dispatchAndFire(target, EVENT_MODAL_ASYNC_TARGET_LOADED);\n return result;\n });\n } else {\n var el = targetContent instanceof HTMLElement ||\n targetContent instanceof DocumentFragment ? targetContent : doc.getElementById(targetContent);\n if (el) {\n future = new Promise((resolve) => {\n resolve(el);\n });\n } else {\n throw 'Could not found given modal element (content) with ID: ' + targetContent;\n }\n }\n\n Event.dispatchAndFire(target, EVENT_MODAL_INIT);\n\n return future.then((thisEl) => {\n thisEl.hfWidgetInstance = self;\n self.modalContainer.appendChild(thisEl);\n modalContainerClasses.remove('loading');\n self.loading = false;\n toggleLoader(false);\n\n self.open(thisEl, true, e);\n\n return thisEl;\n });\n }\n\n /**\n * Open's an already rendered modal\n * @param {HTMLElement} modal\n * @param {Boolean} [internal], set to true to prevent container management\n * @param {Boolean} [maybeEvent], optional event-object that triggered open\n */\n open(modal, internal, maybeEvent) {\n\n\n if (!internal) {\n this.modalContainer.classList.add('open');\n this.handleScrollbar();\n }\n this.switchModals(modal, this.currentOpen);\n\n Event.dispatch(modal, EVENT_MODAL_OPENED).withOriginal(maybeEvent).fire();\n }\n\n\n registerEvents(delegate) {\n var delegateContainer = delegate || this.container, self = this;\n // Modals should always be fixed\n FixedWindow.getInstance().addScreenConstraint(Modal, (width) => true);\n // register modal instance so we can detect multiple registrars\n delegateContainer.flexModalInstance = self;\n self.eventFunction = function () {\n self.createWidget.apply(self, arguments);\n };\n delegateContainer.addEventListener(Settings.getTabEvent(), self.eventFunction, false);\n\n self.eventContainer = delegateContainer;\n return self;\n }\n\n\n /**\n * Creates a new Dialog Instance either directly from HTML Element or a Widget instance\n * @param {HTMLElement|Widget} widget instance or html element\n * @returns {Promise}\n */\n fromWidget(widget) {\n return this.createWidget(widget);\n }\n\n /**\n * Creates a Widget from event\n * @param e\n * @returns {Promise}\n */\n fromEvent(e) {\n return this.createWidget(e);\n }\n\n setDestroyOnFinish(v) {\n this.destroyOnFinish = v;\n return this;\n }\n\n /**\n * Destroy this widget instance, cleans empty DOM nodes\n * Will use fast MutationObserver if available, otherwise falls back to DOMNodeRemoved event\n */\n destroy() {\n let self = this, modalContainer = this.modalContainer;\n const isEmptyContainer = modalContainer.childNodes.length === 0;\n // Remove event listener on destroy, do not remove DOM node\n if (self.eventContainer) {\n self.eventContainer.removeEventListener(Settings.getTabEvent(), self.eventFunction, true);\n }\n\n if (isEmptyContainer) {\n if (modalContainer.parentNode) {\n modalContainer.parentNode.removeChild(modalContainer);\n }\n }\n if (global.MutationObserver) {\n var observer = new MutationObserver(function (mutations) {\n mutations.forEach(function () {\n if (isEmptyContainer) {\n modalContainer.parentNode.removeChild(modalContainer);\n observer.disconnect();\n }\n });\n });\n observer.observe(modalContainer, {childList: true});\n } else {\n modalContainer.addEventListener('DOMNodeRemoved', function (e) {\n if (e.target !== modalContainer && (modalContainer.childNodes.length - 1) === 0) {\n modalContainer.parentNode.removeChild(modalContainer);\n }\n });\n }\n }\n}\n\n\n// Static variable that keeps track of all open modals\nModal._modalInstances = [];\n\n// Global keydown listener for modal\nglobal.addEventListener('keydown', function (e) {\n if (e.keyCode === KEY_ESC) {\n var lastModal = Modal._modalInstances[Modal._modalInstances.length - 1];\n if (lastModal) {\n Widget.findWidget(lastModal).close(e);\n }\n }\n});\n\nexport default Modal;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/main/Modal.js\n **/","/*\n * The MIT License (MIT)\n *\n * Copyright (c) 2015 David Heidrich, BowlingX \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n/*!\n * FlexCss.Widget\n * Licensed under the MIT License (MIT)\n * Copyright (c) 2015 David Heidrich, BowlingX \n */\n\n/**\n * A Widget provides async content on a specific target (e.g. a modal link)\n */\nclass Widget {\n\n /**\n * Creates a new Widget\n * @param [element], optional define the content of widget\n */\n constructor(element) {\n /**\n *\n * @type {Promise}\n */\n this.asyncContent = null;\n\n /**\n * @type {boolean}\n */\n this._isWidget = true;\n\n if (element) {\n /**\n * @type {HTMLElement}\n */\n this.element = element instanceof HTMLElement ? element : global.document.getElementById(element);\n if (this.element) {\n this.element.hfWidgetInstance = this;\n this.setAsync(() => {\n return new Promise((s) => {\n s(this.element);\n });\n });\n } else {\n throw new Error(`Could not found element with ID: ${element}`);\n }\n }\n /**\n * The final resulted content that a widget did create (e.g. a modal container)\n * @type {HTMLElement}\n */\n this.finalContent = null;\n }\n\n /**\n *\n * @returns {Promise}\n */\n getAsync() {\n return this.asyncContent();\n }\n\n /**\n * @param {Function.} async\n * @returns {Widget}\n */\n setAsync(async) {\n this.asyncContent = async;\n return this;\n }\n\n /**\n * @returns {HTMLElement}\n */\n getFinalContent() {\n return this.finalContent;\n }\n\n /**\n * @param {HTMLElement} element\n * @returns {Widget}\n */\n setElement(element) {\n this.element = element;\n return this;\n }\n\n /**\n * Destroys the generated content of this widget\n * @returns {boolean}\n */\n destroy() {\n if (this.finalContent && this.finalContent.parentNode) {\n this.finalContent.parentNode.removeChild(this.finalContent);\n return true;\n }\n\n delete this.element;\n delete this.asyncContent;\n delete this.finalContent;\n\n return false;\n }\n\n /**\n * Will find a widget on an Element\n * @param {HTMLElement} element\n * @returns {Widget|undefined}\n */\n static findWidget(element) {\n return element ? element.hfWidgetInstance : undefined;\n }\n\n /**\n * Checks if a given object is an instance\n * @param {Object} self\n * @returns {boolean}\n */\n static isWidget(self) {\n return self instanceof Widget || typeof self === 'object' && self.hasOwnProperty('_isWidget');\n }\n}\n\nexport default Widget;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/main/Widget.js\n **/","import Settings from '../util/Settings';\nimport debounce from './debounce';\nimport Event from '../util/Event';\nimport Util from '../util/Util';\n\nconst CLS_FIXED_WINDOW = 'fixed-window-open';\n\nexport const EVENT_BEFORE_FIXED_ADD = 'flexcss.fixedWindow.beforeAdd';\nexport const EVENT_AFTER_FIXED_REMOVE = 'flexcss.fixedWindow.afterRemove';\n\n/**\n * @type {FixedWindow}\n */\nlet fixedWindowInstance;\n\nexport default class FixedWindow {\n\n constructor() {\n this.widgets = [];\n this.currentScrollTop = 0;\n this.fixedScreenConstraints = [];\n this.windowWidth = 0;\n this.isFixedWindowActive = false;\n this.touchListener = null;\n }\n\n /**\n * Adds a constraint to detect if the window needs to be changed when the screensize changes\n *\n * @param {Function} widget\n * @param {Function} fixedBreakpointFn gets a width argument, return true to open a window\n */\n addScreenConstraint(widget, fixedBreakpointFn) {\n this.fixedScreenConstraints[widget] = fixedBreakpointFn;\n }\n\n /**\n * @returns {null|DestroyableWidget}\n */\n getCurrentWidget() {\n return this.widgets.length > 0 ? this.widgets[this.widgets.length - 1] : null;\n }\n\n /**\n * @private\n */\n _checkFixedNeeded() {\n if (this.widgets.length === 0) {\n return;\n }\n const widgets = new Set(this.widgets);\n const widgetsThatRequireFixedWindow = Array.from(widgets).some(({ widget }) => {\n return this.fixedScreenConstraints[widget] && this.fixedScreenConstraints[widget](this.windowWidth);\n });\n if (!widgetsThatRequireFixedWindow) {\n this._removeFixedContainer();\n } else {\n this._addFixedContainer();\n }\n }\n\n /**\n * @private\n */\n _addFixedContainer() {\n if (this.isFixedWindowActive) {\n return;\n }\n Event.dispatchAndFire(global.document, EVENT_BEFORE_FIXED_ADD, {\n detail: this.getCurrentWidget()\n });\n // this causes layout and should be optimized\n // At lest we write in a batch later\n Settings.get().scrollbarUpdateNodes.map((n) => {\n let foundProperty = 'paddingRight';\n let direction = 1;\n let node = n;\n if (n instanceof Array) {\n const [whatNode, property, d] = n;\n foundProperty = property;\n node = whatNode;\n direction = d || 1;\n }\n return {\n node,\n property: foundProperty,\n value: `${parseInt(global.getComputedStyle(node)[foundProperty], 10) +\n (!node.__fixedWindowMod__ ? (Settings.getScrollbarWidth() * direction) : 0)}px`\n };\n }).forEach((d) => {\n d.node.__fixedWindowMod__ = true;\n d.node.style[d.property] = d.value;\n });\n\n this.touchListener = (e) => {\n e.preventDefault();\n };\n\n let shouldNotMove = false;\n this.touchStartListener = (e) => {\n const { element } = this.getCurrentWidget();\n if (Util.isPartOfNode(e.target, element)) {\n if (element.scrollTop === 0) {\n element.scrollTop = 1;\n shouldNotMove = true;\n } else if (element.scrollHeight === element.scrollTop + element.offsetHeight) {\n shouldNotMove = true;\n element.scrollTop -= 1;\n }\n }\n };\n\n global.addEventListener('touchmove', this.touchListener);\n global.document.body.addEventListener('touchstart', this.touchStartListener);\n\n this.touchMoveListener = (e) => {\n const { element } = this.getCurrentWidget();\n if (Util.isPartOfNode(e.target, element)) {\n if (!shouldNotMove) {\n e.stopImmediatePropagation();\n }\n shouldNotMove = false;\n }\n };\n global.document.body.addEventListener('touchmove', this.touchMoveListener);\n\n global.document.documentElement.classList.add(CLS_FIXED_WINDOW);\n this.isFixedWindowActive = true;\n }\n\n /**\n * @private\n */\n _removeFixedContainer() {\n if (this.isFixedWindowActive) {\n // cleanup event listeners\n global.removeEventListener('touchmove', this.touchListener);\n global.document.body.removeEventListener('touchstart', this.touchStartListener);\n global.document.body.removeEventListener('touchmove', this.touchMoveListener);\n\n // reset scrollbar nodes\n Settings.get().scrollbarUpdateNodes.forEach((node) => {\n if (node instanceof Array) {\n const [whatNode, property] = node;\n delete whatNode.__fixedWindowMod__;\n whatNode.style[property] = '';\n } else {\n delete node.__fixedWindowMod__;\n node.style.paddingRight = '';\n }\n });\n global.document.documentElement.classList.remove(CLS_FIXED_WINDOW);\n Event.dispatchAndFire(global.document, EVENT_AFTER_FIXED_REMOVE);\n this.isFixedWindowActive = false;\n }\n }\n\n /**\n * Will close a window when no widgets are opened that need one\n */\n resizeListener() {\n this.windowWidth = global.innerWidth;\n this._checkFixedNeeded();\n }\n\n /**\n * @returns {FixedWindow}\n */\n static getInstance() {\n if (!fixedWindowInstance) {\n fixedWindowInstance = new FixedWindow();\n fixedWindowInstance.windowWidth = global.innerWidth;\n const eventHandler = fixedWindowInstance.resizeListener.bind(fixedWindowInstance);\n global.addEventListener(\n 'resize',\n debounce(eventHandler, 500)\n );\n global.addEventListener('orientationchange', eventHandler);\n }\n return fixedWindowInstance;\n }\n\n /**\n * Request a close of the fixed window\n */\n close() {\n this.widgets.pop();\n if (this.widgets.length === 0) {\n this._removeFixedContainer();\n }\n }\n\n /**\n * Request to open a fixed windows\n * @param {Object|DestroyableWidget} instance\n * @param {HTMLElement} element\n */\n open(instance, element) {\n let fixed = false;\n if (typeof instance === 'object') {\n const widget = instance.constructor;\n const fixedWidget = this.fixedScreenConstraints[instance.constructor];\n if (widget && fixedWidget) {\n fixed = fixedWidget(this.windowWidth);\n }\n const length = this.widgets.length;\n this.widgets.push(\n {\n widget,\n element\n }\n );\n // open a new window if there is no window active\n if (length === 0) {\n if (fixed) {\n this._addFixedContainer();\n }\n }\n }\n }\n}\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/main/lib/FixedWindow.js\n **/","export default (fn, ms) => () => {\n clearTimeout(fn.timeout);\n fn.timeout = setTimeout(fn, ms);\n};\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/main/lib/debounce.js\n **/","/*\n * The MIT License (MIT)\n *\n * Copyright (c) 2015 David Heidrich, BowlingX \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n/*!\n * FlexCss.Toggleable\n * Licensed under the MIT License (MIT)\n * Copyright (c) 2015 David Heidrich, BowlingX \n */\n\nimport Settings from './util/Settings';\nimport Widget from './Widget';\nimport Util from './util/Util';\nimport Event from './util/Event';\n\n/**\n * Event that is fired when a tab is closed\n * @type {string}\n */\n\nexport const EVENT_TAB_CLOSED = 'flexcss.tab.closed';\n\n/**\n * Event that is fired when a tab has been opened\n * @type {string}\n */\nexport const EVENT_TAB_OPENED = 'flexcss.tab.opened';\n/**\n * @type {string}\n */\nconst ATTR_NAME = 'data-toggle';\n/**\n * @type {string}\n */\nconst ACTIVE_CLASS = 'active';\n/**\n * @type {string}\n */\nconst LOADING_CLASS = 'loading';\n\n/**\n * @type {string}\n */\nconst ATTR_TOGGLE_LIST = 'data-toggle-list';\n\n/**\n * Creates a toggleable element, either for tabs or a single toggle\n */\nclass Toggleable {\n constructor(ContainerId) {\n const doc = global.document;\n\n this.container = ContainerId instanceof HTMLElement ? ContainerId :\n doc.getElementById(ContainerId);\n\n this.loading = false;\n\n if (!this.container) {\n throw new Error(`Toggleable container with id ${ContainerId} not found`);\n }\n }\n\n /**\n * Listener\n * @param {Event} e\n * @private\n */\n _listener(e) {\n let target = e.target;\n const parent = target.parentNode;\n const doc = global.document;\n\n // support target child element to clicked\n if (!target.hasAttribute(ATTR_NAME)) {\n if (parent && parent.hasAttribute(ATTR_NAME)) {\n target = parent;\n } else {\n return;\n }\n }\n\n if (!target.hasAttribute(ATTR_NAME)) {\n return;\n }\n\n const refId = target.getAttribute(ATTR_NAME);\n const ref = doc.getElementById(refId);\n\n e.preventDefault();\n\n if (this.loading) {\n return;\n }\n\n this.toggleTarget(ref, target);\n }\n\n /**\n * Registers Events for this instance\n * @returns {Toggleable}\n */\n registerEvents() {\n this.container.addEventListener(Settings.getTabEvent(), this._listener.bind(this));\n return this;\n }\n\n /**\n * Toggles given `ref`\n * @param {HTMLElement|Node} ref\n * @param {HTMLElement|Node} [selfTarget] optional target node\n */\n toggleTarget(ref, selfTarget) {\n let target = selfTarget;\n if (!target && !ref) {\n return;\n }\n if (!target) {\n target = document.querySelector(`[${ATTR_NAME}=\"${ref.id}\"]`);\n }\n\n let future;\n const elClassList = target.classList;\n const parent = target.parentNode;\n const doc = global.document;\n\n future = new Promise((resolve, failure) => {\n if (ref) {\n resolve(ref);\n } else {\n const widget = Widget.findWidget(target);\n const async = widget ? widget.getAsync() : null;\n if (Widget.isWidget(widget) && async) {\n future = async.then((r) => {\n if (r instanceof HTMLElement) {\n const id = Util.guid();\n r.id = id;\n target.setAttribute(ATTR_NAME, id);\n resolve(r);\n } else {\n throw new Error(`Dynamically creating toggle-content is not supported right now.\n Return an HTMLElement instance`);\n }\n });\n } else {\n failure('Target not given');\n }\n }\n });\n\n if (parent) {\n const maybeToggleNode = Util.parentsUntil(target, (node) => {\n return node && node.hasAttribute && node.hasAttribute(ATTR_TOGGLE_LIST);\n });\n\n const parentClassList = parent.classList;\n // Abort if element is already active and if is part of a toggle list\n if (maybeToggleNode) {\n if (!parentClassList.contains(ACTIVE_CLASS)) {\n parentClassList.toggle(ACTIVE_CLASS);\n parentClassList.add(LOADING_CLASS);\n } else {\n return;\n }\n }\n\n if (maybeToggleNode) {\n for (let i = 0; i < maybeToggleNode.children.length; i++) {\n const n = maybeToggleNode.children[i];\n const targetRef = n.children[0];\n if (n !== parent) {\n n.classList.remove(ACTIVE_CLASS);\n if (targetRef) {\n const attr = targetRef.getAttribute(ATTR_NAME);\n const el = attr ? doc.getElementById(attr) : null;\n if (el) {\n Event.dispatchAndFire(el, EVENT_TAB_CLOSED);\n el.classList.remove(ACTIVE_CLASS);\n targetRef.classList.remove(ACTIVE_CLASS);\n }\n }\n }\n }\n }\n }\n if (elClassList) {\n elClassList.toggle(ACTIVE_CLASS);\n elClassList.add(LOADING_CLASS);\n }\n this.loading = true;\n future.then((r) => {\n Event.dispatchAndFire(r, EVENT_TAB_OPENED);\n Toggleable._handleLoaded(target);\n r.classList.toggle(ACTIVE_CLASS);\n this.loading = false;\n }).catch(() => {\n this.loading = false;\n Toggleable._handleLoaded(target);\n });\n }\n\n /**\n * @param el\n * @private\n */\n static _handleLoaded(el) {\n const parentClassList = el.parentNode.classList;\n el.classList.remove(LOADING_CLASS);\n if (parentClassList) {\n parentClassList.remove(LOADING_CLASS);\n }\n }\n}\n\nexport default Toggleable;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/main/Toggleable.js\n **/","/*\n * The MIT License (MIT)\n *\n * Copyright (c) 2015 David Heidrich, BowlingX \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n/*!\n * FlexCss.OffCanvas\n * Licensed under the MIT License (MIT)\n * Copyright (c) 2015 David Heidrich, BowlingX \n */\n\nimport Settings from './util/Settings';\nimport Util from './util/Util';\nimport Event from './util/Event';\nimport FixedWindow from './lib/FixedWindow';\n\n/**\n * @type {string}\n */\nconst ATTR_CLOSE_SIDEBAR = 'data-close-offcanvas';\n\n/**\n * @type {string}\n */\nconst ATTR_TARGET = 'data-offcanvas';\n/**\n * @type {string}\n */\nconst INIT_CLASS = 'init';\n/**\n * @type {string}\n */\nconst OPEN_CLASS = 'open';\n/**\n * @type {number}\n */\nconst HIDE_FACTOR = 3;\n\n/**\n * @type {string}\n */\nexport const EVENT_TOGGLE = 'flexcss.offcanvas.toggle';\n\n/**\n * A OffCanvas Implementation\n */\nclass OffCanvas {\n\n /**\n * Creates an off-canvas navigation\n * @param {HTMLElement|String} NavigationId\n * @param {HTMLElement|String} Darkener\n * @param {int} factor positive will expect right sidebar, positive left\n * @param {bool} [disableTouch] if true all touch events are disabled\n * @constructor\n */\n constructor(NavigationId, Darkener, factor, disableTouch) {\n const doc = global.document;\n let touchedX = 0;\n const navigationContainer = NavigationId instanceof HTMLElement ?\n NavigationId : doc.getElementById(NavigationId);\n const darkener = Darkener instanceof HTMLElement ? Darkener : doc.getElementById(Darkener);\n const DARKENER_CLASS_TOGGLE = `toggle-${darkener.id}` || 'darkener';\n const DARKENER_CLASS_INSTANT_TOGGLE = `${DARKENER_CLASS_TOGGLE}-open`;\n\n const shouldNotTouch = () => {\n return window.innerWidth >= Settings.get().smallBreakpoint;\n };\n\n if (!darkener || !navigationContainer) {\n throw new Error('Could not find needed elements (Darkener and/or NavigationId)');\n }\n\n this.darkener = darkener;\n this.darkenerClassToggle = DARKENER_CLASS_TOGGLE;\n this.darkenerClassToggleInstant = DARKENER_CLASS_INSTANT_TOGGLE;\n this.globalToggleClass = Settings.get().canvasToggledClass;\n\n this.navigationContainer = navigationContainer;\n this.navigationContainerId = navigationContainer.id;\n\n // create id if id does not exist\n if (!this.navigationContainerId) {\n this.navigationContainerId = Util.guid();\n navigationContainer.id = this.navigationContainerId;\n }\n\n if (!disableTouch) {\n navigationContainer.addEventListener('touchstart', (e) => {\n if (shouldNotTouch()) {\n return;\n }\n touchedX = e.touches[0].clientX;\n navigationContainer.mustHide = false;\n });\n navigationContainer.addEventListener('touchmove', (e) => {\n if (shouldNotTouch()) {\n return;\n }\n const { clientX } = e.touches[0];\n const target = navigationContainer;\n const style = target.style;\n const calcX = touchedX - clientX;\n const bounds = target.getBoundingClientRect();\n const compare = factor > 0 ? calcX <= 0 : calcX >= 0;\n if (compare) {\n style.transition = 'transform 0s ease';\n style.webkitTransition = '-webkit-transform 0s ease';\n target.mustHide = factor > 0 ? calcX * -1 >\n bounds.width / HIDE_FACTOR : calcX > bounds.width / HIDE_FACTOR;\n const transform = `translate3d(${calcX * -1}px,0,0)`;\n style.transform = transform;\n style.webkitTransform = transform;\n }\n });\n navigationContainer.addEventListener('touchend', () => {\n if (shouldNotTouch()) {\n return;\n }\n const target = navigationContainer;\n const style = target.style;\n if (target.mustHide) {\n const width = target.getBoundingClientRect().width * factor;\n style.transition = 'transform .2s ease';\n style.webkitTransition = '-webkit-transform .2s ease';\n const transform = `translate3d(${width}px,0,0)`;\n style.transform = transform;\n style.webkitTransform = transform;\n this._remove().then(() => {\n this.resetTransform(style);\n });\n this._removeInstant();\n } else {\n this.resetTransform(style);\n }\n });\n }\n }\n\n /**\n * @param {Object} s\n */\n resetTransform(s) {\n s.transform = '';\n s.transition = '';\n s.webkitTransform = '';\n s.webkitTransition = '';\n }\n\n /**\n * @param {Object} [event]\n * @private\n */\n _remove(event) {\n return new Promise((resolve) => {\n Util.addEventOnce(Settings.getTransitionEvent(), this.navigationContainer, function scheduler(e) {\n if (e.target !== this.navigationContainer) {\n return Util.addEventOnce(Settings.getTransitionEvent(),\n this.navigationContainer, scheduler.bind(this));\n }\n requestAnimationFrame(() => {\n OffCanvas.currentOpen = null;\n const docCls = global.document.documentElement.classList;\n docCls.remove(this.darkenerClassToggle);\n docCls.remove(this.globalToggleClass);\n if (!!event) {\n Event.dispatchAndFire(this.navigationContainer, EVENT_TOGGLE);\n }\n resolve();\n });\n }.bind(this));\n });\n }\n\n /**\n * @private\n */\n _removeInstant() {\n this.navigationContainer.classList.remove(OPEN_CLASS);\n global.document.documentElement.classList.remove(this.darkenerClassToggleInstant);\n this.darkener.classList.remove(INIT_CLASS);\n FixedWindow.getInstance().close();\n }\n\n /**\n * Toggles a an off-canvas element\n * @param [e]\n * @private\n */\n toggle(e) {\n if (e) {\n e.preventDefault();\n }\n this.resetTransform(this.navigationContainer.style);\n const darkenerClass = this.darkener.classList;\n const DARKENER_CLASS_TOGGLE = this.darkenerClassToggle;\n const DARKENER_CLASS_INSTANT_TOGGLE = this.darkenerClassToggleInstant;\n const navigationControllerClassList = this.navigationContainer.classList;\n if (!OffCanvas.currentOpen) {\n Util.addEventOnce(Settings.getTransitionEvent(), this.navigationContainer, () => {\n if (!!e) {\n Event.dispatchAndFire(this.navigationContainer, EVENT_TOGGLE);\n }\n });\n OffCanvas.currentOpen = this;\n FixedWindow.getInstance().open(this, this.navigationContainer);\n const docElementCls = global.document.documentElement.classList;\n docElementCls.add(this.globalToggleClass);\n docElementCls.add(DARKENER_CLASS_INSTANT_TOGGLE);\n docElementCls.add(DARKENER_CLASS_TOGGLE);\n darkenerClass.add(INIT_CLASS);\n navigationControllerClassList.add(OPEN_CLASS);\n } else {\n return this.close(e);\n }\n }\n\n close(event) {\n if (this.navigationContainer.classList.contains(OPEN_CLASS)) {\n const promise = this._remove(event);\n this._removeInstant();\n return promise;\n }\n return new Promise(r => r());\n }\n\n /**\n * Register events\n * @param [delegate]\n */\n registerEvents(delegate) {\n const thisDelegate = delegate || global.document;\n FixedWindow.getInstance().addScreenConstraint(OffCanvas, (width) => width < Settings.get().smallBreakpoint);\n thisDelegate.addEventListener(Settings.getTabEvent(), (e) => {\n if (OffCanvas.currentOpen && OffCanvas.currentOpen !== this) {\n return;\n }\n const id = this.navigationContainerId;\n const validTarget = e.target.getAttribute(ATTR_TARGET) === id;\n if (!Util.isPartOfNode(e.target, this.navigationContainer)) {\n if (validTarget || (OffCanvas.currentOpen === this && e.target === this.darkener)) {\n this.toggle(e);\n }\n } else {\n if (e.target.hasAttribute(ATTR_CLOSE_SIDEBAR)) {\n this.toggle(e);\n }\n }\n });\n }\n}\n\nOffCanvas.currentOpen = null;\n\nexport default OffCanvas;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/main/OffCanvas.js\n **/","/*\n * The MIT License (MIT)\n *\n * Copyright (c) 2015 David Heidrich, BowlingX \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n/*!\n * FlexCss.Dropdown\n * Licensed under the MIT License (MIT)\n * Copyright (c) 2015 David Heidrich, BowlingX \n */\n\nimport Util from './util/Util';\nimport Settings from './util/Settings';\nimport Event from './util/Event';\nimport Widget from './Widget';\nimport FixedWindow from './lib/FixedWindow';\n\n/**\n * @type {string}\n */\nconst ATTR_CC = 'data-collision-container';\n/**\n * @type {string}\n */\nconst ATTR_DARKENER = 'data-darkener-container';\n/**\n * @type {string}\n */\nconst DARKENER_INIT = 'init';\n/**\n * @type {string}\n */\nconst ATTR_DATA_TARGET = 'data-target';\n/**\n * @type {string}\n */\nconst ATTR_CLOSE_DROPDOWN = 'data-close-dropdown';\n/**\n * @type {string}\n */\nconst ATTR_NAME = 'data-dropdown';\n/**\n * @type {string}\n */\nconst STATE_LOADING = 'loading';\n\nconst CLS_DARKENER_DROPDOWN = 'darkener-dropdown';\n/**\n * @type {string}\n */\nconst CLS_OPEN = 'open';\n\n/**\n * @type {string}\n */\nconst CLS_DROPDOWN = 'dropdown';\n\n/**\n * @type {string}\n */\nexport const EVENT_DROPDOWN_CLOSED = 'flexcss.dropdown.closed';\n\n/**\n * A Dropdown\n */\nclass Dropdown {\n constructor(DelegateContainer, Darkener) {\n const doc = global.document;\n\n /**\n * Container Element\n * @type {HTMLElement}\n */\n this.container = DelegateContainer instanceof HTMLElement ?\n DelegateContainer : doc.getElementById(DelegateContainer);\n\n this.currentOpen = null;\n this.currentTarget = null;\n /**\n * @type {HTMLElement}\n */\n this.darkener = Darkener instanceof HTMLElement ? Darkener : document.getElementById(Darkener);\n\n this.destroyOnClose = false;\n\n if (!this.darkener || !this.container) {\n throw new Error('required elements not found (darkener and container element)');\n }\n }\n\n /**\n * Method that handles delegation events for dropdowns\n * @param e\n * @returns {boolean}\n * @private\n */\n _delegateFunction(e) {\n const currentOpen = this.currentOpen;\n const target = Util.closestCallback(e.target, n => n instanceof HTMLElement && n.hasAttribute(ATTR_NAME));\n const targetIsCurrent = target === this.currentTarget;\n\n if (currentOpen && !Util.isPartOfNode(e.target, currentOpen) || targetIsCurrent) {\n this.close();\n if (targetIsCurrent) {\n e.preventDefault();\n }\n return targetIsCurrent ? false : this._delegateFunction(e);\n }\n\n if (target && !currentOpen) {\n e.preventDefault();\n e.stopImmediatePropagation();\n\n if (target.isLoading) {\n return false;\n }\n this.createDropdown(target);\n } else {\n if (currentOpen) {\n if (e.target.hasAttribute(ATTR_CLOSE_DROPDOWN)) {\n e.preventDefault();\n this.close();\n }\n if (!Util.isPartOfNode(e.target, currentOpen)) {\n this.close();\n }\n }\n }\n }\n\n /**\n * Register Events for this dropdown container\n * @returns {Dropdown}\n */\n registerEvents() {\n FixedWindow.getInstance().addScreenConstraint(Dropdown, (width) => width < Settings.get().smallBreakpoint);\n this.container.addEventListener(Settings.getTabEvent(), this._delegateFunction.bind(this), true);\n return this;\n }\n\n /**\n * Destroys this instance, unbinds events\n * @returns {Dropdown}\n */\n destroy() {\n this.container.removeEventListener(Settings.getTabEvent(), this._delegateFunction.bind(this), true);\n return this;\n }\n\n\n /**\n * Destroys instance on close of dropdown\n * @param v\n * @returns {Dropdown}\n */\n setDestroyOnClose(v) {\n this.destroyOnClose = v;\n return this;\n }\n\n\n /**\n * Will add the right class to container for specific darkener id\n * @param instance\n * @param show\n */\n toggleDarkenerToggler(instance, show) {\n const cls = `toggle-${(instance.id || CLS_DARKENER_DROPDOWN)}`;\n const classList = this.container.classList;\n if (show) {\n classList.add(cls);\n } else {\n classList.remove(cls);\n }\n }\n\n /**\n * Closes Dropdown on current instance\n * @return {Boolean|Promise}\n */\n close() {\n const currentOpen = this.currentOpen;\n if (!currentOpen) {\n return false;\n }\n const darkenerInstance = currentOpen.flexDarkenerInstance || this.darkener;\n const thisCurrentOpen = currentOpen;\n\n const future = new Promise((resolve) => {\n if (window.getComputedStyle(currentOpen).position === 'fixed') {\n Util.addEventOnce(Settings.getTransitionEvent(), currentOpen, function scheduler(e) {\n if (e.srcElement !== currentOpen) {\n return Util.addEventOnce(Settings.getTransitionEvent(), currentOpen, scheduler.bind(this));\n }\n requestAnimationFrame(() => {\n Event.dispatchAndFire(thisCurrentOpen, EVENT_DROPDOWN_CLOSED);\n // if a new dropdown has been opened in the meantime, do not remove darkener\n if (this.currentOpen !== null) {\n return false;\n }\n this.toggleDarkenerToggler(darkenerInstance, false);\n resolve(true);\n });\n }.bind(this));\n } else {\n resolve(true);\n Event.dispatchAndFire(thisCurrentOpen, EVENT_DROPDOWN_CLOSED);\n }\n });\n\n FixedWindow.getInstance().close();\n currentOpen.classList.remove(CLS_OPEN);\n\n if (currentOpen.flexDarkenerInstance) {\n currentOpen.flexDarkenerInstance.classList.remove(DARKENER_INIT);\n } else {\n this.darkener.classList.remove(DARKENER_INIT);\n }\n\n this.currentOpen = null;\n this.currentTarget = null;\n\n if (this.destroyOnClose) {\n this.destroy();\n }\n\n return future;\n }\n\n /**\n * Creates a dropdown on given target and opens it\n * @param {HTMLElement} target target where this dropdown is placed\n * @param {FlexCss.Widget} [thisWidget] if given will use widget instead of widget instance\n * @return {FlexCss.Dropdown}\n */\n createDropdown(target, thisWidget) {\n const doc = global.document;\n\n if (!target) {\n throw new Error('Dropdown target not found');\n }\n\n const widget = thisWidget || Widget.findWidget(target);\n let future;\n const data = target.getAttribute(ATTR_NAME);\n const dropdownContainerElement = doc.getElementById(data);\n const async = !dropdownContainerElement && Widget.isWidget(widget) ? widget.getAsync() : false;\n\n if (async) {\n target.classList.add(STATE_LOADING);\n target.isLoading = true;\n future = async.then((r) => {\n if (r instanceof HTMLElement) {\n if (r.id) {\n target.setAttribute(ATTR_NAME, r.id);\n }\n return r;\n }\n // Create container Element:\n const element = doc.createElement('div');\n element.className = CLS_DROPDOWN;\n element.innerHTML = r;\n element.id = Util.guid();\n // Cache target for later use:\n target.setAttribute(ATTR_NAME, element.id);\n this.container.appendChild(element);\n return element;\n }).then((r) => {\n target.isLoading = false;\n target.classList.remove(STATE_LOADING);\n return r;\n });\n } else {\n if (!dropdownContainerElement) {\n throw new Error(`Could not found Dropdown container with ID \"${data}\"`);\n }\n future = new Promise((r) => {\n r(dropdownContainerElement);\n });\n }\n\n future.then((dropdownContent) => {\n if (this.currentOpen) {\n this.close();\n }\n // Skip one frame to show animation\n target.dropdownContent = dropdownContent;\n const isAbsolute = global.getComputedStyle(dropdownContent).position === 'absolute';\n dropdownContent.hfWidgetInstance = this;\n\n if (!target.flexCollisionContainer) {\n const collisionC = target.getAttribute(ATTR_CC);\n target.flexCollisionContainer = collisionC ?\n doc.getElementById(collisionC) || document.documentElement : document.documentElement;\n }\n\n dropdownContent.classList.toggle(CLS_OPEN);\n if (dropdownContent.classList.contains(CLS_OPEN)) {\n this.currentOpen = dropdownContent;\n this.currentTarget = target;\n }\n FixedWindow.getInstance().open(this, dropdownContent);\n if (isAbsolute) {\n // Check collision:\n let selfTarget = target.getAttribute(ATTR_DATA_TARGET);\n selfTarget = selfTarget ? doc.getElementById(selfTarget) : target;\n Util.setupPositionNearby(selfTarget, dropdownContent, target.flexCollisionContainer);\n } else {\n // optionally get custom darkener container for target\n const d = target.getAttribute(ATTR_DARKENER);\n if (d) {\n dropdownContent.flexDarkenerInstance = doc.getElementById(d);\n (dropdownContent.flexDarkenerInstance || this.darkener).classList.toggle(DARKENER_INIT);\n } else {\n this.darkener.classList.toggle(DARKENER_INIT);\n }\n this.toggleDarkenerToggler(dropdownContent.flexDarkenerInstance || this.darkener, true);\n\n dropdownContent.style.left = '0';\n dropdownContent.style.top = 'auto';\n }\n });\n }\n\n}\n\nexport default Dropdown;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/main/Dropdown.js\n **/","/*\n * The MIT License (MIT)\n *\n * Copyright (c) 2015 David Heidrich, BowlingX \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n/*!\n * FlexCss.LightBox\n * Licensed under the MIT License (MIT)\n * Copyright (c) 2015 David Heidrich, BowlingX \n */\n\n/* global Image, TouchEvent*/\n\nimport Modal, { EVENT_MODAL_CLOSED } from './Modal';\nimport Settings from './util/Settings';\nimport Widget from './Widget';\n\nconst ATTR_MAX_WIDTH = 'data-original-width';\nconst ATTR_MAX_HEIGHT = 'data-original-height';\nconst ATTR_SRC = 'data-src';\n\nconst CLS_HAS_PREV = 'has-prev';\nconst CLS_HAS_NEXT = 'has-next';\nconst CLS_LOADING = 'loading';\n\nconst ATTR_NO_THUMBNAIL = 'data-no-thumbnail';\nconst ATTR_DATA_HREF = 'data-href';\nconst ATTR_HREF = 'href';\n\nconst KEY_NEXT = 39;\nconst KEY_PREV = 37;\nconst ATTR_CLOSE = 'data-close-modal';\n/**\n * A Simple LightBox\n */\nclass LightBox {\n\n /**\n * Creates a new Lightbox\n * @param DelegateContainer\n * @param AttributeSelector\n * @param ModalAppend\n * @param [options]\n */\n constructor(DelegateContainer, AttributeSelector, ModalAppend, options) {\n const thisDelegateContainer = DelegateContainer instanceof HTMLElement ? DelegateContainer :\n document.getElementById(DelegateContainer);\n\n this._modalAppend = ModalAppend || DelegateContainer;\n /**\n * @type {Function}\n */\n this._resizeEvent = null;\n /**\n * @type {Function}\n */\n this._keyboardNextEvent = null;\n /**\n * @type {Promise}\n */\n this._future = null;\n /**\n * @type {Promise}\n */\n this._nextFuture = this._future;\n /**\n * @type {HTMLElement}\n */\n this._imageContainer = null;\n /**\n * @type {HTMLElement}\n */\n this._modalContainerDiv = null;\n /**\n * @type {HTMLElement}\n */\n this._contentContainer = null;\n /**\n * @type {HTMLElement}\n */\n this._closerContainerDiv = null;\n /**\n * @type {HTMLElement}\n */\n this._delegateContainer = thisDelegateContainer;\n /**\n * @type {HTMLElement}\n */\n this._attributeSelector = AttributeSelector;\n /**\n * @type {Widget}\n */\n this._widget = null;\n /**\n * @type {boolean}\n */\n this._isOpen = false;\n /**\n * @type {HTMLElement}\n */\n this.target = null;\n /**\n * @type {HTMLElement}\n */\n this.img = null;\n /**\n * @type {boolean}\n */\n this._isLoading = false;\n\n /**\n * Default options\n */\n this.options = {\n // set if prev and next should be available\n registerPrevNextEvents: true,\n // set if modal should be closed after last image\n closeOnLast: true,\n // called when next image is requested (either by keyboard or click), return false to abort\n onNext: () => {\n return true;\n },\n onClose: () => {\n },\n getNext: null,\n getPrev: null,\n // called when underlying target changed\n onSwitchImage: () => {\n }\n };\n\n Object.assign(this.options, options);\n }\n\n /**\n * @param {HTMLElement} node\n * @returns {HTMLElement|null}\n */\n findImmediateNextTarget(node) {\n if (node && node.children[0].hasAttribute(this._attributeSelector)) {\n return node.children[0];\n }\n return null;\n }\n\n /**\n * Will fetch the next element of a lightBox\n * @param {HTMLElement} target\n * @returns {null|HTMLElement}\n */\n getNext(target) {\n if (this.options.getNext) {\n return this.options.getNext.apply(this, [target]);\n }\n return this.findImmediateNextTarget(target.parentNode.nextElementSibling);\n }\n\n /**\n * Will fetch the previous element of a lightBox\n * @param {HTMLElement} target\n * @returns {null|HTMLElement}\n */\n getPrev(target) {\n if (this.options.getPrev) {\n return this.options.getPrev.apply(this, [target]);\n }\n return this.findImmediateNextTarget(target.parentNode.previousElementSibling);\n }\n\n /**\n * Registers events for delegate container\n */\n registerEvents(onOpen) {\n this._delegateContainer.addEventListener(Settings.getTabEvent(), (e) => {\n let target = e.target;\n const parent = target.parentNode;\n let validTarget = target.hasAttribute(this._attributeSelector);\n const parentIsValid = parent && parent.hasAttribute(this._attributeSelector);\n\n if (!validTarget && parentIsValid) {\n validTarget = true;\n target = parent;\n }\n if (validTarget) {\n e.preventDefault();\n this.open(target).then((r) => {\n if (onOpen) {\n onOpen.apply(this, [r, target]);\n }\n });\n }\n });\n }\n\n /**\n * @returns {HTMLElement}\n */\n getContentContainer() {\n return this._contentContainer;\n }\n\n /**\n * Setup max-width and max-height\n * @param {HTMLElement} target\n * @param {HTMLElement} img\n * @param {HTMLElement} loadedImage\n * @private\n */\n static _setupMaxWidthHeight(target, img, loadedImage) {\n const nextMaxWidth = target.getAttribute(ATTR_MAX_WIDTH);\n const nextMaxHeight = target.getAttribute(ATTR_MAX_HEIGHT);\n if (nextMaxWidth && nextMaxHeight) {\n img.style.maxWidth = nextMaxWidth + \"px\";\n img.style.maxHeight = nextMaxHeight + \"px\";\n } else {\n img.style.maxWidth = loadedImage.width + \"px\";\n img.style.maxHeight = loadedImage.height + \"px\";\n }\n }\n\n /**\n * Switches to the next image\n * @param {boolean} direction\n */\n switchImageByDirection(direction) {\n const next = direction ? this.getPrev(this.target) : this.getNext(this.target);\n if (this.options.onNext.apply(this, [next])) {\n return this.switchImage(next);\n }\n return new Promise((_, reject) => reject(next));\n }\n\n /**\n * Checks if lightbox is currently loading\n * @returns {boolean}\n */\n isLoading() {\n return this._isLoading;\n }\n\n /**\n * Checks if modal should be closed\n * @private\n */\n _runOptionalClose() {\n if (this.options.closeOnLast) {\n this.modal.close();\n }\n }\n\n _setupPrevNextStates() {\n const target = this.target;\n const hasPrev = this.getPrev(target);\n const hasNext = this.getNext(target);\n const hasPrevClass = CLS_HAS_PREV;\n const hasNextClass = CLS_HAS_NEXT;\n // because IE does not support the second toggle parameter, we need to do this manually\n if (hasPrev) {\n this._imageContainer.classList.add(hasPrevClass);\n } else {\n this._imageContainer.classList.remove(hasPrevClass);\n }\n if (hasNext) {\n this._imageContainer.classList.add(hasNextClass);\n } else {\n this._imageContainer.classList.remove(hasNextClass);\n }\n }\n\n /**\n * @param img\n * @private\n */\n _calculateContainer(img) {\n if (Settings.isIE()) {\n setTimeout(() => {\n this._imageContainer.style.height = img.offsetHeight + 'px';\n }, 0);\n }\n }\n\n /**\n * Switch to a specific image\n * @param next\n * @returns {*}\n */\n switchImage(next) {\n const self = this;\n const img = this.img;\n this._isLoading = true;\n self._nextFuture = new Promise((resolve, reject) => {\n // notify observers about image switching\n self.options.onSwitchImage.apply(self, [self._nextFuture]);\n if (next) {\n const nextThumb = next.hasAttribute(ATTR_NO_THUMBNAIL) ? next : (next.children[0] || next);\n const nextHighRes = next.getAttribute(ATTR_DATA_HREF) ||\n next.getAttribute(ATTR_HREF);\n const nextSource = nextThumb.getAttribute(ATTR_SRC) || nextThumb.src || nextHighRes;\n const nextImgObject = new Image();\n\n if (!nextSource) {\n reject(next);\n return;\n }\n // set new target to next element\n this.target = next;\n nextImgObject.src = nextSource;\n self._imageContainer.classList.add(CLS_LOADING);\n nextImgObject.addEventListener('load', () => {\n img.src = nextSource;\n self._imageContainer.style.backgroundImage = 'url(' + nextSource + ')';\n LightBox._setupMaxWidthHeight(next, img, nextImgObject);\n self._calculateContainer(img);\n self.highRes(nextThumb, nextHighRes);\n self._setupPrevNextStates();\n self._imageContainer.classList.remove(CLS_LOADING);\n this._isLoading = false;\n resolve(nextSource, this.target);\n });\n } else {\n reject(this);\n }\n });\n return self._nextFuture;\n }\n\n\n /**\n * Setup High-Resolution picture\n * @param {HTMLElement} thisThumbnail\n * @param {String} thisImgHighResolution\n */\n highRes(thisThumbnail, thisImgHighResolution) {\n if (thisImgHighResolution && thisThumbnail.src !== thisImgHighResolution) {\n const highImageObj = new Image();\n highImageObj.src = thisImgHighResolution;\n highImageObj.addEventListener('load', () => {\n // if current image is still available\n if (this._getSrc(thisThumbnail) === this.img.src) {\n this.img.src = thisImgHighResolution;\n this._imageContainer.style.backgroundImage = 'url(' + thisImgHighResolution + ')';\n }\n });\n }\n }\n\n /**\n * Extracts the source of an image\n * @param target\n * @returns {String|null}\n * @private\n */\n _getSrc(target) {\n return target.getAttribute(ATTR_SRC) || target.src;\n }\n\n /**\n * Will show a lightBox on given target\n * @param {HTMLElement} target\n * @returns {$.Deferred|*}\n */\n open(target) {\n const self = this;\n\n if (!target) {\n return false;\n }\n\n this.target = target;\n\n // if lightBox is open, we just switch to the new target image\n if (this._isOpen && target) {\n return this.switchImage(target).then(() => {\n return this;\n });\n }\n\n this._isOpen = true;\n\n /**\n * Setup Widget for modal\n * @type {Widget}\n */\n this._widget = new Widget().setAsync(() => {\n // thumbnail is either target itself or expected to be first childNode\n const thumbnail = target.hasAttribute(ATTR_NO_THUMBNAIL) ? target : (target.children[0] || target);\n\n const imgHighResolution = target.getAttribute(ATTR_DATA_HREF) || target.getAttribute(ATTR_HREF);\n const imgSrc = this._getSrc(thumbnail) || imgHighResolution;\n\n const imageObj = new Image();\n imageObj.src = imgSrc;\n this._imageContainer = document.createElement('div');\n this._modalContainerDiv = document.createElement('div');\n this._closerContainerDiv = document.createElement('i');\n this._contentContainer = document.createElement('div');\n\n this._closerContainerDiv.className = 'modal-close modal-close-lightbox icon-cancel-1';\n this._closerContainerDiv.setAttribute(ATTR_CLOSE, ATTR_CLOSE);\n\n this._modalContainerDiv.className = 'modal image-modal';\n this._modalContainerDiv.appendChild(this._imageContainer);\n this._modalContainerDiv.appendChild(this._contentContainer);\n this._modalContainerDiv.appendChild(this._closerContainerDiv);\n this._contentContainer.className = 'content-container';\n this._isLoading = true;\n this._future = new Promise((resolve) => {\n imageObj.addEventListener('load', () => {\n this._imageContainer.className = 'image-container';\n const img = document.createElement('img');\n // current image\n this.img = img;\n\n img.src = imgSrc;\n LightBox._setupMaxWidthHeight(target, img, imageObj);\n this._imageContainer.appendChild(img);\n this._imageContainer.style.backgroundImage = 'url(' + imgSrc + ')';\n\n resolve(self._modalContainerDiv);\n this._isLoading = false;\n\n if (Settings.isIE()) {\n self._resizeEvent = global.addEventListener('resize', () => {\n setTimeout(() => {\n self._imageContainer.style.height = img.offsetHeight + 'px';\n }, 0);\n });\n }\n\n if (self.options.registerPrevNextEvents) {\n self._setupPrevNextStates();\n // prev or next on touch/click\n self._imageContainer.addEventListener(Settings.getTabEvent(), (e) => {\n if (self.isLoading()) {\n return;\n }\n e.preventDefault();\n\n const ev = e;\n const pageX = global.TouchEvent && ev instanceof TouchEvent ?\n ev.changedTouches[0].pageX : ev.pageX;\n const rect = self._imageContainer.getBoundingClientRect();\n const imgX = rect.left;\n const wrapperWidth = rect.width;\n const posX = pageX - imgX;\n\n self.switchImageByDirection(wrapperWidth / 2 > posX).catch(() => {\n self._runOptionalClose();\n });\n });\n\n // register keyboard events\n self._keyboardNextEvent = (e) => {\n if (e.keyCode === KEY_NEXT || e.keyCode === KEY_PREV) {\n if (self.isLoading()) {\n return;\n }\n self.switchImageByDirection(e.keyCode === KEY_PREV).catch(() => {\n self._runOptionalClose();\n });\n }\n };\n global.addEventListener('keydown', self._keyboardNextEvent);\n } else {\n self._imageContainer.addEventListener(Settings.getTabEvent(), () => {\n self._runOptionalClose();\n });\n }\n\n self.highRes(thumbnail, imgHighResolution);\n });\n });\n\n this._future.then(() => {\n self._calculateContainer(this.img);\n });\n\n self._modalContainerDiv.addEventListener(EVENT_MODAL_CLOSED, () => {\n // cleanup:\n this._modalContainerDiv.parentNode.removeChild(this._modalContainerDiv);\n this.options.onClose.apply(self);\n this._isOpen = false;\n this.modal.destroy();\n // unbind events\n if (this._keyboardNextEvent) {\n global.removeEventListener('keydown', self._keyboardNextEvent);\n }\n if (this._resizeEvent) {\n global.removeEventListener('resize', self._resizeEvent);\n }\n });\n\n return this._future;\n });\n\n this._nextFuture = this._future;\n\n if (self._widget) {\n this.modal = new Modal(this._modalAppend);\n // make sure we close stack before\n return this.modal.close().fromWidget(self._widget).then(() => {\n return self._future.then(() => {\n return self;\n });\n });\n }\n return false;\n }\n\n}\n\nexport default LightBox;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/main/LightBox.js\n **/"],"sourceRoot":""} \ No newline at end of file diff --git a/build/maps/flexcss.min.map b/build/maps/flexcss.min.map index 9c9d56af..1f3bb51b 100644 --- a/build/maps/flexcss.min.map +++ b/build/maps/flexcss.min.map @@ -1 +1 @@ -{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///js/flexcss.min.js","webpack:///webpack/bootstrap 2abcfdab5a59a5cf6b3b","webpack:///./src/main/util/Util.js","webpack:///./src/main/util/Settings.js","webpack:///./src/main/util/Event.js","webpack:///./src/main/Widget.js","webpack:///./src/main/DestroyableWidget.js","webpack:///./src/main/Tooltip.js","webpack:///./src/main/lib/FixedWindow.js","webpack:///./src/main/Modal.js","webpack:///./src/main/Form.js","webpack:///./src/main/lib/debounce.js","webpack:///./~/isomorphic-fetch/fetch-npm-browserify.js","webpack:///./~/whatwg-fetch/fetch.js","webpack:///./src/main/Dropdown.js","webpack:///./src/main/LightBox.js","webpack:///./src/main/OffCanvas.js","webpack:///./src/main/Toggleable.js","webpack:///./src/main/modules/All.js"],"names":["root","factory","exports","module","define","amd","this","modules","__webpack_require__","moduleId","installedModules","id","loaded","call","m","c","p","global","_classCallCheck","instance","Constructor","TypeError","Object","defineProperty","value","_createClass","defineProperties","target","props","i","length","descriptor","enumerable","configurable","writable","key","protoProps","staticProps","prototype","PFX","COL_LEFT_CLASS","COL_RIGHT_CLASS","COL_BOTTOM_CLASS","Util","element","type","callback","thisFunction","e","apply","thisType","toLowerCase","name","addEventListener","t","el","document","createElement","transitions","transition","OTransition","MozTransition","WebkitTransition","undefined","style","parent","now","parentNode","func","s4","Math","floor","random","toString","substring","doc","inner","width","height","outer","position","top","left","visibility","overflow","appendChild","body","w1","offsetWidth","w2","clientWidth","removeChild","ev","capture","event","removeEventListener","offsetHeight","str","replace","g","toUpperCase","input","JSON","parse","stringify","base","attrs","attributes","attr","s","dashToCamelCase","nodeName","val","nodeValue","hasOwnProperty","parseInt","elementToPosition","collisionContainer","centerHorizontal","positionTop","amountTop","amountLeft","parentsUntil","HTMLElement","window","getComputedStyle","isPartOfNode","offsetTop","offsetLeft","targetPosition","getBoundingClientRect","elementRect","colRect","targetTop","targetRight","right","isCollisionTop","isCollisionBottom","innerHeight","isCollisionLeft","targetLeft","isCollisionRight","classList","remove","calcTop","calcLeft","add","rightPosition","leftCentered","collisionCentered","cssText","optionalOffset","scrollIntoView","thisOffset","scrolledY","pageYOffset","scroll","_interopRequireDefault","obj","__esModule","default","_Util","_Util2","FLEXCSS_GLOBAL_SETTINGS","smallBreakpoint","scrollbarUpdateNodes","darkenerFadeDelay","canvasToggledClass","FLEXCSS_CONST_IS_IOS","FLEXCSS_CONST_IS_TOUCH","FLEXCSS_CONST_IS_IE","FLEXCSS_CONST_TAB_EVENT","FLEXCSS_IS_SMALL_SCREEN","init","FLEXCSS_CONST_SCROLLBAR_WIDTH","getScrollBarWidth","FLEXCSS_CONST_TRANSITION_EVENT","whichTransitionEndEvent","readyState","Settings","settings","assign","navigator","userAgent","match","innerWidth","get","msMaxTouchPoints","CustomEvent","_CustomEvent","params","thisParams","bubbles","cancelable","detail","evt","createEvent","initCustomEvent","Event","EventHandler","defaultOptions","options","withDetail","originalEvent","o","dispatchEvent","withOptions","fire","_typeof","Symbol","iterator","constructor","Widget","_this","asyncContent","_isWidget","getElementById","Error","hfWidgetInstance","setAsync","Promise","finalContent","async","self","DestroyableWidget","listeners","forEach","listener","args","push","_possibleConstructorReturn","ReferenceError","_inherits","subClass","superClass","create","setPrototypeOf","__proto__","_get","object","property","receiver","Function","desc","getOwnPropertyDescriptor","getPrototypeOf","getter","_DestroyableWidget2","_DestroyableWidget3","_Settings","_Settings2","CLASS_NAMES_TOOLTIP","CLASS_NAMES_OPEN","ATTR_DATA_CLASSNAME","ATTR_DATA_NO_TOUCH","Tooltip","_DestroyableWidget","DelegateContainer","container","tooltipContainer","containerClass","selectorAttribute","text","removeTitle","positionRelative","trim","isTouchDevice","hasAttribute","_restoreClassNames","innerHTML","flexTooltipCurrentTarget","oldTitle","removeAttribute","setupPositionNearby","classNames","maybeTargetClass","getAttribute","className","join","selfTarget","setAttribute","createTooltip","removeTooltip","EVENT_AFTER_FIXED_REMOVE","EVENT_BEFORE_FIXED_ADD","_slicedToArray","sliceIterator","arr","_arr","_n","_d","_e","_s","_i","next","done","err","Array","isArray","_debounce","_debounce2","_Event","_Event2","CLS_FIXED_WINDOW","fixedWindowInstance","FixedWindow","widgets","currentScrollTop","fixedScreenConstraints","windowWidth","isFixedWindowActive","touchListener","widget","fixedBreakpointFn","Set","widgetsThatRequireFixedWindow","from","some","_ref","_addFixedContainer","_removeFixedContainer","_this2","dispatchAndFire","getCurrentWidget","map","n","foundProperty","direction","node","whatNode","d","__fixedWindowMod__","getScrollbarWidth","preventDefault","shouldNotMove","touchStartListener","_getCurrentWidget","scrollTop","scrollHeight","touchMoveListener","_getCurrentWidget2","stopImmediatePropagation","documentElement","_node","paddingRight","_checkFixedNeeded","pop","resolve","fixed","fixedWidget","eventHandler","resizeListener","bind","EVENT_MODAL_ASYNC_TARGET_LOADED","EVENT_MODAL_INIT","EVENT_MODAL_OPENED","EVENT_MODAL_BEFORE_CLOSED","EVENT_MODAL_CLOSED","_Widget","_Widget2","_FixedWindow","_FixedWindow2","HTML_ELEMENT","KEY_ESC","ATTR_CREATE_NEW","ATTR_CLOSE","ATTR_NAME","CLS_CONTAINER_CURRENT","CLS_OPEN","CLS_CURRENT","CLS_PART_OF_STACK","CLS_MODAL_OPEN","CLS_MODAL_CONTAINER","CLS_ANIM_END","CLS_LOADER_CONTAINER","CLS_LOADER","Modal","currentOpen","loading","closeOnEscape","closeOnBackgroundClick","destroyOnFinish","fixedContainer","containerClassNames","eventContainer","eventFunction","dataMainPageContainer","modalContainer","_modalInstances","indexOf","splice","getInstance","close","applyOptionsFromElement","copy","KeyboardEvent","getTabEvent","defaultPrevented","_finishState","prevModal","switchModals","dispatch","withOriginal","_removeModalFromStack","lastContainer","childNodes","cl","destroy","co","last","open","prefixedAnimateEvent","_finishAnim","instances","isCurrent","contains","foundInstance","flexModalInstance","targetContent","future","hasTarget","isHtmlElement","isWidget","findWidget","newInstance","setDestroyOnFinish","fromEvent","then","registerEvents","getModalContainer","modalContainerClasses","closeModalFunction","ce","loader","toggleLoader","show","loaderLoader","handleScrollbar","getAsync","r","result","DocumentFragment","guid","thisEl","modal","internal","maybeEvent","delegate","delegateContainer","addScreenConstraint","createWidget","arguments","v","isEmptyContainer","MutationObserver","observer","mutations","disconnect","observe","childList","keyCode","lastModal","EVENT_FORM_AJAX_COMPLETED","EVENT_FORM_AFTER_AJAX_SUBMIT","EVENT_FORM_SUBMIT","EVENT_FORM_READY","_Tooltip","_Tooltip2","LOADING_CLASS","DATA_ELEMENT_INVALID","REMOTE","REMOTE_ACTION","ATTR_DISABLE_INLINE","ATTR_DISABLE_REALTIME","ATTR_VALIDATOR","ATTR_DATA_CUSTOM_MESSAGE","ATTR_DATA_CUSTOM_LABEL","ATTR_VALIDATE_VISIBILITY","ATTR_ERROR_TARGET_ID","ATTR_DEPENDS","CONST_USE_JSON","CONST_REALTIME_EVENT","FOCUS_TOOLTIP_DELAY","CLICK_TOOLTIP_DELAY","Form","form","HTMLFormElement","tooltips","currentValidationFuture","createTooltips","appendError","ajaxSubmitType","ajaxJsonContentType","inlineValidation","realtime","realtimeTimeout","formatErrorTooltip","error","inputErrorClass","containerErrorClass","fetchOptions","credentials","tooltipOptions","scrollToElementDiff","_validators","globalValidators","_remoteValidationFunction","initFormValidation","thisForm","shouldUseAjax","ajaxPostUrl","location","href","useJson","_formStopLoading","submit","defaultHeaders","X-Requested-With","Content-Type","headers","method","serverCall","fetch","serialize","FormData","globalRemoteValidationFunction","response","selectors","inputs","querySelectorAll","exists","field","focus","fields","NodeList","_handleValidation","foundAnyError","toValidateFields","scoped","_createArrayFromInvalidFieldList","isLocalInvalid","_focusElement","validation","_customValidationsForElements","validateCustomFields","thisToValidateFields","concat","checkedFields","foundInvalidFields","prepareErrors","firstInvalidField","activeElement","_handleTooltipHideClickAfterChange","showAndOrCreateTooltip","validity","globalErrorMessageHandler","keys","labels","getForm","invalid","labelsIndex","labelEl","_markElementInvalid","_markElementValid","filter","HTMLFieldSetElement","thisParent","errors","inputsWithErrorClasses","elementErrorIndex","inputErrorIndex","validator","validationRef","futures","fieldsLength","iVal","_shouldNotValidateField","customError","valid","_runValidation","console","warn","all","allFutures","l","fI","_removeElementErrors","removeAllErrors","handleAdditionalLabels","isInvalid","thisLabelGroup","additionalLabels","group","removeErrors","labelGroups","invalidFields","errorTarget","_findErrorTarget","flexFormsSavedValidity","_setupErrorMessages","msg","validationMessage","insertAdjacentHTML","flexFormsSavedValidationMessage","setCustomValidity","_field","linkedFields","thisField","_isElementInvalidElement","_handleLabels","_formatErrorTooltip","fieldSelector","slice","_checkIsValidRealtimeElement","clearKeyDownTimeout","KEYDOWN_RUNNING","clearTimeout","TIMEOUT_KEYDOWN","_checkIsValidBlurFocusElement","_checkIsValidInlineCheckElement","_this3","invalidEvent","addEventOnce","handleInvalid","_formLoading","_checkIsInvalid","setTimeout","_handleSubmit","_formIsLoading","isStillTarget","_handleTooltipInline","dependentFields","_getDependentFields","flexcssKeepTooltips","_submitListener","scrollToElement","submitListener","submitEvent","checkValidity","_getInvalidElements","firstError","_submitFunction","isVisible","list","foundTarget","errorFunc","selector","forms","customMsg","fn","ms","timeout","normalizeName","String","test","normalizeValue","Headers","append","getOwnPropertyNames","consumed","bodyUsed","reject","fileReaderReady","reader","onload","onerror","readBlobAsArrayBuffer","blob","FileReader","readAsArrayBuffer","readBlobAsText","readAsText","Body","_initBody","_bodyInit","_bodyText","support","Blob","isPrototypeOf","_bodyBlob","formData","_bodyFormData","arrayBuffer","ArrayBuffer","set","rejected","decode","json","normalizeMethod","upcased","methods","Request","url","mode","referrer","split","bytes","shift","decodeURIComponent","xhr","head","pairs","getAllResponseHeaders","header","Response","bodyInit","status","ok","statusText","values","getAll","has","thisArg","clone","redirectStatuses","redirect","RangeError","responseURL","getResponseHeader","request","XMLHttpRequest","responseText","withCredentials","responseType","setRequestHeader","send","polyfill","EVENT_DROPDOWN_CLOSED","ATTR_CC","ATTR_DARKENER","DARKENER_INIT","ATTR_DATA_TARGET","ATTR_CLOSE_DROPDOWN","STATE_LOADING","CLS_DARKENER_DROPDOWN","CLS_DROPDOWN","Dropdown","Darkener","currentTarget","darkener","destroyOnClose","closestCallback","targetIsCurrent","_delegateFunction","isLoading","createDropdown","cls","darkenerInstance","flexDarkenerInstance","thisCurrentOpen","getTransitionEvent","scheduler","srcElement","requestAnimationFrame","toggleDarkenerToggler","thisWidget","data","dropdownContainerElement","dropdownContent","isAbsolute","flexCollisionContainer","collisionC","toggle","_Modal","_Modal2","ATTR_MAX_WIDTH","ATTR_MAX_HEIGHT","ATTR_SRC","CLS_HAS_PREV","CLS_HAS_NEXT","CLS_LOADING","ATTR_NO_THUMBNAIL","ATTR_DATA_HREF","ATTR_HREF","KEY_NEXT","KEY_PREV","LightBox","AttributeSelector","ModalAppend","thisDelegateContainer","_modalAppend","_resizeEvent","_keyboardNextEvent","_future","_nextFuture","_imageContainer","_modalContainerDiv","_contentContainer","_closerContainerDiv","_delegateContainer","_attributeSelector","_widget","_isOpen","img","_isLoading","registerPrevNextEvents","closeOnLast","onNext","onClose","getNext","getPrev","onSwitchImage","children","findImmediateNextTarget","nextElementSibling","previousElementSibling","onOpen","validTarget","parentIsValid","switchImage","_","hasPrev","hasNext","hasPrevClass","hasNextClass","isIE","_ret","nextThumb","nextHighRes","nextSource","src","nextImgObject","Image","backgroundImage","_setupMaxWidthHeight","_calculateContainer","highRes","_setupPrevNextStates","thisThumbnail","thisImgHighResolution","_this4","highImageObj","_getSrc","_this5","thumbnail","imgHighResolution","imgSrc","imageObj","pageX","TouchEvent","changedTouches","rect","imgX","wrapperWidth","posX","switchImageByDirection","_runOptionalClose","fromWidget","loadedImage","nextMaxWidth","nextMaxHeight","maxWidth","maxHeight","EVENT_TOGGLE","ATTR_CLOSE_SIDEBAR","ATTR_TARGET","INIT_CLASS","OPEN_CLASS","HIDE_FACTOR","OffCanvas","NavigationId","factor","disableTouch","touchedX","navigationContainer","DARKENER_CLASS_TOGGLE","DARKENER_CLASS_INSTANT_TOGGLE","shouldNotTouch","darkenerClassToggle","darkenerClassToggleInstant","globalToggleClass","navigationContainerId","touches","clientX","mustHide","calcX","bounds","compare","webkitTransition","transform","webkitTransform","_remove","resetTransform","_removeInstant","docCls","darkenerClass","navigationControllerClassList","docElementCls","promise","thisDelegate","EVENT_TAB_OPENED","EVENT_TAB_CLOSED","ACTIVE_CLASS","ATTR_TOGGLE_LIST","Toggleable","ContainerId","refId","ref","toggleTarget","_listener","querySelector","elClassList","failure","maybeToggleNode","parentClassList","targetRef","_handleLoaded","_Form","_Form2","_Toggleable","_Toggleable2","_OffCanvas","_OffCanvas2","_Dropdown","_Dropdown2","_LightBox","_LightBox2"],"mappings":"CAAA,SAAAA,EAAAC,GACA,gBAAAC,UAAA,gBAAAC,QACAA,OAAAD,QAAAD,IACA,kBAAAG,gBAAAC,IACAD,UAAAH,GACA,gBAAAC,SACAA,QAAA,QAAAD,IAEAD,EAAA,QAAAC,KACCK,KAAA,WACD,MCAgB,UAAUC,GCN1B,QAAAC,GAAAC,GAGA,GAAAC,EAAAD,GACA,MAAAC,GAAAD,GAAAP,OAGA,IAAAC,GAAAO,EAAAD,IACAP,WACAS,GAAAF,EACAG,QAAA,EAUA,OANAL,GAAAE,GAAAI,KAAAV,EAAAD,QAAAC,IAAAD,QAAAM,GAGAL,EAAAS,QAAA,EAGAT,EAAAD,QAvBA,GAAAQ,KAqCA,OATAF,GAAAM,EAAAP,EAGAC,EAAAO,EAAAL,EAGAF,EAAAQ,EAAA,MAGAR,EAAA,KDgBM,SAASL,EAAQD,EAASM,GAE/BL,EAAOD,QAAUM,EAAoB,KAKhC,SAASL,EAAQD,IAEM,SAASe,GAAS,YAQ9C,SAASC,GAAgBC,EAAUC,GAAe,KAAMD,YAAoBC,IAAgB,KAAM,IAAIC,WAAU,qCANhHC,OAAOC,eAAerB,EAAS,cAC3BsB,OAAO,GAGX,IAAIC,GAAe,WAAc,QAASC,GAAiBC,EAAQC,GAAS,IAAK,GAAIC,GAAI,EAAGA,EAAID,EAAME,OAAQD,IAAK,CAAE,GAAIE,GAAaH,EAAMC,EAAIE,GA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AAO,MAAOA,IAAOA,EAAIC,WAAaD,GAAQE,UAASF,GA7CvFxI,OAAOC,eAAerB,EAAS,cAC7BsB,OAAO,IAETtB,EAAQswB,SAAWtwB,EAAQ8tB,SAAW9tB,EAAQy1B,UAAYz1B,EAAQ43B,WAAa53B,EAAQyC,KAAOzC,EAAQiL,SAAWjL,EAAQkN,OAASlN,EAAQsX,MAAQtX,EAAQ6P,QAAU7P,EAAQke,KAAOra,MAEnL,IAAI40B,GAAQn4B,EAAoB,GAE5Bo4B,EAAS/uB,EAAuB8uB,GAEhCzb,EAAW1c,EAAoB,GAE/B2c,EAAYtT,EAAuBqT,GAEnCyS,EAASnvB,EAAoB,GAE7BovB,EAAU/lB,EAAuB8lB,GAEjCrZ,EAAU9V,EAAoB,GAE9B+V,EAAW1M,EAAuByM,GAElC7G,EAAYjP,EAAoB,GAEhCkP,EAAa7F,EAAuB4F,GAEpCopB,EAAcr4B,EAAoB,IAElCs4B,EAAejvB,EAAuBgvB,GAEtCE,EAAav4B,EAAoB,IAEjCw4B,EAAcnvB,EAAuBkvB,GAErCE,EAAYz4B,EAAoB,IAEhC04B,EAAarvB,EAAuBovB,GAEpCE,EAAY34B,EAAoB,IAEhC44B,EAAavvB,EAAuBsvB,GAEpClvB,EAAQzJ,EAAoB,GAE5B0J,EAASL,EAAuBI,EAIpC/J,GkB5mLQke,KAAAwa,alB6mLR14B,EkB7mLc6P,QAAAoN,alB8mLdjd,EkB9mLuBsX,MAAAoY,alB+mLvB1vB,EkB/mL8BkN,OAAAmJ,alBgnL9BrW,EkBhnLsCiL,SAAAuE,alBinLtCxP,EkBjnLgDyC,KAAAuH,alBknLhDhK,EkBlnLsD43B,WAAAgB,alBmnLtD54B,EkBnnLkEy1B,UAAAqD,alBonLlE94B,EkBpnL6E8tB,SAAAkL,alBqnL7Eh5B,EkBrnLuFswB,SAAA4I","file":"js/flexcss.min.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"FlexCss\"] = factory();\n\telse\n\t\troot[\"FlexCss\"] = factory();\n})(this, function() {\nreturn \n\n\n/** WEBPACK FOOTER **\n ** webpack/universalModuleDefinition\n **/","(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"FlexCss\"] = factory();\n\telse\n\t\troot[\"FlexCss\"] = factory();\n})(this, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId])\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\texports: {},\n/******/ \t\t\tid: moduleId,\n/******/ \t\t\tloaded: false\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.loaded = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"../\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tmodule.exports = __webpack_require__(17);\n\n\n/***/ },\n/* 1 */\n/***/ function(module, exports) {\n\n\t/* WEBPACK VAR INJECTION */(function(global) {\"use strict\";\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\t/*\n\t * The MIT License (MIT)\n\t *\n\t * Copyright (c) 2015 David Heidrich, BowlingX \n\t *\n\t * Permission is hereby granted, free of charge, to any person obtaining a copy\n\t * of this software and associated documentation files (the \"Software\"), to deal\n\t * in the Software without restriction, including without limitation the rights\n\t * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n\t * copies of the Software, and to permit persons to whom the Software is\n\t * furnished to do so, subject to the following conditions:\n\t *\n\t * The above copyright notice and this permission notice shall be included in\n\t * all copies or substantial portions of the Software.\n\t *\n\t * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n\t * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n\t * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n\t * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n\t * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n\t * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n\t * THE SOFTWARE.\n\t */\n\t\n\tvar PFX = [\"webkit\", \"moz\", \"MS\", \"o\", \"\"];\n\t\n\tvar COL_LEFT_CLASS = 'is-collision-left';\n\t\n\tvar COL_RIGHT_CLASS = 'is-collision-right';\n\t\n\tvar COL_BOTTOM_CLASS = 'is-collision-bottom';\n\t\n\t/**\n\t * Provides shared DOM-Utility functions\n\t */\n\t\n\tvar Util = function () {\n\t function Util() {\n\t _classCallCheck(this, Util);\n\t }\n\t\n\t _createClass(Util, null, [{\n\t key: \"prefixedAnimateEvent\",\n\t\n\t\n\t /**\n\t * Will register the right animation event based on browser\n\t * @param element\n\t * @param type\n\t * @param callback\n\t */\n\t value: function prefixedAnimateEvent(element, type, callback) {\n\t var thisFunction = function thisFunction(e) {\n\t callback.apply(element, [e, thisFunction]);\n\t };\n\t\n\t for (var p = 0; p < PFX.length; p++) {\n\t var thisType = type;\n\t if (!PFX[p]) {\n\t thisType = type.toLowerCase();\n\t }\n\t var name = PFX[p] + thisType;\n\t element.addEventListener(name, thisFunction, true);\n\t }\n\t }\n\t\n\t /**\n\t * Get correct transitionend event\n\t * @returns {String}\n\t * @private\n\t */\n\t\n\t }, {\n\t key: \"whichTransitionEndEvent\",\n\t value: function whichTransitionEndEvent() {\n\t var t = void 0;\n\t var el = document.createElement('fake');\n\t\n\t var transitions = {\n\t transition: 'transitionend',\n\t OTransition: 'oTransitionEnd',\n\t MozTransition: 'transitionend',\n\t WebkitTransition: 'webkitTransitionEnd'\n\t };\n\t\n\t for (t in transitions) {\n\t if (el.style[t] !== undefined) {\n\t return transitions[t];\n\t }\n\t }\n\t }\n\t\n\t /**\n\t * Check if target is part of parent node\n\t * @param target\n\t * @param parent\n\t * @returns {boolean}\n\t */\n\t\n\t }, {\n\t key: \"isPartOfNode\",\n\t value: function isPartOfNode(target, parent) {\n\t if (!target || !parent) {\n\t return false;\n\t }\n\t var now = target;\n\t while (now !== parent && now !== null) {\n\t if (now === parent) {\n\t break;\n\t }\n\t now = now.parentNode;\n\t }\n\t return now !== null;\n\t }\n\t\n\t /**\n\t * Finds the closest element including itself matching a callback\n\t * @param {Node} el\n\t * @param {Function} callback\n\t * @returns {Node|boolean}\n\t */\n\t\n\t }, {\n\t key: \"closestCallback\",\n\t value: function closestCallback(el, callback) {\n\t var element = el;\n\t while (element !== null) {\n\t if (callback(element)) {\n\t return element;\n\t }\n\t element = element.parentNode;\n\t }\n\t return false;\n\t }\n\t\n\t /**\n\t * Walks the tree until func returns true for given argument\n\t * @param target\n\t * @param func\n\t * @returns {boolean|HTMLElement}\n\t */\n\t\n\t }, {\n\t key: \"parentsUntil\",\n\t value: function parentsUntil(target, func) {\n\t if (!target) {\n\t return false;\n\t }\n\t var now = target;\n\t while (!func(now) && now !== null) {\n\t now = now.parentNode;\n\t }\n\t\n\t return now;\n\t }\n\t\n\t /**\n\t * Generates a unique id\n\t * @return {String}\n\t */\n\t\n\t }, {\n\t key: \"guid\",\n\t value: function guid() {\n\t function s4() {\n\t return Math.floor((1 + Math.random()) * 0x10000).toString(16).substring(1);\n\t }\n\t\n\t return s4() + s4() + \"-\" + s4() + \"-\" + s4() + \"-\" + s4() + \"-\" + (s4() + s4() + s4());\n\t }\n\t\n\t /**\n\t * Detects scrollbar width\n\t * @see http://stackoverflow.com/questions/986937/how-can-i-get-the-browsers-scrollbar-sizes\n\t * @returns {number}\n\t */\n\t\n\t }, {\n\t key: \"getScrollBarWidth\",\n\t value: function getScrollBarWidth() {\n\t var doc = global.document;\n\t var inner = doc.createElement('p');\n\t\n\t inner.style.width = \"100%\";\n\t inner.style.height = \"200px\";\n\t\n\t var outer = doc.createElement('div');\n\t outer.style.position = \"absolute\";\n\t outer.style.top = \"0px\";\n\t outer.style.left = \"0px\";\n\t outer.style.visibility = \"hidden\";\n\t outer.style.width = \"200px\";\n\t outer.style.height = \"150px\";\n\t outer.style.overflow = \"hidden\";\n\t outer.appendChild(inner);\n\t\n\t doc.body.appendChild(outer);\n\t var w1 = inner.offsetWidth;\n\t outer.style.overflow = 'scroll';\n\t var w2 = inner.offsetWidth;\n\t if (w1 === w2) {\n\t w2 = outer.clientWidth;\n\t }\n\t doc.body.removeChild(outer);\n\t\n\t return w1 - w2;\n\t }\n\t\n\t /**\n\t * Run an event once\n\t * @param {String} ev\n\t * @param {HTMLElement|HTMLDocument} target\n\t * @param {Function} func\n\t * @param {boolean} [capture]\n\t * @return Function created listener\n\t */\n\t\n\t }, {\n\t key: \"addEventOnce\",\n\t value: function addEventOnce(ev, target, func, capture) {\n\t var thisFunction = function thisFunction(event) {\n\t func(event, func);\n\t target.removeEventListener(ev, thisFunction, capture);\n\t };\n\t target.addEventListener(ev, thisFunction, capture);\n\t return thisFunction;\n\t }\n\t\n\t /**\n\t * Checks if an element is visible\n\t * @param {HTMLElement} element\n\t * @returns bool\n\t */\n\t\n\t }, {\n\t key: \"isVisible\",\n\t value: function isVisible(element) {\n\t return element.offsetWidth > 0 && element.offsetHeight > 0;\n\t }\n\t\n\t /**\n\t * Creates a camelCaseRepresentation of a dashed string\n\t * @param {String} str\n\t * @returns String\n\t */\n\t\n\t }, {\n\t key: \"dashToCamelCase\",\n\t value: function dashToCamelCase(str) {\n\t return str.replace(/-([a-z])/g, function (g) {\n\t return g[1].toUpperCase();\n\t });\n\t }\n\t\n\t /**\n\t * Creates a copy of `input`\n\t * @param {*} input\n\t * @return *\n\t */\n\t\n\t }, {\n\t key: \"copy\",\n\t value: function copy(input) {\n\t return JSON.parse(JSON.stringify(input));\n\t }\n\t\n\t /**\n\t * Reads options from element (data attributes) and applies to base\n\t * @param {HTMLElement} element\n\t * @param {Object} base\n\t * @return {Object}\n\t */\n\t\n\t }, {\n\t key: \"applyOptionsFromElement\",\n\t value: function applyOptionsFromElement(element, base) {\n\t if (!element) {\n\t return base;\n\t }\n\t var attrs = element.attributes;\n\t for (var i = 0; i < attrs.length; i++) {\n\t var attr = attrs[i];\n\t if (attr) {\n\t var s = Util.dashToCamelCase(attr.nodeName.replace('data-', ''));\n\t var val = attr.nodeValue;\n\t if (base.hasOwnProperty(s)) {\n\t // skip functions\n\t if (typeof base[s] === 'function') {\n\t continue;\n\t }\n\t if (typeof base[s] === 'boolean') {\n\t base[s] = parseInt(val || 1, 10) === 1;\n\t } else {\n\t base[s] = val;\n\t }\n\t }\n\t }\n\t }\n\t return base;\n\t }\n\t\n\t /**\n\t * Will position an element directly at given target\n\t * Is aware of a given collision container to detect edges\n\t * Will put elementToPosition either to left, center or right edge (prefer right)\n\t * and either to bottom or top (prefers bottom)\n\t *\n\t * You may overwrite preferred positioned with `centerHorizontal` and `positionTop`\n\t *\n\t * @param {HTMLElement|ClientRect} target the target container to align to\n\t * @param {HTMLElement} elementToPosition the element to position\n\t * @param {HTMLElement} collisionContainer the outer container to prevent collisions\n\t * @param {boolean} [centerHorizontal] set true to center element, otherwise it's put on the right border by default\n\t * @param {boolean} [positionTop] flip top, by default element is positioned to the bottom.\n\t * @returns {HTMLElement}\n\t */\n\t\n\t }, {\n\t key: \"setupPositionNearby\",\n\t value: function setupPositionNearby(target, elementToPosition, collisionContainer, centerHorizontal, positionTop) {\n\t // determine relative offsets\n\t var amountTop = 0;\n\t var amountLeft = 0;\n\t Util.parentsUntil(target.parentNode, function (el) {\n\t if (!(el instanceof HTMLElement)) {\n\t return false;\n\t }\n\t var style = window.getComputedStyle(el);\n\t if (Util.isPartOfNode(elementToPosition, el)) {\n\t if (style && style.position === 'relative') {\n\t amountTop += el.offsetTop || 0;\n\t amountLeft += el.offsetLeft || 0;\n\t }\n\t return false;\n\t }\n\t return true;\n\t });\n\t\n\t var targetPosition = target instanceof HTMLElement ? target.getBoundingClientRect() : target;\n\t var elementRect = elementToPosition.getBoundingClientRect();\n\t var colRect = collisionContainer.getBoundingClientRect();\n\t var targetTop = targetPosition.top - amountTop;\n\t var targetRight = targetPosition.right;\n\t var isCollisionTop = targetTop - elementRect.height <= 0;\n\t var isCollisionBottom = window.innerHeight < targetTop + amountTop + targetPosition.height + elementRect.height;\n\t var isCollisionLeft = targetRight < elementRect.width;\n\t var targetLeft = targetPosition.left;\n\t var isCollisionRight = targetLeft + elementRect.width > colRect.width;\n\t var classList = elementToPosition.classList;\n\t\n\t classList.remove(COL_RIGHT_CLASS);\n\t classList.remove(COL_LEFT_CLASS);\n\t classList.remove(COL_BOTTOM_CLASS);\n\t\n\t var calcTop = void 0;\n\t var calcLeft = void 0;\n\t if (isCollisionLeft && !isCollisionRight) {\n\t // put element to left if collision with left\n\t calcLeft = targetPosition.left - colRect.left - amountLeft + \"px\";\n\t classList.add(COL_LEFT_CLASS);\n\t } else {\n\t // maybe center if no collision with either side\n\t var rightPosition = targetRight - elementRect.width - colRect.left - amountLeft + \"px\";\n\t var leftCentered = (targetLeft + targetPosition.width / 2 - elementRect.width / 2 || 0) - colRect.left;\n\t var collisionCentered = leftCentered + elementRect.width > colRect.width;\n\t if (centerHorizontal && !collisionCentered) {\n\t calcLeft = leftCentered + \"px\";\n\t } else {\n\t classList.add(COL_RIGHT_CLASS);\n\t calcLeft = rightPosition;\n\t }\n\t }\n\t\n\t if (isCollisionBottom || positionTop && !isCollisionTop) {\n\t // Put Element on top if collision\n\t calcTop = targetTop - elementRect.height - colRect.top + \"px\";\n\t classList.add(COL_BOTTOM_CLASS);\n\t } else {\n\t calcTop = targetTop + targetPosition.height - colRect.top + \"px\";\n\t }\n\t\n\t elementToPosition.style.cssText = \"top:\" + calcTop + \";left:\" + calcLeft + \";\";\n\t\n\t return elementToPosition;\n\t }\n\t\n\t /**\n\t * Brings a given element into viewport\n\t * @param {HTMLElement} el\n\t * @param {int|function}[optionalOffset]\n\t */\n\t\n\t }, {\n\t key: \"scrollToElement\",\n\t value: function scrollToElement(el, optionalOffset) {\n\t el.scrollIntoView();\n\t var thisOffset = optionalOffset;\n\t // optionally use a additional scrollDif\n\t if (thisOffset) {\n\t if (typeof thisOffset === 'function') {\n\t thisOffset = optionalOffset();\n\t }\n\t if (thisOffset > 0) {\n\t var scrolledY = window.pageYOffset;\n\t if (scrolledY) {\n\t window.scroll(0, scrolledY - thisOffset);\n\t }\n\t }\n\t }\n\t }\n\t }]);\n\t\n\t return Util;\n\t}();\n\t\n\texports.default = Util;\n\t/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))\n\n/***/ },\n/* 2 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t/* WEBPACK VAR INJECTION */(function(global) {'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /*\n\t * The MIT License (MIT)\n\t *\n\t * Copyright (c) 2015 David Heidrich, BowlingX \n\t *\n\t * Permission is hereby granted, free of charge, to any person obtaining a copy\n\t * of this software and associated documentation files (the \"Software\"), to deal\n\t * in the Software without restriction, including without limitation the rights\n\t * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n\t * copies of the Software, and to permit persons to whom the Software is\n\t * furnished to do so, subject to the following conditions:\n\t *\n\t * The above copyright notice and this permission notice shall be included in\n\t * all copies or substantial portions of the Software.\n\t *\n\t * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n\t * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n\t * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n\t * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n\t * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n\t * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n\t * THE SOFTWARE.\n\t */\n\t\n\t\n\tvar _Util = __webpack_require__(1);\n\t\n\tvar _Util2 = _interopRequireDefault(_Util);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\t// we attach global settings to global once because settings might be shared a lot of times trough the application\n\t// Maybe find a better way to handle that scenario\n\tif (!global.FLEXCSS_GLOBAL_SETTINGS) {\n\t (function () {\n\t global.FLEXCSS_GLOBAL_SETTINGS = {\n\t // defined breakpoint for small devices < n\n\t smallBreakpoint: 768,\n\t // nodes that should be updated when no scrollbar is expected\n\t scrollbarUpdateNodes: global.document.body !== null ? [global.document.body] : [],\n\t // additional Delay until darkener is fully hidden\n\t darkenerFadeDelay: 100,\n\t // class that is added if canvas has been toggled\n\t canvasToggledClass: 'toggled-canvas'\n\t };\n\t\n\t global.FLEXCSS_CONST_IS_IOS = null;\n\t\n\t global.FLEXCSS_CONST_IS_TOUCH = null;\n\t\n\t global.FLEXCSS_CONST_IS_IE = null;\n\t\n\t global.FLEXCSS_CONST_TAB_EVENT = 'click';\n\t\n\t global.FLEXCSS_IS_SMALL_SCREEN = false;\n\t\n\t var init = function init() {\n\t // Measure scrollbar width\n\t global.FLEXCSS_CONST_SCROLLBAR_WIDTH = _Util2.default.getScrollBarWidth();\n\t // detect right transition end event\n\t global.FLEXCSS_CONST_TRANSITION_EVENT = _Util2.default.whichTransitionEndEvent();\n\t };\n\t\n\t if (global.document.readyState !== 'loading') {\n\t init();\n\t } else {\n\t // it's possible that global.document.body is not available if the document is not\n\t // loaded completely\n\t document.addEventListener('DOMContentLoaded', function () {\n\t init();\n\t });\n\t }\n\t })();\n\t}\n\t\n\t/**\n\t * Utility class that setups global settings\n\t */\n\t\n\tvar Settings = function () {\n\t function Settings() {\n\t _classCallCheck(this, Settings);\n\t }\n\t\n\t _createClass(Settings, null, [{\n\t key: 'setup',\n\t\n\t\n\t /**\n\t * Setup global settings, overwrite default values\n\t * @param {Object} settings\n\t */\n\t value: function setup(settings) {\n\t Object.assign(global.FLEXCSS_GLOBAL_SETTINGS, settings);\n\t }\n\t\n\t /**\n\t * Access to global settings\n\t * @returns {Object}\n\t */\n\t\n\t }, {\n\t key: 'get',\n\t value: function get() {\n\t return global.FLEXCSS_GLOBAL_SETTINGS;\n\t }\n\t\n\t /**\n\t * Detects a IOS Device, caches subsequent calls\n\t * @returns {boolean}\n\t */\n\t\n\t }, {\n\t key: 'isIosDevice',\n\t value: function isIosDevice() {\n\t if (!global.FLEXCSS_CONST_IS_IOS) {\n\t global.FLEXCSS_CONST_IS_IOS = global.navigator.userAgent.match(/(iPad|iPhone|iPod)/i);\n\t }\n\t\n\t return global.FLEXCSS_CONST_IS_IOS;\n\t }\n\t\n\t /**\n\t * @returns {boolean}\n\t */\n\t\n\t }, {\n\t key: 'isSmallScreen',\n\t value: function isSmallScreen() {\n\t return window.innerWidth < Settings.get().smallBreakpoint;\n\t }\n\t\n\t /**\n\t * Detects a touch device, caches subsequent calls\n\t * @returns {boolean}\n\t */\n\t\n\t }, {\n\t key: 'isTouchDevice',\n\t value: function isTouchDevice() {\n\t if (!global.FLEXCSS_CONST_IS_TOUCH) {\n\t global.FLEXCSS_CONST_IS_TOUCH = 'ontouchstart' in window || !!global.navigator.msMaxTouchPoints;\n\t }\n\t return global.FLEXCSS_CONST_IS_TOUCH;\n\t }\n\t\n\t /**\n\t * Checks if current browser is Internet Explorer\n\t * @returns {boolean|*}\n\t */\n\t\n\t }, {\n\t key: 'isIE',\n\t value: function isIE() {\n\t if (!global.FLEXCSS_CONST_IS_IE) {\n\t global.FLEXCSS_CONST_IS_IE = \"ActiveXObject\" in window;\n\t }\n\t return global.FLEXCSS_CONST_IS_IE;\n\t }\n\t\n\t /**\n\t * @returns {String}\n\t */\n\t\n\t }, {\n\t key: 'getTransitionEvent',\n\t value: function getTransitionEvent() {\n\t return global.FLEXCSS_CONST_TRANSITION_EVENT;\n\t }\n\t\n\t /**\n\t * @returns {int}\n\t */\n\t\n\t }, {\n\t key: 'getScrollbarWidth',\n\t value: function getScrollbarWidth() {\n\t return global.FLEXCSS_CONST_SCROLLBAR_WIDTH;\n\t }\n\t\n\t /**\n\t * @returns {String}\n\t */\n\t\n\t }, {\n\t key: 'getTabEvent',\n\t value: function getTabEvent() {\n\t return global.FLEXCSS_CONST_TAB_EVENT;\n\t }\n\t }]);\n\t\n\t return Settings;\n\t}();\n\t\n\texports.default = Settings;\n\t/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))\n\n/***/ },\n/* 3 */\n/***/ function(module, exports) {\n\n\t/* WEBPACK VAR INJECTION */(function(global) {\"use strict\";\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\t/* global CustomEvent */\n\t\n\t/*\n\t * The MIT License (MIT)\n\t *\n\t * Copyright (c) 2015 David Heidrich, BowlingX \n\t *\n\t * Permission is hereby granted, free of charge, to any person obtaining a copy\n\t * of this software and associated documentation files (the \"Software\"), to deal\n\t * in the Software without restriction, including without limitation the rights\n\t * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n\t * copies of the Software, and to permit persons to whom the Software is\n\t * furnished to do so, subject to the following conditions:\n\t *\n\t * The above copyright notice and this permission notice shall be included in\n\t * all copies or substantial portions of the Software.\n\t *\n\t * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n\t * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n\t * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n\t * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n\t * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n\t * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n\t * THE SOFTWARE.\n\t */\n\t\n\t// polyfill for custom events to make thinks work in IE\n\t// The needed polyfill is so small that I embedded it here\n\t(function poly() {\n\t if (!global.CustomEvent || typeof global.CustomEvent !== 'function') {\n\t var _CustomEvent = function CustomEvent(event, params) {\n\t var thisParams = params || {\n\t bubbles: false,\n\t cancelable: false,\n\t detail: undefined\n\t };\n\t var evt = document.createEvent(\"CustomEvent\");\n\t evt.initCustomEvent(event, thisParams.bubbles, thisParams.cancelable, thisParams.detail);\n\t return evt;\n\t };\n\t _CustomEvent.prototype = global.Event.prototype;\n\t global.CustomEvent = _CustomEvent;\n\t }\n\t})();\n\t/**\n\t * Simpler Event dispatching\n\t */\n\t\n\tvar EventHandler = function () {\n\t\n\t /**\n\t * @param {HTMLElement} target\n\t * @param {String} name\n\t */\n\t\n\t function EventHandler(target, name) {\n\t _classCallCheck(this, EventHandler);\n\t\n\t this.target = target;\n\t this.defaultOptions = {\n\t bubbles: true,\n\t cancelable: true\n\t };\n\t\n\t this.name = name;\n\t }\n\t\n\t /**\n\t * Set more options\n\t * @param {Object} options\n\t * @returns {EventHandler}\n\t */\n\t\n\t\n\t _createClass(EventHandler, [{\n\t key: \"withOptions\",\n\t value: function withOptions(options) {\n\t Object.assign(this.defaultOptions, options || {});\n\t return this;\n\t }\n\t\n\t /**\n\t * Call with the originalEvent\n\t * @param {Event} e\n\t * @returns {EventHandler}\n\t */\n\t\n\t }, {\n\t key: \"withOriginal\",\n\t value: function withOriginal(e) {\n\t return this.withDetail({\n\t originalEvent: e\n\t });\n\t }\n\t\n\t /**\n\t * Extends the detail part of the event\n\t * @param {Object} o\n\t * @returns {EventHandler}\n\t */\n\t\n\t }, {\n\t key: \"withDetail\",\n\t value: function withDetail(o) {\n\t if (!this.defaultOptions.detail) {\n\t this.defaultOptions.detail = {};\n\t }\n\t Object.assign(this.defaultOptions.detail, o);\n\t return this;\n\t }\n\t\n\t /**\n\t * @returns {CustomEvent}\n\t */\n\t\n\t }, {\n\t key: \"fire\",\n\t value: function fire() {\n\t var e = new CustomEvent(this.name, this.defaultOptions);\n\t if (this.target) {\n\t this.target.dispatchEvent(e);\n\t }\n\t return e;\n\t }\n\t }]);\n\t\n\t return EventHandler;\n\t}();\n\t\n\tvar Event = function () {\n\t function Event() {\n\t _classCallCheck(this, Event);\n\t }\n\t\n\t _createClass(Event, null, [{\n\t key: \"dispatch\",\n\t\n\t /**\n\t * Prepares to dispatch a custom event (without firing)\n\t * @param {HTMLElement} target\n\t * @param {String} name\n\t * @returns {EventHandler}\n\t */\n\t value: function dispatch(target, name) {\n\t return new EventHandler(target, name);\n\t }\n\t\n\t /**\n\t * Dispatches a custom event and fires it directly\n\t * @param {HTMLElement} target\n\t * @param {String} name\n\t * @param {Object} [options]\n\t * @returns {CustomEvent}\n\t */\n\t\n\t }, {\n\t key: \"dispatchAndFire\",\n\t value: function dispatchAndFire(target, name, options) {\n\t return new EventHandler(target, name).withOptions(options).fire();\n\t }\n\t }]);\n\t\n\t return Event;\n\t}();\n\t\n\texports.default = Event;\n\t/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))\n\n/***/ },\n/* 4 */\n/***/ function(module, exports) {\n\n\t/* WEBPACK VAR INJECTION */(function(global) {'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol ? \"symbol\" : typeof obj; };\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\t/*\n\t * The MIT License (MIT)\n\t *\n\t * Copyright (c) 2015 David Heidrich, BowlingX \n\t *\n\t * Permission is hereby granted, free of charge, to any person obtaining a copy\n\t * of this software and associated documentation files (the \"Software\"), to deal\n\t * in the Software without restriction, including without limitation the rights\n\t * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n\t * copies of the Software, and to permit persons to whom the Software is\n\t * furnished to do so, subject to the following conditions:\n\t *\n\t * The above copyright notice and this permission notice shall be included in\n\t * all copies or substantial portions of the Software.\n\t *\n\t * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n\t * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n\t * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n\t * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n\t * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n\t * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n\t * THE SOFTWARE.\n\t */\n\t\n\t/*!\n\t * FlexCss.Widget\n\t * Licensed under the MIT License (MIT)\n\t * Copyright (c) 2015 David Heidrich, BowlingX \n\t */\n\t\n\t/**\n\t * A Widget provides async content on a specific target (e.g. a modal link)\n\t */\n\t\n\tvar Widget = function () {\n\t\n\t /**\n\t * Creates a new Widget\n\t * @param [element], optional define the content of widget\n\t */\n\t\n\t function Widget(element) {\n\t var _this = this;\n\t\n\t _classCallCheck(this, Widget);\n\t\n\t /**\n\t *\n\t * @type {Promise}\n\t */\n\t this.asyncContent = null;\n\t\n\t /**\n\t * @type {boolean}\n\t */\n\t this._isWidget = true;\n\t\n\t if (element) {\n\t /**\n\t * @type {HTMLElement}\n\t */\n\t this.element = element instanceof HTMLElement ? element : global.document.getElementById(element);\n\t if (this.element) {\n\t this.element.hfWidgetInstance = this;\n\t this.setAsync(function () {\n\t return new Promise(function (s) {\n\t s(_this.element);\n\t });\n\t });\n\t } else {\n\t throw new Error('Could not found element with ID: ' + element);\n\t }\n\t }\n\t /**\n\t * The final resulted content that a widget did create (e.g. a modal container)\n\t * @type {HTMLElement}\n\t */\n\t this.finalContent = null;\n\t }\n\t\n\t /**\n\t *\n\t * @returns {Promise}\n\t */\n\t\n\t\n\t _createClass(Widget, [{\n\t key: 'getAsync',\n\t value: function getAsync() {\n\t return this.asyncContent();\n\t }\n\t\n\t /**\n\t * @param {Function.} async\n\t * @returns {Widget}\n\t */\n\t\n\t }, {\n\t key: 'setAsync',\n\t value: function setAsync(async) {\n\t this.asyncContent = async;\n\t return this;\n\t }\n\t\n\t /**\n\t * @returns {HTMLElement}\n\t */\n\t\n\t }, {\n\t key: 'getFinalContent',\n\t value: function getFinalContent() {\n\t return this.finalContent;\n\t }\n\t\n\t /**\n\t * @param {HTMLElement} element\n\t * @returns {Widget}\n\t */\n\t\n\t }, {\n\t key: 'setElement',\n\t value: function setElement(element) {\n\t this.element = element;\n\t return this;\n\t }\n\t\n\t /**\n\t * Destroys the generated content of this widget\n\t * @returns {boolean}\n\t */\n\t\n\t }, {\n\t key: 'destroy',\n\t value: function destroy() {\n\t if (this.finalContent && this.finalContent.parentNode) {\n\t this.finalContent.parentNode.removeChild(this.finalContent);\n\t return true;\n\t }\n\t\n\t delete this.element;\n\t delete this.asyncContent;\n\t delete this.finalContent;\n\t\n\t return false;\n\t }\n\t\n\t /**\n\t * Will find a widget on an Element\n\t * @param {HTMLElement} element\n\t * @returns {Widget|undefined}\n\t */\n\t\n\t }], [{\n\t key: 'findWidget',\n\t value: function findWidget(element) {\n\t return element ? element.hfWidgetInstance : undefined;\n\t }\n\t\n\t /**\n\t * Checks if a given object is an instance\n\t * @param {Object} self\n\t * @returns {boolean}\n\t */\n\t\n\t }, {\n\t key: 'isWidget',\n\t value: function isWidget(self) {\n\t return self instanceof Widget || (typeof self === 'undefined' ? 'undefined' : _typeof(self)) === 'object' && self.hasOwnProperty('_isWidget');\n\t }\n\t }]);\n\t\n\t return Widget;\n\t}();\n\t\n\texports.default = Widget;\n\t/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))\n\n/***/ },\n/* 5 */\n/***/ function(module, exports) {\n\n\t\"use strict\";\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\t/*\n\t * The MIT License (MIT)\n\t *\n\t * Copyright (c) 2015 David Heidrich, BowlingX \n\t *\n\t * Permission is hereby granted, free of charge, to any person obtaining a copy\n\t * of this software and associated documentation files (the \"Software\"), to deal\n\t * in the Software without restriction, including without limitation the rights\n\t * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n\t * copies of the Software, and to permit persons to whom the Software is\n\t * furnished to do so, subject to the following conditions:\n\t *\n\t * The above copyright notice and this permission notice shall be included in\n\t * all copies or substantial portions of the Software.\n\t *\n\t * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n\t * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n\t * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n\t * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n\t * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n\t * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n\t * THE SOFTWARE.\n\t */\n\t\n\t/**\n\t * Provides a Basic Widget\n\t */\n\t\n\tvar DestroyableWidget = function () {\n\t function DestroyableWidget() {\n\t _classCallCheck(this, DestroyableWidget);\n\t\n\t this.listeners = [];\n\t }\n\t\n\t /**\n\t * Destroys a Widget\n\t */\n\t\n\t\n\t _createClass(DestroyableWidget, [{\n\t key: \"destroy\",\n\t value: function destroy() {\n\t this.listeners.forEach(function (listener) {\n\t listener.element.removeEventListener.apply(listener.element, listener.args);\n\t });\n\t this.listeners = [];\n\t }\n\t\n\t /**\n\t * Adds an event and registers it later to remove bindings\n\t * @param {HTMLElement} element\n\t * @param {String} name\n\t * @param {Function} listener\n\t * @param {boolean} [capture]\n\t * @returns {Function}\n\t */\n\t\n\t }, {\n\t key: \"addEventListener\",\n\t value: function addEventListener(element, name, listener, capture) {\n\t this.listeners.push({\n\t element: element,\n\t args: [name, listener, capture]\n\t });\n\t\n\t element.addEventListener(name, listener, capture);\n\t return listener;\n\t }\n\t }]);\n\t\n\t return DestroyableWidget;\n\t}();\n\t\n\texports.default = DestroyableWidget;\n\n/***/ },\n/* 6 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t/* WEBPACK VAR INJECTION */(function(global) {'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\t\n\tvar _Util = __webpack_require__(1);\n\t\n\tvar _Util2 = _interopRequireDefault(_Util);\n\t\n\tvar _DestroyableWidget2 = __webpack_require__(5);\n\t\n\tvar _DestroyableWidget3 = _interopRequireDefault(_DestroyableWidget2);\n\t\n\tvar _Settings = __webpack_require__(2);\n\t\n\tvar _Settings2 = _interopRequireDefault(_Settings);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /*\n\t * The MIT License (MIT)\n\t *\n\t * Copyright (c) 2015 David Heidrich, BowlingX \n\t *\n\t * Permission is hereby granted, free of charge, to any person obtaining a copy\n\t * of this software and associated documentation files (the \"Software\"), to deal\n\t * in the Software without restriction, including without limitation the rights\n\t * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n\t * copies of the Software, and to permit persons to whom the Software is\n\t * furnished to do so, subject to the following conditions:\n\t *\n\t * The above copyright notice and this permission notice shall be included in\n\t * all copies or substantial portions of the Software.\n\t *\n\t * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n\t * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n\t * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n\t * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n\t * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n\t * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n\t * THE SOFTWARE.\n\t */\n\t\n\t/*!\n\t * FlexCss.Tooltip\n\t * Licensed under the MIT License (MIT)\n\t * Copyright (c) 2015 David Heidrich, BowlingX \n\t */\n\t\n\t/**\n\t * @type {string}\n\t */\n\tvar CLASS_NAMES_TOOLTIP = 'tooltip-container';\n\t/**\n\t * @type {string}\n\t */\n\tvar CLASS_NAMES_OPEN = 'open';\n\t\n\t/**\n\t * @type {string}\n\t */\n\tvar ATTR_DATA_CLASSNAME = 'data-class';\n\t\n\t/**\n\t * @type {string}\n\t */\n\tvar ATTR_DATA_NO_TOUCH = 'data-no-touch';\n\t\n\t/**\n\t * @type {HTMLDocument}\n\t */\n\tvar doc = global.document;\n\t\n\t/**\n\t * Simple Tooltip\n\t */\n\t\n\tvar Tooltip = function (_DestroyableWidget) {\n\t _inherits(Tooltip, _DestroyableWidget);\n\t\n\t /**\n\t * Creates a Tooltip\n\t * @param {HTMLElement|String} DelegateContainer\n\t * @param {Object} [options]\n\t */\n\t\n\t function Tooltip(DelegateContainer, options) {\n\t _classCallCheck(this, Tooltip);\n\t\n\t /**\n\t * The Container where possible events are captured\n\t */\n\t\n\t var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(Tooltip).call(this));\n\t\n\t _this.container = DelegateContainer instanceof HTMLElement ? DelegateContainer : doc.getElementById(DelegateContainer);\n\t\n\t if (!_this.container) {\n\t throw new Error('Could not create Tooltip, DelegateContainer not found');\n\t }\n\t\n\t /**\n\t * The Container where tooltips are stored for this instance\n\t * @type {HTMLElement}\n\t */\n\t _this.tooltipContainer = null;\n\t\n\t /**\n\t * Default Options\n\t */\n\t _this.options = {\n\t containerClass: '',\n\t selectorAttribute: 'data-tooltip',\n\t collisionContainer: _this.container\n\t };\n\t\n\t Object.assign(_this.options, options || {});\n\t return _this;\n\t }\n\t\n\t /**\n\t * Creates and shows a tooltip\n\t * @param {HTMLElement} target where is this tooltip positioned\n\t * @param {String} text text content in tooltip, will be NOT escaped\n\t * @param {Boolean} [removeTitle] removes title element if given\n\t * @param {Node} [positionRelative]\n\t */\n\t\n\t\n\t _createClass(Tooltip, [{\n\t key: 'createTooltip',\n\t value: function createTooltip(target, text, removeTitle, positionRelative) {\n\t // abort if text is empty\n\t if (!text || text && text.trim() === '') {\n\t return;\n\t }\n\t\n\t if (_Settings2.default.isTouchDevice() && target && target.hasAttribute(ATTR_DATA_NO_TOUCH)) {\n\t return;\n\t }\n\t\n\t var tooltipContainer = this.tooltipContainer;\n\t\n\t if (!tooltipContainer) {\n\t tooltipContainer = doc.createElement('div');\n\t this.container.appendChild(tooltipContainer);\n\t this.tooltipContainer = tooltipContainer;\n\t }\n\t this._restoreClassNames(tooltipContainer, target);\n\t\n\t tooltipContainer.style.left = 'auto';\n\t tooltipContainer.style.top = 'auto';\n\t tooltipContainer.innerHTML = text;\n\t tooltipContainer.flexTooltipCurrentTarget = target;\n\t if (removeTitle) {\n\t target.oldTitle = text;\n\t target.removeAttribute('title');\n\t }\n\t\n\t _Util2.default.setupPositionNearby(positionRelative || target, tooltipContainer, this.options.collisionContainer, true, true);\n\t\n\t tooltipContainer.classList.add(CLASS_NAMES_OPEN);\n\t }\n\t }, {\n\t key: '_restoreClassNames',\n\t value: function _restoreClassNames(container, target) {\n\t // allow additional classname per tooltip on target element\n\t var classNames = [CLASS_NAMES_TOOLTIP, this.options.containerClass];\n\t var maybeTargetClass = target.getAttribute(ATTR_DATA_CLASSNAME);\n\t if (maybeTargetClass) {\n\t classNames.push(maybeTargetClass);\n\t }\n\t container.className = classNames.join(\" \");\n\t return this;\n\t }\n\t\n\t /**\n\t * @returns {HTMLElement|null}\n\t */\n\t\n\t }, {\n\t key: 'getCurrentTarget',\n\t value: function getCurrentTarget() {\n\t return this.tooltipContainer ? this.tooltipContainer.flexTooltipCurrentTarget : null;\n\t }\n\t\n\t /**\n\t * Destroys this Widget\n\t * @returns {boolean}\n\t */\n\t\n\t }, {\n\t key: 'destroy',\n\t value: function destroy() {\n\t _get(Object.getPrototypeOf(Tooltip.prototype), 'destroy', this).call(this);\n\t\n\t if (this.tooltipContainer) {\n\t this.tooltipContainer.parentNode.removeChild(this.tooltipContainer);\n\t return true;\n\t }\n\t return false;\n\t }\n\t\n\t /**\n\t * Removes a Tooltip on given target\n\t * @param {HTMLElement} [target], if not given will remove current open tooltip on this instance\n\t */\n\t\n\t }, {\n\t key: 'removeTooltip',\n\t value: function removeTooltip(target) {\n\t var selfTarget = target;\n\t if (!selfTarget && this.tooltipContainer) {\n\t selfTarget = this.tooltipContainer.flexTooltipCurrentTarget;\n\t }\n\t if (this.tooltipContainer) {\n\t if (this.tooltipContainer.flexTooltipCurrentTarget !== selfTarget) {\n\t return;\n\t }\n\t this.tooltipContainer.classList.remove(CLASS_NAMES_OPEN);\n\t delete this.tooltipContainer.flexTooltipCurrentTarget;\n\t }\n\t if (selfTarget && selfTarget.oldTitle) {\n\t selfTarget.setAttribute('title', selfTarget.oldTitle);\n\t }\n\t }\n\t\n\t /**\n\t * Initilizes mouse events on container element\n\t */\n\t\n\t }, {\n\t key: 'registerEvents',\n\t value: function registerEvents() {\n\t var self = this;\n\t this.addEventListener(this.container, 'mouseover', function (e) {\n\t if (e.target.hasAttribute(self.options.selectorAttribute)) {\n\t self.createTooltip(e.target, e.target.getAttribute('title'), true);\n\t }\n\t });\n\t\n\t this.addEventListener(this.container, 'mouseout', function (e) {\n\t if (e.target.hasAttribute(self.options.selectorAttribute)) {\n\t self.removeTooltip(e.target);\n\t }\n\t });\n\t return this;\n\t }\n\t }]);\n\t\n\t return Tooltip;\n\t}(_DestroyableWidget3.default);\n\t\n\texports.default = Tooltip;\n\t/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))\n\n/***/ },\n/* 7 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t/* WEBPACK VAR INJECTION */(function(global) {'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports.EVENT_AFTER_FIXED_REMOVE = exports.EVENT_BEFORE_FIXED_ADD = undefined;\n\t\n\tvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol ? \"symbol\" : typeof obj; };\n\t\n\tvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _Settings = __webpack_require__(2);\n\t\n\tvar _Settings2 = _interopRequireDefault(_Settings);\n\t\n\tvar _debounce = __webpack_require__(10);\n\t\n\tvar _debounce2 = _interopRequireDefault(_debounce);\n\t\n\tvar _Event = __webpack_require__(3);\n\t\n\tvar _Event2 = _interopRequireDefault(_Event);\n\t\n\tvar _Util = __webpack_require__(1);\n\t\n\tvar _Util2 = _interopRequireDefault(_Util);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tvar CLS_FIXED_WINDOW = 'fixed-window-open';\n\t\n\tvar EVENT_BEFORE_FIXED_ADD = exports.EVENT_BEFORE_FIXED_ADD = 'flexcss.fixedWindow.beforeAdd';\n\tvar EVENT_AFTER_FIXED_REMOVE = exports.EVENT_AFTER_FIXED_REMOVE = 'flexcss.fixedWindow.afterRemove';\n\t\n\t/**\n\t * @type {FixedWindow}\n\t */\n\tvar fixedWindowInstance = void 0;\n\t\n\tvar FixedWindow = function () {\n\t function FixedWindow() {\n\t _classCallCheck(this, FixedWindow);\n\t\n\t this.widgets = [];\n\t this.currentScrollTop = 0;\n\t this.fixedScreenConstraints = [];\n\t this.windowWidth = 0;\n\t this.isFixedWindowActive = false;\n\t this.touchListener = null;\n\t }\n\t\n\t /**\n\t * Adds a constraint to detect if the window needs to be changed when the screensize changes\n\t *\n\t * @param {Function} widget\n\t * @param {Function} fixedBreakpointFn gets a width argument, return true to open a window\n\t */\n\t\n\t\n\t _createClass(FixedWindow, [{\n\t key: 'addScreenConstraint',\n\t value: function addScreenConstraint(widget, fixedBreakpointFn) {\n\t this.fixedScreenConstraints[widget] = fixedBreakpointFn;\n\t }\n\t\n\t /**\n\t * @returns {null|DestroyableWidget}\n\t */\n\t\n\t }, {\n\t key: 'getCurrentWidget',\n\t value: function getCurrentWidget() {\n\t return this.widgets.length > 0 ? this.widgets[this.widgets.length - 1] : null;\n\t }\n\t\n\t /**\n\t * @private\n\t */\n\t\n\t }, {\n\t key: '_checkFixedNeeded',\n\t value: function _checkFixedNeeded() {\n\t var _this = this;\n\t\n\t if (this.widgets.length === 0) {\n\t return;\n\t }\n\t var widgets = new Set(this.widgets);\n\t var widgetsThatRequireFixedWindow = Array.from(widgets).some(function (_ref) {\n\t var widget = _ref.widget;\n\t\n\t return _this.fixedScreenConstraints[widget] && _this.fixedScreenConstraints[widget](_this.windowWidth);\n\t });\n\t if (!widgetsThatRequireFixedWindow) {\n\t this._removeFixedContainer();\n\t } else {\n\t this._addFixedContainer();\n\t }\n\t }\n\t\n\t /**\n\t * @private\n\t */\n\t\n\t }, {\n\t key: '_addFixedContainer',\n\t value: function _addFixedContainer() {\n\t var _this2 = this;\n\t\n\t if (this.isFixedWindowActive) {\n\t return;\n\t }\n\t _Event2.default.dispatchAndFire(global.document, EVENT_BEFORE_FIXED_ADD, {\n\t detail: this.getCurrentWidget()\n\t });\n\t // this causes layout and should be optimized\n\t // At lest we write in a batch later\n\t _Settings2.default.get().scrollbarUpdateNodes.map(function (n) {\n\t var foundProperty = 'paddingRight';\n\t var direction = 1;\n\t var node = n;\n\t if (n instanceof Array) {\n\t var _n = _slicedToArray(n, 3);\n\t\n\t var whatNode = _n[0];\n\t var property = _n[1];\n\t var d = _n[2];\n\t\n\t foundProperty = property;\n\t node = whatNode;\n\t direction = d || 1;\n\t }\n\t return {\n\t node: node,\n\t property: foundProperty,\n\t value: parseInt(global.getComputedStyle(node)[foundProperty], 10) + (!node.__fixedWindowMod__ ? _Settings2.default.getScrollbarWidth() * direction : 0) + 'px'\n\t };\n\t }).forEach(function (d) {\n\t d.node.__fixedWindowMod__ = true;\n\t d.node.style[d.property] = d.value;\n\t });\n\t\n\t this.touchListener = function (e) {\n\t e.preventDefault();\n\t };\n\t\n\t var shouldNotMove = false;\n\t this.touchStartListener = function (e) {\n\t var _getCurrentWidget = _this2.getCurrentWidget();\n\t\n\t var element = _getCurrentWidget.element;\n\t\n\t if (_Util2.default.isPartOfNode(e.target, element)) {\n\t if (element.scrollTop === 0) {\n\t element.scrollTop = 1;\n\t shouldNotMove = true;\n\t } else if (element.scrollHeight === element.scrollTop + element.offsetHeight) {\n\t shouldNotMove = true;\n\t element.scrollTop -= 1;\n\t }\n\t }\n\t };\n\t\n\t global.addEventListener('touchmove', this.touchListener);\n\t global.document.body.addEventListener('touchstart', this.touchStartListener);\n\t\n\t this.touchMoveListener = function (e) {\n\t var _getCurrentWidget2 = _this2.getCurrentWidget();\n\t\n\t var element = _getCurrentWidget2.element;\n\t\n\t if (_Util2.default.isPartOfNode(e.target, element)) {\n\t if (!shouldNotMove) {\n\t e.stopImmediatePropagation();\n\t }\n\t shouldNotMove = false;\n\t }\n\t };\n\t global.document.body.addEventListener('touchmove', this.touchMoveListener);\n\t\n\t global.document.documentElement.classList.add(CLS_FIXED_WINDOW);\n\t this.isFixedWindowActive = true;\n\t }\n\t\n\t /**\n\t * @private\n\t */\n\t\n\t }, {\n\t key: '_removeFixedContainer',\n\t value: function _removeFixedContainer() {\n\t if (this.isFixedWindowActive) {\n\t // cleanup event listeners\n\t global.removeEventListener('touchmove', this.touchListener);\n\t global.document.body.removeEventListener('touchstart', this.touchStartListener);\n\t global.document.body.removeEventListener('touchmove', this.touchMoveListener);\n\t\n\t // reset scrollbar nodes\n\t _Settings2.default.get().scrollbarUpdateNodes.forEach(function (node) {\n\t if (node instanceof Array) {\n\t var _node = _slicedToArray(node, 2);\n\t\n\t var whatNode = _node[0];\n\t var property = _node[1];\n\t\n\t delete whatNode.__fixedWindowMod__;\n\t whatNode.style[property] = '';\n\t } else {\n\t delete node.__fixedWindowMod__;\n\t node.style.paddingRight = '';\n\t }\n\t });\n\t global.document.documentElement.classList.remove(CLS_FIXED_WINDOW);\n\t _Event2.default.dispatchAndFire(global.document, EVENT_AFTER_FIXED_REMOVE);\n\t this.isFixedWindowActive = false;\n\t }\n\t }\n\t\n\t /**\n\t * Will close a window when no widgets are opened that need one\n\t */\n\t\n\t }, {\n\t key: 'resizeListener',\n\t value: function resizeListener() {\n\t this.windowWidth = global.innerWidth;\n\t this._checkFixedNeeded();\n\t }\n\t\n\t /**\n\t * @returns {FixedWindow}\n\t */\n\t\n\t }, {\n\t key: 'close',\n\t\n\t\n\t /**\n\t * Request a close of the fixed window\n\t */\n\t value: function close() {\n\t this.widgets.pop();\n\t if (this.widgets.length === 0) {\n\t this._removeFixedContainer();\n\t resolve();\n\t }\n\t }\n\t\n\t /**\n\t * Request to open a fixed windows\n\t * @param {Object|DestroyableWidget} instance\n\t * @param {HTMLElement} element\n\t */\n\t\n\t }, {\n\t key: 'open',\n\t value: function open(instance, element) {\n\t var fixed = false;\n\t if ((typeof instance === 'undefined' ? 'undefined' : _typeof(instance)) === 'object') {\n\t var widget = instance.constructor;\n\t var fixedWidget = this.fixedScreenConstraints[instance.constructor];\n\t if (widget && fixedWidget) {\n\t fixed = fixedWidget(this.windowWidth);\n\t }\n\t var length = this.widgets.length;\n\t this.widgets.push({\n\t widget: widget,\n\t element: element\n\t });\n\t // open a new window if there is no window active\n\t if (length === 0) {\n\t if (fixed) {\n\t this._addFixedContainer();\n\t }\n\t }\n\t }\n\t }\n\t }], [{\n\t key: 'getInstance',\n\t value: function getInstance() {\n\t if (!fixedWindowInstance) {\n\t fixedWindowInstance = new FixedWindow();\n\t fixedWindowInstance.windowWidth = global.innerWidth;\n\t var eventHandler = fixedWindowInstance.resizeListener.bind(fixedWindowInstance);\n\t global.addEventListener('resize', (0, _debounce2.default)(eventHandler, 500));\n\t global.addEventListener('orientationchange', eventHandler);\n\t }\n\t return fixedWindowInstance;\n\t }\n\t }]);\n\t\n\t return FixedWindow;\n\t}();\n\n\texports.default = FixedWindow;\n\t/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))\n\n/***/ },\n/* 8 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t/* WEBPACK VAR INJECTION */(function(global) {'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports.EVENT_MODAL_ASYNC_TARGET_LOADED = exports.EVENT_MODAL_INIT = exports.EVENT_MODAL_OPENED = exports.EVENT_MODAL_BEFORE_CLOSED = exports.EVENT_MODAL_CLOSED = undefined;\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /*\n\t * The MIT License (MIT)\n\t *\n\t * Copyright (c) 2015 David Heidrich, BowlingX \n\t *\n\t * Permission is hereby granted, free of charge, to any person obtaining a copy\n\t * of this software and associated documentation files (the \"Software\"), to deal\n\t * in the Software without restriction, including without limitation the rights\n\t * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n\t * copies of the Software, and to permit persons to whom the Software is\n\t * furnished to do so, subject to the following conditions:\n\t *\n\t * The above copyright notice and this permission notice shall be included in\n\t * all copies or substantial portions of the Software.\n\t *\n\t * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n\t * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n\t * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n\t * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n\t * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n\t * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n\t * THE SOFTWARE.\n\t */\n\t\n\t/*!\n\t * FlexCss.Modal\n\t * Licensed under the MIT License (MIT)\n\t * Copyright (c) 2015 David Heidrich, BowlingX \n\t */\n\t\n\t/* global KeyboardEvent */\n\t\n\tvar _Settings = __webpack_require__(2);\n\t\n\tvar _Settings2 = _interopRequireDefault(_Settings);\n\t\n\tvar _Event = __webpack_require__(3);\n\t\n\tvar _Event2 = _interopRequireDefault(_Event);\n\t\n\tvar _Util = __webpack_require__(1);\n\t\n\tvar _Util2 = _interopRequireDefault(_Util);\n\t\n\tvar _Widget = __webpack_require__(4);\n\t\n\tvar _Widget2 = _interopRequireDefault(_Widget);\n\t\n\tvar _FixedWindow = __webpack_require__(7);\n\t\n\tvar _FixedWindow2 = _interopRequireDefault(_FixedWindow);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tvar HTML_ELEMENT = global.document.documentElement;\n\tvar KEY_ESC = 27;\n\t/* Attribute Names */\n\tvar ATTR_CREATE_NEW = 'data-new-instance';\n\tvar ATTR_CLOSE = 'data-close-modal';\n\tvar ATTR_NAME = 'data-modal';\n\t\n\t/* Class names */\n\tvar CLS_CONTAINER_CURRENT = 'front';\n\tvar CLS_OPEN = 'open';\n\tvar CLS_CURRENT = 'current';\n\tvar CLS_PART_OF_STACK = 'part-of-stack';\n\tvar CLS_MODAL_OPEN = 'modal-open';\n\tvar CLS_MODAL_CONTAINER = 'modal-container';\n\tvar CLS_ANIM_END = 'modal-anim-end';\n\tvar CLS_LOADER_CONTAINER = 'loader-container';\n\tvar CLS_LOADER = 'loader';\n\t\n\t/* Events */\n\t\n\t/**\n\t * Event triggered when modal is closed\n\t * @type {string}\n\t */\n\tvar EVENT_MODAL_CLOSED = exports.EVENT_MODAL_CLOSED = 'flexcss.modal.closed';\n\t/**\n\t * Event triggered before a modal is closed, cancelable\n\t * @type {string}\n\t */\n\tvar EVENT_MODAL_BEFORE_CLOSED = exports.EVENT_MODAL_BEFORE_CLOSED = 'flexcss.modal.beforeClose';\n\t/**\n\t * Event triggered when a modal is opened\n\t * @type {string}\n\t */\n\tvar EVENT_MODAL_OPENED = exports.EVENT_MODAL_OPENED = 'flexcss.modal.opened';\n\t\n\t/**\n\t * Event triggered when modal is initilized, called on target\n\t * @type {string}\n\t */\n\tvar EVENT_MODAL_INIT = exports.EVENT_MODAL_INIT = 'flexcss.modal.init';\n\t\n\t/**\n\t * Triggered when the content of an async modal on a target is loaded, called on target\n\t * @type {string}\n\t */\n\tvar EVENT_MODAL_ASYNC_TARGET_LOADED = exports.EVENT_MODAL_ASYNC_TARGET_LOADED = 'flexcss.modal.asyncTargetLoaded';\n\t\n\t/**\n\t * A Modal Implementation\n\t */\n\t\n\tvar Modal = function () {\n\t function Modal(DelegateContainer, options) {\n\t _classCallCheck(this, Modal);\n\t\n\t var doc = global.document;\n\t var container = DelegateContainer instanceof HTMLElement ? DelegateContainer : doc.getElementById(DelegateContainer);\n\t\n\t // Instance vars:\n\t if (!container) {\n\t throw new Error('Could not found container element by given ID/Element: ' + DelegateContainer);\n\t }\n\t\n\t this.currentOpen = null;\n\t\n\t this.loading = false;\n\t\n\t this.container = container;\n\t\n\t /**\n\t * Default Options\n\t */\n\t this.options = {\n\t classNames: 'modal',\n\t closeOnEscape: true,\n\t closeOnBackgroundClick: true,\n\t destroyOnFinish: false,\n\t fixedContainer: true,\n\t containerClassNames: ''\n\t };\n\t\n\t Object.assign(this.options, options);\n\t\n\t // Container where events are delegated\n\t this.eventContainer = null;\n\t this.eventFunction = null;\n\t\n\t this.dataMainPageContainer = global.document.body;\n\t\n\t this.currentScrollTop = 0;\n\t\n\t this.modalContainer = null;\n\t\n\t // Destroy full modal instance when no dialogs are bind to?\n\t // Otherwise container is recycled\n\t this.destroyOnFinish = this.options.destroyOnFinish;\n\t }\n\t\n\t /**\n\t * Removes this modal from global stack\n\t * Will handle fixing main html element too\n\t * @private\n\t * @param n\n\t */\n\t\n\t\n\t _createClass(Modal, [{\n\t key: '_removeModalFromStack',\n\t value: function _removeModalFromStack(n) {\n\t var t = Modal._modalInstances.indexOf(n);\n\t if (t > -1) {\n\t Modal._modalInstances.splice(t, 1);\n\t _FixedWindow2.default.getInstance().close();\n\t HTML_ELEMENT.classList.remove(CLS_MODAL_OPEN);\n\t }\n\t }\n\t\n\t /**\n\t * Modal container that contains all `stacked` modals for this instance\n\t * @returns {HTMLElement}\n\t */\n\t\n\t }, {\n\t key: 'getModalContainer',\n\t value: function getModalContainer() {\n\t return this.modalContainer;\n\t }\n\t\n\t /**\n\t * Closes the current open modal of this stack\n\t * @params [e], optional event\n\t * @returns {*}\n\t */\n\t\n\t }, {\n\t key: 'close',\n\t value: function close(e) {\n\t var self = this;\n\t\n\t var options = self.currentOpen ? _Util2.default.applyOptionsFromElement(self.currentOpen, _Util2.default.copy(self.options)) : self.options;\n\t\n\t // close only on keyboard if instance should\n\t if (!options.closeOnEscape && e instanceof KeyboardEvent) {\n\t return false;\n\t }\n\t\n\t // close only on background if instance should\n\t if (!options.closeOnBackgroundClick && e && e.type === _Settings2.default.getTabEvent() && !e.target.hasAttribute(ATTR_CLOSE)) {\n\t return false;\n\t }\n\t\n\t // if an instance is currently loading, prevent from closing\n\t if (self.loading) {\n\t return false;\n\t }\n\t\n\t if (e) {\n\t e.preventDefault();\n\t }\n\t\n\t if (self.currentOpen) {\n\t // dispatch beforeClose event, if prevented prevent modal from closing\n\t var ev = _Event2.default.dispatchAndFire(self.currentOpen, EVENT_MODAL_BEFORE_CLOSED);\n\t if (ev.defaultPrevented) {\n\t return false;\n\t }\n\t\n\t this._finishState(self.currentOpen);\n\t // if there is an previous modal\n\t if (self.currentOpen.prevModal) {\n\t // switch to the next modal\n\t return self.switchModals(self.currentOpen.prevModal, self.currentOpen.prevModal.prevModal || null);\n\t }\n\t\n\t // finally trigger closed event\n\t _Event2.default.dispatch(self.currentOpen, EVENT_MODAL_CLOSED).withOriginal(e).fire();\n\t }\n\t self._removeModalFromStack(self.currentOpen);\n\t\n\t // Full stack closed:\n\t self.currentOpen = null;\n\t if (self.modalContainer) {\n\t // setup next open\n\t var lastContainer = Modal._modalInstances[Modal._modalInstances.length - 1],\n\t classList = self.modalContainer.classList;\n\t classList.remove(CLS_CONTAINER_CURRENT);\n\t classList.remove(CLS_OPEN);\n\t // Remove all current classes from child-nodes\n\t for (var i = 0; i < self.modalContainer.childNodes.length; i++) {\n\t var node = self.modalContainer.childNodes[i],\n\t cl = node.classList;\n\t // remove applied styles\n\t self._finishState(node);\n\t cl.remove(CLS_CURRENT);\n\t cl.remove(CLS_PART_OF_STACK);\n\t }\n\t if (lastContainer) {\n\t lastContainer.parentNode.classList.add(CLS_CONTAINER_CURRENT);\n\t }\n\t }\n\t\n\t if (self.destroyOnFinish) {\n\t self.destroy();\n\t }\n\t return self;\n\t }\n\t\n\t /**\n\t * Resets a target when newly initilizes\n\t * @param target\n\t * @private\n\t */\n\t\n\t }, {\n\t key: '_finishState',\n\t value: function _finishState(target) {\n\t target.classList.remove(CLS_ANIM_END);\n\t }\n\t\n\t /**\n\t * Handler called when a Modal has finished an animation\n\t * @param e\n\t * @param self\n\t * @private\n\t */\n\t\n\t }, {\n\t key: '_finishAnim',\n\t value: function _finishAnim(e, self) {\n\t e.target.classList.add(CLS_ANIM_END);\n\t e.target.removeEventListener(e.type, self, true);\n\t }\n\t\n\t /**\n\t * Brings the given modal to front\n\t * @param co\n\t * @param last\n\t */\n\t\n\t }, {\n\t key: 'switchModals',\n\t value: function switchModals(co, last) {\n\t co.prevModal = last;\n\t Modal._modalInstances.push(co);\n\t _FixedWindow2.default.getInstance().open(this, this.modalContainer);\n\t if (last) {\n\t this._finishState(last);\n\t _Util2.default.prefixedAnimateEvent(last, 'AnimationEnd', this._finishAnim);\n\t last.classList.add(CLS_PART_OF_STACK);\n\t }\n\t // set new currentOpen\n\t this.currentOpen = co;\n\t\n\t // bring current container to the front\n\t var instances = Modal._modalInstances;\n\t\n\t for (var m = 0; m < instances.length; m++) {\n\t instances[m].parentNode.classList.remove(CLS_CONTAINER_CURRENT);\n\t }\n\t this.modalContainer.classList.add(CLS_CONTAINER_CURRENT);\n\t // remove animations if animations has been completed, fixes various bugs:\n\t // - fixes nested scrolling element issue in iOS Browsers / Mobile-Safari\n\t _Util2.default.prefixedAnimateEvent(co, 'AnimationEnd', this._finishAnim);\n\t\n\t for (var i = 0; i < this.modalContainer.childNodes.length; i++) {\n\t var n = this.modalContainer.childNodes[i],\n\t isCurrent = n.classList.contains(CLS_CURRENT);\n\t if (n === co) {\n\t co.classList.add(CLS_CURRENT);\n\t co.classList.remove(CLS_PART_OF_STACK);\n\t this._finishState(co);\n\t } else {\n\t n.classList.remove(CLS_CURRENT);\n\t if (isCurrent) {\n\t this._removeModalFromStack(n);\n\t _Event2.default.dispatchAndFire(n, EVENT_MODAL_CLOSED);\n\t }\n\t }\n\t }\n\t }\n\t }, {\n\t key: 'handleScrollbar',\n\t value: function handleScrollbar() {\n\t if (Modal._modalInstances.length === 0) {\n\t HTML_ELEMENT.classList.add(CLS_MODAL_OPEN);\n\t }\n\t }\n\t\n\t /**\n\t * Creates a Modal and opens it (later)\n\t * @param e\n\t * @returns {Promise|boolean}\n\t */\n\t\n\t }, {\n\t key: 'createWidget',\n\t value: function createWidget(e) {\n\t var self = this;\n\t if (this.loading) {\n\t return false;\n\t }\n\t\n\t // check if another modal has registered events on this dom path:\n\t if (e && e.target) {\n\t var foundInstance = _Util2.default.parentsUntil(e.target, function (node) {\n\t return node && node.flexModalInstance;\n\t });\n\t\n\t // if another instance has been found, abort\n\t if (foundInstance !== this.container) {\n\t return false;\n\t }\n\t }\n\t var targetContent,\n\t future,\n\t widget,\n\t target,\n\t hasTarget = true,\n\t isHtmlElement = e instanceof HTMLElement,\n\t isWidget = _Widget2.default.isWidget(e);\n\t if (isHtmlElement || isWidget) {\n\t if (isHtmlElement) {\n\t targetContent = e;\n\t } else {\n\t widget = e;\n\t targetContent = widget.element;\n\t }\n\t } else {\n\t target = e.target;\n\t if (!target) {\n\t throw 'Could not find target, did you pass an event, a HTMLElement or an Widget?';\n\t }\n\t hasTarget = target.hasAttribute(ATTR_NAME);\n\t targetContent = target.getAttribute(ATTR_NAME);\n\t widget = _Widget2.default.findWidget(target);\n\t if (target.hasAttribute(ATTR_CREATE_NEW) && !e.newInstance) {\n\t var newInstance = new Modal(this.container).setDestroyOnFinish(true);\n\t e.newInstance = true;\n\t newInstance.fromEvent(e).then(function () {\n\t newInstance.registerEvents(newInstance.getModalContainer());\n\t });\n\t return false;\n\t }\n\t if (hasTarget) {\n\t e.stopImmediatePropagation();\n\t e.preventDefault();\n\t }\n\t }\n\t\n\t if (!hasTarget) {\n\t return false;\n\t }\n\t\n\t var modalContainerClasses = this.modalContainer ? this.modalContainer.classList : [];\n\t\n\t // lazy create modal container\n\t if (!this.modalContainer) {\n\t this.modalContainer = global.document.createElement('div');\n\t this.modalContainer.className = CLS_MODAL_CONTAINER + ' ' + this.options.containerClassNames + ' ' + CLS_OPEN;\n\t var closeModalFunction = function closeModalFunction(ce) {\n\t if (self.loading) {\n\t return false;\n\t }\n\t if (_Util2.default.isPartOfNode(ce.target, self.currentOpen)) {\n\t if (!ce.target.hasAttribute(ATTR_CLOSE)) {\n\t return false;\n\t }\n\t }\n\t self.close(ce);\n\t };\n\t\n\t this.modalContainer.addEventListener(_Settings2.default.getTabEvent(), closeModalFunction, false);\n\t\n\t modalContainerClasses = this.modalContainer.classList;\n\t this.container.appendChild(this.modalContainer);\n\t } else {\n\t modalContainerClasses.add(CLS_OPEN);\n\t }\n\t\n\t var loader = void 0,\n\t doc = global.document,\n\t toggleLoader = function toggleLoader(show) {\n\t if (show) {\n\t loader = doc.createElement('div');\n\t loader.className = CLS_LOADER_CONTAINER;\n\t var loaderLoader = doc.createElement('div');\n\t loaderLoader.className = CLS_LOADER;\n\t loader.appendChild(loaderLoader);\n\t self.modalContainer.appendChild(loader);\n\t } else {\n\t loader.parentNode.removeChild(loader);\n\t }\n\t };\n\t\n\t this.handleScrollbar();\n\t\n\t modalContainerClasses.add(CLS_CONTAINER_CURRENT);\n\t modalContainerClasses.add('loading');\n\t this.loading = true;\n\t toggleLoader(true);\n\t var async = widget ? widget.getAsync() : null;\n\t if (_Widget2.default.isWidget(widget) && async) {\n\t future = async.then(function (r) {\n\t var result;\n\t if (r instanceof HTMLElement || r instanceof DocumentFragment) {\n\t result = r;\n\t } else {\n\t // Create container Element:\n\t var element = doc.createElement('div');\n\t element.className = self.options.classNames;\n\t element.innerHTML = r;\n\t element.id = _Util2.default.guid();\n\t result = element;\n\t }\n\t widget.finalContent = result;\n\t _Event2.default.dispatchAndFire(target, EVENT_MODAL_ASYNC_TARGET_LOADED);\n\t return result;\n\t });\n\t } else {\n\t var el = targetContent instanceof HTMLElement || targetContent instanceof DocumentFragment ? targetContent : doc.getElementById(targetContent);\n\t if (el) {\n\t future = new Promise(function (resolve) {\n\t resolve(el);\n\t });\n\t } else {\n\t throw 'Could not found given modal element (content) with ID: ' + targetContent;\n\t }\n\t }\n\t\n\t _Event2.default.dispatchAndFire(target, EVENT_MODAL_INIT);\n\t\n\t return future.then(function (thisEl) {\n\t thisEl.hfWidgetInstance = self;\n\t self.modalContainer.appendChild(thisEl);\n\t modalContainerClasses.remove('loading');\n\t self.loading = false;\n\t toggleLoader(false);\n\t\n\t self.open(thisEl, true, e);\n\t\n\t return thisEl;\n\t });\n\t }\n\t\n\t /**\n\t * Open's an already rendered modal\n\t * @param {HTMLElement} modal\n\t * @param {Boolean} [internal], set to true to prevent container management\n\t * @param {Boolean} [maybeEvent], optional event-object that triggered open\n\t */\n\t\n\t }, {\n\t key: 'open',\n\t value: function open(modal, internal, maybeEvent) {\n\t\n\t if (!internal) {\n\t this.modalContainer.classList.add('open');\n\t this.handleScrollbar();\n\t }\n\t this.switchModals(modal, this.currentOpen);\n\t\n\t _Event2.default.dispatch(modal, EVENT_MODAL_OPENED).withOriginal(maybeEvent).fire();\n\t }\n\t }, {\n\t key: 'registerEvents',\n\t value: function registerEvents(delegate) {\n\t var delegateContainer = delegate || this.container,\n\t self = this;\n\t // Modals should always be fixed\n\t _FixedWindow2.default.getInstance().addScreenConstraint(Modal, function (width) {\n\t return true;\n\t });\n\t // register modal instance so we can detect multiple registrars\n\t delegateContainer.flexModalInstance = self;\n\t self.eventFunction = function () {\n\t self.createWidget.apply(self, arguments);\n\t };\n\t delegateContainer.addEventListener(_Settings2.default.getTabEvent(), self.eventFunction, false);\n\t\n\t self.eventContainer = delegateContainer;\n\t return self;\n\t }\n\t\n\t /**\n\t * Creates a new Dialog Instance either directly from HTML Element or a Widget instance\n\t * @param {HTMLElement|Widget} widget instance or html element\n\t * @returns {Promise}\n\t */\n\t\n\t }, {\n\t key: 'fromWidget',\n\t value: function fromWidget(widget) {\n\t return this.createWidget(widget);\n\t }\n\t\n\t /**\n\t * Creates a Widget from event\n\t * @param e\n\t * @returns {Promise}\n\t */\n\t\n\t }, {\n\t key: 'fromEvent',\n\t value: function fromEvent(e) {\n\t return this.createWidget(e);\n\t }\n\t }, {\n\t key: 'setDestroyOnFinish',\n\t value: function setDestroyOnFinish(v) {\n\t this.destroyOnFinish = v;\n\t return this;\n\t }\n\t\n\t /**\n\t * Destroy this widget instance, cleans empty DOM nodes\n\t * Will use fast MutationObserver if available, otherwise falls back to DOMNodeRemoved event\n\t */\n\t\n\t }, {\n\t key: 'destroy',\n\t value: function destroy() {\n\t var self = this,\n\t modalContainer = this.modalContainer;\n\t var isEmptyContainer = modalContainer.childNodes.length === 0;\n\t // Remove event listener on destroy, do not remove DOM node\n\t if (self.eventContainer) {\n\t self.eventContainer.removeEventListener(_Settings2.default.getTabEvent(), self.eventFunction, true);\n\t }\n\t\n\t if (isEmptyContainer) {\n\t if (modalContainer.parentNode) {\n\t modalContainer.parentNode.removeChild(modalContainer);\n\t }\n\t }\n\t if (global.MutationObserver) {\n\t var observer = new MutationObserver(function (mutations) {\n\t mutations.forEach(function () {\n\t if (isEmptyContainer) {\n\t modalContainer.parentNode.removeChild(modalContainer);\n\t observer.disconnect();\n\t }\n\t });\n\t });\n\t observer.observe(modalContainer, { childList: true });\n\t } else {\n\t modalContainer.addEventListener('DOMNodeRemoved', function (e) {\n\t if (e.target !== modalContainer && modalContainer.childNodes.length - 1 === 0) {\n\t modalContainer.parentNode.removeChild(modalContainer);\n\t }\n\t });\n\t }\n\t }\n\t }]);\n\t\n\t return Modal;\n\t}();\n\t\n\t// Static variable that keeps track of all open modals\n\t\n\t\n\tModal._modalInstances = [];\n\t\n\t// Global keydown listener for modal\n\tglobal.addEventListener('keydown', function (e) {\n\t if (e.keyCode === KEY_ESC) {\n\t var lastModal = Modal._modalInstances[Modal._modalInstances.length - 1];\n\t if (lastModal) {\n\t _Widget2.default.findWidget(lastModal).close(e);\n\t }\n\t }\n\t});\n\t\n\texports.default = Modal;\n\t/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))\n\n/***/ },\n/* 9 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t/* WEBPACK VAR INJECTION */(function(global) {'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports.EVENT_FORM_AJAX_COMPLETED = exports.EVENT_FORM_AFTER_AJAX_SUBMIT = exports.EVENT_FORM_SUBMIT = exports.EVENT_FORM_READY = undefined;\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\t\n\tvar _Tooltip = __webpack_require__(6);\n\t\n\tvar _Tooltip2 = _interopRequireDefault(_Tooltip);\n\t\n\t__webpack_require__(11);\n\t\n\tvar _Event = __webpack_require__(3);\n\t\n\tvar _Event2 = _interopRequireDefault(_Event);\n\t\n\tvar _Util = __webpack_require__(1);\n\t\n\tvar _Util2 = _interopRequireDefault(_Util);\n\t\n\tvar _Settings = __webpack_require__(2);\n\t\n\tvar _Settings2 = _interopRequireDefault(_Settings);\n\t\n\tvar _DestroyableWidget2 = __webpack_require__(5);\n\t\n\tvar _DestroyableWidget3 = _interopRequireDefault(_DestroyableWidget2);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /*global HTMLFormElement, fetch, FormData, clearTimeout, NodeList*/\n\t\n\t/*\n\t * The MIT License (MIT)\n\t *\n\t * Copyright (c) 2015 David Heidrich, BowlingX \n\t *\n\t * Permission is hereby granted, free of charge, to any person obtaining a copy\n\t * of this software and associated documentation files (the \"Software\"), to deal\n\t * in the Software without restriction, including without limitation the rights\n\t * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n\t * copies of the Software, and to permit persons to whom the Software is\n\t * furnished to do so, subject to the following conditions:\n\t *\n\t * The above copyright notice and this permission notice shall be included in\n\t * all copies or substantial portions of the Software.\n\t *\n\t * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n\t * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n\t * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n\t * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n\t * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n\t * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n\t * THE SOFTWARE.\n\t */\n\t\n\t/*!\n\t * FlexCss.Form\n\t * Licensed under the MIT License (MIT)\n\t * Copyright (c) 2015 David Heidrich, BowlingX \n\t */\n\t\n\tvar LOADING_CLASS = 'loading';\n\tvar DATA_ELEMENT_INVALID = 'data-flexcss-invalid';\n\tvar REMOTE = 'data-remote';\n\tvar REMOTE_ACTION = 'data-remote-action';\n\tvar ATTR_DISABLE_INLINE = 'data-disable-inline-validation';\n\tvar ATTR_DISABLE_REALTIME = 'data-disable-realtime-validation';\n\tvar ATTR_VALIDATOR = 'data-validate';\n\tvar ATTR_DATA_CUSTOM_MESSAGE = 'data-validation-message';\n\tvar ATTR_DATA_CUSTOM_LABEL = 'data-custom-label';\n\tvar ATTR_VALIDATE_VISIBILITY = 'data-validate-visibility';\n\tvar ATTR_ERROR_TARGET_ID = 'data-error-target';\n\tvar ATTR_DEPENDS = 'data-depends-selector';\n\tvar CONST_USE_JSON = 'json';\n\tvar CONST_REALTIME_EVENT = 'input';\n\tvar FOCUS_TOOLTIP_DELAY = 20;\n\tvar CLICK_TOOLTIP_DELAY = 150;\n\t\n\t/**\n\t * Triggered when form is fully initialized and handlers are binded\n\t * @type {string}\n\t */\n\tvar EVENT_FORM_READY = exports.EVENT_FORM_READY = 'flexcss.form.ready';\n\t/**\n\t * Fires when a form is submitted, cancelable\n\t * @type {string}\n\t */\n\tvar EVENT_FORM_SUBMIT = exports.EVENT_FORM_SUBMIT = 'flexcss.form.submit';\n\t/**\n\t * Fired directly after the form has been submitted via ajax\n\t * @type {string}\n\t */\n\tvar EVENT_FORM_AFTER_AJAX_SUBMIT = exports.EVENT_FORM_AFTER_AJAX_SUBMIT = 'flexcss.form.afterAjaxSubmit';\n\t/**\n\t * Fired when ajax events did complete\n\t * @type {string}\n\t */\n\tvar EVENT_FORM_AJAX_COMPLETED = exports.EVENT_FORM_AJAX_COMPLETED = 'flexcss.form.ajaxCompleted';\n\t\n\t/**\n\t * A HTML5 Form Validation replacement\n\t */\n\t\n\tvar Form = function (_DestroyableWidget) {\n\t _inherits(Form, _DestroyableWidget);\n\t\n\t /**\n\t * @param {HTMLElement} form\n\t * @param [options] optional options\n\t */\n\t\n\t function Form(form, options) {\n\t _classCallCheck(this, Form);\n\t\n\t var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(Form).call(this));\n\t\n\t if (!(form instanceof HTMLFormElement)) {\n\t throw 'argument {0} form needs to be an form element';\n\t }\n\t\n\t /**\n\t * The Form\n\t * @type {HTMLElement}\n\t */\n\t _this.form = form;\n\t\n\t /**\n\t * @type {Tooltip}\n\t */\n\t _this.tooltips = null;\n\t\n\t /**\n\t * @type {Promise}\n\t */\n\t _this.currentValidationFuture = new Promise(function () {});\n\t\n\t /**\n\t * Default options\n\t * @type {Object}\n\t */\n\t _this.options = {\n\t // if true creates tooltips above element, uses FlexCss Tooltips\n\t createTooltips: true,\n\t // if true appends error message after input element\n\t appendError: false,\n\t // type of ajax submit\n\t ajaxSubmitType: 'POST',\n\t // json content type if ajax method is set to json\n\t ajaxJsonContentType: 'application/json; charset=utf-8',\n\t // allow inline validation\n\t inlineValidation: true,\n\t // validate in realtime (on `input` event)\n\t realtime: true,\n\t // timeout when realtime event should be captured\n\t realtimeTimeout: 250,\n\t // formatting method for an error\n\t formatErrorTooltip: function formatErrorTooltip(error) {\n\t return ' ' + error;\n\t },\n\t // the class that will be put on the element to mark it failed validation\n\t inputErrorClass: 'invalid',\n\t // the container class for error messages below an element\n\t containerErrorClass: 'form-error',\n\t // additional options for fetch\n\t fetchOptions: {\n\t credentials: 'include'\n\t },\n\t // the container for tooltips\n\t tooltipContainer: form,\n\t tooltipOptions: {\n\t containerClass: 'error-tooltip'\n\t },\n\t // if you have a fixed header, either set a number or function here\n\t scrollToElementDiff: 0\n\t };\n\t\n\t // overwrite default options\n\t Object.assign(_this.options, options);\n\t\n\t // apply settings from attributes\n\t _Util2.default.applyOptionsFromElement(form, _this.options);\n\t\n\t // set form class as widget\n\t // Forms are very different to classical widgets,\n\t // we will not use our base widget class for this but just self\n\t form.hfWidgetInstance = _this;\n\t\n\t /**\n\t * A List of Validators\n\t * @type {Object}\n\t * @private\n\t */\n\t _this._validators = Form.globalValidators;\n\t\n\t /**\n\t * @type {Function}\n\t * @private\n\t */\n\t _this._remoteValidationFunction = null;\n\t\n\t _this.initFormValidation();\n\t return _this;\n\t }\n\t\n\t _createClass(Form, [{\n\t key: 'destroy',\n\t value: function destroy() {\n\t _get(Object.getPrototypeOf(Form.prototype), 'destroy', this).call(this);\n\t if (this.tooltips) {\n\t this.tooltips.destroy();\n\t }\n\t }\n\t\n\t /**\n\t * Submits this form, either via ajax or just classical (default)\n\t * @param {HTMLFormElement} thisForm\n\t * @param {Event} e\n\t * @private\n\t * @returns {Promise|boolean} returns false if submit is cancled\n\t */\n\t\n\t }, {\n\t key: '_submitFunction',\n\t value: function _submitFunction(thisForm, e) {\n\t var shouldUseAjax = thisForm.getAttribute(REMOTE),\n\t ajaxPostUrl = thisForm.getAttribute(REMOTE_ACTION) || thisForm.getAttribute('action') || window.location.href,\n\t useJson = CONST_USE_JSON === shouldUseAjax,\n\t self = this;\n\t\n\t var ev = _Event2.default.dispatch(thisForm, EVENT_FORM_SUBMIT).withOriginal(e).fire();\n\t\n\t // abort execution is event was prevented\n\t if (ev.defaultPrevented) {\n\t self._formStopLoading();\n\t return false;\n\t }\n\t\n\t if (shouldUseAjax === null) {\n\t // submit\n\t return thisForm.submit();\n\t }\n\t // prevent form from submit normally\n\t e.preventDefault();\n\t\n\t // add information that this is an XMLHttpRequest request (used by some frameworks)\n\t var defaultHeaders = {\n\t 'X-Requested-With': 'XMLHttpRequest'\n\t };\n\t\n\t // setup default headers\n\t if (useJson) {\n\t Object.assign(defaultHeaders, {\n\t 'Content-Type': this.options.ajaxJsonContentType\n\t });\n\t }\n\t var defaultOptions = Object.assign(this.options.fetchOptions, {\n\t headers: defaultHeaders,\n\t method: this.options.ajaxSubmitType\n\t });\n\t\n\t // support either JSON request payload or normal payload submission\n\t var serverCall = useJson ? fetch(ajaxPostUrl, Object.assign(defaultOptions, {\n\t body: JSON.stringify(this.serialize())\n\t })) : fetch(ajaxPostUrl, Object.assign(defaultOptions, {\n\t body: new FormData(thisForm)\n\t }));\n\t\n\t _Event2.default.dispatch(thisForm, EVENT_FORM_AFTER_AJAX_SUBMIT).withOriginal(e).fire();\n\t\n\t return serverCall.then(function (r) {\n\t (self._remoteValidationFunction || Form.globalRemoteValidationFunction).apply(self, [r]);\n\t\n\t _Event2.default.dispatch(thisForm, EVENT_FORM_AJAX_COMPLETED).withOriginal(e).withDetail({ response: r }).fire();\n\t // always remove error class\n\t self._formStopLoading();\n\t });\n\t }\n\t\n\t /**\n\t * Serializes a form to a json object\n\t * @returns {Object}\n\t */\n\t\n\t }, {\n\t key: 'serialize',\n\t value: function serialize() {\n\t var selectors = ['input[name]:not([type=\"radio\"]):enabled', 'input[type=\"radio\"][name]:checked', 'select[name]:enabled', 'textarea[name]:enabled'],\n\t inputs = this.form.querySelectorAll(selectors.join(',')),\n\t result = {};\n\t\n\t Array.prototype.forEach.call(inputs, function (input) {\n\t var exists = result[input.name],\n\t value = input.value;\n\t if (exists instanceof Array) {\n\t exists.push(value);\n\t } else if (exists) {\n\t result[input.name] = [result[input.name], value];\n\t } else {\n\t result[input.name] = value;\n\t }\n\t });\n\t\n\t return result;\n\t }\n\t\n\t /**\n\t * Handles the chain of validation on given fields\n\t *\n\t * @param {HTMLElement|Array|NodeList} field\n\t * @param [focus] optional focus first error\n\t * @returns {Promise}\n\t */\n\t\n\t }, {\n\t key: 'handleValidation',\n\t value: function handleValidation(field, focus) {\n\t var _this2 = this;\n\t\n\t var fields = field instanceof Array || field instanceof NodeList ? field : [field];\n\t return this._handleValidation(fields, focus, true).then(function (r) {\n\t if (!r.foundAnyError) {\n\t // remove tooltips\n\t if (_this2.tooltips) {\n\t _this2.tooltips.removeTooltip();\n\t }\n\t }\n\t return r;\n\t }.bind(this));\n\t }\n\t\n\t /**\n\t * Handles errors on given node list\n\t * @param {NodeList} toValidateFields\n\t * @param {boolean} focus\n\t * @param {boolean} scoped if true, will only validate the fields `invalidFields`\n\t * @returns {Promise}\n\t * @private\n\t */\n\t\n\t }, {\n\t key: '_handleValidation',\n\t value: function _handleValidation(toValidateFields, focus, scoped) {\n\t var self = this;\n\t var arr = Form._createArrayFromInvalidFieldList(toValidateFields),\n\t isLocalInvalid = arr.length > 0;\n\t // focus must appear in the same frame for iOS devices\n\t if (isLocalInvalid && focus) {\n\t self._focusElement(arr[0]);\n\t }\n\t var validation = scoped ? this._customValidationsForElements(toValidateFields) : self.validateCustomFields();\n\t return validation.then(function (r) {\n\t if (isLocalInvalid) {\n\t // combine browser and custom validators\n\t r.foundAnyError = true;\n\t }\n\t // get a unique field list of all fields that need to be checked and rendered\n\t // it's possible that we have duplicates in non scoped mode\n\t var thisToValidateFields = scoped ? toValidateFields : Array.from(arr).concat(r.checkedFields);\n\t r.checkedFields = thisToValidateFields;\n\t var foundInvalidFields = self.prepareErrors(thisToValidateFields, false),\n\t firstInvalidField = foundInvalidFields[0];\n\t if (firstInvalidField) {\n\t if (focus) {\n\t self._focusElement(firstInvalidField);\n\t // if element could not be focused:\n\t if (document.activeElement !== firstInvalidField) {\n\t self._handleTooltipHideClickAfterChange();\n\t }\n\t } else {\n\t self._handleTooltipHideClickAfterChange();\n\t }\n\t self.showAndOrCreateTooltip(firstInvalidField);\n\t }\n\t return r;\n\t });\n\t }\n\t\n\t /**\n\t * @param {HTMLElement} field\n\t * @param {ValidityState} validity\n\t * @returns {*}\n\t * @private\n\t */\n\t\n\t }, {\n\t key: '_setupErrorMessages',\n\t value: function _setupErrorMessages(field, validity) {\n\t return Form.globalErrorMessageHandler ? Form.globalErrorMessageHandler.apply(this, [field, validity]) : false;\n\t }\n\t\n\t /**\n\t * Handles class labels for elements\n\t * @param {Object} fields\n\t * @private\n\t */\n\t\n\t }, {\n\t key: '_handleLabels',\n\t value: function _handleLabels(fields) {\n\t Object.keys(fields).forEach(function (id) {\n\t var labels = this.getForm().querySelectorAll('[for=\"' + id + '\"]'),\n\t invalid = fields[id];\n\t if (labels.length) {\n\t for (var labelsIndex = 0; labelsIndex < labels.length; labelsIndex++) {\n\t var labelEl = labels[labelsIndex];\n\t // we can't use toggle attribute, not supported in IE\n\t if (invalid) {\n\t this._markElementInvalid(labelEl);\n\t } else {\n\t this._markElementValid(labelEl);\n\t }\n\t }\n\t }\n\t }.bind(this));\n\t }\n\t\n\t /**\n\t * @param el\n\t * @private\n\t */\n\t\n\t }, {\n\t key: '_markElementInvalid',\n\t value: function _markElementInvalid(el) {\n\t el.setAttribute(DATA_ELEMENT_INVALID, \"true\");\n\t el.classList.add(this.options.inputErrorClass);\n\t }\n\t\n\t /**\n\t * @param el\n\t * @private\n\t */\n\t\n\t }, {\n\t key: '_markElementValid',\n\t value: function _markElementValid(el) {\n\t el.removeAttribute(DATA_ELEMENT_INVALID);\n\t el.classList.remove(this.options.inputErrorClass);\n\t }\n\t\n\t /**\n\t * A List of invalid elements (:invalid)\n\t * @returns {Array}\n\t * @private\n\t */\n\t\n\t }, {\n\t key: '_getInvalidElements',\n\t value: function _getInvalidElements() {\n\t return Array.prototype.filter.call(this.getForm().querySelectorAll(\":invalid\"), function (r) {\n\t return !(r instanceof HTMLFieldSetElement);\n\t });\n\t }\n\t\n\t /**\n\t * @param {HTMLElement} thisParent\n\t * @private\n\t */\n\t\n\t }, {\n\t key: '_removeElementErrors',\n\t value: function _removeElementErrors(thisParent) {\n\t var errors = thisParent.querySelectorAll('.' + this.options.containerErrorClass),\n\t inputsWithErrorClasses = thisParent.querySelectorAll('[' + DATA_ELEMENT_INVALID + ']');\n\t for (var elementErrorIndex = 0; elementErrorIndex < errors.length; elementErrorIndex++) {\n\t errors[elementErrorIndex].parentNode.removeChild(errors[elementErrorIndex]);\n\t }\n\t for (var inputErrorIndex = 0; inputErrorIndex < inputsWithErrorClasses.length; inputErrorIndex++) {\n\t var el = inputsWithErrorClasses[inputErrorIndex];\n\t this._markElementValid(el);\n\t }\n\t }\n\t\n\t /**\n\t * Registers a custom validator\n\t * @param {String} name\n\t * @param {Function} validator a validation function should always return either a Future(true) or Future(false)\n\t * even when the field has been invalidated with `setCustomValidity`, because of different browser `bugs`\n\t * we can't rely on that\n\t * @returns {Form}\n\t */\n\t\n\t }, {\n\t key: 'registerValidator',\n\t value: function registerValidator(name, validator) {\n\t this._validators[name] = validator;\n\t return this;\n\t }\n\t\n\t /**\n\t * Runs async validation\n\t * @param {String} validationRef\n\t * @param {HTMLElement} field\n\t * @returns {Promise}\n\t * @private\n\t */\n\t\n\t }, {\n\t key: '_runValidation',\n\t value: function _runValidation(validationRef, field) {\n\t if (!this._validators[validationRef]) {\n\t throw 'Could not found validator: ' + validationRef;\n\t }\n\t var cl = field.classList,\n\t future = this._validators[validationRef].apply(this, [field, this.form]);\n\t cl.add(LOADING_CLASS);\n\t future.then(function () {\n\t cl.remove(LOADING_CLASS);\n\t });\n\t return future;\n\t }\n\t\n\t /**\n\t * Run custom validations for elements, validations are done async do support XHR Requests or other stuff\n\t *\n\t * @param {Array|NodeList} fields\n\t * @returns {Promise} contains either true if validations passed or false if something went wrong\n\t * @private\n\t */\n\t\n\t }, {\n\t key: '_customValidationsForElements',\n\t value: function _customValidationsForElements(fields) {\n\t var futures = [],\n\t fieldsLength = fields.length,\n\t checkedFields = [];\n\t for (var iVal = 0; iVal < fieldsLength; iVal++) {\n\t var field = fields[iVal],\n\t validationRef = field.getAttribute(ATTR_VALIDATOR),\n\t validity = field.validity;\n\t if (this._validators[validationRef]) {\n\t // use local validation first and then continue with custom validations\n\t if (Form._shouldNotValidateField(field) || validity && !validity.customError && !validity.valid) {\n\t continue;\n\t }\n\t checkedFields.push(field);\n\t futures.push(this._runValidation(validationRef, field));\n\t } else {\n\t if (validationRef) {\n\t console.warn('data-validate was set but no validator was found');\n\t }\n\t }\n\t }\n\t return Promise.all(futures).then(function (allFutures) {\n\t var l = allFutures.length;\n\t var result = {\n\t checkedFields: checkedFields,\n\t foundAnyError: false\n\t };\n\t for (var fI = 0; fI < l; fI++) {\n\t if (!allFutures[fI]) {\n\t result.foundAnyError = true;\n\t break;\n\t }\n\t }\n\t return result;\n\t });\n\t }\n\t\n\t /**\n\t * Remove all errors for this form\n\t * @returns {Form}\n\t */\n\t\n\t }, {\n\t key: 'removeErrors',\n\t value: function removeErrors() {\n\t this._removeElementErrors(this.form);\n\t if (this.tooltips) {\n\t this.tooltips.removeTooltip();\n\t }\n\t return this;\n\t }\n\t\n\t /**\n\t * Will handle errors for given fields\n\t * @param {Array|NodeList} fields\n\t * @param {Boolean} removeAllErrors\n\t */\n\t\n\t }, {\n\t key: 'prepareErrors',\n\t value: function prepareErrors(fields, removeAllErrors) {\n\t if (removeAllErrors) {\n\t this.removeErrors();\n\t }\n\t var labelGroups = {},\n\t invalidFields = [];\n\t\n\t function handleAdditionalLabels(isInvalid, thisLabelGroup, field) {\n\t var additionalLabels = field.getAttribute(ATTR_DATA_CUSTOM_LABEL) || field.id,\n\t group = thisLabelGroup[additionalLabels];\n\t if (additionalLabels) {\n\t // check additionally if field is currently marked as invalid\n\t // so the label is not marked as error if no field is marked as one\n\t group = group ? group : isInvalid;\n\t thisLabelGroup[additionalLabels] = group;\n\t }\n\t }\n\t\n\t // We save all validations in an extra property because we need to reset the validity due some\n\t // implementation errors in other browsers then chrome\n\t for (var i = 0; i < fields.length; i++) {\n\t var field = fields[i],\n\t errorTarget = Form._findErrorTarget(field),\n\t parent = errorTarget.parentNode,\n\t validity = field.validity,\n\t isInvalid = validity && !validity.valid;\n\t if (Form._shouldNotValidateField(field)) {\n\t continue;\n\t }\n\t field.flexFormsSavedValidity = JSON.parse(JSON.stringify(validity));\n\t handleAdditionalLabels(isInvalid, labelGroups, field);\n\t if (isInvalid) {\n\t if (!removeAllErrors) {\n\t // Remove current errors:\n\t this._removeElementErrors(parent);\n\t }\n\t // setup custom error messages:\n\t this._setupErrorMessages(field, validity);\n\t var msg = field.validationMessage;\n\t\n\t // mark fields as invalid\n\t this._markElementInvalid(errorTarget);\n\t this._markElementInvalid(field);\n\t\n\t if (this.options.appendError) {\n\t parent.insertAdjacentHTML(\"beforeend\", '
' + msg + '
');\n\t }\n\t invalidFields.push(field);\n\t field.flexFormsSavedValidationMessage = msg;\n\t } else {\n\t // restore invalid fields\n\t this._markElementValid(errorTarget);\n\t this._markElementValid(field);\n\t\n\t // cleanup\n\t delete field.flexFormsSavedValidationMessage;\n\t\n\t // remove error markup\n\t this._removeElementErrors(parent);\n\t }\n\t // We have to reset the custom validity here to allow native validations work again\n\t field.setCustomValidity('');\n\t }\n\t // if validates a single field we need to check the linked fields to a label:\n\t if (fields.length === 1) {\n\t var _field = fields[0];\n\t var id = _field.getAttribute(ATTR_DATA_CUSTOM_LABEL) || _field.id;\n\t if (id) {\n\t var linkedFields = Array.from(this.getForm().querySelectorAll('[' + ATTR_DATA_CUSTOM_LABEL + '=\"' + id + '\"], #' + id));\n\t linkedFields.forEach(function (thisField) {\n\t var validity = thisField.validity,\n\t isInvalid = validity && !validity.valid && this._isElementInvalidElement(thisField);\n\t handleAdditionalLabels(isInvalid, labelGroups, thisField);\n\t }.bind(this));\n\t }\n\t }\n\t this._handleLabels(labelGroups);\n\t return invalidFields;\n\t }\n\t\n\t /**\n\t * Validates all custom fields\n\t * @returns {Promise}\n\t */\n\t\n\t }, {\n\t key: 'validateCustomFields',\n\t value: function validateCustomFields() {\n\t return this._customValidationsForElements(this.form.querySelectorAll(\"[data-validate]\"));\n\t }\n\t\n\t /**\n\t * Tests if a field should be validated\n\t * @param {HTMLElement} field\n\t * @returns {boolean}\n\t * @private\n\t */\n\t\n\t }, {\n\t key: 'getForm',\n\t\n\t\n\t /**\n\t * This form\n\t * @returns {HTMLElement}\n\t */\n\t value: function getForm() {\n\t return this.form;\n\t }\n\t\n\t /**\n\t * Registers a function that handles remote validation\n\t * @param {Function} func\n\t * @returns {Form}\n\t */\n\t\n\t }, {\n\t key: 'registerRemoteValidation',\n\t value: function registerRemoteValidation(func) {\n\t this._remoteValidationFunction = func;\n\t return this;\n\t }\n\t\n\t /**\n\t * Formats the error content for the tooltip\n\t * @param {String} error\n\t * @returns {String}\n\t * @private\n\t */\n\t\n\t }, {\n\t key: '_formatErrorTooltip',\n\t value: function _formatErrorTooltip(error) {\n\t return this.options.formatErrorTooltip.apply(this, [error]);\n\t }\n\t\n\t /**\n\t * Tries to find a custom error target on given target\n\t * @param target\n\t * @returns {HTMLElement}\n\t * @private\n\t */\n\t\n\t }, {\n\t key: 'showAndOrCreateTooltip',\n\t\n\t\n\t /**\n\t * Creates a tooltip at given element, will only create a new instance if not created\n\t * @param {HTMLElement} target\n\t * @param {Boolean} [remove]\n\t */\n\t value: function showAndOrCreateTooltip(target, remove) {\n\t var self = this;\n\t if (!this.tooltips && this.options.createTooltips) {\n\t this.tooltips = new _Tooltip2.default(this.options.tooltipContainer, this.options.tooltipOptions);\n\t }\n\t if (!this.options.createTooltips) {\n\t return false;\n\t }\n\t\n\t if (!target.flexFormsSavedValidity) {\n\t return false;\n\t }\n\t var errorTarget = Form._findErrorTarget(target);\n\t if (!target.flexFormsSavedValidity.valid && self._isElementInvalidElement(errorTarget)) {\n\t self.tooltips.createTooltip(errorTarget, self._formatErrorTooltip(target.flexFormsSavedValidationMessage), false);\n\t return true;\n\t } else {\n\t if (remove) {\n\t self.tooltips.removeTooltip();\n\t }\n\t }\n\t return false;\n\t }\n\t\n\t /**\n\t * Checks if element is marked as invalid\n\t * @param {HTMLElement} el\n\t * @returns {boolean}\n\t * @private\n\t */\n\t\n\t }, {\n\t key: '_isElementInvalidElement',\n\t value: function _isElementInvalidElement(el) {\n\t return el.hasAttribute(DATA_ELEMENT_INVALID);\n\t }\n\t\n\t /**\n\t * Handles invalid event of a form\n\t * @param {Event} e\n\t * @returns {Promise|boolean}\n\t * @private\n\t */\n\t\n\t }, {\n\t key: '_checkIsInvalid',\n\t value: function _checkIsInvalid(e) {\n\t e.preventDefault();\n\t var invalidFields = this.getForm().querySelectorAll(\":invalid\");\n\t return this._handleValidation(invalidFields, true, false);\n\t }\n\t\n\t /**\n\t * Will query dependent fields (by selector) that should be validated with given field\n\t * @param field\n\t * @returns {NodeList|[]}\n\t * @private\n\t */\n\t\n\t }, {\n\t key: '_getDependentFields',\n\t value: function _getDependentFields(field) {\n\t var fieldSelector = field.getAttribute(ATTR_DEPENDS),\n\t base = [field];\n\t if (fieldSelector) {\n\t base.push.apply(base, Array.prototype.slice.apply(this.getForm().querySelectorAll(fieldSelector)));\n\t }\n\t return base;\n\t }\n\t\n\t /**\n\t * @private\n\t * @param {HTMLElement} [target]\n\t */\n\t\n\t }, {\n\t key: '_handleTooltipInline',\n\t value: function _handleTooltipInline(target) {\n\t if (this.tooltips) {\n\t this.tooltips.removeTooltip(target);\n\t }\n\t }\n\t\n\t /**\n\t * Initializes validation for a given form, registers event handlers\n\t */\n\t\n\t }, {\n\t key: 'initFormValidation',\n\t value: function initFormValidation() {\n\t var _this3 = this;\n\t\n\t // Suppress the default bubbles\n\t var form = this.getForm(),\n\t self = this,\n\t invalidEvent = 'invalid';\n\t\n\t /**\n\t * Validates if is valid realtime element\n\t * @param {HTMLElement} target\n\t * @returns {boolean}\n\t * @private\n\t */\n\t function _checkIsValidRealtimeElement(target) {\n\t return !target.hasAttribute(ATTR_DISABLE_REALTIME) && !target.hasAttribute(ATTR_DISABLE_INLINE);\n\t }\n\t\n\t form.addEventListener(invalidEvent, function (e) {\n\t e.preventDefault();\n\t }, true);\n\t\n\t _Util2.default.addEventOnce(invalidEvent, form, function handleInvalid(e) {\n\t self._formLoading();\n\t var result = self._checkIsInvalid(e);\n\t if (result) {\n\t self.currentValidationFuture = new Promise(function (resolve) {\n\t result.then(function (r) {\n\t setTimeout(function () {\n\t _Util2.default.addEventOnce(invalidEvent, form, handleInvalid, true);\n\t }, 0);\n\t resolve(r);\n\t self._formStopLoading();\n\t if (!r.foundAnyError) {\n\t self._formLoading();\n\t self._handleSubmit(e);\n\t }\n\t });\n\t });\n\t }\n\t }, true);\n\t\n\t this.addEventListener(form, 'reset', function () {\n\t _this3.removeErrors();\n\t });\n\t\n\t // Timeout for keys:\n\t var TIMEOUT_KEYDOWN,\n\t KEYDOWN_RUNNING = false;\n\t\n\t // resets keydown events\n\t function clearKeyDownTimeout() {\n\t KEYDOWN_RUNNING = false;\n\t clearTimeout(TIMEOUT_KEYDOWN);\n\t }\n\t\n\t // setup custom realtime event if given\n\t if (self.options.realtime) {\n\t this.addEventListener(form, CONST_REALTIME_EVENT, function (e) {\n\t if (self._formIsLoading()) {\n\t return;\n\t }\n\t var target = e.target;\n\t clearTimeout(TIMEOUT_KEYDOWN);\n\t if (KEYDOWN_RUNNING) {\n\t return;\n\t }\n\t TIMEOUT_KEYDOWN = setTimeout(function () {\n\t var isStillTarget = document.activeElement === e.target;\n\t if (!_checkIsValidRealtimeElement(target)) {\n\t return;\n\t }\n\t if (isStillTarget) {\n\t self._handleTooltipInline();\n\t }\n\t KEYDOWN_RUNNING = true;\n\t var dependentFields = self._getDependentFields(target);\n\t self._customValidationsForElements(dependentFields).then(function () {\n\t self.prepareErrors(dependentFields, false);\n\t if (isStillTarget) {\n\t self.showAndOrCreateTooltip(e.target);\n\t }\n\t // future must be resolved before another event can be started\n\t KEYDOWN_RUNNING = false;\n\t });\n\t }, self.options.realtimeTimeout);\n\t }, true);\n\t }\n\t\n\t /**\n\t * Validates if target is a valid input field to check blur and focus events\n\t *\n\t * @param {HTMLElement} target\n\t * @returns {boolean}\n\t * @private\n\t */\n\t function _checkIsValidBlurFocusElement(target) {\n\t var attr = target.getAttribute(\"type\");\n\t return attr !== \"radio\" && attr !== \"checkbox\" && attr !== \"submit\";\n\t }\n\t\n\t /**\n\t * Validates if is valid inline-check element\n\t * @param {HTMLElement} target\n\t * @returns {boolean}\n\t * @private\n\t */\n\t function _checkIsValidInlineCheckElement(target) {\n\t return !target.hasAttribute(ATTR_DISABLE_INLINE);\n\t }\n\t\n\t this.addEventListener(form, 'blur', function (e) {\n\t // do not hide tooltip after change event\n\t if (!e.target.flexcssKeepTooltips) {\n\t self._handleTooltipInline(e.target);\n\t }\n\t delete e.target.flexcssKeepTooltips;\n\t }, true);\n\t\n\t // handle focus on input elements\n\t // will show an error if field is invalid\n\t this.addEventListener(form, \"focus\", function (e) {\n\t if (self._formIsLoading()) {\n\t return;\n\t }\n\t // do not track errors for checkbox and radios on focus:\n\t if (!_checkIsValidBlurFocusElement(e.target)) {\n\t return;\n\t }\n\t // we need to delay this a little, because Firefox and Safari do not show a tooltip after it\n\t // just have been hidden (on blur). Maybe fix this with a queue later\n\t setTimeout(function () {\n\t self.showAndOrCreateTooltip(e.target);\n\t }, FOCUS_TOOLTIP_DELAY);\n\t }, true);\n\t\n\t if (self.options.inlineValidation) {\n\t // Handle change for checkbox, radios and selects\n\t this.addEventListener(form, \"change\", function (e) {\n\t var target = e.target;\n\t if (self._formIsLoading() || !_checkIsValidInlineCheckElement(target)) {\n\t return;\n\t }\n\t clearKeyDownTimeout();\n\t var name = target.getAttribute('name');\n\t var inputs = name ? form.querySelectorAll('[name=\"' + name + '\"]') : [target];\n\t // we only support dependent fields for a single widgets right now\n\t if (inputs.length === 1) {\n\t inputs = self._getDependentFields(target);\n\t }\n\t self._customValidationsForElements(inputs).then(function () {\n\t self.prepareErrors(inputs, false);\n\t target.flexcssKeepTooltips = self.showAndOrCreateTooltip(target, true);\n\t if (target.flexcssKeepTooltips) {\n\t self._handleTooltipHideClickAfterChange();\n\t }\n\t });\n\t });\n\t }\n\t\n\t // prevent default if form is invalid\n\t this.addEventListener(form, \"submit\", function listener(e) {\n\t self._submitListener(e, listener);\n\t });\n\t\n\t _Event2.default.dispatchAndFire(form, EVENT_FORM_READY);\n\t }\n\t\n\t /* Loading states, unfortunately we can't check if a promise is pending :/*/\n\t /* TODO: Maybe wrap promise to extend this functionality */\n\t\n\t }, {\n\t key: '_formLoading',\n\t value: function _formLoading() {\n\t this.getForm().classList.add(LOADING_CLASS);\n\t }\n\t }, {\n\t key: '_formStopLoading',\n\t value: function _formStopLoading() {\n\t this.getForm().classList.remove(LOADING_CLASS);\n\t }\n\t }, {\n\t key: '_formIsLoading',\n\t value: function _formIsLoading() {\n\t return this.getForm().classList.contains(LOADING_CLASS);\n\t }\n\t\n\t // this defines the logic after a change event when a tooltip is shown\n\t // because we call this method inside the change event, the click would be immeditally executed with the change\n\t // event when not using setTimeout(). There might be another solution for this...\n\t\n\t }, {\n\t key: '_handleTooltipHideClickAfterChange',\n\t value: function _handleTooltipHideClickAfterChange() {\n\t var self = this;\n\t if (this.options.createTooltips) {\n\t setTimeout(function () {\n\t _Util2.default.addEventOnce(_Settings2.default.getTabEvent(), global.document.body, function (t) {\n\t if (!self._isElementInvalidElement(t.target)) {\n\t self._handleTooltipInline();\n\t }\n\t });\n\t }, CLICK_TOOLTIP_DELAY);\n\t }\n\t }\n\t }, {\n\t key: '_focusElement',\n\t value: function _focusElement(el) {\n\t el.focus();\n\t _Util2.default.scrollToElement(el, this.options.scrollToElementDiff);\n\t }\n\t\n\t /**\n\t * Listener that is executed on form submit\n\t * @param e\n\t * @param submitListener\n\t * @returns {boolean}\n\t * @private\n\t */\n\t\n\t }, {\n\t key: '_submitListener',\n\t value: function _submitListener(e, submitListener) {\n\t\n\t var form = this.getForm(),\n\t self = this,\n\t submitEvent = 'submit';\n\t\n\t if (this._formIsLoading()) {\n\t e.preventDefault();\n\t return false;\n\t }\n\t this._formLoading();\n\t form.removeEventListener(submitEvent, submitListener);\n\t this.removeErrors();\n\t e.preventDefault();\n\t // reset:\n\t if (form.checkValidity()) {\n\t form.addEventListener(submitEvent, submitListener);\n\t // It's possible that the form is valid but the custom validations need to be checked again:\n\t self.currentValidationFuture = new Promise(function (resolve) {\n\t var validation = self.validateCustomFields();\n\t validation.then(function (r) {\n\t // because custom validators may mark multiple fields as invalid, we get all of them in the form\n\t var fields = self._getInvalidElements(),\n\t errors = self.prepareErrors(fields, false),\n\t firstError = errors[0];\n\t if (firstError) {\n\t self._focusElement(firstError);\n\t self.showAndOrCreateTooltip(firstError, true);\n\t }\n\t resolve(r);\n\t });\n\t });\n\t self.currentValidationFuture.then(function (r) {\n\t if (!r.foundAnyError) {\n\t // Handle submitting the form to server:\n\t self._handleSubmit(e);\n\t } else {\n\t self._formStopLoading();\n\t }\n\t });\n\t } else {\n\t self._formStopLoading();\n\t form.addEventListener(submitEvent, submitListener);\n\t }\n\t }\n\t\n\t /**\n\t * Handles submitting, optionally allows to stop submitting\n\t * @param e\n\t * @private\n\t */\n\t\n\t }, {\n\t key: '_handleSubmit',\n\t value: function _handleSubmit(e) {\n\t this._submitFunction(this.form, e);\n\t }\n\t\n\t /**\n\t * Registers a global event Handler\n\t * @param errorFunc\n\t */\n\t\n\t }], [{\n\t key: '_shouldNotValidateField',\n\t value: function _shouldNotValidateField(field) {\n\t var target = Form._findErrorTarget(field);\n\t return target instanceof HTMLFieldSetElement || field.validity === undefined || target.hasAttribute(ATTR_VALIDATE_VISIBILITY) && !_Util2.default.isVisible(target);\n\t }\n\t\n\t /**\n\t * Creates an array from a node list with invalid items\n\t * This Method expicitly checks if field should not be validated so it can be used to foucs a field\n\t * @param list\n\t * @returns {Array}\n\t * @private\n\t */\n\t\n\t }, {\n\t key: '_createArrayFromInvalidFieldList',\n\t value: function _createArrayFromInvalidFieldList(list) {\n\t var arr = [];\n\t for (var i = 0; i < list.length; ++i) {\n\t var n = list[i];\n\t if (n.validity && !n.validity.valid) {\n\t if (!Form._shouldNotValidateField(n)) {\n\t arr.push(n);\n\t }\n\t }\n\t }\n\t return arr;\n\t }\n\t }, {\n\t key: '_findErrorTarget',\n\t value: function _findErrorTarget(target) {\n\t var el = target.getAttribute(ATTR_ERROR_TARGET_ID) || target,\n\t foundTarget = el instanceof HTMLElement ? el : global.document.getElementById(el);\n\t if (!foundTarget) {\n\t throw 'Given error target did not exsits:' + target;\n\t }\n\t return foundTarget;\n\t }\n\t }, {\n\t key: 'registerErrorMessageHandler',\n\t value: function registerErrorMessageHandler(errorFunc) {\n\t Form.globalErrorMessageHandler = errorFunc;\n\t }\n\t\n\t /**\n\t * Initialize forms for a specific selector\n\t * @param {String} selector\n\t * @param {Object} [options]\n\t * @return {array.}\n\t */\n\t\n\t }, {\n\t key: 'init',\n\t value: function init(selector, options) {\n\t var forms = selector instanceof HTMLElement ? selector.querySelectorAll('form') : document.querySelectorAll(selector),\n\t instances = [];\n\t for (var i = 0; i < forms.length; i++) {\n\t instances.push(new Form(forms[i], options));\n\t }\n\t return instances;\n\t }\n\t\n\t /**\n\t * Registers a global validator that is usable on all form instances\n\t * @param {String} name\n\t * @param {Function} validator\n\t * @returns {Function}\n\t */\n\t\n\t }, {\n\t key: 'registerValidator',\n\t value: function registerValidator(name, validator) {\n\t Form.globalValidators[name] = validator;\n\t return Form;\n\t }\n\t\n\t /**\n\t * Registers a global function that is called when a form should validate the response of a server\n\t * @param {Function} func\n\t * @returns {Form}\n\t */\n\t\n\t }, {\n\t key: 'registerGlobalRemoteValidationFunction',\n\t value: function registerGlobalRemoteValidationFunction(func) {\n\t Form.globalRemoteValidationFunction = func;\n\t return Form;\n\t }\n\t }]);\n\t\n\t return Form;\n\t}(_DestroyableWidget3.default);\n\t\n\t/**\n\t * Global validators\n\t * @type {Array}\n\t */\n\t\n\t\n\tForm.globalValidators = [];\n\t\n\t/**\n\t * Global Remote validation function\n\t */\n\tForm.globalRemoteValidationFunction = function () {};\n\t\n\t/**\n\t * Handles custom error messages extracts custom message by default\n\t */\n\tForm.globalErrorMessageHandler = function (field, validity) {\n\t if (!validity.customError) {\n\t var customMsg = field.getAttribute(ATTR_DATA_CUSTOM_MESSAGE);\n\t if (customMsg) {\n\t field.setCustomValidity(customMsg);\n\t }\n\t }\n\t};\n\t\n\texports.default = Form;\n\t/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))\n\n/***/ },\n/* 10 */\n/***/ function(module, exports) {\n\n\t\"use strict\";\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\texports.default = function (fn, ms) {\n\t return function () {\n\t clearTimeout(fn.timeout);\n\t fn.timeout = setTimeout(fn, ms);\n\t };\n\t};\n\n/***/ },\n/* 11 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t// the whatwg-fetch polyfill installs the fetch() function\n\t// on the global object (window or self)\n\t//\n\t// Return that as the export for use in Webpack, Browserify etc.\n\t__webpack_require__(12);\n\tmodule.exports = self.fetch.bind(self);\n\n\n/***/ },\n/* 12 */\n/***/ function(module, exports) {\n\n\t(function(self) {\n\t 'use strict';\n\t\n\t if (self.fetch) {\n\t return\n\t }\n\t\n\t function normalizeName(name) {\n\t if (typeof name !== 'string') {\n\t name = String(name)\n\t }\n\t if (/[^a-z0-9\\-#$%&'*+.\\^_`|~]/i.test(name)) {\n\t throw new TypeError('Invalid character in header field name')\n\t }\n\t return name.toLowerCase()\n\t }\n\t\n\t function normalizeValue(value) {\n\t if (typeof value !== 'string') {\n\t value = String(value)\n\t }\n\t return value\n\t }\n\t\n\t function Headers(headers) {\n\t this.map = {}\n\t\n\t if (headers instanceof Headers) {\n\t headers.forEach(function(value, name) {\n\t this.append(name, value)\n\t }, this)\n\t\n\t } else if (headers) {\n\t Object.getOwnPropertyNames(headers).forEach(function(name) {\n\t this.append(name, headers[name])\n\t }, this)\n\t }\n\t }\n\t\n\t Headers.prototype.append = function(name, value) {\n\t name = normalizeName(name)\n\t value = normalizeValue(value)\n\t var list = this.map[name]\n\t if (!list) {\n\t list = []\n\t this.map[name] = list\n\t }\n\t list.push(value)\n\t }\n\t\n\t Headers.prototype['delete'] = function(name) {\n\t delete this.map[normalizeName(name)]\n\t }\n\t\n\t Headers.prototype.get = function(name) {\n\t var values = this.map[normalizeName(name)]\n\t return values ? values[0] : null\n\t }\n\t\n\t Headers.prototype.getAll = function(name) {\n\t return this.map[normalizeName(name)] || []\n\t }\n\t\n\t Headers.prototype.has = function(name) {\n\t return this.map.hasOwnProperty(normalizeName(name))\n\t }\n\t\n\t Headers.prototype.set = function(name, value) {\n\t this.map[normalizeName(name)] = [normalizeValue(value)]\n\t }\n\t\n\t Headers.prototype.forEach = function(callback, thisArg) {\n\t Object.getOwnPropertyNames(this.map).forEach(function(name) {\n\t this.map[name].forEach(function(value) {\n\t callback.call(thisArg, value, name, this)\n\t }, this)\n\t }, this)\n\t }\n\t\n\t function consumed(body) {\n\t if (body.bodyUsed) {\n\t return Promise.reject(new TypeError('Already read'))\n\t }\n\t body.bodyUsed = true\n\t }\n\t\n\t function fileReaderReady(reader) {\n\t return new Promise(function(resolve, reject) {\n\t reader.onload = function() {\n\t resolve(reader.result)\n\t }\n\t reader.onerror = function() {\n\t reject(reader.error)\n\t }\n\t })\n\t }\n\t\n\t function readBlobAsArrayBuffer(blob) {\n\t var reader = new FileReader()\n\t reader.readAsArrayBuffer(blob)\n\t return fileReaderReady(reader)\n\t }\n\t\n\t function readBlobAsText(blob) {\n\t var reader = new FileReader()\n\t reader.readAsText(blob)\n\t return fileReaderReady(reader)\n\t }\n\t\n\t var support = {\n\t blob: 'FileReader' in self && 'Blob' in self && (function() {\n\t try {\n\t new Blob();\n\t return true\n\t } catch(e) {\n\t return false\n\t }\n\t })(),\n\t formData: 'FormData' in self,\n\t arrayBuffer: 'ArrayBuffer' in self\n\t }\n\t\n\t function Body() {\n\t this.bodyUsed = false\n\t\n\t\n\t this._initBody = function(body) {\n\t this._bodyInit = body\n\t if (typeof body === 'string') {\n\t this._bodyText = body\n\t } else if (support.blob && Blob.prototype.isPrototypeOf(body)) {\n\t this._bodyBlob = body\n\t } else if (support.formData && FormData.prototype.isPrototypeOf(body)) {\n\t this._bodyFormData = body\n\t } else if (!body) {\n\t this._bodyText = ''\n\t } else if (support.arrayBuffer && ArrayBuffer.prototype.isPrototypeOf(body)) {\n\t // Only support ArrayBuffers for POST method.\n\t // Receiving ArrayBuffers happens via Blobs, instead.\n\t } else {\n\t throw new Error('unsupported BodyInit type')\n\t }\n\t\n\t if (!this.headers.get('content-type')) {\n\t if (typeof body === 'string') {\n\t this.headers.set('content-type', 'text/plain;charset=UTF-8')\n\t } else if (this._bodyBlob && this._bodyBlob.type) {\n\t this.headers.set('content-type', this._bodyBlob.type)\n\t }\n\t }\n\t }\n\t\n\t if (support.blob) {\n\t this.blob = function() {\n\t var rejected = consumed(this)\n\t if (rejected) {\n\t return rejected\n\t }\n\t\n\t if (this._bodyBlob) {\n\t return Promise.resolve(this._bodyBlob)\n\t } else if (this._bodyFormData) {\n\t throw new Error('could not read FormData body as blob')\n\t } else {\n\t return Promise.resolve(new Blob([this._bodyText]))\n\t }\n\t }\n\t\n\t this.arrayBuffer = function() {\n\t return this.blob().then(readBlobAsArrayBuffer)\n\t }\n\t\n\t this.text = function() {\n\t var rejected = consumed(this)\n\t if (rejected) {\n\t return rejected\n\t }\n\t\n\t if (this._bodyBlob) {\n\t return readBlobAsText(this._bodyBlob)\n\t } else if (this._bodyFormData) {\n\t throw new Error('could not read FormData body as text')\n\t } else {\n\t return Promise.resolve(this._bodyText)\n\t }\n\t }\n\t } else {\n\t this.text = function() {\n\t var rejected = consumed(this)\n\t return rejected ? rejected : Promise.resolve(this._bodyText)\n\t }\n\t }\n\t\n\t if (support.formData) {\n\t this.formData = function() {\n\t return this.text().then(decode)\n\t }\n\t }\n\t\n\t this.json = function() {\n\t return this.text().then(JSON.parse)\n\t }\n\t\n\t return this\n\t }\n\t\n\t // HTTP methods whose capitalization should be normalized\n\t var methods = ['DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT']\n\t\n\t function normalizeMethod(method) {\n\t var upcased = method.toUpperCase()\n\t return (methods.indexOf(upcased) > -1) ? upcased : method\n\t }\n\t\n\t function Request(input, options) {\n\t options = options || {}\n\t var body = options.body\n\t if (Request.prototype.isPrototypeOf(input)) {\n\t if (input.bodyUsed) {\n\t throw new TypeError('Already read')\n\t }\n\t this.url = input.url\n\t this.credentials = input.credentials\n\t if (!options.headers) {\n\t this.headers = new Headers(input.headers)\n\t }\n\t this.method = input.method\n\t this.mode = input.mode\n\t if (!body) {\n\t body = input._bodyInit\n\t input.bodyUsed = true\n\t }\n\t } else {\n\t this.url = input\n\t }\n\t\n\t this.credentials = options.credentials || this.credentials || 'omit'\n\t if (options.headers || !this.headers) {\n\t this.headers = new Headers(options.headers)\n\t }\n\t this.method = normalizeMethod(options.method || this.method || 'GET')\n\t this.mode = options.mode || this.mode || null\n\t this.referrer = null\n\t\n\t if ((this.method === 'GET' || this.method === 'HEAD') && body) {\n\t throw new TypeError('Body not allowed for GET or HEAD requests')\n\t }\n\t this._initBody(body)\n\t }\n\t\n\t Request.prototype.clone = function() {\n\t return new Request(this)\n\t }\n\t\n\t function decode(body) {\n\t var form = new FormData()\n\t body.trim().split('&').forEach(function(bytes) {\n\t if (bytes) {\n\t var split = bytes.split('=')\n\t var name = split.shift().replace(/\\+/g, ' ')\n\t var value = split.join('=').replace(/\\+/g, ' ')\n\t form.append(decodeURIComponent(name), decodeURIComponent(value))\n\t }\n\t })\n\t return form\n\t }\n\t\n\t function headers(xhr) {\n\t var head = new Headers()\n\t var pairs = xhr.getAllResponseHeaders().trim().split('\\n')\n\t pairs.forEach(function(header) {\n\t var split = header.trim().split(':')\n\t var key = split.shift().trim()\n\t var value = split.join(':').trim()\n\t head.append(key, value)\n\t })\n\t return head\n\t }\n\t\n\t Body.call(Request.prototype)\n\t\n\t function Response(bodyInit, options) {\n\t if (!options) {\n\t options = {}\n\t }\n\t\n\t this.type = 'default'\n\t this.status = options.status\n\t this.ok = this.status >= 200 && this.status < 300\n\t this.statusText = options.statusText\n\t this.headers = options.headers instanceof Headers ? options.headers : new Headers(options.headers)\n\t this.url = options.url || ''\n\t this._initBody(bodyInit)\n\t }\n\t\n\t Body.call(Response.prototype)\n\t\n\t Response.prototype.clone = function() {\n\t return new Response(this._bodyInit, {\n\t status: this.status,\n\t statusText: this.statusText,\n\t headers: new Headers(this.headers),\n\t url: this.url\n\t })\n\t }\n\t\n\t Response.error = function() {\n\t var response = new Response(null, {status: 0, statusText: ''})\n\t response.type = 'error'\n\t return response\n\t }\n\t\n\t var redirectStatuses = [301, 302, 303, 307, 308]\n\t\n\t Response.redirect = function(url, status) {\n\t if (redirectStatuses.indexOf(status) === -1) {\n\t throw new RangeError('Invalid status code')\n\t }\n\t\n\t return new Response(null, {status: status, headers: {location: url}})\n\t }\n\t\n\t self.Headers = Headers;\n\t self.Request = Request;\n\t self.Response = Response;\n\t\n\t self.fetch = function(input, init) {\n\t return new Promise(function(resolve, reject) {\n\t var request\n\t if (Request.prototype.isPrototypeOf(input) && !init) {\n\t request = input\n\t } else {\n\t request = new Request(input, init)\n\t }\n\t\n\t var xhr = new XMLHttpRequest()\n\t\n\t function responseURL() {\n\t if ('responseURL' in xhr) {\n\t return xhr.responseURL\n\t }\n\t\n\t // Avoid security warnings on getResponseHeader when not allowed by CORS\n\t if (/^X-Request-URL:/m.test(xhr.getAllResponseHeaders())) {\n\t return xhr.getResponseHeader('X-Request-URL')\n\t }\n\t\n\t return;\n\t }\n\t\n\t xhr.onload = function() {\n\t var status = (xhr.status === 1223) ? 204 : xhr.status\n\t if (status < 100 || status > 599) {\n\t reject(new TypeError('Network request failed'))\n\t return\n\t }\n\t var options = {\n\t status: status,\n\t statusText: xhr.statusText,\n\t headers: headers(xhr),\n\t url: responseURL()\n\t }\n\t var body = 'response' in xhr ? xhr.response : xhr.responseText;\n\t resolve(new Response(body, options))\n\t }\n\t\n\t xhr.onerror = function() {\n\t reject(new TypeError('Network request failed'))\n\t }\n\t\n\t xhr.open(request.method, request.url, true)\n\t\n\t if (request.credentials === 'include') {\n\t xhr.withCredentials = true\n\t }\n\t\n\t if ('responseType' in xhr && support.blob) {\n\t xhr.responseType = 'blob'\n\t }\n\t\n\t request.headers.forEach(function(value, name) {\n\t xhr.setRequestHeader(name, value)\n\t })\n\t\n\t xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit)\n\t })\n\t }\n\t self.fetch.polyfill = true\n\t})(typeof self !== 'undefined' ? self : this);\n\n\n/***/ },\n/* 13 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t/* WEBPACK VAR INJECTION */(function(global) {'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports.EVENT_DROPDOWN_CLOSED = undefined;\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /*\n\t * The MIT License (MIT)\n\t *\n\t * Copyright (c) 2015 David Heidrich, BowlingX \n\t *\n\t * Permission is hereby granted, free of charge, to any person obtaining a copy\n\t * of this software and associated documentation files (the \"Software\"), to deal\n\t * in the Software without restriction, including without limitation the rights\n\t * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n\t * copies of the Software, and to permit persons to whom the Software is\n\t * furnished to do so, subject to the following conditions:\n\t *\n\t * The above copyright notice and this permission notice shall be included in\n\t * all copies or substantial portions of the Software.\n\t *\n\t * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n\t * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n\t * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n\t * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n\t * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n\t * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n\t * THE SOFTWARE.\n\t */\n\t\n\t/*!\n\t * FlexCss.Dropdown\n\t * Licensed under the MIT License (MIT)\n\t * Copyright (c) 2015 David Heidrich, BowlingX \n\t */\n\t\n\tvar _Util = __webpack_require__(1);\n\t\n\tvar _Util2 = _interopRequireDefault(_Util);\n\t\n\tvar _Settings = __webpack_require__(2);\n\t\n\tvar _Settings2 = _interopRequireDefault(_Settings);\n\t\n\tvar _Event = __webpack_require__(3);\n\t\n\tvar _Event2 = _interopRequireDefault(_Event);\n\t\n\tvar _Widget = __webpack_require__(4);\n\t\n\tvar _Widget2 = _interopRequireDefault(_Widget);\n\t\n\tvar _FixedWindow = __webpack_require__(7);\n\t\n\tvar _FixedWindow2 = _interopRequireDefault(_FixedWindow);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\t/**\n\t * @type {string}\n\t */\n\tvar ATTR_CC = 'data-collision-container';\n\t/**\n\t * @type {string}\n\t */\n\tvar ATTR_DARKENER = 'data-darkener-container';\n\t/**\n\t * @type {string}\n\t */\n\tvar DARKENER_INIT = 'init';\n\t/**\n\t * @type {string}\n\t */\n\tvar ATTR_DATA_TARGET = 'data-target';\n\t/**\n\t * @type {string}\n\t */\n\tvar ATTR_CLOSE_DROPDOWN = 'data-close-dropdown';\n\t/**\n\t * @type {string}\n\t */\n\tvar ATTR_NAME = 'data-dropdown';\n\t/**\n\t * @type {string}\n\t */\n\tvar STATE_LOADING = 'loading';\n\t\n\tvar CLS_DARKENER_DROPDOWN = 'darkener-dropdown';\n\t/**\n\t * @type {string}\n\t */\n\tvar CLS_OPEN = 'open';\n\t\n\t/**\n\t * @type {string}\n\t */\n\tvar CLS_DROPDOWN = 'dropdown';\n\t\n\t/**\n\t * @type {string}\n\t */\n\tvar EVENT_DROPDOWN_CLOSED = exports.EVENT_DROPDOWN_CLOSED = 'flexcss.dropdown.closed';\n\t\n\t/**\n\t * A Dropdown\n\t */\n\t\n\tvar Dropdown = function () {\n\t function Dropdown(DelegateContainer, Darkener) {\n\t _classCallCheck(this, Dropdown);\n\t\n\t var doc = global.document;\n\t\n\t /**\n\t * Container Element\n\t * @type {HTMLElement}\n\t */\n\t this.container = DelegateContainer instanceof HTMLElement ? DelegateContainer : doc.getElementById(DelegateContainer);\n\t\n\t this.currentOpen = null;\n\t this.currentTarget = null;\n\t /**\n\t * @type {HTMLElement}\n\t */\n\t this.darkener = Darkener instanceof HTMLElement ? Darkener : document.getElementById(Darkener);\n\t\n\t this.destroyOnClose = false;\n\t\n\t if (!this.darkener || !this.container) {\n\t throw new Error('required elements not found (darkener and container element)');\n\t }\n\t }\n\t\n\t /**\n\t * Method that handles delegation events for dropdowns\n\t * @param e\n\t * @returns {boolean}\n\t * @private\n\t */\n\t\n\t\n\t _createClass(Dropdown, [{\n\t key: '_delegateFunction',\n\t value: function _delegateFunction(e) {\n\t var currentOpen = this.currentOpen;\n\t var target = _Util2.default.closestCallback(e.target, function (n) {\n\t return n instanceof HTMLElement && n.hasAttribute(ATTR_NAME);\n\t });\n\t var targetIsCurrent = target === this.currentTarget;\n\t\n\t if (currentOpen && !_Util2.default.isPartOfNode(e.target, currentOpen) || targetIsCurrent) {\n\t this.close();\n\t if (targetIsCurrent) {\n\t e.preventDefault();\n\t }\n\t return targetIsCurrent ? false : this._delegateFunction(e);\n\t }\n\t\n\t if (target && !currentOpen) {\n\t e.preventDefault();\n\t e.stopImmediatePropagation();\n\t\n\t if (target.isLoading) {\n\t return false;\n\t }\n\t this.createDropdown(target);\n\t } else {\n\t if (currentOpen) {\n\t if (e.target.hasAttribute(ATTR_CLOSE_DROPDOWN)) {\n\t e.preventDefault();\n\t this.close();\n\t }\n\t if (!_Util2.default.isPartOfNode(e.target, currentOpen)) {\n\t this.close();\n\t }\n\t }\n\t }\n\t }\n\t\n\t /**\n\t * Register Events for this dropdown container\n\t * @returns {Dropdown}\n\t */\n\t\n\t }, {\n\t key: 'registerEvents',\n\t value: function registerEvents() {\n\t _FixedWindow2.default.getInstance().addScreenConstraint(Dropdown, function (width) {\n\t return width < _Settings2.default.get().smallBreakpoint;\n\t });\n\t this.container.addEventListener(_Settings2.default.getTabEvent(), this._delegateFunction.bind(this), true);\n\t return this;\n\t }\n\t\n\t /**\n\t * Destroys this instance, unbinds events\n\t * @returns {Dropdown}\n\t */\n\t\n\t }, {\n\t key: 'destroy',\n\t value: function destroy() {\n\t this.container.removeEventListener(_Settings2.default.getTabEvent(), this._delegateFunction.bind(this), true);\n\t return this;\n\t }\n\t\n\t /**\n\t * Destroys instance on close of dropdown\n\t * @param v\n\t * @returns {Dropdown}\n\t */\n\t\n\t }, {\n\t key: 'setDestroyOnClose',\n\t value: function setDestroyOnClose(v) {\n\t this.destroyOnClose = v;\n\t return this;\n\t }\n\t\n\t /**\n\t * Will add the right class to container for specific darkener id\n\t * @param instance\n\t * @param show\n\t */\n\t\n\t }, {\n\t key: 'toggleDarkenerToggler',\n\t value: function toggleDarkenerToggler(instance, show) {\n\t var cls = 'toggle-' + (instance.id || CLS_DARKENER_DROPDOWN);\n\t var classList = this.container.classList;\n\t if (show) {\n\t classList.add(cls);\n\t } else {\n\t classList.remove(cls);\n\t }\n\t }\n\t\n\t /**\n\t * Closes Dropdown on current instance\n\t * @return {Boolean|Promise}\n\t */\n\t\n\t }, {\n\t key: 'close',\n\t value: function close() {\n\t var _this2 = this;\n\t\n\t var currentOpen = this.currentOpen;\n\t if (!currentOpen) {\n\t return false;\n\t }\n\t var darkenerInstance = currentOpen.flexDarkenerInstance || this.darkener;\n\t var thisCurrentOpen = currentOpen;\n\t\n\t var future = new Promise(function (resolve) {\n\t if (window.getComputedStyle(currentOpen).position === 'fixed') {\n\t _Util2.default.addEventOnce(_Settings2.default.getTransitionEvent(), currentOpen, function scheduler(e) {\n\t var _this = this;\n\t\n\t if (e.srcElement !== currentOpen) {\n\t return _Util2.default.addEventOnce(_Settings2.default.getTransitionEvent(), currentOpen, scheduler.bind(this));\n\t }\n\t requestAnimationFrame(function () {\n\t _Event2.default.dispatchAndFire(thisCurrentOpen, EVENT_DROPDOWN_CLOSED);\n\t // if a new dropdown has been opened in the meantime, do not remove darkener\n\t if (_this.currentOpen !== null) {\n\t return false;\n\t }\n\t _this.toggleDarkenerToggler(darkenerInstance, false);\n\t resolve(true);\n\t });\n\t }.bind(_this2));\n\t } else {\n\t resolve(true);\n\t _Event2.default.dispatchAndFire(thisCurrentOpen, EVENT_DROPDOWN_CLOSED);\n\t }\n\t });\n\t\n\t _FixedWindow2.default.getInstance().close();\n\t currentOpen.classList.remove(CLS_OPEN);\n\t\n\t if (currentOpen.flexDarkenerInstance) {\n\t currentOpen.flexDarkenerInstance.classList.remove(DARKENER_INIT);\n\t } else {\n\t this.darkener.classList.remove(DARKENER_INIT);\n\t }\n\t\n\t this.currentOpen = null;\n\t this.currentTarget = null;\n\t\n\t if (this.destroyOnClose) {\n\t this.destroy();\n\t }\n\t\n\t return future;\n\t }\n\t\n\t /**\n\t * Creates a dropdown on given target and opens it\n\t * @param {HTMLElement} target target where this dropdown is placed\n\t * @param {FlexCss.Widget} [thisWidget] if given will use widget instead of widget instance\n\t * @return {FlexCss.Dropdown}\n\t */\n\t\n\t }, {\n\t key: 'createDropdown',\n\t value: function createDropdown(target, thisWidget) {\n\t var _this3 = this;\n\t\n\t var doc = global.document;\n\t\n\t if (!target) {\n\t throw new Error('Dropdown target not found');\n\t }\n\t\n\t var widget = thisWidget || _Widget2.default.findWidget(target);\n\t var future = void 0;\n\t var data = target.getAttribute(ATTR_NAME);\n\t var dropdownContainerElement = doc.getElementById(data);\n\t var async = !dropdownContainerElement && _Widget2.default.isWidget(widget) ? widget.getAsync() : false;\n\t\n\t if (async) {\n\t target.classList.add(STATE_LOADING);\n\t target.isLoading = true;\n\t future = async.then(function (r) {\n\t if (r instanceof HTMLElement) {\n\t if (r.id) {\n\t target.setAttribute(ATTR_NAME, r.id);\n\t }\n\t return r;\n\t }\n\t // Create container Element:\n\t var element = doc.createElement('div');\n\t element.className = CLS_DROPDOWN;\n\t element.innerHTML = r;\n\t element.id = _Util2.default.guid();\n\t // Cache target for later use:\n\t target.setAttribute(ATTR_NAME, element.id);\n\t _this3.container.appendChild(element);\n\t return element;\n\t }).then(function (r) {\n\t target.isLoading = false;\n\t target.classList.remove(STATE_LOADING);\n\t return r;\n\t });\n\t } else {\n\t if (!dropdownContainerElement) {\n\t throw new Error('Could not found Dropdown container with ID \"' + data + '\"');\n\t }\n\t future = new Promise(function (r) {\n\t r(dropdownContainerElement);\n\t });\n\t }\n\t\n\t future.then(function (dropdownContent) {\n\t if (_this3.currentOpen) {\n\t _this3.close();\n\t }\n\t // Skip one frame to show animation\n\t target.dropdownContent = dropdownContent;\n\t var isAbsolute = global.getComputedStyle(dropdownContent).position === 'absolute';\n\t dropdownContent.hfWidgetInstance = _this3;\n\t\n\t if (!target.flexCollisionContainer) {\n\t var collisionC = target.getAttribute(ATTR_CC);\n\t target.flexCollisionContainer = collisionC ? doc.getElementById(collisionC) || document.documentElement : document.documentElement;\n\t }\n\t\n\t dropdownContent.classList.toggle(CLS_OPEN);\n\t if (dropdownContent.classList.contains(CLS_OPEN)) {\n\t _this3.currentOpen = dropdownContent;\n\t _this3.currentTarget = target;\n\t }\n\t _FixedWindow2.default.getInstance().open(_this3, dropdownContent);\n\t if (isAbsolute) {\n\t // Check collision:\n\t var selfTarget = target.getAttribute(ATTR_DATA_TARGET);\n\t selfTarget = selfTarget ? doc.getElementById(selfTarget) : target;\n\t _Util2.default.setupPositionNearby(selfTarget, dropdownContent, target.flexCollisionContainer);\n\t } else {\n\t // optionally get custom darkener container for target\n\t var d = target.getAttribute(ATTR_DARKENER);\n\t if (d) {\n\t dropdownContent.flexDarkenerInstance = doc.getElementById(d);\n\t (dropdownContent.flexDarkenerInstance || _this3.darkener).classList.toggle(DARKENER_INIT);\n\t } else {\n\t _this3.darkener.classList.toggle(DARKENER_INIT);\n\t }\n\t _this3.toggleDarkenerToggler(dropdownContent.flexDarkenerInstance || _this3.darkener, true);\n\t\n\t dropdownContent.style.left = '0';\n\t dropdownContent.style.top = 'auto';\n\t }\n\t });\n\t }\n\t }]);\n\t\n\t return Dropdown;\n\t}();\n\t\n\texports.default = Dropdown;\n\t/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))\n\n/***/ },\n/* 14 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t/* WEBPACK VAR INJECTION */(function(global) {'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol ? \"symbol\" : typeof obj; };\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /*\n\t * The MIT License (MIT)\n\t *\n\t * Copyright (c) 2015 David Heidrich, BowlingX \n\t *\n\t * Permission is hereby granted, free of charge, to any person obtaining a copy\n\t * of this software and associated documentation files (the \"Software\"), to deal\n\t * in the Software without restriction, including without limitation the rights\n\t * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n\t * copies of the Software, and to permit persons to whom the Software is\n\t * furnished to do so, subject to the following conditions:\n\t *\n\t * The above copyright notice and this permission notice shall be included in\n\t * all copies or substantial portions of the Software.\n\t *\n\t * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n\t * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n\t * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n\t * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n\t * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n\t * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n\t * THE SOFTWARE.\n\t */\n\t\n\t/*!\n\t * FlexCss.LightBox\n\t * Licensed under the MIT License (MIT)\n\t * Copyright (c) 2015 David Heidrich, BowlingX \n\t */\n\t\n\t/* global Image, TouchEvent*/\n\t\n\tvar _Modal = __webpack_require__(8);\n\t\n\tvar _Modal2 = _interopRequireDefault(_Modal);\n\t\n\tvar _Settings = __webpack_require__(2);\n\t\n\tvar _Settings2 = _interopRequireDefault(_Settings);\n\t\n\tvar _Widget = __webpack_require__(4);\n\t\n\tvar _Widget2 = _interopRequireDefault(_Widget);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tvar ATTR_MAX_WIDTH = 'data-original-width';\n\tvar ATTR_MAX_HEIGHT = 'data-original-height';\n\tvar ATTR_SRC = 'data-src';\n\t\n\tvar CLS_HAS_PREV = 'has-prev';\n\tvar CLS_HAS_NEXT = 'has-next';\n\tvar CLS_LOADING = 'loading';\n\t\n\tvar ATTR_NO_THUMBNAIL = 'data-no-thumbnail';\n\tvar ATTR_DATA_HREF = 'data-href';\n\tvar ATTR_HREF = 'href';\n\t\n\tvar KEY_NEXT = 39;\n\tvar KEY_PREV = 37;\n\tvar ATTR_CLOSE = 'data-close-modal';\n\t/**\n\t * A Simple LightBox\n\t */\n\t\n\tvar LightBox = function () {\n\t\n\t /**\n\t * Creates a new Lightbox\n\t * @param DelegateContainer\n\t * @param AttributeSelector\n\t * @param ModalAppend\n\t * @param [options]\n\t */\n\t\n\t function LightBox(DelegateContainer, AttributeSelector, ModalAppend, options) {\n\t _classCallCheck(this, LightBox);\n\t\n\t var thisDelegateContainer = DelegateContainer instanceof HTMLElement ? DelegateContainer : document.getElementById(DelegateContainer);\n\t\n\t this._modalAppend = ModalAppend || DelegateContainer;\n\t /**\n\t * @type {Function}\n\t */\n\t this._resizeEvent = null;\n\t /**\n\t * @type {Function}\n\t */\n\t this._keyboardNextEvent = null;\n\t /**\n\t * @type {Promise}\n\t */\n\t this._future = null;\n\t /**\n\t * @type {Promise}\n\t */\n\t this._nextFuture = this._future;\n\t /**\n\t * @type {HTMLElement}\n\t */\n\t this._imageContainer = null;\n\t /**\n\t * @type {HTMLElement}\n\t */\n\t this._modalContainerDiv = null;\n\t /**\n\t * @type {HTMLElement}\n\t */\n\t this._contentContainer = null;\n\t /**\n\t * @type {HTMLElement}\n\t */\n\t this._closerContainerDiv = null;\n\t /**\n\t * @type {HTMLElement}\n\t */\n\t this._delegateContainer = thisDelegateContainer;\n\t /**\n\t * @type {HTMLElement}\n\t */\n\t this._attributeSelector = AttributeSelector;\n\t /**\n\t * @type {Widget}\n\t */\n\t this._widget = null;\n\t /**\n\t * @type {boolean}\n\t */\n\t this._isOpen = false;\n\t /**\n\t * @type {HTMLElement}\n\t */\n\t this.target = null;\n\t /**\n\t * @type {HTMLElement}\n\t */\n\t this.img = null;\n\t /**\n\t * @type {boolean}\n\t */\n\t this._isLoading = false;\n\t\n\t /**\n\t * Default options\n\t */\n\t this.options = {\n\t // set if prev and next should be available\n\t registerPrevNextEvents: true,\n\t // set if modal should be closed after last image\n\t closeOnLast: true,\n\t // called when next image is requested (either by keyboard or click), return false to abort\n\t onNext: function onNext() {\n\t return true;\n\t },\n\t onClose: function onClose() {},\n\t getNext: null,\n\t getPrev: null,\n\t // called when underlying target changed\n\t onSwitchImage: function onSwitchImage() {}\n\t };\n\t\n\t Object.assign(this.options, options);\n\t }\n\t\n\t /**\n\t * @param {HTMLElement} node\n\t * @returns {HTMLElement|null}\n\t */\n\t\n\t\n\t _createClass(LightBox, [{\n\t key: 'findImmediateNextTarget',\n\t value: function findImmediateNextTarget(node) {\n\t if (node && node.children[0].hasAttribute(this._attributeSelector)) {\n\t return node.children[0];\n\t }\n\t return null;\n\t }\n\t\n\t /**\n\t * Will fetch the next element of a lightBox\n\t * @param {HTMLElement} target\n\t * @returns {null|HTMLElement}\n\t */\n\t\n\t }, {\n\t key: 'getNext',\n\t value: function getNext(target) {\n\t if (this.options.getNext) {\n\t return this.options.getNext.apply(this, [target]);\n\t }\n\t return this.findImmediateNextTarget(target.parentNode.nextElementSibling);\n\t }\n\t\n\t /**\n\t * Will fetch the previous element of a lightBox\n\t * @param {HTMLElement} target\n\t * @returns {null|HTMLElement}\n\t */\n\t\n\t }, {\n\t key: 'getPrev',\n\t value: function getPrev(target) {\n\t if (this.options.getPrev) {\n\t return this.options.getPrev.apply(this, [target]);\n\t }\n\t return this.findImmediateNextTarget(target.parentNode.previousElementSibling);\n\t }\n\t\n\t /**\n\t * Registers events for delegate container\n\t */\n\t\n\t }, {\n\t key: 'registerEvents',\n\t value: function registerEvents(onOpen) {\n\t var _this = this;\n\t\n\t this._delegateContainer.addEventListener(_Settings2.default.getTabEvent(), function (e) {\n\t var target = e.target;\n\t var parent = target.parentNode;\n\t var validTarget = target.hasAttribute(_this._attributeSelector);\n\t var parentIsValid = parent && parent.hasAttribute(_this._attributeSelector);\n\t\n\t if (!validTarget && parentIsValid) {\n\t validTarget = true;\n\t target = parent;\n\t }\n\t if (validTarget) {\n\t e.preventDefault();\n\t _this.open(target).then(function (r) {\n\t if (onOpen) {\n\t onOpen.apply(_this, [r, target]);\n\t }\n\t });\n\t }\n\t });\n\t }\n\t\n\t /**\n\t * @returns {HTMLElement}\n\t */\n\t\n\t }, {\n\t key: 'getContentContainer',\n\t value: function getContentContainer() {\n\t return this._contentContainer;\n\t }\n\t\n\t /**\n\t * Setup max-width and max-height\n\t * @param {HTMLElement} target\n\t * @param {HTMLElement} img\n\t * @param {HTMLElement} loadedImage\n\t * @private\n\t */\n\t\n\t }, {\n\t key: 'switchImageByDirection',\n\t\n\t\n\t /**\n\t * Switches to the next image\n\t * @param {boolean} direction\n\t */\n\t value: function switchImageByDirection(direction) {\n\t var next = direction ? this.getPrev(this.target) : this.getNext(this.target);\n\t if (this.options.onNext.apply(this, [next])) {\n\t return this.switchImage(next);\n\t }\n\t return new Promise(function (_, reject) {\n\t return reject(next);\n\t });\n\t }\n\t\n\t /**\n\t * Checks if lightbox is currently loading\n\t * @returns {boolean}\n\t */\n\t\n\t }, {\n\t key: 'isLoading',\n\t value: function isLoading() {\n\t return this._isLoading;\n\t }\n\t\n\t /**\n\t * Checks if modal should be closed\n\t * @private\n\t */\n\t\n\t }, {\n\t key: '_runOptionalClose',\n\t value: function _runOptionalClose() {\n\t if (this.options.closeOnLast) {\n\t this.modal.close();\n\t }\n\t }\n\t }, {\n\t key: '_setupPrevNextStates',\n\t value: function _setupPrevNextStates() {\n\t var target = this.target;\n\t var hasPrev = this.getPrev(target);\n\t var hasNext = this.getNext(target);\n\t var hasPrevClass = CLS_HAS_PREV;\n\t var hasNextClass = CLS_HAS_NEXT;\n\t // because IE does not support the second toggle parameter, we need to do this manually\n\t if (hasPrev) {\n\t this._imageContainer.classList.add(hasPrevClass);\n\t } else {\n\t this._imageContainer.classList.remove(hasPrevClass);\n\t }\n\t if (hasNext) {\n\t this._imageContainer.classList.add(hasNextClass);\n\t } else {\n\t this._imageContainer.classList.remove(hasNextClass);\n\t }\n\t }\n\t\n\t /**\n\t * @param img\n\t * @private\n\t */\n\t\n\t }, {\n\t key: '_calculateContainer',\n\t value: function _calculateContainer(img) {\n\t var _this2 = this;\n\t\n\t if (_Settings2.default.isIE()) {\n\t setTimeout(function () {\n\t _this2._imageContainer.style.height = img.offsetHeight + 'px';\n\t }, 0);\n\t }\n\t }\n\t\n\t /**\n\t * Switch to a specific image\n\t * @param next\n\t * @returns {*}\n\t */\n\t\n\t }, {\n\t key: 'switchImage',\n\t value: function switchImage(next) {\n\t var _this3 = this;\n\t\n\t var self = this;\n\t var img = this.img;\n\t this._isLoading = true;\n\t self._nextFuture = new Promise(function (resolve, reject) {\n\t // notify observers about image switching\n\t self.options.onSwitchImage.apply(self, [self._nextFuture]);\n\t if (next) {\n\t var _ret = function () {\n\t var nextThumb = next.hasAttribute(ATTR_NO_THUMBNAIL) ? next : next.children[0] || next;\n\t var nextHighRes = next.getAttribute(ATTR_DATA_HREF) || next.getAttribute(ATTR_HREF);\n\t var nextSource = nextThumb.getAttribute(ATTR_SRC) || nextThumb.src || nextHighRes;\n\t var nextImgObject = new Image();\n\t\n\t if (!nextSource) {\n\t reject(next);\n\t return {\n\t v: void 0\n\t };\n\t }\n\t // set new target to next element\n\t _this3.target = next;\n\t nextImgObject.src = nextSource;\n\t self._imageContainer.classList.add(CLS_LOADING);\n\t nextImgObject.addEventListener('load', function () {\n\t img.src = nextSource;\n\t self._imageContainer.style.backgroundImage = 'url(' + nextSource + ')';\n\t LightBox._setupMaxWidthHeight(next, img, nextImgObject);\n\t self._calculateContainer(img);\n\t self.highRes(nextThumb, nextHighRes);\n\t self._setupPrevNextStates();\n\t self._imageContainer.classList.remove(CLS_LOADING);\n\t _this3._isLoading = false;\n\t resolve(nextSource, _this3.target);\n\t });\n\t }();\n\t\n\t if ((typeof _ret === 'undefined' ? 'undefined' : _typeof(_ret)) === \"object\") return _ret.v;\n\t } else {\n\t reject(_this3);\n\t }\n\t });\n\t return self._nextFuture;\n\t }\n\t\n\t /**\n\t * Setup High-Resolution picture\n\t * @param {HTMLElement} thisThumbnail\n\t * @param {String} thisImgHighResolution\n\t */\n\t\n\t }, {\n\t key: 'highRes',\n\t value: function highRes(thisThumbnail, thisImgHighResolution) {\n\t var _this4 = this;\n\t\n\t if (thisImgHighResolution && thisThumbnail.src !== thisImgHighResolution) {\n\t var highImageObj = new Image();\n\t highImageObj.src = thisImgHighResolution;\n\t highImageObj.addEventListener('load', function () {\n\t // if current image is still available\n\t if (_this4._getSrc(thisThumbnail) === _this4.img.src) {\n\t _this4.img.src = thisImgHighResolution;\n\t _this4._imageContainer.style.backgroundImage = 'url(' + thisImgHighResolution + ')';\n\t }\n\t });\n\t }\n\t }\n\t\n\t /**\n\t * Extracts the source of an image\n\t * @param target\n\t * @returns {String|null}\n\t * @private\n\t */\n\t\n\t }, {\n\t key: '_getSrc',\n\t value: function _getSrc(target) {\n\t return target.getAttribute(ATTR_SRC) || target.src;\n\t }\n\t\n\t /**\n\t * Will show a lightBox on given target\n\t * @param {HTMLElement} target\n\t * @returns {$.Deferred|*}\n\t */\n\t\n\t }, {\n\t key: 'open',\n\t value: function open(target) {\n\t var _this5 = this;\n\t\n\t var self = this;\n\t\n\t if (!target) {\n\t return false;\n\t }\n\t\n\t this.target = target;\n\t\n\t // if lightBox is open, we just switch to the new target image\n\t if (this._isOpen && target) {\n\t return this.switchImage(target).then(function () {\n\t return _this5;\n\t });\n\t }\n\t\n\t this._isOpen = true;\n\t\n\t /**\n\t * Setup Widget for modal\n\t * @type {Widget}\n\t */\n\t this._widget = new _Widget2.default().setAsync(function () {\n\t // thumbnail is either target itself or expected to be first childNode\n\t var thumbnail = target.hasAttribute(ATTR_NO_THUMBNAIL) ? target : target.children[0] || target;\n\t\n\t var imgHighResolution = target.getAttribute(ATTR_DATA_HREF) || target.getAttribute(ATTR_HREF);\n\t var imgSrc = _this5._getSrc(thumbnail) || imgHighResolution;\n\t\n\t var imageObj = new Image();\n\t imageObj.src = imgSrc;\n\t _this5._imageContainer = document.createElement('div');\n\t _this5._modalContainerDiv = document.createElement('div');\n\t _this5._closerContainerDiv = document.createElement('i');\n\t _this5._contentContainer = document.createElement('div');\n\t\n\t _this5._closerContainerDiv.className = 'modal-close modal-close-lightbox icon-cancel-1';\n\t _this5._closerContainerDiv.setAttribute(ATTR_CLOSE, ATTR_CLOSE);\n\t\n\t _this5._modalContainerDiv.className = 'modal image-modal';\n\t _this5._modalContainerDiv.appendChild(_this5._imageContainer);\n\t _this5._modalContainerDiv.appendChild(_this5._contentContainer);\n\t _this5._modalContainerDiv.appendChild(_this5._closerContainerDiv);\n\t _this5._contentContainer.className = 'content-container';\n\t _this5._isLoading = true;\n\t _this5._future = new Promise(function (resolve) {\n\t imageObj.addEventListener('load', function () {\n\t _this5._imageContainer.className = 'image-container';\n\t var img = document.createElement('img');\n\t // current image\n\t _this5.img = img;\n\t\n\t img.src = imgSrc;\n\t LightBox._setupMaxWidthHeight(target, img, imageObj);\n\t _this5._imageContainer.appendChild(img);\n\t _this5._imageContainer.style.backgroundImage = 'url(' + imgSrc + ')';\n\t\n\t resolve(self._modalContainerDiv);\n\t _this5._isLoading = false;\n\t\n\t if (_Settings2.default.isIE()) {\n\t self._resizeEvent = global.addEventListener('resize', function () {\n\t setTimeout(function () {\n\t self._imageContainer.style.height = img.offsetHeight + 'px';\n\t }, 0);\n\t });\n\t }\n\t\n\t if (self.options.registerPrevNextEvents) {\n\t self._setupPrevNextStates();\n\t // prev or next on touch/click\n\t self._imageContainer.addEventListener(_Settings2.default.getTabEvent(), function (e) {\n\t if (self.isLoading()) {\n\t return;\n\t }\n\t e.preventDefault();\n\t\n\t var ev = e;\n\t var pageX = global.TouchEvent && ev instanceof TouchEvent ? ev.changedTouches[0].pageX : ev.pageX;\n\t var rect = self._imageContainer.getBoundingClientRect();\n\t var imgX = rect.left;\n\t var wrapperWidth = rect.width;\n\t var posX = pageX - imgX;\n\t\n\t self.switchImageByDirection(wrapperWidth / 2 > posX).catch(function () {\n\t self._runOptionalClose();\n\t });\n\t });\n\t\n\t // register keyboard events\n\t self._keyboardNextEvent = function (e) {\n\t if (e.keyCode === KEY_NEXT || e.keyCode === KEY_PREV) {\n\t if (self.isLoading()) {\n\t return;\n\t }\n\t self.switchImageByDirection(e.keyCode === KEY_PREV).catch(function () {\n\t self._runOptionalClose();\n\t });\n\t }\n\t };\n\t global.addEventListener('keydown', self._keyboardNextEvent);\n\t } else {\n\t self._imageContainer.addEventListener(_Settings2.default.getTabEvent(), function () {\n\t self._runOptionalClose();\n\t });\n\t }\n\t\n\t self.highRes(thumbnail, imgHighResolution);\n\t });\n\t });\n\t\n\t _this5._future.then(function () {\n\t self._calculateContainer(_this5.img);\n\t });\n\t\n\t self._modalContainerDiv.addEventListener(_Modal.EVENT_MODAL_CLOSED, function () {\n\t // cleanup:\n\t _this5._modalContainerDiv.parentNode.removeChild(_this5._modalContainerDiv);\n\t _this5.options.onClose.apply(self);\n\t _this5._isOpen = false;\n\t _this5.modal.destroy();\n\t // unbind events\n\t if (_this5._keyboardNextEvent) {\n\t global.removeEventListener('keydown', self._keyboardNextEvent);\n\t }\n\t if (_this5._resizeEvent) {\n\t global.removeEventListener('resize', self._resizeEvent);\n\t }\n\t });\n\t\n\t return _this5._future;\n\t });\n\t\n\t this._nextFuture = this._future;\n\t\n\t if (self._widget) {\n\t this.modal = new _Modal2.default(this._modalAppend);\n\t // make sure we close stack before\n\t return this.modal.close().fromWidget(self._widget).then(function () {\n\t return self._future.then(function () {\n\t return self;\n\t });\n\t });\n\t }\n\t return false;\n\t }\n\t }], [{\n\t key: '_setupMaxWidthHeight',\n\t value: function _setupMaxWidthHeight(target, img, loadedImage) {\n\t var nextMaxWidth = target.getAttribute(ATTR_MAX_WIDTH);\n\t var nextMaxHeight = target.getAttribute(ATTR_MAX_HEIGHT);\n\t if (nextMaxWidth && nextMaxHeight) {\n\t img.style.maxWidth = nextMaxWidth + \"px\";\n\t img.style.maxHeight = nextMaxHeight + \"px\";\n\t } else {\n\t img.style.maxWidth = loadedImage.width + \"px\";\n\t img.style.maxHeight = loadedImage.height + \"px\";\n\t }\n\t }\n\t }]);\n\t\n\t return LightBox;\n\t}();\n\t\n\texports.default = LightBox;\n\t/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))\n\n/***/ },\n/* 15 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t/* WEBPACK VAR INJECTION */(function(global) {'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports.EVENT_TOGGLE = undefined;\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /*\n\t * The MIT License (MIT)\n\t *\n\t * Copyright (c) 2015 David Heidrich, BowlingX \n\t *\n\t * Permission is hereby granted, free of charge, to any person obtaining a copy\n\t * of this software and associated documentation files (the \"Software\"), to deal\n\t * in the Software without restriction, including without limitation the rights\n\t * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n\t * copies of the Software, and to permit persons to whom the Software is\n\t * furnished to do so, subject to the following conditions:\n\t *\n\t * The above copyright notice and this permission notice shall be included in\n\t * all copies or substantial portions of the Software.\n\t *\n\t * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n\t * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n\t * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n\t * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n\t * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n\t * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n\t * THE SOFTWARE.\n\t */\n\t\n\t/*!\n\t * FlexCss.OffCanvas\n\t * Licensed under the MIT License (MIT)\n\t * Copyright (c) 2015 David Heidrich, BowlingX \n\t */\n\t\n\tvar _Settings = __webpack_require__(2);\n\t\n\tvar _Settings2 = _interopRequireDefault(_Settings);\n\t\n\tvar _Util = __webpack_require__(1);\n\t\n\tvar _Util2 = _interopRequireDefault(_Util);\n\t\n\tvar _Event = __webpack_require__(3);\n\t\n\tvar _Event2 = _interopRequireDefault(_Event);\n\t\n\tvar _FixedWindow = __webpack_require__(7);\n\t\n\tvar _FixedWindow2 = _interopRequireDefault(_FixedWindow);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\t/**\n\t * @type {string}\n\t */\n\tvar ATTR_CLOSE_SIDEBAR = 'data-close-offcanvas';\n\t\n\t/**\n\t * @type {string}\n\t */\n\tvar ATTR_TARGET = 'data-offcanvas';\n\t/**\n\t * @type {string}\n\t */\n\tvar INIT_CLASS = 'init';\n\t/**\n\t * @type {string}\n\t */\n\tvar OPEN_CLASS = 'open';\n\t/**\n\t * @type {number}\n\t */\n\tvar HIDE_FACTOR = 3;\n\t\n\t/**\n\t * @type {string}\n\t */\n\tvar EVENT_TOGGLE = exports.EVENT_TOGGLE = 'flexcss.offcanvas.toggle';\n\t\n\t/**\n\t * A OffCanvas Implementation\n\t */\n\t\n\tvar OffCanvas = function () {\n\t\n\t /**\n\t * Creates an off-canvas navigation\n\t * @param {HTMLElement|String} NavigationId\n\t * @param {HTMLElement|String} Darkener\n\t * @param {int} factor positive will expect right sidebar, positive left\n\t * @param {bool} [disableTouch] if true all touch events are disabled\n\t * @constructor\n\t */\n\t\n\t function OffCanvas(NavigationId, Darkener, factor, disableTouch) {\n\t var _this = this;\n\t\n\t _classCallCheck(this, OffCanvas);\n\t\n\t var doc = global.document;\n\t var touchedX = 0;\n\t var navigationContainer = NavigationId instanceof HTMLElement ? NavigationId : doc.getElementById(NavigationId);\n\t var darkener = Darkener instanceof HTMLElement ? Darkener : doc.getElementById(Darkener);\n\t var DARKENER_CLASS_TOGGLE = 'toggle-' + darkener.id || 'darkener';\n\t var DARKENER_CLASS_INSTANT_TOGGLE = DARKENER_CLASS_TOGGLE + '-open';\n\t\n\t var shouldNotTouch = function shouldNotTouch() {\n\t return window.innerWidth >= _Settings2.default.get().smallBreakpoint;\n\t };\n\t\n\t if (!darkener || !navigationContainer) {\n\t throw new Error('Could not find needed elements (Darkener and/or NavigationId)');\n\t }\n\t\n\t this.darkener = darkener;\n\t this.darkenerClassToggle = DARKENER_CLASS_TOGGLE;\n\t this.darkenerClassToggleInstant = DARKENER_CLASS_INSTANT_TOGGLE;\n\t this.globalToggleClass = _Settings2.default.get().canvasToggledClass;\n\t\n\t this.navigationContainer = navigationContainer;\n\t this.navigationContainerId = navigationContainer.id;\n\t\n\t // create id if id does not exist\n\t if (!this.navigationContainerId) {\n\t this.navigationContainerId = _Util2.default.guid();\n\t navigationContainer.id = this.navigationContainerId;\n\t }\n\t\n\t if (!disableTouch) {\n\t navigationContainer.addEventListener('touchstart', function (e) {\n\t if (shouldNotTouch()) {\n\t return;\n\t }\n\t touchedX = e.touches[0].clientX;\n\t navigationContainer.mustHide = false;\n\t });\n\t navigationContainer.addEventListener('touchmove', function (e) {\n\t if (shouldNotTouch()) {\n\t return;\n\t }\n\t var clientX = e.touches[0].clientX;\n\t\n\t var target = navigationContainer;\n\t var style = target.style;\n\t var calcX = touchedX - clientX;\n\t var bounds = target.getBoundingClientRect();\n\t var compare = factor > 0 ? calcX <= 0 : calcX >= 0;\n\t if (compare) {\n\t style.transition = 'transform 0s ease';\n\t style.webkitTransition = '-webkit-transform 0s ease';\n\t target.mustHide = factor > 0 ? calcX * -1 > bounds.width / HIDE_FACTOR : calcX > bounds.width / HIDE_FACTOR;\n\t var transform = 'translate3d(' + calcX * -1 + 'px,0,0)';\n\t style.transform = transform;\n\t style.webkitTransform = transform;\n\t }\n\t });\n\t navigationContainer.addEventListener('touchend', function () {\n\t if (shouldNotTouch()) {\n\t return;\n\t }\n\t var target = navigationContainer;\n\t var style = target.style;\n\t if (target.mustHide) {\n\t var width = target.getBoundingClientRect().width * factor;\n\t style.transition = 'transform .2s ease';\n\t style.webkitTransition = '-webkit-transform .2s ease';\n\t var transform = 'translate3d(' + width + 'px,0,0)';\n\t style.transform = transform;\n\t style.webkitTransform = transform;\n\t _this._remove().then(function () {\n\t _this.resetTransform(style);\n\t });\n\t _this._removeInstant();\n\t } else {\n\t _this.resetTransform(style);\n\t }\n\t });\n\t }\n\t }\n\t\n\t /**\n\t * @param {Object} s\n\t */\n\t\n\t\n\t _createClass(OffCanvas, [{\n\t key: 'resetTransform',\n\t value: function resetTransform(s) {\n\t s.transform = '';\n\t s.transition = '';\n\t s.webkitTransform = '';\n\t s.webkitTransition = '';\n\t }\n\t\n\t /**\n\t * @param {Object} [event]\n\t * @private\n\t */\n\t\n\t }, {\n\t key: '_remove',\n\t value: function _remove(event) {\n\t var _this2 = this;\n\t\n\t return new Promise(function (resolve) {\n\t _Util2.default.addEventOnce(_Settings2.default.getTransitionEvent(), _this2.navigationContainer, function scheduler(e) {\n\t var _this3 = this;\n\t\n\t if (e.target !== this.navigationContainer) {\n\t return _Util2.default.addEventOnce(_Settings2.default.getTransitionEvent(), this.navigationContainer, scheduler.bind(this));\n\t }\n\t requestAnimationFrame(function () {\n\t OffCanvas.currentOpen = null;\n\t var docCls = global.document.documentElement.classList;\n\t docCls.remove(_this3.darkenerClassToggle);\n\t docCls.remove(_this3.globalToggleClass);\n\t if (!!event) {\n\t _Event2.default.dispatchAndFire(_this3.navigationContainer, EVENT_TOGGLE);\n\t }\n\t resolve();\n\t });\n\t }.bind(_this2));\n\t });\n\t }\n\t\n\t /**\n\t * @private\n\t */\n\t\n\t }, {\n\t key: '_removeInstant',\n\t value: function _removeInstant() {\n\t this.navigationContainer.classList.remove(OPEN_CLASS);\n\t global.document.documentElement.classList.remove(this.darkenerClassToggleInstant);\n\t this.darkener.classList.remove(INIT_CLASS);\n\t _FixedWindow2.default.getInstance().close();\n\t }\n\t\n\t /**\n\t * Toggles a an off-canvas element\n\t * @param [e]\n\t * @private\n\t */\n\t\n\t }, {\n\t key: 'toggle',\n\t value: function toggle(e) {\n\t var _this4 = this;\n\t\n\t if (e) {\n\t e.preventDefault();\n\t }\n\t this.resetTransform(this.navigationContainer.style);\n\t var darkenerClass = this.darkener.classList;\n\t var DARKENER_CLASS_TOGGLE = this.darkenerClassToggle;\n\t var DARKENER_CLASS_INSTANT_TOGGLE = this.darkenerClassToggleInstant;\n\t var navigationControllerClassList = this.navigationContainer.classList;\n\t if (!OffCanvas.currentOpen) {\n\t _Util2.default.addEventOnce(_Settings2.default.getTransitionEvent(), this.navigationContainer, function () {\n\t if (!!e) {\n\t _Event2.default.dispatchAndFire(_this4.navigationContainer, EVENT_TOGGLE);\n\t }\n\t });\n\t OffCanvas.currentOpen = this;\n\t _FixedWindow2.default.getInstance().open(this, this.navigationContainer);\n\t var docElementCls = global.document.documentElement.classList;\n\t docElementCls.add(this.globalToggleClass);\n\t docElementCls.add(DARKENER_CLASS_INSTANT_TOGGLE);\n\t docElementCls.add(DARKENER_CLASS_TOGGLE);\n\t darkenerClass.add(INIT_CLASS);\n\t navigationControllerClassList.add(OPEN_CLASS);\n\t } else {\n\t return this.close(e);\n\t }\n\t }\n\t }, {\n\t key: 'close',\n\t value: function close(event) {\n\t if (this.navigationContainer.classList.contains(OPEN_CLASS)) {\n\t var promise = this._remove(event);\n\t this._removeInstant();\n\t return promise;\n\t }\n\t return new Promise(function (r) {\n\t return r();\n\t });\n\t }\n\t\n\t /**\n\t * Register events\n\t * @param [delegate]\n\t */\n\t\n\t }, {\n\t key: 'registerEvents',\n\t value: function registerEvents(delegate) {\n\t var _this5 = this;\n\t\n\t var thisDelegate = delegate || global.document;\n\t _FixedWindow2.default.getInstance().addScreenConstraint(OffCanvas, function (width) {\n\t return width < _Settings2.default.get().smallBreakpoint;\n\t });\n\t thisDelegate.addEventListener(_Settings2.default.getTabEvent(), function (e) {\n\t if (OffCanvas.currentOpen && OffCanvas.currentOpen !== _this5) {\n\t return;\n\t }\n\t var id = _this5.navigationContainerId;\n\t var validTarget = e.target.getAttribute(ATTR_TARGET) === id;\n\t if (!_Util2.default.isPartOfNode(e.target, _this5.navigationContainer)) {\n\t if (validTarget || OffCanvas.currentOpen === _this5 && e.target === _this5.darkener) {\n\t _this5.toggle(e);\n\t }\n\t } else {\n\t if (e.target.hasAttribute(ATTR_CLOSE_SIDEBAR)) {\n\t _this5.toggle(e);\n\t }\n\t }\n\t });\n\t }\n\t }]);\n\t\n\t return OffCanvas;\n\t}();\n\t\n\tOffCanvas.currentOpen = null;\n\t\n\texports.default = OffCanvas;\n\t/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))\n\n/***/ },\n/* 16 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t/* WEBPACK VAR INJECTION */(function(global) {'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports.EVENT_TAB_OPENED = exports.EVENT_TAB_CLOSED = undefined;\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /*\n\t * The MIT License (MIT)\n\t *\n\t * Copyright (c) 2015 David Heidrich, BowlingX \n\t *\n\t * Permission is hereby granted, free of charge, to any person obtaining a copy\n\t * of this software and associated documentation files (the \"Software\"), to deal\n\t * in the Software without restriction, including without limitation the rights\n\t * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n\t * copies of the Software, and to permit persons to whom the Software is\n\t * furnished to do so, subject to the following conditions:\n\t *\n\t * The above copyright notice and this permission notice shall be included in\n\t * all copies or substantial portions of the Software.\n\t *\n\t * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n\t * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n\t * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n\t * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n\t * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n\t * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n\t * THE SOFTWARE.\n\t */\n\t\n\t/*!\n\t * FlexCss.Toggleable\n\t * Licensed under the MIT License (MIT)\n\t * Copyright (c) 2015 David Heidrich, BowlingX \n\t */\n\t\n\tvar _Settings = __webpack_require__(2);\n\t\n\tvar _Settings2 = _interopRequireDefault(_Settings);\n\t\n\tvar _Widget = __webpack_require__(4);\n\t\n\tvar _Widget2 = _interopRequireDefault(_Widget);\n\t\n\tvar _Util = __webpack_require__(1);\n\t\n\tvar _Util2 = _interopRequireDefault(_Util);\n\t\n\tvar _Event = __webpack_require__(3);\n\t\n\tvar _Event2 = _interopRequireDefault(_Event);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\t/**\n\t * Event that is fired when a tab is closed\n\t * @type {string}\n\t */\n\t\n\tvar EVENT_TAB_CLOSED = exports.EVENT_TAB_CLOSED = 'flexcss.tab.closed';\n\t\n\t/**\n\t * Event that is fired when a tab has been opened\n\t * @type {string}\n\t */\n\tvar EVENT_TAB_OPENED = exports.EVENT_TAB_OPENED = 'flexcss.tab.opened';\n\t/**\n\t * @type {string}\n\t */\n\tvar ATTR_NAME = 'data-toggle';\n\t/**\n\t * @type {string}\n\t */\n\tvar ACTIVE_CLASS = 'active';\n\t/**\n\t * @type {string}\n\t */\n\tvar LOADING_CLASS = 'loading';\n\t\n\t/**\n\t * @type {string}\n\t */\n\tvar ATTR_TOGGLE_LIST = 'data-toggle-list';\n\t\n\t/**\n\t * Creates a toggleable element, either for tabs or a single toggle\n\t */\n\t\n\tvar Toggleable = function () {\n\t function Toggleable(ContainerId) {\n\t _classCallCheck(this, Toggleable);\n\t\n\t var doc = global.document;\n\t\n\t this.container = ContainerId instanceof HTMLElement ? ContainerId : doc.getElementById(ContainerId);\n\t\n\t this.loading = false;\n\t\n\t if (!this.container) {\n\t throw new Error('Toggleable container with id ' + ContainerId + ' not found');\n\t }\n\t }\n\t\n\t /**\n\t * Listener\n\t * @param {Event} e\n\t * @private\n\t */\n\t\n\t\n\t _createClass(Toggleable, [{\n\t key: '_listener',\n\t value: function _listener(e) {\n\t var target = e.target;\n\t var parent = target.parentNode;\n\t var doc = global.document;\n\t\n\t // support target child element to clicked\n\t if (!target.hasAttribute(ATTR_NAME)) {\n\t if (parent && parent.hasAttribute(ATTR_NAME)) {\n\t target = parent;\n\t } else {\n\t return;\n\t }\n\t }\n\t\n\t if (!target.hasAttribute(ATTR_NAME)) {\n\t return;\n\t }\n\t\n\t var refId = target.getAttribute(ATTR_NAME);\n\t var ref = doc.getElementById(refId);\n\t\n\t e.preventDefault();\n\t\n\t if (this.loading) {\n\t return;\n\t }\n\t\n\t this.toggleTarget(ref, target);\n\t }\n\t\n\t /**\n\t * Registers Events for this instance\n\t * @returns {Toggleable}\n\t */\n\t\n\t }, {\n\t key: 'registerEvents',\n\t value: function registerEvents() {\n\t this.container.addEventListener(_Settings2.default.getTabEvent(), this._listener.bind(this));\n\t return this;\n\t }\n\t\n\t /**\n\t * Toggles given `ref`\n\t * @param {HTMLElement|Node} ref\n\t * @param {HTMLElement|Node} [selfTarget] optional target node\n\t */\n\t\n\t }, {\n\t key: 'toggleTarget',\n\t value: function toggleTarget(ref, selfTarget) {\n\t var _this = this;\n\t\n\t var target = selfTarget;\n\t if (!target && !ref) {\n\t return;\n\t }\n\t if (!target) {\n\t target = document.querySelector('[' + ATTR_NAME + '=\"' + ref.id + '\"]');\n\t }\n\t\n\t var future = void 0;\n\t var elClassList = target.classList;\n\t var parent = target.parentNode;\n\t var doc = global.document;\n\t\n\t future = new Promise(function (resolve, failure) {\n\t if (ref) {\n\t resolve(ref);\n\t } else {\n\t var widget = _Widget2.default.findWidget(target);\n\t var async = widget ? widget.getAsync() : null;\n\t if (_Widget2.default.isWidget(widget) && async) {\n\t future = async.then(function (r) {\n\t if (r instanceof HTMLElement) {\n\t var id = _Util2.default.guid();\n\t r.id = id;\n\t target.setAttribute(ATTR_NAME, id);\n\t resolve(r);\n\t } else {\n\t throw new Error('Dynamically creating toggle-content is not supported right now.\\n Return an HTMLElement instance');\n\t }\n\t });\n\t } else {\n\t failure('Target not given');\n\t }\n\t }\n\t });\n\t\n\t if (parent) {\n\t var maybeToggleNode = _Util2.default.parentsUntil(target, function (node) {\n\t return node && node.hasAttribute && node.hasAttribute(ATTR_TOGGLE_LIST);\n\t });\n\t\n\t var parentClassList = parent.classList;\n\t // Abort if element is already active and if is part of a toggle list\n\t if (maybeToggleNode) {\n\t if (!parentClassList.contains(ACTIVE_CLASS)) {\n\t parentClassList.toggle(ACTIVE_CLASS);\n\t parentClassList.add(LOADING_CLASS);\n\t } else {\n\t return;\n\t }\n\t }\n\t\n\t if (maybeToggleNode) {\n\t for (var i = 0; i < maybeToggleNode.children.length; i++) {\n\t var n = maybeToggleNode.children[i];\n\t var targetRef = n.children[0];\n\t if (n !== parent) {\n\t n.classList.remove(ACTIVE_CLASS);\n\t if (targetRef) {\n\t var attr = targetRef.getAttribute(ATTR_NAME);\n\t var el = attr ? doc.getElementById(attr) : null;\n\t if (el) {\n\t _Event2.default.dispatchAndFire(el, EVENT_TAB_CLOSED);\n\t el.classList.remove(ACTIVE_CLASS);\n\t targetRef.classList.remove(ACTIVE_CLASS);\n\t }\n\t }\n\t }\n\t }\n\t }\n\t }\n\t if (elClassList) {\n\t elClassList.toggle(ACTIVE_CLASS);\n\t elClassList.add(LOADING_CLASS);\n\t }\n\t this.loading = true;\n\t future.then(function (r) {\n\t _Event2.default.dispatchAndFire(r, EVENT_TAB_OPENED);\n\t Toggleable._handleLoaded(target);\n\t r.classList.toggle(ACTIVE_CLASS);\n\t _this.loading = false;\n\t }).catch(function () {\n\t _this.loading = false;\n\t Toggleable._handleLoaded(target);\n\t });\n\t }\n\t\n\t /**\n\t * @param el\n\t * @private\n\t */\n\t\n\t }], [{\n\t key: '_handleLoaded',\n\t value: function _handleLoaded(el) {\n\t var parentClassList = el.parentNode.classList;\n\t el.classList.remove(LOADING_CLASS);\n\t if (parentClassList) {\n\t parentClassList.remove(LOADING_CLASS);\n\t }\n\t }\n\t }]);\n\t\n\t return Toggleable;\n\t}();\n\t\n\texports.default = Toggleable;\n\t/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))\n\n/***/ },\n/* 17 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports.LightBox = exports.Dropdown = exports.OffCanvas = exports.Toggleable = exports.Util = exports.Settings = exports.Widget = exports.Modal = exports.Tooltip = exports.Form = undefined;\n\t\n\tvar _Form = __webpack_require__(9);\n\t\n\tvar _Form2 = _interopRequireDefault(_Form);\n\t\n\tvar _Tooltip = __webpack_require__(6);\n\t\n\tvar _Tooltip2 = _interopRequireDefault(_Tooltip);\n\t\n\tvar _Modal = __webpack_require__(8);\n\t\n\tvar _Modal2 = _interopRequireDefault(_Modal);\n\t\n\tvar _Widget = __webpack_require__(4);\n\t\n\tvar _Widget2 = _interopRequireDefault(_Widget);\n\t\n\tvar _Settings = __webpack_require__(2);\n\t\n\tvar _Settings2 = _interopRequireDefault(_Settings);\n\t\n\tvar _Toggleable = __webpack_require__(16);\n\t\n\tvar _Toggleable2 = _interopRequireDefault(_Toggleable);\n\t\n\tvar _OffCanvas = __webpack_require__(15);\n\t\n\tvar _OffCanvas2 = _interopRequireDefault(_OffCanvas);\n\t\n\tvar _Dropdown = __webpack_require__(13);\n\t\n\tvar _Dropdown2 = _interopRequireDefault(_Dropdown);\n\t\n\tvar _LightBox = __webpack_require__(14);\n\t\n\tvar _LightBox2 = _interopRequireDefault(_LightBox);\n\t\n\tvar _Util = __webpack_require__(1);\n\t\n\tvar _Util2 = _interopRequireDefault(_Util);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\texports.Form = _Form2.default;\n\texports.Tooltip = _Tooltip2.default;\n\texports.Modal = _Modal2.default;\n\texports.Widget = _Widget2.default;\n\texports.Settings = _Settings2.default;\n\texports.Util = _Util2.default;\n\texports.Toggleable = _Toggleable2.default;\n\texports.OffCanvas = _OffCanvas2.default;\n\texports.Dropdown = _Dropdown2.default;\n\texports.LightBox = _LightBox2.default;\n\n/***/ }\n/******/ ])\n});\n;\n\n\n/** WEBPACK FOOTER **\n ** js/flexcss.min.js\n **/"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"../\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n/** WEBPACK FOOTER **\n ** webpack/bootstrap 2abcfdab5a59a5cf6b3b\n **/","/*\n * The MIT License (MIT)\n *\n * Copyright (c) 2015 David Heidrich, BowlingX \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nconst PFX = [\"webkit\", \"moz\", \"MS\", \"o\", \"\"];\n\nconst COL_LEFT_CLASS = 'is-collision-left';\n\nconst COL_RIGHT_CLASS = 'is-collision-right';\n\nconst COL_BOTTOM_CLASS = 'is-collision-bottom';\n\n/**\n * Provides shared DOM-Utility functions\n */\nclass Util {\n\n /**\n * Will register the right animation event based on browser\n * @param element\n * @param type\n * @param callback\n */\n static prefixedAnimateEvent(element, type, callback) {\n const thisFunction = function thisFunction(e) {\n callback.apply(element, [e, thisFunction]);\n };\n\n for (let p = 0; p < PFX.length; p++) {\n let thisType = type;\n if (!PFX[p]) {\n thisType = type.toLowerCase();\n }\n const name = PFX[p] + thisType;\n element.addEventListener(name, thisFunction, true);\n }\n }\n\n /**\n * Get correct transitionend event\n * @returns {String}\n * @private\n */\n static whichTransitionEndEvent() {\n let t;\n const el = document.createElement('fake');\n\n const transitions = {\n transition: 'transitionend',\n OTransition: 'oTransitionEnd',\n MozTransition: 'transitionend',\n WebkitTransition: 'webkitTransitionEnd'\n };\n\n for (t in transitions) {\n if (el.style[t] !== undefined) {\n return transitions[t];\n }\n }\n }\n\n /**\n * Check if target is part of parent node\n * @param target\n * @param parent\n * @returns {boolean}\n */\n static isPartOfNode(target, parent) {\n if (!target || !parent) {\n return false;\n }\n let now = target;\n while (now !== parent && now !== null) {\n if (now === parent) {\n break;\n }\n now = now.parentNode;\n }\n return now !== null;\n }\n\n /**\n * Finds the closest element including itself matching a callback\n * @param {Node} el\n * @param {Function} callback\n * @returns {Node|boolean}\n */\n static closestCallback(el, callback) {\n let element = el;\n while (element !== null) {\n if (callback(element)) {\n return element;\n }\n element = element.parentNode;\n }\n return false;\n }\n\n /**\n * Walks the tree until func returns true for given argument\n * @param target\n * @param func\n * @returns {boolean|HTMLElement}\n */\n static parentsUntil(target, func) {\n if (!target) {\n return false;\n }\n let now = target;\n while (!func(now) && now !== null) {\n now = now.parentNode;\n }\n\n return now;\n }\n\n /**\n * Generates a unique id\n * @return {String}\n */\n static guid() {\n function s4() {\n return Math.floor((1 + Math.random()) * 0x10000)\n .toString(16)\n .substring(1);\n }\n\n return `${s4() + s4()}-${s4()}-${s4()}-${s4()}-${s4() + s4() + s4()}`;\n }\n\n /**\n * Detects scrollbar width\n * @see http://stackoverflow.com/questions/986937/how-can-i-get-the-browsers-scrollbar-sizes\n * @returns {number}\n */\n static getScrollBarWidth() {\n const doc = global.document;\n const inner = doc.createElement('p');\n\n inner.style.width = \"100%\";\n inner.style.height = \"200px\";\n\n const outer = doc.createElement('div');\n outer.style.position = \"absolute\";\n outer.style.top = \"0px\";\n outer.style.left = \"0px\";\n outer.style.visibility = \"hidden\";\n outer.style.width = \"200px\";\n outer.style.height = \"150px\";\n outer.style.overflow = \"hidden\";\n outer.appendChild(inner);\n\n doc.body.appendChild(outer);\n const w1 = inner.offsetWidth;\n outer.style.overflow = 'scroll';\n let w2 = inner.offsetWidth;\n if (w1 === w2) {\n w2 = outer.clientWidth;\n }\n doc.body.removeChild(outer);\n\n return (w1 - w2);\n }\n\n\n /**\n * Run an event once\n * @param {String} ev\n * @param {HTMLElement|HTMLDocument} target\n * @param {Function} func\n * @param {boolean} [capture]\n * @return Function created listener\n */\n static addEventOnce(ev, target, func, capture) {\n const thisFunction = function thisFunction(event) {\n func(event, func);\n target.removeEventListener(ev, thisFunction, capture);\n };\n target.addEventListener(ev, thisFunction, capture);\n return thisFunction;\n }\n\n /**\n * Checks if an element is visible\n * @param {HTMLElement} element\n * @returns bool\n */\n static isVisible(element) {\n return element.offsetWidth > 0 && element.offsetHeight > 0;\n }\n\n /**\n * Creates a camelCaseRepresentation of a dashed string\n * @param {String} str\n * @returns String\n */\n static dashToCamelCase(str) {\n return str.replace(/-([a-z])/g, (g) => {\n return g[1].toUpperCase();\n });\n }\n\n /**\n * Creates a copy of `input`\n * @param {*} input\n * @return *\n */\n static copy(input) {\n return JSON.parse(JSON.stringify(input));\n }\n\n /**\n * Reads options from element (data attributes) and applies to base\n * @param {HTMLElement} element\n * @param {Object} base\n * @return {Object}\n */\n static applyOptionsFromElement(element, base) {\n if (!element) {\n return base;\n }\n const attrs = element.attributes;\n for (let i = 0; i < attrs.length; i++) {\n const attr = attrs[i];\n if (attr) {\n const s = Util.dashToCamelCase(attr.nodeName.replace('data-', ''));\n const val = attr.nodeValue;\n if (base.hasOwnProperty(s)) {\n // skip functions\n if (typeof base[s] === 'function') {\n continue;\n }\n if (typeof base[s] === 'boolean') {\n base[s] = parseInt(val || 1, 10) === 1;\n } else {\n base[s] = val;\n }\n }\n }\n }\n return base;\n }\n\n /**\n * Will position an element directly at given target\n * Is aware of a given collision container to detect edges\n * Will put elementToPosition either to left, center or right edge (prefer right)\n * and either to bottom or top (prefers bottom)\n *\n * You may overwrite preferred positioned with `centerHorizontal` and `positionTop`\n *\n * @param {HTMLElement|ClientRect} target the target container to align to\n * @param {HTMLElement} elementToPosition the element to position\n * @param {HTMLElement} collisionContainer the outer container to prevent collisions\n * @param {boolean} [centerHorizontal] set true to center element, otherwise it's put on the right border by default\n * @param {boolean} [positionTop] flip top, by default element is positioned to the bottom.\n * @returns {HTMLElement}\n */\n static setupPositionNearby(target, elementToPosition, collisionContainer, centerHorizontal, positionTop) {\n // determine relative offsets\n let amountTop = 0;\n let amountLeft = 0;\n Util.parentsUntil(target.parentNode, (el) => {\n if (!(el instanceof HTMLElement)) {\n return false;\n }\n const style = window.getComputedStyle(el);\n if (Util.isPartOfNode(elementToPosition, el)) {\n if (style && style.position === 'relative') {\n amountTop += el.offsetTop || 0;\n amountLeft += el.offsetLeft || 0;\n }\n return false;\n }\n return true;\n });\n\n const targetPosition = target instanceof HTMLElement ? target.getBoundingClientRect() : target;\n const elementRect = elementToPosition.getBoundingClientRect();\n const colRect = collisionContainer.getBoundingClientRect();\n const targetTop = targetPosition.top - amountTop;\n const targetRight = targetPosition.right;\n const isCollisionTop = (targetTop - elementRect.height) <= 0;\n const isCollisionBottom =\n window.innerHeight < (targetTop + amountTop + targetPosition.height + elementRect.height);\n const isCollisionLeft = targetRight < elementRect.width;\n const targetLeft = targetPosition.left;\n const isCollisionRight = (targetLeft + elementRect.width) > colRect.width;\n const classList = elementToPosition.classList;\n\n classList.remove(COL_RIGHT_CLASS);\n classList.remove(COL_LEFT_CLASS);\n classList.remove(COL_BOTTOM_CLASS);\n\n let calcTop;\n let calcLeft;\n if (isCollisionLeft && !isCollisionRight) {\n // put element to left if collision with left\n calcLeft = `${(targetPosition.left - colRect.left - amountLeft)}px`;\n classList.add(COL_LEFT_CLASS);\n } else {\n // maybe center if no collision with either side\n const rightPosition = `${(targetRight - elementRect.width - colRect.left - amountLeft)}px`;\n const leftCentered = ((targetLeft + targetPosition.width / 2) -\n (elementRect.width / 2) || 0) - colRect.left;\n const collisionCentered = (leftCentered + elementRect.width) > colRect.width;\n if (centerHorizontal && !collisionCentered) {\n calcLeft = `${leftCentered}px`;\n } else {\n classList.add(COL_RIGHT_CLASS);\n calcLeft = rightPosition;\n }\n }\n\n if (isCollisionBottom || (positionTop && !isCollisionTop)) {\n // Put Element on top if collision\n calcTop = `${(targetTop - elementRect.height) - colRect.top}px`;\n classList.add(COL_BOTTOM_CLASS);\n } else {\n calcTop = `${(targetTop + targetPosition.height) - colRect.top}px`;\n }\n\n elementToPosition.style.cssText = `top:${calcTop};left:${calcLeft};`;\n\n return elementToPosition;\n }\n\n /**\n * Brings a given element into viewport\n * @param {HTMLElement} el\n * @param {int|function}[optionalOffset]\n */\n static scrollToElement(el, optionalOffset) {\n el.scrollIntoView();\n let thisOffset = optionalOffset;\n // optionally use a additional scrollDif\n if (thisOffset) {\n if (typeof thisOffset === 'function') {\n thisOffset = optionalOffset();\n }\n if (thisOffset > 0) {\n const scrolledY = window.pageYOffset;\n if (scrolledY) {\n window.scroll(0, scrolledY - thisOffset);\n }\n }\n }\n }\n}\n\nexport default Util;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/main/util/Util.js\n **/","/*\n * The MIT License (MIT)\n *\n * Copyright (c) 2015 David Heidrich, BowlingX \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\nimport Util from './Util';\n\n// we attach global settings to global once because settings might be shared a lot of times trough the application\n// Maybe find a better way to handle that scenario\nif (!global.FLEXCSS_GLOBAL_SETTINGS) {\n global.FLEXCSS_GLOBAL_SETTINGS = {\n // defined breakpoint for small devices < n\n smallBreakpoint: 768,\n // nodes that should be updated when no scrollbar is expected\n scrollbarUpdateNodes: global.document.body !== null ? [global.document.body] : [],\n // additional Delay until darkener is fully hidden\n darkenerFadeDelay: 100,\n // class that is added if canvas has been toggled\n canvasToggledClass: 'toggled-canvas'\n };\n\n global.FLEXCSS_CONST_IS_IOS = null;\n\n global.FLEXCSS_CONST_IS_TOUCH = null;\n\n global.FLEXCSS_CONST_IS_IE = null;\n\n global.FLEXCSS_CONST_TAB_EVENT = 'click';\n\n global.FLEXCSS_IS_SMALL_SCREEN = false;\n\n const init = () => {\n // Measure scrollbar width\n global.FLEXCSS_CONST_SCROLLBAR_WIDTH = Util.getScrollBarWidth();\n // detect right transition end event\n global.FLEXCSS_CONST_TRANSITION_EVENT = Util.whichTransitionEndEvent();\n };\n\n if (global.document.readyState !== 'loading') {\n init();\n } else {\n // it's possible that global.document.body is not available if the document is not\n // loaded completely\n document.addEventListener('DOMContentLoaded', () => {\n init();\n });\n }\n}\n\n/**\n * Utility class that setups global settings\n */\nclass Settings {\n\n /**\n * Setup global settings, overwrite default values\n * @param {Object} settings\n */\n static setup(settings) {\n Object.assign(global.FLEXCSS_GLOBAL_SETTINGS, settings);\n }\n\n /**\n * Access to global settings\n * @returns {Object}\n */\n static get() {\n return global.FLEXCSS_GLOBAL_SETTINGS;\n }\n\n /**\n * Detects a IOS Device, caches subsequent calls\n * @returns {boolean}\n */\n static isIosDevice() {\n if (!global.FLEXCSS_CONST_IS_IOS) {\n global.FLEXCSS_CONST_IS_IOS = global.navigator.userAgent.match(/(iPad|iPhone|iPod)/i);\n }\n\n return global.FLEXCSS_CONST_IS_IOS;\n }\n\n /**\n * @returns {boolean}\n */\n static isSmallScreen() {\n return window.innerWidth < Settings.get().smallBreakpoint;\n }\n\n /**\n * Detects a touch device, caches subsequent calls\n * @returns {boolean}\n */\n static isTouchDevice() {\n if (!global.FLEXCSS_CONST_IS_TOUCH) {\n global.FLEXCSS_CONST_IS_TOUCH = 'ontouchstart' in window || !!(global.navigator.msMaxTouchPoints);\n }\n return global.FLEXCSS_CONST_IS_TOUCH;\n }\n\n /**\n * Checks if current browser is Internet Explorer\n * @returns {boolean|*}\n */\n static isIE() {\n if (!global.FLEXCSS_CONST_IS_IE) {\n global.FLEXCSS_CONST_IS_IE = \"ActiveXObject\" in window;\n }\n return global.FLEXCSS_CONST_IS_IE;\n }\n\n /**\n * @returns {String}\n */\n static getTransitionEvent() {\n return global.FLEXCSS_CONST_TRANSITION_EVENT;\n }\n\n /**\n * @returns {int}\n */\n static getScrollbarWidth() {\n return global.FLEXCSS_CONST_SCROLLBAR_WIDTH;\n }\n\n /**\n * @returns {String}\n */\n static getTabEvent() {\n return global.FLEXCSS_CONST_TAB_EVENT;\n }\n}\n\nexport default Settings;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/main/util/Settings.js\n **/","/* global CustomEvent */\n\n/*\n * The MIT License (MIT)\n *\n * Copyright (c) 2015 David Heidrich, BowlingX \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n// polyfill for custom events to make thinks work in IE\n// The needed polyfill is so small that I embedded it here\n(function poly() {\n if (!global.CustomEvent || typeof global.CustomEvent !== 'function') {\n const CustomEvent = function CustomEvent(event, params) {\n const thisParams = params ||\n {\n bubbles: false,\n cancelable: false,\n detail: undefined\n };\n const evt = document.createEvent(\"CustomEvent\");\n evt.initCustomEvent(event, thisParams.bubbles,\n thisParams.cancelable, thisParams.detail);\n return evt;\n };\n CustomEvent.prototype = global.Event.prototype;\n global.CustomEvent = CustomEvent;\n }\n})();\n/**\n * Simpler Event dispatching\n */\nclass EventHandler {\n\n /**\n * @param {HTMLElement} target\n * @param {String} name\n */\n constructor(target, name) {\n this.target = target;\n this.defaultOptions = {\n bubbles: true,\n cancelable: true\n };\n\n this.name = name;\n }\n\n /**\n * Set more options\n * @param {Object} options\n * @returns {EventHandler}\n */\n withOptions(options) {\n Object.assign(this.defaultOptions, (options || {}));\n return this;\n }\n\n /**\n * Call with the originalEvent\n * @param {Event} e\n * @returns {EventHandler}\n */\n withOriginal(e) {\n return this.withDetail({\n originalEvent: e\n });\n }\n\n /**\n * Extends the detail part of the event\n * @param {Object} o\n * @returns {EventHandler}\n */\n withDetail(o) {\n if (!this.defaultOptions.detail) {\n this.defaultOptions.detail = {};\n }\n Object.assign(this.defaultOptions.detail, o);\n return this;\n }\n\n /**\n * @returns {CustomEvent}\n */\n fire() {\n const e = new CustomEvent(this.name, this.defaultOptions);\n if (this.target) {\n this.target.dispatchEvent(e);\n }\n return e;\n }\n}\n\nclass Event {\n /**\n * Prepares to dispatch a custom event (without firing)\n * @param {HTMLElement} target\n * @param {String} name\n * @returns {EventHandler}\n */\n static dispatch(target, name) {\n return new EventHandler(target, name);\n }\n\n /**\n * Dispatches a custom event and fires it directly\n * @param {HTMLElement} target\n * @param {String} name\n * @param {Object} [options]\n * @returns {CustomEvent}\n */\n static dispatchAndFire(target, name, options) {\n return new EventHandler(target, name).withOptions(options).fire();\n }\n}\n\nexport default Event;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/main/util/Event.js\n **/","/*\n * The MIT License (MIT)\n *\n * Copyright (c) 2015 David Heidrich, BowlingX \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n/*!\n * FlexCss.Widget\n * Licensed under the MIT License (MIT)\n * Copyright (c) 2015 David Heidrich, BowlingX \n */\n\n/**\n * A Widget provides async content on a specific target (e.g. a modal link)\n */\nclass Widget {\n\n /**\n * Creates a new Widget\n * @param [element], optional define the content of widget\n */\n constructor(element) {\n /**\n *\n * @type {Promise}\n */\n this.asyncContent = null;\n\n /**\n * @type {boolean}\n */\n this._isWidget = true;\n\n if (element) {\n /**\n * @type {HTMLElement}\n */\n this.element = element instanceof HTMLElement ? element : global.document.getElementById(element);\n if (this.element) {\n this.element.hfWidgetInstance = this;\n this.setAsync(() => {\n return new Promise((s) => {\n s(this.element);\n });\n });\n } else {\n throw new Error(`Could not found element with ID: ${element}`);\n }\n }\n /**\n * The final resulted content that a widget did create (e.g. a modal container)\n * @type {HTMLElement}\n */\n this.finalContent = null;\n }\n\n /**\n *\n * @returns {Promise}\n */\n getAsync() {\n return this.asyncContent();\n }\n\n /**\n * @param {Function.} async\n * @returns {Widget}\n */\n setAsync(async) {\n this.asyncContent = async;\n return this;\n }\n\n /**\n * @returns {HTMLElement}\n */\n getFinalContent() {\n return this.finalContent;\n }\n\n /**\n * @param {HTMLElement} element\n * @returns {Widget}\n */\n setElement(element) {\n this.element = element;\n return this;\n }\n\n /**\n * Destroys the generated content of this widget\n * @returns {boolean}\n */\n destroy() {\n if (this.finalContent && this.finalContent.parentNode) {\n this.finalContent.parentNode.removeChild(this.finalContent);\n return true;\n }\n\n delete this.element;\n delete this.asyncContent;\n delete this.finalContent;\n\n return false;\n }\n\n /**\n * Will find a widget on an Element\n * @param {HTMLElement} element\n * @returns {Widget|undefined}\n */\n static findWidget(element) {\n return element ? element.hfWidgetInstance : undefined;\n }\n\n /**\n * Checks if a given object is an instance\n * @param {Object} self\n * @returns {boolean}\n */\n static isWidget(self) {\n return self instanceof Widget || typeof self === 'object' && self.hasOwnProperty('_isWidget');\n }\n}\n\nexport default Widget;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/main/Widget.js\n **/","/*\n * The MIT License (MIT)\n *\n * Copyright (c) 2015 David Heidrich, BowlingX \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n/**\n * Provides a Basic Widget\n */\nclass DestroyableWidget {\n\n constructor() {\n this.listeners = [];\n }\n\n /**\n * Destroys a Widget\n */\n destroy() {\n this.listeners.forEach((listener) => {\n listener.element.removeEventListener.apply(listener.element, listener.args);\n });\n this.listeners = [];\n }\n\n /**\n * Adds an event and registers it later to remove bindings\n * @param {HTMLElement} element\n * @param {String} name\n * @param {Function} listener\n * @param {boolean} [capture]\n * @returns {Function}\n */\n addEventListener(element, name, listener, capture) {\n this.listeners.push({\n element,\n args: [name, listener, capture]\n });\n\n element.addEventListener(name, listener, capture);\n return listener;\n }\n\n}\n\nexport default DestroyableWidget;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/main/DestroyableWidget.js\n **/","/*\n * The MIT License (MIT)\n *\n * Copyright (c) 2015 David Heidrich, BowlingX \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n/*!\n * FlexCss.Tooltip\n * Licensed under the MIT License (MIT)\n * Copyright (c) 2015 David Heidrich, BowlingX \n */\n\nimport Util from './util/Util';\nimport DestroyableWidget from './DestroyableWidget';\nimport Settings from './util/Settings';\n\n/**\n * @type {string}\n */\nconst CLASS_NAMES_TOOLTIP = 'tooltip-container';\n/**\n * @type {string}\n */\nconst CLASS_NAMES_OPEN = 'open';\n\n/**\n * @type {string}\n */\nconst ATTR_DATA_CLASSNAME = 'data-class';\n\n/**\n * @type {string}\n */\nconst ATTR_DATA_NO_TOUCH = 'data-no-touch';\n\n/**\n * @type {HTMLDocument}\n */\nconst doc = global.document;\n\n/**\n * Simple Tooltip\n */\nclass Tooltip extends DestroyableWidget {\n\n /**\n * Creates a Tooltip\n * @param {HTMLElement|String} DelegateContainer\n * @param {Object} [options]\n */\n constructor(DelegateContainer, options) {\n super();\n /**\n * The Container where possible events are captured\n */\n this.container = DelegateContainer instanceof HTMLElement ?\n DelegateContainer : doc.getElementById(DelegateContainer);\n\n if (!this.container) {\n throw new Error('Could not create Tooltip, DelegateContainer not found');\n }\n\n /**\n * The Container where tooltips are stored for this instance\n * @type {HTMLElement}\n */\n this.tooltipContainer = null;\n\n /**\n * Default Options\n */\n this.options = {\n containerClass: '',\n selectorAttribute: 'data-tooltip',\n collisionContainer: this.container\n };\n\n Object.assign(this.options, options || {});\n }\n\n /**\n * Creates and shows a tooltip\n * @param {HTMLElement} target where is this tooltip positioned\n * @param {String} text text content in tooltip, will be NOT escaped\n * @param {Boolean} [removeTitle] removes title element if given\n * @param {Node} [positionRelative]\n */\n createTooltip(target, text, removeTitle, positionRelative) {\n // abort if text is empty\n if (!text || text && text.trim() === '') {\n return;\n }\n\n if (Settings.isTouchDevice() && target && target.hasAttribute(ATTR_DATA_NO_TOUCH)) {\n return;\n }\n\n let tooltipContainer = this.tooltipContainer;\n\n if (!tooltipContainer) {\n tooltipContainer = doc.createElement('div');\n this.container.appendChild(tooltipContainer);\n this.tooltipContainer = tooltipContainer;\n }\n this._restoreClassNames(tooltipContainer, target);\n\n tooltipContainer.style.left = 'auto';\n tooltipContainer.style.top = 'auto';\n tooltipContainer.innerHTML = text;\n tooltipContainer.flexTooltipCurrentTarget = target;\n if (removeTitle) {\n target.oldTitle = text;\n target.removeAttribute('title');\n }\n\n Util.setupPositionNearby(positionRelative || target, tooltipContainer,\n this.options.collisionContainer, true, true);\n\n tooltipContainer.classList.add(CLASS_NAMES_OPEN);\n }\n\n _restoreClassNames(container, target) {\n // allow additional classname per tooltip on target element\n const classNames = [CLASS_NAMES_TOOLTIP, this.options.containerClass];\n const maybeTargetClass = target.getAttribute(ATTR_DATA_CLASSNAME);\n if (maybeTargetClass) {\n classNames.push(maybeTargetClass);\n }\n container.className = classNames.join(\" \");\n return this;\n }\n\n /**\n * @returns {HTMLElement|null}\n */\n getCurrentTarget() {\n return this.tooltipContainer ? this.tooltipContainer.flexTooltipCurrentTarget : null;\n }\n\n /**\n * Destroys this Widget\n * @returns {boolean}\n */\n destroy() {\n super.destroy();\n\n if (this.tooltipContainer) {\n this.tooltipContainer.parentNode.removeChild(this.tooltipContainer);\n return true;\n }\n return false;\n }\n\n /**\n * Removes a Tooltip on given target\n * @param {HTMLElement} [target], if not given will remove current open tooltip on this instance\n */\n removeTooltip(target) {\n let selfTarget = target;\n if (!selfTarget && this.tooltipContainer) {\n selfTarget = this.tooltipContainer.flexTooltipCurrentTarget;\n }\n if (this.tooltipContainer) {\n if (this.tooltipContainer.flexTooltipCurrentTarget !== selfTarget) {\n return;\n }\n this.tooltipContainer.classList.remove(CLASS_NAMES_OPEN);\n delete this.tooltipContainer.flexTooltipCurrentTarget;\n }\n if (selfTarget && selfTarget.oldTitle) {\n selfTarget.setAttribute('title', selfTarget.oldTitle);\n }\n }\n\n /**\n * Initilizes mouse events on container element\n */\n registerEvents() {\n const self = this;\n this.addEventListener(this.container, 'mouseover', (e) => {\n if (e.target.hasAttribute(self.options.selectorAttribute)) {\n self.createTooltip(e.target, e.target.getAttribute('title'), true);\n }\n });\n\n this.addEventListener(this.container, 'mouseout', (e) => {\n if (e.target.hasAttribute(self.options.selectorAttribute)) {\n self.removeTooltip(e.target);\n }\n });\n return this;\n }\n}\n\nexport default Tooltip;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/main/Tooltip.js\n **/","import Settings from '../util/Settings';\nimport debounce from './debounce';\nimport Event from '../util/Event';\nimport Util from '../util/Util';\n\nconst CLS_FIXED_WINDOW = 'fixed-window-open';\n\nexport const EVENT_BEFORE_FIXED_ADD = 'flexcss.fixedWindow.beforeAdd';\nexport const EVENT_AFTER_FIXED_REMOVE = 'flexcss.fixedWindow.afterRemove';\n\n/**\n * @type {FixedWindow}\n */\nlet fixedWindowInstance;\n\nexport default class FixedWindow {\n\n constructor() {\n this.widgets = [];\n this.currentScrollTop = 0;\n this.fixedScreenConstraints = [];\n this.windowWidth = 0;\n this.isFixedWindowActive = false;\n this.touchListener = null;\n }\n\n /**\n * Adds a constraint to detect if the window needs to be changed when the screensize changes\n *\n * @param {Function} widget\n * @param {Function} fixedBreakpointFn gets a width argument, return true to open a window\n */\n addScreenConstraint(widget, fixedBreakpointFn) {\n this.fixedScreenConstraints[widget] = fixedBreakpointFn;\n }\n\n /**\n * @returns {null|DestroyableWidget}\n */\n getCurrentWidget() {\n return this.widgets.length > 0 ? this.widgets[this.widgets.length - 1] : null;\n }\n\n /**\n * @private\n */\n _checkFixedNeeded() {\n if (this.widgets.length === 0) {\n return;\n }\n const widgets = new Set(this.widgets);\n const widgetsThatRequireFixedWindow = Array.from(widgets).some(({ widget }) => {\n return this.fixedScreenConstraints[widget] && this.fixedScreenConstraints[widget](this.windowWidth);\n });\n if (!widgetsThatRequireFixedWindow) {\n this._removeFixedContainer();\n } else {\n this._addFixedContainer();\n }\n }\n\n /**\n * @private\n */\n _addFixedContainer() {\n if (this.isFixedWindowActive) {\n return;\n }\n Event.dispatchAndFire(global.document, EVENT_BEFORE_FIXED_ADD, {\n detail: this.getCurrentWidget()\n });\n // this causes layout and should be optimized\n // At lest we write in a batch later\n Settings.get().scrollbarUpdateNodes.map((n) => {\n let foundProperty = 'paddingRight';\n let direction = 1;\n let node = n;\n if (n instanceof Array) {\n const [whatNode, property, d] = n;\n foundProperty = property;\n node = whatNode;\n direction = d || 1;\n }\n return {\n node,\n property: foundProperty,\n value: `${parseInt(global.getComputedStyle(node)[foundProperty], 10) +\n (!node.__fixedWindowMod__ ? (Settings.getScrollbarWidth() * direction) : 0)}px`\n };\n }).forEach((d) => {\n d.node.__fixedWindowMod__ = true;\n d.node.style[d.property] = d.value;\n });\n\n this.touchListener = (e) => {\n e.preventDefault();\n };\n\n let shouldNotMove = false;\n this.touchStartListener = (e) => {\n const { element } = this.getCurrentWidget();\n if (Util.isPartOfNode(e.target, element)) {\n if (element.scrollTop === 0) {\n element.scrollTop = 1;\n shouldNotMove = true;\n } else if (element.scrollHeight === element.scrollTop + element.offsetHeight) {\n shouldNotMove = true;\n element.scrollTop -= 1;\n }\n }\n };\n\n global.addEventListener('touchmove', this.touchListener);\n global.document.body.addEventListener('touchstart', this.touchStartListener);\n\n this.touchMoveListener = (e) => {\n const { element } = this.getCurrentWidget();\n if (Util.isPartOfNode(e.target, element)) {\n if (!shouldNotMove) {\n e.stopImmediatePropagation();\n }\n shouldNotMove = false;\n }\n };\n global.document.body.addEventListener('touchmove', this.touchMoveListener);\n\n global.document.documentElement.classList.add(CLS_FIXED_WINDOW);\n this.isFixedWindowActive = true;\n }\n\n /**\n * @private\n */\n _removeFixedContainer() {\n if (this.isFixedWindowActive) {\n // cleanup event listeners\n global.removeEventListener('touchmove', this.touchListener);\n global.document.body.removeEventListener('touchstart', this.touchStartListener);\n global.document.body.removeEventListener('touchmove', this.touchMoveListener);\n\n // reset scrollbar nodes\n Settings.get().scrollbarUpdateNodes.forEach((node) => {\n if (node instanceof Array) {\n const [whatNode, property] = node;\n delete whatNode.__fixedWindowMod__;\n whatNode.style[property] = '';\n } else {\n delete node.__fixedWindowMod__;\n node.style.paddingRight = '';\n }\n });\n global.document.documentElement.classList.remove(CLS_FIXED_WINDOW);\n Event.dispatchAndFire(global.document, EVENT_AFTER_FIXED_REMOVE);\n this.isFixedWindowActive = false;\n }\n }\n\n /**\n * Will close a window when no widgets are opened that need one\n */\n resizeListener() {\n this.windowWidth = global.innerWidth;\n this._checkFixedNeeded();\n }\n\n /**\n * @returns {FixedWindow}\n */\n static getInstance() {\n if (!fixedWindowInstance) {\n fixedWindowInstance = new FixedWindow();\n fixedWindowInstance.windowWidth = global.innerWidth;\n const eventHandler = fixedWindowInstance.resizeListener.bind(fixedWindowInstance);\n global.addEventListener(\n 'resize',\n debounce(eventHandler, 500)\n );\n global.addEventListener('orientationchange', eventHandler);\n }\n return fixedWindowInstance;\n }\n\n /**\n * Request a close of the fixed window\n */\n close() {\n this.widgets.pop();\n if (this.widgets.length === 0) {\n this._removeFixedContainer();\n resolve();\n }\n }\n\n /**\n * Request to open a fixed windows\n * @param {Object|DestroyableWidget} instance\n * @param {HTMLElement} element\n */\n open(instance, element) {\n let fixed = false;\n if (typeof instance === 'object') {\n const widget = instance.constructor;\n const fixedWidget = this.fixedScreenConstraints[instance.constructor];\n if (widget && fixedWidget) {\n fixed = fixedWidget(this.windowWidth);\n }\n const length = this.widgets.length;\n this.widgets.push(\n {\n widget,\n element\n }\n );\n // open a new window if there is no window active\n if (length === 0) {\n if (fixed) {\n this._addFixedContainer();\n }\n }\n }\n }\n}\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/main/lib/FixedWindow.js\n **/","/*\n * The MIT License (MIT)\n *\n * Copyright (c) 2015 David Heidrich, BowlingX \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n/*!\n * FlexCss.Modal\n * Licensed under the MIT License (MIT)\n * Copyright (c) 2015 David Heidrich, BowlingX \n */\n\n/* global KeyboardEvent */\n\nimport Settings from './util/Settings';\nimport Event from './util/Event';\nimport Util from './util/Util';\nimport Widget from './Widget';\nimport FixedWindow from './lib/FixedWindow';\n\nconst HTML_ELEMENT = global.document.documentElement;\nconst KEY_ESC = 27;\n/* Attribute Names */\nconst ATTR_CREATE_NEW = 'data-new-instance';\nconst ATTR_CLOSE = 'data-close-modal';\nconst ATTR_NAME = 'data-modal';\n\n/* Class names */\nconst CLS_CONTAINER_CURRENT = 'front';\nconst CLS_OPEN = 'open';\nconst CLS_CURRENT = 'current';\nconst CLS_PART_OF_STACK = 'part-of-stack';\nconst CLS_MODAL_OPEN = 'modal-open';\nconst CLS_MODAL_CONTAINER = 'modal-container';\nconst CLS_ANIM_END = 'modal-anim-end';\nconst CLS_LOADER_CONTAINER = 'loader-container';\nconst CLS_LOADER = 'loader';\n\n/* Events */\n\n/**\n * Event triggered when modal is closed\n * @type {string}\n */\nexport const EVENT_MODAL_CLOSED = 'flexcss.modal.closed';\n/**\n * Event triggered before a modal is closed, cancelable\n * @type {string}\n */\nexport const EVENT_MODAL_BEFORE_CLOSED = 'flexcss.modal.beforeClose';\n/**\n * Event triggered when a modal is opened\n * @type {string}\n */\nexport const EVENT_MODAL_OPENED = 'flexcss.modal.opened';\n\n/**\n * Event triggered when modal is initilized, called on target\n * @type {string}\n */\nexport const EVENT_MODAL_INIT = 'flexcss.modal.init';\n\n/**\n * Triggered when the content of an async modal on a target is loaded, called on target\n * @type {string}\n */\nexport const EVENT_MODAL_ASYNC_TARGET_LOADED = 'flexcss.modal.asyncTargetLoaded';\n\n/**\n * A Modal Implementation\n */\nclass Modal {\n constructor(DelegateContainer, options) {\n const doc = global.document;\n const container = DelegateContainer instanceof HTMLElement ?\n DelegateContainer : doc.getElementById(DelegateContainer);\n\n // Instance vars:\n if (!container) {\n throw new Error(`Could not found container element by given ID/Element: ${DelegateContainer}`);\n }\n\n this.currentOpen = null;\n\n this.loading = false;\n\n this.container = container;\n\n /**\n * Default Options\n */\n this.options = {\n classNames: 'modal',\n closeOnEscape: true,\n closeOnBackgroundClick: true,\n destroyOnFinish: false,\n fixedContainer: true,\n containerClassNames: ''\n };\n\n Object.assign(this.options, options);\n\n // Container where events are delegated\n this.eventContainer = null;\n this.eventFunction = null;\n\n this.dataMainPageContainer = global.document.body;\n\n this.currentScrollTop = 0;\n\n this.modalContainer = null;\n\n // Destroy full modal instance when no dialogs are bind to?\n // Otherwise container is recycled\n this.destroyOnFinish = this.options.destroyOnFinish;\n }\n\n /**\n * Removes this modal from global stack\n * Will handle fixing main html element too\n * @private\n * @param n\n */\n _removeModalFromStack(n) {\n const t = Modal._modalInstances.indexOf(n);\n if (t > -1) {\n Modal._modalInstances.splice(t, 1);\n FixedWindow.getInstance().close();\n HTML_ELEMENT.classList.remove(CLS_MODAL_OPEN);\n }\n }\n\n\n /**\n * Modal container that contains all `stacked` modals for this instance\n * @returns {HTMLElement}\n */\n getModalContainer() {\n return this.modalContainer;\n }\n\n /**\n * Closes the current open modal of this stack\n * @params [e], optional event\n * @returns {*}\n */\n close(e) {\n const self = this;\n\n const options = self.currentOpen ? Util.applyOptionsFromElement(\n self.currentOpen, Util.copy(self.options)) : self.options;\n\n // close only on keyboard if instance should\n if (!options.closeOnEscape && e instanceof KeyboardEvent) {\n return false;\n }\n\n // close only on background if instance should\n if (!options.closeOnBackgroundClick && e &&\n e.type === Settings.getTabEvent() && !e.target.hasAttribute(ATTR_CLOSE)) {\n return false;\n }\n\n // if an instance is currently loading, prevent from closing\n if (self.loading) {\n return false;\n }\n\n if (e) {\n e.preventDefault();\n }\n\n if (self.currentOpen) {\n // dispatch beforeClose event, if prevented prevent modal from closing\n var ev = Event.dispatchAndFire(self.currentOpen, EVENT_MODAL_BEFORE_CLOSED);\n if (ev.defaultPrevented) {\n return false;\n }\n\n this._finishState(self.currentOpen);\n // if there is an previous modal\n if (self.currentOpen.prevModal) {\n // switch to the next modal\n return self.switchModals(self.currentOpen.prevModal,\n self.currentOpen.prevModal.prevModal || null);\n }\n\n // finally trigger closed event\n Event.dispatch(self.currentOpen, EVENT_MODAL_CLOSED).withOriginal(e).fire();\n\n }\n self._removeModalFromStack(self.currentOpen);\n\n // Full stack closed:\n self.currentOpen = null;\n if (self.modalContainer) {\n // setup next open\n var lastContainer = Modal._modalInstances[Modal._modalInstances.length - 1],\n classList = self.modalContainer.classList;\n classList.remove(CLS_CONTAINER_CURRENT);\n classList.remove(CLS_OPEN);\n // Remove all current classes from child-nodes\n for (var i = 0; i < self.modalContainer.childNodes.length; i++) {\n var node = self.modalContainer.childNodes[i], cl = node.classList;\n // remove applied styles\n self._finishState(node);\n cl.remove(CLS_CURRENT);\n cl.remove(CLS_PART_OF_STACK);\n }\n if (lastContainer) {\n lastContainer.parentNode.classList.add(CLS_CONTAINER_CURRENT);\n }\n }\n\n if (self.destroyOnFinish) {\n self.destroy();\n }\n return self;\n }\n\n /**\n * Resets a target when newly initilizes\n * @param target\n * @private\n */\n _finishState(target) {\n target.classList.remove(CLS_ANIM_END);\n }\n\n /**\n * Handler called when a Modal has finished an animation\n * @param e\n * @param self\n * @private\n */\n _finishAnim(e, self) {\n e.target.classList.add(CLS_ANIM_END);\n e.target.removeEventListener(e.type, self, true);\n }\n\n /**\n * Brings the given modal to front\n * @param co\n * @param last\n */\n switchModals(co, last) {\n co.prevModal = last;\n Modal._modalInstances.push(co);\n FixedWindow.getInstance().open(this, this.modalContainer);\n if (last) {\n this._finishState(last);\n Util.prefixedAnimateEvent(last, 'AnimationEnd', this._finishAnim);\n last.classList.add(CLS_PART_OF_STACK);\n }\n // set new currentOpen\n this.currentOpen = co;\n\n // bring current container to the front\n var instances = Modal._modalInstances;\n\n for (var m = 0; m < instances.length; m++) {\n instances[m].parentNode.classList.remove(CLS_CONTAINER_CURRENT);\n }\n this.modalContainer.classList.add(CLS_CONTAINER_CURRENT);\n // remove animations if animations has been completed, fixes various bugs:\n // - fixes nested scrolling element issue in iOS Browsers / Mobile-Safari\n Util.prefixedAnimateEvent(co, 'AnimationEnd', this._finishAnim);\n\n for (var i = 0; i < this.modalContainer.childNodes.length; i++) {\n var n = this.modalContainer.childNodes[i], isCurrent = n.classList.contains(CLS_CURRENT);\n if (n === co) {\n co.classList.add(CLS_CURRENT);\n co.classList.remove(CLS_PART_OF_STACK);\n this._finishState(co);\n } else {\n n.classList.remove(CLS_CURRENT);\n if (isCurrent) {\n this._removeModalFromStack(n);\n Event.dispatchAndFire(n, EVENT_MODAL_CLOSED);\n }\n }\n }\n }\n\n handleScrollbar() {\n if (Modal._modalInstances.length === 0) {\n HTML_ELEMENT.classList.add(CLS_MODAL_OPEN);\n }\n }\n\n /**\n * Creates a Modal and opens it (later)\n * @param e\n * @returns {Promise|boolean}\n */\n createWidget(e) {\n var self = this;\n if (this.loading) {\n return false;\n }\n\n // check if another modal has registered events on this dom path:\n if (e && e.target) {\n var foundInstance = Util.parentsUntil(e.target, function (node) {\n return node && node.flexModalInstance;\n });\n\n // if another instance has been found, abort\n if (foundInstance !== this.container) {\n return false;\n }\n }\n var targetContent, future, widget, target, hasTarget = true,\n isHtmlElement = e instanceof HTMLElement, isWidget = Widget.isWidget(e);\n if (isHtmlElement || isWidget) {\n if (isHtmlElement) {\n targetContent = e;\n } else {\n widget = e;\n targetContent = widget.element;\n }\n } else {\n target = e.target;\n if (!target) {\n throw 'Could not find target, did you pass an event, a HTMLElement or an Widget?';\n }\n hasTarget = target.hasAttribute(ATTR_NAME);\n targetContent = target.getAttribute(ATTR_NAME);\n widget = Widget.findWidget(target);\n if (target.hasAttribute(ATTR_CREATE_NEW) && !e.newInstance) {\n var newInstance = new Modal(this.container)\n .setDestroyOnFinish(true);\n e.newInstance = true;\n newInstance.fromEvent(e).then(function () {\n newInstance.registerEvents(newInstance.getModalContainer());\n });\n return false;\n }\n if (hasTarget) {\n e.stopImmediatePropagation();\n e.preventDefault();\n }\n }\n\n if (!hasTarget) {\n return false;\n }\n\n let modalContainerClasses = this.modalContainer ? this.modalContainer.classList : [];\n\n // lazy create modal container\n if (!this.modalContainer) {\n this.modalContainer = global.document.createElement('div');\n this.modalContainer.className = `${CLS_MODAL_CONTAINER} ${this.options.containerClassNames} ${CLS_OPEN}`;\n const closeModalFunction = function (ce) {\n if (self.loading) {\n return false;\n }\n if (Util.isPartOfNode(ce.target, self.currentOpen)) {\n if (!ce.target.hasAttribute(ATTR_CLOSE)) {\n return false;\n }\n }\n self.close(ce);\n };\n\n this.modalContainer.addEventListener(Settings.getTabEvent(), closeModalFunction, false);\n\n modalContainerClasses = this.modalContainer.classList;\n this.container.appendChild(this.modalContainer);\n\n } else {\n modalContainerClasses.add(CLS_OPEN);\n }\n\n let loader, doc = global.document, toggleLoader = function (show) {\n if (show) {\n loader = doc.createElement('div');\n loader.className = CLS_LOADER_CONTAINER;\n var loaderLoader = doc.createElement('div');\n loaderLoader.className = CLS_LOADER;\n loader.appendChild(loaderLoader);\n self.modalContainer.appendChild(loader);\n } else {\n loader.parentNode.removeChild(loader);\n }\n };\n\n this.handleScrollbar();\n\n modalContainerClasses.add(CLS_CONTAINER_CURRENT);\n modalContainerClasses.add('loading');\n this.loading = true;\n toggleLoader(true);\n var async = widget ? widget.getAsync() : null;\n if (Widget.isWidget(widget) && async) {\n future = async.then(function (r) {\n var result;\n if (r instanceof HTMLElement || r instanceof DocumentFragment) {\n result = r;\n } else {\n // Create container Element:\n var element = doc.createElement('div');\n element.className = self.options.classNames;\n element.innerHTML = r;\n element.id = Util.guid();\n result = element;\n }\n widget.finalContent = result;\n Event.dispatchAndFire(target, EVENT_MODAL_ASYNC_TARGET_LOADED);\n return result;\n });\n } else {\n var el = targetContent instanceof HTMLElement ||\n targetContent instanceof DocumentFragment ? targetContent : doc.getElementById(targetContent);\n if (el) {\n future = new Promise((resolve) => {\n resolve(el);\n });\n } else {\n throw 'Could not found given modal element (content) with ID: ' + targetContent;\n }\n }\n\n Event.dispatchAndFire(target, EVENT_MODAL_INIT);\n\n return future.then((thisEl) => {\n thisEl.hfWidgetInstance = self;\n self.modalContainer.appendChild(thisEl);\n modalContainerClasses.remove('loading');\n self.loading = false;\n toggleLoader(false);\n\n self.open(thisEl, true, e);\n\n return thisEl;\n });\n }\n\n /**\n * Open's an already rendered modal\n * @param {HTMLElement} modal\n * @param {Boolean} [internal], set to true to prevent container management\n * @param {Boolean} [maybeEvent], optional event-object that triggered open\n */\n open(modal, internal, maybeEvent) {\n\n\n if (!internal) {\n this.modalContainer.classList.add('open');\n this.handleScrollbar();\n }\n this.switchModals(modal, this.currentOpen);\n\n Event.dispatch(modal, EVENT_MODAL_OPENED).withOriginal(maybeEvent).fire();\n }\n\n\n registerEvents(delegate) {\n var delegateContainer = delegate || this.container, self = this;\n // Modals should always be fixed\n FixedWindow.getInstance().addScreenConstraint(Modal, (width) => true);\n // register modal instance so we can detect multiple registrars\n delegateContainer.flexModalInstance = self;\n self.eventFunction = function () {\n self.createWidget.apply(self, arguments);\n };\n delegateContainer.addEventListener(Settings.getTabEvent(), self.eventFunction, false);\n\n self.eventContainer = delegateContainer;\n return self;\n }\n\n\n /**\n * Creates a new Dialog Instance either directly from HTML Element or a Widget instance\n * @param {HTMLElement|Widget} widget instance or html element\n * @returns {Promise}\n */\n fromWidget(widget) {\n return this.createWidget(widget);\n }\n\n /**\n * Creates a Widget from event\n * @param e\n * @returns {Promise}\n */\n fromEvent(e) {\n return this.createWidget(e);\n }\n\n setDestroyOnFinish(v) {\n this.destroyOnFinish = v;\n return this;\n }\n\n /**\n * Destroy this widget instance, cleans empty DOM nodes\n * Will use fast MutationObserver if available, otherwise falls back to DOMNodeRemoved event\n */\n destroy() {\n let self = this, modalContainer = this.modalContainer;\n const isEmptyContainer = modalContainer.childNodes.length === 0;\n // Remove event listener on destroy, do not remove DOM node\n if (self.eventContainer) {\n self.eventContainer.removeEventListener(Settings.getTabEvent(), self.eventFunction, true);\n }\n\n if (isEmptyContainer) {\n if (modalContainer.parentNode) {\n modalContainer.parentNode.removeChild(modalContainer);\n }\n }\n if (global.MutationObserver) {\n var observer = new MutationObserver(function (mutations) {\n mutations.forEach(function () {\n if (isEmptyContainer) {\n modalContainer.parentNode.removeChild(modalContainer);\n observer.disconnect();\n }\n });\n });\n observer.observe(modalContainer, {childList: true});\n } else {\n modalContainer.addEventListener('DOMNodeRemoved', function (e) {\n if (e.target !== modalContainer && (modalContainer.childNodes.length - 1) === 0) {\n modalContainer.parentNode.removeChild(modalContainer);\n }\n });\n }\n }\n}\n\n\n// Static variable that keeps track of all open modals\nModal._modalInstances = [];\n\n// Global keydown listener for modal\nglobal.addEventListener('keydown', function (e) {\n if (e.keyCode === KEY_ESC) {\n var lastModal = Modal._modalInstances[Modal._modalInstances.length - 1];\n if (lastModal) {\n Widget.findWidget(lastModal).close(e);\n }\n }\n});\n\nexport default Modal;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/main/Modal.js\n **/","/*global HTMLFormElement, fetch, FormData, clearTimeout, NodeList*/\n\n/*\n * The MIT License (MIT)\n *\n * Copyright (c) 2015 David Heidrich, BowlingX \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n/*!\n * FlexCss.Form\n * Licensed under the MIT License (MIT)\n * Copyright (c) 2015 David Heidrich, BowlingX \n */\n\nimport Tooltip from './Tooltip';\nimport 'isomorphic-fetch';\nimport Event from './util/Event';\nimport Util from './util/Util';\nimport Settings from './util/Settings';\nimport DestroyableWidget from './DestroyableWidget';\n\nconst LOADING_CLASS = 'loading';\nconst DATA_ELEMENT_INVALID = 'data-flexcss-invalid';\nconst REMOTE = 'data-remote';\nconst REMOTE_ACTION = 'data-remote-action';\nconst ATTR_DISABLE_INLINE = 'data-disable-inline-validation';\nconst ATTR_DISABLE_REALTIME = 'data-disable-realtime-validation';\nconst ATTR_VALIDATOR = 'data-validate';\nconst ATTR_DATA_CUSTOM_MESSAGE = 'data-validation-message';\nconst ATTR_DATA_CUSTOM_LABEL = 'data-custom-label';\nconst ATTR_VALIDATE_VISIBILITY = 'data-validate-visibility';\nconst ATTR_ERROR_TARGET_ID = 'data-error-target';\nconst ATTR_DEPENDS = 'data-depends-selector';\nconst CONST_USE_JSON = 'json';\nconst CONST_REALTIME_EVENT = 'input';\nconst FOCUS_TOOLTIP_DELAY = 20;\nconst CLICK_TOOLTIP_DELAY = 150;\n\n/**\n * Triggered when form is fully initialized and handlers are binded\n * @type {string}\n */\nexport const EVENT_FORM_READY = 'flexcss.form.ready';\n/**\n * Fires when a form is submitted, cancelable\n * @type {string}\n */\nexport const EVENT_FORM_SUBMIT = 'flexcss.form.submit';\n/**\n * Fired directly after the form has been submitted via ajax\n * @type {string}\n */\nexport const EVENT_FORM_AFTER_AJAX_SUBMIT = 'flexcss.form.afterAjaxSubmit';\n/**\n * Fired when ajax events did complete\n * @type {string}\n */\nexport const EVENT_FORM_AJAX_COMPLETED = 'flexcss.form.ajaxCompleted';\n\n/**\n * A HTML5 Form Validation replacement\n */\n\nclass Form extends DestroyableWidget {\n /**\n * @param {HTMLElement} form\n * @param [options] optional options\n */\n constructor(form, options) {\n super();\n\n if (!(form instanceof HTMLFormElement)) {\n throw 'argument {0} form needs to be an form element';\n }\n\n /**\n * The Form\n * @type {HTMLElement}\n */\n this.form = form;\n\n /**\n * @type {Tooltip}\n */\n this.tooltips = null;\n\n /**\n * @type {Promise}\n */\n this.currentValidationFuture = new Promise(() => {\n });\n\n /**\n * Default options\n * @type {Object}\n */\n this.options = {\n // if true creates tooltips above element, uses FlexCss Tooltips\n createTooltips: true,\n // if true appends error message after input element\n appendError: false,\n // type of ajax submit\n ajaxSubmitType: 'POST',\n // json content type if ajax method is set to json\n ajaxJsonContentType: 'application/json; charset=utf-8',\n // allow inline validation\n inlineValidation: true,\n // validate in realtime (on `input` event)\n realtime: true,\n // timeout when realtime event should be captured\n realtimeTimeout: 250,\n // formatting method for an error\n formatErrorTooltip: (error) => {\n return ' ' + error;\n },\n // the class that will be put on the element to mark it failed validation\n inputErrorClass: 'invalid',\n // the container class for error messages below an element\n containerErrorClass: 'form-error',\n // additional options for fetch\n fetchOptions: {\n credentials: 'include'\n },\n // the container for tooltips\n tooltipContainer: form,\n tooltipOptions: {\n containerClass: 'error-tooltip'\n },\n // if you have a fixed header, either set a number or function here\n scrollToElementDiff: 0\n };\n\n // overwrite default options\n Object.assign(this.options, options);\n\n // apply settings from attributes\n Util.applyOptionsFromElement(form, this.options);\n\n // set form class as widget\n // Forms are very different to classical widgets,\n // we will not use our base widget class for this but just self\n form.hfWidgetInstance = this;\n\n /**\n * A List of Validators\n * @type {Object}\n * @private\n */\n this._validators = Form.globalValidators;\n\n /**\n * @type {Function}\n * @private\n */\n this._remoteValidationFunction = null;\n\n this.initFormValidation();\n }\n\n destroy() {\n super.destroy();\n if (this.tooltips) {\n this.tooltips.destroy();\n }\n }\n\n /**\n * Submits this form, either via ajax or just classical (default)\n * @param {HTMLFormElement} thisForm\n * @param {Event} e\n * @private\n * @returns {Promise|boolean} returns false if submit is cancled\n */\n _submitFunction(thisForm, e) {\n var shouldUseAjax = thisForm.getAttribute(REMOTE), ajaxPostUrl =\n thisForm.getAttribute(REMOTE_ACTION) ||\n thisForm.getAttribute('action') || window.location.href,\n useJson = CONST_USE_JSON === shouldUseAjax, self = this;\n\n var ev = Event.dispatch(thisForm, EVENT_FORM_SUBMIT).withOriginal(e).fire();\n\n // abort execution is event was prevented\n if (ev.defaultPrevented) {\n self._formStopLoading();\n return false;\n }\n\n if (shouldUseAjax === null) {\n // submit\n return thisForm.submit();\n }\n // prevent form from submit normally\n e.preventDefault();\n\n // add information that this is an XMLHttpRequest request (used by some frameworks)\n let defaultHeaders = {\n 'X-Requested-With': 'XMLHttpRequest'\n };\n\n // setup default headers\n if (useJson) {\n Object.assign(defaultHeaders, {\n 'Content-Type': this.options.ajaxJsonContentType\n });\n }\n let defaultOptions = Object.assign(this.options.fetchOptions, {\n headers: defaultHeaders,\n method: this.options.ajaxSubmitType\n });\n\n // support either JSON request payload or normal payload submission\n var serverCall = useJson ? fetch(ajaxPostUrl, Object.assign(defaultOptions, {\n body: JSON.stringify(this.serialize())\n })) : fetch(ajaxPostUrl, Object.assign(defaultOptions, {\n body: new FormData(thisForm)\n }));\n\n Event.dispatch(thisForm, EVENT_FORM_AFTER_AJAX_SUBMIT).withOriginal(e).fire();\n\n return serverCall.then((r) => {\n (self._remoteValidationFunction || Form.globalRemoteValidationFunction).apply(self, [r]);\n\n Event.dispatch(thisForm, EVENT_FORM_AJAX_COMPLETED).withOriginal(e).withDetail({ response: r }).fire();\n // always remove error class\n self._formStopLoading();\n });\n }\n\n /**\n * Serializes a form to a json object\n * @returns {Object}\n */\n serialize() {\n var selectors = [\n 'input[name]:not([type=\"radio\"]):enabled',\n 'input[type=\"radio\"][name]:checked',\n 'select[name]:enabled',\n 'textarea[name]:enabled'\n ], inputs = this.form.querySelectorAll(selectors.join(',')), result = {};\n\n Array.prototype.forEach.call(inputs, function (input) {\n var exists = result[input.name], value = input.value;\n if (exists instanceof Array) {\n exists.push(value);\n } else if (exists) {\n result[input.name] = [result[input.name], value];\n } else {\n result[input.name] = value;\n }\n });\n\n return result;\n }\n\n /**\n * Handles the chain of validation on given fields\n *\n * @param {HTMLElement|Array|NodeList} field\n * @param [focus] optional focus first error\n * @returns {Promise}\n */\n handleValidation(field, focus) {\n var fields = (field instanceof Array || field instanceof NodeList) ? field : [field];\n return this._handleValidation(fields, focus, true).then(((r) => {\n if (!r.foundAnyError) {\n // remove tooltips\n if (this.tooltips) {\n this.tooltips.removeTooltip();\n }\n }\n return r;\n }).bind(this));\n }\n\n /**\n * Handles errors on given node list\n * @param {NodeList} toValidateFields\n * @param {boolean} focus\n * @param {boolean} scoped if true, will only validate the fields `invalidFields`\n * @returns {Promise}\n * @private\n */\n _handleValidation(toValidateFields, focus, scoped) {\n var self = this;\n var arr = Form._createArrayFromInvalidFieldList(toValidateFields), isLocalInvalid = arr.length > 0;\n // focus must appear in the same frame for iOS devices\n if (isLocalInvalid && focus) {\n self._focusElement(arr[0]);\n }\n var validation = scoped ? this._customValidationsForElements(toValidateFields) :\n self.validateCustomFields();\n return validation.then((r) => {\n if (isLocalInvalid) {\n // combine browser and custom validators\n r.foundAnyError = true;\n }\n // get a unique field list of all fields that need to be checked and rendered\n // it's possible that we have duplicates in non scoped mode\n let thisToValidateFields = scoped ? toValidateFields :\n Array.from(arr).concat(r.checkedFields);\n r.checkedFields = thisToValidateFields;\n let foundInvalidFields = self.prepareErrors(thisToValidateFields, false),\n firstInvalidField = foundInvalidFields[0];\n if (firstInvalidField) {\n if (focus) {\n self._focusElement(firstInvalidField);\n // if element could not be focused:\n if (document.activeElement !== firstInvalidField) {\n self._handleTooltipHideClickAfterChange();\n }\n } else {\n self._handleTooltipHideClickAfterChange();\n }\n self.showAndOrCreateTooltip(firstInvalidField);\n }\n return r;\n });\n }\n\n /**\n * @param {HTMLElement} field\n * @param {ValidityState} validity\n * @returns {*}\n * @private\n */\n\n _setupErrorMessages(field, validity) {\n return Form.globalErrorMessageHandler ?\n Form.globalErrorMessageHandler.apply(this, [field, validity]) : false;\n }\n\n /**\n * Handles class labels for elements\n * @param {Object} fields\n * @private\n */\n _handleLabels(fields) {\n Object.keys(fields).forEach(function (id) {\n let labels = this.getForm().querySelectorAll('[for=\"' + id + '\"]'), invalid = fields[id];\n if (labels.length) {\n for (let labelsIndex = 0; labelsIndex < labels.length; labelsIndex++) {\n let labelEl = labels[labelsIndex];\n // we can't use toggle attribute, not supported in IE\n if (invalid) {\n this._markElementInvalid(labelEl);\n } else {\n this._markElementValid(labelEl);\n }\n }\n }\n }.bind(this));\n }\n\n /**\n * @param el\n * @private\n */\n _markElementInvalid(el) {\n el.setAttribute(DATA_ELEMENT_INVALID, \"true\");\n el.classList.add(this.options.inputErrorClass);\n }\n\n /**\n * @param el\n * @private\n */\n _markElementValid(el) {\n el.removeAttribute(DATA_ELEMENT_INVALID);\n el.classList.remove(this.options.inputErrorClass);\n }\n\n /**\n * A List of invalid elements (:invalid)\n * @returns {Array}\n * @private\n */\n _getInvalidElements() {\n return Array.prototype.filter.call(this.getForm().querySelectorAll(\":invalid\"), function (r) {\n return !(r instanceof HTMLFieldSetElement);\n });\n }\n\n /**\n * @param {HTMLElement} thisParent\n * @private\n */\n _removeElementErrors(thisParent) {\n let errors = thisParent.querySelectorAll('.' + this.options.containerErrorClass), inputsWithErrorClasses =\n thisParent.querySelectorAll(`[${DATA_ELEMENT_INVALID}]`);\n for (let elementErrorIndex = 0; elementErrorIndex < errors.length; elementErrorIndex++) {\n errors[elementErrorIndex].parentNode.removeChild(errors[elementErrorIndex]);\n }\n for (let inputErrorIndex = 0; inputErrorIndex < inputsWithErrorClasses.length; inputErrorIndex++) {\n let el = inputsWithErrorClasses[inputErrorIndex];\n this._markElementValid(el);\n }\n }\n\n\n /**\n * Registers a custom validator\n * @param {String} name\n * @param {Function} validator a validation function should always return either a Future(true) or Future(false)\n * even when the field has been invalidated with `setCustomValidity`, because of different browser `bugs`\n * we can't rely on that\n * @returns {Form}\n */\n registerValidator(name, validator) {\n this._validators[name] = validator;\n return this;\n }\n\n /**\n * Runs async validation\n * @param {String} validationRef\n * @param {HTMLElement} field\n * @returns {Promise}\n * @private\n */\n _runValidation(validationRef, field) {\n if (!this._validators[validationRef]) {\n throw 'Could not found validator: ' + validationRef;\n }\n var cl = field.classList, future = this._validators[validationRef].apply(this, [field, this.form]);\n cl.add(LOADING_CLASS);\n future.then(() => {\n cl.remove(LOADING_CLASS);\n });\n return future;\n }\n\n\n /**\n * Run custom validations for elements, validations are done async do support XHR Requests or other stuff\n *\n * @param {Array|NodeList} fields\n * @returns {Promise} contains either true if validations passed or false if something went wrong\n * @private\n */\n _customValidationsForElements(fields) {\n var futures = [], fieldsLength = fields.length, checkedFields = [];\n for (var iVal = 0; iVal < fieldsLength; iVal++) {\n var field = fields[iVal], validationRef = field.getAttribute(ATTR_VALIDATOR), validity = field.validity;\n if (this._validators[validationRef]) {\n // use local validation first and then continue with custom validations\n if (Form._shouldNotValidateField(field) || (validity && !validity.customError && !validity.valid)) {\n continue;\n }\n checkedFields.push(field);\n futures.push(this._runValidation(validationRef, field));\n } else {\n if (validationRef) {\n console.warn('data-validate was set but no validator was found');\n }\n }\n }\n return Promise.all(futures).then(function (allFutures) {\n let l = allFutures.length;\n let result = {\n checkedFields: checkedFields,\n foundAnyError: false\n };\n for (var fI = 0; fI < l; fI++) {\n if (!allFutures[fI]) {\n result.foundAnyError = true;\n break;\n }\n }\n return result;\n });\n }\n\n /**\n * Remove all errors for this form\n * @returns {Form}\n */\n removeErrors() {\n this._removeElementErrors(this.form);\n if (this.tooltips) {\n this.tooltips.removeTooltip();\n }\n return this;\n }\n\n /**\n * Will handle errors for given fields\n * @param {Array|NodeList} fields\n * @param {Boolean} removeAllErrors\n */\n prepareErrors(fields, removeAllErrors) {\n if (removeAllErrors) {\n this.removeErrors();\n }\n let labelGroups = {}, invalidFields = [];\n\n function handleAdditionalLabels(isInvalid, thisLabelGroup, field) {\n let additionalLabels = field.getAttribute(ATTR_DATA_CUSTOM_LABEL) ||\n field.id, group = thisLabelGroup[additionalLabels];\n if (additionalLabels) {\n // check additionally if field is currently marked as invalid\n // so the label is not marked as error if no field is marked as one\n group = group ? group : isInvalid;\n thisLabelGroup[additionalLabels] = group;\n }\n }\n\n // We save all validations in an extra property because we need to reset the validity due some\n // implementation errors in other browsers then chrome\n for (let i = 0; i < fields.length; i++) {\n let field = fields[i], errorTarget = Form._findErrorTarget(field), parent = errorTarget.parentNode,\n validity = field.validity, isInvalid = validity && !validity.valid;\n if (Form._shouldNotValidateField(field)) {\n continue;\n }\n field.flexFormsSavedValidity = JSON.parse(JSON.stringify(validity));\n handleAdditionalLabels(isInvalid, labelGroups, field);\n if (isInvalid) {\n if (!removeAllErrors) {\n // Remove current errors:\n this._removeElementErrors(parent);\n }\n // setup custom error messages:\n this._setupErrorMessages(field, validity);\n let msg = field.validationMessage;\n\n // mark fields as invalid\n this._markElementInvalid(errorTarget);\n this._markElementInvalid(field);\n\n if (this.options.appendError) {\n parent.insertAdjacentHTML(\"beforeend\",\n `
${msg}
`);\n }\n invalidFields.push(field);\n field.flexFormsSavedValidationMessage = msg;\n } else {\n // restore invalid fields\n this._markElementValid(errorTarget);\n this._markElementValid(field);\n\n // cleanup\n delete field.flexFormsSavedValidationMessage;\n\n // remove error markup\n this._removeElementErrors(parent);\n }\n // We have to reset the custom validity here to allow native validations work again\n field.setCustomValidity('');\n }\n // if validates a single field we need to check the linked fields to a label:\n if (fields.length === 1) {\n let field = fields[0];\n let id = field.getAttribute(ATTR_DATA_CUSTOM_LABEL) || field.id;\n if (id) {\n let linkedFields = Array.from(\n this.getForm().querySelectorAll(`[${ATTR_DATA_CUSTOM_LABEL}=\"${id}\"], #${id}`));\n linkedFields.forEach(function (thisField) {\n let validity = thisField.validity, isInvalid = validity && !validity.valid &&\n this._isElementInvalidElement(thisField);\n handleAdditionalLabels(isInvalid, labelGroups, thisField);\n }.bind(this));\n }\n }\n this._handleLabels(labelGroups);\n return invalidFields;\n }\n\n /**\n * Validates all custom fields\n * @returns {Promise}\n */\n validateCustomFields() {\n return this._customValidationsForElements(\n this.form.querySelectorAll(\"[data-validate]\"));\n }\n\n /**\n * Tests if a field should be validated\n * @param {HTMLElement} field\n * @returns {boolean}\n * @private\n */\n static _shouldNotValidateField(field) {\n var target = Form._findErrorTarget(field);\n return target instanceof HTMLFieldSetElement || field.validity === undefined ||\n (target.hasAttribute(ATTR_VALIDATE_VISIBILITY) && !Util.isVisible(target));\n }\n\n /**\n * Creates an array from a node list with invalid items\n * This Method expicitly checks if field should not be validated so it can be used to foucs a field\n * @param list\n * @returns {Array}\n * @private\n */\n static _createArrayFromInvalidFieldList(list) {\n var arr = [];\n for (var i = 0; i < list.length; ++i) {\n var n = list[i];\n if (n.validity && !n.validity.valid) {\n if (!Form._shouldNotValidateField(n)) {\n arr.push(n);\n }\n }\n }\n return arr;\n }\n\n\n /**\n * This form\n * @returns {HTMLElement}\n */\n getForm() {\n return this.form;\n }\n\n /**\n * Registers a function that handles remote validation\n * @param {Function} func\n * @returns {Form}\n */\n registerRemoteValidation(func) {\n this._remoteValidationFunction = func;\n return this;\n }\n\n\n /**\n * Formats the error content for the tooltip\n * @param {String} error\n * @returns {String}\n * @private\n */\n _formatErrorTooltip(error) {\n return this.options.formatErrorTooltip.apply(this, [error]);\n }\n\n /**\n * Tries to find a custom error target on given target\n * @param target\n * @returns {HTMLElement}\n * @private\n */\n static _findErrorTarget(target) {\n var el = target.getAttribute(ATTR_ERROR_TARGET_ID) || target,\n foundTarget = el instanceof HTMLElement ? el : global.document.getElementById(el);\n if (!foundTarget) {\n throw 'Given error target did not exsits:' + target;\n }\n return foundTarget;\n }\n\n /**\n * Creates a tooltip at given element, will only create a new instance if not created\n * @param {HTMLElement} target\n * @param {Boolean} [remove]\n */\n showAndOrCreateTooltip(target, remove) {\n var self = this;\n if (!this.tooltips && this.options.createTooltips) {\n this.tooltips = new Tooltip(this.options.tooltipContainer, this.options.tooltipOptions);\n }\n if (!this.options.createTooltips) {\n return false;\n }\n\n if (!target.flexFormsSavedValidity) {\n return false;\n }\n var errorTarget = Form._findErrorTarget(target);\n if (!target.flexFormsSavedValidity.valid && self._isElementInvalidElement(errorTarget)) {\n self.tooltips.createTooltip(errorTarget,\n self._formatErrorTooltip(target.flexFormsSavedValidationMessage), false);\n return true;\n } else {\n if (remove) {\n self.tooltips.removeTooltip();\n }\n }\n return false;\n }\n\n /**\n * Checks if element is marked as invalid\n * @param {HTMLElement} el\n * @returns {boolean}\n * @private\n */\n _isElementInvalidElement(el) {\n return el.hasAttribute(DATA_ELEMENT_INVALID);\n }\n\n /**\n * Handles invalid event of a form\n * @param {Event} e\n * @returns {Promise|boolean}\n * @private\n */\n _checkIsInvalid(e) {\n e.preventDefault();\n var invalidFields = this.getForm().querySelectorAll(\":invalid\");\n return this._handleValidation(invalidFields, true, false);\n }\n\n /**\n * Will query dependent fields (by selector) that should be validated with given field\n * @param field\n * @returns {NodeList|[]}\n * @private\n */\n _getDependentFields(field) {\n let fieldSelector = field.getAttribute(ATTR_DEPENDS), base = [field];\n if (fieldSelector) {\n base.push.apply(base, Array.prototype.slice.apply(\n this.getForm().querySelectorAll(fieldSelector)));\n }\n return base;\n }\n\n /**\n * @private\n * @param {HTMLElement} [target]\n */\n _handleTooltipInline(target) {\n if (this.tooltips) {\n this.tooltips.removeTooltip(target);\n }\n }\n\n /**\n * Initializes validation for a given form, registers event handlers\n */\n initFormValidation() {\n // Suppress the default bubbles\n var form = this.getForm(),\n self = this,\n invalidEvent = 'invalid';\n\n /**\n * Validates if is valid realtime element\n * @param {HTMLElement} target\n * @returns {boolean}\n * @private\n */\n function _checkIsValidRealtimeElement(target) {\n return !target.hasAttribute(ATTR_DISABLE_REALTIME) && !target.hasAttribute(ATTR_DISABLE_INLINE);\n }\n\n form.addEventListener(invalidEvent, function (e) {\n e.preventDefault();\n }, true);\n\n Util.addEventOnce(invalidEvent, form, function handleInvalid(e) {\n self._formLoading();\n var result = self._checkIsInvalid(e);\n if (result) {\n self.currentValidationFuture = new Promise((resolve) => {\n result.then(function (r) {\n setTimeout(function () {\n Util.addEventOnce(invalidEvent, form, handleInvalid, true);\n }, 0);\n resolve(r);\n self._formStopLoading();\n if (!r.foundAnyError) {\n self._formLoading();\n self._handleSubmit(e);\n }\n });\n });\n }\n }, true);\n\n this.addEventListener(form, 'reset', () => {\n this.removeErrors();\n });\n\n // Timeout for keys:\n var TIMEOUT_KEYDOWN, KEYDOWN_RUNNING = false;\n\n // resets keydown events\n function clearKeyDownTimeout() {\n KEYDOWN_RUNNING = false;\n clearTimeout(TIMEOUT_KEYDOWN);\n }\n\n // setup custom realtime event if given\n if (self.options.realtime) {\n this.addEventListener(form, CONST_REALTIME_EVENT, function (e) {\n if (self._formIsLoading()) {\n return;\n }\n var target = e.target;\n clearTimeout(TIMEOUT_KEYDOWN);\n if (KEYDOWN_RUNNING) {\n return;\n }\n TIMEOUT_KEYDOWN = setTimeout(() => {\n let isStillTarget = document.activeElement === e.target;\n if (!_checkIsValidRealtimeElement(target)) {\n return;\n }\n if (isStillTarget) {\n self._handleTooltipInline();\n }\n KEYDOWN_RUNNING = true;\n let dependentFields = self._getDependentFields(target);\n self._customValidationsForElements(dependentFields).then(function () {\n self.prepareErrors(dependentFields, false);\n if (isStillTarget) {\n self.showAndOrCreateTooltip(e.target);\n }\n // future must be resolved before another event can be started\n KEYDOWN_RUNNING = false;\n });\n }, self.options.realtimeTimeout);\n }, true);\n }\n\n /**\n * Validates if target is a valid input field to check blur and focus events\n *\n * @param {HTMLElement} target\n * @returns {boolean}\n * @private\n */\n function _checkIsValidBlurFocusElement(target) {\n let attr = target.getAttribute(\"type\");\n return (attr !== \"radio\" && attr !== \"checkbox\" && attr !== \"submit\");\n }\n\n /**\n * Validates if is valid inline-check element\n * @param {HTMLElement} target\n * @returns {boolean}\n * @private\n */\n function _checkIsValidInlineCheckElement(target) {\n return !target.hasAttribute(ATTR_DISABLE_INLINE);\n }\n\n this.addEventListener(form, 'blur', function (e) {\n // do not hide tooltip after change event\n if (!e.target.flexcssKeepTooltips) {\n self._handleTooltipInline(e.target);\n }\n delete e.target.flexcssKeepTooltips;\n }, true);\n\n // handle focus on input elements\n // will show an error if field is invalid\n this.addEventListener(form, \"focus\", function (e) {\n if (self._formIsLoading()) {\n return;\n }\n // do not track errors for checkbox and radios on focus:\n if (!_checkIsValidBlurFocusElement(e.target)) {\n return;\n }\n // we need to delay this a little, because Firefox and Safari do not show a tooltip after it\n // just have been hidden (on blur). Maybe fix this with a queue later\n setTimeout(function () {\n self.showAndOrCreateTooltip(e.target);\n }, FOCUS_TOOLTIP_DELAY);\n }, true);\n\n if (self.options.inlineValidation) {\n // Handle change for checkbox, radios and selects\n this.addEventListener(form, \"change\", function (e) {\n const target = e.target;\n if (self._formIsLoading() || !_checkIsValidInlineCheckElement(target)) {\n return;\n }\n clearKeyDownTimeout();\n const name = target.getAttribute('name');\n let inputs = name ? form.querySelectorAll('[name=\"' + name + '\"]') : [target];\n // we only support dependent fields for a single widgets right now\n if (inputs.length === 1) {\n inputs = self._getDependentFields(target);\n }\n self._customValidationsForElements(inputs).then(function () {\n self.prepareErrors(inputs, false);\n target.flexcssKeepTooltips = self.showAndOrCreateTooltip(target, true);\n if (target.flexcssKeepTooltips) {\n self._handleTooltipHideClickAfterChange();\n }\n });\n });\n }\n\n // prevent default if form is invalid\n this.addEventListener(form, \"submit\", function listener(e) {\n self._submitListener(e, listener);\n });\n\n Event.dispatchAndFire(form, EVENT_FORM_READY);\n }\n\n /* Loading states, unfortunately we can't check if a promise is pending :/*/\n /* TODO: Maybe wrap promise to extend this functionality */\n\n _formLoading() {\n this.getForm().classList.add(LOADING_CLASS);\n }\n\n _formStopLoading() {\n this.getForm().classList.remove(LOADING_CLASS);\n }\n\n _formIsLoading() {\n return this.getForm().classList.contains(LOADING_CLASS);\n }\n\n // this defines the logic after a change event when a tooltip is shown\n // because we call this method inside the change event, the click would be immeditally executed with the change\n // event when not using setTimeout(). There might be another solution for this...\n _handleTooltipHideClickAfterChange() {\n const self = this;\n if (this.options.createTooltips) {\n setTimeout(function () {\n Util.addEventOnce(Settings.getTabEvent(), global.document.body, function (t) {\n if (!self._isElementInvalidElement(t.target)) {\n self._handleTooltipInline();\n }\n });\n }, CLICK_TOOLTIP_DELAY);\n }\n }\n\n _focusElement(el) {\n el.focus();\n Util.scrollToElement(el, this.options.scrollToElementDiff);\n }\n\n /**\n * Listener that is executed on form submit\n * @param e\n * @param submitListener\n * @returns {boolean}\n * @private\n */\n _submitListener(e, submitListener) {\n\n const form = this.getForm(),\n self = this,\n submitEvent = 'submit';\n\n if (this._formIsLoading()) {\n e.preventDefault();\n return false;\n }\n this._formLoading();\n form.removeEventListener(submitEvent, submitListener);\n this.removeErrors();\n e.preventDefault();\n // reset:\n if (form.checkValidity()) {\n form.addEventListener(submitEvent, submitListener);\n // It's possible that the form is valid but the custom validations need to be checked again:\n self.currentValidationFuture = new Promise((resolve) => {\n var validation = self.validateCustomFields();\n validation.then(function (r) {\n // because custom validators may mark multiple fields as invalid, we get all of them in the form\n var fields = self._getInvalidElements(),\n errors = self.prepareErrors(fields, false), firstError = errors[0];\n if (firstError) {\n self._focusElement(firstError);\n self.showAndOrCreateTooltip(firstError, true);\n }\n resolve(r);\n });\n });\n self.currentValidationFuture.then(function (r) {\n if (!r.foundAnyError) {\n // Handle submitting the form to server:\n self._handleSubmit(e);\n } else {\n self._formStopLoading();\n }\n });\n } else {\n self._formStopLoading();\n form.addEventListener(submitEvent, submitListener);\n }\n }\n\n\n /**\n * Handles submitting, optionally allows to stop submitting\n * @param e\n * @private\n */\n _handleSubmit(e) {\n this._submitFunction(this.form, e);\n }\n\n\n /**\n * Registers a global event Handler\n * @param errorFunc\n */\n static registerErrorMessageHandler(errorFunc) {\n Form.globalErrorMessageHandler = errorFunc;\n }\n\n /**\n * Initialize forms for a specific selector\n * @param {String} selector\n * @param {Object} [options]\n * @return {array.}\n */\n static init(selector, options) {\n var forms = selector instanceof HTMLElement ? selector.querySelectorAll('form') :\n document.querySelectorAll(selector), instances = [];\n for (var i = 0; i < forms.length; i++) {\n instances.push(new Form(forms[i], options));\n }\n return instances;\n }\n\n\n /**\n * Registers a global validator that is usable on all form instances\n * @param {String} name\n * @param {Function} validator\n * @returns {Function}\n */\n static registerValidator(name, validator) {\n Form.globalValidators[name] = validator;\n return Form;\n }\n\n /**\n * Registers a global function that is called when a form should validate the response of a server\n * @param {Function} func\n * @returns {Form}\n */\n static registerGlobalRemoteValidationFunction(func) {\n Form.globalRemoteValidationFunction = func;\n return Form;\n }\n}\n\n\n/**\n * Global validators\n * @type {Array}\n */\nForm.globalValidators = [];\n\n/**\n * Global Remote validation function\n */\nForm.globalRemoteValidationFunction = function () {\n};\n\n/**\n * Handles custom error messages extracts custom message by default\n */\nForm.globalErrorMessageHandler = (field, validity) => {\n if (!validity.customError) {\n let customMsg = field.getAttribute(ATTR_DATA_CUSTOM_MESSAGE);\n if (customMsg) {\n field.setCustomValidity(customMsg);\n }\n }\n};\n\nexport default Form;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/main/Form.js\n **/","export default (fn, ms) => () => {\n clearTimeout(fn.timeout);\n fn.timeout = setTimeout(fn, ms);\n};\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/main/lib/debounce.js\n **/","// the whatwg-fetch polyfill installs the fetch() function\n// on the global object (window or self)\n//\n// Return that as the export for use in Webpack, Browserify etc.\nrequire('whatwg-fetch');\nmodule.exports = self.fetch.bind(self);\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/isomorphic-fetch/fetch-npm-browserify.js\n ** module id = 11\n ** module chunks = 0 1\n **/","(function(self) {\n 'use strict';\n\n if (self.fetch) {\n return\n }\n\n function normalizeName(name) {\n if (typeof name !== 'string') {\n name = String(name)\n }\n if (/[^a-z0-9\\-#$%&'*+.\\^_`|~]/i.test(name)) {\n throw new TypeError('Invalid character in header field name')\n }\n return name.toLowerCase()\n }\n\n function normalizeValue(value) {\n if (typeof value !== 'string') {\n value = String(value)\n }\n return value\n }\n\n function Headers(headers) {\n this.map = {}\n\n if (headers instanceof Headers) {\n headers.forEach(function(value, name) {\n this.append(name, value)\n }, this)\n\n } else if (headers) {\n Object.getOwnPropertyNames(headers).forEach(function(name) {\n this.append(name, headers[name])\n }, this)\n }\n }\n\n Headers.prototype.append = function(name, value) {\n name = normalizeName(name)\n value = normalizeValue(value)\n var list = this.map[name]\n if (!list) {\n list = []\n this.map[name] = list\n }\n list.push(value)\n }\n\n Headers.prototype['delete'] = function(name) {\n delete this.map[normalizeName(name)]\n }\n\n Headers.prototype.get = function(name) {\n var values = this.map[normalizeName(name)]\n return values ? values[0] : null\n }\n\n Headers.prototype.getAll = function(name) {\n return this.map[normalizeName(name)] || []\n }\n\n Headers.prototype.has = function(name) {\n return this.map.hasOwnProperty(normalizeName(name))\n }\n\n Headers.prototype.set = function(name, value) {\n this.map[normalizeName(name)] = [normalizeValue(value)]\n }\n\n Headers.prototype.forEach = function(callback, thisArg) {\n Object.getOwnPropertyNames(this.map).forEach(function(name) {\n this.map[name].forEach(function(value) {\n callback.call(thisArg, value, name, this)\n }, this)\n }, this)\n }\n\n function consumed(body) {\n if (body.bodyUsed) {\n return Promise.reject(new TypeError('Already read'))\n }\n body.bodyUsed = true\n }\n\n function fileReaderReady(reader) {\n return new Promise(function(resolve, reject) {\n reader.onload = function() {\n resolve(reader.result)\n }\n reader.onerror = function() {\n reject(reader.error)\n }\n })\n }\n\n function readBlobAsArrayBuffer(blob) {\n var reader = new FileReader()\n reader.readAsArrayBuffer(blob)\n return fileReaderReady(reader)\n }\n\n function readBlobAsText(blob) {\n var reader = new FileReader()\n reader.readAsText(blob)\n return fileReaderReady(reader)\n }\n\n var support = {\n blob: 'FileReader' in self && 'Blob' in self && (function() {\n try {\n new Blob();\n return true\n } catch(e) {\n return false\n }\n })(),\n formData: 'FormData' in self,\n arrayBuffer: 'ArrayBuffer' in self\n }\n\n function Body() {\n this.bodyUsed = false\n\n\n this._initBody = function(body) {\n this._bodyInit = body\n if (typeof body === 'string') {\n this._bodyText = body\n } else if (support.blob && Blob.prototype.isPrototypeOf(body)) {\n this._bodyBlob = body\n } else if (support.formData && FormData.prototype.isPrototypeOf(body)) {\n this._bodyFormData = body\n } else if (!body) {\n this._bodyText = ''\n } else if (support.arrayBuffer && ArrayBuffer.prototype.isPrototypeOf(body)) {\n // Only support ArrayBuffers for POST method.\n // Receiving ArrayBuffers happens via Blobs, instead.\n } else {\n throw new Error('unsupported BodyInit type')\n }\n\n if (!this.headers.get('content-type')) {\n if (typeof body === 'string') {\n this.headers.set('content-type', 'text/plain;charset=UTF-8')\n } else if (this._bodyBlob && this._bodyBlob.type) {\n this.headers.set('content-type', this._bodyBlob.type)\n }\n }\n }\n\n if (support.blob) {\n this.blob = function() {\n var rejected = consumed(this)\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return Promise.resolve(this._bodyBlob)\n } else if (this._bodyFormData) {\n throw new Error('could not read FormData body as blob')\n } else {\n return Promise.resolve(new Blob([this._bodyText]))\n }\n }\n\n this.arrayBuffer = function() {\n return this.blob().then(readBlobAsArrayBuffer)\n }\n\n this.text = function() {\n var rejected = consumed(this)\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return readBlobAsText(this._bodyBlob)\n } else if (this._bodyFormData) {\n throw new Error('could not read FormData body as text')\n } else {\n return Promise.resolve(this._bodyText)\n }\n }\n } else {\n this.text = function() {\n var rejected = consumed(this)\n return rejected ? rejected : Promise.resolve(this._bodyText)\n }\n }\n\n if (support.formData) {\n this.formData = function() {\n return this.text().then(decode)\n }\n }\n\n this.json = function() {\n return this.text().then(JSON.parse)\n }\n\n return this\n }\n\n // HTTP methods whose capitalization should be normalized\n var methods = ['DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT']\n\n function normalizeMethod(method) {\n var upcased = method.toUpperCase()\n return (methods.indexOf(upcased) > -1) ? upcased : method\n }\n\n function Request(input, options) {\n options = options || {}\n var body = options.body\n if (Request.prototype.isPrototypeOf(input)) {\n if (input.bodyUsed) {\n throw new TypeError('Already read')\n }\n this.url = input.url\n this.credentials = input.credentials\n if (!options.headers) {\n this.headers = new Headers(input.headers)\n }\n this.method = input.method\n this.mode = input.mode\n if (!body) {\n body = input._bodyInit\n input.bodyUsed = true\n }\n } else {\n this.url = input\n }\n\n this.credentials = options.credentials || this.credentials || 'omit'\n if (options.headers || !this.headers) {\n this.headers = new Headers(options.headers)\n }\n this.method = normalizeMethod(options.method || this.method || 'GET')\n this.mode = options.mode || this.mode || null\n this.referrer = null\n\n if ((this.method === 'GET' || this.method === 'HEAD') && body) {\n throw new TypeError('Body not allowed for GET or HEAD requests')\n }\n this._initBody(body)\n }\n\n Request.prototype.clone = function() {\n return new Request(this)\n }\n\n function decode(body) {\n var form = new FormData()\n body.trim().split('&').forEach(function(bytes) {\n if (bytes) {\n var split = bytes.split('=')\n var name = split.shift().replace(/\\+/g, ' ')\n var value = split.join('=').replace(/\\+/g, ' ')\n form.append(decodeURIComponent(name), decodeURIComponent(value))\n }\n })\n return form\n }\n\n function headers(xhr) {\n var head = new Headers()\n var pairs = xhr.getAllResponseHeaders().trim().split('\\n')\n pairs.forEach(function(header) {\n var split = header.trim().split(':')\n var key = split.shift().trim()\n var value = split.join(':').trim()\n head.append(key, value)\n })\n return head\n }\n\n Body.call(Request.prototype)\n\n function Response(bodyInit, options) {\n if (!options) {\n options = {}\n }\n\n this.type = 'default'\n this.status = options.status\n this.ok = this.status >= 200 && this.status < 300\n this.statusText = options.statusText\n this.headers = options.headers instanceof Headers ? options.headers : new Headers(options.headers)\n this.url = options.url || ''\n this._initBody(bodyInit)\n }\n\n Body.call(Response.prototype)\n\n Response.prototype.clone = function() {\n return new Response(this._bodyInit, {\n status: this.status,\n statusText: this.statusText,\n headers: new Headers(this.headers),\n url: this.url\n })\n }\n\n Response.error = function() {\n var response = new Response(null, {status: 0, statusText: ''})\n response.type = 'error'\n return response\n }\n\n var redirectStatuses = [301, 302, 303, 307, 308]\n\n Response.redirect = function(url, status) {\n if (redirectStatuses.indexOf(status) === -1) {\n throw new RangeError('Invalid status code')\n }\n\n return new Response(null, {status: status, headers: {location: url}})\n }\n\n self.Headers = Headers;\n self.Request = Request;\n self.Response = Response;\n\n self.fetch = function(input, init) {\n return new Promise(function(resolve, reject) {\n var request\n if (Request.prototype.isPrototypeOf(input) && !init) {\n request = input\n } else {\n request = new Request(input, init)\n }\n\n var xhr = new XMLHttpRequest()\n\n function responseURL() {\n if ('responseURL' in xhr) {\n return xhr.responseURL\n }\n\n // Avoid security warnings on getResponseHeader when not allowed by CORS\n if (/^X-Request-URL:/m.test(xhr.getAllResponseHeaders())) {\n return xhr.getResponseHeader('X-Request-URL')\n }\n\n return;\n }\n\n xhr.onload = function() {\n var status = (xhr.status === 1223) ? 204 : xhr.status\n if (status < 100 || status > 599) {\n reject(new TypeError('Network request failed'))\n return\n }\n var options = {\n status: status,\n statusText: xhr.statusText,\n headers: headers(xhr),\n url: responseURL()\n }\n var body = 'response' in xhr ? xhr.response : xhr.responseText;\n resolve(new Response(body, options))\n }\n\n xhr.onerror = function() {\n reject(new TypeError('Network request failed'))\n }\n\n xhr.open(request.method, request.url, true)\n\n if (request.credentials === 'include') {\n xhr.withCredentials = true\n }\n\n if ('responseType' in xhr && support.blob) {\n xhr.responseType = 'blob'\n }\n\n request.headers.forEach(function(value, name) {\n xhr.setRequestHeader(name, value)\n })\n\n xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit)\n })\n }\n self.fetch.polyfill = true\n})(typeof self !== 'undefined' ? self : this);\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/whatwg-fetch/fetch.js\n ** module id = 12\n ** module chunks = 0 1\n **/","/*\n * The MIT License (MIT)\n *\n * Copyright (c) 2015 David Heidrich, BowlingX \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n/*!\n * FlexCss.Dropdown\n * Licensed under the MIT License (MIT)\n * Copyright (c) 2015 David Heidrich, BowlingX \n */\n\nimport Util from './util/Util';\nimport Settings from './util/Settings';\nimport Event from './util/Event';\nimport Widget from './Widget';\nimport FixedWindow from './lib/FixedWindow';\n\n/**\n * @type {string}\n */\nconst ATTR_CC = 'data-collision-container';\n/**\n * @type {string}\n */\nconst ATTR_DARKENER = 'data-darkener-container';\n/**\n * @type {string}\n */\nconst DARKENER_INIT = 'init';\n/**\n * @type {string}\n */\nconst ATTR_DATA_TARGET = 'data-target';\n/**\n * @type {string}\n */\nconst ATTR_CLOSE_DROPDOWN = 'data-close-dropdown';\n/**\n * @type {string}\n */\nconst ATTR_NAME = 'data-dropdown';\n/**\n * @type {string}\n */\nconst STATE_LOADING = 'loading';\n\nconst CLS_DARKENER_DROPDOWN = 'darkener-dropdown';\n/**\n * @type {string}\n */\nconst CLS_OPEN = 'open';\n\n/**\n * @type {string}\n */\nconst CLS_DROPDOWN = 'dropdown';\n\n/**\n * @type {string}\n */\nexport const EVENT_DROPDOWN_CLOSED = 'flexcss.dropdown.closed';\n\n/**\n * A Dropdown\n */\nclass Dropdown {\n constructor(DelegateContainer, Darkener) {\n const doc = global.document;\n\n /**\n * Container Element\n * @type {HTMLElement}\n */\n this.container = DelegateContainer instanceof HTMLElement ?\n DelegateContainer : doc.getElementById(DelegateContainer);\n\n this.currentOpen = null;\n this.currentTarget = null;\n /**\n * @type {HTMLElement}\n */\n this.darkener = Darkener instanceof HTMLElement ? Darkener : document.getElementById(Darkener);\n\n this.destroyOnClose = false;\n\n if (!this.darkener || !this.container) {\n throw new Error('required elements not found (darkener and container element)');\n }\n }\n\n /**\n * Method that handles delegation events for dropdowns\n * @param e\n * @returns {boolean}\n * @private\n */\n _delegateFunction(e) {\n const currentOpen = this.currentOpen;\n const target = Util.closestCallback(e.target, n => n instanceof HTMLElement && n.hasAttribute(ATTR_NAME));\n const targetIsCurrent = target === this.currentTarget;\n\n if (currentOpen && !Util.isPartOfNode(e.target, currentOpen) || targetIsCurrent) {\n this.close();\n if (targetIsCurrent) {\n e.preventDefault();\n }\n return targetIsCurrent ? false : this._delegateFunction(e);\n }\n\n if (target && !currentOpen) {\n e.preventDefault();\n e.stopImmediatePropagation();\n\n if (target.isLoading) {\n return false;\n }\n this.createDropdown(target);\n } else {\n if (currentOpen) {\n if (e.target.hasAttribute(ATTR_CLOSE_DROPDOWN)) {\n e.preventDefault();\n this.close();\n }\n if (!Util.isPartOfNode(e.target, currentOpen)) {\n this.close();\n }\n }\n }\n }\n\n /**\n * Register Events for this dropdown container\n * @returns {Dropdown}\n */\n registerEvents() {\n FixedWindow.getInstance().addScreenConstraint(Dropdown, (width) => width < Settings.get().smallBreakpoint);\n this.container.addEventListener(Settings.getTabEvent(), this._delegateFunction.bind(this), true);\n return this;\n }\n\n /**\n * Destroys this instance, unbinds events\n * @returns {Dropdown}\n */\n destroy() {\n this.container.removeEventListener(Settings.getTabEvent(), this._delegateFunction.bind(this), true);\n return this;\n }\n\n\n /**\n * Destroys instance on close of dropdown\n * @param v\n * @returns {Dropdown}\n */\n setDestroyOnClose(v) {\n this.destroyOnClose = v;\n return this;\n }\n\n\n /**\n * Will add the right class to container for specific darkener id\n * @param instance\n * @param show\n */\n toggleDarkenerToggler(instance, show) {\n const cls = `toggle-${(instance.id || CLS_DARKENER_DROPDOWN)}`;\n const classList = this.container.classList;\n if (show) {\n classList.add(cls);\n } else {\n classList.remove(cls);\n }\n }\n\n /**\n * Closes Dropdown on current instance\n * @return {Boolean|Promise}\n */\n close() {\n const currentOpen = this.currentOpen;\n if (!currentOpen) {\n return false;\n }\n const darkenerInstance = currentOpen.flexDarkenerInstance || this.darkener;\n const thisCurrentOpen = currentOpen;\n\n const future = new Promise((resolve) => {\n if (window.getComputedStyle(currentOpen).position === 'fixed') {\n Util.addEventOnce(Settings.getTransitionEvent(), currentOpen, function scheduler(e) {\n if (e.srcElement !== currentOpen) {\n return Util.addEventOnce(Settings.getTransitionEvent(), currentOpen, scheduler.bind(this));\n }\n requestAnimationFrame(() => {\n Event.dispatchAndFire(thisCurrentOpen, EVENT_DROPDOWN_CLOSED);\n // if a new dropdown has been opened in the meantime, do not remove darkener\n if (this.currentOpen !== null) {\n return false;\n }\n this.toggleDarkenerToggler(darkenerInstance, false);\n resolve(true);\n });\n }.bind(this));\n } else {\n resolve(true);\n Event.dispatchAndFire(thisCurrentOpen, EVENT_DROPDOWN_CLOSED);\n }\n });\n\n FixedWindow.getInstance().close();\n currentOpen.classList.remove(CLS_OPEN);\n\n if (currentOpen.flexDarkenerInstance) {\n currentOpen.flexDarkenerInstance.classList.remove(DARKENER_INIT);\n } else {\n this.darkener.classList.remove(DARKENER_INIT);\n }\n\n this.currentOpen = null;\n this.currentTarget = null;\n\n if (this.destroyOnClose) {\n this.destroy();\n }\n\n return future;\n }\n\n /**\n * Creates a dropdown on given target and opens it\n * @param {HTMLElement} target target where this dropdown is placed\n * @param {FlexCss.Widget} [thisWidget] if given will use widget instead of widget instance\n * @return {FlexCss.Dropdown}\n */\n createDropdown(target, thisWidget) {\n const doc = global.document;\n\n if (!target) {\n throw new Error('Dropdown target not found');\n }\n\n const widget = thisWidget || Widget.findWidget(target);\n let future;\n const data = target.getAttribute(ATTR_NAME);\n const dropdownContainerElement = doc.getElementById(data);\n const async = !dropdownContainerElement && Widget.isWidget(widget) ? widget.getAsync() : false;\n\n if (async) {\n target.classList.add(STATE_LOADING);\n target.isLoading = true;\n future = async.then((r) => {\n if (r instanceof HTMLElement) {\n if (r.id) {\n target.setAttribute(ATTR_NAME, r.id);\n }\n return r;\n }\n // Create container Element:\n const element = doc.createElement('div');\n element.className = CLS_DROPDOWN;\n element.innerHTML = r;\n element.id = Util.guid();\n // Cache target for later use:\n target.setAttribute(ATTR_NAME, element.id);\n this.container.appendChild(element);\n return element;\n }).then((r) => {\n target.isLoading = false;\n target.classList.remove(STATE_LOADING);\n return r;\n });\n } else {\n if (!dropdownContainerElement) {\n throw new Error(`Could not found Dropdown container with ID \"${data}\"`);\n }\n future = new Promise((r) => {\n r(dropdownContainerElement);\n });\n }\n\n future.then((dropdownContent) => {\n if (this.currentOpen) {\n this.close();\n }\n // Skip one frame to show animation\n target.dropdownContent = dropdownContent;\n const isAbsolute = global.getComputedStyle(dropdownContent).position === 'absolute';\n dropdownContent.hfWidgetInstance = this;\n\n if (!target.flexCollisionContainer) {\n const collisionC = target.getAttribute(ATTR_CC);\n target.flexCollisionContainer = collisionC ?\n doc.getElementById(collisionC) || document.documentElement : document.documentElement;\n }\n\n dropdownContent.classList.toggle(CLS_OPEN);\n if (dropdownContent.classList.contains(CLS_OPEN)) {\n this.currentOpen = dropdownContent;\n this.currentTarget = target;\n }\n FixedWindow.getInstance().open(this, dropdownContent);\n if (isAbsolute) {\n // Check collision:\n let selfTarget = target.getAttribute(ATTR_DATA_TARGET);\n selfTarget = selfTarget ? doc.getElementById(selfTarget) : target;\n Util.setupPositionNearby(selfTarget, dropdownContent, target.flexCollisionContainer);\n } else {\n // optionally get custom darkener container for target\n const d = target.getAttribute(ATTR_DARKENER);\n if (d) {\n dropdownContent.flexDarkenerInstance = doc.getElementById(d);\n (dropdownContent.flexDarkenerInstance || this.darkener).classList.toggle(DARKENER_INIT);\n } else {\n this.darkener.classList.toggle(DARKENER_INIT);\n }\n this.toggleDarkenerToggler(dropdownContent.flexDarkenerInstance || this.darkener, true);\n\n dropdownContent.style.left = '0';\n dropdownContent.style.top = 'auto';\n }\n });\n }\n\n}\n\nexport default Dropdown;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/main/Dropdown.js\n **/","/*\n * The MIT License (MIT)\n *\n * Copyright (c) 2015 David Heidrich, BowlingX \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n/*!\n * FlexCss.LightBox\n * Licensed under the MIT License (MIT)\n * Copyright (c) 2015 David Heidrich, BowlingX \n */\n\n/* global Image, TouchEvent*/\n\nimport Modal, { EVENT_MODAL_CLOSED } from './Modal';\nimport Settings from './util/Settings';\nimport Widget from './Widget';\n\nconst ATTR_MAX_WIDTH = 'data-original-width';\nconst ATTR_MAX_HEIGHT = 'data-original-height';\nconst ATTR_SRC = 'data-src';\n\nconst CLS_HAS_PREV = 'has-prev';\nconst CLS_HAS_NEXT = 'has-next';\nconst CLS_LOADING = 'loading';\n\nconst ATTR_NO_THUMBNAIL = 'data-no-thumbnail';\nconst ATTR_DATA_HREF = 'data-href';\nconst ATTR_HREF = 'href';\n\nconst KEY_NEXT = 39;\nconst KEY_PREV = 37;\nconst ATTR_CLOSE = 'data-close-modal';\n/**\n * A Simple LightBox\n */\nclass LightBox {\n\n /**\n * Creates a new Lightbox\n * @param DelegateContainer\n * @param AttributeSelector\n * @param ModalAppend\n * @param [options]\n */\n constructor(DelegateContainer, AttributeSelector, ModalAppend, options) {\n const thisDelegateContainer = DelegateContainer instanceof HTMLElement ? DelegateContainer :\n document.getElementById(DelegateContainer);\n\n this._modalAppend = ModalAppend || DelegateContainer;\n /**\n * @type {Function}\n */\n this._resizeEvent = null;\n /**\n * @type {Function}\n */\n this._keyboardNextEvent = null;\n /**\n * @type {Promise}\n */\n this._future = null;\n /**\n * @type {Promise}\n */\n this._nextFuture = this._future;\n /**\n * @type {HTMLElement}\n */\n this._imageContainer = null;\n /**\n * @type {HTMLElement}\n */\n this._modalContainerDiv = null;\n /**\n * @type {HTMLElement}\n */\n this._contentContainer = null;\n /**\n * @type {HTMLElement}\n */\n this._closerContainerDiv = null;\n /**\n * @type {HTMLElement}\n */\n this._delegateContainer = thisDelegateContainer;\n /**\n * @type {HTMLElement}\n */\n this._attributeSelector = AttributeSelector;\n /**\n * @type {Widget}\n */\n this._widget = null;\n /**\n * @type {boolean}\n */\n this._isOpen = false;\n /**\n * @type {HTMLElement}\n */\n this.target = null;\n /**\n * @type {HTMLElement}\n */\n this.img = null;\n /**\n * @type {boolean}\n */\n this._isLoading = false;\n\n /**\n * Default options\n */\n this.options = {\n // set if prev and next should be available\n registerPrevNextEvents: true,\n // set if modal should be closed after last image\n closeOnLast: true,\n // called when next image is requested (either by keyboard or click), return false to abort\n onNext: () => {\n return true;\n },\n onClose: () => {\n },\n getNext: null,\n getPrev: null,\n // called when underlying target changed\n onSwitchImage: () => {\n }\n };\n\n Object.assign(this.options, options);\n }\n\n /**\n * @param {HTMLElement} node\n * @returns {HTMLElement|null}\n */\n findImmediateNextTarget(node) {\n if (node && node.children[0].hasAttribute(this._attributeSelector)) {\n return node.children[0];\n }\n return null;\n }\n\n /**\n * Will fetch the next element of a lightBox\n * @param {HTMLElement} target\n * @returns {null|HTMLElement}\n */\n getNext(target) {\n if (this.options.getNext) {\n return this.options.getNext.apply(this, [target]);\n }\n return this.findImmediateNextTarget(target.parentNode.nextElementSibling);\n }\n\n /**\n * Will fetch the previous element of a lightBox\n * @param {HTMLElement} target\n * @returns {null|HTMLElement}\n */\n getPrev(target) {\n if (this.options.getPrev) {\n return this.options.getPrev.apply(this, [target]);\n }\n return this.findImmediateNextTarget(target.parentNode.previousElementSibling);\n }\n\n /**\n * Registers events for delegate container\n */\n registerEvents(onOpen) {\n this._delegateContainer.addEventListener(Settings.getTabEvent(), (e) => {\n let target = e.target;\n const parent = target.parentNode;\n let validTarget = target.hasAttribute(this._attributeSelector);\n const parentIsValid = parent && parent.hasAttribute(this._attributeSelector);\n\n if (!validTarget && parentIsValid) {\n validTarget = true;\n target = parent;\n }\n if (validTarget) {\n e.preventDefault();\n this.open(target).then((r) => {\n if (onOpen) {\n onOpen.apply(this, [r, target]);\n }\n });\n }\n });\n }\n\n /**\n * @returns {HTMLElement}\n */\n getContentContainer() {\n return this._contentContainer;\n }\n\n /**\n * Setup max-width and max-height\n * @param {HTMLElement} target\n * @param {HTMLElement} img\n * @param {HTMLElement} loadedImage\n * @private\n */\n static _setupMaxWidthHeight(target, img, loadedImage) {\n const nextMaxWidth = target.getAttribute(ATTR_MAX_WIDTH);\n const nextMaxHeight = target.getAttribute(ATTR_MAX_HEIGHT);\n if (nextMaxWidth && nextMaxHeight) {\n img.style.maxWidth = nextMaxWidth + \"px\";\n img.style.maxHeight = nextMaxHeight + \"px\";\n } else {\n img.style.maxWidth = loadedImage.width + \"px\";\n img.style.maxHeight = loadedImage.height + \"px\";\n }\n }\n\n /**\n * Switches to the next image\n * @param {boolean} direction\n */\n switchImageByDirection(direction) {\n const next = direction ? this.getPrev(this.target) : this.getNext(this.target);\n if (this.options.onNext.apply(this, [next])) {\n return this.switchImage(next);\n }\n return new Promise((_, reject) => reject(next));\n }\n\n /**\n * Checks if lightbox is currently loading\n * @returns {boolean}\n */\n isLoading() {\n return this._isLoading;\n }\n\n /**\n * Checks if modal should be closed\n * @private\n */\n _runOptionalClose() {\n if (this.options.closeOnLast) {\n this.modal.close();\n }\n }\n\n _setupPrevNextStates() {\n const target = this.target;\n const hasPrev = this.getPrev(target);\n const hasNext = this.getNext(target);\n const hasPrevClass = CLS_HAS_PREV;\n const hasNextClass = CLS_HAS_NEXT;\n // because IE does not support the second toggle parameter, we need to do this manually\n if (hasPrev) {\n this._imageContainer.classList.add(hasPrevClass);\n } else {\n this._imageContainer.classList.remove(hasPrevClass);\n }\n if (hasNext) {\n this._imageContainer.classList.add(hasNextClass);\n } else {\n this._imageContainer.classList.remove(hasNextClass);\n }\n }\n\n /**\n * @param img\n * @private\n */\n _calculateContainer(img) {\n if (Settings.isIE()) {\n setTimeout(() => {\n this._imageContainer.style.height = img.offsetHeight + 'px';\n }, 0);\n }\n }\n\n /**\n * Switch to a specific image\n * @param next\n * @returns {*}\n */\n switchImage(next) {\n const self = this;\n const img = this.img;\n this._isLoading = true;\n self._nextFuture = new Promise((resolve, reject) => {\n // notify observers about image switching\n self.options.onSwitchImage.apply(self, [self._nextFuture]);\n if (next) {\n const nextThumb = next.hasAttribute(ATTR_NO_THUMBNAIL) ? next : (next.children[0] || next);\n const nextHighRes = next.getAttribute(ATTR_DATA_HREF) ||\n next.getAttribute(ATTR_HREF);\n const nextSource = nextThumb.getAttribute(ATTR_SRC) || nextThumb.src || nextHighRes;\n const nextImgObject = new Image();\n\n if (!nextSource) {\n reject(next);\n return;\n }\n // set new target to next element\n this.target = next;\n nextImgObject.src = nextSource;\n self._imageContainer.classList.add(CLS_LOADING);\n nextImgObject.addEventListener('load', () => {\n img.src = nextSource;\n self._imageContainer.style.backgroundImage = 'url(' + nextSource + ')';\n LightBox._setupMaxWidthHeight(next, img, nextImgObject);\n self._calculateContainer(img);\n self.highRes(nextThumb, nextHighRes);\n self._setupPrevNextStates();\n self._imageContainer.classList.remove(CLS_LOADING);\n this._isLoading = false;\n resolve(nextSource, this.target);\n });\n } else {\n reject(this);\n }\n });\n return self._nextFuture;\n }\n\n\n /**\n * Setup High-Resolution picture\n * @param {HTMLElement} thisThumbnail\n * @param {String} thisImgHighResolution\n */\n highRes(thisThumbnail, thisImgHighResolution) {\n if (thisImgHighResolution && thisThumbnail.src !== thisImgHighResolution) {\n const highImageObj = new Image();\n highImageObj.src = thisImgHighResolution;\n highImageObj.addEventListener('load', () => {\n // if current image is still available\n if (this._getSrc(thisThumbnail) === this.img.src) {\n this.img.src = thisImgHighResolution;\n this._imageContainer.style.backgroundImage = 'url(' + thisImgHighResolution + ')';\n }\n });\n }\n }\n\n /**\n * Extracts the source of an image\n * @param target\n * @returns {String|null}\n * @private\n */\n _getSrc(target) {\n return target.getAttribute(ATTR_SRC) || target.src;\n }\n\n /**\n * Will show a lightBox on given target\n * @param {HTMLElement} target\n * @returns {$.Deferred|*}\n */\n open(target) {\n const self = this;\n\n if (!target) {\n return false;\n }\n\n this.target = target;\n\n // if lightBox is open, we just switch to the new target image\n if (this._isOpen && target) {\n return this.switchImage(target).then(() => {\n return this;\n });\n }\n\n this._isOpen = true;\n\n /**\n * Setup Widget for modal\n * @type {Widget}\n */\n this._widget = new Widget().setAsync(() => {\n // thumbnail is either target itself or expected to be first childNode\n const thumbnail = target.hasAttribute(ATTR_NO_THUMBNAIL) ? target : (target.children[0] || target);\n\n const imgHighResolution = target.getAttribute(ATTR_DATA_HREF) || target.getAttribute(ATTR_HREF);\n const imgSrc = this._getSrc(thumbnail) || imgHighResolution;\n\n const imageObj = new Image();\n imageObj.src = imgSrc;\n this._imageContainer = document.createElement('div');\n this._modalContainerDiv = document.createElement('div');\n this._closerContainerDiv = document.createElement('i');\n this._contentContainer = document.createElement('div');\n\n this._closerContainerDiv.className = 'modal-close modal-close-lightbox icon-cancel-1';\n this._closerContainerDiv.setAttribute(ATTR_CLOSE, ATTR_CLOSE);\n\n this._modalContainerDiv.className = 'modal image-modal';\n this._modalContainerDiv.appendChild(this._imageContainer);\n this._modalContainerDiv.appendChild(this._contentContainer);\n this._modalContainerDiv.appendChild(this._closerContainerDiv);\n this._contentContainer.className = 'content-container';\n this._isLoading = true;\n this._future = new Promise((resolve) => {\n imageObj.addEventListener('load', () => {\n this._imageContainer.className = 'image-container';\n const img = document.createElement('img');\n // current image\n this.img = img;\n\n img.src = imgSrc;\n LightBox._setupMaxWidthHeight(target, img, imageObj);\n this._imageContainer.appendChild(img);\n this._imageContainer.style.backgroundImage = 'url(' + imgSrc + ')';\n\n resolve(self._modalContainerDiv);\n this._isLoading = false;\n\n if (Settings.isIE()) {\n self._resizeEvent = global.addEventListener('resize', () => {\n setTimeout(() => {\n self._imageContainer.style.height = img.offsetHeight + 'px';\n }, 0);\n });\n }\n\n if (self.options.registerPrevNextEvents) {\n self._setupPrevNextStates();\n // prev or next on touch/click\n self._imageContainer.addEventListener(Settings.getTabEvent(), (e) => {\n if (self.isLoading()) {\n return;\n }\n e.preventDefault();\n\n const ev = e;\n const pageX = global.TouchEvent && ev instanceof TouchEvent ?\n ev.changedTouches[0].pageX : ev.pageX;\n const rect = self._imageContainer.getBoundingClientRect();\n const imgX = rect.left;\n const wrapperWidth = rect.width;\n const posX = pageX - imgX;\n\n self.switchImageByDirection(wrapperWidth / 2 > posX).catch(() => {\n self._runOptionalClose();\n });\n });\n\n // register keyboard events\n self._keyboardNextEvent = (e) => {\n if (e.keyCode === KEY_NEXT || e.keyCode === KEY_PREV) {\n if (self.isLoading()) {\n return;\n }\n self.switchImageByDirection(e.keyCode === KEY_PREV).catch(() => {\n self._runOptionalClose();\n });\n }\n };\n global.addEventListener('keydown', self._keyboardNextEvent);\n } else {\n self._imageContainer.addEventListener(Settings.getTabEvent(), () => {\n self._runOptionalClose();\n });\n }\n\n self.highRes(thumbnail, imgHighResolution);\n });\n });\n\n this._future.then(() => {\n self._calculateContainer(this.img);\n });\n\n self._modalContainerDiv.addEventListener(EVENT_MODAL_CLOSED, () => {\n // cleanup:\n this._modalContainerDiv.parentNode.removeChild(this._modalContainerDiv);\n this.options.onClose.apply(self);\n this._isOpen = false;\n this.modal.destroy();\n // unbind events\n if (this._keyboardNextEvent) {\n global.removeEventListener('keydown', self._keyboardNextEvent);\n }\n if (this._resizeEvent) {\n global.removeEventListener('resize', self._resizeEvent);\n }\n });\n\n return this._future;\n });\n\n this._nextFuture = this._future;\n\n if (self._widget) {\n this.modal = new Modal(this._modalAppend);\n // make sure we close stack before\n return this.modal.close().fromWidget(self._widget).then(() => {\n return self._future.then(() => {\n return self;\n });\n });\n }\n return false;\n }\n\n}\n\nexport default LightBox;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/main/LightBox.js\n **/","/*\n * The MIT License (MIT)\n *\n * Copyright (c) 2015 David Heidrich, BowlingX \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n/*!\n * FlexCss.OffCanvas\n * Licensed under the MIT License (MIT)\n * Copyright (c) 2015 David Heidrich, BowlingX \n */\n\nimport Settings from './util/Settings';\nimport Util from './util/Util';\nimport Event from './util/Event';\nimport FixedWindow from './lib/FixedWindow';\n\n/**\n * @type {string}\n */\nconst ATTR_CLOSE_SIDEBAR = 'data-close-offcanvas';\n\n/**\n * @type {string}\n */\nconst ATTR_TARGET = 'data-offcanvas';\n/**\n * @type {string}\n */\nconst INIT_CLASS = 'init';\n/**\n * @type {string}\n */\nconst OPEN_CLASS = 'open';\n/**\n * @type {number}\n */\nconst HIDE_FACTOR = 3;\n\n/**\n * @type {string}\n */\nexport const EVENT_TOGGLE = 'flexcss.offcanvas.toggle';\n\n/**\n * A OffCanvas Implementation\n */\nclass OffCanvas {\n\n /**\n * Creates an off-canvas navigation\n * @param {HTMLElement|String} NavigationId\n * @param {HTMLElement|String} Darkener\n * @param {int} factor positive will expect right sidebar, positive left\n * @param {bool} [disableTouch] if true all touch events are disabled\n * @constructor\n */\n constructor(NavigationId, Darkener, factor, disableTouch) {\n const doc = global.document;\n let touchedX = 0;\n const navigationContainer = NavigationId instanceof HTMLElement ?\n NavigationId : doc.getElementById(NavigationId);\n const darkener = Darkener instanceof HTMLElement ? Darkener : doc.getElementById(Darkener);\n const DARKENER_CLASS_TOGGLE = `toggle-${darkener.id}` || 'darkener';\n const DARKENER_CLASS_INSTANT_TOGGLE = `${DARKENER_CLASS_TOGGLE}-open`;\n\n const shouldNotTouch = () => {\n return window.innerWidth >= Settings.get().smallBreakpoint;\n };\n\n if (!darkener || !navigationContainer) {\n throw new Error('Could not find needed elements (Darkener and/or NavigationId)');\n }\n\n this.darkener = darkener;\n this.darkenerClassToggle = DARKENER_CLASS_TOGGLE;\n this.darkenerClassToggleInstant = DARKENER_CLASS_INSTANT_TOGGLE;\n this.globalToggleClass = Settings.get().canvasToggledClass;\n\n this.navigationContainer = navigationContainer;\n this.navigationContainerId = navigationContainer.id;\n\n // create id if id does not exist\n if (!this.navigationContainerId) {\n this.navigationContainerId = Util.guid();\n navigationContainer.id = this.navigationContainerId;\n }\n\n if (!disableTouch) {\n navigationContainer.addEventListener('touchstart', (e) => {\n if (shouldNotTouch()) {\n return;\n }\n touchedX = e.touches[0].clientX;\n navigationContainer.mustHide = false;\n });\n navigationContainer.addEventListener('touchmove', (e) => {\n if (shouldNotTouch()) {\n return;\n }\n const { clientX } = e.touches[0];\n const target = navigationContainer;\n const style = target.style;\n const calcX = touchedX - clientX;\n const bounds = target.getBoundingClientRect();\n const compare = factor > 0 ? calcX <= 0 : calcX >= 0;\n if (compare) {\n style.transition = 'transform 0s ease';\n style.webkitTransition = '-webkit-transform 0s ease';\n target.mustHide = factor > 0 ? calcX * -1 >\n bounds.width / HIDE_FACTOR : calcX > bounds.width / HIDE_FACTOR;\n const transform = `translate3d(${calcX * -1}px,0,0)`;\n style.transform = transform;\n style.webkitTransform = transform;\n }\n });\n navigationContainer.addEventListener('touchend', () => {\n if (shouldNotTouch()) {\n return;\n }\n const target = navigationContainer;\n const style = target.style;\n if (target.mustHide) {\n const width = target.getBoundingClientRect().width * factor;\n style.transition = 'transform .2s ease';\n style.webkitTransition = '-webkit-transform .2s ease';\n const transform = `translate3d(${width}px,0,0)`;\n style.transform = transform;\n style.webkitTransform = transform;\n this._remove().then(() => {\n this.resetTransform(style);\n });\n this._removeInstant();\n } else {\n this.resetTransform(style);\n }\n });\n }\n }\n\n /**\n * @param {Object} s\n */\n resetTransform(s) {\n s.transform = '';\n s.transition = '';\n s.webkitTransform = '';\n s.webkitTransition = '';\n }\n\n /**\n * @param {Object} [event]\n * @private\n */\n _remove(event) {\n return new Promise((resolve) => {\n Util.addEventOnce(Settings.getTransitionEvent(), this.navigationContainer, function scheduler(e) {\n if (e.target !== this.navigationContainer) {\n return Util.addEventOnce(Settings.getTransitionEvent(),\n this.navigationContainer, scheduler.bind(this));\n }\n requestAnimationFrame(() => {\n OffCanvas.currentOpen = null;\n const docCls = global.document.documentElement.classList;\n docCls.remove(this.darkenerClassToggle);\n docCls.remove(this.globalToggleClass);\n if (!!event) {\n Event.dispatchAndFire(this.navigationContainer, EVENT_TOGGLE);\n }\n resolve();\n });\n }.bind(this));\n });\n }\n\n /**\n * @private\n */\n _removeInstant() {\n this.navigationContainer.classList.remove(OPEN_CLASS);\n global.document.documentElement.classList.remove(this.darkenerClassToggleInstant);\n this.darkener.classList.remove(INIT_CLASS);\n FixedWindow.getInstance().close();\n }\n\n /**\n * Toggles a an off-canvas element\n * @param [e]\n * @private\n */\n toggle(e) {\n if (e) {\n e.preventDefault();\n }\n this.resetTransform(this.navigationContainer.style);\n const darkenerClass = this.darkener.classList;\n const DARKENER_CLASS_TOGGLE = this.darkenerClassToggle;\n const DARKENER_CLASS_INSTANT_TOGGLE = this.darkenerClassToggleInstant;\n const navigationControllerClassList = this.navigationContainer.classList;\n if (!OffCanvas.currentOpen) {\n Util.addEventOnce(Settings.getTransitionEvent(), this.navigationContainer, () => {\n if (!!e) {\n Event.dispatchAndFire(this.navigationContainer, EVENT_TOGGLE);\n }\n });\n OffCanvas.currentOpen = this;\n FixedWindow.getInstance().open(this, this.navigationContainer);\n const docElementCls = global.document.documentElement.classList;\n docElementCls.add(this.globalToggleClass);\n docElementCls.add(DARKENER_CLASS_INSTANT_TOGGLE);\n docElementCls.add(DARKENER_CLASS_TOGGLE);\n darkenerClass.add(INIT_CLASS);\n navigationControllerClassList.add(OPEN_CLASS);\n } else {\n return this.close(e);\n }\n }\n\n close(event) {\n if (this.navigationContainer.classList.contains(OPEN_CLASS)) {\n const promise = this._remove(event);\n this._removeInstant();\n return promise;\n }\n return new Promise(r => r());\n }\n\n /**\n * Register events\n * @param [delegate]\n */\n registerEvents(delegate) {\n const thisDelegate = delegate || global.document;\n FixedWindow.getInstance().addScreenConstraint(OffCanvas, (width) => width < Settings.get().smallBreakpoint);\n thisDelegate.addEventListener(Settings.getTabEvent(), (e) => {\n if (OffCanvas.currentOpen && OffCanvas.currentOpen !== this) {\n return;\n }\n const id = this.navigationContainerId;\n const validTarget = e.target.getAttribute(ATTR_TARGET) === id;\n if (!Util.isPartOfNode(e.target, this.navigationContainer)) {\n if (validTarget || (OffCanvas.currentOpen === this && e.target === this.darkener)) {\n this.toggle(e);\n }\n } else {\n if (e.target.hasAttribute(ATTR_CLOSE_SIDEBAR)) {\n this.toggle(e);\n }\n }\n });\n }\n}\n\nOffCanvas.currentOpen = null;\n\nexport default OffCanvas;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/main/OffCanvas.js\n **/","/*\n * The MIT License (MIT)\n *\n * Copyright (c) 2015 David Heidrich, BowlingX \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n/*!\n * FlexCss.Toggleable\n * Licensed under the MIT License (MIT)\n * Copyright (c) 2015 David Heidrich, BowlingX \n */\n\nimport Settings from './util/Settings';\nimport Widget from './Widget';\nimport Util from './util/Util';\nimport Event from './util/Event';\n\n/**\n * Event that is fired when a tab is closed\n * @type {string}\n */\n\nexport const EVENT_TAB_CLOSED = 'flexcss.tab.closed';\n\n/**\n * Event that is fired when a tab has been opened\n * @type {string}\n */\nexport const EVENT_TAB_OPENED = 'flexcss.tab.opened';\n/**\n * @type {string}\n */\nconst ATTR_NAME = 'data-toggle';\n/**\n * @type {string}\n */\nconst ACTIVE_CLASS = 'active';\n/**\n * @type {string}\n */\nconst LOADING_CLASS = 'loading';\n\n/**\n * @type {string}\n */\nconst ATTR_TOGGLE_LIST = 'data-toggle-list';\n\n/**\n * Creates a toggleable element, either for tabs or a single toggle\n */\nclass Toggleable {\n constructor(ContainerId) {\n const doc = global.document;\n\n this.container = ContainerId instanceof HTMLElement ? ContainerId :\n doc.getElementById(ContainerId);\n\n this.loading = false;\n\n if (!this.container) {\n throw new Error(`Toggleable container with id ${ContainerId} not found`);\n }\n }\n\n /**\n * Listener\n * @param {Event} e\n * @private\n */\n _listener(e) {\n let target = e.target;\n const parent = target.parentNode;\n const doc = global.document;\n\n // support target child element to clicked\n if (!target.hasAttribute(ATTR_NAME)) {\n if (parent && parent.hasAttribute(ATTR_NAME)) {\n target = parent;\n } else {\n return;\n }\n }\n\n if (!target.hasAttribute(ATTR_NAME)) {\n return;\n }\n\n const refId = target.getAttribute(ATTR_NAME);\n const ref = doc.getElementById(refId);\n\n e.preventDefault();\n\n if (this.loading) {\n return;\n }\n\n this.toggleTarget(ref, target);\n }\n\n /**\n * Registers Events for this instance\n * @returns {Toggleable}\n */\n registerEvents() {\n this.container.addEventListener(Settings.getTabEvent(), this._listener.bind(this));\n return this;\n }\n\n /**\n * Toggles given `ref`\n * @param {HTMLElement|Node} ref\n * @param {HTMLElement|Node} [selfTarget] optional target node\n */\n toggleTarget(ref, selfTarget) {\n let target = selfTarget;\n if (!target && !ref) {\n return;\n }\n if (!target) {\n target = document.querySelector(`[${ATTR_NAME}=\"${ref.id}\"]`);\n }\n\n let future;\n const elClassList = target.classList;\n const parent = target.parentNode;\n const doc = global.document;\n\n future = new Promise((resolve, failure) => {\n if (ref) {\n resolve(ref);\n } else {\n const widget = Widget.findWidget(target);\n const async = widget ? widget.getAsync() : null;\n if (Widget.isWidget(widget) && async) {\n future = async.then((r) => {\n if (r instanceof HTMLElement) {\n const id = Util.guid();\n r.id = id;\n target.setAttribute(ATTR_NAME, id);\n resolve(r);\n } else {\n throw new Error(`Dynamically creating toggle-content is not supported right now.\n Return an HTMLElement instance`);\n }\n });\n } else {\n failure('Target not given');\n }\n }\n });\n\n if (parent) {\n const maybeToggleNode = Util.parentsUntil(target, (node) => {\n return node && node.hasAttribute && node.hasAttribute(ATTR_TOGGLE_LIST);\n });\n\n const parentClassList = parent.classList;\n // Abort if element is already active and if is part of a toggle list\n if (maybeToggleNode) {\n if (!parentClassList.contains(ACTIVE_CLASS)) {\n parentClassList.toggle(ACTIVE_CLASS);\n parentClassList.add(LOADING_CLASS);\n } else {\n return;\n }\n }\n\n if (maybeToggleNode) {\n for (let i = 0; i < maybeToggleNode.children.length; i++) {\n const n = maybeToggleNode.children[i];\n const targetRef = n.children[0];\n if (n !== parent) {\n n.classList.remove(ACTIVE_CLASS);\n if (targetRef) {\n const attr = targetRef.getAttribute(ATTR_NAME);\n const el = attr ? doc.getElementById(attr) : null;\n if (el) {\n Event.dispatchAndFire(el, EVENT_TAB_CLOSED);\n el.classList.remove(ACTIVE_CLASS);\n targetRef.classList.remove(ACTIVE_CLASS);\n }\n }\n }\n }\n }\n }\n if (elClassList) {\n elClassList.toggle(ACTIVE_CLASS);\n elClassList.add(LOADING_CLASS);\n }\n this.loading = true;\n future.then((r) => {\n Event.dispatchAndFire(r, EVENT_TAB_OPENED);\n Toggleable._handleLoaded(target);\n r.classList.toggle(ACTIVE_CLASS);\n this.loading = false;\n }).catch(() => {\n this.loading = false;\n Toggleable._handleLoaded(target);\n });\n }\n\n /**\n * @param el\n * @private\n */\n static _handleLoaded(el) {\n const parentClassList = el.parentNode.classList;\n el.classList.remove(LOADING_CLASS);\n if (parentClassList) {\n parentClassList.remove(LOADING_CLASS);\n }\n }\n}\n\nexport default Toggleable;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/main/Toggleable.js\n **/","import Form from '../Form';\nimport Tooltip from '../Tooltip';\nimport Modal from '../Modal';\nimport Widget from '../Widget';\nimport Settings from '../util/Settings';\nimport Toggleable from '../Toggleable';\nimport OffCanvas from '../OffCanvas';\nimport Dropdown from '../Dropdown';\nimport LightBox from '../LightBox';\nimport Util from '../util/Util';\n\nexport { Form, Tooltip, Modal, Widget, Settings, Util, Toggleable, OffCanvas, Dropdown, LightBox };\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/main/modules/All.js\n **/"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///js/flexcss.min.js","webpack:///webpack/bootstrap a32af781d3d6caa30484","webpack:///./src/main/util/Util.js","webpack:///./src/main/util/Settings.js","webpack:///./src/main/util/Event.js","webpack:///./src/main/Widget.js","webpack:///./src/main/DestroyableWidget.js","webpack:///./src/main/Tooltip.js","webpack:///./src/main/lib/FixedWindow.js","webpack:///./src/main/Modal.js","webpack:///./src/main/Form.js","webpack:///./src/main/lib/debounce.js","webpack:///./~/isomorphic-fetch/fetch-npm-browserify.js","webpack:///./~/whatwg-fetch/fetch.js","webpack:///./src/main/Dropdown.js","webpack:///./src/main/LightBox.js","webpack:///./src/main/OffCanvas.js","webpack:///./src/main/Toggleable.js","webpack:///./src/main/modules/All.js"],"names":["root","factory","exports","module","define","amd","this","modules","__webpack_require__","moduleId","installedModules","id","loaded","call","m","c","p","global","_classCallCheck","instance","Constructor","TypeError","Object","defineProperty","value","_createClass","defineProperties","target","props","i","length","descriptor","enumerable","configurable","writable","key","protoProps","staticProps","prototype","PFX","COL_LEFT_CLASS","COL_RIGHT_CLASS","COL_BOTTOM_CLASS","Util","element","type","callback","thisFunction","e","apply","thisType","toLowerCase","name","addEventListener","t","el","document","createElement","transitions","transition","OTransition","MozTransition","WebkitTransition","undefined","style","parent","now","parentNode","func","s4","Math","floor","random","toString","substring","doc","inner","width","height","outer","position","top","left","visibility","overflow","appendChild","body","w1","offsetWidth","w2","clientWidth","removeChild","ev","capture","event","removeEventListener","offsetHeight","str","replace","g","toUpperCase","input","JSON","parse","stringify","base","attrs","attributes","attr","s","dashToCamelCase","nodeName","val","nodeValue","hasOwnProperty","parseInt","elementToPosition","collisionContainer","centerHorizontal","positionTop","amountTop","amountLeft","parentsUntil","HTMLElement","window","getComputedStyle","isPartOfNode","offsetTop","offsetLeft","targetPosition","getBoundingClientRect","elementRect","colRect","targetTop","targetRight","right","isCollisionTop","isCollisionBottom","innerHeight","isCollisionLeft","targetLeft","isCollisionRight","classList","remove","calcTop","calcLeft","add","rightPosition","leftCentered","collisionCentered","cssText","optionalOffset","scrollIntoView","thisOffset","scrolledY","pageYOffset","scroll","_interopRequireDefault","obj","__esModule","default","_Util","_Util2","FLEXCSS_GLOBAL_SETTINGS","smallBreakpoint","scrollbarUpdateNodes","darkenerFadeDelay","canvasToggledClass","FLEXCSS_CONST_IS_IOS","FLEXCSS_CONST_IS_TOUCH","FLEXCSS_CONST_IS_IE","FLEXCSS_CONST_TAB_EVENT","FLEXCSS_IS_SMALL_SCREEN","init","FLEXCSS_CONST_SCROLLBAR_WIDTH","getScrollBarWidth","FLEXCSS_CONST_TRANSITION_EVENT","whichTransitionEndEvent","readyState","Settings","settings","assign","navigator","userAgent","match","innerWidth","get","msMaxTouchPoints","CustomEvent","_CustomEvent","params","thisParams","bubbles","cancelable","detail","evt","createEvent","initCustomEvent","Event","EventHandler","defaultOptions","options","withDetail","originalEvent","o","dispatchEvent","withOptions","fire","_typeof","Symbol","iterator","constructor","Widget","_this","asyncContent","_isWidget","getElementById","Error","hfWidgetInstance","setAsync","Promise","finalContent","async","self","DestroyableWidget","listeners","forEach","listener","args","push","_possibleConstructorReturn","ReferenceError","_inherits","subClass","superClass","create","setPrototypeOf","__proto__","_get","object","property","receiver","Function","desc","getOwnPropertyDescriptor","getPrototypeOf","getter","_DestroyableWidget2","_DestroyableWidget3","_Settings","_Settings2","CLASS_NAMES_TOOLTIP","CLASS_NAMES_OPEN","ATTR_DATA_CLASSNAME","ATTR_DATA_NO_TOUCH","Tooltip","_DestroyableWidget","DelegateContainer","container","tooltipContainer","containerClass","selectorAttribute","text","removeTitle","positionRelative","trim","isTouchDevice","hasAttribute","_restoreClassNames","innerHTML","flexTooltipCurrentTarget","oldTitle","removeAttribute","setupPositionNearby","classNames","maybeTargetClass","getAttribute","className","join","selfTarget","setAttribute","createTooltip","removeTooltip","EVENT_AFTER_FIXED_REMOVE","EVENT_BEFORE_FIXED_ADD","_slicedToArray","sliceIterator","arr","_arr","_n","_d","_e","_s","_i","next","done","err","Array","isArray","_debounce","_debounce2","_Event","_Event2","CLS_FIXED_WINDOW","fixedWindowInstance","FixedWindow","widgets","currentScrollTop","fixedScreenConstraints","windowWidth","isFixedWindowActive","touchListener","widget","fixedBreakpointFn","Set","widgetsThatRequireFixedWindow","from","some","_ref","_addFixedContainer","_removeFixedContainer","_this2","dispatchAndFire","getCurrentWidget","map","n","foundProperty","direction","node","whatNode","d","__fixedWindowMod__","getScrollbarWidth","preventDefault","shouldNotMove","touchStartListener","_getCurrentWidget","scrollTop","scrollHeight","touchMoveListener","_getCurrentWidget2","stopImmediatePropagation","documentElement","_node","paddingRight","_checkFixedNeeded","pop","fixed","fixedWidget","eventHandler","resizeListener","bind","EVENT_MODAL_ASYNC_TARGET_LOADED","EVENT_MODAL_INIT","EVENT_MODAL_OPENED","EVENT_MODAL_BEFORE_CLOSED","EVENT_MODAL_CLOSED","_Widget","_Widget2","_FixedWindow","_FixedWindow2","HTML_ELEMENT","KEY_ESC","ATTR_CREATE_NEW","ATTR_CLOSE","ATTR_NAME","CLS_CONTAINER_CURRENT","CLS_OPEN","CLS_CURRENT","CLS_PART_OF_STACK","CLS_MODAL_OPEN","CLS_MODAL_CONTAINER","CLS_ANIM_END","CLS_LOADER_CONTAINER","CLS_LOADER","Modal","currentOpen","loading","closeOnEscape","closeOnBackgroundClick","destroyOnFinish","fixedContainer","containerClassNames","eventContainer","eventFunction","dataMainPageContainer","modalContainer","_modalInstances","indexOf","splice","getInstance","close","applyOptionsFromElement","copy","KeyboardEvent","getTabEvent","defaultPrevented","_finishState","prevModal","switchModals","dispatch","withOriginal","_removeModalFromStack","lastContainer","childNodes","cl","destroy","co","last","open","prefixedAnimateEvent","_finishAnim","instances","isCurrent","contains","foundInstance","flexModalInstance","targetContent","future","hasTarget","isHtmlElement","isWidget","findWidget","newInstance","setDestroyOnFinish","fromEvent","then","registerEvents","getModalContainer","modalContainerClasses","closeModalFunction","ce","loader","toggleLoader","show","loaderLoader","handleScrollbar","getAsync","r","result","DocumentFragment","guid","resolve","thisEl","modal","internal","maybeEvent","delegate","delegateContainer","addScreenConstraint","createWidget","arguments","v","isEmptyContainer","MutationObserver","observer","mutations","disconnect","observe","childList","keyCode","lastModal","EVENT_FORM_AJAX_COMPLETED","EVENT_FORM_AFTER_AJAX_SUBMIT","EVENT_FORM_SUBMIT","EVENT_FORM_READY","_Tooltip","_Tooltip2","LOADING_CLASS","DATA_ELEMENT_INVALID","REMOTE","REMOTE_ACTION","ATTR_DISABLE_INLINE","ATTR_DISABLE_REALTIME","ATTR_VALIDATOR","ATTR_DATA_CUSTOM_MESSAGE","ATTR_DATA_CUSTOM_LABEL","ATTR_VALIDATE_VISIBILITY","ATTR_ERROR_TARGET_ID","ATTR_DEPENDS","CONST_USE_JSON","CONST_REALTIME_EVENT","FOCUS_TOOLTIP_DELAY","CLICK_TOOLTIP_DELAY","Form","form","HTMLFormElement","tooltips","currentValidationFuture","createTooltips","appendError","ajaxSubmitType","ajaxJsonContentType","inlineValidation","realtime","realtimeTimeout","formatErrorTooltip","error","inputErrorClass","containerErrorClass","fetchOptions","credentials","tooltipOptions","scrollToElementDiff","_validators","globalValidators","_remoteValidationFunction","initFormValidation","thisForm","shouldUseAjax","ajaxPostUrl","location","href","useJson","_formStopLoading","submit","defaultHeaders","X-Requested-With","Content-Type","headers","method","serverCall","fetch","serialize","FormData","globalRemoteValidationFunction","response","selectors","inputs","querySelectorAll","exists","field","focus","fields","NodeList","_handleValidation","foundAnyError","toValidateFields","scoped","_createArrayFromInvalidFieldList","isLocalInvalid","_focusElement","validation","_customValidationsForElements","validateCustomFields","thisToValidateFields","concat","checkedFields","foundInvalidFields","prepareErrors","firstInvalidField","activeElement","_handleTooltipHideClickAfterChange","showAndOrCreateTooltip","validity","globalErrorMessageHandler","keys","labels","getForm","invalid","labelsIndex","labelEl","_markElementInvalid","_markElementValid","filter","HTMLFieldSetElement","thisParent","errors","inputsWithErrorClasses","elementErrorIndex","inputErrorIndex","validator","validationRef","futures","fieldsLength","iVal","_shouldNotValidateField","customError","valid","_runValidation","console","warn","all","allFutures","l","fI","_removeElementErrors","removeAllErrors","handleAdditionalLabels","isInvalid","thisLabelGroup","additionalLabels","group","removeErrors","labelGroups","invalidFields","errorTarget","_findErrorTarget","flexFormsSavedValidity","_setupErrorMessages","msg","validationMessage","insertAdjacentHTML","flexFormsSavedValidationMessage","setCustomValidity","_field","linkedFields","thisField","_isElementInvalidElement","_handleLabels","_formatErrorTooltip","fieldSelector","slice","_checkIsValidRealtimeElement","clearKeyDownTimeout","KEYDOWN_RUNNING","clearTimeout","TIMEOUT_KEYDOWN","_checkIsValidBlurFocusElement","_checkIsValidInlineCheckElement","_this3","invalidEvent","addEventOnce","handleInvalid","_formLoading","_checkIsInvalid","setTimeout","_handleSubmit","_formIsLoading","isStillTarget","_handleTooltipInline","dependentFields","_getDependentFields","flexcssKeepTooltips","_submitListener","scrollToElement","submitListener","submitEvent","checkValidity","_getInvalidElements","firstError","_submitFunction","isVisible","list","foundTarget","errorFunc","selector","forms","customMsg","fn","ms","timeout","normalizeName","String","test","normalizeValue","Headers","append","getOwnPropertyNames","consumed","bodyUsed","reject","fileReaderReady","reader","onload","onerror","readBlobAsArrayBuffer","blob","FileReader","readAsArrayBuffer","readBlobAsText","readAsText","Body","_initBody","_bodyInit","_bodyText","support","Blob","isPrototypeOf","_bodyBlob","formData","_bodyFormData","arrayBuffer","ArrayBuffer","set","rejected","decode","json","normalizeMethod","upcased","methods","Request","url","mode","referrer","split","bytes","shift","decodeURIComponent","xhr","head","pairs","getAllResponseHeaders","header","Response","bodyInit","status","ok","statusText","values","getAll","has","thisArg","clone","redirectStatuses","redirect","RangeError","responseURL","getResponseHeader","request","XMLHttpRequest","responseText","withCredentials","responseType","setRequestHeader","send","polyfill","EVENT_DROPDOWN_CLOSED","ATTR_CC","ATTR_DARKENER","DARKENER_INIT","ATTR_DATA_TARGET","ATTR_CLOSE_DROPDOWN","STATE_LOADING","CLS_DARKENER_DROPDOWN","CLS_DROPDOWN","Dropdown","Darkener","currentTarget","darkener","destroyOnClose","closestCallback","targetIsCurrent","_delegateFunction","isLoading","createDropdown","cls","darkenerInstance","flexDarkenerInstance","thisCurrentOpen","getTransitionEvent","scheduler","srcElement","requestAnimationFrame","toggleDarkenerToggler","thisWidget","data","dropdownContainerElement","dropdownContent","isAbsolute","flexCollisionContainer","collisionC","toggle","_Modal","_Modal2","ATTR_MAX_WIDTH","ATTR_MAX_HEIGHT","ATTR_SRC","CLS_HAS_PREV","CLS_HAS_NEXT","CLS_LOADING","ATTR_NO_THUMBNAIL","ATTR_DATA_HREF","ATTR_HREF","KEY_NEXT","KEY_PREV","LightBox","AttributeSelector","ModalAppend","thisDelegateContainer","_modalAppend","_resizeEvent","_keyboardNextEvent","_future","_nextFuture","_imageContainer","_modalContainerDiv","_contentContainer","_closerContainerDiv","_delegateContainer","_attributeSelector","_widget","_isOpen","img","_isLoading","registerPrevNextEvents","closeOnLast","onNext","onClose","getNext","getPrev","onSwitchImage","children","findImmediateNextTarget","nextElementSibling","previousElementSibling","onOpen","validTarget","parentIsValid","switchImage","_","hasPrev","hasNext","hasPrevClass","hasNextClass","isIE","_ret","nextThumb","nextHighRes","nextSource","src","nextImgObject","Image","backgroundImage","_setupMaxWidthHeight","_calculateContainer","highRes","_setupPrevNextStates","thisThumbnail","thisImgHighResolution","_this4","highImageObj","_getSrc","_this5","thumbnail","imgHighResolution","imgSrc","imageObj","pageX","TouchEvent","changedTouches","rect","imgX","wrapperWidth","posX","switchImageByDirection","_runOptionalClose","fromWidget","loadedImage","nextMaxWidth","nextMaxHeight","maxWidth","maxHeight","EVENT_TOGGLE","ATTR_CLOSE_SIDEBAR","ATTR_TARGET","INIT_CLASS","OPEN_CLASS","HIDE_FACTOR","OffCanvas","NavigationId","factor","disableTouch","touchedX","navigationContainer","DARKENER_CLASS_TOGGLE","DARKENER_CLASS_INSTANT_TOGGLE","shouldNotTouch","darkenerClassToggle","darkenerClassToggleInstant","globalToggleClass","navigationContainerId","touches","clientX","mustHide","calcX","bounds","compare","webkitTransition","transform","webkitTransform","_remove","resetTransform","_removeInstant","docCls","darkenerClass","navigationControllerClassList","docElementCls","promise","thisDelegate","EVENT_TAB_OPENED","EVENT_TAB_CLOSED","ACTIVE_CLASS","ATTR_TOGGLE_LIST","Toggleable","ContainerId","refId","ref","toggleTarget","_listener","querySelector","elClassList","failure","maybeToggleNode","parentClassList","targetRef","_handleLoaded","_Form","_Form2","_Toggleable","_Toggleable2","_OffCanvas","_OffCanvas2","_Dropdown","_Dropdown2","_LightBox","_LightBox2"],"mappings":"CA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o4B,EAAS/uB,EAAuB8uB,GAEhCzb,EAAW1c,EAAoB,GAE/B2c,EAAYtT,EAAuBqT,GAEnCyS,EAASnvB,EAAoB,GAE7BovB,EAAU/lB,EAAuB8lB,GAEjCtZ,EAAU7V,EAAoB,GAE9B8V,EAAWzM,EAAuBwM,GAElC5G,EAAYjP,EAAoB,GAEhCkP,EAAa7F,EAAuB4F,GAEpCopB,EAAcr4B,EAAoB,IAElCs4B,EAAejvB,EAAuBgvB,GAEtCE,EAAav4B,EAAoB,IAEjCw4B,EAAcnvB,EAAuBkvB,GAErCE,EAAYz4B,EAAoB,IAEhC04B,EAAarvB,EAAuBovB,GAEpCE,EAAY34B,EAAoB,IAEhC44B,EAAavvB,EAAuBsvB,GAEpClvB,EAAQzJ,EAAoB,GAE5B0J,EAASL,EAAuBI,EAIpC/J,GkB3mLQke,KAAAwa,alB4mLR14B,EkB5mLc6P,QAAAoN,alB6mLdjd,EkB7mLuBqX,MAAAqY,alB8mLvB1vB,EkB9mL8BkN,OAAAkJ,alB+mL9BpW,EkB/mLsCiL,SAAAuE,alBgnLtCxP,EkBhnLgDyC,KAAAuH,alBinLhDhK,EkBjnLsD43B,WAAAgB,alBknLtD54B,EkBlnLkEy1B,UAAAqD,alBmnLlE94B,EkBnnL6E8tB,SAAAkL,alBonL7Eh5B,EkBpnLuFswB,SAAA4I","file":"js/flexcss.min.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"FlexCss\"] = factory();\n\telse\n\t\troot[\"FlexCss\"] = factory();\n})(this, function() {\nreturn \n\n\n/** WEBPACK FOOTER **\n ** webpack/universalModuleDefinition\n **/","(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"FlexCss\"] = factory();\n\telse\n\t\troot[\"FlexCss\"] = factory();\n})(this, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId])\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\texports: {},\n/******/ \t\t\tid: moduleId,\n/******/ \t\t\tloaded: false\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.loaded = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"../\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tmodule.exports = __webpack_require__(17);\n\n\n/***/ },\n/* 1 */\n/***/ function(module, exports) {\n\n\t/* WEBPACK VAR INJECTION */(function(global) {\"use strict\";\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\t/*\n\t * The MIT License (MIT)\n\t *\n\t * Copyright (c) 2015 David Heidrich, BowlingX \n\t *\n\t * Permission is hereby granted, free of charge, to any person obtaining a copy\n\t * of this software and associated documentation files (the \"Software\"), to deal\n\t * in the Software without restriction, including without limitation the rights\n\t * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n\t * copies of the Software, and to permit persons to whom the Software is\n\t * furnished to do so, subject to the following conditions:\n\t *\n\t * The above copyright notice and this permission notice shall be included in\n\t * all copies or substantial portions of the Software.\n\t *\n\t * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n\t * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n\t * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n\t * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n\t * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n\t * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n\t * THE SOFTWARE.\n\t */\n\t\n\tvar PFX = [\"webkit\", \"moz\", \"MS\", \"o\", \"\"];\n\t\n\tvar COL_LEFT_CLASS = 'is-collision-left';\n\t\n\tvar COL_RIGHT_CLASS = 'is-collision-right';\n\t\n\tvar COL_BOTTOM_CLASS = 'is-collision-bottom';\n\t\n\t/**\n\t * Provides shared DOM-Utility functions\n\t */\n\t\n\tvar Util = function () {\n\t function Util() {\n\t _classCallCheck(this, Util);\n\t }\n\t\n\t _createClass(Util, null, [{\n\t key: \"prefixedAnimateEvent\",\n\t\n\t\n\t /**\n\t * Will register the right animation event based on browser\n\t * @param element\n\t * @param type\n\t * @param callback\n\t */\n\t value: function prefixedAnimateEvent(element, type, callback) {\n\t var thisFunction = function thisFunction(e) {\n\t callback.apply(element, [e, thisFunction]);\n\t };\n\t\n\t for (var p = 0; p < PFX.length; p++) {\n\t var thisType = type;\n\t if (!PFX[p]) {\n\t thisType = type.toLowerCase();\n\t }\n\t var name = PFX[p] + thisType;\n\t element.addEventListener(name, thisFunction, true);\n\t }\n\t }\n\t\n\t /**\n\t * Get correct transitionend event\n\t * @returns {String}\n\t * @private\n\t */\n\t\n\t }, {\n\t key: \"whichTransitionEndEvent\",\n\t value: function whichTransitionEndEvent() {\n\t var t = void 0;\n\t var el = document.createElement('fake');\n\t\n\t var transitions = {\n\t transition: 'transitionend',\n\t OTransition: 'oTransitionEnd',\n\t MozTransition: 'transitionend',\n\t WebkitTransition: 'webkitTransitionEnd'\n\t };\n\t\n\t for (t in transitions) {\n\t if (el.style[t] !== undefined) {\n\t return transitions[t];\n\t }\n\t }\n\t }\n\t\n\t /**\n\t * Check if target is part of parent node\n\t * @param target\n\t * @param parent\n\t * @returns {boolean}\n\t */\n\t\n\t }, {\n\t key: \"isPartOfNode\",\n\t value: function isPartOfNode(target, parent) {\n\t if (!target || !parent) {\n\t return false;\n\t }\n\t var now = target;\n\t while (now !== parent && now !== null) {\n\t if (now === parent) {\n\t break;\n\t }\n\t now = now.parentNode;\n\t }\n\t return now !== null;\n\t }\n\t\n\t /**\n\t * Finds the closest element including itself matching a callback\n\t * @param {Node} el\n\t * @param {Function} callback\n\t * @returns {Node|boolean}\n\t */\n\t\n\t }, {\n\t key: \"closestCallback\",\n\t value: function closestCallback(el, callback) {\n\t var element = el;\n\t while (element !== null) {\n\t if (callback(element)) {\n\t return element;\n\t }\n\t element = element.parentNode;\n\t }\n\t return false;\n\t }\n\t\n\t /**\n\t * Walks the tree until func returns true for given argument\n\t * @param target\n\t * @param func\n\t * @returns {boolean|HTMLElement}\n\t */\n\t\n\t }, {\n\t key: \"parentsUntil\",\n\t value: function parentsUntil(target, func) {\n\t if (!target) {\n\t return false;\n\t }\n\t var now = target;\n\t while (!func(now) && now !== null) {\n\t now = now.parentNode;\n\t }\n\t\n\t return now;\n\t }\n\t\n\t /**\n\t * Generates a unique id\n\t * @return {String}\n\t */\n\t\n\t }, {\n\t key: \"guid\",\n\t value: function guid() {\n\t function s4() {\n\t return Math.floor((1 + Math.random()) * 0x10000).toString(16).substring(1);\n\t }\n\t\n\t return s4() + s4() + \"-\" + s4() + \"-\" + s4() + \"-\" + s4() + \"-\" + (s4() + s4() + s4());\n\t }\n\t\n\t /**\n\t * Detects scrollbar width\n\t * @see http://stackoverflow.com/questions/986937/how-can-i-get-the-browsers-scrollbar-sizes\n\t * @returns {number}\n\t */\n\t\n\t }, {\n\t key: \"getScrollBarWidth\",\n\t value: function getScrollBarWidth() {\n\t var doc = global.document;\n\t var inner = doc.createElement('p');\n\t\n\t inner.style.width = \"100%\";\n\t inner.style.height = \"200px\";\n\t\n\t var outer = doc.createElement('div');\n\t outer.style.position = \"absolute\";\n\t outer.style.top = \"0px\";\n\t outer.style.left = \"0px\";\n\t outer.style.visibility = \"hidden\";\n\t outer.style.width = \"200px\";\n\t outer.style.height = \"150px\";\n\t outer.style.overflow = \"hidden\";\n\t outer.appendChild(inner);\n\t\n\t doc.body.appendChild(outer);\n\t var w1 = inner.offsetWidth;\n\t outer.style.overflow = 'scroll';\n\t var w2 = inner.offsetWidth;\n\t if (w1 === w2) {\n\t w2 = outer.clientWidth;\n\t }\n\t doc.body.removeChild(outer);\n\t\n\t return w1 - w2;\n\t }\n\t\n\t /**\n\t * Run an event once\n\t * @param {String} ev\n\t * @param {HTMLElement|HTMLDocument} target\n\t * @param {Function} func\n\t * @param {boolean} [capture]\n\t * @return Function created listener\n\t */\n\t\n\t }, {\n\t key: \"addEventOnce\",\n\t value: function addEventOnce(ev, target, func, capture) {\n\t var thisFunction = function thisFunction(event) {\n\t func(event, func);\n\t target.removeEventListener(ev, thisFunction, capture);\n\t };\n\t target.addEventListener(ev, thisFunction, capture);\n\t return thisFunction;\n\t }\n\t\n\t /**\n\t * Checks if an element is visible\n\t * @param {HTMLElement} element\n\t * @returns bool\n\t */\n\t\n\t }, {\n\t key: \"isVisible\",\n\t value: function isVisible(element) {\n\t return element.offsetWidth > 0 && element.offsetHeight > 0;\n\t }\n\t\n\t /**\n\t * Creates a camelCaseRepresentation of a dashed string\n\t * @param {String} str\n\t * @returns String\n\t */\n\t\n\t }, {\n\t key: \"dashToCamelCase\",\n\t value: function dashToCamelCase(str) {\n\t return str.replace(/-([a-z])/g, function (g) {\n\t return g[1].toUpperCase();\n\t });\n\t }\n\t\n\t /**\n\t * Creates a copy of `input`\n\t * @param {*} input\n\t * @return *\n\t */\n\t\n\t }, {\n\t key: \"copy\",\n\t value: function copy(input) {\n\t return JSON.parse(JSON.stringify(input));\n\t }\n\t\n\t /**\n\t * Reads options from element (data attributes) and applies to base\n\t * @param {HTMLElement} element\n\t * @param {Object} base\n\t * @return {Object}\n\t */\n\t\n\t }, {\n\t key: \"applyOptionsFromElement\",\n\t value: function applyOptionsFromElement(element, base) {\n\t if (!element) {\n\t return base;\n\t }\n\t var attrs = element.attributes;\n\t for (var i = 0; i < attrs.length; i++) {\n\t var attr = attrs[i];\n\t if (attr) {\n\t var s = Util.dashToCamelCase(attr.nodeName.replace('data-', ''));\n\t var val = attr.nodeValue;\n\t if (base.hasOwnProperty(s)) {\n\t // skip functions\n\t if (typeof base[s] === 'function') {\n\t continue;\n\t }\n\t if (typeof base[s] === 'boolean') {\n\t base[s] = parseInt(val || 1, 10) === 1;\n\t } else {\n\t base[s] = val;\n\t }\n\t }\n\t }\n\t }\n\t return base;\n\t }\n\t\n\t /**\n\t * Will position an element directly at given target\n\t * Is aware of a given collision container to detect edges\n\t * Will put elementToPosition either to left, center or right edge (prefer right)\n\t * and either to bottom or top (prefers bottom)\n\t *\n\t * You may overwrite preferred positioned with `centerHorizontal` and `positionTop`\n\t *\n\t * @param {HTMLElement|ClientRect} target the target container to align to\n\t * @param {HTMLElement} elementToPosition the element to position\n\t * @param {HTMLElement} collisionContainer the outer container to prevent collisions\n\t * @param {boolean} [centerHorizontal] set true to center element, otherwise it's put on the right border by default\n\t * @param {boolean} [positionTop] flip top, by default element is positioned to the bottom.\n\t * @returns {HTMLElement}\n\t */\n\t\n\t }, {\n\t key: \"setupPositionNearby\",\n\t value: function setupPositionNearby(target, elementToPosition, collisionContainer, centerHorizontal, positionTop) {\n\t // determine relative offsets\n\t var amountTop = 0;\n\t var amountLeft = 0;\n\t Util.parentsUntil(target.parentNode, function (el) {\n\t if (!(el instanceof HTMLElement)) {\n\t return false;\n\t }\n\t var style = window.getComputedStyle(el);\n\t if (Util.isPartOfNode(elementToPosition, el)) {\n\t if (style && style.position === 'relative') {\n\t amountTop += el.offsetTop || 0;\n\t amountLeft += el.offsetLeft || 0;\n\t }\n\t return false;\n\t }\n\t return true;\n\t });\n\t\n\t var targetPosition = target instanceof HTMLElement ? target.getBoundingClientRect() : target;\n\t var elementRect = elementToPosition.getBoundingClientRect();\n\t var colRect = collisionContainer.getBoundingClientRect();\n\t var targetTop = targetPosition.top - amountTop;\n\t var targetRight = targetPosition.right;\n\t var isCollisionTop = targetTop - elementRect.height <= 0;\n\t var isCollisionBottom = window.innerHeight < targetTop + amountTop + targetPosition.height + elementRect.height;\n\t var isCollisionLeft = targetRight < elementRect.width;\n\t var targetLeft = targetPosition.left;\n\t var isCollisionRight = targetLeft + elementRect.width > colRect.width;\n\t var classList = elementToPosition.classList;\n\t\n\t classList.remove(COL_RIGHT_CLASS);\n\t classList.remove(COL_LEFT_CLASS);\n\t classList.remove(COL_BOTTOM_CLASS);\n\t\n\t var calcTop = void 0;\n\t var calcLeft = void 0;\n\t if (isCollisionLeft && !isCollisionRight) {\n\t // put element to left if collision with left\n\t calcLeft = targetPosition.left - colRect.left - amountLeft + \"px\";\n\t classList.add(COL_LEFT_CLASS);\n\t } else {\n\t // maybe center if no collision with either side\n\t var rightPosition = targetRight - elementRect.width - colRect.left - amountLeft + \"px\";\n\t var leftCentered = (targetLeft + targetPosition.width / 2 - elementRect.width / 2 || 0) - colRect.left;\n\t var collisionCentered = leftCentered + elementRect.width > colRect.width;\n\t if (centerHorizontal && !collisionCentered) {\n\t calcLeft = leftCentered + \"px\";\n\t } else {\n\t classList.add(COL_RIGHT_CLASS);\n\t calcLeft = rightPosition;\n\t }\n\t }\n\t\n\t if (isCollisionBottom || positionTop && !isCollisionTop) {\n\t // Put Element on top if collision\n\t calcTop = targetTop - elementRect.height - colRect.top + \"px\";\n\t classList.add(COL_BOTTOM_CLASS);\n\t } else {\n\t calcTop = targetTop + targetPosition.height - colRect.top + \"px\";\n\t }\n\t\n\t elementToPosition.style.cssText = \"top:\" + calcTop + \";left:\" + calcLeft + \";\";\n\t\n\t return elementToPosition;\n\t }\n\t\n\t /**\n\t * Brings a given element into viewport\n\t * @param {HTMLElement} el\n\t * @param {int|function}[optionalOffset]\n\t */\n\t\n\t }, {\n\t key: \"scrollToElement\",\n\t value: function scrollToElement(el, optionalOffset) {\n\t el.scrollIntoView();\n\t var thisOffset = optionalOffset;\n\t // optionally use a additional scrollDif\n\t if (thisOffset) {\n\t if (typeof thisOffset === 'function') {\n\t thisOffset = optionalOffset();\n\t }\n\t if (thisOffset > 0) {\n\t var scrolledY = window.pageYOffset;\n\t if (scrolledY) {\n\t window.scroll(0, scrolledY - thisOffset);\n\t }\n\t }\n\t }\n\t }\n\t }]);\n\t\n\t return Util;\n\t}();\n\t\n\texports.default = Util;\n\t/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))\n\n/***/ },\n/* 2 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t/* WEBPACK VAR INJECTION */(function(global) {'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /*\n\t * The MIT License (MIT)\n\t *\n\t * Copyright (c) 2015 David Heidrich, BowlingX \n\t *\n\t * Permission is hereby granted, free of charge, to any person obtaining a copy\n\t * of this software and associated documentation files (the \"Software\"), to deal\n\t * in the Software without restriction, including without limitation the rights\n\t * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n\t * copies of the Software, and to permit persons to whom the Software is\n\t * furnished to do so, subject to the following conditions:\n\t *\n\t * The above copyright notice and this permission notice shall be included in\n\t * all copies or substantial portions of the Software.\n\t *\n\t * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n\t * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n\t * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n\t * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n\t * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n\t * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n\t * THE SOFTWARE.\n\t */\n\t\n\t\n\tvar _Util = __webpack_require__(1);\n\t\n\tvar _Util2 = _interopRequireDefault(_Util);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\t// we attach global settings to global once because settings might be shared a lot of times trough the application\n\t// Maybe find a better way to handle that scenario\n\tif (!global.FLEXCSS_GLOBAL_SETTINGS) {\n\t (function () {\n\t global.FLEXCSS_GLOBAL_SETTINGS = {\n\t // defined breakpoint for small devices < n\n\t smallBreakpoint: 768,\n\t // nodes that should be updated when no scrollbar is expected\n\t scrollbarUpdateNodes: global.document.body !== null ? [global.document.body] : [],\n\t // additional Delay until darkener is fully hidden\n\t darkenerFadeDelay: 100,\n\t // class that is added if canvas has been toggled\n\t canvasToggledClass: 'toggled-canvas'\n\t };\n\t\n\t global.FLEXCSS_CONST_IS_IOS = null;\n\t\n\t global.FLEXCSS_CONST_IS_TOUCH = null;\n\t\n\t global.FLEXCSS_CONST_IS_IE = null;\n\t\n\t global.FLEXCSS_CONST_TAB_EVENT = 'click';\n\t\n\t global.FLEXCSS_IS_SMALL_SCREEN = false;\n\t\n\t var init = function init() {\n\t // Measure scrollbar width\n\t global.FLEXCSS_CONST_SCROLLBAR_WIDTH = _Util2.default.getScrollBarWidth();\n\t // detect right transition end event\n\t global.FLEXCSS_CONST_TRANSITION_EVENT = _Util2.default.whichTransitionEndEvent();\n\t };\n\t\n\t if (global.document.readyState !== 'loading') {\n\t init();\n\t } else {\n\t // it's possible that global.document.body is not available if the document is not\n\t // loaded completely\n\t document.addEventListener('DOMContentLoaded', function () {\n\t init();\n\t });\n\t }\n\t })();\n\t}\n\t\n\t/**\n\t * Utility class that setups global settings\n\t */\n\t\n\tvar Settings = function () {\n\t function Settings() {\n\t _classCallCheck(this, Settings);\n\t }\n\t\n\t _createClass(Settings, null, [{\n\t key: 'setup',\n\t\n\t\n\t /**\n\t * Setup global settings, overwrite default values\n\t * @param {Object} settings\n\t */\n\t value: function setup(settings) {\n\t Object.assign(global.FLEXCSS_GLOBAL_SETTINGS, settings);\n\t }\n\t\n\t /**\n\t * Access to global settings\n\t * @returns {Object}\n\t */\n\t\n\t }, {\n\t key: 'get',\n\t value: function get() {\n\t return global.FLEXCSS_GLOBAL_SETTINGS;\n\t }\n\t\n\t /**\n\t * Detects a IOS Device, caches subsequent calls\n\t * @returns {boolean}\n\t */\n\t\n\t }, {\n\t key: 'isIosDevice',\n\t value: function isIosDevice() {\n\t if (!global.FLEXCSS_CONST_IS_IOS) {\n\t global.FLEXCSS_CONST_IS_IOS = global.navigator.userAgent.match(/(iPad|iPhone|iPod)/i);\n\t }\n\t\n\t return global.FLEXCSS_CONST_IS_IOS;\n\t }\n\t\n\t /**\n\t * @returns {boolean}\n\t */\n\t\n\t }, {\n\t key: 'isSmallScreen',\n\t value: function isSmallScreen() {\n\t return window.innerWidth < Settings.get().smallBreakpoint;\n\t }\n\t\n\t /**\n\t * Detects a touch device, caches subsequent calls\n\t * @returns {boolean}\n\t */\n\t\n\t }, {\n\t key: 'isTouchDevice',\n\t value: function isTouchDevice() {\n\t if (!global.FLEXCSS_CONST_IS_TOUCH) {\n\t global.FLEXCSS_CONST_IS_TOUCH = 'ontouchstart' in window || !!global.navigator.msMaxTouchPoints;\n\t }\n\t return global.FLEXCSS_CONST_IS_TOUCH;\n\t }\n\t\n\t /**\n\t * Checks if current browser is Internet Explorer\n\t * @returns {boolean|*}\n\t */\n\t\n\t }, {\n\t key: 'isIE',\n\t value: function isIE() {\n\t if (!global.FLEXCSS_CONST_IS_IE) {\n\t global.FLEXCSS_CONST_IS_IE = \"ActiveXObject\" in window;\n\t }\n\t return global.FLEXCSS_CONST_IS_IE;\n\t }\n\t\n\t /**\n\t * @returns {String}\n\t */\n\t\n\t }, {\n\t key: 'getTransitionEvent',\n\t value: function getTransitionEvent() {\n\t return global.FLEXCSS_CONST_TRANSITION_EVENT;\n\t }\n\t\n\t /**\n\t * @returns {int}\n\t */\n\t\n\t }, {\n\t key: 'getScrollbarWidth',\n\t value: function getScrollbarWidth() {\n\t return global.FLEXCSS_CONST_SCROLLBAR_WIDTH;\n\t }\n\t\n\t /**\n\t * @returns {String}\n\t */\n\t\n\t }, {\n\t key: 'getTabEvent',\n\t value: function getTabEvent() {\n\t return global.FLEXCSS_CONST_TAB_EVENT;\n\t }\n\t }]);\n\t\n\t return Settings;\n\t}();\n\t\n\texports.default = Settings;\n\t/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))\n\n/***/ },\n/* 3 */\n/***/ function(module, exports) {\n\n\t/* WEBPACK VAR INJECTION */(function(global) {\"use strict\";\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\t/* global CustomEvent */\n\t\n\t/*\n\t * The MIT License (MIT)\n\t *\n\t * Copyright (c) 2015 David Heidrich, BowlingX \n\t *\n\t * Permission is hereby granted, free of charge, to any person obtaining a copy\n\t * of this software and associated documentation files (the \"Software\"), to deal\n\t * in the Software without restriction, including without limitation the rights\n\t * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n\t * copies of the Software, and to permit persons to whom the Software is\n\t * furnished to do so, subject to the following conditions:\n\t *\n\t * The above copyright notice and this permission notice shall be included in\n\t * all copies or substantial portions of the Software.\n\t *\n\t * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n\t * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n\t * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n\t * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n\t * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n\t * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n\t * THE SOFTWARE.\n\t */\n\t\n\t// polyfill for custom events to make thinks work in IE\n\t// The needed polyfill is so small that I embedded it here\n\t(function poly() {\n\t if (!global.CustomEvent || typeof global.CustomEvent !== 'function') {\n\t var _CustomEvent = function CustomEvent(event, params) {\n\t var thisParams = params || {\n\t bubbles: false,\n\t cancelable: false,\n\t detail: undefined\n\t };\n\t var evt = document.createEvent(\"CustomEvent\");\n\t evt.initCustomEvent(event, thisParams.bubbles, thisParams.cancelable, thisParams.detail);\n\t return evt;\n\t };\n\t _CustomEvent.prototype = global.Event.prototype;\n\t global.CustomEvent = _CustomEvent;\n\t }\n\t})();\n\t/**\n\t * Simpler Event dispatching\n\t */\n\t\n\tvar EventHandler = function () {\n\t\n\t /**\n\t * @param {HTMLElement} target\n\t * @param {String} name\n\t */\n\t\n\t function EventHandler(target, name) {\n\t _classCallCheck(this, EventHandler);\n\t\n\t this.target = target;\n\t this.defaultOptions = {\n\t bubbles: true,\n\t cancelable: true\n\t };\n\t\n\t this.name = name;\n\t }\n\t\n\t /**\n\t * Set more options\n\t * @param {Object} options\n\t * @returns {EventHandler}\n\t */\n\t\n\t\n\t _createClass(EventHandler, [{\n\t key: \"withOptions\",\n\t value: function withOptions(options) {\n\t Object.assign(this.defaultOptions, options || {});\n\t return this;\n\t }\n\t\n\t /**\n\t * Call with the originalEvent\n\t * @param {Event} e\n\t * @returns {EventHandler}\n\t */\n\t\n\t }, {\n\t key: \"withOriginal\",\n\t value: function withOriginal(e) {\n\t return this.withDetail({\n\t originalEvent: e\n\t });\n\t }\n\t\n\t /**\n\t * Extends the detail part of the event\n\t * @param {Object} o\n\t * @returns {EventHandler}\n\t */\n\t\n\t }, {\n\t key: \"withDetail\",\n\t value: function withDetail(o) {\n\t if (!this.defaultOptions.detail) {\n\t this.defaultOptions.detail = {};\n\t }\n\t Object.assign(this.defaultOptions.detail, o);\n\t return this;\n\t }\n\t\n\t /**\n\t * @returns {CustomEvent}\n\t */\n\t\n\t }, {\n\t key: \"fire\",\n\t value: function fire() {\n\t var e = new CustomEvent(this.name, this.defaultOptions);\n\t if (this.target) {\n\t this.target.dispatchEvent(e);\n\t }\n\t return e;\n\t }\n\t }]);\n\t\n\t return EventHandler;\n\t}();\n\t\n\tvar Event = function () {\n\t function Event() {\n\t _classCallCheck(this, Event);\n\t }\n\t\n\t _createClass(Event, null, [{\n\t key: \"dispatch\",\n\t\n\t /**\n\t * Prepares to dispatch a custom event (without firing)\n\t * @param {HTMLElement} target\n\t * @param {String} name\n\t * @returns {EventHandler}\n\t */\n\t value: function dispatch(target, name) {\n\t return new EventHandler(target, name);\n\t }\n\t\n\t /**\n\t * Dispatches a custom event and fires it directly\n\t * @param {HTMLElement} target\n\t * @param {String} name\n\t * @param {Object} [options]\n\t * @returns {CustomEvent}\n\t */\n\t\n\t }, {\n\t key: \"dispatchAndFire\",\n\t value: function dispatchAndFire(target, name, options) {\n\t return new EventHandler(target, name).withOptions(options).fire();\n\t }\n\t }]);\n\t\n\t return Event;\n\t}();\n\t\n\texports.default = Event;\n\t/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))\n\n/***/ },\n/* 4 */\n/***/ function(module, exports) {\n\n\t/* WEBPACK VAR INJECTION */(function(global) {'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol ? \"symbol\" : typeof obj; };\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\t/*\n\t * The MIT License (MIT)\n\t *\n\t * Copyright (c) 2015 David Heidrich, BowlingX \n\t *\n\t * Permission is hereby granted, free of charge, to any person obtaining a copy\n\t * of this software and associated documentation files (the \"Software\"), to deal\n\t * in the Software without restriction, including without limitation the rights\n\t * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n\t * copies of the Software, and to permit persons to whom the Software is\n\t * furnished to do so, subject to the following conditions:\n\t *\n\t * The above copyright notice and this permission notice shall be included in\n\t * all copies or substantial portions of the Software.\n\t *\n\t * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n\t * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n\t * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n\t * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n\t * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n\t * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n\t * THE SOFTWARE.\n\t */\n\t\n\t/*!\n\t * FlexCss.Widget\n\t * Licensed under the MIT License (MIT)\n\t * Copyright (c) 2015 David Heidrich, BowlingX \n\t */\n\t\n\t/**\n\t * A Widget provides async content on a specific target (e.g. a modal link)\n\t */\n\t\n\tvar Widget = function () {\n\t\n\t /**\n\t * Creates a new Widget\n\t * @param [element], optional define the content of widget\n\t */\n\t\n\t function Widget(element) {\n\t var _this = this;\n\t\n\t _classCallCheck(this, Widget);\n\t\n\t /**\n\t *\n\t * @type {Promise}\n\t */\n\t this.asyncContent = null;\n\t\n\t /**\n\t * @type {boolean}\n\t */\n\t this._isWidget = true;\n\t\n\t if (element) {\n\t /**\n\t * @type {HTMLElement}\n\t */\n\t this.element = element instanceof HTMLElement ? element : global.document.getElementById(element);\n\t if (this.element) {\n\t this.element.hfWidgetInstance = this;\n\t this.setAsync(function () {\n\t return new Promise(function (s) {\n\t s(_this.element);\n\t });\n\t });\n\t } else {\n\t throw new Error('Could not found element with ID: ' + element);\n\t }\n\t }\n\t /**\n\t * The final resulted content that a widget did create (e.g. a modal container)\n\t * @type {HTMLElement}\n\t */\n\t this.finalContent = null;\n\t }\n\t\n\t /**\n\t *\n\t * @returns {Promise}\n\t */\n\t\n\t\n\t _createClass(Widget, [{\n\t key: 'getAsync',\n\t value: function getAsync() {\n\t return this.asyncContent();\n\t }\n\t\n\t /**\n\t * @param {Function.} async\n\t * @returns {Widget}\n\t */\n\t\n\t }, {\n\t key: 'setAsync',\n\t value: function setAsync(async) {\n\t this.asyncContent = async;\n\t return this;\n\t }\n\t\n\t /**\n\t * @returns {HTMLElement}\n\t */\n\t\n\t }, {\n\t key: 'getFinalContent',\n\t value: function getFinalContent() {\n\t return this.finalContent;\n\t }\n\t\n\t /**\n\t * @param {HTMLElement} element\n\t * @returns {Widget}\n\t */\n\t\n\t }, {\n\t key: 'setElement',\n\t value: function setElement(element) {\n\t this.element = element;\n\t return this;\n\t }\n\t\n\t /**\n\t * Destroys the generated content of this widget\n\t * @returns {boolean}\n\t */\n\t\n\t }, {\n\t key: 'destroy',\n\t value: function destroy() {\n\t if (this.finalContent && this.finalContent.parentNode) {\n\t this.finalContent.parentNode.removeChild(this.finalContent);\n\t return true;\n\t }\n\t\n\t delete this.element;\n\t delete this.asyncContent;\n\t delete this.finalContent;\n\t\n\t return false;\n\t }\n\t\n\t /**\n\t * Will find a widget on an Element\n\t * @param {HTMLElement} element\n\t * @returns {Widget|undefined}\n\t */\n\t\n\t }], [{\n\t key: 'findWidget',\n\t value: function findWidget(element) {\n\t return element ? element.hfWidgetInstance : undefined;\n\t }\n\t\n\t /**\n\t * Checks if a given object is an instance\n\t * @param {Object} self\n\t * @returns {boolean}\n\t */\n\t\n\t }, {\n\t key: 'isWidget',\n\t value: function isWidget(self) {\n\t return self instanceof Widget || (typeof self === 'undefined' ? 'undefined' : _typeof(self)) === 'object' && self.hasOwnProperty('_isWidget');\n\t }\n\t }]);\n\t\n\t return Widget;\n\t}();\n\t\n\texports.default = Widget;\n\t/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))\n\n/***/ },\n/* 5 */\n/***/ function(module, exports) {\n\n\t\"use strict\";\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\t/*\n\t * The MIT License (MIT)\n\t *\n\t * Copyright (c) 2015 David Heidrich, BowlingX \n\t *\n\t * Permission is hereby granted, free of charge, to any person obtaining a copy\n\t * of this software and associated documentation files (the \"Software\"), to deal\n\t * in the Software without restriction, including without limitation the rights\n\t * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n\t * copies of the Software, and to permit persons to whom the Software is\n\t * furnished to do so, subject to the following conditions:\n\t *\n\t * The above copyright notice and this permission notice shall be included in\n\t * all copies or substantial portions of the Software.\n\t *\n\t * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n\t * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n\t * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n\t * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n\t * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n\t * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n\t * THE SOFTWARE.\n\t */\n\t\n\t/**\n\t * Provides a Basic Widget\n\t */\n\t\n\tvar DestroyableWidget = function () {\n\t function DestroyableWidget() {\n\t _classCallCheck(this, DestroyableWidget);\n\t\n\t this.listeners = [];\n\t }\n\t\n\t /**\n\t * Destroys a Widget\n\t */\n\t\n\t\n\t _createClass(DestroyableWidget, [{\n\t key: \"destroy\",\n\t value: function destroy() {\n\t this.listeners.forEach(function (listener) {\n\t listener.element.removeEventListener.apply(listener.element, listener.args);\n\t });\n\t this.listeners = [];\n\t }\n\t\n\t /**\n\t * Adds an event and registers it later to remove bindings\n\t * @param {HTMLElement} element\n\t * @param {String} name\n\t * @param {Function} listener\n\t * @param {boolean} [capture]\n\t * @returns {Function}\n\t */\n\t\n\t }, {\n\t key: \"addEventListener\",\n\t value: function addEventListener(element, name, listener, capture) {\n\t this.listeners.push({\n\t element: element,\n\t args: [name, listener, capture]\n\t });\n\t\n\t element.addEventListener(name, listener, capture);\n\t return listener;\n\t }\n\t }]);\n\t\n\t return DestroyableWidget;\n\t}();\n\t\n\texports.default = DestroyableWidget;\n\n/***/ },\n/* 6 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t/* WEBPACK VAR INJECTION */(function(global) {'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\t\n\tvar _Util = __webpack_require__(1);\n\t\n\tvar _Util2 = _interopRequireDefault(_Util);\n\t\n\tvar _DestroyableWidget2 = __webpack_require__(5);\n\t\n\tvar _DestroyableWidget3 = _interopRequireDefault(_DestroyableWidget2);\n\t\n\tvar _Settings = __webpack_require__(2);\n\t\n\tvar _Settings2 = _interopRequireDefault(_Settings);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /*\n\t * The MIT License (MIT)\n\t *\n\t * Copyright (c) 2015 David Heidrich, BowlingX \n\t *\n\t * Permission is hereby granted, free of charge, to any person obtaining a copy\n\t * of this software and associated documentation files (the \"Software\"), to deal\n\t * in the Software without restriction, including without limitation the rights\n\t * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n\t * copies of the Software, and to permit persons to whom the Software is\n\t * furnished to do so, subject to the following conditions:\n\t *\n\t * The above copyright notice and this permission notice shall be included in\n\t * all copies or substantial portions of the Software.\n\t *\n\t * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n\t * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n\t * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n\t * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n\t * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n\t * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n\t * THE SOFTWARE.\n\t */\n\t\n\t/*!\n\t * FlexCss.Tooltip\n\t * Licensed under the MIT License (MIT)\n\t * Copyright (c) 2015 David Heidrich, BowlingX \n\t */\n\t\n\t/**\n\t * @type {string}\n\t */\n\tvar CLASS_NAMES_TOOLTIP = 'tooltip-container';\n\t/**\n\t * @type {string}\n\t */\n\tvar CLASS_NAMES_OPEN = 'open';\n\t\n\t/**\n\t * @type {string}\n\t */\n\tvar ATTR_DATA_CLASSNAME = 'data-class';\n\t\n\t/**\n\t * @type {string}\n\t */\n\tvar ATTR_DATA_NO_TOUCH = 'data-no-touch';\n\t\n\t/**\n\t * @type {HTMLDocument}\n\t */\n\tvar doc = global.document;\n\t\n\t/**\n\t * Simple Tooltip\n\t */\n\t\n\tvar Tooltip = function (_DestroyableWidget) {\n\t _inherits(Tooltip, _DestroyableWidget);\n\t\n\t /**\n\t * Creates a Tooltip\n\t * @param {HTMLElement|String} DelegateContainer\n\t * @param {Object} [options]\n\t */\n\t\n\t function Tooltip(DelegateContainer, options) {\n\t _classCallCheck(this, Tooltip);\n\t\n\t /**\n\t * The Container where possible events are captured\n\t */\n\t\n\t var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(Tooltip).call(this));\n\t\n\t _this.container = DelegateContainer instanceof HTMLElement ? DelegateContainer : doc.getElementById(DelegateContainer);\n\t\n\t if (!_this.container) {\n\t throw new Error('Could not create Tooltip, DelegateContainer not found');\n\t }\n\t\n\t /**\n\t * The Container where tooltips are stored for this instance\n\t * @type {HTMLElement}\n\t */\n\t _this.tooltipContainer = null;\n\t\n\t /**\n\t * Default Options\n\t */\n\t _this.options = {\n\t containerClass: '',\n\t selectorAttribute: 'data-tooltip',\n\t collisionContainer: _this.container\n\t };\n\t\n\t Object.assign(_this.options, options || {});\n\t return _this;\n\t }\n\t\n\t /**\n\t * Creates and shows a tooltip\n\t * @param {HTMLElement} target where is this tooltip positioned\n\t * @param {String} text text content in tooltip, will be NOT escaped\n\t * @param {Boolean} [removeTitle] removes title element if given\n\t * @param {Node} [positionRelative]\n\t */\n\t\n\t\n\t _createClass(Tooltip, [{\n\t key: 'createTooltip',\n\t value: function createTooltip(target, text, removeTitle, positionRelative) {\n\t // abort if text is empty\n\t if (!text || text && text.trim() === '') {\n\t return;\n\t }\n\t\n\t if (_Settings2.default.isTouchDevice() && target && target.hasAttribute(ATTR_DATA_NO_TOUCH)) {\n\t return;\n\t }\n\t\n\t var tooltipContainer = this.tooltipContainer;\n\t\n\t if (!tooltipContainer) {\n\t tooltipContainer = doc.createElement('div');\n\t this.container.appendChild(tooltipContainer);\n\t this.tooltipContainer = tooltipContainer;\n\t }\n\t this._restoreClassNames(tooltipContainer, target);\n\t\n\t tooltipContainer.style.left = 'auto';\n\t tooltipContainer.style.top = 'auto';\n\t tooltipContainer.innerHTML = text;\n\t tooltipContainer.flexTooltipCurrentTarget = target;\n\t if (removeTitle) {\n\t target.oldTitle = text;\n\t target.removeAttribute('title');\n\t }\n\t\n\t _Util2.default.setupPositionNearby(positionRelative || target, tooltipContainer, this.options.collisionContainer, true, true);\n\t\n\t tooltipContainer.classList.add(CLASS_NAMES_OPEN);\n\t }\n\t }, {\n\t key: '_restoreClassNames',\n\t value: function _restoreClassNames(container, target) {\n\t // allow additional classname per tooltip on target element\n\t var classNames = [CLASS_NAMES_TOOLTIP, this.options.containerClass];\n\t var maybeTargetClass = target.getAttribute(ATTR_DATA_CLASSNAME);\n\t if (maybeTargetClass) {\n\t classNames.push(maybeTargetClass);\n\t }\n\t container.className = classNames.join(\" \");\n\t return this;\n\t }\n\t\n\t /**\n\t * @returns {HTMLElement|null}\n\t */\n\t\n\t }, {\n\t key: 'getCurrentTarget',\n\t value: function getCurrentTarget() {\n\t return this.tooltipContainer ? this.tooltipContainer.flexTooltipCurrentTarget : null;\n\t }\n\t\n\t /**\n\t * Destroys this Widget\n\t * @returns {boolean}\n\t */\n\t\n\t }, {\n\t key: 'destroy',\n\t value: function destroy() {\n\t _get(Object.getPrototypeOf(Tooltip.prototype), 'destroy', this).call(this);\n\t\n\t if (this.tooltipContainer) {\n\t this.tooltipContainer.parentNode.removeChild(this.tooltipContainer);\n\t return true;\n\t }\n\t return false;\n\t }\n\t\n\t /**\n\t * Removes a Tooltip on given target\n\t * @param {HTMLElement} [target], if not given will remove current open tooltip on this instance\n\t */\n\t\n\t }, {\n\t key: 'removeTooltip',\n\t value: function removeTooltip(target) {\n\t var selfTarget = target;\n\t if (!selfTarget && this.tooltipContainer) {\n\t selfTarget = this.tooltipContainer.flexTooltipCurrentTarget;\n\t }\n\t if (this.tooltipContainer) {\n\t if (this.tooltipContainer.flexTooltipCurrentTarget !== selfTarget) {\n\t return;\n\t }\n\t this.tooltipContainer.classList.remove(CLASS_NAMES_OPEN);\n\t delete this.tooltipContainer.flexTooltipCurrentTarget;\n\t }\n\t if (selfTarget && selfTarget.oldTitle) {\n\t selfTarget.setAttribute('title', selfTarget.oldTitle);\n\t }\n\t }\n\t\n\t /**\n\t * Initilizes mouse events on container element\n\t */\n\t\n\t }, {\n\t key: 'registerEvents',\n\t value: function registerEvents() {\n\t var self = this;\n\t this.addEventListener(this.container, 'mouseover', function (e) {\n\t if (e.target.hasAttribute(self.options.selectorAttribute)) {\n\t self.createTooltip(e.target, e.target.getAttribute('title'), true);\n\t }\n\t });\n\t\n\t this.addEventListener(this.container, 'mouseout', function (e) {\n\t if (e.target.hasAttribute(self.options.selectorAttribute)) {\n\t self.removeTooltip(e.target);\n\t }\n\t });\n\t return this;\n\t }\n\t }]);\n\t\n\t return Tooltip;\n\t}(_DestroyableWidget3.default);\n\t\n\texports.default = Tooltip;\n\t/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))\n\n/***/ },\n/* 7 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t/* WEBPACK VAR INJECTION */(function(global) {'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports.EVENT_AFTER_FIXED_REMOVE = exports.EVENT_BEFORE_FIXED_ADD = undefined;\n\t\n\tvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol ? \"symbol\" : typeof obj; };\n\t\n\tvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _Settings = __webpack_require__(2);\n\t\n\tvar _Settings2 = _interopRequireDefault(_Settings);\n\t\n\tvar _debounce = __webpack_require__(10);\n\t\n\tvar _debounce2 = _interopRequireDefault(_debounce);\n\t\n\tvar _Event = __webpack_require__(3);\n\t\n\tvar _Event2 = _interopRequireDefault(_Event);\n\t\n\tvar _Util = __webpack_require__(1);\n\t\n\tvar _Util2 = _interopRequireDefault(_Util);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tvar CLS_FIXED_WINDOW = 'fixed-window-open';\n\t\n\tvar EVENT_BEFORE_FIXED_ADD = exports.EVENT_BEFORE_FIXED_ADD = 'flexcss.fixedWindow.beforeAdd';\n\tvar EVENT_AFTER_FIXED_REMOVE = exports.EVENT_AFTER_FIXED_REMOVE = 'flexcss.fixedWindow.afterRemove';\n\t\n\t/**\n\t * @type {FixedWindow}\n\t */\n\tvar fixedWindowInstance = void 0;\n\t\n\tvar FixedWindow = function () {\n\t function FixedWindow() {\n\t _classCallCheck(this, FixedWindow);\n\t\n\t this.widgets = [];\n\t this.currentScrollTop = 0;\n\t this.fixedScreenConstraints = [];\n\t this.windowWidth = 0;\n\t this.isFixedWindowActive = false;\n\t this.touchListener = null;\n\t }\n\t\n\t /**\n\t * Adds a constraint to detect if the window needs to be changed when the screensize changes\n\t *\n\t * @param {Function} widget\n\t * @param {Function} fixedBreakpointFn gets a width argument, return true to open a window\n\t */\n\t\n\t\n\t _createClass(FixedWindow, [{\n\t key: 'addScreenConstraint',\n\t value: function addScreenConstraint(widget, fixedBreakpointFn) {\n\t this.fixedScreenConstraints[widget] = fixedBreakpointFn;\n\t }\n\t\n\t /**\n\t * @returns {null|DestroyableWidget}\n\t */\n\t\n\t }, {\n\t key: 'getCurrentWidget',\n\t value: function getCurrentWidget() {\n\t return this.widgets.length > 0 ? this.widgets[this.widgets.length - 1] : null;\n\t }\n\t\n\t /**\n\t * @private\n\t */\n\t\n\t }, {\n\t key: '_checkFixedNeeded',\n\t value: function _checkFixedNeeded() {\n\t var _this = this;\n\t\n\t if (this.widgets.length === 0) {\n\t return;\n\t }\n\t var widgets = new Set(this.widgets);\n\t var widgetsThatRequireFixedWindow = Array.from(widgets).some(function (_ref) {\n\t var widget = _ref.widget;\n\t\n\t return _this.fixedScreenConstraints[widget] && _this.fixedScreenConstraints[widget](_this.windowWidth);\n\t });\n\t if (!widgetsThatRequireFixedWindow) {\n\t this._removeFixedContainer();\n\t } else {\n\t this._addFixedContainer();\n\t }\n\t }\n\t\n\t /**\n\t * @private\n\t */\n\t\n\t }, {\n\t key: '_addFixedContainer',\n\t value: function _addFixedContainer() {\n\t var _this2 = this;\n\t\n\t if (this.isFixedWindowActive) {\n\t return;\n\t }\n\t _Event2.default.dispatchAndFire(global.document, EVENT_BEFORE_FIXED_ADD, {\n\t detail: this.getCurrentWidget()\n\t });\n\t // this causes layout and should be optimized\n\t // At lest we write in a batch later\n\t _Settings2.default.get().scrollbarUpdateNodes.map(function (n) {\n\t var foundProperty = 'paddingRight';\n\t var direction = 1;\n\t var node = n;\n\t if (n instanceof Array) {\n\t var _n = _slicedToArray(n, 3);\n\t\n\t var whatNode = _n[0];\n\t var property = _n[1];\n\t var d = _n[2];\n\t\n\t foundProperty = property;\n\t node = whatNode;\n\t direction = d || 1;\n\t }\n\t return {\n\t node: node,\n\t property: foundProperty,\n\t value: parseInt(global.getComputedStyle(node)[foundProperty], 10) + (!node.__fixedWindowMod__ ? _Settings2.default.getScrollbarWidth() * direction : 0) + 'px'\n\t };\n\t }).forEach(function (d) {\n\t d.node.__fixedWindowMod__ = true;\n\t d.node.style[d.property] = d.value;\n\t });\n\t\n\t this.touchListener = function (e) {\n\t e.preventDefault();\n\t };\n\t\n\t var shouldNotMove = false;\n\t this.touchStartListener = function (e) {\n\t var _getCurrentWidget = _this2.getCurrentWidget();\n\t\n\t var element = _getCurrentWidget.element;\n\t\n\t if (_Util2.default.isPartOfNode(e.target, element)) {\n\t if (element.scrollTop === 0) {\n\t element.scrollTop = 1;\n\t shouldNotMove = true;\n\t } else if (element.scrollHeight === element.scrollTop + element.offsetHeight) {\n\t shouldNotMove = true;\n\t element.scrollTop -= 1;\n\t }\n\t }\n\t };\n\t\n\t global.addEventListener('touchmove', this.touchListener);\n\t global.document.body.addEventListener('touchstart', this.touchStartListener);\n\t\n\t this.touchMoveListener = function (e) {\n\t var _getCurrentWidget2 = _this2.getCurrentWidget();\n\t\n\t var element = _getCurrentWidget2.element;\n\t\n\t if (_Util2.default.isPartOfNode(e.target, element)) {\n\t if (!shouldNotMove) {\n\t e.stopImmediatePropagation();\n\t }\n\t shouldNotMove = false;\n\t }\n\t };\n\t global.document.body.addEventListener('touchmove', this.touchMoveListener);\n\t\n\t global.document.documentElement.classList.add(CLS_FIXED_WINDOW);\n\t this.isFixedWindowActive = true;\n\t }\n\t\n\t /**\n\t * @private\n\t */\n\t\n\t }, {\n\t key: '_removeFixedContainer',\n\t value: function _removeFixedContainer() {\n\t if (this.isFixedWindowActive) {\n\t // cleanup event listeners\n\t global.removeEventListener('touchmove', this.touchListener);\n\t global.document.body.removeEventListener('touchstart', this.touchStartListener);\n\t global.document.body.removeEventListener('touchmove', this.touchMoveListener);\n\t\n\t // reset scrollbar nodes\n\t _Settings2.default.get().scrollbarUpdateNodes.forEach(function (node) {\n\t if (node instanceof Array) {\n\t var _node = _slicedToArray(node, 2);\n\t\n\t var whatNode = _node[0];\n\t var property = _node[1];\n\t\n\t delete whatNode.__fixedWindowMod__;\n\t whatNode.style[property] = '';\n\t } else {\n\t delete node.__fixedWindowMod__;\n\t node.style.paddingRight = '';\n\t }\n\t });\n\t global.document.documentElement.classList.remove(CLS_FIXED_WINDOW);\n\t _Event2.default.dispatchAndFire(global.document, EVENT_AFTER_FIXED_REMOVE);\n\t this.isFixedWindowActive = false;\n\t }\n\t }\n\t\n\t /**\n\t * Will close a window when no widgets are opened that need one\n\t */\n\t\n\t }, {\n\t key: 'resizeListener',\n\t value: function resizeListener() {\n\t this.windowWidth = global.innerWidth;\n\t this._checkFixedNeeded();\n\t }\n\t\n\t /**\n\t * @returns {FixedWindow}\n\t */\n\t\n\t }, {\n\t key: 'close',\n\t\n\t\n\t /**\n\t * Request a close of the fixed window\n\t */\n\t value: function close() {\n\t this.widgets.pop();\n\t if (this.widgets.length === 0) {\n\t this._removeFixedContainer();\n\t }\n\t }\n\t\n\t /**\n\t * Request to open a fixed windows\n\t * @param {Object|DestroyableWidget} instance\n\t * @param {HTMLElement} element\n\t */\n\t\n\t }, {\n\t key: 'open',\n\t value: function open(instance, element) {\n\t var fixed = false;\n\t if ((typeof instance === 'undefined' ? 'undefined' : _typeof(instance)) === 'object') {\n\t var widget = instance.constructor;\n\t var fixedWidget = this.fixedScreenConstraints[instance.constructor];\n\t if (widget && fixedWidget) {\n\t fixed = fixedWidget(this.windowWidth);\n\t }\n\t var length = this.widgets.length;\n\t this.widgets.push({\n\t widget: widget,\n\t element: element\n\t });\n\t // open a new window if there is no window active\n\t if (length === 0) {\n\t if (fixed) {\n\t this._addFixedContainer();\n\t }\n\t }\n\t }\n\t }\n\t }], [{\n\t key: 'getInstance',\n\t value: function getInstance() {\n\t if (!fixedWindowInstance) {\n\t fixedWindowInstance = new FixedWindow();\n\t fixedWindowInstance.windowWidth = global.innerWidth;\n\t var eventHandler = fixedWindowInstance.resizeListener.bind(fixedWindowInstance);\n\t global.addEventListener('resize', (0, _debounce2.default)(eventHandler, 500));\n\t global.addEventListener('orientationchange', eventHandler);\n\t }\n\t return fixedWindowInstance;\n\t }\n\t }]);\n\t\n\t return FixedWindow;\n\t}();\n\n\texports.default = FixedWindow;\n\t/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))\n\n/***/ },\n/* 8 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t/* WEBPACK VAR INJECTION */(function(global) {'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports.EVENT_MODAL_ASYNC_TARGET_LOADED = exports.EVENT_MODAL_INIT = exports.EVENT_MODAL_OPENED = exports.EVENT_MODAL_BEFORE_CLOSED = exports.EVENT_MODAL_CLOSED = undefined;\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /*\n\t * The MIT License (MIT)\n\t *\n\t * Copyright (c) 2015 David Heidrich, BowlingX \n\t *\n\t * Permission is hereby granted, free of charge, to any person obtaining a copy\n\t * of this software and associated documentation files (the \"Software\"), to deal\n\t * in the Software without restriction, including without limitation the rights\n\t * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n\t * copies of the Software, and to permit persons to whom the Software is\n\t * furnished to do so, subject to the following conditions:\n\t *\n\t * The above copyright notice and this permission notice shall be included in\n\t * all copies or substantial portions of the Software.\n\t *\n\t * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n\t * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n\t * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n\t * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n\t * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n\t * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n\t * THE SOFTWARE.\n\t */\n\t\n\t/*!\n\t * FlexCss.Modal\n\t * Licensed under the MIT License (MIT)\n\t * Copyright (c) 2015 David Heidrich, BowlingX \n\t */\n\t\n\t/* global KeyboardEvent */\n\t\n\tvar _Settings = __webpack_require__(2);\n\t\n\tvar _Settings2 = _interopRequireDefault(_Settings);\n\t\n\tvar _Event = __webpack_require__(3);\n\t\n\tvar _Event2 = _interopRequireDefault(_Event);\n\t\n\tvar _Util = __webpack_require__(1);\n\t\n\tvar _Util2 = _interopRequireDefault(_Util);\n\t\n\tvar _Widget = __webpack_require__(4);\n\t\n\tvar _Widget2 = _interopRequireDefault(_Widget);\n\t\n\tvar _FixedWindow = __webpack_require__(7);\n\t\n\tvar _FixedWindow2 = _interopRequireDefault(_FixedWindow);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tvar HTML_ELEMENT = global.document.documentElement;\n\tvar KEY_ESC = 27;\n\t/* Attribute Names */\n\tvar ATTR_CREATE_NEW = 'data-new-instance';\n\tvar ATTR_CLOSE = 'data-close-modal';\n\tvar ATTR_NAME = 'data-modal';\n\t\n\t/* Class names */\n\tvar CLS_CONTAINER_CURRENT = 'front';\n\tvar CLS_OPEN = 'open';\n\tvar CLS_CURRENT = 'current';\n\tvar CLS_PART_OF_STACK = 'part-of-stack';\n\tvar CLS_MODAL_OPEN = 'modal-open';\n\tvar CLS_MODAL_CONTAINER = 'modal-container';\n\tvar CLS_ANIM_END = 'modal-anim-end';\n\tvar CLS_LOADER_CONTAINER = 'loader-container';\n\tvar CLS_LOADER = 'loader';\n\t\n\t/* Events */\n\t\n\t/**\n\t * Event triggered when modal is closed\n\t * @type {string}\n\t */\n\tvar EVENT_MODAL_CLOSED = exports.EVENT_MODAL_CLOSED = 'flexcss.modal.closed';\n\t/**\n\t * Event triggered before a modal is closed, cancelable\n\t * @type {string}\n\t */\n\tvar EVENT_MODAL_BEFORE_CLOSED = exports.EVENT_MODAL_BEFORE_CLOSED = 'flexcss.modal.beforeClose';\n\t/**\n\t * Event triggered when a modal is opened\n\t * @type {string}\n\t */\n\tvar EVENT_MODAL_OPENED = exports.EVENT_MODAL_OPENED = 'flexcss.modal.opened';\n\t\n\t/**\n\t * Event triggered when modal is initilized, called on target\n\t * @type {string}\n\t */\n\tvar EVENT_MODAL_INIT = exports.EVENT_MODAL_INIT = 'flexcss.modal.init';\n\t\n\t/**\n\t * Triggered when the content of an async modal on a target is loaded, called on target\n\t * @type {string}\n\t */\n\tvar EVENT_MODAL_ASYNC_TARGET_LOADED = exports.EVENT_MODAL_ASYNC_TARGET_LOADED = 'flexcss.modal.asyncTargetLoaded';\n\t\n\t/**\n\t * A Modal Implementation\n\t */\n\t\n\tvar Modal = function () {\n\t function Modal(DelegateContainer, options) {\n\t _classCallCheck(this, Modal);\n\t\n\t var doc = global.document;\n\t var container = DelegateContainer instanceof HTMLElement ? DelegateContainer : doc.getElementById(DelegateContainer);\n\t\n\t // Instance vars:\n\t if (!container) {\n\t throw new Error('Could not found container element by given ID/Element: ' + DelegateContainer);\n\t }\n\t\n\t this.currentOpen = null;\n\t\n\t this.loading = false;\n\t\n\t this.container = container;\n\t\n\t /**\n\t * Default Options\n\t */\n\t this.options = {\n\t classNames: 'modal',\n\t closeOnEscape: true,\n\t closeOnBackgroundClick: true,\n\t destroyOnFinish: false,\n\t fixedContainer: true,\n\t containerClassNames: ''\n\t };\n\t\n\t Object.assign(this.options, options);\n\t\n\t // Container where events are delegated\n\t this.eventContainer = null;\n\t this.eventFunction = null;\n\t\n\t this.dataMainPageContainer = global.document.body;\n\t\n\t this.currentScrollTop = 0;\n\t\n\t this.modalContainer = null;\n\t\n\t // Destroy full modal instance when no dialogs are bind to?\n\t // Otherwise container is recycled\n\t this.destroyOnFinish = this.options.destroyOnFinish;\n\t }\n\t\n\t /**\n\t * Removes this modal from global stack\n\t * Will handle fixing main html element too\n\t * @private\n\t * @param n\n\t */\n\t\n\t\n\t _createClass(Modal, [{\n\t key: '_removeModalFromStack',\n\t value: function _removeModalFromStack(n) {\n\t var t = Modal._modalInstances.indexOf(n);\n\t if (t > -1) {\n\t Modal._modalInstances.splice(t, 1);\n\t _FixedWindow2.default.getInstance().close();\n\t HTML_ELEMENT.classList.remove(CLS_MODAL_OPEN);\n\t }\n\t }\n\t\n\t /**\n\t * Modal container that contains all `stacked` modals for this instance\n\t * @returns {HTMLElement}\n\t */\n\t\n\t }, {\n\t key: 'getModalContainer',\n\t value: function getModalContainer() {\n\t return this.modalContainer;\n\t }\n\t\n\t /**\n\t * Closes the current open modal of this stack\n\t * @params [e], optional event\n\t * @returns {*}\n\t */\n\t\n\t }, {\n\t key: 'close',\n\t value: function close(e) {\n\t var self = this;\n\t\n\t var options = self.currentOpen ? _Util2.default.applyOptionsFromElement(self.currentOpen, _Util2.default.copy(self.options)) : self.options;\n\t\n\t // close only on keyboard if instance should\n\t if (!options.closeOnEscape && e instanceof KeyboardEvent) {\n\t return false;\n\t }\n\t\n\t // close only on background if instance should\n\t if (!options.closeOnBackgroundClick && e && e.type === _Settings2.default.getTabEvent() && !e.target.hasAttribute(ATTR_CLOSE)) {\n\t return false;\n\t }\n\t\n\t // if an instance is currently loading, prevent from closing\n\t if (self.loading) {\n\t return false;\n\t }\n\t\n\t if (e) {\n\t e.preventDefault();\n\t }\n\t\n\t if (self.currentOpen) {\n\t // dispatch beforeClose event, if prevented prevent modal from closing\n\t var ev = _Event2.default.dispatchAndFire(self.currentOpen, EVENT_MODAL_BEFORE_CLOSED);\n\t if (ev.defaultPrevented) {\n\t return false;\n\t }\n\t\n\t this._finishState(self.currentOpen);\n\t // if there is an previous modal\n\t if (self.currentOpen.prevModal) {\n\t // switch to the next modal\n\t return self.switchModals(self.currentOpen.prevModal, self.currentOpen.prevModal.prevModal || null);\n\t }\n\t\n\t // finally trigger closed event\n\t _Event2.default.dispatch(self.currentOpen, EVENT_MODAL_CLOSED).withOriginal(e).fire();\n\t }\n\t self._removeModalFromStack(self.currentOpen);\n\t\n\t // Full stack closed:\n\t self.currentOpen = null;\n\t if (self.modalContainer) {\n\t // setup next open\n\t var lastContainer = Modal._modalInstances[Modal._modalInstances.length - 1],\n\t classList = self.modalContainer.classList;\n\t classList.remove(CLS_CONTAINER_CURRENT);\n\t classList.remove(CLS_OPEN);\n\t // Remove all current classes from child-nodes\n\t for (var i = 0; i < self.modalContainer.childNodes.length; i++) {\n\t var node = self.modalContainer.childNodes[i],\n\t cl = node.classList;\n\t // remove applied styles\n\t self._finishState(node);\n\t cl.remove(CLS_CURRENT);\n\t cl.remove(CLS_PART_OF_STACK);\n\t }\n\t if (lastContainer) {\n\t lastContainer.parentNode.classList.add(CLS_CONTAINER_CURRENT);\n\t }\n\t }\n\t\n\t if (self.destroyOnFinish) {\n\t self.destroy();\n\t }\n\t return self;\n\t }\n\t\n\t /**\n\t * Resets a target when newly initilizes\n\t * @param target\n\t * @private\n\t */\n\t\n\t }, {\n\t key: '_finishState',\n\t value: function _finishState(target) {\n\t target.classList.remove(CLS_ANIM_END);\n\t }\n\t\n\t /**\n\t * Handler called when a Modal has finished an animation\n\t * @param e\n\t * @param self\n\t * @private\n\t */\n\t\n\t }, {\n\t key: '_finishAnim',\n\t value: function _finishAnim(e, self) {\n\t e.target.classList.add(CLS_ANIM_END);\n\t e.target.removeEventListener(e.type, self, true);\n\t }\n\t\n\t /**\n\t * Brings the given modal to front\n\t * @param co\n\t * @param last\n\t */\n\t\n\t }, {\n\t key: 'switchModals',\n\t value: function switchModals(co, last) {\n\t co.prevModal = last;\n\t Modal._modalInstances.push(co);\n\t _FixedWindow2.default.getInstance().open(this, this.modalContainer);\n\t if (last) {\n\t this._finishState(last);\n\t _Util2.default.prefixedAnimateEvent(last, 'AnimationEnd', this._finishAnim);\n\t last.classList.add(CLS_PART_OF_STACK);\n\t }\n\t // set new currentOpen\n\t this.currentOpen = co;\n\t\n\t // bring current container to the front\n\t var instances = Modal._modalInstances;\n\t\n\t for (var m = 0; m < instances.length; m++) {\n\t instances[m].parentNode.classList.remove(CLS_CONTAINER_CURRENT);\n\t }\n\t this.modalContainer.classList.add(CLS_CONTAINER_CURRENT);\n\t // remove animations if animations has been completed, fixes various bugs:\n\t // - fixes nested scrolling element issue in iOS Browsers / Mobile-Safari\n\t _Util2.default.prefixedAnimateEvent(co, 'AnimationEnd', this._finishAnim);\n\t\n\t for (var i = 0; i < this.modalContainer.childNodes.length; i++) {\n\t var n = this.modalContainer.childNodes[i],\n\t isCurrent = n.classList.contains(CLS_CURRENT);\n\t if (n === co) {\n\t co.classList.add(CLS_CURRENT);\n\t co.classList.remove(CLS_PART_OF_STACK);\n\t this._finishState(co);\n\t } else {\n\t n.classList.remove(CLS_CURRENT);\n\t if (isCurrent) {\n\t this._removeModalFromStack(n);\n\t _Event2.default.dispatchAndFire(n, EVENT_MODAL_CLOSED);\n\t }\n\t }\n\t }\n\t }\n\t }, {\n\t key: 'handleScrollbar',\n\t value: function handleScrollbar() {\n\t if (Modal._modalInstances.length === 0) {\n\t HTML_ELEMENT.classList.add(CLS_MODAL_OPEN);\n\t }\n\t }\n\t\n\t /**\n\t * Creates a Modal and opens it (later)\n\t * @param e\n\t * @returns {Promise|boolean}\n\t */\n\t\n\t }, {\n\t key: 'createWidget',\n\t value: function createWidget(e) {\n\t var self = this;\n\t if (this.loading) {\n\t return false;\n\t }\n\t\n\t // check if another modal has registered events on this dom path:\n\t if (e && e.target) {\n\t var foundInstance = _Util2.default.parentsUntil(e.target, function (node) {\n\t return node && node.flexModalInstance;\n\t });\n\t\n\t // if another instance has been found, abort\n\t if (foundInstance !== this.container) {\n\t return false;\n\t }\n\t }\n\t var targetContent,\n\t future,\n\t widget,\n\t target,\n\t hasTarget = true,\n\t isHtmlElement = e instanceof HTMLElement,\n\t isWidget = _Widget2.default.isWidget(e);\n\t if (isHtmlElement || isWidget) {\n\t if (isHtmlElement) {\n\t targetContent = e;\n\t } else {\n\t widget = e;\n\t targetContent = widget.element;\n\t }\n\t } else {\n\t target = e.target;\n\t if (!target) {\n\t throw 'Could not find target, did you pass an event, a HTMLElement or an Widget?';\n\t }\n\t hasTarget = target.hasAttribute(ATTR_NAME);\n\t targetContent = target.getAttribute(ATTR_NAME);\n\t widget = _Widget2.default.findWidget(target);\n\t if (target.hasAttribute(ATTR_CREATE_NEW) && !e.newInstance) {\n\t var newInstance = new Modal(this.container).setDestroyOnFinish(true);\n\t e.newInstance = true;\n\t newInstance.fromEvent(e).then(function () {\n\t newInstance.registerEvents(newInstance.getModalContainer());\n\t });\n\t return false;\n\t }\n\t if (hasTarget) {\n\t e.stopImmediatePropagation();\n\t e.preventDefault();\n\t }\n\t }\n\t\n\t if (!hasTarget) {\n\t return false;\n\t }\n\t\n\t var modalContainerClasses = this.modalContainer ? this.modalContainer.classList : [];\n\t\n\t // lazy create modal container\n\t if (!this.modalContainer) {\n\t this.modalContainer = global.document.createElement('div');\n\t this.modalContainer.className = CLS_MODAL_CONTAINER + ' ' + this.options.containerClassNames + ' ' + CLS_OPEN;\n\t var closeModalFunction = function closeModalFunction(ce) {\n\t if (self.loading) {\n\t return false;\n\t }\n\t if (_Util2.default.isPartOfNode(ce.target, self.currentOpen)) {\n\t if (!ce.target.hasAttribute(ATTR_CLOSE)) {\n\t return false;\n\t }\n\t }\n\t self.close(ce);\n\t };\n\t\n\t this.modalContainer.addEventListener(_Settings2.default.getTabEvent(), closeModalFunction, false);\n\t\n\t modalContainerClasses = this.modalContainer.classList;\n\t this.container.appendChild(this.modalContainer);\n\t } else {\n\t modalContainerClasses.add(CLS_OPEN);\n\t }\n\t\n\t var loader = void 0,\n\t doc = global.document,\n\t toggleLoader = function toggleLoader(show) {\n\t if (show) {\n\t loader = doc.createElement('div');\n\t loader.className = CLS_LOADER_CONTAINER;\n\t var loaderLoader = doc.createElement('div');\n\t loaderLoader.className = CLS_LOADER;\n\t loader.appendChild(loaderLoader);\n\t self.modalContainer.appendChild(loader);\n\t } else {\n\t loader.parentNode.removeChild(loader);\n\t }\n\t };\n\t\n\t this.handleScrollbar();\n\t\n\t modalContainerClasses.add(CLS_CONTAINER_CURRENT);\n\t modalContainerClasses.add('loading');\n\t this.loading = true;\n\t toggleLoader(true);\n\t var async = widget ? widget.getAsync() : null;\n\t if (_Widget2.default.isWidget(widget) && async) {\n\t future = async.then(function (r) {\n\t var result;\n\t if (r instanceof HTMLElement || r instanceof DocumentFragment) {\n\t result = r;\n\t } else {\n\t // Create container Element:\n\t var element = doc.createElement('div');\n\t element.className = self.options.classNames;\n\t element.innerHTML = r;\n\t element.id = _Util2.default.guid();\n\t result = element;\n\t }\n\t widget.finalContent = result;\n\t _Event2.default.dispatchAndFire(target, EVENT_MODAL_ASYNC_TARGET_LOADED);\n\t return result;\n\t });\n\t } else {\n\t var el = targetContent instanceof HTMLElement || targetContent instanceof DocumentFragment ? targetContent : doc.getElementById(targetContent);\n\t if (el) {\n\t future = new Promise(function (resolve) {\n\t resolve(el);\n\t });\n\t } else {\n\t throw 'Could not found given modal element (content) with ID: ' + targetContent;\n\t }\n\t }\n\t\n\t _Event2.default.dispatchAndFire(target, EVENT_MODAL_INIT);\n\t\n\t return future.then(function (thisEl) {\n\t thisEl.hfWidgetInstance = self;\n\t self.modalContainer.appendChild(thisEl);\n\t modalContainerClasses.remove('loading');\n\t self.loading = false;\n\t toggleLoader(false);\n\t\n\t self.open(thisEl, true, e);\n\t\n\t return thisEl;\n\t });\n\t }\n\t\n\t /**\n\t * Open's an already rendered modal\n\t * @param {HTMLElement} modal\n\t * @param {Boolean} [internal], set to true to prevent container management\n\t * @param {Boolean} [maybeEvent], optional event-object that triggered open\n\t */\n\t\n\t }, {\n\t key: 'open',\n\t value: function open(modal, internal, maybeEvent) {\n\t\n\t if (!internal) {\n\t this.modalContainer.classList.add('open');\n\t this.handleScrollbar();\n\t }\n\t this.switchModals(modal, this.currentOpen);\n\t\n\t _Event2.default.dispatch(modal, EVENT_MODAL_OPENED).withOriginal(maybeEvent).fire();\n\t }\n\t }, {\n\t key: 'registerEvents',\n\t value: function registerEvents(delegate) {\n\t var delegateContainer = delegate || this.container,\n\t self = this;\n\t // Modals should always be fixed\n\t _FixedWindow2.default.getInstance().addScreenConstraint(Modal, function (width) {\n\t return true;\n\t });\n\t // register modal instance so we can detect multiple registrars\n\t delegateContainer.flexModalInstance = self;\n\t self.eventFunction = function () {\n\t self.createWidget.apply(self, arguments);\n\t };\n\t delegateContainer.addEventListener(_Settings2.default.getTabEvent(), self.eventFunction, false);\n\t\n\t self.eventContainer = delegateContainer;\n\t return self;\n\t }\n\t\n\t /**\n\t * Creates a new Dialog Instance either directly from HTML Element or a Widget instance\n\t * @param {HTMLElement|Widget} widget instance or html element\n\t * @returns {Promise}\n\t */\n\t\n\t }, {\n\t key: 'fromWidget',\n\t value: function fromWidget(widget) {\n\t return this.createWidget(widget);\n\t }\n\t\n\t /**\n\t * Creates a Widget from event\n\t * @param e\n\t * @returns {Promise}\n\t */\n\t\n\t }, {\n\t key: 'fromEvent',\n\t value: function fromEvent(e) {\n\t return this.createWidget(e);\n\t }\n\t }, {\n\t key: 'setDestroyOnFinish',\n\t value: function setDestroyOnFinish(v) {\n\t this.destroyOnFinish = v;\n\t return this;\n\t }\n\t\n\t /**\n\t * Destroy this widget instance, cleans empty DOM nodes\n\t * Will use fast MutationObserver if available, otherwise falls back to DOMNodeRemoved event\n\t */\n\t\n\t }, {\n\t key: 'destroy',\n\t value: function destroy() {\n\t var self = this,\n\t modalContainer = this.modalContainer;\n\t var isEmptyContainer = modalContainer.childNodes.length === 0;\n\t // Remove event listener on destroy, do not remove DOM node\n\t if (self.eventContainer) {\n\t self.eventContainer.removeEventListener(_Settings2.default.getTabEvent(), self.eventFunction, true);\n\t }\n\t\n\t if (isEmptyContainer) {\n\t if (modalContainer.parentNode) {\n\t modalContainer.parentNode.removeChild(modalContainer);\n\t }\n\t }\n\t if (global.MutationObserver) {\n\t var observer = new MutationObserver(function (mutations) {\n\t mutations.forEach(function () {\n\t if (isEmptyContainer) {\n\t modalContainer.parentNode.removeChild(modalContainer);\n\t observer.disconnect();\n\t }\n\t });\n\t });\n\t observer.observe(modalContainer, { childList: true });\n\t } else {\n\t modalContainer.addEventListener('DOMNodeRemoved', function (e) {\n\t if (e.target !== modalContainer && modalContainer.childNodes.length - 1 === 0) {\n\t modalContainer.parentNode.removeChild(modalContainer);\n\t }\n\t });\n\t }\n\t }\n\t }]);\n\t\n\t return Modal;\n\t}();\n\t\n\t// Static variable that keeps track of all open modals\n\t\n\t\n\tModal._modalInstances = [];\n\t\n\t// Global keydown listener for modal\n\tglobal.addEventListener('keydown', function (e) {\n\t if (e.keyCode === KEY_ESC) {\n\t var lastModal = Modal._modalInstances[Modal._modalInstances.length - 1];\n\t if (lastModal) {\n\t _Widget2.default.findWidget(lastModal).close(e);\n\t }\n\t }\n\t});\n\t\n\texports.default = Modal;\n\t/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))\n\n/***/ },\n/* 9 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t/* WEBPACK VAR INJECTION */(function(global) {'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports.EVENT_FORM_AJAX_COMPLETED = exports.EVENT_FORM_AFTER_AJAX_SUBMIT = exports.EVENT_FORM_SUBMIT = exports.EVENT_FORM_READY = undefined;\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\t\n\tvar _Tooltip = __webpack_require__(6);\n\t\n\tvar _Tooltip2 = _interopRequireDefault(_Tooltip);\n\t\n\t__webpack_require__(11);\n\t\n\tvar _Event = __webpack_require__(3);\n\t\n\tvar _Event2 = _interopRequireDefault(_Event);\n\t\n\tvar _Util = __webpack_require__(1);\n\t\n\tvar _Util2 = _interopRequireDefault(_Util);\n\t\n\tvar _Settings = __webpack_require__(2);\n\t\n\tvar _Settings2 = _interopRequireDefault(_Settings);\n\t\n\tvar _DestroyableWidget2 = __webpack_require__(5);\n\t\n\tvar _DestroyableWidget3 = _interopRequireDefault(_DestroyableWidget2);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /*global HTMLFormElement, fetch, FormData, clearTimeout, NodeList*/\n\t\n\t/*\n\t * The MIT License (MIT)\n\t *\n\t * Copyright (c) 2015 David Heidrich, BowlingX \n\t *\n\t * Permission is hereby granted, free of charge, to any person obtaining a copy\n\t * of this software and associated documentation files (the \"Software\"), to deal\n\t * in the Software without restriction, including without limitation the rights\n\t * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n\t * copies of the Software, and to permit persons to whom the Software is\n\t * furnished to do so, subject to the following conditions:\n\t *\n\t * The above copyright notice and this permission notice shall be included in\n\t * all copies or substantial portions of the Software.\n\t *\n\t * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n\t * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n\t * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n\t * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n\t * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n\t * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n\t * THE SOFTWARE.\n\t */\n\t\n\t/*!\n\t * FlexCss.Form\n\t * Licensed under the MIT License (MIT)\n\t * Copyright (c) 2015 David Heidrich, BowlingX \n\t */\n\t\n\tvar LOADING_CLASS = 'loading';\n\tvar DATA_ELEMENT_INVALID = 'data-flexcss-invalid';\n\tvar REMOTE = 'data-remote';\n\tvar REMOTE_ACTION = 'data-remote-action';\n\tvar ATTR_DISABLE_INLINE = 'data-disable-inline-validation';\n\tvar ATTR_DISABLE_REALTIME = 'data-disable-realtime-validation';\n\tvar ATTR_VALIDATOR = 'data-validate';\n\tvar ATTR_DATA_CUSTOM_MESSAGE = 'data-validation-message';\n\tvar ATTR_DATA_CUSTOM_LABEL = 'data-custom-label';\n\tvar ATTR_VALIDATE_VISIBILITY = 'data-validate-visibility';\n\tvar ATTR_ERROR_TARGET_ID = 'data-error-target';\n\tvar ATTR_DEPENDS = 'data-depends-selector';\n\tvar CONST_USE_JSON = 'json';\n\tvar CONST_REALTIME_EVENT = 'input';\n\tvar FOCUS_TOOLTIP_DELAY = 20;\n\tvar CLICK_TOOLTIP_DELAY = 150;\n\t\n\t/**\n\t * Triggered when form is fully initialized and handlers are binded\n\t * @type {string}\n\t */\n\tvar EVENT_FORM_READY = exports.EVENT_FORM_READY = 'flexcss.form.ready';\n\t/**\n\t * Fires when a form is submitted, cancelable\n\t * @type {string}\n\t */\n\tvar EVENT_FORM_SUBMIT = exports.EVENT_FORM_SUBMIT = 'flexcss.form.submit';\n\t/**\n\t * Fired directly after the form has been submitted via ajax\n\t * @type {string}\n\t */\n\tvar EVENT_FORM_AFTER_AJAX_SUBMIT = exports.EVENT_FORM_AFTER_AJAX_SUBMIT = 'flexcss.form.afterAjaxSubmit';\n\t/**\n\t * Fired when ajax events did complete\n\t * @type {string}\n\t */\n\tvar EVENT_FORM_AJAX_COMPLETED = exports.EVENT_FORM_AJAX_COMPLETED = 'flexcss.form.ajaxCompleted';\n\t\n\t/**\n\t * A HTML5 Form Validation replacement\n\t */\n\t\n\tvar Form = function (_DestroyableWidget) {\n\t _inherits(Form, _DestroyableWidget);\n\t\n\t /**\n\t * @param {HTMLElement} form\n\t * @param [options] optional options\n\t */\n\t\n\t function Form(form, options) {\n\t _classCallCheck(this, Form);\n\t\n\t var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(Form).call(this));\n\t\n\t if (!(form instanceof HTMLFormElement)) {\n\t throw 'argument {0} form needs to be an form element';\n\t }\n\t\n\t /**\n\t * The Form\n\t * @type {HTMLElement}\n\t */\n\t _this.form = form;\n\t\n\t /**\n\t * @type {Tooltip}\n\t */\n\t _this.tooltips = null;\n\t\n\t /**\n\t * @type {Promise}\n\t */\n\t _this.currentValidationFuture = new Promise(function () {});\n\t\n\t /**\n\t * Default options\n\t * @type {Object}\n\t */\n\t _this.options = {\n\t // if true creates tooltips above element, uses FlexCss Tooltips\n\t createTooltips: true,\n\t // if true appends error message after input element\n\t appendError: false,\n\t // type of ajax submit\n\t ajaxSubmitType: 'POST',\n\t // json content type if ajax method is set to json\n\t ajaxJsonContentType: 'application/json; charset=utf-8',\n\t // allow inline validation\n\t inlineValidation: true,\n\t // validate in realtime (on `input` event)\n\t realtime: true,\n\t // timeout when realtime event should be captured\n\t realtimeTimeout: 250,\n\t // formatting method for an error\n\t formatErrorTooltip: function formatErrorTooltip(error) {\n\t return ' ' + error;\n\t },\n\t // the class that will be put on the element to mark it failed validation\n\t inputErrorClass: 'invalid',\n\t // the container class for error messages below an element\n\t containerErrorClass: 'form-error',\n\t // additional options for fetch\n\t fetchOptions: {\n\t credentials: 'include'\n\t },\n\t // the container for tooltips\n\t tooltipContainer: form,\n\t tooltipOptions: {\n\t containerClass: 'error-tooltip'\n\t },\n\t // if you have a fixed header, either set a number or function here\n\t scrollToElementDiff: 0\n\t };\n\t\n\t // overwrite default options\n\t Object.assign(_this.options, options);\n\t\n\t // apply settings from attributes\n\t _Util2.default.applyOptionsFromElement(form, _this.options);\n\t\n\t // set form class as widget\n\t // Forms are very different to classical widgets,\n\t // we will not use our base widget class for this but just self\n\t form.hfWidgetInstance = _this;\n\t\n\t /**\n\t * A List of Validators\n\t * @type {Object}\n\t * @private\n\t */\n\t _this._validators = Form.globalValidators;\n\t\n\t /**\n\t * @type {Function}\n\t * @private\n\t */\n\t _this._remoteValidationFunction = null;\n\t\n\t _this.initFormValidation();\n\t return _this;\n\t }\n\t\n\t _createClass(Form, [{\n\t key: 'destroy',\n\t value: function destroy() {\n\t _get(Object.getPrototypeOf(Form.prototype), 'destroy', this).call(this);\n\t if (this.tooltips) {\n\t this.tooltips.destroy();\n\t }\n\t }\n\t\n\t /**\n\t * Submits this form, either via ajax or just classical (default)\n\t * @param {HTMLFormElement} thisForm\n\t * @param {Event} e\n\t * @private\n\t * @returns {Promise|boolean} returns false if submit is cancled\n\t */\n\t\n\t }, {\n\t key: '_submitFunction',\n\t value: function _submitFunction(thisForm, e) {\n\t var shouldUseAjax = thisForm.getAttribute(REMOTE),\n\t ajaxPostUrl = thisForm.getAttribute(REMOTE_ACTION) || thisForm.getAttribute('action') || window.location.href,\n\t useJson = CONST_USE_JSON === shouldUseAjax,\n\t self = this;\n\t\n\t var ev = _Event2.default.dispatch(thisForm, EVENT_FORM_SUBMIT).withOriginal(e).fire();\n\t\n\t // abort execution is event was prevented\n\t if (ev.defaultPrevented) {\n\t self._formStopLoading();\n\t return false;\n\t }\n\t\n\t if (shouldUseAjax === null) {\n\t // submit\n\t return thisForm.submit();\n\t }\n\t // prevent form from submit normally\n\t e.preventDefault();\n\t\n\t // add information that this is an XMLHttpRequest request (used by some frameworks)\n\t var defaultHeaders = {\n\t 'X-Requested-With': 'XMLHttpRequest'\n\t };\n\t\n\t // setup default headers\n\t if (useJson) {\n\t Object.assign(defaultHeaders, {\n\t 'Content-Type': this.options.ajaxJsonContentType\n\t });\n\t }\n\t var defaultOptions = Object.assign(this.options.fetchOptions, {\n\t headers: defaultHeaders,\n\t method: this.options.ajaxSubmitType\n\t });\n\t\n\t // support either JSON request payload or normal payload submission\n\t var serverCall = useJson ? fetch(ajaxPostUrl, Object.assign(defaultOptions, {\n\t body: JSON.stringify(this.serialize())\n\t })) : fetch(ajaxPostUrl, Object.assign(defaultOptions, {\n\t body: new FormData(thisForm)\n\t }));\n\t\n\t _Event2.default.dispatch(thisForm, EVENT_FORM_AFTER_AJAX_SUBMIT).withOriginal(e).fire();\n\t\n\t return serverCall.then(function (r) {\n\t (self._remoteValidationFunction || Form.globalRemoteValidationFunction).apply(self, [r]);\n\t\n\t _Event2.default.dispatch(thisForm, EVENT_FORM_AJAX_COMPLETED).withOriginal(e).withDetail({ response: r }).fire();\n\t // always remove error class\n\t self._formStopLoading();\n\t });\n\t }\n\t\n\t /**\n\t * Serializes a form to a json object\n\t * @returns {Object}\n\t */\n\t\n\t }, {\n\t key: 'serialize',\n\t value: function serialize() {\n\t var selectors = ['input[name]:not([type=\"radio\"]):enabled', 'input[type=\"radio\"][name]:checked', 'select[name]:enabled', 'textarea[name]:enabled'],\n\t inputs = this.form.querySelectorAll(selectors.join(',')),\n\t result = {};\n\t\n\t Array.prototype.forEach.call(inputs, function (input) {\n\t var exists = result[input.name],\n\t value = input.value;\n\t if (exists instanceof Array) {\n\t exists.push(value);\n\t } else if (exists) {\n\t result[input.name] = [result[input.name], value];\n\t } else {\n\t result[input.name] = value;\n\t }\n\t });\n\t\n\t return result;\n\t }\n\t\n\t /**\n\t * Handles the chain of validation on given fields\n\t *\n\t * @param {HTMLElement|Array|NodeList} field\n\t * @param [focus] optional focus first error\n\t * @returns {Promise}\n\t */\n\t\n\t }, {\n\t key: 'handleValidation',\n\t value: function handleValidation(field, focus) {\n\t var _this2 = this;\n\t\n\t var fields = field instanceof Array || field instanceof NodeList ? field : [field];\n\t return this._handleValidation(fields, focus, true).then(function (r) {\n\t if (!r.foundAnyError) {\n\t // remove tooltips\n\t if (_this2.tooltips) {\n\t _this2.tooltips.removeTooltip();\n\t }\n\t }\n\t return r;\n\t }.bind(this));\n\t }\n\t\n\t /**\n\t * Handles errors on given node list\n\t * @param {NodeList} toValidateFields\n\t * @param {boolean} focus\n\t * @param {boolean} scoped if true, will only validate the fields `invalidFields`\n\t * @returns {Promise}\n\t * @private\n\t */\n\t\n\t }, {\n\t key: '_handleValidation',\n\t value: function _handleValidation(toValidateFields, focus, scoped) {\n\t var self = this;\n\t var arr = Form._createArrayFromInvalidFieldList(toValidateFields),\n\t isLocalInvalid = arr.length > 0;\n\t // focus must appear in the same frame for iOS devices\n\t if (isLocalInvalid && focus) {\n\t self._focusElement(arr[0]);\n\t }\n\t var validation = scoped ? this._customValidationsForElements(toValidateFields) : self.validateCustomFields();\n\t return validation.then(function (r) {\n\t if (isLocalInvalid) {\n\t // combine browser and custom validators\n\t r.foundAnyError = true;\n\t }\n\t // get a unique field list of all fields that need to be checked and rendered\n\t // it's possible that we have duplicates in non scoped mode\n\t var thisToValidateFields = scoped ? toValidateFields : Array.from(arr).concat(r.checkedFields);\n\t r.checkedFields = thisToValidateFields;\n\t var foundInvalidFields = self.prepareErrors(thisToValidateFields, false),\n\t firstInvalidField = foundInvalidFields[0];\n\t if (firstInvalidField) {\n\t if (focus) {\n\t self._focusElement(firstInvalidField);\n\t // if element could not be focused:\n\t if (document.activeElement !== firstInvalidField) {\n\t self._handleTooltipHideClickAfterChange();\n\t }\n\t } else {\n\t self._handleTooltipHideClickAfterChange();\n\t }\n\t self.showAndOrCreateTooltip(firstInvalidField);\n\t }\n\t return r;\n\t });\n\t }\n\t\n\t /**\n\t * @param {HTMLElement} field\n\t * @param {ValidityState} validity\n\t * @returns {*}\n\t * @private\n\t */\n\t\n\t }, {\n\t key: '_setupErrorMessages',\n\t value: function _setupErrorMessages(field, validity) {\n\t return Form.globalErrorMessageHandler ? Form.globalErrorMessageHandler.apply(this, [field, validity]) : false;\n\t }\n\t\n\t /**\n\t * Handles class labels for elements\n\t * @param {Object} fields\n\t * @private\n\t */\n\t\n\t }, {\n\t key: '_handleLabels',\n\t value: function _handleLabels(fields) {\n\t Object.keys(fields).forEach(function (id) {\n\t var labels = this.getForm().querySelectorAll('[for=\"' + id + '\"]'),\n\t invalid = fields[id];\n\t if (labels.length) {\n\t for (var labelsIndex = 0; labelsIndex < labels.length; labelsIndex++) {\n\t var labelEl = labels[labelsIndex];\n\t // we can't use toggle attribute, not supported in IE\n\t if (invalid) {\n\t this._markElementInvalid(labelEl);\n\t } else {\n\t this._markElementValid(labelEl);\n\t }\n\t }\n\t }\n\t }.bind(this));\n\t }\n\t\n\t /**\n\t * @param el\n\t * @private\n\t */\n\t\n\t }, {\n\t key: '_markElementInvalid',\n\t value: function _markElementInvalid(el) {\n\t el.setAttribute(DATA_ELEMENT_INVALID, \"true\");\n\t el.classList.add(this.options.inputErrorClass);\n\t }\n\t\n\t /**\n\t * @param el\n\t * @private\n\t */\n\t\n\t }, {\n\t key: '_markElementValid',\n\t value: function _markElementValid(el) {\n\t el.removeAttribute(DATA_ELEMENT_INVALID);\n\t el.classList.remove(this.options.inputErrorClass);\n\t }\n\t\n\t /**\n\t * A List of invalid elements (:invalid)\n\t * @returns {Array}\n\t * @private\n\t */\n\t\n\t }, {\n\t key: '_getInvalidElements',\n\t value: function _getInvalidElements() {\n\t return Array.prototype.filter.call(this.getForm().querySelectorAll(\":invalid\"), function (r) {\n\t return !(r instanceof HTMLFieldSetElement);\n\t });\n\t }\n\t\n\t /**\n\t * @param {HTMLElement} thisParent\n\t * @private\n\t */\n\t\n\t }, {\n\t key: '_removeElementErrors',\n\t value: function _removeElementErrors(thisParent) {\n\t var errors = thisParent.querySelectorAll('.' + this.options.containerErrorClass),\n\t inputsWithErrorClasses = thisParent.querySelectorAll('[' + DATA_ELEMENT_INVALID + ']');\n\t for (var elementErrorIndex = 0; elementErrorIndex < errors.length; elementErrorIndex++) {\n\t errors[elementErrorIndex].parentNode.removeChild(errors[elementErrorIndex]);\n\t }\n\t for (var inputErrorIndex = 0; inputErrorIndex < inputsWithErrorClasses.length; inputErrorIndex++) {\n\t var el = inputsWithErrorClasses[inputErrorIndex];\n\t this._markElementValid(el);\n\t }\n\t }\n\t\n\t /**\n\t * Registers a custom validator\n\t * @param {String} name\n\t * @param {Function} validator a validation function should always return either a Future(true) or Future(false)\n\t * even when the field has been invalidated with `setCustomValidity`, because of different browser `bugs`\n\t * we can't rely on that\n\t * @returns {Form}\n\t */\n\t\n\t }, {\n\t key: 'registerValidator',\n\t value: function registerValidator(name, validator) {\n\t this._validators[name] = validator;\n\t return this;\n\t }\n\t\n\t /**\n\t * Runs async validation\n\t * @param {String} validationRef\n\t * @param {HTMLElement} field\n\t * @returns {Promise}\n\t * @private\n\t */\n\t\n\t }, {\n\t key: '_runValidation',\n\t value: function _runValidation(validationRef, field) {\n\t if (!this._validators[validationRef]) {\n\t throw 'Could not found validator: ' + validationRef;\n\t }\n\t var cl = field.classList,\n\t future = this._validators[validationRef].apply(this, [field, this.form]);\n\t cl.add(LOADING_CLASS);\n\t future.then(function () {\n\t cl.remove(LOADING_CLASS);\n\t });\n\t return future;\n\t }\n\t\n\t /**\n\t * Run custom validations for elements, validations are done async do support XHR Requests or other stuff\n\t *\n\t * @param {Array|NodeList} fields\n\t * @returns {Promise} contains either true if validations passed or false if something went wrong\n\t * @private\n\t */\n\t\n\t }, {\n\t key: '_customValidationsForElements',\n\t value: function _customValidationsForElements(fields) {\n\t var futures = [],\n\t fieldsLength = fields.length,\n\t checkedFields = [];\n\t for (var iVal = 0; iVal < fieldsLength; iVal++) {\n\t var field = fields[iVal],\n\t validationRef = field.getAttribute(ATTR_VALIDATOR),\n\t validity = field.validity;\n\t if (this._validators[validationRef]) {\n\t // use local validation first and then continue with custom validations\n\t if (Form._shouldNotValidateField(field) || validity && !validity.customError && !validity.valid) {\n\t continue;\n\t }\n\t checkedFields.push(field);\n\t futures.push(this._runValidation(validationRef, field));\n\t } else {\n\t if (validationRef) {\n\t console.warn('data-validate was set but no validator was found');\n\t }\n\t }\n\t }\n\t return Promise.all(futures).then(function (allFutures) {\n\t var l = allFutures.length;\n\t var result = {\n\t checkedFields: checkedFields,\n\t foundAnyError: false\n\t };\n\t for (var fI = 0; fI < l; fI++) {\n\t if (!allFutures[fI]) {\n\t result.foundAnyError = true;\n\t break;\n\t }\n\t }\n\t return result;\n\t });\n\t }\n\t\n\t /**\n\t * Remove all errors for this form\n\t * @returns {Form}\n\t */\n\t\n\t }, {\n\t key: 'removeErrors',\n\t value: function removeErrors() {\n\t this._removeElementErrors(this.form);\n\t if (this.tooltips) {\n\t this.tooltips.removeTooltip();\n\t }\n\t return this;\n\t }\n\t\n\t /**\n\t * Will handle errors for given fields\n\t * @param {Array|NodeList} fields\n\t * @param {Boolean} removeAllErrors\n\t */\n\t\n\t }, {\n\t key: 'prepareErrors',\n\t value: function prepareErrors(fields, removeAllErrors) {\n\t if (removeAllErrors) {\n\t this.removeErrors();\n\t }\n\t var labelGroups = {},\n\t invalidFields = [];\n\t\n\t function handleAdditionalLabels(isInvalid, thisLabelGroup, field) {\n\t var additionalLabels = field.getAttribute(ATTR_DATA_CUSTOM_LABEL) || field.id,\n\t group = thisLabelGroup[additionalLabels];\n\t if (additionalLabels) {\n\t // check additionally if field is currently marked as invalid\n\t // so the label is not marked as error if no field is marked as one\n\t group = group ? group : isInvalid;\n\t thisLabelGroup[additionalLabels] = group;\n\t }\n\t }\n\t\n\t // We save all validations in an extra property because we need to reset the validity due some\n\t // implementation errors in other browsers then chrome\n\t for (var i = 0; i < fields.length; i++) {\n\t var field = fields[i],\n\t errorTarget = Form._findErrorTarget(field),\n\t parent = errorTarget.parentNode,\n\t validity = field.validity,\n\t isInvalid = validity && !validity.valid;\n\t if (Form._shouldNotValidateField(field)) {\n\t continue;\n\t }\n\t field.flexFormsSavedValidity = JSON.parse(JSON.stringify(validity));\n\t handleAdditionalLabels(isInvalid, labelGroups, field);\n\t if (isInvalid) {\n\t if (!removeAllErrors) {\n\t // Remove current errors:\n\t this._removeElementErrors(parent);\n\t }\n\t // setup custom error messages:\n\t this._setupErrorMessages(field, validity);\n\t var msg = field.validationMessage;\n\t\n\t // mark fields as invalid\n\t this._markElementInvalid(errorTarget);\n\t this._markElementInvalid(field);\n\t\n\t if (this.options.appendError) {\n\t parent.insertAdjacentHTML(\"beforeend\", '
' + msg + '
');\n\t }\n\t invalidFields.push(field);\n\t field.flexFormsSavedValidationMessage = msg;\n\t } else {\n\t // restore invalid fields\n\t this._markElementValid(errorTarget);\n\t this._markElementValid(field);\n\t\n\t // cleanup\n\t delete field.flexFormsSavedValidationMessage;\n\t\n\t // remove error markup\n\t this._removeElementErrors(parent);\n\t }\n\t // We have to reset the custom validity here to allow native validations work again\n\t field.setCustomValidity('');\n\t }\n\t // if validates a single field we need to check the linked fields to a label:\n\t if (fields.length === 1) {\n\t var _field = fields[0];\n\t var id = _field.getAttribute(ATTR_DATA_CUSTOM_LABEL) || _field.id;\n\t if (id) {\n\t var linkedFields = Array.from(this.getForm().querySelectorAll('[' + ATTR_DATA_CUSTOM_LABEL + '=\"' + id + '\"], #' + id));\n\t linkedFields.forEach(function (thisField) {\n\t var validity = thisField.validity,\n\t isInvalid = validity && !validity.valid && this._isElementInvalidElement(thisField);\n\t handleAdditionalLabels(isInvalid, labelGroups, thisField);\n\t }.bind(this));\n\t }\n\t }\n\t this._handleLabels(labelGroups);\n\t return invalidFields;\n\t }\n\t\n\t /**\n\t * Validates all custom fields\n\t * @returns {Promise}\n\t */\n\t\n\t }, {\n\t key: 'validateCustomFields',\n\t value: function validateCustomFields() {\n\t return this._customValidationsForElements(this.form.querySelectorAll(\"[data-validate]\"));\n\t }\n\t\n\t /**\n\t * Tests if a field should be validated\n\t * @param {HTMLElement} field\n\t * @returns {boolean}\n\t * @private\n\t */\n\t\n\t }, {\n\t key: 'getForm',\n\t\n\t\n\t /**\n\t * This form\n\t * @returns {HTMLElement}\n\t */\n\t value: function getForm() {\n\t return this.form;\n\t }\n\t\n\t /**\n\t * Registers a function that handles remote validation\n\t * @param {Function} func\n\t * @returns {Form}\n\t */\n\t\n\t }, {\n\t key: 'registerRemoteValidation',\n\t value: function registerRemoteValidation(func) {\n\t this._remoteValidationFunction = func;\n\t return this;\n\t }\n\t\n\t /**\n\t * Formats the error content for the tooltip\n\t * @param {String} error\n\t * @returns {String}\n\t * @private\n\t */\n\t\n\t }, {\n\t key: '_formatErrorTooltip',\n\t value: function _formatErrorTooltip(error) {\n\t return this.options.formatErrorTooltip.apply(this, [error]);\n\t }\n\t\n\t /**\n\t * Tries to find a custom error target on given target\n\t * @param target\n\t * @returns {HTMLElement}\n\t * @private\n\t */\n\t\n\t }, {\n\t key: 'showAndOrCreateTooltip',\n\t\n\t\n\t /**\n\t * Creates a tooltip at given element, will only create a new instance if not created\n\t * @param {HTMLElement} target\n\t * @param {Boolean} [remove]\n\t */\n\t value: function showAndOrCreateTooltip(target, remove) {\n\t var self = this;\n\t if (!this.tooltips && this.options.createTooltips) {\n\t this.tooltips = new _Tooltip2.default(this.options.tooltipContainer, this.options.tooltipOptions);\n\t }\n\t if (!this.options.createTooltips) {\n\t return false;\n\t }\n\t\n\t if (!target.flexFormsSavedValidity) {\n\t return false;\n\t }\n\t var errorTarget = Form._findErrorTarget(target);\n\t if (!target.flexFormsSavedValidity.valid && self._isElementInvalidElement(errorTarget)) {\n\t self.tooltips.createTooltip(errorTarget, self._formatErrorTooltip(target.flexFormsSavedValidationMessage), false);\n\t return true;\n\t } else {\n\t if (remove) {\n\t self.tooltips.removeTooltip();\n\t }\n\t }\n\t return false;\n\t }\n\t\n\t /**\n\t * Checks if element is marked as invalid\n\t * @param {HTMLElement} el\n\t * @returns {boolean}\n\t * @private\n\t */\n\t\n\t }, {\n\t key: '_isElementInvalidElement',\n\t value: function _isElementInvalidElement(el) {\n\t return el.hasAttribute(DATA_ELEMENT_INVALID);\n\t }\n\t\n\t /**\n\t * Handles invalid event of a form\n\t * @param {Event} e\n\t * @returns {Promise|boolean}\n\t * @private\n\t */\n\t\n\t }, {\n\t key: '_checkIsInvalid',\n\t value: function _checkIsInvalid(e) {\n\t e.preventDefault();\n\t var invalidFields = this.getForm().querySelectorAll(\":invalid\");\n\t return this._handleValidation(invalidFields, true, false);\n\t }\n\t\n\t /**\n\t * Will query dependent fields (by selector) that should be validated with given field\n\t * @param field\n\t * @returns {NodeList|[]}\n\t * @private\n\t */\n\t\n\t }, {\n\t key: '_getDependentFields',\n\t value: function _getDependentFields(field) {\n\t var fieldSelector = field.getAttribute(ATTR_DEPENDS),\n\t base = [field];\n\t if (fieldSelector) {\n\t base.push.apply(base, Array.prototype.slice.apply(this.getForm().querySelectorAll(fieldSelector)));\n\t }\n\t return base;\n\t }\n\t\n\t /**\n\t * @private\n\t * @param {HTMLElement} [target]\n\t */\n\t\n\t }, {\n\t key: '_handleTooltipInline',\n\t value: function _handleTooltipInline(target) {\n\t if (this.tooltips) {\n\t this.tooltips.removeTooltip(target);\n\t }\n\t }\n\t\n\t /**\n\t * Initializes validation for a given form, registers event handlers\n\t */\n\t\n\t }, {\n\t key: 'initFormValidation',\n\t value: function initFormValidation() {\n\t var _this3 = this;\n\t\n\t // Suppress the default bubbles\n\t var form = this.getForm(),\n\t self = this,\n\t invalidEvent = 'invalid';\n\t\n\t /**\n\t * Validates if is valid realtime element\n\t * @param {HTMLElement} target\n\t * @returns {boolean}\n\t * @private\n\t */\n\t function _checkIsValidRealtimeElement(target) {\n\t return !target.hasAttribute(ATTR_DISABLE_REALTIME) && !target.hasAttribute(ATTR_DISABLE_INLINE);\n\t }\n\t\n\t form.addEventListener(invalidEvent, function (e) {\n\t e.preventDefault();\n\t }, true);\n\t\n\t _Util2.default.addEventOnce(invalidEvent, form, function handleInvalid(e) {\n\t self._formLoading();\n\t var result = self._checkIsInvalid(e);\n\t if (result) {\n\t self.currentValidationFuture = new Promise(function (resolve) {\n\t result.then(function (r) {\n\t setTimeout(function () {\n\t _Util2.default.addEventOnce(invalidEvent, form, handleInvalid, true);\n\t }, 0);\n\t resolve(r);\n\t self._formStopLoading();\n\t if (!r.foundAnyError) {\n\t self._formLoading();\n\t self._handleSubmit(e);\n\t }\n\t });\n\t });\n\t }\n\t }, true);\n\t\n\t this.addEventListener(form, 'reset', function () {\n\t _this3.removeErrors();\n\t });\n\t\n\t // Timeout for keys:\n\t var TIMEOUT_KEYDOWN,\n\t KEYDOWN_RUNNING = false;\n\t\n\t // resets keydown events\n\t function clearKeyDownTimeout() {\n\t KEYDOWN_RUNNING = false;\n\t clearTimeout(TIMEOUT_KEYDOWN);\n\t }\n\t\n\t // setup custom realtime event if given\n\t if (self.options.realtime) {\n\t this.addEventListener(form, CONST_REALTIME_EVENT, function (e) {\n\t if (self._formIsLoading()) {\n\t return;\n\t }\n\t var target = e.target;\n\t clearTimeout(TIMEOUT_KEYDOWN);\n\t if (KEYDOWN_RUNNING) {\n\t return;\n\t }\n\t TIMEOUT_KEYDOWN = setTimeout(function () {\n\t var isStillTarget = document.activeElement === e.target;\n\t if (!_checkIsValidRealtimeElement(target)) {\n\t return;\n\t }\n\t if (isStillTarget) {\n\t self._handleTooltipInline();\n\t }\n\t KEYDOWN_RUNNING = true;\n\t var dependentFields = self._getDependentFields(target);\n\t self._customValidationsForElements(dependentFields).then(function () {\n\t self.prepareErrors(dependentFields, false);\n\t if (isStillTarget) {\n\t self.showAndOrCreateTooltip(e.target);\n\t }\n\t // future must be resolved before another event can be started\n\t KEYDOWN_RUNNING = false;\n\t });\n\t }, self.options.realtimeTimeout);\n\t }, true);\n\t }\n\t\n\t /**\n\t * Validates if target is a valid input field to check blur and focus events\n\t *\n\t * @param {HTMLElement} target\n\t * @returns {boolean}\n\t * @private\n\t */\n\t function _checkIsValidBlurFocusElement(target) {\n\t var attr = target.getAttribute(\"type\");\n\t return attr !== \"radio\" && attr !== \"checkbox\" && attr !== \"submit\";\n\t }\n\t\n\t /**\n\t * Validates if is valid inline-check element\n\t * @param {HTMLElement} target\n\t * @returns {boolean}\n\t * @private\n\t */\n\t function _checkIsValidInlineCheckElement(target) {\n\t return !target.hasAttribute(ATTR_DISABLE_INLINE);\n\t }\n\t\n\t this.addEventListener(form, 'blur', function (e) {\n\t // do not hide tooltip after change event\n\t if (!e.target.flexcssKeepTooltips) {\n\t self._handleTooltipInline(e.target);\n\t }\n\t delete e.target.flexcssKeepTooltips;\n\t }, true);\n\t\n\t // handle focus on input elements\n\t // will show an error if field is invalid\n\t this.addEventListener(form, \"focus\", function (e) {\n\t if (self._formIsLoading()) {\n\t return;\n\t }\n\t // do not track errors for checkbox and radios on focus:\n\t if (!_checkIsValidBlurFocusElement(e.target)) {\n\t return;\n\t }\n\t // we need to delay this a little, because Firefox and Safari do not show a tooltip after it\n\t // just have been hidden (on blur). Maybe fix this with a queue later\n\t setTimeout(function () {\n\t self.showAndOrCreateTooltip(e.target);\n\t }, FOCUS_TOOLTIP_DELAY);\n\t }, true);\n\t\n\t if (self.options.inlineValidation) {\n\t // Handle change for checkbox, radios and selects\n\t this.addEventListener(form, \"change\", function (e) {\n\t var target = e.target;\n\t if (self._formIsLoading() || !_checkIsValidInlineCheckElement(target)) {\n\t return;\n\t }\n\t clearKeyDownTimeout();\n\t var name = target.getAttribute('name');\n\t var inputs = name ? form.querySelectorAll('[name=\"' + name + '\"]') : [target];\n\t // we only support dependent fields for a single widgets right now\n\t if (inputs.length === 1) {\n\t inputs = self._getDependentFields(target);\n\t }\n\t self._customValidationsForElements(inputs).then(function () {\n\t self.prepareErrors(inputs, false);\n\t target.flexcssKeepTooltips = self.showAndOrCreateTooltip(target, true);\n\t if (target.flexcssKeepTooltips) {\n\t self._handleTooltipHideClickAfterChange();\n\t }\n\t });\n\t });\n\t }\n\t\n\t // prevent default if form is invalid\n\t this.addEventListener(form, \"submit\", function listener(e) {\n\t self._submitListener(e, listener);\n\t });\n\t\n\t _Event2.default.dispatchAndFire(form, EVENT_FORM_READY);\n\t }\n\t\n\t /* Loading states, unfortunately we can't check if a promise is pending :/*/\n\t /* TODO: Maybe wrap promise to extend this functionality */\n\t\n\t }, {\n\t key: '_formLoading',\n\t value: function _formLoading() {\n\t this.getForm().classList.add(LOADING_CLASS);\n\t }\n\t }, {\n\t key: '_formStopLoading',\n\t value: function _formStopLoading() {\n\t this.getForm().classList.remove(LOADING_CLASS);\n\t }\n\t }, {\n\t key: '_formIsLoading',\n\t value: function _formIsLoading() {\n\t return this.getForm().classList.contains(LOADING_CLASS);\n\t }\n\t\n\t // this defines the logic after a change event when a tooltip is shown\n\t // because we call this method inside the change event, the click would be immeditally executed with the change\n\t // event when not using setTimeout(). There might be another solution for this...\n\t\n\t }, {\n\t key: '_handleTooltipHideClickAfterChange',\n\t value: function _handleTooltipHideClickAfterChange() {\n\t var self = this;\n\t if (this.options.createTooltips) {\n\t setTimeout(function () {\n\t _Util2.default.addEventOnce(_Settings2.default.getTabEvent(), global.document.body, function (t) {\n\t if (!self._isElementInvalidElement(t.target)) {\n\t self._handleTooltipInline();\n\t }\n\t });\n\t }, CLICK_TOOLTIP_DELAY);\n\t }\n\t }\n\t }, {\n\t key: '_focusElement',\n\t value: function _focusElement(el) {\n\t el.focus();\n\t _Util2.default.scrollToElement(el, this.options.scrollToElementDiff);\n\t }\n\t\n\t /**\n\t * Listener that is executed on form submit\n\t * @param e\n\t * @param submitListener\n\t * @returns {boolean}\n\t * @private\n\t */\n\t\n\t }, {\n\t key: '_submitListener',\n\t value: function _submitListener(e, submitListener) {\n\t\n\t var form = this.getForm(),\n\t self = this,\n\t submitEvent = 'submit';\n\t\n\t if (this._formIsLoading()) {\n\t e.preventDefault();\n\t return false;\n\t }\n\t this._formLoading();\n\t form.removeEventListener(submitEvent, submitListener);\n\t this.removeErrors();\n\t e.preventDefault();\n\t // reset:\n\t if (form.checkValidity()) {\n\t form.addEventListener(submitEvent, submitListener);\n\t // It's possible that the form is valid but the custom validations need to be checked again:\n\t self.currentValidationFuture = new Promise(function (resolve) {\n\t var validation = self.validateCustomFields();\n\t validation.then(function (r) {\n\t // because custom validators may mark multiple fields as invalid, we get all of them in the form\n\t var fields = self._getInvalidElements(),\n\t errors = self.prepareErrors(fields, false),\n\t firstError = errors[0];\n\t if (firstError) {\n\t self._focusElement(firstError);\n\t self.showAndOrCreateTooltip(firstError, true);\n\t }\n\t resolve(r);\n\t });\n\t });\n\t self.currentValidationFuture.then(function (r) {\n\t if (!r.foundAnyError) {\n\t // Handle submitting the form to server:\n\t self._handleSubmit(e);\n\t } else {\n\t self._formStopLoading();\n\t }\n\t });\n\t } else {\n\t self._formStopLoading();\n\t form.addEventListener(submitEvent, submitListener);\n\t }\n\t }\n\t\n\t /**\n\t * Handles submitting, optionally allows to stop submitting\n\t * @param e\n\t * @private\n\t */\n\t\n\t }, {\n\t key: '_handleSubmit',\n\t value: function _handleSubmit(e) {\n\t this._submitFunction(this.form, e);\n\t }\n\t\n\t /**\n\t * Registers a global event Handler\n\t * @param errorFunc\n\t */\n\t\n\t }], [{\n\t key: '_shouldNotValidateField',\n\t value: function _shouldNotValidateField(field) {\n\t var target = Form._findErrorTarget(field);\n\t return target instanceof HTMLFieldSetElement || field.validity === undefined || target.hasAttribute(ATTR_VALIDATE_VISIBILITY) && !_Util2.default.isVisible(target);\n\t }\n\t\n\t /**\n\t * Creates an array from a node list with invalid items\n\t * This Method expicitly checks if field should not be validated so it can be used to foucs a field\n\t * @param list\n\t * @returns {Array}\n\t * @private\n\t */\n\t\n\t }, {\n\t key: '_createArrayFromInvalidFieldList',\n\t value: function _createArrayFromInvalidFieldList(list) {\n\t var arr = [];\n\t for (var i = 0; i < list.length; ++i) {\n\t var n = list[i];\n\t if (n.validity && !n.validity.valid) {\n\t if (!Form._shouldNotValidateField(n)) {\n\t arr.push(n);\n\t }\n\t }\n\t }\n\t return arr;\n\t }\n\t }, {\n\t key: '_findErrorTarget',\n\t value: function _findErrorTarget(target) {\n\t var el = target.getAttribute(ATTR_ERROR_TARGET_ID) || target,\n\t foundTarget = el instanceof HTMLElement ? el : global.document.getElementById(el);\n\t if (!foundTarget) {\n\t throw 'Given error target did not exsits:' + target;\n\t }\n\t return foundTarget;\n\t }\n\t }, {\n\t key: 'registerErrorMessageHandler',\n\t value: function registerErrorMessageHandler(errorFunc) {\n\t Form.globalErrorMessageHandler = errorFunc;\n\t }\n\t\n\t /**\n\t * Initialize forms for a specific selector\n\t * @param {String} selector\n\t * @param {Object} [options]\n\t * @return {array.}\n\t */\n\t\n\t }, {\n\t key: 'init',\n\t value: function init(selector, options) {\n\t var forms = selector instanceof HTMLElement ? selector.querySelectorAll('form') : document.querySelectorAll(selector),\n\t instances = [];\n\t for (var i = 0; i < forms.length; i++) {\n\t instances.push(new Form(forms[i], options));\n\t }\n\t return instances;\n\t }\n\t\n\t /**\n\t * Registers a global validator that is usable on all form instances\n\t * @param {String} name\n\t * @param {Function} validator\n\t * @returns {Function}\n\t */\n\t\n\t }, {\n\t key: 'registerValidator',\n\t value: function registerValidator(name, validator) {\n\t Form.globalValidators[name] = validator;\n\t return Form;\n\t }\n\t\n\t /**\n\t * Registers a global function that is called when a form should validate the response of a server\n\t * @param {Function} func\n\t * @returns {Form}\n\t */\n\t\n\t }, {\n\t key: 'registerGlobalRemoteValidationFunction',\n\t value: function registerGlobalRemoteValidationFunction(func) {\n\t Form.globalRemoteValidationFunction = func;\n\t return Form;\n\t }\n\t }]);\n\t\n\t return Form;\n\t}(_DestroyableWidget3.default);\n\t\n\t/**\n\t * Global validators\n\t * @type {Array}\n\t */\n\t\n\t\n\tForm.globalValidators = [];\n\t\n\t/**\n\t * Global Remote validation function\n\t */\n\tForm.globalRemoteValidationFunction = function () {};\n\t\n\t/**\n\t * Handles custom error messages extracts custom message by default\n\t */\n\tForm.globalErrorMessageHandler = function (field, validity) {\n\t if (!validity.customError) {\n\t var customMsg = field.getAttribute(ATTR_DATA_CUSTOM_MESSAGE);\n\t if (customMsg) {\n\t field.setCustomValidity(customMsg);\n\t }\n\t }\n\t};\n\t\n\texports.default = Form;\n\t/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))\n\n/***/ },\n/* 10 */\n/***/ function(module, exports) {\n\n\t\"use strict\";\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\texports.default = function (fn, ms) {\n\t return function () {\n\t clearTimeout(fn.timeout);\n\t fn.timeout = setTimeout(fn, ms);\n\t };\n\t};\n\n/***/ },\n/* 11 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t// the whatwg-fetch polyfill installs the fetch() function\n\t// on the global object (window or self)\n\t//\n\t// Return that as the export for use in Webpack, Browserify etc.\n\t__webpack_require__(12);\n\tmodule.exports = self.fetch.bind(self);\n\n\n/***/ },\n/* 12 */\n/***/ function(module, exports) {\n\n\t(function(self) {\n\t 'use strict';\n\t\n\t if (self.fetch) {\n\t return\n\t }\n\t\n\t function normalizeName(name) {\n\t if (typeof name !== 'string') {\n\t name = String(name)\n\t }\n\t if (/[^a-z0-9\\-#$%&'*+.\\^_`|~]/i.test(name)) {\n\t throw new TypeError('Invalid character in header field name')\n\t }\n\t return name.toLowerCase()\n\t }\n\t\n\t function normalizeValue(value) {\n\t if (typeof value !== 'string') {\n\t value = String(value)\n\t }\n\t return value\n\t }\n\t\n\t function Headers(headers) {\n\t this.map = {}\n\t\n\t if (headers instanceof Headers) {\n\t headers.forEach(function(value, name) {\n\t this.append(name, value)\n\t }, this)\n\t\n\t } else if (headers) {\n\t Object.getOwnPropertyNames(headers).forEach(function(name) {\n\t this.append(name, headers[name])\n\t }, this)\n\t }\n\t }\n\t\n\t Headers.prototype.append = function(name, value) {\n\t name = normalizeName(name)\n\t value = normalizeValue(value)\n\t var list = this.map[name]\n\t if (!list) {\n\t list = []\n\t this.map[name] = list\n\t }\n\t list.push(value)\n\t }\n\t\n\t Headers.prototype['delete'] = function(name) {\n\t delete this.map[normalizeName(name)]\n\t }\n\t\n\t Headers.prototype.get = function(name) {\n\t var values = this.map[normalizeName(name)]\n\t return values ? values[0] : null\n\t }\n\t\n\t Headers.prototype.getAll = function(name) {\n\t return this.map[normalizeName(name)] || []\n\t }\n\t\n\t Headers.prototype.has = function(name) {\n\t return this.map.hasOwnProperty(normalizeName(name))\n\t }\n\t\n\t Headers.prototype.set = function(name, value) {\n\t this.map[normalizeName(name)] = [normalizeValue(value)]\n\t }\n\t\n\t Headers.prototype.forEach = function(callback, thisArg) {\n\t Object.getOwnPropertyNames(this.map).forEach(function(name) {\n\t this.map[name].forEach(function(value) {\n\t callback.call(thisArg, value, name, this)\n\t }, this)\n\t }, this)\n\t }\n\t\n\t function consumed(body) {\n\t if (body.bodyUsed) {\n\t return Promise.reject(new TypeError('Already read'))\n\t }\n\t body.bodyUsed = true\n\t }\n\t\n\t function fileReaderReady(reader) {\n\t return new Promise(function(resolve, reject) {\n\t reader.onload = function() {\n\t resolve(reader.result)\n\t }\n\t reader.onerror = function() {\n\t reject(reader.error)\n\t }\n\t })\n\t }\n\t\n\t function readBlobAsArrayBuffer(blob) {\n\t var reader = new FileReader()\n\t reader.readAsArrayBuffer(blob)\n\t return fileReaderReady(reader)\n\t }\n\t\n\t function readBlobAsText(blob) {\n\t var reader = new FileReader()\n\t reader.readAsText(blob)\n\t return fileReaderReady(reader)\n\t }\n\t\n\t var support = {\n\t blob: 'FileReader' in self && 'Blob' in self && (function() {\n\t try {\n\t new Blob();\n\t return true\n\t } catch(e) {\n\t return false\n\t }\n\t })(),\n\t formData: 'FormData' in self,\n\t arrayBuffer: 'ArrayBuffer' in self\n\t }\n\t\n\t function Body() {\n\t this.bodyUsed = false\n\t\n\t\n\t this._initBody = function(body) {\n\t this._bodyInit = body\n\t if (typeof body === 'string') {\n\t this._bodyText = body\n\t } else if (support.blob && Blob.prototype.isPrototypeOf(body)) {\n\t this._bodyBlob = body\n\t } else if (support.formData && FormData.prototype.isPrototypeOf(body)) {\n\t this._bodyFormData = body\n\t } else if (!body) {\n\t this._bodyText = ''\n\t } else if (support.arrayBuffer && ArrayBuffer.prototype.isPrototypeOf(body)) {\n\t // Only support ArrayBuffers for POST method.\n\t // Receiving ArrayBuffers happens via Blobs, instead.\n\t } else {\n\t throw new Error('unsupported BodyInit type')\n\t }\n\t\n\t if (!this.headers.get('content-type')) {\n\t if (typeof body === 'string') {\n\t this.headers.set('content-type', 'text/plain;charset=UTF-8')\n\t } else if (this._bodyBlob && this._bodyBlob.type) {\n\t this.headers.set('content-type', this._bodyBlob.type)\n\t }\n\t }\n\t }\n\t\n\t if (support.blob) {\n\t this.blob = function() {\n\t var rejected = consumed(this)\n\t if (rejected) {\n\t return rejected\n\t }\n\t\n\t if (this._bodyBlob) {\n\t return Promise.resolve(this._bodyBlob)\n\t } else if (this._bodyFormData) {\n\t throw new Error('could not read FormData body as blob')\n\t } else {\n\t return Promise.resolve(new Blob([this._bodyText]))\n\t }\n\t }\n\t\n\t this.arrayBuffer = function() {\n\t return this.blob().then(readBlobAsArrayBuffer)\n\t }\n\t\n\t this.text = function() {\n\t var rejected = consumed(this)\n\t if (rejected) {\n\t return rejected\n\t }\n\t\n\t if (this._bodyBlob) {\n\t return readBlobAsText(this._bodyBlob)\n\t } else if (this._bodyFormData) {\n\t throw new Error('could not read FormData body as text')\n\t } else {\n\t return Promise.resolve(this._bodyText)\n\t }\n\t }\n\t } else {\n\t this.text = function() {\n\t var rejected = consumed(this)\n\t return rejected ? rejected : Promise.resolve(this._bodyText)\n\t }\n\t }\n\t\n\t if (support.formData) {\n\t this.formData = function() {\n\t return this.text().then(decode)\n\t }\n\t }\n\t\n\t this.json = function() {\n\t return this.text().then(JSON.parse)\n\t }\n\t\n\t return this\n\t }\n\t\n\t // HTTP methods whose capitalization should be normalized\n\t var methods = ['DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT']\n\t\n\t function normalizeMethod(method) {\n\t var upcased = method.toUpperCase()\n\t return (methods.indexOf(upcased) > -1) ? upcased : method\n\t }\n\t\n\t function Request(input, options) {\n\t options = options || {}\n\t var body = options.body\n\t if (Request.prototype.isPrototypeOf(input)) {\n\t if (input.bodyUsed) {\n\t throw new TypeError('Already read')\n\t }\n\t this.url = input.url\n\t this.credentials = input.credentials\n\t if (!options.headers) {\n\t this.headers = new Headers(input.headers)\n\t }\n\t this.method = input.method\n\t this.mode = input.mode\n\t if (!body) {\n\t body = input._bodyInit\n\t input.bodyUsed = true\n\t }\n\t } else {\n\t this.url = input\n\t }\n\t\n\t this.credentials = options.credentials || this.credentials || 'omit'\n\t if (options.headers || !this.headers) {\n\t this.headers = new Headers(options.headers)\n\t }\n\t this.method = normalizeMethod(options.method || this.method || 'GET')\n\t this.mode = options.mode || this.mode || null\n\t this.referrer = null\n\t\n\t if ((this.method === 'GET' || this.method === 'HEAD') && body) {\n\t throw new TypeError('Body not allowed for GET or HEAD requests')\n\t }\n\t this._initBody(body)\n\t }\n\t\n\t Request.prototype.clone = function() {\n\t return new Request(this)\n\t }\n\t\n\t function decode(body) {\n\t var form = new FormData()\n\t body.trim().split('&').forEach(function(bytes) {\n\t if (bytes) {\n\t var split = bytes.split('=')\n\t var name = split.shift().replace(/\\+/g, ' ')\n\t var value = split.join('=').replace(/\\+/g, ' ')\n\t form.append(decodeURIComponent(name), decodeURIComponent(value))\n\t }\n\t })\n\t return form\n\t }\n\t\n\t function headers(xhr) {\n\t var head = new Headers()\n\t var pairs = xhr.getAllResponseHeaders().trim().split('\\n')\n\t pairs.forEach(function(header) {\n\t var split = header.trim().split(':')\n\t var key = split.shift().trim()\n\t var value = split.join(':').trim()\n\t head.append(key, value)\n\t })\n\t return head\n\t }\n\t\n\t Body.call(Request.prototype)\n\t\n\t function Response(bodyInit, options) {\n\t if (!options) {\n\t options = {}\n\t }\n\t\n\t this.type = 'default'\n\t this.status = options.status\n\t this.ok = this.status >= 200 && this.status < 300\n\t this.statusText = options.statusText\n\t this.headers = options.headers instanceof Headers ? options.headers : new Headers(options.headers)\n\t this.url = options.url || ''\n\t this._initBody(bodyInit)\n\t }\n\t\n\t Body.call(Response.prototype)\n\t\n\t Response.prototype.clone = function() {\n\t return new Response(this._bodyInit, {\n\t status: this.status,\n\t statusText: this.statusText,\n\t headers: new Headers(this.headers),\n\t url: this.url\n\t })\n\t }\n\t\n\t Response.error = function() {\n\t var response = new Response(null, {status: 0, statusText: ''})\n\t response.type = 'error'\n\t return response\n\t }\n\t\n\t var redirectStatuses = [301, 302, 303, 307, 308]\n\t\n\t Response.redirect = function(url, status) {\n\t if (redirectStatuses.indexOf(status) === -1) {\n\t throw new RangeError('Invalid status code')\n\t }\n\t\n\t return new Response(null, {status: status, headers: {location: url}})\n\t }\n\t\n\t self.Headers = Headers;\n\t self.Request = Request;\n\t self.Response = Response;\n\t\n\t self.fetch = function(input, init) {\n\t return new Promise(function(resolve, reject) {\n\t var request\n\t if (Request.prototype.isPrototypeOf(input) && !init) {\n\t request = input\n\t } else {\n\t request = new Request(input, init)\n\t }\n\t\n\t var xhr = new XMLHttpRequest()\n\t\n\t function responseURL() {\n\t if ('responseURL' in xhr) {\n\t return xhr.responseURL\n\t }\n\t\n\t // Avoid security warnings on getResponseHeader when not allowed by CORS\n\t if (/^X-Request-URL:/m.test(xhr.getAllResponseHeaders())) {\n\t return xhr.getResponseHeader('X-Request-URL')\n\t }\n\t\n\t return;\n\t }\n\t\n\t xhr.onload = function() {\n\t var status = (xhr.status === 1223) ? 204 : xhr.status\n\t if (status < 100 || status > 599) {\n\t reject(new TypeError('Network request failed'))\n\t return\n\t }\n\t var options = {\n\t status: status,\n\t statusText: xhr.statusText,\n\t headers: headers(xhr),\n\t url: responseURL()\n\t }\n\t var body = 'response' in xhr ? xhr.response : xhr.responseText;\n\t resolve(new Response(body, options))\n\t }\n\t\n\t xhr.onerror = function() {\n\t reject(new TypeError('Network request failed'))\n\t }\n\t\n\t xhr.open(request.method, request.url, true)\n\t\n\t if (request.credentials === 'include') {\n\t xhr.withCredentials = true\n\t }\n\t\n\t if ('responseType' in xhr && support.blob) {\n\t xhr.responseType = 'blob'\n\t }\n\t\n\t request.headers.forEach(function(value, name) {\n\t xhr.setRequestHeader(name, value)\n\t })\n\t\n\t xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit)\n\t })\n\t }\n\t self.fetch.polyfill = true\n\t})(typeof self !== 'undefined' ? self : this);\n\n\n/***/ },\n/* 13 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t/* WEBPACK VAR INJECTION */(function(global) {'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports.EVENT_DROPDOWN_CLOSED = undefined;\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /*\n\t * The MIT License (MIT)\n\t *\n\t * Copyright (c) 2015 David Heidrich, BowlingX \n\t *\n\t * Permission is hereby granted, free of charge, to any person obtaining a copy\n\t * of this software and associated documentation files (the \"Software\"), to deal\n\t * in the Software without restriction, including without limitation the rights\n\t * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n\t * copies of the Software, and to permit persons to whom the Software is\n\t * furnished to do so, subject to the following conditions:\n\t *\n\t * The above copyright notice and this permission notice shall be included in\n\t * all copies or substantial portions of the Software.\n\t *\n\t * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n\t * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n\t * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n\t * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n\t * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n\t * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n\t * THE SOFTWARE.\n\t */\n\t\n\t/*!\n\t * FlexCss.Dropdown\n\t * Licensed under the MIT License (MIT)\n\t * Copyright (c) 2015 David Heidrich, BowlingX \n\t */\n\t\n\tvar _Util = __webpack_require__(1);\n\t\n\tvar _Util2 = _interopRequireDefault(_Util);\n\t\n\tvar _Settings = __webpack_require__(2);\n\t\n\tvar _Settings2 = _interopRequireDefault(_Settings);\n\t\n\tvar _Event = __webpack_require__(3);\n\t\n\tvar _Event2 = _interopRequireDefault(_Event);\n\t\n\tvar _Widget = __webpack_require__(4);\n\t\n\tvar _Widget2 = _interopRequireDefault(_Widget);\n\t\n\tvar _FixedWindow = __webpack_require__(7);\n\t\n\tvar _FixedWindow2 = _interopRequireDefault(_FixedWindow);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\t/**\n\t * @type {string}\n\t */\n\tvar ATTR_CC = 'data-collision-container';\n\t/**\n\t * @type {string}\n\t */\n\tvar ATTR_DARKENER = 'data-darkener-container';\n\t/**\n\t * @type {string}\n\t */\n\tvar DARKENER_INIT = 'init';\n\t/**\n\t * @type {string}\n\t */\n\tvar ATTR_DATA_TARGET = 'data-target';\n\t/**\n\t * @type {string}\n\t */\n\tvar ATTR_CLOSE_DROPDOWN = 'data-close-dropdown';\n\t/**\n\t * @type {string}\n\t */\n\tvar ATTR_NAME = 'data-dropdown';\n\t/**\n\t * @type {string}\n\t */\n\tvar STATE_LOADING = 'loading';\n\t\n\tvar CLS_DARKENER_DROPDOWN = 'darkener-dropdown';\n\t/**\n\t * @type {string}\n\t */\n\tvar CLS_OPEN = 'open';\n\t\n\t/**\n\t * @type {string}\n\t */\n\tvar CLS_DROPDOWN = 'dropdown';\n\t\n\t/**\n\t * @type {string}\n\t */\n\tvar EVENT_DROPDOWN_CLOSED = exports.EVENT_DROPDOWN_CLOSED = 'flexcss.dropdown.closed';\n\t\n\t/**\n\t * A Dropdown\n\t */\n\t\n\tvar Dropdown = function () {\n\t function Dropdown(DelegateContainer, Darkener) {\n\t _classCallCheck(this, Dropdown);\n\t\n\t var doc = global.document;\n\t\n\t /**\n\t * Container Element\n\t * @type {HTMLElement}\n\t */\n\t this.container = DelegateContainer instanceof HTMLElement ? DelegateContainer : doc.getElementById(DelegateContainer);\n\t\n\t this.currentOpen = null;\n\t this.currentTarget = null;\n\t /**\n\t * @type {HTMLElement}\n\t */\n\t this.darkener = Darkener instanceof HTMLElement ? Darkener : document.getElementById(Darkener);\n\t\n\t this.destroyOnClose = false;\n\t\n\t if (!this.darkener || !this.container) {\n\t throw new Error('required elements not found (darkener and container element)');\n\t }\n\t }\n\t\n\t /**\n\t * Method that handles delegation events for dropdowns\n\t * @param e\n\t * @returns {boolean}\n\t * @private\n\t */\n\t\n\t\n\t _createClass(Dropdown, [{\n\t key: '_delegateFunction',\n\t value: function _delegateFunction(e) {\n\t var currentOpen = this.currentOpen;\n\t var target = _Util2.default.closestCallback(e.target, function (n) {\n\t return n instanceof HTMLElement && n.hasAttribute(ATTR_NAME);\n\t });\n\t var targetIsCurrent = target === this.currentTarget;\n\t\n\t if (currentOpen && !_Util2.default.isPartOfNode(e.target, currentOpen) || targetIsCurrent) {\n\t this.close();\n\t if (targetIsCurrent) {\n\t e.preventDefault();\n\t }\n\t return targetIsCurrent ? false : this._delegateFunction(e);\n\t }\n\t\n\t if (target && !currentOpen) {\n\t e.preventDefault();\n\t e.stopImmediatePropagation();\n\t\n\t if (target.isLoading) {\n\t return false;\n\t }\n\t this.createDropdown(target);\n\t } else {\n\t if (currentOpen) {\n\t if (e.target.hasAttribute(ATTR_CLOSE_DROPDOWN)) {\n\t e.preventDefault();\n\t this.close();\n\t }\n\t if (!_Util2.default.isPartOfNode(e.target, currentOpen)) {\n\t this.close();\n\t }\n\t }\n\t }\n\t }\n\t\n\t /**\n\t * Register Events for this dropdown container\n\t * @returns {Dropdown}\n\t */\n\t\n\t }, {\n\t key: 'registerEvents',\n\t value: function registerEvents() {\n\t _FixedWindow2.default.getInstance().addScreenConstraint(Dropdown, function (width) {\n\t return width < _Settings2.default.get().smallBreakpoint;\n\t });\n\t this.container.addEventListener(_Settings2.default.getTabEvent(), this._delegateFunction.bind(this), true);\n\t return this;\n\t }\n\t\n\t /**\n\t * Destroys this instance, unbinds events\n\t * @returns {Dropdown}\n\t */\n\t\n\t }, {\n\t key: 'destroy',\n\t value: function destroy() {\n\t this.container.removeEventListener(_Settings2.default.getTabEvent(), this._delegateFunction.bind(this), true);\n\t return this;\n\t }\n\t\n\t /**\n\t * Destroys instance on close of dropdown\n\t * @param v\n\t * @returns {Dropdown}\n\t */\n\t\n\t }, {\n\t key: 'setDestroyOnClose',\n\t value: function setDestroyOnClose(v) {\n\t this.destroyOnClose = v;\n\t return this;\n\t }\n\t\n\t /**\n\t * Will add the right class to container for specific darkener id\n\t * @param instance\n\t * @param show\n\t */\n\t\n\t }, {\n\t key: 'toggleDarkenerToggler',\n\t value: function toggleDarkenerToggler(instance, show) {\n\t var cls = 'toggle-' + (instance.id || CLS_DARKENER_DROPDOWN);\n\t var classList = this.container.classList;\n\t if (show) {\n\t classList.add(cls);\n\t } else {\n\t classList.remove(cls);\n\t }\n\t }\n\t\n\t /**\n\t * Closes Dropdown on current instance\n\t * @return {Boolean|Promise}\n\t */\n\t\n\t }, {\n\t key: 'close',\n\t value: function close() {\n\t var _this2 = this;\n\t\n\t var currentOpen = this.currentOpen;\n\t if (!currentOpen) {\n\t return false;\n\t }\n\t var darkenerInstance = currentOpen.flexDarkenerInstance || this.darkener;\n\t var thisCurrentOpen = currentOpen;\n\t\n\t var future = new Promise(function (resolve) {\n\t if (window.getComputedStyle(currentOpen).position === 'fixed') {\n\t _Util2.default.addEventOnce(_Settings2.default.getTransitionEvent(), currentOpen, function scheduler(e) {\n\t var _this = this;\n\t\n\t if (e.srcElement !== currentOpen) {\n\t return _Util2.default.addEventOnce(_Settings2.default.getTransitionEvent(), currentOpen, scheduler.bind(this));\n\t }\n\t requestAnimationFrame(function () {\n\t _Event2.default.dispatchAndFire(thisCurrentOpen, EVENT_DROPDOWN_CLOSED);\n\t // if a new dropdown has been opened in the meantime, do not remove darkener\n\t if (_this.currentOpen !== null) {\n\t return false;\n\t }\n\t _this.toggleDarkenerToggler(darkenerInstance, false);\n\t resolve(true);\n\t });\n\t }.bind(_this2));\n\t } else {\n\t resolve(true);\n\t _Event2.default.dispatchAndFire(thisCurrentOpen, EVENT_DROPDOWN_CLOSED);\n\t }\n\t });\n\t\n\t _FixedWindow2.default.getInstance().close();\n\t currentOpen.classList.remove(CLS_OPEN);\n\t\n\t if (currentOpen.flexDarkenerInstance) {\n\t currentOpen.flexDarkenerInstance.classList.remove(DARKENER_INIT);\n\t } else {\n\t this.darkener.classList.remove(DARKENER_INIT);\n\t }\n\t\n\t this.currentOpen = null;\n\t this.currentTarget = null;\n\t\n\t if (this.destroyOnClose) {\n\t this.destroy();\n\t }\n\t\n\t return future;\n\t }\n\t\n\t /**\n\t * Creates a dropdown on given target and opens it\n\t * @param {HTMLElement} target target where this dropdown is placed\n\t * @param {FlexCss.Widget} [thisWidget] if given will use widget instead of widget instance\n\t * @return {FlexCss.Dropdown}\n\t */\n\t\n\t }, {\n\t key: 'createDropdown',\n\t value: function createDropdown(target, thisWidget) {\n\t var _this3 = this;\n\t\n\t var doc = global.document;\n\t\n\t if (!target) {\n\t throw new Error('Dropdown target not found');\n\t }\n\t\n\t var widget = thisWidget || _Widget2.default.findWidget(target);\n\t var future = void 0;\n\t var data = target.getAttribute(ATTR_NAME);\n\t var dropdownContainerElement = doc.getElementById(data);\n\t var async = !dropdownContainerElement && _Widget2.default.isWidget(widget) ? widget.getAsync() : false;\n\t\n\t if (async) {\n\t target.classList.add(STATE_LOADING);\n\t target.isLoading = true;\n\t future = async.then(function (r) {\n\t if (r instanceof HTMLElement) {\n\t if (r.id) {\n\t target.setAttribute(ATTR_NAME, r.id);\n\t }\n\t return r;\n\t }\n\t // Create container Element:\n\t var element = doc.createElement('div');\n\t element.className = CLS_DROPDOWN;\n\t element.innerHTML = r;\n\t element.id = _Util2.default.guid();\n\t // Cache target for later use:\n\t target.setAttribute(ATTR_NAME, element.id);\n\t _this3.container.appendChild(element);\n\t return element;\n\t }).then(function (r) {\n\t target.isLoading = false;\n\t target.classList.remove(STATE_LOADING);\n\t return r;\n\t });\n\t } else {\n\t if (!dropdownContainerElement) {\n\t throw new Error('Could not found Dropdown container with ID \"' + data + '\"');\n\t }\n\t future = new Promise(function (r) {\n\t r(dropdownContainerElement);\n\t });\n\t }\n\t\n\t future.then(function (dropdownContent) {\n\t if (_this3.currentOpen) {\n\t _this3.close();\n\t }\n\t // Skip one frame to show animation\n\t target.dropdownContent = dropdownContent;\n\t var isAbsolute = global.getComputedStyle(dropdownContent).position === 'absolute';\n\t dropdownContent.hfWidgetInstance = _this3;\n\t\n\t if (!target.flexCollisionContainer) {\n\t var collisionC = target.getAttribute(ATTR_CC);\n\t target.flexCollisionContainer = collisionC ? doc.getElementById(collisionC) || document.documentElement : document.documentElement;\n\t }\n\t\n\t dropdownContent.classList.toggle(CLS_OPEN);\n\t if (dropdownContent.classList.contains(CLS_OPEN)) {\n\t _this3.currentOpen = dropdownContent;\n\t _this3.currentTarget = target;\n\t }\n\t _FixedWindow2.default.getInstance().open(_this3, dropdownContent);\n\t if (isAbsolute) {\n\t // Check collision:\n\t var selfTarget = target.getAttribute(ATTR_DATA_TARGET);\n\t selfTarget = selfTarget ? doc.getElementById(selfTarget) : target;\n\t _Util2.default.setupPositionNearby(selfTarget, dropdownContent, target.flexCollisionContainer);\n\t } else {\n\t // optionally get custom darkener container for target\n\t var d = target.getAttribute(ATTR_DARKENER);\n\t if (d) {\n\t dropdownContent.flexDarkenerInstance = doc.getElementById(d);\n\t (dropdownContent.flexDarkenerInstance || _this3.darkener).classList.toggle(DARKENER_INIT);\n\t } else {\n\t _this3.darkener.classList.toggle(DARKENER_INIT);\n\t }\n\t _this3.toggleDarkenerToggler(dropdownContent.flexDarkenerInstance || _this3.darkener, true);\n\t\n\t dropdownContent.style.left = '0';\n\t dropdownContent.style.top = 'auto';\n\t }\n\t });\n\t }\n\t }]);\n\t\n\t return Dropdown;\n\t}();\n\t\n\texports.default = Dropdown;\n\t/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))\n\n/***/ },\n/* 14 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t/* WEBPACK VAR INJECTION */(function(global) {'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol ? \"symbol\" : typeof obj; };\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /*\n\t * The MIT License (MIT)\n\t *\n\t * Copyright (c) 2015 David Heidrich, BowlingX \n\t *\n\t * Permission is hereby granted, free of charge, to any person obtaining a copy\n\t * of this software and associated documentation files (the \"Software\"), to deal\n\t * in the Software without restriction, including without limitation the rights\n\t * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n\t * copies of the Software, and to permit persons to whom the Software is\n\t * furnished to do so, subject to the following conditions:\n\t *\n\t * The above copyright notice and this permission notice shall be included in\n\t * all copies or substantial portions of the Software.\n\t *\n\t * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n\t * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n\t * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n\t * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n\t * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n\t * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n\t * THE SOFTWARE.\n\t */\n\t\n\t/*!\n\t * FlexCss.LightBox\n\t * Licensed under the MIT License (MIT)\n\t * Copyright (c) 2015 David Heidrich, BowlingX \n\t */\n\t\n\t/* global Image, TouchEvent*/\n\t\n\tvar _Modal = __webpack_require__(8);\n\t\n\tvar _Modal2 = _interopRequireDefault(_Modal);\n\t\n\tvar _Settings = __webpack_require__(2);\n\t\n\tvar _Settings2 = _interopRequireDefault(_Settings);\n\t\n\tvar _Widget = __webpack_require__(4);\n\t\n\tvar _Widget2 = _interopRequireDefault(_Widget);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tvar ATTR_MAX_WIDTH = 'data-original-width';\n\tvar ATTR_MAX_HEIGHT = 'data-original-height';\n\tvar ATTR_SRC = 'data-src';\n\t\n\tvar CLS_HAS_PREV = 'has-prev';\n\tvar CLS_HAS_NEXT = 'has-next';\n\tvar CLS_LOADING = 'loading';\n\t\n\tvar ATTR_NO_THUMBNAIL = 'data-no-thumbnail';\n\tvar ATTR_DATA_HREF = 'data-href';\n\tvar ATTR_HREF = 'href';\n\t\n\tvar KEY_NEXT = 39;\n\tvar KEY_PREV = 37;\n\tvar ATTR_CLOSE = 'data-close-modal';\n\t/**\n\t * A Simple LightBox\n\t */\n\t\n\tvar LightBox = function () {\n\t\n\t /**\n\t * Creates a new Lightbox\n\t * @param DelegateContainer\n\t * @param AttributeSelector\n\t * @param ModalAppend\n\t * @param [options]\n\t */\n\t\n\t function LightBox(DelegateContainer, AttributeSelector, ModalAppend, options) {\n\t _classCallCheck(this, LightBox);\n\t\n\t var thisDelegateContainer = DelegateContainer instanceof HTMLElement ? DelegateContainer : document.getElementById(DelegateContainer);\n\t\n\t this._modalAppend = ModalAppend || DelegateContainer;\n\t /**\n\t * @type {Function}\n\t */\n\t this._resizeEvent = null;\n\t /**\n\t * @type {Function}\n\t */\n\t this._keyboardNextEvent = null;\n\t /**\n\t * @type {Promise}\n\t */\n\t this._future = null;\n\t /**\n\t * @type {Promise}\n\t */\n\t this._nextFuture = this._future;\n\t /**\n\t * @type {HTMLElement}\n\t */\n\t this._imageContainer = null;\n\t /**\n\t * @type {HTMLElement}\n\t */\n\t this._modalContainerDiv = null;\n\t /**\n\t * @type {HTMLElement}\n\t */\n\t this._contentContainer = null;\n\t /**\n\t * @type {HTMLElement}\n\t */\n\t this._closerContainerDiv = null;\n\t /**\n\t * @type {HTMLElement}\n\t */\n\t this._delegateContainer = thisDelegateContainer;\n\t /**\n\t * @type {HTMLElement}\n\t */\n\t this._attributeSelector = AttributeSelector;\n\t /**\n\t * @type {Widget}\n\t */\n\t this._widget = null;\n\t /**\n\t * @type {boolean}\n\t */\n\t this._isOpen = false;\n\t /**\n\t * @type {HTMLElement}\n\t */\n\t this.target = null;\n\t /**\n\t * @type {HTMLElement}\n\t */\n\t this.img = null;\n\t /**\n\t * @type {boolean}\n\t */\n\t this._isLoading = false;\n\t\n\t /**\n\t * Default options\n\t */\n\t this.options = {\n\t // set if prev and next should be available\n\t registerPrevNextEvents: true,\n\t // set if modal should be closed after last image\n\t closeOnLast: true,\n\t // called when next image is requested (either by keyboard or click), return false to abort\n\t onNext: function onNext() {\n\t return true;\n\t },\n\t onClose: function onClose() {},\n\t getNext: null,\n\t getPrev: null,\n\t // called when underlying target changed\n\t onSwitchImage: function onSwitchImage() {}\n\t };\n\t\n\t Object.assign(this.options, options);\n\t }\n\t\n\t /**\n\t * @param {HTMLElement} node\n\t * @returns {HTMLElement|null}\n\t */\n\t\n\t\n\t _createClass(LightBox, [{\n\t key: 'findImmediateNextTarget',\n\t value: function findImmediateNextTarget(node) {\n\t if (node && node.children[0].hasAttribute(this._attributeSelector)) {\n\t return node.children[0];\n\t }\n\t return null;\n\t }\n\t\n\t /**\n\t * Will fetch the next element of a lightBox\n\t * @param {HTMLElement} target\n\t * @returns {null|HTMLElement}\n\t */\n\t\n\t }, {\n\t key: 'getNext',\n\t value: function getNext(target) {\n\t if (this.options.getNext) {\n\t return this.options.getNext.apply(this, [target]);\n\t }\n\t return this.findImmediateNextTarget(target.parentNode.nextElementSibling);\n\t }\n\t\n\t /**\n\t * Will fetch the previous element of a lightBox\n\t * @param {HTMLElement} target\n\t * @returns {null|HTMLElement}\n\t */\n\t\n\t }, {\n\t key: 'getPrev',\n\t value: function getPrev(target) {\n\t if (this.options.getPrev) {\n\t return this.options.getPrev.apply(this, [target]);\n\t }\n\t return this.findImmediateNextTarget(target.parentNode.previousElementSibling);\n\t }\n\t\n\t /**\n\t * Registers events for delegate container\n\t */\n\t\n\t }, {\n\t key: 'registerEvents',\n\t value: function registerEvents(onOpen) {\n\t var _this = this;\n\t\n\t this._delegateContainer.addEventListener(_Settings2.default.getTabEvent(), function (e) {\n\t var target = e.target;\n\t var parent = target.parentNode;\n\t var validTarget = target.hasAttribute(_this._attributeSelector);\n\t var parentIsValid = parent && parent.hasAttribute(_this._attributeSelector);\n\t\n\t if (!validTarget && parentIsValid) {\n\t validTarget = true;\n\t target = parent;\n\t }\n\t if (validTarget) {\n\t e.preventDefault();\n\t _this.open(target).then(function (r) {\n\t if (onOpen) {\n\t onOpen.apply(_this, [r, target]);\n\t }\n\t });\n\t }\n\t });\n\t }\n\t\n\t /**\n\t * @returns {HTMLElement}\n\t */\n\t\n\t }, {\n\t key: 'getContentContainer',\n\t value: function getContentContainer() {\n\t return this._contentContainer;\n\t }\n\t\n\t /**\n\t * Setup max-width and max-height\n\t * @param {HTMLElement} target\n\t * @param {HTMLElement} img\n\t * @param {HTMLElement} loadedImage\n\t * @private\n\t */\n\t\n\t }, {\n\t key: 'switchImageByDirection',\n\t\n\t\n\t /**\n\t * Switches to the next image\n\t * @param {boolean} direction\n\t */\n\t value: function switchImageByDirection(direction) {\n\t var next = direction ? this.getPrev(this.target) : this.getNext(this.target);\n\t if (this.options.onNext.apply(this, [next])) {\n\t return this.switchImage(next);\n\t }\n\t return new Promise(function (_, reject) {\n\t return reject(next);\n\t });\n\t }\n\t\n\t /**\n\t * Checks if lightbox is currently loading\n\t * @returns {boolean}\n\t */\n\t\n\t }, {\n\t key: 'isLoading',\n\t value: function isLoading() {\n\t return this._isLoading;\n\t }\n\t\n\t /**\n\t * Checks if modal should be closed\n\t * @private\n\t */\n\t\n\t }, {\n\t key: '_runOptionalClose',\n\t value: function _runOptionalClose() {\n\t if (this.options.closeOnLast) {\n\t this.modal.close();\n\t }\n\t }\n\t }, {\n\t key: '_setupPrevNextStates',\n\t value: function _setupPrevNextStates() {\n\t var target = this.target;\n\t var hasPrev = this.getPrev(target);\n\t var hasNext = this.getNext(target);\n\t var hasPrevClass = CLS_HAS_PREV;\n\t var hasNextClass = CLS_HAS_NEXT;\n\t // because IE does not support the second toggle parameter, we need to do this manually\n\t if (hasPrev) {\n\t this._imageContainer.classList.add(hasPrevClass);\n\t } else {\n\t this._imageContainer.classList.remove(hasPrevClass);\n\t }\n\t if (hasNext) {\n\t this._imageContainer.classList.add(hasNextClass);\n\t } else {\n\t this._imageContainer.classList.remove(hasNextClass);\n\t }\n\t }\n\t\n\t /**\n\t * @param img\n\t * @private\n\t */\n\t\n\t }, {\n\t key: '_calculateContainer',\n\t value: function _calculateContainer(img) {\n\t var _this2 = this;\n\t\n\t if (_Settings2.default.isIE()) {\n\t setTimeout(function () {\n\t _this2._imageContainer.style.height = img.offsetHeight + 'px';\n\t }, 0);\n\t }\n\t }\n\t\n\t /**\n\t * Switch to a specific image\n\t * @param next\n\t * @returns {*}\n\t */\n\t\n\t }, {\n\t key: 'switchImage',\n\t value: function switchImage(next) {\n\t var _this3 = this;\n\t\n\t var self = this;\n\t var img = this.img;\n\t this._isLoading = true;\n\t self._nextFuture = new Promise(function (resolve, reject) {\n\t // notify observers about image switching\n\t self.options.onSwitchImage.apply(self, [self._nextFuture]);\n\t if (next) {\n\t var _ret = function () {\n\t var nextThumb = next.hasAttribute(ATTR_NO_THUMBNAIL) ? next : next.children[0] || next;\n\t var nextHighRes = next.getAttribute(ATTR_DATA_HREF) || next.getAttribute(ATTR_HREF);\n\t var nextSource = nextThumb.getAttribute(ATTR_SRC) || nextThumb.src || nextHighRes;\n\t var nextImgObject = new Image();\n\t\n\t if (!nextSource) {\n\t reject(next);\n\t return {\n\t v: void 0\n\t };\n\t }\n\t // set new target to next element\n\t _this3.target = next;\n\t nextImgObject.src = nextSource;\n\t self._imageContainer.classList.add(CLS_LOADING);\n\t nextImgObject.addEventListener('load', function () {\n\t img.src = nextSource;\n\t self._imageContainer.style.backgroundImage = 'url(' + nextSource + ')';\n\t LightBox._setupMaxWidthHeight(next, img, nextImgObject);\n\t self._calculateContainer(img);\n\t self.highRes(nextThumb, nextHighRes);\n\t self._setupPrevNextStates();\n\t self._imageContainer.classList.remove(CLS_LOADING);\n\t _this3._isLoading = false;\n\t resolve(nextSource, _this3.target);\n\t });\n\t }();\n\t\n\t if ((typeof _ret === 'undefined' ? 'undefined' : _typeof(_ret)) === \"object\") return _ret.v;\n\t } else {\n\t reject(_this3);\n\t }\n\t });\n\t return self._nextFuture;\n\t }\n\t\n\t /**\n\t * Setup High-Resolution picture\n\t * @param {HTMLElement} thisThumbnail\n\t * @param {String} thisImgHighResolution\n\t */\n\t\n\t }, {\n\t key: 'highRes',\n\t value: function highRes(thisThumbnail, thisImgHighResolution) {\n\t var _this4 = this;\n\t\n\t if (thisImgHighResolution && thisThumbnail.src !== thisImgHighResolution) {\n\t var highImageObj = new Image();\n\t highImageObj.src = thisImgHighResolution;\n\t highImageObj.addEventListener('load', function () {\n\t // if current image is still available\n\t if (_this4._getSrc(thisThumbnail) === _this4.img.src) {\n\t _this4.img.src = thisImgHighResolution;\n\t _this4._imageContainer.style.backgroundImage = 'url(' + thisImgHighResolution + ')';\n\t }\n\t });\n\t }\n\t }\n\t\n\t /**\n\t * Extracts the source of an image\n\t * @param target\n\t * @returns {String|null}\n\t * @private\n\t */\n\t\n\t }, {\n\t key: '_getSrc',\n\t value: function _getSrc(target) {\n\t return target.getAttribute(ATTR_SRC) || target.src;\n\t }\n\t\n\t /**\n\t * Will show a lightBox on given target\n\t * @param {HTMLElement} target\n\t * @returns {$.Deferred|*}\n\t */\n\t\n\t }, {\n\t key: 'open',\n\t value: function open(target) {\n\t var _this5 = this;\n\t\n\t var self = this;\n\t\n\t if (!target) {\n\t return false;\n\t }\n\t\n\t this.target = target;\n\t\n\t // if lightBox is open, we just switch to the new target image\n\t if (this._isOpen && target) {\n\t return this.switchImage(target).then(function () {\n\t return _this5;\n\t });\n\t }\n\t\n\t this._isOpen = true;\n\t\n\t /**\n\t * Setup Widget for modal\n\t * @type {Widget}\n\t */\n\t this._widget = new _Widget2.default().setAsync(function () {\n\t // thumbnail is either target itself or expected to be first childNode\n\t var thumbnail = target.hasAttribute(ATTR_NO_THUMBNAIL) ? target : target.children[0] || target;\n\t\n\t var imgHighResolution = target.getAttribute(ATTR_DATA_HREF) || target.getAttribute(ATTR_HREF);\n\t var imgSrc = _this5._getSrc(thumbnail) || imgHighResolution;\n\t\n\t var imageObj = new Image();\n\t imageObj.src = imgSrc;\n\t _this5._imageContainer = document.createElement('div');\n\t _this5._modalContainerDiv = document.createElement('div');\n\t _this5._closerContainerDiv = document.createElement('i');\n\t _this5._contentContainer = document.createElement('div');\n\t\n\t _this5._closerContainerDiv.className = 'modal-close modal-close-lightbox icon-cancel-1';\n\t _this5._closerContainerDiv.setAttribute(ATTR_CLOSE, ATTR_CLOSE);\n\t\n\t _this5._modalContainerDiv.className = 'modal image-modal';\n\t _this5._modalContainerDiv.appendChild(_this5._imageContainer);\n\t _this5._modalContainerDiv.appendChild(_this5._contentContainer);\n\t _this5._modalContainerDiv.appendChild(_this5._closerContainerDiv);\n\t _this5._contentContainer.className = 'content-container';\n\t _this5._isLoading = true;\n\t _this5._future = new Promise(function (resolve) {\n\t imageObj.addEventListener('load', function () {\n\t _this5._imageContainer.className = 'image-container';\n\t var img = document.createElement('img');\n\t // current image\n\t _this5.img = img;\n\t\n\t img.src = imgSrc;\n\t LightBox._setupMaxWidthHeight(target, img, imageObj);\n\t _this5._imageContainer.appendChild(img);\n\t _this5._imageContainer.style.backgroundImage = 'url(' + imgSrc + ')';\n\t\n\t resolve(self._modalContainerDiv);\n\t _this5._isLoading = false;\n\t\n\t if (_Settings2.default.isIE()) {\n\t self._resizeEvent = global.addEventListener('resize', function () {\n\t setTimeout(function () {\n\t self._imageContainer.style.height = img.offsetHeight + 'px';\n\t }, 0);\n\t });\n\t }\n\t\n\t if (self.options.registerPrevNextEvents) {\n\t self._setupPrevNextStates();\n\t // prev or next on touch/click\n\t self._imageContainer.addEventListener(_Settings2.default.getTabEvent(), function (e) {\n\t if (self.isLoading()) {\n\t return;\n\t }\n\t e.preventDefault();\n\t\n\t var ev = e;\n\t var pageX = global.TouchEvent && ev instanceof TouchEvent ? ev.changedTouches[0].pageX : ev.pageX;\n\t var rect = self._imageContainer.getBoundingClientRect();\n\t var imgX = rect.left;\n\t var wrapperWidth = rect.width;\n\t var posX = pageX - imgX;\n\t\n\t self.switchImageByDirection(wrapperWidth / 2 > posX).catch(function () {\n\t self._runOptionalClose();\n\t });\n\t });\n\t\n\t // register keyboard events\n\t self._keyboardNextEvent = function (e) {\n\t if (e.keyCode === KEY_NEXT || e.keyCode === KEY_PREV) {\n\t if (self.isLoading()) {\n\t return;\n\t }\n\t self.switchImageByDirection(e.keyCode === KEY_PREV).catch(function () {\n\t self._runOptionalClose();\n\t });\n\t }\n\t };\n\t global.addEventListener('keydown', self._keyboardNextEvent);\n\t } else {\n\t self._imageContainer.addEventListener(_Settings2.default.getTabEvent(), function () {\n\t self._runOptionalClose();\n\t });\n\t }\n\t\n\t self.highRes(thumbnail, imgHighResolution);\n\t });\n\t });\n\t\n\t _this5._future.then(function () {\n\t self._calculateContainer(_this5.img);\n\t });\n\t\n\t self._modalContainerDiv.addEventListener(_Modal.EVENT_MODAL_CLOSED, function () {\n\t // cleanup:\n\t _this5._modalContainerDiv.parentNode.removeChild(_this5._modalContainerDiv);\n\t _this5.options.onClose.apply(self);\n\t _this5._isOpen = false;\n\t _this5.modal.destroy();\n\t // unbind events\n\t if (_this5._keyboardNextEvent) {\n\t global.removeEventListener('keydown', self._keyboardNextEvent);\n\t }\n\t if (_this5._resizeEvent) {\n\t global.removeEventListener('resize', self._resizeEvent);\n\t }\n\t });\n\t\n\t return _this5._future;\n\t });\n\t\n\t this._nextFuture = this._future;\n\t\n\t if (self._widget) {\n\t this.modal = new _Modal2.default(this._modalAppend);\n\t // make sure we close stack before\n\t return this.modal.close().fromWidget(self._widget).then(function () {\n\t return self._future.then(function () {\n\t return self;\n\t });\n\t });\n\t }\n\t return false;\n\t }\n\t }], [{\n\t key: '_setupMaxWidthHeight',\n\t value: function _setupMaxWidthHeight(target, img, loadedImage) {\n\t var nextMaxWidth = target.getAttribute(ATTR_MAX_WIDTH);\n\t var nextMaxHeight = target.getAttribute(ATTR_MAX_HEIGHT);\n\t if (nextMaxWidth && nextMaxHeight) {\n\t img.style.maxWidth = nextMaxWidth + \"px\";\n\t img.style.maxHeight = nextMaxHeight + \"px\";\n\t } else {\n\t img.style.maxWidth = loadedImage.width + \"px\";\n\t img.style.maxHeight = loadedImage.height + \"px\";\n\t }\n\t }\n\t }]);\n\t\n\t return LightBox;\n\t}();\n\t\n\texports.default = LightBox;\n\t/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))\n\n/***/ },\n/* 15 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t/* WEBPACK VAR INJECTION */(function(global) {'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports.EVENT_TOGGLE = undefined;\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /*\n\t * The MIT License (MIT)\n\t *\n\t * Copyright (c) 2015 David Heidrich, BowlingX \n\t *\n\t * Permission is hereby granted, free of charge, to any person obtaining a copy\n\t * of this software and associated documentation files (the \"Software\"), to deal\n\t * in the Software without restriction, including without limitation the rights\n\t * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n\t * copies of the Software, and to permit persons to whom the Software is\n\t * furnished to do so, subject to the following conditions:\n\t *\n\t * The above copyright notice and this permission notice shall be included in\n\t * all copies or substantial portions of the Software.\n\t *\n\t * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n\t * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n\t * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n\t * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n\t * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n\t * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n\t * THE SOFTWARE.\n\t */\n\t\n\t/*!\n\t * FlexCss.OffCanvas\n\t * Licensed under the MIT License (MIT)\n\t * Copyright (c) 2015 David Heidrich, BowlingX \n\t */\n\t\n\tvar _Settings = __webpack_require__(2);\n\t\n\tvar _Settings2 = _interopRequireDefault(_Settings);\n\t\n\tvar _Util = __webpack_require__(1);\n\t\n\tvar _Util2 = _interopRequireDefault(_Util);\n\t\n\tvar _Event = __webpack_require__(3);\n\t\n\tvar _Event2 = _interopRequireDefault(_Event);\n\t\n\tvar _FixedWindow = __webpack_require__(7);\n\t\n\tvar _FixedWindow2 = _interopRequireDefault(_FixedWindow);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\t/**\n\t * @type {string}\n\t */\n\tvar ATTR_CLOSE_SIDEBAR = 'data-close-offcanvas';\n\t\n\t/**\n\t * @type {string}\n\t */\n\tvar ATTR_TARGET = 'data-offcanvas';\n\t/**\n\t * @type {string}\n\t */\n\tvar INIT_CLASS = 'init';\n\t/**\n\t * @type {string}\n\t */\n\tvar OPEN_CLASS = 'open';\n\t/**\n\t * @type {number}\n\t */\n\tvar HIDE_FACTOR = 3;\n\t\n\t/**\n\t * @type {string}\n\t */\n\tvar EVENT_TOGGLE = exports.EVENT_TOGGLE = 'flexcss.offcanvas.toggle';\n\t\n\t/**\n\t * A OffCanvas Implementation\n\t */\n\t\n\tvar OffCanvas = function () {\n\t\n\t /**\n\t * Creates an off-canvas navigation\n\t * @param {HTMLElement|String} NavigationId\n\t * @param {HTMLElement|String} Darkener\n\t * @param {int} factor positive will expect right sidebar, positive left\n\t * @param {bool} [disableTouch] if true all touch events are disabled\n\t * @constructor\n\t */\n\t\n\t function OffCanvas(NavigationId, Darkener, factor, disableTouch) {\n\t var _this = this;\n\t\n\t _classCallCheck(this, OffCanvas);\n\t\n\t var doc = global.document;\n\t var touchedX = 0;\n\t var navigationContainer = NavigationId instanceof HTMLElement ? NavigationId : doc.getElementById(NavigationId);\n\t var darkener = Darkener instanceof HTMLElement ? Darkener : doc.getElementById(Darkener);\n\t var DARKENER_CLASS_TOGGLE = 'toggle-' + darkener.id || 'darkener';\n\t var DARKENER_CLASS_INSTANT_TOGGLE = DARKENER_CLASS_TOGGLE + '-open';\n\t\n\t var shouldNotTouch = function shouldNotTouch() {\n\t return window.innerWidth >= _Settings2.default.get().smallBreakpoint;\n\t };\n\t\n\t if (!darkener || !navigationContainer) {\n\t throw new Error('Could not find needed elements (Darkener and/or NavigationId)');\n\t }\n\t\n\t this.darkener = darkener;\n\t this.darkenerClassToggle = DARKENER_CLASS_TOGGLE;\n\t this.darkenerClassToggleInstant = DARKENER_CLASS_INSTANT_TOGGLE;\n\t this.globalToggleClass = _Settings2.default.get().canvasToggledClass;\n\t\n\t this.navigationContainer = navigationContainer;\n\t this.navigationContainerId = navigationContainer.id;\n\t\n\t // create id if id does not exist\n\t if (!this.navigationContainerId) {\n\t this.navigationContainerId = _Util2.default.guid();\n\t navigationContainer.id = this.navigationContainerId;\n\t }\n\t\n\t if (!disableTouch) {\n\t navigationContainer.addEventListener('touchstart', function (e) {\n\t if (shouldNotTouch()) {\n\t return;\n\t }\n\t touchedX = e.touches[0].clientX;\n\t navigationContainer.mustHide = false;\n\t });\n\t navigationContainer.addEventListener('touchmove', function (e) {\n\t if (shouldNotTouch()) {\n\t return;\n\t }\n\t var clientX = e.touches[0].clientX;\n\t\n\t var target = navigationContainer;\n\t var style = target.style;\n\t var calcX = touchedX - clientX;\n\t var bounds = target.getBoundingClientRect();\n\t var compare = factor > 0 ? calcX <= 0 : calcX >= 0;\n\t if (compare) {\n\t style.transition = 'transform 0s ease';\n\t style.webkitTransition = '-webkit-transform 0s ease';\n\t target.mustHide = factor > 0 ? calcX * -1 > bounds.width / HIDE_FACTOR : calcX > bounds.width / HIDE_FACTOR;\n\t var transform = 'translate3d(' + calcX * -1 + 'px,0,0)';\n\t style.transform = transform;\n\t style.webkitTransform = transform;\n\t }\n\t });\n\t navigationContainer.addEventListener('touchend', function () {\n\t if (shouldNotTouch()) {\n\t return;\n\t }\n\t var target = navigationContainer;\n\t var style = target.style;\n\t if (target.mustHide) {\n\t var width = target.getBoundingClientRect().width * factor;\n\t style.transition = 'transform .2s ease';\n\t style.webkitTransition = '-webkit-transform .2s ease';\n\t var transform = 'translate3d(' + width + 'px,0,0)';\n\t style.transform = transform;\n\t style.webkitTransform = transform;\n\t _this._remove().then(function () {\n\t _this.resetTransform(style);\n\t });\n\t _this._removeInstant();\n\t } else {\n\t _this.resetTransform(style);\n\t }\n\t });\n\t }\n\t }\n\t\n\t /**\n\t * @param {Object} s\n\t */\n\t\n\t\n\t _createClass(OffCanvas, [{\n\t key: 'resetTransform',\n\t value: function resetTransform(s) {\n\t s.transform = '';\n\t s.transition = '';\n\t s.webkitTransform = '';\n\t s.webkitTransition = '';\n\t }\n\t\n\t /**\n\t * @param {Object} [event]\n\t * @private\n\t */\n\t\n\t }, {\n\t key: '_remove',\n\t value: function _remove(event) {\n\t var _this2 = this;\n\t\n\t return new Promise(function (resolve) {\n\t _Util2.default.addEventOnce(_Settings2.default.getTransitionEvent(), _this2.navigationContainer, function scheduler(e) {\n\t var _this3 = this;\n\t\n\t if (e.target !== this.navigationContainer) {\n\t return _Util2.default.addEventOnce(_Settings2.default.getTransitionEvent(), this.navigationContainer, scheduler.bind(this));\n\t }\n\t requestAnimationFrame(function () {\n\t OffCanvas.currentOpen = null;\n\t var docCls = global.document.documentElement.classList;\n\t docCls.remove(_this3.darkenerClassToggle);\n\t docCls.remove(_this3.globalToggleClass);\n\t if (!!event) {\n\t _Event2.default.dispatchAndFire(_this3.navigationContainer, EVENT_TOGGLE);\n\t }\n\t resolve();\n\t });\n\t }.bind(_this2));\n\t });\n\t }\n\t\n\t /**\n\t * @private\n\t */\n\t\n\t }, {\n\t key: '_removeInstant',\n\t value: function _removeInstant() {\n\t this.navigationContainer.classList.remove(OPEN_CLASS);\n\t global.document.documentElement.classList.remove(this.darkenerClassToggleInstant);\n\t this.darkener.classList.remove(INIT_CLASS);\n\t _FixedWindow2.default.getInstance().close();\n\t }\n\t\n\t /**\n\t * Toggles a an off-canvas element\n\t * @param [e]\n\t * @private\n\t */\n\t\n\t }, {\n\t key: 'toggle',\n\t value: function toggle(e) {\n\t var _this4 = this;\n\t\n\t if (e) {\n\t e.preventDefault();\n\t }\n\t this.resetTransform(this.navigationContainer.style);\n\t var darkenerClass = this.darkener.classList;\n\t var DARKENER_CLASS_TOGGLE = this.darkenerClassToggle;\n\t var DARKENER_CLASS_INSTANT_TOGGLE = this.darkenerClassToggleInstant;\n\t var navigationControllerClassList = this.navigationContainer.classList;\n\t if (!OffCanvas.currentOpen) {\n\t _Util2.default.addEventOnce(_Settings2.default.getTransitionEvent(), this.navigationContainer, function () {\n\t if (!!e) {\n\t _Event2.default.dispatchAndFire(_this4.navigationContainer, EVENT_TOGGLE);\n\t }\n\t });\n\t OffCanvas.currentOpen = this;\n\t _FixedWindow2.default.getInstance().open(this, this.navigationContainer);\n\t var docElementCls = global.document.documentElement.classList;\n\t docElementCls.add(this.globalToggleClass);\n\t docElementCls.add(DARKENER_CLASS_INSTANT_TOGGLE);\n\t docElementCls.add(DARKENER_CLASS_TOGGLE);\n\t darkenerClass.add(INIT_CLASS);\n\t navigationControllerClassList.add(OPEN_CLASS);\n\t } else {\n\t return this.close(e);\n\t }\n\t }\n\t }, {\n\t key: 'close',\n\t value: function close(event) {\n\t if (this.navigationContainer.classList.contains(OPEN_CLASS)) {\n\t var promise = this._remove(event);\n\t this._removeInstant();\n\t return promise;\n\t }\n\t return new Promise(function (r) {\n\t return r();\n\t });\n\t }\n\t\n\t /**\n\t * Register events\n\t * @param [delegate]\n\t */\n\t\n\t }, {\n\t key: 'registerEvents',\n\t value: function registerEvents(delegate) {\n\t var _this5 = this;\n\t\n\t var thisDelegate = delegate || global.document;\n\t _FixedWindow2.default.getInstance().addScreenConstraint(OffCanvas, function (width) {\n\t return width < _Settings2.default.get().smallBreakpoint;\n\t });\n\t thisDelegate.addEventListener(_Settings2.default.getTabEvent(), function (e) {\n\t if (OffCanvas.currentOpen && OffCanvas.currentOpen !== _this5) {\n\t return;\n\t }\n\t var id = _this5.navigationContainerId;\n\t var validTarget = e.target.getAttribute(ATTR_TARGET) === id;\n\t if (!_Util2.default.isPartOfNode(e.target, _this5.navigationContainer)) {\n\t if (validTarget || OffCanvas.currentOpen === _this5 && e.target === _this5.darkener) {\n\t _this5.toggle(e);\n\t }\n\t } else {\n\t if (e.target.hasAttribute(ATTR_CLOSE_SIDEBAR)) {\n\t _this5.toggle(e);\n\t }\n\t }\n\t });\n\t }\n\t }]);\n\t\n\t return OffCanvas;\n\t}();\n\t\n\tOffCanvas.currentOpen = null;\n\t\n\texports.default = OffCanvas;\n\t/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))\n\n/***/ },\n/* 16 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t/* WEBPACK VAR INJECTION */(function(global) {'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports.EVENT_TAB_OPENED = exports.EVENT_TAB_CLOSED = undefined;\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /*\n\t * The MIT License (MIT)\n\t *\n\t * Copyright (c) 2015 David Heidrich, BowlingX \n\t *\n\t * Permission is hereby granted, free of charge, to any person obtaining a copy\n\t * of this software and associated documentation files (the \"Software\"), to deal\n\t * in the Software without restriction, including without limitation the rights\n\t * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n\t * copies of the Software, and to permit persons to whom the Software is\n\t * furnished to do so, subject to the following conditions:\n\t *\n\t * The above copyright notice and this permission notice shall be included in\n\t * all copies or substantial portions of the Software.\n\t *\n\t * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n\t * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n\t * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n\t * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n\t * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n\t * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n\t * THE SOFTWARE.\n\t */\n\t\n\t/*!\n\t * FlexCss.Toggleable\n\t * Licensed under the MIT License (MIT)\n\t * Copyright (c) 2015 David Heidrich, BowlingX \n\t */\n\t\n\tvar _Settings = __webpack_require__(2);\n\t\n\tvar _Settings2 = _interopRequireDefault(_Settings);\n\t\n\tvar _Widget = __webpack_require__(4);\n\t\n\tvar _Widget2 = _interopRequireDefault(_Widget);\n\t\n\tvar _Util = __webpack_require__(1);\n\t\n\tvar _Util2 = _interopRequireDefault(_Util);\n\t\n\tvar _Event = __webpack_require__(3);\n\t\n\tvar _Event2 = _interopRequireDefault(_Event);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\t/**\n\t * Event that is fired when a tab is closed\n\t * @type {string}\n\t */\n\t\n\tvar EVENT_TAB_CLOSED = exports.EVENT_TAB_CLOSED = 'flexcss.tab.closed';\n\t\n\t/**\n\t * Event that is fired when a tab has been opened\n\t * @type {string}\n\t */\n\tvar EVENT_TAB_OPENED = exports.EVENT_TAB_OPENED = 'flexcss.tab.opened';\n\t/**\n\t * @type {string}\n\t */\n\tvar ATTR_NAME = 'data-toggle';\n\t/**\n\t * @type {string}\n\t */\n\tvar ACTIVE_CLASS = 'active';\n\t/**\n\t * @type {string}\n\t */\n\tvar LOADING_CLASS = 'loading';\n\t\n\t/**\n\t * @type {string}\n\t */\n\tvar ATTR_TOGGLE_LIST = 'data-toggle-list';\n\t\n\t/**\n\t * Creates a toggleable element, either for tabs or a single toggle\n\t */\n\t\n\tvar Toggleable = function () {\n\t function Toggleable(ContainerId) {\n\t _classCallCheck(this, Toggleable);\n\t\n\t var doc = global.document;\n\t\n\t this.container = ContainerId instanceof HTMLElement ? ContainerId : doc.getElementById(ContainerId);\n\t\n\t this.loading = false;\n\t\n\t if (!this.container) {\n\t throw new Error('Toggleable container with id ' + ContainerId + ' not found');\n\t }\n\t }\n\t\n\t /**\n\t * Listener\n\t * @param {Event} e\n\t * @private\n\t */\n\t\n\t\n\t _createClass(Toggleable, [{\n\t key: '_listener',\n\t value: function _listener(e) {\n\t var target = e.target;\n\t var parent = target.parentNode;\n\t var doc = global.document;\n\t\n\t // support target child element to clicked\n\t if (!target.hasAttribute(ATTR_NAME)) {\n\t if (parent && parent.hasAttribute(ATTR_NAME)) {\n\t target = parent;\n\t } else {\n\t return;\n\t }\n\t }\n\t\n\t if (!target.hasAttribute(ATTR_NAME)) {\n\t return;\n\t }\n\t\n\t var refId = target.getAttribute(ATTR_NAME);\n\t var ref = doc.getElementById(refId);\n\t\n\t e.preventDefault();\n\t\n\t if (this.loading) {\n\t return;\n\t }\n\t\n\t this.toggleTarget(ref, target);\n\t }\n\t\n\t /**\n\t * Registers Events for this instance\n\t * @returns {Toggleable}\n\t */\n\t\n\t }, {\n\t key: 'registerEvents',\n\t value: function registerEvents() {\n\t this.container.addEventListener(_Settings2.default.getTabEvent(), this._listener.bind(this));\n\t return this;\n\t }\n\t\n\t /**\n\t * Toggles given `ref`\n\t * @param {HTMLElement|Node} ref\n\t * @param {HTMLElement|Node} [selfTarget] optional target node\n\t */\n\t\n\t }, {\n\t key: 'toggleTarget',\n\t value: function toggleTarget(ref, selfTarget) {\n\t var _this = this;\n\t\n\t var target = selfTarget;\n\t if (!target && !ref) {\n\t return;\n\t }\n\t if (!target) {\n\t target = document.querySelector('[' + ATTR_NAME + '=\"' + ref.id + '\"]');\n\t }\n\t\n\t var future = void 0;\n\t var elClassList = target.classList;\n\t var parent = target.parentNode;\n\t var doc = global.document;\n\t\n\t future = new Promise(function (resolve, failure) {\n\t if (ref) {\n\t resolve(ref);\n\t } else {\n\t var widget = _Widget2.default.findWidget(target);\n\t var async = widget ? widget.getAsync() : null;\n\t if (_Widget2.default.isWidget(widget) && async) {\n\t future = async.then(function (r) {\n\t if (r instanceof HTMLElement) {\n\t var id = _Util2.default.guid();\n\t r.id = id;\n\t target.setAttribute(ATTR_NAME, id);\n\t resolve(r);\n\t } else {\n\t throw new Error('Dynamically creating toggle-content is not supported right now.\\n Return an HTMLElement instance');\n\t }\n\t });\n\t } else {\n\t failure('Target not given');\n\t }\n\t }\n\t });\n\t\n\t if (parent) {\n\t var maybeToggleNode = _Util2.default.parentsUntil(target, function (node) {\n\t return node && node.hasAttribute && node.hasAttribute(ATTR_TOGGLE_LIST);\n\t });\n\t\n\t var parentClassList = parent.classList;\n\t // Abort if element is already active and if is part of a toggle list\n\t if (maybeToggleNode) {\n\t if (!parentClassList.contains(ACTIVE_CLASS)) {\n\t parentClassList.toggle(ACTIVE_CLASS);\n\t parentClassList.add(LOADING_CLASS);\n\t } else {\n\t return;\n\t }\n\t }\n\t\n\t if (maybeToggleNode) {\n\t for (var i = 0; i < maybeToggleNode.children.length; i++) {\n\t var n = maybeToggleNode.children[i];\n\t var targetRef = n.children[0];\n\t if (n !== parent) {\n\t n.classList.remove(ACTIVE_CLASS);\n\t if (targetRef) {\n\t var attr = targetRef.getAttribute(ATTR_NAME);\n\t var el = attr ? doc.getElementById(attr) : null;\n\t if (el) {\n\t _Event2.default.dispatchAndFire(el, EVENT_TAB_CLOSED);\n\t el.classList.remove(ACTIVE_CLASS);\n\t targetRef.classList.remove(ACTIVE_CLASS);\n\t }\n\t }\n\t }\n\t }\n\t }\n\t }\n\t if (elClassList) {\n\t elClassList.toggle(ACTIVE_CLASS);\n\t elClassList.add(LOADING_CLASS);\n\t }\n\t this.loading = true;\n\t future.then(function (r) {\n\t _Event2.default.dispatchAndFire(r, EVENT_TAB_OPENED);\n\t Toggleable._handleLoaded(target);\n\t r.classList.toggle(ACTIVE_CLASS);\n\t _this.loading = false;\n\t }).catch(function () {\n\t _this.loading = false;\n\t Toggleable._handleLoaded(target);\n\t });\n\t }\n\t\n\t /**\n\t * @param el\n\t * @private\n\t */\n\t\n\t }], [{\n\t key: '_handleLoaded',\n\t value: function _handleLoaded(el) {\n\t var parentClassList = el.parentNode.classList;\n\t el.classList.remove(LOADING_CLASS);\n\t if (parentClassList) {\n\t parentClassList.remove(LOADING_CLASS);\n\t }\n\t }\n\t }]);\n\t\n\t return Toggleable;\n\t}();\n\t\n\texports.default = Toggleable;\n\t/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))\n\n/***/ },\n/* 17 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports.LightBox = exports.Dropdown = exports.OffCanvas = exports.Toggleable = exports.Util = exports.Settings = exports.Widget = exports.Modal = exports.Tooltip = exports.Form = undefined;\n\t\n\tvar _Form = __webpack_require__(9);\n\t\n\tvar _Form2 = _interopRequireDefault(_Form);\n\t\n\tvar _Tooltip = __webpack_require__(6);\n\t\n\tvar _Tooltip2 = _interopRequireDefault(_Tooltip);\n\t\n\tvar _Modal = __webpack_require__(8);\n\t\n\tvar _Modal2 = _interopRequireDefault(_Modal);\n\t\n\tvar _Widget = __webpack_require__(4);\n\t\n\tvar _Widget2 = _interopRequireDefault(_Widget);\n\t\n\tvar _Settings = __webpack_require__(2);\n\t\n\tvar _Settings2 = _interopRequireDefault(_Settings);\n\t\n\tvar _Toggleable = __webpack_require__(16);\n\t\n\tvar _Toggleable2 = _interopRequireDefault(_Toggleable);\n\t\n\tvar _OffCanvas = __webpack_require__(15);\n\t\n\tvar _OffCanvas2 = _interopRequireDefault(_OffCanvas);\n\t\n\tvar _Dropdown = __webpack_require__(13);\n\t\n\tvar _Dropdown2 = _interopRequireDefault(_Dropdown);\n\t\n\tvar _LightBox = __webpack_require__(14);\n\t\n\tvar _LightBox2 = _interopRequireDefault(_LightBox);\n\t\n\tvar _Util = __webpack_require__(1);\n\t\n\tvar _Util2 = _interopRequireDefault(_Util);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\texports.Form = _Form2.default;\n\texports.Tooltip = _Tooltip2.default;\n\texports.Modal = _Modal2.default;\n\texports.Widget = _Widget2.default;\n\texports.Settings = _Settings2.default;\n\texports.Util = _Util2.default;\n\texports.Toggleable = _Toggleable2.default;\n\texports.OffCanvas = _OffCanvas2.default;\n\texports.Dropdown = _Dropdown2.default;\n\texports.LightBox = _LightBox2.default;\n\n/***/ }\n/******/ ])\n});\n;\n\n\n/** WEBPACK FOOTER **\n ** js/flexcss.min.js\n **/"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"../\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n/** WEBPACK FOOTER **\n ** webpack/bootstrap a32af781d3d6caa30484\n **/","/*\n * The MIT License (MIT)\n *\n * Copyright (c) 2015 David Heidrich, BowlingX \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nconst PFX = [\"webkit\", \"moz\", \"MS\", \"o\", \"\"];\n\nconst COL_LEFT_CLASS = 'is-collision-left';\n\nconst COL_RIGHT_CLASS = 'is-collision-right';\n\nconst COL_BOTTOM_CLASS = 'is-collision-bottom';\n\n/**\n * Provides shared DOM-Utility functions\n */\nclass Util {\n\n /**\n * Will register the right animation event based on browser\n * @param element\n * @param type\n * @param callback\n */\n static prefixedAnimateEvent(element, type, callback) {\n const thisFunction = function thisFunction(e) {\n callback.apply(element, [e, thisFunction]);\n };\n\n for (let p = 0; p < PFX.length; p++) {\n let thisType = type;\n if (!PFX[p]) {\n thisType = type.toLowerCase();\n }\n const name = PFX[p] + thisType;\n element.addEventListener(name, thisFunction, true);\n }\n }\n\n /**\n * Get correct transitionend event\n * @returns {String}\n * @private\n */\n static whichTransitionEndEvent() {\n let t;\n const el = document.createElement('fake');\n\n const transitions = {\n transition: 'transitionend',\n OTransition: 'oTransitionEnd',\n MozTransition: 'transitionend',\n WebkitTransition: 'webkitTransitionEnd'\n };\n\n for (t in transitions) {\n if (el.style[t] !== undefined) {\n return transitions[t];\n }\n }\n }\n\n /**\n * Check if target is part of parent node\n * @param target\n * @param parent\n * @returns {boolean}\n */\n static isPartOfNode(target, parent) {\n if (!target || !parent) {\n return false;\n }\n let now = target;\n while (now !== parent && now !== null) {\n if (now === parent) {\n break;\n }\n now = now.parentNode;\n }\n return now !== null;\n }\n\n /**\n * Finds the closest element including itself matching a callback\n * @param {Node} el\n * @param {Function} callback\n * @returns {Node|boolean}\n */\n static closestCallback(el, callback) {\n let element = el;\n while (element !== null) {\n if (callback(element)) {\n return element;\n }\n element = element.parentNode;\n }\n return false;\n }\n\n /**\n * Walks the tree until func returns true for given argument\n * @param target\n * @param func\n * @returns {boolean|HTMLElement}\n */\n static parentsUntil(target, func) {\n if (!target) {\n return false;\n }\n let now = target;\n while (!func(now) && now !== null) {\n now = now.parentNode;\n }\n\n return now;\n }\n\n /**\n * Generates a unique id\n * @return {String}\n */\n static guid() {\n function s4() {\n return Math.floor((1 + Math.random()) * 0x10000)\n .toString(16)\n .substring(1);\n }\n\n return `${s4() + s4()}-${s4()}-${s4()}-${s4()}-${s4() + s4() + s4()}`;\n }\n\n /**\n * Detects scrollbar width\n * @see http://stackoverflow.com/questions/986937/how-can-i-get-the-browsers-scrollbar-sizes\n * @returns {number}\n */\n static getScrollBarWidth() {\n const doc = global.document;\n const inner = doc.createElement('p');\n\n inner.style.width = \"100%\";\n inner.style.height = \"200px\";\n\n const outer = doc.createElement('div');\n outer.style.position = \"absolute\";\n outer.style.top = \"0px\";\n outer.style.left = \"0px\";\n outer.style.visibility = \"hidden\";\n outer.style.width = \"200px\";\n outer.style.height = \"150px\";\n outer.style.overflow = \"hidden\";\n outer.appendChild(inner);\n\n doc.body.appendChild(outer);\n const w1 = inner.offsetWidth;\n outer.style.overflow = 'scroll';\n let w2 = inner.offsetWidth;\n if (w1 === w2) {\n w2 = outer.clientWidth;\n }\n doc.body.removeChild(outer);\n\n return (w1 - w2);\n }\n\n\n /**\n * Run an event once\n * @param {String} ev\n * @param {HTMLElement|HTMLDocument} target\n * @param {Function} func\n * @param {boolean} [capture]\n * @return Function created listener\n */\n static addEventOnce(ev, target, func, capture) {\n const thisFunction = function thisFunction(event) {\n func(event, func);\n target.removeEventListener(ev, thisFunction, capture);\n };\n target.addEventListener(ev, thisFunction, capture);\n return thisFunction;\n }\n\n /**\n * Checks if an element is visible\n * @param {HTMLElement} element\n * @returns bool\n */\n static isVisible(element) {\n return element.offsetWidth > 0 && element.offsetHeight > 0;\n }\n\n /**\n * Creates a camelCaseRepresentation of a dashed string\n * @param {String} str\n * @returns String\n */\n static dashToCamelCase(str) {\n return str.replace(/-([a-z])/g, (g) => {\n return g[1].toUpperCase();\n });\n }\n\n /**\n * Creates a copy of `input`\n * @param {*} input\n * @return *\n */\n static copy(input) {\n return JSON.parse(JSON.stringify(input));\n }\n\n /**\n * Reads options from element (data attributes) and applies to base\n * @param {HTMLElement} element\n * @param {Object} base\n * @return {Object}\n */\n static applyOptionsFromElement(element, base) {\n if (!element) {\n return base;\n }\n const attrs = element.attributes;\n for (let i = 0; i < attrs.length; i++) {\n const attr = attrs[i];\n if (attr) {\n const s = Util.dashToCamelCase(attr.nodeName.replace('data-', ''));\n const val = attr.nodeValue;\n if (base.hasOwnProperty(s)) {\n // skip functions\n if (typeof base[s] === 'function') {\n continue;\n }\n if (typeof base[s] === 'boolean') {\n base[s] = parseInt(val || 1, 10) === 1;\n } else {\n base[s] = val;\n }\n }\n }\n }\n return base;\n }\n\n /**\n * Will position an element directly at given target\n * Is aware of a given collision container to detect edges\n * Will put elementToPosition either to left, center or right edge (prefer right)\n * and either to bottom or top (prefers bottom)\n *\n * You may overwrite preferred positioned with `centerHorizontal` and `positionTop`\n *\n * @param {HTMLElement|ClientRect} target the target container to align to\n * @param {HTMLElement} elementToPosition the element to position\n * @param {HTMLElement} collisionContainer the outer container to prevent collisions\n * @param {boolean} [centerHorizontal] set true to center element, otherwise it's put on the right border by default\n * @param {boolean} [positionTop] flip top, by default element is positioned to the bottom.\n * @returns {HTMLElement}\n */\n static setupPositionNearby(target, elementToPosition, collisionContainer, centerHorizontal, positionTop) {\n // determine relative offsets\n let amountTop = 0;\n let amountLeft = 0;\n Util.parentsUntil(target.parentNode, (el) => {\n if (!(el instanceof HTMLElement)) {\n return false;\n }\n const style = window.getComputedStyle(el);\n if (Util.isPartOfNode(elementToPosition, el)) {\n if (style && style.position === 'relative') {\n amountTop += el.offsetTop || 0;\n amountLeft += el.offsetLeft || 0;\n }\n return false;\n }\n return true;\n });\n\n const targetPosition = target instanceof HTMLElement ? target.getBoundingClientRect() : target;\n const elementRect = elementToPosition.getBoundingClientRect();\n const colRect = collisionContainer.getBoundingClientRect();\n const targetTop = targetPosition.top - amountTop;\n const targetRight = targetPosition.right;\n const isCollisionTop = (targetTop - elementRect.height) <= 0;\n const isCollisionBottom =\n window.innerHeight < (targetTop + amountTop + targetPosition.height + elementRect.height);\n const isCollisionLeft = targetRight < elementRect.width;\n const targetLeft = targetPosition.left;\n const isCollisionRight = (targetLeft + elementRect.width) > colRect.width;\n const classList = elementToPosition.classList;\n\n classList.remove(COL_RIGHT_CLASS);\n classList.remove(COL_LEFT_CLASS);\n classList.remove(COL_BOTTOM_CLASS);\n\n let calcTop;\n let calcLeft;\n if (isCollisionLeft && !isCollisionRight) {\n // put element to left if collision with left\n calcLeft = `${(targetPosition.left - colRect.left - amountLeft)}px`;\n classList.add(COL_LEFT_CLASS);\n } else {\n // maybe center if no collision with either side\n const rightPosition = `${(targetRight - elementRect.width - colRect.left - amountLeft)}px`;\n const leftCentered = ((targetLeft + targetPosition.width / 2) -\n (elementRect.width / 2) || 0) - colRect.left;\n const collisionCentered = (leftCentered + elementRect.width) > colRect.width;\n if (centerHorizontal && !collisionCentered) {\n calcLeft = `${leftCentered}px`;\n } else {\n classList.add(COL_RIGHT_CLASS);\n calcLeft = rightPosition;\n }\n }\n\n if (isCollisionBottom || (positionTop && !isCollisionTop)) {\n // Put Element on top if collision\n calcTop = `${(targetTop - elementRect.height) - colRect.top}px`;\n classList.add(COL_BOTTOM_CLASS);\n } else {\n calcTop = `${(targetTop + targetPosition.height) - colRect.top}px`;\n }\n\n elementToPosition.style.cssText = `top:${calcTop};left:${calcLeft};`;\n\n return elementToPosition;\n }\n\n /**\n * Brings a given element into viewport\n * @param {HTMLElement} el\n * @param {int|function}[optionalOffset]\n */\n static scrollToElement(el, optionalOffset) {\n el.scrollIntoView();\n let thisOffset = optionalOffset;\n // optionally use a additional scrollDif\n if (thisOffset) {\n if (typeof thisOffset === 'function') {\n thisOffset = optionalOffset();\n }\n if (thisOffset > 0) {\n const scrolledY = window.pageYOffset;\n if (scrolledY) {\n window.scroll(0, scrolledY - thisOffset);\n }\n }\n }\n }\n}\n\nexport default Util;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/main/util/Util.js\n **/","/*\n * The MIT License (MIT)\n *\n * Copyright (c) 2015 David Heidrich, BowlingX \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\nimport Util from './Util';\n\n// we attach global settings to global once because settings might be shared a lot of times trough the application\n// Maybe find a better way to handle that scenario\nif (!global.FLEXCSS_GLOBAL_SETTINGS) {\n global.FLEXCSS_GLOBAL_SETTINGS = {\n // defined breakpoint for small devices < n\n smallBreakpoint: 768,\n // nodes that should be updated when no scrollbar is expected\n scrollbarUpdateNodes: global.document.body !== null ? [global.document.body] : [],\n // additional Delay until darkener is fully hidden\n darkenerFadeDelay: 100,\n // class that is added if canvas has been toggled\n canvasToggledClass: 'toggled-canvas'\n };\n\n global.FLEXCSS_CONST_IS_IOS = null;\n\n global.FLEXCSS_CONST_IS_TOUCH = null;\n\n global.FLEXCSS_CONST_IS_IE = null;\n\n global.FLEXCSS_CONST_TAB_EVENT = 'click';\n\n global.FLEXCSS_IS_SMALL_SCREEN = false;\n\n const init = () => {\n // Measure scrollbar width\n global.FLEXCSS_CONST_SCROLLBAR_WIDTH = Util.getScrollBarWidth();\n // detect right transition end event\n global.FLEXCSS_CONST_TRANSITION_EVENT = Util.whichTransitionEndEvent();\n };\n\n if (global.document.readyState !== 'loading') {\n init();\n } else {\n // it's possible that global.document.body is not available if the document is not\n // loaded completely\n document.addEventListener('DOMContentLoaded', () => {\n init();\n });\n }\n}\n\n/**\n * Utility class that setups global settings\n */\nclass Settings {\n\n /**\n * Setup global settings, overwrite default values\n * @param {Object} settings\n */\n static setup(settings) {\n Object.assign(global.FLEXCSS_GLOBAL_SETTINGS, settings);\n }\n\n /**\n * Access to global settings\n * @returns {Object}\n */\n static get() {\n return global.FLEXCSS_GLOBAL_SETTINGS;\n }\n\n /**\n * Detects a IOS Device, caches subsequent calls\n * @returns {boolean}\n */\n static isIosDevice() {\n if (!global.FLEXCSS_CONST_IS_IOS) {\n global.FLEXCSS_CONST_IS_IOS = global.navigator.userAgent.match(/(iPad|iPhone|iPod)/i);\n }\n\n return global.FLEXCSS_CONST_IS_IOS;\n }\n\n /**\n * @returns {boolean}\n */\n static isSmallScreen() {\n return window.innerWidth < Settings.get().smallBreakpoint;\n }\n\n /**\n * Detects a touch device, caches subsequent calls\n * @returns {boolean}\n */\n static isTouchDevice() {\n if (!global.FLEXCSS_CONST_IS_TOUCH) {\n global.FLEXCSS_CONST_IS_TOUCH = 'ontouchstart' in window || !!(global.navigator.msMaxTouchPoints);\n }\n return global.FLEXCSS_CONST_IS_TOUCH;\n }\n\n /**\n * Checks if current browser is Internet Explorer\n * @returns {boolean|*}\n */\n static isIE() {\n if (!global.FLEXCSS_CONST_IS_IE) {\n global.FLEXCSS_CONST_IS_IE = \"ActiveXObject\" in window;\n }\n return global.FLEXCSS_CONST_IS_IE;\n }\n\n /**\n * @returns {String}\n */\n static getTransitionEvent() {\n return global.FLEXCSS_CONST_TRANSITION_EVENT;\n }\n\n /**\n * @returns {int}\n */\n static getScrollbarWidth() {\n return global.FLEXCSS_CONST_SCROLLBAR_WIDTH;\n }\n\n /**\n * @returns {String}\n */\n static getTabEvent() {\n return global.FLEXCSS_CONST_TAB_EVENT;\n }\n}\n\nexport default Settings;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/main/util/Settings.js\n **/","/* global CustomEvent */\n\n/*\n * The MIT License (MIT)\n *\n * Copyright (c) 2015 David Heidrich, BowlingX \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n// polyfill for custom events to make thinks work in IE\n// The needed polyfill is so small that I embedded it here\n(function poly() {\n if (!global.CustomEvent || typeof global.CustomEvent !== 'function') {\n const CustomEvent = function CustomEvent(event, params) {\n const thisParams = params ||\n {\n bubbles: false,\n cancelable: false,\n detail: undefined\n };\n const evt = document.createEvent(\"CustomEvent\");\n evt.initCustomEvent(event, thisParams.bubbles,\n thisParams.cancelable, thisParams.detail);\n return evt;\n };\n CustomEvent.prototype = global.Event.prototype;\n global.CustomEvent = CustomEvent;\n }\n})();\n/**\n * Simpler Event dispatching\n */\nclass EventHandler {\n\n /**\n * @param {HTMLElement} target\n * @param {String} name\n */\n constructor(target, name) {\n this.target = target;\n this.defaultOptions = {\n bubbles: true,\n cancelable: true\n };\n\n this.name = name;\n }\n\n /**\n * Set more options\n * @param {Object} options\n * @returns {EventHandler}\n */\n withOptions(options) {\n Object.assign(this.defaultOptions, (options || {}));\n return this;\n }\n\n /**\n * Call with the originalEvent\n * @param {Event} e\n * @returns {EventHandler}\n */\n withOriginal(e) {\n return this.withDetail({\n originalEvent: e\n });\n }\n\n /**\n * Extends the detail part of the event\n * @param {Object} o\n * @returns {EventHandler}\n */\n withDetail(o) {\n if (!this.defaultOptions.detail) {\n this.defaultOptions.detail = {};\n }\n Object.assign(this.defaultOptions.detail, o);\n return this;\n }\n\n /**\n * @returns {CustomEvent}\n */\n fire() {\n const e = new CustomEvent(this.name, this.defaultOptions);\n if (this.target) {\n this.target.dispatchEvent(e);\n }\n return e;\n }\n}\n\nclass Event {\n /**\n * Prepares to dispatch a custom event (without firing)\n * @param {HTMLElement} target\n * @param {String} name\n * @returns {EventHandler}\n */\n static dispatch(target, name) {\n return new EventHandler(target, name);\n }\n\n /**\n * Dispatches a custom event and fires it directly\n * @param {HTMLElement} target\n * @param {String} name\n * @param {Object} [options]\n * @returns {CustomEvent}\n */\n static dispatchAndFire(target, name, options) {\n return new EventHandler(target, name).withOptions(options).fire();\n }\n}\n\nexport default Event;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/main/util/Event.js\n **/","/*\n * The MIT License (MIT)\n *\n * Copyright (c) 2015 David Heidrich, BowlingX \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n/*!\n * FlexCss.Widget\n * Licensed under the MIT License (MIT)\n * Copyright (c) 2015 David Heidrich, BowlingX \n */\n\n/**\n * A Widget provides async content on a specific target (e.g. a modal link)\n */\nclass Widget {\n\n /**\n * Creates a new Widget\n * @param [element], optional define the content of widget\n */\n constructor(element) {\n /**\n *\n * @type {Promise}\n */\n this.asyncContent = null;\n\n /**\n * @type {boolean}\n */\n this._isWidget = true;\n\n if (element) {\n /**\n * @type {HTMLElement}\n */\n this.element = element instanceof HTMLElement ? element : global.document.getElementById(element);\n if (this.element) {\n this.element.hfWidgetInstance = this;\n this.setAsync(() => {\n return new Promise((s) => {\n s(this.element);\n });\n });\n } else {\n throw new Error(`Could not found element with ID: ${element}`);\n }\n }\n /**\n * The final resulted content that a widget did create (e.g. a modal container)\n * @type {HTMLElement}\n */\n this.finalContent = null;\n }\n\n /**\n *\n * @returns {Promise}\n */\n getAsync() {\n return this.asyncContent();\n }\n\n /**\n * @param {Function.} async\n * @returns {Widget}\n */\n setAsync(async) {\n this.asyncContent = async;\n return this;\n }\n\n /**\n * @returns {HTMLElement}\n */\n getFinalContent() {\n return this.finalContent;\n }\n\n /**\n * @param {HTMLElement} element\n * @returns {Widget}\n */\n setElement(element) {\n this.element = element;\n return this;\n }\n\n /**\n * Destroys the generated content of this widget\n * @returns {boolean}\n */\n destroy() {\n if (this.finalContent && this.finalContent.parentNode) {\n this.finalContent.parentNode.removeChild(this.finalContent);\n return true;\n }\n\n delete this.element;\n delete this.asyncContent;\n delete this.finalContent;\n\n return false;\n }\n\n /**\n * Will find a widget on an Element\n * @param {HTMLElement} element\n * @returns {Widget|undefined}\n */\n static findWidget(element) {\n return element ? element.hfWidgetInstance : undefined;\n }\n\n /**\n * Checks if a given object is an instance\n * @param {Object} self\n * @returns {boolean}\n */\n static isWidget(self) {\n return self instanceof Widget || typeof self === 'object' && self.hasOwnProperty('_isWidget');\n }\n}\n\nexport default Widget;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/main/Widget.js\n **/","/*\n * The MIT License (MIT)\n *\n * Copyright (c) 2015 David Heidrich, BowlingX \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n/**\n * Provides a Basic Widget\n */\nclass DestroyableWidget {\n\n constructor() {\n this.listeners = [];\n }\n\n /**\n * Destroys a Widget\n */\n destroy() {\n this.listeners.forEach((listener) => {\n listener.element.removeEventListener.apply(listener.element, listener.args);\n });\n this.listeners = [];\n }\n\n /**\n * Adds an event and registers it later to remove bindings\n * @param {HTMLElement} element\n * @param {String} name\n * @param {Function} listener\n * @param {boolean} [capture]\n * @returns {Function}\n */\n addEventListener(element, name, listener, capture) {\n this.listeners.push({\n element,\n args: [name, listener, capture]\n });\n\n element.addEventListener(name, listener, capture);\n return listener;\n }\n\n}\n\nexport default DestroyableWidget;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/main/DestroyableWidget.js\n **/","/*\n * The MIT License (MIT)\n *\n * Copyright (c) 2015 David Heidrich, BowlingX \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n/*!\n * FlexCss.Tooltip\n * Licensed under the MIT License (MIT)\n * Copyright (c) 2015 David Heidrich, BowlingX \n */\n\nimport Util from './util/Util';\nimport DestroyableWidget from './DestroyableWidget';\nimport Settings from './util/Settings';\n\n/**\n * @type {string}\n */\nconst CLASS_NAMES_TOOLTIP = 'tooltip-container';\n/**\n * @type {string}\n */\nconst CLASS_NAMES_OPEN = 'open';\n\n/**\n * @type {string}\n */\nconst ATTR_DATA_CLASSNAME = 'data-class';\n\n/**\n * @type {string}\n */\nconst ATTR_DATA_NO_TOUCH = 'data-no-touch';\n\n/**\n * @type {HTMLDocument}\n */\nconst doc = global.document;\n\n/**\n * Simple Tooltip\n */\nclass Tooltip extends DestroyableWidget {\n\n /**\n * Creates a Tooltip\n * @param {HTMLElement|String} DelegateContainer\n * @param {Object} [options]\n */\n constructor(DelegateContainer, options) {\n super();\n /**\n * The Container where possible events are captured\n */\n this.container = DelegateContainer instanceof HTMLElement ?\n DelegateContainer : doc.getElementById(DelegateContainer);\n\n if (!this.container) {\n throw new Error('Could not create Tooltip, DelegateContainer not found');\n }\n\n /**\n * The Container where tooltips are stored for this instance\n * @type {HTMLElement}\n */\n this.tooltipContainer = null;\n\n /**\n * Default Options\n */\n this.options = {\n containerClass: '',\n selectorAttribute: 'data-tooltip',\n collisionContainer: this.container\n };\n\n Object.assign(this.options, options || {});\n }\n\n /**\n * Creates and shows a tooltip\n * @param {HTMLElement} target where is this tooltip positioned\n * @param {String} text text content in tooltip, will be NOT escaped\n * @param {Boolean} [removeTitle] removes title element if given\n * @param {Node} [positionRelative]\n */\n createTooltip(target, text, removeTitle, positionRelative) {\n // abort if text is empty\n if (!text || text && text.trim() === '') {\n return;\n }\n\n if (Settings.isTouchDevice() && target && target.hasAttribute(ATTR_DATA_NO_TOUCH)) {\n return;\n }\n\n let tooltipContainer = this.tooltipContainer;\n\n if (!tooltipContainer) {\n tooltipContainer = doc.createElement('div');\n this.container.appendChild(tooltipContainer);\n this.tooltipContainer = tooltipContainer;\n }\n this._restoreClassNames(tooltipContainer, target);\n\n tooltipContainer.style.left = 'auto';\n tooltipContainer.style.top = 'auto';\n tooltipContainer.innerHTML = text;\n tooltipContainer.flexTooltipCurrentTarget = target;\n if (removeTitle) {\n target.oldTitle = text;\n target.removeAttribute('title');\n }\n\n Util.setupPositionNearby(positionRelative || target, tooltipContainer,\n this.options.collisionContainer, true, true);\n\n tooltipContainer.classList.add(CLASS_NAMES_OPEN);\n }\n\n _restoreClassNames(container, target) {\n // allow additional classname per tooltip on target element\n const classNames = [CLASS_NAMES_TOOLTIP, this.options.containerClass];\n const maybeTargetClass = target.getAttribute(ATTR_DATA_CLASSNAME);\n if (maybeTargetClass) {\n classNames.push(maybeTargetClass);\n }\n container.className = classNames.join(\" \");\n return this;\n }\n\n /**\n * @returns {HTMLElement|null}\n */\n getCurrentTarget() {\n return this.tooltipContainer ? this.tooltipContainer.flexTooltipCurrentTarget : null;\n }\n\n /**\n * Destroys this Widget\n * @returns {boolean}\n */\n destroy() {\n super.destroy();\n\n if (this.tooltipContainer) {\n this.tooltipContainer.parentNode.removeChild(this.tooltipContainer);\n return true;\n }\n return false;\n }\n\n /**\n * Removes a Tooltip on given target\n * @param {HTMLElement} [target], if not given will remove current open tooltip on this instance\n */\n removeTooltip(target) {\n let selfTarget = target;\n if (!selfTarget && this.tooltipContainer) {\n selfTarget = this.tooltipContainer.flexTooltipCurrentTarget;\n }\n if (this.tooltipContainer) {\n if (this.tooltipContainer.flexTooltipCurrentTarget !== selfTarget) {\n return;\n }\n this.tooltipContainer.classList.remove(CLASS_NAMES_OPEN);\n delete this.tooltipContainer.flexTooltipCurrentTarget;\n }\n if (selfTarget && selfTarget.oldTitle) {\n selfTarget.setAttribute('title', selfTarget.oldTitle);\n }\n }\n\n /**\n * Initilizes mouse events on container element\n */\n registerEvents() {\n const self = this;\n this.addEventListener(this.container, 'mouseover', (e) => {\n if (e.target.hasAttribute(self.options.selectorAttribute)) {\n self.createTooltip(e.target, e.target.getAttribute('title'), true);\n }\n });\n\n this.addEventListener(this.container, 'mouseout', (e) => {\n if (e.target.hasAttribute(self.options.selectorAttribute)) {\n self.removeTooltip(e.target);\n }\n });\n return this;\n }\n}\n\nexport default Tooltip;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/main/Tooltip.js\n **/","import Settings from '../util/Settings';\nimport debounce from './debounce';\nimport Event from '../util/Event';\nimport Util from '../util/Util';\n\nconst CLS_FIXED_WINDOW = 'fixed-window-open';\n\nexport const EVENT_BEFORE_FIXED_ADD = 'flexcss.fixedWindow.beforeAdd';\nexport const EVENT_AFTER_FIXED_REMOVE = 'flexcss.fixedWindow.afterRemove';\n\n/**\n * @type {FixedWindow}\n */\nlet fixedWindowInstance;\n\nexport default class FixedWindow {\n\n constructor() {\n this.widgets = [];\n this.currentScrollTop = 0;\n this.fixedScreenConstraints = [];\n this.windowWidth = 0;\n this.isFixedWindowActive = false;\n this.touchListener = null;\n }\n\n /**\n * Adds a constraint to detect if the window needs to be changed when the screensize changes\n *\n * @param {Function} widget\n * @param {Function} fixedBreakpointFn gets a width argument, return true to open a window\n */\n addScreenConstraint(widget, fixedBreakpointFn) {\n this.fixedScreenConstraints[widget] = fixedBreakpointFn;\n }\n\n /**\n * @returns {null|DestroyableWidget}\n */\n getCurrentWidget() {\n return this.widgets.length > 0 ? this.widgets[this.widgets.length - 1] : null;\n }\n\n /**\n * @private\n */\n _checkFixedNeeded() {\n if (this.widgets.length === 0) {\n return;\n }\n const widgets = new Set(this.widgets);\n const widgetsThatRequireFixedWindow = Array.from(widgets).some(({ widget }) => {\n return this.fixedScreenConstraints[widget] && this.fixedScreenConstraints[widget](this.windowWidth);\n });\n if (!widgetsThatRequireFixedWindow) {\n this._removeFixedContainer();\n } else {\n this._addFixedContainer();\n }\n }\n\n /**\n * @private\n */\n _addFixedContainer() {\n if (this.isFixedWindowActive) {\n return;\n }\n Event.dispatchAndFire(global.document, EVENT_BEFORE_FIXED_ADD, {\n detail: this.getCurrentWidget()\n });\n // this causes layout and should be optimized\n // At lest we write in a batch later\n Settings.get().scrollbarUpdateNodes.map((n) => {\n let foundProperty = 'paddingRight';\n let direction = 1;\n let node = n;\n if (n instanceof Array) {\n const [whatNode, property, d] = n;\n foundProperty = property;\n node = whatNode;\n direction = d || 1;\n }\n return {\n node,\n property: foundProperty,\n value: `${parseInt(global.getComputedStyle(node)[foundProperty], 10) +\n (!node.__fixedWindowMod__ ? (Settings.getScrollbarWidth() * direction) : 0)}px`\n };\n }).forEach((d) => {\n d.node.__fixedWindowMod__ = true;\n d.node.style[d.property] = d.value;\n });\n\n this.touchListener = (e) => {\n e.preventDefault();\n };\n\n let shouldNotMove = false;\n this.touchStartListener = (e) => {\n const { element } = this.getCurrentWidget();\n if (Util.isPartOfNode(e.target, element)) {\n if (element.scrollTop === 0) {\n element.scrollTop = 1;\n shouldNotMove = true;\n } else if (element.scrollHeight === element.scrollTop + element.offsetHeight) {\n shouldNotMove = true;\n element.scrollTop -= 1;\n }\n }\n };\n\n global.addEventListener('touchmove', this.touchListener);\n global.document.body.addEventListener('touchstart', this.touchStartListener);\n\n this.touchMoveListener = (e) => {\n const { element } = this.getCurrentWidget();\n if (Util.isPartOfNode(e.target, element)) {\n if (!shouldNotMove) {\n e.stopImmediatePropagation();\n }\n shouldNotMove = false;\n }\n };\n global.document.body.addEventListener('touchmove', this.touchMoveListener);\n\n global.document.documentElement.classList.add(CLS_FIXED_WINDOW);\n this.isFixedWindowActive = true;\n }\n\n /**\n * @private\n */\n _removeFixedContainer() {\n if (this.isFixedWindowActive) {\n // cleanup event listeners\n global.removeEventListener('touchmove', this.touchListener);\n global.document.body.removeEventListener('touchstart', this.touchStartListener);\n global.document.body.removeEventListener('touchmove', this.touchMoveListener);\n\n // reset scrollbar nodes\n Settings.get().scrollbarUpdateNodes.forEach((node) => {\n if (node instanceof Array) {\n const [whatNode, property] = node;\n delete whatNode.__fixedWindowMod__;\n whatNode.style[property] = '';\n } else {\n delete node.__fixedWindowMod__;\n node.style.paddingRight = '';\n }\n });\n global.document.documentElement.classList.remove(CLS_FIXED_WINDOW);\n Event.dispatchAndFire(global.document, EVENT_AFTER_FIXED_REMOVE);\n this.isFixedWindowActive = false;\n }\n }\n\n /**\n * Will close a window when no widgets are opened that need one\n */\n resizeListener() {\n this.windowWidth = global.innerWidth;\n this._checkFixedNeeded();\n }\n\n /**\n * @returns {FixedWindow}\n */\n static getInstance() {\n if (!fixedWindowInstance) {\n fixedWindowInstance = new FixedWindow();\n fixedWindowInstance.windowWidth = global.innerWidth;\n const eventHandler = fixedWindowInstance.resizeListener.bind(fixedWindowInstance);\n global.addEventListener(\n 'resize',\n debounce(eventHandler, 500)\n );\n global.addEventListener('orientationchange', eventHandler);\n }\n return fixedWindowInstance;\n }\n\n /**\n * Request a close of the fixed window\n */\n close() {\n this.widgets.pop();\n if (this.widgets.length === 0) {\n this._removeFixedContainer();\n }\n }\n\n /**\n * Request to open a fixed windows\n * @param {Object|DestroyableWidget} instance\n * @param {HTMLElement} element\n */\n open(instance, element) {\n let fixed = false;\n if (typeof instance === 'object') {\n const widget = instance.constructor;\n const fixedWidget = this.fixedScreenConstraints[instance.constructor];\n if (widget && fixedWidget) {\n fixed = fixedWidget(this.windowWidth);\n }\n const length = this.widgets.length;\n this.widgets.push(\n {\n widget,\n element\n }\n );\n // open a new window if there is no window active\n if (length === 0) {\n if (fixed) {\n this._addFixedContainer();\n }\n }\n }\n }\n}\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/main/lib/FixedWindow.js\n **/","/*\n * The MIT License (MIT)\n *\n * Copyright (c) 2015 David Heidrich, BowlingX \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n/*!\n * FlexCss.Modal\n * Licensed under the MIT License (MIT)\n * Copyright (c) 2015 David Heidrich, BowlingX \n */\n\n/* global KeyboardEvent */\n\nimport Settings from './util/Settings';\nimport Event from './util/Event';\nimport Util from './util/Util';\nimport Widget from './Widget';\nimport FixedWindow from './lib/FixedWindow';\n\nconst HTML_ELEMENT = global.document.documentElement;\nconst KEY_ESC = 27;\n/* Attribute Names */\nconst ATTR_CREATE_NEW = 'data-new-instance';\nconst ATTR_CLOSE = 'data-close-modal';\nconst ATTR_NAME = 'data-modal';\n\n/* Class names */\nconst CLS_CONTAINER_CURRENT = 'front';\nconst CLS_OPEN = 'open';\nconst CLS_CURRENT = 'current';\nconst CLS_PART_OF_STACK = 'part-of-stack';\nconst CLS_MODAL_OPEN = 'modal-open';\nconst CLS_MODAL_CONTAINER = 'modal-container';\nconst CLS_ANIM_END = 'modal-anim-end';\nconst CLS_LOADER_CONTAINER = 'loader-container';\nconst CLS_LOADER = 'loader';\n\n/* Events */\n\n/**\n * Event triggered when modal is closed\n * @type {string}\n */\nexport const EVENT_MODAL_CLOSED = 'flexcss.modal.closed';\n/**\n * Event triggered before a modal is closed, cancelable\n * @type {string}\n */\nexport const EVENT_MODAL_BEFORE_CLOSED = 'flexcss.modal.beforeClose';\n/**\n * Event triggered when a modal is opened\n * @type {string}\n */\nexport const EVENT_MODAL_OPENED = 'flexcss.modal.opened';\n\n/**\n * Event triggered when modal is initilized, called on target\n * @type {string}\n */\nexport const EVENT_MODAL_INIT = 'flexcss.modal.init';\n\n/**\n * Triggered when the content of an async modal on a target is loaded, called on target\n * @type {string}\n */\nexport const EVENT_MODAL_ASYNC_TARGET_LOADED = 'flexcss.modal.asyncTargetLoaded';\n\n/**\n * A Modal Implementation\n */\nclass Modal {\n constructor(DelegateContainer, options) {\n const doc = global.document;\n const container = DelegateContainer instanceof HTMLElement ?\n DelegateContainer : doc.getElementById(DelegateContainer);\n\n // Instance vars:\n if (!container) {\n throw new Error(`Could not found container element by given ID/Element: ${DelegateContainer}`);\n }\n\n this.currentOpen = null;\n\n this.loading = false;\n\n this.container = container;\n\n /**\n * Default Options\n */\n this.options = {\n classNames: 'modal',\n closeOnEscape: true,\n closeOnBackgroundClick: true,\n destroyOnFinish: false,\n fixedContainer: true,\n containerClassNames: ''\n };\n\n Object.assign(this.options, options);\n\n // Container where events are delegated\n this.eventContainer = null;\n this.eventFunction = null;\n\n this.dataMainPageContainer = global.document.body;\n\n this.currentScrollTop = 0;\n\n this.modalContainer = null;\n\n // Destroy full modal instance when no dialogs are bind to?\n // Otherwise container is recycled\n this.destroyOnFinish = this.options.destroyOnFinish;\n }\n\n /**\n * Removes this modal from global stack\n * Will handle fixing main html element too\n * @private\n * @param n\n */\n _removeModalFromStack(n) {\n const t = Modal._modalInstances.indexOf(n);\n if (t > -1) {\n Modal._modalInstances.splice(t, 1);\n FixedWindow.getInstance().close();\n HTML_ELEMENT.classList.remove(CLS_MODAL_OPEN);\n }\n }\n\n\n /**\n * Modal container that contains all `stacked` modals for this instance\n * @returns {HTMLElement}\n */\n getModalContainer() {\n return this.modalContainer;\n }\n\n /**\n * Closes the current open modal of this stack\n * @params [e], optional event\n * @returns {*}\n */\n close(e) {\n const self = this;\n\n const options = self.currentOpen ? Util.applyOptionsFromElement(\n self.currentOpen, Util.copy(self.options)) : self.options;\n\n // close only on keyboard if instance should\n if (!options.closeOnEscape && e instanceof KeyboardEvent) {\n return false;\n }\n\n // close only on background if instance should\n if (!options.closeOnBackgroundClick && e &&\n e.type === Settings.getTabEvent() && !e.target.hasAttribute(ATTR_CLOSE)) {\n return false;\n }\n\n // if an instance is currently loading, prevent from closing\n if (self.loading) {\n return false;\n }\n\n if (e) {\n e.preventDefault();\n }\n\n if (self.currentOpen) {\n // dispatch beforeClose event, if prevented prevent modal from closing\n var ev = Event.dispatchAndFire(self.currentOpen, EVENT_MODAL_BEFORE_CLOSED);\n if (ev.defaultPrevented) {\n return false;\n }\n\n this._finishState(self.currentOpen);\n // if there is an previous modal\n if (self.currentOpen.prevModal) {\n // switch to the next modal\n return self.switchModals(self.currentOpen.prevModal,\n self.currentOpen.prevModal.prevModal || null);\n }\n\n // finally trigger closed event\n Event.dispatch(self.currentOpen, EVENT_MODAL_CLOSED).withOriginal(e).fire();\n\n }\n self._removeModalFromStack(self.currentOpen);\n\n // Full stack closed:\n self.currentOpen = null;\n if (self.modalContainer) {\n // setup next open\n var lastContainer = Modal._modalInstances[Modal._modalInstances.length - 1],\n classList = self.modalContainer.classList;\n classList.remove(CLS_CONTAINER_CURRENT);\n classList.remove(CLS_OPEN);\n // Remove all current classes from child-nodes\n for (var i = 0; i < self.modalContainer.childNodes.length; i++) {\n var node = self.modalContainer.childNodes[i], cl = node.classList;\n // remove applied styles\n self._finishState(node);\n cl.remove(CLS_CURRENT);\n cl.remove(CLS_PART_OF_STACK);\n }\n if (lastContainer) {\n lastContainer.parentNode.classList.add(CLS_CONTAINER_CURRENT);\n }\n }\n\n if (self.destroyOnFinish) {\n self.destroy();\n }\n return self;\n }\n\n /**\n * Resets a target when newly initilizes\n * @param target\n * @private\n */\n _finishState(target) {\n target.classList.remove(CLS_ANIM_END);\n }\n\n /**\n * Handler called when a Modal has finished an animation\n * @param e\n * @param self\n * @private\n */\n _finishAnim(e, self) {\n e.target.classList.add(CLS_ANIM_END);\n e.target.removeEventListener(e.type, self, true);\n }\n\n /**\n * Brings the given modal to front\n * @param co\n * @param last\n */\n switchModals(co, last) {\n co.prevModal = last;\n Modal._modalInstances.push(co);\n FixedWindow.getInstance().open(this, this.modalContainer);\n if (last) {\n this._finishState(last);\n Util.prefixedAnimateEvent(last, 'AnimationEnd', this._finishAnim);\n last.classList.add(CLS_PART_OF_STACK);\n }\n // set new currentOpen\n this.currentOpen = co;\n\n // bring current container to the front\n var instances = Modal._modalInstances;\n\n for (var m = 0; m < instances.length; m++) {\n instances[m].parentNode.classList.remove(CLS_CONTAINER_CURRENT);\n }\n this.modalContainer.classList.add(CLS_CONTAINER_CURRENT);\n // remove animations if animations has been completed, fixes various bugs:\n // - fixes nested scrolling element issue in iOS Browsers / Mobile-Safari\n Util.prefixedAnimateEvent(co, 'AnimationEnd', this._finishAnim);\n\n for (var i = 0; i < this.modalContainer.childNodes.length; i++) {\n var n = this.modalContainer.childNodes[i], isCurrent = n.classList.contains(CLS_CURRENT);\n if (n === co) {\n co.classList.add(CLS_CURRENT);\n co.classList.remove(CLS_PART_OF_STACK);\n this._finishState(co);\n } else {\n n.classList.remove(CLS_CURRENT);\n if (isCurrent) {\n this._removeModalFromStack(n);\n Event.dispatchAndFire(n, EVENT_MODAL_CLOSED);\n }\n }\n }\n }\n\n handleScrollbar() {\n if (Modal._modalInstances.length === 0) {\n HTML_ELEMENT.classList.add(CLS_MODAL_OPEN);\n }\n }\n\n /**\n * Creates a Modal and opens it (later)\n * @param e\n * @returns {Promise|boolean}\n */\n createWidget(e) {\n var self = this;\n if (this.loading) {\n return false;\n }\n\n // check if another modal has registered events on this dom path:\n if (e && e.target) {\n var foundInstance = Util.parentsUntil(e.target, function (node) {\n return node && node.flexModalInstance;\n });\n\n // if another instance has been found, abort\n if (foundInstance !== this.container) {\n return false;\n }\n }\n var targetContent, future, widget, target, hasTarget = true,\n isHtmlElement = e instanceof HTMLElement, isWidget = Widget.isWidget(e);\n if (isHtmlElement || isWidget) {\n if (isHtmlElement) {\n targetContent = e;\n } else {\n widget = e;\n targetContent = widget.element;\n }\n } else {\n target = e.target;\n if (!target) {\n throw 'Could not find target, did you pass an event, a HTMLElement or an Widget?';\n }\n hasTarget = target.hasAttribute(ATTR_NAME);\n targetContent = target.getAttribute(ATTR_NAME);\n widget = Widget.findWidget(target);\n if (target.hasAttribute(ATTR_CREATE_NEW) && !e.newInstance) {\n var newInstance = new Modal(this.container)\n .setDestroyOnFinish(true);\n e.newInstance = true;\n newInstance.fromEvent(e).then(function () {\n newInstance.registerEvents(newInstance.getModalContainer());\n });\n return false;\n }\n if (hasTarget) {\n e.stopImmediatePropagation();\n e.preventDefault();\n }\n }\n\n if (!hasTarget) {\n return false;\n }\n\n let modalContainerClasses = this.modalContainer ? this.modalContainer.classList : [];\n\n // lazy create modal container\n if (!this.modalContainer) {\n this.modalContainer = global.document.createElement('div');\n this.modalContainer.className = `${CLS_MODAL_CONTAINER} ${this.options.containerClassNames} ${CLS_OPEN}`;\n const closeModalFunction = function (ce) {\n if (self.loading) {\n return false;\n }\n if (Util.isPartOfNode(ce.target, self.currentOpen)) {\n if (!ce.target.hasAttribute(ATTR_CLOSE)) {\n return false;\n }\n }\n self.close(ce);\n };\n\n this.modalContainer.addEventListener(Settings.getTabEvent(), closeModalFunction, false);\n\n modalContainerClasses = this.modalContainer.classList;\n this.container.appendChild(this.modalContainer);\n\n } else {\n modalContainerClasses.add(CLS_OPEN);\n }\n\n let loader, doc = global.document, toggleLoader = function (show) {\n if (show) {\n loader = doc.createElement('div');\n loader.className = CLS_LOADER_CONTAINER;\n var loaderLoader = doc.createElement('div');\n loaderLoader.className = CLS_LOADER;\n loader.appendChild(loaderLoader);\n self.modalContainer.appendChild(loader);\n } else {\n loader.parentNode.removeChild(loader);\n }\n };\n\n this.handleScrollbar();\n\n modalContainerClasses.add(CLS_CONTAINER_CURRENT);\n modalContainerClasses.add('loading');\n this.loading = true;\n toggleLoader(true);\n var async = widget ? widget.getAsync() : null;\n if (Widget.isWidget(widget) && async) {\n future = async.then(function (r) {\n var result;\n if (r instanceof HTMLElement || r instanceof DocumentFragment) {\n result = r;\n } else {\n // Create container Element:\n var element = doc.createElement('div');\n element.className = self.options.classNames;\n element.innerHTML = r;\n element.id = Util.guid();\n result = element;\n }\n widget.finalContent = result;\n Event.dispatchAndFire(target, EVENT_MODAL_ASYNC_TARGET_LOADED);\n return result;\n });\n } else {\n var el = targetContent instanceof HTMLElement ||\n targetContent instanceof DocumentFragment ? targetContent : doc.getElementById(targetContent);\n if (el) {\n future = new Promise((resolve) => {\n resolve(el);\n });\n } else {\n throw 'Could not found given modal element (content) with ID: ' + targetContent;\n }\n }\n\n Event.dispatchAndFire(target, EVENT_MODAL_INIT);\n\n return future.then((thisEl) => {\n thisEl.hfWidgetInstance = self;\n self.modalContainer.appendChild(thisEl);\n modalContainerClasses.remove('loading');\n self.loading = false;\n toggleLoader(false);\n\n self.open(thisEl, true, e);\n\n return thisEl;\n });\n }\n\n /**\n * Open's an already rendered modal\n * @param {HTMLElement} modal\n * @param {Boolean} [internal], set to true to prevent container management\n * @param {Boolean} [maybeEvent], optional event-object that triggered open\n */\n open(modal, internal, maybeEvent) {\n\n\n if (!internal) {\n this.modalContainer.classList.add('open');\n this.handleScrollbar();\n }\n this.switchModals(modal, this.currentOpen);\n\n Event.dispatch(modal, EVENT_MODAL_OPENED).withOriginal(maybeEvent).fire();\n }\n\n\n registerEvents(delegate) {\n var delegateContainer = delegate || this.container, self = this;\n // Modals should always be fixed\n FixedWindow.getInstance().addScreenConstraint(Modal, (width) => true);\n // register modal instance so we can detect multiple registrars\n delegateContainer.flexModalInstance = self;\n self.eventFunction = function () {\n self.createWidget.apply(self, arguments);\n };\n delegateContainer.addEventListener(Settings.getTabEvent(), self.eventFunction, false);\n\n self.eventContainer = delegateContainer;\n return self;\n }\n\n\n /**\n * Creates a new Dialog Instance either directly from HTML Element or a Widget instance\n * @param {HTMLElement|Widget} widget instance or html element\n * @returns {Promise}\n */\n fromWidget(widget) {\n return this.createWidget(widget);\n }\n\n /**\n * Creates a Widget from event\n * @param e\n * @returns {Promise}\n */\n fromEvent(e) {\n return this.createWidget(e);\n }\n\n setDestroyOnFinish(v) {\n this.destroyOnFinish = v;\n return this;\n }\n\n /**\n * Destroy this widget instance, cleans empty DOM nodes\n * Will use fast MutationObserver if available, otherwise falls back to DOMNodeRemoved event\n */\n destroy() {\n let self = this, modalContainer = this.modalContainer;\n const isEmptyContainer = modalContainer.childNodes.length === 0;\n // Remove event listener on destroy, do not remove DOM node\n if (self.eventContainer) {\n self.eventContainer.removeEventListener(Settings.getTabEvent(), self.eventFunction, true);\n }\n\n if (isEmptyContainer) {\n if (modalContainer.parentNode) {\n modalContainer.parentNode.removeChild(modalContainer);\n }\n }\n if (global.MutationObserver) {\n var observer = new MutationObserver(function (mutations) {\n mutations.forEach(function () {\n if (isEmptyContainer) {\n modalContainer.parentNode.removeChild(modalContainer);\n observer.disconnect();\n }\n });\n });\n observer.observe(modalContainer, {childList: true});\n } else {\n modalContainer.addEventListener('DOMNodeRemoved', function (e) {\n if (e.target !== modalContainer && (modalContainer.childNodes.length - 1) === 0) {\n modalContainer.parentNode.removeChild(modalContainer);\n }\n });\n }\n }\n}\n\n\n// Static variable that keeps track of all open modals\nModal._modalInstances = [];\n\n// Global keydown listener for modal\nglobal.addEventListener('keydown', function (e) {\n if (e.keyCode === KEY_ESC) {\n var lastModal = Modal._modalInstances[Modal._modalInstances.length - 1];\n if (lastModal) {\n Widget.findWidget(lastModal).close(e);\n }\n }\n});\n\nexport default Modal;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/main/Modal.js\n **/","/*global HTMLFormElement, fetch, FormData, clearTimeout, NodeList*/\n\n/*\n * The MIT License (MIT)\n *\n * Copyright (c) 2015 David Heidrich, BowlingX \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n/*!\n * FlexCss.Form\n * Licensed under the MIT License (MIT)\n * Copyright (c) 2015 David Heidrich, BowlingX \n */\n\nimport Tooltip from './Tooltip';\nimport 'isomorphic-fetch';\nimport Event from './util/Event';\nimport Util from './util/Util';\nimport Settings from './util/Settings';\nimport DestroyableWidget from './DestroyableWidget';\n\nconst LOADING_CLASS = 'loading';\nconst DATA_ELEMENT_INVALID = 'data-flexcss-invalid';\nconst REMOTE = 'data-remote';\nconst REMOTE_ACTION = 'data-remote-action';\nconst ATTR_DISABLE_INLINE = 'data-disable-inline-validation';\nconst ATTR_DISABLE_REALTIME = 'data-disable-realtime-validation';\nconst ATTR_VALIDATOR = 'data-validate';\nconst ATTR_DATA_CUSTOM_MESSAGE = 'data-validation-message';\nconst ATTR_DATA_CUSTOM_LABEL = 'data-custom-label';\nconst ATTR_VALIDATE_VISIBILITY = 'data-validate-visibility';\nconst ATTR_ERROR_TARGET_ID = 'data-error-target';\nconst ATTR_DEPENDS = 'data-depends-selector';\nconst CONST_USE_JSON = 'json';\nconst CONST_REALTIME_EVENT = 'input';\nconst FOCUS_TOOLTIP_DELAY = 20;\nconst CLICK_TOOLTIP_DELAY = 150;\n\n/**\n * Triggered when form is fully initialized and handlers are binded\n * @type {string}\n */\nexport const EVENT_FORM_READY = 'flexcss.form.ready';\n/**\n * Fires when a form is submitted, cancelable\n * @type {string}\n */\nexport const EVENT_FORM_SUBMIT = 'flexcss.form.submit';\n/**\n * Fired directly after the form has been submitted via ajax\n * @type {string}\n */\nexport const EVENT_FORM_AFTER_AJAX_SUBMIT = 'flexcss.form.afterAjaxSubmit';\n/**\n * Fired when ajax events did complete\n * @type {string}\n */\nexport const EVENT_FORM_AJAX_COMPLETED = 'flexcss.form.ajaxCompleted';\n\n/**\n * A HTML5 Form Validation replacement\n */\n\nclass Form extends DestroyableWidget {\n /**\n * @param {HTMLElement} form\n * @param [options] optional options\n */\n constructor(form, options) {\n super();\n\n if (!(form instanceof HTMLFormElement)) {\n throw 'argument {0} form needs to be an form element';\n }\n\n /**\n * The Form\n * @type {HTMLElement}\n */\n this.form = form;\n\n /**\n * @type {Tooltip}\n */\n this.tooltips = null;\n\n /**\n * @type {Promise}\n */\n this.currentValidationFuture = new Promise(() => {\n });\n\n /**\n * Default options\n * @type {Object}\n */\n this.options = {\n // if true creates tooltips above element, uses FlexCss Tooltips\n createTooltips: true,\n // if true appends error message after input element\n appendError: false,\n // type of ajax submit\n ajaxSubmitType: 'POST',\n // json content type if ajax method is set to json\n ajaxJsonContentType: 'application/json; charset=utf-8',\n // allow inline validation\n inlineValidation: true,\n // validate in realtime (on `input` event)\n realtime: true,\n // timeout when realtime event should be captured\n realtimeTimeout: 250,\n // formatting method for an error\n formatErrorTooltip: (error) => {\n return ' ' + error;\n },\n // the class that will be put on the element to mark it failed validation\n inputErrorClass: 'invalid',\n // the container class for error messages below an element\n containerErrorClass: 'form-error',\n // additional options for fetch\n fetchOptions: {\n credentials: 'include'\n },\n // the container for tooltips\n tooltipContainer: form,\n tooltipOptions: {\n containerClass: 'error-tooltip'\n },\n // if you have a fixed header, either set a number or function here\n scrollToElementDiff: 0\n };\n\n // overwrite default options\n Object.assign(this.options, options);\n\n // apply settings from attributes\n Util.applyOptionsFromElement(form, this.options);\n\n // set form class as widget\n // Forms are very different to classical widgets,\n // we will not use our base widget class for this but just self\n form.hfWidgetInstance = this;\n\n /**\n * A List of Validators\n * @type {Object}\n * @private\n */\n this._validators = Form.globalValidators;\n\n /**\n * @type {Function}\n * @private\n */\n this._remoteValidationFunction = null;\n\n this.initFormValidation();\n }\n\n destroy() {\n super.destroy();\n if (this.tooltips) {\n this.tooltips.destroy();\n }\n }\n\n /**\n * Submits this form, either via ajax or just classical (default)\n * @param {HTMLFormElement} thisForm\n * @param {Event} e\n * @private\n * @returns {Promise|boolean} returns false if submit is cancled\n */\n _submitFunction(thisForm, e) {\n var shouldUseAjax = thisForm.getAttribute(REMOTE), ajaxPostUrl =\n thisForm.getAttribute(REMOTE_ACTION) ||\n thisForm.getAttribute('action') || window.location.href,\n useJson = CONST_USE_JSON === shouldUseAjax, self = this;\n\n var ev = Event.dispatch(thisForm, EVENT_FORM_SUBMIT).withOriginal(e).fire();\n\n // abort execution is event was prevented\n if (ev.defaultPrevented) {\n self._formStopLoading();\n return false;\n }\n\n if (shouldUseAjax === null) {\n // submit\n return thisForm.submit();\n }\n // prevent form from submit normally\n e.preventDefault();\n\n // add information that this is an XMLHttpRequest request (used by some frameworks)\n let defaultHeaders = {\n 'X-Requested-With': 'XMLHttpRequest'\n };\n\n // setup default headers\n if (useJson) {\n Object.assign(defaultHeaders, {\n 'Content-Type': this.options.ajaxJsonContentType\n });\n }\n let defaultOptions = Object.assign(this.options.fetchOptions, {\n headers: defaultHeaders,\n method: this.options.ajaxSubmitType\n });\n\n // support either JSON request payload or normal payload submission\n var serverCall = useJson ? fetch(ajaxPostUrl, Object.assign(defaultOptions, {\n body: JSON.stringify(this.serialize())\n })) : fetch(ajaxPostUrl, Object.assign(defaultOptions, {\n body: new FormData(thisForm)\n }));\n\n Event.dispatch(thisForm, EVENT_FORM_AFTER_AJAX_SUBMIT).withOriginal(e).fire();\n\n return serverCall.then((r) => {\n (self._remoteValidationFunction || Form.globalRemoteValidationFunction).apply(self, [r]);\n\n Event.dispatch(thisForm, EVENT_FORM_AJAX_COMPLETED).withOriginal(e).withDetail({ response: r }).fire();\n // always remove error class\n self._formStopLoading();\n });\n }\n\n /**\n * Serializes a form to a json object\n * @returns {Object}\n */\n serialize() {\n var selectors = [\n 'input[name]:not([type=\"radio\"]):enabled',\n 'input[type=\"radio\"][name]:checked',\n 'select[name]:enabled',\n 'textarea[name]:enabled'\n ], inputs = this.form.querySelectorAll(selectors.join(',')), result = {};\n\n Array.prototype.forEach.call(inputs, function (input) {\n var exists = result[input.name], value = input.value;\n if (exists instanceof Array) {\n exists.push(value);\n } else if (exists) {\n result[input.name] = [result[input.name], value];\n } else {\n result[input.name] = value;\n }\n });\n\n return result;\n }\n\n /**\n * Handles the chain of validation on given fields\n *\n * @param {HTMLElement|Array|NodeList} field\n * @param [focus] optional focus first error\n * @returns {Promise}\n */\n handleValidation(field, focus) {\n var fields = (field instanceof Array || field instanceof NodeList) ? field : [field];\n return this._handleValidation(fields, focus, true).then(((r) => {\n if (!r.foundAnyError) {\n // remove tooltips\n if (this.tooltips) {\n this.tooltips.removeTooltip();\n }\n }\n return r;\n }).bind(this));\n }\n\n /**\n * Handles errors on given node list\n * @param {NodeList} toValidateFields\n * @param {boolean} focus\n * @param {boolean} scoped if true, will only validate the fields `invalidFields`\n * @returns {Promise}\n * @private\n */\n _handleValidation(toValidateFields, focus, scoped) {\n var self = this;\n var arr = Form._createArrayFromInvalidFieldList(toValidateFields), isLocalInvalid = arr.length > 0;\n // focus must appear in the same frame for iOS devices\n if (isLocalInvalid && focus) {\n self._focusElement(arr[0]);\n }\n var validation = scoped ? this._customValidationsForElements(toValidateFields) :\n self.validateCustomFields();\n return validation.then((r) => {\n if (isLocalInvalid) {\n // combine browser and custom validators\n r.foundAnyError = true;\n }\n // get a unique field list of all fields that need to be checked and rendered\n // it's possible that we have duplicates in non scoped mode\n let thisToValidateFields = scoped ? toValidateFields :\n Array.from(arr).concat(r.checkedFields);\n r.checkedFields = thisToValidateFields;\n let foundInvalidFields = self.prepareErrors(thisToValidateFields, false),\n firstInvalidField = foundInvalidFields[0];\n if (firstInvalidField) {\n if (focus) {\n self._focusElement(firstInvalidField);\n // if element could not be focused:\n if (document.activeElement !== firstInvalidField) {\n self._handleTooltipHideClickAfterChange();\n }\n } else {\n self._handleTooltipHideClickAfterChange();\n }\n self.showAndOrCreateTooltip(firstInvalidField);\n }\n return r;\n });\n }\n\n /**\n * @param {HTMLElement} field\n * @param {ValidityState} validity\n * @returns {*}\n * @private\n */\n\n _setupErrorMessages(field, validity) {\n return Form.globalErrorMessageHandler ?\n Form.globalErrorMessageHandler.apply(this, [field, validity]) : false;\n }\n\n /**\n * Handles class labels for elements\n * @param {Object} fields\n * @private\n */\n _handleLabels(fields) {\n Object.keys(fields).forEach(function (id) {\n let labels = this.getForm().querySelectorAll('[for=\"' + id + '\"]'), invalid = fields[id];\n if (labels.length) {\n for (let labelsIndex = 0; labelsIndex < labels.length; labelsIndex++) {\n let labelEl = labels[labelsIndex];\n // we can't use toggle attribute, not supported in IE\n if (invalid) {\n this._markElementInvalid(labelEl);\n } else {\n this._markElementValid(labelEl);\n }\n }\n }\n }.bind(this));\n }\n\n /**\n * @param el\n * @private\n */\n _markElementInvalid(el) {\n el.setAttribute(DATA_ELEMENT_INVALID, \"true\");\n el.classList.add(this.options.inputErrorClass);\n }\n\n /**\n * @param el\n * @private\n */\n _markElementValid(el) {\n el.removeAttribute(DATA_ELEMENT_INVALID);\n el.classList.remove(this.options.inputErrorClass);\n }\n\n /**\n * A List of invalid elements (:invalid)\n * @returns {Array}\n * @private\n */\n _getInvalidElements() {\n return Array.prototype.filter.call(this.getForm().querySelectorAll(\":invalid\"), function (r) {\n return !(r instanceof HTMLFieldSetElement);\n });\n }\n\n /**\n * @param {HTMLElement} thisParent\n * @private\n */\n _removeElementErrors(thisParent) {\n let errors = thisParent.querySelectorAll('.' + this.options.containerErrorClass), inputsWithErrorClasses =\n thisParent.querySelectorAll(`[${DATA_ELEMENT_INVALID}]`);\n for (let elementErrorIndex = 0; elementErrorIndex < errors.length; elementErrorIndex++) {\n errors[elementErrorIndex].parentNode.removeChild(errors[elementErrorIndex]);\n }\n for (let inputErrorIndex = 0; inputErrorIndex < inputsWithErrorClasses.length; inputErrorIndex++) {\n let el = inputsWithErrorClasses[inputErrorIndex];\n this._markElementValid(el);\n }\n }\n\n\n /**\n * Registers a custom validator\n * @param {String} name\n * @param {Function} validator a validation function should always return either a Future(true) or Future(false)\n * even when the field has been invalidated with `setCustomValidity`, because of different browser `bugs`\n * we can't rely on that\n * @returns {Form}\n */\n registerValidator(name, validator) {\n this._validators[name] = validator;\n return this;\n }\n\n /**\n * Runs async validation\n * @param {String} validationRef\n * @param {HTMLElement} field\n * @returns {Promise}\n * @private\n */\n _runValidation(validationRef, field) {\n if (!this._validators[validationRef]) {\n throw 'Could not found validator: ' + validationRef;\n }\n var cl = field.classList, future = this._validators[validationRef].apply(this, [field, this.form]);\n cl.add(LOADING_CLASS);\n future.then(() => {\n cl.remove(LOADING_CLASS);\n });\n return future;\n }\n\n\n /**\n * Run custom validations for elements, validations are done async do support XHR Requests or other stuff\n *\n * @param {Array|NodeList} fields\n * @returns {Promise} contains either true if validations passed or false if something went wrong\n * @private\n */\n _customValidationsForElements(fields) {\n var futures = [], fieldsLength = fields.length, checkedFields = [];\n for (var iVal = 0; iVal < fieldsLength; iVal++) {\n var field = fields[iVal], validationRef = field.getAttribute(ATTR_VALIDATOR), validity = field.validity;\n if (this._validators[validationRef]) {\n // use local validation first and then continue with custom validations\n if (Form._shouldNotValidateField(field) || (validity && !validity.customError && !validity.valid)) {\n continue;\n }\n checkedFields.push(field);\n futures.push(this._runValidation(validationRef, field));\n } else {\n if (validationRef) {\n console.warn('data-validate was set but no validator was found');\n }\n }\n }\n return Promise.all(futures).then(function (allFutures) {\n let l = allFutures.length;\n let result = {\n checkedFields: checkedFields,\n foundAnyError: false\n };\n for (var fI = 0; fI < l; fI++) {\n if (!allFutures[fI]) {\n result.foundAnyError = true;\n break;\n }\n }\n return result;\n });\n }\n\n /**\n * Remove all errors for this form\n * @returns {Form}\n */\n removeErrors() {\n this._removeElementErrors(this.form);\n if (this.tooltips) {\n this.tooltips.removeTooltip();\n }\n return this;\n }\n\n /**\n * Will handle errors for given fields\n * @param {Array|NodeList} fields\n * @param {Boolean} removeAllErrors\n */\n prepareErrors(fields, removeAllErrors) {\n if (removeAllErrors) {\n this.removeErrors();\n }\n let labelGroups = {}, invalidFields = [];\n\n function handleAdditionalLabels(isInvalid, thisLabelGroup, field) {\n let additionalLabels = field.getAttribute(ATTR_DATA_CUSTOM_LABEL) ||\n field.id, group = thisLabelGroup[additionalLabels];\n if (additionalLabels) {\n // check additionally if field is currently marked as invalid\n // so the label is not marked as error if no field is marked as one\n group = group ? group : isInvalid;\n thisLabelGroup[additionalLabels] = group;\n }\n }\n\n // We save all validations in an extra property because we need to reset the validity due some\n // implementation errors in other browsers then chrome\n for (let i = 0; i < fields.length; i++) {\n let field = fields[i], errorTarget = Form._findErrorTarget(field), parent = errorTarget.parentNode,\n validity = field.validity, isInvalid = validity && !validity.valid;\n if (Form._shouldNotValidateField(field)) {\n continue;\n }\n field.flexFormsSavedValidity = JSON.parse(JSON.stringify(validity));\n handleAdditionalLabels(isInvalid, labelGroups, field);\n if (isInvalid) {\n if (!removeAllErrors) {\n // Remove current errors:\n this._removeElementErrors(parent);\n }\n // setup custom error messages:\n this._setupErrorMessages(field, validity);\n let msg = field.validationMessage;\n\n // mark fields as invalid\n this._markElementInvalid(errorTarget);\n this._markElementInvalid(field);\n\n if (this.options.appendError) {\n parent.insertAdjacentHTML(\"beforeend\",\n `
${msg}
`);\n }\n invalidFields.push(field);\n field.flexFormsSavedValidationMessage = msg;\n } else {\n // restore invalid fields\n this._markElementValid(errorTarget);\n this._markElementValid(field);\n\n // cleanup\n delete field.flexFormsSavedValidationMessage;\n\n // remove error markup\n this._removeElementErrors(parent);\n }\n // We have to reset the custom validity here to allow native validations work again\n field.setCustomValidity('');\n }\n // if validates a single field we need to check the linked fields to a label:\n if (fields.length === 1) {\n let field = fields[0];\n let id = field.getAttribute(ATTR_DATA_CUSTOM_LABEL) || field.id;\n if (id) {\n let linkedFields = Array.from(\n this.getForm().querySelectorAll(`[${ATTR_DATA_CUSTOM_LABEL}=\"${id}\"], #${id}`));\n linkedFields.forEach(function (thisField) {\n let validity = thisField.validity, isInvalid = validity && !validity.valid &&\n this._isElementInvalidElement(thisField);\n handleAdditionalLabels(isInvalid, labelGroups, thisField);\n }.bind(this));\n }\n }\n this._handleLabels(labelGroups);\n return invalidFields;\n }\n\n /**\n * Validates all custom fields\n * @returns {Promise}\n */\n validateCustomFields() {\n return this._customValidationsForElements(\n this.form.querySelectorAll(\"[data-validate]\"));\n }\n\n /**\n * Tests if a field should be validated\n * @param {HTMLElement} field\n * @returns {boolean}\n * @private\n */\n static _shouldNotValidateField(field) {\n var target = Form._findErrorTarget(field);\n return target instanceof HTMLFieldSetElement || field.validity === undefined ||\n (target.hasAttribute(ATTR_VALIDATE_VISIBILITY) && !Util.isVisible(target));\n }\n\n /**\n * Creates an array from a node list with invalid items\n * This Method expicitly checks if field should not be validated so it can be used to foucs a field\n * @param list\n * @returns {Array}\n * @private\n */\n static _createArrayFromInvalidFieldList(list) {\n var arr = [];\n for (var i = 0; i < list.length; ++i) {\n var n = list[i];\n if (n.validity && !n.validity.valid) {\n if (!Form._shouldNotValidateField(n)) {\n arr.push(n);\n }\n }\n }\n return arr;\n }\n\n\n /**\n * This form\n * @returns {HTMLElement}\n */\n getForm() {\n return this.form;\n }\n\n /**\n * Registers a function that handles remote validation\n * @param {Function} func\n * @returns {Form}\n */\n registerRemoteValidation(func) {\n this._remoteValidationFunction = func;\n return this;\n }\n\n\n /**\n * Formats the error content for the tooltip\n * @param {String} error\n * @returns {String}\n * @private\n */\n _formatErrorTooltip(error) {\n return this.options.formatErrorTooltip.apply(this, [error]);\n }\n\n /**\n * Tries to find a custom error target on given target\n * @param target\n * @returns {HTMLElement}\n * @private\n */\n static _findErrorTarget(target) {\n var el = target.getAttribute(ATTR_ERROR_TARGET_ID) || target,\n foundTarget = el instanceof HTMLElement ? el : global.document.getElementById(el);\n if (!foundTarget) {\n throw 'Given error target did not exsits:' + target;\n }\n return foundTarget;\n }\n\n /**\n * Creates a tooltip at given element, will only create a new instance if not created\n * @param {HTMLElement} target\n * @param {Boolean} [remove]\n */\n showAndOrCreateTooltip(target, remove) {\n var self = this;\n if (!this.tooltips && this.options.createTooltips) {\n this.tooltips = new Tooltip(this.options.tooltipContainer, this.options.tooltipOptions);\n }\n if (!this.options.createTooltips) {\n return false;\n }\n\n if (!target.flexFormsSavedValidity) {\n return false;\n }\n var errorTarget = Form._findErrorTarget(target);\n if (!target.flexFormsSavedValidity.valid && self._isElementInvalidElement(errorTarget)) {\n self.tooltips.createTooltip(errorTarget,\n self._formatErrorTooltip(target.flexFormsSavedValidationMessage), false);\n return true;\n } else {\n if (remove) {\n self.tooltips.removeTooltip();\n }\n }\n return false;\n }\n\n /**\n * Checks if element is marked as invalid\n * @param {HTMLElement} el\n * @returns {boolean}\n * @private\n */\n _isElementInvalidElement(el) {\n return el.hasAttribute(DATA_ELEMENT_INVALID);\n }\n\n /**\n * Handles invalid event of a form\n * @param {Event} e\n * @returns {Promise|boolean}\n * @private\n */\n _checkIsInvalid(e) {\n e.preventDefault();\n var invalidFields = this.getForm().querySelectorAll(\":invalid\");\n return this._handleValidation(invalidFields, true, false);\n }\n\n /**\n * Will query dependent fields (by selector) that should be validated with given field\n * @param field\n * @returns {NodeList|[]}\n * @private\n */\n _getDependentFields(field) {\n let fieldSelector = field.getAttribute(ATTR_DEPENDS), base = [field];\n if (fieldSelector) {\n base.push.apply(base, Array.prototype.slice.apply(\n this.getForm().querySelectorAll(fieldSelector)));\n }\n return base;\n }\n\n /**\n * @private\n * @param {HTMLElement} [target]\n */\n _handleTooltipInline(target) {\n if (this.tooltips) {\n this.tooltips.removeTooltip(target);\n }\n }\n\n /**\n * Initializes validation for a given form, registers event handlers\n */\n initFormValidation() {\n // Suppress the default bubbles\n var form = this.getForm(),\n self = this,\n invalidEvent = 'invalid';\n\n /**\n * Validates if is valid realtime element\n * @param {HTMLElement} target\n * @returns {boolean}\n * @private\n */\n function _checkIsValidRealtimeElement(target) {\n return !target.hasAttribute(ATTR_DISABLE_REALTIME) && !target.hasAttribute(ATTR_DISABLE_INLINE);\n }\n\n form.addEventListener(invalidEvent, function (e) {\n e.preventDefault();\n }, true);\n\n Util.addEventOnce(invalidEvent, form, function handleInvalid(e) {\n self._formLoading();\n var result = self._checkIsInvalid(e);\n if (result) {\n self.currentValidationFuture = new Promise((resolve) => {\n result.then(function (r) {\n setTimeout(function () {\n Util.addEventOnce(invalidEvent, form, handleInvalid, true);\n }, 0);\n resolve(r);\n self._formStopLoading();\n if (!r.foundAnyError) {\n self._formLoading();\n self._handleSubmit(e);\n }\n });\n });\n }\n }, true);\n\n this.addEventListener(form, 'reset', () => {\n this.removeErrors();\n });\n\n // Timeout for keys:\n var TIMEOUT_KEYDOWN, KEYDOWN_RUNNING = false;\n\n // resets keydown events\n function clearKeyDownTimeout() {\n KEYDOWN_RUNNING = false;\n clearTimeout(TIMEOUT_KEYDOWN);\n }\n\n // setup custom realtime event if given\n if (self.options.realtime) {\n this.addEventListener(form, CONST_REALTIME_EVENT, function (e) {\n if (self._formIsLoading()) {\n return;\n }\n var target = e.target;\n clearTimeout(TIMEOUT_KEYDOWN);\n if (KEYDOWN_RUNNING) {\n return;\n }\n TIMEOUT_KEYDOWN = setTimeout(() => {\n let isStillTarget = document.activeElement === e.target;\n if (!_checkIsValidRealtimeElement(target)) {\n return;\n }\n if (isStillTarget) {\n self._handleTooltipInline();\n }\n KEYDOWN_RUNNING = true;\n let dependentFields = self._getDependentFields(target);\n self._customValidationsForElements(dependentFields).then(function () {\n self.prepareErrors(dependentFields, false);\n if (isStillTarget) {\n self.showAndOrCreateTooltip(e.target);\n }\n // future must be resolved before another event can be started\n KEYDOWN_RUNNING = false;\n });\n }, self.options.realtimeTimeout);\n }, true);\n }\n\n /**\n * Validates if target is a valid input field to check blur and focus events\n *\n * @param {HTMLElement} target\n * @returns {boolean}\n * @private\n */\n function _checkIsValidBlurFocusElement(target) {\n let attr = target.getAttribute(\"type\");\n return (attr !== \"radio\" && attr !== \"checkbox\" && attr !== \"submit\");\n }\n\n /**\n * Validates if is valid inline-check element\n * @param {HTMLElement} target\n * @returns {boolean}\n * @private\n */\n function _checkIsValidInlineCheckElement(target) {\n return !target.hasAttribute(ATTR_DISABLE_INLINE);\n }\n\n this.addEventListener(form, 'blur', function (e) {\n // do not hide tooltip after change event\n if (!e.target.flexcssKeepTooltips) {\n self._handleTooltipInline(e.target);\n }\n delete e.target.flexcssKeepTooltips;\n }, true);\n\n // handle focus on input elements\n // will show an error if field is invalid\n this.addEventListener(form, \"focus\", function (e) {\n if (self._formIsLoading()) {\n return;\n }\n // do not track errors for checkbox and radios on focus:\n if (!_checkIsValidBlurFocusElement(e.target)) {\n return;\n }\n // we need to delay this a little, because Firefox and Safari do not show a tooltip after it\n // just have been hidden (on blur). Maybe fix this with a queue later\n setTimeout(function () {\n self.showAndOrCreateTooltip(e.target);\n }, FOCUS_TOOLTIP_DELAY);\n }, true);\n\n if (self.options.inlineValidation) {\n // Handle change for checkbox, radios and selects\n this.addEventListener(form, \"change\", function (e) {\n const target = e.target;\n if (self._formIsLoading() || !_checkIsValidInlineCheckElement(target)) {\n return;\n }\n clearKeyDownTimeout();\n const name = target.getAttribute('name');\n let inputs = name ? form.querySelectorAll('[name=\"' + name + '\"]') : [target];\n // we only support dependent fields for a single widgets right now\n if (inputs.length === 1) {\n inputs = self._getDependentFields(target);\n }\n self._customValidationsForElements(inputs).then(function () {\n self.prepareErrors(inputs, false);\n target.flexcssKeepTooltips = self.showAndOrCreateTooltip(target, true);\n if (target.flexcssKeepTooltips) {\n self._handleTooltipHideClickAfterChange();\n }\n });\n });\n }\n\n // prevent default if form is invalid\n this.addEventListener(form, \"submit\", function listener(e) {\n self._submitListener(e, listener);\n });\n\n Event.dispatchAndFire(form, EVENT_FORM_READY);\n }\n\n /* Loading states, unfortunately we can't check if a promise is pending :/*/\n /* TODO: Maybe wrap promise to extend this functionality */\n\n _formLoading() {\n this.getForm().classList.add(LOADING_CLASS);\n }\n\n _formStopLoading() {\n this.getForm().classList.remove(LOADING_CLASS);\n }\n\n _formIsLoading() {\n return this.getForm().classList.contains(LOADING_CLASS);\n }\n\n // this defines the logic after a change event when a tooltip is shown\n // because we call this method inside the change event, the click would be immeditally executed with the change\n // event when not using setTimeout(). There might be another solution for this...\n _handleTooltipHideClickAfterChange() {\n const self = this;\n if (this.options.createTooltips) {\n setTimeout(function () {\n Util.addEventOnce(Settings.getTabEvent(), global.document.body, function (t) {\n if (!self._isElementInvalidElement(t.target)) {\n self._handleTooltipInline();\n }\n });\n }, CLICK_TOOLTIP_DELAY);\n }\n }\n\n _focusElement(el) {\n el.focus();\n Util.scrollToElement(el, this.options.scrollToElementDiff);\n }\n\n /**\n * Listener that is executed on form submit\n * @param e\n * @param submitListener\n * @returns {boolean}\n * @private\n */\n _submitListener(e, submitListener) {\n\n const form = this.getForm(),\n self = this,\n submitEvent = 'submit';\n\n if (this._formIsLoading()) {\n e.preventDefault();\n return false;\n }\n this._formLoading();\n form.removeEventListener(submitEvent, submitListener);\n this.removeErrors();\n e.preventDefault();\n // reset:\n if (form.checkValidity()) {\n form.addEventListener(submitEvent, submitListener);\n // It's possible that the form is valid but the custom validations need to be checked again:\n self.currentValidationFuture = new Promise((resolve) => {\n var validation = self.validateCustomFields();\n validation.then(function (r) {\n // because custom validators may mark multiple fields as invalid, we get all of them in the form\n var fields = self._getInvalidElements(),\n errors = self.prepareErrors(fields, false), firstError = errors[0];\n if (firstError) {\n self._focusElement(firstError);\n self.showAndOrCreateTooltip(firstError, true);\n }\n resolve(r);\n });\n });\n self.currentValidationFuture.then(function (r) {\n if (!r.foundAnyError) {\n // Handle submitting the form to server:\n self._handleSubmit(e);\n } else {\n self._formStopLoading();\n }\n });\n } else {\n self._formStopLoading();\n form.addEventListener(submitEvent, submitListener);\n }\n }\n\n\n /**\n * Handles submitting, optionally allows to stop submitting\n * @param e\n * @private\n */\n _handleSubmit(e) {\n this._submitFunction(this.form, e);\n }\n\n\n /**\n * Registers a global event Handler\n * @param errorFunc\n */\n static registerErrorMessageHandler(errorFunc) {\n Form.globalErrorMessageHandler = errorFunc;\n }\n\n /**\n * Initialize forms for a specific selector\n * @param {String} selector\n * @param {Object} [options]\n * @return {array.}\n */\n static init(selector, options) {\n var forms = selector instanceof HTMLElement ? selector.querySelectorAll('form') :\n document.querySelectorAll(selector), instances = [];\n for (var i = 0; i < forms.length; i++) {\n instances.push(new Form(forms[i], options));\n }\n return instances;\n }\n\n\n /**\n * Registers a global validator that is usable on all form instances\n * @param {String} name\n * @param {Function} validator\n * @returns {Function}\n */\n static registerValidator(name, validator) {\n Form.globalValidators[name] = validator;\n return Form;\n }\n\n /**\n * Registers a global function that is called when a form should validate the response of a server\n * @param {Function} func\n * @returns {Form}\n */\n static registerGlobalRemoteValidationFunction(func) {\n Form.globalRemoteValidationFunction = func;\n return Form;\n }\n}\n\n\n/**\n * Global validators\n * @type {Array}\n */\nForm.globalValidators = [];\n\n/**\n * Global Remote validation function\n */\nForm.globalRemoteValidationFunction = function () {\n};\n\n/**\n * Handles custom error messages extracts custom message by default\n */\nForm.globalErrorMessageHandler = (field, validity) => {\n if (!validity.customError) {\n let customMsg = field.getAttribute(ATTR_DATA_CUSTOM_MESSAGE);\n if (customMsg) {\n field.setCustomValidity(customMsg);\n }\n }\n};\n\nexport default Form;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/main/Form.js\n **/","export default (fn, ms) => () => {\n clearTimeout(fn.timeout);\n fn.timeout = setTimeout(fn, ms);\n};\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/main/lib/debounce.js\n **/","// the whatwg-fetch polyfill installs the fetch() function\n// on the global object (window or self)\n//\n// Return that as the export for use in Webpack, Browserify etc.\nrequire('whatwg-fetch');\nmodule.exports = self.fetch.bind(self);\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/isomorphic-fetch/fetch-npm-browserify.js\n ** module id = 11\n ** module chunks = 0 1\n **/","(function(self) {\n 'use strict';\n\n if (self.fetch) {\n return\n }\n\n function normalizeName(name) {\n if (typeof name !== 'string') {\n name = String(name)\n }\n if (/[^a-z0-9\\-#$%&'*+.\\^_`|~]/i.test(name)) {\n throw new TypeError('Invalid character in header field name')\n }\n return name.toLowerCase()\n }\n\n function normalizeValue(value) {\n if (typeof value !== 'string') {\n value = String(value)\n }\n return value\n }\n\n function Headers(headers) {\n this.map = {}\n\n if (headers instanceof Headers) {\n headers.forEach(function(value, name) {\n this.append(name, value)\n }, this)\n\n } else if (headers) {\n Object.getOwnPropertyNames(headers).forEach(function(name) {\n this.append(name, headers[name])\n }, this)\n }\n }\n\n Headers.prototype.append = function(name, value) {\n name = normalizeName(name)\n value = normalizeValue(value)\n var list = this.map[name]\n if (!list) {\n list = []\n this.map[name] = list\n }\n list.push(value)\n }\n\n Headers.prototype['delete'] = function(name) {\n delete this.map[normalizeName(name)]\n }\n\n Headers.prototype.get = function(name) {\n var values = this.map[normalizeName(name)]\n return values ? values[0] : null\n }\n\n Headers.prototype.getAll = function(name) {\n return this.map[normalizeName(name)] || []\n }\n\n Headers.prototype.has = function(name) {\n return this.map.hasOwnProperty(normalizeName(name))\n }\n\n Headers.prototype.set = function(name, value) {\n this.map[normalizeName(name)] = [normalizeValue(value)]\n }\n\n Headers.prototype.forEach = function(callback, thisArg) {\n Object.getOwnPropertyNames(this.map).forEach(function(name) {\n this.map[name].forEach(function(value) {\n callback.call(thisArg, value, name, this)\n }, this)\n }, this)\n }\n\n function consumed(body) {\n if (body.bodyUsed) {\n return Promise.reject(new TypeError('Already read'))\n }\n body.bodyUsed = true\n }\n\n function fileReaderReady(reader) {\n return new Promise(function(resolve, reject) {\n reader.onload = function() {\n resolve(reader.result)\n }\n reader.onerror = function() {\n reject(reader.error)\n }\n })\n }\n\n function readBlobAsArrayBuffer(blob) {\n var reader = new FileReader()\n reader.readAsArrayBuffer(blob)\n return fileReaderReady(reader)\n }\n\n function readBlobAsText(blob) {\n var reader = new FileReader()\n reader.readAsText(blob)\n return fileReaderReady(reader)\n }\n\n var support = {\n blob: 'FileReader' in self && 'Blob' in self && (function() {\n try {\n new Blob();\n return true\n } catch(e) {\n return false\n }\n })(),\n formData: 'FormData' in self,\n arrayBuffer: 'ArrayBuffer' in self\n }\n\n function Body() {\n this.bodyUsed = false\n\n\n this._initBody = function(body) {\n this._bodyInit = body\n if (typeof body === 'string') {\n this._bodyText = body\n } else if (support.blob && Blob.prototype.isPrototypeOf(body)) {\n this._bodyBlob = body\n } else if (support.formData && FormData.prototype.isPrototypeOf(body)) {\n this._bodyFormData = body\n } else if (!body) {\n this._bodyText = ''\n } else if (support.arrayBuffer && ArrayBuffer.prototype.isPrototypeOf(body)) {\n // Only support ArrayBuffers for POST method.\n // Receiving ArrayBuffers happens via Blobs, instead.\n } else {\n throw new Error('unsupported BodyInit type')\n }\n\n if (!this.headers.get('content-type')) {\n if (typeof body === 'string') {\n this.headers.set('content-type', 'text/plain;charset=UTF-8')\n } else if (this._bodyBlob && this._bodyBlob.type) {\n this.headers.set('content-type', this._bodyBlob.type)\n }\n }\n }\n\n if (support.blob) {\n this.blob = function() {\n var rejected = consumed(this)\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return Promise.resolve(this._bodyBlob)\n } else if (this._bodyFormData) {\n throw new Error('could not read FormData body as blob')\n } else {\n return Promise.resolve(new Blob([this._bodyText]))\n }\n }\n\n this.arrayBuffer = function() {\n return this.blob().then(readBlobAsArrayBuffer)\n }\n\n this.text = function() {\n var rejected = consumed(this)\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return readBlobAsText(this._bodyBlob)\n } else if (this._bodyFormData) {\n throw new Error('could not read FormData body as text')\n } else {\n return Promise.resolve(this._bodyText)\n }\n }\n } else {\n this.text = function() {\n var rejected = consumed(this)\n return rejected ? rejected : Promise.resolve(this._bodyText)\n }\n }\n\n if (support.formData) {\n this.formData = function() {\n return this.text().then(decode)\n }\n }\n\n this.json = function() {\n return this.text().then(JSON.parse)\n }\n\n return this\n }\n\n // HTTP methods whose capitalization should be normalized\n var methods = ['DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT']\n\n function normalizeMethod(method) {\n var upcased = method.toUpperCase()\n return (methods.indexOf(upcased) > -1) ? upcased : method\n }\n\n function Request(input, options) {\n options = options || {}\n var body = options.body\n if (Request.prototype.isPrototypeOf(input)) {\n if (input.bodyUsed) {\n throw new TypeError('Already read')\n }\n this.url = input.url\n this.credentials = input.credentials\n if (!options.headers) {\n this.headers = new Headers(input.headers)\n }\n this.method = input.method\n this.mode = input.mode\n if (!body) {\n body = input._bodyInit\n input.bodyUsed = true\n }\n } else {\n this.url = input\n }\n\n this.credentials = options.credentials || this.credentials || 'omit'\n if (options.headers || !this.headers) {\n this.headers = new Headers(options.headers)\n }\n this.method = normalizeMethod(options.method || this.method || 'GET')\n this.mode = options.mode || this.mode || null\n this.referrer = null\n\n if ((this.method === 'GET' || this.method === 'HEAD') && body) {\n throw new TypeError('Body not allowed for GET or HEAD requests')\n }\n this._initBody(body)\n }\n\n Request.prototype.clone = function() {\n return new Request(this)\n }\n\n function decode(body) {\n var form = new FormData()\n body.trim().split('&').forEach(function(bytes) {\n if (bytes) {\n var split = bytes.split('=')\n var name = split.shift().replace(/\\+/g, ' ')\n var value = split.join('=').replace(/\\+/g, ' ')\n form.append(decodeURIComponent(name), decodeURIComponent(value))\n }\n })\n return form\n }\n\n function headers(xhr) {\n var head = new Headers()\n var pairs = xhr.getAllResponseHeaders().trim().split('\\n')\n pairs.forEach(function(header) {\n var split = header.trim().split(':')\n var key = split.shift().trim()\n var value = split.join(':').trim()\n head.append(key, value)\n })\n return head\n }\n\n Body.call(Request.prototype)\n\n function Response(bodyInit, options) {\n if (!options) {\n options = {}\n }\n\n this.type = 'default'\n this.status = options.status\n this.ok = this.status >= 200 && this.status < 300\n this.statusText = options.statusText\n this.headers = options.headers instanceof Headers ? options.headers : new Headers(options.headers)\n this.url = options.url || ''\n this._initBody(bodyInit)\n }\n\n Body.call(Response.prototype)\n\n Response.prototype.clone = function() {\n return new Response(this._bodyInit, {\n status: this.status,\n statusText: this.statusText,\n headers: new Headers(this.headers),\n url: this.url\n })\n }\n\n Response.error = function() {\n var response = new Response(null, {status: 0, statusText: ''})\n response.type = 'error'\n return response\n }\n\n var redirectStatuses = [301, 302, 303, 307, 308]\n\n Response.redirect = function(url, status) {\n if (redirectStatuses.indexOf(status) === -1) {\n throw new RangeError('Invalid status code')\n }\n\n return new Response(null, {status: status, headers: {location: url}})\n }\n\n self.Headers = Headers;\n self.Request = Request;\n self.Response = Response;\n\n self.fetch = function(input, init) {\n return new Promise(function(resolve, reject) {\n var request\n if (Request.prototype.isPrototypeOf(input) && !init) {\n request = input\n } else {\n request = new Request(input, init)\n }\n\n var xhr = new XMLHttpRequest()\n\n function responseURL() {\n if ('responseURL' in xhr) {\n return xhr.responseURL\n }\n\n // Avoid security warnings on getResponseHeader when not allowed by CORS\n if (/^X-Request-URL:/m.test(xhr.getAllResponseHeaders())) {\n return xhr.getResponseHeader('X-Request-URL')\n }\n\n return;\n }\n\n xhr.onload = function() {\n var status = (xhr.status === 1223) ? 204 : xhr.status\n if (status < 100 || status > 599) {\n reject(new TypeError('Network request failed'))\n return\n }\n var options = {\n status: status,\n statusText: xhr.statusText,\n headers: headers(xhr),\n url: responseURL()\n }\n var body = 'response' in xhr ? xhr.response : xhr.responseText;\n resolve(new Response(body, options))\n }\n\n xhr.onerror = function() {\n reject(new TypeError('Network request failed'))\n }\n\n xhr.open(request.method, request.url, true)\n\n if (request.credentials === 'include') {\n xhr.withCredentials = true\n }\n\n if ('responseType' in xhr && support.blob) {\n xhr.responseType = 'blob'\n }\n\n request.headers.forEach(function(value, name) {\n xhr.setRequestHeader(name, value)\n })\n\n xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit)\n })\n }\n self.fetch.polyfill = true\n})(typeof self !== 'undefined' ? self : this);\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/whatwg-fetch/fetch.js\n ** module id = 12\n ** module chunks = 0 1\n **/","/*\n * The MIT License (MIT)\n *\n * Copyright (c) 2015 David Heidrich, BowlingX \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n/*!\n * FlexCss.Dropdown\n * Licensed under the MIT License (MIT)\n * Copyright (c) 2015 David Heidrich, BowlingX \n */\n\nimport Util from './util/Util';\nimport Settings from './util/Settings';\nimport Event from './util/Event';\nimport Widget from './Widget';\nimport FixedWindow from './lib/FixedWindow';\n\n/**\n * @type {string}\n */\nconst ATTR_CC = 'data-collision-container';\n/**\n * @type {string}\n */\nconst ATTR_DARKENER = 'data-darkener-container';\n/**\n * @type {string}\n */\nconst DARKENER_INIT = 'init';\n/**\n * @type {string}\n */\nconst ATTR_DATA_TARGET = 'data-target';\n/**\n * @type {string}\n */\nconst ATTR_CLOSE_DROPDOWN = 'data-close-dropdown';\n/**\n * @type {string}\n */\nconst ATTR_NAME = 'data-dropdown';\n/**\n * @type {string}\n */\nconst STATE_LOADING = 'loading';\n\nconst CLS_DARKENER_DROPDOWN = 'darkener-dropdown';\n/**\n * @type {string}\n */\nconst CLS_OPEN = 'open';\n\n/**\n * @type {string}\n */\nconst CLS_DROPDOWN = 'dropdown';\n\n/**\n * @type {string}\n */\nexport const EVENT_DROPDOWN_CLOSED = 'flexcss.dropdown.closed';\n\n/**\n * A Dropdown\n */\nclass Dropdown {\n constructor(DelegateContainer, Darkener) {\n const doc = global.document;\n\n /**\n * Container Element\n * @type {HTMLElement}\n */\n this.container = DelegateContainer instanceof HTMLElement ?\n DelegateContainer : doc.getElementById(DelegateContainer);\n\n this.currentOpen = null;\n this.currentTarget = null;\n /**\n * @type {HTMLElement}\n */\n this.darkener = Darkener instanceof HTMLElement ? Darkener : document.getElementById(Darkener);\n\n this.destroyOnClose = false;\n\n if (!this.darkener || !this.container) {\n throw new Error('required elements not found (darkener and container element)');\n }\n }\n\n /**\n * Method that handles delegation events for dropdowns\n * @param e\n * @returns {boolean}\n * @private\n */\n _delegateFunction(e) {\n const currentOpen = this.currentOpen;\n const target = Util.closestCallback(e.target, n => n instanceof HTMLElement && n.hasAttribute(ATTR_NAME));\n const targetIsCurrent = target === this.currentTarget;\n\n if (currentOpen && !Util.isPartOfNode(e.target, currentOpen) || targetIsCurrent) {\n this.close();\n if (targetIsCurrent) {\n e.preventDefault();\n }\n return targetIsCurrent ? false : this._delegateFunction(e);\n }\n\n if (target && !currentOpen) {\n e.preventDefault();\n e.stopImmediatePropagation();\n\n if (target.isLoading) {\n return false;\n }\n this.createDropdown(target);\n } else {\n if (currentOpen) {\n if (e.target.hasAttribute(ATTR_CLOSE_DROPDOWN)) {\n e.preventDefault();\n this.close();\n }\n if (!Util.isPartOfNode(e.target, currentOpen)) {\n this.close();\n }\n }\n }\n }\n\n /**\n * Register Events for this dropdown container\n * @returns {Dropdown}\n */\n registerEvents() {\n FixedWindow.getInstance().addScreenConstraint(Dropdown, (width) => width < Settings.get().smallBreakpoint);\n this.container.addEventListener(Settings.getTabEvent(), this._delegateFunction.bind(this), true);\n return this;\n }\n\n /**\n * Destroys this instance, unbinds events\n * @returns {Dropdown}\n */\n destroy() {\n this.container.removeEventListener(Settings.getTabEvent(), this._delegateFunction.bind(this), true);\n return this;\n }\n\n\n /**\n * Destroys instance on close of dropdown\n * @param v\n * @returns {Dropdown}\n */\n setDestroyOnClose(v) {\n this.destroyOnClose = v;\n return this;\n }\n\n\n /**\n * Will add the right class to container for specific darkener id\n * @param instance\n * @param show\n */\n toggleDarkenerToggler(instance, show) {\n const cls = `toggle-${(instance.id || CLS_DARKENER_DROPDOWN)}`;\n const classList = this.container.classList;\n if (show) {\n classList.add(cls);\n } else {\n classList.remove(cls);\n }\n }\n\n /**\n * Closes Dropdown on current instance\n * @return {Boolean|Promise}\n */\n close() {\n const currentOpen = this.currentOpen;\n if (!currentOpen) {\n return false;\n }\n const darkenerInstance = currentOpen.flexDarkenerInstance || this.darkener;\n const thisCurrentOpen = currentOpen;\n\n const future = new Promise((resolve) => {\n if (window.getComputedStyle(currentOpen).position === 'fixed') {\n Util.addEventOnce(Settings.getTransitionEvent(), currentOpen, function scheduler(e) {\n if (e.srcElement !== currentOpen) {\n return Util.addEventOnce(Settings.getTransitionEvent(), currentOpen, scheduler.bind(this));\n }\n requestAnimationFrame(() => {\n Event.dispatchAndFire(thisCurrentOpen, EVENT_DROPDOWN_CLOSED);\n // if a new dropdown has been opened in the meantime, do not remove darkener\n if (this.currentOpen !== null) {\n return false;\n }\n this.toggleDarkenerToggler(darkenerInstance, false);\n resolve(true);\n });\n }.bind(this));\n } else {\n resolve(true);\n Event.dispatchAndFire(thisCurrentOpen, EVENT_DROPDOWN_CLOSED);\n }\n });\n\n FixedWindow.getInstance().close();\n currentOpen.classList.remove(CLS_OPEN);\n\n if (currentOpen.flexDarkenerInstance) {\n currentOpen.flexDarkenerInstance.classList.remove(DARKENER_INIT);\n } else {\n this.darkener.classList.remove(DARKENER_INIT);\n }\n\n this.currentOpen = null;\n this.currentTarget = null;\n\n if (this.destroyOnClose) {\n this.destroy();\n }\n\n return future;\n }\n\n /**\n * Creates a dropdown on given target and opens it\n * @param {HTMLElement} target target where this dropdown is placed\n * @param {FlexCss.Widget} [thisWidget] if given will use widget instead of widget instance\n * @return {FlexCss.Dropdown}\n */\n createDropdown(target, thisWidget) {\n const doc = global.document;\n\n if (!target) {\n throw new Error('Dropdown target not found');\n }\n\n const widget = thisWidget || Widget.findWidget(target);\n let future;\n const data = target.getAttribute(ATTR_NAME);\n const dropdownContainerElement = doc.getElementById(data);\n const async = !dropdownContainerElement && Widget.isWidget(widget) ? widget.getAsync() : false;\n\n if (async) {\n target.classList.add(STATE_LOADING);\n target.isLoading = true;\n future = async.then((r) => {\n if (r instanceof HTMLElement) {\n if (r.id) {\n target.setAttribute(ATTR_NAME, r.id);\n }\n return r;\n }\n // Create container Element:\n const element = doc.createElement('div');\n element.className = CLS_DROPDOWN;\n element.innerHTML = r;\n element.id = Util.guid();\n // Cache target for later use:\n target.setAttribute(ATTR_NAME, element.id);\n this.container.appendChild(element);\n return element;\n }).then((r) => {\n target.isLoading = false;\n target.classList.remove(STATE_LOADING);\n return r;\n });\n } else {\n if (!dropdownContainerElement) {\n throw new Error(`Could not found Dropdown container with ID \"${data}\"`);\n }\n future = new Promise((r) => {\n r(dropdownContainerElement);\n });\n }\n\n future.then((dropdownContent) => {\n if (this.currentOpen) {\n this.close();\n }\n // Skip one frame to show animation\n target.dropdownContent = dropdownContent;\n const isAbsolute = global.getComputedStyle(dropdownContent).position === 'absolute';\n dropdownContent.hfWidgetInstance = this;\n\n if (!target.flexCollisionContainer) {\n const collisionC = target.getAttribute(ATTR_CC);\n target.flexCollisionContainer = collisionC ?\n doc.getElementById(collisionC) || document.documentElement : document.documentElement;\n }\n\n dropdownContent.classList.toggle(CLS_OPEN);\n if (dropdownContent.classList.contains(CLS_OPEN)) {\n this.currentOpen = dropdownContent;\n this.currentTarget = target;\n }\n FixedWindow.getInstance().open(this, dropdownContent);\n if (isAbsolute) {\n // Check collision:\n let selfTarget = target.getAttribute(ATTR_DATA_TARGET);\n selfTarget = selfTarget ? doc.getElementById(selfTarget) : target;\n Util.setupPositionNearby(selfTarget, dropdownContent, target.flexCollisionContainer);\n } else {\n // optionally get custom darkener container for target\n const d = target.getAttribute(ATTR_DARKENER);\n if (d) {\n dropdownContent.flexDarkenerInstance = doc.getElementById(d);\n (dropdownContent.flexDarkenerInstance || this.darkener).classList.toggle(DARKENER_INIT);\n } else {\n this.darkener.classList.toggle(DARKENER_INIT);\n }\n this.toggleDarkenerToggler(dropdownContent.flexDarkenerInstance || this.darkener, true);\n\n dropdownContent.style.left = '0';\n dropdownContent.style.top = 'auto';\n }\n });\n }\n\n}\n\nexport default Dropdown;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/main/Dropdown.js\n **/","/*\n * The MIT License (MIT)\n *\n * Copyright (c) 2015 David Heidrich, BowlingX \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n/*!\n * FlexCss.LightBox\n * Licensed under the MIT License (MIT)\n * Copyright (c) 2015 David Heidrich, BowlingX \n */\n\n/* global Image, TouchEvent*/\n\nimport Modal, { EVENT_MODAL_CLOSED } from './Modal';\nimport Settings from './util/Settings';\nimport Widget from './Widget';\n\nconst ATTR_MAX_WIDTH = 'data-original-width';\nconst ATTR_MAX_HEIGHT = 'data-original-height';\nconst ATTR_SRC = 'data-src';\n\nconst CLS_HAS_PREV = 'has-prev';\nconst CLS_HAS_NEXT = 'has-next';\nconst CLS_LOADING = 'loading';\n\nconst ATTR_NO_THUMBNAIL = 'data-no-thumbnail';\nconst ATTR_DATA_HREF = 'data-href';\nconst ATTR_HREF = 'href';\n\nconst KEY_NEXT = 39;\nconst KEY_PREV = 37;\nconst ATTR_CLOSE = 'data-close-modal';\n/**\n * A Simple LightBox\n */\nclass LightBox {\n\n /**\n * Creates a new Lightbox\n * @param DelegateContainer\n * @param AttributeSelector\n * @param ModalAppend\n * @param [options]\n */\n constructor(DelegateContainer, AttributeSelector, ModalAppend, options) {\n const thisDelegateContainer = DelegateContainer instanceof HTMLElement ? DelegateContainer :\n document.getElementById(DelegateContainer);\n\n this._modalAppend = ModalAppend || DelegateContainer;\n /**\n * @type {Function}\n */\n this._resizeEvent = null;\n /**\n * @type {Function}\n */\n this._keyboardNextEvent = null;\n /**\n * @type {Promise}\n */\n this._future = null;\n /**\n * @type {Promise}\n */\n this._nextFuture = this._future;\n /**\n * @type {HTMLElement}\n */\n this._imageContainer = null;\n /**\n * @type {HTMLElement}\n */\n this._modalContainerDiv = null;\n /**\n * @type {HTMLElement}\n */\n this._contentContainer = null;\n /**\n * @type {HTMLElement}\n */\n this._closerContainerDiv = null;\n /**\n * @type {HTMLElement}\n */\n this._delegateContainer = thisDelegateContainer;\n /**\n * @type {HTMLElement}\n */\n this._attributeSelector = AttributeSelector;\n /**\n * @type {Widget}\n */\n this._widget = null;\n /**\n * @type {boolean}\n */\n this._isOpen = false;\n /**\n * @type {HTMLElement}\n */\n this.target = null;\n /**\n * @type {HTMLElement}\n */\n this.img = null;\n /**\n * @type {boolean}\n */\n this._isLoading = false;\n\n /**\n * Default options\n */\n this.options = {\n // set if prev and next should be available\n registerPrevNextEvents: true,\n // set if modal should be closed after last image\n closeOnLast: true,\n // called when next image is requested (either by keyboard or click), return false to abort\n onNext: () => {\n return true;\n },\n onClose: () => {\n },\n getNext: null,\n getPrev: null,\n // called when underlying target changed\n onSwitchImage: () => {\n }\n };\n\n Object.assign(this.options, options);\n }\n\n /**\n * @param {HTMLElement} node\n * @returns {HTMLElement|null}\n */\n findImmediateNextTarget(node) {\n if (node && node.children[0].hasAttribute(this._attributeSelector)) {\n return node.children[0];\n }\n return null;\n }\n\n /**\n * Will fetch the next element of a lightBox\n * @param {HTMLElement} target\n * @returns {null|HTMLElement}\n */\n getNext(target) {\n if (this.options.getNext) {\n return this.options.getNext.apply(this, [target]);\n }\n return this.findImmediateNextTarget(target.parentNode.nextElementSibling);\n }\n\n /**\n * Will fetch the previous element of a lightBox\n * @param {HTMLElement} target\n * @returns {null|HTMLElement}\n */\n getPrev(target) {\n if (this.options.getPrev) {\n return this.options.getPrev.apply(this, [target]);\n }\n return this.findImmediateNextTarget(target.parentNode.previousElementSibling);\n }\n\n /**\n * Registers events for delegate container\n */\n registerEvents(onOpen) {\n this._delegateContainer.addEventListener(Settings.getTabEvent(), (e) => {\n let target = e.target;\n const parent = target.parentNode;\n let validTarget = target.hasAttribute(this._attributeSelector);\n const parentIsValid = parent && parent.hasAttribute(this._attributeSelector);\n\n if (!validTarget && parentIsValid) {\n validTarget = true;\n target = parent;\n }\n if (validTarget) {\n e.preventDefault();\n this.open(target).then((r) => {\n if (onOpen) {\n onOpen.apply(this, [r, target]);\n }\n });\n }\n });\n }\n\n /**\n * @returns {HTMLElement}\n */\n getContentContainer() {\n return this._contentContainer;\n }\n\n /**\n * Setup max-width and max-height\n * @param {HTMLElement} target\n * @param {HTMLElement} img\n * @param {HTMLElement} loadedImage\n * @private\n */\n static _setupMaxWidthHeight(target, img, loadedImage) {\n const nextMaxWidth = target.getAttribute(ATTR_MAX_WIDTH);\n const nextMaxHeight = target.getAttribute(ATTR_MAX_HEIGHT);\n if (nextMaxWidth && nextMaxHeight) {\n img.style.maxWidth = nextMaxWidth + \"px\";\n img.style.maxHeight = nextMaxHeight + \"px\";\n } else {\n img.style.maxWidth = loadedImage.width + \"px\";\n img.style.maxHeight = loadedImage.height + \"px\";\n }\n }\n\n /**\n * Switches to the next image\n * @param {boolean} direction\n */\n switchImageByDirection(direction) {\n const next = direction ? this.getPrev(this.target) : this.getNext(this.target);\n if (this.options.onNext.apply(this, [next])) {\n return this.switchImage(next);\n }\n return new Promise((_, reject) => reject(next));\n }\n\n /**\n * Checks if lightbox is currently loading\n * @returns {boolean}\n */\n isLoading() {\n return this._isLoading;\n }\n\n /**\n * Checks if modal should be closed\n * @private\n */\n _runOptionalClose() {\n if (this.options.closeOnLast) {\n this.modal.close();\n }\n }\n\n _setupPrevNextStates() {\n const target = this.target;\n const hasPrev = this.getPrev(target);\n const hasNext = this.getNext(target);\n const hasPrevClass = CLS_HAS_PREV;\n const hasNextClass = CLS_HAS_NEXT;\n // because IE does not support the second toggle parameter, we need to do this manually\n if (hasPrev) {\n this._imageContainer.classList.add(hasPrevClass);\n } else {\n this._imageContainer.classList.remove(hasPrevClass);\n }\n if (hasNext) {\n this._imageContainer.classList.add(hasNextClass);\n } else {\n this._imageContainer.classList.remove(hasNextClass);\n }\n }\n\n /**\n * @param img\n * @private\n */\n _calculateContainer(img) {\n if (Settings.isIE()) {\n setTimeout(() => {\n this._imageContainer.style.height = img.offsetHeight + 'px';\n }, 0);\n }\n }\n\n /**\n * Switch to a specific image\n * @param next\n * @returns {*}\n */\n switchImage(next) {\n const self = this;\n const img = this.img;\n this._isLoading = true;\n self._nextFuture = new Promise((resolve, reject) => {\n // notify observers about image switching\n self.options.onSwitchImage.apply(self, [self._nextFuture]);\n if (next) {\n const nextThumb = next.hasAttribute(ATTR_NO_THUMBNAIL) ? next : (next.children[0] || next);\n const nextHighRes = next.getAttribute(ATTR_DATA_HREF) ||\n next.getAttribute(ATTR_HREF);\n const nextSource = nextThumb.getAttribute(ATTR_SRC) || nextThumb.src || nextHighRes;\n const nextImgObject = new Image();\n\n if (!nextSource) {\n reject(next);\n return;\n }\n // set new target to next element\n this.target = next;\n nextImgObject.src = nextSource;\n self._imageContainer.classList.add(CLS_LOADING);\n nextImgObject.addEventListener('load', () => {\n img.src = nextSource;\n self._imageContainer.style.backgroundImage = 'url(' + nextSource + ')';\n LightBox._setupMaxWidthHeight(next, img, nextImgObject);\n self._calculateContainer(img);\n self.highRes(nextThumb, nextHighRes);\n self._setupPrevNextStates();\n self._imageContainer.classList.remove(CLS_LOADING);\n this._isLoading = false;\n resolve(nextSource, this.target);\n });\n } else {\n reject(this);\n }\n });\n return self._nextFuture;\n }\n\n\n /**\n * Setup High-Resolution picture\n * @param {HTMLElement} thisThumbnail\n * @param {String} thisImgHighResolution\n */\n highRes(thisThumbnail, thisImgHighResolution) {\n if (thisImgHighResolution && thisThumbnail.src !== thisImgHighResolution) {\n const highImageObj = new Image();\n highImageObj.src = thisImgHighResolution;\n highImageObj.addEventListener('load', () => {\n // if current image is still available\n if (this._getSrc(thisThumbnail) === this.img.src) {\n this.img.src = thisImgHighResolution;\n this._imageContainer.style.backgroundImage = 'url(' + thisImgHighResolution + ')';\n }\n });\n }\n }\n\n /**\n * Extracts the source of an image\n * @param target\n * @returns {String|null}\n * @private\n */\n _getSrc(target) {\n return target.getAttribute(ATTR_SRC) || target.src;\n }\n\n /**\n * Will show a lightBox on given target\n * @param {HTMLElement} target\n * @returns {$.Deferred|*}\n */\n open(target) {\n const self = this;\n\n if (!target) {\n return false;\n }\n\n this.target = target;\n\n // if lightBox is open, we just switch to the new target image\n if (this._isOpen && target) {\n return this.switchImage(target).then(() => {\n return this;\n });\n }\n\n this._isOpen = true;\n\n /**\n * Setup Widget for modal\n * @type {Widget}\n */\n this._widget = new Widget().setAsync(() => {\n // thumbnail is either target itself or expected to be first childNode\n const thumbnail = target.hasAttribute(ATTR_NO_THUMBNAIL) ? target : (target.children[0] || target);\n\n const imgHighResolution = target.getAttribute(ATTR_DATA_HREF) || target.getAttribute(ATTR_HREF);\n const imgSrc = this._getSrc(thumbnail) || imgHighResolution;\n\n const imageObj = new Image();\n imageObj.src = imgSrc;\n this._imageContainer = document.createElement('div');\n this._modalContainerDiv = document.createElement('div');\n this._closerContainerDiv = document.createElement('i');\n this._contentContainer = document.createElement('div');\n\n this._closerContainerDiv.className = 'modal-close modal-close-lightbox icon-cancel-1';\n this._closerContainerDiv.setAttribute(ATTR_CLOSE, ATTR_CLOSE);\n\n this._modalContainerDiv.className = 'modal image-modal';\n this._modalContainerDiv.appendChild(this._imageContainer);\n this._modalContainerDiv.appendChild(this._contentContainer);\n this._modalContainerDiv.appendChild(this._closerContainerDiv);\n this._contentContainer.className = 'content-container';\n this._isLoading = true;\n this._future = new Promise((resolve) => {\n imageObj.addEventListener('load', () => {\n this._imageContainer.className = 'image-container';\n const img = document.createElement('img');\n // current image\n this.img = img;\n\n img.src = imgSrc;\n LightBox._setupMaxWidthHeight(target, img, imageObj);\n this._imageContainer.appendChild(img);\n this._imageContainer.style.backgroundImage = 'url(' + imgSrc + ')';\n\n resolve(self._modalContainerDiv);\n this._isLoading = false;\n\n if (Settings.isIE()) {\n self._resizeEvent = global.addEventListener('resize', () => {\n setTimeout(() => {\n self._imageContainer.style.height = img.offsetHeight + 'px';\n }, 0);\n });\n }\n\n if (self.options.registerPrevNextEvents) {\n self._setupPrevNextStates();\n // prev or next on touch/click\n self._imageContainer.addEventListener(Settings.getTabEvent(), (e) => {\n if (self.isLoading()) {\n return;\n }\n e.preventDefault();\n\n const ev = e;\n const pageX = global.TouchEvent && ev instanceof TouchEvent ?\n ev.changedTouches[0].pageX : ev.pageX;\n const rect = self._imageContainer.getBoundingClientRect();\n const imgX = rect.left;\n const wrapperWidth = rect.width;\n const posX = pageX - imgX;\n\n self.switchImageByDirection(wrapperWidth / 2 > posX).catch(() => {\n self._runOptionalClose();\n });\n });\n\n // register keyboard events\n self._keyboardNextEvent = (e) => {\n if (e.keyCode === KEY_NEXT || e.keyCode === KEY_PREV) {\n if (self.isLoading()) {\n return;\n }\n self.switchImageByDirection(e.keyCode === KEY_PREV).catch(() => {\n self._runOptionalClose();\n });\n }\n };\n global.addEventListener('keydown', self._keyboardNextEvent);\n } else {\n self._imageContainer.addEventListener(Settings.getTabEvent(), () => {\n self._runOptionalClose();\n });\n }\n\n self.highRes(thumbnail, imgHighResolution);\n });\n });\n\n this._future.then(() => {\n self._calculateContainer(this.img);\n });\n\n self._modalContainerDiv.addEventListener(EVENT_MODAL_CLOSED, () => {\n // cleanup:\n this._modalContainerDiv.parentNode.removeChild(this._modalContainerDiv);\n this.options.onClose.apply(self);\n this._isOpen = false;\n this.modal.destroy();\n // unbind events\n if (this._keyboardNextEvent) {\n global.removeEventListener('keydown', self._keyboardNextEvent);\n }\n if (this._resizeEvent) {\n global.removeEventListener('resize', self._resizeEvent);\n }\n });\n\n return this._future;\n });\n\n this._nextFuture = this._future;\n\n if (self._widget) {\n this.modal = new Modal(this._modalAppend);\n // make sure we close stack before\n return this.modal.close().fromWidget(self._widget).then(() => {\n return self._future.then(() => {\n return self;\n });\n });\n }\n return false;\n }\n\n}\n\nexport default LightBox;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/main/LightBox.js\n **/","/*\n * The MIT License (MIT)\n *\n * Copyright (c) 2015 David Heidrich, BowlingX \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n/*!\n * FlexCss.OffCanvas\n * Licensed under the MIT License (MIT)\n * Copyright (c) 2015 David Heidrich, BowlingX \n */\n\nimport Settings from './util/Settings';\nimport Util from './util/Util';\nimport Event from './util/Event';\nimport FixedWindow from './lib/FixedWindow';\n\n/**\n * @type {string}\n */\nconst ATTR_CLOSE_SIDEBAR = 'data-close-offcanvas';\n\n/**\n * @type {string}\n */\nconst ATTR_TARGET = 'data-offcanvas';\n/**\n * @type {string}\n */\nconst INIT_CLASS = 'init';\n/**\n * @type {string}\n */\nconst OPEN_CLASS = 'open';\n/**\n * @type {number}\n */\nconst HIDE_FACTOR = 3;\n\n/**\n * @type {string}\n */\nexport const EVENT_TOGGLE = 'flexcss.offcanvas.toggle';\n\n/**\n * A OffCanvas Implementation\n */\nclass OffCanvas {\n\n /**\n * Creates an off-canvas navigation\n * @param {HTMLElement|String} NavigationId\n * @param {HTMLElement|String} Darkener\n * @param {int} factor positive will expect right sidebar, positive left\n * @param {bool} [disableTouch] if true all touch events are disabled\n * @constructor\n */\n constructor(NavigationId, Darkener, factor, disableTouch) {\n const doc = global.document;\n let touchedX = 0;\n const navigationContainer = NavigationId instanceof HTMLElement ?\n NavigationId : doc.getElementById(NavigationId);\n const darkener = Darkener instanceof HTMLElement ? Darkener : doc.getElementById(Darkener);\n const DARKENER_CLASS_TOGGLE = `toggle-${darkener.id}` || 'darkener';\n const DARKENER_CLASS_INSTANT_TOGGLE = `${DARKENER_CLASS_TOGGLE}-open`;\n\n const shouldNotTouch = () => {\n return window.innerWidth >= Settings.get().smallBreakpoint;\n };\n\n if (!darkener || !navigationContainer) {\n throw new Error('Could not find needed elements (Darkener and/or NavigationId)');\n }\n\n this.darkener = darkener;\n this.darkenerClassToggle = DARKENER_CLASS_TOGGLE;\n this.darkenerClassToggleInstant = DARKENER_CLASS_INSTANT_TOGGLE;\n this.globalToggleClass = Settings.get().canvasToggledClass;\n\n this.navigationContainer = navigationContainer;\n this.navigationContainerId = navigationContainer.id;\n\n // create id if id does not exist\n if (!this.navigationContainerId) {\n this.navigationContainerId = Util.guid();\n navigationContainer.id = this.navigationContainerId;\n }\n\n if (!disableTouch) {\n navigationContainer.addEventListener('touchstart', (e) => {\n if (shouldNotTouch()) {\n return;\n }\n touchedX = e.touches[0].clientX;\n navigationContainer.mustHide = false;\n });\n navigationContainer.addEventListener('touchmove', (e) => {\n if (shouldNotTouch()) {\n return;\n }\n const { clientX } = e.touches[0];\n const target = navigationContainer;\n const style = target.style;\n const calcX = touchedX - clientX;\n const bounds = target.getBoundingClientRect();\n const compare = factor > 0 ? calcX <= 0 : calcX >= 0;\n if (compare) {\n style.transition = 'transform 0s ease';\n style.webkitTransition = '-webkit-transform 0s ease';\n target.mustHide = factor > 0 ? calcX * -1 >\n bounds.width / HIDE_FACTOR : calcX > bounds.width / HIDE_FACTOR;\n const transform = `translate3d(${calcX * -1}px,0,0)`;\n style.transform = transform;\n style.webkitTransform = transform;\n }\n });\n navigationContainer.addEventListener('touchend', () => {\n if (shouldNotTouch()) {\n return;\n }\n const target = navigationContainer;\n const style = target.style;\n if (target.mustHide) {\n const width = target.getBoundingClientRect().width * factor;\n style.transition = 'transform .2s ease';\n style.webkitTransition = '-webkit-transform .2s ease';\n const transform = `translate3d(${width}px,0,0)`;\n style.transform = transform;\n style.webkitTransform = transform;\n this._remove().then(() => {\n this.resetTransform(style);\n });\n this._removeInstant();\n } else {\n this.resetTransform(style);\n }\n });\n }\n }\n\n /**\n * @param {Object} s\n */\n resetTransform(s) {\n s.transform = '';\n s.transition = '';\n s.webkitTransform = '';\n s.webkitTransition = '';\n }\n\n /**\n * @param {Object} [event]\n * @private\n */\n _remove(event) {\n return new Promise((resolve) => {\n Util.addEventOnce(Settings.getTransitionEvent(), this.navigationContainer, function scheduler(e) {\n if (e.target !== this.navigationContainer) {\n return Util.addEventOnce(Settings.getTransitionEvent(),\n this.navigationContainer, scheduler.bind(this));\n }\n requestAnimationFrame(() => {\n OffCanvas.currentOpen = null;\n const docCls = global.document.documentElement.classList;\n docCls.remove(this.darkenerClassToggle);\n docCls.remove(this.globalToggleClass);\n if (!!event) {\n Event.dispatchAndFire(this.navigationContainer, EVENT_TOGGLE);\n }\n resolve();\n });\n }.bind(this));\n });\n }\n\n /**\n * @private\n */\n _removeInstant() {\n this.navigationContainer.classList.remove(OPEN_CLASS);\n global.document.documentElement.classList.remove(this.darkenerClassToggleInstant);\n this.darkener.classList.remove(INIT_CLASS);\n FixedWindow.getInstance().close();\n }\n\n /**\n * Toggles a an off-canvas element\n * @param [e]\n * @private\n */\n toggle(e) {\n if (e) {\n e.preventDefault();\n }\n this.resetTransform(this.navigationContainer.style);\n const darkenerClass = this.darkener.classList;\n const DARKENER_CLASS_TOGGLE = this.darkenerClassToggle;\n const DARKENER_CLASS_INSTANT_TOGGLE = this.darkenerClassToggleInstant;\n const navigationControllerClassList = this.navigationContainer.classList;\n if (!OffCanvas.currentOpen) {\n Util.addEventOnce(Settings.getTransitionEvent(), this.navigationContainer, () => {\n if (!!e) {\n Event.dispatchAndFire(this.navigationContainer, EVENT_TOGGLE);\n }\n });\n OffCanvas.currentOpen = this;\n FixedWindow.getInstance().open(this, this.navigationContainer);\n const docElementCls = global.document.documentElement.classList;\n docElementCls.add(this.globalToggleClass);\n docElementCls.add(DARKENER_CLASS_INSTANT_TOGGLE);\n docElementCls.add(DARKENER_CLASS_TOGGLE);\n darkenerClass.add(INIT_CLASS);\n navigationControllerClassList.add(OPEN_CLASS);\n } else {\n return this.close(e);\n }\n }\n\n close(event) {\n if (this.navigationContainer.classList.contains(OPEN_CLASS)) {\n const promise = this._remove(event);\n this._removeInstant();\n return promise;\n }\n return new Promise(r => r());\n }\n\n /**\n * Register events\n * @param [delegate]\n */\n registerEvents(delegate) {\n const thisDelegate = delegate || global.document;\n FixedWindow.getInstance().addScreenConstraint(OffCanvas, (width) => width < Settings.get().smallBreakpoint);\n thisDelegate.addEventListener(Settings.getTabEvent(), (e) => {\n if (OffCanvas.currentOpen && OffCanvas.currentOpen !== this) {\n return;\n }\n const id = this.navigationContainerId;\n const validTarget = e.target.getAttribute(ATTR_TARGET) === id;\n if (!Util.isPartOfNode(e.target, this.navigationContainer)) {\n if (validTarget || (OffCanvas.currentOpen === this && e.target === this.darkener)) {\n this.toggle(e);\n }\n } else {\n if (e.target.hasAttribute(ATTR_CLOSE_SIDEBAR)) {\n this.toggle(e);\n }\n }\n });\n }\n}\n\nOffCanvas.currentOpen = null;\n\nexport default OffCanvas;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/main/OffCanvas.js\n **/","/*\n * The MIT License (MIT)\n *\n * Copyright (c) 2015 David Heidrich, BowlingX \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n/*!\n * FlexCss.Toggleable\n * Licensed under the MIT License (MIT)\n * Copyright (c) 2015 David Heidrich, BowlingX \n */\n\nimport Settings from './util/Settings';\nimport Widget from './Widget';\nimport Util from './util/Util';\nimport Event from './util/Event';\n\n/**\n * Event that is fired when a tab is closed\n * @type {string}\n */\n\nexport const EVENT_TAB_CLOSED = 'flexcss.tab.closed';\n\n/**\n * Event that is fired when a tab has been opened\n * @type {string}\n */\nexport const EVENT_TAB_OPENED = 'flexcss.tab.opened';\n/**\n * @type {string}\n */\nconst ATTR_NAME = 'data-toggle';\n/**\n * @type {string}\n */\nconst ACTIVE_CLASS = 'active';\n/**\n * @type {string}\n */\nconst LOADING_CLASS = 'loading';\n\n/**\n * @type {string}\n */\nconst ATTR_TOGGLE_LIST = 'data-toggle-list';\n\n/**\n * Creates a toggleable element, either for tabs or a single toggle\n */\nclass Toggleable {\n constructor(ContainerId) {\n const doc = global.document;\n\n this.container = ContainerId instanceof HTMLElement ? ContainerId :\n doc.getElementById(ContainerId);\n\n this.loading = false;\n\n if (!this.container) {\n throw new Error(`Toggleable container with id ${ContainerId} not found`);\n }\n }\n\n /**\n * Listener\n * @param {Event} e\n * @private\n */\n _listener(e) {\n let target = e.target;\n const parent = target.parentNode;\n const doc = global.document;\n\n // support target child element to clicked\n if (!target.hasAttribute(ATTR_NAME)) {\n if (parent && parent.hasAttribute(ATTR_NAME)) {\n target = parent;\n } else {\n return;\n }\n }\n\n if (!target.hasAttribute(ATTR_NAME)) {\n return;\n }\n\n const refId = target.getAttribute(ATTR_NAME);\n const ref = doc.getElementById(refId);\n\n e.preventDefault();\n\n if (this.loading) {\n return;\n }\n\n this.toggleTarget(ref, target);\n }\n\n /**\n * Registers Events for this instance\n * @returns {Toggleable}\n */\n registerEvents() {\n this.container.addEventListener(Settings.getTabEvent(), this._listener.bind(this));\n return this;\n }\n\n /**\n * Toggles given `ref`\n * @param {HTMLElement|Node} ref\n * @param {HTMLElement|Node} [selfTarget] optional target node\n */\n toggleTarget(ref, selfTarget) {\n let target = selfTarget;\n if (!target && !ref) {\n return;\n }\n if (!target) {\n target = document.querySelector(`[${ATTR_NAME}=\"${ref.id}\"]`);\n }\n\n let future;\n const elClassList = target.classList;\n const parent = target.parentNode;\n const doc = global.document;\n\n future = new Promise((resolve, failure) => {\n if (ref) {\n resolve(ref);\n } else {\n const widget = Widget.findWidget(target);\n const async = widget ? widget.getAsync() : null;\n if (Widget.isWidget(widget) && async) {\n future = async.then((r) => {\n if (r instanceof HTMLElement) {\n const id = Util.guid();\n r.id = id;\n target.setAttribute(ATTR_NAME, id);\n resolve(r);\n } else {\n throw new Error(`Dynamically creating toggle-content is not supported right now.\n Return an HTMLElement instance`);\n }\n });\n } else {\n failure('Target not given');\n }\n }\n });\n\n if (parent) {\n const maybeToggleNode = Util.parentsUntil(target, (node) => {\n return node && node.hasAttribute && node.hasAttribute(ATTR_TOGGLE_LIST);\n });\n\n const parentClassList = parent.classList;\n // Abort if element is already active and if is part of a toggle list\n if (maybeToggleNode) {\n if (!parentClassList.contains(ACTIVE_CLASS)) {\n parentClassList.toggle(ACTIVE_CLASS);\n parentClassList.add(LOADING_CLASS);\n } else {\n return;\n }\n }\n\n if (maybeToggleNode) {\n for (let i = 0; i < maybeToggleNode.children.length; i++) {\n const n = maybeToggleNode.children[i];\n const targetRef = n.children[0];\n if (n !== parent) {\n n.classList.remove(ACTIVE_CLASS);\n if (targetRef) {\n const attr = targetRef.getAttribute(ATTR_NAME);\n const el = attr ? doc.getElementById(attr) : null;\n if (el) {\n Event.dispatchAndFire(el, EVENT_TAB_CLOSED);\n el.classList.remove(ACTIVE_CLASS);\n targetRef.classList.remove(ACTIVE_CLASS);\n }\n }\n }\n }\n }\n }\n if (elClassList) {\n elClassList.toggle(ACTIVE_CLASS);\n elClassList.add(LOADING_CLASS);\n }\n this.loading = true;\n future.then((r) => {\n Event.dispatchAndFire(r, EVENT_TAB_OPENED);\n Toggleable._handleLoaded(target);\n r.classList.toggle(ACTIVE_CLASS);\n this.loading = false;\n }).catch(() => {\n this.loading = false;\n Toggleable._handleLoaded(target);\n });\n }\n\n /**\n * @param el\n * @private\n */\n static _handleLoaded(el) {\n const parentClassList = el.parentNode.classList;\n el.classList.remove(LOADING_CLASS);\n if (parentClassList) {\n parentClassList.remove(LOADING_CLASS);\n }\n }\n}\n\nexport default Toggleable;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/main/Toggleable.js\n **/","import Form from '../Form';\nimport Tooltip from '../Tooltip';\nimport Modal from '../Modal';\nimport Widget from '../Widget';\nimport Settings from '../util/Settings';\nimport Toggleable from '../Toggleable';\nimport OffCanvas from '../OffCanvas';\nimport Dropdown from '../Dropdown';\nimport LightBox from '../LightBox';\nimport Util from '../util/Util';\n\nexport { Form, Tooltip, Modal, Widget, Settings, Util, Toggleable, OffCanvas, Dropdown, LightBox };\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/main/modules/All.js\n **/"],"sourceRoot":""} \ No newline at end of file diff --git a/build/maps/form.map b/build/maps/form.map index 0ef26ed4..d0b61ec6 100644 --- a/build/maps/form.map +++ b/build/maps/form.map @@ -1 +1 @@ -{"version":3,"sources":["webpack:///webpack/universalModuleDefinition?5ca6**","webpack:///webpack/bootstrap 8d0e91e18875c4432251?cd11**","webpack:///./src/main/Form.js?18a8","webpack:///./src/main/Tooltip.js?3890","webpack:///./src/main/util/Util.js?5bc4","webpack:///./src/main/DestroyableWidget.js?8d9b","webpack:///./src/main/util/Settings.js?b01f","webpack:///./~/isomorphic-fetch/fetch-npm-browserify.js?7723","webpack:///./~/whatwg-fetch/fetch.js?1c20","webpack:///./src/main/util/Event.js?68bf","webpack:///./src/main/modules/Form.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;ACVA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,uBAAe;AACf;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;;;;;;;;;;;;;;;;;;;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AAiB,gBAAjB,CAD/B;cAApC;AAGA,oBAAO,OAAO,sBAAP,CAJY;;;;;;;;;;gCAWT;AACV,iBAAI,CAAC,OAAO,mBAAP,EAA4B;AAC7B,wBAAO,mBAAP,GAA6B,mBAAmB,MAAnB,CADA;cAAjC;AAGA,oBAAO,OAAO,mBAAP,CAJG;;;;;;;;;8CAUc;AACxB,oBAAO,OAAO,8BAAP,CADiB;;;;;;;;;6CAOD;AACvB,oBAAO,OAAO,6BAAP,CADgB;;;;;;;;;uCAON;AACjB,oBAAO,OAAO,uBAAP,CADU;;;;YA5EnB;;;mBAiFS,S;;;;;;;ACvJf;AACA;AACA;AACA;AACA;AACA;;;;;;;ACLA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,QAAO;;AAEP,MAAK;AACL;AACA;AACA,QAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,QAAO;AACP,MAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,QAAO;AACP;AACA;AACA,MAAK;AACL;AACA;AACA;;AAEA;AACA;;;AAGA;AACA;AACA;AACA;AACA,QAAO;AACP;AACA,QAAO;AACP;AACA,QAAO;AACP;AACA,QAAO;AACP;AACA;AACA,QAAO;AACP;AACA;;AAEA;AACA;AACA,wDAAuD;AACvD,UAAS;AACT;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,UAAS;AACT;AACA,UAAS;AACT;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,UAAS;AACT;AACA,UAAS;AACT;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;;AAEA;AACA,wCAAuC,0BAA0B;AACjE;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA,gCAA+B,0BAA0B,eAAe;AACxE;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,QAAO;AACP;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,QAAO;;AAEP;AACA,MAAK;AACL;AACA;AACA,EAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACxWD,EAAC,SAAS,IAAT,GAAgB;AACb,SAAI,CAA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IAAP,CALU;;;;;;;;;gCAWP;AACH,iBAAM,IAAI,IAAI,WAAJ,CAAgB,KAAK,IAAL,EAAW,KAAK,cAAL,CAA/B,CADH;AAEH,iBAAI,KAAK,MAAL,EAAa;AACb,sBAAK,MAAL,CAAY,aAAZ,CAA0B,CAA1B,EADa;cAAjB;AAGA,oBAAO,CAAP,CALG;;;;YArDL;;;KA8DA;;;;;;;;;;;;;;kCAOc,QAAQ,MAAM;AAC1B,oBAAO,IAAI,YAAJ,CAAiB,MAAjB,EAAyB,IAAzB,CAAP,CAD0B;;;;;;;;;;;;;yCAWP,QAAQ,MAAM,SAAS;AAC1C,oBAAO,IAAI,YAAJ,CAAiB,MAAjB,EAAyB,IAAzB,EAA+B,WAA/B,CAA2C,OAA3C,EAAoD,IAApD,EAAP,CAD0C;;;;YAlB5C;;;mBAuBS,M;;;;;;;;;;;;;;;ACtIf;;;;;;;;;;;;;;;;;;;;;mBAOe;AACX,yBADW;AAEX,iCAFW;AAGX,+BAHW","file":"js/form.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"FlexCss\"] = factory();\n\telse\n\t\troot[\"FlexCss\"] = factory();\n})(this, function() {\nreturn \n\n\n/** WEBPACK FOOTER **\n ** webpack/universalModuleDefinition\n **/"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"../\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n/** WEBPACK FOOTER **\n ** webpack/bootstrap 8d0e91e18875c4432251\n **/","/*global HTMLFormElement, fetch, FormData, clearTimeout, NodeList*/\n\n/*\n * The MIT License (MIT)\n *\n * Copyright (c) 2015 David Heidrich, BowlingX \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n/*!\n * FlexCss.Form\n * Licensed under the MIT License (MIT)\n * Copyright (c) 2015 David Heidrich, BowlingX \n */\n\nimport Tooltip from './Tooltip';\nimport 'isomorphic-fetch';\nimport Event from './util/Event';\nimport Util from './util/Util';\nimport Settings from './util/Settings';\nimport DestroyableWidget from './DestroyableWidget';\n\nconst LOADING_CLASS = 'loading';\nconst DATA_ELEMENT_INVALID = 'data-flexcss-invalid';\nconst REMOTE = 'data-remote';\nconst REMOTE_ACTION = 'data-remote-action';\nconst ATTR_DISABLE_INLINE = 'data-disable-inline-validation';\nconst ATTR_DISABLE_REALTIME = 'data-disable-realtime-validation';\nconst ATTR_VALIDATOR = 'data-validate';\nconst ATTR_DATA_CUSTOM_MESSAGE = 'data-validation-message';\nconst ATTR_DATA_CUSTOM_LABEL = 'data-custom-label';\nconst ATTR_VALIDATE_VISIBILITY = 'data-validate-visibility';\nconst ATTR_ERROR_TARGET_ID = 'data-error-target';\nconst ATTR_DEPENDS = 'data-depends-selector';\nconst CONST_USE_JSON = 'json';\nconst CONST_REALTIME_EVENT = 'input';\nconst FOCUS_TOOLTIP_DELAY = 20;\nconst CLICK_TOOLTIP_DELAY = 150;\n\n/**\n * Triggered when form is fully initialized and handlers are binded\n * @type {string}\n */\nexport const EVENT_FORM_READY = 'flexcss.form.ready';\n/**\n * Fires when a form is submitted, cancelable\n * @type {string}\n */\nexport const EVENT_FORM_SUBMIT = 'flexcss.form.submit';\n/**\n * Fired directly after the form has been submitted via ajax\n * @type {string}\n */\nexport const EVENT_FORM_AFTER_AJAX_SUBMIT = 'flexcss.form.afterAjaxSubmit';\n/**\n * Fired when ajax events did complete\n * @type {string}\n */\nexport const EVENT_FORM_AJAX_COMPLETED = 'flexcss.form.ajaxCompleted';\n\n/**\n * A HTML5 Form Validation replacement\n */\n\nclass Form extends DestroyableWidget {\n /**\n * @param {HTMLElement} form\n * @param [options] optional options\n */\n constructor(form, options) {\n super();\n\n if (!(form instanceof HTMLFormElement)) {\n throw 'argument {0} form needs to be an form element';\n }\n\n /**\n * The Form\n * @type {HTMLElement}\n */\n this.form = form;\n\n /**\n * @type {Tooltip}\n */\n this.tooltips = null;\n\n /**\n * @type {Promise}\n */\n this.currentValidationFuture = new Promise(() => {\n });\n\n /**\n * Default options\n * @type {Object}\n */\n this.options = {\n // if true creates tooltips above element, uses FlexCss Tooltips\n createTooltips: true,\n // if true appends error message after input element\n appendError: false,\n // type of ajax submit\n ajaxSubmitType: 'POST',\n // json content type if ajax method is set to json\n ajaxJsonContentType: 'application/json; charset=utf-8',\n // allow inline validation\n inlineValidation: true,\n // validate in realtime (on `input` event)\n realtime: true,\n // timeout when realtime event should be captured\n realtimeTimeout: 250,\n // formatting method for an error\n formatErrorTooltip: (error) => {\n return ' ' + error;\n },\n // the class that will be put on the element to mark it failed validation\n inputErrorClass: 'invalid',\n // the container class for error messages below an element\n containerErrorClass: 'form-error',\n // additional options for fetch\n fetchOptions: {\n credentials: 'include'\n },\n // the container for tooltips\n tooltipContainer: form,\n tooltipOptions: {\n containerClass: 'error-tooltip'\n },\n // if you have a fixed header, either set a number or function here\n scrollToElementDiff: 0\n };\n\n // overwrite default options\n Object.assign(this.options, options);\n\n // apply settings from attributes\n Util.applyOptionsFromElement(form, this.options);\n\n // set form class as widget\n // Forms are very different to classical widgets,\n // we will not use our base widget class for this but just self\n form.hfWidgetInstance = this;\n\n /**\n * A List of Validators\n * @type {Object}\n * @private\n */\n this._validators = Form.globalValidators;\n\n /**\n * @type {Function}\n * @private\n */\n this._remoteValidationFunction = null;\n\n this.initFormValidation();\n }\n\n destroy() {\n super.destroy();\n if (this.tooltips) {\n this.tooltips.destroy();\n }\n }\n\n /**\n * Submits this form, either via ajax or just classical (default)\n * @param {HTMLFormElement} thisForm\n * @param {Event} e\n * @private\n * @returns {Promise|boolean} returns false if submit is cancled\n */\n _submitFunction(thisForm, e) {\n var shouldUseAjax = thisForm.getAttribute(REMOTE), ajaxPostUrl =\n thisForm.getAttribute(REMOTE_ACTION) ||\n thisForm.getAttribute('action') || window.location.href,\n useJson = CONST_USE_JSON === shouldUseAjax, self = this;\n\n var ev = Event.dispatch(thisForm, EVENT_FORM_SUBMIT).withOriginal(e).fire();\n\n // abort execution is event was prevented\n if (ev.defaultPrevented) {\n self._formStopLoading();\n return false;\n }\n\n if (shouldUseAjax === null) {\n // submit\n return thisForm.submit();\n }\n // prevent form from submit normally\n e.preventDefault();\n\n // add information that this is an XMLHttpRequest request (used by some frameworks)\n let defaultHeaders = {\n 'X-Requested-With': 'XMLHttpRequest'\n };\n\n // setup default headers\n if (useJson) {\n Object.assign(defaultHeaders, {\n 'Content-Type': this.options.ajaxJsonContentType\n });\n }\n let defaultOptions = Object.assign(this.options.fetchOptions, {\n headers: defaultHeaders,\n method: this.options.ajaxSubmitType\n });\n\n // support either JSON request payload or normal payload submission\n var serverCall = useJson ? fetch(ajaxPostUrl, Object.assign(defaultOptions, {\n body: JSON.stringify(this.serialize())\n })) : fetch(ajaxPostUrl, Object.assign(defaultOptions, {\n body: new FormData(thisForm)\n }));\n\n Event.dispatch(thisForm, EVENT_FORM_AFTER_AJAX_SUBMIT).withOriginal(e).fire();\n\n return serverCall.then((r) => {\n (self._remoteValidationFunction || Form.globalRemoteValidationFunction).apply(self, [r]);\n\n Event.dispatch(thisForm, EVENT_FORM_AJAX_COMPLETED).withOriginal(e).withDetail({ response: r }).fire();\n // always remove error class\n self._formStopLoading();\n });\n }\n\n /**\n * Serializes a form to a json object\n * @returns {Object}\n */\n serialize() {\n var selectors = [\n 'input[name]:not([type=\"radio\"]):enabled',\n 'input[type=\"radio\"][name]:checked',\n 'select[name]:enabled',\n 'textarea[name]:enabled'\n ], inputs = this.form.querySelectorAll(selectors.join(',')), result = {};\n\n Array.prototype.forEach.call(inputs, function (input) {\n var exists = result[input.name], value = input.value;\n if (exists instanceof Array) {\n exists.push(value);\n } else if (exists) {\n result[input.name] = [result[input.name], value];\n } else {\n result[input.name] = value;\n }\n });\n\n return result;\n }\n\n /**\n * Handles the chain of validation on given fields\n *\n * @param {HTMLElement|Array|NodeList} field\n * @param [focus] optional focus first error\n * @returns {Promise}\n */\n handleValidation(field, focus) {\n var fields = (field instanceof Array || field instanceof NodeList) ? field : [field];\n return this._handleValidation(fields, focus, true).then(((r) => {\n if (!r.foundAnyError) {\n // remove tooltips\n if (this.tooltips) {\n this.tooltips.removeTooltip();\n }\n }\n return r;\n }).bind(this));\n }\n\n /**\n * Handles errors on given node list\n * @param {NodeList} toValidateFields\n * @param {boolean} focus\n * @param {boolean} scoped if true, will only validate the fields `invalidFields`\n * @returns {Promise}\n * @private\n */\n _handleValidation(toValidateFields, focus, scoped) {\n var self = this;\n var arr = Form._createArrayFromInvalidFieldList(toValidateFields), isLocalInvalid = arr.length > 0;\n // focus must appear in the same frame for iOS devices\n if (isLocalInvalid && focus) {\n self._focusElement(arr[0]);\n }\n var validation = scoped ? this._customValidationsForElements(toValidateFields) :\n self.validateCustomFields();\n return validation.then((r) => {\n if (isLocalInvalid) {\n // combine browser and custom validators\n r.foundAnyError = true;\n }\n // get a unique field list of all fields that need to be checked and rendered\n // it's possible that we have duplicates in non scoped mode\n let thisToValidateFields = scoped ? toValidateFields :\n Array.from(arr).concat(r.checkedFields);\n r.checkedFields = thisToValidateFields;\n let foundInvalidFields = self.prepareErrors(thisToValidateFields, false),\n firstInvalidField = foundInvalidFields[0];\n if (firstInvalidField) {\n if (focus) {\n self._focusElement(firstInvalidField);\n // if element could not be focused:\n if (document.activeElement !== firstInvalidField) {\n self._handleTooltipHideClickAfterChange();\n }\n } else {\n self._handleTooltipHideClickAfterChange();\n }\n self.showAndOrCreateTooltip(firstInvalidField);\n }\n return r;\n });\n }\n\n /**\n * @param {HTMLElement} field\n * @param {ValidityState} validity\n * @returns {*}\n * @private\n */\n\n _setupErrorMessages(field, validity) {\n return Form.globalErrorMessageHandler ?\n Form.globalErrorMessageHandler.apply(this, [field, validity]) : false;\n }\n\n /**\n * Handles class labels for elements\n * @param {Object} fields\n * @private\n */\n _handleLabels(fields) {\n Object.keys(fields).forEach(function (id) {\n let labels = this.getForm().querySelectorAll('[for=\"' + id + '\"]'), invalid = fields[id];\n if (labels.length) {\n for (let labelsIndex = 0; labelsIndex < labels.length; labelsIndex++) {\n let labelEl = labels[labelsIndex];\n // we can't use toggle attribute, not supported in IE\n if (invalid) {\n this._markElementInvalid(labelEl);\n } else {\n this._markElementValid(labelEl);\n }\n }\n }\n }.bind(this));\n }\n\n /**\n * @param el\n * @private\n */\n _markElementInvalid(el) {\n el.setAttribute(DATA_ELEMENT_INVALID, \"true\");\n el.classList.add(this.options.inputErrorClass);\n }\n\n /**\n * @param el\n * @private\n */\n _markElementValid(el) {\n el.removeAttribute(DATA_ELEMENT_INVALID);\n el.classList.remove(this.options.inputErrorClass);\n }\n\n /**\n * A List of invalid elements (:invalid)\n * @returns {Array}\n * @private\n */\n _getInvalidElements() {\n return Array.prototype.filter.call(this.getForm().querySelectorAll(\":invalid\"), function (r) {\n return !(r instanceof HTMLFieldSetElement);\n });\n }\n\n /**\n * @param {HTMLElement} thisParent\n * @private\n */\n _removeElementErrors(thisParent) {\n let errors = thisParent.querySelectorAll('.' + this.options.containerErrorClass), inputsWithErrorClasses =\n thisParent.querySelectorAll(`[${DATA_ELEMENT_INVALID}]`);\n for (let elementErrorIndex = 0; elementErrorIndex < errors.length; elementErrorIndex++) {\n errors[elementErrorIndex].parentNode.removeChild(errors[elementErrorIndex]);\n }\n for (let inputErrorIndex = 0; inputErrorIndex < inputsWithErrorClasses.length; inputErrorIndex++) {\n let el = inputsWithErrorClasses[inputErrorIndex];\n this._markElementValid(el);\n }\n }\n\n\n /**\n * Registers a custom validator\n * @param {String} name\n * @param {Function} validator a validation function should always return either a Future(true) or Future(false)\n * even when the field has been invalidated with `setCustomValidity`, because of different browser `bugs`\n * we can't rely on that\n * @returns {Form}\n */\n registerValidator(name, validator) {\n this._validators[name] = validator;\n return this;\n }\n\n /**\n * Runs async validation\n * @param {String} validationRef\n * @param {HTMLElement} field\n * @returns {Promise}\n * @private\n */\n _runValidation(validationRef, field) {\n if (!this._validators[validationRef]) {\n throw 'Could not found validator: ' + validationRef;\n }\n var cl = field.classList, future = this._validators[validationRef].apply(this, [field, this.form]);\n cl.add(LOADING_CLASS);\n future.then(() => {\n cl.remove(LOADING_CLASS);\n });\n return future;\n }\n\n\n /**\n * Run custom validations for elements, validations are done async do support XHR Requests or other stuff\n *\n * @param {Array|NodeList} fields\n * @returns {Promise} contains either true if validations passed or false if something went wrong\n * @private\n */\n _customValidationsForElements(fields) {\n var futures = [], fieldsLength = fields.length, checkedFields = [];\n for (var iVal = 0; iVal < fieldsLength; iVal++) {\n var field = fields[iVal], validationRef = field.getAttribute(ATTR_VALIDATOR), validity = field.validity;\n if (this._validators[validationRef]) {\n // use local validation first and then continue with custom validations\n if (Form._shouldNotValidateField(field) || (validity && !validity.customError && !validity.valid)) {\n continue;\n }\n checkedFields.push(field);\n futures.push(this._runValidation(validationRef, field));\n } else {\n if (validationRef) {\n console.warn('data-validate was set but no validator was found');\n }\n }\n }\n return Promise.all(futures).then(function (allFutures) {\n let l = allFutures.length;\n let result = {\n checkedFields: checkedFields,\n foundAnyError: false\n };\n for (var fI = 0; fI < l; fI++) {\n if (!allFutures[fI]) {\n result.foundAnyError = true;\n break;\n }\n }\n return result;\n });\n }\n\n /**\n * Remove all errors for this form\n * @returns {Form}\n */\n removeErrors() {\n this._removeElementErrors(this.form);\n if (this.tooltips) {\n this.tooltips.removeTooltip();\n }\n return this;\n }\n\n /**\n * Will handle errors for given fields\n * @param {Array|NodeList} fields\n * @param {Boolean} removeAllErrors\n */\n prepareErrors(fields, removeAllErrors) {\n if (removeAllErrors) {\n this.removeErrors();\n }\n let labelGroups = {}, invalidFields = [];\n\n function handleAdditionalLabels(isInvalid, thisLabelGroup, field) {\n let additionalLabels = field.getAttribute(ATTR_DATA_CUSTOM_LABEL) ||\n field.id, group = thisLabelGroup[additionalLabels];\n if (additionalLabels) {\n // check additionally if field is currently marked as invalid\n // so the label is not marked as error if no field is marked as one\n group = group ? group : isInvalid;\n thisLabelGroup[additionalLabels] = group;\n }\n }\n\n // We save all validations in an extra property because we need to reset the validity due some\n // implementation errors in other browsers then chrome\n for (let i = 0; i < fields.length; i++) {\n let field = fields[i], errorTarget = Form._findErrorTarget(field), parent = errorTarget.parentNode,\n validity = field.validity, isInvalid = validity && !validity.valid;\n if (Form._shouldNotValidateField(field)) {\n continue;\n }\n field.flexFormsSavedValidity = JSON.parse(JSON.stringify(validity));\n handleAdditionalLabels(isInvalid, labelGroups, field);\n if (isInvalid) {\n if (!removeAllErrors) {\n // Remove current errors:\n this._removeElementErrors(parent);\n }\n // setup custom error messages:\n this._setupErrorMessages(field, validity);\n let msg = field.validationMessage;\n\n // mark fields as invalid\n this._markElementInvalid(errorTarget);\n this._markElementInvalid(field);\n\n if (this.options.appendError) {\n parent.insertAdjacentHTML(\"beforeend\",\n `
${msg}
`);\n }\n invalidFields.push(field);\n field.flexFormsSavedValidationMessage = msg;\n } else {\n // restore invalid fields\n this._markElementValid(errorTarget);\n this._markElementValid(field);\n\n // cleanup\n delete field.flexFormsSavedValidationMessage;\n\n // remove error markup\n this._removeElementErrors(parent);\n }\n // We have to reset the custom validity here to allow native validations work again\n field.setCustomValidity('');\n }\n // if validates a single field we need to check the linked fields to a label:\n if (fields.length === 1) {\n let field = fields[0];\n let id = field.getAttribute(ATTR_DATA_CUSTOM_LABEL) || field.id;\n if (id) {\n let linkedFields = Array.from(\n this.getForm().querySelectorAll(`[${ATTR_DATA_CUSTOM_LABEL}=\"${id}\"], #${id}`));\n linkedFields.forEach(function (thisField) {\n let validity = thisField.validity, isInvalid = validity && !validity.valid &&\n this._isElementInvalidElement(thisField);\n handleAdditionalLabels(isInvalid, labelGroups, thisField);\n }.bind(this));\n }\n }\n this._handleLabels(labelGroups);\n return invalidFields;\n }\n\n /**\n * Validates all custom fields\n * @returns {Promise}\n */\n validateCustomFields() {\n return this._customValidationsForElements(\n this.form.querySelectorAll(\"[data-validate]\"));\n }\n\n /**\n * Tests if a field should be validated\n * @param {HTMLElement} field\n * @returns {boolean}\n * @private\n */\n static _shouldNotValidateField(field) {\n var target = Form._findErrorTarget(field);\n return target instanceof HTMLFieldSetElement || field.validity === undefined ||\n (target.hasAttribute(ATTR_VALIDATE_VISIBILITY) && !Util.isVisible(target));\n }\n\n /**\n * Creates an array from a node list with invalid items\n * This Method expicitly checks if field should not be validated so it can be used to foucs a field\n * @param list\n * @returns {Array}\n * @private\n */\n static _createArrayFromInvalidFieldList(list) {\n var arr = [];\n for (var i = 0; i < list.length; ++i) {\n var n = list[i];\n if (n.validity && !n.validity.valid) {\n if (!Form._shouldNotValidateField(n)) {\n arr.push(n);\n }\n }\n }\n return arr;\n }\n\n\n /**\n * This form\n * @returns {HTMLElement}\n */\n getForm() {\n return this.form;\n }\n\n /**\n * Registers a function that handles remote validation\n * @param {Function} func\n * @returns {Form}\n */\n registerRemoteValidation(func) {\n this._remoteValidationFunction = func;\n return this;\n }\n\n\n /**\n * Formats the error content for the tooltip\n * @param {String} error\n * @returns {String}\n * @private\n */\n _formatErrorTooltip(error) {\n return this.options.formatErrorTooltip.apply(this, [error]);\n }\n\n /**\n * Tries to find a custom error target on given target\n * @param target\n * @returns {HTMLElement}\n * @private\n */\n static _findErrorTarget(target) {\n var el = target.getAttribute(ATTR_ERROR_TARGET_ID) || target,\n foundTarget = el instanceof HTMLElement ? el : global.document.getElementById(el);\n if (!foundTarget) {\n throw 'Given error target did not exsits:' + target;\n }\n return foundTarget;\n }\n\n /**\n * Creates a tooltip at given element, will only create a new instance if not created\n * @param {HTMLElement} target\n * @param {Boolean} [remove]\n */\n showAndOrCreateTooltip(target, remove) {\n var self = this;\n if (!this.tooltips && this.options.createTooltips) {\n this.tooltips = new Tooltip(this.options.tooltipContainer, this.options.tooltipOptions);\n }\n if (!this.options.createTooltips) {\n return false;\n }\n\n if (!target.flexFormsSavedValidity) {\n return false;\n }\n var errorTarget = Form._findErrorTarget(target);\n if (!target.flexFormsSavedValidity.valid && self._isElementInvalidElement(errorTarget)) {\n self.tooltips.createTooltip(errorTarget,\n self._formatErrorTooltip(target.flexFormsSavedValidationMessage), false);\n return true;\n } else {\n if (remove) {\n self.tooltips.removeTooltip();\n }\n }\n return false;\n }\n\n /**\n * Checks if element is marked as invalid\n * @param {HTMLElement} el\n * @returns {boolean}\n * @private\n */\n _isElementInvalidElement(el) {\n return el.hasAttribute(DATA_ELEMENT_INVALID);\n }\n\n /**\n * Handles invalid event of a form\n * @param {Event} e\n * @returns {Promise|boolean}\n * @private\n */\n _checkIsInvalid(e) {\n e.preventDefault();\n var invalidFields = this.getForm().querySelectorAll(\":invalid\");\n return this._handleValidation(invalidFields, true, false);\n }\n\n /**\n * Will query dependent fields (by selector) that should be validated with given field\n * @param field\n * @returns {NodeList|[]}\n * @private\n */\n _getDependentFields(field) {\n let fieldSelector = field.getAttribute(ATTR_DEPENDS), base = [field];\n if (fieldSelector) {\n base.push.apply(base, Array.prototype.slice.apply(\n this.getForm().querySelectorAll(fieldSelector)));\n }\n return base;\n }\n\n /**\n * @private\n * @param {HTMLElement} [target]\n */\n _handleTooltipInline(target) {\n if (this.tooltips) {\n this.tooltips.removeTooltip(target);\n }\n }\n\n /**\n * Initializes validation for a given form, registers event handlers\n */\n initFormValidation() {\n // Suppress the default bubbles\n var form = this.getForm(),\n self = this,\n invalidEvent = 'invalid';\n\n /**\n * Validates if is valid realtime element\n * @param {HTMLElement} target\n * @returns {boolean}\n * @private\n */\n function _checkIsValidRealtimeElement(target) {\n return !target.hasAttribute(ATTR_DISABLE_REALTIME) && !target.hasAttribute(ATTR_DISABLE_INLINE);\n }\n\n form.addEventListener(invalidEvent, function (e) {\n e.preventDefault();\n }, true);\n\n Util.addEventOnce(invalidEvent, form, function handleInvalid(e) {\n self._formLoading();\n var result = self._checkIsInvalid(e);\n if (result) {\n self.currentValidationFuture = new Promise((resolve) => {\n result.then(function (r) {\n setTimeout(function () {\n Util.addEventOnce(invalidEvent, form, handleInvalid, true);\n }, 0);\n resolve(r);\n self._formStopLoading();\n if (!r.foundAnyError) {\n self._formLoading();\n self._handleSubmit(e);\n }\n });\n });\n }\n }, true);\n\n this.addEventListener(form, 'reset', () => {\n this.removeErrors();\n });\n\n // Timeout for keys:\n var TIMEOUT_KEYDOWN, KEYDOWN_RUNNING = false;\n\n // resets keydown events\n function clearKeyDownTimeout() {\n KEYDOWN_RUNNING = false;\n clearTimeout(TIMEOUT_KEYDOWN);\n }\n\n // setup custom realtime event if given\n if (self.options.realtime) {\n this.addEventListener(form, CONST_REALTIME_EVENT, function (e) {\n if (self._formIsLoading()) {\n return;\n }\n var target = e.target;\n clearTimeout(TIMEOUT_KEYDOWN);\n if (KEYDOWN_RUNNING) {\n return;\n }\n TIMEOUT_KEYDOWN = setTimeout(() => {\n let isStillTarget = document.activeElement === e.target;\n if (!_checkIsValidRealtimeElement(target)) {\n return;\n }\n if (isStillTarget) {\n self._handleTooltipInline();\n }\n KEYDOWN_RUNNING = true;\n let dependentFields = self._getDependentFields(target);\n self._customValidationsForElements(dependentFields).then(function () {\n self.prepareErrors(dependentFields, false);\n if (isStillTarget) {\n self.showAndOrCreateTooltip(e.target);\n }\n // future must be resolved before another event can be started\n KEYDOWN_RUNNING = false;\n });\n }, self.options.realtimeTimeout);\n }, true);\n }\n\n /**\n * Validates if target is a valid input field to check blur and focus events\n *\n * @param {HTMLElement} target\n * @returns {boolean}\n * @private\n */\n function _checkIsValidBlurFocusElement(target) {\n let attr = target.getAttribute(\"type\");\n return (attr !== \"radio\" && attr !== \"checkbox\" && attr !== \"submit\");\n }\n\n /**\n * Validates if is valid inline-check element\n * @param {HTMLElement} target\n * @returns {boolean}\n * @private\n */\n function _checkIsValidInlineCheckElement(target) {\n return !target.hasAttribute(ATTR_DISABLE_INLINE);\n }\n\n this.addEventListener(form, 'blur', function (e) {\n // do not hide tooltip after change event\n if (!e.target.flexcssKeepTooltips) {\n self._handleTooltipInline(e.target);\n }\n delete e.target.flexcssKeepTooltips;\n }, true);\n\n // handle focus on input elements\n // will show an error if field is invalid\n this.addEventListener(form, \"focus\", function (e) {\n if (self._formIsLoading()) {\n return;\n }\n // do not track errors for checkbox and radios on focus:\n if (!_checkIsValidBlurFocusElement(e.target)) {\n return;\n }\n // we need to delay this a little, because Firefox and Safari do not show a tooltip after it\n // just have been hidden (on blur). Maybe fix this with a queue later\n setTimeout(function () {\n self.showAndOrCreateTooltip(e.target);\n }, FOCUS_TOOLTIP_DELAY);\n }, true);\n\n if (self.options.inlineValidation) {\n // Handle change for checkbox, radios and selects\n this.addEventListener(form, \"change\", function (e) {\n const target = e.target;\n if (self._formIsLoading() || !_checkIsValidInlineCheckElement(target)) {\n return;\n }\n clearKeyDownTimeout();\n const name = target.getAttribute('name');\n let inputs = name ? form.querySelectorAll('[name=\"' + name + '\"]') : [target];\n // we only support dependent fields for a single widgets right now\n if (inputs.length === 1) {\n inputs = self._getDependentFields(target);\n }\n self._customValidationsForElements(inputs).then(function () {\n self.prepareErrors(inputs, false);\n target.flexcssKeepTooltips = self.showAndOrCreateTooltip(target, true);\n if (target.flexcssKeepTooltips) {\n self._handleTooltipHideClickAfterChange();\n }\n });\n });\n }\n\n // prevent default if form is invalid\n this.addEventListener(form, \"submit\", function listener(e) {\n self._submitListener(e, listener);\n });\n\n Event.dispatchAndFire(form, EVENT_FORM_READY);\n }\n\n /* Loading states, unfortunately we can't check if a promise is pending :/*/\n /* TODO: Maybe wrap promise to extend this functionality */\n\n _formLoading() {\n this.getForm().classList.add(LOADING_CLASS);\n }\n\n _formStopLoading() {\n this.getForm().classList.remove(LOADING_CLASS);\n }\n\n _formIsLoading() {\n return this.getForm().classList.contains(LOADING_CLASS);\n }\n\n // this defines the logic after a change event when a tooltip is shown\n // because we call this method inside the change event, the click would be immeditally executed with the change\n // event when not using setTimeout(). There might be another solution for this...\n _handleTooltipHideClickAfterChange() {\n const self = this;\n if (this.options.createTooltips) {\n setTimeout(function () {\n Util.addEventOnce(Settings.getTabEvent(), global.document.body, function (t) {\n if (!self._isElementInvalidElement(t.target)) {\n self._handleTooltipInline();\n }\n });\n }, CLICK_TOOLTIP_DELAY);\n }\n }\n\n _focusElement(el) {\n el.focus();\n Util.scrollToElement(el, this.options.scrollToElementDiff);\n }\n\n /**\n * Listener that is executed on form submit\n * @param e\n * @param submitListener\n * @returns {boolean}\n * @private\n */\n _submitListener(e, submitListener) {\n\n const form = this.getForm(),\n self = this,\n submitEvent = 'submit';\n\n if (this._formIsLoading()) {\n e.preventDefault();\n return false;\n }\n this._formLoading();\n form.removeEventListener(submitEvent, submitListener);\n this.removeErrors();\n e.preventDefault();\n // reset:\n if (form.checkValidity()) {\n form.addEventListener(submitEvent, submitListener);\n // It's possible that the form is valid but the custom validations need to be checked again:\n self.currentValidationFuture = new Promise((resolve) => {\n var validation = self.validateCustomFields();\n validation.then(function (r) {\n // because custom validators may mark multiple fields as invalid, we get all of them in the form\n var fields = self._getInvalidElements(),\n errors = self.prepareErrors(fields, false), firstError = errors[0];\n if (firstError) {\n self._focusElement(firstError);\n self.showAndOrCreateTooltip(firstError, true);\n }\n resolve(r);\n });\n });\n self.currentValidationFuture.then(function (r) {\n if (!r.foundAnyError) {\n // Handle submitting the form to server:\n self._handleSubmit(e);\n } else {\n self._formStopLoading();\n }\n });\n } else {\n self._formStopLoading();\n form.addEventListener(submitEvent, submitListener);\n }\n }\n\n\n /**\n * Handles submitting, optionally allows to stop submitting\n * @param e\n * @private\n */\n _handleSubmit(e) {\n this._submitFunction(this.form, e);\n }\n\n\n /**\n * Registers a global event Handler\n * @param errorFunc\n */\n static registerErrorMessageHandler(errorFunc) {\n Form.globalErrorMessageHandler = errorFunc;\n }\n\n /**\n * Initialize forms for a specific selector\n * @param {String} selector\n * @param {Object} [options]\n * @return {array.}\n */\n static init(selector, options) {\n var forms = selector instanceof HTMLElement ? selector.querySelectorAll('form') :\n document.querySelectorAll(selector), instances = [];\n for (var i = 0; i < forms.length; i++) {\n instances.push(new Form(forms[i], options));\n }\n return instances;\n }\n\n\n /**\n * Registers a global validator that is usable on all form instances\n * @param {String} name\n * @param {Function} validator\n * @returns {Function}\n */\n static registerValidator(name, validator) {\n Form.globalValidators[name] = validator;\n return Form;\n }\n\n /**\n * Registers a global function that is called when a form should validate the response of a server\n * @param {Function} func\n * @returns {Form}\n */\n static registerGlobalRemoteValidationFunction(func) {\n Form.globalRemoteValidationFunction = func;\n return Form;\n }\n}\n\n\n/**\n * Global validators\n * @type {Array}\n */\nForm.globalValidators = [];\n\n/**\n * Global Remote validation function\n */\nForm.globalRemoteValidationFunction = function () {\n};\n\n/**\n * Handles custom error messages extracts custom message by default\n */\nForm.globalErrorMessageHandler = (field, validity) => {\n if (!validity.customError) {\n let customMsg = field.getAttribute(ATTR_DATA_CUSTOM_MESSAGE);\n if (customMsg) {\n field.setCustomValidity(customMsg);\n }\n }\n};\n\nexport default Form;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/main/Form.js\n **/","/*\n * The MIT License (MIT)\n *\n * Copyright (c) 2015 David Heidrich, BowlingX \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n/*!\n * FlexCss.Tooltip\n * Licensed under the MIT License (MIT)\n * Copyright (c) 2015 David Heidrich, BowlingX \n */\n\nimport Util from './util/Util';\nimport DestroyableWidget from './DestroyableWidget';\nimport Settings from './util/Settings';\n\n/**\n * @type {string}\n */\nconst CLASS_NAMES_TOOLTIP = 'tooltip-container';\n/**\n * @type {string}\n */\nconst CLASS_NAMES_OPEN = 'open';\n\n/**\n * @type {string}\n */\nconst ATTR_DATA_CLASSNAME = 'data-class';\n\n/**\n * @type {string}\n */\nconst ATTR_DATA_NO_TOUCH = 'data-no-touch';\n\n/**\n * @type {HTMLDocument}\n */\nconst doc = global.document;\n\n/**\n * Simple Tooltip\n */\nclass Tooltip extends DestroyableWidget {\n\n /**\n * Creates a Tooltip\n * @param {HTMLElement|String} DelegateContainer\n * @param {Object} [options]\n */\n constructor(DelegateContainer, options) {\n super();\n /**\n * The Container where possible events are captured\n */\n this.container = DelegateContainer instanceof HTMLElement ?\n DelegateContainer : doc.getElementById(DelegateContainer);\n\n if (!this.container) {\n throw new Error('Could not create Tooltip, DelegateContainer not found');\n }\n\n /**\n * The Container where tooltips are stored for this instance\n * @type {HTMLElement}\n */\n this.tooltipContainer = null;\n\n /**\n * Default Options\n */\n this.options = {\n containerClass: '',\n selectorAttribute: 'data-tooltip',\n collisionContainer: this.container\n };\n\n Object.assign(this.options, options || {});\n }\n\n /**\n * Creates and shows a tooltip\n * @param {HTMLElement} target where is this tooltip positioned\n * @param {String} text text content in tooltip, will be NOT escaped\n * @param {Boolean} [removeTitle] removes title element if given\n * @param {Node} [positionRelative]\n */\n createTooltip(target, text, removeTitle, positionRelative) {\n // abort if text is empty\n if (!text || text && text.trim() === '') {\n return;\n }\n\n if (Settings.isTouchDevice() && target && target.hasAttribute(ATTR_DATA_NO_TOUCH)) {\n return;\n }\n\n let tooltipContainer = this.tooltipContainer;\n\n if (!tooltipContainer) {\n tooltipContainer = doc.createElement('div');\n this.container.appendChild(tooltipContainer);\n this.tooltipContainer = tooltipContainer;\n }\n this._restoreClassNames(tooltipContainer, target);\n\n tooltipContainer.style.left = 'auto';\n tooltipContainer.style.top = 'auto';\n tooltipContainer.innerHTML = text;\n tooltipContainer.flexTooltipCurrentTarget = target;\n if (removeTitle) {\n target.oldTitle = text;\n target.removeAttribute('title');\n }\n\n Util.setupPositionNearby(positionRelative || target, tooltipContainer,\n this.options.collisionContainer, true, true);\n\n tooltipContainer.classList.add(CLASS_NAMES_OPEN);\n }\n\n _restoreClassNames(container, target) {\n // allow additional classname per tooltip on target element\n const classNames = [CLASS_NAMES_TOOLTIP, this.options.containerClass];\n const maybeTargetClass = target.getAttribute(ATTR_DATA_CLASSNAME);\n if (maybeTargetClass) {\n classNames.push(maybeTargetClass);\n }\n container.className = classNames.join(\" \");\n return this;\n }\n\n /**\n * @returns {HTMLElement|null}\n */\n getCurrentTarget() {\n return this.tooltipContainer ? this.tooltipContainer.flexTooltipCurrentTarget : null;\n }\n\n /**\n * Destroys this Widget\n * @returns {boolean}\n */\n destroy() {\n super.destroy();\n\n if (this.tooltipContainer) {\n this.tooltipContainer.parentNode.removeChild(this.tooltipContainer);\n return true;\n }\n return false;\n }\n\n /**\n * Removes a Tooltip on given target\n * @param {HTMLElement} [target], if not given will remove current open tooltip on this instance\n */\n removeTooltip(target) {\n let selfTarget = target;\n if (!selfTarget && this.tooltipContainer) {\n selfTarget = this.tooltipContainer.flexTooltipCurrentTarget;\n }\n if (this.tooltipContainer) {\n if (this.tooltipContainer.flexTooltipCurrentTarget !== selfTarget) {\n return;\n }\n this.tooltipContainer.classList.remove(CLASS_NAMES_OPEN);\n delete this.tooltipContainer.flexTooltipCurrentTarget;\n }\n if (selfTarget && selfTarget.oldTitle) {\n selfTarget.setAttribute('title', selfTarget.oldTitle);\n }\n }\n\n /**\n * Initilizes mouse events on container element\n */\n registerEvents() {\n const self = this;\n this.addEventListener(this.container, 'mouseover', (e) => {\n if (e.target.hasAttribute(self.options.selectorAttribute)) {\n self.createTooltip(e.target, e.target.getAttribute('title'), true);\n }\n });\n\n this.addEventListener(this.container, 'mouseout', (e) => {\n if (e.target.hasAttribute(self.options.selectorAttribute)) {\n self.removeTooltip(e.target);\n }\n });\n return this;\n }\n}\n\nexport default Tooltip;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/main/Tooltip.js\n **/","/*\n * The MIT License (MIT)\n *\n * Copyright (c) 2015 David Heidrich, BowlingX \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nconst PFX = [\"webkit\", \"moz\", \"MS\", \"o\", \"\"];\n\nconst COL_LEFT_CLASS = 'is-collision-left';\n\nconst COL_RIGHT_CLASS = 'is-collision-right';\n\nconst COL_BOTTOM_CLASS = 'is-collision-bottom';\n\n/**\n * Provides shared DOM-Utility functions\n */\nclass Util {\n\n /**\n * Will register the right animation event based on browser\n * @param element\n * @param type\n * @param callback\n */\n static prefixedAnimateEvent(element, type, callback) {\n const thisFunction = function thisFunction(e) {\n callback.apply(element, [e, thisFunction]);\n };\n\n for (let p = 0; p < PFX.length; p++) {\n let thisType = type;\n if (!PFX[p]) {\n thisType = type.toLowerCase();\n }\n const name = PFX[p] + thisType;\n element.addEventListener(name, thisFunction, true);\n }\n }\n\n /**\n * Get correct transitionend event\n * @returns {String}\n * @private\n */\n static whichTransitionEndEvent() {\n let t;\n const el = document.createElement('fake');\n\n const transitions = {\n transition: 'transitionend',\n OTransition: 'oTransitionEnd',\n MozTransition: 'transitionend',\n WebkitTransition: 'webkitTransitionEnd'\n };\n\n for (t in transitions) {\n if (el.style[t] !== undefined) {\n return transitions[t];\n }\n }\n }\n\n /**\n * Check if target is part of parent node\n * @param target\n * @param parent\n * @returns {boolean}\n */\n static isPartOfNode(target, parent) {\n if (!target || !parent) {\n return false;\n }\n let now = target;\n while (now !== parent && now !== null) {\n if (now === parent) {\n break;\n }\n now = now.parentNode;\n }\n return now !== null;\n }\n\n /**\n * Finds the closest element including itself matching a callback\n * @param {Node} el\n * @param {Function} callback\n * @returns {Node|boolean}\n */\n static closestCallback(el, callback) {\n let element = el;\n while (element !== null) {\n if (callback(element)) {\n return element;\n }\n element = element.parentNode;\n }\n return false;\n }\n\n /**\n * Walks the tree until func returns true for given argument\n * @param target\n * @param func\n * @returns {boolean|HTMLElement}\n */\n static parentsUntil(target, func) {\n if (!target) {\n return false;\n }\n let now = target;\n while (!func(now) && now !== null) {\n now = now.parentNode;\n }\n\n return now;\n }\n\n /**\n * Generates a unique id\n * @return {String}\n */\n static guid() {\n function s4() {\n return Math.floor((1 + Math.random()) * 0x10000)\n .toString(16)\n .substring(1);\n }\n\n return `${s4() + s4()}-${s4()}-${s4()}-${s4()}-${s4() + s4() + s4()}`;\n }\n\n /**\n * Detects scrollbar width\n * @see http://stackoverflow.com/questions/986937/how-can-i-get-the-browsers-scrollbar-sizes\n * @returns {number}\n */\n static getScrollBarWidth() {\n const doc = global.document;\n const inner = doc.createElement('p');\n\n inner.style.width = \"100%\";\n inner.style.height = \"200px\";\n\n const outer = doc.createElement('div');\n outer.style.position = \"absolute\";\n outer.style.top = \"0px\";\n outer.style.left = \"0px\";\n outer.style.visibility = \"hidden\";\n outer.style.width = \"200px\";\n outer.style.height = \"150px\";\n outer.style.overflow = \"hidden\";\n outer.appendChild(inner);\n\n doc.body.appendChild(outer);\n const w1 = inner.offsetWidth;\n outer.style.overflow = 'scroll';\n let w2 = inner.offsetWidth;\n if (w1 === w2) {\n w2 = outer.clientWidth;\n }\n doc.body.removeChild(outer);\n\n return (w1 - w2);\n }\n\n\n /**\n * Run an event once\n * @param {String} ev\n * @param {HTMLElement|HTMLDocument} target\n * @param {Function} func\n * @param {boolean} [capture]\n * @return Function created listener\n */\n static addEventOnce(ev, target, func, capture) {\n const thisFunction = function thisFunction(event) {\n func(event, func);\n target.removeEventListener(ev, thisFunction, capture);\n };\n target.addEventListener(ev, thisFunction, capture);\n return thisFunction;\n }\n\n /**\n * Checks if an element is visible\n * @param {HTMLElement} element\n * @returns bool\n */\n static isVisible(element) {\n return element.offsetWidth > 0 && element.offsetHeight > 0;\n }\n\n /**\n * Creates a camelCaseRepresentation of a dashed string\n * @param {String} str\n * @returns String\n */\n static dashToCamelCase(str) {\n return str.replace(/-([a-z])/g, (g) => {\n return g[1].toUpperCase();\n });\n }\n\n /**\n * Creates a copy of `input`\n * @param {*} input\n * @return *\n */\n static copy(input) {\n return JSON.parse(JSON.stringify(input));\n }\n\n /**\n * Reads options from element (data attributes) and applies to base\n * @param {HTMLElement} element\n * @param {Object} base\n * @return {Object}\n */\n static applyOptionsFromElement(element, base) {\n if (!element) {\n return base;\n }\n const attrs = element.attributes;\n for (let i = 0; i < attrs.length; i++) {\n const attr = attrs[i];\n if (attr) {\n const s = Util.dashToCamelCase(attr.nodeName.replace('data-', ''));\n const val = attr.nodeValue;\n if (base.hasOwnProperty(s)) {\n // skip functions\n if (typeof base[s] === 'function') {\n continue;\n }\n if (typeof base[s] === 'boolean') {\n base[s] = parseInt(val || 1, 10) === 1;\n } else {\n base[s] = val;\n }\n }\n }\n }\n return base;\n }\n\n /**\n * Will position an element directly at given target\n * Is aware of a given collision container to detect edges\n * Will put elementToPosition either to left, center or right edge (prefer right)\n * and either to bottom or top (prefers bottom)\n *\n * You may overwrite preferred positioned with `centerHorizontal` and `positionTop`\n *\n * @param {HTMLElement|ClientRect} target the target container to align to\n * @param {HTMLElement} elementToPosition the element to position\n * @param {HTMLElement} collisionContainer the outer container to prevent collisions\n * @param {boolean} [centerHorizontal] set true to center element, otherwise it's put on the right border by default\n * @param {boolean} [positionTop] flip top, by default element is positioned to the bottom.\n * @returns {HTMLElement}\n */\n static setupPositionNearby(target, elementToPosition, collisionContainer, centerHorizontal, positionTop) {\n // determine relative offsets\n let amountTop = 0;\n let amountLeft = 0;\n Util.parentsUntil(target.parentNode, (el) => {\n if (!(el instanceof HTMLElement)) {\n return false;\n }\n const style = window.getComputedStyle(el);\n if (Util.isPartOfNode(elementToPosition, el)) {\n if (style && style.position === 'relative') {\n amountTop += el.offsetTop || 0;\n amountLeft += el.offsetLeft || 0;\n }\n return false;\n }\n return true;\n });\n\n const targetPosition = target instanceof HTMLElement ? target.getBoundingClientRect() : target;\n const elementRect = elementToPosition.getBoundingClientRect();\n const colRect = collisionContainer.getBoundingClientRect();\n const targetTop = targetPosition.top - amountTop;\n const targetRight = targetPosition.right;\n const isCollisionTop = (targetTop - elementRect.height) <= 0;\n const isCollisionBottom =\n window.innerHeight < (targetTop + amountTop + targetPosition.height + elementRect.height);\n const isCollisionLeft = targetRight < elementRect.width;\n const targetLeft = targetPosition.left;\n const isCollisionRight = (targetLeft + elementRect.width) > colRect.width;\n const classList = elementToPosition.classList;\n\n classList.remove(COL_RIGHT_CLASS);\n classList.remove(COL_LEFT_CLASS);\n classList.remove(COL_BOTTOM_CLASS);\n\n let calcTop;\n let calcLeft;\n if (isCollisionLeft && !isCollisionRight) {\n // put element to left if collision with left\n calcLeft = `${(targetPosition.left - colRect.left - amountLeft)}px`;\n classList.add(COL_LEFT_CLASS);\n } else {\n // maybe center if no collision with either side\n const rightPosition = `${(targetRight - elementRect.width - colRect.left - amountLeft)}px`;\n const leftCentered = ((targetLeft + targetPosition.width / 2) -\n (elementRect.width / 2) || 0) - colRect.left;\n const collisionCentered = (leftCentered + elementRect.width) > colRect.width;\n if (centerHorizontal && !collisionCentered) {\n calcLeft = `${leftCentered}px`;\n } else {\n classList.add(COL_RIGHT_CLASS);\n calcLeft = rightPosition;\n }\n }\n\n if (isCollisionBottom || (positionTop && !isCollisionTop)) {\n // Put Element on top if collision\n calcTop = `${(targetTop - elementRect.height) - colRect.top}px`;\n classList.add(COL_BOTTOM_CLASS);\n } else {\n calcTop = `${(targetTop + targetPosition.height) - colRect.top}px`;\n }\n\n elementToPosition.style.cssText = `top:${calcTop};left:${calcLeft};`;\n\n return elementToPosition;\n }\n\n /**\n * Brings a given element into viewport\n * @param {HTMLElement} el\n * @param {int|function}[optionalOffset]\n */\n static scrollToElement(el, optionalOffset) {\n el.scrollIntoView();\n let thisOffset = optionalOffset;\n // optionally use a additional scrollDif\n if (thisOffset) {\n if (typeof thisOffset === 'function') {\n thisOffset = optionalOffset();\n }\n if (thisOffset > 0) {\n const scrolledY = window.pageYOffset;\n if (scrolledY) {\n window.scroll(0, scrolledY - thisOffset);\n }\n }\n }\n }\n}\n\nexport default Util;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/main/util/Util.js\n **/","/*\n * The MIT License (MIT)\n *\n * Copyright (c) 2015 David Heidrich, BowlingX \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n/**\n * Provides a Basic Widget\n */\nclass DestroyableWidget {\n\n constructor() {\n this.listeners = [];\n }\n\n /**\n * Destroys a Widget\n */\n destroy() {\n this.listeners.forEach((listener) => {\n listener.element.removeEventListener.apply(listener.element, listener.args);\n });\n this.listeners = [];\n }\n\n /**\n * Adds an event and registers it later to remove bindings\n * @param {HTMLElement} element\n * @param {String} name\n * @param {Function} listener\n * @param {boolean} [capture]\n * @returns {Function}\n */\n addEventListener(element, name, listener, capture) {\n this.listeners.push({\n element,\n args: [name, listener, capture]\n });\n\n element.addEventListener(name, listener, capture);\n return listener;\n }\n\n}\n\nexport default DestroyableWidget;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/main/DestroyableWidget.js\n **/","/*\n * The MIT License (MIT)\n *\n * Copyright (c) 2015 David Heidrich, BowlingX \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\nimport Util from './Util';\n\n// we attach global settings to global once because settings might be shared a lot of times trough the application\n// Maybe find a better way to handle that scenario\nif (!global.FLEXCSS_GLOBAL_SETTINGS) {\n global.FLEXCSS_GLOBAL_SETTINGS = {\n // defined breakpoint for small devices < n\n smallBreakpoint: 768,\n // nodes that should be updated when no scrollbar is expected\n scrollbarUpdateNodes: global.document.body !== null ? [global.document.body] : [],\n // additional Delay until darkener is fully hidden\n darkenerFadeDelay: 100,\n // class that is added if canvas has been toggled\n canvasToggledClass: 'toggled-canvas'\n };\n\n global.FLEXCSS_CONST_IS_IOS = null;\n\n global.FLEXCSS_CONST_IS_TOUCH = null;\n\n global.FLEXCSS_CONST_IS_IE = null;\n\n global.FLEXCSS_CONST_TAB_EVENT = 'click';\n\n global.FLEXCSS_IS_SMALL_SCREEN = false;\n\n const init = () => {\n // Measure scrollbar width\n global.FLEXCSS_CONST_SCROLLBAR_WIDTH = Util.getScrollBarWidth();\n // detect right transition end event\n global.FLEXCSS_CONST_TRANSITION_EVENT = Util.whichTransitionEndEvent();\n };\n\n if (global.document.readyState !== 'loading') {\n init();\n } else {\n // it's possible that global.document.body is not available if the document is not\n // loaded completely\n document.addEventListener('DOMContentLoaded', () => {\n init();\n });\n }\n}\n\n/**\n * Utility class that setups global settings\n */\nclass Settings {\n\n /**\n * Setup global settings, overwrite default values\n * @param {Object} settings\n */\n static setup(settings) {\n Object.assign(global.FLEXCSS_GLOBAL_SETTINGS, settings);\n }\n\n /**\n * Access to global settings\n * @returns {Object}\n */\n static get() {\n return global.FLEXCSS_GLOBAL_SETTINGS;\n }\n\n /**\n * Detects a IOS Device, caches subsequent calls\n * @returns {boolean}\n */\n static isIosDevice() {\n if (!global.FLEXCSS_CONST_IS_IOS) {\n global.FLEXCSS_CONST_IS_IOS = global.navigator.userAgent.match(/(iPad|iPhone|iPod)/i);\n }\n\n return global.FLEXCSS_CONST_IS_IOS;\n }\n\n /**\n * @returns {boolean}\n */\n static isSmallScreen() {\n return window.innerWidth < Settings.get().smallBreakpoint;\n }\n\n /**\n * Detects a touch device, caches subsequent calls\n * @returns {boolean}\n */\n static isTouchDevice() {\n if (!global.FLEXCSS_CONST_IS_TOUCH) {\n global.FLEXCSS_CONST_IS_TOUCH = 'ontouchstart' in window || !!(global.navigator.msMaxTouchPoints);\n }\n return global.FLEXCSS_CONST_IS_TOUCH;\n }\n\n /**\n * Checks if current browser is Internet Explorer\n * @returns {boolean|*}\n */\n static isIE() {\n if (!global.FLEXCSS_CONST_IS_IE) {\n global.FLEXCSS_CONST_IS_IE = \"ActiveXObject\" in window;\n }\n return global.FLEXCSS_CONST_IS_IE;\n }\n\n /**\n * @returns {String}\n */\n static getTransitionEvent() {\n return global.FLEXCSS_CONST_TRANSITION_EVENT;\n }\n\n /**\n * @returns {int}\n */\n static getScrollbarWidth() {\n return global.FLEXCSS_CONST_SCROLLBAR_WIDTH;\n }\n\n /**\n * @returns {String}\n */\n static getTabEvent() {\n return global.FLEXCSS_CONST_TAB_EVENT;\n }\n}\n\nexport default Settings;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/main/util/Settings.js\n **/","// the whatwg-fetch polyfill installs the fetch() function\n// on the global object (window or self)\n//\n// Return that as the export for use in Webpack, Browserify etc.\nrequire('whatwg-fetch');\nmodule.exports = self.fetch.bind(self);\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/isomorphic-fetch/fetch-npm-browserify.js\n ** module id = 12\n ** module chunks = 2 3\n **/","(function(self) {\n 'use strict';\n\n if (self.fetch) {\n return\n }\n\n function normalizeName(name) {\n if (typeof name !== 'string') {\n name = String(name)\n }\n if (/[^a-z0-9\\-#$%&'*+.\\^_`|~]/i.test(name)) {\n throw new TypeError('Invalid character in header field name')\n }\n return name.toLowerCase()\n }\n\n function normalizeValue(value) {\n if (typeof value !== 'string') {\n value = String(value)\n }\n return value\n }\n\n function Headers(headers) {\n this.map = {}\n\n if (headers instanceof Headers) {\n headers.forEach(function(value, name) {\n this.append(name, value)\n }, this)\n\n } else if (headers) {\n Object.getOwnPropertyNames(headers).forEach(function(name) {\n this.append(name, headers[name])\n }, this)\n }\n }\n\n Headers.prototype.append = function(name, value) {\n name = normalizeName(name)\n value = normalizeValue(value)\n var list = this.map[name]\n if (!list) {\n list = []\n this.map[name] = list\n }\n list.push(value)\n }\n\n Headers.prototype['delete'] = function(name) {\n delete this.map[normalizeName(name)]\n }\n\n Headers.prototype.get = function(name) {\n var values = this.map[normalizeName(name)]\n return values ? values[0] : null\n }\n\n Headers.prototype.getAll = function(name) {\n return this.map[normalizeName(name)] || []\n }\n\n Headers.prototype.has = function(name) {\n return this.map.hasOwnProperty(normalizeName(name))\n }\n\n Headers.prototype.set = function(name, value) {\n this.map[normalizeName(name)] = [normalizeValue(value)]\n }\n\n Headers.prototype.forEach = function(callback, thisArg) {\n Object.getOwnPropertyNames(this.map).forEach(function(name) {\n this.map[name].forEach(function(value) {\n callback.call(thisArg, value, name, this)\n }, this)\n }, this)\n }\n\n function consumed(body) {\n if (body.bodyUsed) {\n return Promise.reject(new TypeError('Already read'))\n }\n body.bodyUsed = true\n }\n\n function fileReaderReady(reader) {\n return new Promise(function(resolve, reject) {\n reader.onload = function() {\n resolve(reader.result)\n }\n reader.onerror = function() {\n reject(reader.error)\n }\n })\n }\n\n function readBlobAsArrayBuffer(blob) {\n var reader = new FileReader()\n reader.readAsArrayBuffer(blob)\n return fileReaderReady(reader)\n }\n\n function readBlobAsText(blob) {\n var reader = new FileReader()\n reader.readAsText(blob)\n return fileReaderReady(reader)\n }\n\n var support = {\n blob: 'FileReader' in self && 'Blob' in self && (function() {\n try {\n new Blob();\n return true\n } catch(e) {\n return false\n }\n })(),\n formData: 'FormData' in self,\n arrayBuffer: 'ArrayBuffer' in self\n }\n\n function Body() {\n this.bodyUsed = false\n\n\n this._initBody = function(body) {\n this._bodyInit = body\n if (typeof body === 'string') {\n this._bodyText = body\n } else if (support.blob && Blob.prototype.isPrototypeOf(body)) {\n this._bodyBlob = body\n } else if (support.formData && FormData.prototype.isPrototypeOf(body)) {\n this._bodyFormData = body\n } else if (!body) {\n this._bodyText = ''\n } else if (support.arrayBuffer && ArrayBuffer.prototype.isPrototypeOf(body)) {\n // Only support ArrayBuffers for POST method.\n // Receiving ArrayBuffers happens via Blobs, instead.\n } else {\n throw new Error('unsupported BodyInit type')\n }\n\n if (!this.headers.get('content-type')) {\n if (typeof body === 'string') {\n this.headers.set('content-type', 'text/plain;charset=UTF-8')\n } else if (this._bodyBlob && this._bodyBlob.type) {\n this.headers.set('content-type', this._bodyBlob.type)\n }\n }\n }\n\n if (support.blob) {\n this.blob = function() {\n var rejected = consumed(this)\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return Promise.resolve(this._bodyBlob)\n } else if (this._bodyFormData) {\n throw new Error('could not read FormData body as blob')\n } else {\n return Promise.resolve(new Blob([this._bodyText]))\n }\n }\n\n this.arrayBuffer = function() {\n return this.blob().then(readBlobAsArrayBuffer)\n }\n\n this.text = function() {\n var rejected = consumed(this)\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return readBlobAsText(this._bodyBlob)\n } else if (this._bodyFormData) {\n throw new Error('could not read FormData body as text')\n } else {\n return Promise.resolve(this._bodyText)\n }\n }\n } else {\n this.text = function() {\n var rejected = consumed(this)\n return rejected ? rejected : Promise.resolve(this._bodyText)\n }\n }\n\n if (support.formData) {\n this.formData = function() {\n return this.text().then(decode)\n }\n }\n\n this.json = function() {\n return this.text().then(JSON.parse)\n }\n\n return this\n }\n\n // HTTP methods whose capitalization should be normalized\n var methods = ['DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT']\n\n function normalizeMethod(method) {\n var upcased = method.toUpperCase()\n return (methods.indexOf(upcased) > -1) ? upcased : method\n }\n\n function Request(input, options) {\n options = options || {}\n var body = options.body\n if (Request.prototype.isPrototypeOf(input)) {\n if (input.bodyUsed) {\n throw new TypeError('Already read')\n }\n this.url = input.url\n this.credentials = input.credentials\n if (!options.headers) {\n this.headers = new Headers(input.headers)\n }\n this.method = input.method\n this.mode = input.mode\n if (!body) {\n body = input._bodyInit\n input.bodyUsed = true\n }\n } else {\n this.url = input\n }\n\n this.credentials = options.credentials || this.credentials || 'omit'\n if (options.headers || !this.headers) {\n this.headers = new Headers(options.headers)\n }\n this.method = normalizeMethod(options.method || this.method || 'GET')\n this.mode = options.mode || this.mode || null\n this.referrer = null\n\n if ((this.method === 'GET' || this.method === 'HEAD') && body) {\n throw new TypeError('Body not allowed for GET or HEAD requests')\n }\n this._initBody(body)\n }\n\n Request.prototype.clone = function() {\n return new Request(this)\n }\n\n function decode(body) {\n var form = new FormData()\n body.trim().split('&').forEach(function(bytes) {\n if (bytes) {\n var split = bytes.split('=')\n var name = split.shift().replace(/\\+/g, ' ')\n var value = split.join('=').replace(/\\+/g, ' ')\n form.append(decodeURIComponent(name), decodeURIComponent(value))\n }\n })\n return form\n }\n\n function headers(xhr) {\n var head = new Headers()\n var pairs = xhr.getAllResponseHeaders().trim().split('\\n')\n pairs.forEach(function(header) {\n var split = header.trim().split(':')\n var key = split.shift().trim()\n var value = split.join(':').trim()\n head.append(key, value)\n })\n return head\n }\n\n Body.call(Request.prototype)\n\n function Response(bodyInit, options) {\n if (!options) {\n options = {}\n }\n\n this.type = 'default'\n this.status = options.status\n this.ok = this.status >= 200 && this.status < 300\n this.statusText = options.statusText\n this.headers = options.headers instanceof Headers ? options.headers : new Headers(options.headers)\n this.url = options.url || ''\n this._initBody(bodyInit)\n }\n\n Body.call(Response.prototype)\n\n Response.prototype.clone = function() {\n return new Response(this._bodyInit, {\n status: this.status,\n statusText: this.statusText,\n headers: new Headers(this.headers),\n url: this.url\n })\n }\n\n Response.error = function() {\n var response = new Response(null, {status: 0, statusText: ''})\n response.type = 'error'\n return response\n }\n\n var redirectStatuses = [301, 302, 303, 307, 308]\n\n Response.redirect = function(url, status) {\n if (redirectStatuses.indexOf(status) === -1) {\n throw new RangeError('Invalid status code')\n }\n\n return new Response(null, {status: status, headers: {location: url}})\n }\n\n self.Headers = Headers;\n self.Request = Request;\n self.Response = Response;\n\n self.fetch = function(input, init) {\n return new Promise(function(resolve, reject) {\n var request\n if (Request.prototype.isPrototypeOf(input) && !init) {\n request = input\n } else {\n request = new Request(input, init)\n }\n\n var xhr = new XMLHttpRequest()\n\n function responseURL() {\n if ('responseURL' in xhr) {\n return xhr.responseURL\n }\n\n // Avoid security warnings on getResponseHeader when not allowed by CORS\n if (/^X-Request-URL:/m.test(xhr.getAllResponseHeaders())) {\n return xhr.getResponseHeader('X-Request-URL')\n }\n\n return;\n }\n\n xhr.onload = function() {\n var status = (xhr.status === 1223) ? 204 : xhr.status\n if (status < 100 || status > 599) {\n reject(new TypeError('Network request failed'))\n return\n }\n var options = {\n status: status,\n statusText: xhr.statusText,\n headers: headers(xhr),\n url: responseURL()\n }\n var body = 'response' in xhr ? xhr.response : xhr.responseText;\n resolve(new Response(body, options))\n }\n\n xhr.onerror = function() {\n reject(new TypeError('Network request failed'))\n }\n\n xhr.open(request.method, request.url, true)\n\n if (request.credentials === 'include') {\n xhr.withCredentials = true\n }\n\n if ('responseType' in xhr && support.blob) {\n xhr.responseType = 'blob'\n }\n\n request.headers.forEach(function(value, name) {\n xhr.setRequestHeader(name, value)\n })\n\n xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit)\n })\n }\n self.fetch.polyfill = true\n})(typeof self !== 'undefined' ? self : this);\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/whatwg-fetch/fetch.js\n ** module id = 13\n ** module chunks = 2 3\n **/","/* global CustomEvent */\n\n/*\n * The MIT License (MIT)\n *\n * Copyright (c) 2015 David Heidrich, BowlingX \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n// polyfill for custom events to make thinks work in IE\n// The needed polyfill is so small that I embedded it here\n(function poly() {\n if (!global.CustomEvent || typeof global.CustomEvent !== 'function') {\n const CustomEvent = function CustomEvent(event, params) {\n const thisParams = params ||\n {\n bubbles: false,\n cancelable: false,\n detail: undefined\n };\n const evt = document.createEvent(\"CustomEvent\");\n evt.initCustomEvent(event, thisParams.bubbles,\n thisParams.cancelable, thisParams.detail);\n return evt;\n };\n CustomEvent.prototype = global.Event.prototype;\n global.CustomEvent = CustomEvent;\n }\n})();\n/**\n * Simpler Event dispatching\n */\nclass EventHandler {\n\n /**\n * @param {HTMLElement} target\n * @param {String} name\n */\n constructor(target, name) {\n this.target = target;\n this.defaultOptions = {\n bubbles: true,\n cancelable: true\n };\n\n this.name = name;\n }\n\n /**\n * Set more options\n * @param {Object} options\n * @returns {EventHandler}\n */\n withOptions(options) {\n Object.assign(this.defaultOptions, (options || {}));\n return this;\n }\n\n /**\n * Call with the originalEvent\n * @param {Event} e\n * @returns {EventHandler}\n */\n withOriginal(e) {\n return this.withDetail({\n originalEvent: e\n });\n }\n\n /**\n * Extends the detail part of the event\n * @param {Object} o\n * @returns {EventHandler}\n */\n withDetail(o) {\n if (!this.defaultOptions.detail) {\n this.defaultOptions.detail = {};\n }\n Object.assign(this.defaultOptions.detail, o);\n return this;\n }\n\n /**\n * @returns {CustomEvent}\n */\n fire() {\n const e = new CustomEvent(this.name, this.defaultOptions);\n if (this.target) {\n this.target.dispatchEvent(e);\n }\n return e;\n }\n}\n\nclass Event {\n /**\n * Prepares to dispatch a custom event (without firing)\n * @param {HTMLElement} target\n * @param {String} name\n * @returns {EventHandler}\n */\n static dispatch(target, name) {\n return new EventHandler(target, name);\n }\n\n /**\n * Dispatches a custom event and fires it directly\n * @param {HTMLElement} target\n * @param {String} name\n * @param {Object} [options]\n * @returns {CustomEvent}\n */\n static dispatchAndFire(target, name, options) {\n return new EventHandler(target, name).withOptions(options).fire();\n }\n}\n\nexport default Event;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/main/util/Event.js\n **/","'use strict';\n\nimport Form from '../Form';\nimport Tooltip from '../Tooltip';\nimport Settings from '../util/Settings';\n\n// default export as component object\nexport default {\n Form,\n Settings,\n Tooltip\n};\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/main/modules/Form.js\n **/"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack:///webpack/universalModuleDefinition?5ca6**","webpack:///webpack/bootstrap 07d11fb01134afeef692?d78f**","webpack:///./src/main/Form.js?18a8","webpack:///./src/main/Tooltip.js?3890","webpack:///./src/main/util/Util.js?5bc4","webpack:///./src/main/DestroyableWidget.js?8d9b","webpack:///./src/main/util/Settings.js?b01f","webpack:///./~/isomorphic-fetch/fetch-npm-browserify.js?7723","webpack:///./~/whatwg-fetch/fetch.js?1c20","webpack:///./src/main/util/Event.js?68bf","webpack:///./src/main/modules/Form.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;ACVA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,uBAAe;AACf;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAE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B,MAAlB,IAA4B,CAAC,CAAE,OAAO,SAAP,CAAiB,gBAAjB,CAD/B;cAApC;AAGA,oBAAO,OAAO,sBAAP,CAJY;;;;;;;;;;gCAWT;AACV,iBAAI,CAAC,OAAO,mBAAP,EAA4B;AAC7B,wBAAO,mBAAP,GAA6B,mBAAmB,MAAnB,CADA;cAAjC;AAGA,oBAAO,OAAO,mBAAP,CAJG;;;;;;;;;8CAUc;AACxB,oBAAO,OAAO,8BAAP,CADiB;;;;;;;;;6CAOD;AACvB,oBAAO,OAAO,6BAAP,CADgB;;;;;;;;;uCAON;AACjB,oBAAO,OAAO,uBAAP,CADU;;;;YA5EnB;;;mBAiFS,S;;;;;;;ACvJf;AACA;AACA;AACA;AACA;AACA;;;;;;;ACLA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,QAAO;;AAEP,MAAK;AACL;AACA;AACA,QAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,QAAO;AACP,MAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,QAAO;AACP;AACA;AACA,MAAK;AACL;AACA;AACA;;AAEA;AACA;;;AAGA;AACA;AACA;AACA;AACA,QAAO;AACP;AACA,QAAO;AACP;AACA,QAAO;AACP;AACA,QAAO;AACP;AACA;AACA,QAAO;AACP;AACA;;AAEA;AACA;AACA,wDAAuD;AACvD,UAAS;AACT;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,UAAS;AACT;AACA,UAAS;AACT;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,UAAS;AACT;AACA,UAAS;AACT;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;;AAEA;AACA,wCAAuC,0BAA0B;AACjE;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA,gCAA+B,0BAA0B,eAAe;AACxE;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,QAAO;AACP;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,QAAO;;AAEP;AACA,MAAK;AACL;AACA;AACA,EAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACxW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B,MAApB,EAA4B,CAA1C,EAJU;AAKV,oBAAO,IAAP,CALU;;;;;;;;;gCAWP;AACH,iBAAM,IAAI,IAAI,WAAJ,CAAgB,KAAK,IAAL,EAAW,KAAK,cAAL,CAA/B,CADH;AAEH,iBAAI,KAAK,MAAL,EAAa;AACb,sBAAK,MAAL,CAAY,aAAZ,CAA0B,CAA1B,EADa;cAAjB;AAGA,oBAAO,CAAP,CALG;;;;YArDL;;;KA8DA;;;;;;;;;;;;;;kCAOc,QAAQ,MAAM;AAC1B,oBAAO,IAAI,YAAJ,CAAiB,MAAjB,EAAyB,IAAzB,CAAP,CAD0B;;;;;;;;;;;;;yCAWP,QAAQ,MAAM,SAAS;AAC1C,oBAAO,IAAI,YAAJ,CAAiB,MAAjB,EAAyB,IAAzB,EAA+B,WAA/B,CAA2C,OAA3C,EAAoD,IAApD,EAAP,CAD0C;;;;YAlB5C;;;mBAuBS,M;;;;;;;;;;;;;;;ACtIf;;;;;;;;;;;;;;;;;;;;;mBAOe;AACX,yBADW;AAEX,iCAFW;AAGX,+BAHW","file":"js/form.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"FlexCss\"] = factory();\n\telse\n\t\troot[\"FlexCss\"] = factory();\n})(this, function() {\nreturn \n\n\n/** WEBPACK FOOTER **\n ** webpack/universalModuleDefinition\n **/"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"../\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n/** WEBPACK FOOTER **\n ** webpack/bootstrap 07d11fb01134afeef692\n **/","/*global HTMLFormElement, fetch, FormData, clearTimeout, NodeList*/\n\n/*\n * The MIT License (MIT)\n *\n * Copyright (c) 2015 David Heidrich, BowlingX \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n/*!\n * FlexCss.Form\n * Licensed under the MIT License (MIT)\n * Copyright (c) 2015 David Heidrich, BowlingX \n */\n\nimport Tooltip from './Tooltip';\nimport 'isomorphic-fetch';\nimport Event from './util/Event';\nimport Util from './util/Util';\nimport Settings from './util/Settings';\nimport DestroyableWidget from './DestroyableWidget';\n\nconst LOADING_CLASS = 'loading';\nconst DATA_ELEMENT_INVALID = 'data-flexcss-invalid';\nconst REMOTE = 'data-remote';\nconst REMOTE_ACTION = 'data-remote-action';\nconst ATTR_DISABLE_INLINE = 'data-disable-inline-validation';\nconst ATTR_DISABLE_REALTIME = 'data-disable-realtime-validation';\nconst ATTR_VALIDATOR = 'data-validate';\nconst ATTR_DATA_CUSTOM_MESSAGE = 'data-validation-message';\nconst ATTR_DATA_CUSTOM_LABEL = 'data-custom-label';\nconst ATTR_VALIDATE_VISIBILITY = 'data-validate-visibility';\nconst ATTR_ERROR_TARGET_ID = 'data-error-target';\nconst ATTR_DEPENDS = 'data-depends-selector';\nconst CONST_USE_JSON = 'json';\nconst CONST_REALTIME_EVENT = 'input';\nconst FOCUS_TOOLTIP_DELAY = 20;\nconst CLICK_TOOLTIP_DELAY = 150;\n\n/**\n * Triggered when form is fully initialized and handlers are binded\n * @type {string}\n */\nexport const EVENT_FORM_READY = 'flexcss.form.ready';\n/**\n * Fires when a form is submitted, cancelable\n * @type {string}\n */\nexport const EVENT_FORM_SUBMIT = 'flexcss.form.submit';\n/**\n * Fired directly after the form has been submitted via ajax\n * @type {string}\n */\nexport const EVENT_FORM_AFTER_AJAX_SUBMIT = 'flexcss.form.afterAjaxSubmit';\n/**\n * Fired when ajax events did complete\n * @type {string}\n */\nexport const EVENT_FORM_AJAX_COMPLETED = 'flexcss.form.ajaxCompleted';\n\n/**\n * A HTML5 Form Validation replacement\n */\n\nclass Form extends DestroyableWidget {\n /**\n * @param {HTMLElement} form\n * @param [options] optional options\n */\n constructor(form, options) {\n super();\n\n if (!(form instanceof HTMLFormElement)) {\n throw 'argument {0} form needs to be an form element';\n }\n\n /**\n * The Form\n * @type {HTMLElement}\n */\n this.form = form;\n\n /**\n * @type {Tooltip}\n */\n this.tooltips = null;\n\n /**\n * @type {Promise}\n */\n this.currentValidationFuture = new Promise(() => {\n });\n\n /**\n * Default options\n * @type {Object}\n */\n this.options = {\n // if true creates tooltips above element, uses FlexCss Tooltips\n createTooltips: true,\n // if true appends error message after input element\n appendError: false,\n // type of ajax submit\n ajaxSubmitType: 'POST',\n // json content type if ajax method is set to json\n ajaxJsonContentType: 'application/json; charset=utf-8',\n // allow inline validation\n inlineValidation: true,\n // validate in realtime (on `input` event)\n realtime: true,\n // timeout when realtime event should be captured\n realtimeTimeout: 250,\n // formatting method for an error\n formatErrorTooltip: (error) => {\n return ' ' + error;\n },\n // the class that will be put on the element to mark it failed validation\n inputErrorClass: 'invalid',\n // the container class for error messages below an element\n containerErrorClass: 'form-error',\n // additional options for fetch\n fetchOptions: {\n credentials: 'include'\n },\n // the container for tooltips\n tooltipContainer: form,\n tooltipOptions: {\n containerClass: 'error-tooltip'\n },\n // if you have a fixed header, either set a number or function here\n scrollToElementDiff: 0\n };\n\n // overwrite default options\n Object.assign(this.options, options);\n\n // apply settings from attributes\n Util.applyOptionsFromElement(form, this.options);\n\n // set form class as widget\n // Forms are very different to classical widgets,\n // we will not use our base widget class for this but just self\n form.hfWidgetInstance = this;\n\n /**\n * A List of Validators\n * @type {Object}\n * @private\n */\n this._validators = Form.globalValidators;\n\n /**\n * @type {Function}\n * @private\n */\n this._remoteValidationFunction = null;\n\n this.initFormValidation();\n }\n\n destroy() {\n super.destroy();\n if (this.tooltips) {\n this.tooltips.destroy();\n }\n }\n\n /**\n * Submits this form, either via ajax or just classical (default)\n * @param {HTMLFormElement} thisForm\n * @param {Event} e\n * @private\n * @returns {Promise|boolean} returns false if submit is cancled\n */\n _submitFunction(thisForm, e) {\n var shouldUseAjax = thisForm.getAttribute(REMOTE), ajaxPostUrl =\n thisForm.getAttribute(REMOTE_ACTION) ||\n thisForm.getAttribute('action') || window.location.href,\n useJson = CONST_USE_JSON === shouldUseAjax, self = this;\n\n var ev = Event.dispatch(thisForm, EVENT_FORM_SUBMIT).withOriginal(e).fire();\n\n // abort execution is event was prevented\n if (ev.defaultPrevented) {\n self._formStopLoading();\n return false;\n }\n\n if (shouldUseAjax === null) {\n // submit\n return thisForm.submit();\n }\n // prevent form from submit normally\n e.preventDefault();\n\n // add information that this is an XMLHttpRequest request (used by some frameworks)\n let defaultHeaders = {\n 'X-Requested-With': 'XMLHttpRequest'\n };\n\n // setup default headers\n if (useJson) {\n Object.assign(defaultHeaders, {\n 'Content-Type': this.options.ajaxJsonContentType\n });\n }\n let defaultOptions = Object.assign(this.options.fetchOptions, {\n headers: defaultHeaders,\n method: this.options.ajaxSubmitType\n });\n\n // support either JSON request payload or normal payload submission\n var serverCall = useJson ? fetch(ajaxPostUrl, Object.assign(defaultOptions, {\n body: JSON.stringify(this.serialize())\n })) : fetch(ajaxPostUrl, Object.assign(defaultOptions, {\n body: new FormData(thisForm)\n }));\n\n Event.dispatch(thisForm, EVENT_FORM_AFTER_AJAX_SUBMIT).withOriginal(e).fire();\n\n return serverCall.then((r) => {\n (self._remoteValidationFunction || Form.globalRemoteValidationFunction).apply(self, [r]);\n\n Event.dispatch(thisForm, EVENT_FORM_AJAX_COMPLETED).withOriginal(e).withDetail({ response: r }).fire();\n // always remove error class\n self._formStopLoading();\n });\n }\n\n /**\n * Serializes a form to a json object\n * @returns {Object}\n */\n serialize() {\n var selectors = [\n 'input[name]:not([type=\"radio\"]):enabled',\n 'input[type=\"radio\"][name]:checked',\n 'select[name]:enabled',\n 'textarea[name]:enabled'\n ], inputs = this.form.querySelectorAll(selectors.join(',')), result = {};\n\n Array.prototype.forEach.call(inputs, function (input) {\n var exists = result[input.name], value = input.value;\n if (exists instanceof Array) {\n exists.push(value);\n } else if (exists) {\n result[input.name] = [result[input.name], value];\n } else {\n result[input.name] = value;\n }\n });\n\n return result;\n }\n\n /**\n * Handles the chain of validation on given fields\n *\n * @param {HTMLElement|Array|NodeList} field\n * @param [focus] optional focus first error\n * @returns {Promise}\n */\n handleValidation(field, focus) {\n var fields = (field instanceof Array || field instanceof NodeList) ? field : [field];\n return this._handleValidation(fields, focus, true).then(((r) => {\n if (!r.foundAnyError) {\n // remove tooltips\n if (this.tooltips) {\n this.tooltips.removeTooltip();\n }\n }\n return r;\n }).bind(this));\n }\n\n /**\n * Handles errors on given node list\n * @param {NodeList} toValidateFields\n * @param {boolean} focus\n * @param {boolean} scoped if true, will only validate the fields `invalidFields`\n * @returns {Promise}\n * @private\n */\n _handleValidation(toValidateFields, focus, scoped) {\n var self = this;\n var arr = Form._createArrayFromInvalidFieldList(toValidateFields), isLocalInvalid = arr.length > 0;\n // focus must appear in the same frame for iOS devices\n if (isLocalInvalid && focus) {\n self._focusElement(arr[0]);\n }\n var validation = scoped ? this._customValidationsForElements(toValidateFields) :\n self.validateCustomFields();\n return validation.then((r) => {\n if (isLocalInvalid) {\n // combine browser and custom validators\n r.foundAnyError = true;\n }\n // get a unique field list of all fields that need to be checked and rendered\n // it's possible that we have duplicates in non scoped mode\n let thisToValidateFields = scoped ? toValidateFields :\n Array.from(arr).concat(r.checkedFields);\n r.checkedFields = thisToValidateFields;\n let foundInvalidFields = self.prepareErrors(thisToValidateFields, false),\n firstInvalidField = foundInvalidFields[0];\n if (firstInvalidField) {\n if (focus) {\n self._focusElement(firstInvalidField);\n // if element could not be focused:\n if (document.activeElement !== firstInvalidField) {\n self._handleTooltipHideClickAfterChange();\n }\n } else {\n self._handleTooltipHideClickAfterChange();\n }\n self.showAndOrCreateTooltip(firstInvalidField);\n }\n return r;\n });\n }\n\n /**\n * @param {HTMLElement} field\n * @param {ValidityState} validity\n * @returns {*}\n * @private\n */\n\n _setupErrorMessages(field, validity) {\n return Form.globalErrorMessageHandler ?\n Form.globalErrorMessageHandler.apply(this, [field, validity]) : false;\n }\n\n /**\n * Handles class labels for elements\n * @param {Object} fields\n * @private\n */\n _handleLabels(fields) {\n Object.keys(fields).forEach(function (id) {\n let labels = this.getForm().querySelectorAll('[for=\"' + id + '\"]'), invalid = fields[id];\n if (labels.length) {\n for (let labelsIndex = 0; labelsIndex < labels.length; labelsIndex++) {\n let labelEl = labels[labelsIndex];\n // we can't use toggle attribute, not supported in IE\n if (invalid) {\n this._markElementInvalid(labelEl);\n } else {\n this._markElementValid(labelEl);\n }\n }\n }\n }.bind(this));\n }\n\n /**\n * @param el\n * @private\n */\n _markElementInvalid(el) {\n el.setAttribute(DATA_ELEMENT_INVALID, \"true\");\n el.classList.add(this.options.inputErrorClass);\n }\n\n /**\n * @param el\n * @private\n */\n _markElementValid(el) {\n el.removeAttribute(DATA_ELEMENT_INVALID);\n el.classList.remove(this.options.inputErrorClass);\n }\n\n /**\n * A List of invalid elements (:invalid)\n * @returns {Array}\n * @private\n */\n _getInvalidElements() {\n return Array.prototype.filter.call(this.getForm().querySelectorAll(\":invalid\"), function (r) {\n return !(r instanceof HTMLFieldSetElement);\n });\n }\n\n /**\n * @param {HTMLElement} thisParent\n * @private\n */\n _removeElementErrors(thisParent) {\n let errors = thisParent.querySelectorAll('.' + this.options.containerErrorClass), inputsWithErrorClasses =\n thisParent.querySelectorAll(`[${DATA_ELEMENT_INVALID}]`);\n for (let elementErrorIndex = 0; elementErrorIndex < errors.length; elementErrorIndex++) {\n errors[elementErrorIndex].parentNode.removeChild(errors[elementErrorIndex]);\n }\n for (let inputErrorIndex = 0; inputErrorIndex < inputsWithErrorClasses.length; inputErrorIndex++) {\n let el = inputsWithErrorClasses[inputErrorIndex];\n this._markElementValid(el);\n }\n }\n\n\n /**\n * Registers a custom validator\n * @param {String} name\n * @param {Function} validator a validation function should always return either a Future(true) or Future(false)\n * even when the field has been invalidated with `setCustomValidity`, because of different browser `bugs`\n * we can't rely on that\n * @returns {Form}\n */\n registerValidator(name, validator) {\n this._validators[name] = validator;\n return this;\n }\n\n /**\n * Runs async validation\n * @param {String} validationRef\n * @param {HTMLElement} field\n * @returns {Promise}\n * @private\n */\n _runValidation(validationRef, field) {\n if (!this._validators[validationRef]) {\n throw 'Could not found validator: ' + validationRef;\n }\n var cl = field.classList, future = this._validators[validationRef].apply(this, [field, this.form]);\n cl.add(LOADING_CLASS);\n future.then(() => {\n cl.remove(LOADING_CLASS);\n });\n return future;\n }\n\n\n /**\n * Run custom validations for elements, validations are done async do support XHR Requests or other stuff\n *\n * @param {Array|NodeList} fields\n * @returns {Promise} contains either true if validations passed or false if something went wrong\n * @private\n */\n _customValidationsForElements(fields) {\n var futures = [], fieldsLength = fields.length, checkedFields = [];\n for (var iVal = 0; iVal < fieldsLength; iVal++) {\n var field = fields[iVal], validationRef = field.getAttribute(ATTR_VALIDATOR), validity = field.validity;\n if (this._validators[validationRef]) {\n // use local validation first and then continue with custom validations\n if (Form._shouldNotValidateField(field) || (validity && !validity.customError && !validity.valid)) {\n continue;\n }\n checkedFields.push(field);\n futures.push(this._runValidation(validationRef, field));\n } else {\n if (validationRef) {\n console.warn('data-validate was set but no validator was found');\n }\n }\n }\n return Promise.all(futures).then(function (allFutures) {\n let l = allFutures.length;\n let result = {\n checkedFields: checkedFields,\n foundAnyError: false\n };\n for (var fI = 0; fI < l; fI++) {\n if (!allFutures[fI]) {\n result.foundAnyError = true;\n break;\n }\n }\n return result;\n });\n }\n\n /**\n * Remove all errors for this form\n * @returns {Form}\n */\n removeErrors() {\n this._removeElementErrors(this.form);\n if (this.tooltips) {\n this.tooltips.removeTooltip();\n }\n return this;\n }\n\n /**\n * Will handle errors for given fields\n * @param {Array|NodeList} fields\n * @param {Boolean} removeAllErrors\n */\n prepareErrors(fields, removeAllErrors) {\n if (removeAllErrors) {\n this.removeErrors();\n }\n let labelGroups = {}, invalidFields = [];\n\n function handleAdditionalLabels(isInvalid, thisLabelGroup, field) {\n let additionalLabels = field.getAttribute(ATTR_DATA_CUSTOM_LABEL) ||\n field.id, group = thisLabelGroup[additionalLabels];\n if (additionalLabels) {\n // check additionally if field is currently marked as invalid\n // so the label is not marked as error if no field is marked as one\n group = group ? group : isInvalid;\n thisLabelGroup[additionalLabels] = group;\n }\n }\n\n // We save all validations in an extra property because we need to reset the validity due some\n // implementation errors in other browsers then chrome\n for (let i = 0; i < fields.length; i++) {\n let field = fields[i], errorTarget = Form._findErrorTarget(field), parent = errorTarget.parentNode,\n validity = field.validity, isInvalid = validity && !validity.valid;\n if (Form._shouldNotValidateField(field)) {\n continue;\n }\n field.flexFormsSavedValidity = JSON.parse(JSON.stringify(validity));\n handleAdditionalLabels(isInvalid, labelGroups, field);\n if (isInvalid) {\n if (!removeAllErrors) {\n // Remove current errors:\n this._removeElementErrors(parent);\n }\n // setup custom error messages:\n this._setupErrorMessages(field, validity);\n let msg = field.validationMessage;\n\n // mark fields as invalid\n this._markElementInvalid(errorTarget);\n this._markElementInvalid(field);\n\n if (this.options.appendError) {\n parent.insertAdjacentHTML(\"beforeend\",\n `
${msg}
`);\n }\n invalidFields.push(field);\n field.flexFormsSavedValidationMessage = msg;\n } else {\n // restore invalid fields\n this._markElementValid(errorTarget);\n this._markElementValid(field);\n\n // cleanup\n delete field.flexFormsSavedValidationMessage;\n\n // remove error markup\n this._removeElementErrors(parent);\n }\n // We have to reset the custom validity here to allow native validations work again\n field.setCustomValidity('');\n }\n // if validates a single field we need to check the linked fields to a label:\n if (fields.length === 1) {\n let field = fields[0];\n let id = field.getAttribute(ATTR_DATA_CUSTOM_LABEL) || field.id;\n if (id) {\n let linkedFields = Array.from(\n this.getForm().querySelectorAll(`[${ATTR_DATA_CUSTOM_LABEL}=\"${id}\"], #${id}`));\n linkedFields.forEach(function (thisField) {\n let validity = thisField.validity, isInvalid = validity && !validity.valid &&\n this._isElementInvalidElement(thisField);\n handleAdditionalLabels(isInvalid, labelGroups, thisField);\n }.bind(this));\n }\n }\n this._handleLabels(labelGroups);\n return invalidFields;\n }\n\n /**\n * Validates all custom fields\n * @returns {Promise}\n */\n validateCustomFields() {\n return this._customValidationsForElements(\n this.form.querySelectorAll(\"[data-validate]\"));\n }\n\n /**\n * Tests if a field should be validated\n * @param {HTMLElement} field\n * @returns {boolean}\n * @private\n */\n static _shouldNotValidateField(field) {\n var target = Form._findErrorTarget(field);\n return target instanceof HTMLFieldSetElement || field.validity === undefined ||\n (target.hasAttribute(ATTR_VALIDATE_VISIBILITY) && !Util.isVisible(target));\n }\n\n /**\n * Creates an array from a node list with invalid items\n * This Method expicitly checks if field should not be validated so it can be used to foucs a field\n * @param list\n * @returns {Array}\n * @private\n */\n static _createArrayFromInvalidFieldList(list) {\n var arr = [];\n for (var i = 0; i < list.length; ++i) {\n var n = list[i];\n if (n.validity && !n.validity.valid) {\n if (!Form._shouldNotValidateField(n)) {\n arr.push(n);\n }\n }\n }\n return arr;\n }\n\n\n /**\n * This form\n * @returns {HTMLElement}\n */\n getForm() {\n return this.form;\n }\n\n /**\n * Registers a function that handles remote validation\n * @param {Function} func\n * @returns {Form}\n */\n registerRemoteValidation(func) {\n this._remoteValidationFunction = func;\n return this;\n }\n\n\n /**\n * Formats the error content for the tooltip\n * @param {String} error\n * @returns {String}\n * @private\n */\n _formatErrorTooltip(error) {\n return this.options.formatErrorTooltip.apply(this, [error]);\n }\n\n /**\n * Tries to find a custom error target on given target\n * @param target\n * @returns {HTMLElement}\n * @private\n */\n static _findErrorTarget(target) {\n var el = target.getAttribute(ATTR_ERROR_TARGET_ID) || target,\n foundTarget = el instanceof HTMLElement ? el : global.document.getElementById(el);\n if (!foundTarget) {\n throw 'Given error target did not exsits:' + target;\n }\n return foundTarget;\n }\n\n /**\n * Creates a tooltip at given element, will only create a new instance if not created\n * @param {HTMLElement} target\n * @param {Boolean} [remove]\n */\n showAndOrCreateTooltip(target, remove) {\n var self = this;\n if (!this.tooltips && this.options.createTooltips) {\n this.tooltips = new Tooltip(this.options.tooltipContainer, this.options.tooltipOptions);\n }\n if (!this.options.createTooltips) {\n return false;\n }\n\n if (!target.flexFormsSavedValidity) {\n return false;\n }\n var errorTarget = Form._findErrorTarget(target);\n if (!target.flexFormsSavedValidity.valid && self._isElementInvalidElement(errorTarget)) {\n self.tooltips.createTooltip(errorTarget,\n self._formatErrorTooltip(target.flexFormsSavedValidationMessage), false);\n return true;\n } else {\n if (remove) {\n self.tooltips.removeTooltip();\n }\n }\n return false;\n }\n\n /**\n * Checks if element is marked as invalid\n * @param {HTMLElement} el\n * @returns {boolean}\n * @private\n */\n _isElementInvalidElement(el) {\n return el.hasAttribute(DATA_ELEMENT_INVALID);\n }\n\n /**\n * Handles invalid event of a form\n * @param {Event} e\n * @returns {Promise|boolean}\n * @private\n */\n _checkIsInvalid(e) {\n e.preventDefault();\n var invalidFields = this.getForm().querySelectorAll(\":invalid\");\n return this._handleValidation(invalidFields, true, false);\n }\n\n /**\n * Will query dependent fields (by selector) that should be validated with given field\n * @param field\n * @returns {NodeList|[]}\n * @private\n */\n _getDependentFields(field) {\n let fieldSelector = field.getAttribute(ATTR_DEPENDS), base = [field];\n if (fieldSelector) {\n base.push.apply(base, Array.prototype.slice.apply(\n this.getForm().querySelectorAll(fieldSelector)));\n }\n return base;\n }\n\n /**\n * @private\n * @param {HTMLElement} [target]\n */\n _handleTooltipInline(target) {\n if (this.tooltips) {\n this.tooltips.removeTooltip(target);\n }\n }\n\n /**\n * Initializes validation for a given form, registers event handlers\n */\n initFormValidation() {\n // Suppress the default bubbles\n var form = this.getForm(),\n self = this,\n invalidEvent = 'invalid';\n\n /**\n * Validates if is valid realtime element\n * @param {HTMLElement} target\n * @returns {boolean}\n * @private\n */\n function _checkIsValidRealtimeElement(target) {\n return !target.hasAttribute(ATTR_DISABLE_REALTIME) && !target.hasAttribute(ATTR_DISABLE_INLINE);\n }\n\n form.addEventListener(invalidEvent, function (e) {\n e.preventDefault();\n }, true);\n\n Util.addEventOnce(invalidEvent, form, function handleInvalid(e) {\n self._formLoading();\n var result = self._checkIsInvalid(e);\n if (result) {\n self.currentValidationFuture = new Promise((resolve) => {\n result.then(function (r) {\n setTimeout(function () {\n Util.addEventOnce(invalidEvent, form, handleInvalid, true);\n }, 0);\n resolve(r);\n self._formStopLoading();\n if (!r.foundAnyError) {\n self._formLoading();\n self._handleSubmit(e);\n }\n });\n });\n }\n }, true);\n\n this.addEventListener(form, 'reset', () => {\n this.removeErrors();\n });\n\n // Timeout for keys:\n var TIMEOUT_KEYDOWN, KEYDOWN_RUNNING = false;\n\n // resets keydown events\n function clearKeyDownTimeout() {\n KEYDOWN_RUNNING = false;\n clearTimeout(TIMEOUT_KEYDOWN);\n }\n\n // setup custom realtime event if given\n if (self.options.realtime) {\n this.addEventListener(form, CONST_REALTIME_EVENT, function (e) {\n if (self._formIsLoading()) {\n return;\n }\n var target = e.target;\n clearTimeout(TIMEOUT_KEYDOWN);\n if (KEYDOWN_RUNNING) {\n return;\n }\n TIMEOUT_KEYDOWN = setTimeout(() => {\n let isStillTarget = document.activeElement === e.target;\n if (!_checkIsValidRealtimeElement(target)) {\n return;\n }\n if (isStillTarget) {\n self._handleTooltipInline();\n }\n KEYDOWN_RUNNING = true;\n let dependentFields = self._getDependentFields(target);\n self._customValidationsForElements(dependentFields).then(function () {\n self.prepareErrors(dependentFields, false);\n if (isStillTarget) {\n self.showAndOrCreateTooltip(e.target);\n }\n // future must be resolved before another event can be started\n KEYDOWN_RUNNING = false;\n });\n }, self.options.realtimeTimeout);\n }, true);\n }\n\n /**\n * Validates if target is a valid input field to check blur and focus events\n *\n * @param {HTMLElement} target\n * @returns {boolean}\n * @private\n */\n function _checkIsValidBlurFocusElement(target) {\n let attr = target.getAttribute(\"type\");\n return (attr !== \"radio\" && attr !== \"checkbox\" && attr !== \"submit\");\n }\n\n /**\n * Validates if is valid inline-check element\n * @param {HTMLElement} target\n * @returns {boolean}\n * @private\n */\n function _checkIsValidInlineCheckElement(target) {\n return !target.hasAttribute(ATTR_DISABLE_INLINE);\n }\n\n this.addEventListener(form, 'blur', function (e) {\n // do not hide tooltip after change event\n if (!e.target.flexcssKeepTooltips) {\n self._handleTooltipInline(e.target);\n }\n delete e.target.flexcssKeepTooltips;\n }, true);\n\n // handle focus on input elements\n // will show an error if field is invalid\n this.addEventListener(form, \"focus\", function (e) {\n if (self._formIsLoading()) {\n return;\n }\n // do not track errors for checkbox and radios on focus:\n if (!_checkIsValidBlurFocusElement(e.target)) {\n return;\n }\n // we need to delay this a little, because Firefox and Safari do not show a tooltip after it\n // just have been hidden (on blur). Maybe fix this with a queue later\n setTimeout(function () {\n self.showAndOrCreateTooltip(e.target);\n }, FOCUS_TOOLTIP_DELAY);\n }, true);\n\n if (self.options.inlineValidation) {\n // Handle change for checkbox, radios and selects\n this.addEventListener(form, \"change\", function (e) {\n const target = e.target;\n if (self._formIsLoading() || !_checkIsValidInlineCheckElement(target)) {\n return;\n }\n clearKeyDownTimeout();\n const name = target.getAttribute('name');\n let inputs = name ? form.querySelectorAll('[name=\"' + name + '\"]') : [target];\n // we only support dependent fields for a single widgets right now\n if (inputs.length === 1) {\n inputs = self._getDependentFields(target);\n }\n self._customValidationsForElements(inputs).then(function () {\n self.prepareErrors(inputs, false);\n target.flexcssKeepTooltips = self.showAndOrCreateTooltip(target, true);\n if (target.flexcssKeepTooltips) {\n self._handleTooltipHideClickAfterChange();\n }\n });\n });\n }\n\n // prevent default if form is invalid\n this.addEventListener(form, \"submit\", function listener(e) {\n self._submitListener(e, listener);\n });\n\n Event.dispatchAndFire(form, EVENT_FORM_READY);\n }\n\n /* Loading states, unfortunately we can't check if a promise is pending :/*/\n /* TODO: Maybe wrap promise to extend this functionality */\n\n _formLoading() {\n this.getForm().classList.add(LOADING_CLASS);\n }\n\n _formStopLoading() {\n this.getForm().classList.remove(LOADING_CLASS);\n }\n\n _formIsLoading() {\n return this.getForm().classList.contains(LOADING_CLASS);\n }\n\n // this defines the logic after a change event when a tooltip is shown\n // because we call this method inside the change event, the click would be immeditally executed with the change\n // event when not using setTimeout(). There might be another solution for this...\n _handleTooltipHideClickAfterChange() {\n const self = this;\n if (this.options.createTooltips) {\n setTimeout(function () {\n Util.addEventOnce(Settings.getTabEvent(), global.document.body, function (t) {\n if (!self._isElementInvalidElement(t.target)) {\n self._handleTooltipInline();\n }\n });\n }, CLICK_TOOLTIP_DELAY);\n }\n }\n\n _focusElement(el) {\n el.focus();\n Util.scrollToElement(el, this.options.scrollToElementDiff);\n }\n\n /**\n * Listener that is executed on form submit\n * @param e\n * @param submitListener\n * @returns {boolean}\n * @private\n */\n _submitListener(e, submitListener) {\n\n const form = this.getForm(),\n self = this,\n submitEvent = 'submit';\n\n if (this._formIsLoading()) {\n e.preventDefault();\n return false;\n }\n this._formLoading();\n form.removeEventListener(submitEvent, submitListener);\n this.removeErrors();\n e.preventDefault();\n // reset:\n if (form.checkValidity()) {\n form.addEventListener(submitEvent, submitListener);\n // It's possible that the form is valid but the custom validations need to be checked again:\n self.currentValidationFuture = new Promise((resolve) => {\n var validation = self.validateCustomFields();\n validation.then(function (r) {\n // because custom validators may mark multiple fields as invalid, we get all of them in the form\n var fields = self._getInvalidElements(),\n errors = self.prepareErrors(fields, false), firstError = errors[0];\n if (firstError) {\n self._focusElement(firstError);\n self.showAndOrCreateTooltip(firstError, true);\n }\n resolve(r);\n });\n });\n self.currentValidationFuture.then(function (r) {\n if (!r.foundAnyError) {\n // Handle submitting the form to server:\n self._handleSubmit(e);\n } else {\n self._formStopLoading();\n }\n });\n } else {\n self._formStopLoading();\n form.addEventListener(submitEvent, submitListener);\n }\n }\n\n\n /**\n * Handles submitting, optionally allows to stop submitting\n * @param e\n * @private\n */\n _handleSubmit(e) {\n this._submitFunction(this.form, e);\n }\n\n\n /**\n * Registers a global event Handler\n * @param errorFunc\n */\n static registerErrorMessageHandler(errorFunc) {\n Form.globalErrorMessageHandler = errorFunc;\n }\n\n /**\n * Initialize forms for a specific selector\n * @param {String} selector\n * @param {Object} [options]\n * @return {array.}\n */\n static init(selector, options) {\n var forms = selector instanceof HTMLElement ? selector.querySelectorAll('form') :\n document.querySelectorAll(selector), instances = [];\n for (var i = 0; i < forms.length; i++) {\n instances.push(new Form(forms[i], options));\n }\n return instances;\n }\n\n\n /**\n * Registers a global validator that is usable on all form instances\n * @param {String} name\n * @param {Function} validator\n * @returns {Function}\n */\n static registerValidator(name, validator) {\n Form.globalValidators[name] = validator;\n return Form;\n }\n\n /**\n * Registers a global function that is called when a form should validate the response of a server\n * @param {Function} func\n * @returns {Form}\n */\n static registerGlobalRemoteValidationFunction(func) {\n Form.globalRemoteValidationFunction = func;\n return Form;\n }\n}\n\n\n/**\n * Global validators\n * @type {Array}\n */\nForm.globalValidators = [];\n\n/**\n * Global Remote validation function\n */\nForm.globalRemoteValidationFunction = function () {\n};\n\n/**\n * Handles custom error messages extracts custom message by default\n */\nForm.globalErrorMessageHandler = (field, validity) => {\n if (!validity.customError) {\n let customMsg = field.getAttribute(ATTR_DATA_CUSTOM_MESSAGE);\n if (customMsg) {\n field.setCustomValidity(customMsg);\n }\n }\n};\n\nexport default Form;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/main/Form.js\n **/","/*\n * The MIT License (MIT)\n *\n * Copyright (c) 2015 David Heidrich, BowlingX \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n/*!\n * FlexCss.Tooltip\n * Licensed under the MIT License (MIT)\n * Copyright (c) 2015 David Heidrich, BowlingX \n */\n\nimport Util from './util/Util';\nimport DestroyableWidget from './DestroyableWidget';\nimport Settings from './util/Settings';\n\n/**\n * @type {string}\n */\nconst CLASS_NAMES_TOOLTIP = 'tooltip-container';\n/**\n * @type {string}\n */\nconst CLASS_NAMES_OPEN = 'open';\n\n/**\n * @type {string}\n */\nconst ATTR_DATA_CLASSNAME = 'data-class';\n\n/**\n * @type {string}\n */\nconst ATTR_DATA_NO_TOUCH = 'data-no-touch';\n\n/**\n * @type {HTMLDocument}\n */\nconst doc = global.document;\n\n/**\n * Simple Tooltip\n */\nclass Tooltip extends DestroyableWidget {\n\n /**\n * Creates a Tooltip\n * @param {HTMLElement|String} DelegateContainer\n * @param {Object} [options]\n */\n constructor(DelegateContainer, options) {\n super();\n /**\n * The Container where possible events are captured\n */\n this.container = DelegateContainer instanceof HTMLElement ?\n DelegateContainer : doc.getElementById(DelegateContainer);\n\n if (!this.container) {\n throw new Error('Could not create Tooltip, DelegateContainer not found');\n }\n\n /**\n * The Container where tooltips are stored for this instance\n * @type {HTMLElement}\n */\n this.tooltipContainer = null;\n\n /**\n * Default Options\n */\n this.options = {\n containerClass: '',\n selectorAttribute: 'data-tooltip',\n collisionContainer: this.container\n };\n\n Object.assign(this.options, options || {});\n }\n\n /**\n * Creates and shows a tooltip\n * @param {HTMLElement} target where is this tooltip positioned\n * @param {String} text text content in tooltip, will be NOT escaped\n * @param {Boolean} [removeTitle] removes title element if given\n * @param {Node} [positionRelative]\n */\n createTooltip(target, text, removeTitle, positionRelative) {\n // abort if text is empty\n if (!text || text && text.trim() === '') {\n return;\n }\n\n if (Settings.isTouchDevice() && target && target.hasAttribute(ATTR_DATA_NO_TOUCH)) {\n return;\n }\n\n let tooltipContainer = this.tooltipContainer;\n\n if (!tooltipContainer) {\n tooltipContainer = doc.createElement('div');\n this.container.appendChild(tooltipContainer);\n this.tooltipContainer = tooltipContainer;\n }\n this._restoreClassNames(tooltipContainer, target);\n\n tooltipContainer.style.left = 'auto';\n tooltipContainer.style.top = 'auto';\n tooltipContainer.innerHTML = text;\n tooltipContainer.flexTooltipCurrentTarget = target;\n if (removeTitle) {\n target.oldTitle = text;\n target.removeAttribute('title');\n }\n\n Util.setupPositionNearby(positionRelative || target, tooltipContainer,\n this.options.collisionContainer, true, true);\n\n tooltipContainer.classList.add(CLASS_NAMES_OPEN);\n }\n\n _restoreClassNames(container, target) {\n // allow additional classname per tooltip on target element\n const classNames = [CLASS_NAMES_TOOLTIP, this.options.containerClass];\n const maybeTargetClass = target.getAttribute(ATTR_DATA_CLASSNAME);\n if (maybeTargetClass) {\n classNames.push(maybeTargetClass);\n }\n container.className = classNames.join(\" \");\n return this;\n }\n\n /**\n * @returns {HTMLElement|null}\n */\n getCurrentTarget() {\n return this.tooltipContainer ? this.tooltipContainer.flexTooltipCurrentTarget : null;\n }\n\n /**\n * Destroys this Widget\n * @returns {boolean}\n */\n destroy() {\n super.destroy();\n\n if (this.tooltipContainer) {\n this.tooltipContainer.parentNode.removeChild(this.tooltipContainer);\n return true;\n }\n return false;\n }\n\n /**\n * Removes a Tooltip on given target\n * @param {HTMLElement} [target], if not given will remove current open tooltip on this instance\n */\n removeTooltip(target) {\n let selfTarget = target;\n if (!selfTarget && this.tooltipContainer) {\n selfTarget = this.tooltipContainer.flexTooltipCurrentTarget;\n }\n if (this.tooltipContainer) {\n if (this.tooltipContainer.flexTooltipCurrentTarget !== selfTarget) {\n return;\n }\n this.tooltipContainer.classList.remove(CLASS_NAMES_OPEN);\n delete this.tooltipContainer.flexTooltipCurrentTarget;\n }\n if (selfTarget && selfTarget.oldTitle) {\n selfTarget.setAttribute('title', selfTarget.oldTitle);\n }\n }\n\n /**\n * Initilizes mouse events on container element\n */\n registerEvents() {\n const self = this;\n this.addEventListener(this.container, 'mouseover', (e) => {\n if (e.target.hasAttribute(self.options.selectorAttribute)) {\n self.createTooltip(e.target, e.target.getAttribute('title'), true);\n }\n });\n\n this.addEventListener(this.container, 'mouseout', (e) => {\n if (e.target.hasAttribute(self.options.selectorAttribute)) {\n self.removeTooltip(e.target);\n }\n });\n return this;\n }\n}\n\nexport default Tooltip;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/main/Tooltip.js\n **/","/*\n * The MIT License (MIT)\n *\n * Copyright (c) 2015 David Heidrich, BowlingX \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nconst PFX = [\"webkit\", \"moz\", \"MS\", \"o\", \"\"];\n\nconst COL_LEFT_CLASS = 'is-collision-left';\n\nconst COL_RIGHT_CLASS = 'is-collision-right';\n\nconst COL_BOTTOM_CLASS = 'is-collision-bottom';\n\n/**\n * Provides shared DOM-Utility functions\n */\nclass Util {\n\n /**\n * Will register the right animation event based on browser\n * @param element\n * @param type\n * @param callback\n */\n static prefixedAnimateEvent(element, type, callback) {\n const thisFunction = function thisFunction(e) {\n callback.apply(element, [e, thisFunction]);\n };\n\n for (let p = 0; p < PFX.length; p++) {\n let thisType = type;\n if (!PFX[p]) {\n thisType = type.toLowerCase();\n }\n const name = PFX[p] + thisType;\n element.addEventListener(name, thisFunction, true);\n }\n }\n\n /**\n * Get correct transitionend event\n * @returns {String}\n * @private\n */\n static whichTransitionEndEvent() {\n let t;\n const el = document.createElement('fake');\n\n const transitions = {\n transition: 'transitionend',\n OTransition: 'oTransitionEnd',\n MozTransition: 'transitionend',\n WebkitTransition: 'webkitTransitionEnd'\n };\n\n for (t in transitions) {\n if (el.style[t] !== undefined) {\n return transitions[t];\n }\n }\n }\n\n /**\n * Check if target is part of parent node\n * @param target\n * @param parent\n * @returns {boolean}\n */\n static isPartOfNode(target, parent) {\n if (!target || !parent) {\n return false;\n }\n let now = target;\n while (now !== parent && now !== null) {\n if (now === parent) {\n break;\n }\n now = now.parentNode;\n }\n return now !== null;\n }\n\n /**\n * Finds the closest element including itself matching a callback\n * @param {Node} el\n * @param {Function} callback\n * @returns {Node|boolean}\n */\n static closestCallback(el, callback) {\n let element = el;\n while (element !== null) {\n if (callback(element)) {\n return element;\n }\n element = element.parentNode;\n }\n return false;\n }\n\n /**\n * Walks the tree until func returns true for given argument\n * @param target\n * @param func\n * @returns {boolean|HTMLElement}\n */\n static parentsUntil(target, func) {\n if (!target) {\n return false;\n }\n let now = target;\n while (!func(now) && now !== null) {\n now = now.parentNode;\n }\n\n return now;\n }\n\n /**\n * Generates a unique id\n * @return {String}\n */\n static guid() {\n function s4() {\n return Math.floor((1 + Math.random()) * 0x10000)\n .toString(16)\n .substring(1);\n }\n\n return `${s4() + s4()}-${s4()}-${s4()}-${s4()}-${s4() + s4() + s4()}`;\n }\n\n /**\n * Detects scrollbar width\n * @see http://stackoverflow.com/questions/986937/how-can-i-get-the-browsers-scrollbar-sizes\n * @returns {number}\n */\n static getScrollBarWidth() {\n const doc = global.document;\n const inner = doc.createElement('p');\n\n inner.style.width = \"100%\";\n inner.style.height = \"200px\";\n\n const outer = doc.createElement('div');\n outer.style.position = \"absolute\";\n outer.style.top = \"0px\";\n outer.style.left = \"0px\";\n outer.style.visibility = \"hidden\";\n outer.style.width = \"200px\";\n outer.style.height = \"150px\";\n outer.style.overflow = \"hidden\";\n outer.appendChild(inner);\n\n doc.body.appendChild(outer);\n const w1 = inner.offsetWidth;\n outer.style.overflow = 'scroll';\n let w2 = inner.offsetWidth;\n if (w1 === w2) {\n w2 = outer.clientWidth;\n }\n doc.body.removeChild(outer);\n\n return (w1 - w2);\n }\n\n\n /**\n * Run an event once\n * @param {String} ev\n * @param {HTMLElement|HTMLDocument} target\n * @param {Function} func\n * @param {boolean} [capture]\n * @return Function created listener\n */\n static addEventOnce(ev, target, func, capture) {\n const thisFunction = function thisFunction(event) {\n func(event, func);\n target.removeEventListener(ev, thisFunction, capture);\n };\n target.addEventListener(ev, thisFunction, capture);\n return thisFunction;\n }\n\n /**\n * Checks if an element is visible\n * @param {HTMLElement} element\n * @returns bool\n */\n static isVisible(element) {\n return element.offsetWidth > 0 && element.offsetHeight > 0;\n }\n\n /**\n * Creates a camelCaseRepresentation of a dashed string\n * @param {String} str\n * @returns String\n */\n static dashToCamelCase(str) {\n return str.replace(/-([a-z])/g, (g) => {\n return g[1].toUpperCase();\n });\n }\n\n /**\n * Creates a copy of `input`\n * @param {*} input\n * @return *\n */\n static copy(input) {\n return JSON.parse(JSON.stringify(input));\n }\n\n /**\n * Reads options from element (data attributes) and applies to base\n * @param {HTMLElement} element\n * @param {Object} base\n * @return {Object}\n */\n static applyOptionsFromElement(element, base) {\n if (!element) {\n return base;\n }\n const attrs = element.attributes;\n for (let i = 0; i < attrs.length; i++) {\n const attr = attrs[i];\n if (attr) {\n const s = Util.dashToCamelCase(attr.nodeName.replace('data-', ''));\n const val = attr.nodeValue;\n if (base.hasOwnProperty(s)) {\n // skip functions\n if (typeof base[s] === 'function') {\n continue;\n }\n if (typeof base[s] === 'boolean') {\n base[s] = parseInt(val || 1, 10) === 1;\n } else {\n base[s] = val;\n }\n }\n }\n }\n return base;\n }\n\n /**\n * Will position an element directly at given target\n * Is aware of a given collision container to detect edges\n * Will put elementToPosition either to left, center or right edge (prefer right)\n * and either to bottom or top (prefers bottom)\n *\n * You may overwrite preferred positioned with `centerHorizontal` and `positionTop`\n *\n * @param {HTMLElement|ClientRect} target the target container to align to\n * @param {HTMLElement} elementToPosition the element to position\n * @param {HTMLElement} collisionContainer the outer container to prevent collisions\n * @param {boolean} [centerHorizontal] set true to center element, otherwise it's put on the right border by default\n * @param {boolean} [positionTop] flip top, by default element is positioned to the bottom.\n * @returns {HTMLElement}\n */\n static setupPositionNearby(target, elementToPosition, collisionContainer, centerHorizontal, positionTop) {\n // determine relative offsets\n let amountTop = 0;\n let amountLeft = 0;\n Util.parentsUntil(target.parentNode, (el) => {\n if (!(el instanceof HTMLElement)) {\n return false;\n }\n const style = window.getComputedStyle(el);\n if (Util.isPartOfNode(elementToPosition, el)) {\n if (style && style.position === 'relative') {\n amountTop += el.offsetTop || 0;\n amountLeft += el.offsetLeft || 0;\n }\n return false;\n }\n return true;\n });\n\n const targetPosition = target instanceof HTMLElement ? target.getBoundingClientRect() : target;\n const elementRect = elementToPosition.getBoundingClientRect();\n const colRect = collisionContainer.getBoundingClientRect();\n const targetTop = targetPosition.top - amountTop;\n const targetRight = targetPosition.right;\n const isCollisionTop = (targetTop - elementRect.height) <= 0;\n const isCollisionBottom =\n window.innerHeight < (targetTop + amountTop + targetPosition.height + elementRect.height);\n const isCollisionLeft = targetRight < elementRect.width;\n const targetLeft = targetPosition.left;\n const isCollisionRight = (targetLeft + elementRect.width) > colRect.width;\n const classList = elementToPosition.classList;\n\n classList.remove(COL_RIGHT_CLASS);\n classList.remove(COL_LEFT_CLASS);\n classList.remove(COL_BOTTOM_CLASS);\n\n let calcTop;\n let calcLeft;\n if (isCollisionLeft && !isCollisionRight) {\n // put element to left if collision with left\n calcLeft = `${(targetPosition.left - colRect.left - amountLeft)}px`;\n classList.add(COL_LEFT_CLASS);\n } else {\n // maybe center if no collision with either side\n const rightPosition = `${(targetRight - elementRect.width - colRect.left - amountLeft)}px`;\n const leftCentered = ((targetLeft + targetPosition.width / 2) -\n (elementRect.width / 2) || 0) - colRect.left;\n const collisionCentered = (leftCentered + elementRect.width) > colRect.width;\n if (centerHorizontal && !collisionCentered) {\n calcLeft = `${leftCentered}px`;\n } else {\n classList.add(COL_RIGHT_CLASS);\n calcLeft = rightPosition;\n }\n }\n\n if (isCollisionBottom || (positionTop && !isCollisionTop)) {\n // Put Element on top if collision\n calcTop = `${(targetTop - elementRect.height) - colRect.top}px`;\n classList.add(COL_BOTTOM_CLASS);\n } else {\n calcTop = `${(targetTop + targetPosition.height) - colRect.top}px`;\n }\n\n elementToPosition.style.cssText = `top:${calcTop};left:${calcLeft};`;\n\n return elementToPosition;\n }\n\n /**\n * Brings a given element into viewport\n * @param {HTMLElement} el\n * @param {int|function}[optionalOffset]\n */\n static scrollToElement(el, optionalOffset) {\n el.scrollIntoView();\n let thisOffset = optionalOffset;\n // optionally use a additional scrollDif\n if (thisOffset) {\n if (typeof thisOffset === 'function') {\n thisOffset = optionalOffset();\n }\n if (thisOffset > 0) {\n const scrolledY = window.pageYOffset;\n if (scrolledY) {\n window.scroll(0, scrolledY - thisOffset);\n }\n }\n }\n }\n}\n\nexport default Util;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/main/util/Util.js\n **/","/*\n * The MIT License (MIT)\n *\n * Copyright (c) 2015 David Heidrich, BowlingX \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n/**\n * Provides a Basic Widget\n */\nclass DestroyableWidget {\n\n constructor() {\n this.listeners = [];\n }\n\n /**\n * Destroys a Widget\n */\n destroy() {\n this.listeners.forEach((listener) => {\n listener.element.removeEventListener.apply(listener.element, listener.args);\n });\n this.listeners = [];\n }\n\n /**\n * Adds an event and registers it later to remove bindings\n * @param {HTMLElement} element\n * @param {String} name\n * @param {Function} listener\n * @param {boolean} [capture]\n * @returns {Function}\n */\n addEventListener(element, name, listener, capture) {\n this.listeners.push({\n element,\n args: [name, listener, capture]\n });\n\n element.addEventListener(name, listener, capture);\n return listener;\n }\n\n}\n\nexport default DestroyableWidget;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/main/DestroyableWidget.js\n **/","/*\n * The MIT License (MIT)\n *\n * Copyright (c) 2015 David Heidrich, BowlingX \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\nimport Util from './Util';\n\n// we attach global settings to global once because settings might be shared a lot of times trough the application\n// Maybe find a better way to handle that scenario\nif (!global.FLEXCSS_GLOBAL_SETTINGS) {\n global.FLEXCSS_GLOBAL_SETTINGS = {\n // defined breakpoint for small devices < n\n smallBreakpoint: 768,\n // nodes that should be updated when no scrollbar is expected\n scrollbarUpdateNodes: global.document.body !== null ? [global.document.body] : [],\n // additional Delay until darkener is fully hidden\n darkenerFadeDelay: 100,\n // class that is added if canvas has been toggled\n canvasToggledClass: 'toggled-canvas'\n };\n\n global.FLEXCSS_CONST_IS_IOS = null;\n\n global.FLEXCSS_CONST_IS_TOUCH = null;\n\n global.FLEXCSS_CONST_IS_IE = null;\n\n global.FLEXCSS_CONST_TAB_EVENT = 'click';\n\n global.FLEXCSS_IS_SMALL_SCREEN = false;\n\n const init = () => {\n // Measure scrollbar width\n global.FLEXCSS_CONST_SCROLLBAR_WIDTH = Util.getScrollBarWidth();\n // detect right transition end event\n global.FLEXCSS_CONST_TRANSITION_EVENT = Util.whichTransitionEndEvent();\n };\n\n if (global.document.readyState !== 'loading') {\n init();\n } else {\n // it's possible that global.document.body is not available if the document is not\n // loaded completely\n document.addEventListener('DOMContentLoaded', () => {\n init();\n });\n }\n}\n\n/**\n * Utility class that setups global settings\n */\nclass Settings {\n\n /**\n * Setup global settings, overwrite default values\n * @param {Object} settings\n */\n static setup(settings) {\n Object.assign(global.FLEXCSS_GLOBAL_SETTINGS, settings);\n }\n\n /**\n * Access to global settings\n * @returns {Object}\n */\n static get() {\n return global.FLEXCSS_GLOBAL_SETTINGS;\n }\n\n /**\n * Detects a IOS Device, caches subsequent calls\n * @returns {boolean}\n */\n static isIosDevice() {\n if (!global.FLEXCSS_CONST_IS_IOS) {\n global.FLEXCSS_CONST_IS_IOS = global.navigator.userAgent.match(/(iPad|iPhone|iPod)/i);\n }\n\n return global.FLEXCSS_CONST_IS_IOS;\n }\n\n /**\n * @returns {boolean}\n */\n static isSmallScreen() {\n return window.innerWidth < Settings.get().smallBreakpoint;\n }\n\n /**\n * Detects a touch device, caches subsequent calls\n * @returns {boolean}\n */\n static isTouchDevice() {\n if (!global.FLEXCSS_CONST_IS_TOUCH) {\n global.FLEXCSS_CONST_IS_TOUCH = 'ontouchstart' in window || !!(global.navigator.msMaxTouchPoints);\n }\n return global.FLEXCSS_CONST_IS_TOUCH;\n }\n\n /**\n * Checks if current browser is Internet Explorer\n * @returns {boolean|*}\n */\n static isIE() {\n if (!global.FLEXCSS_CONST_IS_IE) {\n global.FLEXCSS_CONST_IS_IE = \"ActiveXObject\" in window;\n }\n return global.FLEXCSS_CONST_IS_IE;\n }\n\n /**\n * @returns {String}\n */\n static getTransitionEvent() {\n return global.FLEXCSS_CONST_TRANSITION_EVENT;\n }\n\n /**\n * @returns {int}\n */\n static getScrollbarWidth() {\n return global.FLEXCSS_CONST_SCROLLBAR_WIDTH;\n }\n\n /**\n * @returns {String}\n */\n static getTabEvent() {\n return global.FLEXCSS_CONST_TAB_EVENT;\n }\n}\n\nexport default Settings;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/main/util/Settings.js\n **/","// the whatwg-fetch polyfill installs the fetch() function\n// on the global object (window or self)\n//\n// Return that as the export for use in Webpack, Browserify etc.\nrequire('whatwg-fetch');\nmodule.exports = self.fetch.bind(self);\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/isomorphic-fetch/fetch-npm-browserify.js\n ** module id = 12\n ** module chunks = 2 3\n **/","(function(self) {\n 'use strict';\n\n if (self.fetch) {\n return\n }\n\n function normalizeName(name) {\n if (typeof name !== 'string') {\n name = String(name)\n }\n if (/[^a-z0-9\\-#$%&'*+.\\^_`|~]/i.test(name)) {\n throw new TypeError('Invalid character in header field name')\n }\n return name.toLowerCase()\n }\n\n function normalizeValue(value) {\n if (typeof value !== 'string') {\n value = String(value)\n }\n return value\n }\n\n function Headers(headers) {\n this.map = {}\n\n if (headers instanceof Headers) {\n headers.forEach(function(value, name) {\n this.append(name, value)\n }, this)\n\n } else if (headers) {\n Object.getOwnPropertyNames(headers).forEach(function(name) {\n this.append(name, headers[name])\n }, this)\n }\n }\n\n Headers.prototype.append = function(name, value) {\n name = normalizeName(name)\n value = normalizeValue(value)\n var list = this.map[name]\n if (!list) {\n list = []\n this.map[name] = list\n }\n list.push(value)\n }\n\n Headers.prototype['delete'] = function(name) {\n delete this.map[normalizeName(name)]\n }\n\n Headers.prototype.get = function(name) {\n var values = this.map[normalizeName(name)]\n return values ? values[0] : null\n }\n\n Headers.prototype.getAll = function(name) {\n return this.map[normalizeName(name)] || []\n }\n\n Headers.prototype.has = function(name) {\n return this.map.hasOwnProperty(normalizeName(name))\n }\n\n Headers.prototype.set = function(name, value) {\n this.map[normalizeName(name)] = [normalizeValue(value)]\n }\n\n Headers.prototype.forEach = function(callback, thisArg) {\n Object.getOwnPropertyNames(this.map).forEach(function(name) {\n this.map[name].forEach(function(value) {\n callback.call(thisArg, value, name, this)\n }, this)\n }, this)\n }\n\n function consumed(body) {\n if (body.bodyUsed) {\n return Promise.reject(new TypeError('Already read'))\n }\n body.bodyUsed = true\n }\n\n function fileReaderReady(reader) {\n return new Promise(function(resolve, reject) {\n reader.onload = function() {\n resolve(reader.result)\n }\n reader.onerror = function() {\n reject(reader.error)\n }\n })\n }\n\n function readBlobAsArrayBuffer(blob) {\n var reader = new FileReader()\n reader.readAsArrayBuffer(blob)\n return fileReaderReady(reader)\n }\n\n function readBlobAsText(blob) {\n var reader = new FileReader()\n reader.readAsText(blob)\n return fileReaderReady(reader)\n }\n\n var support = {\n blob: 'FileReader' in self && 'Blob' in self && (function() {\n try {\n new Blob();\n return true\n } catch(e) {\n return false\n }\n })(),\n formData: 'FormData' in self,\n arrayBuffer: 'ArrayBuffer' in self\n }\n\n function Body() {\n this.bodyUsed = false\n\n\n this._initBody = function(body) {\n this._bodyInit = body\n if (typeof body === 'string') {\n this._bodyText = body\n } else if (support.blob && Blob.prototype.isPrototypeOf(body)) {\n this._bodyBlob = body\n } else if (support.formData && FormData.prototype.isPrototypeOf(body)) {\n this._bodyFormData = body\n } else if (!body) {\n this._bodyText = ''\n } else if (support.arrayBuffer && ArrayBuffer.prototype.isPrototypeOf(body)) {\n // Only support ArrayBuffers for POST method.\n // Receiving ArrayBuffers happens via Blobs, instead.\n } else {\n throw new Error('unsupported BodyInit type')\n }\n\n if (!this.headers.get('content-type')) {\n if (typeof body === 'string') {\n this.headers.set('content-type', 'text/plain;charset=UTF-8')\n } else if (this._bodyBlob && this._bodyBlob.type) {\n this.headers.set('content-type', this._bodyBlob.type)\n }\n }\n }\n\n if (support.blob) {\n this.blob = function() {\n var rejected = consumed(this)\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return Promise.resolve(this._bodyBlob)\n } else if (this._bodyFormData) {\n throw new Error('could not read FormData body as blob')\n } else {\n return Promise.resolve(new Blob([this._bodyText]))\n }\n }\n\n this.arrayBuffer = function() {\n return this.blob().then(readBlobAsArrayBuffer)\n }\n\n this.text = function() {\n var rejected = consumed(this)\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return readBlobAsText(this._bodyBlob)\n } else if (this._bodyFormData) {\n throw new Error('could not read FormData body as text')\n } else {\n return Promise.resolve(this._bodyText)\n }\n }\n } else {\n this.text = function() {\n var rejected = consumed(this)\n return rejected ? rejected : Promise.resolve(this._bodyText)\n }\n }\n\n if (support.formData) {\n this.formData = function() {\n return this.text().then(decode)\n }\n }\n\n this.json = function() {\n return this.text().then(JSON.parse)\n }\n\n return this\n }\n\n // HTTP methods whose capitalization should be normalized\n var methods = ['DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT']\n\n function normalizeMethod(method) {\n var upcased = method.toUpperCase()\n return (methods.indexOf(upcased) > -1) ? upcased : method\n }\n\n function Request(input, options) {\n options = options || {}\n var body = options.body\n if (Request.prototype.isPrototypeOf(input)) {\n if (input.bodyUsed) {\n throw new TypeError('Already read')\n }\n this.url = input.url\n this.credentials = input.credentials\n if (!options.headers) {\n this.headers = new Headers(input.headers)\n }\n this.method = input.method\n this.mode = input.mode\n if (!body) {\n body = input._bodyInit\n input.bodyUsed = true\n }\n } else {\n this.url = input\n }\n\n this.credentials = options.credentials || this.credentials || 'omit'\n if (options.headers || !this.headers) {\n this.headers = new Headers(options.headers)\n }\n this.method = normalizeMethod(options.method || this.method || 'GET')\n this.mode = options.mode || this.mode || null\n this.referrer = null\n\n if ((this.method === 'GET' || this.method === 'HEAD') && body) {\n throw new TypeError('Body not allowed for GET or HEAD requests')\n }\n this._initBody(body)\n }\n\n Request.prototype.clone = function() {\n return new Request(this)\n }\n\n function decode(body) {\n var form = new FormData()\n body.trim().split('&').forEach(function(bytes) {\n if (bytes) {\n var split = bytes.split('=')\n var name = split.shift().replace(/\\+/g, ' ')\n var value = split.join('=').replace(/\\+/g, ' ')\n form.append(decodeURIComponent(name), decodeURIComponent(value))\n }\n })\n return form\n }\n\n function headers(xhr) {\n var head = new Headers()\n var pairs = xhr.getAllResponseHeaders().trim().split('\\n')\n pairs.forEach(function(header) {\n var split = header.trim().split(':')\n var key = split.shift().trim()\n var value = split.join(':').trim()\n head.append(key, value)\n })\n return head\n }\n\n Body.call(Request.prototype)\n\n function Response(bodyInit, options) {\n if (!options) {\n options = {}\n }\n\n this.type = 'default'\n this.status = options.status\n this.ok = this.status >= 200 && this.status < 300\n this.statusText = options.statusText\n this.headers = options.headers instanceof Headers ? options.headers : new Headers(options.headers)\n this.url = options.url || ''\n this._initBody(bodyInit)\n }\n\n Body.call(Response.prototype)\n\n Response.prototype.clone = function() {\n return new Response(this._bodyInit, {\n status: this.status,\n statusText: this.statusText,\n headers: new Headers(this.headers),\n url: this.url\n })\n }\n\n Response.error = function() {\n var response = new Response(null, {status: 0, statusText: ''})\n response.type = 'error'\n return response\n }\n\n var redirectStatuses = [301, 302, 303, 307, 308]\n\n Response.redirect = function(url, status) {\n if (redirectStatuses.indexOf(status) === -1) {\n throw new RangeError('Invalid status code')\n }\n\n return new Response(null, {status: status, headers: {location: url}})\n }\n\n self.Headers = Headers;\n self.Request = Request;\n self.Response = Response;\n\n self.fetch = function(input, init) {\n return new Promise(function(resolve, reject) {\n var request\n if (Request.prototype.isPrototypeOf(input) && !init) {\n request = input\n } else {\n request = new Request(input, init)\n }\n\n var xhr = new XMLHttpRequest()\n\n function responseURL() {\n if ('responseURL' in xhr) {\n return xhr.responseURL\n }\n\n // Avoid security warnings on getResponseHeader when not allowed by CORS\n if (/^X-Request-URL:/m.test(xhr.getAllResponseHeaders())) {\n return xhr.getResponseHeader('X-Request-URL')\n }\n\n return;\n }\n\n xhr.onload = function() {\n var status = (xhr.status === 1223) ? 204 : xhr.status\n if (status < 100 || status > 599) {\n reject(new TypeError('Network request failed'))\n return\n }\n var options = {\n status: status,\n statusText: xhr.statusText,\n headers: headers(xhr),\n url: responseURL()\n }\n var body = 'response' in xhr ? xhr.response : xhr.responseText;\n resolve(new Response(body, options))\n }\n\n xhr.onerror = function() {\n reject(new TypeError('Network request failed'))\n }\n\n xhr.open(request.method, request.url, true)\n\n if (request.credentials === 'include') {\n xhr.withCredentials = true\n }\n\n if ('responseType' in xhr && support.blob) {\n xhr.responseType = 'blob'\n }\n\n request.headers.forEach(function(value, name) {\n xhr.setRequestHeader(name, value)\n })\n\n xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit)\n })\n }\n self.fetch.polyfill = true\n})(typeof self !== 'undefined' ? self : this);\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/whatwg-fetch/fetch.js\n ** module id = 13\n ** module chunks = 2 3\n **/","/* global CustomEvent */\n\n/*\n * The MIT License (MIT)\n *\n * Copyright (c) 2015 David Heidrich, BowlingX \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n// polyfill for custom events to make thinks work in IE\n// The needed polyfill is so small that I embedded it here\n(function poly() {\n if (!global.CustomEvent || typeof global.CustomEvent !== 'function') {\n const CustomEvent = function CustomEvent(event, params) {\n const thisParams = params ||\n {\n bubbles: false,\n cancelable: false,\n detail: undefined\n };\n const evt = document.createEvent(\"CustomEvent\");\n evt.initCustomEvent(event, thisParams.bubbles,\n thisParams.cancelable, thisParams.detail);\n return evt;\n };\n CustomEvent.prototype = global.Event.prototype;\n global.CustomEvent = CustomEvent;\n }\n})();\n/**\n * Simpler Event dispatching\n */\nclass EventHandler {\n\n /**\n * @param {HTMLElement} target\n * @param {String} name\n */\n constructor(target, name) {\n this.target = target;\n this.defaultOptions = {\n bubbles: true,\n cancelable: true\n };\n\n this.name = name;\n }\n\n /**\n * Set more options\n * @param {Object} options\n * @returns {EventHandler}\n */\n withOptions(options) {\n Object.assign(this.defaultOptions, (options || {}));\n return this;\n }\n\n /**\n * Call with the originalEvent\n * @param {Event} e\n * @returns {EventHandler}\n */\n withOriginal(e) {\n return this.withDetail({\n originalEvent: e\n });\n }\n\n /**\n * Extends the detail part of the event\n * @param {Object} o\n * @returns {EventHandler}\n */\n withDetail(o) {\n if (!this.defaultOptions.detail) {\n this.defaultOptions.detail = {};\n }\n Object.assign(this.defaultOptions.detail, o);\n return this;\n }\n\n /**\n * @returns {CustomEvent}\n */\n fire() {\n const e = new CustomEvent(this.name, this.defaultOptions);\n if (this.target) {\n this.target.dispatchEvent(e);\n }\n return e;\n }\n}\n\nclass Event {\n /**\n * Prepares to dispatch a custom event (without firing)\n * @param {HTMLElement} target\n * @param {String} name\n * @returns {EventHandler}\n */\n static dispatch(target, name) {\n return new EventHandler(target, name);\n }\n\n /**\n * Dispatches a custom event and fires it directly\n * @param {HTMLElement} target\n * @param {String} name\n * @param {Object} [options]\n * @returns {CustomEvent}\n */\n static dispatchAndFire(target, name, options) {\n return new EventHandler(target, name).withOptions(options).fire();\n }\n}\n\nexport default Event;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/main/util/Event.js\n **/","'use strict';\n\nimport Form from '../Form';\nimport Tooltip from '../Tooltip';\nimport Settings from '../util/Settings';\n\n// default export as component object\nexport default {\n Form,\n Settings,\n Tooltip\n};\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/main/modules/Form.js\n **/"],"sourceRoot":""} \ No newline at end of file diff --git a/build/maps/form.min.map b/build/maps/form.min.map index 0f8d2525..71d376ff 100644 --- a/build/maps/form.min.map +++ b/build/maps/form.min.map @@ -1 +1 @@ -{"version":3,"sources":["webpack:///webpack/universalModuleDefinition?5ca6","webpack:///js/form.min.js","webpack:///webpack/bootstrap 2abcfdab5a59a5cf6b3b?7be2","webpack:///./src/main/util/Util.js?5bc4","webpack:///./src/main/util/Settings.js?b01f","webpack:///./src/main/util/Event.js?68bf","webpack:///./src/main/DestroyableWidget.js?8d9b","webpack:///./src/main/Tooltip.js?3890","webpack:///./src/main/Form.js?18a8","webpack:///./~/isomorphic-fetch/fetch-npm-browserify.js?7723","webpack:///./~/whatwg-fetch/fetch.js?1c20","webpack:///./src/main/modules/Form.js"],"names":["root","factory","exports","module","define","amd","this","modules","__webpack_require__","moduleId","installedModules","id","loaded","call","m","c","p","global","_classCallCheck","instance","Constructor","TypeError","Object","defineProperty","value","_createClass","defineProperties","target","props","i","length","descriptor","enumerable","configurable","writable","key","protoProps","staticProps","prototype","PFX","COL_LEFT_CLASS","COL_RIGHT_CLASS","COL_BOTTOM_CLASS","Util","element","type","callback","thisFunction","e","apply","thisType","toLowerCase","name","addEventListener","t","el","document","createElement","transitions","transition","OTransition","MozTransition","WebkitTransition","undefined","style","parent","now","parentNode","func","s4","Math","floor","random","toString","substring","doc","inner","width","height","outer","position","top","left","visibility","overflow","appendChild","body","w1","offsetWidth","w2","clientWidth","removeChild","ev","capture","event","removeEventListener","offsetHeight","str","replace","g","toUpperCase","input","JSON","parse","stringify","base","attrs","attributes","attr","s","dashToCamelCase","nodeName","val","nodeValue","hasOwnProperty","parseInt","elementToPosition","collisionContainer","centerHorizontal","positionTop","amountTop","amountLeft","parentsUntil","HTMLElement","window","getComputedStyle","isPartOfNode","offsetTop","offsetLeft","targetPosition","getBoundingClientRect","elementRect","colRect","targetTop","targetRight","right","isCollisionTop","isCollisionBottom","innerHeight","isCollisionLeft","targetLeft","isCollisionRight","classList","remove","calcTop","calcLeft","add","rightPosition","leftCentered","collisionCentered","cssText","optionalOffset","scrollIntoView","thisOffset","scrolledY","pageYOffset","scroll","_interopRequireDefault","obj","__esModule","default","_Util","_Util2","FLEXCSS_GLOBAL_SETTINGS","smallBreakpoint","scrollbarUpdateNodes","darkenerFadeDelay","canvasToggledClass","FLEXCSS_CONST_IS_IOS","FLEXCSS_CONST_IS_TOUCH","FLEXCSS_CONST_IS_IE","FLEXCSS_CONST_TAB_EVENT","FLEXCSS_IS_SMALL_SCREEN","init","FLEXCSS_CONST_SCROLLBAR_WIDTH","getScrollBarWidth","FLEXCSS_CONST_TRANSITION_EVENT","whichTransitionEndEvent","readyState","Settings","settings","assign","navigator","userAgent","match","innerWidth","get","msMaxTouchPoints","CustomEvent","_CustomEvent","params","thisParams","bubbles","cancelable","detail","evt","createEvent","initCustomEvent","Event","EventHandler","defaultOptions","options","withDetail","originalEvent","o","dispatchEvent","withOptions","fire","DestroyableWidget","listeners","forEach","listener","args","push","_possibleConstructorReturn","self","ReferenceError","_inherits","subClass","superClass","create","constructor","setPrototypeOf","__proto__","_get","object","property","receiver","Function","desc","getOwnPropertyDescriptor","getPrototypeOf","getter","_DestroyableWidget2","_DestroyableWidget3","_Settings","_Settings2","CLASS_NAMES_TOOLTIP","CLASS_NAMES_OPEN","ATTR_DATA_CLASSNAME","ATTR_DATA_NO_TOUCH","Tooltip","_DestroyableWidget","DelegateContainer","_this","container","getElementById","Error","tooltipContainer","containerClass","selectorAttribute","text","removeTitle","positionRelative","trim","isTouchDevice","hasAttribute","_restoreClassNames","innerHTML","flexTooltipCurrentTarget","oldTitle","removeAttribute","setupPositionNearby","classNames","maybeTargetClass","getAttribute","className","join","selfTarget","setAttribute","createTooltip","removeTooltip","EVENT_FORM_AJAX_COMPLETED","EVENT_FORM_AFTER_AJAX_SUBMIT","EVENT_FORM_SUBMIT","EVENT_FORM_READY","_Tooltip","_Tooltip2","_Event","_Event2","LOADING_CLASS","DATA_ELEMENT_INVALID","REMOTE","REMOTE_ACTION","ATTR_DISABLE_INLINE","ATTR_DISABLE_REALTIME","ATTR_VALIDATOR","ATTR_DATA_CUSTOM_MESSAGE","ATTR_DATA_CUSTOM_LABEL","ATTR_VALIDATE_VISIBILITY","ATTR_ERROR_TARGET_ID","ATTR_DEPENDS","CONST_USE_JSON","CONST_REALTIME_EVENT","FOCUS_TOOLTIP_DELAY","CLICK_TOOLTIP_DELAY","Form","form","HTMLFormElement","tooltips","currentValidationFuture","Promise","createTooltips","appendError","ajaxSubmitType","ajaxJsonContentType","inlineValidation","realtime","realtimeTimeout","formatErrorTooltip","error","inputErrorClass","containerErrorClass","fetchOptions","credentials","tooltipOptions","scrollToElementDiff","applyOptionsFromElement","hfWidgetInstance","_validators","globalValidators","_remoteValidationFunction","initFormValidation","destroy","thisForm","shouldUseAjax","ajaxPostUrl","location","href","useJson","dispatch","withOriginal","defaultPrevented","_formStopLoading","submit","preventDefault","defaultHeaders","X-Requested-With","Content-Type","headers","method","serverCall","fetch","serialize","FormData","then","r","globalRemoteValidationFunction","response","selectors","inputs","querySelectorAll","result","Array","exists","field","focus","_this2","fields","NodeList","_handleValidation","foundAnyError","bind","toValidateFields","scoped","arr","_createArrayFromInvalidFieldList","isLocalInvalid","_focusElement","validation","_customValidationsForElements","validateCustomFields","thisToValidateFields","from","concat","checkedFields","foundInvalidFields","prepareErrors","firstInvalidField","activeElement","_handleTooltipHideClickAfterChange","showAndOrCreateTooltip","validity","globalErrorMessageHandler","keys","labels","getForm","invalid","labelsIndex","labelEl","_markElementInvalid","_markElementValid","filter","HTMLFieldSetElement","thisParent","errors","inputsWithErrorClasses","elementErrorIndex","inputErrorIndex","validator","validationRef","cl","future","futures","fieldsLength","iVal","_shouldNotValidateField","customError","valid","_runValidation","console","warn","all","allFutures","l","fI","_removeElementErrors","removeAllErrors","handleAdditionalLabels","isInvalid","thisLabelGroup","additionalLabels","group","removeErrors","labelGroups","invalidFields","errorTarget","_findErrorTarget","flexFormsSavedValidity","_setupErrorMessages","msg","validationMessage","insertAdjacentHTML","flexFormsSavedValidationMessage","setCustomValidity","_field","linkedFields","thisField","_isElementInvalidElement","_handleLabels","_formatErrorTooltip","fieldSelector","slice","_checkIsValidRealtimeElement","clearKeyDownTimeout","KEYDOWN_RUNNING","clearTimeout","TIMEOUT_KEYDOWN","_checkIsValidBlurFocusElement","_checkIsValidInlineCheckElement","_this3","invalidEvent","addEventOnce","handleInvalid","_formLoading","_checkIsInvalid","resolve","setTimeout","_handleSubmit","_formIsLoading","isStillTarget","_handleTooltipInline","dependentFields","_getDependentFields","flexcssKeepTooltips","_submitListener","dispatchAndFire","contains","getTabEvent","scrollToElement","submitListener","submitEvent","checkValidity","_getInvalidElements","firstError","_submitFunction","isVisible","list","n","foundTarget","errorFunc","selector","forms","instances","customMsg","normalizeName","String","test","normalizeValue","Headers","map","append","getOwnPropertyNames","consumed","bodyUsed","reject","fileReaderReady","reader","onload","onerror","readBlobAsArrayBuffer","blob","FileReader","readAsArrayBuffer","readBlobAsText","readAsText","Body","_initBody","_bodyInit","_bodyText","support","Blob","isPrototypeOf","_bodyBlob","formData","_bodyFormData","arrayBuffer","ArrayBuffer","set","rejected","decode","json","normalizeMethod","upcased","methods","indexOf","Request","url","mode","referrer","split","bytes","shift","decodeURIComponent","xhr","head","pairs","getAllResponseHeaders","header","Response","bodyInit","status","ok","statusText","values","getAll","has","thisArg","clone","redirectStatuses","redirect","RangeError","responseURL","getResponseHeader","request","XMLHttpRequest","responseText","open","withCredentials","responseType","setRequestHeader","send","polyfill","_Form","_Form2"],"mappings":"CAAA,SAAAA,EAAAC,GACA,gBAAAC,UAAA,gBAAAC,QACAA,OAAAD,QAAAD,IACA,kBAAAG,gBAAAC,IACAD,UAAAH,GACA,gBAAAC,SACAA,QAAA,QAAAD,IAEAD,EAAA,QAAAC,KACCK,KAAA,WACD,MCAgB,UAAUC,GCN1B,QAAAC,GAAAC,GAGA,GAAAC,EAAAD,GACA,MAAAC,GAAAD,GAAAP,OAGA,IAAAC,GAAAO,EAAAD,IACAP,WACAS,GAAAF,EACAG,QAAA,EAUA,OANAL,GAAAE,GAAAI,KAAAV,EAAAD,QAAAC,IAAAD,QAAAM,GAGAL,EAAAS,QAAA,EAGAT,EAAAD,QAvBA,GAAAQ,KAqCA,OATAF,GAAAM,EAAAP,EAGAC,EAAAO,EAAAL,EAGAF,EAAAQ,EAAA,MAGAR,EAAA,KDgBM,SAASL,EAAQD,EAASM,GAE/BL,EAAOD,QAAUM,EAAoB,KAKhC,SAASL,EAAQD,IAEM,SAASe,GAAS,YAQ9C,SAASC,GAAgBC,EAAUC,GAAe,KAAMD,YAAoBC,IAAgB,KAAM,IAAIC,WAAU,qCANhHC,OAAOC,eAAerB,EAAS,cAC3BsB,OAAO,GAGX,IAAIC,GAAe,WAAc,QAASC,GAAiBC,EAAQC,GAAS,IAAK,GAAIC,GAAI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,EAAAsB,YACApG,GAAA,GAAAmF,GAAArc,EAAAmH,KAGA6U,EAAAnC,QAAA,WACAJ,EAAA,GAAA1d,WAAA,4BAGAigB,EAAAuB,KAAAH,EAAAtN,OAAAsN,EAAA3B,KAAA,GAEA,YAAA2B,EAAAhP,cACA4N,EAAAwB,iBAAA,GAGA,gBAAAxB,IAAAxB,EAAAT,OACAiC,EAAAyB,aAAA;AAGAL,EAAAvN,QAAAjI,QAAA,SAAA1L,EAAA4B,GACAke,EAAA0B,iBAAA5f,EAAA5B,KAGA8f,EAAA2B,KAAA,mBAAAP,GAAA9C,UAAA,KAAA8C,EAAA9C,cAGArS,EAAA+H,MAAA4N,UAAA,IACC,mBAAA3V,WAAAjN,OT68EO,CACA,CACA,CACA,CACA,CAEF,SAASH,EAAQD,EAASM,GUv1FhC,YV22FC,SAASqJ,GAAuBC,GAAO,MAAOA,IAAOA,EAAIC,WAAaD,GAAQE,UAASF,GAhBvFxI,OAAOC,eAAerB,EAAS,cAC3BsB,OAAO,GAGX,IAAI2hB,GAAQ3iB,EAAoB,GAE5B4iB,EAASvZ,EAAuBsZ,GAEhC/R,EAAW5Q,EAAoB,GAE/B6Q,EAAYxH,EAAuBuH,GAEnCzC,EAAYnO,EAAoB,GAEhCoO,EAAa/E,EAAuB8E,EAKxCzO,eUt2FGsS,KAAA4Q,aACAjY,SAAAyD,aACAK,QAAAoC","file":"js/form.min.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"FlexCss\"] = factory();\n\telse\n\t\troot[\"FlexCss\"] = factory();\n})(this, function() {\nreturn \n\n\n/** WEBPACK FOOTER **\n ** webpack/universalModuleDefinition\n **/","(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"FlexCss\"] = factory();\n\telse\n\t\troot[\"FlexCss\"] = factory();\n})(this, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId])\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\texports: {},\n/******/ \t\t\tid: moduleId,\n/******/ \t\t\tloaded: false\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.loaded = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"../\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tmodule.exports = __webpack_require__(18);\n\n\n/***/ },\n/* 1 */\n/***/ function(module, exports) {\n\n\t/* WEBPACK VAR INJECTION */(function(global) {\"use strict\";\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\t/*\n\t * The MIT License (MIT)\n\t *\n\t * Copyright (c) 2015 David Heidrich, BowlingX \n\t *\n\t * Permission is hereby granted, free of charge, to any person obtaining a copy\n\t * of this software and associated documentation files (the \"Software\"), to deal\n\t * in the Software without restriction, including without limitation the rights\n\t * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n\t * copies of the Software, and to permit persons to whom the Software is\n\t * furnished to do so, subject to the following conditions:\n\t *\n\t * The above copyright notice and this permission notice shall be included in\n\t * all copies or substantial portions of the Software.\n\t *\n\t * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n\t * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n\t * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n\t * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n\t * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n\t * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n\t * THE SOFTWARE.\n\t */\n\t\n\tvar PFX = [\"webkit\", \"moz\", \"MS\", \"o\", \"\"];\n\t\n\tvar COL_LEFT_CLASS = 'is-collision-left';\n\t\n\tvar COL_RIGHT_CLASS = 'is-collision-right';\n\t\n\tvar COL_BOTTOM_CLASS = 'is-collision-bottom';\n\t\n\t/**\n\t * Provides shared DOM-Utility functions\n\t */\n\t\n\tvar Util = function () {\n\t function Util() {\n\t _classCallCheck(this, Util);\n\t }\n\t\n\t _createClass(Util, null, [{\n\t key: \"prefixedAnimateEvent\",\n\t\n\t\n\t /**\n\t * Will register the right animation event based on browser\n\t * @param element\n\t * @param type\n\t * @param callback\n\t */\n\t value: function prefixedAnimateEvent(element, type, callback) {\n\t var thisFunction = function thisFunction(e) {\n\t callback.apply(element, [e, thisFunction]);\n\t };\n\t\n\t for (var p = 0; p < PFX.length; p++) {\n\t var thisType = type;\n\t if (!PFX[p]) {\n\t thisType = type.toLowerCase();\n\t }\n\t var name = PFX[p] + thisType;\n\t element.addEventListener(name, thisFunction, true);\n\t }\n\t }\n\t\n\t /**\n\t * Get correct transitionend event\n\t * @returns {String}\n\t * @private\n\t */\n\t\n\t }, {\n\t key: \"whichTransitionEndEvent\",\n\t value: function whichTransitionEndEvent() {\n\t var t = void 0;\n\t var el = document.createElement('fake');\n\t\n\t var transitions = {\n\t transition: 'transitionend',\n\t OTransition: 'oTransitionEnd',\n\t MozTransition: 'transitionend',\n\t WebkitTransition: 'webkitTransitionEnd'\n\t };\n\t\n\t for (t in transitions) {\n\t if (el.style[t] !== undefined) {\n\t return transitions[t];\n\t }\n\t }\n\t }\n\t\n\t /**\n\t * Check if target is part of parent node\n\t * @param target\n\t * @param parent\n\t * @returns {boolean}\n\t */\n\t\n\t }, {\n\t key: \"isPartOfNode\",\n\t value: function isPartOfNode(target, parent) {\n\t if (!target || !parent) {\n\t return false;\n\t }\n\t var now = target;\n\t while (now !== parent && now !== null) {\n\t if (now === parent) {\n\t break;\n\t }\n\t now = now.parentNode;\n\t }\n\t return now !== null;\n\t }\n\t\n\t /**\n\t * Finds the closest element including itself matching a callback\n\t * @param {Node} el\n\t * @param {Function} callback\n\t * @returns {Node|boolean}\n\t */\n\t\n\t }, {\n\t key: \"closestCallback\",\n\t value: function closestCallback(el, callback) {\n\t var element = el;\n\t while (element !== null) {\n\t if (callback(element)) {\n\t return element;\n\t }\n\t element = element.parentNode;\n\t }\n\t return false;\n\t }\n\t\n\t /**\n\t * Walks the tree until func returns true for given argument\n\t * @param target\n\t * @param func\n\t * @returns {boolean|HTMLElement}\n\t */\n\t\n\t }, {\n\t key: \"parentsUntil\",\n\t value: function parentsUntil(target, func) {\n\t if (!target) {\n\t return false;\n\t }\n\t var now = target;\n\t while (!func(now) && now !== null) {\n\t now = now.parentNode;\n\t }\n\t\n\t return now;\n\t }\n\t\n\t /**\n\t * Generates a unique id\n\t * @return {String}\n\t */\n\t\n\t }, {\n\t key: \"guid\",\n\t value: function guid() {\n\t function s4() {\n\t return Math.floor((1 + Math.random()) * 0x10000).toString(16).substring(1);\n\t }\n\t\n\t return s4() + s4() + \"-\" + s4() + \"-\" + s4() + \"-\" + s4() + \"-\" + (s4() + s4() + s4());\n\t }\n\t\n\t /**\n\t * Detects scrollbar width\n\t * @see http://stackoverflow.com/questions/986937/how-can-i-get-the-browsers-scrollbar-sizes\n\t * @returns {number}\n\t */\n\t\n\t }, {\n\t key: \"getScrollBarWidth\",\n\t value: function getScrollBarWidth() {\n\t var doc = global.document;\n\t var inner = doc.createElement('p');\n\t\n\t inner.style.width = \"100%\";\n\t inner.style.height = \"200px\";\n\t\n\t var outer = doc.createElement('div');\n\t outer.style.position = \"absolute\";\n\t outer.style.top = \"0px\";\n\t outer.style.left = \"0px\";\n\t outer.style.visibility = \"hidden\";\n\t outer.style.width = \"200px\";\n\t outer.style.height = \"150px\";\n\t outer.style.overflow = \"hidden\";\n\t outer.appendChild(inner);\n\t\n\t doc.body.appendChild(outer);\n\t var w1 = inner.offsetWidth;\n\t outer.style.overflow = 'scroll';\n\t var w2 = inner.offsetWidth;\n\t if (w1 === w2) {\n\t w2 = outer.clientWidth;\n\t }\n\t doc.body.removeChild(outer);\n\t\n\t return w1 - w2;\n\t }\n\t\n\t /**\n\t * Run an event once\n\t * @param {String} ev\n\t * @param {HTMLElement|HTMLDocument} target\n\t * @param {Function} func\n\t * @param {boolean} [capture]\n\t * @return Function created listener\n\t */\n\t\n\t }, {\n\t key: \"addEventOnce\",\n\t value: function addEventOnce(ev, target, func, capture) {\n\t var thisFunction = function thisFunction(event) {\n\t func(event, func);\n\t target.removeEventListener(ev, thisFunction, capture);\n\t };\n\t target.addEventListener(ev, thisFunction, capture);\n\t return thisFunction;\n\t }\n\t\n\t /**\n\t * Checks if an element is visible\n\t * @param {HTMLElement} element\n\t * @returns bool\n\t */\n\t\n\t }, {\n\t key: \"isVisible\",\n\t value: function isVisible(element) {\n\t return element.offsetWidth > 0 && element.offsetHeight > 0;\n\t }\n\t\n\t /**\n\t * Creates a camelCaseRepresentation of a dashed string\n\t * @param {String} str\n\t * @returns String\n\t */\n\t\n\t }, {\n\t key: \"dashToCamelCase\",\n\t value: function dashToCamelCase(str) {\n\t return str.replace(/-([a-z])/g, function (g) {\n\t return g[1].toUpperCase();\n\t });\n\t }\n\t\n\t /**\n\t * Creates a copy of `input`\n\t * @param {*} input\n\t * @return *\n\t */\n\t\n\t }, {\n\t key: \"copy\",\n\t value: function copy(input) {\n\t return JSON.parse(JSON.stringify(input));\n\t }\n\t\n\t /**\n\t * Reads options from element (data attributes) and applies to base\n\t * @param {HTMLElement} element\n\t * @param {Object} base\n\t * @return {Object}\n\t */\n\t\n\t }, {\n\t key: \"applyOptionsFromElement\",\n\t value: function applyOptionsFromElement(element, base) {\n\t if (!element) {\n\t return base;\n\t }\n\t var attrs = element.attributes;\n\t for (var i = 0; i < attrs.length; i++) {\n\t var attr = attrs[i];\n\t if (attr) {\n\t var s = Util.dashToCamelCase(attr.nodeName.replace('data-', ''));\n\t var val = attr.nodeValue;\n\t if (base.hasOwnProperty(s)) {\n\t // skip functions\n\t if (typeof base[s] === 'function') {\n\t continue;\n\t }\n\t if (typeof base[s] === 'boolean') {\n\t base[s] = parseInt(val || 1, 10) === 1;\n\t } else {\n\t base[s] = val;\n\t }\n\t }\n\t }\n\t }\n\t return base;\n\t }\n\t\n\t /**\n\t * Will position an element directly at given target\n\t * Is aware of a given collision container to detect edges\n\t * Will put elementToPosition either to left, center or right edge (prefer right)\n\t * and either to bottom or top (prefers bottom)\n\t *\n\t * You may overwrite preferred positioned with `centerHorizontal` and `positionTop`\n\t *\n\t * @param {HTMLElement|ClientRect} target the target container to align to\n\t * @param {HTMLElement} elementToPosition the element to position\n\t * @param {HTMLElement} collisionContainer the outer container to prevent collisions\n\t * @param {boolean} [centerHorizontal] set true to center element, otherwise it's put on the right border by default\n\t * @param {boolean} [positionTop] flip top, by default element is positioned to the bottom.\n\t * @returns {HTMLElement}\n\t */\n\t\n\t }, {\n\t key: \"setupPositionNearby\",\n\t value: function setupPositionNearby(target, elementToPosition, collisionContainer, centerHorizontal, positionTop) {\n\t // determine relative offsets\n\t var amountTop = 0;\n\t var amountLeft = 0;\n\t Util.parentsUntil(target.parentNode, function (el) {\n\t if (!(el instanceof HTMLElement)) {\n\t return false;\n\t }\n\t var style = window.getComputedStyle(el);\n\t if (Util.isPartOfNode(elementToPosition, el)) {\n\t if (style && style.position === 'relative') {\n\t amountTop += el.offsetTop || 0;\n\t amountLeft += el.offsetLeft || 0;\n\t }\n\t return false;\n\t }\n\t return true;\n\t });\n\t\n\t var targetPosition = target instanceof HTMLElement ? target.getBoundingClientRect() : target;\n\t var elementRect = elementToPosition.getBoundingClientRect();\n\t var colRect = collisionContainer.getBoundingClientRect();\n\t var targetTop = targetPosition.top - amountTop;\n\t var targetRight = targetPosition.right;\n\t var isCollisionTop = targetTop - elementRect.height <= 0;\n\t var isCollisionBottom = window.innerHeight < targetTop + amountTop + targetPosition.height + elementRect.height;\n\t var isCollisionLeft = targetRight < elementRect.width;\n\t var targetLeft = targetPosition.left;\n\t var isCollisionRight = targetLeft + elementRect.width > colRect.width;\n\t var classList = elementToPosition.classList;\n\t\n\t classList.remove(COL_RIGHT_CLASS);\n\t classList.remove(COL_LEFT_CLASS);\n\t classList.remove(COL_BOTTOM_CLASS);\n\t\n\t var calcTop = void 0;\n\t var calcLeft = void 0;\n\t if (isCollisionLeft && !isCollisionRight) {\n\t // put element to left if collision with left\n\t calcLeft = targetPosition.left - colRect.left - amountLeft + \"px\";\n\t classList.add(COL_LEFT_CLASS);\n\t } else {\n\t // maybe center if no collision with either side\n\t var rightPosition = targetRight - elementRect.width - colRect.left - amountLeft + \"px\";\n\t var leftCentered = (targetLeft + targetPosition.width / 2 - elementRect.width / 2 || 0) - colRect.left;\n\t var collisionCentered = leftCentered + elementRect.width > colRect.width;\n\t if (centerHorizontal && !collisionCentered) {\n\t calcLeft = leftCentered + \"px\";\n\t } else {\n\t classList.add(COL_RIGHT_CLASS);\n\t calcLeft = rightPosition;\n\t }\n\t }\n\t\n\t if (isCollisionBottom || positionTop && !isCollisionTop) {\n\t // Put Element on top if collision\n\t calcTop = targetTop - elementRect.height - colRect.top + \"px\";\n\t classList.add(COL_BOTTOM_CLASS);\n\t } else {\n\t calcTop = targetTop + targetPosition.height - colRect.top + \"px\";\n\t }\n\t\n\t elementToPosition.style.cssText = \"top:\" + calcTop + \";left:\" + calcLeft + \";\";\n\t\n\t return elementToPosition;\n\t }\n\t\n\t /**\n\t * Brings a given element into viewport\n\t * @param {HTMLElement} el\n\t * @param {int|function}[optionalOffset]\n\t */\n\t\n\t }, {\n\t key: \"scrollToElement\",\n\t value: function scrollToElement(el, optionalOffset) {\n\t el.scrollIntoView();\n\t var thisOffset = optionalOffset;\n\t // optionally use a additional scrollDif\n\t if (thisOffset) {\n\t if (typeof thisOffset === 'function') {\n\t thisOffset = optionalOffset();\n\t }\n\t if (thisOffset > 0) {\n\t var scrolledY = window.pageYOffset;\n\t if (scrolledY) {\n\t window.scroll(0, scrolledY - thisOffset);\n\t }\n\t }\n\t }\n\t }\n\t }]);\n\t\n\t return Util;\n\t}();\n\t\n\texports.default = Util;\n\t/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))\n\n/***/ },\n/* 2 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t/* WEBPACK VAR INJECTION */(function(global) {'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /*\n\t * The MIT License (MIT)\n\t *\n\t * Copyright (c) 2015 David Heidrich, BowlingX \n\t *\n\t * Permission is hereby granted, free of charge, to any person obtaining a copy\n\t * of this software and associated documentation files (the \"Software\"), to deal\n\t * in the Software without restriction, including without limitation the rights\n\t * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n\t * copies of the Software, and to permit persons to whom the Software is\n\t * furnished to do so, subject to the following conditions:\n\t *\n\t * The above copyright notice and this permission notice shall be included in\n\t * all copies or substantial portions of the Software.\n\t *\n\t * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n\t * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n\t * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n\t * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n\t * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n\t * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n\t * THE SOFTWARE.\n\t */\n\t\n\t\n\tvar _Util = __webpack_require__(1);\n\t\n\tvar _Util2 = _interopRequireDefault(_Util);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\t// we attach global settings to global once because settings might be shared a lot of times trough the application\n\t// Maybe find a better way to handle that scenario\n\tif (!global.FLEXCSS_GLOBAL_SETTINGS) {\n\t (function () {\n\t global.FLEXCSS_GLOBAL_SETTINGS = {\n\t // defined breakpoint for small devices < n\n\t smallBreakpoint: 768,\n\t // nodes that should be updated when no scrollbar is expected\n\t scrollbarUpdateNodes: global.document.body !== null ? [global.document.body] : [],\n\t // additional Delay until darkener is fully hidden\n\t darkenerFadeDelay: 100,\n\t // class that is added if canvas has been toggled\n\t canvasToggledClass: 'toggled-canvas'\n\t };\n\t\n\t global.FLEXCSS_CONST_IS_IOS = null;\n\t\n\t global.FLEXCSS_CONST_IS_TOUCH = null;\n\t\n\t global.FLEXCSS_CONST_IS_IE = null;\n\t\n\t global.FLEXCSS_CONST_TAB_EVENT = 'click';\n\t\n\t global.FLEXCSS_IS_SMALL_SCREEN = false;\n\t\n\t var init = function init() {\n\t // Measure scrollbar width\n\t global.FLEXCSS_CONST_SCROLLBAR_WIDTH = _Util2.default.getScrollBarWidth();\n\t // detect right transition end event\n\t global.FLEXCSS_CONST_TRANSITION_EVENT = _Util2.default.whichTransitionEndEvent();\n\t };\n\t\n\t if (global.document.readyState !== 'loading') {\n\t init();\n\t } else {\n\t // it's possible that global.document.body is not available if the document is not\n\t // loaded completely\n\t document.addEventListener('DOMContentLoaded', function () {\n\t init();\n\t });\n\t }\n\t })();\n\t}\n\t\n\t/**\n\t * Utility class that setups global settings\n\t */\n\t\n\tvar Settings = function () {\n\t function Settings() {\n\t _classCallCheck(this, Settings);\n\t }\n\t\n\t _createClass(Settings, null, [{\n\t key: 'setup',\n\t\n\t\n\t /**\n\t * Setup global settings, overwrite default values\n\t * @param {Object} settings\n\t */\n\t value: function setup(settings) {\n\t Object.assign(global.FLEXCSS_GLOBAL_SETTINGS, settings);\n\t }\n\t\n\t /**\n\t * Access to global settings\n\t * @returns {Object}\n\t */\n\t\n\t }, {\n\t key: 'get',\n\t value: function get() {\n\t return global.FLEXCSS_GLOBAL_SETTINGS;\n\t }\n\t\n\t /**\n\t * Detects a IOS Device, caches subsequent calls\n\t * @returns {boolean}\n\t */\n\t\n\t }, {\n\t key: 'isIosDevice',\n\t value: function isIosDevice() {\n\t if (!global.FLEXCSS_CONST_IS_IOS) {\n\t global.FLEXCSS_CONST_IS_IOS = global.navigator.userAgent.match(/(iPad|iPhone|iPod)/i);\n\t }\n\t\n\t return global.FLEXCSS_CONST_IS_IOS;\n\t }\n\t\n\t /**\n\t * @returns {boolean}\n\t */\n\t\n\t }, {\n\t key: 'isSmallScreen',\n\t value: function isSmallScreen() {\n\t return window.innerWidth < Settings.get().smallBreakpoint;\n\t }\n\t\n\t /**\n\t * Detects a touch device, caches subsequent calls\n\t * @returns {boolean}\n\t */\n\t\n\t }, {\n\t key: 'isTouchDevice',\n\t value: function isTouchDevice() {\n\t if (!global.FLEXCSS_CONST_IS_TOUCH) {\n\t global.FLEXCSS_CONST_IS_TOUCH = 'ontouchstart' in window || !!global.navigator.msMaxTouchPoints;\n\t }\n\t return global.FLEXCSS_CONST_IS_TOUCH;\n\t }\n\t\n\t /**\n\t * Checks if current browser is Internet Explorer\n\t * @returns {boolean|*}\n\t */\n\t\n\t }, {\n\t key: 'isIE',\n\t value: function isIE() {\n\t if (!global.FLEXCSS_CONST_IS_IE) {\n\t global.FLEXCSS_CONST_IS_IE = \"ActiveXObject\" in window;\n\t }\n\t return global.FLEXCSS_CONST_IS_IE;\n\t }\n\t\n\t /**\n\t * @returns {String}\n\t */\n\t\n\t }, {\n\t key: 'getTransitionEvent',\n\t value: function getTransitionEvent() {\n\t return global.FLEXCSS_CONST_TRANSITION_EVENT;\n\t }\n\t\n\t /**\n\t * @returns {int}\n\t */\n\t\n\t }, {\n\t key: 'getScrollbarWidth',\n\t value: function getScrollbarWidth() {\n\t return global.FLEXCSS_CONST_SCROLLBAR_WIDTH;\n\t }\n\t\n\t /**\n\t * @returns {String}\n\t */\n\t\n\t }, {\n\t key: 'getTabEvent',\n\t value: function getTabEvent() {\n\t return global.FLEXCSS_CONST_TAB_EVENT;\n\t }\n\t }]);\n\t\n\t return Settings;\n\t}();\n\t\n\texports.default = Settings;\n\t/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))\n\n/***/ },\n/* 3 */\n/***/ function(module, exports) {\n\n\t/* WEBPACK VAR INJECTION */(function(global) {\"use strict\";\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\t/* global CustomEvent */\n\t\n\t/*\n\t * The MIT License (MIT)\n\t *\n\t * Copyright (c) 2015 David Heidrich, BowlingX \n\t *\n\t * Permission is hereby granted, free of charge, to any person obtaining a copy\n\t * of this software and associated documentation files (the \"Software\"), to deal\n\t * in the Software without restriction, including without limitation the rights\n\t * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n\t * copies of the Software, and to permit persons to whom the Software is\n\t * furnished to do so, subject to the following conditions:\n\t *\n\t * The above copyright notice and this permission notice shall be included in\n\t * all copies or substantial portions of the Software.\n\t *\n\t * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n\t * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n\t * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n\t * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n\t * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n\t * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n\t * THE SOFTWARE.\n\t */\n\t\n\t// polyfill for custom events to make thinks work in IE\n\t// The needed polyfill is so small that I embedded it here\n\t(function poly() {\n\t if (!global.CustomEvent || typeof global.CustomEvent !== 'function') {\n\t var _CustomEvent = function CustomEvent(event, params) {\n\t var thisParams = params || {\n\t bubbles: false,\n\t cancelable: false,\n\t detail: undefined\n\t };\n\t var evt = document.createEvent(\"CustomEvent\");\n\t evt.initCustomEvent(event, thisParams.bubbles, thisParams.cancelable, thisParams.detail);\n\t return evt;\n\t };\n\t _CustomEvent.prototype = global.Event.prototype;\n\t global.CustomEvent = _CustomEvent;\n\t }\n\t})();\n\t/**\n\t * Simpler Event dispatching\n\t */\n\t\n\tvar EventHandler = function () {\n\t\n\t /**\n\t * @param {HTMLElement} target\n\t * @param {String} name\n\t */\n\t\n\t function EventHandler(target, name) {\n\t _classCallCheck(this, EventHandler);\n\t\n\t this.target = target;\n\t this.defaultOptions = {\n\t bubbles: true,\n\t cancelable: true\n\t };\n\t\n\t this.name = name;\n\t }\n\t\n\t /**\n\t * Set more options\n\t * @param {Object} options\n\t * @returns {EventHandler}\n\t */\n\t\n\t\n\t _createClass(EventHandler, [{\n\t key: \"withOptions\",\n\t value: function withOptions(options) {\n\t Object.assign(this.defaultOptions, options || {});\n\t return this;\n\t }\n\t\n\t /**\n\t * Call with the originalEvent\n\t * @param {Event} e\n\t * @returns {EventHandler}\n\t */\n\t\n\t }, {\n\t key: \"withOriginal\",\n\t value: function withOriginal(e) {\n\t return this.withDetail({\n\t originalEvent: e\n\t });\n\t }\n\t\n\t /**\n\t * Extends the detail part of the event\n\t * @param {Object} o\n\t * @returns {EventHandler}\n\t */\n\t\n\t }, {\n\t key: \"withDetail\",\n\t value: function withDetail(o) {\n\t if (!this.defaultOptions.detail) {\n\t this.defaultOptions.detail = {};\n\t }\n\t Object.assign(this.defaultOptions.detail, o);\n\t return this;\n\t }\n\t\n\t /**\n\t * @returns {CustomEvent}\n\t */\n\t\n\t }, {\n\t key: \"fire\",\n\t value: function fire() {\n\t var e = new CustomEvent(this.name, this.defaultOptions);\n\t if (this.target) {\n\t this.target.dispatchEvent(e);\n\t }\n\t return e;\n\t }\n\t }]);\n\t\n\t return EventHandler;\n\t}();\n\t\n\tvar Event = function () {\n\t function Event() {\n\t _classCallCheck(this, Event);\n\t }\n\t\n\t _createClass(Event, null, [{\n\t key: \"dispatch\",\n\t\n\t /**\n\t * Prepares to dispatch a custom event (without firing)\n\t * @param {HTMLElement} target\n\t * @param {String} name\n\t * @returns {EventHandler}\n\t */\n\t value: function dispatch(target, name) {\n\t return new EventHandler(target, name);\n\t }\n\t\n\t /**\n\t * Dispatches a custom event and fires it directly\n\t * @param {HTMLElement} target\n\t * @param {String} name\n\t * @param {Object} [options]\n\t * @returns {CustomEvent}\n\t */\n\t\n\t }, {\n\t key: \"dispatchAndFire\",\n\t value: function dispatchAndFire(target, name, options) {\n\t return new EventHandler(target, name).withOptions(options).fire();\n\t }\n\t }]);\n\t\n\t return Event;\n\t}();\n\t\n\texports.default = Event;\n\t/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))\n\n/***/ },\n/* 4 */,\n/* 5 */\n/***/ function(module, exports) {\n\n\t\"use strict\";\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\t/*\n\t * The MIT License (MIT)\n\t *\n\t * Copyright (c) 2015 David Heidrich, BowlingX \n\t *\n\t * Permission is hereby granted, free of charge, to any person obtaining a copy\n\t * of this software and associated documentation files (the \"Software\"), to deal\n\t * in the Software without restriction, including without limitation the rights\n\t * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n\t * copies of the Software, and to permit persons to whom the Software is\n\t * furnished to do so, subject to the following conditions:\n\t *\n\t * The above copyright notice and this permission notice shall be included in\n\t * all copies or substantial portions of the Software.\n\t *\n\t * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n\t * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n\t * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n\t * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n\t * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n\t * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n\t * THE SOFTWARE.\n\t */\n\t\n\t/**\n\t * Provides a Basic Widget\n\t */\n\t\n\tvar DestroyableWidget = function () {\n\t function DestroyableWidget() {\n\t _classCallCheck(this, DestroyableWidget);\n\t\n\t this.listeners = [];\n\t }\n\t\n\t /**\n\t * Destroys a Widget\n\t */\n\t\n\t\n\t _createClass(DestroyableWidget, [{\n\t key: \"destroy\",\n\t value: function destroy() {\n\t this.listeners.forEach(function (listener) {\n\t listener.element.removeEventListener.apply(listener.element, listener.args);\n\t });\n\t this.listeners = [];\n\t }\n\t\n\t /**\n\t * Adds an event and registers it later to remove bindings\n\t * @param {HTMLElement} element\n\t * @param {String} name\n\t * @param {Function} listener\n\t * @param {boolean} [capture]\n\t * @returns {Function}\n\t */\n\t\n\t }, {\n\t key: \"addEventListener\",\n\t value: function addEventListener(element, name, listener, capture) {\n\t this.listeners.push({\n\t element: element,\n\t args: [name, listener, capture]\n\t });\n\t\n\t element.addEventListener(name, listener, capture);\n\t return listener;\n\t }\n\t }]);\n\t\n\t return DestroyableWidget;\n\t}();\n\t\n\texports.default = DestroyableWidget;\n\n/***/ },\n/* 6 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t/* WEBPACK VAR INJECTION */(function(global) {'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\t\n\tvar _Util = __webpack_require__(1);\n\t\n\tvar _Util2 = _interopRequireDefault(_Util);\n\t\n\tvar _DestroyableWidget2 = __webpack_require__(5);\n\t\n\tvar _DestroyableWidget3 = _interopRequireDefault(_DestroyableWidget2);\n\t\n\tvar _Settings = __webpack_require__(2);\n\t\n\tvar _Settings2 = _interopRequireDefault(_Settings);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /*\n\t * The MIT License (MIT)\n\t *\n\t * Copyright (c) 2015 David Heidrich, BowlingX \n\t *\n\t * Permission is hereby granted, free of charge, to any person obtaining a copy\n\t * of this software and associated documentation files (the \"Software\"), to deal\n\t * in the Software without restriction, including without limitation the rights\n\t * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n\t * copies of the Software, and to permit persons to whom the Software is\n\t * furnished to do so, subject to the following conditions:\n\t *\n\t * The above copyright notice and this permission notice shall be included in\n\t * all copies or substantial portions of the Software.\n\t *\n\t * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n\t * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n\t * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n\t * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n\t * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n\t * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n\t * THE SOFTWARE.\n\t */\n\t\n\t/*!\n\t * FlexCss.Tooltip\n\t * Licensed under the MIT License (MIT)\n\t * Copyright (c) 2015 David Heidrich, BowlingX \n\t */\n\t\n\t/**\n\t * @type {string}\n\t */\n\tvar CLASS_NAMES_TOOLTIP = 'tooltip-container';\n\t/**\n\t * @type {string}\n\t */\n\tvar CLASS_NAMES_OPEN = 'open';\n\t\n\t/**\n\t * @type {string}\n\t */\n\tvar ATTR_DATA_CLASSNAME = 'data-class';\n\t\n\t/**\n\t * @type {string}\n\t */\n\tvar ATTR_DATA_NO_TOUCH = 'data-no-touch';\n\t\n\t/**\n\t * @type {HTMLDocument}\n\t */\n\tvar doc = global.document;\n\t\n\t/**\n\t * Simple Tooltip\n\t */\n\t\n\tvar Tooltip = function (_DestroyableWidget) {\n\t _inherits(Tooltip, _DestroyableWidget);\n\t\n\t /**\n\t * Creates a Tooltip\n\t * @param {HTMLElement|String} DelegateContainer\n\t * @param {Object} [options]\n\t */\n\t\n\t function Tooltip(DelegateContainer, options) {\n\t _classCallCheck(this, Tooltip);\n\t\n\t /**\n\t * The Container where possible events are captured\n\t */\n\t\n\t var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(Tooltip).call(this));\n\t\n\t _this.container = DelegateContainer instanceof HTMLElement ? DelegateContainer : doc.getElementById(DelegateContainer);\n\t\n\t if (!_this.container) {\n\t throw new Error('Could not create Tooltip, DelegateContainer not found');\n\t }\n\t\n\t /**\n\t * The Container where tooltips are stored for this instance\n\t * @type {HTMLElement}\n\t */\n\t _this.tooltipContainer = null;\n\t\n\t /**\n\t * Default Options\n\t */\n\t _this.options = {\n\t containerClass: '',\n\t selectorAttribute: 'data-tooltip',\n\t collisionContainer: _this.container\n\t };\n\t\n\t Object.assign(_this.options, options || {});\n\t return _this;\n\t }\n\t\n\t /**\n\t * Creates and shows a tooltip\n\t * @param {HTMLElement} target where is this tooltip positioned\n\t * @param {String} text text content in tooltip, will be NOT escaped\n\t * @param {Boolean} [removeTitle] removes title element if given\n\t * @param {Node} [positionRelative]\n\t */\n\t\n\t\n\t _createClass(Tooltip, [{\n\t key: 'createTooltip',\n\t value: function createTooltip(target, text, removeTitle, positionRelative) {\n\t // abort if text is empty\n\t if (!text || text && text.trim() === '') {\n\t return;\n\t }\n\t\n\t if (_Settings2.default.isTouchDevice() && target && target.hasAttribute(ATTR_DATA_NO_TOUCH)) {\n\t return;\n\t }\n\t\n\t var tooltipContainer = this.tooltipContainer;\n\t\n\t if (!tooltipContainer) {\n\t tooltipContainer = doc.createElement('div');\n\t this.container.appendChild(tooltipContainer);\n\t this.tooltipContainer = tooltipContainer;\n\t }\n\t this._restoreClassNames(tooltipContainer, target);\n\t\n\t tooltipContainer.style.left = 'auto';\n\t tooltipContainer.style.top = 'auto';\n\t tooltipContainer.innerHTML = text;\n\t tooltipContainer.flexTooltipCurrentTarget = target;\n\t if (removeTitle) {\n\t target.oldTitle = text;\n\t target.removeAttribute('title');\n\t }\n\t\n\t _Util2.default.setupPositionNearby(positionRelative || target, tooltipContainer, this.options.collisionContainer, true, true);\n\t\n\t tooltipContainer.classList.add(CLASS_NAMES_OPEN);\n\t }\n\t }, {\n\t key: '_restoreClassNames',\n\t value: function _restoreClassNames(container, target) {\n\t // allow additional classname per tooltip on target element\n\t var classNames = [CLASS_NAMES_TOOLTIP, this.options.containerClass];\n\t var maybeTargetClass = target.getAttribute(ATTR_DATA_CLASSNAME);\n\t if (maybeTargetClass) {\n\t classNames.push(maybeTargetClass);\n\t }\n\t container.className = classNames.join(\" \");\n\t return this;\n\t }\n\t\n\t /**\n\t * @returns {HTMLElement|null}\n\t */\n\t\n\t }, {\n\t key: 'getCurrentTarget',\n\t value: function getCurrentTarget() {\n\t return this.tooltipContainer ? this.tooltipContainer.flexTooltipCurrentTarget : null;\n\t }\n\t\n\t /**\n\t * Destroys this Widget\n\t * @returns {boolean}\n\t */\n\t\n\t }, {\n\t key: 'destroy',\n\t value: function destroy() {\n\t _get(Object.getPrototypeOf(Tooltip.prototype), 'destroy', this).call(this);\n\t\n\t if (this.tooltipContainer) {\n\t this.tooltipContainer.parentNode.removeChild(this.tooltipContainer);\n\t return true;\n\t }\n\t return false;\n\t }\n\t\n\t /**\n\t * Removes a Tooltip on given target\n\t * @param {HTMLElement} [target], if not given will remove current open tooltip on this instance\n\t */\n\t\n\t }, {\n\t key: 'removeTooltip',\n\t value: function removeTooltip(target) {\n\t var selfTarget = target;\n\t if (!selfTarget && this.tooltipContainer) {\n\t selfTarget = this.tooltipContainer.flexTooltipCurrentTarget;\n\t }\n\t if (this.tooltipContainer) {\n\t if (this.tooltipContainer.flexTooltipCurrentTarget !== selfTarget) {\n\t return;\n\t }\n\t this.tooltipContainer.classList.remove(CLASS_NAMES_OPEN);\n\t delete this.tooltipContainer.flexTooltipCurrentTarget;\n\t }\n\t if (selfTarget && selfTarget.oldTitle) {\n\t selfTarget.setAttribute('title', selfTarget.oldTitle);\n\t }\n\t }\n\t\n\t /**\n\t * Initilizes mouse events on container element\n\t */\n\t\n\t }, {\n\t key: 'registerEvents',\n\t value: function registerEvents() {\n\t var self = this;\n\t this.addEventListener(this.container, 'mouseover', function (e) {\n\t if (e.target.hasAttribute(self.options.selectorAttribute)) {\n\t self.createTooltip(e.target, e.target.getAttribute('title'), true);\n\t }\n\t });\n\t\n\t this.addEventListener(this.container, 'mouseout', function (e) {\n\t if (e.target.hasAttribute(self.options.selectorAttribute)) {\n\t self.removeTooltip(e.target);\n\t }\n\t });\n\t return this;\n\t }\n\t }]);\n\t\n\t return Tooltip;\n\t}(_DestroyableWidget3.default);\n\t\n\texports.default = Tooltip;\n\t/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))\n\n/***/ },\n/* 7 */,\n/* 8 */,\n/* 9 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t/* WEBPACK VAR INJECTION */(function(global) {'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports.EVENT_FORM_AJAX_COMPLETED = exports.EVENT_FORM_AFTER_AJAX_SUBMIT = exports.EVENT_FORM_SUBMIT = exports.EVENT_FORM_READY = undefined;\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\t\n\tvar _Tooltip = __webpack_require__(6);\n\t\n\tvar _Tooltip2 = _interopRequireDefault(_Tooltip);\n\t\n\t__webpack_require__(11);\n\t\n\tvar _Event = __webpack_require__(3);\n\t\n\tvar _Event2 = _interopRequireDefault(_Event);\n\t\n\tvar _Util = __webpack_require__(1);\n\t\n\tvar _Util2 = _interopRequireDefault(_Util);\n\t\n\tvar _Settings = __webpack_require__(2);\n\t\n\tvar _Settings2 = _interopRequireDefault(_Settings);\n\t\n\tvar _DestroyableWidget2 = __webpack_require__(5);\n\t\n\tvar _DestroyableWidget3 = _interopRequireDefault(_DestroyableWidget2);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /*global HTMLFormElement, fetch, FormData, clearTimeout, NodeList*/\n\t\n\t/*\n\t * The MIT License (MIT)\n\t *\n\t * Copyright (c) 2015 David Heidrich, BowlingX \n\t *\n\t * Permission is hereby granted, free of charge, to any person obtaining a copy\n\t * of this software and associated documentation files (the \"Software\"), to deal\n\t * in the Software without restriction, including without limitation the rights\n\t * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n\t * copies of the Software, and to permit persons to whom the Software is\n\t * furnished to do so, subject to the following conditions:\n\t *\n\t * The above copyright notice and this permission notice shall be included in\n\t * all copies or substantial portions of the Software.\n\t *\n\t * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n\t * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n\t * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n\t * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n\t * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n\t * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n\t * THE SOFTWARE.\n\t */\n\t\n\t/*!\n\t * FlexCss.Form\n\t * Licensed under the MIT License (MIT)\n\t * Copyright (c) 2015 David Heidrich, BowlingX \n\t */\n\t\n\tvar LOADING_CLASS = 'loading';\n\tvar DATA_ELEMENT_INVALID = 'data-flexcss-invalid';\n\tvar REMOTE = 'data-remote';\n\tvar REMOTE_ACTION = 'data-remote-action';\n\tvar ATTR_DISABLE_INLINE = 'data-disable-inline-validation';\n\tvar ATTR_DISABLE_REALTIME = 'data-disable-realtime-validation';\n\tvar ATTR_VALIDATOR = 'data-validate';\n\tvar ATTR_DATA_CUSTOM_MESSAGE = 'data-validation-message';\n\tvar ATTR_DATA_CUSTOM_LABEL = 'data-custom-label';\n\tvar ATTR_VALIDATE_VISIBILITY = 'data-validate-visibility';\n\tvar ATTR_ERROR_TARGET_ID = 'data-error-target';\n\tvar ATTR_DEPENDS = 'data-depends-selector';\n\tvar CONST_USE_JSON = 'json';\n\tvar CONST_REALTIME_EVENT = 'input';\n\tvar FOCUS_TOOLTIP_DELAY = 20;\n\tvar CLICK_TOOLTIP_DELAY = 150;\n\t\n\t/**\n\t * Triggered when form is fully initialized and handlers are binded\n\t * @type {string}\n\t */\n\tvar EVENT_FORM_READY = exports.EVENT_FORM_READY = 'flexcss.form.ready';\n\t/**\n\t * Fires when a form is submitted, cancelable\n\t * @type {string}\n\t */\n\tvar EVENT_FORM_SUBMIT = exports.EVENT_FORM_SUBMIT = 'flexcss.form.submit';\n\t/**\n\t * Fired directly after the form has been submitted via ajax\n\t * @type {string}\n\t */\n\tvar EVENT_FORM_AFTER_AJAX_SUBMIT = exports.EVENT_FORM_AFTER_AJAX_SUBMIT = 'flexcss.form.afterAjaxSubmit';\n\t/**\n\t * Fired when ajax events did complete\n\t * @type {string}\n\t */\n\tvar EVENT_FORM_AJAX_COMPLETED = exports.EVENT_FORM_AJAX_COMPLETED = 'flexcss.form.ajaxCompleted';\n\t\n\t/**\n\t * A HTML5 Form Validation replacement\n\t */\n\t\n\tvar Form = function (_DestroyableWidget) {\n\t _inherits(Form, _DestroyableWidget);\n\t\n\t /**\n\t * @param {HTMLElement} form\n\t * @param [options] optional options\n\t */\n\t\n\t function Form(form, options) {\n\t _classCallCheck(this, Form);\n\t\n\t var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(Form).call(this));\n\t\n\t if (!(form instanceof HTMLFormElement)) {\n\t throw 'argument {0} form needs to be an form element';\n\t }\n\t\n\t /**\n\t * The Form\n\t * @type {HTMLElement}\n\t */\n\t _this.form = form;\n\t\n\t /**\n\t * @type {Tooltip}\n\t */\n\t _this.tooltips = null;\n\t\n\t /**\n\t * @type {Promise}\n\t */\n\t _this.currentValidationFuture = new Promise(function () {});\n\t\n\t /**\n\t * Default options\n\t * @type {Object}\n\t */\n\t _this.options = {\n\t // if true creates tooltips above element, uses FlexCss Tooltips\n\t createTooltips: true,\n\t // if true appends error message after input element\n\t appendError: false,\n\t // type of ajax submit\n\t ajaxSubmitType: 'POST',\n\t // json content type if ajax method is set to json\n\t ajaxJsonContentType: 'application/json; charset=utf-8',\n\t // allow inline validation\n\t inlineValidation: true,\n\t // validate in realtime (on `input` event)\n\t realtime: true,\n\t // timeout when realtime event should be captured\n\t realtimeTimeout: 250,\n\t // formatting method for an error\n\t formatErrorTooltip: function formatErrorTooltip(error) {\n\t return ' ' + error;\n\t },\n\t // the class that will be put on the element to mark it failed validation\n\t inputErrorClass: 'invalid',\n\t // the container class for error messages below an element\n\t containerErrorClass: 'form-error',\n\t // additional options for fetch\n\t fetchOptions: {\n\t credentials: 'include'\n\t },\n\t // the container for tooltips\n\t tooltipContainer: form,\n\t tooltipOptions: {\n\t containerClass: 'error-tooltip'\n\t },\n\t // if you have a fixed header, either set a number or function here\n\t scrollToElementDiff: 0\n\t };\n\t\n\t // overwrite default options\n\t Object.assign(_this.options, options);\n\t\n\t // apply settings from attributes\n\t _Util2.default.applyOptionsFromElement(form, _this.options);\n\t\n\t // set form class as widget\n\t // Forms are very different to classical widgets,\n\t // we will not use our base widget class for this but just self\n\t form.hfWidgetInstance = _this;\n\t\n\t /**\n\t * A List of Validators\n\t * @type {Object}\n\t * @private\n\t */\n\t _this._validators = Form.globalValidators;\n\t\n\t /**\n\t * @type {Function}\n\t * @private\n\t */\n\t _this._remoteValidationFunction = null;\n\t\n\t _this.initFormValidation();\n\t return _this;\n\t }\n\t\n\t _createClass(Form, [{\n\t key: 'destroy',\n\t value: function destroy() {\n\t _get(Object.getPrototypeOf(Form.prototype), 'destroy', this).call(this);\n\t if (this.tooltips) {\n\t this.tooltips.destroy();\n\t }\n\t }\n\t\n\t /**\n\t * Submits this form, either via ajax or just classical (default)\n\t * @param {HTMLFormElement} thisForm\n\t * @param {Event} e\n\t * @private\n\t * @returns {Promise|boolean} returns false if submit is cancled\n\t */\n\t\n\t }, {\n\t key: '_submitFunction',\n\t value: function _submitFunction(thisForm, e) {\n\t var shouldUseAjax = thisForm.getAttribute(REMOTE),\n\t ajaxPostUrl = thisForm.getAttribute(REMOTE_ACTION) || thisForm.getAttribute('action') || window.location.href,\n\t useJson = CONST_USE_JSON === shouldUseAjax,\n\t self = this;\n\t\n\t var ev = _Event2.default.dispatch(thisForm, EVENT_FORM_SUBMIT).withOriginal(e).fire();\n\t\n\t // abort execution is event was prevented\n\t if (ev.defaultPrevented) {\n\t self._formStopLoading();\n\t return false;\n\t }\n\t\n\t if (shouldUseAjax === null) {\n\t // submit\n\t return thisForm.submit();\n\t }\n\t // prevent form from submit normally\n\t e.preventDefault();\n\t\n\t // add information that this is an XMLHttpRequest request (used by some frameworks)\n\t var defaultHeaders = {\n\t 'X-Requested-With': 'XMLHttpRequest'\n\t };\n\t\n\t // setup default headers\n\t if (useJson) {\n\t Object.assign(defaultHeaders, {\n\t 'Content-Type': this.options.ajaxJsonContentType\n\t });\n\t }\n\t var defaultOptions = Object.assign(this.options.fetchOptions, {\n\t headers: defaultHeaders,\n\t method: this.options.ajaxSubmitType\n\t });\n\t\n\t // support either JSON request payload or normal payload submission\n\t var serverCall = useJson ? fetch(ajaxPostUrl, Object.assign(defaultOptions, {\n\t body: JSON.stringify(this.serialize())\n\t })) : fetch(ajaxPostUrl, Object.assign(defaultOptions, {\n\t body: new FormData(thisForm)\n\t }));\n\t\n\t _Event2.default.dispatch(thisForm, EVENT_FORM_AFTER_AJAX_SUBMIT).withOriginal(e).fire();\n\t\n\t return serverCall.then(function (r) {\n\t (self._remoteValidationFunction || Form.globalRemoteValidationFunction).apply(self, [r]);\n\t\n\t _Event2.default.dispatch(thisForm, EVENT_FORM_AJAX_COMPLETED).withOriginal(e).withDetail({ response: r }).fire();\n\t // always remove error class\n\t self._formStopLoading();\n\t });\n\t }\n\t\n\t /**\n\t * Serializes a form to a json object\n\t * @returns {Object}\n\t */\n\t\n\t }, {\n\t key: 'serialize',\n\t value: function serialize() {\n\t var selectors = ['input[name]:not([type=\"radio\"]):enabled', 'input[type=\"radio\"][name]:checked', 'select[name]:enabled', 'textarea[name]:enabled'],\n\t inputs = this.form.querySelectorAll(selectors.join(',')),\n\t result = {};\n\t\n\t Array.prototype.forEach.call(inputs, function (input) {\n\t var exists = result[input.name],\n\t value = input.value;\n\t if (exists instanceof Array) {\n\t exists.push(value);\n\t } else if (exists) {\n\t result[input.name] = [result[input.name], value];\n\t } else {\n\t result[input.name] = value;\n\t }\n\t });\n\t\n\t return result;\n\t }\n\t\n\t /**\n\t * Handles the chain of validation on given fields\n\t *\n\t * @param {HTMLElement|Array|NodeList} field\n\t * @param [focus] optional focus first error\n\t * @returns {Promise}\n\t */\n\t\n\t }, {\n\t key: 'handleValidation',\n\t value: function handleValidation(field, focus) {\n\t var _this2 = this;\n\t\n\t var fields = field instanceof Array || field instanceof NodeList ? field : [field];\n\t return this._handleValidation(fields, focus, true).then(function (r) {\n\t if (!r.foundAnyError) {\n\t // remove tooltips\n\t if (_this2.tooltips) {\n\t _this2.tooltips.removeTooltip();\n\t }\n\t }\n\t return r;\n\t }.bind(this));\n\t }\n\t\n\t /**\n\t * Handles errors on given node list\n\t * @param {NodeList} toValidateFields\n\t * @param {boolean} focus\n\t * @param {boolean} scoped if true, will only validate the fields `invalidFields`\n\t * @returns {Promise}\n\t * @private\n\t */\n\t\n\t }, {\n\t key: '_handleValidation',\n\t value: function _handleValidation(toValidateFields, focus, scoped) {\n\t var self = this;\n\t var arr = Form._createArrayFromInvalidFieldList(toValidateFields),\n\t isLocalInvalid = arr.length > 0;\n\t // focus must appear in the same frame for iOS devices\n\t if (isLocalInvalid && focus) {\n\t self._focusElement(arr[0]);\n\t }\n\t var validation = scoped ? this._customValidationsForElements(toValidateFields) : self.validateCustomFields();\n\t return validation.then(function (r) {\n\t if (isLocalInvalid) {\n\t // combine browser and custom validators\n\t r.foundAnyError = true;\n\t }\n\t // get a unique field list of all fields that need to be checked and rendered\n\t // it's possible that we have duplicates in non scoped mode\n\t var thisToValidateFields = scoped ? toValidateFields : Array.from(arr).concat(r.checkedFields);\n\t r.checkedFields = thisToValidateFields;\n\t var foundInvalidFields = self.prepareErrors(thisToValidateFields, false),\n\t firstInvalidField = foundInvalidFields[0];\n\t if (firstInvalidField) {\n\t if (focus) {\n\t self._focusElement(firstInvalidField);\n\t // if element could not be focused:\n\t if (document.activeElement !== firstInvalidField) {\n\t self._handleTooltipHideClickAfterChange();\n\t }\n\t } else {\n\t self._handleTooltipHideClickAfterChange();\n\t }\n\t self.showAndOrCreateTooltip(firstInvalidField);\n\t }\n\t return r;\n\t });\n\t }\n\t\n\t /**\n\t * @param {HTMLElement} field\n\t * @param {ValidityState} validity\n\t * @returns {*}\n\t * @private\n\t */\n\t\n\t }, {\n\t key: '_setupErrorMessages',\n\t value: function _setupErrorMessages(field, validity) {\n\t return Form.globalErrorMessageHandler ? Form.globalErrorMessageHandler.apply(this, [field, validity]) : false;\n\t }\n\t\n\t /**\n\t * Handles class labels for elements\n\t * @param {Object} fields\n\t * @private\n\t */\n\t\n\t }, {\n\t key: '_handleLabels',\n\t value: function _handleLabels(fields) {\n\t Object.keys(fields).forEach(function (id) {\n\t var labels = this.getForm().querySelectorAll('[for=\"' + id + '\"]'),\n\t invalid = fields[id];\n\t if (labels.length) {\n\t for (var labelsIndex = 0; labelsIndex < labels.length; labelsIndex++) {\n\t var labelEl = labels[labelsIndex];\n\t // we can't use toggle attribute, not supported in IE\n\t if (invalid) {\n\t this._markElementInvalid(labelEl);\n\t } else {\n\t this._markElementValid(labelEl);\n\t }\n\t }\n\t }\n\t }.bind(this));\n\t }\n\t\n\t /**\n\t * @param el\n\t * @private\n\t */\n\t\n\t }, {\n\t key: '_markElementInvalid',\n\t value: function _markElementInvalid(el) {\n\t el.setAttribute(DATA_ELEMENT_INVALID, \"true\");\n\t el.classList.add(this.options.inputErrorClass);\n\t }\n\t\n\t /**\n\t * @param el\n\t * @private\n\t */\n\t\n\t }, {\n\t key: '_markElementValid',\n\t value: function _markElementValid(el) {\n\t el.removeAttribute(DATA_ELEMENT_INVALID);\n\t el.classList.remove(this.options.inputErrorClass);\n\t }\n\t\n\t /**\n\t * A List of invalid elements (:invalid)\n\t * @returns {Array}\n\t * @private\n\t */\n\t\n\t }, {\n\t key: '_getInvalidElements',\n\t value: function _getInvalidElements() {\n\t return Array.prototype.filter.call(this.getForm().querySelectorAll(\":invalid\"), function (r) {\n\t return !(r instanceof HTMLFieldSetElement);\n\t });\n\t }\n\t\n\t /**\n\t * @param {HTMLElement} thisParent\n\t * @private\n\t */\n\t\n\t }, {\n\t key: '_removeElementErrors',\n\t value: function _removeElementErrors(thisParent) {\n\t var errors = thisParent.querySelectorAll('.' + this.options.containerErrorClass),\n\t inputsWithErrorClasses = thisParent.querySelectorAll('[' + DATA_ELEMENT_INVALID + ']');\n\t for (var elementErrorIndex = 0; elementErrorIndex < errors.length; elementErrorIndex++) {\n\t errors[elementErrorIndex].parentNode.removeChild(errors[elementErrorIndex]);\n\t }\n\t for (var inputErrorIndex = 0; inputErrorIndex < inputsWithErrorClasses.length; inputErrorIndex++) {\n\t var el = inputsWithErrorClasses[inputErrorIndex];\n\t this._markElementValid(el);\n\t }\n\t }\n\t\n\t /**\n\t * Registers a custom validator\n\t * @param {String} name\n\t * @param {Function} validator a validation function should always return either a Future(true) or Future(false)\n\t * even when the field has been invalidated with `setCustomValidity`, because of different browser `bugs`\n\t * we can't rely on that\n\t * @returns {Form}\n\t */\n\t\n\t }, {\n\t key: 'registerValidator',\n\t value: function registerValidator(name, validator) {\n\t this._validators[name] = validator;\n\t return this;\n\t }\n\t\n\t /**\n\t * Runs async validation\n\t * @param {String} validationRef\n\t * @param {HTMLElement} field\n\t * @returns {Promise}\n\t * @private\n\t */\n\t\n\t }, {\n\t key: '_runValidation',\n\t value: function _runValidation(validationRef, field) {\n\t if (!this._validators[validationRef]) {\n\t throw 'Could not found validator: ' + validationRef;\n\t }\n\t var cl = field.classList,\n\t future = this._validators[validationRef].apply(this, [field, this.form]);\n\t cl.add(LOADING_CLASS);\n\t future.then(function () {\n\t cl.remove(LOADING_CLASS);\n\t });\n\t return future;\n\t }\n\t\n\t /**\n\t * Run custom validations for elements, validations are done async do support XHR Requests or other stuff\n\t *\n\t * @param {Array|NodeList} fields\n\t * @returns {Promise} contains either true if validations passed or false if something went wrong\n\t * @private\n\t */\n\t\n\t }, {\n\t key: '_customValidationsForElements',\n\t value: function _customValidationsForElements(fields) {\n\t var futures = [],\n\t fieldsLength = fields.length,\n\t checkedFields = [];\n\t for (var iVal = 0; iVal < fieldsLength; iVal++) {\n\t var field = fields[iVal],\n\t validationRef = field.getAttribute(ATTR_VALIDATOR),\n\t validity = field.validity;\n\t if (this._validators[validationRef]) {\n\t // use local validation first and then continue with custom validations\n\t if (Form._shouldNotValidateField(field) || validity && !validity.customError && !validity.valid) {\n\t continue;\n\t }\n\t checkedFields.push(field);\n\t futures.push(this._runValidation(validationRef, field));\n\t } else {\n\t if (validationRef) {\n\t console.warn('data-validate was set but no validator was found');\n\t }\n\t }\n\t }\n\t return Promise.all(futures).then(function (allFutures) {\n\t var l = allFutures.length;\n\t var result = {\n\t checkedFields: checkedFields,\n\t foundAnyError: false\n\t };\n\t for (var fI = 0; fI < l; fI++) {\n\t if (!allFutures[fI]) {\n\t result.foundAnyError = true;\n\t break;\n\t }\n\t }\n\t return result;\n\t });\n\t }\n\t\n\t /**\n\t * Remove all errors for this form\n\t * @returns {Form}\n\t */\n\t\n\t }, {\n\t key: 'removeErrors',\n\t value: function removeErrors() {\n\t this._removeElementErrors(this.form);\n\t if (this.tooltips) {\n\t this.tooltips.removeTooltip();\n\t }\n\t return this;\n\t }\n\t\n\t /**\n\t * Will handle errors for given fields\n\t * @param {Array|NodeList} fields\n\t * @param {Boolean} removeAllErrors\n\t */\n\t\n\t }, {\n\t key: 'prepareErrors',\n\t value: function prepareErrors(fields, removeAllErrors) {\n\t if (removeAllErrors) {\n\t this.removeErrors();\n\t }\n\t var labelGroups = {},\n\t invalidFields = [];\n\t\n\t function handleAdditionalLabels(isInvalid, thisLabelGroup, field) {\n\t var additionalLabels = field.getAttribute(ATTR_DATA_CUSTOM_LABEL) || field.id,\n\t group = thisLabelGroup[additionalLabels];\n\t if (additionalLabels) {\n\t // check additionally if field is currently marked as invalid\n\t // so the label is not marked as error if no field is marked as one\n\t group = group ? group : isInvalid;\n\t thisLabelGroup[additionalLabels] = group;\n\t }\n\t }\n\t\n\t // We save all validations in an extra property because we need to reset the validity due some\n\t // implementation errors in other browsers then chrome\n\t for (var i = 0; i < fields.length; i++) {\n\t var field = fields[i],\n\t errorTarget = Form._findErrorTarget(field),\n\t parent = errorTarget.parentNode,\n\t validity = field.validity,\n\t isInvalid = validity && !validity.valid;\n\t if (Form._shouldNotValidateField(field)) {\n\t continue;\n\t }\n\t field.flexFormsSavedValidity = JSON.parse(JSON.stringify(validity));\n\t handleAdditionalLabels(isInvalid, labelGroups, field);\n\t if (isInvalid) {\n\t if (!removeAllErrors) {\n\t // Remove current errors:\n\t this._removeElementErrors(parent);\n\t }\n\t // setup custom error messages:\n\t this._setupErrorMessages(field, validity);\n\t var msg = field.validationMessage;\n\t\n\t // mark fields as invalid\n\t this._markElementInvalid(errorTarget);\n\t this._markElementInvalid(field);\n\t\n\t if (this.options.appendError) {\n\t parent.insertAdjacentHTML(\"beforeend\", '
' + msg + '
');\n\t }\n\t invalidFields.push(field);\n\t field.flexFormsSavedValidationMessage = msg;\n\t } else {\n\t // restore invalid fields\n\t this._markElementValid(errorTarget);\n\t this._markElementValid(field);\n\t\n\t // cleanup\n\t delete field.flexFormsSavedValidationMessage;\n\t\n\t // remove error markup\n\t this._removeElementErrors(parent);\n\t }\n\t // We have to reset the custom validity here to allow native validations work again\n\t field.setCustomValidity('');\n\t }\n\t // if validates a single field we need to check the linked fields to a label:\n\t if (fields.length === 1) {\n\t var _field = fields[0];\n\t var id = _field.getAttribute(ATTR_DATA_CUSTOM_LABEL) || _field.id;\n\t if (id) {\n\t var linkedFields = Array.from(this.getForm().querySelectorAll('[' + ATTR_DATA_CUSTOM_LABEL + '=\"' + id + '\"], #' + id));\n\t linkedFields.forEach(function (thisField) {\n\t var validity = thisField.validity,\n\t isInvalid = validity && !validity.valid && this._isElementInvalidElement(thisField);\n\t handleAdditionalLabels(isInvalid, labelGroups, thisField);\n\t }.bind(this));\n\t }\n\t }\n\t this._handleLabels(labelGroups);\n\t return invalidFields;\n\t }\n\t\n\t /**\n\t * Validates all custom fields\n\t * @returns {Promise}\n\t */\n\t\n\t }, {\n\t key: 'validateCustomFields',\n\t value: function validateCustomFields() {\n\t return this._customValidationsForElements(this.form.querySelectorAll(\"[data-validate]\"));\n\t }\n\t\n\t /**\n\t * Tests if a field should be validated\n\t * @param {HTMLElement} field\n\t * @returns {boolean}\n\t * @private\n\t */\n\t\n\t }, {\n\t key: 'getForm',\n\t\n\t\n\t /**\n\t * This form\n\t * @returns {HTMLElement}\n\t */\n\t value: function getForm() {\n\t return this.form;\n\t }\n\t\n\t /**\n\t * Registers a function that handles remote validation\n\t * @param {Function} func\n\t * @returns {Form}\n\t */\n\t\n\t }, {\n\t key: 'registerRemoteValidation',\n\t value: function registerRemoteValidation(func) {\n\t this._remoteValidationFunction = func;\n\t return this;\n\t }\n\t\n\t /**\n\t * Formats the error content for the tooltip\n\t * @param {String} error\n\t * @returns {String}\n\t * @private\n\t */\n\t\n\t }, {\n\t key: '_formatErrorTooltip',\n\t value: function _formatErrorTooltip(error) {\n\t return this.options.formatErrorTooltip.apply(this, [error]);\n\t }\n\t\n\t /**\n\t * Tries to find a custom error target on given target\n\t * @param target\n\t * @returns {HTMLElement}\n\t * @private\n\t */\n\t\n\t }, {\n\t key: 'showAndOrCreateTooltip',\n\t\n\t\n\t /**\n\t * Creates a tooltip at given element, will only create a new instance if not created\n\t * @param {HTMLElement} target\n\t * @param {Boolean} [remove]\n\t */\n\t value: function showAndOrCreateTooltip(target, remove) {\n\t var self = this;\n\t if (!this.tooltips && this.options.createTooltips) {\n\t this.tooltips = new _Tooltip2.default(this.options.tooltipContainer, this.options.tooltipOptions);\n\t }\n\t if (!this.options.createTooltips) {\n\t return false;\n\t }\n\t\n\t if (!target.flexFormsSavedValidity) {\n\t return false;\n\t }\n\t var errorTarget = Form._findErrorTarget(target);\n\t if (!target.flexFormsSavedValidity.valid && self._isElementInvalidElement(errorTarget)) {\n\t self.tooltips.createTooltip(errorTarget, self._formatErrorTooltip(target.flexFormsSavedValidationMessage), false);\n\t return true;\n\t } else {\n\t if (remove) {\n\t self.tooltips.removeTooltip();\n\t }\n\t }\n\t return false;\n\t }\n\t\n\t /**\n\t * Checks if element is marked as invalid\n\t * @param {HTMLElement} el\n\t * @returns {boolean}\n\t * @private\n\t */\n\t\n\t }, {\n\t key: '_isElementInvalidElement',\n\t value: function _isElementInvalidElement(el) {\n\t return el.hasAttribute(DATA_ELEMENT_INVALID);\n\t }\n\t\n\t /**\n\t * Handles invalid event of a form\n\t * @param {Event} e\n\t * @returns {Promise|boolean}\n\t * @private\n\t */\n\t\n\t }, {\n\t key: '_checkIsInvalid',\n\t value: function _checkIsInvalid(e) {\n\t e.preventDefault();\n\t var invalidFields = this.getForm().querySelectorAll(\":invalid\");\n\t return this._handleValidation(invalidFields, true, false);\n\t }\n\t\n\t /**\n\t * Will query dependent fields (by selector) that should be validated with given field\n\t * @param field\n\t * @returns {NodeList|[]}\n\t * @private\n\t */\n\t\n\t }, {\n\t key: '_getDependentFields',\n\t value: function _getDependentFields(field) {\n\t var fieldSelector = field.getAttribute(ATTR_DEPENDS),\n\t base = [field];\n\t if (fieldSelector) {\n\t base.push.apply(base, Array.prototype.slice.apply(this.getForm().querySelectorAll(fieldSelector)));\n\t }\n\t return base;\n\t }\n\t\n\t /**\n\t * @private\n\t * @param {HTMLElement} [target]\n\t */\n\t\n\t }, {\n\t key: '_handleTooltipInline',\n\t value: function _handleTooltipInline(target) {\n\t if (this.tooltips) {\n\t this.tooltips.removeTooltip(target);\n\t }\n\t }\n\t\n\t /**\n\t * Initializes validation for a given form, registers event handlers\n\t */\n\t\n\t }, {\n\t key: 'initFormValidation',\n\t value: function initFormValidation() {\n\t var _this3 = this;\n\t\n\t // Suppress the default bubbles\n\t var form = this.getForm(),\n\t self = this,\n\t invalidEvent = 'invalid';\n\t\n\t /**\n\t * Validates if is valid realtime element\n\t * @param {HTMLElement} target\n\t * @returns {boolean}\n\t * @private\n\t */\n\t function _checkIsValidRealtimeElement(target) {\n\t return !target.hasAttribute(ATTR_DISABLE_REALTIME) && !target.hasAttribute(ATTR_DISABLE_INLINE);\n\t }\n\t\n\t form.addEventListener(invalidEvent, function (e) {\n\t e.preventDefault();\n\t }, true);\n\t\n\t _Util2.default.addEventOnce(invalidEvent, form, function handleInvalid(e) {\n\t self._formLoading();\n\t var result = self._checkIsInvalid(e);\n\t if (result) {\n\t self.currentValidationFuture = new Promise(function (resolve) {\n\t result.then(function (r) {\n\t setTimeout(function () {\n\t _Util2.default.addEventOnce(invalidEvent, form, handleInvalid, true);\n\t }, 0);\n\t resolve(r);\n\t self._formStopLoading();\n\t if (!r.foundAnyError) {\n\t self._formLoading();\n\t self._handleSubmit(e);\n\t }\n\t });\n\t });\n\t }\n\t }, true);\n\t\n\t this.addEventListener(form, 'reset', function () {\n\t _this3.removeErrors();\n\t });\n\t\n\t // Timeout for keys:\n\t var TIMEOUT_KEYDOWN,\n\t KEYDOWN_RUNNING = false;\n\t\n\t // resets keydown events\n\t function clearKeyDownTimeout() {\n\t KEYDOWN_RUNNING = false;\n\t clearTimeout(TIMEOUT_KEYDOWN);\n\t }\n\t\n\t // setup custom realtime event if given\n\t if (self.options.realtime) {\n\t this.addEventListener(form, CONST_REALTIME_EVENT, function (e) {\n\t if (self._formIsLoading()) {\n\t return;\n\t }\n\t var target = e.target;\n\t clearTimeout(TIMEOUT_KEYDOWN);\n\t if (KEYDOWN_RUNNING) {\n\t return;\n\t }\n\t TIMEOUT_KEYDOWN = setTimeout(function () {\n\t var isStillTarget = document.activeElement === e.target;\n\t if (!_checkIsValidRealtimeElement(target)) {\n\t return;\n\t }\n\t if (isStillTarget) {\n\t self._handleTooltipInline();\n\t }\n\t KEYDOWN_RUNNING = true;\n\t var dependentFields = self._getDependentFields(target);\n\t self._customValidationsForElements(dependentFields).then(function () {\n\t self.prepareErrors(dependentFields, false);\n\t if (isStillTarget) {\n\t self.showAndOrCreateTooltip(e.target);\n\t }\n\t // future must be resolved before another event can be started\n\t KEYDOWN_RUNNING = false;\n\t });\n\t }, self.options.realtimeTimeout);\n\t }, true);\n\t }\n\t\n\t /**\n\t * Validates if target is a valid input field to check blur and focus events\n\t *\n\t * @param {HTMLElement} target\n\t * @returns {boolean}\n\t * @private\n\t */\n\t function _checkIsValidBlurFocusElement(target) {\n\t var attr = target.getAttribute(\"type\");\n\t return attr !== \"radio\" && attr !== \"checkbox\" && attr !== \"submit\";\n\t }\n\t\n\t /**\n\t * Validates if is valid inline-check element\n\t * @param {HTMLElement} target\n\t * @returns {boolean}\n\t * @private\n\t */\n\t function _checkIsValidInlineCheckElement(target) {\n\t return !target.hasAttribute(ATTR_DISABLE_INLINE);\n\t }\n\t\n\t this.addEventListener(form, 'blur', function (e) {\n\t // do not hide tooltip after change event\n\t if (!e.target.flexcssKeepTooltips) {\n\t self._handleTooltipInline(e.target);\n\t }\n\t delete e.target.flexcssKeepTooltips;\n\t }, true);\n\t\n\t // handle focus on input elements\n\t // will show an error if field is invalid\n\t this.addEventListener(form, \"focus\", function (e) {\n\t if (self._formIsLoading()) {\n\t return;\n\t }\n\t // do not track errors for checkbox and radios on focus:\n\t if (!_checkIsValidBlurFocusElement(e.target)) {\n\t return;\n\t }\n\t // we need to delay this a little, because Firefox and Safari do not show a tooltip after it\n\t // just have been hidden (on blur). Maybe fix this with a queue later\n\t setTimeout(function () {\n\t self.showAndOrCreateTooltip(e.target);\n\t }, FOCUS_TOOLTIP_DELAY);\n\t }, true);\n\t\n\t if (self.options.inlineValidation) {\n\t // Handle change for checkbox, radios and selects\n\t this.addEventListener(form, \"change\", function (e) {\n\t var target = e.target;\n\t if (self._formIsLoading() || !_checkIsValidInlineCheckElement(target)) {\n\t return;\n\t }\n\t clearKeyDownTimeout();\n\t var name = target.getAttribute('name');\n\t var inputs = name ? form.querySelectorAll('[name=\"' + name + '\"]') : [target];\n\t // we only support dependent fields for a single widgets right now\n\t if (inputs.length === 1) {\n\t inputs = self._getDependentFields(target);\n\t }\n\t self._customValidationsForElements(inputs).then(function () {\n\t self.prepareErrors(inputs, false);\n\t target.flexcssKeepTooltips = self.showAndOrCreateTooltip(target, true);\n\t if (target.flexcssKeepTooltips) {\n\t self._handleTooltipHideClickAfterChange();\n\t }\n\t });\n\t });\n\t }\n\t\n\t // prevent default if form is invalid\n\t this.addEventListener(form, \"submit\", function listener(e) {\n\t self._submitListener(e, listener);\n\t });\n\t\n\t _Event2.default.dispatchAndFire(form, EVENT_FORM_READY);\n\t }\n\t\n\t /* Loading states, unfortunately we can't check if a promise is pending :/*/\n\t /* TODO: Maybe wrap promise to extend this functionality */\n\t\n\t }, {\n\t key: '_formLoading',\n\t value: function _formLoading() {\n\t this.getForm().classList.add(LOADING_CLASS);\n\t }\n\t }, {\n\t key: '_formStopLoading',\n\t value: function _formStopLoading() {\n\t this.getForm().classList.remove(LOADING_CLASS);\n\t }\n\t }, {\n\t key: '_formIsLoading',\n\t value: function _formIsLoading() {\n\t return this.getForm().classList.contains(LOADING_CLASS);\n\t }\n\t\n\t // this defines the logic after a change event when a tooltip is shown\n\t // because we call this method inside the change event, the click would be immeditally executed with the change\n\t // event when not using setTimeout(). There might be another solution for this...\n\t\n\t }, {\n\t key: '_handleTooltipHideClickAfterChange',\n\t value: function _handleTooltipHideClickAfterChange() {\n\t var self = this;\n\t if (this.options.createTooltips) {\n\t setTimeout(function () {\n\t _Util2.default.addEventOnce(_Settings2.default.getTabEvent(), global.document.body, function (t) {\n\t if (!self._isElementInvalidElement(t.target)) {\n\t self._handleTooltipInline();\n\t }\n\t });\n\t }, CLICK_TOOLTIP_DELAY);\n\t }\n\t }\n\t }, {\n\t key: '_focusElement',\n\t value: function _focusElement(el) {\n\t el.focus();\n\t _Util2.default.scrollToElement(el, this.options.scrollToElementDiff);\n\t }\n\t\n\t /**\n\t * Listener that is executed on form submit\n\t * @param e\n\t * @param submitListener\n\t * @returns {boolean}\n\t * @private\n\t */\n\t\n\t }, {\n\t key: '_submitListener',\n\t value: function _submitListener(e, submitListener) {\n\t\n\t var form = this.getForm(),\n\t self = this,\n\t submitEvent = 'submit';\n\t\n\t if (this._formIsLoading()) {\n\t e.preventDefault();\n\t return false;\n\t }\n\t this._formLoading();\n\t form.removeEventListener(submitEvent, submitListener);\n\t this.removeErrors();\n\t e.preventDefault();\n\t // reset:\n\t if (form.checkValidity()) {\n\t form.addEventListener(submitEvent, submitListener);\n\t // It's possible that the form is valid but the custom validations need to be checked again:\n\t self.currentValidationFuture = new Promise(function (resolve) {\n\t var validation = self.validateCustomFields();\n\t validation.then(function (r) {\n\t // because custom validators may mark multiple fields as invalid, we get all of them in the form\n\t var fields = self._getInvalidElements(),\n\t errors = self.prepareErrors(fields, false),\n\t firstError = errors[0];\n\t if (firstError) {\n\t self._focusElement(firstError);\n\t self.showAndOrCreateTooltip(firstError, true);\n\t }\n\t resolve(r);\n\t });\n\t });\n\t self.currentValidationFuture.then(function (r) {\n\t if (!r.foundAnyError) {\n\t // Handle submitting the form to server:\n\t self._handleSubmit(e);\n\t } else {\n\t self._formStopLoading();\n\t }\n\t });\n\t } else {\n\t self._formStopLoading();\n\t form.addEventListener(submitEvent, submitListener);\n\t }\n\t }\n\t\n\t /**\n\t * Handles submitting, optionally allows to stop submitting\n\t * @param e\n\t * @private\n\t */\n\t\n\t }, {\n\t key: '_handleSubmit',\n\t value: function _handleSubmit(e) {\n\t this._submitFunction(this.form, e);\n\t }\n\t\n\t /**\n\t * Registers a global event Handler\n\t * @param errorFunc\n\t */\n\t\n\t }], [{\n\t key: '_shouldNotValidateField',\n\t value: function _shouldNotValidateField(field) {\n\t var target = Form._findErrorTarget(field);\n\t return target instanceof HTMLFieldSetElement || field.validity === undefined || target.hasAttribute(ATTR_VALIDATE_VISIBILITY) && !_Util2.default.isVisible(target);\n\t }\n\t\n\t /**\n\t * Creates an array from a node list with invalid items\n\t * This Method expicitly checks if field should not be validated so it can be used to foucs a field\n\t * @param list\n\t * @returns {Array}\n\t * @private\n\t */\n\t\n\t }, {\n\t key: '_createArrayFromInvalidFieldList',\n\t value: function _createArrayFromInvalidFieldList(list) {\n\t var arr = [];\n\t for (var i = 0; i < list.length; ++i) {\n\t var n = list[i];\n\t if (n.validity && !n.validity.valid) {\n\t if (!Form._shouldNotValidateField(n)) {\n\t arr.push(n);\n\t }\n\t }\n\t }\n\t return arr;\n\t }\n\t }, {\n\t key: '_findErrorTarget',\n\t value: function _findErrorTarget(target) {\n\t var el = target.getAttribute(ATTR_ERROR_TARGET_ID) || target,\n\t foundTarget = el instanceof HTMLElement ? el : global.document.getElementById(el);\n\t if (!foundTarget) {\n\t throw 'Given error target did not exsits:' + target;\n\t }\n\t return foundTarget;\n\t }\n\t }, {\n\t key: 'registerErrorMessageHandler',\n\t value: function registerErrorMessageHandler(errorFunc) {\n\t Form.globalErrorMessageHandler = errorFunc;\n\t }\n\t\n\t /**\n\t * Initialize forms for a specific selector\n\t * @param {String} selector\n\t * @param {Object} [options]\n\t * @return {array.}\n\t */\n\t\n\t }, {\n\t key: 'init',\n\t value: function init(selector, options) {\n\t var forms = selector instanceof HTMLElement ? selector.querySelectorAll('form') : document.querySelectorAll(selector),\n\t instances = [];\n\t for (var i = 0; i < forms.length; i++) {\n\t instances.push(new Form(forms[i], options));\n\t }\n\t return instances;\n\t }\n\t\n\t /**\n\t * Registers a global validator that is usable on all form instances\n\t * @param {String} name\n\t * @param {Function} validator\n\t * @returns {Function}\n\t */\n\t\n\t }, {\n\t key: 'registerValidator',\n\t value: function registerValidator(name, validator) {\n\t Form.globalValidators[name] = validator;\n\t return Form;\n\t }\n\t\n\t /**\n\t * Registers a global function that is called when a form should validate the response of a server\n\t * @param {Function} func\n\t * @returns {Form}\n\t */\n\t\n\t }, {\n\t key: 'registerGlobalRemoteValidationFunction',\n\t value: function registerGlobalRemoteValidationFunction(func) {\n\t Form.globalRemoteValidationFunction = func;\n\t return Form;\n\t }\n\t }]);\n\t\n\t return Form;\n\t}(_DestroyableWidget3.default);\n\t\n\t/**\n\t * Global validators\n\t * @type {Array}\n\t */\n\t\n\t\n\tForm.globalValidators = [];\n\t\n\t/**\n\t * Global Remote validation function\n\t */\n\tForm.globalRemoteValidationFunction = function () {};\n\t\n\t/**\n\t * Handles custom error messages extracts custom message by default\n\t */\n\tForm.globalErrorMessageHandler = function (field, validity) {\n\t if (!validity.customError) {\n\t var customMsg = field.getAttribute(ATTR_DATA_CUSTOM_MESSAGE);\n\t if (customMsg) {\n\t field.setCustomValidity(customMsg);\n\t }\n\t }\n\t};\n\t\n\texports.default = Form;\n\t/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))\n\n/***/ },\n/* 10 */,\n/* 11 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t// the whatwg-fetch polyfill installs the fetch() function\n\t// on the global object (window or self)\n\t//\n\t// Return that as the export for use in Webpack, Browserify etc.\n\t__webpack_require__(12);\n\tmodule.exports = self.fetch.bind(self);\n\n\n/***/ },\n/* 12 */\n/***/ function(module, exports) {\n\n\t(function(self) {\n\t 'use strict';\n\t\n\t if (self.fetch) {\n\t return\n\t }\n\t\n\t function normalizeName(name) {\n\t if (typeof name !== 'string') {\n\t name = String(name)\n\t }\n\t if (/[^a-z0-9\\-#$%&'*+.\\^_`|~]/i.test(name)) {\n\t throw new TypeError('Invalid character in header field name')\n\t }\n\t return name.toLowerCase()\n\t }\n\t\n\t function normalizeValue(value) {\n\t if (typeof value !== 'string') {\n\t value = String(value)\n\t }\n\t return value\n\t }\n\t\n\t function Headers(headers) {\n\t this.map = {}\n\t\n\t if (headers instanceof Headers) {\n\t headers.forEach(function(value, name) {\n\t this.append(name, value)\n\t }, this)\n\t\n\t } else if (headers) {\n\t Object.getOwnPropertyNames(headers).forEach(function(name) {\n\t this.append(name, headers[name])\n\t }, this)\n\t }\n\t }\n\t\n\t Headers.prototype.append = function(name, value) {\n\t name = normalizeName(name)\n\t value = normalizeValue(value)\n\t var list = this.map[name]\n\t if (!list) {\n\t list = []\n\t this.map[name] = list\n\t }\n\t list.push(value)\n\t }\n\t\n\t Headers.prototype['delete'] = function(name) {\n\t delete this.map[normalizeName(name)]\n\t }\n\t\n\t Headers.prototype.get = function(name) {\n\t var values = this.map[normalizeName(name)]\n\t return values ? values[0] : null\n\t }\n\t\n\t Headers.prototype.getAll = function(name) {\n\t return this.map[normalizeName(name)] || []\n\t }\n\t\n\t Headers.prototype.has = function(name) {\n\t return this.map.hasOwnProperty(normalizeName(name))\n\t }\n\t\n\t Headers.prototype.set = function(name, value) {\n\t this.map[normalizeName(name)] = [normalizeValue(value)]\n\t }\n\t\n\t Headers.prototype.forEach = function(callback, thisArg) {\n\t Object.getOwnPropertyNames(this.map).forEach(function(name) {\n\t this.map[name].forEach(function(value) {\n\t callback.call(thisArg, value, name, this)\n\t }, this)\n\t }, this)\n\t }\n\t\n\t function consumed(body) {\n\t if (body.bodyUsed) {\n\t return Promise.reject(new TypeError('Already read'))\n\t }\n\t body.bodyUsed = true\n\t }\n\t\n\t function fileReaderReady(reader) {\n\t return new Promise(function(resolve, reject) {\n\t reader.onload = function() {\n\t resolve(reader.result)\n\t }\n\t reader.onerror = function() {\n\t reject(reader.error)\n\t }\n\t })\n\t }\n\t\n\t function readBlobAsArrayBuffer(blob) {\n\t var reader = new FileReader()\n\t reader.readAsArrayBuffer(blob)\n\t return fileReaderReady(reader)\n\t }\n\t\n\t function readBlobAsText(blob) {\n\t var reader = new FileReader()\n\t reader.readAsText(blob)\n\t return fileReaderReady(reader)\n\t }\n\t\n\t var support = {\n\t blob: 'FileReader' in self && 'Blob' in self && (function() {\n\t try {\n\t new Blob();\n\t return true\n\t } catch(e) {\n\t return false\n\t }\n\t })(),\n\t formData: 'FormData' in self,\n\t arrayBuffer: 'ArrayBuffer' in self\n\t }\n\t\n\t function Body() {\n\t this.bodyUsed = false\n\t\n\t\n\t this._initBody = function(body) {\n\t this._bodyInit = body\n\t if (typeof body === 'string') {\n\t this._bodyText = body\n\t } else if (support.blob && Blob.prototype.isPrototypeOf(body)) {\n\t this._bodyBlob = body\n\t } else if (support.formData && FormData.prototype.isPrototypeOf(body)) {\n\t this._bodyFormData = body\n\t } else if (!body) {\n\t this._bodyText = ''\n\t } else if (support.arrayBuffer && ArrayBuffer.prototype.isPrototypeOf(body)) {\n\t // Only support ArrayBuffers for POST method.\n\t // Receiving ArrayBuffers happens via Blobs, instead.\n\t } else {\n\t throw new Error('unsupported BodyInit type')\n\t }\n\t\n\t if (!this.headers.get('content-type')) {\n\t if (typeof body === 'string') {\n\t this.headers.set('content-type', 'text/plain;charset=UTF-8')\n\t } else if (this._bodyBlob && this._bodyBlob.type) {\n\t this.headers.set('content-type', this._bodyBlob.type)\n\t }\n\t }\n\t }\n\t\n\t if (support.blob) {\n\t this.blob = function() {\n\t var rejected = consumed(this)\n\t if (rejected) {\n\t return rejected\n\t }\n\t\n\t if (this._bodyBlob) {\n\t return Promise.resolve(this._bodyBlob)\n\t } else if (this._bodyFormData) {\n\t throw new Error('could not read FormData body as blob')\n\t } else {\n\t return Promise.resolve(new Blob([this._bodyText]))\n\t }\n\t }\n\t\n\t this.arrayBuffer = function() {\n\t return this.blob().then(readBlobAsArrayBuffer)\n\t }\n\t\n\t this.text = function() {\n\t var rejected = consumed(this)\n\t if (rejected) {\n\t return rejected\n\t }\n\t\n\t if (this._bodyBlob) {\n\t return readBlobAsText(this._bodyBlob)\n\t } else if (this._bodyFormData) {\n\t throw new Error('could not read FormData body as text')\n\t } else {\n\t return Promise.resolve(this._bodyText)\n\t }\n\t }\n\t } else {\n\t this.text = function() {\n\t var rejected = consumed(this)\n\t return rejected ? rejected : Promise.resolve(this._bodyText)\n\t }\n\t }\n\t\n\t if (support.formData) {\n\t this.formData = function() {\n\t return this.text().then(decode)\n\t }\n\t }\n\t\n\t this.json = function() {\n\t return this.text().then(JSON.parse)\n\t }\n\t\n\t return this\n\t }\n\t\n\t // HTTP methods whose capitalization should be normalized\n\t var methods = ['DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT']\n\t\n\t function normalizeMethod(method) {\n\t var upcased = method.toUpperCase()\n\t return (methods.indexOf(upcased) > -1) ? upcased : method\n\t }\n\t\n\t function Request(input, options) {\n\t options = options || {}\n\t var body = options.body\n\t if (Request.prototype.isPrototypeOf(input)) {\n\t if (input.bodyUsed) {\n\t throw new TypeError('Already read')\n\t }\n\t this.url = input.url\n\t this.credentials = input.credentials\n\t if (!options.headers) {\n\t this.headers = new Headers(input.headers)\n\t }\n\t this.method = input.method\n\t this.mode = input.mode\n\t if (!body) {\n\t body = input._bodyInit\n\t input.bodyUsed = true\n\t }\n\t } else {\n\t this.url = input\n\t }\n\t\n\t this.credentials = options.credentials || this.credentials || 'omit'\n\t if (options.headers || !this.headers) {\n\t this.headers = new Headers(options.headers)\n\t }\n\t this.method = normalizeMethod(options.method || this.method || 'GET')\n\t this.mode = options.mode || this.mode || null\n\t this.referrer = null\n\t\n\t if ((this.method === 'GET' || this.method === 'HEAD') && body) {\n\t throw new TypeError('Body not allowed for GET or HEAD requests')\n\t }\n\t this._initBody(body)\n\t }\n\t\n\t Request.prototype.clone = function() {\n\t return new Request(this)\n\t }\n\t\n\t function decode(body) {\n\t var form = new FormData()\n\t body.trim().split('&').forEach(function(bytes) {\n\t if (bytes) {\n\t var split = bytes.split('=')\n\t var name = split.shift().replace(/\\+/g, ' ')\n\t var value = split.join('=').replace(/\\+/g, ' ')\n\t form.append(decodeURIComponent(name), decodeURIComponent(value))\n\t }\n\t })\n\t return form\n\t }\n\t\n\t function headers(xhr) {\n\t var head = new Headers()\n\t var pairs = xhr.getAllResponseHeaders().trim().split('\\n')\n\t pairs.forEach(function(header) {\n\t var split = header.trim().split(':')\n\t var key = split.shift().trim()\n\t var value = split.join(':').trim()\n\t head.append(key, value)\n\t })\n\t return head\n\t }\n\t\n\t Body.call(Request.prototype)\n\t\n\t function Response(bodyInit, options) {\n\t if (!options) {\n\t options = {}\n\t }\n\t\n\t this.type = 'default'\n\t this.status = options.status\n\t this.ok = this.status >= 200 && this.status < 300\n\t this.statusText = options.statusText\n\t this.headers = options.headers instanceof Headers ? options.headers : new Headers(options.headers)\n\t this.url = options.url || ''\n\t this._initBody(bodyInit)\n\t }\n\t\n\t Body.call(Response.prototype)\n\t\n\t Response.prototype.clone = function() {\n\t return new Response(this._bodyInit, {\n\t status: this.status,\n\t statusText: this.statusText,\n\t headers: new Headers(this.headers),\n\t url: this.url\n\t })\n\t }\n\t\n\t Response.error = function() {\n\t var response = new Response(null, {status: 0, statusText: ''})\n\t response.type = 'error'\n\t return response\n\t }\n\t\n\t var redirectStatuses = [301, 302, 303, 307, 308]\n\t\n\t Response.redirect = function(url, status) {\n\t if (redirectStatuses.indexOf(status) === -1) {\n\t throw new RangeError('Invalid status code')\n\t }\n\t\n\t return new Response(null, {status: status, headers: {location: url}})\n\t }\n\t\n\t self.Headers = Headers;\n\t self.Request = Request;\n\t self.Response = Response;\n\t\n\t self.fetch = function(input, init) {\n\t return new Promise(function(resolve, reject) {\n\t var request\n\t if (Request.prototype.isPrototypeOf(input) && !init) {\n\t request = input\n\t } else {\n\t request = new Request(input, init)\n\t }\n\t\n\t var xhr = new XMLHttpRequest()\n\t\n\t function responseURL() {\n\t if ('responseURL' in xhr) {\n\t return xhr.responseURL\n\t }\n\t\n\t // Avoid security warnings on getResponseHeader when not allowed by CORS\n\t if (/^X-Request-URL:/m.test(xhr.getAllResponseHeaders())) {\n\t return xhr.getResponseHeader('X-Request-URL')\n\t }\n\t\n\t return;\n\t }\n\t\n\t xhr.onload = function() {\n\t var status = (xhr.status === 1223) ? 204 : xhr.status\n\t if (status < 100 || status > 599) {\n\t reject(new TypeError('Network request failed'))\n\t return\n\t }\n\t var options = {\n\t status: status,\n\t statusText: xhr.statusText,\n\t headers: headers(xhr),\n\t url: responseURL()\n\t }\n\t var body = 'response' in xhr ? xhr.response : xhr.responseText;\n\t resolve(new Response(body, options))\n\t }\n\t\n\t xhr.onerror = function() {\n\t reject(new TypeError('Network request failed'))\n\t }\n\t\n\t xhr.open(request.method, request.url, true)\n\t\n\t if (request.credentials === 'include') {\n\t xhr.withCredentials = true\n\t }\n\t\n\t if ('responseType' in xhr && support.blob) {\n\t xhr.responseType = 'blob'\n\t }\n\t\n\t request.headers.forEach(function(value, name) {\n\t xhr.setRequestHeader(name, value)\n\t })\n\t\n\t xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit)\n\t })\n\t }\n\t self.fetch.polyfill = true\n\t})(typeof self !== 'undefined' ? self : this);\n\n\n/***/ },\n/* 13 */,\n/* 14 */,\n/* 15 */,\n/* 16 */,\n/* 17 */,\n/* 18 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _Form = __webpack_require__(9);\n\t\n\tvar _Form2 = _interopRequireDefault(_Form);\n\t\n\tvar _Tooltip = __webpack_require__(6);\n\t\n\tvar _Tooltip2 = _interopRequireDefault(_Tooltip);\n\t\n\tvar _Settings = __webpack_require__(2);\n\t\n\tvar _Settings2 = _interopRequireDefault(_Settings);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\t// default export as component object\n\texports.default = {\n\t Form: _Form2.default,\n\t Settings: _Settings2.default,\n\t Tooltip: _Tooltip2.default\n\t};\n\n/***/ }\n/******/ ])\n});\n;\n\n\n/** WEBPACK FOOTER **\n ** js/form.min.js\n **/"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"../\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n/** WEBPACK FOOTER **\n ** webpack/bootstrap 2abcfdab5a59a5cf6b3b\n **/","/*\n * The MIT License (MIT)\n *\n * Copyright (c) 2015 David Heidrich, BowlingX \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nconst PFX = [\"webkit\", \"moz\", \"MS\", \"o\", \"\"];\n\nconst COL_LEFT_CLASS = 'is-collision-left';\n\nconst COL_RIGHT_CLASS = 'is-collision-right';\n\nconst COL_BOTTOM_CLASS = 'is-collision-bottom';\n\n/**\n * Provides shared DOM-Utility functions\n */\nclass Util {\n\n /**\n * Will register the right animation event based on browser\n * @param element\n * @param type\n * @param callback\n */\n static prefixedAnimateEvent(element, type, callback) {\n const thisFunction = function thisFunction(e) {\n callback.apply(element, [e, thisFunction]);\n };\n\n for (let p = 0; p < PFX.length; p++) {\n let thisType = type;\n if (!PFX[p]) {\n thisType = type.toLowerCase();\n }\n const name = PFX[p] + thisType;\n element.addEventListener(name, thisFunction, true);\n }\n }\n\n /**\n * Get correct transitionend event\n * @returns {String}\n * @private\n */\n static whichTransitionEndEvent() {\n let t;\n const el = document.createElement('fake');\n\n const transitions = {\n transition: 'transitionend',\n OTransition: 'oTransitionEnd',\n MozTransition: 'transitionend',\n WebkitTransition: 'webkitTransitionEnd'\n };\n\n for (t in transitions) {\n if (el.style[t] !== undefined) {\n return transitions[t];\n }\n }\n }\n\n /**\n * Check if target is part of parent node\n * @param target\n * @param parent\n * @returns {boolean}\n */\n static isPartOfNode(target, parent) {\n if (!target || !parent) {\n return false;\n }\n let now = target;\n while (now !== parent && now !== null) {\n if (now === parent) {\n break;\n }\n now = now.parentNode;\n }\n return now !== null;\n }\n\n /**\n * Finds the closest element including itself matching a callback\n * @param {Node} el\n * @param {Function} callback\n * @returns {Node|boolean}\n */\n static closestCallback(el, callback) {\n let element = el;\n while (element !== null) {\n if (callback(element)) {\n return element;\n }\n element = element.parentNode;\n }\n return false;\n }\n\n /**\n * Walks the tree until func returns true for given argument\n * @param target\n * @param func\n * @returns {boolean|HTMLElement}\n */\n static parentsUntil(target, func) {\n if (!target) {\n return false;\n }\n let now = target;\n while (!func(now) && now !== null) {\n now = now.parentNode;\n }\n\n return now;\n }\n\n /**\n * Generates a unique id\n * @return {String}\n */\n static guid() {\n function s4() {\n return Math.floor((1 + Math.random()) * 0x10000)\n .toString(16)\n .substring(1);\n }\n\n return `${s4() + s4()}-${s4()}-${s4()}-${s4()}-${s4() + s4() + s4()}`;\n }\n\n /**\n * Detects scrollbar width\n * @see http://stackoverflow.com/questions/986937/how-can-i-get-the-browsers-scrollbar-sizes\n * @returns {number}\n */\n static getScrollBarWidth() {\n const doc = global.document;\n const inner = doc.createElement('p');\n\n inner.style.width = \"100%\";\n inner.style.height = \"200px\";\n\n const outer = doc.createElement('div');\n outer.style.position = \"absolute\";\n outer.style.top = \"0px\";\n outer.style.left = \"0px\";\n outer.style.visibility = \"hidden\";\n outer.style.width = \"200px\";\n outer.style.height = \"150px\";\n outer.style.overflow = \"hidden\";\n outer.appendChild(inner);\n\n doc.body.appendChild(outer);\n const w1 = inner.offsetWidth;\n outer.style.overflow = 'scroll';\n let w2 = inner.offsetWidth;\n if (w1 === w2) {\n w2 = outer.clientWidth;\n }\n doc.body.removeChild(outer);\n\n return (w1 - w2);\n }\n\n\n /**\n * Run an event once\n * @param {String} ev\n * @param {HTMLElement|HTMLDocument} target\n * @param {Function} func\n * @param {boolean} [capture]\n * @return Function created listener\n */\n static addEventOnce(ev, target, func, capture) {\n const thisFunction = function thisFunction(event) {\n func(event, func);\n target.removeEventListener(ev, thisFunction, capture);\n };\n target.addEventListener(ev, thisFunction, capture);\n return thisFunction;\n }\n\n /**\n * Checks if an element is visible\n * @param {HTMLElement} element\n * @returns bool\n */\n static isVisible(element) {\n return element.offsetWidth > 0 && element.offsetHeight > 0;\n }\n\n /**\n * Creates a camelCaseRepresentation of a dashed string\n * @param {String} str\n * @returns String\n */\n static dashToCamelCase(str) {\n return str.replace(/-([a-z])/g, (g) => {\n return g[1].toUpperCase();\n });\n }\n\n /**\n * Creates a copy of `input`\n * @param {*} input\n * @return *\n */\n static copy(input) {\n return JSON.parse(JSON.stringify(input));\n }\n\n /**\n * Reads options from element (data attributes) and applies to base\n * @param {HTMLElement} element\n * @param {Object} base\n * @return {Object}\n */\n static applyOptionsFromElement(element, base) {\n if (!element) {\n return base;\n }\n const attrs = element.attributes;\n for (let i = 0; i < attrs.length; i++) {\n const attr = attrs[i];\n if (attr) {\n const s = Util.dashToCamelCase(attr.nodeName.replace('data-', ''));\n const val = attr.nodeValue;\n if (base.hasOwnProperty(s)) {\n // skip functions\n if (typeof base[s] === 'function') {\n continue;\n }\n if (typeof base[s] === 'boolean') {\n base[s] = parseInt(val || 1, 10) === 1;\n } else {\n base[s] = val;\n }\n }\n }\n }\n return base;\n }\n\n /**\n * Will position an element directly at given target\n * Is aware of a given collision container to detect edges\n * Will put elementToPosition either to left, center or right edge (prefer right)\n * and either to bottom or top (prefers bottom)\n *\n * You may overwrite preferred positioned with `centerHorizontal` and `positionTop`\n *\n * @param {HTMLElement|ClientRect} target the target container to align to\n * @param {HTMLElement} elementToPosition the element to position\n * @param {HTMLElement} collisionContainer the outer container to prevent collisions\n * @param {boolean} [centerHorizontal] set true to center element, otherwise it's put on the right border by default\n * @param {boolean} [positionTop] flip top, by default element is positioned to the bottom.\n * @returns {HTMLElement}\n */\n static setupPositionNearby(target, elementToPosition, collisionContainer, centerHorizontal, positionTop) {\n // determine relative offsets\n let amountTop = 0;\n let amountLeft = 0;\n Util.parentsUntil(target.parentNode, (el) => {\n if (!(el instanceof HTMLElement)) {\n return false;\n }\n const style = window.getComputedStyle(el);\n if (Util.isPartOfNode(elementToPosition, el)) {\n if (style && style.position === 'relative') {\n amountTop += el.offsetTop || 0;\n amountLeft += el.offsetLeft || 0;\n }\n return false;\n }\n return true;\n });\n\n const targetPosition = target instanceof HTMLElement ? target.getBoundingClientRect() : target;\n const elementRect = elementToPosition.getBoundingClientRect();\n const colRect = collisionContainer.getBoundingClientRect();\n const targetTop = targetPosition.top - amountTop;\n const targetRight = targetPosition.right;\n const isCollisionTop = (targetTop - elementRect.height) <= 0;\n const isCollisionBottom =\n window.innerHeight < (targetTop + amountTop + targetPosition.height + elementRect.height);\n const isCollisionLeft = targetRight < elementRect.width;\n const targetLeft = targetPosition.left;\n const isCollisionRight = (targetLeft + elementRect.width) > colRect.width;\n const classList = elementToPosition.classList;\n\n classList.remove(COL_RIGHT_CLASS);\n classList.remove(COL_LEFT_CLASS);\n classList.remove(COL_BOTTOM_CLASS);\n\n let calcTop;\n let calcLeft;\n if (isCollisionLeft && !isCollisionRight) {\n // put element to left if collision with left\n calcLeft = `${(targetPosition.left - colRect.left - amountLeft)}px`;\n classList.add(COL_LEFT_CLASS);\n } else {\n // maybe center if no collision with either side\n const rightPosition = `${(targetRight - elementRect.width - colRect.left - amountLeft)}px`;\n const leftCentered = ((targetLeft + targetPosition.width / 2) -\n (elementRect.width / 2) || 0) - colRect.left;\n const collisionCentered = (leftCentered + elementRect.width) > colRect.width;\n if (centerHorizontal && !collisionCentered) {\n calcLeft = `${leftCentered}px`;\n } else {\n classList.add(COL_RIGHT_CLASS);\n calcLeft = rightPosition;\n }\n }\n\n if (isCollisionBottom || (positionTop && !isCollisionTop)) {\n // Put Element on top if collision\n calcTop = `${(targetTop - elementRect.height) - colRect.top}px`;\n classList.add(COL_BOTTOM_CLASS);\n } else {\n calcTop = `${(targetTop + targetPosition.height) - colRect.top}px`;\n }\n\n elementToPosition.style.cssText = `top:${calcTop};left:${calcLeft};`;\n\n return elementToPosition;\n }\n\n /**\n * Brings a given element into viewport\n * @param {HTMLElement} el\n * @param {int|function}[optionalOffset]\n */\n static scrollToElement(el, optionalOffset) {\n el.scrollIntoView();\n let thisOffset = optionalOffset;\n // optionally use a additional scrollDif\n if (thisOffset) {\n if (typeof thisOffset === 'function') {\n thisOffset = optionalOffset();\n }\n if (thisOffset > 0) {\n const scrolledY = window.pageYOffset;\n if (scrolledY) {\n window.scroll(0, scrolledY - thisOffset);\n }\n }\n }\n }\n}\n\nexport default Util;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/main/util/Util.js\n **/","/*\n * The MIT License (MIT)\n *\n * Copyright (c) 2015 David Heidrich, BowlingX \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\nimport Util from './Util';\n\n// we attach global settings to global once because settings might be shared a lot of times trough the application\n// Maybe find a better way to handle that scenario\nif (!global.FLEXCSS_GLOBAL_SETTINGS) {\n global.FLEXCSS_GLOBAL_SETTINGS = {\n // defined breakpoint for small devices < n\n smallBreakpoint: 768,\n // nodes that should be updated when no scrollbar is expected\n scrollbarUpdateNodes: global.document.body !== null ? [global.document.body] : [],\n // additional Delay until darkener is fully hidden\n darkenerFadeDelay: 100,\n // class that is added if canvas has been toggled\n canvasToggledClass: 'toggled-canvas'\n };\n\n global.FLEXCSS_CONST_IS_IOS = null;\n\n global.FLEXCSS_CONST_IS_TOUCH = null;\n\n global.FLEXCSS_CONST_IS_IE = null;\n\n global.FLEXCSS_CONST_TAB_EVENT = 'click';\n\n global.FLEXCSS_IS_SMALL_SCREEN = false;\n\n const init = () => {\n // Measure scrollbar width\n global.FLEXCSS_CONST_SCROLLBAR_WIDTH = Util.getScrollBarWidth();\n // detect right transition end event\n global.FLEXCSS_CONST_TRANSITION_EVENT = Util.whichTransitionEndEvent();\n };\n\n if (global.document.readyState !== 'loading') {\n init();\n } else {\n // it's possible that global.document.body is not available if the document is not\n // loaded completely\n document.addEventListener('DOMContentLoaded', () => {\n init();\n });\n }\n}\n\n/**\n * Utility class that setups global settings\n */\nclass Settings {\n\n /**\n * Setup global settings, overwrite default values\n * @param {Object} settings\n */\n static setup(settings) {\n Object.assign(global.FLEXCSS_GLOBAL_SETTINGS, settings);\n }\n\n /**\n * Access to global settings\n * @returns {Object}\n */\n static get() {\n return global.FLEXCSS_GLOBAL_SETTINGS;\n }\n\n /**\n * Detects a IOS Device, caches subsequent calls\n * @returns {boolean}\n */\n static isIosDevice() {\n if (!global.FLEXCSS_CONST_IS_IOS) {\n global.FLEXCSS_CONST_IS_IOS = global.navigator.userAgent.match(/(iPad|iPhone|iPod)/i);\n }\n\n return global.FLEXCSS_CONST_IS_IOS;\n }\n\n /**\n * @returns {boolean}\n */\n static isSmallScreen() {\n return window.innerWidth < Settings.get().smallBreakpoint;\n }\n\n /**\n * Detects a touch device, caches subsequent calls\n * @returns {boolean}\n */\n static isTouchDevice() {\n if (!global.FLEXCSS_CONST_IS_TOUCH) {\n global.FLEXCSS_CONST_IS_TOUCH = 'ontouchstart' in window || !!(global.navigator.msMaxTouchPoints);\n }\n return global.FLEXCSS_CONST_IS_TOUCH;\n }\n\n /**\n * Checks if current browser is Internet Explorer\n * @returns {boolean|*}\n */\n static isIE() {\n if (!global.FLEXCSS_CONST_IS_IE) {\n global.FLEXCSS_CONST_IS_IE = \"ActiveXObject\" in window;\n }\n return global.FLEXCSS_CONST_IS_IE;\n }\n\n /**\n * @returns {String}\n */\n static getTransitionEvent() {\n return global.FLEXCSS_CONST_TRANSITION_EVENT;\n }\n\n /**\n * @returns {int}\n */\n static getScrollbarWidth() {\n return global.FLEXCSS_CONST_SCROLLBAR_WIDTH;\n }\n\n /**\n * @returns {String}\n */\n static getTabEvent() {\n return global.FLEXCSS_CONST_TAB_EVENT;\n }\n}\n\nexport default Settings;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/main/util/Settings.js\n **/","/* global CustomEvent */\n\n/*\n * The MIT License (MIT)\n *\n * Copyright (c) 2015 David Heidrich, BowlingX \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n// polyfill for custom events to make thinks work in IE\n// The needed polyfill is so small that I embedded it here\n(function poly() {\n if (!global.CustomEvent || typeof global.CustomEvent !== 'function') {\n const CustomEvent = function CustomEvent(event, params) {\n const thisParams = params ||\n {\n bubbles: false,\n cancelable: false,\n detail: undefined\n };\n const evt = document.createEvent(\"CustomEvent\");\n evt.initCustomEvent(event, thisParams.bubbles,\n thisParams.cancelable, thisParams.detail);\n return evt;\n };\n CustomEvent.prototype = global.Event.prototype;\n global.CustomEvent = CustomEvent;\n }\n})();\n/**\n * Simpler Event dispatching\n */\nclass EventHandler {\n\n /**\n * @param {HTMLElement} target\n * @param {String} name\n */\n constructor(target, name) {\n this.target = target;\n this.defaultOptions = {\n bubbles: true,\n cancelable: true\n };\n\n this.name = name;\n }\n\n /**\n * Set more options\n * @param {Object} options\n * @returns {EventHandler}\n */\n withOptions(options) {\n Object.assign(this.defaultOptions, (options || {}));\n return this;\n }\n\n /**\n * Call with the originalEvent\n * @param {Event} e\n * @returns {EventHandler}\n */\n withOriginal(e) {\n return this.withDetail({\n originalEvent: e\n });\n }\n\n /**\n * Extends the detail part of the event\n * @param {Object} o\n * @returns {EventHandler}\n */\n withDetail(o) {\n if (!this.defaultOptions.detail) {\n this.defaultOptions.detail = {};\n }\n Object.assign(this.defaultOptions.detail, o);\n return this;\n }\n\n /**\n * @returns {CustomEvent}\n */\n fire() {\n const e = new CustomEvent(this.name, this.defaultOptions);\n if (this.target) {\n this.target.dispatchEvent(e);\n }\n return e;\n }\n}\n\nclass Event {\n /**\n * Prepares to dispatch a custom event (without firing)\n * @param {HTMLElement} target\n * @param {String} name\n * @returns {EventHandler}\n */\n static dispatch(target, name) {\n return new EventHandler(target, name);\n }\n\n /**\n * Dispatches a custom event and fires it directly\n * @param {HTMLElement} target\n * @param {String} name\n * @param {Object} [options]\n * @returns {CustomEvent}\n */\n static dispatchAndFire(target, name, options) {\n return new EventHandler(target, name).withOptions(options).fire();\n }\n}\n\nexport default Event;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/main/util/Event.js\n **/","/*\n * The MIT License (MIT)\n *\n * Copyright (c) 2015 David Heidrich, BowlingX \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n/**\n * Provides a Basic Widget\n */\nclass DestroyableWidget {\n\n constructor() {\n this.listeners = [];\n }\n\n /**\n * Destroys a Widget\n */\n destroy() {\n this.listeners.forEach((listener) => {\n listener.element.removeEventListener.apply(listener.element, listener.args);\n });\n this.listeners = [];\n }\n\n /**\n * Adds an event and registers it later to remove bindings\n * @param {HTMLElement} element\n * @param {String} name\n * @param {Function} listener\n * @param {boolean} [capture]\n * @returns {Function}\n */\n addEventListener(element, name, listener, capture) {\n this.listeners.push({\n element,\n args: [name, listener, capture]\n });\n\n element.addEventListener(name, listener, capture);\n return listener;\n }\n\n}\n\nexport default DestroyableWidget;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/main/DestroyableWidget.js\n **/","/*\n * The MIT License (MIT)\n *\n * Copyright (c) 2015 David Heidrich, BowlingX \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n/*!\n * FlexCss.Tooltip\n * Licensed under the MIT License (MIT)\n * Copyright (c) 2015 David Heidrich, BowlingX \n */\n\nimport Util from './util/Util';\nimport DestroyableWidget from './DestroyableWidget';\nimport Settings from './util/Settings';\n\n/**\n * @type {string}\n */\nconst CLASS_NAMES_TOOLTIP = 'tooltip-container';\n/**\n * @type {string}\n */\nconst CLASS_NAMES_OPEN = 'open';\n\n/**\n * @type {string}\n */\nconst ATTR_DATA_CLASSNAME = 'data-class';\n\n/**\n * @type {string}\n */\nconst ATTR_DATA_NO_TOUCH = 'data-no-touch';\n\n/**\n * @type {HTMLDocument}\n */\nconst doc = global.document;\n\n/**\n * Simple Tooltip\n */\nclass Tooltip extends DestroyableWidget {\n\n /**\n * Creates a Tooltip\n * @param {HTMLElement|String} DelegateContainer\n * @param {Object} [options]\n */\n constructor(DelegateContainer, options) {\n super();\n /**\n * The Container where possible events are captured\n */\n this.container = DelegateContainer instanceof HTMLElement ?\n DelegateContainer : doc.getElementById(DelegateContainer);\n\n if (!this.container) {\n throw new Error('Could not create Tooltip, DelegateContainer not found');\n }\n\n /**\n * The Container where tooltips are stored for this instance\n * @type {HTMLElement}\n */\n this.tooltipContainer = null;\n\n /**\n * Default Options\n */\n this.options = {\n containerClass: '',\n selectorAttribute: 'data-tooltip',\n collisionContainer: this.container\n };\n\n Object.assign(this.options, options || {});\n }\n\n /**\n * Creates and shows a tooltip\n * @param {HTMLElement} target where is this tooltip positioned\n * @param {String} text text content in tooltip, will be NOT escaped\n * @param {Boolean} [removeTitle] removes title element if given\n * @param {Node} [positionRelative]\n */\n createTooltip(target, text, removeTitle, positionRelative) {\n // abort if text is empty\n if (!text || text && text.trim() === '') {\n return;\n }\n\n if (Settings.isTouchDevice() && target && target.hasAttribute(ATTR_DATA_NO_TOUCH)) {\n return;\n }\n\n let tooltipContainer = this.tooltipContainer;\n\n if (!tooltipContainer) {\n tooltipContainer = doc.createElement('div');\n this.container.appendChild(tooltipContainer);\n this.tooltipContainer = tooltipContainer;\n }\n this._restoreClassNames(tooltipContainer, target);\n\n tooltipContainer.style.left = 'auto';\n tooltipContainer.style.top = 'auto';\n tooltipContainer.innerHTML = text;\n tooltipContainer.flexTooltipCurrentTarget = target;\n if (removeTitle) {\n target.oldTitle = text;\n target.removeAttribute('title');\n }\n\n Util.setupPositionNearby(positionRelative || target, tooltipContainer,\n this.options.collisionContainer, true, true);\n\n tooltipContainer.classList.add(CLASS_NAMES_OPEN);\n }\n\n _restoreClassNames(container, target) {\n // allow additional classname per tooltip on target element\n const classNames = [CLASS_NAMES_TOOLTIP, this.options.containerClass];\n const maybeTargetClass = target.getAttribute(ATTR_DATA_CLASSNAME);\n if (maybeTargetClass) {\n classNames.push(maybeTargetClass);\n }\n container.className = classNames.join(\" \");\n return this;\n }\n\n /**\n * @returns {HTMLElement|null}\n */\n getCurrentTarget() {\n return this.tooltipContainer ? this.tooltipContainer.flexTooltipCurrentTarget : null;\n }\n\n /**\n * Destroys this Widget\n * @returns {boolean}\n */\n destroy() {\n super.destroy();\n\n if (this.tooltipContainer) {\n this.tooltipContainer.parentNode.removeChild(this.tooltipContainer);\n return true;\n }\n return false;\n }\n\n /**\n * Removes a Tooltip on given target\n * @param {HTMLElement} [target], if not given will remove current open tooltip on this instance\n */\n removeTooltip(target) {\n let selfTarget = target;\n if (!selfTarget && this.tooltipContainer) {\n selfTarget = this.tooltipContainer.flexTooltipCurrentTarget;\n }\n if (this.tooltipContainer) {\n if (this.tooltipContainer.flexTooltipCurrentTarget !== selfTarget) {\n return;\n }\n this.tooltipContainer.classList.remove(CLASS_NAMES_OPEN);\n delete this.tooltipContainer.flexTooltipCurrentTarget;\n }\n if (selfTarget && selfTarget.oldTitle) {\n selfTarget.setAttribute('title', selfTarget.oldTitle);\n }\n }\n\n /**\n * Initilizes mouse events on container element\n */\n registerEvents() {\n const self = this;\n this.addEventListener(this.container, 'mouseover', (e) => {\n if (e.target.hasAttribute(self.options.selectorAttribute)) {\n self.createTooltip(e.target, e.target.getAttribute('title'), true);\n }\n });\n\n this.addEventListener(this.container, 'mouseout', (e) => {\n if (e.target.hasAttribute(self.options.selectorAttribute)) {\n self.removeTooltip(e.target);\n }\n });\n return this;\n }\n}\n\nexport default Tooltip;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/main/Tooltip.js\n **/","/*global HTMLFormElement, fetch, FormData, clearTimeout, NodeList*/\n\n/*\n * The MIT License (MIT)\n *\n * Copyright (c) 2015 David Heidrich, BowlingX \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n/*!\n * FlexCss.Form\n * Licensed under the MIT License (MIT)\n * Copyright (c) 2015 David Heidrich, BowlingX \n */\n\nimport Tooltip from './Tooltip';\nimport 'isomorphic-fetch';\nimport Event from './util/Event';\nimport Util from './util/Util';\nimport Settings from './util/Settings';\nimport DestroyableWidget from './DestroyableWidget';\n\nconst LOADING_CLASS = 'loading';\nconst DATA_ELEMENT_INVALID = 'data-flexcss-invalid';\nconst REMOTE = 'data-remote';\nconst REMOTE_ACTION = 'data-remote-action';\nconst ATTR_DISABLE_INLINE = 'data-disable-inline-validation';\nconst ATTR_DISABLE_REALTIME = 'data-disable-realtime-validation';\nconst ATTR_VALIDATOR = 'data-validate';\nconst ATTR_DATA_CUSTOM_MESSAGE = 'data-validation-message';\nconst ATTR_DATA_CUSTOM_LABEL = 'data-custom-label';\nconst ATTR_VALIDATE_VISIBILITY = 'data-validate-visibility';\nconst ATTR_ERROR_TARGET_ID = 'data-error-target';\nconst ATTR_DEPENDS = 'data-depends-selector';\nconst CONST_USE_JSON = 'json';\nconst CONST_REALTIME_EVENT = 'input';\nconst FOCUS_TOOLTIP_DELAY = 20;\nconst CLICK_TOOLTIP_DELAY = 150;\n\n/**\n * Triggered when form is fully initialized and handlers are binded\n * @type {string}\n */\nexport const EVENT_FORM_READY = 'flexcss.form.ready';\n/**\n * Fires when a form is submitted, cancelable\n * @type {string}\n */\nexport const EVENT_FORM_SUBMIT = 'flexcss.form.submit';\n/**\n * Fired directly after the form has been submitted via ajax\n * @type {string}\n */\nexport const EVENT_FORM_AFTER_AJAX_SUBMIT = 'flexcss.form.afterAjaxSubmit';\n/**\n * Fired when ajax events did complete\n * @type {string}\n */\nexport const EVENT_FORM_AJAX_COMPLETED = 'flexcss.form.ajaxCompleted';\n\n/**\n * A HTML5 Form Validation replacement\n */\n\nclass Form extends DestroyableWidget {\n /**\n * @param {HTMLElement} form\n * @param [options] optional options\n */\n constructor(form, options) {\n super();\n\n if (!(form instanceof HTMLFormElement)) {\n throw 'argument {0} form needs to be an form element';\n }\n\n /**\n * The Form\n * @type {HTMLElement}\n */\n this.form = form;\n\n /**\n * @type {Tooltip}\n */\n this.tooltips = null;\n\n /**\n * @type {Promise}\n */\n this.currentValidationFuture = new Promise(() => {\n });\n\n /**\n * Default options\n * @type {Object}\n */\n this.options = {\n // if true creates tooltips above element, uses FlexCss Tooltips\n createTooltips: true,\n // if true appends error message after input element\n appendError: false,\n // type of ajax submit\n ajaxSubmitType: 'POST',\n // json content type if ajax method is set to json\n ajaxJsonContentType: 'application/json; charset=utf-8',\n // allow inline validation\n inlineValidation: true,\n // validate in realtime (on `input` event)\n realtime: true,\n // timeout when realtime event should be captured\n realtimeTimeout: 250,\n // formatting method for an error\n formatErrorTooltip: (error) => {\n return ' ' + error;\n },\n // the class that will be put on the element to mark it failed validation\n inputErrorClass: 'invalid',\n // the container class for error messages below an element\n containerErrorClass: 'form-error',\n // additional options for fetch\n fetchOptions: {\n credentials: 'include'\n },\n // the container for tooltips\n tooltipContainer: form,\n tooltipOptions: {\n containerClass: 'error-tooltip'\n },\n // if you have a fixed header, either set a number or function here\n scrollToElementDiff: 0\n };\n\n // overwrite default options\n Object.assign(this.options, options);\n\n // apply settings from attributes\n Util.applyOptionsFromElement(form, this.options);\n\n // set form class as widget\n // Forms are very different to classical widgets,\n // we will not use our base widget class for this but just self\n form.hfWidgetInstance = this;\n\n /**\n * A List of Validators\n * @type {Object}\n * @private\n */\n this._validators = Form.globalValidators;\n\n /**\n * @type {Function}\n * @private\n */\n this._remoteValidationFunction = null;\n\n this.initFormValidation();\n }\n\n destroy() {\n super.destroy();\n if (this.tooltips) {\n this.tooltips.destroy();\n }\n }\n\n /**\n * Submits this form, either via ajax or just classical (default)\n * @param {HTMLFormElement} thisForm\n * @param {Event} e\n * @private\n * @returns {Promise|boolean} returns false if submit is cancled\n */\n _submitFunction(thisForm, e) {\n var shouldUseAjax = thisForm.getAttribute(REMOTE), ajaxPostUrl =\n thisForm.getAttribute(REMOTE_ACTION) ||\n thisForm.getAttribute('action') || window.location.href,\n useJson = CONST_USE_JSON === shouldUseAjax, self = this;\n\n var ev = Event.dispatch(thisForm, EVENT_FORM_SUBMIT).withOriginal(e).fire();\n\n // abort execution is event was prevented\n if (ev.defaultPrevented) {\n self._formStopLoading();\n return false;\n }\n\n if (shouldUseAjax === null) {\n // submit\n return thisForm.submit();\n }\n // prevent form from submit normally\n e.preventDefault();\n\n // add information that this is an XMLHttpRequest request (used by some frameworks)\n let defaultHeaders = {\n 'X-Requested-With': 'XMLHttpRequest'\n };\n\n // setup default headers\n if (useJson) {\n Object.assign(defaultHeaders, {\n 'Content-Type': this.options.ajaxJsonContentType\n });\n }\n let defaultOptions = Object.assign(this.options.fetchOptions, {\n headers: defaultHeaders,\n method: this.options.ajaxSubmitType\n });\n\n // support either JSON request payload or normal payload submission\n var serverCall = useJson ? fetch(ajaxPostUrl, Object.assign(defaultOptions, {\n body: JSON.stringify(this.serialize())\n })) : fetch(ajaxPostUrl, Object.assign(defaultOptions, {\n body: new FormData(thisForm)\n }));\n\n Event.dispatch(thisForm, EVENT_FORM_AFTER_AJAX_SUBMIT).withOriginal(e).fire();\n\n return serverCall.then((r) => {\n (self._remoteValidationFunction || Form.globalRemoteValidationFunction).apply(self, [r]);\n\n Event.dispatch(thisForm, EVENT_FORM_AJAX_COMPLETED).withOriginal(e).withDetail({ response: r }).fire();\n // always remove error class\n self._formStopLoading();\n });\n }\n\n /**\n * Serializes a form to a json object\n * @returns {Object}\n */\n serialize() {\n var selectors = [\n 'input[name]:not([type=\"radio\"]):enabled',\n 'input[type=\"radio\"][name]:checked',\n 'select[name]:enabled',\n 'textarea[name]:enabled'\n ], inputs = this.form.querySelectorAll(selectors.join(',')), result = {};\n\n Array.prototype.forEach.call(inputs, function (input) {\n var exists = result[input.name], value = input.value;\n if (exists instanceof Array) {\n exists.push(value);\n } else if (exists) {\n result[input.name] = [result[input.name], value];\n } else {\n result[input.name] = value;\n }\n });\n\n return result;\n }\n\n /**\n * Handles the chain of validation on given fields\n *\n * @param {HTMLElement|Array|NodeList} field\n * @param [focus] optional focus first error\n * @returns {Promise}\n */\n handleValidation(field, focus) {\n var fields = (field instanceof Array || field instanceof NodeList) ? field : [field];\n return this._handleValidation(fields, focus, true).then(((r) => {\n if (!r.foundAnyError) {\n // remove tooltips\n if (this.tooltips) {\n this.tooltips.removeTooltip();\n }\n }\n return r;\n }).bind(this));\n }\n\n /**\n * Handles errors on given node list\n * @param {NodeList} toValidateFields\n * @param {boolean} focus\n * @param {boolean} scoped if true, will only validate the fields `invalidFields`\n * @returns {Promise}\n * @private\n */\n _handleValidation(toValidateFields, focus, scoped) {\n var self = this;\n var arr = Form._createArrayFromInvalidFieldList(toValidateFields), isLocalInvalid = arr.length > 0;\n // focus must appear in the same frame for iOS devices\n if (isLocalInvalid && focus) {\n self._focusElement(arr[0]);\n }\n var validation = scoped ? this._customValidationsForElements(toValidateFields) :\n self.validateCustomFields();\n return validation.then((r) => {\n if (isLocalInvalid) {\n // combine browser and custom validators\n r.foundAnyError = true;\n }\n // get a unique field list of all fields that need to be checked and rendered\n // it's possible that we have duplicates in non scoped mode\n let thisToValidateFields = scoped ? toValidateFields :\n Array.from(arr).concat(r.checkedFields);\n r.checkedFields = thisToValidateFields;\n let foundInvalidFields = self.prepareErrors(thisToValidateFields, false),\n firstInvalidField = foundInvalidFields[0];\n if (firstInvalidField) {\n if (focus) {\n self._focusElement(firstInvalidField);\n // if element could not be focused:\n if (document.activeElement !== firstInvalidField) {\n self._handleTooltipHideClickAfterChange();\n }\n } else {\n self._handleTooltipHideClickAfterChange();\n }\n self.showAndOrCreateTooltip(firstInvalidField);\n }\n return r;\n });\n }\n\n /**\n * @param {HTMLElement} field\n * @param {ValidityState} validity\n * @returns {*}\n * @private\n */\n\n _setupErrorMessages(field, validity) {\n return Form.globalErrorMessageHandler ?\n Form.globalErrorMessageHandler.apply(this, [field, validity]) : false;\n }\n\n /**\n * Handles class labels for elements\n * @param {Object} fields\n * @private\n */\n _handleLabels(fields) {\n Object.keys(fields).forEach(function (id) {\n let labels = this.getForm().querySelectorAll('[for=\"' + id + '\"]'), invalid = fields[id];\n if (labels.length) {\n for (let labelsIndex = 0; labelsIndex < labels.length; labelsIndex++) {\n let labelEl = labels[labelsIndex];\n // we can't use toggle attribute, not supported in IE\n if (invalid) {\n this._markElementInvalid(labelEl);\n } else {\n this._markElementValid(labelEl);\n }\n }\n }\n }.bind(this));\n }\n\n /**\n * @param el\n * @private\n */\n _markElementInvalid(el) {\n el.setAttribute(DATA_ELEMENT_INVALID, \"true\");\n el.classList.add(this.options.inputErrorClass);\n }\n\n /**\n * @param el\n * @private\n */\n _markElementValid(el) {\n el.removeAttribute(DATA_ELEMENT_INVALID);\n el.classList.remove(this.options.inputErrorClass);\n }\n\n /**\n * A List of invalid elements (:invalid)\n * @returns {Array}\n * @private\n */\n _getInvalidElements() {\n return Array.prototype.filter.call(this.getForm().querySelectorAll(\":invalid\"), function (r) {\n return !(r instanceof HTMLFieldSetElement);\n });\n }\n\n /**\n * @param {HTMLElement} thisParent\n * @private\n */\n _removeElementErrors(thisParent) {\n let errors = thisParent.querySelectorAll('.' + this.options.containerErrorClass), inputsWithErrorClasses =\n thisParent.querySelectorAll(`[${DATA_ELEMENT_INVALID}]`);\n for (let elementErrorIndex = 0; elementErrorIndex < errors.length; elementErrorIndex++) {\n errors[elementErrorIndex].parentNode.removeChild(errors[elementErrorIndex]);\n }\n for (let inputErrorIndex = 0; inputErrorIndex < inputsWithErrorClasses.length; inputErrorIndex++) {\n let el = inputsWithErrorClasses[inputErrorIndex];\n this._markElementValid(el);\n }\n }\n\n\n /**\n * Registers a custom validator\n * @param {String} name\n * @param {Function} validator a validation function should always return either a Future(true) or Future(false)\n * even when the field has been invalidated with `setCustomValidity`, because of different browser `bugs`\n * we can't rely on that\n * @returns {Form}\n */\n registerValidator(name, validator) {\n this._validators[name] = validator;\n return this;\n }\n\n /**\n * Runs async validation\n * @param {String} validationRef\n * @param {HTMLElement} field\n * @returns {Promise}\n * @private\n */\n _runValidation(validationRef, field) {\n if (!this._validators[validationRef]) {\n throw 'Could not found validator: ' + validationRef;\n }\n var cl = field.classList, future = this._validators[validationRef].apply(this, [field, this.form]);\n cl.add(LOADING_CLASS);\n future.then(() => {\n cl.remove(LOADING_CLASS);\n });\n return future;\n }\n\n\n /**\n * Run custom validations for elements, validations are done async do support XHR Requests or other stuff\n *\n * @param {Array|NodeList} fields\n * @returns {Promise} contains either true if validations passed or false if something went wrong\n * @private\n */\n _customValidationsForElements(fields) {\n var futures = [], fieldsLength = fields.length, checkedFields = [];\n for (var iVal = 0; iVal < fieldsLength; iVal++) {\n var field = fields[iVal], validationRef = field.getAttribute(ATTR_VALIDATOR), validity = field.validity;\n if (this._validators[validationRef]) {\n // use local validation first and then continue with custom validations\n if (Form._shouldNotValidateField(field) || (validity && !validity.customError && !validity.valid)) {\n continue;\n }\n checkedFields.push(field);\n futures.push(this._runValidation(validationRef, field));\n } else {\n if (validationRef) {\n console.warn('data-validate was set but no validator was found');\n }\n }\n }\n return Promise.all(futures).then(function (allFutures) {\n let l = allFutures.length;\n let result = {\n checkedFields: checkedFields,\n foundAnyError: false\n };\n for (var fI = 0; fI < l; fI++) {\n if (!allFutures[fI]) {\n result.foundAnyError = true;\n break;\n }\n }\n return result;\n });\n }\n\n /**\n * Remove all errors for this form\n * @returns {Form}\n */\n removeErrors() {\n this._removeElementErrors(this.form);\n if (this.tooltips) {\n this.tooltips.removeTooltip();\n }\n return this;\n }\n\n /**\n * Will handle errors for given fields\n * @param {Array|NodeList} fields\n * @param {Boolean} removeAllErrors\n */\n prepareErrors(fields, removeAllErrors) {\n if (removeAllErrors) {\n this.removeErrors();\n }\n let labelGroups = {}, invalidFields = [];\n\n function handleAdditionalLabels(isInvalid, thisLabelGroup, field) {\n let additionalLabels = field.getAttribute(ATTR_DATA_CUSTOM_LABEL) ||\n field.id, group = thisLabelGroup[additionalLabels];\n if (additionalLabels) {\n // check additionally if field is currently marked as invalid\n // so the label is not marked as error if no field is marked as one\n group = group ? group : isInvalid;\n thisLabelGroup[additionalLabels] = group;\n }\n }\n\n // We save all validations in an extra property because we need to reset the validity due some\n // implementation errors in other browsers then chrome\n for (let i = 0; i < fields.length; i++) {\n let field = fields[i], errorTarget = Form._findErrorTarget(field), parent = errorTarget.parentNode,\n validity = field.validity, isInvalid = validity && !validity.valid;\n if (Form._shouldNotValidateField(field)) {\n continue;\n }\n field.flexFormsSavedValidity = JSON.parse(JSON.stringify(validity));\n handleAdditionalLabels(isInvalid, labelGroups, field);\n if (isInvalid) {\n if (!removeAllErrors) {\n // Remove current errors:\n this._removeElementErrors(parent);\n }\n // setup custom error messages:\n this._setupErrorMessages(field, validity);\n let msg = field.validationMessage;\n\n // mark fields as invalid\n this._markElementInvalid(errorTarget);\n this._markElementInvalid(field);\n\n if (this.options.appendError) {\n parent.insertAdjacentHTML(\"beforeend\",\n `
${msg}
`);\n }\n invalidFields.push(field);\n field.flexFormsSavedValidationMessage = msg;\n } else {\n // restore invalid fields\n this._markElementValid(errorTarget);\n this._markElementValid(field);\n\n // cleanup\n delete field.flexFormsSavedValidationMessage;\n\n // remove error markup\n this._removeElementErrors(parent);\n }\n // We have to reset the custom validity here to allow native validations work again\n field.setCustomValidity('');\n }\n // if validates a single field we need to check the linked fields to a label:\n if (fields.length === 1) {\n let field = fields[0];\n let id = field.getAttribute(ATTR_DATA_CUSTOM_LABEL) || field.id;\n if (id) {\n let linkedFields = Array.from(\n this.getForm().querySelectorAll(`[${ATTR_DATA_CUSTOM_LABEL}=\"${id}\"], #${id}`));\n linkedFields.forEach(function (thisField) {\n let validity = thisField.validity, isInvalid = validity && !validity.valid &&\n this._isElementInvalidElement(thisField);\n handleAdditionalLabels(isInvalid, labelGroups, thisField);\n }.bind(this));\n }\n }\n this._handleLabels(labelGroups);\n return invalidFields;\n }\n\n /**\n * Validates all custom fields\n * @returns {Promise}\n */\n validateCustomFields() {\n return this._customValidationsForElements(\n this.form.querySelectorAll(\"[data-validate]\"));\n }\n\n /**\n * Tests if a field should be validated\n * @param {HTMLElement} field\n * @returns {boolean}\n * @private\n */\n static _shouldNotValidateField(field) {\n var target = Form._findErrorTarget(field);\n return target instanceof HTMLFieldSetElement || field.validity === undefined ||\n (target.hasAttribute(ATTR_VALIDATE_VISIBILITY) && !Util.isVisible(target));\n }\n\n /**\n * Creates an array from a node list with invalid items\n * This Method expicitly checks if field should not be validated so it can be used to foucs a field\n * @param list\n * @returns {Array}\n * @private\n */\n static _createArrayFromInvalidFieldList(list) {\n var arr = [];\n for (var i = 0; i < list.length; ++i) {\n var n = list[i];\n if (n.validity && !n.validity.valid) {\n if (!Form._shouldNotValidateField(n)) {\n arr.push(n);\n }\n }\n }\n return arr;\n }\n\n\n /**\n * This form\n * @returns {HTMLElement}\n */\n getForm() {\n return this.form;\n }\n\n /**\n * Registers a function that handles remote validation\n * @param {Function} func\n * @returns {Form}\n */\n registerRemoteValidation(func) {\n this._remoteValidationFunction = func;\n return this;\n }\n\n\n /**\n * Formats the error content for the tooltip\n * @param {String} error\n * @returns {String}\n * @private\n */\n _formatErrorTooltip(error) {\n return this.options.formatErrorTooltip.apply(this, [error]);\n }\n\n /**\n * Tries to find a custom error target on given target\n * @param target\n * @returns {HTMLElement}\n * @private\n */\n static _findErrorTarget(target) {\n var el = target.getAttribute(ATTR_ERROR_TARGET_ID) || target,\n foundTarget = el instanceof HTMLElement ? el : global.document.getElementById(el);\n if (!foundTarget) {\n throw 'Given error target did not exsits:' + target;\n }\n return foundTarget;\n }\n\n /**\n * Creates a tooltip at given element, will only create a new instance if not created\n * @param {HTMLElement} target\n * @param {Boolean} [remove]\n */\n showAndOrCreateTooltip(target, remove) {\n var self = this;\n if (!this.tooltips && this.options.createTooltips) {\n this.tooltips = new Tooltip(this.options.tooltipContainer, this.options.tooltipOptions);\n }\n if (!this.options.createTooltips) {\n return false;\n }\n\n if (!target.flexFormsSavedValidity) {\n return false;\n }\n var errorTarget = Form._findErrorTarget(target);\n if (!target.flexFormsSavedValidity.valid && self._isElementInvalidElement(errorTarget)) {\n self.tooltips.createTooltip(errorTarget,\n self._formatErrorTooltip(target.flexFormsSavedValidationMessage), false);\n return true;\n } else {\n if (remove) {\n self.tooltips.removeTooltip();\n }\n }\n return false;\n }\n\n /**\n * Checks if element is marked as invalid\n * @param {HTMLElement} el\n * @returns {boolean}\n * @private\n */\n _isElementInvalidElement(el) {\n return el.hasAttribute(DATA_ELEMENT_INVALID);\n }\n\n /**\n * Handles invalid event of a form\n * @param {Event} e\n * @returns {Promise|boolean}\n * @private\n */\n _checkIsInvalid(e) {\n e.preventDefault();\n var invalidFields = this.getForm().querySelectorAll(\":invalid\");\n return this._handleValidation(invalidFields, true, false);\n }\n\n /**\n * Will query dependent fields (by selector) that should be validated with given field\n * @param field\n * @returns {NodeList|[]}\n * @private\n */\n _getDependentFields(field) {\n let fieldSelector = field.getAttribute(ATTR_DEPENDS), base = [field];\n if (fieldSelector) {\n base.push.apply(base, Array.prototype.slice.apply(\n this.getForm().querySelectorAll(fieldSelector)));\n }\n return base;\n }\n\n /**\n * @private\n * @param {HTMLElement} [target]\n */\n _handleTooltipInline(target) {\n if (this.tooltips) {\n this.tooltips.removeTooltip(target);\n }\n }\n\n /**\n * Initializes validation for a given form, registers event handlers\n */\n initFormValidation() {\n // Suppress the default bubbles\n var form = this.getForm(),\n self = this,\n invalidEvent = 'invalid';\n\n /**\n * Validates if is valid realtime element\n * @param {HTMLElement} target\n * @returns {boolean}\n * @private\n */\n function _checkIsValidRealtimeElement(target) {\n return !target.hasAttribute(ATTR_DISABLE_REALTIME) && !target.hasAttribute(ATTR_DISABLE_INLINE);\n }\n\n form.addEventListener(invalidEvent, function (e) {\n e.preventDefault();\n }, true);\n\n Util.addEventOnce(invalidEvent, form, function handleInvalid(e) {\n self._formLoading();\n var result = self._checkIsInvalid(e);\n if (result) {\n self.currentValidationFuture = new Promise((resolve) => {\n result.then(function (r) {\n setTimeout(function () {\n Util.addEventOnce(invalidEvent, form, handleInvalid, true);\n }, 0);\n resolve(r);\n self._formStopLoading();\n if (!r.foundAnyError) {\n self._formLoading();\n self._handleSubmit(e);\n }\n });\n });\n }\n }, true);\n\n this.addEventListener(form, 'reset', () => {\n this.removeErrors();\n });\n\n // Timeout for keys:\n var TIMEOUT_KEYDOWN, KEYDOWN_RUNNING = false;\n\n // resets keydown events\n function clearKeyDownTimeout() {\n KEYDOWN_RUNNING = false;\n clearTimeout(TIMEOUT_KEYDOWN);\n }\n\n // setup custom realtime event if given\n if (self.options.realtime) {\n this.addEventListener(form, CONST_REALTIME_EVENT, function (e) {\n if (self._formIsLoading()) {\n return;\n }\n var target = e.target;\n clearTimeout(TIMEOUT_KEYDOWN);\n if (KEYDOWN_RUNNING) {\n return;\n }\n TIMEOUT_KEYDOWN = setTimeout(() => {\n let isStillTarget = document.activeElement === e.target;\n if (!_checkIsValidRealtimeElement(target)) {\n return;\n }\n if (isStillTarget) {\n self._handleTooltipInline();\n }\n KEYDOWN_RUNNING = true;\n let dependentFields = self._getDependentFields(target);\n self._customValidationsForElements(dependentFields).then(function () {\n self.prepareErrors(dependentFields, false);\n if (isStillTarget) {\n self.showAndOrCreateTooltip(e.target);\n }\n // future must be resolved before another event can be started\n KEYDOWN_RUNNING = false;\n });\n }, self.options.realtimeTimeout);\n }, true);\n }\n\n /**\n * Validates if target is a valid input field to check blur and focus events\n *\n * @param {HTMLElement} target\n * @returns {boolean}\n * @private\n */\n function _checkIsValidBlurFocusElement(target) {\n let attr = target.getAttribute(\"type\");\n return (attr !== \"radio\" && attr !== \"checkbox\" && attr !== \"submit\");\n }\n\n /**\n * Validates if is valid inline-check element\n * @param {HTMLElement} target\n * @returns {boolean}\n * @private\n */\n function _checkIsValidInlineCheckElement(target) {\n return !target.hasAttribute(ATTR_DISABLE_INLINE);\n }\n\n this.addEventListener(form, 'blur', function (e) {\n // do not hide tooltip after change event\n if (!e.target.flexcssKeepTooltips) {\n self._handleTooltipInline(e.target);\n }\n delete e.target.flexcssKeepTooltips;\n }, true);\n\n // handle focus on input elements\n // will show an error if field is invalid\n this.addEventListener(form, \"focus\", function (e) {\n if (self._formIsLoading()) {\n return;\n }\n // do not track errors for checkbox and radios on focus:\n if (!_checkIsValidBlurFocusElement(e.target)) {\n return;\n }\n // we need to delay this a little, because Firefox and Safari do not show a tooltip after it\n // just have been hidden (on blur). Maybe fix this with a queue later\n setTimeout(function () {\n self.showAndOrCreateTooltip(e.target);\n }, FOCUS_TOOLTIP_DELAY);\n }, true);\n\n if (self.options.inlineValidation) {\n // Handle change for checkbox, radios and selects\n this.addEventListener(form, \"change\", function (e) {\n const target = e.target;\n if (self._formIsLoading() || !_checkIsValidInlineCheckElement(target)) {\n return;\n }\n clearKeyDownTimeout();\n const name = target.getAttribute('name');\n let inputs = name ? form.querySelectorAll('[name=\"' + name + '\"]') : [target];\n // we only support dependent fields for a single widgets right now\n if (inputs.length === 1) {\n inputs = self._getDependentFields(target);\n }\n self._customValidationsForElements(inputs).then(function () {\n self.prepareErrors(inputs, false);\n target.flexcssKeepTooltips = self.showAndOrCreateTooltip(target, true);\n if (target.flexcssKeepTooltips) {\n self._handleTooltipHideClickAfterChange();\n }\n });\n });\n }\n\n // prevent default if form is invalid\n this.addEventListener(form, \"submit\", function listener(e) {\n self._submitListener(e, listener);\n });\n\n Event.dispatchAndFire(form, EVENT_FORM_READY);\n }\n\n /* Loading states, unfortunately we can't check if a promise is pending :/*/\n /* TODO: Maybe wrap promise to extend this functionality */\n\n _formLoading() {\n this.getForm().classList.add(LOADING_CLASS);\n }\n\n _formStopLoading() {\n this.getForm().classList.remove(LOADING_CLASS);\n }\n\n _formIsLoading() {\n return this.getForm().classList.contains(LOADING_CLASS);\n }\n\n // this defines the logic after a change event when a tooltip is shown\n // because we call this method inside the change event, the click would be immeditally executed with the change\n // event when not using setTimeout(). There might be another solution for this...\n _handleTooltipHideClickAfterChange() {\n const self = this;\n if (this.options.createTooltips) {\n setTimeout(function () {\n Util.addEventOnce(Settings.getTabEvent(), global.document.body, function (t) {\n if (!self._isElementInvalidElement(t.target)) {\n self._handleTooltipInline();\n }\n });\n }, CLICK_TOOLTIP_DELAY);\n }\n }\n\n _focusElement(el) {\n el.focus();\n Util.scrollToElement(el, this.options.scrollToElementDiff);\n }\n\n /**\n * Listener that is executed on form submit\n * @param e\n * @param submitListener\n * @returns {boolean}\n * @private\n */\n _submitListener(e, submitListener) {\n\n const form = this.getForm(),\n self = this,\n submitEvent = 'submit';\n\n if (this._formIsLoading()) {\n e.preventDefault();\n return false;\n }\n this._formLoading();\n form.removeEventListener(submitEvent, submitListener);\n this.removeErrors();\n e.preventDefault();\n // reset:\n if (form.checkValidity()) {\n form.addEventListener(submitEvent, submitListener);\n // It's possible that the form is valid but the custom validations need to be checked again:\n self.currentValidationFuture = new Promise((resolve) => {\n var validation = self.validateCustomFields();\n validation.then(function (r) {\n // because custom validators may mark multiple fields as invalid, we get all of them in the form\n var fields = self._getInvalidElements(),\n errors = self.prepareErrors(fields, false), firstError = errors[0];\n if (firstError) {\n self._focusElement(firstError);\n self.showAndOrCreateTooltip(firstError, true);\n }\n resolve(r);\n });\n });\n self.currentValidationFuture.then(function (r) {\n if (!r.foundAnyError) {\n // Handle submitting the form to server:\n self._handleSubmit(e);\n } else {\n self._formStopLoading();\n }\n });\n } else {\n self._formStopLoading();\n form.addEventListener(submitEvent, submitListener);\n }\n }\n\n\n /**\n * Handles submitting, optionally allows to stop submitting\n * @param e\n * @private\n */\n _handleSubmit(e) {\n this._submitFunction(this.form, e);\n }\n\n\n /**\n * Registers a global event Handler\n * @param errorFunc\n */\n static registerErrorMessageHandler(errorFunc) {\n Form.globalErrorMessageHandler = errorFunc;\n }\n\n /**\n * Initialize forms for a specific selector\n * @param {String} selector\n * @param {Object} [options]\n * @return {array.}\n */\n static init(selector, options) {\n var forms = selector instanceof HTMLElement ? selector.querySelectorAll('form') :\n document.querySelectorAll(selector), instances = [];\n for (var i = 0; i < forms.length; i++) {\n instances.push(new Form(forms[i], options));\n }\n return instances;\n }\n\n\n /**\n * Registers a global validator that is usable on all form instances\n * @param {String} name\n * @param {Function} validator\n * @returns {Function}\n */\n static registerValidator(name, validator) {\n Form.globalValidators[name] = validator;\n return Form;\n }\n\n /**\n * Registers a global function that is called when a form should validate the response of a server\n * @param {Function} func\n * @returns {Form}\n */\n static registerGlobalRemoteValidationFunction(func) {\n Form.globalRemoteValidationFunction = func;\n return Form;\n }\n}\n\n\n/**\n * Global validators\n * @type {Array}\n */\nForm.globalValidators = [];\n\n/**\n * Global Remote validation function\n */\nForm.globalRemoteValidationFunction = function () {\n};\n\n/**\n * Handles custom error messages extracts custom message by default\n */\nForm.globalErrorMessageHandler = (field, validity) => {\n if (!validity.customError) {\n let customMsg = field.getAttribute(ATTR_DATA_CUSTOM_MESSAGE);\n if (customMsg) {\n field.setCustomValidity(customMsg);\n }\n }\n};\n\nexport default Form;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/main/Form.js\n **/","// the whatwg-fetch polyfill installs the fetch() function\n// on the global object (window or self)\n//\n// Return that as the export for use in Webpack, Browserify etc.\nrequire('whatwg-fetch');\nmodule.exports = self.fetch.bind(self);\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/isomorphic-fetch/fetch-npm-browserify.js\n ** module id = 11\n ** module chunks = 0 1\n **/","(function(self) {\n 'use strict';\n\n if (self.fetch) {\n return\n }\n\n function normalizeName(name) {\n if (typeof name !== 'string') {\n name = String(name)\n }\n if (/[^a-z0-9\\-#$%&'*+.\\^_`|~]/i.test(name)) {\n throw new TypeError('Invalid character in header field name')\n }\n return name.toLowerCase()\n }\n\n function normalizeValue(value) {\n if (typeof value !== 'string') {\n value = String(value)\n }\n return value\n }\n\n function Headers(headers) {\n this.map = {}\n\n if (headers instanceof Headers) {\n headers.forEach(function(value, name) {\n this.append(name, value)\n }, this)\n\n } else if (headers) {\n Object.getOwnPropertyNames(headers).forEach(function(name) {\n this.append(name, headers[name])\n }, this)\n }\n }\n\n Headers.prototype.append = function(name, value) {\n name = normalizeName(name)\n value = normalizeValue(value)\n var list = this.map[name]\n if (!list) {\n list = []\n this.map[name] = list\n }\n list.push(value)\n }\n\n Headers.prototype['delete'] = function(name) {\n delete this.map[normalizeName(name)]\n }\n\n Headers.prototype.get = function(name) {\n var values = this.map[normalizeName(name)]\n return values ? values[0] : null\n }\n\n Headers.prototype.getAll = function(name) {\n return this.map[normalizeName(name)] || []\n }\n\n Headers.prototype.has = function(name) {\n return this.map.hasOwnProperty(normalizeName(name))\n }\n\n Headers.prototype.set = function(name, value) {\n this.map[normalizeName(name)] = [normalizeValue(value)]\n }\n\n Headers.prototype.forEach = function(callback, thisArg) {\n Object.getOwnPropertyNames(this.map).forEach(function(name) {\n this.map[name].forEach(function(value) {\n callback.call(thisArg, value, name, this)\n }, this)\n }, this)\n }\n\n function consumed(body) {\n if (body.bodyUsed) {\n return Promise.reject(new TypeError('Already read'))\n }\n body.bodyUsed = true\n }\n\n function fileReaderReady(reader) {\n return new Promise(function(resolve, reject) {\n reader.onload = function() {\n resolve(reader.result)\n }\n reader.onerror = function() {\n reject(reader.error)\n }\n })\n }\n\n function readBlobAsArrayBuffer(blob) {\n var reader = new FileReader()\n reader.readAsArrayBuffer(blob)\n return fileReaderReady(reader)\n }\n\n function readBlobAsText(blob) {\n var reader = new FileReader()\n reader.readAsText(blob)\n return fileReaderReady(reader)\n }\n\n var support = {\n blob: 'FileReader' in self && 'Blob' in self && (function() {\n try {\n new Blob();\n return true\n } catch(e) {\n return false\n }\n })(),\n formData: 'FormData' in self,\n arrayBuffer: 'ArrayBuffer' in self\n }\n\n function Body() {\n this.bodyUsed = false\n\n\n this._initBody = function(body) {\n this._bodyInit = body\n if (typeof body === 'string') {\n this._bodyText = body\n } else if (support.blob && Blob.prototype.isPrototypeOf(body)) {\n this._bodyBlob = body\n } else if (support.formData && FormData.prototype.isPrototypeOf(body)) {\n this._bodyFormData = body\n } else if (!body) {\n this._bodyText = ''\n } else if (support.arrayBuffer && ArrayBuffer.prototype.isPrototypeOf(body)) {\n // Only support ArrayBuffers for POST method.\n // Receiving ArrayBuffers happens via Blobs, instead.\n } else {\n throw new Error('unsupported BodyInit type')\n }\n\n if (!this.headers.get('content-type')) {\n if (typeof body === 'string') {\n this.headers.set('content-type', 'text/plain;charset=UTF-8')\n } else if (this._bodyBlob && this._bodyBlob.type) {\n this.headers.set('content-type', this._bodyBlob.type)\n }\n }\n }\n\n if (support.blob) {\n this.blob = function() {\n var rejected = consumed(this)\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return Promise.resolve(this._bodyBlob)\n } else if (this._bodyFormData) {\n throw new Error('could not read FormData body as blob')\n } else {\n return Promise.resolve(new Blob([this._bodyText]))\n }\n }\n\n this.arrayBuffer = function() {\n return this.blob().then(readBlobAsArrayBuffer)\n }\n\n this.text = function() {\n var rejected = consumed(this)\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return readBlobAsText(this._bodyBlob)\n } else if (this._bodyFormData) {\n throw new Error('could not read FormData body as text')\n } else {\n return Promise.resolve(this._bodyText)\n }\n }\n } else {\n this.text = function() {\n var rejected = consumed(this)\n return rejected ? rejected : Promise.resolve(this._bodyText)\n }\n }\n\n if (support.formData) {\n this.formData = function() {\n return this.text().then(decode)\n }\n }\n\n this.json = function() {\n return this.text().then(JSON.parse)\n }\n\n return this\n }\n\n // HTTP methods whose capitalization should be normalized\n var methods = ['DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT']\n\n function normalizeMethod(method) {\n var upcased = method.toUpperCase()\n return (methods.indexOf(upcased) > -1) ? upcased : method\n }\n\n function Request(input, options) {\n options = options || {}\n var body = options.body\n if (Request.prototype.isPrototypeOf(input)) {\n if (input.bodyUsed) {\n throw new TypeError('Already read')\n }\n this.url = input.url\n this.credentials = input.credentials\n if (!options.headers) {\n this.headers = new Headers(input.headers)\n }\n this.method = input.method\n this.mode = input.mode\n if (!body) {\n body = input._bodyInit\n input.bodyUsed = true\n }\n } else {\n this.url = input\n }\n\n this.credentials = options.credentials || this.credentials || 'omit'\n if (options.headers || !this.headers) {\n this.headers = new Headers(options.headers)\n }\n this.method = normalizeMethod(options.method || this.method || 'GET')\n this.mode = options.mode || this.mode || null\n this.referrer = null\n\n if ((this.method === 'GET' || this.method === 'HEAD') && body) {\n throw new TypeError('Body not allowed for GET or HEAD requests')\n }\n this._initBody(body)\n }\n\n Request.prototype.clone = function() {\n return new Request(this)\n }\n\n function decode(body) {\n var form = new FormData()\n body.trim().split('&').forEach(function(bytes) {\n if (bytes) {\n var split = bytes.split('=')\n var name = split.shift().replace(/\\+/g, ' ')\n var value = split.join('=').replace(/\\+/g, ' ')\n form.append(decodeURIComponent(name), decodeURIComponent(value))\n }\n })\n return form\n }\n\n function headers(xhr) {\n var head = new Headers()\n var pairs = xhr.getAllResponseHeaders().trim().split('\\n')\n pairs.forEach(function(header) {\n var split = header.trim().split(':')\n var key = split.shift().trim()\n var value = split.join(':').trim()\n head.append(key, value)\n })\n return head\n }\n\n Body.call(Request.prototype)\n\n function Response(bodyInit, options) {\n if (!options) {\n options = {}\n }\n\n this.type = 'default'\n this.status = options.status\n this.ok = this.status >= 200 && this.status < 300\n this.statusText = options.statusText\n this.headers = options.headers instanceof Headers ? options.headers : new Headers(options.headers)\n this.url = options.url || ''\n this._initBody(bodyInit)\n }\n\n Body.call(Response.prototype)\n\n Response.prototype.clone = function() {\n return new Response(this._bodyInit, {\n status: this.status,\n statusText: this.statusText,\n headers: new Headers(this.headers),\n url: this.url\n })\n }\n\n Response.error = function() {\n var response = new Response(null, {status: 0, statusText: ''})\n response.type = 'error'\n return response\n }\n\n var redirectStatuses = [301, 302, 303, 307, 308]\n\n Response.redirect = function(url, status) {\n if (redirectStatuses.indexOf(status) === -1) {\n throw new RangeError('Invalid status code')\n }\n\n return new Response(null, {status: status, headers: {location: url}})\n }\n\n self.Headers = Headers;\n self.Request = Request;\n self.Response = Response;\n\n self.fetch = function(input, init) {\n return new Promise(function(resolve, reject) {\n var request\n if (Request.prototype.isPrototypeOf(input) && !init) {\n request = input\n } else {\n request = new Request(input, init)\n }\n\n var xhr = new XMLHttpRequest()\n\n function responseURL() {\n if ('responseURL' in xhr) {\n return xhr.responseURL\n }\n\n // Avoid security warnings on getResponseHeader when not allowed by CORS\n if (/^X-Request-URL:/m.test(xhr.getAllResponseHeaders())) {\n return xhr.getResponseHeader('X-Request-URL')\n }\n\n return;\n }\n\n xhr.onload = function() {\n var status = (xhr.status === 1223) ? 204 : xhr.status\n if (status < 100 || status > 599) {\n reject(new TypeError('Network request failed'))\n return\n }\n var options = {\n status: status,\n statusText: xhr.statusText,\n headers: headers(xhr),\n url: responseURL()\n }\n var body = 'response' in xhr ? xhr.response : xhr.responseText;\n resolve(new Response(body, options))\n }\n\n xhr.onerror = function() {\n reject(new TypeError('Network request failed'))\n }\n\n xhr.open(request.method, request.url, true)\n\n if (request.credentials === 'include') {\n xhr.withCredentials = true\n }\n\n if ('responseType' in xhr && support.blob) {\n xhr.responseType = 'blob'\n }\n\n request.headers.forEach(function(value, name) {\n xhr.setRequestHeader(name, value)\n })\n\n xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit)\n })\n }\n self.fetch.polyfill = true\n})(typeof self !== 'undefined' ? self : this);\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/whatwg-fetch/fetch.js\n ** module id = 12\n ** module chunks = 0 1\n **/","'use strict';\n\nimport Form from '../Form';\nimport Tooltip from '../Tooltip';\nimport Settings from '../util/Settings';\n\n// default export as component object\nexport default {\n Form,\n Settings,\n Tooltip\n};\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/main/modules/Form.js\n **/"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack:///webpack/universalModuleDefinition?5ca6","webpack:///js/form.min.js","webpack:///webpack/bootstrap a32af781d3d6caa30484?a65b","webpack:///./src/main/util/Util.js?5bc4","webpack:///./src/main/util/Settings.js?b01f","webpack:///./src/main/util/Event.js?68bf","webpack:///./src/main/DestroyableWidget.js?8d9b","webpack:///./src/main/Tooltip.js?3890","webpack:///./src/main/Form.js?18a8","webpack:///./~/isomorphic-fetch/fetch-npm-browserify.js?7723","webpack:///./~/whatwg-fetch/fetch.js?1c20","webpack:///./src/main/modules/Form.js"],"names":["root","factory","exports","module","define","amd","this","modules","__webpack_require__","moduleId","installedModules","id","loaded","call","m","c","p","global","_classCallCheck","instance","Constructor","TypeError","Object","defineProperty","value","_createClass","defineProperties","target","props","i","length","descriptor","enumerable","configurable","writable","key","protoProps","staticProps","prototype","PFX","COL_LEFT_CLASS","COL_RIGHT_CLASS","COL_BOTTOM_CLASS","Util","element","type","callback","thisFunction","e","apply","thisType","toLowerCase","name","addEventListener","t","el","document","createElement","transitions","transition","OTransition","MozTransition","WebkitTransition","undefined","style","parent","now","parentNode","func","s4","Math","floor","random","toString","substring","doc","inner","width","height","outer","position","top","left","visibility","overflow","appendChild","body","w1","offsetWidth","w2","clientWidth","removeChild","ev","capture","event","removeEventListener","offsetHeight","str","replace","g","toUpperCase","input","JSON","parse","stringify","base","attrs","attributes","attr","s","dashToCamelCase","nodeName","val","nodeValue","hasOwnProperty","parseInt","elementToPosition","collisionContainer","centerHorizontal","positionTop","amountTop","amountLeft","parentsUntil","HTMLElement","window","getComputedStyle","isPartOfNode","offsetTop","offsetLeft","targetPosition","getBoundingClientRect","elementRect","colRect","targetTop","targetRight","right","isCollisionTop","isCollisionBottom","innerHeight","isCollisionLeft","targetLeft","isCollisionRight","classList","remove","calcTop","calcLeft","add","rightPosition","leftCentered","collisionCentered","cssText","optionalOffset","scrollIntoView","thisOffset","scrolledY","pageYOffset","scroll","_interopRequireDefault","obj","__esModule","default","_Util","_Util2","FLEXCSS_GLOBAL_SETTINGS","smallBreakpoint","scrollbarUpdateNodes","darkenerFadeDelay","canvasToggledClass","FLEXCSS_CONST_IS_IOS","FLEXCSS_CONST_IS_TOUCH","FLEXCSS_CONST_IS_IE","FLEXCSS_CONST_TAB_EVENT","FLEXCSS_IS_SMALL_SCREEN","init","FLEXCSS_CONST_SCROLLBAR_WIDTH","getScrollBarWidth","FLEXCSS_CONST_TRANSITION_EVENT","whichTransitionEndEvent","readyState","Settings","settings","assign","navigator","userAgent","match","innerWidth","get","msMaxTouchPoints","CustomEvent","_CustomEvent","params","thisParams","bubbles","cancelable","detail","evt","createEvent","initCustomEvent","Event","EventHandler","defaultOptions","options","withDetail","originalEvent","o","dispatchEvent","withOptions","fire","DestroyableWidget","listeners","forEach","listener","args","push","_possibleConstructorReturn","self","ReferenceError","_inherits","subClass","superClass","create","constructor","setPrototypeOf","__proto__","_get","object","property","receiver","Function","desc","getOwnPropertyDescriptor","getPrototypeOf","getter","_DestroyableWidget2","_DestroyableWidget3","_Settings","_Settings2","CLASS_NAMES_TOOLTIP","CLASS_NAMES_OPEN","ATTR_DATA_CLASSNAME","ATTR_DATA_NO_TOUCH","Tooltip","_DestroyableWidget","DelegateContainer","_this","container","getElementById","Error","tooltipContainer","containerClass","selectorAttribute","text","removeTitle","positionRelative","trim","isTouchDevice","hasAttribute","_restoreClassNames","innerHTML","flexTooltipCurrentTarget","oldTitle","removeAttribute","setupPositionNearby","classNames","maybeTargetClass","getAttribute","className","join","selfTarget","setAttribute","createTooltip","removeTooltip","EVENT_FORM_AJAX_COMPLETED","EVENT_FORM_AFTER_AJAX_SUBMIT","EVENT_FORM_SUBMIT","EVENT_FORM_READY","_Tooltip","_Tooltip2","_Event","_Event2","LOADING_CLASS","DATA_ELEMENT_INVALID","REMOTE","REMOTE_ACTION","ATTR_DISABLE_INLINE","ATTR_DISABLE_REALTIME","ATTR_VALIDATOR","ATTR_DATA_CUSTOM_MESSAGE","ATTR_DATA_CUSTOM_LABEL","ATTR_VALIDATE_VISIBILITY","ATTR_ERROR_TARGET_ID","ATTR_DEPENDS","CONST_USE_JSON","CONST_REALTIME_EVENT","FOCUS_TOOLTIP_DELAY","CLICK_TOOLTIP_DELAY","Form","form","HTMLFormElement","tooltips","currentValidationFuture","Promise","createTooltips","appendError","ajaxSubmitType","ajaxJsonContentType","inlineValidation","realtime","realtimeTimeout","formatErrorTooltip","error","inputErrorClass","containerErrorClass","fetchOptions","credentials","tooltipOptions","scrollToElementDiff","applyOptionsFromElement","hfWidgetInstance","_validators","globalValidators","_remoteValidationFunction","initFormValidation","destroy","thisForm","shouldUseAjax","ajaxPostUrl","location","href","useJson","dispatch","withOriginal","defaultPrevented","_formStopLoading","submit","preventDefault","defaultHeaders","X-Requested-With","Content-Type","headers","method","serverCall","fetch","serialize","FormData","then","r","globalRemoteValidationFunction","response","selectors","inputs","querySelectorAll","result","Array","exists","field","focus","_this2","fields","NodeList","_handleValidation","foundAnyError","bind","toValidateFields","scoped","arr","_createArrayFromInvalidFieldList","isLocalInvalid","_focusElement","validation","_customValidationsForElements","validateCustomFields","thisToValidateFields","from","concat","checkedFields","foundInvalidFields","prepareErrors","firstInvalidField","activeElement","_handleTooltipHideClickAfterChange","showAndOrCreateTooltip","validity","globalErrorMessageHandler","keys","labels","getForm","invalid","labelsIndex","labelEl","_markElementInvalid","_markElementValid","filter","HTMLFieldSetElement","thisParent","errors","inputsWithErrorClasses","elementErrorIndex","inputErrorIndex","validator","validationRef","cl","future","futures","fieldsLength","iVal","_shouldNotValidateField","customError","valid","_runValidation","console","warn","all","allFutures","l","fI","_removeElementErrors","removeAllErrors","handleAdditionalLabels","isInvalid","thisLabelGroup","additionalLabels","group","removeErrors","labelGroups","invalidFields","errorTarget","_findErrorTarget","flexFormsSavedValidity","_setupErrorMessages","msg","validationMessage","insertAdjacentHTML","flexFormsSavedValidationMessage","setCustomValidity","_field","linkedFields","thisField","_isElementInvalidElement","_handleLabels","_formatErrorTooltip","fieldSelector","slice","_checkIsValidRealtimeElement","clearKeyDownTimeout","KEYDOWN_RUNNING","clearTimeout","TIMEOUT_KEYDOWN","_checkIsValidBlurFocusElement","_checkIsValidInlineCheckElement","_this3","invalidEvent","addEventOnce","handleInvalid","_formLoading","_checkIsInvalid","resolve","setTimeout","_handleSubmit","_formIsLoading","isStillTarget","_handleTooltipInline","dependentFields","_getDependentFields","flexcssKeepTooltips","_submitListener","dispatchAndFire","contains","getTabEvent","scrollToElement","submitListener","submitEvent","checkValidity","_getInvalidElements","firstError","_submitFunction","isVisible","list","n","foundTarget","errorFunc","selector","forms","instances","customMsg","normalizeName","String","test","normalizeValue","Headers","map","append","getOwnPropertyNames","consumed","bodyUsed","reject","fileReaderReady","reader","onload","onerror","readBlobAsArrayBuffer","blob","FileReader","readAsArrayBuffer","readBlobAsText","readAsText","Body","_initBody","_bodyInit","_bodyText","support","Blob","isPrototypeOf","_bodyBlob","formData","_bodyFormData","arrayBuffer","ArrayBuffer","set","rejected","decode","json","normalizeMethod","upcased","methods","indexOf","Request","url","mode","referrer","split","bytes","shift","decodeURIComponent","xhr","head","pairs","getAllResponseHeaders","header","Response","bodyInit","status","ok","statusText","values","getAll","has","thisArg","clone","redirectStatuses","redirect","RangeError","responseURL","getResponseHeader","request","XMLHttpRequest","responseText","open","withCredentials","responseType","setRequestHeader","send","polyfill","_Form","_Form2"],"mappings":"CAAA,SAAAA,EAAAC,GACA,gBAAAC,UAAA,gBAAAC,QACAA,OAAAD,QAAAD,IACA,kBAAAG,gBAAAC,IACAD,UAAAH,GACA,gBAAAC,SACAA,QAAA,QAAAD,IAEAD,EAAA,QAAAC,KACCK,KAAA,WACD,MCAgB,UAAUC,GCN1B,QAAAC,GAAAC,GAGA,GAAAC,EAAAD,GACA,MAAAC,GAAAD,GAAAP,OAGA,IAAAC,GAAAO,EAAAD,IACAP,WACAS,GAAAF,EACAG,QAAA,EAUA,OANAL,GAAAE,GAAAI,KAAAV,EAAAD,QAAAC,IAAAD,QAAAM,GAGAL,EAAAS,QAAA,EAGAT,EAAAD,QAvBA,GAAAQ,KAqCA,OATAF,GAAAM,EAAAP,EAGAC,EAAAO,EAAAL,EAGAF,EAAAQ,EAAA,MAGAR,EAAA,KDgBM,SAASL,EAAQD,EAASM,GAE/BL,EAAOD,QAAUM,EAAoB,KAKhC,SAASL,EAAQD,IAEM,SAASe,GAAS,YAQ9C,SAASC,GAAgBC,EAAUC,GAAe,KAAMD,YAAoBC,IAAgB,KAAM,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AA,GAAA1d,WAAA,0BAGA,IAAAoL,IACAoV,SACAE,WAAAT,EAAAS,WACA5M,UAAAmM,GACAP,IAAAyB,KAEAld,EAAA,YAAAgc,KAAA1L,SAAA0L,EAAAsB,YACApG,GAAA,GAAAmF,GAAArc,EAAAmH,KAGA6U,EAAAnC,QAAA,WACAJ,EAAA,GAAA1d,WAAA,4BAGAigB,EAAAuB,KAAAH,EAAAtN,OAAAsN,EAAA3B,KAAA,GAEA,YAAA2B,EAAAhP,cACA4N,EAAAwB,iBAAA,GAGA,gBAAAxB,IAAAxB,EAAAT,OACAiC,EAAAyB,aAAA;AAGAL,EAAAvN,QAAAjI,QAAA,SAAA1L,EAAA4B,GACAke,EAAA0B,iBAAA5f,EAAA5B,KAGA8f,EAAA2B,KAAA,mBAAAP,GAAA9C,UAAA,KAAA8C,EAAA9C,cAGArS,EAAA+H,MAAA4N,UAAA,IACC,mBAAA3V,WAAAjN,OT68EO,CACA,CACA,CACA,CACA,CAEF,SAASH,EAAQD,EAASM,GUv1FhC,YV22FC,SAASqJ,GAAuBC,GAAO,MAAOA,IAAOA,EAAIC,WAAaD,GAAQE,UAASF,GAhBvFxI,OAAOC,eAAerB,EAAS,cAC3BsB,OAAO,GAGX,IAAI2hB,GAAQ3iB,EAAoB,GAE5B4iB,EAASvZ,EAAuBsZ,GAEhC/R,EAAW5Q,EAAoB,GAE/B6Q,EAAYxH,EAAuBuH,GAEnCzC,EAAYnO,EAAoB,GAEhCoO,EAAa/E,EAAuB8E,EAKxCzO,eUt2FGsS,KAAA4Q,aACAjY,SAAAyD,aACAK,QAAAoC","file":"js/form.min.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"FlexCss\"] = factory();\n\telse\n\t\troot[\"FlexCss\"] = factory();\n})(this, function() {\nreturn \n\n\n/** WEBPACK FOOTER **\n ** webpack/universalModuleDefinition\n **/","(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"FlexCss\"] = factory();\n\telse\n\t\troot[\"FlexCss\"] = factory();\n})(this, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId])\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\texports: {},\n/******/ \t\t\tid: moduleId,\n/******/ \t\t\tloaded: false\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.loaded = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"../\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tmodule.exports = __webpack_require__(18);\n\n\n/***/ },\n/* 1 */\n/***/ function(module, exports) {\n\n\t/* WEBPACK VAR INJECTION */(function(global) {\"use strict\";\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\t/*\n\t * The MIT License (MIT)\n\t *\n\t * Copyright (c) 2015 David Heidrich, BowlingX \n\t *\n\t * Permission is hereby granted, free of charge, to any person obtaining a copy\n\t * of this software and associated documentation files (the \"Software\"), to deal\n\t * in the Software without restriction, including without limitation the rights\n\t * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n\t * copies of the Software, and to permit persons to whom the Software is\n\t * furnished to do so, subject to the following conditions:\n\t *\n\t * The above copyright notice and this permission notice shall be included in\n\t * all copies or substantial portions of the Software.\n\t *\n\t * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n\t * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n\t * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n\t * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n\t * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n\t * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n\t * THE SOFTWARE.\n\t */\n\t\n\tvar PFX = [\"webkit\", \"moz\", \"MS\", \"o\", \"\"];\n\t\n\tvar COL_LEFT_CLASS = 'is-collision-left';\n\t\n\tvar COL_RIGHT_CLASS = 'is-collision-right';\n\t\n\tvar COL_BOTTOM_CLASS = 'is-collision-bottom';\n\t\n\t/**\n\t * Provides shared DOM-Utility functions\n\t */\n\t\n\tvar Util = function () {\n\t function Util() {\n\t _classCallCheck(this, Util);\n\t }\n\t\n\t _createClass(Util, null, [{\n\t key: \"prefixedAnimateEvent\",\n\t\n\t\n\t /**\n\t * Will register the right animation event based on browser\n\t * @param element\n\t * @param type\n\t * @param callback\n\t */\n\t value: function prefixedAnimateEvent(element, type, callback) {\n\t var thisFunction = function thisFunction(e) {\n\t callback.apply(element, [e, thisFunction]);\n\t };\n\t\n\t for (var p = 0; p < PFX.length; p++) {\n\t var thisType = type;\n\t if (!PFX[p]) {\n\t thisType = type.toLowerCase();\n\t }\n\t var name = PFX[p] + thisType;\n\t element.addEventListener(name, thisFunction, true);\n\t }\n\t }\n\t\n\t /**\n\t * Get correct transitionend event\n\t * @returns {String}\n\t * @private\n\t */\n\t\n\t }, {\n\t key: \"whichTransitionEndEvent\",\n\t value: function whichTransitionEndEvent() {\n\t var t = void 0;\n\t var el = document.createElement('fake');\n\t\n\t var transitions = {\n\t transition: 'transitionend',\n\t OTransition: 'oTransitionEnd',\n\t MozTransition: 'transitionend',\n\t WebkitTransition: 'webkitTransitionEnd'\n\t };\n\t\n\t for (t in transitions) {\n\t if (el.style[t] !== undefined) {\n\t return transitions[t];\n\t }\n\t }\n\t }\n\t\n\t /**\n\t * Check if target is part of parent node\n\t * @param target\n\t * @param parent\n\t * @returns {boolean}\n\t */\n\t\n\t }, {\n\t key: \"isPartOfNode\",\n\t value: function isPartOfNode(target, parent) {\n\t if (!target || !parent) {\n\t return false;\n\t }\n\t var now = target;\n\t while (now !== parent && now !== null) {\n\t if (now === parent) {\n\t break;\n\t }\n\t now = now.parentNode;\n\t }\n\t return now !== null;\n\t }\n\t\n\t /**\n\t * Finds the closest element including itself matching a callback\n\t * @param {Node} el\n\t * @param {Function} callback\n\t * @returns {Node|boolean}\n\t */\n\t\n\t }, {\n\t key: \"closestCallback\",\n\t value: function closestCallback(el, callback) {\n\t var element = el;\n\t while (element !== null) {\n\t if (callback(element)) {\n\t return element;\n\t }\n\t element = element.parentNode;\n\t }\n\t return false;\n\t }\n\t\n\t /**\n\t * Walks the tree until func returns true for given argument\n\t * @param target\n\t * @param func\n\t * @returns {boolean|HTMLElement}\n\t */\n\t\n\t }, {\n\t key: \"parentsUntil\",\n\t value: function parentsUntil(target, func) {\n\t if (!target) {\n\t return false;\n\t }\n\t var now = target;\n\t while (!func(now) && now !== null) {\n\t now = now.parentNode;\n\t }\n\t\n\t return now;\n\t }\n\t\n\t /**\n\t * Generates a unique id\n\t * @return {String}\n\t */\n\t\n\t }, {\n\t key: \"guid\",\n\t value: function guid() {\n\t function s4() {\n\t return Math.floor((1 + Math.random()) * 0x10000).toString(16).substring(1);\n\t }\n\t\n\t return s4() + s4() + \"-\" + s4() + \"-\" + s4() + \"-\" + s4() + \"-\" + (s4() + s4() + s4());\n\t }\n\t\n\t /**\n\t * Detects scrollbar width\n\t * @see http://stackoverflow.com/questions/986937/how-can-i-get-the-browsers-scrollbar-sizes\n\t * @returns {number}\n\t */\n\t\n\t }, {\n\t key: \"getScrollBarWidth\",\n\t value: function getScrollBarWidth() {\n\t var doc = global.document;\n\t var inner = doc.createElement('p');\n\t\n\t inner.style.width = \"100%\";\n\t inner.style.height = \"200px\";\n\t\n\t var outer = doc.createElement('div');\n\t outer.style.position = \"absolute\";\n\t outer.style.top = \"0px\";\n\t outer.style.left = \"0px\";\n\t outer.style.visibility = \"hidden\";\n\t outer.style.width = \"200px\";\n\t outer.style.height = \"150px\";\n\t outer.style.overflow = \"hidden\";\n\t outer.appendChild(inner);\n\t\n\t doc.body.appendChild(outer);\n\t var w1 = inner.offsetWidth;\n\t outer.style.overflow = 'scroll';\n\t var w2 = inner.offsetWidth;\n\t if (w1 === w2) {\n\t w2 = outer.clientWidth;\n\t }\n\t doc.body.removeChild(outer);\n\t\n\t return w1 - w2;\n\t }\n\t\n\t /**\n\t * Run an event once\n\t * @param {String} ev\n\t * @param {HTMLElement|HTMLDocument} target\n\t * @param {Function} func\n\t * @param {boolean} [capture]\n\t * @return Function created listener\n\t */\n\t\n\t }, {\n\t key: \"addEventOnce\",\n\t value: function addEventOnce(ev, target, func, capture) {\n\t var thisFunction = function thisFunction(event) {\n\t func(event, func);\n\t target.removeEventListener(ev, thisFunction, capture);\n\t };\n\t target.addEventListener(ev, thisFunction, capture);\n\t return thisFunction;\n\t }\n\t\n\t /**\n\t * Checks if an element is visible\n\t * @param {HTMLElement} element\n\t * @returns bool\n\t */\n\t\n\t }, {\n\t key: \"isVisible\",\n\t value: function isVisible(element) {\n\t return element.offsetWidth > 0 && element.offsetHeight > 0;\n\t }\n\t\n\t /**\n\t * Creates a camelCaseRepresentation of a dashed string\n\t * @param {String} str\n\t * @returns String\n\t */\n\t\n\t }, {\n\t key: \"dashToCamelCase\",\n\t value: function dashToCamelCase(str) {\n\t return str.replace(/-([a-z])/g, function (g) {\n\t return g[1].toUpperCase();\n\t });\n\t }\n\t\n\t /**\n\t * Creates a copy of `input`\n\t * @param {*} input\n\t * @return *\n\t */\n\t\n\t }, {\n\t key: \"copy\",\n\t value: function copy(input) {\n\t return JSON.parse(JSON.stringify(input));\n\t }\n\t\n\t /**\n\t * Reads options from element (data attributes) and applies to base\n\t * @param {HTMLElement} element\n\t * @param {Object} base\n\t * @return {Object}\n\t */\n\t\n\t }, {\n\t key: \"applyOptionsFromElement\",\n\t value: function applyOptionsFromElement(element, base) {\n\t if (!element) {\n\t return base;\n\t }\n\t var attrs = element.attributes;\n\t for (var i = 0; i < attrs.length; i++) {\n\t var attr = attrs[i];\n\t if (attr) {\n\t var s = Util.dashToCamelCase(attr.nodeName.replace('data-', ''));\n\t var val = attr.nodeValue;\n\t if (base.hasOwnProperty(s)) {\n\t // skip functions\n\t if (typeof base[s] === 'function') {\n\t continue;\n\t }\n\t if (typeof base[s] === 'boolean') {\n\t base[s] = parseInt(val || 1, 10) === 1;\n\t } else {\n\t base[s] = val;\n\t }\n\t }\n\t }\n\t }\n\t return base;\n\t }\n\t\n\t /**\n\t * Will position an element directly at given target\n\t * Is aware of a given collision container to detect edges\n\t * Will put elementToPosition either to left, center or right edge (prefer right)\n\t * and either to bottom or top (prefers bottom)\n\t *\n\t * You may overwrite preferred positioned with `centerHorizontal` and `positionTop`\n\t *\n\t * @param {HTMLElement|ClientRect} target the target container to align to\n\t * @param {HTMLElement} elementToPosition the element to position\n\t * @param {HTMLElement} collisionContainer the outer container to prevent collisions\n\t * @param {boolean} [centerHorizontal] set true to center element, otherwise it's put on the right border by default\n\t * @param {boolean} [positionTop] flip top, by default element is positioned to the bottom.\n\t * @returns {HTMLElement}\n\t */\n\t\n\t }, {\n\t key: \"setupPositionNearby\",\n\t value: function setupPositionNearby(target, elementToPosition, collisionContainer, centerHorizontal, positionTop) {\n\t // determine relative offsets\n\t var amountTop = 0;\n\t var amountLeft = 0;\n\t Util.parentsUntil(target.parentNode, function (el) {\n\t if (!(el instanceof HTMLElement)) {\n\t return false;\n\t }\n\t var style = window.getComputedStyle(el);\n\t if (Util.isPartOfNode(elementToPosition, el)) {\n\t if (style && style.position === 'relative') {\n\t amountTop += el.offsetTop || 0;\n\t amountLeft += el.offsetLeft || 0;\n\t }\n\t return false;\n\t }\n\t return true;\n\t });\n\t\n\t var targetPosition = target instanceof HTMLElement ? target.getBoundingClientRect() : target;\n\t var elementRect = elementToPosition.getBoundingClientRect();\n\t var colRect = collisionContainer.getBoundingClientRect();\n\t var targetTop = targetPosition.top - amountTop;\n\t var targetRight = targetPosition.right;\n\t var isCollisionTop = targetTop - elementRect.height <= 0;\n\t var isCollisionBottom = window.innerHeight < targetTop + amountTop + targetPosition.height + elementRect.height;\n\t var isCollisionLeft = targetRight < elementRect.width;\n\t var targetLeft = targetPosition.left;\n\t var isCollisionRight = targetLeft + elementRect.width > colRect.width;\n\t var classList = elementToPosition.classList;\n\t\n\t classList.remove(COL_RIGHT_CLASS);\n\t classList.remove(COL_LEFT_CLASS);\n\t classList.remove(COL_BOTTOM_CLASS);\n\t\n\t var calcTop = void 0;\n\t var calcLeft = void 0;\n\t if (isCollisionLeft && !isCollisionRight) {\n\t // put element to left if collision with left\n\t calcLeft = targetPosition.left - colRect.left - amountLeft + \"px\";\n\t classList.add(COL_LEFT_CLASS);\n\t } else {\n\t // maybe center if no collision with either side\n\t var rightPosition = targetRight - elementRect.width - colRect.left - amountLeft + \"px\";\n\t var leftCentered = (targetLeft + targetPosition.width / 2 - elementRect.width / 2 || 0) - colRect.left;\n\t var collisionCentered = leftCentered + elementRect.width > colRect.width;\n\t if (centerHorizontal && !collisionCentered) {\n\t calcLeft = leftCentered + \"px\";\n\t } else {\n\t classList.add(COL_RIGHT_CLASS);\n\t calcLeft = rightPosition;\n\t }\n\t }\n\t\n\t if (isCollisionBottom || positionTop && !isCollisionTop) {\n\t // Put Element on top if collision\n\t calcTop = targetTop - elementRect.height - colRect.top + \"px\";\n\t classList.add(COL_BOTTOM_CLASS);\n\t } else {\n\t calcTop = targetTop + targetPosition.height - colRect.top + \"px\";\n\t }\n\t\n\t elementToPosition.style.cssText = \"top:\" + calcTop + \";left:\" + calcLeft + \";\";\n\t\n\t return elementToPosition;\n\t }\n\t\n\t /**\n\t * Brings a given element into viewport\n\t * @param {HTMLElement} el\n\t * @param {int|function}[optionalOffset]\n\t */\n\t\n\t }, {\n\t key: \"scrollToElement\",\n\t value: function scrollToElement(el, optionalOffset) {\n\t el.scrollIntoView();\n\t var thisOffset = optionalOffset;\n\t // optionally use a additional scrollDif\n\t if (thisOffset) {\n\t if (typeof thisOffset === 'function') {\n\t thisOffset = optionalOffset();\n\t }\n\t if (thisOffset > 0) {\n\t var scrolledY = window.pageYOffset;\n\t if (scrolledY) {\n\t window.scroll(0, scrolledY - thisOffset);\n\t }\n\t }\n\t }\n\t }\n\t }]);\n\t\n\t return Util;\n\t}();\n\t\n\texports.default = Util;\n\t/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))\n\n/***/ },\n/* 2 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t/* WEBPACK VAR INJECTION */(function(global) {'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /*\n\t * The MIT License (MIT)\n\t *\n\t * Copyright (c) 2015 David Heidrich, BowlingX \n\t *\n\t * Permission is hereby granted, free of charge, to any person obtaining a copy\n\t * of this software and associated documentation files (the \"Software\"), to deal\n\t * in the Software without restriction, including without limitation the rights\n\t * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n\t * copies of the Software, and to permit persons to whom the Software is\n\t * furnished to do so, subject to the following conditions:\n\t *\n\t * The above copyright notice and this permission notice shall be included in\n\t * all copies or substantial portions of the Software.\n\t *\n\t * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n\t * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n\t * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n\t * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n\t * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n\t * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n\t * THE SOFTWARE.\n\t */\n\t\n\t\n\tvar _Util = __webpack_require__(1);\n\t\n\tvar _Util2 = _interopRequireDefault(_Util);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\t// we attach global settings to global once because settings might be shared a lot of times trough the application\n\t// Maybe find a better way to handle that scenario\n\tif (!global.FLEXCSS_GLOBAL_SETTINGS) {\n\t (function () {\n\t global.FLEXCSS_GLOBAL_SETTINGS = {\n\t // defined breakpoint for small devices < n\n\t smallBreakpoint: 768,\n\t // nodes that should be updated when no scrollbar is expected\n\t scrollbarUpdateNodes: global.document.body !== null ? [global.document.body] : [],\n\t // additional Delay until darkener is fully hidden\n\t darkenerFadeDelay: 100,\n\t // class that is added if canvas has been toggled\n\t canvasToggledClass: 'toggled-canvas'\n\t };\n\t\n\t global.FLEXCSS_CONST_IS_IOS = null;\n\t\n\t global.FLEXCSS_CONST_IS_TOUCH = null;\n\t\n\t global.FLEXCSS_CONST_IS_IE = null;\n\t\n\t global.FLEXCSS_CONST_TAB_EVENT = 'click';\n\t\n\t global.FLEXCSS_IS_SMALL_SCREEN = false;\n\t\n\t var init = function init() {\n\t // Measure scrollbar width\n\t global.FLEXCSS_CONST_SCROLLBAR_WIDTH = _Util2.default.getScrollBarWidth();\n\t // detect right transition end event\n\t global.FLEXCSS_CONST_TRANSITION_EVENT = _Util2.default.whichTransitionEndEvent();\n\t };\n\t\n\t if (global.document.readyState !== 'loading') {\n\t init();\n\t } else {\n\t // it's possible that global.document.body is not available if the document is not\n\t // loaded completely\n\t document.addEventListener('DOMContentLoaded', function () {\n\t init();\n\t });\n\t }\n\t })();\n\t}\n\t\n\t/**\n\t * Utility class that setups global settings\n\t */\n\t\n\tvar Settings = function () {\n\t function Settings() {\n\t _classCallCheck(this, Settings);\n\t }\n\t\n\t _createClass(Settings, null, [{\n\t key: 'setup',\n\t\n\t\n\t /**\n\t * Setup global settings, overwrite default values\n\t * @param {Object} settings\n\t */\n\t value: function setup(settings) {\n\t Object.assign(global.FLEXCSS_GLOBAL_SETTINGS, settings);\n\t }\n\t\n\t /**\n\t * Access to global settings\n\t * @returns {Object}\n\t */\n\t\n\t }, {\n\t key: 'get',\n\t value: function get() {\n\t return global.FLEXCSS_GLOBAL_SETTINGS;\n\t }\n\t\n\t /**\n\t * Detects a IOS Device, caches subsequent calls\n\t * @returns {boolean}\n\t */\n\t\n\t }, {\n\t key: 'isIosDevice',\n\t value: function isIosDevice() {\n\t if (!global.FLEXCSS_CONST_IS_IOS) {\n\t global.FLEXCSS_CONST_IS_IOS = global.navigator.userAgent.match(/(iPad|iPhone|iPod)/i);\n\t }\n\t\n\t return global.FLEXCSS_CONST_IS_IOS;\n\t }\n\t\n\t /**\n\t * @returns {boolean}\n\t */\n\t\n\t }, {\n\t key: 'isSmallScreen',\n\t value: function isSmallScreen() {\n\t return window.innerWidth < Settings.get().smallBreakpoint;\n\t }\n\t\n\t /**\n\t * Detects a touch device, caches subsequent calls\n\t * @returns {boolean}\n\t */\n\t\n\t }, {\n\t key: 'isTouchDevice',\n\t value: function isTouchDevice() {\n\t if (!global.FLEXCSS_CONST_IS_TOUCH) {\n\t global.FLEXCSS_CONST_IS_TOUCH = 'ontouchstart' in window || !!global.navigator.msMaxTouchPoints;\n\t }\n\t return global.FLEXCSS_CONST_IS_TOUCH;\n\t }\n\t\n\t /**\n\t * Checks if current browser is Internet Explorer\n\t * @returns {boolean|*}\n\t */\n\t\n\t }, {\n\t key: 'isIE',\n\t value: function isIE() {\n\t if (!global.FLEXCSS_CONST_IS_IE) {\n\t global.FLEXCSS_CONST_IS_IE = \"ActiveXObject\" in window;\n\t }\n\t return global.FLEXCSS_CONST_IS_IE;\n\t }\n\t\n\t /**\n\t * @returns {String}\n\t */\n\t\n\t }, {\n\t key: 'getTransitionEvent',\n\t value: function getTransitionEvent() {\n\t return global.FLEXCSS_CONST_TRANSITION_EVENT;\n\t }\n\t\n\t /**\n\t * @returns {int}\n\t */\n\t\n\t }, {\n\t key: 'getScrollbarWidth',\n\t value: function getScrollbarWidth() {\n\t return global.FLEXCSS_CONST_SCROLLBAR_WIDTH;\n\t }\n\t\n\t /**\n\t * @returns {String}\n\t */\n\t\n\t }, {\n\t key: 'getTabEvent',\n\t value: function getTabEvent() {\n\t return global.FLEXCSS_CONST_TAB_EVENT;\n\t }\n\t }]);\n\t\n\t return Settings;\n\t}();\n\t\n\texports.default = Settings;\n\t/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))\n\n/***/ },\n/* 3 */\n/***/ function(module, exports) {\n\n\t/* WEBPACK VAR INJECTION */(function(global) {\"use strict\";\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\t/* global CustomEvent */\n\t\n\t/*\n\t * The MIT License (MIT)\n\t *\n\t * Copyright (c) 2015 David Heidrich, BowlingX \n\t *\n\t * Permission is hereby granted, free of charge, to any person obtaining a copy\n\t * of this software and associated documentation files (the \"Software\"), to deal\n\t * in the Software without restriction, including without limitation the rights\n\t * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n\t * copies of the Software, and to permit persons to whom the Software is\n\t * furnished to do so, subject to the following conditions:\n\t *\n\t * The above copyright notice and this permission notice shall be included in\n\t * all copies or substantial portions of the Software.\n\t *\n\t * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n\t * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n\t * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n\t * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n\t * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n\t * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n\t * THE SOFTWARE.\n\t */\n\t\n\t// polyfill for custom events to make thinks work in IE\n\t// The needed polyfill is so small that I embedded it here\n\t(function poly() {\n\t if (!global.CustomEvent || typeof global.CustomEvent !== 'function') {\n\t var _CustomEvent = function CustomEvent(event, params) {\n\t var thisParams = params || {\n\t bubbles: false,\n\t cancelable: false,\n\t detail: undefined\n\t };\n\t var evt = document.createEvent(\"CustomEvent\");\n\t evt.initCustomEvent(event, thisParams.bubbles, thisParams.cancelable, thisParams.detail);\n\t return evt;\n\t };\n\t _CustomEvent.prototype = global.Event.prototype;\n\t global.CustomEvent = _CustomEvent;\n\t }\n\t})();\n\t/**\n\t * Simpler Event dispatching\n\t */\n\t\n\tvar EventHandler = function () {\n\t\n\t /**\n\t * @param {HTMLElement} target\n\t * @param {String} name\n\t */\n\t\n\t function EventHandler(target, name) {\n\t _classCallCheck(this, EventHandler);\n\t\n\t this.target = target;\n\t this.defaultOptions = {\n\t bubbles: true,\n\t cancelable: true\n\t };\n\t\n\t this.name = name;\n\t }\n\t\n\t /**\n\t * Set more options\n\t * @param {Object} options\n\t * @returns {EventHandler}\n\t */\n\t\n\t\n\t _createClass(EventHandler, [{\n\t key: \"withOptions\",\n\t value: function withOptions(options) {\n\t Object.assign(this.defaultOptions, options || {});\n\t return this;\n\t }\n\t\n\t /**\n\t * Call with the originalEvent\n\t * @param {Event} e\n\t * @returns {EventHandler}\n\t */\n\t\n\t }, {\n\t key: \"withOriginal\",\n\t value: function withOriginal(e) {\n\t return this.withDetail({\n\t originalEvent: e\n\t });\n\t }\n\t\n\t /**\n\t * Extends the detail part of the event\n\t * @param {Object} o\n\t * @returns {EventHandler}\n\t */\n\t\n\t }, {\n\t key: \"withDetail\",\n\t value: function withDetail(o) {\n\t if (!this.defaultOptions.detail) {\n\t this.defaultOptions.detail = {};\n\t }\n\t Object.assign(this.defaultOptions.detail, o);\n\t return this;\n\t }\n\t\n\t /**\n\t * @returns {CustomEvent}\n\t */\n\t\n\t }, {\n\t key: \"fire\",\n\t value: function fire() {\n\t var e = new CustomEvent(this.name, this.defaultOptions);\n\t if (this.target) {\n\t this.target.dispatchEvent(e);\n\t }\n\t return e;\n\t }\n\t }]);\n\t\n\t return EventHandler;\n\t}();\n\t\n\tvar Event = function () {\n\t function Event() {\n\t _classCallCheck(this, Event);\n\t }\n\t\n\t _createClass(Event, null, [{\n\t key: \"dispatch\",\n\t\n\t /**\n\t * Prepares to dispatch a custom event (without firing)\n\t * @param {HTMLElement} target\n\t * @param {String} name\n\t * @returns {EventHandler}\n\t */\n\t value: function dispatch(target, name) {\n\t return new EventHandler(target, name);\n\t }\n\t\n\t /**\n\t * Dispatches a custom event and fires it directly\n\t * @param {HTMLElement} target\n\t * @param {String} name\n\t * @param {Object} [options]\n\t * @returns {CustomEvent}\n\t */\n\t\n\t }, {\n\t key: \"dispatchAndFire\",\n\t value: function dispatchAndFire(target, name, options) {\n\t return new EventHandler(target, name).withOptions(options).fire();\n\t }\n\t }]);\n\t\n\t return Event;\n\t}();\n\t\n\texports.default = Event;\n\t/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))\n\n/***/ },\n/* 4 */,\n/* 5 */\n/***/ function(module, exports) {\n\n\t\"use strict\";\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\t/*\n\t * The MIT License (MIT)\n\t *\n\t * Copyright (c) 2015 David Heidrich, BowlingX \n\t *\n\t * Permission is hereby granted, free of charge, to any person obtaining a copy\n\t * of this software and associated documentation files (the \"Software\"), to deal\n\t * in the Software without restriction, including without limitation the rights\n\t * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n\t * copies of the Software, and to permit persons to whom the Software is\n\t * furnished to do so, subject to the following conditions:\n\t *\n\t * The above copyright notice and this permission notice shall be included in\n\t * all copies or substantial portions of the Software.\n\t *\n\t * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n\t * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n\t * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n\t * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n\t * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n\t * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n\t * THE SOFTWARE.\n\t */\n\t\n\t/**\n\t * Provides a Basic Widget\n\t */\n\t\n\tvar DestroyableWidget = function () {\n\t function DestroyableWidget() {\n\t _classCallCheck(this, DestroyableWidget);\n\t\n\t this.listeners = [];\n\t }\n\t\n\t /**\n\t * Destroys a Widget\n\t */\n\t\n\t\n\t _createClass(DestroyableWidget, [{\n\t key: \"destroy\",\n\t value: function destroy() {\n\t this.listeners.forEach(function (listener) {\n\t listener.element.removeEventListener.apply(listener.element, listener.args);\n\t });\n\t this.listeners = [];\n\t }\n\t\n\t /**\n\t * Adds an event and registers it later to remove bindings\n\t * @param {HTMLElement} element\n\t * @param {String} name\n\t * @param {Function} listener\n\t * @param {boolean} [capture]\n\t * @returns {Function}\n\t */\n\t\n\t }, {\n\t key: \"addEventListener\",\n\t value: function addEventListener(element, name, listener, capture) {\n\t this.listeners.push({\n\t element: element,\n\t args: [name, listener, capture]\n\t });\n\t\n\t element.addEventListener(name, listener, capture);\n\t return listener;\n\t }\n\t }]);\n\t\n\t return DestroyableWidget;\n\t}();\n\t\n\texports.default = DestroyableWidget;\n\n/***/ },\n/* 6 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t/* WEBPACK VAR INJECTION */(function(global) {'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\t\n\tvar _Util = __webpack_require__(1);\n\t\n\tvar _Util2 = _interopRequireDefault(_Util);\n\t\n\tvar _DestroyableWidget2 = __webpack_require__(5);\n\t\n\tvar _DestroyableWidget3 = _interopRequireDefault(_DestroyableWidget2);\n\t\n\tvar _Settings = __webpack_require__(2);\n\t\n\tvar _Settings2 = _interopRequireDefault(_Settings);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /*\n\t * The MIT License (MIT)\n\t *\n\t * Copyright (c) 2015 David Heidrich, BowlingX \n\t *\n\t * Permission is hereby granted, free of charge, to any person obtaining a copy\n\t * of this software and associated documentation files (the \"Software\"), to deal\n\t * in the Software without restriction, including without limitation the rights\n\t * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n\t * copies of the Software, and to permit persons to whom the Software is\n\t * furnished to do so, subject to the following conditions:\n\t *\n\t * The above copyright notice and this permission notice shall be included in\n\t * all copies or substantial portions of the Software.\n\t *\n\t * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n\t * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n\t * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n\t * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n\t * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n\t * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n\t * THE SOFTWARE.\n\t */\n\t\n\t/*!\n\t * FlexCss.Tooltip\n\t * Licensed under the MIT License (MIT)\n\t * Copyright (c) 2015 David Heidrich, BowlingX \n\t */\n\t\n\t/**\n\t * @type {string}\n\t */\n\tvar CLASS_NAMES_TOOLTIP = 'tooltip-container';\n\t/**\n\t * @type {string}\n\t */\n\tvar CLASS_NAMES_OPEN = 'open';\n\t\n\t/**\n\t * @type {string}\n\t */\n\tvar ATTR_DATA_CLASSNAME = 'data-class';\n\t\n\t/**\n\t * @type {string}\n\t */\n\tvar ATTR_DATA_NO_TOUCH = 'data-no-touch';\n\t\n\t/**\n\t * @type {HTMLDocument}\n\t */\n\tvar doc = global.document;\n\t\n\t/**\n\t * Simple Tooltip\n\t */\n\t\n\tvar Tooltip = function (_DestroyableWidget) {\n\t _inherits(Tooltip, _DestroyableWidget);\n\t\n\t /**\n\t * Creates a Tooltip\n\t * @param {HTMLElement|String} DelegateContainer\n\t * @param {Object} [options]\n\t */\n\t\n\t function Tooltip(DelegateContainer, options) {\n\t _classCallCheck(this, Tooltip);\n\t\n\t /**\n\t * The Container where possible events are captured\n\t */\n\t\n\t var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(Tooltip).call(this));\n\t\n\t _this.container = DelegateContainer instanceof HTMLElement ? DelegateContainer : doc.getElementById(DelegateContainer);\n\t\n\t if (!_this.container) {\n\t throw new Error('Could not create Tooltip, DelegateContainer not found');\n\t }\n\t\n\t /**\n\t * The Container where tooltips are stored for this instance\n\t * @type {HTMLElement}\n\t */\n\t _this.tooltipContainer = null;\n\t\n\t /**\n\t * Default Options\n\t */\n\t _this.options = {\n\t containerClass: '',\n\t selectorAttribute: 'data-tooltip',\n\t collisionContainer: _this.container\n\t };\n\t\n\t Object.assign(_this.options, options || {});\n\t return _this;\n\t }\n\t\n\t /**\n\t * Creates and shows a tooltip\n\t * @param {HTMLElement} target where is this tooltip positioned\n\t * @param {String} text text content in tooltip, will be NOT escaped\n\t * @param {Boolean} [removeTitle] removes title element if given\n\t * @param {Node} [positionRelative]\n\t */\n\t\n\t\n\t _createClass(Tooltip, [{\n\t key: 'createTooltip',\n\t value: function createTooltip(target, text, removeTitle, positionRelative) {\n\t // abort if text is empty\n\t if (!text || text && text.trim() === '') {\n\t return;\n\t }\n\t\n\t if (_Settings2.default.isTouchDevice() && target && target.hasAttribute(ATTR_DATA_NO_TOUCH)) {\n\t return;\n\t }\n\t\n\t var tooltipContainer = this.tooltipContainer;\n\t\n\t if (!tooltipContainer) {\n\t tooltipContainer = doc.createElement('div');\n\t this.container.appendChild(tooltipContainer);\n\t this.tooltipContainer = tooltipContainer;\n\t }\n\t this._restoreClassNames(tooltipContainer, target);\n\t\n\t tooltipContainer.style.left = 'auto';\n\t tooltipContainer.style.top = 'auto';\n\t tooltipContainer.innerHTML = text;\n\t tooltipContainer.flexTooltipCurrentTarget = target;\n\t if (removeTitle) {\n\t target.oldTitle = text;\n\t target.removeAttribute('title');\n\t }\n\t\n\t _Util2.default.setupPositionNearby(positionRelative || target, tooltipContainer, this.options.collisionContainer, true, true);\n\t\n\t tooltipContainer.classList.add(CLASS_NAMES_OPEN);\n\t }\n\t }, {\n\t key: '_restoreClassNames',\n\t value: function _restoreClassNames(container, target) {\n\t // allow additional classname per tooltip on target element\n\t var classNames = [CLASS_NAMES_TOOLTIP, this.options.containerClass];\n\t var maybeTargetClass = target.getAttribute(ATTR_DATA_CLASSNAME);\n\t if (maybeTargetClass) {\n\t classNames.push(maybeTargetClass);\n\t }\n\t container.className = classNames.join(\" \");\n\t return this;\n\t }\n\t\n\t /**\n\t * @returns {HTMLElement|null}\n\t */\n\t\n\t }, {\n\t key: 'getCurrentTarget',\n\t value: function getCurrentTarget() {\n\t return this.tooltipContainer ? this.tooltipContainer.flexTooltipCurrentTarget : null;\n\t }\n\t\n\t /**\n\t * Destroys this Widget\n\t * @returns {boolean}\n\t */\n\t\n\t }, {\n\t key: 'destroy',\n\t value: function destroy() {\n\t _get(Object.getPrototypeOf(Tooltip.prototype), 'destroy', this).call(this);\n\t\n\t if (this.tooltipContainer) {\n\t this.tooltipContainer.parentNode.removeChild(this.tooltipContainer);\n\t return true;\n\t }\n\t return false;\n\t }\n\t\n\t /**\n\t * Removes a Tooltip on given target\n\t * @param {HTMLElement} [target], if not given will remove current open tooltip on this instance\n\t */\n\t\n\t }, {\n\t key: 'removeTooltip',\n\t value: function removeTooltip(target) {\n\t var selfTarget = target;\n\t if (!selfTarget && this.tooltipContainer) {\n\t selfTarget = this.tooltipContainer.flexTooltipCurrentTarget;\n\t }\n\t if (this.tooltipContainer) {\n\t if (this.tooltipContainer.flexTooltipCurrentTarget !== selfTarget) {\n\t return;\n\t }\n\t this.tooltipContainer.classList.remove(CLASS_NAMES_OPEN);\n\t delete this.tooltipContainer.flexTooltipCurrentTarget;\n\t }\n\t if (selfTarget && selfTarget.oldTitle) {\n\t selfTarget.setAttribute('title', selfTarget.oldTitle);\n\t }\n\t }\n\t\n\t /**\n\t * Initilizes mouse events on container element\n\t */\n\t\n\t }, {\n\t key: 'registerEvents',\n\t value: function registerEvents() {\n\t var self = this;\n\t this.addEventListener(this.container, 'mouseover', function (e) {\n\t if (e.target.hasAttribute(self.options.selectorAttribute)) {\n\t self.createTooltip(e.target, e.target.getAttribute('title'), true);\n\t }\n\t });\n\t\n\t this.addEventListener(this.container, 'mouseout', function (e) {\n\t if (e.target.hasAttribute(self.options.selectorAttribute)) {\n\t self.removeTooltip(e.target);\n\t }\n\t });\n\t return this;\n\t }\n\t }]);\n\t\n\t return Tooltip;\n\t}(_DestroyableWidget3.default);\n\t\n\texports.default = Tooltip;\n\t/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))\n\n/***/ },\n/* 7 */,\n/* 8 */,\n/* 9 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t/* WEBPACK VAR INJECTION */(function(global) {'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports.EVENT_FORM_AJAX_COMPLETED = exports.EVENT_FORM_AFTER_AJAX_SUBMIT = exports.EVENT_FORM_SUBMIT = exports.EVENT_FORM_READY = undefined;\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\t\n\tvar _Tooltip = __webpack_require__(6);\n\t\n\tvar _Tooltip2 = _interopRequireDefault(_Tooltip);\n\t\n\t__webpack_require__(11);\n\t\n\tvar _Event = __webpack_require__(3);\n\t\n\tvar _Event2 = _interopRequireDefault(_Event);\n\t\n\tvar _Util = __webpack_require__(1);\n\t\n\tvar _Util2 = _interopRequireDefault(_Util);\n\t\n\tvar _Settings = __webpack_require__(2);\n\t\n\tvar _Settings2 = _interopRequireDefault(_Settings);\n\t\n\tvar _DestroyableWidget2 = __webpack_require__(5);\n\t\n\tvar _DestroyableWidget3 = _interopRequireDefault(_DestroyableWidget2);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /*global HTMLFormElement, fetch, FormData, clearTimeout, NodeList*/\n\t\n\t/*\n\t * The MIT License (MIT)\n\t *\n\t * Copyright (c) 2015 David Heidrich, BowlingX \n\t *\n\t * Permission is hereby granted, free of charge, to any person obtaining a copy\n\t * of this software and associated documentation files (the \"Software\"), to deal\n\t * in the Software without restriction, including without limitation the rights\n\t * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n\t * copies of the Software, and to permit persons to whom the Software is\n\t * furnished to do so, subject to the following conditions:\n\t *\n\t * The above copyright notice and this permission notice shall be included in\n\t * all copies or substantial portions of the Software.\n\t *\n\t * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n\t * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n\t * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n\t * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n\t * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n\t * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n\t * THE SOFTWARE.\n\t */\n\t\n\t/*!\n\t * FlexCss.Form\n\t * Licensed under the MIT License (MIT)\n\t * Copyright (c) 2015 David Heidrich, BowlingX \n\t */\n\t\n\tvar LOADING_CLASS = 'loading';\n\tvar DATA_ELEMENT_INVALID = 'data-flexcss-invalid';\n\tvar REMOTE = 'data-remote';\n\tvar REMOTE_ACTION = 'data-remote-action';\n\tvar ATTR_DISABLE_INLINE = 'data-disable-inline-validation';\n\tvar ATTR_DISABLE_REALTIME = 'data-disable-realtime-validation';\n\tvar ATTR_VALIDATOR = 'data-validate';\n\tvar ATTR_DATA_CUSTOM_MESSAGE = 'data-validation-message';\n\tvar ATTR_DATA_CUSTOM_LABEL = 'data-custom-label';\n\tvar ATTR_VALIDATE_VISIBILITY = 'data-validate-visibility';\n\tvar ATTR_ERROR_TARGET_ID = 'data-error-target';\n\tvar ATTR_DEPENDS = 'data-depends-selector';\n\tvar CONST_USE_JSON = 'json';\n\tvar CONST_REALTIME_EVENT = 'input';\n\tvar FOCUS_TOOLTIP_DELAY = 20;\n\tvar CLICK_TOOLTIP_DELAY = 150;\n\t\n\t/**\n\t * Triggered when form is fully initialized and handlers are binded\n\t * @type {string}\n\t */\n\tvar EVENT_FORM_READY = exports.EVENT_FORM_READY = 'flexcss.form.ready';\n\t/**\n\t * Fires when a form is submitted, cancelable\n\t * @type {string}\n\t */\n\tvar EVENT_FORM_SUBMIT = exports.EVENT_FORM_SUBMIT = 'flexcss.form.submit';\n\t/**\n\t * Fired directly after the form has been submitted via ajax\n\t * @type {string}\n\t */\n\tvar EVENT_FORM_AFTER_AJAX_SUBMIT = exports.EVENT_FORM_AFTER_AJAX_SUBMIT = 'flexcss.form.afterAjaxSubmit';\n\t/**\n\t * Fired when ajax events did complete\n\t * @type {string}\n\t */\n\tvar EVENT_FORM_AJAX_COMPLETED = exports.EVENT_FORM_AJAX_COMPLETED = 'flexcss.form.ajaxCompleted';\n\t\n\t/**\n\t * A HTML5 Form Validation replacement\n\t */\n\t\n\tvar Form = function (_DestroyableWidget) {\n\t _inherits(Form, _DestroyableWidget);\n\t\n\t /**\n\t * @param {HTMLElement} form\n\t * @param [options] optional options\n\t */\n\t\n\t function Form(form, options) {\n\t _classCallCheck(this, Form);\n\t\n\t var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(Form).call(this));\n\t\n\t if (!(form instanceof HTMLFormElement)) {\n\t throw 'argument {0} form needs to be an form element';\n\t }\n\t\n\t /**\n\t * The Form\n\t * @type {HTMLElement}\n\t */\n\t _this.form = form;\n\t\n\t /**\n\t * @type {Tooltip}\n\t */\n\t _this.tooltips = null;\n\t\n\t /**\n\t * @type {Promise}\n\t */\n\t _this.currentValidationFuture = new Promise(function () {});\n\t\n\t /**\n\t * Default options\n\t * @type {Object}\n\t */\n\t _this.options = {\n\t // if true creates tooltips above element, uses FlexCss Tooltips\n\t createTooltips: true,\n\t // if true appends error message after input element\n\t appendError: false,\n\t // type of ajax submit\n\t ajaxSubmitType: 'POST',\n\t // json content type if ajax method is set to json\n\t ajaxJsonContentType: 'application/json; charset=utf-8',\n\t // allow inline validation\n\t inlineValidation: true,\n\t // validate in realtime (on `input` event)\n\t realtime: true,\n\t // timeout when realtime event should be captured\n\t realtimeTimeout: 250,\n\t // formatting method for an error\n\t formatErrorTooltip: function formatErrorTooltip(error) {\n\t return ' ' + error;\n\t },\n\t // the class that will be put on the element to mark it failed validation\n\t inputErrorClass: 'invalid',\n\t // the container class for error messages below an element\n\t containerErrorClass: 'form-error',\n\t // additional options for fetch\n\t fetchOptions: {\n\t credentials: 'include'\n\t },\n\t // the container for tooltips\n\t tooltipContainer: form,\n\t tooltipOptions: {\n\t containerClass: 'error-tooltip'\n\t },\n\t // if you have a fixed header, either set a number or function here\n\t scrollToElementDiff: 0\n\t };\n\t\n\t // overwrite default options\n\t Object.assign(_this.options, options);\n\t\n\t // apply settings from attributes\n\t _Util2.default.applyOptionsFromElement(form, _this.options);\n\t\n\t // set form class as widget\n\t // Forms are very different to classical widgets,\n\t // we will not use our base widget class for this but just self\n\t form.hfWidgetInstance = _this;\n\t\n\t /**\n\t * A List of Validators\n\t * @type {Object}\n\t * @private\n\t */\n\t _this._validators = Form.globalValidators;\n\t\n\t /**\n\t * @type {Function}\n\t * @private\n\t */\n\t _this._remoteValidationFunction = null;\n\t\n\t _this.initFormValidation();\n\t return _this;\n\t }\n\t\n\t _createClass(Form, [{\n\t key: 'destroy',\n\t value: function destroy() {\n\t _get(Object.getPrototypeOf(Form.prototype), 'destroy', this).call(this);\n\t if (this.tooltips) {\n\t this.tooltips.destroy();\n\t }\n\t }\n\t\n\t /**\n\t * Submits this form, either via ajax or just classical (default)\n\t * @param {HTMLFormElement} thisForm\n\t * @param {Event} e\n\t * @private\n\t * @returns {Promise|boolean} returns false if submit is cancled\n\t */\n\t\n\t }, {\n\t key: '_submitFunction',\n\t value: function _submitFunction(thisForm, e) {\n\t var shouldUseAjax = thisForm.getAttribute(REMOTE),\n\t ajaxPostUrl = thisForm.getAttribute(REMOTE_ACTION) || thisForm.getAttribute('action') || window.location.href,\n\t useJson = CONST_USE_JSON === shouldUseAjax,\n\t self = this;\n\t\n\t var ev = _Event2.default.dispatch(thisForm, EVENT_FORM_SUBMIT).withOriginal(e).fire();\n\t\n\t // abort execution is event was prevented\n\t if (ev.defaultPrevented) {\n\t self._formStopLoading();\n\t return false;\n\t }\n\t\n\t if (shouldUseAjax === null) {\n\t // submit\n\t return thisForm.submit();\n\t }\n\t // prevent form from submit normally\n\t e.preventDefault();\n\t\n\t // add information that this is an XMLHttpRequest request (used by some frameworks)\n\t var defaultHeaders = {\n\t 'X-Requested-With': 'XMLHttpRequest'\n\t };\n\t\n\t // setup default headers\n\t if (useJson) {\n\t Object.assign(defaultHeaders, {\n\t 'Content-Type': this.options.ajaxJsonContentType\n\t });\n\t }\n\t var defaultOptions = Object.assign(this.options.fetchOptions, {\n\t headers: defaultHeaders,\n\t method: this.options.ajaxSubmitType\n\t });\n\t\n\t // support either JSON request payload or normal payload submission\n\t var serverCall = useJson ? fetch(ajaxPostUrl, Object.assign(defaultOptions, {\n\t body: JSON.stringify(this.serialize())\n\t })) : fetch(ajaxPostUrl, Object.assign(defaultOptions, {\n\t body: new FormData(thisForm)\n\t }));\n\t\n\t _Event2.default.dispatch(thisForm, EVENT_FORM_AFTER_AJAX_SUBMIT).withOriginal(e).fire();\n\t\n\t return serverCall.then(function (r) {\n\t (self._remoteValidationFunction || Form.globalRemoteValidationFunction).apply(self, [r]);\n\t\n\t _Event2.default.dispatch(thisForm, EVENT_FORM_AJAX_COMPLETED).withOriginal(e).withDetail({ response: r }).fire();\n\t // always remove error class\n\t self._formStopLoading();\n\t });\n\t }\n\t\n\t /**\n\t * Serializes a form to a json object\n\t * @returns {Object}\n\t */\n\t\n\t }, {\n\t key: 'serialize',\n\t value: function serialize() {\n\t var selectors = ['input[name]:not([type=\"radio\"]):enabled', 'input[type=\"radio\"][name]:checked', 'select[name]:enabled', 'textarea[name]:enabled'],\n\t inputs = this.form.querySelectorAll(selectors.join(',')),\n\t result = {};\n\t\n\t Array.prototype.forEach.call(inputs, function (input) {\n\t var exists = result[input.name],\n\t value = input.value;\n\t if (exists instanceof Array) {\n\t exists.push(value);\n\t } else if (exists) {\n\t result[input.name] = [result[input.name], value];\n\t } else {\n\t result[input.name] = value;\n\t }\n\t });\n\t\n\t return result;\n\t }\n\t\n\t /**\n\t * Handles the chain of validation on given fields\n\t *\n\t * @param {HTMLElement|Array|NodeList} field\n\t * @param [focus] optional focus first error\n\t * @returns {Promise}\n\t */\n\t\n\t }, {\n\t key: 'handleValidation',\n\t value: function handleValidation(field, focus) {\n\t var _this2 = this;\n\t\n\t var fields = field instanceof Array || field instanceof NodeList ? field : [field];\n\t return this._handleValidation(fields, focus, true).then(function (r) {\n\t if (!r.foundAnyError) {\n\t // remove tooltips\n\t if (_this2.tooltips) {\n\t _this2.tooltips.removeTooltip();\n\t }\n\t }\n\t return r;\n\t }.bind(this));\n\t }\n\t\n\t /**\n\t * Handles errors on given node list\n\t * @param {NodeList} toValidateFields\n\t * @param {boolean} focus\n\t * @param {boolean} scoped if true, will only validate the fields `invalidFields`\n\t * @returns {Promise}\n\t * @private\n\t */\n\t\n\t }, {\n\t key: '_handleValidation',\n\t value: function _handleValidation(toValidateFields, focus, scoped) {\n\t var self = this;\n\t var arr = Form._createArrayFromInvalidFieldList(toValidateFields),\n\t isLocalInvalid = arr.length > 0;\n\t // focus must appear in the same frame for iOS devices\n\t if (isLocalInvalid && focus) {\n\t self._focusElement(arr[0]);\n\t }\n\t var validation = scoped ? this._customValidationsForElements(toValidateFields) : self.validateCustomFields();\n\t return validation.then(function (r) {\n\t if (isLocalInvalid) {\n\t // combine browser and custom validators\n\t r.foundAnyError = true;\n\t }\n\t // get a unique field list of all fields that need to be checked and rendered\n\t // it's possible that we have duplicates in non scoped mode\n\t var thisToValidateFields = scoped ? toValidateFields : Array.from(arr).concat(r.checkedFields);\n\t r.checkedFields = thisToValidateFields;\n\t var foundInvalidFields = self.prepareErrors(thisToValidateFields, false),\n\t firstInvalidField = foundInvalidFields[0];\n\t if (firstInvalidField) {\n\t if (focus) {\n\t self._focusElement(firstInvalidField);\n\t // if element could not be focused:\n\t if (document.activeElement !== firstInvalidField) {\n\t self._handleTooltipHideClickAfterChange();\n\t }\n\t } else {\n\t self._handleTooltipHideClickAfterChange();\n\t }\n\t self.showAndOrCreateTooltip(firstInvalidField);\n\t }\n\t return r;\n\t });\n\t }\n\t\n\t /**\n\t * @param {HTMLElement} field\n\t * @param {ValidityState} validity\n\t * @returns {*}\n\t * @private\n\t */\n\t\n\t }, {\n\t key: '_setupErrorMessages',\n\t value: function _setupErrorMessages(field, validity) {\n\t return Form.globalErrorMessageHandler ? Form.globalErrorMessageHandler.apply(this, [field, validity]) : false;\n\t }\n\t\n\t /**\n\t * Handles class labels for elements\n\t * @param {Object} fields\n\t * @private\n\t */\n\t\n\t }, {\n\t key: '_handleLabels',\n\t value: function _handleLabels(fields) {\n\t Object.keys(fields).forEach(function (id) {\n\t var labels = this.getForm().querySelectorAll('[for=\"' + id + '\"]'),\n\t invalid = fields[id];\n\t if (labels.length) {\n\t for (var labelsIndex = 0; labelsIndex < labels.length; labelsIndex++) {\n\t var labelEl = labels[labelsIndex];\n\t // we can't use toggle attribute, not supported in IE\n\t if (invalid) {\n\t this._markElementInvalid(labelEl);\n\t } else {\n\t this._markElementValid(labelEl);\n\t }\n\t }\n\t }\n\t }.bind(this));\n\t }\n\t\n\t /**\n\t * @param el\n\t * @private\n\t */\n\t\n\t }, {\n\t key: '_markElementInvalid',\n\t value: function _markElementInvalid(el) {\n\t el.setAttribute(DATA_ELEMENT_INVALID, \"true\");\n\t el.classList.add(this.options.inputErrorClass);\n\t }\n\t\n\t /**\n\t * @param el\n\t * @private\n\t */\n\t\n\t }, {\n\t key: '_markElementValid',\n\t value: function _markElementValid(el) {\n\t el.removeAttribute(DATA_ELEMENT_INVALID);\n\t el.classList.remove(this.options.inputErrorClass);\n\t }\n\t\n\t /**\n\t * A List of invalid elements (:invalid)\n\t * @returns {Array}\n\t * @private\n\t */\n\t\n\t }, {\n\t key: '_getInvalidElements',\n\t value: function _getInvalidElements() {\n\t return Array.prototype.filter.call(this.getForm().querySelectorAll(\":invalid\"), function (r) {\n\t return !(r instanceof HTMLFieldSetElement);\n\t });\n\t }\n\t\n\t /**\n\t * @param {HTMLElement} thisParent\n\t * @private\n\t */\n\t\n\t }, {\n\t key: '_removeElementErrors',\n\t value: function _removeElementErrors(thisParent) {\n\t var errors = thisParent.querySelectorAll('.' + this.options.containerErrorClass),\n\t inputsWithErrorClasses = thisParent.querySelectorAll('[' + DATA_ELEMENT_INVALID + ']');\n\t for (var elementErrorIndex = 0; elementErrorIndex < errors.length; elementErrorIndex++) {\n\t errors[elementErrorIndex].parentNode.removeChild(errors[elementErrorIndex]);\n\t }\n\t for (var inputErrorIndex = 0; inputErrorIndex < inputsWithErrorClasses.length; inputErrorIndex++) {\n\t var el = inputsWithErrorClasses[inputErrorIndex];\n\t this._markElementValid(el);\n\t }\n\t }\n\t\n\t /**\n\t * Registers a custom validator\n\t * @param {String} name\n\t * @param {Function} validator a validation function should always return either a Future(true) or Future(false)\n\t * even when the field has been invalidated with `setCustomValidity`, because of different browser `bugs`\n\t * we can't rely on that\n\t * @returns {Form}\n\t */\n\t\n\t }, {\n\t key: 'registerValidator',\n\t value: function registerValidator(name, validator) {\n\t this._validators[name] = validator;\n\t return this;\n\t }\n\t\n\t /**\n\t * Runs async validation\n\t * @param {String} validationRef\n\t * @param {HTMLElement} field\n\t * @returns {Promise}\n\t * @private\n\t */\n\t\n\t }, {\n\t key: '_runValidation',\n\t value: function _runValidation(validationRef, field) {\n\t if (!this._validators[validationRef]) {\n\t throw 'Could not found validator: ' + validationRef;\n\t }\n\t var cl = field.classList,\n\t future = this._validators[validationRef].apply(this, [field, this.form]);\n\t cl.add(LOADING_CLASS);\n\t future.then(function () {\n\t cl.remove(LOADING_CLASS);\n\t });\n\t return future;\n\t }\n\t\n\t /**\n\t * Run custom validations for elements, validations are done async do support XHR Requests or other stuff\n\t *\n\t * @param {Array|NodeList} fields\n\t * @returns {Promise} contains either true if validations passed or false if something went wrong\n\t * @private\n\t */\n\t\n\t }, {\n\t key: '_customValidationsForElements',\n\t value: function _customValidationsForElements(fields) {\n\t var futures = [],\n\t fieldsLength = fields.length,\n\t checkedFields = [];\n\t for (var iVal = 0; iVal < fieldsLength; iVal++) {\n\t var field = fields[iVal],\n\t validationRef = field.getAttribute(ATTR_VALIDATOR),\n\t validity = field.validity;\n\t if (this._validators[validationRef]) {\n\t // use local validation first and then continue with custom validations\n\t if (Form._shouldNotValidateField(field) || validity && !validity.customError && !validity.valid) {\n\t continue;\n\t }\n\t checkedFields.push(field);\n\t futures.push(this._runValidation(validationRef, field));\n\t } else {\n\t if (validationRef) {\n\t console.warn('data-validate was set but no validator was found');\n\t }\n\t }\n\t }\n\t return Promise.all(futures).then(function (allFutures) {\n\t var l = allFutures.length;\n\t var result = {\n\t checkedFields: checkedFields,\n\t foundAnyError: false\n\t };\n\t for (var fI = 0; fI < l; fI++) {\n\t if (!allFutures[fI]) {\n\t result.foundAnyError = true;\n\t break;\n\t }\n\t }\n\t return result;\n\t });\n\t }\n\t\n\t /**\n\t * Remove all errors for this form\n\t * @returns {Form}\n\t */\n\t\n\t }, {\n\t key: 'removeErrors',\n\t value: function removeErrors() {\n\t this._removeElementErrors(this.form);\n\t if (this.tooltips) {\n\t this.tooltips.removeTooltip();\n\t }\n\t return this;\n\t }\n\t\n\t /**\n\t * Will handle errors for given fields\n\t * @param {Array|NodeList} fields\n\t * @param {Boolean} removeAllErrors\n\t */\n\t\n\t }, {\n\t key: 'prepareErrors',\n\t value: function prepareErrors(fields, removeAllErrors) {\n\t if (removeAllErrors) {\n\t this.removeErrors();\n\t }\n\t var labelGroups = {},\n\t invalidFields = [];\n\t\n\t function handleAdditionalLabels(isInvalid, thisLabelGroup, field) {\n\t var additionalLabels = field.getAttribute(ATTR_DATA_CUSTOM_LABEL) || field.id,\n\t group = thisLabelGroup[additionalLabels];\n\t if (additionalLabels) {\n\t // check additionally if field is currently marked as invalid\n\t // so the label is not marked as error if no field is marked as one\n\t group = group ? group : isInvalid;\n\t thisLabelGroup[additionalLabels] = group;\n\t }\n\t }\n\t\n\t // We save all validations in an extra property because we need to reset the validity due some\n\t // implementation errors in other browsers then chrome\n\t for (var i = 0; i < fields.length; i++) {\n\t var field = fields[i],\n\t errorTarget = Form._findErrorTarget(field),\n\t parent = errorTarget.parentNode,\n\t validity = field.validity,\n\t isInvalid = validity && !validity.valid;\n\t if (Form._shouldNotValidateField(field)) {\n\t continue;\n\t }\n\t field.flexFormsSavedValidity = JSON.parse(JSON.stringify(validity));\n\t handleAdditionalLabels(isInvalid, labelGroups, field);\n\t if (isInvalid) {\n\t if (!removeAllErrors) {\n\t // Remove current errors:\n\t this._removeElementErrors(parent);\n\t }\n\t // setup custom error messages:\n\t this._setupErrorMessages(field, validity);\n\t var msg = field.validationMessage;\n\t\n\t // mark fields as invalid\n\t this._markElementInvalid(errorTarget);\n\t this._markElementInvalid(field);\n\t\n\t if (this.options.appendError) {\n\t parent.insertAdjacentHTML(\"beforeend\", '
' + msg + '
');\n\t }\n\t invalidFields.push(field);\n\t field.flexFormsSavedValidationMessage = msg;\n\t } else {\n\t // restore invalid fields\n\t this._markElementValid(errorTarget);\n\t this._markElementValid(field);\n\t\n\t // cleanup\n\t delete field.flexFormsSavedValidationMessage;\n\t\n\t // remove error markup\n\t this._removeElementErrors(parent);\n\t }\n\t // We have to reset the custom validity here to allow native validations work again\n\t field.setCustomValidity('');\n\t }\n\t // if validates a single field we need to check the linked fields to a label:\n\t if (fields.length === 1) {\n\t var _field = fields[0];\n\t var id = _field.getAttribute(ATTR_DATA_CUSTOM_LABEL) || _field.id;\n\t if (id) {\n\t var linkedFields = Array.from(this.getForm().querySelectorAll('[' + ATTR_DATA_CUSTOM_LABEL + '=\"' + id + '\"], #' + id));\n\t linkedFields.forEach(function (thisField) {\n\t var validity = thisField.validity,\n\t isInvalid = validity && !validity.valid && this._isElementInvalidElement(thisField);\n\t handleAdditionalLabels(isInvalid, labelGroups, thisField);\n\t }.bind(this));\n\t }\n\t }\n\t this._handleLabels(labelGroups);\n\t return invalidFields;\n\t }\n\t\n\t /**\n\t * Validates all custom fields\n\t * @returns {Promise}\n\t */\n\t\n\t }, {\n\t key: 'validateCustomFields',\n\t value: function validateCustomFields() {\n\t return this._customValidationsForElements(this.form.querySelectorAll(\"[data-validate]\"));\n\t }\n\t\n\t /**\n\t * Tests if a field should be validated\n\t * @param {HTMLElement} field\n\t * @returns {boolean}\n\t * @private\n\t */\n\t\n\t }, {\n\t key: 'getForm',\n\t\n\t\n\t /**\n\t * This form\n\t * @returns {HTMLElement}\n\t */\n\t value: function getForm() {\n\t return this.form;\n\t }\n\t\n\t /**\n\t * Registers a function that handles remote validation\n\t * @param {Function} func\n\t * @returns {Form}\n\t */\n\t\n\t }, {\n\t key: 'registerRemoteValidation',\n\t value: function registerRemoteValidation(func) {\n\t this._remoteValidationFunction = func;\n\t return this;\n\t }\n\t\n\t /**\n\t * Formats the error content for the tooltip\n\t * @param {String} error\n\t * @returns {String}\n\t * @private\n\t */\n\t\n\t }, {\n\t key: '_formatErrorTooltip',\n\t value: function _formatErrorTooltip(error) {\n\t return this.options.formatErrorTooltip.apply(this, [error]);\n\t }\n\t\n\t /**\n\t * Tries to find a custom error target on given target\n\t * @param target\n\t * @returns {HTMLElement}\n\t * @private\n\t */\n\t\n\t }, {\n\t key: 'showAndOrCreateTooltip',\n\t\n\t\n\t /**\n\t * Creates a tooltip at given element, will only create a new instance if not created\n\t * @param {HTMLElement} target\n\t * @param {Boolean} [remove]\n\t */\n\t value: function showAndOrCreateTooltip(target, remove) {\n\t var self = this;\n\t if (!this.tooltips && this.options.createTooltips) {\n\t this.tooltips = new _Tooltip2.default(this.options.tooltipContainer, this.options.tooltipOptions);\n\t }\n\t if (!this.options.createTooltips) {\n\t return false;\n\t }\n\t\n\t if (!target.flexFormsSavedValidity) {\n\t return false;\n\t }\n\t var errorTarget = Form._findErrorTarget(target);\n\t if (!target.flexFormsSavedValidity.valid && self._isElementInvalidElement(errorTarget)) {\n\t self.tooltips.createTooltip(errorTarget, self._formatErrorTooltip(target.flexFormsSavedValidationMessage), false);\n\t return true;\n\t } else {\n\t if (remove) {\n\t self.tooltips.removeTooltip();\n\t }\n\t }\n\t return false;\n\t }\n\t\n\t /**\n\t * Checks if element is marked as invalid\n\t * @param {HTMLElement} el\n\t * @returns {boolean}\n\t * @private\n\t */\n\t\n\t }, {\n\t key: '_isElementInvalidElement',\n\t value: function _isElementInvalidElement(el) {\n\t return el.hasAttribute(DATA_ELEMENT_INVALID);\n\t }\n\t\n\t /**\n\t * Handles invalid event of a form\n\t * @param {Event} e\n\t * @returns {Promise|boolean}\n\t * @private\n\t */\n\t\n\t }, {\n\t key: '_checkIsInvalid',\n\t value: function _checkIsInvalid(e) {\n\t e.preventDefault();\n\t var invalidFields = this.getForm().querySelectorAll(\":invalid\");\n\t return this._handleValidation(invalidFields, true, false);\n\t }\n\t\n\t /**\n\t * Will query dependent fields (by selector) that should be validated with given field\n\t * @param field\n\t * @returns {NodeList|[]}\n\t * @private\n\t */\n\t\n\t }, {\n\t key: '_getDependentFields',\n\t value: function _getDependentFields(field) {\n\t var fieldSelector = field.getAttribute(ATTR_DEPENDS),\n\t base = [field];\n\t if (fieldSelector) {\n\t base.push.apply(base, Array.prototype.slice.apply(this.getForm().querySelectorAll(fieldSelector)));\n\t }\n\t return base;\n\t }\n\t\n\t /**\n\t * @private\n\t * @param {HTMLElement} [target]\n\t */\n\t\n\t }, {\n\t key: '_handleTooltipInline',\n\t value: function _handleTooltipInline(target) {\n\t if (this.tooltips) {\n\t this.tooltips.removeTooltip(target);\n\t }\n\t }\n\t\n\t /**\n\t * Initializes validation for a given form, registers event handlers\n\t */\n\t\n\t }, {\n\t key: 'initFormValidation',\n\t value: function initFormValidation() {\n\t var _this3 = this;\n\t\n\t // Suppress the default bubbles\n\t var form = this.getForm(),\n\t self = this,\n\t invalidEvent = 'invalid';\n\t\n\t /**\n\t * Validates if is valid realtime element\n\t * @param {HTMLElement} target\n\t * @returns {boolean}\n\t * @private\n\t */\n\t function _checkIsValidRealtimeElement(target) {\n\t return !target.hasAttribute(ATTR_DISABLE_REALTIME) && !target.hasAttribute(ATTR_DISABLE_INLINE);\n\t }\n\t\n\t form.addEventListener(invalidEvent, function (e) {\n\t e.preventDefault();\n\t }, true);\n\t\n\t _Util2.default.addEventOnce(invalidEvent, form, function handleInvalid(e) {\n\t self._formLoading();\n\t var result = self._checkIsInvalid(e);\n\t if (result) {\n\t self.currentValidationFuture = new Promise(function (resolve) {\n\t result.then(function (r) {\n\t setTimeout(function () {\n\t _Util2.default.addEventOnce(invalidEvent, form, handleInvalid, true);\n\t }, 0);\n\t resolve(r);\n\t self._formStopLoading();\n\t if (!r.foundAnyError) {\n\t self._formLoading();\n\t self._handleSubmit(e);\n\t }\n\t });\n\t });\n\t }\n\t }, true);\n\t\n\t this.addEventListener(form, 'reset', function () {\n\t _this3.removeErrors();\n\t });\n\t\n\t // Timeout for keys:\n\t var TIMEOUT_KEYDOWN,\n\t KEYDOWN_RUNNING = false;\n\t\n\t // resets keydown events\n\t function clearKeyDownTimeout() {\n\t KEYDOWN_RUNNING = false;\n\t clearTimeout(TIMEOUT_KEYDOWN);\n\t }\n\t\n\t // setup custom realtime event if given\n\t if (self.options.realtime) {\n\t this.addEventListener(form, CONST_REALTIME_EVENT, function (e) {\n\t if (self._formIsLoading()) {\n\t return;\n\t }\n\t var target = e.target;\n\t clearTimeout(TIMEOUT_KEYDOWN);\n\t if (KEYDOWN_RUNNING) {\n\t return;\n\t }\n\t TIMEOUT_KEYDOWN = setTimeout(function () {\n\t var isStillTarget = document.activeElement === e.target;\n\t if (!_checkIsValidRealtimeElement(target)) {\n\t return;\n\t }\n\t if (isStillTarget) {\n\t self._handleTooltipInline();\n\t }\n\t KEYDOWN_RUNNING = true;\n\t var dependentFields = self._getDependentFields(target);\n\t self._customValidationsForElements(dependentFields).then(function () {\n\t self.prepareErrors(dependentFields, false);\n\t if (isStillTarget) {\n\t self.showAndOrCreateTooltip(e.target);\n\t }\n\t // future must be resolved before another event can be started\n\t KEYDOWN_RUNNING = false;\n\t });\n\t }, self.options.realtimeTimeout);\n\t }, true);\n\t }\n\t\n\t /**\n\t * Validates if target is a valid input field to check blur and focus events\n\t *\n\t * @param {HTMLElement} target\n\t * @returns {boolean}\n\t * @private\n\t */\n\t function _checkIsValidBlurFocusElement(target) {\n\t var attr = target.getAttribute(\"type\");\n\t return attr !== \"radio\" && attr !== \"checkbox\" && attr !== \"submit\";\n\t }\n\t\n\t /**\n\t * Validates if is valid inline-check element\n\t * @param {HTMLElement} target\n\t * @returns {boolean}\n\t * @private\n\t */\n\t function _checkIsValidInlineCheckElement(target) {\n\t return !target.hasAttribute(ATTR_DISABLE_INLINE);\n\t }\n\t\n\t this.addEventListener(form, 'blur', function (e) {\n\t // do not hide tooltip after change event\n\t if (!e.target.flexcssKeepTooltips) {\n\t self._handleTooltipInline(e.target);\n\t }\n\t delete e.target.flexcssKeepTooltips;\n\t }, true);\n\t\n\t // handle focus on input elements\n\t // will show an error if field is invalid\n\t this.addEventListener(form, \"focus\", function (e) {\n\t if (self._formIsLoading()) {\n\t return;\n\t }\n\t // do not track errors for checkbox and radios on focus:\n\t if (!_checkIsValidBlurFocusElement(e.target)) {\n\t return;\n\t }\n\t // we need to delay this a little, because Firefox and Safari do not show a tooltip after it\n\t // just have been hidden (on blur). Maybe fix this with a queue later\n\t setTimeout(function () {\n\t self.showAndOrCreateTooltip(e.target);\n\t }, FOCUS_TOOLTIP_DELAY);\n\t }, true);\n\t\n\t if (self.options.inlineValidation) {\n\t // Handle change for checkbox, radios and selects\n\t this.addEventListener(form, \"change\", function (e) {\n\t var target = e.target;\n\t if (self._formIsLoading() || !_checkIsValidInlineCheckElement(target)) {\n\t return;\n\t }\n\t clearKeyDownTimeout();\n\t var name = target.getAttribute('name');\n\t var inputs = name ? form.querySelectorAll('[name=\"' + name + '\"]') : [target];\n\t // we only support dependent fields for a single widgets right now\n\t if (inputs.length === 1) {\n\t inputs = self._getDependentFields(target);\n\t }\n\t self._customValidationsForElements(inputs).then(function () {\n\t self.prepareErrors(inputs, false);\n\t target.flexcssKeepTooltips = self.showAndOrCreateTooltip(target, true);\n\t if (target.flexcssKeepTooltips) {\n\t self._handleTooltipHideClickAfterChange();\n\t }\n\t });\n\t });\n\t }\n\t\n\t // prevent default if form is invalid\n\t this.addEventListener(form, \"submit\", function listener(e) {\n\t self._submitListener(e, listener);\n\t });\n\t\n\t _Event2.default.dispatchAndFire(form, EVENT_FORM_READY);\n\t }\n\t\n\t /* Loading states, unfortunately we can't check if a promise is pending :/*/\n\t /* TODO: Maybe wrap promise to extend this functionality */\n\t\n\t }, {\n\t key: '_formLoading',\n\t value: function _formLoading() {\n\t this.getForm().classList.add(LOADING_CLASS);\n\t }\n\t }, {\n\t key: '_formStopLoading',\n\t value: function _formStopLoading() {\n\t this.getForm().classList.remove(LOADING_CLASS);\n\t }\n\t }, {\n\t key: '_formIsLoading',\n\t value: function _formIsLoading() {\n\t return this.getForm().classList.contains(LOADING_CLASS);\n\t }\n\t\n\t // this defines the logic after a change event when a tooltip is shown\n\t // because we call this method inside the change event, the click would be immeditally executed with the change\n\t // event when not using setTimeout(). There might be another solution for this...\n\t\n\t }, {\n\t key: '_handleTooltipHideClickAfterChange',\n\t value: function _handleTooltipHideClickAfterChange() {\n\t var self = this;\n\t if (this.options.createTooltips) {\n\t setTimeout(function () {\n\t _Util2.default.addEventOnce(_Settings2.default.getTabEvent(), global.document.body, function (t) {\n\t if (!self._isElementInvalidElement(t.target)) {\n\t self._handleTooltipInline();\n\t }\n\t });\n\t }, CLICK_TOOLTIP_DELAY);\n\t }\n\t }\n\t }, {\n\t key: '_focusElement',\n\t value: function _focusElement(el) {\n\t el.focus();\n\t _Util2.default.scrollToElement(el, this.options.scrollToElementDiff);\n\t }\n\t\n\t /**\n\t * Listener that is executed on form submit\n\t * @param e\n\t * @param submitListener\n\t * @returns {boolean}\n\t * @private\n\t */\n\t\n\t }, {\n\t key: '_submitListener',\n\t value: function _submitListener(e, submitListener) {\n\t\n\t var form = this.getForm(),\n\t self = this,\n\t submitEvent = 'submit';\n\t\n\t if (this._formIsLoading()) {\n\t e.preventDefault();\n\t return false;\n\t }\n\t this._formLoading();\n\t form.removeEventListener(submitEvent, submitListener);\n\t this.removeErrors();\n\t e.preventDefault();\n\t // reset:\n\t if (form.checkValidity()) {\n\t form.addEventListener(submitEvent, submitListener);\n\t // It's possible that the form is valid but the custom validations need to be checked again:\n\t self.currentValidationFuture = new Promise(function (resolve) {\n\t var validation = self.validateCustomFields();\n\t validation.then(function (r) {\n\t // because custom validators may mark multiple fields as invalid, we get all of them in the form\n\t var fields = self._getInvalidElements(),\n\t errors = self.prepareErrors(fields, false),\n\t firstError = errors[0];\n\t if (firstError) {\n\t self._focusElement(firstError);\n\t self.showAndOrCreateTooltip(firstError, true);\n\t }\n\t resolve(r);\n\t });\n\t });\n\t self.currentValidationFuture.then(function (r) {\n\t if (!r.foundAnyError) {\n\t // Handle submitting the form to server:\n\t self._handleSubmit(e);\n\t } else {\n\t self._formStopLoading();\n\t }\n\t });\n\t } else {\n\t self._formStopLoading();\n\t form.addEventListener(submitEvent, submitListener);\n\t }\n\t }\n\t\n\t /**\n\t * Handles submitting, optionally allows to stop submitting\n\t * @param e\n\t * @private\n\t */\n\t\n\t }, {\n\t key: '_handleSubmit',\n\t value: function _handleSubmit(e) {\n\t this._submitFunction(this.form, e);\n\t }\n\t\n\t /**\n\t * Registers a global event Handler\n\t * @param errorFunc\n\t */\n\t\n\t }], [{\n\t key: '_shouldNotValidateField',\n\t value: function _shouldNotValidateField(field) {\n\t var target = Form._findErrorTarget(field);\n\t return target instanceof HTMLFieldSetElement || field.validity === undefined || target.hasAttribute(ATTR_VALIDATE_VISIBILITY) && !_Util2.default.isVisible(target);\n\t }\n\t\n\t /**\n\t * Creates an array from a node list with invalid items\n\t * This Method expicitly checks if field should not be validated so it can be used to foucs a field\n\t * @param list\n\t * @returns {Array}\n\t * @private\n\t */\n\t\n\t }, {\n\t key: '_createArrayFromInvalidFieldList',\n\t value: function _createArrayFromInvalidFieldList(list) {\n\t var arr = [];\n\t for (var i = 0; i < list.length; ++i) {\n\t var n = list[i];\n\t if (n.validity && !n.validity.valid) {\n\t if (!Form._shouldNotValidateField(n)) {\n\t arr.push(n);\n\t }\n\t }\n\t }\n\t return arr;\n\t }\n\t }, {\n\t key: '_findErrorTarget',\n\t value: function _findErrorTarget(target) {\n\t var el = target.getAttribute(ATTR_ERROR_TARGET_ID) || target,\n\t foundTarget = el instanceof HTMLElement ? el : global.document.getElementById(el);\n\t if (!foundTarget) {\n\t throw 'Given error target did not exsits:' + target;\n\t }\n\t return foundTarget;\n\t }\n\t }, {\n\t key: 'registerErrorMessageHandler',\n\t value: function registerErrorMessageHandler(errorFunc) {\n\t Form.globalErrorMessageHandler = errorFunc;\n\t }\n\t\n\t /**\n\t * Initialize forms for a specific selector\n\t * @param {String} selector\n\t * @param {Object} [options]\n\t * @return {array.}\n\t */\n\t\n\t }, {\n\t key: 'init',\n\t value: function init(selector, options) {\n\t var forms = selector instanceof HTMLElement ? selector.querySelectorAll('form') : document.querySelectorAll(selector),\n\t instances = [];\n\t for (var i = 0; i < forms.length; i++) {\n\t instances.push(new Form(forms[i], options));\n\t }\n\t return instances;\n\t }\n\t\n\t /**\n\t * Registers a global validator that is usable on all form instances\n\t * @param {String} name\n\t * @param {Function} validator\n\t * @returns {Function}\n\t */\n\t\n\t }, {\n\t key: 'registerValidator',\n\t value: function registerValidator(name, validator) {\n\t Form.globalValidators[name] = validator;\n\t return Form;\n\t }\n\t\n\t /**\n\t * Registers a global function that is called when a form should validate the response of a server\n\t * @param {Function} func\n\t * @returns {Form}\n\t */\n\t\n\t }, {\n\t key: 'registerGlobalRemoteValidationFunction',\n\t value: function registerGlobalRemoteValidationFunction(func) {\n\t Form.globalRemoteValidationFunction = func;\n\t return Form;\n\t }\n\t }]);\n\t\n\t return Form;\n\t}(_DestroyableWidget3.default);\n\t\n\t/**\n\t * Global validators\n\t * @type {Array}\n\t */\n\t\n\t\n\tForm.globalValidators = [];\n\t\n\t/**\n\t * Global Remote validation function\n\t */\n\tForm.globalRemoteValidationFunction = function () {};\n\t\n\t/**\n\t * Handles custom error messages extracts custom message by default\n\t */\n\tForm.globalErrorMessageHandler = function (field, validity) {\n\t if (!validity.customError) {\n\t var customMsg = field.getAttribute(ATTR_DATA_CUSTOM_MESSAGE);\n\t if (customMsg) {\n\t field.setCustomValidity(customMsg);\n\t }\n\t }\n\t};\n\t\n\texports.default = Form;\n\t/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))\n\n/***/ },\n/* 10 */,\n/* 11 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t// the whatwg-fetch polyfill installs the fetch() function\n\t// on the global object (window or self)\n\t//\n\t// Return that as the export for use in Webpack, Browserify etc.\n\t__webpack_require__(12);\n\tmodule.exports = self.fetch.bind(self);\n\n\n/***/ },\n/* 12 */\n/***/ function(module, exports) {\n\n\t(function(self) {\n\t 'use strict';\n\t\n\t if (self.fetch) {\n\t return\n\t }\n\t\n\t function normalizeName(name) {\n\t if (typeof name !== 'string') {\n\t name = String(name)\n\t }\n\t if (/[^a-z0-9\\-#$%&'*+.\\^_`|~]/i.test(name)) {\n\t throw new TypeError('Invalid character in header field name')\n\t }\n\t return name.toLowerCase()\n\t }\n\t\n\t function normalizeValue(value) {\n\t if (typeof value !== 'string') {\n\t value = String(value)\n\t }\n\t return value\n\t }\n\t\n\t function Headers(headers) {\n\t this.map = {}\n\t\n\t if (headers instanceof Headers) {\n\t headers.forEach(function(value, name) {\n\t this.append(name, value)\n\t }, this)\n\t\n\t } else if (headers) {\n\t Object.getOwnPropertyNames(headers).forEach(function(name) {\n\t this.append(name, headers[name])\n\t }, this)\n\t }\n\t }\n\t\n\t Headers.prototype.append = function(name, value) {\n\t name = normalizeName(name)\n\t value = normalizeValue(value)\n\t var list = this.map[name]\n\t if (!list) {\n\t list = []\n\t this.map[name] = list\n\t }\n\t list.push(value)\n\t }\n\t\n\t Headers.prototype['delete'] = function(name) {\n\t delete this.map[normalizeName(name)]\n\t }\n\t\n\t Headers.prototype.get = function(name) {\n\t var values = this.map[normalizeName(name)]\n\t return values ? values[0] : null\n\t }\n\t\n\t Headers.prototype.getAll = function(name) {\n\t return this.map[normalizeName(name)] || []\n\t }\n\t\n\t Headers.prototype.has = function(name) {\n\t return this.map.hasOwnProperty(normalizeName(name))\n\t }\n\t\n\t Headers.prototype.set = function(name, value) {\n\t this.map[normalizeName(name)] = [normalizeValue(value)]\n\t }\n\t\n\t Headers.prototype.forEach = function(callback, thisArg) {\n\t Object.getOwnPropertyNames(this.map).forEach(function(name) {\n\t this.map[name].forEach(function(value) {\n\t callback.call(thisArg, value, name, this)\n\t }, this)\n\t }, this)\n\t }\n\t\n\t function consumed(body) {\n\t if (body.bodyUsed) {\n\t return Promise.reject(new TypeError('Already read'))\n\t }\n\t body.bodyUsed = true\n\t }\n\t\n\t function fileReaderReady(reader) {\n\t return new Promise(function(resolve, reject) {\n\t reader.onload = function() {\n\t resolve(reader.result)\n\t }\n\t reader.onerror = function() {\n\t reject(reader.error)\n\t }\n\t })\n\t }\n\t\n\t function readBlobAsArrayBuffer(blob) {\n\t var reader = new FileReader()\n\t reader.readAsArrayBuffer(blob)\n\t return fileReaderReady(reader)\n\t }\n\t\n\t function readBlobAsText(blob) {\n\t var reader = new FileReader()\n\t reader.readAsText(blob)\n\t return fileReaderReady(reader)\n\t }\n\t\n\t var support = {\n\t blob: 'FileReader' in self && 'Blob' in self && (function() {\n\t try {\n\t new Blob();\n\t return true\n\t } catch(e) {\n\t return false\n\t }\n\t })(),\n\t formData: 'FormData' in self,\n\t arrayBuffer: 'ArrayBuffer' in self\n\t }\n\t\n\t function Body() {\n\t this.bodyUsed = false\n\t\n\t\n\t this._initBody = function(body) {\n\t this._bodyInit = body\n\t if (typeof body === 'string') {\n\t this._bodyText = body\n\t } else if (support.blob && Blob.prototype.isPrototypeOf(body)) {\n\t this._bodyBlob = body\n\t } else if (support.formData && FormData.prototype.isPrototypeOf(body)) {\n\t this._bodyFormData = body\n\t } else if (!body) {\n\t this._bodyText = ''\n\t } else if (support.arrayBuffer && ArrayBuffer.prototype.isPrototypeOf(body)) {\n\t // Only support ArrayBuffers for POST method.\n\t // Receiving ArrayBuffers happens via Blobs, instead.\n\t } else {\n\t throw new Error('unsupported BodyInit type')\n\t }\n\t\n\t if (!this.headers.get('content-type')) {\n\t if (typeof body === 'string') {\n\t this.headers.set('content-type', 'text/plain;charset=UTF-8')\n\t } else if (this._bodyBlob && this._bodyBlob.type) {\n\t this.headers.set('content-type', this._bodyBlob.type)\n\t }\n\t }\n\t }\n\t\n\t if (support.blob) {\n\t this.blob = function() {\n\t var rejected = consumed(this)\n\t if (rejected) {\n\t return rejected\n\t }\n\t\n\t if (this._bodyBlob) {\n\t return Promise.resolve(this._bodyBlob)\n\t } else if (this._bodyFormData) {\n\t throw new Error('could not read FormData body as blob')\n\t } else {\n\t return Promise.resolve(new Blob([this._bodyText]))\n\t }\n\t }\n\t\n\t this.arrayBuffer = function() {\n\t return this.blob().then(readBlobAsArrayBuffer)\n\t }\n\t\n\t this.text = function() {\n\t var rejected = consumed(this)\n\t if (rejected) {\n\t return rejected\n\t }\n\t\n\t if (this._bodyBlob) {\n\t return readBlobAsText(this._bodyBlob)\n\t } else if (this._bodyFormData) {\n\t throw new Error('could not read FormData body as text')\n\t } else {\n\t return Promise.resolve(this._bodyText)\n\t }\n\t }\n\t } else {\n\t this.text = function() {\n\t var rejected = consumed(this)\n\t return rejected ? rejected : Promise.resolve(this._bodyText)\n\t }\n\t }\n\t\n\t if (support.formData) {\n\t this.formData = function() {\n\t return this.text().then(decode)\n\t }\n\t }\n\t\n\t this.json = function() {\n\t return this.text().then(JSON.parse)\n\t }\n\t\n\t return this\n\t }\n\t\n\t // HTTP methods whose capitalization should be normalized\n\t var methods = ['DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT']\n\t\n\t function normalizeMethod(method) {\n\t var upcased = method.toUpperCase()\n\t return (methods.indexOf(upcased) > -1) ? upcased : method\n\t }\n\t\n\t function Request(input, options) {\n\t options = options || {}\n\t var body = options.body\n\t if (Request.prototype.isPrototypeOf(input)) {\n\t if (input.bodyUsed) {\n\t throw new TypeError('Already read')\n\t }\n\t this.url = input.url\n\t this.credentials = input.credentials\n\t if (!options.headers) {\n\t this.headers = new Headers(input.headers)\n\t }\n\t this.method = input.method\n\t this.mode = input.mode\n\t if (!body) {\n\t body = input._bodyInit\n\t input.bodyUsed = true\n\t }\n\t } else {\n\t this.url = input\n\t }\n\t\n\t this.credentials = options.credentials || this.credentials || 'omit'\n\t if (options.headers || !this.headers) {\n\t this.headers = new Headers(options.headers)\n\t }\n\t this.method = normalizeMethod(options.method || this.method || 'GET')\n\t this.mode = options.mode || this.mode || null\n\t this.referrer = null\n\t\n\t if ((this.method === 'GET' || this.method === 'HEAD') && body) {\n\t throw new TypeError('Body not allowed for GET or HEAD requests')\n\t }\n\t this._initBody(body)\n\t }\n\t\n\t Request.prototype.clone = function() {\n\t return new Request(this)\n\t }\n\t\n\t function decode(body) {\n\t var form = new FormData()\n\t body.trim().split('&').forEach(function(bytes) {\n\t if (bytes) {\n\t var split = bytes.split('=')\n\t var name = split.shift().replace(/\\+/g, ' ')\n\t var value = split.join('=').replace(/\\+/g, ' ')\n\t form.append(decodeURIComponent(name), decodeURIComponent(value))\n\t }\n\t })\n\t return form\n\t }\n\t\n\t function headers(xhr) {\n\t var head = new Headers()\n\t var pairs = xhr.getAllResponseHeaders().trim().split('\\n')\n\t pairs.forEach(function(header) {\n\t var split = header.trim().split(':')\n\t var key = split.shift().trim()\n\t var value = split.join(':').trim()\n\t head.append(key, value)\n\t })\n\t return head\n\t }\n\t\n\t Body.call(Request.prototype)\n\t\n\t function Response(bodyInit, options) {\n\t if (!options) {\n\t options = {}\n\t }\n\t\n\t this.type = 'default'\n\t this.status = options.status\n\t this.ok = this.status >= 200 && this.status < 300\n\t this.statusText = options.statusText\n\t this.headers = options.headers instanceof Headers ? options.headers : new Headers(options.headers)\n\t this.url = options.url || ''\n\t this._initBody(bodyInit)\n\t }\n\t\n\t Body.call(Response.prototype)\n\t\n\t Response.prototype.clone = function() {\n\t return new Response(this._bodyInit, {\n\t status: this.status,\n\t statusText: this.statusText,\n\t headers: new Headers(this.headers),\n\t url: this.url\n\t })\n\t }\n\t\n\t Response.error = function() {\n\t var response = new Response(null, {status: 0, statusText: ''})\n\t response.type = 'error'\n\t return response\n\t }\n\t\n\t var redirectStatuses = [301, 302, 303, 307, 308]\n\t\n\t Response.redirect = function(url, status) {\n\t if (redirectStatuses.indexOf(status) === -1) {\n\t throw new RangeError('Invalid status code')\n\t }\n\t\n\t return new Response(null, {status: status, headers: {location: url}})\n\t }\n\t\n\t self.Headers = Headers;\n\t self.Request = Request;\n\t self.Response = Response;\n\t\n\t self.fetch = function(input, init) {\n\t return new Promise(function(resolve, reject) {\n\t var request\n\t if (Request.prototype.isPrototypeOf(input) && !init) {\n\t request = input\n\t } else {\n\t request = new Request(input, init)\n\t }\n\t\n\t var xhr = new XMLHttpRequest()\n\t\n\t function responseURL() {\n\t if ('responseURL' in xhr) {\n\t return xhr.responseURL\n\t }\n\t\n\t // Avoid security warnings on getResponseHeader when not allowed by CORS\n\t if (/^X-Request-URL:/m.test(xhr.getAllResponseHeaders())) {\n\t return xhr.getResponseHeader('X-Request-URL')\n\t }\n\t\n\t return;\n\t }\n\t\n\t xhr.onload = function() {\n\t var status = (xhr.status === 1223) ? 204 : xhr.status\n\t if (status < 100 || status > 599) {\n\t reject(new TypeError('Network request failed'))\n\t return\n\t }\n\t var options = {\n\t status: status,\n\t statusText: xhr.statusText,\n\t headers: headers(xhr),\n\t url: responseURL()\n\t }\n\t var body = 'response' in xhr ? xhr.response : xhr.responseText;\n\t resolve(new Response(body, options))\n\t }\n\t\n\t xhr.onerror = function() {\n\t reject(new TypeError('Network request failed'))\n\t }\n\t\n\t xhr.open(request.method, request.url, true)\n\t\n\t if (request.credentials === 'include') {\n\t xhr.withCredentials = true\n\t }\n\t\n\t if ('responseType' in xhr && support.blob) {\n\t xhr.responseType = 'blob'\n\t }\n\t\n\t request.headers.forEach(function(value, name) {\n\t xhr.setRequestHeader(name, value)\n\t })\n\t\n\t xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit)\n\t })\n\t }\n\t self.fetch.polyfill = true\n\t})(typeof self !== 'undefined' ? self : this);\n\n\n/***/ },\n/* 13 */,\n/* 14 */,\n/* 15 */,\n/* 16 */,\n/* 17 */,\n/* 18 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _Form = __webpack_require__(9);\n\t\n\tvar _Form2 = _interopRequireDefault(_Form);\n\t\n\tvar _Tooltip = __webpack_require__(6);\n\t\n\tvar _Tooltip2 = _interopRequireDefault(_Tooltip);\n\t\n\tvar _Settings = __webpack_require__(2);\n\t\n\tvar _Settings2 = _interopRequireDefault(_Settings);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\t// default export as component object\n\texports.default = {\n\t Form: _Form2.default,\n\t Settings: _Settings2.default,\n\t Tooltip: _Tooltip2.default\n\t};\n\n/***/ }\n/******/ ])\n});\n;\n\n\n/** WEBPACK FOOTER **\n ** js/form.min.js\n **/"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"../\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n/** WEBPACK FOOTER **\n ** webpack/bootstrap a32af781d3d6caa30484\n **/","/*\n * The MIT License (MIT)\n *\n * Copyright (c) 2015 David Heidrich, BowlingX \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nconst PFX = [\"webkit\", \"moz\", \"MS\", \"o\", \"\"];\n\nconst COL_LEFT_CLASS = 'is-collision-left';\n\nconst COL_RIGHT_CLASS = 'is-collision-right';\n\nconst COL_BOTTOM_CLASS = 'is-collision-bottom';\n\n/**\n * Provides shared DOM-Utility functions\n */\nclass Util {\n\n /**\n * Will register the right animation event based on browser\n * @param element\n * @param type\n * @param callback\n */\n static prefixedAnimateEvent(element, type, callback) {\n const thisFunction = function thisFunction(e) {\n callback.apply(element, [e, thisFunction]);\n };\n\n for (let p = 0; p < PFX.length; p++) {\n let thisType = type;\n if (!PFX[p]) {\n thisType = type.toLowerCase();\n }\n const name = PFX[p] + thisType;\n element.addEventListener(name, thisFunction, true);\n }\n }\n\n /**\n * Get correct transitionend event\n * @returns {String}\n * @private\n */\n static whichTransitionEndEvent() {\n let t;\n const el = document.createElement('fake');\n\n const transitions = {\n transition: 'transitionend',\n OTransition: 'oTransitionEnd',\n MozTransition: 'transitionend',\n WebkitTransition: 'webkitTransitionEnd'\n };\n\n for (t in transitions) {\n if (el.style[t] !== undefined) {\n return transitions[t];\n }\n }\n }\n\n /**\n * Check if target is part of parent node\n * @param target\n * @param parent\n * @returns {boolean}\n */\n static isPartOfNode(target, parent) {\n if (!target || !parent) {\n return false;\n }\n let now = target;\n while (now !== parent && now !== null) {\n if (now === parent) {\n break;\n }\n now = now.parentNode;\n }\n return now !== null;\n }\n\n /**\n * Finds the closest element including itself matching a callback\n * @param {Node} el\n * @param {Function} callback\n * @returns {Node|boolean}\n */\n static closestCallback(el, callback) {\n let element = el;\n while (element !== null) {\n if (callback(element)) {\n return element;\n }\n element = element.parentNode;\n }\n return false;\n }\n\n /**\n * Walks the tree until func returns true for given argument\n * @param target\n * @param func\n * @returns {boolean|HTMLElement}\n */\n static parentsUntil(target, func) {\n if (!target) {\n return false;\n }\n let now = target;\n while (!func(now) && now !== null) {\n now = now.parentNode;\n }\n\n return now;\n }\n\n /**\n * Generates a unique id\n * @return {String}\n */\n static guid() {\n function s4() {\n return Math.floor((1 + Math.random()) * 0x10000)\n .toString(16)\n .substring(1);\n }\n\n return `${s4() + s4()}-${s4()}-${s4()}-${s4()}-${s4() + s4() + s4()}`;\n }\n\n /**\n * Detects scrollbar width\n * @see http://stackoverflow.com/questions/986937/how-can-i-get-the-browsers-scrollbar-sizes\n * @returns {number}\n */\n static getScrollBarWidth() {\n const doc = global.document;\n const inner = doc.createElement('p');\n\n inner.style.width = \"100%\";\n inner.style.height = \"200px\";\n\n const outer = doc.createElement('div');\n outer.style.position = \"absolute\";\n outer.style.top = \"0px\";\n outer.style.left = \"0px\";\n outer.style.visibility = \"hidden\";\n outer.style.width = \"200px\";\n outer.style.height = \"150px\";\n outer.style.overflow = \"hidden\";\n outer.appendChild(inner);\n\n doc.body.appendChild(outer);\n const w1 = inner.offsetWidth;\n outer.style.overflow = 'scroll';\n let w2 = inner.offsetWidth;\n if (w1 === w2) {\n w2 = outer.clientWidth;\n }\n doc.body.removeChild(outer);\n\n return (w1 - w2);\n }\n\n\n /**\n * Run an event once\n * @param {String} ev\n * @param {HTMLElement|HTMLDocument} target\n * @param {Function} func\n * @param {boolean} [capture]\n * @return Function created listener\n */\n static addEventOnce(ev, target, func, capture) {\n const thisFunction = function thisFunction(event) {\n func(event, func);\n target.removeEventListener(ev, thisFunction, capture);\n };\n target.addEventListener(ev, thisFunction, capture);\n return thisFunction;\n }\n\n /**\n * Checks if an element is visible\n * @param {HTMLElement} element\n * @returns bool\n */\n static isVisible(element) {\n return element.offsetWidth > 0 && element.offsetHeight > 0;\n }\n\n /**\n * Creates a camelCaseRepresentation of a dashed string\n * @param {String} str\n * @returns String\n */\n static dashToCamelCase(str) {\n return str.replace(/-([a-z])/g, (g) => {\n return g[1].toUpperCase();\n });\n }\n\n /**\n * Creates a copy of `input`\n * @param {*} input\n * @return *\n */\n static copy(input) {\n return JSON.parse(JSON.stringify(input));\n }\n\n /**\n * Reads options from element (data attributes) and applies to base\n * @param {HTMLElement} element\n * @param {Object} base\n * @return {Object}\n */\n static applyOptionsFromElement(element, base) {\n if (!element) {\n return base;\n }\n const attrs = element.attributes;\n for (let i = 0; i < attrs.length; i++) {\n const attr = attrs[i];\n if (attr) {\n const s = Util.dashToCamelCase(attr.nodeName.replace('data-', ''));\n const val = attr.nodeValue;\n if (base.hasOwnProperty(s)) {\n // skip functions\n if (typeof base[s] === 'function') {\n continue;\n }\n if (typeof base[s] === 'boolean') {\n base[s] = parseInt(val || 1, 10) === 1;\n } else {\n base[s] = val;\n }\n }\n }\n }\n return base;\n }\n\n /**\n * Will position an element directly at given target\n * Is aware of a given collision container to detect edges\n * Will put elementToPosition either to left, center or right edge (prefer right)\n * and either to bottom or top (prefers bottom)\n *\n * You may overwrite preferred positioned with `centerHorizontal` and `positionTop`\n *\n * @param {HTMLElement|ClientRect} target the target container to align to\n * @param {HTMLElement} elementToPosition the element to position\n * @param {HTMLElement} collisionContainer the outer container to prevent collisions\n * @param {boolean} [centerHorizontal] set true to center element, otherwise it's put on the right border by default\n * @param {boolean} [positionTop] flip top, by default element is positioned to the bottom.\n * @returns {HTMLElement}\n */\n static setupPositionNearby(target, elementToPosition, collisionContainer, centerHorizontal, positionTop) {\n // determine relative offsets\n let amountTop = 0;\n let amountLeft = 0;\n Util.parentsUntil(target.parentNode, (el) => {\n if (!(el instanceof HTMLElement)) {\n return false;\n }\n const style = window.getComputedStyle(el);\n if (Util.isPartOfNode(elementToPosition, el)) {\n if (style && style.position === 'relative') {\n amountTop += el.offsetTop || 0;\n amountLeft += el.offsetLeft || 0;\n }\n return false;\n }\n return true;\n });\n\n const targetPosition = target instanceof HTMLElement ? target.getBoundingClientRect() : target;\n const elementRect = elementToPosition.getBoundingClientRect();\n const colRect = collisionContainer.getBoundingClientRect();\n const targetTop = targetPosition.top - amountTop;\n const targetRight = targetPosition.right;\n const isCollisionTop = (targetTop - elementRect.height) <= 0;\n const isCollisionBottom =\n window.innerHeight < (targetTop + amountTop + targetPosition.height + elementRect.height);\n const isCollisionLeft = targetRight < elementRect.width;\n const targetLeft = targetPosition.left;\n const isCollisionRight = (targetLeft + elementRect.width) > colRect.width;\n const classList = elementToPosition.classList;\n\n classList.remove(COL_RIGHT_CLASS);\n classList.remove(COL_LEFT_CLASS);\n classList.remove(COL_BOTTOM_CLASS);\n\n let calcTop;\n let calcLeft;\n if (isCollisionLeft && !isCollisionRight) {\n // put element to left if collision with left\n calcLeft = `${(targetPosition.left - colRect.left - amountLeft)}px`;\n classList.add(COL_LEFT_CLASS);\n } else {\n // maybe center if no collision with either side\n const rightPosition = `${(targetRight - elementRect.width - colRect.left - amountLeft)}px`;\n const leftCentered = ((targetLeft + targetPosition.width / 2) -\n (elementRect.width / 2) || 0) - colRect.left;\n const collisionCentered = (leftCentered + elementRect.width) > colRect.width;\n if (centerHorizontal && !collisionCentered) {\n calcLeft = `${leftCentered}px`;\n } else {\n classList.add(COL_RIGHT_CLASS);\n calcLeft = rightPosition;\n }\n }\n\n if (isCollisionBottom || (positionTop && !isCollisionTop)) {\n // Put Element on top if collision\n calcTop = `${(targetTop - elementRect.height) - colRect.top}px`;\n classList.add(COL_BOTTOM_CLASS);\n } else {\n calcTop = `${(targetTop + targetPosition.height) - colRect.top}px`;\n }\n\n elementToPosition.style.cssText = `top:${calcTop};left:${calcLeft};`;\n\n return elementToPosition;\n }\n\n /**\n * Brings a given element into viewport\n * @param {HTMLElement} el\n * @param {int|function}[optionalOffset]\n */\n static scrollToElement(el, optionalOffset) {\n el.scrollIntoView();\n let thisOffset = optionalOffset;\n // optionally use a additional scrollDif\n if (thisOffset) {\n if (typeof thisOffset === 'function') {\n thisOffset = optionalOffset();\n }\n if (thisOffset > 0) {\n const scrolledY = window.pageYOffset;\n if (scrolledY) {\n window.scroll(0, scrolledY - thisOffset);\n }\n }\n }\n }\n}\n\nexport default Util;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/main/util/Util.js\n **/","/*\n * The MIT License (MIT)\n *\n * Copyright (c) 2015 David Heidrich, BowlingX \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\nimport Util from './Util';\n\n// we attach global settings to global once because settings might be shared a lot of times trough the application\n// Maybe find a better way to handle that scenario\nif (!global.FLEXCSS_GLOBAL_SETTINGS) {\n global.FLEXCSS_GLOBAL_SETTINGS = {\n // defined breakpoint for small devices < n\n smallBreakpoint: 768,\n // nodes that should be updated when no scrollbar is expected\n scrollbarUpdateNodes: global.document.body !== null ? [global.document.body] : [],\n // additional Delay until darkener is fully hidden\n darkenerFadeDelay: 100,\n // class that is added if canvas has been toggled\n canvasToggledClass: 'toggled-canvas'\n };\n\n global.FLEXCSS_CONST_IS_IOS = null;\n\n global.FLEXCSS_CONST_IS_TOUCH = null;\n\n global.FLEXCSS_CONST_IS_IE = null;\n\n global.FLEXCSS_CONST_TAB_EVENT = 'click';\n\n global.FLEXCSS_IS_SMALL_SCREEN = false;\n\n const init = () => {\n // Measure scrollbar width\n global.FLEXCSS_CONST_SCROLLBAR_WIDTH = Util.getScrollBarWidth();\n // detect right transition end event\n global.FLEXCSS_CONST_TRANSITION_EVENT = Util.whichTransitionEndEvent();\n };\n\n if (global.document.readyState !== 'loading') {\n init();\n } else {\n // it's possible that global.document.body is not available if the document is not\n // loaded completely\n document.addEventListener('DOMContentLoaded', () => {\n init();\n });\n }\n}\n\n/**\n * Utility class that setups global settings\n */\nclass Settings {\n\n /**\n * Setup global settings, overwrite default values\n * @param {Object} settings\n */\n static setup(settings) {\n Object.assign(global.FLEXCSS_GLOBAL_SETTINGS, settings);\n }\n\n /**\n * Access to global settings\n * @returns {Object}\n */\n static get() {\n return global.FLEXCSS_GLOBAL_SETTINGS;\n }\n\n /**\n * Detects a IOS Device, caches subsequent calls\n * @returns {boolean}\n */\n static isIosDevice() {\n if (!global.FLEXCSS_CONST_IS_IOS) {\n global.FLEXCSS_CONST_IS_IOS = global.navigator.userAgent.match(/(iPad|iPhone|iPod)/i);\n }\n\n return global.FLEXCSS_CONST_IS_IOS;\n }\n\n /**\n * @returns {boolean}\n */\n static isSmallScreen() {\n return window.innerWidth < Settings.get().smallBreakpoint;\n }\n\n /**\n * Detects a touch device, caches subsequent calls\n * @returns {boolean}\n */\n static isTouchDevice() {\n if (!global.FLEXCSS_CONST_IS_TOUCH) {\n global.FLEXCSS_CONST_IS_TOUCH = 'ontouchstart' in window || !!(global.navigator.msMaxTouchPoints);\n }\n return global.FLEXCSS_CONST_IS_TOUCH;\n }\n\n /**\n * Checks if current browser is Internet Explorer\n * @returns {boolean|*}\n */\n static isIE() {\n if (!global.FLEXCSS_CONST_IS_IE) {\n global.FLEXCSS_CONST_IS_IE = \"ActiveXObject\" in window;\n }\n return global.FLEXCSS_CONST_IS_IE;\n }\n\n /**\n * @returns {String}\n */\n static getTransitionEvent() {\n return global.FLEXCSS_CONST_TRANSITION_EVENT;\n }\n\n /**\n * @returns {int}\n */\n static getScrollbarWidth() {\n return global.FLEXCSS_CONST_SCROLLBAR_WIDTH;\n }\n\n /**\n * @returns {String}\n */\n static getTabEvent() {\n return global.FLEXCSS_CONST_TAB_EVENT;\n }\n}\n\nexport default Settings;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/main/util/Settings.js\n **/","/* global CustomEvent */\n\n/*\n * The MIT License (MIT)\n *\n * Copyright (c) 2015 David Heidrich, BowlingX \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n// polyfill for custom events to make thinks work in IE\n// The needed polyfill is so small that I embedded it here\n(function poly() {\n if (!global.CustomEvent || typeof global.CustomEvent !== 'function') {\n const CustomEvent = function CustomEvent(event, params) {\n const thisParams = params ||\n {\n bubbles: false,\n cancelable: false,\n detail: undefined\n };\n const evt = document.createEvent(\"CustomEvent\");\n evt.initCustomEvent(event, thisParams.bubbles,\n thisParams.cancelable, thisParams.detail);\n return evt;\n };\n CustomEvent.prototype = global.Event.prototype;\n global.CustomEvent = CustomEvent;\n }\n})();\n/**\n * Simpler Event dispatching\n */\nclass EventHandler {\n\n /**\n * @param {HTMLElement} target\n * @param {String} name\n */\n constructor(target, name) {\n this.target = target;\n this.defaultOptions = {\n bubbles: true,\n cancelable: true\n };\n\n this.name = name;\n }\n\n /**\n * Set more options\n * @param {Object} options\n * @returns {EventHandler}\n */\n withOptions(options) {\n Object.assign(this.defaultOptions, (options || {}));\n return this;\n }\n\n /**\n * Call with the originalEvent\n * @param {Event} e\n * @returns {EventHandler}\n */\n withOriginal(e) {\n return this.withDetail({\n originalEvent: e\n });\n }\n\n /**\n * Extends the detail part of the event\n * @param {Object} o\n * @returns {EventHandler}\n */\n withDetail(o) {\n if (!this.defaultOptions.detail) {\n this.defaultOptions.detail = {};\n }\n Object.assign(this.defaultOptions.detail, o);\n return this;\n }\n\n /**\n * @returns {CustomEvent}\n */\n fire() {\n const e = new CustomEvent(this.name, this.defaultOptions);\n if (this.target) {\n this.target.dispatchEvent(e);\n }\n return e;\n }\n}\n\nclass Event {\n /**\n * Prepares to dispatch a custom event (without firing)\n * @param {HTMLElement} target\n * @param {String} name\n * @returns {EventHandler}\n */\n static dispatch(target, name) {\n return new EventHandler(target, name);\n }\n\n /**\n * Dispatches a custom event and fires it directly\n * @param {HTMLElement} target\n * @param {String} name\n * @param {Object} [options]\n * @returns {CustomEvent}\n */\n static dispatchAndFire(target, name, options) {\n return new EventHandler(target, name).withOptions(options).fire();\n }\n}\n\nexport default Event;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/main/util/Event.js\n **/","/*\n * The MIT License (MIT)\n *\n * Copyright (c) 2015 David Heidrich, BowlingX \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n/**\n * Provides a Basic Widget\n */\nclass DestroyableWidget {\n\n constructor() {\n this.listeners = [];\n }\n\n /**\n * Destroys a Widget\n */\n destroy() {\n this.listeners.forEach((listener) => {\n listener.element.removeEventListener.apply(listener.element, listener.args);\n });\n this.listeners = [];\n }\n\n /**\n * Adds an event and registers it later to remove bindings\n * @param {HTMLElement} element\n * @param {String} name\n * @param {Function} listener\n * @param {boolean} [capture]\n * @returns {Function}\n */\n addEventListener(element, name, listener, capture) {\n this.listeners.push({\n element,\n args: [name, listener, capture]\n });\n\n element.addEventListener(name, listener, capture);\n return listener;\n }\n\n}\n\nexport default DestroyableWidget;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/main/DestroyableWidget.js\n **/","/*\n * The MIT License (MIT)\n *\n * Copyright (c) 2015 David Heidrich, BowlingX \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n/*!\n * FlexCss.Tooltip\n * Licensed under the MIT License (MIT)\n * Copyright (c) 2015 David Heidrich, BowlingX \n */\n\nimport Util from './util/Util';\nimport DestroyableWidget from './DestroyableWidget';\nimport Settings from './util/Settings';\n\n/**\n * @type {string}\n */\nconst CLASS_NAMES_TOOLTIP = 'tooltip-container';\n/**\n * @type {string}\n */\nconst CLASS_NAMES_OPEN = 'open';\n\n/**\n * @type {string}\n */\nconst ATTR_DATA_CLASSNAME = 'data-class';\n\n/**\n * @type {string}\n */\nconst ATTR_DATA_NO_TOUCH = 'data-no-touch';\n\n/**\n * @type {HTMLDocument}\n */\nconst doc = global.document;\n\n/**\n * Simple Tooltip\n */\nclass Tooltip extends DestroyableWidget {\n\n /**\n * Creates a Tooltip\n * @param {HTMLElement|String} DelegateContainer\n * @param {Object} [options]\n */\n constructor(DelegateContainer, options) {\n super();\n /**\n * The Container where possible events are captured\n */\n this.container = DelegateContainer instanceof HTMLElement ?\n DelegateContainer : doc.getElementById(DelegateContainer);\n\n if (!this.container) {\n throw new Error('Could not create Tooltip, DelegateContainer not found');\n }\n\n /**\n * The Container where tooltips are stored for this instance\n * @type {HTMLElement}\n */\n this.tooltipContainer = null;\n\n /**\n * Default Options\n */\n this.options = {\n containerClass: '',\n selectorAttribute: 'data-tooltip',\n collisionContainer: this.container\n };\n\n Object.assign(this.options, options || {});\n }\n\n /**\n * Creates and shows a tooltip\n * @param {HTMLElement} target where is this tooltip positioned\n * @param {String} text text content in tooltip, will be NOT escaped\n * @param {Boolean} [removeTitle] removes title element if given\n * @param {Node} [positionRelative]\n */\n createTooltip(target, text, removeTitle, positionRelative) {\n // abort if text is empty\n if (!text || text && text.trim() === '') {\n return;\n }\n\n if (Settings.isTouchDevice() && target && target.hasAttribute(ATTR_DATA_NO_TOUCH)) {\n return;\n }\n\n let tooltipContainer = this.tooltipContainer;\n\n if (!tooltipContainer) {\n tooltipContainer = doc.createElement('div');\n this.container.appendChild(tooltipContainer);\n this.tooltipContainer = tooltipContainer;\n }\n this._restoreClassNames(tooltipContainer, target);\n\n tooltipContainer.style.left = 'auto';\n tooltipContainer.style.top = 'auto';\n tooltipContainer.innerHTML = text;\n tooltipContainer.flexTooltipCurrentTarget = target;\n if (removeTitle) {\n target.oldTitle = text;\n target.removeAttribute('title');\n }\n\n Util.setupPositionNearby(positionRelative || target, tooltipContainer,\n this.options.collisionContainer, true, true);\n\n tooltipContainer.classList.add(CLASS_NAMES_OPEN);\n }\n\n _restoreClassNames(container, target) {\n // allow additional classname per tooltip on target element\n const classNames = [CLASS_NAMES_TOOLTIP, this.options.containerClass];\n const maybeTargetClass = target.getAttribute(ATTR_DATA_CLASSNAME);\n if (maybeTargetClass) {\n classNames.push(maybeTargetClass);\n }\n container.className = classNames.join(\" \");\n return this;\n }\n\n /**\n * @returns {HTMLElement|null}\n */\n getCurrentTarget() {\n return this.tooltipContainer ? this.tooltipContainer.flexTooltipCurrentTarget : null;\n }\n\n /**\n * Destroys this Widget\n * @returns {boolean}\n */\n destroy() {\n super.destroy();\n\n if (this.tooltipContainer) {\n this.tooltipContainer.parentNode.removeChild(this.tooltipContainer);\n return true;\n }\n return false;\n }\n\n /**\n * Removes a Tooltip on given target\n * @param {HTMLElement} [target], if not given will remove current open tooltip on this instance\n */\n removeTooltip(target) {\n let selfTarget = target;\n if (!selfTarget && this.tooltipContainer) {\n selfTarget = this.tooltipContainer.flexTooltipCurrentTarget;\n }\n if (this.tooltipContainer) {\n if (this.tooltipContainer.flexTooltipCurrentTarget !== selfTarget) {\n return;\n }\n this.tooltipContainer.classList.remove(CLASS_NAMES_OPEN);\n delete this.tooltipContainer.flexTooltipCurrentTarget;\n }\n if (selfTarget && selfTarget.oldTitle) {\n selfTarget.setAttribute('title', selfTarget.oldTitle);\n }\n }\n\n /**\n * Initilizes mouse events on container element\n */\n registerEvents() {\n const self = this;\n this.addEventListener(this.container, 'mouseover', (e) => {\n if (e.target.hasAttribute(self.options.selectorAttribute)) {\n self.createTooltip(e.target, e.target.getAttribute('title'), true);\n }\n });\n\n this.addEventListener(this.container, 'mouseout', (e) => {\n if (e.target.hasAttribute(self.options.selectorAttribute)) {\n self.removeTooltip(e.target);\n }\n });\n return this;\n }\n}\n\nexport default Tooltip;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/main/Tooltip.js\n **/","/*global HTMLFormElement, fetch, FormData, clearTimeout, NodeList*/\n\n/*\n * The MIT License (MIT)\n *\n * Copyright (c) 2015 David Heidrich, BowlingX \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n/*!\n * FlexCss.Form\n * Licensed under the MIT License (MIT)\n * Copyright (c) 2015 David Heidrich, BowlingX \n */\n\nimport Tooltip from './Tooltip';\nimport 'isomorphic-fetch';\nimport Event from './util/Event';\nimport Util from './util/Util';\nimport Settings from './util/Settings';\nimport DestroyableWidget from './DestroyableWidget';\n\nconst LOADING_CLASS = 'loading';\nconst DATA_ELEMENT_INVALID = 'data-flexcss-invalid';\nconst REMOTE = 'data-remote';\nconst REMOTE_ACTION = 'data-remote-action';\nconst ATTR_DISABLE_INLINE = 'data-disable-inline-validation';\nconst ATTR_DISABLE_REALTIME = 'data-disable-realtime-validation';\nconst ATTR_VALIDATOR = 'data-validate';\nconst ATTR_DATA_CUSTOM_MESSAGE = 'data-validation-message';\nconst ATTR_DATA_CUSTOM_LABEL = 'data-custom-label';\nconst ATTR_VALIDATE_VISIBILITY = 'data-validate-visibility';\nconst ATTR_ERROR_TARGET_ID = 'data-error-target';\nconst ATTR_DEPENDS = 'data-depends-selector';\nconst CONST_USE_JSON = 'json';\nconst CONST_REALTIME_EVENT = 'input';\nconst FOCUS_TOOLTIP_DELAY = 20;\nconst CLICK_TOOLTIP_DELAY = 150;\n\n/**\n * Triggered when form is fully initialized and handlers are binded\n * @type {string}\n */\nexport const EVENT_FORM_READY = 'flexcss.form.ready';\n/**\n * Fires when a form is submitted, cancelable\n * @type {string}\n */\nexport const EVENT_FORM_SUBMIT = 'flexcss.form.submit';\n/**\n * Fired directly after the form has been submitted via ajax\n * @type {string}\n */\nexport const EVENT_FORM_AFTER_AJAX_SUBMIT = 'flexcss.form.afterAjaxSubmit';\n/**\n * Fired when ajax events did complete\n * @type {string}\n */\nexport const EVENT_FORM_AJAX_COMPLETED = 'flexcss.form.ajaxCompleted';\n\n/**\n * A HTML5 Form Validation replacement\n */\n\nclass Form extends DestroyableWidget {\n /**\n * @param {HTMLElement} form\n * @param [options] optional options\n */\n constructor(form, options) {\n super();\n\n if (!(form instanceof HTMLFormElement)) {\n throw 'argument {0} form needs to be an form element';\n }\n\n /**\n * The Form\n * @type {HTMLElement}\n */\n this.form = form;\n\n /**\n * @type {Tooltip}\n */\n this.tooltips = null;\n\n /**\n * @type {Promise}\n */\n this.currentValidationFuture = new Promise(() => {\n });\n\n /**\n * Default options\n * @type {Object}\n */\n this.options = {\n // if true creates tooltips above element, uses FlexCss Tooltips\n createTooltips: true,\n // if true appends error message after input element\n appendError: false,\n // type of ajax submit\n ajaxSubmitType: 'POST',\n // json content type if ajax method is set to json\n ajaxJsonContentType: 'application/json; charset=utf-8',\n // allow inline validation\n inlineValidation: true,\n // validate in realtime (on `input` event)\n realtime: true,\n // timeout when realtime event should be captured\n realtimeTimeout: 250,\n // formatting method for an error\n formatErrorTooltip: (error) => {\n return ' ' + error;\n },\n // the class that will be put on the element to mark it failed validation\n inputErrorClass: 'invalid',\n // the container class for error messages below an element\n containerErrorClass: 'form-error',\n // additional options for fetch\n fetchOptions: {\n credentials: 'include'\n },\n // the container for tooltips\n tooltipContainer: form,\n tooltipOptions: {\n containerClass: 'error-tooltip'\n },\n // if you have a fixed header, either set a number or function here\n scrollToElementDiff: 0\n };\n\n // overwrite default options\n Object.assign(this.options, options);\n\n // apply settings from attributes\n Util.applyOptionsFromElement(form, this.options);\n\n // set form class as widget\n // Forms are very different to classical widgets,\n // we will not use our base widget class for this but just self\n form.hfWidgetInstance = this;\n\n /**\n * A List of Validators\n * @type {Object}\n * @private\n */\n this._validators = Form.globalValidators;\n\n /**\n * @type {Function}\n * @private\n */\n this._remoteValidationFunction = null;\n\n this.initFormValidation();\n }\n\n destroy() {\n super.destroy();\n if (this.tooltips) {\n this.tooltips.destroy();\n }\n }\n\n /**\n * Submits this form, either via ajax or just classical (default)\n * @param {HTMLFormElement} thisForm\n * @param {Event} e\n * @private\n * @returns {Promise|boolean} returns false if submit is cancled\n */\n _submitFunction(thisForm, e) {\n var shouldUseAjax = thisForm.getAttribute(REMOTE), ajaxPostUrl =\n thisForm.getAttribute(REMOTE_ACTION) ||\n thisForm.getAttribute('action') || window.location.href,\n useJson = CONST_USE_JSON === shouldUseAjax, self = this;\n\n var ev = Event.dispatch(thisForm, EVENT_FORM_SUBMIT).withOriginal(e).fire();\n\n // abort execution is event was prevented\n if (ev.defaultPrevented) {\n self._formStopLoading();\n return false;\n }\n\n if (shouldUseAjax === null) {\n // submit\n return thisForm.submit();\n }\n // prevent form from submit normally\n e.preventDefault();\n\n // add information that this is an XMLHttpRequest request (used by some frameworks)\n let defaultHeaders = {\n 'X-Requested-With': 'XMLHttpRequest'\n };\n\n // setup default headers\n if (useJson) {\n Object.assign(defaultHeaders, {\n 'Content-Type': this.options.ajaxJsonContentType\n });\n }\n let defaultOptions = Object.assign(this.options.fetchOptions, {\n headers: defaultHeaders,\n method: this.options.ajaxSubmitType\n });\n\n // support either JSON request payload or normal payload submission\n var serverCall = useJson ? fetch(ajaxPostUrl, Object.assign(defaultOptions, {\n body: JSON.stringify(this.serialize())\n })) : fetch(ajaxPostUrl, Object.assign(defaultOptions, {\n body: new FormData(thisForm)\n }));\n\n Event.dispatch(thisForm, EVENT_FORM_AFTER_AJAX_SUBMIT).withOriginal(e).fire();\n\n return serverCall.then((r) => {\n (self._remoteValidationFunction || Form.globalRemoteValidationFunction).apply(self, [r]);\n\n Event.dispatch(thisForm, EVENT_FORM_AJAX_COMPLETED).withOriginal(e).withDetail({ response: r }).fire();\n // always remove error class\n self._formStopLoading();\n });\n }\n\n /**\n * Serializes a form to a json object\n * @returns {Object}\n */\n serialize() {\n var selectors = [\n 'input[name]:not([type=\"radio\"]):enabled',\n 'input[type=\"radio\"][name]:checked',\n 'select[name]:enabled',\n 'textarea[name]:enabled'\n ], inputs = this.form.querySelectorAll(selectors.join(',')), result = {};\n\n Array.prototype.forEach.call(inputs, function (input) {\n var exists = result[input.name], value = input.value;\n if (exists instanceof Array) {\n exists.push(value);\n } else if (exists) {\n result[input.name] = [result[input.name], value];\n } else {\n result[input.name] = value;\n }\n });\n\n return result;\n }\n\n /**\n * Handles the chain of validation on given fields\n *\n * @param {HTMLElement|Array|NodeList} field\n * @param [focus] optional focus first error\n * @returns {Promise}\n */\n handleValidation(field, focus) {\n var fields = (field instanceof Array || field instanceof NodeList) ? field : [field];\n return this._handleValidation(fields, focus, true).then(((r) => {\n if (!r.foundAnyError) {\n // remove tooltips\n if (this.tooltips) {\n this.tooltips.removeTooltip();\n }\n }\n return r;\n }).bind(this));\n }\n\n /**\n * Handles errors on given node list\n * @param {NodeList} toValidateFields\n * @param {boolean} focus\n * @param {boolean} scoped if true, will only validate the fields `invalidFields`\n * @returns {Promise}\n * @private\n */\n _handleValidation(toValidateFields, focus, scoped) {\n var self = this;\n var arr = Form._createArrayFromInvalidFieldList(toValidateFields), isLocalInvalid = arr.length > 0;\n // focus must appear in the same frame for iOS devices\n if (isLocalInvalid && focus) {\n self._focusElement(arr[0]);\n }\n var validation = scoped ? this._customValidationsForElements(toValidateFields) :\n self.validateCustomFields();\n return validation.then((r) => {\n if (isLocalInvalid) {\n // combine browser and custom validators\n r.foundAnyError = true;\n }\n // get a unique field list of all fields that need to be checked and rendered\n // it's possible that we have duplicates in non scoped mode\n let thisToValidateFields = scoped ? toValidateFields :\n Array.from(arr).concat(r.checkedFields);\n r.checkedFields = thisToValidateFields;\n let foundInvalidFields = self.prepareErrors(thisToValidateFields, false),\n firstInvalidField = foundInvalidFields[0];\n if (firstInvalidField) {\n if (focus) {\n self._focusElement(firstInvalidField);\n // if element could not be focused:\n if (document.activeElement !== firstInvalidField) {\n self._handleTooltipHideClickAfterChange();\n }\n } else {\n self._handleTooltipHideClickAfterChange();\n }\n self.showAndOrCreateTooltip(firstInvalidField);\n }\n return r;\n });\n }\n\n /**\n * @param {HTMLElement} field\n * @param {ValidityState} validity\n * @returns {*}\n * @private\n */\n\n _setupErrorMessages(field, validity) {\n return Form.globalErrorMessageHandler ?\n Form.globalErrorMessageHandler.apply(this, [field, validity]) : false;\n }\n\n /**\n * Handles class labels for elements\n * @param {Object} fields\n * @private\n */\n _handleLabels(fields) {\n Object.keys(fields).forEach(function (id) {\n let labels = this.getForm().querySelectorAll('[for=\"' + id + '\"]'), invalid = fields[id];\n if (labels.length) {\n for (let labelsIndex = 0; labelsIndex < labels.length; labelsIndex++) {\n let labelEl = labels[labelsIndex];\n // we can't use toggle attribute, not supported in IE\n if (invalid) {\n this._markElementInvalid(labelEl);\n } else {\n this._markElementValid(labelEl);\n }\n }\n }\n }.bind(this));\n }\n\n /**\n * @param el\n * @private\n */\n _markElementInvalid(el) {\n el.setAttribute(DATA_ELEMENT_INVALID, \"true\");\n el.classList.add(this.options.inputErrorClass);\n }\n\n /**\n * @param el\n * @private\n */\n _markElementValid(el) {\n el.removeAttribute(DATA_ELEMENT_INVALID);\n el.classList.remove(this.options.inputErrorClass);\n }\n\n /**\n * A List of invalid elements (:invalid)\n * @returns {Array}\n * @private\n */\n _getInvalidElements() {\n return Array.prototype.filter.call(this.getForm().querySelectorAll(\":invalid\"), function (r) {\n return !(r instanceof HTMLFieldSetElement);\n });\n }\n\n /**\n * @param {HTMLElement} thisParent\n * @private\n */\n _removeElementErrors(thisParent) {\n let errors = thisParent.querySelectorAll('.' + this.options.containerErrorClass), inputsWithErrorClasses =\n thisParent.querySelectorAll(`[${DATA_ELEMENT_INVALID}]`);\n for (let elementErrorIndex = 0; elementErrorIndex < errors.length; elementErrorIndex++) {\n errors[elementErrorIndex].parentNode.removeChild(errors[elementErrorIndex]);\n }\n for (let inputErrorIndex = 0; inputErrorIndex < inputsWithErrorClasses.length; inputErrorIndex++) {\n let el = inputsWithErrorClasses[inputErrorIndex];\n this._markElementValid(el);\n }\n }\n\n\n /**\n * Registers a custom validator\n * @param {String} name\n * @param {Function} validator a validation function should always return either a Future(true) or Future(false)\n * even when the field has been invalidated with `setCustomValidity`, because of different browser `bugs`\n * we can't rely on that\n * @returns {Form}\n */\n registerValidator(name, validator) {\n this._validators[name] = validator;\n return this;\n }\n\n /**\n * Runs async validation\n * @param {String} validationRef\n * @param {HTMLElement} field\n * @returns {Promise}\n * @private\n */\n _runValidation(validationRef, field) {\n if (!this._validators[validationRef]) {\n throw 'Could not found validator: ' + validationRef;\n }\n var cl = field.classList, future = this._validators[validationRef].apply(this, [field, this.form]);\n cl.add(LOADING_CLASS);\n future.then(() => {\n cl.remove(LOADING_CLASS);\n });\n return future;\n }\n\n\n /**\n * Run custom validations for elements, validations are done async do support XHR Requests or other stuff\n *\n * @param {Array|NodeList} fields\n * @returns {Promise} contains either true if validations passed or false if something went wrong\n * @private\n */\n _customValidationsForElements(fields) {\n var futures = [], fieldsLength = fields.length, checkedFields = [];\n for (var iVal = 0; iVal < fieldsLength; iVal++) {\n var field = fields[iVal], validationRef = field.getAttribute(ATTR_VALIDATOR), validity = field.validity;\n if (this._validators[validationRef]) {\n // use local validation first and then continue with custom validations\n if (Form._shouldNotValidateField(field) || (validity && !validity.customError && !validity.valid)) {\n continue;\n }\n checkedFields.push(field);\n futures.push(this._runValidation(validationRef, field));\n } else {\n if (validationRef) {\n console.warn('data-validate was set but no validator was found');\n }\n }\n }\n return Promise.all(futures).then(function (allFutures) {\n let l = allFutures.length;\n let result = {\n checkedFields: checkedFields,\n foundAnyError: false\n };\n for (var fI = 0; fI < l; fI++) {\n if (!allFutures[fI]) {\n result.foundAnyError = true;\n break;\n }\n }\n return result;\n });\n }\n\n /**\n * Remove all errors for this form\n * @returns {Form}\n */\n removeErrors() {\n this._removeElementErrors(this.form);\n if (this.tooltips) {\n this.tooltips.removeTooltip();\n }\n return this;\n }\n\n /**\n * Will handle errors for given fields\n * @param {Array|NodeList} fields\n * @param {Boolean} removeAllErrors\n */\n prepareErrors(fields, removeAllErrors) {\n if (removeAllErrors) {\n this.removeErrors();\n }\n let labelGroups = {}, invalidFields = [];\n\n function handleAdditionalLabels(isInvalid, thisLabelGroup, field) {\n let additionalLabels = field.getAttribute(ATTR_DATA_CUSTOM_LABEL) ||\n field.id, group = thisLabelGroup[additionalLabels];\n if (additionalLabels) {\n // check additionally if field is currently marked as invalid\n // so the label is not marked as error if no field is marked as one\n group = group ? group : isInvalid;\n thisLabelGroup[additionalLabels] = group;\n }\n }\n\n // We save all validations in an extra property because we need to reset the validity due some\n // implementation errors in other browsers then chrome\n for (let i = 0; i < fields.length; i++) {\n let field = fields[i], errorTarget = Form._findErrorTarget(field), parent = errorTarget.parentNode,\n validity = field.validity, isInvalid = validity && !validity.valid;\n if (Form._shouldNotValidateField(field)) {\n continue;\n }\n field.flexFormsSavedValidity = JSON.parse(JSON.stringify(validity));\n handleAdditionalLabels(isInvalid, labelGroups, field);\n if (isInvalid) {\n if (!removeAllErrors) {\n // Remove current errors:\n this._removeElementErrors(parent);\n }\n // setup custom error messages:\n this._setupErrorMessages(field, validity);\n let msg = field.validationMessage;\n\n // mark fields as invalid\n this._markElementInvalid(errorTarget);\n this._markElementInvalid(field);\n\n if (this.options.appendError) {\n parent.insertAdjacentHTML(\"beforeend\",\n `
${msg}
`);\n }\n invalidFields.push(field);\n field.flexFormsSavedValidationMessage = msg;\n } else {\n // restore invalid fields\n this._markElementValid(errorTarget);\n this._markElementValid(field);\n\n // cleanup\n delete field.flexFormsSavedValidationMessage;\n\n // remove error markup\n this._removeElementErrors(parent);\n }\n // We have to reset the custom validity here to allow native validations work again\n field.setCustomValidity('');\n }\n // if validates a single field we need to check the linked fields to a label:\n if (fields.length === 1) {\n let field = fields[0];\n let id = field.getAttribute(ATTR_DATA_CUSTOM_LABEL) || field.id;\n if (id) {\n let linkedFields = Array.from(\n this.getForm().querySelectorAll(`[${ATTR_DATA_CUSTOM_LABEL}=\"${id}\"], #${id}`));\n linkedFields.forEach(function (thisField) {\n let validity = thisField.validity, isInvalid = validity && !validity.valid &&\n this._isElementInvalidElement(thisField);\n handleAdditionalLabels(isInvalid, labelGroups, thisField);\n }.bind(this));\n }\n }\n this._handleLabels(labelGroups);\n return invalidFields;\n }\n\n /**\n * Validates all custom fields\n * @returns {Promise}\n */\n validateCustomFields() {\n return this._customValidationsForElements(\n this.form.querySelectorAll(\"[data-validate]\"));\n }\n\n /**\n * Tests if a field should be validated\n * @param {HTMLElement} field\n * @returns {boolean}\n * @private\n */\n static _shouldNotValidateField(field) {\n var target = Form._findErrorTarget(field);\n return target instanceof HTMLFieldSetElement || field.validity === undefined ||\n (target.hasAttribute(ATTR_VALIDATE_VISIBILITY) && !Util.isVisible(target));\n }\n\n /**\n * Creates an array from a node list with invalid items\n * This Method expicitly checks if field should not be validated so it can be used to foucs a field\n * @param list\n * @returns {Array}\n * @private\n */\n static _createArrayFromInvalidFieldList(list) {\n var arr = [];\n for (var i = 0; i < list.length; ++i) {\n var n = list[i];\n if (n.validity && !n.validity.valid) {\n if (!Form._shouldNotValidateField(n)) {\n arr.push(n);\n }\n }\n }\n return arr;\n }\n\n\n /**\n * This form\n * @returns {HTMLElement}\n */\n getForm() {\n return this.form;\n }\n\n /**\n * Registers a function that handles remote validation\n * @param {Function} func\n * @returns {Form}\n */\n registerRemoteValidation(func) {\n this._remoteValidationFunction = func;\n return this;\n }\n\n\n /**\n * Formats the error content for the tooltip\n * @param {String} error\n * @returns {String}\n * @private\n */\n _formatErrorTooltip(error) {\n return this.options.formatErrorTooltip.apply(this, [error]);\n }\n\n /**\n * Tries to find a custom error target on given target\n * @param target\n * @returns {HTMLElement}\n * @private\n */\n static _findErrorTarget(target) {\n var el = target.getAttribute(ATTR_ERROR_TARGET_ID) || target,\n foundTarget = el instanceof HTMLElement ? el : global.document.getElementById(el);\n if (!foundTarget) {\n throw 'Given error target did not exsits:' + target;\n }\n return foundTarget;\n }\n\n /**\n * Creates a tooltip at given element, will only create a new instance if not created\n * @param {HTMLElement} target\n * @param {Boolean} [remove]\n */\n showAndOrCreateTooltip(target, remove) {\n var self = this;\n if (!this.tooltips && this.options.createTooltips) {\n this.tooltips = new Tooltip(this.options.tooltipContainer, this.options.tooltipOptions);\n }\n if (!this.options.createTooltips) {\n return false;\n }\n\n if (!target.flexFormsSavedValidity) {\n return false;\n }\n var errorTarget = Form._findErrorTarget(target);\n if (!target.flexFormsSavedValidity.valid && self._isElementInvalidElement(errorTarget)) {\n self.tooltips.createTooltip(errorTarget,\n self._formatErrorTooltip(target.flexFormsSavedValidationMessage), false);\n return true;\n } else {\n if (remove) {\n self.tooltips.removeTooltip();\n }\n }\n return false;\n }\n\n /**\n * Checks if element is marked as invalid\n * @param {HTMLElement} el\n * @returns {boolean}\n * @private\n */\n _isElementInvalidElement(el) {\n return el.hasAttribute(DATA_ELEMENT_INVALID);\n }\n\n /**\n * Handles invalid event of a form\n * @param {Event} e\n * @returns {Promise|boolean}\n * @private\n */\n _checkIsInvalid(e) {\n e.preventDefault();\n var invalidFields = this.getForm().querySelectorAll(\":invalid\");\n return this._handleValidation(invalidFields, true, false);\n }\n\n /**\n * Will query dependent fields (by selector) that should be validated with given field\n * @param field\n * @returns {NodeList|[]}\n * @private\n */\n _getDependentFields(field) {\n let fieldSelector = field.getAttribute(ATTR_DEPENDS), base = [field];\n if (fieldSelector) {\n base.push.apply(base, Array.prototype.slice.apply(\n this.getForm().querySelectorAll(fieldSelector)));\n }\n return base;\n }\n\n /**\n * @private\n * @param {HTMLElement} [target]\n */\n _handleTooltipInline(target) {\n if (this.tooltips) {\n this.tooltips.removeTooltip(target);\n }\n }\n\n /**\n * Initializes validation for a given form, registers event handlers\n */\n initFormValidation() {\n // Suppress the default bubbles\n var form = this.getForm(),\n self = this,\n invalidEvent = 'invalid';\n\n /**\n * Validates if is valid realtime element\n * @param {HTMLElement} target\n * @returns {boolean}\n * @private\n */\n function _checkIsValidRealtimeElement(target) {\n return !target.hasAttribute(ATTR_DISABLE_REALTIME) && !target.hasAttribute(ATTR_DISABLE_INLINE);\n }\n\n form.addEventListener(invalidEvent, function (e) {\n e.preventDefault();\n }, true);\n\n Util.addEventOnce(invalidEvent, form, function handleInvalid(e) {\n self._formLoading();\n var result = self._checkIsInvalid(e);\n if (result) {\n self.currentValidationFuture = new Promise((resolve) => {\n result.then(function (r) {\n setTimeout(function () {\n Util.addEventOnce(invalidEvent, form, handleInvalid, true);\n }, 0);\n resolve(r);\n self._formStopLoading();\n if (!r.foundAnyError) {\n self._formLoading();\n self._handleSubmit(e);\n }\n });\n });\n }\n }, true);\n\n this.addEventListener(form, 'reset', () => {\n this.removeErrors();\n });\n\n // Timeout for keys:\n var TIMEOUT_KEYDOWN, KEYDOWN_RUNNING = false;\n\n // resets keydown events\n function clearKeyDownTimeout() {\n KEYDOWN_RUNNING = false;\n clearTimeout(TIMEOUT_KEYDOWN);\n }\n\n // setup custom realtime event if given\n if (self.options.realtime) {\n this.addEventListener(form, CONST_REALTIME_EVENT, function (e) {\n if (self._formIsLoading()) {\n return;\n }\n var target = e.target;\n clearTimeout(TIMEOUT_KEYDOWN);\n if (KEYDOWN_RUNNING) {\n return;\n }\n TIMEOUT_KEYDOWN = setTimeout(() => {\n let isStillTarget = document.activeElement === e.target;\n if (!_checkIsValidRealtimeElement(target)) {\n return;\n }\n if (isStillTarget) {\n self._handleTooltipInline();\n }\n KEYDOWN_RUNNING = true;\n let dependentFields = self._getDependentFields(target);\n self._customValidationsForElements(dependentFields).then(function () {\n self.prepareErrors(dependentFields, false);\n if (isStillTarget) {\n self.showAndOrCreateTooltip(e.target);\n }\n // future must be resolved before another event can be started\n KEYDOWN_RUNNING = false;\n });\n }, self.options.realtimeTimeout);\n }, true);\n }\n\n /**\n * Validates if target is a valid input field to check blur and focus events\n *\n * @param {HTMLElement} target\n * @returns {boolean}\n * @private\n */\n function _checkIsValidBlurFocusElement(target) {\n let attr = target.getAttribute(\"type\");\n return (attr !== \"radio\" && attr !== \"checkbox\" && attr !== \"submit\");\n }\n\n /**\n * Validates if is valid inline-check element\n * @param {HTMLElement} target\n * @returns {boolean}\n * @private\n */\n function _checkIsValidInlineCheckElement(target) {\n return !target.hasAttribute(ATTR_DISABLE_INLINE);\n }\n\n this.addEventListener(form, 'blur', function (e) {\n // do not hide tooltip after change event\n if (!e.target.flexcssKeepTooltips) {\n self._handleTooltipInline(e.target);\n }\n delete e.target.flexcssKeepTooltips;\n }, true);\n\n // handle focus on input elements\n // will show an error if field is invalid\n this.addEventListener(form, \"focus\", function (e) {\n if (self._formIsLoading()) {\n return;\n }\n // do not track errors for checkbox and radios on focus:\n if (!_checkIsValidBlurFocusElement(e.target)) {\n return;\n }\n // we need to delay this a little, because Firefox and Safari do not show a tooltip after it\n // just have been hidden (on blur). Maybe fix this with a queue later\n setTimeout(function () {\n self.showAndOrCreateTooltip(e.target);\n }, FOCUS_TOOLTIP_DELAY);\n }, true);\n\n if (self.options.inlineValidation) {\n // Handle change for checkbox, radios and selects\n this.addEventListener(form, \"change\", function (e) {\n const target = e.target;\n if (self._formIsLoading() || !_checkIsValidInlineCheckElement(target)) {\n return;\n }\n clearKeyDownTimeout();\n const name = target.getAttribute('name');\n let inputs = name ? form.querySelectorAll('[name=\"' + name + '\"]') : [target];\n // we only support dependent fields for a single widgets right now\n if (inputs.length === 1) {\n inputs = self._getDependentFields(target);\n }\n self._customValidationsForElements(inputs).then(function () {\n self.prepareErrors(inputs, false);\n target.flexcssKeepTooltips = self.showAndOrCreateTooltip(target, true);\n if (target.flexcssKeepTooltips) {\n self._handleTooltipHideClickAfterChange();\n }\n });\n });\n }\n\n // prevent default if form is invalid\n this.addEventListener(form, \"submit\", function listener(e) {\n self._submitListener(e, listener);\n });\n\n Event.dispatchAndFire(form, EVENT_FORM_READY);\n }\n\n /* Loading states, unfortunately we can't check if a promise is pending :/*/\n /* TODO: Maybe wrap promise to extend this functionality */\n\n _formLoading() {\n this.getForm().classList.add(LOADING_CLASS);\n }\n\n _formStopLoading() {\n this.getForm().classList.remove(LOADING_CLASS);\n }\n\n _formIsLoading() {\n return this.getForm().classList.contains(LOADING_CLASS);\n }\n\n // this defines the logic after a change event when a tooltip is shown\n // because we call this method inside the change event, the click would be immeditally executed with the change\n // event when not using setTimeout(). There might be another solution for this...\n _handleTooltipHideClickAfterChange() {\n const self = this;\n if (this.options.createTooltips) {\n setTimeout(function () {\n Util.addEventOnce(Settings.getTabEvent(), global.document.body, function (t) {\n if (!self._isElementInvalidElement(t.target)) {\n self._handleTooltipInline();\n }\n });\n }, CLICK_TOOLTIP_DELAY);\n }\n }\n\n _focusElement(el) {\n el.focus();\n Util.scrollToElement(el, this.options.scrollToElementDiff);\n }\n\n /**\n * Listener that is executed on form submit\n * @param e\n * @param submitListener\n * @returns {boolean}\n * @private\n */\n _submitListener(e, submitListener) {\n\n const form = this.getForm(),\n self = this,\n submitEvent = 'submit';\n\n if (this._formIsLoading()) {\n e.preventDefault();\n return false;\n }\n this._formLoading();\n form.removeEventListener(submitEvent, submitListener);\n this.removeErrors();\n e.preventDefault();\n // reset:\n if (form.checkValidity()) {\n form.addEventListener(submitEvent, submitListener);\n // It's possible that the form is valid but the custom validations need to be checked again:\n self.currentValidationFuture = new Promise((resolve) => {\n var validation = self.validateCustomFields();\n validation.then(function (r) {\n // because custom validators may mark multiple fields as invalid, we get all of them in the form\n var fields = self._getInvalidElements(),\n errors = self.prepareErrors(fields, false), firstError = errors[0];\n if (firstError) {\n self._focusElement(firstError);\n self.showAndOrCreateTooltip(firstError, true);\n }\n resolve(r);\n });\n });\n self.currentValidationFuture.then(function (r) {\n if (!r.foundAnyError) {\n // Handle submitting the form to server:\n self._handleSubmit(e);\n } else {\n self._formStopLoading();\n }\n });\n } else {\n self._formStopLoading();\n form.addEventListener(submitEvent, submitListener);\n }\n }\n\n\n /**\n * Handles submitting, optionally allows to stop submitting\n * @param e\n * @private\n */\n _handleSubmit(e) {\n this._submitFunction(this.form, e);\n }\n\n\n /**\n * Registers a global event Handler\n * @param errorFunc\n */\n static registerErrorMessageHandler(errorFunc) {\n Form.globalErrorMessageHandler = errorFunc;\n }\n\n /**\n * Initialize forms for a specific selector\n * @param {String} selector\n * @param {Object} [options]\n * @return {array.}\n */\n static init(selector, options) {\n var forms = selector instanceof HTMLElement ? selector.querySelectorAll('form') :\n document.querySelectorAll(selector), instances = [];\n for (var i = 0; i < forms.length; i++) {\n instances.push(new Form(forms[i], options));\n }\n return instances;\n }\n\n\n /**\n * Registers a global validator that is usable on all form instances\n * @param {String} name\n * @param {Function} validator\n * @returns {Function}\n */\n static registerValidator(name, validator) {\n Form.globalValidators[name] = validator;\n return Form;\n }\n\n /**\n * Registers a global function that is called when a form should validate the response of a server\n * @param {Function} func\n * @returns {Form}\n */\n static registerGlobalRemoteValidationFunction(func) {\n Form.globalRemoteValidationFunction = func;\n return Form;\n }\n}\n\n\n/**\n * Global validators\n * @type {Array}\n */\nForm.globalValidators = [];\n\n/**\n * Global Remote validation function\n */\nForm.globalRemoteValidationFunction = function () {\n};\n\n/**\n * Handles custom error messages extracts custom message by default\n */\nForm.globalErrorMessageHandler = (field, validity) => {\n if (!validity.customError) {\n let customMsg = field.getAttribute(ATTR_DATA_CUSTOM_MESSAGE);\n if (customMsg) {\n field.setCustomValidity(customMsg);\n }\n }\n};\n\nexport default Form;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/main/Form.js\n **/","// the whatwg-fetch polyfill installs the fetch() function\n// on the global object (window or self)\n//\n// Return that as the export for use in Webpack, Browserify etc.\nrequire('whatwg-fetch');\nmodule.exports = self.fetch.bind(self);\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/isomorphic-fetch/fetch-npm-browserify.js\n ** module id = 11\n ** module chunks = 0 1\n **/","(function(self) {\n 'use strict';\n\n if (self.fetch) {\n return\n }\n\n function normalizeName(name) {\n if (typeof name !== 'string') {\n name = String(name)\n }\n if (/[^a-z0-9\\-#$%&'*+.\\^_`|~]/i.test(name)) {\n throw new TypeError('Invalid character in header field name')\n }\n return name.toLowerCase()\n }\n\n function normalizeValue(value) {\n if (typeof value !== 'string') {\n value = String(value)\n }\n return value\n }\n\n function Headers(headers) {\n this.map = {}\n\n if (headers instanceof Headers) {\n headers.forEach(function(value, name) {\n this.append(name, value)\n }, this)\n\n } else if (headers) {\n Object.getOwnPropertyNames(headers).forEach(function(name) {\n this.append(name, headers[name])\n }, this)\n }\n }\n\n Headers.prototype.append = function(name, value) {\n name = normalizeName(name)\n value = normalizeValue(value)\n var list = this.map[name]\n if (!list) {\n list = []\n this.map[name] = list\n }\n list.push(value)\n }\n\n Headers.prototype['delete'] = function(name) {\n delete this.map[normalizeName(name)]\n }\n\n Headers.prototype.get = function(name) {\n var values = this.map[normalizeName(name)]\n return values ? values[0] : null\n }\n\n Headers.prototype.getAll = function(name) {\n return this.map[normalizeName(name)] || []\n }\n\n Headers.prototype.has = function(name) {\n return this.map.hasOwnProperty(normalizeName(name))\n }\n\n Headers.prototype.set = function(name, value) {\n this.map[normalizeName(name)] = [normalizeValue(value)]\n }\n\n Headers.prototype.forEach = function(callback, thisArg) {\n Object.getOwnPropertyNames(this.map).forEach(function(name) {\n this.map[name].forEach(function(value) {\n callback.call(thisArg, value, name, this)\n }, this)\n }, this)\n }\n\n function consumed(body) {\n if (body.bodyUsed) {\n return Promise.reject(new TypeError('Already read'))\n }\n body.bodyUsed = true\n }\n\n function fileReaderReady(reader) {\n return new Promise(function(resolve, reject) {\n reader.onload = function() {\n resolve(reader.result)\n }\n reader.onerror = function() {\n reject(reader.error)\n }\n })\n }\n\n function readBlobAsArrayBuffer(blob) {\n var reader = new FileReader()\n reader.readAsArrayBuffer(blob)\n return fileReaderReady(reader)\n }\n\n function readBlobAsText(blob) {\n var reader = new FileReader()\n reader.readAsText(blob)\n return fileReaderReady(reader)\n }\n\n var support = {\n blob: 'FileReader' in self && 'Blob' in self && (function() {\n try {\n new Blob();\n return true\n } catch(e) {\n return false\n }\n })(),\n formData: 'FormData' in self,\n arrayBuffer: 'ArrayBuffer' in self\n }\n\n function Body() {\n this.bodyUsed = false\n\n\n this._initBody = function(body) {\n this._bodyInit = body\n if (typeof body === 'string') {\n this._bodyText = body\n } else if (support.blob && Blob.prototype.isPrototypeOf(body)) {\n this._bodyBlob = body\n } else if (support.formData && FormData.prototype.isPrototypeOf(body)) {\n this._bodyFormData = body\n } else if (!body) {\n this._bodyText = ''\n } else if (support.arrayBuffer && ArrayBuffer.prototype.isPrototypeOf(body)) {\n // Only support ArrayBuffers for POST method.\n // Receiving ArrayBuffers happens via Blobs, instead.\n } else {\n throw new Error('unsupported BodyInit type')\n }\n\n if (!this.headers.get('content-type')) {\n if (typeof body === 'string') {\n this.headers.set('content-type', 'text/plain;charset=UTF-8')\n } else if (this._bodyBlob && this._bodyBlob.type) {\n this.headers.set('content-type', this._bodyBlob.type)\n }\n }\n }\n\n if (support.blob) {\n this.blob = function() {\n var rejected = consumed(this)\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return Promise.resolve(this._bodyBlob)\n } else if (this._bodyFormData) {\n throw new Error('could not read FormData body as blob')\n } else {\n return Promise.resolve(new Blob([this._bodyText]))\n }\n }\n\n this.arrayBuffer = function() {\n return this.blob().then(readBlobAsArrayBuffer)\n }\n\n this.text = function() {\n var rejected = consumed(this)\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return readBlobAsText(this._bodyBlob)\n } else if (this._bodyFormData) {\n throw new Error('could not read FormData body as text')\n } else {\n return Promise.resolve(this._bodyText)\n }\n }\n } else {\n this.text = function() {\n var rejected = consumed(this)\n return rejected ? rejected : Promise.resolve(this._bodyText)\n }\n }\n\n if (support.formData) {\n this.formData = function() {\n return this.text().then(decode)\n }\n }\n\n this.json = function() {\n return this.text().then(JSON.parse)\n }\n\n return this\n }\n\n // HTTP methods whose capitalization should be normalized\n var methods = ['DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT']\n\n function normalizeMethod(method) {\n var upcased = method.toUpperCase()\n return (methods.indexOf(upcased) > -1) ? upcased : method\n }\n\n function Request(input, options) {\n options = options || {}\n var body = options.body\n if (Request.prototype.isPrototypeOf(input)) {\n if (input.bodyUsed) {\n throw new TypeError('Already read')\n }\n this.url = input.url\n this.credentials = input.credentials\n if (!options.headers) {\n this.headers = new Headers(input.headers)\n }\n this.method = input.method\n this.mode = input.mode\n if (!body) {\n body = input._bodyInit\n input.bodyUsed = true\n }\n } else {\n this.url = input\n }\n\n this.credentials = options.credentials || this.credentials || 'omit'\n if (options.headers || !this.headers) {\n this.headers = new Headers(options.headers)\n }\n this.method = normalizeMethod(options.method || this.method || 'GET')\n this.mode = options.mode || this.mode || null\n this.referrer = null\n\n if ((this.method === 'GET' || this.method === 'HEAD') && body) {\n throw new TypeError('Body not allowed for GET or HEAD requests')\n }\n this._initBody(body)\n }\n\n Request.prototype.clone = function() {\n return new Request(this)\n }\n\n function decode(body) {\n var form = new FormData()\n body.trim().split('&').forEach(function(bytes) {\n if (bytes) {\n var split = bytes.split('=')\n var name = split.shift().replace(/\\+/g, ' ')\n var value = split.join('=').replace(/\\+/g, ' ')\n form.append(decodeURIComponent(name), decodeURIComponent(value))\n }\n })\n return form\n }\n\n function headers(xhr) {\n var head = new Headers()\n var pairs = xhr.getAllResponseHeaders().trim().split('\\n')\n pairs.forEach(function(header) {\n var split = header.trim().split(':')\n var key = split.shift().trim()\n var value = split.join(':').trim()\n head.append(key, value)\n })\n return head\n }\n\n Body.call(Request.prototype)\n\n function Response(bodyInit, options) {\n if (!options) {\n options = {}\n }\n\n this.type = 'default'\n this.status = options.status\n this.ok = this.status >= 200 && this.status < 300\n this.statusText = options.statusText\n this.headers = options.headers instanceof Headers ? options.headers : new Headers(options.headers)\n this.url = options.url || ''\n this._initBody(bodyInit)\n }\n\n Body.call(Response.prototype)\n\n Response.prototype.clone = function() {\n return new Response(this._bodyInit, {\n status: this.status,\n statusText: this.statusText,\n headers: new Headers(this.headers),\n url: this.url\n })\n }\n\n Response.error = function() {\n var response = new Response(null, {status: 0, statusText: ''})\n response.type = 'error'\n return response\n }\n\n var redirectStatuses = [301, 302, 303, 307, 308]\n\n Response.redirect = function(url, status) {\n if (redirectStatuses.indexOf(status) === -1) {\n throw new RangeError('Invalid status code')\n }\n\n return new Response(null, {status: status, headers: {location: url}})\n }\n\n self.Headers = Headers;\n self.Request = Request;\n self.Response = Response;\n\n self.fetch = function(input, init) {\n return new Promise(function(resolve, reject) {\n var request\n if (Request.prototype.isPrototypeOf(input) && !init) {\n request = input\n } else {\n request = new Request(input, init)\n }\n\n var xhr = new XMLHttpRequest()\n\n function responseURL() {\n if ('responseURL' in xhr) {\n return xhr.responseURL\n }\n\n // Avoid security warnings on getResponseHeader when not allowed by CORS\n if (/^X-Request-URL:/m.test(xhr.getAllResponseHeaders())) {\n return xhr.getResponseHeader('X-Request-URL')\n }\n\n return;\n }\n\n xhr.onload = function() {\n var status = (xhr.status === 1223) ? 204 : xhr.status\n if (status < 100 || status > 599) {\n reject(new TypeError('Network request failed'))\n return\n }\n var options = {\n status: status,\n statusText: xhr.statusText,\n headers: headers(xhr),\n url: responseURL()\n }\n var body = 'response' in xhr ? xhr.response : xhr.responseText;\n resolve(new Response(body, options))\n }\n\n xhr.onerror = function() {\n reject(new TypeError('Network request failed'))\n }\n\n xhr.open(request.method, request.url, true)\n\n if (request.credentials === 'include') {\n xhr.withCredentials = true\n }\n\n if ('responseType' in xhr && support.blob) {\n xhr.responseType = 'blob'\n }\n\n request.headers.forEach(function(value, name) {\n xhr.setRequestHeader(name, value)\n })\n\n xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit)\n })\n }\n self.fetch.polyfill = true\n})(typeof self !== 'undefined' ? self : this);\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/whatwg-fetch/fetch.js\n ** module id = 12\n ** module chunks = 0 1\n **/","'use strict';\n\nimport Form from '../Form';\nimport Tooltip from '../Tooltip';\nimport Settings from '../util/Settings';\n\n// default export as component object\nexport default {\n Form,\n Settings,\n Tooltip\n};\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/main/modules/Form.js\n **/"],"sourceRoot":""} \ No newline at end of file diff --git a/build/maps/modal.map b/build/maps/modal.map index b6dd44dd..2ef28657 100644 --- a/build/maps/modal.map +++ b/build/maps/modal.map @@ -1 +1 @@ -{"version":3,"sources":["webpack:///webpack/universalModuleDefinition?5ca6***","webpack:///webpack/bootstrap 8d0e91e18875c4432251?cd11***","webpack:///./src/main/util/Util.js?5bc4*","webpack:///./src/main/util/Settings.js?b01f*","webpack:///./src/main/util/Event.js?68bf*","webpack:///./src/main/Modal.js?a8d4","webpack:///./src/main/Widget.js?920e","webpack:///./src/main/lib/FixedWindow.js?6376","webpack:///./src/main/lib/debounce.js?3601","webpack:///./src/main/modules/Modal.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;ACVA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,uBAAe;AACf;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACdA,KAAM,MAAM,CAAC,QAAD,EAAW,KAAX,EAAkB,IAAlB,EAAwB,GAAxB,EAA6B,EAA7B,CAAN;;AAEN,KAAM,iBAAiB,mBAAjB;;AAEN,KAAM,kBAAkB,oBAAlB;;AAEN,KAAM,mBAAmB,qBAAnB;;;;;;KAKA;;;;;;;;;;;;;;;8CAQ0B,SAAS,MAAM,UAAU;AACjD,iBAAM,eAAe,SAAS,YAAT,CAAsB,CAAtB,EAAyB;AAC1C,0BAAS,KAAT,CAAe,OAAf,EAAwB,CAAC,CAAD,EAAI,YAAJ,CAAxB,EAD0C;cAAzB,CAD4B;;AAKjD,kBAAK,IAAI,IAAI,CAAJ,EAAO,IAAI,IAAI,MAAJ,EAAY,GAAhC,EAAqC;AACjC,qBAAI,WAAW,IAAX,CAD6B;AAEjC,qBAAI,CAAC,IAAI,CAAJ,CAAD,EAAS;AACT,gCAAW,KAAK,WAAL,EAAX,CADS;kBAAb;AAGA,qBAAM,OAAO,IAAI,CAAJ,IAAS,QAAT,CALoB;AAMjC,yBAAQ,gBAAR,CAAyB,IAAzB,EAA+B,YAA/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,GAAa,WAAW,EAAX,EAAe,EAAf,CAAb,CAF6B;MAAN;EAAZ,C;;;;;;;;;;;ACAf;;;;;;;;;;;;;;;;;;;;;mBAOe;AACX,2BADW;AAEX,iCAFW;AAGX,6BAHW","file":"js/modal.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"FlexCss\"] = factory();\n\telse\n\t\troot[\"FlexCss\"] = factory();\n})(this, function() {\nreturn \n\n\n/** WEBPACK FOOTER **\n ** webpack/universalModuleDefinition\n **/"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"../\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n/** WEBPACK FOOTER **\n ** webpack/bootstrap 8d0e91e18875c4432251\n **/","/*\n * The MIT License (MIT)\n *\n * Copyright (c) 2015 David Heidrich, BowlingX \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nconst PFX = [\"webkit\", \"moz\", \"MS\", \"o\", \"\"];\n\nconst COL_LEFT_CLASS = 'is-collision-left';\n\nconst COL_RIGHT_CLASS = 'is-collision-right';\n\nconst COL_BOTTOM_CLASS = 'is-collision-bottom';\n\n/**\n * Provides shared DOM-Utility functions\n */\nclass Util {\n\n /**\n * Will register the right animation event based on browser\n * @param element\n * @param type\n * @param callback\n */\n static prefixedAnimateEvent(element, type, callback) {\n const thisFunction = function thisFunction(e) {\n callback.apply(element, [e, thisFunction]);\n };\n\n for (let p = 0; p < PFX.length; p++) {\n let thisType = type;\n if (!PFX[p]) {\n thisType = type.toLowerCase();\n }\n const name = PFX[p] + thisType;\n element.addEventListener(name, thisFunction, true);\n }\n }\n\n /**\n * Get correct transitionend event\n * @returns {String}\n * @private\n */\n static whichTransitionEndEvent() {\n let t;\n const el = document.createElement('fake');\n\n const transitions = {\n transition: 'transitionend',\n OTransition: 'oTransitionEnd',\n MozTransition: 'transitionend',\n WebkitTransition: 'webkitTransitionEnd'\n };\n\n for (t in transitions) {\n if (el.style[t] !== undefined) {\n return transitions[t];\n }\n }\n }\n\n /**\n * Check if target is part of parent node\n * @param target\n * @param parent\n * @returns {boolean}\n */\n static isPartOfNode(target, parent) {\n if (!target || !parent) {\n return false;\n }\n let now = target;\n while (now !== parent && now !== null) {\n if (now === parent) {\n break;\n }\n now = now.parentNode;\n }\n return now !== null;\n }\n\n /**\n * Finds the closest element including itself matching a callback\n * @param {Node} el\n * @param {Function} callback\n * @returns {Node|boolean}\n */\n static closestCallback(el, callback) {\n let element = el;\n while (element !== null) {\n if (callback(element)) {\n return element;\n }\n element = element.parentNode;\n }\n return false;\n }\n\n /**\n * Walks the tree until func returns true for given argument\n * @param target\n * @param func\n * @returns {boolean|HTMLElement}\n */\n static parentsUntil(target, func) {\n if (!target) {\n return false;\n }\n let now = target;\n while (!func(now) && now !== null) {\n now = now.parentNode;\n }\n\n return now;\n }\n\n /**\n * Generates a unique id\n * @return {String}\n */\n static guid() {\n function s4() {\n return Math.floor((1 + Math.random()) * 0x10000)\n .toString(16)\n .substring(1);\n }\n\n return `${s4() + s4()}-${s4()}-${s4()}-${s4()}-${s4() + s4() + s4()}`;\n }\n\n /**\n * Detects scrollbar width\n * @see http://stackoverflow.com/questions/986937/how-can-i-get-the-browsers-scrollbar-sizes\n * @returns {number}\n */\n static getScrollBarWidth() {\n const doc = global.document;\n const inner = doc.createElement('p');\n\n inner.style.width = \"100%\";\n inner.style.height = \"200px\";\n\n const outer = doc.createElement('div');\n outer.style.position = \"absolute\";\n outer.style.top = \"0px\";\n outer.style.left = \"0px\";\n outer.style.visibility = \"hidden\";\n outer.style.width = \"200px\";\n outer.style.height = \"150px\";\n outer.style.overflow = \"hidden\";\n outer.appendChild(inner);\n\n doc.body.appendChild(outer);\n const w1 = inner.offsetWidth;\n outer.style.overflow = 'scroll';\n let w2 = inner.offsetWidth;\n if (w1 === w2) {\n w2 = outer.clientWidth;\n }\n doc.body.removeChild(outer);\n\n return (w1 - w2);\n }\n\n\n /**\n * Run an event once\n * @param {String} ev\n * @param {HTMLElement|HTMLDocument} target\n * @param {Function} func\n * @param {boolean} [capture]\n * @return Function created listener\n */\n static addEventOnce(ev, target, func, capture) {\n const thisFunction = function thisFunction(event) {\n func(event, func);\n target.removeEventListener(ev, thisFunction, capture);\n };\n target.addEventListener(ev, thisFunction, capture);\n return thisFunction;\n }\n\n /**\n * Checks if an element is visible\n * @param {HTMLElement} element\n * @returns bool\n */\n static isVisible(element) {\n return element.offsetWidth > 0 && element.offsetHeight > 0;\n }\n\n /**\n * Creates a camelCaseRepresentation of a dashed string\n * @param {String} str\n * @returns String\n */\n static dashToCamelCase(str) {\n return str.replace(/-([a-z])/g, (g) => {\n return g[1].toUpperCase();\n });\n }\n\n /**\n * Creates a copy of `input`\n * @param {*} input\n * @return *\n */\n static copy(input) {\n return JSON.parse(JSON.stringify(input));\n }\n\n /**\n * Reads options from element (data attributes) and applies to base\n * @param {HTMLElement} element\n * @param {Object} base\n * @return {Object}\n */\n static applyOptionsFromElement(element, base) {\n if (!element) {\n return base;\n }\n const attrs = element.attributes;\n for (let i = 0; i < attrs.length; i++) {\n const attr = attrs[i];\n if (attr) {\n const s = Util.dashToCamelCase(attr.nodeName.replace('data-', ''));\n const val = attr.nodeValue;\n if (base.hasOwnProperty(s)) {\n // skip functions\n if (typeof base[s] === 'function') {\n continue;\n }\n if (typeof base[s] === 'boolean') {\n base[s] = parseInt(val || 1, 10) === 1;\n } else {\n base[s] = val;\n }\n }\n }\n }\n return base;\n }\n\n /**\n * Will position an element directly at given target\n * Is aware of a given collision container to detect edges\n * Will put elementToPosition either to left, center or right edge (prefer right)\n * and either to bottom or top (prefers bottom)\n *\n * You may overwrite preferred positioned with `centerHorizontal` and `positionTop`\n *\n * @param {HTMLElement|ClientRect} target the target container to align to\n * @param {HTMLElement} elementToPosition the element to position\n * @param {HTMLElement} collisionContainer the outer container to prevent collisions\n * @param {boolean} [centerHorizontal] set true to center element, otherwise it's put on the right border by default\n * @param {boolean} [positionTop] flip top, by default element is positioned to the bottom.\n * @returns {HTMLElement}\n */\n static setupPositionNearby(target, elementToPosition, collisionContainer, centerHorizontal, positionTop) {\n // determine relative offsets\n let amountTop = 0;\n let amountLeft = 0;\n Util.parentsUntil(target.parentNode, (el) => {\n if (!(el instanceof HTMLElement)) {\n return false;\n }\n const style = window.getComputedStyle(el);\n if (Util.isPartOfNode(elementToPosition, el)) {\n if (style && style.position === 'relative') {\n amountTop += el.offsetTop || 0;\n amountLeft += el.offsetLeft || 0;\n }\n return false;\n }\n return true;\n });\n\n const targetPosition = target instanceof HTMLElement ? target.getBoundingClientRect() : target;\n const elementRect = elementToPosition.getBoundingClientRect();\n const colRect = collisionContainer.getBoundingClientRect();\n const targetTop = targetPosition.top - amountTop;\n const targetRight = targetPosition.right;\n const isCollisionTop = (targetTop - elementRect.height) <= 0;\n const isCollisionBottom =\n window.innerHeight < (targetTop + amountTop + targetPosition.height + elementRect.height);\n const isCollisionLeft = targetRight < elementRect.width;\n const targetLeft = targetPosition.left;\n const isCollisionRight = (targetLeft + elementRect.width) > colRect.width;\n const classList = elementToPosition.classList;\n\n classList.remove(COL_RIGHT_CLASS);\n classList.remove(COL_LEFT_CLASS);\n classList.remove(COL_BOTTOM_CLASS);\n\n let calcTop;\n let calcLeft;\n if (isCollisionLeft && !isCollisionRight) {\n // put element to left if collision with left\n calcLeft = `${(targetPosition.left - colRect.left - amountLeft)}px`;\n classList.add(COL_LEFT_CLASS);\n } else {\n // maybe center if no collision with either side\n const rightPosition = `${(targetRight - elementRect.width - colRect.left - amountLeft)}px`;\n const leftCentered = ((targetLeft + targetPosition.width / 2) -\n (elementRect.width / 2) || 0) - colRect.left;\n const collisionCentered = (leftCentered + elementRect.width) > colRect.width;\n if (centerHorizontal && !collisionCentered) {\n calcLeft = `${leftCentered}px`;\n } else {\n classList.add(COL_RIGHT_CLASS);\n calcLeft = rightPosition;\n }\n }\n\n if (isCollisionBottom || (positionTop && !isCollisionTop)) {\n // Put Element on top if collision\n calcTop = `${(targetTop - elementRect.height) - colRect.top}px`;\n classList.add(COL_BOTTOM_CLASS);\n } else {\n calcTop = `${(targetTop + targetPosition.height) - colRect.top}px`;\n }\n\n elementToPosition.style.cssText = `top:${calcTop};left:${calcLeft};`;\n\n return elementToPosition;\n }\n\n /**\n * Brings a given element into viewport\n * @param {HTMLElement} el\n * @param {int|function}[optionalOffset]\n */\n static scrollToElement(el, optionalOffset) {\n el.scrollIntoView();\n let thisOffset = optionalOffset;\n // optionally use a additional scrollDif\n if (thisOffset) {\n if (typeof thisOffset === 'function') {\n thisOffset = optionalOffset();\n }\n if (thisOffset > 0) {\n const scrolledY = window.pageYOffset;\n if (scrolledY) {\n window.scroll(0, scrolledY - thisOffset);\n }\n }\n }\n }\n}\n\nexport default Util;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/main/util/Util.js\n **/","/*\n * The MIT License (MIT)\n *\n * Copyright (c) 2015 David Heidrich, BowlingX \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\nimport Util from './Util';\n\n// we attach global settings to global once because settings might be shared a lot of times trough the application\n// Maybe find a better way to handle that scenario\nif (!global.FLEXCSS_GLOBAL_SETTINGS) {\n global.FLEXCSS_GLOBAL_SETTINGS = {\n // defined breakpoint for small devices < n\n smallBreakpoint: 768,\n // nodes that should be updated when no scrollbar is expected\n scrollbarUpdateNodes: global.document.body !== null ? [global.document.body] : [],\n // additional Delay until darkener is fully hidden\n darkenerFadeDelay: 100,\n // class that is added if canvas has been toggled\n canvasToggledClass: 'toggled-canvas'\n };\n\n global.FLEXCSS_CONST_IS_IOS = null;\n\n global.FLEXCSS_CONST_IS_TOUCH = null;\n\n global.FLEXCSS_CONST_IS_IE = null;\n\n global.FLEXCSS_CONST_TAB_EVENT = 'click';\n\n global.FLEXCSS_IS_SMALL_SCREEN = false;\n\n const init = () => {\n // Measure scrollbar width\n global.FLEXCSS_CONST_SCROLLBAR_WIDTH = Util.getScrollBarWidth();\n // detect right transition end event\n global.FLEXCSS_CONST_TRANSITION_EVENT = Util.whichTransitionEndEvent();\n };\n\n if (global.document.readyState !== 'loading') {\n init();\n } else {\n // it's possible that global.document.body is not available if the document is not\n // loaded completely\n document.addEventListener('DOMContentLoaded', () => {\n init();\n });\n }\n}\n\n/**\n * Utility class that setups global settings\n */\nclass Settings {\n\n /**\n * Setup global settings, overwrite default values\n * @param {Object} settings\n */\n static setup(settings) {\n Object.assign(global.FLEXCSS_GLOBAL_SETTINGS, settings);\n }\n\n /**\n * Access to global settings\n * @returns {Object}\n */\n static get() {\n return global.FLEXCSS_GLOBAL_SETTINGS;\n }\n\n /**\n * Detects a IOS Device, caches subsequent calls\n * @returns {boolean}\n */\n static isIosDevice() {\n if (!global.FLEXCSS_CONST_IS_IOS) {\n global.FLEXCSS_CONST_IS_IOS = global.navigator.userAgent.match(/(iPad|iPhone|iPod)/i);\n }\n\n return global.FLEXCSS_CONST_IS_IOS;\n }\n\n /**\n * @returns {boolean}\n */\n static isSmallScreen() {\n return window.innerWidth < Settings.get().smallBreakpoint;\n }\n\n /**\n * Detects a touch device, caches subsequent calls\n * @returns {boolean}\n */\n static isTouchDevice() {\n if (!global.FLEXCSS_CONST_IS_TOUCH) {\n global.FLEXCSS_CONST_IS_TOUCH = 'ontouchstart' in window || !!(global.navigator.msMaxTouchPoints);\n }\n return global.FLEXCSS_CONST_IS_TOUCH;\n }\n\n /**\n * Checks if current browser is Internet Explorer\n * @returns {boolean|*}\n */\n static isIE() {\n if (!global.FLEXCSS_CONST_IS_IE) {\n global.FLEXCSS_CONST_IS_IE = \"ActiveXObject\" in window;\n }\n return global.FLEXCSS_CONST_IS_IE;\n }\n\n /**\n * @returns {String}\n */\n static getTransitionEvent() {\n return global.FLEXCSS_CONST_TRANSITION_EVENT;\n }\n\n /**\n * @returns {int}\n */\n static getScrollbarWidth() {\n return global.FLEXCSS_CONST_SCROLLBAR_WIDTH;\n }\n\n /**\n * @returns {String}\n */\n static getTabEvent() {\n return global.FLEXCSS_CONST_TAB_EVENT;\n }\n}\n\nexport default Settings;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/main/util/Settings.js\n **/","/* global CustomEvent */\n\n/*\n * The MIT License (MIT)\n *\n * Copyright (c) 2015 David Heidrich, BowlingX \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n// polyfill for custom events to make thinks work in IE\n// The needed polyfill is so small that I embedded it here\n(function poly() {\n if (!global.CustomEvent || typeof global.CustomEvent !== 'function') {\n const CustomEvent = function CustomEvent(event, params) {\n const thisParams = params ||\n {\n bubbles: false,\n cancelable: false,\n detail: undefined\n };\n const evt = document.createEvent(\"CustomEvent\");\n evt.initCustomEvent(event, thisParams.bubbles,\n thisParams.cancelable, thisParams.detail);\n return evt;\n };\n CustomEvent.prototype = global.Event.prototype;\n global.CustomEvent = CustomEvent;\n }\n})();\n/**\n * Simpler Event dispatching\n */\nclass EventHandler {\n\n /**\n * @param {HTMLElement} target\n * @param {String} name\n */\n constructor(target, name) {\n this.target = target;\n this.defaultOptions = {\n bubbles: true,\n cancelable: true\n };\n\n this.name = name;\n }\n\n /**\n * Set more options\n * @param {Object} options\n * @returns {EventHandler}\n */\n withOptions(options) {\n Object.assign(this.defaultOptions, (options || {}));\n return this;\n }\n\n /**\n * Call with the originalEvent\n * @param {Event} e\n * @returns {EventHandler}\n */\n withOriginal(e) {\n return this.withDetail({\n originalEvent: e\n });\n }\n\n /**\n * Extends the detail part of the event\n * @param {Object} o\n * @returns {EventHandler}\n */\n withDetail(o) {\n if (!this.defaultOptions.detail) {\n this.defaultOptions.detail = {};\n }\n Object.assign(this.defaultOptions.detail, o);\n return this;\n }\n\n /**\n * @returns {CustomEvent}\n */\n fire() {\n const e = new CustomEvent(this.name, this.defaultOptions);\n if (this.target) {\n this.target.dispatchEvent(e);\n }\n return e;\n }\n}\n\nclass Event {\n /**\n * Prepares to dispatch a custom event (without firing)\n * @param {HTMLElement} target\n * @param {String} name\n * @returns {EventHandler}\n */\n static dispatch(target, name) {\n return new EventHandler(target, name);\n }\n\n /**\n * Dispatches a custom event and fires it directly\n * @param {HTMLElement} target\n * @param {String} name\n * @param {Object} [options]\n * @returns {CustomEvent}\n */\n static dispatchAndFire(target, name, options) {\n return new EventHandler(target, name).withOptions(options).fire();\n }\n}\n\nexport default Event;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/main/util/Event.js\n **/","/*\n * The MIT License (MIT)\n *\n * Copyright (c) 2015 David Heidrich, BowlingX \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n/*!\n * FlexCss.Modal\n * Licensed under the MIT License (MIT)\n * Copyright (c) 2015 David Heidrich, BowlingX \n */\n\n/* global KeyboardEvent */\n\nimport Settings from './util/Settings';\nimport Event from './util/Event';\nimport Util from './util/Util';\nimport Widget from './Widget';\nimport FixedWindow from './lib/FixedWindow';\n\nconst HTML_ELEMENT = global.document.documentElement;\nconst KEY_ESC = 27;\n/* Attribute Names */\nconst ATTR_CREATE_NEW = 'data-new-instance';\nconst ATTR_CLOSE = 'data-close-modal';\nconst ATTR_NAME = 'data-modal';\n\n/* Class names */\nconst CLS_CONTAINER_CURRENT = 'front';\nconst CLS_OPEN = 'open';\nconst CLS_CURRENT = 'current';\nconst CLS_PART_OF_STACK = 'part-of-stack';\nconst CLS_MODAL_OPEN = 'modal-open';\nconst CLS_MODAL_CONTAINER = 'modal-container';\nconst CLS_ANIM_END = 'modal-anim-end';\nconst CLS_LOADER_CONTAINER = 'loader-container';\nconst CLS_LOADER = 'loader';\n\n/* Events */\n\n/**\n * Event triggered when modal is closed\n * @type {string}\n */\nexport const EVENT_MODAL_CLOSED = 'flexcss.modal.closed';\n/**\n * Event triggered before a modal is closed, cancelable\n * @type {string}\n */\nexport const EVENT_MODAL_BEFORE_CLOSED = 'flexcss.modal.beforeClose';\n/**\n * Event triggered when a modal is opened\n * @type {string}\n */\nexport const EVENT_MODAL_OPENED = 'flexcss.modal.opened';\n\n/**\n * Event triggered when modal is initilized, called on target\n * @type {string}\n */\nexport const EVENT_MODAL_INIT = 'flexcss.modal.init';\n\n/**\n * Triggered when the content of an async modal on a target is loaded, called on target\n * @type {string}\n */\nexport const EVENT_MODAL_ASYNC_TARGET_LOADED = 'flexcss.modal.asyncTargetLoaded';\n\n/**\n * A Modal Implementation\n */\nclass Modal {\n constructor(DelegateContainer, options) {\n const doc = global.document;\n const container = DelegateContainer instanceof HTMLElement ?\n DelegateContainer : doc.getElementById(DelegateContainer);\n\n // Instance vars:\n if (!container) {\n throw new Error(`Could not found container element by given ID/Element: ${DelegateContainer}`);\n }\n\n this.currentOpen = null;\n\n this.loading = false;\n\n this.container = container;\n\n /**\n * Default Options\n */\n this.options = {\n classNames: 'modal',\n closeOnEscape: true,\n closeOnBackgroundClick: true,\n destroyOnFinish: false,\n fixedContainer: true,\n containerClassNames: ''\n };\n\n Object.assign(this.options, options);\n\n // Container where events are delegated\n this.eventContainer = null;\n this.eventFunction = null;\n\n this.dataMainPageContainer = global.document.body;\n\n this.currentScrollTop = 0;\n\n this.modalContainer = null;\n\n // Destroy full modal instance when no dialogs are bind to?\n // Otherwise container is recycled\n this.destroyOnFinish = this.options.destroyOnFinish;\n }\n\n /**\n * Removes this modal from global stack\n * Will handle fixing main html element too\n * @private\n * @param n\n */\n _removeModalFromStack(n) {\n const t = Modal._modalInstances.indexOf(n);\n if (t > -1) {\n Modal._modalInstances.splice(t, 1);\n FixedWindow.getInstance().close();\n HTML_ELEMENT.classList.remove(CLS_MODAL_OPEN);\n }\n }\n\n\n /**\n * Modal container that contains all `stacked` modals for this instance\n * @returns {HTMLElement}\n */\n getModalContainer() {\n return this.modalContainer;\n }\n\n /**\n * Closes the current open modal of this stack\n * @params [e], optional event\n * @returns {*}\n */\n close(e) {\n const self = this;\n\n const options = self.currentOpen ? Util.applyOptionsFromElement(\n self.currentOpen, Util.copy(self.options)) : self.options;\n\n // close only on keyboard if instance should\n if (!options.closeOnEscape && e instanceof KeyboardEvent) {\n return false;\n }\n\n // close only on background if instance should\n if (!options.closeOnBackgroundClick && e &&\n e.type === Settings.getTabEvent() && !e.target.hasAttribute(ATTR_CLOSE)) {\n return false;\n }\n\n // if an instance is currently loading, prevent from closing\n if (self.loading) {\n return false;\n }\n\n if (e) {\n e.preventDefault();\n }\n\n if (self.currentOpen) {\n // dispatch beforeClose event, if prevented prevent modal from closing\n var ev = Event.dispatchAndFire(self.currentOpen, EVENT_MODAL_BEFORE_CLOSED);\n if (ev.defaultPrevented) {\n return false;\n }\n\n this._finishState(self.currentOpen);\n // if there is an previous modal\n if (self.currentOpen.prevModal) {\n // switch to the next modal\n return self.switchModals(self.currentOpen.prevModal,\n self.currentOpen.prevModal.prevModal || null);\n }\n\n // finally trigger closed event\n Event.dispatch(self.currentOpen, EVENT_MODAL_CLOSED).withOriginal(e).fire();\n\n }\n self._removeModalFromStack(self.currentOpen);\n\n // Full stack closed:\n self.currentOpen = null;\n if (self.modalContainer) {\n // setup next open\n var lastContainer = Modal._modalInstances[Modal._modalInstances.length - 1],\n classList = self.modalContainer.classList;\n classList.remove(CLS_CONTAINER_CURRENT);\n classList.remove(CLS_OPEN);\n // Remove all current classes from child-nodes\n for (var i = 0; i < self.modalContainer.childNodes.length; i++) {\n var node = self.modalContainer.childNodes[i], cl = node.classList;\n // remove applied styles\n self._finishState(node);\n cl.remove(CLS_CURRENT);\n cl.remove(CLS_PART_OF_STACK);\n }\n if (lastContainer) {\n lastContainer.parentNode.classList.add(CLS_CONTAINER_CURRENT);\n }\n }\n\n if (self.destroyOnFinish) {\n self.destroy();\n }\n return self;\n }\n\n /**\n * Resets a target when newly initilizes\n * @param target\n * @private\n */\n _finishState(target) {\n target.classList.remove(CLS_ANIM_END);\n }\n\n /**\n * Handler called when a Modal has finished an animation\n * @param e\n * @param self\n * @private\n */\n _finishAnim(e, self) {\n e.target.classList.add(CLS_ANIM_END);\n e.target.removeEventListener(e.type, self, true);\n }\n\n /**\n * Brings the given modal to front\n * @param co\n * @param last\n */\n switchModals(co, last) {\n co.prevModal = last;\n Modal._modalInstances.push(co);\n FixedWindow.getInstance().open(this, this.modalContainer);\n if (last) {\n this._finishState(last);\n Util.prefixedAnimateEvent(last, 'AnimationEnd', this._finishAnim);\n last.classList.add(CLS_PART_OF_STACK);\n }\n // set new currentOpen\n this.currentOpen = co;\n\n // bring current container to the front\n var instances = Modal._modalInstances;\n\n for (var m = 0; m < instances.length; m++) {\n instances[m].parentNode.classList.remove(CLS_CONTAINER_CURRENT);\n }\n this.modalContainer.classList.add(CLS_CONTAINER_CURRENT);\n // remove animations if animations has been completed, fixes various bugs:\n // - fixes nested scrolling element issue in iOS Browsers / Mobile-Safari\n Util.prefixedAnimateEvent(co, 'AnimationEnd', this._finishAnim);\n\n for (var i = 0; i < this.modalContainer.childNodes.length; i++) {\n var n = this.modalContainer.childNodes[i], isCurrent = n.classList.contains(CLS_CURRENT);\n if (n === co) {\n co.classList.add(CLS_CURRENT);\n co.classList.remove(CLS_PART_OF_STACK);\n this._finishState(co);\n } else {\n n.classList.remove(CLS_CURRENT);\n if (isCurrent) {\n this._removeModalFromStack(n);\n Event.dispatchAndFire(n, EVENT_MODAL_CLOSED);\n }\n }\n }\n }\n\n handleScrollbar() {\n if (Modal._modalInstances.length === 0) {\n HTML_ELEMENT.classList.add(CLS_MODAL_OPEN);\n }\n }\n\n /**\n * Creates a Modal and opens it (later)\n * @param e\n * @returns {Promise|boolean}\n */\n createWidget(e) {\n var self = this;\n if (this.loading) {\n return false;\n }\n\n // check if another modal has registered events on this dom path:\n if (e && e.target) {\n var foundInstance = Util.parentsUntil(e.target, function (node) {\n return node && node.flexModalInstance;\n });\n\n // if another instance has been found, abort\n if (foundInstance !== this.container) {\n return false;\n }\n }\n var targetContent, future, widget, target, hasTarget = true,\n isHtmlElement = e instanceof HTMLElement, isWidget = Widget.isWidget(e);\n if (isHtmlElement || isWidget) {\n if (isHtmlElement) {\n targetContent = e;\n } else {\n widget = e;\n targetContent = widget.element;\n }\n } else {\n target = e.target;\n if (!target) {\n throw 'Could not find target, did you pass an event, a HTMLElement or an Widget?';\n }\n hasTarget = target.hasAttribute(ATTR_NAME);\n targetContent = target.getAttribute(ATTR_NAME);\n widget = Widget.findWidget(target);\n if (target.hasAttribute(ATTR_CREATE_NEW) && !e.newInstance) {\n var newInstance = new Modal(this.container)\n .setDestroyOnFinish(true);\n e.newInstance = true;\n newInstance.fromEvent(e).then(function () {\n newInstance.registerEvents(newInstance.getModalContainer());\n });\n return false;\n }\n if (hasTarget) {\n e.stopImmediatePropagation();\n e.preventDefault();\n }\n }\n\n if (!hasTarget) {\n return false;\n }\n\n let modalContainerClasses = this.modalContainer ? this.modalContainer.classList : [];\n\n // lazy create modal container\n if (!this.modalContainer) {\n this.modalContainer = global.document.createElement('div');\n this.modalContainer.className = `${CLS_MODAL_CONTAINER} ${this.options.containerClassNames} ${CLS_OPEN}`;\n const closeModalFunction = function (ce) {\n if (self.loading) {\n return false;\n }\n if (Util.isPartOfNode(ce.target, self.currentOpen)) {\n if (!ce.target.hasAttribute(ATTR_CLOSE)) {\n return false;\n }\n }\n self.close(ce);\n };\n\n this.modalContainer.addEventListener(Settings.getTabEvent(), closeModalFunction, false);\n\n modalContainerClasses = this.modalContainer.classList;\n this.container.appendChild(this.modalContainer);\n\n } else {\n modalContainerClasses.add(CLS_OPEN);\n }\n\n let loader, doc = global.document, toggleLoader = function (show) {\n if (show) {\n loader = doc.createElement('div');\n loader.className = CLS_LOADER_CONTAINER;\n var loaderLoader = doc.createElement('div');\n loaderLoader.className = CLS_LOADER;\n loader.appendChild(loaderLoader);\n self.modalContainer.appendChild(loader);\n } else {\n loader.parentNode.removeChild(loader);\n }\n };\n\n this.handleScrollbar();\n\n modalContainerClasses.add(CLS_CONTAINER_CURRENT);\n modalContainerClasses.add('loading');\n this.loading = true;\n toggleLoader(true);\n var async = widget ? widget.getAsync() : null;\n if (Widget.isWidget(widget) && async) {\n future = async.then(function (r) {\n var result;\n if (r instanceof HTMLElement || r instanceof DocumentFragment) {\n result = r;\n } else {\n // Create container Element:\n var element = doc.createElement('div');\n element.className = self.options.classNames;\n element.innerHTML = r;\n element.id = Util.guid();\n result = element;\n }\n widget.finalContent = result;\n Event.dispatchAndFire(target, EVENT_MODAL_ASYNC_TARGET_LOADED);\n return result;\n });\n } else {\n var el = targetContent instanceof HTMLElement ||\n targetContent instanceof DocumentFragment ? targetContent : doc.getElementById(targetContent);\n if (el) {\n future = new Promise((resolve) => {\n resolve(el);\n });\n } else {\n throw 'Could not found given modal element (content) with ID: ' + targetContent;\n }\n }\n\n Event.dispatchAndFire(target, EVENT_MODAL_INIT);\n\n return future.then((thisEl) => {\n thisEl.hfWidgetInstance = self;\n self.modalContainer.appendChild(thisEl);\n modalContainerClasses.remove('loading');\n self.loading = false;\n toggleLoader(false);\n\n self.open(thisEl, true, e);\n\n return thisEl;\n });\n }\n\n /**\n * Open's an already rendered modal\n * @param {HTMLElement} modal\n * @param {Boolean} [internal], set to true to prevent container management\n * @param {Boolean} [maybeEvent], optional event-object that triggered open\n */\n open(modal, internal, maybeEvent) {\n\n\n if (!internal) {\n this.modalContainer.classList.add('open');\n this.handleScrollbar();\n }\n this.switchModals(modal, this.currentOpen);\n\n Event.dispatch(modal, EVENT_MODAL_OPENED).withOriginal(maybeEvent).fire();\n }\n\n\n registerEvents(delegate) {\n var delegateContainer = delegate || this.container, self = this;\n // Modals should always be fixed\n FixedWindow.getInstance().addScreenConstraint(Modal, (width) => true);\n // register modal instance so we can detect multiple registrars\n delegateContainer.flexModalInstance = self;\n self.eventFunction = function () {\n self.createWidget.apply(self, arguments);\n };\n delegateContainer.addEventListener(Settings.getTabEvent(), self.eventFunction, false);\n\n self.eventContainer = delegateContainer;\n return self;\n }\n\n\n /**\n * Creates a new Dialog Instance either directly from HTML Element or a Widget instance\n * @param {HTMLElement|Widget} widget instance or html element\n * @returns {Promise}\n */\n fromWidget(widget) {\n return this.createWidget(widget);\n }\n\n /**\n * Creates a Widget from event\n * @param e\n * @returns {Promise}\n */\n fromEvent(e) {\n return this.createWidget(e);\n }\n\n setDestroyOnFinish(v) {\n this.destroyOnFinish = v;\n return this;\n }\n\n /**\n * Destroy this widget instance, cleans empty DOM nodes\n * Will use fast MutationObserver if available, otherwise falls back to DOMNodeRemoved event\n */\n destroy() {\n let self = this, modalContainer = this.modalContainer;\n const isEmptyContainer = modalContainer.childNodes.length === 0;\n // Remove event listener on destroy, do not remove DOM node\n if (self.eventContainer) {\n self.eventContainer.removeEventListener(Settings.getTabEvent(), self.eventFunction, true);\n }\n\n if (isEmptyContainer) {\n if (modalContainer.parentNode) {\n modalContainer.parentNode.removeChild(modalContainer);\n }\n }\n if (global.MutationObserver) {\n var observer = new MutationObserver(function (mutations) {\n mutations.forEach(function () {\n if (isEmptyContainer) {\n modalContainer.parentNode.removeChild(modalContainer);\n observer.disconnect();\n }\n });\n });\n observer.observe(modalContainer, {childList: true});\n } else {\n modalContainer.addEventListener('DOMNodeRemoved', function (e) {\n if (e.target !== modalContainer && (modalContainer.childNodes.length - 1) === 0) {\n modalContainer.parentNode.removeChild(modalContainer);\n }\n });\n }\n }\n}\n\n\n// Static variable that keeps track of all open modals\nModal._modalInstances = [];\n\n// Global keydown listener for modal\nglobal.addEventListener('keydown', function (e) {\n if (e.keyCode === KEY_ESC) {\n var lastModal = Modal._modalInstances[Modal._modalInstances.length - 1];\n if (lastModal) {\n Widget.findWidget(lastModal).close(e);\n }\n }\n});\n\nexport default Modal;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/main/Modal.js\n **/","/*\n * The MIT License (MIT)\n *\n * Copyright (c) 2015 David Heidrich, BowlingX \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n/*!\n * FlexCss.Widget\n * Licensed under the MIT License (MIT)\n * Copyright (c) 2015 David Heidrich, BowlingX \n */\n\n/**\n * A Widget provides async content on a specific target (e.g. a modal link)\n */\nclass Widget {\n\n /**\n * Creates a new Widget\n * @param [element], optional define the content of widget\n */\n constructor(element) {\n /**\n *\n * @type {Promise}\n */\n this.asyncContent = null;\n\n /**\n * @type {boolean}\n */\n this._isWidget = true;\n\n if (element) {\n /**\n * @type {HTMLElement}\n */\n this.element = element instanceof HTMLElement ? element : global.document.getElementById(element);\n if (this.element) {\n this.element.hfWidgetInstance = this;\n this.setAsync(() => {\n return new Promise((s) => {\n s(this.element);\n });\n });\n } else {\n throw new Error(`Could not found element with ID: ${element}`);\n }\n }\n /**\n * The final resulted content that a widget did create (e.g. a modal container)\n * @type {HTMLElement}\n */\n this.finalContent = null;\n }\n\n /**\n *\n * @returns {Promise}\n */\n getAsync() {\n return this.asyncContent();\n }\n\n /**\n * @param {Function.} async\n * @returns {Widget}\n */\n setAsync(async) {\n this.asyncContent = async;\n return this;\n }\n\n /**\n * @returns {HTMLElement}\n */\n getFinalContent() {\n return this.finalContent;\n }\n\n /**\n * @param {HTMLElement} element\n * @returns {Widget}\n */\n setElement(element) {\n this.element = element;\n return this;\n }\n\n /**\n * Destroys the generated content of this widget\n * @returns {boolean}\n */\n destroy() {\n if (this.finalContent && this.finalContent.parentNode) {\n this.finalContent.parentNode.removeChild(this.finalContent);\n return true;\n }\n\n delete this.element;\n delete this.asyncContent;\n delete this.finalContent;\n\n return false;\n }\n\n /**\n * Will find a widget on an Element\n * @param {HTMLElement} element\n * @returns {Widget|undefined}\n */\n static findWidget(element) {\n return element ? element.hfWidgetInstance : undefined;\n }\n\n /**\n * Checks if a given object is an instance\n * @param {Object} self\n * @returns {boolean}\n */\n static isWidget(self) {\n return self instanceof Widget || typeof self === 'object' && self.hasOwnProperty('_isWidget');\n }\n}\n\nexport default Widget;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/main/Widget.js\n **/","import Settings from '../util/Settings';\nimport debounce from './debounce';\nimport Event from '../util/Event';\nimport Util from '../util/Util';\n\nconst CLS_FIXED_WINDOW = 'fixed-window-open';\n\nexport const EVENT_BEFORE_FIXED_ADD = 'flexcss.fixedWindow.beforeAdd';\nexport const EVENT_AFTER_FIXED_REMOVE = 'flexcss.fixedWindow.afterRemove';\n\n/**\n * @type {FixedWindow}\n */\nlet fixedWindowInstance;\n\nexport default class FixedWindow {\n\n constructor() {\n this.widgets = [];\n this.currentScrollTop = 0;\n this.fixedScreenConstraints = [];\n this.windowWidth = 0;\n this.isFixedWindowActive = false;\n this.touchListener = null;\n }\n\n /**\n * Adds a constraint to detect if the window needs to be changed when the screensize changes\n *\n * @param {Function} widget\n * @param {Function} fixedBreakpointFn gets a width argument, return true to open a window\n */\n addScreenConstraint(widget, fixedBreakpointFn) {\n this.fixedScreenConstraints[widget] = fixedBreakpointFn;\n }\n\n /**\n * @returns {null|DestroyableWidget}\n */\n getCurrentWidget() {\n return this.widgets.length > 0 ? this.widgets[this.widgets.length - 1] : null;\n }\n\n /**\n * @private\n */\n _checkFixedNeeded() {\n if (this.widgets.length === 0) {\n return;\n }\n const widgets = new Set(this.widgets);\n const widgetsThatRequireFixedWindow = Array.from(widgets).some(({ widget }) => {\n return this.fixedScreenConstraints[widget] && this.fixedScreenConstraints[widget](this.windowWidth);\n });\n if (!widgetsThatRequireFixedWindow) {\n this._removeFixedContainer();\n } else {\n this._addFixedContainer();\n }\n }\n\n /**\n * @private\n */\n _addFixedContainer() {\n if (this.isFixedWindowActive) {\n return;\n }\n Event.dispatchAndFire(global.document, EVENT_BEFORE_FIXED_ADD, {\n detail: this.getCurrentWidget()\n });\n // this causes layout and should be optimized\n // At lest we write in a batch later\n Settings.get().scrollbarUpdateNodes.map((n) => {\n let foundProperty = 'paddingRight';\n let direction = 1;\n let node = n;\n if (n instanceof Array) {\n const [whatNode, property, d] = n;\n foundProperty = property;\n node = whatNode;\n direction = d || 1;\n }\n return {\n node,\n property: foundProperty,\n value: `${parseInt(global.getComputedStyle(node)[foundProperty], 10) +\n (!node.__fixedWindowMod__ ? (Settings.getScrollbarWidth() * direction) : 0)}px`\n };\n }).forEach((d) => {\n d.node.__fixedWindowMod__ = true;\n d.node.style[d.property] = d.value;\n });\n\n this.touchListener = (e) => {\n e.preventDefault();\n };\n\n let shouldNotMove = false;\n this.touchStartListener = (e) => {\n const { element } = this.getCurrentWidget();\n if (Util.isPartOfNode(e.target, element)) {\n if (element.scrollTop === 0) {\n element.scrollTop = 1;\n shouldNotMove = true;\n } else if (element.scrollHeight === element.scrollTop + element.offsetHeight) {\n shouldNotMove = true;\n element.scrollTop -= 1;\n }\n }\n };\n\n global.addEventListener('touchmove', this.touchListener);\n global.document.body.addEventListener('touchstart', this.touchStartListener);\n\n this.touchMoveListener = (e) => {\n const { element } = this.getCurrentWidget();\n if (Util.isPartOfNode(e.target, element)) {\n if (!shouldNotMove) {\n e.stopImmediatePropagation();\n }\n shouldNotMove = false;\n }\n };\n global.document.body.addEventListener('touchmove', this.touchMoveListener);\n\n global.document.documentElement.classList.add(CLS_FIXED_WINDOW);\n this.isFixedWindowActive = true;\n }\n\n /**\n * @private\n */\n _removeFixedContainer() {\n if (this.isFixedWindowActive) {\n // cleanup event listeners\n global.removeEventListener('touchmove', this.touchListener);\n global.document.body.removeEventListener('touchstart', this.touchStartListener);\n global.document.body.removeEventListener('touchmove', this.touchMoveListener);\n\n // reset scrollbar nodes\n Settings.get().scrollbarUpdateNodes.forEach((node) => {\n if (node instanceof Array) {\n const [whatNode, property] = node;\n delete whatNode.__fixedWindowMod__;\n whatNode.style[property] = '';\n } else {\n delete node.__fixedWindowMod__;\n node.style.paddingRight = '';\n }\n });\n global.document.documentElement.classList.remove(CLS_FIXED_WINDOW);\n Event.dispatchAndFire(global.document, EVENT_AFTER_FIXED_REMOVE);\n this.isFixedWindowActive = false;\n }\n }\n\n /**\n * Will close a window when no widgets are opened that need one\n */\n resizeListener() {\n this.windowWidth = global.innerWidth;\n this._checkFixedNeeded();\n }\n\n /**\n * @returns {FixedWindow}\n */\n static getInstance() {\n if (!fixedWindowInstance) {\n fixedWindowInstance = new FixedWindow();\n fixedWindowInstance.windowWidth = global.innerWidth;\n const eventHandler = fixedWindowInstance.resizeListener.bind(fixedWindowInstance);\n global.addEventListener(\n 'resize',\n debounce(eventHandler, 500)\n );\n global.addEventListener('orientationchange', eventHandler);\n }\n return fixedWindowInstance;\n }\n\n /**\n * Request a close of the fixed window\n */\n close() {\n this.widgets.pop();\n if (this.widgets.length === 0) {\n this._removeFixedContainer();\n resolve();\n }\n }\n\n /**\n * Request to open a fixed windows\n * @param {Object|DestroyableWidget} instance\n * @param {HTMLElement} element\n */\n open(instance, element) {\n let fixed = false;\n if (typeof instance === 'object') {\n const widget = instance.constructor;\n const fixedWidget = this.fixedScreenConstraints[instance.constructor];\n if (widget && fixedWidget) {\n fixed = fixedWidget(this.windowWidth);\n }\n const length = this.widgets.length;\n this.widgets.push(\n {\n widget,\n element\n }\n );\n // open a new window if there is no window active\n if (length === 0) {\n if (fixed) {\n this._addFixedContainer();\n }\n }\n }\n }\n}\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/main/lib/FixedWindow.js\n **/","export default (fn, ms) => () => {\n clearTimeout(fn.timeout);\n fn.timeout = setTimeout(fn, ms);\n};\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/main/lib/debounce.js\n **/","'use strict';\n\nimport Modal from '../Modal';\nimport Settings from '../util/Settings';\nimport Widget from '../Widget';\n\n// default export as component object\nexport default {\n Modal,\n Settings,\n Widget\n};\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/main/modules/Modal.js\n **/"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack:///webpack/universalModuleDefinition?5ca6***","webpack:///webpack/bootstrap 07d11fb01134afeef692?d78f***","webpack:///./src/main/util/Util.js?5bc4*","webpack:///./src/main/util/Settings.js?b01f*","webpack:///./src/main/util/Event.js?68bf*","webpack:///./src/main/Modal.js?a8d4","webpack:///./src/main/Widget.js?920e","webpack:///./src/main/lib/FixedWindow.js?6376","webpack:///./src/main/lib/debounce.js?3601","webpack:///./src/main/modules/Modal.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;ACVA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,uBAAe;AACf;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;;;;;;;;;;;;;;;;;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AAL,CAAa,MAAb,CANe;AAO9B,sBAAK,OAAL,CAAa,IAAb,CACI;AACI,mCADJ;AAEI,qCAFJ;kBADJ;;AAP8B,qBAc1B,WAAW,CAAX,EAAc;AACd,yBAAI,KAAJ,EAAW;AACP,8BAAK,kBAAL,GADO;sBAAX;kBADJ;cAdJ;;;;uCA/BiB;AACjB,iBAAI,CAAC,mBAAD,EAAsB;AACtB,uCAAsB,IAAI,WAAJ,EAAtB,CADsB;AAEtB,qCAAoB,WAApB,GAAkC,OAAO,UAAP,CAFZ;AAGtB,qBAAM,eAAe,oBAAoB,cAApB,CAAmC,IAAnC,CAAwC,mBAAxC,CAAf,CAHgB;AAItB,wBAAO,gBAAP,CACI,QADJ,EAEI,wBAAS,YAAT,EAAuB,GAAvB,CAFJ,EAJsB;AAQtB,wBAAO,gBAAP,CAAwB,mBAAxB,EAA6C,YAA7C,EARsB;cAA1B;AAUA,oBAAO,mBAAP,CAXiB;;;;YAzJJ;;;;;;;;;;;;;;;;mBCfN,UAAC,EAAD,EAAK,EAAL;YAAY,YAAM;AAC7B,sBAAa,GAAG,OAAH,CAAb,CAD6B;AAE7B,YAAG,OAAH,GAAa,WAAW,EAAX,EAAe,EAAf,CAAb,CAF6B;MAAN;EAAZ,C;;;;;;;;;;;ACAf;;;;;;;;;;;;;;;;;;;;;mBAOe;AACX,2BADW;AAEX,iCAFW;AAGX,6BAHW","file":"js/modal.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"FlexCss\"] = factory();\n\telse\n\t\troot[\"FlexCss\"] = factory();\n})(this, function() {\nreturn \n\n\n/** WEBPACK FOOTER **\n ** webpack/universalModuleDefinition\n **/"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"../\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n/** WEBPACK FOOTER **\n ** webpack/bootstrap 07d11fb01134afeef692\n **/","/*\n * The MIT License (MIT)\n *\n * Copyright (c) 2015 David Heidrich, BowlingX \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nconst PFX = [\"webkit\", \"moz\", \"MS\", \"o\", \"\"];\n\nconst COL_LEFT_CLASS = 'is-collision-left';\n\nconst COL_RIGHT_CLASS = 'is-collision-right';\n\nconst COL_BOTTOM_CLASS = 'is-collision-bottom';\n\n/**\n * Provides shared DOM-Utility functions\n */\nclass Util {\n\n /**\n * Will register the right animation event based on browser\n * @param element\n * @param type\n * @param callback\n */\n static prefixedAnimateEvent(element, type, callback) {\n const thisFunction = function thisFunction(e) {\n callback.apply(element, [e, thisFunction]);\n };\n\n for (let p = 0; p < PFX.length; p++) {\n let thisType = type;\n if (!PFX[p]) {\n thisType = type.toLowerCase();\n }\n const name = PFX[p] + thisType;\n element.addEventListener(name, thisFunction, true);\n }\n }\n\n /**\n * Get correct transitionend event\n * @returns {String}\n * @private\n */\n static whichTransitionEndEvent() {\n let t;\n const el = document.createElement('fake');\n\n const transitions = {\n transition: 'transitionend',\n OTransition: 'oTransitionEnd',\n MozTransition: 'transitionend',\n WebkitTransition: 'webkitTransitionEnd'\n };\n\n for (t in transitions) {\n if (el.style[t] !== undefined) {\n return transitions[t];\n }\n }\n }\n\n /**\n * Check if target is part of parent node\n * @param target\n * @param parent\n * @returns {boolean}\n */\n static isPartOfNode(target, parent) {\n if (!target || !parent) {\n return false;\n }\n let now = target;\n while (now !== parent && now !== null) {\n if (now === parent) {\n break;\n }\n now = now.parentNode;\n }\n return now !== null;\n }\n\n /**\n * Finds the closest element including itself matching a callback\n * @param {Node} el\n * @param {Function} callback\n * @returns {Node|boolean}\n */\n static closestCallback(el, callback) {\n let element = el;\n while (element !== null) {\n if (callback(element)) {\n return element;\n }\n element = element.parentNode;\n }\n return false;\n }\n\n /**\n * Walks the tree until func returns true for given argument\n * @param target\n * @param func\n * @returns {boolean|HTMLElement}\n */\n static parentsUntil(target, func) {\n if (!target) {\n return false;\n }\n let now = target;\n while (!func(now) && now !== null) {\n now = now.parentNode;\n }\n\n return now;\n }\n\n /**\n * Generates a unique id\n * @return {String}\n */\n static guid() {\n function s4() {\n return Math.floor((1 + Math.random()) * 0x10000)\n .toString(16)\n .substring(1);\n }\n\n return `${s4() + s4()}-${s4()}-${s4()}-${s4()}-${s4() + s4() + s4()}`;\n }\n\n /**\n * Detects scrollbar width\n * @see http://stackoverflow.com/questions/986937/how-can-i-get-the-browsers-scrollbar-sizes\n * @returns {number}\n */\n static getScrollBarWidth() {\n const doc = global.document;\n const inner = doc.createElement('p');\n\n inner.style.width = \"100%\";\n inner.style.height = \"200px\";\n\n const outer = doc.createElement('div');\n outer.style.position = \"absolute\";\n outer.style.top = \"0px\";\n outer.style.left = \"0px\";\n outer.style.visibility = \"hidden\";\n outer.style.width = \"200px\";\n outer.style.height = \"150px\";\n outer.style.overflow = \"hidden\";\n outer.appendChild(inner);\n\n doc.body.appendChild(outer);\n const w1 = inner.offsetWidth;\n outer.style.overflow = 'scroll';\n let w2 = inner.offsetWidth;\n if (w1 === w2) {\n w2 = outer.clientWidth;\n }\n doc.body.removeChild(outer);\n\n return (w1 - w2);\n }\n\n\n /**\n * Run an event once\n * @param {String} ev\n * @param {HTMLElement|HTMLDocument} target\n * @param {Function} func\n * @param {boolean} [capture]\n * @return Function created listener\n */\n static addEventOnce(ev, target, func, capture) {\n const thisFunction = function thisFunction(event) {\n func(event, func);\n target.removeEventListener(ev, thisFunction, capture);\n };\n target.addEventListener(ev, thisFunction, capture);\n return thisFunction;\n }\n\n /**\n * Checks if an element is visible\n * @param {HTMLElement} element\n * @returns bool\n */\n static isVisible(element) {\n return element.offsetWidth > 0 && element.offsetHeight > 0;\n }\n\n /**\n * Creates a camelCaseRepresentation of a dashed string\n * @param {String} str\n * @returns String\n */\n static dashToCamelCase(str) {\n return str.replace(/-([a-z])/g, (g) => {\n return g[1].toUpperCase();\n });\n }\n\n /**\n * Creates a copy of `input`\n * @param {*} input\n * @return *\n */\n static copy(input) {\n return JSON.parse(JSON.stringify(input));\n }\n\n /**\n * Reads options from element (data attributes) and applies to base\n * @param {HTMLElement} element\n * @param {Object} base\n * @return {Object}\n */\n static applyOptionsFromElement(element, base) {\n if (!element) {\n return base;\n }\n const attrs = element.attributes;\n for (let i = 0; i < attrs.length; i++) {\n const attr = attrs[i];\n if (attr) {\n const s = Util.dashToCamelCase(attr.nodeName.replace('data-', ''));\n const val = attr.nodeValue;\n if (base.hasOwnProperty(s)) {\n // skip functions\n if (typeof base[s] === 'function') {\n continue;\n }\n if (typeof base[s] === 'boolean') {\n base[s] = parseInt(val || 1, 10) === 1;\n } else {\n base[s] = val;\n }\n }\n }\n }\n return base;\n }\n\n /**\n * Will position an element directly at given target\n * Is aware of a given collision container to detect edges\n * Will put elementToPosition either to left, center or right edge (prefer right)\n * and either to bottom or top (prefers bottom)\n *\n * You may overwrite preferred positioned with `centerHorizontal` and `positionTop`\n *\n * @param {HTMLElement|ClientRect} target the target container to align to\n * @param {HTMLElement} elementToPosition the element to position\n * @param {HTMLElement} collisionContainer the outer container to prevent collisions\n * @param {boolean} [centerHorizontal] set true to center element, otherwise it's put on the right border by default\n * @param {boolean} [positionTop] flip top, by default element is positioned to the bottom.\n * @returns {HTMLElement}\n */\n static setupPositionNearby(target, elementToPosition, collisionContainer, centerHorizontal, positionTop) {\n // determine relative offsets\n let amountTop = 0;\n let amountLeft = 0;\n Util.parentsUntil(target.parentNode, (el) => {\n if (!(el instanceof HTMLElement)) {\n return false;\n }\n const style = window.getComputedStyle(el);\n if (Util.isPartOfNode(elementToPosition, el)) {\n if (style && style.position === 'relative') {\n amountTop += el.offsetTop || 0;\n amountLeft += el.offsetLeft || 0;\n }\n return false;\n }\n return true;\n });\n\n const targetPosition = target instanceof HTMLElement ? target.getBoundingClientRect() : target;\n const elementRect = elementToPosition.getBoundingClientRect();\n const colRect = collisionContainer.getBoundingClientRect();\n const targetTop = targetPosition.top - amountTop;\n const targetRight = targetPosition.right;\n const isCollisionTop = (targetTop - elementRect.height) <= 0;\n const isCollisionBottom =\n window.innerHeight < (targetTop + amountTop + targetPosition.height + elementRect.height);\n const isCollisionLeft = targetRight < elementRect.width;\n const targetLeft = targetPosition.left;\n const isCollisionRight = (targetLeft + elementRect.width) > colRect.width;\n const classList = elementToPosition.classList;\n\n classList.remove(COL_RIGHT_CLASS);\n classList.remove(COL_LEFT_CLASS);\n classList.remove(COL_BOTTOM_CLASS);\n\n let calcTop;\n let calcLeft;\n if (isCollisionLeft && !isCollisionRight) {\n // put element to left if collision with left\n calcLeft = `${(targetPosition.left - colRect.left - amountLeft)}px`;\n classList.add(COL_LEFT_CLASS);\n } else {\n // maybe center if no collision with either side\n const rightPosition = `${(targetRight - elementRect.width - colRect.left - amountLeft)}px`;\n const leftCentered = ((targetLeft + targetPosition.width / 2) -\n (elementRect.width / 2) || 0) - colRect.left;\n const collisionCentered = (leftCentered + elementRect.width) > colRect.width;\n if (centerHorizontal && !collisionCentered) {\n calcLeft = `${leftCentered}px`;\n } else {\n classList.add(COL_RIGHT_CLASS);\n calcLeft = rightPosition;\n }\n }\n\n if (isCollisionBottom || (positionTop && !isCollisionTop)) {\n // Put Element on top if collision\n calcTop = `${(targetTop - elementRect.height) - colRect.top}px`;\n classList.add(COL_BOTTOM_CLASS);\n } else {\n calcTop = `${(targetTop + targetPosition.height) - colRect.top}px`;\n }\n\n elementToPosition.style.cssText = `top:${calcTop};left:${calcLeft};`;\n\n return elementToPosition;\n }\n\n /**\n * Brings a given element into viewport\n * @param {HTMLElement} el\n * @param {int|function}[optionalOffset]\n */\n static scrollToElement(el, optionalOffset) {\n el.scrollIntoView();\n let thisOffset = optionalOffset;\n // optionally use a additional scrollDif\n if (thisOffset) {\n if (typeof thisOffset === 'function') {\n thisOffset = optionalOffset();\n }\n if (thisOffset > 0) {\n const scrolledY = window.pageYOffset;\n if (scrolledY) {\n window.scroll(0, scrolledY - thisOffset);\n }\n }\n }\n }\n}\n\nexport default Util;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/main/util/Util.js\n **/","/*\n * The MIT License (MIT)\n *\n * Copyright (c) 2015 David Heidrich, BowlingX \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\nimport Util from './Util';\n\n// we attach global settings to global once because settings might be shared a lot of times trough the application\n// Maybe find a better way to handle that scenario\nif (!global.FLEXCSS_GLOBAL_SETTINGS) {\n global.FLEXCSS_GLOBAL_SETTINGS = {\n // defined breakpoint for small devices < n\n smallBreakpoint: 768,\n // nodes that should be updated when no scrollbar is expected\n scrollbarUpdateNodes: global.document.body !== null ? [global.document.body] : [],\n // additional Delay until darkener is fully hidden\n darkenerFadeDelay: 100,\n // class that is added if canvas has been toggled\n canvasToggledClass: 'toggled-canvas'\n };\n\n global.FLEXCSS_CONST_IS_IOS = null;\n\n global.FLEXCSS_CONST_IS_TOUCH = null;\n\n global.FLEXCSS_CONST_IS_IE = null;\n\n global.FLEXCSS_CONST_TAB_EVENT = 'click';\n\n global.FLEXCSS_IS_SMALL_SCREEN = false;\n\n const init = () => {\n // Measure scrollbar width\n global.FLEXCSS_CONST_SCROLLBAR_WIDTH = Util.getScrollBarWidth();\n // detect right transition end event\n global.FLEXCSS_CONST_TRANSITION_EVENT = Util.whichTransitionEndEvent();\n };\n\n if (global.document.readyState !== 'loading') {\n init();\n } else {\n // it's possible that global.document.body is not available if the document is not\n // loaded completely\n document.addEventListener('DOMContentLoaded', () => {\n init();\n });\n }\n}\n\n/**\n * Utility class that setups global settings\n */\nclass Settings {\n\n /**\n * Setup global settings, overwrite default values\n * @param {Object} settings\n */\n static setup(settings) {\n Object.assign(global.FLEXCSS_GLOBAL_SETTINGS, settings);\n }\n\n /**\n * Access to global settings\n * @returns {Object}\n */\n static get() {\n return global.FLEXCSS_GLOBAL_SETTINGS;\n }\n\n /**\n * Detects a IOS Device, caches subsequent calls\n * @returns {boolean}\n */\n static isIosDevice() {\n if (!global.FLEXCSS_CONST_IS_IOS) {\n global.FLEXCSS_CONST_IS_IOS = global.navigator.userAgent.match(/(iPad|iPhone|iPod)/i);\n }\n\n return global.FLEXCSS_CONST_IS_IOS;\n }\n\n /**\n * @returns {boolean}\n */\n static isSmallScreen() {\n return window.innerWidth < Settings.get().smallBreakpoint;\n }\n\n /**\n * Detects a touch device, caches subsequent calls\n * @returns {boolean}\n */\n static isTouchDevice() {\n if (!global.FLEXCSS_CONST_IS_TOUCH) {\n global.FLEXCSS_CONST_IS_TOUCH = 'ontouchstart' in window || !!(global.navigator.msMaxTouchPoints);\n }\n return global.FLEXCSS_CONST_IS_TOUCH;\n }\n\n /**\n * Checks if current browser is Internet Explorer\n * @returns {boolean|*}\n */\n static isIE() {\n if (!global.FLEXCSS_CONST_IS_IE) {\n global.FLEXCSS_CONST_IS_IE = \"ActiveXObject\" in window;\n }\n return global.FLEXCSS_CONST_IS_IE;\n }\n\n /**\n * @returns {String}\n */\n static getTransitionEvent() {\n return global.FLEXCSS_CONST_TRANSITION_EVENT;\n }\n\n /**\n * @returns {int}\n */\n static getScrollbarWidth() {\n return global.FLEXCSS_CONST_SCROLLBAR_WIDTH;\n }\n\n /**\n * @returns {String}\n */\n static getTabEvent() {\n return global.FLEXCSS_CONST_TAB_EVENT;\n }\n}\n\nexport default Settings;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/main/util/Settings.js\n **/","/* global CustomEvent */\n\n/*\n * The MIT License (MIT)\n *\n * Copyright (c) 2015 David Heidrich, BowlingX \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n// polyfill for custom events to make thinks work in IE\n// The needed polyfill is so small that I embedded it here\n(function poly() {\n if (!global.CustomEvent || typeof global.CustomEvent !== 'function') {\n const CustomEvent = function CustomEvent(event, params) {\n const thisParams = params ||\n {\n bubbles: false,\n cancelable: false,\n detail: undefined\n };\n const evt = document.createEvent(\"CustomEvent\");\n evt.initCustomEvent(event, thisParams.bubbles,\n thisParams.cancelable, thisParams.detail);\n return evt;\n };\n CustomEvent.prototype = global.Event.prototype;\n global.CustomEvent = CustomEvent;\n }\n})();\n/**\n * Simpler Event dispatching\n */\nclass EventHandler {\n\n /**\n * @param {HTMLElement} target\n * @param {String} name\n */\n constructor(target, name) {\n this.target = target;\n this.defaultOptions = {\n bubbles: true,\n cancelable: true\n };\n\n this.name = name;\n }\n\n /**\n * Set more options\n * @param {Object} options\n * @returns {EventHandler}\n */\n withOptions(options) {\n Object.assign(this.defaultOptions, (options || {}));\n return this;\n }\n\n /**\n * Call with the originalEvent\n * @param {Event} e\n * @returns {EventHandler}\n */\n withOriginal(e) {\n return this.withDetail({\n originalEvent: e\n });\n }\n\n /**\n * Extends the detail part of the event\n * @param {Object} o\n * @returns {EventHandler}\n */\n withDetail(o) {\n if (!this.defaultOptions.detail) {\n this.defaultOptions.detail = {};\n }\n Object.assign(this.defaultOptions.detail, o);\n return this;\n }\n\n /**\n * @returns {CustomEvent}\n */\n fire() {\n const e = new CustomEvent(this.name, this.defaultOptions);\n if (this.target) {\n this.target.dispatchEvent(e);\n }\n return e;\n }\n}\n\nclass Event {\n /**\n * Prepares to dispatch a custom event (without firing)\n * @param {HTMLElement} target\n * @param {String} name\n * @returns {EventHandler}\n */\n static dispatch(target, name) {\n return new EventHandler(target, name);\n }\n\n /**\n * Dispatches a custom event and fires it directly\n * @param {HTMLElement} target\n * @param {String} name\n * @param {Object} [options]\n * @returns {CustomEvent}\n */\n static dispatchAndFire(target, name, options) {\n return new EventHandler(target, name).withOptions(options).fire();\n }\n}\n\nexport default Event;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/main/util/Event.js\n **/","/*\n * The MIT License (MIT)\n *\n * Copyright (c) 2015 David Heidrich, BowlingX \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n/*!\n * FlexCss.Modal\n * Licensed under the MIT License (MIT)\n * Copyright (c) 2015 David Heidrich, BowlingX \n */\n\n/* global KeyboardEvent */\n\nimport Settings from './util/Settings';\nimport Event from './util/Event';\nimport Util from './util/Util';\nimport Widget from './Widget';\nimport FixedWindow from './lib/FixedWindow';\n\nconst HTML_ELEMENT = global.document.documentElement;\nconst KEY_ESC = 27;\n/* Attribute Names */\nconst ATTR_CREATE_NEW = 'data-new-instance';\nconst ATTR_CLOSE = 'data-close-modal';\nconst ATTR_NAME = 'data-modal';\n\n/* Class names */\nconst CLS_CONTAINER_CURRENT = 'front';\nconst CLS_OPEN = 'open';\nconst CLS_CURRENT = 'current';\nconst CLS_PART_OF_STACK = 'part-of-stack';\nconst CLS_MODAL_OPEN = 'modal-open';\nconst CLS_MODAL_CONTAINER = 'modal-container';\nconst CLS_ANIM_END = 'modal-anim-end';\nconst CLS_LOADER_CONTAINER = 'loader-container';\nconst CLS_LOADER = 'loader';\n\n/* Events */\n\n/**\n * Event triggered when modal is closed\n * @type {string}\n */\nexport const EVENT_MODAL_CLOSED = 'flexcss.modal.closed';\n/**\n * Event triggered before a modal is closed, cancelable\n * @type {string}\n */\nexport const EVENT_MODAL_BEFORE_CLOSED = 'flexcss.modal.beforeClose';\n/**\n * Event triggered when a modal is opened\n * @type {string}\n */\nexport const EVENT_MODAL_OPENED = 'flexcss.modal.opened';\n\n/**\n * Event triggered when modal is initilized, called on target\n * @type {string}\n */\nexport const EVENT_MODAL_INIT = 'flexcss.modal.init';\n\n/**\n * Triggered when the content of an async modal on a target is loaded, called on target\n * @type {string}\n */\nexport const EVENT_MODAL_ASYNC_TARGET_LOADED = 'flexcss.modal.asyncTargetLoaded';\n\n/**\n * A Modal Implementation\n */\nclass Modal {\n constructor(DelegateContainer, options) {\n const doc = global.document;\n const container = DelegateContainer instanceof HTMLElement ?\n DelegateContainer : doc.getElementById(DelegateContainer);\n\n // Instance vars:\n if (!container) {\n throw new Error(`Could not found container element by given ID/Element: ${DelegateContainer}`);\n }\n\n this.currentOpen = null;\n\n this.loading = false;\n\n this.container = container;\n\n /**\n * Default Options\n */\n this.options = {\n classNames: 'modal',\n closeOnEscape: true,\n closeOnBackgroundClick: true,\n destroyOnFinish: false,\n fixedContainer: true,\n containerClassNames: ''\n };\n\n Object.assign(this.options, options);\n\n // Container where events are delegated\n this.eventContainer = null;\n this.eventFunction = null;\n\n this.dataMainPageContainer = global.document.body;\n\n this.currentScrollTop = 0;\n\n this.modalContainer = null;\n\n // Destroy full modal instance when no dialogs are bind to?\n // Otherwise container is recycled\n this.destroyOnFinish = this.options.destroyOnFinish;\n }\n\n /**\n * Removes this modal from global stack\n * Will handle fixing main html element too\n * @private\n * @param n\n */\n _removeModalFromStack(n) {\n const t = Modal._modalInstances.indexOf(n);\n if (t > -1) {\n Modal._modalInstances.splice(t, 1);\n FixedWindow.getInstance().close();\n HTML_ELEMENT.classList.remove(CLS_MODAL_OPEN);\n }\n }\n\n\n /**\n * Modal container that contains all `stacked` modals for this instance\n * @returns {HTMLElement}\n */\n getModalContainer() {\n return this.modalContainer;\n }\n\n /**\n * Closes the current open modal of this stack\n * @params [e], optional event\n * @returns {*}\n */\n close(e) {\n const self = this;\n\n const options = self.currentOpen ? Util.applyOptionsFromElement(\n self.currentOpen, Util.copy(self.options)) : self.options;\n\n // close only on keyboard if instance should\n if (!options.closeOnEscape && e instanceof KeyboardEvent) {\n return false;\n }\n\n // close only on background if instance should\n if (!options.closeOnBackgroundClick && e &&\n e.type === Settings.getTabEvent() && !e.target.hasAttribute(ATTR_CLOSE)) {\n return false;\n }\n\n // if an instance is currently loading, prevent from closing\n if (self.loading) {\n return false;\n }\n\n if (e) {\n e.preventDefault();\n }\n\n if (self.currentOpen) {\n // dispatch beforeClose event, if prevented prevent modal from closing\n var ev = Event.dispatchAndFire(self.currentOpen, EVENT_MODAL_BEFORE_CLOSED);\n if (ev.defaultPrevented) {\n return false;\n }\n\n this._finishState(self.currentOpen);\n // if there is an previous modal\n if (self.currentOpen.prevModal) {\n // switch to the next modal\n return self.switchModals(self.currentOpen.prevModal,\n self.currentOpen.prevModal.prevModal || null);\n }\n\n // finally trigger closed event\n Event.dispatch(self.currentOpen, EVENT_MODAL_CLOSED).withOriginal(e).fire();\n\n }\n self._removeModalFromStack(self.currentOpen);\n\n // Full stack closed:\n self.currentOpen = null;\n if (self.modalContainer) {\n // setup next open\n var lastContainer = Modal._modalInstances[Modal._modalInstances.length - 1],\n classList = self.modalContainer.classList;\n classList.remove(CLS_CONTAINER_CURRENT);\n classList.remove(CLS_OPEN);\n // Remove all current classes from child-nodes\n for (var i = 0; i < self.modalContainer.childNodes.length; i++) {\n var node = self.modalContainer.childNodes[i], cl = node.classList;\n // remove applied styles\n self._finishState(node);\n cl.remove(CLS_CURRENT);\n cl.remove(CLS_PART_OF_STACK);\n }\n if (lastContainer) {\n lastContainer.parentNode.classList.add(CLS_CONTAINER_CURRENT);\n }\n }\n\n if (self.destroyOnFinish) {\n self.destroy();\n }\n return self;\n }\n\n /**\n * Resets a target when newly initilizes\n * @param target\n * @private\n */\n _finishState(target) {\n target.classList.remove(CLS_ANIM_END);\n }\n\n /**\n * Handler called when a Modal has finished an animation\n * @param e\n * @param self\n * @private\n */\n _finishAnim(e, self) {\n e.target.classList.add(CLS_ANIM_END);\n e.target.removeEventListener(e.type, self, true);\n }\n\n /**\n * Brings the given modal to front\n * @param co\n * @param last\n */\n switchModals(co, last) {\n co.prevModal = last;\n Modal._modalInstances.push(co);\n FixedWindow.getInstance().open(this, this.modalContainer);\n if (last) {\n this._finishState(last);\n Util.prefixedAnimateEvent(last, 'AnimationEnd', this._finishAnim);\n last.classList.add(CLS_PART_OF_STACK);\n }\n // set new currentOpen\n this.currentOpen = co;\n\n // bring current container to the front\n var instances = Modal._modalInstances;\n\n for (var m = 0; m < instances.length; m++) {\n instances[m].parentNode.classList.remove(CLS_CONTAINER_CURRENT);\n }\n this.modalContainer.classList.add(CLS_CONTAINER_CURRENT);\n // remove animations if animations has been completed, fixes various bugs:\n // - fixes nested scrolling element issue in iOS Browsers / Mobile-Safari\n Util.prefixedAnimateEvent(co, 'AnimationEnd', this._finishAnim);\n\n for (var i = 0; i < this.modalContainer.childNodes.length; i++) {\n var n = this.modalContainer.childNodes[i], isCurrent = n.classList.contains(CLS_CURRENT);\n if (n === co) {\n co.classList.add(CLS_CURRENT);\n co.classList.remove(CLS_PART_OF_STACK);\n this._finishState(co);\n } else {\n n.classList.remove(CLS_CURRENT);\n if (isCurrent) {\n this._removeModalFromStack(n);\n Event.dispatchAndFire(n, EVENT_MODAL_CLOSED);\n }\n }\n }\n }\n\n handleScrollbar() {\n if (Modal._modalInstances.length === 0) {\n HTML_ELEMENT.classList.add(CLS_MODAL_OPEN);\n }\n }\n\n /**\n * Creates a Modal and opens it (later)\n * @param e\n * @returns {Promise|boolean}\n */\n createWidget(e) {\n var self = this;\n if (this.loading) {\n return false;\n }\n\n // check if another modal has registered events on this dom path:\n if (e && e.target) {\n var foundInstance = Util.parentsUntil(e.target, function (node) {\n return node && node.flexModalInstance;\n });\n\n // if another instance has been found, abort\n if (foundInstance !== this.container) {\n return false;\n }\n }\n var targetContent, future, widget, target, hasTarget = true,\n isHtmlElement = e instanceof HTMLElement, isWidget = Widget.isWidget(e);\n if (isHtmlElement || isWidget) {\n if (isHtmlElement) {\n targetContent = e;\n } else {\n widget = e;\n targetContent = widget.element;\n }\n } else {\n target = e.target;\n if (!target) {\n throw 'Could not find target, did you pass an event, a HTMLElement or an Widget?';\n }\n hasTarget = target.hasAttribute(ATTR_NAME);\n targetContent = target.getAttribute(ATTR_NAME);\n widget = Widget.findWidget(target);\n if (target.hasAttribute(ATTR_CREATE_NEW) && !e.newInstance) {\n var newInstance = new Modal(this.container)\n .setDestroyOnFinish(true);\n e.newInstance = true;\n newInstance.fromEvent(e).then(function () {\n newInstance.registerEvents(newInstance.getModalContainer());\n });\n return false;\n }\n if (hasTarget) {\n e.stopImmediatePropagation();\n e.preventDefault();\n }\n }\n\n if (!hasTarget) {\n return false;\n }\n\n let modalContainerClasses = this.modalContainer ? this.modalContainer.classList : [];\n\n // lazy create modal container\n if (!this.modalContainer) {\n this.modalContainer = global.document.createElement('div');\n this.modalContainer.className = `${CLS_MODAL_CONTAINER} ${this.options.containerClassNames} ${CLS_OPEN}`;\n const closeModalFunction = function (ce) {\n if (self.loading) {\n return false;\n }\n if (Util.isPartOfNode(ce.target, self.currentOpen)) {\n if (!ce.target.hasAttribute(ATTR_CLOSE)) {\n return false;\n }\n }\n self.close(ce);\n };\n\n this.modalContainer.addEventListener(Settings.getTabEvent(), closeModalFunction, false);\n\n modalContainerClasses = this.modalContainer.classList;\n this.container.appendChild(this.modalContainer);\n\n } else {\n modalContainerClasses.add(CLS_OPEN);\n }\n\n let loader, doc = global.document, toggleLoader = function (show) {\n if (show) {\n loader = doc.createElement('div');\n loader.className = CLS_LOADER_CONTAINER;\n var loaderLoader = doc.createElement('div');\n loaderLoader.className = CLS_LOADER;\n loader.appendChild(loaderLoader);\n self.modalContainer.appendChild(loader);\n } else {\n loader.parentNode.removeChild(loader);\n }\n };\n\n this.handleScrollbar();\n\n modalContainerClasses.add(CLS_CONTAINER_CURRENT);\n modalContainerClasses.add('loading');\n this.loading = true;\n toggleLoader(true);\n var async = widget ? widget.getAsync() : null;\n if (Widget.isWidget(widget) && async) {\n future = async.then(function (r) {\n var result;\n if (r instanceof HTMLElement || r instanceof DocumentFragment) {\n result = r;\n } else {\n // Create container Element:\n var element = doc.createElement('div');\n element.className = self.options.classNames;\n element.innerHTML = r;\n element.id = Util.guid();\n result = element;\n }\n widget.finalContent = result;\n Event.dispatchAndFire(target, EVENT_MODAL_ASYNC_TARGET_LOADED);\n return result;\n });\n } else {\n var el = targetContent instanceof HTMLElement ||\n targetContent instanceof DocumentFragment ? targetContent : doc.getElementById(targetContent);\n if (el) {\n future = new Promise((resolve) => {\n resolve(el);\n });\n } else {\n throw 'Could not found given modal element (content) with ID: ' + targetContent;\n }\n }\n\n Event.dispatchAndFire(target, EVENT_MODAL_INIT);\n\n return future.then((thisEl) => {\n thisEl.hfWidgetInstance = self;\n self.modalContainer.appendChild(thisEl);\n modalContainerClasses.remove('loading');\n self.loading = false;\n toggleLoader(false);\n\n self.open(thisEl, true, e);\n\n return thisEl;\n });\n }\n\n /**\n * Open's an already rendered modal\n * @param {HTMLElement} modal\n * @param {Boolean} [internal], set to true to prevent container management\n * @param {Boolean} [maybeEvent], optional event-object that triggered open\n */\n open(modal, internal, maybeEvent) {\n\n\n if (!internal) {\n this.modalContainer.classList.add('open');\n this.handleScrollbar();\n }\n this.switchModals(modal, this.currentOpen);\n\n Event.dispatch(modal, EVENT_MODAL_OPENED).withOriginal(maybeEvent).fire();\n }\n\n\n registerEvents(delegate) {\n var delegateContainer = delegate || this.container, self = this;\n // Modals should always be fixed\n FixedWindow.getInstance().addScreenConstraint(Modal, (width) => true);\n // register modal instance so we can detect multiple registrars\n delegateContainer.flexModalInstance = self;\n self.eventFunction = function () {\n self.createWidget.apply(self, arguments);\n };\n delegateContainer.addEventListener(Settings.getTabEvent(), self.eventFunction, false);\n\n self.eventContainer = delegateContainer;\n return self;\n }\n\n\n /**\n * Creates a new Dialog Instance either directly from HTML Element or a Widget instance\n * @param {HTMLElement|Widget} widget instance or html element\n * @returns {Promise}\n */\n fromWidget(widget) {\n return this.createWidget(widget);\n }\n\n /**\n * Creates a Widget from event\n * @param e\n * @returns {Promise}\n */\n fromEvent(e) {\n return this.createWidget(e);\n }\n\n setDestroyOnFinish(v) {\n this.destroyOnFinish = v;\n return this;\n }\n\n /**\n * Destroy this widget instance, cleans empty DOM nodes\n * Will use fast MutationObserver if available, otherwise falls back to DOMNodeRemoved event\n */\n destroy() {\n let self = this, modalContainer = this.modalContainer;\n const isEmptyContainer = modalContainer.childNodes.length === 0;\n // Remove event listener on destroy, do not remove DOM node\n if (self.eventContainer) {\n self.eventContainer.removeEventListener(Settings.getTabEvent(), self.eventFunction, true);\n }\n\n if (isEmptyContainer) {\n if (modalContainer.parentNode) {\n modalContainer.parentNode.removeChild(modalContainer);\n }\n }\n if (global.MutationObserver) {\n var observer = new MutationObserver(function (mutations) {\n mutations.forEach(function () {\n if (isEmptyContainer) {\n modalContainer.parentNode.removeChild(modalContainer);\n observer.disconnect();\n }\n });\n });\n observer.observe(modalContainer, {childList: true});\n } else {\n modalContainer.addEventListener('DOMNodeRemoved', function (e) {\n if (e.target !== modalContainer && (modalContainer.childNodes.length - 1) === 0) {\n modalContainer.parentNode.removeChild(modalContainer);\n }\n });\n }\n }\n}\n\n\n// Static variable that keeps track of all open modals\nModal._modalInstances = [];\n\n// Global keydown listener for modal\nglobal.addEventListener('keydown', function (e) {\n if (e.keyCode === KEY_ESC) {\n var lastModal = Modal._modalInstances[Modal._modalInstances.length - 1];\n if (lastModal) {\n Widget.findWidget(lastModal).close(e);\n }\n }\n});\n\nexport default Modal;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/main/Modal.js\n **/","/*\n * The MIT License (MIT)\n *\n * Copyright (c) 2015 David Heidrich, BowlingX \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n/*!\n * FlexCss.Widget\n * Licensed under the MIT License (MIT)\n * Copyright (c) 2015 David Heidrich, BowlingX \n */\n\n/**\n * A Widget provides async content on a specific target (e.g. a modal link)\n */\nclass Widget {\n\n /**\n * Creates a new Widget\n * @param [element], optional define the content of widget\n */\n constructor(element) {\n /**\n *\n * @type {Promise}\n */\n this.asyncContent = null;\n\n /**\n * @type {boolean}\n */\n this._isWidget = true;\n\n if (element) {\n /**\n * @type {HTMLElement}\n */\n this.element = element instanceof HTMLElement ? element : global.document.getElementById(element);\n if (this.element) {\n this.element.hfWidgetInstance = this;\n this.setAsync(() => {\n return new Promise((s) => {\n s(this.element);\n });\n });\n } else {\n throw new Error(`Could not found element with ID: ${element}`);\n }\n }\n /**\n * The final resulted content that a widget did create (e.g. a modal container)\n * @type {HTMLElement}\n */\n this.finalContent = null;\n }\n\n /**\n *\n * @returns {Promise}\n */\n getAsync() {\n return this.asyncContent();\n }\n\n /**\n * @param {Function.} async\n * @returns {Widget}\n */\n setAsync(async) {\n this.asyncContent = async;\n return this;\n }\n\n /**\n * @returns {HTMLElement}\n */\n getFinalContent() {\n return this.finalContent;\n }\n\n /**\n * @param {HTMLElement} element\n * @returns {Widget}\n */\n setElement(element) {\n this.element = element;\n return this;\n }\n\n /**\n * Destroys the generated content of this widget\n * @returns {boolean}\n */\n destroy() {\n if (this.finalContent && this.finalContent.parentNode) {\n this.finalContent.parentNode.removeChild(this.finalContent);\n return true;\n }\n\n delete this.element;\n delete this.asyncContent;\n delete this.finalContent;\n\n return false;\n }\n\n /**\n * Will find a widget on an Element\n * @param {HTMLElement} element\n * @returns {Widget|undefined}\n */\n static findWidget(element) {\n return element ? element.hfWidgetInstance : undefined;\n }\n\n /**\n * Checks if a given object is an instance\n * @param {Object} self\n * @returns {boolean}\n */\n static isWidget(self) {\n return self instanceof Widget || typeof self === 'object' && self.hasOwnProperty('_isWidget');\n }\n}\n\nexport default Widget;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/main/Widget.js\n **/","import Settings from '../util/Settings';\nimport debounce from './debounce';\nimport Event from '../util/Event';\nimport Util from '../util/Util';\n\nconst CLS_FIXED_WINDOW = 'fixed-window-open';\n\nexport const EVENT_BEFORE_FIXED_ADD = 'flexcss.fixedWindow.beforeAdd';\nexport const EVENT_AFTER_FIXED_REMOVE = 'flexcss.fixedWindow.afterRemove';\n\n/**\n * @type {FixedWindow}\n */\nlet fixedWindowInstance;\n\nexport default class FixedWindow {\n\n constructor() {\n this.widgets = [];\n this.currentScrollTop = 0;\n this.fixedScreenConstraints = [];\n this.windowWidth = 0;\n this.isFixedWindowActive = false;\n this.touchListener = null;\n }\n\n /**\n * Adds a constraint to detect if the window needs to be changed when the screensize changes\n *\n * @param {Function} widget\n * @param {Function} fixedBreakpointFn gets a width argument, return true to open a window\n */\n addScreenConstraint(widget, fixedBreakpointFn) {\n this.fixedScreenConstraints[widget] = fixedBreakpointFn;\n }\n\n /**\n * @returns {null|DestroyableWidget}\n */\n getCurrentWidget() {\n return this.widgets.length > 0 ? this.widgets[this.widgets.length - 1] : null;\n }\n\n /**\n * @private\n */\n _checkFixedNeeded() {\n if (this.widgets.length === 0) {\n return;\n }\n const widgets = new Set(this.widgets);\n const widgetsThatRequireFixedWindow = Array.from(widgets).some(({ widget }) => {\n return this.fixedScreenConstraints[widget] && this.fixedScreenConstraints[widget](this.windowWidth);\n });\n if (!widgetsThatRequireFixedWindow) {\n this._removeFixedContainer();\n } else {\n this._addFixedContainer();\n }\n }\n\n /**\n * @private\n */\n _addFixedContainer() {\n if (this.isFixedWindowActive) {\n return;\n }\n Event.dispatchAndFire(global.document, EVENT_BEFORE_FIXED_ADD, {\n detail: this.getCurrentWidget()\n });\n // this causes layout and should be optimized\n // At lest we write in a batch later\n Settings.get().scrollbarUpdateNodes.map((n) => {\n let foundProperty = 'paddingRight';\n let direction = 1;\n let node = n;\n if (n instanceof Array) {\n const [whatNode, property, d] = n;\n foundProperty = property;\n node = whatNode;\n direction = d || 1;\n }\n return {\n node,\n property: foundProperty,\n value: `${parseInt(global.getComputedStyle(node)[foundProperty], 10) +\n (!node.__fixedWindowMod__ ? (Settings.getScrollbarWidth() * direction) : 0)}px`\n };\n }).forEach((d) => {\n d.node.__fixedWindowMod__ = true;\n d.node.style[d.property] = d.value;\n });\n\n this.touchListener = (e) => {\n e.preventDefault();\n };\n\n let shouldNotMove = false;\n this.touchStartListener = (e) => {\n const { element } = this.getCurrentWidget();\n if (Util.isPartOfNode(e.target, element)) {\n if (element.scrollTop === 0) {\n element.scrollTop = 1;\n shouldNotMove = true;\n } else if (element.scrollHeight === element.scrollTop + element.offsetHeight) {\n shouldNotMove = true;\n element.scrollTop -= 1;\n }\n }\n };\n\n global.addEventListener('touchmove', this.touchListener);\n global.document.body.addEventListener('touchstart', this.touchStartListener);\n\n this.touchMoveListener = (e) => {\n const { element } = this.getCurrentWidget();\n if (Util.isPartOfNode(e.target, element)) {\n if (!shouldNotMove) {\n e.stopImmediatePropagation();\n }\n shouldNotMove = false;\n }\n };\n global.document.body.addEventListener('touchmove', this.touchMoveListener);\n\n global.document.documentElement.classList.add(CLS_FIXED_WINDOW);\n this.isFixedWindowActive = true;\n }\n\n /**\n * @private\n */\n _removeFixedContainer() {\n if (this.isFixedWindowActive) {\n // cleanup event listeners\n global.removeEventListener('touchmove', this.touchListener);\n global.document.body.removeEventListener('touchstart', this.touchStartListener);\n global.document.body.removeEventListener('touchmove', this.touchMoveListener);\n\n // reset scrollbar nodes\n Settings.get().scrollbarUpdateNodes.forEach((node) => {\n if (node instanceof Array) {\n const [whatNode, property] = node;\n delete whatNode.__fixedWindowMod__;\n whatNode.style[property] = '';\n } else {\n delete node.__fixedWindowMod__;\n node.style.paddingRight = '';\n }\n });\n global.document.documentElement.classList.remove(CLS_FIXED_WINDOW);\n Event.dispatchAndFire(global.document, EVENT_AFTER_FIXED_REMOVE);\n this.isFixedWindowActive = false;\n }\n }\n\n /**\n * Will close a window when no widgets are opened that need one\n */\n resizeListener() {\n this.windowWidth = global.innerWidth;\n this._checkFixedNeeded();\n }\n\n /**\n * @returns {FixedWindow}\n */\n static getInstance() {\n if (!fixedWindowInstance) {\n fixedWindowInstance = new FixedWindow();\n fixedWindowInstance.windowWidth = global.innerWidth;\n const eventHandler = fixedWindowInstance.resizeListener.bind(fixedWindowInstance);\n global.addEventListener(\n 'resize',\n debounce(eventHandler, 500)\n );\n global.addEventListener('orientationchange', eventHandler);\n }\n return fixedWindowInstance;\n }\n\n /**\n * Request a close of the fixed window\n */\n close() {\n this.widgets.pop();\n if (this.widgets.length === 0) {\n this._removeFixedContainer();\n }\n }\n\n /**\n * Request to open a fixed windows\n * @param {Object|DestroyableWidget} instance\n * @param {HTMLElement} element\n */\n open(instance, element) {\n let fixed = false;\n if (typeof instance === 'object') {\n const widget = instance.constructor;\n const fixedWidget = this.fixedScreenConstraints[instance.constructor];\n if (widget && fixedWidget) {\n fixed = fixedWidget(this.windowWidth);\n }\n const length = this.widgets.length;\n this.widgets.push(\n {\n widget,\n element\n }\n );\n // open a new window if there is no window active\n if (length === 0) {\n if (fixed) {\n this._addFixedContainer();\n }\n }\n }\n }\n}\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/main/lib/FixedWindow.js\n **/","export default (fn, ms) => () => {\n clearTimeout(fn.timeout);\n fn.timeout = setTimeout(fn, ms);\n};\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/main/lib/debounce.js\n **/","'use strict';\n\nimport Modal from '../Modal';\nimport Settings from '../util/Settings';\nimport Widget from '../Widget';\n\n// default export as component object\nexport default {\n Modal,\n Settings,\n Widget\n};\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/main/modules/Modal.js\n **/"],"sourceRoot":""} \ No newline at end of file diff --git a/build/maps/modal.min.map b/build/maps/modal.min.map index 6528bb9d..31d91eba 100644 --- a/build/maps/modal.min.map +++ b/build/maps/modal.min.map @@ -1 +1 @@ -{"version":3,"sources":["webpack:///webpack/universalModuleDefinition?5ca6*","webpack:///js/modal.min.js","webpack:///webpack/bootstrap 2abcfdab5a59a5cf6b3b?7be2*","webpack:///./src/main/util/Util.js?5bc4*","webpack:///./src/main/util/Settings.js?b01f*","webpack:///./src/main/util/Event.js?68bf*","webpack:///./src/main/Widget.js?920e","webpack:///./src/main/lib/FixedWindow.js?6376","webpack:///./src/main/Modal.js?a8d4","webpack:///./src/main/lib/debounce.js?3601","webpack:///./src/main/modules/Modal.js"],"names":["root","factory","exports","module","define","amd","this","modules","__webpack_require__","moduleId","installedModules","id","loaded","call","m","c","p","global","_classCallCheck","instance","Constructor","TypeError","Object","defineProperty","value","_createClass","defineProperties","target","props","i","length","descriptor","enumerable","configurable","writable","key","protoProps","staticProps","prototype","PFX","COL_LEFT_CLASS","COL_RIGHT_CLASS","COL_BOTTOM_CLASS","Util","element","type","callback","thisFunction","e","apply","thisType","toLowerCase","name","addEventListener","t","el","document","createElement","transitions","transition","OTransition","MozTransition","WebkitTransition","undefined","style","parent","now","parentNode","func","s4","Math","floor","random","toString","substring","doc","inner","width","height","outer","position","top","left","visibility","overflow","appendChild","body","w1","offsetWidth","w2","clientWidth","removeChild","ev","capture","event","removeEventListener","offsetHeight","str","replace","g","toUpperCase","input","JSON","parse","stringify","base","attrs","attributes","attr","s","dashToCamelCase","nodeName","val","nodeValue","hasOwnProperty","parseInt","elementToPosition","collisionContainer","centerHorizontal","positionTop","amountTop","amountLeft","parentsUntil","HTMLElement","window","getComputedStyle","isPartOfNode","offsetTop","offsetLeft","targetPosition","getBoundingClientRect","elementRect","colRect","targetTop","targetRight","right","isCollisionTop","isCollisionBottom","innerHeight","isCollisionLeft","targetLeft","isCollisionRight","classList","remove","calcTop","calcLeft","add","rightPosition","leftCentered","collisionCentered","cssText","optionalOffset","scrollIntoView","thisOffset","scrolledY","pageYOffset","scroll","_interopRequireDefault","obj","__esModule","default","_Util","_Util2","FLEXCSS_GLOBAL_SETTINGS","smallBreakpoint","scrollbarUpdateNodes","darkenerFadeDelay","canvasToggledClass","FLEXCSS_CONST_IS_IOS","FLEXCSS_CONST_IS_TOUCH","FLEXCSS_CONST_IS_IE","FLEXCSS_CONST_TAB_EVENT","FLEXCSS_IS_SMALL_SCREEN","init","FLEXCSS_CONST_SCROLLBAR_WIDTH","getScrollBarWidth","FLEXCSS_CONST_TRANSITION_EVENT","whichTransitionEndEvent","readyState","Settings","settings","assign","navigator","userAgent","match","innerWidth","get","msMaxTouchPoints","CustomEvent","_CustomEvent","params","thisParams","bubbles","cancelable","detail","evt","createEvent","initCustomEvent","Event","EventHandler","defaultOptions","options","withDetail","originalEvent","o","dispatchEvent","withOptions","fire","_typeof","Symbol","iterator","constructor","Widget","_this","asyncContent","_isWidget","getElementById","Error","hfWidgetInstance","setAsync","Promise","finalContent","async","self","EVENT_AFTER_FIXED_REMOVE","EVENT_BEFORE_FIXED_ADD","_slicedToArray","sliceIterator","arr","_arr","_n","_d","_e","_s","_i","next","done","push","err","Array","isArray","_Settings","_Settings2","_debounce","_debounce2","_Event","_Event2","CLS_FIXED_WINDOW","fixedWindowInstance","FixedWindow","widgets","currentScrollTop","fixedScreenConstraints","windowWidth","isFixedWindowActive","touchListener","widget","fixedBreakpointFn","Set","widgetsThatRequireFixedWindow","from","some","_ref","_addFixedContainer","_removeFixedContainer","_this2","dispatchAndFire","getCurrentWidget","map","n","foundProperty","direction","node","whatNode","property","d","__fixedWindowMod__","getScrollbarWidth","forEach","preventDefault","shouldNotMove","touchStartListener","_getCurrentWidget","scrollTop","scrollHeight","touchMoveListener","_getCurrentWidget2","stopImmediatePropagation","documentElement","_node","paddingRight","_checkFixedNeeded","pop","resolve","fixed","fixedWidget","eventHandler","resizeListener","bind","EVENT_MODAL_ASYNC_TARGET_LOADED","EVENT_MODAL_INIT","EVENT_MODAL_OPENED","EVENT_MODAL_BEFORE_CLOSED","EVENT_MODAL_CLOSED","_Widget","_Widget2","_FixedWindow","_FixedWindow2","HTML_ELEMENT","KEY_ESC","ATTR_CREATE_NEW","ATTR_CLOSE","ATTR_NAME","CLS_CONTAINER_CURRENT","CLS_OPEN","CLS_CURRENT","CLS_PART_OF_STACK","CLS_MODAL_OPEN","CLS_MODAL_CONTAINER","CLS_ANIM_END","CLS_LOADER_CONTAINER","CLS_LOADER","Modal","DelegateContainer","container","currentOpen","loading","classNames","closeOnEscape","closeOnBackgroundClick","destroyOnFinish","fixedContainer","containerClassNames","eventContainer","eventFunction","dataMainPageContainer","modalContainer","_modalInstances","indexOf","splice","getInstance","close","applyOptionsFromElement","copy","KeyboardEvent","getTabEvent","hasAttribute","defaultPrevented","_finishState","prevModal","switchModals","dispatch","withOriginal","_removeModalFromStack","lastContainer","childNodes","cl","destroy","co","last","open","prefixedAnimateEvent","_finishAnim","instances","isCurrent","contains","foundInstance","flexModalInstance","targetContent","future","hasTarget","isHtmlElement","isWidget","getAttribute","findWidget","newInstance","setDestroyOnFinish","fromEvent","then","registerEvents","getModalContainer","modalContainerClasses","className","closeModalFunction","ce","loader","toggleLoader","show","loaderLoader","handleScrollbar","getAsync","r","result","DocumentFragment","innerHTML","guid","thisEl","modal","internal","maybeEvent","delegate","delegateContainer","addScreenConstraint","createWidget","arguments","v","isEmptyContainer","MutationObserver","observer","mutations","disconnect","observe","childList","keyCode","lastModal","fn","ms","clearTimeout","timeout","setTimeout","_Modal","_Modal2"],"mappings":"CAAA,SAAAA,EAAAC,GACA,gBAAAC,UAAA,gBAAAC,QACAA,OAAAD,QAAAD,IACA,kBAAAG,gBAAAC,IACAD,UAAAH,GACA,gBAAAC,SACA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(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"FlexCss\"] = factory();\n\telse\n\t\troot[\"FlexCss\"] = factory();\n})(this, function() {\nreturn \n\n\n/** WEBPACK FOOTER **\n ** webpack/universalModuleDefinition\n **/","(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"FlexCss\"] = factory();\n\telse\n\t\troot[\"FlexCss\"] = factory();\n})(this, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId])\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\texports: {},\n/******/ \t\t\tid: moduleId,\n/******/ \t\t\tloaded: false\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.loaded = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"../\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tmodule.exports = __webpack_require__(19);\n\n\n/***/ },\n/* 1 */\n/***/ function(module, exports) {\n\n\t/* WEBPACK VAR INJECTION */(function(global) {\"use strict\";\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\t/*\n\t * The MIT License (MIT)\n\t *\n\t * Copyright (c) 2015 David Heidrich, BowlingX \n\t *\n\t * Permission is hereby granted, free of charge, to any person obtaining a copy\n\t * of this software and associated documentation files (the \"Software\"), to deal\n\t * in the Software without restriction, including without limitation the rights\n\t * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n\t * copies of the Software, and to permit persons to whom the Software is\n\t * furnished to do so, subject to the following conditions:\n\t *\n\t * The above copyright notice and this permission notice shall be included in\n\t * all copies or substantial portions of the Software.\n\t *\n\t * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n\t * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n\t * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n\t * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n\t * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n\t * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n\t * THE SOFTWARE.\n\t */\n\t\n\tvar PFX = [\"webkit\", \"moz\", \"MS\", \"o\", \"\"];\n\t\n\tvar COL_LEFT_CLASS = 'is-collision-left';\n\t\n\tvar COL_RIGHT_CLASS = 'is-collision-right';\n\t\n\tvar COL_BOTTOM_CLASS = 'is-collision-bottom';\n\t\n\t/**\n\t * Provides shared DOM-Utility functions\n\t */\n\t\n\tvar Util = function () {\n\t function Util() {\n\t _classCallCheck(this, Util);\n\t }\n\t\n\t _createClass(Util, null, [{\n\t key: \"prefixedAnimateEvent\",\n\t\n\t\n\t /**\n\t * Will register the right animation event based on browser\n\t * @param element\n\t * @param type\n\t * @param callback\n\t */\n\t value: function prefixedAnimateEvent(element, type, callback) {\n\t var thisFunction = function thisFunction(e) {\n\t callback.apply(element, [e, thisFunction]);\n\t };\n\t\n\t for (var p = 0; p < PFX.length; p++) {\n\t var thisType = type;\n\t if (!PFX[p]) {\n\t thisType = type.toLowerCase();\n\t }\n\t var name = PFX[p] + thisType;\n\t element.addEventListener(name, thisFunction, true);\n\t }\n\t }\n\t\n\t /**\n\t * Get correct transitionend event\n\t * @returns {String}\n\t * @private\n\t */\n\t\n\t }, {\n\t key: \"whichTransitionEndEvent\",\n\t value: function whichTransitionEndEvent() {\n\t var t = void 0;\n\t var el = document.createElement('fake');\n\t\n\t var transitions = {\n\t transition: 'transitionend',\n\t OTransition: 'oTransitionEnd',\n\t MozTransition: 'transitionend',\n\t WebkitTransition: 'webkitTransitionEnd'\n\t };\n\t\n\t for (t in transitions) {\n\t if (el.style[t] !== undefined) {\n\t return transitions[t];\n\t }\n\t }\n\t }\n\t\n\t /**\n\t * Check if target is part of parent node\n\t * @param target\n\t * @param parent\n\t * @returns {boolean}\n\t */\n\t\n\t }, {\n\t key: \"isPartOfNode\",\n\t value: function isPartOfNode(target, parent) {\n\t if (!target || !parent) {\n\t return false;\n\t }\n\t var now = target;\n\t while (now !== parent && now !== null) {\n\t if (now === parent) {\n\t break;\n\t }\n\t now = now.parentNode;\n\t }\n\t return now !== null;\n\t }\n\t\n\t /**\n\t * Finds the closest element including itself matching a callback\n\t * @param {Node} el\n\t * @param {Function} callback\n\t * @returns {Node|boolean}\n\t */\n\t\n\t }, {\n\t key: \"closestCallback\",\n\t value: function closestCallback(el, callback) {\n\t var element = el;\n\t while (element !== null) {\n\t if (callback(element)) {\n\t return element;\n\t }\n\t element = element.parentNode;\n\t }\n\t return false;\n\t }\n\t\n\t /**\n\t * Walks the tree until func returns true for given argument\n\t * @param target\n\t * @param func\n\t * @returns {boolean|HTMLElement}\n\t */\n\t\n\t }, {\n\t key: \"parentsUntil\",\n\t value: function parentsUntil(target, func) {\n\t if (!target) {\n\t return false;\n\t }\n\t var now = target;\n\t while (!func(now) && now !== null) {\n\t now = now.parentNode;\n\t }\n\t\n\t return now;\n\t }\n\t\n\t /**\n\t * Generates a unique id\n\t * @return {String}\n\t */\n\t\n\t }, {\n\t key: \"guid\",\n\t value: function guid() {\n\t function s4() {\n\t return Math.floor((1 + Math.random()) * 0x10000).toString(16).substring(1);\n\t }\n\t\n\t return s4() + s4() + \"-\" + s4() + \"-\" + s4() + \"-\" + s4() + \"-\" + (s4() + s4() + s4());\n\t }\n\t\n\t /**\n\t * Detects scrollbar width\n\t * @see http://stackoverflow.com/questions/986937/how-can-i-get-the-browsers-scrollbar-sizes\n\t * @returns {number}\n\t */\n\t\n\t }, {\n\t key: \"getScrollBarWidth\",\n\t value: function getScrollBarWidth() {\n\t var doc = global.document;\n\t var inner = doc.createElement('p');\n\t\n\t inner.style.width = \"100%\";\n\t inner.style.height = \"200px\";\n\t\n\t var outer = doc.createElement('div');\n\t outer.style.position = \"absolute\";\n\t outer.style.top = \"0px\";\n\t outer.style.left = \"0px\";\n\t outer.style.visibility = \"hidden\";\n\t outer.style.width = \"200px\";\n\t outer.style.height = \"150px\";\n\t outer.style.overflow = \"hidden\";\n\t outer.appendChild(inner);\n\t\n\t doc.body.appendChild(outer);\n\t var w1 = inner.offsetWidth;\n\t outer.style.overflow = 'scroll';\n\t var w2 = inner.offsetWidth;\n\t if (w1 === w2) {\n\t w2 = outer.clientWidth;\n\t }\n\t doc.body.removeChild(outer);\n\t\n\t return w1 - w2;\n\t }\n\t\n\t /**\n\t * Run an event once\n\t * @param {String} ev\n\t * @param {HTMLElement|HTMLDocument} target\n\t * @param {Function} func\n\t * @param {boolean} [capture]\n\t * @return Function created listener\n\t */\n\t\n\t }, {\n\t key: \"addEventOnce\",\n\t value: function addEventOnce(ev, target, func, capture) {\n\t var thisFunction = function thisFunction(event) {\n\t func(event, func);\n\t target.removeEventListener(ev, thisFunction, capture);\n\t };\n\t target.addEventListener(ev, thisFunction, capture);\n\t return thisFunction;\n\t }\n\t\n\t /**\n\t * Checks if an element is visible\n\t * @param {HTMLElement} element\n\t * @returns bool\n\t */\n\t\n\t }, {\n\t key: \"isVisible\",\n\t value: function isVisible(element) {\n\t return element.offsetWidth > 0 && element.offsetHeight > 0;\n\t }\n\t\n\t /**\n\t * Creates a camelCaseRepresentation of a dashed string\n\t * @param {String} str\n\t * @returns String\n\t */\n\t\n\t }, {\n\t key: \"dashToCamelCase\",\n\t value: function dashToCamelCase(str) {\n\t return str.replace(/-([a-z])/g, function (g) {\n\t return g[1].toUpperCase();\n\t });\n\t }\n\t\n\t /**\n\t * Creates a copy of `input`\n\t * @param {*} input\n\t * @return *\n\t */\n\t\n\t }, {\n\t key: \"copy\",\n\t value: function copy(input) {\n\t return JSON.parse(JSON.stringify(input));\n\t }\n\t\n\t /**\n\t * Reads options from element (data attributes) and applies to base\n\t * @param {HTMLElement} element\n\t * @param {Object} base\n\t * @return {Object}\n\t */\n\t\n\t }, {\n\t key: \"applyOptionsFromElement\",\n\t value: function applyOptionsFromElement(element, base) {\n\t if (!element) {\n\t return base;\n\t }\n\t var attrs = element.attributes;\n\t for (var i = 0; i < attrs.length; i++) {\n\t var attr = attrs[i];\n\t if (attr) {\n\t var s = Util.dashToCamelCase(attr.nodeName.replace('data-', ''));\n\t var val = attr.nodeValue;\n\t if (base.hasOwnProperty(s)) {\n\t // skip functions\n\t if (typeof base[s] === 'function') {\n\t continue;\n\t }\n\t if (typeof base[s] === 'boolean') {\n\t base[s] = parseInt(val || 1, 10) === 1;\n\t } else {\n\t base[s] = val;\n\t }\n\t }\n\t }\n\t }\n\t return base;\n\t }\n\t\n\t /**\n\t * Will position an element directly at given target\n\t * Is aware of a given collision container to detect edges\n\t * Will put elementToPosition either to left, center or right edge (prefer right)\n\t * and either to bottom or top (prefers bottom)\n\t *\n\t * You may overwrite preferred positioned with `centerHorizontal` and `positionTop`\n\t *\n\t * @param {HTMLElement|ClientRect} target the target container to align to\n\t * @param {HTMLElement} elementToPosition the element to position\n\t * @param {HTMLElement} collisionContainer the outer container to prevent collisions\n\t * @param {boolean} [centerHorizontal] set true to center element, otherwise it's put on the right border by default\n\t * @param {boolean} [positionTop] flip top, by default element is positioned to the bottom.\n\t * @returns {HTMLElement}\n\t */\n\t\n\t }, {\n\t key: \"setupPositionNearby\",\n\t value: function setupPositionNearby(target, elementToPosition, collisionContainer, centerHorizontal, positionTop) {\n\t // determine relative offsets\n\t var amountTop = 0;\n\t var amountLeft = 0;\n\t Util.parentsUntil(target.parentNode, function (el) {\n\t if (!(el instanceof HTMLElement)) {\n\t return false;\n\t }\n\t var style = window.getComputedStyle(el);\n\t if (Util.isPartOfNode(elementToPosition, el)) {\n\t if (style && style.position === 'relative') {\n\t amountTop += el.offsetTop || 0;\n\t amountLeft += el.offsetLeft || 0;\n\t }\n\t return false;\n\t }\n\t return true;\n\t });\n\t\n\t var targetPosition = target instanceof HTMLElement ? target.getBoundingClientRect() : target;\n\t var elementRect = elementToPosition.getBoundingClientRect();\n\t var colRect = collisionContainer.getBoundingClientRect();\n\t var targetTop = targetPosition.top - amountTop;\n\t var targetRight = targetPosition.right;\n\t var isCollisionTop = targetTop - elementRect.height <= 0;\n\t var isCollisionBottom = window.innerHeight < targetTop + amountTop + targetPosition.height + elementRect.height;\n\t var isCollisionLeft = targetRight < elementRect.width;\n\t var targetLeft = targetPosition.left;\n\t var isCollisionRight = targetLeft + elementRect.width > colRect.width;\n\t var classList = elementToPosition.classList;\n\t\n\t classList.remove(COL_RIGHT_CLASS);\n\t classList.remove(COL_LEFT_CLASS);\n\t classList.remove(COL_BOTTOM_CLASS);\n\t\n\t var calcTop = void 0;\n\t var calcLeft = void 0;\n\t if (isCollisionLeft && !isCollisionRight) {\n\t // put element to left if collision with left\n\t calcLeft = targetPosition.left - colRect.left - amountLeft + \"px\";\n\t classList.add(COL_LEFT_CLASS);\n\t } else {\n\t // maybe center if no collision with either side\n\t var rightPosition = targetRight - elementRect.width - colRect.left - amountLeft + \"px\";\n\t var leftCentered = (targetLeft + targetPosition.width / 2 - elementRect.width / 2 || 0) - colRect.left;\n\t var collisionCentered = leftCentered + elementRect.width > colRect.width;\n\t if (centerHorizontal && !collisionCentered) {\n\t calcLeft = leftCentered + \"px\";\n\t } else {\n\t classList.add(COL_RIGHT_CLASS);\n\t calcLeft = rightPosition;\n\t }\n\t }\n\t\n\t if (isCollisionBottom || positionTop && !isCollisionTop) {\n\t // Put Element on top if collision\n\t calcTop = targetTop - elementRect.height - colRect.top + \"px\";\n\t classList.add(COL_BOTTOM_CLASS);\n\t } else {\n\t calcTop = targetTop + targetPosition.height - colRect.top + \"px\";\n\t }\n\t\n\t elementToPosition.style.cssText = \"top:\" + calcTop + \";left:\" + calcLeft + \";\";\n\t\n\t return elementToPosition;\n\t }\n\t\n\t /**\n\t * Brings a given element into viewport\n\t * @param {HTMLElement} el\n\t * @param {int|function}[optionalOffset]\n\t */\n\t\n\t }, {\n\t key: \"scrollToElement\",\n\t value: function scrollToElement(el, optionalOffset) {\n\t el.scrollIntoView();\n\t var thisOffset = optionalOffset;\n\t // optionally use a additional scrollDif\n\t if (thisOffset) {\n\t if (typeof thisOffset === 'function') {\n\t thisOffset = optionalOffset();\n\t }\n\t if (thisOffset > 0) {\n\t var scrolledY = window.pageYOffset;\n\t if (scrolledY) {\n\t window.scroll(0, scrolledY - thisOffset);\n\t }\n\t }\n\t }\n\t }\n\t }]);\n\t\n\t return Util;\n\t}();\n\t\n\texports.default = Util;\n\t/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))\n\n/***/ },\n/* 2 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t/* WEBPACK VAR INJECTION */(function(global) {'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /*\n\t * The MIT License (MIT)\n\t *\n\t * Copyright (c) 2015 David Heidrich, BowlingX \n\t *\n\t * Permission is hereby granted, free of charge, to any person obtaining a copy\n\t * of this software and associated documentation files (the \"Software\"), to deal\n\t * in the Software without restriction, including without limitation the rights\n\t * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n\t * copies of the Software, and to permit persons to whom the Software is\n\t * furnished to do so, subject to the following conditions:\n\t *\n\t * The above copyright notice and this permission notice shall be included in\n\t * all copies or substantial portions of the Software.\n\t *\n\t * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n\t * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n\t * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n\t * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n\t * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n\t * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n\t * THE SOFTWARE.\n\t */\n\t\n\t\n\tvar _Util = __webpack_require__(1);\n\t\n\tvar _Util2 = _interopRequireDefault(_Util);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\t// we attach global settings to global once because settings might be shared a lot of times trough the application\n\t// Maybe find a better way to handle that scenario\n\tif (!global.FLEXCSS_GLOBAL_SETTINGS) {\n\t (function () {\n\t global.FLEXCSS_GLOBAL_SETTINGS = {\n\t // defined breakpoint for small devices < n\n\t smallBreakpoint: 768,\n\t // nodes that should be updated when no scrollbar is expected\n\t scrollbarUpdateNodes: global.document.body !== null ? [global.document.body] : [],\n\t // additional Delay until darkener is fully hidden\n\t darkenerFadeDelay: 100,\n\t // class that is added if canvas has been toggled\n\t canvasToggledClass: 'toggled-canvas'\n\t };\n\t\n\t global.FLEXCSS_CONST_IS_IOS = null;\n\t\n\t global.FLEXCSS_CONST_IS_TOUCH = null;\n\t\n\t global.FLEXCSS_CONST_IS_IE = null;\n\t\n\t global.FLEXCSS_CONST_TAB_EVENT = 'click';\n\t\n\t global.FLEXCSS_IS_SMALL_SCREEN = false;\n\t\n\t var init = function init() {\n\t // Measure scrollbar width\n\t global.FLEXCSS_CONST_SCROLLBAR_WIDTH = _Util2.default.getScrollBarWidth();\n\t // detect right transition end event\n\t global.FLEXCSS_CONST_TRANSITION_EVENT = _Util2.default.whichTransitionEndEvent();\n\t };\n\t\n\t if (global.document.readyState !== 'loading') {\n\t init();\n\t } else {\n\t // it's possible that global.document.body is not available if the document is not\n\t // loaded completely\n\t document.addEventListener('DOMContentLoaded', function () {\n\t init();\n\t });\n\t }\n\t })();\n\t}\n\t\n\t/**\n\t * Utility class that setups global settings\n\t */\n\t\n\tvar Settings = function () {\n\t function Settings() {\n\t _classCallCheck(this, Settings);\n\t }\n\t\n\t _createClass(Settings, null, [{\n\t key: 'setup',\n\t\n\t\n\t /**\n\t * Setup global settings, overwrite default values\n\t * @param {Object} settings\n\t */\n\t value: function setup(settings) {\n\t Object.assign(global.FLEXCSS_GLOBAL_SETTINGS, settings);\n\t }\n\t\n\t /**\n\t * Access to global settings\n\t * @returns {Object}\n\t */\n\t\n\t }, {\n\t key: 'get',\n\t value: function get() {\n\t return global.FLEXCSS_GLOBAL_SETTINGS;\n\t }\n\t\n\t /**\n\t * Detects a IOS Device, caches subsequent calls\n\t * @returns {boolean}\n\t */\n\t\n\t }, {\n\t key: 'isIosDevice',\n\t value: function isIosDevice() {\n\t if (!global.FLEXCSS_CONST_IS_IOS) {\n\t global.FLEXCSS_CONST_IS_IOS = global.navigator.userAgent.match(/(iPad|iPhone|iPod)/i);\n\t }\n\t\n\t return global.FLEXCSS_CONST_IS_IOS;\n\t }\n\t\n\t /**\n\t * @returns {boolean}\n\t */\n\t\n\t }, {\n\t key: 'isSmallScreen',\n\t value: function isSmallScreen() {\n\t return window.innerWidth < Settings.get().smallBreakpoint;\n\t }\n\t\n\t /**\n\t * Detects a touch device, caches subsequent calls\n\t * @returns {boolean}\n\t */\n\t\n\t }, {\n\t key: 'isTouchDevice',\n\t value: function isTouchDevice() {\n\t if (!global.FLEXCSS_CONST_IS_TOUCH) {\n\t global.FLEXCSS_CONST_IS_TOUCH = 'ontouchstart' in window || !!global.navigator.msMaxTouchPoints;\n\t }\n\t return global.FLEXCSS_CONST_IS_TOUCH;\n\t }\n\t\n\t /**\n\t * Checks if current browser is Internet Explorer\n\t * @returns {boolean|*}\n\t */\n\t\n\t }, {\n\t key: 'isIE',\n\t value: function isIE() {\n\t if (!global.FLEXCSS_CONST_IS_IE) {\n\t global.FLEXCSS_CONST_IS_IE = \"ActiveXObject\" in window;\n\t }\n\t return global.FLEXCSS_CONST_IS_IE;\n\t }\n\t\n\t /**\n\t * @returns {String}\n\t */\n\t\n\t }, {\n\t key: 'getTransitionEvent',\n\t value: function getTransitionEvent() {\n\t return global.FLEXCSS_CONST_TRANSITION_EVENT;\n\t }\n\t\n\t /**\n\t * @returns {int}\n\t */\n\t\n\t }, {\n\t key: 'getScrollbarWidth',\n\t value: function getScrollbarWidth() {\n\t return global.FLEXCSS_CONST_SCROLLBAR_WIDTH;\n\t }\n\t\n\t /**\n\t * @returns {String}\n\t */\n\t\n\t }, {\n\t key: 'getTabEvent',\n\t value: function getTabEvent() {\n\t return global.FLEXCSS_CONST_TAB_EVENT;\n\t }\n\t }]);\n\t\n\t return Settings;\n\t}();\n\t\n\texports.default = Settings;\n\t/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))\n\n/***/ },\n/* 3 */\n/***/ function(module, exports) {\n\n\t/* WEBPACK VAR INJECTION */(function(global) {\"use strict\";\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\t/* global CustomEvent */\n\t\n\t/*\n\t * The MIT License (MIT)\n\t *\n\t * Copyright (c) 2015 David Heidrich, BowlingX \n\t *\n\t * Permission is hereby granted, free of charge, to any person obtaining a copy\n\t * of this software and associated documentation files (the \"Software\"), to deal\n\t * in the Software without restriction, including without limitation the rights\n\t * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n\t * copies of the Software, and to permit persons to whom the Software is\n\t * furnished to do so, subject to the following conditions:\n\t *\n\t * The above copyright notice and this permission notice shall be included in\n\t * all copies or substantial portions of the Software.\n\t *\n\t * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n\t * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n\t * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n\t * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n\t * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n\t * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n\t * THE SOFTWARE.\n\t */\n\t\n\t// polyfill for custom events to make thinks work in IE\n\t// The needed polyfill is so small that I embedded it here\n\t(function poly() {\n\t if (!global.CustomEvent || typeof global.CustomEvent !== 'function') {\n\t var _CustomEvent = function CustomEvent(event, params) {\n\t var thisParams = params || {\n\t bubbles: false,\n\t cancelable: false,\n\t detail: undefined\n\t };\n\t var evt = document.createEvent(\"CustomEvent\");\n\t evt.initCustomEvent(event, thisParams.bubbles, thisParams.cancelable, thisParams.detail);\n\t return evt;\n\t };\n\t _CustomEvent.prototype = global.Event.prototype;\n\t global.CustomEvent = _CustomEvent;\n\t }\n\t})();\n\t/**\n\t * Simpler Event dispatching\n\t */\n\t\n\tvar EventHandler = function () {\n\t\n\t /**\n\t * @param {HTMLElement} target\n\t * @param {String} name\n\t */\n\t\n\t function EventHandler(target, name) {\n\t _classCallCheck(this, EventHandler);\n\t\n\t this.target = target;\n\t this.defaultOptions = {\n\t bubbles: true,\n\t cancelable: true\n\t };\n\t\n\t this.name = name;\n\t }\n\t\n\t /**\n\t * Set more options\n\t * @param {Object} options\n\t * @returns {EventHandler}\n\t */\n\t\n\t\n\t _createClass(EventHandler, [{\n\t key: \"withOptions\",\n\t value: function withOptions(options) {\n\t Object.assign(this.defaultOptions, options || {});\n\t return this;\n\t }\n\t\n\t /**\n\t * Call with the originalEvent\n\t * @param {Event} e\n\t * @returns {EventHandler}\n\t */\n\t\n\t }, {\n\t key: \"withOriginal\",\n\t value: function withOriginal(e) {\n\t return this.withDetail({\n\t originalEvent: e\n\t });\n\t }\n\t\n\t /**\n\t * Extends the detail part of the event\n\t * @param {Object} o\n\t * @returns {EventHandler}\n\t */\n\t\n\t }, {\n\t key: \"withDetail\",\n\t value: function withDetail(o) {\n\t if (!this.defaultOptions.detail) {\n\t this.defaultOptions.detail = {};\n\t }\n\t Object.assign(this.defaultOptions.detail, o);\n\t return this;\n\t }\n\t\n\t /**\n\t * @returns {CustomEvent}\n\t */\n\t\n\t }, {\n\t key: \"fire\",\n\t value: function fire() {\n\t var e = new CustomEvent(this.name, this.defaultOptions);\n\t if (this.target) {\n\t this.target.dispatchEvent(e);\n\t }\n\t return e;\n\t }\n\t }]);\n\t\n\t return EventHandler;\n\t}();\n\t\n\tvar Event = function () {\n\t function Event() {\n\t _classCallCheck(this, Event);\n\t }\n\t\n\t _createClass(Event, null, [{\n\t key: \"dispatch\",\n\t\n\t /**\n\t * Prepares to dispatch a custom event (without firing)\n\t * @param {HTMLElement} target\n\t * @param {String} name\n\t * @returns {EventHandler}\n\t */\n\t value: function dispatch(target, name) {\n\t return new EventHandler(target, name);\n\t }\n\t\n\t /**\n\t * Dispatches a custom event and fires it directly\n\t * @param {HTMLElement} target\n\t * @param {String} name\n\t * @param {Object} [options]\n\t * @returns {CustomEvent}\n\t */\n\t\n\t }, {\n\t key: \"dispatchAndFire\",\n\t value: function dispatchAndFire(target, name, options) {\n\t return new EventHandler(target, name).withOptions(options).fire();\n\t }\n\t }]);\n\t\n\t return Event;\n\t}();\n\t\n\texports.default = Event;\n\t/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))\n\n/***/ },\n/* 4 */\n/***/ function(module, exports) {\n\n\t/* WEBPACK VAR INJECTION */(function(global) {'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol ? \"symbol\" : typeof obj; };\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\t/*\n\t * The MIT License (MIT)\n\t *\n\t * Copyright (c) 2015 David Heidrich, BowlingX \n\t *\n\t * Permission is hereby granted, free of charge, to any person obtaining a copy\n\t * of this software and associated documentation files (the \"Software\"), to deal\n\t * in the Software without restriction, including without limitation the rights\n\t * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n\t * copies of the Software, and to permit persons to whom the Software is\n\t * furnished to do so, subject to the following conditions:\n\t *\n\t * The above copyright notice and this permission notice shall be included in\n\t * all copies or substantial portions of the Software.\n\t *\n\t * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n\t * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n\t * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n\t * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n\t * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n\t * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n\t * THE SOFTWARE.\n\t */\n\t\n\t/*!\n\t * FlexCss.Widget\n\t * Licensed under the MIT License (MIT)\n\t * Copyright (c) 2015 David Heidrich, BowlingX \n\t */\n\t\n\t/**\n\t * A Widget provides async content on a specific target (e.g. a modal link)\n\t */\n\t\n\tvar Widget = function () {\n\t\n\t /**\n\t * Creates a new Widget\n\t * @param [element], optional define the content of widget\n\t */\n\t\n\t function Widget(element) {\n\t var _this = this;\n\t\n\t _classCallCheck(this, Widget);\n\t\n\t /**\n\t *\n\t * @type {Promise}\n\t */\n\t this.asyncContent = null;\n\t\n\t /**\n\t * @type {boolean}\n\t */\n\t this._isWidget = true;\n\t\n\t if (element) {\n\t /**\n\t * @type {HTMLElement}\n\t */\n\t this.element = element instanceof HTMLElement ? element : global.document.getElementById(element);\n\t if (this.element) {\n\t this.element.hfWidgetInstance = this;\n\t this.setAsync(function () {\n\t return new Promise(function (s) {\n\t s(_this.element);\n\t });\n\t });\n\t } else {\n\t throw new Error('Could not found element with ID: ' + element);\n\t }\n\t }\n\t /**\n\t * The final resulted content that a widget did create (e.g. a modal container)\n\t * @type {HTMLElement}\n\t */\n\t this.finalContent = null;\n\t }\n\t\n\t /**\n\t *\n\t * @returns {Promise}\n\t */\n\t\n\t\n\t _createClass(Widget, [{\n\t key: 'getAsync',\n\t value: function getAsync() {\n\t return this.asyncContent();\n\t }\n\t\n\t /**\n\t * @param {Function.} async\n\t * @returns {Widget}\n\t */\n\t\n\t }, {\n\t key: 'setAsync',\n\t value: function setAsync(async) {\n\t this.asyncContent = async;\n\t return this;\n\t }\n\t\n\t /**\n\t * @returns {HTMLElement}\n\t */\n\t\n\t }, {\n\t key: 'getFinalContent',\n\t value: function getFinalContent() {\n\t return this.finalContent;\n\t }\n\t\n\t /**\n\t * @param {HTMLElement} element\n\t * @returns {Widget}\n\t */\n\t\n\t }, {\n\t key: 'setElement',\n\t value: function setElement(element) {\n\t this.element = element;\n\t return this;\n\t }\n\t\n\t /**\n\t * Destroys the generated content of this widget\n\t * @returns {boolean}\n\t */\n\t\n\t }, {\n\t key: 'destroy',\n\t value: function destroy() {\n\t if (this.finalContent && this.finalContent.parentNode) {\n\t this.finalContent.parentNode.removeChild(this.finalContent);\n\t return true;\n\t }\n\t\n\t delete this.element;\n\t delete this.asyncContent;\n\t delete this.finalContent;\n\t\n\t return false;\n\t }\n\t\n\t /**\n\t * Will find a widget on an Element\n\t * @param {HTMLElement} element\n\t * @returns {Widget|undefined}\n\t */\n\t\n\t }], [{\n\t key: 'findWidget',\n\t value: function findWidget(element) {\n\t return element ? element.hfWidgetInstance : undefined;\n\t }\n\t\n\t /**\n\t * Checks if a given object is an instance\n\t * @param {Object} self\n\t * @returns {boolean}\n\t */\n\t\n\t }, {\n\t key: 'isWidget',\n\t value: function isWidget(self) {\n\t return self instanceof Widget || (typeof self === 'undefined' ? 'undefined' : _typeof(self)) === 'object' && self.hasOwnProperty('_isWidget');\n\t }\n\t }]);\n\t\n\t return Widget;\n\t}();\n\t\n\texports.default = Widget;\n\t/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))\n\n/***/ },\n/* 5 */,\n/* 6 */,\n/* 7 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t/* WEBPACK VAR INJECTION */(function(global) {'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports.EVENT_AFTER_FIXED_REMOVE = exports.EVENT_BEFORE_FIXED_ADD = undefined;\n\t\n\tvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol ? \"symbol\" : typeof obj; };\n\t\n\tvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _Settings = __webpack_require__(2);\n\t\n\tvar _Settings2 = _interopRequireDefault(_Settings);\n\t\n\tvar _debounce = __webpack_require__(10);\n\t\n\tvar _debounce2 = _interopRequireDefault(_debounce);\n\t\n\tvar _Event = __webpack_require__(3);\n\t\n\tvar _Event2 = _interopRequireDefault(_Event);\n\t\n\tvar _Util = __webpack_require__(1);\n\t\n\tvar _Util2 = _interopRequireDefault(_Util);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tvar CLS_FIXED_WINDOW = 'fixed-window-open';\n\t\n\tvar EVENT_BEFORE_FIXED_ADD = exports.EVENT_BEFORE_FIXED_ADD = 'flexcss.fixedWindow.beforeAdd';\n\tvar EVENT_AFTER_FIXED_REMOVE = exports.EVENT_AFTER_FIXED_REMOVE = 'flexcss.fixedWindow.afterRemove';\n\t\n\t/**\n\t * @type {FixedWindow}\n\t */\n\tvar fixedWindowInstance = void 0;\n\t\n\tvar FixedWindow = function () {\n\t function FixedWindow() {\n\t _classCallCheck(this, FixedWindow);\n\t\n\t this.widgets = [];\n\t this.currentScrollTop = 0;\n\t this.fixedScreenConstraints = [];\n\t this.windowWidth = 0;\n\t this.isFixedWindowActive = false;\n\t this.touchListener = null;\n\t }\n\t\n\t /**\n\t * Adds a constraint to detect if the window needs to be changed when the screensize changes\n\t *\n\t * @param {Function} widget\n\t * @param {Function} fixedBreakpointFn gets a width argument, return true to open a window\n\t */\n\t\n\t\n\t _createClass(FixedWindow, [{\n\t key: 'addScreenConstraint',\n\t value: function addScreenConstraint(widget, fixedBreakpointFn) {\n\t this.fixedScreenConstraints[widget] = fixedBreakpointFn;\n\t }\n\t\n\t /**\n\t * @returns {null|DestroyableWidget}\n\t */\n\t\n\t }, {\n\t key: 'getCurrentWidget',\n\t value: function getCurrentWidget() {\n\t return this.widgets.length > 0 ? this.widgets[this.widgets.length - 1] : null;\n\t }\n\t\n\t /**\n\t * @private\n\t */\n\t\n\t }, {\n\t key: '_checkFixedNeeded',\n\t value: function _checkFixedNeeded() {\n\t var _this = this;\n\t\n\t if (this.widgets.length === 0) {\n\t return;\n\t }\n\t var widgets = new Set(this.widgets);\n\t var widgetsThatRequireFixedWindow = Array.from(widgets).some(function (_ref) {\n\t var widget = _ref.widget;\n\t\n\t return _this.fixedScreenConstraints[widget] && _this.fixedScreenConstraints[widget](_this.windowWidth);\n\t });\n\t if (!widgetsThatRequireFixedWindow) {\n\t this._removeFixedContainer();\n\t } else {\n\t this._addFixedContainer();\n\t }\n\t }\n\t\n\t /**\n\t * @private\n\t */\n\t\n\t }, {\n\t key: '_addFixedContainer',\n\t value: function _addFixedContainer() {\n\t var _this2 = this;\n\t\n\t if (this.isFixedWindowActive) {\n\t return;\n\t }\n\t _Event2.default.dispatchAndFire(global.document, EVENT_BEFORE_FIXED_ADD, {\n\t detail: this.getCurrentWidget()\n\t });\n\t // this causes layout and should be optimized\n\t // At lest we write in a batch later\n\t _Settings2.default.get().scrollbarUpdateNodes.map(function (n) {\n\t var foundProperty = 'paddingRight';\n\t var direction = 1;\n\t var node = n;\n\t if (n instanceof Array) {\n\t var _n = _slicedToArray(n, 3);\n\t\n\t var whatNode = _n[0];\n\t var property = _n[1];\n\t var d = _n[2];\n\t\n\t foundProperty = property;\n\t node = whatNode;\n\t direction = d || 1;\n\t }\n\t return {\n\t node: node,\n\t property: foundProperty,\n\t value: parseInt(global.getComputedStyle(node)[foundProperty], 10) + (!node.__fixedWindowMod__ ? _Settings2.default.getScrollbarWidth() * direction : 0) + 'px'\n\t };\n\t }).forEach(function (d) {\n\t d.node.__fixedWindowMod__ = true;\n\t d.node.style[d.property] = d.value;\n\t });\n\t\n\t this.touchListener = function (e) {\n\t e.preventDefault();\n\t };\n\t\n\t var shouldNotMove = false;\n\t this.touchStartListener = function (e) {\n\t var _getCurrentWidget = _this2.getCurrentWidget();\n\t\n\t var element = _getCurrentWidget.element;\n\t\n\t if (_Util2.default.isPartOfNode(e.target, element)) {\n\t if (element.scrollTop === 0) {\n\t element.scrollTop = 1;\n\t shouldNotMove = true;\n\t } else if (element.scrollHeight === element.scrollTop + element.offsetHeight) {\n\t shouldNotMove = true;\n\t element.scrollTop -= 1;\n\t }\n\t }\n\t };\n\t\n\t global.addEventListener('touchmove', this.touchListener);\n\t global.document.body.addEventListener('touchstart', this.touchStartListener);\n\t\n\t this.touchMoveListener = function (e) {\n\t var _getCurrentWidget2 = _this2.getCurrentWidget();\n\t\n\t var element = _getCurrentWidget2.element;\n\t\n\t if (_Util2.default.isPartOfNode(e.target, element)) {\n\t if (!shouldNotMove) {\n\t e.stopImmediatePropagation();\n\t }\n\t shouldNotMove = false;\n\t }\n\t };\n\t global.document.body.addEventListener('touchmove', this.touchMoveListener);\n\t\n\t global.document.documentElement.classList.add(CLS_FIXED_WINDOW);\n\t this.isFixedWindowActive = true;\n\t }\n\t\n\t /**\n\t * @private\n\t */\n\t\n\t }, {\n\t key: '_removeFixedContainer',\n\t value: function _removeFixedContainer() {\n\t if (this.isFixedWindowActive) {\n\t // cleanup event listeners\n\t global.removeEventListener('touchmove', this.touchListener);\n\t global.document.body.removeEventListener('touchstart', this.touchStartListener);\n\t global.document.body.removeEventListener('touchmove', this.touchMoveListener);\n\t\n\t // reset scrollbar nodes\n\t _Settings2.default.get().scrollbarUpdateNodes.forEach(function (node) {\n\t if (node instanceof Array) {\n\t var _node = _slicedToArray(node, 2);\n\t\n\t var whatNode = _node[0];\n\t var property = _node[1];\n\t\n\t delete whatNode.__fixedWindowMod__;\n\t whatNode.style[property] = '';\n\t } else {\n\t delete node.__fixedWindowMod__;\n\t node.style.paddingRight = '';\n\t }\n\t });\n\t global.document.documentElement.classList.remove(CLS_FIXED_WINDOW);\n\t _Event2.default.dispatchAndFire(global.document, EVENT_AFTER_FIXED_REMOVE);\n\t this.isFixedWindowActive = false;\n\t }\n\t }\n\t\n\t /**\n\t * Will close a window when no widgets are opened that need one\n\t */\n\t\n\t }, {\n\t key: 'resizeListener',\n\t value: function resizeListener() {\n\t this.windowWidth = global.innerWidth;\n\t this._checkFixedNeeded();\n\t }\n\t\n\t /**\n\t * @returns {FixedWindow}\n\t */\n\t\n\t }, {\n\t key: 'close',\n\t\n\t\n\t /**\n\t * Request a close of the fixed window\n\t */\n\t value: function close() {\n\t this.widgets.pop();\n\t if (this.widgets.length === 0) {\n\t this._removeFixedContainer();\n\t resolve();\n\t }\n\t }\n\t\n\t /**\n\t * Request to open a fixed windows\n\t * @param {Object|DestroyableWidget} instance\n\t * @param {HTMLElement} element\n\t */\n\t\n\t }, {\n\t key: 'open',\n\t value: function open(instance, element) {\n\t var fixed = false;\n\t if ((typeof instance === 'undefined' ? 'undefined' : _typeof(instance)) === 'object') {\n\t var widget = instance.constructor;\n\t var fixedWidget = this.fixedScreenConstraints[instance.constructor];\n\t if (widget && fixedWidget) {\n\t fixed = fixedWidget(this.windowWidth);\n\t }\n\t var length = this.widgets.length;\n\t this.widgets.push({\n\t widget: widget,\n\t element: element\n\t });\n\t // open a new window if there is no window active\n\t if (length === 0) {\n\t if (fixed) {\n\t this._addFixedContainer();\n\t }\n\t }\n\t }\n\t }\n\t }], [{\n\t key: 'getInstance',\n\t value: function getInstance() {\n\t if (!fixedWindowInstance) {\n\t fixedWindowInstance = new FixedWindow();\n\t fixedWindowInstance.windowWidth = global.innerWidth;\n\t var eventHandler = fixedWindowInstance.resizeListener.bind(fixedWindowInstance);\n\t global.addEventListener('resize', (0, _debounce2.default)(eventHandler, 500));\n\t global.addEventListener('orientationchange', eventHandler);\n\t }\n\t return fixedWindowInstance;\n\t }\n\t }]);\n\t\n\t return FixedWindow;\n\t}();\n\n\texports.default = FixedWindow;\n\t/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))\n\n/***/ },\n/* 8 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t/* WEBPACK VAR INJECTION */(function(global) {'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports.EVENT_MODAL_ASYNC_TARGET_LOADED = exports.EVENT_MODAL_INIT = exports.EVENT_MODAL_OPENED = exports.EVENT_MODAL_BEFORE_CLOSED = exports.EVENT_MODAL_CLOSED = undefined;\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /*\n\t * The MIT License (MIT)\n\t *\n\t * Copyright (c) 2015 David Heidrich, BowlingX \n\t *\n\t * Permission is hereby granted, free of charge, to any person obtaining a copy\n\t * of this software and associated documentation files (the \"Software\"), to deal\n\t * in the Software without restriction, including without limitation the rights\n\t * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n\t * copies of the Software, and to permit persons to whom the Software is\n\t * furnished to do so, subject to the following conditions:\n\t *\n\t * The above copyright notice and this permission notice shall be included in\n\t * all copies or substantial portions of the Software.\n\t *\n\t * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n\t * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n\t * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n\t * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n\t * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n\t * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n\t * THE SOFTWARE.\n\t */\n\t\n\t/*!\n\t * FlexCss.Modal\n\t * Licensed under the MIT License (MIT)\n\t * Copyright (c) 2015 David Heidrich, BowlingX \n\t */\n\t\n\t/* global KeyboardEvent */\n\t\n\tvar _Settings = __webpack_require__(2);\n\t\n\tvar _Settings2 = _interopRequireDefault(_Settings);\n\t\n\tvar _Event = __webpack_require__(3);\n\t\n\tvar _Event2 = _interopRequireDefault(_Event);\n\t\n\tvar _Util = __webpack_require__(1);\n\t\n\tvar _Util2 = _interopRequireDefault(_Util);\n\t\n\tvar _Widget = __webpack_require__(4);\n\t\n\tvar _Widget2 = _interopRequireDefault(_Widget);\n\t\n\tvar _FixedWindow = __webpack_require__(7);\n\t\n\tvar _FixedWindow2 = _interopRequireDefault(_FixedWindow);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tvar HTML_ELEMENT = global.document.documentElement;\n\tvar KEY_ESC = 27;\n\t/* Attribute Names */\n\tvar ATTR_CREATE_NEW = 'data-new-instance';\n\tvar ATTR_CLOSE = 'data-close-modal';\n\tvar ATTR_NAME = 'data-modal';\n\t\n\t/* Class names */\n\tvar CLS_CONTAINER_CURRENT = 'front';\n\tvar CLS_OPEN = 'open';\n\tvar CLS_CURRENT = 'current';\n\tvar CLS_PART_OF_STACK = 'part-of-stack';\n\tvar CLS_MODAL_OPEN = 'modal-open';\n\tvar CLS_MODAL_CONTAINER = 'modal-container';\n\tvar CLS_ANIM_END = 'modal-anim-end';\n\tvar CLS_LOADER_CONTAINER = 'loader-container';\n\tvar CLS_LOADER = 'loader';\n\t\n\t/* Events */\n\t\n\t/**\n\t * Event triggered when modal is closed\n\t * @type {string}\n\t */\n\tvar EVENT_MODAL_CLOSED = exports.EVENT_MODAL_CLOSED = 'flexcss.modal.closed';\n\t/**\n\t * Event triggered before a modal is closed, cancelable\n\t * @type {string}\n\t */\n\tvar EVENT_MODAL_BEFORE_CLOSED = exports.EVENT_MODAL_BEFORE_CLOSED = 'flexcss.modal.beforeClose';\n\t/**\n\t * Event triggered when a modal is opened\n\t * @type {string}\n\t */\n\tvar EVENT_MODAL_OPENED = exports.EVENT_MODAL_OPENED = 'flexcss.modal.opened';\n\t\n\t/**\n\t * Event triggered when modal is initilized, called on target\n\t * @type {string}\n\t */\n\tvar EVENT_MODAL_INIT = exports.EVENT_MODAL_INIT = 'flexcss.modal.init';\n\t\n\t/**\n\t * Triggered when the content of an async modal on a target is loaded, called on target\n\t * @type {string}\n\t */\n\tvar EVENT_MODAL_ASYNC_TARGET_LOADED = exports.EVENT_MODAL_ASYNC_TARGET_LOADED = 'flexcss.modal.asyncTargetLoaded';\n\t\n\t/**\n\t * A Modal Implementation\n\t */\n\t\n\tvar Modal = function () {\n\t function Modal(DelegateContainer, options) {\n\t _classCallCheck(this, Modal);\n\t\n\t var doc = global.document;\n\t var container = DelegateContainer instanceof HTMLElement ? DelegateContainer : doc.getElementById(DelegateContainer);\n\t\n\t // Instance vars:\n\t if (!container) {\n\t throw new Error('Could not found container element by given ID/Element: ' + DelegateContainer);\n\t }\n\t\n\t this.currentOpen = null;\n\t\n\t this.loading = false;\n\t\n\t this.container = container;\n\t\n\t /**\n\t * Default Options\n\t */\n\t this.options = {\n\t classNames: 'modal',\n\t closeOnEscape: true,\n\t closeOnBackgroundClick: true,\n\t destroyOnFinish: false,\n\t fixedContainer: true,\n\t containerClassNames: ''\n\t };\n\t\n\t Object.assign(this.options, options);\n\t\n\t // Container where events are delegated\n\t this.eventContainer = null;\n\t this.eventFunction = null;\n\t\n\t this.dataMainPageContainer = global.document.body;\n\t\n\t this.currentScrollTop = 0;\n\t\n\t this.modalContainer = null;\n\t\n\t // Destroy full modal instance when no dialogs are bind to?\n\t // Otherwise container is recycled\n\t this.destroyOnFinish = this.options.destroyOnFinish;\n\t }\n\t\n\t /**\n\t * Removes this modal from global stack\n\t * Will handle fixing main html element too\n\t * @private\n\t * @param n\n\t */\n\t\n\t\n\t _createClass(Modal, [{\n\t key: '_removeModalFromStack',\n\t value: function _removeModalFromStack(n) {\n\t var t = Modal._modalInstances.indexOf(n);\n\t if (t > -1) {\n\t Modal._modalInstances.splice(t, 1);\n\t _FixedWindow2.default.getInstance().close();\n\t HTML_ELEMENT.classList.remove(CLS_MODAL_OPEN);\n\t }\n\t }\n\t\n\t /**\n\t * Modal container that contains all `stacked` modals for this instance\n\t * @returns {HTMLElement}\n\t */\n\t\n\t }, {\n\t key: 'getModalContainer',\n\t value: function getModalContainer() {\n\t return this.modalContainer;\n\t }\n\t\n\t /**\n\t * Closes the current open modal of this stack\n\t * @params [e], optional event\n\t * @returns {*}\n\t */\n\t\n\t }, {\n\t key: 'close',\n\t value: function close(e) {\n\t var self = this;\n\t\n\t var options = self.currentOpen ? _Util2.default.applyOptionsFromElement(self.currentOpen, _Util2.default.copy(self.options)) : self.options;\n\t\n\t // close only on keyboard if instance should\n\t if (!options.closeOnEscape && e instanceof KeyboardEvent) {\n\t return false;\n\t }\n\t\n\t // close only on background if instance should\n\t if (!options.closeOnBackgroundClick && e && e.type === _Settings2.default.getTabEvent() && !e.target.hasAttribute(ATTR_CLOSE)) {\n\t return false;\n\t }\n\t\n\t // if an instance is currently loading, prevent from closing\n\t if (self.loading) {\n\t return false;\n\t }\n\t\n\t if (e) {\n\t e.preventDefault();\n\t }\n\t\n\t if (self.currentOpen) {\n\t // dispatch beforeClose event, if prevented prevent modal from closing\n\t var ev = _Event2.default.dispatchAndFire(self.currentOpen, EVENT_MODAL_BEFORE_CLOSED);\n\t if (ev.defaultPrevented) {\n\t return false;\n\t }\n\t\n\t this._finishState(self.currentOpen);\n\t // if there is an previous modal\n\t if (self.currentOpen.prevModal) {\n\t // switch to the next modal\n\t return self.switchModals(self.currentOpen.prevModal, self.currentOpen.prevModal.prevModal || null);\n\t }\n\t\n\t // finally trigger closed event\n\t _Event2.default.dispatch(self.currentOpen, EVENT_MODAL_CLOSED).withOriginal(e).fire();\n\t }\n\t self._removeModalFromStack(self.currentOpen);\n\t\n\t // Full stack closed:\n\t self.currentOpen = null;\n\t if (self.modalContainer) {\n\t // setup next open\n\t var lastContainer = Modal._modalInstances[Modal._modalInstances.length - 1],\n\t classList = self.modalContainer.classList;\n\t classList.remove(CLS_CONTAINER_CURRENT);\n\t classList.remove(CLS_OPEN);\n\t // Remove all current classes from child-nodes\n\t for (var i = 0; i < self.modalContainer.childNodes.length; i++) {\n\t var node = self.modalContainer.childNodes[i],\n\t cl = node.classList;\n\t // remove applied styles\n\t self._finishState(node);\n\t cl.remove(CLS_CURRENT);\n\t cl.remove(CLS_PART_OF_STACK);\n\t }\n\t if (lastContainer) {\n\t lastContainer.parentNode.classList.add(CLS_CONTAINER_CURRENT);\n\t }\n\t }\n\t\n\t if (self.destroyOnFinish) {\n\t self.destroy();\n\t }\n\t return self;\n\t }\n\t\n\t /**\n\t * Resets a target when newly initilizes\n\t * @param target\n\t * @private\n\t */\n\t\n\t }, {\n\t key: '_finishState',\n\t value: function _finishState(target) {\n\t target.classList.remove(CLS_ANIM_END);\n\t }\n\t\n\t /**\n\t * Handler called when a Modal has finished an animation\n\t * @param e\n\t * @param self\n\t * @private\n\t */\n\t\n\t }, {\n\t key: '_finishAnim',\n\t value: function _finishAnim(e, self) {\n\t e.target.classList.add(CLS_ANIM_END);\n\t e.target.removeEventListener(e.type, self, true);\n\t }\n\t\n\t /**\n\t * Brings the given modal to front\n\t * @param co\n\t * @param last\n\t */\n\t\n\t }, {\n\t key: 'switchModals',\n\t value: function switchModals(co, last) {\n\t co.prevModal = last;\n\t Modal._modalInstances.push(co);\n\t _FixedWindow2.default.getInstance().open(this, this.modalContainer);\n\t if (last) {\n\t this._finishState(last);\n\t _Util2.default.prefixedAnimateEvent(last, 'AnimationEnd', this._finishAnim);\n\t last.classList.add(CLS_PART_OF_STACK);\n\t }\n\t // set new currentOpen\n\t this.currentOpen = co;\n\t\n\t // bring current container to the front\n\t var instances = Modal._modalInstances;\n\t\n\t for (var m = 0; m < instances.length; m++) {\n\t instances[m].parentNode.classList.remove(CLS_CONTAINER_CURRENT);\n\t }\n\t this.modalContainer.classList.add(CLS_CONTAINER_CURRENT);\n\t // remove animations if animations has been completed, fixes various bugs:\n\t // - fixes nested scrolling element issue in iOS Browsers / Mobile-Safari\n\t _Util2.default.prefixedAnimateEvent(co, 'AnimationEnd', this._finishAnim);\n\t\n\t for (var i = 0; i < this.modalContainer.childNodes.length; i++) {\n\t var n = this.modalContainer.childNodes[i],\n\t isCurrent = n.classList.contains(CLS_CURRENT);\n\t if (n === co) {\n\t co.classList.add(CLS_CURRENT);\n\t co.classList.remove(CLS_PART_OF_STACK);\n\t this._finishState(co);\n\t } else {\n\t n.classList.remove(CLS_CURRENT);\n\t if (isCurrent) {\n\t this._removeModalFromStack(n);\n\t _Event2.default.dispatchAndFire(n, EVENT_MODAL_CLOSED);\n\t }\n\t }\n\t }\n\t }\n\t }, {\n\t key: 'handleScrollbar',\n\t value: function handleScrollbar() {\n\t if (Modal._modalInstances.length === 0) {\n\t HTML_ELEMENT.classList.add(CLS_MODAL_OPEN);\n\t }\n\t }\n\t\n\t /**\n\t * Creates a Modal and opens it (later)\n\t * @param e\n\t * @returns {Promise|boolean}\n\t */\n\t\n\t }, {\n\t key: 'createWidget',\n\t value: function createWidget(e) {\n\t var self = this;\n\t if (this.loading) {\n\t return false;\n\t }\n\t\n\t // check if another modal has registered events on this dom path:\n\t if (e && e.target) {\n\t var foundInstance = _Util2.default.parentsUntil(e.target, function (node) {\n\t return node && node.flexModalInstance;\n\t });\n\t\n\t // if another instance has been found, abort\n\t if (foundInstance !== this.container) {\n\t return false;\n\t }\n\t }\n\t var targetContent,\n\t future,\n\t widget,\n\t target,\n\t hasTarget = true,\n\t isHtmlElement = e instanceof HTMLElement,\n\t isWidget = _Widget2.default.isWidget(e);\n\t if (isHtmlElement || isWidget) {\n\t if (isHtmlElement) {\n\t targetContent = e;\n\t } else {\n\t widget = e;\n\t targetContent = widget.element;\n\t }\n\t } else {\n\t target = e.target;\n\t if (!target) {\n\t throw 'Could not find target, did you pass an event, a HTMLElement or an Widget?';\n\t }\n\t hasTarget = target.hasAttribute(ATTR_NAME);\n\t targetContent = target.getAttribute(ATTR_NAME);\n\t widget = _Widget2.default.findWidget(target);\n\t if (target.hasAttribute(ATTR_CREATE_NEW) && !e.newInstance) {\n\t var newInstance = new Modal(this.container).setDestroyOnFinish(true);\n\t e.newInstance = true;\n\t newInstance.fromEvent(e).then(function () {\n\t newInstance.registerEvents(newInstance.getModalContainer());\n\t });\n\t return false;\n\t }\n\t if (hasTarget) {\n\t e.stopImmediatePropagation();\n\t e.preventDefault();\n\t }\n\t }\n\t\n\t if (!hasTarget) {\n\t return false;\n\t }\n\t\n\t var modalContainerClasses = this.modalContainer ? this.modalContainer.classList : [];\n\t\n\t // lazy create modal container\n\t if (!this.modalContainer) {\n\t this.modalContainer = global.document.createElement('div');\n\t this.modalContainer.className = CLS_MODAL_CONTAINER + ' ' + this.options.containerClassNames + ' ' + CLS_OPEN;\n\t var closeModalFunction = function closeModalFunction(ce) {\n\t if (self.loading) {\n\t return false;\n\t }\n\t if (_Util2.default.isPartOfNode(ce.target, self.currentOpen)) {\n\t if (!ce.target.hasAttribute(ATTR_CLOSE)) {\n\t return false;\n\t }\n\t }\n\t self.close(ce);\n\t };\n\t\n\t this.modalContainer.addEventListener(_Settings2.default.getTabEvent(), closeModalFunction, false);\n\t\n\t modalContainerClasses = this.modalContainer.classList;\n\t this.container.appendChild(this.modalContainer);\n\t } else {\n\t modalContainerClasses.add(CLS_OPEN);\n\t }\n\t\n\t var loader = void 0,\n\t doc = global.document,\n\t toggleLoader = function toggleLoader(show) {\n\t if (show) {\n\t loader = doc.createElement('div');\n\t loader.className = CLS_LOADER_CONTAINER;\n\t var loaderLoader = doc.createElement('div');\n\t loaderLoader.className = CLS_LOADER;\n\t loader.appendChild(loaderLoader);\n\t self.modalContainer.appendChild(loader);\n\t } else {\n\t loader.parentNode.removeChild(loader);\n\t }\n\t };\n\t\n\t this.handleScrollbar();\n\t\n\t modalContainerClasses.add(CLS_CONTAINER_CURRENT);\n\t modalContainerClasses.add('loading');\n\t this.loading = true;\n\t toggleLoader(true);\n\t var async = widget ? widget.getAsync() : null;\n\t if (_Widget2.default.isWidget(widget) && async) {\n\t future = async.then(function (r) {\n\t var result;\n\t if (r instanceof HTMLElement || r instanceof DocumentFragment) {\n\t result = r;\n\t } else {\n\t // Create container Element:\n\t var element = doc.createElement('div');\n\t element.className = self.options.classNames;\n\t element.innerHTML = r;\n\t element.id = _Util2.default.guid();\n\t result = element;\n\t }\n\t widget.finalContent = result;\n\t _Event2.default.dispatchAndFire(target, EVENT_MODAL_ASYNC_TARGET_LOADED);\n\t return result;\n\t });\n\t } else {\n\t var el = targetContent instanceof HTMLElement || targetContent instanceof DocumentFragment ? targetContent : doc.getElementById(targetContent);\n\t if (el) {\n\t future = new Promise(function (resolve) {\n\t resolve(el);\n\t });\n\t } else {\n\t throw 'Could not found given modal element (content) with ID: ' + targetContent;\n\t }\n\t }\n\t\n\t _Event2.default.dispatchAndFire(target, EVENT_MODAL_INIT);\n\t\n\t return future.then(function (thisEl) {\n\t thisEl.hfWidgetInstance = self;\n\t self.modalContainer.appendChild(thisEl);\n\t modalContainerClasses.remove('loading');\n\t self.loading = false;\n\t toggleLoader(false);\n\t\n\t self.open(thisEl, true, e);\n\t\n\t return thisEl;\n\t });\n\t }\n\t\n\t /**\n\t * Open's an already rendered modal\n\t * @param {HTMLElement} modal\n\t * @param {Boolean} [internal], set to true to prevent container management\n\t * @param {Boolean} [maybeEvent], optional event-object that triggered open\n\t */\n\t\n\t }, {\n\t key: 'open',\n\t value: function open(modal, internal, maybeEvent) {\n\t\n\t if (!internal) {\n\t this.modalContainer.classList.add('open');\n\t this.handleScrollbar();\n\t }\n\t this.switchModals(modal, this.currentOpen);\n\t\n\t _Event2.default.dispatch(modal, EVENT_MODAL_OPENED).withOriginal(maybeEvent).fire();\n\t }\n\t }, {\n\t key: 'registerEvents',\n\t value: function registerEvents(delegate) {\n\t var delegateContainer = delegate || this.container,\n\t self = this;\n\t // Modals should always be fixed\n\t _FixedWindow2.default.getInstance().addScreenConstraint(Modal, function (width) {\n\t return true;\n\t });\n\t // register modal instance so we can detect multiple registrars\n\t delegateContainer.flexModalInstance = self;\n\t self.eventFunction = function () {\n\t self.createWidget.apply(self, arguments);\n\t };\n\t delegateContainer.addEventListener(_Settings2.default.getTabEvent(), self.eventFunction, false);\n\t\n\t self.eventContainer = delegateContainer;\n\t return self;\n\t }\n\t\n\t /**\n\t * Creates a new Dialog Instance either directly from HTML Element or a Widget instance\n\t * @param {HTMLElement|Widget} widget instance or html element\n\t * @returns {Promise}\n\t */\n\t\n\t }, {\n\t key: 'fromWidget',\n\t value: function fromWidget(widget) {\n\t return this.createWidget(widget);\n\t }\n\t\n\t /**\n\t * Creates a Widget from event\n\t * @param e\n\t * @returns {Promise}\n\t */\n\t\n\t }, {\n\t key: 'fromEvent',\n\t value: function fromEvent(e) {\n\t return this.createWidget(e);\n\t }\n\t }, {\n\t key: 'setDestroyOnFinish',\n\t value: function setDestroyOnFinish(v) {\n\t this.destroyOnFinish = v;\n\t return this;\n\t }\n\t\n\t /**\n\t * Destroy this widget instance, cleans empty DOM nodes\n\t * Will use fast MutationObserver if available, otherwise falls back to DOMNodeRemoved event\n\t */\n\t\n\t }, {\n\t key: 'destroy',\n\t value: function destroy() {\n\t var self = this,\n\t modalContainer = this.modalContainer;\n\t var isEmptyContainer = modalContainer.childNodes.length === 0;\n\t // Remove event listener on destroy, do not remove DOM node\n\t if (self.eventContainer) {\n\t self.eventContainer.removeEventListener(_Settings2.default.getTabEvent(), self.eventFunction, true);\n\t }\n\t\n\t if (isEmptyContainer) {\n\t if (modalContainer.parentNode) {\n\t modalContainer.parentNode.removeChild(modalContainer);\n\t }\n\t }\n\t if (global.MutationObserver) {\n\t var observer = new MutationObserver(function (mutations) {\n\t mutations.forEach(function () {\n\t if (isEmptyContainer) {\n\t modalContainer.parentNode.removeChild(modalContainer);\n\t observer.disconnect();\n\t }\n\t });\n\t });\n\t observer.observe(modalContainer, { childList: true });\n\t } else {\n\t modalContainer.addEventListener('DOMNodeRemoved', function (e) {\n\t if (e.target !== modalContainer && modalContainer.childNodes.length - 1 === 0) {\n\t modalContainer.parentNode.removeChild(modalContainer);\n\t }\n\t });\n\t }\n\t }\n\t }]);\n\t\n\t return Modal;\n\t}();\n\t\n\t// Static variable that keeps track of all open modals\n\t\n\t\n\tModal._modalInstances = [];\n\t\n\t// Global keydown listener for modal\n\tglobal.addEventListener('keydown', function (e) {\n\t if (e.keyCode === KEY_ESC) {\n\t var lastModal = Modal._modalInstances[Modal._modalInstances.length - 1];\n\t if (lastModal) {\n\t _Widget2.default.findWidget(lastModal).close(e);\n\t }\n\t }\n\t});\n\t\n\texports.default = Modal;\n\t/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))\n\n/***/ },\n/* 9 */,\n/* 10 */\n/***/ function(module, exports) {\n\n\t\"use strict\";\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\texports.default = function (fn, ms) {\n\t return function () {\n\t clearTimeout(fn.timeout);\n\t fn.timeout = setTimeout(fn, ms);\n\t };\n\t};\n\n/***/ },\n/* 11 */,\n/* 12 */,\n/* 13 */,\n/* 14 */,\n/* 15 */,\n/* 16 */,\n/* 17 */,\n/* 18 */,\n/* 19 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _Modal = __webpack_require__(8);\n\t\n\tvar _Modal2 = _interopRequireDefault(_Modal);\n\t\n\tvar _Settings = __webpack_require__(2);\n\t\n\tvar _Settings2 = _interopRequireDefault(_Settings);\n\t\n\tvar _Widget = __webpack_require__(4);\n\t\n\tvar _Widget2 = _interopRequireDefault(_Widget);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\t// default export as component object\n\texports.default = {\n\t Modal: _Modal2.default,\n\t Settings: _Settings2.default,\n\t Widget: _Widget2.default\n\t};\n\n/***/ }\n/******/ ])\n});\n;\n\n\n/** WEBPACK FOOTER **\n ** js/modal.min.js\n **/"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"../\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n/** WEBPACK FOOTER **\n ** webpack/bootstrap 2abcfdab5a59a5cf6b3b\n **/","/*\n * The MIT License (MIT)\n *\n * Copyright (c) 2015 David Heidrich, BowlingX \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nconst PFX = [\"webkit\", \"moz\", \"MS\", \"o\", \"\"];\n\nconst COL_LEFT_CLASS = 'is-collision-left';\n\nconst COL_RIGHT_CLASS = 'is-collision-right';\n\nconst COL_BOTTOM_CLASS = 'is-collision-bottom';\n\n/**\n * Provides shared DOM-Utility functions\n */\nclass Util {\n\n /**\n * Will register the right animation event based on browser\n * @param element\n * @param type\n * @param callback\n */\n static prefixedAnimateEvent(element, type, callback) {\n const thisFunction = function thisFunction(e) {\n callback.apply(element, [e, thisFunction]);\n };\n\n for (let p = 0; p < PFX.length; p++) {\n let thisType = type;\n if (!PFX[p]) {\n thisType = type.toLowerCase();\n }\n const name = PFX[p] + thisType;\n element.addEventListener(name, thisFunction, true);\n }\n }\n\n /**\n * Get correct transitionend event\n * @returns {String}\n * @private\n */\n static whichTransitionEndEvent() {\n let t;\n const el = document.createElement('fake');\n\n const transitions = {\n transition: 'transitionend',\n OTransition: 'oTransitionEnd',\n MozTransition: 'transitionend',\n WebkitTransition: 'webkitTransitionEnd'\n };\n\n for (t in transitions) {\n if (el.style[t] !== undefined) {\n return transitions[t];\n }\n }\n }\n\n /**\n * Check if target is part of parent node\n * @param target\n * @param parent\n * @returns {boolean}\n */\n static isPartOfNode(target, parent) {\n if (!target || !parent) {\n return false;\n }\n let now = target;\n while (now !== parent && now !== null) {\n if (now === parent) {\n break;\n }\n now = now.parentNode;\n }\n return now !== null;\n }\n\n /**\n * Finds the closest element including itself matching a callback\n * @param {Node} el\n * @param {Function} callback\n * @returns {Node|boolean}\n */\n static closestCallback(el, callback) {\n let element = el;\n while (element !== null) {\n if (callback(element)) {\n return element;\n }\n element = element.parentNode;\n }\n return false;\n }\n\n /**\n * Walks the tree until func returns true for given argument\n * @param target\n * @param func\n * @returns {boolean|HTMLElement}\n */\n static parentsUntil(target, func) {\n if (!target) {\n return false;\n }\n let now = target;\n while (!func(now) && now !== null) {\n now = now.parentNode;\n }\n\n return now;\n }\n\n /**\n * Generates a unique id\n * @return {String}\n */\n static guid() {\n function s4() {\n return Math.floor((1 + Math.random()) * 0x10000)\n .toString(16)\n .substring(1);\n }\n\n return `${s4() + s4()}-${s4()}-${s4()}-${s4()}-${s4() + s4() + s4()}`;\n }\n\n /**\n * Detects scrollbar width\n * @see http://stackoverflow.com/questions/986937/how-can-i-get-the-browsers-scrollbar-sizes\n * @returns {number}\n */\n static getScrollBarWidth() {\n const doc = global.document;\n const inner = doc.createElement('p');\n\n inner.style.width = \"100%\";\n inner.style.height = \"200px\";\n\n const outer = doc.createElement('div');\n outer.style.position = \"absolute\";\n outer.style.top = \"0px\";\n outer.style.left = \"0px\";\n outer.style.visibility = \"hidden\";\n outer.style.width = \"200px\";\n outer.style.height = \"150px\";\n outer.style.overflow = \"hidden\";\n outer.appendChild(inner);\n\n doc.body.appendChild(outer);\n const w1 = inner.offsetWidth;\n outer.style.overflow = 'scroll';\n let w2 = inner.offsetWidth;\n if (w1 === w2) {\n w2 = outer.clientWidth;\n }\n doc.body.removeChild(outer);\n\n return (w1 - w2);\n }\n\n\n /**\n * Run an event once\n * @param {String} ev\n * @param {HTMLElement|HTMLDocument} target\n * @param {Function} func\n * @param {boolean} [capture]\n * @return Function created listener\n */\n static addEventOnce(ev, target, func, capture) {\n const thisFunction = function thisFunction(event) {\n func(event, func);\n target.removeEventListener(ev, thisFunction, capture);\n };\n target.addEventListener(ev, thisFunction, capture);\n return thisFunction;\n }\n\n /**\n * Checks if an element is visible\n * @param {HTMLElement} element\n * @returns bool\n */\n static isVisible(element) {\n return element.offsetWidth > 0 && element.offsetHeight > 0;\n }\n\n /**\n * Creates a camelCaseRepresentation of a dashed string\n * @param {String} str\n * @returns String\n */\n static dashToCamelCase(str) {\n return str.replace(/-([a-z])/g, (g) => {\n return g[1].toUpperCase();\n });\n }\n\n /**\n * Creates a copy of `input`\n * @param {*} input\n * @return *\n */\n static copy(input) {\n return JSON.parse(JSON.stringify(input));\n }\n\n /**\n * Reads options from element (data attributes) and applies to base\n * @param {HTMLElement} element\n * @param {Object} base\n * @return {Object}\n */\n static applyOptionsFromElement(element, base) {\n if (!element) {\n return base;\n }\n const attrs = element.attributes;\n for (let i = 0; i < attrs.length; i++) {\n const attr = attrs[i];\n if (attr) {\n const s = Util.dashToCamelCase(attr.nodeName.replace('data-', ''));\n const val = attr.nodeValue;\n if (base.hasOwnProperty(s)) {\n // skip functions\n if (typeof base[s] === 'function') {\n continue;\n }\n if (typeof base[s] === 'boolean') {\n base[s] = parseInt(val || 1, 10) === 1;\n } else {\n base[s] = val;\n }\n }\n }\n }\n return base;\n }\n\n /**\n * Will position an element directly at given target\n * Is aware of a given collision container to detect edges\n * Will put elementToPosition either to left, center or right edge (prefer right)\n * and either to bottom or top (prefers bottom)\n *\n * You may overwrite preferred positioned with `centerHorizontal` and `positionTop`\n *\n * @param {HTMLElement|ClientRect} target the target container to align to\n * @param {HTMLElement} elementToPosition the element to position\n * @param {HTMLElement} collisionContainer the outer container to prevent collisions\n * @param {boolean} [centerHorizontal] set true to center element, otherwise it's put on the right border by default\n * @param {boolean} [positionTop] flip top, by default element is positioned to the bottom.\n * @returns {HTMLElement}\n */\n static setupPositionNearby(target, elementToPosition, collisionContainer, centerHorizontal, positionTop) {\n // determine relative offsets\n let amountTop = 0;\n let amountLeft = 0;\n Util.parentsUntil(target.parentNode, (el) => {\n if (!(el instanceof HTMLElement)) {\n return false;\n }\n const style = window.getComputedStyle(el);\n if (Util.isPartOfNode(elementToPosition, el)) {\n if (style && style.position === 'relative') {\n amountTop += el.offsetTop || 0;\n amountLeft += el.offsetLeft || 0;\n }\n return false;\n }\n return true;\n });\n\n const targetPosition = target instanceof HTMLElement ? target.getBoundingClientRect() : target;\n const elementRect = elementToPosition.getBoundingClientRect();\n const colRect = collisionContainer.getBoundingClientRect();\n const targetTop = targetPosition.top - amountTop;\n const targetRight = targetPosition.right;\n const isCollisionTop = (targetTop - elementRect.height) <= 0;\n const isCollisionBottom =\n window.innerHeight < (targetTop + amountTop + targetPosition.height + elementRect.height);\n const isCollisionLeft = targetRight < elementRect.width;\n const targetLeft = targetPosition.left;\n const isCollisionRight = (targetLeft + elementRect.width) > colRect.width;\n const classList = elementToPosition.classList;\n\n classList.remove(COL_RIGHT_CLASS);\n classList.remove(COL_LEFT_CLASS);\n classList.remove(COL_BOTTOM_CLASS);\n\n let calcTop;\n let calcLeft;\n if (isCollisionLeft && !isCollisionRight) {\n // put element to left if collision with left\n calcLeft = `${(targetPosition.left - colRect.left - amountLeft)}px`;\n classList.add(COL_LEFT_CLASS);\n } else {\n // maybe center if no collision with either side\n const rightPosition = `${(targetRight - elementRect.width - colRect.left - amountLeft)}px`;\n const leftCentered = ((targetLeft + targetPosition.width / 2) -\n (elementRect.width / 2) || 0) - colRect.left;\n const collisionCentered = (leftCentered + elementRect.width) > colRect.width;\n if (centerHorizontal && !collisionCentered) {\n calcLeft = `${leftCentered}px`;\n } else {\n classList.add(COL_RIGHT_CLASS);\n calcLeft = rightPosition;\n }\n }\n\n if (isCollisionBottom || (positionTop && !isCollisionTop)) {\n // Put Element on top if collision\n calcTop = `${(targetTop - elementRect.height) - colRect.top}px`;\n classList.add(COL_BOTTOM_CLASS);\n } else {\n calcTop = `${(targetTop + targetPosition.height) - colRect.top}px`;\n }\n\n elementToPosition.style.cssText = `top:${calcTop};left:${calcLeft};`;\n\n return elementToPosition;\n }\n\n /**\n * Brings a given element into viewport\n * @param {HTMLElement} el\n * @param {int|function}[optionalOffset]\n */\n static scrollToElement(el, optionalOffset) {\n el.scrollIntoView();\n let thisOffset = optionalOffset;\n // optionally use a additional scrollDif\n if (thisOffset) {\n if (typeof thisOffset === 'function') {\n thisOffset = optionalOffset();\n }\n if (thisOffset > 0) {\n const scrolledY = window.pageYOffset;\n if (scrolledY) {\n window.scroll(0, scrolledY - thisOffset);\n }\n }\n }\n }\n}\n\nexport default Util;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/main/util/Util.js\n **/","/*\n * The MIT License (MIT)\n *\n * Copyright (c) 2015 David Heidrich, BowlingX \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\nimport Util from './Util';\n\n// we attach global settings to global once because settings might be shared a lot of times trough the application\n// Maybe find a better way to handle that scenario\nif (!global.FLEXCSS_GLOBAL_SETTINGS) {\n global.FLEXCSS_GLOBAL_SETTINGS = {\n // defined breakpoint for small devices < n\n smallBreakpoint: 768,\n // nodes that should be updated when no scrollbar is expected\n scrollbarUpdateNodes: global.document.body !== null ? [global.document.body] : [],\n // additional Delay until darkener is fully hidden\n darkenerFadeDelay: 100,\n // class that is added if canvas has been toggled\n canvasToggledClass: 'toggled-canvas'\n };\n\n global.FLEXCSS_CONST_IS_IOS = null;\n\n global.FLEXCSS_CONST_IS_TOUCH = null;\n\n global.FLEXCSS_CONST_IS_IE = null;\n\n global.FLEXCSS_CONST_TAB_EVENT = 'click';\n\n global.FLEXCSS_IS_SMALL_SCREEN = false;\n\n const init = () => {\n // Measure scrollbar width\n global.FLEXCSS_CONST_SCROLLBAR_WIDTH = Util.getScrollBarWidth();\n // detect right transition end event\n global.FLEXCSS_CONST_TRANSITION_EVENT = Util.whichTransitionEndEvent();\n };\n\n if (global.document.readyState !== 'loading') {\n init();\n } else {\n // it's possible that global.document.body is not available if the document is not\n // loaded completely\n document.addEventListener('DOMContentLoaded', () => {\n init();\n });\n }\n}\n\n/**\n * Utility class that setups global settings\n */\nclass Settings {\n\n /**\n * Setup global settings, overwrite default values\n * @param {Object} settings\n */\n static setup(settings) {\n Object.assign(global.FLEXCSS_GLOBAL_SETTINGS, settings);\n }\n\n /**\n * Access to global settings\n * @returns {Object}\n */\n static get() {\n return global.FLEXCSS_GLOBAL_SETTINGS;\n }\n\n /**\n * Detects a IOS Device, caches subsequent calls\n * @returns {boolean}\n */\n static isIosDevice() {\n if (!global.FLEXCSS_CONST_IS_IOS) {\n global.FLEXCSS_CONST_IS_IOS = global.navigator.userAgent.match(/(iPad|iPhone|iPod)/i);\n }\n\n return global.FLEXCSS_CONST_IS_IOS;\n }\n\n /**\n * @returns {boolean}\n */\n static isSmallScreen() {\n return window.innerWidth < Settings.get().smallBreakpoint;\n }\n\n /**\n * Detects a touch device, caches subsequent calls\n * @returns {boolean}\n */\n static isTouchDevice() {\n if (!global.FLEXCSS_CONST_IS_TOUCH) {\n global.FLEXCSS_CONST_IS_TOUCH = 'ontouchstart' in window || !!(global.navigator.msMaxTouchPoints);\n }\n return global.FLEXCSS_CONST_IS_TOUCH;\n }\n\n /**\n * Checks if current browser is Internet Explorer\n * @returns {boolean|*}\n */\n static isIE() {\n if (!global.FLEXCSS_CONST_IS_IE) {\n global.FLEXCSS_CONST_IS_IE = \"ActiveXObject\" in window;\n }\n return global.FLEXCSS_CONST_IS_IE;\n }\n\n /**\n * @returns {String}\n */\n static getTransitionEvent() {\n return global.FLEXCSS_CONST_TRANSITION_EVENT;\n }\n\n /**\n * @returns {int}\n */\n static getScrollbarWidth() {\n return global.FLEXCSS_CONST_SCROLLBAR_WIDTH;\n }\n\n /**\n * @returns {String}\n */\n static getTabEvent() {\n return global.FLEXCSS_CONST_TAB_EVENT;\n }\n}\n\nexport default Settings;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/main/util/Settings.js\n **/","/* global CustomEvent */\n\n/*\n * The MIT License (MIT)\n *\n * Copyright (c) 2015 David Heidrich, BowlingX \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n// polyfill for custom events to make thinks work in IE\n// The needed polyfill is so small that I embedded it here\n(function poly() {\n if (!global.CustomEvent || typeof global.CustomEvent !== 'function') {\n const CustomEvent = function CustomEvent(event, params) {\n const thisParams = params ||\n {\n bubbles: false,\n cancelable: false,\n detail: undefined\n };\n const evt = document.createEvent(\"CustomEvent\");\n evt.initCustomEvent(event, thisParams.bubbles,\n thisParams.cancelable, thisParams.detail);\n return evt;\n };\n CustomEvent.prototype = global.Event.prototype;\n global.CustomEvent = CustomEvent;\n }\n})();\n/**\n * Simpler Event dispatching\n */\nclass EventHandler {\n\n /**\n * @param {HTMLElement} target\n * @param {String} name\n */\n constructor(target, name) {\n this.target = target;\n this.defaultOptions = {\n bubbles: true,\n cancelable: true\n };\n\n this.name = name;\n }\n\n /**\n * Set more options\n * @param {Object} options\n * @returns {EventHandler}\n */\n withOptions(options) {\n Object.assign(this.defaultOptions, (options || {}));\n return this;\n }\n\n /**\n * Call with the originalEvent\n * @param {Event} e\n * @returns {EventHandler}\n */\n withOriginal(e) {\n return this.withDetail({\n originalEvent: e\n });\n }\n\n /**\n * Extends the detail part of the event\n * @param {Object} o\n * @returns {EventHandler}\n */\n withDetail(o) {\n if (!this.defaultOptions.detail) {\n this.defaultOptions.detail = {};\n }\n Object.assign(this.defaultOptions.detail, o);\n return this;\n }\n\n /**\n * @returns {CustomEvent}\n */\n fire() {\n const e = new CustomEvent(this.name, this.defaultOptions);\n if (this.target) {\n this.target.dispatchEvent(e);\n }\n return e;\n }\n}\n\nclass Event {\n /**\n * Prepares to dispatch a custom event (without firing)\n * @param {HTMLElement} target\n * @param {String} name\n * @returns {EventHandler}\n */\n static dispatch(target, name) {\n return new EventHandler(target, name);\n }\n\n /**\n * Dispatches a custom event and fires it directly\n * @param {HTMLElement} target\n * @param {String} name\n * @param {Object} [options]\n * @returns {CustomEvent}\n */\n static dispatchAndFire(target, name, options) {\n return new EventHandler(target, name).withOptions(options).fire();\n }\n}\n\nexport default Event;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/main/util/Event.js\n **/","/*\n * The MIT License (MIT)\n *\n * Copyright (c) 2015 David Heidrich, BowlingX \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n/*!\n * FlexCss.Widget\n * Licensed under the MIT License (MIT)\n * Copyright (c) 2015 David Heidrich, BowlingX \n */\n\n/**\n * A Widget provides async content on a specific target (e.g. a modal link)\n */\nclass Widget {\n\n /**\n * Creates a new Widget\n * @param [element], optional define the content of widget\n */\n constructor(element) {\n /**\n *\n * @type {Promise}\n */\n this.asyncContent = null;\n\n /**\n * @type {boolean}\n */\n this._isWidget = true;\n\n if (element) {\n /**\n * @type {HTMLElement}\n */\n this.element = element instanceof HTMLElement ? element : global.document.getElementById(element);\n if (this.element) {\n this.element.hfWidgetInstance = this;\n this.setAsync(() => {\n return new Promise((s) => {\n s(this.element);\n });\n });\n } else {\n throw new Error(`Could not found element with ID: ${element}`);\n }\n }\n /**\n * The final resulted content that a widget did create (e.g. a modal container)\n * @type {HTMLElement}\n */\n this.finalContent = null;\n }\n\n /**\n *\n * @returns {Promise}\n */\n getAsync() {\n return this.asyncContent();\n }\n\n /**\n * @param {Function.} async\n * @returns {Widget}\n */\n setAsync(async) {\n this.asyncContent = async;\n return this;\n }\n\n /**\n * @returns {HTMLElement}\n */\n getFinalContent() {\n return this.finalContent;\n }\n\n /**\n * @param {HTMLElement} element\n * @returns {Widget}\n */\n setElement(element) {\n this.element = element;\n return this;\n }\n\n /**\n * Destroys the generated content of this widget\n * @returns {boolean}\n */\n destroy() {\n if (this.finalContent && this.finalContent.parentNode) {\n this.finalContent.parentNode.removeChild(this.finalContent);\n return true;\n }\n\n delete this.element;\n delete this.asyncContent;\n delete this.finalContent;\n\n return false;\n }\n\n /**\n * Will find a widget on an Element\n * @param {HTMLElement} element\n * @returns {Widget|undefined}\n */\n static findWidget(element) {\n return element ? element.hfWidgetInstance : undefined;\n }\n\n /**\n * Checks if a given object is an instance\n * @param {Object} self\n * @returns {boolean}\n */\n static isWidget(self) {\n return self instanceof Widget || typeof self === 'object' && self.hasOwnProperty('_isWidget');\n }\n}\n\nexport default Widget;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/main/Widget.js\n **/","import Settings from '../util/Settings';\nimport debounce from './debounce';\nimport Event from '../util/Event';\nimport Util from '../util/Util';\n\nconst CLS_FIXED_WINDOW = 'fixed-window-open';\n\nexport const EVENT_BEFORE_FIXED_ADD = 'flexcss.fixedWindow.beforeAdd';\nexport const EVENT_AFTER_FIXED_REMOVE = 'flexcss.fixedWindow.afterRemove';\n\n/**\n * @type {FixedWindow}\n */\nlet fixedWindowInstance;\n\nexport default class FixedWindow {\n\n constructor() {\n this.widgets = [];\n this.currentScrollTop = 0;\n this.fixedScreenConstraints = [];\n this.windowWidth = 0;\n this.isFixedWindowActive = false;\n this.touchListener = null;\n }\n\n /**\n * Adds a constraint to detect if the window needs to be changed when the screensize changes\n *\n * @param {Function} widget\n * @param {Function} fixedBreakpointFn gets a width argument, return true to open a window\n */\n addScreenConstraint(widget, fixedBreakpointFn) {\n this.fixedScreenConstraints[widget] = fixedBreakpointFn;\n }\n\n /**\n * @returns {null|DestroyableWidget}\n */\n getCurrentWidget() {\n return this.widgets.length > 0 ? this.widgets[this.widgets.length - 1] : null;\n }\n\n /**\n * @private\n */\n _checkFixedNeeded() {\n if (this.widgets.length === 0) {\n return;\n }\n const widgets = new Set(this.widgets);\n const widgetsThatRequireFixedWindow = Array.from(widgets).some(({ widget }) => {\n return this.fixedScreenConstraints[widget] && this.fixedScreenConstraints[widget](this.windowWidth);\n });\n if (!widgetsThatRequireFixedWindow) {\n this._removeFixedContainer();\n } else {\n this._addFixedContainer();\n }\n }\n\n /**\n * @private\n */\n _addFixedContainer() {\n if (this.isFixedWindowActive) {\n return;\n }\n Event.dispatchAndFire(global.document, EVENT_BEFORE_FIXED_ADD, {\n detail: this.getCurrentWidget()\n });\n // this causes layout and should be optimized\n // At lest we write in a batch later\n Settings.get().scrollbarUpdateNodes.map((n) => {\n let foundProperty = 'paddingRight';\n let direction = 1;\n let node = n;\n if (n instanceof Array) {\n const [whatNode, property, d] = n;\n foundProperty = property;\n node = whatNode;\n direction = d || 1;\n }\n return {\n node,\n property: foundProperty,\n value: `${parseInt(global.getComputedStyle(node)[foundProperty], 10) +\n (!node.__fixedWindowMod__ ? (Settings.getScrollbarWidth() * direction) : 0)}px`\n };\n }).forEach((d) => {\n d.node.__fixedWindowMod__ = true;\n d.node.style[d.property] = d.value;\n });\n\n this.touchListener = (e) => {\n e.preventDefault();\n };\n\n let shouldNotMove = false;\n this.touchStartListener = (e) => {\n const { element } = this.getCurrentWidget();\n if (Util.isPartOfNode(e.target, element)) {\n if (element.scrollTop === 0) {\n element.scrollTop = 1;\n shouldNotMove = true;\n } else if (element.scrollHeight === element.scrollTop + element.offsetHeight) {\n shouldNotMove = true;\n element.scrollTop -= 1;\n }\n }\n };\n\n global.addEventListener('touchmove', this.touchListener);\n global.document.body.addEventListener('touchstart', this.touchStartListener);\n\n this.touchMoveListener = (e) => {\n const { element } = this.getCurrentWidget();\n if (Util.isPartOfNode(e.target, element)) {\n if (!shouldNotMove) {\n e.stopImmediatePropagation();\n }\n shouldNotMove = false;\n }\n };\n global.document.body.addEventListener('touchmove', this.touchMoveListener);\n\n global.document.documentElement.classList.add(CLS_FIXED_WINDOW);\n this.isFixedWindowActive = true;\n }\n\n /**\n * @private\n */\n _removeFixedContainer() {\n if (this.isFixedWindowActive) {\n // cleanup event listeners\n global.removeEventListener('touchmove', this.touchListener);\n global.document.body.removeEventListener('touchstart', this.touchStartListener);\n global.document.body.removeEventListener('touchmove', this.touchMoveListener);\n\n // reset scrollbar nodes\n Settings.get().scrollbarUpdateNodes.forEach((node) => {\n if (node instanceof Array) {\n const [whatNode, property] = node;\n delete whatNode.__fixedWindowMod__;\n whatNode.style[property] = '';\n } else {\n delete node.__fixedWindowMod__;\n node.style.paddingRight = '';\n }\n });\n global.document.documentElement.classList.remove(CLS_FIXED_WINDOW);\n Event.dispatchAndFire(global.document, EVENT_AFTER_FIXED_REMOVE);\n this.isFixedWindowActive = false;\n }\n }\n\n /**\n * Will close a window when no widgets are opened that need one\n */\n resizeListener() {\n this.windowWidth = global.innerWidth;\n this._checkFixedNeeded();\n }\n\n /**\n * @returns {FixedWindow}\n */\n static getInstance() {\n if (!fixedWindowInstance) {\n fixedWindowInstance = new FixedWindow();\n fixedWindowInstance.windowWidth = global.innerWidth;\n const eventHandler = fixedWindowInstance.resizeListener.bind(fixedWindowInstance);\n global.addEventListener(\n 'resize',\n debounce(eventHandler, 500)\n );\n global.addEventListener('orientationchange', eventHandler);\n }\n return fixedWindowInstance;\n }\n\n /**\n * Request a close of the fixed window\n */\n close() {\n this.widgets.pop();\n if (this.widgets.length === 0) {\n this._removeFixedContainer();\n resolve();\n }\n }\n\n /**\n * Request to open a fixed windows\n * @param {Object|DestroyableWidget} instance\n * @param {HTMLElement} element\n */\n open(instance, element) {\n let fixed = false;\n if (typeof instance === 'object') {\n const widget = instance.constructor;\n const fixedWidget = this.fixedScreenConstraints[instance.constructor];\n if (widget && fixedWidget) {\n fixed = fixedWidget(this.windowWidth);\n }\n const length = this.widgets.length;\n this.widgets.push(\n {\n widget,\n element\n }\n );\n // open a new window if there is no window active\n if (length === 0) {\n if (fixed) {\n this._addFixedContainer();\n }\n }\n }\n }\n}\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/main/lib/FixedWindow.js\n **/","/*\n * The MIT License (MIT)\n *\n * Copyright (c) 2015 David Heidrich, BowlingX \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n/*!\n * FlexCss.Modal\n * Licensed under the MIT License (MIT)\n * Copyright (c) 2015 David Heidrich, BowlingX \n */\n\n/* global KeyboardEvent */\n\nimport Settings from './util/Settings';\nimport Event from './util/Event';\nimport Util from './util/Util';\nimport Widget from './Widget';\nimport FixedWindow from './lib/FixedWindow';\n\nconst HTML_ELEMENT = global.document.documentElement;\nconst KEY_ESC = 27;\n/* Attribute Names */\nconst ATTR_CREATE_NEW = 'data-new-instance';\nconst ATTR_CLOSE = 'data-close-modal';\nconst ATTR_NAME = 'data-modal';\n\n/* Class names */\nconst CLS_CONTAINER_CURRENT = 'front';\nconst CLS_OPEN = 'open';\nconst CLS_CURRENT = 'current';\nconst CLS_PART_OF_STACK = 'part-of-stack';\nconst CLS_MODAL_OPEN = 'modal-open';\nconst CLS_MODAL_CONTAINER = 'modal-container';\nconst CLS_ANIM_END = 'modal-anim-end';\nconst CLS_LOADER_CONTAINER = 'loader-container';\nconst CLS_LOADER = 'loader';\n\n/* Events */\n\n/**\n * Event triggered when modal is closed\n * @type {string}\n */\nexport const EVENT_MODAL_CLOSED = 'flexcss.modal.closed';\n/**\n * Event triggered before a modal is closed, cancelable\n * @type {string}\n */\nexport const EVENT_MODAL_BEFORE_CLOSED = 'flexcss.modal.beforeClose';\n/**\n * Event triggered when a modal is opened\n * @type {string}\n */\nexport const EVENT_MODAL_OPENED = 'flexcss.modal.opened';\n\n/**\n * Event triggered when modal is initilized, called on target\n * @type {string}\n */\nexport const EVENT_MODAL_INIT = 'flexcss.modal.init';\n\n/**\n * Triggered when the content of an async modal on a target is loaded, called on target\n * @type {string}\n */\nexport const EVENT_MODAL_ASYNC_TARGET_LOADED = 'flexcss.modal.asyncTargetLoaded';\n\n/**\n * A Modal Implementation\n */\nclass Modal {\n constructor(DelegateContainer, options) {\n const doc = global.document;\n const container = DelegateContainer instanceof HTMLElement ?\n DelegateContainer : doc.getElementById(DelegateContainer);\n\n // Instance vars:\n if (!container) {\n throw new Error(`Could not found container element by given ID/Element: ${DelegateContainer}`);\n }\n\n this.currentOpen = null;\n\n this.loading = false;\n\n this.container = container;\n\n /**\n * Default Options\n */\n this.options = {\n classNames: 'modal',\n closeOnEscape: true,\n closeOnBackgroundClick: true,\n destroyOnFinish: false,\n fixedContainer: true,\n containerClassNames: ''\n };\n\n Object.assign(this.options, options);\n\n // Container where events are delegated\n this.eventContainer = null;\n this.eventFunction = null;\n\n this.dataMainPageContainer = global.document.body;\n\n this.currentScrollTop = 0;\n\n this.modalContainer = null;\n\n // Destroy full modal instance when no dialogs are bind to?\n // Otherwise container is recycled\n this.destroyOnFinish = this.options.destroyOnFinish;\n }\n\n /**\n * Removes this modal from global stack\n * Will handle fixing main html element too\n * @private\n * @param n\n */\n _removeModalFromStack(n) {\n const t = Modal._modalInstances.indexOf(n);\n if (t > -1) {\n Modal._modalInstances.splice(t, 1);\n FixedWindow.getInstance().close();\n HTML_ELEMENT.classList.remove(CLS_MODAL_OPEN);\n }\n }\n\n\n /**\n * Modal container that contains all `stacked` modals for this instance\n * @returns {HTMLElement}\n */\n getModalContainer() {\n return this.modalContainer;\n }\n\n /**\n * Closes the current open modal of this stack\n * @params [e], optional event\n * @returns {*}\n */\n close(e) {\n const self = this;\n\n const options = self.currentOpen ? Util.applyOptionsFromElement(\n self.currentOpen, Util.copy(self.options)) : self.options;\n\n // close only on keyboard if instance should\n if (!options.closeOnEscape && e instanceof KeyboardEvent) {\n return false;\n }\n\n // close only on background if instance should\n if (!options.closeOnBackgroundClick && e &&\n e.type === Settings.getTabEvent() && !e.target.hasAttribute(ATTR_CLOSE)) {\n return false;\n }\n\n // if an instance is currently loading, prevent from closing\n if (self.loading) {\n return false;\n }\n\n if (e) {\n e.preventDefault();\n }\n\n if (self.currentOpen) {\n // dispatch beforeClose event, if prevented prevent modal from closing\n var ev = Event.dispatchAndFire(self.currentOpen, EVENT_MODAL_BEFORE_CLOSED);\n if (ev.defaultPrevented) {\n return false;\n }\n\n this._finishState(self.currentOpen);\n // if there is an previous modal\n if (self.currentOpen.prevModal) {\n // switch to the next modal\n return self.switchModals(self.currentOpen.prevModal,\n self.currentOpen.prevModal.prevModal || null);\n }\n\n // finally trigger closed event\n Event.dispatch(self.currentOpen, EVENT_MODAL_CLOSED).withOriginal(e).fire();\n\n }\n self._removeModalFromStack(self.currentOpen);\n\n // Full stack closed:\n self.currentOpen = null;\n if (self.modalContainer) {\n // setup next open\n var lastContainer = Modal._modalInstances[Modal._modalInstances.length - 1],\n classList = self.modalContainer.classList;\n classList.remove(CLS_CONTAINER_CURRENT);\n classList.remove(CLS_OPEN);\n // Remove all current classes from child-nodes\n for (var i = 0; i < self.modalContainer.childNodes.length; i++) {\n var node = self.modalContainer.childNodes[i], cl = node.classList;\n // remove applied styles\n self._finishState(node);\n cl.remove(CLS_CURRENT);\n cl.remove(CLS_PART_OF_STACK);\n }\n if (lastContainer) {\n lastContainer.parentNode.classList.add(CLS_CONTAINER_CURRENT);\n }\n }\n\n if (self.destroyOnFinish) {\n self.destroy();\n }\n return self;\n }\n\n /**\n * Resets a target when newly initilizes\n * @param target\n * @private\n */\n _finishState(target) {\n target.classList.remove(CLS_ANIM_END);\n }\n\n /**\n * Handler called when a Modal has finished an animation\n * @param e\n * @param self\n * @private\n */\n _finishAnim(e, self) {\n e.target.classList.add(CLS_ANIM_END);\n e.target.removeEventListener(e.type, self, true);\n }\n\n /**\n * Brings the given modal to front\n * @param co\n * @param last\n */\n switchModals(co, last) {\n co.prevModal = last;\n Modal._modalInstances.push(co);\n FixedWindow.getInstance().open(this, this.modalContainer);\n if (last) {\n this._finishState(last);\n Util.prefixedAnimateEvent(last, 'AnimationEnd', this._finishAnim);\n last.classList.add(CLS_PART_OF_STACK);\n }\n // set new currentOpen\n this.currentOpen = co;\n\n // bring current container to the front\n var instances = Modal._modalInstances;\n\n for (var m = 0; m < instances.length; m++) {\n instances[m].parentNode.classList.remove(CLS_CONTAINER_CURRENT);\n }\n this.modalContainer.classList.add(CLS_CONTAINER_CURRENT);\n // remove animations if animations has been completed, fixes various bugs:\n // - fixes nested scrolling element issue in iOS Browsers / Mobile-Safari\n Util.prefixedAnimateEvent(co, 'AnimationEnd', this._finishAnim);\n\n for (var i = 0; i < this.modalContainer.childNodes.length; i++) {\n var n = this.modalContainer.childNodes[i], isCurrent = n.classList.contains(CLS_CURRENT);\n if (n === co) {\n co.classList.add(CLS_CURRENT);\n co.classList.remove(CLS_PART_OF_STACK);\n this._finishState(co);\n } else {\n n.classList.remove(CLS_CURRENT);\n if (isCurrent) {\n this._removeModalFromStack(n);\n Event.dispatchAndFire(n, EVENT_MODAL_CLOSED);\n }\n }\n }\n }\n\n handleScrollbar() {\n if (Modal._modalInstances.length === 0) {\n HTML_ELEMENT.classList.add(CLS_MODAL_OPEN);\n }\n }\n\n /**\n * Creates a Modal and opens it (later)\n * @param e\n * @returns {Promise|boolean}\n */\n createWidget(e) {\n var self = this;\n if (this.loading) {\n return false;\n }\n\n // check if another modal has registered events on this dom path:\n if (e && e.target) {\n var foundInstance = Util.parentsUntil(e.target, function (node) {\n return node && node.flexModalInstance;\n });\n\n // if another instance has been found, abort\n if (foundInstance !== this.container) {\n return false;\n }\n }\n var targetContent, future, widget, target, hasTarget = true,\n isHtmlElement = e instanceof HTMLElement, isWidget = Widget.isWidget(e);\n if (isHtmlElement || isWidget) {\n if (isHtmlElement) {\n targetContent = e;\n } else {\n widget = e;\n targetContent = widget.element;\n }\n } else {\n target = e.target;\n if (!target) {\n throw 'Could not find target, did you pass an event, a HTMLElement or an Widget?';\n }\n hasTarget = target.hasAttribute(ATTR_NAME);\n targetContent = target.getAttribute(ATTR_NAME);\n widget = Widget.findWidget(target);\n if (target.hasAttribute(ATTR_CREATE_NEW) && !e.newInstance) {\n var newInstance = new Modal(this.container)\n .setDestroyOnFinish(true);\n e.newInstance = true;\n newInstance.fromEvent(e).then(function () {\n newInstance.registerEvents(newInstance.getModalContainer());\n });\n return false;\n }\n if (hasTarget) {\n e.stopImmediatePropagation();\n e.preventDefault();\n }\n }\n\n if (!hasTarget) {\n return false;\n }\n\n let modalContainerClasses = this.modalContainer ? this.modalContainer.classList : [];\n\n // lazy create modal container\n if (!this.modalContainer) {\n this.modalContainer = global.document.createElement('div');\n this.modalContainer.className = `${CLS_MODAL_CONTAINER} ${this.options.containerClassNames} ${CLS_OPEN}`;\n const closeModalFunction = function (ce) {\n if (self.loading) {\n return false;\n }\n if (Util.isPartOfNode(ce.target, self.currentOpen)) {\n if (!ce.target.hasAttribute(ATTR_CLOSE)) {\n return false;\n }\n }\n self.close(ce);\n };\n\n this.modalContainer.addEventListener(Settings.getTabEvent(), closeModalFunction, false);\n\n modalContainerClasses = this.modalContainer.classList;\n this.container.appendChild(this.modalContainer);\n\n } else {\n modalContainerClasses.add(CLS_OPEN);\n }\n\n let loader, doc = global.document, toggleLoader = function (show) {\n if (show) {\n loader = doc.createElement('div');\n loader.className = CLS_LOADER_CONTAINER;\n var loaderLoader = doc.createElement('div');\n loaderLoader.className = CLS_LOADER;\n loader.appendChild(loaderLoader);\n self.modalContainer.appendChild(loader);\n } else {\n loader.parentNode.removeChild(loader);\n }\n };\n\n this.handleScrollbar();\n\n modalContainerClasses.add(CLS_CONTAINER_CURRENT);\n modalContainerClasses.add('loading');\n this.loading = true;\n toggleLoader(true);\n var async = widget ? widget.getAsync() : null;\n if (Widget.isWidget(widget) && async) {\n future = async.then(function (r) {\n var result;\n if (r instanceof HTMLElement || r instanceof DocumentFragment) {\n result = r;\n } else {\n // Create container Element:\n var element = doc.createElement('div');\n element.className = self.options.classNames;\n element.innerHTML = r;\n element.id = Util.guid();\n result = element;\n }\n widget.finalContent = result;\n Event.dispatchAndFire(target, EVENT_MODAL_ASYNC_TARGET_LOADED);\n return result;\n });\n } else {\n var el = targetContent instanceof HTMLElement ||\n targetContent instanceof DocumentFragment ? targetContent : doc.getElementById(targetContent);\n if (el) {\n future = new Promise((resolve) => {\n resolve(el);\n });\n } else {\n throw 'Could not found given modal element (content) with ID: ' + targetContent;\n }\n }\n\n Event.dispatchAndFire(target, EVENT_MODAL_INIT);\n\n return future.then((thisEl) => {\n thisEl.hfWidgetInstance = self;\n self.modalContainer.appendChild(thisEl);\n modalContainerClasses.remove('loading');\n self.loading = false;\n toggleLoader(false);\n\n self.open(thisEl, true, e);\n\n return thisEl;\n });\n }\n\n /**\n * Open's an already rendered modal\n * @param {HTMLElement} modal\n * @param {Boolean} [internal], set to true to prevent container management\n * @param {Boolean} [maybeEvent], optional event-object that triggered open\n */\n open(modal, internal, maybeEvent) {\n\n\n if (!internal) {\n this.modalContainer.classList.add('open');\n this.handleScrollbar();\n }\n this.switchModals(modal, this.currentOpen);\n\n Event.dispatch(modal, EVENT_MODAL_OPENED).withOriginal(maybeEvent).fire();\n }\n\n\n registerEvents(delegate) {\n var delegateContainer = delegate || this.container, self = this;\n // Modals should always be fixed\n FixedWindow.getInstance().addScreenConstraint(Modal, (width) => true);\n // register modal instance so we can detect multiple registrars\n delegateContainer.flexModalInstance = self;\n self.eventFunction = function () {\n self.createWidget.apply(self, arguments);\n };\n delegateContainer.addEventListener(Settings.getTabEvent(), self.eventFunction, false);\n\n self.eventContainer = delegateContainer;\n return self;\n }\n\n\n /**\n * Creates a new Dialog Instance either directly from HTML Element or a Widget instance\n * @param {HTMLElement|Widget} widget instance or html element\n * @returns {Promise}\n */\n fromWidget(widget) {\n return this.createWidget(widget);\n }\n\n /**\n * Creates a Widget from event\n * @param e\n * @returns {Promise}\n */\n fromEvent(e) {\n return this.createWidget(e);\n }\n\n setDestroyOnFinish(v) {\n this.destroyOnFinish = v;\n return this;\n }\n\n /**\n * Destroy this widget instance, cleans empty DOM nodes\n * Will use fast MutationObserver if available, otherwise falls back to DOMNodeRemoved event\n */\n destroy() {\n let self = this, modalContainer = this.modalContainer;\n const isEmptyContainer = modalContainer.childNodes.length === 0;\n // Remove event listener on destroy, do not remove DOM node\n if (self.eventContainer) {\n self.eventContainer.removeEventListener(Settings.getTabEvent(), self.eventFunction, true);\n }\n\n if (isEmptyContainer) {\n if (modalContainer.parentNode) {\n modalContainer.parentNode.removeChild(modalContainer);\n }\n }\n if (global.MutationObserver) {\n var observer = new MutationObserver(function (mutations) {\n mutations.forEach(function () {\n if (isEmptyContainer) {\n modalContainer.parentNode.removeChild(modalContainer);\n observer.disconnect();\n }\n });\n });\n observer.observe(modalContainer, {childList: true});\n } else {\n modalContainer.addEventListener('DOMNodeRemoved', function (e) {\n if (e.target !== modalContainer && (modalContainer.childNodes.length - 1) === 0) {\n modalContainer.parentNode.removeChild(modalContainer);\n }\n });\n }\n }\n}\n\n\n// Static variable that keeps track of all open modals\nModal._modalInstances = [];\n\n// Global keydown listener for modal\nglobal.addEventListener('keydown', function (e) {\n if (e.keyCode === KEY_ESC) {\n var lastModal = Modal._modalInstances[Modal._modalInstances.length - 1];\n if (lastModal) {\n Widget.findWidget(lastModal).close(e);\n }\n }\n});\n\nexport default Modal;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/main/Modal.js\n **/","export default (fn, ms) => () => {\n clearTimeout(fn.timeout);\n fn.timeout = setTimeout(fn, ms);\n};\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/main/lib/debounce.js\n **/","'use strict';\n\nimport Modal from '../Modal';\nimport Settings from '../util/Settings';\nimport Widget from '../Widget';\n\n// default export as component object\nexport default {\n Modal,\n Settings,\n Widget\n};\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/main/modules/Modal.js\n **/"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack:///webpack/universalModuleDefinition?5ca6*","webpack:///js/modal.min.js","webpack:///webpack/bootstrap a32af781d3d6caa30484?a65b*","webpack:///./src/main/util/Util.js?5bc4*","webpack:///./src/main/util/Settings.js?b01f*","webpack:///./src/main/util/Event.js?68bf*","webpack:///./src/main/Widget.js?920e","webpack:///./src/main/lib/FixedWindow.js?6376","webpack:///./src/main/Modal.js?a8d4","webpack:///./src/main/lib/debounce.js?3601","webpack:///./src/main/modules/Modal.js"],"names":["root","factory","exports","module","define","amd","this","modules","__webpack_require__","moduleId","installedModules","id","loaded","call","m","c","p","global","_classCallCheck","instance","Constructor","TypeError","Object","defineProperty","value","_createClass","defineProperties","target","props","i","length","descriptor","enumerable","configurable","writable","key","protoProps","staticProps","prototype","PFX","COL_LEFT_CLASS","COL_RIGHT_CLASS","COL_BOTTOM_CLASS","Util","element","type","callback","thisFunction","e","apply","thisType","toLowerCase","name","addEventListener","t","el","document","createElement","transitions","transition","OTransition","MozTransition","WebkitTransition","undefined","style","parent","now","parentNode","func","s4","Math","floor","random","toString","substring","doc","inner","width","height","outer","position","top","left","visibility","overflow","appendChild","body","w1","offsetWidth","w2","clientWidth","removeChild","ev","capture","event","removeEventListener","offsetHeight","str","replace","g","toUpperCase","input","JSON","parse","stringify","base","attrs","attributes","attr","s","dashToCamelCase","nodeName","val","nodeValue","hasOwnProperty","parseInt","elementToPosition","collisionContainer","centerHorizontal","positionTop","amountTop","amountLeft","parentsUntil","HTMLElement","window","getComputedStyle","isPartOfNode","offsetTop","offsetLeft","targetPosition","getBoundingClientRect","elementRect","colRect","targetTop","targetRight","right","isCollisionTop","isCollisionBottom","innerHeight","isCollisionLeft","targetLeft","isCollisionRight","classList","remove","calcTop","calcLeft","add","rightPosition","leftCentered","collisionCentered","cssText","optionalOffset","scrollIntoView","thisOffset","scrolledY","pageYOffset","scroll","_interopRequireDefault","obj","__esModule","default","_Util","_Util2","FLEXCSS_GLOBAL_SETTINGS","smallBreakpoint","scrollbarUpdateNodes","darkenerFadeDelay","canvasToggledClass","FLEXCSS_CONST_IS_IOS","FLEXCSS_CONST_IS_TOUCH","FLEXCSS_CONST_IS_IE","FLEXCSS_CONST_TAB_EVENT","FLEXCSS_IS_SMALL_SCREEN","init","FLEXCSS_CONST_SCROLLBAR_WIDTH","getScrollBarWidth","FLEXCSS_CONST_TRANSITION_EVENT","whichTransitionEndEvent","readyState","Settings","settings","assign","navigator","userAgent","match","innerWidth","get","msMaxTouchPoints","CustomEvent","_CustomEvent","params","thisParams","bubbles","cancelable","detail","evt","createEvent","initCustomEvent","Event","EventHandler","defaultOptions","options","withDetail","originalEvent","o","dispatchEvent","withOptions","fire","_typeof","Symbol","iterator","constructor","Widget","_this","asyncContent","_isWidget","getElementById","Error","hfWidgetInstance","setAsync","Promise","finalContent","async","self","EVENT_AFTER_FIXED_REMOVE","EVENT_BEFORE_FIXED_ADD","_slicedToArray","sliceIterator","arr","_arr","_n","_d","_e","_s","_i","next","done","push","err","Array","isArray","_Settings","_Settings2","_debounce","_debounce2","_Event","_Event2","CLS_FIXED_WINDOW","fixedWindowInstance","FixedWindow","widgets","currentScrollTop","fixedScreenConstraints","windowWidth","isFixedWindowActive","touchListener","widget","fixedBreakpointFn","Set","widgetsThatRequireFixedWindow","from","some","_ref","_addFixedContainer","_removeFixedContainer","_this2","dispatchAndFire","getCurrentWidget","map","n","foundProperty","direction","node","whatNode","property","d","__fixedWindowMod__","getScrollbarWidth","forEach","preventDefault","shouldNotMove","touchStartListener","_getCurrentWidget","scrollTop","scrollHeight","touchMoveListener","_getCurrentWidget2","stopImmediatePropagation","documentElement","_node","paddingRight","_checkFixedNeeded","pop","fixed","fixedWidget","eventHandler","resizeListener","bind","EVENT_MODAL_ASYNC_TARGET_LOADED","EVENT_MODAL_INIT","EVENT_MODAL_OPENED","EVENT_MODAL_BEFORE_CLOSED","EVENT_MODAL_CLOSED","_Widget","_Widget2","_FixedWindow","_FixedWindow2","HTML_ELEMENT","KEY_ESC","ATTR_CREATE_NEW","ATTR_CLOSE","ATTR_NAME","CLS_CONTAINER_CURRENT","CLS_OPEN","CLS_CURRENT","CLS_PART_OF_STACK","CLS_MODAL_OPEN","CLS_MODAL_CONTAINER","CLS_ANIM_END","CLS_LOADER_CONTAINER","CLS_LOADER","Modal","DelegateContainer","container","currentOpen","loading","classNames","closeOnEscape","closeOnBackgroundClick","destroyOnFinish","fixedContainer","containerClassNames","eventContainer","eventFunction","dataMainPageContainer","modalContainer","_modalInstances","indexOf","splice","getInstance","close","applyOptionsFromElement","copy","KeyboardEvent","getTabEvent","hasAttribute","defaultPrevented","_finishState","prevModal","switchModals","dispatch","withOriginal","_removeModalFromStack","lastContainer","childNodes","cl","destroy","co","last","open","prefixedAnimateEvent","_finishAnim","instances","isCurrent","contains","foundInstance","flexModalInstance","targetContent","future","hasTarget","isHtmlElement","isWidget","getAttribute","findWidget","newInstance","setDestroyOnFinish","fromEvent","then","registerEvents","getModalContainer","modalContainerClasses","className","closeModalFunction","ce","loader","toggleLoader","show","loaderLoader","handleScrollbar","getAsync","r","result","DocumentFragment","innerHTML","guid","resolve","thisEl","modal","internal","maybeEvent","delegate","delegateContainer","addScreenConstraint","createWidget","arguments","v","isEmptyContainer","MutationObserver","observer","mutations","disconnect","observe","childList","keyCode","lastModal","fn","ms","clearTimeout","timeout","setTimeout","_Modal","_Modal2"],"mappings":"CAAA,SAAAA,EAAAC,GACA,gBAAAC,UAAA,gBAAAC,QACAA,OAAAD,QAAAD,IACA,kBAAAG,gBAAAC,IACAD,UAAAH,GACA,gBAAAC,SACAA,QAAA,QAAAD,IAEAD,EAAA,QAAAC,KACCK,KAAA,WACD,MCAgB,UAAUC,GCN1B,QAAAC,GAAAC,GAGA,GAAAC,EAAAD,GACA,MAAAC,GAAAD,GAAAP,OAGA,IAAAC,GAAAO,EAAAD,IACAP,WACAS,GAAAF,EACAG,QAAA,EAUA,OANAL,GAAAE,GAAAI,KAAAV,EAAAD,QAAAC,IAAAD,QAAAM,GAGAL,EAAAS,QAAA,EAGAT,EAAAD,QAvBA,GAAAQ,KAqCA,OATAF,GAAAM,EAAAP,EAGAC,EAAAO,EAAAL,EAGAF,EAAAQ,EAAA,MAGAR,EAAA,KDgBM,SAASL,EAAQD,EAASM,GAE/BL,EAAOD,QAAUM,EAAoB,KAKhC,SAASL,EAAQD,IAEM,SAASe,GAAS,YAQ9C,SAASC,GAAgBC,EAAUC,GAAe,KAAMD,YAAoBC,IAAgB,KAAM,IAAIC,WAAU,qCANhHC,OAAOC,eAA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1D,CAED,SAASH,EAAQD,GAEtB,YAEAoB,QAAOC,eAAerB,EAAS,cAC3BsB,OAAO,IAGXtB,aQn/Dc,SAAC6Z,EAAIC,GRo/Df,MQp/DsB,YACvBC,aAAaF,EAAGG,SAChBH,EAAGG,QAAUC,WAAWJ,EAAIC,MRy/DxB,CACA,CACA,CACA,CACA,CACA,CACA,CACA,CAEF,SAAS7Z,EAAQD,EAASM,GSpgEhC,YTwhEC,SAASqJ,GAAuBC,GAAO,MAAOA,IAAOA,EAAIC,WAAaD,GAAQE,UAASF,GAhBvFxI,OAAOC,eAAerB,EAAS,cAC3BsB,OAAO,GAGX,IAAI4Y,GAAS5Z,EAAoB,GAE7B6Z,EAAUxQ,EAAuBuQ,GAEjCnL,EAAYzO,EAAoB,GAEhC0O,EAAarF,EAAuBoF,GAEpC8D,EAAUvS,EAAoB,GAE9BwS,EAAWnJ,EAAuBkJ,EAKtC7S,eSnhEG+T,MAAAoG,aACAlP,SAAA+D,aACA9B,OAAA4F","file":"js/modal.min.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"FlexCss\"] = factory();\n\telse\n\t\troot[\"FlexCss\"] = factory();\n})(this, function() {\nreturn \n\n\n/** WEBPACK FOOTER **\n ** webpack/universalModuleDefinition\n **/","(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"FlexCss\"] = factory();\n\telse\n\t\troot[\"FlexCss\"] = factory();\n})(this, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId])\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\texports: {},\n/******/ \t\t\tid: moduleId,\n/******/ \t\t\tloaded: false\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.loaded = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"../\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tmodule.exports = __webpack_require__(19);\n\n\n/***/ },\n/* 1 */\n/***/ function(module, exports) {\n\n\t/* WEBPACK VAR INJECTION */(function(global) {\"use strict\";\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\t/*\n\t * The MIT License (MIT)\n\t *\n\t * Copyright (c) 2015 David Heidrich, BowlingX \n\t *\n\t * Permission is hereby granted, free of charge, to any person obtaining a copy\n\t * of this software and associated documentation files (the \"Software\"), to deal\n\t * in the Software without restriction, including without limitation the rights\n\t * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n\t * copies of the Software, and to permit persons to whom the Software is\n\t * furnished to do so, subject to the following conditions:\n\t *\n\t * The above copyright notice and this permission notice shall be included in\n\t * all copies or substantial portions of the Software.\n\t *\n\t * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n\t * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n\t * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n\t * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n\t * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n\t * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n\t * THE SOFTWARE.\n\t */\n\t\n\tvar PFX = [\"webkit\", \"moz\", \"MS\", \"o\", \"\"];\n\t\n\tvar COL_LEFT_CLASS = 'is-collision-left';\n\t\n\tvar COL_RIGHT_CLASS = 'is-collision-right';\n\t\n\tvar COL_BOTTOM_CLASS = 'is-collision-bottom';\n\t\n\t/**\n\t * Provides shared DOM-Utility functions\n\t */\n\t\n\tvar Util = function () {\n\t function Util() {\n\t _classCallCheck(this, Util);\n\t }\n\t\n\t _createClass(Util, null, [{\n\t key: \"prefixedAnimateEvent\",\n\t\n\t\n\t /**\n\t * Will register the right animation event based on browser\n\t * @param element\n\t * @param type\n\t * @param callback\n\t */\n\t value: function prefixedAnimateEvent(element, type, callback) {\n\t var thisFunction = function thisFunction(e) {\n\t callback.apply(element, [e, thisFunction]);\n\t };\n\t\n\t for (var p = 0; p < PFX.length; p++) {\n\t var thisType = type;\n\t if (!PFX[p]) {\n\t thisType = type.toLowerCase();\n\t }\n\t var name = PFX[p] + thisType;\n\t element.addEventListener(name, thisFunction, true);\n\t }\n\t }\n\t\n\t /**\n\t * Get correct transitionend event\n\t * @returns {String}\n\t * @private\n\t */\n\t\n\t }, {\n\t key: \"whichTransitionEndEvent\",\n\t value: function whichTransitionEndEvent() {\n\t var t = void 0;\n\t var el = document.createElement('fake');\n\t\n\t var transitions = {\n\t transition: 'transitionend',\n\t OTransition: 'oTransitionEnd',\n\t MozTransition: 'transitionend',\n\t WebkitTransition: 'webkitTransitionEnd'\n\t };\n\t\n\t for (t in transitions) {\n\t if (el.style[t] !== undefined) {\n\t return transitions[t];\n\t }\n\t }\n\t }\n\t\n\t /**\n\t * Check if target is part of parent node\n\t * @param target\n\t * @param parent\n\t * @returns {boolean}\n\t */\n\t\n\t }, {\n\t key: \"isPartOfNode\",\n\t value: function isPartOfNode(target, parent) {\n\t if (!target || !parent) {\n\t return false;\n\t }\n\t var now = target;\n\t while (now !== parent && now !== null) {\n\t if (now === parent) {\n\t break;\n\t }\n\t now = now.parentNode;\n\t }\n\t return now !== null;\n\t }\n\t\n\t /**\n\t * Finds the closest element including itself matching a callback\n\t * @param {Node} el\n\t * @param {Function} callback\n\t * @returns {Node|boolean}\n\t */\n\t\n\t }, {\n\t key: \"closestCallback\",\n\t value: function closestCallback(el, callback) {\n\t var element = el;\n\t while (element !== null) {\n\t if (callback(element)) {\n\t return element;\n\t }\n\t element = element.parentNode;\n\t }\n\t return false;\n\t }\n\t\n\t /**\n\t * Walks the tree until func returns true for given argument\n\t * @param target\n\t * @param func\n\t * @returns {boolean|HTMLElement}\n\t */\n\t\n\t }, {\n\t key: \"parentsUntil\",\n\t value: function parentsUntil(target, func) {\n\t if (!target) {\n\t return false;\n\t }\n\t var now = target;\n\t while (!func(now) && now !== null) {\n\t now = now.parentNode;\n\t }\n\t\n\t return now;\n\t }\n\t\n\t /**\n\t * Generates a unique id\n\t * @return {String}\n\t */\n\t\n\t }, {\n\t key: \"guid\",\n\t value: function guid() {\n\t function s4() {\n\t return Math.floor((1 + Math.random()) * 0x10000).toString(16).substring(1);\n\t }\n\t\n\t return s4() + s4() + \"-\" + s4() + \"-\" + s4() + \"-\" + s4() + \"-\" + (s4() + s4() + s4());\n\t }\n\t\n\t /**\n\t * Detects scrollbar width\n\t * @see http://stackoverflow.com/questions/986937/how-can-i-get-the-browsers-scrollbar-sizes\n\t * @returns {number}\n\t */\n\t\n\t }, {\n\t key: \"getScrollBarWidth\",\n\t value: function getScrollBarWidth() {\n\t var doc = global.document;\n\t var inner = doc.createElement('p');\n\t\n\t inner.style.width = \"100%\";\n\t inner.style.height = \"200px\";\n\t\n\t var outer = doc.createElement('div');\n\t outer.style.position = \"absolute\";\n\t outer.style.top = \"0px\";\n\t outer.style.left = \"0px\";\n\t outer.style.visibility = \"hidden\";\n\t outer.style.width = \"200px\";\n\t outer.style.height = \"150px\";\n\t outer.style.overflow = \"hidden\";\n\t outer.appendChild(inner);\n\t\n\t doc.body.appendChild(outer);\n\t var w1 = inner.offsetWidth;\n\t outer.style.overflow = 'scroll';\n\t var w2 = inner.offsetWidth;\n\t if (w1 === w2) {\n\t w2 = outer.clientWidth;\n\t }\n\t doc.body.removeChild(outer);\n\t\n\t return w1 - w2;\n\t }\n\t\n\t /**\n\t * Run an event once\n\t * @param {String} ev\n\t * @param {HTMLElement|HTMLDocument} target\n\t * @param {Function} func\n\t * @param {boolean} [capture]\n\t * @return Function created listener\n\t */\n\t\n\t }, {\n\t key: \"addEventOnce\",\n\t value: function addEventOnce(ev, target, func, capture) {\n\t var thisFunction = function thisFunction(event) {\n\t func(event, func);\n\t target.removeEventListener(ev, thisFunction, capture);\n\t };\n\t target.addEventListener(ev, thisFunction, capture);\n\t return thisFunction;\n\t }\n\t\n\t /**\n\t * Checks if an element is visible\n\t * @param {HTMLElement} element\n\t * @returns bool\n\t */\n\t\n\t }, {\n\t key: \"isVisible\",\n\t value: function isVisible(element) {\n\t return element.offsetWidth > 0 && element.offsetHeight > 0;\n\t }\n\t\n\t /**\n\t * Creates a camelCaseRepresentation of a dashed string\n\t * @param {String} str\n\t * @returns String\n\t */\n\t\n\t }, {\n\t key: \"dashToCamelCase\",\n\t value: function dashToCamelCase(str) {\n\t return str.replace(/-([a-z])/g, function (g) {\n\t return g[1].toUpperCase();\n\t });\n\t }\n\t\n\t /**\n\t * Creates a copy of `input`\n\t * @param {*} input\n\t * @return *\n\t */\n\t\n\t }, {\n\t key: \"copy\",\n\t value: function copy(input) {\n\t return JSON.parse(JSON.stringify(input));\n\t }\n\t\n\t /**\n\t * Reads options from element (data attributes) and applies to base\n\t * @param {HTMLElement} element\n\t * @param {Object} base\n\t * @return {Object}\n\t */\n\t\n\t }, {\n\t key: \"applyOptionsFromElement\",\n\t value: function applyOptionsFromElement(element, base) {\n\t if (!element) {\n\t return base;\n\t }\n\t var attrs = element.attributes;\n\t for (var i = 0; i < attrs.length; i++) {\n\t var attr = attrs[i];\n\t if (attr) {\n\t var s = Util.dashToCamelCase(attr.nodeName.replace('data-', ''));\n\t var val = attr.nodeValue;\n\t if (base.hasOwnProperty(s)) {\n\t // skip functions\n\t if (typeof base[s] === 'function') {\n\t continue;\n\t }\n\t if (typeof base[s] === 'boolean') {\n\t base[s] = parseInt(val || 1, 10) === 1;\n\t } else {\n\t base[s] = val;\n\t }\n\t }\n\t }\n\t }\n\t return base;\n\t }\n\t\n\t /**\n\t * Will position an element directly at given target\n\t * Is aware of a given collision container to detect edges\n\t * Will put elementToPosition either to left, center or right edge (prefer right)\n\t * and either to bottom or top (prefers bottom)\n\t *\n\t * You may overwrite preferred positioned with `centerHorizontal` and `positionTop`\n\t *\n\t * @param {HTMLElement|ClientRect} target the target container to align to\n\t * @param {HTMLElement} elementToPosition the element to position\n\t * @param {HTMLElement} collisionContainer the outer container to prevent collisions\n\t * @param {boolean} [centerHorizontal] set true to center element, otherwise it's put on the right border by default\n\t * @param {boolean} [positionTop] flip top, by default element is positioned to the bottom.\n\t * @returns {HTMLElement}\n\t */\n\t\n\t }, {\n\t key: \"setupPositionNearby\",\n\t value: function setupPositionNearby(target, elementToPosition, collisionContainer, centerHorizontal, positionTop) {\n\t // determine relative offsets\n\t var amountTop = 0;\n\t var amountLeft = 0;\n\t Util.parentsUntil(target.parentNode, function (el) {\n\t if (!(el instanceof HTMLElement)) {\n\t return false;\n\t }\n\t var style = window.getComputedStyle(el);\n\t if (Util.isPartOfNode(elementToPosition, el)) {\n\t if (style && style.position === 'relative') {\n\t amountTop += el.offsetTop || 0;\n\t amountLeft += el.offsetLeft || 0;\n\t }\n\t return false;\n\t }\n\t return true;\n\t });\n\t\n\t var targetPosition = target instanceof HTMLElement ? target.getBoundingClientRect() : target;\n\t var elementRect = elementToPosition.getBoundingClientRect();\n\t var colRect = collisionContainer.getBoundingClientRect();\n\t var targetTop = targetPosition.top - amountTop;\n\t var targetRight = targetPosition.right;\n\t var isCollisionTop = targetTop - elementRect.height <= 0;\n\t var isCollisionBottom = window.innerHeight < targetTop + amountTop + targetPosition.height + elementRect.height;\n\t var isCollisionLeft = targetRight < elementRect.width;\n\t var targetLeft = targetPosition.left;\n\t var isCollisionRight = targetLeft + elementRect.width > colRect.width;\n\t var classList = elementToPosition.classList;\n\t\n\t classList.remove(COL_RIGHT_CLASS);\n\t classList.remove(COL_LEFT_CLASS);\n\t classList.remove(COL_BOTTOM_CLASS);\n\t\n\t var calcTop = void 0;\n\t var calcLeft = void 0;\n\t if (isCollisionLeft && !isCollisionRight) {\n\t // put element to left if collision with left\n\t calcLeft = targetPosition.left - colRect.left - amountLeft + \"px\";\n\t classList.add(COL_LEFT_CLASS);\n\t } else {\n\t // maybe center if no collision with either side\n\t var rightPosition = targetRight - elementRect.width - colRect.left - amountLeft + \"px\";\n\t var leftCentered = (targetLeft + targetPosition.width / 2 - elementRect.width / 2 || 0) - colRect.left;\n\t var collisionCentered = leftCentered + elementRect.width > colRect.width;\n\t if (centerHorizontal && !collisionCentered) {\n\t calcLeft = leftCentered + \"px\";\n\t } else {\n\t classList.add(COL_RIGHT_CLASS);\n\t calcLeft = rightPosition;\n\t }\n\t }\n\t\n\t if (isCollisionBottom || positionTop && !isCollisionTop) {\n\t // Put Element on top if collision\n\t calcTop = targetTop - elementRect.height - colRect.top + \"px\";\n\t classList.add(COL_BOTTOM_CLASS);\n\t } else {\n\t calcTop = targetTop + targetPosition.height - colRect.top + \"px\";\n\t }\n\t\n\t elementToPosition.style.cssText = \"top:\" + calcTop + \";left:\" + calcLeft + \";\";\n\t\n\t return elementToPosition;\n\t }\n\t\n\t /**\n\t * Brings a given element into viewport\n\t * @param {HTMLElement} el\n\t * @param {int|function}[optionalOffset]\n\t */\n\t\n\t }, {\n\t key: \"scrollToElement\",\n\t value: function scrollToElement(el, optionalOffset) {\n\t el.scrollIntoView();\n\t var thisOffset = optionalOffset;\n\t // optionally use a additional scrollDif\n\t if (thisOffset) {\n\t if (typeof thisOffset === 'function') {\n\t thisOffset = optionalOffset();\n\t }\n\t if (thisOffset > 0) {\n\t var scrolledY = window.pageYOffset;\n\t if (scrolledY) {\n\t window.scroll(0, scrolledY - thisOffset);\n\t }\n\t }\n\t }\n\t }\n\t }]);\n\t\n\t return Util;\n\t}();\n\t\n\texports.default = Util;\n\t/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))\n\n/***/ },\n/* 2 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t/* WEBPACK VAR INJECTION */(function(global) {'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /*\n\t * The MIT License (MIT)\n\t *\n\t * Copyright (c) 2015 David Heidrich, BowlingX \n\t *\n\t * Permission is hereby granted, free of charge, to any person obtaining a copy\n\t * of this software and associated documentation files (the \"Software\"), to deal\n\t * in the Software without restriction, including without limitation the rights\n\t * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n\t * copies of the Software, and to permit persons to whom the Software is\n\t * furnished to do so, subject to the following conditions:\n\t *\n\t * The above copyright notice and this permission notice shall be included in\n\t * all copies or substantial portions of the Software.\n\t *\n\t * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n\t * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n\t * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n\t * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n\t * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n\t * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n\t * THE SOFTWARE.\n\t */\n\t\n\t\n\tvar _Util = __webpack_require__(1);\n\t\n\tvar _Util2 = _interopRequireDefault(_Util);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\t// we attach global settings to global once because settings might be shared a lot of times trough the application\n\t// Maybe find a better way to handle that scenario\n\tif (!global.FLEXCSS_GLOBAL_SETTINGS) {\n\t (function () {\n\t global.FLEXCSS_GLOBAL_SETTINGS = {\n\t // defined breakpoint for small devices < n\n\t smallBreakpoint: 768,\n\t // nodes that should be updated when no scrollbar is expected\n\t scrollbarUpdateNodes: global.document.body !== null ? [global.document.body] : [],\n\t // additional Delay until darkener is fully hidden\n\t darkenerFadeDelay: 100,\n\t // class that is added if canvas has been toggled\n\t canvasToggledClass: 'toggled-canvas'\n\t };\n\t\n\t global.FLEXCSS_CONST_IS_IOS = null;\n\t\n\t global.FLEXCSS_CONST_IS_TOUCH = null;\n\t\n\t global.FLEXCSS_CONST_IS_IE = null;\n\t\n\t global.FLEXCSS_CONST_TAB_EVENT = 'click';\n\t\n\t global.FLEXCSS_IS_SMALL_SCREEN = false;\n\t\n\t var init = function init() {\n\t // Measure scrollbar width\n\t global.FLEXCSS_CONST_SCROLLBAR_WIDTH = _Util2.default.getScrollBarWidth();\n\t // detect right transition end event\n\t global.FLEXCSS_CONST_TRANSITION_EVENT = _Util2.default.whichTransitionEndEvent();\n\t };\n\t\n\t if (global.document.readyState !== 'loading') {\n\t init();\n\t } else {\n\t // it's possible that global.document.body is not available if the document is not\n\t // loaded completely\n\t document.addEventListener('DOMContentLoaded', function () {\n\t init();\n\t });\n\t }\n\t })();\n\t}\n\t\n\t/**\n\t * Utility class that setups global settings\n\t */\n\t\n\tvar Settings = function () {\n\t function Settings() {\n\t _classCallCheck(this, Settings);\n\t }\n\t\n\t _createClass(Settings, null, [{\n\t key: 'setup',\n\t\n\t\n\t /**\n\t * Setup global settings, overwrite default values\n\t * @param {Object} settings\n\t */\n\t value: function setup(settings) {\n\t Object.assign(global.FLEXCSS_GLOBAL_SETTINGS, settings);\n\t }\n\t\n\t /**\n\t * Access to global settings\n\t * @returns {Object}\n\t */\n\t\n\t }, {\n\t key: 'get',\n\t value: function get() {\n\t return global.FLEXCSS_GLOBAL_SETTINGS;\n\t }\n\t\n\t /**\n\t * Detects a IOS Device, caches subsequent calls\n\t * @returns {boolean}\n\t */\n\t\n\t }, {\n\t key: 'isIosDevice',\n\t value: function isIosDevice() {\n\t if (!global.FLEXCSS_CONST_IS_IOS) {\n\t global.FLEXCSS_CONST_IS_IOS = global.navigator.userAgent.match(/(iPad|iPhone|iPod)/i);\n\t }\n\t\n\t return global.FLEXCSS_CONST_IS_IOS;\n\t }\n\t\n\t /**\n\t * @returns {boolean}\n\t */\n\t\n\t }, {\n\t key: 'isSmallScreen',\n\t value: function isSmallScreen() {\n\t return window.innerWidth < Settings.get().smallBreakpoint;\n\t }\n\t\n\t /**\n\t * Detects a touch device, caches subsequent calls\n\t * @returns {boolean}\n\t */\n\t\n\t }, {\n\t key: 'isTouchDevice',\n\t value: function isTouchDevice() {\n\t if (!global.FLEXCSS_CONST_IS_TOUCH) {\n\t global.FLEXCSS_CONST_IS_TOUCH = 'ontouchstart' in window || !!global.navigator.msMaxTouchPoints;\n\t }\n\t return global.FLEXCSS_CONST_IS_TOUCH;\n\t }\n\t\n\t /**\n\t * Checks if current browser is Internet Explorer\n\t * @returns {boolean|*}\n\t */\n\t\n\t }, {\n\t key: 'isIE',\n\t value: function isIE() {\n\t if (!global.FLEXCSS_CONST_IS_IE) {\n\t global.FLEXCSS_CONST_IS_IE = \"ActiveXObject\" in window;\n\t }\n\t return global.FLEXCSS_CONST_IS_IE;\n\t }\n\t\n\t /**\n\t * @returns {String}\n\t */\n\t\n\t }, {\n\t key: 'getTransitionEvent',\n\t value: function getTransitionEvent() {\n\t return global.FLEXCSS_CONST_TRANSITION_EVENT;\n\t }\n\t\n\t /**\n\t * @returns {int}\n\t */\n\t\n\t }, {\n\t key: 'getScrollbarWidth',\n\t value: function getScrollbarWidth() {\n\t return global.FLEXCSS_CONST_SCROLLBAR_WIDTH;\n\t }\n\t\n\t /**\n\t * @returns {String}\n\t */\n\t\n\t }, {\n\t key: 'getTabEvent',\n\t value: function getTabEvent() {\n\t return global.FLEXCSS_CONST_TAB_EVENT;\n\t }\n\t }]);\n\t\n\t return Settings;\n\t}();\n\t\n\texports.default = Settings;\n\t/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))\n\n/***/ },\n/* 3 */\n/***/ function(module, exports) {\n\n\t/* WEBPACK VAR INJECTION */(function(global) {\"use strict\";\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\t/* global CustomEvent */\n\t\n\t/*\n\t * The MIT License (MIT)\n\t *\n\t * Copyright (c) 2015 David Heidrich, BowlingX \n\t *\n\t * Permission is hereby granted, free of charge, to any person obtaining a copy\n\t * of this software and associated documentation files (the \"Software\"), to deal\n\t * in the Software without restriction, including without limitation the rights\n\t * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n\t * copies of the Software, and to permit persons to whom the Software is\n\t * furnished to do so, subject to the following conditions:\n\t *\n\t * The above copyright notice and this permission notice shall be included in\n\t * all copies or substantial portions of the Software.\n\t *\n\t * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n\t * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n\t * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n\t * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n\t * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n\t * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n\t * THE SOFTWARE.\n\t */\n\t\n\t// polyfill for custom events to make thinks work in IE\n\t// The needed polyfill is so small that I embedded it here\n\t(function poly() {\n\t if (!global.CustomEvent || typeof global.CustomEvent !== 'function') {\n\t var _CustomEvent = function CustomEvent(event, params) {\n\t var thisParams = params || {\n\t bubbles: false,\n\t cancelable: false,\n\t detail: undefined\n\t };\n\t var evt = document.createEvent(\"CustomEvent\");\n\t evt.initCustomEvent(event, thisParams.bubbles, thisParams.cancelable, thisParams.detail);\n\t return evt;\n\t };\n\t _CustomEvent.prototype = global.Event.prototype;\n\t global.CustomEvent = _CustomEvent;\n\t }\n\t})();\n\t/**\n\t * Simpler Event dispatching\n\t */\n\t\n\tvar EventHandler = function () {\n\t\n\t /**\n\t * @param {HTMLElement} target\n\t * @param {String} name\n\t */\n\t\n\t function EventHandler(target, name) {\n\t _classCallCheck(this, EventHandler);\n\t\n\t this.target = target;\n\t this.defaultOptions = {\n\t bubbles: true,\n\t cancelable: true\n\t };\n\t\n\t this.name = name;\n\t }\n\t\n\t /**\n\t * Set more options\n\t * @param {Object} options\n\t * @returns {EventHandler}\n\t */\n\t\n\t\n\t _createClass(EventHandler, [{\n\t key: \"withOptions\",\n\t value: function withOptions(options) {\n\t Object.assign(this.defaultOptions, options || {});\n\t return this;\n\t }\n\t\n\t /**\n\t * Call with the originalEvent\n\t * @param {Event} e\n\t * @returns {EventHandler}\n\t */\n\t\n\t }, {\n\t key: \"withOriginal\",\n\t value: function withOriginal(e) {\n\t return this.withDetail({\n\t originalEvent: e\n\t });\n\t }\n\t\n\t /**\n\t * Extends the detail part of the event\n\t * @param {Object} o\n\t * @returns {EventHandler}\n\t */\n\t\n\t }, {\n\t key: \"withDetail\",\n\t value: function withDetail(o) {\n\t if (!this.defaultOptions.detail) {\n\t this.defaultOptions.detail = {};\n\t }\n\t Object.assign(this.defaultOptions.detail, o);\n\t return this;\n\t }\n\t\n\t /**\n\t * @returns {CustomEvent}\n\t */\n\t\n\t }, {\n\t key: \"fire\",\n\t value: function fire() {\n\t var e = new CustomEvent(this.name, this.defaultOptions);\n\t if (this.target) {\n\t this.target.dispatchEvent(e);\n\t }\n\t return e;\n\t }\n\t }]);\n\t\n\t return EventHandler;\n\t}();\n\t\n\tvar Event = function () {\n\t function Event() {\n\t _classCallCheck(this, Event);\n\t }\n\t\n\t _createClass(Event, null, [{\n\t key: \"dispatch\",\n\t\n\t /**\n\t * Prepares to dispatch a custom event (without firing)\n\t * @param {HTMLElement} target\n\t * @param {String} name\n\t * @returns {EventHandler}\n\t */\n\t value: function dispatch(target, name) {\n\t return new EventHandler(target, name);\n\t }\n\t\n\t /**\n\t * Dispatches a custom event and fires it directly\n\t * @param {HTMLElement} target\n\t * @param {String} name\n\t * @param {Object} [options]\n\t * @returns {CustomEvent}\n\t */\n\t\n\t }, {\n\t key: \"dispatchAndFire\",\n\t value: function dispatchAndFire(target, name, options) {\n\t return new EventHandler(target, name).withOptions(options).fire();\n\t }\n\t }]);\n\t\n\t return Event;\n\t}();\n\t\n\texports.default = Event;\n\t/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))\n\n/***/ },\n/* 4 */\n/***/ function(module, exports) {\n\n\t/* WEBPACK VAR INJECTION */(function(global) {'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol ? \"symbol\" : typeof obj; };\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\t/*\n\t * The MIT License (MIT)\n\t *\n\t * Copyright (c) 2015 David Heidrich, BowlingX \n\t *\n\t * Permission is hereby granted, free of charge, to any person obtaining a copy\n\t * of this software and associated documentation files (the \"Software\"), to deal\n\t * in the Software without restriction, including without limitation the rights\n\t * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n\t * copies of the Software, and to permit persons to whom the Software is\n\t * furnished to do so, subject to the following conditions:\n\t *\n\t * The above copyright notice and this permission notice shall be included in\n\t * all copies or substantial portions of the Software.\n\t *\n\t * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n\t * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n\t * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n\t * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n\t * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n\t * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n\t * THE SOFTWARE.\n\t */\n\t\n\t/*!\n\t * FlexCss.Widget\n\t * Licensed under the MIT License (MIT)\n\t * Copyright (c) 2015 David Heidrich, BowlingX \n\t */\n\t\n\t/**\n\t * A Widget provides async content on a specific target (e.g. a modal link)\n\t */\n\t\n\tvar Widget = function () {\n\t\n\t /**\n\t * Creates a new Widget\n\t * @param [element], optional define the content of widget\n\t */\n\t\n\t function Widget(element) {\n\t var _this = this;\n\t\n\t _classCallCheck(this, Widget);\n\t\n\t /**\n\t *\n\t * @type {Promise}\n\t */\n\t this.asyncContent = null;\n\t\n\t /**\n\t * @type {boolean}\n\t */\n\t this._isWidget = true;\n\t\n\t if (element) {\n\t /**\n\t * @type {HTMLElement}\n\t */\n\t this.element = element instanceof HTMLElement ? element : global.document.getElementById(element);\n\t if (this.element) {\n\t this.element.hfWidgetInstance = this;\n\t this.setAsync(function () {\n\t return new Promise(function (s) {\n\t s(_this.element);\n\t });\n\t });\n\t } else {\n\t throw new Error('Could not found element with ID: ' + element);\n\t }\n\t }\n\t /**\n\t * The final resulted content that a widget did create (e.g. a modal container)\n\t * @type {HTMLElement}\n\t */\n\t this.finalContent = null;\n\t }\n\t\n\t /**\n\t *\n\t * @returns {Promise}\n\t */\n\t\n\t\n\t _createClass(Widget, [{\n\t key: 'getAsync',\n\t value: function getAsync() {\n\t return this.asyncContent();\n\t }\n\t\n\t /**\n\t * @param {Function.} async\n\t * @returns {Widget}\n\t */\n\t\n\t }, {\n\t key: 'setAsync',\n\t value: function setAsync(async) {\n\t this.asyncContent = async;\n\t return this;\n\t }\n\t\n\t /**\n\t * @returns {HTMLElement}\n\t */\n\t\n\t }, {\n\t key: 'getFinalContent',\n\t value: function getFinalContent() {\n\t return this.finalContent;\n\t }\n\t\n\t /**\n\t * @param {HTMLElement} element\n\t * @returns {Widget}\n\t */\n\t\n\t }, {\n\t key: 'setElement',\n\t value: function setElement(element) {\n\t this.element = element;\n\t return this;\n\t }\n\t\n\t /**\n\t * Destroys the generated content of this widget\n\t * @returns {boolean}\n\t */\n\t\n\t }, {\n\t key: 'destroy',\n\t value: function destroy() {\n\t if (this.finalContent && this.finalContent.parentNode) {\n\t this.finalContent.parentNode.removeChild(this.finalContent);\n\t return true;\n\t }\n\t\n\t delete this.element;\n\t delete this.asyncContent;\n\t delete this.finalContent;\n\t\n\t return false;\n\t }\n\t\n\t /**\n\t * Will find a widget on an Element\n\t * @param {HTMLElement} element\n\t * @returns {Widget|undefined}\n\t */\n\t\n\t }], [{\n\t key: 'findWidget',\n\t value: function findWidget(element) {\n\t return element ? element.hfWidgetInstance : undefined;\n\t }\n\t\n\t /**\n\t * Checks if a given object is an instance\n\t * @param {Object} self\n\t * @returns {boolean}\n\t */\n\t\n\t }, {\n\t key: 'isWidget',\n\t value: function isWidget(self) {\n\t return self instanceof Widget || (typeof self === 'undefined' ? 'undefined' : _typeof(self)) === 'object' && self.hasOwnProperty('_isWidget');\n\t }\n\t }]);\n\t\n\t return Widget;\n\t}();\n\t\n\texports.default = Widget;\n\t/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))\n\n/***/ },\n/* 5 */,\n/* 6 */,\n/* 7 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t/* WEBPACK VAR INJECTION */(function(global) {'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports.EVENT_AFTER_FIXED_REMOVE = exports.EVENT_BEFORE_FIXED_ADD = undefined;\n\t\n\tvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol ? \"symbol\" : typeof obj; };\n\t\n\tvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _Settings = __webpack_require__(2);\n\t\n\tvar _Settings2 = _interopRequireDefault(_Settings);\n\t\n\tvar _debounce = __webpack_require__(10);\n\t\n\tvar _debounce2 = _interopRequireDefault(_debounce);\n\t\n\tvar _Event = __webpack_require__(3);\n\t\n\tvar _Event2 = _interopRequireDefault(_Event);\n\t\n\tvar _Util = __webpack_require__(1);\n\t\n\tvar _Util2 = _interopRequireDefault(_Util);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tvar CLS_FIXED_WINDOW = 'fixed-window-open';\n\t\n\tvar EVENT_BEFORE_FIXED_ADD = exports.EVENT_BEFORE_FIXED_ADD = 'flexcss.fixedWindow.beforeAdd';\n\tvar EVENT_AFTER_FIXED_REMOVE = exports.EVENT_AFTER_FIXED_REMOVE = 'flexcss.fixedWindow.afterRemove';\n\t\n\t/**\n\t * @type {FixedWindow}\n\t */\n\tvar fixedWindowInstance = void 0;\n\t\n\tvar FixedWindow = function () {\n\t function FixedWindow() {\n\t _classCallCheck(this, FixedWindow);\n\t\n\t this.widgets = [];\n\t this.currentScrollTop = 0;\n\t this.fixedScreenConstraints = [];\n\t this.windowWidth = 0;\n\t this.isFixedWindowActive = false;\n\t this.touchListener = null;\n\t }\n\t\n\t /**\n\t * Adds a constraint to detect if the window needs to be changed when the screensize changes\n\t *\n\t * @param {Function} widget\n\t * @param {Function} fixedBreakpointFn gets a width argument, return true to open a window\n\t */\n\t\n\t\n\t _createClass(FixedWindow, [{\n\t key: 'addScreenConstraint',\n\t value: function addScreenConstraint(widget, fixedBreakpointFn) {\n\t this.fixedScreenConstraints[widget] = fixedBreakpointFn;\n\t }\n\t\n\t /**\n\t * @returns {null|DestroyableWidget}\n\t */\n\t\n\t }, {\n\t key: 'getCurrentWidget',\n\t value: function getCurrentWidget() {\n\t return this.widgets.length > 0 ? this.widgets[this.widgets.length - 1] : null;\n\t }\n\t\n\t /**\n\t * @private\n\t */\n\t\n\t }, {\n\t key: '_checkFixedNeeded',\n\t value: function _checkFixedNeeded() {\n\t var _this = this;\n\t\n\t if (this.widgets.length === 0) {\n\t return;\n\t }\n\t var widgets = new Set(this.widgets);\n\t var widgetsThatRequireFixedWindow = Array.from(widgets).some(function (_ref) {\n\t var widget = _ref.widget;\n\t\n\t return _this.fixedScreenConstraints[widget] && _this.fixedScreenConstraints[widget](_this.windowWidth);\n\t });\n\t if (!widgetsThatRequireFixedWindow) {\n\t this._removeFixedContainer();\n\t } else {\n\t this._addFixedContainer();\n\t }\n\t }\n\t\n\t /**\n\t * @private\n\t */\n\t\n\t }, {\n\t key: '_addFixedContainer',\n\t value: function _addFixedContainer() {\n\t var _this2 = this;\n\t\n\t if (this.isFixedWindowActive) {\n\t return;\n\t }\n\t _Event2.default.dispatchAndFire(global.document, EVENT_BEFORE_FIXED_ADD, {\n\t detail: this.getCurrentWidget()\n\t });\n\t // this causes layout and should be optimized\n\t // At lest we write in a batch later\n\t _Settings2.default.get().scrollbarUpdateNodes.map(function (n) {\n\t var foundProperty = 'paddingRight';\n\t var direction = 1;\n\t var node = n;\n\t if (n instanceof Array) {\n\t var _n = _slicedToArray(n, 3);\n\t\n\t var whatNode = _n[0];\n\t var property = _n[1];\n\t var d = _n[2];\n\t\n\t foundProperty = property;\n\t node = whatNode;\n\t direction = d || 1;\n\t }\n\t return {\n\t node: node,\n\t property: foundProperty,\n\t value: parseInt(global.getComputedStyle(node)[foundProperty], 10) + (!node.__fixedWindowMod__ ? _Settings2.default.getScrollbarWidth() * direction : 0) + 'px'\n\t };\n\t }).forEach(function (d) {\n\t d.node.__fixedWindowMod__ = true;\n\t d.node.style[d.property] = d.value;\n\t });\n\t\n\t this.touchListener = function (e) {\n\t e.preventDefault();\n\t };\n\t\n\t var shouldNotMove = false;\n\t this.touchStartListener = function (e) {\n\t var _getCurrentWidget = _this2.getCurrentWidget();\n\t\n\t var element = _getCurrentWidget.element;\n\t\n\t if (_Util2.default.isPartOfNode(e.target, element)) {\n\t if (element.scrollTop === 0) {\n\t element.scrollTop = 1;\n\t shouldNotMove = true;\n\t } else if (element.scrollHeight === element.scrollTop + element.offsetHeight) {\n\t shouldNotMove = true;\n\t element.scrollTop -= 1;\n\t }\n\t }\n\t };\n\t\n\t global.addEventListener('touchmove', this.touchListener);\n\t global.document.body.addEventListener('touchstart', this.touchStartListener);\n\t\n\t this.touchMoveListener = function (e) {\n\t var _getCurrentWidget2 = _this2.getCurrentWidget();\n\t\n\t var element = _getCurrentWidget2.element;\n\t\n\t if (_Util2.default.isPartOfNode(e.target, element)) {\n\t if (!shouldNotMove) {\n\t e.stopImmediatePropagation();\n\t }\n\t shouldNotMove = false;\n\t }\n\t };\n\t global.document.body.addEventListener('touchmove', this.touchMoveListener);\n\t\n\t global.document.documentElement.classList.add(CLS_FIXED_WINDOW);\n\t this.isFixedWindowActive = true;\n\t }\n\t\n\t /**\n\t * @private\n\t */\n\t\n\t }, {\n\t key: '_removeFixedContainer',\n\t value: function _removeFixedContainer() {\n\t if (this.isFixedWindowActive) {\n\t // cleanup event listeners\n\t global.removeEventListener('touchmove', this.touchListener);\n\t global.document.body.removeEventListener('touchstart', this.touchStartListener);\n\t global.document.body.removeEventListener('touchmove', this.touchMoveListener);\n\t\n\t // reset scrollbar nodes\n\t _Settings2.default.get().scrollbarUpdateNodes.forEach(function (node) {\n\t if (node instanceof Array) {\n\t var _node = _slicedToArray(node, 2);\n\t\n\t var whatNode = _node[0];\n\t var property = _node[1];\n\t\n\t delete whatNode.__fixedWindowMod__;\n\t whatNode.style[property] = '';\n\t } else {\n\t delete node.__fixedWindowMod__;\n\t node.style.paddingRight = '';\n\t }\n\t });\n\t global.document.documentElement.classList.remove(CLS_FIXED_WINDOW);\n\t _Event2.default.dispatchAndFire(global.document, EVENT_AFTER_FIXED_REMOVE);\n\t this.isFixedWindowActive = false;\n\t }\n\t }\n\t\n\t /**\n\t * Will close a window when no widgets are opened that need one\n\t */\n\t\n\t }, {\n\t key: 'resizeListener',\n\t value: function resizeListener() {\n\t this.windowWidth = global.innerWidth;\n\t this._checkFixedNeeded();\n\t }\n\t\n\t /**\n\t * @returns {FixedWindow}\n\t */\n\t\n\t }, {\n\t key: 'close',\n\t\n\t\n\t /**\n\t * Request a close of the fixed window\n\t */\n\t value: function close() {\n\t this.widgets.pop();\n\t if (this.widgets.length === 0) {\n\t this._removeFixedContainer();\n\t }\n\t }\n\t\n\t /**\n\t * Request to open a fixed windows\n\t * @param {Object|DestroyableWidget} instance\n\t * @param {HTMLElement} element\n\t */\n\t\n\t }, {\n\t key: 'open',\n\t value: function open(instance, element) {\n\t var fixed = false;\n\t if ((typeof instance === 'undefined' ? 'undefined' : _typeof(instance)) === 'object') {\n\t var widget = instance.constructor;\n\t var fixedWidget = this.fixedScreenConstraints[instance.constructor];\n\t if (widget && fixedWidget) {\n\t fixed = fixedWidget(this.windowWidth);\n\t }\n\t var length = this.widgets.length;\n\t this.widgets.push({\n\t widget: widget,\n\t element: element\n\t });\n\t // open a new window if there is no window active\n\t if (length === 0) {\n\t if (fixed) {\n\t this._addFixedContainer();\n\t }\n\t }\n\t }\n\t }\n\t }], [{\n\t key: 'getInstance',\n\t value: function getInstance() {\n\t if (!fixedWindowInstance) {\n\t fixedWindowInstance = new FixedWindow();\n\t fixedWindowInstance.windowWidth = global.innerWidth;\n\t var eventHandler = fixedWindowInstance.resizeListener.bind(fixedWindowInstance);\n\t global.addEventListener('resize', (0, _debounce2.default)(eventHandler, 500));\n\t global.addEventListener('orientationchange', eventHandler);\n\t }\n\t return fixedWindowInstance;\n\t }\n\t }]);\n\t\n\t return FixedWindow;\n\t}();\n\n\texports.default = FixedWindow;\n\t/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))\n\n/***/ },\n/* 8 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t/* WEBPACK VAR INJECTION */(function(global) {'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports.EVENT_MODAL_ASYNC_TARGET_LOADED = exports.EVENT_MODAL_INIT = exports.EVENT_MODAL_OPENED = exports.EVENT_MODAL_BEFORE_CLOSED = exports.EVENT_MODAL_CLOSED = undefined;\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /*\n\t * The MIT License (MIT)\n\t *\n\t * Copyright (c) 2015 David Heidrich, BowlingX \n\t *\n\t * Permission is hereby granted, free of charge, to any person obtaining a copy\n\t * of this software and associated documentation files (the \"Software\"), to deal\n\t * in the Software without restriction, including without limitation the rights\n\t * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n\t * copies of the Software, and to permit persons to whom the Software is\n\t * furnished to do so, subject to the following conditions:\n\t *\n\t * The above copyright notice and this permission notice shall be included in\n\t * all copies or substantial portions of the Software.\n\t *\n\t * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n\t * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n\t * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n\t * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n\t * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n\t * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n\t * THE SOFTWARE.\n\t */\n\t\n\t/*!\n\t * FlexCss.Modal\n\t * Licensed under the MIT License (MIT)\n\t * Copyright (c) 2015 David Heidrich, BowlingX \n\t */\n\t\n\t/* global KeyboardEvent */\n\t\n\tvar _Settings = __webpack_require__(2);\n\t\n\tvar _Settings2 = _interopRequireDefault(_Settings);\n\t\n\tvar _Event = __webpack_require__(3);\n\t\n\tvar _Event2 = _interopRequireDefault(_Event);\n\t\n\tvar _Util = __webpack_require__(1);\n\t\n\tvar _Util2 = _interopRequireDefault(_Util);\n\t\n\tvar _Widget = __webpack_require__(4);\n\t\n\tvar _Widget2 = _interopRequireDefault(_Widget);\n\t\n\tvar _FixedWindow = __webpack_require__(7);\n\t\n\tvar _FixedWindow2 = _interopRequireDefault(_FixedWindow);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tvar HTML_ELEMENT = global.document.documentElement;\n\tvar KEY_ESC = 27;\n\t/* Attribute Names */\n\tvar ATTR_CREATE_NEW = 'data-new-instance';\n\tvar ATTR_CLOSE = 'data-close-modal';\n\tvar ATTR_NAME = 'data-modal';\n\t\n\t/* Class names */\n\tvar CLS_CONTAINER_CURRENT = 'front';\n\tvar CLS_OPEN = 'open';\n\tvar CLS_CURRENT = 'current';\n\tvar CLS_PART_OF_STACK = 'part-of-stack';\n\tvar CLS_MODAL_OPEN = 'modal-open';\n\tvar CLS_MODAL_CONTAINER = 'modal-container';\n\tvar CLS_ANIM_END = 'modal-anim-end';\n\tvar CLS_LOADER_CONTAINER = 'loader-container';\n\tvar CLS_LOADER = 'loader';\n\t\n\t/* Events */\n\t\n\t/**\n\t * Event triggered when modal is closed\n\t * @type {string}\n\t */\n\tvar EVENT_MODAL_CLOSED = exports.EVENT_MODAL_CLOSED = 'flexcss.modal.closed';\n\t/**\n\t * Event triggered before a modal is closed, cancelable\n\t * @type {string}\n\t */\n\tvar EVENT_MODAL_BEFORE_CLOSED = exports.EVENT_MODAL_BEFORE_CLOSED = 'flexcss.modal.beforeClose';\n\t/**\n\t * Event triggered when a modal is opened\n\t * @type {string}\n\t */\n\tvar EVENT_MODAL_OPENED = exports.EVENT_MODAL_OPENED = 'flexcss.modal.opened';\n\t\n\t/**\n\t * Event triggered when modal is initilized, called on target\n\t * @type {string}\n\t */\n\tvar EVENT_MODAL_INIT = exports.EVENT_MODAL_INIT = 'flexcss.modal.init';\n\t\n\t/**\n\t * Triggered when the content of an async modal on a target is loaded, called on target\n\t * @type {string}\n\t */\n\tvar EVENT_MODAL_ASYNC_TARGET_LOADED = exports.EVENT_MODAL_ASYNC_TARGET_LOADED = 'flexcss.modal.asyncTargetLoaded';\n\t\n\t/**\n\t * A Modal Implementation\n\t */\n\t\n\tvar Modal = function () {\n\t function Modal(DelegateContainer, options) {\n\t _classCallCheck(this, Modal);\n\t\n\t var doc = global.document;\n\t var container = DelegateContainer instanceof HTMLElement ? DelegateContainer : doc.getElementById(DelegateContainer);\n\t\n\t // Instance vars:\n\t if (!container) {\n\t throw new Error('Could not found container element by given ID/Element: ' + DelegateContainer);\n\t }\n\t\n\t this.currentOpen = null;\n\t\n\t this.loading = false;\n\t\n\t this.container = container;\n\t\n\t /**\n\t * Default Options\n\t */\n\t this.options = {\n\t classNames: 'modal',\n\t closeOnEscape: true,\n\t closeOnBackgroundClick: true,\n\t destroyOnFinish: false,\n\t fixedContainer: true,\n\t containerClassNames: ''\n\t };\n\t\n\t Object.assign(this.options, options);\n\t\n\t // Container where events are delegated\n\t this.eventContainer = null;\n\t this.eventFunction = null;\n\t\n\t this.dataMainPageContainer = global.document.body;\n\t\n\t this.currentScrollTop = 0;\n\t\n\t this.modalContainer = null;\n\t\n\t // Destroy full modal instance when no dialogs are bind to?\n\t // Otherwise container is recycled\n\t this.destroyOnFinish = this.options.destroyOnFinish;\n\t }\n\t\n\t /**\n\t * Removes this modal from global stack\n\t * Will handle fixing main html element too\n\t * @private\n\t * @param n\n\t */\n\t\n\t\n\t _createClass(Modal, [{\n\t key: '_removeModalFromStack',\n\t value: function _removeModalFromStack(n) {\n\t var t = Modal._modalInstances.indexOf(n);\n\t if (t > -1) {\n\t Modal._modalInstances.splice(t, 1);\n\t _FixedWindow2.default.getInstance().close();\n\t HTML_ELEMENT.classList.remove(CLS_MODAL_OPEN);\n\t }\n\t }\n\t\n\t /**\n\t * Modal container that contains all `stacked` modals for this instance\n\t * @returns {HTMLElement}\n\t */\n\t\n\t }, {\n\t key: 'getModalContainer',\n\t value: function getModalContainer() {\n\t return this.modalContainer;\n\t }\n\t\n\t /**\n\t * Closes the current open modal of this stack\n\t * @params [e], optional event\n\t * @returns {*}\n\t */\n\t\n\t }, {\n\t key: 'close',\n\t value: function close(e) {\n\t var self = this;\n\t\n\t var options = self.currentOpen ? _Util2.default.applyOptionsFromElement(self.currentOpen, _Util2.default.copy(self.options)) : self.options;\n\t\n\t // close only on keyboard if instance should\n\t if (!options.closeOnEscape && e instanceof KeyboardEvent) {\n\t return false;\n\t }\n\t\n\t // close only on background if instance should\n\t if (!options.closeOnBackgroundClick && e && e.type === _Settings2.default.getTabEvent() && !e.target.hasAttribute(ATTR_CLOSE)) {\n\t return false;\n\t }\n\t\n\t // if an instance is currently loading, prevent from closing\n\t if (self.loading) {\n\t return false;\n\t }\n\t\n\t if (e) {\n\t e.preventDefault();\n\t }\n\t\n\t if (self.currentOpen) {\n\t // dispatch beforeClose event, if prevented prevent modal from closing\n\t var ev = _Event2.default.dispatchAndFire(self.currentOpen, EVENT_MODAL_BEFORE_CLOSED);\n\t if (ev.defaultPrevented) {\n\t return false;\n\t }\n\t\n\t this._finishState(self.currentOpen);\n\t // if there is an previous modal\n\t if (self.currentOpen.prevModal) {\n\t // switch to the next modal\n\t return self.switchModals(self.currentOpen.prevModal, self.currentOpen.prevModal.prevModal || null);\n\t }\n\t\n\t // finally trigger closed event\n\t _Event2.default.dispatch(self.currentOpen, EVENT_MODAL_CLOSED).withOriginal(e).fire();\n\t }\n\t self._removeModalFromStack(self.currentOpen);\n\t\n\t // Full stack closed:\n\t self.currentOpen = null;\n\t if (self.modalContainer) {\n\t // setup next open\n\t var lastContainer = Modal._modalInstances[Modal._modalInstances.length - 1],\n\t classList = self.modalContainer.classList;\n\t classList.remove(CLS_CONTAINER_CURRENT);\n\t classList.remove(CLS_OPEN);\n\t // Remove all current classes from child-nodes\n\t for (var i = 0; i < self.modalContainer.childNodes.length; i++) {\n\t var node = self.modalContainer.childNodes[i],\n\t cl = node.classList;\n\t // remove applied styles\n\t self._finishState(node);\n\t cl.remove(CLS_CURRENT);\n\t cl.remove(CLS_PART_OF_STACK);\n\t }\n\t if (lastContainer) {\n\t lastContainer.parentNode.classList.add(CLS_CONTAINER_CURRENT);\n\t }\n\t }\n\t\n\t if (self.destroyOnFinish) {\n\t self.destroy();\n\t }\n\t return self;\n\t }\n\t\n\t /**\n\t * Resets a target when newly initilizes\n\t * @param target\n\t * @private\n\t */\n\t\n\t }, {\n\t key: '_finishState',\n\t value: function _finishState(target) {\n\t target.classList.remove(CLS_ANIM_END);\n\t }\n\t\n\t /**\n\t * Handler called when a Modal has finished an animation\n\t * @param e\n\t * @param self\n\t * @private\n\t */\n\t\n\t }, {\n\t key: '_finishAnim',\n\t value: function _finishAnim(e, self) {\n\t e.target.classList.add(CLS_ANIM_END);\n\t e.target.removeEventListener(e.type, self, true);\n\t }\n\t\n\t /**\n\t * Brings the given modal to front\n\t * @param co\n\t * @param last\n\t */\n\t\n\t }, {\n\t key: 'switchModals',\n\t value: function switchModals(co, last) {\n\t co.prevModal = last;\n\t Modal._modalInstances.push(co);\n\t _FixedWindow2.default.getInstance().open(this, this.modalContainer);\n\t if (last) {\n\t this._finishState(last);\n\t _Util2.default.prefixedAnimateEvent(last, 'AnimationEnd', this._finishAnim);\n\t last.classList.add(CLS_PART_OF_STACK);\n\t }\n\t // set new currentOpen\n\t this.currentOpen = co;\n\t\n\t // bring current container to the front\n\t var instances = Modal._modalInstances;\n\t\n\t for (var m = 0; m < instances.length; m++) {\n\t instances[m].parentNode.classList.remove(CLS_CONTAINER_CURRENT);\n\t }\n\t this.modalContainer.classList.add(CLS_CONTAINER_CURRENT);\n\t // remove animations if animations has been completed, fixes various bugs:\n\t // - fixes nested scrolling element issue in iOS Browsers / Mobile-Safari\n\t _Util2.default.prefixedAnimateEvent(co, 'AnimationEnd', this._finishAnim);\n\t\n\t for (var i = 0; i < this.modalContainer.childNodes.length; i++) {\n\t var n = this.modalContainer.childNodes[i],\n\t isCurrent = n.classList.contains(CLS_CURRENT);\n\t if (n === co) {\n\t co.classList.add(CLS_CURRENT);\n\t co.classList.remove(CLS_PART_OF_STACK);\n\t this._finishState(co);\n\t } else {\n\t n.classList.remove(CLS_CURRENT);\n\t if (isCurrent) {\n\t this._removeModalFromStack(n);\n\t _Event2.default.dispatchAndFire(n, EVENT_MODAL_CLOSED);\n\t }\n\t }\n\t }\n\t }\n\t }, {\n\t key: 'handleScrollbar',\n\t value: function handleScrollbar() {\n\t if (Modal._modalInstances.length === 0) {\n\t HTML_ELEMENT.classList.add(CLS_MODAL_OPEN);\n\t }\n\t }\n\t\n\t /**\n\t * Creates a Modal and opens it (later)\n\t * @param e\n\t * @returns {Promise|boolean}\n\t */\n\t\n\t }, {\n\t key: 'createWidget',\n\t value: function createWidget(e) {\n\t var self = this;\n\t if (this.loading) {\n\t return false;\n\t }\n\t\n\t // check if another modal has registered events on this dom path:\n\t if (e && e.target) {\n\t var foundInstance = _Util2.default.parentsUntil(e.target, function (node) {\n\t return node && node.flexModalInstance;\n\t });\n\t\n\t // if another instance has been found, abort\n\t if (foundInstance !== this.container) {\n\t return false;\n\t }\n\t }\n\t var targetContent,\n\t future,\n\t widget,\n\t target,\n\t hasTarget = true,\n\t isHtmlElement = e instanceof HTMLElement,\n\t isWidget = _Widget2.default.isWidget(e);\n\t if (isHtmlElement || isWidget) {\n\t if (isHtmlElement) {\n\t targetContent = e;\n\t } else {\n\t widget = e;\n\t targetContent = widget.element;\n\t }\n\t } else {\n\t target = e.target;\n\t if (!target) {\n\t throw 'Could not find target, did you pass an event, a HTMLElement or an Widget?';\n\t }\n\t hasTarget = target.hasAttribute(ATTR_NAME);\n\t targetContent = target.getAttribute(ATTR_NAME);\n\t widget = _Widget2.default.findWidget(target);\n\t if (target.hasAttribute(ATTR_CREATE_NEW) && !e.newInstance) {\n\t var newInstance = new Modal(this.container).setDestroyOnFinish(true);\n\t e.newInstance = true;\n\t newInstance.fromEvent(e).then(function () {\n\t newInstance.registerEvents(newInstance.getModalContainer());\n\t });\n\t return false;\n\t }\n\t if (hasTarget) {\n\t e.stopImmediatePropagation();\n\t e.preventDefault();\n\t }\n\t }\n\t\n\t if (!hasTarget) {\n\t return false;\n\t }\n\t\n\t var modalContainerClasses = this.modalContainer ? this.modalContainer.classList : [];\n\t\n\t // lazy create modal container\n\t if (!this.modalContainer) {\n\t this.modalContainer = global.document.createElement('div');\n\t this.modalContainer.className = CLS_MODAL_CONTAINER + ' ' + this.options.containerClassNames + ' ' + CLS_OPEN;\n\t var closeModalFunction = function closeModalFunction(ce) {\n\t if (self.loading) {\n\t return false;\n\t }\n\t if (_Util2.default.isPartOfNode(ce.target, self.currentOpen)) {\n\t if (!ce.target.hasAttribute(ATTR_CLOSE)) {\n\t return false;\n\t }\n\t }\n\t self.close(ce);\n\t };\n\t\n\t this.modalContainer.addEventListener(_Settings2.default.getTabEvent(), closeModalFunction, false);\n\t\n\t modalContainerClasses = this.modalContainer.classList;\n\t this.container.appendChild(this.modalContainer);\n\t } else {\n\t modalContainerClasses.add(CLS_OPEN);\n\t }\n\t\n\t var loader = void 0,\n\t doc = global.document,\n\t toggleLoader = function toggleLoader(show) {\n\t if (show) {\n\t loader = doc.createElement('div');\n\t loader.className = CLS_LOADER_CONTAINER;\n\t var loaderLoader = doc.createElement('div');\n\t loaderLoader.className = CLS_LOADER;\n\t loader.appendChild(loaderLoader);\n\t self.modalContainer.appendChild(loader);\n\t } else {\n\t loader.parentNode.removeChild(loader);\n\t }\n\t };\n\t\n\t this.handleScrollbar();\n\t\n\t modalContainerClasses.add(CLS_CONTAINER_CURRENT);\n\t modalContainerClasses.add('loading');\n\t this.loading = true;\n\t toggleLoader(true);\n\t var async = widget ? widget.getAsync() : null;\n\t if (_Widget2.default.isWidget(widget) && async) {\n\t future = async.then(function (r) {\n\t var result;\n\t if (r instanceof HTMLElement || r instanceof DocumentFragment) {\n\t result = r;\n\t } else {\n\t // Create container Element:\n\t var element = doc.createElement('div');\n\t element.className = self.options.classNames;\n\t element.innerHTML = r;\n\t element.id = _Util2.default.guid();\n\t result = element;\n\t }\n\t widget.finalContent = result;\n\t _Event2.default.dispatchAndFire(target, EVENT_MODAL_ASYNC_TARGET_LOADED);\n\t return result;\n\t });\n\t } else {\n\t var el = targetContent instanceof HTMLElement || targetContent instanceof DocumentFragment ? targetContent : doc.getElementById(targetContent);\n\t if (el) {\n\t future = new Promise(function (resolve) {\n\t resolve(el);\n\t });\n\t } else {\n\t throw 'Could not found given modal element (content) with ID: ' + targetContent;\n\t }\n\t }\n\t\n\t _Event2.default.dispatchAndFire(target, EVENT_MODAL_INIT);\n\t\n\t return future.then(function (thisEl) {\n\t thisEl.hfWidgetInstance = self;\n\t self.modalContainer.appendChild(thisEl);\n\t modalContainerClasses.remove('loading');\n\t self.loading = false;\n\t toggleLoader(false);\n\t\n\t self.open(thisEl, true, e);\n\t\n\t return thisEl;\n\t });\n\t }\n\t\n\t /**\n\t * Open's an already rendered modal\n\t * @param {HTMLElement} modal\n\t * @param {Boolean} [internal], set to true to prevent container management\n\t * @param {Boolean} [maybeEvent], optional event-object that triggered open\n\t */\n\t\n\t }, {\n\t key: 'open',\n\t value: function open(modal, internal, maybeEvent) {\n\t\n\t if (!internal) {\n\t this.modalContainer.classList.add('open');\n\t this.handleScrollbar();\n\t }\n\t this.switchModals(modal, this.currentOpen);\n\t\n\t _Event2.default.dispatch(modal, EVENT_MODAL_OPENED).withOriginal(maybeEvent).fire();\n\t }\n\t }, {\n\t key: 'registerEvents',\n\t value: function registerEvents(delegate) {\n\t var delegateContainer = delegate || this.container,\n\t self = this;\n\t // Modals should always be fixed\n\t _FixedWindow2.default.getInstance().addScreenConstraint(Modal, function (width) {\n\t return true;\n\t });\n\t // register modal instance so we can detect multiple registrars\n\t delegateContainer.flexModalInstance = self;\n\t self.eventFunction = function () {\n\t self.createWidget.apply(self, arguments);\n\t };\n\t delegateContainer.addEventListener(_Settings2.default.getTabEvent(), self.eventFunction, false);\n\t\n\t self.eventContainer = delegateContainer;\n\t return self;\n\t }\n\t\n\t /**\n\t * Creates a new Dialog Instance either directly from HTML Element or a Widget instance\n\t * @param {HTMLElement|Widget} widget instance or html element\n\t * @returns {Promise}\n\t */\n\t\n\t }, {\n\t key: 'fromWidget',\n\t value: function fromWidget(widget) {\n\t return this.createWidget(widget);\n\t }\n\t\n\t /**\n\t * Creates a Widget from event\n\t * @param e\n\t * @returns {Promise}\n\t */\n\t\n\t }, {\n\t key: 'fromEvent',\n\t value: function fromEvent(e) {\n\t return this.createWidget(e);\n\t }\n\t }, {\n\t key: 'setDestroyOnFinish',\n\t value: function setDestroyOnFinish(v) {\n\t this.destroyOnFinish = v;\n\t return this;\n\t }\n\t\n\t /**\n\t * Destroy this widget instance, cleans empty DOM nodes\n\t * Will use fast MutationObserver if available, otherwise falls back to DOMNodeRemoved event\n\t */\n\t\n\t }, {\n\t key: 'destroy',\n\t value: function destroy() {\n\t var self = this,\n\t modalContainer = this.modalContainer;\n\t var isEmptyContainer = modalContainer.childNodes.length === 0;\n\t // Remove event listener on destroy, do not remove DOM node\n\t if (self.eventContainer) {\n\t self.eventContainer.removeEventListener(_Settings2.default.getTabEvent(), self.eventFunction, true);\n\t }\n\t\n\t if (isEmptyContainer) {\n\t if (modalContainer.parentNode) {\n\t modalContainer.parentNode.removeChild(modalContainer);\n\t }\n\t }\n\t if (global.MutationObserver) {\n\t var observer = new MutationObserver(function (mutations) {\n\t mutations.forEach(function () {\n\t if (isEmptyContainer) {\n\t modalContainer.parentNode.removeChild(modalContainer);\n\t observer.disconnect();\n\t }\n\t });\n\t });\n\t observer.observe(modalContainer, { childList: true });\n\t } else {\n\t modalContainer.addEventListener('DOMNodeRemoved', function (e) {\n\t if (e.target !== modalContainer && modalContainer.childNodes.length - 1 === 0) {\n\t modalContainer.parentNode.removeChild(modalContainer);\n\t }\n\t });\n\t }\n\t }\n\t }]);\n\t\n\t return Modal;\n\t}();\n\t\n\t// Static variable that keeps track of all open modals\n\t\n\t\n\tModal._modalInstances = [];\n\t\n\t// Global keydown listener for modal\n\tglobal.addEventListener('keydown', function (e) {\n\t if (e.keyCode === KEY_ESC) {\n\t var lastModal = Modal._modalInstances[Modal._modalInstances.length - 1];\n\t if (lastModal) {\n\t _Widget2.default.findWidget(lastModal).close(e);\n\t }\n\t }\n\t});\n\t\n\texports.default = Modal;\n\t/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))\n\n/***/ },\n/* 9 */,\n/* 10 */\n/***/ function(module, exports) {\n\n\t\"use strict\";\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\texports.default = function (fn, ms) {\n\t return function () {\n\t clearTimeout(fn.timeout);\n\t fn.timeout = setTimeout(fn, ms);\n\t };\n\t};\n\n/***/ },\n/* 11 */,\n/* 12 */,\n/* 13 */,\n/* 14 */,\n/* 15 */,\n/* 16 */,\n/* 17 */,\n/* 18 */,\n/* 19 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _Modal = __webpack_require__(8);\n\t\n\tvar _Modal2 = _interopRequireDefault(_Modal);\n\t\n\tvar _Settings = __webpack_require__(2);\n\t\n\tvar _Settings2 = _interopRequireDefault(_Settings);\n\t\n\tvar _Widget = __webpack_require__(4);\n\t\n\tvar _Widget2 = _interopRequireDefault(_Widget);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\t// default export as component object\n\texports.default = {\n\t Modal: _Modal2.default,\n\t Settings: _Settings2.default,\n\t Widget: _Widget2.default\n\t};\n\n/***/ }\n/******/ ])\n});\n;\n\n\n/** WEBPACK FOOTER **\n ** js/modal.min.js\n **/"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"../\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n/** WEBPACK FOOTER **\n ** webpack/bootstrap a32af781d3d6caa30484\n **/","/*\n * The MIT License (MIT)\n *\n * Copyright (c) 2015 David Heidrich, BowlingX \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nconst PFX = [\"webkit\", \"moz\", \"MS\", \"o\", \"\"];\n\nconst COL_LEFT_CLASS = 'is-collision-left';\n\nconst COL_RIGHT_CLASS = 'is-collision-right';\n\nconst COL_BOTTOM_CLASS = 'is-collision-bottom';\n\n/**\n * Provides shared DOM-Utility functions\n */\nclass Util {\n\n /**\n * Will register the right animation event based on browser\n * @param element\n * @param type\n * @param callback\n */\n static prefixedAnimateEvent(element, type, callback) {\n const thisFunction = function thisFunction(e) {\n callback.apply(element, [e, thisFunction]);\n };\n\n for (let p = 0; p < PFX.length; p++) {\n let thisType = type;\n if (!PFX[p]) {\n thisType = type.toLowerCase();\n }\n const name = PFX[p] + thisType;\n element.addEventListener(name, thisFunction, true);\n }\n }\n\n /**\n * Get correct transitionend event\n * @returns {String}\n * @private\n */\n static whichTransitionEndEvent() {\n let t;\n const el = document.createElement('fake');\n\n const transitions = {\n transition: 'transitionend',\n OTransition: 'oTransitionEnd',\n MozTransition: 'transitionend',\n WebkitTransition: 'webkitTransitionEnd'\n };\n\n for (t in transitions) {\n if (el.style[t] !== undefined) {\n return transitions[t];\n }\n }\n }\n\n /**\n * Check if target is part of parent node\n * @param target\n * @param parent\n * @returns {boolean}\n */\n static isPartOfNode(target, parent) {\n if (!target || !parent) {\n return false;\n }\n let now = target;\n while (now !== parent && now !== null) {\n if (now === parent) {\n break;\n }\n now = now.parentNode;\n }\n return now !== null;\n }\n\n /**\n * Finds the closest element including itself matching a callback\n * @param {Node} el\n * @param {Function} callback\n * @returns {Node|boolean}\n */\n static closestCallback(el, callback) {\n let element = el;\n while (element !== null) {\n if (callback(element)) {\n return element;\n }\n element = element.parentNode;\n }\n return false;\n }\n\n /**\n * Walks the tree until func returns true for given argument\n * @param target\n * @param func\n * @returns {boolean|HTMLElement}\n */\n static parentsUntil(target, func) {\n if (!target) {\n return false;\n }\n let now = target;\n while (!func(now) && now !== null) {\n now = now.parentNode;\n }\n\n return now;\n }\n\n /**\n * Generates a unique id\n * @return {String}\n */\n static guid() {\n function s4() {\n return Math.floor((1 + Math.random()) * 0x10000)\n .toString(16)\n .substring(1);\n }\n\n return `${s4() + s4()}-${s4()}-${s4()}-${s4()}-${s4() + s4() + s4()}`;\n }\n\n /**\n * Detects scrollbar width\n * @see http://stackoverflow.com/questions/986937/how-can-i-get-the-browsers-scrollbar-sizes\n * @returns {number}\n */\n static getScrollBarWidth() {\n const doc = global.document;\n const inner = doc.createElement('p');\n\n inner.style.width = \"100%\";\n inner.style.height = \"200px\";\n\n const outer = doc.createElement('div');\n outer.style.position = \"absolute\";\n outer.style.top = \"0px\";\n outer.style.left = \"0px\";\n outer.style.visibility = \"hidden\";\n outer.style.width = \"200px\";\n outer.style.height = \"150px\";\n outer.style.overflow = \"hidden\";\n outer.appendChild(inner);\n\n doc.body.appendChild(outer);\n const w1 = inner.offsetWidth;\n outer.style.overflow = 'scroll';\n let w2 = inner.offsetWidth;\n if (w1 === w2) {\n w2 = outer.clientWidth;\n }\n doc.body.removeChild(outer);\n\n return (w1 - w2);\n }\n\n\n /**\n * Run an event once\n * @param {String} ev\n * @param {HTMLElement|HTMLDocument} target\n * @param {Function} func\n * @param {boolean} [capture]\n * @return Function created listener\n */\n static addEventOnce(ev, target, func, capture) {\n const thisFunction = function thisFunction(event) {\n func(event, func);\n target.removeEventListener(ev, thisFunction, capture);\n };\n target.addEventListener(ev, thisFunction, capture);\n return thisFunction;\n }\n\n /**\n * Checks if an element is visible\n * @param {HTMLElement} element\n * @returns bool\n */\n static isVisible(element) {\n return element.offsetWidth > 0 && element.offsetHeight > 0;\n }\n\n /**\n * Creates a camelCaseRepresentation of a dashed string\n * @param {String} str\n * @returns String\n */\n static dashToCamelCase(str) {\n return str.replace(/-([a-z])/g, (g) => {\n return g[1].toUpperCase();\n });\n }\n\n /**\n * Creates a copy of `input`\n * @param {*} input\n * @return *\n */\n static copy(input) {\n return JSON.parse(JSON.stringify(input));\n }\n\n /**\n * Reads options from element (data attributes) and applies to base\n * @param {HTMLElement} element\n * @param {Object} base\n * @return {Object}\n */\n static applyOptionsFromElement(element, base) {\n if (!element) {\n return base;\n }\n const attrs = element.attributes;\n for (let i = 0; i < attrs.length; i++) {\n const attr = attrs[i];\n if (attr) {\n const s = Util.dashToCamelCase(attr.nodeName.replace('data-', ''));\n const val = attr.nodeValue;\n if (base.hasOwnProperty(s)) {\n // skip functions\n if (typeof base[s] === 'function') {\n continue;\n }\n if (typeof base[s] === 'boolean') {\n base[s] = parseInt(val || 1, 10) === 1;\n } else {\n base[s] = val;\n }\n }\n }\n }\n return base;\n }\n\n /**\n * Will position an element directly at given target\n * Is aware of a given collision container to detect edges\n * Will put elementToPosition either to left, center or right edge (prefer right)\n * and either to bottom or top (prefers bottom)\n *\n * You may overwrite preferred positioned with `centerHorizontal` and `positionTop`\n *\n * @param {HTMLElement|ClientRect} target the target container to align to\n * @param {HTMLElement} elementToPosition the element to position\n * @param {HTMLElement} collisionContainer the outer container to prevent collisions\n * @param {boolean} [centerHorizontal] set true to center element, otherwise it's put on the right border by default\n * @param {boolean} [positionTop] flip top, by default element is positioned to the bottom.\n * @returns {HTMLElement}\n */\n static setupPositionNearby(target, elementToPosition, collisionContainer, centerHorizontal, positionTop) {\n // determine relative offsets\n let amountTop = 0;\n let amountLeft = 0;\n Util.parentsUntil(target.parentNode, (el) => {\n if (!(el instanceof HTMLElement)) {\n return false;\n }\n const style = window.getComputedStyle(el);\n if (Util.isPartOfNode(elementToPosition, el)) {\n if (style && style.position === 'relative') {\n amountTop += el.offsetTop || 0;\n amountLeft += el.offsetLeft || 0;\n }\n return false;\n }\n return true;\n });\n\n const targetPosition = target instanceof HTMLElement ? target.getBoundingClientRect() : target;\n const elementRect = elementToPosition.getBoundingClientRect();\n const colRect = collisionContainer.getBoundingClientRect();\n const targetTop = targetPosition.top - amountTop;\n const targetRight = targetPosition.right;\n const isCollisionTop = (targetTop - elementRect.height) <= 0;\n const isCollisionBottom =\n window.innerHeight < (targetTop + amountTop + targetPosition.height + elementRect.height);\n const isCollisionLeft = targetRight < elementRect.width;\n const targetLeft = targetPosition.left;\n const isCollisionRight = (targetLeft + elementRect.width) > colRect.width;\n const classList = elementToPosition.classList;\n\n classList.remove(COL_RIGHT_CLASS);\n classList.remove(COL_LEFT_CLASS);\n classList.remove(COL_BOTTOM_CLASS);\n\n let calcTop;\n let calcLeft;\n if (isCollisionLeft && !isCollisionRight) {\n // put element to left if collision with left\n calcLeft = `${(targetPosition.left - colRect.left - amountLeft)}px`;\n classList.add(COL_LEFT_CLASS);\n } else {\n // maybe center if no collision with either side\n const rightPosition = `${(targetRight - elementRect.width - colRect.left - amountLeft)}px`;\n const leftCentered = ((targetLeft + targetPosition.width / 2) -\n (elementRect.width / 2) || 0) - colRect.left;\n const collisionCentered = (leftCentered + elementRect.width) > colRect.width;\n if (centerHorizontal && !collisionCentered) {\n calcLeft = `${leftCentered}px`;\n } else {\n classList.add(COL_RIGHT_CLASS);\n calcLeft = rightPosition;\n }\n }\n\n if (isCollisionBottom || (positionTop && !isCollisionTop)) {\n // Put Element on top if collision\n calcTop = `${(targetTop - elementRect.height) - colRect.top}px`;\n classList.add(COL_BOTTOM_CLASS);\n } else {\n calcTop = `${(targetTop + targetPosition.height) - colRect.top}px`;\n }\n\n elementToPosition.style.cssText = `top:${calcTop};left:${calcLeft};`;\n\n return elementToPosition;\n }\n\n /**\n * Brings a given element into viewport\n * @param {HTMLElement} el\n * @param {int|function}[optionalOffset]\n */\n static scrollToElement(el, optionalOffset) {\n el.scrollIntoView();\n let thisOffset = optionalOffset;\n // optionally use a additional scrollDif\n if (thisOffset) {\n if (typeof thisOffset === 'function') {\n thisOffset = optionalOffset();\n }\n if (thisOffset > 0) {\n const scrolledY = window.pageYOffset;\n if (scrolledY) {\n window.scroll(0, scrolledY - thisOffset);\n }\n }\n }\n }\n}\n\nexport default Util;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/main/util/Util.js\n **/","/*\n * The MIT License (MIT)\n *\n * Copyright (c) 2015 David Heidrich, BowlingX \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\nimport Util from './Util';\n\n// we attach global settings to global once because settings might be shared a lot of times trough the application\n// Maybe find a better way to handle that scenario\nif (!global.FLEXCSS_GLOBAL_SETTINGS) {\n global.FLEXCSS_GLOBAL_SETTINGS = {\n // defined breakpoint for small devices < n\n smallBreakpoint: 768,\n // nodes that should be updated when no scrollbar is expected\n scrollbarUpdateNodes: global.document.body !== null ? [global.document.body] : [],\n // additional Delay until darkener is fully hidden\n darkenerFadeDelay: 100,\n // class that is added if canvas has been toggled\n canvasToggledClass: 'toggled-canvas'\n };\n\n global.FLEXCSS_CONST_IS_IOS = null;\n\n global.FLEXCSS_CONST_IS_TOUCH = null;\n\n global.FLEXCSS_CONST_IS_IE = null;\n\n global.FLEXCSS_CONST_TAB_EVENT = 'click';\n\n global.FLEXCSS_IS_SMALL_SCREEN = false;\n\n const init = () => {\n // Measure scrollbar width\n global.FLEXCSS_CONST_SCROLLBAR_WIDTH = Util.getScrollBarWidth();\n // detect right transition end event\n global.FLEXCSS_CONST_TRANSITION_EVENT = Util.whichTransitionEndEvent();\n };\n\n if (global.document.readyState !== 'loading') {\n init();\n } else {\n // it's possible that global.document.body is not available if the document is not\n // loaded completely\n document.addEventListener('DOMContentLoaded', () => {\n init();\n });\n }\n}\n\n/**\n * Utility class that setups global settings\n */\nclass Settings {\n\n /**\n * Setup global settings, overwrite default values\n * @param {Object} settings\n */\n static setup(settings) {\n Object.assign(global.FLEXCSS_GLOBAL_SETTINGS, settings);\n }\n\n /**\n * Access to global settings\n * @returns {Object}\n */\n static get() {\n return global.FLEXCSS_GLOBAL_SETTINGS;\n }\n\n /**\n * Detects a IOS Device, caches subsequent calls\n * @returns {boolean}\n */\n static isIosDevice() {\n if (!global.FLEXCSS_CONST_IS_IOS) {\n global.FLEXCSS_CONST_IS_IOS = global.navigator.userAgent.match(/(iPad|iPhone|iPod)/i);\n }\n\n return global.FLEXCSS_CONST_IS_IOS;\n }\n\n /**\n * @returns {boolean}\n */\n static isSmallScreen() {\n return window.innerWidth < Settings.get().smallBreakpoint;\n }\n\n /**\n * Detects a touch device, caches subsequent calls\n * @returns {boolean}\n */\n static isTouchDevice() {\n if (!global.FLEXCSS_CONST_IS_TOUCH) {\n global.FLEXCSS_CONST_IS_TOUCH = 'ontouchstart' in window || !!(global.navigator.msMaxTouchPoints);\n }\n return global.FLEXCSS_CONST_IS_TOUCH;\n }\n\n /**\n * Checks if current browser is Internet Explorer\n * @returns {boolean|*}\n */\n static isIE() {\n if (!global.FLEXCSS_CONST_IS_IE) {\n global.FLEXCSS_CONST_IS_IE = \"ActiveXObject\" in window;\n }\n return global.FLEXCSS_CONST_IS_IE;\n }\n\n /**\n * @returns {String}\n */\n static getTransitionEvent() {\n return global.FLEXCSS_CONST_TRANSITION_EVENT;\n }\n\n /**\n * @returns {int}\n */\n static getScrollbarWidth() {\n return global.FLEXCSS_CONST_SCROLLBAR_WIDTH;\n }\n\n /**\n * @returns {String}\n */\n static getTabEvent() {\n return global.FLEXCSS_CONST_TAB_EVENT;\n }\n}\n\nexport default Settings;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/main/util/Settings.js\n **/","/* global CustomEvent */\n\n/*\n * The MIT License (MIT)\n *\n * Copyright (c) 2015 David Heidrich, BowlingX \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n// polyfill for custom events to make thinks work in IE\n// The needed polyfill is so small that I embedded it here\n(function poly() {\n if (!global.CustomEvent || typeof global.CustomEvent !== 'function') {\n const CustomEvent = function CustomEvent(event, params) {\n const thisParams = params ||\n {\n bubbles: false,\n cancelable: false,\n detail: undefined\n };\n const evt = document.createEvent(\"CustomEvent\");\n evt.initCustomEvent(event, thisParams.bubbles,\n thisParams.cancelable, thisParams.detail);\n return evt;\n };\n CustomEvent.prototype = global.Event.prototype;\n global.CustomEvent = CustomEvent;\n }\n})();\n/**\n * Simpler Event dispatching\n */\nclass EventHandler {\n\n /**\n * @param {HTMLElement} target\n * @param {String} name\n */\n constructor(target, name) {\n this.target = target;\n this.defaultOptions = {\n bubbles: true,\n cancelable: true\n };\n\n this.name = name;\n }\n\n /**\n * Set more options\n * @param {Object} options\n * @returns {EventHandler}\n */\n withOptions(options) {\n Object.assign(this.defaultOptions, (options || {}));\n return this;\n }\n\n /**\n * Call with the originalEvent\n * @param {Event} e\n * @returns {EventHandler}\n */\n withOriginal(e) {\n return this.withDetail({\n originalEvent: e\n });\n }\n\n /**\n * Extends the detail part of the event\n * @param {Object} o\n * @returns {EventHandler}\n */\n withDetail(o) {\n if (!this.defaultOptions.detail) {\n this.defaultOptions.detail = {};\n }\n Object.assign(this.defaultOptions.detail, o);\n return this;\n }\n\n /**\n * @returns {CustomEvent}\n */\n fire() {\n const e = new CustomEvent(this.name, this.defaultOptions);\n if (this.target) {\n this.target.dispatchEvent(e);\n }\n return e;\n }\n}\n\nclass Event {\n /**\n * Prepares to dispatch a custom event (without firing)\n * @param {HTMLElement} target\n * @param {String} name\n * @returns {EventHandler}\n */\n static dispatch(target, name) {\n return new EventHandler(target, name);\n }\n\n /**\n * Dispatches a custom event and fires it directly\n * @param {HTMLElement} target\n * @param {String} name\n * @param {Object} [options]\n * @returns {CustomEvent}\n */\n static dispatchAndFire(target, name, options) {\n return new EventHandler(target, name).withOptions(options).fire();\n }\n}\n\nexport default Event;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/main/util/Event.js\n **/","/*\n * The MIT License (MIT)\n *\n * Copyright (c) 2015 David Heidrich, BowlingX \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n/*!\n * FlexCss.Widget\n * Licensed under the MIT License (MIT)\n * Copyright (c) 2015 David Heidrich, BowlingX \n */\n\n/**\n * A Widget provides async content on a specific target (e.g. a modal link)\n */\nclass Widget {\n\n /**\n * Creates a new Widget\n * @param [element], optional define the content of widget\n */\n constructor(element) {\n /**\n *\n * @type {Promise}\n */\n this.asyncContent = null;\n\n /**\n * @type {boolean}\n */\n this._isWidget = true;\n\n if (element) {\n /**\n * @type {HTMLElement}\n */\n this.element = element instanceof HTMLElement ? element : global.document.getElementById(element);\n if (this.element) {\n this.element.hfWidgetInstance = this;\n this.setAsync(() => {\n return new Promise((s) => {\n s(this.element);\n });\n });\n } else {\n throw new Error(`Could not found element with ID: ${element}`);\n }\n }\n /**\n * The final resulted content that a widget did create (e.g. a modal container)\n * @type {HTMLElement}\n */\n this.finalContent = null;\n }\n\n /**\n *\n * @returns {Promise}\n */\n getAsync() {\n return this.asyncContent();\n }\n\n /**\n * @param {Function.} async\n * @returns {Widget}\n */\n setAsync(async) {\n this.asyncContent = async;\n return this;\n }\n\n /**\n * @returns {HTMLElement}\n */\n getFinalContent() {\n return this.finalContent;\n }\n\n /**\n * @param {HTMLElement} element\n * @returns {Widget}\n */\n setElement(element) {\n this.element = element;\n return this;\n }\n\n /**\n * Destroys the generated content of this widget\n * @returns {boolean}\n */\n destroy() {\n if (this.finalContent && this.finalContent.parentNode) {\n this.finalContent.parentNode.removeChild(this.finalContent);\n return true;\n }\n\n delete this.element;\n delete this.asyncContent;\n delete this.finalContent;\n\n return false;\n }\n\n /**\n * Will find a widget on an Element\n * @param {HTMLElement} element\n * @returns {Widget|undefined}\n */\n static findWidget(element) {\n return element ? element.hfWidgetInstance : undefined;\n }\n\n /**\n * Checks if a given object is an instance\n * @param {Object} self\n * @returns {boolean}\n */\n static isWidget(self) {\n return self instanceof Widget || typeof self === 'object' && self.hasOwnProperty('_isWidget');\n }\n}\n\nexport default Widget;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/main/Widget.js\n **/","import Settings from '../util/Settings';\nimport debounce from './debounce';\nimport Event from '../util/Event';\nimport Util from '../util/Util';\n\nconst CLS_FIXED_WINDOW = 'fixed-window-open';\n\nexport const EVENT_BEFORE_FIXED_ADD = 'flexcss.fixedWindow.beforeAdd';\nexport const EVENT_AFTER_FIXED_REMOVE = 'flexcss.fixedWindow.afterRemove';\n\n/**\n * @type {FixedWindow}\n */\nlet fixedWindowInstance;\n\nexport default class FixedWindow {\n\n constructor() {\n this.widgets = [];\n this.currentScrollTop = 0;\n this.fixedScreenConstraints = [];\n this.windowWidth = 0;\n this.isFixedWindowActive = false;\n this.touchListener = null;\n }\n\n /**\n * Adds a constraint to detect if the window needs to be changed when the screensize changes\n *\n * @param {Function} widget\n * @param {Function} fixedBreakpointFn gets a width argument, return true to open a window\n */\n addScreenConstraint(widget, fixedBreakpointFn) {\n this.fixedScreenConstraints[widget] = fixedBreakpointFn;\n }\n\n /**\n * @returns {null|DestroyableWidget}\n */\n getCurrentWidget() {\n return this.widgets.length > 0 ? this.widgets[this.widgets.length - 1] : null;\n }\n\n /**\n * @private\n */\n _checkFixedNeeded() {\n if (this.widgets.length === 0) {\n return;\n }\n const widgets = new Set(this.widgets);\n const widgetsThatRequireFixedWindow = Array.from(widgets).some(({ widget }) => {\n return this.fixedScreenConstraints[widget] && this.fixedScreenConstraints[widget](this.windowWidth);\n });\n if (!widgetsThatRequireFixedWindow) {\n this._removeFixedContainer();\n } else {\n this._addFixedContainer();\n }\n }\n\n /**\n * @private\n */\n _addFixedContainer() {\n if (this.isFixedWindowActive) {\n return;\n }\n Event.dispatchAndFire(global.document, EVENT_BEFORE_FIXED_ADD, {\n detail: this.getCurrentWidget()\n });\n // this causes layout and should be optimized\n // At lest we write in a batch later\n Settings.get().scrollbarUpdateNodes.map((n) => {\n let foundProperty = 'paddingRight';\n let direction = 1;\n let node = n;\n if (n instanceof Array) {\n const [whatNode, property, d] = n;\n foundProperty = property;\n node = whatNode;\n direction = d || 1;\n }\n return {\n node,\n property: foundProperty,\n value: `${parseInt(global.getComputedStyle(node)[foundProperty], 10) +\n (!node.__fixedWindowMod__ ? (Settings.getScrollbarWidth() * direction) : 0)}px`\n };\n }).forEach((d) => {\n d.node.__fixedWindowMod__ = true;\n d.node.style[d.property] = d.value;\n });\n\n this.touchListener = (e) => {\n e.preventDefault();\n };\n\n let shouldNotMove = false;\n this.touchStartListener = (e) => {\n const { element } = this.getCurrentWidget();\n if (Util.isPartOfNode(e.target, element)) {\n if (element.scrollTop === 0) {\n element.scrollTop = 1;\n shouldNotMove = true;\n } else if (element.scrollHeight === element.scrollTop + element.offsetHeight) {\n shouldNotMove = true;\n element.scrollTop -= 1;\n }\n }\n };\n\n global.addEventListener('touchmove', this.touchListener);\n global.document.body.addEventListener('touchstart', this.touchStartListener);\n\n this.touchMoveListener = (e) => {\n const { element } = this.getCurrentWidget();\n if (Util.isPartOfNode(e.target, element)) {\n if (!shouldNotMove) {\n e.stopImmediatePropagation();\n }\n shouldNotMove = false;\n }\n };\n global.document.body.addEventListener('touchmove', this.touchMoveListener);\n\n global.document.documentElement.classList.add(CLS_FIXED_WINDOW);\n this.isFixedWindowActive = true;\n }\n\n /**\n * @private\n */\n _removeFixedContainer() {\n if (this.isFixedWindowActive) {\n // cleanup event listeners\n global.removeEventListener('touchmove', this.touchListener);\n global.document.body.removeEventListener('touchstart', this.touchStartListener);\n global.document.body.removeEventListener('touchmove', this.touchMoveListener);\n\n // reset scrollbar nodes\n Settings.get().scrollbarUpdateNodes.forEach((node) => {\n if (node instanceof Array) {\n const [whatNode, property] = node;\n delete whatNode.__fixedWindowMod__;\n whatNode.style[property] = '';\n } else {\n delete node.__fixedWindowMod__;\n node.style.paddingRight = '';\n }\n });\n global.document.documentElement.classList.remove(CLS_FIXED_WINDOW);\n Event.dispatchAndFire(global.document, EVENT_AFTER_FIXED_REMOVE);\n this.isFixedWindowActive = false;\n }\n }\n\n /**\n * Will close a window when no widgets are opened that need one\n */\n resizeListener() {\n this.windowWidth = global.innerWidth;\n this._checkFixedNeeded();\n }\n\n /**\n * @returns {FixedWindow}\n */\n static getInstance() {\n if (!fixedWindowInstance) {\n fixedWindowInstance = new FixedWindow();\n fixedWindowInstance.windowWidth = global.innerWidth;\n const eventHandler = fixedWindowInstance.resizeListener.bind(fixedWindowInstance);\n global.addEventListener(\n 'resize',\n debounce(eventHandler, 500)\n );\n global.addEventListener('orientationchange', eventHandler);\n }\n return fixedWindowInstance;\n }\n\n /**\n * Request a close of the fixed window\n */\n close() {\n this.widgets.pop();\n if (this.widgets.length === 0) {\n this._removeFixedContainer();\n }\n }\n\n /**\n * Request to open a fixed windows\n * @param {Object|DestroyableWidget} instance\n * @param {HTMLElement} element\n */\n open(instance, element) {\n let fixed = false;\n if (typeof instance === 'object') {\n const widget = instance.constructor;\n const fixedWidget = this.fixedScreenConstraints[instance.constructor];\n if (widget && fixedWidget) {\n fixed = fixedWidget(this.windowWidth);\n }\n const length = this.widgets.length;\n this.widgets.push(\n {\n widget,\n element\n }\n );\n // open a new window if there is no window active\n if (length === 0) {\n if (fixed) {\n this._addFixedContainer();\n }\n }\n }\n }\n}\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/main/lib/FixedWindow.js\n **/","/*\n * The MIT License (MIT)\n *\n * Copyright (c) 2015 David Heidrich, BowlingX \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n/*!\n * FlexCss.Modal\n * Licensed under the MIT License (MIT)\n * Copyright (c) 2015 David Heidrich, BowlingX \n */\n\n/* global KeyboardEvent */\n\nimport Settings from './util/Settings';\nimport Event from './util/Event';\nimport Util from './util/Util';\nimport Widget from './Widget';\nimport FixedWindow from './lib/FixedWindow';\n\nconst HTML_ELEMENT = global.document.documentElement;\nconst KEY_ESC = 27;\n/* Attribute Names */\nconst ATTR_CREATE_NEW = 'data-new-instance';\nconst ATTR_CLOSE = 'data-close-modal';\nconst ATTR_NAME = 'data-modal';\n\n/* Class names */\nconst CLS_CONTAINER_CURRENT = 'front';\nconst CLS_OPEN = 'open';\nconst CLS_CURRENT = 'current';\nconst CLS_PART_OF_STACK = 'part-of-stack';\nconst CLS_MODAL_OPEN = 'modal-open';\nconst CLS_MODAL_CONTAINER = 'modal-container';\nconst CLS_ANIM_END = 'modal-anim-end';\nconst CLS_LOADER_CONTAINER = 'loader-container';\nconst CLS_LOADER = 'loader';\n\n/* Events */\n\n/**\n * Event triggered when modal is closed\n * @type {string}\n */\nexport const EVENT_MODAL_CLOSED = 'flexcss.modal.closed';\n/**\n * Event triggered before a modal is closed, cancelable\n * @type {string}\n */\nexport const EVENT_MODAL_BEFORE_CLOSED = 'flexcss.modal.beforeClose';\n/**\n * Event triggered when a modal is opened\n * @type {string}\n */\nexport const EVENT_MODAL_OPENED = 'flexcss.modal.opened';\n\n/**\n * Event triggered when modal is initilized, called on target\n * @type {string}\n */\nexport const EVENT_MODAL_INIT = 'flexcss.modal.init';\n\n/**\n * Triggered when the content of an async modal on a target is loaded, called on target\n * @type {string}\n */\nexport const EVENT_MODAL_ASYNC_TARGET_LOADED = 'flexcss.modal.asyncTargetLoaded';\n\n/**\n * A Modal Implementation\n */\nclass Modal {\n constructor(DelegateContainer, options) {\n const doc = global.document;\n const container = DelegateContainer instanceof HTMLElement ?\n DelegateContainer : doc.getElementById(DelegateContainer);\n\n // Instance vars:\n if (!container) {\n throw new Error(`Could not found container element by given ID/Element: ${DelegateContainer}`);\n }\n\n this.currentOpen = null;\n\n this.loading = false;\n\n this.container = container;\n\n /**\n * Default Options\n */\n this.options = {\n classNames: 'modal',\n closeOnEscape: true,\n closeOnBackgroundClick: true,\n destroyOnFinish: false,\n fixedContainer: true,\n containerClassNames: ''\n };\n\n Object.assign(this.options, options);\n\n // Container where events are delegated\n this.eventContainer = null;\n this.eventFunction = null;\n\n this.dataMainPageContainer = global.document.body;\n\n this.currentScrollTop = 0;\n\n this.modalContainer = null;\n\n // Destroy full modal instance when no dialogs are bind to?\n // Otherwise container is recycled\n this.destroyOnFinish = this.options.destroyOnFinish;\n }\n\n /**\n * Removes this modal from global stack\n * Will handle fixing main html element too\n * @private\n * @param n\n */\n _removeModalFromStack(n) {\n const t = Modal._modalInstances.indexOf(n);\n if (t > -1) {\n Modal._modalInstances.splice(t, 1);\n FixedWindow.getInstance().close();\n HTML_ELEMENT.classList.remove(CLS_MODAL_OPEN);\n }\n }\n\n\n /**\n * Modal container that contains all `stacked` modals for this instance\n * @returns {HTMLElement}\n */\n getModalContainer() {\n return this.modalContainer;\n }\n\n /**\n * Closes the current open modal of this stack\n * @params [e], optional event\n * @returns {*}\n */\n close(e) {\n const self = this;\n\n const options = self.currentOpen ? Util.applyOptionsFromElement(\n self.currentOpen, Util.copy(self.options)) : self.options;\n\n // close only on keyboard if instance should\n if (!options.closeOnEscape && e instanceof KeyboardEvent) {\n return false;\n }\n\n // close only on background if instance should\n if (!options.closeOnBackgroundClick && e &&\n e.type === Settings.getTabEvent() && !e.target.hasAttribute(ATTR_CLOSE)) {\n return false;\n }\n\n // if an instance is currently loading, prevent from closing\n if (self.loading) {\n return false;\n }\n\n if (e) {\n e.preventDefault();\n }\n\n if (self.currentOpen) {\n // dispatch beforeClose event, if prevented prevent modal from closing\n var ev = Event.dispatchAndFire(self.currentOpen, EVENT_MODAL_BEFORE_CLOSED);\n if (ev.defaultPrevented) {\n return false;\n }\n\n this._finishState(self.currentOpen);\n // if there is an previous modal\n if (self.currentOpen.prevModal) {\n // switch to the next modal\n return self.switchModals(self.currentOpen.prevModal,\n self.currentOpen.prevModal.prevModal || null);\n }\n\n // finally trigger closed event\n Event.dispatch(self.currentOpen, EVENT_MODAL_CLOSED).withOriginal(e).fire();\n\n }\n self._removeModalFromStack(self.currentOpen);\n\n // Full stack closed:\n self.currentOpen = null;\n if (self.modalContainer) {\n // setup next open\n var lastContainer = Modal._modalInstances[Modal._modalInstances.length - 1],\n classList = self.modalContainer.classList;\n classList.remove(CLS_CONTAINER_CURRENT);\n classList.remove(CLS_OPEN);\n // Remove all current classes from child-nodes\n for (var i = 0; i < self.modalContainer.childNodes.length; i++) {\n var node = self.modalContainer.childNodes[i], cl = node.classList;\n // remove applied styles\n self._finishState(node);\n cl.remove(CLS_CURRENT);\n cl.remove(CLS_PART_OF_STACK);\n }\n if (lastContainer) {\n lastContainer.parentNode.classList.add(CLS_CONTAINER_CURRENT);\n }\n }\n\n if (self.destroyOnFinish) {\n self.destroy();\n }\n return self;\n }\n\n /**\n * Resets a target when newly initilizes\n * @param target\n * @private\n */\n _finishState(target) {\n target.classList.remove(CLS_ANIM_END);\n }\n\n /**\n * Handler called when a Modal has finished an animation\n * @param e\n * @param self\n * @private\n */\n _finishAnim(e, self) {\n e.target.classList.add(CLS_ANIM_END);\n e.target.removeEventListener(e.type, self, true);\n }\n\n /**\n * Brings the given modal to front\n * @param co\n * @param last\n */\n switchModals(co, last) {\n co.prevModal = last;\n Modal._modalInstances.push(co);\n FixedWindow.getInstance().open(this, this.modalContainer);\n if (last) {\n this._finishState(last);\n Util.prefixedAnimateEvent(last, 'AnimationEnd', this._finishAnim);\n last.classList.add(CLS_PART_OF_STACK);\n }\n // set new currentOpen\n this.currentOpen = co;\n\n // bring current container to the front\n var instances = Modal._modalInstances;\n\n for (var m = 0; m < instances.length; m++) {\n instances[m].parentNode.classList.remove(CLS_CONTAINER_CURRENT);\n }\n this.modalContainer.classList.add(CLS_CONTAINER_CURRENT);\n // remove animations if animations has been completed, fixes various bugs:\n // - fixes nested scrolling element issue in iOS Browsers / Mobile-Safari\n Util.prefixedAnimateEvent(co, 'AnimationEnd', this._finishAnim);\n\n for (var i = 0; i < this.modalContainer.childNodes.length; i++) {\n var n = this.modalContainer.childNodes[i], isCurrent = n.classList.contains(CLS_CURRENT);\n if (n === co) {\n co.classList.add(CLS_CURRENT);\n co.classList.remove(CLS_PART_OF_STACK);\n this._finishState(co);\n } else {\n n.classList.remove(CLS_CURRENT);\n if (isCurrent) {\n this._removeModalFromStack(n);\n Event.dispatchAndFire(n, EVENT_MODAL_CLOSED);\n }\n }\n }\n }\n\n handleScrollbar() {\n if (Modal._modalInstances.length === 0) {\n HTML_ELEMENT.classList.add(CLS_MODAL_OPEN);\n }\n }\n\n /**\n * Creates a Modal and opens it (later)\n * @param e\n * @returns {Promise|boolean}\n */\n createWidget(e) {\n var self = this;\n if (this.loading) {\n return false;\n }\n\n // check if another modal has registered events on this dom path:\n if (e && e.target) {\n var foundInstance = Util.parentsUntil(e.target, function (node) {\n return node && node.flexModalInstance;\n });\n\n // if another instance has been found, abort\n if (foundInstance !== this.container) {\n return false;\n }\n }\n var targetContent, future, widget, target, hasTarget = true,\n isHtmlElement = e instanceof HTMLElement, isWidget = Widget.isWidget(e);\n if (isHtmlElement || isWidget) {\n if (isHtmlElement) {\n targetContent = e;\n } else {\n widget = e;\n targetContent = widget.element;\n }\n } else {\n target = e.target;\n if (!target) {\n throw 'Could not find target, did you pass an event, a HTMLElement or an Widget?';\n }\n hasTarget = target.hasAttribute(ATTR_NAME);\n targetContent = target.getAttribute(ATTR_NAME);\n widget = Widget.findWidget(target);\n if (target.hasAttribute(ATTR_CREATE_NEW) && !e.newInstance) {\n var newInstance = new Modal(this.container)\n .setDestroyOnFinish(true);\n e.newInstance = true;\n newInstance.fromEvent(e).then(function () {\n newInstance.registerEvents(newInstance.getModalContainer());\n });\n return false;\n }\n if (hasTarget) {\n e.stopImmediatePropagation();\n e.preventDefault();\n }\n }\n\n if (!hasTarget) {\n return false;\n }\n\n let modalContainerClasses = this.modalContainer ? this.modalContainer.classList : [];\n\n // lazy create modal container\n if (!this.modalContainer) {\n this.modalContainer = global.document.createElement('div');\n this.modalContainer.className = `${CLS_MODAL_CONTAINER} ${this.options.containerClassNames} ${CLS_OPEN}`;\n const closeModalFunction = function (ce) {\n if (self.loading) {\n return false;\n }\n if (Util.isPartOfNode(ce.target, self.currentOpen)) {\n if (!ce.target.hasAttribute(ATTR_CLOSE)) {\n return false;\n }\n }\n self.close(ce);\n };\n\n this.modalContainer.addEventListener(Settings.getTabEvent(), closeModalFunction, false);\n\n modalContainerClasses = this.modalContainer.classList;\n this.container.appendChild(this.modalContainer);\n\n } else {\n modalContainerClasses.add(CLS_OPEN);\n }\n\n let loader, doc = global.document, toggleLoader = function (show) {\n if (show) {\n loader = doc.createElement('div');\n loader.className = CLS_LOADER_CONTAINER;\n var loaderLoader = doc.createElement('div');\n loaderLoader.className = CLS_LOADER;\n loader.appendChild(loaderLoader);\n self.modalContainer.appendChild(loader);\n } else {\n loader.parentNode.removeChild(loader);\n }\n };\n\n this.handleScrollbar();\n\n modalContainerClasses.add(CLS_CONTAINER_CURRENT);\n modalContainerClasses.add('loading');\n this.loading = true;\n toggleLoader(true);\n var async = widget ? widget.getAsync() : null;\n if (Widget.isWidget(widget) && async) {\n future = async.then(function (r) {\n var result;\n if (r instanceof HTMLElement || r instanceof DocumentFragment) {\n result = r;\n } else {\n // Create container Element:\n var element = doc.createElement('div');\n element.className = self.options.classNames;\n element.innerHTML = r;\n element.id = Util.guid();\n result = element;\n }\n widget.finalContent = result;\n Event.dispatchAndFire(target, EVENT_MODAL_ASYNC_TARGET_LOADED);\n return result;\n });\n } else {\n var el = targetContent instanceof HTMLElement ||\n targetContent instanceof DocumentFragment ? targetContent : doc.getElementById(targetContent);\n if (el) {\n future = new Promise((resolve) => {\n resolve(el);\n });\n } else {\n throw 'Could not found given modal element (content) with ID: ' + targetContent;\n }\n }\n\n Event.dispatchAndFire(target, EVENT_MODAL_INIT);\n\n return future.then((thisEl) => {\n thisEl.hfWidgetInstance = self;\n self.modalContainer.appendChild(thisEl);\n modalContainerClasses.remove('loading');\n self.loading = false;\n toggleLoader(false);\n\n self.open(thisEl, true, e);\n\n return thisEl;\n });\n }\n\n /**\n * Open's an already rendered modal\n * @param {HTMLElement} modal\n * @param {Boolean} [internal], set to true to prevent container management\n * @param {Boolean} [maybeEvent], optional event-object that triggered open\n */\n open(modal, internal, maybeEvent) {\n\n\n if (!internal) {\n this.modalContainer.classList.add('open');\n this.handleScrollbar();\n }\n this.switchModals(modal, this.currentOpen);\n\n Event.dispatch(modal, EVENT_MODAL_OPENED).withOriginal(maybeEvent).fire();\n }\n\n\n registerEvents(delegate) {\n var delegateContainer = delegate || this.container, self = this;\n // Modals should always be fixed\n FixedWindow.getInstance().addScreenConstraint(Modal, (width) => true);\n // register modal instance so we can detect multiple registrars\n delegateContainer.flexModalInstance = self;\n self.eventFunction = function () {\n self.createWidget.apply(self, arguments);\n };\n delegateContainer.addEventListener(Settings.getTabEvent(), self.eventFunction, false);\n\n self.eventContainer = delegateContainer;\n return self;\n }\n\n\n /**\n * Creates a new Dialog Instance either directly from HTML Element or a Widget instance\n * @param {HTMLElement|Widget} widget instance or html element\n * @returns {Promise}\n */\n fromWidget(widget) {\n return this.createWidget(widget);\n }\n\n /**\n * Creates a Widget from event\n * @param e\n * @returns {Promise}\n */\n fromEvent(e) {\n return this.createWidget(e);\n }\n\n setDestroyOnFinish(v) {\n this.destroyOnFinish = v;\n return this;\n }\n\n /**\n * Destroy this widget instance, cleans empty DOM nodes\n * Will use fast MutationObserver if available, otherwise falls back to DOMNodeRemoved event\n */\n destroy() {\n let self = this, modalContainer = this.modalContainer;\n const isEmptyContainer = modalContainer.childNodes.length === 0;\n // Remove event listener on destroy, do not remove DOM node\n if (self.eventContainer) {\n self.eventContainer.removeEventListener(Settings.getTabEvent(), self.eventFunction, true);\n }\n\n if (isEmptyContainer) {\n if (modalContainer.parentNode) {\n modalContainer.parentNode.removeChild(modalContainer);\n }\n }\n if (global.MutationObserver) {\n var observer = new MutationObserver(function (mutations) {\n mutations.forEach(function () {\n if (isEmptyContainer) {\n modalContainer.parentNode.removeChild(modalContainer);\n observer.disconnect();\n }\n });\n });\n observer.observe(modalContainer, {childList: true});\n } else {\n modalContainer.addEventListener('DOMNodeRemoved', function (e) {\n if (e.target !== modalContainer && (modalContainer.childNodes.length - 1) === 0) {\n modalContainer.parentNode.removeChild(modalContainer);\n }\n });\n }\n }\n}\n\n\n// Static variable that keeps track of all open modals\nModal._modalInstances = [];\n\n// Global keydown listener for modal\nglobal.addEventListener('keydown', function (e) {\n if (e.keyCode === KEY_ESC) {\n var lastModal = Modal._modalInstances[Modal._modalInstances.length - 1];\n if (lastModal) {\n Widget.findWidget(lastModal).close(e);\n }\n }\n});\n\nexport default Modal;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/main/Modal.js\n **/","export default (fn, ms) => () => {\n clearTimeout(fn.timeout);\n fn.timeout = setTimeout(fn, ms);\n};\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/main/lib/debounce.js\n **/","'use strict';\n\nimport Modal from '../Modal';\nimport Settings from '../util/Settings';\nimport Widget from '../Widget';\n\n// default export as component object\nexport default {\n Modal,\n Settings,\n Widget\n};\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/main/modules/Modal.js\n **/"],"sourceRoot":""} \ No newline at end of file