!function(t){const e=wp.customize,i=new function(){let e=null;const i={resize(i){if(e){const e=new Image,n=t(".site-header .custom-logo");let c={width:parseInt(n.attr("width"),10),height:parseInt(n.attr("height"),10)};const s={width:parseInt(n.css("max-width"),10),height:parseInt(n.css("max-height"),10)},r=new Object;r.width=t.isNumeric(s.width)?s.width:600,r.height=t.isNumeric(s.height)?s.height:c.height,e.onload=function(){let t=new Object;c.width>=c.height?(t=o(c.height,c.width,r.height,r.width,i,48),c={height:t.a,width:t.b}):c.width<c.height&&(t=o(c.width,c.height,r.width,r.height,i,48),c={height:t.b,width:t.a}),n.css({width:c.width,height:c.height})},e.src=n.attr("src"),clearTimeout(h),h=setTimeout((function(){t(document.body).resize()}),500)}},add(){const i=setInterval((function(){t(".custom-logo[src]").length&&(clearInterval(i),e=!0)}),500)},change(){const h=t(".custom-logo").attr("src"),n=setInterval((function(){t(".custom-logo").attr("src")!==h&&(clearInterval(n),e=!0,i.resize(50))}),100)},remove(){e=null}};return i};let h;function n(t,e){""===t?i.remove():void 0===e?i.add():i.change(),e=t}function o(t,e,i,h,n,o){const c=new Object,s=new Object,r=e/t;c.b=h>=e?e:h,c.a=i>=c.b/r?Math.floor(c.b/r):i;const a=(c.a-o)/100;return s.a=Math.floor(o+n*a),s.b=Math.floor(s.a*r),s}e("custom_logo",(function(t){n(t()),t.bind(n)})),e("logo_size",(function(t){i.resize(t()),t.bind(i.resize)}))}(jQuery);