!function(){"use strict";var e={808(e,t){t.S=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return e&&Object.keys(e).indexOf("desktop")>-1?t?e:e.desktop:t?{desktop:e,tablet:e,mobile:e}:e}}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var a=t[n]={exports:{}};return e[n](a,a.exports,r),a.exports}r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,{a:t}),t},r.d=function(e,t){for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};r.d({},{F:function(){return te},m:function(){return re}});var n=window.wp.element,o=window.wp.plugins,a=window.wp.editor,s=window.wp.data,i=window.wp.compose,c=(window.wp.components,ctEvents),l=r.n(c);function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r0&&/\s/.test(this.cssText.charAt(t-1));)t--;return{start:e,end:t}}flush(){const e=[];for(;this.currentToken;)e.push(this.advance());return e}getNextToken_(){const e=this.cssText[this.offset];let t;return this.currentToken_=null,this.offset>=this.cssText.length?null:(t=f.whitespace.test(e)?this.tokenizeWhitespace(this.offset):f.stringBoundary.test(e)?this.tokenizeString(this.offset):"/"===e&&"*"===this.cssText[this.offset+1]?this.tokenizeComment(this.offset):f.boundary.test(e)?this.tokenizeBoundary(this.offset):this.tokenizeWord(this.offset),t.previous=this.cursorToken_,this.cursorToken_.next=t,this.cursorToken_=t,t)}tokenizeString(e){const t=this.cssText[e];let r=!1;const n=e;let o;for(;o=this.cssText[++e];)if(r)r=!1;else{if(o===t){++e;break}"\\"===o&&(r=!0)}return new T(T.type.string,n,e)}tokenizeWord(e){const t=e;let r;for(;(r=this.cssText[e])&&!f.boundary.test(r);)e++;return new T(T.type.word,t,e)}tokenizeWhitespace(e){const t=e;f.whitespaceGreedy.lastIndex=e;const r=f.whitespaceGreedy.exec(this.cssText);return null!=r&&r.index===e&&(e=f.whitespaceGreedy.lastIndex),new T(T.type.whitespace,t,e)}tokenizeComment(e){const t=e;f.commentGreedy.lastIndex=e;return e=null==f.commentGreedy.exec(this.cssText)?this.cssText.length:f.commentGreedy.lastIndex,new T(T.type.comment,t,e)}tokenizeBoundary(e){const t=C[this.cssText[e]]||T.type.boundary;return new T(t,e,e+1)}}class R{stylesheet(e,t){return{type:v,rules:e,range:t}}atRule(e,t,r=void 0,n,o,a){return{type:h,name:e,parameters:t,rulelist:r,nameRange:n,parametersRange:o,range:a}}comment(e,t){return{type:m,value:e,range:t}}rulelist(e,t){return{type:w,rules:e,range:t}}ruleset(e,t,r,n){return{type:_,selector:e,rulelist:t,selectorRange:r,range:n}}declaration(e,t,r,n){return{type:k,name:e,value:t,nameRange:r,range:n}}expression(e,t){return{type:g,text:e,range:t}}discarded(e,t){return{type:S,text:e,range:t}}}class D{constructor(){this.path_=[]}get path(){return this.path_}visit(e){let t;return this[e.type]&&(this.path_.push(e),t=this[e.type](e),this.path_.pop()),t}}class E{constructor(e=new R){this.nodeFactory=e}parse(e){return this.parseStylesheet(new P(e))}parseStylesheet(e){return this.nodeFactory.stylesheet(this.parseRules(e),{start:0,end:e.cssText.length})}parseRules(e){const t=[];for(;e.currentToken;){const r=this.parseRule(e);r&&t.push(r)}return t}parseRule(e){const t=e.currentToken;return null===t?null:t.is(T.type.whitespace)?(e.advance(),null):t.is(T.type.comment)?this.parseComment(e):t.is(T.type.word)?this.parseDeclarationOrRuleset(e):t.is(T.type.propertyBoundary)?this.parseUnknown(e):t.is(T.type.at)?this.parseAtRule(e):this.parseUnknown(e)}parseComment(e){const t=e.advance();return null===t?null:this.nodeFactory.comment(e.slice(t),{start:t.start,end:t.end})}parseUnknown(e){const t=e.advance();let r;if(null===t)return null;for(;e.currentToken&&e.currentToken.is(T.type.boundary);)r=e.advance();return this.nodeFactory.discarded(e.slice(t,r),e.getRange(t,r))}parseAtRule(e){let t,r,n,o,a;if(!e.currentToken)return null;const s=e.currentToken.start;for(;e.currentToken;)if(e.currentToken.is(T.type.whitespace))e.advance();else if(!t&&e.currentToken.is(T.type.at)){e.advance();const n=e.currentToken;let o;for(;e.currentToken&&e.currentToken.is(T.type.word);)o=e.advance();r=e.getRange(n,o),t=e.cssText.slice(r.start,r.end)}else{if(e.currentToken.is(T.type.openBrace)){n=this.parseRulelist(e);break}if(e.currentToken.is(T.type.propertyBoundary)){e.advance();break}null==o?o=e.advance():a=e.advance()}if(void 0===t||void 0===r)return null;let i,c="";o&&(i=e.trimRange(e.getRange(o,a)),c=e.cssText.slice(i.start,i.end));const l=e.currentToken?e.currentToken.previous.end:e.cssText.length;return this.nodeFactory.atRule(t,c,n,r,i,{start:s,end:l})}parseRulelist(e){const t=[],r=e.currentToken.start;let n;for(e.advance();e.currentToken;){if(e.currentToken.is(T.type.closeBrace)){n=e.currentToken,e.advance();break}{const r=this.parseRule(e);r&&t.push(r)}}const o=n?n.end:e.cssText.length;return this.nodeFactory.rulelist(t,{start:r,end:o})}parseDeclarationOrRuleset(e){let t=null,r=null,n=null;for(;e.currentToken;)if(e.currentToken.is(T.type.whitespace))e.advance();else if(e.currentToken.is(T.type.openParenthesis))for(;e.currentToken&&!e.currentToken.is(T.type.closeParenthesis);)e.advance();else{if(e.currentToken.is(T.type.openBrace)||e.currentToken.is(T.type.propertyBoundary))break;e.currentToken.is(T.type.colon)&&(n=e.currentToken),null===t?(t=e.advance(),r=t):r=e.advance()}if(null===e.currentToken)return null;if(e.currentToken.is(T.type.propertyBoundary)){const o=e.getRange(t,n?n.previous:r),a=e.cssText.slice(o.start,o.end);let s;if(n&&n.next){const t=e.getRange(n.next,r),o=e.trimRange(t),a=e.cssText.slice(o.start,o.end);s=this.nodeFactory.expression(a,o)}e.currentToken.is(T.type.semicolon)&&e.advance();const i=e.trimRange(e.getRange(t,e.currentToken&&e.currentToken.previous||r));return this.nodeFactory.declaration(a,s,o,i)}if(n&&n===r){const n=this.parseRulelist(e);e.currentToken.is(T.type.semicolon)&&e.advance();const o=e.getRange(t,r.previous),a=e.cssText.slice(o.start,o.end),s=e.trimRange(e.getRange(t,e.currentToken&&e.currentToken.previous||r));return this.nodeFactory.declaration(a,n,o,s)}{const n=e.getRange(t,r),o=e.cssText.slice(n.start,n.end),a=this.parseRulelist(e),s=t.start;let i;return i=e.currentToken?e.currentToken.previous?e.currentToken.previous.end:t.end:e.cssText.length,this.nodeFactory.ruleset(o,a,n,{start:s,end:i})}}}class V extends D{stringify(e){return this.visit(e)||""}[v](e){let t="";for(let r=0;r0&&void 0!==arguments[0]?arguments[0]:{},t=(e=y({variableDescriptorsWithValue:[],ast:{},device:"desktop"},e)).ast,r=e.variableDescriptorsWithValue.flatMap(function(e){return e.variableDescriptor.dropSelectors||[]});if(r.length>0&&Array.isArray(t.rules)){var n=new Set(t.rules.map(function(e){return e.selector}));t=y(y({},t),{},{rules:t.rules.filter(function(e){var t=n.has(e.selector),o="string"==typeof e.selector&&r.some(function(t){return e.selector.includes(t)});return!(t&&o)})})}if(0===e.variableDescriptorsWithValue.length)return t;var o,a,s=(o=e.variableDescriptorsWithValue,a=function(t){var r=t.variableDescriptor;return U(r,e.device)},o.reduce(function(e,t,r){var n;return(e[n=a(t,r,o)]||(e[n]=[])).push(t),e},{})),i=[],c={};if(c=y(y({},t),{},{rules:t.rules.map(function(e){if(!e.selector||!s[e.selector])return e;i.push(e.selector);var t=s[e.selector],r=[],n=t.filter(function(e){return!e.value.includes("CT_CSS_SKIP_RULE")}).reduce(function(e,t){return y(y({},e),{},p({},t.variableDescriptor.variableName,t))},{}),o=t.filter(function(e){return e.value.includes("CT_CSS_SKIP_RULE")}).reduce(function(e,t){return y(y({},e),{},p({},t.variableDescriptor.variableName,t))},{}),a=e.rulelist.rules.filter(function(e){var t=e.type,r=e.name;return"declaration"!==t||!o[r]}).map(function(e){return"declaration"===e.type&&n[e.name]?(r.push(e.name),y(y({},e),{},{value:y(y({},e.value),{},{text:n[e.name].value})})):e});return r.length!==Object.values(n).length&&(a=[].concat(b(a),b(Object.values(n).filter(function(e){var t=e.variableDescriptor;return!r.includes(t.variableName)}).map(function(e){return z(e)})))),y(y({},e),{},{rulelist:y(y({},e.rulelist),{},{rules:a})})})}),i.length!==Object.keys(s).length){var l=Object.values(s).filter(function(t){return!i.includes(U(t[0].variableDescriptor,e.device))&&!!t.find(function(e){return!e.value.includes("CT_CSS_SKIP_RULE")})});c=y(y({},c),{},{rules:[].concat(b(c.rules),b(l.map(function(t){return{type:"ruleset",selector:U(t[0].variableDescriptor,e.device),rulelist:{type:"rulelist",rules:t.filter(function(e){return!e.value.includes("CT_CSS_SKIP_RULE")}).map(z)}}})))})}return c},F=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=(e=y({variableDescriptor:{},value:{},device:"desktop"},e)).value;(e.variableDescriptor.type||"").indexOf("color")>-1&&"CT_CSS_SKIP_RULE"!==e.value&&(t=e.value["color"===e.variableDescriptor.type?"default":e.variableDescriptor.type.split(":")[1]].color),"border"===(e.variableDescriptor.type||"")&&(t=e.value&&"none"!==e.value.style?"".concat(e.value.width,"px ").concat(e.value.style," ").concat(e.value.color.color):"none",e.variableDescriptor.skip_none&&"none"===t&&(t="CT_CSS_SKIP_RULE")),"spacing"===(e.variableDescriptor.type||"")&&(t=function(e,t,r){if("CT_CSS_SKIP_RULE"===e)return"CT_CSS_SKIP_RULE";e.values||(e={values:[O(e.top),O(e.right),O(e.bottom),O(e.left)],custom:"",state:e.linked?1:2});var n=t.transformSpacingValue||M;if(3===e.state)return e.custom.trim()?n(e.custom.trim(),[e.custom.trim()],r):"CT_CSS_SKIP_RULE";var o=0;Object.keys(t).includes("emptyValue")&&(o=t.emptyValue);var a=e.values.map(function(t){return""===t.value||"auto"===t.value?y(y({},t),{},{value:1===e.state?o:0}):t}),s=!0,i="";return a.forEach(function(e){e.value!==o&&(s=!1),""!==e.unit&&(i=e.unit)}),i&&(a=a.map(function(e){return""===e.unit?y(y({},e),{},{unit:i}):e})),s?"CT_CSS_SKIP_RULE":(a=a.map(function(e){return"".concat(e.value).concat(e.unit)}))[0]===a[1]&&a[0]===a[2]&&a[0]===a[3]?n(a[0],[a[0]],r):a[0]===a[2]&&a[1]===a[3]?n("".concat(a[0]," ").concat(a[3]),[a[0],a[3]],r):n(a.join(" "),a,r)}(e.value,e.variableDescriptor,e.device)),"box-shadow"===(e.variableDescriptor.type||"")&&(t=function(e,t){var r=t.forcedOutput,n=void 0!==r&&r;if("CT_CSS_SKIP_RULE"===e||e.inherit)return"CT_CSS_SKIP_RULE";if("none"===e)return"none";if(!e.enable)return"none";if(0===parseFloat(e.blur)&&0===parseFloat(e.spread)&&0===parseFloat(e.v_offset)&&0===parseFloat(e.h_offset))return n?"none":"CT_CSS_SKIP_RULE";var o=[];return e.inset&&o.push("inset"),o.push("".concat(e.h_offset,"px")),o.push("".concat(e.v_offset,"px")),0!==parseFloat(e.blur)&&(o.push("".concat(e.blur,"px")),0!==parseFloat(e.spread)&&o.push("".concat(e.spread,"px"))),0===parseFloat(e.blur)&&0!==parseFloat(e.spread)&&(o.push("".concat(e.blur,"px")),o.push("".concat(e.spread,"px"))),o.push(e.color.color),o.join(" ")}(e.value,e.variableDescriptor));var r="--";"property"===e.variableDescriptor.variableType&&(r="");var n="".concat(r).concat(L(e.variableDescriptor.variable)?e.variableDescriptor.variable():e.variableDescriptor.variable);return{variableDescriptor:y(y({},e.variableDescriptor),{},{selector:e.variableDescriptor.selector||":root",variableName:n}),value:"".concat(t).concat(e.variableDescriptor.unit||"").concat(e.variableDescriptor.important?" !important":"")}},K=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=(e=y({variableDescriptor:{},value:"",fullValue:{},tabletMQ:"(max-width: 999.98px)",mobileMQ:"(max-width: 689.98px)",cacheId:"default",initialStyleTagsDescriptor:[]},e)).variableDescriptor;return L(t)&&(t=t(e.value)),Array.isArray(t)||(t=[t]),function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(e=y({cacheId:"default",initialStyleTagsDescriptor:[],initialStyleTags:[]},e),I[e.cacheId])return I[e.cacheId];var t=new E,r=b(e.initialStyleTags),n=document.querySelector("#ct-main-styles-inline-css");return n&&r.push(n),I[e.cacheId]=[].concat(b(e.initialStyleTagsDescriptor),b(r.map(function(e){return{style:e}}))).map(function(e){var r={readStyles:e.readStyles?e.readStyles:function(){if(!e.style)throw new Error("No style tag is provided. Please provide a style tag or a readStyles function.");return e.style.innerText},persistStyles:e.persistStyles?e.persistStyles:function(t){if(!e.style)throw new Error("No style tag is provided. Please provide a style tag or a persistStyles function.");e.style.innerText=t}};return y(y({},r),{},{ast:t.parse(r.readStyles().replace(new RegExp("\n","g"),""))})}),I[e.cacheId]}({cacheId:e.cacheId,initialStyleTagsDescriptor:e.initialStyleTagsDescriptor}).map(function(r){var n=function(r){return("desktop"===r?t:t.filter(function(e){return!!e.responsive})).map(function(t){var n=t.fullValue?e.fullValue:e.value;return n=t.extractValue?t.extractValue(n):n,t.whenDone&&t.whenDone(n,e.value),n=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return e&&Object.keys(e).indexOf("desktop")>-1?t?e:e.desktop:t?{desktop:e,tablet:e,mobile:e}:e}(n,!!t.responsive),F({variableDescriptor:t,value:t.responsive?n[r]:n,device:r})})},o=j({variableDescriptorsWithValue:n("desktop"),ast:r.ast,device:"desktop"});return t.find(function(e){return!!e.responsive})?(o.rules.find(function(t){var r=t.type,n=t.parameters;return"atRule"===r&&n===e.tabletMQ})||(o=y(y({},o),{},{rules:[].concat(b(o.rules),[{type:"atRule",name:"media",parameters:e.tabletMQ,rulelist:{type:"rulelist",rules:[]}}])})),o.rules.find(function(t){var r=t.type,n=t.parameters;return"atRule"===r&&n===e.mobileMQ})||(o=y(y({},o),{},{rules:[].concat(b(o.rules),[{type:"atRule",name:"media",parameters:e.mobileMQ,rulelist:{type:"rulelist",rules:[]}}])})),o=y(y({},o),{},{rules:o.rules.map(function(t){if("atRule"!==t.type)return t;var r=t.rulelist;return t.parameters===e.tabletMQ&&(r=j({variableDescriptorsWithValue:n("tablet"),ast:r,device:"tablet"})),t.parameters===e.mobileMQ&&(r=j({variableDescriptorsWithValue:n("mobile"),ast:r,device:"mobile"})),y(y({},t),{},{rulelist:r})})}),y(y({},r),{},{ast:o})):y(y({},r),{},{ast:o})})},A=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};!function(e,t){I[e]=t;var r=new V;I[e].map(function(e){var t=e.ast.rules.reduce(function(e,t){return"atRule"===t.type&&"media"===t.name?y(y({},e),{},{media:[].concat(b(e.media),[t])}):y(y({},e),{},{nonMedia:[].concat(b(e.nonMedia),[t])})},{nonMedia:[],media:[]}),n=r.stringify(y(y({},e.ast),{},{rules:[].concat(b(t.nonMedia),b(t.media))}));e.persistStyles(n)})}((e=y({variableDescriptor:{},value:"",fullValue:{},tabletMQ:"(max-width: 999.98px)",mobileMQ:"(max-width: 689.98px)",cacheId:"default",initialStyleTagsDescriptor:[]},e)).cacheId,K(e))},B=window.blocksyOptions,$=r(808);const N=function(e){var t=e.toString(16);return 1==t.length?"0"+t:t},G=function({responsive:e,value:t,cb:r}){return t=(0,$.S)(t,e),e?{desktop:r(t.desktop),tablet:r(t.tablet),mobile:r(t.mobile)}:r(t)},Q=function({id:e,selector:t,responsive:r=!1,valueExtractor:n=function(e){return e},addToDescriptors:o={},conditional_var:a=!1,forced_background_image:s=!1}){return{[e]:[{variable:"background-color",variableType:"property",selector:t,responsive:r,extractValue:function(e){return G({value:n(e),responsive:r,cb:function(e){return"gradient"===e.background_type?"initial":a?`var(${a}, ${e.backgroundColor.default.color})`:e?e.backgroundColor.default.color:"CT_CSS_SKIP_RULE"}})},...o},{variable:"background-image",variableType:"property",selector:t,responsive:r,extractValue:function(e){return G({value:n(e),responsive:r,cb:function({background_type:e="color",gradient:t,background_image:r,background_pattern:n,patternColor:o,backgroundColor:a,overlayColor:i}={}){if(!e)return"CT_CSS_SKIP_RULE";if("color"===e)return s?"none":"CT_CSS_SKIP_RULE";const c=function(e,t,r){return(r+"").split(e).join(t)};if("image"===e)return r.url?`${"CT_CSS_SKIP_RULE"!==i.default.color?`linear-gradient(${i.default.color}, ${i.default.color}), `:""}url(${r.url})`:"CT_CSS_SKIP_RULE";if("gradient"===e)return t;let l=1,u=o?o.default.color:"";if(u.indexOf("theme-palette-color-1")>-1&&(u=getComputedStyle(document.body).getPropertyValue("--theme-palette-color-1")),u.indexOf("theme-palette-color-2")>-1&&(u=getComputedStyle(document.body).getPropertyValue("--theme-palette-color-2")),u.indexOf("theme-palette-color-3")>-1&&(u=getComputedStyle(document.body).getPropertyValue("--theme-palette-color-3")),u.indexOf("theme-palette-color-4")>-1&&(u=getComputedStyle(document.body).getPropertyValue("--theme-palette-color-4")),u.indexOf("theme-palette-color-5")>-1&&(u=getComputedStyle(document.body).getPropertyValue("--theme-palette-color-5")),u.indexOf("theme-palette-color-6")>-1&&(u=getComputedStyle(document.body).getPropertyValue("--theme-palette-color-6")),u.indexOf("theme-palette-color-7")>-1&&(u=getComputedStyle(document.body).getPropertyValue("--theme-palette-color-7")),u.indexOf("theme-palette-color-8")>-1&&(u=getComputedStyle(document.body).getPropertyValue("--theme-palette-color-8")),u.indexOf("rgb")>-1){const e=c("rgb(","",c(")","",c("rgba(","",c(" ","",u)))).split(",");u=`#${N(parseInt(e[0],10))}${N(parseInt(e[1],10))}${N(parseInt(e[2],10))}`,e.length>3&&(l=e[3])}return u=c("#","",u),`url("${c("OPACITY",l,c("COLOR",u,ct_localizations.customizer_sync.svg_patterns[n]||ct_localizations.customizer_sync.svg_patterns["type-1"]))}")`}})},...o},{variable:"background-position",variableType:"property",selector:t,responsive:r,...o,extractValue:function(e){return G({value:n(e),responsive:r,cb:function({background_type:e,background_image:t}={}){return"image"!==e?"CT_CSS_SKIP_RULE":`${Math.round(100*parseFloat(t.x||0))}% ${Math.round(100*parseFloat(t.y||0))}%`}})}},{variable:"background-size",variableType:"property",selector:t,responsive:r,...o,extractValue:function(e){return G({value:n(e),responsive:r,cb:function({background_type:e,background_size:t}={}){return"image"!==e?"CT_CSS_SKIP_RULE":t}})}},{variable:"background-attachment",variableType:"property",selector:t,responsive:r,...o,extractValue:function(e){return G({value:n(e),responsive:r,cb:function({background_type:e,background_attachment:t}={}){return"image"!==e?"CT_CSS_SKIP_RULE":t}})}},{selector:t,variable:"background-repeat",variableType:"property",responsive:r,...o,extractValue:function(e){return G({value:n(e),responsive:r,cb:function({background_type:e,background_repeat:t}={}){return"image"!==e||"repeat"===t?"CT_CSS_SKIP_RULE":t}})}}]}};var W=window.wp.i18n;const q=document.body.classList.contains("post-type-ct_content_block");let J={desktop:'.ct-desktop-view iframe[name="editor-canvas"], .ct-desktop-view .edit-post-visual-editor',tablet:'.ct-tablet-view iframe[name="editor-canvas"]',mobile:'.ct-mobile-view iframe[name="editor-canvas"]'};if(document.body.className.indexOf("version-6-4")>-1){}const H={...Q({id:"popup_background",selector:J.desktop,responsive:!0,addToDescriptors:{important:!0}}),...(Y=["content_style_source","content_style","content_background","content_boxed_shadow","boxed_content_spacing","content_boxed_radius","content_boxed_border","page_structure_type","background",...q?["has_content_block_structure","content_block_structure","template_subtype","template_editor_width_source","template_editor_width"]:[]],X=[...["desktop","tablet","mobile"].reduce(function(e,t){return[...e,...Q({id:"background",selector:J[t],responsive:!1,addToDescriptors:{fullValue:!0,important:!0},valueExtractor:function(e){const{background:r,template_subtype:n,has_content_block_structure:o,content_block_structure:a}=e;let s=r;return!r.desktop&&!q&&"color"===r.background_type&&r.backgroundColor.default.color&&r.backgroundColor.default.color.indexOf("CT_CSS_SKIP_RULE")>-1&&(s=ct_editor_localizations.default_background),q&&(o&&"yes"!==o||"card"===n)&&(s={background_type:"color",backgroundColor:{default:{color:"CT_CSS_SKIP_RULE"}}}),q&&!s.desktop&&"color"===s.background_type&&s.backgroundColor.default.color&&s.backgroundColor.default.color.indexOf("CT_CSS_SKIP_RULE")>-1&&(s=ct_editor_localizations.default_background),(0,$.S)(s)[t]}}).background]},[]),{selector:".editor-styles-wrapper",variable:"theme-block-max-width",extractValue:function({template_subtype:e,template_editor_width_source:t="small",template_editor_width:r=1290,has_content_block_structure:n,content_block_structure:o,page_structure_type:a}){return e&&"card"===e?"small"===t?"500px":"medium"===t?"900px":`${r}px`:("default"===a&&(a=ct_editor_localizations.default_page_structure),q&&(a=o,"yes"===n&&"card"!==e&&"content"!==e||"canvas"===e||(a="type-4")),"type-4"===a?"var(--theme-normal-container-max-width)":"var(--theme-narrow-container-max-width)")},fullValue:!0,important:!0,unit:""},{selector:".editor-styles-wrapper",variable:"theme-block-wide-max-width",extractValue:function({template_subtype:e,has_content_block_structure:t,content_block_structure:r,page_structure_type:n}){return e&&"card"===e?"CT_CSS_SKIP_RULE":(q&&(n=r,"yes"!==t&&(n="type-4")),"default"===n&&(n=ct_editor_localizations.default_page_structure),"type-4"===n?"calc(var(--theme-normal-container-max-width) + var(--theme-wide-offset) * 2)":"calc(var(--theme-narrow-container-max-width) + var(--theme-wide-offset) * 2)")},fullValue:!0,unit:""},{selector:".editor-styles-wrapper",variable:"has-boxed",responsive:!0,extractValue:function({template_subtype:e,content_style_source:t="inherit",has_content_block_structure:r="yes",content_style:n="wide"}){return q||"inherit"!==t||(n=ct_editor_localizations.default_content_style),n=(0,$.S)(n),!q||"yes"===r&&"card"!==e&&"content"!==e||(n={desktop:"wide",tablet:"wide",mobile:"wide"}),{desktop:"boxed"===n.desktop?"var(--true)":"var(--false)",tablet:"boxed"===n.tablet?"var(--true)":"var(--false)",mobile:"boxed"===n.mobile?"var(--true)":"var(--false)"}},fullValue:!0,unit:""},{selector:".editor-styles-wrapper",variable:"has-wide",responsive:!0,extractValue:function({template_subtype:e,has_content_block_structure:t="yes",content_style_source:r="inherit",content_style:n="wide"}){return q||"inherit"!==r||(n=ct_editor_localizations.default_content_style),n=(0,$.S)(n),!q||"yes"===t&&"card"!==e&&"content"!==e||(n={desktop:"wide",tablet:"wide",mobile:"wide"}),{desktop:"wide"===n.desktop?"var(--true)":"var(--false)",tablet:"wide"===n.tablet?"var(--true)":"var(--false)",mobile:"wide"===n.mobile?"var(--true)":"var(--false)"}},fullValue:!0,unit:""},...Q({id:"background",selector:".editor-styles-wrapper",responsive:!0,conditional_var:"--has-boxed",addToDescriptors:{fullValue:!0},valueExtractor:function({template_subtype:e,has_content_block_structure:t="yes",content_style_source:r="inherit",content_background:n}){return q||"inherit"!==r||(n=ct_editor_localizations.default_content_background),!q||"yes"===t&&"card"!==e&&"content"!==e||((n=JSON.parse(JSON.stringify((0,$.S)(n)))).desktop.background_type="color",n.desktop.backgroundColor.default.color="transparent",n.tablet.background_type="color",n.tablet.backgroundColor.default.color="transparent",n.mobile.background_type="color",n.mobile.backgroundColor.default.color="transparent"),n}}).background,{selector:".editor-styles-wrapper",type:"spacing",variable:"theme-boxed-content-spacing",responsive:!0,unit:"",fullValue:!0,extractValue:function({template_subtype:e,content_style_source:t="inherit",boxed_content_spacing:r,has_content_block_structure:n="yes"}){return q||"inherit"!==t||(r=ct_editor_localizations.default_boxed_content_spacing),!q||"yes"===n&&"card"!==e&&"content"!==e?r:"CT_CSS_SKIP_RULE"}},{selector:".editor-styles-wrapper",type:"spacing",variable:"theme-boxed-content-border-radius",responsive:!0,fullValue:!0,extractValue:function({template_subtype:e,content_style_source:t="inherit",content_boxed_radius:r,has_content_block_structure:n="yes"}){return q||"inherit"!==t||(r=ct_editor_localizations.default_content_boxed_radius),!q||"yes"===n&&"card"!==e&&"content"!==e?r:"CT_CSS_SKIP_RULE"}},{selector:".editor-styles-wrapper",type:"border",variable:"theme-boxed-content-border",responsive:!0,fullValue:!0,extractValue:function({template_subtype:e,content_style_source:t="inherit",content_boxed_border:r,has_content_block_structure:n="yes"}){return q||"inherit"!==t||(r=ct_editor_localizations.default_content_boxed_border),!q||"yes"===n&&"card"!==e&&"content"!==e||(r=null),r}},{selector:".editor-styles-wrapper",type:"box-shadow",variable:"theme-boxed-content-box-shadow",responsive:!0,fullValue:!0,extractValue:function({template_subtype:e,content_style_source:t="inherit",content_boxed_shadow:r,has_content_block_structure:n="yes"}){return q||"inherit"!==t||(r=ct_editor_localizations.default_content_boxed_shadow),!q||"yes"===n&&"card"!==e&&"content"!==e?r:"CT_CSS_SKIP_RULE"}}],Y.reduce(function(e,t){return{...e,[t]:X}},{}))};var Y,X;const Z=function(e,t){const r={...(0,B.getValueFromInput)(ct_editor_localizations.post_options,wp.data.select("core/editor").getEditedPostAttribute("blocksy_meta")||{}),[e]:t};if(!H[e])return;const n=(Array.isArray(H[e])?H[e]:[H[e]]).reduce(function(e,t){const r=t.selector.includes('iframe[name="editor-canvas"]')?"backgroundVariables":"nonBackgroundVariables";return{...e,[r]:[...e[r],t]}},{backgroundVariables:[],nonBackgroundVariables:[]});if(te(),n.backgroundVariables.length>0){const e=document.querySelector("#ct-main-editor-styles-inline-css");e&&A({variableDescriptor:n.backgroundVariables,value:t,fullValue:r,tabletMQ:"(max-width: 800px)",mobileMQ:"(max-width: 370px)",cacheId:"background",initialStyleTagsDescriptor:[{style:e}]})}n.nonBackgroundVariables.length>0&&A({variableDescriptor:n.nonBackgroundVariables,value:t,fullValue:r,tabletMQ:"(max-width: 800px)",mobileMQ:"(max-width: 370px)",cacheId:"non-background",initialStyleTagsDescriptor:[{readStyles:function(){const e=window.wp.data.select("core/editor").getEditorSettings().styles.find(function(e){return"blocksy"===e.source});return e&&e.css?e.css:""},persistStyles:function(e){const t=window.wp.data.select("core/editor").getEditorSettings();wp.data.dispatch("core/editor").updateEditorSettings({...t,styles:t.styles.map(function(t){return"blocksy"!==t.source?t:{...t,css:e}})})}}]}),re()};var ee=window.wp.primitives;(0,n.createContext)(),(0,n.createContext)();const te=function(){const e=document.querySelector('iframe[name="editor-canvas"]');if(e){const t=e.contentDocument.querySelector("body");t&&(t.style.transition="none")}},re=function(){const e=document.querySelector('iframe[name="editor-canvas"]');if(e){const t=e.contentDocument.querySelector("body");t&&setTimeout(function(){t.removeAttribute("style")},100)}};let ne=null;const oe=function(){let e=function(e=null){if(wp.customize&&wp.customize.previewedDevice)return wp.customize.previewedDevice();let t=e;wp.data&&wp.data.select&&(t=wp.data.select);let r="desktop";return t&&(t("core/editor")&&t("core/editor").getDeviceType?r=t("core/editor").getDeviceType().toLowerCase():t("core/edit-post")&&t("core/edit-post").__experimentalGetPreviewDeviceType()&&(r=t("core/edit-post").__experimentalGetPreviewDeviceType().toLowerCase())),r}();ne!==e&&(ne=e,document.body.classList.remove("ct-desktop-view","ct-tablet-view","ct-mobile-view"),document.body.classList.add(`ct-${e}-view`))};oe(),wp.data.subscribe(function(){oe()});(0,n.createElement)(ee.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,n.createElement)(ee.Path,{d:"M13 11.9l3.3-3.4-1.1-1-3.2 3.3-3.2-3.3-1.1 1 3.3 3.4-3.5 3.6 1 1L12 13l3.5 3.5 1-1z"})),(0,n.createElement)(ee.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,n.createElement)(ee.Path,{fillRule:"evenodd",d:"M9.706 8.646a.25.25 0 01-.188.137l-4.626.672a.25.25 0 00-.139.427l3.348 3.262a.25.25 0 01.072.222l-.79 4.607a.25.25 0 00.362.264l4.138-2.176a.25.25 0 01.233 0l4.137 2.175a.25.25 0 00.363-.263l-.79-4.607a.25.25 0 01.072-.222l3.347-3.262a.25.25 0 00-.139-.427l-4.626-.672a.25.25 0 01-.188-.137l-2.069-4.192a.25.25 0 00-.448 0L9.706 8.646zM12 7.39l-.948 1.921a1.75 1.75 0 01-1.317.957l-2.12.308 1.534 1.495c.412.402.6.982.503 1.55l-.362 2.11 1.896-.997a1.75 1.75 0 011.629 0l1.895.997-.362-2.11a1.75 1.75 0 01.504-1.55l1.533-1.495-2.12-.308a1.75 1.75 0 01-1.317-.957L12 7.39z",clipRule:"evenodd"})),(0,n.createElement)(ee.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,n.createElement)(ee.Path,{d:"M11.776 4.454a.25.25 0 01.448 0l2.069 4.192a.25.25 0 00.188.137l4.626.672a.25.25 0 01.139.426l-3.348 3.263a.25.25 0 00-.072.222l.79 4.607a.25.25 0 01-.362.263l-4.138-2.175a.25.25 0 00-.232 0l-4.138 2.175a.25.25 0 01-.363-.263l.79-4.607a.25.25 0 00-.071-.222L4.754 9.881a.25.25 0 01.139-.426l4.626-.672a.25.25 0 00.188-.137l2.069-4.192z"}));const ae=(0,i.compose)((0,o.withPluginContext)(function(e,{name:t}){return{sidebarName:`${e.name}/${t}`}}),(0,s.withSelect)(function(e,{sidebarName:t}){const r=e("core/editor").getEditedPostAttribute("blocksy_meta"),{getActiveGeneralSidebarName:n,isPluginItemPinned:o}=e("core/edit-post");return{isActive:n()===t,value:Array.isArray(r)?{}:r||{},options:ct_editor_localizations.post_options}}),(0,s.withDispatch)(function(e,{sidebarName:t}){return{onChange:function(t){e("core/editor").editPost({blocksy_meta:t})}}}))(function({name:e,value:t,options:r,onChange:o,isActive:s}){const i=(0,n.useRef)(),c=(0,n.useRef)(),[u,p]=(0,n.useState)(null),[d,y]=(0,n.useState)(null);(0,n.useEffect)(function(){document.body.classList[s?"add":"remove"]("blocksy-sidebar-active")},[s]);const b=function({id:e,value:n}){const a={...u||(0,B.getValueFromInput)(r,t||{}),[e]:n};Z(e,n),o({...t,[e]:n}),p(a)};return(0,n.useEffect)(function(){return function(){const e=new AbortController;y(e),l().on("ct:metabox:options:trigger-change",b,{signal:e.signal})}(),function(){d&&d.abort(),y(null)}},[]),(0,n.createElement)(n.Fragment,null,(0,n.createElement)(a.PluginSidebarMoreMenuItem,{target:"blocksy",icon:"admin-customizer"},(0,W.sprintf)((0,W.__)("%s Page Settings","blocksy"),ct_localizations.product_name)),(0,n.createElement)(a.PluginSidebar,{name:e,icon:(0,n.createElement)("span",{style:{display:"flex",width:"20px",height:"20px"},dangerouslySetInnerHTML:{__html:ct_editor_localizations.options_panel_svg}}),className:"ct-components-panel",title:(0,W.sprintf)((0,W.__)("%s Page Settings","blocksy"),ct_localizations.product_name)},(0,n.createElement)("div",{id:"ct-page-options",ref:c},(0,n.createElement)("div",{className:"ct-options-container",ref:i},(0,n.createElement)(B.DeviceManagerProvider,null,(0,n.createElement)(B.PanelLevel,{containerRef:i,parentContainerRef:c,useRefsAsWrappers:!0},(0,n.createElement)(B.OptionsPanel,{onChange:function(e,n){const a={...u||(0,B.getValueFromInput)(r,t||{}),[e]:n};Z(e,n),o({...t,[e]:n}),p(a)},onChangeMultiple:function(e,n={}){let a=null;a=(n={deleteNonExistent:!1,...n}).deleteNonExistent?{...e}:{...u||(0,B.getValueFromInput)(r,t||{}),...e},o(a),p(a)},value:u||(0,B.getValueFromInput)(r,t||{}),options:r})))))))});ct_editor_localizations.post_options&&(0,o.registerPlugin)("blocksy",{render:function(){return(0,n.createElement)(ae,{name:"blocksy"})}})}();