From bf005096766db21035038af30cc49bd51ba9a8e1 Mon Sep 17 00:00:00 2001 From: Karthik Bhat Date: Mon, 26 Oct 2020 16:49:02 +0530 Subject: [PATCH 1/2] Fix colorwings --- .../colorwings/class-colorwings-admin.php | 8 + .../colorwings/js/color-wings-preview.js | 12 +- .../colorwings/js/color-wings-preview.min.js | 2 +- library/addons/colorwings/js/color-wings.js | 315 +++--------------- .../addons/colorwings/js/color-wings.min.js | 12 +- src/backend/colorwings | 2 +- 6 files changed, 57 insertions(+), 294 deletions(-) diff --git a/library/addons/colorwings/class-colorwings-admin.php b/library/addons/colorwings/class-colorwings-admin.php index 98ad949..f48796b 100644 --- a/library/addons/colorwings/class-colorwings-admin.php +++ b/library/addons/colorwings/class-colorwings-admin.php @@ -111,6 +111,14 @@ public function add_controls( $wp_customize ) { 'transport' => 'postMessage', 'sanitize_callback' => array( $this, 'sanitize' ), 'validate_callback' => array( $this, 'validate' ), + 'default' => array( + get_stylesheet() => array( + 'global' => array( + 'type' => 'global', + 'styles' => '', + ), + ), + ), ) ); diff --git a/library/addons/colorwings/js/color-wings-preview.js b/library/addons/colorwings/js/color-wings-preview.js index 90b01cc..1386309 100644 --- a/library/addons/colorwings/js/color-wings-preview.js +++ b/library/addons/colorwings/js/color-wings-preview.js @@ -163,11 +163,13 @@ } function _createSuper(Derived) { - return function () { + var hasNativeReflectConstruct = _isNativeReflectConstruct(); + + return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; - if (_isNativeReflectConstruct()) { + if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); @@ -231,7 +233,7 @@ if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; - if (n === "Map" || n === "Set") return Array.from(n); + if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } @@ -1189,7 +1191,7 @@ focusDetails = _useStore.focusDetails, detailsOpacity = _useStore.detailsOpacity; - var styles = _objectSpread2({}, focusDetails.style, { + var styles = _objectSpread2(_objectSpread2({}, focusDetails.style), {}, { opacity: detailsOpacity }); @@ -1347,7 +1349,7 @@ value = _ref5.value, onChange = _ref5.onChange; var cOptions = clone(options).map(function (option) { - return _objectSpread2({}, option, { + return _objectSpread2(_objectSpread2({}, option), {}, { selected: value.includes(option.value) }); }); diff --git a/library/addons/colorwings/js/color-wings-preview.min.js b/library/addons/colorwings/js/color-wings-preview.min.js index 78c610d..75f2ea4 100644 --- a/library/addons/colorwings/js/color-wings-preview.min.js +++ b/library/addons/colorwings/js/color-wings-preview.min.js @@ -1 +1 @@ -!function(){"use strict";function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(t)}function t(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,o=new Array(t);n0?u:0,borderRightWidth:d>0?d:0,borderBottomWidth:f>0?f:0,borderLeftWidth:h>0?h:0}};E.setHighlightStyles(p)}R(e,n)},C=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];E.setHighlightStyles({box:{},main:{},padding:{},margin:{}}),j(e)},P=cw.Evt,L=function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return n.push({el:t}),t.parentNode!==document&&e(t.parentNode,n),n},D=function(e){var t="";return e.forEach((function(e,n){var o=e.el;e.cwSelected={classSelected:[]};var r="";if(""!==o.id&&!/\w*-\d+/g.test("".concat(o.id))&&"#".concat(o.id," ").concat(t).length<=30)return e.cwSelected.idSelected=!0,void(t=0===n?"#".concat(o.id):"#".concat(o.id," ").concat(t));var i=[];if(o.classList.forEach((function(n){i.length>=2||/\w*-\d+/g.test("".concat(n))||"".concat(r,".").concat(n," ").concat(t).length>=30||(e.cwSelected.classSelected.push(n),r="".concat(r,".").concat(n),i.push(n))})),0===o.classList.length){var c=o.tagName.toLowerCase();if("html"===c&&0!==t.length)return;"".concat(c).concat(r," ").concat(t).length<=30&&(r="".concat(c).concat(r),e.cwSelected.tagSelected=!0)}"".concat(r," ").concat(t).length>=30?e.cwSelected={classSelected:[]}:t=0===n?r:"".concat(""===r?"":r+" ").concat(t)})),t},N=function(e){if(null===e)return"";var t=L(e);return D(t)},F=function(e){if(null===e)return"";var t=L(e);return D(t),t},z=function(e){var t=window.pageYOffset+e.top;return{top:{borderTopWidth:"1px",width:e.width,left:e.left,top:t},right:{borderRightWidth:"1px",height:e.height,left:e.right-1,top:t},bottom:{borderTopWidth:"1px",width:e.width,left:e.left,top:window.pageYOffset+e.bottom-1},left:{borderRightWidth:"1px",height:e.height,left:e.left,top:t}}},A=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!E.isFocused()||!1!==t){var n=!1;if(void 0!==e&&!1!==e||void 0===x)if(void 0===e.target){if(""===e)return;var o=p(document.querySelectorAll(e));o.includes(x)||(x=o[0]),n=!0}else x=e.target;else;var r=x.getBoundingClientRect(),i=window.pageYOffset+r.top,c=i-24=document.body.clientHeight&&(c=0);var a={focusLines:z(r),focusDetails:{style:{left:r.left,top:c,height:"24px",background:"#7CB342"},selector:n?e:N(x)}};E.moveFocus(a)}},I=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;e&&(e.preventDefault(),e.stopPropagation());var n=E.get().focusDetails.selector;E.isFocused()&&"lock"!==t?(E.unlockFocus(),P.emit("focusUnlocked",n),C()):(E.lockFocus(),P.emit("focusLocked",{currentSelector:n,currentTarget:x}),C(),R(n)),cw.MainStore.setSelectorClass()};jQuery;function M(t){var n,o,r;if("object"!==e(t)||null===t)return t;for(r in n=Array.isArray(t)?[]:{},t)o=t[r],n[r]=M(o);return n}var W,_,B=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"cw-applied-styles",t=document.createElement("style");return t.id=e,document.head.appendChild(t),t},H=B(),U=B("cw-temp-styles"),q=(W="cw-applied-font",(_=document.createElement("link")).id=W,_.rel="stylesheet",document.head.appendChild(_),_),Y=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=null;return function(){var r=arguments,i=this,c=n&&!o,a=function(){return e.apply(i,r)};clearTimeout(o),o=setTimeout(a,t),c&&a()}}((function(){void 0!==x&&A(!1,!0)}),500,!0);cw.StylesStore.registerSpecialSubscriber((function(e){return U.innerHTML=e})),cw.StylesStore.registerSpecialSubscriber((function(){var e=cw.MainStore.get(),t=e.currentPage,n=e.allFonts;for(var o in n[t])if(n[t].hasOwnProperty(o)){var r=n[t][o];if("google"===o){var i=[];for(var c in r)if(r.hasOwnProperty(c)){var a=r[c],l=c.replace(" ","+");i.push("".concat(l,":").concat(a.join(",")))}q.href="https://fonts.googleapis.com/css?family=".concat(i.join("|"),"&display=fallback")}}}),"fontManager"),cw.StylesStore.subscribe((function(){var e=cw.StylesStore.get().allOutputs,t="";for(var n in e)e.hasOwnProperty(n)&&("global"===n||n in window.cwPreviewObject.pages&&window.cwPreviewObject.pages[n])&&(t+=e[n]);H.innerHTML=t,U.innerHTML=""})),cw.StylesStore.subscribe(Y),window.addEventListener("resize",Y);var Q=document.querySelectorAll("body > *:not(script):not(style):not(#color-wings)");Q.forEach((function(e){e.addEventListener("mouseover",A)})),cw.Evt.on("mount-colorwings",(function(){Q.forEach((function(e){e.addEventListener("click",I,!0)}))})),cw.Evt.on("unmount-colorwings",(function(){Q.forEach((function(e){e.removeEventListener("click",I,!0)}))})),document.body.addEventListener("mouseleave",(function(){E.reduceFocusOpacity()})),document.body.addEventListener("mouseenter",(function(){E.increaseFocusOpacity()}));var X=[{name:"Body",sel:"body"},{name:"Header",sel:".site-header"},{name:"Content Wrapper",sel:".site-content"},{name:"Main Content",sel:".main"},{name:"Sidebar",sel:".sidebar"},{name:"Footer",sel:".site-footer"},{name:"Buttons",sel:"button"},{name:"Links",sel:"a"},{name:"Inputs",sel:"input"},{name:"H1",sel:"h1"},{name:"H2",sel:"h2"},{name:"Paragraphs",sel:"p"},{name:"Code",sel:"code"},{name:"Article Card",sel:".entry-article"}].filter((function(e){return null!==document.querySelector(e.sel)}));cw.MainStore.setQuickSelectors(X),cw.Evt.on("select-element",(function(e){A(e,!0),I(!1,"lock")})),cw.Evt.on("update-selector",(function(e){!function(e){var t=null;try{t=document.querySelector(e)}catch(e){}null===t?cw.MainStore.setSelectorClass("invalid"):(A(e,!0),I(!1,"lock"))}(e)})),cw.Evt.on("highlight-elements",(function(e){var t,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];"string"!=typeof e&&(t=e,e=N(e)),T(e,t,n)})),cw.Evt.on("de-highlight-elements",C);var $=function(e){var t=function(e){var t="";return e.forEach((function(e){""===t||t.endsWith(" ")||(t+=" "),"name"in e.tag&&e.tag.selected&&(t+=e.tag.name),"name"in e.id&&e.id.selected&&(t+=e.id.name),Object.values(e.cls).forEach((function(e){e.selected&&(t+=e.name)}))})),t}(e);cw.Evt.emit("select-element",t)},G=function(e){for(var t=E.get().currentTarget;e>0;)t=t.parentElement,e--;return t},J=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];!0===t?cw.Evt.emit("de-highlight-elements",!0):cw.Evt.emit("highlight-elements",G(e),!0)};function K(){var e=y(E),t=e.focusLines,n=e.focusOpacity;return React.createElement("div",{id:"cw-focuser",style:{opacity:n}},React.createElement("div",{className:"cw-focus-line",id:"cw-focuser-top",style:t.top}),React.createElement("div",{className:"cw-focus-line",id:"cw-focuser-right",style:t.right}),React.createElement("div",{className:"cw-focus-line",id:"cw-focuser-bottom",style:t.bottom}),React.createElement("div",{className:"cw-focus-line",id:"cw-focuser-left",style:t.left}))}function V(){var e=y(E),t=e.focusDetails,n=e.detailsOpacity,o=c({},t.style,{opacity:n});return React.createElement("div",{id:"cw-focus-details",className:"cw-focus-details",style:o},React.createElement("div",{id:"cw-focus-selector",className:"cw-selector"},t.selector))}cw.Evt.on("focusLocked",(function(e){var t=E.get(),n=t.currentTarget,o=t.showDomTree;n===e.currentTarget&&o||E.showDomTree(e,function(e){if(!1===e)return[];var t=[];return F(e).forEach((function(e){var n={tag:{},id:{},cls:{}};n.tag.name=e.el.tagName.toLowerCase(),n.tag.selected=!(!e.cwSelected||!e.cwSelected.tagSelected),""!==e.el.id&&(n.id.name="#".concat(e.el.id),n.id.selected=!(!e.cwSelected||!e.cwSelected.idSelected)),e.el.classList.forEach((function(t){n.cls[".".concat(t)]={name:".".concat(t),selected:!!e.cwSelected&&e.cwSelected.classSelected.includes(t)}})),t.unshift(n)})),t}(e.currentTarget))})),cw.Evt.on("focusUnlocked",(function(){return E.hideDomTree()}));function Z(){var e=y(E),t=e.showDomTree,n=e.domTree;return React.createElement("div",{id:"cw-domtree"},t?function(e){var t=function(){return setTimeout((function(){return $(e)}),100)},n=[];return e.forEach((function(o,r){n.push(React.createElement("li",{key:"".concat(o.tag.name,"-").concat(r),className:"cw-domtree-node"},React.createElement(ee,{element:o,callUpdateSelector:t,ri:e.length-r-1}),o.id.name||o.cls&&Object.keys(o.cls).length>0?React.createElement("div",{className:"cw-node-attributes"},React.createElement(te,{element:o,callUpdateSelector:t})):null))})),React.createElement("ul",{className:"cw-domtree-list"},n)}(n):"",React.createElement("style",{type:"text/css"},"#cw-domtree {\n width: 100%;\n bottom: 0;\n position: fixed;\n background: #eee;\n font-size: 14px;\n color: #444;\n line-height: 16px;\n margin: 0; }\n #cw-domtree .cw-domtree-list {\n white-space: nowrap;\n list-style-type: none;\n margin: 0;\n border-top: 1px solid #bbb; }\n #cw-domtree .cw-domtree-node {\n display: inline-block;\n background-color: #ddd;\n margin: 0;\n position: relative; }\n #cw-domtree .cw-node-tag {\n position: relative; }\n #cw-domtree .cw-node-tag button {\n margin: 0;\n text-transform: none;\n border: none;\n letter-spacing: normal;\n font-size: 12px;\n font-weight: 500;\n height: 24px;\n line-height: 24px;\n padding: 0 16px 0 20px;\n background: #ddd;\n color: #555;\n transition: none; }\n #cw-domtree .cw-node-tag .cw-target {\n display: none;\n position: absolute;\n right: -3px;\n top: 6px;\n width: 12px;\n height: 12px;\n border-radius: 6px;\n background: center/contain no-repeat url(\"data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12px' height='12px' viewBox='0 0 12 12'%3E%3Crect fill='%23333' x='5.5' y='.5' width='1' height='3.5'/%3E%3Crect fill='%23333' x='5.5' y='8' width='1' height='3.5'/%3E%3Crect fill='%23333' x='.5' y='5.5' width='3.5' height='1'/%3E%3Crect fill='%23333' x='8' y='5.5' width='3.5' height='1'/%3E%3C/svg%3E\");\n padding: 0;\n z-index: 3; }\n #cw-domtree .cw-node-tag:before {\n content: \" \";\n display: block;\n width: 0;\n height: 0;\n border-top: 12px solid transparent;\n border-bottom: 12px solid transparent;\n border-left: 10px solid rgba(0, 0, 0, 0.4);\n position: absolute;\n top: 0;\n margin-left: 1px;\n left: 100%;\n z-index: 1; }\n #cw-domtree .cw-node-tag:after {\n content: \" \";\n display: block;\n width: 0;\n height: 0;\n border-top: 12px solid transparent;\n border-bottom: 12px solid transparent;\n border-left: 10px solid #ddd;\n position: absolute;\n top: 0;\n left: 100%;\n z-index: 2; }\n #cw-domtree .cw-domtree-node:hover, #cw-domtree .cw-domtree-node:hover .cw-node-tag button, #cw-domtree .cw-domtree-node .selected button {\n background-color: #7cb342;\n color: #fff; }\n #cw-domtree .cw-domtree-node:hover .cw-node-tag:after, #cw-domtree .cw-domtree-node .cw-node-tag.selected:after {\n border-left-color: #7cb342; }\n #cw-domtree .cw-domtree-node:not(:last-child):hover .cw-target {\n display: block;\n background-color: #fff; }\n #cw-domtree .cw-domtree-node .selected button {\n color: #fff; }\n #cw-domtree .cw-node-attributes {\n display: none;\n position: absolute;\n bottom: 100%;\n background: #eee;\n height: auto;\n min-width: 15em;\n color: #444;\n line-height: 16px;\n margin: 0;\n padding: 0 5px;\n transition: all .5s ease-in-out;\n border: 1px solid #bbb;\n border-radius: 3px;\n left: 0; }\n #cw-domtree .cw-select {\n display: flex;\n flex-wrap: wrap;\n border: none;\n border-bottom: 1px solid #ccc;\n border-radius: 0;\n box-shadow: none;\n background: #eee;\n padding: 5px 0; }\n #cw-domtree .cw-select:last-child {\n border-bottom: none; }\n #cw-domtree .cw-select .cw-select-option {\n margin: 2px;\n border: none; }\n #cw-domtree .cw-select button {\n margin: 0;\n text-transform: none;\n font-weight: 500;\n letter-spacing: normal;\n height: 22px;\n line-height: 22px;\n font-size: 12px;\n border-radius: 3px;\n padding: 0 8px;\n background: #fff;\n color: #444;\n border: none; }\n #cw-domtree .cw-select button.selected {\n background-color: #7cb342;\n color: #fff; }\n #cw-domtree .cw-select button:hover {\n background: #f1f7eb; }\n #cw-domtree .cw-select button.selected:hover {\n background: #6fa13b; }\n #cw-domtree .cw-domtree-node:hover > .cw-node-attributes {\n display: block; }\n"))}function ee(e){var t=e.element,n=e.callUpdateSelector,o=e.ri,r=h(React.useState(!!t.tag.selected),2),i=r[0],c=r[1];return React.createElement("div",{className:"cw-node-tag".concat(i?" selected":"")},React.createElement("button",{onClick:function(){c((function(e){return t.tag.selected=!e,!e})),n()}},t.tag.name),React.createElement("button",{onClick:function(){return function(e){E.hideDomTree(),setTimeout((function(){cw.Evt.emit("select-element",{target:G(e)})}),0)}(o)},className:"cw-target",onMouseEnter:function(){return J(o,!1)},onMouseLeave:J}))}function te(e){var t=e.element,n=e.callUpdateSelector,o=[],r=[],i=[],c=[];t.id&&t.id.name&&(t.id.selected&&o.push(t.id.name),i.push({value:t.id.name,name:t.id.name})),t.cls&&Object.entries(t.cls).map((function(e){var t=h(e,2),n=(t[0],t[1]);n.selected&&r.push(n.name),c.push({value:n.name,name:n.name})}));return React.createElement(React.Fragment,null,i.length>0&&React.createElement(ne,{options:i,onChange:function(e){t.id.selected=e.includes(t.id.name),n()},value:o}),c.length>0&&React.createElement(ne,{options:c,onChange:function(e){Object.values(t.cls).forEach((function(e){e.selected=!1})),e.forEach((function(e){t.cls[e].selected=!0})),n()},value:r}))}function ne(e){var t=e.options,n=e.value,o=e.onChange,r=M(t).map((function(e){return c({},e,{selected:n.includes(e.value)})})),i=h(React.useState(r),2),a=i[0],l=i[1];return React.createElement("div",{className:"cw-select"},a.map((function(e,t){return React.createElement("div",{key:e.value,className:"cw-select-option"},React.createElement("button",{onClick:function(){return function(e){l((function(t){var n=M(t);return n[e].selected=!n[e].selected,o(n.reduce((function(e,t){return t.selected&&e.push(t.value),e}),[])),n}))}(t)},className:"".concat(e.selected?"selected":"")},e.name))})))}function oe(){var e=y(E),t=e.highlightStyles,n=e.similarStyles;return React.createElement("div",{id:"cw-highlighter"},React.createElement("div",{className:"cw-highlight-box",style:t.box},React.createElement("div",{className:"cw-highlight-main",style:t.main}),React.createElement("div",{className:"cw-highlight-padding",style:t.padding}),React.createElement("div",{className:"cw-highlight-margin",style:t.margin})),React.createElement("style",null,n))}function re(){return React.createElement("div",{id:"cw-canvas"},React.createElement(V,null),React.createElement(K,null),React.createElement(oe,null),React.createElement(Z,null),React.createElement("style",{type:"text/css"},"#color-wings {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 0;\n overflow: visible;\n z-index: 1500; }\n\n#cw-focuser .cw-focus-line {\n position: absolute;\n border-color: #7cb342;\n border-style: solid;\n border-width: 0;\n box-shadow: 0 0 2px rgba(124, 179, 66, 0.6); }\n\n#cw-focus-details {\n position: absolute;\n color: #fff;\n font-size: 12px;\n line-height: 24px;\n font-weight: 500; }\n #cw-focus-details .cw-selector {\n padding: 0 10px; }\n\n#cw-highlighter .cw-highlight-box {\n position: absolute; }\n\n#cw-highlighter .cw-highlight-main {\n position: absolute;\n background: rgba(92, 153, 214, 0.6); }\n\n#cw-highlighter .cw-highlight-padding {\n position: absolute;\n top: 0;\n left: 0;\n border: 0 solid rgba(147, 197, 129, 0.6);\n box-sizing: border-box; }\n\n#cw-highlighter .cw-highlight-margin {\n position: absolute;\n border: 0 solid rgba(244, 166, 87, 0.6);\n box-sizing: content-box; }\n\n.customize-partial-edit-shortcut, .customize-partial-edit-shortcut {\n display: none; }\n"))}"undefined"!=typeof wp&&wp.hasOwnProperty("customize")&&wp.customize.bind("preview-ready",(function(){var e=document.createElement("div");e.id="color-wings",document.body.appendChild(e),cw.Evt.on("mount-colorwings",(function(){setTimeout((function(){return ReactDOM.render(React.createElement(re,null),e)}),100)})),cw.Evt.on("unmount-colorwings",(function(){ReactDOM.unmountComponentAtNode(e)}))}))}(); +!function(){"use strict";function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(t)}function t(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,o=new Array(t);n0?u:0,borderRightWidth:d>0?d:0,borderBottomWidth:f>0?f:0,borderLeftWidth:h>0?h:0}};S.setHighlightStyles(p)}k(e,n)},T=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];S.setHighlightStyles({box:{},main:{},padding:{},margin:{}}),R(e)},C=cw.Evt,P=function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return n.push({el:t}),t.parentNode!==document&&e(t.parentNode,n),n},L=function(e){var t="";return e.forEach((function(e,n){var o=e.el;e.cwSelected={classSelected:[]};var r="";if(""!==o.id&&!/\w*-\d+/g.test("".concat(o.id))&&"#".concat(o.id," ").concat(t).length<=30)return e.cwSelected.idSelected=!0,void(t=0===n?"#".concat(o.id):"#".concat(o.id," ").concat(t));var i=[];if(o.classList.forEach((function(n){i.length>=2||/\w*-\d+/g.test("".concat(n))||"".concat(r,".").concat(n," ").concat(t).length>=30||(e.cwSelected.classSelected.push(n),r="".concat(r,".").concat(n),i.push(n))})),0===o.classList.length){var c=o.tagName.toLowerCase();if("html"===c&&0!==t.length)return;"".concat(c).concat(r," ").concat(t).length<=30&&(r="".concat(c).concat(r),e.cwSelected.tagSelected=!0)}"".concat(r," ").concat(t).length>=30?e.cwSelected={classSelected:[]}:t=0===n?r:"".concat(""===r?"":r+" ").concat(t)})),t},D=function(e){if(null===e)return"";var t=P(e);return L(t)},N=function(e){if(null===e)return"";var t=P(e);return L(t),t},F=function(e){var t=window.pageYOffset+e.top;return{top:{borderTopWidth:"1px",width:e.width,left:e.left,top:t},right:{borderRightWidth:"1px",height:e.height,left:e.right-1,top:t},bottom:{borderTopWidth:"1px",width:e.width,left:e.left,top:window.pageYOffset+e.bottom-1},left:{borderRightWidth:"1px",height:e.height,left:e.left,top:t}}},z=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!S.isFocused()||!1!==t){var n=!1;if(void 0!==e&&!1!==e||void 0===y)if(void 0===e.target){if(""===e)return;var o=h(document.querySelectorAll(e));o.includes(y)||(y=o[0]),n=!0}else y=e.target;else;var r=y.getBoundingClientRect(),i=window.pageYOffset+r.top,c=i-24=document.body.clientHeight&&(c=0);var a={focusLines:F(r),focusDetails:{style:{left:r.left,top:c,height:"24px",background:"#7CB342"},selector:n?e:D(y)}};S.moveFocus(a)}},A=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;e&&(e.preventDefault(),e.stopPropagation());var n=S.get().focusDetails.selector;S.isFocused()&&"lock"!==t?(S.unlockFocus(),C.emit("focusUnlocked",n),T()):(S.lockFocus(),C.emit("focusLocked",{currentSelector:n,currentTarget:y}),T(),k(n)),cw.MainStore.setSelectorClass()};jQuery;function I(t){var n,o,r;if("object"!==e(t)||null===t)return t;for(r in n=Array.isArray(t)?[]:{},t)o=t[r],n[r]=I(o);return n}var M,W,_=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"cw-applied-styles",t=document.createElement("style");return t.id=e,document.head.appendChild(t),t},B=_(),H=_("cw-temp-styles"),U=(M="cw-applied-font",(W=document.createElement("link")).id=M,W.rel="stylesheet",document.head.appendChild(W),W),q=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=null;return function(){var r=arguments,i=this,c=n&&!o,a=function(){return e.apply(i,r)};clearTimeout(o),o=setTimeout(a,t),c&&a()}}((function(){void 0!==y&&z(!1,!0)}),500,!0);cw.StylesStore.registerSpecialSubscriber((function(e){return H.innerHTML=e})),cw.StylesStore.registerSpecialSubscriber((function(){var e=cw.MainStore.get(),t=e.currentPage,n=e.allFonts;for(var o in n[t])if(n[t].hasOwnProperty(o)){var r=n[t][o];if("google"===o){var i=[];for(var c in r)if(r.hasOwnProperty(c)){var a=r[c],l=c.replace(" ","+");i.push("".concat(l,":").concat(a.join(",")))}U.href="https://fonts.googleapis.com/css?family=".concat(i.join("|"),"&display=fallback")}}}),"fontManager"),cw.StylesStore.subscribe((function(){var e=cw.StylesStore.get().allOutputs,t="";for(var n in e)e.hasOwnProperty(n)&&("global"===n||n in window.cwPreviewObject.pages&&window.cwPreviewObject.pages[n])&&(t+=e[n]);B.innerHTML=t,H.innerHTML=""})),cw.StylesStore.subscribe(q),window.addEventListener("resize",q);var Y=document.querySelectorAll("body > *:not(script):not(style):not(#color-wings)");Y.forEach((function(e){e.addEventListener("mouseover",z)})),cw.Evt.on("mount-colorwings",(function(){Y.forEach((function(e){e.addEventListener("click",A,!0)}))})),cw.Evt.on("unmount-colorwings",(function(){Y.forEach((function(e){e.removeEventListener("click",A,!0)}))})),document.body.addEventListener("mouseleave",(function(){S.reduceFocusOpacity()})),document.body.addEventListener("mouseenter",(function(){S.increaseFocusOpacity()}));var Q=[{name:"Body",sel:"body"},{name:"Header",sel:".site-header"},{name:"Content Wrapper",sel:".site-content"},{name:"Main Content",sel:".main"},{name:"Sidebar",sel:".sidebar"},{name:"Footer",sel:".site-footer"},{name:"Buttons",sel:"button"},{name:"Links",sel:"a"},{name:"Inputs",sel:"input"},{name:"H1",sel:"h1"},{name:"H2",sel:"h2"},{name:"Paragraphs",sel:"p"},{name:"Code",sel:"code"},{name:"Article Card",sel:".entry-article"}].filter((function(e){return null!==document.querySelector(e.sel)}));cw.MainStore.setQuickSelectors(Q),cw.Evt.on("select-element",(function(e){z(e,!0),A(!1,"lock")})),cw.Evt.on("update-selector",(function(e){!function(e){var t=null;try{t=document.querySelector(e)}catch(e){}null===t?cw.MainStore.setSelectorClass("invalid"):(z(e,!0),A(!1,"lock"))}(e)})),cw.Evt.on("highlight-elements",(function(e){var t,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];"string"!=typeof e&&(t=e,e=D(e)),j(e,t,n)})),cw.Evt.on("de-highlight-elements",T);var X=function(e){var t=function(e){var t="";return e.forEach((function(e){""===t||t.endsWith(" ")||(t+=" "),"name"in e.tag&&e.tag.selected&&(t+=e.tag.name),"name"in e.id&&e.id.selected&&(t+=e.id.name),Object.values(e.cls).forEach((function(e){e.selected&&(t+=e.name)}))})),t}(e);cw.Evt.emit("select-element",t)},$=function(e){for(var t=S.get().currentTarget;e>0;)t=t.parentElement,e--;return t},G=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];!0===t?cw.Evt.emit("de-highlight-elements",!0):cw.Evt.emit("highlight-elements",$(e),!0)};function J(){var e=v(S),t=e.focusLines,n=e.focusOpacity;return React.createElement("div",{id:"cw-focuser",style:{opacity:n}},React.createElement("div",{className:"cw-focus-line",id:"cw-focuser-top",style:t.top}),React.createElement("div",{className:"cw-focus-line",id:"cw-focuser-right",style:t.right}),React.createElement("div",{className:"cw-focus-line",id:"cw-focuser-bottom",style:t.bottom}),React.createElement("div",{className:"cw-focus-line",id:"cw-focuser-left",style:t.left}))}function K(){var e=v(S),t=e.focusDetails,n=e.detailsOpacity,o=c(c({},t.style),{},{opacity:n});return React.createElement("div",{id:"cw-focus-details",className:"cw-focus-details",style:o},React.createElement("div",{id:"cw-focus-selector",className:"cw-selector"},t.selector))}cw.Evt.on("focusLocked",(function(e){var t=S.get(),n=t.currentTarget,o=t.showDomTree;n===e.currentTarget&&o||S.showDomTree(e,function(e){if(!1===e)return[];var t=[];return N(e).forEach((function(e){var n={tag:{},id:{},cls:{}};n.tag.name=e.el.tagName.toLowerCase(),n.tag.selected=!(!e.cwSelected||!e.cwSelected.tagSelected),""!==e.el.id&&(n.id.name="#".concat(e.el.id),n.id.selected=!(!e.cwSelected||!e.cwSelected.idSelected)),e.el.classList.forEach((function(t){n.cls[".".concat(t)]={name:".".concat(t),selected:!!e.cwSelected&&e.cwSelected.classSelected.includes(t)}})),t.unshift(n)})),t}(e.currentTarget))})),cw.Evt.on("focusUnlocked",(function(){return S.hideDomTree()}));function V(){var e=v(S),t=e.showDomTree,n=e.domTree;return React.createElement("div",{id:"cw-domtree"},t?function(e){var t=function(){return setTimeout((function(){return X(e)}),100)},n=[];return e.forEach((function(o,r){n.push(React.createElement("li",{key:"".concat(o.tag.name,"-").concat(r),className:"cw-domtree-node"},React.createElement(Z,{element:o,callUpdateSelector:t,ri:e.length-r-1}),o.id.name||o.cls&&Object.keys(o.cls).length>0?React.createElement("div",{className:"cw-node-attributes"},React.createElement(ee,{element:o,callUpdateSelector:t})):null))})),React.createElement("ul",{className:"cw-domtree-list"},n)}(n):"",React.createElement("style",{type:"text/css"},"#cw-domtree {\n width: 100%;\n bottom: 0;\n position: fixed;\n background: #eee;\n font-size: 14px;\n color: #444;\n line-height: 16px;\n margin: 0; }\n #cw-domtree .cw-domtree-list {\n white-space: nowrap;\n list-style-type: none;\n margin: 0;\n border-top: 1px solid #bbb; }\n #cw-domtree .cw-domtree-node {\n display: inline-block;\n background-color: #ddd;\n margin: 0;\n position: relative; }\n #cw-domtree .cw-node-tag {\n position: relative; }\n #cw-domtree .cw-node-tag button {\n margin: 0;\n text-transform: none;\n border: none;\n letter-spacing: normal;\n font-size: 12px;\n font-weight: 500;\n height: 24px;\n line-height: 24px;\n padding: 0 16px 0 20px;\n background: #ddd;\n color: #555;\n transition: none; }\n #cw-domtree .cw-node-tag .cw-target {\n display: none;\n position: absolute;\n right: -3px;\n top: 6px;\n width: 12px;\n height: 12px;\n border-radius: 6px;\n background: center/contain no-repeat url(\"data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12px' height='12px' viewBox='0 0 12 12'%3E%3Crect fill='%23333' x='5.5' y='.5' width='1' height='3.5'/%3E%3Crect fill='%23333' x='5.5' y='8' width='1' height='3.5'/%3E%3Crect fill='%23333' x='.5' y='5.5' width='3.5' height='1'/%3E%3Crect fill='%23333' x='8' y='5.5' width='3.5' height='1'/%3E%3C/svg%3E\");\n padding: 0;\n z-index: 3; }\n #cw-domtree .cw-node-tag:before {\n content: \" \";\n display: block;\n width: 0;\n height: 0;\n border-top: 12px solid transparent;\n border-bottom: 12px solid transparent;\n border-left: 10px solid rgba(0, 0, 0, 0.4);\n position: absolute;\n top: 0;\n margin-left: 1px;\n left: 100%;\n z-index: 1; }\n #cw-domtree .cw-node-tag:after {\n content: \" \";\n display: block;\n width: 0;\n height: 0;\n border-top: 12px solid transparent;\n border-bottom: 12px solid transparent;\n border-left: 10px solid #ddd;\n position: absolute;\n top: 0;\n left: 100%;\n z-index: 2; }\n #cw-domtree .cw-domtree-node:hover, #cw-domtree .cw-domtree-node:hover .cw-node-tag button, #cw-domtree .cw-domtree-node .selected button {\n background-color: #7cb342;\n color: #fff; }\n #cw-domtree .cw-domtree-node:hover .cw-node-tag:after, #cw-domtree .cw-domtree-node .cw-node-tag.selected:after {\n border-left-color: #7cb342; }\n #cw-domtree .cw-domtree-node:not(:last-child):hover .cw-target {\n display: block;\n background-color: #fff; }\n #cw-domtree .cw-domtree-node .selected button {\n color: #fff; }\n #cw-domtree .cw-node-attributes {\n display: none;\n position: absolute;\n bottom: 100%;\n background: #eee;\n height: auto;\n min-width: 15em;\n color: #444;\n line-height: 16px;\n margin: 0;\n padding: 0 5px;\n transition: all .5s ease-in-out;\n border: 1px solid #bbb;\n border-radius: 3px;\n left: 0; }\n #cw-domtree .cw-select {\n display: flex;\n flex-wrap: wrap;\n border: none;\n border-bottom: 1px solid #ccc;\n border-radius: 0;\n box-shadow: none;\n background: #eee;\n padding: 5px 0; }\n #cw-domtree .cw-select:last-child {\n border-bottom: none; }\n #cw-domtree .cw-select .cw-select-option {\n margin: 2px;\n border: none; }\n #cw-domtree .cw-select button {\n margin: 0;\n text-transform: none;\n font-weight: 500;\n letter-spacing: normal;\n height: 22px;\n line-height: 22px;\n font-size: 12px;\n border-radius: 3px;\n padding: 0 8px;\n background: #fff;\n color: #444;\n border: none; }\n #cw-domtree .cw-select button.selected {\n background-color: #7cb342;\n color: #fff; }\n #cw-domtree .cw-select button:hover {\n background: #f1f7eb; }\n #cw-domtree .cw-select button.selected:hover {\n background: #6fa13b; }\n #cw-domtree .cw-domtree-node:hover > .cw-node-attributes {\n display: block; }\n"))}function Z(e){var t=e.element,n=e.callUpdateSelector,o=e.ri,r=f(React.useState(!!t.tag.selected),2),i=r[0],c=r[1];return React.createElement("div",{className:"cw-node-tag".concat(i?" selected":"")},React.createElement("button",{onClick:function(){c((function(e){return t.tag.selected=!e,!e})),n()}},t.tag.name),React.createElement("button",{onClick:function(){return function(e){S.hideDomTree(),setTimeout((function(){cw.Evt.emit("select-element",{target:$(e)})}),0)}(o)},className:"cw-target",onMouseEnter:function(){return G(o,!1)},onMouseLeave:G}))}function ee(e){var t=e.element,n=e.callUpdateSelector,o=[],r=[],i=[],c=[];t.id&&t.id.name&&(t.id.selected&&o.push(t.id.name),i.push({value:t.id.name,name:t.id.name})),t.cls&&Object.entries(t.cls).map((function(e){var t=f(e,2),n=(t[0],t[1]);n.selected&&r.push(n.name),c.push({value:n.name,name:n.name})}));return React.createElement(React.Fragment,null,i.length>0&&React.createElement(te,{options:i,onChange:function(e){t.id.selected=e.includes(t.id.name),n()},value:o}),c.length>0&&React.createElement(te,{options:c,onChange:function(e){Object.values(t.cls).forEach((function(e){e.selected=!1})),e.forEach((function(e){t.cls[e].selected=!0})),n()},value:r}))}function te(e){var t=e.options,n=e.value,o=e.onChange,r=I(t).map((function(e){return c(c({},e),{},{selected:n.includes(e.value)})})),i=f(React.useState(r),2),a=i[0],l=i[1];return React.createElement("div",{className:"cw-select"},a.map((function(e,t){return React.createElement("div",{key:e.value,className:"cw-select-option"},React.createElement("button",{onClick:function(){return function(e){l((function(t){var n=I(t);return n[e].selected=!n[e].selected,o(n.reduce((function(e,t){return t.selected&&e.push(t.value),e}),[])),n}))}(t)},className:"".concat(e.selected?"selected":"")},e.name))})))}function ne(){var e=v(S),t=e.highlightStyles,n=e.similarStyles;return React.createElement("div",{id:"cw-highlighter"},React.createElement("div",{className:"cw-highlight-box",style:t.box},React.createElement("div",{className:"cw-highlight-main",style:t.main}),React.createElement("div",{className:"cw-highlight-padding",style:t.padding}),React.createElement("div",{className:"cw-highlight-margin",style:t.margin})),React.createElement("style",null,n))}function oe(){return React.createElement("div",{id:"cw-canvas"},React.createElement(K,null),React.createElement(J,null),React.createElement(ne,null),React.createElement(V,null),React.createElement("style",{type:"text/css"},"#color-wings {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 0;\n overflow: visible;\n z-index: 1500; }\n\n#cw-focuser .cw-focus-line {\n position: absolute;\n border-color: #7cb342;\n border-style: solid;\n border-width: 0;\n box-shadow: 0 0 2px rgba(124, 179, 66, 0.6); }\n\n#cw-focus-details {\n position: absolute;\n color: #fff;\n font-size: 12px;\n line-height: 24px;\n font-weight: 500; }\n #cw-focus-details .cw-selector {\n padding: 0 10px; }\n\n#cw-highlighter .cw-highlight-box {\n position: absolute; }\n\n#cw-highlighter .cw-highlight-main {\n position: absolute;\n background: rgba(92, 153, 214, 0.6); }\n\n#cw-highlighter .cw-highlight-padding {\n position: absolute;\n top: 0;\n left: 0;\n border: 0 solid rgba(147, 197, 129, 0.6);\n box-sizing: border-box; }\n\n#cw-highlighter .cw-highlight-margin {\n position: absolute;\n border: 0 solid rgba(244, 166, 87, 0.6);\n box-sizing: content-box; }\n\n.customize-partial-edit-shortcut, .customize-partial-edit-shortcut {\n display: none; }\n"))}"undefined"!=typeof wp&&wp.hasOwnProperty("customize")&&wp.customize.bind("preview-ready",(function(){var e=document.createElement("div");e.id="color-wings",document.body.appendChild(e),cw.Evt.on("mount-colorwings",(function(){setTimeout((function(){return ReactDOM.render(React.createElement(oe,null),e)}),100)})),cw.Evt.on("unmount-colorwings",(function(){ReactDOM.unmountComponentAtNode(e)}))}))}(); diff --git a/library/addons/colorwings/js/color-wings.js b/library/addons/colorwings/js/color-wings.js index c534eb5..87ef7dd 100644 --- a/library/addons/colorwings/js/color-wings.js +++ b/library/addons/colorwings/js/color-wings.js @@ -6,10 +6,11 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ -(function (React$1) { +(function (React$1, PropTypes) { 'use strict'; var React$1__default = 'default' in React$1 ? React$1['default'] : React$1; + PropTypes = PropTypes && Object.prototype.hasOwnProperty.call(PropTypes, 'default') ? PropTypes['default'] : PropTypes; function _typeof(obj) { "@babel/helpers - typeof"; @@ -177,11 +178,13 @@ } function _createSuper(Derived) { - return function () { + var hasNativeReflectConstruct = _isNativeReflectConstruct(); + + return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; - if (_isNativeReflectConstruct()) { + if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); @@ -245,7 +248,7 @@ if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; - if (n === "Map" || n === "Set") return Array.from(n); + if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } @@ -2269,7 +2272,7 @@ unit = _getLength4[1]; setState(function (prev) { - return _objectSpread2({}, prev, { + return _objectSpread2(_objectSpread2({}, prev), {}, { main: main, unit: unit }); @@ -2287,7 +2290,7 @@ unit = _resetVal[1]; handleChange("".concat(main).concat(unit)); - return _objectSpread2({}, prev, { + return _objectSpread2(_objectSpread2({}, prev), {}, { main: main, unit: unit }); @@ -2298,7 +2301,7 @@ e.persist(); setState(function (prev) { handleChange("".concat(e.target.value).concat(prev.unit)); - return _objectSpread2({}, prev, { + return _objectSpread2(_objectSpread2({}, prev), {}, { main: e.target.value }); }); @@ -2309,7 +2312,7 @@ var unit = e.target.value; setState(function (prev) { handleChange("".concat(prev.main).concat(unit)); - return _objectSpread2({}, prev, { + return _objectSpread2(_objectSpread2({}, prev), {}, { unit: unit, step: units[unit].step, min: units[unit].min, @@ -2665,7 +2668,7 @@ }); e.currentTarget.classList.add('active'); setState(function (prev) { - return _objectSpread2({}, prev, { + return _objectSpread2(_objectSpread2({}, prev), {}, { tab: i }); }); @@ -2681,7 +2684,7 @@ } setState(function (prev) { - return _objectSpread2({}, prev, { + return _objectSpread2(_objectSpread2({}, prev), {}, { currentVal: currentVal, values: values }); @@ -3230,270 +3233,17 @@ }))]; } - /** @license React v16.13.1 - * react-is.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - var b="function"===typeof Symbol&&Symbol.for,c=b?Symbol.for("react.element"):60103,d=b?Symbol.for("react.portal"):60106,e=b?Symbol.for("react.fragment"):60107,f=b?Symbol.for("react.strict_mode"):60108,g=b?Symbol.for("react.profiler"):60114,h=b?Symbol.for("react.provider"):60109,k=b?Symbol.for("react.context"):60110,l=b?Symbol.for("react.async_mode"):60111,m=b?Symbol.for("react.concurrent_mode"):60111,n=b?Symbol.for("react.forward_ref"):60112,p=b?Symbol.for("react.suspense"):60113,q=b? - Symbol.for("react.suspense_list"):60120,r=b?Symbol.for("react.memo"):60115,t=b?Symbol.for("react.lazy"):60116,v=b?Symbol.for("react.block"):60121,w=b?Symbol.for("react.fundamental"):60117,x=b?Symbol.for("react.responder"):60118,y=b?Symbol.for("react.scope"):60119; - function z(a){if("object"===typeof a&&null!==a){var u=a.$$typeof;switch(u){case c:switch(a=a.type,a){case l:case m:case e:case g:case f:case p:return a;default:switch(a=a&&a.$$typeof,a){case k:case n:case t:case r:case h:return a;default:return u}}case d:return u}}}function A(a){return z(a)===m}var AsyncMode=l;var ConcurrentMode=m;var ContextConsumer=k;var ContextProvider=h;var Element=c;var ForwardRef=n;var Fragment=e;var Lazy=t;var Memo=r;var Portal=d; - var Profiler=g;var StrictMode=f;var Suspense=p;var isAsyncMode=function(a){return A(a)||z(a)===l};var isConcurrentMode=A;var isContextConsumer=function(a){return z(a)===k};var isContextProvider=function(a){return z(a)===h};var isElement=function(a){return "object"===typeof a&&null!==a&&a.$$typeof===c};var isForwardRef=function(a){return z(a)===n};var isFragment=function(a){return z(a)===e};var isLazy=function(a){return z(a)===t}; - var isMemo=function(a){return z(a)===r};var isPortal=function(a){return z(a)===d};var isProfiler=function(a){return z(a)===g};var isStrictMode=function(a){return z(a)===f};var isSuspense=function(a){return z(a)===p}; - var isValidElementType=function(a){return "string"===typeof a||"function"===typeof a||a===e||a===m||a===g||a===f||a===p||a===q||"object"===typeof a&&null!==a&&(a.$$typeof===t||a.$$typeof===r||a.$$typeof===h||a.$$typeof===k||a.$$typeof===n||a.$$typeof===w||a.$$typeof===x||a.$$typeof===y||a.$$typeof===v)};var typeOf=z; - - var reactIs_production_min = { - AsyncMode: AsyncMode, - ConcurrentMode: ConcurrentMode, - ContextConsumer: ContextConsumer, - ContextProvider: ContextProvider, - Element: Element, - ForwardRef: ForwardRef, - Fragment: Fragment, - Lazy: Lazy, - Memo: Memo, - Portal: Portal, - Profiler: Profiler, - StrictMode: StrictMode, - Suspense: Suspense, - isAsyncMode: isAsyncMode, - isConcurrentMode: isConcurrentMode, - isContextConsumer: isContextConsumer, - isContextProvider: isContextProvider, - isElement: isElement, - isForwardRef: isForwardRef, - isFragment: isFragment, - isLazy: isLazy, - isMemo: isMemo, - isPortal: isPortal, - isProfiler: isProfiler, - isStrictMode: isStrictMode, - isSuspense: isSuspense, - isValidElementType: isValidElementType, - typeOf: typeOf - }; - - var reactIs_development = createCommonjsModule(function (module, exports) { - }); - var reactIs_development_1 = reactIs_development.AsyncMode; - var reactIs_development_2 = reactIs_development.ConcurrentMode; - var reactIs_development_3 = reactIs_development.ContextConsumer; - var reactIs_development_4 = reactIs_development.ContextProvider; - var reactIs_development_5 = reactIs_development.Element; - var reactIs_development_6 = reactIs_development.ForwardRef; - var reactIs_development_7 = reactIs_development.Fragment; - var reactIs_development_8 = reactIs_development.Lazy; - var reactIs_development_9 = reactIs_development.Memo; - var reactIs_development_10 = reactIs_development.Portal; - var reactIs_development_11 = reactIs_development.Profiler; - var reactIs_development_12 = reactIs_development.StrictMode; - var reactIs_development_13 = reactIs_development.Suspense; - var reactIs_development_14 = reactIs_development.isAsyncMode; - var reactIs_development_15 = reactIs_development.isConcurrentMode; - var reactIs_development_16 = reactIs_development.isContextConsumer; - var reactIs_development_17 = reactIs_development.isContextProvider; - var reactIs_development_18 = reactIs_development.isElement; - var reactIs_development_19 = reactIs_development.isForwardRef; - var reactIs_development_20 = reactIs_development.isFragment; - var reactIs_development_21 = reactIs_development.isLazy; - var reactIs_development_22 = reactIs_development.isMemo; - var reactIs_development_23 = reactIs_development.isPortal; - var reactIs_development_24 = reactIs_development.isProfiler; - var reactIs_development_25 = reactIs_development.isStrictMode; - var reactIs_development_26 = reactIs_development.isSuspense; - var reactIs_development_27 = reactIs_development.isValidElementType; - var reactIs_development_28 = reactIs_development.typeOf; - - var reactIs = createCommonjsModule(function (module) { - - { - module.exports = reactIs_production_min; - } - }); - - /* - object-assign - (c) Sindre Sorhus - @license MIT - */ - /* eslint-disable no-unused-vars */ - var getOwnPropertySymbols = Object.getOwnPropertySymbols; - var hasOwnProperty = Object.prototype.hasOwnProperty; - var propIsEnumerable = Object.prototype.propertyIsEnumerable; - - function toObject(val) { - if (val === null || val === undefined) { - throw new TypeError('Object.assign cannot be called with null or undefined'); - } - - return Object(val); - } - - function shouldUseNative() { - try { - if (!Object.assign) { - return false; - } - - // Detect buggy property enumeration order in older V8 versions. - - // https://bugs.chromium.org/p/v8/issues/detail?id=4118 - var test1 = new String('abc'); // eslint-disable-line no-new-wrappers - test1[5] = 'de'; - if (Object.getOwnPropertyNames(test1)[0] === '5') { - return false; - } - - // https://bugs.chromium.org/p/v8/issues/detail?id=3056 - var test2 = {}; - for (var i = 0; i < 10; i++) { - test2['_' + String.fromCharCode(i)] = i; - } - var order2 = Object.getOwnPropertyNames(test2).map(function (n) { - return test2[n]; - }); - if (order2.join('') !== '0123456789') { - return false; - } - - // https://bugs.chromium.org/p/v8/issues/detail?id=3056 - var test3 = {}; - 'abcdefghijklmnopqrst'.split('').forEach(function (letter) { - test3[letter] = letter; - }); - if (Object.keys(Object.assign({}, test3)).join('') !== - 'abcdefghijklmnopqrst') { - return false; - } - - return true; - } catch (err) { - // We don't expect any of the above to throw, but better to be safe. - return false; - } - } - - var objectAssign = shouldUseNative() ? Object.assign : function (target, source) { - var from; - var to = toObject(target); - var symbols; - - for (var s = 1; s < arguments.length; s++) { - from = Object(arguments[s]); - - for (var key in from) { - if (hasOwnProperty.call(from, key)) { - to[key] = from[key]; - } - } - - if (getOwnPropertySymbols) { - symbols = getOwnPropertySymbols(from); - for (var i = 0; i < symbols.length; i++) { - if (propIsEnumerable.call(from, symbols[i])) { - to[symbols[i]] = from[symbols[i]]; - } - } - } - } - - return to; - }; - - /** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - - var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED'; - - var ReactPropTypesSecret_1 = ReactPropTypesSecret; - - var has = Function.call.bind(Object.prototype.hasOwnProperty); - - function emptyFunction() {} - function emptyFunctionWithReset() {} - emptyFunctionWithReset.resetWarningCache = emptyFunction; - - var factoryWithThrowingShims = function() { - function shim(props, propName, componentName, location, propFullName, secret) { - if (secret === ReactPropTypesSecret_1) { - // It is still safe when called from React. - return; - } - var err = new Error( - 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' + - 'Use PropTypes.checkPropTypes() to call them. ' + - 'Read more at http://fb.me/use-check-prop-types' - ); - err.name = 'Invariant Violation'; - throw err; - } shim.isRequired = shim; - function getShim() { - return shim; - } // Important! - // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`. - var ReactPropTypes = { - array: shim, - bool: shim, - func: shim, - number: shim, - object: shim, - string: shim, - symbol: shim, - - any: shim, - arrayOf: getShim, - element: shim, - elementType: shim, - instanceOf: getShim, - node: shim, - objectOf: getShim, - oneOf: getShim, - oneOfType: getShim, - shape: getShim, - exact: getShim, - - checkPropTypes: emptyFunctionWithReset, - resetWarningCache: emptyFunction - }; - - ReactPropTypes.PropTypes = ReactPropTypes; - - return ReactPropTypes; - }; - - var propTypes = createCommonjsModule(function (module) { - /** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - - { - // By explicitly using `prop-types` you are opting into new production behavior. - // http://fb.me/prop-types-in-prod - module.exports = factoryWithThrowingShims(); - } - }); - - const option = propTypes.shape({ - name: propTypes.string.isRequired, - value: propTypes.oneOfType([propTypes.string, propTypes.number]).isRequired + const option = PropTypes.shape({ + name: PropTypes.string.isRequired, + value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired }); - const optionType = propTypes.oneOfType([option, propTypes.shape({ - name: propTypes.string.isRequired, - type: propTypes.string.isRequired, - items: propTypes.arrayOf(option) + const optionType = PropTypes.oneOfType([option, PropTypes.shape({ + name: PropTypes.string.isRequired, + type: PropTypes.string.isRequired, + items: PropTypes.arrayOf(option) })]); - const valueType = propTypes.oneOfType([propTypes.object, propTypes.arrayOf(propTypes.object)]); - const classNameType = propTypes.oneOfType([propTypes.string, propTypes.func]); + const valueType = PropTypes.oneOfType([PropTypes.object, PropTypes.arrayOf(PropTypes.object)]); + const classNameType = PropTypes.oneOfType([PropTypes.string, PropTypes.func]); function ownKeys$5(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } @@ -3922,7 +3672,7 @@ }); e.currentTarget.classList.add('active'); changeState(function (prev) { - return _objectSpread2({}, prev, { + return _objectSpread2(_objectSpread2({}, prev), {}, { tab: i }); }); @@ -4236,7 +3986,7 @@ React.useEffect(function () { setFontParams(function (prev) { - return _objectSpread2({}, prev, { + return _objectSpread2(_objectSpread2({}, prev), {}, { family: currentStyles.fontFamily, style: currentStyles.fontStyle, weight: currentStyles.fontWeight @@ -4305,6 +4055,17 @@ details['category'] = 'sans-serif'; } + if (!('variants' in details)) { + details['variants'] = { + normal: ['300'], + italic: ['300'] + }; + } + + if (!('category' in details)) { + details['category'] = fontFamily.includes('serif') ? 'serif' : 'sans-serif'; + } + return details; }; @@ -5162,7 +4923,7 @@ var changePage = function changePage(e, page) { MainStore.changePage(page.name, page.type); setPopState(function (prev) { - return _objectSpread2({}, prev, { + return _objectSpread2(_objectSpread2({}, prev), {}, { show: false }); }); @@ -5206,7 +4967,7 @@ className: "popup-overlay ".concat(popState.show ? '' : 'hidden'), onClick: function onClick() { return setPopState(function (prev) { - return _objectSpread2({}, prev, { + return _objectSpread2(_objectSpread2({}, prev), {}, { show: false }); }); @@ -5301,5 +5062,5 @@ } }); -}(React)); +}(React, PropTypes)); //# sourceMappingURL=color-wings.js.map diff --git a/library/addons/colorwings/js/color-wings.min.js b/library/addons/colorwings/js/color-wings.min.js index 0f12d23..1ac5759 100644 --- a/library/addons/colorwings/js/color-wings.min.js +++ b/library/addons/colorwings/js/color-wings.min.js @@ -1,4 +1,4 @@ -!function(e){"use strict";var t="default"in e?e.default:e;function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n-1&&this.events[e].splice(r,1)}}},{key:"emit",value:function(e){for(var t=this,r=arguments.length,o=new Array(r>1?r-1:0),a=1;a2&&void 0!==arguments[2]&&arguments[2],r=null;return function(){var o=arguments,a=this,i=n&&!r,c=function(){return e.apply(a,o)};clearTimeout(r),r=setTimeout(c,t),i&&c()}}function P(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:100,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1e4,o=function(e){t=e},a=function(){},i=r/n,c=setInterval((function(){i--,("function"==typeof e&&!0===e()||!0===e&&"function"==typeof t)&&(t(),clearInterval(c)),i<=0&&clearInterval(c)}),n);return[o,a]}var N,z,M,T={mounted:!0,currentTheme:cwControlObject.theme,currentPage:"global",currentPageType:"global",currentSelector:"",currentPseudo:"",openSection:!1,currentStyles:{},previewObject:{},allFonts:{},quickSelectors:[],selectorClass:""},L=new(function(e){u(n,e);var t=m(n);function n(){return r(this,n),t.apply(this,arguments)}return a(n,[{key:"setMounted",value:function(e){this.set((function(){return{mounted:e}}))}},{key:"toggleSection",value:function(e){this.set((function(t){return t.openSection===e?{openSection:!1}:{openSection:e}}))}},{key:"addInitialSettings",value:function(e){if(e){var t={};for(var n in e)e.hasOwnProperty(n)&&"fonts"in e[n]&&(t[n]=e[n].fonts);this.set((function(){return{allFonts:t}}))}}},{key:"changePage",value:function(e,t){this.set((function(){return{currentPage:e,currentPageType:t}}))}},{key:"addPreviewObject",value:function(e){this.set((function(){return{previewObject:e}}))}},{key:"addFont",value:function(e){this.set((function(t){var n=t.currentPage,r=t.allFonts;n in r||(r[n]={});var o=e.source,a=e.family,c="normal"===e.style?"":"i",l="".concat(e.weight).concat(c);return o in r[n]?a in r[n][o]?r[n][o][a].includes(l)||r[n][o][a].push(l):r[n][o][a]=[l]:r[n][o]=i({},a,[l]),{allFonts:r}}))}},{key:"setQuickSelectors",value:function(e){this.set((function(){return{quickSelectors:e}}))}},{key:"togglePseudo",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";this.set((function(){return{currentPseudo:e}}))}},{key:"setSelectorClass",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";this.set((function(){return{selectorClass:e}}))}}]),n}(O))(T),A=new(function(e){u(n,e);var t=m(n);function n(){return r(this,n),t.apply(this,arguments)}return a(n,[{key:"setInitialMediaQueries",value:function(e){var t={},n=[];e.forEach((function(e){if("all"!==e){var r=e.match(/\d*(min-width):\s*(\d+\s?)(px)/),o=e.match(/\d*(max-width):\s*(\d+\s?)(px)/);if(null!==r||null!==o){var a=0,i=5e3;null!==r&&(a=Number(r[2]),-1===n.indexOf(a)&&n.push(a)),null!==o&&(i=Number(o[2]),-1===n.indexOf(i)&&n.push(i)),t["".concat(a,"-").concat(i)]={min:a,max:i,enabled:!0}}}})),this.set((function(){return{queries:t,breakpoints:n}}))}},{key:"addBreakpoint",value:function(){this.set((function(e){var t=e.breakpoints,n=e.currentPreviewWidth;return-1===t.indexOf(n)&&t.push(n),t.sort((function(e,t){return e-t})),{breakpoints:t,queries:function(e){for(var t=[0].concat(v(e),[5e3]),n={},r=0;r1&&void 0!==arguments[1]&&arguments[1];this.set((function(n){var r=n.queries;return r[e].enabled=t||!r[e].enabled,{queries:r}}))}},{key:"activateQuery",value:function(e){var t=function(e){return"".concat(0!==e.min?"(min-width: "+e.min+"px)":"").concat(0!==e.min&&5e3!==e.max?" and ":"").concat(5e3!==e.max?"(max-width: "+e.max+"px)":"")};this.set((function(n){return{currentMedia:{key:e,query:t(n.queries[e])}}})),this.toggleEnabled(e,!0)}},{key:"deActivateQuery",value:function(){this.set((function(){return{currentMedia:{key:"",query:"all"}}}))}},{key:"removeBreakpoint",value:function(e){this.set((function(t){var n=t.breakpoints.filter((function(t){return t!==e}));return{queries:Object.filter(t.queries,(function(t){var n=g(t,2),r=(n[0],n[1]);return r.min!==e&&r.max!==e})),breakpoints:n}}))}}]),n}(O))({currentPreviewWidth:0,breakpoints:[],queries:{},currentMedia:{key:"",query:"all"}}),q=new(function(e){u(n,e);var t=m(n);function n(){return r(this,n),t.apply(this,arguments)}return a(n,[{key:"addInitialStyle",value:function(e,t){var n={};for(var r in t)t.hasOwnProperty(r)&&(n[r]=t[r].styles);var o=this.parseStyles(e);this.overrideInitialState({styles:o,allOutputs:n}),A.setInitialMediaQueries(Object.keys(o))}},{key:"generateOutput",value:function(e){var t="";for(var n in e)if(e.hasOwnProperty(n)){for(var r in"all"!==n&&(t+="@media ".concat(n,"{")),e[n])if(e[n].hasOwnProperty(r)){for(var o in t+=r+"{",e[n][r])e[n][r].hasOwnProperty(o)&&(t+="".concat(o,":").concat(e[n][r][o],";"));t+="}"}"all"!==n&&(t+="}")}return t}},{key:"registerSpecialSubscriber",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"tempStyler";"tempStyler"===t?this.tempStyler=e:"fontManager"===t&&(this.addFont=e),this.debouncedSetStyles=j(this.setStyles,500)}},{key:"addStyle",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"all";this.tempStyler("".concat(e," { ").concat(t,": ").concat(n,"; }")),this.debouncedSetStyles(e,t,n,r)}},{key:"addStyleNow",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"all";this.tempStyler("".concat(e," { ").concat(t,": ").concat(n,"; }")),this.setStyles(e,t,n,r)}},{key:"setStyles",value:function(e,t,n){var r=this,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"all";o=A.get().currentMedia.query,this.set((function(a){var i=L.get().currentPseudo;e=""!==i?"".concat(e,":").concat(i):e;var c=a.styles;c.hasOwnProperty(o)||(c[o]={}),c[o].hasOwnProperty(e)||(c[o][e]={}),c[o][e][t]=n;var l=L.get().currentPage;return a.allOutputs[l]=r.generateOutput(c),{styles:c,allOutputs:a.allOutputs}}))}},{key:"parseStyles",value:function(e){try{return function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"all",r={};return r[n]={},t.forEach((function(t){if("rule"===t.type){var o={};t.declarations.forEach((function(e){o[e.property]=e.value})),r[n][t.selectors.join(", ")]=o}else"media"===t.type&&(r[t.media]=e(t.rules,t.media)[t.media])})),r}(S(e).stylesheet.rules)}catch(e){return e}}},{key:"addFromString",value:function(e){var t=this.parseStyles(e);if(t instanceof Error){var n=t;return cw.Evt.emit("toggle-notice","invalid","Invalid CSS: ".concat(n.reason," at ").concat(n.line,":").concat(n.column)),!1}cw.Evt.emit("toggle-notice","invalid",!1),this.set((function(n){var r=L.get().currentPage;return n.allOutputs[r]=e,{styles:t,allOutputs:n.allOutputs}}))}},{key:"removeMediaStyles",value:function(e){var t=this;this.set((function(n){var r=n.styles;return e.forEach((function(e){delete r[e]})),n.allOutputs[L.get().currentPage]=t.generateOutput(r),{styles:r,allOutputs:n.allOutputs}}))}}]),n}(O))({styles:{all:{}},allOutputs:{}});function I(e){N.innerHTML=".cwm-resizer{left:".concat(e,"px;}.cwm-enabled #customize-preview{width:").concat(e,"px;}"),M.innerHTML="".concat(e,"px")}function F(e){z.innerHTML=".cwm-bar .cwm-breakpoint-adder{left:".concat(e,"px;}"),A.updatePreviewWidth(e)}function D(e){e===A.get().currentMedia.key||""===e?A.deActivateQuery():A.activateQuery(e)}function B(e){var t=e.left,n=g(React.useState({show:!1,x:0,y:0}),2),r=n[0],o=n[1],a=function(){return o({show:!1})};return React.createElement(React.Fragment,null,r.show&&React.createElement("div",{className:"cwm-breakpoint-context"},React.createElement("div",{className:"cwm-context-bg",onClick:a}),React.createElement("div",{className:"cwm-context-menu",style:{left:r.x+2,top:r.y}},React.createElement("div",{className:"cwm-context-item",onClick:function(){var e=!0,n=function(e){var t=q.get().styles,n=[],r="";for(var o in t)t.hasOwnProperty(o)&&o.includes(e)&&(n.push(o),r+="\n".concat(o));return{queries:n,queriesString:r}}(t),r=n.queries,o=n.queriesString;""!==o&&(e=window.confirm("This will also remove all styles for following media queries:\n".concat(o,"\n\nAre you sure you want to remove?"))),e&&(A.removeBreakpoint(t),q.removeMediaStyles(r)),a()}},"Remove Breakpoint"))),React.createElement("div",{className:"cwm-breakpoint",style:{left:"".concat(t,"px")},onContextMenu:function(e){e.preventDefault(),o({show:!0,x:e.clientX,y:e.clientY})}}))}function W(){var e=g(React.useState(!1),2),t=e[0],n=e[1],r=E(A),o=r.queries,a=r.breakpoints,i=r.currentPreviewWidth,c=r.currentMedia,l=["rgba(229, 57, 53, .2)","rgb(142, 36, 170, .2)","rgb(57, 73, 171, .2)","rgb(3, 155, 229, .2)","rgb(0, 137, 123, .2)","rgb(124, 179, 66, .2)","rgb(253, 216, 53, .2)","rgb(251, 140, 0, .2)","rgb(109, 76, 65, .2)","rgb(84, 110, 122, .2)"],s=["rgba(229, 57, 53, .8)","rgb(142, 36, 170, .8)","rgb(57, 73, 171, .8)","rgb(3, 155, 229, .8)","rgb(0, 137, 123, .8)","rgb(124, 179, 66, .8)","rgb(253, 216, 53, .8)","rgb(251, 140, 0, .8)","rgb(109, 76, 65, .8)","rgb(84, 110, 122, .8)"];return React.createElement("div",{className:"cwm-bar".concat(t?" expanded":"")},React.createElement("div",{className:"cwm-queries"},Object.entries(o).map((function(e,n){var r=g(e,2),o=r[0],a=r[1],i="".concat(t?n%10*25:n%10*2,"px"),u=c.key===o;return u&&!t&&(i=0),React.createElement("div",{key:o,onClick:function(){return D(o)},className:"cwm-query".concat(a.enabled?" enabled":"").concat(u?" active":""),style:{left:"".concat(a.min+1,"px"),width:"".concat(a.max-a.min-2,"px"),background:a.enabled?s[n%9]:l[n%9],top:i}},React.createElement("span",{className:"cwm-query-enabler dashicons ".concat(a.enabled?"dashicons-visibility":"dashicons-hidden"),onClick:function(e){return function(e,t){e.stopPropagation(),A.toggleEnabled(t)}(e,o)}}),React.createElement("div",{className:"cwm-query-details"},0!==a.min?"(min: ".concat(a.min,"px)"):""," ",0!==a.min&&5e3!==a.max?"&":""," ",5e3!==a.max?"(max: ".concat(a.max,"px)"):""))}))),React.createElement("div",{className:"cwm-breakpoints"},a.map((function(e){return React.createElement(B,{key:e,left:e})}))),-1===a.indexOf(i)&&React.createElement("div",{className:"cwm-breakpoint-adder",onClick:function(){A.addBreakpoint()}},React.createElement("span",{className:"plus-sign"},"+"),React.createElement("span",{className:"adder-text"},"Add Breakpoint")),React.createElement("div",{className:"cwm-bar-toggler",onClick:function(){n((function(e){return!e}))}},React.createElement("span",{className:"dashicons dashicons-leftright"})))}function $(e){var t=React.createRef(),n=0,r=0,o=function(t){t.preventDefault();var o=Math.floor(t.clientX-n);o<1||(r=o,e.onResize&&e.onResize(r))},a=function t(){document.removeEventListener("mousemove",o),document.removeEventListener("mouseup",t),document.removeEventListener("touchcancel",t),document.removeEventListener("touchend",t),e.onEnd&&e.onEnd(r),document.body.classList.remove("cwm-resizing")};function i(e){e.preventDefault(),document.body.classList.add("cwm-resizing"),n=t.current.parentNode.getBoundingClientRect().left,document.addEventListener("mousemove",o),document.addEventListener("mouseup",a),document.addEventListener("touchcancel",a),document.addEventListener("touchend",a)}return React.createElement("div",{className:"cwm-resizer",ref:t,onMouseDown:i,onTouchStart:i,onMouseUp:a,onTouchCancel:a,onTouchEnd:a},React.createElement("div",{className:"cwm-resizer-tip"},React.createElement("div",{className:"cwm-indicator"}),React.createElement("div",{id:"cwm-resizer-details"})))}window.cw={Evt:w,StylesStore:q,MainStore:L},Object.filter=function(e,t){return Object.fromEntries(Object.entries(e).filter(t))},cw.Evt.on("cw-media-loaded",(function(){(N=document.createElement("style")).id="cwm-special-styles",(z=document.createElement("style")).id="cwm-bar-styles",document.getElementById("color-wings-media").append(N,z),M=document.getElementById("cwm-resizer-details")}));var V,H,U,K;function Q(){return React.useEffect((function(){cw.Evt.emit("cw-media-loaded")}),[]),React.createElement(React.Fragment,null,React.createElement(W,null),React.createElement($,{onResize:I,onEnd:F}),React.createElement("style",{type:"text/css"},"#color-wings-media {\n display: none;\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n height: 100%; }\n #color-wings-media * {\n box-sizing: border-box; }\n\n.cwm-enabled #color-wings-media {\n display: block; }\n\n.cwm-enabled #customize-preview {\n height: calc( 100% - 24px);\n top: 24px;\n left: 0;\n margin: auto 0 auto 1px; }\n .cwm-enabled #customize-preview iframe {\n z-index: 2; }\n\n.cwm-bar {\n position: fixed;\n top: 0;\n left: 301px;\n right: 0;\n height: 24px;\n background: #444;\n color: #eee;\n border-bottom: 1px solid #555;\n z-index: 5; }\n\n@media screen and (min-width: 1667px) {\n .cwm-bar {\n left: calc( 18% + 1px); } }\n\n.collapsed .cwm-bar {\n left: 1px !important; }\n\n.cwm-resizer {\n position: absolute;\n left: 100%;\n height: 100%;\n width: 14px;\n background: #666;\n cursor: ew-resize;\n z-index: 3; }\n .cwm-resizer:before {\n content: '';\n width: 2px;\n height: 26px;\n top: 50%;\n position: absolute;\n left: 50%;\n transform: translate(-50%, -50%);\n border-right: 2px solid #888;\n border-left: 2px solid #888; }\n\n.cwm-resizing #color-wings-media {\n z-index: 3; }\n\n.cwm-resizing #customize-preview {\n transition: none !important; }\n\n.cwm-resizer-tip {\n position: absolute;\n top: 0;\n left: 0; }\n\n.cwm-indicator {\n position: absolute;\n bottom: 0;\n left: 0;\n height: 26px;\n width: 0;\n border-top: 1px solid #eee;\n border-right: 1px solid transparent;\n border-bottom: 1px solid transparent;\n border-left: 1px solid #69e000; }\n\n#cwm-resizer-details {\n position: absolute;\n top: 2px;\n color: #fff;\n left: 16px;\n background: #444444;\n padding: 0 10px; }\n\n.cwm-breakpoint-adder {\n position: absolute;\n background: #eee;\n border: 1px solid #666;\n color: #000;\n left: 0;\n top: 0;\n padding: 0 5px 0 5px;\n border-radius: 0 0 3px 0;\n max-height: 18px;\n white-space: nowrap;\n cursor: pointer;\n z-index: 5;\n border-top-width: 0;\n line-height: 16px; }\n .cwm-breakpoint-adder:before, .cwm-breakpoint-adder:after {\n content: '';\n display: block;\n position: absolute;\n left: 0;\n top: 100%;\n width: 0;\n height: 0;\n border-top: 6px solid #eee;\n border-right: 8px solid transparent;\n border-bottom: 0 solid transparent;\n border-left: 0 solid transparent; }\n .cwm-breakpoint-adder:before {\n left: -1px;\n border-top: 8px solid #666;\n border-right: 11px solid transparent;\n border-bottom: 0 solid transparent;\n border-left: 0 solid transparent; }\n .cwm-breakpoint-adder .plus-sign {\n font-size: 18px; }\n .cwm-breakpoint-adder .adder-text {\n display: none; }\n .cwm-breakpoint-adder:hover .adder-text {\n display: block; }\n .cwm-breakpoint-adder:hover .plus-sign {\n display: none; }\n\n.cwm-resizing .cwm-breakpoint-adder {\n display: none; }\n\n.cwm-queries, .cwm-breakpoints {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%; }\n\n.cwm-breakpoints {\n height: 0; }\n\n.cwm-breakpoint {\n position: absolute;\n height: 24px;\n width: 10px;\n cursor: pointer;\n transform: translateX(-50%); }\n .cwm-breakpoint:before {\n content: '';\n position: absolute;\n left: 50%;\n height: 100%;\n width: 1px;\n background: #7cb342; }\n\n.cwm-query {\n position: absolute;\n height: 30%;\n line-height: 24px;\n color: #444;\n cursor: pointer;\n display: none; }\n .cwm-query.enabled {\n color: #fff;\n display: block; }\n\n.cwm-bar.expanded .cwm-queries {\n height: 250px;\n background: #fff;\n box-shadow: 0 0 100px 50px #000; }\n\n.cwm-bar.expanded .cwm-query {\n display: block;\n height: 24px;\n border-radius: 3px; }\n .cwm-bar.expanded .cwm-query:not(.active) .cwm-query-enabler {\n display: block; }\n\n.cwm-bar.expanded .cwm-query-details {\n display: block; }\n\n.cwm-bar-toggler {\n position: absolute;\n right: 0;\n background: #7cb342;\n cursor: pointer; }\n .cwm-bar-toggler .dashicons {\n line-height: 24px;\n height: 24px;\n width: 24px;\n transform: rotateZ(90deg); }\n\n.cwm-query-enabler {\n position: absolute;\n font-size: 14px;\n line-height: 24px;\n height: 24px;\n padding: 0 6px;\n width: max-content;\n background: rgba(0, 0, 0, 0.1);\n border-radius: 3px;\n display: none; }\n .cwm-query-enabler:hover {\n background: rgba(0, 0, 0, 0.2); }\n\n.cwm-query-details {\n font-size: 12px;\n white-space: nowrap;\n padding-left: 34px;\n display: none; }\n .cwm-query-details:hover {\n background: #7cb342;\n color: #fff; }\n\n.cwm-query.active {\n height: 24px; }\n .cwm-query.active .cwm-query-details {\n display: block;\n padding-left: 8px; }\n\n.cwm-context-bg {\n position: fixed;\n left: 0;\n top: 0;\n height: 100%;\n width: 100%; }\n\n.cwm-context-menu {\n position: fixed;\n padding: 4px 0 5px;\n background: rgba(239, 239, 239, 0.95);\n box-shadow: 0 4px 9px rgba(0, 0, 0, 0.34);\n border-radius: 4px;\n color: #000; }\n\n.cwm-context-item {\n padding: 1px 20px;\n cursor: default; }\n .cwm-context-item:hover {\n background: #4195fa;\n color: #fff; }\n"))}function Z(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"disable";if(null===(V=document.getElementById("color-wings-media"))){(V=document.createElement("div")).id="color-wings-media";var t=document.getElementById("customize-preview");t.appendChild(V),ReactDOM.render(React.createElement(Q,null),V)}"enable"===e?(H="open","desktop"!==U&&document.documentElement.classList.add("cwm-enabled")):(H="close",document.documentElement.classList.remove("cwm-enabled"))}function G(e){U=e,"desktop"!==e&&"open"===H?(document.documentElement.classList.add("cwm-enabled"),N.innerHTML="",setTimeout((function(){var e=document.getElementById("customize-preview");M.innerHTML="".concat(e.clientWidth,"px"),F(e.clientWidth)}),500)):(D(""),document.documentElement.classList.remove("cwm-enabled"))}var X=L.get(),Y=X.currentTheme,J=X.currentPage,ee=function(e){return e===Object(e)},te=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"toggle",t=L.get(),n=t.mounted;n&&!0!==e?(cw.Evt.emit("unmount-colorwings"),Z("disable"),L.setMounted(!1)):(cw.Evt.emit("mount-colorwings"),Z("enable"),L.setMounted(!0))},ne=function(){var e,t=L.get(),n=t.currentPage,r=t.currentPageType,o=t.allFonts,a=q.get().allOutputs[n];e=ee(K.setting._value)?JSON.parse(JSON.stringify(K.setting._value)):i({},Y,{}),Y in e||(e[Y]={}),e[Y][n]={type:r,styles:a,fonts:o[n]},cw.Evt.emit("update-control",e)},re=function(){var e=L.get().currentPage;if(e!==J){if(ee(K.setting._value)&&Y in K.setting._value&&e in K.setting._value[Y]){var t=K.setting._value[Y][e].styles;q.addFromString(t)}else q.addFromString("");ne(),J=e}},oe=j((function(e,t){if(!1===t)K.notifications.remove(e);else{var n=new wp.customize.Notification(e,{message:t});K.notifications.add(e,n)}}),1e3);q.subscribe(ne),L.subscribe(re),cw.Evt.on("colorwings-will-mount",(function(e){if((K=e).setting._value&&Y in K.setting._value){var t,n=K.setting._value[Y];if("global"in n)t=n.global;else{var r=Object.keys(n);r.length>0&&(t=n[r[0]],L.changePage(r[0],t.type))}L.addInitialSettings(n),q.addInitialStyle(t.styles,n)}})),cw.Evt.on("preview-object-ready",(function(e){L.addPreviewObject(e)})),cw.Evt.on("toggle-notice",(function(e,t){oe(e,t)}));var ae=window.cw.Evt;ae.on("focusLocked",(function(e){var t=e.currentSelector,n=e.currentTarget,r=window.getComputedStyle(n);L.set((function(){return{currentSelector:t,currentStyles:r}}))})),ae.on("focusUnlocked",(function(){L.set((function(){return{currentSelector:""}}))}));function ie(e){var t=["radius","padding","margin"].includes(e.subType),n={px:{step:1,min:0,max:2e3},pc:{step:.1,min:0,max:200},cm:{step:.1,min:0,max:200},mm:{step:1,min:0,max:2e3},rem:{step:.1,min:0,max:200},em:{step:.01,min:0,max:100},ex:{step:.1,min:0,max:200},ch:{step:.1,min:0,max:200},vh:{step:.1,min:0,max:200},vw:{step:.1,min:0,max:200},in:{step:.01,min:0,max:100},"%":{step:.1,min:0,max:200},"":{step:.1,min:0,max:1}},r=function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n="";!1!==t?n=t:(n=e.val,"values"in e&&(n=e.values[e.tab]));var r=n.match(/^([+-]?(?:\d+|\d*\.\d+))([a-z]*|%)$/);return[null===r?"":r[1],null===r?"px":r[2]]},o=g(r(),2),a=o[0],i=o[1],c=g(React.useState({main:a,unit:i,step:n[i].step,min:n[i].min,max:n[i].max}),2),l=c[0],u=c[1],p=g(React.useState([]),2),d=p[0],f=p[1];React.useEffect((function(){f(r())}),[]),React.useEffect((function(){var e=g(r(),2),t=e[0],n=e[1];u((function(e){return s({},e,{main:t,unit:n})}))}),[e.val]);var h=function(t){e.handleChange(e.tab,t)},m=function(e){e.persist(),u((function(t){return h("".concat(e.target.value).concat(t.unit)),s({},t,{main:e.target.value})}))};return React.createElement("div",{className:"tab-content "+(t?"shorthand":"")+(e.hidden?" hidden":"")},React.createElement("div",{className:"cw-row"},React.createElement("div",{className:"col-".concat("unitLess"===e.subType?"9":"7"," range-wrap")},React.createElement("input",{type:"range",step:l.step,min:l.min,max:l.max,value:l.main,onChange:m})),React.createElement("div",{className:"col-3"},React.createElement("input",{type:"number",step:l.step,min:l.min,max:l.max,value:l.main,onChange:m})),"unitLess"!==e.subType&&React.createElement("select",{className:"col-2 length-unit",onChange:function(e){e.persist();var t=e.target.value;u((function(e){return h("".concat(e.main).concat(t)),s({},e,{unit:t,step:n[t].step,min:n[t].min,max:n[t].max})}))},value:l.unit},Object.keys(n).map((function(e){return React.createElement("option",{key:e,value:e},e)}))),React.createElement("span",{className:"reset",onClick:function(){u((function(e){var t=g(d,2),n=t[0],r=t[1];return h("".concat(n).concat(r)),s({},e,{main:n,unit:r})}))}},React.createElement("svg",{width:"15px",height:"14.7px",viewBox:"0 0 50 49",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},React.createElement("path",{d:"M0,20 L14,0 C14,6 14,9 14,9 C40,-3 65,30 38,49 C58,27 36,7 18,17 C18,17 20,19 24,23 L0,20 Z",fill:"#7CB342"})))))}function ce(e){var t,n,r=e.subType,o=e.tab;return"radius"===r?(t=React.createElement("rect",{stroke:"#999",fill:"none",x:"1",y:"1",width:"14",height:"14",rx:"3"}),n=React.createElement("rect",{stroke:"#7CB342",strokeWidth:"2",fill:"none",x:"1",y:"1",width:"14",height:"14",rx:"4"}),1===o?n=React.createElement("path",{d:"M8,0 L8,2 L5,2 C3.34,2 2,3.34 2,5 L2,8 L0,8 L0,5 C0,2.24 2.24,0 5,0 L8,0 Z",fill:"#7CB342"}):2===o?n=React.createElement("path",{d:"M8,0 L11,0 C13.76,0 16,2.24 16,5 L16,8 L14,8 L14,5 C14,3.34 12.66,2 11,2 L8,2 L8,0 Z",fill:"#7CB342"}):3===o?n=React.createElement("path",{d:"M16,8 L16,11 C16,13.76 13.76,16 11,16 L8,16 L8,14 L11,14 C12.66,14 14,12.66 14,11 L14,8 L16,8 Z",fill:"#7CB342"}):4===o&&(n=React.createElement("path",{d:"M8,16 L5,16 C2.24,16 0,13.76 0,11 L0,8 L2,8 L2,11 C2,12.66 3.34,14 5,14 L8,14 L8,16 Z",fill:"#7CB342"}))):"padding"===r?(t=React.createElement("rect",{stroke:"#000",strokeWidth:".6",fill:"none",x:"1",y:"1",width:"14",height:"14",rx:"1"}),n=React.createElement("rect",{stroke:"#7CB342",strokeWidth:"4",fill:"none",x:"3",y:"3",width:"10",height:"10",rx:"0",opacity:".6"}),1===o?n=React.createElement("rect",{fill:"#7CB342",x:"1",y:"1",width:"14",height:"5",opacity:".6"}):2===o?n=React.createElement("rect",{fill:"#7CB342",x:"10",y:"1",width:"5",height:"14",opacity:".6"}):3===o?n=React.createElement("rect",{fill:"#7CB342",x:"1",y:"10",width:"14",height:"5",opacity:".6"}):4===o&&(n=React.createElement("rect",{fill:"#7CB342",x:"1",y:"1",width:"5",height:"14",opacity:".6"}))):"margin"===r?(t=React.createElement("rect",{stroke:"#000",strokeWidth:".6",fill:"none",x:"2.5",y:"2.5",width:"11",height:"11",rx:"1"}),n=React.createElement("rect",{stroke:"#F9CDA0",strokeWidth:"2.5",fill:"none",x:"1",y:"1",width:"14",height:"14",rx:"1"}),1===o?(t=React.createElement("rect",{stroke:"#000",strokeWidth:".6",fill:"none",x:"1",y:"5.5",width:"14",height:"9.5",rx:"1"}),n=React.createElement("rect",{fill:"#F9CDA0",x:"1",y:"0",width:"14",height:"5"})):2===o?(t=React.createElement("rect",{stroke:"#000",strokeWidth:".6",fill:"none",x:"1",y:"1",width:"9.5",height:"14",rx:"1"}),n=React.createElement("rect",{fill:"#F9CDA0",x:"11",y:"1",width:"5",height:"14"})):3===o?(t=React.createElement("rect",{stroke:"#000",strokeWidth:".6",fill:"none",x:"1",y:"1",width:"14",height:"9.5",rx:"1"}),n=React.createElement("rect",{fill:"#F9CDA0",x:"1",y:"11",width:"14",height:"5"})):4===o&&(t=React.createElement("rect",{stroke:"#000",strokeWidth:".6",fill:"none",x:"5.5",y:"1",width:"9.5",height:"14",rx:"1"}),n=React.createElement("rect",{fill:"#F9CDA0",x:"0",y:"1",width:"5",height:"14"}))):"border"===r&&(t=React.createElement("rect",{stroke:"#000",strokeWidth:".6",fill:"none",x:"1",y:"1",width:"14",height:"14",rx:"1"}),n=React.createElement("rect",{stroke:"#000",strokeWidth:"2",fill:"none",x:"1",y:"1",width:"14",height:"14",rx:"1"}),1===o?n=React.createElement("rect",{fill:"#000",x:"1",y:"1",width:"14",height:"2"}):2===o?n=React.createElement("rect",{fill:"#000",x:"13",y:"1",width:"2",height:"14"}):3===o?n=React.createElement("rect",{fill:"#000",x:"1",y:"13",width:"14",height:"2"}):4===o&&(n=React.createElement("rect",{fill:"#000",x:"1",y:"1",width:"2",height:"14"}))),React.createElement("svg",{width:"16px",height:"16px",viewBox:"0 0 16 16",style:{pointerEvents:"bounding-box"}},t,n)}function le(e){var t=e.subType,n=e.val,r=e.onChange,o=["radius","padding","margin"].includes(t),a=n,i=a.split(" "),l=[a,a,a,a,a];4===i.length?l=["0px",i[0],i[1],i[2],i[3]]:3===i.length?l=["0px",i[0],i[1],i[2],i[1]]:2===i.length&&(l=["0px",i[0],i[1],i[0],i[1]]);var u,p=g(React.useState({tab:0,values:l,currentVal:n}),2),d=p[0],f=p[1],h=function(e,t){var n=d.values;n[e]=t;var o=t;0!==e&&void 0!==e&&(o="".concat(n[1]," ").concat(n[2]," ").concat(n[3]," ").concat(n[4])),f((function(e){return s({},e,{currentVal:o,values:n})})),r(o)},m=o&&React.createElement("div",{className:"cw-tabs"},[0,1,2,3,4].map((function(e){return React.createElement("div",{key:e,className:"tab tab-".concat(e," ").concat(0===e?"active":""),onClick:function(t){return function(e,t){e.currentTarget.parentNode.childNodes.forEach((function(e){return e.classList.remove("active")})),e.currentTarget.classList.add("active"),f((function(e){return s({},e,{tab:t})}))}(t,e)}},React.createElement(ce,{tab:e,subType:t}))})));u=o?[0,1,2,3,4].map((function(t){return React.createElement(ie,c({},e,{values:l,key:t,tab:t,hidden:t!==d.tab,handleChange:h}))})):React.createElement(ie,c({},e,{handleChange:h}));var v=o&&React.createElement("div",{className:"output"},"Output: ",d.currentVal);return React.createElement("div",{className:"cw-control-content cw-length "+(o?"shorthand":"single-length")},e.label&&React.createElement("span",{className:"cw-control-title"},e.label),e.description&&React.createElement("span",{className:"description customize-control-description"},e.description),m,u,v)}function se(e){var t=function(e){var t=e.toString(16);return 1===t.length?"0".concat(t):t};var n=function(e){if(-1!==e.indexOf("rgb(")){var n=g(e.substring(4,e.length-1).replace(/ /g,"").split(","),3),r=n[0],o=n[1],a=n[2];return"#"+t(parseInt(r,10))+t(parseInt(o,10))+t(parseInt(a,10))}if(-1!==e.indexOf("rgba(")){var i=g(e.substring(5,e.length-1).replace(/ /g,"").split(","),4),c=i[0],l=i[1],s=i[2];if("0"===i[3])return"#"+t(parseInt(c,10))+t(parseInt(l,10))+t(parseInt(s,10))}return e.replace(/ /g,"")}(e.val),r={change:function(t,r){var o=r.color.toString();o!==n&&e.onChange(o)},clear:function(){e.onChange("")}},o=React.createRef();return(0,g(P((function(){return null!==o.current})),1)[0])((function(){_(o.current).wpColorPicker(r),_(o.current).iris("color",n),function(e){var t=e.parentNode.parentNode.parentNode;if(!t.classList.contains("fixed")){var n=t.getBoundingClientRect().left,r=t.querySelector(".wp-picker-holder");r.style.left="-".concat(n-12,"px"),r.style.position="absolute",t.classList.add("fixed"),setTimeout((function(){r.style.left="-".concat(t.getBoundingClientRect().left-12,"px")}),1e3)}}(o.current)})),React.createElement("div",{className:"cw-control-content cw-color"},e.label&&React.createElement("span",{className:"cw-control-title"},e.label),React.createElement("input",{type:"text",ref:o,"data-alpha":"true",defaultValue:n}))}function ue(e,t){const{key:n,options:r}=t,o=r.length-1;let a="ArrowDown"===n?e+1:e-1;a<0?a=o:a>o&&(a=0);const i=r[a];return i&&i.disabled?ue(a,{key:n,options:r}):a}function pe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function de(e){for(var t=1;t{if("groupId"in e){const r=function(e){for(var t=1;t"groupId"in e&&e.groupId===r.groupId);r.index=n,o>-1?t[o].items.push(r):t.push({items:[r],groupId:e.groupId,type:"group",name:e.groupName})}else t.push(e)}),t}function ve(e,t){return Array.isArray(e)?e.map(e=>t.find(t=>t.value===e)):t.find(t=>t.value===e)||null}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function be(e,t){return e(t={exports:{}},t.exports),t.exports}var ye=be((function(e,t){ +!function(e,t){"use strict";var n="default"in e?e.default:e;function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n-1&&this.events[e].splice(n,1)}}},{key:"emit",value:function(e){for(var t=this,n=arguments.length,a=new Array(n>1?n-1:0),o=1;o2&&void 0!==arguments[2]&&arguments[2],r=null;return function(){var a=arguments,o=this,i=n&&!r,c=function(){return e.apply(o,a)};clearTimeout(r),r=setTimeout(c,t),i&&c()}}function N(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:100,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1e4,a=function(e){t=e},o=function(){},i=r/n,c=setInterval((function(){i--,("function"==typeof e&&!0===e()||!0===e&&"function"==typeof t)&&(t(),clearInterval(c)),i<=0&&clearInterval(c)}),n);return[a,o]}var P,z,T,M={mounted:!0,currentTheme:cwControlObject.theme,currentPage:"global",currentPageType:"global",currentSelector:"",currentPseudo:"",openSection:!1,currentStyles:{},previewObject:{},allFonts:{},quickSelectors:[],selectorClass:""},L=new(function(e){p(n,e);var t=m(n);function n(){return a(this,n),t.apply(this,arguments)}return i(n,[{key:"setMounted",value:function(e){this.set((function(){return{mounted:e}}))}},{key:"toggleSection",value:function(e){this.set((function(t){return t.openSection===e?{openSection:!1}:{openSection:e}}))}},{key:"addInitialSettings",value:function(e){if(e){var t={};for(var n in e)e.hasOwnProperty(n)&&"fonts"in e[n]&&(t[n]=e[n].fonts);this.set((function(){return{allFonts:t}}))}}},{key:"changePage",value:function(e,t){this.set((function(){return{currentPage:e,currentPageType:t}}))}},{key:"addPreviewObject",value:function(e){this.set((function(){return{previewObject:e}}))}},{key:"addFont",value:function(e){this.set((function(t){var n=t.currentPage,r=t.allFonts;n in r||(r[n]={});var a=e.source,o=e.family,i="normal"===e.style?"":"i",l="".concat(e.weight).concat(i);return a in r[n]?o in r[n][a]?r[n][a][o].includes(l)||r[n][a][o].push(l):r[n][a][o]=[l]:r[n][a]=c({},o,[l]),{allFonts:r}}))}},{key:"setQuickSelectors",value:function(e){this.set((function(){return{quickSelectors:e}}))}},{key:"togglePseudo",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";this.set((function(){return{currentPseudo:e}}))}},{key:"setSelectorClass",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";this.set((function(){return{selectorClass:e}}))}}]),n}(E))(M),A=new(function(e){p(n,e);var t=m(n);function n(){return a(this,n),t.apply(this,arguments)}return i(n,[{key:"setInitialMediaQueries",value:function(e){var t={},n=[];e.forEach((function(e){if("all"!==e){var r=e.match(/\d*(min-width):\s*(\d+\s?)(px)/),a=e.match(/\d*(max-width):\s*(\d+\s?)(px)/);if(null!==r||null!==a){var o=0,i=5e3;null!==r&&(o=Number(r[2]),-1===n.indexOf(o)&&n.push(o)),null!==a&&(i=Number(a[2]),-1===n.indexOf(i)&&n.push(i)),t["".concat(o,"-").concat(i)]={min:o,max:i,enabled:!0}}}})),this.set((function(){return{queries:t,breakpoints:n}}))}},{key:"addBreakpoint",value:function(){this.set((function(e){var t=e.breakpoints,n=e.currentPreviewWidth;return-1===t.indexOf(n)&&t.push(n),t.sort((function(e,t){return e-t})),{breakpoints:t,queries:function(e){for(var t=[0].concat(v(e),[5e3]),n={},r=0;r1&&void 0!==arguments[1]&&arguments[1];this.set((function(n){var r=n.queries;return r[e].enabled=t||!r[e].enabled,{queries:r}}))}},{key:"activateQuery",value:function(e){this.set((function(t){return{currentMedia:{key:e,query:(n=t.queries[e],"".concat(0!==n.min?"(min-width: "+n.min+"px)":"").concat(0!==n.min&&5e3!==n.max?" and ":"").concat(5e3!==n.max?"(max-width: "+n.max+"px)":""))}};var n})),this.toggleEnabled(e,!0)}},{key:"deActivateQuery",value:function(){this.set((function(){return{currentMedia:{key:"",query:"all"}}}))}},{key:"removeBreakpoint",value:function(e){this.set((function(t){var n=t.breakpoints.filter((function(t){return t!==e}));return{queries:Object.filter(t.queries,(function(t){var n=g(t,2),r=(n[0],n[1]);return r.min!==e&&r.max!==e})),breakpoints:n}}))}}]),n}(E))({currentPreviewWidth:0,breakpoints:[],queries:{},currentMedia:{key:"",query:"all"}}),q=new(function(e){p(n,e);var t=m(n);function n(){return a(this,n),t.apply(this,arguments)}return i(n,[{key:"addInitialStyle",value:function(e,t){var n={};for(var r in t)t.hasOwnProperty(r)&&(n[r]=t[r].styles);var a=this.parseStyles(e);this.overrideInitialState({styles:a,allOutputs:n}),A.setInitialMediaQueries(Object.keys(a))}},{key:"generateOutput",value:function(e){var t="";for(var n in e)if(e.hasOwnProperty(n)){for(var r in"all"!==n&&(t+="@media ".concat(n,"{")),e[n])if(e[n].hasOwnProperty(r)){for(var a in t+=r+"{",e[n][r])e[n][r].hasOwnProperty(a)&&(t+="".concat(a,":").concat(e[n][r][a],";"));t+="}"}"all"!==n&&(t+="}")}return t}},{key:"registerSpecialSubscriber",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"tempStyler";"tempStyler"===t?this.tempStyler=e:"fontManager"===t&&(this.addFont=e),this.debouncedSetStyles=j(this.setStyles,500)}},{key:"addStyle",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"all";this.tempStyler("".concat(e," { ").concat(t,": ").concat(n,"; }")),this.debouncedSetStyles(e,t,n,r)}},{key:"addStyleNow",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"all";this.tempStyler("".concat(e," { ").concat(t,": ").concat(n,"; }")),this.setStyles(e,t,n,r)}},{key:"setStyles",value:function(e,t,n){var r=this,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"all";a=A.get().currentMedia.query,this.set((function(o){var i=L.get().currentPseudo;e=""!==i?"".concat(e,":").concat(i):e;var c=o.styles;c.hasOwnProperty(a)||(c[a]={}),c[a].hasOwnProperty(e)||(c[a][e]={}),c[a][e][t]=n;var l=L.get().currentPage;return o.allOutputs[l]=r.generateOutput(c),{styles:c,allOutputs:o.allOutputs}}))}},{key:"parseStyles",value:function(e){try{return function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"all",r={};return r[n]={},t.forEach((function(t){if("rule"===t.type){var a={};t.declarations.forEach((function(e){a[e.property]=e.value})),r[n][t.selectors.join(", ")]=a}else"media"===t.type&&(r[t.media]=e(t.rules,t.media)[t.media])})),r}(C(e).stylesheet.rules)}catch(e){return e}}},{key:"addFromString",value:function(e){var t=this.parseStyles(e);if(t instanceof Error){var n=t;return cw.Evt.emit("toggle-notice","invalid","Invalid CSS: ".concat(n.reason," at ").concat(n.line,":").concat(n.column)),!1}cw.Evt.emit("toggle-notice","invalid",!1),this.set((function(n){var r=L.get().currentPage;return n.allOutputs[r]=e,{styles:t,allOutputs:n.allOutputs}}))}},{key:"removeMediaStyles",value:function(e){var t=this;this.set((function(n){var r=n.styles;return e.forEach((function(e){delete r[e]})),n.allOutputs[L.get().currentPage]=t.generateOutput(r),{styles:r,allOutputs:n.allOutputs}}))}}]),n}(E))({styles:{all:{}},allOutputs:{}});function I(e){P.innerHTML=".cwm-resizer{left:".concat(e,"px;}.cwm-enabled #customize-preview{width:").concat(e,"px;}"),T.innerHTML="".concat(e,"px")}function F(e){z.innerHTML=".cwm-bar .cwm-breakpoint-adder{left:".concat(e,"px;}"),A.updatePreviewWidth(e)}function D(e){e===A.get().currentMedia.key||""===e?A.deActivateQuery():A.activateQuery(e)}function B(e){var t=e.left,n=g(React.useState({show:!1,x:0,y:0}),2),r=n[0],a=n[1],o=function(){return a({show:!1})};return React.createElement(React.Fragment,null,r.show&&React.createElement("div",{className:"cwm-breakpoint-context"},React.createElement("div",{className:"cwm-context-bg",onClick:o}),React.createElement("div",{className:"cwm-context-menu",style:{left:r.x+2,top:r.y}},React.createElement("div",{className:"cwm-context-item",onClick:function(){var e=!0,n=function(e){var t=q.get().styles,n=[],r="";for(var a in t)t.hasOwnProperty(a)&&a.includes(e)&&(n.push(a),r+="\n".concat(a));return{queries:n,queriesString:r}}(t),r=n.queries,a=n.queriesString;""!==a&&(e=window.confirm("This will also remove all styles for following media queries:\n".concat(a,"\n\nAre you sure you want to remove?"))),e&&(A.removeBreakpoint(t),q.removeMediaStyles(r)),o()}},"Remove Breakpoint"))),React.createElement("div",{className:"cwm-breakpoint",style:{left:"".concat(t,"px")},onContextMenu:function(e){e.preventDefault(),a({show:!0,x:e.clientX,y:e.clientY})}}))}function W(){var e=g(React.useState(!1),2),t=e[0],n=e[1],r=O(A),a=r.queries,o=r.breakpoints,i=r.currentPreviewWidth,c=r.currentMedia,l=["rgba(229, 57, 53, .2)","rgb(142, 36, 170, .2)","rgb(57, 73, 171, .2)","rgb(3, 155, 229, .2)","rgb(0, 137, 123, .2)","rgb(124, 179, 66, .2)","rgb(253, 216, 53, .2)","rgb(251, 140, 0, .2)","rgb(109, 76, 65, .2)","rgb(84, 110, 122, .2)"],s=["rgba(229, 57, 53, .8)","rgb(142, 36, 170, .8)","rgb(57, 73, 171, .8)","rgb(3, 155, 229, .8)","rgb(0, 137, 123, .8)","rgb(124, 179, 66, .8)","rgb(253, 216, 53, .8)","rgb(251, 140, 0, .8)","rgb(109, 76, 65, .8)","rgb(84, 110, 122, .8)"];return React.createElement("div",{className:"cwm-bar".concat(t?" expanded":"")},React.createElement("div",{className:"cwm-queries"},Object.entries(a).map((function(e,n){var r=g(e,2),a=r[0],o=r[1],i="".concat(t?n%10*25:n%10*2,"px"),u=c.key===a;return u&&!t&&(i=0),React.createElement("div",{key:a,onClick:function(){return D(a)},className:"cwm-query".concat(o.enabled?" enabled":"").concat(u?" active":""),style:{left:"".concat(o.min+1,"px"),width:"".concat(o.max-o.min-2,"px"),background:o.enabled?s[n%9]:l[n%9],top:i}},React.createElement("span",{className:"cwm-query-enabler dashicons ".concat(o.enabled?"dashicons-visibility":"dashicons-hidden"),onClick:function(e){return function(e,t){e.stopPropagation(),A.toggleEnabled(t)}(e,a)}}),React.createElement("div",{className:"cwm-query-details"},0!==o.min?"(min: ".concat(o.min,"px)"):""," ",0!==o.min&&5e3!==o.max?"&":""," ",5e3!==o.max?"(max: ".concat(o.max,"px)"):""))}))),React.createElement("div",{className:"cwm-breakpoints"},o.map((function(e){return React.createElement(B,{key:e,left:e})}))),-1===o.indexOf(i)&&React.createElement("div",{className:"cwm-breakpoint-adder",onClick:function(){A.addBreakpoint()}},React.createElement("span",{className:"plus-sign"},"+"),React.createElement("span",{className:"adder-text"},"Add Breakpoint")),React.createElement("div",{className:"cwm-bar-toggler",onClick:function(){n((function(e){return!e}))}},React.createElement("span",{className:"dashicons dashicons-leftright"})))}function H(e){var t=React.createRef(),n=0,r=0,a=function(t){t.preventDefault();var a=Math.floor(t.clientX-n);a<1||(r=a,e.onResize&&e.onResize(r))},o=function t(){document.removeEventListener("mousemove",a),document.removeEventListener("mouseup",t),document.removeEventListener("touchcancel",t),document.removeEventListener("touchend",t),e.onEnd&&e.onEnd(r),document.body.classList.remove("cwm-resizing")};function i(e){e.preventDefault(),document.body.classList.add("cwm-resizing"),n=t.current.parentNode.getBoundingClientRect().left,document.addEventListener("mousemove",a),document.addEventListener("mouseup",o),document.addEventListener("touchcancel",o),document.addEventListener("touchend",o)}return React.createElement("div",{className:"cwm-resizer",ref:t,onMouseDown:i,onTouchStart:i,onMouseUp:o,onTouchCancel:o,onTouchEnd:o},React.createElement("div",{className:"cwm-resizer-tip"},React.createElement("div",{className:"cwm-indicator"}),React.createElement("div",{id:"cwm-resizer-details"})))}window.cw={Evt:w,StylesStore:q,MainStore:L},Object.filter=function(e,t){return Object.fromEntries(Object.entries(e).filter(t))},cw.Evt.on("cw-media-loaded",(function(){(P=document.createElement("style")).id="cwm-special-styles",(z=document.createElement("style")).id="cwm-bar-styles",document.getElementById("color-wings-media").append(P,z),T=document.getElementById("cwm-resizer-details")}));var V,$,U,K;function Q(){return React.useEffect((function(){cw.Evt.emit("cw-media-loaded")}),[]),React.createElement(React.Fragment,null,React.createElement(W,null),React.createElement(H,{onResize:I,onEnd:F}),React.createElement("style",{type:"text/css"},"#color-wings-media {\n display: none;\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n height: 100%; }\n #color-wings-media * {\n box-sizing: border-box; }\n\n.cwm-enabled #color-wings-media {\n display: block; }\n\n.cwm-enabled #customize-preview {\n height: calc( 100% - 24px);\n top: 24px;\n left: 0;\n margin: auto 0 auto 1px; }\n .cwm-enabled #customize-preview iframe {\n z-index: 2; }\n\n.cwm-bar {\n position: fixed;\n top: 0;\n left: 301px;\n right: 0;\n height: 24px;\n background: #444;\n color: #eee;\n border-bottom: 1px solid #555;\n z-index: 5; }\n\n@media screen and (min-width: 1667px) {\n .cwm-bar {\n left: calc( 18% + 1px); } }\n\n.collapsed .cwm-bar {\n left: 1px !important; }\n\n.cwm-resizer {\n position: absolute;\n left: 100%;\n height: 100%;\n width: 14px;\n background: #666;\n cursor: ew-resize;\n z-index: 3; }\n .cwm-resizer:before {\n content: '';\n width: 2px;\n height: 26px;\n top: 50%;\n position: absolute;\n left: 50%;\n transform: translate(-50%, -50%);\n border-right: 2px solid #888;\n border-left: 2px solid #888; }\n\n.cwm-resizing #color-wings-media {\n z-index: 3; }\n\n.cwm-resizing #customize-preview {\n transition: none !important; }\n\n.cwm-resizer-tip {\n position: absolute;\n top: 0;\n left: 0; }\n\n.cwm-indicator {\n position: absolute;\n bottom: 0;\n left: 0;\n height: 26px;\n width: 0;\n border-top: 1px solid #eee;\n border-right: 1px solid transparent;\n border-bottom: 1px solid transparent;\n border-left: 1px solid #69e000; }\n\n#cwm-resizer-details {\n position: absolute;\n top: 2px;\n color: #fff;\n left: 16px;\n background: #444444;\n padding: 0 10px; }\n\n.cwm-breakpoint-adder {\n position: absolute;\n background: #eee;\n border: 1px solid #666;\n color: #000;\n left: 0;\n top: 0;\n padding: 0 5px 0 5px;\n border-radius: 0 0 3px 0;\n max-height: 18px;\n white-space: nowrap;\n cursor: pointer;\n z-index: 5;\n border-top-width: 0;\n line-height: 16px; }\n .cwm-breakpoint-adder:before, .cwm-breakpoint-adder:after {\n content: '';\n display: block;\n position: absolute;\n left: 0;\n top: 100%;\n width: 0;\n height: 0;\n border-top: 6px solid #eee;\n border-right: 8px solid transparent;\n border-bottom: 0 solid transparent;\n border-left: 0 solid transparent; }\n .cwm-breakpoint-adder:before {\n left: -1px;\n border-top: 8px solid #666;\n border-right: 11px solid transparent;\n border-bottom: 0 solid transparent;\n border-left: 0 solid transparent; }\n .cwm-breakpoint-adder .plus-sign {\n font-size: 18px; }\n .cwm-breakpoint-adder .adder-text {\n display: none; }\n .cwm-breakpoint-adder:hover .adder-text {\n display: block; }\n .cwm-breakpoint-adder:hover .plus-sign {\n display: none; }\n\n.cwm-resizing .cwm-breakpoint-adder {\n display: none; }\n\n.cwm-queries, .cwm-breakpoints {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%; }\n\n.cwm-breakpoints {\n height: 0; }\n\n.cwm-breakpoint {\n position: absolute;\n height: 24px;\n width: 10px;\n cursor: pointer;\n transform: translateX(-50%); }\n .cwm-breakpoint:before {\n content: '';\n position: absolute;\n left: 50%;\n height: 100%;\n width: 1px;\n background: #7cb342; }\n\n.cwm-query {\n position: absolute;\n height: 30%;\n line-height: 24px;\n color: #444;\n cursor: pointer;\n display: none; }\n .cwm-query.enabled {\n color: #fff;\n display: block; }\n\n.cwm-bar.expanded .cwm-queries {\n height: 250px;\n background: #fff;\n box-shadow: 0 0 100px 50px #000; }\n\n.cwm-bar.expanded .cwm-query {\n display: block;\n height: 24px;\n border-radius: 3px; }\n .cwm-bar.expanded .cwm-query:not(.active) .cwm-query-enabler {\n display: block; }\n\n.cwm-bar.expanded .cwm-query-details {\n display: block; }\n\n.cwm-bar-toggler {\n position: absolute;\n right: 0;\n background: #7cb342;\n cursor: pointer; }\n .cwm-bar-toggler .dashicons {\n line-height: 24px;\n height: 24px;\n width: 24px;\n transform: rotateZ(90deg); }\n\n.cwm-query-enabler {\n position: absolute;\n font-size: 14px;\n line-height: 24px;\n height: 24px;\n padding: 0 6px;\n width: max-content;\n background: rgba(0, 0, 0, 0.1);\n border-radius: 3px;\n display: none; }\n .cwm-query-enabler:hover {\n background: rgba(0, 0, 0, 0.2); }\n\n.cwm-query-details {\n font-size: 12px;\n white-space: nowrap;\n padding-left: 34px;\n display: none; }\n .cwm-query-details:hover {\n background: #7cb342;\n color: #fff; }\n\n.cwm-query.active {\n height: 24px; }\n .cwm-query.active .cwm-query-details {\n display: block;\n padding-left: 8px; }\n\n.cwm-context-bg {\n position: fixed;\n left: 0;\n top: 0;\n height: 100%;\n width: 100%; }\n\n.cwm-context-menu {\n position: fixed;\n padding: 4px 0 5px;\n background: rgba(239, 239, 239, 0.95);\n box-shadow: 0 4px 9px rgba(0, 0, 0, 0.34);\n border-radius: 4px;\n color: #000; }\n\n.cwm-context-item {\n padding: 1px 20px;\n cursor: default; }\n .cwm-context-item:hover {\n background: #4195fa;\n color: #fff; }\n"))}function Z(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"disable";if(null===(V=document.getElementById("color-wings-media"))){(V=document.createElement("div")).id="color-wings-media";var t=document.getElementById("customize-preview");t.appendChild(V),ReactDOM.render(React.createElement(Q,null),V)}"enable"===e?($="open","desktop"!==U&&document.documentElement.classList.add("cwm-enabled")):($="close",document.documentElement.classList.remove("cwm-enabled"))}function G(e){U=e,"desktop"!==e&&"open"===$?(document.documentElement.classList.add("cwm-enabled"),P.innerHTML="",setTimeout((function(){var e=document.getElementById("customize-preview");T.innerHTML="".concat(e.clientWidth,"px"),F(e.clientWidth)}),500)):(D(""),document.documentElement.classList.remove("cwm-enabled"))}var X=L.get(),J=X.currentTheme,Y=X.currentPage,ee=function(e){return e===Object(e)},te=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"toggle",t=L.get(),n=t.mounted;n&&!0!==e?(cw.Evt.emit("unmount-colorwings"),Z("disable"),L.setMounted(!1)):(cw.Evt.emit("mount-colorwings"),Z("enable"),L.setMounted(!0))},ne=function(){var e,t=L.get(),n=t.currentPage,r=t.currentPageType,a=t.allFonts,o=q.get().allOutputs[n];e=ee(K.setting._value)?JSON.parse(JSON.stringify(K.setting._value)):c({},J,{}),J in e||(e[J]={}),e[J][n]={type:r,styles:o,fonts:a[n]},cw.Evt.emit("update-control",e)},re=function(){var e=L.get().currentPage;if(e!==Y){if(ee(K.setting._value)&&J in K.setting._value&&e in K.setting._value[J]){var t=K.setting._value[J][e].styles;q.addFromString(t)}else q.addFromString("");ne(),Y=e}},ae=j((function(e,t){if(!1===t)K.notifications.remove(e);else{var n=new wp.customize.Notification(e,{message:t});K.notifications.add(e,n)}}),1e3);q.subscribe(ne),L.subscribe(re),cw.Evt.on("colorwings-will-mount",(function(e){if((K=e).setting._value&&J in K.setting._value){var t,n=K.setting._value[J];if("global"in n)t=n.global;else{var r=Object.keys(n);r.length>0&&(t=n[r[0]],L.changePage(r[0],t.type))}L.addInitialSettings(n),q.addInitialStyle(t.styles,n)}})),cw.Evt.on("preview-object-ready",(function(e){L.addPreviewObject(e)})),cw.Evt.on("toggle-notice",(function(e,t){ae(e,t)}));var oe=window.cw.Evt;oe.on("focusLocked",(function(e){var t=e.currentSelector,n=e.currentTarget,r=window.getComputedStyle(n);L.set((function(){return{currentSelector:t,currentStyles:r}}))})),oe.on("focusUnlocked",(function(){L.set((function(){return{currentSelector:""}}))}));function ie(e){var t=["radius","padding","margin"].includes(e.subType),n={px:{step:1,min:0,max:2e3},pc:{step:.1,min:0,max:200},cm:{step:.1,min:0,max:200},mm:{step:1,min:0,max:2e3},rem:{step:.1,min:0,max:200},em:{step:.01,min:0,max:100},ex:{step:.1,min:0,max:200},ch:{step:.1,min:0,max:200},vh:{step:.1,min:0,max:200},vw:{step:.1,min:0,max:200},in:{step:.01,min:0,max:100},"%":{step:.1,min:0,max:200},"":{step:.1,min:0,max:1}},r=function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n="";!1!==t?n=t:(n=e.val,"values"in e&&(n=e.values[e.tab]));var r=n.match(/^([+-]?(?:\d+|\d*\.\d+))([a-z]*|%)$/);return[null===r?"":r[1],null===r?"px":r[2]]},a=g(r(),2),o=a[0],i=a[1],c=g(React.useState({main:o,unit:i,step:n[i].step,min:n[i].min,max:n[i].max}),2),l=c[0],s=c[1],p=g(React.useState([]),2),d=p[0],h=p[1];React.useEffect((function(){h(r())}),[]),React.useEffect((function(){var e=g(r(),2),t=e[0],n=e[1];s((function(e){return u(u({},e),{},{main:t,unit:n})}))}),[e.val]);var f=function(t){e.handleChange(e.tab,t)},m=function(e){e.persist(),s((function(t){return f("".concat(e.target.value).concat(t.unit)),u(u({},t),{},{main:e.target.value})}))};return React.createElement("div",{className:"tab-content "+(t?"shorthand":"")+(e.hidden?" hidden":"")},React.createElement("div",{className:"cw-row"},React.createElement("div",{className:"col-".concat("unitLess"===e.subType?"9":"7"," range-wrap")},React.createElement("input",{type:"range",step:l.step,min:l.min,max:l.max,value:l.main,onChange:m})),React.createElement("div",{className:"col-3"},React.createElement("input",{type:"number",step:l.step,min:l.min,max:l.max,value:l.main,onChange:m})),"unitLess"!==e.subType&&React.createElement("select",{className:"col-2 length-unit",onChange:function(e){e.persist();var t=e.target.value;s((function(e){return f("".concat(e.main).concat(t)),u(u({},e),{},{unit:t,step:n[t].step,min:n[t].min,max:n[t].max})}))},value:l.unit},Object.keys(n).map((function(e){return React.createElement("option",{key:e,value:e},e)}))),React.createElement("span",{className:"reset",onClick:function(){s((function(e){var t=g(d,2),n=t[0],r=t[1];return f("".concat(n).concat(r)),u(u({},e),{},{main:n,unit:r})}))}},React.createElement("svg",{width:"15px",height:"14.7px",viewBox:"0 0 50 49",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},React.createElement("path",{d:"M0,20 L14,0 C14,6 14,9 14,9 C40,-3 65,30 38,49 C58,27 36,7 18,17 C18,17 20,19 24,23 L0,20 Z",fill:"#7CB342"})))))}function ce(e){var t,n,r=e.subType,a=e.tab;return"radius"===r?(t=React.createElement("rect",{stroke:"#999",fill:"none",x:"1",y:"1",width:"14",height:"14",rx:"3"}),n=React.createElement("rect",{stroke:"#7CB342",strokeWidth:"2",fill:"none",x:"1",y:"1",width:"14",height:"14",rx:"4"}),1===a?n=React.createElement("path",{d:"M8,0 L8,2 L5,2 C3.34,2 2,3.34 2,5 L2,8 L0,8 L0,5 C0,2.24 2.24,0 5,0 L8,0 Z",fill:"#7CB342"}):2===a?n=React.createElement("path",{d:"M8,0 L11,0 C13.76,0 16,2.24 16,5 L16,8 L14,8 L14,5 C14,3.34 12.66,2 11,2 L8,2 L8,0 Z",fill:"#7CB342"}):3===a?n=React.createElement("path",{d:"M16,8 L16,11 C16,13.76 13.76,16 11,16 L8,16 L8,14 L11,14 C12.66,14 14,12.66 14,11 L14,8 L16,8 Z",fill:"#7CB342"}):4===a&&(n=React.createElement("path",{d:"M8,16 L5,16 C2.24,16 0,13.76 0,11 L0,8 L2,8 L2,11 C2,12.66 3.34,14 5,14 L8,14 L8,16 Z",fill:"#7CB342"}))):"padding"===r?(t=React.createElement("rect",{stroke:"#000",strokeWidth:".6",fill:"none",x:"1",y:"1",width:"14",height:"14",rx:"1"}),n=React.createElement("rect",{stroke:"#7CB342",strokeWidth:"4",fill:"none",x:"3",y:"3",width:"10",height:"10",rx:"0",opacity:".6"}),1===a?n=React.createElement("rect",{fill:"#7CB342",x:"1",y:"1",width:"14",height:"5",opacity:".6"}):2===a?n=React.createElement("rect",{fill:"#7CB342",x:"10",y:"1",width:"5",height:"14",opacity:".6"}):3===a?n=React.createElement("rect",{fill:"#7CB342",x:"1",y:"10",width:"14",height:"5",opacity:".6"}):4===a&&(n=React.createElement("rect",{fill:"#7CB342",x:"1",y:"1",width:"5",height:"14",opacity:".6"}))):"margin"===r?(t=React.createElement("rect",{stroke:"#000",strokeWidth:".6",fill:"none",x:"2.5",y:"2.5",width:"11",height:"11",rx:"1"}),n=React.createElement("rect",{stroke:"#F9CDA0",strokeWidth:"2.5",fill:"none",x:"1",y:"1",width:"14",height:"14",rx:"1"}),1===a?(t=React.createElement("rect",{stroke:"#000",strokeWidth:".6",fill:"none",x:"1",y:"5.5",width:"14",height:"9.5",rx:"1"}),n=React.createElement("rect",{fill:"#F9CDA0",x:"1",y:"0",width:"14",height:"5"})):2===a?(t=React.createElement("rect",{stroke:"#000",strokeWidth:".6",fill:"none",x:"1",y:"1",width:"9.5",height:"14",rx:"1"}),n=React.createElement("rect",{fill:"#F9CDA0",x:"11",y:"1",width:"5",height:"14"})):3===a?(t=React.createElement("rect",{stroke:"#000",strokeWidth:".6",fill:"none",x:"1",y:"1",width:"14",height:"9.5",rx:"1"}),n=React.createElement("rect",{fill:"#F9CDA0",x:"1",y:"11",width:"14",height:"5"})):4===a&&(t=React.createElement("rect",{stroke:"#000",strokeWidth:".6",fill:"none",x:"5.5",y:"1",width:"9.5",height:"14",rx:"1"}),n=React.createElement("rect",{fill:"#F9CDA0",x:"0",y:"1",width:"5",height:"14"}))):"border"===r&&(t=React.createElement("rect",{stroke:"#000",strokeWidth:".6",fill:"none",x:"1",y:"1",width:"14",height:"14",rx:"1"}),n=React.createElement("rect",{stroke:"#000",strokeWidth:"2",fill:"none",x:"1",y:"1",width:"14",height:"14",rx:"1"}),1===a?n=React.createElement("rect",{fill:"#000",x:"1",y:"1",width:"14",height:"2"}):2===a?n=React.createElement("rect",{fill:"#000",x:"13",y:"1",width:"2",height:"14"}):3===a?n=React.createElement("rect",{fill:"#000",x:"1",y:"13",width:"14",height:"2"}):4===a&&(n=React.createElement("rect",{fill:"#000",x:"1",y:"1",width:"2",height:"14"}))),React.createElement("svg",{width:"16px",height:"16px",viewBox:"0 0 16 16",style:{pointerEvents:"bounding-box"}},t,n)}function le(e){var t=e.subType,n=e.val,r=e.onChange,a=["radius","padding","margin"].includes(t),o=n,i=o.split(" "),c=[o,o,o,o,o];4===i.length?c=["0px",i[0],i[1],i[2],i[3]]:3===i.length?c=["0px",i[0],i[1],i[2],i[1]]:2===i.length&&(c=["0px",i[0],i[1],i[0],i[1]]);var s,p=g(React.useState({tab:0,values:c,currentVal:n}),2),d=p[0],h=p[1],f=function(e,t){var n=d.values;n[e]=t;var a=t;0!==e&&void 0!==e&&(a="".concat(n[1]," ").concat(n[2]," ").concat(n[3]," ").concat(n[4])),h((function(e){return u(u({},e),{},{currentVal:a,values:n})})),r(a)},m=a&&React.createElement("div",{className:"cw-tabs"},[0,1,2,3,4].map((function(e){return React.createElement("div",{key:e,className:"tab tab-".concat(e," ").concat(0===e?"active":""),onClick:function(t){return function(e,t){e.currentTarget.parentNode.childNodes.forEach((function(e){return e.classList.remove("active")})),e.currentTarget.classList.add("active"),h((function(e){return u(u({},e),{},{tab:t})}))}(t,e)}},React.createElement(ce,{tab:e,subType:t}))})));s=a?[0,1,2,3,4].map((function(t){return React.createElement(ie,l({},e,{values:c,key:t,tab:t,hidden:t!==d.tab,handleChange:f}))})):React.createElement(ie,l({},e,{handleChange:f}));var v=a&&React.createElement("div",{className:"output"},"Output: ",d.currentVal);return React.createElement("div",{className:"cw-control-content cw-length "+(a?"shorthand":"single-length")},e.label&&React.createElement("span",{className:"cw-control-title"},e.label),e.description&&React.createElement("span",{className:"description customize-control-description"},e.description),m,s,v)}function se(e){var t=function(e){var t=e.toString(16);return 1===t.length?"0".concat(t):t};var n=function(e){if(-1!==e.indexOf("rgb(")){var n=g(e.substring(4,e.length-1).replace(/ /g,"").split(","),3),r=n[0],a=n[1],o=n[2];return"#"+t(parseInt(r,10))+t(parseInt(a,10))+t(parseInt(o,10))}if(-1!==e.indexOf("rgba(")){var i=g(e.substring(5,e.length-1).replace(/ /g,"").split(","),4),c=i[0],l=i[1],s=i[2];if("0"===i[3])return"#"+t(parseInt(c,10))+t(parseInt(l,10))+t(parseInt(s,10))}return e.replace(/ /g,"")}(e.val),r={change:function(t,r){var a=r.color.toString();a!==n&&e.onChange(a)},clear:function(){e.onChange("")}},a=React.createRef();return(0,g(N((function(){return null!==a.current})),1)[0])((function(){S(a.current).wpColorPicker(r),S(a.current).iris("color",n),function(e){var t=e.parentNode.parentNode.parentNode;if(!t.classList.contains("fixed")){var n=t.getBoundingClientRect().left,r=t.querySelector(".wp-picker-holder");r.style.left="-".concat(n-12,"px"),r.style.position="absolute",t.classList.add("fixed"),setTimeout((function(){r.style.left="-".concat(t.getBoundingClientRect().left-12,"px")}),1e3)}}(a.current)})),React.createElement("div",{className:"cw-control-content cw-color"},e.label&&React.createElement("span",{className:"cw-control-title"},e.label),React.createElement("input",{type:"text",ref:a,"data-alpha":"true",defaultValue:n}))}function ue(e,t){const{key:n,options:r}=t,a=r.length-1;let o="ArrowDown"===n?e+1:e-1;o<0?o=a:o>a&&(o=0);const i=r[o];return i&&i.disabled?ue(o,{key:n,options:r}):o}function pe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function de(e){for(var t=1;t{if("groupId"in e){const r=function(e){for(var t=1;t"groupId"in e&&e.groupId===r.groupId);r.index=n,a>-1?t[a].items.push(r):t.push({items:[r],groupId:e.groupId,type:"group",name:e.groupName})}else t.push(e)}),t}function ve(e,t){return Array.isArray(e)?e.map(e=>t.find(t=>t.value===e)):t.find(t=>t.value===e)||null}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var be,ye=function(e,t){return e(t={exports:{}},t.exports),t.exports}((function(e,t){ /*! * Fuse.js v3.6.1 - Lightweight fuzzy-search (http://fusejs.io) * @@ -7,12 +7,4 @@ * * http://www.apache.org/licenses/LICENSE-2.0 */ -e.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t,n){function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var o=n(1),a=n(7),i=a.get,c=(a.deepValue,a.isArray),l=function(){function e(t,n){var r=n.location,o=void 0===r?0:r,a=n.distance,c=void 0===a?100:a,l=n.threshold,s=void 0===l?.6:l,u=n.maxPatternLength,p=void 0===u?32:u,d=n.caseSensitive,f=void 0!==d&&d,h=n.tokenSeparator,m=void 0===h?/ +/g:h,g=n.findAllMatches,v=void 0!==g&&g,b=n.minMatchCharLength,y=void 0===b?1:b,w=n.id,x=void 0===w?null:w,k=n.keys,O=void 0===k?[]:k,E=n.shouldSort,R=void 0===E||E,S=n.getFn,C=void 0===S?i:S,_=n.sortFn,j=void 0===_?function(e,t){return e.score-t.score}:_,P=n.tokenize,N=void 0!==P&&P,z=n.matchAllTokens,M=void 0!==z&&z,T=n.includeMatches,L=void 0!==T&&T,A=n.includeScore,q=void 0!==A&&A,I=n.verbose,F=void 0!==I&&I;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.options={location:o,distance:c,threshold:s,maxPatternLength:p,isCaseSensitive:f,tokenSeparator:m,findAllMatches:v,minMatchCharLength:y,id:x,keys:O,includeMatches:L,includeScore:q,shouldSort:R,getFn:C,sortFn:j,verbose:F,tokenize:N,matchAllTokens:M},this.setCollection(t),this._processKeys(O)}var t;return(t=[{key:"setCollection",value:function(e){return this.list=e,e}},{key:"_processKeys",value:function(e){if(this._keyWeights={},this._keyNames=[],e.length&&"string"==typeof e[0])for(var t=0,n=e.length;t1)throw new Error('"weight" property in key must bein the range of [0, 1)');this._keyWeights[l]=s,o+=s}if(o>1)throw new Error("Total of weights cannot exceed 1")}}},{key:"search",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{limit:!1};this._log('---------\nSearch pattern: "'.concat(e,'"'));var n=this._prepareSearchers(e),r=n.tokenSearchers,o=n.fullSearcher,a=this._search(r,o);return this._computeScore(a),this.options.shouldSort&&this._sort(a),t.limit&&"number"==typeof t.limit&&(a=a.slice(0,t.limit)),this._format(a)}},{key:"_prepareSearchers",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=[];if(this.options.tokenize)for(var n=e.split(this.options.tokenSeparator),r=0,a=n.length;r0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0,n=this.list,r={},o=[];if("string"==typeof n[0]){for(var a=0,i=n.length;a-1&&(j=(j+s)/2),n._log("Score average:",j);var P=!n.options.tokenize||!n.options.matchAllTokens||u>=p.length;if(n._log("\nCheck Matches: ".concat(P)),(l||f.isMatch)&&P){var N={key:r,arrayIndex:t,value:o,score:j};n.options.includeMatches&&(N.matchedIndices=f.matchedIndices);var z=h[i];z?z.output.push(N):(h[i]={item:a,output:[N]},g.push(h[i]))}}else if(c(o))for(var M=0,T=o.length;M0?Number.EPSILON:u.score;l*=Math.pow(f,d)}a.score=l,this._log(a)}}},{key:"_sort",value:function(e){this._log("\n\nSorting...."),e.sort(this.options.sortFn)}},{key:"_format",value:function(e){var t=[];if(this.options.verbose){var n=[];this._log("\n\nOutput:\n\n",JSON.stringify(e,(function(e,t){if("object"===r(t)&&null!==t){if(-1!==n.indexOf(t))return;n.push(t)}return t}),2)),n=null}var o=[];this.options.includeMatches&&o.push((function(e,t){var n=e.output;t.matches=[];for(var r=0,o=n.length;r-1&&(i.arrayIndex=a.arrayIndex),t.matches.push(i)}}})),this.options.includeScore&&o.push((function(e,t){t.score=e.score}));for(var a=0,i=e.length;al)return r(e,this.pattern,s);var u=this.options,p=u.location,d=u.distance,f=u.threshold,h=u.findAllMatches,m=u.minMatchCharLength;return o(e,this.pattern,this.patternAlphabet,{location:p,distance:d,threshold:f,findAllMatches:h,minMatchCharLength:m,includeMatches:a})}}])&&function(e,t){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:/ +/g,o=new RegExp(t.replace(n,"\\$&").replace(r,"|")),a=e.match(o),i=!!a,c=[];if(i)for(var l=0,s=a.length;l=T;q-=1){var I=q-1,F=n[e.charAt(I)];if(F&&(O[I]=1),A[q]=(A[q+1]<<1|1)&F,0!==N&&(A[q]|=(C[q+1]|C[q])<<1|1|C[q+1]),A[q]&P&&(_=r(t,{errors:N,currentLocation:I,expectedLocation:b,distance:s}))<=w){if(w=_,(x=I)<=b)break;T=Math.max(1,2*b-x)}}if(r(t,{errors:N+1,currentLocation:b,expectedLocation:b,distance:s})>w)break;C=A}var D={isMatch:x>=0,score:0===_?.001:_};return v&&(D.matchedIndices=o(O,m)),D}},function(e,t){e.exports=function(e,t){var n=t.errors,r=void 0===n?0:n,o=t.currentLocation,a=void 0===o?0:o,i=t.expectedLocation,c=void 0===i?0:i,l=t.distance,s=void 0===l?100:l,u=r/e.length,p=Math.abs(c-a);return s?u+p/s:p?1:u}},function(e,t){e.exports=function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=[],r=-1,o=-1,a=0,i=e.length;a=t&&n.push([r,o]),r=-1)}return e[a-1]&&a-r>=t&&n.push([r,a-1]),n}},function(e,t){e.exports=function(e){for(var t={},n=e.length,r=0;rxe(xe({},e),{},{index:t}))}(e,t,n)}function Re(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Se(e){for(var t=1;t{}),getOptions:l=null,allowEmpty:s=!0,closeOnSelect:u=!0,closable:p=!0}){const d=e.useRef(null),f=e.useMemo(()=>function(e){if(!Array.isArray(e))return[];const t=[];return e.forEach((e,n)=>{if("type"in e&&"group"===e.type){const r=e.name.replace(/\s+/g,"-").toLowerCase()+"-"+n;e.items.forEach(n=>{t.push(de(de({},n),{},{groupId:r,groupName:e.name,_id:""+n.value}))})}else t.push(de(de({},e),{},{_id:""+e.value,index:n}))}),t}(i),[i]),[h,m]=e.useState({flat:[],addedOptions:[],value:t,search:"",focus:!1,searching:!1,highlighted:-1,changed:!1}),{flat:g,addedOptions:v,value:b,search:y,focus:w,searching:x,highlighted:k}=h,O=e.useMemo(()=>{let e=ve(b,[...f,...v]);return e||s||r||([e]=f),e},[b,f,v,s,r]),E=e.useMemo(()=>ge(g),[g]),R=e.useMemo(()=>function(e){return e&&"object"==typeof e?Array.isArray(e)?e.map(e=>e.name).join(", "):e.name:""}(O),[O]),S=e.useCallback(()=>{m(e=>Se(Se({},e),{},{focus:!1,search:"",flat:f,highlighted:-1})),d.current&&d.current.blur()},[f,d]),C=e=>m(t=>Se(Se({},t),{},{focus:e})),_=e.useCallback(e=>{m(t=>{const{flat:n,highlighted:o}=t,a=e?n.find(t=>t.value==e):n[o];if(!a)return t;const i=function(e,t,n){if(!n)return e;if(!t)return[e];const r=Array.isArray(t)?[...t]:[t],o=r.findIndex(t=>t===e);return o>=0?r.splice(o,1):r.push(e),r}(a.value,t.value,r),c=ve(i,n);return Se(Se({},t),{},{addedOptions:r?c:[c],value:i,changed:[i,c]})})},[r]),j=e.useCallback(e=>{u||e.preventDefault(),_(e.currentTarget.value)},[_,u]),P=e.useCallback(e=>{const{key:t}=e;"ArrowDown"!==t&&"ArrowUp"!==t||(e.preventDefault(),m(e=>Se(Se({},e),{},{highlighted:ue(e.highlighted,{key:t,options:e.flat})})))},[]),N=e.useCallback(({key:e})=>{"Enter"===e&&(_(),p&&u&&S())},[_,u,S,p]),z=e.useCallback(({key:e})=>{"Escape"===e&&S()},[S]),M={tabIndex:"0",readOnly:!o,onChange:o?({target:e})=>{const{value:t}=e,n={search:t};let r=f;l&&t.length&&(n.searching=!0,r=l(t)),m(e=>Se(Se({},e),n)),Promise.resolve(r).then(e=>{let n=e;t.length&&(n=Ee(t,e,a)),m(t=>Se(Se({},t),{},{flat:!1===n?e:n,searching:!1}))}).catch(()=>m(e=>Se(Se({},e),{},{flat:f,searching:!1})))}:null,disabled:n,onMouseDown:()=>C(!w),onBlur:S,onFocus:()=>C(!0),onKeyPress:N,onKeyDown:P,onKeyUp:z,ref:d},T=e.useMemo(()=>({tabIndex:"-1",onMouseDown:j,onKeyDown:P,onKeyPress:N,onBlur:S}),[j,P,N,S]);return e.useEffect(()=>{m(e=>Se(Se({},e),{},{value:t}))},[t]),e.useEffect(()=>{m(e=>Se(Se({},e),{},{flat:f}))},[f]),e.useEffect(()=>{!1!==h.changed&&(m(e=>Se(Se({},e),{},{changed:!1})),c(...h.changed))},[h.changed,c]),[{value:O,highlighted:k,options:E,disabled:n,displayValue:R,focus:w,search:y,searching:x},M,T,e=>m(t=>Se(Se({},t),{},{value:e}))]} -/** @license React v16.13.1 - * react-is.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var je="function"==typeof Symbol&&Symbol.for,Pe=je?Symbol.for("react.element"):60103,Ne=je?Symbol.for("react.portal"):60106,ze=je?Symbol.for("react.fragment"):60107,Me=je?Symbol.for("react.strict_mode"):60108,Te=je?Symbol.for("react.profiler"):60114,Le=je?Symbol.for("react.provider"):60109,Ae=je?Symbol.for("react.context"):60110,qe=je?Symbol.for("react.async_mode"):60111,Ie=je?Symbol.for("react.concurrent_mode"):60111,Fe=je?Symbol.for("react.forward_ref"):60112,De=je?Symbol.for("react.suspense"):60113,Be=je?Symbol.for("react.suspense_list"):60120,We=je?Symbol.for("react.memo"):60115,$e=je?Symbol.for("react.lazy"):60116,Ve=je?Symbol.for("react.block"):60121,He=je?Symbol.for("react.fundamental"):60117,Ue=je?Symbol.for("react.responder"):60118,Ke=je?Symbol.for("react.scope"):60119;function Qe(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case Pe:switch(e=e.type){case qe:case Ie:case ze:case Te:case Me:case De:return e;default:switch(e=e&&e.$$typeof){case Ae:case Fe:case $e:case We:case Le:return e;default:return t}}case Ne:return t}}}function Ze(e){return Qe(e)===Ie}var Ge={AsyncMode:qe,ConcurrentMode:Ie,ContextConsumer:Ae,ContextProvider:Le,Element:Pe,ForwardRef:Fe,Fragment:ze,Lazy:$e,Memo:We,Portal:Ne,Profiler:Te,StrictMode:Me,Suspense:De,isAsyncMode:function(e){return Ze(e)||Qe(e)===qe},isConcurrentMode:Ze,isContextConsumer:function(e){return Qe(e)===Ae},isContextProvider:function(e){return Qe(e)===Le},isElement:function(e){return"object"==typeof e&&null!==e&&e.$$typeof===Pe},isForwardRef:function(e){return Qe(e)===Fe},isFragment:function(e){return Qe(e)===ze},isLazy:function(e){return Qe(e)===$e},isMemo:function(e){return Qe(e)===We},isPortal:function(e){return Qe(e)===Ne},isProfiler:function(e){return Qe(e)===Te},isStrictMode:function(e){return Qe(e)===Me},isSuspense:function(e){return Qe(e)===De},isValidElementType:function(e){return"string"==typeof e||"function"==typeof e||e===ze||e===Ie||e===Te||e===Me||e===De||e===Be||"object"==typeof e&&null!==e&&(e.$$typeof===$e||e.$$typeof===We||e.$$typeof===Le||e.$$typeof===Ae||e.$$typeof===Fe||e.$$typeof===He||e.$$typeof===Ue||e.$$typeof===Ke||e.$$typeof===Ve)},typeOf:Qe},Xe=be((function(e,t){})),Ye=(Xe.AsyncMode,Xe.ConcurrentMode,Xe.ContextConsumer,Xe.ContextProvider,Xe.Element,Xe.ForwardRef,Xe.Fragment,Xe.Lazy,Xe.Memo,Xe.Portal,Xe.Profiler,Xe.StrictMode,Xe.Suspense,Xe.isAsyncMode,Xe.isConcurrentMode,Xe.isContextConsumer,Xe.isContextProvider,Xe.isElement,Xe.isForwardRef,Xe.isFragment,Xe.isLazy,Xe.isMemo,Xe.isPortal,Xe.isProfiler,Xe.isStrictMode,Xe.isSuspense,Xe.isValidElementType,Xe.typeOf,be((function(e){e.exports=Ge})),Object.getOwnPropertySymbols),Je=Object.prototype.hasOwnProperty,et=Object.prototype.propertyIsEnumerable;function tt(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}})()&&Object.assign,Function.call.bind(Object.prototype.hasOwnProperty);function nt(){}function rt(){}rt.resetWarningCache=nt;var ot=be((function(e){e.exports=function(){function e(e,t,n,r,o,a){if("SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"!==a){var i=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw i.name="Invariant Violation",i}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:rt,resetWarningCache:nt};return n.PropTypes=n,n}()}));const at=ot.shape({name:ot.string.isRequired,value:ot.oneOfType([ot.string,ot.number]).isRequired});ot.oneOfType([at,ot.shape({name:ot.string.isRequired,type:ot.string.isRequired,items:ot.arrayOf(at)})]),ot.oneOfType([ot.object,ot.arrayOf(ot.object)]),ot.oneOfType([ot.string,ot.func]);function it(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ct(e){for(var t=1;t=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}const ut=e=>{let{optionProps:n,highlighted:r,selected:o,cls:a,renderOption:i}=e,c=st(e,["optionProps","highlighted","selected","cls","renderOption"]);const l=[a("option"),!!o&&a("is-selected"),!!r&&a("is-highlighted")].filter(e=>!!e).join(" "),s=ct(ct({},n),{},{value:c.value,disabled:c.disabled});return t.createElement("li",{className:a("row"),role:"menuitem","data-index":c.index,"data-value":escape(c.value),key:c.value},i(s,c,{selected:o,highlighted:r},l))};ut.defaultProps={disabled:!1,index:null,value:null},ut.propTypes={};var pt=e.memo(ut);function dt(){return(dt=Object.assign||function(e){for(var t=1;t{const x=e.useRef(null),[k,O,E]=_e({options:s,value:n,multiple:a,disabled:r,fuse:y,search:i,onChange:p,getOptions:b,closeOnSelect:f,closable:!a||"on-focus"===d,allowEmpty:!!o}),{focus:R,highlighted:S,value:C,options:_,searching:j,displayValue:P,search:N}=k,z=e.useCallback(e=>"function"==typeof h?h(e):0===e.indexOf("container")?e.replace("container",h):0===e.indexOf("is-")||0===e.indexOf("has-")?e:h.split(" ")[0]+"__"+e,[h]),M=[z("container"),!!r&&z("is-disabled"),!!j&&z("is-loading"),!!R&&z("has-focus")].filter(e=>!!e).join(" "),T=R&&i?N:P;let L;switch(e.useEffect(()=>{const{current:e}=x;if(!e||a||S<0&&!C)return;const t=S>-1?'[data-index="'+S+'"]':'[data-value="'+escape(C.value)+'"]',n=e.querySelector(t);if(n){const t=e.getBoundingClientRect(),r=n.getBoundingClientRect();e.scrollTop=n.offsetTop-t.height/2+r.height/2}},[R,C,S,x,a]),d){case"never":L=!1;break;case"always":L=!0;break;case"on-focus":L=R;break;default:L=!r&&(R||a)}return t.createElement("div",{ref:w,className:M,id:u},(!a||o||i)&&t.createElement("div",{className:z("value")},m(ht(ht({},O),{},{placeholder:o,autoFocus:c,autoComplete:l,value:T}),k,z("input"))),L&&t.createElement("div",{className:z("select"),ref:x},t.createElement("ul",{className:z("options")},_.map(e=>{const n="group"===e.type,r=n?e.items:[e],o={cls:z,optionProps:E,renderOption:g},a=r.map(e=>{return t.createElement(pt,dt({key:e.value,selected:(n=e,r=C,!!r&&(Array.isArray(r)?r.findIndex(e=>e.value===n.value)>=0:r.value===n.value)),highlighted:S===e.index},o,e));var n,r});return n?t.createElement("li",{role:"none",className:z("row"),key:e.groupId},t.createElement("div",{className:z("group")},t.createElement("div",{className:z("group-header")},v(e.name)),t.createElement("ul",{className:z("options")},a))):a}))))});gt.defaultProps={className:"select-search",disabled:!1,search:!1,multiple:!1,placeholder:null,id:null,autoFocus:!1,autoComplete:"on",value:"",onChange:()=>{},printOptions:"auto",closeOnSelect:!0,renderOption:(e,n,r,o)=>t.createElement("button",dt({className:o},e),n.name),renderGroupHeader:e=>e,renderValue:(e,n,r)=>t.createElement("input",dt({},e,{className:r})),fuse:{keys:["name","groupName"],threshold:.3},getOptions:null},gt.propTypes={};var vt=e.memo(gt);function bt(e){var t=e.options,r=t;if(!Array.isArray(t)||0===t.length)return null;"object"!==n(t[0])&&(r=t.map((function(e){return{name:e,value:e}})));var o=s({search:!1,printOptions:"auto"},e),a={options:r,value:e.val,name:e.name,onChange:e.onChange,search:o.search,printOptions:o.printOptions,className:o.horizontal?"select-search horizontal":"select-search",renderOption:function(e,t,n,r){return React.createElement("button",c({className:r},e,{type:"button"}),t.name)}};return"object"===n(t[0])&&"clsName"in t[0]&&(a.renderOption=function(e,t,n,r){return React.createElement("button",c({},e,{className:r,type:"button"}),React.createElement("span",{className:"clsName"in t?t.clsName:""},React.createElement("span",null,t.name)))}),"renderOption"in o&&(a.renderOption=o.renderOption),React.createElement("div",{className:"cw-control-content cw-select"},React.createElement("span",{className:"cw-control-title"},e.label," "),React.createElement(vt,a))}function yt(e){var t=["0px","0px","0px","0px","#000000"];if("none"!==e.val)if(isNaN(e.val.charAt(0))){var n=e.val.split(/ (?![^\(]*\))/);t=[n[1],n[2],n[3],n[4],n[0]]}else t=e.val.split(" ");var r=g(React.useState(t),2),o=r[0],a=r[1];return React.createElement("div",{className:"cw-control-content border"},e.label&&React.createElement("span",{className:"cw-control-title"},e.label),React.createElement("span",{className:"cw-control-title"},"X Offset"),React.createElement(ie,{val:o[0],tab:0,hidden:!1,handleChange:function(t,n){a((function(e){return e[0]=n,e})),e.onChange(o.join(" "))}}),React.createElement("span",{className:"cw-control-title"},"Y Offset"),React.createElement(ie,{val:o[1],tab:0,hidden:!1,handleChange:function(t,n){a((function(e){return e[1]=n,e})),e.onChange(o.join(" "))}}),React.createElement("span",{className:"cw-control-title"},"Blur Radius"),React.createElement(ie,{val:o[2],tab:0,hidden:!1,handleChange:function(t,n){a((function(e){return e[2]=n,e})),e.onChange(o.join(" "))}}),React.createElement("span",{className:"cw-control-title"},"Spread Radius"),React.createElement(ie,{val:o[3],tab:0,hidden:!1,handleChange:function(t,n){a((function(e){return e[3]=n,e})),e.onChange(o.join(" "))}}),React.createElement(se,{val:o[4],onChange:function(t){a((function(e){return e[4]=t,e})),e.onChange(o.join(" "))},label:"Color"}))}function wt(e){var t={tab:0,values:[["0px","none","#000000"],["0px","none","#000000"],["0px","none","#000000"],["0px","none","#000000"],["0px","none","#000000"]]};"borderTopWidth"in e.val&&(t.values=[[e.val.borderTopWidth,e.val.borderTopStyle,e.val.borderTopColor],[e.val.borderTopWidth,e.val.borderTopStyle,e.val.borderTopColor],[e.val.borderRightWidth,e.val.borderRightStyle,e.val.borderRightColor],[e.val.borderBottomWidth,e.val.borderBottomStyle,e.val.borderBottomColor],[e.val.borderLeftWidth,e.val.borderLeftStyle,e.val.borderLeftColor]]);var n=g(React.useState(t),2),r=n[0],o=n[1],a=React.createElement("div",{className:"cw-tabs"},[0,1,2,3,4].map((function(e){return React.createElement("div",{key:e,className:"tab tab-".concat(e," ").concat(0===e?"active":""),onClick:function(t){return function(e,t){e.currentTarget.parentNode.childNodes.forEach((function(e){return e.classList.remove("active")})),e.currentTarget.classList.add("active"),o((function(e){return s({},e,{tab:t})}))}(t,e)}},React.createElement(ce,{tab:e,subType:"border"}))}))),i=r.tab,c=r.values,l=React.createElement("div",{className:"cw-tab-wrap"},React.createElement(ie,{val:c[i][0],tab:0,hidden:!1,handleChange:function(t,n){o((function(e){return e.values[i][0]=n,e})),e.onChange(c,i)}}),React.createElement(se,{val:c[i][2],onChange:function(t){o((function(e){return e.values[i][2]=t,e})),e.onChange(c,i)},label:"Color"}),React.createElement(bt,{options:[{name:"x",value:"none"},{name:"",value:"solid"},{name:"",value:"dotted"},{name:"",value:"dashed"}],val:c[i][1],onChange:function(t){o((function(e){return e.values[i][1]=t,e})),e.onChange(c,i)},printOptions:"always",horizontal:"true",label:"Style"}));return React.createElement("div",{className:"cw-control-content cw-border"},e.label&&React.createElement("span",{className:"cw-control-title"},e.label),a,l)}function xt(e){var t=e.selectors,n=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];!0===t?cw.Evt.emit("de-highlight-elements"):cw.Evt.emit("highlight-elements",e)},r=React.createElement("span",{className:"dashicons dashicons-arrow-right-alt"});return React.createElement("div",{id:"cw-quick-select"},React.createElement("div",{className:"cw-panel-title"},React.createElement("span",null,"No Element Selected.")),React.createElement("div",{className:"cw-qs-content"},React.createElement("div",{className:"cw-qs-title"},"Click on any element to edit the styles ",r,React.createElement("br",null),"OR",React.createElement("br",null),"Quick select an Element below"),React.createElement("ul",{className:"cw-qs-btns"},t.map((function(e){return React.createElement("li",{key:e.name,className:"cw-qs-btn",onClick:function(){return function(e){cw.Evt.emit("select-element",e)}(e.sel)},onMouseEnter:function(){return n(e.sel,!1)},onMouseLeave:n},e.name)})))))}function kt(){var e=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"open";"add"===t?e.classList.add(n):e.classList.remove(n)},t=g(React.useState(["hover","focus","active","visited"]),2),n=t[0],r=t[1],o=function(t){var o=t.target.innerText;L.get().currentPseudo===o?(L.togglePseudo(""),e(t.target.parentNode.parentNode,"","active")):(L.togglePseudo(o),n.indexOf(o)>0&&(n.splice(n.indexOf(o),1),n.unshift(o),r(n)),e(t.target.parentNode.parentNode),e(t.target.parentNode.parentNode,"add","active")),t.target.parentNode.childNodes.forEach((function(e){return e.classList.remove("selected")}))},a=""===L.get().currentPseudo?"":"active";return React.createElement("div",{className:"cw-pseudo ".concat(a),onMouseEnter:function(t){return e(t.currentTarget,"add")},onMouseLeave:function(t){return e(t.currentTarget)}},React.createElement("span",{className:"cw-pseudo-icon dashicons dashicons-menu-alt2"}),React.createElement("div",{className:"cw-pseudo-content"},n.map((function(e,t){return React.createElement("div",{key:t,className:"cw-pseudo-item",onClick:o},e)}))))}var Ot=wp.mediaUtils.MediaUpload;function Et(e){var t=e.val;if("none"!==t){var n=v(t.matchAll(/(url)(?:\(['"]?)(.*?)(?:['"]?\))/g));n.length&&n[0].length>2&&(t=n[0][2])}var r=g(React.useState(t),2),o=r[0],a=r[1],i=function(t){a(t.url),e.onChange("url('".concat(t.url,"')"))};return React.createElement("div",{className:"cw-control-content cw-media"},e.label&&React.createElement("span",{className:"cw-control-title"},e.label),React.createElement("div",{className:"attachment-media-view"},"none"===o?React.createElement(Ot,{onSelect:i,allowedTypes:["image"],value:"",render:function(t){var n=t.open;return React.createElement("button",{type:"button",onClick:n,className:"upload-button button-add-media"},e.buttonText?e.buttonText:"Select Image")}}):React.createElement(React.Fragment,null,React.createElement("div",{className:"thumbnail thumbnail-image"},React.createElement("img",{className:"attachment-thumb",src:o})),React.createElement("div",{className:"actions"},React.createElement("button",{type:"button",onClick:function(){a("none"),e.onChange("none")},className:"button remove-button"},"Remove"),React.createElement(Ot,{onSelect:i,allowedTypes:["image"],value:"",render:function(t){var n=t.open;return React.createElement("button",{type:"button",onClick:n,className:"button upload-button"},e.changeText?e.changeText:"Change Image")}})))))}function Rt(){var e=cwControlObject.fonts,t=E(L),n=t.currentSelector,r=t.openSection,o=t.currentStyles,a=t.quickSelectors,i=t.selectorClass,c=g(React.useState({styleOptions:["normal","italic"],weightOptions:["100","200","300","400","500","600","700","800","900"]}),2),l=c[0],u=c[1],p=g(React.useState(!1),2),d=p[0],f=p[1];""!==n?setTimeout((function(){return f(!0)}),0):setTimeout((function(){return f(!1)}),0),React.useEffect((function(){u((function(e){return s({},e,{family:o.fontFamily,style:o.fontStyle,weight:o.fontWeight})}))}),[o]);var h=function(t){var n={family:t=t.replace(/^"(.+(?="$))"$/,"$1"),source:"system"};if(e.allFonts.system.hasOwnProperty(t))n.variants=e.defaults.variants,n.category=e.allFonts.system[t].category;else if(e.allFonts.google.hasOwnProperty(t)){var r=e.allFonts.google[t][0],o=e.allFonts.google[t][1];n.source="google",n.category=o,n.variants={},r[0].length>0&&(n.variants.normal=r[0]),r[1].length>0&&(n.variants.italic=r[1])}else t.includes("system-ui")&&(n.variants=e.defaults.variants,n.category="sans-serif");return n},m=function(e,t){return t.reduce((function(t,n){return Math.abs(n-e)0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];e=(e=e||l.family).replace(/^"(.+(?="$))"$/,"$1");var o=h(e);t||(t=l.style,o.variants.hasOwnProperty(t)||(t=Object.keys(o.variants)[0])),r||(r=l.weight,-1===o.variants[t].indexOf(r)&&(r=m(r,o.variants[t]))),u({styleOptions:Object.keys(o.variants),weightOptions:o.variants[t],family:e,style:t,weight:r.toString()});var a={family:e,style:t,weight:r,source:o.source,category:o.category};L.addFont(a),q.addFont(),l.family!==e&&q.addStyleNow(n,"font-family",e),l.style!==t&&q.addStyleNow(n,"font-style",t),l.weight!==r&&q.addStyleNow(n,"font-weight",r)},b=[{id:"padding",title:"Padding",controls:[{property:"padding",Component:le,params:{subType:"padding",val:o.padding}}]},{id:"margin",title:"Margin",controls:[{property:"margin",Component:le,params:{subType:"margin",val:o.margin}}]},{id:"background",title:"Background",controls:[{property:"background",Component:se,params:{label:"Background Color",val:o.backgroundColor}},{property:"background-image",Component:Et,params:{label:"Background Image",val:o.backgroundImage}},{property:"background-size",Component:bt,params:{label:"Background Size",name:"background-size",options:[{name:"Auto",value:"auto"},{name:"Cover",value:"cover"},{name:"Contain",value:"contain"}],val:o.backgroundSize,printOptions:"always",horizontal:!0}}]},{id:"text",title:"Text",controls:[{property:"font-size",Component:le,params:{label:"Font Size",subType:"size",val:o.fontSize}},{property:"line-height",Component:le,params:{label:"Line Height",subType:"size",val:o.lineHeight}},{property:"font-family",Component:bt,params:{label:"Font Family",name:"font-family",options:function(){var t=[];for(var n in e.allFonts){var r=n;"system"===n?r="System Fonts":"google"===n&&(r="Google Fonts");var o=[];for(var a in e.allFonts[n]){var i="Default"===a?"Default System Font":a;o.push({name:i,value:a})}t.push({type:"group",name:r,items:o})}return t}(),val:l.family,search:!0,onChange:function(e){return v(e,!1,!1)}}},{property:"color",Component:se,params:{label:"Font Color",val:o.color},cls:"col-8"},{property:"font-weight",Component:bt,params:{label:"Font Weight",name:"font-weight",options:l.weightOptions,val:l.weight,onChange:function(e){return v(!1,!1,e)}},cls:"col-4"},{property:"font-style",Component:bt,params:{label:"Font Style",name:"font-style",options:l.styleOptions,val:l.style,onChange:function(e){return v(!1,e,!1)},printOptions:"always",horizontal:!0},cls:"col-5"},{property:"text-align",Component:bt,params:{label:"Text Align",name:"text-align",options:[{name:"",value:"left",clsName:"dashicons dashicons-editor-alignleft"},{name:"",value:"right",clsName:"dashicons dashicons-editor-alignright"},{name:"",value:"center",clsName:"dashicons dashicons-editor-aligncenter"},{name:"",value:"justify",clsName:"dashicons dashicons-editor-justify"}],val:o.textAlign,printOptions:"always",horizontal:!0},cls:"col-7"},{property:"text-decoration",Component:bt,params:{label:"Text Decoration",name:"text-decoration",options:[{name:"A",value:"none"},{name:"O",value:"overline"},{name:"U",value:"underline"},{name:"S",value:"line-through"}],val:o.textDecoration,printOptions:"always",horizontal:!0},cls:"col-6"},{property:"text-transform",Component:bt,params:{label:"Text Transform",name:"text-transform",options:[{name:"x",value:"none"},{name:"Aa",value:"capitalize"},{name:"aa",value:"lowercase"},{name:"AA",value:"uppercase"}],val:o.textTransform,printOptions:"always",horizontal:!0},cls:"col-6"},{property:"letter-spacing",Component:le,params:{label:"Letter Spacing",subType:"size",val:"normal"===o.letterSpacing?"0px":o.letterSpacing}},{property:"word-spacing",Component:le,params:{label:"Word Spacing",subType:"size",val:o.wordSpacing}},{property:"text-indent",Component:le,params:{label:"Text Indent",subType:"size",val:o.textIndent}}]},{id:"border",title:"Border",controls:[{property:"border-radius",Component:le,params:{label:"Border Radius",subType:"radius",val:o.borderRadius}},{property:"border",Component:wt,params:{label:"Border Width",val:o,onChange:function(e,t){e.every((function(e,t,n){return e===n[0]}))||0===t?q.addStyleNow(n,"border","".concat(e[0][0]," ").concat(e[0][1]," ").concat(e[0][2])):(q.addStyleNow(n,"border-top","".concat(e[1][0]," ").concat(e[1][1]," ").concat(e[1][2])),q.addStyleNow(n,"border-right","".concat(e[2][0]," ").concat(e[2][1]," ").concat(e[2][2])),q.addStyleNow(n,"border-bottom","".concat(e[3][0]," ").concat(e[3][1]," ").concat(e[3][2])),q.addStyleNow(n,"border-left","".concat(e[4][0]," ").concat(e[4][1]," ").concat(e[4][2])))}}}]},{id:"size",title:"Size",controls:[{property:"width",Component:le,params:{label:"Width",subType:"size",val:o.width}},{property:"height",Component:le,params:{label:"Height",subType:"size",val:o.height}},{property:"min-width",Component:le,params:{label:"Min Width",subType:"size",val:o.minWidth}},{property:"min-height",Component:le,params:{label:"Min Height",subType:"size",val:o.minHeight}},{property:"max-width",Component:le,params:{label:"Max Width",subType:"size",val:o.maxWidth}},{property:"max-height",Component:le,params:{label:"Max Height",subType:"size",val:o.maxHeight}}]},{id:"shadow",title:"Shadow",controls:[{property:"box-shadow",Component:yt,params:{val:o.boxShadow}}]},{id:"position",title:"Position",controls:[{property:"position",Component:bt,params:{label:"Position",name:"position",options:[{name:"Relative",value:"relative"},{name:"Absolute",value:"absolute"},{name:"Static",value:"static"},{name:"Fixed",value:"fixed"},{name:"Sticky",value:"sticky"}],val:o.position,printOptions:"always",horizontal:!0}},{property:"top",Component:le,params:{label:"Top",subType:"size",val:o.top}},{property:"right",Component:le,params:{label:"Right",subType:"size",val:o.right}},{property:"bottom",Component:le,params:{label:"Bottom",subType:"size",val:o.bottom}},{property:"left",Component:le,params:{label:"Left",subType:"size",val:o.left}}]},{id:"others",title:"Others",controls:[{property:"display",Component:bt,params:{label:"Display",name:"display",options:[{name:"block",value:"block"},{name:"none",value:"none"},{name:"flex",value:"flex"},{name:"grid",value:"grid"},{name:"inline",value:"inline"},{name:"inline-block",value:"inline-block"},{name:"inline-flex",value:"inline-flex"},{name:"inline-grid",value:"inline-grid"},{name:"contents",value:"contents"},{name:"inline-table",value:"inline-table"},{name:"list-item",value:"list-item"},{name:"run-in",value:"run-in"},{name:"table",value:"table"},{name:"table-caption",value:"table-caption"},{name:"table-column-group",value:"table-column-group"},{name:"table-header-group",value:"table-header-group"},{name:"table-footer-group",value:"table-footer-group"},{name:"table-row-group",value:"table-row-group"},{name:"table-cell",value:"table-cell"},{name:"table-column",value:"table-column"},{name:"table-row",value:"table-row"},{name:"initial",value:"initial"},{name:"inherit",value:"inherit"}],val:o.display},cls:"col-6"},{property:"visibility",Component:bt,params:{label:"Visibility",name:"visibility",options:[{name:"",value:"Visible",clsName:"dashicons dashicons-visibility"},{name:"",value:"Hidden",clsName:"dashicons dashicons-hidden"}],val:o.visibility,printOptions:"always",horizontal:!0},cls:"col-6"},{property:"opacity",Component:le,params:{label:"Opacity",subType:"unitLess",val:o.opacity}}]}];b.forEach((function(e){e.controls.forEach((function(e){"onChange"in e.params||(e.params.onChange=function(t){q.addStyle(n,e.property,t)})}))}));var y=g(React.useState(n),2),w=y[0],x=y[1];React.useEffect((function(){return x(n)}),[n]);return React.createElement("div",{id:"cw-editor-wrap"},React.createElement("div",{id:"cw-editor-panel",className:"cw-panel"},""!==n?React.createElement(React.Fragment,null,React.createElement("div",{className:"cw-panel-title"},React.createElement("div",{className:"title-inner"},React.createElement("span",{className:"title-desc"},"You're editing:"),React.createElement("input",{type:"text",className:"selector ".concat(i),value:w,onChange:function(e){x(e.target.value),cw.Evt.emit("update-selector",e.target.value)}})),React.createElement(kt,null)),React.createElement("div",{className:"cw-panel-main"},React.createElement("ul",{className:"cw-panel-sections"},b.map((function(e){return React.createElement("li",{key:e.id,className:"cw-panel-section ".concat(r===e.id?"open":"")},React.createElement("h3",{className:"cw-section-title",onClick:function(){return L.toggleSection(e.id)}},e.title),React.createElement("div",{className:"cw-section-content"},e.controls.map((function(t){return r===e.id?React.createElement("div",{key:t.property,className:"cw-control ".concat(t.property," ").concat(t.cls?t.cls:"")},d&&React.createElement(t.Component,t.params)):null}))))}))))):React.createElement(xt,{selectors:a})),React.createElement("style",{type:"text/css"},"#cw-editor-wrap ul, #cw-editor-wrap li {\n list-style: none;\n margin: 0;\n padding: 0; }\n\n#cw-editor-wrap .cw-panel {\n background: #eee;\n font-size: 13px;\n color: #444; }\n\n#cw-editor-wrap .cw-panel-title {\n background: #fff;\n border-bottom: 1px solid #ddd;\n font-size: 13px;\n padding: 16px;\n color: #444;\n line-height: 16px;\n margin: 0; }\n #cw-editor-wrap .cw-panel-title * {\n box-sizing: border-box; }\n #cw-editor-wrap .cw-panel-title .title-inner {\n display: inline-flex;\n width: calc(100% - 54px); }\n #cw-editor-wrap .cw-panel-title .title-desc {\n padding: 3px 0;\n width: 90px; }\n #cw-editor-wrap .cw-panel-title .selector {\n background: #f2f8ec;\n border: 1px solid #7cb342;\n padding: 3px 5px;\n width: calc(100% - 90px);\n border-radius: 0;\n min-height: 24px;\n line-height: 1;\n font-size: 13px;\n background-image: none !important; }\n #cw-editor-wrap .cw-panel-title .selector:focus {\n box-shadow: none;\n border-color: #5b8230; }\n #cw-editor-wrap .cw-panel-title .selector.invalid, #cw-editor-wrap .cw-panel-title .selector.invalid:focus {\n border-color: #c78100; }\n\n#cw-editor-wrap .cw-panel-main {\n height: calc(100% - 41px);\n overflow-y: auto; }\n\n#cw-editor-wrap h3.cw-section-title {\n border-bottom: 1px solid #ddd;\n background: #fff;\n font-size: 14px;\n padding: 12px 16px;\n font-weight: 600;\n color: #444;\n line-height: 16px;\n margin: 0;\n cursor: pointer; }\n\n.cw-section-content {\n display: flex;\n flex-wrap: wrap;\n padding: 0 12px;\n max-height: 0;\n opacity: 0;\n overflow: auto;\n transition: max-height .2s ease, opacity .2s ease; }\n\n.cw-panel .open .cw-section-content {\n opacity: 1;\n max-height: 1000px;\n border-bottom: 1px solid #ddd; }\n\n.cw-control {\n flex-shrink: 0;\n width: 100%;\n margin-bottom: 12px;\n box-sizing: border-box; }\n .cw-control.padding, .cw-control.margin {\n margin-bottom: 0; }\n .cw-control.col-4 {\n width: 33.333%; }\n .cw-control.col-5 {\n width: 41.666%; }\n .cw-control.col-6 {\n width: 50%; }\n .cw-control.col-7 {\n width: 58.333%; }\n .cw-control.col-8 {\n width: 66.666%; }\n .cw-control .cw-tabs {\n margin: 0 -12px -1px -13px; }\n .cw-control .tab.active {\n border-bottom-color: #eee;\n background: #eee; }\n .cw-control .tab-content {\n position: relative;\n padding: 30px 0 15px; }\n .cw-control .shorthand .tab-content {\n border-top: 1px solid #ccc; }\n .cw-control .single-length .tab-content {\n padding: 20px 0 0; }\n .cw-control .single-length .tab-content .reset {\n bottom: 32px; }\n .cw-control .output {\n padding: 5px;\n border-top: 1px dotted #ddd;\n border-bottom: 1px solid #ddd;\n font-size: 11px;\n margin-top: -1px; }\n .cw-control .reset {\n position: absolute;\n right: 2px;\n bottom: 47px;\n padding: 4px;\n cursor: pointer; }\n .cw-control .reset:hover {\n background: #fff; }\n .cw-control .range-wrap {\n padding-right: 5px;\n line-height: 1.8; }\n .cw-control input:focus {\n outline: none; }\n .cw-control svg {\n display: block;\n margin: auto; }\n .cw-control .wp-picker-container {\n position: relative; }\n .cw-control .wp-picker-container.wp-picker-active {\n min-height: 270px; }\n .cw-control .wp-picker-container .wp-color-result.button {\n margin-right: 2px; }\n .cw-control .wp-picker-active .wp-color-result-text {\n display: none; }\n .cw-control .wp-picker-clear, .cw-control .wp-picker-clear:hover, .cw-control .wp-picker-clear:focus, .cw-control .wp-picker-clear:active {\n height: 30px;\n text-indent: -100px;\n background-image: url(\"data:image/svg+xml,%3Csvg width='15px' height='14.7px' viewBox='0 0 50 49' version='1.1' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0,20 L14,0 C14,6 14,9 14,9 C40,-3 65,30 38,49 C58,27 36,7 18,17 C18,17 20,19 24,23 L0,20 Z' fill='%237CB342'%3E%3C/path%3E%3C/svg%3E\");\n background-repeat: no-repeat;\n background-position: center;\n min-width: 26px; }\n .cw-control.color input[type=\"text\"].wp-color-picker {\n max-width: 120px; }\n .cw-control.border input[type=\"text\"].wp-color-picker {\n max-width: 100px; }\n .cw-control.font-style, .cw-control.text-decoration, .cw-control.display {\n padding-right: 12px; }\n .cw-control.position .select-search__option {\n font-size: 13px; }\n\n.cw-control-title {\n display: block;\n padding: 10px 0; }\n .cw-control-title + .tab-content {\n margin-top: -25px; }\n\n.border .cw-tab-wrap {\n display: flex;\n flex-wrap: wrap; }\n .border .cw-tab-wrap > * {\n flex-shrink: 0;\n width: 100%;\n box-sizing: border-box; }\n .border .cw-tab-wrap .cw-color {\n width: 60%; }\n .border .cw-tab-wrap .cw-select {\n width: 40%; }\n\nbutton.wp-color-result .color-alpha {\n height: 28px !important; }\n\n#cw-quick-select .cw-qs-title {\n padding: 15px 0 10px;\n text-align: center;\n line-height: 22px; }\n #cw-quick-select .cw-qs-title .dashicons {\n background-color: #0171a1;\n background-image: linear-gradient(90deg, #01a0e4, #0171a1);\n background-size: 100%;\n background-repeat: repeat;\n -webkit-background-clip: text;\n -webkit-text-fill-color: transparent;\n font-size: 16px;\n height: 16px;\n vertical-align: text-top; }\n\n#cw-quick-select .cw-qs-title svg {\n vertical-align: text-top;\n padding-left: 10px; }\n\n#cw-quick-select ul.cw-qs-btns {\n padding: 10px;\n display: flex;\n flex-flow: column wrap;\n align-content: space-between;\n height: 300px; }\n #cw-quick-select ul.cw-qs-btns::before, #cw-quick-select ul.cw-qs-btns::after {\n content: '';\n flex-basis: 100%;\n width: 0;\n order: 2; }\n\n#cw-quick-select .cw-qs-btn:nth-child(3n+1) {\n order: 1; }\n\n#cw-quick-select .cw-qs-btn:nth-child(3n+2) {\n order: 2; }\n\n#cw-quick-select .cw-qs-btn:nth-child(3n) {\n order: 3; }\n\n#cw-quick-select li.cw-qs-btn {\n padding: 6px 8px;\n background: #fff linear-gradient(90deg, #ffffff 0%, #f3f7f4 100%);\n color: #0071a1;\n border: 1px solid #0071a1;\n border-radius: 3px;\n cursor: pointer;\n width: calc(33.3% - 5px);\n box-sizing: border-box;\n margin-bottom: 10px;\n text-align: center; }\n\n.cw-pseudo {\n display: inline-block;\n vertical-align: top;\n cursor: pointer;\n position: relative; }\n\n.cw-pseudo-icon {\n display: inline-block;\n background: #f2f8ec;\n border: 1px solid #7cb342;\n border-left: none;\n color: #5b8230;\n cursor: pointer;\n line-height: 22px;\n height: 24px; }\n\n.cw-pseudo-content {\n border: 1px solid #7cb342;\n box-sizing: border-box;\n display: none;\n position: absolute;\n top: 0;\n left: -1px;\n background: white;\n z-index: 3; }\n\n.cw-pseudo-item {\n padding: 3px 0 3px 7px;\n width: 52px;\n display: none; }\n .cw-pseudo-item:hover {\n color: #5b8230; }\n\n.cw-pseudo.active .cw-pseudo-content {\n display: inline-block; }\n\n.cw-pseudo.active .cw-pseudo-item:first-child {\n display: inline-block;\n background: #f2f8ec; }\n\n.cw-pseudo.active .cw-pseudo-icon {\n display: none; }\n\n.cw-pseudo.open .cw-pseudo-content {\n display: inline-block; }\n\n.cw-pseudo.open .cw-pseudo-item {\n display: inline-block; }\n\n.cw-pseudo.open .cw-pseudo-icon {\n display: none; }\n\n.cw-media .thumbnail img {\n max-height: 100px; }\n\n[id*=\"__lpform_input\"] {\n display: none !important; }\n"," ",'/**\n * Main wrapper\n */\n.select-search {\n position: relative;\n box-sizing: border-box; }\n\n.select-search *,\n.select-search *::after,\n.select-search *::before {\n box-sizing: inherit; }\n\n/**\n * Value wrapper\n */\n.select-search__value {\n position: relative;\n z-index: 1; }\n\n.select-search__value::after {\n content: \'\';\n display: inline-block;\n position: absolute;\n top: calc(50% - 7px);\n right: 19px;\n width: 9px;\n height: 9px; }\n\n/**\n * Input\n */\n.select-search__input {\n display: block;\n height: 30px;\n width: 100%;\n padding: 0 16px;\n background: #fff !important;\n border: 1px solid #7cb342;\n border-radius: 3px;\n outline: none;\n font-family: \'Noto Sans\', sans-serif;\n font-size: 14px;\n text-align: left;\n text-overflow: ellipsis;\n line-height: 36px;\n -webkit-appearance: none;\n margin: 0; }\n\n.select-search__input::-webkit-search-decoration,\n.select-search__input::-webkit-search-cancel-button,\n.select-search__input::-webkit-search-results-button,\n.select-search__input::-webkit-search-results-decoration {\n -webkit-appearance: none; }\n\n.select-search__input:not([readonly]):focus {\n cursor: initial; }\n\n/**\n * Options wrapper\n */\n.select-search__select {\n background: #fff;\n box-shadow: 0 0.0625rem 0.125rem rgba(0, 0, 0, 0.15); }\n\n/**\n * Options\n */\n.select-search__options {\n list-style: none; }\n\n/**\n * Option row\n */\n.select-search__row:not(:first-child) {\n border-top: 1px solid #eee; }\n\n/**\n * Option\n */\n.select-search__option {\n display: block;\n height: 36px;\n width: 100%;\n padding: 0 16px;\n background: #fff;\n border: none;\n outline: none;\n font-size: 14px;\n text-align: left;\n cursor: pointer; }\n\n.select-search--multiple .select-search__option {\n height: 48px; }\n\n.select-search__option.is-selected {\n background: #7cb342;\n color: #fff; }\n\n.select-search__option.is-highlighted,\n.select-search__option:not(.is-selected):hover {\n background: #f1f7eb; }\n\n.select-search__option.is-highlighted.is-selected,\n.select-search__option.is-selected:hover {\n background: #6fa13b;\n color: #fff; }\n\n/**\n * Group\n */\n.select-search__group-header {\n font-size: 10px;\n text-transform: uppercase;\n background: #f7f7f7;\n padding: 6px 16px;\n position: sticky;\n top: 0;\n box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2); }\n\n/**\n * States\n */\n.select-search.is-disabled {\n opacity: 0.5; }\n\n.select-search.is-loading .select-search__value::after {\n background-image: url("data:image/svg+xml,%3Csvg xmlns=\'http://www.w3.org/2000/svg\' width=\'50\' height=\'50\' viewBox=\'0 0 50 50\'%3E%3Cpath fill=\'%232F2D37\' d=\'M25,5A20.14,20.14,0,0,1,45,22.88a2.51,2.51,0,0,0,2.49,2.26h0A2.52,2.52,0,0,0,50,22.33a25.14,25.14,0,0,0-50,0,2.52,2.52,0,0,0,2.5,2.81h0A2.51,2.51,0,0,0,5,22.88,20.14,20.14,0,0,1,25,5Z\'%3E%3CanimateTransform attributeName=\'transform\' type=\'rotate\' from=\'0 25 25\' to=\'360 25 25\' dur=\'0.6s\' repeatCount=\'indefinite\'/%3E%3C/path%3E%3C/svg%3E");\n background-size: 11px; }\n\n.select-search:not(.is-disabled) .select-search__input {\n cursor: pointer; }\n\n/**\n * Modifiers\n */\n.select-search--multiple {\n border-radius: 3px;\n overflow: hidden; }\n\n.select-search:not(.is-loading):not(.select-search--multiple) .select-search__value::after {\n transform: rotate(45deg);\n border-right: 2px solid #555;\n border-bottom: 2px solid #555;\n pointer-events: none; }\n\n.select-search--multiple .select-search__input {\n cursor: initial; }\n\n.select-search--multiple .select-search__input {\n border-radius: 3px 3px 0 0; }\n\n.select-search--multiple:not(.select-search--search) .select-search__input {\n cursor: default; }\n\n.select-search:not(.select-search--multiple) .select-search__input:hover {\n border-color: #7cb342; }\n\n.select-search:not(.select-search--multiple) .select-search__select {\n z-index: 2;\n top: 38px;\n right: 0;\n left: 0;\n border-radius: 3px;\n overflow: auto;\n max-height: 360px;\n border: 1px solid #7cb342; }\n\n.select-search--multiple .select-search__select {\n position: relative;\n overflow: auto;\n max-height: 260px;\n border-top: 1px solid #eee;\n border-radius: 0 0 3px 3px; }\n\n.select-search.horizontal .select-search__value {\n display: none; }\n\n.select-search.horizontal .select-search__select {\n top: 0;\n box-shadow: none; }\n\n.select-search.horizontal .select-search__options {\n display: flex; }\n\n.select-search.horizontal .select-search__option {\n height: 28px;\n position: relative;\n text-align: center;\n padding: 0 10px; }\n\n.select-search.horizontal .select-search__row {\n flex: 1; }\n .select-search.horizontal .select-search__row:not(:first-child) {\n border-top: none; }\n\n.select-search__row[data-value="italic"] .select-search__option {\n font-style: italic; }\n\n.select-search__row[data-value="overline"] .select-search__option {\n text-decoration: overline; }\n\n.select-search__row[data-value="underline"] .select-search__option {\n text-decoration: underline; }\n\n.select-search__row[data-value="line-through"] .select-search__option {\n text-decoration: line-through; }\n\n.cw-border .select-search__row .select-search__option:after {\n content: \'\';\n position: absolute;\n top: 50%;\n left: 15%;\n width: 70%; }\n\n.cw-border .select-search__row[data-value="solid"] .select-search__option:after {\n border-top: 2px solid #000; }\n\n.cw-border .select-search__row[data-value="dotted"] .select-search__option:after {\n border-top: 2px dotted #000; }\n\n.cw-border .select-search__row[data-value="dashed"] .select-search__option:after {\n border-top: 2px dashed #000; }\n\n.font-weight .select-search__row[data-value="100"] .select-search__option {\n font-weight: 100; }\n\n.font-weight .select-search__row[data-value="200"] .select-search__option {\n font-weight: 200; }\n\n.font-weight .select-search__row[data-value="300"] .select-search__option {\n font-weight: 300; }\n\n.font-weight .select-search__row[data-value="400"] .select-search__option {\n font-weight: 400; }\n\n.font-weight .select-search__row[data-value="500"] .select-search__option {\n font-weight: 500; }\n\n.font-weight .select-search__row[data-value="600"] .select-search__option {\n font-weight: 600; }\n\n.font-weight .select-search__row[data-value="700"] .select-search__option {\n font-weight: 700; }\n\n.font-weight .select-search__row[data-value="800"] .select-search__option {\n font-weight: 800; }\n\n.font-weight .select-search__row[data-value="900"] .select-search__option {\n font-weight: 900; }\n'))}var St,Ct=!1,_t=!1,jt=!1;function Pt(e,t){St=t.origin,!0!==jt&&!0!==_t&&(_t=!0,q.addFromString(Ct.getValue()),setTimeout((function(){_t=!1}),100))}function Nt(){var e=E(q).allOutputs,t=E(L).currentPage;return w.emit("textarea-ready",{textAreaId:"cw-code-editor"}),React.createElement("textarea",{id:"cw-code-editor",defaultValue:e[t]})}function zt(){var e=g(React.useState("editor"),2),t=e[0],n=e[1],r=g(React.useState({show:!1,style:{content:{top:0},arrow:{right:0}}}),2),o=r[0],a=r[1],i=E(L),c=i.previewObject,l=i.mounted,u=[{type:"global",name:"global",title:"All Pages"}];"pages"in c&&(c.pages.is_home&&u.push({type:"template",name:"is_home",title:"Blog Post List Page"}),c.pages.is_front_page&&u.push({type:"template",name:"is_front_page",title:"Front Page"}),c.pages.is_single&&(u.push({type:"template",name:"is_single",title:"All Single Posts"}),u.push({type:"single",name:c.page.id,title:"Post: ".concat(c.page.title)})),c.pages.is_page&&(u.push({type:"template",name:"is_page",title:"All Single Pages"}),u.push({type:"single",name:c.page.id,title:"Page: ".concat(c.page.title)})));var p=L.get().currentPage,d="All Pages";for(var f in u)if(u.hasOwnProperty(f)&&u[f].name===p){d=u[f].title;break}return React.createElement("div",{className:"cw-panel"},React.createElement("div",{className:"cw-panel-heading cw-row"},React.createElement("div",{className:"col-5"},React.createElement("span",null,"Editing Styles for: ")),React.createElement("div",{className:"col-5"},React.createElement("button",{className:"button button-block cw-current-page",onClick:function(e){var t=e.target.getBoundingClientRect(),n=t.bottom-e.target.offsetParent.getBoundingClientRect().top;a((function(e){return{show:!e.show,style:{content:{top:"".concat(n+10,"px")},arrow:{left:"".concat(t.left+t.width/2-7,"px")}}}}))},type:"button"},d),React.createElement("div",{className:"popup-overlay ".concat(o.show?"":"hidden"),onClick:function(){return a((function(e){return s({},e,{show:!1})}))}}),React.createElement("div",{className:"page-selector popup-content ".concat(o.show?"":"hidden"),style:o.style.content},React.createElement("div",{className:"popup-arrow",style:o.style.arrow}),u.map((function(e){return React.createElement("button",{key:e.name,onClick:function(t){return function(e,t){L.changePage(t.name,t.type),a((function(e){return s({},e,{show:!1})}))}(0,e)},className:"button button-block",type:"button"},e.title)})))),React.createElement("div",{className:"col-2"},React.createElement("button",{className:"button cw-pause",onClick:function(){te()},type:"button"},React.createElement("span",{className:"dashicons dashicons-controls-".concat(l?"pause":"play")})))),React.createElement("div",{className:"panel-main"},React.createElement("div",{className:"cw-tabs"},React.createElement("div",{className:"editor-tab tab"+("editor"===t?" active":""),onClick:function(){return n("editor")}},"Visual Editor"),React.createElement("div",{className:"code-tab tab"+("code"===t?" active":""),onClick:function(){return n("code")}},"Code Editor")),React.createElement("div",{className:"tab-content cw-editor"+("editor"!==t?" hidden":"")},React.createElement(Rt,null)),React.createElement("div",{className:"tab-content cw-code-editor"+("code"!==t?" hidden":"")},React.createElement(Nt,null))))}function Mt(){return React.createElement("div",{id:"cw-canvas"},React.createElement("style",{type:"text/css"},"#color-wings {\n margin-left: -12px;\n margin-right: -12px; }\n\n[style=\"display: none;\"] + #color-wings {\n margin-top: -15px; }\n\n.cw-row {\n display: flex; }\n .cw-row .col {\n flex: 1; }\n .cw-row .col-1 {\n flex: 0 0 8.33333%; }\n .cw-row .col-2 {\n flex: 0 0 16.66667%; }\n .cw-row .col-3 {\n flex: 0 0 25%; }\n .cw-row .col-4 {\n flex: 0 0 33.33333%; }\n .cw-row .col-5 {\n flex: 0 0 41.66667%; }\n .cw-row .col-6 {\n flex: 0 0 50%; }\n .cw-row .col-7 {\n flex: 0 0 58.33333%; }\n .cw-row .col-8 {\n flex: 0 0 66.66667%; }\n .cw-row .col-9 {\n flex: 0 0 75%; }\n .cw-row .col-10 {\n flex: 0 0 83.33333%; }\n .cw-row .col-11 {\n flex: 0 0 91.66667%; }\n .cw-row .col-12 {\n flex: 0 0 100%; }\n\n.cw-panel-heading {\n padding: 10px;\n align-items: center;\n position: relative; }\n .cw-panel-heading .popup-content {\n width: 100%;\n box-sizing: border-box;\n position: absolute;\n z-index: 5;\n background: #fff;\n right: 0;\n border: 1px solid #ccc; }\n .cw-panel-heading .popup-overlay {\n position: fixed;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0; }\n .cw-panel-heading .popup-arrow {\n width: 14px;\n height: 14px;\n background: white;\n position: absolute;\n right: 100px;\n top: -6px;\n transform: rotate(135deg);\n z-index: -1;\n box-shadow: rgba(0, 0, 0, 0.3) -1px 1px 1px; }\n .cw-panel-heading .cw-current-page {\n max-height: 30px;\n white-space: pre-wrap;\n overflow: auto; }\n .cw-panel-heading .page-selector .button {\n border-color: transparent;\n background: none;\n padding: 10px 20px; }\n .cw-panel-heading .page-selector .button:focus {\n border-color: #0071a1; }\n .cw-panel-heading .cw-pause {\n margin: 0 0 0 auto;\n display: block;\n line-height: 1; }\n\n.button.button-block {\n width: 100%;\n text-align: center; }\n\n.cw-tabs {\n display: flex;\n margin: 0 -1px;\n position: relative;\n z-index: 2; }\n .cw-tabs .tab {\n flex: 1;\n padding: 8px;\n background: #ddd;\n border: 1px solid transparent;\n border-bottom-color: #ccc;\n cursor: pointer;\n text-align: center; }\n .cw-tabs .tab.active {\n border: 1px solid #ccc;\n border-bottom-color: #fff;\n background: #fff;\n cursor: auto; }\n\n#cw-code-editor {\n width: 100%; }\n\n.cw-code-editor .CodeMirror {\n height: calc( 100vh - 255px);\n margin-bottom: -22px;\n overflow: hidden; }\n\n.customize-control .cw-link-wrap {\n background: #fff;\n padding: 6px 10px;\n cursor: pointer;\n border-left: 2px solid transparent;\n transition: all .15s ease-in-out, border-color .15s ease-in-out, background .15s ease-in-out;\n box-shadow: 0 0 0 1px #ddd;\n position: relative; }\n .customize-control .cw-link-wrap:hover {\n color: #0073aa;\n background: #f3f3f5;\n border-left: 2px solid #0073aa; }\n .customize-control .cw-link-wrap:hover:after {\n color: #0073aa; }\n .customize-control .cw-link-wrap:after {\n content: '\\f345';\n font: normal 16px/1 dashicons;\n color: #a0a5aa;\n position: absolute;\n right: 6px;\n top: calc(50% - 8px); }\n\n.customize-control .cw-link-text {\n position: absolute;\n right: 26px;\n top: calc(50% - 9px);\n font-size: 11px; }\n"),React.createElement(zt,null))}q.subscribe((function(){jt=!0,!0!==_t&&Ct.getDoc().setValue(q.get().allOutputs[L.get().currentPage]),"setValue"===St&&Ct.autoFormatRange({line:0,ch:0},{line:Ct.lineCount()}),setTimeout((function(){jt=!1}),100)})),w.on("textarea-ready",(function(e){if(!1===Ct){var t={indentUnit:2,indentWithTabs:!0,inputStyle:"contenteditable",lineNumbers:!0,autoRefresh:!0,lineWrapping:!0,styleActiveLine:!0,continueComments:!0,extraKeys:{"Ctrl-Space":"autocomplete","Ctrl-/":"toggleComment","Cmd-/":"toggleComment","Alt-F":"findPersistent","Ctrl-F":"findPersistent","Cmd-F":"findPersistent"},direction:"ltr",gutters:[],mode:"text/css",lint:!1,autoCloseBrackets:!0,autoCloseTags:!0,matchTags:{bothTags:!0},tabSize:2,matchBrackets:!0,jshint:{}};(0,g(P(!("undefined"==typeof wp||!wp.hasOwnProperty("CodeMirror"))),1)[0])((function(){(Ct=wp.CodeMirror.fromTextArea(document.getElementById(e.textAreaId),t)).on("change",Pt),Ct.showHint&&Ct.on("keyup",(function(e,t){var n,r,o,a,i=/^[a-zA-Z]$/.test(t.key);Ct.state.completionActive&&i||"string"!==(a=Ct.getTokenAt(Ct.getCursor())).type&&"comment"!==a.type&&(o=wp.CodeMirror.innerMode(Ct.getMode(),a.state).mode.name,r=Ct.doc.getLine(Ct.doc.getCursor().line).substr(0,Ct.doc.getCursor().ch),"css"===o&&(n=i||":"===t.key||" "===t.key&&/:\s+$/.test(r)),n&&Ct.showHint({completeSingle:!1}))}))}))}})),wp.customize.controlConstructor["color-wings"]=wp.customize.Control.extend({ready:function(){var e=this;cw.Evt.emit("colorwings-will-mount",e),ReactDOM.render(React.createElement(Mt,null),document.getElementById("color-wings")),wp.customize.section("extra_styles",(function(e){e.expanded.bind((function(e){te(!!e)}))})),wp.customize.state("previewedDevice").bind(G),cw.Evt.on("update-control",(function(t){console.log(t),e.setting.set(t)}))}}),wp.customize.controlConstructor["cw-link"]=wp.customize.Control.extend({ready:function(){var e=this;this.container[0].addEventListener("click",(function(){cw.Evt.emit("focusUnlocked"),wp.customize.control("color_wings").focus(),cw.Evt.emit("select-element",e.params.options.selector)}))}})}(React); +e.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var a=t[r]={i:r,l:!1,exports:{}};return e[r].call(a.exports,a,a.exports,n),a.l=!0,a.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)n.d(r,a,function(t){return e[t]}.bind(null,a));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t,n){function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var a=n(1),o=n(7),i=o.get,c=(o.deepValue,o.isArray),l=function(){function e(t,n){var r=n.location,a=void 0===r?0:r,o=n.distance,c=void 0===o?100:o,l=n.threshold,s=void 0===l?.6:l,u=n.maxPatternLength,p=void 0===u?32:u,d=n.caseSensitive,h=void 0!==d&&d,f=n.tokenSeparator,m=void 0===f?/ +/g:f,g=n.findAllMatches,v=void 0!==g&&g,b=n.minMatchCharLength,y=void 0===b?1:b,w=n.id,x=void 0===w?null:w,k=n.keys,E=void 0===k?[]:k,O=n.shouldSort,R=void 0===O||O,C=n.getFn,_=void 0===C?i:C,S=n.sortFn,j=void 0===S?function(e,t){return e.score-t.score}:S,N=n.tokenize,P=void 0!==N&&N,z=n.matchAllTokens,T=void 0!==z&&z,M=n.includeMatches,L=void 0!==M&&M,A=n.includeScore,q=void 0!==A&&A,I=n.verbose,F=void 0!==I&&I;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.options={location:a,distance:c,threshold:s,maxPatternLength:p,isCaseSensitive:h,tokenSeparator:m,findAllMatches:v,minMatchCharLength:y,id:x,keys:E,includeMatches:L,includeScore:q,shouldSort:R,getFn:_,sortFn:j,verbose:F,tokenize:P,matchAllTokens:T},this.setCollection(t),this._processKeys(E)}var t;return(t=[{key:"setCollection",value:function(e){return this.list=e,e}},{key:"_processKeys",value:function(e){if(this._keyWeights={},this._keyNames=[],e.length&&"string"==typeof e[0])for(var t=0,n=e.length;t1)throw new Error('"weight" property in key must bein the range of [0, 1)');this._keyWeights[l]=s,a+=s}if(a>1)throw new Error("Total of weights cannot exceed 1")}}},{key:"search",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{limit:!1};this._log('---------\nSearch pattern: "'.concat(e,'"'));var n=this._prepareSearchers(e),r=n.tokenSearchers,a=n.fullSearcher,o=this._search(r,a);return this._computeScore(o),this.options.shouldSort&&this._sort(o),t.limit&&"number"==typeof t.limit&&(o=o.slice(0,t.limit)),this._format(o)}},{key:"_prepareSearchers",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=[];if(this.options.tokenize)for(var n=e.split(this.options.tokenSeparator),r=0,o=n.length;r0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0,n=this.list,r={},a=[];if("string"==typeof n[0]){for(var o=0,i=n.length;o-1&&(j=(j+s)/2),n._log("Score average:",j);var N=!n.options.tokenize||!n.options.matchAllTokens||u>=p.length;if(n._log("\nCheck Matches: ".concat(N)),(l||h.isMatch)&&N){var P={key:r,arrayIndex:t,value:a,score:j};n.options.includeMatches&&(P.matchedIndices=h.matchedIndices);var z=f[i];z?z.output.push(P):(f[i]={item:o,output:[P]},g.push(f[i]))}}else if(c(a))for(var T=0,M=a.length;T0?Number.EPSILON:u.score;l*=Math.pow(h,d)}o.score=l,this._log(o)}}},{key:"_sort",value:function(e){this._log("\n\nSorting...."),e.sort(this.options.sortFn)}},{key:"_format",value:function(e){var t=[];if(this.options.verbose){var n=[];this._log("\n\nOutput:\n\n",JSON.stringify(e,(function(e,t){if("object"===r(t)&&null!==t){if(-1!==n.indexOf(t))return;n.push(t)}return t}),2)),n=null}var a=[];this.options.includeMatches&&a.push((function(e,t){var n=e.output;t.matches=[];for(var r=0,a=n.length;r-1&&(i.arrayIndex=o.arrayIndex),t.matches.push(i)}}})),this.options.includeScore&&a.push((function(e,t){t.score=e.score}));for(var o=0,i=e.length;ol)return r(e,this.pattern,s);var u=this.options,p=u.location,d=u.distance,h=u.threshold,f=u.findAllMatches,m=u.minMatchCharLength;return a(e,this.pattern,this.patternAlphabet,{location:p,distance:d,threshold:h,findAllMatches:f,minMatchCharLength:m,includeMatches:o})}}])&&function(e,t){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:/ +/g,a=new RegExp(t.replace(n,"\\$&").replace(r,"|")),o=e.match(a),i=!!o,c=[];if(i)for(var l=0,s=o.length;l=M;q-=1){var I=q-1,F=n[e.charAt(I)];if(F&&(E[I]=1),A[q]=(A[q+1]<<1|1)&F,0!==P&&(A[q]|=(_[q+1]|_[q])<<1|1|_[q+1]),A[q]&N&&(S=r(t,{errors:P,currentLocation:I,expectedLocation:b,distance:s}))<=w){if(w=S,(x=I)<=b)break;M=Math.max(1,2*b-x)}}if(r(t,{errors:P+1,currentLocation:b,expectedLocation:b,distance:s})>w)break;_=A}var D={isMatch:x>=0,score:0===S?.001:S};return v&&(D.matchedIndices=a(E,m)),D}},function(e,t){e.exports=function(e,t){var n=t.errors,r=void 0===n?0:n,a=t.currentLocation,o=void 0===a?0:a,i=t.expectedLocation,c=void 0===i?0:i,l=t.distance,s=void 0===l?100:l,u=r/e.length,p=Math.abs(c-o);return s?u+p/s:p?1:u}},function(e,t){e.exports=function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=[],r=-1,a=-1,o=0,i=e.length;o=t&&n.push([r,a]),r=-1)}return e[o-1]&&o-r>=t&&n.push([r,o-1]),n}},function(e,t){e.exports=function(e){for(var t={},n=e.length,r=0;rxe(xe({},e),{},{index:t}))}(e,t,n)}function Re(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ce(e){for(var t=1;t{}),getOptions:l=null,allowEmpty:s=!0,closeOnSelect:u=!0,closable:p=!0}){const d=e.useRef(null),h=e.useMemo(()=>function(e){if(!Array.isArray(e))return[];const t=[];return e.forEach((e,n)=>{if("type"in e&&"group"===e.type){const r=e.name.replace(/\s+/g,"-").toLowerCase()+"-"+n;e.items.forEach(n=>{t.push(de(de({},n),{},{groupId:r,groupName:e.name,_id:""+n.value}))})}else t.push(de(de({},e),{},{_id:""+e.value,index:n}))}),t}(i),[i]),[f,m]=e.useState({flat:[],addedOptions:[],value:t,search:"",focus:!1,searching:!1,highlighted:-1,changed:!1}),{flat:g,addedOptions:v,value:b,search:y,focus:w,searching:x,highlighted:k}=f,E=e.useMemo(()=>{let e=ve(b,[...h,...v]);return e||s||r||([e]=h),e},[b,h,v,s,r]),O=e.useMemo(()=>ge(g),[g]),R=e.useMemo(()=>function(e){return e&&"object"==typeof e?Array.isArray(e)?e.map(e=>e.name).join(", "):e.name:""}(E),[E]),C=e.useCallback(()=>{m(e=>Ce(Ce({},e),{},{focus:!1,search:"",flat:h,highlighted:-1})),d.current&&d.current.blur()},[h,d]),_=e=>m(t=>Ce(Ce({},t),{},{focus:e})),S=e.useCallback(e=>{m(t=>{const{flat:n,highlighted:a}=t,o=e?n.find(t=>t.value==e):n[a];if(!o)return t;const i=function(e,t,n){if(!n)return e;if(!t)return[e];const r=Array.isArray(t)?[...t]:[t],a=r.findIndex(t=>t===e);return a>=0?r.splice(a,1):r.push(e),r}(o.value,t.value,r),c=ve(i,n);return Ce(Ce({},t),{},{addedOptions:r?c:[c],value:i,changed:[i,c]})})},[r]),j=e.useCallback(e=>{u||e.preventDefault(),S(e.currentTarget.value)},[S,u]),N=e.useCallback(e=>{const{key:t}=e;"ArrowDown"!==t&&"ArrowUp"!==t||(e.preventDefault(),m(e=>Ce(Ce({},e),{},{highlighted:ue(e.highlighted,{key:t,options:e.flat})})))},[]),P=e.useCallback(({key:e})=>{"Enter"===e&&(S(),p&&u&&C())},[S,u,C,p]),z=e.useCallback(({key:e})=>{"Escape"===e&&C()},[C]),T={tabIndex:"0",readOnly:!a,onChange:a?({target:e})=>{const{value:t}=e,n={search:t};let r=h;l&&t.length&&(n.searching=!0,r=l(t)),m(e=>Ce(Ce({},e),n)),Promise.resolve(r).then(e=>{let n=e;t.length&&(n=Oe(t,e,o)),m(t=>Ce(Ce({},t),{},{flat:!1===n?e:n,searching:!1}))}).catch(()=>m(e=>Ce(Ce({},e),{},{flat:h,searching:!1})))}:null,disabled:n,onMouseDown:()=>_(!w),onBlur:C,onFocus:()=>_(!0),onKeyPress:P,onKeyDown:N,onKeyUp:z,ref:d},M=e.useMemo(()=>({tabIndex:"-1",onMouseDown:j,onKeyDown:N,onKeyPress:P,onBlur:C}),[j,N,P,C]);return e.useEffect(()=>{m(e=>Ce(Ce({},e),{},{value:t}))},[t]),e.useEffect(()=>{m(e=>Ce(Ce({},e),{},{flat:h}))},[h]),e.useEffect(()=>{!1!==f.changed&&(m(e=>Ce(Ce({},e),{},{changed:!1})),c(...f.changed))},[f.changed,c]),[{value:E,highlighted:k,options:O,disabled:n,displayValue:R,focus:w,search:y,searching:x},T,M,e=>m(t=>Ce(Ce({},t),{},{value:e}))]}const je=t.shape({name:t.string.isRequired,value:t.oneOfType([t.string,t.number]).isRequired});t.oneOfType([je,t.shape({name:t.string.isRequired,type:t.string.isRequired,items:t.arrayOf(je)})]),t.oneOfType([t.object,t.arrayOf(t.object)]),t.oneOfType([t.string,t.func]);function Ne(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Pe(e){for(var t=1;t=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}const Me=e=>{let{optionProps:t,highlighted:r,selected:a,cls:o,renderOption:i}=e,c=Te(e,["optionProps","highlighted","selected","cls","renderOption"]);const l=[o("option"),!!a&&o("is-selected"),!!r&&o("is-highlighted")].filter(e=>!!e).join(" "),s=Pe(Pe({},t),{},{value:c.value,disabled:c.disabled});return n.createElement("li",{className:o("row"),role:"menuitem","data-index":c.index,"data-value":escape(c.value),key:c.value},i(s,c,{selected:a,highlighted:r},l))};Me.defaultProps={disabled:!1,index:null,value:null},Me.propTypes={};var Le=e.memo(Me);function Ae(){return(Ae=Object.assign||function(e){for(var t=1;t{const x=e.useRef(null),[k,E,O]=Se({options:s,value:t,multiple:o,disabled:r,fuse:y,search:i,onChange:p,getOptions:b,closeOnSelect:h,closable:!o||"on-focus"===d,allowEmpty:!!a}),{focus:R,highlighted:C,value:_,options:S,searching:j,displayValue:N,search:P}=k,z=e.useCallback(e=>"function"==typeof f?f(e):0===e.indexOf("container")?e.replace("container",f):0===e.indexOf("is-")||0===e.indexOf("has-")?e:f.split(" ")[0]+"__"+e,[f]),T=[z("container"),!!r&&z("is-disabled"),!!j&&z("is-loading"),!!R&&z("has-focus")].filter(e=>!!e).join(" "),M=R&&i?P:N;let L;switch(e.useEffect(()=>{const{current:e}=x;if(!e||o||C<0&&!_)return;const t=C>-1?'[data-index="'+C+'"]':'[data-value="'+escape(_.value)+'"]',n=e.querySelector(t);if(n){const t=e.getBoundingClientRect(),r=n.getBoundingClientRect();e.scrollTop=n.offsetTop-t.height/2+r.height/2}},[R,_,C,x,o]),d){case"never":L=!1;break;case"always":L=!0;break;case"on-focus":L=R;break;default:L=!r&&(R||o)}return n.createElement("div",{ref:w,className:T,id:u},(!o||a||i)&&n.createElement("div",{className:z("value")},m(Ie(Ie({},E),{},{placeholder:a,autoFocus:c,autoComplete:l,value:M}),k,z("input"))),L&&n.createElement("div",{className:z("select"),ref:x},n.createElement("ul",{className:z("options")},S.map(e=>{const t="group"===e.type,r=t?e.items:[e],a={cls:z,optionProps:O,renderOption:g},o=r.map(e=>{return n.createElement(Le,Ae({key:e.value,selected:(t=e,r=_,!!r&&(Array.isArray(r)?r.findIndex(e=>e.value===t.value)>=0:r.value===t.value)),highlighted:C===e.index},a,e));var t,r});return t?n.createElement("li",{role:"none",className:z("row"),key:e.groupId},n.createElement("div",{className:z("group")},n.createElement("div",{className:z("group-header")},v(e.name)),n.createElement("ul",{className:z("options")},o))):o}))))});De.defaultProps={className:"select-search",disabled:!1,search:!1,multiple:!1,placeholder:null,id:null,autoFocus:!1,autoComplete:"on",value:"",onChange:()=>{},printOptions:"auto",closeOnSelect:!0,renderOption:(e,t,r,a)=>n.createElement("button",Ae({className:a},e),t.name),renderGroupHeader:e=>e,renderValue:(e,t,r)=>n.createElement("input",Ae({},e,{className:r})),fuse:{keys:["name","groupName"],threshold:.3},getOptions:null},De.propTypes={};var Be=e.memo(De);function We(e){var t=e.options,n=t;if(!Array.isArray(t)||0===t.length)return null;"object"!==r(t[0])&&(n=t.map((function(e){return{name:e,value:e}})));var a=u({search:!1,printOptions:"auto"},e),o={options:n,value:e.val,name:e.name,onChange:e.onChange,search:a.search,printOptions:a.printOptions,className:a.horizontal?"select-search horizontal":"select-search",renderOption:function(e,t,n,r){return React.createElement("button",l({className:r},e,{type:"button"}),t.name)}};return"object"===r(t[0])&&"clsName"in t[0]&&(o.renderOption=function(e,t,n,r){return React.createElement("button",l({},e,{className:r,type:"button"}),React.createElement("span",{className:"clsName"in t?t.clsName:""},React.createElement("span",null,t.name)))}),"renderOption"in a&&(o.renderOption=a.renderOption),React.createElement("div",{className:"cw-control-content cw-select"},React.createElement("span",{className:"cw-control-title"},e.label," "),React.createElement(Be,o))}function He(e){var t=["0px","0px","0px","0px","#000000"];if("none"!==e.val)if(isNaN(e.val.charAt(0))){var n=e.val.split(/ (?![^\(]*\))/);t=[n[1],n[2],n[3],n[4],n[0]]}else t=e.val.split(" ");var r=g(React.useState(t),2),a=r[0],o=r[1];return React.createElement("div",{className:"cw-control-content border"},e.label&&React.createElement("span",{className:"cw-control-title"},e.label),React.createElement("span",{className:"cw-control-title"},"X Offset"),React.createElement(ie,{val:a[0],tab:0,hidden:!1,handleChange:function(t,n){o((function(e){return e[0]=n,e})),e.onChange(a.join(" "))}}),React.createElement("span",{className:"cw-control-title"},"Y Offset"),React.createElement(ie,{val:a[1],tab:0,hidden:!1,handleChange:function(t,n){o((function(e){return e[1]=n,e})),e.onChange(a.join(" "))}}),React.createElement("span",{className:"cw-control-title"},"Blur Radius"),React.createElement(ie,{val:a[2],tab:0,hidden:!1,handleChange:function(t,n){o((function(e){return e[2]=n,e})),e.onChange(a.join(" "))}}),React.createElement("span",{className:"cw-control-title"},"Spread Radius"),React.createElement(ie,{val:a[3],tab:0,hidden:!1,handleChange:function(t,n){o((function(e){return e[3]=n,e})),e.onChange(a.join(" "))}}),React.createElement(se,{val:a[4],onChange:function(t){o((function(e){return e[4]=t,e})),e.onChange(a.join(" "))},label:"Color"}))}function Ve(e){var t={tab:0,values:[["0px","none","#000000"],["0px","none","#000000"],["0px","none","#000000"],["0px","none","#000000"],["0px","none","#000000"]]};"borderTopWidth"in e.val&&(t.values=[[e.val.borderTopWidth,e.val.borderTopStyle,e.val.borderTopColor],[e.val.borderTopWidth,e.val.borderTopStyle,e.val.borderTopColor],[e.val.borderRightWidth,e.val.borderRightStyle,e.val.borderRightColor],[e.val.borderBottomWidth,e.val.borderBottomStyle,e.val.borderBottomColor],[e.val.borderLeftWidth,e.val.borderLeftStyle,e.val.borderLeftColor]]);var n=g(React.useState(t),2),r=n[0],a=n[1],o=React.createElement("div",{className:"cw-tabs"},[0,1,2,3,4].map((function(e){return React.createElement("div",{key:e,className:"tab tab-".concat(e," ").concat(0===e?"active":""),onClick:function(t){return function(e,t){e.currentTarget.parentNode.childNodes.forEach((function(e){return e.classList.remove("active")})),e.currentTarget.classList.add("active"),a((function(e){return u(u({},e),{},{tab:t})}))}(t,e)}},React.createElement(ce,{tab:e,subType:"border"}))}))),i=r.tab,c=r.values,l=React.createElement("div",{className:"cw-tab-wrap"},React.createElement(ie,{val:c[i][0],tab:0,hidden:!1,handleChange:function(t,n){a((function(e){return e.values[i][0]=n,e})),e.onChange(c,i)}}),React.createElement(se,{val:c[i][2],onChange:function(t){a((function(e){return e.values[i][2]=t,e})),e.onChange(c,i)},label:"Color"}),React.createElement(We,{options:[{name:"x",value:"none"},{name:"",value:"solid"},{name:"",value:"dotted"},{name:"",value:"dashed"}],val:c[i][1],onChange:function(t){a((function(e){return e.values[i][1]=t,e})),e.onChange(c,i)},printOptions:"always",horizontal:"true",label:"Style"}));return React.createElement("div",{className:"cw-control-content cw-border"},e.label&&React.createElement("span",{className:"cw-control-title"},e.label),o,l)}function $e(e){var t=e.selectors,n=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];!0===t?cw.Evt.emit("de-highlight-elements"):cw.Evt.emit("highlight-elements",e)},r=React.createElement("span",{className:"dashicons dashicons-arrow-right-alt"});return React.createElement("div",{id:"cw-quick-select"},React.createElement("div",{className:"cw-panel-title"},React.createElement("span",null,"No Element Selected.")),React.createElement("div",{className:"cw-qs-content"},React.createElement("div",{className:"cw-qs-title"},"Click on any element to edit the styles ",r,React.createElement("br",null),"OR",React.createElement("br",null),"Quick select an Element below"),React.createElement("ul",{className:"cw-qs-btns"},t.map((function(e){return React.createElement("li",{key:e.name,className:"cw-qs-btn",onClick:function(){return function(e){cw.Evt.emit("select-element",e)}(e.sel)},onMouseEnter:function(){return n(e.sel,!1)},onMouseLeave:n},e.name)})))))}function Ue(){var e=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"open";"add"===t?e.classList.add(n):e.classList.remove(n)},t=g(React.useState(["hover","focus","active","visited"]),2),n=t[0],r=t[1],a=function(t){var a=t.target.innerText;L.get().currentPseudo===a?(L.togglePseudo(""),e(t.target.parentNode.parentNode,"","active")):(L.togglePseudo(a),n.indexOf(a)>0&&(n.splice(n.indexOf(a),1),n.unshift(a),r(n)),e(t.target.parentNode.parentNode),e(t.target.parentNode.parentNode,"add","active")),t.target.parentNode.childNodes.forEach((function(e){return e.classList.remove("selected")}))},o=""===L.get().currentPseudo?"":"active";return React.createElement("div",{className:"cw-pseudo ".concat(o),onMouseEnter:function(t){return e(t.currentTarget,"add")},onMouseLeave:function(t){return e(t.currentTarget)}},React.createElement("span",{className:"cw-pseudo-icon dashicons dashicons-menu-alt2"}),React.createElement("div",{className:"cw-pseudo-content"},n.map((function(e,t){return React.createElement("div",{key:t,className:"cw-pseudo-item",onClick:a},e)}))))}var Ke=wp.mediaUtils.MediaUpload;function Qe(e){var t=e.val;if("none"!==t){var n=v(t.matchAll(/(url)(?:\(['"]?)(.*?)(?:['"]?\))/g));n.length&&n[0].length>2&&(t=n[0][2])}var r=g(React.useState(t),2),a=r[0],o=r[1],i=function(t){o(t.url),e.onChange("url('".concat(t.url,"')"))};return React.createElement("div",{className:"cw-control-content cw-media"},e.label&&React.createElement("span",{className:"cw-control-title"},e.label),React.createElement("div",{className:"attachment-media-view"},"none"===a?React.createElement(Ke,{onSelect:i,allowedTypes:["image"],value:"",render:function(t){var n=t.open;return React.createElement("button",{type:"button",onClick:n,className:"upload-button button-add-media"},e.buttonText?e.buttonText:"Select Image")}}):React.createElement(React.Fragment,null,React.createElement("div",{className:"thumbnail thumbnail-image"},React.createElement("img",{className:"attachment-thumb",src:a})),React.createElement("div",{className:"actions"},React.createElement("button",{type:"button",onClick:function(){o("none"),e.onChange("none")},className:"button remove-button"},"Remove"),React.createElement(Ke,{onSelect:i,allowedTypes:["image"],value:"",render:function(t){var n=t.open;return React.createElement("button",{type:"button",onClick:n,className:"button upload-button"},e.changeText?e.changeText:"Change Image")}})))))}function Ze(){var e=cwControlObject.fonts,t=O(L),n=t.currentSelector,r=t.openSection,a=t.currentStyles,o=t.quickSelectors,i=t.selectorClass,c=g(React.useState({styleOptions:["normal","italic"],weightOptions:["100","200","300","400","500","600","700","800","900"]}),2),l=c[0],s=c[1],p=g(React.useState(!1),2),d=p[0],h=p[1];""!==n?setTimeout((function(){return h(!0)}),0):setTimeout((function(){return h(!1)}),0),React.useEffect((function(){s((function(e){return u(u({},e),{},{family:a.fontFamily,style:a.fontStyle,weight:a.fontWeight})}))}),[a]);var f=function(t){var n={family:t=t.replace(/^"(.+(?="$))"$/,"$1"),source:"system"};if(e.allFonts.system.hasOwnProperty(t))n.variants=e.defaults.variants,n.category=e.allFonts.system[t].category;else if(e.allFonts.google.hasOwnProperty(t)){var r=e.allFonts.google[t][0],a=e.allFonts.google[t][1];n.source="google",n.category=a,n.variants={},r[0].length>0&&(n.variants.normal=r[0]),r[1].length>0&&(n.variants.italic=r[1])}else t.includes("system-ui")&&(n.variants=e.defaults.variants,n.category="sans-serif");return"variants"in n||(n.variants={normal:["300"],italic:["300"]}),"category"in n||(n.category=t.includes("serif")?"serif":"sans-serif"),n},m=function(e,t){return t.reduce((function(t,n){return Math.abs(n-e)0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];e=(e=e||l.family).replace(/^"(.+(?="$))"$/,"$1");var a=f(e);t||(t=l.style,a.variants.hasOwnProperty(t)||(t=Object.keys(a.variants)[0])),r||(r=l.weight,-1===a.variants[t].indexOf(r)&&(r=m(r,a.variants[t]))),s({styleOptions:Object.keys(a.variants),weightOptions:a.variants[t],family:e,style:t,weight:r.toString()});var o={family:e,style:t,weight:r,source:a.source,category:a.category};L.addFont(o),q.addFont(),l.family!==e&&q.addStyleNow(n,"font-family",e),l.style!==t&&q.addStyleNow(n,"font-style",t),l.weight!==r&&q.addStyleNow(n,"font-weight",r)},b=[{id:"padding",title:"Padding",controls:[{property:"padding",Component:le,params:{subType:"padding",val:a.padding}}]},{id:"margin",title:"Margin",controls:[{property:"margin",Component:le,params:{subType:"margin",val:a.margin}}]},{id:"background",title:"Background",controls:[{property:"background",Component:se,params:{label:"Background Color",val:a.backgroundColor}},{property:"background-image",Component:Qe,params:{label:"Background Image",val:a.backgroundImage}},{property:"background-size",Component:We,params:{label:"Background Size",name:"background-size",options:[{name:"Auto",value:"auto"},{name:"Cover",value:"cover"},{name:"Contain",value:"contain"}],val:a.backgroundSize,printOptions:"always",horizontal:!0}}]},{id:"text",title:"Text",controls:[{property:"font-size",Component:le,params:{label:"Font Size",subType:"size",val:a.fontSize}},{property:"line-height",Component:le,params:{label:"Line Height",subType:"size",val:a.lineHeight}},{property:"font-family",Component:We,params:{label:"Font Family",name:"font-family",options:function(){var t=[];for(var n in e.allFonts){var r=n;"system"===n?r="System Fonts":"google"===n&&(r="Google Fonts");var a=[];for(var o in e.allFonts[n]){var i="Default"===o?"Default System Font":o;a.push({name:i,value:o})}t.push({type:"group",name:r,items:a})}return t}(),val:l.family,search:!0,onChange:function(e){return v(e,!1,!1)}}},{property:"color",Component:se,params:{label:"Font Color",val:a.color},cls:"col-8"},{property:"font-weight",Component:We,params:{label:"Font Weight",name:"font-weight",options:l.weightOptions,val:l.weight,onChange:function(e){return v(!1,!1,e)}},cls:"col-4"},{property:"font-style",Component:We,params:{label:"Font Style",name:"font-style",options:l.styleOptions,val:l.style,onChange:function(e){return v(!1,e,!1)},printOptions:"always",horizontal:!0},cls:"col-5"},{property:"text-align",Component:We,params:{label:"Text Align",name:"text-align",options:[{name:"",value:"left",clsName:"dashicons dashicons-editor-alignleft"},{name:"",value:"right",clsName:"dashicons dashicons-editor-alignright"},{name:"",value:"center",clsName:"dashicons dashicons-editor-aligncenter"},{name:"",value:"justify",clsName:"dashicons dashicons-editor-justify"}],val:a.textAlign,printOptions:"always",horizontal:!0},cls:"col-7"},{property:"text-decoration",Component:We,params:{label:"Text Decoration",name:"text-decoration",options:[{name:"A",value:"none"},{name:"O",value:"overline"},{name:"U",value:"underline"},{name:"S",value:"line-through"}],val:a.textDecoration,printOptions:"always",horizontal:!0},cls:"col-6"},{property:"text-transform",Component:We,params:{label:"Text Transform",name:"text-transform",options:[{name:"x",value:"none"},{name:"Aa",value:"capitalize"},{name:"aa",value:"lowercase"},{name:"AA",value:"uppercase"}],val:a.textTransform,printOptions:"always",horizontal:!0},cls:"col-6"},{property:"letter-spacing",Component:le,params:{label:"Letter Spacing",subType:"size",val:"normal"===a.letterSpacing?"0px":a.letterSpacing}},{property:"word-spacing",Component:le,params:{label:"Word Spacing",subType:"size",val:a.wordSpacing}},{property:"text-indent",Component:le,params:{label:"Text Indent",subType:"size",val:a.textIndent}}]},{id:"border",title:"Border",controls:[{property:"border-radius",Component:le,params:{label:"Border Radius",subType:"radius",val:a.borderRadius}},{property:"border",Component:Ve,params:{label:"Border Width",val:a,onChange:function(e,t){e.every((function(e,t,n){return e===n[0]}))||0===t?q.addStyleNow(n,"border","".concat(e[0][0]," ").concat(e[0][1]," ").concat(e[0][2])):(q.addStyleNow(n,"border-top","".concat(e[1][0]," ").concat(e[1][1]," ").concat(e[1][2])),q.addStyleNow(n,"border-right","".concat(e[2][0]," ").concat(e[2][1]," ").concat(e[2][2])),q.addStyleNow(n,"border-bottom","".concat(e[3][0]," ").concat(e[3][1]," ").concat(e[3][2])),q.addStyleNow(n,"border-left","".concat(e[4][0]," ").concat(e[4][1]," ").concat(e[4][2])))}}}]},{id:"size",title:"Size",controls:[{property:"width",Component:le,params:{label:"Width",subType:"size",val:a.width}},{property:"height",Component:le,params:{label:"Height",subType:"size",val:a.height}},{property:"min-width",Component:le,params:{label:"Min Width",subType:"size",val:a.minWidth}},{property:"min-height",Component:le,params:{label:"Min Height",subType:"size",val:a.minHeight}},{property:"max-width",Component:le,params:{label:"Max Width",subType:"size",val:a.maxWidth}},{property:"max-height",Component:le,params:{label:"Max Height",subType:"size",val:a.maxHeight}}]},{id:"shadow",title:"Shadow",controls:[{property:"box-shadow",Component:He,params:{val:a.boxShadow}}]},{id:"position",title:"Position",controls:[{property:"position",Component:We,params:{label:"Position",name:"position",options:[{name:"Relative",value:"relative"},{name:"Absolute",value:"absolute"},{name:"Static",value:"static"},{name:"Fixed",value:"fixed"},{name:"Sticky",value:"sticky"}],val:a.position,printOptions:"always",horizontal:!0}},{property:"top",Component:le,params:{label:"Top",subType:"size",val:a.top}},{property:"right",Component:le,params:{label:"Right",subType:"size",val:a.right}},{property:"bottom",Component:le,params:{label:"Bottom",subType:"size",val:a.bottom}},{property:"left",Component:le,params:{label:"Left",subType:"size",val:a.left}}]},{id:"others",title:"Others",controls:[{property:"display",Component:We,params:{label:"Display",name:"display",options:[{name:"block",value:"block"},{name:"none",value:"none"},{name:"flex",value:"flex"},{name:"grid",value:"grid"},{name:"inline",value:"inline"},{name:"inline-block",value:"inline-block"},{name:"inline-flex",value:"inline-flex"},{name:"inline-grid",value:"inline-grid"},{name:"contents",value:"contents"},{name:"inline-table",value:"inline-table"},{name:"list-item",value:"list-item"},{name:"run-in",value:"run-in"},{name:"table",value:"table"},{name:"table-caption",value:"table-caption"},{name:"table-column-group",value:"table-column-group"},{name:"table-header-group",value:"table-header-group"},{name:"table-footer-group",value:"table-footer-group"},{name:"table-row-group",value:"table-row-group"},{name:"table-cell",value:"table-cell"},{name:"table-column",value:"table-column"},{name:"table-row",value:"table-row"},{name:"initial",value:"initial"},{name:"inherit",value:"inherit"}],val:a.display},cls:"col-6"},{property:"visibility",Component:We,params:{label:"Visibility",name:"visibility",options:[{name:"",value:"Visible",clsName:"dashicons dashicons-visibility"},{name:"",value:"Hidden",clsName:"dashicons dashicons-hidden"}],val:a.visibility,printOptions:"always",horizontal:!0},cls:"col-6"},{property:"opacity",Component:le,params:{label:"Opacity",subType:"unitLess",val:a.opacity}}]}];b.forEach((function(e){e.controls.forEach((function(e){"onChange"in e.params||(e.params.onChange=function(t){q.addStyle(n,e.property,t)})}))}));var y=g(React.useState(n),2),w=y[0],x=y[1];React.useEffect((function(){return x(n)}),[n]);return React.createElement("div",{id:"cw-editor-wrap"},React.createElement("div",{id:"cw-editor-panel",className:"cw-panel"},""!==n?React.createElement(React.Fragment,null,React.createElement("div",{className:"cw-panel-title"},React.createElement("div",{className:"title-inner"},React.createElement("span",{className:"title-desc"},"You're editing:"),React.createElement("input",{type:"text",className:"selector ".concat(i),value:w,onChange:function(e){x(e.target.value),cw.Evt.emit("update-selector",e.target.value)}})),React.createElement(Ue,null)),React.createElement("div",{className:"cw-panel-main"},React.createElement("ul",{className:"cw-panel-sections"},b.map((function(e){return React.createElement("li",{key:e.id,className:"cw-panel-section ".concat(r===e.id?"open":"")},React.createElement("h3",{className:"cw-section-title",onClick:function(){return L.toggleSection(e.id)}},e.title),React.createElement("div",{className:"cw-section-content"},e.controls.map((function(t){return r===e.id?React.createElement("div",{key:t.property,className:"cw-control ".concat(t.property," ").concat(t.cls?t.cls:"")},d&&React.createElement(t.Component,t.params)):null}))))}))))):React.createElement($e,{selectors:o})),React.createElement("style",{type:"text/css"},"#cw-editor-wrap ul, #cw-editor-wrap li {\n list-style: none;\n margin: 0;\n padding: 0; }\n\n#cw-editor-wrap .cw-panel {\n background: #eee;\n font-size: 13px;\n color: #444; }\n\n#cw-editor-wrap .cw-panel-title {\n background: #fff;\n border-bottom: 1px solid #ddd;\n font-size: 13px;\n padding: 16px;\n color: #444;\n line-height: 16px;\n margin: 0; }\n #cw-editor-wrap .cw-panel-title * {\n box-sizing: border-box; }\n #cw-editor-wrap .cw-panel-title .title-inner {\n display: inline-flex;\n width: calc(100% - 54px); }\n #cw-editor-wrap .cw-panel-title .title-desc {\n padding: 3px 0;\n width: 90px; }\n #cw-editor-wrap .cw-panel-title .selector {\n background: #f2f8ec;\n border: 1px solid #7cb342;\n padding: 3px 5px;\n width: calc(100% - 90px);\n border-radius: 0;\n min-height: 24px;\n line-height: 1;\n font-size: 13px;\n background-image: none !important; }\n #cw-editor-wrap .cw-panel-title .selector:focus {\n box-shadow: none;\n border-color: #5b8230; }\n #cw-editor-wrap .cw-panel-title .selector.invalid, #cw-editor-wrap .cw-panel-title .selector.invalid:focus {\n border-color: #c78100; }\n\n#cw-editor-wrap .cw-panel-main {\n height: calc(100% - 41px);\n overflow-y: auto; }\n\n#cw-editor-wrap h3.cw-section-title {\n border-bottom: 1px solid #ddd;\n background: #fff;\n font-size: 14px;\n padding: 12px 16px;\n font-weight: 600;\n color: #444;\n line-height: 16px;\n margin: 0;\n cursor: pointer; }\n\n.cw-section-content {\n display: flex;\n flex-wrap: wrap;\n padding: 0 12px;\n max-height: 0;\n opacity: 0;\n overflow: auto;\n transition: max-height .2s ease, opacity .2s ease; }\n\n.cw-panel .open .cw-section-content {\n opacity: 1;\n max-height: 1000px;\n border-bottom: 1px solid #ddd; }\n\n.cw-control {\n flex-shrink: 0;\n width: 100%;\n margin-bottom: 12px;\n box-sizing: border-box; }\n .cw-control.padding, .cw-control.margin {\n margin-bottom: 0; }\n .cw-control.col-4 {\n width: 33.333%; }\n .cw-control.col-5 {\n width: 41.666%; }\n .cw-control.col-6 {\n width: 50%; }\n .cw-control.col-7 {\n width: 58.333%; }\n .cw-control.col-8 {\n width: 66.666%; }\n .cw-control .cw-tabs {\n margin: 0 -12px -1px -13px; }\n .cw-control .tab.active {\n border-bottom-color: #eee;\n background: #eee; }\n .cw-control .tab-content {\n position: relative;\n padding: 30px 0 15px; }\n .cw-control .shorthand .tab-content {\n border-top: 1px solid #ccc; }\n .cw-control .single-length .tab-content {\n padding: 20px 0 0; }\n .cw-control .single-length .tab-content .reset {\n bottom: 32px; }\n .cw-control .output {\n padding: 5px;\n border-top: 1px dotted #ddd;\n border-bottom: 1px solid #ddd;\n font-size: 11px;\n margin-top: -1px; }\n .cw-control .reset {\n position: absolute;\n right: 2px;\n bottom: 47px;\n padding: 4px;\n cursor: pointer; }\n .cw-control .reset:hover {\n background: #fff; }\n .cw-control .range-wrap {\n padding-right: 5px;\n line-height: 1.8; }\n .cw-control input:focus {\n outline: none; }\n .cw-control svg {\n display: block;\n margin: auto; }\n .cw-control .wp-picker-container {\n position: relative; }\n .cw-control .wp-picker-container.wp-picker-active {\n min-height: 270px; }\n .cw-control .wp-picker-container .wp-color-result.button {\n margin-right: 2px; }\n .cw-control .wp-picker-active .wp-color-result-text {\n display: none; }\n .cw-control .wp-picker-clear, .cw-control .wp-picker-clear:hover, .cw-control .wp-picker-clear:focus, .cw-control .wp-picker-clear:active {\n height: 30px;\n text-indent: -100px;\n background-image: url(\"data:image/svg+xml,%3Csvg width='15px' height='14.7px' viewBox='0 0 50 49' version='1.1' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0,20 L14,0 C14,6 14,9 14,9 C40,-3 65,30 38,49 C58,27 36,7 18,17 C18,17 20,19 24,23 L0,20 Z' fill='%237CB342'%3E%3C/path%3E%3C/svg%3E\");\n background-repeat: no-repeat;\n background-position: center;\n min-width: 26px; }\n .cw-control.color input[type=\"text\"].wp-color-picker {\n max-width: 120px; }\n .cw-control.border input[type=\"text\"].wp-color-picker {\n max-width: 100px; }\n .cw-control.font-style, .cw-control.text-decoration, .cw-control.display {\n padding-right: 12px; }\n .cw-control.position .select-search__option {\n font-size: 13px; }\n\n.cw-control-title {\n display: block;\n padding: 10px 0; }\n .cw-control-title + .tab-content {\n margin-top: -25px; }\n\n.border .cw-tab-wrap {\n display: flex;\n flex-wrap: wrap; }\n .border .cw-tab-wrap > * {\n flex-shrink: 0;\n width: 100%;\n box-sizing: border-box; }\n .border .cw-tab-wrap .cw-color {\n width: 60%; }\n .border .cw-tab-wrap .cw-select {\n width: 40%; }\n\nbutton.wp-color-result .color-alpha {\n height: 28px !important; }\n\n#cw-quick-select .cw-qs-title {\n padding: 15px 0 10px;\n text-align: center;\n line-height: 22px; }\n #cw-quick-select .cw-qs-title .dashicons {\n background-color: #0171a1;\n background-image: linear-gradient(90deg, #01a0e4, #0171a1);\n background-size: 100%;\n background-repeat: repeat;\n -webkit-background-clip: text;\n -webkit-text-fill-color: transparent;\n font-size: 16px;\n height: 16px;\n vertical-align: text-top; }\n\n#cw-quick-select .cw-qs-title svg {\n vertical-align: text-top;\n padding-left: 10px; }\n\n#cw-quick-select ul.cw-qs-btns {\n padding: 10px;\n display: flex;\n flex-flow: column wrap;\n align-content: space-between;\n height: 300px; }\n #cw-quick-select ul.cw-qs-btns::before, #cw-quick-select ul.cw-qs-btns::after {\n content: '';\n flex-basis: 100%;\n width: 0;\n order: 2; }\n\n#cw-quick-select .cw-qs-btn:nth-child(3n+1) {\n order: 1; }\n\n#cw-quick-select .cw-qs-btn:nth-child(3n+2) {\n order: 2; }\n\n#cw-quick-select .cw-qs-btn:nth-child(3n) {\n order: 3; }\n\n#cw-quick-select li.cw-qs-btn {\n padding: 6px 8px;\n background: #fff linear-gradient(90deg, #ffffff 0%, #f3f7f4 100%);\n color: #0071a1;\n border: 1px solid #0071a1;\n border-radius: 3px;\n cursor: pointer;\n width: calc(33.3% - 5px);\n box-sizing: border-box;\n margin-bottom: 10px;\n text-align: center; }\n\n.cw-pseudo {\n display: inline-block;\n vertical-align: top;\n cursor: pointer;\n position: relative; }\n\n.cw-pseudo-icon {\n display: inline-block;\n background: #f2f8ec;\n border: 1px solid #7cb342;\n border-left: none;\n color: #5b8230;\n cursor: pointer;\n line-height: 22px;\n height: 24px; }\n\n.cw-pseudo-content {\n border: 1px solid #7cb342;\n box-sizing: border-box;\n display: none;\n position: absolute;\n top: 0;\n left: -1px;\n background: white;\n z-index: 3; }\n\n.cw-pseudo-item {\n padding: 3px 0 3px 7px;\n width: 52px;\n display: none; }\n .cw-pseudo-item:hover {\n color: #5b8230; }\n\n.cw-pseudo.active .cw-pseudo-content {\n display: inline-block; }\n\n.cw-pseudo.active .cw-pseudo-item:first-child {\n display: inline-block;\n background: #f2f8ec; }\n\n.cw-pseudo.active .cw-pseudo-icon {\n display: none; }\n\n.cw-pseudo.open .cw-pseudo-content {\n display: inline-block; }\n\n.cw-pseudo.open .cw-pseudo-item {\n display: inline-block; }\n\n.cw-pseudo.open .cw-pseudo-icon {\n display: none; }\n\n.cw-media .thumbnail img {\n max-height: 100px; }\n\n[id*=\"__lpform_input\"] {\n display: none !important; }\n"," ",'/**\n * Main wrapper\n */\n.select-search {\n position: relative;\n box-sizing: border-box; }\n\n.select-search *,\n.select-search *::after,\n.select-search *::before {\n box-sizing: inherit; }\n\n/**\n * Value wrapper\n */\n.select-search__value {\n position: relative;\n z-index: 1; }\n\n.select-search__value::after {\n content: \'\';\n display: inline-block;\n position: absolute;\n top: calc(50% - 7px);\n right: 19px;\n width: 9px;\n height: 9px; }\n\n/**\n * Input\n */\n.select-search__input {\n display: block;\n height: 30px;\n width: 100%;\n padding: 0 16px;\n background: #fff !important;\n border: 1px solid #7cb342;\n border-radius: 3px;\n outline: none;\n font-family: \'Noto Sans\', sans-serif;\n font-size: 14px;\n text-align: left;\n text-overflow: ellipsis;\n line-height: 36px;\n -webkit-appearance: none;\n margin: 0; }\n\n.select-search__input::-webkit-search-decoration,\n.select-search__input::-webkit-search-cancel-button,\n.select-search__input::-webkit-search-results-button,\n.select-search__input::-webkit-search-results-decoration {\n -webkit-appearance: none; }\n\n.select-search__input:not([readonly]):focus {\n cursor: initial; }\n\n/**\n * Options wrapper\n */\n.select-search__select {\n background: #fff;\n box-shadow: 0 0.0625rem 0.125rem rgba(0, 0, 0, 0.15); }\n\n/**\n * Options\n */\n.select-search__options {\n list-style: none; }\n\n/**\n * Option row\n */\n.select-search__row:not(:first-child) {\n border-top: 1px solid #eee; }\n\n/**\n * Option\n */\n.select-search__option {\n display: block;\n height: 36px;\n width: 100%;\n padding: 0 16px;\n background: #fff;\n border: none;\n outline: none;\n font-size: 14px;\n text-align: left;\n cursor: pointer; }\n\n.select-search--multiple .select-search__option {\n height: 48px; }\n\n.select-search__option.is-selected {\n background: #7cb342;\n color: #fff; }\n\n.select-search__option.is-highlighted,\n.select-search__option:not(.is-selected):hover {\n background: #f1f7eb; }\n\n.select-search__option.is-highlighted.is-selected,\n.select-search__option.is-selected:hover {\n background: #6fa13b;\n color: #fff; }\n\n/**\n * Group\n */\n.select-search__group-header {\n font-size: 10px;\n text-transform: uppercase;\n background: #f7f7f7;\n padding: 6px 16px;\n position: sticky;\n top: 0;\n box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2); }\n\n/**\n * States\n */\n.select-search.is-disabled {\n opacity: 0.5; }\n\n.select-search.is-loading .select-search__value::after {\n background-image: url("data:image/svg+xml,%3Csvg xmlns=\'http://www.w3.org/2000/svg\' width=\'50\' height=\'50\' viewBox=\'0 0 50 50\'%3E%3Cpath fill=\'%232F2D37\' d=\'M25,5A20.14,20.14,0,0,1,45,22.88a2.51,2.51,0,0,0,2.49,2.26h0A2.52,2.52,0,0,0,50,22.33a25.14,25.14,0,0,0-50,0,2.52,2.52,0,0,0,2.5,2.81h0A2.51,2.51,0,0,0,5,22.88,20.14,20.14,0,0,1,25,5Z\'%3E%3CanimateTransform attributeName=\'transform\' type=\'rotate\' from=\'0 25 25\' to=\'360 25 25\' dur=\'0.6s\' repeatCount=\'indefinite\'/%3E%3C/path%3E%3C/svg%3E");\n background-size: 11px; }\n\n.select-search:not(.is-disabled) .select-search__input {\n cursor: pointer; }\n\n/**\n * Modifiers\n */\n.select-search--multiple {\n border-radius: 3px;\n overflow: hidden; }\n\n.select-search:not(.is-loading):not(.select-search--multiple) .select-search__value::after {\n transform: rotate(45deg);\n border-right: 2px solid #555;\n border-bottom: 2px solid #555;\n pointer-events: none; }\n\n.select-search--multiple .select-search__input {\n cursor: initial; }\n\n.select-search--multiple .select-search__input {\n border-radius: 3px 3px 0 0; }\n\n.select-search--multiple:not(.select-search--search) .select-search__input {\n cursor: default; }\n\n.select-search:not(.select-search--multiple) .select-search__input:hover {\n border-color: #7cb342; }\n\n.select-search:not(.select-search--multiple) .select-search__select {\n z-index: 2;\n top: 38px;\n right: 0;\n left: 0;\n border-radius: 3px;\n overflow: auto;\n max-height: 360px;\n border: 1px solid #7cb342; }\n\n.select-search--multiple .select-search__select {\n position: relative;\n overflow: auto;\n max-height: 260px;\n border-top: 1px solid #eee;\n border-radius: 0 0 3px 3px; }\n\n.select-search.horizontal .select-search__value {\n display: none; }\n\n.select-search.horizontal .select-search__select {\n top: 0;\n box-shadow: none; }\n\n.select-search.horizontal .select-search__options {\n display: flex; }\n\n.select-search.horizontal .select-search__option {\n height: 28px;\n position: relative;\n text-align: center;\n padding: 0 10px; }\n\n.select-search.horizontal .select-search__row {\n flex: 1; }\n .select-search.horizontal .select-search__row:not(:first-child) {\n border-top: none; }\n\n.select-search__row[data-value="italic"] .select-search__option {\n font-style: italic; }\n\n.select-search__row[data-value="overline"] .select-search__option {\n text-decoration: overline; }\n\n.select-search__row[data-value="underline"] .select-search__option {\n text-decoration: underline; }\n\n.select-search__row[data-value="line-through"] .select-search__option {\n text-decoration: line-through; }\n\n.cw-border .select-search__row .select-search__option:after {\n content: \'\';\n position: absolute;\n top: 50%;\n left: 15%;\n width: 70%; }\n\n.cw-border .select-search__row[data-value="solid"] .select-search__option:after {\n border-top: 2px solid #000; }\n\n.cw-border .select-search__row[data-value="dotted"] .select-search__option:after {\n border-top: 2px dotted #000; }\n\n.cw-border .select-search__row[data-value="dashed"] .select-search__option:after {\n border-top: 2px dashed #000; }\n\n.font-weight .select-search__row[data-value="100"] .select-search__option {\n font-weight: 100; }\n\n.font-weight .select-search__row[data-value="200"] .select-search__option {\n font-weight: 200; }\n\n.font-weight .select-search__row[data-value="300"] .select-search__option {\n font-weight: 300; }\n\n.font-weight .select-search__row[data-value="400"] .select-search__option {\n font-weight: 400; }\n\n.font-weight .select-search__row[data-value="500"] .select-search__option {\n font-weight: 500; }\n\n.font-weight .select-search__row[data-value="600"] .select-search__option {\n font-weight: 600; }\n\n.font-weight .select-search__row[data-value="700"] .select-search__option {\n font-weight: 700; }\n\n.font-weight .select-search__row[data-value="800"] .select-search__option {\n font-weight: 800; }\n\n.font-weight .select-search__row[data-value="900"] .select-search__option {\n font-weight: 900; }\n'))}var Ge,Xe=!1,Je=!1,Ye=!1;function et(e,t){Ge=t.origin,!0!==Ye&&!0!==Je&&(Je=!0,q.addFromString(Xe.getValue()),setTimeout((function(){Je=!1}),100))}function tt(){var e=O(q).allOutputs,t=O(L).currentPage;return w.emit("textarea-ready",{textAreaId:"cw-code-editor"}),React.createElement("textarea",{id:"cw-code-editor",defaultValue:e[t]})}function nt(){var e=g(React.useState("editor"),2),t=e[0],n=e[1],r=g(React.useState({show:!1,style:{content:{top:0},arrow:{right:0}}}),2),a=r[0],o=r[1],i=O(L),c=i.previewObject,l=i.mounted,s=[{type:"global",name:"global",title:"All Pages"}];"pages"in c&&(c.pages.is_home&&s.push({type:"template",name:"is_home",title:"Blog Post List Page"}),c.pages.is_front_page&&s.push({type:"template",name:"is_front_page",title:"Front Page"}),c.pages.is_single&&(s.push({type:"template",name:"is_single",title:"All Single Posts"}),s.push({type:"single",name:c.page.id,title:"Post: ".concat(c.page.title)})),c.pages.is_page&&(s.push({type:"template",name:"is_page",title:"All Single Pages"}),s.push({type:"single",name:c.page.id,title:"Page: ".concat(c.page.title)})));var p=L.get().currentPage,d="All Pages";for(var h in s)if(s.hasOwnProperty(h)&&s[h].name===p){d=s[h].title;break}return React.createElement("div",{className:"cw-panel"},React.createElement("div",{className:"cw-panel-heading cw-row"},React.createElement("div",{className:"col-5"},React.createElement("span",null,"Editing Styles for: ")),React.createElement("div",{className:"col-5"},React.createElement("button",{className:"button button-block cw-current-page",onClick:function(e){var t=e.target.getBoundingClientRect(),n=t.bottom-e.target.offsetParent.getBoundingClientRect().top;o((function(e){return{show:!e.show,style:{content:{top:"".concat(n+10,"px")},arrow:{left:"".concat(t.left+t.width/2-7,"px")}}}}))},type:"button"},d),React.createElement("div",{className:"popup-overlay ".concat(a.show?"":"hidden"),onClick:function(){return o((function(e){return u(u({},e),{},{show:!1})}))}}),React.createElement("div",{className:"page-selector popup-content ".concat(a.show?"":"hidden"),style:a.style.content},React.createElement("div",{className:"popup-arrow",style:a.style.arrow}),s.map((function(e){return React.createElement("button",{key:e.name,onClick:function(t){return function(e,t){L.changePage(t.name,t.type),o((function(e){return u(u({},e),{},{show:!1})}))}(0,e)},className:"button button-block",type:"button"},e.title)})))),React.createElement("div",{className:"col-2"},React.createElement("button",{className:"button cw-pause",onClick:function(){te()},type:"button"},React.createElement("span",{className:"dashicons dashicons-controls-".concat(l?"pause":"play")})))),React.createElement("div",{className:"panel-main"},React.createElement("div",{className:"cw-tabs"},React.createElement("div",{className:"editor-tab tab"+("editor"===t?" active":""),onClick:function(){return n("editor")}},"Visual Editor"),React.createElement("div",{className:"code-tab tab"+("code"===t?" active":""),onClick:function(){return n("code")}},"Code Editor")),React.createElement("div",{className:"tab-content cw-editor"+("editor"!==t?" hidden":"")},React.createElement(Ze,null)),React.createElement("div",{className:"tab-content cw-code-editor"+("code"!==t?" hidden":"")},React.createElement(tt,null))))}function rt(){return React.createElement("div",{id:"cw-canvas"},React.createElement("style",{type:"text/css"},"#color-wings {\n margin-left: -12px;\n margin-right: -12px; }\n\n[style=\"display: none;\"] + #color-wings {\n margin-top: -15px; }\n\n.cw-row {\n display: flex; }\n .cw-row .col {\n flex: 1; }\n .cw-row .col-1 {\n flex: 0 0 8.33333%; }\n .cw-row .col-2 {\n flex: 0 0 16.66667%; }\n .cw-row .col-3 {\n flex: 0 0 25%; }\n .cw-row .col-4 {\n flex: 0 0 33.33333%; }\n .cw-row .col-5 {\n flex: 0 0 41.66667%; }\n .cw-row .col-6 {\n flex: 0 0 50%; }\n .cw-row .col-7 {\n flex: 0 0 58.33333%; }\n .cw-row .col-8 {\n flex: 0 0 66.66667%; }\n .cw-row .col-9 {\n flex: 0 0 75%; }\n .cw-row .col-10 {\n flex: 0 0 83.33333%; }\n .cw-row .col-11 {\n flex: 0 0 91.66667%; }\n .cw-row .col-12 {\n flex: 0 0 100%; }\n\n.cw-panel-heading {\n padding: 10px;\n align-items: center;\n position: relative; }\n .cw-panel-heading .popup-content {\n width: 100%;\n box-sizing: border-box;\n position: absolute;\n z-index: 5;\n background: #fff;\n right: 0;\n border: 1px solid #ccc; }\n .cw-panel-heading .popup-overlay {\n position: fixed;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0; }\n .cw-panel-heading .popup-arrow {\n width: 14px;\n height: 14px;\n background: white;\n position: absolute;\n right: 100px;\n top: -6px;\n transform: rotate(135deg);\n z-index: -1;\n box-shadow: rgba(0, 0, 0, 0.3) -1px 1px 1px; }\n .cw-panel-heading .cw-current-page {\n max-height: 30px;\n white-space: pre-wrap;\n overflow: auto; }\n .cw-panel-heading .page-selector .button {\n border-color: transparent;\n background: none;\n padding: 10px 20px; }\n .cw-panel-heading .page-selector .button:focus {\n border-color: #0071a1; }\n .cw-panel-heading .cw-pause {\n margin: 0 0 0 auto;\n display: block;\n line-height: 1; }\n\n.button.button-block {\n width: 100%;\n text-align: center; }\n\n.cw-tabs {\n display: flex;\n margin: 0 -1px;\n position: relative;\n z-index: 2; }\n .cw-tabs .tab {\n flex: 1;\n padding: 8px;\n background: #ddd;\n border: 1px solid transparent;\n border-bottom-color: #ccc;\n cursor: pointer;\n text-align: center; }\n .cw-tabs .tab.active {\n border: 1px solid #ccc;\n border-bottom-color: #fff;\n background: #fff;\n cursor: auto; }\n\n#cw-code-editor {\n width: 100%; }\n\n.cw-code-editor .CodeMirror {\n height: calc( 100vh - 255px);\n margin-bottom: -22px;\n overflow: hidden; }\n\n.customize-control .cw-link-wrap {\n background: #fff;\n padding: 6px 10px;\n cursor: pointer;\n border-left: 2px solid transparent;\n transition: all .15s ease-in-out, border-color .15s ease-in-out, background .15s ease-in-out;\n box-shadow: 0 0 0 1px #ddd;\n position: relative; }\n .customize-control .cw-link-wrap:hover {\n color: #0073aa;\n background: #f3f3f5;\n border-left: 2px solid #0073aa; }\n .customize-control .cw-link-wrap:hover:after {\n color: #0073aa; }\n .customize-control .cw-link-wrap:after {\n content: '\\f345';\n font: normal 16px/1 dashicons;\n color: #a0a5aa;\n position: absolute;\n right: 6px;\n top: calc(50% - 8px); }\n\n.customize-control .cw-link-text {\n position: absolute;\n right: 26px;\n top: calc(50% - 9px);\n font-size: 11px; }\n"),React.createElement(nt,null))}q.subscribe((function(){Ye=!0,!0!==Je&&Xe.getDoc().setValue(q.get().allOutputs[L.get().currentPage]),"setValue"===Ge&&Xe.autoFormatRange({line:0,ch:0},{line:Xe.lineCount()}),setTimeout((function(){Ye=!1}),100)})),w.on("textarea-ready",(function(e){if(!1===Xe){var t={indentUnit:2,indentWithTabs:!0,inputStyle:"contenteditable",lineNumbers:!0,autoRefresh:!0,lineWrapping:!0,styleActiveLine:!0,continueComments:!0,extraKeys:{"Ctrl-Space":"autocomplete","Ctrl-/":"toggleComment","Cmd-/":"toggleComment","Alt-F":"findPersistent","Ctrl-F":"findPersistent","Cmd-F":"findPersistent"},direction:"ltr",gutters:[],mode:"text/css",lint:!1,autoCloseBrackets:!0,autoCloseTags:!0,matchTags:{bothTags:!0},tabSize:2,matchBrackets:!0,jshint:{}};(0,g(N(!("undefined"==typeof wp||!wp.hasOwnProperty("CodeMirror"))),1)[0])((function(){(Xe=wp.CodeMirror.fromTextArea(document.getElementById(e.textAreaId),t)).on("change",et),Xe.showHint&&Xe.on("keyup",(function(e,t){var n,r,a,o,i=/^[a-zA-Z]$/.test(t.key);Xe.state.completionActive&&i||"string"!==(o=Xe.getTokenAt(Xe.getCursor())).type&&"comment"!==o.type&&(a=wp.CodeMirror.innerMode(Xe.getMode(),o.state).mode.name,r=Xe.doc.getLine(Xe.doc.getCursor().line).substr(0,Xe.doc.getCursor().ch),"css"===a&&(n=i||":"===t.key||" "===t.key&&/:\s+$/.test(r)),n&&Xe.showHint({completeSingle:!1}))}))}))}})),wp.customize.controlConstructor["color-wings"]=wp.customize.Control.extend({ready:function(){var e=this;cw.Evt.emit("colorwings-will-mount",e),ReactDOM.render(React.createElement(rt,null),document.getElementById("color-wings")),wp.customize.section("extra_styles",(function(e){e.expanded.bind((function(e){te(!!e)}))})),wp.customize.state("previewedDevice").bind(G),cw.Evt.on("update-control",(function(t){console.log(t),e.setting.set(t)}))}}),wp.customize.controlConstructor["cw-link"]=wp.customize.Control.extend({ready:function(){var e=this;this.container[0].addEventListener("click",(function(){cw.Evt.emit("focusUnlocked"),wp.customize.control("color_wings").focus(),cw.Evt.emit("select-element",e.params.options.selector)}))}})}(React,PropTypes); diff --git a/src/backend/colorwings b/src/backend/colorwings index 5f7ea3a..f2592f8 160000 --- a/src/backend/colorwings +++ b/src/backend/colorwings @@ -1 +1 @@ -Subproject commit 5f7ea3a855019d323f029c1d7a34dd98b00fb168 +Subproject commit f2592f8b4b191f4cc73312ec132141318b18c7f2 From 8459e19bde98e6dbf17b10bb9cbed0183c6efaca Mon Sep 17 00:00:00 2001 From: Karthik Bhat Date: Mon, 26 Oct 2020 16:53:29 +0530 Subject: [PATCH 2/2] Version upgrade --- changelog.txt | 5 +++++ library/init.php | 2 +- package.json | 2 +- readme.txt | 11 +++-------- rollup.config.js | 9 ++++++--- style.css | 2 +- tests/e2e/package.json | 2 +- 7 files changed, 18 insertions(+), 15 deletions(-) diff --git a/changelog.txt b/changelog.txt index 8d98f6c..4e22473 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,8 @@ +Version 2.0.1 / Release: 26-10-2020 +=================== +- Fix: Bug in Extra styles. +- Fix: Unknown font family is gracefully handled + Version 2.0.0 / Release: 25-10-2020 =================== - New: Visual CSS editor under "Extra Styles". diff --git a/library/init.php b/library/init.php index 0e4ab70..d55be77 100644 --- a/library/init.php +++ b/library/init.php @@ -46,7 +46,7 @@ function greenlet_constants() { define( 'GREENLET_CHILD_URL', get_stylesheet_directory_uri() ); // Define other constants. - define( 'GREENLET_VERSION', '2.0.0' ); + define( 'GREENLET_VERSION', '2.0.1' ); } add_action( 'greenlet_init', 'greenlet_constants' ); diff --git a/package.json b/package.json index 3e1f3d5..7cea66c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "greenlet", - "version": "2.0.0", + "version": "2.0.1", "description": "Extremely fast and highly customizable WordPress theme.", "dependencies": { "react-select-search": "^2.1.1" diff --git a/readme.txt b/readme.txt index cbb6962..79a5b5a 100644 --- a/readme.txt +++ b/readme.txt @@ -6,7 +6,7 @@ Tags: blog, custom-background, custom-colors, editor-style, featured-images, foo Tested up to: 5.5.1 Requires at least: 5.0 Requires PHP: 5.4 or higher -Stable tag: 2.0.0 +Stable tag: 2.0.1 Extremely fast and highly customizable WordPress theme. @@ -61,13 +61,8 @@ Greenlet also is SEO friendly. Theme integrates schema.org efficiently for Searc == Changelog == -- New: Visual CSS editor under "Extra Styles". -- New: Unlimited Headers and Footers creator. -- New: Individual post/page layout selector -- Improvement: All visual styles are moved to "Extra Styles". -- Improvement: Bootstrap update to 4.5.3. -- Improvement: Show logo, title & tagline independently. -- Improvement: Full-width & full-width container block support +- Fix: Bug in Extra styles. +- Fix: Unknown font family is gracefully handled == Copyright == diff --git a/rollup.config.js b/rollup.config.js index 189d22a..7c780bb 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -4,7 +4,7 @@ * @package greenlet */ -import babel from 'rollup-plugin-babel' +import babel from '@rollup/plugin-babel' import resolve from '@rollup/plugin-node-resolve' import commonjs from '@rollup/plugin-commonjs' import replace from '@rollup/plugin-replace' @@ -14,7 +14,8 @@ import scss from 'rollup-plugin-scss' const GLOBALS = { jQuery: 'jQuery', react: 'React', - 'react-dom': 'ReactDOM' + 'react-dom': 'ReactDOM', + 'prop-types': 'PropTypes' } const EXTERNAL = [ @@ -22,7 +23,8 @@ const EXTERNAL = [ 'react', 'react-dom', 'React', - 'ReactDOM' + 'ReactDOM', + 'prop-types' ] const getCWBanner = filename => `/** @license ColorWings v1.0.0 @@ -87,6 +89,7 @@ const config = paths.map(( path ) => ({ plugins: [ babel({ exclude: 'node_modules/**', + babelHelpers: 'bundled', }), resolve({ browser: true, diff --git a/style.css b/style.css index 120e64b..bdaf21f 100644 --- a/style.css +++ b/style.css @@ -4,7 +4,7 @@ * Theme Name: Greenlet * Theme URI: https://greenletwp.com * Description: Greenlet is an extremely fast, lightweight best SEO WordPress theme made for blogs, personal portfolio, business, and Woocommerce Stores. While Greenlet setup is quick and easy, it provides dozens of options for customization without affecting the speed and size of your website. Features: 100/100 Google Page Speed score | Extremely Lightweight (~25KB) | Schema Markup Added | No jQuery | 12 Column Design System | 8 Predefined Layouts (extendable) | Unlimited Post Layout | Unlimited Header and Footer layout | Pagination ( Default, Numbered, Ajax, Load More, Infinite Scroll ) | ML Support | RTL Support | Visual style edtor | Mobile Ready | Breadcrumb | WooCommerce Support | Theme Presets and so much more. - * Version: 2.0.0 + * Version: 2.0.1 * Tested up to: 5.5.1 * Requires PHP: 5.4 or higher * Author: Greenlet Team diff --git a/tests/e2e/package.json b/tests/e2e/package.json index 292700c..16838bd 100644 --- a/tests/e2e/package.json +++ b/tests/e2e/package.json @@ -1,6 +1,6 @@ { "name": "e2e-testing", - "version": "2.0.0", + "version": "2.0.1", "description": "End to End Testing for Greenlet", "main": "index.js", "scripts": {