View file File name : ast-addon-customizer-preview.min.js Content :function astra_hex2rgba(e,r){e=e.replace("#","");var a=g=b="",e=(b=3==e.length?(a=get_hexdec(e.substring(0,1)+e.substring(0,1)),g=get_hexdec(e.substring(1,1)+e.substring(1,1)),get_hexdec(e.substring(2,1)+e.substring(2,1))):(a=get_hexdec(e.substring(0,2)),g=get_hexdec(e.substring(2,4)),get_hexdec(e.substring(4,6))),a+","+g+","+b);return""==r?"rgb("+e+")":"rgba("+e+","+(r=parseFloat(r))+")"}function astraIsHexColor(e){return isHex=!1,regexp=/^[0-9a-fA-F]+$/,isHex=regexp.test(e)?!0:isHex}function astraTrimAlpha(e){return e.replace(/^\s+|\s+$/gm,"")}function astraRgbaToHex(e){var r,a,t,o;return""===e||astraIsHexColor(e.replace("#",""))||(o=e.substring(e.indexOf("(")).split(","),r=parseInt(astraTrimAlpha(o[0].substring(1)),10),a=parseInt(astraTrimAlpha(o[1]),10),t=parseInt(astraTrimAlpha(o[2]),10),o=parseFloat(astraTrimAlpha(o[3].substring(0,o[3].length-1))).toFixed(2),e="#"+r.toString(16)+a.toString(16)+t.toString(16)+(255*o).toString(16).substring(0,2)),e}function astra_color_responsive_css(o,i,n,g){wp.customize(i,function(e){e.bind(function(e){var r,a,t;e.desktop||e.mobile||e.tablet?(i=(i=i.replace("[","-")).replace("]",""),jQuery("style#"+i+"-"+o).remove(),(t=a=r="")!=e.desktop&&(r=n+": "+e.desktop),""!=e.tablet&&(a=n+": "+e.tablet),""!=e.mobile&&(t=n+": "+e.mobile),jQuery("head").append('<style id="'+i+"-"+o+'">'+g+"\t{ "+r+" }@media (max-width: 768px) {"+g+"\t{ "+a+" } }@media (max-width: 544px) {"+g+"\t{ "+t+" } }</style>")):jQuery("style#"+i+"-"+o).remove()})})}function astra_apply_responsive_background_css(d,c,u,e,b){wp.customize(d,function(e){e.bind(function(e){if(b=(b=b||"")||"header",d=(d=d.replace("[","-")).replace("]",""),""!==e[u]&&void 0!==e[u]){var r,a="",t=e[u]["background-image"],o=e.tablet["background-image"],i=e.desktop["background-image"],n=e[u]["background-color"],g=!!e.tablet["background-image"],s=!!e.desktop["background-image"];if(void 0!==e[u]["background-type"]&&""!==e[u]["background-type"])if("color"===e[u]["background-type"])""!==t&&""!==n&&void 0!==n&&"unset"!==n?a="background-image: linear-gradient(to right, "+n+", "+n+"), url("+t+");":"mobile"===u?s?a="background-image: linear-gradient(to right, "+n+", "+n+"), url("+i+");":g?a="background-image: linear-gradient(to right, "+n+", "+n+"), url("+o+");":(a="background-color: "+n+";",a+="background-image: none;"):"tablet"===u?s?a="background-image: linear-gradient(to right, "+n+", "+n+"), url("+i+");":(a="background-color: "+n+";",a+="background-image: none;"):void 0!==t&&""!==t||(a="background-color: "+n+";",a+="background-image: none;");else if("image"===e[u]["background-type"]){if(""!==t)if("overlay-type"in e[u]&&"none"!==e[u]["overlay-type"]){g="overlay-color"in e[u]?e[u]["overlay-color"]:"",o="overlay-opacity"in e[u]?e[u]["overlay-opacity"]:"",s="overlay-gradient"in e[u]?e[u]["overlay-gradient"]:"";if("classic"===e[u]["overlay-type"]&&""!==g){if(""!==o)return void wp.customize.preview.send("refresh");a="background-image: linear-gradient(to right, "+g+", "+g+"), url("+t+");"}else a="gradient"===e[u]["overlay-type"]&&""!==s?"background-image: "+s+", url("+t+");":"background-image: url("+t+");"}else a="background-image: url("+t+");"}else"gradient"===e[u]["background-type"]&&""!==n&&"unset"!==n&&(a="background-image: "+n+";");""!==t&&(a=(a=(a=(a+="background-repeat: "+e[u]["background-repeat"]+";")+"background-position: "+e[u]["background-position"]+";")+"background-size: "+e[u]["background-size"]+";")+"background-attachment: "+e[u]["background-attachment"]+";"),jQuery("style#"+d+"-"+u+"-"+b).remove(),"desktop"==u&&(r='<style id="'+d+"-"+u+"-"+b+'">'+c+"\t{ "+a+" }</style>"),"tablet"==u&&(r='<style id="'+d+"-"+u+"-"+b+'">@media (max-width: 768px) {'+c+"\t{ "+a+" } }</style>"),"mobile"==u&&(r='<style id="'+d+"-"+u+"-"+b+'">@media (max-width: 544px) {'+c+"\t{ "+a+" } }</style>"),jQuery("head").append(r)}})})}function astra_responsive_background_obj_css(e,r,a,t,o){var i,n,g,s;""!==r[o]&&void 0!==r[o]&&(n=r[o]["background-image"],g=r[o]["background-color"],(i="")!==n&&""!==g?void 0!==g&&(i="background-image: linear-gradient(to right, "+g+", "+g+"), url("+n+");"):""!==n?i="background-image: url("+n+");":""!==g&&(i="background-color: "+g+";"),""!==n?i=(i=(i=(i+="background-repeat: "+r[o]["background-repeat"]+";")+"background-position: "+r[o]["background-position"]+";")+"background-size: "+r[o]["background-size"]+";")+"background-attachment: "+r[o]["background-attachment"]+";":i+="background-image: none;","desktop"==o&&(s=t.replace("{{css}}",i)),"tablet"==o&&(s="@media (max-width: 768px) {"+t.replace("{{css}}",i)+"};"),"mobile"==o&&(s="@media (max-width: 544px) {"+t.replace("{{css}}",i)+"};"),astra_add_dynamic_css(a+"-"+o,s))}function astra_responsive_background_obj_refresh(e){void 0!==e.desktop&&void 0!==e.tablet&&void 0!==e.mobile&&""===e.desktop["background-color"]&&""===e.tablet["background-color"]&&""===e.mobile["background-color"]&&wp.customize.preview.send("refresh")}