HEX
Server: LiteSpeed
System: Linux premium290.web-hosting.com 4.18.0-553.45.1.lve.el8.x86_64 #1 SMP Wed Mar 26 12:08:09 UTC 2025 x86_64
User: karemvyp (1881)
PHP: 8.1.33
Disabled: NONE
Upload Files
File: /home/karemvyp/h555.com.pk/wp-content/plugins/kadence-blocks/dist/header-visual-builder.js
(()=>{var e={6942:(e,t)=>{var n;!function(){"use strict";var r={}.hasOwnProperty;function o(){for(var e="",t=0;t<arguments.length;t++){var n=arguments[t];n&&(e=s(e,i(n)))}return e}function i(e){if("string"==typeof e||"number"==typeof e)return e;if("object"!=typeof e)return"";if(Array.isArray(e))return o.apply(null,e);if(e.toString!==Object.prototype.toString&&!e.toString.toString().includes("[native code]"))return e.toString();var t="";for(var n in e)r.call(e,n)&&e[n]&&(t=s(t,n));return t}function s(e,t){return t?e?e+" "+t:e+t:e}e.exports?(o.default=o,e.exports=o):void 0===(n=function(){return o}.apply(t,[]))||(e.exports=n)}()}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r](i,i.exports,n),i.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";const e=window.wp.element,t=window.wp.data,r=window.wp.i18n,o=window.wp.components,i=(window.kadence.icons,window.ReactJSXRuntime),s=window.kadence.helpers,a=window.lodash,l=window.wp.primitives,c=(0,i.jsx)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,i.jsx)(l.Path,{d:"M12 13.06l3.712 3.713 1.061-1.06L13.061 12l3.712-3.712-1.06-1.06L12 10.938 8.288 7.227l-1.061 1.06L10.939 12l-3.712 3.712 1.06 1.061L12 13.061z"})});function d({isVisible:e,setIsVisible:t}){return(0,i.jsx)(o.Button,{className:"kb-header-visual-builder-modal-close","aria-label":(0,r.__)("Close Modal","kadence-blocks"),onClick:()=>{t(!e)},variant:"secondary",icon:c,iconSize:18,children:(0,r.__)("Hide","kadence-blocks")})}const u=window.React;var f=n.n(u);const v=window.ReactDOM,h="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;function g(e){const t=Object.prototype.toString.call(e);return"[object Window]"===t||"[object global]"===t}function p(e){return"nodeType"in e}function b(e){var t,n;return e?g(e)?e:p(e)&&null!=(t=null==(n=e.ownerDocument)?void 0:n.defaultView)?t:window:window}function m(e){const{Document:t}=b(e);return e instanceof t}function w(e){return!g(e)&&e instanceof b(e).HTMLElement}function y(e){return e instanceof b(e).SVGElement}function x(e){return e?g(e)?e.document:p(e)?m(e)?e:w(e)||y(e)?e.ownerDocument:document:document:document}const k=h?u.useLayoutEffect:u.useEffect;function C(e){const t=(0,u.useRef)(e);return k(()=>{t.current=e}),(0,u.useCallback)(function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return null==t.current?void 0:t.current(...n)},[])}function D(e,t){void 0===t&&(t=[e]);const n=(0,u.useRef)(e);return k(()=>{n.current!==e&&(n.current=e)},t),n}function I(e,t){const n=(0,u.useRef)();return(0,u.useMemo)(()=>{const t=e(n.current);return n.current=t,t},[...t])}function E(e){const t=C(e),n=(0,u.useRef)(null),r=(0,u.useCallback)(e=>{e!==n.current&&(null==t||t(e,n.current)),n.current=e},[]);return[n,r]}function R(e){const t=(0,u.useRef)();return(0,u.useEffect)(()=>{t.current=e},[e]),t.current}let S={};function N(e,t){return(0,u.useMemo)(()=>{if(t)return t;const n=null==S[e]?0:S[e]+1;return S[e]=n,e+"-"+n},[e,t])}function j(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return r.reduce((t,n)=>{const r=Object.entries(n);for(const[n,o]of r){const r=t[n];null!=r&&(t[n]=r+e*o)}return t},{...t})}}const B=j(1),M=j(-1);function O(e){if(!e)return!1;const{KeyboardEvent:t}=b(e.target);return t&&e instanceof t}function T(e){if(function(e){if(!e)return!1;const{TouchEvent:t}=b(e.target);return t&&e instanceof t}(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return function(e){return"clientX"in e&&"clientY"in e}(e)?{x:e.clientX,y:e.clientY}:null}const _=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[_.Translate.toString(e),_.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),A="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function L(e){return e.matches(A)?e:e.querySelector(A)}const P={display:"none"};function z(e){let{id:t,value:n}=e;return f().createElement("div",{id:t,style:P},n)}function $(e){let{id:t,announcement:n,ariaLiveType:r="assertive"}=e;return f().createElement("div",{id:t,style:{position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"},role:"status","aria-live":r,"aria-atomic":!0},n)}const F=(0,u.createContext)(null),Y={draggable:"\n    To pick up a draggable item, press the space bar.\n    While dragging, use the arrow keys to move the item.\n    Press space again to drop the item in its new position, or press escape to cancel.\n  "},V={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function X(e){let{announcements:t=V,container:n,hiddenTextDescribedById:r,screenReaderInstructions:o=Y}=e;const{announce:i,announcement:s}=function(){const[e,t]=(0,u.useState)("");return{announce:(0,u.useCallback)(e=>{null!=e&&t(e)},[]),announcement:e}}(),a=N("DndLiveRegion"),[l,c]=(0,u.useState)(!1);if((0,u.useEffect)(()=>{c(!0)},[]),function(e){const t=(0,u.useContext)(F);(0,u.useEffect)(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}((0,u.useMemo)(()=>({onDragStart(e){let{active:n}=e;i(t.onDragStart({active:n}))},onDragMove(e){let{active:n,over:r}=e;t.onDragMove&&i(t.onDragMove({active:n,over:r}))},onDragOver(e){let{active:n,over:r}=e;i(t.onDragOver({active:n,over:r}))},onDragEnd(e){let{active:n,over:r}=e;i(t.onDragEnd({active:n,over:r}))},onDragCancel(e){let{active:n,over:r}=e;i(t.onDragCancel({active:n,over:r}))}}),[i,t])),!l)return null;const d=f().createElement(f().Fragment,null,f().createElement(z,{id:r,value:o.draggable}),f().createElement($,{id:a,announcement:s}));return n?(0,v.createPortal)(d,n):d}var H;function U(){}!function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"}(H||(H={}));const K=Object.freeze({x:0,y:0});function W(e,t){const n=T(e);return n?(n.x-t.left)/t.width*100+"% "+(n.y-t.top)/t.height*100+"%":"0 0"}function J(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function q(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),o=Math.min(t.left+t.width,e.left+e.width),i=Math.min(t.top+t.height,e.top+e.height),s=o-r,a=i-n;if(r<o&&n<i){const n=t.width*t.height,r=e.width*e.height,o=s*a;return Number((o/(n+r-o)).toFixed(4))}return 0}const G=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=[];for(const e of r){const{id:r}=e,i=n.get(r);if(i){const n=q(i,t);n>0&&o.push({id:r,data:{droppableContainer:e,value:n}})}}return o.sort(J)};function Q(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:K}function Z(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return r.reduce((t,n)=>({...t,top:t.top+e*n.y,bottom:t.bottom+e*n.y,left:t.left+e*n.x,right:t.right+e*n.x}),{...t})}}const ee=Z(1);function te(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}const ne={ignoreTransform:!1};function re(e,t){void 0===t&&(t=ne);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:t,transformOrigin:r}=b(e).getComputedStyle(e);t&&(n=function(e,t,n){const r=te(t);if(!r)return e;const{scaleX:o,scaleY:i,x:s,y:a}=r,l=e.left-s-(1-o)*parseFloat(n),c=e.top-a-(1-i)*parseFloat(n.slice(n.indexOf(" ")+1)),d=o?e.width/o:e.width,u=i?e.height/i:e.height;return{width:d,height:u,top:c,right:l+d,bottom:c+u,left:l}}(n,t,r))}const{top:r,left:o,width:i,height:s,bottom:a,right:l}=n;return{top:r,left:o,width:i,height:s,bottom:a,right:l}}function oe(e){return re(e,{ignoreTransform:!0})}function ie(e,t){const n=[];return e?function r(o){if(null!=t&&n.length>=t)return n;if(!o)return n;if(m(o)&&null!=o.scrollingElement&&!n.includes(o.scrollingElement))return n.push(o.scrollingElement),n;if(!w(o)||y(o))return n;if(n.includes(o))return n;const i=b(e).getComputedStyle(o);return o!==e&&function(e,t){void 0===t&&(t=b(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(e=>{const r=t[e];return"string"==typeof r&&n.test(r)})}(o,i)&&n.push(o),function(e,t){return void 0===t&&(t=b(e).getComputedStyle(e)),"fixed"===t.position}(o,i)?n:r(o.parentNode)}(e):n}function se(e){const[t]=ie(e,1);return null!=t?t:null}function ae(e){return h&&e?g(e)?e:p(e)?m(e)||e===x(e).scrollingElement?window:w(e)?e:null:null:null}function le(e){return g(e)?e.scrollX:e.scrollLeft}function ce(e){return g(e)?e.scrollY:e.scrollTop}function de(e){return{x:le(e),y:ce(e)}}var ue;function fe(e){return!(!h||!e)&&e===document.scrollingElement}function ve(e){const t={x:0,y:0},n=fe(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height};return{isTop:e.scrollTop<=t.y,isLeft:e.scrollLeft<=t.x,isBottom:e.scrollTop>=r.y,isRight:e.scrollLeft>=r.x,maxScroll:r,minScroll:t}}!function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"}(ue||(ue={}));const he={x:.2,y:.2};function ge(e,t,n,r,o){let{top:i,left:s,right:a,bottom:l}=n;void 0===r&&(r=10),void 0===o&&(o=he);const{isTop:c,isBottom:d,isLeft:u,isRight:f}=ve(e),v={x:0,y:0},h={x:0,y:0},g=t.height*o.y,p=t.width*o.x;return!c&&i<=t.top+g?(v.y=ue.Backward,h.y=r*Math.abs((t.top+g-i)/g)):!d&&l>=t.bottom-g&&(v.y=ue.Forward,h.y=r*Math.abs((t.bottom-g-l)/g)),!f&&a>=t.right-p?(v.x=ue.Forward,h.x=r*Math.abs((t.right-p-a)/p)):!u&&s<=t.left+p&&(v.x=ue.Backward,h.x=r*Math.abs((t.left+p-s)/p)),{direction:v,speed:h}}function pe(e){if(e===document.scrollingElement){const{innerWidth:e,innerHeight:t}=window;return{top:0,left:0,right:e,bottom:t,width:e,height:t}}const{top:t,left:n,right:r,bottom:o}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:o,width:e.clientWidth,height:e.clientHeight}}function be(e){return e.reduce((e,t)=>B(e,de(t)),K)}function me(e,t){if(void 0===t&&(t=re),!e)return;const{top:n,left:r,bottom:o,right:i}=t(e);se(e)&&(o<=0||i<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const we=[["x",["left","right"],function(e){return e.reduce((e,t)=>e+le(t),0)}],["y",["top","bottom"],function(e){return e.reduce((e,t)=>e+ce(t),0)}]];class ye{constructor(e,t){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const n=ie(t),r=be(n);this.rect={...e},this.width=e.width,this.height=e.height;for(const[e,t,o]of we)for(const i of t)Object.defineProperty(this,i,{get:()=>{const t=o(n),s=r[e]-t;return this.rect[i]+s},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class xe{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(e=>{var t;return null==(t=this.target)?void 0:t.removeEventListener(...e)})},this.target=e}add(e,t,n){var r;null==(r=this.target)||r.addEventListener(e,t,n),this.listeners.push([e,t,n])}}function ke(e,t){const n=Math.abs(e.x),r=Math.abs(e.y);return"number"==typeof t?Math.sqrt(n**2+r**2)>t:"x"in t&&"y"in t?n>t.x&&r>t.y:"x"in t?n>t.x:"y"in t&&r>t.y}var Ce,De,Ie;function Ee(e){e.preventDefault()}function Re(e){e.stopPropagation()}!function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"}(Ce||(Ce={})),(Ie=De||(De={})).Space="Space",Ie.Down="ArrowDown",Ie.Right="ArrowRight",Ie.Left="ArrowLeft",Ie.Up="ArrowUp",Ie.Esc="Escape",Ie.Enter="Enter",Ie.Tab="Tab";const Se={start:[De.Space,De.Enter],cancel:[De.Esc],end:[De.Space,De.Enter,De.Tab]},Ne=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case De.Right:return{...n,x:n.x+25};case De.Left:return{...n,x:n.x-25};case De.Down:return{...n,y:n.y+25};case De.Up:return{...n,y:n.y-25}}};class je{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;const{event:{target:t}}=e;this.props=e,this.listeners=new xe(x(t)),this.windowListeners=new xe(b(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Ce.Resize,this.handleCancel),this.windowListeners.add(Ce.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Ce.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:e,onStart:t}=this.props,n=e.node.current;n&&me(n),t(K)}handleKeyDown(e){if(O(e)){const{active:t,context:n,options:r}=this.props,{keyboardCodes:o=Se,coordinateGetter:i=Ne,scrollBehavior:s="smooth"}=r,{code:a}=e;if(o.end.includes(a))return void this.handleEnd(e);if(o.cancel.includes(a))return void this.handleCancel(e);const{collisionRect:l}=n.current,c=l?{x:l.left,y:l.top}:K;this.referenceCoordinates||(this.referenceCoordinates=c);const d=i(e,{active:t,context:n.current,currentCoordinates:c});if(d){const t=M(d,c),r={x:0,y:0},{scrollableAncestors:o}=n.current;for(const n of o){const o=e.code,{isTop:i,isRight:a,isLeft:l,isBottom:c,maxScroll:u,minScroll:f}=ve(n),v=pe(n),h={x:Math.min(o===De.Right?v.right-v.width/2:v.right,Math.max(o===De.Right?v.left:v.left+v.width/2,d.x)),y:Math.min(o===De.Down?v.bottom-v.height/2:v.bottom,Math.max(o===De.Down?v.top:v.top+v.height/2,d.y))},g=o===De.Right&&!a||o===De.Left&&!l,p=o===De.Down&&!c||o===De.Up&&!i;if(g&&h.x!==d.x){const e=n.scrollLeft+t.x,i=o===De.Right&&e<=u.x||o===De.Left&&e>=f.x;if(i&&!t.y)return void n.scrollTo({left:e,behavior:s});r.x=i?n.scrollLeft-e:o===De.Right?n.scrollLeft-u.x:n.scrollLeft-f.x,r.x&&n.scrollBy({left:-r.x,behavior:s});break}if(p&&h.y!==d.y){const e=n.scrollTop+t.y,i=o===De.Down&&e<=u.y||o===De.Up&&e>=f.y;if(i&&!t.x)return void n.scrollTo({top:e,behavior:s});r.y=i?n.scrollTop-e:o===De.Down?n.scrollTop-u.y:n.scrollTop-f.y,r.y&&n.scrollBy({top:-r.y,behavior:s});break}}this.handleMove(e,B(M(d,this.referenceCoordinates),r))}}}handleMove(e,t){const{onMove:n}=this.props;e.preventDefault(),n(t)}handleEnd(e){const{onEnd:t}=this.props;e.preventDefault(),this.detach(),t()}handleCancel(e){const{onCancel:t}=this.props;e.preventDefault(),this.detach(),t()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}function Be(e){return Boolean(e&&"distance"in e)}function Me(e){return Boolean(e&&"delay"in e)}je.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=Se,onActivation:o}=t,{active:i}=n;const{code:s}=e.nativeEvent;if(r.start.includes(s)){const t=i.activatorNode.current;return!(t&&e.target!==t||(e.preventDefault(),null==o||o({event:e.nativeEvent}),0))}return!1}}];class Oe{constructor(e,t,n){var r;void 0===n&&(n=function(e){const{EventTarget:t}=b(e);return e instanceof t?e:x(e)}(e.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=e,this.events=t;const{event:o}=e,{target:i}=o;this.props=e,this.events=t,this.document=x(i),this.documentListeners=new xe(this.document),this.listeners=new xe(n),this.windowListeners=new xe(b(i)),this.initialCoordinates=null!=(r=T(o))?r:K,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:e,props:{options:{activationConstraint:t,bypassActivationConstraint:n}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),e.cancel&&this.listeners.add(e.cancel.name,this.handleCancel),this.windowListeners.add(Ce.Resize,this.handleCancel),this.windowListeners.add(Ce.DragStart,Ee),this.windowListeners.add(Ce.VisibilityChange,this.handleCancel),this.windowListeners.add(Ce.ContextMenu,Ee),this.documentListeners.add(Ce.Keydown,this.handleKeydown),t){if(null!=n&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Me(t))return this.timeoutId=setTimeout(this.handleStart,t.delay),void this.handlePending(t);if(Be(t))return void this.handlePending(t)}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),null!==this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(e,t){const{active:n,onPending:r}=this.props;r(n,e,this.initialCoordinates,t)}handleStart(){const{initialCoordinates:e}=this,{onStart:t}=this.props;e&&(this.activated=!0,this.documentListeners.add(Ce.Click,Re,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Ce.SelectionChange,this.removeTextSelection),t(e))}handleMove(e){var t;const{activated:n,initialCoordinates:r,props:o}=this,{onMove:i,options:{activationConstraint:s}}=o;if(!r)return;const a=null!=(t=T(e))?t:K,l=M(r,a);if(!n&&s){if(Be(s)){if(null!=s.tolerance&&ke(l,s.tolerance))return this.handleCancel();if(ke(l,s.distance))return this.handleStart()}return Me(s)&&ke(l,s.tolerance)?this.handleCancel():void this.handlePending(s,l)}e.cancelable&&e.preventDefault(),i(a)}handleEnd(){const{onAbort:e,onEnd:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleCancel(){const{onAbort:e,onCancel:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleKeydown(e){e.code===De.Esc&&this.handleCancel()}removeTextSelection(){var e;null==(e=this.document.getSelection())||e.removeAllRanges()}}const Te={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class _e extends Oe{constructor(e){const{event:t}=e,n=x(t.target);super(e,Te,n)}}_e.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!(!n.isPrimary||0!==n.button||(null==r||r({event:n}),0))}}];const Ae={move:{name:"mousemove"},end:{name:"mouseup"}};var Le;!function(e){e[e.RightClick=2]="RightClick"}(Le||(Le={})),class extends Oe{constructor(e){super(e,Ae,x(e.event.target))}}.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button!==Le.RightClick&&(null==r||r({event:n}),!0)}}];const Pe={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};var ze,$e;(class extends Oe{constructor(e){super(e,Pe)}static setup(){return window.addEventListener(Pe.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(Pe.move.name,e)};function e(){}}}).activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;const{touches:o}=n;return!(o.length>1||(null==r||r({event:n}),0))}}],function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"}(ze||(ze={})),function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"}($e||($e={}));const Fe={x:{[ue.Backward]:!1,[ue.Forward]:!1},y:{[ue.Backward]:!1,[ue.Forward]:!1}};var Ye,Ve;!function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"}(Ye||(Ye={})),function(e){e.Optimized="optimized"}(Ve||(Ve={}));const Xe=new Map;function He(e,t){return I(n=>e?n||("function"==typeof t?t(e):e):null,[t,e])}function Ue(e){let{callback:t,disabled:n}=e;const r=C(t),o=(0,u.useMemo)(()=>{if(n||"undefined"==typeof window||void 0===window.ResizeObserver)return;const{ResizeObserver:e}=window;return new e(r)},[n]);return(0,u.useEffect)(()=>()=>null==o?void 0:o.disconnect(),[o]),o}function Ke(e){return new ye(re(e),e)}function We(e,t,n){void 0===t&&(t=Ke);const[r,o]=(0,u.useState)(null);function i(){o(r=>{if(!e)return null;var o;if(!1===e.isConnected)return null!=(o=null!=r?r:n)?o:null;const i=t(e);return JSON.stringify(r)===JSON.stringify(i)?r:i})}const s=function(e){let{callback:t,disabled:n}=e;const r=C(t),o=(0,u.useMemo)(()=>{if(n||"undefined"==typeof window||void 0===window.MutationObserver)return;const{MutationObserver:e}=window;return new e(r)},[r,n]);return(0,u.useEffect)(()=>()=>null==o?void 0:o.disconnect(),[o]),o}({callback(t){if(e)for(const n of t){const{type:t,target:r}=n;if("childList"===t&&r instanceof HTMLElement&&r.contains(e)){i();break}}}}),a=Ue({callback:i});return k(()=>{i(),e?(null==a||a.observe(e),null==s||s.observe(document.body,{childList:!0,subtree:!0})):(null==a||a.disconnect(),null==s||s.disconnect())},[e]),r}const Je=[];function qe(e,t){void 0===t&&(t=[]);const n=(0,u.useRef)(null);return(0,u.useEffect)(()=>{n.current=null},t),(0,u.useEffect)(()=>{const t=e!==K;t&&!n.current&&(n.current=e),!t&&n.current&&(n.current=null)},[e]),n.current?M(e,n.current):K}function Ge(e){return(0,u.useMemo)(()=>e?function(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}(e):null,[e])}const Qe=[];function Ze(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return w(t)?t:e}const et=[{sensor:_e,options:{}},{sensor:je,options:{}}],tt={current:{}},nt={draggable:{measure:oe},droppable:{measure:oe,strategy:Ye.WhileDragging,frequency:Ve.Optimized},dragOverlay:{measure:re}};class rt extends Map{get(e){var t;return null!=e&&null!=(t=super.get(e))?t:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(e=>{let{disabled:t}=e;return!t})}getNodeFor(e){var t,n;return null!=(t=null==(n=this.get(e))?void 0:n.node.current)?t:void 0}}const ot={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new rt,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:U},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:nt,measureDroppableContainers:U,windowRect:null,measuringScheduled:!1},it={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:U,draggableNodes:new Map,over:null,measureDroppableContainers:U},st=(0,u.createContext)(it),at=(0,u.createContext)(ot);function lt(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new rt}}}function ct(e,t){switch(t.type){case H.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case H.DragMove:return null==e.draggable.active?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case H.DragEnd:case H.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case H.RegisterDroppable:{const{element:n}=t,{id:r}=n,o=new rt(e.droppable.containers);return o.set(r,n),{...e,droppable:{...e.droppable,containers:o}}}case H.SetDroppableDisabled:{const{id:n,key:r,disabled:o}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;const s=new rt(e.droppable.containers);return s.set(n,{...i,disabled:o}),{...e,droppable:{...e.droppable,containers:s}}}case H.UnregisterDroppable:{const{id:n,key:r}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;const i=new rt(e.droppable.containers);return i.delete(n),{...e,droppable:{...e.droppable,containers:i}}}default:return e}}function dt(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:o}=(0,u.useContext)(st),i=R(r),s=R(null==n?void 0:n.id);return(0,u.useEffect)(()=>{if(!t&&!r&&i&&null!=s){if(!O(i))return;if(document.activeElement===i.target)return;const e=o.get(s);if(!e)return;const{activatorNode:t,node:n}=e;if(!t.current&&!n.current)return;requestAnimationFrame(()=>{for(const e of[t.current,n.current]){if(!e)continue;const t=L(e);if(t){t.focus();break}}})}},[r,t,o,s,i]),null}function ut(e,t){let{transform:n,...r}=t;return null!=e&&e.length?e.reduce((e,t)=>t({transform:e,...r}),n):n}const ft=(0,u.createContext)({...K,scaleX:1,scaleY:1});var vt;!function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"}(vt||(vt={}));const ht=(0,u.memo)(function(e){var t,n,r,o;let{id:i,accessibility:s,autoScroll:a=!0,children:l,sensors:c=et,collisionDetection:d=G,measuring:g,modifiers:p,...m}=e;const y=(0,u.useReducer)(ct,void 0,lt),[x,C]=y,[S,j]=function(){const[e]=(0,u.useState)(()=>new Set),t=(0,u.useCallback)(t=>(e.add(t),()=>e.delete(t)),[e]);return[(0,u.useCallback)(t=>{let{type:n,event:r}=t;e.forEach(e=>{var t;return null==(t=e[n])?void 0:t.call(e,r)})},[e]),t]}(),[M,O]=(0,u.useState)(vt.Uninitialized),_=M===vt.Initialized,{draggable:{active:A,nodes:L,translate:P},droppable:{containers:z}}=x,$=null!=A?L.get(A):null,Y=(0,u.useRef)({initial:null,translated:null}),V=(0,u.useMemo)(()=>{var e;return null!=A?{id:A,data:null!=(e=null==$?void 0:$.data)?e:tt,rect:Y}:null},[A,$]),U=(0,u.useRef)(null),[W,J]=(0,u.useState)(null),[q,Z]=(0,u.useState)(null),te=D(m,Object.values(m)),ne=N("DndDescribedBy",i),oe=(0,u.useMemo)(()=>z.getEnabled(),[z]),le=(ce=g,(0,u.useMemo)(()=>({draggable:{...nt.draggable,...null==ce?void 0:ce.draggable},droppable:{...nt.droppable,...null==ce?void 0:ce.droppable},dragOverlay:{...nt.dragOverlay,...null==ce?void 0:ce.dragOverlay}}),[null==ce?void 0:ce.draggable,null==ce?void 0:ce.droppable,null==ce?void 0:ce.dragOverlay]));var ce;const{droppableRects:ve,measureDroppableContainers:he,measuringScheduled:pe}=function(e,t){let{dragging:n,dependencies:r,config:o}=t;const[i,s]=(0,u.useState)(null),{frequency:a,measure:l,strategy:c}=o,d=(0,u.useRef)(e),f=function(){switch(c){case Ye.Always:return!1;case Ye.BeforeDragging:return n;default:return!n}}(),v=D(f),h=(0,u.useCallback)(function(e){void 0===e&&(e=[]),v.current||s(t=>null===t?e:t.concat(e.filter(e=>!t.includes(e))))},[v]),g=(0,u.useRef)(null),p=I(t=>{if(f&&!n)return Xe;if(!t||t===Xe||d.current!==e||null!=i){const t=new Map;for(let n of e){if(!n)continue;if(i&&i.length>0&&!i.includes(n.id)&&n.rect.current){t.set(n.id,n.rect.current);continue}const e=n.node.current,r=e?new ye(l(e),e):null;n.rect.current=r,r&&t.set(n.id,r)}return t}return t},[e,i,n,f,l]);return(0,u.useEffect)(()=>{d.current=e},[e]),(0,u.useEffect)(()=>{f||h()},[n,f]),(0,u.useEffect)(()=>{i&&i.length>0&&s(null)},[JSON.stringify(i)]),(0,u.useEffect)(()=>{f||"number"!=typeof a||null!==g.current||(g.current=setTimeout(()=>{h(),g.current=null},a))},[a,f,h,...r]),{droppableRects:p,measureDroppableContainers:h,measuringScheduled:null!=i}}(oe,{dragging:_,dependencies:[P.x,P.y],config:le.droppable}),me=function(e,t){const n=null!=t?e.get(t):void 0,r=n?n.node.current:null;return I(e=>{var n;return null==t?null:null!=(n=null!=r?r:e)?n:null},[r,t])}(L,A),we=(0,u.useMemo)(()=>q?T(q):null,[q]),xe=function(){const e=!1===(null==W?void 0:W.autoScrollEnabled),t="object"==typeof a?!1===a.enabled:!1===a,n=_&&!e&&!t;return"object"==typeof a?{...a,enabled:n}:{enabled:n}}(),ke=function(e,t){return He(e,t)}(me,le.draggable.measure);!function(e){let{activeNode:t,measure:n,initialRect:r,config:o=!0}=e;const i=(0,u.useRef)(!1),{x:s,y:a}="boolean"==typeof o?{x:o,y:o}:o;k(()=>{if(!s&&!a||!t)return void(i.current=!1);if(i.current||!r)return;const e=null==t?void 0:t.node.current;if(!e||!1===e.isConnected)return;const o=Q(n(e),r);if(s||(o.x=0),a||(o.y=0),i.current=!0,Math.abs(o.x)>0||Math.abs(o.y)>0){const t=se(e);t&&t.scrollBy({top:o.y,left:o.x})}},[t,s,a,r,n])}({activeNode:null!=A?L.get(A):null,config:xe.layoutShiftCompensation,initialRect:ke,measure:le.draggable.measure});const Ce=We(me,le.draggable.measure,ke),De=We(me?me.parentElement:null),Ie=(0,u.useRef)({activatorEvent:null,active:null,activeNode:me,collisionRect:null,collisions:null,droppableRects:ve,draggableNodes:L,draggingNode:null,draggingNodeRect:null,droppableContainers:z,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Ee=z.getNodeFor(null==(t=Ie.current.over)?void 0:t.id),Re=function(e){let{measure:t}=e;const[n,r]=(0,u.useState)(null),o=Ue({callback:(0,u.useCallback)(e=>{for(const{target:n}of e)if(w(n)){r(e=>{const r=t(n);return e?{...e,width:r.width,height:r.height}:r});break}},[t])}),i=(0,u.useCallback)(e=>{const n=Ze(e);null==o||o.disconnect(),n&&(null==o||o.observe(n)),r(n?t(n):null)},[t,o]),[s,a]=E(i);return(0,u.useMemo)(()=>({nodeRef:s,rect:n,setRef:a}),[n,s,a])}({measure:le.dragOverlay.measure}),Se=null!=(n=Re.nodeRef.current)?n:me,Ne=_?null!=(r=Re.rect)?r:Ce:null,je=Boolean(Re.nodeRef.current&&Re.rect),Be=Q(Me=je?null:Ce,He(Me));var Me;const Oe=Ge(Se?b(Se):null),Te=function(e){const t=(0,u.useRef)(e),n=I(n=>e?n&&n!==Je&&e&&t.current&&e.parentNode===t.current.parentNode?n:ie(e):Je,[e]);return(0,u.useEffect)(()=>{t.current=e},[e]),n}(_?null!=Ee?Ee:me:null),_e=function(e,t){void 0===t&&(t=re);const[n]=e,r=Ge(n?b(n):null),[o,i]=(0,u.useState)(Qe);function s(){i(()=>e.length?e.map(e=>fe(e)?r:new ye(t(e),e)):Qe)}const a=Ue({callback:s});return k(()=>{null==a||a.disconnect(),s(),e.forEach(e=>null==a?void 0:a.observe(e))},[e]),o}(Te),Ae=ut(p,{transform:{x:P.x-Be.x,y:P.y-Be.y,scaleX:1,scaleY:1},activatorEvent:q,active:V,activeNodeRect:Ce,containerNodeRect:De,draggingNodeRect:Ne,over:Ie.current.over,overlayNodeRect:Re.rect,scrollableAncestors:Te,scrollableAncestorRects:_e,windowRect:Oe}),Le=we?B(we,P):null,Pe=function(e){const[t,n]=(0,u.useState)(null),r=(0,u.useRef)(e),o=(0,u.useCallback)(e=>{const t=ae(e.target);t&&n(e=>e?(e.set(t,de(t)),new Map(e)):null)},[]);return(0,u.useEffect)(()=>{const t=r.current;if(e!==t){i(t);const s=e.map(e=>{const t=ae(e);return t?(t.addEventListener("scroll",o,{passive:!0}),[t,de(t)]):null}).filter(e=>null!=e);n(s.length?new Map(s):null),r.current=e}return()=>{i(e),i(t)};function i(e){e.forEach(e=>{const t=ae(e);null==t||t.removeEventListener("scroll",o)})}},[o,e]),(0,u.useMemo)(()=>e.length?t?Array.from(t.values()).reduce((e,t)=>B(e,t),K):be(e):K,[e,t])}(Te),Ve=qe(Pe),Ke=qe(Pe,[Ce]),rt=B(Ae,Ve),ot=Ne?ee(Ne,Ae):null,it=V&&ot?d({active:V,collisionRect:ot,droppableRects:ve,droppableContainers:oe,pointerCoordinates:Le}):null,ht=function(e){if(!e||0===e.length)return null;const[t]=e;return t.id}(it),[gt,pt]=(0,u.useState)(null),bt=function(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}(je?Ae:B(Ae,Ke),null!=(o=null==gt?void 0:gt.rect)?o:null,Ce),mt=(0,u.useRef)(null),wt=(0,u.useCallback)((e,t)=>{let{sensor:n,options:r}=t;if(null==U.current)return;const o=L.get(U.current);if(!o)return;const i=e.nativeEvent,s=new n({active:U.current,activeNode:o,event:i,options:r,context:Ie,onAbort(e){if(!L.get(e))return;const{onDragAbort:t}=te.current,n={id:e};null==t||t(n),S({type:"onDragAbort",event:n})},onPending(e,t,n,r){if(!L.get(e))return;const{onDragPending:o}=te.current,i={id:e,constraint:t,initialCoordinates:n,offset:r};null==o||o(i),S({type:"onDragPending",event:i})},onStart(e){const t=U.current;if(null==t)return;const n=L.get(t);if(!n)return;const{onDragStart:r}=te.current,o={activatorEvent:i,active:{id:t,data:n.data,rect:Y}};(0,v.unstable_batchedUpdates)(()=>{null==r||r(o),O(vt.Initializing),C({type:H.DragStart,initialCoordinates:e,active:t}),S({type:"onDragStart",event:o}),J(mt.current),Z(i)})},onMove(e){C({type:H.DragMove,coordinates:e})},onEnd:a(H.DragEnd),onCancel:a(H.DragCancel)});function a(e){return async function(){const{active:t,collisions:n,over:r,scrollAdjustedTranslate:o}=Ie.current;let s=null;if(t&&o){const{cancelDrop:a}=te.current;s={activatorEvent:i,active:t,collisions:n,delta:o,over:r},e===H.DragEnd&&"function"==typeof a&&await Promise.resolve(a(s))&&(e=H.DragCancel)}U.current=null,(0,v.unstable_batchedUpdates)(()=>{C({type:e}),O(vt.Uninitialized),pt(null),J(null),Z(null),mt.current=null;const t=e===H.DragEnd?"onDragEnd":"onDragCancel";if(s){const e=te.current[t];null==e||e(s),S({type:t,event:s})}})}}mt.current=s},[L]),yt=(0,u.useCallback)((e,t)=>(n,r)=>{const o=n.nativeEvent,i=L.get(r);if(null!==U.current||!i||o.dndKit||o.defaultPrevented)return;const s={active:i};!0===e(n,t.options,s)&&(o.dndKit={capturedBy:t.sensor},U.current=r,wt(n,t))},[L,wt]),xt=function(e,t){return(0,u.useMemo)(()=>e.reduce((e,n)=>{const{sensor:r}=n;return[...e,...r.activators.map(e=>({eventName:e.eventName,handler:t(e.handler,n)}))]},[]),[e,t])}(c,yt);!function(e){(0,u.useEffect)(()=>{if(!h)return;const t=e.map(e=>{let{sensor:t}=e;return null==t.setup?void 0:t.setup()});return()=>{for(const e of t)null==e||e()}},e.map(e=>{let{sensor:t}=e;return t}))}(c),k(()=>{Ce&&M===vt.Initializing&&O(vt.Initialized)},[Ce,M]),(0,u.useEffect)(()=>{const{onDragMove:e}=te.current,{active:t,activatorEvent:n,collisions:r,over:o}=Ie.current;if(!t||!n)return;const i={active:t,activatorEvent:n,collisions:r,delta:{x:rt.x,y:rt.y},over:o};(0,v.unstable_batchedUpdates)(()=>{null==e||e(i),S({type:"onDragMove",event:i})})},[rt.x,rt.y]),(0,u.useEffect)(()=>{const{active:e,activatorEvent:t,collisions:n,droppableContainers:r,scrollAdjustedTranslate:o}=Ie.current;if(!e||null==U.current||!t||!o)return;const{onDragOver:i}=te.current,s=r.get(ht),a=s&&s.rect.current?{id:s.id,rect:s.rect.current,data:s.data,disabled:s.disabled}:null,l={active:e,activatorEvent:t,collisions:n,delta:{x:o.x,y:o.y},over:a};(0,v.unstable_batchedUpdates)(()=>{pt(a),null==i||i(l),S({type:"onDragOver",event:l})})},[ht]),k(()=>{Ie.current={activatorEvent:q,active:V,activeNode:me,collisionRect:ot,collisions:it,droppableRects:ve,draggableNodes:L,draggingNode:Se,draggingNodeRect:Ne,droppableContainers:z,over:gt,scrollableAncestors:Te,scrollAdjustedTranslate:rt},Y.current={initial:Ne,translated:ot}},[V,me,it,ot,L,Se,Ne,ve,z,gt,Te,rt]),function(e){let{acceleration:t,activator:n=ze.Pointer,canScroll:r,draggingRect:o,enabled:i,interval:s=5,order:a=$e.TreeOrder,pointerCoordinates:l,scrollableAncestors:c,scrollableAncestorRects:d,delta:f,threshold:v}=e;const h=function(e){let{delta:t,disabled:n}=e;const r=R(t);return I(e=>{if(n||!r||!e)return Fe;const o=Math.sign(t.x-r.x),i=Math.sign(t.y-r.y);return{x:{[ue.Backward]:e.x[ue.Backward]||-1===o,[ue.Forward]:e.x[ue.Forward]||1===o},y:{[ue.Backward]:e.y[ue.Backward]||-1===i,[ue.Forward]:e.y[ue.Forward]||1===i}}},[n,t,r])}({delta:f,disabled:!i}),[g,p]=function(){const e=(0,u.useRef)(null);return[(0,u.useCallback)((t,n)=>{e.current=setInterval(t,n)},[]),(0,u.useCallback)(()=>{null!==e.current&&(clearInterval(e.current),e.current=null)},[])]}(),b=(0,u.useRef)({x:0,y:0}),m=(0,u.useRef)({x:0,y:0}),w=(0,u.useMemo)(()=>{switch(n){case ze.Pointer:return l?{top:l.y,bottom:l.y,left:l.x,right:l.x}:null;case ze.DraggableRect:return o}},[n,o,l]),y=(0,u.useRef)(null),x=(0,u.useCallback)(()=>{const e=y.current;if(!e)return;const t=b.current.x*m.current.x,n=b.current.y*m.current.y;e.scrollBy(t,n)},[]),k=(0,u.useMemo)(()=>a===$e.TreeOrder?[...c].reverse():c,[a,c]);(0,u.useEffect)(()=>{if(i&&c.length&&w){for(const e of k){if(!1===(null==r?void 0:r(e)))continue;const n=c.indexOf(e),o=d[n];if(!o)continue;const{direction:i,speed:a}=ge(e,o,w,t,v);for(const e of["x","y"])h[e][i[e]]||(a[e]=0,i[e]=0);if(a.x>0||a.y>0)return p(),y.current=e,g(x,s),b.current=a,void(m.current=i)}b.current={x:0,y:0},m.current={x:0,y:0},p()}else p()},[t,x,r,p,i,s,JSON.stringify(w),JSON.stringify(h),g,c,k,d,JSON.stringify(v)])}({...xe,delta:P,draggingRect:ot,pointerCoordinates:Le,scrollableAncestors:Te,scrollableAncestorRects:_e});const kt=(0,u.useMemo)(()=>({active:V,activeNode:me,activeNodeRect:Ce,activatorEvent:q,collisions:it,containerNodeRect:De,dragOverlay:Re,draggableNodes:L,droppableContainers:z,droppableRects:ve,over:gt,measureDroppableContainers:he,scrollableAncestors:Te,scrollableAncestorRects:_e,measuringConfiguration:le,measuringScheduled:pe,windowRect:Oe}),[V,me,Ce,q,it,De,Re,L,z,ve,gt,he,Te,_e,le,pe,Oe]),Ct=(0,u.useMemo)(()=>({activatorEvent:q,activators:xt,active:V,activeNodeRect:Ce,ariaDescribedById:{draggable:ne},dispatch:C,draggableNodes:L,over:gt,measureDroppableContainers:he}),[q,xt,V,Ce,C,ne,L,gt,he]);return f().createElement(F.Provider,{value:j},f().createElement(st.Provider,{value:Ct},f().createElement(at.Provider,{value:kt},f().createElement(ft.Provider,{value:bt},l)),f().createElement(dt,{disabled:!1===(null==s?void 0:s.restoreFocus)})),f().createElement(X,{...s,hiddenTextDescribedById:ne}))}),gt=(0,u.createContext)(null),pt="button";function bt(){return(0,u.useContext)(at)}const mt={timeout:25};function wt(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:o}=e;const i=N("Droppable"),{active:s,dispatch:a,over:l,measureDroppableContainers:c}=(0,u.useContext)(st),d=(0,u.useRef)({disabled:n}),f=(0,u.useRef)(!1),v=(0,u.useRef)(null),h=(0,u.useRef)(null),{disabled:g,updateMeasurementsFor:p,timeout:b}={...mt,...o},m=D(null!=p?p:r),w=Ue({callback:(0,u.useCallback)(()=>{f.current?(null!=h.current&&clearTimeout(h.current),h.current=setTimeout(()=>{c(Array.isArray(m.current)?m.current:[m.current]),h.current=null},b)):f.current=!0},[b]),disabled:g||!s}),y=(0,u.useCallback)((e,t)=>{w&&(t&&(w.unobserve(t),f.current=!1),e&&w.observe(e))},[w]),[x,k]=E(y),C=D(t);return(0,u.useEffect)(()=>{w&&x.current&&(w.disconnect(),f.current=!1,w.observe(x.current))},[x,w]),(0,u.useEffect)(()=>(a({type:H.RegisterDroppable,element:{id:r,key:i,disabled:n,node:x,rect:v,data:C}}),()=>a({type:H.UnregisterDroppable,key:i,id:r})),[r]),(0,u.useEffect)(()=>{n!==d.current.disabled&&(a({type:H.SetDroppableDisabled,id:r,key:i,disabled:n}),d.current.disabled=n)},[r,i,n,a]),{active:s,rect:v,isOver:(null==l?void 0:l.id)===r,node:x,over:l,setNodeRef:k}}function yt(e){let{animation:t,children:n}=e;const[r,o]=(0,u.useState)(null),[i,s]=(0,u.useState)(null),a=R(n);return n||r||!a||o(a),k(()=>{if(!i)return;const e=null==r?void 0:r.key,n=null==r?void 0:r.props.id;null!=e&&null!=n?Promise.resolve(t(n,i)).then(()=>{o(null)}):o(null)},[t,r,i]),f().createElement(f().Fragment,null,n,r?(0,u.cloneElement)(r,{ref:s}):null)}const xt={x:0,y:0,scaleX:1,scaleY:1};function kt(e){let{children:t}=e;return f().createElement(st.Provider,{value:it},f().createElement(ft.Provider,{value:xt},t))}const Ct={position:"fixed",touchAction:"none"},Dt=e=>O(e)?"transform 250ms ease":void 0,It=(0,u.forwardRef)((e,t)=>{let{as:n,activatorEvent:r,adjustScale:o,children:i,className:s,rect:a,style:l,transform:c,transition:d=Dt}=e;if(!a)return null;const u=o?c:{...c,scaleX:1,scaleY:1},v={...Ct,width:a.width,height:a.height,top:a.top,left:a.left,transform:_.Transform.toString(u),transformOrigin:o&&r?W(r,a):void 0,transition:"function"==typeof d?d(r):d,...l};return f().createElement(n,{className:s,style:v,ref:t},i)}),Et=e=>t=>{let{active:n,dragOverlay:r}=t;const o={},{styles:i,className:s}=e;if(null!=i&&i.active)for(const[e,t]of Object.entries(i.active))void 0!==t&&(o[e]=n.node.style.getPropertyValue(e),n.node.style.setProperty(e,t));if(null!=i&&i.dragOverlay)for(const[e,t]of Object.entries(i.dragOverlay))void 0!==t&&r.node.style.setProperty(e,t);return null!=s&&s.active&&n.node.classList.add(s.active),null!=s&&s.dragOverlay&&r.node.classList.add(s.dragOverlay),function(){for(const[e,t]of Object.entries(o))n.node.style.setProperty(e,t);null!=s&&s.active&&n.node.classList.remove(s.active)}},Rt={duration:250,easing:"ease",keyframes:e=>{let{transform:{initial:t,final:n}}=e;return[{transform:_.Transform.toString(t)},{transform:_.Transform.toString(n)}]},sideEffects:Et({styles:{active:{opacity:"0"}}})};let St=0;function Nt(e){return(0,u.useMemo)(()=>{if(null!=e)return St++,St},[e])}const jt=f().memo(e=>{let{adjustScale:t=!1,children:n,dropAnimation:r,style:o,transition:i,modifiers:s,wrapperElement:a="div",className:l,zIndex:c=999}=e;const{activatorEvent:d,active:v,activeNodeRect:h,containerNodeRect:g,draggableNodes:p,droppableContainers:m,dragOverlay:w,over:y,measuringConfiguration:x,scrollableAncestors:k,scrollableAncestorRects:D,windowRect:I}=bt(),E=(0,u.useContext)(ft),R=Nt(null==v?void 0:v.id),S=ut(s,{activatorEvent:d,active:v,activeNodeRect:h,containerNodeRect:g,draggingNodeRect:w.rect,over:y,overlayNodeRect:w.rect,scrollableAncestors:k,scrollableAncestorRects:D,transform:E,windowRect:I}),N=He(h),j=function(e){let{config:t,draggableNodes:n,droppableContainers:r,measuringConfiguration:o}=e;return C((e,i)=>{if(null===t)return;const s=n.get(e);if(!s)return;const a=s.node.current;if(!a)return;const l=Ze(i);if(!l)return;const{transform:c}=b(i).getComputedStyle(i),d=te(c);if(!d)return;const u="function"==typeof t?t:function(e){const{duration:t,easing:n,sideEffects:r,keyframes:o}={...Rt,...e};return e=>{let{active:i,dragOverlay:s,transform:a,...l}=e;if(!t)return;const c=s.rect.left-i.rect.left,d=s.rect.top-i.rect.top,u={scaleX:1!==a.scaleX?i.rect.width*a.scaleX/s.rect.width:1,scaleY:1!==a.scaleY?i.rect.height*a.scaleY/s.rect.height:1},f={x:a.x-c,y:a.y-d,...u},v=o({...l,active:i,dragOverlay:s,transform:{initial:a,final:f}}),[h]=v,g=v[v.length-1];if(JSON.stringify(h)===JSON.stringify(g))return;const p=null==r?void 0:r({active:i,dragOverlay:s,...l}),b=s.node.animate(v,{duration:t,easing:n,fill:"forwards"});return new Promise(e=>{b.onfinish=()=>{null==p||p(),e()}})}}(t);return me(a,o.draggable.measure),u({active:{id:e,data:s.data,node:a,rect:o.draggable.measure(a)},draggableNodes:n,dragOverlay:{node:i,rect:o.dragOverlay.measure(l)},droppableContainers:r,measuringConfiguration:o,transform:d})})}({config:r,draggableNodes:p,droppableContainers:m,measuringConfiguration:x}),B=N?w.setRef:void 0;return f().createElement(kt,null,f().createElement(yt,{animation:j},v&&R?f().createElement(It,{key:R,id:v.id,ref:B,as:a,activatorEvent:d,adjustScale:t,className:l,transition:i,rect:N,style:{zIndex:c,...o},transform:S},n):null))});function Bt({clientId:e}){const{selectedBlockClientId:n}=(0,t.useSelect)(e=>{const{getSelectedBlockClientId:t}=e("core/block-editor");return{selectedBlockClientId:t()}});return(0,i.jsx)(o.Button,{className:"block-select",isPressed:n===e,icon:"admin-generic",iconSize:14,onClick:()=>{wp.data.dispatch("core/block-editor").selectBlock(e)}})}const Mt=window.wp.blockEditor;var Ot=n(6942),Tt=n.n(Ot);function _t({position:e,clientId:t,showMidColumns:n=!1}){const s=Tt()({"add-item":"off-canvas"!==e,[`add-item-${e}`]:!0,"add-item-has-mid-columns":n});function a({...t}){const{onToggle:n,disabled:a,isOpen:l,blockTitle:c,hasSingleBlockType:d}=t;return(0,i.jsx)(o.Button,{icon:"plus",disabled:a,onClick:n,className:s,children:"off-canvas"===e?(0,r.__)("Add Block","kadence-blocks"):""})}return(0,i.jsx)(Mt.Inserter,{renderToggle:e=>(0,i.jsx)(a,{...e}),rootClientId:t,position:"top center",isAppender:!0,__experimentalIsQuick:!0})}function At(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function Lt(e,t){return e.reduce((e,n,r)=>{const o=t.get(n);return o&&(e[r]=o),e},Array(e.length))}function Pt(e){return null!==e&&e>=0}const zt={scaleX:1,scaleY:1},$t=e=>{var t;let{rects:n,activeNodeRect:r,activeIndex:o,overIndex:i,index:s}=e;const a=null!=(t=n[o])?t:r;if(!a)return null;const l=function(e,t,n){const r=e[t],o=e[t-1],i=e[t+1];return r&&(o||i)?n<t?o?r.left-(o.left+o.width):i.left-(r.left+r.width):i?i.left-(r.left+r.width):r.left-(o.left+o.width):0}(n,s,o);if(s===o){const e=n[i];return e?{x:o<i?e.left+e.width-(a.left+a.width):e.left-a.left,y:0,...zt}:null}return s>o&&s<=i?{x:-a.width-l,y:0,...zt}:s<o&&s>=i?{x:a.width+l,y:0,...zt}:{x:0,y:0,...zt}},Ft=e=>{let{rects:t,activeIndex:n,overIndex:r,index:o}=e;const i=At(t,r,n),s=t[o],a=i[o];return a&&s?{x:a.left-s.left,y:a.top-s.top,scaleX:a.width/s.width,scaleY:a.height/s.height}:null},Yt={scaleX:1,scaleY:1},Vt=e=>{var t;let{activeIndex:n,activeNodeRect:r,index:o,rects:i,overIndex:s}=e;const a=null!=(t=i[n])?t:r;if(!a)return null;if(o===n){const e=i[s];return e?{x:0,y:n<s?e.top+e.height-(a.top+a.height):e.top-a.top,...Yt}:null}const l=function(e,t,n){const r=e[t],o=e[t-1],i=e[t+1];return r?n<t?o?r.top-(o.top+o.height):i?i.top-(r.top+r.height):0:i?i.top-(r.top+r.height):o?r.top-(o.top+o.height):0:0}(i,o,n);return o>n&&o<=s?{x:0,y:-a.height-l,...Yt}:o<n&&o>=s?{x:0,y:a.height+l,...Yt}:{x:0,y:0,...Yt}},Xt="Sortable",Ht=f().createContext({activeIndex:-1,containerId:Xt,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:Ft,disabled:{draggable:!1,droppable:!1}});function Ut(e){let{children:t,id:n,items:r,strategy:o=Ft,disabled:i=!1}=e;const{active:s,dragOverlay:a,droppableRects:l,over:c,measureDroppableContainers:d}=bt(),v=N(Xt,n),h=Boolean(null!==a.rect),g=(0,u.useMemo)(()=>r.map(e=>"object"==typeof e&&"id"in e?e.id:e),[r]),p=null!=s,b=s?g.indexOf(s.id):-1,m=c?g.indexOf(c.id):-1,w=(0,u.useRef)(g),y=!function(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}(g,w.current),x=-1!==m&&-1===b||y,C=function(e){return"boolean"==typeof e?{draggable:e,droppable:e}:e}(i);k(()=>{y&&p&&d(g)},[y,g,p,d]),(0,u.useEffect)(()=>{w.current=g},[g]);const D=(0,u.useMemo)(()=>({activeIndex:b,containerId:v,disabled:C,disableTransforms:x,items:g,overIndex:m,useDragOverlay:h,sortedRects:Lt(g,l),strategy:o}),[b,v,C.draggable,C.droppable,x,g,m,l,h,o]);return f().createElement(Ht.Provider,{value:D},t)}const Kt=e=>{let{id:t,items:n,activeIndex:r,overIndex:o}=e;return At(n,r,o).indexOf(t)},Wt=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:o,items:i,newIndex:s,previousItems:a,previousContainerId:l,transition:c}=e;return!(!c||!r||a!==i&&o===s||!n&&(s===o||t!==l))},Jt={duration:200,easing:"ease"},qt="transform",Gt=_.Transition.toString({property:qt,duration:0,easing:"linear"}),Qt={roleDescription:"sortable"};function Zt(e){let{animateLayoutChanges:t=Wt,attributes:n,disabled:r,data:o,getNewIndex:i=Kt,id:s,strategy:a,resizeObserverConfig:l,transition:c=Jt}=e;const{items:d,containerId:f,activeIndex:v,disabled:h,disableTransforms:g,sortedRects:p,overIndex:b,useDragOverlay:m,strategy:w}=(0,u.useContext)(Ht),y=function(e,t){var n,r;return"boolean"==typeof e?{draggable:e,droppable:!1}:{draggable:null!=(n=null==e?void 0:e.draggable)?n:t.draggable,droppable:null!=(r=null==e?void 0:e.droppable)?r:t.droppable}}(r,h),x=d.indexOf(s),C=(0,u.useMemo)(()=>({sortable:{containerId:f,index:x,items:d},...o}),[f,o,x,d]),I=(0,u.useMemo)(()=>d.slice(d.indexOf(s)),[d,s]),{rect:R,node:S,isOver:j,setNodeRef:B}=wt({id:s,data:C,disabled:y.droppable,resizeObserverConfig:{updateMeasurementsFor:I,...l}}),{active:M,activatorEvent:T,activeNodeRect:A,attributes:L,setNodeRef:P,listeners:z,isDragging:$,over:F,setActivatorNodeRef:Y,transform:V}=function(e){let{id:t,data:n,disabled:r=!1,attributes:o}=e;const i=N("Draggable"),{activators:s,activatorEvent:a,active:l,activeNodeRect:c,ariaDescribedById:d,draggableNodes:f,over:v}=(0,u.useContext)(st),{role:h=pt,roleDescription:g="draggable",tabIndex:p=0}=null!=o?o:{},b=(null==l?void 0:l.id)===t,m=(0,u.useContext)(b?ft:gt),[w,y]=E(),[x,C]=E(),I=function(e,t){return(0,u.useMemo)(()=>e.reduce((e,n)=>{let{eventName:r,handler:o}=n;return e[r]=e=>{o(e,t)},e},{}),[e,t])}(s,t),R=D(n);return k(()=>(f.set(t,{id:t,key:i,node:w,activatorNode:x,data:R}),()=>{const e=f.get(t);e&&e.key===i&&f.delete(t)}),[f,t]),{active:l,activatorEvent:a,activeNodeRect:c,attributes:(0,u.useMemo)(()=>({role:h,tabIndex:p,"aria-disabled":r,"aria-pressed":!(!b||h!==pt)||void 0,"aria-roledescription":g,"aria-describedby":d.draggable}),[r,h,p,b,g,d.draggable]),isDragging:b,listeners:r?void 0:I,node:w,over:v,setNodeRef:y,setActivatorNodeRef:C,transform:m}}({id:s,data:C,attributes:{...Qt,...n},disabled:y.draggable}),X=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return(0,u.useMemo)(()=>e=>{t.forEach(t=>t(e))},t)}(B,P),H=Boolean(M),U=H&&!g&&Pt(v)&&Pt(b),K=!m&&$,W=K&&U?V:null,J=U?null!=W?W:(null!=a?a:w)({rects:p,activeNodeRect:A,activeIndex:v,overIndex:b,index:x}):null,q=Pt(v)&&Pt(b)?i({id:s,items:d,activeIndex:v,overIndex:b}):x,G=null==M?void 0:M.id,Q=(0,u.useRef)({activeId:G,items:d,newIndex:q,containerId:f}),Z=d!==Q.current.items,ee=t({active:M,containerId:f,isDragging:$,isSorting:H,id:s,index:x,items:d,newIndex:Q.current.newIndex,previousItems:Q.current.items,previousContainerId:Q.current.containerId,transition:c,wasDragging:null!=Q.current.activeId}),te=function(e){let{disabled:t,index:n,node:r,rect:o}=e;const[i,s]=(0,u.useState)(null),a=(0,u.useRef)(n);return k(()=>{if(!t&&n!==a.current&&r.current){const e=o.current;if(e){const t=re(r.current,{ignoreTransform:!0}),n={x:e.left-t.left,y:e.top-t.top,scaleX:e.width/t.width,scaleY:e.height/t.height};(n.x||n.y)&&s(n)}}n!==a.current&&(a.current=n)},[t,n,r,o]),(0,u.useEffect)(()=>{i&&s(null)},[i]),i}({disabled:!ee,index:x,node:S,rect:R});return(0,u.useEffect)(()=>{H&&Q.current.newIndex!==q&&(Q.current.newIndex=q),f!==Q.current.containerId&&(Q.current.containerId=f),d!==Q.current.items&&(Q.current.items=d)},[H,q,f,d]),(0,u.useEffect)(()=>{if(G===Q.current.activeId)return;if(null!=G&&null==Q.current.activeId)return void(Q.current.activeId=G);const e=setTimeout(()=>{Q.current.activeId=G},50);return()=>clearTimeout(e)},[G]),{active:M,activeIndex:v,attributes:L,data:C,rect:R,index:x,newIndex:q,items:d,isOver:j,isSorting:H,isDragging:$,listeners:z,node:S,overIndex:b,over:F,setNodeRef:X,setActivatorNodeRef:Y,setDroppableNodeRef:B,setDraggableNodeRef:P,transform:null!=te?te:J,transition:te||Z&&Q.current.newIndex===x?Gt:K&&!O(T)||!c?void 0:H||ee?_.Transition.toString({...c,property:qt}):void 0}}function en({clientId:t}){const[n,s]=(0,e.useState)(!1),a=()=>s(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(o.Button,{className:"block-delete",icon:"no-alt",iconSize:14,isBusy:n,onClick:()=>s(!0)}),n&&(0,i.jsxs)(o.Modal,{title:(0,r.__)("Delete block?"),onRequestClose:a,children:[(0,r.__)("This will remove the block from the header."),(0,i.jsxs)("div",{style:{marginTop:"20px"},children:[(0,i.jsx)(o.Button,{isSecondary:!0,onClick:a,children:(0,r.__)("Cancel")}),(0,i.jsx)(o.Button,{isSecondary:!0,isDestructive:!0,onClick:()=>{wp.data.dispatch("core/block-editor").removeBlock(t),a()},style:{marginLeft:"15px"},children:(0,r.__)("Confirm")})]})]})]})}De.Down,De.Right,De.Up,De.Left;const tn=(0,e.memo)(function(e){return(0,i.jsx)("div",{className:"drag-handle",style:{cursor:"grab",marginRight:"5px"},...e,children:(0,i.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 18 18",children:(0,i.jsx)("path",{d:"M13 8c.6 0 1-.4 1-1s-.4-1-1-1-1 .4-1-1 .4 1 1 1zM5 6c-.6 0-1 .4-1 1s.4 1 1 1 1-.4 1-1-.4-1-1-1zm0 4c-.6 0-1 .4-1 1s.4 1 1 1 1-.4 1-1-.4-1-1-1zm8 0c-.6 0-1 .4-1 1s.4 1 1 1 1-.4 1-1-.4-1-1-1zM9 6c-.6 0-1 .4-1 1s.4 1 1 1 1-.4 1-1-.4-1-1-1zm0 4c-.6 0-1 .4-1 1s.4 1 1 1 1-.4 1-1-.4-1-1-1z"})})})});function nn({block:e,isPreview:n=!1}){const r={};let s={};const l=(0,t.useSelect)(t=>{const n=t("core/blocks").getBlockType(e.name);return{title:n?.title||"",icon:n?.icon||{}}},[e.name]);if(!n){const{attributes:t,listeners:n,setNodeRef:o,transform:i,transition:a}=Zt({id:e.clientId,data:{name:e.name,attributes:e.attributes}}),l=i?{transform:`translate3d(${i.x}px, ${i.y}px, 0)`}:void 0;r.ref=o,r.style=l,s={...n,...t}}const c=Tt()({"visual-inner-block":!0,"visual-inner-block__preview":n});return(0,i.jsxs)("div",{className:c,...r,children:[(0,i.jsxs)("div",{className:"visual-inner-block__controls",children:[(0,i.jsx)(tn,{...s}),(0,i.jsxs)("div",{children:[(0,i.jsx)(Bt,{clientId:e.clientId}),(0,i.jsx)(en,{clientId:e.clientId})]})]}),(0,i.jsxs)("div",{className:"visual-inner-block__meta",children:[(0,i.jsx)(o.Icon,{size:16,className:"block-icon",icon:l?.icon?.src}),(0,i.jsx)("span",{className:"visual-inner-block__name",children:(()=>{const t=(0,a.get)(e,["attributes","metadata","name"],"");return""!==t?t:l.title})()})]})]})}function rn(e){const{isOver:t,setNodeRef:n}=wt({id:e.clientId}),r={backgroundColor:t?"rgba(0, 124, 186, 0.05)":""},o=Tt()({[e.classNames]:!0,"visual-column-wrapper_is-dropping":t});return(0,i.jsx)("div",{className:o,ref:n,style:r,children:e.children})}function on({blocks:t,className:n,clientId:r,showMidColumns:o=!0,type:s=""}){const l=Tt()({"visual-column-wrapper":!0,[`visual-column-wrapper-${n}`]:!0,"visual-column-wrapper-empty-center":!o&&"desktop"===s}),c=(0,e.useMemo)(()=>(0,a.map)(t,"clientId"),[t]);return(0,i.jsx)(Ut,{items:c,strategy:"off-canvas"===s?Vt:$t,children:"off-canvas"!==s?(0,i.jsx)(rn,{clientId:r,classNames:l,children:t.map(e=>(0,i.jsx)(nn,{block:e},e.clientId))}):(0,i.jsx)(i.Fragment,{children:t.map(e=>(0,i.jsx)(nn,{block:e},e.clientId))})})}function sn({children:e,setActiveBlockData:t}){const n=e=>wp.data.select("core/block-editor").getBlockIndex(e);return(0,i.jsx)(ht,{onDragEnd:()=>t(null),onDragStart:e=>t(e.active),onDragOver:(0,a.debounce)(function(e){const{active:t,over:r}=e;if(r&&t){let e=r.id;const o=t.id,i=wp.data.select("core/block-editor").getBlockRootClientId(o),s=n(e),a=n(o),l=wp.data.select("core/block-editor").getBlockName(e);if(wp.data.select("core/block-editor").getBlockName(i),"kadence/header-column"!==l&&(e=i),e===i&&s===a)return;wp.data.dispatch("core/block-editor").moveBlockToPosition(o,i,e,s)}},100),children:e})}const an=["left","center-left","center","center-right","right"],ln=[["innerBlocks",0,"innerBlocks",0,"innerBlocks"],["innerBlocks",0,"innerBlocks",1,"innerBlocks"],["innerBlocks",1,"innerBlocks"],["innerBlocks",2,"innerBlocks",0,"innerBlocks"],["innerBlocks",2,"innerBlocks",1,"innerBlocks"]],cn=[["innerBlocks",0,"innerBlocks",0,"clientId"],["innerBlocks",0,"innerBlocks",1,"clientId"],["innerBlocks",1,"clientId"],["innerBlocks",2,"innerBlocks",0,"clientId"],["innerBlocks",2,"innerBlocks",1,"clientId"]],dn={top:0,middle:1,bottom:2},un=["top","middle","bottom"],fn=({position:e,blocks:t,activeBlockData:n})=>{const r=(0,a.get)(t,[dn[e]],[]),o=(e=>an.map((t,n)=>({name:t,blocks:(0,a.get)(e,ln[n],[]),clientId:(0,a.get)(e,cn[n],[])})))(r),s=0===o[2].blocks.length,l=0===o[1].blocks.length&&0===o[3].blocks.length,c=null!==n&&1===o[2].blocks.length&&n.id===o[2].blocks[0].clientId,d=!s&&!c||!l,u="single"===r?.attributes?.layoutConfig;return(0,i.jsxs)("div",{className:"visual-row-wrapper",children:[(0,i.jsx)(Bt,{clientId:r.clientId}),(0,i.jsxs)("div",{className:`visual-desktop-row visual-desktop-row-${e}${u?" kb-single-column-header":""}`,children:[(0,i.jsxs)("div",{className:"visual-section-wrapper visual-section-wrapper-left",children:[(0,i.jsx)(on,{blocks:o[0].blocks,position:e,className:"left",clientId:o[0].clientId,type:"desktop"},`${e}-left`),(0,i.jsx)(_t,{position:"left",clientId:o[0].clientId,showMidColumns:d},`${e}-left-add`),d&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(on,{blocks:o[1].blocks,className:"center-left",showMidColumns:d,clientId:o[1].clientId,type:"desktop"},`${e}-center-left`),(0,i.jsx)(_t,{position:"center-left",clientId:o[1].clientId},`${e}-center-left-add`)]})]}),(0,i.jsxs)("div",{className:"visual-section-wrapper visual-section-wrapper-center",children:[(0,i.jsx)(on,{blocks:o[2].blocks,className:"center",clientId:o[2].clientId,type:"desktop"},`${e}-center`),(0,i.jsx)(_t,{position:"center",clientId:o[2].clientId},`${e}-center-add`)]}),(0,i.jsxs)("div",{className:"visual-section-wrapper visual-section-wrapper-right",children:[d&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(on,{blocks:o[3].blocks,className:"center-right",showMidColumns:d,clientId:o[3].clientId,type:"desktop"},`${e}-center-right`),(0,i.jsx)(_t,{position:"center-right",clientId:o[3].clientId},`${e}-center-right-add`)]}),(0,i.jsx)(on,{blocks:o[4].blocks,className:"right",clientId:o[4].clientId,type:"desktop"},`${e}-right`),(0,i.jsx)(_t,{position:"right",clientId:o[4].clientId,showMidColumns:d},`${e}-right-add`)]})]})]},e)};function vn({blocks:t}){const n=(0,e.useMemo)(()=>(0,a.get)(t,["innerBlocks"],[]),[t]),[r,o]=(0,e.useState)(null);return(0,i.jsx)("div",{className:"visual-desktop-container",children:(0,i.jsxs)(sn,{setActiveBlockData:o,children:[un.map(e=>(0,i.jsx)(fn,{position:e,blocks:n,activeBlockData:r},e)),(0,i.jsx)(jt,{children:null!==r&&(0,i.jsx)(nn,{block:{...r.data.current,clientId:""},isPreview:!0})})]})})}const hn=["top","middle","bottom"],gn=({position:e,blocks:t})=>{const n=(0,a.get)(t,[dn[e]],[]),r="single"===n?.attributes?.layoutConfig;return(0,i.jsxs)("div",{className:"visual-row-wrapper",children:[(0,i.jsx)(Bt,{clientId:n.clientId}),(0,i.jsx)("div",{className:`visual-tablet-row visual-tablet-row-${e}${r?" kb-single-column-header":""}`,children:["left","center","right"].map((t,r)=>(0,i.jsxs)("div",{className:`visual-section-wrapper visual-section-wrapper-${t}`,children:[(0,i.jsx)(on,{blocks:(0,a.get)(n,["innerBlocks",r,"innerBlocks"],[]),className:t,clientId:(0,a.get)(n,["innerBlocks",r,"clientId"],[]),showMidColumns:!1,isTablet:!0},`${e}-${t}-blocks`),(0,i.jsx)(_t,{position:t,clientId:(0,a.get)(n,["innerBlocks",r,"clientId"],[])},`${e}-${t}-add`)]},`${e}-${t}`))})]},e)};function pn({blocks:t}){const n=(0,e.useMemo)(()=>(0,a.get)(t,["innerBlocks"],[]),[t]),[r,o]=(0,e.useState)(null);return(0,i.jsx)("div",{className:"visual-desktop-container",children:(0,i.jsxs)(sn,{setActiveBlockData:o,children:[hn.map(e=>(0,i.jsx)(gn,{position:e,blocks:n},e)),(0,i.jsx)(jt,{children:null!==r&&(0,i.jsx)(nn,{block:{...r.data.current,clientId:""},isPreview:!0})})]})})}const bn=({blocks:e,offCanvasClientId:t})=>(0,i.jsxs)("div",{className:"visual-row-wrapper",children:[(0,i.jsx)(Bt,{clientId:t}),(0,i.jsx)("div",{className:"visual-off-canvas-row",children:(0,i.jsx)("div",{className:"visual-section-wrapper visual-section-wrapper-off-canvas",children:(0,i.jsx)(on,{blocks:e,className:"off-canvas",clientId:t,showMidColumns:!1,isTablet:!0,type:"off-canvas"},`off-canvas-blocks-${t}`)})}),(0,i.jsx)(_t,{position:"off-canvas",clientId:t},`off-canvas-add-${t}`)]});function mn({blocks:t,topLevelBlocks:n}){const[r,o]=(0,e.useState)(null),s=(0,e.useMemo)(()=>(0,a.get)(t,["innerBlocks"],[]),[t]),l=(0,a.get)(n,[2,"clientId"],"");return(0,i.jsx)("div",{className:"visual-off-canvas-container",children:(0,i.jsxs)(sn,{setActiveBlockData:o,children:[(0,i.jsx)(bn,{blocks:s,offCanvasClientId:l}),(0,i.jsx)(jt,{children:null!==r&&(0,i.jsx)(nn,{block:{...r.data.current,clientId:""},isPreview:!0},`drag-overlay-${r.data.current.clientId}`)})]})})}const wn=(0,i.jsx)(l.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,i.jsx)(l.Path,{d:"M6.5 12.4L12 8l5.5 4.4-.9 1.2L12 10l-4.5 3.6-1-1.2z"})}),yn=(0,i.jsx)(l.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,i.jsx)(l.Path,{d:"M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z"})});function xn({position:e,setPosition:t}){const n="bottom"===e?(0,r.__)("Move to top","kadence-blocks"):(0,r.__)("Move to bottom","kadence-blocks");return(0,i.jsx)(o.Button,{className:"kb-header-visual-builder-modal-close","aria-label":n,onClick:()=>{t("bottom"===e?"top":"bottom")},variant:"secondary",icon:"bottom"===e?wn:yn,iconSize:18,children:n})}function kn({clientId:n,previewDevice:l,isSelected:c}){const[u,f]=(0,e.useState)(l),{setPreviewDeviceType:v,setHeaderVisualBuilderOpenId:h,setHeaderVisualBuilderOpenPosition:g,setOffCanvasOpenId:p}=(0,t.useDispatch)("kadenceblocks/data"),{selectBlock:b}=(0,t.useDispatch)("core/block-editor"),m=(e,t=null)=>{const n=(0,a.get)(t,"clientId");"off-canvas"!==e?(v((0,s.capitalizeFirstLetter)(e)),"off-canvas"===u&&(p(null),b(n))):"off-canvas"===e&&n&&(p(n),b(n)),f(e)},{topLevelBlocks:w,childSelected:y,isVisible:x,modalPosition:k}=(0,t.useSelect)(e=>{const{getBlockOrder:t,getBlock:r,hasSelectedInnerBlock:o}=e("core/block-editor");return{topLevelBlocks:t(n).map(e=>r(e)),childSelected:o(n,!0),isVisible:e("kadenceblocks/data").getOpenHeaderVisualBuilderId()===n,modalPosition:e("kadenceblocks/data").getOpenHeaderVisualBuilderPosition()}},[n]),C=(0,t.useSelect)(e=>e("core/edit-post").isListViewOpened(),[]);(0,e.useEffect)(()=>{const e="Mobile"===l||"Tablet"===l?"Tablet":"Desktop";u!==e&&f(e)},[x,l]);const D=()=>{h(x?null:n)},{desktopBlocks:I,tabletBlocks:E,offCanvasBlocks:R}=function(e){let t,n,r=null;return e.forEach(e=>{e.name.includes("desktop")?t=e:e.name.includes("tablet")?n=e:e.name.includes("off-canvas")&&(r=e)}),{desktopBlocks:t,tabletBlocks:n,offCanvasBlocks:r}}(w),S=(0,s.blockExists)(w,"kadence/off-canvas-trigger"),N=(0,e.useRef)(),j=(0,s.useEditorElement)(N,[l,u,C],"editor-visual-editor"),B=j?.clientWidth,M=j?.getBoundingClientRect().left,O=(0,e.useMemo)(()=>({width:B+"px",left:M+"px"}),[B,M]);return S||"off-canvas"!==u||m("Desktop",I),0===w.length?null:(0,i.jsxs)(i.Fragment,{children:[x&&(0,i.jsx)("style",{children:"top"===k&&(0,i.jsx)(i.Fragment,{children:".kb-off-canvas-inner { margin-top: 310px; }"})},"modal-position-style"),(0,i.jsxs)("div",{ref:N,children:[!x&&(c||y)&&(0,i.jsx)("div",{className:"kb-header-visual-builder-teaser",style:O,children:(0,i.jsx)(o.Button,{isPrimary:!0,onClick:()=>D(),children:(0,r.__)("Open Visual Builder","kadence-blocks")})}),x&&(0,i.jsxs)("div",{className:"kb-header-visual-builder-modal kb-header-visual-builder-modal-"+k,style:O,children:[(0,i.jsxs)("div",{className:"tabs",children:[(0,i.jsx)(o.Button,{className:"kb-device-tab",isPressed:"Desktop"===u,disabled:null===I,onClick:()=>m("Desktop",I),children:(0,r.__)("Desktop","kadence-blocks")}),(0,i.jsx)(o.Button,{className:"kb-device-tab",isPressed:"Tablet"===u,disabled:null===E,onClick:()=>m("Tablet",E),children:(0,r.__)("Tablet / Mobile","kadence-blocks")}),S&&(0,i.jsx)(o.Button,{className:"kb-device-tab",isPressed:"off-canvas"===u,disabled:null===R,onClick:()=>m("off-canvas",R),children:(0,r.__)("Off Canvas","kadence-blocks")}),(0,i.jsxs)("div",{className:"modal-settings",children:[(0,i.jsx)(xn,{position:k,setPosition:g}),(0,i.jsx)(d,{isVisible:x,setIsVisible:D})]})]}),(0,i.jsxs)("div",{className:"content",children:["Desktop"===u&&(0,i.jsx)(vn,{blocks:I},"desktop"),"Tablet"===u&&(0,i.jsx)(pn,{blocks:E},"tablet"),"off-canvas"===u&&(0,i.jsx)(mn,{blocks:R,topLevelBlocks:w},"off-canvas")]})]})]}),(x||!x&&(c||y))&&(0,i.jsx)("style",{children:`.edit-post-layout__metaboxes{display: none}.editor-styles-wrapper{ margin-${k}: ${"top"===k?"280":"315"}px;}.editor-visual-editor:not(.is-resizable) .block-editor-iframe__scale-container{\n\t\t\t\t\t\t\t${"top"===k?"":"margin-bottom: 250px;"}\n\t\t\t\t\t\t\t${"Desktop"!==l&&"bottom"===k?"height: 1224px;":""}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t`},"layout-style")]})}(0,r.__)("Introduction to your Header","kadence-blocks"),(0,r.__)("The Header (adv) Block has many options to customize and extend your header. Keep reading to learn more or close this to get started. You can always read the","kadence-blocks"),(0,r.__)("documentation","kadence-blocks"),(0,r.__)("later.","kadence-blocks"),(0,r.__)("Logo Image","kadence-blocks"),(0,r.__)("This header automatically displays your site logo. You can update it directly in the block settings.","kadence-blocks"),(0,r.__)("Manage Navigation","kadence-blocks"),(0,r.__)("You can use the Navigation (adv) block to build a new navigation or use an existing one.","kadence-blocks"),(0,r.__)("Customize CTAs","kadence-blocks"),(0,r.__)("Use Button blocks to add your Call to Actions and Social Links.","kadence-blocks"),(0,r.__)("Edit Appearance","kadence-blocks"),(0,r.__)("Customize your header's appearance by selecting the Header (adv) block and using the options in the sidebar.","kadence-blocks"),(0,r.__)("The Visual Builder","kadence-blocks"),(0,r.__)("Easily arrange the layout and content of your header with the Visual Builder. Look for it at the bottom of the editor.","kadence-blocks"),(0,r.__)("Off Canvas Trigger","kadence-blocks"),(0,r.__)("Your header has an off canvas area. The Off Canvas Trigger block in your header will open it on the live page.","kadence-blocks"),(0,r.__)("Manage Off Canvas Content","kadence-blocks"),(0,r.__)('To edit your off canvas content, select the "Off Canvas" tab from the visual builder.',"kadence-blocks");const Cn=()=>{const{previewDevice:e,visualBuilderClientId:n,modalPosition:r}=(0,t.useSelect)(e=>({previewDevice:e("kadenceblocks/data").getPreviewDeviceType(),visualBuilderClientId:e("kadenceblocks/data").getSelectedHeaderVisualBuilderId(),modalPosition:e("kadenceblocks/data").getOpenHeaderVisualBuilderPosition()}),[]);return n?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(kn,{clientId:n,previewDevice:e,isSelected:!0}),(0,i.jsx)("style",{children:` .editor-visual-editor.is-iframed {\n             ${"top"===r?"margin-top: 290px;":""}\n                }\n             `})]}):null};document.addEventListener("DOMContentLoaded",()=>{const t=document.createElement("div");t.id="kb-header-visual-builder",document.body.appendChild(t),(0,e.createRoot)(t).render((0,i.jsx)(Cn,{}))})})(),(this.kadence=this.kadence||{})["header-visual-builder"]={}})();