(function e(n,t,i){function u(r,e){var s,h,o;if(!t[r]){if(!n[r]){if(s=typeof require=="function"&&require,!e&&s)return s(r,!0);if(f)return f(r,!0);h=new Error("Cannot find module '"+r+"'");throw h.code="MODULE_NOT_FOUND",h;}o=t[r]={exports:{}};n[r][0].call(o.exports,function(t){var i=n[r][1][t];return u(i?i:t)},o,o.exports,e,n,t,i)}return t[r].exports}for(var f=typeof require=="function"&&require,r=0;r<i.length;r++)u(i[r]);return u})({1:[function(n,t,i){"use strict";function f(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function");}var r,u;Object.defineProperty(i,"__esModule",{value:!0});r=function(){function n(n,t){for(var i,r=0;r<t.length;r++)i=t[r],i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(n,i.key,i)}return function(t,i,r){return i&&n(t.prototype,i),r&&n(t,r),t}}();u=function(){function n(){f(this,n)}return r(n,null,[{key:"bake",value:function(){document.cookie="smartbanner_exited=1"}},{key:"unbake",value:function(){document.cookie="smartbanner_exited=; expires=Thu, 01 Jan 1970 00:00:01 GMT;"}},{key:"baked",get:function(){var n=document.cookie.replace(/(?:(?:^|.*;\s*)smartbanner_exited\s*\=\s*([^;]*).*$)|^.*$/,"$1");return n==="1"}}]),n}();i.default=u},{}],2:[function(n,t,i){(function(n){"use strict";function u(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function");}var t,r;Object.defineProperty(i,"__esModule",{value:!0});t=function(){function n(n,t){for(var i,r=0;r<t.length;r++)i=t[r],i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(n,i.key,i)}return function(t,i,r){return i&&n(t.prototype,i),r&&n(t,r),t}}();r=function(){function i(){u(this,i)}return t(i,null,[{key:"platform",value:function(){return/iPhone|iPad|iPod/i.test(window.navigator.userAgent)?"ios":/Android/i.test(window.navigator.userAgent)?"android":void 0}},{key:"userAgentMatchesRegex",value:function(n){return new RegExp(n).test(window.navigator.userAgent)}},{key:"jQueryMobilePage",value:function(){return typeof n.$!="undefined"&&n.$.mobile!=="undefined"&&document.querySelector(".ui-page")!==null}},{key:"wrapperElement",value:function(){var n=i.jQueryMobilePage()?".ui-page":"html";return document.querySelectorAll(n)}}]),i}();i.default=r}).call(this,typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],3:[function(n){"use strict";function u(n){return n&&n.__esModule?n:{"default":n}}var i=n("./smartbanner.js"),r=u(i),t=void 0;window.addEventListener("load",function(){t=new r.default;t.publish()})},{"./smartbanner.js":7}],4:[function(n,t,i){"use strict";function f(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function");}function e(n){return n.indexOf("smartbanner:")!==-1&&n.split(":")[1].length>0}function o(n){var t=n.split("-");return t.map(function(n,i){i>0&&(t[i]=n.charAt(0).toUpperCase()+n.substring(1))}),t.join("")}var r,u;Object.defineProperty(i,"__esModule",{value:!0});r=function(){function n(n,t){for(var i,r=0;r<t.length;r++)i=t[r],i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(n,i.key,i)}return function(t,i,r){return i&&n(t.prototype,i),r&&n(t,r),t}}();n("./polyfills/array/from.js");n("./polyfills/array/includes.js");u=function(){function n(){f(this,n)}return r(n,[{key:"parse",value:function(){var i=document.getElementsByTagName("meta"),t={},n=null;return Array.from(i).forEach(function(i){var r=i.getAttribute("name"),u=i.getAttribute("content");r&&u&&e(r)&&u.length>0&&(n=r.split(":")[1],Array.from(n).includes("-")&&(n=o(n)),t[n]=u)}),t}}]),n}();i.default=u},{"./polyfills/array/from.js":5,"./polyfills/array/includes.js":6}],5:[function(){"use strict";Array.from||(Array.from=function(){var t=Object.prototype.toString,n=function(n){return typeof n=="function"||t.call(n)==="[object Function]"},i=function(n){var t=Number(n);return isNaN(t)?0:t===0||!isFinite(t)?t:(t>0?1:-1)*Math.floor(Math.abs(t))},r=Math.pow(2,53)-1,u=function(n){var t=i(n);return Math.min(Math.max(t,0),r)};return function(t){var h=this,c=Object(t),i,o;if(t==null)throw new TypeError("Array.from requires an array-like object - not null or undefined");if(i=arguments.length>1?arguments[1]:void undefined,typeof i!="undefined"){if(!n(i))throw new TypeError("Array.from: when provided, the second argument must be a function");arguments.length>2&&(o=arguments[2])}for(var f=u(c.length),s=n(h)?Object(new h(f)):new Array(f),r=0,e;r<f;)e=c[r],s[r]=i?typeof o=="undefined"?i(e,r):i.call(o,e,r):e,r+=1;return s.length=f,s}}())},{}],6:[function(){"use strict";Array.prototype.includes||(Array.prototype.includes=function(n){var f,i,r,t,u;if(this==null)throw new TypeError("Array.prototype.includes called on null or undefined");if(f=Object(this),i=parseInt(f.length,10)||0,i===0)return!1;for(r=parseInt(arguments[1],10)||0,r>=0?t=r:(t=i+r,t<0&&(t=0));t<i;){if(u=f[t],n===u||n!==n&&u!==u)return!0;t++}return!1})},{}],7:[function(n,t,i){"use strict";function f(n){return n&&n.__esModule?n:{"default":n}}function w(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function");}function b(n,t){t.exit();n.preventDefault()}function s(n){this.positioningDisabled||h(n.data.height)}function k(n){var t=document.querySelector(".js_smartbanner__exit");if(t.addEventListener("click",function(t){return b(t,n)}),r.default.jQueryMobilePage())$(document).on("pagebeforeshow",n,s)}function d(){r.default.jQueryMobilePage()&&$(document).off("pagebeforeshow",s)}function h(n){for(var o=r.default.wrapperElement(),t,f,e,i=0,s=o.length;i<s;i++)if(t=o[i],r.default.jQueryMobilePage()){if(t.getAttribute(u.originalTop))continue;f=parseFloat(getComputedStyle(t).top);t.setAttribute(u.originalTop,isNaN(f)?0:f);t.style.top=n+"px"}else{if(t.getAttribute(u.originalMarginTop))continue;e=parseFloat(getComputedStyle(t).marginTop);t.setAttribute(u.originalMarginTop,isNaN(e)?0:e);t.style.marginTop=n+"px"}}function g(){for(var i=r.default.wrapperElement(),n,t=0,f=i.length;t<f;t++)n=i[t],r.default.jQueryMobilePage()&&n.getAttribute(u.originalTop)?n.style.top=n.getAttribute(u.originalTop)+"px":n.getAttribute(u.originalMarginTop)&&(n.style.marginTop=n.getAttribute(u.originalMarginTop)+"px")}var o,u,c;Object.defineProperty(i,"__esModule",{value:!0});var l=function(){function n(n,t){for(var i,r=0;r<t.length;r++)i=t[r],i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(n,i.key,i)}return function(t,i,r){return i&&n(t.prototype,i),r&&n(t,r),t}}(),a=n("./optionparser.js"),v=f(a),y=n("./detector.js"),r=f(y),p=n("./bakery.js"),e=f(p);o="android,ios";u={originalTop:"data-smartbanner-original-top",originalMarginTop:"data-smartbanner-original-margin-top"};c=function(){function n(){w(this,n);var t=new v.default;this.options=t.parse();this.platform=r.default.platform()}return l(n,[{key:"publish",value:function(){if(Object.keys(this.options).length===0)throw new Error("No options detected. Please consult documentation.");if(e.default.baked||this.userAgentExcluded||!(this.platformEnabled||this.userAgentIncluded))return!1;var n=document.createElement("div");document.querySelector("body").appendChild(n);n.outerHTML=this.html;this.positioningDisabled||h(this.height);k(this)}},{key:"exit",value:function(){d();this.positioningDisabled||g();var n=document.querySelector(".js_smartbanner");document.querySelector("body").removeChild(n);e.default.bake()}},{key:"originalTop",get:function(){var n=r.default.wrapperElement()[0];return parseFloat(n.getAttribute(u.originalTop))}},{key:"originalTopMargin",get:function(){var n=r.default.wrapperElement()[0];return parseFloat(n.getAttribute(u.originalMarginTop))}},{key:"priceSuffix",get:function(){return this.platform==="ios"?this.options.priceSuffixApple:this.platform==="android"?this.options.priceSuffixGoogle:""}},{key:"icon",get:function(){return this.platform==="android"?this.options.iconGoogle:this.options.iconApple}},{key:"buttonUrl",get:function(){return this.platform==="android"?this.options.buttonUrlGoogle:this.platform==="ios"?this.options.buttonUrlApple:"#"}},{key:"html",get:function(){return'<div class="smartbanner smartbanner--'+this.platform+' js_smartbanner">\n      <a href="javascript:void();" class="smartbanner__exit js_smartbanner__exit"><\/a>\n      <div class="smartbanner__icon" style="background-image: url('+this.icon+');"><\/div>\n      <div class="smartbanner__info">\n        <div>\n          <div class="smartbanner__info__title">'+this.options.title+'<\/div>\n          <div class="smartbanner__info__author">'+this.options.author+'<\/div>\n          <div class="smartbanner__info__price">'+this.options.price+this.priceSuffix+'<\/div>\n        <\/div>\n      <\/div>\n      <a href="'+this.buttonUrl+'" target="_blank" class="smartbanner__button"><span class="smartbanner__button__label">'+this.options.button+"<\/span><\/a>\n    <\/div>"}},{key:"height",get:function(){var n=document.querySelector(".js_smartbanner").offsetHeight;return n!==undefined?n:0}},{key:"platformEnabled",get:function(){var n=this.options.enabledPlatforms||o;return n&&n.replace(/\s+/g,"").split(",").indexOf(this.platform)!==-1}},{key:"positioningDisabled",get:function(){return this.options.disablePositioning==="true"}},{key:"userAgentExcluded",get:function(){return this.options.excludeUserAgentRegex?r.default.userAgentMatchesRegex(this.options.excludeUserAgentRegex):!1}},{key:"userAgentIncluded",get:function(){return this.options.includeUserAgentRegex?r.default.userAgentMatchesRegex(this.options.includeUserAgentRegex):!1}}]),n}();i.default=c},{"./bakery.js":1,"./detector.js":2,"./optionparser.js":4}]},{},[3])