smartbanner-ts
Advanced tools
Comparing version 1.2.0 to 1.2.1
/*! For license information please see smartbanner.min.js.LICENSE.txt */ | ||
!function(){var t={646:function(t){t.exports=function(){"use strict";function t(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)t[r]=n[r]}return t}var e={read:function(t){return t.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(t){return encodeURIComponent(t).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function n(r,o){function i(e,n,i){if("undefined"!=typeof document){"number"==typeof(i=t({},o,i)).expires&&(i.expires=new Date(Date.now()+864e5*i.expires)),i.expires&&(i.expires=i.expires.toUTCString()),e=encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape),n=r.write(n,e);var a="";for(var c in i)i[c]&&(a+="; "+c,!0!==i[c]&&(a+="="+i[c].split(";")[0]));return document.cookie=e+"="+n+a}}function a(t){if("undefined"!=typeof document&&(!arguments.length||t)){for(var n=document.cookie?document.cookie.split("; "):[],o={},i=0;i<n.length;i++){var a=n[i].split("="),c=a.slice(1).join("=");'"'===c[0]&&(c=c.slice(1,-1));try{var u=e.read(a[0]);if(o[u]=r.read(c,u),t===u)break}catch(t){}}return t?o[t]:o}}return Object.create({set:i,get:a,remove:function(e,n){i(e,"",t({},n,{expires:-1}))},withAttributes:function(e){return n(this.converter,t({},this.attributes,e))},withConverter:function(e){return n(t({},this.converter,e),this.attributes)}},{attributes:{value:Object.freeze(o)},converter:{value:Object.freeze(r)}})}return n(e,{path:"/"})}()},655:function(t,e,n){"use strict";n.r(e),n.d(e,{__extends:function(){return o},__assign:function(){return i},__rest:function(){return a},__decorate:function(){return c},__param:function(){return u},__metadata:function(){return s},__awaiter:function(){return f},__generator:function(){return l},__createBinding:function(){return p},__exportStar:function(){return d},__values:function(){return h},__read:function(){return y},__spread:function(){return g},__spreadArrays:function(){return b},__spreadArray:function(){return m},__await:function(){return v},__asyncGenerator:function(){return _},__asyncDelegator:function(){return w},__asyncValues:function(){return O},__makeTemplateObject:function(){return x},__importStar:function(){return P},__importDefault:function(){return T},__classPrivateFieldGet:function(){return C},__classPrivateFieldSet:function(){return E}});var r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)};function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var i=function(){return(i=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function a(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]])}return n}function c(t,e,n,r){var o,i=arguments.length,a=i<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var c=t.length-1;c>=0;c--)(o=t[c])&&(a=(i<3?o(a):i>3?o(e,n,a):o(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a}function u(t,e){return function(n,r){e(n,r,t)}}function s(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}function f(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{u(r.next(t))}catch(t){i(t)}}function c(t){try{u(r.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,c)}u((r=r.apply(t,e||[])).next())}))}function l(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(i){return function(c){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,c])}}}var p=Object.create?function(t,e,n,r){void 0===r&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]};function d(t,e){for(var n in t)"default"===n||Object.prototype.hasOwnProperty.call(e,n)||p(e,t,n)}function h(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function y(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}function g(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(y(arguments[e]));return t}function b(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var r=Array(t),o=0;for(e=0;e<n;e++)for(var i=arguments[e],a=0,c=i.length;a<c;a++,o++)r[o]=i[a];return r}function m(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))}function v(t){return this instanceof v?(this.v=t,this):new v(t)}function _(t,e,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,o=n.apply(t,e||[]),i=[];return r={},a("next"),a("throw"),a("return"),r[Symbol.asyncIterator]=function(){return this},r;function a(t){o[t]&&(r[t]=function(e){return new Promise((function(n,r){i.push([t,e,n,r])>1||c(t,e)}))})}function c(t,e){try{(n=o[t](e)).value instanceof v?Promise.resolve(n.value.v).then(u,s):f(i[0][2],n)}catch(t){f(i[0][3],t)}var n}function u(t){c("next",t)}function s(t){c("throw",t)}function f(t,e){t(e),i.shift(),i.length&&c(i[0][0],i[0][1])}}function w(t){var e,n;return e={},r("next"),r("throw",(function(t){throw t})),r("return"),e[Symbol.iterator]=function(){return this},e;function r(r,o){e[r]=t[r]?function(e){return(n=!n)?{value:v(t[r](e)),done:"return"===r}:o?o(e):e}:o}}function O(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e,n=t[Symbol.asyncIterator];return n?n.call(t):(t=h(t),e={},r("next"),r("throw"),r("return"),e[Symbol.asyncIterator]=function(){return this},e);function r(n){e[n]=t[n]&&function(e){return new Promise((function(r,o){(function(t,e,n,r){Promise.resolve(r).then((function(e){t({value:e,done:n})}),e)})(r,o,(e=t[n](e)).done,e.value)}))}}}function x(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}var j=Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e};function P(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&p(e,t,n);return j(e,t),e}function T(t){return t&&t.__esModule?t:{default:t}}function C(t,e,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(t):r?r.value:e.get(t)}function E(t,e,n,r,o){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!o:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?o.call(t,n):o?o.value=n:e.set(t,n),n}}},e={};function n(r){var o=e[r];if(void 0!==o)return o.exports;var i=e[r]={exports:{}};return t[r].call(i.exports,i,i.exports,n),i.exports}n.d=function(t,e){for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},function(){"use strict";var t=n(655),e=t.__importDefault(n(646));(function(){function n(e){this.config=e,this.node=null,this.storageKey="smartbanner-ts",this.storageLifeTime=2592e6,this.config=t.__assign({autoInit:!0,author:null,subTitle:null,installButton:"Install",closeButton:"Close"},this.config),(!1!==this.config.enable.android||!1!==this.config.enable.ios)&&window.navigator&&window.navigator.userAgent&&new RegExp(this.userAgents.join("|"),"i").test(window.navigator.userAgent)&&!0===this.config.autoInit&&!1===this.keepClosed&&this.run()}Object.defineProperty(n.prototype,"userAgents",{get:function(){var t=[];return!0===this.config.enable.android&&t.push("Android"),!0===this.config.enable.ios&&t.push.apply(t,["iPhone","iPad","iPod"]),t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"keepClosed",{get:function(){return!!e.default.get(this.storageKey)},enumerable:!1,configurable:!0}),n.prototype.run=function(t){void 0===t&&(t=null),null===t&&(t=new RegExp("Android","i").test(window.navigator.userAgent)?"android":"ios"),this.node=this.generateNode(t),document.body.insertBefore(this.node,document.body.firstChild)},n.prototype.generateNode=function(t){var e=this,n=document.createElement("div");n.className="smartbanner-ts is-"+t;var r=document.createElement("button");r.type="button",r.className="smartbanner-ts__close",r.title="string"==typeof this.config.closeButton?this.config.closeButton:this.config.closeButton[t],r.setAttribute("role","button"),r.setAttribute("aria-label","string"==typeof this.config.closeButton?this.config.closeButton:this.config.closeButton[t]),r.addEventListener("click",(function(){e.closeBanner()})),n.appendChild(r);var o=document.createElement("figure");o.className="smartbanner-ts__image-container",n.appendChild(o);var i=document.createElement("img");i.className="smartbanner-ts__image",i.alt="string"==typeof this.config.title?this.config.title:this.config.title[t],i.title="string"==typeof this.config.title?this.config.title:this.config.title[t],i.src="string"==typeof this.config.icon?this.config.icon:this.config.icon[t],o.appendChild(i);var a=document.createElement("div");a.className="smartbanner-ts__container",n.appendChild(a);var c=document.createElement("div");if(c.className="smartbanner-ts__title",c.innerText="string"==typeof this.config.title?this.config.title:this.config.title[t],a.appendChild(c),this.config.author){var u=document.createElement("div");u.className="smartbanner-ts__author",u.innerText="string"==typeof this.config.author?this.config.author:this.config.author[t],a.appendChild(u)}if(this.config.subTitle){var s=document.createElement("div");s.className="smartbanner-ts__subtitle",s.innerText="string"==typeof this.config.subTitle?this.config.subTitle:this.config.subTitle[t],a.appendChild(s)}var f=document.createElement("div");f.className="smartbanner-ts__price",f.innerText="string"==typeof this.config.price?this.config.price:this.config.price[t],a.appendChild(f);var l=document.createElement("a");return l.href=this.config.link[t],l.target="_blank",l.className="smartbanner-ts__install",l.setAttribute("role","button"),l.setAttribute("aria-label","string"==typeof this.config.installButton?this.config.installButton:this.config.installButton[t]),l.innerText="string"==typeof this.config.installButton?this.config.installButton:this.config.installButton[t],l.addEventListener("click",(function(){setTimeout((function(){e.closeBanner()}))})),n.appendChild(l),n},n.prototype.closeBanner=function(){if(null!==this.node){document.body.removeChild(this.node),this.node=null;var t=new Date((new Date).getTime()+this.storageLifeTime);e.default.set(this.storageKey,"1",{expires:t,path:"/"})}}})()}()}(); | ||
!function(){var t={646:function(t){t.exports=function(){"use strict";function t(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)t[r]=n[r]}return t}function e(n,r){function o(e,o,i){if("undefined"!=typeof document){"number"==typeof(i=t({},r,i)).expires&&(i.expires=new Date(Date.now()+864e5*i.expires)),i.expires&&(i.expires=i.expires.toUTCString()),e=encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var a="";for(var c in i)i[c]&&(a+="; "+c,!0!==i[c]&&(a+="="+i[c].split(";")[0]));return document.cookie=e+"="+n.write(o,e)+a}}function i(t){if("undefined"!=typeof document&&(!arguments.length||t)){for(var e=document.cookie?document.cookie.split("; "):[],r={},o=0;o<e.length;o++){var i=e[o].split("="),a=i.slice(1).join("=");try{var c=decodeURIComponent(i[0]);if(r[c]=n.read(a,c),t===c)break}catch(t){}}return t?r[t]:r}}return Object.create({set:o,get:i,remove:function(e,n){o(e,"",t({},n,{expires:-1}))},withAttributes:function(n){return e(this.converter,t({},this.attributes,n))},withConverter:function(n){return e(t({},this.converter,n),this.attributes)}},{attributes:{value:Object.freeze(r)},converter:{value:Object.freeze(n)}})}return e({read:function(t){return'"'===t[0]&&(t=t.slice(1,-1)),t.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(t){return encodeURIComponent(t).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}},{path:"/"})}()},655:function(t,e,n){"use strict";n.r(e),n.d(e,{__extends:function(){return o},__assign:function(){return i},__rest:function(){return a},__decorate:function(){return c},__param:function(){return u},__metadata:function(){return s},__awaiter:function(){return f},__generator:function(){return l},__createBinding:function(){return p},__exportStar:function(){return d},__values:function(){return h},__read:function(){return y},__spread:function(){return g},__spreadArrays:function(){return b},__spreadArray:function(){return m},__await:function(){return v},__asyncGenerator:function(){return _},__asyncDelegator:function(){return w},__asyncValues:function(){return O},__makeTemplateObject:function(){return x},__importStar:function(){return P},__importDefault:function(){return C},__classPrivateFieldGet:function(){return T},__classPrivateFieldSet:function(){return E}});var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)};function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var i=function(){return i=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},i.apply(this,arguments)};function a(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]])}return n}function c(t,e,n,r){var o,i=arguments.length,a=i<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var c=t.length-1;c>=0;c--)(o=t[c])&&(a=(i<3?o(a):i>3?o(e,n,a):o(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a}function u(t,e){return function(n,r){e(n,r,t)}}function s(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}function f(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{u(r.next(t))}catch(t){i(t)}}function c(t){try{u(r.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,c)}u((r=r.apply(t,e||[])).next())}))}function l(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(i){return function(c){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,c])}}}var p=Object.create?function(t,e,n,r){void 0===r&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]};function d(t,e){for(var n in t)"default"===n||Object.prototype.hasOwnProperty.call(e,n)||p(e,t,n)}function h(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function y(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}function g(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(y(arguments[e]));return t}function b(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var r=Array(t),o=0;for(e=0;e<n;e++)for(var i=arguments[e],a=0,c=i.length;a<c;a++,o++)r[o]=i[a];return r}function m(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))}function v(t){return this instanceof v?(this.v=t,this):new v(t)}function _(t,e,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,o=n.apply(t,e||[]),i=[];return r={},a("next"),a("throw"),a("return"),r[Symbol.asyncIterator]=function(){return this},r;function a(t){o[t]&&(r[t]=function(e){return new Promise((function(n,r){i.push([t,e,n,r])>1||c(t,e)}))})}function c(t,e){try{(n=o[t](e)).value instanceof v?Promise.resolve(n.value.v).then(u,s):f(i[0][2],n)}catch(t){f(i[0][3],t)}var n}function u(t){c("next",t)}function s(t){c("throw",t)}function f(t,e){t(e),i.shift(),i.length&&c(i[0][0],i[0][1])}}function w(t){var e,n;return e={},r("next"),r("throw",(function(t){throw t})),r("return"),e[Symbol.iterator]=function(){return this},e;function r(r,o){e[r]=t[r]?function(e){return(n=!n)?{value:v(t[r](e)),done:"return"===r}:o?o(e):e}:o}}function O(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e,n=t[Symbol.asyncIterator];return n?n.call(t):(t=h(t),e={},r("next"),r("throw"),r("return"),e[Symbol.asyncIterator]=function(){return this},e);function r(n){e[n]=t[n]&&function(e){return new Promise((function(r,o){(function(t,e,n,r){Promise.resolve(r).then((function(e){t({value:e,done:n})}),e)})(r,o,(e=t[n](e)).done,e.value)}))}}}function x(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}var j=Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e};function P(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&p(e,t,n);return j(e,t),e}function C(t){return t&&t.__esModule?t:{default:t}}function T(t,e,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(t):r?r.value:e.get(t)}function E(t,e,n,r,o){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!o:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?o.call(t,n):o?o.value=n:e.set(t,n),n}}},e={};function n(r){var o=e[r];if(void 0!==o)return o.exports;var i=e[r]={exports:{}};return t[r].call(i.exports,i,i.exports,n),i.exports}n.d=function(t,e){for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},function(){"use strict";var t=n(655),e=(0,t.__importDefault)(n(646));(function(){function n(e){this.config=e,this.node=null,this.storageKey="smartbanner-ts",this.storageLifeTime=2592e6,this.config=(0,t.__assign)({autoInit:!0,author:null,subTitle:null,installButton:"Install",closeButton:"Close"},this.config),(!1!==this.config.enable.android||!1!==this.config.enable.ios)&&window.navigator&&window.navigator.userAgent&&new RegExp(this.userAgents.join("|"),"i").test(window.navigator.userAgent)&&!0===this.config.autoInit&&!1===this.keepClosed&&this.run()}Object.defineProperty(n.prototype,"userAgents",{get:function(){var t=[];return!0===this.config.enable.android&&t.push("Android"),!0===this.config.enable.ios&&t.push.apply(t,["iPhone","iPad","iPod"]),t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"keepClosed",{get:function(){return!!e.default.get(this.storageKey)},enumerable:!1,configurable:!0}),n.prototype.run=function(t){void 0===t&&(t=null),null===t&&(t=new RegExp("Android","i").test(window.navigator.userAgent)?"android":"ios"),this.node=this.generateNode(t),document.body.insertBefore(this.node,document.body.firstChild)},n.prototype.generateNode=function(t){var e=this,n=document.createElement("div");n.className="smartbanner-ts is-"+t;var r=document.createElement("button");r.type="button",r.className="smartbanner-ts__close",r.title="string"==typeof this.config.closeButton?this.config.closeButton:this.config.closeButton[t],r.setAttribute("role","button"),r.setAttribute("aria-label","string"==typeof this.config.closeButton?this.config.closeButton:this.config.closeButton[t]),r.addEventListener("click",(function(){e.closeBanner()})),n.appendChild(r);var o=document.createElement("figure");o.className="smartbanner-ts__image-container",n.appendChild(o);var i=document.createElement("img");i.className="smartbanner-ts__image",i.alt="string"==typeof this.config.title?this.config.title:this.config.title[t],i.title="string"==typeof this.config.title?this.config.title:this.config.title[t],i.src="string"==typeof this.config.icon?this.config.icon:this.config.icon[t],o.appendChild(i);var a=document.createElement("div");a.className="smartbanner-ts__container",n.appendChild(a);var c=document.createElement("div");if(c.className="smartbanner-ts__title",c.innerText="string"==typeof this.config.title?this.config.title:this.config.title[t],a.appendChild(c),this.config.author){var u=document.createElement("div");u.className="smartbanner-ts__author",u.innerText="string"==typeof this.config.author?this.config.author:this.config.author[t],a.appendChild(u)}if(this.config.subTitle){var s=document.createElement("div");s.className="smartbanner-ts__subtitle",s.innerText="string"==typeof this.config.subTitle?this.config.subTitle:this.config.subTitle[t],a.appendChild(s)}var f=document.createElement("div");f.className="smartbanner-ts__price",f.innerText="string"==typeof this.config.price?this.config.price:this.config.price[t],a.appendChild(f);var l=document.createElement("a");return l.href=this.config.link[t],l.target="_blank",l.className="smartbanner-ts__install",l.setAttribute("role","button"),l.setAttribute("aria-label","string"==typeof this.config.installButton?this.config.installButton:this.config.installButton[t]),l.innerText="string"==typeof this.config.installButton?this.config.installButton:this.config.installButton[t],l.addEventListener("click",(function(){setTimeout((function(){e.closeBanner()}))})),n.appendChild(l),n},n.prototype.closeBanner=function(){if(null!==this.node){document.body.removeChild(this.node),this.node=null;var t=new Date((new Date).getTime()+this.storageLifeTime);e.default.set(this.storageKey,"1",{expires:t,path:"/"})}}})()}()}(); |
{ | ||
"name": "smartbanner-ts", | ||
"version": "1.2.0", | ||
"version": "1.2.1", | ||
"description": "Smartbanner library written using TS", | ||
@@ -24,26 +24,26 @@ "author": "David Myška", | ||
"dependencies": { | ||
"js-cookie": "^3.0.0", | ||
"postcss": "^8.3.6" | ||
"js-cookie": "^3.0.1", | ||
"postcss": "^8.3.7" | ||
}, | ||
"devDependencies": { | ||
"@babel/core": "^7.15.0", | ||
"@babel/preset-env": "^7.15.0", | ||
"@types/node": "^16.6.0", | ||
"autoprefixer": "^10.3.1", | ||
"@babel/core": "^7.15.5", | ||
"@babel/preset-env": "^7.15.6", | ||
"@types/node": "^16.9.6", | ||
"autoprefixer": "^10.3.5", | ||
"babel-loader": "^8.2.2", | ||
"core-js": "3", | ||
"css-loader": "^6.2.0", | ||
"css-loader": "^6.3.0", | ||
"css-minimizer-webpack-plugin": "^3.0.2", | ||
"mini-css-extract-plugin": "^2.2.0", | ||
"mini-css-extract-plugin": "^2.3.0", | ||
"postcss-loader": "^6.1.1", | ||
"sass": "^1.37.5", | ||
"sass": "^1.42.0", | ||
"sass-loader": "^12.1.0", | ||
"terser-webpack-plugin": "^5.1.4", | ||
"ts-loader": "^9.2.5", | ||
"ts-node": "^10.2.0", | ||
"terser-webpack-plugin": "^5.2.4", | ||
"ts-loader": "^9.2.6", | ||
"ts-node": "^10.2.1", | ||
"tslib": "^2.3.1", | ||
"typescript": "^4.3.5", | ||
"webpack": "^5.50.0", | ||
"webpack-cli": "^4.7.2", | ||
"webpack-dev-middleware": "^5.0.0", | ||
"typescript": "^4.4.3", | ||
"webpack": "^5.53.0", | ||
"webpack-cli": "^4.8.0", | ||
"webpack-dev-middleware": "^5.1.0", | ||
"webpack-merge": "^5.8.0" | ||
@@ -50,0 +50,0 @@ }, |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
64065
Updatedjs-cookie@^3.0.1
Updatedpostcss@^8.3.7