!function(D){"use strict";let W=[],M=!1;redux.field_objects=redux.field_objects||{},redux.field_objects.typography=redux.field_objects.typography||{},redux.field_objects.typography.init=function(e){e=D.redux.getSelector(e,"typography"),D(e).each(function(){var e=D(this);let t=e;(t=e.hasClass("redux-field-container")?t:e.parents(".redux-field-container:first")).is(":hidden")||e.each(function(){D(this).find(".redux-typography-container").each(function(){var e,t=D(this);let a=t,r,s,o=D(this).find(".redux-typography-family");var i=o.data("value"),p=D(this).find(".redux-typography-family").parents(".redux-container-typography:first").data("id"),d=D("#"+p+" .redux-typography-google").val(),n=[],y=[],l=D("#"+p+" .redux-typography-font-family").data("user-fonts");if(!(a=t.hasClass("redux-field-container")?a:t.parents(".redux-field-container:first")).is(":hidden")&&a.hasClass("redux-field-init")){if(a.removeClass("redux-field-init"),void 0===i?o=D(this):""!==i&&D(o).val(i),l=l?1:0,d=d?1:0,void 0!==redux.customfonts&&n.push(redux.customfonts),void 0!==redux.typekitfonts&&n.push(redux.typekitfonts),void 0!==redux.stdfonts&&0==l&&n.push(redux.stdfonts),1==l){for(r in redux.optName.typography[p])if(redux.optName.typography[p].hasOwnProperty(r))for(s in e=redux.optName.typography[p].std_font)e.hasOwnProperty(s)&&y.push({id:s,text:s,"data-google":"false"});n.push({text:"Standard Fonts",children:y})}(1==d||!0===d&&void 0!==redux.googlefonts)&&n.push(redux.googlefonts),i=n,l=D(this).find(".redux-typography-family").data("value"),D(this).find(".redux-typography-family").addClass("ignore-change"),D(this).find(".redux-typography-family").select2({data:i}),D(this).find(".redux-typography-family").val(l).trigger("change"),D(this).find(".redux-typography-family").removeClass("ignore-change"),t.find(".redux-typography-family").hasClass("redux-typography-family")||t.find(".redux-typography-style").select2(),D(this).find(".redux-typography-subsets").select2(),D(this).find(".redux-typography-align").select2(),D(this).find(".redux-typography-family-backup").select2(),D(this).find(".redux-typography-transform").select2(),D(this).find(".redux-typography-font-variant").select2(),D(this).find(".redux-typography-decoration").select2(),D(this).find(".redux-insights-data-we-collect-typography").on("click",function(e){e.preventDefault(),D(this).parent().find(".description").toggle()}),redux.field_objects.typography.select(o,!0,!1,null,!0),D(this).find(".redux-typography-family, .redux-typography-family-backup, .redux-typography-style, .redux-typography-subsets, .redux-typography-align").on("change",function(e){var t;let a;var r=D(this).attr("id"),r=D("#"+r);D(this).hasClass("redux-typography-family")?r.val()&&(t=D(this).select2("data"),a=t?t[0].text:null,r.data("value",a),W=t[0],M=!0,redux.field_objects.typography.select(r,!0,!1,a,!0)):(e=r.val(),r.data("value",e),(D(this).hasClass("redux-typography-align")||D(this).hasClass("redux-typography-subsets")||D(this).hasClass("redux-typography-family-backup")||D(this).hasClass("redux-typography-transform")||D(this).hasClass("redux-typography-font-variant")||D(this).hasClass("redux-typography-decoration"))&&(r.find('option[selected="selected"]').attr("selected",!1),r.find('option[value="'+e+'"]').attr("selected","selected")),D(this).hasClass("redux-typography-subsets")&&r.siblings(".typography-subsets").val(e),redux.field_objects.typography.select(D(this),!0,!1,null,!1))}),D(this).find(".redux-typography-size, .redux-typography-height, .redux-typography-word, .redux-typography-letter, .redux-typography-margin-top, .redux-typography-margin-bottom").on("keyup",function(){redux.field_objects.typography.select(D(this).parents(".redux-container-typography:first"))}),D(this).find(".redux-typography-color, .redux-typography-shadow-color").wpColorPicker({change:function(e,t){D(this).val(t.color.toString()),redux.field_objects.typography.select(D(this).parents(".redux-container-typography:first"))}}),D(this).find(".redux-typography-size").numeric({allowMinus:!1}),D(this).find(".redux-typography-height, .redux-typography-word, .redux-typography-letter").numeric({allowMinus:!0}),D(this).find(".redux-typography").on("select2:unselecting",function(){var e,t;const a=D(this).data("select2").options;a.set("disabled",!0),setTimeout(function(){a.set("disabled",!1)},1),e=D(this).attr("id"),(t=D("#"+e)).data("value",""),D(this).hasClass("redux-typography-family")?(D(this).find(".redux-typography-family").addClass("ignore-change"),D(this).val(null).trigger("change"),D(this).find(".redux-typography-family").removeClass("ignore-change"),redux.field_objects.typography.select(t,!0,!1,null,!0)):((D(this).hasClass("redux-typography-align")||D(this).hasClass("redux-typography-subsets")||D(this).hasClass("redux-typography-family-backup")||D(this).hasClass("redux-typography-transform")||D(this).hasClass("redux-typography-font-variant")||D(this).hasClass("redux-typography-decoration"))&&D("#"+e+' option[selected="selected"]').removeAttr("selected"),D(this).hasClass("redux-typography-subsets")&&t.siblings(".typography-subsets").val(""),D(this).hasClass("redux-typography-family-backup")&&(D(this).find(".redux-typography-family-backup").addClass("ignore-change"),t.val(null).trigger("change"),D(this).find(".redux-typography-family-backup").removeClass("ignore-change")),redux.field_objects.typography.select(D(this),!0,!1,null,!1))}),redux.field_objects.typography.updates(D(this)),window.onbeforeunload=null,a.removeClass("redux-field-init"),redux.field_objects.typography.sliderInit(t)}})})})},redux.field_objects.typography.sliderInit=function(d){d.find(".redux-typography-slider").each(function(){const e=D(this).data("id");var t=D(this).data("min"),a=D(this).data("max"),r=D(this).data("step"),s=D(this).data("default");const o=D(this).data("label");var i=Boolean(D(this).data("rtl")),t=[t,a];const p=D(this).reduxNoUiSlider({range:t,start:s,handles:1,step:r,connect:"lower",behaviour:"tap-drag",rtl:i,serialization:{resolution:1},slide:function(){D(this).next("#redux-slider-value-"+e).attr("value",p.val()),D(this).prev("label").html(o+": "+p.val()+"px"),redux.field_objects.typography.select(d)}})})},redux.field_objects.typography.updates=function(s){s.find(".update-google-fonts").on("click",function(e){const a=D(this).data("action"),r=D(this).parent().parent();var t=r.attr("data-nonce");return r.find("p").text(redux_typography_ajax.update_google_fonts.updating),r.find("p").attr("aria-label",redux_typography_ajax.update_google_fonts.updating),r.removeClass("updating-message updated-message notice-success notice-warning notice-error").addClass("update-message notice-warning updating-message"),D.ajax({type:"post",dataType:"json",url:redux_typography_ajax.ajaxurl,data:{action:"redux_update_google_fonts",nonce:t,data:a},error:function(e){let t;console.log(e),r.removeClass("notice-warning updating-message updated-message notice-success").addClass("notice-error"),t=(t=e.error)&&': "'+t+'"',r.find("p").html(redux_typography_ajax.update_google_fonts.error.replace("%s",a).replace("|msg",t)),r.find("p").attr("aria-label",redux_typography_ajax.update_google_fonts.error),redux.field_objects.typography.updates(s)},success:function(e){let t;console.log(e),"success"===e.status?(r.find("p").html(redux_typography_ajax.update_google_fonts.success),r.find("p").attr("aria-label",redux_typography_ajax.update_google_fonts.success),r.removeClass("updating-message notice-warning").addClass("updated-message notice-success"),D(".redux-update-google-fonts").not(".notice-success").remove()):(r.removeClass("notice-warning updating-message updated-message notice-success").addClass("notice-error"),t=(t=e.error)&&': "'+t+'"',r.find("p").html(redux_typography_ajax.update_google_fonts.error.replace("%s",a).replace("|msg",t)),r.find("p").attr("aria-label",redux_typography_ajax.update_google_fonts.error),redux.field_objects.typography.updates(s))}}),e.preventDefault(),!1})},redux.field_objects.typography.size=function(e){let t=0,a;for(a in e)e.hasOwnProperty(a)&&(t+=1);return t},redux.field_objects.typography.makeBool=function(e){return"false"!==e&&"0"!==e&&!1!==e&&0!==e&&("true"===e||"1"===e||!0===e||1===e||void 0)},redux.field_objects.typography.contrastColour=function(e){var t,a;let r="#444444";return""!==e&&(e=e.replace("#",""),t=parseInt(e.substring(0,2),16),a=parseInt(e.substring(2,2),16),e=parseInt(e.substring(4,2),16),r=128<=(299*t+587*a+114*e)/1e3?"#444444":"#ffffff"),r},redux.field_objects.typography.hexToInt=function(e){return 0===e.indexOf("#")&&(e=e.slice(1)),parseInt(e,16)},redux.field_objects.typography.select=function(e,t,a,r,s){let o,i,p,d;var n,y,l,h,g,u,f,c,x,v;let m,b,_,w,C,j,k,z,I,O,S,T,B=!1,N="",F='',P="";void 0===(o=D(e).parents(".redux-container-typography:first").data("id"))&&(o=D(e).data("id")),i=D("#"+o),p=(p=D("#"+o+"-family").val())||null,r&&(p=r),r=i.find("select.redux-typography-family-backup").val(),n=i.find(".redux-typography-size").val(),m=i.find(".redux-typography-height").val(),b=i.find(".redux-typography-word").val(),_=i.find(".redux-typography-letter").val(),y=i.find("select.redux-typography-align").val(),l=i.find("select.redux-typography-transform").val(),h=i.find("select.redux-typography-font-variant").val(),g=i.find("select.redux-typography-decoration").val(),w=i.find("select.redux-typography-style").val(),C=i.find("select.redux-typography-subsets").val(),u=i.find(".redux-typography-color").val(),c=i.find(".redux-typography-margin-top").val(),x=i.find(".redux-typography-margin-bottom").val(),v=i.find(".typography-style"),f=i.data("units"),void 0===b&&(b="0"),void 0===_&&(_="0"),0