1;!function(){try { var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&((e._debugIds|| (e._debugIds={}))[n]="612025be-4ae8-bae3-0a12-627681695837")}catch(e){}}(); 2(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,522557,378215,382254,526121,933477,203294,658735,e=>{"use strict";var r=e.i(681099),t=e.i(514499),n=e.i(543489),a=e.i(258950),o=e.i(953760),i=e.i(88653),s=e.i(846932),l=e.i(303887),c=e.i(489632),d=e.i(99769),u=function(){return(u=Object.assign||function(e){for(var r,t=1,n=arguments.length;t<n;t++)for(var a in r=arguments[t])Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a]);return e}).apply(this,arguments)};e.s(["InlineTextEditor",0,function(e){var g=e.id,f=e.value,p=e.isActive,x=e.onDeactivate,y=e.onSave,h=e.anchorEl,m=e.className,b=e.onChange,v=e.configKey,k=(0,t.useState)(f),j=k[0],w=k[1],N=(0,t.useState)(f),C=N[0],P=N[1],E=(0,c.useWidgetEdit)(),O=E.onValueChange,F=E.onCommit,S=(0,t.useRef)(null),I=(0,t.useRef)(!1),z=v||g;(0,t.useEffect)(function(){p&&(w(f),P(f),I.current=!1)},[p]);var B=function(e){null==e||e.stopPropagation(),I.current||(I.current=!0,null==F||F(z,j),y(j),x())},A=function(e){null==e||e.stopPropagation(),I.current||(I.current=!0,null==O||O(z,C),null==b||b(C),x())},D=(0,n.useFloating)({open:p,strategy:"fixed",onOpenChange:function(e){e||I.current||B()},placement:"bottom-start",middleware:[(0,a.offset)(8),(0,a.flip)(),(0,a.shift)({padding:8})],whileElementsMounted:o.autoUpdate,elements:{reference:h||void 0}}),R=D.x,K=D.y,M=D.strategy,T=D.refs,V=D.context,U=(0,n.useDismiss)(V,{escapeKey:!1}),W=(0,n.useInteractions)([U]).getFloatingProps;return h?(0,r.jsx)(n.FloatingPortal,{children:(0,r.jsx)(i.AnimatePresence,{children:p&&(0,r.jsx)(n.FloatingFocusManager,{context:V,modal:!1,initialFocus:S,children:(0,r.jsxs)(s.motion.div,u({initial:{opacity:0,scale:.95,y:10},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:10},transition:{duration:.15},ref:T.setFloating,style:{position:M,top:null!=K?K:0,left:null!=R?R:0}},W(),{className:(0,d.cn)("z-[9999] flex flex-col bg-white dark:bg-gray-900 border border-gray-200 dark:border-gray-700 rounded-lg shadow-xl p-2 outline-none min-w-[280px]",m),onClick:function(e){return e.stopPropagation()},children:[(0,r.jsx)("input",{ref:S,type:"text",value:j,onChange:function(e){var r=e.target.value;w(r),null==O||O(z,r),null==b||b(r)},onKeyDown:function(e){"Enter"===e.key?B(e):"Escape"===e.key?A(e):"Tab"===e.key&&(e.preventDefault(),B(e))},onClick:function(e){return e.stopPropagation()},className:"flex-1 px-3 py-2 text-sm border border-gray-100 dark:border-gray-600 rounded bg-gray-50 dark:bg-gray-800 text-gray-900 dark:text-gray-100 placeholder-gray-400 dark:placeholder-gray-500 focus:ring-1 focus:ring-gray-400 dark:focus:ring-gray-500 focus:bg-white dark:focus:bg-gray-700 focus:outline-none mb-2"}),(0,r.jsxs)("div",{className:"flex items-center justify-end gap-2 pt-1 border-t border-gray-50 dark:border-gray-700",children:[(0,r.jsx)(l.Button,{size:"sm",variant:"ghost",className:"h-8 px-3 text-xs text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-200 hover:bg-gray-100 dark:hover:bg-gray-700",onClick:A,children:"Cancel"}),(0,r.jsx)(l.Button,{size:"sm",className:"h-8 px-4 text-xs",onClick:B,children:"Save"})]})]}))})})}):null}],378215);var g=e.i(880088),f=function(){return(f=Object.assign||function(e){for(var r,t=1,n=arguments.length;t<n;t++)for(var a in r=arguments[t])Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a]);return e}).apply(this,arguments)};e.s(["InlineColorPicker",0,function(e){var u=e.id,p=e.value,x=e.isActive,y=e.onDeactivate,h=e.onSave,m=e.anchorEl,b=e.className,v=e.label,k=e.onChange,j=e.configKey,w=(0,t.useState)(p),N=w[0],C=w[1],P=(0,t.useState)(p),E=P[0],O=P[1],F=(0,c.useWidgetEdit)(),S=F.onValueChange,I=F.onCommit,z=(0,t.useRef)(null),B=(0,t.useRef)(!1),A=j||u;(0,t.useEffect)(function(){x&&(C(p),O(p),B.current=!1)},[x]);var D=(0,n.useFloating)({open:x,strategy:"fixed",onOpenChange:function(e){e||B.current||H()},placement:"bottom-start",middleware:[(0,a.offset)(8),(0,a.flip)(),(0,a.shift)({padding:8})],whileElementsMounted:o.autoUpdate,elements:{reference:m||void 0}}),R=D.x,K=D.y,M=D.strategy,T=D.refs,V=D.context,U=(0,n.useDismiss)(V,{escapeKey:!1}),W=(0,n.useInteractions)([U]).getFloatingProps,H=function(){B.current||(B.current=!0,null==I||I(A,N),h(N),y())},L=function(){B.current||(B.current=!0,null==S||S(A,E),null==k||k(E),y())},_=function(e){C(e),null==S||S(A,e),null==k||k(e)};return m?(0,r.jsx)(n.FloatingPortal,{children:(0,r.jsx)(i.AnimatePresence,{children:x&&(0,r.jsx)(n.FloatingFocusManager,{context:V,modal:!1,initialFocus:z,children:(0,r.jsxs)(s.motion.div,f({initial:{opacity:0,scale:.95,y:10}
2,animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:10},transition:{duration:.15},ref:T.setFloating,style:{position:M,top:null!=K?K:0,left:null!=R?R:0}},W(),{className:(0,d.cn)("z-[9999] flex flex-col gap-3 bg-white dark:bg-gray-900 border border-gray-200 dark:border-gray-700 rounded-lg shadow-xl p-3 outline-none",b),onKeyDown:function(e){"Enter"===e.key?H():"Escape"===e.key&&L()},children:[(0,r.jsx)("div",{className:"text-xs font-semibold text-gray-500 dark:text-gray-400 uppercase tracking-wider px-1",children:void 0===v?"Pick a color":v}),(0,r.jsx)(g.HexColorPicker,{color:N,onChange:_}),(0,r.jsxs)("div",{className:"flex items-center gap-2 px-1",children:[(0,r.jsx)("span",{className:"text-sm font-medium text-gray-400 dark:text-gray-500",children:"#"}),t.default.createElement(g.HexColorInput,{ref:z,color:N,onChange:_,className:"flex-1 px-2 py-1 text-sm border border-gray-100 dark:border-gray-600 rounded bg-gray-50 dark:bg-gray-800 text-gray-900 dark:text-gray-100 focus:ring-1 focus:ring-gray-400 dark:focus:ring-gray-500 focus:bg-white dark:focus:bg-gray-700 focus:outline-none font-mono"})]}),(0,r.jsxs)("div",{className:"flex items-center justify-end gap-2 pt-2 border-t border-gray-50 dark:border-gray-700",children:[(0,r.jsx)(l.Button,{size:"sm",variant:"ghost",className:"h-8 px-3 text-xs text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-200 hover:bg-gray-100 dark:hover:bg-gray-700",onClick:L,children:"Cancel"}),(0,r.jsx)(l.Button,{size:"sm",className:"h-8 px-4 text-xs",onClick:H,children:"Save"})]})]}))})})}):null}],382254);var p=e.i(107233),x=e.i(37727),y=e.i(225913),h=function(){return(h=Object.assign||function(e){for(var r,t=1,n=arguments.length;t<n;t++)for(var a in r=arguments[t])Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a]);return e}).apply(this,arguments)},m=function(e,r){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>r.indexOf(n)&&(t[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var a=0,n=Object.getOwnPropertySymbols(e);a<n.length;a++)0>r.indexOf(n[a])&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(t[n[a]]=e[n[a]]);return t},b=(0,y.cva)("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function v(e){var t=e.className,n=e.variant,a=m(e,["className","variant"]);return(0,r.jsx)("div",h({className:(0,d.cn)(b({variant:n}),t)},a))}var k=function(){return(k=Object.assign||function(e){for(var r,t=1,n=arguments.length;t<n;t++)for(var a in r=arguments[t])Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a]);return e}).apply(this,arguments)},j=function(e,r,t){if(t||2==arguments.length)for(var n,a=0,o=r.length;a<o;a++)!n&&a in r||(n||(n=Array.prototype.slice.call(r,0,a)),n[a]=r[a]);return e.concat(n||Array.prototype.slice.call(r))};e.s(["InlineSuggestionsEditor",0,function(e){var u=e.id,f=e.value,y=e.bgColorId,h=e.bgColorValue,m=e.isActive,b=e.onDeactivate,w=e.onSave,N=e.anchorEl,C=e.className,P=e.onChange,E=(0,t.useState)(""),O=E[0],F=E[1],S=(0,t.useState)(f),I=S[0],z=S[1],B=(0,t.useState)(h),A=B[0],D=B[1],R=(0,t.useState)(f),K=R[0],M=R[1],T=(0,t.useState)(h),V=T[0],U=T[1],W=(0,c.useWidgetEdit)(),H=W.onValueChange,L=W.onCommit,_=(0,t.useRef)(null),X=(0,t.useRef)(null),q=(0,t.useRef)(!1);(0,t.useEffect)(function(){m&&(z(f),D(h),M(f),U(h),F(""),q.current=!1)},[m]);var G=(0,n.useFloating)({open:m,strategy:"fixed",onOpenChange:function(e){e||q.current||eo()},placement:"bottom-start",middleware:[(0,a.offset)(8),(0,a.flip)(),(0,a.shift)({padding:8})],whileElementsMounted:o.autoUpdate,elements:{reference:N||void 0}}),J=G.x,Q=G.y,Y=G.strategy,Z=G.refs,$=G.context,ee=(0,n.useDismiss)($,{escapeKey:!1}),er=(0,n.useInteractions)([ee]).getFloatingProps,et=function(){if(!(I.length>=5)){var e=O.trim();if(e&&!I.includes(e)){var r=j(j([],I,!0),[e],!1);z(r),null==H||H(u,r),null==P||P(r,A),F(""),setTimeout(function(){var e;return null==(e=_.current)?void 0:e.focus()},0)}}},en=function(e){var r=I.filter(function(r,t){return t!==e});z(r),null==H||H(u,r),null==P||P(r,A)},ea=function(e){D(e),null==H||H(y,e),null==P||P(I,e)},eo=function(e){null==e||e.stopPropagation(),q.current||(q.current=!0,null==L||L(u,I),null==L||L(y,A),w(I,A),b())},ei=function(e){null==e||e.stopPropagation(),q.current||(q.current=!0,null==H||H(u,K),null==H||H(y,V),null==P||P(K,V),b())};return N?(0,r.jsx)(n.FloatingPortal,{children:(0,r.jsx)(i.AnimatePresence,{children:m&&(0,r.jsx)(n.FloatingFocusManager,{context:$,modal:!1,initialFocus:_,children:(0,r.jsxs)(s.motion.div,k({initial:{opacity:0,scale:.95,y:10}
2,animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:10},transition:{duration:.15},ref:Z.setFloating,style:{position:Y,top:null!=Q?Q:0,left:null!=J?J:0}},er(),{className:(0,d.cn)("z-[9999] flex flex-col gap-3 bg-white dark:bg-gray-900 border border-gray-200 dark:border-gray-700 rounded-lg shadow-xl p-3 min-w-[320px] outline-none",C),onClick:function(e){return e.stopPropagation()},children:[(0,r.jsx)("div",{className:"text-xs font-semibold text-gray-500 dark:text-gray-400 uppercase tracking-wider px-1",children:"Edit Suggestions"}),(0,r.jsxs)("div",{className:"grid grid-cols-2 gap-1.5 max-h-[150px] overflow-y-auto p-2 border border-gray-100 dark:border-gray-700 rounded bg-gray-50/30 dark:bg-gray-800/50",onClick:function(e){return e.stopPropagation()},children:[I.map(function(e,t){return(0,r.jsxs)(v,{variant:"secondary",className:"pl-2 pr-1 py-1 flex items-center gap-1 group bg-gray-100 dark:bg-gray-700 text-gray-700 dark:text-gray-200 border-gray-200 dark:border-gray-600 hover:bg-gray-200 dark:hover:bg-gray-600 transition-colors",children:[(0,r.jsx)("span",{className:"max-w-[150px] truncate text-xs",children:e}),(0,r.jsx)("button",{onClick:function(e){e.stopPropagation(),en(t)},className:"rounded-full hover:bg-gray-300 dark:hover:bg-gray-500 p-0.5 transition-colors",children:(0,r.jsx)(x.X,{className:"h-3 w-3"})})]},t)}),0===I.length&&(0,r.jsx)("div",{className:"text-[10px] text-gray-400 dark:text-gray-500 py-1 px-1 italic",children:"No suggestions yet. Add one below."})]}),(0,r.jsx)("div",{className:"flex items-center gap-2 px-1",onClick:function(e){return e.stopPropagation()},children:I.length<5?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"relative flex-1",children:(0,r.jsx)("input",{ref:_,type:"text",value:O,onChange:function(e){return F(e.target.value)},onKeyDown:function(e){e.stopPropagation(),"Enter"===e.key?O.trim()?et():eo(e):"Escape"===e.key?ei(e):"Tab"===e.key&&O.trim()&&(e.preventDefault(),et())},onClick:function(e){return e.stopPropagation()},placeholder:"Type a new suggestion...",className:"w-full px-3 py-1.5 text-sm border border-gray-100 dark:border-gray-600 rounded bg-gray-50 dark:bg-gray-800 text-gray-900 dark:text-gray-100 placeholder-gray-400 dark:placeholder-gray-500 focus:ring-1 focus:ring-gray-400 dark:focus:ring-gray-500 focus:bg-white dark:focus:bg-gray-700 focus:outline-none"})}),(0,r.jsx)(l.Button,{size:"sm",variant:"secondary",className:"h-8 w-8 p-0 shrink-0 bg-gray-100 dark:bg-gray-700 hover:bg-gray-200 dark:hover:bg-gray-600 text-gray-600 dark:text-gray-300",onClick:function(e){e.stopPropagation(),et()},disabled:!O.trim(),children:(0,r.jsx)(p.Plus,{className:"h-4 w-4"})})]}):(0,r.jsx)("div",{className:"w-full py-1.5 px-3 bg-gray-50 dark:bg-gray-800 text-xs text-gray-500 dark:text-gray-400 rounded border border-gray-100 dark:border-gray-600 text-center italic",children:"Max 5 suggestions reached"})}),(0,r.jsxs)("div",{className:"border-t border-gray-50 dark:border-gray-700 pt-2",onClick:function(e){return e.stopPropagation()},children:[(0,r.jsx)("div",{className:"text-xs font-semibold text-gray-500 dark:text-gray-400 uppercase tracking-wider px-1 mb-2",children:"Backgroun
2d Color"}),(0,r.jsx)(g.HexColorPicker,{color:A,onChange:ea,className:"!w-full !h-[120px] mb-2"}),(0,r.jsxs)("div",{className:"flex items-center gap-2 px-1",children:[(0,r.jsx)("span",{className:"text-sm font-medium text-gray-400 dark:text-gray-500",children:"#"}),t.default.createElement(g.HexColorInput,{ref:X,color:A,onChange:ea,onClick:function(e){return e.stopPropagation()},className:"flex-1 px-2 py-1 text-sm border border-gray-100 dark:border-gray-600 rounded bg-gray-50 dark:bg-gray-800 text-gray-900 dark:text-gray-100 focus:ring-1 focus:ring-gray-400 dark:focus:ring-gray-500 focus:bg-white dark:focus:bg-gray-700 focus:outline-none font-mono"}),(0,r.jsx)("div",{className:"w-6 h-6 rounded border border-gray-100 dark:border-gray-600 shadow-sm",style:{backgroundColor:A}})]})]}),(0,r.jsxs)("div",{className:"flex items-center justify-end gap-2 pt-2 border-t border-gray-50 dark:border-gray-700",children:[(0,r.jsx)(l.Button,{size:"sm",variant:"ghost",className:"h-8 px-3 text-xs text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-200 hover:bg-gray-100 dark:hover:bg-gray-700",onClick:ei,children:"Cancel"}),(0,r.jsx)(l.Button,{size:"sm",className:"h-8 px-4 text-xs",onClick:eo,children:"Save"})]})]}))})})}):null}],526121);var w=e.i(473708),N=e.i(221345),C=function(){return(C=Object.assign||function(e){for(var r,t=1,n=arguments.length;t<n;t++)for(var a in r=arguments[t])Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a]);return e}).apply(this,arguments)};e.s(["InlineImageUrlEditor",0,function(e){var u=e.id,g=e.value,f=e.isActive,p=e.onDeactivate,x=e.onSave,y=e.anchorEl,h=e.className,m=e.label,b=e.onChange,v=e.configKey,k=(0,t.useState)(g),j=k[0],P=k[1],E=(0,t.useState)(g),O=E[0],F=E[1],S=(0,t.useState)(!1),I=S[0],z=S[1],B=(0,c.useWidgetEdit)(),A=B.onValueChange,D=B.onCommit,R=(0,t.useRef)(null),K=(0,t.useRef)(!1),M=v||u;(0,t.useEffect)(function(){f&&(P(g),F(g),z(!1),K.current=!1)},[f]);var T=(0,n.useFloating)({open:f,strategy:"fixed",onOpenChange:function(e){e||K.current||q()},placement:"bottom-start",middleware:[(0,a.offset)(8),(0,a.flip)(),(0,a.shift)({padding:8})],whileElementsMounted:o.autoUpdate,elements:{reference:y||void 0}}),V=T.x,U=T.y,W=T.strategy,H=T.refs,L=T.context,_=(0,n.useDismiss)(L,{escapeKey:!1}),X=(0,n.useInteractions)([_]).getFloatingProps,q=function(e){null==e||e.stopPropagation(),K.current||(K.current=!0,null==D||D(M,j),x(j),p())},G=function(e){null==e||e.stopPropagation(),K.current||(K.current=!0,null==A||A(M,O),null==b||b(O),p())};return y?(0,r.jsx)(n.FloatingPortal,{children:(0,r.jsx)(i.AnimatePresence,{children:f&&(0,r.jsx)(n.FloatingFocusManager,{context:L,modal:!1,initialFocus:R,children:(0,r.jsxs)(s.motion.div,C({initial:{opacity:0,scale:.95,y:10},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:10},transition:{duration:.15},ref:H.setFloating,style:{position:W,top:null!=U?U:0,left:null!=V?V:0}},X(),{className:(0,d.cn)("z-[9999] flex flex-col gap-3 bg-white dark:bg-gray-900 border border-gray-200 dark:border-gray-700 rounded-lg shadow-xl p-3 min-w-[320px] outline-none",h),onClick:function(e){return e.stopPropagation()},children:[(0,r.jsxs)("div",{className:"text-xs font-semibold text-gray-500 dark:text-gray-400 uppercase tracking-wider flex items-center gap-1.5 px-1",children:[(0,r.jsx)(w.Image,{className:"h-3 w-3"}),void 0===m?"Image URL":m]}),(0,r.jsxs)("div",{className:"flex gap-3 px-1",onClick:function(e){return e.stopPropagation()},children:[(0,r.jsx)("div",{className:"w-16 h-16 rounded-md border border-gray-100 dark:border-gray-600 bg-gray-50 dark:bg-gray-800 flex items-center justify-center shrink-0 overflow-hidden",children:j&&!I?(0,r.jsx)("img",{src:j,alt:"Preview",className:"w-full h-full object-cover",onError:function(){return z(!0)}}):(0,r.jsx)(w.Image,{className:"h-6 w-6 text-gray-300 dark:text-gray-600"})}),(0,r.jsxs)("div",{className:"flex-1 flex flex-col gap-2",children:[(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)(N.Link,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-gray-400 dark:text-gray-500"}),(0,r.jsx)("input",{ref:R,type:"text",value:j,onChange:function(e){var r=e.target.value;P(r),z(!1),null==A||A(M,r),null==b||b(r)},onKeyDown:function(e){"Enter"===e.key?q(e):"Escape"===e.key?G(e):"Tab"===e.key&&(e.preventDefault(),q(e))},onClick:function(e){return e.stopPropagation()},placeholder:"https://example.com/image.png",className:"w-full pl-8 pr-2.5 py-1.5 text-sm border border-gray-100 dark:border-gray-600 rounded bg-gray-50 dark:bg-gray-800 text-gray-900 dark:text-gray-100 placeholder-gray-400 dark:placeholder-gray-500 focus:ring-1 focus:ring-gray-400 dark:focus:ring-gray-500 focus:bg-white dark:focus:bg-gray-700 focus:outline-none font-mono"})]}),I&&j&&(0,r.jsx)("span",{className:"text-[10px] text-red-500",children:"Invalid image URL or unable to load"})]})]}),(0,r.jsxs)("div",{className:"flex items-center justify-end gap-2 pt-2 border-t border-gray-50 dark:border-gray-700",children:[(0,r.jsx)(l.Button,{size:"sm",variant:"ghost",className:"h-8 px-3 text-xs text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-200 hover:bg-gray-100 dark:hover:bg-gray-700",onClick:G,children:"Cancel"}),(0,r.jsx)(l.Button,{size:"sm",className:"h-8 px-4 text-xs",onClick:q,children:"Save"})]})]}))})})}):null}],933477),e.i(168312),e.i(373264);var P=function(){return(P=Object.assign||function(e){for(var r,t=1,n=arguments.length;t<n;t++)for(var a in r=arguments[t])Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a]);return e}).apply(this,arguments)};e.s(["InlineCompositeEditor",0,function(e){e.id;var u=e.fields,f=e.isActive,p=e.onDeactivate,x=e.anchorEl,y=e.className,h=e.title,m=e.onSave,b=e.onChange,v=(0,c.useWidgetEdit)(),k=v.onValueChange,j=v.onCommit,w=v.onBulkValueChange,N=v.onBulkCommit,C=t.default.useMemo(function(){return{textFields:u.filter(function(e){return"text"===e.type}),colorFields:u.filter(function(e){return"color"===e.type}),toggleFields:u.filter(function(e){return"toggle"===e.type}),selectFields:u.filter(function(e){return"select"===e.type})}},[u]),E=C.textFields,O=C.colorFields,F=C.toggleFields,S=C.selectFields,I=(0,t.useState)({}),z=I[0],B=I[1],A=(0,t.useState)({}),D=A[0],R=A[1],K=(0,t.useState)(null),M=K[0],T=K[1],V=(0,t.useRef)(null),U=(0,t.useRef)(!1);(0,t.useEffect)(function(){if(f){var e={};u.forEach(function(r){e[r.id]=r.value}),B(e),R(e),T(null),U.current=!1}},[f]);var W=x&&"nodeType"in x,H=(0,n.useFloating)({open:f,strategy:"fixed",onOpenChange:function(e){e||U.current||Z()},placement:"bottom-start",middleware:[(0,a.offset)(8),(0,a.flip)(),(0,a.shift)({padding:8})],whileElementsMounted:W?o.autoUpdate:void 0}),L=H.x,_=H.y,X=H.strategy,q=H.refs,G=H.context,J=H.update;
2(0,t.useEffect)(function(){x&&q.setPositionReference(x)},[x,q]);var Q=(0,n.useDismiss)(G,{escapeKey:!1}),Y=(0,n.useInteractions)([Q]).getFloatingProps;(0,t.useEffect)(function(){f&&J()},[M,f,J]),(0,t.useEffect)(function(){f&&1===O.length&&0===E.length&&T(O[0].id)},[f,O.length,E.length]);var Z=function(e){null==e||e.stopPropagation(),U.current||(U.current=!0,N?N(z):Object.entries(z).forEach(function(e){var r=e[0],t=e[1];null==j||j(r,t)}),m&&m(z),p())},$=function(e){null==e||e.stopPropagation(),U.current||(U.current=!0,w?w(D):Object.entries(D).forEach(function(e){var r=e[0],t=e[1];null==k||k(r,t)}),b&&b(D),p())},ee=function(e,r){var t,n=P(P({},z),((t={})[e]=r,t));B(n),null==k||k(e,r),b&&b(n)},er=function(e,r){var t,n=P(P({},z),((t={})[e]=r,t));B(n),null==k||k(e,r),b&&b(n)},et=function(e,r){var t,n=u.find(function(r){return r.id===e}),a=r;(null==n?void 0:n.options)&&n.options.length>=2&&(a=r?n.options[1].value:n.options[0].value);var o=P(P({},z),((t={})[e]=a,t));B(o),null==k||k(e,a),b&&b(o)},en=function(e,r){var t,n=P(P({},z),((t={})[e]=r,t));B(n),null==k||k(e,r),b&&b(n)};return x?(0,r.jsx)(n.FloatingPortal,{children:(0,r.jsx)(i.AnimatePresence,{children:f&&(0,r.jsx)(n.FloatingFocusManager,{context:G,modal:!1,initialFocus:E.length>0?V:void 0,children:(0,r.jsxs)(s.motion.div,P({initial:{opacity:0,scale:.95,y:10},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:10},transition:{duration:.15},ref:q.setFloating,style:{position:X,top:null!=_?_:0,left:null!=L?L:0}},Y(),{className:(0,d.cn)("z-[9999] flex flex-col gap-4 bg-white dark:bg-gray-900 border border-gray-200 dark:border-gray-700 rounded-lg shadow-xl p-4 min-w-[340px] outline-none",y),onKeyDown:function(e){"Enter"===e.key?Z(e):"Escape"===e.key&&$(e)},onClick:function(e){return e.stopPropagation()},children:[(0,r.jsx)("div",{className:"text-sm font-semibold text-gray-700 dark:text-gray-200 px-1 border-b border-gray-50 dark:border-gray-700 pb-2",children:void 0===h?"Edit":h}),F.length>0&&(0,r.jsx)("div",{className:"flex flex-col gap-3 px-1",children:F.map(function(e){return(0,r.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,r.jsx)("label",{className:"text-sm text-gray-600 dark:text-gray-300 font-medium",children:e.label}),(0,r.jsx)("button",{onClick:function(){var r=e.options&&e.options.length>=2?z[e.id]===e.options[1].value:!!z[e.id];et(e.id,!r)},className:(0,d.cn)("relative inline-flex h-6 w-11 items-center rounded-full transition-colors focus:outline-none",(e.options&&e.options.length>=2?z[e.id]===e.options[1].value:z[e.id])?"bg-blue-600":"bg-gray-200 dark:bg-gray-600"),children:(0,r.jsx)("span",{className:(0,d.cn)("inline-block h-4 w-4 transform rounded-full bg-white transition-transform",(e.options&&e.options.length>=2?z[e.id]===e.options[1].value:z[e.id])?"translate-x-6":"translate-x-1")})})]},e.id)})}),S.length>0&&(0,r.jsx)("div",{className:"flex flex-col gap-3 px-1",children:S.map(function(e){var t;return(0,r.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,r.jsx)("label",{className:"text-xs text-gray-500 dark:text-gray-400 font-medium",children:e.label}),(0,r.jsx)("div",{className:"flex gap-2",children:null==(t=e.options)?void 0:t.map(function(t){return(0,r.jsx)("button",{onClick:function(){return en(e.id,t.value)},className:(0,d.cn)("flex-1 px-3 py-2 text-xs font-medium border rounded-md transition-all",z[e.id]===t.value?"bg-blue-50 dark:bg-blue-900/30 border-blue-200 dark:border-blue-700 text-blue-700 dark:text-blue-300 shadow-sm":"bg-white dark:bg-gray-800 border-gray-200 dark:border-gray-600 text-gray-500 dark:text-gray-400 hover:bg-gray-50 dark:hover:bg-gray-700"),children:t.label},t.value)})})]},e.id)})}),E.length>0&&(0,r.jsx)("div",{className:"flex flex-col gap-3 px-1",children:E.map(function(e,t){return(0,r.jsxs)("div",{className:"flex flex-col gap-1",children:[E.length>1&&(0,r.jsx)("label",{className:"text-xs text-gray-500 dark:text-gray-400 font-medium",children:e.label}),(0,r.jsx)("input",{ref:0===t?V:void 0,type:"text",value:z[e.id]||"",onChange:function(r){return ee(e.id,r.target.value)},className:"w-full px-3 py-2 text-sm border border-gray-200 dark:border-gray-600 rounded-md bg-white dark:bg-gray-800 text-gray-900 dark:text-gray-100 placeholder-gray-400 dark:placeholder-gray-500 focus:ring-1 focus:ring-blue-500 dark:focus:ring-blue-400 focus:border-blue-500 dark:focus:border-blue-400 outline-none",placeholder:e.placeholder||e.label,onClick:function(e){return e.stopPropagation()}})]},e.id)})}),O.length>0&&(E.length>0||O.length>1)&&(0,r.jsx)("div",{className:"flex flex-wrap gap-3 px-1",children:O.map(function(e){return(0,r.jsxs)("div",{className:"flex flex-col gap-1.5 cursor-pointer group flex-1 min-w-[20%]",onClick:function(r){r.stopPropagation(),T(M===e.id?null:e.id)},children:[(0,r.jsx)("span",{className:(0,d.cn)("text-xs font-medium whitespace-nowrap transition-colors",M===e.id?"text-gray-900 dark:text-gray-100":"text-gray-500 dark:text-gray-400 group-hover:text-gray-700 dark:group-hover:text-gray-200"),children:e.label}),(0,r.jsx)("div",{className:"flex gap-2 items-center",children:(0,r.jsx)("div",{className:(0,d.cn)("w-10 h-10 rounded-md border shadow-sm transition-all duration-200 shrink-0 hover:scale-105 active:scale-95",M===e.id?"border-gray-900 dark:border-gray-300 ring-2 ring-gray-100 dark:ring-gray-700 scale-105":"border-gray-200 dark:border-gray-600 group-hover:border-gray-300 dark:group-hover:border-gray-500"),style:{backgroundColor:z[e.id]}})})]},e.id)})}),(0,r.jsx)(i.AnimatePresence,{children:M&&(0,r.jsx)(s.motion.div,{initial:{height:0,opacity:0,marginTop:0},animate:{height:"auto",opacity:1,marginTop:12},exit:{height:0,opacity:0,marginTop:0},transition:{duration:.2},className:"overflow-hidden border-t border-gray-50 dark:border-gray-700",onClick:function(e){return e.stopPropagation()},children:(0,r.jsxs)("div",{className:"pt-3",children:[(0,r.jsx)(g.HexColorPicker,{color:z[M]||"#000000",onChange:function(e){return er(M,e)},className:"!w-full !h-[120px] mb-3"}),(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("span",{className:"text-sm font-medium text-gray-400 dark:text-gray-500",children:"#"}),(0,r.jsx)(g.HexColorInput,{color:z[M]||"#000000",onChange:function(e){return er(M,e)},className:"flex-1 px-2 py-1 text-sm border border-gray-100 dark:border-gray-600 rounded bg-gray-50 dark:bg-gray-800 text-gray-900 dark:text-gray-100 focus:ring-1 focus:ring-gray-400 dark:focus:ring-gray-500 focus:bg-white dark:focus:bg-gray-700 focus:outline-none font-mono",prefixed:!1,onClick:function(e){return e.stopPropagation()}})]})]})})}),(0,r.jsxs)("div",{className:"flex items-center justify-end gap-2 pt-2 border-t border-gray-50 dark:border-gray-700",children:[(0,r.jsx)(l.Button,{size:"sm",variant:"ghost",className:"h-8 px-3 text-xs text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-200 hover:bg-gray-100 dark:hover:bg-gray-700",onClick:$,children:"Cancel"}),(0,r.jsx)(l.Button,{size:"sm",className:"h-8 px-4 text-xs",onClick:Z,children:"Save"})]})]}))})})}):null}],203294);var E=function(){return(E=Object.assign||function(e){for(var r,t=1,n=arguments.length;t<n;t++)for(var a in r=arguments[t])Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a]);return e}).apply(this,arguments)};e.s(["InlineToggleEditor",0,function(e){var l=e.id,u=e.label,g=e.checked,f=e.isActive,p=e.onDeactivate,x=e.onSave,y=e.anchorEl,h=e.className,m=e.onChange,b=(0,t.useState)(g),v=b[0],k=b[1],j=(0,t.useState)(g),w=(j[0],j[1]),N=(0,c.useWidgetEdit)(),C=N.onValueChange,P=N.onCommit,O=(0,t.useRef)(!1),F=(0,t.useRef)(null);(0,t.useEffect)(function(){f&&(k(g),w(g),O.current=!1)},[f]);var S=function(e){null==P||P(l,e),x(e)},I=(0,n.useFloating)({open:f,strategy:"fixed",onOpenChange:function(e){e||p()},placement:"bottom-start",middleware:[(0,a.offset)(8),(0,a.flip)(),(0,a.shift)({padding:8})],whileElementsMounted:o.autoUpdate,elements:{reference:y||void 0}}
2),z=I.x,B=I.y,A=I.strategy,D=I.refs,R=I.context,K=(0,n.useDismiss)(R,{escapeKey:!0}),M=(0,n.useInteractions)([K]).getFloatingProps;return y?(0,r.jsx)(n.FloatingPortal,{children:(0,r.jsx)(i.AnimatePresence,{children:f&&(0,r.jsx)(n.FloatingFocusManager,{context:R,modal:!1,initialFocus:F,children:(0,r.jsx)(s.motion.div,E({initial:{opacity:0,scale:.95,y:10},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:10},transition:{duration:.15},ref:D.setFloating,style:{position:A,top:null!=B?B:0,left:null!=z?z:0}},M(),{className:(0,d.cn)("z-[9999] flex flex-col bg-white dark:bg-gray-900 border border-gray-200 dark:border-gray-700 rounded-lg shadow-xl p-3 outline-none min-w-[240px]",h),onKeyDown:function(e){"Escape"===e.key&&p()},onClick:function(e){return e.stopPropagation()},children:(0,r.jsxs)("div",{className:"flex items-center justify-between px-1",children:[(0,r.jsx)("span",{className:"text-sm font-medium text-gray-700 dark:text-gray-200",children:u}),(0,r.jsxs)("button",{ref:F,type:"button",onClick:function(){var e=!v;k(e),null==C||C(l,e),null==m||m(e),S(e)},className:(0,d.cn)("relative inline-flex h-6 w-11 shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus:outline-none focus-visible:ring-2 focus-visible:ring-gray-900 dark:focus-visible:ring-gray-300 focus-visible:ring-offset-2",v?"bg-black dark:bg-white":"bg-gray-200 dark:bg-gray-600"),children:[(0,r.jsx)("span",{className:"sr-only",children:"Use setting"}),(0,r.jsx)("span",{"aria-hidden":"true",className:(0,d.cn)("pointer-events-none inline-block h-5 w-5 transform rounded-full bg-white dark:bg-gray-900 shadow ring-0 transition duration-200 ease-in-out",v?"translate-x-5":"translate-x-0")})]})]})}))})})}):null}],658735),e.s([],522557)},303887,e=>{"use strict";var r=e.i(681099),t=e.i(514499),n=e.i(991918),a=e.i(225913),o=e.i(99769),i=function(){return(i=Object.assign||function(e){for(var r,t=1,n=arguments.length;t<n;t++)for(var a in r=arguments[t])Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a]);return e}).apply(this,arguments)},s=function(e,r){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>r.indexOf(n)&&(t[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var a=0,n=Object.getOwnPropertySymbols(e);a<n.length;a++)0>r.indexOf(n[a])&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(t[n[a]]=e[n[a]]);return t},l=(0,a.cva)("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),c=t.forwardRef(function(e,t){var a=e.className,c=e.variant,d=e.size,u=e.asChild,g=e.children,f=s(e,["className","variant","size","asChild","children"]);return void 0!==u&&u?(0,r.jsx)(n.Slot,i({className:(0,o.cn)(l({variant:c,size:d,className:a})),ref:t},f,{children:g})):(0,r.jsx)("button",i({className:(0,o.cn)(l({variant:c,size:d,className:a})),ref:t},f,{children:g}))});c.displayName="Button",e.s(["Button",0,c])},489632,e=>{"use strict";var r=e.i(681099),t=e.i(514499),n=(0,t.createContext)({editMode:!1,activeEditorId:null,setActiveEditor:function(){}});e.s(["WidgetEditProvider",0,function(e){var a=e.children,o=e.editMode,i=e.onElementClick,s=e.onValueChange,l=e.onCommit,c=e.onBulkValueChange,d=e.onBulkCommit,u=e.onActiveEditorChange,g=(0,t.useState)(null),f=g[0],p=g[1];return(0,r.jsx)(n.Provider,{value:{editMode:void 0!==o&&o,onElementClick:i,onValueChange:s,onCommit:l,onBulkValueChange:c,onBulkCommit:d,activeEditorId:f,setActiveEditor:function(e){p(e),null==u||u(e)}},children:a})}
2,"useWidgetEdit",0,function(){return(0,t.useContext)(n)}])}]); 3 4//# debugId=612025be-4ae8-bae3-0a12-627681695837
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.