smartbanner-ts
Advanced tools
Comparing version 1.2.3 to 1.2.4
@@ -0,0 +0,0 @@ import type { smartbannerOptions } from '../interfaces/smartbannerOptions'; |
export { SmartBanner } from './components/smartbanner'; | ||
export type { smartbannerOptions } from './interfaces/smartbannerOptions'; |
@@ -0,0 +0,0 @@ export interface smartbannerOptions { |
@@ -1,1 +0,1 @@ | ||
!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,{__assign:function(){return i},__asyncDelegator:function(){return w},__asyncGenerator:function(){return _},__asyncValues:function(){return O},__await:function(){return v},__awaiter:function(){return f},__classPrivateFieldGet:function(){return T},__classPrivateFieldIn:function(){return S},__classPrivateFieldSet:function(){return E},__createBinding:function(){return p},__decorate:function(){return c},__exportStar:function(){return d},__extends:function(){return o},__generator:function(){return l},__importDefault:function(){return C},__importStar:function(){return P},__makeTemplateObject:function(){return j},__metadata:function(){return s},__param:function(){return u},__read:function(){return y},__rest:function(){return a},__spread:function(){return g},__spreadArray:function(){return m},__spreadArrays:function(){return b},__values:function(){return h}});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(c){return function(u){return function(c){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,c[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,r=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==c[0]&&2!==c[0])){a=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){a.label=c[1];break}if(6===c[0]&&a.label<o[1]){a.label=o[1],o=c;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(c);break}o[2]&&a.ops.pop(),a.trys.pop();continue}c=e.call(t,a)}catch(t){c=[6,t],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}([c,u])}}}var p=Object.create?function(t,e,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(e,n);o&&!("get"in o?!e.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,o)}: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 j(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}var x=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 x(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}function S(t,e){if(null===e||"object"!=typeof e&&"function"!=typeof e)throw new TypeError("Cannot use 'in' operator on non-object");return"function"==typeof t?e===t:t.has(e)}}},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,{__assign:function(){return i},__asyncDelegator:function(){return P},__asyncGenerator:function(){return x},__asyncValues:function(){return T},__await:function(){return j},__awaiter:function(){return h},__classPrivateFieldGet:function(){return A},__classPrivateFieldIn:function(){return k},__classPrivateFieldSet:function(){return I},__createBinding:function(){return g},__decorate:function(){return c},__esDecorate:function(){return s},__exportStar:function(){return b},__extends:function(){return o},__generator:function(){return y},__importDefault:function(){return B},__importStar:function(){return S},__makeTemplateObject:function(){return E},__metadata:function(){return d},__param:function(){return u},__propKey:function(){return l},__read:function(){return m},__rest:function(){return a},__runInitializers:function(){return f},__setFunctionName:function(){return p},__spread:function(){return _},__spreadArray:function(){return O},__spreadArrays:function(){return w},__values:function(){return v}});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,n,r,o,i){function a(t){if(void 0!==t&&"function"!=typeof t)throw new TypeError("Function expected");return t}for(var c,u=r.kind,s="getter"===u?"get":"setter"===u?"set":"value",f=!e&&t?r.static?t:t.prototype:null,l=e||(f?Object.getOwnPropertyDescriptor(f,r.name):{}),p=!1,d=n.length-1;d>=0;d--){var h={};for(var y in r)h[y]="access"===y?{}:r[y];for(var y in r.access)h.access[y]=r.access[y];h.addInitializer=function(t){if(p)throw new TypeError("Cannot add initializers after decoration has completed");i.push(a(t||null))};var g=(0,n[d])("accessor"===u?{get:l.get,set:l.set}:l[s],h);if("accessor"===u){if(void 0===g)continue;if(null===g||"object"!=typeof g)throw new TypeError("Object expected");(c=a(g.get))&&(l.get=c),(c=a(g.set))&&(l.set=c),(c=a(g.init))&&o.push(c)}else(c=a(g))&&("field"===u?o.push(c):l[s]=c)}f&&Object.defineProperty(f,r.name,l),p=!0}function f(t,e,n){for(var r=arguments.length>2,o=0;o<e.length;o++)n=r?e[o].call(t,n):e[o].call(t);return r?n:void 0}function l(t){return"symbol"==typeof t?t:"".concat(t)}function p(t,e,n){return"symbol"==typeof e&&(e=e.description?"[".concat(e.description,"]"):""),Object.defineProperty(t,"name",{configurable:!0,value:n?"".concat(n," ",e):e})}function d(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}function h(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 y(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(c){return function(u){return function(c){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,c[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,r=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==c[0]&&2!==c[0])){a=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){a.label=c[1];break}if(6===c[0]&&a.label<o[1]){a.label=o[1],o=c;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(c);break}o[2]&&a.ops.pop(),a.trys.pop();continue}c=e.call(t,a)}catch(t){c=[6,t],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}([c,u])}}}var g=Object.create?function(t,e,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(e,n);o&&!("get"in o?!e.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,o)}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]};function b(t,e){for(var n in t)"default"===n||Object.prototype.hasOwnProperty.call(e,n)||g(e,t,n)}function v(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 m(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 _(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(m(arguments[e]));return t}function w(){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 O(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 j(t){return this instanceof j?(this.v=t,this):new j(t)}function x(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 j?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 P(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:j(t[r](e)),done:!1}:o?o(e):e}:o}}function T(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e,n=t[Symbol.asyncIterator];return n?n.call(t):(t=v(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 E(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}var C=Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e};function S(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)&&g(e,t,n);return C(e,t),e}function B(t){return t&&t.__esModule?t:{default:t}}function A(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 I(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}function k(t,e){if(null===e||"object"!=typeof e&&"function"!=typeof e)throw new TypeError("Cannot use 'in' operator on non-object");return"function"==typeof t?e===t:t.has(e)}}},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:"/"})}}})()}()}(); |
{ | ||
"name": "smartbanner-ts", | ||
"version": "1.2.3", | ||
"version": "1.2.4", | ||
"description": "Smartbanner library written using TS", | ||
@@ -26,6 +26,6 @@ "author": "David Myška", | ||
"devDependencies": { | ||
"@babel/core": "^7.20.12", | ||
"@babel/core": "^7.21.3", | ||
"@babel/preset-env": "^7.20.2", | ||
"@types/node": "^18.11.18", | ||
"autoprefixer": "^10.4.13", | ||
"@types/node": "^18.15.3", | ||
"autoprefixer": "^10.4.14", | ||
"babel-loader": "^9.1.2", | ||
@@ -35,12 +35,12 @@ "core-js": "3", | ||
"css-minimizer-webpack-plugin": "^4.2.2", | ||
"mini-css-extract-plugin": "^2.7.2", | ||
"mini-css-extract-plugin": "^2.7.3", | ||
"postcss-loader": "^7.0.2", | ||
"sass": "^1.57.1", | ||
"sass": "^1.59.3", | ||
"sass-loader": "^13.2.0", | ||
"terser-webpack-plugin": "^5.3.6", | ||
"terser-webpack-plugin": "^5.3.7", | ||
"ts-loader": "^9.4.2", | ||
"ts-node": "^10.9.1", | ||
"tslib": "^2.4.1", | ||
"typescript": "^4.9.4", | ||
"webpack": "^5.75.0", | ||
"tslib": "^2.5.0", | ||
"typescript": "^4.9.5", | ||
"webpack": "^5.76.1", | ||
"webpack-cli": "^5.0.1", | ||
@@ -47,0 +47,0 @@ "webpack-dev-middleware": "^6.0.1", |
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
65599