Plugin Directory

Changeset 3408408


Ignore:
Timestamp:
12/02/2025 07:24:41 PM (4 months ago)
Author:
britner
Message:

Update to version 3.5.28 from GitHub

Location:
kadence-blocks
Files:
20 edited
1 copied

Legend:

Unmodified
Added
Removed
  • kadence-blocks/tags/3.5.28/dist/components.asset.php

    r3391357 r3408408  
    1 <?php return array('dependencies' => array('kadence-helpers', 'kadence-icons', 'lodash', 'react', 'react-dom', 'react-jsx-runtime', 'wp-api-fetch', 'wp-block-editor', 'wp-components', 'wp-compose', 'wp-data', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keycodes', 'wp-notices', 'wp-primitives', 'wp-url'), 'version' => 'ca204dabfe9dcf9253de');
     1<?php return array('dependencies' => array('kadence-helpers', 'kadence-icons', 'lodash', 'react', 'react-dom', 'react-jsx-runtime', 'wp-api-fetch', 'wp-block-editor', 'wp-components', 'wp-compose', 'wp-data', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keycodes', 'wp-notices', 'wp-primitives', 'wp-url'), 'version' => '22f69fa372555e6b5012');
  • kadence-blocks/tags/3.5.28/dist/components.js

    r3375940 r3408408  
    3838// translators: %s: color hex code e.g: "#f00".
    3939// translators: %s: color hex code e.g: "#f00".
    40 (0,Mo.sprintf)((0,Mo.__)("Color code: %s","kadence-blocks"),n)})}),h&&(0,_o.jsx)(yo.Dashicon,{icon:"admin-site"}),!o.startsWith("theme-palette")&&u===n&&(0,_o.jsx)(yo.Dashicon,{icon:"saved"})]},n)})})]}),style:null!==a?{left:`${a}%`,transform:"translateX( -50% )"}:void 0})};const $u=Gu;function Wu(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 qu={id:"IDLE"};function Xu({background:e,hasGradient:t,value:n,onChange:o,disableInserter:a=!1,isRenderedInSidebar:r}){const s=(0,ko.useRef)(),[i,l]=(0,ko.useReducer)(Wu,qu),c=e=>{const t=Fu(e.clientX,s.current);(0,Oo.some)(n,({position:e})=>Math.abs(t-e)<Mu)?"MOVING_INSERTER"===i.id&&l({type:"STOP_INSERTER_MOVE"}):l({type:"MOVE_INSERTER",insertPosition:t})},u="MOVING_INSERTER"===i.id,d="INSERTING_CONTROL_POINT"===i.id;return(0,_o.jsx)("div",{className:Bc()("components-custom-gradient-picker__gradient-bar",{"has-gradient":t}),onMouseEnter:c,onMouseMove:c,style:{background:e},onMouseLeave:()=>{l({type:"STOP_INSERTER_MOVE"})},children:(0,_o.jsxs)("div",{ref:s,className:"components-custom-gradient-picker__markers-container",children:[!a&&(u||d)&&(0,_o.jsx)($u.InsertPoint,{isRenderedInSidebar:r,insertPosition:i.insertPosition,value:n,onChange:o,onOpenInserter:()=>{l({type:"OPEN_INSERTER"})},onCloseInserter:()=>{l({type:"CLOSE_INSERTER"})}}),(0,_o.jsx)($u,{isRenderedInSidebar:r,disableRemove:a,gradientPickerDomRef:s,ignoreMarkerPosition:d?i.insertPosition:void 0,value:n,onChange:o,onStartControlPointChange:()=>{l({type:"START_CONTROL_CHANGE"})},onStopControlPointChange:()=>{l({type:"STOP_CONTROL_CHANGE"})}})]})})}var Ju=a(9942);const Ku="linear-gradient(135deg, rgb(6, 147, 227) 0%, rgb(20, 39, 109) 100%)",Yu={type:"angular",value:90},Zu=[{type:"shape",value:"ellipse",at:{type:"position",value:{x:{type:"position-keyword",value:"center"},y:{type:"position-keyword",value:"center"}}}}],Qu=[{value:"linear-gradient",label:(0,Mo.__)("Linear","kadence-blocks")},{value:"radial-gradient",label:(0,Mo.__)("Radial","kadence-blocks")}],ed=[{value:"center top",label:(0,Mo.__)("Center Top","kadence-blocks")},{value:"center center",label:(0,Mo.__)("Center Center","kadence-blocks")},{value:"center bottom",label:(0,Mo.__)("Center Bottom","kadence-blocks")},{value:"left top",label:(0,Mo.__)("Left Top","kadence-blocks")},{value:"left center",label:(0,Mo.__)("Left Center","kadence-blocks")},{value:"left bottom",label:(0,Mo.__)("Left Bottom","kadence-blocks")},{value:"right top",label:(0,Mo.__)("Right Top","kadence-blocks")},{value:"right center",label:(0,Mo.__)("Right Center","kadence-blocks")},{value:"right bottom",label:(0,Mo.__)("Right Bottom","kadence-blocks")}],td={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 nd({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 od({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)}).map(nd)].filter(Boolean).join(",")})`}function ad(e){return void 0===e.length||"%"!==e.length.type}function rd(e){switch(e.type){case"hex":return`#${e.value}`;case"literal":return e.value;case"rgb":case"rgba":return`${e.type}(${e.value.join(",")})`;default:return"transparent"}}const sd=({gradientAST:e,hasGradient:t,onChange:n})=>{var o;const a=null!==(o=e?.orientation?.value)&&void 0!==o?o:180;return(0,_o.jsx)(yo.AnglePickerControl,{__nextHasNoMarginBottom:!0,onChange:t=>{n(od({...e,orientation:{type:"angular",value:t}}))},labelPosition:"top",value:t?a:""})},id=({gradientAST:e,hasGradient:t,onChange:n})=>{const{type:o}=e;return(0,_o.jsx)(yo.SelectControl,{className:"components-custom-gradient-picker__type-picker kadence-select-large",label:(0,Mo.__)("Type"),labelPosition:"top",onChange:t=>{"linear-gradient"===t&&n(od({...e,orientation:Yu,type:"linear-gradient"})),"radial-gradient"===t&&n(od({...e,orientation:Zu,type:"radial-gradient"}))},options:Qu,value:t&&o})},ld=({gradientAST:e,hasGradient:t,onChange:n})=>{let o="center center",a="50%",r="50%",s="position-keyword";e?.orientation&&e?.orientation[0]?.at?.value?.x?.value&&(s=e.orientation[0].at.value.x.type,"position-keyword"!==s?(o=e.orientation[0].at.value.x.value+"% "+e.orientation[0].at.value.y.value+"%",a=e.orientation[0].at.value.x.value+"%",r=e.orientation[0].at.value.y.value+"%"):o=e.orientation[0].at.value.x.value+" "+e.orientation[0].at.value.y.value);const i=t=>{const a=o.split(" ");let r="%"===t?50:"center",s="%"===t?50:"center";if(a[0])switch(a[0]){case"left":r=0;break;case"right":r="100";break;case"center":r=50;break;case 0:s="left";break;case 100:s="right";break;case 50:s="center"}if(a[1])switch(a[1]){case"top":s=0;break;case"bottom":s=100;break;case"center":s=50;break;case 0:s="top";break;case 100:s="bottom";break;case 50:s="center"}n(od({...e,orientation:[{type:"shape",value:e.orientation[0].value,at:{type:"position",value:{x:{type:t,value:r},y:{type:t,value:s}}}}]}))};if(t)return(0,_o.jsxs)("div",{className:"components-base-control kadence-gradient-position-control",children:[(0,_o.jsx)(yo.Flex,{justify:"space-between",className:"kadence-gradient-position_header",children:(0,_o.jsx)(yo.FlexItem,{children:(0,_o.jsx)("label",{className:"kadence-gradient-position__label",children:(0,Mo.__)("Position","kadence-blocks")})})}),"position-keyword"===s&&(0,_o.jsxs)("div",{className:"kadence-controls-content",children:[(0,_o.jsx)(yo.SelectControl,{className:"components-custom-gradient-picker__position-picker",onChange:t=>{const o=t.split(" ");n(od({...e,orientation:[{type:"shape",value:e.orientation[0].value,at:{type:"position",value:{x:{type:"position-keyword",value:void 0!==o[0]&&o[0]?o[0]:"center"},y:{type:"position-keyword",value:void 0!==o[1]&&o[1]?o[1]:"center"}}}}]}))},options:ed,value:o}),(0,_o.jsx)(yo.Button,{className:"kadence-control-toggle-advanced only-icon",label:(0,Mo.__)("Set custom position","kadence-blocks"),icon:zc,onClick:()=>i("%"),isPressed:!1,isTertiary:!0})]}),"position-keyword"!==s&&(0,_o.jsxs)("div",{className:"kadence-controls-content",children:[(0,_o.jsx)(yo.__experimentalUnitControl,{labelPosition:"left",label:(0,Mo.__)("Left","kadence-blocks"),max:100,min:0,units:[{value:"%",label:"%"}],value:a,onChange:t=>{n(od({...e,orientation:[{type:"shape",value:e.orientation[0].value,at:{type:"position",value:{x:{type:"%",value:parseInt(t,10)},y:e.orientation[0].at.value.y}}}]}))}}),(0,_o.jsx)(yo.__experimentalUnitControl,{labelPosition:"left",label:(0,Mo.__)("Top","kadence-blocks"),max:100,min:0,value:r,units:[{value:"%",label:"%"}],onChange:t=>{n(od({...e,orientation:[{type:"shape",value:e.orientation[0].value,at:{type:"position",value:{x:e.orientation[0].at.value.x,y:{type:"%",value:parseInt(t,10)}}}}]}))}}),(0,_o.jsx)(yo.Button,{className:"kadence-control-toggle-advanced only-icon",label:(0,Mo.__)("Set standard position","kadence-blocks"),icon:zc,onClick:()=>i("position-keyword"),isPrimary:!0,isPressed:!0})]})]})},cd=({gradientAST:e,hasGradient:t,onChange:n})=>{let o="ellipse";return e?.orientation&&e?.orientation[0]?.type&&"shape"===e?.orientation[0]?.type&&e?.orientation[0]?.value&&(o=e?.orientation&&e?.orientation[0]?.value),(0,_o.jsx)(yo.SelectControl,{className:"components-custom-gradient-picker__shape-picker kadence-select-large",label:(0,Mo.__)("Shape","kadence-blocks"),labelPosition:"top",onChange:t=>{n(od({...e,orientation:[{type:"shape",value:t,at:e.orientation[0].at}]}))},options:[{value:"ellipse",label:(0,Mo.__)("Ellipse","kadence-blocks")},{value:"circle",label:(0,Mo.__)("Circle","kadence-blocks")}],value:t&&o})};function ud({value:e,onChange:t,isRenderedInSidebar:n=!0}){const o=function(e){let t;try{t=Ju.parse(e)[0],t.value=e}catch(e){t=Ju.parse(Ku)[0],t.value=Ku}if("directional"===t.orientation?.type&&(t.orientation.type="angular",t.orientation.value=td[t.orientation.value].toString()),t.colorStops.some(ad)){const{colorStops:e}=t,n=100/(e.length-1);e.forEach((e,t)=>{e.length={value:n*t,type:"%"}}),t.value=od(t)}return t}(e),a=function(e){return od({type:"linear-gradient",orientation:Yu,colorStops:e.colorStops})}(o),r=o.value!==Ku,s=o.colorStops.map(e=>({color:rd(e),position:parseInt(e.length.value)}));return(0,_o.jsxs)("div",{className:"components-base-control components-custom-gradient-picker kadence-gradient-control",children:[(0,_o.jsx)(Xu,{isRenderedInSidebar:n,background:a,hasGradient:r,value:s,onChange:e=>{t(od(function(e,t){return{...e,colorStops:t.map(({position:e,color:t})=>{if(t.startsWith("var("))return{length:{type:"%",value:e?.toString()},type:"literal",value:t};const{r:n,g:o,b:a,a:r}=Ou(t).toRgb();return{length:{type:"%",value:e?.toString()},type:r<1?"rgba":"rgb",value:r<1?[n,o,a,r]:[n,o,a]}})}}(o,e)))}}),(0,_o.jsxs)(yo.Flex,{gap:3,className:"components-custom-gradient-picker__ui-line",children:[(0,_o.jsx)("div",{className:"components-custom-gradient-picker__item components-custom-gradient-picker-type",children:(0,_o.jsx)(id,{gradientAST:o,hasGradient:r,onChange:t})}),"linear-gradient"===o.type&&(0,_o.jsx)("div",{className:"components-custom-gradient-picker__item components-custom-gradient-picker-angle",children:(0,_o.jsx)(sd,{gradientAST:o,hasGradient:r,onChange:t})}),"radial-gradient"===o.type&&(0,_o.jsx)("div",{className:"components-custom-gradient-picker__item components-custom-gradient-picker-shape",children:(0,_o.jsx)(cd,{gradientAST:o,hasGradient:r,onChange:t})})]}),"radial-gradient"===o.type&&(0,_o.jsx)(yo.Flex,{gap:3,className:"components-custom-gradient-picker__ui-line",children:(0,_o.jsx)("div",{className:"components-custom-gradient-picker__item components-custom-gradient-picker-position",children:(0,_o.jsx)(ld,{gradientAST:o,hasGradient:r,onChange:t})})})]})}const dd=[{value:"0",label:(0,Mo.__)("None","kadence-blocks"),size:0,name:(0,Mo.__)("None","kadence-blocks")},{value:"xxs",output:"var(--global-kb-spacing-xxs, 0.5rem)",size:8,label:(0,Mo.__)("XXS","kadence-blocks"),name:(0,Mo.__)("2X Small","kadence-blocks")},{value:"xs",output:"var(--global-kb-spacing-xs, 1rem)",size:16,label:(0,Mo.__)("XS","kadence-blocks"),name:(0,Mo.__)("X Small","kadence-blocks")},{value:"sm",output:"var(--global-kb-spacing-sm, 1.5rem)",size:24,label:(0,Mo.__)("SM","kadence-blocks"),name:(0,Mo.__)("Small","kadence-blocks")},{value:"md",output:"var(--global-kb-spacing-md, 2rem)",size:32,label:(0,Mo.__)("MD","kadence-blocks"),name:(0,Mo.__)("Medium","kadence-blocks")},{value:"lg",output:"var(--global-kb-spacing-lg, 3rem)",size:48,label:(0,Mo.__)("LG","kadence-blocks"),name:(0,Mo.__)("Large","kadence-blocks")},{value:"xl",output:"var(--global-kb-spacing-xl, 4rem)",size:64,label:(0,Mo.__)("XL","kadence-blocks"),name:(0,Mo.__)("X Large","kadence-blocks")},{value:"xxl",output:"var(--global-kb-spacing-xxl, 5rem)",size:80,label:(0,Mo.__)("XXL","kadence-blocks"),name:(0,Mo.__)("2X Large","kadence-blocks")},{value:"3xl",output:"var(--global-kb-spacing-3xl, 6.5rem)",size:104,label:(0,Mo.__)("3XL","kadence-blocks"),name:(0,Mo.__)("3X Large","kadence-blocks")},{value:"4xl",output:"var(--global-kb-spacing-4xl, 8rem)",size:128,label:(0,Mo.__)("4XL","kadence-blocks"),name:(0,Mo.__)("4X Large","kadence-blocks")},{value:"5xl",output:"var(--global-kb-spacing-5xl, 10rem)",size:160,label:(0,Mo.__)("5XL","kadence-blocks"),name:(0,Mo.__)("5X Large","kadence-blocks")}];function pd(e,t){if(!t)return;if(!e)return;if("0"===t||"default"===t)return 0;return e.findIndex(e=>e.value===t)||void 0}function hd({label:e,onChange:t,value:n="",placeholder:o="",className:a="",options:r=dd,step:s=1,max:i=200,min:l=0,beforeIcon:c="",help:u="",defaultValue:d=0,unit:p="",onUnit:h,units:f=["px","em","rem"],disableCustomSizes:b=!1,customControl:m=!1,setCustomControl:g=null,isPopover:v=!1,isSingle:x=!1,parentLabel:k=null,onMouseOver:y,onMouseOut:_,allowAuto:w=!1}){const[C,j]=(0,ko.useState)(!1),[S,N]=(0,ko.useState)(!1),O=JSON.parse(JSON.stringify(r));O.push({value:"ss-auto",output:"var(--global-kb-spacing-auto, auto)",label:(0,Mo.__)("Auto","kadence-blocks"),size:0,name:(0,Mo.__)("Auto","kadence-blocks")}),(0,ko.useEffect)(()=>{j(function(e,t){return!!t&&!!e&&!e.find(e=>e.value===t)}(O,n))},[]);const E=g?m:C,M=g||j,T=r.map((e,t)=>({value:t,label:void 0})),R=f.map(e=>({value:e,label:e})),I=E?Number(n):pd(O,n),P=E?Number(o):pd(O,o),L=O[I]?.label?O[I]?.label:(0,Mo.__)("Unset","kadence-blocks"),A=O[I]?.name?O[I]?.name+" "+O[I]?.size+"px":(0,Mo.__)("Unset","kadence-blocks"),D=k?k+" ":"";let F=e;x?F=A:e&&D&&(F=D+e+" "+L);const V=(0,_o.jsxs)(_o.Fragment,{children:[(0,_o.jsx)(yo.RangeControl,{label:F||void 0,className:"components-spacing-sizes-control__range-control",beforeIcon:c,value:"ss-auto"==n?"":I,onChange:e=>{var n;t(void 0===e?d:void 0===(n=e)?"":0===parseInt(n,10)?"0":`${r[n]?.value}`)},min:0,max:r.length-1,marks:T,step:1,help:u,withInputField:!1,"aria-valuenow":I,"aria-valuetext":r[I]?.label,renderTooltipContent:e=>O[e]?.label,initialPosition:d||0,allowReset:!!x,hideLabelFromVision:!v&&!x,onMouseOver:y,onMouseOut:_,onMouseDown:e=>{e?.nativeEvent?.offsetX<35&&void 0===n&&t("0")}}),!b&&(0,_o.jsx)(yo.Button,{className:"kadence-radio-item radio-custom only-icon",label:(0,Mo.__)("Set custom size","kadence-blocks"),icon:zc,onClick:()=>M(!0),isPressed:!1,isTertiary:!0})]});return[t&&(0,_o.jsxs)("div",{className:"components-base-control component-spacing-sizes-control kadence-single-measure-range-control"+(a?" "+a:""),children:[!g&&e&&(0,_o.jsx)(yo.Flex,{justify:"space-between",className:"kadence-radio-range__header",children:(0,_o.jsx)(yo.FlexItem,{children:(0,_o.jsx)("label",{className:"components-base-control__label",children:e})})}),!E&&(0,_o.jsxs)("div",{className:"kadence-controls-content",children:[v&&(0,_o.jsxs)(_o.Fragment,{children:[(0,_o.jsxs)(yo.Button,{className:"kadence-popover-spacing-btn",disabled:!(!n||"auto"!=n),tabIndex:"-1",onClick:n&&"auto"==n?"":function(){N(!S)},onMouseOver:y,onMouseOut:_,children:[k&&e&&(0,_o.jsx)("span",{className:"kadence-placement-label",children:e}),(0,_o.jsxs)("span",{className:"kadence-spacing-btn-val",children:[O[I]?.label,!O[I]?.label&&(0,_o.jsx)("span",{className:"kadence-spacing-btn-placeholder",children:O?.[P]?.label?O?.[P]?.label:o})]})]}),S&&(0,_o.jsx)(yo.Popover,{onClose:function(){N(!1)},className:"kadence-range-popover-settings",children:(0,_o.jsxs)("div",{className:"kadence-range-popover-settings-inner",children:[V,w&&(0,_o.jsx)(yo.Button,{className:"custom-auto-button",variant:"secondary",isSmall:!0,text:(0,Mo.__)("Auto","kadence-blocks"),onClick:()=>t("ss-auto"),isPressed:!(!n||"ss-auto"!=n)}),(0,_o.jsx)(yo.Button,{className:"custom-reset-button",variant:"secondary",isSmall:!0,text:(0,Mo.__)("Reset","kadence-blocks"),onClick:()=>t("")})]})})]}),!v&&(0,_o.jsx)(_o.Fragment,{children:V})]}),E&&(0,_o.jsxs)("div",{className:"kadence-controls-content kadence-single-unit-control",children:[(0,_o.jsx)(yo.__experimentalUnitControl,{label:k&&e?e:void 0,labelPosition:"top",min:l,max:i,disabled:!(!n||"auto"!=n),step:s,units:R,value:n,placeholder:o||void 0,disableUnits:!0,onChange:e=>(e=>{const n=isNaN(parseFloat(e))?void 0:parseFloat(e);t(n)})(e),onMouseOver:y,onMouseOut:_}),!k&&(0,_o.jsx)("div",{className:"kadence-measure-control-select-wrapper",children:(0,_o.jsx)("select",{className:"kadence-measure-control-select components-unit-control__select",onChange:e=>{h(e.target.value)},value:p,children:f.map(e=>(0,_o.jsx)("option",{value:e,selected:p===e||void 0,children:e},e))})}),!b&&(0,_o.jsx)(yo.ButtonGroup,{className:"kadence-radio-container-control",children:(0,_o.jsx)(yo.Button,{className:"kadence-radio-item radio-custom only-icon",label:(0,Mo.__)("Use size preset","kadence-blocks"),icon:zc,isPrimary:!0,onClick:()=>M(!1),isPressed:!0})})]})]})]}tu.pxIcon,tu.emIcon,tu.remIcon,tu.vhIcon,tu.vwIcon,tu.percentIcon;const fd=(0,_o.jsx)(Ho.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,_o.jsx)(Ho.Path,{d:"M10 17.389H8.444A5.194 5.194 0 1 1 8.444 7H10v1.5H8.444a3.694 3.694 0 0 0 0 7.389H10v1.5ZM14 7h1.556a5.194 5.194 0 0 1 0 10.39H14v-1.5h1.556a3.694 3.694 0 0 0 0-7.39H14V7Zm-4.5 6h5v-1.5h-5V13Z"})}),bd=(0,_o.jsx)(Ho.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,_o.jsx)(Ho.Path,{d:"M17.031 4.703 15.576 4l-1.56 3H14v.03l-2.324 4.47H9.5V13h1.396l-1.502 2.889h-.95a3.694 3.694 0 0 1 0-7.389H10V7H8.444a5.194 5.194 0 1 0 0 10.389h.17L7.5 19.53l1.416.719L15.049 8.5h.507a3.694 3.694 0 0 1 0 7.39H14v1.5h1.556a5.194 5.194 0 0 0 .273-10.383l1.202-2.304Z"})});function md(e,t){return!(!t||!e||!(void 0===t[0]||""!==t[0]||void 0===t[1]||""!==t[1]&&"auto"!==t[1]||void 0===t[2]||""!==t[2]||void 0===t[3]||""!==t[3]&&"auto"!==t[3])||(void 0!==t[0]&&""!==t[0]?e.find(e=>e.value===t[0]):void 0!==t[1]&&""!==t[1]&&"auto"!==t[1]?e.find(e=>e.value===t[1]):void 0!==t[2]&&""!==t[2]?e.find(e=>e.value===t[2]):void 0!==t[3]&&""!==t[3]&&"auto"!==t[3]?e.find(e=>e.value===t[3]):e.find(e=>e.value===t)))}function gd(e,t,n){if(!t)return"";if(!e)return"";if("0"===t)return 0;if("px"!==n)return"";const o=e.find(e=>e.value===t);return o?o.size:""}function vd(e,t,n){if(!t)return"";if(!e)return"";if(0===t)return"0";if("px"!==n)return"";const o=e.find(e=>e.size.toString()===t.toString());return o?o.value:""}function xd({label:e,onChange:t,onControl:n,value:o="",className:a="",options:r=dd,step:s=1,max:i=200,min:l=0,beforeIcon:c="",help:u="",placeholder:d=["","","",""],defaultValue:p=["","","",""],control:h="individual",unit:f="",onUnit:b,units:m=["px","em","rem"],disableCustomSizes:g=!1,isBorderRadius:v=!1,firstIcon:x=tu.outlineTopIcon,secondIcon:k=tu.outlineRightIcon,thirdIcon:y=tu.outlineBottomIcon,fourthIcon:_=tu.outlineLeftIcon,linkIcon:w=fd,unlinkIcon:C=bd,customControl:j=!1,setCustomControl:S=null,parentLabel:N=null,reset:O,onMouseOver:E,onMouseOut:M,allowAuto:T=!1}){const R={first:v?tu.topLeftIcon:x,second:v?tu.topRightIcon:k,third:v?tu.bottomRightIcon:y,fourth:v?tu.bottomLeftIcon:_,link:v?tu.radiusLinkedIcon:w,unlink:v?tu.radiusIndividualIcon:C},[I,P]=(0,ko.useState)(!1),[L,A]=(0,ko.useState)(h),D=JSON.parse(JSON.stringify(r));D.push({value:"ss-auto",output:"var(--global-kb-spacing-auto, auto)",label:(0,Mo.__)("Auto","kadence-blocks"),size:0,name:(0,Mo.__)("Auto","kadence-blocks")}),(0,ko.useEffect)(()=>{P(md(D,o))},[]);const F=S?j:I,V=S||P,B=n?h:L,z=n||A;return[t&&(0,_o.jsxs)("div",{className:"components-base-control component-spacing-sizes-control kadence-measure-range-control "+(a?" "+a:""),children:[e&&(0,_o.jsxs)(yo.Flex,{justify:"space-between",className:"kadence-component__header kadence-radio-range__header",children:[e&&(0,_o.jsxs)("div",{className:"kadence-component__header__title kadence-radio-range__title",children:[(0,_o.jsx)("label",{className:"components-base-control__label",children:e}),O&&(0,_o.jsx)("div",{className:"title-reset-wrap",children:(0,_o.jsx)(yo.Button,{className:"is-reset is-single",label:"reset",isSmall:!0,disabled:!!(0,Oo.isEqual)(p,o),icon:undo,onClick:()=>{"function"==typeof O?O():t(p)}})})]}),!g&&(0,_o.jsx)(yo.Button,{className:"kadence-radio-item radio-custom only-icon",label:F?(0,Mo.__)("Use size preset","kadence-blocks"):(0,Mo.__)("Set custom size","kadence-blocks"),icon:zc,isSmall:!0,onClick:()=>{if(F){const e=[vd(r,o?o[0]:"",f),vd(r,o?o[1]:"",f),vd(r,o?o[2]:"",f),vd(r,o?o[3]:"",f)];t(e)}else{const e=[gd(r,o?o[0]:"",f),gd(r,o?o[1]:"",f),gd(r,o?o[2]:"",f),gd(r,o?o[3]:"",f)];t(e)}V(!F)},isPressed:!!F,isTertiary:!F}),z&&(0,_o.jsx)(yo.Button,{isSmall:!0,className:"kadence-radio-item radio-custom is-single only-icon",label:"individual"!==B?(0,Mo.__)("Individual","kadence-blocks"):(0,Mo.__)("Linked","kadence-blocks"),icon:"individual"!==B?R.link:R.unlink,onClick:()=>z("individual"!==B?"individual":"linked"),isPressed:"individual"!==B,isTertiary:"individual"===B})]}),(0,_o.jsxs)("div",{className:"kadence-controls-content",children:["individual"!==B&&(0,_o.jsx)(_o.Fragment,{children:(0,_o.jsx)(hd,{value:o?o[0]:"",onChange:e=>t([e,e,e,e]),className:"kb-measure-input-all-inputs",min:l,max:i,options:r,step:s,help:u,unit:f,units:m,onUnit:b,defaultValue:p[0],placeholder:d?.[0]?d?.[0]:"",allowReset:!1,disableCustomSizes:!0,setCustomControl:V,customControl:F,isPopover:!1,isSingle:!0,onMouseOver:E,onMouseOut:M,allowAuto:T})}),"individual"===B&&(0,_o.jsxs)(_o.Fragment,{children:[(0,_o.jsx)(hd,{parentLabel:N||e,label:(0,Mo.__)("Top","kadence-blocks"),className:"kb-measure-box-top",value:o?o[0]:"",onChange:e=>{t([e,o&&void 0!==o[1]?o[1]:"",o&&void 0!==o[2]?o[2]:"",o&&void 0!==o[3]?o[3]:""])},min:l,max:i,options:r,step:s,help:u,unit:f,units:m,onUnit:b,defaultValue:p[0],placeholder:d?.[0]?d?.[0]:"",allowReset:!1,disableCustomSizes:!0,setCustomControl:V,customControl:F,isPopover:!0,onMouseOver:E,onMouseOut:M,allowAuto:T}),(0,_o.jsx)(hd,{parentLabel:N||e,label:(0,Mo.__)("Right","kadence-blocks"),className:"kb-measure-box-right",value:o?o[1]:"",onChange:e=>t([o&&void 0!==o[0]?o[0]:"",e,o&&void 0!==o[2]?o[2]:"",o&&void 0!==o[3]?o[3]:""]),min:l,max:i,options:r,step:s,help:u,unit:f,units:m,onUnit:b,defaultValue:p[1],placeholder:d?.[1]?d?.[1]:"",allowReset:!1,disableCustomSizes:!0,setCustomControl:V,customControl:F,isPopover:!0,onMouseOver:E,onMouseOut:M,allowAuto:T}),(0,_o.jsx)(hd,{parentLabel:N||e,label:(0,Mo.__)("Bottom","kadence-blocks"),className:"kb-measure-box-bottom",value:o?o[2]:"",onChange:e=>t([o&&void 0!==o[0]?o[0]:"",o&&void 0!==o[1]?o[1]:"",e,o&&void 0!==o[3]?o[3]:""]),min:l,max:i,options:r,step:s,help:u,unit:f,units:m,onUnit:b,defaultValue:p[2],placeholder:d?.[2]?d?.[2]:"",allowReset:!1,disableCustomSizes:!0,setCustomControl:V,customControl:F,isPopover:!0,onMouseOver:E,onMouseOut:M,allowAuto:T}),(0,_o.jsx)(hd,{parentLabel:N||e,label:(0,Mo.__)("Left","kadence-blocks"),className:"kb-measure-box-left",value:o?o[3]:"",onChange:e=>t([o&&void 0!==o[0]?o[0]:"",o&&void 0!==o[1]?o[1]:"",o&&void 0!==o[2]?o[2]:"",e]),min:l,max:i,options:r,step:s,help:u,unit:f,units:m,onUnit:b,defaultValue:p[3],placeholder:d?.[3]?d?.[3]:"",allowReset:!1,disableCustomSizes:!0,setCustomControl:V,customControl:F,isPopover:!0,onMouseOver:E,onMouseOut:M,allowAuto:T}),F&&(0,_o.jsx)("div",{className:"kadence-units kadence-measure-control-select-wrapper",children:(0,_o.jsx)("select",{className:"kadence-measure-control-select components-unit-control__select",onChange:e=>{b(e.target.value)},value:f,disabled:1===m.length,children:m.map(e=>(0,_o.jsx)("option",{value:e,selected:f===e||void 0,children:e},e))})})]})]})]})]}const kd=(0,_o.jsx)(Ho.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,_o.jsx)(Ho.Path,{d:"M18.3 11.7c-.6-.6-1.4-.9-2.3-.9H6.7l2.9-3.3-1.1-1-4.5 5L8.5 16l1-1-2.7-2.7H16c.5 0 .9.2 1.3.5 1 1 1 3.4 1 4.5v.3h1.5v-.2c0-1.5 0-4.3-1.5-5.7z"})});function yd({label:e,subLabel:t,onChange:n,onChangeTablet:o,onChangeMobile:a,mobileValue:r,tabletValue:s,value:i,onControl:l,control:c="individual",options:u=dd,step:d=1,max:p=100,min:h=0,unit:f="",onUnit:b,showUnit:m=!1,units:g=["px","em","rem"],isBorderRadius:v=!1,disableCustomSizes:x=!1,firstIcon:k=tu.outlineTopIcon,secondIcon:y=tu.outlineRightIcon,thirdIcon:_=tu.outlineBottomIcon,fourthIcon:w=tu.outlineLeftIcon,linkIcon:C=fd,unlinkIcon:j=bd,deskDefault:S=["","","",""],tabletDefault:N=["","","",""],mobileDefault:O=["","","",""],ghostDefault:E=["","","",""],reset:M=!0,setCustomControl:T=null,onMouseOver:R,onMouseOut:I,allowAuto:P=!1}){const L=(0,ko.useRef)(),A={first:v?topLeftIcon:k,second:v?topRightIcon:y,third:v?bottomRightIcon:_,fourth:v?bottomLeftIcon:w,link:v?radiusLinkedIcon:C,unlink:v?radiusIndividualIcon:j},[D,F]=(0,ko.useState)(!1),[V,B]=(0,ko.useState)(c),z=T?customControl:D,H=T||F,U=JSON.parse(JSON.stringify(u));U.push({value:"ss-auto",output:"var(--global-kb-spacing-auto, auto)",label:(0,Mo.__)("Auto","kadence-blocks"),size:0,name:(0,Mo.__)("Auto","kadence-blocks")});const G=e=>{let t=[];return t=z?[vd(u,e?e[0]:"",f),vd(u,e?e[1]:"",f),vd(u,e?e[2]:"",f),vd(u,e?e[3]:"",f)]:[gd(u,e?e[0]:"",f),gd(u,e?e[1]:"",f),gd(u,e?e[2]:"",f),gd(u,e?e[3]:"",f)],t},$=l?c:V,W=l||B,[q,X]=(0,ko.useState)("Desktop"),J=(0,To.useSelect)(e=>e("kadenceblocks/data").getPreviewDeviceType(),[]);J!==q&&X(J),(0,ko.useEffect)(()=>{let e=i;"Tablet"==J?e=s:"Mobile"==J&&(e=r),F(md(U,e))},[J]);const{setPreviewDeviceType:K}=(0,To.useDispatch)("kadenceblocks/data"),Y=[{name:"Desktop",title:(0,_o.jsx)(yo.Dashicon,{icon:"desktop"}),itemClass:"kb-desk-tab"},{name:"Tablet",title:(0,_o.jsx)(yo.Dashicon,{icon:"tablet"}),itemClass:"kb-tablet-tab"},{name:"Mobile",key:"mobile",title:(0,_o.jsx)(yo.Dashicon,{icon:"smartphone"}),itemClass:"kb-mobile-tab"}];let Z=i||["","","",""];"Tablet"===q?Z=s||["","","",""]:"Mobile"===q&&(Z=r||["","","",""]);let Q=s?JSON.parse(JSON.stringify(s)):["","","",""];Q?.[0]||(Q[0]=i?.[0]?i[0]:""),Q?.[1]||(Q[1]=i?.[1]?i[1]:""),Q?.[2]||(Q[2]=i?.[2]?i[2]:""),Q?.[3]||(Q[3]=i?.[3]?i[3]:"");const ee={};ee.Mobile=(0,_o.jsx)(xd,{className:"measure-mobile-size",parentLabel:e,label:t?(0,Mo.__)("Mobile:","kadence-blocks")+t:void 0,value:r||["","","",""],placeholder:Q,onChange:e=>a((0,No.clearNonMatchingValues)(r,e)),control:$,onControl:e=>W(e),setCustomControl:H,customControl:z,options:u,defaultValue:O,min:h,max:p,step:d,unit:f,onUnit:b||void 0,showUnit:!0,units:[f],isBorderRadius:v,firstIcon:k,secondIcon:y,thirdIcon:_,fourthIcon:w,linkIcon:C,unlinkIcon:j,onMouseOver:R,onMouseOut:I,allowAuto:P},2),ee.Tablet=(0,_o.jsx)(xd,{className:"measure-tablet-size",parentLabel:e,label:t?(0,Mo.__)("Tablet:","kadence-blocks")+t:void 0,value:s||["","","",""],placeholder:i||["","","",""],onChange:e=>o((0,No.clearNonMatchingValues)(s,e)),control:$,onControl:e=>W(e),setCustomControl:H,customControl:z,options:u,defaultValue:N,min:h,max:p,step:d,unit:f,onUnit:b||void 0,showUnit:!0,units:[f],isBorderRadius:v,firstIcon:k,secondIcon:y,thirdIcon:_,fourthIcon:w,linkIcon:C,unlinkIcon:j,onMouseOver:R,onMouseOut:I,allowAuto:P},1),ee.Desktop=(0,_o.jsx)(xd,{className:"measure-desktop-size",parentLabel:e,label:t||void 0,value:i||["","","",""],placeholder:E||["","","",""],onChange:e=>n((0,No.clearNonMatchingValues)(i,e)),control:$,onControl:e=>W(e),setCustomControl:H,customControl:z,options:u,defaultValue:S,min:h,max:p,step:d,unit:f,onUnit:b||void 0,showUnit:m,units:g,isBorderRadius:v,firstIcon:k,secondIcon:y,thirdIcon:_,fourthIcon:w,linkIcon:C,unlinkIcon:j,onMouseOver:R,onMouseOut:I,allowAuto:P},0);let te=S;return"Mobile"===q?te=O:"Mobile"===q&&(te=N),[n&&o&&a&&(0,_o.jsxs)("div",{ref:L,className:"components-base-control kb-responsive-measure-control kadence-measure-range-control",children:[(0,_o.jsxs)(yo.Flex,{justify:"space-between",className:"kadence-title-bar kadence-component__header kadence-measure-range__header kadence-radio-range__header",children:[e&&(0,_o.jsxs)("div",{className:"kadence-component__header__title kadence-radio-range__title",children:[(0,_o.jsx)("label",{className:"components-base-control__label",children:e}),!0===M&&("linked"!==$||"linked"===$&&!0===z)&&(0,_o.jsx)("div",{className:"title-reset-wrap",children:(0,_o.jsx)(yo.Button,{className:"is-reset is-single",label:"reset",isSmall:!0,disabled:!!(0,Oo.isEqual)(te,Z),icon:kd,onClick:()=>{"Tablet"===q?o(N):"Mobile"===q?a(O):n(S)}})})]}),(0,_o.jsx)(yo.ButtonGroup,{className:"kb-responsive-options kb-measure-responsive-options","aria-label":(0,Mo.__)("Device","kadence-blocks"),children:(0,Oo.map)(Y,({name:e,key:t,title:n,itemClass:o})=>(0,_o.jsx)(yo.Button,{className:`kb-responsive-btn ${o}${e===q?" is-active":""}`,isSmall:!0,"aria-pressed":q===e,onClick:()=>{return t=e,K((0,No.capitalizeFirstLetter)(t)),void X((0,No.capitalizeFirstLetter)(t));var t},children:n},t))}),!x&&!t&&(0,_o.jsx)(yo.Button,{className:"kadence-radio-item radio-custom only-icon",label:z?(0,Mo.__)("Use size preset","kadence-blocks"):(0,Mo.__)("Set custom size","kadence-blocks"),icon:zc,isSmall:!0,onClick:()=>{(()=>{if("Mobile"==q){const e=G(r);(0,No.objectSameFill)(r,e)&&a(e)}else if("Tablet"==q){const e=G(s);(0,No.objectSameFill)(s,e)&&o(e)}else{const e=G(i);(0,No.objectSameFill)(i,e)&&n(e)}})(),H(!z)},isPressed:!!z,isTertiary:!z}),W&&!t&&(0,_o.jsx)(yo.Button,{isSmall:!0,className:"kadence-radio-item radio-custom is-single only-icon",label:"individual"!==$?(0,Mo.__)("Individual","kadence-blocks"):(0,Mo.__)("Linked","kadence-blocks"),icon:"individual"!==$?A.link:A.unlink,onClick:()=>W("individual"!==$?"individual":"linked"),isPressed:"individual"!==$,isTertiary:"individual"===$})]}),(0,_o.jsx)("div",{className:"kb-responsive-measure-control-inner",children:ee[q]?ee[q]:ee.Desktop})]})]}const _d=window.wp.isShallowEqual;function wd({style:e,type:t="inside",spacing:n,forceShow:o=!1,forceHide:a=!1,offset:r=!0}){const s=n[0],i=n[1],l=n[2],c=n[3],u=(0,ko.useMemo)(()=>{if("outside"===t){const e=s||0,t=i||0,n=l||0,o=c||0;return{borderTopWidth:e,borderRightWidth:t,borderBottomWidth:n,borderLeftWidth:o,top:r&&e?`calc(${e} * -1)`:0,right:r&&t?`calc(${t} * -1)`:0,bottom:r&&n?`calc(${n} * -1)`:0,left:r&&o?`calc(${o} * -1)`:0}}if("outsideVertical"===t){const e=s||0,t=l||0;return{borderTopWidth:e,borderRightWidth:i||0,borderBottomWidth:t,borderLeftWidth:c||0,top:r&&e?`calc(${e} * -1)`:0,bottom:r&&t?`calc(${t} * -1)`:0}}return{borderTopWidth:s||0,borderRightWidth:i||0,borderBottomWidth:l||0,borderLeftWidth:c||0,marginLeft:e?.marginLeft?e.marginLeft:0,marginRight:e?.marginRight?e.marginRight:0}},[n]),[d,p]=(0,ko.useState)(!1),h=(0,ko.useRef)(n),f=(0,ko.useRef)(),b=()=>{f.current&&window.clearTimeout(f.current)};return(0,ko.useMemo)(()=>(a&&(h.current=n),(0,_d.isShallowEqualArrays)(n,h.current)||o||a||(p(!0),h.current=n,b(),f.current=setTimeout(()=>{p(!1)},400)),()=>b()),[n,o,a]),!d&&!o||a?null:(0,_o.jsx)("div",{className:`kb__spacing-visualizer-wrap kb__spacing_visualizer-type-${t}`,style:e,children:(0,_o.jsx)("div",{className:"kb__spacing-visualizer",style:u})})}function Cd({label:e,className:t,hideLabel:n=!1,wrap:o=!1,allowClear:a=!1,help:r="",onChange:s,onChangeTablet:i,onChangeMobile:l,value:c,mobileValue:u,tabletValue:d,options:p=[],tabletOptions:h=p,mobileOptions:f=h,...b}){return(0,_o.jsx)(Lo,{label:e,desktopChildren:(0,_o.jsx)(wc,{className:t,value:c,options:p,onChange:s,hideLabel:n,help:r,wrap:o,allowClear:a}),tabletChildren:(0,_o.jsx)(wc,{className:t,value:d,options:h,onChange:i,hideLabel:n,help:r,wrap:o,allowClear:!0}),mobileChildren:(0,_o.jsx)(wc,{className:t,value:u,options:f,onChange:l,hideLabel:n,help:r,wrap:o,allowClear:!0})})}function jd({value:e,isPressed:t=!1}){const n={top:"M19.5 19.5H.5V.5h19v19zM1.607 18.392h16.786V1.608H1.607v16.784zM17.178 2.888H2.822v3.275h14.356V2.888z",middle:"M19.5 19.482H.5V.5h19v18.982zM1.607 18.375h16.786V1.607H1.607v16.768zm15.571-10.02H2.822v3.272h14.356V8.355z",bottom:"M19.518 19.5H.5V.5h19.018v19zm-17.91-1.108H18.41V1.608H1.608v16.784zm15.586-4.739H2.824v3.275h14.37v-3.275z"};return n.hasOwnProperty(e)?(0,_o.jsx)(yo.SVG,{width:"20",height:"20",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",isPressed:t,children:(0,_o.jsx)(yo.Path,{d:n[e]})}):null}const Sd=["image"];class Nd extends ko.Component{constructor(){super(...arguments)}render(){const{label:e,hasImage:t,onSaveImage:n,onRemoveImage:o,disableMediaButtons:a,imageURL:r,imageID:s,kadenceDynamic:i,dynamicAttribute:l=""}=this.props;return(0,_o.jsxs)("div",{className:"kadence-image-media-control kadence-image-background-control",children:[!t&&(0,_o.jsxs)(ko.Fragment,{children:[e&&(0,_o.jsx)("div",{className:"components-kadence-image-background__label",children:e}),(0,_o.jsx)(qc,{labels:"",selectIcon:Kc,selectLabel:(0,Mo.__)("Select Image","kadence-blocks"),onSelect:e=>n(e),accept:"image/*",className:"kadence-image-upload",allowedTypes:Sd,disableMediaButtons:a,dynamicControl:l&&kadence_blocks_params.dynamic_enabled?(0,_o.jsx)(Oc,{...this.props}):void 0})]}),t&&(0,_o.jsxs)(ko.Fragment,{children:[e&&(0,_o.jsx)("div",{className:"components-kadence-image-background__label",children:e}),l&&kadence_blocks_params.dynamic_enabled&&i&&i[l]&&i[l].enable?(0,_o.jsx)("div",{className:"kb-dynamic-background-sidebar-top",children:(0,_o.jsx)(Oc,{startOpen:!i[l].field,...this.props})}):(0,_o.jsxs)(ko.Fragment,{children:[(0,_o.jsx)(Eo.MediaUpload,{onSelect:e=>n(e),type:"image",value:s||"",render:({open:e})=>(0,_o.jsx)(yo.Button,{className:"components-button components-icon-button kt-cta-upload-btn kb-sidebar-image",style:{backgroundImage:'url("'+r+'")',backgroundSize:"cover"},onClick:e,icon:Yc,children:(0,Mo.__)("Edit Image","kadence-blocks")})}),(0,_o.jsx)(yo.Button,{icon:Zc,label:(0,Mo.__)("Remove Image","kadence-blocks"),className:"components-button components-icon-button kt-remove-img kt-cta-upload-btn",onClick:()=>o()}),l&&kadence_blocks_params.dynamic_enabled&&(0,_o.jsx)(Oc,{...this.props})]})]})]})}}const Od=Nd,Ed=["video"];class Md extends ko.Component{constructor(){super(...arguments)}render(){const{label:e,hasVideo:t,onSaveVideo:n,onRemoveVideo:o,disableMediaButtons:a,videoURL:r,videoID:s}=this.props;return(0,_o.jsxs)("div",{className:"components-base-control kadence-image-media-control kadence-image-background-control kadence-video-background-control",children:[!t&&(0,_o.jsxs)(ko.Fragment,{children:[e&&(0,_o.jsx)("div",{className:"components-kadence-video-background__label",children:e}),(0,_o.jsx)(qc,{labels:"",selectIcon:Kc,selectLabel:(0,Mo.__)("Select Video","kadence-blocks"),onSelect:e=>n(e),accept:"video/*",className:"kadence-image-upload",allowedTypes:Ed,disableMediaButtons:a})]}),t&&(0,_o.jsxs)(ko.Fragment,{children:[e&&(0,_o.jsx)("div",{className:"components-kadence-video-background__label",children:e}),(0,_o.jsxs)("div",{className:"components-kadence-video-btns",children:[(0,_o.jsx)(Eo.MediaUpload,{onSelect:e=>n(e),type:"video",value:s||"",render:({open:e})=>(0,_o.jsx)(yo.Button,{className:"components-button components-icon-button kb-cta-upload-btn kb-video-edit",onClick:e,icon:tu.video,children:(0,Mo.__)("Edit Video","kadence-blocks")})}),(0,_o.jsx)(yo.Button,{icon:Zc,label:(0,Mo.__)("Remove Image","kadence-blocks"),className:"components-button components-icon-button kb-remove-video kb-cta-upload-btn",onClick:()=>o()})]})]})]})}}const Td=Md;function Rd({label:e,className:t,children:n}){return(0,_o.jsxs)("div",{className:"components-base-control kadence-subsection-wrap"+(t?" "+t:""),children:[e&&(0,_o.jsx)("h2",{className:"subsection-wrap-title",children:e}),(0,_o.jsx)("div",{className:"kt-inner-subsection",children:n})]})}const Id=(0,_c.compose)([(0,To.withSelect)((e,t)=>{const n=void 0===t.initialOpen||t.initialOpen,o=(0,Oo.get)(t,["index"],"");return{isOpened:e("kadenceblocks/data").isEditorPanelOpened(t.panelName+o+e("core/block-editor").getSelectedBlockClientId(),n)}}),(0,To.withDispatch)((e,t,{select:n})=>{const{getSelectedBlockClientId:o}=n("core/block-editor"),a=void 0===t.initialOpen||t.initialOpen,r=(0,Oo.get)(t,["index"],"");return{toggleOpened:()=>{e("kadenceblocks/data").toggleEditorPanelOpened(t.panelName+r+o(),a)}}})])(function({children:e,title:t,initialOpen:n=!0,isOpened:o,toggleOpened:a,className:r="",icon:s="",buttonProps:i={},blockSlug:l=!1,index:c=!1,proTag:u=!1,panelName:d}){return!1===l||(0,No.showSettings)(d,l)?(u&&(i.icon=tu.proIcon,i.iconPosition="right"),(0,_o.jsx)(yo.PanelBody,{title:t,initialOpen:n,onToggle:a,opened:o,className:r,icon:s,buttonProps:i,children:e})):null});function Pd({children:e,title:t}){return(0,_o.jsxs)("div",{className:"kb-sub-panel",children:[t&&(0,_o.jsx)("h2",{className:"kb-sub-panel-title",children:t}),(0,_o.jsx)("div",{className:"kb-inner-sub-panel",children:e})]})}const Ld=function({children:e,blockSlug:t=!1,settingSlug:n="allSettings"}){return!1===t||(0,No.showSettings)(n,t)?(0,_o.jsx)(Eo.InspectorControls,{children:e}):null};class Ad extends ko.Component{constructor(){super(...arguments),this.state={options:[],isLoading:!1,page:1,hasMore:!1}}componentDidMount(){this.fetchPostAbortController=new AbortController,this.fetchTerms()}componentWillUnmount(){this.fetchPostAbortController&&this.fetchPostAbortController.abort()}fetchTerms(){const{restBase:e}=this.props,{page:t,options:n,search:o}=this.state,a={page:t,per_page:10};o&&o.length>=3&&(a.search=o),this.setState({isLoading:!0}),(0,No.fetchJson)({path:(0,hc.addQueryArgs)(`${e}/`,a),signal:this.fetchPostAbortController.signal}).then(([e,o])=>{const a=(0,Oo.uniqBy)([...n,...e.map(e=>({value:e.id,label:e.name}))],"value");this.setState({options:a,hasMore:parseInt(o["x-wp-totalpages"],10)>t,isLoading:!1})})}fetchMoreTerms(){const{page:e,hasMore:t,isLoading:n}=this.state;t&&!n&&this.setState({page:e+1},()=>this.fetchTerms())}updateSearch(e){e.length>=3&&this.setState({search:e,page:1},()=>this.fetchTerms())}handleChange(e){const{onChange:t}=this.props;this.setState({search:null,page:1}),t(e)}render(){return(0,_o.jsxs)("div",{className:"term-select-form-row",children:[(0,_o.jsx)("label",{htmlFor:this.props.fieldId,className:"screen-reader-text",children:this.props.placeholder}),(0,_o.jsx)(pc,{value:this.props.value,onChange:e=>this.handleChange(e),id:this.props.fieldId,options:this.state.options,isMulti:!0,classNamePrefix:"kt-tax-select",isLoading:this.state.isLoading,onMenuScrollToBottom:()=>this.fetchMoreTerms(),onInputChange:e=>this.updateSearch(e),maxMenuHeight:300,placeholder:this.props.placeholder})]})}}Ad.propTypes={fieldId:S().string.isRequired,label:S().string.isRequired,restBase:S().string.isRequired,onChange:S().func.isRequired};const Dd=Ad,Fd=window.wp.apiFetch;var Vd=a.n(Fd);function Bd({value:e,onChange:t,source:n,isMulti:o=!1}){const[a,r]=(0,ko.useState)(!0),[s,i]=(0,ko.useState)([]),[l,c]=(0,ko.useState)(1),[u,d]=(0,ko.useState)(!1),p=e;return(0,ko.useEffect)(()=>{if(n&&void 0!==window.kadence_blocks_params.taxonomies[n]&&window.kadence_blocks_params.taxonomies[n])i(Array.from(window.kadence_blocks_params.taxonomies[n])),r(!1);else{const e={source:n,page:l,per_page:50};r(!0),Vd()({path:(0,hc.addQueryArgs)(window.kadence_blocks_params.termEndpoint,e)}).then(e=>{e?(i(e),window.kadence_blocks_params.taxonomies[n]=e):(i([]),window.kadence_blocks_params.taxonomies[n]=[]),r(!1)}).catch(()=>{r(!1),i([]),window.kadence_blocks_params.taxonomies[n]=[]})}},[n]),a?(0,_o.jsx)(yo.Spinner,{}):(0,_o.jsx)("div",{className:"kb-inner-term-select-wrap",children:(0,_o.jsx)(pc,{options:s,className:"kb-dynamic-select",classNamePrefix:"kbp",value:o?e:""!==e?s.filter(({value:e})=>e===p):"",isMulti:o,isSearchable:!0,isClearable:!0,menuPortalTarget:document.body,styles:{menuPortal:e=>({...e,zIndex:99999999})},maxMenuHeight:200,placeholder:(0,Mo.__)("Select Term","kadence-blocks"),onChange:e=>{t(e?o?e:e.value:"")}})})}function zd({desktopChildren:e,tabletChildren:t,mobileChildren:n}){const[o,a]=(0,ko.useState)("Desktop"),r=(0,To.useSelect)(e=>e("kadenceblocks/data").getPreviewDeviceType(),[]);r!==o&&a(r);const{setPreviewDeviceType:s}=(0,To.useDispatch)("kadenceblocks/data"),i=[{name:"Desktop",key:"desktop",label:(0,Mo.__)("Desktop","kadence-blocks"),title:(0,_o.jsx)(yo.Dashicon,{icon:"desktop"}),itemClass:"kb-desk-tab"},{name:"Tablet",key:"tablet",label:(0,Mo.__)("Tablet","kadence-blocks"),title:(0,_o.jsx)(yo.Dashicon,{icon:"tablet"}),itemClass:"kb-tablet-tab"},{name:"Mobile",key:"mobile",label:(0,Mo.__)("Mobile","kadence-blocks"),title:(0,_o.jsx)(yo.Dashicon,{icon:"smartphone"}),itemClass:"kb-mobile-tab"}],l={};return l.Mobile=n,l.Tablet=t,l.Desktop=e,(0,_o.jsxs)("div",{className:"components-base-control kt-inspect-tabs kb-responsive-control",children:[(0,_o.jsx)("div",{className:"kadence-title-bar",children:(0,_o.jsx)(yo.ButtonGroup,{className:"components-tab-panel__tabs","aria-label":(0,Mo.__)("Device","kadence-blocks"),children:(0,Oo.map)(i,({name:e,key:t,title:n,itemClass:r,label:i})=>(0,_o.jsx)(yo.Button,{className:`components-tab-panel__tabs-item ${r}${e===o?" active-tab":""}`,"aria-pressed":o===e,"aria-label":i,onClick:()=>{return t=e,s((0,No.capitalizeFirstLetter)(t)),void a((0,No.capitalizeFirstLetter)(t));var t},children:n},t))})}),(0,_o.jsx)("div",{className:"kb-responsive-control-inner",children:l[o]?l[o]:l.Desktop})]})}function Hd({label:e,onChange:t,onChangeTablet:n,onChangeMobile:o,value:a,mobileValue:r,tabletValue:s,options:i,tabletOptions:l=i,mobileOptions:c=l,help:u}){return(0,_o.jsx)(Lo,{label:e,desktopChildren:(0,_o.jsx)(yo.SelectControl,{value:a,options:i,onChange:e=>t(e),help:u}),tabletChildren:(0,_o.jsx)(yo.SelectControl,{value:s,options:l,onChange:e=>n(e),help:u}),mobileChildren:(0,_o.jsx)(yo.SelectControl,{value:r,options:c,onChange:e=>o(e),help:u})})}const Ud=(0,_o.jsx)(Ho.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,_o.jsx)(Ho.Path,{d:"m13.1 16-3.4-4 3.4-4 1.1 1-2.6 3 2.6 3-1.1 1z"})}),Gd=(0,_o.jsx)(Ho.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,_o.jsx)(Ho.Path,{d:"M10.8622 8.04053L14.2805 12.0286L10.8622 16.0167L9.72327 15.0405L12.3049 12.0286L9.72327 9.01672L10.8622 8.04053Z"})});function $d({label:e,value:t,onChange:n,min:o,max:a,step:r=1}){return[n&&(0,_o.jsxs)("div",{className:"components-base-control",children:[(0,_o.jsx)("p",{className:"components-base-control__label",children:e}),(0,_o.jsxs)("div",{className:"components-base-control__field kb-flex-center kb-step-control",children:[(0,_o.jsx)(yo.Button,{className:"kb-step-btn",icon:Ud,isSecondary:!0,onClick:()=>{t>o&&n(t-r)}}),(0,_o.jsx)("input",{className:"components-step-control__number",type:"number",onChange:e=>n(Number(e.target.value)),"aria-label":e,value:t,min:o,max:a,step:r}),(0,_o.jsx)(yo.Button,{className:"kb-step-btn",isSecondary:!0,icon:Gd,onClick:()=>{t<a&&n(t+r)}})]})]})]}class Wd extends ko.Component{constructor(e,t,n){super(...arguments),this.state={isVisible:!1}}render(){const e=()=>{this.setState({isVisible:!1})};let t={};return t.opacity=(0,_o.jsxs)("svg",{width:"20px",height:"20px",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",fillRule:"evenodd",clipRule:"evenodd",strokeLinejoin:"round",strokeMiterlimit:"1.414",children:[(0,_o.jsxs)("g",{fillRule:"nonzero",children:[(0,_o.jsx)("path",{d:"M14.043,7.612c2.23,2.178 2.23,5.726 0,7.904c-1.081,1.055 -2.515,1.638 -4.042,1.638c-1.527,0 -2.964,-0.583 -4.042,-1.638c-1.08,-1.056 -1.674,-2.46 -1.674,-3.952c0,-1.492 0.594,-2.896 1.676,-3.956l4.04,-4.026l4.038,4.026c0.002,0.002 0.004,0.002 0.004,0.004Z",fill:"url(#_Linear1)"}),(0,_o.jsx)("path",{d:"M15.595,6.066c3.082,3.013 3.082,7.917 -0.002,10.931c-1.493,1.461 -3.479,2.265 -5.591,2.265c-2.112,0 -4.097,-0.804 -5.593,-2.265c-1.493,-1.46 -2.315,-3.402 -2.315,-5.467c0,-2.065 0.822,-4.007 2.315,-5.466l5.176,-5.162c0.221,-0.219 0.614,-0.219 0.833,0l5.177,5.164Zm-0.826,10.124c2.629,-2.568 2.629,-6.751 0,-9.32c0,-0.002 -0.003,-0.002 -0.005,-0.004l-4.762,-4.749l-4.764,4.749c-1.276,1.249 -1.976,2.905 -1.976,4.664c0,1.76 0.7,3.416 1.974,4.66c1.272,1.245 2.966,1.932 4.766,1.932c1.801,0 3.493,-0.687 4.767,-1.932Z"})]}),(0,_o.jsx)("defs",{children:(0,_o.jsxs)("linearGradient",{id:"_Linear1",x2:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"matrix(11.4305 0 0 13.5721 4.285 10.368)",children:[(0,_o.jsx)("stop",{offset:"0"}),(0,_o.jsx)("stop",{offset:"0.5",stopOpacity:"0.749"}),(0,_o.jsx)("stop",{offset:"1",stopOpacity:"0"})]})})]}),(0,_o.jsxs)("div",{className:"kt-popover-container",children:[this.state.isVisible&&(0,_o.jsx)(yo.Popover,{position:"top left",className:"kt-popover-opacity",onClose:e,children:(0,_o.jsx)(yo.RangeControl,{label:this.props.label,value:this.props.value,onChange:this.props.onChanged,min:0,max:1,step:.01})}),(0,_o.jsxs)(yo.Tooltip,{text:this.props.label,children:[!this.state.isVisible&&(0,_o.jsx)(yo.Button,{className:"kt-opacity-icon",isSecondary:!0,onClick:()=>{this.setState({isVisible:!0})},children:t.opacity}),this.state.isVisible&&(0,_o.jsx)(yo.Button,{className:"kt-opacity-icon",isSecondary:!0,onClick:e,children:t.opacity})]})]})}}const qd=Wd;function Xd({label:e,onChange:t,value:n="",className:o="",step:a=1,max:r=200,min:s=0,unit:i="px",onUnit:l,units:c=["px","em","rem"],styles:u=["solid","dashed","dotted","double"],defaultLinked:d=!0}){const p=(0,_c.useInstanceId)(Xd),h=n?.[1]||"solid",f=e=>{const o=n;o[0]=e,t(o)},b=n?.[0]||"",m=void 0!==n?.[2]&&""!==n?.[2]?n[2]:"",g={solid:(0,_o.jsx)("svg",{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",fillRule:"evenodd",strokeLinejoin:"round",strokeMiterlimit:"2",clipRule:"evenodd",viewBox:"0 0 20 20",children:(0,_o.jsx)("path",{d:"M18.988 11.478V8.522H1.012v2.956h17.976z"})}),dashed:(0,_o.jsx)("svg",{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",fillRule:"evenodd",strokeLinejoin:"round",strokeMiterlimit:"2",clipRule:"evenodd",viewBox:"0 0 20 20",children:(0,_o.jsx)("path",{d:"M12.512 11.478V8.522H7.488v2.956h5.024zM14.004 8.522v2.956h4.984V8.522h-4.984zM1.012 8.522v2.956H6.05V8.522H1.012z"})}),dotted:(0,_o.jsxs)("svg",{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",fillRule:"evenodd",strokeLinejoin:"round",strokeMiterlimit:"2",clipRule:"evenodd",viewBox:"0 0 20 20",children:[(0,_o.jsx)("circle",{cx:"2.503",cy:"10",r:"1.487"}),(0,_o.jsx)("circle",{cx:"17.486",cy:"10",r:"1.487"}),(0,_o.jsx)("circle",{cx:"12.447",cy:"10",r:"1.487"}),(0,_o.jsx)("circle",{cx:"7.455",cy:"10",r:"1.487"})]}),double:(0,_o.jsx)("svg",{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",fillRule:"evenodd",strokeLinejoin:"round",strokeMiterlimit:"2",clipRule:"evenodd",viewBox:"0 0 20 20",children:(0,_o.jsx)("path",{d:"M1.02 6.561v2.957h17.968V6.561H1.02zM1.012 10.586v2.956H18.98v-2.956H1.012z"})})},v={solid:(0,Mo.__)("Solid","kadence-blocks"),dashed:(0,Mo.__)("Dashed","kadence-blocks"),dotted:(0,Mo.__)("Dotted","kadence-blocks"),double:(0,Mo.__)("Double","kadence-blocks")},x=c.map(e=>({value:e,label:e}));return[t&&(0,_o.jsxs)("div",{className:`components-base-control kadence-single-border-control kadence-single-border-control${p}${o?" "+o:""}`,children:[e&&(0,_o.jsx)(yo.Flex,{justify:"space-between",className:"kadence-border-control__header",children:(0,_o.jsx)(yo.FlexItem,{children:(0,_o.jsx)("label",{className:"components-base-control__label",children:e})})}),(0,_o.jsxs)("div",{className:"kadence-single-border-control-wrap",children:[(0,_o.jsx)(Po,{value:b,default:"",hideClear:!0,onChange:e=>f(e)},`border-color-${b}-${p}`),(0,_o.jsx)(yo.DropdownMenu,{className:"border-control-style-select",icon:g[h],label:(0,Mo.__)("Border Style","kadence-blocks"),popoverProps:{className:"border-control-style-select__popover",placement:"bottom"},children:({onClose:e})=>(0,_o.jsx)(_o.Fragment,{children:(0,_o.jsx)(yo.MenuGroup,{children:u.map(o=>(0,_o.jsx)(yo.MenuItem,{icon:g[o],onClick:()=>{e(),(e=>{const o=n;o[1]=e,t(o)})(o)},label:v[o]}))})})}),(0,_o.jsxs)("div",{className:"kadence-controls-content kadence-single-unit-control",children:[(0,_o.jsx)(yo.__experimentalUnitControl,{min:s,max:r,step:a,units:x,value:m,disableUnits:!0,onChange:e=>(e=>{const o=isNaN(parseFloat(e))?"":parseFloat(e),a=n;a[2]=o,t(a)})(e)}),(0,_o.jsx)("div",{className:"kadence-measure-control-select-wrapper",children:(0,_o.jsx)("select",{className:"kadence-measure-control-select components-unit-control__select",onChange:e=>{l(e.target.value)},disabled:1===c.length,children:c.map(e=>(0,_o.jsx)("option",{value:e,selected:i===e||void 0,children:e},e))})})]})]})]})]}function Jd({label:e,onChange:t,onChangeTablet:n,onChangeMobile:o,onControl:a,value:r="",tabletValue:s="",mobileValue:i="",control:l="individual",units:c=["px","em","rem"],firstIcon:u=tu.outlineTopIcon,secondIcon:d=tu.outlineRightIcon,thirdIcon:p=tu.outlineBottomIcon,fourthIcon:h=tu.outlineLeftIcon,linkIcon:f=fd,unlinkIcon:b=bd,styles:m=["solid","dashed","dotted","double"],deskDefault:g={top:["","",""],right:["","",""],bottom:["","",""],left:["","",""],unit:"px"},tabletDefault:v={top:["","",""],right:["","",""],bottom:["","",""],left:["","",""],unit:""},mobileDefault:x={top:["","",""],right:["","",""],bottom:["","",""],left:["","",""],unit:""},reset:k=!0,defaultLinked:y=!0}){const _=(0,_c.useInstanceId)(Jd),w=r?.[0]||g,C=s?.[0]||v,j=i?.[0]||x,[S,N]=(0,ko.useState)(l),[O,E]=(0,ko.useState)("Desktop"),M=(0,To.useSelect)(e=>e("kadenceblocks/data").getPreviewDeviceType(),[]);M!==O&&E(M),(0,ko.useEffect)(()=>{j&&(0,Oo.isEqual)(w.unit,j?.unit)&&(j.unit="",V("","unit")),C&&(0,Oo.isEqual)(w.unit,C?.unit)&&(C.unit="",F("","unit"))},[]);const{setPreviewDeviceType:T}=(0,To.useDispatch)("kadenceblocks/data"),R=[{name:"Desktop",title:(0,_o.jsx)(yo.Dashicon,{icon:"desktop"}),itemClass:"kb-desk-tab"},{name:"Tablet",title:(0,_o.jsx)(yo.Dashicon,{icon:"tablet"}),itemClass:"kb-tablet-tab"},{name:"Mobile",key:"mobile",title:(0,_o.jsx)(yo.Dashicon,{icon:"smartphone"}),itemClass:"kb-mobile-tab"}];let I=w;"Tablet"===O?I=C:"Mobile"===O&&(I=j);const P={},L=j?.unit?j.unit:w?.unit?w.unit:"px",A=C?.unit?C.unit:w?.unit?w.unit:"px",D=(e,n)=>{var o=JSON.parse(JSON.stringify(r));o[0][n]=e,t(o)},F=(e,t)=>{var o=JSON.parse(JSON.stringify(s));o[0][t]=e,n(o)},V=(e,t)=>{var n=JSON.parse(JSON.stringify(i));n[0][t]=e,o(n)};P.Mobile=(0,_o.jsx)(Xd,{value:j?.bottom?JSON.parse(JSON.stringify(j?.bottom)):void 0,unit:j?.unit?JSON.parse(JSON.stringify(j?.unit)):"px",onChange:e=>V(e,"bottom"),onUnit:e=>V(e,"unit"),defaultValue:x?.bottom,styles:m,units:[L],firstIcon:u,secondIcon:d,thirdIcon:p,fourthIcon:h},"mobile"+_),P.Tablet=(0,_o.jsx)(Xd,{value:C?.bottom?JSON.parse(JSON.stringify(C?.bottom)):void 0,unit:C?.unit?JSON.parse(JSON.stringify(C?.unit)):"px",onChange:e=>F(e,"bottom"),onUnit:e=>F(e,"unit"),defaultValue:v?.bottom,styles:m,units:[A],firstIcon:u,secondIcon:d,thirdIcon:p,fourthIcon:h},"tablet"+_),P.Desktop=(0,_o.jsx)(Xd,{value:w?.bottom?JSON.parse(JSON.stringify(w?.bottom)):void 0,unit:w?.unit?JSON.parse(JSON.stringify(w?.unit)):"px",onChange:e=>D(e,"bottom"),onUnit:e=>D(e,"unit"),defaultValue:g?.bottom,styles:m,units:c,firstIcon:u,secondIcon:d,thirdIcon:p,fourthIcon:h},"desktop"+_);let B=g;return"Mobile"===O?B=x:"Mobile"===O&&(B=v),[t&&n&&o&&(0,_o.jsxs)("div",{className:`components-base-control kb-responsive-border-control kadence-border-box-control kadence-border-box-control${_}`,children:[(0,_o.jsxs)("div",{className:"kadence-border-control__header kadence-component__header",children:[e&&(0,_o.jsxs)("div",{className:"kadence-component__header__title kadence-radio-range__title",children:[(0,_o.jsx)("label",{className:"components-base-control__label",children:e}),k&&(0,_o.jsx)("div",{className:"title-reset-wrap",children:(0,_o.jsx)(yo.Button,{className:"is-reset is-single",label:"reset",isSmall:!0,disabled:!!(0,Oo.isEqual)(B,I),icon:kd,onClick:()=>{"Tablet"===O?n([v]):"Mobile"===O?o([x]):t([g])}})})]}),(0,_o.jsx)(yo.ButtonGroup,{className:"kb-responsive-options kb-measure-responsive-options","aria-label":(0,Mo.__)("Device","kadence-blocks"),children:(0,Oo.map)(R,({name:e,key:t,title:n,itemClass:o})=>(0,_o.jsx)(yo.Button,{className:`kb-responsive-btn ${o}${e===O?" is-active":""}`,isSmall:!0,"aria-pressed":O===e,onClick:()=>{return t=e,T((0,No.capitalizeFirstLetter)(t)),void E((0,No.capitalizeFirstLetter)(t));var t},children:n},t))})]}),(0,_o.jsx)("div",{className:"kb-responsive-border-control-inner",children:P[O]?P[O]:P.Desktop})]})]}function Kd({label:e,onChange:t,onControl:n,value:o="",className:a="",help:r="",defaultValue:s={top:{color:"",style:"solid",width:""},right:{color:"",style:"solid",width:""},bottom:{color:"",style:"solid",width:""},left:{color:"",style:"solid",width:""},unit:""},control:i="individual",units:l=["px","em","rem"],firstIcon:c=tu.outlineTopIcon,secondIcon:u=tu.outlineRightIcon,thirdIcon:d=tu.outlineBottomIcon,fourthIcon:p=tu.outlineLeftIcon,linkIcon:h=fd,unlinkIcon:f=bd,styles:b=["solid","dashed","dotted","double"],reset:m}){const g=(0,_c.useInstanceId)(Kd),[v,x]=(0,ko.useState)(i),k=n?i:v,y=n||x,_={first:c,second:u,third:d,fourth:p,link:h,unlink:f},w=(0,ko.useRef)(),C=o?.[0]||s,j="px"!==C.unit?.1:1,S="px"!==C.unit&&""!==C.unit?12:200,N=(e,n)=>{C[n]=e;const o=JSON.parse(JSON.stringify(C));t([o])},O=e=>{C.unit=e;const n=JSON.parse(JSON.stringify(C));t([n])};return[t&&(0,_o.jsxs)("div",{ref:w,className:`components-base-control kadence-border-control kadence-border-control${g}${a?" "+a:""}`,children:[e&&(0,_o.jsxs)("div",{className:"kadence-border-control__header",children:[e&&(0,_o.jsxs)("div",{className:"kadence-border-control__title",children:[(0,_o.jsx)("label",{className:"components-base-control__label",children:e}),m&&(0,_o.jsx)("div",{className:"title-reset-wrap",children:(0,_o.jsx)(yo.Button,{className:"is-reset is-single",label:"reset",isSmall:!0,disabled:!!(0,Oo.isEqual)(s,o),icon:undo,onClick:()=>{"function"==typeof m?m():t([s])}})})]}),y&&(0,_o.jsx)(yo.Button,{className:"kadence-radio-item border-control-toggle is-single only-icon",label:"individual"!==k?(0,Mo.__)("Individual","kadence-blocks"):(0,Mo.__)("Linked","kadence-blocks"),icon:"individual"!==k?_.link:_.unlink,onClick:()=>y("individual"!==k?"individual":"linked"),isPressed:"individual"!==k,isTertiary:"individual"===k})]}),(0,_o.jsxs)("div",{className:"kadence-controls-content",children:["individual"!==k&&(0,_o.jsx)(_o.Fragment,{children:(0,_o.jsx)(Xd,{value:C?.top||["","",""],onChange:e=>(e=>{C.top=e,C.bottom=e,C.right=e,C.left=e;const n=JSON.parse(JSON.stringify(C));t([n])})(e),min:0,max:S,step:j,help:r,styles:b,unit:C?.unit||"px",units:l,onUnit:e=>O(e),defaultValue:s.top,allowReset:!1})}),"individual"===k&&(0,_o.jsxs)("div",{className:"kadence-border-controls-grid-wrap",children:[(0,_o.jsx)("div",{className:"kadence-border-control-grid-visualizer",style:{borderTopColor:C?.top?.[0]?(0,No.KadenceColorOutput)(C?.top?.[0]):void 0,borderTopStyle:C?.top?.[1]||void 0,borderTopWidth:C?.top?.[2]?"clamp( 1px, "+C?.top?.[2]+C?.unit+", 10px )":void 0,borderRightColor:C?.right?.[0]?(0,No.KadenceColorOutput)(C?.right?.[0]):void 0,borderRightStyle:C?.right?.[1]||void 0,borderRightWidth:C?.right?.[2]?"clamp( 1px, "+C?.right?.[2]+C?.unit+", 10px )":void 0,borderBottomColor:C?.bottom?.[0]?(0,No.KadenceColorOutput)(C?.bottom?.[0]):void 0,borderBottomStyle:C?.bottom?.[1]||void 0,borderBottomWidth:C?.bottom?.[2]?"clamp( 1px, "+C?.bottom?.[2]+C?.unit+", 10px )":void 0,borderLeftColor:C?.left?.[0]?(0,No.KadenceColorOutput)(C?.left?.[0]):void 0,borderLeftStyle:C?.left?.[1]||void 0,borderLeftWidth:C?.left?.[2]?"clamp( 1px, "+C?.left?.[2]+C?.unit+", 10px )":void 0}}),(0,_o.jsx)(Xd,{value:C?.top||["","",""],onChange:e=>N(e,"top"),min:0,max:S,step:j,help:r,styles:b,unit:C?.unit||"px",units:l,onUnit:e=>O(e),defaultValue:s.top,allowReset:!1}),(0,_o.jsx)(Xd,{value:C?.left||["","",""],onChange:e=>N(e,"left"),min:0,max:S,step:j,help:r,styles:b,unit:C?.unit||"px",units:l,onUnit:e=>O(e),defaultValue:s.left,allowReset:!1}),(0,_o.jsx)(Xd,{value:C?.right||["","",""],onChange:e=>N(e,"right"),min:0,max:S,step:j,help:r,styles:b,unit:C?.unit||"px",units:l,onUnit:e=>O(e),defaultValue:s.right,allowReset:!1}),(0,_o.jsx)(Xd,{value:C?.bottom||["","",""],onChange:e=>N(e,"bottom"),min:0,max:S,step:j,help:r,styles:b,unit:C?.unit||"px",units:l,onUnit:e=>O(e),defaultValue:s.bottom,allowReset:!1})]})]})]})]}function Yd({label:e,onChange:t,onChangeTablet:n,onChangeMobile:o,onControl:a,mobileValue:r="",tabletValue:s="",value:i="",control:l="individual",units:c=["px","em","rem"],firstIcon:u=tu.outlineTopIcon,secondIcon:d=tu.outlineRightIcon,thirdIcon:p=tu.outlineBottomIcon,fourthIcon:h=tu.outlineLeftIcon,linkIcon:f=fd,unlinkIcon:b=bd,styles:m=["solid","dashed","dotted","double"],deskDefault:g={top:["","",""],right:["","",""],bottom:["","",""],left:["","",""],unit:"px"},tabletDefault:v={top:["","",""],right:["","",""],bottom:["","",""],left:["","",""],unit:""},mobileDefault:x={top:["","",""],right:["","",""],bottom:["","",""],left:["","",""],unit:""},reset:k=!0,defaultLinked:y=!0}){const _=(0,_c.useInstanceId)(Yd),w={first:u,second:d,third:p,fourth:h,link:f,unlink:b},[C,j]=(0,ko.useState)(l),S=a?l:C,N=a||j,[O,E]=(0,ko.useState)("Desktop"),M=(0,To.useSelect)(e=>e("kadenceblocks/data").getPreviewDeviceType(),[]);M!==O&&E(M),(0,ko.useEffect)(()=>{y&&("Mobile"===M?(0,Oo.isEqual)(r?.[0]?.top,r?.[0]?.bottom)&&(0,Oo.isEqual)(r?.[0]?.top,r?.[0]?.bottom)&&(0,Oo.isEqual)(r?.[0]?.top,r?.[0]?.right)&&(0,Oo.isEqual)(r?.[0]?.top,r?.[0]?.left)&&N("linked"):"Tablet"===M?(0,Oo.isEqual)(s?.[0]?.top,s?.[0]?.bottom)&&(0,Oo.isEqual)(s?.[0]?.top,s?.[0]?.bottom)&&(0,Oo.isEqual)(s?.[0]?.top,s?.[0]?.right)&&(0,Oo.isEqual)(s?.[0]?.top,s?.[0]?.left)&&N("linked"):(0,Oo.isEqual)(i?.[0]?.top,i?.[0]?.bottom)&&(0,Oo.isEqual)(i?.[0]?.top,i?.[0]?.bottom)&&(0,Oo.isEqual)(i?.[0]?.top,i?.[0]?.right)&&(0,Oo.isEqual)(i?.[0]?.top,i?.[0]?.left)&&N("linked")),r&&(0,Oo.isEqual)(i?.[0]?.unit,r?.[0]?.unit)&&(r[0].unit="",o(r)),s&&(0,Oo.isEqual)(i?.[0]?.unit,s?.[0]?.unit)&&(s[0].unit="",n(s))},[]);const{setPreviewDeviceType:T}=(0,To.useDispatch)("kadenceblocks/data"),R=[{name:"Desktop",title:(0,_o.jsx)(yo.Dashicon,{icon:"desktop"}),itemClass:"kb-desk-tab"},{name:"Tablet",title:(0,_o.jsx)(yo.Dashicon,{icon:"tablet"}),itemClass:"kb-tablet-tab"},{name:"Mobile",key:"mobile",title:(0,_o.jsx)(yo.Dashicon,{icon:"smartphone"}),itemClass:"kb-mobile-tab"}];let I=i?.[0]?i[0]:g;"Tablet"===O?I=s?.[0]?s[0]:v:"Mobile"===O&&(I=r?.[0]?r[0]:x);const P={},L=r?.[0]?.unit?r[0].unit:i?.[0]?.unit?i[0].unit:"px",A=s?.[0]?.unit?s[0].unit:i?.[0]?.unit?i[0].unit:"px";P.Mobile=(0,_o.jsx)(Kd,{value:r?JSON.parse(JSON.stringify(r)):void 0,onChange:e=>o(e),control:S,onControl:e=>N(e),defaultValue:x,styles:m,units:[L],firstIcon:u,secondIcon:d,thirdIcon:p,fourthIcon:h,linkIcon:f,unlinkIcon:b},"mobile"+_),P.Tablet=(0,_o.jsx)(Kd,{value:s?JSON.parse(JSON.stringify(s)):void 0,onChange:e=>n(e),control:S,onControl:e=>N(e),defaultValue:v,styles:m,units:[A],firstIcon:u,secondIcon:d,thirdIcon:p,fourthIcon:h,linkIcon:f,unlinkIcon:b},"tablet"+_),P.Desktop=(0,_o.jsx)(Kd,{value:i?JSON.parse(JSON.stringify(i)):void 0,onChange:e=>t(e),control:S,onControl:e=>N(e),defaultValue:g,styles:m,units:c,firstIcon:u,secondIcon:d,thirdIcon:p,fourthIcon:h,linkIcon:f,unlinkIcon:b},"desktop"+_);let D=g;return"Mobile"===O?D=x:"Mobile"===O&&(D=v),[t&&n&&o&&(0,_o.jsxs)("div",{className:`components-base-control kb-responsive-border-control kadence-border-box-control kadence-border-box-control${_}`,children:[(0,_o.jsxs)("div",{className:"kadence-border-control__header kadence-component__header",children:[e&&(0,_o.jsxs)("div",{className:"kadence-component__header__title kadence-radio-range__title",children:[(0,_o.jsx)("label",{className:"components-base-control__label",children:e}),k&&(0,_o.jsx)("div",{className:"title-reset-wrap",children:(0,_o.jsx)(yo.Button,{className:"is-reset is-single",label:"reset",isSmall:!0,disabled:!!(0,Oo.isEqual)(D,I),icon:kd,onClick:()=>{"Tablet"===O?n([v]):"Mobile"===O?o([x]):t([g])}})})]}),(0,_o.jsx)(yo.ButtonGroup,{className:"kb-responsive-options kb-measure-responsive-options","aria-label":(0,Mo.__)("Device","kadence-blocks"),children:(0,Oo.map)(R,({name:e,key:t,title:n,itemClass:o})=>(0,_o.jsx)(yo.Button,{className:`kb-responsive-btn ${o}${e===O?" is-active":""}`,isSmall:!0,"aria-pressed":O===e,onClick:()=>{return t=e,T((0,No.capitalizeFirstLetter)(t)),void E((0,No.capitalizeFirstLetter)(t));var t},children:n},t))}),N&&(0,_o.jsx)(yo.Button,{isSmall:!0,className:"kadence-radio-item border-control-toggle is-single only-icon",label:"individual"!==S?(0,Mo.__)("Individual","kadence-blocks"):(0,Mo.__)("Linked","kadence-blocks"),icon:"individual"!==S?w.link:w.unlink,onClick:()=>N("individual"!==S?"individual":"linked"),isPressed:"individual"!==S,isTertiary:"individual"===S})]}),(0,_o.jsx)("div",{className:"kb-responsive-border-control-inner",children:P[O]?P[O]:P.Desktop})]})]}function Zd(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 Qd({label:e,onChange:t,value:n="",className:o="",options:a=No.FONT_SIZES_MAP,step:r=1,max:s=200,min:i=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,preventUnitSelection:v=!1}){const[x,k]=(0,ko.useState)(!1);(0,ko.useEffect)(()=>{k(function(e,t){return!!t&&!!e&&!e.find(e=>e.value===t)}(a,n))},[]);const y=f?h:x,_=f||k,w=d.map(e=>({value:e,label:e})),C=y?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),j=[{value:"",output:"",size:"",label:(0,Mo.__)("Inherit","kadence-blocks"),name:(0,Mo.__)("Inherit","kadence-blocks")},...a];return[t&&(0,_o.jsxs)("div",{className:"components-base-control component-font-size-control kadence-font-size-control"+(o?" "+o:""),children:[!f&&e&&(0,_o.jsx)("div",{className:"kadence-font-size-control__header kadence-component__header",children:(0,_o.jsxs)("div",{className:"kadence-component__header__title kadence-radio-range__title",children:[(0,_o.jsx)("label",{className:"components-base-control__label",children:e}),m&&(0,_o.jsx)("div",{className:"title-reset-wrap",children:(0,_o.jsx)(yo.Button,{className:"is-reset is-single",label:"reset",isSmall:!0,disabled:!!(0,Oo.isEqual)(l,n),icon:kd,onClick:()=>{"function"==typeof m?m():t(l)}})})]})}),!y&&g&&(0,_o.jsx)("div",{className:"kadence-controls-content",children:(0,_o.jsxs)(yo.ButtonGroup,{className:"kadence-radio-container-control",children:[a.map((e,n)=>(0,_o.jsx)(yo.Button,{isTertiary:C!==e.value,className:"kadence-radio-item radio-"+e.value,isPrimary:C===e.value,icon:void 0!==e.icon?e.icon:void 0,"aria-pressed":C===e.value,onClick:()=>{C==e.value&&""==l?t(""):t(e.value)},children:e.label},`${e.label}-${e.value}-${n}`)),!p&&(0,_o.jsx)(yo.Button,{className:"kadence-radio-item radio-custom only-icon",label:(0,Mo.__)("Set custom size","kadence-blocks"),icon:zc,onClick:()=>{C&&"px"===c&&t(Zd(a,C)),_(!0)},isPressed:!1,isTertiary:!0})]})}),!y&&!g&&(0,_o.jsxs)("div",{className:"kadence-controls-content kadence-font-size-select-control-wrap",children:[(0,_o.jsx)(yo.SelectControl,{className:"kadence-font-size-select-control",value:C,options:j,onChange:e=>{t(C==e&&""==l?"":e)}}),!p&&(0,_o.jsx)(yo.ButtonGroup,{className:"kadence-radio-container-control",children:(0,_o.jsx)(yo.Button,{className:"kadence-radio-item radio-custom only-icon",label:(0,Mo.__)("Set custom size","kadence-blocks"),icon:zc,onClick:()=>{C&&"px"===c&&t(Zd(a,C)),_(!0)},isPressed:!1,isTertiary:!0})})]}),y&&(0,_o.jsxs)("div",{className:"kadence-controls-content kadence-single-unit-control",children:[(0,_o.jsx)(yo.__experimentalUnitControl,{label:b&&e?e:void 0,labelPosition:"top",min:i,max:s,step:r,units:w,value:n,disableUnits:!0,onChange:e=>(e=>{const n=isNaN(parseFloat(e))?void 0:parseFloat(e);t(n)})(e)}),(0,_o.jsx)("div",{className:"kadence-measure-control-select-wrapper",children:(0,_o.jsxs)("select",{className:"kadence-measure-control-select components-unit-control__select",onChange:e=>{u(e.target.value)},value:c,disabled:!!v,children:[!v&&d.map(e=>(0,_o.jsx)("option",{value:e,selected:c===e||void 0,children:e},e)),v&&(0,_o.jsx)("option",{value:c,selected:!0,children:""===c?"-":c},c)]})}),!p&&(0,_o.jsx)(yo.ButtonGroup,{className:"kadence-radio-container-control",children:(0,_o.jsx)(yo.Button,{className:"kadence-radio-item radio-custom only-icon",label:(0,Mo.__)("Use size preset","kadence-blocks"),icon:zc,isPrimary:!0,onClick:()=>{n&&"px"===c&&t(function(e,t){if(!t)return"";if(!e)return"";if("0"===t)return"";const n=e.find(e=>e.size===t);return n?n.value:""}(a,n)),_(!1)},isPressed:!0})})]})]})]}function ep({label:e,onChange:t,onChangeTablet:n,onChangeMobile:o,mobileValue:a,tabletValue:r,value:s,units:i=["px","em","rem"],onUnit:l,options:c=No.FONT_SIZES_MAP,step:u=1,max:d=200,min:p=0,unit:h="px",defaultValue:f=["","",""],reset:b=!0,radio:m=!0,compressedDevice:g=!1}){const v=(0,ko.useRef)(),[x,k]=(0,ko.useState)("Desktop"),y=(0,To.useSelect)(e=>e("kadenceblocks/data").getPreviewDeviceType(),[]);y!==x&&k(y);const{setPreviewDeviceType:_}=(0,To.useDispatch)("kadenceblocks/data"),w=e=>{_((0,No.capitalizeFirstLetter)(e)),k((0,No.capitalizeFirstLetter)(e))},C=[{name:"Desktop",title:(0,_o.jsx)(yo.Dashicon,{icon:"desktop"}),itemClass:"kb-desk-tab"},{name:"Tablet",title:(0,_o.jsx)(yo.Dashicon,{icon:"tablet"}),itemClass:"kb-tablet-tab"},{name:"Mobile",key:"mobile",title:(0,_o.jsx)(yo.Dashicon,{icon:"smartphone"}),itemClass:"kb-mobile-tab"}],j=[s,r,a],S={};S.Mobile=(0,_o.jsx)(Qd,{value:a||void 0,onChange:e=>o(e),options:c,onUnit:l,defaultValue:f[2],units:i,step:u,max:d,min:p,unit:h,radio:m,preventUnitSelection:!0}),S.Tablet=(0,_o.jsx)(Qd,{value:r||void 0,onChange:e=>n(e),options:c,onUnit:l,defaultValue:f[1],units:i,step:u,max:d,min:p,unit:h,radio:m,preventUnitSelection:!0}),S.Desktop=(0,_o.jsx)(Qd,{value:s||void 0,onChange:e=>t(e),options:c,onUnit:l,defaultValue:f[0],units:i,step:u,max:d,min:p,unit:h,radio:m});const N={Desktop:(0,_o.jsx)(yo.Dashicon,{icon:"desktop"}),Tablet:(0,_o.jsx)(yo.Dashicon,{icon:"tablet"}),Mobile:(0,_o.jsx)(yo.Dashicon,{icon:"smartphone"})};return[t&&n&&o&&(0,_o.jsxs)("div",{ref:v,className:"components-base-control kb-responsive-font-size-control kadence-font-size-control",children:[(0,_o.jsxs)("div",{className:"kadence-font-size-control__header kadence-component__header",children:[e&&(0,_o.jsxs)("div",{className:"kadence-component__header__title kadence-font-size__title",children:[(0,_o.jsx)("label",{className:"components-base-control__label",children:e}),b&&(0,_o.jsx)("div",{className:"title-reset-wrap",children:(0,_o.jsx)(yo.Button,{className:"is-reset is-single",label:"reset",isSmall:!0,disabled:!!(0,Oo.isEqual)(f,j),icon:kd,onClick:()=>{"function"==typeof b?b():"Mobile"===x?o(f[2]):"Tablet"===x?n(f[1]):t(f[0])}})})]}),!g&&(0,_o.jsx)(yo.ButtonGroup,{className:"kb-responsive-options kb-measure-responsive-options","aria-label":(0,Mo.__)("Device","kadence-blocks"),children:(0,Oo.map)(C,({name:e,key:t,title:n,itemClass:o})=>(0,_o.jsx)(yo.Button,{className:`kb-responsive-btn ${o}${e===x?" is-active":""}`,isSmall:!0,"aria-pressed":x===e,onClick:()=>w(e),children:n},t))}),g&&(0,_o.jsx)(yo.DropdownMenu,{className:"kb-responsive-options-dropdown",icon:N[x]?N[x]:N.Desktop,label:(0,Mo.__)("Target Device","kadence-blocks"),controls:C.map(e=>{return[{title:(t=e).name,icon:t.title,isActive:x===t.name,onClick:()=>{w(t.name)}}];var t})})]}),(0,_o.jsx)("div",{className:"kb-responsive-border-control-inner",children:S[x]?S[x]:S.Desktop})]})]}function tp({label:e,onChange:t,value:n="",className:o="",step:a=1,max:r=200,min:s=0,defaultValue:i="",unit:l="",onUnit:c,units:u=["px","em","rem"],parentLabel:d=null,reset:p=!0,preventUnitSelection:h=!1}){const f=u.map(e=>({value:e,label:e}));return[t&&(0,_o.jsxs)("div",{className:"components-base-control component-font-size-control kadence-font-size-control"+(o?" "+o:""),children:[e&&(0,_o.jsx)("div",{className:"kadence-font-size-control__header kadence-component__header",children:(0,_o.jsxs)("div",{className:"kadence-component__header__title kadence-radio-range__title",children:[(0,_o.jsx)("label",{className:"components-base-control__label",children:e}),p&&(0,_o.jsx)("div",{className:"title-reset-wrap",children:(0,_o.jsx)(yo.Button,{className:"is-reset is-single",label:"reset",isSmall:!0,disabled:!!(0,Oo.isEqual)(i,n),icon:kd,onClick:()=>{"function"==typeof p?p():t(i)}})})]})}),(0,_o.jsxs)("div",{className:"kadence-controls-content kadence-single-unit-control",children:[(0,_o.jsx)(yo.__experimentalUnitControl,{label:d&&e?e:void 0,labelPosition:"top",min:s,max:r,step:a,units:f,value:n,disableUnits:!0,onChange:e=>(e=>{const n=isNaN(parseFloat(e))?void 0:parseFloat(e);t(n)})(e)}),(0,_o.jsx)("div",{className:"kadence-measure-control-select-wrapper",children:(0,_o.jsx)("select",{className:"kadence-measure-control-select components-unit-control__select",onChange:e=>{"-"===e.target.value?c(""):c(e.target.value)},value:l,disabled:!!h,children:u.map(e=>h?l===e&&(0,_o.jsx)("option",{value:e,selected:l===e||""===l&&"-"===e||void 0,children:e},e):(0,_o.jsx)("option",{value:e,selected:l===e||""===l&&"-"===e||void 0,children:e},e))})})]})]})]}function np({label:e,onChange:t,onChangeTablet:n,onChangeMobile:o,mobileValue:a,tabletValue:r,value:s,units:i=["px","em","rem"],onUnit:l,step:c=1,max:u=200,min:d=0,unit:p="",defaultValue:h=["","",""],compressedDevice:f=!1,reset:b=!0}){const m=(0,ko.useRef)(),[g,v]=(0,ko.useState)("Desktop"),x=(0,To.useSelect)(e=>e("kadenceblocks/data").getPreviewDeviceType(),[]);x!==g&&v(x);const{setPreviewDeviceType:k}=(0,To.useDispatch)("kadenceblocks/data"),y=e=>{k((0,No.capitalizeFirstLetter)(e)),v((0,No.capitalizeFirstLetter)(e))},_=[{name:"Desktop",title:(0,_o.jsx)(yo.Dashicon,{icon:"desktop"}),itemClass:"kb-desk-tab"},{name:"Tablet",title:(0,_o.jsx)(yo.Dashicon,{icon:"tablet"}),itemClass:"kb-tablet-tab"},{name:"Mobile",key:"mobile",title:(0,_o.jsx)(yo.Dashicon,{icon:"smartphone"}),itemClass:"kb-mobile-tab"}],w={Desktop:(0,_o.jsx)(yo.Dashicon,{icon:"desktop"}),Tablet:(0,_o.jsx)(yo.Dashicon,{icon:"tablet"}),Mobile:(0,_o.jsx)(yo.Dashicon,{icon:"smartphone"})},C=[s,r,a],j={};return j.Mobile=(0,_o.jsx)(tp,{value:a||void 0,onChange:e=>o(e),onUnit:l,defaultValue:h[2],units:i,step:c,max:u,min:d,unit:p,preventUnitSelection:!0}),j.Tablet=(0,_o.jsx)(tp,{value:r||void 0,onChange:e=>n(e),onUnit:l,defaultValue:h[1],units:i,step:c,max:u,min:d,unit:p,preventUnitSelection:!0}),j.Desktop=(0,_o.jsx)(tp,{value:s||void 0,onChange:e=>t(e),onUnit:l,defaultValue:h[0],units:i,step:c,max:u,min:d,unit:p}),[t&&n&&o&&(0,_o.jsxs)("div",{ref:m,className:"components-base-control kb-responsive-unit-control kadence-unit-control",children:[(0,_o.jsxs)("div",{className:"kadence-unit-control__header kadence-component__header",children:[e&&(0,_o.jsxs)("div",{className:"kadence-component__header__title kadence-unit__title",children:[(0,_o.jsx)("label",{className:"components-base-control__label",children:e}),b&&(0,_o.jsx)("div",{className:"title-reset-wrap",children:(0,_o.jsx)(yo.Button,{className:"is-reset is-single",label:"reset",isSmall:!0,disabled:!!(0,Oo.isEqual)(h,C),icon:kd,onClick:()=>{"function"==typeof b?b():"Mobile"===g?o(h[2]):"Tablet"===g?n(h[1]):t(h[0])}})})]}),!f&&(0,_o.jsx)(yo.ButtonGroup,{className:"kb-responsive-options kb-measure-responsive-options","aria-label":(0,Mo.__)("Device","kadence-blocks"),children:(0,Oo.map)(_,({name:e,key:t,title:n,itemClass:o})=>(0,_o.jsx)(yo.Button,{className:`kb-responsive-btn ${o}${e===g?" is-active":""}`,isSmall:!0,"aria-pressed":g===e,onClick:()=>y(e),children:n},t))}),f&&(0,_o.jsx)(yo.DropdownMenu,{className:"kb-responsive-options-dropdown",icon:w[g]?w[g]:w.Desktop,label:(0,Mo.__)("Target Device","kadence-blocks"),controls:_.map(e=>{return[{title:(t=e).name,icon:t.title,isActive:g===t.name,onClick:()=>{y(t.name)}}];var t})})]}),(0,_o.jsx)("div",{className:"kb-responsive-border-control-inner",children:j[g]?j[g]:j.Desktop})]})]}const op=(0,_o.jsx)(Ho.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,_o.jsx)(Ho.Path,{d:"M19 8h-1V6h-5v2h-2V6H6v2H5c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-8c0-1.1-.9-2-2-2zm.5 10c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5v-8c0-.3.2-.5.5-.5h14c.3 0 .5.2.5.5v8z"})}),ap=(0,_o.jsx)(Ho.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,_o.jsx)(Ho.Path,{d:"M4 20h8v-1.5H4V20zM18.9 3.5c-.6-.6-1.5-.6-2.1 0l-7.2 7.2c-.4-.1-.7 0-1.1.1-.5.2-1.5.7-1.9 2.2-.4 1.7-.8 2.2-1.1 2.7-.1.1-.2.3-.3.4l-.6 1.1H6c2 0 3.4-.4 4.7-1.4.8-.6 1.2-1.4 1.3-2.3 0-.3 0-.5-.1-.7L19 5.7c.5-.6.5-1.6-.1-2.2zM9.7 14.7c-.7.5-1.5.8-2.4 1 .2-.5.5-1.2.8-2.3.2-.6.4-1 .8-1.1.5-.1 1 .1 1.3.3.2.2.3.5.2.8 0 .3-.1.9-.7 1.3z"})}),rp=(0,_c.compose)([(0,To.withSelect)((e,t)=>{const n=void 0!==t.initialOpen?t.initialOpen:"general";return{openedTab:e("kadenceblocks/data").getOpenSidebarTabKey(t.panelName+e("core/block-editor").getSelectedBlockClientId(),n)}}),(0,To.withDispatch)((e,t,{select:n})=>{const{getSelectedBlockClientId:o}=n("core/block-editor");return{toggleOpened:n=>{e("kadenceblocks/data").switchEditorTabOpened(t.panelName+o(),n)}}})])(function({allowedTabs:e=null,activeTab:t,setActiveTab:n,openedTab:o,toggleOpened:a,tabs:r=null}){const s=[{key:"general",title:(0,Mo.__)("General","kadence-blocks"),icon:op},{key:"style",title:(0,Mo.__)("Style","kadence-blocks"),icon:ap},{key:"advanced",title:(0,Mo.__)("Advanced","kadence-blocks"),icon:zc}],i=e||["general","style","advanced"],l=r||s,c=(0,ko.createRef)();let u;return(0,ko.useEffect)(()=>{u=c.current.closest(".components-panel")}),t!==o&&n(o),(0,ko.useEffect)(()=>{var e;return e=t,u&&(u.setAttribute("data-kadence-hide-advanced","advanced"!==e),u.setAttribute("data-kadence-active-tab",e)),()=>{if(u){const e=u.querySelector(".kadence-blocks-inspector-tabs");e&&null!==e||(u.removeAttribute("data-kadence-hide-advanced"),u.removeAttribute("data-kadence-active-tab"))}}},[t]),(0,_o.jsx)("div",{className:"kadence-blocks-inspector-tabs",ref:c,children:l.map(({key:e,title:o,icon:r},s)=>{if(i.includes(e))return(0,_o.jsxs)("button",{"aria-label":o+" "+(0,Mo.__)("tab","kadence-blocks"),onClick:()=>(e=>{a(e),n(e)})(e),className:Bc()({"is-active":e===t}),children:[(0,_o.jsx)(yo.Icon,{icon:r})," ",o]},e)})})});function sp({label:e=(0,Mo.__)("Hover Styles","kadence-blocks"),activeLabel:t=(0,Mo.__)("Active Styles","kadence-blocks"),initial:n="normal",hoverTab:o=(0,Mo.__)("Hover","kadence-blocks"),normalTab:a=(0,Mo.__)("Normal","kadence-blocks"),activeTab:r=(0,Mo.__)("Active","kadence-blocks"),active:s,hover:i,normal:l,className:c="",icon:u=tu.hoverToggle,activeIcon:d=tu.click,tabUI:p=!0,setActivePreview:h,activePreview:f}){const[b,m]=(0,ko.useState)("hover"===n),[g,v]=(0,ko.useState)("active"===n);var x=[{name:"normal",title:a,className:"kt-normal-tab"}];return i&&x.push({name:"hover",title:o,className:"kt-hover-tab"}),s&&x.push({name:"active",title:r,className:"kt-active-tab"}),p?[(0,_o.jsx)("div",{className:"components-base-control kb-hover-toggle-control-tab-ui kb-hover-toggle-control"+(c?" "+c:""),children:(0,_o.jsx)(yo.TabPanel,{className:"kt-inspect-tabs kt-hover-tabs",activeClass:"active-tab",tabs:x,children:e=>{if(e.name)return"hover"===e.name?(0,_o.jsx)(_o.Fragment,{children:i}):"active"===e.name?(0,_o.jsxs)(_o.Fragment,{children:[h&&(0,_o.jsx)(yo.Button,{className:"kb-hover-toggle-active-preview",isPressed:f,text:f?(0,Mo.__)("Hide Active State","kadence-blocks"):(0,Mo.__)("Preview Active State","kadence-blocks"),onClick:()=>{h(!f)},variant:"secondary"}),s]}):(0,_o.jsx)(_o.Fragment,{children:l})}})})]:[(0,_o.jsxs)("div",{className:"components-base-control kb-hover-toggle-control"+(c?" "+c:""),children:[(0,_o.jsxs)("div",{className:"kb-hover-toggle-control-toggle",children:[i&&(0,_o.jsx)(yo.Button,{className:"kb-hover-toggle-btn "+(No.isRTL?"is-rtl":""),isPrimary:b,icon:u,"aria-pressed":b,label:e,onClick:()=>{v(!1),m(!b)}}),s&&(0,_o.jsx)(yo.Button,{className:"kb-active-toggle-btn "+(No.isRTL?"is-rtl":""),isPrimary:g,icon:d,"aria-pressed":g,label:t,onClick:()=>{m(!1),v(!g)}})]}),(0,_o.jsxs)("div",{className:"kb-hover-toggle-area",children:[b&&(0,_o.jsx)("div",{className:"kb-hover-control-wrap",children:i}),g&&(0,_o.jsx)("div",{className:"kb-active-control-wrap",children:s}),!b&&!g&&(0,_o.jsx)(_o.Fragment,{children:l})]})]})]}function ip({label:e,onChange:t,value:n="",className:o="",isCollapsed:a=!1,ariaLabel:r=(0,Mo.__)("Change HTML Tag","kadence-blocks"),reset:s=!1,headingOnly:i=!1,tagLowLevel:l=1,tagHighLevel:c=7}){const u="span"!==n&&"div"!==n&&"p"!==n?n:2,d="span"===n||"div"===n||"p"===n?n:"heading",p=[[{icon:(0,_o.jsx)(yc,{level:1,isPressed:!(1!==u||!d||"heading"!==d)}),title:(0,Mo.__)("Heading 1","kadence-blocks"),isActive:!(1!==u||!d||"heading"!==d),onClick:()=>t(1)}],[{icon:(0,_o.jsx)(yc,{level:2,isPressed:!(2!==u||!d||"heading"!==d)}),title:(0,Mo.__)("Heading 2","kadence-blocks"),isActive:!(2!==u||!d||"heading"!==d),onClick:()=>t(2)}],[{icon:(0,_o.jsx)(yc,{level:3,isPressed:!(3!==u||!d||"heading"!==d)}),title:(0,Mo.__)("Heading 3","kadence-blocks"),isActive:!(3!==u||!d||"heading"!==d),onClick:()=>t(3)}],[{icon:(0,_o.jsx)(yc,{level:4,isPressed:!(4!==u||!d||"heading"!==d)}),title:(0,Mo.__)("Heading 4","kadence-blocks"),isActive:!(4!==u||!d||"heading"!==d),onClick:()=>t(4)}],[{icon:(0,_o.jsx)(yc,{level:5,isPressed:!(5!==u||!d||"heading"!==d)}),title:(0,Mo.__)("Heading 5","kadence-blocks"),isActive:!(5!==u||!d||"heading"!==d),onClick:()=>t(5)}],[{icon:(0,_o.jsx)(yc,{level:6,isPressed:!(6!==u||!d||"heading"!==d)}),title:(0,Mo.__)("Heading 6","kadence-blocks"),isActive:!(6!==u||!d||"heading"!==d),onClick:()=>t(6)}],[{icon:(0,_o.jsx)(yc,{level:"p",isPressed:!(!d||"p"!==d)}),title:(0,Mo.__)("Paragraph","kadence-blocks"),isActive:!(!d||"p"!==d),onClick:()=>t("p")}],[{icon:(0,_o.jsx)(yc,{level:"span",isPressed:!(!d||"span"!==d)}),title:(0,Mo.__)("Span","kadence-blocks"),isActive:!(!d||"span"!==d),onClick:()=>t("span")}],[{icon:(0,_o.jsx)(yc,{level:"div",isPressed:!(!d||"div"!==d)}),title:(0,Mo.__)("div","kadence-blocks"),isActive:!(!d||"div"!==d),onClick:()=>t("div")}]],h=(0,Oo.range)(l,c).map(e=>[{icon:(0,_o.jsx)(yc,{level:e,isPressed:!(e!==u||!d||"heading"!==d)}),title:sprintf(/* translators: %d: heading level e.g: "1", "2", "3" */ /* translators: %d: heading level e.g: "1", "2", "3" */
     40(0,Mo.sprintf)((0,Mo.__)("Color code: %s","kadence-blocks"),n)})}),h&&(0,_o.jsx)(yo.Dashicon,{icon:"admin-site"}),!o.startsWith("theme-palette")&&u===n&&(0,_o.jsx)(yo.Dashicon,{icon:"saved"})]},n)})})]}),style:null!==a?{left:`${a}%`,transform:"translateX( -50% )"}:void 0})};const $u=Gu;function Wu(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 qu={id:"IDLE"};function Xu({background:e,hasGradient:t,value:n,onChange:o,disableInserter:a=!1,isRenderedInSidebar:r}){const s=(0,ko.useRef)(),[i,l]=(0,ko.useReducer)(Wu,qu),c=e=>{const t=Fu(e.clientX,s.current);(0,Oo.some)(n,({position:e})=>Math.abs(t-e)<Mu)?"MOVING_INSERTER"===i.id&&l({type:"STOP_INSERTER_MOVE"}):l({type:"MOVE_INSERTER",insertPosition:t})},u="MOVING_INSERTER"===i.id,d="INSERTING_CONTROL_POINT"===i.id;return(0,_o.jsx)("div",{className:Bc()("components-custom-gradient-picker__gradient-bar",{"has-gradient":t}),onMouseEnter:c,onMouseMove:c,style:{background:e},onMouseLeave:()=>{l({type:"STOP_INSERTER_MOVE"})},children:(0,_o.jsxs)("div",{ref:s,className:"components-custom-gradient-picker__markers-container",children:[!a&&(u||d)&&(0,_o.jsx)($u.InsertPoint,{isRenderedInSidebar:r,insertPosition:i.insertPosition,value:n,onChange:o,onOpenInserter:()=>{l({type:"OPEN_INSERTER"})},onCloseInserter:()=>{l({type:"CLOSE_INSERTER"})}}),(0,_o.jsx)($u,{isRenderedInSidebar:r,disableRemove:a,gradientPickerDomRef:s,ignoreMarkerPosition:d?i.insertPosition:void 0,value:n,onChange:o,onStartControlPointChange:()=>{l({type:"START_CONTROL_CHANGE"})},onStopControlPointChange:()=>{l({type:"STOP_CONTROL_CHANGE"})}})]})})}var Ju=a(9942);const Ku="linear-gradient(135deg, rgb(6, 147, 227) 0%, rgb(20, 39, 109) 100%)",Yu={type:"angular",value:90},Zu=[{type:"shape",value:"ellipse",at:{type:"position",value:{x:{type:"position-keyword",value:"center"},y:{type:"position-keyword",value:"center"}}}}],Qu=[{value:"linear-gradient",label:(0,Mo.__)("Linear","kadence-blocks")},{value:"radial-gradient",label:(0,Mo.__)("Radial","kadence-blocks")}],ed=[{value:"center top",label:(0,Mo.__)("Center Top","kadence-blocks")},{value:"center center",label:(0,Mo.__)("Center Center","kadence-blocks")},{value:"center bottom",label:(0,Mo.__)("Center Bottom","kadence-blocks")},{value:"left top",label:(0,Mo.__)("Left Top","kadence-blocks")},{value:"left center",label:(0,Mo.__)("Left Center","kadence-blocks")},{value:"left bottom",label:(0,Mo.__)("Left Bottom","kadence-blocks")},{value:"right top",label:(0,Mo.__)("Right Top","kadence-blocks")},{value:"right center",label:(0,Mo.__)("Right Center","kadence-blocks")},{value:"right bottom",label:(0,Mo.__)("Right Bottom","kadence-blocks")}],td={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 nd({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 od({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)}).map(nd)].filter(Boolean).join(",")})`}function ad(e){return void 0===e.length||"%"!==e.length.type}function rd(e){switch(e.type){case"hex":return`#${e.value}`;case"literal":return e.value;case"rgb":case"rgba":return`${e.type}(${e.value.join(",")})`;default:return"transparent"}}const sd=({gradientAST:e,hasGradient:t,onChange:n})=>{var o;const a=null!==(o=e?.orientation?.value)&&void 0!==o?o:180;return(0,_o.jsx)(yo.AnglePickerControl,{__nextHasNoMarginBottom:!0,onChange:t=>{n(od({...e,orientation:{type:"angular",value:t}}))},labelPosition:"top",value:t?a:""})},id=({gradientAST:e,hasGradient:t,onChange:n})=>{const{type:o}=e;return(0,_o.jsx)(yo.SelectControl,{className:"components-custom-gradient-picker__type-picker kadence-select-large",label:(0,Mo.__)("Type"),labelPosition:"top",onChange:t=>{"linear-gradient"===t&&n(od({...e,orientation:Yu,type:"linear-gradient"})),"radial-gradient"===t&&n(od({...e,orientation:Zu,type:"radial-gradient"}))},options:Qu,value:t&&o})},ld=({gradientAST:e,hasGradient:t,onChange:n})=>{let o="center center",a="50%",r="50%",s="position-keyword";e?.orientation&&e?.orientation[0]?.at?.value?.x?.value&&(s=e.orientation[0].at.value.x.type,"position-keyword"!==s?(o=e.orientation[0].at.value.x.value+"% "+e.orientation[0].at.value.y.value+"%",a=e.orientation[0].at.value.x.value+"%",r=e.orientation[0].at.value.y.value+"%"):o=e.orientation[0].at.value.x.value+" "+e.orientation[0].at.value.y.value);const i=t=>{const a=o.split(" ");let r="%"===t?50:"center",s="%"===t?50:"center";if(a[0])switch(a[0]){case"left":r=0;break;case"right":r="100";break;case"center":r=50;break;case 0:s="left";break;case 100:s="right";break;case 50:s="center"}if(a[1])switch(a[1]){case"top":s=0;break;case"bottom":s=100;break;case"center":s=50;break;case 0:s="top";break;case 100:s="bottom";break;case 50:s="center"}n(od({...e,orientation:[{type:"shape",value:e.orientation[0].value,at:{type:"position",value:{x:{type:t,value:r},y:{type:t,value:s}}}}]}))};if(t)return(0,_o.jsxs)("div",{className:"components-base-control kadence-gradient-position-control",children:[(0,_o.jsx)(yo.Flex,{justify:"space-between",className:"kadence-gradient-position_header",children:(0,_o.jsx)(yo.FlexItem,{children:(0,_o.jsx)("label",{className:"kadence-gradient-position__label",children:(0,Mo.__)("Position","kadence-blocks")})})}),"position-keyword"===s&&(0,_o.jsxs)("div",{className:"kadence-controls-content",children:[(0,_o.jsx)(yo.SelectControl,{className:"components-custom-gradient-picker__position-picker",onChange:t=>{const o=t.split(" ");n(od({...e,orientation:[{type:"shape",value:e.orientation[0].value,at:{type:"position",value:{x:{type:"position-keyword",value:void 0!==o[0]&&o[0]?o[0]:"center"},y:{type:"position-keyword",value:void 0!==o[1]&&o[1]?o[1]:"center"}}}}]}))},options:ed,value:o}),(0,_o.jsx)(yo.Button,{className:"kadence-control-toggle-advanced only-icon",label:(0,Mo.__)("Set custom position","kadence-blocks"),icon:zc,onClick:()=>i("%"),isPressed:!1,isTertiary:!0})]}),"position-keyword"!==s&&(0,_o.jsxs)("div",{className:"kadence-controls-content",children:[(0,_o.jsx)(yo.__experimentalUnitControl,{labelPosition:"left",label:(0,Mo.__)("Left","kadence-blocks"),max:100,min:0,units:[{value:"%",label:"%"}],value:a,onChange:t=>{n(od({...e,orientation:[{type:"shape",value:e.orientation[0].value,at:{type:"position",value:{x:{type:"%",value:parseInt(t,10)},y:e.orientation[0].at.value.y}}}]}))}}),(0,_o.jsx)(yo.__experimentalUnitControl,{labelPosition:"left",label:(0,Mo.__)("Top","kadence-blocks"),max:100,min:0,value:r,units:[{value:"%",label:"%"}],onChange:t=>{n(od({...e,orientation:[{type:"shape",value:e.orientation[0].value,at:{type:"position",value:{x:e.orientation[0].at.value.x,y:{type:"%",value:parseInt(t,10)}}}}]}))}}),(0,_o.jsx)(yo.Button,{className:"kadence-control-toggle-advanced only-icon",label:(0,Mo.__)("Set standard position","kadence-blocks"),icon:zc,onClick:()=>i("position-keyword"),isPrimary:!0,isPressed:!0})]})]})},cd=({gradientAST:e,hasGradient:t,onChange:n})=>{let o="ellipse";return e?.orientation&&e?.orientation[0]?.type&&"shape"===e?.orientation[0]?.type&&e?.orientation[0]?.value&&(o=e?.orientation&&e?.orientation[0]?.value),(0,_o.jsx)(yo.SelectControl,{className:"components-custom-gradient-picker__shape-picker kadence-select-large",label:(0,Mo.__)("Shape","kadence-blocks"),labelPosition:"top",onChange:t=>{n(od({...e,orientation:[{type:"shape",value:t,at:e.orientation[0].at}]}))},options:[{value:"ellipse",label:(0,Mo.__)("Ellipse","kadence-blocks")},{value:"circle",label:(0,Mo.__)("Circle","kadence-blocks")}],value:t&&o})};function ud({value:e,onChange:t,isRenderedInSidebar:n=!0}){const o=function(e){let t;try{t=Ju.parse(e)[0],t.value=e}catch(e){t=Ju.parse(Ku)[0],t.value=Ku}if("directional"===t.orientation?.type&&(t.orientation.type="angular",t.orientation.value=td[t.orientation.value].toString()),t.colorStops.some(ad)){const{colorStops:e}=t,n=100/(e.length-1);e.forEach((e,t)=>{e.length={value:n*t,type:"%"}}),t.value=od(t)}return t}(e),a=function(e){return od({type:"linear-gradient",orientation:Yu,colorStops:e.colorStops})}(o),r=o.value!==Ku,s=o.colorStops.map(e=>({color:rd(e),position:parseInt(e.length.value)}));return(0,_o.jsxs)("div",{className:"components-base-control components-custom-gradient-picker kadence-gradient-control",children:[(0,_o.jsx)(Xu,{isRenderedInSidebar:n,background:a,hasGradient:r,value:s,onChange:e=>{t(od(function(e,t){return{...e,colorStops:t.map(({position:e,color:t})=>{if(t.startsWith("var("))return{length:{type:"%",value:e?.toString()},type:"literal",value:t};const{r:n,g:o,b:a,a:r}=Ou(t).toRgb();return{length:{type:"%",value:e?.toString()},type:r<1?"rgba":"rgb",value:r<1?[n,o,a,r]:[n,o,a]}})}}(o,e)))}}),(0,_o.jsxs)(yo.Flex,{gap:3,className:"components-custom-gradient-picker__ui-line",children:[(0,_o.jsx)("div",{className:"components-custom-gradient-picker__item components-custom-gradient-picker-type",children:(0,_o.jsx)(id,{gradientAST:o,hasGradient:r,onChange:t})}),"linear-gradient"===o.type&&(0,_o.jsx)("div",{className:"components-custom-gradient-picker__item components-custom-gradient-picker-angle",children:(0,_o.jsx)(sd,{gradientAST:o,hasGradient:r,onChange:t})}),"radial-gradient"===o.type&&(0,_o.jsx)("div",{className:"components-custom-gradient-picker__item components-custom-gradient-picker-shape",children:(0,_o.jsx)(cd,{gradientAST:o,hasGradient:r,onChange:t})})]}),"radial-gradient"===o.type&&(0,_o.jsx)(yo.Flex,{gap:3,className:"components-custom-gradient-picker__ui-line",children:(0,_o.jsx)("div",{className:"components-custom-gradient-picker__item components-custom-gradient-picker-position",children:(0,_o.jsx)(ld,{gradientAST:o,hasGradient:r,onChange:t})})})]})}const dd=[{value:"0",label:(0,Mo.__)("None","kadence-blocks"),size:0,name:(0,Mo.__)("None","kadence-blocks")},{value:"xxs",output:"var(--global-kb-spacing-xxs, 0.5rem)",size:8,label:(0,Mo.__)("XXS","kadence-blocks"),name:(0,Mo.__)("2X Small","kadence-blocks")},{value:"xs",output:"var(--global-kb-spacing-xs, 1rem)",size:16,label:(0,Mo.__)("XS","kadence-blocks"),name:(0,Mo.__)("X Small","kadence-blocks")},{value:"sm",output:"var(--global-kb-spacing-sm, 1.5rem)",size:24,label:(0,Mo.__)("SM","kadence-blocks"),name:(0,Mo.__)("Small","kadence-blocks")},{value:"md",output:"var(--global-kb-spacing-md, 2rem)",size:32,label:(0,Mo.__)("MD","kadence-blocks"),name:(0,Mo.__)("Medium","kadence-blocks")},{value:"lg",output:"var(--global-kb-spacing-lg, 3rem)",size:48,label:(0,Mo.__)("LG","kadence-blocks"),name:(0,Mo.__)("Large","kadence-blocks")},{value:"xl",output:"var(--global-kb-spacing-xl, 4rem)",size:64,label:(0,Mo.__)("XL","kadence-blocks"),name:(0,Mo.__)("X Large","kadence-blocks")},{value:"xxl",output:"var(--global-kb-spacing-xxl, 5rem)",size:80,label:(0,Mo.__)("XXL","kadence-blocks"),name:(0,Mo.__)("2X Large","kadence-blocks")},{value:"3xl",output:"var(--global-kb-spacing-3xl, 6.5rem)",size:104,label:(0,Mo.__)("3XL","kadence-blocks"),name:(0,Mo.__)("3X Large","kadence-blocks")},{value:"4xl",output:"var(--global-kb-spacing-4xl, 8rem)",size:128,label:(0,Mo.__)("4XL","kadence-blocks"),name:(0,Mo.__)("4X Large","kadence-blocks")},{value:"5xl",output:"var(--global-kb-spacing-5xl, 10rem)",size:160,label:(0,Mo.__)("5XL","kadence-blocks"),name:(0,Mo.__)("5X Large","kadence-blocks")}];function pd(e,t){if(!t)return;if(!e)return;if("0"===t||"default"===t)return 0;return e.findIndex(e=>e.value===t)||void 0}function hd({label:e,onChange:t,value:n="",placeholder:o="",className:a="",options:r=dd,step:s=1,max:i=200,min:l=0,beforeIcon:c="",help:u="",defaultValue:d=0,unit:p="",onUnit:h,units:f=["px","em","rem"],disableCustomSizes:b=!1,customControl:m=!1,setCustomControl:g=null,isPopover:v=!1,isSingle:x=!1,parentLabel:k=null,onMouseOver:y,onMouseOut:_,allowAuto:w=!1}){const[C,j]=(0,ko.useState)(!1),[S,N]=(0,ko.useState)(!1),O=JSON.parse(JSON.stringify(r));O.push({value:"ss-auto",output:"var(--global-kb-spacing-auto, auto)",label:(0,Mo.__)("Auto","kadence-blocks"),size:0,name:(0,Mo.__)("Auto","kadence-blocks")}),(0,ko.useEffect)(()=>{j(function(e,t){return!!t&&!!e&&!e.find(e=>e.value===t)}(O,n))},[]);const E=g?m:C,M=g||j,T=r.map((e,t)=>({value:t,label:void 0})),R=f.map(e=>({value:e,label:e})),I=E?Number(n):pd(O,n),P=E?Number(o):pd(O,o),L=O[I]?.label?O[I]?.label:(0,Mo.__)("Unset","kadence-blocks"),A=O[I]?.name?O[I]?.name+" "+O[I]?.size+"px":(0,Mo.__)("Unset","kadence-blocks"),D=k?k+" ":"";let F=e;x?F=A:e&&D&&(F=D+e+" "+L);const V=(0,_o.jsxs)(_o.Fragment,{children:[(0,_o.jsx)(yo.RangeControl,{label:F||void 0,className:"components-spacing-sizes-control__range-control",beforeIcon:c,value:"ss-auto"==n?"":I,onChange:e=>{var n;t(void 0===e?d:void 0===(n=e)?"":0===parseInt(n,10)?"0":`${r[n]?.value}`)},min:0,max:r.length-1,marks:T,step:1,help:u,withInputField:!1,"aria-valuenow":I,"aria-valuetext":r[I]?.label,renderTooltipContent:e=>O[e]?.label,initialPosition:d||0,allowReset:!!x,hideLabelFromVision:!v&&!x,onMouseOver:y,onMouseOut:_,onMouseDown:e=>{e?.nativeEvent?.offsetX<35&&void 0===n&&t("0")}}),!b&&(0,_o.jsx)(yo.Button,{className:"kadence-radio-item radio-custom only-icon",label:(0,Mo.__)("Set custom size","kadence-blocks"),icon:zc,onClick:()=>M(!0),isPressed:!1,isTertiary:!0})]});return[t&&(0,_o.jsxs)("div",{className:"components-base-control component-spacing-sizes-control kadence-single-measure-range-control"+(a?" "+a:""),children:[!g&&e&&(0,_o.jsx)(yo.Flex,{justify:"space-between",className:"kadence-radio-range__header",children:(0,_o.jsx)(yo.FlexItem,{children:(0,_o.jsx)("label",{className:"components-base-control__label",children:e})})}),!E&&(0,_o.jsxs)("div",{className:"kadence-controls-content",children:[v&&(0,_o.jsxs)(_o.Fragment,{children:[(0,_o.jsxs)(yo.Button,{className:"kadence-popover-spacing-btn",disabled:!(!n||"auto"!=n),tabIndex:"-1",onClick:n&&"auto"==n?"":function(){N(!S)},onMouseOver:y,onMouseOut:_,children:[k&&e&&(0,_o.jsx)("span",{className:"kadence-placement-label",children:e}),(0,_o.jsxs)("span",{className:"kadence-spacing-btn-val",children:[O[I]?.label,!O[I]?.label&&(0,_o.jsx)("span",{className:"kadence-spacing-btn-placeholder",children:O?.[P]?.label?O?.[P]?.label:o})]})]}),S&&(0,_o.jsx)(yo.Popover,{onClose:function(){N(!1)},className:"kadence-range-popover-settings",children:(0,_o.jsxs)("div",{className:"kadence-range-popover-settings-inner",children:[V,w&&(0,_o.jsx)(yo.Button,{className:"custom-auto-button",variant:"secondary",isSmall:!0,text:(0,Mo.__)("Auto","kadence-blocks"),onClick:()=>t("ss-auto"),isPressed:!(!n||"ss-auto"!=n)}),(0,_o.jsx)(yo.Button,{className:"custom-reset-button",variant:"secondary",isSmall:!0,text:(0,Mo.__)("Reset","kadence-blocks"),onClick:()=>t("")})]})})]}),!v&&(0,_o.jsx)(_o.Fragment,{children:V})]}),E&&(0,_o.jsxs)("div",{className:"kadence-controls-content kadence-single-unit-control",children:[(0,_o.jsx)(yo.__experimentalUnitControl,{label:k&&e?e:void 0,labelPosition:"top",min:l,max:i,disabled:!(!n||"auto"!=n),step:s,units:R,value:n,placeholder:o||void 0,disableUnits:!0,onChange:e=>(e=>{const n=isNaN(parseFloat(e))?void 0:parseFloat(e);t(n)})(e),onMouseOver:y,onMouseOut:_}),!k&&(0,_o.jsx)("div",{className:"kadence-measure-control-select-wrapper",children:(0,_o.jsx)("select",{className:"kadence-measure-control-select components-unit-control__select",onChange:e=>{h(e.target.value)},value:p,children:f.map(e=>(0,_o.jsx)("option",{value:e,selected:p===e||void 0,children:e},e))})}),!b&&(0,_o.jsx)(yo.ButtonGroup,{className:"kadence-radio-container-control",children:(0,_o.jsx)(yo.Button,{className:"kadence-radio-item radio-custom only-icon",label:(0,Mo.__)("Use size preset","kadence-blocks"),icon:zc,isPrimary:!0,onClick:()=>M(!1),isPressed:!0})})]})]})]}tu.pxIcon,tu.emIcon,tu.remIcon,tu.vhIcon,tu.vwIcon,tu.percentIcon;const fd=(0,_o.jsx)(Ho.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,_o.jsx)(Ho.Path,{d:"M10 17.389H8.444A5.194 5.194 0 1 1 8.444 7H10v1.5H8.444a3.694 3.694 0 0 0 0 7.389H10v1.5ZM14 7h1.556a5.194 5.194 0 0 1 0 10.39H14v-1.5h1.556a3.694 3.694 0 0 0 0-7.39H14V7Zm-4.5 6h5v-1.5h-5V13Z"})}),bd=(0,_o.jsx)(Ho.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,_o.jsx)(Ho.Path,{d:"M17.031 4.703 15.576 4l-1.56 3H14v.03l-2.324 4.47H9.5V13h1.396l-1.502 2.889h-.95a3.694 3.694 0 0 1 0-7.389H10V7H8.444a5.194 5.194 0 1 0 0 10.389h.17L7.5 19.53l1.416.719L15.049 8.5h.507a3.694 3.694 0 0 1 0 7.39H14v1.5h1.556a5.194 5.194 0 0 0 .273-10.383l1.202-2.304Z"})});function md(e,t){return!(!t||!e||!(void 0===t[0]||""!==t[0]||void 0===t[1]||""!==t[1]&&"auto"!==t[1]||void 0===t[2]||""!==t[2]||void 0===t[3]||""!==t[3]&&"auto"!==t[3])||(void 0!==t[0]&&""!==t[0]?e.find(e=>e.value===t[0]):void 0!==t[1]&&""!==t[1]&&"auto"!==t[1]?e.find(e=>e.value===t[1]):void 0!==t[2]&&""!==t[2]?e.find(e=>e.value===t[2]):void 0!==t[3]&&""!==t[3]&&"auto"!==t[3]?e.find(e=>e.value===t[3]):e.find(e=>e.value===t)))}function gd(e,t,n){if(!t)return"";if(!e)return"";if("0"===t)return 0;if("px"!==n)return"";const o=e.find(e=>e.value===t);return o?o.size:""}function vd(e,t,n){if(!t)return"";if(!e)return"";if(0===t)return"0";if("px"!==n)return"";const o=e.find(e=>e.size.toString()===t.toString());return o?o.value:""}function xd({label:e,onChange:t,onControl:n,value:o="",className:a="",options:r=dd,step:s=1,max:i=200,min:l=0,beforeIcon:c="",help:u="",placeholder:d=["","","",""],defaultValue:p=["","","",""],control:h="individual",unit:f="",onUnit:b,units:m=["px","em","rem"],disableCustomSizes:g=!1,isBorderRadius:v=!1,firstIcon:x=tu.outlineTopIcon,secondIcon:k=tu.outlineRightIcon,thirdIcon:y=tu.outlineBottomIcon,fourthIcon:_=tu.outlineLeftIcon,linkIcon:w=fd,unlinkIcon:C=bd,customControl:j=!1,setCustomControl:S=null,parentLabel:N=null,reset:O,onMouseOver:E,onMouseOut:M,allowAuto:T=!1}){const R={first:v?tu.topLeftIcon:x,second:v?tu.topRightIcon:k,third:v?tu.bottomRightIcon:y,fourth:v?tu.bottomLeftIcon:_,link:v?tu.radiusLinkedIcon:w,unlink:v?tu.radiusIndividualIcon:C},[I,P]=(0,ko.useState)(!1),[L,A]=(0,ko.useState)(h),D=JSON.parse(JSON.stringify(r));D.push({value:"ss-auto",output:"var(--global-kb-spacing-auto, auto)",label:(0,Mo.__)("Auto","kadence-blocks"),size:0,name:(0,Mo.__)("Auto","kadence-blocks")}),(0,ko.useEffect)(()=>{P(md(D,o))},[]);const F=S?j:I,V=S||P,B=n?h:L,z=n||A;return[t&&(0,_o.jsxs)("div",{className:"components-base-control component-spacing-sizes-control kadence-measure-range-control "+(a?" "+a:""),children:[e&&(0,_o.jsxs)(yo.Flex,{justify:"space-between",className:"kadence-component__header kadence-radio-range__header",children:[e&&(0,_o.jsxs)("div",{className:"kadence-component__header__title kadence-radio-range__title",children:[(0,_o.jsx)("label",{className:"components-base-control__label",children:e}),O&&(0,_o.jsx)("div",{className:"title-reset-wrap",children:(0,_o.jsx)(yo.Button,{className:"is-reset is-single",label:"reset",isSmall:!0,disabled:!!(0,Oo.isEqual)(p,o),icon:undo,onClick:()=>{"function"==typeof O?O():t(p)}})})]}),!g&&(0,_o.jsx)(yo.Button,{className:"kadence-radio-item radio-custom only-icon",label:F?(0,Mo.__)("Use size preset","kadence-blocks"):(0,Mo.__)("Set custom size","kadence-blocks"),icon:zc,isSmall:!0,onClick:()=>{if(F){const e=[vd(r,o?o[0]:"",f),vd(r,o?o[1]:"",f),vd(r,o?o[2]:"",f),vd(r,o?o[3]:"",f)];t(e)}else{const e=[gd(r,o?o[0]:"",f),gd(r,o?o[1]:"",f),gd(r,o?o[2]:"",f),gd(r,o?o[3]:"",f)];t(e)}V(!F)},isPressed:!!F,isTertiary:!F}),z&&(0,_o.jsx)(yo.Button,{isSmall:!0,className:"kadence-radio-item radio-custom is-single only-icon",label:"individual"!==B?(0,Mo.__)("Individual","kadence-blocks"):(0,Mo.__)("Linked","kadence-blocks"),icon:"individual"!==B?R.link:R.unlink,onClick:()=>z("individual"!==B?"individual":"linked"),isPressed:"individual"!==B,isTertiary:"individual"===B})]}),(0,_o.jsxs)("div",{className:"kadence-controls-content",children:["individual"!==B&&(0,_o.jsx)(_o.Fragment,{children:(0,_o.jsx)(hd,{value:o?o[0]:"",onChange:e=>t([e,e,e,e]),className:"kb-measure-input-all-inputs",min:l,max:i,options:r,step:s,help:u,unit:f,units:m,onUnit:b,defaultValue:p[0],placeholder:d?.[0]?d?.[0]:"",allowReset:!1,disableCustomSizes:!0,setCustomControl:V,customControl:F,isPopover:!1,isSingle:!0,onMouseOver:E,onMouseOut:M,allowAuto:T})}),"individual"===B&&(0,_o.jsxs)(_o.Fragment,{children:[(0,_o.jsx)(hd,{parentLabel:N||e,label:(0,Mo.__)("Top","kadence-blocks"),className:"kb-measure-box-top",value:o?o[0]:"",onChange:e=>{t([e,o&&void 0!==o[1]?o[1]:"",o&&void 0!==o[2]?o[2]:"",o&&void 0!==o[3]?o[3]:""])},min:l,max:i,options:r,step:s,help:u,unit:f,units:m,onUnit:b,defaultValue:p[0],placeholder:d?.[0]?d?.[0]:"",allowReset:!1,disableCustomSizes:!0,setCustomControl:V,customControl:F,isPopover:!0,onMouseOver:E,onMouseOut:M,allowAuto:T}),(0,_o.jsx)(hd,{parentLabel:N||e,label:(0,Mo.__)("Right","kadence-blocks"),className:"kb-measure-box-right",value:o?o[1]:"",onChange:e=>t([o&&void 0!==o[0]?o[0]:"",e,o&&void 0!==o[2]?o[2]:"",o&&void 0!==o[3]?o[3]:""]),min:l,max:i,options:r,step:s,help:u,unit:f,units:m,onUnit:b,defaultValue:p[1],placeholder:d?.[1]?d?.[1]:"",allowReset:!1,disableCustomSizes:!0,setCustomControl:V,customControl:F,isPopover:!0,onMouseOver:E,onMouseOut:M,allowAuto:T}),(0,_o.jsx)(hd,{parentLabel:N||e,label:(0,Mo.__)("Bottom","kadence-blocks"),className:"kb-measure-box-bottom",value:o?o[2]:"",onChange:e=>t([o&&void 0!==o[0]?o[0]:"",o&&void 0!==o[1]?o[1]:"",e,o&&void 0!==o[3]?o[3]:""]),min:l,max:i,options:r,step:s,help:u,unit:f,units:m,onUnit:b,defaultValue:p[2],placeholder:d?.[2]?d?.[2]:"",allowReset:!1,disableCustomSizes:!0,setCustomControl:V,customControl:F,isPopover:!0,onMouseOver:E,onMouseOut:M,allowAuto:T}),(0,_o.jsx)(hd,{parentLabel:N||e,label:(0,Mo.__)("Left","kadence-blocks"),className:"kb-measure-box-left",value:o?o[3]:"",onChange:e=>t([o&&void 0!==o[0]?o[0]:"",o&&void 0!==o[1]?o[1]:"",o&&void 0!==o[2]?o[2]:"",e]),min:l,max:i,options:r,step:s,help:u,unit:f,units:m,onUnit:b,defaultValue:p[3],placeholder:d?.[3]?d?.[3]:"",allowReset:!1,disableCustomSizes:!0,setCustomControl:V,customControl:F,isPopover:!0,onMouseOver:E,onMouseOut:M,allowAuto:T}),F&&(0,_o.jsx)("div",{className:"kadence-units kadence-measure-control-select-wrapper",children:(0,_o.jsx)("select",{className:"kadence-measure-control-select components-unit-control__select",onChange:e=>{b(e.target.value)},value:f,disabled:1===m.length,children:m.map(e=>(0,_o.jsx)("option",{value:e,selected:f===e||void 0,children:e},e))})})]})]})]})]}const kd=(0,_o.jsx)(Ho.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,_o.jsx)(Ho.Path,{d:"M18.3 11.7c-.6-.6-1.4-.9-2.3-.9H6.7l2.9-3.3-1.1-1-4.5 5L8.5 16l1-1-2.7-2.7H16c.5 0 .9.2 1.3.5 1 1 1 3.4 1 4.5v.3h1.5v-.2c0-1.5 0-4.3-1.5-5.7z"})});function yd({label:e,subLabel:t,onChange:n,onChangeTablet:o,onChangeMobile:a,mobileValue:r,tabletValue:s,value:i,onControl:l,control:c="individual",options:u=dd,step:d=1,max:p=100,min:h=0,unit:f="",onUnit:b,showUnit:m=!1,units:g=["px","em","rem"],isBorderRadius:v=!1,disableCustomSizes:x=!1,firstIcon:k=tu.outlineTopIcon,secondIcon:y=tu.outlineRightIcon,thirdIcon:_=tu.outlineBottomIcon,fourthIcon:w=tu.outlineLeftIcon,linkIcon:C=fd,unlinkIcon:j=bd,deskDefault:S=["","","",""],tabletDefault:N=["","","",""],mobileDefault:O=["","","",""],ghostDefault:E=["","","",""],reset:M=!0,setCustomControl:T=null,onMouseOver:R,onMouseOut:I,allowAuto:P=!1}){const L=(0,ko.useRef)(),A={first:v?topLeftIcon:k,second:v?topRightIcon:y,third:v?bottomRightIcon:_,fourth:v?bottomLeftIcon:w,link:v?radiusLinkedIcon:C,unlink:v?radiusIndividualIcon:j},[D,F]=(0,ko.useState)(!1),[V,B]=(0,ko.useState)(c),z=T?customControl:D,H=T||F,U=JSON.parse(JSON.stringify(u));U.push({value:"ss-auto",output:"var(--global-kb-spacing-auto, auto)",label:(0,Mo.__)("Auto","kadence-blocks"),size:0,name:(0,Mo.__)("Auto","kadence-blocks")});const G=e=>{let t=[];return t=z?[vd(u,e?e[0]:"",f),vd(u,e?e[1]:"",f),vd(u,e?e[2]:"",f),vd(u,e?e[3]:"",f)]:[gd(u,e?e[0]:"",f),gd(u,e?e[1]:"",f),gd(u,e?e[2]:"",f),gd(u,e?e[3]:"",f)],t},$=l?c:V,W=l||B,[q,X]=(0,ko.useState)("Desktop"),J=(0,To.useSelect)(e=>e("kadenceblocks/data").getPreviewDeviceType(),[]);J!==q&&X(J),(0,ko.useEffect)(()=>{let e=i;"Tablet"==J?e=s:"Mobile"==J&&(e=r),F(md(U,e))},[J]);const{setPreviewDeviceType:K}=(0,To.useDispatch)("kadenceblocks/data"),Y=[{name:"Desktop",title:(0,_o.jsx)(yo.Dashicon,{icon:"desktop"}),itemClass:"kb-desk-tab"},{name:"Tablet",title:(0,_o.jsx)(yo.Dashicon,{icon:"tablet"}),itemClass:"kb-tablet-tab"},{name:"Mobile",key:"mobile",title:(0,_o.jsx)(yo.Dashicon,{icon:"smartphone"}),itemClass:"kb-mobile-tab"}];let Z=i||["","","",""];"Tablet"===q?Z=s||["","","",""]:"Mobile"===q&&(Z=r||["","","",""]);let Q=s?JSON.parse(JSON.stringify(s)):["","","",""];Q?.[0]||(Q[0]=i?.[0]?i[0]:""),Q?.[1]||(Q[1]=i?.[1]?i[1]:""),Q?.[2]||(Q[2]=i?.[2]?i[2]:""),Q?.[3]||(Q[3]=i?.[3]?i[3]:"");const ee={};ee.Mobile=(0,_o.jsx)(xd,{className:"measure-mobile-size",parentLabel:e,label:t?(0,Mo.__)("Mobile:","kadence-blocks")+t:void 0,value:r||["","","",""],placeholder:Q,onChange:e=>a((0,No.clearNonMatchingValues)(r,e)),control:$,onControl:e=>W(e),setCustomControl:H,customControl:z,options:u,defaultValue:O,min:h,max:p,step:d,unit:f,onUnit:b||void 0,showUnit:!0,units:[f],isBorderRadius:v,firstIcon:k,secondIcon:y,thirdIcon:_,fourthIcon:w,linkIcon:C,unlinkIcon:j,onMouseOver:R,onMouseOut:I,allowAuto:P},2),ee.Tablet=(0,_o.jsx)(xd,{className:"measure-tablet-size",parentLabel:e,label:t?(0,Mo.__)("Tablet:","kadence-blocks")+t:void 0,value:s||["","","",""],placeholder:i||["","","",""],onChange:e=>o((0,No.clearNonMatchingValues)(s,e)),control:$,onControl:e=>W(e),setCustomControl:H,customControl:z,options:u,defaultValue:N,min:h,max:p,step:d,unit:f,onUnit:b||void 0,showUnit:!0,units:[f],isBorderRadius:v,firstIcon:k,secondIcon:y,thirdIcon:_,fourthIcon:w,linkIcon:C,unlinkIcon:j,onMouseOver:R,onMouseOut:I,allowAuto:P},1),ee.Desktop=(0,_o.jsx)(xd,{className:"measure-desktop-size",parentLabel:e,label:t||void 0,value:i||["","","",""],placeholder:E||["","","",""],onChange:e=>n((0,No.clearNonMatchingValues)(i,e)),control:$,onControl:e=>W(e),setCustomControl:H,customControl:z,options:u,defaultValue:S,min:h,max:p,step:d,unit:f,onUnit:b||void 0,showUnit:m,units:g,isBorderRadius:v,firstIcon:k,secondIcon:y,thirdIcon:_,fourthIcon:w,linkIcon:C,unlinkIcon:j,onMouseOver:R,onMouseOut:I,allowAuto:P},0);let te=S;return"Mobile"===q?te=O:"Mobile"===q&&(te=N),[n&&o&&a&&(0,_o.jsxs)("div",{ref:L,className:"components-base-control kb-responsive-measure-control kadence-measure-range-control",children:[(0,_o.jsxs)(yo.Flex,{justify:"space-between",className:"kadence-title-bar kadence-component__header kadence-measure-range__header kadence-radio-range__header",children:[e&&(0,_o.jsxs)("div",{className:"kadence-component__header__title kadence-radio-range__title",children:[(0,_o.jsx)("label",{className:"components-base-control__label",children:e}),!0===M&&("linked"!==$||"linked"===$&&!0===z)&&(0,_o.jsx)("div",{className:"title-reset-wrap",children:(0,_o.jsx)(yo.Button,{className:"is-reset is-single",label:"reset",isSmall:!0,disabled:!!(0,Oo.isEqual)(te,Z),icon:kd,onClick:()=>{"Tablet"===q?o(N):"Mobile"===q?a(O):n(S)}})})]}),(0,_o.jsx)(yo.ButtonGroup,{className:"kb-responsive-options kb-measure-responsive-options","aria-label":(0,Mo.__)("Device","kadence-blocks"),children:(0,Oo.map)(Y,({name:e,key:t,title:n,itemClass:o})=>(0,_o.jsx)(yo.Button,{className:`kb-responsive-btn ${o}${e===q?" is-active":""}`,isSmall:!0,"aria-pressed":q===e,onClick:()=>{return t=e,K((0,No.capitalizeFirstLetter)(t)),void X((0,No.capitalizeFirstLetter)(t));var t},children:n},t))}),!x&&!t&&(0,_o.jsx)(yo.Button,{className:"kadence-radio-item radio-custom only-icon",label:z?(0,Mo.__)("Use size preset","kadence-blocks"):(0,Mo.__)("Set custom size","kadence-blocks"),icon:zc,isSmall:!0,onClick:()=>{(()=>{if("Mobile"==q){const e=G(r);(0,No.objectSameFill)(r,e)&&a(e)}else if("Tablet"==q){const e=G(s);(0,No.objectSameFill)(s,e)&&o(e)}else{const e=G(i);(0,No.objectSameFill)(i,e)&&n(e)}})(),H(!z)},isPressed:!!z,isTertiary:!z}),W&&!t&&(0,_o.jsx)(yo.Button,{isSmall:!0,className:"kadence-radio-item radio-custom is-single only-icon",label:"individual"!==$?(0,Mo.__)("Individual","kadence-blocks"):(0,Mo.__)("Linked","kadence-blocks"),icon:"individual"!==$?A.link:A.unlink,onClick:()=>W("individual"!==$?"individual":"linked"),isPressed:"individual"!==$,isTertiary:"individual"===$})]}),(0,_o.jsx)("div",{className:"kb-responsive-measure-control-inner",children:ee[q]?ee[q]:ee.Desktop})]})]}const _d=window.wp.isShallowEqual;function wd({style:e,type:t="inside",spacing:n,forceShow:o=!1,forceHide:a=!1,offset:r=!0}){const s=n[0],i=n[1],l=n[2],c=n[3],u=(0,ko.useMemo)(()=>{if("outside"===t){const e=s||0,t=i||0,n=l||0,o=c||0;return{borderTopWidth:e,borderRightWidth:t,borderBottomWidth:n,borderLeftWidth:o,top:r&&e?`calc(${e} * -1)`:0,right:r&&t?`calc(${t} * -1)`:0,bottom:r&&n?`calc(${n} * -1)`:0,left:r&&o?`calc(${o} * -1)`:0}}if("outsideVertical"===t){const e=s||0,t=l||0;return{borderTopWidth:e,borderRightWidth:i||0,borderBottomWidth:t,borderLeftWidth:c||0,top:r&&e?`calc(${e} * -1)`:0,bottom:r&&t?`calc(${t} * -1)`:0}}return{borderTopWidth:s||0,borderRightWidth:i||0,borderBottomWidth:l||0,borderLeftWidth:c||0,marginLeft:e?.marginLeft?e.marginLeft:0,marginRight:e?.marginRight?e.marginRight:0}},[n]),[d,p]=(0,ko.useState)(!1),h=(0,ko.useRef)(n),f=(0,ko.useRef)(),b=()=>{f.current&&window.clearTimeout(f.current)};return(0,ko.useMemo)(()=>(a&&(h.current=n),(0,_d.isShallowEqualArrays)(n,h.current)||o||a||(p(!0),h.current=n,b(),f.current=setTimeout(()=>{p(!1)},400)),()=>b()),[n,o,a]),!d&&!o||a?null:(0,_o.jsx)("div",{className:`kb__spacing-visualizer-wrap kb__spacing_visualizer-type-${t}`,style:e,children:(0,_o.jsx)("div",{className:"kb__spacing-visualizer",style:u})})}function Cd({label:e,className:t,hideLabel:n=!1,wrap:o=!1,allowClear:a=!1,help:r="",onChange:s,onChangeTablet:i,onChangeMobile:l,value:c,mobileValue:u,tabletValue:d,options:p=[],tabletOptions:h=p,mobileOptions:f=h,...b}){return(0,_o.jsx)(Lo,{label:e,desktopChildren:(0,_o.jsx)(wc,{className:t,value:c,options:p,onChange:s,hideLabel:n,help:r,wrap:o,allowClear:a}),tabletChildren:(0,_o.jsx)(wc,{className:t,value:d,options:h,onChange:i,hideLabel:n,help:r,wrap:o,allowClear:!0}),mobileChildren:(0,_o.jsx)(wc,{className:t,value:u,options:f,onChange:l,hideLabel:n,help:r,wrap:o,allowClear:!0})})}function jd({value:e,isPressed:t=!1}){const n={top:"M19.5 19.5H.5V.5h19v19zM1.607 18.392h16.786V1.608H1.607v16.784zM17.178 2.888H2.822v3.275h14.356V2.888z",middle:"M19.5 19.482H.5V.5h19v18.982zM1.607 18.375h16.786V1.607H1.607v16.768zm15.571-10.02H2.822v3.272h14.356V8.355z",bottom:"M19.518 19.5H.5V.5h19.018v19zm-17.91-1.108H18.41V1.608H1.608v16.784zm15.586-4.739H2.824v3.275h14.37v-3.275z"};return n.hasOwnProperty(e)?(0,_o.jsx)(yo.SVG,{width:"20",height:"20",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",isPressed:t,children:(0,_o.jsx)(yo.Path,{d:n[e]})}):null}const Sd=["image"];class Nd extends ko.Component{constructor(){super(...arguments)}render(){const{label:e,hasImage:t,onSaveImage:n,onRemoveImage:o,disableMediaButtons:a,imageURL:r,imageID:s,kadenceDynamic:i,dynamicAttribute:l=""}=this.props;return(0,_o.jsxs)("div",{className:"kadence-image-media-control kadence-image-background-control",children:[!t&&(0,_o.jsxs)(ko.Fragment,{children:[e&&(0,_o.jsx)("div",{className:"components-kadence-image-background__label",children:e}),(0,_o.jsx)(qc,{labels:"",selectIcon:Kc,selectLabel:(0,Mo.__)("Select Image","kadence-blocks"),onSelect:e=>n(e),accept:"image/*",className:"kadence-image-upload",allowedTypes:Sd,disableMediaButtons:a,dynamicControl:l&&kadence_blocks_params.dynamic_enabled?(0,_o.jsx)(Oc,{...this.props}):void 0})]}),t&&(0,_o.jsxs)(ko.Fragment,{children:[e&&(0,_o.jsx)("div",{className:"components-kadence-image-background__label",children:e}),l&&kadence_blocks_params.dynamic_enabled&&i&&i[l]&&i[l].enable?(0,_o.jsx)("div",{className:"kb-dynamic-background-sidebar-top",children:(0,_o.jsx)(Oc,{startOpen:!i[l].field,...this.props})}):(0,_o.jsxs)(ko.Fragment,{children:[(0,_o.jsx)(Eo.MediaUpload,{onSelect:e=>n(e),type:"image",value:s||"",render:({open:e})=>(0,_o.jsx)(yo.Button,{className:"components-button components-icon-button kt-cta-upload-btn kb-sidebar-image",style:{backgroundImage:'url("'+r+'")',backgroundSize:"cover"},onClick:e,icon:Yc,children:(0,Mo.__)("Edit Image","kadence-blocks")})}),(0,_o.jsx)(yo.Button,{icon:Zc,label:(0,Mo.__)("Remove Image","kadence-blocks"),className:"components-button components-icon-button kt-remove-img kt-cta-upload-btn",onClick:()=>o()}),l&&kadence_blocks_params.dynamic_enabled&&(0,_o.jsx)(Oc,{...this.props})]})]})]})}}const Od=Nd,Ed=["video"];class Md extends ko.Component{constructor(){super(...arguments)}render(){const{label:e,hasVideo:t,onSaveVideo:n,onRemoveVideo:o,disableMediaButtons:a,videoURL:r,videoID:s}=this.props;return(0,_o.jsxs)("div",{className:"components-base-control kadence-image-media-control kadence-image-background-control kadence-video-background-control",children:[!t&&(0,_o.jsxs)(ko.Fragment,{children:[e&&(0,_o.jsx)("div",{className:"components-kadence-video-background__label",children:e}),(0,_o.jsx)(qc,{labels:"",selectIcon:Kc,selectLabel:(0,Mo.__)("Select Video","kadence-blocks"),onSelect:e=>n(e),accept:"video/*",className:"kadence-image-upload",allowedTypes:Ed,disableMediaButtons:a})]}),t&&(0,_o.jsxs)(ko.Fragment,{children:[e&&(0,_o.jsx)("div",{className:"components-kadence-video-background__label",children:e}),(0,_o.jsxs)("div",{className:"components-kadence-video-btns",children:[(0,_o.jsx)(Eo.MediaUpload,{onSelect:e=>n(e),type:"video",value:s||"",render:({open:e})=>(0,_o.jsx)(yo.Button,{className:"components-button components-icon-button kb-cta-upload-btn kb-video-edit",onClick:e,icon:tu.video,children:(0,Mo.__)("Edit Video","kadence-blocks")})}),(0,_o.jsx)(yo.Button,{icon:Zc,label:(0,Mo.__)("Remove Image","kadence-blocks"),className:"components-button components-icon-button kb-remove-video kb-cta-upload-btn",onClick:()=>o()})]})]})]})}}const Td=Md;function Rd({label:e,className:t,children:n}){return(0,_o.jsxs)("div",{className:"components-base-control kadence-subsection-wrap"+(t?" "+t:""),children:[e&&(0,_o.jsx)("h2",{className:"subsection-wrap-title",children:e}),(0,_o.jsx)("div",{className:"kt-inner-subsection",children:n})]})}const Id=(0,_c.compose)([(0,To.withSelect)((e,t)=>{const n=void 0===t.initialOpen||t.initialOpen,o=(0,Oo.get)(t,["index"],"");return{isOpened:e("kadenceblocks/data").isEditorPanelOpened(t.panelName+o+e("core/block-editor").getSelectedBlockClientId(),n)}}),(0,To.withDispatch)((e,t,{select:n})=>{const{getSelectedBlockClientId:o}=n("core/block-editor"),a=void 0===t.initialOpen||t.initialOpen,r=(0,Oo.get)(t,["index"],"");return{toggleOpened:()=>{e("kadenceblocks/data").toggleEditorPanelOpened(t.panelName+r+o(),a)}}})])(function({children:e,title:t,initialOpen:n=!0,isOpened:o,toggleOpened:a,className:r="",icon:s="",buttonProps:i={},blockSlug:l=!1,index:c=!1,proTag:u=!1,panelName:d}){return!1===l||(0,No.showSettings)(d,l)?(u&&(i.icon=tu.proIcon,i.iconPosition="right"),(0,_o.jsx)(yo.PanelBody,{title:t,initialOpen:n,onToggle:a,opened:o,className:r,icon:s,buttonProps:i,children:e})):null});function Pd({children:e,title:t}){return(0,_o.jsxs)("div",{className:"kb-sub-panel",children:[t&&(0,_o.jsx)("h2",{className:"kb-sub-panel-title",children:t}),(0,_o.jsx)("div",{className:"kb-inner-sub-panel",children:e})]})}const Ld=function({children:e,blockSlug:t=!1,settingSlug:n="allSettings"}){return!1===t||(0,No.showSettings)(n,t)?(0,_o.jsx)(Eo.InspectorControls,{children:e}):null};class Ad extends ko.Component{constructor(){super(...arguments),this.state={options:[],isLoading:!1,page:1,hasMore:!1}}componentDidMount(){this.fetchPostAbortController=new AbortController,this.fetchTerms()}componentWillUnmount(){this.fetchPostAbortController&&this.fetchPostAbortController.abort()}fetchTerms(){const{restBase:e}=this.props,{page:t,options:n,search:o}=this.state,a={page:t,per_page:10};o&&o.length>=3&&(a.search=o),this.setState({isLoading:!0}),(0,No.fetchJson)({path:(0,hc.addQueryArgs)(`${e}/`,a),signal:this.fetchPostAbortController.signal}).then(([e,o])=>{const a=(0,Oo.uniqBy)([...n,...e.map(e=>({value:e.id,label:e.name}))],"value");this.setState({options:a,hasMore:parseInt(o["x-wp-totalpages"],10)>t,isLoading:!1})})}fetchMoreTerms(){const{page:e,hasMore:t,isLoading:n}=this.state;t&&!n&&this.setState({page:e+1},()=>this.fetchTerms())}updateSearch(e){e.length>=3&&this.setState({search:e,page:1},()=>this.fetchTerms())}handleChange(e){const{onChange:t}=this.props;this.setState({search:null,page:1}),t(e)}render(){return(0,_o.jsxs)("div",{className:"term-select-form-row",children:[(0,_o.jsx)("label",{htmlFor:this.props.fieldId,className:"screen-reader-text",children:this.props.placeholder}),(0,_o.jsx)(pc,{value:this.props.value,onChange:e=>this.handleChange(e),id:this.props.fieldId,options:this.state.options,isMulti:!0,classNamePrefix:"kt-tax-select",isLoading:this.state.isLoading,onMenuScrollToBottom:()=>this.fetchMoreTerms(),onInputChange:e=>this.updateSearch(e),maxMenuHeight:300,placeholder:this.props.placeholder})]})}}Ad.propTypes={fieldId:S().string.isRequired,label:S().string.isRequired,restBase:S().string.isRequired,onChange:S().func.isRequired};const Dd=Ad,Fd=window.wp.apiFetch;var Vd=a.n(Fd);function Bd({value:e,onChange:t,source:n,isMulti:o=!1}){const[a,r]=(0,ko.useState)(!0),[s,i]=(0,ko.useState)([]),[l,c]=(0,ko.useState)(1),[u,d]=(0,ko.useState)(!1),p=e;return(0,ko.useEffect)(()=>{if(n&&void 0!==window.kadence_blocks_params.taxonomies[n]&&window.kadence_blocks_params.taxonomies[n])i(Array.from(window.kadence_blocks_params.taxonomies[n])),r(!1);else{const e={source:n,page:l,per_page:50};r(!0),Vd()({path:(0,hc.addQueryArgs)(window.kadence_blocks_params.termEndpoint,e)}).then(e=>{e?(i(e),window.kadence_blocks_params.taxonomies[n]=e):(i([]),window.kadence_blocks_params.taxonomies[n]=[]),r(!1)}).catch(()=>{r(!1),i([]),window.kadence_blocks_params.taxonomies[n]=[]})}},[n]),a?(0,_o.jsx)(yo.Spinner,{}):(0,_o.jsx)("div",{className:"kb-inner-term-select-wrap",children:(0,_o.jsx)(pc,{options:s,className:"kb-dynamic-select",classNamePrefix:"kbp",value:o?e:""!==e?s.filter(({value:e})=>e===p):"",isMulti:o,isSearchable:!0,isClearable:!0,menuPortalTarget:document.body,styles:{menuPortal:e=>({...e,zIndex:99999999})},maxMenuHeight:200,placeholder:(0,Mo.__)("Select Term","kadence-blocks"),onChange:e=>{t(e?o?e:e.value:"")}})})}function zd({desktopChildren:e,tabletChildren:t,mobileChildren:n}){const[o,a]=(0,ko.useState)("Desktop"),r=(0,To.useSelect)(e=>e("kadenceblocks/data").getPreviewDeviceType(),[]);r!==o&&a(r);const{setPreviewDeviceType:s}=(0,To.useDispatch)("kadenceblocks/data"),i=[{name:"Desktop",key:"desktop",label:(0,Mo.__)("Desktop","kadence-blocks"),title:(0,_o.jsx)(yo.Dashicon,{icon:"desktop"}),itemClass:"kb-desk-tab"},{name:"Tablet",key:"tablet",label:(0,Mo.__)("Tablet","kadence-blocks"),title:(0,_o.jsx)(yo.Dashicon,{icon:"tablet"}),itemClass:"kb-tablet-tab"},{name:"Mobile",key:"mobile",label:(0,Mo.__)("Mobile","kadence-blocks"),title:(0,_o.jsx)(yo.Dashicon,{icon:"smartphone"}),itemClass:"kb-mobile-tab"}],l={};return l.Mobile=n,l.Tablet=t,l.Desktop=e,(0,_o.jsxs)("div",{className:"components-base-control kt-inspect-tabs kb-responsive-control",children:[(0,_o.jsx)("div",{className:"kadence-title-bar",children:(0,_o.jsx)(yo.ButtonGroup,{className:"components-tab-panel__tabs","aria-label":(0,Mo.__)("Device","kadence-blocks"),children:(0,Oo.map)(i,({name:e,key:t,title:n,itemClass:r,label:i})=>(0,_o.jsx)(yo.Button,{className:`components-tab-panel__tabs-item ${r}${e===o?" active-tab":""}`,"aria-pressed":o===e,"aria-label":i,onClick:()=>{return t=e,s((0,No.capitalizeFirstLetter)(t)),void a((0,No.capitalizeFirstLetter)(t));var t},children:n},t))})}),(0,_o.jsx)("div",{className:"kb-responsive-control-inner",children:l[o]?l[o]:l.Desktop})]})}function Hd({label:e,onChange:t,onChangeTablet:n,onChangeMobile:o,value:a,mobileValue:r,tabletValue:s,options:i,tabletOptions:l=i,mobileOptions:c=l,help:u}){return(0,_o.jsx)(Lo,{label:e,desktopChildren:(0,_o.jsx)(yo.SelectControl,{value:a,options:i,onChange:e=>t(e),help:u}),tabletChildren:(0,_o.jsx)(yo.SelectControl,{value:s,options:l,onChange:e=>n(e),help:u}),mobileChildren:(0,_o.jsx)(yo.SelectControl,{value:r,options:c,onChange:e=>o(e),help:u})})}const Ud=(0,_o.jsx)(Ho.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,_o.jsx)(Ho.Path,{d:"m13.1 16-3.4-4 3.4-4 1.1 1-2.6 3 2.6 3-1.1 1z"})}),Gd=(0,_o.jsx)(Ho.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,_o.jsx)(Ho.Path,{d:"M10.8622 8.04053L14.2805 12.0286L10.8622 16.0167L9.72327 15.0405L12.3049 12.0286L9.72327 9.01672L10.8622 8.04053Z"})});function $d({label:e,value:t,onChange:n,min:o,max:a,step:r=1}){return[n&&(0,_o.jsxs)("div",{className:"components-base-control",children:[(0,_o.jsx)("p",{className:"components-base-control__label",children:e}),(0,_o.jsxs)("div",{className:"components-base-control__field kb-flex-center kb-step-control",children:[(0,_o.jsx)(yo.Button,{className:"kb-step-btn",icon:Ud,isSecondary:!0,onClick:()=>{t>o&&n(t-r)}}),(0,_o.jsx)("input",{className:"components-step-control__number",type:"number",onChange:e=>n(Number(e.target.value)),"aria-label":e,value:t,min:o,max:a,step:r}),(0,_o.jsx)(yo.Button,{className:"kb-step-btn",isSecondary:!0,icon:Gd,onClick:()=>{t<a&&n(t+r)}})]})]})]}class Wd extends ko.Component{constructor(e,t,n){super(...arguments),this.state={isVisible:!1}}render(){const e=()=>{this.setState({isVisible:!1})};let t={};return t.opacity=(0,_o.jsxs)("svg",{width:"20px",height:"20px",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",fillRule:"evenodd",clipRule:"evenodd",strokeLinejoin:"round",strokeMiterlimit:"1.414",children:[(0,_o.jsxs)("g",{fillRule:"nonzero",children:[(0,_o.jsx)("path",{d:"M14.043,7.612c2.23,2.178 2.23,5.726 0,7.904c-1.081,1.055 -2.515,1.638 -4.042,1.638c-1.527,0 -2.964,-0.583 -4.042,-1.638c-1.08,-1.056 -1.674,-2.46 -1.674,-3.952c0,-1.492 0.594,-2.896 1.676,-3.956l4.04,-4.026l4.038,4.026c0.002,0.002 0.004,0.002 0.004,0.004Z",fill:"url(#_Linear1)"}),(0,_o.jsx)("path",{d:"M15.595,6.066c3.082,3.013 3.082,7.917 -0.002,10.931c-1.493,1.461 -3.479,2.265 -5.591,2.265c-2.112,0 -4.097,-0.804 -5.593,-2.265c-1.493,-1.46 -2.315,-3.402 -2.315,-5.467c0,-2.065 0.822,-4.007 2.315,-5.466l5.176,-5.162c0.221,-0.219 0.614,-0.219 0.833,0l5.177,5.164Zm-0.826,10.124c2.629,-2.568 2.629,-6.751 0,-9.32c0,-0.002 -0.003,-0.002 -0.005,-0.004l-4.762,-4.749l-4.764,4.749c-1.276,1.249 -1.976,2.905 -1.976,4.664c0,1.76 0.7,3.416 1.974,4.66c1.272,1.245 2.966,1.932 4.766,1.932c1.801,0 3.493,-0.687 4.767,-1.932Z"})]}),(0,_o.jsx)("defs",{children:(0,_o.jsxs)("linearGradient",{id:"_Linear1",x2:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"matrix(11.4305 0 0 13.5721 4.285 10.368)",children:[(0,_o.jsx)("stop",{offset:"0"}),(0,_o.jsx)("stop",{offset:"0.5",stopOpacity:"0.749"}),(0,_o.jsx)("stop",{offset:"1",stopOpacity:"0"})]})})]}),(0,_o.jsxs)("div",{className:"kt-popover-container",children:[this.state.isVisible&&(0,_o.jsx)(yo.Popover,{position:"top left",className:"kt-popover-opacity",onClose:e,children:(0,_o.jsx)(yo.RangeControl,{label:this.props.label,value:this.props.value,onChange:this.props.onChanged,min:0,max:1,step:.01})}),(0,_o.jsxs)(yo.Tooltip,{text:this.props.label,children:[!this.state.isVisible&&(0,_o.jsx)(yo.Button,{className:"kt-opacity-icon",isSecondary:!0,onClick:()=>{this.setState({isVisible:!0})},children:t.opacity}),this.state.isVisible&&(0,_o.jsx)(yo.Button,{className:"kt-opacity-icon",isSecondary:!0,onClick:e,children:t.opacity})]})]})}}const qd=Wd;function Xd({label:e,onChange:t,value:n="",className:o="",step:a=1,max:r=200,min:s=0,unit:i="px",onUnit:l,units:c=["px","em","rem"],styles:u=["solid","dashed","dotted","double"],defaultLinked:d=!0}){const p=(0,_c.useInstanceId)(Xd),h=n?.[1]||"solid",f=e=>{const o=n;o[0]=e,t(o)},b=n?.[0]||"",m=void 0!==n?.[2]&&""!==n?.[2]?n[2]:"",g={solid:(0,_o.jsx)("svg",{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",fillRule:"evenodd",strokeLinejoin:"round",strokeMiterlimit:"2",clipRule:"evenodd",viewBox:"0 0 20 20",children:(0,_o.jsx)("path",{d:"M18.988 11.478V8.522H1.012v2.956h17.976z"})}),dashed:(0,_o.jsx)("svg",{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",fillRule:"evenodd",strokeLinejoin:"round",strokeMiterlimit:"2",clipRule:"evenodd",viewBox:"0 0 20 20",children:(0,_o.jsx)("path",{d:"M12.512 11.478V8.522H7.488v2.956h5.024zM14.004 8.522v2.956h4.984V8.522h-4.984zM1.012 8.522v2.956H6.05V8.522H1.012z"})}),dotted:(0,_o.jsxs)("svg",{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",fillRule:"evenodd",strokeLinejoin:"round",strokeMiterlimit:"2",clipRule:"evenodd",viewBox:"0 0 20 20",children:[(0,_o.jsx)("circle",{cx:"2.503",cy:"10",r:"1.487"}),(0,_o.jsx)("circle",{cx:"17.486",cy:"10",r:"1.487"}),(0,_o.jsx)("circle",{cx:"12.447",cy:"10",r:"1.487"}),(0,_o.jsx)("circle",{cx:"7.455",cy:"10",r:"1.487"})]}),double:(0,_o.jsx)("svg",{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",fillRule:"evenodd",strokeLinejoin:"round",strokeMiterlimit:"2",clipRule:"evenodd",viewBox:"0 0 20 20",children:(0,_o.jsx)("path",{d:"M1.02 6.561v2.957h17.968V6.561H1.02zM1.012 10.586v2.956H18.98v-2.956H1.012z"})})},v={solid:(0,Mo.__)("Solid","kadence-blocks"),dashed:(0,Mo.__)("Dashed","kadence-blocks"),dotted:(0,Mo.__)("Dotted","kadence-blocks"),double:(0,Mo.__)("Double","kadence-blocks")},x=c.map(e=>({value:e,label:e}));return[t&&(0,_o.jsxs)("div",{className:`components-base-control kadence-single-border-control kadence-single-border-control${p}${o?" "+o:""}`,children:[e&&(0,_o.jsx)(yo.Flex,{justify:"space-between",className:"kadence-border-control__header",children:(0,_o.jsx)(yo.FlexItem,{children:(0,_o.jsx)("label",{className:"components-base-control__label",children:e})})}),(0,_o.jsxs)("div",{className:"kadence-single-border-control-wrap",children:[(0,_o.jsx)(Po,{value:b,default:"",hideClear:!0,onChange:e=>f(e)},`border-color-${b}-${p}`),(0,_o.jsx)(yo.DropdownMenu,{className:"border-control-style-select",icon:g[h],label:(0,Mo.__)("Border Style","kadence-blocks"),popoverProps:{className:"border-control-style-select__popover",placement:"bottom"},children:({onClose:e})=>(0,_o.jsx)(_o.Fragment,{children:(0,_o.jsx)(yo.MenuGroup,{children:u.map(o=>(0,_o.jsx)(yo.MenuItem,{icon:g[o],onClick:()=>{e(),(e=>{const o=n;o[1]=e,t(o)})(o)},label:v[o]}))})})}),(0,_o.jsxs)("div",{className:"kadence-controls-content kadence-single-unit-control",children:[(0,_o.jsx)(yo.__experimentalUnitControl,{min:s,max:r,step:a,units:x,value:m,disableUnits:!0,onChange:e=>(e=>{const o=isNaN(parseFloat(e))?"":parseFloat(e),a=n;a[2]=o,t(a)})(e)}),(0,_o.jsx)("div",{className:"kadence-measure-control-select-wrapper",children:(0,_o.jsx)("select",{className:"kadence-measure-control-select components-unit-control__select",onChange:e=>{l(e.target.value)},disabled:1===c.length,children:c.map(e=>(0,_o.jsx)("option",{value:e,selected:i===e||void 0,children:e},e))})})]})]})]})]}function Jd({label:e,onChange:t,onChangeTablet:n,onChangeMobile:o,onControl:a,value:r="",tabletValue:s="",mobileValue:i="",control:l="individual",units:c=["px","em","rem"],firstIcon:u=tu.outlineTopIcon,secondIcon:d=tu.outlineRightIcon,thirdIcon:p=tu.outlineBottomIcon,fourthIcon:h=tu.outlineLeftIcon,linkIcon:f=fd,unlinkIcon:b=bd,styles:m=["solid","dashed","dotted","double"],deskDefault:g={top:["","",""],right:["","",""],bottom:["","",""],left:["","",""],unit:"px"},tabletDefault:v={top:["","",""],right:["","",""],bottom:["","",""],left:["","",""],unit:""},mobileDefault:x={top:["","",""],right:["","",""],bottom:["","",""],left:["","",""],unit:""},reset:k=!0,defaultLinked:y=!0}){const _=(0,_c.useInstanceId)(Jd),w=r?.[0]||g,C=s?.[0]||v,j=i?.[0]||x,[S,N]=(0,ko.useState)(l),[O,E]=(0,ko.useState)("Desktop"),M=(0,To.useSelect)(e=>e("kadenceblocks/data").getPreviewDeviceType(),[]);M!==O&&E(M),(0,ko.useEffect)(()=>{j&&(0,Oo.isEqual)(w.unit,j?.unit)&&(j.unit="",V("","unit")),C&&(0,Oo.isEqual)(w.unit,C?.unit)&&(C.unit="",F("","unit"))},[]);const{setPreviewDeviceType:T}=(0,To.useDispatch)("kadenceblocks/data"),R=[{name:"Desktop",title:(0,_o.jsx)(yo.Dashicon,{icon:"desktop"}),itemClass:"kb-desk-tab"},{name:"Tablet",title:(0,_o.jsx)(yo.Dashicon,{icon:"tablet"}),itemClass:"kb-tablet-tab"},{name:"Mobile",key:"mobile",title:(0,_o.jsx)(yo.Dashicon,{icon:"smartphone"}),itemClass:"kb-mobile-tab"}];let I=w;"Tablet"===O?I=C:"Mobile"===O&&(I=j);const P={},L=j?.unit?j.unit:w?.unit?w.unit:"px",A=C?.unit?C.unit:w?.unit?w.unit:"px",D=(e,n)=>{var o=JSON.parse(JSON.stringify(r));o[0][n]=e,t(o)},F=(e,t)=>{var o=JSON.parse(JSON.stringify(s));o[0][t]=e,n(o)},V=(e,t)=>{var n=JSON.parse(JSON.stringify(i));n[0][t]=e,o(n)};P.Mobile=(0,_o.jsx)(Xd,{value:j?.bottom?JSON.parse(JSON.stringify(j?.bottom)):void 0,unit:j?.unit?JSON.parse(JSON.stringify(j?.unit)):"px",onChange:e=>V(e,"bottom"),onUnit:e=>V(e,"unit"),defaultValue:x?.bottom,styles:m,units:[L],firstIcon:u,secondIcon:d,thirdIcon:p,fourthIcon:h},"mobile"+_),P.Tablet=(0,_o.jsx)(Xd,{value:C?.bottom?JSON.parse(JSON.stringify(C?.bottom)):void 0,unit:C?.unit?JSON.parse(JSON.stringify(C?.unit)):"px",onChange:e=>F(e,"bottom"),onUnit:e=>F(e,"unit"),defaultValue:v?.bottom,styles:m,units:[A],firstIcon:u,secondIcon:d,thirdIcon:p,fourthIcon:h},"tablet"+_),P.Desktop=(0,_o.jsx)(Xd,{value:w?.bottom?JSON.parse(JSON.stringify(w?.bottom)):void 0,unit:w?.unit?JSON.parse(JSON.stringify(w?.unit)):"px",onChange:e=>D(e,"bottom"),onUnit:e=>D(e,"unit"),defaultValue:g?.bottom,styles:m,units:c,firstIcon:u,secondIcon:d,thirdIcon:p,fourthIcon:h},"desktop"+_);let B=g;return"Mobile"===O?B=x:"Mobile"===O&&(B=v),[t&&n&&o&&(0,_o.jsxs)("div",{className:`components-base-control kb-responsive-border-control kadence-border-box-control kadence-border-box-control${_}`,children:[(0,_o.jsxs)("div",{className:"kadence-border-control__header kadence-component__header",children:[e&&(0,_o.jsxs)("div",{className:"kadence-component__header__title kadence-radio-range__title",children:[(0,_o.jsx)("label",{className:"components-base-control__label",children:e}),k&&(0,_o.jsx)("div",{className:"title-reset-wrap",children:(0,_o.jsx)(yo.Button,{className:"is-reset is-single",label:"reset",isSmall:!0,disabled:!!(0,Oo.isEqual)(B,I),icon:kd,onClick:()=>{"Tablet"===O?n([v]):"Mobile"===O?o([x]):t([g])}})})]}),(0,_o.jsx)(yo.ButtonGroup,{className:"kb-responsive-options kb-measure-responsive-options","aria-label":(0,Mo.__)("Device","kadence-blocks"),children:(0,Oo.map)(R,({name:e,key:t,title:n,itemClass:o})=>(0,_o.jsx)(yo.Button,{className:`kb-responsive-btn ${o}${e===O?" is-active":""}`,isSmall:!0,"aria-pressed":O===e,onClick:()=>{return t=e,T((0,No.capitalizeFirstLetter)(t)),void E((0,No.capitalizeFirstLetter)(t));var t},children:n},t))})]}),(0,_o.jsx)("div",{className:"kb-responsive-border-control-inner",children:P[O]?P[O]:P.Desktop})]})]}function Kd({label:e,onChange:t,onControl:n,value:o="",className:a="",help:r="",defaultValue:s={top:{color:"",style:"solid",width:""},right:{color:"",style:"solid",width:""},bottom:{color:"",style:"solid",width:""},left:{color:"",style:"solid",width:""},unit:""},control:i="individual",units:l=["px","em","rem"],firstIcon:c=tu.outlineTopIcon,secondIcon:u=tu.outlineRightIcon,thirdIcon:d=tu.outlineBottomIcon,fourthIcon:p=tu.outlineLeftIcon,linkIcon:h=fd,unlinkIcon:f=bd,styles:b=["solid","dashed","dotted","double"],reset:m}){const g=(0,_c.useInstanceId)(Kd),[v,x]=(0,ko.useState)(i),k=n?i:v,y=n||x,_={first:c,second:u,third:d,fourth:p,link:h,unlink:f},w=(0,ko.useRef)(),C=o?.[0]||s,j="px"!==C.unit?.1:1,S="px"!==C.unit&&""!==C.unit?12:200,N=(e,n)=>{C[n]=e;const o=JSON.parse(JSON.stringify(C));t([o])},O=e=>{C.unit=e;const n=JSON.parse(JSON.stringify(C));t([n])};return[t&&(0,_o.jsxs)("div",{ref:w,className:`components-base-control kadence-border-control kadence-border-control${g}${a?" "+a:""}`,children:[e&&(0,_o.jsxs)("div",{className:"kadence-border-control__header",children:[e&&(0,_o.jsxs)("div",{className:"kadence-border-control__title",children:[(0,_o.jsx)("label",{className:"components-base-control__label",children:e}),m&&(0,_o.jsx)("div",{className:"title-reset-wrap",children:(0,_o.jsx)(yo.Button,{className:"is-reset is-single",label:"reset",isSmall:!0,disabled:!!(0,Oo.isEqual)(s,o),icon:undo,onClick:()=>{"function"==typeof m?m():t([s])}})})]}),y&&(0,_o.jsx)(yo.Button,{className:"kadence-radio-item border-control-toggle is-single only-icon",label:"individual"!==k?(0,Mo.__)("Individual","kadence-blocks"):(0,Mo.__)("Linked","kadence-blocks"),icon:"individual"!==k?_.link:_.unlink,onClick:()=>y("individual"!==k?"individual":"linked"),isPressed:"individual"!==k,isTertiary:"individual"===k})]}),(0,_o.jsxs)("div",{className:"kadence-controls-content",children:["individual"!==k&&(0,_o.jsx)(_o.Fragment,{children:(0,_o.jsx)(Xd,{value:C?.top||["","",""],onChange:e=>(e=>{C.top=e,C.bottom=e,C.right=e,C.left=e;const n=JSON.parse(JSON.stringify(C));t([n])})(e),min:0,max:S,step:j,help:r,styles:b,unit:C?.unit||"px",units:l,onUnit:e=>O(e),defaultValue:s.top,allowReset:!1})}),"individual"===k&&(0,_o.jsxs)("div",{className:"kadence-border-controls-grid-wrap",children:[(0,_o.jsx)("div",{className:"kadence-border-control-grid-visualizer",style:{borderTopColor:C?.top?.[0]?(0,No.KadenceColorOutput)(C?.top?.[0]):void 0,borderTopStyle:C?.top?.[1]||void 0,borderTopWidth:C?.top?.[2]?"clamp( 1px, "+C?.top?.[2]+C?.unit+", 10px )":void 0,borderRightColor:C?.right?.[0]?(0,No.KadenceColorOutput)(C?.right?.[0]):void 0,borderRightStyle:C?.right?.[1]||void 0,borderRightWidth:C?.right?.[2]?"clamp( 1px, "+C?.right?.[2]+C?.unit+", 10px )":void 0,borderBottomColor:C?.bottom?.[0]?(0,No.KadenceColorOutput)(C?.bottom?.[0]):void 0,borderBottomStyle:C?.bottom?.[1]||void 0,borderBottomWidth:C?.bottom?.[2]?"clamp( 1px, "+C?.bottom?.[2]+C?.unit+", 10px )":void 0,borderLeftColor:C?.left?.[0]?(0,No.KadenceColorOutput)(C?.left?.[0]):void 0,borderLeftStyle:C?.left?.[1]||void 0,borderLeftWidth:C?.left?.[2]?"clamp( 1px, "+C?.left?.[2]+C?.unit+", 10px )":void 0}}),(0,_o.jsx)(Xd,{value:C?.top||["","",""],onChange:e=>N(e,"top"),min:0,max:S,step:j,help:r,styles:b,unit:C?.unit||"px",units:l,onUnit:e=>O(e),defaultValue:s.top,allowReset:!1}),(0,_o.jsx)(Xd,{value:C?.left||["","",""],onChange:e=>N(e,"left"),min:0,max:S,step:j,help:r,styles:b,unit:C?.unit||"px",units:l,onUnit:e=>O(e),defaultValue:s.left,allowReset:!1}),(0,_o.jsx)(Xd,{value:C?.right||["","",""],onChange:e=>N(e,"right"),min:0,max:S,step:j,help:r,styles:b,unit:C?.unit||"px",units:l,onUnit:e=>O(e),defaultValue:s.right,allowReset:!1}),(0,_o.jsx)(Xd,{value:C?.bottom||["","",""],onChange:e=>N(e,"bottom"),min:0,max:S,step:j,help:r,styles:b,unit:C?.unit||"px",units:l,onUnit:e=>O(e),defaultValue:s.bottom,allowReset:!1})]})]})]})]}function Yd({label:e,onChange:t,onChangeTablet:n,onChangeMobile:o,onControl:a,mobileValue:r="",tabletValue:s="",value:i="",control:l="individual",units:c=["px","em","rem"],firstIcon:u=tu.outlineTopIcon,secondIcon:d=tu.outlineRightIcon,thirdIcon:p=tu.outlineBottomIcon,fourthIcon:h=tu.outlineLeftIcon,linkIcon:f=fd,unlinkIcon:b=bd,styles:m=["solid","dashed","dotted","double"],deskDefault:g={top:["","",""],right:["","",""],bottom:["","",""],left:["","",""],unit:"px"},tabletDefault:v={top:["","",""],right:["","",""],bottom:["","",""],left:["","",""],unit:""},mobileDefault:x={top:["","",""],right:["","",""],bottom:["","",""],left:["","",""],unit:""},reset:k=!0,defaultLinked:y=!0}){const _=(0,_c.useInstanceId)(Yd),w={first:u,second:d,third:p,fourth:h,link:f,unlink:b},[C,j]=(0,ko.useState)(l),S=a?l:C,N=a||j,[O,E]=(0,ko.useState)("Desktop"),M=(0,To.useSelect)(e=>e("kadenceblocks/data").getPreviewDeviceType(),[]);M!==O&&E(M),(0,ko.useEffect)(()=>{y&&("Mobile"===M?(0,Oo.isEqual)(r?.[0]?.top,r?.[0]?.bottom)&&(0,Oo.isEqual)(r?.[0]?.top,r?.[0]?.bottom)&&(0,Oo.isEqual)(r?.[0]?.top,r?.[0]?.right)&&(0,Oo.isEqual)(r?.[0]?.top,r?.[0]?.left)&&N("linked"):"Tablet"===M?(0,Oo.isEqual)(s?.[0]?.top,s?.[0]?.bottom)&&(0,Oo.isEqual)(s?.[0]?.top,s?.[0]?.bottom)&&(0,Oo.isEqual)(s?.[0]?.top,s?.[0]?.right)&&(0,Oo.isEqual)(s?.[0]?.top,s?.[0]?.left)&&N("linked"):(0,Oo.isEqual)(i?.[0]?.top,i?.[0]?.bottom)&&(0,Oo.isEqual)(i?.[0]?.top,i?.[0]?.bottom)&&(0,Oo.isEqual)(i?.[0]?.top,i?.[0]?.right)&&(0,Oo.isEqual)(i?.[0]?.top,i?.[0]?.left)&&N("linked")),r&&(0,Oo.isEqual)(i?.[0]?.unit,r?.[0]?.unit)&&(r[0].unit="",o(r)),s&&(0,Oo.isEqual)(i?.[0]?.unit,s?.[0]?.unit)&&(s[0].unit="",n(s))},[]);const{setPreviewDeviceType:T}=(0,To.useDispatch)("kadenceblocks/data"),R=[{name:"Desktop",title:(0,_o.jsx)(yo.Dashicon,{icon:"desktop"}),itemClass:"kb-desk-tab"},{name:"Tablet",title:(0,_o.jsx)(yo.Dashicon,{icon:"tablet"}),itemClass:"kb-tablet-tab"},{name:"Mobile",key:"mobile",title:(0,_o.jsx)(yo.Dashicon,{icon:"smartphone"}),itemClass:"kb-mobile-tab"}];let I=i?.[0]?i[0]:g;"Tablet"===O?I=s?.[0]?s[0]:v:"Mobile"===O&&(I=r?.[0]?r[0]:x);const P={},L=r?.[0]?.unit?r[0].unit:i?.[0]?.unit?i[0].unit:"px",A=s?.[0]?.unit?s[0].unit:i?.[0]?.unit?i[0].unit:"px";P.Mobile=(0,_o.jsx)(Kd,{value:r?JSON.parse(JSON.stringify(r)):void 0,onChange:e=>o(e),control:S,onControl:e=>N(e),defaultValue:x,styles:m,units:[L],firstIcon:u,secondIcon:d,thirdIcon:p,fourthIcon:h,linkIcon:f,unlinkIcon:b},"mobile"+_),P.Tablet=(0,_o.jsx)(Kd,{value:s?JSON.parse(JSON.stringify(s)):void 0,onChange:e=>n(e),control:S,onControl:e=>N(e),defaultValue:v,styles:m,units:[A],firstIcon:u,secondIcon:d,thirdIcon:p,fourthIcon:h,linkIcon:f,unlinkIcon:b},"tablet"+_),P.Desktop=(0,_o.jsx)(Kd,{value:i?JSON.parse(JSON.stringify(i)):void 0,onChange:e=>t(e),control:S,onControl:e=>N(e),defaultValue:g,styles:m,units:c,firstIcon:u,secondIcon:d,thirdIcon:p,fourthIcon:h,linkIcon:f,unlinkIcon:b},"desktop"+_);let D=g;return"Mobile"===O?D=x:"Mobile"===O&&(D=v),[t&&n&&o&&(0,_o.jsxs)("div",{className:`components-base-control kb-responsive-border-control kadence-border-box-control kadence-border-box-control${_}`,children:[(0,_o.jsxs)("div",{className:"kadence-border-control__header kadence-component__header",children:[e&&(0,_o.jsxs)("div",{className:"kadence-component__header__title kadence-radio-range__title",children:[(0,_o.jsx)("label",{className:"components-base-control__label",children:e}),k&&(0,_o.jsx)("div",{className:"title-reset-wrap",children:(0,_o.jsx)(yo.Button,{className:"is-reset is-single",label:"reset",isSmall:!0,disabled:!!(0,Oo.isEqual)(D,I),icon:kd,onClick:()=>{"Tablet"===O?n([v]):"Mobile"===O?o([x]):t([g])}})})]}),(0,_o.jsx)(yo.ButtonGroup,{className:"kb-responsive-options kb-measure-responsive-options","aria-label":(0,Mo.__)("Device","kadence-blocks"),children:(0,Oo.map)(R,({name:e,key:t,title:n,itemClass:o})=>(0,_o.jsx)(yo.Button,{className:`kb-responsive-btn ${o}${e===O?" is-active":""}`,isSmall:!0,"aria-pressed":O===e,onClick:()=>{return t=e,T((0,No.capitalizeFirstLetter)(t)),void E((0,No.capitalizeFirstLetter)(t));var t},children:n},t))}),N&&(0,_o.jsx)(yo.Button,{isSmall:!0,className:"kadence-radio-item border-control-toggle is-single only-icon",label:"individual"!==S?(0,Mo.__)("Individual","kadence-blocks"):(0,Mo.__)("Linked","kadence-blocks"),icon:"individual"!==S?w.link:w.unlink,onClick:()=>N("individual"!==S?"individual":"linked"),isPressed:"individual"!==S,isTertiary:"individual"===S})]}),(0,_o.jsx)("div",{className:"kb-responsive-border-control-inner",children:P[O]?P[O]:P.Desktop})]})]}function Zd(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 Qd({label:e,onChange:t,value:n="",className:o="",options:a=No.FONT_SIZES_MAP,step:r=1,max:s=200,min:i=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,preventUnitSelection:v=!1}){const[x,k]=(0,ko.useState)(!1);(0,ko.useEffect)(()=>{k(function(e,t){return!!t&&!!e&&!e.find(e=>e.value===t)}(a,n))},[]);const y=f?h:x,_=f||k,w=d.map(e=>({value:e,label:e})),C=y?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),j=[{value:"",output:"",size:"",label:(0,Mo.__)("Inherit","kadence-blocks"),name:(0,Mo.__)("Inherit","kadence-blocks")},...a];return[t&&(0,_o.jsxs)("div",{className:"components-base-control component-font-size-control kadence-font-size-control"+(o?" "+o:""),children:[!f&&e&&(0,_o.jsx)("div",{className:"kadence-font-size-control__header kadence-component__header",children:(0,_o.jsxs)("div",{className:"kadence-component__header__title kadence-radio-range__title",children:[(0,_o.jsx)("label",{className:"components-base-control__label",children:e}),m&&(0,_o.jsx)("div",{className:"title-reset-wrap",children:(0,_o.jsx)(yo.Button,{className:"is-reset is-single",label:"reset",isSmall:!0,disabled:!!(0,Oo.isEqual)(l,n),icon:kd,onClick:()=>{"function"==typeof m?m():t(l)}})})]})}),!y&&g&&(0,_o.jsx)("div",{className:"kadence-controls-content",children:(0,_o.jsxs)(yo.ButtonGroup,{className:"kadence-radio-container-control",children:[a.map((e,n)=>(0,_o.jsx)(yo.Button,{isTertiary:C!==e.value,className:"kadence-radio-item radio-"+e.value,isPrimary:C===e.value,icon:void 0!==e.icon?e.icon:void 0,"aria-pressed":C===e.value,onClick:()=>{C==e.value&&""==l?t(""):t(e.value)},children:e.label},`${e.label}-${e.value}-${n}`)),!p&&(0,_o.jsx)(yo.Button,{className:"kadence-radio-item radio-custom only-icon",label:(0,Mo.__)("Set custom size","kadence-blocks"),icon:zc,onClick:()=>{C&&"px"===c&&t(Zd(a,C)),_(!0)},isPressed:!1,isTertiary:!0})]})}),!y&&!g&&(0,_o.jsxs)("div",{className:"kadence-controls-content kadence-font-size-select-control-wrap",children:[(0,_o.jsx)(yo.SelectControl,{className:"kadence-font-size-select-control",value:C,options:j,onChange:e=>{t(C==e&&""==l?"":e)}}),!p&&(0,_o.jsx)(yo.ButtonGroup,{className:"kadence-radio-container-control",children:(0,_o.jsx)(yo.Button,{className:"kadence-radio-item radio-custom only-icon",label:(0,Mo.__)("Set custom size","kadence-blocks"),icon:zc,onClick:()=>{C&&"px"===c&&t(Zd(a,C)),_(!0)},isPressed:!1,isTertiary:!0})})]}),y&&(0,_o.jsxs)("div",{className:"kadence-controls-content kadence-single-unit-control",children:[(0,_o.jsx)(yo.__experimentalUnitControl,{label:b&&e?e:void 0,labelPosition:"top",min:i,max:s,step:r,units:w,value:n,disableUnits:!0,onChange:e=>(e=>{const n=isNaN(parseFloat(e))?void 0:parseFloat(e);t(n)})(e)}),(0,_o.jsx)("div",{className:"kadence-measure-control-select-wrapper",children:(0,_o.jsxs)("select",{className:"kadence-measure-control-select components-unit-control__select",onChange:e=>{u(e.target.value)},value:c,disabled:!!v,children:[!v&&d.map(e=>(0,_o.jsx)("option",{value:e,selected:c===e||void 0,children:e},e)),v&&(0,_o.jsx)("option",{value:c,selected:!0,children:""===c?"-":c},c)]})}),!p&&(0,_o.jsx)(yo.ButtonGroup,{className:"kadence-radio-container-control",children:(0,_o.jsx)(yo.Button,{className:"kadence-radio-item radio-custom only-icon",label:(0,Mo.__)("Use size preset","kadence-blocks"),icon:zc,isPrimary:!0,onClick:()=>{n&&"px"===c&&t(function(e,t){if(!t)return"";if(!e)return"";if("0"===t)return"";const n=e.find(e=>e.size===t);return n?n.value:""}(a,n)),_(!1)},isPressed:!0})})]})]})]}function ep({label:e,onChange:t,onChangeTablet:n,onChangeMobile:o,mobileValue:a,tabletValue:r,value:s,units:i=["px","em","rem"],onUnit:l,options:c=No.FONT_SIZES_MAP,step:u=1,max:d=200,min:p=0,unit:h="px",defaultValue:f=["","",""],reset:b=!0,radio:m=!0,compressedDevice:g=!1}){const v=(0,ko.useRef)(),[x,k]=(0,ko.useState)("Desktop"),y=(0,To.useSelect)(e=>e("kadenceblocks/data").getPreviewDeviceType(),[]);y!==x&&k(y);const{setPreviewDeviceType:_}=(0,To.useDispatch)("kadenceblocks/data"),w=e=>{_((0,No.capitalizeFirstLetter)(e)),k((0,No.capitalizeFirstLetter)(e))},C=[{name:"Desktop",title:(0,_o.jsx)(yo.Dashicon,{icon:"desktop"}),itemClass:"kb-desk-tab"},{name:"Tablet",title:(0,_o.jsx)(yo.Dashicon,{icon:"tablet"}),itemClass:"kb-tablet-tab"},{name:"Mobile",key:"mobile",title:(0,_o.jsx)(yo.Dashicon,{icon:"smartphone"}),itemClass:"kb-mobile-tab"}],j=[s,r,a],S={};S.Mobile=(0,_o.jsx)(Qd,{value:a||void 0,onChange:e=>o(e),options:c,onUnit:l,defaultValue:f[2],units:i,step:u,max:d,min:p,unit:h,radio:m,preventUnitSelection:!0}),S.Tablet=(0,_o.jsx)(Qd,{value:r||void 0,onChange:e=>n(e),options:c,onUnit:l,defaultValue:f[1],units:i,step:u,max:d,min:p,unit:h,radio:m,preventUnitSelection:!0}),S.Desktop=(0,_o.jsx)(Qd,{value:s||void 0,onChange:e=>t(e),options:c,onUnit:l,defaultValue:f[0],units:i,step:u,max:d,min:p,unit:h,radio:m});const N={Desktop:(0,_o.jsx)(yo.Dashicon,{icon:"desktop"}),Tablet:(0,_o.jsx)(yo.Dashicon,{icon:"tablet"}),Mobile:(0,_o.jsx)(yo.Dashicon,{icon:"smartphone"})};return[t&&n&&o&&(0,_o.jsxs)("div",{ref:v,className:"components-base-control kb-responsive-font-size-control kadence-font-size-control",children:[(0,_o.jsxs)("div",{className:"kadence-font-size-control__header kadence-component__header",children:[e&&(0,_o.jsxs)("div",{className:"kadence-component__header__title kadence-font-size__title",children:[(0,_o.jsx)("label",{className:"components-base-control__label",children:e}),b&&(0,_o.jsx)("div",{className:"title-reset-wrap",children:(0,_o.jsx)(yo.Button,{className:"is-reset is-single",label:"reset",isSmall:!0,disabled:!!(0,Oo.isEqual)(f,j),icon:kd,onClick:()=>{"function"==typeof b?b():"Mobile"===x?o(f[2]):"Tablet"===x?n(f[1]):t(f[0])}})})]}),!g&&(0,_o.jsx)(yo.ButtonGroup,{className:"kb-responsive-options kb-measure-responsive-options","aria-label":(0,Mo.__)("Device","kadence-blocks"),children:(0,Oo.map)(C,({name:e,key:t,title:n,itemClass:o})=>(0,_o.jsx)(yo.Button,{className:`kb-responsive-btn ${o}${e===x?" is-active":""}`,isSmall:!0,"aria-pressed":x===e,onClick:()=>w(e),children:n},t))}),g&&(0,_o.jsx)(yo.DropdownMenu,{className:"kb-responsive-options-dropdown",icon:N[x]?N[x]:N.Desktop,label:(0,Mo.__)("Target Device","kadence-blocks"),controls:C.map(e=>{return[{title:(t=e).name,icon:t.title,isActive:x===t.name,onClick:()=>{w(t.name)}}];var t})})]}),(0,_o.jsx)("div",{className:"kb-responsive-border-control-inner",children:S[x]?S[x]:S.Desktop})]})]}function tp({label:e,onChange:t,value:n="",className:o="",step:a=1,max:r=200,min:s=0,defaultValue:i="",unit:l="",onUnit:c,units:u=["px","em","rem"],parentLabel:d=null,reset:p=!0,preventUnitSelection:h=!1}){const f=u.map(e=>({value:e,label:e}));return[t&&(0,_o.jsxs)("div",{className:"components-base-control component-font-size-control kadence-font-size-control"+(o?" "+o:""),children:[e&&(0,_o.jsx)("div",{className:"kadence-font-size-control__header kadence-component__header",children:(0,_o.jsxs)("div",{className:"kadence-component__header__title kadence-radio-range__title",children:[(0,_o.jsx)("label",{className:"components-base-control__label",children:e}),p&&(0,_o.jsx)("div",{className:"title-reset-wrap",children:(0,_o.jsx)(yo.Button,{className:"is-reset is-single",label:"reset",isSmall:!0,disabled:!!(0,Oo.isEqual)(i,n),icon:kd,onClick:()=>{"function"==typeof p?p():t(i)}})})]})}),(0,_o.jsxs)("div",{className:"kadence-controls-content kadence-single-unit-control",children:[(0,_o.jsx)(yo.__experimentalUnitControl,{label:d&&e?e:void 0,labelPosition:"top",min:s,max:r,step:a,units:f,value:n,disableUnits:!0,onChange:e=>(e=>{const n=isNaN(parseFloat(e))?void 0:parseFloat(e);t(n)})(e)}),(0,_o.jsx)("div",{className:"kadence-measure-control-select-wrapper",children:(0,_o.jsx)("select",{className:"kadence-measure-control-select components-unit-control__select",onChange:e=>{"-"===e.target.value?c(""):c(e.target.value)},value:l,disabled:!!h,children:u.map(e=>h?l===e&&(0,_o.jsx)("option",{value:e,selected:l===e||""===l&&"-"===e||void 0,children:e},e):(0,_o.jsx)("option",{value:e,selected:l===e||""===l&&"-"===e||void 0,children:e},e))})})]})]})]}function np({label:e,onChange:t,onChangeTablet:n,onChangeMobile:o,mobileValue:a,tabletValue:r,value:s,units:i=["px","em","rem"],onUnit:l,step:c=1,max:u=200,min:d=0,unit:p="",defaultValue:h=["","",""],compressedDevice:f=!1,reset:b=!0}){const m=(0,ko.useRef)(),[g,v]=(0,ko.useState)("Desktop"),x=(0,To.useSelect)(e=>e("kadenceblocks/data").getPreviewDeviceType(),[]);x!==g&&v(x);const{setPreviewDeviceType:k}=(0,To.useDispatch)("kadenceblocks/data"),y=e=>{k((0,No.capitalizeFirstLetter)(e)),v((0,No.capitalizeFirstLetter)(e))},_=[{name:"Desktop",title:(0,_o.jsx)(yo.Dashicon,{icon:"desktop"}),itemClass:"kb-desk-tab"},{name:"Tablet",title:(0,_o.jsx)(yo.Dashicon,{icon:"tablet"}),itemClass:"kb-tablet-tab"},{name:"Mobile",key:"mobile",title:(0,_o.jsx)(yo.Dashicon,{icon:"smartphone"}),itemClass:"kb-mobile-tab"}],w={Desktop:(0,_o.jsx)(yo.Dashicon,{icon:"desktop"}),Tablet:(0,_o.jsx)(yo.Dashicon,{icon:"tablet"}),Mobile:(0,_o.jsx)(yo.Dashicon,{icon:"smartphone"})},C=[s,r,a],j={};return j.Mobile=(0,_o.jsx)(tp,{value:a||void 0,onChange:e=>o(e),onUnit:l,defaultValue:h[2],units:i,step:c,max:u,min:d,unit:p,preventUnitSelection:!0}),j.Tablet=(0,_o.jsx)(tp,{value:r||void 0,onChange:e=>n(e),onUnit:l,defaultValue:h[1],units:i,step:c,max:u,min:d,unit:p,preventUnitSelection:!0}),j.Desktop=(0,_o.jsx)(tp,{value:s||void 0,onChange:e=>t(e),onUnit:l,defaultValue:h[0],units:i,step:c,max:u,min:d,unit:p}),[t&&n&&o&&(0,_o.jsxs)("div",{ref:m,className:"components-base-control kb-responsive-unit-control kadence-unit-control",children:[(0,_o.jsxs)("div",{className:"kadence-unit-control__header kadence-component__header",children:[e&&(0,_o.jsxs)("div",{className:"kadence-component__header__title kadence-unit__title",children:[(0,_o.jsx)("label",{className:"components-base-control__label",children:e}),b&&(0,_o.jsx)("div",{className:"title-reset-wrap",children:(0,_o.jsx)(yo.Button,{className:"is-reset is-single",label:"reset",isSmall:!0,disabled:!!(0,Oo.isEqual)(h,C),icon:kd,onClick:()=>{"function"==typeof b?b():"Mobile"===g?o(h[2]):"Tablet"===g?n(h[1]):t(h[0])}})})]}),!f&&(0,_o.jsx)(yo.ButtonGroup,{className:"kb-responsive-options kb-measure-responsive-options","aria-label":(0,Mo.__)("Device","kadence-blocks"),children:(0,Oo.map)(_,({name:e,key:t,title:n,itemClass:o})=>(0,_o.jsx)(yo.Button,{className:`kb-responsive-btn ${o}${e===g?" is-active":""}`,isSmall:!0,"aria-pressed":g===e,onClick:()=>y(e),children:n},t))}),f&&(0,_o.jsx)(yo.DropdownMenu,{className:"kb-responsive-options-dropdown",icon:w[g]?w[g]:w.Desktop,label:(0,Mo.__)("Target Device","kadence-blocks"),controls:_.map(e=>{return[{title:(t=e).name,icon:t.title,isActive:g===t.name,onClick:()=>{y(t.name)}}];var t})})]}),(0,_o.jsx)("div",{className:"kb-responsive-border-control-inner",children:j[g]?j[g]:j.Desktop})]})]}const op=(0,_o.jsx)(Ho.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,_o.jsx)(Ho.Path,{d:"M19 8h-1V6h-5v2h-2V6H6v2H5c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-8c0-1.1-.9-2-2-2zm.5 10c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5v-8c0-.3.2-.5.5-.5h14c.3 0 .5.2.5.5v8z"})}),ap=(0,_o.jsx)(Ho.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,_o.jsx)(Ho.Path,{d:"M4 20h8v-1.5H4V20zM18.9 3.5c-.6-.6-1.5-.6-2.1 0l-7.2 7.2c-.4-.1-.7 0-1.1.1-.5.2-1.5.7-1.9 2.2-.4 1.7-.8 2.2-1.1 2.7-.1.1-.2.3-.3.4l-.6 1.1H6c2 0 3.4-.4 4.7-1.4.8-.6 1.2-1.4 1.3-2.3 0-.3 0-.5-.1-.7L19 5.7c.5-.6.5-1.6-.1-2.2zM9.7 14.7c-.7.5-1.5.8-2.4 1 .2-.5.5-1.2.8-2.3.2-.6.4-1 .8-1.1.5-.1 1 .1 1.3.3.2.2.3.5.2.8 0 .3-.1.9-.7 1.3z"})}),rp=(0,_c.compose)([(0,To.withSelect)((e,t)=>{const n=void 0!==t.initialOpen?t.initialOpen:"general";return{openedTab:e("kadenceblocks/data").getOpenSidebarTabKey(t.panelName+e("core/block-editor").getSelectedBlockClientId(),n)}}),(0,To.withDispatch)((e,t,{select:n})=>{const{getSelectedBlockClientId:o}=n("core/block-editor");return{toggleOpened:n=>{e("kadenceblocks/data").switchEditorTabOpened(t.panelName+o(),n)}}})])(function({allowedTabs:e=null,activeTab:t,setActiveTab:n,openedTab:o,toggleOpened:a,tabs:r=null}){const s=[{key:"general",title:(0,Mo.__)("General","kadence-blocks"),icon:op},{key:"style",title:(0,Mo.__)("Style","kadence-blocks"),icon:ap},{key:"advanced",title:(0,Mo.__)("Advanced","kadence-blocks"),icon:zc}],i=e||["general","style","advanced"],l=r||s,c=(0,ko.createRef)();let u;return(0,ko.useEffect)(()=>{u=c.current.closest(".components-panel")}),t!==o&&n(o),(0,ko.useEffect)(()=>{var e;return e=t,u&&(u.setAttribute("data-kadence-hide-advanced","advanced"!==e),u.setAttribute("data-kadence-active-tab",e)),()=>{if(u){const e=u.querySelector(".kadence-blocks-inspector-tabs");e&&null!==e||(u.removeAttribute("data-kadence-hide-advanced"),u.removeAttribute("data-kadence-active-tab"))}}},[t]),(0,_o.jsx)("div",{className:"kadence-blocks-inspector-tabs",ref:c,children:l.map(({key:e,title:o,icon:r},s)=>{if(i.includes(e))return(0,_o.jsxs)("button",{"aria-label":o+" "+(0,Mo.__)("tab","kadence-blocks"),onClick:()=>(e=>{a(e),n(e)})(e),className:Bc()({"is-active":e===t}),children:[(0,_o.jsx)(yo.Icon,{icon:r})," ",o]},e)})})});function sp({label:e=(0,Mo.__)("Hover Styles","kadence-blocks"),activeLabel:t=(0,Mo.__)("Active Styles","kadence-blocks"),initial:n="normal",hoverTab:o=(0,Mo.__)("Hover","kadence-blocks"),normalTab:a=(0,Mo.__)("Normal","kadence-blocks"),activeTab:r=(0,Mo.__)("Active","kadence-blocks"),active:s,hover:i,normal:l,className:c="",icon:u=tu.hoverToggle,activeIcon:d=tu.click,tabUI:p=!0,setActivePreview:h,activePreview:f}){const[b,m]=(0,ko.useState)("hover"===n),[g,v]=(0,ko.useState)("active"===n);var x=[{name:"normal",title:a,className:"kt-normal-tab"}];return i&&x.push({name:"hover",title:o,className:"kt-hover-tab"}),s&&x.push({name:"active",title:r,className:"kt-active-tab"}),p?[(0,_o.jsx)("div",{className:"components-base-control kb-hover-toggle-control-tab-ui kb-hover-toggle-control"+(c?" "+c:""),children:(0,_o.jsx)(yo.TabPanel,{className:"kt-inspect-tabs kt-hover-tabs",activeClass:"active-tab",tabs:x,children:e=>{if(e.name)return"hover"===e.name?(0,_o.jsx)(_o.Fragment,{children:i}):"active"===e.name?(0,_o.jsxs)(_o.Fragment,{children:[h&&(0,_o.jsx)(yo.Button,{className:"kb-hover-toggle-active-preview",isPressed:f,text:f?(0,Mo.__)("Hide Active State","kadence-blocks"):(0,Mo.__)("Preview Active State","kadence-blocks"),onClick:()=>{h(!f)},variant:"secondary"}),s]}):(0,_o.jsx)(_o.Fragment,{children:l})}})})]:[(0,_o.jsxs)("div",{className:"components-base-control kb-hover-toggle-control"+(c?" "+c:""),children:[(0,_o.jsxs)("div",{className:"kb-hover-toggle-control-toggle",children:[i&&(0,_o.jsx)(yo.Button,{className:"kb-hover-toggle-btn "+(No.isRTL?"is-rtl":""),isPrimary:b,icon:u,"aria-pressed":b,label:e,onClick:()=>{v(!1),m(!b)}}),s&&(0,_o.jsx)(yo.Button,{className:"kb-active-toggle-btn "+(No.isRTL?"is-rtl":""),isPrimary:g,icon:d,"aria-pressed":g,label:t,onClick:()=>{m(!1),v(!g)}})]}),(0,_o.jsxs)("div",{className:"kb-hover-toggle-area",children:[b&&(0,_o.jsx)("div",{className:"kb-hover-control-wrap",children:i}),g&&(0,_o.jsx)("div",{className:"kb-active-control-wrap",children:s}),!b&&!g&&(0,_o.jsx)(_o.Fragment,{children:l})]})]})]}function ip({label:e,onChange:t,value:n="",className:o="",isCollapsed:a=!1,ariaLabel:r=(0,Mo.__)("Change HTML Tag","kadence-blocks"),reset:s=!1,headingOnly:i=!1,tagLowLevel:l=1,tagHighLevel:c=7}){const u="span"!==n&&"div"!==n&&"p"!==n?n:2,d="span"===n||"div"===n||"p"===n?n:"heading",p=[[{icon:(0,_o.jsx)(yc,{level:1,isPressed:!(1!==u||!d||"heading"!==d)}),title:(0,Mo.__)("Heading 1","kadence-blocks"),isActive:!(1!==u||!d||"heading"!==d),onClick:()=>t(1)}],[{icon:(0,_o.jsx)(yc,{level:2,isPressed:!(2!==u||!d||"heading"!==d)}),title:(0,Mo.__)("Heading 2","kadence-blocks"),isActive:!(2!==u||!d||"heading"!==d),onClick:()=>t(2)}],[{icon:(0,_o.jsx)(yc,{level:3,isPressed:!(3!==u||!d||"heading"!==d)}),title:(0,Mo.__)("Heading 3","kadence-blocks"),isActive:!(3!==u||!d||"heading"!==d),onClick:()=>t(3)}],[{icon:(0,_o.jsx)(yc,{level:4,isPressed:!(4!==u||!d||"heading"!==d)}),title:(0,Mo.__)("Heading 4","kadence-blocks"),isActive:!(4!==u||!d||"heading"!==d),onClick:()=>t(4)}],[{icon:(0,_o.jsx)(yc,{level:5,isPressed:!(5!==u||!d||"heading"!==d)}),title:(0,Mo.__)("Heading 5","kadence-blocks"),isActive:!(5!==u||!d||"heading"!==d),onClick:()=>t(5)}],[{icon:(0,_o.jsx)(yc,{level:6,isPressed:!(6!==u||!d||"heading"!==d)}),title:(0,Mo.__)("Heading 6","kadence-blocks"),isActive:!(6!==u||!d||"heading"!==d),onClick:()=>t(6)}],[{icon:(0,_o.jsx)(yc,{level:"p",isPressed:!(!d||"p"!==d)}),title:(0,Mo.__)("Paragraph","kadence-blocks"),isActive:!(!d||"p"!==d),onClick:()=>t("p")}],[{icon:(0,_o.jsx)(yc,{level:"span",isPressed:!(!d||"span"!==d)}),title:(0,Mo.__)("Span","kadence-blocks"),isActive:!(!d||"span"!==d),onClick:()=>t("span")}],[{icon:(0,_o.jsx)(yc,{level:"div",isPressed:!(!d||"div"!==d)}),title:(0,Mo.__)("div","kadence-blocks"),isActive:!(!d||"div"!==d),onClick:()=>t("div")}]],h=(0,Oo.range)(l,c).map(e=>[{icon:(0,_o.jsx)(yc,{level:e,isPressed:!(e!==u||!d||"heading"!==d)}),title:(0,Mo.sprintf)(/* translators: %d: heading level e.g: "1", "2", "3" */ /* translators: %d: heading level e.g: "1", "2", "3" */
    4141(0,Mo.__)("Heading %d","kadence-blocks"),e),isActive:!(e!==u||!d||"heading"!==d),onClick:()=>t(e)}]),f=a?ToolbarDropdownMenu:yo.ToolbarGroup;return[t&&(0,_o.jsxs)("div",{className:"kb-tag-level-control components-base-control"+(o?" "+o:""),children:[e&&(0,_o.jsx)("div",{className:"kadence-component__header kadence-tag-select__header",children:e&&(0,_o.jsxs)("div",{className:"kadence-component__header__title kadence-tag-select__title",children:[(0,_o.jsx)("label",{className:"components-base-control__label",children:e}),s&&(0,_o.jsx)("div",{className:"title-reset-wrap",children:(0,_o.jsx)(yo.Button,{className:"is-reset is-single",label:"reset",isSmall:!0,disabled:!!isEqual(defaultValue,n),icon:undo,onClick:()=>onReset()})})]})}),(0,_o.jsx)("div",{className:"kadence-controls-content kb-tag-select-control-inner",children:(0,_o.jsx)(f,{isCollapsed:a,label:r,controls:i?h:p})})]})]}function lp(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 cp({label:e,onChange:t,value:n="",className:o="",options:a=No.GAP_SIZES_MAP,step:r=1,max:s=200,min:i=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,ko.useState)(!1);(0,ko.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,Mo.__)("Inherit","kadence-blocks"),name:(0,Mo.__)("Inherit","kadence-blocks")},...a];return[t&&(0,_o.jsxs)("div",{className:"components-base-control component-gap-size-control kadence-gap-size-control"+(o?" "+o:""),children:[!f&&e&&(0,_o.jsx)("div",{className:"kadence-gap-size-control__header kadence-component__header",children:(0,_o.jsxs)("div",{className:"kadence-component__header__title kadence-radio-range__title",children:[(0,_o.jsx)("label",{className:"components-base-control__label",children:e}),m&&(0,_o.jsx)("div",{className:"title-reset-wrap",children:(0,_o.jsx)(yo.Button,{className:"is-reset is-single",label:"reset",isSmall:!0,disabled:!!(0,Oo.isEqual)(l,n),icon:kd,onClick:()=>{"function"==typeof m?m():t(l)}})})]})}),!k&&g&&(0,_o.jsx)("div",{className:"kadence-controls-content",children:(0,_o.jsxs)(yo.ButtonGroup,{className:"kadence-radio-container-control",children:[a.map((e,n)=>(0,_o.jsx)(yo.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,_o.jsx)(yo.Button,{className:"kadence-radio-item radio-custom only-icon",label:(0,Mo.__)("Set custom size","kadence-blocks"),icon:zc,onClick:()=>{w&&"px"===c&&t(lp(a,w)),y(!0)},isPressed:!1,isTertiary:!0})]})}),!k&&!g&&(0,_o.jsxs)("div",{className:"kadence-controls-content kadence-gap-size-select-control-wrap",children:[(0,_o.jsx)(yo.SelectControl,{className:"kadence-gap-size-select-control",value:w,options:C,onChange:e=>{t(w==e&&""==l?"":e)}}),!p&&(0,_o.jsx)(yo.ButtonGroup,{className:"kadence-radio-container-control",children:(0,_o.jsx)(yo.Button,{className:"kadence-radio-item radio-custom only-icon",label:(0,Mo.__)("Set custom size","kadence-blocks"),icon:zc,onClick:()=>{w&&"px"===c&&t(lp(a,w)),y(!0)},isPressed:!1,isTertiary:!0})})]}),k&&(0,_o.jsxs)("div",{className:"kadence-controls-content kadence-single-unit-control",children:[(0,_o.jsx)(yo.__experimentalUnitControl,{label:b&&e?e:void 0,labelPosition:"top",min:i,max:s,step:r,units:_,value:n,disableUnits:!0,onChange:e=>(e=>{const n=isNaN(parseFloat(e))?void 0:parseFloat(e);t(n)})(e)}),(0,_o.jsx)("div",{className:"kadence-measure-control-select-wrapper",children:(0,_o.jsx)("select",{className:"kadence-measure-control-select components-unit-control__select",onChange:e=>{u(e.target.value)},value:c,children:d.map(e=>(0,_o.jsx)("option",{value:e,selected:c===e||void 0,children:e},e))})}),!p&&(0,_o.jsx)(yo.ButtonGroup,{className:"kadence-radio-container-control",children:(0,_o.jsx)(yo.Button,{className:"kadence-radio-item radio-custom only-icon",label:(0,Mo.__)("Use size preset","kadence-blocks"),icon:zc,isPrimary:!0,onClick:()=>{n&&"px"===c&&t(function(e,t){if(!t)return"";if(!e)return"";if("0"===t)return"";const n=e.find(e=>e.size===t);return n?n.value:""}(a,n)),y(!1)},isPressed:!0})})]})]})]}function up({label:e,onChange:t,onChangeTablet:n,onChangeMobile:o,mobileValue:a,tabletValue:r,value:s,units:i=["px","em","rem"],onUnit:l,options:c=No.GAP_SIZES_MAP,step:u=1,max:d=200,min:p=0,unit:h="px",defaultValue:f=["","",""],reset:b=!0,radio:m=!0,compressedDevice:g=!1}){const v=(0,ko.useRef)(),[x,k]=(0,ko.useState)("Desktop"),y=(0,To.useSelect)(e=>e("kadenceblocks/data").getPreviewDeviceType(),[]);y!==x&&k(y);const{setPreviewDeviceType:_}=(0,To.useDispatch)("kadenceblocks/data"),w=e=>{_((0,No.capitalizeFirstLetter)(e)),k((0,No.capitalizeFirstLetter)(e))},C=[{name:"Desktop",title:(0,_o.jsx)(yo.Dashicon,{icon:"desktop"}),itemClass:"kb-desk-tab"},{name:"Tablet",title:(0,_o.jsx)(yo.Dashicon,{icon:"tablet"}),itemClass:"kb-tablet-tab"},{name:"Mobile",key:"mobile",title:(0,_o.jsx)(yo.Dashicon,{icon:"smartphone"}),itemClass:"kb-mobile-tab"}],j=[s,r,a],S={};S.Mobile=(0,_o.jsx)(cp,{value:a||void 0,onChange:e=>o(e),options:c,onUnit:l,defaultValue:f[2],units:i,step:u,max:d,min:p,unit:h,radio:m}),S.Tablet=(0,_o.jsx)(cp,{value:r||void 0,onChange:e=>n(e),options:c,onUnit:l,defaultValue:f[1],units:i,step:u,max:d,min:p,unit:h,radio:m}),S.Desktop=(0,_o.jsx)(cp,{value:s||void 0,onChange:e=>t(e),options:c,onUnit:l,defaultValue:f[0],units:i,step:u,max:d,min:p,unit:h,radio:m});const N={Desktop:(0,_o.jsx)(yo.Dashicon,{icon:"desktop"}),Tablet:(0,_o.jsx)(yo.Dashicon,{icon:"tablet"}),Mobile:(0,_o.jsx)(yo.Dashicon,{icon:"smartphone"})};return[t&&n&&o&&(0,_o.jsxs)("div",{ref:v,className:"components-base-control kb-responsive-gap-size-control kadence-gap-size-control",children:[(0,_o.jsxs)("div",{className:"kadence-gap-size-control__header kadence-component__header",children:[e&&(0,_o.jsxs)("div",{className:"kadence-component__header__title kadence-gap-size__title",children:[(0,_o.jsx)("label",{className:"components-base-control__label",children:e}),b&&(0,_o.jsx)("div",{className:"title-reset-wrap",children:(0,_o.jsx)(yo.Button,{className:"is-reset is-single",label:"reset",isSmall:!0,disabled:!!(0,Oo.isEqual)(f,j),icon:kd,onClick:()=>{"function"==typeof b?b():"Mobile"===x?o(f[2]):"Tablet"===x?n(f[1]):t(f[0])}})})]}),!g&&(0,_o.jsx)(yo.ButtonGroup,{className:"kb-responsive-options kb-measure-responsive-options","aria-label":(0,Mo.__)("Device","kadence-blocks"),children:(0,Oo.map)(C,({name:e,key:t,title:n,itemClass:o})=>(0,_o.jsx)(yo.Button,{className:`kb-responsive-btn ${o}${e===x?" is-active":""}`,isSmall:!0,"aria-pressed":x===e,onClick:()=>w(e),children:n},t))}),g&&(0,_o.jsx)(yo.DropdownMenu,{className:"kb-responsive-options-dropdown",icon:N[x]?N[x]:N.Desktop,label:(0,Mo.__)("Target Device","kadence-blocks"),controls:C.map(e=>{return[{title:(t=e).name,icon:t.title,isActive:x===t.name,onClick:()=>{w(t.name)}}];var t})})]}),(0,_o.jsx)("div",{className:"kb-responsive-border-control-inner",children:S[x]?S[x]:S.Desktop})]})]}tu.pxIcon,tu.emIcon,tu.remIcon,tu.vhIcon,tu.vwIcon,tu.percentIcon;const{localStorage:dp}=window;function pp({attributes:e,defaultAttributes:t={},blockSlug:n,excludedAttrs:o=[],preventMultiple:a=[],onPaste:r}){const s=n+"-style",i=JSON.parse(dp.getItem(s)),l=()=>{dp.setItem(s,JSON.stringify((0,No.getTransferableAttributes)(e,t,o,a,!0)))},c=()=>{const e=JSON.parse(dp.getItem(s));if(e){const n=(0,No.getTransferableAttributes)(e,t,[],[],!1);r(n)}},u=()=>{const e=JSON.parse(dp.getItem(s));e&&r(e)};return(0,_o.jsx)(yo.ToolbarDropdownMenu,{className:"components-toolbar kb-copy-paste-attributes",icon:tu.copyStyles,label:(0,Mo.__)("Copy/Paste Styles","kadence-blocks"),popoverProps:{className:"kb-copy-paste-attributes__popover"},children:({onClose:e})=>(0,_o.jsx)(_o.Fragment,{children:(0,_o.jsxs)(yo.MenuGroup,{children:[(0,_o.jsx)(yo.MenuItem,{icon:tu.copy,onClick:(0,Oo.flow)(e,l),label:(0,Mo.__)("Copy Styles","kadence-blocks"),children:(0,Mo.__)("Copy Styles","kadence-blocks")}),(0,_o.jsx)(yo.MenuItem,{icon:tu.paste,onClick:(0,Oo.flow)(e,c),disabled:!i,label:(0,Mo.__)("Paste Styles","kadence-blocks"),children:(0,Mo.__)("Paste Styles","kadence-blocks")}),(0,_o.jsx)(yo.MenuItem,{icon:tu.paste,onClick:(0,Oo.flow)(e,u),disabled:!i,label:(0,Mo.__)("Paste and Replace","kadence-blocks"),children:(0,Mo.__)("Paste and Replace","kadence-blocks")})]})})})}const hp=window.wp.hooks,fp=(0,yo.withFilters)("kadence.FormInputDynamicControl")(function(){const[e,t]=(0,ko.useState)(),[n,o]=(0,ko.useState)(!1),a=(0,Oo.debounce)(()=>{o(!n)},100);return(0,_o.jsxs)("div",{className:"kb-dynamic-form-input-sidebar-wrap",children:[(0,_o.jsx)(yo.Button,{className:"kb-dynamic-form-input-sidebar",icon:tu.dynamic,onClick:()=>a(),ref:t,isPressed:n,"aria-haspopup":"true","aria-expanded":n,label:(0,Mo.__)("Dynamic Content","kadence-blocks"),showTooltip:!0}),n&&(0,_o.jsx)(yo.Popover,{headerTitle:(0,Mo.__)("Select Dynamic Source","kadence-blocks"),noArrow:!1,onClose:a,placement:"bottom-end",anchor:e,className:"kb-dynamic-popover",children:(0,_o.jsx)("div",{className:"kb-dynamic-popover-inner-wrap",children:(0,_o.jsxs)("div",{className:"kb-pro-notice",children:[(0,_o.jsxs)("h2",{children:[(0,Mo.__)("Dynamic Content","kadence-blocks")," "]}),(0,_o.jsxs)("p",{children:[(0,Mo.__)("Create dynamic sites by populating content from various sources.","kadence-blocks")," "]}),(0,_o.jsx)(yo.ExternalLink,{href:"https://www.kadencewp.com/kadence-blocks/pro/?utm_source=in-app&utm_medium=kadence-blocks&utm_campaign=dynamic-content",children:(0,Mo.__)("Upgrade to Pro","kadence-blocks")})]})})})]})});function bp({value:e,onChange:t,label:n,className:o,reset:a,defaultValue:r="",dynamicAttribute:s,isSelected:i,attributes:l,setAttributes:c,name:u,clientId:d,context:p}){const h=(0,_c.useInstanceId)(bp),{kadenceDynamic:f}=l,b=void 0!==f&&void 0!==f[s]&&void 0!==f[s].enable&&""!==f[s].enable&&f[s].enable;return(0,_o.jsxs)("div",{className:`components-base-control kadence-form-input-control kadence-form-input-control${h}${o?" "+o:""}`,children:[n&&(0,_o.jsx)("div",{className:"kadence-form-input-control__header",children:n&&(0,_o.jsxs)("div",{className:"kadence-form-input-control__title",children:[(0,_o.jsx)("label",{className:"components-base-control__label",children:n}),a&&(0,_o.jsx)("div",{className:"title-reset-wrap",children:(0,_o.jsx)(yo.Button,{className:"is-reset is-single",label:"reset",isSmall:!0,disabled:!!(0,Oo.isEqual)(r,e),icon:undo,onClick:()=>{"function"==typeof a?a():t(r)}})})]})}),(0,_o.jsxs)("div",{className:"kadence-controls-content",children:[b&&(0,_o.jsx)("div",{className:"kadence-form-input-control__dynamic__label",children:(0,hp.applyFilters)("kadence.formInputDisplay",e,l,s)}),!b&&(0,_o.jsx)(yo.TextControl,{label:"",value:e,onChange:e=>t(e)}),(0,_o.jsx)(fp,{dynamicAttribute:s,isSelected:i,attributes:l,setAttributes:c,name:u,clientId:d,context:p})]})]})}function mp(e){const{label:t,onChange:n,value:o,postType:a="post",hideLabelFromVision:r=!1,overrideLabel:s=null}=e,{posts:i}=(0,To.useSelect)(e=>({posts:e("core").getEntityRecords("postType",a,{per_page:-1,orderby:"title",order:"asc"})}),[a]),l=[...(i||[]).map(e=>({label:null!==s&&o===e.id?s:gp(e.title.raw),value:e.id}))];return!(o&&l.some(e=>e.value===o))&&o&&l.push({label:null!==s?s:(0,Mo.__)("Unknown Selection","kadence-blocks"),value:o}),(0,_o.jsx)(yo.SelectControl,{label:t,options:l,onChange:n,value:o,hideLabelFromVision:r})}function gp(e){const t=(e=e||"").replace(/<!--[\s\S]*?(-->|$)/g,"").replace(/<(script|style)[^>]*>[\s\S]*?(<\/\1>|$)/gi,"").replace(/<\/?[a-z][\s\S]*?(>|$)/gi,"");return t!==e?gp(t):t}var vp=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"].join(","),xp="undefined"==typeof Element,kp=xp?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,yp=!xp&&Element.prototype.getRootNode?function(e){var t;return null==e||null===(t=e.getRootNode)||void 0===t?void 0:t.call(e)}:function(e){return null==e?void 0:e.ownerDocument},_p=function e(t,n){var o;void 0===n&&(n=!0);var a=null==t||null===(o=t.getAttribute)||void 0===o?void 0:o.call(t,"inert");return""===a||"true"===a||n&&t&&e(t.parentNode)},Cp=function e(t,n,o){for(var a=[],r=Array.from(t);r.length;){var s=r.shift();if(!_p(s,!1))if("SLOT"===s.tagName){var i=s.assignedElements(),l=e(i.length?i:s.children,!0,o);o.flatten?a.push.apply(a,l):a.push({scopeParent:s,candidates:l})}else{kp.call(s,vp)&&o.filter(s)&&(n||!t.includes(s))&&a.push(s);var c=s.shadowRoot||"function"==typeof o.getShadowRoot&&o.getShadowRoot(s),u=!_p(c,!1)&&(!o.shadowRootFilter||o.shadowRootFilter(s));if(c&&u){var d=e(!0===c?s.children:c.children,!0,o);o.flatten?a.push.apply(a,d):a.push({scopeParent:s,candidates:d})}else r.unshift.apply(r,s.children)}}return a},jp=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},Sp=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||function(e){var t,n=null==e||null===(t=e.getAttribute)||void 0===t?void 0:t.call(e,"contenteditable");return""===n||"true"===n}(e))&&!jp(e)?0:e.tabIndex},Np=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},Op=function(e){return"INPUT"===e.tagName},Ep=function(e){var t=e.getBoundingClientRect(),n=t.width,o=t.height;return 0===n&&0===o},Mp=function(e,t){return!(t.disabled||_p(t)||function(e){return Op(e)&&"hidden"===e.type}(t)||function(e,t){var n=t.displayCheck,o=t.getShadowRoot;if("hidden"===getComputedStyle(e).visibility)return!0;var a=kp.call(e,"details>summary:first-of-type")?e.parentElement:e;if(kp.call(a,"details:not([open]) *"))return!0;if(n&&"full"!==n&&"legacy-full"!==n){if("non-zero-area"===n)return Ep(e)}else{if("function"==typeof o){for(var r=e;e;){var s=e.parentElement,i=yp(e);if(s&&!s.shadowRoot&&!0===o(s))return Ep(e);e=e.assignedSlot?e.assignedSlot:s||i===e.ownerDocument?s:i.host}e=r}if(function(e){var t,n,o,a,r=e&&yp(e),s=null===(t=r)||void 0===t?void 0:t.host,i=!1;if(r&&r!==e)for(i=!!(null!==(n=s)&&void 0!==n&&null!==(o=n.ownerDocument)&&void 0!==o&&o.contains(s)||null!=e&&null!==(a=e.ownerDocument)&&void 0!==a&&a.contains(e));!i&&s;){var l,c,u;i=!(null===(c=s=null===(l=r=yp(s))||void 0===l?void 0:l.host)||void 0===c||null===(u=c.ownerDocument)||void 0===u||!u.contains(s))}return i}(e))return!e.getClientRects().length;if("legacy-full"!==n)return!0}return!1}(t,e)||function(e){return"DETAILS"===e.tagName&&Array.prototype.slice.apply(e.children).some(function(e){return"SUMMARY"===e.tagName})}(t)||function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if("FIELDSET"===t.tagName&&t.disabled){for(var n=0;n<t.children.length;n++){var o=t.children.item(n);if("LEGEND"===o.tagName)return!!kp.call(t,"fieldset[disabled] *")||!o.contains(e)}return!0}t=t.parentElement}return!1}(t))},Tp=function(e,t){return!(function(e){return function(e){return Op(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t,n=e.form||yp(e),o=function(e){return n.querySelectorAll('input[type="radio"][name="'+e+'"]')};if("undefined"!=typeof window&&void 0!==window.CSS&&"function"==typeof window.CSS.escape)t=o(window.CSS.escape(e.name));else try{t=o(e.name)}catch(e){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",e.message),!1}var a=function(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]}(t,e.form);return!a||a===e}(e)}(t)||Sp(t)<0||!Mp(e,t))},Rp=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},Ip=function e(t){var n=[],o=[];return t.forEach(function(t,a){var r=!!t.scopeParent,s=r?t.scopeParent:t,i=function(e,t){var n=Sp(e);return n<0&&t&&!jp(e)?0:n}(s,r),l=r?e(t.candidates):s;0===i?r?n.push.apply(n,l):n.push(s):o.push({documentOrder:a,tabIndex:i,item:t,isScope:r,content:l})}),o.sort(Np).reduce(function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e},[]).concat(n)},Pp=function(e,t){var n;return n=(t=t||{}).getShadowRoot?Cp([e],t.includeContainer,{filter:Tp.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:Rp}):function(e,t,n){if(_p(e))return[];var o=Array.prototype.slice.apply(e.querySelectorAll(vp));return t&&kp.call(e,vp)&&o.unshift(e),o.filter(n)}(e,t.includeContainer,Tp.bind(null,t)),Ip(n)};function Lp(){return/apple/i.test(navigator.vendor)}function Ap(){return function(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(e=>{let{brand:t,version:n}=e;return t+"/"+n}).join(" "):navigator.userAgent}().includes("jsdom/")}const Dp="data-floating-ui-focusable",Fp="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function Vp(e){let t=e.activeElement;for(;null!=(null==(n=t)||null==(n=n.shadowRoot)?void 0:n.activeElement);){var n;t=t.shadowRoot.activeElement}return t}function Bp(e,t){if(!e||!t)return!1;const n=null==t.getRootNode?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&Rs(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function zp(e){return"composedPath"in e?e.composedPath()[0]:e.target}function Hp(e,t){if(null==t)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return null!=n.target&&t.contains(n.target)}function Up(e){return(null==e?void 0:e.ownerDocument)||document}function Gp(e,t,n){void 0===n&&(n=!0);const o=e.filter(e=>{var o;return e.parentId===t&&(!n||(null==(o=e.context)?void 0:o.open))});return o.flatMap(t=>[t,...Gp(e,t.id,n)])}function $p(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}var Wp="undefined"!=typeof document?e.useLayoutEffect:function(){};function qp(t){const n=e.useRef(t);return Wp(()=>{n.current=t}),n}const Xp={...t}.useInsertionEffect||(e=>e());function Jp(t){const n=e.useRef(()=>{});return Xp(()=>{n.current=t}),e.useCallback(function(){for(var e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];return null==n.current?void 0:n.current(...t)},[])}const Kp=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function Yp(e,t){const n=Pp(e,Kp()),o=n.length;if(0===o)return;const a=Vp(Up(e)),r=n.indexOf(a);return n[-1===r?1===t?0:o-1:r+t]}function Zp(e,t){const n=t||e.currentTarget,o=e.relatedTarget;return!o||!Bp(n,o)}function Qp(e){Pp(e,Kp()).forEach(e=>{e.dataset.tabindex=e.getAttribute("tabindex")||"",e.setAttribute("tabindex","-1")})}function eh(e){e.querySelectorAll("[data-tabindex]").forEach(e=>{const t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute("tabindex",t):e.removeAttribute("tabindex")})}var th="undefined"!=typeof document?e.useLayoutEffect:function(){};function nh(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let n,o,a;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(o=n;0!==o--;)if(!nh(e[o],t[o]))return!1;return!0}if(a=Object.keys(e),n=a.length,n!==Object.keys(t).length)return!1;for(o=n;0!==o--;)if(!{}.hasOwnProperty.call(t,a[o]))return!1;for(o=n;0!==o--;){const n=a[o];if(!("_owner"===n&&e.$$typeof||nh(e[n],t[n])))return!1}return!0}return e!=e&&t!=t}function oh(e){return"undefined"==typeof window?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function ah(e,t){const n=oh(e);return Math.round(t*n)/n}function rh(t){const n=e.useRef(t);return th(()=>{n.current=t}),n}const sh=(e,t)=>({...mi(e),options:[e,t]}),ih=(e,t)=>({...gi(e),options:[e,t]}),lh=(e,t)=>({...vi(e),options:[e,t]}),ch="data-floating-ui-focusable",uh="active",dh="selected",ph={...t};let hh=!1,fh=0;const bh=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+fh++,mh=ph.useId||function(){const[t,n]=e.useState(()=>hh?bh():void 0);return Wp(()=>{null==t&&n(bh())},[]),e.useEffect(()=>{hh=!0},[]),t};const gh=e.createContext(null),vh=e.createContext(null),xh=()=>{var t;return(null==(t=e.useContext(gh))?void 0:t.id)||null},kh=()=>e.useContext(vh);function yh(e){return"data-floating-ui-"+e}function _h(e){-1!==e.current&&(clearTimeout(e.current),e.current=-1)}const wh=yh("safe-polygon");function Ch(e,t,n){if(n&&!$p(n))return 0;if("number"==typeof e)return e;if("function"==typeof e){const n=e();return"number"==typeof n?n:null==n?void 0:n[t]}return null==e?void 0:e[t]}function jh(e){return"function"==typeof e?e():e}const Sh={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0},Nh=e.forwardRef(function(t,n){const[o,a]=e.useState();Wp(()=>{Lp()&&a("button")},[]);const r={ref:n,tabIndex:0,role:o,"aria-hidden":!o||void 0,[yh("focus-guard")]:"",style:Sh};return(0,_o.jsx)("span",{...t,...r})}),Oh=e.createContext(null),Eh=yh("portal");function Mh(t){const{children:n,id:o,root:a,preserveTabOrder:r=!0}=t,s=function(t){void 0===t&&(t={});const{id:n,root:o}=t,a=mh(),r=Th(),[s,i]=e.useState(null),l=e.useRef(null);return Wp(()=>()=>{null==s||s.remove(),queueMicrotask(()=>{l.current=null})},[s]),Wp(()=>{if(!a)return;if(l.current)return;const e=n?document.getElementById(n):null;if(!e)return;const t=document.createElement("div");t.id=a,t.setAttribute(Eh,""),e.appendChild(t),l.current=t,i(t)},[n,a]),Wp(()=>{if(null===o)return;if(!a)return;if(l.current)return;let e=o||(null==r?void 0:r.portalNode);e&&!Ms(e)&&(e=e.current),e=e||document.body;let t=null;n&&(t=document.createElement("div"),t.id=n,e.appendChild(t));const s=document.createElement("div");s.id=a,s.setAttribute(Eh,""),e=t||e,e.appendChild(s),l.current=s,i(s)},[n,o,a,r]),s}({id:o,root:a}),[i,l]=e.useState(null),c=e.useRef(null),u=e.useRef(null),d=e.useRef(null),p=e.useRef(null),h=null==i?void 0:i.modal,f=null==i?void 0:i.open,b=!!i&&!i.modal&&i.open&&r&&!(!a&&!s);return e.useEffect(()=>{if(s&&r&&!h)return s.addEventListener("focusin",e,!0),s.addEventListener("focusout",e,!0),()=>{s.removeEventListener("focusin",e,!0),s.removeEventListener("focusout",e,!0)};function e(e){s&&Zp(e)&&("focusin"===e.type?eh:Qp)(s)}},[s,r,h]),e.useEffect(()=>{s&&(f||eh(s))},[f,s]),(0,_o.jsxs)(Oh.Provider,{value:e.useMemo(()=>({preserveTabOrder:r,beforeOutsideRef:c,afterOutsideRef:u,beforeInsideRef:d,afterInsideRef:p,portalNode:s,setFocusManagerState:l}),[r,s]),children:[b&&s&&(0,_o.jsx)(Nh,{"data-type":"outside",ref:c,onFocus:e=>{if(Zp(e,s)){var t;null==(t=d.current)||t.focus()}else{const e=Yp(Up(n=i?i.domReference:null).body,-1)||n;null==e||e.focus()}var n}}),b&&s&&(0,_o.jsx)("span",{"aria-owns":s.id,style:Sh}),s&&Zr.createPortal(n,s),b&&s&&(0,_o.jsx)(Nh,{"data-type":"outside",ref:u,onFocus:e=>{if(Zp(e,s)){var t;null==(t=p.current)||t.focus()}else{const t=Yp(Up(n=i?i.domReference:null).body,1)||n;null==t||t.focus(),(null==i?void 0:i.closeOnFocusOut)&&(null==i||i.onOpenChange(!1,e.nativeEvent,"focus-out"))}var n}})]})}const Th=()=>e.useContext(Oh),Rh={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},Ih={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},Ph=e=>{var t,n;return{escapeKey:"boolean"==typeof e?e:null!=(t=null==e?void 0:e.escapeKey)&&t,outsidePress:"boolean"==typeof e?e:null==(n=null==e?void 0:e.outsidePress)||n}};function Lh(t){void 0===t&&(t={});const{nodeId:n}=t,o=function(t){const{open:n=!1,onOpenChange:o,elements:a}=t,r=mh(),s=e.useRef({}),[i]=e.useState(()=>function(){const e=new Map;return{emit(t,n){var o;null==(o=e.get(t))||o.forEach(e=>e(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var o;null==(o=e.get(t))||o.delete(n)}}}()),l=null!=xh(),[c,u]=e.useState(a.reference),d=Jp((e,t,n)=>{s.current.openEvent=e?t:void 0,i.emit("openchange",{open:e,event:t,reason:n,nested:l}),null==o||o(e,t,n)}),p=e.useMemo(()=>({setPositionReference:u}),[]),h=e.useMemo(()=>({reference:c||a.reference||null,floating:a.floating||null,domReference:a.reference}),[c,a.reference,a.floating]);return e.useMemo(()=>({dataRef:s,open:n,onOpenChange:d,elements:h,events:i,floatingId:r,refs:p}),[n,d,h,i,r,p])}({...t,elements:{reference:null,floating:null,...t.elements}}),a=t.rootContext||o,r=a.elements,[s,i]=e.useState(null),[l,c]=e.useState(null),u=(null==r?void 0:r.domReference)||s,d=e.useRef(null),p=kh();Wp(()=>{u&&(d.current=u)},[u]);const h=function(t){void 0===t&&(t={});const{placement:n="bottom",strategy:o="absolute",middleware:a=[],platform:r,elements:{reference:s,floating:i}={},transform:l=!0,whileElementsMounted:c,open:u}=t,[d,p]=e.useState({x:0,y:0,strategy:o,placement:n,middlewareData:{},isPositioned:!1}),[h,f]=e.useState(a);nh(h,a)||f(a);const[b,m]=e.useState(null),[g,v]=e.useState(null),x=e.useCallback(e=>{e!==w.current&&(w.current=e,m(e))},[]),k=e.useCallback(e=>{e!==C.current&&(C.current=e,v(e))},[]),y=s||b,_=i||g,w=e.useRef(null),C=e.useRef(null),j=e.useRef(d),S=null!=c,N=rh(c),O=rh(r),E=rh(u),M=e.useCallback(()=>{if(!w.current||!C.current)return;const e={placement:n,strategy:o,middleware:h};O.current&&(e.platform=O.current),xi(w.current,C.current,e).then(e=>{const t={...e,isPositioned:!1!==E.current};T.current&&!nh(j.current,t)&&(j.current=t,Zr.flushSync(()=>{p(t)}))})},[h,n,o,O,E]);th(()=>{!1===u&&j.current.isPositioned&&(j.current.isPositioned=!1,p(e=>({...e,isPositioned:!1})))},[u]);const T=e.useRef(!1);th(()=>(T.current=!0,()=>{T.current=!1}),[]),th(()=>{if(y&&(w.current=y),_&&(C.current=_),y&&_){if(N.current)return N.current(y,_,M);M()}},[y,_,M,N,S]);const R=e.useMemo(()=>({reference:w,floating:C,setReference:x,setFloating:k}),[x,k]),I=e.useMemo(()=>({reference:y,floating:_}),[y,_]),P=e.useMemo(()=>{const e={position:o,left:0,top:0};if(!I.floating)return e;const t=ah(I.floating,d.x),n=ah(I.floating,d.y);return l?{...e,transform:"translate("+t+"px, "+n+"px)",...oh(I.floating)>=1.5&&{willChange:"transform"}}:{position:o,left:t,top:n}},[o,l,I.floating,d.x,d.y]);return e.useMemo(()=>({...d,update:M,refs:R,elements:I,floatingStyles:P}),[d,M,R,I,P])}({...t,elements:{...r,...l&&{reference:l}}}),f=e.useCallback(e=>{const t=Ms(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;c(t),h.refs.setReference(t)},[h.refs]),b=e.useCallback(e=>{(Ms(e)||null===e)&&(d.current=e,i(e)),(Ms(h.refs.reference.current)||null===h.refs.reference.current||null!==e&&!Ms(e))&&h.refs.setReference(e)},[h.refs]),m=e.useMemo(()=>({...h.refs,setReference:b,setPositionReference:f,domReference:d}),[h.refs,b,f]),g=e.useMemo(()=>({...h.elements,domReference:u}),[h.elements,u]),v=e.useMemo(()=>({...h,...a,refs:m,elements:g,nodeId:n}),[h,m,g,n,a]);return Wp(()=>{a.dataRef.current.floatingContext=v;const e=null==p?void 0:p.nodesRef.current.find(e=>e.id===n);e&&(e.context=v)}),e.useMemo(()=>({...h,context:v,refs:m,elements:g}),[h,m,g,v])}function Ah(){return function(){const e=navigator.userAgentData;return null!=e&&e.platform?e.platform:navigator.platform}().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints&&Lp()}function Dh(t,n){void 0===n&&(n={});const{open:o,onOpenChange:a,events:r,dataRef:s,elements:i}=t,{enabled:l=!0,visibleOnly:c=!0}=n,u=e.useRef(!1),d=e.useRef(-1),p=e.useRef(!0);e.useEffect(()=>{if(!l)return;const e=Ns(i.domReference);function t(){!o&&Ts(i.domReference)&&i.domReference===Vp(Up(i.domReference))&&(u.current=!0)}function n(){p.current=!0}function a(){p.current=!1}return e.addEventListener("blur",t),Ah()&&(e.addEventListener("keydown",n,!0),e.addEventListener("pointerdown",a,!0)),()=>{e.removeEventListener("blur",t),Ah()&&(e.removeEventListener("keydown",n,!0),e.removeEventListener("pointerdown",a,!0))}},[i.domReference,o,l]),e.useEffect(()=>{if(l)return r.on("openchange",e),()=>{r.off("openchange",e)};function e(e){let{reason:t}=e;"reference-press"!==t&&"escape-key"!==t||(u.current=!0)}},[r,l]),e.useEffect(()=>()=>{_h(d)},[]);const h=e.useMemo(()=>({onMouseLeave(){u.current=!1},onFocus(e){if(u.current)return;const t=zp(e.nativeEvent);if(c&&Ms(t))if(Ah()&&!e.relatedTarget){if(!p.current&&(!Ts(n=t)||!n.matches(Fp)))return}else if(!function(e){if(!e||Ap())return!0;try{return e.matches(":focus-visible")}catch(e){return!0}}(t))return;var n;a(!0,e.nativeEvent,"focus")},onBlur(e){u.current=!1;const t=e.relatedTarget,n=e.nativeEvent,o=Ms(t)&&t.hasAttribute(yh("focus-guard"))&&"outside"===t.getAttribute("data-type");d.current=window.setTimeout(()=>{var e;const r=Vp(i.domReference?i.domReference.ownerDocument:document);(t||r!==i.domReference)&&(Bp(null==(e=s.current.floatingContext)?void 0:e.refs.floating.current,r)||Bp(i.domReference,r)||o||a(!1,n,"focus"))})}}),[s,i.domReference,a,c]);return e.useMemo(()=>l?{reference:h}:{},[l,h])}function Fh(e,t,n){const o=new Map,a="item"===n;let r=e;if(a&&e){const{[uh]:t,[dh]:__,...n}=e;r=n}return{..."floating"===n&&{tabIndex:-1,[ch]:""},...r,...t.map(t=>{const o=t?t[n]:null;return"function"==typeof o?e?o(e):null:o}).concat(e).reduce((e,t)=>t?(Object.entries(t).forEach(t=>{let[n,r]=t;var s;a&&[uh,dh].includes(n)||(0===n.indexOf("on")?(o.has(n)||o.set(n,[]),"function"==typeof r&&(null==(s=o.get(n))||s.push(r),e[n]=function(){for(var e,t=arguments.length,a=new Array(t),r=0;r<t;r++)a[r]=arguments[r];return null==(e=o.get(n))?void 0:e.map(e=>e(...a)).find(e=>void 0!==e)})):e[n]=r)}),e):e,{})}}const Vh=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function Bh({children:t,text:n,className:o,TagName:a="span",placement:r="top"}){if(!n)return(0,_o.jsx)(a,{className:"tooltip-ref-wrap"+(o?" "+o:""),children:t});const[s,i]=(0,ko.useState)(!1);let l=r;switch(r){case"auto":l="top";break;case"auto-start":l="top-start";break;case"auto-end":l="top-end"}const{refs:c,floatingStyles:u,context:d}=Lh({open:s,onOpenChange:i,placement:l,whileElementsMounted:bi,middleware:[sh(5),lh({fallbackAxisSideDirection:"start"}),ih()]}),p=function(t,n){void 0===n&&(n={});const{open:o,onOpenChange:a,dataRef:r,events:s,elements:i}=t,{enabled:l=!0,delay:c=0,handleClose:u=null,mouseOnly:d=!1,restMs:p=0,move:h=!0}=n,f=kh(),b=xh(),m=qp(u),g=qp(c),v=qp(o),x=qp(p),k=e.useRef(),y=e.useRef(-1),_=e.useRef(),w=e.useRef(-1),C=e.useRef(!0),j=e.useRef(!1),S=e.useRef(()=>{}),N=e.useRef(!1),O=Jp(()=>{var e;const t=null==(e=r.current.openEvent)?void 0:e.type;return(null==t?void 0:t.includes("mouse"))&&"mousedown"!==t});e.useEffect(()=>{if(l)return s.on("openchange",e),()=>{s.off("openchange",e)};function e(e){let{open:t}=e;t||(_h(y),_h(w),C.current=!0,N.current=!1)}},[l,s]),e.useEffect(()=>{if(!l)return;if(!m.current)return;if(!o)return;function e(e){O()&&a(!1,e,"hover")}const t=Up(i.floating).documentElement;return t.addEventListener("mouseleave",e),()=>{t.removeEventListener("mouseleave",e)}},[i.floating,o,a,l,m,O]);const E=e.useCallback(function(e,t,n){void 0===t&&(t=!0),void 0===n&&(n="hover");const o=Ch(g.current,"close",k.current);o&&!_.current?(_h(y),y.current=window.setTimeout(()=>a(!1,e,n),o)):t&&(_h(y),a(!1,e,n))},[g,a]),M=Jp(()=>{S.current(),_.current=void 0}),T=Jp(()=>{if(j.current){const e=Up(i.floating).body;e.style.pointerEvents="",e.removeAttribute(wh),j.current=!1}}),R=Jp(()=>!!r.current.openEvent&&["click","mousedown"].includes(r.current.openEvent.type));e.useEffect(()=>{if(l&&Ms(i.domReference)){const a=i.domReference,r=i.floating;return o&&a.addEventListener("mouseleave",n),h&&a.addEventListener("mousemove",e,{once:!0}),a.addEventListener("mouseenter",e),a.addEventListener("mouseleave",t),r&&(r.addEventListener("mouseleave",n),r.addEventListener("mouseenter",s),r.addEventListener("mouseleave",c)),()=>{o&&a.removeEventListener("mouseleave",n),h&&a.removeEventListener("mousemove",e),a.removeEventListener("mouseenter",e),a.removeEventListener("mouseleave",t),r&&(r.removeEventListener("mouseleave",n),r.removeEventListener("mouseenter",s),r.removeEventListener("mouseleave",c))}}function e(e){if(_h(y),C.current=!1,d&&!$p(k.current)||jh(x.current)>0&&!Ch(g.current,"open"))return;const t=Ch(g.current,"open",k.current);t?y.current=window.setTimeout(()=>{v.current||a(!0,e,"hover")},t):o||a(!0,e,"hover")}function t(e){if(R())return void T();S.current();const t=Up(i.floating);if(_h(w),N.current=!1,m.current&&r.current.floatingContext){o||_h(y),_.current=m.current({...r.current.floatingContext,tree:f,x:e.clientX,y:e.clientY,onClose(){T(),M(),R()||E(e,!0,"safe-polygon")}});const n=_.current;return t.addEventListener("mousemove",n),void(S.current=()=>{t.removeEventListener("mousemove",n)})}("touch"!==k.current||!Bp(i.floating,e.relatedTarget))&&E(e)}function n(e){R()||r.current.floatingContext&&(null==m.current||m.current({...r.current.floatingContext,tree:f,x:e.clientX,y:e.clientY,onClose(){T(),M(),R()||E(e)}})(e))}function s(){_h(y)}function c(e){R()||E(e,!1)}},[i,l,t,d,h,E,M,T,a,o,v,f,g,m,r,R,x]),Wp(()=>{var e;if(l&&o&&null!=(e=m.current)&&null!=(e=e.__options)&&e.blockPointerEvents&&O()){j.current=!0;const e=i.floating;if(Ms(i.domReference)&&e){var t;const n=Up(i.floating).body;n.setAttribute(wh,"");const o=i.domReference,a=null==f||null==(t=f.nodesRef.current.find(e=>e.id===b))||null==(t=t.context)?void 0:t.elements.floating;return a&&(a.style.pointerEvents=""),n.style.pointerEvents="none",o.style.pointerEvents="auto",e.style.pointerEvents="auto",()=>{n.style.pointerEvents="",o.style.pointerEvents="",e.style.pointerEvents=""}}}},[l,o,b,i,f,m,O]),Wp(()=>{o||(k.current=void 0,N.current=!1,M(),T())},[o,M,T]),e.useEffect(()=>()=>{M(),_h(y),_h(w),T()},[l,i.domReference,M,T]);const I=e.useMemo(()=>{function e(e){k.current=e.pointerType}return{onPointerDown:e,onPointerEnter:e,onMouseMove(e){const{nativeEvent:t}=e;function n(){C.current||v.current||a(!0,t,"hover")}d&&!$p(k.current)||o||0===jh(x.current)||N.current&&e.movementX**2+e.movementY**2<2||(_h(w),"touch"===k.current?n():(N.current=!0,w.current=window.setTimeout(n,jh(x.current))))}}},[d,a,o,v,x]);return e.useMemo(()=>l?{reference:I}:{},[l,I])}(d,{move:!1}),h=Dh(d),f=function(t,n){void 0===n&&(n={});const{open:o,onOpenChange:a,elements:r,dataRef:s}=t,{enabled:i=!0,escapeKey:l=!0,outsidePress:c=!0,outsidePressEvent:u="pointerdown",referencePress:d=!1,referencePressEvent:p="pointerdown",ancestorScroll:h=!1,bubbles:f,capture:b}=n,m=kh(),g=Jp("function"==typeof c?c:()=>!1),v="function"==typeof c?g:c,x=e.useRef(!1),{escapeKey:k,outsidePress:y}=Ph(f),{escapeKey:_,outsidePress:w}=Ph(b),C=e.useRef(!1),j=e.useRef(-1),S=Jp(e=>{var t;if(!o||!i||!l||"Escape"!==e.key)return;if(C.current)return;const n=null==(t=s.current.floatingContext)?void 0:t.nodeId,r=m?Gp(m.nodesRef.current,n):[];if(!k&&(e.stopPropagation(),r.length>0)){let e=!0;if(r.forEach(t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__escapeKeyBubbles||(e=!1)}),!e)return}a(!1,function(e){return"nativeEvent"in e}(e)?e.nativeEvent:e,"escape-key")}),N=Jp(e=>{var t;const n=()=>{var t;S(e),null==(t=zp(e))||t.removeEventListener("keydown",n)};null==(t=zp(e))||t.addEventListener("keydown",n)}),O=Jp(e=>{var t;const n=s.current.insideReactTree;s.current.insideReactTree=!1;const o=x.current;if(x.current=!1,"click"===u&&o)return;if(n)return;if("function"==typeof v&&!v(e))return;const i=zp(e),l="["+yh("inert")+"]",c=Up(r.floating).querySelectorAll(l);let d=Ms(i)?i:null;for(;d&&!$s(d);){const e=Xs(d);if($s(e)||!Ms(e))break;d=e}if(c.length&&Ms(i)&&!i.matches("html,body")&&!Bp(i,r.floating)&&Array.from(c).every(e=>!Bp(d,e)))return;if(Ts(i)&&T){const t=$s(i),n=Ws(i),o=/auto|scroll/,a=t||o.test(n.overflowX),r=t||o.test(n.overflowY),s=a&&i.clientWidth>0&&i.scrollWidth>i.clientWidth,l=r&&i.clientHeight>0&&i.scrollHeight>i.clientHeight,c="rtl"===n.direction,u=l&&(c?e.offsetX<=i.offsetWidth-i.clientWidth:e.offsetX>i.clientWidth),d=s&&e.offsetY>i.clientHeight;if(u||d)return}const p=null==(t=s.current.floatingContext)?void 0:t.nodeId,h=m&&Gp(m.nodesRef.current,p).some(t=>{var n;return Hp(e,null==(n=t.context)?void 0:n.elements.floating)});if(Hp(e,r.floating)||Hp(e,r.domReference)||h)return;const f=m?Gp(m.nodesRef.current,p):[];if(f.length>0){let e=!0;if(f.forEach(t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__outsidePressBubbles||(e=!1)}),!e)return}a(!1,e,"outside-press")}),E=Jp(e=>{var t;const n=()=>{var t;O(e),null==(t=zp(e))||t.removeEventListener(u,n)};null==(t=zp(e))||t.addEventListener(u,n)});e.useEffect(()=>{if(!o||!i)return;s.current.__escapeKeyBubbles=k,s.current.__outsidePressBubbles=y;let e=-1;function t(e){a(!1,e,"ancestor-scroll")}function n(){window.clearTimeout(e),C.current=!0}function c(){e=window.setTimeout(()=>{C.current=!1},Us()?5:0)}const d=Up(r.floating);l&&(d.addEventListener("keydown",_?N:S,_),d.addEventListener("compositionstart",n),d.addEventListener("compositionend",c)),v&&d.addEventListener(u,w?E:O,w);let p=[];return h&&(Ms(r.domReference)&&(p=Ks(r.domReference)),Ms(r.floating)&&(p=p.concat(Ks(r.floating))),!Ms(r.reference)&&r.reference&&r.reference.contextElement&&(p=p.concat(Ks(r.reference.contextElement)))),p=p.filter(e=>{var t;return e!==(null==(t=d.defaultView)?void 0:t.visualViewport)}),p.forEach(e=>{e.addEventListener("scroll",t,{passive:!0})}),()=>{l&&(d.removeEventListener("keydown",_?N:S,_),d.removeEventListener("compositionstart",n),d.removeEventListener("compositionend",c)),v&&d.removeEventListener(u,w?E:O,w),p.forEach(e=>{e.removeEventListener("scroll",t)}),window.clearTimeout(e)}},[s,r,l,v,u,o,a,h,i,k,y,S,_,N,O,w,E]),e.useEffect(()=>{s.current.insideReactTree=!1},[s,v,u]);const M=e.useMemo(()=>({onKeyDown:S,...d&&{[Rh[p]]:e=>{a(!1,e.nativeEvent,"reference-press")},..."click"!==p&&{onClick(e){a(!1,e.nativeEvent,"reference-press")}}}}),[S,a,d,p]),T=e.useMemo(()=>({onKeyDown:S,onMouseDown(){x.current=!0},onMouseUp(){x.current=!0},[Ih[u]]:()=>{s.current.insideReactTree=!0},onBlurCapture(){m||(_h(j),s.current.insideReactTree=!0,j.current=window.setTimeout(()=>{s.current.insideReactTree=!1}))}}),[S,u,s,m]);return e.useMemo(()=>i?{reference:M,floating:T}:{},[i,M,T])}(d),b=function(t,n){var o,a;void 0===n&&(n={});const{open:r,elements:s,floatingId:i}=t,{enabled:l=!0,role:c="dialog"}=n,u=mh(),d=(null==(o=s.domReference)?void 0:o.id)||u,p=e.useMemo(()=>{var e,t;return(null==(e=(t=s.floating)?t.hasAttribute(Dp)?t:t.querySelector("["+Dp+"]")||t:null)?void 0:e.id)||i},[s.floating,i]),h=null!=(a=Vh.get(c))?a:c,f=null!=xh(),b=e.useMemo(()=>"tooltip"===h||"label"===c?{["aria-"+("label"===c?"labelledby":"describedby")]:r?p:void 0}:{"aria-expanded":r?"true":"false","aria-haspopup":"alertdialog"===h?"dialog":h,"aria-controls":r?p:void 0,..."listbox"===h&&{role:"combobox"},..."menu"===h&&{id:d},..."menu"===h&&f&&{role:"menuitem"},..."select"===c&&{"aria-autocomplete":"none"},..."combobox"===c&&{"aria-autocomplete":"list"}},[h,p,f,r,d,c]),m=e.useMemo(()=>{const e={id:p,...h&&{role:h}};return"tooltip"===h||"label"===c?e:{...e,..."menu"===h&&{"aria-labelledby":d}}},[h,p,d,c]),g=e.useCallback(e=>{let{active:t,selected:n}=e;const o={role:"option",...t&&{id:p+"-fui-option"}};switch(c){case"select":return{...o,"aria-selected":t&&n};case"combobox":return{...o,"aria-selected":n}}return{}},[p,c]);return e.useMemo(()=>l?{reference:b,floating:m,item:g}:{},[l,b,m,g])}(d,{role:"tooltip"}),{getReferenceProps:m,getFloatingProps:g}=function(t){void 0===t&&(t=[]);const n=t.map(e=>null==e?void 0:e.reference),o=t.map(e=>null==e?void 0:e.floating),a=t.map(e=>null==e?void 0:e.item),r=e.useCallback(e=>Fh(e,t,"reference"),n),s=e.useCallback(e=>Fh(e,t,"floating"),o),i=e.useCallback(e=>Fh(e,t,"item"),a);return e.useMemo(()=>({getReferenceProps:r,getFloatingProps:s,getItemProps:i}),[r,s,i])}([p,h,f,b]);return(0,_o.jsxs)(_o.Fragment,{children:[(0,_o.jsx)(a,{className:"tooltip-ref-wrap tooltip-ref-has-tip"+(o?" "+o:""),ref:c.setReference,...m(),children:t}),(0,_o.jsx)(Mh,{children:s&&(0,_o.jsxs)("div",{className:"kb-floating-tooltip",ref:c.setFloating,style:u,...g(),"data-placement":l,children:[(0,_o.jsx)("span",{className:"kb-tooltip-content",dangerouslySetInnerHTML:{__html:(v=n,x="<br><b><i><u><p><ol><ul><li><strong><small>",x=(((x||"")+"").toLowerCase().match(/<[a-z][a-z0-9]*>/g)||[]).join(""),v.replace(/<!--[\s\S]*?-->|<\?(?:php)?[\s\S]*?\?>/gi,"").replace(/<\/?([a-z][a-z0-9]*)\b[^>]*>/gi,function(e,t){return x.indexOf("<"+t.toLowerCase()+">")>-1?e:""}))}}),(0,_o.jsx)("span",{className:"kb-tooltip-arrow"})]})})]});var v,x}function zh({children:e}){return(0,_o.jsx)("div",{className:"components-base-control kadence-color-group",children:e})}function Hh({children:e}){return(0,_o.jsx)("div",{className:"components-base-control kadence-two-column-group",children:e})}class Uh extends ko.Component{constructor(){super(...arguments),this.toggle=this.toggle.bind(this),this.state={open:!1},this.popRef=(0,ko.createRef)(),this.debouncedToggle=(0,Oo.debounce)(this.toggle.bind(this),100)}toggle(){this.setState({open:!this.state.open})}render(){const{open:e}=this.state;let t={};return t.dynamic=(0,_o.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",children:(0,_o.jsx)("path",{d:"M4 5.002s.003-.095.213-.288c.245-.225.671-.483 1.306-.73C7.018 3.399 9.34 3 12 3s4.982.399 6.482.984c.634.247 1.061.505 1.306.73.205.189.212.281.212.288 0 .003-.007.095-.213.284-.245.225-.671.483-1.306.73C16.982 6.601 14.66 7 12 7s-4.982-.399-6.482-.984c-.634-.247-1.061-.505-1.306-.73C4.004 5.094 4 5.002 4 5.002zm16 9.53v4.471a.779.779 0 01-.217.291c-.245.225-.671.482-1.303.728-1.495.582-3.809.978-6.48.978s-4.985-.396-6.48-.978c-.633-.246-1.058-.503-1.303-.728a.865.865 0 01-.199-.242l-.006-4.514c.248.126.51.242.782.348C6.591 15.585 9.171 16 12 16s5.409-.415 7.206-1.114c.277-.108.543-.225.794-.354zm0-7.005v4.476a.779.779 0 01-.217.291c-.245.225-.671.482-1.303.728-1.495.582-3.809.978-6.48.978s-4.985-.396-6.48-.978c-.633-.246-1.058-.503-1.303-.728a.865.865 0 01-.199-.242 1.109 1.109 0 00-.009-.117l-.005-4.407c.248.128.513.244.788.352C6.593 8.582 9.18 9 12 9s5.407-.418 7.208-1.12A8.69 8.69 0 0020 7.527zM2 5v14c0 .058.002.116.007.174.057.665.425 1.197.857 1.594.498.457 1.175.824 1.93 1.118C6.591 22.585 9.171 23 12 23s5.409-.415 7.206-1.114c.755-.294 1.432-.661 1.93-1.118.432-.397.8-.929.857-1.594.005-.058.007-.116.007-.174V5c0-.056-.002-.112-.007-.168-.055-.664-.422-1.195-.852-1.59-.498-.459-1.177-.827-1.933-1.122C17.407 1.418 14.82 1 12 1s-5.407.418-7.208 1.12c-.756.295-1.435.664-1.933 1.122-.43.395-.797.927-.852 1.59A1.887 1.887 0 002 5z"})}),(0,_o.jsxs)(ko.Fragment,{children:[(0,_o.jsx)(yo.Button,{className:"kb-dynamic-url-sidebar",icon:t.dynamic,onClick:()=>this.debouncedToggle(),isPressed:!1,"aria-haspopup":"true","aria-expanded":e,label:(0,Mo.__)("Dynamic Link","kadence-blocks"),showTooltip:!0}),e&&(0,_o.jsx)(yo.Popover,{className:"kb-dynamic-popover",position:"bottom left",onClick:()=>{},expandOnMobile:!0,onClose:()=>this.debouncedToggle(),ref:this.popRef,children:(0,_o.jsx)("div",{className:"kb-dynamic-popover-inner-wrap",children:(0,_o.jsxs)("div",{className:"kb-pro-notice",children:[(0,_o.jsxs)("h2",{children:[(0,Mo.__)("Dynamic links","kadence-blocks")," "]}),(0,_o.jsxs)("p",{children:[(0,Mo.__)("Create dynamic sites by populating links from various sources.","kadence-blocks")," "]}),(0,_o.jsx)(yo.ExternalLink,{href:"https://www.kadencewp.com/kadence-blocks/pro/?utm_source=in-app&utm_medium=kadence-blocks&utm_campaign=dynamic-content",children:(0,Mo.__)("Upgrade to Pro","kadence-blocks")})]})})})]})}}const Gh=(0,yo.withFilters)("kadence.URLInputDynamicControl")(Uh),$h=window.wp.htmlEntities;function Wh(e){const t=[];return t.push(Vd()({path:(0,hc.addQueryArgs)("/wp/v2/search",{search:e,per_page:20,type:"post"})}).catch(()=>[])),Promise.all(t).then(e=>(0,Oo.map)((0,Oo.flatten)(e).slice(0,20),e=>({id:e.id,url:e.url,title:(0,$h.decodeEntities)(e.title)||(0,Mo.__)("(no title)"),type:e.subtype||e.type})))}const qh=(0,_o.jsx)(Ho.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,_o.jsx)(Ho.Path,{d:"m13.06 12 6.47-6.47-1.06-1.06L12 10.94 5.53 4.47 4.47 5.53 10.94 12l-6.47 6.47 1.06 1.06L12 13.06l6.47 6.47 1.06-1.06L13.06 12Z"})}),Xh="none",Jh="custom",Kh="media",Yh="attachment",Zh=(0,_o.jsxs)(yo.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:[(0,_o.jsx)(yo.Path,{d:"M0,0h24v24H0V0z",fill:"none"}),(0,_o.jsx)(yo.Path,{d:"m19 5v14h-14v-14h14m0-2h-14c-1.1 0-2 0.9-2 2v14c0 1.1 0.9 2 2 2h14c1.1 0 2-0.9 2-2v-14c0-1.1-0.9-2-2-2z"}),(0,_o.jsx)(yo.Path,{d:"m14.14 11.86l-3 3.87-2.14-2.59-3 3.86h12l-3.86-5.14z"})]}),Qh=({linkDestination:e="none",onChangeUrl:t,url:n,mediaType:o="image",mediaUrl:a,mediaLink:r,onChangeAttribute:s,onChangeLinkDestination:i,additionalControls:l=!0,opensInNewTab:c,onChangeTarget:u,linkNoFollow:d,onChangeFollow:p,linkSponsored:h,onChangeSponsored:f,linkDownload:b,onChangeDownload:m,linkTitle:g,onChangeTitle:v,onChangeLinkClass:x,linkClass:k,changeTargetType:y=!1})=>{const[_,w]=(0,ko.useState)(!1),C=(0,ko.useCallback)(()=>{w(!0)}),[j,S]=(0,ko.useState)(!1),[N,O]=(0,ko.useState)(null),E=(0,ko.useRef)(null),M=(0,ko.useCallback)(()=>{e!==Kh&&e!==Yh||O(""),S(!0)}),T=(0,ko.useCallback)(()=>{S(!1)}),R=(0,ko.useCallback)(()=>{O(null),T(),w(!1)}),I=(0,ko.useCallback)(()=>e=>{const t=E.current;t&&t.contains(e.target)||(w(!1),O(null),T())}),P=(0,ko.useCallback)(()=>e=>{if(N){const e=A().find(e=>e.url===N)?.linkDestination||Jh;s?s({link:N,linkDestination:e}):(t(N),i&&i(e))}T(),O(null),e.preventDefault()}),L=(0,ko.useCallback)(()=>{s?s({link:"",linkDestination:Xh}):(t(""),i&&i(Xh))}),A=()=>{const e=[{linkDestination:Kh,title:(0,Mo.__)("Media File"),url:"image"===o?a:void 0,icon:Zh}];return"image"===o&&r&&e.push({linkDestination:Yh,title:(0,Mo.__)("Attachment Page"),url:"image"===o?r:void 0,icon:(0,_o.jsxs)(yo.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:[(0,_o.jsx)(yo.Path,{d:"M0 0h24v24H0V0z",fill:"none"}),(0,_o.jsx)(yo.Path,{d:"M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zM6 20V4h7v5h5v11H6z"})]})}),e},D=e=>{u(e)},F=(0,_o.jsxs)(ko.Fragment,{children:[u&&(0,_o.jsxs)(ko.Fragment,{children:[y&&(0,_o.jsxs)(ko.Fragment,{children:[(0,_o.jsx)(SelectControl,{label:(0,Mo.__)("Link Target","kadence-blocks"),value:c,options:[{value:"_self",label:(0,Mo.__)("Same Tab/Window","kadence-blocks")},{value:"_blank",label:(0,Mo.__)("Open in New Tab","kadence-blocks")},{value:"video",label:(0,Mo.__)("Video Popup","kadence-blocks")}],onChange:D}),"video"===c&&(0,_o.jsx)("p",{children:(0,Mo.__)("NOTE: Video popup only works with youtube and vimeo links.","kadence-blocks")})]}),!y&&(0,_o.jsx)(yo.ToggleControl,{label:(0,Mo.__)("Open in New Tab","kadence-blocks"),onChange:D,checked:c})]}),p&&(0,_o.jsx)(yo.ToggleControl,{label:(0,Mo.__)("No Follow","kadence-blocks"),onChange:e=>{p(e)},checked:d}),f&&(0,_o.jsx)(yo.ToggleControl,{label:(0,Mo.__)("Sponsored","kadence-blocks"),onChange:e=>{f(e)},checked:h}),m&&(0,_o.jsx)(yo.ToggleControl,{label:(0,Mo.__)("Download","kadence-blocks"),onChange:e=>{m(e)},checked:b}),v&&(0,_o.jsx)(yo.TextControl,{label:(0,Mo.__)("Title","kadence-blocks"),onChange:e=>{v(e)},value:g}),x&&(0,_o.jsx)(yo.TextControl,{label:(0,Mo.__)("Link CSS Class","kadence-blocks"),onChange:e=>{x(e)},value:k})]}),V=null!==N?N:n,B=((0,Oo.find)(A(),["linkDestination",e])||{}).title;return(0,_o.jsxs)(_o.Fragment,{children:[(0,_o.jsx)(yo.ToolbarButton,{icon:fd,className:"components-toolbar__control",label:n?(0,Mo.__)("Edit link"):(0,Mo.__)("Insert link"),"aria-expanded":_,onClick:C}),_&&(0,_o.jsxs)(Eo.URLPopover,{onFocusOutside:I(),onClose:R,renderSettings:()=>l?F:"",additionalControls:!V&&(0,_o.jsx)(yo.NavigableMenu,{children:(0,Oo.map)(A(),e=>(0,_o.jsx)(yo.MenuItem,{icon:e.icon,onClick:()=>{O(null),(e=>{const n=A();let o;o=e?((0,Oo.find)(n,t=>t.url===e)||{linkDestination:Jh}).linkDestination:Xh,s?s({linkDestination:o,link:e}):(t(e),i&&i(o))})(e.url),T()},children:e.title},e.linkDestination))}),children:[(!n||j)&&(0,_o.jsx)(Eo.URLPopover.LinkEditor,{className:"block-editor-format-toolbar__link-container-content",value:V,onChangeInputValue:O,onSubmit:P(),autocompleteRef:E}),n&&!j&&(0,_o.jsxs)(_o.Fragment,{children:[(0,_o.jsx)(Eo.URLPopover.LinkViewer,{className:"block-editor-format-toolbar__link-container-content",url:n,onEditLinkClick:M,urlLabel:B}),(0,_o.jsx)(yo.Button,{icon:qh,label:(0,Mo.__)("Remove link"),onClick:L})]})]})]})},ef=(0,_o.jsx)(Ho.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,_o.jsx)(Ho.Path,{d:"m19 7-3-3-8.5 8.5-1 4 4-1L19 7Zm-7 11.5H5V20h7v-1.5Z"})}),tf=(0,_o.jsx)(Ho.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,_o.jsx)(Ho.Path,{d:"M12 21C16.9706 21 21 16.9706 21 12C21 7.02944 16.9706 3 12 3C7.02944 3 3 7.02944 3 12C3 16.9706 7.02944 21 12 21ZM15.5303 8.46967C15.8232 8.76256 15.8232 9.23744 15.5303 9.53033L13.0607 12L15.5303 14.4697C15.8232 14.7626 15.8232 15.2374 15.5303 15.5303C15.2374 15.8232 14.7626 15.8232 14.4697 15.5303L12 13.0607L9.53033 15.5303C9.23744 15.8232 8.76256 15.8232 8.46967 15.5303C8.17678 15.2374 8.17678 14.7626 8.46967 14.4697L10.9393 12L8.46967 9.53033C8.17678 9.23744 8.17678 8.76256 8.46967 8.46967C8.76256 8.17678 9.23744 8.17678 9.53033 8.46967L12 10.9393L14.4697 8.46967C14.7626 8.17678 15.2374 8.17678 15.5303 8.46967Z"})}),nf=(0,_o.jsx)(Ho.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,_o.jsx)(Ho.Path,{d:"M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z"})}),of=(0,_o.jsx)(Ho.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,_o.jsx)(Ho.Path,{d:"M12 3.3c-4.8 0-8.8 3.9-8.8 8.8 0 4.8 3.9 8.8 8.8 8.8 4.8 0 8.8-3.9 8.8-8.8s-4-8.8-8.8-8.8zm6.5 5.5h-2.6C15.4 7.3 14.8 6 14 5c2 .6 3.6 2 4.5 3.8zm.7 3.2c0 .6-.1 1.2-.2 1.8h-2.9c.1-.6.1-1.2.1-1.8s-.1-1.2-.1-1.8H19c.2.6.2 1.2.2 1.8zM12 18.7c-1-.7-1.8-1.9-2.3-3.5h4.6c-.5 1.6-1.3 2.9-2.3 3.5zm-2.6-4.9c-.1-.6-.1-1.1-.1-1.8 0-.6.1-1.2.1-1.8h5.2c.1.6.1 1.1.1 1.8s-.1 1.2-.1 1.8H9.4zM4.8 12c0-.6.1-1.2.2-1.8h2.9c-.1.6-.1 1.2-.1 1.8 0 .6.1 1.2.1 1.8H5c-.2-.6-.2-1.2-.2-1.8zM12 5.3c1 .7 1.8 1.9 2.3 3.5H9.7c.5-1.6 1.3-2.9 2.3-3.5zM10 5c-.8 1-1.4 2.3-1.8 3.8H5.5C6.4 7 8 5.6 10 5zM5.5 15.3h2.6c.4 1.5 1 2.8 1.8 3.7-1.8-.6-3.5-2-4.4-3.7zM14 19c.8-1 1.4-2.2 1.8-3.7h2.6C17.6 17 16 18.4 14 19z"})}),af=({text:e="",highlight:t=""})=>{const n=t.trim();if(!n)return e;const o=new RegExp(`(${(0,Oo.escapeRegExp)(n)})`,"gi");return(0,ko.createInterpolateElement)(e.replace(o,"<mark>$&</mark>"),{mark:(0,_o.jsx)("mark",{})})};class rf extends ko.Component{constructor(e){super(e),this.onChange=this.onChange.bind(this),this.onFocus=this.onFocus.bind(this),this.onKeyDown=this.onKeyDown.bind(this),this.selectPost=this.selectPost.bind(this),this.handleOnClick=this.handleOnClick.bind(this),this.autocompleteRef=e.autocompleteRef||(0,ko.createRef)(),this.inputRef=(0,ko.createRef)(),this.updateSuggestions=(0,Oo.debounce)(this.updateSuggestions.bind(this),200),this.suggestionNodes=[],this.isUpdatingSuggestions=!1,this.state={search:"",suggestions:[],showSuggestions:!1,selectedSuggestion:null,suggestionsListboxId:"",suggestionOptionIdPrefix:"",isEditing:!1}}updateSuggestions(e=""){this.setState({selectedSuggestion:null,loading:!0});const t=Wh(e);t.then(e=>{this.suggestionsRequest===t&&this.setState({suggestions:e,loading:!1,showSuggestions:!!e.length})}).catch(()=>{this.suggestionsRequest===t&&this.setState({loading:!1})}),this.suggestionsRequest=t}onChange(e){const t=e.target.value;this.setState({search:t}),this.updateSuggestions(t.trim())}onFocus(){const{suggestions:e,search:t}=this.state;!t||this.loading||e&&e.length||this.updateSuggestions(t.trim())}onKeyDown(e){const{showSuggestions:t,selectedSuggestion:n,suggestions:o,loading:a}=this.state;if(!t||!o.length||a){switch(e.keyCode){case Vo.UP:0!==e.target.selectionStart&&(e.stopPropagation(),e.preventDefault(),e.target.setSelectionRange(0,0));break;case Vo.DOWN:this.state.search.length!==e.target.selectionStart&&(e.stopPropagation(),e.preventDefault(),e.target.setSelectionRange(this.state.search.length,this.state.search.length))}return}const r=this.state.suggestions[this.state.selectedSuggestion];switch(e.keyCode){case Vo.UP:{e.stopPropagation(),e.preventDefault();const t=n?n-1:o.length-1;this.setState({selectedSuggestion:t});break}case Vo.DOWN:{e.stopPropagation(),e.preventDefault();const t=null===n||n===o.length-1?0:n+1;this.setState({selectedSuggestion:t});break}case Vo.TAB:null!==this.state.selectedSuggestion&&(this.selectPost(r),this.props.speak((0,Mo.__)("Link selected.")));break;case Vo.ENTER:null!==this.state.selectedSuggestion&&(e.stopPropagation(),this.selectPost(r))}}selectPost(e){this.props.onChange(e.url,e),this.setState({isEditing:!1,selectedSuggestion:null,showSuggestions:!1})}handleOnClick(e){this.selectPost(e)}render(){return(0,_o.jsxs)(ko.Fragment,{children:[this.renderControl(),this.renderSuggestions(),this.renderSettings()]})}renderSettings(){const{isSettingsExpanded:e,additionalControls:t,advancedOptions:n}=this.props;return(0,_o.jsx)(ko.Fragment,{children:t&&e&&(0,_o.jsx)("div",{className:"kb-link-control-additional-controls",children:n})})}renderControl(){const{label:e,className:t,isFullWidth:n,instanceId:o,placeholder:a=(0,Mo.__)("Paste URL or type to search","kadence-blocks"),url:r="",attributes:s,dynamicAttribute:i="",isSettingsExpanded:l,additionalControls:c,advancedOptions:u,onExpandSettings:d,allowClear:p}=this.props,{loading:h,showSuggestions:f,selectedSuggestion:b,suggestionsListboxId:m=`block-editor-url-input-suggestions-${o}`,suggestionOptionIdPrefix:g=`block-editor-url-input-suggestion-${o}`,isEditing:v}=this.state,x={id:`url-input-control-${o}`,className:"kb-search-selection-name"},k={value:this.state.search||r,required:!0,className:"kb-search-selection-input",type:"text",onChange:this.onChange,onFocus:this.onFocus,placeholder:a,onKeyDown:this.onKeyDown,role:"combobox","aria-label":(0,Mo.__)("URL Input or Search","kadence-blocks"),"aria-expanded":f,"aria-autocomplete":"list","aria-owns":m,"aria-activedescendant":null!==b?`${g}-${b}`:void 0,ref:this.inputRef};return(0,_o.jsx)(ko.Fragment,{children:(0,_o.jsxs)("div",{className:"kb-side-link-control-inner-row",children:[r&&!v&&(0,_o.jsx)("div",{className:"kb-search-selection-name",children:(0,hp.applyFilters)("kadence.linkDisplay",(0,_o.jsx)(ko.Fragment,{children:(0,_o.jsxs)("div",{className:"block-editor-url-popover__link-viewer block-editor-format-toolbar__link-container-content",children:[r?(0,_o.jsx)(yo.ExternalLink,{href:r,children:(0,hc.filterURLForDisplay)((0,hc.safeDecodeURI)(r))}):(0,_o.jsx)("span",{}),(0,_o.jsx)(yo.Button,{icon:ef,label:(0,Mo.__)("Edit","kadence-blocks"),onClick:()=>{this.state.search&&this.updateSuggestions(this.state.search),this.setState({isEditing:!0})}})]})}),this.props.attributes,i,void 0,this.props.context)}),(!r||v)&&(0,_o.jsxs)(yo.BaseControl,{...x,children:[(0,_o.jsx)("div",{className:"kb-search-url-input",children:(0,_o.jsx)("input",{...k})}),h&&(0,_o.jsx)(yo.Spinner,{}),p&&!this.state.search&&r&&(0,_o.jsx)(yo.Button,{className:"kb-search-url-clear",icon:tf,label:(0,Mo.__)("Clear","kadence-blocks"),onClick:()=>{this.props.onChange("",""),this.setState({isEditing:!1,selectedSuggestion:null,showSuggestions:!1})}}),(0,_o.jsx)(yo.Button,{className:"kb-search-url-submit",icon:Gc,label:(0,Mo.__)("Submit","kadence-blocks"),onClick:()=>{this.props.onChange(this.state.search||r,""),this.setState({isEditing:!1,selectedSuggestion:null,showSuggestions:!1})}})]}),i&&kadence_blocks_params.dynamic_enabled&&(0,_o.jsx)(Gh,{...this.props}),c&&(0,_o.jsx)(yo.Button,{className:"kb-link-settings-toggle",icon:nf,label:(0,Mo.__)("Link settings","kadence-blocks"),onClick:d,"aria-expanded":l})]})})}renderSuggestions(){const{className:t}=this.props,{showSuggestions:n,suggestions:o,selectedSuggestion:a,suggestionsListboxId:r,suggestionOptionIdPrefix:s,loading:i,search:l}=this.state,c={id:r,ref:this.autocompleteRef,role:"listbox"},u=["url","mailto","tel","internal"],d=(e,t)=>({role:"option",tabIndex:"-1",id:`${s}-${t}`,"aria-selected":t===a});return n&&o.length?(0,_o.jsx)("div",{className:"kb-search-selection-list",children:(0,_o.jsx)("div",{...c,className:Bc()("kb-search-selection-suggestions",`${t}__suggestions`),children:o.map((t,n)=>(0,e.createElement)(yo.Button,{...d(0,n),key:t.id,className:Bc()("kb-search-selection-suggestion",{"is-selected":n===a}),onClick:()=>this.handleOnClick(t)},u.includes(t.type.toLowerCase())&&(0,_o.jsx)(Icon,{className:"block-editor-link-control__search-item-icon",icon:of}),(0,_o.jsxs)("span",{className:"kb-search-selection-search-item-header",children:[(0,_o.jsx)("span",{className:"kb-search-selection-search-item-title",children:(0,_o.jsx)(af,{text:t.title,highlight:l})}),(0,_o.jsxs)("span",{"aria-hidden":!u.includes(t.type.toLowerCase()),className:"kb-search-selection-search-item-info",children:[!u.includes(t.type.toLowerCase())&&((0,hc.filterURLForDisplay)((0,hc.safeDecodeURI)(t.url))||""),u.includes(t.type.toLowerCase())&&(0,Mo.__)("Press ENTER to add this link")]})]}),(0,_o.jsx)("span",{className:"kb-search-selection-search-item-type",children:"post_tag"===t.type?"tag":t.type})))})}):null}}const sf=(0,_c.compose)(_c.withSafeTimeout,_c.withInstanceId)(rf);class lf extends ko.Component{constructor(){super(...arguments),this.state={isEditingLink:!1,isSettingsExpanded:!1,urlInput:null}}render(){const{label:e,onChangeUrl:t,url:n,additionalControls:o=!0,opensInNewTab:a,onChangeTarget:r,linkNoFollow:s,onChangeFollow:i,linkSponsored:l,onChangeSponsored:c,linkDownload:u,onChangeDownload:d,linkTitle:p,onChangeTitle:h,changeTargetType:f=!1,allowClear:b=!1,dynamicAttribute:m=""}=this.props,{urlInput:g,isEditingLink:v,isSettingsExpanded:x}=this.state,k=e=>{r(e)},y=(0,_o.jsxs)(ko.Fragment,{children:[r&&(0,_o.jsxs)(ko.Fragment,{children:[f&&(0,_o.jsxs)(ko.Fragment,{children:[(0,_o.jsx)(yo.SelectControl,{label:(0,Mo.__)("Link Target","kadence-blocks"),value:a,options:[{value:"_self",label:(0,Mo.__)("Same Tab/Window","kadence-blocks")},{value:"_blank",label:(0,Mo.__)("Open in New Tab","kadence-blocks")},{value:"video",label:(0,Mo.__)("Video Popup","kadence-blocks")}],onChange:k}),"video"===a&&(0,_o.jsx)("p",{children:(0,Mo.__)("NOTE: Video popup only works with youtube and vimeo links.","kadence-blocks")})]}),!f&&(0,_o.jsx)(yo.ToggleControl,{label:(0,Mo.__)("Open in New Tab","kadence-blocks"),onChange:k,checked:a})]}),i&&(0,_o.jsx)(yo.ToggleControl,{label:(0,Mo.__)("No Follow","kadence-blocks"),onChange:e=>{i(e)},checked:s}),c&&(0,_o.jsx)(yo.ToggleControl,{label:(0,Mo.__)("Sponsored","kadence-blocks"),onChange:e=>{c(e)},checked:l}),d&&(0,_o.jsx)(yo.ToggleControl,{label:(0,Mo.__)("Download","kadence-blocks"),onChange:e=>{d(e)},checked:u}),h&&(0,_o.jsx)(yo.TextControl,{label:(0,Mo.__)("Title","kadence-blocks"),onChange:e=>{h(e)},value:p})]}),_=null!==g?g:n;return(0,_o.jsx)(yo.Popover,{className:"kb-popover-link-popover",position:"bottom center",children:(0,_o.jsx)("div",{className:"components-base-control kb-popover-link-control kb-side-link-control"+(m&&kadence_blocks_params.dynamic_enabled?" has-dynamic-support":""),children:(0,_o.jsx)(sf,{url:_,onChange:e=>(e=>{t(e)})(e),attributes:this.props.attributes,dynamicAttribute:m,additionalControls:o,advancedOptions:y,isSettingsExpanded:x,onExpandSettings:()=>{this.setState({isSettingsExpanded:!x})},allowClear:b,...this.props})})})}}const cf=lf;class uf extends ko.Component{constructor(){super(...arguments),this.state={isEditingLink:!1,isSettingsExpanded:!1,urlInput:null}}render(){const{label:e,onChangeUrl:t,url:n,additionalControls:o=!0,opensInNewTab:a,onChangeTarget:r,linkNoFollow:s,onChangeFollow:i,linkSponsored:l,onChangeSponsored:c,linkDownload:u,onChangeDownload:d,linkTitle:p,onChangeTitle:h,onChangeLinkClass:f,linkClass:b,changeTargetType:m=!1,allowClear:g=!1,dynamicAttribute:v=""}=this.props,{urlInput:x,isEditingLink:k,isSettingsExpanded:y}=this.state,_=e=>{r(e)},w=(0,_o.jsxs)(ko.Fragment,{children:[r&&(0,_o.jsxs)(ko.Fragment,{children:[m&&(0,_o.jsxs)(ko.Fragment,{children:[(0,_o.jsx)(yo.SelectControl,{label:(0,Mo.__)("Link Target","kadence-blocks"),value:a,options:[{value:"_self",label:(0,Mo.__)("Same Tab/Window","kadence-blocks")},{value:"_blank",label:(0,Mo.__)("Open in New Tab","kadence-blocks")},{value:"video",label:(0,Mo.__)("Video Popup","kadence-blocks")}],onChange:_}),"video"===a&&(0,_o.jsx)("p",{children:(0,Mo.__)("NOTE: Video popup only works with youtube and vimeo links.","kadence-blocks")})]}),!m&&(0,_o.jsx)(yo.ToggleControl,{label:(0,Mo.__)("Open in New Tab","kadence-blocks"),onChange:_,checked:a})]}),i&&(0,_o.jsx)(yo.ToggleControl,{label:(0,Mo.__)("No Follow","kadence-blocks"),onChange:e=>{i(e)},checked:s}),c&&(0,_o.jsx)(yo.ToggleControl,{label:(0,Mo.__)("Sponsored","kadence-blocks"),onChange:e=>{c(e)},checked:l}),d&&(0,_o.jsx)(yo.ToggleControl,{label:(0,Mo.__)("Download","kadence-blocks"),onChange:e=>{d(e)},checked:u}),f&&(0,_o.jsx)(yo.TextControl,{label:(0,Mo.__)("Link CSS Class","kadence-blocks"),onChange:e=>{f(e)},value:b})]});return(0,_o.jsxs)("div",{className:"components-base-control kb-side-link-control"+(v&&kadence_blocks_params.dynamic_enabled?" has-dynamic-support":""),children:[e&&(0,_o.jsx)("label",{className:"components-base-control__label",children:e}),(0,_o.jsx)(sf,{url:n,onChange:e=>(e=>{t(e)})(e),attributes:this.props.attributes,dynamicAttribute:v,additionalControls:o,advancedOptions:w,isSettingsExpanded:y,onExpandSettings:()=>{this.setState({isSettingsExpanded:!y})},allowClear:g,...this.props}),h&&(0,_o.jsx)(yo.TextControl,{label:(0,Mo.__)("Title","kadence-blocks"),onChange:e=>{h(e)},value:p,style:n&&!p?{backgroundColor:"rgba(255, 255, 0, 0.5)"}:{},placeholder:n&&!p?(0,Mo.__)("Add a Title","kadence-blocks"):""})]})}}const df=uf,pf=e=>e.map((e,t)=>{const{nE:n,aBs:o,children:a=null}=e,r=Object.keys(o).filter(e=>"fill"!==e&&"stroke"!==e&&"none"!==o[e]).reduce((e,t)=>(e[t]=o[t],e),{});let s={};return"none"===o.fill&&o.stroke&&(s={fill:"none",stroke:"currentColor"}),(0,ko.createElement)(n,{key:t,...r,...s},null===a?a:pf(a))}),hf=e=>{const{style:t,className:n,icon:o,name:a,htmltag:r,...s}=e,i=a.substring(0,2),l=a.substring(0,3),c=!(!i||"fe"!=i),u=c?"none":"currentColor",d=c?e.strokeWidth:void 0,p=c?"currentColor":void 0,h=c?"round":void 0,f=c?"round":void 0,b=e.ariaHidden?"true":void 0,m=r||"div",g=!(!e.icon||!e.icon.vB)&&e.icon.vB.split(" ");return(0,_o.jsx)(m,{style:{display:"inline-flex",justifyContent:"center",alignItems:"center",...t},className:`${n} ${0===e.size?"kb-icon-transparent":""}`,children:(0,_o.jsxs)("svg",{style:{display:"inline-block",verticalAlign:"middle"},viewBox:e.icon?e.icon.vB:"0 0 24 24",height:0===e.size?"24":e.size,width:0===e.size?"24":e.size,fill:u,stroke:p,xmlns:e.xmlns,preserveAspectRatio:l&&"fas"!==l&&"fe_"!==l&&"ic_"!==l&&g&&(void 0!==g[0]&&0!==g[0]||void 0!==g[1]&&0!==g[1])?"xMinYMin meet":void 0,"stroke-width":d,"stroke-linecap":h,"stroke-linejoin":f,"aria-hidden":b,children:[e.title?(0,_o.jsx)("title",{children:e.title}):null,e.icon&&pf(e.icon.cD)]})})};hf.defaultProps={size:24,xmlns:"http://www.w3.org/2000/svg",strokeWidth:2,htmltag:"div"},hf.propTypes={icon:S().object.isRequired,size:S().oneOfType([S().number,S().string]),style:S().object,className:S().string};const ff=hf;class bf extends ko.Component{constructor(){super(...arguments),this.updateIcons=this.updateIcons.bind(this),this.getCustomSvg=this.getCustomSvg.bind(this),this.state={iconOptions:void 0,isLoading:!1,customSvg:""}}componentDidMount(){const e={...kadence_blocks_params_ico.icons,...kadence_blocks_params_fa.icons,...kadence_blocks_params_kbcustomicons.icons};this.setState({iconOptions:(0,hp.applyFilters)("kadence.icon_options",e)}),this.props.name.startsWith("kb-custom")&&this.getCustomSvg(this.props.name.replace("kb-custom-",""))}componentDidUpdate(e,t,n){this.props.name!==e.name&&this.props.name.startsWith("kb-custom")&&this.getCustomSvg(this.props.name.replace("kb-custom-",""))}getCustomSvg=async e=>{try{const t=localStorage.getItem(`kb-custom-${e}`);if(t)return void this.setState({customSvg:JSON.parse(t)});this.setState({isLoading:!0});const n=await(async e=>{const t=await fetch(kadence_blocks_params.rest_url+`wp/v2/kadence_custom_svg/${e}`,{method:"GET"});if(!t.ok)throw new Error("Network response was not ok");return t.json()})(e);if(n){const t=n.content.rendered.replace("<p>","").replace("</p>","").replace(/&#8220;/g,'"').replace(/&#8221;/g,'"').replace(/&#8222;/g,'"').replace(/&#8243;/g,'"'),o=JSON.parse(t);localStorage.setItem(`kb-custom-${e}`,JSON.stringify(o)),this.setState({customSvg:o})}else this.setState({customSvg:""})}catch(e){this.setState({customSvg:""}),console.error("Failed to fetch custom SVGs:",e)}this.setState({isLoading:!1})};updateIcons(){const e={...kadence_blocks_params_ico.icons,...kadence_blocks_params_fa.icons,...kadence_blocks_params_kbcustomicons.icons};return(0,hp.applyFilters)("kadence.icon_options",e)}render(){const{name:e}=this.props;let{iconOptions:t,isLoading:n,customSvg:o}=this.state;return t||(t=this.updateIcons()),e.startsWith("kb-custom")&&n?(0,_o.jsx)(yo.Spinner,{}):e.startsWith("kb-custom")&&""!==o?(0,_o.jsx)(ff,{name:e,icon:o,...this.props}):(0,_o.jsx)(ff,{name:e,icon:t[e],...this.props})}}const mf=bf;function gf({name:e,title:t,extraClass:n,strokeWidth:o=!1,tooltipID:a="",tooltipPlacement:r=""}){return(0,_o.jsx)("span",{"data-name":e,"data-stroke":o||void 0,"data-title":t?t.replace(/ /g,"_"):void 0,"data-class":n?n.replace(/ /g,"_"):void 0,"data-tooltip-id":a||void 0,"data-tooltip-placement":a&&r?r:void 0,className:"kadence-dynamic-icon"})}function vf({label:e,onChange:t,value:n="",defaultValue:o="",className:a="",step:r=1,max:s=100,min:i=0,beforeIcon:l="",help:c="",unit:u="",onUnit:d,showUnit:p=!1,lockUnits:h=!1,units:f=["px","em","rem"],reset:b,initialPosition:m}){return[t&&(0,_o.jsxs)("div",{className:"components-base-control kadence-range-control"+(a?" "+a:""),children:[(0,_o.jsx)("div",{className:"kadence-title-bar",children:e&&(0,_o.jsxs)("span",{className:"kadence-control-title",children:[e,b&&(0,_o.jsx)(yo.Button,{className:"is-reset is-single",isSmall:!0,disabled:(0,Oo.isEqual)(n,o),icon:kd,onClick:()=>{"function"==typeof b?b():t(o)}})]})}),(0,_o.jsxs)("div",{className:"kadence-controls-content",children:[(0,_o.jsx)("div",{className:"kadence-range-control-inner",children:(0,_o.jsx)(yo.RangeControl,{className:"kadence-range-control-range",beforeIcon:l,value:n,onChange:e=>t(e),min:i,max:s,step:r,help:c,allowReset:!0,initialPosition:m})}),(d||p)&&(0,_o.jsx)("div",{className:"kadence-units kadence-measure-control-select-wrapper",children:(0,_o.jsx)("select",{className:"kadence-measure-control-select components-unit-control__select",onChange:e=>{d&&d(e.target.value)},value:u,disabled:1===f.length||h,children:f.map((e,t)=>(0,_o.jsx)("option",{value:e,children:e},t))})})]})]})]}function xf({label:e,placement:t="top",measurement:n,onChange:o,step:a=1,max:r=100,min:s=0,icon:i,unit:l="",allowEmpty:c=!1,className:u="",preset:d=""}){const[p,h]=function(){const[e,t]=(0,ko.useState)(!1);return[e,e=>{t(e)}]}();return(0,_o.jsxs)("div",{className:`measure-input-wrap measure-input-${t}`,children:[(0,_o.jsxs)("div",{className:"input-setting-toggle",children:[(0,_o.jsx)(yo.Button,{isSmall:!0,className:"input-setting-toggle-btn",disabled:!(!n||"auto"!=n),tabIndex:"-1",onClick:n&&"auto"==n?"":function(){h(!p)},children:e}),p&&(0,_o.jsxs)(yo.Popover,{onClose:function(){h(!1)},className:"kadence-range-popover-settings",children:[(0,_o.jsx)(vf,{beforeIcon:i,value:void 0!==n?n:"",onChange:e=>o(e?parseFloat(e):e),min:s,max:r,step:a}),""!==l||d&&Array.isArray(d)&&d.length>1&&(0,_o.jsx)(yo.ButtonGroup,{className:"kb-preset-size-options","aria-label":(0,Mo.__)("Choose a Preset Size","kadence-blocks"),children:(0,Oo.map)(d&&Array.isArray(d)&&d.length>1?d:{px:[0,10,20,40,60,80,100,140,160,200],em:[0,.5,1,1.5,2,2.5,3,3.5,4,4.5],rem:[0,.5,1,1.5,2,2.5,3,3.5,4,4.5],"%":[0,2,5,8,10,20,30,40,50,60],vh:[0,2,5,8,10,20,30,40,50,60],vw:[0,2,5,8,10,20,30,40,50,60]}[l],e=>(0,_o.jsx)(yo.Button,{className:"kb-preset-sizes",isSmall:!0,onClick:()=>o(parseFloat(e)),children:e},e))})]})]}),(0,_o.jsx)(yo.TextControl,{label:e,hideLabelFromVision:!0,type:"number",className:"measure-inputs",disabled:!(!n||"auto"!=n),placeholder:n&&"auto"==n?(0,Mo.__)("auto","kadence-blocks"):void 0,value:void 0!==n?n:"",onChange:e=>o(e?Number(e):e),min:s,max:r,step:a}),(0,_o.jsx)("span",{className:"measure-label",children:i})]})}function kf({label:e,measurement:t,control:n="individual",onChange:o,onControl:a=!1,step:r=1,max:s=100,min:i=0,firstIcon:l=tu.outlineTopIcon,secondIcon:c=tu.outlineRightIcon,thirdIcon:u=tu.outlineBottomIcon,fourthIcon:d=tu.outlineLeftIcon,linkIcon:p=fd,unlinkIcon:h=bd,isBorderRadius:f=!1,unit:b="",onUnit:m,showUnit:g=!1,units:v=["px","em","rem"],allowEmpty:x=!1,key:k,className:y="",reset:_,preset:w=""}){const C={first:f?tu.topLeftIcon:l,second:f?tu.topRightIcon:c,third:f?tu.bottomRightIcon:u,fourth:f?tu.bottomLeftIcon:d,link:f?tu.radiusLinkedIcon:p,unlink:f?tu.radiusIndividualIcon:h},j=t||["","","",""],S=x?"":0,[N,O]=(0,ko.useState)(n),E=a?n:N,M=a||O;return(0,_o.jsx)(_o.Fragment,{children:o&&(0,_o.jsxs)("div",{className:`components-base-control kb-measure-control ${C.first!==tu.outlineTopIcon?"kb-measure-corners-control":"kb-measure-sides-control"}${""!==y?" "+y:""}`,children:[e&&(0,_o.jsxs)("div",{className:"kadence-component__header kadence-title-bar",children:[e&&(0,_o.jsxs)("div",{className:"kadence-component__header__title kadence-measure-control__title",children:[(0,_o.jsx)("label",{className:"components-base-control__label",children:e}),_&&(0,_o.jsx)("div",{className:"title-reset-wrap",children:(0,_o.jsx)(yo.Button,{className:"is-reset is-single",label:"reset",isSmall:!0,disabled:!(!(0,Oo.isEqual)(["","","",""],j)&&!(0,Oo.isEqual)(["","auto","","auto"],j)),icon:kd,onClick:()=>{"function"==typeof _?_():o(["","","",""])}})})]}),M&&(0,_o.jsx)(yo.Button,{isSmall:!0,className:"kadence-radio-item kadence-control-toggle radio-custom is-single only-icon",label:"individual"!==E?(0,Mo.__)("Individual","kadence-blocks"):(0,Mo.__)("Linked","kadence-blocks"),icon:"individual"!==E?p:h,onClick:()=>M("individual"!==E?"individual":"linked"),isPressed:"individual"!==E,isTertiary:"individual"===E})]}),(0,_o.jsxs)("div",{className:"kadence-controls-content",children:["individual"!==E&&(0,_o.jsx)(vf,{value:t?t[0]:"",onChange:e=>o([e,e,e,e]),min:i,max:s,step:r}),"individual"===E&&(0,_o.jsxs)(ko.Fragment,{children:[(0,_o.jsx)(xf,{placement:"top",label:(0,Mo.__)("Top","kadence-blocks"),measurement:t?t[0]:"",onChange:e=>o([e?Number(e):e,t&&void 0!==t[1]&&""!==t[1]?t[1]:S,t&&void 0!==t[2]&&""!==t[2]?t[2]:S,t&&void 0!==t[3]&&""!==t[3]?t[3]:S]),min:i,max:s,step:r,icon:C.first,unit:b,allowEmpty:x,preset:w}),(0,_o.jsx)(xf,{placement:"right",label:(0,Mo.__)("Right","kadence-blocks"),measurement:t?t[1]:"",onChange:e=>o([t&&void 0!==t[0]&&""!==t[0]?t[0]:S,e?Number(e):e,t&&void 0!==t[2]&&""!==t[2]?t[2]:S,t&&void 0!==t[3]&&""!==t[3]?t[3]:S]),min:i,max:s,step:r,icon:C.second,unit:b,allowEmpty:x,preset:w}),(0,_o.jsx)(xf,{placement:"bottom",label:(0,Mo.__)("Bottom","kadence-blocks"),measurement:t?t[2]:"",onChange:e=>o([t&&void 0!==t[0]&&""!==t[0]?t[0]:S,t&&void 0!==t[1]&&""!==t[1]?t[1]:S,e?Number(e):e,t&&void 0!==t[3]&&""!==t[3]?t[3]:S]),min:i,max:s,step:r,icon:C.third,unit:b,allowEmpty:x,preset:w}),(0,_o.jsx)(xf,{placement:"left",label:(0,Mo.__)("Left","kadence-blocks"),measurement:t?t[3]:"",onChange:e=>o([t&&void 0!==t[0]&&""!==t[0]?t[0]:S,t&&void 0!==t[1]&&""!==t[1]?t[1]:S,t&&void 0!==t[2]&&""!==t[2]?t[2]:S,e?Number(e):e]),min:i,max:s,step:r,icon:C.fourth,unit:b,allowEmpty:x,preset:w})]}),(m||g)&&(0,_o.jsx)("div",{className:"kadence-measure-control-select-wrapper",children:(0,_o.jsx)("select",{className:"kadence-measure-control-select components-unit-control__select",onChange:e=>{m&&m(e.target.value)},value:b,children:v.map(e=>(0,_o.jsx)("option",{value:e,selected:b===e||void 0,children:e},e))})})]})]},k)})}class yf extends ko.Component{constructor(){super(...arguments),this.state={typographyOptions:[],typographySelectOptions:[],typographyWeights:[],typographyStyles:[],typographySubsets:""}}componentDidMount(){const e="undefined"!=typeof kadence_blocks_params&&kadence_blocks_params.g_font_names?kadence_blocks_params.g_font_names.map(e=>({label:e,value:e,google:!0})):{};let t=[{type:"group",label:(0,Mo.__)("Standard Fonts","kadence-blocks"),options:[{label:"System Default",value:'-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',google:!1},{label:"Arial, Helvetica, sans-serif",value:"Arial, Helvetica, sans-serif",google:!1},{label:'"Arial Black", Gadget, sans-serif',value:'"Arial Black", Gadget, sans-serif',google:!1},{label:"Helvetica, sans-serif",value:"Helvetica, sans-serif",google:!1},{label:'"Comic Sans MS", cursive, sans-serif',value:'"Comic Sans MS", cursive, sans-serif',google:!1},{label:"Impact, Charcoal, sans-serif",value:"Impact, Charcoal, sans-serif",google:!1},{label:'"Lucida Sans Unicode", "Lucida Grande", sans-serif',value:'"Lucida Sans Unicode", "Lucida Grande", sans-serif',google:!1},{label:"Tahoma, Geneva, sans-serif",value:"Tahoma, Geneva, sans-serif",google:!1},{label:'"Trebuchet MS", Helvetica, sans-serif',value:'"Trebuchet MS", Helvetica, sans-serif',google:!1},{label:"Verdana, Geneva, sans-serif",value:"Verdana, Geneva, sans-serif",google:!1},{label:"Georgia, serif",value:"Georgia, serif",google:!1},{label:'"Palatino Linotype", "Book Antiqua", Palatino, serif',value:'"Palatino Linotype", "Book Antiqua", Palatino, serif',google:!1},{label:'"Times New Roman", Times, serif',value:'"Times New Roman", Times, serif',google:!1},{label:"Courier, monospace",value:"Courier, monospace",google:!1},{label:'"Lucida Console", Monaco, monospace',value:'"Lucida Console", Monaco, monospace',google:!1}]},{type:"group",label:(0,Mo.__)("Google Fonts","kadence-blocks"),options:e}];if("undefined"!=typeof kadence_blocks_params&&kadence_blocks_params.c_fonts){const e=[];Object.keys(kadence_blocks_params.c_fonts).forEach(function(t){const n=kadence_blocks_params.c_fonts[t].name,o=kadence_blocks_params.c_fonts[t].label?kadence_blocks_params.c_fonts[t].label:n,a=[];Object.keys(kadence_blocks_params.c_fonts[t].weights).forEach(function(e){a.push({value:kadence_blocks_params.c_fonts[t].weights[e],label:kadence_blocks_params.c_fonts[t].weights[e]})});const r=[];Object.keys(kadence_blocks_params.c_fonts[t].styles).forEach(function(e){r.push({value:kadence_blocks_params.c_fonts[t].weights[e],label:kadence_blocks_params.c_fonts[t].weights[e]})}),e.push({label:o,value:n,google:!1,weights:a,styles:r})}),t=[{type:"group",label:(0,Mo.__)("Custom Fonts","kadence-blocks"),options:e}].concat(t)}if("undefined"!=typeof kadence_blocks_params&&kadence_blocks_params?.isKadenceT){const e=[{label:"Inherit Heading Font Family",value:"var( --global-heading-font-family, inherit )",google:!1},{label:"Inherit Body Font Family",value:"var( --global-body-font-family, inherit )",google:!1}];t=[{type:"group",label:(0,Mo.__)("Theme Global Fonts","kadence-blocks"),options:e}].concat(t)}let n=(0,hp.applyFilters)("kadence.typography_options",t),o=[].concat.apply([],n.map(e=>e.options));const a=kadence_blocks_params.configuration?JSON.parse(kadence_blocks_params.configuration):[];void 0!==a["kadence/typography"]&&"object"==typeof a["kadence/typography"]&&(void 0===a["kadence/typography"].showAll||a["kadence/typography"].showAll||(n=a["kadence/typography"].choiceArray,o=a["kadence/typography"].choiceArray)),this.setState({typographyOptions:n}),this.setState({typographySelectOptions:o}),this.setTypographyOptions(o)}componentDidUpdate(e){this.props.fontFamily!==e.fontFamily&&this.setTypographyOptions(this.state.typographySelectOptions)}setTypographyOptions(e){let t=[{value:"inherit",label:(0,Mo.__)("Inherit","kadence-blocks")},{value:"400",label:(0,Mo.__)("Normal","kadence-blocks")},{value:"bold",label:(0,Mo.__)("Bold","kadence-blocks")}];const n=[{value:"inherit",label:(0,Mo.__)("Inherit","kadence-blocks")},{value:"100",label:(0,Mo.__)("Thin 100","kadence-blocks")},{value:"200",label:(0,Mo.__)("Extra-Light 200","kadence-blocks")},{value:"300",label:(0,Mo.__)("Light 300","kadence-blocks")},{value:"400",label:(0,Mo.__)("Regular","kadence-blocks")},{value:"500",label:(0,Mo.__)("Medium 500","kadence-blocks")},{value:"600",label:(0,Mo.__)("Semi-Bold 600","kadence-blocks")},{value:"700",label:(0,Mo.__)("Bold 700","kadence-blocks")},{value:"800",label:(0,Mo.__)("Extra-Bold 800","kadence-blocks")},{value:"900",label:(0,Mo.__)("Ultra-Bold 900","kadence-blocks")}],o=!("undefined"==typeof kadence_blocks_params||!kadence_blocks_params.isKadenceT),a="undefined"!=typeof kadence_blocks_params&&kadence_blocks_params.headingWeights?kadence_blocks_params.headingWeights:[],r="undefined"!=typeof kadence_blocks_params&&kadence_blocks_params.bodyWeights?kadence_blocks_params.bodyWeights:[],s="undefined"!=typeof kadence_blocks_params&&kadence_blocks_params.buttonWeights?kadence_blocks_params.buttonWeights:[];o&&"heading"===this.props.fontGroup&&a&&Array.isArray(a)&&a.length&&(t=a),o&&"body"===this.props.fontGroup&&r&&Array.isArray(r)&&r.length&&(t=r),o&&"button"===this.props.fontGroup&&s&&Array.isArray(s)&&s.length&&(t=s);const i=[{value:"normal",label:(0,Mo.__)("Normal","kadence-blocks")},{value:"italic",label:(0,Mo.__)("Italic","kadence-blocks")}],l=e?e.filter(({value:e})=>e===this.props.fontFamily):"";let c=t,u=i,d="";l&&l[0]&&(void 0!==l[0].weights&&(c=l[0].weights),void 0!==l[0].styles&&(u=l[0].styles)),'-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"'===this.props.fontFamily?c=n:"var( --global-heading-font-family, inherit )"===this.props.fontFamily?c=a:"var( --global-body-font-family, inherit )"===this.props.fontFamily?c=r:this.props.googleFont&&this.props.fontFamily&&"undefined"!=typeof kadence_blocks_params&&kadence_blocks_params.g_fonts&&kadence_blocks_params.g_fonts[this.props.fontFamily]&&(c=kadence_blocks_params.g_fonts[this.props.fontFamily].w.map(e=>({label:(0,No.capitalizeFirstLetter)(e),value:e})),u=kadence_blocks_params.g_fonts[this.props.fontFamily].i.map(e=>({label:(0,No.capitalizeFirstLetter)(e),value:e})),d=kadence_blocks_params.g_fonts[this.props.fontFamily].s.map(e=>({label:(0,No.capitalizeFirstLetter)(e),value:e}))),this.setState({typographyWeights:c}),this.setState({typographyStyles:u}),this.setState({typographySubsets:d}),this.setState({fontFamilyValue:l})}render(){const{tagLevel:e,label:t,htmlTag:n="heading",tagLowLevel:o=1,tagHighLevel:a=7,lineHeight:r,lineHeightType:s="",fontSize:i,fontSizeType:l="px",googleFont:c,loadGoogleFont:u,fontFamily:d,fontVariant:p,fontWeight:h,fontStyle:f,fontSubset:b,letterSpacing:m,margin:g,marginControl:v,padding:x,paddingControl:k,onTagLevel:y,onTagLevelHTML:_,onLineHeight:w,onFontSize:C,onFontFamily:j,onFontVariant:S,onFontWeight:N,onFontStyle:O,onFontSubset:E,onFontChange:M,onFontArrayChange:T,onLoadGoogleFont:R,onGoogleFont:I,onLetterSpacing:P,onFontSizeType:L,onLineHeightType:A,onPadding:D,onPaddingControl:F,onMargin:V,onMarginControl:B,loadItalic:z,onLoadItalic:H,textTransform:U,onTextTransform:G,reLetterSpacing:$=!1,letterSpacingType:W="px",otherTags:q=[],onLetterSpacingType:X,reset:J,defaultValue:K={size:["","",""],sizeType:"px",lineHeight:["","",""],lineType:"px",letterSpacing:["","",""],letterType:"px",textTransform:"",family:"",google:!1,style:"",weight:"",variant:"",subset:"",loadGoogle:!0}}=this.props,{controlSize:Y,typographySelectOptions:Z,typographyOptions:Q,typographySubsets:ee,typographyStyles:te,typographyWeights:ne,fontFamilyValue:oe}=this.state,ae={size:i,sizeType:l,lineHeight:r,lineType:s,letterSpacing:m,letterType:W,textTransform:U,family:d,google:c,style:f,weight:h,variant:p,subset:b,loadGoogle:u},re=(0,Oo.range)(o,a).map(t=>[{icon:(0,_o.jsx)(yc,{level:t,isPressed:!(1!==e||!n||"heading"!==n)}),title:(0,Mo.sprintf)(/* translators: %d: heading level e.g: "1", "2", "3" */ /* translators: %d: heading level e.g: "1", "2", "3" */
    4242(0,Mo.__)("Heading %d","kadence-blocks"),t),isActive:!(t!==e||!n||"heading"!==n),onClick:()=>_(t,"heading")}]);q.p&&re.push([{icon:(0,_o.jsx)(yc,{level:"p",isPressed:!(!n||"p"!==n)}),title:(0,Mo.__)("Paragraph","kadence-blocks"),isActive:!(!n||"p"!==n),onClick:()=>_(2,"p")}]),q.span&&re.push([{icon:(0,_o.jsx)(yc,{level:"span",isPressed:!(!n||"span"!==n)}),title:(0,Mo.__)("Span","kadence-blocks"),isActive:!(!n||"span"!==n),onClick:()=>_(2,"span")}]),q.div&&re.push([{icon:(0,_o.jsx)(yc,{level:"div",isPressed:!(!n||"div"!==n)}),title:(0,Mo.__)("Div","kadence-blocks"),isActive:!(!n||"div"!==n),onClick:()=>_(2,"div")}]);const se=()=>{T?T({google:!1,family:"",variant:"",weight:"inherit",style:"normal",subset:""}):(I(!1),j(""),S(""),N("inherit"),O("normal"),E(""))},ie=[{value:"none",label:(0,Mo.__)("-","kadence-blocks"),tooltip:(0,Mo.__)("None","kadence-blocks")},{value:"uppercase",label:(0,Mo.__)("AB","kadence-blocks"),tooltip:(0,Mo.__)("Uppercase","kadence-blocks")},{value:"lowercase",label:(0,Mo.__)("ab","kadence-blocks"),tooltip:(0,Mo.__)("Lowercase","kadence-blocks")},{value:"capitalize",label:(0,Mo.__)("Ab","kadence-blocks"),tooltip:(0,Mo.__)("Capitalize","kadence-blocks")}],le="px"!==l?120:3e3,ce="px"!==l?.001:1,ue="px"!==s?.2:5,de="px"!==s?120:3e3,pe="px"!==s?.001:1,he=ne.some(function(e){return"regular"===e.value});return(0,_o.jsx)(_o.Fragment,{children:(0,_o.jsxs)("div",{className:"components-base-control kb-typography-control",children:[t&&(0,_o.jsx)("div",{className:"kadence-title-bar kadence-component__header",children:(0,_o.jsx)("label",{className:"kadence-heading-fontfamily-title components-typography-control__label kadence-component__header__title",children:t})}),(0,_o.jsxs)("div",{className:"kadence-title-bar",children:[t&&(0,_o.jsx)("h2",{className:"kt-heading-fontfamily-title",children:t}),J&&(0,_o.jsx)(Button,{className:"is-reset is-single",isSmall:!0,disabled:!!isEqual(ae,K),icon:undo,onClick:()=>{"function"==typeof J?J():T(K)}})]}),y&&(0,_o.jsxs)(_o.Fragment,{children:[_&&(0,_o.jsx)(ip,{label:(0,Mo.__)("HTML Tag","kadence-blocks"),value:"heading"===n?e:n,onChange:e=>{"div"===e||"p"===e||"span"===e?_(2,e):_(e,"heading")}}),!_&&(0,_o.jsx)(ip,{label:(0,Mo.__)("HTML Tag","kadence-blocks"),value:e,headingOnly:!0,tagHighLevel:a,tagLowLevel:o,onChange:e=>{y(e)}})]}),C&&L&&(0,_o.jsx)(ep,{label:(0,Mo.__)("Font Size","kadence-blocks"),value:i&&void 0!==i[0]?i[0]:"",onChange:e=>C([e,i&&void 0!==i[1]?i[1]:"",i&&void 0!==i[2]?i[2]:""]),tabletValue:i&&void 0!==i[1]?i[1]:"",onChangeTablet:e=>C([i&&void 0!==i[0]?i[0]:"",e,i&&void 0!==i[2]?i[2]:""]),mobileValue:i&&void 0!==i[2]?i[2]:"",onChangeMobile:e=>C([i&&void 0!==i[0]?i[0]:"",i&&void 0!==i[1]?i[1]:"",e]),min:0,max:le,step:ce,unit:l||"px",onUnit:e=>L(e),units:["px","em","rem","vw"]}),!G&&w&&A&&(0,_o.jsx)(np,{label:(0,Mo.__)("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:s||"-",onUnit:e=>A(e),units:["-","px","em","rem"]}),G&&w&&A&&(0,_o.jsxs)(Hh,{className:"kb-font-settings",children:[(0,_o.jsx)(np,{label:(0,Mo.__)("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:s||"-",onUnit:e=>A(e),units:["-","px","em","rem"],compressedDevice:!0}),(0,_o.jsx)(wc,{label:(0,Mo.__)("Letter Case","kadence-blocks"),value:U,options:ie,className:"kb-letter-case",allowClear:!0,onChange:e=>G(e)})]}),G&&(!w||!A)&&(0,_o.jsx)(wc,{label:(0,Mo.__)("Letter Case","kadence-blocks"),value:U,options:ie,className:"kb-letter-case",allowClear:!0,onChange:e=>G(e)}),j&&se&&(0,_o.jsxs)(_o.Fragment,{children:[(0,_o.jsxs)("div",{className:"components-base-control",children:[(0,_o.jsx)("div",{className:"kadence-component__header kadence-title-bar",children:(0,_o.jsx)("label",{className:"kadence-control-title kadence-component__header__title",children:(0,Mo.__)("Font Family","kadence-blocks")})}),(0,_o.jsx)("div",{className:"typography-family-select-form-row",children:(0,_o.jsx)(pc,{options:Q,value:oe,classNamePrefix:"kb-react-select",isMulti:!1,maxMenuHeight:300,isClearable:!0,placeholder:(0,Mo.__)("Select a font family","kadence-blocks"),onChange:e=>{if(null===e)se();else{let t,n,o;e.google?(t="undefined"!=typeof kadence_blocks_params&&kadence_blocks_params.g_fonts&&!kadence_blocks_params.g_fonts[e.value].v.includes("regular")?kadence_blocks_params.g_fonts[e.value].v[0]:"regular",n="undefined"!=typeof kadence_blocks_params&&kadence_blocks_params.g_fonts&&!kadence_blocks_params.g_fonts[e.value].w.includes("regular")?kadence_blocks_params.g_fonts[e.value].w[0]:"400",o="undefined"!=typeof kadence_blocks_params&&kadence_blocks_params.g_fonts&&kadence_blocks_params.g_fonts[e.value].s.length>1?"latin":""):(o="",t="",n=void 0!==e.weights?.[0]?.value?e.weights[0].value:"inherit"),T?T({google:e.google,family:e.value,variant:t,weight:n,style:"normal",subset:o}):(M(e),S(t),N(n),O("normal"),E(o))}},styles:{control:(e,t)=>({...e,borderColor:"rgb(30, 30, 30)",borderRadius:"2px",":hover":{borderColor:"rgb(30, 30, 30)"}})}})})]}),N&&(0,_o.jsx)(yo.SelectControl,{label:(0,Mo.__)("Font Weight","kadence-blocks"),value:"400"===h&&he?"regular":h,options:ne,onChange:e=>{if(c){let t;t="italic"===f?"regular"===e?"italic":e+"italic":e,T?T({variant:t,weight:"regular"===e?"400":e}):(S(t),N("regular"===e?"400":e))}else T?T({variant:"",weight:"regular"===e?"400":e}):(S(""),N("regular"===e?"400":e))},className:"kb-select-style"}),d&&O&&(0,_o.jsx)(yo.SelectControl,{label:(0,Mo.__)("Font Style","kadence-blocks"),value:f,options:te,onChange:e=>{if(c){let t;t="italic"===e?h&&"regular"!==h?h+"italic":"italic":h||"regular",T?T({variant:t,style:e}):(S(t),O(e))}else T?T({variant:"",style:e}):(S(""),O(e))},className:"kb-select-style"}),d&&c&&R&&(0,_o.jsx)(yo.ToggleControl,{label:(0,Mo.__)("Load Google Font on Frontend","kadence-blocks"),checked:u,onChange:R}),d&&c&&u&&O&&"normal"===f&&H&&void 0!==te[1]&&void 0!==te[1].value&&"italic"===te[1].value&&(0,_o.jsx)(yo.ToggleControl,{label:(0,Mo.__)("Load Italic Styles Also","kadence-blocks"),checked:z,onChange:H}),P&&$&&(0,_o.jsx)(np,{label:(0,Mo.__)("Letter Spacing","kadence-blocks"),value:void 0!==$&&void 0!==$[0]?$[0]:"",onChange:e=>P([e,void 0!==$&&void 0!==$[1]?$[1]:"",void 0!==$&&void 0!==$[2]?$[2]:""]),tabletValue:void 0!==$&&void 0!==$[1]?$[1]:"",onChangeTablet:e=>P([void 0!==$&&void 0!==$[0]?$[0]:"",e,void 0!==$&&void 0!==$[2]?$[2]:""]),mobileValue:void 0!==$&&void 0!==$[2]?$[2]:"",onChangeMobile:e=>P([void 0!==$&&void 0!==$[0]?$[0]:"",void 0!==$&&void 0!==$[1]?$[1]:"",e]),min:-5,max:25,step:X&&"px"===X?.1:.01,unit:X?W:"px",onUnit:e=>X(e),units:X?["px","em","rem"]:["px"]}),P&&!$&&(0,_o.jsx)(vf,{label:(0,Mo.__)("Letter Spacing","kadence-blocks"),value:void 0!==m?m:"",defaultValue:0,onChange:e=>P(e),min:-5,max:25,step:.1,reset:!0})]}),D&&F&&(0,_o.jsx)(_o.Fragment,{children:(0,_o.jsx)(kf,{label:(0,Mo.__)("Padding (px)","kadence-blocks"),measurement:x||"",control:k,onChange:e=>D(e),onControl:e=>F(e),min:0,max:100,step:1,allowEmpty:!1,reset:()=>D([0,0,0,0])})}),V&&B&&(0,_o.jsx)(_o.Fragment,{children:(0,_o.jsx)(kf,{label:(0,Mo.__)("Margin (px)","kadence-blocks"),measurement:g||"",control:v,onChange:e=>V(e),onControl:e=>B(e),min:-100,max:100,step:1,allowEmpty:!1,reset:()=>V([0,0,0,0])})})]})})}}const _f=yf;class wf extends ko.Component{constructor(){super(...arguments),this.state={controlSize:"desk",typographyOptions:[],typographySelectOptions:[],typographyWeights:[],typographyStyles:[],typographySubsets:""}}componentDidMount(){let e=[{type:"group",label:"Standard Fonts",options:[{label:"System Default",value:'-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',google:!1},{label:"Arial, Helvetica, sans-serif",value:"Arial, Helvetica, sans-serif",google:!1},{label:'"Arial Black", Gadget, sans-serif',value:'"Arial Black", Gadget, sans-serif',google:!1},{label:"Helvetica, sans-serif",value:"Helvetica, sans-serif",google:!1},{label:'"Comic Sans MS", cursive, sans-serif',value:'"Comic Sans MS", cursive, sans-serif',google:!1},{label:"Impact, Charcoal, sans-serif",value:"Impact, Charcoal, sans-serif",google:!1},{label:'"Lucida Sans Unicode", "Lucida Grande", sans-serif',value:'"Lucida Sans Unicode", "Lucida Grande", sans-serif',google:!1},{label:"Tahoma, Geneva, sans-serif",value:"Tahoma, Geneva, sans-serif",google:!1},{label:'"Trebuchet MS", Helvetica, sans-serif',value:'"Trebuchet MS", Helvetica, sans-serif',google:!1},{label:"Verdana, Geneva, sans-serif",value:"Verdana, Geneva, sans-serif",google:!1},{label:"Georgia, serif",value:"Georgia, serif",google:!1},{label:'"Palatino Linotype", "Book Antiqua", Palatino, serif',value:'"Palatino Linotype", "Book Antiqua", Palatino, serif',google:!1},{label:'"Times New Roman", Times, serif',value:'"Times New Roman", Times, serif',google:!1},{label:"Courier, monospace",value:"Courier, monospace",google:!1},{label:'"Lucida Console", Monaco, monospace',value:'"Lucida Console", Monaco, monospace',google:!1}]},{type:"group",label:"Google Fonts",options:"undefined"!=typeof kadence_blocks_params&&kadence_blocks_params.g_font_names?kadence_blocks_params.g_font_names.map(e=>({label:e,value:e,google:!0})):{}}];if("undefined"!=typeof kadence_blocks_params&&kadence_blocks_params.c_fonts){const t=[];Object.keys(kadence_blocks_params.c_fonts).forEach(function(e){const n=kadence_blocks_params.c_fonts[e].name,o=kadence_blocks_params.c_fonts[e].label?kadence_blocks_params.c_fonts[e].label:n,a=[];Object.keys(kadence_blocks_params.c_fonts[e].weights).forEach(function(t){a.push({value:kadence_blocks_params.c_fonts[e].weights[t],label:kadence_blocks_params.c_fonts[e].weights[t]})});const r=[];Object.keys(kadence_blocks_params.c_fonts[e].styles).forEach(function(t){r.push({value:kadence_blocks_params.c_fonts[e].weights[t],label:kadence_blocks_params.c_fonts[e].weights[t]})}),t.push({label:o,value:n,google:!1,weights:a,styles:r})}),e=[{type:"group",label:(0,Mo.__)("Custom Fonts","kadence-blocks"),options:t}].concat(e)}if("undefined"!=typeof kadence_blocks_params&&kadence_blocks_params?.isKadenceT){const t=[{label:"Inherit Heading Font Family",value:"var( --global-heading-font-family, inherit )",google:!1},{label:"Inherit Body Font Family",value:"var( --global-body-font-family, inherit )",google:!1}];e=[{type:"group",label:(0,Mo.__)("Theme Global Fonts","kadence-blocks"),options:t}].concat(e)}let t=(0,hp.applyFilters)("kadence.typography_options",e),n=[].concat.apply([],t.map(e=>e.options));const o=kadence_blocks_params.configuration?JSON.parse(kadence_blocks_params.configuration):[];void 0!==o["kadence/typography"]&&"object"==typeof o["kadence/typography"]&&(void 0===o["kadence/typography"].showAll||o["kadence/typography"].showAll||(t=o["kadence/typography"].choiceArray,n=o["kadence/typography"].choiceArray)),this.setState({typographyOptions:t}),this.setState({typographySelectOptions:n}),this.setTypographyOptions(n)}componentDidUpdate(e){this.props.fontFamily!==e.fontFamily&&this.setTypographyOptions(this.state.typographySelectOptions)}setTypographyOptions(e){let t=[{value:"inherit",label:(0,Mo.__)("Inherit","kadence-blocks")},{value:"400",label:(0,Mo.__)("Normal","kadence-blocks")},{value:"bold",label:(0,Mo.__)("Bold","kadence-blocks")}];const n=[{value:"inherit",label:(0,Mo.__)("Inherit","kadence-blocks")},{value:"100",label:(0,Mo.__)("Thin 100","kadence-blocks")},{value:"200",label:(0,Mo.__)("Extra-Light 200","kadence-blocks")},{value:"300",label:(0,Mo.__)("Light 300","kadence-blocks")},{value:"400",label:(0,Mo.__)("Regular","kadence-blocks")},{value:"500",label:(0,Mo.__)("Medium 500","kadence-blocks")},{value:"600",label:(0,Mo.__)("Semi-Bold 600","kadence-blocks")},{value:"700",label:(0,Mo.__)("Bold 700","kadence-blocks")},{value:"800",label:(0,Mo.__)("Extra-Bold 800","kadence-blocks")},{value:"900",label:(0,Mo.__)("Ultra-Bold 900","kadence-blocks")}],o=[{value:"normal",label:(0,Mo.__)("Normal","kadence-blocks")},{value:"italic",label:(0,Mo.__)("Italic","kadence-blocks")}],a=!("undefined"==typeof kadence_blocks_params||!kadence_blocks_params.isKadenceT),r="undefined"!=typeof kadence_blocks_params&&kadence_blocks_params.headingWeights?kadence_blocks_params.headingWeights:[],s="undefined"!=typeof kadence_blocks_params&&kadence_blocks_params.bodyWeights?kadence_blocks_params.bodyWeights:[],i="undefined"!=typeof kadence_blocks_params&&kadence_blocks_params.buttonWeights?kadence_blocks_params.buttonWeights:[];a&&"heading"===this.props.fontGroup&&r&&Array.isArray(r)&&r.length&&(t=r),a&&"body"===this.props.fontGroup&&s&&Array.isArray(s)&&s.length&&(t=s),a&&"button"===this.props.fontGroup&&i&&Array.isArray(i)&&i.length&&(t=i);const l=e?e.filter(({value:e})=>e===this.props.fontFamily):"";let c=t,u=o,d="";l&&l[0]&&(void 0!==l[0].weights&&(c=l[0].weights),void 0!==l[0].styles&&(u=l[0].styles)),'-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"'===this.props.fontFamily?c=n:"var( --global-heading-font-family, inherit )"===this.props.fontFamily?c=r:"var( --global-body-font-family, inherit )"===this.props.fontFamily?c=s:this.props.googleFont&&this.props.fontFamily&&"undefined"!=typeof kadence_blocks_params&&kadence_blocks_params.g_fonts&&kadence_blocks_params.g_fonts[this.props.fontFamily]&&(c=kadence_blocks_params.g_fonts[this.props.fontFamily].w.map(e=>({label:(0,No.capitalizeFirstLetter)(e),value:e})),u=kadence_blocks_params.g_fonts[this.props.fontFamily].i.map(e=>({label:(0,No.capitalizeFirstLetter)(e),value:e})),d=kadence_blocks_params.g_fonts[this.props.fontFamily].s.map(e=>({label:(0,No.capitalizeFirstLetter)(e),value:e}))),this.setState({typographyWeights:c}),this.setState({typographyStyles:u}),this.setState({typographySubsets:d}),this.setState({fontFamilyValue:l})}render(){const{uniqueID:e,lineHeight:t,lineHeightType:n,fontSize:o,fontSizeType:a,googleFont:r,loadGoogleFont:s,fontFamily:i,fontVariant:l,fontWeight:c,fontStyle:u,fontSubset:d,letterSpacing:p,onLineHeight:h,onFontSize:f,onFontFamily:b,onFontVariant:m,onFontWeight:g,onFontStyle:v,onFontSubset:x,onFontChange:k,onFontArrayChange:y,onLoadGoogleFont:_,onGoogleFont:w,onLetterSpacing:C,onFontSizeType:j,onLineHeightType:S,textTransform:N,onTextTransform:O,fontSizeArray:E,tabSize:M,tabLineHeight:T,onTabLineHeight:R,onTabSize:I,mobileSize:P,mobileLineHeight:L,onMobileLineHeight:A,onMobileSize:D}=this.props,{controlSize:F,typographySelectOptions:V,typographyOptions:B,typographySubsets:z,typographyStyles:H,typographyWeights:U,fontFamilyValue:G}=this.state,$=((0,Mo.__)("Desktop"),yo.Dashicon,(0,Mo.__)("Tablet"),yo.Dashicon,(0,Mo.__)("Mobile"),yo.Dashicon,e=>{const t=Number(e.target.value);C(""!==t?t>15?15:t<-5?-5:t:void 0)}),W=e=>{if(null===e)q();else{let t,n,o;e.google?(t="undefined"!=typeof kadence_blocks_params&&kadence_blocks_params.g_fonts&&!kadence_blocks_params.g_fonts[e.value].v.includes("regular")?kadence_blocks_params.g_fonts[e.value].v[0]:"regular",n="undefined"!=typeof kadence_blocks_params&&kadence_blocks_params.g_fonts&&!kadence_blocks_params.g_fonts[e.value].w.includes("regular")?kadence_blocks_params.g_fonts[e.value].w[0]:"400",o="undefined"!=typeof kadence_blocks_params&&kadence_blocks_params.g_fonts&&kadence_blocks_params.g_fonts[e.value].s.length>1?"latin":""):(o="",t="",n="inherit"),y?y({google:e.google,family:e.value,variant:t,weight:n,style:"normal",subset:o}):(k(e),m(t),g(n),v("normal"),x(o))}},q=()=>{y?y({google:!1,family:"",variant:"",weight:"inherit",style:"normal",subset:""}):(w(!1),b(""),m(""),g("inherit"),v("normal"),x(""))},X=e=>{if(r){let t;t="italic"===u?"regular"===e?"italic":e+"italic":e,y?y({variant:t,weight:"regular"===e?"400":e}):(m(t),g("regular"===e?"400":e))}else y?y({variant:"",weight:"regular"===e?"400":e}):(m(""),g("regular"===e?"400":e))},J=e=>{if(r){let t;t="italic"===e?c&&"regular"!==c?c+"italic":"italic":c||"regular",y?y({variant:t,style:e}):(m(t),v(e))}else y?y({variant:"",style:e}):(m(""),v(e))},K=[{value:"none",label:"None"},{value:"capitalize",label:"Capitalize"},{value:"uppercase",label:"Uppercase"},{value:"lowercase",label:"Lowercase"}],Y=U.some(function(e){return"regular"===e.value});let Z={};return Z.fontfamily=(0,_o.jsx)("svg",{width:"16px",height:"16px",viewBox:"0 0 48 48",xmlns:"http://www.w3.org/2000/svg",fillRule:"evenodd",clipRule:"evenodd",strokeLinejoin:"round",strokeMiterlimit:"1.414",children:(0,_o.jsx)("path",{d:"M39.939,7.124l0,-3.751l-11.251,0l0,3.751l3.75,0l0,33.752l-3.75,0l0,3.751l11.251,0l0,-3.751l-3.751,0l0,-33.752l3.751,0Zm-11.251,4.391c0,-0.195 -0.366,-0.429 -0.6,-0.596c-1.033,-0.771 -2.175,-1.273 -3.443,-1.506c-1.268,-0.234 -2.747,-0.35 -4.45,-0.35c-1.234,0 -2.501,0.195 -3.797,0.592c-1.297,0.396 -2.4,0.876 -3.311,1.446c-1.056,0.667 -1.911,1.429 -2.569,2.278c-0.658,0.852 -0.988,1.744 -0.988,2.676c0,0.893 0.238,1.697 0.714,2.417c0.476,0.72 1.221,1.078 2.233,1.078c1.135,0 2.022,-0.292 2.661,-0.883c0.639,-0.585 0.958,-1.234 0.958,-1.944c0,-0.668 -0.097,-1.397 -0.289,-2.189c-0.195,-0.789 -0.288,-1.387 -0.288,-1.792c0.324,-0.345 0.887,-0.674 1.687,-0.989c0.799,-0.315 1.667,-0.47 2.599,-0.47c1.358,0 2.406,0.277 3.147,0.834c0.74,0.559 1.312,1.212 1.717,1.962c0.364,0.669 0.269,2.186 0.269,2.186l0,4.472c0,0.527 -2.545,1.257 -5.333,2.189c-2.789,0.931 -4.484,1.569 -5.397,1.914c-0.728,0.285 -1.429,0.666 -2.261,1.14c-0.831,0.478 -1.463,1.018 -1.971,1.628c-0.649,0.729 -1.116,1.549 -1.44,2.46c-0.325,0.911 -0.475,1.944 -0.475,3.101c0,2.23 0.73,4.034 2.179,5.412c1.448,1.376 3.3,2.068 5.549,2.068c2.128,0 3.947,-0.834 5.456,-1.603c1.514,-0.774 2.928,-1.92 4.244,-3.795l0.184,0c0.264,1.875 0.851,2.946 1.792,3.686l1.223,0.064l0,-27.486Zm-3.259,22.286c-0.75,0.955 -1.673,1.78 -2.766,2.483c-1.095,0.699 -2.363,1.052 -3.801,1.052c-1.359,0 -2.477,-0.396 -3.358,-1.191c-0.883,-0.791 -1.322,-2.029 -1.322,-3.712c0,-1.3 0.292,-2.425 0.883,-3.368c0.585,-0.947 1.388,-1.763 2.398,-2.453c1.118,-0.733 2.322,-1.341 3.619,-1.83c1.296,-0.488 2.622,-0.934 4.347,-1.438l0,10.457Z",fill:"#0e9cd1",fillRule:"nonzero"})}),(0,_o.jsx)(ko.Fragment,{children:(0,_o.jsx)(yo.Dropdown,{className:"kt-popover-font-family-container components-dropdown-menu components-toolbar",contentClassName:"kt-popover-font-family",placement:"top",renderToggle:({isOpen:e,onToggle:t})=>(0,_o.jsx)(ko.Fragment,{children:(0,_o.jsx)(yo.Button,{className:"components-dropdown-menu__toggle kt-font-family-icon",label:(0,Mo.__)("Typography Settings"),tooltip:(0,Mo.__)("Typography Settings"),icon:Z.fontfamily,onClick:t,"aria-expanded":e,children:(0,_o.jsx)("span",{className:"components-dropdown-menu__indicator"})})}),renderContent:()=>(0,_o.jsxs)(ko.Fragment,{children:[b&&(0,_o.jsxs)(ko.Fragment,{children:[(0,_o.jsx)("h2",{className:"kt-heading-fontfamily-title",children:(0,Mo.__)("Font Family")}),(0,_o.jsx)("div",{className:"typography-family-select-form-row block-editor-block-toolbar",children:(0,_o.jsx)(pc,{options:B,className:"kt-inline-typography-select",classNamePrefix:"kt-typography",value:G,isMulti:!1,isSearchable:!0,isClearable:!0,maxMenuHeight:200,placeholder:(0,Mo.__)("Default"),onChange:W})})]}),(0,_o.jsxs)("div",{className:"typography-row-settings",children:[g&&(0,_o.jsx)(yo.SelectControl,{label:(0,Mo.__)("Weight","kadence-blocks"),value:"400"===c&&Y?"regular":c,options:U,onChange:X}),O&&(0,_o.jsx)(yo.SelectControl,{label:(0,Mo.__)("Transform"),value:N,options:K,onChange:e=>O(e)}),i&&v&&(0,_o.jsx)(yo.SelectControl,{label:(0,Mo.__)("Style"),value:u,options:H,onChange:J})]}),(0,_o.jsxs)("div",{className:"typography-row-settings",children:[C&&(0,_o.jsxs)("div",{className:"kt-type-input-wrap",children:[(0,_o.jsx)("div",{className:"components-base-control kt-typography-number-input",children:(0,_o.jsxs)("div",{className:"components-base-control__field",children:[(0,_o.jsx)("label",{className:"components-base-control__label",htmlFor:`kt-inline-spacing${e}`,children:(0,Mo.__)("Spacing")}),(0,_o.jsx)("input",{id:`kt-inline-spacing${e}`,value:void 0!==p?p:"",onChange:$,min:-5,max:15,step:.1,type:"number",className:"components-text-control__input"})]})}),(0,_o.jsx)("span",{className:"kt-unit",children:(0,Mo.__)("px")})]}),i&&r&&x&&(0,_o.jsx)(yo.SelectControl,{label:(0,Mo.__)("Subset"),value:d,options:z,onChange:e=>x(e)}),i&&r&&_&&(0,_o.jsx)(yo.ToggleControl,{label:(0,Mo.__)("Load Font"),checked:s,onChange:_})]}),(0,_o.jsxs)("div",{className:"typography-row-settings typography-size-row-settings",children:[f&&j&&!E&&(0,_o.jsx)("div",{className:"kt-size-input-wrap",children:f&&(0,_o.jsx)("div",{className:"kt-type-size-input-wrap",children:(0,_o.jsx)(ep,{label:(0,Mo.__)("Size","kadence-blocks"),value:o||"",onChange:e=>f(e),tabletValue:M||"",onChangeTablet:e=>onTabletSize(e),mobileValue:P||"",onChangeMobile:e=>D(e),min:0,max:"px"!==a?12:300,step:"px"!==a?.001:1,unit:a||"px",onUnit:e=>j(e),units:["px","em","rem","vw"],radio:!1,compressedDevice:!0})})}),h&&S&&!E&&(0,_o.jsx)("div",{className:"kt-size-input-wrap",children:(0,_o.jsx)("div",{className:"kt-type-size-input-wrap",children:(0,_o.jsx)(np,{label:(0,Mo.__)("Height","kadence-blocks"),value:t||"",onChange:e=>h(e),tabletValue:T||"",onChangeTablet:e=>R(e),mobileValue:L||"",onChangeMobile:e=>A(e),min:0,max:"px"===n?300:12,step:"px"===n?1:.1,unit:n||"",onUnit:e=>S(e),units:["-","px","em","rem"],compressedDevice:!0})})})]})]})})})}}const Cf=wf,jf=({label:e,enable:t=!0,color:n,colorDefault:o,blur:a,hOffset:r,vOffset:s,onColorChange:i,onBlurChange:l,onHOffsetChange:c,onVOffsetChange:u,onEnableChange:d})=>(0,_o.jsxs)("div",{className:"kb-text-shadow-container components-base-control",children:[e&&(0,_o.jsxs)("div",{className:"kt-box-shadow-label",children:[(0,_o.jsx)("h2",{className:"kt-beside-color-label",children:e}),d&&(0,_o.jsx)(yo.ToggleControl,{checked:t,onChange:e=>d(e)})]}),t&&(0,_o.jsx)("div",{className:"kt-inner-sub-section",children:(0,_o.jsxs)("div",{className:"kt-inner-sub-section-row",children:[(0,_o.jsxs)("div",{className:"kt-box-color-settings kt-box-shadow-subset",children:[(0,_o.jsx)("p",{className:"kt-box-shadow-title",children:(0,Mo.__)("Color","kadence-blocks")}),(0,_o.jsx)(Po,{value:n||o,default:o,onChange:e=>i(e)})]}),(0,_o.jsxs)("div",{className:"kt-box-x-settings kt-box-shadow-subset",children:[(0,_o.jsx)("p",{className:"kt-box-shadow-title",children:"X"}),(0,_o.jsx)("div",{className:"components-base-control kt-boxshadow-number-input",children:(0,_o.jsx)("div",{className:"components-base-control__field",children:(0,_o.jsx)("input",{value:void 0!==r?r:"",onChange:e=>c(Number(e.target.value)),min:-200,max:200,step:1,type:"number",className:"components-text-control__input"})})})]}),(0,_o.jsxs)("div",{className:"kt-box-y-settings kt-box-shadow-subset",children:[(0,_o.jsx)("p",{className:"kt-box-shadow-title",children:"Y"}),(0,_o.jsx)("div",{className:"components-base-control kt-boxshadow-number-input",children:(0,_o.jsx)("div",{className:"components-base-control__field",children:(0,_o.jsx)("input",{value:void 0!==s?s:"",onChange:e=>u(Number(e.target.value)),min:-200,max:200,step:1,type:"number",className:"components-text-control__input"})})})]}),(0,_o.jsxs)("div",{className:"kt-box-blur-settings kt-box-shadow-subset",children:[(0,_o.jsx)("p",{className:"kt-box-shadow-title",children:"Blur"}),(0,_o.jsx)("div",{className:"components-base-control kt-boxshadow-number-input",children:(0,_o.jsx)("div",{className:"components-base-control__field",children:(0,_o.jsx)("input",{value:void 0!==a?a:"",onChange:e=>l(Number(e.target.value)),min:0,max:200,step:1,type:"number",className:"components-text-control__input"})})})]})]})})]});function Sf({label:e,onChange:t,value:n="",className:o="",options:a=[],step:r=1,max:s=100,min:i=0,beforeIcon:l="",help:c="",defaultValue:u="",unit:d="",onUnit:p,showUnit:h=!1,units:f=["px","em","rem"],disableCustomSizes:b=!1}){const m=n.value?n.value:"",g=n.size?n.size:"";return[t&&(0,_o.jsxs)("div",{className:"components-base-control kadence-radio-range-control kadence-range-control"+(o?" "+o:""),children:[e&&(0,_o.jsx)(yo.Flex,{justify:"space-between",className:"kadence-radio-range__header",children:(0,_o.jsx)(yo.FlexItem,{children:(0,_o.jsx)("label",{className:"components-base-control__label",children:e})})}),"custom"!==m&&(0,_o.jsx)("div",{className:"kadence-controls-content",children:(0,_o.jsxs)(yo.ButtonGroup,{className:"kadence-radio-container-control",children:[a.map((e,n)=>(0,_o.jsx)(yo.Button,{isTertiary:m!==e.value,className:"kadence-radio-item radio-"+e.value,isPrimary:m===e.value,icon:void 0!==e.icon?e.icon:void 0,"aria-pressed":m===e.value,onClick:()=>{m==e.value&&""==u?t("",""):t(e.value,e.size)},children:e.label},`${e.label}-${e.value}-${n}`)),!b&&(0,_o.jsx)(yo.Button,{className:"kadence-radio-item radio-custom only-icon",label:(0,Mo.__)("Set custom size","kadence-blocks"),icon:zc,onClick:()=>t("custom",g),isPressed:!1,isTertiary:!0})]})}),"custom"===m&&(0,_o.jsxs)("div",{className:"kadence-controls-content",children:[(0,_o.jsx)("div",{className:"kadence-range-control-inner",children:(0,_o.jsx)(yo.RangeControl,{className:"kadence-range-control-range",beforeIcon:l,value:g,onChange:e=>t("custom",e),min:i,max:s,step:r,help:c,allowReset:!0,initialPosition:0===n.size?0:""})}),(p||h)&&(0,_o.jsx)("div",{className:"kadence-units kadence-measure-control-select-wrapper",children:(0,_o.jsx)("select",{className:"kadence-measure-control-select components-unit-control__select",onChange:e=>{p&&p(e.target.value)},value:d,disabled:1===f.length,children:f.map((e,t)=>(0,_o.jsx)("option",{value:e,children:e},t))})}),!b&&(0,_o.jsx)(yo.ButtonGroup,{className:"kadence-radio-container-control",children:(0,_o.jsx)(yo.Button,{className:"kadence-radio-item radio-custom only-icon",label:(0,Mo.__)("Use size preset","kadence-blocks"),icon:zc,isPrimary:!0,onClick:()=>t(u,g),isPressed:!0})})]})]})]}function Nf({label:e,onChange:t,onChangeTablet:n,onChangeMobile:o,mobileValue:a,tabletValue:r,value:s,defaultValue:i="",defaultTablet:l="",defaultMobile:c="",step:u=1,max:d=100,min:p=0,unit:h="",onUnit:f,allowResponsiveUnitChange:b=!1,showUnit:m=!1,units:g=["px","em","rem"],allowEmpty:v=!0,className:x="",initialPosition:k,reset:y}){const[_,w]=(0,ko.useState)("Desktop"),C=(0,To.useSelect)(e=>e("kadenceblocks/data").getPreviewDeviceType(),[]);C!==_&&w(C);const{setPreviewDeviceType:j}=(0,To.useDispatch)("kadenceblocks/data"),S=[{name:"Desktop",key:"desktop",title:(0,_o.jsx)(yo.Dashicon,{icon:"desktop"}),itemClass:"kb-desk-tab"},{name:"Tablet",key:"tablet",title:(0,_o.jsx)(yo.Dashicon,{icon:"tablet"}),itemClass:"kb-tablet-tab"},{name:"Mobile",key:"mobile",title:(0,_o.jsx)(yo.Dashicon,{icon:"smartphone"}),itemClass:"kb-mobile-tab"}],N={};return N.Mobile=(0,_o.jsx)(vf,{value:void 0!==a?a:"",onChange:e=>o(e),min:p,max:d,step:u,unit:h,onUnit:f,showUnit:m,units:g,lockUnits:!b,initialPosition:k}),N.Tablet=(0,_o.jsx)(vf,{value:void 0!==r?r:"",onChange:e=>n(e),min:p,max:d,step:u,unit:h,onUnit:f,showUnit:m,units:g,lockUnits:!b,initialPosition:k}),N.Desktop=(0,_o.jsx)(vf,{value:void 0!==s?s:"",onChange:e=>t(e),min:p,max:d,step:u,unit:h,onUnit:f,showUnit:m,units:g,initialPosition:k}),[t&&n&&o&&(0,_o.jsxs)("div",{className:"components-base-control kb-responsive-range-control"+(""!==x?" "+x:""),children:[(0,_o.jsxs)("div",{className:"kadence-title-bar",children:[e&&(0,_o.jsxs)("span",{className:"kadence-control-title",children:[e,y&&(0,_o.jsx)(yo.Button,{className:"is-reset is-single",isSmall:!0,disabled:(0,Oo.isEqual)(s,i)&&(0,Oo.isEqual)(r,l)&&(0,Oo.isEqual)(a,c),icon:kd,onClick:()=>{"function"==typeof y?y():"Tablet"===_?n(l):"Mobile"===_?o(c):t(i)}})]}),(0,_o.jsx)(yo.ButtonGroup,{className:"kb-measure-responsive-options","aria-label":(0,Mo.__)("Device","kadence-blocks"),children:(0,Oo.map)(S,({name:e,key:t,title:n,itemClass:o})=>(0,_o.jsx)(yo.Button,{className:`kb-responsive-btn ${o}${e===_?" is-active":""}`,isSmall:!0,"aria-pressed":_===e,onClick:()=>{return t=e,j((0,No.capitalizeFirstLetter)(t)),void w((0,No.capitalizeFirstLetter)(t));var t},children:n},t))})]}),N[_]?N[_]:N.Desktop]})]}function Of({label:e,onChange:t,onChangeTablet:n,onChangeMobile:o,mobileValue:a,tabletValue:r,value:s,options:i=[],step:l=1,max:c=100,min:u=0,unit:d="",onUnit:p,defaultValue:h="default",defaultTablet:f="",defaultMobile:b="",showUnit:m=!1,units:g=["px","em","rem"],allowEmpty:v=!0,className:x="",disableCustomSizes:k=!1,reset:y}){const[_,w]=(0,ko.useState)("Desktop"),C=(0,To.useSelect)(e=>e("kadenceblocks/data").getPreviewDeviceType(),[]);C!==_&&w(C);const{setPreviewDeviceType:j}=(0,To.useDispatch)("kadenceblocks/data"),S=[{name:"Desktop",key:"desktop",title:(0,_o.jsx)(yo.Dashicon,{icon:"desktop"}),itemClass:"kb-desk-tab"},{name:"Tablet",key:"tablet",title:(0,_o.jsx)(yo.Dashicon,{icon:"tablet"}),itemClass:"kb-tablet-tab"},{name:"Mobile",key:"mobile",title:(0,_o.jsx)(yo.Dashicon,{icon:"smartphone"}),itemClass:"kb-mobile-tab"}],N={};return N.Mobile=(0,_o.jsx)(Sf,{value:void 0!==a?a:"",onChange:(e,t)=>o(e,t),options:i,defaultValue:b,min:u,max:c,step:l,unit:d,onUnit:p,showUnit:m,units:g,disableCustomSizes:k}),N.Tablet=(0,_o.jsx)(Sf,{value:void 0!==r?r:"",onChange:(e,t)=>n(e,t),options:i,defaultValue:f,min:u,max:c,step:l,unit:d,onUnit:p,showUnit:m,units:g,disableCustomSizes:k}),N.Desktop=(0,_o.jsx)(Sf,{value:void 0!==s?s:"",onChange:(e,n)=>t(e,n),options:i,defaultValue:h,min:u,max:c,step:l,unit:d,onUnit:p,showUnit:m,units:g,disableCustomSizes:k}),[t&&n&&o&&(0,_o.jsxs)("div",{className:"components-base-control kb-responsive-radio-range-control"+(""!==x?" "+x:""),children:[(0,_o.jsxs)("div",{className:"kadence-title-bar",children:[e&&(0,_o.jsx)("span",{className:"kadence-control-title",children:e}),y&&(0,_o.jsx)(yo.Button,{className:"is-reset is-single",isSmall:!0,disabled:(0,Oo.isEqual)(s,h)&&(0,Oo.isEqual)(r,f)&&(0,Oo.isEqual)(a,b),icon:kd,onClick:()=>{"function"==typeof y?y():"Tablet"===_?n(f):"Mobile"===_?o(b):t(h)}}),(0,_o.jsx)(yo.ButtonGroup,{className:"kb-measure-responsive-options","aria-label":(0,Mo.__)("Device","kadence-blocks"),children:(0,Oo.map)(S,({name:e,key:t,title:n,itemClass:o})=>(0,_o.jsx)(yo.Button,{className:`kb-responsive-btn ${o}${e===_?" is-active":""}`,isSmall:!0,"aria-pressed":_===e,onClick:()=>{return t=e,j((0,No.capitalizeFirstLetter)(t)),void w((0,No.capitalizeFirstLetter)(t));var t},children:n},t))})]}),N[_]?N[_]:N.Desktop]})]}tu.pxIcon,tu.emIcon,tu.remIcon,tu.vhIcon,tu.vwIcon,tu.percentIcon;let Ef={px:tu.pxIcon,em:tu.emIcon,rem:tu.remIcon,vh:tu.vhIcon,vw:tu.vwIcon,percent:tu.percentIcon};function Mf({device:e="device",onChange:t,value:n,step:o=1,max:a=100,min:r=0,unit:s="",onUnit:i,showUnit:l=!1,units:c=["px","em","rem"],lockUnits:u=!1,className:d=""}){return[t&&(0,_o.jsxs)("div",{className:"kadence-controls-content kb-responsive-range-control-inner"+(""!==d?" "+d:""),children:[(0,_o.jsx)(vf,{value:void 0!==n?n:"",onChange:e=>t(e),min:r,max:a,step:o}),(i||l)&&(0,_o.jsx)("div",{className:"kadence-units",children:1===c.length||u?(0,_o.jsx)(yo.Button,{className:"is-active is-single",isSmall:!0,disabled:!0,children:"%"===s?Ef.percent:Ef[s]}):(0,_o.jsx)(yo.DropdownMenu,{icon:"%"===s?Ef.percent:Ef[s],label:(0,Mo.__)("Select a Unit","kadence-blocks"),controls:c.map(e=>{return[{icon:"%"===(t=e)?Ef.percent:Ef[t],isActive:s===t,onClick:()=>{i(t)}}];var t}),className:"kadence-units-group",popoverProps:{className:"kadence-units-popover"}})})]})]}function Tf({label:e,subLabel:t,onChange:n,onChangeTablet:o,onChangeMobile:a,mobileValue:r,tabletValue:s,value:i,onChangeControl:l=!1,control:c="individual",step:u=1,max:d=100,min:p=0,unit:h="",onUnit:f,showUnit:b=!1,units:m=["px","em","rem"],allowEmpty:g=!0,preset:v="",isBorderRadius:x=!1,firstIcon:k=tu.outlineTopIcon,secondIcon:y=tu.outlineRightIcon,thirdIcon:_=tu.outlineBottomIcon,fourthIcon:w=tu.outlineLeftIcon,linkIcon:C=fd,unlinkIcon:j=bd,reset:S=!0}){const N=(0,ko.useRef)(),[O,E]=(0,ko.useState)(c),M=l?c:O,T=l||E,R=!!g,[I,P]=(0,ko.useState)("Desktop"),L=(0,To.useSelect)(e=>e("kadenceblocks/data").getPreviewDeviceType(),[]);L!==I&&P(L);const{setPreviewDeviceType:A}=(0,To.useDispatch)("kadenceblocks/data"),D=[{name:"Desktop",title:(0,_o.jsx)(yo.Dashicon,{icon:"desktop"}),itemClass:"kb-desk-tab"},{name:"Tablet",title:(0,_o.jsx)(yo.Dashicon,{icon:"tablet"}),itemClass:"kb-tablet-tab"},{name:"Mobile",key:"mobile",title:(0,_o.jsx)(yo.Dashicon,{icon:"smartphone"}),itemClass:"kb-mobile-tab"}];let F=i||["","","",""];"Tablet"===I?F=s||["","","",""]:"Mobile"===I&&(F=r||["","","",""]);const V={};return V.Mobile=(0,_o.jsx)(kf,{className:"measure-mobile-size",label:t?(0,Mo.__)("Mobile:","kadence-blocks")+t:void 0,measurement:r||["","","",""],control:M,onChange:e=>a(e),onControl:e=>T(e),min:p,max:d,step:u,allowEmpty:R,unit:h,showUnit:!0,units:[h],preset:v,isBorderRadius:x,firstIcon:k,secondIcon:y,thirdIcon:_,fourthIcon:w,linkIcon:C,unlinkIcon:j},2),V.Tablet=(0,_o.jsx)(kf,{className:"measure-tablet-size",label:t?(0,Mo.__)("Tablet:","kadence-blocks")+t:void 0,measurement:s||["","","",""],control:M,onChange:e=>o(e),onControl:e=>T(e),min:p,max:d,step:u,allowEmpty:R,unit:h,showUnit:!0,units:[h],preset:v,isBorderRadius:x,firstIcon:k,secondIcon:y,thirdIcon:_,fourthIcon:w,linkIcon:C,unlinkIcon:j},1),V.Desktop=(0,_o.jsx)(kf,{className:"measure-desktop-size",label:t||void 0,measurement:i||["","","",""],control:M,onChange:e=>n(e),onControl:e=>T(e),min:p,max:d,step:u,allowEmpty:R,unit:h,onUnit:f||void 0,showUnit:b,units:m,preset:v,isBorderRadius:x,firstIcon:k,secondIcon:y,thirdIcon:_,fourthIcon:w,linkIcon:C,unlinkIcon:j},0),[n&&o&&a&&(0,_o.jsxs)("div",{ref:N,className:"components-base-control kb-responsive-measure-control",children:[(0,_o.jsxs)("div",{className:"kadence-component__header kadence-title-bar",children:[e&&(0,_o.jsxs)("div",{className:"kadence-component__header__title kadence-title-bar kadence-measure-control__title",children:[(0,_o.jsx)("label",{className:"components-base-control__label",children:e}),S&&(0,_o.jsx)("div",{className:"title-reset-wrap",children:(0,_o.jsx)(yo.Button,{className:"is-reset is-single",label:"reset",isSmall:!0,disabled:!(!(0,Oo.isEqual)(["","","",""],F)&&!(0,Oo.isEqual)(["","auto","","auto"],F)),icon:kd,onClick:()=>"function"==typeof S?S():void("Tablet"===I?o(["","","",""]):"Mobile"===I?a(["","","",""]):n(["","","",""]))})})]}),(0,_o.jsx)(yo.ButtonGroup,{className:"kb-measure-responsive-options","aria-label":(0,Mo.__)("Device","kadence-blocks"),children:(0,Oo.map)(D,({name:e,key:t,title:n,itemClass:o})=>(0,_o.jsx)(yo.Button,{className:`kb-responsive-btn ${o}${e===I?" is-active":""}`,isSmall:!0,"aria-pressed":I===e,onClick:()=>{return t=e,A((0,No.capitalizeFirstLetter)(t)),void P((0,No.capitalizeFirstLetter)(t));var t},children:n},t))}),T&&(0,_o.jsx)(yo.Button,{isSmall:!0,className:"kadence-radio-item kadence-control-toggle radio-custom is-single only-icon",label:"individual"!==M?(0,Mo.__)("Individual","kadence-blocks"):(0,Mo.__)("Linked","kadence-blocks"),icon:"individual"!==M?C:j,onClick:()=>T("individual"!==M?"individual":"linked"),isPressed:"individual"!==M,isTertiary:"individual"===M})]}),(0,_o.jsx)("div",{className:"kb-responsive-measure-control-inner",children:V[I]?V[I]:V.Desktop})]})]}class Rf extends ko.Component{constructor(e,t,n){super(...arguments),this.state={isVisible:!1,color:"",name:""}}componentDidMount(){this.setState({color:this.props.colorValue}),this.setState({name:this.props.nameValue})}render(){const e=()=>{!0===this.state.isVisible&&(this.setState({isVisible:!1}),this.props.onSave(this.state.color,this.state.name))},t=e=>{this.setState({color:e})};return(0,_o.jsxs)("div",{className:"kt-advanced-color-settings-container",children:[this.state.isVisible&&(0,_o.jsxs)(yo.Popover,{position:"top left",className:"kt-popover-color",onClose:e,children:[(0,_o.jsx)(yo.ColorPicker,{color:void 0===this.state.color||""===this.state.color?this.props.colorValue:this.state.color,onChangeComplete:e=>t(e.hex),disableAlpha:!0}),(0,_o.jsx)(yo.TextControl,{label:(0,Mo.__)("Name:"),value:void 0===this.state.name||""===this.state.name?this.props.nameValue:this.state.name,onChange:e=>this.setState({name:e})})]}),this.state.isVisible&&(0,_o.jsx)(yo.Tooltip,{text:(0,Mo.__)("Edit Color"),children:(0,_o.jsx)(yo.Button,{className:"kt-color-icon-indicate",onClick:e,children:(0,_o.jsx)(yo.ColorIndicator,{className:"kt-advanced-color-indicate",colorValue:"transparent"===this.state.color||void 0===this.state.color||""===this.state.color?this.props.colorDefault:this.state.color})})}),!this.state.isVisible&&(0,_o.jsx)(yo.Tooltip,{text:(0,Mo.__)("Edit Color"),children:(0,_o.jsx)(yo.Button,{className:"kt-color-icon-indicate",onClick:()=>{this.setState({isVisible:!0})},children:(0,_o.jsx)(yo.ColorIndicator,{className:"kt-advanced-color-indicate",colorValue:"transparent"===this.state.color||void 0===this.state.color||""===this.state.color?this.props.colorDefault:this.state.color})})})]})}}const If=Rf;function Pf({label:e,swatchLabel:t="",value:n,onChange:o,defaultColor:a="",value2:r,swatchLabel2:s="",onChange2:i,defaultColor2:l="",value3:c,swatchLabel3:u="",onChange3:d,defaultColor3:p="",control:h,onControl:f,firstIcon:b=tu.outlineTopIcon,secondIcon:m=tu.outlineRightIcon,thirdIcon:g=tu.outlineBottomIcon,fourthIcon:v=tu.outlineLeftIcon,linkIcon:x=tu.linkedIcon,unlinkIcon:k=tu.individualIcon,className:y="",reset:_=!1}){const w={first:b,second:m,third:g,fourth:v,link:x,unlink:k},[C,j]=(0,ko.useState)("individual"),S=h||C,N=f||j,O=(0,ko.useRef)();return(0,_o.jsxs)("div",{ref:O,className:"components-base-control kb-border-color-control "+(""!==y?" "+y:""),children:[(0,_o.jsxs)("div",{className:"kadence-title-bar",children:[e&&(0,_o.jsx)("span",{className:"kadence-control-title",children:e}),N&&(0,_o.jsx)("div",{className:"kadence-units kadence-locked",children:"individual"!==S?(0,_o.jsx)(yo.Tooltip,{text:(0,Mo.__)("Individual","kadence-blocks"),children:(0,_o.jsx)(yo.Button,{className:"is-single",isSmall:!0,onClick:()=>N("individual"),children:w.link})}):(0,_o.jsx)(yo.Tooltip,{text:(0,Mo.__)("Linked","kadence-blocks"),children:(0,_o.jsx)(yo.Button,{className:"is-single",isSmall:!0,onClick:()=>N("linked"),children:w.unlink})})})]}),(0,_o.jsxs)("div",{className:"kadence-controls-content-border",children:["individual"!==S&&(0,_o.jsx)(ko.Fragment,{children:(0,_o.jsx)(Po,{label:w.link,swatchLabel:t||"",value:n&&n[0]?n[0]:"",default:a||"",onChange:e=>o([e,e,e,e]),swatchLabel2:s||"",value2:r&&r[0]?r[0]:"",default2:l||"",onChange2:i?e=>i([e,e,e,e]):void 0,swatchLabel3:u||"",value3:c&&c[0]?c[0]:"",default3:p||"",onChange3:d?e=>d([e,e,e,e]):void 0})}),"individual"===S&&(0,_o.jsxs)("div",{className:"kt-border-color-array-control",children:[(0,_o.jsx)(Po,{label:b,swatchLabel:t||"",value:n&&n[0]?n[0]:"",default:a||"",onChange:e=>o([e,n[1],n[2],n[3]]),swatchLabel2:s||"",value2:r&&r[0]?r[0]:"",default2:l||"",onChange2:i?e=>i([e,r[1],r[2],r[3]]):void 0,value3:c&&c[0]?c[0]:"",swatchLabel3:u||"",default3:p||"",onChange3:d?e=>d([e,c[1],c[2],c[3]]):void 0}),(0,_o.jsx)(Po,{label:m,value:n&&n[1]?n[1]:"",swatchLabel:t||"",default:a||"",onChange:e=>o([n[0],e,n[2],n[3]]),swatchLabel2:s||"",value2:r&&r[1]?r[1]:"",default2:l||"",onChange2:i?e=>i([r[0],e,r[2],r[3]]):void 0,value3:c&&c[1]?c[1]:"",swatchLabel3:u||"",default3:p||"",onChange3:d?e=>d([c[0],e,c[2],c[3]]):void 0}),(0,_o.jsx)(Po,{label:g,value:n&&n[2]?n[2]:"",swatchLabel:t||"",default:a||"",onChange:e=>o([n[0],n[1],e,n[3]]),value2:r&&r[2]?r[2]:"",swatchLabel2:s||"",default2:l||"",onChange2:i?e=>i([r[0],r[1],e,r[3]]):void 0,value3:c&&c[2]?c[2]:"",swatchLabel3:u||"",default3:p||"",onChange3:d?e=>d([c[0],c[1],e,c[3]]):void 0}),(0,_o.jsx)(Po,{label:v,value:n&&n[3]?n[3]:"",swatchLabel:t||"",default:a||"",onChange:e=>o([n[0],n[1],n[2],e]),value2:r&&r[3]?r[3]:"",swatchLabel2:s||"",default2:l||"",onChange2:i?e=>i([r[0],r[1],r[2],e]):void 0,value3:c&&c[3]?c[3]:"",swatchLabel3:u||"",default3:p||"",onChange3:d?e=>d([c[0],c[1],c[2],e]):void 0})]})]})]})}const Lf=({label:e,enable:t=!0,color:n,colorDefault:o,opacity:a,blur:r,spread:s,hOffset:i,vOffset:l,inset:c,onColorChange:u,onOpacityChange:d,onBlurChange:p,onHOffsetChange:h,onVOffsetChange:f,onEnableChange:b,onSpreadChange:m,onInsetChange:g,shadowType:v,onArrayChange:x})=>(0,_o.jsxs)("div",{className:"kb-shadow-container components-base-control",children:[e&&(0,_o.jsx)("div",{className:"kt-box-shadow-label",children:(0,_o.jsx)("h2",{className:"kt-beside-color-label",children:e})}),(0,_o.jsxs)("div",{className:"kt-inner-sub-section",children:[(0,_o.jsxs)("div",{className:"kt-inner-sub-section-row",children:[(0,_o.jsxs)("div",{className:"kt-box-color-settings kt-box-shadow-subset",children:[(0,_o.jsx)("p",{className:"kt-box-shadow-title",children:(0,Mo.__)("Color","kadence-blocks")}),(0,_o.jsx)(Po,{value:n||o,default:o,onChange:e=>u(e),opacityValue:a,onOpacityChange:e=>d(e),onArrayChange:x?(e,t)=>x(e,t):void 0})]}),(0,_o.jsxs)("div",{className:"kt-box-x-settings kt-box-shadow-subset",children:[(0,_o.jsx)("p",{className:"kt-box-shadow-title",children:"X"}),(0,_o.jsx)("div",{className:"components-base-control kt-boxshadow-number-input",children:(0,_o.jsx)("div",{className:"components-base-control__field",children:(0,_o.jsx)("input",{value:void 0!==i?i:"",onChange:e=>h(Number(e.target.value)),min:-200,max:200,step:1,type:"number",className:"components-text-control__input"})})})]}),(0,_o.jsxs)("div",{className:"kt-box-y-settings kt-box-shadow-subset",children:[(0,_o.jsx)("p",{className:"kt-box-shadow-title",children:"Y"}),(0,_o.jsx)("div",{className:"components-base-control kt-boxshadow-number-input",children:(0,_o.jsx)("div",{className:"components-base-control__field",children:(0,_o.jsx)("input",{value:void 0!==l?l:"",onChange:e=>f(Number(e.target.value)),min:-200,max:200,step:1,type:"number",className:"components-text-control__input"})})})]}),(0,_o.jsxs)("div",{className:"kt-box-blur-settings kt-box-shadow-subset",children:[(0,_o.jsx)("p",{className:"kt-box-shadow-title",children:"Blur"}),(0,_o.jsx)("div",{className:"components-base-control kt-boxshadow-number-input",children:(0,_o.jsx)("div",{className:"components-base-control__field",children:(0,_o.jsx)("input",{value:void 0!==r?r:"",onChange:e=>p(Number(e.target.value)),min:0,max:200,step:1,type:"number",className:"components-text-control__input"})})})]}),"box"===v&&(0,_o.jsxs)("div",{className:"kt-box-spread-settings kt-box-shadow-subset",children:[(0,_o.jsx)("p",{className:"kt-box-shadow-title",children:(0,Mo.__)("Spread")}),(0,_o.jsx)("div",{className:"components-base-control kt-boxshadow-number-input",children:(0,_o.jsx)("div",{className:"components-base-control__field",children:(0,_o.jsx)("input",{value:void 0!==s?s:"",onChange:e=>m(Number(e.target.value)),min:-200,max:200,step:1,type:"number",className:"components-text-control__input"})})})]})]}),"box"===v&&g&&(0,_o.jsx)("div",{className:"kt-box-inset-settings",children:(0,_o.jsx)(yo.ToggleControl,{label:(0,Mo.__)("Inset"),checked:c,onChange:e=>g(e)})})]})]});function Af({label:e,enable:t=!0,color:n,colorDefault:o,opacity:a,blur:r,spread:s,inset:i,hOffset:l,vOffset:c,onColorChange:u,onOpacityChange:d,onBlurChange:p,onHOffsetChange:h,onVOffsetChange:f,onEnableChange:b,onSpreadChange:m,onInsetChange:g,className:v="",shadowType:x,onArrayChange:k,onApplyShadowPreset:y,reset:_=!0}){const[w,C]=(0,ko.useState)("Desktop"),j=(0,To.useSelect)(e=>e("kadenceblocks/data").getPreviewDeviceType(),[]);j!==w&&C(j);const{setPreviewDeviceType:S}=(0,To.useDispatch)("kadenceblocks/data"),N=[{name:"Desktop",key:"desktop",title:(0,_o.jsx)(yo.Dashicon,{icon:"desktop"}),itemClass:"kb-desk-tab"},{name:"Tablet",key:"tablet",title:(0,_o.jsx)(yo.Dashicon,{icon:"tablet"}),itemClass:"kb-tablet-tab"},{name:"Mobile",key:"mobile",title:(0,_o.jsx)(yo.Dashicon,{icon:"smartphone"}),itemClass:"kb-mobile-tab"}],O={};O.Mobile=(0,_o.jsx)(Lf,{label:(0,Mo.__)("Shadow","kadence-blocks"),enable:t,color:n,colorDefault:o,opacity:a,hOffset:l,vOffset:c,blur:r,spread:s,onEnableChange:b,onColorChange:u,onOpacityChange:d,onHOffsetChange:h,onVOffsetChange:f,onBlurChange:p,onSpreadChange:m,shadowType:x,inset:i,onInsetChange:g,onArrayChange:k,onApplyShadowPreset:y},"mobile-text-shadow-control"),O.Tablet=(0,_o.jsx)(Lf,{label:(0,Mo.__)("Shadow","kadence-blocks"),enable:t,color:n,colorDefault:o,opacity:a,hOffset:l,vOffset:c,blur:r,spread:s,onEnableChange:b,onColorChange:u,onOpacityChange:d,onHOffsetChange:h,onVOffsetChange:f,onBlurChange:p,onSpreadChange:m,shadowType:x,inset:i,onInsetChange:g,onArrayChange:k,onApplyShadowPreset:y},"tablet-text-shadow-control"),O.Desktop=(0,_o.jsx)(Lf,{label:(0,Mo.__)("Shadow","kadence-blocks"),enable:t,color:n,opacity:a,colorDefault:o,hOffset:l,vOffset:c,blur:r,spread:s,onEnableChange:b,onColorChange:u,onOpacityChange:d,onHOffsetChange:h,onVOffsetChange:f,onBlurChange:p,onSpreadChange:m,shadowType:x,inset:i,onInsetChange:g,onArrayChange:k,onApplyShadowPreset:y},"desktop-text-shadow-control");const E=[{value:"none",label:(0,Mo.__)("None","kadence-blocks"),icon:Cc.shadowPresetNone},{value:"soft-inner-glow",label:(0,Mo.__)("Soft Inner Glow","kadence-blocks"),icon:"soft-inner-glow"},{value:"soft-outer-glow",label:(0,Mo.__)("Soft Outer Glow","kadence-blocks"),icon:"soft-outer-glow"},{value:"right-offset-glow",label:(0,Mo.__)("Right Offset Glow","kadence-blocks"),icon:"right-offset-glow"},{value:"bottom-offset-glow",label:(0,Mo.__)("Bottom Offset Glow","kadence-blocks"),icon:"bottom-offset-glow"},{value:"inner-solid",label:(0,Mo.__)("Inner Solid","kadence-blocks"),icon:"inner-solid"},{value:"right-bottom-solid",label:(0,Mo.__)("Right Bottom Solid","kadence-blocks"),icon:"right-bottom-solid"},{value:"top-left-solid",label:(0,Mo.__)("Top Left Solid","kadence-blocks"),icon:"top-left-solid"}],M={none:{hOffset:0,vOffset:0,blur:0,spread:0,inset:!1},"soft-inner-glow":{hOffset:0,vOffset:0,blur:60,spread:-15,inset:!0},"soft-outer-glow":{hOffset:0,vOffset:0,blur:60,spread:5,inset:!1},"right-offset-glow":{hOffset:20,vOffset:20,blur:30,spread:0,inset:!1},"bottom-offset-glow":{hOffset:0,vOffset:35,blur:30,spread:-5,inset:!1},"inner-solid":{hOffset:0,vOffset:0,blur:0,spread:15,inset:!0},"right-bottom-solid":{hOffset:15,vOffset:15,blur:0,spread:0,inset:!1},"top-left-solid":{hOffset:-15,vOffset:-15,blur:0,spread:0,inset:!1}};return[b&&(0,_o.jsxs)("div",{className:"components-base-control kb-responsive-range-control"+(""!==v?" "+v:""),children:[(0,_o.jsxs)("div",{className:"kadence-title-bar",children:[e&&(0,_o.jsxs)("span",{className:"kadence-control-title",children:[e,_&&(0,_o.jsx)(yo.Button,{className:"is-reset is-single",isSmall:!0,disabled:!1===t,icon:kd,onClick:()=>{"function"==typeof _?_():b("reset")}})]}),(0,_o.jsx)(yo.ButtonGroup,{className:"kb-measure-responsive-options","aria-label":(0,Mo.__)("Device","kadence-blocks"),children:(0,Oo.map)(N,({name:e,key:t,title:n,itemClass:o})=>(0,_o.jsx)(yo.Button,{className:`kb-responsive-btn ${o}${e===w?" is-active":""}`,isSmall:!0,"aria-pressed":w===e,onClick:()=>{return t=e,S((0,No.capitalizeFirstLetter)(t)),void C((0,No.capitalizeFirstLetter)(t));var t},children:n},t))})]}),(0,_o.jsxs)("div",{children:["box"===x&&(0,_o.jsx)(wc,{value:0,options:E,wrap:!0,hideLabel:!0,className:"kadence-box-shadow-radio-btns",onChange:e=>{(e=>{y({hOffset:M[e].hOffset,vOffset:M[e].vOffset,blur:M[e].blur,spread:M[e].spread,inset:M[e].inset})})(e)}}),O[w]?O[w]:O.Desktop]})]})]}const Df=window.wp.notices;function Ff({attributes:e,defaultAttributes:t={},blockSlug:n,excludedAttrs:o=[],preventMultiple:a=[]}){const[r,s]=(0,ko.useState)(kadence_blocks_params.userrole?kadence_blocks_params.userrole:"admin");if("admin"!==r)return null;const{createErrorNotice:i,createSuccessNotice:l}=(0,To.useDispatch)(Df.store),[c,u]=(0,ko.useState)(!1),[d,p]=(0,ko.useState)(!1),[h,f]=(0,ko.useState)(!1),b=(0,No.SafeParseJSON)((0,Oo.get)(kadence_blocks_params,["configuration"],{}),!0),m=(0,Oo.get)(b,n,{}),[g,v]=(0,ko.useState)(m),x=0!==Object.keys(m).length;return(0,_o.jsxs)(_o.Fragment,{children:[(0,_o.jsxs)(Id,{title:(0,Mo.__)("Block Defaults","kadence-blocks"),initialOpen:!1,panelName:`kb-${n}-defaults`,children:[(0,Mo.__)("This will set the current block attributes as the default styles for this block type.","kadence-blocks")," ",(0,Mo.__)("This will not modify any blocks that have already been created.","kadence-blocks")," ",(0,Mo.__)("Block content is not included.","kadence-blocks")," ",(0,_o.jsx)("br",{}),(0,_o.jsx)("br",{}),(0,_o.jsx)(yo.Button,{isPrimary:!0,onClick:()=>p(!0),children:(0,Mo.__)(" Save as default","kadence-blocks")}),x&&(0,_o.jsxs)(_o.Fragment,{children:[(0,_o.jsx)("br",{}),(0,_o.jsx)("br",{}),(0,_o.jsx)("a",{href:"#",onClick:()=>f(!0),children:(0,Mo.__)("Modify attributes","kadence-blocks")}),(0,_o.jsx)("a",{href:"#",style:{color:"red",float:"right"},onClick:()=>u(!0),children:(0,Mo.__)("Reset defaults","kadence-blocks")})]})]}),(0,_o.jsx)(yo.__experimentalConfirmDialog,{isOpen:c,onConfirm:()=>(()=>{let e=kadence_blocks_params.configuration?(0,No.SafeParseJSON)(kadence_blocks_params.configuration,!0):{};e=(0,Oo.omit)(e,n),Vd()({path:"/wp/v2/settings",method:"POST",data:{kadence_blocks_config_blocks:JSON.stringify(e)}}).then(()=>{l((0,Mo.__)("Block default saved","kadence-blocks"),{type:"snackbar"}),u(!1),kadence_blocks_params.configuration=JSON.stringify(e),v({})})})(),onCancel:()=>u(!1),children:(0,Mo.__)("Are you sure you'd like to reset this blocks default attributes?","kadence-blocks")}),(0,_o.jsx)(yo.__experimentalConfirmDialog,{isOpen:d,onConfirm:()=>(()=>{const r=(0,No.getTransferableAttributes)(e,t,o,a),s=kadence_blocks_params.configuration?(0,No.SafeParseJSON)(kadence_blocks_params.configuration,!0):{};s[n]=r,Vd()({path:"/wp/v2/settings",method:"POST",data:{kadence_blocks_config_blocks:JSON.stringify(s)}}).then(()=>{l((0,Mo.__)("Block default saved","kadence-blocks"),{type:"snackbar"}),p(!1),kadence_blocks_params.configuration=JSON.stringify(s),v(r)})})(),onCancel:()=>p(!1),children:(0,Mo.__)("Are you sure you'd like to save this as the blocks default attributes?","kadence-blocks")}),h?(0,_o.jsxs)(yo.Modal,{className:"kt-block-defaults-modal",title:(0,Mo.__)("Modify Block Defaults","kadence-blocks"),onRequestClose:()=>{v(m),f(!1)},children:[Object.keys(g).map((e,t)=>(0,_o.jsx)(_o.Fragment,{children:(0,_o.jsxs)("div",{style:{marginBottom:"10px"},children:[(0,_o.jsx)(yo.Button,{onClick:()=>v((0,Oo.omit)(g,e)),children:(0,_o.jsx)("span",{className:"dashicons dashicons-trash"})}),(0,_o.jsx)("span",{style:{verticalAlign:"super"},children:e})]},t)})),(0,_o.jsxs)("div",{className:"kb-modal-footer",children:[(0,_o.jsx)(yo.Button,{className:"kt-defaults-save",isDestructive:!0,disabled:!1,onClick:()=>{v(m),f(!1)},children:(0,Mo.__)("Cancel","kadence-blocks")}),(0,_o.jsx)(yo.Button,{className:"kt-defaults-save",isPrimary:!0,onClick:()=>{(()=>{const e=kadence_blocks_params.configuration?(0,No.SafeParseJSON)(kadence_blocks_params.configuration,!0):{};e[n]=g,Vd()({path:"/wp/v2/settings",method:"POST",data:{kadence_blocks_config_blocks:JSON.stringify(e)}}).then(()=>{l((0,Mo.__)("Block default saved","kadence-blocks"),{type:"snackbar"}),kadence_blocks_params.configuration=JSON.stringify(e)})})(),f(!1)},children:(0,Mo.__)("Save","kadence-blocks")})]})]}):null]})}function Vf({isOpen:e,setIsOpen:t,callback:n}){const[o,a]=(0,ko.useState)(""),[r,s]=(0,ko.useState)([]),[i,l]=(0,ko.useState)([]),[c,u]=(0,ko.useState)(null),[d,p]=(0,ko.useState)(!1),[h,f]=(0,ko.useState)(!1),[b,m]=(0,ko.useState)(!1),[g,v]=(0,ko.useState)(0),{createSuccessNotice:x}=(0,To.useDispatch)(Df.store),[k,y]=(0,ko.useState)(1),[_,w]=(0,ko.useState)(!1),C=(0,ko.useRef)(null);(0,ko.useEffect)(()=>{e&&C.current&&C.current.focus()},[e]);const j=async()=>{if(s([]),l([]),u(null),p(!0),y(1),v(0),o)try{const e=await Vd()({path:(0,hc.addQueryArgs)("/kb-custom-svg/v1/search",{search:o,page:1}),method:"GET"});e.success?(s(e),l(e.svgs.icons),w(e.svgs.has_more)):u(`Error ${e.code}: ${e.message||"Unexpected error occurred."}`)}catch(e){u(`Error ${e.code||"unknown"}: ${e.message||"An unexpected error occurred."}`)}finally{p(!1)}else p(!1)};return(0,_o.jsxs)("div",{className:"svg-search-modal",children:[(0,_o.jsxs)("div",{className:"svg-search-modal__input_row",children:[(0,_o.jsx)(yo.TextControl,{label:(0,Mo.__)("Search Icons","kadence-blocks"),hideLabelFromVision:!0,value:o,placeholder:(0,Mo.__)("Search Icons","kadence-blocks"),onChange:e=>{a(e)},onKeyDown:e=>{"Enter"===e.key&&j()},ref:C}),(0,_o.jsx)(yo.Button,{isPrimary:!0,className:"svg-search-modal__search-button",onClick:j,isBusy:d,disabled:d||0===o.length||h||b,children:(0,Mo.__)("Search","kadence-blocks")})]}),d&&(0,_o.jsx)("div",{className:"svg-search-modal__loading",children:(0,_o.jsx)(yo.Spinner,{className:"wp-spinner"})}),!d&&i.length>0&&(0,_o.jsxs)(_o.Fragment,{children:[(0,_o.jsx)("ul",{className:"svg-search-modal__results",children:i.map((e,t)=>(0,_o.jsx)("li",{onClick:()=>(e=>{v(e)})(t),style:{width:"84px",height:"88px",border:g===t?"2px solid var(--wp-components-color-accent, var(--wp-admin-theme-color, #007cba))":"2px solid transparent"},children:(0,_o.jsx)("img",{src:e.url,alt:e.title})},t))}),(0,_o.jsxs)("div",{className:"footer",children:[(0,_o.jsx)(yo.Button,{isSecondary:!0,onClick:async()=>{if(_){u(null),f(!0);try{const e=k+1,t=await Vd()({path:(0,hc.addQueryArgs)("/kb-custom-svg/v1/search",{search:o,page:e}),method:"GET"});t.svgs&&t.svgs.icons?(l(e=>[...e,...t.svgs.icons]),y(e),w(t.svgs.has_more)):u("No further results found.")}catch(e){u("Failed to load more icons, please try again.")}finally{f(!1)}}},isBusy:h,disabled:!_||b,children:(0,Mo.__)("Load More","kadence-blocks")}),(0,_o.jsx)(yo.Button,{isPrimary:!0,isBusy:b,disabled:h,onClick:()=>(async()=>{if(i&&g>=0){const e=i[g];if(!e||!e.url)return void u((0,Mo.__)("Selected SVG is invalid. Please try again.","kadence-blocks"));const o=e.url;m(!0);try{const a=await Vd()({path:"/kb-custom-svg/v1/search/add",method:"POST",data:{svgUrl:o,title:e.title||"",id:e.id||""}});if(!a?.value||!a?.label)throw new Error((0,Mo.__)("Invalid response from the server.","kadence-blocks"));x((0,Mo.__)("SVG Saved.","kadence-blocks"),{type:"snackbar"}),n(a.value),t(!1)}catch(e){u((0,Mo.__)("Failed to add the SVG. Please try again.","kadence-blocks"))}finally{m(!1)}}else u((0,Mo.__)("No SVG selected","kadence-blocks"))})(),children:(0,Mo.__)("Add","kadence-blocks")})]})]}),c&&(0,_o.jsx)("p",{className:"svg-search-modal__error",style:{color:"red"},children:c}),!d&&!c&&(!r||r.svgs&&0===r.svgs.icons.length)&&(0,_o.jsx)("p",{className:"svg-search-modal__no-results",children:(0,Mo.__)("No results found. Please try a different search.","kadence-blocks")}),!d&&!r.svgs&&!c&&(0,_o.jsx)("p",{className:"svg-search-modal__start-search",children:(0,Mo.__)("Start Search...","kadence-blocks")})]})}function Bf({isOpen:e,setIsOpen:t,callback:n,proVersion:o}){const[a,r]=(0,ko.useState)("upload"),[s,i]=(0,ko.useState)(""),[l,c]=(0,ko.useState)(""),[u,d]=(0,ko.useState)(null),[p,h]=(0,ko.useState)(""),{createSuccessNotice:f}=(0,To.useDispatch)(Df.store),b=(0,No.compareVersions)(o,"2.7.0")>=0;return(0,_o.jsx)(_o.Fragment,{children:e&&(0,_o.jsx)(yo.Modal,{title:(0,Mo.__)("Add a Custom Icon ","kadence-blocks"),className:"upload-svg-modal",size:"medium",onRequestClose:()=>t(!1),children:(0,_o.jsx)(yo.TabPanel,{className:"kb-icon-block__add-icon-modal-tabs",activeClass:"active-tab",tabs:[{name:"upload",title:"Upload",className:"tab-one"},...b?[{name:"search",title:"Search",className:"tab-two"}]:[]],children:o=>(0,_o.jsxs)("div",{className:"modal-body",children:["upload"===o.name&&(0,_o.jsxs)(_o.Fragment,{children:[(0,_o.jsxs)("div",{className:"security-notice",children:[(0,_o.jsx)("h4",{children:(0,Mo.__)("Important: SVG Safety","kadence-blocks")}),(0,_o.jsxs)("p",{children:[(0,Mo.__)("SVGs can contain malicious code. For your security, we suggest sanitizing your files before uploading.","kadence-blocks")," ",(0,_o.jsx)("a",{href:"https://www.kadencewp.com/help-center/docs/kadence-blocks/custom-icons/",children:(0,Mo.__)("Learn more about SVG security and supported SVG formatting.","kadence-blocks")})]})]}),""!==l&&(0,_o.jsx)("div",{className:"error-message",children:l}),"upload"===a&&(0,_o.jsxs)("div",{className:"drag-drop-container",children:[(0,_o.jsx)(yo.TextControl,{placeholder:(0,Mo.__)("Title your SVG","kadence-blocks"),value:p,onChange:e=>h(e)}),(0,_o.jsx)(yo.FormFileUpload,{accept:"image/svg+xml",onChange:e=>{d(e.currentTarget.files),""===p&&h((0,Oo.get)(e.currentTarget.files,["0","name"],"").replace(".svg",""))},render:({openFileDialog:e})=>(0,_o.jsxs)("div",{onClick:e,className:"drag-drop-target",style:{position:"relative"},children:[(0,_o.jsx)(yo.DropZone,{label:(0,Mo.__)("Upload SVG","kadence-blocks"),onFilesDrop:e=>{d(e),""===p&&h((0,Oo.get)(e,["0","name"],"").replace(".svg",""))}}),null===u||0===u.length?(0,_o.jsxs)(_o.Fragment,{children:[(0,_o.jsx)("h3",{children:(0,Mo.__)("Select a file or drop it here","kadence-blocks")}),(0,_o.jsx)("p",{children:(0,Mo.__)("SVG dimensions: 24px by 24px","kadence-blocks")})]}):(0,_o.jsxs)(_o.Fragment,{children:[(0,_o.jsx)("h3",{children:(0,Mo.__)("File Selected","kadence-blocks")}),(0,_o.jsx)("p",{children:(0,Oo.get)(u,["0","name"],"")})]}),(0,_o.jsx)(yo.Button,{isPrimary:!0,children:null===u?(0,Mo.__)("Select a file","kadence-blocks"):(0,Mo.__)("Change file","kadence-blocks")})]})}),(0,_o.jsx)(yo.Button,{type:"link",onClick:()=>{r("paste"),d(null)},children:(0,Mo.__)("Paste an SVG","kadence-blocks")})]}),"paste"===a&&(0,_o.jsxs)("div",{className:"paste-container",children:[(0,_o.jsx)("h3",{children:(0,Mo.__)("Paste your SVG","kadence-blocks")}),(0,_o.jsx)(yo.TextControl,{placeholder:(0,Mo.__)("Title your SVG","kadence-blocks"),value:p,onChange:e=>h(e)}),(0,_o.jsx)(yo.TextareaControl,{value:s,onChange:e=>i(e)}),(0,_o.jsx)(yo.Button,{type:"link",onClick:()=>{r("upload"),i("")},children:(0,Mo.__)("Upload an SVG","kadence-blocks")})]}),(0,_o.jsxs)("div",{className:"footer",children:[(0,_o.jsx)(yo.Button,{isSecondary:!0,onClick:()=>t(!1),children:(0,Mo.__)("Cancel","kadence-blocks")}),(0,_o.jsx)(yo.Button,{isPrimary:!0,onClick:()=>{!function(){const e=new FileReader;let o;if("upload"==(null!==u?"upload":"paste")){if(!u||0===u.length)return void c((0,Mo.__)("No file selected","kadence-blocks"));if(o=u[0],"image/svg+xml"!==o.type)return void c((0,Mo.__)("The selected file is not an SVG","kadence-blocks"))}else{if(!s.trim())return void c((0,Mo.__)("No SVG content pasted","kadence-blocks"));o=new Blob([s],{type:"image/svg+xml"})}e.onload=function(e){const o=e.target.result;""!==o&&Vd()({path:"/kb-custom-svg/v1/manage",data:{file:o,title:p},method:"POST"}).then(e=>{(0,Oo.has)(e,"value")&&(0,Oo.has)(e,"label")?(f((0,Mo.__)("SVG Saved.","kadence-blocks"),{type:"snackbar"}),n(e.value),t(!1)):(0,Oo.has)(e,"error")&&(0,Oo.has)(e,"message")?c(e.message):c((0,Mo.__)("An error occurred when uploading your file","kadence-blocks"))})},e.readAsText(o)}()},children:(0,Mo.__)("Add","kadence-blocks")})]})]}),"search"===o.name&&b&&(0,_o.jsx)(Vf,{isOpen:e,setIsOpen:t,callback:n})]})})})})}function zf({isOpen:e,setIsOpen:t,id:n,callback:o}){const{createSuccessNotice:a,createErrorNotice:r}=(0,To.useDispatch)(Df.store),s=()=>{r((0,Mo.__)("There was an error deleting the SVG.","kadence-blocks"),{type:"snackbar"})};return(0,_o.jsx)(_o.Fragment,{children:e&&null!==n&&(0,_o.jsxs)(yo.Modal,{title:(0,Mo.__)("Delete SVG"),onRequestClose:()=>t(!1),children:[(0,_o.jsx)(yo.Button,{isSecondary:!0,onClick:()=>t(!1),children:(0,Mo.__)("Cancel","kadence-blocks")}),(0,_o.jsx)(yo.Button,{isDestructive:!0,onClick:()=>{(e=>{Vd()({path:`/wp/v2/kadence_custom_svg/${e}`,method:"DELETE"}).then(e=>{(0,Oo.get)(e,"id",!1)?(a((0,Mo.__)("SVG Deleted.","kadence-blocks"),{type:"snackbar"}),o()):(0,Oo.has)(e,"error")&&(0,Oo.has)(e,"message")?(console.log(e.message),s()):(console.log("An error occurred when delete your svg"),s())}).catch(e=>{console.log(e),s()})})(n),t(!1)},children:(0,Mo.__)("Delete","kadence-blocks")})]})})}function Hf({value:e,onChange:t,label:n,placeholder:o=(0,Mo.__)("Select Icon","kadence-blocks"),showSearch:a=!0,renderFunc:r=null,className:s,theme:i="default",allowClear:l=!1,icons:c=null}){const[u,d]=(0,ko.useState)(),[p,h]=(0,ko.useState)(!1),[f,b]=(0,ko.useState)(""),[m,g]=(0,ko.useState)("all"),[v,x]=(0,ko.useState)(!1),[k,y]=(0,ko.useState)(!1),[_,w]=(0,ko.useState)(null),[C,j]=(0,ko.useState)(!1),[S,N]=(0,ko.useState)([]),[O,E]=(0,ko.useState)(!1),M=!(!kadence_blocks_params.pro||"true"!==kadence_blocks_params.pro),T=window?.kbpData?(0,Oo.get)(window.kbpData,["pVersion"],"1.0.0"):"1.0.0",R=(0,No.compareVersions)(T,"2.4.0")>=0,I=(0,Oo.debounce)(()=>{h(!p)},100),P=async(e=!1)=>{if(e||M&&R&&!1===C&&!O){try{E(!0);const t=await Uf(e);if(t.length>0){const e=t.map(e=>e.id.toString()),n={};t.forEach(e=>{n[e.id.toString()]=e.title.rendered.toLowerCase()}),!(0,Oo.isEqual)(e,C)&&e.length>0&&(j(e),N(n))}else j([])}catch(e){j([]),console.error("Failed to fetch custom SVGs (picker):",e)}E(!1)}};(0,ko.useEffect)(()=>{P()});const L=(0,Mo.__)("My Icons","kadence-blocks"),A=(0,ko.useMemo)(()=>{if(c){const e=c.map(e=>({value:e,label:e}));return C.length>0?{[L]:C,...e}:M&&R?{[L]:["placeholder"],...e}:e}const e=(0,hp.applyFilters)("kadence.icon_options_names",kadence_blocks_params.icon_names);return C.length>0?{[L]:C,...e}:M&&R?{[L]:["placeholder"],...e}:e},[kadence_blocks_params.icon_names,c,C]),D=(0,ko.useMemo)(()=>(0,hp.applyFilters)("kadence.icon_options",{...kadence_blocks_params_ico.icons,...kadence_blocks_params_fa.icons,...kadence_blocks_params_kbcustomicons.icons}),[kadence_blocks_params_ico.icons,kadence_blocks_params_fa.icons,kadence_blocks_params_kbcustomicons.icons,C]),F=(0,ko.useMemo)(()=>{let e=Object.keys(A).map((e,t)=>({value:t,label:e}));return[{value:"all",label:(0,Mo.__)("Show All","kadence-blocks")},...e]},[kadence_blocks_params.icon_names,A]),V=(0,ko.useCallback)(e=>e.startsWith("kb-custom")?(0,_o.jsx)(mf,{className:`kt-svg-icon-single-${e}`,name:e}):(0,_o.jsx)(ff,{className:`kt-svg-icon-single-${e}`,name:e,icon:D[e]}),[D]),B=r||V,z=(0,ko.useMemo)(()=>{let e={};if(!c){const t=f.toLowerCase();Object.keys(A).map((n,o)=>{"all"!==m&&o!==parseInt(m)||A[n].map((a,r)=>{const s=a.toLowerCase();if(""===f||s.includes(t)||0===o&&(0,Oo.has)(S,s.toString())&&S[s.toString()].includes(t))return e={...e,[o]:{label:n,icons:{...e[o]?.icons,[a]:D[a]}}},a})})}return e},[f,m,A]);return(0,_o.jsxs)("div",{className:"kadence-icon-picker",children:[(0,_o.jsx)(Bf,{isOpen:v,setIsOpen:x,callback:e=>{t("kb-custom-"+e.toString()),P(!0)},proVersion:T}),(0,_o.jsx)(zf,{isOpen:k,setIsOpen:y,id:_,callback:()=>{P(!0),w(null)}}),(0,_o.jsxs)("div",{className:`kadence-icon-picker-selection kadence-icon-picker-theme-${i||"default"}${s?" "+s:""}`,children:[n&&(0,_o.jsx)("div",{className:"kadence-icon-picker__title",children:(0,_o.jsx)("label",{className:"components-base-control__label",children:n})}),(0,_o.jsxs)("div",{className:"kadence-icon-picker-toggle-wrap",children:[(0,_o.jsxs)("button",{onClick:()=>I(),ref:d,className:"kadence-icon-picker-link kadence-icon-picker-selection-toggle",children:[(0,_o.jsx)("span",{className:"kadence-icon-picker-selection-value"+(e?"":" kadence-icon-picker-placeholder"),children:e?B(e):o}),(0,_o.jsx)("span",{className:"kadence-icon-picker-selection-arrow",children:(0,_o.jsx)(yo.Icon,{icon:nf})})]}),e&&l&&(0,_o.jsx)("button",{className:"kadence-icon-picker-clear",onClick:()=>{t(""),h(!1)},children:(0,_o.jsx)(yo.Icon,{icon:Zc})})]})]}),p&&(0,_o.jsx)(yo.Popover,{headerTitle:(0,Mo.__)("Select Icon","kadence-blocks"),noArrow:!1,onClose:I,placement:"bottom-end",anchor:u,className:`kadence-icon-picker-pop-selection kadence-icon-picker-pop-theme-${i||"default"}`,children:(0,_o.jsxs)("div",{className:"kadence-icon-picker-container",children:[a&&(0,_o.jsxs)("div",{className:"kadence-icon-picker-search",children:[(0,_o.jsx)(yo.TextControl,{label:(0,Mo.__)("Search Icons","kadence-blocks"),hideLabelFromVision:!0,value:f,placeholder:(0,Mo.__)("Search Icons","kadence-blocks"),onChange:e=>b(e)}),(0,_o.jsx)(yo.SelectControl,{label:(0,Mo.__)("Filter Icons","kadence-blocks"),hideLabelFromVision:!0,value:m,options:F,onChange:g})]}),(0,_o.jsxs)("div",{className:"kadence-icon-picker-content"+(a?" has-search":""),children:[c&&(0,_o.jsx)("div",{className:"kadence-icon-grid-wrap",children:c.map(e=>(0,_o.jsx)("button",{className:"kadence-icon-picker-link",onClick:()=>{t(e),I()},children:B(e)}))}),!c&&(0,_o.jsxs)(_o.Fragment,{children:[0===Object.keys(z).length&&(0,_o.jsx)("div",{style:{padding:"15px"},children:(0,_o.jsx)("p",{children:(0,Mo.__)("No icons found","kadence-blocks")})}),Object.keys(z).map(e=>(0,_o.jsx)(yo.PanelBody,{title:z[e].label,children:(0,_o.jsxs)("div",{className:"kadence-icon-grid-wrap",children:[z[e].label===L&&""===f&&R&&M&&(0,_o.jsx)("button",{className:"kadence-icon-picker-link add-custom-svg",onClick:()=>{x(!0),I()},children:(0,_o.jsx)(yo.Icon,{icon:Eu})}),Object.keys(z[e].icons).map(n=>{if(z[e].label===L){if("placeholder"===n)return;return(0,_o.jsxs)("div",{className:"kb-custom-svg",children:[M&&R&&(0,_o.jsx)("div",{className:"custom-svg-delete",onClick:()=>{w(n),y(!0)},children:(0,_o.jsx)(yo.Icon,{icon:Zc,size:20})}),(0,_o.jsx)("button",{title:n,className:"kadence-icon-picker-link",onClick:()=>{t("kb-custom-"+n),I()},children:B("kb-custom-"+n)},z[e].label+n)]})}return(0,_o.jsx)("button",{title:n,className:"kadence-icon-picker-link",onClick:()=>{t(n),I()},children:B(n)},z[e].label+n)})]})},e))]})]})]})})]})}const Uf=async(e=!1)=>{const t={per_page:100};e&&(t.cache_bust=(new Date).getTime());const n=new URLSearchParams(t),o=await fetch(kadence_blocks_params.rest_url+`wp/v2/kadence_custom_svg?${n.toString()}`,{method:"GET"});if(!o.ok)throw new Error("Network response was not ok");return o.json()};function Gf({label:e,value:t,onChange:n,source:o,contextPost:a=null,className:r=null,termIsMulti:s=!1,taxOnly:i=!1,termIsOptional:l=!1}){const c=`inspector-taxonomy-select-control-${(0,_c.useInstanceId)(Gf)}`,[u,d]=(0,ko.useState)(!0),[p,h]=(0,ko.useState)([]);let f="";f=i||l&&"string"==typeof t?t:(0,Oo.isArrayLike)(t)&&(0,Oo.has)(t,[0,"value"])&&!(0,Oo.isEmpty)(t)?t[0].value.split("|"):t&&!(0,Oo.isEmpty)(t)?t.split("|"):[""];const[b,m]=(0,ko.useState)("object"==typeof f?f[0]:f);return(0,ko.useEffect)(()=>{let e=o||a;if(wp.data.select("core/editor")&&!e)if(kadence_blocks_params.isKadenceE&&kadenceElementParams.previewPostID){const t=(0,No.tryParseJSON)(kadenceElementParams.previewPostID);e=t&&t.id?t.id:""}else e=wp.data.select("core/editor").getCurrentPostId();const t={source:e};d(!0),Vd()({path:(0,hc.addQueryArgs)(window.kadence_blocks_params.taxonomiesEndpoint,t)}).then(e=>{h(e||[]),d(!1)}).catch(()=>{d(!1),h([])})},[o]),u?(0,_o.jsx)(yo.Spinner,{}):(0,_o.jsxs)("div",{className:"components-base-control kb-taxonomy-select-control"+(r?" "+r:""),children:[e&&(0,_o.jsx)("label",{htmlFor:c,className:"components-taxonomy-select-control__label kb-dynamic-components-label",children:e}),(0,_o.jsx)(pc,{options:p,id:c,className:"kb-dynamic-select",classNamePrefix:"kbp",value:""!==b?p.filter(({value:e})=>e===b):"",isMulti:!1,isSearchable:!0,isClearable:!0,menuPortalTarget:document.body,styles:{menuPortal:e=>({...e,zIndex:99999999})},maxMenuHeight:200,placeholder:(0,Mo.__)("Select Taxonomy","kadence-blocks"),onChange:e=>{i||l?e?(m(e.value),n(e.value)):(m(""),n("")):m(e?e.value:"")}}),""!==b&&!i&&(0,_o.jsx)(Bd,{source:b,value:t,isMulti:s,onChange:e=>{e&&!(0,Oo.isEmpty)(e)?n(e):n(l&&b?b:"")}})]})}function $f({clientId:e,label:t=null,parentSlug:n=null}){const{selectBlock:o}=(0,To.useDispatch)(Eo.store),{firstParentClientId:a}=(0,To.useSelect)(t=>{const{getBlockParents:o,getBlockParentsByBlockName:a}=t(Eo.store);let r,s;return s=null!==n?a(e,n):o(e),r=s[s.length-1],{firstParentClientId:r}},[]);if(void 0===a)return null;const r=(0,Eo.useBlockDisplayInformation)(a);return(0,_o.jsx)("div",{className:"kadence-blocks-block-parent-selector",children:(0,_o.jsx)(yo.Button,{className:"kadence-blocks-block-parent-selector__button",onClick:()=>o(a),icon:(0,_o.jsx)(Eo.BlockIcon,{icon:r?.icon}),children:t||(0,Mo.__)("View Parent Block Settings","kadence-blocks")})},a)}function Wf({clientId:e,label:t=null,childSlug:n=null}){const{selectBlock:o}=(0,To.useDispatch)(Eo.store),{childClientId:a}=(0,To.useSelect)(t=>{const{getBlocksByClientId:o,getBlock:a}=t(Eo.store),r=(e,t)=>{const n=a(e);if(!n)return null;for(const e of n.innerBlocks){if(e.name===t)return e.clientId;const n=r(e.clientId,t);if(n)return n}return null};let s;if(null!==n)s=r(e,n);else{const t=o(e)[0]?.innerBlocks[0]||null;s=t?.clientId}return{childClientId:s}},[e,n]);if(void 0===a)return null;const r=(0,Eo.useBlockDisplayInformation)(a);return(0,_o.jsx)("div",{className:"kadence-blocks-block-child-selector",children:(0,_o.jsx)(yo.Button,{className:"kadence-blocks-block-child-selector__button",onClick:()=>o(a),icon:(0,_o.jsx)(Eo.BlockIcon,{icon:r?.icon}),children:t||(0,Mo.__)("View Child Block Settings","kadence-blocks")})},a)}function qf({label:e,onChange:t,isSaving:n,value:o="",placeholder:a=null,className:r="",obfuscate:s=!0,help:i=""}){const[l,c]=(0,ko.useState)(""),u=`inspector-obfuscate-text-control-${(0,_c.useInstanceId)(qf)}`;return[t&&(0,_o.jsxs)("div",{className:"components-base-control kadence-obfuscate-text-control"+(r?" "+r:""),children:[e&&(0,_o.jsx)("label",{htmlFor:u,className:"components-background-obfuscate-text-control__label",children:e}),(0,_o.jsxs)("div",{className:"kadence-obfuscate-text-control-inner",children:[!o&&(0,_o.jsxs)(_o.Fragment,{children:[(0,_o.jsx)(yo.TextControl,{id:u,value:l,placeholder:a,onChange:e=>c(e)}),(0,_o.jsxs)(yo.Button,{isPrimary:!0,isSmall:!0,className:"kb-obfuscate-save",onClick:()=>t(l),disabled:""===l,children:[(0,Mo.__)("Save","kadence-blocks"),n?(0,_o.jsx)(yo.Spinner,{}):""]})]}),o&&s&&(0,_o.jsxs)(_o.Fragment,{children:[(0,_o.jsx)(yo.TextControl,{id:u,value:"***************************",readOnly:!0}),(0,_o.jsxs)(yo.Button,{isSecondary:!0,isSmall:!0,className:"kb-obfuscate-save",onClick:()=>t(""),children:[(0,Mo.__)("Remove","kadence-blocks"),n?(0,_o.jsx)(yo.Spinner,{}):""]})]}),o&&!s&&(0,_o.jsxs)(_o.Fragment,{children:[(0,_o.jsx)(yo.TextControl,{id:u,value:o,readOnly:!0}),(0,_o.jsxs)(yo.Button,{isSecondary:!0,isSmall:!0,className:"kb-obfuscate-save",onClick:()=>t(""),children:[(0,Mo.__)("Clear","kadence-blocks"),n?(0,_o.jsx)(yo.Spinner,{}):""]})]})]})]})]}function Xf({postType:e="posts",title:t="",onSelect:n,initialOpen:o=!0,useForceState:a=!1,forceOpen:r=!1,onPanelBodyToggle:s}){const i=""===t?(0,Mo.__)("Posts","kadence-blocks"):t,[l,c]=(0,ko.useState)([]),[u,d]=(0,ko.useState)(!0),[p,h]=(0,ko.useState)(!1),[f,b]=(0,ko.useState)(1),[m,g]=(0,ko.useState)([]),[v,x]=(0,ko.useState)([]),[k,y]=(0,ko.useState)(!1),[_,w]=(0,ko.useState)(""),[C,j]=(0,ko.useState)("recent"),S=(0,ko.useRef)(null),N=(0,ko.useRef)(null);function O(e){return"post"===e?"posts":"page"===e?"pages":e}(0,ko.useEffect)(()=>{E()},[C,f]),(0,ko.useEffect)(()=>{const e=()=>{const e=S.current;e.scrollTop+e.clientHeight+25>=e.scrollHeight&&"search"!==C&&(u||p||!k||(b(f+1),h(!0)))},t=S.current;return t&&t.addEventListener("scroll",e),()=>{t&&t.removeEventListener("scroll",e)}},[u,p]);const E=(t="standard",n="")=>{p||d(!0);const o={per_page:30,page:f};"search"===t?o.search=n:"categories"!==e&&"product_cat"!==e&&(o.orderby="all"===C?"title":"date",o.order="all"===C?"asc":"desc"),Vd()({path:(0,hc.addQueryArgs)(`/wp/v2/${O(e)}`,o),parse:!1}).then(e=>{e.json().then(n=>{p?g(e=>[...e,...n]):"search"===t?x(n):g(n),d(!1),h(!1);const o=e.headers.get("X-WP-TotalPages");y(o>f)})}).catch(()=>{p||(g([]),x([])),d(!1),h(!1)})},M=()=>{l.length===m.length?c([]):c(m)},T=(0,ko.useMemo)(()=>(0,Oo.debounce)(e=>{E("search",e)},300),[]),R=(0,ko.useCallback)(e=>{w(e),T(e)},[T]),I=(t=null)=>{const n=t||m;return(0,_o.jsxs)("div",{children:[(0,_o.jsxs)("div",{ref:S,className:"posts-container",children:[n.map(t=>(0,_o.jsx)("div",{children:(0,_o.jsx)(yo.CheckboxControl,{label:(0,$h.decodeEntities)("categories"===e||"product_cat"===e?t?.name:t?.title?.rendered),checked:l.some(e=>e.id===t.id),onChange:()=>(e=>{c(t=>t.some(t=>t.id===e.id)?t.filter(t=>t.id!==e.id):[...t,e])})(t)})},t.id)),p&&(0,_o.jsx)("div",{children:(0,_o.jsx)(yo.Spinner,{})})]}),(0,_o.jsx)("div",{style:{marginTop:"10px"},children:(0,_o.jsx)(yo.CheckboxControl,{label:(0,Mo.__)("Select All","kadence-blocks"),checked:l.length===m.length,indeterminate:l.length>0&&l.length<m.length,onChange:M})})]})},P={};return a?P.opened=r:P.initialOpen=o,s&&(P.onToggle=s),(0,_o.jsxs)(yo.PanelBody,{className:"kb-post-selector-checkbox",title:i,...P,children:[(0,_o.jsx)(yo.TabPanel,{className:"tab-panel",activeClass:"active-tab",onSelect:e=>{C!==e&&(j(e),w(""),c([]),b(1))},tabs:[{name:"recent",title:(0,Mo.__)("Recent","kadence-blocks"),className:"tab-one"},{name:"all",title:(0,Mo.__)("All","kadence-blocks"),className:"all-tab"},{name:"search",title:(0,Mo.__)("Search","kadence-blocks"),className:"search-tab"}],children:e=>(0,_o.jsx)("div",{className:"tab-content-container",children:(0,_o.jsx)("div",{className:"tab-content",children:"recent"===e.name||"all"===e.name?(0,_o.jsx)(_o.Fragment,{children:u?(0,_o.jsx)(yo.Spinner,{}):I()}):(0,_o.jsxs)("div",{className:"search-container",children:[(0,_o.jsx)(yo.TextControl,{ref:N,value:_,onChange:e=>R(e),placeholder:(0,Mo.__)("Search posts...","kadence-blocks")}),(0,_o.jsx)(_o.Fragment,{children:u?(0,_o.jsx)(yo.Spinner,{}):I(v)})]})})})}),(0,_o.jsx)(yo.Button,{isPrimary:!0,onClick:()=>{n(l),c([])},children:(0,Mo.__)("Add to Menu","kadence-blocks")})]})}(0,Mo.__)("None","kadence-blocks"),(0,Mo.__)("None","kadence-blocks"),(0,Mo.__)("XXS","kadence-blocks"),(0,Mo.__)("2X Small","kadence-blocks"),(0,Mo.__)("XS","kadence-blocks"),(0,Mo.__)("X Small","kadence-blocks"),(0,Mo.__)("SM","kadence-blocks"),(0,Mo.__)("Small","kadence-blocks"),(0,Mo.__)("MD","kadence-blocks"),(0,Mo.__)("Medium","kadence-blocks"),(0,Mo.__)("LG","kadence-blocks"),(0,Mo.__)("Large","kadence-blocks"),(0,Mo.__)("XL","kadence-blocks"),(0,Mo.__)("X Large","kadence-blocks"),(0,Mo.__)("XXL","kadence-blocks"),(0,Mo.__)("2X Large","kadence-blocks"),(0,Mo.__)("3XL","kadence-blocks"),(0,Mo.__)("3X Large","kadence-blocks"),(0,Mo.__)("4XL","kadence-blocks"),(0,Mo.__)("4X Large","kadence-blocks"),(0,Mo.__)("5XL","kadence-blocks"),(0,Mo.__)("5X Large","kadence-blocks");const Jf=({children:e})=>{const[t,n]=(0,ko.useState)(null),o=(0,ko.useRef)(null);if((0,ko.useEffect)(()=>{if(!o.current?.parentElement)return;const e=()=>{o.current?.parentElement&&n((e=>{const{top:t,right:n,bottom:o,left:a,width:r,height:s}=e.getBoundingClientRect();return{top:t,right:n,bottom:o,left:a,width:r,height:s}})(o.current.parentElement))};e();const t=new ResizeObserver(()=>{e()});return t.observe(o.current.parentElement),()=>{o.current?.parentElement&&t.unobserve(o.current.parentElement),t.disconnect()}},[]),!t)return(0,_o.jsx)("div",{ref:o});if("function"==typeof e){const n=e(t);return n?(0,_o.jsx)("div",{ref:o,children:n}):null}return React.cloneElement(e,{...t,ref:t=>{o.current=t;const{ref:n}=e;"function"==typeof n?n(t):n&&(n.current=t)}})};function Kf(e){const{attributes:t,setAttributes:n,previewDevice:o,columns:a,columnWidths:r,columnGap:s,columnsUnlocked:i,onColumnsUnlocked:l,onResize:c,onResizeStop:u,onResizeTablet:d,onResizeStopTablet:p,onResizeMobile:h,onResizeStopMobile:f,active:b}=e,{uniqueID:m,columnGutter:g,customGutter:v,gutterType:x}=t,k=(0,No.getPreviewSize)(o,r,r,r),y=(e,t,n)=>{const a=w(e,t,n);f&&"Mobile"==o?f(a):p&&"Tablet"==o?p(a):u(a)},_=(e,t,n)=>{const a=w(e,t,n);h&&"Mobile"==o?h(a):d&&"Tablet"==o?d(a):c(a)},w=(e,t,n)=>{let o,r,s;const l=n.style.width,c=parseInt(n.dataset?.column),u=k[c],d=c+1,p=k[d],h=0==c?0:k.slice(0,c).reduce((e,t)=>e+t,0);i?(o=Math.round(10*parseFloat(l))/10-h,r=o-(u||10),s=Math.round(10*Math.abs((p||10)-r))/10):(o=5*Math.round(parseInt(l)/5)-h,r=o-(u||10),s=5*Math.round(Math.abs((p||10)-r)/5));var f=[...k];if(f[c]=o,f[d]=s,a>2){f=f.map(e=>i?Math.round(10*parseFloat(e))/10:5*Math.round(parseInt(e)/5));const e=f.reduce((e,t)=>e+t,0),t=100-e,n=c==a-2?0:f.length-1;f[n]=f[n]+t}return f},C=Bc()({"kt-resizeable-column-container":!0,[`kt-resizeable-column-container${m}`]:m,"kt-resizeable-column-inactive":!b});var j=e=>{var t=[];for(let n=0;n<a-1;n++){const o=k?.[n],r=k?.[n+1],c=0==n?0:k.slice(0,n).reduce((e,t)=>e+t,0),u=10,d="calc((((("+s+" * "+(a-1)+")) / "+a+") * "+-1*(n+1)+") + ( ("+s+" * "+n+") + ("+s+" / 2 ) ) )",p=(0,_o.jsx)(yo.ResizableBox,{className:"editor-row-column__resizer",size:{width:c+o+"%"},style:{left:d},minWidth:c+u+"%",maxWidth:c+o+r-u+"%",enable:{right:!No.isRTL,left:!!No.isRTL},handleClasses:{right:"components-resizable-box__handle components-resizable-box__handle-right",left:"components-resizable-box__handle components-resizable-box__handle-left"},handleWrapperClass:"editor-row-controls-container",grid:i?[e/1e3,1]:[e/20,1],onResize:_,onResizeStop:y,axis:"x","data-column":n,children:(0,_o.jsxs)("span",{className:"editor-row-controls-container kadence-resize-extra-controls",children:[i&&(0,_o.jsx)(yo.Tooltip,{text:(0,Mo.__)("Switch to 5% step resizing","kadence-blocks"),children:(0,_o.jsx)(yo.Button,{className:"kt-fluid-grid-btn",isSmall:!0,onClick:()=>l(!1),children:(0,_o.jsx)("svg",{viewBox:"0 0 20 20",width:"20",height:"20",xmlns:"http://www.w3.org/2000/svg",fillRule:"evenodd",clipRule:"evenodd",strokeLinejoin:"round",strokeMiterlimit:"1.414",children:(0,_o.jsx)("path",{d:"M4.217,10.611l0,2.7l-3.31,-3.311l3.31,-3.311l0,2.7l11.566,0l0,-2.7l3.31,3.311l-3.31,3.311l0,-2.7l-11.566,0Z"})})})}),!i&&(0,_o.jsx)(yo.Tooltip,{text:(0,Mo.__)("Switch to fluid resizing","kadence-blocks"),children:(0,_o.jsx)(yo.Button,{className:"kt-fluid-grid-btn",isSmall:!0,onClick:()=>l(!0),children:(0,_o.jsxs)("svg",{viewBox:"0 0 20 20",width:"20",height:"20",xmlns:"http://www.w3.org/2000/svg",fillRule:"evenodd",clipRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:"1.5",children:[(0,_o.jsx)("path",{d:"M13.967,10.611l0.001,-1.222l1.815,0l0,-2.7l3.31,3.311l-3.31,3.311l0,-2.7l-1.816,0Z"}),(0,_o.jsx)("path",{d:"M8.918,10.611l-0.022,-1.222l2.15,0l-0.031,1.222l-2.097,0Z"}),(0,_o.jsx)("path",{d:"M4.217,10.611l0,2.7l-3.31,-3.311l3.31,-3.311l0,2.7l1.693,0l-0.028,1.222l-1.665,0Z"}),(0,_o.jsx)("circle",{cx:"12.427",cy:"9.997",r:"1.419",fill:"none",stroke:"#0085ba"}),(0,_o.jsx)("circle",{cx:"7.456",cy:"9.997",r:"1.419",fill:"none",stroke:"#0085ba"})]})})}),(0,_o.jsx)("span",{id:`left-column-width-${n}`,className:"left-column-width-size column-width-size-handle",children:o+"%"}),(0,_o.jsx)("span",{id:`right-column-width-${n}`,className:"right-column-width-size column-width-size-handle",children:r+"%"})]})});t.push(p)}return t};return(0,_o.jsx)("div",{className:C,children:(0,_o.jsx)(Jf,{children:({width:e})=>(0,_o.jsx)(_o.Fragment,{children:j(e)})})})}const Yf=({steps:e,isOpen:t,onRequestClose:n,onSubmit:o})=>{const[a,r]=(0,ko.useState)(0),[s,i]=(0,ko.useState)({meta:{isValid:!0}}),l=()=>{a<e.length-1&&r(a+1)},c=()=>{a>0&&r(a-1)},u=()=>{delete s.meta,o(s),n({complete:!0})};if((0,ko.useEffect)(()=>{Number.isInteger(s?.meta?.exitAndCallbackStep)&&s?.meta?.exitAndCallbackStep===a&&u()},[s,a]),(0,ko.useEffect)(()=>{const e=document.getElementsByClassName("has-scrolled-content");for(let t=0;t<e.length;t++)e[t].scrollTo(0,0)},[a]),t)return(0,_o.jsxs)(yo.Modal,{className:"kadence-onboarding-modal",isDismissible:!1,__experimentalHideHeader:!0,size:"fill",onRequestClose:n,children:[(0,_o.jsxs)("div",{className:"header",style:e[a]?.containerData?.headerStyle,children:[(0,_o.jsx)("img",{src:kadence_blocks_params.kadenceBlocksUrl+"/includes/settings/img/kadence-logo.png",alt:"Kadence Blocks"}),(0,_o.jsx)("div",{className:"close",onClick:()=>{delete s.meta,n({complete:!1})},children:(0,_o.jsx)(yo.Dashicon,{icon:"no-alt"})})]}),(0,_o.jsx)("div",{children:React.createElement(e[a].component,{data:s,componentData:e[a].componentData,onChange:e=>(e=>{i(t=>({...t,...e}))})(e),handleNextStep:l,handlePreviousStep:c,handleFinish:u})},a),(0,_o.jsxs)("div",{className:"footer",children:[(0,_o.jsx)("div",{className:"back",children:(0,_o.jsx)(yo.Button,{onClick:c,icon:"arrow-left-alt",disabled:0===a,children:(0,Mo.__)("Back","kadence-blocks")})}),(0,_o.jsx)("div",{className:"step-indicator",children:e[a]?.hideSteps?null:e.map((e,t)=>e?.hideSteps?null:(0,_o.jsxs)("div",{className:"step "+(t===a?"active":""),children:[(0,_o.jsx)("div",{className:"number",children:e.visualNumber}),(0,Mo.__)(e.name,"kadence-blocks")]},t))}),(0,_o.jsx)("div",{className:"next",children:a<e.length-1?(0,_o.jsx)(yo.Button,{isPrimary:!0,disabled:!s.meta.isValid,onClick:l,children:s.meta?.nextText?s.meta.nextText:(0,Mo.__)("Next","kadence-blocks")}):(0,_o.jsx)(yo.Button,{isPrimary:!0,onClick:u,children:(0,Mo.__)("Finish","kadence-blocks")})})]})]})}})(),(this.kadence=this.kadence||{}).components=r})();
  • kadence-blocks/tags/3.5.28/kadence-blocks.php

    r3391357 r3408408  
    66 * Author: Kadence WP
    77 * Author URI: https://www.kadencewp.com
    8  * Version: 3.5.27
     8 * Version: 3.5.28
    99 * Requires PHP: 7.4
    1010 * Text Domain: kadence-blocks
     
    2121define( 'KADENCE_BLOCKS_PATH', realpath( plugin_dir_path( __FILE__ ) ) . DIRECTORY_SEPARATOR );
    2222define( 'KADENCE_BLOCKS_URL', plugin_dir_url( __FILE__ ) );
    23 define( 'KADENCE_BLOCKS_VERSION', '3.5.27' );
     23define( 'KADENCE_BLOCKS_VERSION', '3.5.28' );
    2424
    2525require_once plugin_dir_path( __FILE__ ) . 'vendor/vendor-prefixed/autoload.php';
  • kadence-blocks/tags/3.5.28/readme.txt

    r3391357 r3408408  
    44Donate link: https://www.kadencewp.com/about-us/
    55Requires at least: 6.6
    6 Tested up to: 6.8.3
    7 Stable tag: 3.5.27
     6Tested up to: 6.9
     7Stable tag: 3.5.28
    88Requires PHP: 7.4
    99License: GPLv2 or later
     
    174174
    175175== Changelog ==
     176= 3.5.28 =
     177Release Date: 2nd December 2025
     178* Update: Improve compatibility with WordPress 6.9.
     179
    176180= 3.5.27 =
    177181Release Date: 6th November 2025
  • kadence-blocks/tags/3.5.28/vendor/autoload.php

    r3303153 r3408408  
    2020require_once __DIR__ . '/composer/autoload_real.php';
    2121
    22 return ComposerAutoloaderInit6d32022b9c863d1c3003f9643a50ed81::getLoader();
     22return ComposerAutoloaderInit6e3141dc35a5efed55bf0b472cccdf31::getLoader();
  • kadence-blocks/tags/3.5.28/vendor/composer/autoload_real.php

    r3303153 r3408408  
    33// autoload_real.php @generated by Composer
    44
    5 class ComposerAutoloaderInit6d32022b9c863d1c3003f9643a50ed81
     5class ComposerAutoloaderInit6e3141dc35a5efed55bf0b472cccdf31
    66{
    77    private static $loader;
     
    2323        }
    2424
    25         spl_autoload_register(array('ComposerAutoloaderInit6d32022b9c863d1c3003f9643a50ed81', 'loadClassLoader'), true, true);
     25        spl_autoload_register(array('ComposerAutoloaderInit6e3141dc35a5efed55bf0b472cccdf31', 'loadClassLoader'), true, true);
    2626        self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
    27         spl_autoload_unregister(array('ComposerAutoloaderInit6d32022b9c863d1c3003f9643a50ed81', 'loadClassLoader'));
     27        spl_autoload_unregister(array('ComposerAutoloaderInit6e3141dc35a5efed55bf0b472cccdf31', 'loadClassLoader'));
    2828
    2929        require __DIR__ . '/autoload_static.php';
    30         call_user_func(\Composer\Autoload\ComposerStaticInit6d32022b9c863d1c3003f9643a50ed81::getInitializer($loader));
     30        call_user_func(\Composer\Autoload\ComposerStaticInit6e3141dc35a5efed55bf0b472cccdf31::getInitializer($loader));
    3131
    3232        $loader->register(true);
  • kadence-blocks/tags/3.5.28/vendor/composer/autoload_static.php

    r3303153 r3408408  
    55namespace Composer\Autoload;
    66
    7 class ComposerStaticInit6d32022b9c863d1c3003f9643a50ed81
     7class ComposerStaticInit6e3141dc35a5efed55bf0b472cccdf31
    88{
    99    public static $prefixLengthsPsr4 = array (
     
    5252    {
    5353        return \Closure::bind(function () use ($loader) {
    54             $loader->prefixLengthsPsr4 = ComposerStaticInit6d32022b9c863d1c3003f9643a50ed81::$prefixLengthsPsr4;
    55             $loader->prefixDirsPsr4 = ComposerStaticInit6d32022b9c863d1c3003f9643a50ed81::$prefixDirsPsr4;
    56             $loader->classMap = ComposerStaticInit6d32022b9c863d1c3003f9643a50ed81::$classMap;
     54            $loader->prefixLengthsPsr4 = ComposerStaticInit6e3141dc35a5efed55bf0b472cccdf31::$prefixLengthsPsr4;
     55            $loader->prefixDirsPsr4 = ComposerStaticInit6e3141dc35a5efed55bf0b472cccdf31::$prefixDirsPsr4;
     56            $loader->classMap = ComposerStaticInit6e3141dc35a5efed55bf0b472cccdf31::$classMap;
    5757
    5858        }, null, ClassLoader::class);
  • kadence-blocks/tags/3.5.28/vendor/composer/installed.json

    r3303153 r3408408  
    209209        {
    210210            "name": "enshrined/svg-sanitize",
    211             "version": "0.21.0",
    212             "version_normalized": "0.21.0.0",
     211            "version": "0.22.0",
     212            "version_normalized": "0.22.0.0",
    213213            "source": {
    214214                "type": "git",
    215215                "url": "https://github.com/darylldoyle/svg-sanitizer.git",
    216                 "reference": "5e477468fac5c5ce933dce53af3e8e4e58dcccc9"
    217             },
    218             "dist": {
    219                 "type": "zip",
    220                 "url": "https://api.github.com/repos/darylldoyle/svg-sanitizer/zipball/5e477468fac5c5ce933dce53af3e8e4e58dcccc9",
    221                 "reference": "5e477468fac5c5ce933dce53af3e8e4e58dcccc9",
     216                "reference": "0afa95ea74be155a7bcd6c6fb60c276c39984500"
     217            },
     218            "dist": {
     219                "type": "zip",
     220                "url": "https://api.github.com/repos/darylldoyle/svg-sanitizer/zipball/0afa95ea74be155a7bcd6c6fb60c276c39984500",
     221                "reference": "0afa95ea74be155a7bcd6c6fb60c276c39984500",
    222222                "shasum": ""
    223223            },
     
    230230                "phpunit/phpunit": "^6.5 || ^8.5"
    231231            },
    232             "time": "2025-01-13T09:32:25+00:00",
     232            "time": "2025-08-12T10:13:48+00:00",
    233233            "type": "library",
    234234            "installation-source": "dist",
     
    251251            "support": {
    252252                "issues": "https://github.com/darylldoyle/svg-sanitizer/issues",
    253                 "source": "https://github.com/darylldoyle/svg-sanitizer/tree/0.21.0"
     253                "source": "https://github.com/darylldoyle/svg-sanitizer/tree/0.22.0"
    254254            },
    255255            "install-path": "../enshrined/svg-sanitize"
  • kadence-blocks/tags/3.5.28/vendor/composer/installed.php

    r3391357 r3408408  
    22    'root' => array(
    33        'name' => 'kadencewp/kadence-blocks',
    4         'pretty_version' => '3.5.27',
    5         'version' => '3.5.27.0',
    6         'reference' => '6de882e08a868968a2693ec66969515094f2cfb5',
     4        'pretty_version' => '3.5.28',
     5        'version' => '3.5.28.0',
     6        'reference' => 'f82abcca7da0e05521afbb8adf8faa35ccb6f242',
    77        'type' => 'wordpress-plugin',
    88        'install_path' => __DIR__ . '/../../',
     
    3030        ),
    3131        'enshrined/svg-sanitize' => array(
    32             'pretty_version' => '0.21.0',
    33             'version' => '0.21.0.0',
    34             'reference' => '5e477468fac5c5ce933dce53af3e8e4e58dcccc9',
     32            'pretty_version' => '0.22.0',
     33            'version' => '0.22.0.0',
     34            'reference' => '0afa95ea74be155a7bcd6c6fb60c276c39984500',
    3535            'type' => 'library',
    3636            'install_path' => __DIR__ . '/../enshrined/svg-sanitize',
     
    4848        ),
    4949        'kadencewp/kadence-blocks' => array(
    50             'pretty_version' => '3.5.27',
    51             'version' => '3.5.27.0',
    52             'reference' => '6de882e08a868968a2693ec66969515094f2cfb5',
     50            'pretty_version' => '3.5.28',
     51            'version' => '3.5.28.0',
     52            'reference' => 'f82abcca7da0e05521afbb8adf8faa35ccb6f242',
    5353            'type' => 'wordpress-plugin',
    5454            'install_path' => __DIR__ . '/../../',
  • kadence-blocks/tags/3.5.28/vendor/vendor-prefixed/enshrined/svg-sanitize/src/Sanitizer.php

    r3257981 r3408408  
    427427             * We have to do this as the link is still ran in this case.
    428428             */
    429             if (false !== strpos($attrName, 'href')) {
     429            if (false !== stripos($attrName, 'href')) {
    430430                $href = $element->getAttribute($attrName);
    431431                if (false === $this->isHrefSafeValue($href)) {
     
    459459    protected function cleanXlinkHrefs(\DOMElement $element)
    460460    {
    461         $xlinks = $element->getAttributeNS('http://www.w3.org/1999/xlink', 'href');
    462         if (false === $this->isHrefSafeValue($xlinks)) {
    463             $element->removeAttributeNS( 'http://www.w3.org/1999/xlink', 'href' );
    464             $this->xmlIssues[] = array(
    465                 'message' => 'Suspicious attribute \'href\'',
    466                 'line' => $element->getLineNo(),
    467             );
    468         }
     461        foreach ($element->attributes as $attribute) {
     462            // remove attributes with unexpected namespace prefix, e.g. `XLinK:href` (instead of `xlink:href`)
     463            if ($attribute->prefix === '' && strtolower($attribute->nodeName) === 'xlink:href') {
     464                $element->removeAttribute($attribute->nodeName);
     465                $this->xmlIssues[] = array(
     466                    'message' => sprintf('Unexpected attribute \'%s\'', $attribute->nodeName),
     467                    'line' => $element->getLineNo(),
     468                );
     469            }
     470        }
     471        $this->cleanHrefAttributes($element, 'xlink');
    469472    }
    470473
     
    476479    protected function cleanHrefs(\DOMElement $element)
    477480    {
    478         $href = $element->getAttribute('href');
    479         if (false === $this->isHrefSafeValue($href)) {
    480             $element->removeAttribute('href');
    481             $this->xmlIssues[] = array(
    482                 'message' => 'Suspicious attribute \'href\'',
    483                 'line' => $element->getLineNo(),
    484             );
     481        $this->cleanHrefAttributes($element);
     482    }
     483
     484    protected function cleanHrefAttributes(\DOMElement $element, string $prefix = ''): void
     485    {
     486        $relevantAttributes = array_filter(
     487            iterator_to_array($element->attributes),
     488            static function (\DOMAttr $attr) use ($prefix) {
     489                return strtolower($attr->name) === 'href' && strtolower($attr->prefix) === $prefix;
     490            }
     491        );
     492        foreach ($relevantAttributes as $attribute) {
     493            if (!$this->isHrefSafeValue($attribute->value)) {
     494                $element->removeAttribute($attribute->nodeName);
     495                $this->xmlIssues[] = array(
     496                    'message' => sprintf('Suspicious attribute \'%s\'', $attribute->nodeName),
     497                    'line' => $element->getLineNo(),
     498                );
     499                continue;
     500            }
     501            // in case the attribute name is `HrEf`/`xlink:HrEf`, adjust it to `href`/`xlink:href`
     502            if (!in_array($attribute->nodeName, $this->allowedAttrs, true)
     503                && in_array(strtolower($attribute->nodeName), $this->allowedAttrs, true)
     504            ) {
     505                $element->removeAttribute($attribute->nodeName);
     506                $element->setAttribute(strtolower($attribute->nodeName), $attribute->value);
     507            }
    485508        }
    486509    }
  • kadence-blocks/trunk/dist/components.asset.php

    r3391357 r3408408  
    1 <?php return array('dependencies' => array('kadence-helpers', 'kadence-icons', 'lodash', 'react', 'react-dom', 'react-jsx-runtime', 'wp-api-fetch', 'wp-block-editor', 'wp-components', 'wp-compose', 'wp-data', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keycodes', 'wp-notices', 'wp-primitives', 'wp-url'), 'version' => 'ca204dabfe9dcf9253de');
     1<?php return array('dependencies' => array('kadence-helpers', 'kadence-icons', 'lodash', 'react', 'react-dom', 'react-jsx-runtime', 'wp-api-fetch', 'wp-block-editor', 'wp-components', 'wp-compose', 'wp-data', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keycodes', 'wp-notices', 'wp-primitives', 'wp-url'), 'version' => '22f69fa372555e6b5012');
  • kadence-blocks/trunk/dist/components.js

    r3375940 r3408408  
    3838// translators: %s: color hex code e.g: "#f00".
    3939// translators: %s: color hex code e.g: "#f00".
    40 (0,Mo.sprintf)((0,Mo.__)("Color code: %s","kadence-blocks"),n)})}),h&&(0,_o.jsx)(yo.Dashicon,{icon:"admin-site"}),!o.startsWith("theme-palette")&&u===n&&(0,_o.jsx)(yo.Dashicon,{icon:"saved"})]},n)})})]}),style:null!==a?{left:`${a}%`,transform:"translateX( -50% )"}:void 0})};const $u=Gu;function Wu(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 qu={id:"IDLE"};function Xu({background:e,hasGradient:t,value:n,onChange:o,disableInserter:a=!1,isRenderedInSidebar:r}){const s=(0,ko.useRef)(),[i,l]=(0,ko.useReducer)(Wu,qu),c=e=>{const t=Fu(e.clientX,s.current);(0,Oo.some)(n,({position:e})=>Math.abs(t-e)<Mu)?"MOVING_INSERTER"===i.id&&l({type:"STOP_INSERTER_MOVE"}):l({type:"MOVE_INSERTER",insertPosition:t})},u="MOVING_INSERTER"===i.id,d="INSERTING_CONTROL_POINT"===i.id;return(0,_o.jsx)("div",{className:Bc()("components-custom-gradient-picker__gradient-bar",{"has-gradient":t}),onMouseEnter:c,onMouseMove:c,style:{background:e},onMouseLeave:()=>{l({type:"STOP_INSERTER_MOVE"})},children:(0,_o.jsxs)("div",{ref:s,className:"components-custom-gradient-picker__markers-container",children:[!a&&(u||d)&&(0,_o.jsx)($u.InsertPoint,{isRenderedInSidebar:r,insertPosition:i.insertPosition,value:n,onChange:o,onOpenInserter:()=>{l({type:"OPEN_INSERTER"})},onCloseInserter:()=>{l({type:"CLOSE_INSERTER"})}}),(0,_o.jsx)($u,{isRenderedInSidebar:r,disableRemove:a,gradientPickerDomRef:s,ignoreMarkerPosition:d?i.insertPosition:void 0,value:n,onChange:o,onStartControlPointChange:()=>{l({type:"START_CONTROL_CHANGE"})},onStopControlPointChange:()=>{l({type:"STOP_CONTROL_CHANGE"})}})]})})}var Ju=a(9942);const Ku="linear-gradient(135deg, rgb(6, 147, 227) 0%, rgb(20, 39, 109) 100%)",Yu={type:"angular",value:90},Zu=[{type:"shape",value:"ellipse",at:{type:"position",value:{x:{type:"position-keyword",value:"center"},y:{type:"position-keyword",value:"center"}}}}],Qu=[{value:"linear-gradient",label:(0,Mo.__)("Linear","kadence-blocks")},{value:"radial-gradient",label:(0,Mo.__)("Radial","kadence-blocks")}],ed=[{value:"center top",label:(0,Mo.__)("Center Top","kadence-blocks")},{value:"center center",label:(0,Mo.__)("Center Center","kadence-blocks")},{value:"center bottom",label:(0,Mo.__)("Center Bottom","kadence-blocks")},{value:"left top",label:(0,Mo.__)("Left Top","kadence-blocks")},{value:"left center",label:(0,Mo.__)("Left Center","kadence-blocks")},{value:"left bottom",label:(0,Mo.__)("Left Bottom","kadence-blocks")},{value:"right top",label:(0,Mo.__)("Right Top","kadence-blocks")},{value:"right center",label:(0,Mo.__)("Right Center","kadence-blocks")},{value:"right bottom",label:(0,Mo.__)("Right Bottom","kadence-blocks")}],td={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 nd({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 od({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)}).map(nd)].filter(Boolean).join(",")})`}function ad(e){return void 0===e.length||"%"!==e.length.type}function rd(e){switch(e.type){case"hex":return`#${e.value}`;case"literal":return e.value;case"rgb":case"rgba":return`${e.type}(${e.value.join(",")})`;default:return"transparent"}}const sd=({gradientAST:e,hasGradient:t,onChange:n})=>{var o;const a=null!==(o=e?.orientation?.value)&&void 0!==o?o:180;return(0,_o.jsx)(yo.AnglePickerControl,{__nextHasNoMarginBottom:!0,onChange:t=>{n(od({...e,orientation:{type:"angular",value:t}}))},labelPosition:"top",value:t?a:""})},id=({gradientAST:e,hasGradient:t,onChange:n})=>{const{type:o}=e;return(0,_o.jsx)(yo.SelectControl,{className:"components-custom-gradient-picker__type-picker kadence-select-large",label:(0,Mo.__)("Type"),labelPosition:"top",onChange:t=>{"linear-gradient"===t&&n(od({...e,orientation:Yu,type:"linear-gradient"})),"radial-gradient"===t&&n(od({...e,orientation:Zu,type:"radial-gradient"}))},options:Qu,value:t&&o})},ld=({gradientAST:e,hasGradient:t,onChange:n})=>{let o="center center",a="50%",r="50%",s="position-keyword";e?.orientation&&e?.orientation[0]?.at?.value?.x?.value&&(s=e.orientation[0].at.value.x.type,"position-keyword"!==s?(o=e.orientation[0].at.value.x.value+"% "+e.orientation[0].at.value.y.value+"%",a=e.orientation[0].at.value.x.value+"%",r=e.orientation[0].at.value.y.value+"%"):o=e.orientation[0].at.value.x.value+" "+e.orientation[0].at.value.y.value);const i=t=>{const a=o.split(" ");let r="%"===t?50:"center",s="%"===t?50:"center";if(a[0])switch(a[0]){case"left":r=0;break;case"right":r="100";break;case"center":r=50;break;case 0:s="left";break;case 100:s="right";break;case 50:s="center"}if(a[1])switch(a[1]){case"top":s=0;break;case"bottom":s=100;break;case"center":s=50;break;case 0:s="top";break;case 100:s="bottom";break;case 50:s="center"}n(od({...e,orientation:[{type:"shape",value:e.orientation[0].value,at:{type:"position",value:{x:{type:t,value:r},y:{type:t,value:s}}}}]}))};if(t)return(0,_o.jsxs)("div",{className:"components-base-control kadence-gradient-position-control",children:[(0,_o.jsx)(yo.Flex,{justify:"space-between",className:"kadence-gradient-position_header",children:(0,_o.jsx)(yo.FlexItem,{children:(0,_o.jsx)("label",{className:"kadence-gradient-position__label",children:(0,Mo.__)("Position","kadence-blocks")})})}),"position-keyword"===s&&(0,_o.jsxs)("div",{className:"kadence-controls-content",children:[(0,_o.jsx)(yo.SelectControl,{className:"components-custom-gradient-picker__position-picker",onChange:t=>{const o=t.split(" ");n(od({...e,orientation:[{type:"shape",value:e.orientation[0].value,at:{type:"position",value:{x:{type:"position-keyword",value:void 0!==o[0]&&o[0]?o[0]:"center"},y:{type:"position-keyword",value:void 0!==o[1]&&o[1]?o[1]:"center"}}}}]}))},options:ed,value:o}),(0,_o.jsx)(yo.Button,{className:"kadence-control-toggle-advanced only-icon",label:(0,Mo.__)("Set custom position","kadence-blocks"),icon:zc,onClick:()=>i("%"),isPressed:!1,isTertiary:!0})]}),"position-keyword"!==s&&(0,_o.jsxs)("div",{className:"kadence-controls-content",children:[(0,_o.jsx)(yo.__experimentalUnitControl,{labelPosition:"left",label:(0,Mo.__)("Left","kadence-blocks"),max:100,min:0,units:[{value:"%",label:"%"}],value:a,onChange:t=>{n(od({...e,orientation:[{type:"shape",value:e.orientation[0].value,at:{type:"position",value:{x:{type:"%",value:parseInt(t,10)},y:e.orientation[0].at.value.y}}}]}))}}),(0,_o.jsx)(yo.__experimentalUnitControl,{labelPosition:"left",label:(0,Mo.__)("Top","kadence-blocks"),max:100,min:0,value:r,units:[{value:"%",label:"%"}],onChange:t=>{n(od({...e,orientation:[{type:"shape",value:e.orientation[0].value,at:{type:"position",value:{x:e.orientation[0].at.value.x,y:{type:"%",value:parseInt(t,10)}}}}]}))}}),(0,_o.jsx)(yo.Button,{className:"kadence-control-toggle-advanced only-icon",label:(0,Mo.__)("Set standard position","kadence-blocks"),icon:zc,onClick:()=>i("position-keyword"),isPrimary:!0,isPressed:!0})]})]})},cd=({gradientAST:e,hasGradient:t,onChange:n})=>{let o="ellipse";return e?.orientation&&e?.orientation[0]?.type&&"shape"===e?.orientation[0]?.type&&e?.orientation[0]?.value&&(o=e?.orientation&&e?.orientation[0]?.value),(0,_o.jsx)(yo.SelectControl,{className:"components-custom-gradient-picker__shape-picker kadence-select-large",label:(0,Mo.__)("Shape","kadence-blocks"),labelPosition:"top",onChange:t=>{n(od({...e,orientation:[{type:"shape",value:t,at:e.orientation[0].at}]}))},options:[{value:"ellipse",label:(0,Mo.__)("Ellipse","kadence-blocks")},{value:"circle",label:(0,Mo.__)("Circle","kadence-blocks")}],value:t&&o})};function ud({value:e,onChange:t,isRenderedInSidebar:n=!0}){const o=function(e){let t;try{t=Ju.parse(e)[0],t.value=e}catch(e){t=Ju.parse(Ku)[0],t.value=Ku}if("directional"===t.orientation?.type&&(t.orientation.type="angular",t.orientation.value=td[t.orientation.value].toString()),t.colorStops.some(ad)){const{colorStops:e}=t,n=100/(e.length-1);e.forEach((e,t)=>{e.length={value:n*t,type:"%"}}),t.value=od(t)}return t}(e),a=function(e){return od({type:"linear-gradient",orientation:Yu,colorStops:e.colorStops})}(o),r=o.value!==Ku,s=o.colorStops.map(e=>({color:rd(e),position:parseInt(e.length.value)}));return(0,_o.jsxs)("div",{className:"components-base-control components-custom-gradient-picker kadence-gradient-control",children:[(0,_o.jsx)(Xu,{isRenderedInSidebar:n,background:a,hasGradient:r,value:s,onChange:e=>{t(od(function(e,t){return{...e,colorStops:t.map(({position:e,color:t})=>{if(t.startsWith("var("))return{length:{type:"%",value:e?.toString()},type:"literal",value:t};const{r:n,g:o,b:a,a:r}=Ou(t).toRgb();return{length:{type:"%",value:e?.toString()},type:r<1?"rgba":"rgb",value:r<1?[n,o,a,r]:[n,o,a]}})}}(o,e)))}}),(0,_o.jsxs)(yo.Flex,{gap:3,className:"components-custom-gradient-picker__ui-line",children:[(0,_o.jsx)("div",{className:"components-custom-gradient-picker__item components-custom-gradient-picker-type",children:(0,_o.jsx)(id,{gradientAST:o,hasGradient:r,onChange:t})}),"linear-gradient"===o.type&&(0,_o.jsx)("div",{className:"components-custom-gradient-picker__item components-custom-gradient-picker-angle",children:(0,_o.jsx)(sd,{gradientAST:o,hasGradient:r,onChange:t})}),"radial-gradient"===o.type&&(0,_o.jsx)("div",{className:"components-custom-gradient-picker__item components-custom-gradient-picker-shape",children:(0,_o.jsx)(cd,{gradientAST:o,hasGradient:r,onChange:t})})]}),"radial-gradient"===o.type&&(0,_o.jsx)(yo.Flex,{gap:3,className:"components-custom-gradient-picker__ui-line",children:(0,_o.jsx)("div",{className:"components-custom-gradient-picker__item components-custom-gradient-picker-position",children:(0,_o.jsx)(ld,{gradientAST:o,hasGradient:r,onChange:t})})})]})}const dd=[{value:"0",label:(0,Mo.__)("None","kadence-blocks"),size:0,name:(0,Mo.__)("None","kadence-blocks")},{value:"xxs",output:"var(--global-kb-spacing-xxs, 0.5rem)",size:8,label:(0,Mo.__)("XXS","kadence-blocks"),name:(0,Mo.__)("2X Small","kadence-blocks")},{value:"xs",output:"var(--global-kb-spacing-xs, 1rem)",size:16,label:(0,Mo.__)("XS","kadence-blocks"),name:(0,Mo.__)("X Small","kadence-blocks")},{value:"sm",output:"var(--global-kb-spacing-sm, 1.5rem)",size:24,label:(0,Mo.__)("SM","kadence-blocks"),name:(0,Mo.__)("Small","kadence-blocks")},{value:"md",output:"var(--global-kb-spacing-md, 2rem)",size:32,label:(0,Mo.__)("MD","kadence-blocks"),name:(0,Mo.__)("Medium","kadence-blocks")},{value:"lg",output:"var(--global-kb-spacing-lg, 3rem)",size:48,label:(0,Mo.__)("LG","kadence-blocks"),name:(0,Mo.__)("Large","kadence-blocks")},{value:"xl",output:"var(--global-kb-spacing-xl, 4rem)",size:64,label:(0,Mo.__)("XL","kadence-blocks"),name:(0,Mo.__)("X Large","kadence-blocks")},{value:"xxl",output:"var(--global-kb-spacing-xxl, 5rem)",size:80,label:(0,Mo.__)("XXL","kadence-blocks"),name:(0,Mo.__)("2X Large","kadence-blocks")},{value:"3xl",output:"var(--global-kb-spacing-3xl, 6.5rem)",size:104,label:(0,Mo.__)("3XL","kadence-blocks"),name:(0,Mo.__)("3X Large","kadence-blocks")},{value:"4xl",output:"var(--global-kb-spacing-4xl, 8rem)",size:128,label:(0,Mo.__)("4XL","kadence-blocks"),name:(0,Mo.__)("4X Large","kadence-blocks")},{value:"5xl",output:"var(--global-kb-spacing-5xl, 10rem)",size:160,label:(0,Mo.__)("5XL","kadence-blocks"),name:(0,Mo.__)("5X Large","kadence-blocks")}];function pd(e,t){if(!t)return;if(!e)return;if("0"===t||"default"===t)return 0;return e.findIndex(e=>e.value===t)||void 0}function hd({label:e,onChange:t,value:n="",placeholder:o="",className:a="",options:r=dd,step:s=1,max:i=200,min:l=0,beforeIcon:c="",help:u="",defaultValue:d=0,unit:p="",onUnit:h,units:f=["px","em","rem"],disableCustomSizes:b=!1,customControl:m=!1,setCustomControl:g=null,isPopover:v=!1,isSingle:x=!1,parentLabel:k=null,onMouseOver:y,onMouseOut:_,allowAuto:w=!1}){const[C,j]=(0,ko.useState)(!1),[S,N]=(0,ko.useState)(!1),O=JSON.parse(JSON.stringify(r));O.push({value:"ss-auto",output:"var(--global-kb-spacing-auto, auto)",label:(0,Mo.__)("Auto","kadence-blocks"),size:0,name:(0,Mo.__)("Auto","kadence-blocks")}),(0,ko.useEffect)(()=>{j(function(e,t){return!!t&&!!e&&!e.find(e=>e.value===t)}(O,n))},[]);const E=g?m:C,M=g||j,T=r.map((e,t)=>({value:t,label:void 0})),R=f.map(e=>({value:e,label:e})),I=E?Number(n):pd(O,n),P=E?Number(o):pd(O,o),L=O[I]?.label?O[I]?.label:(0,Mo.__)("Unset","kadence-blocks"),A=O[I]?.name?O[I]?.name+" "+O[I]?.size+"px":(0,Mo.__)("Unset","kadence-blocks"),D=k?k+" ":"";let F=e;x?F=A:e&&D&&(F=D+e+" "+L);const V=(0,_o.jsxs)(_o.Fragment,{children:[(0,_o.jsx)(yo.RangeControl,{label:F||void 0,className:"components-spacing-sizes-control__range-control",beforeIcon:c,value:"ss-auto"==n?"":I,onChange:e=>{var n;t(void 0===e?d:void 0===(n=e)?"":0===parseInt(n,10)?"0":`${r[n]?.value}`)},min:0,max:r.length-1,marks:T,step:1,help:u,withInputField:!1,"aria-valuenow":I,"aria-valuetext":r[I]?.label,renderTooltipContent:e=>O[e]?.label,initialPosition:d||0,allowReset:!!x,hideLabelFromVision:!v&&!x,onMouseOver:y,onMouseOut:_,onMouseDown:e=>{e?.nativeEvent?.offsetX<35&&void 0===n&&t("0")}}),!b&&(0,_o.jsx)(yo.Button,{className:"kadence-radio-item radio-custom only-icon",label:(0,Mo.__)("Set custom size","kadence-blocks"),icon:zc,onClick:()=>M(!0),isPressed:!1,isTertiary:!0})]});return[t&&(0,_o.jsxs)("div",{className:"components-base-control component-spacing-sizes-control kadence-single-measure-range-control"+(a?" "+a:""),children:[!g&&e&&(0,_o.jsx)(yo.Flex,{justify:"space-between",className:"kadence-radio-range__header",children:(0,_o.jsx)(yo.FlexItem,{children:(0,_o.jsx)("label",{className:"components-base-control__label",children:e})})}),!E&&(0,_o.jsxs)("div",{className:"kadence-controls-content",children:[v&&(0,_o.jsxs)(_o.Fragment,{children:[(0,_o.jsxs)(yo.Button,{className:"kadence-popover-spacing-btn",disabled:!(!n||"auto"!=n),tabIndex:"-1",onClick:n&&"auto"==n?"":function(){N(!S)},onMouseOver:y,onMouseOut:_,children:[k&&e&&(0,_o.jsx)("span",{className:"kadence-placement-label",children:e}),(0,_o.jsxs)("span",{className:"kadence-spacing-btn-val",children:[O[I]?.label,!O[I]?.label&&(0,_o.jsx)("span",{className:"kadence-spacing-btn-placeholder",children:O?.[P]?.label?O?.[P]?.label:o})]})]}),S&&(0,_o.jsx)(yo.Popover,{onClose:function(){N(!1)},className:"kadence-range-popover-settings",children:(0,_o.jsxs)("div",{className:"kadence-range-popover-settings-inner",children:[V,w&&(0,_o.jsx)(yo.Button,{className:"custom-auto-button",variant:"secondary",isSmall:!0,text:(0,Mo.__)("Auto","kadence-blocks"),onClick:()=>t("ss-auto"),isPressed:!(!n||"ss-auto"!=n)}),(0,_o.jsx)(yo.Button,{className:"custom-reset-button",variant:"secondary",isSmall:!0,text:(0,Mo.__)("Reset","kadence-blocks"),onClick:()=>t("")})]})})]}),!v&&(0,_o.jsx)(_o.Fragment,{children:V})]}),E&&(0,_o.jsxs)("div",{className:"kadence-controls-content kadence-single-unit-control",children:[(0,_o.jsx)(yo.__experimentalUnitControl,{label:k&&e?e:void 0,labelPosition:"top",min:l,max:i,disabled:!(!n||"auto"!=n),step:s,units:R,value:n,placeholder:o||void 0,disableUnits:!0,onChange:e=>(e=>{const n=isNaN(parseFloat(e))?void 0:parseFloat(e);t(n)})(e),onMouseOver:y,onMouseOut:_}),!k&&(0,_o.jsx)("div",{className:"kadence-measure-control-select-wrapper",children:(0,_o.jsx)("select",{className:"kadence-measure-control-select components-unit-control__select",onChange:e=>{h(e.target.value)},value:p,children:f.map(e=>(0,_o.jsx)("option",{value:e,selected:p===e||void 0,children:e},e))})}),!b&&(0,_o.jsx)(yo.ButtonGroup,{className:"kadence-radio-container-control",children:(0,_o.jsx)(yo.Button,{className:"kadence-radio-item radio-custom only-icon",label:(0,Mo.__)("Use size preset","kadence-blocks"),icon:zc,isPrimary:!0,onClick:()=>M(!1),isPressed:!0})})]})]})]}tu.pxIcon,tu.emIcon,tu.remIcon,tu.vhIcon,tu.vwIcon,tu.percentIcon;const fd=(0,_o.jsx)(Ho.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,_o.jsx)(Ho.Path,{d:"M10 17.389H8.444A5.194 5.194 0 1 1 8.444 7H10v1.5H8.444a3.694 3.694 0 0 0 0 7.389H10v1.5ZM14 7h1.556a5.194 5.194 0 0 1 0 10.39H14v-1.5h1.556a3.694 3.694 0 0 0 0-7.39H14V7Zm-4.5 6h5v-1.5h-5V13Z"})}),bd=(0,_o.jsx)(Ho.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,_o.jsx)(Ho.Path,{d:"M17.031 4.703 15.576 4l-1.56 3H14v.03l-2.324 4.47H9.5V13h1.396l-1.502 2.889h-.95a3.694 3.694 0 0 1 0-7.389H10V7H8.444a5.194 5.194 0 1 0 0 10.389h.17L7.5 19.53l1.416.719L15.049 8.5h.507a3.694 3.694 0 0 1 0 7.39H14v1.5h1.556a5.194 5.194 0 0 0 .273-10.383l1.202-2.304Z"})});function md(e,t){return!(!t||!e||!(void 0===t[0]||""!==t[0]||void 0===t[1]||""!==t[1]&&"auto"!==t[1]||void 0===t[2]||""!==t[2]||void 0===t[3]||""!==t[3]&&"auto"!==t[3])||(void 0!==t[0]&&""!==t[0]?e.find(e=>e.value===t[0]):void 0!==t[1]&&""!==t[1]&&"auto"!==t[1]?e.find(e=>e.value===t[1]):void 0!==t[2]&&""!==t[2]?e.find(e=>e.value===t[2]):void 0!==t[3]&&""!==t[3]&&"auto"!==t[3]?e.find(e=>e.value===t[3]):e.find(e=>e.value===t)))}function gd(e,t,n){if(!t)return"";if(!e)return"";if("0"===t)return 0;if("px"!==n)return"";const o=e.find(e=>e.value===t);return o?o.size:""}function vd(e,t,n){if(!t)return"";if(!e)return"";if(0===t)return"0";if("px"!==n)return"";const o=e.find(e=>e.size.toString()===t.toString());return o?o.value:""}function xd({label:e,onChange:t,onControl:n,value:o="",className:a="",options:r=dd,step:s=1,max:i=200,min:l=0,beforeIcon:c="",help:u="",placeholder:d=["","","",""],defaultValue:p=["","","",""],control:h="individual",unit:f="",onUnit:b,units:m=["px","em","rem"],disableCustomSizes:g=!1,isBorderRadius:v=!1,firstIcon:x=tu.outlineTopIcon,secondIcon:k=tu.outlineRightIcon,thirdIcon:y=tu.outlineBottomIcon,fourthIcon:_=tu.outlineLeftIcon,linkIcon:w=fd,unlinkIcon:C=bd,customControl:j=!1,setCustomControl:S=null,parentLabel:N=null,reset:O,onMouseOver:E,onMouseOut:M,allowAuto:T=!1}){const R={first:v?tu.topLeftIcon:x,second:v?tu.topRightIcon:k,third:v?tu.bottomRightIcon:y,fourth:v?tu.bottomLeftIcon:_,link:v?tu.radiusLinkedIcon:w,unlink:v?tu.radiusIndividualIcon:C},[I,P]=(0,ko.useState)(!1),[L,A]=(0,ko.useState)(h),D=JSON.parse(JSON.stringify(r));D.push({value:"ss-auto",output:"var(--global-kb-spacing-auto, auto)",label:(0,Mo.__)("Auto","kadence-blocks"),size:0,name:(0,Mo.__)("Auto","kadence-blocks")}),(0,ko.useEffect)(()=>{P(md(D,o))},[]);const F=S?j:I,V=S||P,B=n?h:L,z=n||A;return[t&&(0,_o.jsxs)("div",{className:"components-base-control component-spacing-sizes-control kadence-measure-range-control "+(a?" "+a:""),children:[e&&(0,_o.jsxs)(yo.Flex,{justify:"space-between",className:"kadence-component__header kadence-radio-range__header",children:[e&&(0,_o.jsxs)("div",{className:"kadence-component__header__title kadence-radio-range__title",children:[(0,_o.jsx)("label",{className:"components-base-control__label",children:e}),O&&(0,_o.jsx)("div",{className:"title-reset-wrap",children:(0,_o.jsx)(yo.Button,{className:"is-reset is-single",label:"reset",isSmall:!0,disabled:!!(0,Oo.isEqual)(p,o),icon:undo,onClick:()=>{"function"==typeof O?O():t(p)}})})]}),!g&&(0,_o.jsx)(yo.Button,{className:"kadence-radio-item radio-custom only-icon",label:F?(0,Mo.__)("Use size preset","kadence-blocks"):(0,Mo.__)("Set custom size","kadence-blocks"),icon:zc,isSmall:!0,onClick:()=>{if(F){const e=[vd(r,o?o[0]:"",f),vd(r,o?o[1]:"",f),vd(r,o?o[2]:"",f),vd(r,o?o[3]:"",f)];t(e)}else{const e=[gd(r,o?o[0]:"",f),gd(r,o?o[1]:"",f),gd(r,o?o[2]:"",f),gd(r,o?o[3]:"",f)];t(e)}V(!F)},isPressed:!!F,isTertiary:!F}),z&&(0,_o.jsx)(yo.Button,{isSmall:!0,className:"kadence-radio-item radio-custom is-single only-icon",label:"individual"!==B?(0,Mo.__)("Individual","kadence-blocks"):(0,Mo.__)("Linked","kadence-blocks"),icon:"individual"!==B?R.link:R.unlink,onClick:()=>z("individual"!==B?"individual":"linked"),isPressed:"individual"!==B,isTertiary:"individual"===B})]}),(0,_o.jsxs)("div",{className:"kadence-controls-content",children:["individual"!==B&&(0,_o.jsx)(_o.Fragment,{children:(0,_o.jsx)(hd,{value:o?o[0]:"",onChange:e=>t([e,e,e,e]),className:"kb-measure-input-all-inputs",min:l,max:i,options:r,step:s,help:u,unit:f,units:m,onUnit:b,defaultValue:p[0],placeholder:d?.[0]?d?.[0]:"",allowReset:!1,disableCustomSizes:!0,setCustomControl:V,customControl:F,isPopover:!1,isSingle:!0,onMouseOver:E,onMouseOut:M,allowAuto:T})}),"individual"===B&&(0,_o.jsxs)(_o.Fragment,{children:[(0,_o.jsx)(hd,{parentLabel:N||e,label:(0,Mo.__)("Top","kadence-blocks"),className:"kb-measure-box-top",value:o?o[0]:"",onChange:e=>{t([e,o&&void 0!==o[1]?o[1]:"",o&&void 0!==o[2]?o[2]:"",o&&void 0!==o[3]?o[3]:""])},min:l,max:i,options:r,step:s,help:u,unit:f,units:m,onUnit:b,defaultValue:p[0],placeholder:d?.[0]?d?.[0]:"",allowReset:!1,disableCustomSizes:!0,setCustomControl:V,customControl:F,isPopover:!0,onMouseOver:E,onMouseOut:M,allowAuto:T}),(0,_o.jsx)(hd,{parentLabel:N||e,label:(0,Mo.__)("Right","kadence-blocks"),className:"kb-measure-box-right",value:o?o[1]:"",onChange:e=>t([o&&void 0!==o[0]?o[0]:"",e,o&&void 0!==o[2]?o[2]:"",o&&void 0!==o[3]?o[3]:""]),min:l,max:i,options:r,step:s,help:u,unit:f,units:m,onUnit:b,defaultValue:p[1],placeholder:d?.[1]?d?.[1]:"",allowReset:!1,disableCustomSizes:!0,setCustomControl:V,customControl:F,isPopover:!0,onMouseOver:E,onMouseOut:M,allowAuto:T}),(0,_o.jsx)(hd,{parentLabel:N||e,label:(0,Mo.__)("Bottom","kadence-blocks"),className:"kb-measure-box-bottom",value:o?o[2]:"",onChange:e=>t([o&&void 0!==o[0]?o[0]:"",o&&void 0!==o[1]?o[1]:"",e,o&&void 0!==o[3]?o[3]:""]),min:l,max:i,options:r,step:s,help:u,unit:f,units:m,onUnit:b,defaultValue:p[2],placeholder:d?.[2]?d?.[2]:"",allowReset:!1,disableCustomSizes:!0,setCustomControl:V,customControl:F,isPopover:!0,onMouseOver:E,onMouseOut:M,allowAuto:T}),(0,_o.jsx)(hd,{parentLabel:N||e,label:(0,Mo.__)("Left","kadence-blocks"),className:"kb-measure-box-left",value:o?o[3]:"",onChange:e=>t([o&&void 0!==o[0]?o[0]:"",o&&void 0!==o[1]?o[1]:"",o&&void 0!==o[2]?o[2]:"",e]),min:l,max:i,options:r,step:s,help:u,unit:f,units:m,onUnit:b,defaultValue:p[3],placeholder:d?.[3]?d?.[3]:"",allowReset:!1,disableCustomSizes:!0,setCustomControl:V,customControl:F,isPopover:!0,onMouseOver:E,onMouseOut:M,allowAuto:T}),F&&(0,_o.jsx)("div",{className:"kadence-units kadence-measure-control-select-wrapper",children:(0,_o.jsx)("select",{className:"kadence-measure-control-select components-unit-control__select",onChange:e=>{b(e.target.value)},value:f,disabled:1===m.length,children:m.map(e=>(0,_o.jsx)("option",{value:e,selected:f===e||void 0,children:e},e))})})]})]})]})]}const kd=(0,_o.jsx)(Ho.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,_o.jsx)(Ho.Path,{d:"M18.3 11.7c-.6-.6-1.4-.9-2.3-.9H6.7l2.9-3.3-1.1-1-4.5 5L8.5 16l1-1-2.7-2.7H16c.5 0 .9.2 1.3.5 1 1 1 3.4 1 4.5v.3h1.5v-.2c0-1.5 0-4.3-1.5-5.7z"})});function yd({label:e,subLabel:t,onChange:n,onChangeTablet:o,onChangeMobile:a,mobileValue:r,tabletValue:s,value:i,onControl:l,control:c="individual",options:u=dd,step:d=1,max:p=100,min:h=0,unit:f="",onUnit:b,showUnit:m=!1,units:g=["px","em","rem"],isBorderRadius:v=!1,disableCustomSizes:x=!1,firstIcon:k=tu.outlineTopIcon,secondIcon:y=tu.outlineRightIcon,thirdIcon:_=tu.outlineBottomIcon,fourthIcon:w=tu.outlineLeftIcon,linkIcon:C=fd,unlinkIcon:j=bd,deskDefault:S=["","","",""],tabletDefault:N=["","","",""],mobileDefault:O=["","","",""],ghostDefault:E=["","","",""],reset:M=!0,setCustomControl:T=null,onMouseOver:R,onMouseOut:I,allowAuto:P=!1}){const L=(0,ko.useRef)(),A={first:v?topLeftIcon:k,second:v?topRightIcon:y,third:v?bottomRightIcon:_,fourth:v?bottomLeftIcon:w,link:v?radiusLinkedIcon:C,unlink:v?radiusIndividualIcon:j},[D,F]=(0,ko.useState)(!1),[V,B]=(0,ko.useState)(c),z=T?customControl:D,H=T||F,U=JSON.parse(JSON.stringify(u));U.push({value:"ss-auto",output:"var(--global-kb-spacing-auto, auto)",label:(0,Mo.__)("Auto","kadence-blocks"),size:0,name:(0,Mo.__)("Auto","kadence-blocks")});const G=e=>{let t=[];return t=z?[vd(u,e?e[0]:"",f),vd(u,e?e[1]:"",f),vd(u,e?e[2]:"",f),vd(u,e?e[3]:"",f)]:[gd(u,e?e[0]:"",f),gd(u,e?e[1]:"",f),gd(u,e?e[2]:"",f),gd(u,e?e[3]:"",f)],t},$=l?c:V,W=l||B,[q,X]=(0,ko.useState)("Desktop"),J=(0,To.useSelect)(e=>e("kadenceblocks/data").getPreviewDeviceType(),[]);J!==q&&X(J),(0,ko.useEffect)(()=>{let e=i;"Tablet"==J?e=s:"Mobile"==J&&(e=r),F(md(U,e))},[J]);const{setPreviewDeviceType:K}=(0,To.useDispatch)("kadenceblocks/data"),Y=[{name:"Desktop",title:(0,_o.jsx)(yo.Dashicon,{icon:"desktop"}),itemClass:"kb-desk-tab"},{name:"Tablet",title:(0,_o.jsx)(yo.Dashicon,{icon:"tablet"}),itemClass:"kb-tablet-tab"},{name:"Mobile",key:"mobile",title:(0,_o.jsx)(yo.Dashicon,{icon:"smartphone"}),itemClass:"kb-mobile-tab"}];let Z=i||["","","",""];"Tablet"===q?Z=s||["","","",""]:"Mobile"===q&&(Z=r||["","","",""]);let Q=s?JSON.parse(JSON.stringify(s)):["","","",""];Q?.[0]||(Q[0]=i?.[0]?i[0]:""),Q?.[1]||(Q[1]=i?.[1]?i[1]:""),Q?.[2]||(Q[2]=i?.[2]?i[2]:""),Q?.[3]||(Q[3]=i?.[3]?i[3]:"");const ee={};ee.Mobile=(0,_o.jsx)(xd,{className:"measure-mobile-size",parentLabel:e,label:t?(0,Mo.__)("Mobile:","kadence-blocks")+t:void 0,value:r||["","","",""],placeholder:Q,onChange:e=>a((0,No.clearNonMatchingValues)(r,e)),control:$,onControl:e=>W(e),setCustomControl:H,customControl:z,options:u,defaultValue:O,min:h,max:p,step:d,unit:f,onUnit:b||void 0,showUnit:!0,units:[f],isBorderRadius:v,firstIcon:k,secondIcon:y,thirdIcon:_,fourthIcon:w,linkIcon:C,unlinkIcon:j,onMouseOver:R,onMouseOut:I,allowAuto:P},2),ee.Tablet=(0,_o.jsx)(xd,{className:"measure-tablet-size",parentLabel:e,label:t?(0,Mo.__)("Tablet:","kadence-blocks")+t:void 0,value:s||["","","",""],placeholder:i||["","","",""],onChange:e=>o((0,No.clearNonMatchingValues)(s,e)),control:$,onControl:e=>W(e),setCustomControl:H,customControl:z,options:u,defaultValue:N,min:h,max:p,step:d,unit:f,onUnit:b||void 0,showUnit:!0,units:[f],isBorderRadius:v,firstIcon:k,secondIcon:y,thirdIcon:_,fourthIcon:w,linkIcon:C,unlinkIcon:j,onMouseOver:R,onMouseOut:I,allowAuto:P},1),ee.Desktop=(0,_o.jsx)(xd,{className:"measure-desktop-size",parentLabel:e,label:t||void 0,value:i||["","","",""],placeholder:E||["","","",""],onChange:e=>n((0,No.clearNonMatchingValues)(i,e)),control:$,onControl:e=>W(e),setCustomControl:H,customControl:z,options:u,defaultValue:S,min:h,max:p,step:d,unit:f,onUnit:b||void 0,showUnit:m,units:g,isBorderRadius:v,firstIcon:k,secondIcon:y,thirdIcon:_,fourthIcon:w,linkIcon:C,unlinkIcon:j,onMouseOver:R,onMouseOut:I,allowAuto:P},0);let te=S;return"Mobile"===q?te=O:"Mobile"===q&&(te=N),[n&&o&&a&&(0,_o.jsxs)("div",{ref:L,className:"components-base-control kb-responsive-measure-control kadence-measure-range-control",children:[(0,_o.jsxs)(yo.Flex,{justify:"space-between",className:"kadence-title-bar kadence-component__header kadence-measure-range__header kadence-radio-range__header",children:[e&&(0,_o.jsxs)("div",{className:"kadence-component__header__title kadence-radio-range__title",children:[(0,_o.jsx)("label",{className:"components-base-control__label",children:e}),!0===M&&("linked"!==$||"linked"===$&&!0===z)&&(0,_o.jsx)("div",{className:"title-reset-wrap",children:(0,_o.jsx)(yo.Button,{className:"is-reset is-single",label:"reset",isSmall:!0,disabled:!!(0,Oo.isEqual)(te,Z),icon:kd,onClick:()=>{"Tablet"===q?o(N):"Mobile"===q?a(O):n(S)}})})]}),(0,_o.jsx)(yo.ButtonGroup,{className:"kb-responsive-options kb-measure-responsive-options","aria-label":(0,Mo.__)("Device","kadence-blocks"),children:(0,Oo.map)(Y,({name:e,key:t,title:n,itemClass:o})=>(0,_o.jsx)(yo.Button,{className:`kb-responsive-btn ${o}${e===q?" is-active":""}`,isSmall:!0,"aria-pressed":q===e,onClick:()=>{return t=e,K((0,No.capitalizeFirstLetter)(t)),void X((0,No.capitalizeFirstLetter)(t));var t},children:n},t))}),!x&&!t&&(0,_o.jsx)(yo.Button,{className:"kadence-radio-item radio-custom only-icon",label:z?(0,Mo.__)("Use size preset","kadence-blocks"):(0,Mo.__)("Set custom size","kadence-blocks"),icon:zc,isSmall:!0,onClick:()=>{(()=>{if("Mobile"==q){const e=G(r);(0,No.objectSameFill)(r,e)&&a(e)}else if("Tablet"==q){const e=G(s);(0,No.objectSameFill)(s,e)&&o(e)}else{const e=G(i);(0,No.objectSameFill)(i,e)&&n(e)}})(),H(!z)},isPressed:!!z,isTertiary:!z}),W&&!t&&(0,_o.jsx)(yo.Button,{isSmall:!0,className:"kadence-radio-item radio-custom is-single only-icon",label:"individual"!==$?(0,Mo.__)("Individual","kadence-blocks"):(0,Mo.__)("Linked","kadence-blocks"),icon:"individual"!==$?A.link:A.unlink,onClick:()=>W("individual"!==$?"individual":"linked"),isPressed:"individual"!==$,isTertiary:"individual"===$})]}),(0,_o.jsx)("div",{className:"kb-responsive-measure-control-inner",children:ee[q]?ee[q]:ee.Desktop})]})]}const _d=window.wp.isShallowEqual;function wd({style:e,type:t="inside",spacing:n,forceShow:o=!1,forceHide:a=!1,offset:r=!0}){const s=n[0],i=n[1],l=n[2],c=n[3],u=(0,ko.useMemo)(()=>{if("outside"===t){const e=s||0,t=i||0,n=l||0,o=c||0;return{borderTopWidth:e,borderRightWidth:t,borderBottomWidth:n,borderLeftWidth:o,top:r&&e?`calc(${e} * -1)`:0,right:r&&t?`calc(${t} * -1)`:0,bottom:r&&n?`calc(${n} * -1)`:0,left:r&&o?`calc(${o} * -1)`:0}}if("outsideVertical"===t){const e=s||0,t=l||0;return{borderTopWidth:e,borderRightWidth:i||0,borderBottomWidth:t,borderLeftWidth:c||0,top:r&&e?`calc(${e} * -1)`:0,bottom:r&&t?`calc(${t} * -1)`:0}}return{borderTopWidth:s||0,borderRightWidth:i||0,borderBottomWidth:l||0,borderLeftWidth:c||0,marginLeft:e?.marginLeft?e.marginLeft:0,marginRight:e?.marginRight?e.marginRight:0}},[n]),[d,p]=(0,ko.useState)(!1),h=(0,ko.useRef)(n),f=(0,ko.useRef)(),b=()=>{f.current&&window.clearTimeout(f.current)};return(0,ko.useMemo)(()=>(a&&(h.current=n),(0,_d.isShallowEqualArrays)(n,h.current)||o||a||(p(!0),h.current=n,b(),f.current=setTimeout(()=>{p(!1)},400)),()=>b()),[n,o,a]),!d&&!o||a?null:(0,_o.jsx)("div",{className:`kb__spacing-visualizer-wrap kb__spacing_visualizer-type-${t}`,style:e,children:(0,_o.jsx)("div",{className:"kb__spacing-visualizer",style:u})})}function Cd({label:e,className:t,hideLabel:n=!1,wrap:o=!1,allowClear:a=!1,help:r="",onChange:s,onChangeTablet:i,onChangeMobile:l,value:c,mobileValue:u,tabletValue:d,options:p=[],tabletOptions:h=p,mobileOptions:f=h,...b}){return(0,_o.jsx)(Lo,{label:e,desktopChildren:(0,_o.jsx)(wc,{className:t,value:c,options:p,onChange:s,hideLabel:n,help:r,wrap:o,allowClear:a}),tabletChildren:(0,_o.jsx)(wc,{className:t,value:d,options:h,onChange:i,hideLabel:n,help:r,wrap:o,allowClear:!0}),mobileChildren:(0,_o.jsx)(wc,{className:t,value:u,options:f,onChange:l,hideLabel:n,help:r,wrap:o,allowClear:!0})})}function jd({value:e,isPressed:t=!1}){const n={top:"M19.5 19.5H.5V.5h19v19zM1.607 18.392h16.786V1.608H1.607v16.784zM17.178 2.888H2.822v3.275h14.356V2.888z",middle:"M19.5 19.482H.5V.5h19v18.982zM1.607 18.375h16.786V1.607H1.607v16.768zm15.571-10.02H2.822v3.272h14.356V8.355z",bottom:"M19.518 19.5H.5V.5h19.018v19zm-17.91-1.108H18.41V1.608H1.608v16.784zm15.586-4.739H2.824v3.275h14.37v-3.275z"};return n.hasOwnProperty(e)?(0,_o.jsx)(yo.SVG,{width:"20",height:"20",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",isPressed:t,children:(0,_o.jsx)(yo.Path,{d:n[e]})}):null}const Sd=["image"];class Nd extends ko.Component{constructor(){super(...arguments)}render(){const{label:e,hasImage:t,onSaveImage:n,onRemoveImage:o,disableMediaButtons:a,imageURL:r,imageID:s,kadenceDynamic:i,dynamicAttribute:l=""}=this.props;return(0,_o.jsxs)("div",{className:"kadence-image-media-control kadence-image-background-control",children:[!t&&(0,_o.jsxs)(ko.Fragment,{children:[e&&(0,_o.jsx)("div",{className:"components-kadence-image-background__label",children:e}),(0,_o.jsx)(qc,{labels:"",selectIcon:Kc,selectLabel:(0,Mo.__)("Select Image","kadence-blocks"),onSelect:e=>n(e),accept:"image/*",className:"kadence-image-upload",allowedTypes:Sd,disableMediaButtons:a,dynamicControl:l&&kadence_blocks_params.dynamic_enabled?(0,_o.jsx)(Oc,{...this.props}):void 0})]}),t&&(0,_o.jsxs)(ko.Fragment,{children:[e&&(0,_o.jsx)("div",{className:"components-kadence-image-background__label",children:e}),l&&kadence_blocks_params.dynamic_enabled&&i&&i[l]&&i[l].enable?(0,_o.jsx)("div",{className:"kb-dynamic-background-sidebar-top",children:(0,_o.jsx)(Oc,{startOpen:!i[l].field,...this.props})}):(0,_o.jsxs)(ko.Fragment,{children:[(0,_o.jsx)(Eo.MediaUpload,{onSelect:e=>n(e),type:"image",value:s||"",render:({open:e})=>(0,_o.jsx)(yo.Button,{className:"components-button components-icon-button kt-cta-upload-btn kb-sidebar-image",style:{backgroundImage:'url("'+r+'")',backgroundSize:"cover"},onClick:e,icon:Yc,children:(0,Mo.__)("Edit Image","kadence-blocks")})}),(0,_o.jsx)(yo.Button,{icon:Zc,label:(0,Mo.__)("Remove Image","kadence-blocks"),className:"components-button components-icon-button kt-remove-img kt-cta-upload-btn",onClick:()=>o()}),l&&kadence_blocks_params.dynamic_enabled&&(0,_o.jsx)(Oc,{...this.props})]})]})]})}}const Od=Nd,Ed=["video"];class Md extends ko.Component{constructor(){super(...arguments)}render(){const{label:e,hasVideo:t,onSaveVideo:n,onRemoveVideo:o,disableMediaButtons:a,videoURL:r,videoID:s}=this.props;return(0,_o.jsxs)("div",{className:"components-base-control kadence-image-media-control kadence-image-background-control kadence-video-background-control",children:[!t&&(0,_o.jsxs)(ko.Fragment,{children:[e&&(0,_o.jsx)("div",{className:"components-kadence-video-background__label",children:e}),(0,_o.jsx)(qc,{labels:"",selectIcon:Kc,selectLabel:(0,Mo.__)("Select Video","kadence-blocks"),onSelect:e=>n(e),accept:"video/*",className:"kadence-image-upload",allowedTypes:Ed,disableMediaButtons:a})]}),t&&(0,_o.jsxs)(ko.Fragment,{children:[e&&(0,_o.jsx)("div",{className:"components-kadence-video-background__label",children:e}),(0,_o.jsxs)("div",{className:"components-kadence-video-btns",children:[(0,_o.jsx)(Eo.MediaUpload,{onSelect:e=>n(e),type:"video",value:s||"",render:({open:e})=>(0,_o.jsx)(yo.Button,{className:"components-button components-icon-button kb-cta-upload-btn kb-video-edit",onClick:e,icon:tu.video,children:(0,Mo.__)("Edit Video","kadence-blocks")})}),(0,_o.jsx)(yo.Button,{icon:Zc,label:(0,Mo.__)("Remove Image","kadence-blocks"),className:"components-button components-icon-button kb-remove-video kb-cta-upload-btn",onClick:()=>o()})]})]})]})}}const Td=Md;function Rd({label:e,className:t,children:n}){return(0,_o.jsxs)("div",{className:"components-base-control kadence-subsection-wrap"+(t?" "+t:""),children:[e&&(0,_o.jsx)("h2",{className:"subsection-wrap-title",children:e}),(0,_o.jsx)("div",{className:"kt-inner-subsection",children:n})]})}const Id=(0,_c.compose)([(0,To.withSelect)((e,t)=>{const n=void 0===t.initialOpen||t.initialOpen,o=(0,Oo.get)(t,["index"],"");return{isOpened:e("kadenceblocks/data").isEditorPanelOpened(t.panelName+o+e("core/block-editor").getSelectedBlockClientId(),n)}}),(0,To.withDispatch)((e,t,{select:n})=>{const{getSelectedBlockClientId:o}=n("core/block-editor"),a=void 0===t.initialOpen||t.initialOpen,r=(0,Oo.get)(t,["index"],"");return{toggleOpened:()=>{e("kadenceblocks/data").toggleEditorPanelOpened(t.panelName+r+o(),a)}}})])(function({children:e,title:t,initialOpen:n=!0,isOpened:o,toggleOpened:a,className:r="",icon:s="",buttonProps:i={},blockSlug:l=!1,index:c=!1,proTag:u=!1,panelName:d}){return!1===l||(0,No.showSettings)(d,l)?(u&&(i.icon=tu.proIcon,i.iconPosition="right"),(0,_o.jsx)(yo.PanelBody,{title:t,initialOpen:n,onToggle:a,opened:o,className:r,icon:s,buttonProps:i,children:e})):null});function Pd({children:e,title:t}){return(0,_o.jsxs)("div",{className:"kb-sub-panel",children:[t&&(0,_o.jsx)("h2",{className:"kb-sub-panel-title",children:t}),(0,_o.jsx)("div",{className:"kb-inner-sub-panel",children:e})]})}const Ld=function({children:e,blockSlug:t=!1,settingSlug:n="allSettings"}){return!1===t||(0,No.showSettings)(n,t)?(0,_o.jsx)(Eo.InspectorControls,{children:e}):null};class Ad extends ko.Component{constructor(){super(...arguments),this.state={options:[],isLoading:!1,page:1,hasMore:!1}}componentDidMount(){this.fetchPostAbortController=new AbortController,this.fetchTerms()}componentWillUnmount(){this.fetchPostAbortController&&this.fetchPostAbortController.abort()}fetchTerms(){const{restBase:e}=this.props,{page:t,options:n,search:o}=this.state,a={page:t,per_page:10};o&&o.length>=3&&(a.search=o),this.setState({isLoading:!0}),(0,No.fetchJson)({path:(0,hc.addQueryArgs)(`${e}/`,a),signal:this.fetchPostAbortController.signal}).then(([e,o])=>{const a=(0,Oo.uniqBy)([...n,...e.map(e=>({value:e.id,label:e.name}))],"value");this.setState({options:a,hasMore:parseInt(o["x-wp-totalpages"],10)>t,isLoading:!1})})}fetchMoreTerms(){const{page:e,hasMore:t,isLoading:n}=this.state;t&&!n&&this.setState({page:e+1},()=>this.fetchTerms())}updateSearch(e){e.length>=3&&this.setState({search:e,page:1},()=>this.fetchTerms())}handleChange(e){const{onChange:t}=this.props;this.setState({search:null,page:1}),t(e)}render(){return(0,_o.jsxs)("div",{className:"term-select-form-row",children:[(0,_o.jsx)("label",{htmlFor:this.props.fieldId,className:"screen-reader-text",children:this.props.placeholder}),(0,_o.jsx)(pc,{value:this.props.value,onChange:e=>this.handleChange(e),id:this.props.fieldId,options:this.state.options,isMulti:!0,classNamePrefix:"kt-tax-select",isLoading:this.state.isLoading,onMenuScrollToBottom:()=>this.fetchMoreTerms(),onInputChange:e=>this.updateSearch(e),maxMenuHeight:300,placeholder:this.props.placeholder})]})}}Ad.propTypes={fieldId:S().string.isRequired,label:S().string.isRequired,restBase:S().string.isRequired,onChange:S().func.isRequired};const Dd=Ad,Fd=window.wp.apiFetch;var Vd=a.n(Fd);function Bd({value:e,onChange:t,source:n,isMulti:o=!1}){const[a,r]=(0,ko.useState)(!0),[s,i]=(0,ko.useState)([]),[l,c]=(0,ko.useState)(1),[u,d]=(0,ko.useState)(!1),p=e;return(0,ko.useEffect)(()=>{if(n&&void 0!==window.kadence_blocks_params.taxonomies[n]&&window.kadence_blocks_params.taxonomies[n])i(Array.from(window.kadence_blocks_params.taxonomies[n])),r(!1);else{const e={source:n,page:l,per_page:50};r(!0),Vd()({path:(0,hc.addQueryArgs)(window.kadence_blocks_params.termEndpoint,e)}).then(e=>{e?(i(e),window.kadence_blocks_params.taxonomies[n]=e):(i([]),window.kadence_blocks_params.taxonomies[n]=[]),r(!1)}).catch(()=>{r(!1),i([]),window.kadence_blocks_params.taxonomies[n]=[]})}},[n]),a?(0,_o.jsx)(yo.Spinner,{}):(0,_o.jsx)("div",{className:"kb-inner-term-select-wrap",children:(0,_o.jsx)(pc,{options:s,className:"kb-dynamic-select",classNamePrefix:"kbp",value:o?e:""!==e?s.filter(({value:e})=>e===p):"",isMulti:o,isSearchable:!0,isClearable:!0,menuPortalTarget:document.body,styles:{menuPortal:e=>({...e,zIndex:99999999})},maxMenuHeight:200,placeholder:(0,Mo.__)("Select Term","kadence-blocks"),onChange:e=>{t(e?o?e:e.value:"")}})})}function zd({desktopChildren:e,tabletChildren:t,mobileChildren:n}){const[o,a]=(0,ko.useState)("Desktop"),r=(0,To.useSelect)(e=>e("kadenceblocks/data").getPreviewDeviceType(),[]);r!==o&&a(r);const{setPreviewDeviceType:s}=(0,To.useDispatch)("kadenceblocks/data"),i=[{name:"Desktop",key:"desktop",label:(0,Mo.__)("Desktop","kadence-blocks"),title:(0,_o.jsx)(yo.Dashicon,{icon:"desktop"}),itemClass:"kb-desk-tab"},{name:"Tablet",key:"tablet",label:(0,Mo.__)("Tablet","kadence-blocks"),title:(0,_o.jsx)(yo.Dashicon,{icon:"tablet"}),itemClass:"kb-tablet-tab"},{name:"Mobile",key:"mobile",label:(0,Mo.__)("Mobile","kadence-blocks"),title:(0,_o.jsx)(yo.Dashicon,{icon:"smartphone"}),itemClass:"kb-mobile-tab"}],l={};return l.Mobile=n,l.Tablet=t,l.Desktop=e,(0,_o.jsxs)("div",{className:"components-base-control kt-inspect-tabs kb-responsive-control",children:[(0,_o.jsx)("div",{className:"kadence-title-bar",children:(0,_o.jsx)(yo.ButtonGroup,{className:"components-tab-panel__tabs","aria-label":(0,Mo.__)("Device","kadence-blocks"),children:(0,Oo.map)(i,({name:e,key:t,title:n,itemClass:r,label:i})=>(0,_o.jsx)(yo.Button,{className:`components-tab-panel__tabs-item ${r}${e===o?" active-tab":""}`,"aria-pressed":o===e,"aria-label":i,onClick:()=>{return t=e,s((0,No.capitalizeFirstLetter)(t)),void a((0,No.capitalizeFirstLetter)(t));var t},children:n},t))})}),(0,_o.jsx)("div",{className:"kb-responsive-control-inner",children:l[o]?l[o]:l.Desktop})]})}function Hd({label:e,onChange:t,onChangeTablet:n,onChangeMobile:o,value:a,mobileValue:r,tabletValue:s,options:i,tabletOptions:l=i,mobileOptions:c=l,help:u}){return(0,_o.jsx)(Lo,{label:e,desktopChildren:(0,_o.jsx)(yo.SelectControl,{value:a,options:i,onChange:e=>t(e),help:u}),tabletChildren:(0,_o.jsx)(yo.SelectControl,{value:s,options:l,onChange:e=>n(e),help:u}),mobileChildren:(0,_o.jsx)(yo.SelectControl,{value:r,options:c,onChange:e=>o(e),help:u})})}const Ud=(0,_o.jsx)(Ho.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,_o.jsx)(Ho.Path,{d:"m13.1 16-3.4-4 3.4-4 1.1 1-2.6 3 2.6 3-1.1 1z"})}),Gd=(0,_o.jsx)(Ho.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,_o.jsx)(Ho.Path,{d:"M10.8622 8.04053L14.2805 12.0286L10.8622 16.0167L9.72327 15.0405L12.3049 12.0286L9.72327 9.01672L10.8622 8.04053Z"})});function $d({label:e,value:t,onChange:n,min:o,max:a,step:r=1}){return[n&&(0,_o.jsxs)("div",{className:"components-base-control",children:[(0,_o.jsx)("p",{className:"components-base-control__label",children:e}),(0,_o.jsxs)("div",{className:"components-base-control__field kb-flex-center kb-step-control",children:[(0,_o.jsx)(yo.Button,{className:"kb-step-btn",icon:Ud,isSecondary:!0,onClick:()=>{t>o&&n(t-r)}}),(0,_o.jsx)("input",{className:"components-step-control__number",type:"number",onChange:e=>n(Number(e.target.value)),"aria-label":e,value:t,min:o,max:a,step:r}),(0,_o.jsx)(yo.Button,{className:"kb-step-btn",isSecondary:!0,icon:Gd,onClick:()=>{t<a&&n(t+r)}})]})]})]}class Wd extends ko.Component{constructor(e,t,n){super(...arguments),this.state={isVisible:!1}}render(){const e=()=>{this.setState({isVisible:!1})};let t={};return t.opacity=(0,_o.jsxs)("svg",{width:"20px",height:"20px",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",fillRule:"evenodd",clipRule:"evenodd",strokeLinejoin:"round",strokeMiterlimit:"1.414",children:[(0,_o.jsxs)("g",{fillRule:"nonzero",children:[(0,_o.jsx)("path",{d:"M14.043,7.612c2.23,2.178 2.23,5.726 0,7.904c-1.081,1.055 -2.515,1.638 -4.042,1.638c-1.527,0 -2.964,-0.583 -4.042,-1.638c-1.08,-1.056 -1.674,-2.46 -1.674,-3.952c0,-1.492 0.594,-2.896 1.676,-3.956l4.04,-4.026l4.038,4.026c0.002,0.002 0.004,0.002 0.004,0.004Z",fill:"url(#_Linear1)"}),(0,_o.jsx)("path",{d:"M15.595,6.066c3.082,3.013 3.082,7.917 -0.002,10.931c-1.493,1.461 -3.479,2.265 -5.591,2.265c-2.112,0 -4.097,-0.804 -5.593,-2.265c-1.493,-1.46 -2.315,-3.402 -2.315,-5.467c0,-2.065 0.822,-4.007 2.315,-5.466l5.176,-5.162c0.221,-0.219 0.614,-0.219 0.833,0l5.177,5.164Zm-0.826,10.124c2.629,-2.568 2.629,-6.751 0,-9.32c0,-0.002 -0.003,-0.002 -0.005,-0.004l-4.762,-4.749l-4.764,4.749c-1.276,1.249 -1.976,2.905 -1.976,4.664c0,1.76 0.7,3.416 1.974,4.66c1.272,1.245 2.966,1.932 4.766,1.932c1.801,0 3.493,-0.687 4.767,-1.932Z"})]}),(0,_o.jsx)("defs",{children:(0,_o.jsxs)("linearGradient",{id:"_Linear1",x2:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"matrix(11.4305 0 0 13.5721 4.285 10.368)",children:[(0,_o.jsx)("stop",{offset:"0"}),(0,_o.jsx)("stop",{offset:"0.5",stopOpacity:"0.749"}),(0,_o.jsx)("stop",{offset:"1",stopOpacity:"0"})]})})]}),(0,_o.jsxs)("div",{className:"kt-popover-container",children:[this.state.isVisible&&(0,_o.jsx)(yo.Popover,{position:"top left",className:"kt-popover-opacity",onClose:e,children:(0,_o.jsx)(yo.RangeControl,{label:this.props.label,value:this.props.value,onChange:this.props.onChanged,min:0,max:1,step:.01})}),(0,_o.jsxs)(yo.Tooltip,{text:this.props.label,children:[!this.state.isVisible&&(0,_o.jsx)(yo.Button,{className:"kt-opacity-icon",isSecondary:!0,onClick:()=>{this.setState({isVisible:!0})},children:t.opacity}),this.state.isVisible&&(0,_o.jsx)(yo.Button,{className:"kt-opacity-icon",isSecondary:!0,onClick:e,children:t.opacity})]})]})}}const qd=Wd;function Xd({label:e,onChange:t,value:n="",className:o="",step:a=1,max:r=200,min:s=0,unit:i="px",onUnit:l,units:c=["px","em","rem"],styles:u=["solid","dashed","dotted","double"],defaultLinked:d=!0}){const p=(0,_c.useInstanceId)(Xd),h=n?.[1]||"solid",f=e=>{const o=n;o[0]=e,t(o)},b=n?.[0]||"",m=void 0!==n?.[2]&&""!==n?.[2]?n[2]:"",g={solid:(0,_o.jsx)("svg",{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",fillRule:"evenodd",strokeLinejoin:"round",strokeMiterlimit:"2",clipRule:"evenodd",viewBox:"0 0 20 20",children:(0,_o.jsx)("path",{d:"M18.988 11.478V8.522H1.012v2.956h17.976z"})}),dashed:(0,_o.jsx)("svg",{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",fillRule:"evenodd",strokeLinejoin:"round",strokeMiterlimit:"2",clipRule:"evenodd",viewBox:"0 0 20 20",children:(0,_o.jsx)("path",{d:"M12.512 11.478V8.522H7.488v2.956h5.024zM14.004 8.522v2.956h4.984V8.522h-4.984zM1.012 8.522v2.956H6.05V8.522H1.012z"})}),dotted:(0,_o.jsxs)("svg",{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",fillRule:"evenodd",strokeLinejoin:"round",strokeMiterlimit:"2",clipRule:"evenodd",viewBox:"0 0 20 20",children:[(0,_o.jsx)("circle",{cx:"2.503",cy:"10",r:"1.487"}),(0,_o.jsx)("circle",{cx:"17.486",cy:"10",r:"1.487"}),(0,_o.jsx)("circle",{cx:"12.447",cy:"10",r:"1.487"}),(0,_o.jsx)("circle",{cx:"7.455",cy:"10",r:"1.487"})]}),double:(0,_o.jsx)("svg",{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",fillRule:"evenodd",strokeLinejoin:"round",strokeMiterlimit:"2",clipRule:"evenodd",viewBox:"0 0 20 20",children:(0,_o.jsx)("path",{d:"M1.02 6.561v2.957h17.968V6.561H1.02zM1.012 10.586v2.956H18.98v-2.956H1.012z"})})},v={solid:(0,Mo.__)("Solid","kadence-blocks"),dashed:(0,Mo.__)("Dashed","kadence-blocks"),dotted:(0,Mo.__)("Dotted","kadence-blocks"),double:(0,Mo.__)("Double","kadence-blocks")},x=c.map(e=>({value:e,label:e}));return[t&&(0,_o.jsxs)("div",{className:`components-base-control kadence-single-border-control kadence-single-border-control${p}${o?" "+o:""}`,children:[e&&(0,_o.jsx)(yo.Flex,{justify:"space-between",className:"kadence-border-control__header",children:(0,_o.jsx)(yo.FlexItem,{children:(0,_o.jsx)("label",{className:"components-base-control__label",children:e})})}),(0,_o.jsxs)("div",{className:"kadence-single-border-control-wrap",children:[(0,_o.jsx)(Po,{value:b,default:"",hideClear:!0,onChange:e=>f(e)},`border-color-${b}-${p}`),(0,_o.jsx)(yo.DropdownMenu,{className:"border-control-style-select",icon:g[h],label:(0,Mo.__)("Border Style","kadence-blocks"),popoverProps:{className:"border-control-style-select__popover",placement:"bottom"},children:({onClose:e})=>(0,_o.jsx)(_o.Fragment,{children:(0,_o.jsx)(yo.MenuGroup,{children:u.map(o=>(0,_o.jsx)(yo.MenuItem,{icon:g[o],onClick:()=>{e(),(e=>{const o=n;o[1]=e,t(o)})(o)},label:v[o]}))})})}),(0,_o.jsxs)("div",{className:"kadence-controls-content kadence-single-unit-control",children:[(0,_o.jsx)(yo.__experimentalUnitControl,{min:s,max:r,step:a,units:x,value:m,disableUnits:!0,onChange:e=>(e=>{const o=isNaN(parseFloat(e))?"":parseFloat(e),a=n;a[2]=o,t(a)})(e)}),(0,_o.jsx)("div",{className:"kadence-measure-control-select-wrapper",children:(0,_o.jsx)("select",{className:"kadence-measure-control-select components-unit-control__select",onChange:e=>{l(e.target.value)},disabled:1===c.length,children:c.map(e=>(0,_o.jsx)("option",{value:e,selected:i===e||void 0,children:e},e))})})]})]})]})]}function Jd({label:e,onChange:t,onChangeTablet:n,onChangeMobile:o,onControl:a,value:r="",tabletValue:s="",mobileValue:i="",control:l="individual",units:c=["px","em","rem"],firstIcon:u=tu.outlineTopIcon,secondIcon:d=tu.outlineRightIcon,thirdIcon:p=tu.outlineBottomIcon,fourthIcon:h=tu.outlineLeftIcon,linkIcon:f=fd,unlinkIcon:b=bd,styles:m=["solid","dashed","dotted","double"],deskDefault:g={top:["","",""],right:["","",""],bottom:["","",""],left:["","",""],unit:"px"},tabletDefault:v={top:["","",""],right:["","",""],bottom:["","",""],left:["","",""],unit:""},mobileDefault:x={top:["","",""],right:["","",""],bottom:["","",""],left:["","",""],unit:""},reset:k=!0,defaultLinked:y=!0}){const _=(0,_c.useInstanceId)(Jd),w=r?.[0]||g,C=s?.[0]||v,j=i?.[0]||x,[S,N]=(0,ko.useState)(l),[O,E]=(0,ko.useState)("Desktop"),M=(0,To.useSelect)(e=>e("kadenceblocks/data").getPreviewDeviceType(),[]);M!==O&&E(M),(0,ko.useEffect)(()=>{j&&(0,Oo.isEqual)(w.unit,j?.unit)&&(j.unit="",V("","unit")),C&&(0,Oo.isEqual)(w.unit,C?.unit)&&(C.unit="",F("","unit"))},[]);const{setPreviewDeviceType:T}=(0,To.useDispatch)("kadenceblocks/data"),R=[{name:"Desktop",title:(0,_o.jsx)(yo.Dashicon,{icon:"desktop"}),itemClass:"kb-desk-tab"},{name:"Tablet",title:(0,_o.jsx)(yo.Dashicon,{icon:"tablet"}),itemClass:"kb-tablet-tab"},{name:"Mobile",key:"mobile",title:(0,_o.jsx)(yo.Dashicon,{icon:"smartphone"}),itemClass:"kb-mobile-tab"}];let I=w;"Tablet"===O?I=C:"Mobile"===O&&(I=j);const P={},L=j?.unit?j.unit:w?.unit?w.unit:"px",A=C?.unit?C.unit:w?.unit?w.unit:"px",D=(e,n)=>{var o=JSON.parse(JSON.stringify(r));o[0][n]=e,t(o)},F=(e,t)=>{var o=JSON.parse(JSON.stringify(s));o[0][t]=e,n(o)},V=(e,t)=>{var n=JSON.parse(JSON.stringify(i));n[0][t]=e,o(n)};P.Mobile=(0,_o.jsx)(Xd,{value:j?.bottom?JSON.parse(JSON.stringify(j?.bottom)):void 0,unit:j?.unit?JSON.parse(JSON.stringify(j?.unit)):"px",onChange:e=>V(e,"bottom"),onUnit:e=>V(e,"unit"),defaultValue:x?.bottom,styles:m,units:[L],firstIcon:u,secondIcon:d,thirdIcon:p,fourthIcon:h},"mobile"+_),P.Tablet=(0,_o.jsx)(Xd,{value:C?.bottom?JSON.parse(JSON.stringify(C?.bottom)):void 0,unit:C?.unit?JSON.parse(JSON.stringify(C?.unit)):"px",onChange:e=>F(e,"bottom"),onUnit:e=>F(e,"unit"),defaultValue:v?.bottom,styles:m,units:[A],firstIcon:u,secondIcon:d,thirdIcon:p,fourthIcon:h},"tablet"+_),P.Desktop=(0,_o.jsx)(Xd,{value:w?.bottom?JSON.parse(JSON.stringify(w?.bottom)):void 0,unit:w?.unit?JSON.parse(JSON.stringify(w?.unit)):"px",onChange:e=>D(e,"bottom"),onUnit:e=>D(e,"unit"),defaultValue:g?.bottom,styles:m,units:c,firstIcon:u,secondIcon:d,thirdIcon:p,fourthIcon:h},"desktop"+_);let B=g;return"Mobile"===O?B=x:"Mobile"===O&&(B=v),[t&&n&&o&&(0,_o.jsxs)("div",{className:`components-base-control kb-responsive-border-control kadence-border-box-control kadence-border-box-control${_}`,children:[(0,_o.jsxs)("div",{className:"kadence-border-control__header kadence-component__header",children:[e&&(0,_o.jsxs)("div",{className:"kadence-component__header__title kadence-radio-range__title",children:[(0,_o.jsx)("label",{className:"components-base-control__label",children:e}),k&&(0,_o.jsx)("div",{className:"title-reset-wrap",children:(0,_o.jsx)(yo.Button,{className:"is-reset is-single",label:"reset",isSmall:!0,disabled:!!(0,Oo.isEqual)(B,I),icon:kd,onClick:()=>{"Tablet"===O?n([v]):"Mobile"===O?o([x]):t([g])}})})]}),(0,_o.jsx)(yo.ButtonGroup,{className:"kb-responsive-options kb-measure-responsive-options","aria-label":(0,Mo.__)("Device","kadence-blocks"),children:(0,Oo.map)(R,({name:e,key:t,title:n,itemClass:o})=>(0,_o.jsx)(yo.Button,{className:`kb-responsive-btn ${o}${e===O?" is-active":""}`,isSmall:!0,"aria-pressed":O===e,onClick:()=>{return t=e,T((0,No.capitalizeFirstLetter)(t)),void E((0,No.capitalizeFirstLetter)(t));var t},children:n},t))})]}),(0,_o.jsx)("div",{className:"kb-responsive-border-control-inner",children:P[O]?P[O]:P.Desktop})]})]}function Kd({label:e,onChange:t,onControl:n,value:o="",className:a="",help:r="",defaultValue:s={top:{color:"",style:"solid",width:""},right:{color:"",style:"solid",width:""},bottom:{color:"",style:"solid",width:""},left:{color:"",style:"solid",width:""},unit:""},control:i="individual",units:l=["px","em","rem"],firstIcon:c=tu.outlineTopIcon,secondIcon:u=tu.outlineRightIcon,thirdIcon:d=tu.outlineBottomIcon,fourthIcon:p=tu.outlineLeftIcon,linkIcon:h=fd,unlinkIcon:f=bd,styles:b=["solid","dashed","dotted","double"],reset:m}){const g=(0,_c.useInstanceId)(Kd),[v,x]=(0,ko.useState)(i),k=n?i:v,y=n||x,_={first:c,second:u,third:d,fourth:p,link:h,unlink:f},w=(0,ko.useRef)(),C=o?.[0]||s,j="px"!==C.unit?.1:1,S="px"!==C.unit&&""!==C.unit?12:200,N=(e,n)=>{C[n]=e;const o=JSON.parse(JSON.stringify(C));t([o])},O=e=>{C.unit=e;const n=JSON.parse(JSON.stringify(C));t([n])};return[t&&(0,_o.jsxs)("div",{ref:w,className:`components-base-control kadence-border-control kadence-border-control${g}${a?" "+a:""}`,children:[e&&(0,_o.jsxs)("div",{className:"kadence-border-control__header",children:[e&&(0,_o.jsxs)("div",{className:"kadence-border-control__title",children:[(0,_o.jsx)("label",{className:"components-base-control__label",children:e}),m&&(0,_o.jsx)("div",{className:"title-reset-wrap",children:(0,_o.jsx)(yo.Button,{className:"is-reset is-single",label:"reset",isSmall:!0,disabled:!!(0,Oo.isEqual)(s,o),icon:undo,onClick:()=>{"function"==typeof m?m():t([s])}})})]}),y&&(0,_o.jsx)(yo.Button,{className:"kadence-radio-item border-control-toggle is-single only-icon",label:"individual"!==k?(0,Mo.__)("Individual","kadence-blocks"):(0,Mo.__)("Linked","kadence-blocks"),icon:"individual"!==k?_.link:_.unlink,onClick:()=>y("individual"!==k?"individual":"linked"),isPressed:"individual"!==k,isTertiary:"individual"===k})]}),(0,_o.jsxs)("div",{className:"kadence-controls-content",children:["individual"!==k&&(0,_o.jsx)(_o.Fragment,{children:(0,_o.jsx)(Xd,{value:C?.top||["","",""],onChange:e=>(e=>{C.top=e,C.bottom=e,C.right=e,C.left=e;const n=JSON.parse(JSON.stringify(C));t([n])})(e),min:0,max:S,step:j,help:r,styles:b,unit:C?.unit||"px",units:l,onUnit:e=>O(e),defaultValue:s.top,allowReset:!1})}),"individual"===k&&(0,_o.jsxs)("div",{className:"kadence-border-controls-grid-wrap",children:[(0,_o.jsx)("div",{className:"kadence-border-control-grid-visualizer",style:{borderTopColor:C?.top?.[0]?(0,No.KadenceColorOutput)(C?.top?.[0]):void 0,borderTopStyle:C?.top?.[1]||void 0,borderTopWidth:C?.top?.[2]?"clamp( 1px, "+C?.top?.[2]+C?.unit+", 10px )":void 0,borderRightColor:C?.right?.[0]?(0,No.KadenceColorOutput)(C?.right?.[0]):void 0,borderRightStyle:C?.right?.[1]||void 0,borderRightWidth:C?.right?.[2]?"clamp( 1px, "+C?.right?.[2]+C?.unit+", 10px )":void 0,borderBottomColor:C?.bottom?.[0]?(0,No.KadenceColorOutput)(C?.bottom?.[0]):void 0,borderBottomStyle:C?.bottom?.[1]||void 0,borderBottomWidth:C?.bottom?.[2]?"clamp( 1px, "+C?.bottom?.[2]+C?.unit+", 10px )":void 0,borderLeftColor:C?.left?.[0]?(0,No.KadenceColorOutput)(C?.left?.[0]):void 0,borderLeftStyle:C?.left?.[1]||void 0,borderLeftWidth:C?.left?.[2]?"clamp( 1px, "+C?.left?.[2]+C?.unit+", 10px )":void 0}}),(0,_o.jsx)(Xd,{value:C?.top||["","",""],onChange:e=>N(e,"top"),min:0,max:S,step:j,help:r,styles:b,unit:C?.unit||"px",units:l,onUnit:e=>O(e),defaultValue:s.top,allowReset:!1}),(0,_o.jsx)(Xd,{value:C?.left||["","",""],onChange:e=>N(e,"left"),min:0,max:S,step:j,help:r,styles:b,unit:C?.unit||"px",units:l,onUnit:e=>O(e),defaultValue:s.left,allowReset:!1}),(0,_o.jsx)(Xd,{value:C?.right||["","",""],onChange:e=>N(e,"right"),min:0,max:S,step:j,help:r,styles:b,unit:C?.unit||"px",units:l,onUnit:e=>O(e),defaultValue:s.right,allowReset:!1}),(0,_o.jsx)(Xd,{value:C?.bottom||["","",""],onChange:e=>N(e,"bottom"),min:0,max:S,step:j,help:r,styles:b,unit:C?.unit||"px",units:l,onUnit:e=>O(e),defaultValue:s.bottom,allowReset:!1})]})]})]})]}function Yd({label:e,onChange:t,onChangeTablet:n,onChangeMobile:o,onControl:a,mobileValue:r="",tabletValue:s="",value:i="",control:l="individual",units:c=["px","em","rem"],firstIcon:u=tu.outlineTopIcon,secondIcon:d=tu.outlineRightIcon,thirdIcon:p=tu.outlineBottomIcon,fourthIcon:h=tu.outlineLeftIcon,linkIcon:f=fd,unlinkIcon:b=bd,styles:m=["solid","dashed","dotted","double"],deskDefault:g={top:["","",""],right:["","",""],bottom:["","",""],left:["","",""],unit:"px"},tabletDefault:v={top:["","",""],right:["","",""],bottom:["","",""],left:["","",""],unit:""},mobileDefault:x={top:["","",""],right:["","",""],bottom:["","",""],left:["","",""],unit:""},reset:k=!0,defaultLinked:y=!0}){const _=(0,_c.useInstanceId)(Yd),w={first:u,second:d,third:p,fourth:h,link:f,unlink:b},[C,j]=(0,ko.useState)(l),S=a?l:C,N=a||j,[O,E]=(0,ko.useState)("Desktop"),M=(0,To.useSelect)(e=>e("kadenceblocks/data").getPreviewDeviceType(),[]);M!==O&&E(M),(0,ko.useEffect)(()=>{y&&("Mobile"===M?(0,Oo.isEqual)(r?.[0]?.top,r?.[0]?.bottom)&&(0,Oo.isEqual)(r?.[0]?.top,r?.[0]?.bottom)&&(0,Oo.isEqual)(r?.[0]?.top,r?.[0]?.right)&&(0,Oo.isEqual)(r?.[0]?.top,r?.[0]?.left)&&N("linked"):"Tablet"===M?(0,Oo.isEqual)(s?.[0]?.top,s?.[0]?.bottom)&&(0,Oo.isEqual)(s?.[0]?.top,s?.[0]?.bottom)&&(0,Oo.isEqual)(s?.[0]?.top,s?.[0]?.right)&&(0,Oo.isEqual)(s?.[0]?.top,s?.[0]?.left)&&N("linked"):(0,Oo.isEqual)(i?.[0]?.top,i?.[0]?.bottom)&&(0,Oo.isEqual)(i?.[0]?.top,i?.[0]?.bottom)&&(0,Oo.isEqual)(i?.[0]?.top,i?.[0]?.right)&&(0,Oo.isEqual)(i?.[0]?.top,i?.[0]?.left)&&N("linked")),r&&(0,Oo.isEqual)(i?.[0]?.unit,r?.[0]?.unit)&&(r[0].unit="",o(r)),s&&(0,Oo.isEqual)(i?.[0]?.unit,s?.[0]?.unit)&&(s[0].unit="",n(s))},[]);const{setPreviewDeviceType:T}=(0,To.useDispatch)("kadenceblocks/data"),R=[{name:"Desktop",title:(0,_o.jsx)(yo.Dashicon,{icon:"desktop"}),itemClass:"kb-desk-tab"},{name:"Tablet",title:(0,_o.jsx)(yo.Dashicon,{icon:"tablet"}),itemClass:"kb-tablet-tab"},{name:"Mobile",key:"mobile",title:(0,_o.jsx)(yo.Dashicon,{icon:"smartphone"}),itemClass:"kb-mobile-tab"}];let I=i?.[0]?i[0]:g;"Tablet"===O?I=s?.[0]?s[0]:v:"Mobile"===O&&(I=r?.[0]?r[0]:x);const P={},L=r?.[0]?.unit?r[0].unit:i?.[0]?.unit?i[0].unit:"px",A=s?.[0]?.unit?s[0].unit:i?.[0]?.unit?i[0].unit:"px";P.Mobile=(0,_o.jsx)(Kd,{value:r?JSON.parse(JSON.stringify(r)):void 0,onChange:e=>o(e),control:S,onControl:e=>N(e),defaultValue:x,styles:m,units:[L],firstIcon:u,secondIcon:d,thirdIcon:p,fourthIcon:h,linkIcon:f,unlinkIcon:b},"mobile"+_),P.Tablet=(0,_o.jsx)(Kd,{value:s?JSON.parse(JSON.stringify(s)):void 0,onChange:e=>n(e),control:S,onControl:e=>N(e),defaultValue:v,styles:m,units:[A],firstIcon:u,secondIcon:d,thirdIcon:p,fourthIcon:h,linkIcon:f,unlinkIcon:b},"tablet"+_),P.Desktop=(0,_o.jsx)(Kd,{value:i?JSON.parse(JSON.stringify(i)):void 0,onChange:e=>t(e),control:S,onControl:e=>N(e),defaultValue:g,styles:m,units:c,firstIcon:u,secondIcon:d,thirdIcon:p,fourthIcon:h,linkIcon:f,unlinkIcon:b},"desktop"+_);let D=g;return"Mobile"===O?D=x:"Mobile"===O&&(D=v),[t&&n&&o&&(0,_o.jsxs)("div",{className:`components-base-control kb-responsive-border-control kadence-border-box-control kadence-border-box-control${_}`,children:[(0,_o.jsxs)("div",{className:"kadence-border-control__header kadence-component__header",children:[e&&(0,_o.jsxs)("div",{className:"kadence-component__header__title kadence-radio-range__title",children:[(0,_o.jsx)("label",{className:"components-base-control__label",children:e}),k&&(0,_o.jsx)("div",{className:"title-reset-wrap",children:(0,_o.jsx)(yo.Button,{className:"is-reset is-single",label:"reset",isSmall:!0,disabled:!!(0,Oo.isEqual)(D,I),icon:kd,onClick:()=>{"Tablet"===O?n([v]):"Mobile"===O?o([x]):t([g])}})})]}),(0,_o.jsx)(yo.ButtonGroup,{className:"kb-responsive-options kb-measure-responsive-options","aria-label":(0,Mo.__)("Device","kadence-blocks"),children:(0,Oo.map)(R,({name:e,key:t,title:n,itemClass:o})=>(0,_o.jsx)(yo.Button,{className:`kb-responsive-btn ${o}${e===O?" is-active":""}`,isSmall:!0,"aria-pressed":O===e,onClick:()=>{return t=e,T((0,No.capitalizeFirstLetter)(t)),void E((0,No.capitalizeFirstLetter)(t));var t},children:n},t))}),N&&(0,_o.jsx)(yo.Button,{isSmall:!0,className:"kadence-radio-item border-control-toggle is-single only-icon",label:"individual"!==S?(0,Mo.__)("Individual","kadence-blocks"):(0,Mo.__)("Linked","kadence-blocks"),icon:"individual"!==S?w.link:w.unlink,onClick:()=>N("individual"!==S?"individual":"linked"),isPressed:"individual"!==S,isTertiary:"individual"===S})]}),(0,_o.jsx)("div",{className:"kb-responsive-border-control-inner",children:P[O]?P[O]:P.Desktop})]})]}function Zd(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 Qd({label:e,onChange:t,value:n="",className:o="",options:a=No.FONT_SIZES_MAP,step:r=1,max:s=200,min:i=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,preventUnitSelection:v=!1}){const[x,k]=(0,ko.useState)(!1);(0,ko.useEffect)(()=>{k(function(e,t){return!!t&&!!e&&!e.find(e=>e.value===t)}(a,n))},[]);const y=f?h:x,_=f||k,w=d.map(e=>({value:e,label:e})),C=y?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),j=[{value:"",output:"",size:"",label:(0,Mo.__)("Inherit","kadence-blocks"),name:(0,Mo.__)("Inherit","kadence-blocks")},...a];return[t&&(0,_o.jsxs)("div",{className:"components-base-control component-font-size-control kadence-font-size-control"+(o?" "+o:""),children:[!f&&e&&(0,_o.jsx)("div",{className:"kadence-font-size-control__header kadence-component__header",children:(0,_o.jsxs)("div",{className:"kadence-component__header__title kadence-radio-range__title",children:[(0,_o.jsx)("label",{className:"components-base-control__label",children:e}),m&&(0,_o.jsx)("div",{className:"title-reset-wrap",children:(0,_o.jsx)(yo.Button,{className:"is-reset is-single",label:"reset",isSmall:!0,disabled:!!(0,Oo.isEqual)(l,n),icon:kd,onClick:()=>{"function"==typeof m?m():t(l)}})})]})}),!y&&g&&(0,_o.jsx)("div",{className:"kadence-controls-content",children:(0,_o.jsxs)(yo.ButtonGroup,{className:"kadence-radio-container-control",children:[a.map((e,n)=>(0,_o.jsx)(yo.Button,{isTertiary:C!==e.value,className:"kadence-radio-item radio-"+e.value,isPrimary:C===e.value,icon:void 0!==e.icon?e.icon:void 0,"aria-pressed":C===e.value,onClick:()=>{C==e.value&&""==l?t(""):t(e.value)},children:e.label},`${e.label}-${e.value}-${n}`)),!p&&(0,_o.jsx)(yo.Button,{className:"kadence-radio-item radio-custom only-icon",label:(0,Mo.__)("Set custom size","kadence-blocks"),icon:zc,onClick:()=>{C&&"px"===c&&t(Zd(a,C)),_(!0)},isPressed:!1,isTertiary:!0})]})}),!y&&!g&&(0,_o.jsxs)("div",{className:"kadence-controls-content kadence-font-size-select-control-wrap",children:[(0,_o.jsx)(yo.SelectControl,{className:"kadence-font-size-select-control",value:C,options:j,onChange:e=>{t(C==e&&""==l?"":e)}}),!p&&(0,_o.jsx)(yo.ButtonGroup,{className:"kadence-radio-container-control",children:(0,_o.jsx)(yo.Button,{className:"kadence-radio-item radio-custom only-icon",label:(0,Mo.__)("Set custom size","kadence-blocks"),icon:zc,onClick:()=>{C&&"px"===c&&t(Zd(a,C)),_(!0)},isPressed:!1,isTertiary:!0})})]}),y&&(0,_o.jsxs)("div",{className:"kadence-controls-content kadence-single-unit-control",children:[(0,_o.jsx)(yo.__experimentalUnitControl,{label:b&&e?e:void 0,labelPosition:"top",min:i,max:s,step:r,units:w,value:n,disableUnits:!0,onChange:e=>(e=>{const n=isNaN(parseFloat(e))?void 0:parseFloat(e);t(n)})(e)}),(0,_o.jsx)("div",{className:"kadence-measure-control-select-wrapper",children:(0,_o.jsxs)("select",{className:"kadence-measure-control-select components-unit-control__select",onChange:e=>{u(e.target.value)},value:c,disabled:!!v,children:[!v&&d.map(e=>(0,_o.jsx)("option",{value:e,selected:c===e||void 0,children:e},e)),v&&(0,_o.jsx)("option",{value:c,selected:!0,children:""===c?"-":c},c)]})}),!p&&(0,_o.jsx)(yo.ButtonGroup,{className:"kadence-radio-container-control",children:(0,_o.jsx)(yo.Button,{className:"kadence-radio-item radio-custom only-icon",label:(0,Mo.__)("Use size preset","kadence-blocks"),icon:zc,isPrimary:!0,onClick:()=>{n&&"px"===c&&t(function(e,t){if(!t)return"";if(!e)return"";if("0"===t)return"";const n=e.find(e=>e.size===t);return n?n.value:""}(a,n)),_(!1)},isPressed:!0})})]})]})]}function ep({label:e,onChange:t,onChangeTablet:n,onChangeMobile:o,mobileValue:a,tabletValue:r,value:s,units:i=["px","em","rem"],onUnit:l,options:c=No.FONT_SIZES_MAP,step:u=1,max:d=200,min:p=0,unit:h="px",defaultValue:f=["","",""],reset:b=!0,radio:m=!0,compressedDevice:g=!1}){const v=(0,ko.useRef)(),[x,k]=(0,ko.useState)("Desktop"),y=(0,To.useSelect)(e=>e("kadenceblocks/data").getPreviewDeviceType(),[]);y!==x&&k(y);const{setPreviewDeviceType:_}=(0,To.useDispatch)("kadenceblocks/data"),w=e=>{_((0,No.capitalizeFirstLetter)(e)),k((0,No.capitalizeFirstLetter)(e))},C=[{name:"Desktop",title:(0,_o.jsx)(yo.Dashicon,{icon:"desktop"}),itemClass:"kb-desk-tab"},{name:"Tablet",title:(0,_o.jsx)(yo.Dashicon,{icon:"tablet"}),itemClass:"kb-tablet-tab"},{name:"Mobile",key:"mobile",title:(0,_o.jsx)(yo.Dashicon,{icon:"smartphone"}),itemClass:"kb-mobile-tab"}],j=[s,r,a],S={};S.Mobile=(0,_o.jsx)(Qd,{value:a||void 0,onChange:e=>o(e),options:c,onUnit:l,defaultValue:f[2],units:i,step:u,max:d,min:p,unit:h,radio:m,preventUnitSelection:!0}),S.Tablet=(0,_o.jsx)(Qd,{value:r||void 0,onChange:e=>n(e),options:c,onUnit:l,defaultValue:f[1],units:i,step:u,max:d,min:p,unit:h,radio:m,preventUnitSelection:!0}),S.Desktop=(0,_o.jsx)(Qd,{value:s||void 0,onChange:e=>t(e),options:c,onUnit:l,defaultValue:f[0],units:i,step:u,max:d,min:p,unit:h,radio:m});const N={Desktop:(0,_o.jsx)(yo.Dashicon,{icon:"desktop"}),Tablet:(0,_o.jsx)(yo.Dashicon,{icon:"tablet"}),Mobile:(0,_o.jsx)(yo.Dashicon,{icon:"smartphone"})};return[t&&n&&o&&(0,_o.jsxs)("div",{ref:v,className:"components-base-control kb-responsive-font-size-control kadence-font-size-control",children:[(0,_o.jsxs)("div",{className:"kadence-font-size-control__header kadence-component__header",children:[e&&(0,_o.jsxs)("div",{className:"kadence-component__header__title kadence-font-size__title",children:[(0,_o.jsx)("label",{className:"components-base-control__label",children:e}),b&&(0,_o.jsx)("div",{className:"title-reset-wrap",children:(0,_o.jsx)(yo.Button,{className:"is-reset is-single",label:"reset",isSmall:!0,disabled:!!(0,Oo.isEqual)(f,j),icon:kd,onClick:()=>{"function"==typeof b?b():"Mobile"===x?o(f[2]):"Tablet"===x?n(f[1]):t(f[0])}})})]}),!g&&(0,_o.jsx)(yo.ButtonGroup,{className:"kb-responsive-options kb-measure-responsive-options","aria-label":(0,Mo.__)("Device","kadence-blocks"),children:(0,Oo.map)(C,({name:e,key:t,title:n,itemClass:o})=>(0,_o.jsx)(yo.Button,{className:`kb-responsive-btn ${o}${e===x?" is-active":""}`,isSmall:!0,"aria-pressed":x===e,onClick:()=>w(e),children:n},t))}),g&&(0,_o.jsx)(yo.DropdownMenu,{className:"kb-responsive-options-dropdown",icon:N[x]?N[x]:N.Desktop,label:(0,Mo.__)("Target Device","kadence-blocks"),controls:C.map(e=>{return[{title:(t=e).name,icon:t.title,isActive:x===t.name,onClick:()=>{w(t.name)}}];var t})})]}),(0,_o.jsx)("div",{className:"kb-responsive-border-control-inner",children:S[x]?S[x]:S.Desktop})]})]}function tp({label:e,onChange:t,value:n="",className:o="",step:a=1,max:r=200,min:s=0,defaultValue:i="",unit:l="",onUnit:c,units:u=["px","em","rem"],parentLabel:d=null,reset:p=!0,preventUnitSelection:h=!1}){const f=u.map(e=>({value:e,label:e}));return[t&&(0,_o.jsxs)("div",{className:"components-base-control component-font-size-control kadence-font-size-control"+(o?" "+o:""),children:[e&&(0,_o.jsx)("div",{className:"kadence-font-size-control__header kadence-component__header",children:(0,_o.jsxs)("div",{className:"kadence-component__header__title kadence-radio-range__title",children:[(0,_o.jsx)("label",{className:"components-base-control__label",children:e}),p&&(0,_o.jsx)("div",{className:"title-reset-wrap",children:(0,_o.jsx)(yo.Button,{className:"is-reset is-single",label:"reset",isSmall:!0,disabled:!!(0,Oo.isEqual)(i,n),icon:kd,onClick:()=>{"function"==typeof p?p():t(i)}})})]})}),(0,_o.jsxs)("div",{className:"kadence-controls-content kadence-single-unit-control",children:[(0,_o.jsx)(yo.__experimentalUnitControl,{label:d&&e?e:void 0,labelPosition:"top",min:s,max:r,step:a,units:f,value:n,disableUnits:!0,onChange:e=>(e=>{const n=isNaN(parseFloat(e))?void 0:parseFloat(e);t(n)})(e)}),(0,_o.jsx)("div",{className:"kadence-measure-control-select-wrapper",children:(0,_o.jsx)("select",{className:"kadence-measure-control-select components-unit-control__select",onChange:e=>{"-"===e.target.value?c(""):c(e.target.value)},value:l,disabled:!!h,children:u.map(e=>h?l===e&&(0,_o.jsx)("option",{value:e,selected:l===e||""===l&&"-"===e||void 0,children:e},e):(0,_o.jsx)("option",{value:e,selected:l===e||""===l&&"-"===e||void 0,children:e},e))})})]})]})]}function np({label:e,onChange:t,onChangeTablet:n,onChangeMobile:o,mobileValue:a,tabletValue:r,value:s,units:i=["px","em","rem"],onUnit:l,step:c=1,max:u=200,min:d=0,unit:p="",defaultValue:h=["","",""],compressedDevice:f=!1,reset:b=!0}){const m=(0,ko.useRef)(),[g,v]=(0,ko.useState)("Desktop"),x=(0,To.useSelect)(e=>e("kadenceblocks/data").getPreviewDeviceType(),[]);x!==g&&v(x);const{setPreviewDeviceType:k}=(0,To.useDispatch)("kadenceblocks/data"),y=e=>{k((0,No.capitalizeFirstLetter)(e)),v((0,No.capitalizeFirstLetter)(e))},_=[{name:"Desktop",title:(0,_o.jsx)(yo.Dashicon,{icon:"desktop"}),itemClass:"kb-desk-tab"},{name:"Tablet",title:(0,_o.jsx)(yo.Dashicon,{icon:"tablet"}),itemClass:"kb-tablet-tab"},{name:"Mobile",key:"mobile",title:(0,_o.jsx)(yo.Dashicon,{icon:"smartphone"}),itemClass:"kb-mobile-tab"}],w={Desktop:(0,_o.jsx)(yo.Dashicon,{icon:"desktop"}),Tablet:(0,_o.jsx)(yo.Dashicon,{icon:"tablet"}),Mobile:(0,_o.jsx)(yo.Dashicon,{icon:"smartphone"})},C=[s,r,a],j={};return j.Mobile=(0,_o.jsx)(tp,{value:a||void 0,onChange:e=>o(e),onUnit:l,defaultValue:h[2],units:i,step:c,max:u,min:d,unit:p,preventUnitSelection:!0}),j.Tablet=(0,_o.jsx)(tp,{value:r||void 0,onChange:e=>n(e),onUnit:l,defaultValue:h[1],units:i,step:c,max:u,min:d,unit:p,preventUnitSelection:!0}),j.Desktop=(0,_o.jsx)(tp,{value:s||void 0,onChange:e=>t(e),onUnit:l,defaultValue:h[0],units:i,step:c,max:u,min:d,unit:p}),[t&&n&&o&&(0,_o.jsxs)("div",{ref:m,className:"components-base-control kb-responsive-unit-control kadence-unit-control",children:[(0,_o.jsxs)("div",{className:"kadence-unit-control__header kadence-component__header",children:[e&&(0,_o.jsxs)("div",{className:"kadence-component__header__title kadence-unit__title",children:[(0,_o.jsx)("label",{className:"components-base-control__label",children:e}),b&&(0,_o.jsx)("div",{className:"title-reset-wrap",children:(0,_o.jsx)(yo.Button,{className:"is-reset is-single",label:"reset",isSmall:!0,disabled:!!(0,Oo.isEqual)(h,C),icon:kd,onClick:()=>{"function"==typeof b?b():"Mobile"===g?o(h[2]):"Tablet"===g?n(h[1]):t(h[0])}})})]}),!f&&(0,_o.jsx)(yo.ButtonGroup,{className:"kb-responsive-options kb-measure-responsive-options","aria-label":(0,Mo.__)("Device","kadence-blocks"),children:(0,Oo.map)(_,({name:e,key:t,title:n,itemClass:o})=>(0,_o.jsx)(yo.Button,{className:`kb-responsive-btn ${o}${e===g?" is-active":""}`,isSmall:!0,"aria-pressed":g===e,onClick:()=>y(e),children:n},t))}),f&&(0,_o.jsx)(yo.DropdownMenu,{className:"kb-responsive-options-dropdown",icon:w[g]?w[g]:w.Desktop,label:(0,Mo.__)("Target Device","kadence-blocks"),controls:_.map(e=>{return[{title:(t=e).name,icon:t.title,isActive:g===t.name,onClick:()=>{y(t.name)}}];var t})})]}),(0,_o.jsx)("div",{className:"kb-responsive-border-control-inner",children:j[g]?j[g]:j.Desktop})]})]}const op=(0,_o.jsx)(Ho.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,_o.jsx)(Ho.Path,{d:"M19 8h-1V6h-5v2h-2V6H6v2H5c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-8c0-1.1-.9-2-2-2zm.5 10c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5v-8c0-.3.2-.5.5-.5h14c.3 0 .5.2.5.5v8z"})}),ap=(0,_o.jsx)(Ho.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,_o.jsx)(Ho.Path,{d:"M4 20h8v-1.5H4V20zM18.9 3.5c-.6-.6-1.5-.6-2.1 0l-7.2 7.2c-.4-.1-.7 0-1.1.1-.5.2-1.5.7-1.9 2.2-.4 1.7-.8 2.2-1.1 2.7-.1.1-.2.3-.3.4l-.6 1.1H6c2 0 3.4-.4 4.7-1.4.8-.6 1.2-1.4 1.3-2.3 0-.3 0-.5-.1-.7L19 5.7c.5-.6.5-1.6-.1-2.2zM9.7 14.7c-.7.5-1.5.8-2.4 1 .2-.5.5-1.2.8-2.3.2-.6.4-1 .8-1.1.5-.1 1 .1 1.3.3.2.2.3.5.2.8 0 .3-.1.9-.7 1.3z"})}),rp=(0,_c.compose)([(0,To.withSelect)((e,t)=>{const n=void 0!==t.initialOpen?t.initialOpen:"general";return{openedTab:e("kadenceblocks/data").getOpenSidebarTabKey(t.panelName+e("core/block-editor").getSelectedBlockClientId(),n)}}),(0,To.withDispatch)((e,t,{select:n})=>{const{getSelectedBlockClientId:o}=n("core/block-editor");return{toggleOpened:n=>{e("kadenceblocks/data").switchEditorTabOpened(t.panelName+o(),n)}}})])(function({allowedTabs:e=null,activeTab:t,setActiveTab:n,openedTab:o,toggleOpened:a,tabs:r=null}){const s=[{key:"general",title:(0,Mo.__)("General","kadence-blocks"),icon:op},{key:"style",title:(0,Mo.__)("Style","kadence-blocks"),icon:ap},{key:"advanced",title:(0,Mo.__)("Advanced","kadence-blocks"),icon:zc}],i=e||["general","style","advanced"],l=r||s,c=(0,ko.createRef)();let u;return(0,ko.useEffect)(()=>{u=c.current.closest(".components-panel")}),t!==o&&n(o),(0,ko.useEffect)(()=>{var e;return e=t,u&&(u.setAttribute("data-kadence-hide-advanced","advanced"!==e),u.setAttribute("data-kadence-active-tab",e)),()=>{if(u){const e=u.querySelector(".kadence-blocks-inspector-tabs");e&&null!==e||(u.removeAttribute("data-kadence-hide-advanced"),u.removeAttribute("data-kadence-active-tab"))}}},[t]),(0,_o.jsx)("div",{className:"kadence-blocks-inspector-tabs",ref:c,children:l.map(({key:e,title:o,icon:r},s)=>{if(i.includes(e))return(0,_o.jsxs)("button",{"aria-label":o+" "+(0,Mo.__)("tab","kadence-blocks"),onClick:()=>(e=>{a(e),n(e)})(e),className:Bc()({"is-active":e===t}),children:[(0,_o.jsx)(yo.Icon,{icon:r})," ",o]},e)})})});function sp({label:e=(0,Mo.__)("Hover Styles","kadence-blocks"),activeLabel:t=(0,Mo.__)("Active Styles","kadence-blocks"),initial:n="normal",hoverTab:o=(0,Mo.__)("Hover","kadence-blocks"),normalTab:a=(0,Mo.__)("Normal","kadence-blocks"),activeTab:r=(0,Mo.__)("Active","kadence-blocks"),active:s,hover:i,normal:l,className:c="",icon:u=tu.hoverToggle,activeIcon:d=tu.click,tabUI:p=!0,setActivePreview:h,activePreview:f}){const[b,m]=(0,ko.useState)("hover"===n),[g,v]=(0,ko.useState)("active"===n);var x=[{name:"normal",title:a,className:"kt-normal-tab"}];return i&&x.push({name:"hover",title:o,className:"kt-hover-tab"}),s&&x.push({name:"active",title:r,className:"kt-active-tab"}),p?[(0,_o.jsx)("div",{className:"components-base-control kb-hover-toggle-control-tab-ui kb-hover-toggle-control"+(c?" "+c:""),children:(0,_o.jsx)(yo.TabPanel,{className:"kt-inspect-tabs kt-hover-tabs",activeClass:"active-tab",tabs:x,children:e=>{if(e.name)return"hover"===e.name?(0,_o.jsx)(_o.Fragment,{children:i}):"active"===e.name?(0,_o.jsxs)(_o.Fragment,{children:[h&&(0,_o.jsx)(yo.Button,{className:"kb-hover-toggle-active-preview",isPressed:f,text:f?(0,Mo.__)("Hide Active State","kadence-blocks"):(0,Mo.__)("Preview Active State","kadence-blocks"),onClick:()=>{h(!f)},variant:"secondary"}),s]}):(0,_o.jsx)(_o.Fragment,{children:l})}})})]:[(0,_o.jsxs)("div",{className:"components-base-control kb-hover-toggle-control"+(c?" "+c:""),children:[(0,_o.jsxs)("div",{className:"kb-hover-toggle-control-toggle",children:[i&&(0,_o.jsx)(yo.Button,{className:"kb-hover-toggle-btn "+(No.isRTL?"is-rtl":""),isPrimary:b,icon:u,"aria-pressed":b,label:e,onClick:()=>{v(!1),m(!b)}}),s&&(0,_o.jsx)(yo.Button,{className:"kb-active-toggle-btn "+(No.isRTL?"is-rtl":""),isPrimary:g,icon:d,"aria-pressed":g,label:t,onClick:()=>{m(!1),v(!g)}})]}),(0,_o.jsxs)("div",{className:"kb-hover-toggle-area",children:[b&&(0,_o.jsx)("div",{className:"kb-hover-control-wrap",children:i}),g&&(0,_o.jsx)("div",{className:"kb-active-control-wrap",children:s}),!b&&!g&&(0,_o.jsx)(_o.Fragment,{children:l})]})]})]}function ip({label:e,onChange:t,value:n="",className:o="",isCollapsed:a=!1,ariaLabel:r=(0,Mo.__)("Change HTML Tag","kadence-blocks"),reset:s=!1,headingOnly:i=!1,tagLowLevel:l=1,tagHighLevel:c=7}){const u="span"!==n&&"div"!==n&&"p"!==n?n:2,d="span"===n||"div"===n||"p"===n?n:"heading",p=[[{icon:(0,_o.jsx)(yc,{level:1,isPressed:!(1!==u||!d||"heading"!==d)}),title:(0,Mo.__)("Heading 1","kadence-blocks"),isActive:!(1!==u||!d||"heading"!==d),onClick:()=>t(1)}],[{icon:(0,_o.jsx)(yc,{level:2,isPressed:!(2!==u||!d||"heading"!==d)}),title:(0,Mo.__)("Heading 2","kadence-blocks"),isActive:!(2!==u||!d||"heading"!==d),onClick:()=>t(2)}],[{icon:(0,_o.jsx)(yc,{level:3,isPressed:!(3!==u||!d||"heading"!==d)}),title:(0,Mo.__)("Heading 3","kadence-blocks"),isActive:!(3!==u||!d||"heading"!==d),onClick:()=>t(3)}],[{icon:(0,_o.jsx)(yc,{level:4,isPressed:!(4!==u||!d||"heading"!==d)}),title:(0,Mo.__)("Heading 4","kadence-blocks"),isActive:!(4!==u||!d||"heading"!==d),onClick:()=>t(4)}],[{icon:(0,_o.jsx)(yc,{level:5,isPressed:!(5!==u||!d||"heading"!==d)}),title:(0,Mo.__)("Heading 5","kadence-blocks"),isActive:!(5!==u||!d||"heading"!==d),onClick:()=>t(5)}],[{icon:(0,_o.jsx)(yc,{level:6,isPressed:!(6!==u||!d||"heading"!==d)}),title:(0,Mo.__)("Heading 6","kadence-blocks"),isActive:!(6!==u||!d||"heading"!==d),onClick:()=>t(6)}],[{icon:(0,_o.jsx)(yc,{level:"p",isPressed:!(!d||"p"!==d)}),title:(0,Mo.__)("Paragraph","kadence-blocks"),isActive:!(!d||"p"!==d),onClick:()=>t("p")}],[{icon:(0,_o.jsx)(yc,{level:"span",isPressed:!(!d||"span"!==d)}),title:(0,Mo.__)("Span","kadence-blocks"),isActive:!(!d||"span"!==d),onClick:()=>t("span")}],[{icon:(0,_o.jsx)(yc,{level:"div",isPressed:!(!d||"div"!==d)}),title:(0,Mo.__)("div","kadence-blocks"),isActive:!(!d||"div"!==d),onClick:()=>t("div")}]],h=(0,Oo.range)(l,c).map(e=>[{icon:(0,_o.jsx)(yc,{level:e,isPressed:!(e!==u||!d||"heading"!==d)}),title:sprintf(/* translators: %d: heading level e.g: "1", "2", "3" */ /* translators: %d: heading level e.g: "1", "2", "3" */
     40(0,Mo.sprintf)((0,Mo.__)("Color code: %s","kadence-blocks"),n)})}),h&&(0,_o.jsx)(yo.Dashicon,{icon:"admin-site"}),!o.startsWith("theme-palette")&&u===n&&(0,_o.jsx)(yo.Dashicon,{icon:"saved"})]},n)})})]}),style:null!==a?{left:`${a}%`,transform:"translateX( -50% )"}:void 0})};const $u=Gu;function Wu(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 qu={id:"IDLE"};function Xu({background:e,hasGradient:t,value:n,onChange:o,disableInserter:a=!1,isRenderedInSidebar:r}){const s=(0,ko.useRef)(),[i,l]=(0,ko.useReducer)(Wu,qu),c=e=>{const t=Fu(e.clientX,s.current);(0,Oo.some)(n,({position:e})=>Math.abs(t-e)<Mu)?"MOVING_INSERTER"===i.id&&l({type:"STOP_INSERTER_MOVE"}):l({type:"MOVE_INSERTER",insertPosition:t})},u="MOVING_INSERTER"===i.id,d="INSERTING_CONTROL_POINT"===i.id;return(0,_o.jsx)("div",{className:Bc()("components-custom-gradient-picker__gradient-bar",{"has-gradient":t}),onMouseEnter:c,onMouseMove:c,style:{background:e},onMouseLeave:()=>{l({type:"STOP_INSERTER_MOVE"})},children:(0,_o.jsxs)("div",{ref:s,className:"components-custom-gradient-picker__markers-container",children:[!a&&(u||d)&&(0,_o.jsx)($u.InsertPoint,{isRenderedInSidebar:r,insertPosition:i.insertPosition,value:n,onChange:o,onOpenInserter:()=>{l({type:"OPEN_INSERTER"})},onCloseInserter:()=>{l({type:"CLOSE_INSERTER"})}}),(0,_o.jsx)($u,{isRenderedInSidebar:r,disableRemove:a,gradientPickerDomRef:s,ignoreMarkerPosition:d?i.insertPosition:void 0,value:n,onChange:o,onStartControlPointChange:()=>{l({type:"START_CONTROL_CHANGE"})},onStopControlPointChange:()=>{l({type:"STOP_CONTROL_CHANGE"})}})]})})}var Ju=a(9942);const Ku="linear-gradient(135deg, rgb(6, 147, 227) 0%, rgb(20, 39, 109) 100%)",Yu={type:"angular",value:90},Zu=[{type:"shape",value:"ellipse",at:{type:"position",value:{x:{type:"position-keyword",value:"center"},y:{type:"position-keyword",value:"center"}}}}],Qu=[{value:"linear-gradient",label:(0,Mo.__)("Linear","kadence-blocks")},{value:"radial-gradient",label:(0,Mo.__)("Radial","kadence-blocks")}],ed=[{value:"center top",label:(0,Mo.__)("Center Top","kadence-blocks")},{value:"center center",label:(0,Mo.__)("Center Center","kadence-blocks")},{value:"center bottom",label:(0,Mo.__)("Center Bottom","kadence-blocks")},{value:"left top",label:(0,Mo.__)("Left Top","kadence-blocks")},{value:"left center",label:(0,Mo.__)("Left Center","kadence-blocks")},{value:"left bottom",label:(0,Mo.__)("Left Bottom","kadence-blocks")},{value:"right top",label:(0,Mo.__)("Right Top","kadence-blocks")},{value:"right center",label:(0,Mo.__)("Right Center","kadence-blocks")},{value:"right bottom",label:(0,Mo.__)("Right Bottom","kadence-blocks")}],td={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 nd({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 od({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)}).map(nd)].filter(Boolean).join(",")})`}function ad(e){return void 0===e.length||"%"!==e.length.type}function rd(e){switch(e.type){case"hex":return`#${e.value}`;case"literal":return e.value;case"rgb":case"rgba":return`${e.type}(${e.value.join(",")})`;default:return"transparent"}}const sd=({gradientAST:e,hasGradient:t,onChange:n})=>{var o;const a=null!==(o=e?.orientation?.value)&&void 0!==o?o:180;return(0,_o.jsx)(yo.AnglePickerControl,{__nextHasNoMarginBottom:!0,onChange:t=>{n(od({...e,orientation:{type:"angular",value:t}}))},labelPosition:"top",value:t?a:""})},id=({gradientAST:e,hasGradient:t,onChange:n})=>{const{type:o}=e;return(0,_o.jsx)(yo.SelectControl,{className:"components-custom-gradient-picker__type-picker kadence-select-large",label:(0,Mo.__)("Type"),labelPosition:"top",onChange:t=>{"linear-gradient"===t&&n(od({...e,orientation:Yu,type:"linear-gradient"})),"radial-gradient"===t&&n(od({...e,orientation:Zu,type:"radial-gradient"}))},options:Qu,value:t&&o})},ld=({gradientAST:e,hasGradient:t,onChange:n})=>{let o="center center",a="50%",r="50%",s="position-keyword";e?.orientation&&e?.orientation[0]?.at?.value?.x?.value&&(s=e.orientation[0].at.value.x.type,"position-keyword"!==s?(o=e.orientation[0].at.value.x.value+"% "+e.orientation[0].at.value.y.value+"%",a=e.orientation[0].at.value.x.value+"%",r=e.orientation[0].at.value.y.value+"%"):o=e.orientation[0].at.value.x.value+" "+e.orientation[0].at.value.y.value);const i=t=>{const a=o.split(" ");let r="%"===t?50:"center",s="%"===t?50:"center";if(a[0])switch(a[0]){case"left":r=0;break;case"right":r="100";break;case"center":r=50;break;case 0:s="left";break;case 100:s="right";break;case 50:s="center"}if(a[1])switch(a[1]){case"top":s=0;break;case"bottom":s=100;break;case"center":s=50;break;case 0:s="top";break;case 100:s="bottom";break;case 50:s="center"}n(od({...e,orientation:[{type:"shape",value:e.orientation[0].value,at:{type:"position",value:{x:{type:t,value:r},y:{type:t,value:s}}}}]}))};if(t)return(0,_o.jsxs)("div",{className:"components-base-control kadence-gradient-position-control",children:[(0,_o.jsx)(yo.Flex,{justify:"space-between",className:"kadence-gradient-position_header",children:(0,_o.jsx)(yo.FlexItem,{children:(0,_o.jsx)("label",{className:"kadence-gradient-position__label",children:(0,Mo.__)("Position","kadence-blocks")})})}),"position-keyword"===s&&(0,_o.jsxs)("div",{className:"kadence-controls-content",children:[(0,_o.jsx)(yo.SelectControl,{className:"components-custom-gradient-picker__position-picker",onChange:t=>{const o=t.split(" ");n(od({...e,orientation:[{type:"shape",value:e.orientation[0].value,at:{type:"position",value:{x:{type:"position-keyword",value:void 0!==o[0]&&o[0]?o[0]:"center"},y:{type:"position-keyword",value:void 0!==o[1]&&o[1]?o[1]:"center"}}}}]}))},options:ed,value:o}),(0,_o.jsx)(yo.Button,{className:"kadence-control-toggle-advanced only-icon",label:(0,Mo.__)("Set custom position","kadence-blocks"),icon:zc,onClick:()=>i("%"),isPressed:!1,isTertiary:!0})]}),"position-keyword"!==s&&(0,_o.jsxs)("div",{className:"kadence-controls-content",children:[(0,_o.jsx)(yo.__experimentalUnitControl,{labelPosition:"left",label:(0,Mo.__)("Left","kadence-blocks"),max:100,min:0,units:[{value:"%",label:"%"}],value:a,onChange:t=>{n(od({...e,orientation:[{type:"shape",value:e.orientation[0].value,at:{type:"position",value:{x:{type:"%",value:parseInt(t,10)},y:e.orientation[0].at.value.y}}}]}))}}),(0,_o.jsx)(yo.__experimentalUnitControl,{labelPosition:"left",label:(0,Mo.__)("Top","kadence-blocks"),max:100,min:0,value:r,units:[{value:"%",label:"%"}],onChange:t=>{n(od({...e,orientation:[{type:"shape",value:e.orientation[0].value,at:{type:"position",value:{x:e.orientation[0].at.value.x,y:{type:"%",value:parseInt(t,10)}}}}]}))}}),(0,_o.jsx)(yo.Button,{className:"kadence-control-toggle-advanced only-icon",label:(0,Mo.__)("Set standard position","kadence-blocks"),icon:zc,onClick:()=>i("position-keyword"),isPrimary:!0,isPressed:!0})]})]})},cd=({gradientAST:e,hasGradient:t,onChange:n})=>{let o="ellipse";return e?.orientation&&e?.orientation[0]?.type&&"shape"===e?.orientation[0]?.type&&e?.orientation[0]?.value&&(o=e?.orientation&&e?.orientation[0]?.value),(0,_o.jsx)(yo.SelectControl,{className:"components-custom-gradient-picker__shape-picker kadence-select-large",label:(0,Mo.__)("Shape","kadence-blocks"),labelPosition:"top",onChange:t=>{n(od({...e,orientation:[{type:"shape",value:t,at:e.orientation[0].at}]}))},options:[{value:"ellipse",label:(0,Mo.__)("Ellipse","kadence-blocks")},{value:"circle",label:(0,Mo.__)("Circle","kadence-blocks")}],value:t&&o})};function ud({value:e,onChange:t,isRenderedInSidebar:n=!0}){const o=function(e){let t;try{t=Ju.parse(e)[0],t.value=e}catch(e){t=Ju.parse(Ku)[0],t.value=Ku}if("directional"===t.orientation?.type&&(t.orientation.type="angular",t.orientation.value=td[t.orientation.value].toString()),t.colorStops.some(ad)){const{colorStops:e}=t,n=100/(e.length-1);e.forEach((e,t)=>{e.length={value:n*t,type:"%"}}),t.value=od(t)}return t}(e),a=function(e){return od({type:"linear-gradient",orientation:Yu,colorStops:e.colorStops})}(o),r=o.value!==Ku,s=o.colorStops.map(e=>({color:rd(e),position:parseInt(e.length.value)}));return(0,_o.jsxs)("div",{className:"components-base-control components-custom-gradient-picker kadence-gradient-control",children:[(0,_o.jsx)(Xu,{isRenderedInSidebar:n,background:a,hasGradient:r,value:s,onChange:e=>{t(od(function(e,t){return{...e,colorStops:t.map(({position:e,color:t})=>{if(t.startsWith("var("))return{length:{type:"%",value:e?.toString()},type:"literal",value:t};const{r:n,g:o,b:a,a:r}=Ou(t).toRgb();return{length:{type:"%",value:e?.toString()},type:r<1?"rgba":"rgb",value:r<1?[n,o,a,r]:[n,o,a]}})}}(o,e)))}}),(0,_o.jsxs)(yo.Flex,{gap:3,className:"components-custom-gradient-picker__ui-line",children:[(0,_o.jsx)("div",{className:"components-custom-gradient-picker__item components-custom-gradient-picker-type",children:(0,_o.jsx)(id,{gradientAST:o,hasGradient:r,onChange:t})}),"linear-gradient"===o.type&&(0,_o.jsx)("div",{className:"components-custom-gradient-picker__item components-custom-gradient-picker-angle",children:(0,_o.jsx)(sd,{gradientAST:o,hasGradient:r,onChange:t})}),"radial-gradient"===o.type&&(0,_o.jsx)("div",{className:"components-custom-gradient-picker__item components-custom-gradient-picker-shape",children:(0,_o.jsx)(cd,{gradientAST:o,hasGradient:r,onChange:t})})]}),"radial-gradient"===o.type&&(0,_o.jsx)(yo.Flex,{gap:3,className:"components-custom-gradient-picker__ui-line",children:(0,_o.jsx)("div",{className:"components-custom-gradient-picker__item components-custom-gradient-picker-position",children:(0,_o.jsx)(ld,{gradientAST:o,hasGradient:r,onChange:t})})})]})}const dd=[{value:"0",label:(0,Mo.__)("None","kadence-blocks"),size:0,name:(0,Mo.__)("None","kadence-blocks")},{value:"xxs",output:"var(--global-kb-spacing-xxs, 0.5rem)",size:8,label:(0,Mo.__)("XXS","kadence-blocks"),name:(0,Mo.__)("2X Small","kadence-blocks")},{value:"xs",output:"var(--global-kb-spacing-xs, 1rem)",size:16,label:(0,Mo.__)("XS","kadence-blocks"),name:(0,Mo.__)("X Small","kadence-blocks")},{value:"sm",output:"var(--global-kb-spacing-sm, 1.5rem)",size:24,label:(0,Mo.__)("SM","kadence-blocks"),name:(0,Mo.__)("Small","kadence-blocks")},{value:"md",output:"var(--global-kb-spacing-md, 2rem)",size:32,label:(0,Mo.__)("MD","kadence-blocks"),name:(0,Mo.__)("Medium","kadence-blocks")},{value:"lg",output:"var(--global-kb-spacing-lg, 3rem)",size:48,label:(0,Mo.__)("LG","kadence-blocks"),name:(0,Mo.__)("Large","kadence-blocks")},{value:"xl",output:"var(--global-kb-spacing-xl, 4rem)",size:64,label:(0,Mo.__)("XL","kadence-blocks"),name:(0,Mo.__)("X Large","kadence-blocks")},{value:"xxl",output:"var(--global-kb-spacing-xxl, 5rem)",size:80,label:(0,Mo.__)("XXL","kadence-blocks"),name:(0,Mo.__)("2X Large","kadence-blocks")},{value:"3xl",output:"var(--global-kb-spacing-3xl, 6.5rem)",size:104,label:(0,Mo.__)("3XL","kadence-blocks"),name:(0,Mo.__)("3X Large","kadence-blocks")},{value:"4xl",output:"var(--global-kb-spacing-4xl, 8rem)",size:128,label:(0,Mo.__)("4XL","kadence-blocks"),name:(0,Mo.__)("4X Large","kadence-blocks")},{value:"5xl",output:"var(--global-kb-spacing-5xl, 10rem)",size:160,label:(0,Mo.__)("5XL","kadence-blocks"),name:(0,Mo.__)("5X Large","kadence-blocks")}];function pd(e,t){if(!t)return;if(!e)return;if("0"===t||"default"===t)return 0;return e.findIndex(e=>e.value===t)||void 0}function hd({label:e,onChange:t,value:n="",placeholder:o="",className:a="",options:r=dd,step:s=1,max:i=200,min:l=0,beforeIcon:c="",help:u="",defaultValue:d=0,unit:p="",onUnit:h,units:f=["px","em","rem"],disableCustomSizes:b=!1,customControl:m=!1,setCustomControl:g=null,isPopover:v=!1,isSingle:x=!1,parentLabel:k=null,onMouseOver:y,onMouseOut:_,allowAuto:w=!1}){const[C,j]=(0,ko.useState)(!1),[S,N]=(0,ko.useState)(!1),O=JSON.parse(JSON.stringify(r));O.push({value:"ss-auto",output:"var(--global-kb-spacing-auto, auto)",label:(0,Mo.__)("Auto","kadence-blocks"),size:0,name:(0,Mo.__)("Auto","kadence-blocks")}),(0,ko.useEffect)(()=>{j(function(e,t){return!!t&&!!e&&!e.find(e=>e.value===t)}(O,n))},[]);const E=g?m:C,M=g||j,T=r.map((e,t)=>({value:t,label:void 0})),R=f.map(e=>({value:e,label:e})),I=E?Number(n):pd(O,n),P=E?Number(o):pd(O,o),L=O[I]?.label?O[I]?.label:(0,Mo.__)("Unset","kadence-blocks"),A=O[I]?.name?O[I]?.name+" "+O[I]?.size+"px":(0,Mo.__)("Unset","kadence-blocks"),D=k?k+" ":"";let F=e;x?F=A:e&&D&&(F=D+e+" "+L);const V=(0,_o.jsxs)(_o.Fragment,{children:[(0,_o.jsx)(yo.RangeControl,{label:F||void 0,className:"components-spacing-sizes-control__range-control",beforeIcon:c,value:"ss-auto"==n?"":I,onChange:e=>{var n;t(void 0===e?d:void 0===(n=e)?"":0===parseInt(n,10)?"0":`${r[n]?.value}`)},min:0,max:r.length-1,marks:T,step:1,help:u,withInputField:!1,"aria-valuenow":I,"aria-valuetext":r[I]?.label,renderTooltipContent:e=>O[e]?.label,initialPosition:d||0,allowReset:!!x,hideLabelFromVision:!v&&!x,onMouseOver:y,onMouseOut:_,onMouseDown:e=>{e?.nativeEvent?.offsetX<35&&void 0===n&&t("0")}}),!b&&(0,_o.jsx)(yo.Button,{className:"kadence-radio-item radio-custom only-icon",label:(0,Mo.__)("Set custom size","kadence-blocks"),icon:zc,onClick:()=>M(!0),isPressed:!1,isTertiary:!0})]});return[t&&(0,_o.jsxs)("div",{className:"components-base-control component-spacing-sizes-control kadence-single-measure-range-control"+(a?" "+a:""),children:[!g&&e&&(0,_o.jsx)(yo.Flex,{justify:"space-between",className:"kadence-radio-range__header",children:(0,_o.jsx)(yo.FlexItem,{children:(0,_o.jsx)("label",{className:"components-base-control__label",children:e})})}),!E&&(0,_o.jsxs)("div",{className:"kadence-controls-content",children:[v&&(0,_o.jsxs)(_o.Fragment,{children:[(0,_o.jsxs)(yo.Button,{className:"kadence-popover-spacing-btn",disabled:!(!n||"auto"!=n),tabIndex:"-1",onClick:n&&"auto"==n?"":function(){N(!S)},onMouseOver:y,onMouseOut:_,children:[k&&e&&(0,_o.jsx)("span",{className:"kadence-placement-label",children:e}),(0,_o.jsxs)("span",{className:"kadence-spacing-btn-val",children:[O[I]?.label,!O[I]?.label&&(0,_o.jsx)("span",{className:"kadence-spacing-btn-placeholder",children:O?.[P]?.label?O?.[P]?.label:o})]})]}),S&&(0,_o.jsx)(yo.Popover,{onClose:function(){N(!1)},className:"kadence-range-popover-settings",children:(0,_o.jsxs)("div",{className:"kadence-range-popover-settings-inner",children:[V,w&&(0,_o.jsx)(yo.Button,{className:"custom-auto-button",variant:"secondary",isSmall:!0,text:(0,Mo.__)("Auto","kadence-blocks"),onClick:()=>t("ss-auto"),isPressed:!(!n||"ss-auto"!=n)}),(0,_o.jsx)(yo.Button,{className:"custom-reset-button",variant:"secondary",isSmall:!0,text:(0,Mo.__)("Reset","kadence-blocks"),onClick:()=>t("")})]})})]}),!v&&(0,_o.jsx)(_o.Fragment,{children:V})]}),E&&(0,_o.jsxs)("div",{className:"kadence-controls-content kadence-single-unit-control",children:[(0,_o.jsx)(yo.__experimentalUnitControl,{label:k&&e?e:void 0,labelPosition:"top",min:l,max:i,disabled:!(!n||"auto"!=n),step:s,units:R,value:n,placeholder:o||void 0,disableUnits:!0,onChange:e=>(e=>{const n=isNaN(parseFloat(e))?void 0:parseFloat(e);t(n)})(e),onMouseOver:y,onMouseOut:_}),!k&&(0,_o.jsx)("div",{className:"kadence-measure-control-select-wrapper",children:(0,_o.jsx)("select",{className:"kadence-measure-control-select components-unit-control__select",onChange:e=>{h(e.target.value)},value:p,children:f.map(e=>(0,_o.jsx)("option",{value:e,selected:p===e||void 0,children:e},e))})}),!b&&(0,_o.jsx)(yo.ButtonGroup,{className:"kadence-radio-container-control",children:(0,_o.jsx)(yo.Button,{className:"kadence-radio-item radio-custom only-icon",label:(0,Mo.__)("Use size preset","kadence-blocks"),icon:zc,isPrimary:!0,onClick:()=>M(!1),isPressed:!0})})]})]})]}tu.pxIcon,tu.emIcon,tu.remIcon,tu.vhIcon,tu.vwIcon,tu.percentIcon;const fd=(0,_o.jsx)(Ho.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,_o.jsx)(Ho.Path,{d:"M10 17.389H8.444A5.194 5.194 0 1 1 8.444 7H10v1.5H8.444a3.694 3.694 0 0 0 0 7.389H10v1.5ZM14 7h1.556a5.194 5.194 0 0 1 0 10.39H14v-1.5h1.556a3.694 3.694 0 0 0 0-7.39H14V7Zm-4.5 6h5v-1.5h-5V13Z"})}),bd=(0,_o.jsx)(Ho.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,_o.jsx)(Ho.Path,{d:"M17.031 4.703 15.576 4l-1.56 3H14v.03l-2.324 4.47H9.5V13h1.396l-1.502 2.889h-.95a3.694 3.694 0 0 1 0-7.389H10V7H8.444a5.194 5.194 0 1 0 0 10.389h.17L7.5 19.53l1.416.719L15.049 8.5h.507a3.694 3.694 0 0 1 0 7.39H14v1.5h1.556a5.194 5.194 0 0 0 .273-10.383l1.202-2.304Z"})});function md(e,t){return!(!t||!e||!(void 0===t[0]||""!==t[0]||void 0===t[1]||""!==t[1]&&"auto"!==t[1]||void 0===t[2]||""!==t[2]||void 0===t[3]||""!==t[3]&&"auto"!==t[3])||(void 0!==t[0]&&""!==t[0]?e.find(e=>e.value===t[0]):void 0!==t[1]&&""!==t[1]&&"auto"!==t[1]?e.find(e=>e.value===t[1]):void 0!==t[2]&&""!==t[2]?e.find(e=>e.value===t[2]):void 0!==t[3]&&""!==t[3]&&"auto"!==t[3]?e.find(e=>e.value===t[3]):e.find(e=>e.value===t)))}function gd(e,t,n){if(!t)return"";if(!e)return"";if("0"===t)return 0;if("px"!==n)return"";const o=e.find(e=>e.value===t);return o?o.size:""}function vd(e,t,n){if(!t)return"";if(!e)return"";if(0===t)return"0";if("px"!==n)return"";const o=e.find(e=>e.size.toString()===t.toString());return o?o.value:""}function xd({label:e,onChange:t,onControl:n,value:o="",className:a="",options:r=dd,step:s=1,max:i=200,min:l=0,beforeIcon:c="",help:u="",placeholder:d=["","","",""],defaultValue:p=["","","",""],control:h="individual",unit:f="",onUnit:b,units:m=["px","em","rem"],disableCustomSizes:g=!1,isBorderRadius:v=!1,firstIcon:x=tu.outlineTopIcon,secondIcon:k=tu.outlineRightIcon,thirdIcon:y=tu.outlineBottomIcon,fourthIcon:_=tu.outlineLeftIcon,linkIcon:w=fd,unlinkIcon:C=bd,customControl:j=!1,setCustomControl:S=null,parentLabel:N=null,reset:O,onMouseOver:E,onMouseOut:M,allowAuto:T=!1}){const R={first:v?tu.topLeftIcon:x,second:v?tu.topRightIcon:k,third:v?tu.bottomRightIcon:y,fourth:v?tu.bottomLeftIcon:_,link:v?tu.radiusLinkedIcon:w,unlink:v?tu.radiusIndividualIcon:C},[I,P]=(0,ko.useState)(!1),[L,A]=(0,ko.useState)(h),D=JSON.parse(JSON.stringify(r));D.push({value:"ss-auto",output:"var(--global-kb-spacing-auto, auto)",label:(0,Mo.__)("Auto","kadence-blocks"),size:0,name:(0,Mo.__)("Auto","kadence-blocks")}),(0,ko.useEffect)(()=>{P(md(D,o))},[]);const F=S?j:I,V=S||P,B=n?h:L,z=n||A;return[t&&(0,_o.jsxs)("div",{className:"components-base-control component-spacing-sizes-control kadence-measure-range-control "+(a?" "+a:""),children:[e&&(0,_o.jsxs)(yo.Flex,{justify:"space-between",className:"kadence-component__header kadence-radio-range__header",children:[e&&(0,_o.jsxs)("div",{className:"kadence-component__header__title kadence-radio-range__title",children:[(0,_o.jsx)("label",{className:"components-base-control__label",children:e}),O&&(0,_o.jsx)("div",{className:"title-reset-wrap",children:(0,_o.jsx)(yo.Button,{className:"is-reset is-single",label:"reset",isSmall:!0,disabled:!!(0,Oo.isEqual)(p,o),icon:undo,onClick:()=>{"function"==typeof O?O():t(p)}})})]}),!g&&(0,_o.jsx)(yo.Button,{className:"kadence-radio-item radio-custom only-icon",label:F?(0,Mo.__)("Use size preset","kadence-blocks"):(0,Mo.__)("Set custom size","kadence-blocks"),icon:zc,isSmall:!0,onClick:()=>{if(F){const e=[vd(r,o?o[0]:"",f),vd(r,o?o[1]:"",f),vd(r,o?o[2]:"",f),vd(r,o?o[3]:"",f)];t(e)}else{const e=[gd(r,o?o[0]:"",f),gd(r,o?o[1]:"",f),gd(r,o?o[2]:"",f),gd(r,o?o[3]:"",f)];t(e)}V(!F)},isPressed:!!F,isTertiary:!F}),z&&(0,_o.jsx)(yo.Button,{isSmall:!0,className:"kadence-radio-item radio-custom is-single only-icon",label:"individual"!==B?(0,Mo.__)("Individual","kadence-blocks"):(0,Mo.__)("Linked","kadence-blocks"),icon:"individual"!==B?R.link:R.unlink,onClick:()=>z("individual"!==B?"individual":"linked"),isPressed:"individual"!==B,isTertiary:"individual"===B})]}),(0,_o.jsxs)("div",{className:"kadence-controls-content",children:["individual"!==B&&(0,_o.jsx)(_o.Fragment,{children:(0,_o.jsx)(hd,{value:o?o[0]:"",onChange:e=>t([e,e,e,e]),className:"kb-measure-input-all-inputs",min:l,max:i,options:r,step:s,help:u,unit:f,units:m,onUnit:b,defaultValue:p[0],placeholder:d?.[0]?d?.[0]:"",allowReset:!1,disableCustomSizes:!0,setCustomControl:V,customControl:F,isPopover:!1,isSingle:!0,onMouseOver:E,onMouseOut:M,allowAuto:T})}),"individual"===B&&(0,_o.jsxs)(_o.Fragment,{children:[(0,_o.jsx)(hd,{parentLabel:N||e,label:(0,Mo.__)("Top","kadence-blocks"),className:"kb-measure-box-top",value:o?o[0]:"",onChange:e=>{t([e,o&&void 0!==o[1]?o[1]:"",o&&void 0!==o[2]?o[2]:"",o&&void 0!==o[3]?o[3]:""])},min:l,max:i,options:r,step:s,help:u,unit:f,units:m,onUnit:b,defaultValue:p[0],placeholder:d?.[0]?d?.[0]:"",allowReset:!1,disableCustomSizes:!0,setCustomControl:V,customControl:F,isPopover:!0,onMouseOver:E,onMouseOut:M,allowAuto:T}),(0,_o.jsx)(hd,{parentLabel:N||e,label:(0,Mo.__)("Right","kadence-blocks"),className:"kb-measure-box-right",value:o?o[1]:"",onChange:e=>t([o&&void 0!==o[0]?o[0]:"",e,o&&void 0!==o[2]?o[2]:"",o&&void 0!==o[3]?o[3]:""]),min:l,max:i,options:r,step:s,help:u,unit:f,units:m,onUnit:b,defaultValue:p[1],placeholder:d?.[1]?d?.[1]:"",allowReset:!1,disableCustomSizes:!0,setCustomControl:V,customControl:F,isPopover:!0,onMouseOver:E,onMouseOut:M,allowAuto:T}),(0,_o.jsx)(hd,{parentLabel:N||e,label:(0,Mo.__)("Bottom","kadence-blocks"),className:"kb-measure-box-bottom",value:o?o[2]:"",onChange:e=>t([o&&void 0!==o[0]?o[0]:"",o&&void 0!==o[1]?o[1]:"",e,o&&void 0!==o[3]?o[3]:""]),min:l,max:i,options:r,step:s,help:u,unit:f,units:m,onUnit:b,defaultValue:p[2],placeholder:d?.[2]?d?.[2]:"",allowReset:!1,disableCustomSizes:!0,setCustomControl:V,customControl:F,isPopover:!0,onMouseOver:E,onMouseOut:M,allowAuto:T}),(0,_o.jsx)(hd,{parentLabel:N||e,label:(0,Mo.__)("Left","kadence-blocks"),className:"kb-measure-box-left",value:o?o[3]:"",onChange:e=>t([o&&void 0!==o[0]?o[0]:"",o&&void 0!==o[1]?o[1]:"",o&&void 0!==o[2]?o[2]:"",e]),min:l,max:i,options:r,step:s,help:u,unit:f,units:m,onUnit:b,defaultValue:p[3],placeholder:d?.[3]?d?.[3]:"",allowReset:!1,disableCustomSizes:!0,setCustomControl:V,customControl:F,isPopover:!0,onMouseOver:E,onMouseOut:M,allowAuto:T}),F&&(0,_o.jsx)("div",{className:"kadence-units kadence-measure-control-select-wrapper",children:(0,_o.jsx)("select",{className:"kadence-measure-control-select components-unit-control__select",onChange:e=>{b(e.target.value)},value:f,disabled:1===m.length,children:m.map(e=>(0,_o.jsx)("option",{value:e,selected:f===e||void 0,children:e},e))})})]})]})]})]}const kd=(0,_o.jsx)(Ho.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,_o.jsx)(Ho.Path,{d:"M18.3 11.7c-.6-.6-1.4-.9-2.3-.9H6.7l2.9-3.3-1.1-1-4.5 5L8.5 16l1-1-2.7-2.7H16c.5 0 .9.2 1.3.5 1 1 1 3.4 1 4.5v.3h1.5v-.2c0-1.5 0-4.3-1.5-5.7z"})});function yd({label:e,subLabel:t,onChange:n,onChangeTablet:o,onChangeMobile:a,mobileValue:r,tabletValue:s,value:i,onControl:l,control:c="individual",options:u=dd,step:d=1,max:p=100,min:h=0,unit:f="",onUnit:b,showUnit:m=!1,units:g=["px","em","rem"],isBorderRadius:v=!1,disableCustomSizes:x=!1,firstIcon:k=tu.outlineTopIcon,secondIcon:y=tu.outlineRightIcon,thirdIcon:_=tu.outlineBottomIcon,fourthIcon:w=tu.outlineLeftIcon,linkIcon:C=fd,unlinkIcon:j=bd,deskDefault:S=["","","",""],tabletDefault:N=["","","",""],mobileDefault:O=["","","",""],ghostDefault:E=["","","",""],reset:M=!0,setCustomControl:T=null,onMouseOver:R,onMouseOut:I,allowAuto:P=!1}){const L=(0,ko.useRef)(),A={first:v?topLeftIcon:k,second:v?topRightIcon:y,third:v?bottomRightIcon:_,fourth:v?bottomLeftIcon:w,link:v?radiusLinkedIcon:C,unlink:v?radiusIndividualIcon:j},[D,F]=(0,ko.useState)(!1),[V,B]=(0,ko.useState)(c),z=T?customControl:D,H=T||F,U=JSON.parse(JSON.stringify(u));U.push({value:"ss-auto",output:"var(--global-kb-spacing-auto, auto)",label:(0,Mo.__)("Auto","kadence-blocks"),size:0,name:(0,Mo.__)("Auto","kadence-blocks")});const G=e=>{let t=[];return t=z?[vd(u,e?e[0]:"",f),vd(u,e?e[1]:"",f),vd(u,e?e[2]:"",f),vd(u,e?e[3]:"",f)]:[gd(u,e?e[0]:"",f),gd(u,e?e[1]:"",f),gd(u,e?e[2]:"",f),gd(u,e?e[3]:"",f)],t},$=l?c:V,W=l||B,[q,X]=(0,ko.useState)("Desktop"),J=(0,To.useSelect)(e=>e("kadenceblocks/data").getPreviewDeviceType(),[]);J!==q&&X(J),(0,ko.useEffect)(()=>{let e=i;"Tablet"==J?e=s:"Mobile"==J&&(e=r),F(md(U,e))},[J]);const{setPreviewDeviceType:K}=(0,To.useDispatch)("kadenceblocks/data"),Y=[{name:"Desktop",title:(0,_o.jsx)(yo.Dashicon,{icon:"desktop"}),itemClass:"kb-desk-tab"},{name:"Tablet",title:(0,_o.jsx)(yo.Dashicon,{icon:"tablet"}),itemClass:"kb-tablet-tab"},{name:"Mobile",key:"mobile",title:(0,_o.jsx)(yo.Dashicon,{icon:"smartphone"}),itemClass:"kb-mobile-tab"}];let Z=i||["","","",""];"Tablet"===q?Z=s||["","","",""]:"Mobile"===q&&(Z=r||["","","",""]);let Q=s?JSON.parse(JSON.stringify(s)):["","","",""];Q?.[0]||(Q[0]=i?.[0]?i[0]:""),Q?.[1]||(Q[1]=i?.[1]?i[1]:""),Q?.[2]||(Q[2]=i?.[2]?i[2]:""),Q?.[3]||(Q[3]=i?.[3]?i[3]:"");const ee={};ee.Mobile=(0,_o.jsx)(xd,{className:"measure-mobile-size",parentLabel:e,label:t?(0,Mo.__)("Mobile:","kadence-blocks")+t:void 0,value:r||["","","",""],placeholder:Q,onChange:e=>a((0,No.clearNonMatchingValues)(r,e)),control:$,onControl:e=>W(e),setCustomControl:H,customControl:z,options:u,defaultValue:O,min:h,max:p,step:d,unit:f,onUnit:b||void 0,showUnit:!0,units:[f],isBorderRadius:v,firstIcon:k,secondIcon:y,thirdIcon:_,fourthIcon:w,linkIcon:C,unlinkIcon:j,onMouseOver:R,onMouseOut:I,allowAuto:P},2),ee.Tablet=(0,_o.jsx)(xd,{className:"measure-tablet-size",parentLabel:e,label:t?(0,Mo.__)("Tablet:","kadence-blocks")+t:void 0,value:s||["","","",""],placeholder:i||["","","",""],onChange:e=>o((0,No.clearNonMatchingValues)(s,e)),control:$,onControl:e=>W(e),setCustomControl:H,customControl:z,options:u,defaultValue:N,min:h,max:p,step:d,unit:f,onUnit:b||void 0,showUnit:!0,units:[f],isBorderRadius:v,firstIcon:k,secondIcon:y,thirdIcon:_,fourthIcon:w,linkIcon:C,unlinkIcon:j,onMouseOver:R,onMouseOut:I,allowAuto:P},1),ee.Desktop=(0,_o.jsx)(xd,{className:"measure-desktop-size",parentLabel:e,label:t||void 0,value:i||["","","",""],placeholder:E||["","","",""],onChange:e=>n((0,No.clearNonMatchingValues)(i,e)),control:$,onControl:e=>W(e),setCustomControl:H,customControl:z,options:u,defaultValue:S,min:h,max:p,step:d,unit:f,onUnit:b||void 0,showUnit:m,units:g,isBorderRadius:v,firstIcon:k,secondIcon:y,thirdIcon:_,fourthIcon:w,linkIcon:C,unlinkIcon:j,onMouseOver:R,onMouseOut:I,allowAuto:P},0);let te=S;return"Mobile"===q?te=O:"Mobile"===q&&(te=N),[n&&o&&a&&(0,_o.jsxs)("div",{ref:L,className:"components-base-control kb-responsive-measure-control kadence-measure-range-control",children:[(0,_o.jsxs)(yo.Flex,{justify:"space-between",className:"kadence-title-bar kadence-component__header kadence-measure-range__header kadence-radio-range__header",children:[e&&(0,_o.jsxs)("div",{className:"kadence-component__header__title kadence-radio-range__title",children:[(0,_o.jsx)("label",{className:"components-base-control__label",children:e}),!0===M&&("linked"!==$||"linked"===$&&!0===z)&&(0,_o.jsx)("div",{className:"title-reset-wrap",children:(0,_o.jsx)(yo.Button,{className:"is-reset is-single",label:"reset",isSmall:!0,disabled:!!(0,Oo.isEqual)(te,Z),icon:kd,onClick:()=>{"Tablet"===q?o(N):"Mobile"===q?a(O):n(S)}})})]}),(0,_o.jsx)(yo.ButtonGroup,{className:"kb-responsive-options kb-measure-responsive-options","aria-label":(0,Mo.__)("Device","kadence-blocks"),children:(0,Oo.map)(Y,({name:e,key:t,title:n,itemClass:o})=>(0,_o.jsx)(yo.Button,{className:`kb-responsive-btn ${o}${e===q?" is-active":""}`,isSmall:!0,"aria-pressed":q===e,onClick:()=>{return t=e,K((0,No.capitalizeFirstLetter)(t)),void X((0,No.capitalizeFirstLetter)(t));var t},children:n},t))}),!x&&!t&&(0,_o.jsx)(yo.Button,{className:"kadence-radio-item radio-custom only-icon",label:z?(0,Mo.__)("Use size preset","kadence-blocks"):(0,Mo.__)("Set custom size","kadence-blocks"),icon:zc,isSmall:!0,onClick:()=>{(()=>{if("Mobile"==q){const e=G(r);(0,No.objectSameFill)(r,e)&&a(e)}else if("Tablet"==q){const e=G(s);(0,No.objectSameFill)(s,e)&&o(e)}else{const e=G(i);(0,No.objectSameFill)(i,e)&&n(e)}})(),H(!z)},isPressed:!!z,isTertiary:!z}),W&&!t&&(0,_o.jsx)(yo.Button,{isSmall:!0,className:"kadence-radio-item radio-custom is-single only-icon",label:"individual"!==$?(0,Mo.__)("Individual","kadence-blocks"):(0,Mo.__)("Linked","kadence-blocks"),icon:"individual"!==$?A.link:A.unlink,onClick:()=>W("individual"!==$?"individual":"linked"),isPressed:"individual"!==$,isTertiary:"individual"===$})]}),(0,_o.jsx)("div",{className:"kb-responsive-measure-control-inner",children:ee[q]?ee[q]:ee.Desktop})]})]}const _d=window.wp.isShallowEqual;function wd({style:e,type:t="inside",spacing:n,forceShow:o=!1,forceHide:a=!1,offset:r=!0}){const s=n[0],i=n[1],l=n[2],c=n[3],u=(0,ko.useMemo)(()=>{if("outside"===t){const e=s||0,t=i||0,n=l||0,o=c||0;return{borderTopWidth:e,borderRightWidth:t,borderBottomWidth:n,borderLeftWidth:o,top:r&&e?`calc(${e} * -1)`:0,right:r&&t?`calc(${t} * -1)`:0,bottom:r&&n?`calc(${n} * -1)`:0,left:r&&o?`calc(${o} * -1)`:0}}if("outsideVertical"===t){const e=s||0,t=l||0;return{borderTopWidth:e,borderRightWidth:i||0,borderBottomWidth:t,borderLeftWidth:c||0,top:r&&e?`calc(${e} * -1)`:0,bottom:r&&t?`calc(${t} * -1)`:0}}return{borderTopWidth:s||0,borderRightWidth:i||0,borderBottomWidth:l||0,borderLeftWidth:c||0,marginLeft:e?.marginLeft?e.marginLeft:0,marginRight:e?.marginRight?e.marginRight:0}},[n]),[d,p]=(0,ko.useState)(!1),h=(0,ko.useRef)(n),f=(0,ko.useRef)(),b=()=>{f.current&&window.clearTimeout(f.current)};return(0,ko.useMemo)(()=>(a&&(h.current=n),(0,_d.isShallowEqualArrays)(n,h.current)||o||a||(p(!0),h.current=n,b(),f.current=setTimeout(()=>{p(!1)},400)),()=>b()),[n,o,a]),!d&&!o||a?null:(0,_o.jsx)("div",{className:`kb__spacing-visualizer-wrap kb__spacing_visualizer-type-${t}`,style:e,children:(0,_o.jsx)("div",{className:"kb__spacing-visualizer",style:u})})}function Cd({label:e,className:t,hideLabel:n=!1,wrap:o=!1,allowClear:a=!1,help:r="",onChange:s,onChangeTablet:i,onChangeMobile:l,value:c,mobileValue:u,tabletValue:d,options:p=[],tabletOptions:h=p,mobileOptions:f=h,...b}){return(0,_o.jsx)(Lo,{label:e,desktopChildren:(0,_o.jsx)(wc,{className:t,value:c,options:p,onChange:s,hideLabel:n,help:r,wrap:o,allowClear:a}),tabletChildren:(0,_o.jsx)(wc,{className:t,value:d,options:h,onChange:i,hideLabel:n,help:r,wrap:o,allowClear:!0}),mobileChildren:(0,_o.jsx)(wc,{className:t,value:u,options:f,onChange:l,hideLabel:n,help:r,wrap:o,allowClear:!0})})}function jd({value:e,isPressed:t=!1}){const n={top:"M19.5 19.5H.5V.5h19v19zM1.607 18.392h16.786V1.608H1.607v16.784zM17.178 2.888H2.822v3.275h14.356V2.888z",middle:"M19.5 19.482H.5V.5h19v18.982zM1.607 18.375h16.786V1.607H1.607v16.768zm15.571-10.02H2.822v3.272h14.356V8.355z",bottom:"M19.518 19.5H.5V.5h19.018v19zm-17.91-1.108H18.41V1.608H1.608v16.784zm15.586-4.739H2.824v3.275h14.37v-3.275z"};return n.hasOwnProperty(e)?(0,_o.jsx)(yo.SVG,{width:"20",height:"20",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",isPressed:t,children:(0,_o.jsx)(yo.Path,{d:n[e]})}):null}const Sd=["image"];class Nd extends ko.Component{constructor(){super(...arguments)}render(){const{label:e,hasImage:t,onSaveImage:n,onRemoveImage:o,disableMediaButtons:a,imageURL:r,imageID:s,kadenceDynamic:i,dynamicAttribute:l=""}=this.props;return(0,_o.jsxs)("div",{className:"kadence-image-media-control kadence-image-background-control",children:[!t&&(0,_o.jsxs)(ko.Fragment,{children:[e&&(0,_o.jsx)("div",{className:"components-kadence-image-background__label",children:e}),(0,_o.jsx)(qc,{labels:"",selectIcon:Kc,selectLabel:(0,Mo.__)("Select Image","kadence-blocks"),onSelect:e=>n(e),accept:"image/*",className:"kadence-image-upload",allowedTypes:Sd,disableMediaButtons:a,dynamicControl:l&&kadence_blocks_params.dynamic_enabled?(0,_o.jsx)(Oc,{...this.props}):void 0})]}),t&&(0,_o.jsxs)(ko.Fragment,{children:[e&&(0,_o.jsx)("div",{className:"components-kadence-image-background__label",children:e}),l&&kadence_blocks_params.dynamic_enabled&&i&&i[l]&&i[l].enable?(0,_o.jsx)("div",{className:"kb-dynamic-background-sidebar-top",children:(0,_o.jsx)(Oc,{startOpen:!i[l].field,...this.props})}):(0,_o.jsxs)(ko.Fragment,{children:[(0,_o.jsx)(Eo.MediaUpload,{onSelect:e=>n(e),type:"image",value:s||"",render:({open:e})=>(0,_o.jsx)(yo.Button,{className:"components-button components-icon-button kt-cta-upload-btn kb-sidebar-image",style:{backgroundImage:'url("'+r+'")',backgroundSize:"cover"},onClick:e,icon:Yc,children:(0,Mo.__)("Edit Image","kadence-blocks")})}),(0,_o.jsx)(yo.Button,{icon:Zc,label:(0,Mo.__)("Remove Image","kadence-blocks"),className:"components-button components-icon-button kt-remove-img kt-cta-upload-btn",onClick:()=>o()}),l&&kadence_blocks_params.dynamic_enabled&&(0,_o.jsx)(Oc,{...this.props})]})]})]})}}const Od=Nd,Ed=["video"];class Md extends ko.Component{constructor(){super(...arguments)}render(){const{label:e,hasVideo:t,onSaveVideo:n,onRemoveVideo:o,disableMediaButtons:a,videoURL:r,videoID:s}=this.props;return(0,_o.jsxs)("div",{className:"components-base-control kadence-image-media-control kadence-image-background-control kadence-video-background-control",children:[!t&&(0,_o.jsxs)(ko.Fragment,{children:[e&&(0,_o.jsx)("div",{className:"components-kadence-video-background__label",children:e}),(0,_o.jsx)(qc,{labels:"",selectIcon:Kc,selectLabel:(0,Mo.__)("Select Video","kadence-blocks"),onSelect:e=>n(e),accept:"video/*",className:"kadence-image-upload",allowedTypes:Ed,disableMediaButtons:a})]}),t&&(0,_o.jsxs)(ko.Fragment,{children:[e&&(0,_o.jsx)("div",{className:"components-kadence-video-background__label",children:e}),(0,_o.jsxs)("div",{className:"components-kadence-video-btns",children:[(0,_o.jsx)(Eo.MediaUpload,{onSelect:e=>n(e),type:"video",value:s||"",render:({open:e})=>(0,_o.jsx)(yo.Button,{className:"components-button components-icon-button kb-cta-upload-btn kb-video-edit",onClick:e,icon:tu.video,children:(0,Mo.__)("Edit Video","kadence-blocks")})}),(0,_o.jsx)(yo.Button,{icon:Zc,label:(0,Mo.__)("Remove Image","kadence-blocks"),className:"components-button components-icon-button kb-remove-video kb-cta-upload-btn",onClick:()=>o()})]})]})]})}}const Td=Md;function Rd({label:e,className:t,children:n}){return(0,_o.jsxs)("div",{className:"components-base-control kadence-subsection-wrap"+(t?" "+t:""),children:[e&&(0,_o.jsx)("h2",{className:"subsection-wrap-title",children:e}),(0,_o.jsx)("div",{className:"kt-inner-subsection",children:n})]})}const Id=(0,_c.compose)([(0,To.withSelect)((e,t)=>{const n=void 0===t.initialOpen||t.initialOpen,o=(0,Oo.get)(t,["index"],"");return{isOpened:e("kadenceblocks/data").isEditorPanelOpened(t.panelName+o+e("core/block-editor").getSelectedBlockClientId(),n)}}),(0,To.withDispatch)((e,t,{select:n})=>{const{getSelectedBlockClientId:o}=n("core/block-editor"),a=void 0===t.initialOpen||t.initialOpen,r=(0,Oo.get)(t,["index"],"");return{toggleOpened:()=>{e("kadenceblocks/data").toggleEditorPanelOpened(t.panelName+r+o(),a)}}})])(function({children:e,title:t,initialOpen:n=!0,isOpened:o,toggleOpened:a,className:r="",icon:s="",buttonProps:i={},blockSlug:l=!1,index:c=!1,proTag:u=!1,panelName:d}){return!1===l||(0,No.showSettings)(d,l)?(u&&(i.icon=tu.proIcon,i.iconPosition="right"),(0,_o.jsx)(yo.PanelBody,{title:t,initialOpen:n,onToggle:a,opened:o,className:r,icon:s,buttonProps:i,children:e})):null});function Pd({children:e,title:t}){return(0,_o.jsxs)("div",{className:"kb-sub-panel",children:[t&&(0,_o.jsx)("h2",{className:"kb-sub-panel-title",children:t}),(0,_o.jsx)("div",{className:"kb-inner-sub-panel",children:e})]})}const Ld=function({children:e,blockSlug:t=!1,settingSlug:n="allSettings"}){return!1===t||(0,No.showSettings)(n,t)?(0,_o.jsx)(Eo.InspectorControls,{children:e}):null};class Ad extends ko.Component{constructor(){super(...arguments),this.state={options:[],isLoading:!1,page:1,hasMore:!1}}componentDidMount(){this.fetchPostAbortController=new AbortController,this.fetchTerms()}componentWillUnmount(){this.fetchPostAbortController&&this.fetchPostAbortController.abort()}fetchTerms(){const{restBase:e}=this.props,{page:t,options:n,search:o}=this.state,a={page:t,per_page:10};o&&o.length>=3&&(a.search=o),this.setState({isLoading:!0}),(0,No.fetchJson)({path:(0,hc.addQueryArgs)(`${e}/`,a),signal:this.fetchPostAbortController.signal}).then(([e,o])=>{const a=(0,Oo.uniqBy)([...n,...e.map(e=>({value:e.id,label:e.name}))],"value");this.setState({options:a,hasMore:parseInt(o["x-wp-totalpages"],10)>t,isLoading:!1})})}fetchMoreTerms(){const{page:e,hasMore:t,isLoading:n}=this.state;t&&!n&&this.setState({page:e+1},()=>this.fetchTerms())}updateSearch(e){e.length>=3&&this.setState({search:e,page:1},()=>this.fetchTerms())}handleChange(e){const{onChange:t}=this.props;this.setState({search:null,page:1}),t(e)}render(){return(0,_o.jsxs)("div",{className:"term-select-form-row",children:[(0,_o.jsx)("label",{htmlFor:this.props.fieldId,className:"screen-reader-text",children:this.props.placeholder}),(0,_o.jsx)(pc,{value:this.props.value,onChange:e=>this.handleChange(e),id:this.props.fieldId,options:this.state.options,isMulti:!0,classNamePrefix:"kt-tax-select",isLoading:this.state.isLoading,onMenuScrollToBottom:()=>this.fetchMoreTerms(),onInputChange:e=>this.updateSearch(e),maxMenuHeight:300,placeholder:this.props.placeholder})]})}}Ad.propTypes={fieldId:S().string.isRequired,label:S().string.isRequired,restBase:S().string.isRequired,onChange:S().func.isRequired};const Dd=Ad,Fd=window.wp.apiFetch;var Vd=a.n(Fd);function Bd({value:e,onChange:t,source:n,isMulti:o=!1}){const[a,r]=(0,ko.useState)(!0),[s,i]=(0,ko.useState)([]),[l,c]=(0,ko.useState)(1),[u,d]=(0,ko.useState)(!1),p=e;return(0,ko.useEffect)(()=>{if(n&&void 0!==window.kadence_blocks_params.taxonomies[n]&&window.kadence_blocks_params.taxonomies[n])i(Array.from(window.kadence_blocks_params.taxonomies[n])),r(!1);else{const e={source:n,page:l,per_page:50};r(!0),Vd()({path:(0,hc.addQueryArgs)(window.kadence_blocks_params.termEndpoint,e)}).then(e=>{e?(i(e),window.kadence_blocks_params.taxonomies[n]=e):(i([]),window.kadence_blocks_params.taxonomies[n]=[]),r(!1)}).catch(()=>{r(!1),i([]),window.kadence_blocks_params.taxonomies[n]=[]})}},[n]),a?(0,_o.jsx)(yo.Spinner,{}):(0,_o.jsx)("div",{className:"kb-inner-term-select-wrap",children:(0,_o.jsx)(pc,{options:s,className:"kb-dynamic-select",classNamePrefix:"kbp",value:o?e:""!==e?s.filter(({value:e})=>e===p):"",isMulti:o,isSearchable:!0,isClearable:!0,menuPortalTarget:document.body,styles:{menuPortal:e=>({...e,zIndex:99999999})},maxMenuHeight:200,placeholder:(0,Mo.__)("Select Term","kadence-blocks"),onChange:e=>{t(e?o?e:e.value:"")}})})}function zd({desktopChildren:e,tabletChildren:t,mobileChildren:n}){const[o,a]=(0,ko.useState)("Desktop"),r=(0,To.useSelect)(e=>e("kadenceblocks/data").getPreviewDeviceType(),[]);r!==o&&a(r);const{setPreviewDeviceType:s}=(0,To.useDispatch)("kadenceblocks/data"),i=[{name:"Desktop",key:"desktop",label:(0,Mo.__)("Desktop","kadence-blocks"),title:(0,_o.jsx)(yo.Dashicon,{icon:"desktop"}),itemClass:"kb-desk-tab"},{name:"Tablet",key:"tablet",label:(0,Mo.__)("Tablet","kadence-blocks"),title:(0,_o.jsx)(yo.Dashicon,{icon:"tablet"}),itemClass:"kb-tablet-tab"},{name:"Mobile",key:"mobile",label:(0,Mo.__)("Mobile","kadence-blocks"),title:(0,_o.jsx)(yo.Dashicon,{icon:"smartphone"}),itemClass:"kb-mobile-tab"}],l={};return l.Mobile=n,l.Tablet=t,l.Desktop=e,(0,_o.jsxs)("div",{className:"components-base-control kt-inspect-tabs kb-responsive-control",children:[(0,_o.jsx)("div",{className:"kadence-title-bar",children:(0,_o.jsx)(yo.ButtonGroup,{className:"components-tab-panel__tabs","aria-label":(0,Mo.__)("Device","kadence-blocks"),children:(0,Oo.map)(i,({name:e,key:t,title:n,itemClass:r,label:i})=>(0,_o.jsx)(yo.Button,{className:`components-tab-panel__tabs-item ${r}${e===o?" active-tab":""}`,"aria-pressed":o===e,"aria-label":i,onClick:()=>{return t=e,s((0,No.capitalizeFirstLetter)(t)),void a((0,No.capitalizeFirstLetter)(t));var t},children:n},t))})}),(0,_o.jsx)("div",{className:"kb-responsive-control-inner",children:l[o]?l[o]:l.Desktop})]})}function Hd({label:e,onChange:t,onChangeTablet:n,onChangeMobile:o,value:a,mobileValue:r,tabletValue:s,options:i,tabletOptions:l=i,mobileOptions:c=l,help:u}){return(0,_o.jsx)(Lo,{label:e,desktopChildren:(0,_o.jsx)(yo.SelectControl,{value:a,options:i,onChange:e=>t(e),help:u}),tabletChildren:(0,_o.jsx)(yo.SelectControl,{value:s,options:l,onChange:e=>n(e),help:u}),mobileChildren:(0,_o.jsx)(yo.SelectControl,{value:r,options:c,onChange:e=>o(e),help:u})})}const Ud=(0,_o.jsx)(Ho.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,_o.jsx)(Ho.Path,{d:"m13.1 16-3.4-4 3.4-4 1.1 1-2.6 3 2.6 3-1.1 1z"})}),Gd=(0,_o.jsx)(Ho.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,_o.jsx)(Ho.Path,{d:"M10.8622 8.04053L14.2805 12.0286L10.8622 16.0167L9.72327 15.0405L12.3049 12.0286L9.72327 9.01672L10.8622 8.04053Z"})});function $d({label:e,value:t,onChange:n,min:o,max:a,step:r=1}){return[n&&(0,_o.jsxs)("div",{className:"components-base-control",children:[(0,_o.jsx)("p",{className:"components-base-control__label",children:e}),(0,_o.jsxs)("div",{className:"components-base-control__field kb-flex-center kb-step-control",children:[(0,_o.jsx)(yo.Button,{className:"kb-step-btn",icon:Ud,isSecondary:!0,onClick:()=>{t>o&&n(t-r)}}),(0,_o.jsx)("input",{className:"components-step-control__number",type:"number",onChange:e=>n(Number(e.target.value)),"aria-label":e,value:t,min:o,max:a,step:r}),(0,_o.jsx)(yo.Button,{className:"kb-step-btn",isSecondary:!0,icon:Gd,onClick:()=>{t<a&&n(t+r)}})]})]})]}class Wd extends ko.Component{constructor(e,t,n){super(...arguments),this.state={isVisible:!1}}render(){const e=()=>{this.setState({isVisible:!1})};let t={};return t.opacity=(0,_o.jsxs)("svg",{width:"20px",height:"20px",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",fillRule:"evenodd",clipRule:"evenodd",strokeLinejoin:"round",strokeMiterlimit:"1.414",children:[(0,_o.jsxs)("g",{fillRule:"nonzero",children:[(0,_o.jsx)("path",{d:"M14.043,7.612c2.23,2.178 2.23,5.726 0,7.904c-1.081,1.055 -2.515,1.638 -4.042,1.638c-1.527,0 -2.964,-0.583 -4.042,-1.638c-1.08,-1.056 -1.674,-2.46 -1.674,-3.952c0,-1.492 0.594,-2.896 1.676,-3.956l4.04,-4.026l4.038,4.026c0.002,0.002 0.004,0.002 0.004,0.004Z",fill:"url(#_Linear1)"}),(0,_o.jsx)("path",{d:"M15.595,6.066c3.082,3.013 3.082,7.917 -0.002,10.931c-1.493,1.461 -3.479,2.265 -5.591,2.265c-2.112,0 -4.097,-0.804 -5.593,-2.265c-1.493,-1.46 -2.315,-3.402 -2.315,-5.467c0,-2.065 0.822,-4.007 2.315,-5.466l5.176,-5.162c0.221,-0.219 0.614,-0.219 0.833,0l5.177,5.164Zm-0.826,10.124c2.629,-2.568 2.629,-6.751 0,-9.32c0,-0.002 -0.003,-0.002 -0.005,-0.004l-4.762,-4.749l-4.764,4.749c-1.276,1.249 -1.976,2.905 -1.976,4.664c0,1.76 0.7,3.416 1.974,4.66c1.272,1.245 2.966,1.932 4.766,1.932c1.801,0 3.493,-0.687 4.767,-1.932Z"})]}),(0,_o.jsx)("defs",{children:(0,_o.jsxs)("linearGradient",{id:"_Linear1",x2:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"matrix(11.4305 0 0 13.5721 4.285 10.368)",children:[(0,_o.jsx)("stop",{offset:"0"}),(0,_o.jsx)("stop",{offset:"0.5",stopOpacity:"0.749"}),(0,_o.jsx)("stop",{offset:"1",stopOpacity:"0"})]})})]}),(0,_o.jsxs)("div",{className:"kt-popover-container",children:[this.state.isVisible&&(0,_o.jsx)(yo.Popover,{position:"top left",className:"kt-popover-opacity",onClose:e,children:(0,_o.jsx)(yo.RangeControl,{label:this.props.label,value:this.props.value,onChange:this.props.onChanged,min:0,max:1,step:.01})}),(0,_o.jsxs)(yo.Tooltip,{text:this.props.label,children:[!this.state.isVisible&&(0,_o.jsx)(yo.Button,{className:"kt-opacity-icon",isSecondary:!0,onClick:()=>{this.setState({isVisible:!0})},children:t.opacity}),this.state.isVisible&&(0,_o.jsx)(yo.Button,{className:"kt-opacity-icon",isSecondary:!0,onClick:e,children:t.opacity})]})]})}}const qd=Wd;function Xd({label:e,onChange:t,value:n="",className:o="",step:a=1,max:r=200,min:s=0,unit:i="px",onUnit:l,units:c=["px","em","rem"],styles:u=["solid","dashed","dotted","double"],defaultLinked:d=!0}){const p=(0,_c.useInstanceId)(Xd),h=n?.[1]||"solid",f=e=>{const o=n;o[0]=e,t(o)},b=n?.[0]||"",m=void 0!==n?.[2]&&""!==n?.[2]?n[2]:"",g={solid:(0,_o.jsx)("svg",{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",fillRule:"evenodd",strokeLinejoin:"round",strokeMiterlimit:"2",clipRule:"evenodd",viewBox:"0 0 20 20",children:(0,_o.jsx)("path",{d:"M18.988 11.478V8.522H1.012v2.956h17.976z"})}),dashed:(0,_o.jsx)("svg",{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",fillRule:"evenodd",strokeLinejoin:"round",strokeMiterlimit:"2",clipRule:"evenodd",viewBox:"0 0 20 20",children:(0,_o.jsx)("path",{d:"M12.512 11.478V8.522H7.488v2.956h5.024zM14.004 8.522v2.956h4.984V8.522h-4.984zM1.012 8.522v2.956H6.05V8.522H1.012z"})}),dotted:(0,_o.jsxs)("svg",{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",fillRule:"evenodd",strokeLinejoin:"round",strokeMiterlimit:"2",clipRule:"evenodd",viewBox:"0 0 20 20",children:[(0,_o.jsx)("circle",{cx:"2.503",cy:"10",r:"1.487"}),(0,_o.jsx)("circle",{cx:"17.486",cy:"10",r:"1.487"}),(0,_o.jsx)("circle",{cx:"12.447",cy:"10",r:"1.487"}),(0,_o.jsx)("circle",{cx:"7.455",cy:"10",r:"1.487"})]}),double:(0,_o.jsx)("svg",{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",fillRule:"evenodd",strokeLinejoin:"round",strokeMiterlimit:"2",clipRule:"evenodd",viewBox:"0 0 20 20",children:(0,_o.jsx)("path",{d:"M1.02 6.561v2.957h17.968V6.561H1.02zM1.012 10.586v2.956H18.98v-2.956H1.012z"})})},v={solid:(0,Mo.__)("Solid","kadence-blocks"),dashed:(0,Mo.__)("Dashed","kadence-blocks"),dotted:(0,Mo.__)("Dotted","kadence-blocks"),double:(0,Mo.__)("Double","kadence-blocks")},x=c.map(e=>({value:e,label:e}));return[t&&(0,_o.jsxs)("div",{className:`components-base-control kadence-single-border-control kadence-single-border-control${p}${o?" "+o:""}`,children:[e&&(0,_o.jsx)(yo.Flex,{justify:"space-between",className:"kadence-border-control__header",children:(0,_o.jsx)(yo.FlexItem,{children:(0,_o.jsx)("label",{className:"components-base-control__label",children:e})})}),(0,_o.jsxs)("div",{className:"kadence-single-border-control-wrap",children:[(0,_o.jsx)(Po,{value:b,default:"",hideClear:!0,onChange:e=>f(e)},`border-color-${b}-${p}`),(0,_o.jsx)(yo.DropdownMenu,{className:"border-control-style-select",icon:g[h],label:(0,Mo.__)("Border Style","kadence-blocks"),popoverProps:{className:"border-control-style-select__popover",placement:"bottom"},children:({onClose:e})=>(0,_o.jsx)(_o.Fragment,{children:(0,_o.jsx)(yo.MenuGroup,{children:u.map(o=>(0,_o.jsx)(yo.MenuItem,{icon:g[o],onClick:()=>{e(),(e=>{const o=n;o[1]=e,t(o)})(o)},label:v[o]}))})})}),(0,_o.jsxs)("div",{className:"kadence-controls-content kadence-single-unit-control",children:[(0,_o.jsx)(yo.__experimentalUnitControl,{min:s,max:r,step:a,units:x,value:m,disableUnits:!0,onChange:e=>(e=>{const o=isNaN(parseFloat(e))?"":parseFloat(e),a=n;a[2]=o,t(a)})(e)}),(0,_o.jsx)("div",{className:"kadence-measure-control-select-wrapper",children:(0,_o.jsx)("select",{className:"kadence-measure-control-select components-unit-control__select",onChange:e=>{l(e.target.value)},disabled:1===c.length,children:c.map(e=>(0,_o.jsx)("option",{value:e,selected:i===e||void 0,children:e},e))})})]})]})]})]}function Jd({label:e,onChange:t,onChangeTablet:n,onChangeMobile:o,onControl:a,value:r="",tabletValue:s="",mobileValue:i="",control:l="individual",units:c=["px","em","rem"],firstIcon:u=tu.outlineTopIcon,secondIcon:d=tu.outlineRightIcon,thirdIcon:p=tu.outlineBottomIcon,fourthIcon:h=tu.outlineLeftIcon,linkIcon:f=fd,unlinkIcon:b=bd,styles:m=["solid","dashed","dotted","double"],deskDefault:g={top:["","",""],right:["","",""],bottom:["","",""],left:["","",""],unit:"px"},tabletDefault:v={top:["","",""],right:["","",""],bottom:["","",""],left:["","",""],unit:""},mobileDefault:x={top:["","",""],right:["","",""],bottom:["","",""],left:["","",""],unit:""},reset:k=!0,defaultLinked:y=!0}){const _=(0,_c.useInstanceId)(Jd),w=r?.[0]||g,C=s?.[0]||v,j=i?.[0]||x,[S,N]=(0,ko.useState)(l),[O,E]=(0,ko.useState)("Desktop"),M=(0,To.useSelect)(e=>e("kadenceblocks/data").getPreviewDeviceType(),[]);M!==O&&E(M),(0,ko.useEffect)(()=>{j&&(0,Oo.isEqual)(w.unit,j?.unit)&&(j.unit="",V("","unit")),C&&(0,Oo.isEqual)(w.unit,C?.unit)&&(C.unit="",F("","unit"))},[]);const{setPreviewDeviceType:T}=(0,To.useDispatch)("kadenceblocks/data"),R=[{name:"Desktop",title:(0,_o.jsx)(yo.Dashicon,{icon:"desktop"}),itemClass:"kb-desk-tab"},{name:"Tablet",title:(0,_o.jsx)(yo.Dashicon,{icon:"tablet"}),itemClass:"kb-tablet-tab"},{name:"Mobile",key:"mobile",title:(0,_o.jsx)(yo.Dashicon,{icon:"smartphone"}),itemClass:"kb-mobile-tab"}];let I=w;"Tablet"===O?I=C:"Mobile"===O&&(I=j);const P={},L=j?.unit?j.unit:w?.unit?w.unit:"px",A=C?.unit?C.unit:w?.unit?w.unit:"px",D=(e,n)=>{var o=JSON.parse(JSON.stringify(r));o[0][n]=e,t(o)},F=(e,t)=>{var o=JSON.parse(JSON.stringify(s));o[0][t]=e,n(o)},V=(e,t)=>{var n=JSON.parse(JSON.stringify(i));n[0][t]=e,o(n)};P.Mobile=(0,_o.jsx)(Xd,{value:j?.bottom?JSON.parse(JSON.stringify(j?.bottom)):void 0,unit:j?.unit?JSON.parse(JSON.stringify(j?.unit)):"px",onChange:e=>V(e,"bottom"),onUnit:e=>V(e,"unit"),defaultValue:x?.bottom,styles:m,units:[L],firstIcon:u,secondIcon:d,thirdIcon:p,fourthIcon:h},"mobile"+_),P.Tablet=(0,_o.jsx)(Xd,{value:C?.bottom?JSON.parse(JSON.stringify(C?.bottom)):void 0,unit:C?.unit?JSON.parse(JSON.stringify(C?.unit)):"px",onChange:e=>F(e,"bottom"),onUnit:e=>F(e,"unit"),defaultValue:v?.bottom,styles:m,units:[A],firstIcon:u,secondIcon:d,thirdIcon:p,fourthIcon:h},"tablet"+_),P.Desktop=(0,_o.jsx)(Xd,{value:w?.bottom?JSON.parse(JSON.stringify(w?.bottom)):void 0,unit:w?.unit?JSON.parse(JSON.stringify(w?.unit)):"px",onChange:e=>D(e,"bottom"),onUnit:e=>D(e,"unit"),defaultValue:g?.bottom,styles:m,units:c,firstIcon:u,secondIcon:d,thirdIcon:p,fourthIcon:h},"desktop"+_);let B=g;return"Mobile"===O?B=x:"Mobile"===O&&(B=v),[t&&n&&o&&(0,_o.jsxs)("div",{className:`components-base-control kb-responsive-border-control kadence-border-box-control kadence-border-box-control${_}`,children:[(0,_o.jsxs)("div",{className:"kadence-border-control__header kadence-component__header",children:[e&&(0,_o.jsxs)("div",{className:"kadence-component__header__title kadence-radio-range__title",children:[(0,_o.jsx)("label",{className:"components-base-control__label",children:e}),k&&(0,_o.jsx)("div",{className:"title-reset-wrap",children:(0,_o.jsx)(yo.Button,{className:"is-reset is-single",label:"reset",isSmall:!0,disabled:!!(0,Oo.isEqual)(B,I),icon:kd,onClick:()=>{"Tablet"===O?n([v]):"Mobile"===O?o([x]):t([g])}})})]}),(0,_o.jsx)(yo.ButtonGroup,{className:"kb-responsive-options kb-measure-responsive-options","aria-label":(0,Mo.__)("Device","kadence-blocks"),children:(0,Oo.map)(R,({name:e,key:t,title:n,itemClass:o})=>(0,_o.jsx)(yo.Button,{className:`kb-responsive-btn ${o}${e===O?" is-active":""}`,isSmall:!0,"aria-pressed":O===e,onClick:()=>{return t=e,T((0,No.capitalizeFirstLetter)(t)),void E((0,No.capitalizeFirstLetter)(t));var t},children:n},t))})]}),(0,_o.jsx)("div",{className:"kb-responsive-border-control-inner",children:P[O]?P[O]:P.Desktop})]})]}function Kd({label:e,onChange:t,onControl:n,value:o="",className:a="",help:r="",defaultValue:s={top:{color:"",style:"solid",width:""},right:{color:"",style:"solid",width:""},bottom:{color:"",style:"solid",width:""},left:{color:"",style:"solid",width:""},unit:""},control:i="individual",units:l=["px","em","rem"],firstIcon:c=tu.outlineTopIcon,secondIcon:u=tu.outlineRightIcon,thirdIcon:d=tu.outlineBottomIcon,fourthIcon:p=tu.outlineLeftIcon,linkIcon:h=fd,unlinkIcon:f=bd,styles:b=["solid","dashed","dotted","double"],reset:m}){const g=(0,_c.useInstanceId)(Kd),[v,x]=(0,ko.useState)(i),k=n?i:v,y=n||x,_={first:c,second:u,third:d,fourth:p,link:h,unlink:f},w=(0,ko.useRef)(),C=o?.[0]||s,j="px"!==C.unit?.1:1,S="px"!==C.unit&&""!==C.unit?12:200,N=(e,n)=>{C[n]=e;const o=JSON.parse(JSON.stringify(C));t([o])},O=e=>{C.unit=e;const n=JSON.parse(JSON.stringify(C));t([n])};return[t&&(0,_o.jsxs)("div",{ref:w,className:`components-base-control kadence-border-control kadence-border-control${g}${a?" "+a:""}`,children:[e&&(0,_o.jsxs)("div",{className:"kadence-border-control__header",children:[e&&(0,_o.jsxs)("div",{className:"kadence-border-control__title",children:[(0,_o.jsx)("label",{className:"components-base-control__label",children:e}),m&&(0,_o.jsx)("div",{className:"title-reset-wrap",children:(0,_o.jsx)(yo.Button,{className:"is-reset is-single",label:"reset",isSmall:!0,disabled:!!(0,Oo.isEqual)(s,o),icon:undo,onClick:()=>{"function"==typeof m?m():t([s])}})})]}),y&&(0,_o.jsx)(yo.Button,{className:"kadence-radio-item border-control-toggle is-single only-icon",label:"individual"!==k?(0,Mo.__)("Individual","kadence-blocks"):(0,Mo.__)("Linked","kadence-blocks"),icon:"individual"!==k?_.link:_.unlink,onClick:()=>y("individual"!==k?"individual":"linked"),isPressed:"individual"!==k,isTertiary:"individual"===k})]}),(0,_o.jsxs)("div",{className:"kadence-controls-content",children:["individual"!==k&&(0,_o.jsx)(_o.Fragment,{children:(0,_o.jsx)(Xd,{value:C?.top||["","",""],onChange:e=>(e=>{C.top=e,C.bottom=e,C.right=e,C.left=e;const n=JSON.parse(JSON.stringify(C));t([n])})(e),min:0,max:S,step:j,help:r,styles:b,unit:C?.unit||"px",units:l,onUnit:e=>O(e),defaultValue:s.top,allowReset:!1})}),"individual"===k&&(0,_o.jsxs)("div",{className:"kadence-border-controls-grid-wrap",children:[(0,_o.jsx)("div",{className:"kadence-border-control-grid-visualizer",style:{borderTopColor:C?.top?.[0]?(0,No.KadenceColorOutput)(C?.top?.[0]):void 0,borderTopStyle:C?.top?.[1]||void 0,borderTopWidth:C?.top?.[2]?"clamp( 1px, "+C?.top?.[2]+C?.unit+", 10px )":void 0,borderRightColor:C?.right?.[0]?(0,No.KadenceColorOutput)(C?.right?.[0]):void 0,borderRightStyle:C?.right?.[1]||void 0,borderRightWidth:C?.right?.[2]?"clamp( 1px, "+C?.right?.[2]+C?.unit+", 10px )":void 0,borderBottomColor:C?.bottom?.[0]?(0,No.KadenceColorOutput)(C?.bottom?.[0]):void 0,borderBottomStyle:C?.bottom?.[1]||void 0,borderBottomWidth:C?.bottom?.[2]?"clamp( 1px, "+C?.bottom?.[2]+C?.unit+", 10px )":void 0,borderLeftColor:C?.left?.[0]?(0,No.KadenceColorOutput)(C?.left?.[0]):void 0,borderLeftStyle:C?.left?.[1]||void 0,borderLeftWidth:C?.left?.[2]?"clamp( 1px, "+C?.left?.[2]+C?.unit+", 10px )":void 0}}),(0,_o.jsx)(Xd,{value:C?.top||["","",""],onChange:e=>N(e,"top"),min:0,max:S,step:j,help:r,styles:b,unit:C?.unit||"px",units:l,onUnit:e=>O(e),defaultValue:s.top,allowReset:!1}),(0,_o.jsx)(Xd,{value:C?.left||["","",""],onChange:e=>N(e,"left"),min:0,max:S,step:j,help:r,styles:b,unit:C?.unit||"px",units:l,onUnit:e=>O(e),defaultValue:s.left,allowReset:!1}),(0,_o.jsx)(Xd,{value:C?.right||["","",""],onChange:e=>N(e,"right"),min:0,max:S,step:j,help:r,styles:b,unit:C?.unit||"px",units:l,onUnit:e=>O(e),defaultValue:s.right,allowReset:!1}),(0,_o.jsx)(Xd,{value:C?.bottom||["","",""],onChange:e=>N(e,"bottom"),min:0,max:S,step:j,help:r,styles:b,unit:C?.unit||"px",units:l,onUnit:e=>O(e),defaultValue:s.bottom,allowReset:!1})]})]})]})]}function Yd({label:e,onChange:t,onChangeTablet:n,onChangeMobile:o,onControl:a,mobileValue:r="",tabletValue:s="",value:i="",control:l="individual",units:c=["px","em","rem"],firstIcon:u=tu.outlineTopIcon,secondIcon:d=tu.outlineRightIcon,thirdIcon:p=tu.outlineBottomIcon,fourthIcon:h=tu.outlineLeftIcon,linkIcon:f=fd,unlinkIcon:b=bd,styles:m=["solid","dashed","dotted","double"],deskDefault:g={top:["","",""],right:["","",""],bottom:["","",""],left:["","",""],unit:"px"},tabletDefault:v={top:["","",""],right:["","",""],bottom:["","",""],left:["","",""],unit:""},mobileDefault:x={top:["","",""],right:["","",""],bottom:["","",""],left:["","",""],unit:""},reset:k=!0,defaultLinked:y=!0}){const _=(0,_c.useInstanceId)(Yd),w={first:u,second:d,third:p,fourth:h,link:f,unlink:b},[C,j]=(0,ko.useState)(l),S=a?l:C,N=a||j,[O,E]=(0,ko.useState)("Desktop"),M=(0,To.useSelect)(e=>e("kadenceblocks/data").getPreviewDeviceType(),[]);M!==O&&E(M),(0,ko.useEffect)(()=>{y&&("Mobile"===M?(0,Oo.isEqual)(r?.[0]?.top,r?.[0]?.bottom)&&(0,Oo.isEqual)(r?.[0]?.top,r?.[0]?.bottom)&&(0,Oo.isEqual)(r?.[0]?.top,r?.[0]?.right)&&(0,Oo.isEqual)(r?.[0]?.top,r?.[0]?.left)&&N("linked"):"Tablet"===M?(0,Oo.isEqual)(s?.[0]?.top,s?.[0]?.bottom)&&(0,Oo.isEqual)(s?.[0]?.top,s?.[0]?.bottom)&&(0,Oo.isEqual)(s?.[0]?.top,s?.[0]?.right)&&(0,Oo.isEqual)(s?.[0]?.top,s?.[0]?.left)&&N("linked"):(0,Oo.isEqual)(i?.[0]?.top,i?.[0]?.bottom)&&(0,Oo.isEqual)(i?.[0]?.top,i?.[0]?.bottom)&&(0,Oo.isEqual)(i?.[0]?.top,i?.[0]?.right)&&(0,Oo.isEqual)(i?.[0]?.top,i?.[0]?.left)&&N("linked")),r&&(0,Oo.isEqual)(i?.[0]?.unit,r?.[0]?.unit)&&(r[0].unit="",o(r)),s&&(0,Oo.isEqual)(i?.[0]?.unit,s?.[0]?.unit)&&(s[0].unit="",n(s))},[]);const{setPreviewDeviceType:T}=(0,To.useDispatch)("kadenceblocks/data"),R=[{name:"Desktop",title:(0,_o.jsx)(yo.Dashicon,{icon:"desktop"}),itemClass:"kb-desk-tab"},{name:"Tablet",title:(0,_o.jsx)(yo.Dashicon,{icon:"tablet"}),itemClass:"kb-tablet-tab"},{name:"Mobile",key:"mobile",title:(0,_o.jsx)(yo.Dashicon,{icon:"smartphone"}),itemClass:"kb-mobile-tab"}];let I=i?.[0]?i[0]:g;"Tablet"===O?I=s?.[0]?s[0]:v:"Mobile"===O&&(I=r?.[0]?r[0]:x);const P={},L=r?.[0]?.unit?r[0].unit:i?.[0]?.unit?i[0].unit:"px",A=s?.[0]?.unit?s[0].unit:i?.[0]?.unit?i[0].unit:"px";P.Mobile=(0,_o.jsx)(Kd,{value:r?JSON.parse(JSON.stringify(r)):void 0,onChange:e=>o(e),control:S,onControl:e=>N(e),defaultValue:x,styles:m,units:[L],firstIcon:u,secondIcon:d,thirdIcon:p,fourthIcon:h,linkIcon:f,unlinkIcon:b},"mobile"+_),P.Tablet=(0,_o.jsx)(Kd,{value:s?JSON.parse(JSON.stringify(s)):void 0,onChange:e=>n(e),control:S,onControl:e=>N(e),defaultValue:v,styles:m,units:[A],firstIcon:u,secondIcon:d,thirdIcon:p,fourthIcon:h,linkIcon:f,unlinkIcon:b},"tablet"+_),P.Desktop=(0,_o.jsx)(Kd,{value:i?JSON.parse(JSON.stringify(i)):void 0,onChange:e=>t(e),control:S,onControl:e=>N(e),defaultValue:g,styles:m,units:c,firstIcon:u,secondIcon:d,thirdIcon:p,fourthIcon:h,linkIcon:f,unlinkIcon:b},"desktop"+_);let D=g;return"Mobile"===O?D=x:"Mobile"===O&&(D=v),[t&&n&&o&&(0,_o.jsxs)("div",{className:`components-base-control kb-responsive-border-control kadence-border-box-control kadence-border-box-control${_}`,children:[(0,_o.jsxs)("div",{className:"kadence-border-control__header kadence-component__header",children:[e&&(0,_o.jsxs)("div",{className:"kadence-component__header__title kadence-radio-range__title",children:[(0,_o.jsx)("label",{className:"components-base-control__label",children:e}),k&&(0,_o.jsx)("div",{className:"title-reset-wrap",children:(0,_o.jsx)(yo.Button,{className:"is-reset is-single",label:"reset",isSmall:!0,disabled:!!(0,Oo.isEqual)(D,I),icon:kd,onClick:()=>{"Tablet"===O?n([v]):"Mobile"===O?o([x]):t([g])}})})]}),(0,_o.jsx)(yo.ButtonGroup,{className:"kb-responsive-options kb-measure-responsive-options","aria-label":(0,Mo.__)("Device","kadence-blocks"),children:(0,Oo.map)(R,({name:e,key:t,title:n,itemClass:o})=>(0,_o.jsx)(yo.Button,{className:`kb-responsive-btn ${o}${e===O?" is-active":""}`,isSmall:!0,"aria-pressed":O===e,onClick:()=>{return t=e,T((0,No.capitalizeFirstLetter)(t)),void E((0,No.capitalizeFirstLetter)(t));var t},children:n},t))}),N&&(0,_o.jsx)(yo.Button,{isSmall:!0,className:"kadence-radio-item border-control-toggle is-single only-icon",label:"individual"!==S?(0,Mo.__)("Individual","kadence-blocks"):(0,Mo.__)("Linked","kadence-blocks"),icon:"individual"!==S?w.link:w.unlink,onClick:()=>N("individual"!==S?"individual":"linked"),isPressed:"individual"!==S,isTertiary:"individual"===S})]}),(0,_o.jsx)("div",{className:"kb-responsive-border-control-inner",children:P[O]?P[O]:P.Desktop})]})]}function Zd(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 Qd({label:e,onChange:t,value:n="",className:o="",options:a=No.FONT_SIZES_MAP,step:r=1,max:s=200,min:i=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,preventUnitSelection:v=!1}){const[x,k]=(0,ko.useState)(!1);(0,ko.useEffect)(()=>{k(function(e,t){return!!t&&!!e&&!e.find(e=>e.value===t)}(a,n))},[]);const y=f?h:x,_=f||k,w=d.map(e=>({value:e,label:e})),C=y?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),j=[{value:"",output:"",size:"",label:(0,Mo.__)("Inherit","kadence-blocks"),name:(0,Mo.__)("Inherit","kadence-blocks")},...a];return[t&&(0,_o.jsxs)("div",{className:"components-base-control component-font-size-control kadence-font-size-control"+(o?" "+o:""),children:[!f&&e&&(0,_o.jsx)("div",{className:"kadence-font-size-control__header kadence-component__header",children:(0,_o.jsxs)("div",{className:"kadence-component__header__title kadence-radio-range__title",children:[(0,_o.jsx)("label",{className:"components-base-control__label",children:e}),m&&(0,_o.jsx)("div",{className:"title-reset-wrap",children:(0,_o.jsx)(yo.Button,{className:"is-reset is-single",label:"reset",isSmall:!0,disabled:!!(0,Oo.isEqual)(l,n),icon:kd,onClick:()=>{"function"==typeof m?m():t(l)}})})]})}),!y&&g&&(0,_o.jsx)("div",{className:"kadence-controls-content",children:(0,_o.jsxs)(yo.ButtonGroup,{className:"kadence-radio-container-control",children:[a.map((e,n)=>(0,_o.jsx)(yo.Button,{isTertiary:C!==e.value,className:"kadence-radio-item radio-"+e.value,isPrimary:C===e.value,icon:void 0!==e.icon?e.icon:void 0,"aria-pressed":C===e.value,onClick:()=>{C==e.value&&""==l?t(""):t(e.value)},children:e.label},`${e.label}-${e.value}-${n}`)),!p&&(0,_o.jsx)(yo.Button,{className:"kadence-radio-item radio-custom only-icon",label:(0,Mo.__)("Set custom size","kadence-blocks"),icon:zc,onClick:()=>{C&&"px"===c&&t(Zd(a,C)),_(!0)},isPressed:!1,isTertiary:!0})]})}),!y&&!g&&(0,_o.jsxs)("div",{className:"kadence-controls-content kadence-font-size-select-control-wrap",children:[(0,_o.jsx)(yo.SelectControl,{className:"kadence-font-size-select-control",value:C,options:j,onChange:e=>{t(C==e&&""==l?"":e)}}),!p&&(0,_o.jsx)(yo.ButtonGroup,{className:"kadence-radio-container-control",children:(0,_o.jsx)(yo.Button,{className:"kadence-radio-item radio-custom only-icon",label:(0,Mo.__)("Set custom size","kadence-blocks"),icon:zc,onClick:()=>{C&&"px"===c&&t(Zd(a,C)),_(!0)},isPressed:!1,isTertiary:!0})})]}),y&&(0,_o.jsxs)("div",{className:"kadence-controls-content kadence-single-unit-control",children:[(0,_o.jsx)(yo.__experimentalUnitControl,{label:b&&e?e:void 0,labelPosition:"top",min:i,max:s,step:r,units:w,value:n,disableUnits:!0,onChange:e=>(e=>{const n=isNaN(parseFloat(e))?void 0:parseFloat(e);t(n)})(e)}),(0,_o.jsx)("div",{className:"kadence-measure-control-select-wrapper",children:(0,_o.jsxs)("select",{className:"kadence-measure-control-select components-unit-control__select",onChange:e=>{u(e.target.value)},value:c,disabled:!!v,children:[!v&&d.map(e=>(0,_o.jsx)("option",{value:e,selected:c===e||void 0,children:e},e)),v&&(0,_o.jsx)("option",{value:c,selected:!0,children:""===c?"-":c},c)]})}),!p&&(0,_o.jsx)(yo.ButtonGroup,{className:"kadence-radio-container-control",children:(0,_o.jsx)(yo.Button,{className:"kadence-radio-item radio-custom only-icon",label:(0,Mo.__)("Use size preset","kadence-blocks"),icon:zc,isPrimary:!0,onClick:()=>{n&&"px"===c&&t(function(e,t){if(!t)return"";if(!e)return"";if("0"===t)return"";const n=e.find(e=>e.size===t);return n?n.value:""}(a,n)),_(!1)},isPressed:!0})})]})]})]}function ep({label:e,onChange:t,onChangeTablet:n,onChangeMobile:o,mobileValue:a,tabletValue:r,value:s,units:i=["px","em","rem"],onUnit:l,options:c=No.FONT_SIZES_MAP,step:u=1,max:d=200,min:p=0,unit:h="px",defaultValue:f=["","",""],reset:b=!0,radio:m=!0,compressedDevice:g=!1}){const v=(0,ko.useRef)(),[x,k]=(0,ko.useState)("Desktop"),y=(0,To.useSelect)(e=>e("kadenceblocks/data").getPreviewDeviceType(),[]);y!==x&&k(y);const{setPreviewDeviceType:_}=(0,To.useDispatch)("kadenceblocks/data"),w=e=>{_((0,No.capitalizeFirstLetter)(e)),k((0,No.capitalizeFirstLetter)(e))},C=[{name:"Desktop",title:(0,_o.jsx)(yo.Dashicon,{icon:"desktop"}),itemClass:"kb-desk-tab"},{name:"Tablet",title:(0,_o.jsx)(yo.Dashicon,{icon:"tablet"}),itemClass:"kb-tablet-tab"},{name:"Mobile",key:"mobile",title:(0,_o.jsx)(yo.Dashicon,{icon:"smartphone"}),itemClass:"kb-mobile-tab"}],j=[s,r,a],S={};S.Mobile=(0,_o.jsx)(Qd,{value:a||void 0,onChange:e=>o(e),options:c,onUnit:l,defaultValue:f[2],units:i,step:u,max:d,min:p,unit:h,radio:m,preventUnitSelection:!0}),S.Tablet=(0,_o.jsx)(Qd,{value:r||void 0,onChange:e=>n(e),options:c,onUnit:l,defaultValue:f[1],units:i,step:u,max:d,min:p,unit:h,radio:m,preventUnitSelection:!0}),S.Desktop=(0,_o.jsx)(Qd,{value:s||void 0,onChange:e=>t(e),options:c,onUnit:l,defaultValue:f[0],units:i,step:u,max:d,min:p,unit:h,radio:m});const N={Desktop:(0,_o.jsx)(yo.Dashicon,{icon:"desktop"}),Tablet:(0,_o.jsx)(yo.Dashicon,{icon:"tablet"}),Mobile:(0,_o.jsx)(yo.Dashicon,{icon:"smartphone"})};return[t&&n&&o&&(0,_o.jsxs)("div",{ref:v,className:"components-base-control kb-responsive-font-size-control kadence-font-size-control",children:[(0,_o.jsxs)("div",{className:"kadence-font-size-control__header kadence-component__header",children:[e&&(0,_o.jsxs)("div",{className:"kadence-component__header__title kadence-font-size__title",children:[(0,_o.jsx)("label",{className:"components-base-control__label",children:e}),b&&(0,_o.jsx)("div",{className:"title-reset-wrap",children:(0,_o.jsx)(yo.Button,{className:"is-reset is-single",label:"reset",isSmall:!0,disabled:!!(0,Oo.isEqual)(f,j),icon:kd,onClick:()=>{"function"==typeof b?b():"Mobile"===x?o(f[2]):"Tablet"===x?n(f[1]):t(f[0])}})})]}),!g&&(0,_o.jsx)(yo.ButtonGroup,{className:"kb-responsive-options kb-measure-responsive-options","aria-label":(0,Mo.__)("Device","kadence-blocks"),children:(0,Oo.map)(C,({name:e,key:t,title:n,itemClass:o})=>(0,_o.jsx)(yo.Button,{className:`kb-responsive-btn ${o}${e===x?" is-active":""}`,isSmall:!0,"aria-pressed":x===e,onClick:()=>w(e),children:n},t))}),g&&(0,_o.jsx)(yo.DropdownMenu,{className:"kb-responsive-options-dropdown",icon:N[x]?N[x]:N.Desktop,label:(0,Mo.__)("Target Device","kadence-blocks"),controls:C.map(e=>{return[{title:(t=e).name,icon:t.title,isActive:x===t.name,onClick:()=>{w(t.name)}}];var t})})]}),(0,_o.jsx)("div",{className:"kb-responsive-border-control-inner",children:S[x]?S[x]:S.Desktop})]})]}function tp({label:e,onChange:t,value:n="",className:o="",step:a=1,max:r=200,min:s=0,defaultValue:i="",unit:l="",onUnit:c,units:u=["px","em","rem"],parentLabel:d=null,reset:p=!0,preventUnitSelection:h=!1}){const f=u.map(e=>({value:e,label:e}));return[t&&(0,_o.jsxs)("div",{className:"components-base-control component-font-size-control kadence-font-size-control"+(o?" "+o:""),children:[e&&(0,_o.jsx)("div",{className:"kadence-font-size-control__header kadence-component__header",children:(0,_o.jsxs)("div",{className:"kadence-component__header__title kadence-radio-range__title",children:[(0,_o.jsx)("label",{className:"components-base-control__label",children:e}),p&&(0,_o.jsx)("div",{className:"title-reset-wrap",children:(0,_o.jsx)(yo.Button,{className:"is-reset is-single",label:"reset",isSmall:!0,disabled:!!(0,Oo.isEqual)(i,n),icon:kd,onClick:()=>{"function"==typeof p?p():t(i)}})})]})}),(0,_o.jsxs)("div",{className:"kadence-controls-content kadence-single-unit-control",children:[(0,_o.jsx)(yo.__experimentalUnitControl,{label:d&&e?e:void 0,labelPosition:"top",min:s,max:r,step:a,units:f,value:n,disableUnits:!0,onChange:e=>(e=>{const n=isNaN(parseFloat(e))?void 0:parseFloat(e);t(n)})(e)}),(0,_o.jsx)("div",{className:"kadence-measure-control-select-wrapper",children:(0,_o.jsx)("select",{className:"kadence-measure-control-select components-unit-control__select",onChange:e=>{"-"===e.target.value?c(""):c(e.target.value)},value:l,disabled:!!h,children:u.map(e=>h?l===e&&(0,_o.jsx)("option",{value:e,selected:l===e||""===l&&"-"===e||void 0,children:e},e):(0,_o.jsx)("option",{value:e,selected:l===e||""===l&&"-"===e||void 0,children:e},e))})})]})]})]}function np({label:e,onChange:t,onChangeTablet:n,onChangeMobile:o,mobileValue:a,tabletValue:r,value:s,units:i=["px","em","rem"],onUnit:l,step:c=1,max:u=200,min:d=0,unit:p="",defaultValue:h=["","",""],compressedDevice:f=!1,reset:b=!0}){const m=(0,ko.useRef)(),[g,v]=(0,ko.useState)("Desktop"),x=(0,To.useSelect)(e=>e("kadenceblocks/data").getPreviewDeviceType(),[]);x!==g&&v(x);const{setPreviewDeviceType:k}=(0,To.useDispatch)("kadenceblocks/data"),y=e=>{k((0,No.capitalizeFirstLetter)(e)),v((0,No.capitalizeFirstLetter)(e))},_=[{name:"Desktop",title:(0,_o.jsx)(yo.Dashicon,{icon:"desktop"}),itemClass:"kb-desk-tab"},{name:"Tablet",title:(0,_o.jsx)(yo.Dashicon,{icon:"tablet"}),itemClass:"kb-tablet-tab"},{name:"Mobile",key:"mobile",title:(0,_o.jsx)(yo.Dashicon,{icon:"smartphone"}),itemClass:"kb-mobile-tab"}],w={Desktop:(0,_o.jsx)(yo.Dashicon,{icon:"desktop"}),Tablet:(0,_o.jsx)(yo.Dashicon,{icon:"tablet"}),Mobile:(0,_o.jsx)(yo.Dashicon,{icon:"smartphone"})},C=[s,r,a],j={};return j.Mobile=(0,_o.jsx)(tp,{value:a||void 0,onChange:e=>o(e),onUnit:l,defaultValue:h[2],units:i,step:c,max:u,min:d,unit:p,preventUnitSelection:!0}),j.Tablet=(0,_o.jsx)(tp,{value:r||void 0,onChange:e=>n(e),onUnit:l,defaultValue:h[1],units:i,step:c,max:u,min:d,unit:p,preventUnitSelection:!0}),j.Desktop=(0,_o.jsx)(tp,{value:s||void 0,onChange:e=>t(e),onUnit:l,defaultValue:h[0],units:i,step:c,max:u,min:d,unit:p}),[t&&n&&o&&(0,_o.jsxs)("div",{ref:m,className:"components-base-control kb-responsive-unit-control kadence-unit-control",children:[(0,_o.jsxs)("div",{className:"kadence-unit-control__header kadence-component__header",children:[e&&(0,_o.jsxs)("div",{className:"kadence-component__header__title kadence-unit__title",children:[(0,_o.jsx)("label",{className:"components-base-control__label",children:e}),b&&(0,_o.jsx)("div",{className:"title-reset-wrap",children:(0,_o.jsx)(yo.Button,{className:"is-reset is-single",label:"reset",isSmall:!0,disabled:!!(0,Oo.isEqual)(h,C),icon:kd,onClick:()=>{"function"==typeof b?b():"Mobile"===g?o(h[2]):"Tablet"===g?n(h[1]):t(h[0])}})})]}),!f&&(0,_o.jsx)(yo.ButtonGroup,{className:"kb-responsive-options kb-measure-responsive-options","aria-label":(0,Mo.__)("Device","kadence-blocks"),children:(0,Oo.map)(_,({name:e,key:t,title:n,itemClass:o})=>(0,_o.jsx)(yo.Button,{className:`kb-responsive-btn ${o}${e===g?" is-active":""}`,isSmall:!0,"aria-pressed":g===e,onClick:()=>y(e),children:n},t))}),f&&(0,_o.jsx)(yo.DropdownMenu,{className:"kb-responsive-options-dropdown",icon:w[g]?w[g]:w.Desktop,label:(0,Mo.__)("Target Device","kadence-blocks"),controls:_.map(e=>{return[{title:(t=e).name,icon:t.title,isActive:g===t.name,onClick:()=>{y(t.name)}}];var t})})]}),(0,_o.jsx)("div",{className:"kb-responsive-border-control-inner",children:j[g]?j[g]:j.Desktop})]})]}const op=(0,_o.jsx)(Ho.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,_o.jsx)(Ho.Path,{d:"M19 8h-1V6h-5v2h-2V6H6v2H5c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-8c0-1.1-.9-2-2-2zm.5 10c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5v-8c0-.3.2-.5.5-.5h14c.3 0 .5.2.5.5v8z"})}),ap=(0,_o.jsx)(Ho.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,_o.jsx)(Ho.Path,{d:"M4 20h8v-1.5H4V20zM18.9 3.5c-.6-.6-1.5-.6-2.1 0l-7.2 7.2c-.4-.1-.7 0-1.1.1-.5.2-1.5.7-1.9 2.2-.4 1.7-.8 2.2-1.1 2.7-.1.1-.2.3-.3.4l-.6 1.1H6c2 0 3.4-.4 4.7-1.4.8-.6 1.2-1.4 1.3-2.3 0-.3 0-.5-.1-.7L19 5.7c.5-.6.5-1.6-.1-2.2zM9.7 14.7c-.7.5-1.5.8-2.4 1 .2-.5.5-1.2.8-2.3.2-.6.4-1 .8-1.1.5-.1 1 .1 1.3.3.2.2.3.5.2.8 0 .3-.1.9-.7 1.3z"})}),rp=(0,_c.compose)([(0,To.withSelect)((e,t)=>{const n=void 0!==t.initialOpen?t.initialOpen:"general";return{openedTab:e("kadenceblocks/data").getOpenSidebarTabKey(t.panelName+e("core/block-editor").getSelectedBlockClientId(),n)}}),(0,To.withDispatch)((e,t,{select:n})=>{const{getSelectedBlockClientId:o}=n("core/block-editor");return{toggleOpened:n=>{e("kadenceblocks/data").switchEditorTabOpened(t.panelName+o(),n)}}})])(function({allowedTabs:e=null,activeTab:t,setActiveTab:n,openedTab:o,toggleOpened:a,tabs:r=null}){const s=[{key:"general",title:(0,Mo.__)("General","kadence-blocks"),icon:op},{key:"style",title:(0,Mo.__)("Style","kadence-blocks"),icon:ap},{key:"advanced",title:(0,Mo.__)("Advanced","kadence-blocks"),icon:zc}],i=e||["general","style","advanced"],l=r||s,c=(0,ko.createRef)();let u;return(0,ko.useEffect)(()=>{u=c.current.closest(".components-panel")}),t!==o&&n(o),(0,ko.useEffect)(()=>{var e;return e=t,u&&(u.setAttribute("data-kadence-hide-advanced","advanced"!==e),u.setAttribute("data-kadence-active-tab",e)),()=>{if(u){const e=u.querySelector(".kadence-blocks-inspector-tabs");e&&null!==e||(u.removeAttribute("data-kadence-hide-advanced"),u.removeAttribute("data-kadence-active-tab"))}}},[t]),(0,_o.jsx)("div",{className:"kadence-blocks-inspector-tabs",ref:c,children:l.map(({key:e,title:o,icon:r},s)=>{if(i.includes(e))return(0,_o.jsxs)("button",{"aria-label":o+" "+(0,Mo.__)("tab","kadence-blocks"),onClick:()=>(e=>{a(e),n(e)})(e),className:Bc()({"is-active":e===t}),children:[(0,_o.jsx)(yo.Icon,{icon:r})," ",o]},e)})})});function sp({label:e=(0,Mo.__)("Hover Styles","kadence-blocks"),activeLabel:t=(0,Mo.__)("Active Styles","kadence-blocks"),initial:n="normal",hoverTab:o=(0,Mo.__)("Hover","kadence-blocks"),normalTab:a=(0,Mo.__)("Normal","kadence-blocks"),activeTab:r=(0,Mo.__)("Active","kadence-blocks"),active:s,hover:i,normal:l,className:c="",icon:u=tu.hoverToggle,activeIcon:d=tu.click,tabUI:p=!0,setActivePreview:h,activePreview:f}){const[b,m]=(0,ko.useState)("hover"===n),[g,v]=(0,ko.useState)("active"===n);var x=[{name:"normal",title:a,className:"kt-normal-tab"}];return i&&x.push({name:"hover",title:o,className:"kt-hover-tab"}),s&&x.push({name:"active",title:r,className:"kt-active-tab"}),p?[(0,_o.jsx)("div",{className:"components-base-control kb-hover-toggle-control-tab-ui kb-hover-toggle-control"+(c?" "+c:""),children:(0,_o.jsx)(yo.TabPanel,{className:"kt-inspect-tabs kt-hover-tabs",activeClass:"active-tab",tabs:x,children:e=>{if(e.name)return"hover"===e.name?(0,_o.jsx)(_o.Fragment,{children:i}):"active"===e.name?(0,_o.jsxs)(_o.Fragment,{children:[h&&(0,_o.jsx)(yo.Button,{className:"kb-hover-toggle-active-preview",isPressed:f,text:f?(0,Mo.__)("Hide Active State","kadence-blocks"):(0,Mo.__)("Preview Active State","kadence-blocks"),onClick:()=>{h(!f)},variant:"secondary"}),s]}):(0,_o.jsx)(_o.Fragment,{children:l})}})})]:[(0,_o.jsxs)("div",{className:"components-base-control kb-hover-toggle-control"+(c?" "+c:""),children:[(0,_o.jsxs)("div",{className:"kb-hover-toggle-control-toggle",children:[i&&(0,_o.jsx)(yo.Button,{className:"kb-hover-toggle-btn "+(No.isRTL?"is-rtl":""),isPrimary:b,icon:u,"aria-pressed":b,label:e,onClick:()=>{v(!1),m(!b)}}),s&&(0,_o.jsx)(yo.Button,{className:"kb-active-toggle-btn "+(No.isRTL?"is-rtl":""),isPrimary:g,icon:d,"aria-pressed":g,label:t,onClick:()=>{m(!1),v(!g)}})]}),(0,_o.jsxs)("div",{className:"kb-hover-toggle-area",children:[b&&(0,_o.jsx)("div",{className:"kb-hover-control-wrap",children:i}),g&&(0,_o.jsx)("div",{className:"kb-active-control-wrap",children:s}),!b&&!g&&(0,_o.jsx)(_o.Fragment,{children:l})]})]})]}function ip({label:e,onChange:t,value:n="",className:o="",isCollapsed:a=!1,ariaLabel:r=(0,Mo.__)("Change HTML Tag","kadence-blocks"),reset:s=!1,headingOnly:i=!1,tagLowLevel:l=1,tagHighLevel:c=7}){const u="span"!==n&&"div"!==n&&"p"!==n?n:2,d="span"===n||"div"===n||"p"===n?n:"heading",p=[[{icon:(0,_o.jsx)(yc,{level:1,isPressed:!(1!==u||!d||"heading"!==d)}),title:(0,Mo.__)("Heading 1","kadence-blocks"),isActive:!(1!==u||!d||"heading"!==d),onClick:()=>t(1)}],[{icon:(0,_o.jsx)(yc,{level:2,isPressed:!(2!==u||!d||"heading"!==d)}),title:(0,Mo.__)("Heading 2","kadence-blocks"),isActive:!(2!==u||!d||"heading"!==d),onClick:()=>t(2)}],[{icon:(0,_o.jsx)(yc,{level:3,isPressed:!(3!==u||!d||"heading"!==d)}),title:(0,Mo.__)("Heading 3","kadence-blocks"),isActive:!(3!==u||!d||"heading"!==d),onClick:()=>t(3)}],[{icon:(0,_o.jsx)(yc,{level:4,isPressed:!(4!==u||!d||"heading"!==d)}),title:(0,Mo.__)("Heading 4","kadence-blocks"),isActive:!(4!==u||!d||"heading"!==d),onClick:()=>t(4)}],[{icon:(0,_o.jsx)(yc,{level:5,isPressed:!(5!==u||!d||"heading"!==d)}),title:(0,Mo.__)("Heading 5","kadence-blocks"),isActive:!(5!==u||!d||"heading"!==d),onClick:()=>t(5)}],[{icon:(0,_o.jsx)(yc,{level:6,isPressed:!(6!==u||!d||"heading"!==d)}),title:(0,Mo.__)("Heading 6","kadence-blocks"),isActive:!(6!==u||!d||"heading"!==d),onClick:()=>t(6)}],[{icon:(0,_o.jsx)(yc,{level:"p",isPressed:!(!d||"p"!==d)}),title:(0,Mo.__)("Paragraph","kadence-blocks"),isActive:!(!d||"p"!==d),onClick:()=>t("p")}],[{icon:(0,_o.jsx)(yc,{level:"span",isPressed:!(!d||"span"!==d)}),title:(0,Mo.__)("Span","kadence-blocks"),isActive:!(!d||"span"!==d),onClick:()=>t("span")}],[{icon:(0,_o.jsx)(yc,{level:"div",isPressed:!(!d||"div"!==d)}),title:(0,Mo.__)("div","kadence-blocks"),isActive:!(!d||"div"!==d),onClick:()=>t("div")}]],h=(0,Oo.range)(l,c).map(e=>[{icon:(0,_o.jsx)(yc,{level:e,isPressed:!(e!==u||!d||"heading"!==d)}),title:(0,Mo.sprintf)(/* translators: %d: heading level e.g: "1", "2", "3" */ /* translators: %d: heading level e.g: "1", "2", "3" */
    4141(0,Mo.__)("Heading %d","kadence-blocks"),e),isActive:!(e!==u||!d||"heading"!==d),onClick:()=>t(e)}]),f=a?ToolbarDropdownMenu:yo.ToolbarGroup;return[t&&(0,_o.jsxs)("div",{className:"kb-tag-level-control components-base-control"+(o?" "+o:""),children:[e&&(0,_o.jsx)("div",{className:"kadence-component__header kadence-tag-select__header",children:e&&(0,_o.jsxs)("div",{className:"kadence-component__header__title kadence-tag-select__title",children:[(0,_o.jsx)("label",{className:"components-base-control__label",children:e}),s&&(0,_o.jsx)("div",{className:"title-reset-wrap",children:(0,_o.jsx)(yo.Button,{className:"is-reset is-single",label:"reset",isSmall:!0,disabled:!!isEqual(defaultValue,n),icon:undo,onClick:()=>onReset()})})]})}),(0,_o.jsx)("div",{className:"kadence-controls-content kb-tag-select-control-inner",children:(0,_o.jsx)(f,{isCollapsed:a,label:r,controls:i?h:p})})]})]}function lp(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 cp({label:e,onChange:t,value:n="",className:o="",options:a=No.GAP_SIZES_MAP,step:r=1,max:s=200,min:i=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,ko.useState)(!1);(0,ko.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,Mo.__)("Inherit","kadence-blocks"),name:(0,Mo.__)("Inherit","kadence-blocks")},...a];return[t&&(0,_o.jsxs)("div",{className:"components-base-control component-gap-size-control kadence-gap-size-control"+(o?" "+o:""),children:[!f&&e&&(0,_o.jsx)("div",{className:"kadence-gap-size-control__header kadence-component__header",children:(0,_o.jsxs)("div",{className:"kadence-component__header__title kadence-radio-range__title",children:[(0,_o.jsx)("label",{className:"components-base-control__label",children:e}),m&&(0,_o.jsx)("div",{className:"title-reset-wrap",children:(0,_o.jsx)(yo.Button,{className:"is-reset is-single",label:"reset",isSmall:!0,disabled:!!(0,Oo.isEqual)(l,n),icon:kd,onClick:()=>{"function"==typeof m?m():t(l)}})})]})}),!k&&g&&(0,_o.jsx)("div",{className:"kadence-controls-content",children:(0,_o.jsxs)(yo.ButtonGroup,{className:"kadence-radio-container-control",children:[a.map((e,n)=>(0,_o.jsx)(yo.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,_o.jsx)(yo.Button,{className:"kadence-radio-item radio-custom only-icon",label:(0,Mo.__)("Set custom size","kadence-blocks"),icon:zc,onClick:()=>{w&&"px"===c&&t(lp(a,w)),y(!0)},isPressed:!1,isTertiary:!0})]})}),!k&&!g&&(0,_o.jsxs)("div",{className:"kadence-controls-content kadence-gap-size-select-control-wrap",children:[(0,_o.jsx)(yo.SelectControl,{className:"kadence-gap-size-select-control",value:w,options:C,onChange:e=>{t(w==e&&""==l?"":e)}}),!p&&(0,_o.jsx)(yo.ButtonGroup,{className:"kadence-radio-container-control",children:(0,_o.jsx)(yo.Button,{className:"kadence-radio-item radio-custom only-icon",label:(0,Mo.__)("Set custom size","kadence-blocks"),icon:zc,onClick:()=>{w&&"px"===c&&t(lp(a,w)),y(!0)},isPressed:!1,isTertiary:!0})})]}),k&&(0,_o.jsxs)("div",{className:"kadence-controls-content kadence-single-unit-control",children:[(0,_o.jsx)(yo.__experimentalUnitControl,{label:b&&e?e:void 0,labelPosition:"top",min:i,max:s,step:r,units:_,value:n,disableUnits:!0,onChange:e=>(e=>{const n=isNaN(parseFloat(e))?void 0:parseFloat(e);t(n)})(e)}),(0,_o.jsx)("div",{className:"kadence-measure-control-select-wrapper",children:(0,_o.jsx)("select",{className:"kadence-measure-control-select components-unit-control__select",onChange:e=>{u(e.target.value)},value:c,children:d.map(e=>(0,_o.jsx)("option",{value:e,selected:c===e||void 0,children:e},e))})}),!p&&(0,_o.jsx)(yo.ButtonGroup,{className:"kadence-radio-container-control",children:(0,_o.jsx)(yo.Button,{className:"kadence-radio-item radio-custom only-icon",label:(0,Mo.__)("Use size preset","kadence-blocks"),icon:zc,isPrimary:!0,onClick:()=>{n&&"px"===c&&t(function(e,t){if(!t)return"";if(!e)return"";if("0"===t)return"";const n=e.find(e=>e.size===t);return n?n.value:""}(a,n)),y(!1)},isPressed:!0})})]})]})]}function up({label:e,onChange:t,onChangeTablet:n,onChangeMobile:o,mobileValue:a,tabletValue:r,value:s,units:i=["px","em","rem"],onUnit:l,options:c=No.GAP_SIZES_MAP,step:u=1,max:d=200,min:p=0,unit:h="px",defaultValue:f=["","",""],reset:b=!0,radio:m=!0,compressedDevice:g=!1}){const v=(0,ko.useRef)(),[x,k]=(0,ko.useState)("Desktop"),y=(0,To.useSelect)(e=>e("kadenceblocks/data").getPreviewDeviceType(),[]);y!==x&&k(y);const{setPreviewDeviceType:_}=(0,To.useDispatch)("kadenceblocks/data"),w=e=>{_((0,No.capitalizeFirstLetter)(e)),k((0,No.capitalizeFirstLetter)(e))},C=[{name:"Desktop",title:(0,_o.jsx)(yo.Dashicon,{icon:"desktop"}),itemClass:"kb-desk-tab"},{name:"Tablet",title:(0,_o.jsx)(yo.Dashicon,{icon:"tablet"}),itemClass:"kb-tablet-tab"},{name:"Mobile",key:"mobile",title:(0,_o.jsx)(yo.Dashicon,{icon:"smartphone"}),itemClass:"kb-mobile-tab"}],j=[s,r,a],S={};S.Mobile=(0,_o.jsx)(cp,{value:a||void 0,onChange:e=>o(e),options:c,onUnit:l,defaultValue:f[2],units:i,step:u,max:d,min:p,unit:h,radio:m}),S.Tablet=(0,_o.jsx)(cp,{value:r||void 0,onChange:e=>n(e),options:c,onUnit:l,defaultValue:f[1],units:i,step:u,max:d,min:p,unit:h,radio:m}),S.Desktop=(0,_o.jsx)(cp,{value:s||void 0,onChange:e=>t(e),options:c,onUnit:l,defaultValue:f[0],units:i,step:u,max:d,min:p,unit:h,radio:m});const N={Desktop:(0,_o.jsx)(yo.Dashicon,{icon:"desktop"}),Tablet:(0,_o.jsx)(yo.Dashicon,{icon:"tablet"}),Mobile:(0,_o.jsx)(yo.Dashicon,{icon:"smartphone"})};return[t&&n&&o&&(0,_o.jsxs)("div",{ref:v,className:"components-base-control kb-responsive-gap-size-control kadence-gap-size-control",children:[(0,_o.jsxs)("div",{className:"kadence-gap-size-control__header kadence-component__header",children:[e&&(0,_o.jsxs)("div",{className:"kadence-component__header__title kadence-gap-size__title",children:[(0,_o.jsx)("label",{className:"components-base-control__label",children:e}),b&&(0,_o.jsx)("div",{className:"title-reset-wrap",children:(0,_o.jsx)(yo.Button,{className:"is-reset is-single",label:"reset",isSmall:!0,disabled:!!(0,Oo.isEqual)(f,j),icon:kd,onClick:()=>{"function"==typeof b?b():"Mobile"===x?o(f[2]):"Tablet"===x?n(f[1]):t(f[0])}})})]}),!g&&(0,_o.jsx)(yo.ButtonGroup,{className:"kb-responsive-options kb-measure-responsive-options","aria-label":(0,Mo.__)("Device","kadence-blocks"),children:(0,Oo.map)(C,({name:e,key:t,title:n,itemClass:o})=>(0,_o.jsx)(yo.Button,{className:`kb-responsive-btn ${o}${e===x?" is-active":""}`,isSmall:!0,"aria-pressed":x===e,onClick:()=>w(e),children:n},t))}),g&&(0,_o.jsx)(yo.DropdownMenu,{className:"kb-responsive-options-dropdown",icon:N[x]?N[x]:N.Desktop,label:(0,Mo.__)("Target Device","kadence-blocks"),controls:C.map(e=>{return[{title:(t=e).name,icon:t.title,isActive:x===t.name,onClick:()=>{w(t.name)}}];var t})})]}),(0,_o.jsx)("div",{className:"kb-responsive-border-control-inner",children:S[x]?S[x]:S.Desktop})]})]}tu.pxIcon,tu.emIcon,tu.remIcon,tu.vhIcon,tu.vwIcon,tu.percentIcon;const{localStorage:dp}=window;function pp({attributes:e,defaultAttributes:t={},blockSlug:n,excludedAttrs:o=[],preventMultiple:a=[],onPaste:r}){const s=n+"-style",i=JSON.parse(dp.getItem(s)),l=()=>{dp.setItem(s,JSON.stringify((0,No.getTransferableAttributes)(e,t,o,a,!0)))},c=()=>{const e=JSON.parse(dp.getItem(s));if(e){const n=(0,No.getTransferableAttributes)(e,t,[],[],!1);r(n)}},u=()=>{const e=JSON.parse(dp.getItem(s));e&&r(e)};return(0,_o.jsx)(yo.ToolbarDropdownMenu,{className:"components-toolbar kb-copy-paste-attributes",icon:tu.copyStyles,label:(0,Mo.__)("Copy/Paste Styles","kadence-blocks"),popoverProps:{className:"kb-copy-paste-attributes__popover"},children:({onClose:e})=>(0,_o.jsx)(_o.Fragment,{children:(0,_o.jsxs)(yo.MenuGroup,{children:[(0,_o.jsx)(yo.MenuItem,{icon:tu.copy,onClick:(0,Oo.flow)(e,l),label:(0,Mo.__)("Copy Styles","kadence-blocks"),children:(0,Mo.__)("Copy Styles","kadence-blocks")}),(0,_o.jsx)(yo.MenuItem,{icon:tu.paste,onClick:(0,Oo.flow)(e,c),disabled:!i,label:(0,Mo.__)("Paste Styles","kadence-blocks"),children:(0,Mo.__)("Paste Styles","kadence-blocks")}),(0,_o.jsx)(yo.MenuItem,{icon:tu.paste,onClick:(0,Oo.flow)(e,u),disabled:!i,label:(0,Mo.__)("Paste and Replace","kadence-blocks"),children:(0,Mo.__)("Paste and Replace","kadence-blocks")})]})})})}const hp=window.wp.hooks,fp=(0,yo.withFilters)("kadence.FormInputDynamicControl")(function(){const[e,t]=(0,ko.useState)(),[n,o]=(0,ko.useState)(!1),a=(0,Oo.debounce)(()=>{o(!n)},100);return(0,_o.jsxs)("div",{className:"kb-dynamic-form-input-sidebar-wrap",children:[(0,_o.jsx)(yo.Button,{className:"kb-dynamic-form-input-sidebar",icon:tu.dynamic,onClick:()=>a(),ref:t,isPressed:n,"aria-haspopup":"true","aria-expanded":n,label:(0,Mo.__)("Dynamic Content","kadence-blocks"),showTooltip:!0}),n&&(0,_o.jsx)(yo.Popover,{headerTitle:(0,Mo.__)("Select Dynamic Source","kadence-blocks"),noArrow:!1,onClose:a,placement:"bottom-end",anchor:e,className:"kb-dynamic-popover",children:(0,_o.jsx)("div",{className:"kb-dynamic-popover-inner-wrap",children:(0,_o.jsxs)("div",{className:"kb-pro-notice",children:[(0,_o.jsxs)("h2",{children:[(0,Mo.__)("Dynamic Content","kadence-blocks")," "]}),(0,_o.jsxs)("p",{children:[(0,Mo.__)("Create dynamic sites by populating content from various sources.","kadence-blocks")," "]}),(0,_o.jsx)(yo.ExternalLink,{href:"https://www.kadencewp.com/kadence-blocks/pro/?utm_source=in-app&utm_medium=kadence-blocks&utm_campaign=dynamic-content",children:(0,Mo.__)("Upgrade to Pro","kadence-blocks")})]})})})]})});function bp({value:e,onChange:t,label:n,className:o,reset:a,defaultValue:r="",dynamicAttribute:s,isSelected:i,attributes:l,setAttributes:c,name:u,clientId:d,context:p}){const h=(0,_c.useInstanceId)(bp),{kadenceDynamic:f}=l,b=void 0!==f&&void 0!==f[s]&&void 0!==f[s].enable&&""!==f[s].enable&&f[s].enable;return(0,_o.jsxs)("div",{className:`components-base-control kadence-form-input-control kadence-form-input-control${h}${o?" "+o:""}`,children:[n&&(0,_o.jsx)("div",{className:"kadence-form-input-control__header",children:n&&(0,_o.jsxs)("div",{className:"kadence-form-input-control__title",children:[(0,_o.jsx)("label",{className:"components-base-control__label",children:n}),a&&(0,_o.jsx)("div",{className:"title-reset-wrap",children:(0,_o.jsx)(yo.Button,{className:"is-reset is-single",label:"reset",isSmall:!0,disabled:!!(0,Oo.isEqual)(r,e),icon:undo,onClick:()=>{"function"==typeof a?a():t(r)}})})]})}),(0,_o.jsxs)("div",{className:"kadence-controls-content",children:[b&&(0,_o.jsx)("div",{className:"kadence-form-input-control__dynamic__label",children:(0,hp.applyFilters)("kadence.formInputDisplay",e,l,s)}),!b&&(0,_o.jsx)(yo.TextControl,{label:"",value:e,onChange:e=>t(e)}),(0,_o.jsx)(fp,{dynamicAttribute:s,isSelected:i,attributes:l,setAttributes:c,name:u,clientId:d,context:p})]})]})}function mp(e){const{label:t,onChange:n,value:o,postType:a="post",hideLabelFromVision:r=!1,overrideLabel:s=null}=e,{posts:i}=(0,To.useSelect)(e=>({posts:e("core").getEntityRecords("postType",a,{per_page:-1,orderby:"title",order:"asc"})}),[a]),l=[...(i||[]).map(e=>({label:null!==s&&o===e.id?s:gp(e.title.raw),value:e.id}))];return!(o&&l.some(e=>e.value===o))&&o&&l.push({label:null!==s?s:(0,Mo.__)("Unknown Selection","kadence-blocks"),value:o}),(0,_o.jsx)(yo.SelectControl,{label:t,options:l,onChange:n,value:o,hideLabelFromVision:r})}function gp(e){const t=(e=e||"").replace(/<!--[\s\S]*?(-->|$)/g,"").replace(/<(script|style)[^>]*>[\s\S]*?(<\/\1>|$)/gi,"").replace(/<\/?[a-z][\s\S]*?(>|$)/gi,"");return t!==e?gp(t):t}var vp=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"].join(","),xp="undefined"==typeof Element,kp=xp?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,yp=!xp&&Element.prototype.getRootNode?function(e){var t;return null==e||null===(t=e.getRootNode)||void 0===t?void 0:t.call(e)}:function(e){return null==e?void 0:e.ownerDocument},_p=function e(t,n){var o;void 0===n&&(n=!0);var a=null==t||null===(o=t.getAttribute)||void 0===o?void 0:o.call(t,"inert");return""===a||"true"===a||n&&t&&e(t.parentNode)},Cp=function e(t,n,o){for(var a=[],r=Array.from(t);r.length;){var s=r.shift();if(!_p(s,!1))if("SLOT"===s.tagName){var i=s.assignedElements(),l=e(i.length?i:s.children,!0,o);o.flatten?a.push.apply(a,l):a.push({scopeParent:s,candidates:l})}else{kp.call(s,vp)&&o.filter(s)&&(n||!t.includes(s))&&a.push(s);var c=s.shadowRoot||"function"==typeof o.getShadowRoot&&o.getShadowRoot(s),u=!_p(c,!1)&&(!o.shadowRootFilter||o.shadowRootFilter(s));if(c&&u){var d=e(!0===c?s.children:c.children,!0,o);o.flatten?a.push.apply(a,d):a.push({scopeParent:s,candidates:d})}else r.unshift.apply(r,s.children)}}return a},jp=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},Sp=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||function(e){var t,n=null==e||null===(t=e.getAttribute)||void 0===t?void 0:t.call(e,"contenteditable");return""===n||"true"===n}(e))&&!jp(e)?0:e.tabIndex},Np=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},Op=function(e){return"INPUT"===e.tagName},Ep=function(e){var t=e.getBoundingClientRect(),n=t.width,o=t.height;return 0===n&&0===o},Mp=function(e,t){return!(t.disabled||_p(t)||function(e){return Op(e)&&"hidden"===e.type}(t)||function(e,t){var n=t.displayCheck,o=t.getShadowRoot;if("hidden"===getComputedStyle(e).visibility)return!0;var a=kp.call(e,"details>summary:first-of-type")?e.parentElement:e;if(kp.call(a,"details:not([open]) *"))return!0;if(n&&"full"!==n&&"legacy-full"!==n){if("non-zero-area"===n)return Ep(e)}else{if("function"==typeof o){for(var r=e;e;){var s=e.parentElement,i=yp(e);if(s&&!s.shadowRoot&&!0===o(s))return Ep(e);e=e.assignedSlot?e.assignedSlot:s||i===e.ownerDocument?s:i.host}e=r}if(function(e){var t,n,o,a,r=e&&yp(e),s=null===(t=r)||void 0===t?void 0:t.host,i=!1;if(r&&r!==e)for(i=!!(null!==(n=s)&&void 0!==n&&null!==(o=n.ownerDocument)&&void 0!==o&&o.contains(s)||null!=e&&null!==(a=e.ownerDocument)&&void 0!==a&&a.contains(e));!i&&s;){var l,c,u;i=!(null===(c=s=null===(l=r=yp(s))||void 0===l?void 0:l.host)||void 0===c||null===(u=c.ownerDocument)||void 0===u||!u.contains(s))}return i}(e))return!e.getClientRects().length;if("legacy-full"!==n)return!0}return!1}(t,e)||function(e){return"DETAILS"===e.tagName&&Array.prototype.slice.apply(e.children).some(function(e){return"SUMMARY"===e.tagName})}(t)||function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if("FIELDSET"===t.tagName&&t.disabled){for(var n=0;n<t.children.length;n++){var o=t.children.item(n);if("LEGEND"===o.tagName)return!!kp.call(t,"fieldset[disabled] *")||!o.contains(e)}return!0}t=t.parentElement}return!1}(t))},Tp=function(e,t){return!(function(e){return function(e){return Op(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t,n=e.form||yp(e),o=function(e){return n.querySelectorAll('input[type="radio"][name="'+e+'"]')};if("undefined"!=typeof window&&void 0!==window.CSS&&"function"==typeof window.CSS.escape)t=o(window.CSS.escape(e.name));else try{t=o(e.name)}catch(e){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",e.message),!1}var a=function(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]}(t,e.form);return!a||a===e}(e)}(t)||Sp(t)<0||!Mp(e,t))},Rp=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},Ip=function e(t){var n=[],o=[];return t.forEach(function(t,a){var r=!!t.scopeParent,s=r?t.scopeParent:t,i=function(e,t){var n=Sp(e);return n<0&&t&&!jp(e)?0:n}(s,r),l=r?e(t.candidates):s;0===i?r?n.push.apply(n,l):n.push(s):o.push({documentOrder:a,tabIndex:i,item:t,isScope:r,content:l})}),o.sort(Np).reduce(function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e},[]).concat(n)},Pp=function(e,t){var n;return n=(t=t||{}).getShadowRoot?Cp([e],t.includeContainer,{filter:Tp.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:Rp}):function(e,t,n){if(_p(e))return[];var o=Array.prototype.slice.apply(e.querySelectorAll(vp));return t&&kp.call(e,vp)&&o.unshift(e),o.filter(n)}(e,t.includeContainer,Tp.bind(null,t)),Ip(n)};function Lp(){return/apple/i.test(navigator.vendor)}function Ap(){return function(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(e=>{let{brand:t,version:n}=e;return t+"/"+n}).join(" "):navigator.userAgent}().includes("jsdom/")}const Dp="data-floating-ui-focusable",Fp="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function Vp(e){let t=e.activeElement;for(;null!=(null==(n=t)||null==(n=n.shadowRoot)?void 0:n.activeElement);){var n;t=t.shadowRoot.activeElement}return t}function Bp(e,t){if(!e||!t)return!1;const n=null==t.getRootNode?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&Rs(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function zp(e){return"composedPath"in e?e.composedPath()[0]:e.target}function Hp(e,t){if(null==t)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return null!=n.target&&t.contains(n.target)}function Up(e){return(null==e?void 0:e.ownerDocument)||document}function Gp(e,t,n){void 0===n&&(n=!0);const o=e.filter(e=>{var o;return e.parentId===t&&(!n||(null==(o=e.context)?void 0:o.open))});return o.flatMap(t=>[t,...Gp(e,t.id,n)])}function $p(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}var Wp="undefined"!=typeof document?e.useLayoutEffect:function(){};function qp(t){const n=e.useRef(t);return Wp(()=>{n.current=t}),n}const Xp={...t}.useInsertionEffect||(e=>e());function Jp(t){const n=e.useRef(()=>{});return Xp(()=>{n.current=t}),e.useCallback(function(){for(var e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];return null==n.current?void 0:n.current(...t)},[])}const Kp=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function Yp(e,t){const n=Pp(e,Kp()),o=n.length;if(0===o)return;const a=Vp(Up(e)),r=n.indexOf(a);return n[-1===r?1===t?0:o-1:r+t]}function Zp(e,t){const n=t||e.currentTarget,o=e.relatedTarget;return!o||!Bp(n,o)}function Qp(e){Pp(e,Kp()).forEach(e=>{e.dataset.tabindex=e.getAttribute("tabindex")||"",e.setAttribute("tabindex","-1")})}function eh(e){e.querySelectorAll("[data-tabindex]").forEach(e=>{const t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute("tabindex",t):e.removeAttribute("tabindex")})}var th="undefined"!=typeof document?e.useLayoutEffect:function(){};function nh(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let n,o,a;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(o=n;0!==o--;)if(!nh(e[o],t[o]))return!1;return!0}if(a=Object.keys(e),n=a.length,n!==Object.keys(t).length)return!1;for(o=n;0!==o--;)if(!{}.hasOwnProperty.call(t,a[o]))return!1;for(o=n;0!==o--;){const n=a[o];if(!("_owner"===n&&e.$$typeof||nh(e[n],t[n])))return!1}return!0}return e!=e&&t!=t}function oh(e){return"undefined"==typeof window?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function ah(e,t){const n=oh(e);return Math.round(t*n)/n}function rh(t){const n=e.useRef(t);return th(()=>{n.current=t}),n}const sh=(e,t)=>({...mi(e),options:[e,t]}),ih=(e,t)=>({...gi(e),options:[e,t]}),lh=(e,t)=>({...vi(e),options:[e,t]}),ch="data-floating-ui-focusable",uh="active",dh="selected",ph={...t};let hh=!1,fh=0;const bh=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+fh++,mh=ph.useId||function(){const[t,n]=e.useState(()=>hh?bh():void 0);return Wp(()=>{null==t&&n(bh())},[]),e.useEffect(()=>{hh=!0},[]),t};const gh=e.createContext(null),vh=e.createContext(null),xh=()=>{var t;return(null==(t=e.useContext(gh))?void 0:t.id)||null},kh=()=>e.useContext(vh);function yh(e){return"data-floating-ui-"+e}function _h(e){-1!==e.current&&(clearTimeout(e.current),e.current=-1)}const wh=yh("safe-polygon");function Ch(e,t,n){if(n&&!$p(n))return 0;if("number"==typeof e)return e;if("function"==typeof e){const n=e();return"number"==typeof n?n:null==n?void 0:n[t]}return null==e?void 0:e[t]}function jh(e){return"function"==typeof e?e():e}const Sh={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0},Nh=e.forwardRef(function(t,n){const[o,a]=e.useState();Wp(()=>{Lp()&&a("button")},[]);const r={ref:n,tabIndex:0,role:o,"aria-hidden":!o||void 0,[yh("focus-guard")]:"",style:Sh};return(0,_o.jsx)("span",{...t,...r})}),Oh=e.createContext(null),Eh=yh("portal");function Mh(t){const{children:n,id:o,root:a,preserveTabOrder:r=!0}=t,s=function(t){void 0===t&&(t={});const{id:n,root:o}=t,a=mh(),r=Th(),[s,i]=e.useState(null),l=e.useRef(null);return Wp(()=>()=>{null==s||s.remove(),queueMicrotask(()=>{l.current=null})},[s]),Wp(()=>{if(!a)return;if(l.current)return;const e=n?document.getElementById(n):null;if(!e)return;const t=document.createElement("div");t.id=a,t.setAttribute(Eh,""),e.appendChild(t),l.current=t,i(t)},[n,a]),Wp(()=>{if(null===o)return;if(!a)return;if(l.current)return;let e=o||(null==r?void 0:r.portalNode);e&&!Ms(e)&&(e=e.current),e=e||document.body;let t=null;n&&(t=document.createElement("div"),t.id=n,e.appendChild(t));const s=document.createElement("div");s.id=a,s.setAttribute(Eh,""),e=t||e,e.appendChild(s),l.current=s,i(s)},[n,o,a,r]),s}({id:o,root:a}),[i,l]=e.useState(null),c=e.useRef(null),u=e.useRef(null),d=e.useRef(null),p=e.useRef(null),h=null==i?void 0:i.modal,f=null==i?void 0:i.open,b=!!i&&!i.modal&&i.open&&r&&!(!a&&!s);return e.useEffect(()=>{if(s&&r&&!h)return s.addEventListener("focusin",e,!0),s.addEventListener("focusout",e,!0),()=>{s.removeEventListener("focusin",e,!0),s.removeEventListener("focusout",e,!0)};function e(e){s&&Zp(e)&&("focusin"===e.type?eh:Qp)(s)}},[s,r,h]),e.useEffect(()=>{s&&(f||eh(s))},[f,s]),(0,_o.jsxs)(Oh.Provider,{value:e.useMemo(()=>({preserveTabOrder:r,beforeOutsideRef:c,afterOutsideRef:u,beforeInsideRef:d,afterInsideRef:p,portalNode:s,setFocusManagerState:l}),[r,s]),children:[b&&s&&(0,_o.jsx)(Nh,{"data-type":"outside",ref:c,onFocus:e=>{if(Zp(e,s)){var t;null==(t=d.current)||t.focus()}else{const e=Yp(Up(n=i?i.domReference:null).body,-1)||n;null==e||e.focus()}var n}}),b&&s&&(0,_o.jsx)("span",{"aria-owns":s.id,style:Sh}),s&&Zr.createPortal(n,s),b&&s&&(0,_o.jsx)(Nh,{"data-type":"outside",ref:u,onFocus:e=>{if(Zp(e,s)){var t;null==(t=p.current)||t.focus()}else{const t=Yp(Up(n=i?i.domReference:null).body,1)||n;null==t||t.focus(),(null==i?void 0:i.closeOnFocusOut)&&(null==i||i.onOpenChange(!1,e.nativeEvent,"focus-out"))}var n}})]})}const Th=()=>e.useContext(Oh),Rh={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},Ih={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},Ph=e=>{var t,n;return{escapeKey:"boolean"==typeof e?e:null!=(t=null==e?void 0:e.escapeKey)&&t,outsidePress:"boolean"==typeof e?e:null==(n=null==e?void 0:e.outsidePress)||n}};function Lh(t){void 0===t&&(t={});const{nodeId:n}=t,o=function(t){const{open:n=!1,onOpenChange:o,elements:a}=t,r=mh(),s=e.useRef({}),[i]=e.useState(()=>function(){const e=new Map;return{emit(t,n){var o;null==(o=e.get(t))||o.forEach(e=>e(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var o;null==(o=e.get(t))||o.delete(n)}}}()),l=null!=xh(),[c,u]=e.useState(a.reference),d=Jp((e,t,n)=>{s.current.openEvent=e?t:void 0,i.emit("openchange",{open:e,event:t,reason:n,nested:l}),null==o||o(e,t,n)}),p=e.useMemo(()=>({setPositionReference:u}),[]),h=e.useMemo(()=>({reference:c||a.reference||null,floating:a.floating||null,domReference:a.reference}),[c,a.reference,a.floating]);return e.useMemo(()=>({dataRef:s,open:n,onOpenChange:d,elements:h,events:i,floatingId:r,refs:p}),[n,d,h,i,r,p])}({...t,elements:{reference:null,floating:null,...t.elements}}),a=t.rootContext||o,r=a.elements,[s,i]=e.useState(null),[l,c]=e.useState(null),u=(null==r?void 0:r.domReference)||s,d=e.useRef(null),p=kh();Wp(()=>{u&&(d.current=u)},[u]);const h=function(t){void 0===t&&(t={});const{placement:n="bottom",strategy:o="absolute",middleware:a=[],platform:r,elements:{reference:s,floating:i}={},transform:l=!0,whileElementsMounted:c,open:u}=t,[d,p]=e.useState({x:0,y:0,strategy:o,placement:n,middlewareData:{},isPositioned:!1}),[h,f]=e.useState(a);nh(h,a)||f(a);const[b,m]=e.useState(null),[g,v]=e.useState(null),x=e.useCallback(e=>{e!==w.current&&(w.current=e,m(e))},[]),k=e.useCallback(e=>{e!==C.current&&(C.current=e,v(e))},[]),y=s||b,_=i||g,w=e.useRef(null),C=e.useRef(null),j=e.useRef(d),S=null!=c,N=rh(c),O=rh(r),E=rh(u),M=e.useCallback(()=>{if(!w.current||!C.current)return;const e={placement:n,strategy:o,middleware:h};O.current&&(e.platform=O.current),xi(w.current,C.current,e).then(e=>{const t={...e,isPositioned:!1!==E.current};T.current&&!nh(j.current,t)&&(j.current=t,Zr.flushSync(()=>{p(t)}))})},[h,n,o,O,E]);th(()=>{!1===u&&j.current.isPositioned&&(j.current.isPositioned=!1,p(e=>({...e,isPositioned:!1})))},[u]);const T=e.useRef(!1);th(()=>(T.current=!0,()=>{T.current=!1}),[]),th(()=>{if(y&&(w.current=y),_&&(C.current=_),y&&_){if(N.current)return N.current(y,_,M);M()}},[y,_,M,N,S]);const R=e.useMemo(()=>({reference:w,floating:C,setReference:x,setFloating:k}),[x,k]),I=e.useMemo(()=>({reference:y,floating:_}),[y,_]),P=e.useMemo(()=>{const e={position:o,left:0,top:0};if(!I.floating)return e;const t=ah(I.floating,d.x),n=ah(I.floating,d.y);return l?{...e,transform:"translate("+t+"px, "+n+"px)",...oh(I.floating)>=1.5&&{willChange:"transform"}}:{position:o,left:t,top:n}},[o,l,I.floating,d.x,d.y]);return e.useMemo(()=>({...d,update:M,refs:R,elements:I,floatingStyles:P}),[d,M,R,I,P])}({...t,elements:{...r,...l&&{reference:l}}}),f=e.useCallback(e=>{const t=Ms(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;c(t),h.refs.setReference(t)},[h.refs]),b=e.useCallback(e=>{(Ms(e)||null===e)&&(d.current=e,i(e)),(Ms(h.refs.reference.current)||null===h.refs.reference.current||null!==e&&!Ms(e))&&h.refs.setReference(e)},[h.refs]),m=e.useMemo(()=>({...h.refs,setReference:b,setPositionReference:f,domReference:d}),[h.refs,b,f]),g=e.useMemo(()=>({...h.elements,domReference:u}),[h.elements,u]),v=e.useMemo(()=>({...h,...a,refs:m,elements:g,nodeId:n}),[h,m,g,n,a]);return Wp(()=>{a.dataRef.current.floatingContext=v;const e=null==p?void 0:p.nodesRef.current.find(e=>e.id===n);e&&(e.context=v)}),e.useMemo(()=>({...h,context:v,refs:m,elements:g}),[h,m,g,v])}function Ah(){return function(){const e=navigator.userAgentData;return null!=e&&e.platform?e.platform:navigator.platform}().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints&&Lp()}function Dh(t,n){void 0===n&&(n={});const{open:o,onOpenChange:a,events:r,dataRef:s,elements:i}=t,{enabled:l=!0,visibleOnly:c=!0}=n,u=e.useRef(!1),d=e.useRef(-1),p=e.useRef(!0);e.useEffect(()=>{if(!l)return;const e=Ns(i.domReference);function t(){!o&&Ts(i.domReference)&&i.domReference===Vp(Up(i.domReference))&&(u.current=!0)}function n(){p.current=!0}function a(){p.current=!1}return e.addEventListener("blur",t),Ah()&&(e.addEventListener("keydown",n,!0),e.addEventListener("pointerdown",a,!0)),()=>{e.removeEventListener("blur",t),Ah()&&(e.removeEventListener("keydown",n,!0),e.removeEventListener("pointerdown",a,!0))}},[i.domReference,o,l]),e.useEffect(()=>{if(l)return r.on("openchange",e),()=>{r.off("openchange",e)};function e(e){let{reason:t}=e;"reference-press"!==t&&"escape-key"!==t||(u.current=!0)}},[r,l]),e.useEffect(()=>()=>{_h(d)},[]);const h=e.useMemo(()=>({onMouseLeave(){u.current=!1},onFocus(e){if(u.current)return;const t=zp(e.nativeEvent);if(c&&Ms(t))if(Ah()&&!e.relatedTarget){if(!p.current&&(!Ts(n=t)||!n.matches(Fp)))return}else if(!function(e){if(!e||Ap())return!0;try{return e.matches(":focus-visible")}catch(e){return!0}}(t))return;var n;a(!0,e.nativeEvent,"focus")},onBlur(e){u.current=!1;const t=e.relatedTarget,n=e.nativeEvent,o=Ms(t)&&t.hasAttribute(yh("focus-guard"))&&"outside"===t.getAttribute("data-type");d.current=window.setTimeout(()=>{var e;const r=Vp(i.domReference?i.domReference.ownerDocument:document);(t||r!==i.domReference)&&(Bp(null==(e=s.current.floatingContext)?void 0:e.refs.floating.current,r)||Bp(i.domReference,r)||o||a(!1,n,"focus"))})}}),[s,i.domReference,a,c]);return e.useMemo(()=>l?{reference:h}:{},[l,h])}function Fh(e,t,n){const o=new Map,a="item"===n;let r=e;if(a&&e){const{[uh]:t,[dh]:__,...n}=e;r=n}return{..."floating"===n&&{tabIndex:-1,[ch]:""},...r,...t.map(t=>{const o=t?t[n]:null;return"function"==typeof o?e?o(e):null:o}).concat(e).reduce((e,t)=>t?(Object.entries(t).forEach(t=>{let[n,r]=t;var s;a&&[uh,dh].includes(n)||(0===n.indexOf("on")?(o.has(n)||o.set(n,[]),"function"==typeof r&&(null==(s=o.get(n))||s.push(r),e[n]=function(){for(var e,t=arguments.length,a=new Array(t),r=0;r<t;r++)a[r]=arguments[r];return null==(e=o.get(n))?void 0:e.map(e=>e(...a)).find(e=>void 0!==e)})):e[n]=r)}),e):e,{})}}const Vh=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function Bh({children:t,text:n,className:o,TagName:a="span",placement:r="top"}){if(!n)return(0,_o.jsx)(a,{className:"tooltip-ref-wrap"+(o?" "+o:""),children:t});const[s,i]=(0,ko.useState)(!1);let l=r;switch(r){case"auto":l="top";break;case"auto-start":l="top-start";break;case"auto-end":l="top-end"}const{refs:c,floatingStyles:u,context:d}=Lh({open:s,onOpenChange:i,placement:l,whileElementsMounted:bi,middleware:[sh(5),lh({fallbackAxisSideDirection:"start"}),ih()]}),p=function(t,n){void 0===n&&(n={});const{open:o,onOpenChange:a,dataRef:r,events:s,elements:i}=t,{enabled:l=!0,delay:c=0,handleClose:u=null,mouseOnly:d=!1,restMs:p=0,move:h=!0}=n,f=kh(),b=xh(),m=qp(u),g=qp(c),v=qp(o),x=qp(p),k=e.useRef(),y=e.useRef(-1),_=e.useRef(),w=e.useRef(-1),C=e.useRef(!0),j=e.useRef(!1),S=e.useRef(()=>{}),N=e.useRef(!1),O=Jp(()=>{var e;const t=null==(e=r.current.openEvent)?void 0:e.type;return(null==t?void 0:t.includes("mouse"))&&"mousedown"!==t});e.useEffect(()=>{if(l)return s.on("openchange",e),()=>{s.off("openchange",e)};function e(e){let{open:t}=e;t||(_h(y),_h(w),C.current=!0,N.current=!1)}},[l,s]),e.useEffect(()=>{if(!l)return;if(!m.current)return;if(!o)return;function e(e){O()&&a(!1,e,"hover")}const t=Up(i.floating).documentElement;return t.addEventListener("mouseleave",e),()=>{t.removeEventListener("mouseleave",e)}},[i.floating,o,a,l,m,O]);const E=e.useCallback(function(e,t,n){void 0===t&&(t=!0),void 0===n&&(n="hover");const o=Ch(g.current,"close",k.current);o&&!_.current?(_h(y),y.current=window.setTimeout(()=>a(!1,e,n),o)):t&&(_h(y),a(!1,e,n))},[g,a]),M=Jp(()=>{S.current(),_.current=void 0}),T=Jp(()=>{if(j.current){const e=Up(i.floating).body;e.style.pointerEvents="",e.removeAttribute(wh),j.current=!1}}),R=Jp(()=>!!r.current.openEvent&&["click","mousedown"].includes(r.current.openEvent.type));e.useEffect(()=>{if(l&&Ms(i.domReference)){const a=i.domReference,r=i.floating;return o&&a.addEventListener("mouseleave",n),h&&a.addEventListener("mousemove",e,{once:!0}),a.addEventListener("mouseenter",e),a.addEventListener("mouseleave",t),r&&(r.addEventListener("mouseleave",n),r.addEventListener("mouseenter",s),r.addEventListener("mouseleave",c)),()=>{o&&a.removeEventListener("mouseleave",n),h&&a.removeEventListener("mousemove",e),a.removeEventListener("mouseenter",e),a.removeEventListener("mouseleave",t),r&&(r.removeEventListener("mouseleave",n),r.removeEventListener("mouseenter",s),r.removeEventListener("mouseleave",c))}}function e(e){if(_h(y),C.current=!1,d&&!$p(k.current)||jh(x.current)>0&&!Ch(g.current,"open"))return;const t=Ch(g.current,"open",k.current);t?y.current=window.setTimeout(()=>{v.current||a(!0,e,"hover")},t):o||a(!0,e,"hover")}function t(e){if(R())return void T();S.current();const t=Up(i.floating);if(_h(w),N.current=!1,m.current&&r.current.floatingContext){o||_h(y),_.current=m.current({...r.current.floatingContext,tree:f,x:e.clientX,y:e.clientY,onClose(){T(),M(),R()||E(e,!0,"safe-polygon")}});const n=_.current;return t.addEventListener("mousemove",n),void(S.current=()=>{t.removeEventListener("mousemove",n)})}("touch"!==k.current||!Bp(i.floating,e.relatedTarget))&&E(e)}function n(e){R()||r.current.floatingContext&&(null==m.current||m.current({...r.current.floatingContext,tree:f,x:e.clientX,y:e.clientY,onClose(){T(),M(),R()||E(e)}})(e))}function s(){_h(y)}function c(e){R()||E(e,!1)}},[i,l,t,d,h,E,M,T,a,o,v,f,g,m,r,R,x]),Wp(()=>{var e;if(l&&o&&null!=(e=m.current)&&null!=(e=e.__options)&&e.blockPointerEvents&&O()){j.current=!0;const e=i.floating;if(Ms(i.domReference)&&e){var t;const n=Up(i.floating).body;n.setAttribute(wh,"");const o=i.domReference,a=null==f||null==(t=f.nodesRef.current.find(e=>e.id===b))||null==(t=t.context)?void 0:t.elements.floating;return a&&(a.style.pointerEvents=""),n.style.pointerEvents="none",o.style.pointerEvents="auto",e.style.pointerEvents="auto",()=>{n.style.pointerEvents="",o.style.pointerEvents="",e.style.pointerEvents=""}}}},[l,o,b,i,f,m,O]),Wp(()=>{o||(k.current=void 0,N.current=!1,M(),T())},[o,M,T]),e.useEffect(()=>()=>{M(),_h(y),_h(w),T()},[l,i.domReference,M,T]);const I=e.useMemo(()=>{function e(e){k.current=e.pointerType}return{onPointerDown:e,onPointerEnter:e,onMouseMove(e){const{nativeEvent:t}=e;function n(){C.current||v.current||a(!0,t,"hover")}d&&!$p(k.current)||o||0===jh(x.current)||N.current&&e.movementX**2+e.movementY**2<2||(_h(w),"touch"===k.current?n():(N.current=!0,w.current=window.setTimeout(n,jh(x.current))))}}},[d,a,o,v,x]);return e.useMemo(()=>l?{reference:I}:{},[l,I])}(d,{move:!1}),h=Dh(d),f=function(t,n){void 0===n&&(n={});const{open:o,onOpenChange:a,elements:r,dataRef:s}=t,{enabled:i=!0,escapeKey:l=!0,outsidePress:c=!0,outsidePressEvent:u="pointerdown",referencePress:d=!1,referencePressEvent:p="pointerdown",ancestorScroll:h=!1,bubbles:f,capture:b}=n,m=kh(),g=Jp("function"==typeof c?c:()=>!1),v="function"==typeof c?g:c,x=e.useRef(!1),{escapeKey:k,outsidePress:y}=Ph(f),{escapeKey:_,outsidePress:w}=Ph(b),C=e.useRef(!1),j=e.useRef(-1),S=Jp(e=>{var t;if(!o||!i||!l||"Escape"!==e.key)return;if(C.current)return;const n=null==(t=s.current.floatingContext)?void 0:t.nodeId,r=m?Gp(m.nodesRef.current,n):[];if(!k&&(e.stopPropagation(),r.length>0)){let e=!0;if(r.forEach(t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__escapeKeyBubbles||(e=!1)}),!e)return}a(!1,function(e){return"nativeEvent"in e}(e)?e.nativeEvent:e,"escape-key")}),N=Jp(e=>{var t;const n=()=>{var t;S(e),null==(t=zp(e))||t.removeEventListener("keydown",n)};null==(t=zp(e))||t.addEventListener("keydown",n)}),O=Jp(e=>{var t;const n=s.current.insideReactTree;s.current.insideReactTree=!1;const o=x.current;if(x.current=!1,"click"===u&&o)return;if(n)return;if("function"==typeof v&&!v(e))return;const i=zp(e),l="["+yh("inert")+"]",c=Up(r.floating).querySelectorAll(l);let d=Ms(i)?i:null;for(;d&&!$s(d);){const e=Xs(d);if($s(e)||!Ms(e))break;d=e}if(c.length&&Ms(i)&&!i.matches("html,body")&&!Bp(i,r.floating)&&Array.from(c).every(e=>!Bp(d,e)))return;if(Ts(i)&&T){const t=$s(i),n=Ws(i),o=/auto|scroll/,a=t||o.test(n.overflowX),r=t||o.test(n.overflowY),s=a&&i.clientWidth>0&&i.scrollWidth>i.clientWidth,l=r&&i.clientHeight>0&&i.scrollHeight>i.clientHeight,c="rtl"===n.direction,u=l&&(c?e.offsetX<=i.offsetWidth-i.clientWidth:e.offsetX>i.clientWidth),d=s&&e.offsetY>i.clientHeight;if(u||d)return}const p=null==(t=s.current.floatingContext)?void 0:t.nodeId,h=m&&Gp(m.nodesRef.current,p).some(t=>{var n;return Hp(e,null==(n=t.context)?void 0:n.elements.floating)});if(Hp(e,r.floating)||Hp(e,r.domReference)||h)return;const f=m?Gp(m.nodesRef.current,p):[];if(f.length>0){let e=!0;if(f.forEach(t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__outsidePressBubbles||(e=!1)}),!e)return}a(!1,e,"outside-press")}),E=Jp(e=>{var t;const n=()=>{var t;O(e),null==(t=zp(e))||t.removeEventListener(u,n)};null==(t=zp(e))||t.addEventListener(u,n)});e.useEffect(()=>{if(!o||!i)return;s.current.__escapeKeyBubbles=k,s.current.__outsidePressBubbles=y;let e=-1;function t(e){a(!1,e,"ancestor-scroll")}function n(){window.clearTimeout(e),C.current=!0}function c(){e=window.setTimeout(()=>{C.current=!1},Us()?5:0)}const d=Up(r.floating);l&&(d.addEventListener("keydown",_?N:S,_),d.addEventListener("compositionstart",n),d.addEventListener("compositionend",c)),v&&d.addEventListener(u,w?E:O,w);let p=[];return h&&(Ms(r.domReference)&&(p=Ks(r.domReference)),Ms(r.floating)&&(p=p.concat(Ks(r.floating))),!Ms(r.reference)&&r.reference&&r.reference.contextElement&&(p=p.concat(Ks(r.reference.contextElement)))),p=p.filter(e=>{var t;return e!==(null==(t=d.defaultView)?void 0:t.visualViewport)}),p.forEach(e=>{e.addEventListener("scroll",t,{passive:!0})}),()=>{l&&(d.removeEventListener("keydown",_?N:S,_),d.removeEventListener("compositionstart",n),d.removeEventListener("compositionend",c)),v&&d.removeEventListener(u,w?E:O,w),p.forEach(e=>{e.removeEventListener("scroll",t)}),window.clearTimeout(e)}},[s,r,l,v,u,o,a,h,i,k,y,S,_,N,O,w,E]),e.useEffect(()=>{s.current.insideReactTree=!1},[s,v,u]);const M=e.useMemo(()=>({onKeyDown:S,...d&&{[Rh[p]]:e=>{a(!1,e.nativeEvent,"reference-press")},..."click"!==p&&{onClick(e){a(!1,e.nativeEvent,"reference-press")}}}}),[S,a,d,p]),T=e.useMemo(()=>({onKeyDown:S,onMouseDown(){x.current=!0},onMouseUp(){x.current=!0},[Ih[u]]:()=>{s.current.insideReactTree=!0},onBlurCapture(){m||(_h(j),s.current.insideReactTree=!0,j.current=window.setTimeout(()=>{s.current.insideReactTree=!1}))}}),[S,u,s,m]);return e.useMemo(()=>i?{reference:M,floating:T}:{},[i,M,T])}(d),b=function(t,n){var o,a;void 0===n&&(n={});const{open:r,elements:s,floatingId:i}=t,{enabled:l=!0,role:c="dialog"}=n,u=mh(),d=(null==(o=s.domReference)?void 0:o.id)||u,p=e.useMemo(()=>{var e,t;return(null==(e=(t=s.floating)?t.hasAttribute(Dp)?t:t.querySelector("["+Dp+"]")||t:null)?void 0:e.id)||i},[s.floating,i]),h=null!=(a=Vh.get(c))?a:c,f=null!=xh(),b=e.useMemo(()=>"tooltip"===h||"label"===c?{["aria-"+("label"===c?"labelledby":"describedby")]:r?p:void 0}:{"aria-expanded":r?"true":"false","aria-haspopup":"alertdialog"===h?"dialog":h,"aria-controls":r?p:void 0,..."listbox"===h&&{role:"combobox"},..."menu"===h&&{id:d},..."menu"===h&&f&&{role:"menuitem"},..."select"===c&&{"aria-autocomplete":"none"},..."combobox"===c&&{"aria-autocomplete":"list"}},[h,p,f,r,d,c]),m=e.useMemo(()=>{const e={id:p,...h&&{role:h}};return"tooltip"===h||"label"===c?e:{...e,..."menu"===h&&{"aria-labelledby":d}}},[h,p,d,c]),g=e.useCallback(e=>{let{active:t,selected:n}=e;const o={role:"option",...t&&{id:p+"-fui-option"}};switch(c){case"select":return{...o,"aria-selected":t&&n};case"combobox":return{...o,"aria-selected":n}}return{}},[p,c]);return e.useMemo(()=>l?{reference:b,floating:m,item:g}:{},[l,b,m,g])}(d,{role:"tooltip"}),{getReferenceProps:m,getFloatingProps:g}=function(t){void 0===t&&(t=[]);const n=t.map(e=>null==e?void 0:e.reference),o=t.map(e=>null==e?void 0:e.floating),a=t.map(e=>null==e?void 0:e.item),r=e.useCallback(e=>Fh(e,t,"reference"),n),s=e.useCallback(e=>Fh(e,t,"floating"),o),i=e.useCallback(e=>Fh(e,t,"item"),a);return e.useMemo(()=>({getReferenceProps:r,getFloatingProps:s,getItemProps:i}),[r,s,i])}([p,h,f,b]);return(0,_o.jsxs)(_o.Fragment,{children:[(0,_o.jsx)(a,{className:"tooltip-ref-wrap tooltip-ref-has-tip"+(o?" "+o:""),ref:c.setReference,...m(),children:t}),(0,_o.jsx)(Mh,{children:s&&(0,_o.jsxs)("div",{className:"kb-floating-tooltip",ref:c.setFloating,style:u,...g(),"data-placement":l,children:[(0,_o.jsx)("span",{className:"kb-tooltip-content",dangerouslySetInnerHTML:{__html:(v=n,x="<br><b><i><u><p><ol><ul><li><strong><small>",x=(((x||"")+"").toLowerCase().match(/<[a-z][a-z0-9]*>/g)||[]).join(""),v.replace(/<!--[\s\S]*?-->|<\?(?:php)?[\s\S]*?\?>/gi,"").replace(/<\/?([a-z][a-z0-9]*)\b[^>]*>/gi,function(e,t){return x.indexOf("<"+t.toLowerCase()+">")>-1?e:""}))}}),(0,_o.jsx)("span",{className:"kb-tooltip-arrow"})]})})]});var v,x}function zh({children:e}){return(0,_o.jsx)("div",{className:"components-base-control kadence-color-group",children:e})}function Hh({children:e}){return(0,_o.jsx)("div",{className:"components-base-control kadence-two-column-group",children:e})}class Uh extends ko.Component{constructor(){super(...arguments),this.toggle=this.toggle.bind(this),this.state={open:!1},this.popRef=(0,ko.createRef)(),this.debouncedToggle=(0,Oo.debounce)(this.toggle.bind(this),100)}toggle(){this.setState({open:!this.state.open})}render(){const{open:e}=this.state;let t={};return t.dynamic=(0,_o.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",children:(0,_o.jsx)("path",{d:"M4 5.002s.003-.095.213-.288c.245-.225.671-.483 1.306-.73C7.018 3.399 9.34 3 12 3s4.982.399 6.482.984c.634.247 1.061.505 1.306.73.205.189.212.281.212.288 0 .003-.007.095-.213.284-.245.225-.671.483-1.306.73C16.982 6.601 14.66 7 12 7s-4.982-.399-6.482-.984c-.634-.247-1.061-.505-1.306-.73C4.004 5.094 4 5.002 4 5.002zm16 9.53v4.471a.779.779 0 01-.217.291c-.245.225-.671.482-1.303.728-1.495.582-3.809.978-6.48.978s-4.985-.396-6.48-.978c-.633-.246-1.058-.503-1.303-.728a.865.865 0 01-.199-.242l-.006-4.514c.248.126.51.242.782.348C6.591 15.585 9.171 16 12 16s5.409-.415 7.206-1.114c.277-.108.543-.225.794-.354zm0-7.005v4.476a.779.779 0 01-.217.291c-.245.225-.671.482-1.303.728-1.495.582-3.809.978-6.48.978s-4.985-.396-6.48-.978c-.633-.246-1.058-.503-1.303-.728a.865.865 0 01-.199-.242 1.109 1.109 0 00-.009-.117l-.005-4.407c.248.128.513.244.788.352C6.593 8.582 9.18 9 12 9s5.407-.418 7.208-1.12A8.69 8.69 0 0020 7.527zM2 5v14c0 .058.002.116.007.174.057.665.425 1.197.857 1.594.498.457 1.175.824 1.93 1.118C6.591 22.585 9.171 23 12 23s5.409-.415 7.206-1.114c.755-.294 1.432-.661 1.93-1.118.432-.397.8-.929.857-1.594.005-.058.007-.116.007-.174V5c0-.056-.002-.112-.007-.168-.055-.664-.422-1.195-.852-1.59-.498-.459-1.177-.827-1.933-1.122C17.407 1.418 14.82 1 12 1s-5.407.418-7.208 1.12c-.756.295-1.435.664-1.933 1.122-.43.395-.797.927-.852 1.59A1.887 1.887 0 002 5z"})}),(0,_o.jsxs)(ko.Fragment,{children:[(0,_o.jsx)(yo.Button,{className:"kb-dynamic-url-sidebar",icon:t.dynamic,onClick:()=>this.debouncedToggle(),isPressed:!1,"aria-haspopup":"true","aria-expanded":e,label:(0,Mo.__)("Dynamic Link","kadence-blocks"),showTooltip:!0}),e&&(0,_o.jsx)(yo.Popover,{className:"kb-dynamic-popover",position:"bottom left",onClick:()=>{},expandOnMobile:!0,onClose:()=>this.debouncedToggle(),ref:this.popRef,children:(0,_o.jsx)("div",{className:"kb-dynamic-popover-inner-wrap",children:(0,_o.jsxs)("div",{className:"kb-pro-notice",children:[(0,_o.jsxs)("h2",{children:[(0,Mo.__)("Dynamic links","kadence-blocks")," "]}),(0,_o.jsxs)("p",{children:[(0,Mo.__)("Create dynamic sites by populating links from various sources.","kadence-blocks")," "]}),(0,_o.jsx)(yo.ExternalLink,{href:"https://www.kadencewp.com/kadence-blocks/pro/?utm_source=in-app&utm_medium=kadence-blocks&utm_campaign=dynamic-content",children:(0,Mo.__)("Upgrade to Pro","kadence-blocks")})]})})})]})}}const Gh=(0,yo.withFilters)("kadence.URLInputDynamicControl")(Uh),$h=window.wp.htmlEntities;function Wh(e){const t=[];return t.push(Vd()({path:(0,hc.addQueryArgs)("/wp/v2/search",{search:e,per_page:20,type:"post"})}).catch(()=>[])),Promise.all(t).then(e=>(0,Oo.map)((0,Oo.flatten)(e).slice(0,20),e=>({id:e.id,url:e.url,title:(0,$h.decodeEntities)(e.title)||(0,Mo.__)("(no title)"),type:e.subtype||e.type})))}const qh=(0,_o.jsx)(Ho.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,_o.jsx)(Ho.Path,{d:"m13.06 12 6.47-6.47-1.06-1.06L12 10.94 5.53 4.47 4.47 5.53 10.94 12l-6.47 6.47 1.06 1.06L12 13.06l6.47 6.47 1.06-1.06L13.06 12Z"})}),Xh="none",Jh="custom",Kh="media",Yh="attachment",Zh=(0,_o.jsxs)(yo.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:[(0,_o.jsx)(yo.Path,{d:"M0,0h24v24H0V0z",fill:"none"}),(0,_o.jsx)(yo.Path,{d:"m19 5v14h-14v-14h14m0-2h-14c-1.1 0-2 0.9-2 2v14c0 1.1 0.9 2 2 2h14c1.1 0 2-0.9 2-2v-14c0-1.1-0.9-2-2-2z"}),(0,_o.jsx)(yo.Path,{d:"m14.14 11.86l-3 3.87-2.14-2.59-3 3.86h12l-3.86-5.14z"})]}),Qh=({linkDestination:e="none",onChangeUrl:t,url:n,mediaType:o="image",mediaUrl:a,mediaLink:r,onChangeAttribute:s,onChangeLinkDestination:i,additionalControls:l=!0,opensInNewTab:c,onChangeTarget:u,linkNoFollow:d,onChangeFollow:p,linkSponsored:h,onChangeSponsored:f,linkDownload:b,onChangeDownload:m,linkTitle:g,onChangeTitle:v,onChangeLinkClass:x,linkClass:k,changeTargetType:y=!1})=>{const[_,w]=(0,ko.useState)(!1),C=(0,ko.useCallback)(()=>{w(!0)}),[j,S]=(0,ko.useState)(!1),[N,O]=(0,ko.useState)(null),E=(0,ko.useRef)(null),M=(0,ko.useCallback)(()=>{e!==Kh&&e!==Yh||O(""),S(!0)}),T=(0,ko.useCallback)(()=>{S(!1)}),R=(0,ko.useCallback)(()=>{O(null),T(),w(!1)}),I=(0,ko.useCallback)(()=>e=>{const t=E.current;t&&t.contains(e.target)||(w(!1),O(null),T())}),P=(0,ko.useCallback)(()=>e=>{if(N){const e=A().find(e=>e.url===N)?.linkDestination||Jh;s?s({link:N,linkDestination:e}):(t(N),i&&i(e))}T(),O(null),e.preventDefault()}),L=(0,ko.useCallback)(()=>{s?s({link:"",linkDestination:Xh}):(t(""),i&&i(Xh))}),A=()=>{const e=[{linkDestination:Kh,title:(0,Mo.__)("Media File"),url:"image"===o?a:void 0,icon:Zh}];return"image"===o&&r&&e.push({linkDestination:Yh,title:(0,Mo.__)("Attachment Page"),url:"image"===o?r:void 0,icon:(0,_o.jsxs)(yo.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:[(0,_o.jsx)(yo.Path,{d:"M0 0h24v24H0V0z",fill:"none"}),(0,_o.jsx)(yo.Path,{d:"M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zM6 20V4h7v5h5v11H6z"})]})}),e},D=e=>{u(e)},F=(0,_o.jsxs)(ko.Fragment,{children:[u&&(0,_o.jsxs)(ko.Fragment,{children:[y&&(0,_o.jsxs)(ko.Fragment,{children:[(0,_o.jsx)(SelectControl,{label:(0,Mo.__)("Link Target","kadence-blocks"),value:c,options:[{value:"_self",label:(0,Mo.__)("Same Tab/Window","kadence-blocks")},{value:"_blank",label:(0,Mo.__)("Open in New Tab","kadence-blocks")},{value:"video",label:(0,Mo.__)("Video Popup","kadence-blocks")}],onChange:D}),"video"===c&&(0,_o.jsx)("p",{children:(0,Mo.__)("NOTE: Video popup only works with youtube and vimeo links.","kadence-blocks")})]}),!y&&(0,_o.jsx)(yo.ToggleControl,{label:(0,Mo.__)("Open in New Tab","kadence-blocks"),onChange:D,checked:c})]}),p&&(0,_o.jsx)(yo.ToggleControl,{label:(0,Mo.__)("No Follow","kadence-blocks"),onChange:e=>{p(e)},checked:d}),f&&(0,_o.jsx)(yo.ToggleControl,{label:(0,Mo.__)("Sponsored","kadence-blocks"),onChange:e=>{f(e)},checked:h}),m&&(0,_o.jsx)(yo.ToggleControl,{label:(0,Mo.__)("Download","kadence-blocks"),onChange:e=>{m(e)},checked:b}),v&&(0,_o.jsx)(yo.TextControl,{label:(0,Mo.__)("Title","kadence-blocks"),onChange:e=>{v(e)},value:g}),x&&(0,_o.jsx)(yo.TextControl,{label:(0,Mo.__)("Link CSS Class","kadence-blocks"),onChange:e=>{x(e)},value:k})]}),V=null!==N?N:n,B=((0,Oo.find)(A(),["linkDestination",e])||{}).title;return(0,_o.jsxs)(_o.Fragment,{children:[(0,_o.jsx)(yo.ToolbarButton,{icon:fd,className:"components-toolbar__control",label:n?(0,Mo.__)("Edit link"):(0,Mo.__)("Insert link"),"aria-expanded":_,onClick:C}),_&&(0,_o.jsxs)(Eo.URLPopover,{onFocusOutside:I(),onClose:R,renderSettings:()=>l?F:"",additionalControls:!V&&(0,_o.jsx)(yo.NavigableMenu,{children:(0,Oo.map)(A(),e=>(0,_o.jsx)(yo.MenuItem,{icon:e.icon,onClick:()=>{O(null),(e=>{const n=A();let o;o=e?((0,Oo.find)(n,t=>t.url===e)||{linkDestination:Jh}).linkDestination:Xh,s?s({linkDestination:o,link:e}):(t(e),i&&i(o))})(e.url),T()},children:e.title},e.linkDestination))}),children:[(!n||j)&&(0,_o.jsx)(Eo.URLPopover.LinkEditor,{className:"block-editor-format-toolbar__link-container-content",value:V,onChangeInputValue:O,onSubmit:P(),autocompleteRef:E}),n&&!j&&(0,_o.jsxs)(_o.Fragment,{children:[(0,_o.jsx)(Eo.URLPopover.LinkViewer,{className:"block-editor-format-toolbar__link-container-content",url:n,onEditLinkClick:M,urlLabel:B}),(0,_o.jsx)(yo.Button,{icon:qh,label:(0,Mo.__)("Remove link"),onClick:L})]})]})]})},ef=(0,_o.jsx)(Ho.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,_o.jsx)(Ho.Path,{d:"m19 7-3-3-8.5 8.5-1 4 4-1L19 7Zm-7 11.5H5V20h7v-1.5Z"})}),tf=(0,_o.jsx)(Ho.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,_o.jsx)(Ho.Path,{d:"M12 21C16.9706 21 21 16.9706 21 12C21 7.02944 16.9706 3 12 3C7.02944 3 3 7.02944 3 12C3 16.9706 7.02944 21 12 21ZM15.5303 8.46967C15.8232 8.76256 15.8232 9.23744 15.5303 9.53033L13.0607 12L15.5303 14.4697C15.8232 14.7626 15.8232 15.2374 15.5303 15.5303C15.2374 15.8232 14.7626 15.8232 14.4697 15.5303L12 13.0607L9.53033 15.5303C9.23744 15.8232 8.76256 15.8232 8.46967 15.5303C8.17678 15.2374 8.17678 14.7626 8.46967 14.4697L10.9393 12L8.46967 9.53033C8.17678 9.23744 8.17678 8.76256 8.46967 8.46967C8.76256 8.17678 9.23744 8.17678 9.53033 8.46967L12 10.9393L14.4697 8.46967C14.7626 8.17678 15.2374 8.17678 15.5303 8.46967Z"})}),nf=(0,_o.jsx)(Ho.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,_o.jsx)(Ho.Path,{d:"M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z"})}),of=(0,_o.jsx)(Ho.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,_o.jsx)(Ho.Path,{d:"M12 3.3c-4.8 0-8.8 3.9-8.8 8.8 0 4.8 3.9 8.8 8.8 8.8 4.8 0 8.8-3.9 8.8-8.8s-4-8.8-8.8-8.8zm6.5 5.5h-2.6C15.4 7.3 14.8 6 14 5c2 .6 3.6 2 4.5 3.8zm.7 3.2c0 .6-.1 1.2-.2 1.8h-2.9c.1-.6.1-1.2.1-1.8s-.1-1.2-.1-1.8H19c.2.6.2 1.2.2 1.8zM12 18.7c-1-.7-1.8-1.9-2.3-3.5h4.6c-.5 1.6-1.3 2.9-2.3 3.5zm-2.6-4.9c-.1-.6-.1-1.1-.1-1.8 0-.6.1-1.2.1-1.8h5.2c.1.6.1 1.1.1 1.8s-.1 1.2-.1 1.8H9.4zM4.8 12c0-.6.1-1.2.2-1.8h2.9c-.1.6-.1 1.2-.1 1.8 0 .6.1 1.2.1 1.8H5c-.2-.6-.2-1.2-.2-1.8zM12 5.3c1 .7 1.8 1.9 2.3 3.5H9.7c.5-1.6 1.3-2.9 2.3-3.5zM10 5c-.8 1-1.4 2.3-1.8 3.8H5.5C6.4 7 8 5.6 10 5zM5.5 15.3h2.6c.4 1.5 1 2.8 1.8 3.7-1.8-.6-3.5-2-4.4-3.7zM14 19c.8-1 1.4-2.2 1.8-3.7h2.6C17.6 17 16 18.4 14 19z"})}),af=({text:e="",highlight:t=""})=>{const n=t.trim();if(!n)return e;const o=new RegExp(`(${(0,Oo.escapeRegExp)(n)})`,"gi");return(0,ko.createInterpolateElement)(e.replace(o,"<mark>$&</mark>"),{mark:(0,_o.jsx)("mark",{})})};class rf extends ko.Component{constructor(e){super(e),this.onChange=this.onChange.bind(this),this.onFocus=this.onFocus.bind(this),this.onKeyDown=this.onKeyDown.bind(this),this.selectPost=this.selectPost.bind(this),this.handleOnClick=this.handleOnClick.bind(this),this.autocompleteRef=e.autocompleteRef||(0,ko.createRef)(),this.inputRef=(0,ko.createRef)(),this.updateSuggestions=(0,Oo.debounce)(this.updateSuggestions.bind(this),200),this.suggestionNodes=[],this.isUpdatingSuggestions=!1,this.state={search:"",suggestions:[],showSuggestions:!1,selectedSuggestion:null,suggestionsListboxId:"",suggestionOptionIdPrefix:"",isEditing:!1}}updateSuggestions(e=""){this.setState({selectedSuggestion:null,loading:!0});const t=Wh(e);t.then(e=>{this.suggestionsRequest===t&&this.setState({suggestions:e,loading:!1,showSuggestions:!!e.length})}).catch(()=>{this.suggestionsRequest===t&&this.setState({loading:!1})}),this.suggestionsRequest=t}onChange(e){const t=e.target.value;this.setState({search:t}),this.updateSuggestions(t.trim())}onFocus(){const{suggestions:e,search:t}=this.state;!t||this.loading||e&&e.length||this.updateSuggestions(t.trim())}onKeyDown(e){const{showSuggestions:t,selectedSuggestion:n,suggestions:o,loading:a}=this.state;if(!t||!o.length||a){switch(e.keyCode){case Vo.UP:0!==e.target.selectionStart&&(e.stopPropagation(),e.preventDefault(),e.target.setSelectionRange(0,0));break;case Vo.DOWN:this.state.search.length!==e.target.selectionStart&&(e.stopPropagation(),e.preventDefault(),e.target.setSelectionRange(this.state.search.length,this.state.search.length))}return}const r=this.state.suggestions[this.state.selectedSuggestion];switch(e.keyCode){case Vo.UP:{e.stopPropagation(),e.preventDefault();const t=n?n-1:o.length-1;this.setState({selectedSuggestion:t});break}case Vo.DOWN:{e.stopPropagation(),e.preventDefault();const t=null===n||n===o.length-1?0:n+1;this.setState({selectedSuggestion:t});break}case Vo.TAB:null!==this.state.selectedSuggestion&&(this.selectPost(r),this.props.speak((0,Mo.__)("Link selected.")));break;case Vo.ENTER:null!==this.state.selectedSuggestion&&(e.stopPropagation(),this.selectPost(r))}}selectPost(e){this.props.onChange(e.url,e),this.setState({isEditing:!1,selectedSuggestion:null,showSuggestions:!1})}handleOnClick(e){this.selectPost(e)}render(){return(0,_o.jsxs)(ko.Fragment,{children:[this.renderControl(),this.renderSuggestions(),this.renderSettings()]})}renderSettings(){const{isSettingsExpanded:e,additionalControls:t,advancedOptions:n}=this.props;return(0,_o.jsx)(ko.Fragment,{children:t&&e&&(0,_o.jsx)("div",{className:"kb-link-control-additional-controls",children:n})})}renderControl(){const{label:e,className:t,isFullWidth:n,instanceId:o,placeholder:a=(0,Mo.__)("Paste URL or type to search","kadence-blocks"),url:r="",attributes:s,dynamicAttribute:i="",isSettingsExpanded:l,additionalControls:c,advancedOptions:u,onExpandSettings:d,allowClear:p}=this.props,{loading:h,showSuggestions:f,selectedSuggestion:b,suggestionsListboxId:m=`block-editor-url-input-suggestions-${o}`,suggestionOptionIdPrefix:g=`block-editor-url-input-suggestion-${o}`,isEditing:v}=this.state,x={id:`url-input-control-${o}`,className:"kb-search-selection-name"},k={value:this.state.search||r,required:!0,className:"kb-search-selection-input",type:"text",onChange:this.onChange,onFocus:this.onFocus,placeholder:a,onKeyDown:this.onKeyDown,role:"combobox","aria-label":(0,Mo.__)("URL Input or Search","kadence-blocks"),"aria-expanded":f,"aria-autocomplete":"list","aria-owns":m,"aria-activedescendant":null!==b?`${g}-${b}`:void 0,ref:this.inputRef};return(0,_o.jsx)(ko.Fragment,{children:(0,_o.jsxs)("div",{className:"kb-side-link-control-inner-row",children:[r&&!v&&(0,_o.jsx)("div",{className:"kb-search-selection-name",children:(0,hp.applyFilters)("kadence.linkDisplay",(0,_o.jsx)(ko.Fragment,{children:(0,_o.jsxs)("div",{className:"block-editor-url-popover__link-viewer block-editor-format-toolbar__link-container-content",children:[r?(0,_o.jsx)(yo.ExternalLink,{href:r,children:(0,hc.filterURLForDisplay)((0,hc.safeDecodeURI)(r))}):(0,_o.jsx)("span",{}),(0,_o.jsx)(yo.Button,{icon:ef,label:(0,Mo.__)("Edit","kadence-blocks"),onClick:()=>{this.state.search&&this.updateSuggestions(this.state.search),this.setState({isEditing:!0})}})]})}),this.props.attributes,i,void 0,this.props.context)}),(!r||v)&&(0,_o.jsxs)(yo.BaseControl,{...x,children:[(0,_o.jsx)("div",{className:"kb-search-url-input",children:(0,_o.jsx)("input",{...k})}),h&&(0,_o.jsx)(yo.Spinner,{}),p&&!this.state.search&&r&&(0,_o.jsx)(yo.Button,{className:"kb-search-url-clear",icon:tf,label:(0,Mo.__)("Clear","kadence-blocks"),onClick:()=>{this.props.onChange("",""),this.setState({isEditing:!1,selectedSuggestion:null,showSuggestions:!1})}}),(0,_o.jsx)(yo.Button,{className:"kb-search-url-submit",icon:Gc,label:(0,Mo.__)("Submit","kadence-blocks"),onClick:()=>{this.props.onChange(this.state.search||r,""),this.setState({isEditing:!1,selectedSuggestion:null,showSuggestions:!1})}})]}),i&&kadence_blocks_params.dynamic_enabled&&(0,_o.jsx)(Gh,{...this.props}),c&&(0,_o.jsx)(yo.Button,{className:"kb-link-settings-toggle",icon:nf,label:(0,Mo.__)("Link settings","kadence-blocks"),onClick:d,"aria-expanded":l})]})})}renderSuggestions(){const{className:t}=this.props,{showSuggestions:n,suggestions:o,selectedSuggestion:a,suggestionsListboxId:r,suggestionOptionIdPrefix:s,loading:i,search:l}=this.state,c={id:r,ref:this.autocompleteRef,role:"listbox"},u=["url","mailto","tel","internal"],d=(e,t)=>({role:"option",tabIndex:"-1",id:`${s}-${t}`,"aria-selected":t===a});return n&&o.length?(0,_o.jsx)("div",{className:"kb-search-selection-list",children:(0,_o.jsx)("div",{...c,className:Bc()("kb-search-selection-suggestions",`${t}__suggestions`),children:o.map((t,n)=>(0,e.createElement)(yo.Button,{...d(0,n),key:t.id,className:Bc()("kb-search-selection-suggestion",{"is-selected":n===a}),onClick:()=>this.handleOnClick(t)},u.includes(t.type.toLowerCase())&&(0,_o.jsx)(Icon,{className:"block-editor-link-control__search-item-icon",icon:of}),(0,_o.jsxs)("span",{className:"kb-search-selection-search-item-header",children:[(0,_o.jsx)("span",{className:"kb-search-selection-search-item-title",children:(0,_o.jsx)(af,{text:t.title,highlight:l})}),(0,_o.jsxs)("span",{"aria-hidden":!u.includes(t.type.toLowerCase()),className:"kb-search-selection-search-item-info",children:[!u.includes(t.type.toLowerCase())&&((0,hc.filterURLForDisplay)((0,hc.safeDecodeURI)(t.url))||""),u.includes(t.type.toLowerCase())&&(0,Mo.__)("Press ENTER to add this link")]})]}),(0,_o.jsx)("span",{className:"kb-search-selection-search-item-type",children:"post_tag"===t.type?"tag":t.type})))})}):null}}const sf=(0,_c.compose)(_c.withSafeTimeout,_c.withInstanceId)(rf);class lf extends ko.Component{constructor(){super(...arguments),this.state={isEditingLink:!1,isSettingsExpanded:!1,urlInput:null}}render(){const{label:e,onChangeUrl:t,url:n,additionalControls:o=!0,opensInNewTab:a,onChangeTarget:r,linkNoFollow:s,onChangeFollow:i,linkSponsored:l,onChangeSponsored:c,linkDownload:u,onChangeDownload:d,linkTitle:p,onChangeTitle:h,changeTargetType:f=!1,allowClear:b=!1,dynamicAttribute:m=""}=this.props,{urlInput:g,isEditingLink:v,isSettingsExpanded:x}=this.state,k=e=>{r(e)},y=(0,_o.jsxs)(ko.Fragment,{children:[r&&(0,_o.jsxs)(ko.Fragment,{children:[f&&(0,_o.jsxs)(ko.Fragment,{children:[(0,_o.jsx)(yo.SelectControl,{label:(0,Mo.__)("Link Target","kadence-blocks"),value:a,options:[{value:"_self",label:(0,Mo.__)("Same Tab/Window","kadence-blocks")},{value:"_blank",label:(0,Mo.__)("Open in New Tab","kadence-blocks")},{value:"video",label:(0,Mo.__)("Video Popup","kadence-blocks")}],onChange:k}),"video"===a&&(0,_o.jsx)("p",{children:(0,Mo.__)("NOTE: Video popup only works with youtube and vimeo links.","kadence-blocks")})]}),!f&&(0,_o.jsx)(yo.ToggleControl,{label:(0,Mo.__)("Open in New Tab","kadence-blocks"),onChange:k,checked:a})]}),i&&(0,_o.jsx)(yo.ToggleControl,{label:(0,Mo.__)("No Follow","kadence-blocks"),onChange:e=>{i(e)},checked:s}),c&&(0,_o.jsx)(yo.ToggleControl,{label:(0,Mo.__)("Sponsored","kadence-blocks"),onChange:e=>{c(e)},checked:l}),d&&(0,_o.jsx)(yo.ToggleControl,{label:(0,Mo.__)("Download","kadence-blocks"),onChange:e=>{d(e)},checked:u}),h&&(0,_o.jsx)(yo.TextControl,{label:(0,Mo.__)("Title","kadence-blocks"),onChange:e=>{h(e)},value:p})]}),_=null!==g?g:n;return(0,_o.jsx)(yo.Popover,{className:"kb-popover-link-popover",position:"bottom center",children:(0,_o.jsx)("div",{className:"components-base-control kb-popover-link-control kb-side-link-control"+(m&&kadence_blocks_params.dynamic_enabled?" has-dynamic-support":""),children:(0,_o.jsx)(sf,{url:_,onChange:e=>(e=>{t(e)})(e),attributes:this.props.attributes,dynamicAttribute:m,additionalControls:o,advancedOptions:y,isSettingsExpanded:x,onExpandSettings:()=>{this.setState({isSettingsExpanded:!x})},allowClear:b,...this.props})})})}}const cf=lf;class uf extends ko.Component{constructor(){super(...arguments),this.state={isEditingLink:!1,isSettingsExpanded:!1,urlInput:null}}render(){const{label:e,onChangeUrl:t,url:n,additionalControls:o=!0,opensInNewTab:a,onChangeTarget:r,linkNoFollow:s,onChangeFollow:i,linkSponsored:l,onChangeSponsored:c,linkDownload:u,onChangeDownload:d,linkTitle:p,onChangeTitle:h,onChangeLinkClass:f,linkClass:b,changeTargetType:m=!1,allowClear:g=!1,dynamicAttribute:v=""}=this.props,{urlInput:x,isEditingLink:k,isSettingsExpanded:y}=this.state,_=e=>{r(e)},w=(0,_o.jsxs)(ko.Fragment,{children:[r&&(0,_o.jsxs)(ko.Fragment,{children:[m&&(0,_o.jsxs)(ko.Fragment,{children:[(0,_o.jsx)(yo.SelectControl,{label:(0,Mo.__)("Link Target","kadence-blocks"),value:a,options:[{value:"_self",label:(0,Mo.__)("Same Tab/Window","kadence-blocks")},{value:"_blank",label:(0,Mo.__)("Open in New Tab","kadence-blocks")},{value:"video",label:(0,Mo.__)("Video Popup","kadence-blocks")}],onChange:_}),"video"===a&&(0,_o.jsx)("p",{children:(0,Mo.__)("NOTE: Video popup only works with youtube and vimeo links.","kadence-blocks")})]}),!m&&(0,_o.jsx)(yo.ToggleControl,{label:(0,Mo.__)("Open in New Tab","kadence-blocks"),onChange:_,checked:a})]}),i&&(0,_o.jsx)(yo.ToggleControl,{label:(0,Mo.__)("No Follow","kadence-blocks"),onChange:e=>{i(e)},checked:s}),c&&(0,_o.jsx)(yo.ToggleControl,{label:(0,Mo.__)("Sponsored","kadence-blocks"),onChange:e=>{c(e)},checked:l}),d&&(0,_o.jsx)(yo.ToggleControl,{label:(0,Mo.__)("Download","kadence-blocks"),onChange:e=>{d(e)},checked:u}),f&&(0,_o.jsx)(yo.TextControl,{label:(0,Mo.__)("Link CSS Class","kadence-blocks"),onChange:e=>{f(e)},value:b})]});return(0,_o.jsxs)("div",{className:"components-base-control kb-side-link-control"+(v&&kadence_blocks_params.dynamic_enabled?" has-dynamic-support":""),children:[e&&(0,_o.jsx)("label",{className:"components-base-control__label",children:e}),(0,_o.jsx)(sf,{url:n,onChange:e=>(e=>{t(e)})(e),attributes:this.props.attributes,dynamicAttribute:v,additionalControls:o,advancedOptions:w,isSettingsExpanded:y,onExpandSettings:()=>{this.setState({isSettingsExpanded:!y})},allowClear:g,...this.props}),h&&(0,_o.jsx)(yo.TextControl,{label:(0,Mo.__)("Title","kadence-blocks"),onChange:e=>{h(e)},value:p,style:n&&!p?{backgroundColor:"rgba(255, 255, 0, 0.5)"}:{},placeholder:n&&!p?(0,Mo.__)("Add a Title","kadence-blocks"):""})]})}}const df=uf,pf=e=>e.map((e,t)=>{const{nE:n,aBs:o,children:a=null}=e,r=Object.keys(o).filter(e=>"fill"!==e&&"stroke"!==e&&"none"!==o[e]).reduce((e,t)=>(e[t]=o[t],e),{});let s={};return"none"===o.fill&&o.stroke&&(s={fill:"none",stroke:"currentColor"}),(0,ko.createElement)(n,{key:t,...r,...s},null===a?a:pf(a))}),hf=e=>{const{style:t,className:n,icon:o,name:a,htmltag:r,...s}=e,i=a.substring(0,2),l=a.substring(0,3),c=!(!i||"fe"!=i),u=c?"none":"currentColor",d=c?e.strokeWidth:void 0,p=c?"currentColor":void 0,h=c?"round":void 0,f=c?"round":void 0,b=e.ariaHidden?"true":void 0,m=r||"div",g=!(!e.icon||!e.icon.vB)&&e.icon.vB.split(" ");return(0,_o.jsx)(m,{style:{display:"inline-flex",justifyContent:"center",alignItems:"center",...t},className:`${n} ${0===e.size?"kb-icon-transparent":""}`,children:(0,_o.jsxs)("svg",{style:{display:"inline-block",verticalAlign:"middle"},viewBox:e.icon?e.icon.vB:"0 0 24 24",height:0===e.size?"24":e.size,width:0===e.size?"24":e.size,fill:u,stroke:p,xmlns:e.xmlns,preserveAspectRatio:l&&"fas"!==l&&"fe_"!==l&&"ic_"!==l&&g&&(void 0!==g[0]&&0!==g[0]||void 0!==g[1]&&0!==g[1])?"xMinYMin meet":void 0,"stroke-width":d,"stroke-linecap":h,"stroke-linejoin":f,"aria-hidden":b,children:[e.title?(0,_o.jsx)("title",{children:e.title}):null,e.icon&&pf(e.icon.cD)]})})};hf.defaultProps={size:24,xmlns:"http://www.w3.org/2000/svg",strokeWidth:2,htmltag:"div"},hf.propTypes={icon:S().object.isRequired,size:S().oneOfType([S().number,S().string]),style:S().object,className:S().string};const ff=hf;class bf extends ko.Component{constructor(){super(...arguments),this.updateIcons=this.updateIcons.bind(this),this.getCustomSvg=this.getCustomSvg.bind(this),this.state={iconOptions:void 0,isLoading:!1,customSvg:""}}componentDidMount(){const e={...kadence_blocks_params_ico.icons,...kadence_blocks_params_fa.icons,...kadence_blocks_params_kbcustomicons.icons};this.setState({iconOptions:(0,hp.applyFilters)("kadence.icon_options",e)}),this.props.name.startsWith("kb-custom")&&this.getCustomSvg(this.props.name.replace("kb-custom-",""))}componentDidUpdate(e,t,n){this.props.name!==e.name&&this.props.name.startsWith("kb-custom")&&this.getCustomSvg(this.props.name.replace("kb-custom-",""))}getCustomSvg=async e=>{try{const t=localStorage.getItem(`kb-custom-${e}`);if(t)return void this.setState({customSvg:JSON.parse(t)});this.setState({isLoading:!0});const n=await(async e=>{const t=await fetch(kadence_blocks_params.rest_url+`wp/v2/kadence_custom_svg/${e}`,{method:"GET"});if(!t.ok)throw new Error("Network response was not ok");return t.json()})(e);if(n){const t=n.content.rendered.replace("<p>","").replace("</p>","").replace(/&#8220;/g,'"').replace(/&#8221;/g,'"').replace(/&#8222;/g,'"').replace(/&#8243;/g,'"'),o=JSON.parse(t);localStorage.setItem(`kb-custom-${e}`,JSON.stringify(o)),this.setState({customSvg:o})}else this.setState({customSvg:""})}catch(e){this.setState({customSvg:""}),console.error("Failed to fetch custom SVGs:",e)}this.setState({isLoading:!1})};updateIcons(){const e={...kadence_blocks_params_ico.icons,...kadence_blocks_params_fa.icons,...kadence_blocks_params_kbcustomicons.icons};return(0,hp.applyFilters)("kadence.icon_options",e)}render(){const{name:e}=this.props;let{iconOptions:t,isLoading:n,customSvg:o}=this.state;return t||(t=this.updateIcons()),e.startsWith("kb-custom")&&n?(0,_o.jsx)(yo.Spinner,{}):e.startsWith("kb-custom")&&""!==o?(0,_o.jsx)(ff,{name:e,icon:o,...this.props}):(0,_o.jsx)(ff,{name:e,icon:t[e],...this.props})}}const mf=bf;function gf({name:e,title:t,extraClass:n,strokeWidth:o=!1,tooltipID:a="",tooltipPlacement:r=""}){return(0,_o.jsx)("span",{"data-name":e,"data-stroke":o||void 0,"data-title":t?t.replace(/ /g,"_"):void 0,"data-class":n?n.replace(/ /g,"_"):void 0,"data-tooltip-id":a||void 0,"data-tooltip-placement":a&&r?r:void 0,className:"kadence-dynamic-icon"})}function vf({label:e,onChange:t,value:n="",defaultValue:o="",className:a="",step:r=1,max:s=100,min:i=0,beforeIcon:l="",help:c="",unit:u="",onUnit:d,showUnit:p=!1,lockUnits:h=!1,units:f=["px","em","rem"],reset:b,initialPosition:m}){return[t&&(0,_o.jsxs)("div",{className:"components-base-control kadence-range-control"+(a?" "+a:""),children:[(0,_o.jsx)("div",{className:"kadence-title-bar",children:e&&(0,_o.jsxs)("span",{className:"kadence-control-title",children:[e,b&&(0,_o.jsx)(yo.Button,{className:"is-reset is-single",isSmall:!0,disabled:(0,Oo.isEqual)(n,o),icon:kd,onClick:()=>{"function"==typeof b?b():t(o)}})]})}),(0,_o.jsxs)("div",{className:"kadence-controls-content",children:[(0,_o.jsx)("div",{className:"kadence-range-control-inner",children:(0,_o.jsx)(yo.RangeControl,{className:"kadence-range-control-range",beforeIcon:l,value:n,onChange:e=>t(e),min:i,max:s,step:r,help:c,allowReset:!0,initialPosition:m})}),(d||p)&&(0,_o.jsx)("div",{className:"kadence-units kadence-measure-control-select-wrapper",children:(0,_o.jsx)("select",{className:"kadence-measure-control-select components-unit-control__select",onChange:e=>{d&&d(e.target.value)},value:u,disabled:1===f.length||h,children:f.map((e,t)=>(0,_o.jsx)("option",{value:e,children:e},t))})})]})]})]}function xf({label:e,placement:t="top",measurement:n,onChange:o,step:a=1,max:r=100,min:s=0,icon:i,unit:l="",allowEmpty:c=!1,className:u="",preset:d=""}){const[p,h]=function(){const[e,t]=(0,ko.useState)(!1);return[e,e=>{t(e)}]}();return(0,_o.jsxs)("div",{className:`measure-input-wrap measure-input-${t}`,children:[(0,_o.jsxs)("div",{className:"input-setting-toggle",children:[(0,_o.jsx)(yo.Button,{isSmall:!0,className:"input-setting-toggle-btn",disabled:!(!n||"auto"!=n),tabIndex:"-1",onClick:n&&"auto"==n?"":function(){h(!p)},children:e}),p&&(0,_o.jsxs)(yo.Popover,{onClose:function(){h(!1)},className:"kadence-range-popover-settings",children:[(0,_o.jsx)(vf,{beforeIcon:i,value:void 0!==n?n:"",onChange:e=>o(e?parseFloat(e):e),min:s,max:r,step:a}),""!==l||d&&Array.isArray(d)&&d.length>1&&(0,_o.jsx)(yo.ButtonGroup,{className:"kb-preset-size-options","aria-label":(0,Mo.__)("Choose a Preset Size","kadence-blocks"),children:(0,Oo.map)(d&&Array.isArray(d)&&d.length>1?d:{px:[0,10,20,40,60,80,100,140,160,200],em:[0,.5,1,1.5,2,2.5,3,3.5,4,4.5],rem:[0,.5,1,1.5,2,2.5,3,3.5,4,4.5],"%":[0,2,5,8,10,20,30,40,50,60],vh:[0,2,5,8,10,20,30,40,50,60],vw:[0,2,5,8,10,20,30,40,50,60]}[l],e=>(0,_o.jsx)(yo.Button,{className:"kb-preset-sizes",isSmall:!0,onClick:()=>o(parseFloat(e)),children:e},e))})]})]}),(0,_o.jsx)(yo.TextControl,{label:e,hideLabelFromVision:!0,type:"number",className:"measure-inputs",disabled:!(!n||"auto"!=n),placeholder:n&&"auto"==n?(0,Mo.__)("auto","kadence-blocks"):void 0,value:void 0!==n?n:"",onChange:e=>o(e?Number(e):e),min:s,max:r,step:a}),(0,_o.jsx)("span",{className:"measure-label",children:i})]})}function kf({label:e,measurement:t,control:n="individual",onChange:o,onControl:a=!1,step:r=1,max:s=100,min:i=0,firstIcon:l=tu.outlineTopIcon,secondIcon:c=tu.outlineRightIcon,thirdIcon:u=tu.outlineBottomIcon,fourthIcon:d=tu.outlineLeftIcon,linkIcon:p=fd,unlinkIcon:h=bd,isBorderRadius:f=!1,unit:b="",onUnit:m,showUnit:g=!1,units:v=["px","em","rem"],allowEmpty:x=!1,key:k,className:y="",reset:_,preset:w=""}){const C={first:f?tu.topLeftIcon:l,second:f?tu.topRightIcon:c,third:f?tu.bottomRightIcon:u,fourth:f?tu.bottomLeftIcon:d,link:f?tu.radiusLinkedIcon:p,unlink:f?tu.radiusIndividualIcon:h},j=t||["","","",""],S=x?"":0,[N,O]=(0,ko.useState)(n),E=a?n:N,M=a||O;return(0,_o.jsx)(_o.Fragment,{children:o&&(0,_o.jsxs)("div",{className:`components-base-control kb-measure-control ${C.first!==tu.outlineTopIcon?"kb-measure-corners-control":"kb-measure-sides-control"}${""!==y?" "+y:""}`,children:[e&&(0,_o.jsxs)("div",{className:"kadence-component__header kadence-title-bar",children:[e&&(0,_o.jsxs)("div",{className:"kadence-component__header__title kadence-measure-control__title",children:[(0,_o.jsx)("label",{className:"components-base-control__label",children:e}),_&&(0,_o.jsx)("div",{className:"title-reset-wrap",children:(0,_o.jsx)(yo.Button,{className:"is-reset is-single",label:"reset",isSmall:!0,disabled:!(!(0,Oo.isEqual)(["","","",""],j)&&!(0,Oo.isEqual)(["","auto","","auto"],j)),icon:kd,onClick:()=>{"function"==typeof _?_():o(["","","",""])}})})]}),M&&(0,_o.jsx)(yo.Button,{isSmall:!0,className:"kadence-radio-item kadence-control-toggle radio-custom is-single only-icon",label:"individual"!==E?(0,Mo.__)("Individual","kadence-blocks"):(0,Mo.__)("Linked","kadence-blocks"),icon:"individual"!==E?p:h,onClick:()=>M("individual"!==E?"individual":"linked"),isPressed:"individual"!==E,isTertiary:"individual"===E})]}),(0,_o.jsxs)("div",{className:"kadence-controls-content",children:["individual"!==E&&(0,_o.jsx)(vf,{value:t?t[0]:"",onChange:e=>o([e,e,e,e]),min:i,max:s,step:r}),"individual"===E&&(0,_o.jsxs)(ko.Fragment,{children:[(0,_o.jsx)(xf,{placement:"top",label:(0,Mo.__)("Top","kadence-blocks"),measurement:t?t[0]:"",onChange:e=>o([e?Number(e):e,t&&void 0!==t[1]&&""!==t[1]?t[1]:S,t&&void 0!==t[2]&&""!==t[2]?t[2]:S,t&&void 0!==t[3]&&""!==t[3]?t[3]:S]),min:i,max:s,step:r,icon:C.first,unit:b,allowEmpty:x,preset:w}),(0,_o.jsx)(xf,{placement:"right",label:(0,Mo.__)("Right","kadence-blocks"),measurement:t?t[1]:"",onChange:e=>o([t&&void 0!==t[0]&&""!==t[0]?t[0]:S,e?Number(e):e,t&&void 0!==t[2]&&""!==t[2]?t[2]:S,t&&void 0!==t[3]&&""!==t[3]?t[3]:S]),min:i,max:s,step:r,icon:C.second,unit:b,allowEmpty:x,preset:w}),(0,_o.jsx)(xf,{placement:"bottom",label:(0,Mo.__)("Bottom","kadence-blocks"),measurement:t?t[2]:"",onChange:e=>o([t&&void 0!==t[0]&&""!==t[0]?t[0]:S,t&&void 0!==t[1]&&""!==t[1]?t[1]:S,e?Number(e):e,t&&void 0!==t[3]&&""!==t[3]?t[3]:S]),min:i,max:s,step:r,icon:C.third,unit:b,allowEmpty:x,preset:w}),(0,_o.jsx)(xf,{placement:"left",label:(0,Mo.__)("Left","kadence-blocks"),measurement:t?t[3]:"",onChange:e=>o([t&&void 0!==t[0]&&""!==t[0]?t[0]:S,t&&void 0!==t[1]&&""!==t[1]?t[1]:S,t&&void 0!==t[2]&&""!==t[2]?t[2]:S,e?Number(e):e]),min:i,max:s,step:r,icon:C.fourth,unit:b,allowEmpty:x,preset:w})]}),(m||g)&&(0,_o.jsx)("div",{className:"kadence-measure-control-select-wrapper",children:(0,_o.jsx)("select",{className:"kadence-measure-control-select components-unit-control__select",onChange:e=>{m&&m(e.target.value)},value:b,children:v.map(e=>(0,_o.jsx)("option",{value:e,selected:b===e||void 0,children:e},e))})})]})]},k)})}class yf extends ko.Component{constructor(){super(...arguments),this.state={typographyOptions:[],typographySelectOptions:[],typographyWeights:[],typographyStyles:[],typographySubsets:""}}componentDidMount(){const e="undefined"!=typeof kadence_blocks_params&&kadence_blocks_params.g_font_names?kadence_blocks_params.g_font_names.map(e=>({label:e,value:e,google:!0})):{};let t=[{type:"group",label:(0,Mo.__)("Standard Fonts","kadence-blocks"),options:[{label:"System Default",value:'-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',google:!1},{label:"Arial, Helvetica, sans-serif",value:"Arial, Helvetica, sans-serif",google:!1},{label:'"Arial Black", Gadget, sans-serif',value:'"Arial Black", Gadget, sans-serif',google:!1},{label:"Helvetica, sans-serif",value:"Helvetica, sans-serif",google:!1},{label:'"Comic Sans MS", cursive, sans-serif',value:'"Comic Sans MS", cursive, sans-serif',google:!1},{label:"Impact, Charcoal, sans-serif",value:"Impact, Charcoal, sans-serif",google:!1},{label:'"Lucida Sans Unicode", "Lucida Grande", sans-serif',value:'"Lucida Sans Unicode", "Lucida Grande", sans-serif',google:!1},{label:"Tahoma, Geneva, sans-serif",value:"Tahoma, Geneva, sans-serif",google:!1},{label:'"Trebuchet MS", Helvetica, sans-serif',value:'"Trebuchet MS", Helvetica, sans-serif',google:!1},{label:"Verdana, Geneva, sans-serif",value:"Verdana, Geneva, sans-serif",google:!1},{label:"Georgia, serif",value:"Georgia, serif",google:!1},{label:'"Palatino Linotype", "Book Antiqua", Palatino, serif',value:'"Palatino Linotype", "Book Antiqua", Palatino, serif',google:!1},{label:'"Times New Roman", Times, serif',value:'"Times New Roman", Times, serif',google:!1},{label:"Courier, monospace",value:"Courier, monospace",google:!1},{label:'"Lucida Console", Monaco, monospace',value:'"Lucida Console", Monaco, monospace',google:!1}]},{type:"group",label:(0,Mo.__)("Google Fonts","kadence-blocks"),options:e}];if("undefined"!=typeof kadence_blocks_params&&kadence_blocks_params.c_fonts){const e=[];Object.keys(kadence_blocks_params.c_fonts).forEach(function(t){const n=kadence_blocks_params.c_fonts[t].name,o=kadence_blocks_params.c_fonts[t].label?kadence_blocks_params.c_fonts[t].label:n,a=[];Object.keys(kadence_blocks_params.c_fonts[t].weights).forEach(function(e){a.push({value:kadence_blocks_params.c_fonts[t].weights[e],label:kadence_blocks_params.c_fonts[t].weights[e]})});const r=[];Object.keys(kadence_blocks_params.c_fonts[t].styles).forEach(function(e){r.push({value:kadence_blocks_params.c_fonts[t].weights[e],label:kadence_blocks_params.c_fonts[t].weights[e]})}),e.push({label:o,value:n,google:!1,weights:a,styles:r})}),t=[{type:"group",label:(0,Mo.__)("Custom Fonts","kadence-blocks"),options:e}].concat(t)}if("undefined"!=typeof kadence_blocks_params&&kadence_blocks_params?.isKadenceT){const e=[{label:"Inherit Heading Font Family",value:"var( --global-heading-font-family, inherit )",google:!1},{label:"Inherit Body Font Family",value:"var( --global-body-font-family, inherit )",google:!1}];t=[{type:"group",label:(0,Mo.__)("Theme Global Fonts","kadence-blocks"),options:e}].concat(t)}let n=(0,hp.applyFilters)("kadence.typography_options",t),o=[].concat.apply([],n.map(e=>e.options));const a=kadence_blocks_params.configuration?JSON.parse(kadence_blocks_params.configuration):[];void 0!==a["kadence/typography"]&&"object"==typeof a["kadence/typography"]&&(void 0===a["kadence/typography"].showAll||a["kadence/typography"].showAll||(n=a["kadence/typography"].choiceArray,o=a["kadence/typography"].choiceArray)),this.setState({typographyOptions:n}),this.setState({typographySelectOptions:o}),this.setTypographyOptions(o)}componentDidUpdate(e){this.props.fontFamily!==e.fontFamily&&this.setTypographyOptions(this.state.typographySelectOptions)}setTypographyOptions(e){let t=[{value:"inherit",label:(0,Mo.__)("Inherit","kadence-blocks")},{value:"400",label:(0,Mo.__)("Normal","kadence-blocks")},{value:"bold",label:(0,Mo.__)("Bold","kadence-blocks")}];const n=[{value:"inherit",label:(0,Mo.__)("Inherit","kadence-blocks")},{value:"100",label:(0,Mo.__)("Thin 100","kadence-blocks")},{value:"200",label:(0,Mo.__)("Extra-Light 200","kadence-blocks")},{value:"300",label:(0,Mo.__)("Light 300","kadence-blocks")},{value:"400",label:(0,Mo.__)("Regular","kadence-blocks")},{value:"500",label:(0,Mo.__)("Medium 500","kadence-blocks")},{value:"600",label:(0,Mo.__)("Semi-Bold 600","kadence-blocks")},{value:"700",label:(0,Mo.__)("Bold 700","kadence-blocks")},{value:"800",label:(0,Mo.__)("Extra-Bold 800","kadence-blocks")},{value:"900",label:(0,Mo.__)("Ultra-Bold 900","kadence-blocks")}],o=!("undefined"==typeof kadence_blocks_params||!kadence_blocks_params.isKadenceT),a="undefined"!=typeof kadence_blocks_params&&kadence_blocks_params.headingWeights?kadence_blocks_params.headingWeights:[],r="undefined"!=typeof kadence_blocks_params&&kadence_blocks_params.bodyWeights?kadence_blocks_params.bodyWeights:[],s="undefined"!=typeof kadence_blocks_params&&kadence_blocks_params.buttonWeights?kadence_blocks_params.buttonWeights:[];o&&"heading"===this.props.fontGroup&&a&&Array.isArray(a)&&a.length&&(t=a),o&&"body"===this.props.fontGroup&&r&&Array.isArray(r)&&r.length&&(t=r),o&&"button"===this.props.fontGroup&&s&&Array.isArray(s)&&s.length&&(t=s);const i=[{value:"normal",label:(0,Mo.__)("Normal","kadence-blocks")},{value:"italic",label:(0,Mo.__)("Italic","kadence-blocks")}],l=e?e.filter(({value:e})=>e===this.props.fontFamily):"";let c=t,u=i,d="";l&&l[0]&&(void 0!==l[0].weights&&(c=l[0].weights),void 0!==l[0].styles&&(u=l[0].styles)),'-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"'===this.props.fontFamily?c=n:"var( --global-heading-font-family, inherit )"===this.props.fontFamily?c=a:"var( --global-body-font-family, inherit )"===this.props.fontFamily?c=r:this.props.googleFont&&this.props.fontFamily&&"undefined"!=typeof kadence_blocks_params&&kadence_blocks_params.g_fonts&&kadence_blocks_params.g_fonts[this.props.fontFamily]&&(c=kadence_blocks_params.g_fonts[this.props.fontFamily].w.map(e=>({label:(0,No.capitalizeFirstLetter)(e),value:e})),u=kadence_blocks_params.g_fonts[this.props.fontFamily].i.map(e=>({label:(0,No.capitalizeFirstLetter)(e),value:e})),d=kadence_blocks_params.g_fonts[this.props.fontFamily].s.map(e=>({label:(0,No.capitalizeFirstLetter)(e),value:e}))),this.setState({typographyWeights:c}),this.setState({typographyStyles:u}),this.setState({typographySubsets:d}),this.setState({fontFamilyValue:l})}render(){const{tagLevel:e,label:t,htmlTag:n="heading",tagLowLevel:o=1,tagHighLevel:a=7,lineHeight:r,lineHeightType:s="",fontSize:i,fontSizeType:l="px",googleFont:c,loadGoogleFont:u,fontFamily:d,fontVariant:p,fontWeight:h,fontStyle:f,fontSubset:b,letterSpacing:m,margin:g,marginControl:v,padding:x,paddingControl:k,onTagLevel:y,onTagLevelHTML:_,onLineHeight:w,onFontSize:C,onFontFamily:j,onFontVariant:S,onFontWeight:N,onFontStyle:O,onFontSubset:E,onFontChange:M,onFontArrayChange:T,onLoadGoogleFont:R,onGoogleFont:I,onLetterSpacing:P,onFontSizeType:L,onLineHeightType:A,onPadding:D,onPaddingControl:F,onMargin:V,onMarginControl:B,loadItalic:z,onLoadItalic:H,textTransform:U,onTextTransform:G,reLetterSpacing:$=!1,letterSpacingType:W="px",otherTags:q=[],onLetterSpacingType:X,reset:J,defaultValue:K={size:["","",""],sizeType:"px",lineHeight:["","",""],lineType:"px",letterSpacing:["","",""],letterType:"px",textTransform:"",family:"",google:!1,style:"",weight:"",variant:"",subset:"",loadGoogle:!0}}=this.props,{controlSize:Y,typographySelectOptions:Z,typographyOptions:Q,typographySubsets:ee,typographyStyles:te,typographyWeights:ne,fontFamilyValue:oe}=this.state,ae={size:i,sizeType:l,lineHeight:r,lineType:s,letterSpacing:m,letterType:W,textTransform:U,family:d,google:c,style:f,weight:h,variant:p,subset:b,loadGoogle:u},re=(0,Oo.range)(o,a).map(t=>[{icon:(0,_o.jsx)(yc,{level:t,isPressed:!(1!==e||!n||"heading"!==n)}),title:(0,Mo.sprintf)(/* translators: %d: heading level e.g: "1", "2", "3" */ /* translators: %d: heading level e.g: "1", "2", "3" */
    4242(0,Mo.__)("Heading %d","kadence-blocks"),t),isActive:!(t!==e||!n||"heading"!==n),onClick:()=>_(t,"heading")}]);q.p&&re.push([{icon:(0,_o.jsx)(yc,{level:"p",isPressed:!(!n||"p"!==n)}),title:(0,Mo.__)("Paragraph","kadence-blocks"),isActive:!(!n||"p"!==n),onClick:()=>_(2,"p")}]),q.span&&re.push([{icon:(0,_o.jsx)(yc,{level:"span",isPressed:!(!n||"span"!==n)}),title:(0,Mo.__)("Span","kadence-blocks"),isActive:!(!n||"span"!==n),onClick:()=>_(2,"span")}]),q.div&&re.push([{icon:(0,_o.jsx)(yc,{level:"div",isPressed:!(!n||"div"!==n)}),title:(0,Mo.__)("Div","kadence-blocks"),isActive:!(!n||"div"!==n),onClick:()=>_(2,"div")}]);const se=()=>{T?T({google:!1,family:"",variant:"",weight:"inherit",style:"normal",subset:""}):(I(!1),j(""),S(""),N("inherit"),O("normal"),E(""))},ie=[{value:"none",label:(0,Mo.__)("-","kadence-blocks"),tooltip:(0,Mo.__)("None","kadence-blocks")},{value:"uppercase",label:(0,Mo.__)("AB","kadence-blocks"),tooltip:(0,Mo.__)("Uppercase","kadence-blocks")},{value:"lowercase",label:(0,Mo.__)("ab","kadence-blocks"),tooltip:(0,Mo.__)("Lowercase","kadence-blocks")},{value:"capitalize",label:(0,Mo.__)("Ab","kadence-blocks"),tooltip:(0,Mo.__)("Capitalize","kadence-blocks")}],le="px"!==l?120:3e3,ce="px"!==l?.001:1,ue="px"!==s?.2:5,de="px"!==s?120:3e3,pe="px"!==s?.001:1,he=ne.some(function(e){return"regular"===e.value});return(0,_o.jsx)(_o.Fragment,{children:(0,_o.jsxs)("div",{className:"components-base-control kb-typography-control",children:[t&&(0,_o.jsx)("div",{className:"kadence-title-bar kadence-component__header",children:(0,_o.jsx)("label",{className:"kadence-heading-fontfamily-title components-typography-control__label kadence-component__header__title",children:t})}),(0,_o.jsxs)("div",{className:"kadence-title-bar",children:[t&&(0,_o.jsx)("h2",{className:"kt-heading-fontfamily-title",children:t}),J&&(0,_o.jsx)(Button,{className:"is-reset is-single",isSmall:!0,disabled:!!isEqual(ae,K),icon:undo,onClick:()=>{"function"==typeof J?J():T(K)}})]}),y&&(0,_o.jsxs)(_o.Fragment,{children:[_&&(0,_o.jsx)(ip,{label:(0,Mo.__)("HTML Tag","kadence-blocks"),value:"heading"===n?e:n,onChange:e=>{"div"===e||"p"===e||"span"===e?_(2,e):_(e,"heading")}}),!_&&(0,_o.jsx)(ip,{label:(0,Mo.__)("HTML Tag","kadence-blocks"),value:e,headingOnly:!0,tagHighLevel:a,tagLowLevel:o,onChange:e=>{y(e)}})]}),C&&L&&(0,_o.jsx)(ep,{label:(0,Mo.__)("Font Size","kadence-blocks"),value:i&&void 0!==i[0]?i[0]:"",onChange:e=>C([e,i&&void 0!==i[1]?i[1]:"",i&&void 0!==i[2]?i[2]:""]),tabletValue:i&&void 0!==i[1]?i[1]:"",onChangeTablet:e=>C([i&&void 0!==i[0]?i[0]:"",e,i&&void 0!==i[2]?i[2]:""]),mobileValue:i&&void 0!==i[2]?i[2]:"",onChangeMobile:e=>C([i&&void 0!==i[0]?i[0]:"",i&&void 0!==i[1]?i[1]:"",e]),min:0,max:le,step:ce,unit:l||"px",onUnit:e=>L(e),units:["px","em","rem","vw"]}),!G&&w&&A&&(0,_o.jsx)(np,{label:(0,Mo.__)("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:s||"-",onUnit:e=>A(e),units:["-","px","em","rem"]}),G&&w&&A&&(0,_o.jsxs)(Hh,{className:"kb-font-settings",children:[(0,_o.jsx)(np,{label:(0,Mo.__)("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:s||"-",onUnit:e=>A(e),units:["-","px","em","rem"],compressedDevice:!0}),(0,_o.jsx)(wc,{label:(0,Mo.__)("Letter Case","kadence-blocks"),value:U,options:ie,className:"kb-letter-case",allowClear:!0,onChange:e=>G(e)})]}),G&&(!w||!A)&&(0,_o.jsx)(wc,{label:(0,Mo.__)("Letter Case","kadence-blocks"),value:U,options:ie,className:"kb-letter-case",allowClear:!0,onChange:e=>G(e)}),j&&se&&(0,_o.jsxs)(_o.Fragment,{children:[(0,_o.jsxs)("div",{className:"components-base-control",children:[(0,_o.jsx)("div",{className:"kadence-component__header kadence-title-bar",children:(0,_o.jsx)("label",{className:"kadence-control-title kadence-component__header__title",children:(0,Mo.__)("Font Family","kadence-blocks")})}),(0,_o.jsx)("div",{className:"typography-family-select-form-row",children:(0,_o.jsx)(pc,{options:Q,value:oe,classNamePrefix:"kb-react-select",isMulti:!1,maxMenuHeight:300,isClearable:!0,placeholder:(0,Mo.__)("Select a font family","kadence-blocks"),onChange:e=>{if(null===e)se();else{let t,n,o;e.google?(t="undefined"!=typeof kadence_blocks_params&&kadence_blocks_params.g_fonts&&!kadence_blocks_params.g_fonts[e.value].v.includes("regular")?kadence_blocks_params.g_fonts[e.value].v[0]:"regular",n="undefined"!=typeof kadence_blocks_params&&kadence_blocks_params.g_fonts&&!kadence_blocks_params.g_fonts[e.value].w.includes("regular")?kadence_blocks_params.g_fonts[e.value].w[0]:"400",o="undefined"!=typeof kadence_blocks_params&&kadence_blocks_params.g_fonts&&kadence_blocks_params.g_fonts[e.value].s.length>1?"latin":""):(o="",t="",n=void 0!==e.weights?.[0]?.value?e.weights[0].value:"inherit"),T?T({google:e.google,family:e.value,variant:t,weight:n,style:"normal",subset:o}):(M(e),S(t),N(n),O("normal"),E(o))}},styles:{control:(e,t)=>({...e,borderColor:"rgb(30, 30, 30)",borderRadius:"2px",":hover":{borderColor:"rgb(30, 30, 30)"}})}})})]}),N&&(0,_o.jsx)(yo.SelectControl,{label:(0,Mo.__)("Font Weight","kadence-blocks"),value:"400"===h&&he?"regular":h,options:ne,onChange:e=>{if(c){let t;t="italic"===f?"regular"===e?"italic":e+"italic":e,T?T({variant:t,weight:"regular"===e?"400":e}):(S(t),N("regular"===e?"400":e))}else T?T({variant:"",weight:"regular"===e?"400":e}):(S(""),N("regular"===e?"400":e))},className:"kb-select-style"}),d&&O&&(0,_o.jsx)(yo.SelectControl,{label:(0,Mo.__)("Font Style","kadence-blocks"),value:f,options:te,onChange:e=>{if(c){let t;t="italic"===e?h&&"regular"!==h?h+"italic":"italic":h||"regular",T?T({variant:t,style:e}):(S(t),O(e))}else T?T({variant:"",style:e}):(S(""),O(e))},className:"kb-select-style"}),d&&c&&R&&(0,_o.jsx)(yo.ToggleControl,{label:(0,Mo.__)("Load Google Font on Frontend","kadence-blocks"),checked:u,onChange:R}),d&&c&&u&&O&&"normal"===f&&H&&void 0!==te[1]&&void 0!==te[1].value&&"italic"===te[1].value&&(0,_o.jsx)(yo.ToggleControl,{label:(0,Mo.__)("Load Italic Styles Also","kadence-blocks"),checked:z,onChange:H}),P&&$&&(0,_o.jsx)(np,{label:(0,Mo.__)("Letter Spacing","kadence-blocks"),value:void 0!==$&&void 0!==$[0]?$[0]:"",onChange:e=>P([e,void 0!==$&&void 0!==$[1]?$[1]:"",void 0!==$&&void 0!==$[2]?$[2]:""]),tabletValue:void 0!==$&&void 0!==$[1]?$[1]:"",onChangeTablet:e=>P([void 0!==$&&void 0!==$[0]?$[0]:"",e,void 0!==$&&void 0!==$[2]?$[2]:""]),mobileValue:void 0!==$&&void 0!==$[2]?$[2]:"",onChangeMobile:e=>P([void 0!==$&&void 0!==$[0]?$[0]:"",void 0!==$&&void 0!==$[1]?$[1]:"",e]),min:-5,max:25,step:X&&"px"===X?.1:.01,unit:X?W:"px",onUnit:e=>X(e),units:X?["px","em","rem"]:["px"]}),P&&!$&&(0,_o.jsx)(vf,{label:(0,Mo.__)("Letter Spacing","kadence-blocks"),value:void 0!==m?m:"",defaultValue:0,onChange:e=>P(e),min:-5,max:25,step:.1,reset:!0})]}),D&&F&&(0,_o.jsx)(_o.Fragment,{children:(0,_o.jsx)(kf,{label:(0,Mo.__)("Padding (px)","kadence-blocks"),measurement:x||"",control:k,onChange:e=>D(e),onControl:e=>F(e),min:0,max:100,step:1,allowEmpty:!1,reset:()=>D([0,0,0,0])})}),V&&B&&(0,_o.jsx)(_o.Fragment,{children:(0,_o.jsx)(kf,{label:(0,Mo.__)("Margin (px)","kadence-blocks"),measurement:g||"",control:v,onChange:e=>V(e),onControl:e=>B(e),min:-100,max:100,step:1,allowEmpty:!1,reset:()=>V([0,0,0,0])})})]})})}}const _f=yf;class wf extends ko.Component{constructor(){super(...arguments),this.state={controlSize:"desk",typographyOptions:[],typographySelectOptions:[],typographyWeights:[],typographyStyles:[],typographySubsets:""}}componentDidMount(){let e=[{type:"group",label:"Standard Fonts",options:[{label:"System Default",value:'-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',google:!1},{label:"Arial, Helvetica, sans-serif",value:"Arial, Helvetica, sans-serif",google:!1},{label:'"Arial Black", Gadget, sans-serif',value:'"Arial Black", Gadget, sans-serif',google:!1},{label:"Helvetica, sans-serif",value:"Helvetica, sans-serif",google:!1},{label:'"Comic Sans MS", cursive, sans-serif',value:'"Comic Sans MS", cursive, sans-serif',google:!1},{label:"Impact, Charcoal, sans-serif",value:"Impact, Charcoal, sans-serif",google:!1},{label:'"Lucida Sans Unicode", "Lucida Grande", sans-serif',value:'"Lucida Sans Unicode", "Lucida Grande", sans-serif',google:!1},{label:"Tahoma, Geneva, sans-serif",value:"Tahoma, Geneva, sans-serif",google:!1},{label:'"Trebuchet MS", Helvetica, sans-serif',value:'"Trebuchet MS", Helvetica, sans-serif',google:!1},{label:"Verdana, Geneva, sans-serif",value:"Verdana, Geneva, sans-serif",google:!1},{label:"Georgia, serif",value:"Georgia, serif",google:!1},{label:'"Palatino Linotype", "Book Antiqua", Palatino, serif',value:'"Palatino Linotype", "Book Antiqua", Palatino, serif',google:!1},{label:'"Times New Roman", Times, serif',value:'"Times New Roman", Times, serif',google:!1},{label:"Courier, monospace",value:"Courier, monospace",google:!1},{label:'"Lucida Console", Monaco, monospace',value:'"Lucida Console", Monaco, monospace',google:!1}]},{type:"group",label:"Google Fonts",options:"undefined"!=typeof kadence_blocks_params&&kadence_blocks_params.g_font_names?kadence_blocks_params.g_font_names.map(e=>({label:e,value:e,google:!0})):{}}];if("undefined"!=typeof kadence_blocks_params&&kadence_blocks_params.c_fonts){const t=[];Object.keys(kadence_blocks_params.c_fonts).forEach(function(e){const n=kadence_blocks_params.c_fonts[e].name,o=kadence_blocks_params.c_fonts[e].label?kadence_blocks_params.c_fonts[e].label:n,a=[];Object.keys(kadence_blocks_params.c_fonts[e].weights).forEach(function(t){a.push({value:kadence_blocks_params.c_fonts[e].weights[t],label:kadence_blocks_params.c_fonts[e].weights[t]})});const r=[];Object.keys(kadence_blocks_params.c_fonts[e].styles).forEach(function(t){r.push({value:kadence_blocks_params.c_fonts[e].weights[t],label:kadence_blocks_params.c_fonts[e].weights[t]})}),t.push({label:o,value:n,google:!1,weights:a,styles:r})}),e=[{type:"group",label:(0,Mo.__)("Custom Fonts","kadence-blocks"),options:t}].concat(e)}if("undefined"!=typeof kadence_blocks_params&&kadence_blocks_params?.isKadenceT){const t=[{label:"Inherit Heading Font Family",value:"var( --global-heading-font-family, inherit )",google:!1},{label:"Inherit Body Font Family",value:"var( --global-body-font-family, inherit )",google:!1}];e=[{type:"group",label:(0,Mo.__)("Theme Global Fonts","kadence-blocks"),options:t}].concat(e)}let t=(0,hp.applyFilters)("kadence.typography_options",e),n=[].concat.apply([],t.map(e=>e.options));const o=kadence_blocks_params.configuration?JSON.parse(kadence_blocks_params.configuration):[];void 0!==o["kadence/typography"]&&"object"==typeof o["kadence/typography"]&&(void 0===o["kadence/typography"].showAll||o["kadence/typography"].showAll||(t=o["kadence/typography"].choiceArray,n=o["kadence/typography"].choiceArray)),this.setState({typographyOptions:t}),this.setState({typographySelectOptions:n}),this.setTypographyOptions(n)}componentDidUpdate(e){this.props.fontFamily!==e.fontFamily&&this.setTypographyOptions(this.state.typographySelectOptions)}setTypographyOptions(e){let t=[{value:"inherit",label:(0,Mo.__)("Inherit","kadence-blocks")},{value:"400",label:(0,Mo.__)("Normal","kadence-blocks")},{value:"bold",label:(0,Mo.__)("Bold","kadence-blocks")}];const n=[{value:"inherit",label:(0,Mo.__)("Inherit","kadence-blocks")},{value:"100",label:(0,Mo.__)("Thin 100","kadence-blocks")},{value:"200",label:(0,Mo.__)("Extra-Light 200","kadence-blocks")},{value:"300",label:(0,Mo.__)("Light 300","kadence-blocks")},{value:"400",label:(0,Mo.__)("Regular","kadence-blocks")},{value:"500",label:(0,Mo.__)("Medium 500","kadence-blocks")},{value:"600",label:(0,Mo.__)("Semi-Bold 600","kadence-blocks")},{value:"700",label:(0,Mo.__)("Bold 700","kadence-blocks")},{value:"800",label:(0,Mo.__)("Extra-Bold 800","kadence-blocks")},{value:"900",label:(0,Mo.__)("Ultra-Bold 900","kadence-blocks")}],o=[{value:"normal",label:(0,Mo.__)("Normal","kadence-blocks")},{value:"italic",label:(0,Mo.__)("Italic","kadence-blocks")}],a=!("undefined"==typeof kadence_blocks_params||!kadence_blocks_params.isKadenceT),r="undefined"!=typeof kadence_blocks_params&&kadence_blocks_params.headingWeights?kadence_blocks_params.headingWeights:[],s="undefined"!=typeof kadence_blocks_params&&kadence_blocks_params.bodyWeights?kadence_blocks_params.bodyWeights:[],i="undefined"!=typeof kadence_blocks_params&&kadence_blocks_params.buttonWeights?kadence_blocks_params.buttonWeights:[];a&&"heading"===this.props.fontGroup&&r&&Array.isArray(r)&&r.length&&(t=r),a&&"body"===this.props.fontGroup&&s&&Array.isArray(s)&&s.length&&(t=s),a&&"button"===this.props.fontGroup&&i&&Array.isArray(i)&&i.length&&(t=i);const l=e?e.filter(({value:e})=>e===this.props.fontFamily):"";let c=t,u=o,d="";l&&l[0]&&(void 0!==l[0].weights&&(c=l[0].weights),void 0!==l[0].styles&&(u=l[0].styles)),'-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"'===this.props.fontFamily?c=n:"var( --global-heading-font-family, inherit )"===this.props.fontFamily?c=r:"var( --global-body-font-family, inherit )"===this.props.fontFamily?c=s:this.props.googleFont&&this.props.fontFamily&&"undefined"!=typeof kadence_blocks_params&&kadence_blocks_params.g_fonts&&kadence_blocks_params.g_fonts[this.props.fontFamily]&&(c=kadence_blocks_params.g_fonts[this.props.fontFamily].w.map(e=>({label:(0,No.capitalizeFirstLetter)(e),value:e})),u=kadence_blocks_params.g_fonts[this.props.fontFamily].i.map(e=>({label:(0,No.capitalizeFirstLetter)(e),value:e})),d=kadence_blocks_params.g_fonts[this.props.fontFamily].s.map(e=>({label:(0,No.capitalizeFirstLetter)(e),value:e}))),this.setState({typographyWeights:c}),this.setState({typographyStyles:u}),this.setState({typographySubsets:d}),this.setState({fontFamilyValue:l})}render(){const{uniqueID:e,lineHeight:t,lineHeightType:n,fontSize:o,fontSizeType:a,googleFont:r,loadGoogleFont:s,fontFamily:i,fontVariant:l,fontWeight:c,fontStyle:u,fontSubset:d,letterSpacing:p,onLineHeight:h,onFontSize:f,onFontFamily:b,onFontVariant:m,onFontWeight:g,onFontStyle:v,onFontSubset:x,onFontChange:k,onFontArrayChange:y,onLoadGoogleFont:_,onGoogleFont:w,onLetterSpacing:C,onFontSizeType:j,onLineHeightType:S,textTransform:N,onTextTransform:O,fontSizeArray:E,tabSize:M,tabLineHeight:T,onTabLineHeight:R,onTabSize:I,mobileSize:P,mobileLineHeight:L,onMobileLineHeight:A,onMobileSize:D}=this.props,{controlSize:F,typographySelectOptions:V,typographyOptions:B,typographySubsets:z,typographyStyles:H,typographyWeights:U,fontFamilyValue:G}=this.state,$=((0,Mo.__)("Desktop"),yo.Dashicon,(0,Mo.__)("Tablet"),yo.Dashicon,(0,Mo.__)("Mobile"),yo.Dashicon,e=>{const t=Number(e.target.value);C(""!==t?t>15?15:t<-5?-5:t:void 0)}),W=e=>{if(null===e)q();else{let t,n,o;e.google?(t="undefined"!=typeof kadence_blocks_params&&kadence_blocks_params.g_fonts&&!kadence_blocks_params.g_fonts[e.value].v.includes("regular")?kadence_blocks_params.g_fonts[e.value].v[0]:"regular",n="undefined"!=typeof kadence_blocks_params&&kadence_blocks_params.g_fonts&&!kadence_blocks_params.g_fonts[e.value].w.includes("regular")?kadence_blocks_params.g_fonts[e.value].w[0]:"400",o="undefined"!=typeof kadence_blocks_params&&kadence_blocks_params.g_fonts&&kadence_blocks_params.g_fonts[e.value].s.length>1?"latin":""):(o="",t="",n="inherit"),y?y({google:e.google,family:e.value,variant:t,weight:n,style:"normal",subset:o}):(k(e),m(t),g(n),v("normal"),x(o))}},q=()=>{y?y({google:!1,family:"",variant:"",weight:"inherit",style:"normal",subset:""}):(w(!1),b(""),m(""),g("inherit"),v("normal"),x(""))},X=e=>{if(r){let t;t="italic"===u?"regular"===e?"italic":e+"italic":e,y?y({variant:t,weight:"regular"===e?"400":e}):(m(t),g("regular"===e?"400":e))}else y?y({variant:"",weight:"regular"===e?"400":e}):(m(""),g("regular"===e?"400":e))},J=e=>{if(r){let t;t="italic"===e?c&&"regular"!==c?c+"italic":"italic":c||"regular",y?y({variant:t,style:e}):(m(t),v(e))}else y?y({variant:"",style:e}):(m(""),v(e))},K=[{value:"none",label:"None"},{value:"capitalize",label:"Capitalize"},{value:"uppercase",label:"Uppercase"},{value:"lowercase",label:"Lowercase"}],Y=U.some(function(e){return"regular"===e.value});let Z={};return Z.fontfamily=(0,_o.jsx)("svg",{width:"16px",height:"16px",viewBox:"0 0 48 48",xmlns:"http://www.w3.org/2000/svg",fillRule:"evenodd",clipRule:"evenodd",strokeLinejoin:"round",strokeMiterlimit:"1.414",children:(0,_o.jsx)("path",{d:"M39.939,7.124l0,-3.751l-11.251,0l0,3.751l3.75,0l0,33.752l-3.75,0l0,3.751l11.251,0l0,-3.751l-3.751,0l0,-33.752l3.751,0Zm-11.251,4.391c0,-0.195 -0.366,-0.429 -0.6,-0.596c-1.033,-0.771 -2.175,-1.273 -3.443,-1.506c-1.268,-0.234 -2.747,-0.35 -4.45,-0.35c-1.234,0 -2.501,0.195 -3.797,0.592c-1.297,0.396 -2.4,0.876 -3.311,1.446c-1.056,0.667 -1.911,1.429 -2.569,2.278c-0.658,0.852 -0.988,1.744 -0.988,2.676c0,0.893 0.238,1.697 0.714,2.417c0.476,0.72 1.221,1.078 2.233,1.078c1.135,0 2.022,-0.292 2.661,-0.883c0.639,-0.585 0.958,-1.234 0.958,-1.944c0,-0.668 -0.097,-1.397 -0.289,-2.189c-0.195,-0.789 -0.288,-1.387 -0.288,-1.792c0.324,-0.345 0.887,-0.674 1.687,-0.989c0.799,-0.315 1.667,-0.47 2.599,-0.47c1.358,0 2.406,0.277 3.147,0.834c0.74,0.559 1.312,1.212 1.717,1.962c0.364,0.669 0.269,2.186 0.269,2.186l0,4.472c0,0.527 -2.545,1.257 -5.333,2.189c-2.789,0.931 -4.484,1.569 -5.397,1.914c-0.728,0.285 -1.429,0.666 -2.261,1.14c-0.831,0.478 -1.463,1.018 -1.971,1.628c-0.649,0.729 -1.116,1.549 -1.44,2.46c-0.325,0.911 -0.475,1.944 -0.475,3.101c0,2.23 0.73,4.034 2.179,5.412c1.448,1.376 3.3,2.068 5.549,2.068c2.128,0 3.947,-0.834 5.456,-1.603c1.514,-0.774 2.928,-1.92 4.244,-3.795l0.184,0c0.264,1.875 0.851,2.946 1.792,3.686l1.223,0.064l0,-27.486Zm-3.259,22.286c-0.75,0.955 -1.673,1.78 -2.766,2.483c-1.095,0.699 -2.363,1.052 -3.801,1.052c-1.359,0 -2.477,-0.396 -3.358,-1.191c-0.883,-0.791 -1.322,-2.029 -1.322,-3.712c0,-1.3 0.292,-2.425 0.883,-3.368c0.585,-0.947 1.388,-1.763 2.398,-2.453c1.118,-0.733 2.322,-1.341 3.619,-1.83c1.296,-0.488 2.622,-0.934 4.347,-1.438l0,10.457Z",fill:"#0e9cd1",fillRule:"nonzero"})}),(0,_o.jsx)(ko.Fragment,{children:(0,_o.jsx)(yo.Dropdown,{className:"kt-popover-font-family-container components-dropdown-menu components-toolbar",contentClassName:"kt-popover-font-family",placement:"top",renderToggle:({isOpen:e,onToggle:t})=>(0,_o.jsx)(ko.Fragment,{children:(0,_o.jsx)(yo.Button,{className:"components-dropdown-menu__toggle kt-font-family-icon",label:(0,Mo.__)("Typography Settings"),tooltip:(0,Mo.__)("Typography Settings"),icon:Z.fontfamily,onClick:t,"aria-expanded":e,children:(0,_o.jsx)("span",{className:"components-dropdown-menu__indicator"})})}),renderContent:()=>(0,_o.jsxs)(ko.Fragment,{children:[b&&(0,_o.jsxs)(ko.Fragment,{children:[(0,_o.jsx)("h2",{className:"kt-heading-fontfamily-title",children:(0,Mo.__)("Font Family")}),(0,_o.jsx)("div",{className:"typography-family-select-form-row block-editor-block-toolbar",children:(0,_o.jsx)(pc,{options:B,className:"kt-inline-typography-select",classNamePrefix:"kt-typography",value:G,isMulti:!1,isSearchable:!0,isClearable:!0,maxMenuHeight:200,placeholder:(0,Mo.__)("Default"),onChange:W})})]}),(0,_o.jsxs)("div",{className:"typography-row-settings",children:[g&&(0,_o.jsx)(yo.SelectControl,{label:(0,Mo.__)("Weight","kadence-blocks"),value:"400"===c&&Y?"regular":c,options:U,onChange:X}),O&&(0,_o.jsx)(yo.SelectControl,{label:(0,Mo.__)("Transform"),value:N,options:K,onChange:e=>O(e)}),i&&v&&(0,_o.jsx)(yo.SelectControl,{label:(0,Mo.__)("Style"),value:u,options:H,onChange:J})]}),(0,_o.jsxs)("div",{className:"typography-row-settings",children:[C&&(0,_o.jsxs)("div",{className:"kt-type-input-wrap",children:[(0,_o.jsx)("div",{className:"components-base-control kt-typography-number-input",children:(0,_o.jsxs)("div",{className:"components-base-control__field",children:[(0,_o.jsx)("label",{className:"components-base-control__label",htmlFor:`kt-inline-spacing${e}`,children:(0,Mo.__)("Spacing")}),(0,_o.jsx)("input",{id:`kt-inline-spacing${e}`,value:void 0!==p?p:"",onChange:$,min:-5,max:15,step:.1,type:"number",className:"components-text-control__input"})]})}),(0,_o.jsx)("span",{className:"kt-unit",children:(0,Mo.__)("px")})]}),i&&r&&x&&(0,_o.jsx)(yo.SelectControl,{label:(0,Mo.__)("Subset"),value:d,options:z,onChange:e=>x(e)}),i&&r&&_&&(0,_o.jsx)(yo.ToggleControl,{label:(0,Mo.__)("Load Font"),checked:s,onChange:_})]}),(0,_o.jsxs)("div",{className:"typography-row-settings typography-size-row-settings",children:[f&&j&&!E&&(0,_o.jsx)("div",{className:"kt-size-input-wrap",children:f&&(0,_o.jsx)("div",{className:"kt-type-size-input-wrap",children:(0,_o.jsx)(ep,{label:(0,Mo.__)("Size","kadence-blocks"),value:o||"",onChange:e=>f(e),tabletValue:M||"",onChangeTablet:e=>onTabletSize(e),mobileValue:P||"",onChangeMobile:e=>D(e),min:0,max:"px"!==a?12:300,step:"px"!==a?.001:1,unit:a||"px",onUnit:e=>j(e),units:["px","em","rem","vw"],radio:!1,compressedDevice:!0})})}),h&&S&&!E&&(0,_o.jsx)("div",{className:"kt-size-input-wrap",children:(0,_o.jsx)("div",{className:"kt-type-size-input-wrap",children:(0,_o.jsx)(np,{label:(0,Mo.__)("Height","kadence-blocks"),value:t||"",onChange:e=>h(e),tabletValue:T||"",onChangeTablet:e=>R(e),mobileValue:L||"",onChangeMobile:e=>A(e),min:0,max:"px"===n?300:12,step:"px"===n?1:.1,unit:n||"",onUnit:e=>S(e),units:["-","px","em","rem"],compressedDevice:!0})})})]})]})})})}}const Cf=wf,jf=({label:e,enable:t=!0,color:n,colorDefault:o,blur:a,hOffset:r,vOffset:s,onColorChange:i,onBlurChange:l,onHOffsetChange:c,onVOffsetChange:u,onEnableChange:d})=>(0,_o.jsxs)("div",{className:"kb-text-shadow-container components-base-control",children:[e&&(0,_o.jsxs)("div",{className:"kt-box-shadow-label",children:[(0,_o.jsx)("h2",{className:"kt-beside-color-label",children:e}),d&&(0,_o.jsx)(yo.ToggleControl,{checked:t,onChange:e=>d(e)})]}),t&&(0,_o.jsx)("div",{className:"kt-inner-sub-section",children:(0,_o.jsxs)("div",{className:"kt-inner-sub-section-row",children:[(0,_o.jsxs)("div",{className:"kt-box-color-settings kt-box-shadow-subset",children:[(0,_o.jsx)("p",{className:"kt-box-shadow-title",children:(0,Mo.__)("Color","kadence-blocks")}),(0,_o.jsx)(Po,{value:n||o,default:o,onChange:e=>i(e)})]}),(0,_o.jsxs)("div",{className:"kt-box-x-settings kt-box-shadow-subset",children:[(0,_o.jsx)("p",{className:"kt-box-shadow-title",children:"X"}),(0,_o.jsx)("div",{className:"components-base-control kt-boxshadow-number-input",children:(0,_o.jsx)("div",{className:"components-base-control__field",children:(0,_o.jsx)("input",{value:void 0!==r?r:"",onChange:e=>c(Number(e.target.value)),min:-200,max:200,step:1,type:"number",className:"components-text-control__input"})})})]}),(0,_o.jsxs)("div",{className:"kt-box-y-settings kt-box-shadow-subset",children:[(0,_o.jsx)("p",{className:"kt-box-shadow-title",children:"Y"}),(0,_o.jsx)("div",{className:"components-base-control kt-boxshadow-number-input",children:(0,_o.jsx)("div",{className:"components-base-control__field",children:(0,_o.jsx)("input",{value:void 0!==s?s:"",onChange:e=>u(Number(e.target.value)),min:-200,max:200,step:1,type:"number",className:"components-text-control__input"})})})]}),(0,_o.jsxs)("div",{className:"kt-box-blur-settings kt-box-shadow-subset",children:[(0,_o.jsx)("p",{className:"kt-box-shadow-title",children:"Blur"}),(0,_o.jsx)("div",{className:"components-base-control kt-boxshadow-number-input",children:(0,_o.jsx)("div",{className:"components-base-control__field",children:(0,_o.jsx)("input",{value:void 0!==a?a:"",onChange:e=>l(Number(e.target.value)),min:0,max:200,step:1,type:"number",className:"components-text-control__input"})})})]})]})})]});function Sf({label:e,onChange:t,value:n="",className:o="",options:a=[],step:r=1,max:s=100,min:i=0,beforeIcon:l="",help:c="",defaultValue:u="",unit:d="",onUnit:p,showUnit:h=!1,units:f=["px","em","rem"],disableCustomSizes:b=!1}){const m=n.value?n.value:"",g=n.size?n.size:"";return[t&&(0,_o.jsxs)("div",{className:"components-base-control kadence-radio-range-control kadence-range-control"+(o?" "+o:""),children:[e&&(0,_o.jsx)(yo.Flex,{justify:"space-between",className:"kadence-radio-range__header",children:(0,_o.jsx)(yo.FlexItem,{children:(0,_o.jsx)("label",{className:"components-base-control__label",children:e})})}),"custom"!==m&&(0,_o.jsx)("div",{className:"kadence-controls-content",children:(0,_o.jsxs)(yo.ButtonGroup,{className:"kadence-radio-container-control",children:[a.map((e,n)=>(0,_o.jsx)(yo.Button,{isTertiary:m!==e.value,className:"kadence-radio-item radio-"+e.value,isPrimary:m===e.value,icon:void 0!==e.icon?e.icon:void 0,"aria-pressed":m===e.value,onClick:()=>{m==e.value&&""==u?t("",""):t(e.value,e.size)},children:e.label},`${e.label}-${e.value}-${n}`)),!b&&(0,_o.jsx)(yo.Button,{className:"kadence-radio-item radio-custom only-icon",label:(0,Mo.__)("Set custom size","kadence-blocks"),icon:zc,onClick:()=>t("custom",g),isPressed:!1,isTertiary:!0})]})}),"custom"===m&&(0,_o.jsxs)("div",{className:"kadence-controls-content",children:[(0,_o.jsx)("div",{className:"kadence-range-control-inner",children:(0,_o.jsx)(yo.RangeControl,{className:"kadence-range-control-range",beforeIcon:l,value:g,onChange:e=>t("custom",e),min:i,max:s,step:r,help:c,allowReset:!0,initialPosition:0===n.size?0:""})}),(p||h)&&(0,_o.jsx)("div",{className:"kadence-units kadence-measure-control-select-wrapper",children:(0,_o.jsx)("select",{className:"kadence-measure-control-select components-unit-control__select",onChange:e=>{p&&p(e.target.value)},value:d,disabled:1===f.length,children:f.map((e,t)=>(0,_o.jsx)("option",{value:e,children:e},t))})}),!b&&(0,_o.jsx)(yo.ButtonGroup,{className:"kadence-radio-container-control",children:(0,_o.jsx)(yo.Button,{className:"kadence-radio-item radio-custom only-icon",label:(0,Mo.__)("Use size preset","kadence-blocks"),icon:zc,isPrimary:!0,onClick:()=>t(u,g),isPressed:!0})})]})]})]}function Nf({label:e,onChange:t,onChangeTablet:n,onChangeMobile:o,mobileValue:a,tabletValue:r,value:s,defaultValue:i="",defaultTablet:l="",defaultMobile:c="",step:u=1,max:d=100,min:p=0,unit:h="",onUnit:f,allowResponsiveUnitChange:b=!1,showUnit:m=!1,units:g=["px","em","rem"],allowEmpty:v=!0,className:x="",initialPosition:k,reset:y}){const[_,w]=(0,ko.useState)("Desktop"),C=(0,To.useSelect)(e=>e("kadenceblocks/data").getPreviewDeviceType(),[]);C!==_&&w(C);const{setPreviewDeviceType:j}=(0,To.useDispatch)("kadenceblocks/data"),S=[{name:"Desktop",key:"desktop",title:(0,_o.jsx)(yo.Dashicon,{icon:"desktop"}),itemClass:"kb-desk-tab"},{name:"Tablet",key:"tablet",title:(0,_o.jsx)(yo.Dashicon,{icon:"tablet"}),itemClass:"kb-tablet-tab"},{name:"Mobile",key:"mobile",title:(0,_o.jsx)(yo.Dashicon,{icon:"smartphone"}),itemClass:"kb-mobile-tab"}],N={};return N.Mobile=(0,_o.jsx)(vf,{value:void 0!==a?a:"",onChange:e=>o(e),min:p,max:d,step:u,unit:h,onUnit:f,showUnit:m,units:g,lockUnits:!b,initialPosition:k}),N.Tablet=(0,_o.jsx)(vf,{value:void 0!==r?r:"",onChange:e=>n(e),min:p,max:d,step:u,unit:h,onUnit:f,showUnit:m,units:g,lockUnits:!b,initialPosition:k}),N.Desktop=(0,_o.jsx)(vf,{value:void 0!==s?s:"",onChange:e=>t(e),min:p,max:d,step:u,unit:h,onUnit:f,showUnit:m,units:g,initialPosition:k}),[t&&n&&o&&(0,_o.jsxs)("div",{className:"components-base-control kb-responsive-range-control"+(""!==x?" "+x:""),children:[(0,_o.jsxs)("div",{className:"kadence-title-bar",children:[e&&(0,_o.jsxs)("span",{className:"kadence-control-title",children:[e,y&&(0,_o.jsx)(yo.Button,{className:"is-reset is-single",isSmall:!0,disabled:(0,Oo.isEqual)(s,i)&&(0,Oo.isEqual)(r,l)&&(0,Oo.isEqual)(a,c),icon:kd,onClick:()=>{"function"==typeof y?y():"Tablet"===_?n(l):"Mobile"===_?o(c):t(i)}})]}),(0,_o.jsx)(yo.ButtonGroup,{className:"kb-measure-responsive-options","aria-label":(0,Mo.__)("Device","kadence-blocks"),children:(0,Oo.map)(S,({name:e,key:t,title:n,itemClass:o})=>(0,_o.jsx)(yo.Button,{className:`kb-responsive-btn ${o}${e===_?" is-active":""}`,isSmall:!0,"aria-pressed":_===e,onClick:()=>{return t=e,j((0,No.capitalizeFirstLetter)(t)),void w((0,No.capitalizeFirstLetter)(t));var t},children:n},t))})]}),N[_]?N[_]:N.Desktop]})]}function Of({label:e,onChange:t,onChangeTablet:n,onChangeMobile:o,mobileValue:a,tabletValue:r,value:s,options:i=[],step:l=1,max:c=100,min:u=0,unit:d="",onUnit:p,defaultValue:h="default",defaultTablet:f="",defaultMobile:b="",showUnit:m=!1,units:g=["px","em","rem"],allowEmpty:v=!0,className:x="",disableCustomSizes:k=!1,reset:y}){const[_,w]=(0,ko.useState)("Desktop"),C=(0,To.useSelect)(e=>e("kadenceblocks/data").getPreviewDeviceType(),[]);C!==_&&w(C);const{setPreviewDeviceType:j}=(0,To.useDispatch)("kadenceblocks/data"),S=[{name:"Desktop",key:"desktop",title:(0,_o.jsx)(yo.Dashicon,{icon:"desktop"}),itemClass:"kb-desk-tab"},{name:"Tablet",key:"tablet",title:(0,_o.jsx)(yo.Dashicon,{icon:"tablet"}),itemClass:"kb-tablet-tab"},{name:"Mobile",key:"mobile",title:(0,_o.jsx)(yo.Dashicon,{icon:"smartphone"}),itemClass:"kb-mobile-tab"}],N={};return N.Mobile=(0,_o.jsx)(Sf,{value:void 0!==a?a:"",onChange:(e,t)=>o(e,t),options:i,defaultValue:b,min:u,max:c,step:l,unit:d,onUnit:p,showUnit:m,units:g,disableCustomSizes:k}),N.Tablet=(0,_o.jsx)(Sf,{value:void 0!==r?r:"",onChange:(e,t)=>n(e,t),options:i,defaultValue:f,min:u,max:c,step:l,unit:d,onUnit:p,showUnit:m,units:g,disableCustomSizes:k}),N.Desktop=(0,_o.jsx)(Sf,{value:void 0!==s?s:"",onChange:(e,n)=>t(e,n),options:i,defaultValue:h,min:u,max:c,step:l,unit:d,onUnit:p,showUnit:m,units:g,disableCustomSizes:k}),[t&&n&&o&&(0,_o.jsxs)("div",{className:"components-base-control kb-responsive-radio-range-control"+(""!==x?" "+x:""),children:[(0,_o.jsxs)("div",{className:"kadence-title-bar",children:[e&&(0,_o.jsx)("span",{className:"kadence-control-title",children:e}),y&&(0,_o.jsx)(yo.Button,{className:"is-reset is-single",isSmall:!0,disabled:(0,Oo.isEqual)(s,h)&&(0,Oo.isEqual)(r,f)&&(0,Oo.isEqual)(a,b),icon:kd,onClick:()=>{"function"==typeof y?y():"Tablet"===_?n(f):"Mobile"===_?o(b):t(h)}}),(0,_o.jsx)(yo.ButtonGroup,{className:"kb-measure-responsive-options","aria-label":(0,Mo.__)("Device","kadence-blocks"),children:(0,Oo.map)(S,({name:e,key:t,title:n,itemClass:o})=>(0,_o.jsx)(yo.Button,{className:`kb-responsive-btn ${o}${e===_?" is-active":""}`,isSmall:!0,"aria-pressed":_===e,onClick:()=>{return t=e,j((0,No.capitalizeFirstLetter)(t)),void w((0,No.capitalizeFirstLetter)(t));var t},children:n},t))})]}),N[_]?N[_]:N.Desktop]})]}tu.pxIcon,tu.emIcon,tu.remIcon,tu.vhIcon,tu.vwIcon,tu.percentIcon;let Ef={px:tu.pxIcon,em:tu.emIcon,rem:tu.remIcon,vh:tu.vhIcon,vw:tu.vwIcon,percent:tu.percentIcon};function Mf({device:e="device",onChange:t,value:n,step:o=1,max:a=100,min:r=0,unit:s="",onUnit:i,showUnit:l=!1,units:c=["px","em","rem"],lockUnits:u=!1,className:d=""}){return[t&&(0,_o.jsxs)("div",{className:"kadence-controls-content kb-responsive-range-control-inner"+(""!==d?" "+d:""),children:[(0,_o.jsx)(vf,{value:void 0!==n?n:"",onChange:e=>t(e),min:r,max:a,step:o}),(i||l)&&(0,_o.jsx)("div",{className:"kadence-units",children:1===c.length||u?(0,_o.jsx)(yo.Button,{className:"is-active is-single",isSmall:!0,disabled:!0,children:"%"===s?Ef.percent:Ef[s]}):(0,_o.jsx)(yo.DropdownMenu,{icon:"%"===s?Ef.percent:Ef[s],label:(0,Mo.__)("Select a Unit","kadence-blocks"),controls:c.map(e=>{return[{icon:"%"===(t=e)?Ef.percent:Ef[t],isActive:s===t,onClick:()=>{i(t)}}];var t}),className:"kadence-units-group",popoverProps:{className:"kadence-units-popover"}})})]})]}function Tf({label:e,subLabel:t,onChange:n,onChangeTablet:o,onChangeMobile:a,mobileValue:r,tabletValue:s,value:i,onChangeControl:l=!1,control:c="individual",step:u=1,max:d=100,min:p=0,unit:h="",onUnit:f,showUnit:b=!1,units:m=["px","em","rem"],allowEmpty:g=!0,preset:v="",isBorderRadius:x=!1,firstIcon:k=tu.outlineTopIcon,secondIcon:y=tu.outlineRightIcon,thirdIcon:_=tu.outlineBottomIcon,fourthIcon:w=tu.outlineLeftIcon,linkIcon:C=fd,unlinkIcon:j=bd,reset:S=!0}){const N=(0,ko.useRef)(),[O,E]=(0,ko.useState)(c),M=l?c:O,T=l||E,R=!!g,[I,P]=(0,ko.useState)("Desktop"),L=(0,To.useSelect)(e=>e("kadenceblocks/data").getPreviewDeviceType(),[]);L!==I&&P(L);const{setPreviewDeviceType:A}=(0,To.useDispatch)("kadenceblocks/data"),D=[{name:"Desktop",title:(0,_o.jsx)(yo.Dashicon,{icon:"desktop"}),itemClass:"kb-desk-tab"},{name:"Tablet",title:(0,_o.jsx)(yo.Dashicon,{icon:"tablet"}),itemClass:"kb-tablet-tab"},{name:"Mobile",key:"mobile",title:(0,_o.jsx)(yo.Dashicon,{icon:"smartphone"}),itemClass:"kb-mobile-tab"}];let F=i||["","","",""];"Tablet"===I?F=s||["","","",""]:"Mobile"===I&&(F=r||["","","",""]);const V={};return V.Mobile=(0,_o.jsx)(kf,{className:"measure-mobile-size",label:t?(0,Mo.__)("Mobile:","kadence-blocks")+t:void 0,measurement:r||["","","",""],control:M,onChange:e=>a(e),onControl:e=>T(e),min:p,max:d,step:u,allowEmpty:R,unit:h,showUnit:!0,units:[h],preset:v,isBorderRadius:x,firstIcon:k,secondIcon:y,thirdIcon:_,fourthIcon:w,linkIcon:C,unlinkIcon:j},2),V.Tablet=(0,_o.jsx)(kf,{className:"measure-tablet-size",label:t?(0,Mo.__)("Tablet:","kadence-blocks")+t:void 0,measurement:s||["","","",""],control:M,onChange:e=>o(e),onControl:e=>T(e),min:p,max:d,step:u,allowEmpty:R,unit:h,showUnit:!0,units:[h],preset:v,isBorderRadius:x,firstIcon:k,secondIcon:y,thirdIcon:_,fourthIcon:w,linkIcon:C,unlinkIcon:j},1),V.Desktop=(0,_o.jsx)(kf,{className:"measure-desktop-size",label:t||void 0,measurement:i||["","","",""],control:M,onChange:e=>n(e),onControl:e=>T(e),min:p,max:d,step:u,allowEmpty:R,unit:h,onUnit:f||void 0,showUnit:b,units:m,preset:v,isBorderRadius:x,firstIcon:k,secondIcon:y,thirdIcon:_,fourthIcon:w,linkIcon:C,unlinkIcon:j},0),[n&&o&&a&&(0,_o.jsxs)("div",{ref:N,className:"components-base-control kb-responsive-measure-control",children:[(0,_o.jsxs)("div",{className:"kadence-component__header kadence-title-bar",children:[e&&(0,_o.jsxs)("div",{className:"kadence-component__header__title kadence-title-bar kadence-measure-control__title",children:[(0,_o.jsx)("label",{className:"components-base-control__label",children:e}),S&&(0,_o.jsx)("div",{className:"title-reset-wrap",children:(0,_o.jsx)(yo.Button,{className:"is-reset is-single",label:"reset",isSmall:!0,disabled:!(!(0,Oo.isEqual)(["","","",""],F)&&!(0,Oo.isEqual)(["","auto","","auto"],F)),icon:kd,onClick:()=>"function"==typeof S?S():void("Tablet"===I?o(["","","",""]):"Mobile"===I?a(["","","",""]):n(["","","",""]))})})]}),(0,_o.jsx)(yo.ButtonGroup,{className:"kb-measure-responsive-options","aria-label":(0,Mo.__)("Device","kadence-blocks"),children:(0,Oo.map)(D,({name:e,key:t,title:n,itemClass:o})=>(0,_o.jsx)(yo.Button,{className:`kb-responsive-btn ${o}${e===I?" is-active":""}`,isSmall:!0,"aria-pressed":I===e,onClick:()=>{return t=e,A((0,No.capitalizeFirstLetter)(t)),void P((0,No.capitalizeFirstLetter)(t));var t},children:n},t))}),T&&(0,_o.jsx)(yo.Button,{isSmall:!0,className:"kadence-radio-item kadence-control-toggle radio-custom is-single only-icon",label:"individual"!==M?(0,Mo.__)("Individual","kadence-blocks"):(0,Mo.__)("Linked","kadence-blocks"),icon:"individual"!==M?C:j,onClick:()=>T("individual"!==M?"individual":"linked"),isPressed:"individual"!==M,isTertiary:"individual"===M})]}),(0,_o.jsx)("div",{className:"kb-responsive-measure-control-inner",children:V[I]?V[I]:V.Desktop})]})]}class Rf extends ko.Component{constructor(e,t,n){super(...arguments),this.state={isVisible:!1,color:"",name:""}}componentDidMount(){this.setState({color:this.props.colorValue}),this.setState({name:this.props.nameValue})}render(){const e=()=>{!0===this.state.isVisible&&(this.setState({isVisible:!1}),this.props.onSave(this.state.color,this.state.name))},t=e=>{this.setState({color:e})};return(0,_o.jsxs)("div",{className:"kt-advanced-color-settings-container",children:[this.state.isVisible&&(0,_o.jsxs)(yo.Popover,{position:"top left",className:"kt-popover-color",onClose:e,children:[(0,_o.jsx)(yo.ColorPicker,{color:void 0===this.state.color||""===this.state.color?this.props.colorValue:this.state.color,onChangeComplete:e=>t(e.hex),disableAlpha:!0}),(0,_o.jsx)(yo.TextControl,{label:(0,Mo.__)("Name:"),value:void 0===this.state.name||""===this.state.name?this.props.nameValue:this.state.name,onChange:e=>this.setState({name:e})})]}),this.state.isVisible&&(0,_o.jsx)(yo.Tooltip,{text:(0,Mo.__)("Edit Color"),children:(0,_o.jsx)(yo.Button,{className:"kt-color-icon-indicate",onClick:e,children:(0,_o.jsx)(yo.ColorIndicator,{className:"kt-advanced-color-indicate",colorValue:"transparent"===this.state.color||void 0===this.state.color||""===this.state.color?this.props.colorDefault:this.state.color})})}),!this.state.isVisible&&(0,_o.jsx)(yo.Tooltip,{text:(0,Mo.__)("Edit Color"),children:(0,_o.jsx)(yo.Button,{className:"kt-color-icon-indicate",onClick:()=>{this.setState({isVisible:!0})},children:(0,_o.jsx)(yo.ColorIndicator,{className:"kt-advanced-color-indicate",colorValue:"transparent"===this.state.color||void 0===this.state.color||""===this.state.color?this.props.colorDefault:this.state.color})})})]})}}const If=Rf;function Pf({label:e,swatchLabel:t="",value:n,onChange:o,defaultColor:a="",value2:r,swatchLabel2:s="",onChange2:i,defaultColor2:l="",value3:c,swatchLabel3:u="",onChange3:d,defaultColor3:p="",control:h,onControl:f,firstIcon:b=tu.outlineTopIcon,secondIcon:m=tu.outlineRightIcon,thirdIcon:g=tu.outlineBottomIcon,fourthIcon:v=tu.outlineLeftIcon,linkIcon:x=tu.linkedIcon,unlinkIcon:k=tu.individualIcon,className:y="",reset:_=!1}){const w={first:b,second:m,third:g,fourth:v,link:x,unlink:k},[C,j]=(0,ko.useState)("individual"),S=h||C,N=f||j,O=(0,ko.useRef)();return(0,_o.jsxs)("div",{ref:O,className:"components-base-control kb-border-color-control "+(""!==y?" "+y:""),children:[(0,_o.jsxs)("div",{className:"kadence-title-bar",children:[e&&(0,_o.jsx)("span",{className:"kadence-control-title",children:e}),N&&(0,_o.jsx)("div",{className:"kadence-units kadence-locked",children:"individual"!==S?(0,_o.jsx)(yo.Tooltip,{text:(0,Mo.__)("Individual","kadence-blocks"),children:(0,_o.jsx)(yo.Button,{className:"is-single",isSmall:!0,onClick:()=>N("individual"),children:w.link})}):(0,_o.jsx)(yo.Tooltip,{text:(0,Mo.__)("Linked","kadence-blocks"),children:(0,_o.jsx)(yo.Button,{className:"is-single",isSmall:!0,onClick:()=>N("linked"),children:w.unlink})})})]}),(0,_o.jsxs)("div",{className:"kadence-controls-content-border",children:["individual"!==S&&(0,_o.jsx)(ko.Fragment,{children:(0,_o.jsx)(Po,{label:w.link,swatchLabel:t||"",value:n&&n[0]?n[0]:"",default:a||"",onChange:e=>o([e,e,e,e]),swatchLabel2:s||"",value2:r&&r[0]?r[0]:"",default2:l||"",onChange2:i?e=>i([e,e,e,e]):void 0,swatchLabel3:u||"",value3:c&&c[0]?c[0]:"",default3:p||"",onChange3:d?e=>d([e,e,e,e]):void 0})}),"individual"===S&&(0,_o.jsxs)("div",{className:"kt-border-color-array-control",children:[(0,_o.jsx)(Po,{label:b,swatchLabel:t||"",value:n&&n[0]?n[0]:"",default:a||"",onChange:e=>o([e,n[1],n[2],n[3]]),swatchLabel2:s||"",value2:r&&r[0]?r[0]:"",default2:l||"",onChange2:i?e=>i([e,r[1],r[2],r[3]]):void 0,value3:c&&c[0]?c[0]:"",swatchLabel3:u||"",default3:p||"",onChange3:d?e=>d([e,c[1],c[2],c[3]]):void 0}),(0,_o.jsx)(Po,{label:m,value:n&&n[1]?n[1]:"",swatchLabel:t||"",default:a||"",onChange:e=>o([n[0],e,n[2],n[3]]),swatchLabel2:s||"",value2:r&&r[1]?r[1]:"",default2:l||"",onChange2:i?e=>i([r[0],e,r[2],r[3]]):void 0,value3:c&&c[1]?c[1]:"",swatchLabel3:u||"",default3:p||"",onChange3:d?e=>d([c[0],e,c[2],c[3]]):void 0}),(0,_o.jsx)(Po,{label:g,value:n&&n[2]?n[2]:"",swatchLabel:t||"",default:a||"",onChange:e=>o([n[0],n[1],e,n[3]]),value2:r&&r[2]?r[2]:"",swatchLabel2:s||"",default2:l||"",onChange2:i?e=>i([r[0],r[1],e,r[3]]):void 0,value3:c&&c[2]?c[2]:"",swatchLabel3:u||"",default3:p||"",onChange3:d?e=>d([c[0],c[1],e,c[3]]):void 0}),(0,_o.jsx)(Po,{label:v,value:n&&n[3]?n[3]:"",swatchLabel:t||"",default:a||"",onChange:e=>o([n[0],n[1],n[2],e]),value2:r&&r[3]?r[3]:"",swatchLabel2:s||"",default2:l||"",onChange2:i?e=>i([r[0],r[1],r[2],e]):void 0,value3:c&&c[3]?c[3]:"",swatchLabel3:u||"",default3:p||"",onChange3:d?e=>d([c[0],c[1],c[2],e]):void 0})]})]})]})}const Lf=({label:e,enable:t=!0,color:n,colorDefault:o,opacity:a,blur:r,spread:s,hOffset:i,vOffset:l,inset:c,onColorChange:u,onOpacityChange:d,onBlurChange:p,onHOffsetChange:h,onVOffsetChange:f,onEnableChange:b,onSpreadChange:m,onInsetChange:g,shadowType:v,onArrayChange:x})=>(0,_o.jsxs)("div",{className:"kb-shadow-container components-base-control",children:[e&&(0,_o.jsx)("div",{className:"kt-box-shadow-label",children:(0,_o.jsx)("h2",{className:"kt-beside-color-label",children:e})}),(0,_o.jsxs)("div",{className:"kt-inner-sub-section",children:[(0,_o.jsxs)("div",{className:"kt-inner-sub-section-row",children:[(0,_o.jsxs)("div",{className:"kt-box-color-settings kt-box-shadow-subset",children:[(0,_o.jsx)("p",{className:"kt-box-shadow-title",children:(0,Mo.__)("Color","kadence-blocks")}),(0,_o.jsx)(Po,{value:n||o,default:o,onChange:e=>u(e),opacityValue:a,onOpacityChange:e=>d(e),onArrayChange:x?(e,t)=>x(e,t):void 0})]}),(0,_o.jsxs)("div",{className:"kt-box-x-settings kt-box-shadow-subset",children:[(0,_o.jsx)("p",{className:"kt-box-shadow-title",children:"X"}),(0,_o.jsx)("div",{className:"components-base-control kt-boxshadow-number-input",children:(0,_o.jsx)("div",{className:"components-base-control__field",children:(0,_o.jsx)("input",{value:void 0!==i?i:"",onChange:e=>h(Number(e.target.value)),min:-200,max:200,step:1,type:"number",className:"components-text-control__input"})})})]}),(0,_o.jsxs)("div",{className:"kt-box-y-settings kt-box-shadow-subset",children:[(0,_o.jsx)("p",{className:"kt-box-shadow-title",children:"Y"}),(0,_o.jsx)("div",{className:"components-base-control kt-boxshadow-number-input",children:(0,_o.jsx)("div",{className:"components-base-control__field",children:(0,_o.jsx)("input",{value:void 0!==l?l:"",onChange:e=>f(Number(e.target.value)),min:-200,max:200,step:1,type:"number",className:"components-text-control__input"})})})]}),(0,_o.jsxs)("div",{className:"kt-box-blur-settings kt-box-shadow-subset",children:[(0,_o.jsx)("p",{className:"kt-box-shadow-title",children:"Blur"}),(0,_o.jsx)("div",{className:"components-base-control kt-boxshadow-number-input",children:(0,_o.jsx)("div",{className:"components-base-control__field",children:(0,_o.jsx)("input",{value:void 0!==r?r:"",onChange:e=>p(Number(e.target.value)),min:0,max:200,step:1,type:"number",className:"components-text-control__input"})})})]}),"box"===v&&(0,_o.jsxs)("div",{className:"kt-box-spread-settings kt-box-shadow-subset",children:[(0,_o.jsx)("p",{className:"kt-box-shadow-title",children:(0,Mo.__)("Spread")}),(0,_o.jsx)("div",{className:"components-base-control kt-boxshadow-number-input",children:(0,_o.jsx)("div",{className:"components-base-control__field",children:(0,_o.jsx)("input",{value:void 0!==s?s:"",onChange:e=>m(Number(e.target.value)),min:-200,max:200,step:1,type:"number",className:"components-text-control__input"})})})]})]}),"box"===v&&g&&(0,_o.jsx)("div",{className:"kt-box-inset-settings",children:(0,_o.jsx)(yo.ToggleControl,{label:(0,Mo.__)("Inset"),checked:c,onChange:e=>g(e)})})]})]});function Af({label:e,enable:t=!0,color:n,colorDefault:o,opacity:a,blur:r,spread:s,inset:i,hOffset:l,vOffset:c,onColorChange:u,onOpacityChange:d,onBlurChange:p,onHOffsetChange:h,onVOffsetChange:f,onEnableChange:b,onSpreadChange:m,onInsetChange:g,className:v="",shadowType:x,onArrayChange:k,onApplyShadowPreset:y,reset:_=!0}){const[w,C]=(0,ko.useState)("Desktop"),j=(0,To.useSelect)(e=>e("kadenceblocks/data").getPreviewDeviceType(),[]);j!==w&&C(j);const{setPreviewDeviceType:S}=(0,To.useDispatch)("kadenceblocks/data"),N=[{name:"Desktop",key:"desktop",title:(0,_o.jsx)(yo.Dashicon,{icon:"desktop"}),itemClass:"kb-desk-tab"},{name:"Tablet",key:"tablet",title:(0,_o.jsx)(yo.Dashicon,{icon:"tablet"}),itemClass:"kb-tablet-tab"},{name:"Mobile",key:"mobile",title:(0,_o.jsx)(yo.Dashicon,{icon:"smartphone"}),itemClass:"kb-mobile-tab"}],O={};O.Mobile=(0,_o.jsx)(Lf,{label:(0,Mo.__)("Shadow","kadence-blocks"),enable:t,color:n,colorDefault:o,opacity:a,hOffset:l,vOffset:c,blur:r,spread:s,onEnableChange:b,onColorChange:u,onOpacityChange:d,onHOffsetChange:h,onVOffsetChange:f,onBlurChange:p,onSpreadChange:m,shadowType:x,inset:i,onInsetChange:g,onArrayChange:k,onApplyShadowPreset:y},"mobile-text-shadow-control"),O.Tablet=(0,_o.jsx)(Lf,{label:(0,Mo.__)("Shadow","kadence-blocks"),enable:t,color:n,colorDefault:o,opacity:a,hOffset:l,vOffset:c,blur:r,spread:s,onEnableChange:b,onColorChange:u,onOpacityChange:d,onHOffsetChange:h,onVOffsetChange:f,onBlurChange:p,onSpreadChange:m,shadowType:x,inset:i,onInsetChange:g,onArrayChange:k,onApplyShadowPreset:y},"tablet-text-shadow-control"),O.Desktop=(0,_o.jsx)(Lf,{label:(0,Mo.__)("Shadow","kadence-blocks"),enable:t,color:n,opacity:a,colorDefault:o,hOffset:l,vOffset:c,blur:r,spread:s,onEnableChange:b,onColorChange:u,onOpacityChange:d,onHOffsetChange:h,onVOffsetChange:f,onBlurChange:p,onSpreadChange:m,shadowType:x,inset:i,onInsetChange:g,onArrayChange:k,onApplyShadowPreset:y},"desktop-text-shadow-control");const E=[{value:"none",label:(0,Mo.__)("None","kadence-blocks"),icon:Cc.shadowPresetNone},{value:"soft-inner-glow",label:(0,Mo.__)("Soft Inner Glow","kadence-blocks"),icon:"soft-inner-glow"},{value:"soft-outer-glow",label:(0,Mo.__)("Soft Outer Glow","kadence-blocks"),icon:"soft-outer-glow"},{value:"right-offset-glow",label:(0,Mo.__)("Right Offset Glow","kadence-blocks"),icon:"right-offset-glow"},{value:"bottom-offset-glow",label:(0,Mo.__)("Bottom Offset Glow","kadence-blocks"),icon:"bottom-offset-glow"},{value:"inner-solid",label:(0,Mo.__)("Inner Solid","kadence-blocks"),icon:"inner-solid"},{value:"right-bottom-solid",label:(0,Mo.__)("Right Bottom Solid","kadence-blocks"),icon:"right-bottom-solid"},{value:"top-left-solid",label:(0,Mo.__)("Top Left Solid","kadence-blocks"),icon:"top-left-solid"}],M={none:{hOffset:0,vOffset:0,blur:0,spread:0,inset:!1},"soft-inner-glow":{hOffset:0,vOffset:0,blur:60,spread:-15,inset:!0},"soft-outer-glow":{hOffset:0,vOffset:0,blur:60,spread:5,inset:!1},"right-offset-glow":{hOffset:20,vOffset:20,blur:30,spread:0,inset:!1},"bottom-offset-glow":{hOffset:0,vOffset:35,blur:30,spread:-5,inset:!1},"inner-solid":{hOffset:0,vOffset:0,blur:0,spread:15,inset:!0},"right-bottom-solid":{hOffset:15,vOffset:15,blur:0,spread:0,inset:!1},"top-left-solid":{hOffset:-15,vOffset:-15,blur:0,spread:0,inset:!1}};return[b&&(0,_o.jsxs)("div",{className:"components-base-control kb-responsive-range-control"+(""!==v?" "+v:""),children:[(0,_o.jsxs)("div",{className:"kadence-title-bar",children:[e&&(0,_o.jsxs)("span",{className:"kadence-control-title",children:[e,_&&(0,_o.jsx)(yo.Button,{className:"is-reset is-single",isSmall:!0,disabled:!1===t,icon:kd,onClick:()=>{"function"==typeof _?_():b("reset")}})]}),(0,_o.jsx)(yo.ButtonGroup,{className:"kb-measure-responsive-options","aria-label":(0,Mo.__)("Device","kadence-blocks"),children:(0,Oo.map)(N,({name:e,key:t,title:n,itemClass:o})=>(0,_o.jsx)(yo.Button,{className:`kb-responsive-btn ${o}${e===w?" is-active":""}`,isSmall:!0,"aria-pressed":w===e,onClick:()=>{return t=e,S((0,No.capitalizeFirstLetter)(t)),void C((0,No.capitalizeFirstLetter)(t));var t},children:n},t))})]}),(0,_o.jsxs)("div",{children:["box"===x&&(0,_o.jsx)(wc,{value:0,options:E,wrap:!0,hideLabel:!0,className:"kadence-box-shadow-radio-btns",onChange:e=>{(e=>{y({hOffset:M[e].hOffset,vOffset:M[e].vOffset,blur:M[e].blur,spread:M[e].spread,inset:M[e].inset})})(e)}}),O[w]?O[w]:O.Desktop]})]})]}const Df=window.wp.notices;function Ff({attributes:e,defaultAttributes:t={},blockSlug:n,excludedAttrs:o=[],preventMultiple:a=[]}){const[r,s]=(0,ko.useState)(kadence_blocks_params.userrole?kadence_blocks_params.userrole:"admin");if("admin"!==r)return null;const{createErrorNotice:i,createSuccessNotice:l}=(0,To.useDispatch)(Df.store),[c,u]=(0,ko.useState)(!1),[d,p]=(0,ko.useState)(!1),[h,f]=(0,ko.useState)(!1),b=(0,No.SafeParseJSON)((0,Oo.get)(kadence_blocks_params,["configuration"],{}),!0),m=(0,Oo.get)(b,n,{}),[g,v]=(0,ko.useState)(m),x=0!==Object.keys(m).length;return(0,_o.jsxs)(_o.Fragment,{children:[(0,_o.jsxs)(Id,{title:(0,Mo.__)("Block Defaults","kadence-blocks"),initialOpen:!1,panelName:`kb-${n}-defaults`,children:[(0,Mo.__)("This will set the current block attributes as the default styles for this block type.","kadence-blocks")," ",(0,Mo.__)("This will not modify any blocks that have already been created.","kadence-blocks")," ",(0,Mo.__)("Block content is not included.","kadence-blocks")," ",(0,_o.jsx)("br",{}),(0,_o.jsx)("br",{}),(0,_o.jsx)(yo.Button,{isPrimary:!0,onClick:()=>p(!0),children:(0,Mo.__)(" Save as default","kadence-blocks")}),x&&(0,_o.jsxs)(_o.Fragment,{children:[(0,_o.jsx)("br",{}),(0,_o.jsx)("br",{}),(0,_o.jsx)("a",{href:"#",onClick:()=>f(!0),children:(0,Mo.__)("Modify attributes","kadence-blocks")}),(0,_o.jsx)("a",{href:"#",style:{color:"red",float:"right"},onClick:()=>u(!0),children:(0,Mo.__)("Reset defaults","kadence-blocks")})]})]}),(0,_o.jsx)(yo.__experimentalConfirmDialog,{isOpen:c,onConfirm:()=>(()=>{let e=kadence_blocks_params.configuration?(0,No.SafeParseJSON)(kadence_blocks_params.configuration,!0):{};e=(0,Oo.omit)(e,n),Vd()({path:"/wp/v2/settings",method:"POST",data:{kadence_blocks_config_blocks:JSON.stringify(e)}}).then(()=>{l((0,Mo.__)("Block default saved","kadence-blocks"),{type:"snackbar"}),u(!1),kadence_blocks_params.configuration=JSON.stringify(e),v({})})})(),onCancel:()=>u(!1),children:(0,Mo.__)("Are you sure you'd like to reset this blocks default attributes?","kadence-blocks")}),(0,_o.jsx)(yo.__experimentalConfirmDialog,{isOpen:d,onConfirm:()=>(()=>{const r=(0,No.getTransferableAttributes)(e,t,o,a),s=kadence_blocks_params.configuration?(0,No.SafeParseJSON)(kadence_blocks_params.configuration,!0):{};s[n]=r,Vd()({path:"/wp/v2/settings",method:"POST",data:{kadence_blocks_config_blocks:JSON.stringify(s)}}).then(()=>{l((0,Mo.__)("Block default saved","kadence-blocks"),{type:"snackbar"}),p(!1),kadence_blocks_params.configuration=JSON.stringify(s),v(r)})})(),onCancel:()=>p(!1),children:(0,Mo.__)("Are you sure you'd like to save this as the blocks default attributes?","kadence-blocks")}),h?(0,_o.jsxs)(yo.Modal,{className:"kt-block-defaults-modal",title:(0,Mo.__)("Modify Block Defaults","kadence-blocks"),onRequestClose:()=>{v(m),f(!1)},children:[Object.keys(g).map((e,t)=>(0,_o.jsx)(_o.Fragment,{children:(0,_o.jsxs)("div",{style:{marginBottom:"10px"},children:[(0,_o.jsx)(yo.Button,{onClick:()=>v((0,Oo.omit)(g,e)),children:(0,_o.jsx)("span",{className:"dashicons dashicons-trash"})}),(0,_o.jsx)("span",{style:{verticalAlign:"super"},children:e})]},t)})),(0,_o.jsxs)("div",{className:"kb-modal-footer",children:[(0,_o.jsx)(yo.Button,{className:"kt-defaults-save",isDestructive:!0,disabled:!1,onClick:()=>{v(m),f(!1)},children:(0,Mo.__)("Cancel","kadence-blocks")}),(0,_o.jsx)(yo.Button,{className:"kt-defaults-save",isPrimary:!0,onClick:()=>{(()=>{const e=kadence_blocks_params.configuration?(0,No.SafeParseJSON)(kadence_blocks_params.configuration,!0):{};e[n]=g,Vd()({path:"/wp/v2/settings",method:"POST",data:{kadence_blocks_config_blocks:JSON.stringify(e)}}).then(()=>{l((0,Mo.__)("Block default saved","kadence-blocks"),{type:"snackbar"}),kadence_blocks_params.configuration=JSON.stringify(e)})})(),f(!1)},children:(0,Mo.__)("Save","kadence-blocks")})]})]}):null]})}function Vf({isOpen:e,setIsOpen:t,callback:n}){const[o,a]=(0,ko.useState)(""),[r,s]=(0,ko.useState)([]),[i,l]=(0,ko.useState)([]),[c,u]=(0,ko.useState)(null),[d,p]=(0,ko.useState)(!1),[h,f]=(0,ko.useState)(!1),[b,m]=(0,ko.useState)(!1),[g,v]=(0,ko.useState)(0),{createSuccessNotice:x}=(0,To.useDispatch)(Df.store),[k,y]=(0,ko.useState)(1),[_,w]=(0,ko.useState)(!1),C=(0,ko.useRef)(null);(0,ko.useEffect)(()=>{e&&C.current&&C.current.focus()},[e]);const j=async()=>{if(s([]),l([]),u(null),p(!0),y(1),v(0),o)try{const e=await Vd()({path:(0,hc.addQueryArgs)("/kb-custom-svg/v1/search",{search:o,page:1}),method:"GET"});e.success?(s(e),l(e.svgs.icons),w(e.svgs.has_more)):u(`Error ${e.code}: ${e.message||"Unexpected error occurred."}`)}catch(e){u(`Error ${e.code||"unknown"}: ${e.message||"An unexpected error occurred."}`)}finally{p(!1)}else p(!1)};return(0,_o.jsxs)("div",{className:"svg-search-modal",children:[(0,_o.jsxs)("div",{className:"svg-search-modal__input_row",children:[(0,_o.jsx)(yo.TextControl,{label:(0,Mo.__)("Search Icons","kadence-blocks"),hideLabelFromVision:!0,value:o,placeholder:(0,Mo.__)("Search Icons","kadence-blocks"),onChange:e=>{a(e)},onKeyDown:e=>{"Enter"===e.key&&j()},ref:C}),(0,_o.jsx)(yo.Button,{isPrimary:!0,className:"svg-search-modal__search-button",onClick:j,isBusy:d,disabled:d||0===o.length||h||b,children:(0,Mo.__)("Search","kadence-blocks")})]}),d&&(0,_o.jsx)("div",{className:"svg-search-modal__loading",children:(0,_o.jsx)(yo.Spinner,{className:"wp-spinner"})}),!d&&i.length>0&&(0,_o.jsxs)(_o.Fragment,{children:[(0,_o.jsx)("ul",{className:"svg-search-modal__results",children:i.map((e,t)=>(0,_o.jsx)("li",{onClick:()=>(e=>{v(e)})(t),style:{width:"84px",height:"88px",border:g===t?"2px solid var(--wp-components-color-accent, var(--wp-admin-theme-color, #007cba))":"2px solid transparent"},children:(0,_o.jsx)("img",{src:e.url,alt:e.title})},t))}),(0,_o.jsxs)("div",{className:"footer",children:[(0,_o.jsx)(yo.Button,{isSecondary:!0,onClick:async()=>{if(_){u(null),f(!0);try{const e=k+1,t=await Vd()({path:(0,hc.addQueryArgs)("/kb-custom-svg/v1/search",{search:o,page:e}),method:"GET"});t.svgs&&t.svgs.icons?(l(e=>[...e,...t.svgs.icons]),y(e),w(t.svgs.has_more)):u("No further results found.")}catch(e){u("Failed to load more icons, please try again.")}finally{f(!1)}}},isBusy:h,disabled:!_||b,children:(0,Mo.__)("Load More","kadence-blocks")}),(0,_o.jsx)(yo.Button,{isPrimary:!0,isBusy:b,disabled:h,onClick:()=>(async()=>{if(i&&g>=0){const e=i[g];if(!e||!e.url)return void u((0,Mo.__)("Selected SVG is invalid. Please try again.","kadence-blocks"));const o=e.url;m(!0);try{const a=await Vd()({path:"/kb-custom-svg/v1/search/add",method:"POST",data:{svgUrl:o,title:e.title||"",id:e.id||""}});if(!a?.value||!a?.label)throw new Error((0,Mo.__)("Invalid response from the server.","kadence-blocks"));x((0,Mo.__)("SVG Saved.","kadence-blocks"),{type:"snackbar"}),n(a.value),t(!1)}catch(e){u((0,Mo.__)("Failed to add the SVG. Please try again.","kadence-blocks"))}finally{m(!1)}}else u((0,Mo.__)("No SVG selected","kadence-blocks"))})(),children:(0,Mo.__)("Add","kadence-blocks")})]})]}),c&&(0,_o.jsx)("p",{className:"svg-search-modal__error",style:{color:"red"},children:c}),!d&&!c&&(!r||r.svgs&&0===r.svgs.icons.length)&&(0,_o.jsx)("p",{className:"svg-search-modal__no-results",children:(0,Mo.__)("No results found. Please try a different search.","kadence-blocks")}),!d&&!r.svgs&&!c&&(0,_o.jsx)("p",{className:"svg-search-modal__start-search",children:(0,Mo.__)("Start Search...","kadence-blocks")})]})}function Bf({isOpen:e,setIsOpen:t,callback:n,proVersion:o}){const[a,r]=(0,ko.useState)("upload"),[s,i]=(0,ko.useState)(""),[l,c]=(0,ko.useState)(""),[u,d]=(0,ko.useState)(null),[p,h]=(0,ko.useState)(""),{createSuccessNotice:f}=(0,To.useDispatch)(Df.store),b=(0,No.compareVersions)(o,"2.7.0")>=0;return(0,_o.jsx)(_o.Fragment,{children:e&&(0,_o.jsx)(yo.Modal,{title:(0,Mo.__)("Add a Custom Icon ","kadence-blocks"),className:"upload-svg-modal",size:"medium",onRequestClose:()=>t(!1),children:(0,_o.jsx)(yo.TabPanel,{className:"kb-icon-block__add-icon-modal-tabs",activeClass:"active-tab",tabs:[{name:"upload",title:"Upload",className:"tab-one"},...b?[{name:"search",title:"Search",className:"tab-two"}]:[]],children:o=>(0,_o.jsxs)("div",{className:"modal-body",children:["upload"===o.name&&(0,_o.jsxs)(_o.Fragment,{children:[(0,_o.jsxs)("div",{className:"security-notice",children:[(0,_o.jsx)("h4",{children:(0,Mo.__)("Important: SVG Safety","kadence-blocks")}),(0,_o.jsxs)("p",{children:[(0,Mo.__)("SVGs can contain malicious code. For your security, we suggest sanitizing your files before uploading.","kadence-blocks")," ",(0,_o.jsx)("a",{href:"https://www.kadencewp.com/help-center/docs/kadence-blocks/custom-icons/",children:(0,Mo.__)("Learn more about SVG security and supported SVG formatting.","kadence-blocks")})]})]}),""!==l&&(0,_o.jsx)("div",{className:"error-message",children:l}),"upload"===a&&(0,_o.jsxs)("div",{className:"drag-drop-container",children:[(0,_o.jsx)(yo.TextControl,{placeholder:(0,Mo.__)("Title your SVG","kadence-blocks"),value:p,onChange:e=>h(e)}),(0,_o.jsx)(yo.FormFileUpload,{accept:"image/svg+xml",onChange:e=>{d(e.currentTarget.files),""===p&&h((0,Oo.get)(e.currentTarget.files,["0","name"],"").replace(".svg",""))},render:({openFileDialog:e})=>(0,_o.jsxs)("div",{onClick:e,className:"drag-drop-target",style:{position:"relative"},children:[(0,_o.jsx)(yo.DropZone,{label:(0,Mo.__)("Upload SVG","kadence-blocks"),onFilesDrop:e=>{d(e),""===p&&h((0,Oo.get)(e,["0","name"],"").replace(".svg",""))}}),null===u||0===u.length?(0,_o.jsxs)(_o.Fragment,{children:[(0,_o.jsx)("h3",{children:(0,Mo.__)("Select a file or drop it here","kadence-blocks")}),(0,_o.jsx)("p",{children:(0,Mo.__)("SVG dimensions: 24px by 24px","kadence-blocks")})]}):(0,_o.jsxs)(_o.Fragment,{children:[(0,_o.jsx)("h3",{children:(0,Mo.__)("File Selected","kadence-blocks")}),(0,_o.jsx)("p",{children:(0,Oo.get)(u,["0","name"],"")})]}),(0,_o.jsx)(yo.Button,{isPrimary:!0,children:null===u?(0,Mo.__)("Select a file","kadence-blocks"):(0,Mo.__)("Change file","kadence-blocks")})]})}),(0,_o.jsx)(yo.Button,{type:"link",onClick:()=>{r("paste"),d(null)},children:(0,Mo.__)("Paste an SVG","kadence-blocks")})]}),"paste"===a&&(0,_o.jsxs)("div",{className:"paste-container",children:[(0,_o.jsx)("h3",{children:(0,Mo.__)("Paste your SVG","kadence-blocks")}),(0,_o.jsx)(yo.TextControl,{placeholder:(0,Mo.__)("Title your SVG","kadence-blocks"),value:p,onChange:e=>h(e)}),(0,_o.jsx)(yo.TextareaControl,{value:s,onChange:e=>i(e)}),(0,_o.jsx)(yo.Button,{type:"link",onClick:()=>{r("upload"),i("")},children:(0,Mo.__)("Upload an SVG","kadence-blocks")})]}),(0,_o.jsxs)("div",{className:"footer",children:[(0,_o.jsx)(yo.Button,{isSecondary:!0,onClick:()=>t(!1),children:(0,Mo.__)("Cancel","kadence-blocks")}),(0,_o.jsx)(yo.Button,{isPrimary:!0,onClick:()=>{!function(){const e=new FileReader;let o;if("upload"==(null!==u?"upload":"paste")){if(!u||0===u.length)return void c((0,Mo.__)("No file selected","kadence-blocks"));if(o=u[0],"image/svg+xml"!==o.type)return void c((0,Mo.__)("The selected file is not an SVG","kadence-blocks"))}else{if(!s.trim())return void c((0,Mo.__)("No SVG content pasted","kadence-blocks"));o=new Blob([s],{type:"image/svg+xml"})}e.onload=function(e){const o=e.target.result;""!==o&&Vd()({path:"/kb-custom-svg/v1/manage",data:{file:o,title:p},method:"POST"}).then(e=>{(0,Oo.has)(e,"value")&&(0,Oo.has)(e,"label")?(f((0,Mo.__)("SVG Saved.","kadence-blocks"),{type:"snackbar"}),n(e.value),t(!1)):(0,Oo.has)(e,"error")&&(0,Oo.has)(e,"message")?c(e.message):c((0,Mo.__)("An error occurred when uploading your file","kadence-blocks"))})},e.readAsText(o)}()},children:(0,Mo.__)("Add","kadence-blocks")})]})]}),"search"===o.name&&b&&(0,_o.jsx)(Vf,{isOpen:e,setIsOpen:t,callback:n})]})})})})}function zf({isOpen:e,setIsOpen:t,id:n,callback:o}){const{createSuccessNotice:a,createErrorNotice:r}=(0,To.useDispatch)(Df.store),s=()=>{r((0,Mo.__)("There was an error deleting the SVG.","kadence-blocks"),{type:"snackbar"})};return(0,_o.jsx)(_o.Fragment,{children:e&&null!==n&&(0,_o.jsxs)(yo.Modal,{title:(0,Mo.__)("Delete SVG"),onRequestClose:()=>t(!1),children:[(0,_o.jsx)(yo.Button,{isSecondary:!0,onClick:()=>t(!1),children:(0,Mo.__)("Cancel","kadence-blocks")}),(0,_o.jsx)(yo.Button,{isDestructive:!0,onClick:()=>{(e=>{Vd()({path:`/wp/v2/kadence_custom_svg/${e}`,method:"DELETE"}).then(e=>{(0,Oo.get)(e,"id",!1)?(a((0,Mo.__)("SVG Deleted.","kadence-blocks"),{type:"snackbar"}),o()):(0,Oo.has)(e,"error")&&(0,Oo.has)(e,"message")?(console.log(e.message),s()):(console.log("An error occurred when delete your svg"),s())}).catch(e=>{console.log(e),s()})})(n),t(!1)},children:(0,Mo.__)("Delete","kadence-blocks")})]})})}function Hf({value:e,onChange:t,label:n,placeholder:o=(0,Mo.__)("Select Icon","kadence-blocks"),showSearch:a=!0,renderFunc:r=null,className:s,theme:i="default",allowClear:l=!1,icons:c=null}){const[u,d]=(0,ko.useState)(),[p,h]=(0,ko.useState)(!1),[f,b]=(0,ko.useState)(""),[m,g]=(0,ko.useState)("all"),[v,x]=(0,ko.useState)(!1),[k,y]=(0,ko.useState)(!1),[_,w]=(0,ko.useState)(null),[C,j]=(0,ko.useState)(!1),[S,N]=(0,ko.useState)([]),[O,E]=(0,ko.useState)(!1),M=!(!kadence_blocks_params.pro||"true"!==kadence_blocks_params.pro),T=window?.kbpData?(0,Oo.get)(window.kbpData,["pVersion"],"1.0.0"):"1.0.0",R=(0,No.compareVersions)(T,"2.4.0")>=0,I=(0,Oo.debounce)(()=>{h(!p)},100),P=async(e=!1)=>{if(e||M&&R&&!1===C&&!O){try{E(!0);const t=await Uf(e);if(t.length>0){const e=t.map(e=>e.id.toString()),n={};t.forEach(e=>{n[e.id.toString()]=e.title.rendered.toLowerCase()}),!(0,Oo.isEqual)(e,C)&&e.length>0&&(j(e),N(n))}else j([])}catch(e){j([]),console.error("Failed to fetch custom SVGs (picker):",e)}E(!1)}};(0,ko.useEffect)(()=>{P()});const L=(0,Mo.__)("My Icons","kadence-blocks"),A=(0,ko.useMemo)(()=>{if(c){const e=c.map(e=>({value:e,label:e}));return C.length>0?{[L]:C,...e}:M&&R?{[L]:["placeholder"],...e}:e}const e=(0,hp.applyFilters)("kadence.icon_options_names",kadence_blocks_params.icon_names);return C.length>0?{[L]:C,...e}:M&&R?{[L]:["placeholder"],...e}:e},[kadence_blocks_params.icon_names,c,C]),D=(0,ko.useMemo)(()=>(0,hp.applyFilters)("kadence.icon_options",{...kadence_blocks_params_ico.icons,...kadence_blocks_params_fa.icons,...kadence_blocks_params_kbcustomicons.icons}),[kadence_blocks_params_ico.icons,kadence_blocks_params_fa.icons,kadence_blocks_params_kbcustomicons.icons,C]),F=(0,ko.useMemo)(()=>{let e=Object.keys(A).map((e,t)=>({value:t,label:e}));return[{value:"all",label:(0,Mo.__)("Show All","kadence-blocks")},...e]},[kadence_blocks_params.icon_names,A]),V=(0,ko.useCallback)(e=>e.startsWith("kb-custom")?(0,_o.jsx)(mf,{className:`kt-svg-icon-single-${e}`,name:e}):(0,_o.jsx)(ff,{className:`kt-svg-icon-single-${e}`,name:e,icon:D[e]}),[D]),B=r||V,z=(0,ko.useMemo)(()=>{let e={};if(!c){const t=f.toLowerCase();Object.keys(A).map((n,o)=>{"all"!==m&&o!==parseInt(m)||A[n].map((a,r)=>{const s=a.toLowerCase();if(""===f||s.includes(t)||0===o&&(0,Oo.has)(S,s.toString())&&S[s.toString()].includes(t))return e={...e,[o]:{label:n,icons:{...e[o]?.icons,[a]:D[a]}}},a})})}return e},[f,m,A]);return(0,_o.jsxs)("div",{className:"kadence-icon-picker",children:[(0,_o.jsx)(Bf,{isOpen:v,setIsOpen:x,callback:e=>{t("kb-custom-"+e.toString()),P(!0)},proVersion:T}),(0,_o.jsx)(zf,{isOpen:k,setIsOpen:y,id:_,callback:()=>{P(!0),w(null)}}),(0,_o.jsxs)("div",{className:`kadence-icon-picker-selection kadence-icon-picker-theme-${i||"default"}${s?" "+s:""}`,children:[n&&(0,_o.jsx)("div",{className:"kadence-icon-picker__title",children:(0,_o.jsx)("label",{className:"components-base-control__label",children:n})}),(0,_o.jsxs)("div",{className:"kadence-icon-picker-toggle-wrap",children:[(0,_o.jsxs)("button",{onClick:()=>I(),ref:d,className:"kadence-icon-picker-link kadence-icon-picker-selection-toggle",children:[(0,_o.jsx)("span",{className:"kadence-icon-picker-selection-value"+(e?"":" kadence-icon-picker-placeholder"),children:e?B(e):o}),(0,_o.jsx)("span",{className:"kadence-icon-picker-selection-arrow",children:(0,_o.jsx)(yo.Icon,{icon:nf})})]}),e&&l&&(0,_o.jsx)("button",{className:"kadence-icon-picker-clear",onClick:()=>{t(""),h(!1)},children:(0,_o.jsx)(yo.Icon,{icon:Zc})})]})]}),p&&(0,_o.jsx)(yo.Popover,{headerTitle:(0,Mo.__)("Select Icon","kadence-blocks"),noArrow:!1,onClose:I,placement:"bottom-end",anchor:u,className:`kadence-icon-picker-pop-selection kadence-icon-picker-pop-theme-${i||"default"}`,children:(0,_o.jsxs)("div",{className:"kadence-icon-picker-container",children:[a&&(0,_o.jsxs)("div",{className:"kadence-icon-picker-search",children:[(0,_o.jsx)(yo.TextControl,{label:(0,Mo.__)("Search Icons","kadence-blocks"),hideLabelFromVision:!0,value:f,placeholder:(0,Mo.__)("Search Icons","kadence-blocks"),onChange:e=>b(e)}),(0,_o.jsx)(yo.SelectControl,{label:(0,Mo.__)("Filter Icons","kadence-blocks"),hideLabelFromVision:!0,value:m,options:F,onChange:g})]}),(0,_o.jsxs)("div",{className:"kadence-icon-picker-content"+(a?" has-search":""),children:[c&&(0,_o.jsx)("div",{className:"kadence-icon-grid-wrap",children:c.map(e=>(0,_o.jsx)("button",{className:"kadence-icon-picker-link",onClick:()=>{t(e),I()},children:B(e)}))}),!c&&(0,_o.jsxs)(_o.Fragment,{children:[0===Object.keys(z).length&&(0,_o.jsx)("div",{style:{padding:"15px"},children:(0,_o.jsx)("p",{children:(0,Mo.__)("No icons found","kadence-blocks")})}),Object.keys(z).map(e=>(0,_o.jsx)(yo.PanelBody,{title:z[e].label,children:(0,_o.jsxs)("div",{className:"kadence-icon-grid-wrap",children:[z[e].label===L&&""===f&&R&&M&&(0,_o.jsx)("button",{className:"kadence-icon-picker-link add-custom-svg",onClick:()=>{x(!0),I()},children:(0,_o.jsx)(yo.Icon,{icon:Eu})}),Object.keys(z[e].icons).map(n=>{if(z[e].label===L){if("placeholder"===n)return;return(0,_o.jsxs)("div",{className:"kb-custom-svg",children:[M&&R&&(0,_o.jsx)("div",{className:"custom-svg-delete",onClick:()=>{w(n),y(!0)},children:(0,_o.jsx)(yo.Icon,{icon:Zc,size:20})}),(0,_o.jsx)("button",{title:n,className:"kadence-icon-picker-link",onClick:()=>{t("kb-custom-"+n),I()},children:B("kb-custom-"+n)},z[e].label+n)]})}return(0,_o.jsx)("button",{title:n,className:"kadence-icon-picker-link",onClick:()=>{t(n),I()},children:B(n)},z[e].label+n)})]})},e))]})]})]})})]})}const Uf=async(e=!1)=>{const t={per_page:100};e&&(t.cache_bust=(new Date).getTime());const n=new URLSearchParams(t),o=await fetch(kadence_blocks_params.rest_url+`wp/v2/kadence_custom_svg?${n.toString()}`,{method:"GET"});if(!o.ok)throw new Error("Network response was not ok");return o.json()};function Gf({label:e,value:t,onChange:n,source:o,contextPost:a=null,className:r=null,termIsMulti:s=!1,taxOnly:i=!1,termIsOptional:l=!1}){const c=`inspector-taxonomy-select-control-${(0,_c.useInstanceId)(Gf)}`,[u,d]=(0,ko.useState)(!0),[p,h]=(0,ko.useState)([]);let f="";f=i||l&&"string"==typeof t?t:(0,Oo.isArrayLike)(t)&&(0,Oo.has)(t,[0,"value"])&&!(0,Oo.isEmpty)(t)?t[0].value.split("|"):t&&!(0,Oo.isEmpty)(t)?t.split("|"):[""];const[b,m]=(0,ko.useState)("object"==typeof f?f[0]:f);return(0,ko.useEffect)(()=>{let e=o||a;if(wp.data.select("core/editor")&&!e)if(kadence_blocks_params.isKadenceE&&kadenceElementParams.previewPostID){const t=(0,No.tryParseJSON)(kadenceElementParams.previewPostID);e=t&&t.id?t.id:""}else e=wp.data.select("core/editor").getCurrentPostId();const t={source:e};d(!0),Vd()({path:(0,hc.addQueryArgs)(window.kadence_blocks_params.taxonomiesEndpoint,t)}).then(e=>{h(e||[]),d(!1)}).catch(()=>{d(!1),h([])})},[o]),u?(0,_o.jsx)(yo.Spinner,{}):(0,_o.jsxs)("div",{className:"components-base-control kb-taxonomy-select-control"+(r?" "+r:""),children:[e&&(0,_o.jsx)("label",{htmlFor:c,className:"components-taxonomy-select-control__label kb-dynamic-components-label",children:e}),(0,_o.jsx)(pc,{options:p,id:c,className:"kb-dynamic-select",classNamePrefix:"kbp",value:""!==b?p.filter(({value:e})=>e===b):"",isMulti:!1,isSearchable:!0,isClearable:!0,menuPortalTarget:document.body,styles:{menuPortal:e=>({...e,zIndex:99999999})},maxMenuHeight:200,placeholder:(0,Mo.__)("Select Taxonomy","kadence-blocks"),onChange:e=>{i||l?e?(m(e.value),n(e.value)):(m(""),n("")):m(e?e.value:"")}}),""!==b&&!i&&(0,_o.jsx)(Bd,{source:b,value:t,isMulti:s,onChange:e=>{e&&!(0,Oo.isEmpty)(e)?n(e):n(l&&b?b:"")}})]})}function $f({clientId:e,label:t=null,parentSlug:n=null}){const{selectBlock:o}=(0,To.useDispatch)(Eo.store),{firstParentClientId:a}=(0,To.useSelect)(t=>{const{getBlockParents:o,getBlockParentsByBlockName:a}=t(Eo.store);let r,s;return s=null!==n?a(e,n):o(e),r=s[s.length-1],{firstParentClientId:r}},[]);if(void 0===a)return null;const r=(0,Eo.useBlockDisplayInformation)(a);return(0,_o.jsx)("div",{className:"kadence-blocks-block-parent-selector",children:(0,_o.jsx)(yo.Button,{className:"kadence-blocks-block-parent-selector__button",onClick:()=>o(a),icon:(0,_o.jsx)(Eo.BlockIcon,{icon:r?.icon}),children:t||(0,Mo.__)("View Parent Block Settings","kadence-blocks")})},a)}function Wf({clientId:e,label:t=null,childSlug:n=null}){const{selectBlock:o}=(0,To.useDispatch)(Eo.store),{childClientId:a}=(0,To.useSelect)(t=>{const{getBlocksByClientId:o,getBlock:a}=t(Eo.store),r=(e,t)=>{const n=a(e);if(!n)return null;for(const e of n.innerBlocks){if(e.name===t)return e.clientId;const n=r(e.clientId,t);if(n)return n}return null};let s;if(null!==n)s=r(e,n);else{const t=o(e)[0]?.innerBlocks[0]||null;s=t?.clientId}return{childClientId:s}},[e,n]);if(void 0===a)return null;const r=(0,Eo.useBlockDisplayInformation)(a);return(0,_o.jsx)("div",{className:"kadence-blocks-block-child-selector",children:(0,_o.jsx)(yo.Button,{className:"kadence-blocks-block-child-selector__button",onClick:()=>o(a),icon:(0,_o.jsx)(Eo.BlockIcon,{icon:r?.icon}),children:t||(0,Mo.__)("View Child Block Settings","kadence-blocks")})},a)}function qf({label:e,onChange:t,isSaving:n,value:o="",placeholder:a=null,className:r="",obfuscate:s=!0,help:i=""}){const[l,c]=(0,ko.useState)(""),u=`inspector-obfuscate-text-control-${(0,_c.useInstanceId)(qf)}`;return[t&&(0,_o.jsxs)("div",{className:"components-base-control kadence-obfuscate-text-control"+(r?" "+r:""),children:[e&&(0,_o.jsx)("label",{htmlFor:u,className:"components-background-obfuscate-text-control__label",children:e}),(0,_o.jsxs)("div",{className:"kadence-obfuscate-text-control-inner",children:[!o&&(0,_o.jsxs)(_o.Fragment,{children:[(0,_o.jsx)(yo.TextControl,{id:u,value:l,placeholder:a,onChange:e=>c(e)}),(0,_o.jsxs)(yo.Button,{isPrimary:!0,isSmall:!0,className:"kb-obfuscate-save",onClick:()=>t(l),disabled:""===l,children:[(0,Mo.__)("Save","kadence-blocks"),n?(0,_o.jsx)(yo.Spinner,{}):""]})]}),o&&s&&(0,_o.jsxs)(_o.Fragment,{children:[(0,_o.jsx)(yo.TextControl,{id:u,value:"***************************",readOnly:!0}),(0,_o.jsxs)(yo.Button,{isSecondary:!0,isSmall:!0,className:"kb-obfuscate-save",onClick:()=>t(""),children:[(0,Mo.__)("Remove","kadence-blocks"),n?(0,_o.jsx)(yo.Spinner,{}):""]})]}),o&&!s&&(0,_o.jsxs)(_o.Fragment,{children:[(0,_o.jsx)(yo.TextControl,{id:u,value:o,readOnly:!0}),(0,_o.jsxs)(yo.Button,{isSecondary:!0,isSmall:!0,className:"kb-obfuscate-save",onClick:()=>t(""),children:[(0,Mo.__)("Clear","kadence-blocks"),n?(0,_o.jsx)(yo.Spinner,{}):""]})]})]})]})]}function Xf({postType:e="posts",title:t="",onSelect:n,initialOpen:o=!0,useForceState:a=!1,forceOpen:r=!1,onPanelBodyToggle:s}){const i=""===t?(0,Mo.__)("Posts","kadence-blocks"):t,[l,c]=(0,ko.useState)([]),[u,d]=(0,ko.useState)(!0),[p,h]=(0,ko.useState)(!1),[f,b]=(0,ko.useState)(1),[m,g]=(0,ko.useState)([]),[v,x]=(0,ko.useState)([]),[k,y]=(0,ko.useState)(!1),[_,w]=(0,ko.useState)(""),[C,j]=(0,ko.useState)("recent"),S=(0,ko.useRef)(null),N=(0,ko.useRef)(null);function O(e){return"post"===e?"posts":"page"===e?"pages":e}(0,ko.useEffect)(()=>{E()},[C,f]),(0,ko.useEffect)(()=>{const e=()=>{const e=S.current;e.scrollTop+e.clientHeight+25>=e.scrollHeight&&"search"!==C&&(u||p||!k||(b(f+1),h(!0)))},t=S.current;return t&&t.addEventListener("scroll",e),()=>{t&&t.removeEventListener("scroll",e)}},[u,p]);const E=(t="standard",n="")=>{p||d(!0);const o={per_page:30,page:f};"search"===t?o.search=n:"categories"!==e&&"product_cat"!==e&&(o.orderby="all"===C?"title":"date",o.order="all"===C?"asc":"desc"),Vd()({path:(0,hc.addQueryArgs)(`/wp/v2/${O(e)}`,o),parse:!1}).then(e=>{e.json().then(n=>{p?g(e=>[...e,...n]):"search"===t?x(n):g(n),d(!1),h(!1);const o=e.headers.get("X-WP-TotalPages");y(o>f)})}).catch(()=>{p||(g([]),x([])),d(!1),h(!1)})},M=()=>{l.length===m.length?c([]):c(m)},T=(0,ko.useMemo)(()=>(0,Oo.debounce)(e=>{E("search",e)},300),[]),R=(0,ko.useCallback)(e=>{w(e),T(e)},[T]),I=(t=null)=>{const n=t||m;return(0,_o.jsxs)("div",{children:[(0,_o.jsxs)("div",{ref:S,className:"posts-container",children:[n.map(t=>(0,_o.jsx)("div",{children:(0,_o.jsx)(yo.CheckboxControl,{label:(0,$h.decodeEntities)("categories"===e||"product_cat"===e?t?.name:t?.title?.rendered),checked:l.some(e=>e.id===t.id),onChange:()=>(e=>{c(t=>t.some(t=>t.id===e.id)?t.filter(t=>t.id!==e.id):[...t,e])})(t)})},t.id)),p&&(0,_o.jsx)("div",{children:(0,_o.jsx)(yo.Spinner,{})})]}),(0,_o.jsx)("div",{style:{marginTop:"10px"},children:(0,_o.jsx)(yo.CheckboxControl,{label:(0,Mo.__)("Select All","kadence-blocks"),checked:l.length===m.length,indeterminate:l.length>0&&l.length<m.length,onChange:M})})]})},P={};return a?P.opened=r:P.initialOpen=o,s&&(P.onToggle=s),(0,_o.jsxs)(yo.PanelBody,{className:"kb-post-selector-checkbox",title:i,...P,children:[(0,_o.jsx)(yo.TabPanel,{className:"tab-panel",activeClass:"active-tab",onSelect:e=>{C!==e&&(j(e),w(""),c([]),b(1))},tabs:[{name:"recent",title:(0,Mo.__)("Recent","kadence-blocks"),className:"tab-one"},{name:"all",title:(0,Mo.__)("All","kadence-blocks"),className:"all-tab"},{name:"search",title:(0,Mo.__)("Search","kadence-blocks"),className:"search-tab"}],children:e=>(0,_o.jsx)("div",{className:"tab-content-container",children:(0,_o.jsx)("div",{className:"tab-content",children:"recent"===e.name||"all"===e.name?(0,_o.jsx)(_o.Fragment,{children:u?(0,_o.jsx)(yo.Spinner,{}):I()}):(0,_o.jsxs)("div",{className:"search-container",children:[(0,_o.jsx)(yo.TextControl,{ref:N,value:_,onChange:e=>R(e),placeholder:(0,Mo.__)("Search posts...","kadence-blocks")}),(0,_o.jsx)(_o.Fragment,{children:u?(0,_o.jsx)(yo.Spinner,{}):I(v)})]})})})}),(0,_o.jsx)(yo.Button,{isPrimary:!0,onClick:()=>{n(l),c([])},children:(0,Mo.__)("Add to Menu","kadence-blocks")})]})}(0,Mo.__)("None","kadence-blocks"),(0,Mo.__)("None","kadence-blocks"),(0,Mo.__)("XXS","kadence-blocks"),(0,Mo.__)("2X Small","kadence-blocks"),(0,Mo.__)("XS","kadence-blocks"),(0,Mo.__)("X Small","kadence-blocks"),(0,Mo.__)("SM","kadence-blocks"),(0,Mo.__)("Small","kadence-blocks"),(0,Mo.__)("MD","kadence-blocks"),(0,Mo.__)("Medium","kadence-blocks"),(0,Mo.__)("LG","kadence-blocks"),(0,Mo.__)("Large","kadence-blocks"),(0,Mo.__)("XL","kadence-blocks"),(0,Mo.__)("X Large","kadence-blocks"),(0,Mo.__)("XXL","kadence-blocks"),(0,Mo.__)("2X Large","kadence-blocks"),(0,Mo.__)("3XL","kadence-blocks"),(0,Mo.__)("3X Large","kadence-blocks"),(0,Mo.__)("4XL","kadence-blocks"),(0,Mo.__)("4X Large","kadence-blocks"),(0,Mo.__)("5XL","kadence-blocks"),(0,Mo.__)("5X Large","kadence-blocks");const Jf=({children:e})=>{const[t,n]=(0,ko.useState)(null),o=(0,ko.useRef)(null);if((0,ko.useEffect)(()=>{if(!o.current?.parentElement)return;const e=()=>{o.current?.parentElement&&n((e=>{const{top:t,right:n,bottom:o,left:a,width:r,height:s}=e.getBoundingClientRect();return{top:t,right:n,bottom:o,left:a,width:r,height:s}})(o.current.parentElement))};e();const t=new ResizeObserver(()=>{e()});return t.observe(o.current.parentElement),()=>{o.current?.parentElement&&t.unobserve(o.current.parentElement),t.disconnect()}},[]),!t)return(0,_o.jsx)("div",{ref:o});if("function"==typeof e){const n=e(t);return n?(0,_o.jsx)("div",{ref:o,children:n}):null}return React.cloneElement(e,{...t,ref:t=>{o.current=t;const{ref:n}=e;"function"==typeof n?n(t):n&&(n.current=t)}})};function Kf(e){const{attributes:t,setAttributes:n,previewDevice:o,columns:a,columnWidths:r,columnGap:s,columnsUnlocked:i,onColumnsUnlocked:l,onResize:c,onResizeStop:u,onResizeTablet:d,onResizeStopTablet:p,onResizeMobile:h,onResizeStopMobile:f,active:b}=e,{uniqueID:m,columnGutter:g,customGutter:v,gutterType:x}=t,k=(0,No.getPreviewSize)(o,r,r,r),y=(e,t,n)=>{const a=w(e,t,n);f&&"Mobile"==o?f(a):p&&"Tablet"==o?p(a):u(a)},_=(e,t,n)=>{const a=w(e,t,n);h&&"Mobile"==o?h(a):d&&"Tablet"==o?d(a):c(a)},w=(e,t,n)=>{let o,r,s;const l=n.style.width,c=parseInt(n.dataset?.column),u=k[c],d=c+1,p=k[d],h=0==c?0:k.slice(0,c).reduce((e,t)=>e+t,0);i?(o=Math.round(10*parseFloat(l))/10-h,r=o-(u||10),s=Math.round(10*Math.abs((p||10)-r))/10):(o=5*Math.round(parseInt(l)/5)-h,r=o-(u||10),s=5*Math.round(Math.abs((p||10)-r)/5));var f=[...k];if(f[c]=o,f[d]=s,a>2){f=f.map(e=>i?Math.round(10*parseFloat(e))/10:5*Math.round(parseInt(e)/5));const e=f.reduce((e,t)=>e+t,0),t=100-e,n=c==a-2?0:f.length-1;f[n]=f[n]+t}return f},C=Bc()({"kt-resizeable-column-container":!0,[`kt-resizeable-column-container${m}`]:m,"kt-resizeable-column-inactive":!b});var j=e=>{var t=[];for(let n=0;n<a-1;n++){const o=k?.[n],r=k?.[n+1],c=0==n?0:k.slice(0,n).reduce((e,t)=>e+t,0),u=10,d="calc((((("+s+" * "+(a-1)+")) / "+a+") * "+-1*(n+1)+") + ( ("+s+" * "+n+") + ("+s+" / 2 ) ) )",p=(0,_o.jsx)(yo.ResizableBox,{className:"editor-row-column__resizer",size:{width:c+o+"%"},style:{left:d},minWidth:c+u+"%",maxWidth:c+o+r-u+"%",enable:{right:!No.isRTL,left:!!No.isRTL},handleClasses:{right:"components-resizable-box__handle components-resizable-box__handle-right",left:"components-resizable-box__handle components-resizable-box__handle-left"},handleWrapperClass:"editor-row-controls-container",grid:i?[e/1e3,1]:[e/20,1],onResize:_,onResizeStop:y,axis:"x","data-column":n,children:(0,_o.jsxs)("span",{className:"editor-row-controls-container kadence-resize-extra-controls",children:[i&&(0,_o.jsx)(yo.Tooltip,{text:(0,Mo.__)("Switch to 5% step resizing","kadence-blocks"),children:(0,_o.jsx)(yo.Button,{className:"kt-fluid-grid-btn",isSmall:!0,onClick:()=>l(!1),children:(0,_o.jsx)("svg",{viewBox:"0 0 20 20",width:"20",height:"20",xmlns:"http://www.w3.org/2000/svg",fillRule:"evenodd",clipRule:"evenodd",strokeLinejoin:"round",strokeMiterlimit:"1.414",children:(0,_o.jsx)("path",{d:"M4.217,10.611l0,2.7l-3.31,-3.311l3.31,-3.311l0,2.7l11.566,0l0,-2.7l3.31,3.311l-3.31,3.311l0,-2.7l-11.566,0Z"})})})}),!i&&(0,_o.jsx)(yo.Tooltip,{text:(0,Mo.__)("Switch to fluid resizing","kadence-blocks"),children:(0,_o.jsx)(yo.Button,{className:"kt-fluid-grid-btn",isSmall:!0,onClick:()=>l(!0),children:(0,_o.jsxs)("svg",{viewBox:"0 0 20 20",width:"20",height:"20",xmlns:"http://www.w3.org/2000/svg",fillRule:"evenodd",clipRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:"1.5",children:[(0,_o.jsx)("path",{d:"M13.967,10.611l0.001,-1.222l1.815,0l0,-2.7l3.31,3.311l-3.31,3.311l0,-2.7l-1.816,0Z"}),(0,_o.jsx)("path",{d:"M8.918,10.611l-0.022,-1.222l2.15,0l-0.031,1.222l-2.097,0Z"}),(0,_o.jsx)("path",{d:"M4.217,10.611l0,2.7l-3.31,-3.311l3.31,-3.311l0,2.7l1.693,0l-0.028,1.222l-1.665,0Z"}),(0,_o.jsx)("circle",{cx:"12.427",cy:"9.997",r:"1.419",fill:"none",stroke:"#0085ba"}),(0,_o.jsx)("circle",{cx:"7.456",cy:"9.997",r:"1.419",fill:"none",stroke:"#0085ba"})]})})}),(0,_o.jsx)("span",{id:`left-column-width-${n}`,className:"left-column-width-size column-width-size-handle",children:o+"%"}),(0,_o.jsx)("span",{id:`right-column-width-${n}`,className:"right-column-width-size column-width-size-handle",children:r+"%"})]})});t.push(p)}return t};return(0,_o.jsx)("div",{className:C,children:(0,_o.jsx)(Jf,{children:({width:e})=>(0,_o.jsx)(_o.Fragment,{children:j(e)})})})}const Yf=({steps:e,isOpen:t,onRequestClose:n,onSubmit:o})=>{const[a,r]=(0,ko.useState)(0),[s,i]=(0,ko.useState)({meta:{isValid:!0}}),l=()=>{a<e.length-1&&r(a+1)},c=()=>{a>0&&r(a-1)},u=()=>{delete s.meta,o(s),n({complete:!0})};if((0,ko.useEffect)(()=>{Number.isInteger(s?.meta?.exitAndCallbackStep)&&s?.meta?.exitAndCallbackStep===a&&u()},[s,a]),(0,ko.useEffect)(()=>{const e=document.getElementsByClassName("has-scrolled-content");for(let t=0;t<e.length;t++)e[t].scrollTo(0,0)},[a]),t)return(0,_o.jsxs)(yo.Modal,{className:"kadence-onboarding-modal",isDismissible:!1,__experimentalHideHeader:!0,size:"fill",onRequestClose:n,children:[(0,_o.jsxs)("div",{className:"header",style:e[a]?.containerData?.headerStyle,children:[(0,_o.jsx)("img",{src:kadence_blocks_params.kadenceBlocksUrl+"/includes/settings/img/kadence-logo.png",alt:"Kadence Blocks"}),(0,_o.jsx)("div",{className:"close",onClick:()=>{delete s.meta,n({complete:!1})},children:(0,_o.jsx)(yo.Dashicon,{icon:"no-alt"})})]}),(0,_o.jsx)("div",{children:React.createElement(e[a].component,{data:s,componentData:e[a].componentData,onChange:e=>(e=>{i(t=>({...t,...e}))})(e),handleNextStep:l,handlePreviousStep:c,handleFinish:u})},a),(0,_o.jsxs)("div",{className:"footer",children:[(0,_o.jsx)("div",{className:"back",children:(0,_o.jsx)(yo.Button,{onClick:c,icon:"arrow-left-alt",disabled:0===a,children:(0,Mo.__)("Back","kadence-blocks")})}),(0,_o.jsx)("div",{className:"step-indicator",children:e[a]?.hideSteps?null:e.map((e,t)=>e?.hideSteps?null:(0,_o.jsxs)("div",{className:"step "+(t===a?"active":""),children:[(0,_o.jsx)("div",{className:"number",children:e.visualNumber}),(0,Mo.__)(e.name,"kadence-blocks")]},t))}),(0,_o.jsx)("div",{className:"next",children:a<e.length-1?(0,_o.jsx)(yo.Button,{isPrimary:!0,disabled:!s.meta.isValid,onClick:l,children:s.meta?.nextText?s.meta.nextText:(0,Mo.__)("Next","kadence-blocks")}):(0,_o.jsx)(yo.Button,{isPrimary:!0,onClick:u,children:(0,Mo.__)("Finish","kadence-blocks")})})]})]})}})(),(this.kadence=this.kadence||{}).components=r})();
  • kadence-blocks/trunk/kadence-blocks.php

    r3391357 r3408408  
    66 * Author: Kadence WP
    77 * Author URI: https://www.kadencewp.com
    8  * Version: 3.5.27
     8 * Version: 3.5.28
    99 * Requires PHP: 7.4
    1010 * Text Domain: kadence-blocks
     
    2121define( 'KADENCE_BLOCKS_PATH', realpath( plugin_dir_path( __FILE__ ) ) . DIRECTORY_SEPARATOR );
    2222define( 'KADENCE_BLOCKS_URL', plugin_dir_url( __FILE__ ) );
    23 define( 'KADENCE_BLOCKS_VERSION', '3.5.27' );
     23define( 'KADENCE_BLOCKS_VERSION', '3.5.28' );
    2424
    2525require_once plugin_dir_path( __FILE__ ) . 'vendor/vendor-prefixed/autoload.php';
  • kadence-blocks/trunk/readme.txt

    r3391357 r3408408  
    44Donate link: https://www.kadencewp.com/about-us/
    55Requires at least: 6.6
    6 Tested up to: 6.8.3
    7 Stable tag: 3.5.27
     6Tested up to: 6.9
     7Stable tag: 3.5.28
    88Requires PHP: 7.4
    99License: GPLv2 or later
     
    174174
    175175== Changelog ==
     176= 3.5.28 =
     177Release Date: 2nd December 2025
     178* Update: Improve compatibility with WordPress 6.9.
     179
    176180= 3.5.27 =
    177181Release Date: 6th November 2025
  • kadence-blocks/trunk/vendor/autoload.php

    r3303153 r3408408  
    2020require_once __DIR__ . '/composer/autoload_real.php';
    2121
    22 return ComposerAutoloaderInit6d32022b9c863d1c3003f9643a50ed81::getLoader();
     22return ComposerAutoloaderInit6e3141dc35a5efed55bf0b472cccdf31::getLoader();
  • kadence-blocks/trunk/vendor/composer/autoload_real.php

    r3303153 r3408408  
    33// autoload_real.php @generated by Composer
    44
    5 class ComposerAutoloaderInit6d32022b9c863d1c3003f9643a50ed81
     5class ComposerAutoloaderInit6e3141dc35a5efed55bf0b472cccdf31
    66{
    77    private static $loader;
     
    2323        }
    2424
    25         spl_autoload_register(array('ComposerAutoloaderInit6d32022b9c863d1c3003f9643a50ed81', 'loadClassLoader'), true, true);
     25        spl_autoload_register(array('ComposerAutoloaderInit6e3141dc35a5efed55bf0b472cccdf31', 'loadClassLoader'), true, true);
    2626        self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
    27         spl_autoload_unregister(array('ComposerAutoloaderInit6d32022b9c863d1c3003f9643a50ed81', 'loadClassLoader'));
     27        spl_autoload_unregister(array('ComposerAutoloaderInit6e3141dc35a5efed55bf0b472cccdf31', 'loadClassLoader'));
    2828
    2929        require __DIR__ . '/autoload_static.php';
    30         call_user_func(\Composer\Autoload\ComposerStaticInit6d32022b9c863d1c3003f9643a50ed81::getInitializer($loader));
     30        call_user_func(\Composer\Autoload\ComposerStaticInit6e3141dc35a5efed55bf0b472cccdf31::getInitializer($loader));
    3131
    3232        $loader->register(true);
  • kadence-blocks/trunk/vendor/composer/autoload_static.php

    r3303153 r3408408  
    55namespace Composer\Autoload;
    66
    7 class ComposerStaticInit6d32022b9c863d1c3003f9643a50ed81
     7class ComposerStaticInit6e3141dc35a5efed55bf0b472cccdf31
    88{
    99    public static $prefixLengthsPsr4 = array (
     
    5252    {
    5353        return \Closure::bind(function () use ($loader) {
    54             $loader->prefixLengthsPsr4 = ComposerStaticInit6d32022b9c863d1c3003f9643a50ed81::$prefixLengthsPsr4;
    55             $loader->prefixDirsPsr4 = ComposerStaticInit6d32022b9c863d1c3003f9643a50ed81::$prefixDirsPsr4;
    56             $loader->classMap = ComposerStaticInit6d32022b9c863d1c3003f9643a50ed81::$classMap;
     54            $loader->prefixLengthsPsr4 = ComposerStaticInit6e3141dc35a5efed55bf0b472cccdf31::$prefixLengthsPsr4;
     55            $loader->prefixDirsPsr4 = ComposerStaticInit6e3141dc35a5efed55bf0b472cccdf31::$prefixDirsPsr4;
     56            $loader->classMap = ComposerStaticInit6e3141dc35a5efed55bf0b472cccdf31::$classMap;
    5757
    5858        }, null, ClassLoader::class);
  • kadence-blocks/trunk/vendor/composer/installed.json

    r3303153 r3408408  
    209209        {
    210210            "name": "enshrined/svg-sanitize",
    211             "version": "0.21.0",
    212             "version_normalized": "0.21.0.0",
     211            "version": "0.22.0",
     212            "version_normalized": "0.22.0.0",
    213213            "source": {
    214214                "type": "git",
    215215                "url": "https://github.com/darylldoyle/svg-sanitizer.git",
    216                 "reference": "5e477468fac5c5ce933dce53af3e8e4e58dcccc9"
    217             },
    218             "dist": {
    219                 "type": "zip",
    220                 "url": "https://api.github.com/repos/darylldoyle/svg-sanitizer/zipball/5e477468fac5c5ce933dce53af3e8e4e58dcccc9",
    221                 "reference": "5e477468fac5c5ce933dce53af3e8e4e58dcccc9",
     216                "reference": "0afa95ea74be155a7bcd6c6fb60c276c39984500"
     217            },
     218            "dist": {
     219                "type": "zip",
     220                "url": "https://api.github.com/repos/darylldoyle/svg-sanitizer/zipball/0afa95ea74be155a7bcd6c6fb60c276c39984500",
     221                "reference": "0afa95ea74be155a7bcd6c6fb60c276c39984500",
    222222                "shasum": ""
    223223            },
     
    230230                "phpunit/phpunit": "^6.5 || ^8.5"
    231231            },
    232             "time": "2025-01-13T09:32:25+00:00",
     232            "time": "2025-08-12T10:13:48+00:00",
    233233            "type": "library",
    234234            "installation-source": "dist",
     
    251251            "support": {
    252252                "issues": "https://github.com/darylldoyle/svg-sanitizer/issues",
    253                 "source": "https://github.com/darylldoyle/svg-sanitizer/tree/0.21.0"
     253                "source": "https://github.com/darylldoyle/svg-sanitizer/tree/0.22.0"
    254254            },
    255255            "install-path": "../enshrined/svg-sanitize"
  • kadence-blocks/trunk/vendor/composer/installed.php

    r3391357 r3408408  
    22    'root' => array(
    33        'name' => 'kadencewp/kadence-blocks',
    4         'pretty_version' => '3.5.27',
    5         'version' => '3.5.27.0',
    6         'reference' => '6de882e08a868968a2693ec66969515094f2cfb5',
     4        'pretty_version' => '3.5.28',
     5        'version' => '3.5.28.0',
     6        'reference' => 'f82abcca7da0e05521afbb8adf8faa35ccb6f242',
    77        'type' => 'wordpress-plugin',
    88        'install_path' => __DIR__ . '/../../',
     
    3030        ),
    3131        'enshrined/svg-sanitize' => array(
    32             'pretty_version' => '0.21.0',
    33             'version' => '0.21.0.0',
    34             'reference' => '5e477468fac5c5ce933dce53af3e8e4e58dcccc9',
     32            'pretty_version' => '0.22.0',
     33            'version' => '0.22.0.0',
     34            'reference' => '0afa95ea74be155a7bcd6c6fb60c276c39984500',
    3535            'type' => 'library',
    3636            'install_path' => __DIR__ . '/../enshrined/svg-sanitize',
     
    4848        ),
    4949        'kadencewp/kadence-blocks' => array(
    50             'pretty_version' => '3.5.27',
    51             'version' => '3.5.27.0',
    52             'reference' => '6de882e08a868968a2693ec66969515094f2cfb5',
     50            'pretty_version' => '3.5.28',
     51            'version' => '3.5.28.0',
     52            'reference' => 'f82abcca7da0e05521afbb8adf8faa35ccb6f242',
    5353            'type' => 'wordpress-plugin',
    5454            'install_path' => __DIR__ . '/../../',
  • kadence-blocks/trunk/vendor/vendor-prefixed/enshrined/svg-sanitize/src/Sanitizer.php

    r3257981 r3408408  
    427427             * We have to do this as the link is still ran in this case.
    428428             */
    429             if (false !== strpos($attrName, 'href')) {
     429            if (false !== stripos($attrName, 'href')) {
    430430                $href = $element->getAttribute($attrName);
    431431                if (false === $this->isHrefSafeValue($href)) {
     
    459459    protected function cleanXlinkHrefs(\DOMElement $element)
    460460    {
    461         $xlinks = $element->getAttributeNS('http://www.w3.org/1999/xlink', 'href');
    462         if (false === $this->isHrefSafeValue($xlinks)) {
    463             $element->removeAttributeNS( 'http://www.w3.org/1999/xlink', 'href' );
    464             $this->xmlIssues[] = array(
    465                 'message' => 'Suspicious attribute \'href\'',
    466                 'line' => $element->getLineNo(),
    467             );
    468         }
     461        foreach ($element->attributes as $attribute) {
     462            // remove attributes with unexpected namespace prefix, e.g. `XLinK:href` (instead of `xlink:href`)
     463            if ($attribute->prefix === '' && strtolower($attribute->nodeName) === 'xlink:href') {
     464                $element->removeAttribute($attribute->nodeName);
     465                $this->xmlIssues[] = array(
     466                    'message' => sprintf('Unexpected attribute \'%s\'', $attribute->nodeName),
     467                    'line' => $element->getLineNo(),
     468                );
     469            }
     470        }
     471        $this->cleanHrefAttributes($element, 'xlink');
    469472    }
    470473
     
    476479    protected function cleanHrefs(\DOMElement $element)
    477480    {
    478         $href = $element->getAttribute('href');
    479         if (false === $this->isHrefSafeValue($href)) {
    480             $element->removeAttribute('href');
    481             $this->xmlIssues[] = array(
    482                 'message' => 'Suspicious attribute \'href\'',
    483                 'line' => $element->getLineNo(),
    484             );
     481        $this->cleanHrefAttributes($element);
     482    }
     483
     484    protected function cleanHrefAttributes(\DOMElement $element, string $prefix = ''): void
     485    {
     486        $relevantAttributes = array_filter(
     487            iterator_to_array($element->attributes),
     488            static function (\DOMAttr $attr) use ($prefix) {
     489                return strtolower($attr->name) === 'href' && strtolower($attr->prefix) === $prefix;
     490            }
     491        );
     492        foreach ($relevantAttributes as $attribute) {
     493            if (!$this->isHrefSafeValue($attribute->value)) {
     494                $element->removeAttribute($attribute->nodeName);
     495                $this->xmlIssues[] = array(
     496                    'message' => sprintf('Suspicious attribute \'%s\'', $attribute->nodeName),
     497                    'line' => $element->getLineNo(),
     498                );
     499                continue;
     500            }
     501            // in case the attribute name is `HrEf`/`xlink:HrEf`, adjust it to `href`/`xlink:href`
     502            if (!in_array($attribute->nodeName, $this->allowedAttrs, true)
     503                && in_array(strtolower($attribute->nodeName), $this->allowedAttrs, true)
     504            ) {
     505                $element->removeAttribute($attribute->nodeName);
     506                $element->setAttribute(strtolower($attribute->nodeName), $attribute->value);
     507            }
    485508        }
    486509    }
Note: See TracChangeset for help on using the changeset viewer.