Files

42 lines
630 KiB
JavaScript
Raw Permalink Normal View History

(()=>{var e,t,n={2:(e,t,n)=>{var o=n(2199),a=n(4664),r=n(5950);e.exports=function(e){return o(e,r,a)}},79:(e,t,n)=>{var o=n(3702),a=n(80),r=n(4739),i=n(8655),s=n(1175);function l(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var o=e[t];this.set(o[0],o[1])}}l.prototype.clear=o,l.prototype.delete=a,l.prototype.get=r,l.prototype.has=i,l.prototype.set=s,e.exports=l},80:(e,t,n)=>{var o=n(6025),a=Array.prototype.splice;e.exports=function(e){var t=this.__data__,n=o(t,e);return!(n<0||(n==t.length-1?t.pop():a.call(t,n,1),--this.size,0))}},104:(e,t,n)=>{var o=n(3661);function a(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var o=arguments,a=t?t.apply(this,o):o[0],r=n.cache;if(r.has(a))return r.get(a);var i=e.apply(this,o);return n.cache=r.set(a,i)||r,i};return n.cache=new(a.Cache||o),n}a.Cache=o,e.exports=a},124:(e,t,n)=>{var o=n(9325);e.exports=function(){return o.Date.now()}},181:e=>{e.exports=function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}},270:(e,t,n)=>{var o=n(7068),a=n(346);e.exports=function e(t,n,r,i,s){return t===n||(null==t||null==n||!a(t)&&!a(n)?t!=t&&n!=n:o(t,n,r,i,e,s))}},289:(e,t,n)=>{var o=n(2651);e.exports=function(e){return o(this,e).get(e)}},294:e=>{e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}},317:e=>{e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach(function(e,o){n[++t]=[o,e]}),n}},346:e=>{e.exports=function(e){return null!=e&&"object"==typeof e}},361:e=>{var t=/^(?:0|[1-9]\d*)$/;e.exports=function(e,n){var o=typeof e;return!!(n=null==n?9007199254740991:n)&&("number"==o||"symbol"!=o&&t.test(e))&&e>-1&&e%1==0&&e<n}},392:e=>{e.exports=function(e,t){return null==e?void 0:e[t]}},583:(e,t,n)=>{var o=n(7237),a=n(7255),r=n(8586),i=n(7797);e.exports=function(e){return r(e)?o(i(e)):a(e)}},631:(e,t,n)=>{var o=n(8077),a=n(9326);e.exports=function(e,t){return null!=e&&a(e,t,o)}},641:(e,t,n)=>{var o=n(6649),a=n(5950);e.exports=function(e,t){return e&&o(e,t,a)}},659:(e,t,n)=>{var o=n(1873),a=Object.prototype,r=a.hasOwnProperty,i=a.toString,s=o?o.toStringTag:void 0;e.exports=function(e){var t=r.call(e,s),n=e[s];try{e[s]=void 0;var o=!0}catch(e){}var a=i.call(e);return o&&(t?e[s]=n:delete e[s]),a}},689:(e,t,n)=>{var o=n(2),a=Object.prototype.hasOwnProperty;e.exports=function(e,t,n,r,i,s){var l=1&n,c=o(e),u=c.length;if(u!=o(t).length&&!l)return!1;for(var d=u;d--;){var p=c[d];if(!(l?p in t:a.call(t,p)))return!1}var h=s.get(e),f=s.get(t);if(h&&f)return h==t&&f==e;var b=!0;s.set(e,t),s.set(t,e);for(var m=l;++d<u;){var g=e[p=c[d]],v=t[p];if(r)var x=l?r(v,g,p,t,e,s):r(g,v,p,e,t,s);if(!(void 0===x?g===v||i(g,v,n,r,s):x)){b=!1;break}m||(m="constructor"==p)}if(b&&!m){var k=e.constructor,y=t.constructor;k==y||!("constructor"in e)||!("constructor"in t)||"function"==typeof k&&k instanceof k&&"function"==typeof y&&y instanceof y||(b=!1)}return s.delete(e),s.delete(t),b}},695:(e,t,n)=>{var o=n(8096),a=n(2428),r=n(6449),i=n(3656),s=n(361),l=n(7167),c=Object.prototype.hasOwnProperty;e.exports=function(e,t){var n=r(e),u=!n&&a(e),d=!n&&!u&&i(e),p=!n&&!u&&!d&&l(e),h=n||u||d||p,f=h?o(e.length,String):[],b=f.length;for(var m in e)!t&&!c.call(e,m)||h&&("length"==m||d&&("offset"==m||"parent"==m)||p&&("buffer"==m||"byteLength"==m||"byteOffset"==m)||s(m,b))||f.push(m);return f}},748:(e,t,n)=>{"use strict";var o,a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},r=(o=n(1609))&&o.__esModule?o:{default:o};t.A=function(e){var t=e.fill,n=void 0===t?"currentColor":t,o=e.width,i=void 0===o?24:o,s=e.height,l=void 0===s?24:s,c=e.style,u=void 0===c?{}:c,d=function(e,t){var n={};for(var o in e)t.indexOf(o)>=0||Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o]);return n}(e,["fill","width","height","style"]);return r.default.createElement("svg",a({viewBox:"0 0 24 24",style:a({fill:n,width:i,height:l},u)},d),r.default.createElement("path",{d:"M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,
// translators: %s: color hex code e.g: "#f00".
// translators: %s: color hex code e.g: "#f00".
(0,Ui.sprintf)((0,Ui.__)("Color code: %s"),e),children:(0,Ai.jsx)(Ii.Button,{type:"button",className:"kadence-color-palette__item "+(i?"is-active":""),style:o,onClick:()=>{t.startsWith("theme-palette")?M(e,a):M(e,!1),u&&u(t)},"aria-label":n?
// translators: %s: The name of the color e.g: "vivid red".
// translators: %s: The name of the color e.g: "vivid red".
(0,Ui.sprintf)((0,Ui.__)("Color: %s","kadence-blocks"),n):
// translators: %s: color hex code e.g: "#f00".
// translators: %s: color hex code e.g: "#f00".
(0,Ui.sprintf)((0,Ui.__)("Color code: %s","kadence-blocks"),e),"aria-pressed":i})}),a===r&&(0,Ai.jsx)(Ii.Dashicon,{icon:"admin-site"}),!t.startsWith("theme-palette")&&r===e&&(0,Ai.jsx)(Ii.Dashicon,{icon:"saved"})]},e)})})]}),h&&(0,Ai.jsxs)(Ii.Button,{className:"kadence-pop-color-icon-indicate "+(t?"kadence-has-alpha":"kadence-no-alpha"),onClick:C,showTooltip:!0,label:e,children:[(0,Ai.jsx)(Ii.ColorIndicator,{className:"kadence-pop-color-indicate",colorValue:E}),r&&r.startsWith("palette")&&(0,Ai.jsx)("span",{className:"color-indicator-icon",children:(0,Ai.jsx)(Ii.Dashicon,{icon:"admin-site"})})]}),!h&&(0,Ai.jsxs)(Ii.Button,{className:"kadence-pop-color-icon-indicate "+(t?"kadence-has-alpha":"kadence-no-alpha"),onClick:C,showTooltip:!0,label:e,children:[(0,Ai.jsx)(Ii.ColorIndicator,{className:"kadence-pop-color-indicate",colorValue:E}),r&&r.startsWith("palette")&&(0,Ai.jsx)("span",{className:"color-indicator-icon",children:(0,Ai.jsx)(Ii.Dashicon,{icon:"admin-site"})})]})]})}const qi=class extends Pi.Component{constructor(){super(...arguments),this.state={reload:!1}}render(){let e=!1;const t=this.props.colorDefault?this.props.colorDefault:this.props.default,n=this.props.colorDefault2?this.props.colorDefault2:this.props.default2,o=this.props.colorDefault3?this.props.colorDefault3:this.props.default3,a=this.props.colorValue?this.props.colorValue:this.props.value,r=this.props.colorValue2?this.props.colorValue2:this.props.value2,i=this.props.colorValue3?this.props.colorValue3:this.props.value3,s=this.props.onColorChange?this.props.onColorChange:this.props.onChange,l=this.props.onColorChange2?this.props.onColorChange2:this.props.onChange2,c=this.props.onColorChange3?this.props.onColorChange3:this.props.onChange3;return a&&a!==t&&(e=!0),r&&r!==n&&(e=!0),i&&i!==o&&(e=!0),(0,Ai.jsx)("div",{className:"components-base-control kadence-pop-color-control",children:(0,Ai.jsxs)("div",{className:"kadence-pop-color-container",children:[this.props.label&&(0,Ai.jsx)("label",{className:"kadence-beside-label kadence-pop-color-label",children:this.props.label}),e&&!this.props.hideClear&&(0,Ai.jsx)(Ii.Button,{className:"kadence-pop-color-clear",type:"button",onClick:()=>{s(t||""),this.props.onClassChange&&this.props.onClassChange(""),l&&(l(n||""),this.props.onClassChange2&&this.props.onClassChange2("")),c&&(c(o||""),this.props.onClassChange3&&this.props.onClassChange3("")),this.setState({reload:!0})},isSmall:!0,children:(0,Ai.jsx)(Ii.Dashicon,{icon:"redo"})}),(0,Ai.jsxs)("div",{className:"kadence-pop-color-popovers",children:[(0,Ai.jsx)(Wi,{label:this.props.swatchLabel?this.props.swatchLabel:(0,Ui.__)("Select Color","kadence-blocks"),onChange:e=>s(e),onOpacityChange:this.props.onOpacityChange?e=>this.props.onOpacityChange(e):void 0,onArrayChange:this.props.onArrayChange?(e,t)=>this.props.onArrayChange(e,t):void 0,onClassChange:this.props.onClassChange?e=>this.props.onClassChange(e):void 0,value:a,opacityValue:void 0!==this.props?.opacityValue&&""!==this.props?.opacityValue?this.props.opacityValue:void 0,opacityUnit:this.props.opacityUnit?this.props.opacityUnit:void 0,defaultValue:t||"",reload:this.state.reload,reloaded:e=>this.setState({reload:!1})}),l&&(0,Ai.jsx)(Wi,{label:this.props.swatchLabel2?this.props.swatchLabel2:(0,Ui.__)("Select Color","kadence-blocks"),onChange:e=>l(e),onOpacityChange:this.props.onOpacityChange2?e=>this.props.onOpacityChange2(e):void 0,onArrayChange:this.props.onArrayChange2?(e,t)=>this.props.onArrayChange2(e,t):void 0,onClassChange:this.props.onClassChange2?e=>this.props.onClassChange2(e):void 0,value:r,opacityValue:this.props.opacityValue2?this.props.opacityValue2:void 0,opacityUnit:this.props.opacityUnit2?this.props.opacityUnit2:void 0,defaultValue:n||"",reload:this.state.reload,reloaded:e=>this.setState({reload:!1})}),c&&(0,Ai.jsx)(Wi,{label:this.props.swatchLabel3?this.props.swatchLabel3:(0,Ui.__)("Select Color","kadence-blocks"),onChange:e=>c(e),onOpacityChange:this.props.onOpacityChange3?e=>this.props.onOpacityChange3(e):void 0,onArrayChange:this.props.onArrayChange3?(e,t)=>this.props.onArrayChange3(e,t):void 0
// translators: %s: color hex code e.g: "#f00".
// translators: %s: color hex code e.g: "#f00".
(0,Ui.sprintf)((0,Ui.__)("Color code: %s"),e),children:(0,Ai.jsx)(Ii.Button,{type:"button",className:"kadence-color-palette__item "+(i?"is-active":""),style:o,onClick:()=>{t.startsWith("theme-palette")?N(e,r):N(e,!1),c&&c(t)},"aria-label":n?
// translators: %s: The name of the color e.g: "vivid red".
// translators: %s: The name of the color e.g: "vivid red".
(0,Ui.sprintf)((0,Ui.__)("Color: %s","kadence-blocks"),n):
// translators: %s: color hex code e.g: "#f00".
// translators: %s: color hex code e.g: "#f00".
(0,Ui.sprintf)((0,Ui.__)("Color code: %s","kadence-blocks"),e),"aria-pressed":i})}),r===a&&(0,Ai.jsx)(Ii.Dashicon,{icon:"admin-site"}),!t.startsWith("theme-palette")&&a===e&&(0,Ai.jsx)(Ii.Dashicon,{icon:"saved"})]},e)})})]})})}const ns=window.wp.primitives,os=(0,Ai.jsx)(ns.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Ai.jsx)(ns.Path,{d:"m14.5 6.5-1 1 3.7 3.7H4v1.6h13.2l-3.7 3.7 1 1 5.6-5.5z"})}),as=(0,Ai.jsx)(ns.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Ai.jsx)(ns.Path,{d:"m16.5 13.5-3.7 3.7V4h-1.5v13.2l-3.8-3.7-1 1 5.5 5.6 5.5-5.6z"})}),rs=(0,Ai.jsx)(ns.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Ai.jsx)(ns.Path,{d:"M20 11.2H6.8l3.7-3.7-1-1L3.9 12l5.6 5.5 1-1-3.7-3.7H20z"})}),is=(0,Ai.jsx)(ns.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Ai.jsx)(ns.Path,{d:"M12 3.9 6.5 9.5l1 1 3.8-3.7V20h1.5V6.8l3.7 3.7 1-1z"})}),ss=(0,Ai.jsx)(ns.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Ai.jsx)(ns.Path,{d:"M4 15h11V9H4v6zM18.5 4v16H20V4h-1.5z"})}),ls=(0,Ai.jsx)(ns.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Ai.jsx)(ns.Path,{d:"M12.5 15v5H11v-5H4V9h7V4h1.5v5h7v6h-7Z"})}),cs=(0,Ai.jsx)(ns.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Ai.jsx)(ns.Path,{d:"M9 9v6h11V9H9zM4 20h1.5V4H4v16z"})}),us=(0,Ai.jsx)(ns.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Ai.jsx)(ns.Path,{d:"M4 4H5.5V20H4V4ZM7 10L17 10V14L7 14V10ZM20 4H18.5V20H20V4Z"})}),ds=(0,Ai.jsx)(ns.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Ai.jsx)(ns.Path,{d:"M9 15h6V9H9v6zm-5 5h1.5V4H4v16zM18.5 4v16H20V4h-1.5z"})}),ps=(0,Ai.jsx)(Ii.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Ai.jsx)(Ii.Path,{d:"M15 4H9v11h6V4zM4 18.5V20h16v-1.5H4z"})}),hs=(0,Ai.jsx)(Ii.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Ai.jsx)(Ii.Path,{d:"M20 11h-5V4H9v7H4v1.5h5V20h6v-7.5h5z"})}),fs=(0,Ai.jsx)(Ii.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Ai.jsx)(Ii.Path,{d:"M9 20h6V9H9v11zM4 4v1.5h16V4H4z"})}),bs=(0,Ai.jsx)(Ii.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Ai.jsx)(Ii.Path,{d:"M4 4L20 4L20 5.5L4 5.5L4 4ZM10 7L14 7L14 17L10 17L10 7ZM20 18.5L4 18.5L4 20L20 20L20 18.5Z"})}),ms=(0,Ai.jsx)(Ii.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Ai.jsx)(Ii.Path,{d:"M7 4H17V8L7 8V4ZM7 16L17 16V20L7 20V16ZM20 11.25H4V12.75H20V11.25Z"})}),gs=(0,Ai.jsx)(Ii.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 48 48",children:(0,Ai.jsx)(Ii.Path,{d:"M8 8v3h32V8H8zm32 29H8v3h32v-3zM17.911 14.318v8h12v-8h-12zM17.983 25.637v8h12v-8h-12z"})}),vs=(0,Ai.jsx)(Ii.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 48 48",children:(0,Ai.jsx)(Ii.Path,{d:"M8 8v3h32V8H8zm32 29H8v3h32v-3zM17.911 12.605v8h12v-8h-12zM17.993 27.275v8h12v-8h-12z"})}),xs=(0,Ai.jsxs)(Ii.SVG,{xmlns:"http://www.w3.org/2000/svg",fillRule:"evenodd",strokeLinejoin:"round",strokeMiterlimit:"2",clipRule:"evenodd",viewBox:"0 0 48 48",children:[(0,Ai.jsx)(Ii.Path,{d:"M8 40h3V8H8v32zM37 8v32h3V8h-3z"}),(0,Ai.jsx)(Ii.Path,{d:"M12.605 18.089H20.605V30.089H12.605z"}),(0,Ai.jsx)(Ii.Path,{d:"M27.275 18.007H35.275V30.007H27.275z"})]}),ks=(0,Ai.jsxs)(Ii.SVG,{xmlns:"http://www.w3.org/2000/svg",fillRule:"evenodd",strokeLinejoin:"round",strokeMiterlimit:"2",clipRule:"evenodd",viewBox:"0 0 48 48",children:[(0,Ai.jsx)(Ii.Path,{d:"M8 40h3V8H8v32zM37 8v32h3V8h-3z"}),(0,Ai.jsx)(Ii.Path,{d:"M14.318 18.089H22.317999999999998V30.089H14.318z"}),(0,Ai.jsx)(Ii.Path,{d:"M25.637 18.017H33.637V30.017H25.637z"})]});function ys({label:e,onChange:t,onChangeTablet:n,onChangeMobile:o,mobileValue:a,tabletValue:r,value:i,isCollapsed:s=!1,type:l="textAlign",reverse:c=!1}){const[u,d]=(0,Pi.useState)("Desktop"),p=(0,Gi.useSelect)(e=>e("kadenceblocks/data").getPreviewDeviceType(),[]);p!==u&&d(p);const{setPreviewDeviceType:h}=(0,Gi.useDispatch)("kadenceblocks/data");let f="",b=Hi.AlignmentToolbar;"justify"===l?b=Hi.JustifyTool
// translators: %1$s: gradient position e.g: 70, %2$s: gradient color code e.g: rgb(52,121,151).
// translators: %1$s: gradient position e.g: 70, %2$s: gradient color code e.g: rgb(52,121,151).
(0,Ui.__)("Gradient control point at position %1$s%% with color code %2$s."),t,n),"aria-describedby":a,"aria-haspopup":"true","aria-expanded":e,className:th()("components-custom-gradient-picker__control-point-button",{"is-active":e}),...o}),(0,Ai.jsx)(Ii.VisuallyHidden,{id:a,children:(0,Ui.__)("Use your left or right arrow keys or drag and drop with the mouse to change the gradient position. Press the button to change the color or remove the control point.")})]})}function of({isRenderedInSidebar:e,className:t,...n}){const o=(0,Pi.useMemo)(()=>({placement:"bottom",offset:8}),[]),a=th()("components-custom-gradient-picker__control-point-dropdown",t);return(0,Ai.jsx)(tf,{isRenderedInSidebar:e,popoverProps:o,className:a,...n})}function af(e,t){if(!e)return"";if(!t)return e;if(e.startsWith("var(--global-")){const n=t.find(t=>t.value===e);if(n)return n.color;let o=e.replace("var(--global-","");o=o.substring(0,8),o="theme-"+o;const a=t.find(e=>e.slug===o);if(a&&!a.color.startsWith("var("))return a.color;let r=window.getComputedStyle(document.documentElement).getPropertyValue(e.replace("var(","").replace(" ","").replace(")",""));if(""===r&&(r=window.getComputedStyle(document.documentElement).getPropertyValue(e.replace("var(","").replace(" ","").split(",")[0].replace(")",""))),r)return r}else if(e.startsWith("var(")){let t=window.getComputedStyle(document.documentElement).getPropertyValue(e.replace("var(","").replace(" ","").replace(")",""));if(""===t&&(t=window.getComputedStyle(document.documentElement).getPropertyValue(e.replace("var(","").replace(" ","").split(",")[0].replace(")",""))),t)return t}return e}function rf({disableRemove:e,gradientPickerDomRef:t,ignoreMarkerPosition:n,value:o,onChange:a,onStartControlPointChange:r,onStopControlPointChange:i,isRenderedInSidebar:s}){const l=(0,Pi.useRef)(),c=e=>{const n=Qh(e.clientX,t.current),{initialPosition:r,index:i,significantMoveHappened:s}=l.current;!s&&Math.abs(r-n)>=5&&(l.current.significantMoveHappened=!0),a(Zh(o,i,n))},u=()=>{window&&window.removeEventListener&&l.current&&l.current.listenersActivated&&(window.removeEventListener("mousemove",c),window.removeEventListener("mouseup",u),i(),l.current.listenersActivated=!1)},d=(0,Pi.useRef)();d.current=u,(0,Pi.useEffect)(()=>()=>{d.current()},[]);const p=!(0,Hi.useSetting)("color.custom"),h=(0,Hi.useSetting)("color.palette");return o.map((t,d)=>{const f=t?.position,b=af(t.color,h);return n!==f&&(0,Ai.jsx)(of,{isRenderedInSidebar:s,onClose:i,renderToggle:({isOpen:e,onToggle:n})=>(0,Ai.jsx)(nf,{onClick:()=>{l.current&&l.current.significantMoveHappened||(e?i():r(),n())},onMouseDown:()=>{window&&window.addEventListener&&(l.current={initialPosition:f,index:d,significantMoveHappened:!1,listenersActivated:!0},r(),window.addEventListener("mousemove",c),window.addEventListener("mouseup",u))},onKeyDown:e=>{"ArrowLeft"===e.code?(e.stopPropagation(),a(Zh(o,d,qh(t.position-Wh)))):"ArrowRight"===e.code&&(e.stopPropagation(),a(Zh(o,d,qh(t.position+Wh))))},isOpen:e,position:t.position,color:t.color},d),renderContent:({onClose:n})=>(0,Ai.jsxs)("div",{className:"kadence-pop-gradient-color-picker",children:[!p&&(0,Ai.jsx)(Fi,{color:b,onChange:e=>{a(Kh(o,d,Uh(e.rgb).toRgbString()))},onChangeComplete:e=>{a(Kh(o,d,Uh(e.rgb).toRgbString()))}}),h&&(0,Ai.jsx)("div",{className:"kadence-pop-color-palette-swatches",children:(0,zi.map)(h,({color:e,slug:n,name:r})=>{const i={color:e},s=n.replace("theme-",""),l=n.startsWith("theme-palette")&&e===t.color||n.startsWith("theme-palette")&&b===e,c=!n.startsWith("theme-palette")&&e.startsWith("var(")&&(b===e||e===t.color);return(0,Ai.jsxs)("div",{className:"kadence-color-palette__item-wrapper",children:[(0,Ai.jsx)(Ii.Tooltip,{text:r||
// translators: %s: color hex code e.g: "#f00".
// translators: %s: color hex code e.g: "#f00".
(0,Ui.sprintf)((0,Ui.__)("Color code: %s"),e),children:(0,Ai.jsx)(Ii.Button,{type:"button",className:"kadence-color-palette__item "+(l||c?"is-active":""),style:i,onClick:()=>{n.startsWith("theme-palette")&&!e.startsWith("var(")?a(Kh(o,d,"var(--global-"+s+","+e+")")):e.startsWith("var(")?a(Kh(o,d,e)):a(Kh(o,d,Uh(e).toRgbString()))},"aria-label":r?
// translators: %s: The name of the color e.g: "vivid red".
// translators: %s: The name of the color e.g: "vivid red".
(0,Ui.sprintf)((0,Ui.__)("Color: %s","kadence-blocks"),r):
// translators: %s: color hex code e.g: "#f00".
// translators: %s: color hex code e.g: "#f00".
(0,Ui.sprintf)((0,Ui.__)("Color code: %s","kadence-blocks"),e),"aria-pressed":l||c})}),l&&(0,Ai.jsx)(Ii.Dashicon,{icon:"admin-site"}),!n.startsWith("theme-palette")&&b===e&&(0,Ai.jsx)(Ii.Dashicon,{icon:"saved"})]},e)})}),void 0!==t?.position&&(0,Ai.jsx)(Ii.__experimentalNumberControl,{label:(0,Ui.__)("Control Point Position %","kadence-blocks"),value:t.position,onChange:e=>{a(Zh(o,d,qh(parseFloat(e))))},min:0,step:.01,max:100,style:{paddingBottom:"10px"}}),!e&&o.length>2&&(0,Ai.jsx)(Ii.__experimentalHStack,{className:"components-custom-gradient-picker__remove-control-point-wrapper",alignment:"center",children:(0,Ai.jsx)(Ii.Button,{onClick:()=>{a(function(e,t){return e.filter((e,n)=>n!==t)}(o,d)),n()},variant:"link",children:(0,Ui.__)("Remove Control Point")})})]}),style:{left:`${t.position}%`,transform:"translateX( -50% )"}},d)})}rf.InsertPoint=function({value:e,onChange:t,onOpenInserter:n,onCloseInserter:o,insertPosition:a,isRenderedInSidebar:r}){const[i,s]=(0,Pi.useState)(!1),l=!(0,Hi.useSetting)("color.custom"),c=(0,Hi.useSetting)("color.palette"),[u,d]=(0,Pi.useState)(""),p=af(u,c);return(0,Ai.jsx)(of,{isRenderedInSidebar:r,className:"components-custom-gradient-picker__inserter",onClose:()=>{o()},renderToggle:({isOpen:e,onToggle:t})=>(0,Ai.jsx)(Ii.Button,{"aria-expanded":e,"aria-haspopup":"true",onClick:()=>{e?o():(s(!1),n()),t()},className:"components-custom-gradient-picker__insert-point-dropdown",icon:Gh}),renderContent:()=>(0,Ai.jsxs)("div",{className:"kadence-pop-gradient-color-picker",children:[!l&&(0,Ai.jsx)(Fi,{color:p,onChange:n=>{d(Uh(n.rgb).toRgbString()),i?t(Yh(e,a,Uh(n.rgb).toRgbString())):(t(Xh(e,a,Uh(n.rgb).toRgbString())),s(!0))},onChangeComplete:n=>{d(Uh(n.rgb).toRgbString()),i?t(Yh(e,a,Uh(n.rgb).toRgbString())):(t(Xh(e,a,Uh(n.rgb).toRgbString())),s(!0))}}),c&&(0,Ai.jsx)("div",{className:"kadence-pop-color-palette-swatches",children:(0,zi.map)(c,({color:n,slug:o,name:r})=>{const l={color:n},c=o.replace("theme-",""),h=o.startsWith("theme-palette")&&n===u||o.startsWith("theme-palette")&&p===n,f=!o.startsWith("theme-palette")&&n.startsWith("var(")&&u===n;return(0,Ai.jsxs)("div",{className:"kadence-color-palette__item-wrapper",children:[(0,Ai.jsx)(Ii.Tooltip,{text:r||
// translators: %s: color hex code e.g: "#f00".
// translators: %s: color hex code e.g: "#f00".
(0,Ui.sprintf)((0,Ui.__)("Color code: %s"),n),children:(0,Ai.jsx)(Ii.Button,{type:"button",className:"kadence-color-palette__item "+(h||f?"is-active":""),style:l,onClick:()=>{d(Uh(n).toRgbString()),o.startsWith("theme-palette")&&!n.startsWith("var(")?i?t(Yh(e,a,"var(--global-"+c+","+n+")")):(t(Xh(e,a,"var(--global-"+c+","+n+")")),s(!0)):n.startsWith("var(")?(d(n),i?t(Yh(e,a,n)):(t(Xh(e,a,n)),s(!0))):i?t(Yh(e,a,Uh(n).toRgbString())):(t(Xh(e,a,Uh(n).toRgbString())),s(!0))},"aria-label":r?
// translators: %s: The name of the color e.g: "vivid red".
// translators: %s: The name of the color e.g: "vivid red".
(0,Ui.sprintf)((0,Ui.__)("Color: %s","kadence-blocks"),r):
// translators: %s: color hex code e.g: "#f00".
// translators: %s: color hex code e.g: "#f00".
(0,Ui.sprintf)((0,Ui.__)("Color code: %s","kadence-blocks"),n)})}),h&&(0,Ai.jsx)(Ii.Dashicon,{icon:"admin-site"}),!o.startsWith("theme-palette")&&u===n&&(0,Ai.jsx)(Ii.Dashicon,{icon:"saved"})]},n)})})]}),style:null!==a?{left:`${a}%`,transform:"translateX( -50% )"}:void 0})};const sf=rf;function lf(e,t){switch(t.type){case"MOVE_INSERTER":if("IDLE"===e.id||"MOVING_INSERTER"===e.id)return{id:"MOVING_INSERTER",insertPosition:t.insertPosition};break;case"STOP_INSERTER_MOVE":if("MOVING_INSERTER"===e.id)return{id:"IDLE"};break;case"OPEN_INSERTER":if("MOVING_INSERTER"===e.id)return{id:"INSERTING_CONTROL_POINT",insertPosition:e.insertPosition};break;case"CLOSE_INSERTER":if("INSERTING_CONTROL_POINT"===e.id)return{id:"IDLE"};break;case"START_CONTROL_CHANGE":if("IDLE"===e.id)return{id:"MOVING_CONTROL_POINT"};break;case"STOP_CONTROL_CHANGE":if("MOVING_CONTROL_POINT"===e.id)return{id:"IDLE"}}return e}const cf={id:"IDLE"};function uf({background:e,hasGradient:t,value:n,onChange:o,disableInserter:a=!1,isRenderedInSidebar:r}){const i=(0,Pi.useRef)(),[s,l]=(0,Pi.useReducer)(lf,cf),c=e=>{const t=Qh(e.clientX,i.current);(0,zi.some)(n,({position:e})=>Math.abs(t-e)<$h)?"MOVING_INSERTER"===s.id&&l({type:"STOP_INSERTER_MOVE"}):l({type:"MOVE_INSERTER",insertPosition:t})},u="MOVING_INSERTER"===s.id,d="INSERTING_CONTROL_POINT"===s.id;return(0,Ai.jsx)("div",{className:th()("components-custom-gradient-picker__gradient-bar",{"has-gradient":t}),onMouseEnter:c,onMouseMove:c,style:{background:e},onMouseLeave:()=>{l({type:"STOP_INSERTER_MOVE"})},children:(0,Ai.jsxs)("div",{ref:i,className:"components-custom-gradient-picker__markers-container",children:[!a&&(u||d)&&(0,Ai.jsx)(sf.InsertPoint,{isRenderedInSidebar:r,insertPosition:s.insertPosition,value:n,onChange:o,onOpenInserter:()=>{l({type:"OPEN_INSERTER"})},onCloseInserter:()=>{l({type:"CLOSE_INSERTER"})}}),(0,Ai.jsx)(sf,{isRenderedInSidebar:r,disableRemove:a,gradientPickerDomRef:i,ignoreMarkerPosition:d?s.insertPosition:void 0,value:n,onChange:o,onStartControlPointChange:()=>{l({type:"START_CONTROL_CHANGE"})},onStopControlPointChange:()=>{l({type:"STOP_CONTROL_CHANGE"})}})]})})}var df=a(9942);const pf="linear-gradient(135deg, rgb(6, 147, 227) 0%, rgb(20, 39, 109) 100%)",hf={type:"angular",value:90},ff=[{type:"shape",value:"ellipse",at:{type:"position",value:{x:{type:"position-keyword",value:"center"},y:{type:"position-keyword",value:"center"}}}}],bf=[{value:"linear-gradient",label:(0,Ui.__)("Linear","kadence-blocks")},{value:"radial-gradient",label:(0,Ui.__)("Radial","kadence-blocks")}],mf=[{value:"center top",label:(0,Ui.__)("Center Top","kadence-blocks")},{value:"center center",label:(0,Ui.__)("Center Center","kadence-blocks")},{value:"center bottom",label:(0,Ui.__)("Center Bottom","kadence-blocks")},{value:"left top",label:(0,Ui.__)("Left Top","kadence-blocks")},{value:"left center",label:(0,Ui.__)("Left Center","kadence-blocks")},{value:"left bottom",label:(0,Ui.__)("Left Bottom","kadence-blocks")},{value:"right top",label:(0,Ui.__)("Right Top","kadence-blocks")},{value:"right center",label:(0,Ui.__)("Right Center","kadence-blocks")},{value:"right bottom",label:(0,Ui.__)("Right Bottom","kadence-blocks")}],gf={top:0,"top right":45,"right top":45,right:90,"right bottom":135,"bottom right":135,bottom:180,"bottom left":225,"left bottom":225,left:270,"top left":315,"left top":315};function vf({type:e,value:t,length:n}){return`${function({type:e,value:t}){return"literal"===e?t:"hex"===e?`#${t}`:`${e}(${t.join(",")})`}({type:e,value:t})} ${function(e){if(!e)return"";const{value:t,type:n}=e;return`${t}${n}`}(n)}`}function xf({type:e,orientation:t,colorStops:n}){const o=function(e,t){if("radial-gradient"===e){if(!t||!t[0]||"shape"!==t[0].type)return;return"%"===t[0].at.value.x.type?`${t[0].value} at ${t[0].at.value.x.value}% ${t[0].at.value.y.value}%`:`${t[0].value} at ${t[0].at.value.x.value} ${t[0].at.value.y.value}`}if(t&&"angular"===t.type)return`${t.value}deg`}(e,t);return`${e}(${[o,...n.sort((e,t)=>{var n,o;return(null!==(n=e?.length?.value)&&void 0!==n?n:0)-(null!==(o=t?.length?.value)&&void 0!==o?o
(0,Ui.__)("Heading %d","kadence-blocks"),e),isActive:!(e!==p||!h||"heading"!==h),onClick:()=>t(e)}]),m=a?Ii.ToolbarDropdownMenu:Ii.ToolbarGroup;return[t&&(0,Ai.jsxs)("div",{className:"kb-tag-level-control components-base-control"+(o?" "+o:""),children:[e&&(0,Ai.jsx)("div",{className:"kadence-component__header kadence-tag-select__header",children:e&&(0,Ai.jsxs)("div",{className:"kadence-component__header__title kadence-tag-select__title",children:[(0,Ai.jsx)("label",{className:"components-base-control__label",children:e}),i&&(0,Ai.jsx)("div",{className:"title-reset-wrap",children:(0,Ai.jsx)(Ii.Button,{className:"is-reset is-single",label:"reset",isSmall:!0,disabled:!!(0,zi.isEqual)(u,n),icon:Rf,onClick:()=>d()})})]})}),(0,Ai.jsx)("div",{className:"kadence-controls-content kb-tag-select-control-inner",children:(0,Ai.jsx)(m,{isCollapsed:a,label:r,controls:s?b:f})})]})]}function Cb(e,t){if(!t)return"";if(!e)return"";if("0"===t)return 0;const n=e.find(e=>e.value===t);return n?n.size:""}function jb({label:e,onChange:t,value:n="",className:o="",options:a=Bi.GAP_SIZES_MAP,step:r=1,max:i=200,min:s=0,defaultValue:l="",unit:c="px",onUnit:u,units:d=["px","em","rem"],disableCustomSizes:p=!1,customControl:h=!1,setCustomControl:f=null,parentLabel:b=null,reset:m=!0,radio:g=!0}){const[v,x]=(0,Pi.useState)(!1);(0,Pi.useEffect)(()=>{x(function(e,t){return!!t&&!!e&&!e.find(e=>e.value===t)}(a,n))},[]);const k=f?h:v,y=f||x,_=d.map(e=>({value:e,label:e})),w=k?n:function(e,t){if(!t)return"";if(!e)return"";if("0"===t)return 0;const n=e.find(e=>e.value===t);return n?n.value:""}(a,n),C=[{value:"",output:"",size:"",label:(0,Ui.__)("Inherit","kadence-blocks"),name:(0,Ui.__)("Inherit","kadence-blocks")},...a];return[t&&(0,Ai.jsxs)("div",{className:"components-base-control component-gap-size-control kadence-gap-size-control"+(o?" "+o:""),children:[!f&&e&&(0,Ai.jsx)("div",{className:"kadence-gap-size-control__header kadence-component__header",children:(0,Ai.jsxs)("div",{className:"kadence-component__header__title kadence-radio-range__title",children:[(0,Ai.jsx)("label",{className:"components-base-control__label",children:e}),m&&(0,Ai.jsx)("div",{className:"title-reset-wrap",children:(0,Ai.jsx)(Ii.Button,{className:"is-reset is-single",label:"reset",isSmall:!0,disabled:!!(0,zi.isEqual)(l,n),icon:Rf,onClick:()=>{"function"==typeof m?m():t(l)}})})]})}),!k&&g&&(0,Ai.jsx)("div",{className:"kadence-controls-content",children:(0,Ai.jsxs)(Ii.ButtonGroup,{className:"kadence-radio-container-control",children:[a.map((e,n)=>(0,Ai.jsx)(Ii.Button,{isTertiary:w!==e.value,className:"kadence-radio-item radio-"+e.value,isPrimary:w===e.value,icon:void 0!==e.icon?e.icon:void 0,"aria-pressed":w===e.value,onClick:()=>{w==e.value&&""==l?t(""):t(e.value)},children:e.label},`${e.label}-${e.value}-${n}`)),!p&&(0,Ai.jsx)(Ii.Button,{className:"kadence-radio-item radio-custom only-icon",label:(0,Ui.__)("Set custom size","kadence-blocks"),icon:nh,onClick:()=>{w&&"px"===c&&t(Cb(a,w)),y(!0)},isPressed:!1,isTertiary:!0})]})}),!k&&!g&&(0,Ai.jsxs)("div",{className:"kadence-controls-content kadence-gap-size-select-control-wrap",children:[(0,Ai.jsx)(Ii.SelectControl,{className:"kadence-gap-size-select-control",value:w,options:C,onChange:e=>{t(w==e&&""==l?"":e)}}),!p&&(0,Ai.jsx)(Ii.ButtonGroup,{className:"kadence-radio-container-control",children:(0,Ai.jsx)(Ii.Button,{className:"kadence-radio-item radio-custom only-icon",label:(0,Ui.__)("Set custom size","kadence-blocks"),icon:nh,onClick:()=>{w&&"px"===c&&t(Cb(a,w)),y(!0)},isPressed:!1,isTertiary:!0})})]}),k&&(0,Ai.jsxs)("div",{className:"kadence-controls-content kadence-single-unit-control",children:[(0,Ai.jsx)(Ii.__experimentalUnitControl,{label:b&&e?e:void 0,labelPosition:"top",min:s,max:i,step:r,units:_,value:n,disableUnits:!0,onChange:e=>(e=>{const n=isNaN(parseFloat(e))?void 0:parseFloat(e);t(n)})(e)}),(0,Ai.jsx)("div",{className:"kadence-measure-control-select-wrapper",children:(0,Ai.jsx)("select",{className:"kadence-measure-control-select components-unit-control__select",onChange:e=>{u(e.target.value)},value:c,children:d.map(e=>(0
(0,Ui.__)("Heading %d","kadence-blocks"),t),isActive:!(t!==e||!n||"heading"!==n),onClick:()=>_(t,"heading")}]);q.p&&re.push([{icon:(0,Ai.jsx)(Lp,{level:"p",isPressed:!(!n||"p"!==n)}),title:(0,Ui.__)("Paragraph","kadence-blocks"),isActive:!(!n||"p"!==n),onClick:()=>_(2,"p")}]),q.span&&re.push([{icon:(0,Ai.jsx)(Lp,{level:"span",isPressed:!(!n||"span"!==n)}),title:(0,Ui.__)("Span","kadence-blocks"),isActive:!(!n||"span"!==n),onClick:()=>_(2,"span")}]),q.div&&re.push([{icon:(0,Ai.jsx)(Lp,{level:"div",isPressed:!(!n||"div"!==n)}),title:(0,Ui.__)("Div","kadence-blocks"),isActive:!(!n||"div"!==n),onClick:()=>_(2,"div")}]);const ie=()=>{T?T({google:!1,family:"",variant:"",weight:"inherit",style:"normal",subset:""}):(P(!1),j(""),S(""),O("inherit"),N("normal"),E(""))},se=[{value:"none",label:(0,Ui.__)("-","kadence-blocks"),tooltip:(0,Ui.__)("None","kadence-blocks")},{value:"uppercase",label:(0,Ui.__)("AB","kadence-blocks"),tooltip:(0,Ui.__)("Uppercase","kadence-blocks")},{value:"lowercase",label:(0,Ui.__)("ab","kadence-blocks"),tooltip:(0,Ui.__)("Lowercase","kadence-blocks")},{value:"capitalize",label:(0,Ui.__)("Ab","kadence-blocks"),tooltip:(0,Ui.__)("Capitalize","kadence-blocks")}],le="px"!==l?120:3e3,ce="px"!==l?.001:1,ue="px"!==i?.2:5,de="px"!==i?120:3e3,pe="px"!==i?.001:1,he=ne.some(function(e){return"regular"===e.value});return(0,Ai.jsx)(Ai.Fragment,{children:(0,Ai.jsxs)("div",{className:"components-base-control kb-typography-control",children:[t&&(0,Ai.jsx)("div",{className:"kadence-title-bar kadence-component__header",children:(0,Ai.jsx)("label",{className:"kadence-heading-fontfamily-title components-typography-control__label kadence-component__header__title",children:t})}),(0,Ai.jsxs)("div",{className:"kadence-title-bar",children:[t&&(0,Ai.jsx)("h2",{className:"kt-heading-fontfamily-title",children:t}),J&&(0,Ai.jsx)(Ii.Button,{className:"is-reset is-single",isSmall:!0,disabled:!!(0,zi.isEqual)(ae,Z),icon:Rf,onClick:()=>{"function"==typeof J?J():T(Z)}})]}),y&&(0,Ai.jsxs)(Ai.Fragment,{children:[_&&(0,Ai.jsx)(wb,{label:(0,Ui.__)("HTML Tag","kadence-blocks"),value:"heading"===n?e:n,onChange:e=>{"div"===e||"p"===e||"span"===e?_(2,e):_(e,"heading")}}),!_&&(0,Ai.jsx)(wb,{label:(0,Ui.__)("HTML Tag","kadence-blocks"),value:e,headingOnly:!0,tagHighLevel:a,tagLowLevel:o,onChange:e=>{y(e)}})]}),C&&A&&(0,Ai.jsx)(mb,{label:(0,Ui.__)("Font Size","kadence-blocks"),value:s&&void 0!==s[0]?s[0]:"",onChange:e=>C([e,s&&void 0!==s[1]?s[1]:"",s&&void 0!==s[2]?s[2]:""]),tabletValue:s&&void 0!==s[1]?s[1]:"",onChangeTablet:e=>C([s&&void 0!==s[0]?s[0]:"",e,s&&void 0!==s[2]?s[2]:""]),mobileValue:s&&void 0!==s[2]?s[2]:"",onChangeMobile:e=>C([s&&void 0!==s[0]?s[0]:"",s&&void 0!==s[1]?s[1]:"",e]),min:0,max:le,step:ce,unit:l||"px",onUnit:e=>A(e),units:["px","em","rem","vw"]}),!G&&w&&L&&(0,Ai.jsx)(vb,{label:(0,Ui.__)("Line Height","kadence-blocks"),value:r&&void 0!==r[0]?r[0]:"",onChange:e=>w([e,r&&void 0!==r[1]?r[1]:"",r&&void 0!==r[2]?r[2]:""]),tabletValue:r&&void 0!==r[1]?r[1]:"",onChangeTablet:e=>w([r&&void 0!==r[0]?r[0]:"",e,r&&void 0!==r[2]?r[2]:""]),mobileValue:r&&void 0!==r[2]?r[2]:"",onChangeMobile:e=>w([r&&void 0!==r[0]?r[0]:"",r&&void 0!==r[1]?r[1]:"",e]),min:ue,max:de,step:pe,unit:i||"-",onUnit:e=>L(e),units:["-","px","em","rem"]}),G&&w&&L&&(0,Ai.jsxs)(og,{className:"kb-font-settings",children:[(0,Ai.jsx)(vb,{label:(0,Ui.__)("Line Height","kadence-blocks"),value:r&&void 0!==r[0]?r[0]:"",onChange:e=>w([e,r&&void 0!==r[1]?r[1]:"",r&&void 0!==r[2]?r[2]:""]),tabletValue:r&&void 0!==r[1]?r[1]:"",onChangeTablet:e=>w([r&&void 0!==r[0]?r[0]:"",e,r&&void 0!==r[2]?r[2]:""]),mobileValue:r&&void 0!==r[2]?r[2]:"",onChangeMobile:e=>w([r&&void 0!==r[0]?r[0]:"",r&&void 0!==r[1]?r[1]:"",e]),min:ue,max:de,step:pe,unit:i||"-",onUnit:e=>L(e),units:["-","px","em","rem"],compressedDevice:!0}),(0,Ai.jsx)(Fp,{label:(0,Ui.__)("Letter Case","kadence-blocks"),value:U,options:se,className:"kb-letter-case",allowClear:!0,onChange:e=>G(e)})]}),G&&(!w||!L)&&(0,Ai.jsx)(Fp,{label:(0,Ui.__)("Letter Case","kadence-blocks"),value:U,options:se,className:"kb-letter-case",allowCle