/home/awneajlw/faizastore.com/wp-content/plugins/popup-builder-block/build/popup/helpers.js
(()=>{var t={5371:(t,e,o)=>{var n;!function(){function i(t,e,o){return t.call.apply(t.bind,arguments)}function r(t,e,o){if(!t)throw Error();if(2<arguments.length){var n=Array.prototype.slice.call(arguments,2);return function(){var o=Array.prototype.slice.call(arguments);return Array.prototype.unshift.apply(o,n),t.apply(e,o)}}return function(){return t.apply(e,arguments)}}function a(t,e,o){return(a=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?i:r).apply(null,arguments)}var s=Date.now||function(){return+new Date};function c(t,e){this.a=t,this.o=e||t,this.c=this.o.document}var l=!!window.FontFace;function u(t,e,o,n){if(e=t.c.createElement(e),o)for(var i in o)o.hasOwnProperty(i)&&("style"==i?e.style.cssText=o[i]:e.setAttribute(i,o[i]));return n&&e.appendChild(t.c.createTextNode(n)),e}function f(t,e,o){(t=t.c.getElementsByTagName(e)[0])||(t=document.documentElement),t.insertBefore(o,t.lastChild)}function g(t){t.parentNode&&t.parentNode.removeChild(t)}function d(t,e,o){e=e||[],o=o||[];for(var n=t.className.split(/\s+/),i=0;i<e.length;i+=1){for(var r=!1,a=0;a<n.length;a+=1)if(e[i]===n[a]){r=!0;break}r||n.push(e[i])}for(e=[],i=0;i<n.length;i+=1){for(r=!1,a=0;a<o.length;a+=1)if(n[i]===o[a]){r=!0;break}r||e.push(n[i])}t.className=e.join(" ").replace(/\s+/g," ").replace(/^\s+|\s+$/,"")}function h(t,e){for(var o=t.className.split(/\s+/),n=0,i=o.length;n<i;n++)if(o[n]==e)return!0;return!1}function p(t,e,o){function n(){s&&i&&r&&(s(a),s=null)}e=u(t,"link",{rel:"stylesheet",href:e,media:"all"});var i=!1,r=!0,a=null,s=o||null;l?(e.onload=function(){i=!0,n()},e.onerror=function(){i=!0,a=Error("Stylesheet failed to load"),n()}):setTimeout(function(){i=!0,n()},0),f(t,"head",e)}function m(t,e,o,n){var i=t.c.getElementsByTagName("head")[0];if(i){var r=u(t,"script",{src:e}),a=!1;return r.onload=r.onreadystatechange=function(){a||this.readyState&&"loaded"!=this.readyState&&"complete"!=this.readyState||(a=!0,o&&o(null),r.onload=r.onreadystatechange=null,"HEAD"==r.parentNode.tagName&&i.removeChild(r))},i.appendChild(r),setTimeout(function(){a||(a=!0,o&&o(Error("Script load timeout")))},n||5e3),r}return null}function b(){this.a=0,this.c=null}function v(t){return t.a++,function(){t.a--,w(t)}}function k(t,e){t.c=e,w(t)}function w(t){0==t.a&&t.c&&(t.c(),t.c=null)}function y(t){this.a=t||"-"}function S(t,e){this.c=t,this.f=4,this.a="n";var o=(e||"n4").match(/^([nio])([1-9])$/i);o&&(this.a=o[1],this.f=parseInt(o[2],10))}function $(t){var e=[];t=t.split(/,\s*/);for(var o=0;o<t.length;o++){var n=t[o].replace(/['"]/g,"");-1!=n.indexOf(" ")||/^\d/.test(n)?e.push("'"+n+"'"):e.push(n)}return e.join(",")}function x(t){return t.a+t.f}function T(t){var e="normal";return"o"===t.a?e="oblique":"i"===t.a&&(e="italic"),e}function z(t){var e=4,o="n",n=null;return t&&((n=t.match(/(normal|oblique|italic)/i))&&n[1]&&(o=n[1].substr(0,1).toLowerCase()),(n=t.match(/([1-9]00|normal|bold)/i))&&n[1]&&(/bold/i.test(n[1])?e=7:/[1-9]00/.test(n[1])&&(e=parseInt(n[1].substr(0,1),10)))),o+e}function C(t,e){this.c=t,this.f=t.o.document.documentElement,this.h=e,this.a=new y("-"),this.j=!1!==e.events,this.g=!1!==e.classes}function j(t){if(t.g){var e=h(t.f,t.a.c("wf","active")),o=[],n=[t.a.c("wf","loading")];e||o.push(t.a.c("wf","inactive")),d(t.f,o,n)}A(t,"inactive")}function A(t,e,o){t.j&&t.h[e]&&(o?t.h[e](o.c,x(o)):t.h[e]())}function P(){this.c={}}function N(t,e){this.c=t,this.f=e,this.a=u(this.c,"span",{"aria-hidden":"true"},this.f)}function _(t){f(t.c,"body",t.a)}function E(t){return"display:block;position:absolute;top:-9999px;left:-9999px;font-size:300px;width:auto;height:auto;line-height:normal;margin:0;padding:0;font-variant:normal;white-space:nowrap;font-family:"+$(t.c)+";font-style:"+T(t)+";font-weight:"+t.f+"00;"}function I(t,e,o,n,i,r){this.g=t,this.j=e,this.a=n,this.c=o,this.f=i||3e3,this.h=r||void 0}function O(t,e,o,n,i,r,a){this.v=t,this.B=e,this.c=o,this.a=n,this.s=a||"BESbswy",this.f={},this.w=i||3e3,this.u=r||null,this.m=this.j=this.h=this.g=null,this.g=new N(this.c,this.s),this.h=new N(this.c,this.s),this.j=new N(this.c,this.s),this.m=new N(this.c,this.s),t=E(t=new S(this.a.c+",serif",x(this.a))),this.g.a.style.cssText=t,t=E(t=new S(this.a.c+",sans-serif",x(this.a))),this.h.a.style.cssText=t,t=E(t=new S("serif",x(this.a))),this.j.a.style.cssText=t,t=E(t=new S("sans-serif",x(this.a))),this.m.a.style.cssText=t,_(this.g),_(this.h),_(this.j),_(this.m)}y.prototype.c=function(t){for(var e=[],o=0;o<arguments.length;o++)e.push(arguments[o].replace(/[\W_]+/g,"").toLowerCase());return e.join(this.a)},I.prototype.start=function(){var t=this.c.o.document,e=this,o=s(),n=new Promise(function(n,i){!function r(){s()-o>=e.f?i():t.fonts.load(function(t){return T(t)+" "+t.f+"00 300px "+$(t.c)}(e.a),e.h).then(function(t){1<=t.length?n():setTimeout(r,25)},function(){i()})}()}),i=null,r=new Promise(function(t,o){i=setTimeout(o,e.f)});Promise.race([r,n]).then(function(){i&&(clearTimeout(i),i=null),e.g(e.a)},function(){e.j(e.a)})};var D={D:"serif",C:"sans-serif"},F=null;function H(){if(null===F){var t=/AppleWebKit\/([0-9]+)(?:\.([0-9]+))/.exec(window.navigator.userAgent);F=!!t&&(536>parseInt(t[1],10)||536===parseInt(t[1],10)&&11>=parseInt(t[2],10))}return F}function B(t,e,o){for(var n in D)if(D.hasOwnProperty(n)&&e===t.f[D[n]]&&o===t.f[D[n]])return!0;return!1}function W(t){var e,o=t.g.a.offsetWidth,n=t.h.a.offsetWidth;(e=o===t.f.serif&&n===t.f["sans-serif"])||(e=H()&&B(t,o,n)),e?s()-t.A>=t.w?H()&&B(t,o,n)&&(null===t.u||t.u.hasOwnProperty(t.a.c))?M(t,t.v):M(t,t.B):function(t){setTimeout(a(function(){W(this)},t),50)}(t):M(t,t.v)}function M(t,e){setTimeout(a(function(){g(this.g.a),g(this.h.a),g(this.j.a),g(this.m.a),e(this.a)},t),0)}function L(t,e,o){this.c=t,this.a=e,this.f=0,this.m=this.j=!1,this.s=o}O.prototype.start=function(){this.f.serif=this.j.a.offsetWidth,this.f["sans-serif"]=this.m.a.offsetWidth,this.A=s(),W(this)};var X=null;function R(t){0==--t.f&&t.j&&(t.m?((t=t.a).g&&d(t.f,[t.a.c("wf","active")],[t.a.c("wf","loading"),t.a.c("wf","inactive")]),A(t,"active")):j(t.a))}function Y(t){this.j=t,this.a=new P,this.h=0,this.f=this.g=!0}function V(t,e,o,n,i){var r=0==--t.h;(t.f||t.g)&&setTimeout(function(){var t=i||null,s=n||{};if(0===o.length&&r)j(e.a);else{e.f+=o.length,r&&(e.j=r);var c,l=[];for(c=0;c<o.length;c++){var u=o[c],f=s[u.c],g=e.a,h=u;if(g.g&&d(g.f,[g.a.c("wf",h.c,x(h).toString(),"loading")]),A(g,"fontloading",h),g=null,null===X)if(window.FontFace){h=/Gecko.*Firefox\/(\d+)/.exec(window.navigator.userAgent);var p=/OS X.*Version\/10\..*Safari/.exec(window.navigator.userAgent)&&/Apple/.exec(window.navigator.vendor);X=h?42<parseInt(h[1],10):!p}else X=!1;g=X?new I(a(e.g,e),a(e.h,e),e.c,u,e.s,f):new O(a(e.g,e),a(e.h,e),e.c,u,e.s,t,f),l.push(g)}for(c=0;c<l.length;c++)l[c].start()}},0)}function G(t,e){this.c=t,this.a=e}function U(t,e){this.c=t,this.a=e}function J(t,e){this.c=t||K,this.a=[],this.f=[],this.g=e||""}L.prototype.g=function(t){var e=this.a;e.g&&d(e.f,[e.a.c("wf",t.c,x(t).toString(),"active")],[e.a.c("wf",t.c,x(t).toString(),"loading"),e.a.c("wf",t.c,x(t).toString(),"inactive")]),A(e,"fontactive",t),this.m=!0,R(this)},L.prototype.h=function(t){var e=this.a;if(e.g){var o=h(e.f,e.a.c("wf",t.c,x(t).toString(),"active")),n=[],i=[e.a.c("wf",t.c,x(t).toString(),"loading")];o||n.push(e.a.c("wf",t.c,x(t).toString(),"inactive")),d(e.f,n,i)}A(e,"fontinactive",t),R(this)},Y.prototype.load=function(t){this.c=new c(this.j,t.context||this.j),this.g=!1!==t.events,this.f=!1!==t.classes,function(t,e,o){var n=[],i=o.timeout;!function(t){t.g&&d(t.f,[t.a.c("wf","loading")]),A(t,"loading")}(e),n=function(t,e,o){var n,i=[];for(n in e)if(e.hasOwnProperty(n)){var r=t.c[n];r&&i.push(r(e[n],o))}return i}(t.a,o,t.c);var r=new L(t.c,e,i);for(t.h=n.length,e=0,o=n.length;e<o;e++)n[e].load(function(e,o,n){V(t,r,e,o,n)})}(this,new C(this.c,t),t)},G.prototype.load=function(t){function e(){if(r["__mti_fntLst"+n]){var o,i=r["__mti_fntLst"+n](),a=[];if(i)for(var s=0;s<i.length;s++){var c=i[s].fontfamily;null!=i[s].fontStyle&&null!=i[s].fontWeight?(o=i[s].fontStyle+i[s].fontWeight,a.push(new S(c,o))):a.push(new S(c))}t(a)}else setTimeout(function(){e()},50)}var o=this,n=o.a.projectId,i=o.a.version;if(n){var r=o.c.o;m(this.c,(o.a.api||"https://fast.fonts.net/jsapi")+"/"+n+".js"+(i?"?v="+i:""),function(i){i?t([]):(r["__MonotypeConfiguration__"+n]=function(){return o.a},e())}).id="__MonotypeAPIScript__"+n}else t([])},U.prototype.load=function(t){var e,o,n=this.a.urls||[],i=this.a.families||[],r=this.a.testStrings||{},a=new b;for(e=0,o=n.length;e<o;e++)p(this.c,n[e],v(a));var s=[];for(e=0,o=i.length;e<o;e++)if((n=i[e].split(":"))[1])for(var c=n[1].split(","),l=0;l<c.length;l+=1)s.push(new S(n[0],c[l]));else s.push(new S(n[0]));k(a,function(){t(s,r)})};var K="https://fonts.googleapis.com/css";function q(t){this.f=t,this.a=[],this.c={}}var Q={latin:"BESbswy","latin-ext":"çöüğş",cyrillic:"йяЖ",greek:"αβΣ",khmer:"កខគ",Hanuman:"កខគ"},Z={thin:"1",extralight:"2","extra-light":"2",ultralight:"2","ultra-light":"2",light:"3",regular:"4",book:"4",medium:"5","semi-bold":"6",semibold:"6","demi-bold":"6",demibold:"6",bold:"7","extra-bold":"8",extrabold:"8","ultra-bold":"8",ultrabold:"8",black:"9",heavy:"9",l:"3",r:"4",b:"7"},tt={i:"i",italic:"i",n:"n",normal:"n"},et=/^(thin|(?:(?:extra|ultra)-?)?light|regular|book|medium|(?:(?:semi|demi|extra|ultra)-?)?bold|black|heavy|l|r|b|[1-9]00)?(n|i|normal|italic)?$/;function ot(t,e){this.c=t,this.a=e}var nt={Arimo:!0,Cousine:!0,Tinos:!0};function it(t,e){this.c=t,this.a=e}function rt(t,e){this.c=t,this.f=e,this.a=[]}ot.prototype.load=function(t){var e=new b,o=this.c,n=new J(this.a.api,this.a.text),i=this.a.families;!function(t,e){for(var o=e.length,n=0;n<o;n++){var i=e[n].split(":");3==i.length&&t.f.push(i.pop());var r="";2==i.length&&""!=i[1]&&(r=":"),t.a.push(i.join(r))}}(n,i);var r=new q(i);!function(t){for(var e=t.f.length,o=0;o<e;o++){var n=t.f[o].split(":"),i=n[0].replace(/\+/g," "),r=["n4"];if(2<=n.length){var a;if(a=[],s=n[1])for(var s,c=(s=s.split(",")).length,l=0;l<c;l++){var u;if((u=s[l]).match(/^[\w-]+$/))if(null==(f=et.exec(u.toLowerCase())))u="";else{if(u=null==(u=f[2])||""==u?"n":tt[u],null==(f=f[1])||""==f)f="4";else var f=Z[f]||(isNaN(f)?"4":f.substr(0,1));u=[u,f].join("")}else u="";u&&a.push(u)}0<a.length&&(r=a),3==n.length&&(a=[],0<(n=(n=n[2])?n.split(","):a).length&&(n=Q[n[0]])&&(t.c[i]=n))}for(t.c[i]||(n=Q[i])&&(t.c[i]=n),n=0;n<r.length;n+=1)t.a.push(new S(i,r[n]))}}(r),p(o,function(t){if(0==t.a.length)throw Error("No fonts to load!");if(-1!=t.c.indexOf("kit="))return t.c;for(var e=t.a.length,o=[],n=0;n<e;n++)o.push(t.a[n].replace(/ /g,"+"));return e=t.c+"?family="+o.join("%7C"),0<t.f.length&&(e+="&subset="+t.f.join(",")),0<t.g.length&&(e+="&text="+encodeURIComponent(t.g)),e}(n),v(e)),k(e,function(){t(r.a,r.c,nt)})},it.prototype.load=function(t){var e=this.a.id,o=this.c.o;e?m(this.c,(this.a.api||"https://use.typekit.net")+"/"+e+".js",function(e){if(e)t([]);else if(o.Typekit&&o.Typekit.config&&o.Typekit.config.fn){e=o.Typekit.config.fn;for(var n=[],i=0;i<e.length;i+=2)for(var r=e[i],a=e[i+1],s=0;s<a.length;s++)n.push(new S(r,a[s]));try{o.Typekit.load({events:!1,classes:!1,async:!0})}catch(t){}t(n)}},2e3):t([])},rt.prototype.load=function(t){var e=this.f.id,o=this.c.o,n=this;e?(o.__webfontfontdeckmodule__||(o.__webfontfontdeckmodule__={}),o.__webfontfontdeckmodule__[e]=function(e,o){for(var i=0,r=o.fonts.length;i<r;++i){var a=o.fonts[i];n.a.push(new S(a.name,z("font-weight:"+a.weight+";font-style:"+a.style)))}t(n.a)},m(this.c,(this.f.api||"https://f.fontdeck.com/s/css/js/")+function(t){return t.o.location.hostname||t.a.location.hostname}(this.c)+"/"+e+".js",function(e){e&&t([])})):t([])};var at=new Y(window);at.a.c.custom=function(t,e){return new U(e,t)},at.a.c.fontdeck=function(t,e){return new rt(e,t)},at.a.c.monotype=function(t,e){return new G(e,t)},at.a.c.typekit=function(t,e){return new it(e,t)},at.a.c.google=function(t,e){return new ot(e,t)};var st={load:a(at.load,at)};void 0===(n=function(){return st}.call(e,o,e,t))||(t.exports=n)}()}},e={};function o(n){var i=e[n];if(void 0!==i)return i.exports;var r=e[n]={exports:{}};return t[n](r,r.exports,o),r.exports}o.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return o.d(e,{a:e}),e},o.d=(t,e)=>{for(var n in e)o.o(e,n)&&!o.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},o.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),(()=>{"use strict";const t=(t,e,o)=>{const n=wp.data.select("core/block-editor").getSettings(),i=n&&n.__experimentalFeatures?n.__experimentalFeatures.color:{},r=i&&i[e]?i[e]:{};return Object.keys(r).map(e=>r[e].find(e=>e&&e[o]===t)).filter(t=>void 0!==t)[0]},e=t=>null==t||"object"==typeof t&&0===Object.keys(t).length||"string"==typeof t&&0===t.trim().length||!1===t,n=e=>{if(!e)return;if(e.startsWith("#")||e.startsWith("rgba")||e.startsWith("var("))return e;const[o,n]=e.split(","),i=t(o,"palette","slug");return i?.slug?`var(--wp--preset--color--${i.slug}, ${i.color})`:n||void 0},i=e=>{if(!e||e.startsWith("linear-gradient(")||e?.startsWith("radial-gradient("))return e;const o=e.split(/,(.+)/).filter(Boolean),n=t(o[0],"gradients","slug");return n?`var(--wp--preset--gradient--${n.slug}, ${n.gradient})`:o[1]},r=t=>{let o="";return o=e(t?.size)||e(t?.unit)?!e(t?.size)&&e(t?.unit)?`${t?.size}`:void 0:`${t?.size}${t?.unit}`,o},a=t=>{let o="";return!e(t?.blur)&&(o+=`blur(${t?.blur?.size}px) `),!e(t?.brightness)&&(o+=`brightness(${t?.brightness?.size}%) `),!e(t?.contrast)&&(o+=`contrast(${t?.contrast?.size}%) `),!e(t?.saturation)&&(o+=`saturate(${t?.saturation?.size}%) `),!e(t?.hue)&&(o+=`hue-rotate(${t?.hue?.size}deg) `),!e(t?.grayscale)&&(o+=`grayscale(${t?.grayscale?.size}%) `),!e(t?.invert)&&(o+=`invert(${t?.invert?.size}%) `),!e(t?.sepia)&&(o+=`sepia(${t?.sepia?.size}%) `),e(o)?void 0:o},s=window.wp.hooks,c=window.wp.url,l={label:"Desktop",slug:"Desktop",value:"base",icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" aria-hidden="true" focusable="false"><path d="M20.5 16h-.7V8c0-1.1-.9-2-2-2H6.2c-1.1 0-2 .9-2 2v8h-.7c-.8 0-1.5.7-1.5 1.5h20c0-.8-.7-1.5-1.5-1.5zM5.7 8c0-.3.2-.5.5-.5h11.6c.3 0 .5.2.5.5v7.6H5.7V8z"></path></svg>'},u=[l,{label:"Tablet",slug:"Tablet",value:"1024",direction:"max"},{label:"Mobile",slug:"Mobile",value:"767",direction:"max"}],f=window.wp.data,g=window.wp.editor,d=window.wp.element;var h=o(5371),p=o.n(h);const m=t=>{const{getBlockAttributes:e}=(0,f.select)("core/block-editor");return e(t)},b=(t,e)=>{const{updateBlockAttributes:o}=(0,f.dispatch)("core/block-editor");o(t,e)},v=window.wp.apiFetch;var k=o.n(v);const w=function(t,e,o){let n=`${t}=${e}; path=/`;if(o){const t=new Date;t.setTime(t.getTime()+60*o*60*1e3),n+=`; expires=${t.toUTCString()}`}document.cookie=n},y=function(t){const e=`; ${document.cookie}`.split(`; ${t}=`);return 2===e.length?e.pop().split(";").shift():null},S=new Set(["px","em","rem","%","vh","vw"]),$=t=>{const e=[];for(const o in t){const n=t[o];!n||S.has(n)||Number.isNaN(n)||"string"==typeof n&&n.includes("undefined")||e.push(`${o}: ${n};`)}return e.join(" ")},x=t=>!!t&&!!(t?.desktop||t?.tablet||t?.mobile||t?.tabletlandscape||t?.mobilelandscape||t?.laptop||t?.widescreen||t?.customStyles),T=new Set(["px","em","rem","%","vh","vw"]),z=t=>{let e="";for(const o in t){const n=t[o];void 0===n||T.has(n)||Number.isNaN(n)||"string"==typeof n&&n.includes("undefined")||(e+=`${o}: ${n}; `)}return e.trim()};void 0===window.popupBuilderBlock.helpers&&(window.popupBuilderBlock.helpers={}),window.popupBuilderBlock.helpers={colorsGroup:[{color:"#72aee6",name:"Blue 20"},{color:"#3582c4",name:"Blue 40"},{color:"#e65054",name:"Red 40"},{color:"#8a2424",name:"Red 70"}],boxControlUnit:[{value:"px",label:"px"},{value:"em",label:"em"},{value:"%",label:"%"}],overflowOptions:[{label:"Default",value:""},{label:"Hidden",value:"hidden"},{label:"Auto",value:"auto"}],htmlTags:[{label:"Div",value:"div"},{label:"Header",value:"header"},{label:"Main",value:"main"},{label:"Article",value:"article"},{label:"Section",value:"section"},{label:"Aside",value:"aside"},{label:"Figure",value:"figure"},{label:"Figcaption",value:"figcaption"},{label:"Nav",value:"nav"},{label:"Footer",value:"footer"}],backgroundGenerator:(t,o="Desktop")=>{let a={background:"",size:""};return"image"!==t?.backgroundType||e(t?.backgroundImage?.url)&&e(t?.backgroundImage?.dynamicContentType)||(a.background+=(0,s.applyFilters)("gutenkit.backgroundImage.url",`url(${t?.backgroundImage?.imageUrl?.[o]?t?.backgroundImage?.imageUrl?.[o]:t?.backgroundImage?.url})`,t?.backgroundImage),!e(t?.backgroundRepeat)&&(a.background+=`${t?.backgroundRepeat} `),!e(t?.backgroundAttachment)&&(a.background+=`${t?.backgroundAttachment} `),!e(t?.backgroundPosition[o])&&"custom"!==t?.backgroundPosition[o]&&(a.background+=`${t?.backgroundPosition[o]}`),!e(t?.backgroundPosition[o])&&"custom"===t?.backgroundPosition[o]&&!e(t?.customPositionX[o])&&!e(t?.customPositionY[o])&&(a.background+=`${r(t?.customPositionX[o])} ${r(t?.customPositionY[o])}`),!e(t?.backgroundSize)&&"custom"!==t?.backgroundSize&&(a.size+=`${t?.backgroundSize}`),!e(t?.backgroundSize)&&"custom"===t?.backgroundSize&&(a.size+=`${r(t?.customSize[o])} auto`)),"classic"!==t?.backgroundType||e(t?.backgroundColor)||(a.background+=`${n(t?.backgroundColor)} `),"gradient"!==t?.backgroundType||e(t?.gradient)||(a.background+=`${i(t?.gradient)} `),e(a?.background)?a.background=void 0:a.background=a.background,e(a?.size)?a.size=void 0:a.size=a.size,a},fillBackgroundGenerator:(t,o="Desktop")=>{let a={"background-image":""};return"classic"===t?.backgroundType&&(a["background-color"]=`${n(t?.backgroundColor)}`),"gradient"===t?.backgroundType&&(a["background-image"]=`${i(t?.gradient)}`),"image"===t?.backgroundType&&((!e(t?.backgroundImage?.url)||!e(t?.backgroundImage?.dynamicContentType))&&(a["background-image"]=(0,s.applyFilters)("gutenkit.backgroundImage.url",`url(${t?.backgroundImage?.imageUrl?.[o]?t?.backgroundImage?.imageUrl?.[o]:t?.backgroundImage?.url})`,t?.backgroundImage)),!e(t?.backgroundAttachment)&&(a["background-attachment"]=t?.backgroundAttachment),!e(t?.backgroundPosition[o])&&"custom"!==t?.backgroundPosition[o]&&(a["background-position"]=t?.backgroundPosition[o]),!e(t?.backgroundPosition[o])&&"custom"===t?.backgroundPosition[o]&&!e(t?.customPositionX)&&!e(t?.customPositionY)&&(a["background-position"]=`${r(t?.customPositionX[o])} ${r(t?.customPositionY[o])}`),!e(t?.backgroundSize)&&"custom"!==t?.backgroundSize&&(a["background-size"]=t?.backgroundSize),!e(t?.backgroundSize)&&"custom"===t?.backgroundSize&&(a["background-size"]=`${r(t?.customSize[o])} auto`),!e(t?.backgroundRepeat)&&(a["background-repeat"]=t?.backgroundRepeat)),a},getBoxShadowValue:t=>{if(!t)return;if(t?.selectedType||(t={...t,selectedType:"text"}),t?.slug&&t?.shadow)return`var(--wp--preset--shadow--${t.slug}, ${t.shadow})`;const e=t=>"object"==typeof t&&void 0!==t?.size?`${t.size}px`:"number"==typeof t?`${t}px`:t?`${t}`:"0px",o=e(t?.horizontal),i=e(t?.vertical),r=e(t?.blur),a=e(t?.spread),s=t?.color?n(t.color):"";let c=`${o} ${i} ${r} ${a}`;s&&(c+=` ${s}`),"inset"===t?.position&&(c=`inset ${c}`),c=c.trim();let l=`${o} ${i} ${r}`;return s&&(l+=` ${s}`),l=l.trim(),"box"===t.selectedType?c:"text"===t.selectedType?l:void 0},getBorderValue:t=>{if(e(t))return{border:void 0};if(t?.width&&t?.color)return{border:`${t?.width} ${t?.style||"solid"} ${n(t?.color)}`};if(t?.right||t?.bottom||t?.left||t?.top){const e={};return Object.keys(t).forEach(o=>{t[o]?.width&&t[o]?.color&&(e[`border-${o}`]=`${t[o]?.width} ${t[o]?.style||"solid"} ${n(t[o]?.color)}`)}),e}},getBoxValue:(t={},e="")=>{const{top:o,right:n,bottom:i,left:r}=t,a={top:o,right:n,bottom:i,left:r},s=Object.values(a).filter(t=>void 0!==t).length;if(0===s)return{[e]:void 0};if(4===s){let t="";return t=o===i&&o===n&&o===r?o:o===i&&r===n?`${o} ${n}`:`${o} ${n} ${i} ${r}`,{[e]:t}}let c={};return"border-radius"!==e?(Object.keys(a).forEach(o=>{c[`${e}-${o}`]=t[o]||void 0}),c):"border-radius"===e?(c["border-top-left-radius"]=o||void 0,c["border-top-right-radius"]=n||void 0,c["border-bottom-right-radius"]=i||void 0,c["border-bottom-left-radius"]=r||void 0,c):void 0},getTypographyValue:(t,e)=>"Desktop"===e?{"font-family":t?.fontFamily?.value,"font-size":t?.fontSize?.[e]?.size+t?.fontSize?.[e]?.unit,"font-style":t?.fontStyle,"font-weight":t?.fontWeight?.value,"text-decoration":t?.textDecoration,"text-transform":t?.textTransform,"line-height":t?.lineHeight?.[e]?.size+t?.lineHeight?.[e]?.unit,"letter-spacing":t?.letterSpacing?.[e]?.size+t?.letterSpacing?.[e]?.unit,"word-spacing":t?.wordSpacing?.[e]?.size+t?.wordSpacing?.[e]?.unit}:{"font-size":t?.fontSize?.[e]?.size+t?.fontSize?.[e]?.unit,"line-height":t?.lineHeight?.[e]?.size+t?.lineHeight?.[e]?.unit,"letter-spacing":t?.letterSpacing?.[e]?.size+t?.letterSpacing?.[e]?.unit,"word-spacing":t?.wordSpacing?.[e]?.size+t?.wordSpacing?.[e]?.unit},getSliderValue:r,getMultipleTransition:(...t)=>{let e=[];return Object.keys(t).length>0&&t.forEach((t,o)=>{if(t?.duration?.size||t?.isDeclared&&t?.duration){let o=t?.isDeclared?"":"s";e.push(`${t?.name} ${t?.duration?.size||t?.duration}${o} ${t?.animation}`)}}),e.length>0?e.join(", "):void 0},getCSSFilters:a,getAttrDependencies:(t,e=!1)=>{if(t){let o="";o=e?Object.keys(t).map(t=>"blocksCSS"!==t?"attributes?."+t+",\n":"").join(""):Object.keys(t).filter(t=>"blocksCSS"!==t).join(", \n"),navigator.clipboard.writeText(o).then(()=>{console.info("Copied to clipboard")}).catch(()=>{console.warn("Something went wrong")})}},gkitResponsiveValue:(t,e,o)=>{if(o&&t&&e){if(Array.isArray(e)){let n=t[e[0]];if(n&&n[e[1]])return n[e[1]][o]}return t[e+o]}},isNull:e,linkGenerator:t=>{let e=t?.url;!e||e.startsWith("http:")&&e.startsWith("https:")&&!e.startsWith("#")||(e=(0,c.prependHTTP)(e));let o={href:e,onClick:t=>t.preventDefault()};return t?.newTab&&(o.target="_blank",o.rel="noopener"),t?.noFollow&&(o.rel="_blank"==o.target?"nofollow noopener":"nofollow"),t?.customAttributes&&t?.customAttributes.length>0&&t?.customAttributes.forEach(t=>{const[e,n]=t.split("|");o[e]=n}),t?.isDynamicContent?(o["data-dynamic-content-url"]=JSON.stringify({...t,url:e}),o):o?.href?o:null},overlayGenerator:(t,o="Desktop")=>{let s={"background-image":""};return"gradient"===t?.backgroundType&&(s["background-image"]=i(t?.gradient)),"classic"===t?.backgroundType&&(!e(t?.backgroundColor)&&(s["background-color"]=n(t?.backgroundColor)),!e(t?.backgroundImage?.imageUrl)&&(s["background-image"]=`url(${t?.backgroundImage?.imageUrl})`),!e(t?.backgroundAttachment)&&(s["background-attachment"]=t?.backgroundAttachment),!e(t?.backgroundPosition[o])&&"custom"!==t?.backgroundPosition[o]&&(s["background-position"]=t?.backgroundPosition[o]),!e(t?.backgroundPosition[o])&&"custom"===t?.backgroundPosition[o]&&!e(t?.customPositionX)&&!e(t?.customPositionY)&&(s["background-position"]=`${r(t?.customPositionX[o])} ${r(t?.customPositionY[o])}`),!e(t?.backgroundSize)&&"custom"!==t?.backgroundSize&&(s["background-size"]=t?.backgroundSize),!e(t?.backgroundSize)&&"custom"===t?.backgroundSize&&(s["background-size"]=`${r(t?.customSize[o])} auto`),!e(t?.backgroundRepeat)&&(s["background-repeat"]=t?.backgroundRepeat)),!e(t?.opacity)&&(s.opacity=`${t?.opacity?.size}`),!e(t?.blendMode)&&(s["mix-blend-mode"]=t?.blendMode),!e(t?.cssFilters)&&(s.filter=a(t?.cssFilters)),e(s)?void 0:s},parseCSS:(t,e=u)=>{let o={};if(Array.isArray(t)){let[n,i,r=[]]=t;e.forEach(t=>{o[t?.slug]="base"===t?.value?[...n,...i(t?.slug)]:i(t?.slug)}),o.customStyles=r}else o=t;return{rawCSS:o,breakpoints:e}},responsiveHelper:(t,e,o,n)=>{n({[t+o]:e})},responsiveTypographyHelper:(t,e,o,n)=>{const i={...t};return{...i,[e]:{...i[e],[n]:o}}},useDeviceType:()=>{const{modules:t}=window?.gutenkit||{},e=t?.breakpoints,{deviceType:o}=(0,f.useSelect)(t=>{const o=t("gutenkit/global-store")?.getDeviceType,n=g.store?t(g.store)?.getDeviceType:void 0;return g.store?{deviceType:e?o?.():n?.()}:{deviceType:"Desktop"}},[]);return o||"Desktop"},useFontFamilyinBlock:(t=[])=>{(0,d.useEffect)(()=>{t.length=0},[]),(0,d.useEffect)(()=>{let o=[];t?.length>0&&t.forEach(t=>{let n={};!e(t?.fontFamily)&&(n.Font=t?.fontFamily?.value),!e(t?.fontWeight)&&(n.Condensed=t?.fontWeight?.value);let i="";!e(n?.Font)&&(i=n?.Font),!e(n?.Font)&&!e(n?.Condensed)&&(i+=":400,"+n?.Condensed),!e(i)&&o.push(i)}),o.length>0&&p().load({google:{families:[...o]},context:frames["editor-canvas"]})},[JSON.stringify(t)])},truncateWords:function(t,e){if(!t)return"";const o=t.split(" ");if(e>=o.length)return t;const n=o.slice(0,e);return n.push("..."),n.join(" ")},GkitLocalStoreGetData:t=>t&&localStorage.getItem(t),GkitLocalStoreSetData:(t,e,o=[])=>{const n=o;n.length>0?n.includes(e)&&localStorage.setItem(t,e):localStorage.setItem(t,e)},onScrollAnimateIframe:(t,e)=>{const o=window.frames["editor-canvas"]||window;if(o){const{IntersectionObserver:n,document:i}=o,r=new n(t=>{t.forEach(t=>{if(t.isIntersecting)try{e(t)}catch(t){console.warn(t)}})}),a=i.querySelectorAll(t);a&&a.forEach(t=>{const e=t.getAttribute("id"),o=i.getElementById(e);r.observe(o)})}},onScrollAnimate:(t,e)=>{const o=new IntersectionObserver(t=>{t.forEach(t=>{if(t.isIntersecting)try{e(t)}catch(t){console.warn(t)}})}),n=document.querySelectorAll(t);n&&n.forEach(t=>{const e=t.getAttribute("id"),n=document.getElementById(e);o.observe(n)})},orderSortedValue:(t=[],e,o)=>{if(!e)return[];const n=o.startsWith(".")?o:`.${o}`,i=t?.map((t,e)=>({selector:`${n} .${t.class}`,order:e}));return i},gkitDomNextSibling:function(t,e){let o=t.nextElementSibling;if(e){const t=e.startsWith("."),n=e.startsWith("#");for(;null!==o;){if(t&&o.classList.contains(e.slice(1))||n&&o.id===e.slice(1)||!t&&!n&&o.tagName.toLowerCase()===e.toLowerCase())return o;o=o.nextElementSibling}return null}return o},gkitDomPrevSibling:function(t,e){let o=t.previousElementSibling;if(e){const t=e.startsWith("."),n=e.startsWith("#");for(;null!==o;){if(t&&o.classList.contains(e.slice(1))||n&&o.id===e.slice(1)||!t&&!n&&o.tagName.toLowerCase()===e.toLowerCase())return o;o=o.previousElementSibling}return null}return o},gkitDomFindParent:function(t,e){const o=e.startsWith("."),n=e.startsWith("#");let i=t.parentElement;for(;null!==i;){if(o&&i.classList.contains(e.slice(1))||n&&i.id===e.slice(1)||!o&&!n&&i.tagName.toLowerCase()===e.toLowerCase())return i;i=i.parentElement}return null},gkitDomFindChild:function(t,e){const o=Array.from(t.children);if(e){const t=e.startsWith("."),n=e.startsWith("#");return o.filter(o=>!!(t&&o.classList.contains(e.slice(1))||n&&o.id===e.slice(1)||!t&&!n&&o.tagName.toLowerCase()===e.toLowerCase()))}return o},moveObjectToTop:function(t,e){const o=t.findIndex(t=>t.slug===e);if(-1!==o){const[e]=t.splice(o,1);t.unshift(e)}return t},getAttributes:m,setAttributes:b,getMultipleTransform:(t,e)=>{if(e&&0!==Object.entries(e).length)return Object.entries(e).flatMap(([o,n])=>{const{rotate:i,rotateHover:a,scale:s,scaleHover:c}=e,l=i?.common3DRotate,u=a?.common3DRotateHover,f=s?.commonKeepProportions,g=c?.commonKeepProportionsHover,d=(e,o,i)=>{const a=[e+t].toString(),s=n&&void 0!==n[a],c=n&&void 0!==r(n[a]);return s&&o&&c?`${i}(${r(n[a])})`:!n||"horizontal"!=n[e]&&"vertical"!=n[e]?void 0:`${i}(calc(-1))`};return[d("commonRotate",!l,"rotateZ"),d("commonRotateX",l,"rotateX"),d("commonRotateY",l,"rotateY"),d("perspective",l,"perspective"),d("commonOffsetX",!0,"translateX"),d("commonOffsetY",!0,"translateY"),d("commonScale",f,"scale"),d("commonScaleX",!f,"scaleX"),d("commonScaleY",!f,"scaleY"),d("commonSkewX",!0,"skewX"),d("commonSkewY",!0,"skewY"),d("commonFlipHorizontal",!0,"scaleX"),d("commonFlipVertical",!0,"scaleY"),d("commonRotateHover",!u,"rotateZ"),d("commonRotateXHover",u,"rotateX"),d("commonRotateYHover",u,"rotateY"),d("perspectiveHover",u,"perspective"),d("commonOffsetXHover",!0,"translateX"),d("commonOffsetYHover",!0,"translateY"),d("commonScaleHover",g,"scale"),d("commonScaleXHover",!g,"scaleX"),d("commonScaleYHover",!g,"scaleY"),d("commonSkewXHover",!0,"skewX"),d("commonSkewYHover",!0,"skewY"),d("commonFlipHorizontalHover",!0,"scaleX"),d("commonFlipVerticalHover",!0,"scaleY")]}).filter(t=>void 0!==t).join(" ")},getMultipleTransformOrigin:(...t)=>{let e=[];return t&&t.forEach(t=>{t?.value&&e.push(`${t.value}`)}),e.length>0?e.join(" "):void 0},useHasProActive:function({windowVariable:t="gutenkit",hookName:e="gutenkit.is-pro-active",cookieName:o="isValidLicense",apiPath:n="gutenkit"}={}){const[i,r]=(0,d.useState)(()=>"true"===y(o)),{has_pro:a}=window?.[t]||{};return(0,d.useEffect)(()=>{a&&(async()=>{const t=y(o);t?r("true"===t):setTimeout(async()=>{try{const t=await k()({path:`/${n}/v1/license/status`});"valid"===t?.status?(r(!0),w(o,"true",12)):(r(!1),w(o,"false",12))}catch(t){console.error("Error fetching license status:",t)}},2e3)})()},[a]),(0,d.useMemo)(()=>(0,s.applyFilters)(e,i),[i])},truncateCharacter:function(t,e){return e>=t?.length?t:t?.slice(0,e)+"..."},getTextStrokeValue:(t,e)=>{const{width:o,color:i}=t||{};if(o&&"object"==typeof o){const{size:t,unit:r}=o[e]?o[e]:{};if(null!=t&&!isNaN(t))return`${t}${r||"px"} ${n(i)||""}`.trim()}},getColor:n,getGradient:i,hasCSS:x,useDeviceList:()=>{const{modules:t}=window?.gutenkit||{},e=(0,d.useRef)(null);let o=[l,{label:"Tablet",slug:"Tablet",value:"1024",direction:"max"},{label:"Mobile",slug:"Mobile",value:"767",direction:"max"}];return t&&(o=(0,d.useMemo)(()=>{const e=t?.breakpoints?(0,f.select)("gutenkit/global-store"):null;let o=[l,{label:"Tablet",slug:"Tablet",value:"1024",direction:"max"},{label:"Mobile",slug:"Mobile",value:"767",direction:"max"}];if(e){const{getActiveBreakpoints:t}=e,n=t()?.sort((t,e)=>parseInt(e.value)-parseInt(t.value));n?.length>0&&(o=[l,...n])}return o},[])),(0,d.useMemo)(()=>{const t=e.current;return JSON.stringify(t)!==JSON.stringify(o)?(e.current=o,o):t},[o])},baseBreakpoint:l,useBlockStyles:(t,e,o,n)=>{const{rawCSS:i,breakpoints:r}=(0,d.useMemo)(()=>n,[n]),{__unstableMarkNextChangeAsNotPersistent:a}=(0,f.useDispatch)("core/block-editor"),s=(0,d.useRef)(null),c=(0,d.useMemo)(()=>((t,e)=>{const o={};for(let n=0;n<e.length;n++){const i=e[n],r=t[i.slug]||t[i.slug.toLowerCase()];if(r){const t=[];for(let e=0;e<r.length;e++){const{selector:o,...n}=r[e],i=$(n);i&&t.push(`${o} { ${i} }`)}t.length>0&&(o[i.slug.toLowerCase()]=t.join(" "))}}if(t.customStyles){const e=[];for(let o=0;o<t.customStyles.length;o++){const{mediaQuery:n,selector:i,...r}=t.customStyles[o];if(n&&!n.includes("undefined")){const t=$(r);t&&e.push(`@media (${n}) { ${i} { ${t} } }`)}}e.length>0&&(o.customStyles=e.join(" "))}return o})(i,r),[i,r]),l=(0,d.useRef)(t);return(0,d.useEffect)(()=>(c&&JSON.stringify(t)!==JSON.stringify(l.current||{})&&(s.current&&clearTimeout(s.current),s.current=setTimeout(()=>{a(),e({[o]:c}),l.current=t},200)),()=>clearTimeout(s.current)),[c]),c},hasCSS:x,useModuleStyles:(t,e,o)=>{const{__unstableMarkNextChangeAsNotPersistent:n}=(0,f.useDispatch)("core/block-editor"),i=m(t);if(!i)return;const{rawCSS:r,breakpoints:a}=o,s=(0,d.useCallback)(e=>{b(t,e)},[t]),c=(0,d.useMemo)(()=>((t,e)=>{const o={};let n="";const i=[];for(let o=0;o<e.length;o++){const n=e[o];i.push({deviceKey:n.slug.toLowerCase(),styles:t[n.slug]||t[n.slug.toLowerCase()]})}if(t.customStyles)for(let e=0;e<t.customStyles.length;e++){const o=t.customStyles[e];i.push({custom:!0,mediaQuery:o.mediaQuery,selector:o.selector,properties:o})}for(let t=0;t<i.length;t++){const{deviceKey:e,styles:r,custom:a,mediaQuery:s,selector:c,properties:l}=i[t];if(r){n="";for(let t=0;t<r.length;t++){const{selector:e,...o}=r[t],i=z(o);i&&(n+=`${e} { ${i} } `)}n&&(o[e]=n.trim())}else if(a&&s&&!s.includes("undefined")){const t=z(l);t&&(n=`@media (${s}) { ${c} { ${t} } }`,o.customStyles=(o.customStyles||"")+n)}}return o})(r,a),[r,a]),l=(0,d.useRef)(i);return(0,d.useEffect)(()=>{c&&JSON.stringify(i)!==JSON.stringify(l.current||{})&&(n(),s({[e]:c}),l.current=i)},[c]),i[e]},generatePlaceholder:(t,e,o)=>{const n=document.createElement("canvas"),i=n.getContext("2d");return n.width=e,n.height=o,i.fillStyle="#d3d3d3",i.fillRect(0,0,e,o),i.fillStyle="#000000",i.font="20px Arial",i.textAlign="center",i.textBaseline="middle",i.fillText(t,e/2,o/2),n.toDataURL()},getCookie:y,setCookie:w}})()})();