Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@abtasty/modal

Package Overview
Dependencies
Maintainers
13
Versions
201
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@abtasty/modal - npm Package Compare versions

Comparing version 2.0.4 to 2.0.5

dist/form.js

3

dist/main.js

@@ -1,2 +0,1 @@

!function(){"use strict";function t(){N.style.display="none","video"===s&&(N.innerHTML=N.innerHTML)}function a(){return N.querySelector(q)?(N.querySelector(q).addEventListener("click",t),N.querySelector(H).addEventListener("click",t),0):setTimeout(a,50)}function e(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],a={layout:B,type:s,borderRadius:f,borderWidth:p,borderColor:_,button:g,buttonBackgroundColor:h,buttonLink:v,buttonText:k,buttonTextColor:x,backgroundColor:c,backgroundImage:y,image:S,width:D,videoLink:I,customWidth:E,animation:b,title:L,closeButtonPosition:T,modalContent:C||t.outerHTML};if(N.className="abtasty-modal abtasty-modal--"+s,N.dataset.testId=TEST_ID,N.innerHTML=r(a),document.body.appendChild(N),j=N.querySelector(".abtasty-modal__area"),w){N.querySelector(H).style.color=w}}function o(){var t="abtasty-widget-video-"+Date.now(),a=document.createElement("iframe");a.setAttribute("id",t);var o=function(t){var a=t.indexOf("youtu")>-1,e=t.indexOf("vimeo")>-1,o=void 0;a?o="//www.youtube.com/embed/"+t.match(/^.*(youtu.be\/|v\/|e\/|u\/\w+\/|embed\/|v=)([^#&?]*).*/)[2]+"?rel=0":e&&(o="//player.vimeo.com/video/"+t.match(/.*(www\.)?vimeo.com\/(\d+)($|\/)/)[2]);return o}(I),i=function(){var t=.6*window.innerWidth/16*9;return Math.round(t)}();a.style.height=i+"px",a.src=o,a.frameBorder=0,a.allowfullscreen=!0,e(a),j.style.height=i+"px"}function i(){"video"===s?o():e(),N.style.display="block",m&&ABTastyEvent(u,null,TEST_ID),a(),M||(localStorage.setItem(z,R),sessionStorage.setItem(z,R))}!function(t,a){if("undefined"==typeof document)return a;t=t||"";var e=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css",e.appendChild(o),o.styleSheet?o.styleSheet.cssText=t:o.appendChild(document.createTextNode(t))}("abtasty-modal{display:none;z-index:1000000}abtasty-modal,abtasty-modal__underlay{position:fixed;top:0;left:0;width:100%;height:100%}abtasty-modal__underlay{background-color:rgba(0,0,0,.5);cursor:pointer}.abtasty-modal__area{top:0;left:0;right:0;width:auto;margin:10px!important;max-height:70%;z-index:100;position:relative}.abtasty-modal__content{border-color:#f6f6f6;border-style:solid;padding:20px}.abtasty-modal__area-type--image,.abtasty-modal__area-type--simple,.abtasty-modal__area-type--video{margin:auto!important;top:20%;max-height:50%;border:none}.abtasty-modal__close{position:absolute;right:5px;top:0;font-size:30px;font-weight:300;background:transparent;border:0;color:#bbb;font-family:Helvetica Neue,Helvetica,Arial,sans-serif!important;line-height:32px!important;margin-right:5px;cursor:pointer}.abtasty-modal__close--outside{top:-30px;right:-30px}.abtasty-modal__media,.abtasty-modal__media-link{max-width:100%;display:block}.abtasty-modal__text{padding:20px;font-family:Open Sans,sans-serif!important;color:#000}.abtasty-modal__title{width:auto;font-size:31px!important;font-weight:500;line-height:1.1;margin-bottom:10px}.abtasty-modal__text p{margin:0 0 10px!important;font-size:15px;font-weight:300}.abtasty-modal__button{width:100%;text-align:center}.abtasty-modal__button a{padding:10px 20px;border-radius:10px;display:inline-block;font-weight:700}.abtasty-modal__area-type--simple.abtasty-modal__area-layout--center .abtasty-modal__innertext,.abtasty-modal__area-type--simple.abtasty-modal__area-layout--center .abtasty-modal__title{text-align:center}.abtasty-modal__area-type--simple.abtasty-modal__area-layout--left .abtasty-modal__title{width:50%;float:left;text-align:center;vertical-align:middle}.abtasty-modal__area-type--simple.abtasty-modal__area-layout--left .abtasty-modal__innertext{width:50%;float:left}.abtasty-modal__area-type--simple.abtasty-modal__area-layout--right .abtasty-modal__title{width:50%;float:left;text-align:center;vertical-align:middle}.abtasty-modal__area-type--simple.abtasty-modal__area-layout--right .abtasty-modal__innertext{width:50%;float:left}.abtasty-modal__area-type--image .abtasty-modal__image img{max-height:400px}.abtasty-modal__area-type--image.abtasty-modal__area-layout--left .abtasty-modal__image{width:50%;display:inline-block;height:100%;vertical-align:middle;text-align:center}.abtasty-modal__area-type--image.abtasty-modal__area-layout--left .abtasty-modal__text{text-align:left;width:50%;display:inline-block;vertical-align:middle;-webkit-box-sizing:border-box;box-sizing:border-box}.abtasty-modal__area-type--image.abtasty-modal__area-layout--right .abtasty-modal__image{width:50%;display:inline-block;height:100%;vertical-align:middle;text-align:center}.abtasty-modal__area-type--image.abtasty-modal__area-layout--right .abtasty-modal__text{text-align:left;width:50%;display:inline-block;vertical-align:middle;-webkit-box-sizing:border-box;box-sizing:border-box}.abtasty-modal__area-type--image.abtasty-modal__area-layout--top .abtasty-modal__image{width:100%;text-align:center}.abtasty-modal__area-type--image.abtasty-modal__area-layout--top .abtasty-modal__text{width:100%;padding:20px 0}.abtasty-modal__area-type--image.abtasty-modal__area-layout--top .abtasty-modal__image img{max-height:300px}.abtasty-modal__area-type--image.abtasty-modal__area-layout--bottom .abtasty-modal__image{width:100%;text-align:center}.abtasty-modal__area-type--image.abtasty-modal__area-layout--bottom .abtasty-modal__text{width:100%;padding:20px 0}.abtasty-modal__area-type--video{text-align:center;width:100%}.abtasty-modal__area-type--video iframe{width:100%}@media (min-width:630px){abtasty-modal:not(.abtasty-modal--video) .abtasty-modal__area-width--medium{width:600px;margin:auto!important}.abtasty-modal--video{width:60%;left:20%}}@media (min-width:330px){abtasty-modal:not(.abtasty-modal--video) .abtasty-modal__area-width--small{width:300px;margin:auto!important}}@media (min-width:930px){abtasty-modal:not(.abtasty-modal--video) .abtasty-modal__area-width--large{width:900px;margin:auto!important}}.abtasty-animation-fadeIn{-webkit-animation-name:a;animation-name:a}.abtasty-animation-fadeIn,.abtasty-animation-fadeOut{-webkit-animation-duration:.5s;animation-duration:.5s}.abtasty-animation-fadeOut{-webkit-animation-name:b;animation-name:b}.abtasty-animation-slideIn{-webkit-animation-name:c;animation-name:c;-webkit-animation-duration:.5s;animation-duration:.5s}.abtasty-animation-slideOut{-webkit-animation-name:d;animation-name:d;-webkit-animation-duration:.5s;animation-duration:.5s}@-webkit-keyframes a{0%{opacity:0}to{opacity:1}}@keyframes a{0%{opacity:0}to{opacity:1}}@-webkit-keyframes b{0%{opacity:1}to{opacity:0}}@keyframes b{0%{opacity:1}to{opacity:0}}@-webkit-keyframes c{0%{-webkit-transform:translateY(-100%);transform:translateY(-100%)}to{-webkit-transform:translateY(0);transform:translateY(0)}}@keyframes c{0%{-webkit-transform:translateY(-100%);transform:translateY(-100%)}to{-webkit-transform:translateY(0);transform:translateY(0)}}@-webkit-keyframes d{0%{-webkit-transform:translateY(0);transform:translateY(0)}to{-webkit-transform:translateY(-100%);transform:translateY(-100%)}}@keyframes d{0%{-webkit-transform:translateY(0);transform:translateY(0)}to{-webkit-transform:translateY(-100%);transform:translateY(-100%)}}",void 0);var n=function(t){function a(t,e){if(1===arguments.length){for(var i=t[0],n=1;n<t.length;n++)i=a(i,t[n]);return i}for(var r in e)if("class"===r){d=t[r]||[];t[r]=(Array.isArray(d)?d:[d]).concat(e[r]||[])}else if("style"===r){var d=o(t[r]),l=o(e[r]);t[r]=d+l}else t[r]=e[r];return t}function e(t,a){return Array.isArray(t)?function(t,a){for(var o,i="",r="",d=Array.isArray(a),l=0;l<t.length;l++)(o=e(t[l]))&&(d&&a[l]&&(o=n(o)),i=i+r+o,r=" ");return i}(t,a):t&&"object"==typeof t?function(t){var a="",e="";for(var o in t)o&&t[o]&&d.call(t,o)&&(a=a+e+o,e=" ");return a}(t):t||""}function o(t){if(!t)return"";if("object"==typeof t){var a="";for(var e in t)d.call(t,e)&&(a=a+e+":"+t[e]+";");return a}return";"!==(t+="")[t.length-1]?t+";":t}function i(t,a,e,o){return!1!==a&&null!=a&&(a||"class"!==t&&"style"!==t)?!0===a?" "+(o?t:t+'="'+t+'"'):("function"==typeof a.toJSON&&(a=a.toJSON()),"string"==typeof a||(a=JSON.stringify(a),e||-1===a.indexOf('"'))?(e&&(a=n(a))," "+t+'="'+a+'"'):" "+t+"='"+a.replace(/'/g,"&#39;")+"'"):""}function n(t){var a=""+t,e=l.exec(a);if(!e)return t;var o,i,n,r="";for(o=e.index,i=0;o<a.length;o++){switch(a.charCodeAt(o)){case 34:n="&quot;";break;case 38:n="&amp;";break;case 60:n="&lt;";break;case 62:n="&gt;";break;default:continue}i!==o&&(r+=a.substring(i,o)),i=o+1,r+=n}return i!==o?r+a.substring(i,o):r}function r(t,a,e,o){if(!(t instanceof Error))throw t;if(!("undefined"==typeof window&&a||o))throw t.message+=" on line "+e,t;try{o=o||require("fs").readFileSync(a,"utf8")}catch(a){r(t,null,e)}var i=3,n=o.split("\n"),d=Math.max(e-i,0),l=Math.min(n.length,e+i),i=n.slice(d,l).map(function(t,a){var o=a+d+1;return(o==e?" > ":" ")+o+"| "+t}).join("\n");throw t.path=a,t.message=(a||"Pug")+":"+e+"\n"+i+"\n\n"+t.message,t}var d=Object.prototype.hasOwnProperty;t.merge=a,t.classes=e,t.style=o,t.attr=i,t.attrs=function(t,a){var n="";for(var r in t)if(d.call(t,r)){var l=t[r];if("class"===r){n=i(r,l=e(l),!1,a)+n;continue}"style"===r&&(l=o(l)),n+=i(r,l,!1,a)}return n};var l=/["&<>]/;return t.escape=n,t.rethrow=r,t}({}),r=function(t){var a,e="",o={};try{var i={},r=t||{};(function(t,i,r,d,l,s,m,u,b,c,y,f,p,_,g,h,v,k,x){o.button=a=function(){this&&this.block,this&&this.attributes;e=(e=(e+='<div class="abtasty-modal__button">')+"<a"+(n.attr("href",b,!0,!0)+n.attr("style",n.style({"background-color":u,color:y}),!0,!0))+">")+n.escape(null==(a=c)?"":a)+"</a></div>"},o.title=a=function(){this&&this.block,this&&this.attributes;e=(e+='<h2 class="abtasty-modal__title">')+n.escape(null==(a=v)?"":a)+"</h2>"},o.image=a=function(){this&&this.block,this&&this.attributes;e+='<div class="abtasty-modal__image">',_&&(e=e+"<img"+(n.attr("src",_,!0,!0)+n.attr("style",n.style({"border-radius":l+"px"}),!0,!0))+">"),e+="</div>"},o.content=a=function(){this&&this.block,this&&this.attributes;e=(e+='<p class="abtasty-modal__innertext">')+n.escape(null==(a=h)?"":a)+"</p>"},o.closeButton=a=function(){this&&this.block,this&&this.attributes;e=e+"<div"+n.attr("class",n.classes(["abtasty-modal__close",f?"abtasty-modal__close--"+f:""],[!1,!0]),!1,!0)+">",e+="×</div>"},o.contentWrapper=a=function(){var t=this&&this.block;this&&this.attributes;e=e+'<div class="abtasty-modal__content"'+n.attr("style",n.style({"border-radius":l+"px","border-width":s+"px","border-color":d,"background-color":i,"background-image":r?'url("'+r+'")':"none"}),!0,!0)+">",t&&t&&t(),e+="</div>"},o.modalWrapper=a=function(){var a=this&&this.block;this&&this.attributes;e=(e+="<abtasty-modal__underlay></abtasty-modal__underlay>")+"<div"+(n.attr("class",n.classes(["abtasty-animation-"+t+" abtasty-modal__area abtasty-modal__area-width--"+x+" abtasty-modal__area-type--"+k+" abtasty-modal__area-layout--"+g],[!0]),!1,!0)+n.attr("style",n.style({width:"custom"===x&&p+"%","margin-left":"custom"===x&&(100-p)/2+"% !important"}),!0,!0))+">",a&&a&&a(),e+="</div>"},o.modalWrapper.call({block:function(){o.closeButton(),o.contentWrapper.call({block:function(){"simple"===k?(e+='<div class="abtasty-modal__text">',"center"===g||"left"===g?(o.title(),o.content(),e+='<div style="clear:both;"></div>'):(o.content(),o.title(),e+='<div style="clear:both;"></div>'),e+="</div>",m&&o.button()):"image"===k?("top"!==g&&"left"!==g||o.image(),e+='<div class="abtasty-modal__text">',o.title(),o.content(),m&&o.button(),e+="</div>","right"!==g&&"bottom"!==g||o.image(),e+='<div style="clear:both;"></div>'):"video"===k&&("bottom"===g&&o.title(),e+=null==(a=h)?"":a,"top"===g&&o.title(),m&&o.button())}})}})}).call(this,"animation"in r?r.animation:"undefined"!=typeof animation?animation:void 0,"backgroundColor"in r?r.backgroundColor:"undefined"!=typeof backgroundColor?backgroundColor:void 0,"backgroundImage"in r?r.backgroundImage:"undefined"!=typeof backgroundImage?backgroundImage:void 0,"borderColor"in r?r.borderColor:"undefined"!=typeof borderColor?borderColor:void 0,"borderRadius"in r?r.borderRadius:"undefined"!=typeof borderRadius?borderRadius:void 0,"borderWidth"in r?r.borderWidth:"undefined"!=typeof borderWidth?borderWidth:void 0,"button"in r?r.button:"undefined"!=typeof button?button:void 0,"buttonBackgroundColor"in r?r.buttonBackgroundColor:"undefined"!=typeof buttonBackgroundColor?buttonBackgroundColor:void 0,"buttonLink"in r?r.buttonLink:"undefined"!=typeof buttonLink?buttonLink:void 0,"buttonText"in r?r.buttonText:"undefined"!=typeof buttonText?buttonText:void 0,"buttonTextColor"in r?r.buttonTextColor:"undefined"!=typeof buttonTextColor?buttonTextColor:void 0,"closeButtonPosition"in r?r.closeButtonPosition:"undefined"!=typeof closeButtonPosition?closeButtonPosition:void 0,"customWidth"in r?r.customWidth:"undefined"!=typeof customWidth?customWidth:void 0,"image"in r?r.image:"undefined"!=typeof image?image:void 0,"layout"in r?r.layout:"undefined"!=typeof layout?layout:void 0,"modalContent"in r?r.modalContent:"undefined"!=typeof modalContent?modalContent:void 0,"title"in r?r.title:"undefined"!=typeof title?title:void 0,"type"in r?r.type:"undefined"!=typeof type?type:void 0,"width"in r?r.width:"undefined"!=typeof width?width:void 0)}catch(t){n.rethrow(t,void 0,void 0,i[void 0])}return e},d=DATA,l=d.type,s=void 0===l?"simple":l,m=d.actionTrackingEvent,u=d.actionTrackingName,b=d.animation,c=d.backgroundColor,y=d.backgroundImage,f=d.borderRadius,p=d.borderWidth,_=d.borderColor,g=d.button,h=d.buttonBackgroundColor,v=d.buttonLink,k=d.buttonText,x=d.buttonTextColor,w=d.closeButtonColor,T=d.closeButtonPosition,C=d.content,E=d.customWidth,L=d.title,S=d.image,B=d.layout,I=d.videoLink,A=d.recurrence,Y=d.triggerEvent,W=d.triggerEventDelay,O=d.clickEventSelector,D=d.width,N=document.createElement("abtasty-modal"),z="AB Tasty Modal "+s+" "+TEST_ID,M=void 0!==window.ABTastyEditor,P=!!sessionStorage.getItem("ABTastyPreview"),q="abtasty-modal__underlay",H=".abtasty-modal__close",R=Date.now(),j=void 0;!function(t){"loading"!==document.readyState?t():document.addEventListener("DOMContentLoaded",t)}(function(){if("click"===Y)!function(t,a,e){document.body.addEventListener("click",function(o){var i=o.target;if(!e||!i.matches(e))for(;i;){if(i!==document&&i.matches(t)){a();break}i=i.parentNode}})}(O,i,q+", "+H);else if(function(){var t=Number(A),a=localStorage.getItem(z);return!(a&&-1!==t&&!M&&!P)||(0===t?!sessionStorage.getItem(z):a<R-24*t*60*60*1e3)}())switch(Y){case"pageLoad":i();break;case"exitIntent":!function(t){var a=DATA.exitEventDelay,e=parseFloat(a)||0,o=void 0,i=0;document.addEventListener("mousemove",function(t){i=t.clientY}),document.addEventListener("mouseleave",function a(n){n.clientY<=50&&(i=0,clearInterval(o),o=setTimeout(function(){0===i&&(t(),document.removeEventListener("mouseleave",a))},1e3*e))},!1)}(i);break;case"reengage":!function(t){var a=DATA.reengageEventDelay,e=["mousemove","keydown","scroll"],o=void 0;e.forEach(function(i){document.addEventListener(i,function i(){clearTimeout(o),o=setTimeout(function(){t(),e.forEach(function(t){return document.removeEventListener(t,i)})},1e3*a)},!1)})}(i);break;case"timer":setTimeout(i,1e3*W)}})}();
//# sourceMappingURL=main.js.map
!function(){"use strict";function t(){$&&(document.querySelector("body").style.overflowY=$),N.style.display="none","video"===m&&(N.innerHTML=N.innerHTML)}function a(){return N.querySelector(H)?(N.querySelector(H).addEventListener("click",t),N.querySelector(j).addEventListener("click",t),0):setTimeout(a,50)}function e(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],a={layout:Y,type:m,borderRadius:_,borderWidth:f,borderColor:g,button:h,buttonBackgroundColor:v,buttonLink:x,buttonText:w,buttonTextColor:k,backgroundColor:c,backgroundImage:p,image:B,width:q,videoLink:I,customWidth:S,animation:u,title:L,closeButtonPosition:C,modalContent:E||t.outerHTML};if(N.className="abtasty-modal abtasty-modal--"+m,N.dataset.testId=TEST_ID,N.innerHTML=d(a),document.body.appendChild(N),F=N.querySelector(".abtasty-modal__area"),T){N.querySelector(j).style.color=T}}function o(){var t=(window.innerWidth>630?.6*window.innerWidth:window.innerWidth-40)/16*9;return Math.round(t)}function i(){var t="abtasty-widget-video-"+Date.now(),a=document.createElement("iframe");a.setAttribute("id",t);var i=function(t){var a=t.indexOf("youtu")>-1,e=t.indexOf("vimeo")>-1,o=void 0;a?(o="//www.youtube.com/embed/"+t.match(/^.*(youtu.be\/|v\/|e\/|u\/\w+\/|embed\/|v=)([^#&?]*).*/)[2]+"?rel=0",z&&(o+="&autoplay=1")):e&&(o="//player.vimeo.com/video/"+t.match(/.*(www\.)?vimeo.com\/(\d+)($|\/)/)[2]);return o}(I),n=o();a.style.height=n+"px","no-title"===Y&&(a.style.borderRadius=_+"px"),a.src=i,a.frameBorder=0,a.allowfullscreen=!0,e(a),F.style.height=n+"px",window.addEventListener("resize",function(){var t=document.querySelector("abtasty-modal iframe"),a=o();t.style.height=a+"px",F.style.height=a+"px"})}function n(){"video"===m?i():e(),N.style.display="block",function(){var t=document.querySelector("body");$=window.getComputedStyle(t).overflowY,t.style.overflowY="hidden"}(),y&&ABTastyEvent(b,null,TEST_ID),a(),M||(localStorage.setItem(P,J),sessionStorage.setItem(P,J))}!function(t,a){if("undefined"==typeof document)return a;t=t||"";var e=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css",e.appendChild(o),o.styleSheet?o.styleSheet.cssText=t:o.appendChild(document.createTextNode(t))}("abtasty-modal{display:none;z-index:1000000}abtasty-modal,abtasty-modal__underlay{position:fixed;top:0;left:0;width:100%;height:100%}abtasty-modal__underlay{background-color:rgba(0,0,0,.5);cursor:pointer}.abtasty-modal__area{top:0;left:0;right:0;width:auto;margin:10px!important;max-height:70%;z-index:100;position:relative}.abtasty-modal__area-type--video.abtasty-modal__area-layout--no-title .abtasty-modal__content{padding:5px;border-radius:0!important;border-width:0!important;background-color:transparent!important;background-image:none!important}.abtasty-modal__area-type--video.abtasty-modal__area-layout--no-title .abtasty-modal__content iframe{border:2px solid #fff}.abtasty-modal__area-type--video.abtasty-modal__area-layout--bottom .abtasty-modal__content{padding:25px 20px 20px}.abtasty-modal__content{border-color:#f6f6f6;border-style:solid;padding:20px}.abtasty-modal__area-type--image,.abtasty-modal__area-type--no-title,.abtasty-modal__area-type--simple,.abtasty-modal__area-type--video{margin:auto!important;top:20%;max-height:50%;border:none}.abtasty-modal__area-type--video.abtasty-modal__area-layout--bottom .abtasty-modal__close{top:2px}.abtasty-modal__area-type--video.abtasty-modal__area-layout--top .abtasty-modal__close{right:15px;top:20px}.abtasty-modal__area-type--image .abtasty-modal__close,.abtasty-modal__area-type--simple .abtasty-modal__close{right:10px;top:15px}.abtasty-modal__close{position:absolute;right:5px;top:0;font-size:20px;font-weight:300;background:transparent;border:0;color:#222;font-family:Helvetica Neue,Helvetica,Arial,sans-serif!important;line-height:20px!important;margin-right:5px;cursor:pointer}.abtasty-modal__area-type--video.abtasty-modal__area-layout--no-title .abtasty-modal__close--inside{top:-6px;right:-15px;background:#fff;border-radius:20px;width:22px;height:22px}.abtasty-modal__area-type--image .abtasty-modal__close--outside{width:12px;height:22px;padding:0 5px}.abtasty-modal__close--outside{top:-25px;right:-25px;background:#fff;border-radius:20px;width:22px;height:22px}.abtasty-modal__media,.abtasty-modal__media-link{max-width:100%;display:block}.abtasty-modal__text{padding:20px;font-family:Open Sans,sans-serif!important;color:#000}.abtasty-modal__title{width:auto;font-size:20px!important;font-weight:500;line-height:1.1;margin-bottom:10px}.abtasty-modal__text p{margin:0 0 10px!important;font-size:15px;font-weight:300}.abtasty-modal__button{width:100%;text-align:center;margin-top:20px}.abtasty-modal__button a{padding:10px 20px;border-radius:10px;display:inline-block;font-weight:700}.abtasty-modal__area-type--simple.abtasty-modal__area-layout--center .abtasty-modal__title{text-align:center}.abtasty-modal__area-type--simple.abtasty-modal__area-layout--center .abtasty-modal__innertext{text-align:center;white-space:pre-wrap}.abtasty-modal__area-type--simple.abtasty-modal__area-layout--left .abtasty-modal__title{width:50%;float:left;text-align:center;vertical-align:middle}.abtasty-modal__area-type--simple.abtasty-modal__area-layout--left .abtasty-modal__innertext{width:50%;float:left}.abtasty-modal__area-type--simple.abtasty-modal__area-layout--right .abtasty-modal__title{width:50%;float:left;text-align:center;vertical-align:middle}.abtasty-modal__area-type--simple.abtasty-modal__area-layout--right .abtasty-modal__innertext{width:50%;float:left}.abtasty-modal__area-type--image .abtasty-modal__image img{max-height:400px}.abtasty-modal__area-type--image.abtasty-modal__area-layout--left .abtasty-modal__image{width:50%;display:inline-block;height:100%;vertical-align:middle;text-align:center}.abtasty-modal__area-type--image.abtasty-modal__area-layout--left .abtasty-modal__text{text-align:left;width:50%;display:inline-block;vertical-align:middle;-webkit-box-sizing:border-box;box-sizing:border-box}.abtasty-modal__area-type--image.abtasty-modal__area-layout--right .abtasty-modal__image{width:50%;display:inline-block;height:100%;vertical-align:middle;text-align:center}.abtasty-modal__area-type--image.abtasty-modal__area-layout--right .abtasty-modal__text{text-align:left;width:50%;display:inline-block;vertical-align:middle;-webkit-box-sizing:border-box;box-sizing:border-box}.abtasty-modal__area-type--image.abtasty-modal__area-layout--top .abtasty-modal__image{width:100%;text-align:center}.abtasty-modal__area-type--image.abtasty-modal__area-layout--top .abtasty-modal__text{width:100%;padding:20px 0}.abtasty-modal__area-type--image.abtasty-modal__area-layout--top .abtasty-modal__image img{max-height:300px}.abtasty-modal__area-type--image.abtasty-modal__area-layout--bottom .abtasty-modal__image{width:100%;text-align:center}.abtasty-modal__area-type--image.abtasty-modal__area-layout--bottom .abtasty-modal__text{width:100%;padding:20px 0}.abtasty-modal__area-type--video{text-align:center;width:100%}.abtasty-modal__area-type--video iframe{width:100%}@media (min-width:630px){abtasty-modal:not(.abtasty-modal--video) .abtasty-modal__area-width--medium{width:600px;margin:auto!important}.abtasty-modal--video{width:60%;left:20%}}@media (min-width:330px){abtasty-modal:not(.abtasty-modal--video) .abtasty-modal__area-width--small{width:300px;margin:auto!important}}@media (min-width:930px){abtasty-modal:not(.abtasty-modal--video) .abtasty-modal__area-width--large{width:900px;margin:auto!important}}.abtasty-animation-fadeIn{-webkit-animation-name:a;animation-name:a}.abtasty-animation-fadeIn,.abtasty-animation-fadeOut{-webkit-animation-duration:.5s;animation-duration:.5s}.abtasty-animation-fadeOut{-webkit-animation-name:b;animation-name:b}.abtasty-animation-slideIn{-webkit-animation-name:c;animation-name:c;-webkit-animation-duration:.5s;animation-duration:.5s}.abtasty-animation-slideOut{-webkit-animation-name:d;animation-name:d;-webkit-animation-duration:.5s;animation-duration:.5s}@-webkit-keyframes a{0%{opacity:0}to{opacity:1}}@keyframes a{0%{opacity:0}to{opacity:1}}@-webkit-keyframes b{0%{opacity:1}to{opacity:0}}@keyframes b{0%{opacity:1}to{opacity:0}}@-webkit-keyframes c{0%{-webkit-transform:translateY(-100%);transform:translateY(-100%)}to{-webkit-transform:translateY(0);transform:translateY(0)}}@keyframes c{0%{-webkit-transform:translateY(-100%);transform:translateY(-100%)}to{-webkit-transform:translateY(0);transform:translateY(0)}}@-webkit-keyframes d{0%{-webkit-transform:translateY(0);transform:translateY(0)}to{-webkit-transform:translateY(-100%);transform:translateY(-100%)}}@keyframes d{0%{-webkit-transform:translateY(0);transform:translateY(0)}to{-webkit-transform:translateY(-100%);transform:translateY(-100%)}}",void 0);var r=function(t){function a(t,e){if(1===arguments.length){for(var i=t[0],n=1;n<t.length;n++)i=a(i,t[n]);return i}for(var r in e)if("class"===r){d=t[r]||[];t[r]=(Array.isArray(d)?d:[d]).concat(e[r]||[])}else if("style"===r){var d=o(t[r]),l=o(e[r]);t[r]=d+l}else t[r]=e[r];return t}function e(t,a){return Array.isArray(t)?function(t,a){for(var o,i="",r="",d=Array.isArray(a),l=0;l<t.length;l++)(o=e(t[l]))&&(d&&a[l]&&(o=n(o)),i=i+r+o,r=" ");return i}(t,a):t&&"object"==typeof t?function(t){var a="",e="";for(var o in t)o&&t[o]&&d.call(t,o)&&(a=a+e+o,e=" ");return a}(t):t||""}function o(t){if(!t)return"";if("object"==typeof t){var a="";for(var e in t)d.call(t,e)&&(a=a+e+":"+t[e]+";");return a}return";"!==(t+="")[t.length-1]?t+";":t}function i(t,a,e,o){return!1!==a&&null!=a&&(a||"class"!==t&&"style"!==t)?!0===a?" "+(o?t:t+'="'+t+'"'):("function"==typeof a.toJSON&&(a=a.toJSON()),"string"==typeof a||(a=JSON.stringify(a),e||-1===a.indexOf('"'))?(e&&(a=n(a))," "+t+'="'+a+'"'):" "+t+"='"+a.replace(/'/g,"&#39;")+"'"):""}function n(t){var a=""+t,e=l.exec(a);if(!e)return t;var o,i,n,r="";for(o=e.index,i=0;o<a.length;o++){switch(a.charCodeAt(o)){case 34:n="&quot;";break;case 38:n="&amp;";break;case 60:n="&lt;";break;case 62:n="&gt;";break;default:continue}i!==o&&(r+=a.substring(i,o)),i=o+1,r+=n}return i!==o?r+a.substring(i,o):r}function r(t,a,e,o){if(!(t instanceof Error))throw t;if(!("undefined"==typeof window&&a||o))throw t.message+=" on line "+e,t;try{o=o||require("fs").readFileSync(a,"utf8")}catch(a){r(t,null,e)}var i=3,n=o.split("\n"),d=Math.max(e-i,0),l=Math.min(n.length,e+i),i=n.slice(d,l).map(function(t,a){var o=a+d+1;return(o==e?" > ":" ")+o+"| "+t}).join("\n");throw t.path=a,t.message=(a||"Pug")+":"+e+"\n"+i+"\n\n"+t.message,t}var d=Object.prototype.hasOwnProperty;t.merge=a,t.classes=e,t.style=o,t.attr=i,t.attrs=function(t,a){var n="";for(var r in t)if(d.call(t,r)){var l=t[r];if("class"===r){n=i(r,l=e(l),!1,a)+n;continue}"style"===r&&(l=o(l)),n+=i(r,l,!1,a)}return n};var l=/["&<>]/;return t.escape=n,t.rethrow=r,t}({}),d=function(t){var a,e="",o={};try{var i={},n=t||{};(function(t,i,n,d,l,s,m,y,b,u,c,p,_,f,g,h,v,x,w){o.button=a=function(){this&&this.block,this&&this.attributes;e=(e=(e+='<div class="abtasty-modal__button">')+"<a"+(r.attr("href",b,!0,!0)+r.attr("style",r.style({"background-color":y,color:c}),!0,!0))+">")+r.escape(null==(a=u)?"":a)+"</a></div>"},o.title=a=function(){this&&this.block,this&&this.attributes;e=(e+='<h2 class="abtasty-modal__title">')+r.escape(null==(a=v)?"":a)+"</h2>"},o.image=a=function(){this&&this.block,this&&this.attributes;e+='<div class="abtasty-modal__image">',f&&(e=e+"<img"+(r.attr("src",f,!0,!0)+r.attr("style",r.style({"border-radius":l+"px"}),!0,!0))+">"),e+="</div>"},o.content=a=function(){this&&this.block,this&&this.attributes;e=(e+='<p class="abtasty-modal__innertext">')+r.escape(null==(a=h)?"":a)+"</p>"},o.closeButton=a=function(){this&&this.block,this&&this.attributes;e=e+"<div"+r.attr("class",r.classes(["abtasty-modal__close",p?"abtasty-modal__close--"+p:""],[!1,!0]),!1,!0)+">",e+="×</div>"},o.contentWrapper=a=function(){var t=this&&this.block;this&&this.attributes;e=e+'<div class="abtasty-modal__content"'+r.attr("style",r.style({"border-radius":l+"px","border-width":s+"px","border-color":d,"background-color":i,"background-image":n?'url("'+n+'")':"none"}),!0,!0)+">",t&&t&&t(),e+="</div>"},o.modalWrapper=a=function(){var a=this&&this.block;this&&this.attributes;e=(e+="<abtasty-modal__underlay></abtasty-modal__underlay>")+"<div"+(r.attr("class",r.classes(["abtasty-animation-"+t+" abtasty-modal__area abtasty-modal__area-width--"+w+" abtasty-modal__area-type--"+x+" abtasty-modal__area-layout--"+g],[!0]),!1,!0)+r.attr("style",r.style({width:"custom"===w&&_+"%","margin-left":"custom"===w&&(100-_)/2+"% !important"}),!0,!0))+">",a&&a&&a(),e+="</div>"},o.modalWrapper.call({block:function(){o.closeButton(),o.contentWrapper.call({block:function(){"simple"===x?(e+='<div class="abtasty-modal__text">',"center"===g||"left"===g?(o.title(),o.content(),e+='<div style="clear:both;"></div>'):(o.content(),o.title(),e+='<div style="clear:both;"></div>'),e+="</div>",m&&o.button()):"image"===x?("top"!==g&&"left"!==g||o.image(),e+='<div class="abtasty-modal__text">',o.title(),o.content(),m&&o.button(),e+="</div>","right"!==g&&"bottom"!==g||o.image(),e+='<div style="clear:both;"></div>'):"video"===x&&("top"===g&&o.title(),e+=null==(a=h)?"":a,"bottom"===g&&o.title(),m&&o.button())}})}})}).call(this,"animation"in n?n.animation:"undefined"!=typeof animation?animation:void 0,"backgroundColor"in n?n.backgroundColor:"undefined"!=typeof backgroundColor?backgroundColor:void 0,"backgroundImage"in n?n.backgroundImage:"undefined"!=typeof backgroundImage?backgroundImage:void 0,"borderColor"in n?n.borderColor:"undefined"!=typeof borderColor?borderColor:void 0,"borderRadius"in n?n.borderRadius:"undefined"!=typeof borderRadius?borderRadius:void 0,"borderWidth"in n?n.borderWidth:"undefined"!=typeof borderWidth?borderWidth:void 0,"button"in n?n.button:"undefined"!=typeof button?button:void 0,"buttonBackgroundColor"in n?n.buttonBackgroundColor:"undefined"!=typeof buttonBackgroundColor?buttonBackgroundColor:void 0,"buttonLink"in n?n.buttonLink:"undefined"!=typeof buttonLink?buttonLink:void 0,"buttonText"in n?n.buttonText:"undefined"!=typeof buttonText?buttonText:void 0,"buttonTextColor"in n?n.buttonTextColor:"undefined"!=typeof buttonTextColor?buttonTextColor:void 0,"closeButtonPosition"in n?n.closeButtonPosition:"undefined"!=typeof closeButtonPosition?closeButtonPosition:void 0,"customWidth"in n?n.customWidth:"undefined"!=typeof customWidth?customWidth:void 0,"image"in n?n.image:"undefined"!=typeof image?image:void 0,"layout"in n?n.layout:"undefined"!=typeof layout?layout:void 0,"modalContent"in n?n.modalContent:"undefined"!=typeof modalContent?modalContent:void 0,"title"in n?n.title:"undefined"!=typeof title?title:void 0,"type"in n?n.type:"undefined"!=typeof type?type:void 0,"width"in n?n.width:"undefined"!=typeof width?width:void 0)}catch(t){r.rethrow(t,void 0,void 0,i[void 0])}return e},l=DATA,s=l.type,m=void 0===s?"simple":s,y=l.actionTrackingEvent,b=l.actionTrackingName,u=l.animation,c=l.backgroundColor,p=l.backgroundImage,_=l.borderRadius,f=l.borderWidth,g=l.borderColor,h=l.button,v=l.buttonBackgroundColor,x=l.buttonLink,w=l.buttonText,k=l.buttonTextColor,T=l.closeButtonColor,C=l.closeButtonPosition,E=l.content,S=l.customWidth,L=l.title,B=l.image,Y=l.layout,I=l.videoLink,A=l.recurrence,W=l.triggerEvent,O=l.triggerEventDelay,D=l.clickEventSelector,q=l.width,z=l.autoPlay,N=document.createElement("abtasty-modal"),P="AB Tasty Modal "+m+" "+TEST_ID,M=void 0!==window.ABTastyEditor,R=!!sessionStorage.getItem("ABTastyPreview"),H="abtasty-modal__underlay",j=".abtasty-modal__close",J=Date.now(),F=void 0,$=void 0;!function(t){"loading"!==document.readyState?t():document.addEventListener("DOMContentLoaded",t)}(function(){if("click"===W)!function(t,a,e){document.body.addEventListener("click",function(o){var i=o.target;if(!e||!i.matches(e))for(;i;){if(i!==document&&i.matches(t)){a();break}i=i.parentNode}})}(D,n,H+", "+j);else if(function(){var t=Number(A),a=localStorage.getItem(P);return!(a&&-1!==t&&!M&&!R)||(0===t?!sessionStorage.getItem(P):a<J-24*t*60*60*1e3)}())switch(W){case"pageLoad":n();break;case"exitIntent":!function(t){var a=DATA.exitEventDelay,e=parseFloat(a)||0,o=void 0,i=0;document.addEventListener("mousemove",function(t){i=t.clientY}),document.addEventListener("mouseleave",function a(n){n.clientY<=50&&(i=0,clearInterval(o),o=setTimeout(function(){0===i&&(t(),document.removeEventListener("mouseleave",a))},1e3*e))},!1)}(n);break;case"reengage":!function(t){var a=DATA.reengageEventDelay,e=["mousemove","keydown","scroll"],o=void 0;e.forEach(function(i){document.addEventListener(i,function i(){clearTimeout(o),o=setTimeout(function(){t(),e.forEach(function(t){return document.removeEventListener(t,i)})},1e3*a)},!1)})}(n);break;case"timer":setTimeout(n,1e3*O)}})}();
{
"name": "@abtasty/modal",
"description": "Widget for AB Tasty",
"version": "2.0.4",
"version": "2.0.5",
"icon": "icon.png",
"form": "form.js",
"form": "dist/form.js",
"main": "dist/main.js",
"files": [
"icon.png",
"form.html",
"dist/main.js"
"dist"
],

@@ -24,2 +23,3 @@ "repository": "https://gitlab.com/abtasty/widgets/modal",

"devDependencies": {
"array-from": "^2.1.1",
"babel-preset-env": "^1.6.1",

@@ -26,0 +26,0 @@ "concurrently": "^3.5.0",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc