@abtasty/social-proof
Advanced tools
Comparing version 0.1.17-2 to 0.1.17-3
@@ -1,1 +0,1 @@ | ||
!function(){"use strict";var e=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];e.unshift("[AB Tasty Widget] "+PACKAGE+":"),console.log.apply(console,e)},t=function(e){var t=Object.prototype.hasOwnProperty;function n(e,r){return Array.isArray(e)?function(e,t){for(var r,a="",i="",s=Array.isArray(t),c=0;c<e.length;c++)(r=n(e[c]))&&(s&&t[c]&&(r=o(r)),a=a+i+r,i=" ");return a}(e,r):e&&"object"==typeof e?function(e){var n="",r="";for(var a in e)a&&e[a]&&t.call(e,a)&&(n=n+r+a,r=" ");return n}(e):e||""}function r(e){if(!e)return"";if("object"==typeof e){var n="";for(var r in e)t.call(e,r)&&(n=n+r+":"+e[r]+";");return n}return e+""}function a(e,t,n,r){return!1!==t&&null!=t&&(t||"class"!==e&&"style"!==e)?!0===t?" "+(r?e:e+'="'+e+'"'):("function"==typeof t.toJSON&&(t=t.toJSON()),"string"==typeof t||(t=JSON.stringify(t),n||-1===t.indexOf('"'))?(n&&(t=o(t))," "+e+'="'+t+'"'):" "+e+"='"+t.replace(/'/g,"'")+"'"):""}e.merge=function e(t,n){if(1===arguments.length){for(var a=t[0],i=1;i<t.length;i++)a=e(a,t[i]);return a}for(var o in n)if("class"===o){var s=t[o]||[];t[o]=(Array.isArray(s)?s:[s]).concat(n[o]||[])}else if("style"===o){var s=r(t[o]);s=s&&";"!==s[s.length-1]?s+";":s;var c=r(n[o]);c=c&&";"!==c[c.length-1]?c+";":c,t[o]=s+c}else t[o]=n[o];return t},e.classes=n,e.style=r,e.attr=a,e.attrs=function(e,i){var o="";for(var s in e)if(t.call(e,s)){var c=e[s];if("class"===s){c=n(c),o=a(s,c,!1,i)+o;continue}"style"===s&&(c=r(c)),o+=a(s,c,!1,i)}return o};var i=/["&<>]/;function o(e){var t=""+e,n=i.exec(t);if(!n)return e;var r,a,o,s="";for(r=n.index,a=0;r<t.length;r++){switch(t.charCodeAt(r)){case 34:o=""";break;case 38:o="&";break;case 60:o="<";break;case 62:o=">";break;default:continue}a!==r&&(s+=t.substring(a,r)),a=r+1,s+=o}return a!==r?s+t.substring(a,r):s}return e.escape=o,e.rethrow=function e(t,n,r,a){if(!(t instanceof Error))throw t;if(!("undefined"==typeof window&&n||a))throw t.message+=" on line "+r,t;try{a=a||require("fs").readFileSync(n,"utf8")}catch(n){e(t,null,r)}var i=3,o=a.split("\n"),s=Math.max(r-i,0),c=Math.min(o.length,r+i);var i=o.slice(s,c).map(function(e,t){var n=t+s+1;return(n==r?" > ":" ")+n+"| "+e}).join("\n");t.path=n;t.message=(n||"Pug")+":"+r+"\n"+i+"\n\n"+t.message;throw t},e}({});function n(e){var n,r="";try{var a={},i=e||{};(function(e,a,i){r=(r+='<div class="abtasty-widget-relative-wrapper">')+'<div class="abtasty-wiget__close"'+t.attr("style",t.style(e),!0,!0)+">",r+="×</div>",r=(r=(r+='<div class="abtasty-widget-relative-container">')+'<div class="abtasty-widget-text abtasty-wiget__prevent-transform"'+t.attr("style",t.style(i),!0,!0)+">")+(null==(n=a)?"":n)+"</div></div></div>"}).call(this,"closeStyle"in i?i.closeStyle:"undefined"!=typeof closeStyle?closeStyle:void 0,"content"in i?i.content:"undefined"!=typeof content?content:void 0,"paddingOveruse"in i?i.paddingOveruse:"undefined"!=typeof paddingOveruse?paddingOveruse:void 0)}catch(e){t.rethrow(e,void 0,void 0,a[void 0])}return r}!function(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],a=document.createElement("style");a.type="text/css","top"===n&&r.firstChild?r.insertBefore(a,r.firstChild):r.appendChild(a),a.styleSheet?a.styleSheet.cssText=e:a.appendChild(document.createTextNode(e))}}(".abtasty-widget-base{width:300px;position:fixed;font-family:Helvetica Neue,Helvetica,Arial,sans-serif;padding:3px;z-index:999999998}.abtasty-widget-top{-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);top:0;margin-top:66px;left:50%}.abtasty-widget-text{padding:10% 0;position:relative;max-width:100%;color:#fff;font-size:14px;font-family:Helvetica Neue,Helvetica,Arial,sans-serif}.abtasty-widget-bottom{-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);bottom:0;left:50%}.abtasty-widget-left{left:0}.abtasty-widget-left,.abtasty-widget-right{-webkit-transform:translateY(-50%);transform:translateY(-50%);top:50%}.abtasty-widget-right{right:0;margin-right:80px}.abtasty-widget-relative-wrapper{position:relative;max-width:100%}.abtasty-widget-relative-container{max-width:100%;padding:20px;position:relative}.abtasty-widget-content{font-size:12px;width:300px;color:#fff;position:relative}.abtasty-wiget__prevent-transform>*{text-transform:none!important}.abtasty-wiget__close{position:absolute;top:0;right:0;width:14px;height:14px;color:#fff;line-height:14px;text-align:center;vertical-align:middle;z-index:99999999999999;cursor:pointer;font-size:14px;font-weight:300;border:0;font-family:Helvetica Neue,Helvetica,Arial,sans-serif!important}.abtasty-wiget__close:hover{color:#000}");var r=["fr","en","de","es"],a={1:{fr:"Ce produit a été acheté !purchaseQty! fois depuis ",en:"This item has been purchased !purchaseQty! times in the last ",de:"Dieses Produkt wurde in den letzten !purchaseQty! Stunden ",es:"Este producto se ha comprado !purchaseQty! veces en las últimas "},2:{fr:"Cette page a été vue !views! fois depuis ",en:"This page has been viewed !views! times in the last ",de:"Diese Seite wurde in den letzten !views! Stunden ",es:"Esta página se ha visto !views! veces en las últimas "}},i={fr:function(e){return"count_72hours"===e||"count_168hours"===e?" jours":" heures"},en:function(e){return"count_72hours"===e||"count_168hours"===e?" days":" hours"},de:function(e){return"count_72hours"===e||"count_168hours"===e?" Tagen":" Stunden"},es:function(e){return"count_72hours"===e||"count_168hours"===e?" días":" horas"}},o=DATA,s=o.stickTo,c=o.positionSelector,l=o.viewInterval,d=o.typeOfContent,u=o.manualInput,f=void 0!==window.ABTastyEditor,p=function(){try{return window.self!==window.top}catch(e){return!0}},y=function(){if(1!==d||window.ABTastyProductKey||f){var e={count_3hours:"3",count_12hours:"12",count_24hours:"24",count_72hours:"3",count_168hours:"7"},t={1:"i",2:"pv"},o=navigator.language.substr(0,2)||"en",y=function(e){return r.indexOf(e)>-1}(o)?o:"en",g=function(){return u||(DATA.siteTarget,""+a[d][y]+e[l]+i[y](l))},v=document.createElement("div");v.className="abtasty-widget-base "+(s?"":DATA.layout),v.id="abtasty-widget-base",v.style.marginBottom=-50+DATA.marginBottom+"px",v.style.padding=(DATA.borderRadius?DATA.borderRadius/Math.PI:0)+"px",v.style.marginTop=DATA.marginTop+"px",v.style.marginLeft=DATA.marginLeft+"px",v.style.marginRight=DATA.marginRight+"px",v.style.textAlign=DATA.textAlign,v.style.borderColor=DATA.borderColor,v.style.borderStyle="solid",v.style.whiteSpace="initial",v.style.position=s?"absolute":"fixed",v.style.borderRadius=DATA.borderRadius+"px",v.style.borderWidth=DATA.borderWidth+"px",v.style.backgroundColor=DATA.backgroundColor,v.style.opacity=""+(1-.01*DATA.backgroundOpacity),v.style.boxShadow=DATA.dropShadow?"5px 3px rgba(0,0,0,"+(1-.01*DATA.shadowOpacity)+")":"none",v.dataset.testId=TEST_ID;var h={padding:DATA.contentPadding+"px"};DATA.fadeOut&&!f&&setTimeout(function(){v.className="",v.style.display="none"},DATA.fadeOut);var w=function(){var e;s?document.querySelector(""+s).insertAdjacentHTML(c,(new XMLSerializer).serializeToString(v)):document.body.appendChild(v),(e=document.getElementById("abtasty-widget-base")).addEventListener("click",function(t){"abtasty-wiget__close"===t.target.className&&(e.className="",e.style.display="none")},!1)},m={1:function(){return window.ABTastyProductKey},2:function(){return encodeURIComponent(""+window.location.pathname+window.location.search)}};if(p()){var A=g().replace("!purchaseQty!","0 (example)").replace("!views!","0 (example)").replace("!period!",e[l]+" ");v.innerHTML=n({content:A,paddingOveruse:h}),w()}else fetch("https://stress-widget-api-dot-prod-bq-unicollect-211188.appspot.com/clients/"+window.ABTasty.accountSettings.identifier+"/metrics/"+t[d]+"?key="+m[d]()).then(function(e){return e.ok?e.json():new Error("Network response was not ok.")}).then(function(t){var r,a=g().replace("!purchaseQty!",""+t[l]).replace("!views!",""+t[l]).replace("!period!",""+e[l]);v.style.display=(r=t[l],void 0===DATA.recurrence||null===DATA.recurrence||f?"visible":"ALWAYS"===DATA.recurrence.toString().toUpperCase()||DATA.recurrence<=r||0===parseInt(DATA.recurrence,10)?"visible":"none"),v.innerHTML=n({content:a,paddingOveruse:h}),w()}).catch(function(){console.log("Failed to fetch statistics from server.")})}else console.error("ABTasty_Log: Error during widget api execution, ABTastyProductKey is undefined")};!function(t,n,r){var a,i=0;try{document.querySelector(t)}catch(n){var o="Selector «"+t+"» not valid.";return e(o),"function"==typeof r&&r(o)}a=setTimeout(function(){clearInterval(i);var n="Can't find element «"+t+"».";return e(n),"function"==typeof r&&r(n)},1e4),i=setInterval(function(){var e=document.querySelector(t);if(null!==e)return clearTimeout(a),clearInterval(i),"function"==typeof n&&n(e)},200)}("body",function(){var e=null;null!==document.querySelector(".abtasty-widget-base")||p()&&!f||(e=setInterval(function(){if(1!==d||window.ABTastyProductKey||f){clearInterval(e),y();var t=document.getElementById("abtasty-widget-base");console.log(t),t.addEventListener("click",function(e){console.log(e),"abtasty-wiget__close"===e.target.className&&(t.className="",t.style.display="none")},!1)}},600))})}(); | ||
!function(){"use strict";var e=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];e.unshift("[AB Tasty Widget] "+PACKAGE+":"),console.log.apply(console,e)},t=function(e){var t=Object.prototype.hasOwnProperty;function n(e,r){return Array.isArray(e)?function(e,t){for(var r,a="",i="",s=Array.isArray(t),c=0;c<e.length;c++)(r=n(e[c]))&&(s&&t[c]&&(r=o(r)),a=a+i+r,i=" ");return a}(e,r):e&&"object"==typeof e?function(e){var n="",r="";for(var a in e)a&&e[a]&&t.call(e,a)&&(n=n+r+a,r=" ");return n}(e):e||""}function r(e){if(!e)return"";if("object"==typeof e){var n="";for(var r in e)t.call(e,r)&&(n=n+r+":"+e[r]+";");return n}return e+""}function a(e,t,n,r){return!1!==t&&null!=t&&(t||"class"!==e&&"style"!==e)?!0===t?" "+(r?e:e+'="'+e+'"'):("function"==typeof t.toJSON&&(t=t.toJSON()),"string"==typeof t||(t=JSON.stringify(t),n||-1===t.indexOf('"'))?(n&&(t=o(t))," "+e+'="'+t+'"'):" "+e+"='"+t.replace(/'/g,"'")+"'"):""}e.merge=function e(t,n){if(1===arguments.length){for(var a=t[0],i=1;i<t.length;i++)a=e(a,t[i]);return a}for(var o in n)if("class"===o){var s=t[o]||[];t[o]=(Array.isArray(s)?s:[s]).concat(n[o]||[])}else if("style"===o){var s=r(t[o]);s=s&&";"!==s[s.length-1]?s+";":s;var c=r(n[o]);c=c&&";"!==c[c.length-1]?c+";":c,t[o]=s+c}else t[o]=n[o];return t},e.classes=n,e.style=r,e.attr=a,e.attrs=function(e,i){var o="";for(var s in e)if(t.call(e,s)){var c=e[s];if("class"===s){c=n(c),o=a(s,c,!1,i)+o;continue}"style"===s&&(c=r(c)),o+=a(s,c,!1,i)}return o};var i=/["&<>]/;function o(e){var t=""+e,n=i.exec(t);if(!n)return e;var r,a,o,s="";for(r=n.index,a=0;r<t.length;r++){switch(t.charCodeAt(r)){case 34:o=""";break;case 38:o="&";break;case 60:o="<";break;case 62:o=">";break;default:continue}a!==r&&(s+=t.substring(a,r)),a=r+1,s+=o}return a!==r?s+t.substring(a,r):s}return e.escape=o,e.rethrow=function e(t,n,r,a){if(!(t instanceof Error))throw t;if(!("undefined"==typeof window&&n||a))throw t.message+=" on line "+r,t;try{a=a||require("fs").readFileSync(n,"utf8")}catch(n){e(t,null,r)}var i=3,o=a.split("\n"),s=Math.max(r-i,0),c=Math.min(o.length,r+i);var i=o.slice(s,c).map(function(e,t){var n=t+s+1;return(n==r?" > ":" ")+n+"| "+e}).join("\n");t.path=n;t.message=(n||"Pug")+":"+r+"\n"+i+"\n\n"+t.message;throw t},e}({});function n(e){var n,r="";try{var a={},i=e||{};(function(e,a,i){r=(r+='<div class="abtasty-widget-relative-wrapper">')+'<div class="abtasty-wiget__close"'+t.attr("style",t.style(e),!0,!0)+">",r+="×</div>",r=(r=(r+='<div class="abtasty-widget-relative-container">')+'<div class="abtasty-widget-text abtasty-wiget__prevent-transform"'+t.attr("style",t.style(i),!0,!0)+">")+(null==(n=a)?"":n)+"</div></div></div>"}).call(this,"closeStyle"in i?i.closeStyle:"undefined"!=typeof closeStyle?closeStyle:void 0,"content"in i?i.content:"undefined"!=typeof content?content:void 0,"paddingOveruse"in i?i.paddingOveruse:"undefined"!=typeof paddingOveruse?paddingOveruse:void 0)}catch(e){t.rethrow(e,void 0,void 0,a[void 0])}return r}!function(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],a=document.createElement("style");a.type="text/css","top"===n&&r.firstChild?r.insertBefore(a,r.firstChild):r.appendChild(a),a.styleSheet?a.styleSheet.cssText=e:a.appendChild(document.createTextNode(e))}}(".abtasty-widget-base{width:300px;position:fixed;font-family:Helvetica Neue,Helvetica,Arial,sans-serif;padding:3px;z-index:999999998}.abtasty-widget-top{-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);top:0;margin-top:66px;left:50%}.abtasty-widget-text{padding:10% 0;position:relative;max-width:100%;color:#fff;font-size:14px;font-family:Helvetica Neue,Helvetica,Arial,sans-serif}.abtasty-widget-bottom{-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);bottom:0;left:50%}.abtasty-widget-left{left:0}.abtasty-widget-left,.abtasty-widget-right{-webkit-transform:translateY(-50%);transform:translateY(-50%);top:50%}.abtasty-widget-right{right:0;margin-right:80px}.abtasty-widget-relative-wrapper{position:relative;max-width:100%}.abtasty-widget-relative-container{max-width:100%;padding:20px;position:relative}.abtasty-widget-content{font-size:12px;width:300px;color:#fff;position:relative}.abtasty-wiget__prevent-transform>*{text-transform:none!important}.abtasty-wiget__close{position:absolute;top:0;right:0;width:14px;height:14px;color:#fff;line-height:14px;text-align:center;vertical-align:middle;z-index:99999999999999;cursor:pointer;font-size:14px;font-weight:300;border:0;font-family:Helvetica Neue,Helvetica,Arial,sans-serif!important}.abtasty-wiget__close:hover{color:#000}");var r=["fr","en","de","es"],a={1:{fr:"Ce produit a été acheté !purchaseQty! fois depuis ",en:"This item has been purchased !purchaseQty! times in the last ",de:"Dieses Produkt wurde in den letzten !purchaseQty! Stunden ",es:"Este producto se ha comprado !purchaseQty! veces en las últimas "},2:{fr:"Cette page a été vue !views! fois depuis ",en:"This page has been viewed !views! times in the last ",de:"Diese Seite wurde in den letzten !views! Stunden ",es:"Esta página se ha visto !views! veces en las últimas "}},i={fr:function(e){return"count_72hours"===e||"count_168hours"===e?" jours":" heures"},en:function(e){return"count_72hours"===e||"count_168hours"===e?" days":" hours"},de:function(e){return"count_72hours"===e||"count_168hours"===e?" Tagen":" Stunden"},es:function(e){return"count_72hours"===e||"count_168hours"===e?" días":" horas"}},o=DATA,s=o.stickTo,c=o.positionSelector,l=o.viewInterval,d=o.typeOfContent,u=o.manualInput,f=void 0!==window.ABTastyEditor,p=function(){try{return window.self!==window.top}catch(e){return!0}},y=function(){if(1!==d||window.ABTastyProductKey||f){var e={count_3hours:"3",count_12hours:"12",count_24hours:"24",count_72hours:"3",count_168hours:"7"},t={1:"i",2:"pv"},o=navigator.language.substr(0,2)||"en",y=function(e){return r.indexOf(e)>-1}(o)?o:"en",g=function(){return u||(DATA.siteTarget,""+a[d][y]+e[l]+i[y](l))},v=document.createElement("div");v.className="abtasty-widget-base "+(s?"":DATA.layout),v.id="abtasty-widget-base",v.style.display="block !important",v.style.marginBottom=-50+DATA.marginBottom+"px",v.style.padding=(DATA.borderRadius?DATA.borderRadius/Math.PI:0)+"px",v.style.marginTop=DATA.marginTop+"px",v.style.marginLeft=DATA.marginLeft+"px",v.style.marginRight=DATA.marginRight+"px",v.style.textAlign=DATA.textAlign,v.style.borderColor=DATA.borderColor,v.style.borderStyle="solid",v.style.whiteSpace="initial",v.style.position=s?"absolute":"fixed",v.style.borderRadius=DATA.borderRadius+"px",v.style.borderWidth=DATA.borderWidth+"px",v.style.backgroundColor=DATA.backgroundColor,v.style.opacity=""+(1-.01*DATA.backgroundOpacity),v.style.boxShadow=DATA.dropShadow?"5px 3px rgba(0,0,0,"+(1-.01*DATA.shadowOpacity)+")":"none",v.dataset.testId=TEST_ID;var h={padding:DATA.contentPadding+"px"};DATA.fadeOut&&!f&&setTimeout(function(){v.className="",v.style.display="none"},DATA.fadeOut);var w=function(){var e;s?document.querySelector(""+s).insertAdjacentHTML(c,(new XMLSerializer).serializeToString(v)):document.body.appendChild(v),(e=document.getElementById("abtasty-widget-base")).addEventListener("click",function(t){"abtasty-wiget__close"===t.target.className&&(e.className="",e.style.display="none")},!1)},m={1:function(){return window.ABTastyProductKey},2:function(){return encodeURIComponent(""+window.location.pathname+window.location.search)}};if(p()){var A=g().replace("!purchaseQty!","0 (example)").replace("!views!","0 (example)").replace("!period!",e[l]+" ");v.innerHTML=n({content:A,paddingOveruse:h}),w()}else fetch("https://stress-widget-api-dot-prod-bq-unicollect-211188.appspot.com/clients/"+window.ABTasty.accountSettings.identifier+"/metrics/"+t[d]+"?key="+m[d]()).then(function(e){return e.ok?e.json():new Error("Network response was not ok.")}).then(function(t){var r,a=g().replace("!purchaseQty!",""+t[l]).replace("!views!",""+t[l]).replace("!period!",""+e[l]);v.style.display=(r=t[l],void 0===DATA.recurrence||null===DATA.recurrence||f?"visible":"ALWAYS"===DATA.recurrence.toString().toUpperCase()||DATA.recurrence<=r||0===parseInt(DATA.recurrence,10)?"visible":"none"),v.innerHTML=n({content:a,paddingOveruse:h}),w()}).catch(function(){console.log("Failed to fetch statistics from server.")})}else console.error("ABTasty_Log: Error during widget api execution, ABTastyProductKey is undefined")};!function(t,n,r){var a,i=0;try{document.querySelector(t)}catch(n){var o="Selector «"+t+"» not valid.";return e(o),"function"==typeof r&&r(o)}a=setTimeout(function(){clearInterval(i);var n="Can't find element «"+t+"».";return e(n),"function"==typeof r&&r(n)},1e4),i=setInterval(function(){var e=document.querySelector(t);if(null!==e)return clearTimeout(a),clearInterval(i),"function"==typeof n&&n(e)},200)}("body",function(){var e=null;null!==document.querySelector(".abtasty-widget-base")||p()&&!f||(e=setInterval(function(){if(1!==d||window.ABTastyProductKey||f){clearInterval(e),y();var t=document.getElementById("abtasty-widget-base");console.log(t),t.addEventListener("click",function(e){console.log(e),"abtasty-wiget__close"===e.target.className&&(t.className="",t.style.display="none")},!1)}},600))})}(); |
{ | ||
"name": "@abtasty/social-proof", | ||
"description": "simple", | ||
"version": "0.1.17-2", | ||
"version": "0.1.17-3", | ||
"main": "dist/main.js", | ||
@@ -6,0 +6,0 @@ "form": "dist/form.js", |
20812