var f=Object.defineProperty,h=Object.defineProperties;var x=Object.getOwnPropertyDescriptors;var a=Object.getOwnPropertySymbols;var g=Object.prototype.hasOwnProperty,j=Object.prototype.propertyIsEnumerable;var i=(s,e,l)=>e in s?f(s,e,{enumerable:!0,configurable:!0,writable:!0,value:l}):s[e]=l,o=(s,e)=>{for(var l in e||(e={}))g.call(e,l)&&i(s,l,e[l]);if(a)for(var l of a(e))j.call(e,l)&&i(s,l,e[l]);return s},d=(s,e)=>h(s,x(e));import{j as t}from"./react-vendor-xYZnmIII.js";import{L as v,at as E,au as S,av as b,aw as y,a_ as C,a$ as L,ax as c}from"./ui-components-CQM92IK3.js";import{useEditor as N}from"./use-editor-CiTCcx1l.js";import"./inertia-vendor-cBbDTmhJ.js";import"./ui-vendor-Ds9iwIxa.js";import"./interactive-vendor-B1OgcAgP.js";import"./editor-provider-0C4WlrME.js";import"./v4-DsPse6Vr.js";const F=({changeCustomValues:s})=>{const{editor:e,dispatch:l}=N(),n=e.editor.selectedElement.content,u=()=>{const r=e.editor.selectedElement.className||"";return r.includes("left-0")&&!r.includes("left-1/2")?"right":r.includes("right-0")?"left":r.includes("left-1/2")&&r.includes("-translate-x-1/2")?"center":r.includes("bottom-full")?"top":r.includes("top-full")?"bottom":"left"},m=()=>{if(typeof n=="object"&&n!==null&&"placement"in n){const r=n.placement;if(["left","right","center","top","bottom"].includes(r))return r}return Array.isArray(n)?u():"left"};return t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx(v,{children:"Placement"}),t.jsxs(E,{onValueChange:r=>{const p=Array.isArray(n)?n:typeof n=="object"&&n!==null&&"children"in n?n.children:[];l({type:"UPDATE_ELEMENT",payload:{elementDetails:d(o({},e.editor.selectedElement),{content:{placement:r,children:p}})}})},value:m(),children:[t.jsx(S,{children:t.jsx(b,{placeholder:"Select placement"})}),t.jsx(y,{children:t.jsxs(C,{children:[t.jsx(L,{children:"Placement Options"}),t.jsx(c,{value:"left",children:"Left (Right-aligned)"}),t.jsx(c,{value:"right",children:"Right (Left-aligned)"}),t.jsx(c,{value:"center",children:"Center"}),t.jsx(c,{value:"top",children:"Top"}),t.jsx(c,{value:"bottom",children:"Bottom"})]})})]}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Choose where the content appears relative to the trigger"})]})};export{F as default};
