@texturehq/edges 1.22.3 → 1.22.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
- 'use strict';var reactHookForm=require('react-hook-form'),ce=require('react'),reactAriaComponents=require('react-aria-components'),reactStately=require('react-stately'),tailwindMerge=require('tailwind-merge'),sr=require('@phosphor-icons/react'),jsxRuntime=require('react/jsx-runtime'),lucideReact=require('lucide-react'),reactColorful=require('react-colorful');function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}var ce__namespace=/*#__PURE__*/_interopNamespace(ce);var sr__namespace=/*#__PURE__*/_interopNamespace(sr);var Ie={prefix:String(Math.round(Math.random()*1e10)),current:0},Bt=ce__namespace.default.createContext(Ie),Ho=ce__namespace.default.createContext(false);var Go=!!(typeof window<"u"&&window.document&&window.document.createElement),We=new WeakMap;function Mo(e=false){let o=ce.useContext(Bt),t=ce.useRef(null);if(t.current===null&&!e){var r,n;let a=(n=ce__namespace.default.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED)===null||n===void 0||(r=n.ReactCurrentOwner)===null||r===void 0?void 0:r.current;if(a){let i=We.get(a);i==null?We.set(a,{id:o.current,state:a.memoizedState}):a.memoizedState!==i.state&&(o.current=i.id,We.delete(a));}t.current=++o.current;}return t.current}function Oo(e){let o=ce.useContext(Bt);o===Ie&&!Go&&process.env.NODE_ENV!=="production"&&console.warn("When server rendering, you must wrap your application in an <SSRProvider> to ensure consistent ids are generated between the client and server.");let t=Mo(!!e),r=o===Ie&&process.env.NODE_ENV==="test"?"react-aria":`react-aria${o.prefix}`;return e||`${r}-${t}`}function qo(e){let o=ce__namespace.default.useId(),[t]=ce.useState($e()),r=t||process.env.NODE_ENV==="test"?"react-aria":`react-aria${Ie.prefix}`;return e||`${r}-${o}`}typeof ce__namespace.default.useId=="function"?qo:Oo;function Ko(){return false}function Uo(){return true}function jo(e){return ()=>{}}function $e(){return typeof ce__namespace.default.useSyncExternalStore=="function"?ce__namespace.default.useSyncExternalStore(jo,Ko,Uo):ce.useContext(Ho)}var Qo=new Set(["Arab","Syrc","Samr","Mand","Thaa","Mend","Nkoo","Adlm","Rohg","Hebr"]),Yo=new Set(["ae","ar","arc","bcc","bqi","ckb","dv","fa","glk","he","ku","mzn","nqo","pnb","ps","sd","ug","ur","yi"]);function Ue(e){if(Intl.Locale){let t=new Intl.Locale(e).maximize(),r=typeof t.getTextInfo=="function"?t.getTextInfo():t.textInfo;if(r)return r.direction==="rtl";if(t.script)return Qo.has(t.script)}let o=e.split("-")[0];return Yo.has(o)}var Zo=Symbol.for("react-aria.i18n.locale");function Dt(){let e=typeof window<"u"&&window[Zo]||typeof navigator<"u"&&(navigator.language||navigator.userLanguage)||"en-US";try{Intl.DateTimeFormat.supportedLocalesOf([e]);}catch{e="en-US";}return {locale:e,direction:Ue(e)?"rtl":"ltr"}}var je=Dt(),Re=new Set;function Et(){je=Dt();for(let e of Re)e(je);}function Lt(){let e=$e(),[o,t]=ce.useState(je);return ce.useEffect(()=>(Re.size===0&&window.addEventListener("languagechange",Et),Re.add(t),()=>{Re.delete(t),Re.size===0&&window.removeEventListener("languagechange",Et);}),[]),e?{locale:"en-US",direction:"ltr"}:o}var tr=ce__namespace.default.createContext(null);function Qe(){let e=Lt();return ce.useContext(tr)||e}var Ye=new Map;function Xe(e){let{locale:o}=Qe(),t=o+(e?Object.entries(e).sort((n,a)=>n[0]<a[0]?-1:1).join():"");if(Ye.has(t))return Ye.get(t);let r=new Intl.Collator(o,e);return Ye.set(t,r),r}function Ve(e){let o=Xe({usage:"search",...e}),t=ce.useCallback((a,i)=>i.length===0?true:(a=a.normalize("NFC"),i=i.normalize("NFC"),o.compare(a.slice(0,i.length),i)===0),[o]),r=ce.useCallback((a,i)=>i.length===0?true:(a=a.normalize("NFC"),i=i.normalize("NFC"),o.compare(a.slice(-i.length),i)===0),[o]),n=ce.useCallback((a,i)=>{if(i.length===0)return true;a=a.normalize("NFC"),i=i.normalize("NFC");let s=0,c=i.length;for(;s+c<=a.length;s++){let l=a.slice(s,s+c);if(o.compare(i,l)===0)return true}return false},[o]);return ce.useMemo(()=>({startsWith:t,endsWith:r,contains:n}),[t,r,n])}function At(e,o=300){let[t,r]=ce.useState(e);return ce.useEffect(()=>{let n=setTimeout(()=>r(e),o);return ()=>clearTimeout(n)},[e,o]),t}function ue(e=false){return `${e?"outline outline-1 outline-border-input focus:outline-2 focus:outline-action-default focus:outline-offset-0 invalid:outline-2 invalid:outline-feedback-error-border group-invalid:outline-2 group-invalid:outline-feedback-error-border forced-colors:focus:outline-[Highlight] forced-colors:focus:outline-2 forced-colors:focus:outline-offset-2":"outline-none focus-visible:outline focus-visible:outline-2 focus-visible:outline-action-default focus-visible:outline-offset-0 invalid:outline-2 invalid:outline-feedback-error-border group-invalid:outline-2 group-invalid:outline-feedback-error-border forced-colors:focus:outline-[Highlight] forced-colors:focus:outline-2 forced-colors:focus:outline-offset-2"}`}function L(e,o){return reactAriaComponents.composeRenderProps(e,t=>tailwindMerge.twMerge(o,t))}var k={sm:{text:"text-[length:var(--control-text-sm)]",height:"h-[var(--control-sm-height)]",padding:"px-[var(--control-padding-sm)]",paddingY:"py-[var(--control-gap-sm)]",gap:"gap-[var(--control-gap-sm)]"},md:{text:"text-[length:var(--control-text-md)]",height:"h-[var(--control-md-height)]",padding:"px-[var(--control-padding-md)]",paddingY:"py-[var(--control-gap-md)]",gap:"gap-[var(--control-gap-md)]"},lg:{text:"text-[length:var(--control-text-lg)]",height:"h-[var(--control-lg-height)]",padding:"px-[var(--control-padding-lg)]",paddingY:"py-[var(--control-gap-lg)]",gap:"gap-[var(--control-gap-lg)]"},xl:{text:"text-[length:var(--control-text-xl)]",height:"h-[var(--control-xl-height)]",padding:"px-[var(--control-padding-xl)]",paddingY:"py-[var(--control-gap-xl)]",gap:"gap-[var(--control-gap-xl)]"}};var he={xs:16,sm:20,md:24,lg:32,xl:40,"2xl":48},F=ce.memo(({name:e,size:o="md",color:t,weight:r="regular",className:n,ariaLabel:a,...i})=>{let s=sr__namespace[e];if(!s)return process.env.NODE_ENV==="development"&&console.error(`Icon "${e}" not found in @phosphor-icons/react`),null;let c=typeof o=="string"&&o in he?he[o]:o,l=tailwindMerge.twMerge("inline-block flex-shrink-0",!t&&"text-current",n);return jsxRuntime.jsx(s,{...i,size:c,color:t,weight:r,className:l,"aria-label":a||`${e} icon`,"data-testid":`icon-${e}`})});F.displayName="Icon";var Gt=ce.memo(({variant:e="subtle",shape:o="square",containerSize:t,containerClassName:r,size:n="md",className:a,name:i,color:s,weight:c,ariaLabel:l,ref:u,...d})=>{let x=typeof n=="string"&&n in he?he[n]:n,f=t?typeof t=="string"&&t in he?he[t]:t:x*1.75,p=tailwindMerge.twMerge("inline-flex items-center justify-center flex-shrink-0",o==="circle"?"rounded-full":"rounded-lg",e==="subtle"&&"bg-gray-100 dark:bg-gray-800",e==="solid"&&"bg-brand text-white",e==="outline"&&"border-2 border-current",r);return jsxRuntime.jsx("div",{className:p,style:{width:f,height:f},children:jsxRuntime.jsx(F,{...d,name:i,size:n,color:s,weight:c,className:a,ariaLabel:l})})});Gt.displayName="IconWithContainer";function se(){let[e,o]=ce__namespace.default.useState(false),t=ce__namespace.default.useCallback((n,a)=>{o(true),a?.(n);},[]),r=ce__namespace.default.useCallback((n,a)=>{o(false),a?.(n);},[]);return {isFocused:e,handleFocus:t,handleBlur:r}}function Y({children:e,className:o}){return jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("relative w-full",o),children:e})}function Mt({onClick:e,size:o="md",className:t}){return jsxRuntime.jsx("button",{type:"button",onClick:r=>{r.preventDefault(),r.stopPropagation(),e();},className:tailwindMerge.twMerge("absolute right-2 top-1/2 -translate-y-1/2 transform text-text-muted hover:text-text-body",t),"aria-label":"Clear input",onMouseDown:r=>{r.preventDefault(),r.stopPropagation();},children:jsxRuntime.jsx(F,{name:"X",size:o==="sm"?16:20})})}function ve(e){let{isInvalid:o,isDisabled:t,isFocused:r}=e,n="border rounded-[var(--control-border-radius)] !outline-none ";return t?`${n} border-border-muted`:o&&r?`${n} border-feedback-error-border shadow-[inset_0_0_0_1px_var(--color-feedback-error-border)]`:o?`${n} border-feedback-error-border`:r?`${n} border-border-focus shadow-[inset_0_0_0_1px_var(--color-border-focus)]`:`${n} border-border-input`}function Ot(e){return e.isDisabled?"bg-background-muted":e.transparent?"bg-transparent":"bg-background-input"}function _(e){let{isInvalid:o,isDisabled:t,isFocused:r,transparent:n,size:a="md",className:i}=e;return tailwindMerge.twMerge("w-full",ve({isInvalid:o,isDisabled:t,isFocused:r}),Ot({transparent:n,isDisabled:t}),k[a].text,k[a].height,k[a].padding,i)}function qt(e){let{size:o="md",isFocusWithin:t,isInvalid:r,isDisabled:n,transparent:a,className:i}=e;return tailwindMerge.twMerge("group flex items-center rounded-[var(--control-border-radius)] overflow-hidden",Ot({transparent:a,isDisabled:n}),k[o].height,ve({isFocused:t,isInvalid:r,isDisabled:n}),i)}function A({children:e,size:o="md",tooltip:t,isRequired:r,className:n,htmlFor:a}){return jsxRuntime.jsxs("label",{htmlFor:a,className:tailwindMerge.twMerge(k[o].text,"!text-text-label font-semibold flex items-center gap-1",n),children:[e,r&&jsxRuntime.jsx("span",{children:"*"}),t&&jsxRuntime.jsx("span",{className:"text-text-muted",children:jsxRuntime.jsx(F,{name:"Info",size:o==="sm"?16:20})})]})}function C({size:e="md",className:o,children:t,...r}){return jsxRuntime.jsx("div",{...r,className:tailwindMerge.twMerge("leading-[2.25] text-text-caption",k[e].text,o),children:t})}function m({children:e,size:o="md",className:t}){return jsxRuntime.jsx("div",{role:"alert",className:tailwindMerge.twMerge(k[o].text,"text-feedback-error-text",t),children:e})}function Be({size:e="md",isInvalid:o,isDisabled:t,isFocused:r,transparent:n,className:a,...i}){return jsxRuntime.jsx("input",{className:_({isInvalid:o,isDisabled:t,isFocused:r,transparent:n,size:e,className:a}),...i})}var ur="flex font-medium justify-center items-center gap-2 text-center transition rounded-[var(--control-border-radius)] whitespace-nowrap box-border",mr={default:"bg-action-default text-[color:var(--color-action-default-text)] hover:bg-action-default-hover forced-colors:bg-[ButtonText] forced-colors:text-[ButtonFace] border-2 border-transparent",brand:"bg-action-brand text-[color:var(--color-action-brand-text)] hover:bg-action-brand-hover forced-colors:bg-[ButtonText] forced-colors:text-[ButtonFace] border-2 border-transparent",secondary:"bg-transparent text-text-body border-2 border-border-muted hover:bg-text-body/5 forced-colors:border-[ButtonBorder] forced-colors:bg-[ButtonFace] forced-colors:text-[ButtonText]",ghost:"border-none text-text-body hover:bg-text-body/5 forced-colors:text-[ButtonText] forced-colors:hover:bg-[ButtonFace]",destructive:"bg-transparent text-feedback-error-text border-2 border-border-muted hover:bg-feedback-error-background/50 forced-colors:border-[ButtonBorder] forced-colors:bg-[ButtonFace] forced-colors:text-[Mark]",link:"!text-action-brand hover:text-action-brand/90 hover:underline hover:decoration-2 hover:underline-offset-4",icon:"border-none text-text-body hover:bg-background-hover hover:text-text-heading forced-colors:text-[ButtonText] forced-colors:hover:bg-[ButtonFace] p-1 flex-shrink-0 rounded-[var(--control-border-radius)]",unstyled:"bg-transparent"},Kt={full:"w-full",default:"w-fit"},pr="opacity-50 cursor-not-allowed pointer-events-none",fr="opacity-100 cursor-pointer",br={"top-right":"-right-2 -top-2","top-left":"-left-2 -top-2","bottom-right":"-right-2 -bottom-2","bottom-left":"-left-2 -bottom-2"},xr={primary:"bg-action-brand text-white",destructive:"bg-action-destructive text-white"};function gr(e){return e?e==="primary"?"brand":e:"default"}function hr(e){let{variant:o="default",size:t="md",isDisabled:r,fullWidth:n=false,isLoading:a=false}=e,i=gr(o),s=i==="unstyled"?"":`${ur} ${mr[i]}`;i!=="unstyled"&&(s+=` ${k[t].text} ${k[t].height} ${k[t].padding} ${k[t].gap}`),r||a?s+=` ${pr}`:s+=` ${fr}`,n?s+=` ${Kt.full}`:s+=` ${Kt.default}`;let c=i==="brand"?"focus-visible:outline-action-brand":void 0;return [s,ue(),c].filter(Boolean).join(" ")}function w(e){let{icon:o,children:t,isLoading:r=false,loadingText:n,loadingIndicator:a,size:i="md",iconPosition:s="left",iconWeight:c,href:l,className:u,badgeNumber:d,badgeVariant:x="primary",badgePosition:f="top-right",style:p,target:S,rel:P,...b}=e,h=o?jsxRuntime.jsx(F,{name:o,size:i,weight:c}):null,v=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[s==="left"&&h,typeof t=="function"?null:t,s==="right"&&h]}),E=jsxRuntime.jsxs("div",{className:"relative inline-flex items-center justify-center",children:[jsxRuntime.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:a||jsxRuntime.jsx(F,{name:"CircleNotch",size:i,className:"animate-spin","aria-hidden":"true"})}),jsxRuntime.jsx("div",{className:"invisible","aria-hidden":"true",children:v}),n&&jsxRuntime.jsx("span",{className:"sr-only",role:"status","aria-live":"polite",children:n})]}),N=(d??0)>0,g=tailwindMerge.twMerge(hr(e),u),T=l?{href:l,target:S,rel:P,...b}:{};if(l){let{onPress:j,onPressStart:ae,onPressEnd:H,onPressChange:de,onPressUp:te,onAuxClick:q,onContextMenu:ge,onDoubleClick:$,...y}=b;Object.assign(T,y);}let Q=l?jsxRuntime.jsx(reactAriaComponents.Link,{...T,...r&&{"aria-busy":true},style:N?void 0:p,className:g,children:r?E:typeof t=="function"?(function(j){return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[s==="left"&&h,t(j),s==="right"&&h]})}):v}):jsxRuntime.jsx(reactAriaComponents.Button,{...b,...r&&{"aria-busy":true},style:N?void 0:p,className:g,children:r?E:typeof t=="function"?(function(j){return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[s==="left"&&h,t(j),s==="right"&&h]})}):v});return N?jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("relative flex",u),style:p,children:[Q,jsxRuntime.jsx("span",{className:`absolute ${br[f]} flex h-5 w-5 items-center justify-center rounded-full ${xr[x]} text-xs font-medium`,"aria-label":`${d} items`,children:d})]}):Q}function tt({transparent:e=false,className:o,children:t,...r}){return jsxRuntime.jsx(reactAriaComponents.ModalOverlay,{...r,className:reactAriaComponents.composeRenderProps(o,(n,a)=>tailwindMerge.twMerge("fixed inset-0 z-50",e?"bg-transparent":["bg-gradient-to-br from-black/20 via-black/15 to-black/20","backdrop-blur-[2px]","supports-[backdrop-filter]:bg-black/15"].join(" "),a.isEntering&&["animate-in fade-in","duration-300 ease-out"].join(" "),a.isExiting&&["animate-out fade-out","duration-200 ease-in"].join(" "),n)),children:t})}function wr({isEntering:e,isExiting:o,className:t="",disableGroup:r=false}){let n=[!r&&"group","bg-background-surface","forced-colors:bg-[Canvas]","shadow-lg","rounded-[var(--control-border-radius)]","bg-clip-padding","border","border-border-default","outline-none"].filter(Boolean).join(" "),a=e?["animate-in","fade-in","placement-bottom:slide-in-from-top-1","placement-top:slide-in-from-bottom-1","placement-left:slide-in-from-right-1","placement-right:slide-in-from-left-1","ease-out","duration-200"].join(" "):"",i=o?["animate-out","fade-out","placement-bottom:slide-out-to-top-1","placement-top:slide-out-to-bottom-1","placement-left:slide-out-to-right-1","placement-right:slide-out-to-left-1","ease-in","duration-150"].join(" "):"";return [n,a,i,t].filter(Boolean).join(" ")}function Fe({children:e,showArrow:o=false,withBackdrop:t=false,className:r,isDismissable:n=true,disableGroup:a=false,...i}){let c=reactAriaComponents.useSlottedContext(reactAriaComponents.PopoverContext)?.trigger==="SubmenuTrigger",l=o?12:8;l=c?l-6:l;let u=jsxRuntime.jsxs(reactAriaComponents.Popover,{offset:l,...i,className:reactAriaComponents.composeRenderProps(r,(d,x)=>wr({...x,className:d,disableGroup:a})),children:[o&&jsxRuntime.jsx(reactAriaComponents.OverlayArrow,{children:jsxRuntime.jsx("svg",{width:12,height:12,viewBox:"0 0 12 12",className:"block fill-background-surface stroke-border-default stroke-1 group-placement-left:-rotate-90 group-placement-right:rotate-90 group-placement-bottom:rotate-180 forced-colors:fill-[Canvas] forced-colors:stroke-[ButtonBorder]",children:jsxRuntime.jsx("path",{d:"M0 0 L6 6 L12 0"})})}),e]});return t?jsxRuntime.jsx(tt,{isDismissable:n,children:jsxRuntime.jsx(reactAriaComponents.Modal,{isDismissable:n,children:u})}):u}var Jt=ce.createContext("md");function Zt(){return ce.useContext(Jt)}function Lr(e="md"){return `flex-1 text-start data-[placeholder]:text-text-placeholder overflow-hidden text-ellipsis whitespace-nowrap ${k[e].text}`}function Ar(){let e=ce__namespace.default.useCallback((t,r)=>{r?.(t);},[]),o=ce__namespace.default.useCallback((t,r)=>{r?.(t);},[]);return {handleFocus:e,handleBlur:o}}function ot({label:e,description:o,errorMessage:t,children:r,items:n,renderItem:a,size:i="md",selectedKey:s,defaultSelectedKey:c,onSelectionChange:l,placeholder:u,showErrors:d=false,tooltip:x,isRequired:f,transparent:p,reserveErrorSpace:S=false,placement:P="bottom start",shouldFlip:b=true,menuWidth:h="match",...v}){let[E,N]=ce.useState(null),[g,T]=ce.useState(null),Q=s??E??c,{handleFocus:j,handleBlur:ae}=Ar(),H=q=>{l&&q!==null&&l(q),l||N(q);},de=ce.useRef(null),te=ce.useRef(null);return jsxRuntime.jsx(reactAriaComponents.Select,{...v,selectedKey:Q,defaultSelectedKey:c,onSelectionChange:H,placeholder:u,className:L(v.className,"group flex w-full flex-col"),ref:de,onOpenChange:q=>{q&&te.current?T(te.current.offsetWidth):q||de.current?.blur();},children:({isDisabled:q,isInvalid:ge,isOpen:$})=>jsxRuntime.jsxs("div",{className:"flex flex-col",children:[e&&jsxRuntime.jsx(A,{size:i,tooltip:x,isRequired:f,children:e}),jsxRuntime.jsx(Y,{children:jsxRuntime.jsx("div",{ref:te,children:jsxRuntime.jsxs(w,{variant:"unstyled",className:tailwindMerge.twMerge(_({isInvalid:ge||d&&!!t,isDisabled:q,isFocused:$,transparent:p,size:i}),"flex items-center text-start gap-4 cursor-pointer pl-[var(--control-padding-sm)]"),onFocus:y=>j(y,v.onFocus),onBlur:y=>ae(y,v.onBlur),"data-open":$,children:[jsxRuntime.jsx(reactAriaComponents.SelectValue,{className:Lr(i)}),jsxRuntime.jsx(F,{name:"CaretDown","aria-hidden":true,className:tailwindMerge.twMerge("h-4 w-4 text-text-body group-disabled:text-gray-200 forced-colors:text-[ButtonText] transition-transform",$&&"rotate-180")})]})})}),S?jsxRuntime.jsx("div",{className:"mt-1 min-h-[20px]",children:d?jsxRuntime.jsx(m,{size:i,className:"text-feedback-error-text",children:typeof t=="function"&&v.validationResult?t(v.validationResult):typeof t=="string"?t:null}):o?jsxRuntime.jsx(C,{size:i,children:o}):null}):jsxRuntime.jsx(jsxRuntime.Fragment,{children:d?jsxRuntime.jsx(m,{size:i,className:"mt-1 text-feedback-error-text",children:typeof t=="function"&&v.validationResult?t(v.validationResult):typeof t=="string"?t:null}):o?jsxRuntime.jsx(C,{size:i,className:"mt-1",children:o}):null}),jsxRuntime.jsx(Fe,{className:"bg-background-input shadow-xl border border-border-input/20 backdrop-blur-sm rounded-[var(--control-border-radius)]",style:{width:h==="match"&&g?`${g}px`:void 0,minWidth:h==="auto"&&g?`${g}px`:void 0,maxWidth:h==="auto"?"min(600px, 90vw)":void 0},placement:P,shouldFlip:b,children:jsxRuntime.jsx(Jt.Provider,{value:i,children:jsxRuntime.jsx(reactAriaComponents.ListBox,{items:n,className:"w-full max-h-[300px] overflow-auto bg-background-input p-0 outline-0",children:a&&n?y=>jsxRuntime.jsx(ye,{id:y.id,textValue:y.label,size:i,children:jsxRuntime.jsx("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap min-w-0 flex-1",children:a(y)})},y.id):r})})})]})})}function ye({size:e,className:o,...t}){let r=Zt(),n=e??r;return jsxRuntime.jsx(reactAriaComponents.ListBoxItem,{...t,className:tailwindMerge.twMerge("flex cursor-default items-center gap-2 rounded-sm px-3 outline-none text-text-body data-[focused]:bg-background-hover data-[focus-visible]:ring-2 data-[focus-visible]:ring-action-default data-[focus-visible]:ring-inset data-[selected]:bg-background-selected data-[selected]:font-medium overflow-hidden",k[n].paddingY,k[n].text,o)})}var Yr={sm:"h-4 w-4",md:"h-5 w-5",lg:"h-6 w-6",xl:"h-7 w-7"},Xr={sm:"pl-7",md:"pl-9",lg:"pl-10",xl:"pl-12"},_t={sm:"py-1",md:"py-2",lg:"py-3",xl:"py-4"};function Jr(){let e=ce__namespace.default.useContext(reactAriaComponents.ComboBoxStateContext);return jsxRuntime.jsx(reactAriaComponents.Button,{slot:null,className:"clear-button","aria-label":"Clear",onPress:()=>e?.setSelectedKey(null),children:"\u2715"})}var it=(e,o,t)=>{if(e==null||e==="")return "";let n=(t?t.flatMap(a=>a.items):o||[]).find(a=>a.id===e);return n?n.name:""};async function Zr(e,o,t){try{let r=e.url.replace("{q}",o),n=new URLSearchParams;e.extraParams&&Object.entries(e.extraParams).forEach(([c,l])=>{n.append(c,l.toString());});let a=`${r}${n.toString()?"?"+n.toString():""}`,i=await fetch(a,{method:"GET",headers:e.headers,signal:t});if(!i.ok)throw new Error(`HTTP error! status: ${i.status}`);let s=await i.json();return {items:e.transformResponse(s)}}catch(r){console.error("Error in REST request:",r);let n=r instanceof Error?r.message:"Unknown error occurred";return {items:[],error:n}}}async function _r(e,o,t){try{let r=e.graphqlQuery.replace(`$${e.variableKey||"filter"}`,`"${o}"`),n=await fetch(e.url,{method:"POST",headers:{"Content-Type":"application/json",...e.headers},body:JSON.stringify({query:r}),signal:t});if(!n.ok)throw new Error(`HTTP error! status: ${n.status}`);let a=await n.json();if(a.errors)throw new Error(a.errors[0]?.message||"GraphQL error occurred");return e.responsePath&&(a=e.responsePath.split(".").reduce((i,s)=>i?.[s],a)),{items:e.transformResponse(a)}}catch(r){console.error("Error in GraphQL request:",r);let n=r instanceof Error?r.message:"Unknown error occurred";return {items:[],error:n}}}function lt({label:e,staticItems:o=[],sections:t,selectedKey:r,defaultSelectedKey:n,onSelectionChange:a,requestConfig:i,defaultFilter:s,placeholder:c,errorMessage:l,description:u,size:d="md",tooltip:x,isRequired:f,isDisabled:p,isInvalid:S,validationResult:P,showErrors:b=true,renderItem:h,renderLeftIcon:v,renderSection:E,autoFocus:N=false,reserveErrorSpace:g=false}){let T=ce__namespace.default.useRef(null),[Q,j]=ce__namespace.default.useState(),[ae,H]=ce.useState(()=>it(r||n,o,t)),[de,te]=ce.useState(false),q=At(ae),{contains:ge}=Ve({sensitivity:"base"}),[$,y]=ce.useState(),qe=k[d].text,Vt=k[d].height,ie=null;ce.useEffect(()=>{N&&te(true);},[N]),ce.useEffect(()=>{let M=()=>{T.current&&j(T.current.offsetWidth);};return M(),window.addEventListener("resize",M),()=>window.removeEventListener("resize",M)},[]),ce.useEffect(()=>{ie&&ie.setFilterText(q);},[q,ie]),i&&(ie=reactStately.useAsyncList({async load({signal:M,filterText:D=""}){if(!i.url||i.shouldLoad&&!i.shouldLoad(D))return {items:[]};try{let Z;return i.requestType==="GraphQL"?Z=await _r(i,D,M):Z=await Zr(i,D,M),y(Z.error),{items:Z.items}}catch(Z){return console.error("Error loading items:",Z),y(Z instanceof Error?Z.message:"Unknown error occurred"),{items:[]}}},initialFilterText:""})),q===""&&(ie=null);let Do=M=>{let D=it(M,o,t);H(D),a&&a(M);},Lo=M=>{H(M);let D=it(r,o,t);r!=null&&M!==D&&a&&a(null);};return jsxRuntime.jsx(reactAriaComponents.ComboBox,{onSelectionChange:Do,selectedKey:r||void 0,defaultSelectedKey:n||void 0,defaultItems:t?t.flatMap(M=>M.items):o,items:ie?ie.items:void 0,className:L("group flex flex-col","w-full"),menuTrigger:"focus",isDisabled:p,isInvalid:S||!!l,inputValue:ae,onInputChange:Lo,autoFocus:N,defaultFilter:s||ge,"aria-label":e||c||"Autocomplete",children:M=>jsxRuntime.jsxs("div",{className:"flex flex-col",children:[e&&jsxRuntime.jsx(A,{size:d,tooltip:x,isRequired:f,children:e}),jsxRuntime.jsxs(reactAriaComponents.Group,{ref:T,className:qt({size:d,isInvalid:S||!!l,isDisabled:p,isFocusWithin:de||M.isOpen,className:"w-full cursor-pointer"}),"aria-label":e||c||"Autocomplete",style:{position:"relative"},children:[v?jsxRuntime.jsx("div",{className:"absolute left-3",children:v(!!ie?.isLoading)}):jsxRuntime.jsx(F,{name:"MagnifyingGlass",className:`${Yr[d]} absolute left-3 text-inherit`}),jsxRuntime.jsx(reactAriaComponents.Input,{className:`flex-1 min-w-0 border-none pr-3 outline-0 placeholder:text-text-placeholder ${Xr[d]} ${qe} ${Vt} ${p?"bg-background-muted":"bg-background-input"}`,placeholder:c,disabled:p,onFocus:()=>te(true),onBlur:()=>te(false)}),ae&&!p&&jsxRuntime.jsx(Jr,{}),jsxRuntime.jsx(reactAriaComponents.Button,{className:`px-2 text-text-body ${qe} ${Vt} ${p?"bg-background-muted":"bg-background-input"}`,"aria-label":"Toggle menu",isDisabled:p,children:({isPressed:D})=>jsxRuntime.jsx(F,{name:D?"CaretUp":"CaretDown",className:"h-4 w-4"})})]}),g?jsxRuntime.jsx("div",{className:"mt-1 min-h-[20px]",children:b&&$?jsxRuntime.jsx(m,{size:d,className:"text-feedback-error-text",children:$}):b&&typeof l=="string"?jsxRuntime.jsx(m,{size:d,className:"text-feedback-error-text",children:l}):b&&typeof l=="function"&&P?jsxRuntime.jsx(m,{size:d,className:"text-feedback-error-text",children:l(P)}):u?jsxRuntime.jsx(C,{size:d,children:u}):null}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[u&&jsxRuntime.jsx(C,{size:d,className:"mt-1",children:u}),b&&$&&jsxRuntime.jsx(m,{size:d,className:"text-feedback-error-text mt-1",children:$}),b&&typeof l=="string"&&jsxRuntime.jsx(m,{size:d,className:"text-feedback-error-text mt-1",children:l}),b&&typeof l=="function"&&P&&jsxRuntime.jsx(m,{size:d,className:"text-feedback-error-text mt-1",children:l(P)})]}),jsxRuntime.jsx(Fe,{className:"bg-background-input shadow-xl border border-border-input/20 backdrop-blur-sm ring-1 ring-black/5 rounded-[var(--control-border-radius)]",style:{minWidth:Q?`${Q}px`:void 0},children:jsxRuntime.jsx(reactAriaComponents.ListBox,{className:`max-h-[300px] overflow-auto bg-background-input outline-none ${qe}`,children:t?t.map(D=>{let Z=D.items.map(oe=>jsxRuntime.jsx(ye,{id:oe.id,textValue:oe.name,size:d,className:`flex cursor-default items-center gap-2 px-3 ${_t[d]} text-text-body outline-none data-[focused]:bg-background-hover data-[selected]:bg-background-selected data-[selected]:font-medium`,children:h?h(oe):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[oe.name,jsxRuntime.jsx(F,{name:"X",className:"ml-auto h-4 w-4 text-text-muted opacity-0 data-[focused]:opacity-100 data-[selected]:opacity-100"})]})},oe.id));if(E){let oe=E(D,Z);return ce__namespace.default.isValidElement(oe)&&oe.type===reactAriaComponents.ListBoxSection?oe:jsxRuntime.jsx(reactAriaComponents.ListBoxSection,{children:oe},D.name)}return jsxRuntime.jsxs(reactAriaComponents.ListBoxSection,{children:[jsxRuntime.jsx(reactAriaComponents.Header,{className:"px-3 py-1 text-sm font-bold text-text-muted",children:D.name}),Z]},D.name)}):D=>jsxRuntime.jsx(ye,{id:D.id,textValue:D.name,size:d,className:`flex cursor-default items-center gap-2 px-3 ${_t[d]} text-text-body outline-none data-[focused]:bg-background-hover data-[selected]:bg-background-selected data-[selected]:font-medium`,children:h?h(D):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[D.name,jsxRuntime.jsx(F,{name:"X",className:"ml-auto h-4 w-4 text-text-muted opacity-0 data-[focused]:opacity-100 data-[selected]:opacity-100"})]})},D.id)})})]})})}function V(e,o){let t=o.split("."),r=e;for(let a of t)if(r&&typeof r=="object"&&a in r)r=r[a];else {r=void 0;break}let n=r?.message;return typeof n=="string"?n:void 0}function Pl({name:e,defaultValue:o,...t}){let{control:r,formState:n}=reactHookForm.useFormContext(),a=V(n.errors,e);return jsxRuntime.jsx(reactHookForm.Controller,{control:r,name:e,defaultValue:o,render:({field:i})=>jsxRuntime.jsx(lt,{...t,selectedKey:i.value??null,onSelectionChange:s=>i.onChange(s),showErrors:!!a,errorMessage:a})})}function ro(e){return jsxRuntime.jsxs(reactAriaComponents.CheckboxGroup,{...e,className:L(e.className,"flex flex-col gap-2"),children:[jsxRuntime.jsx(A,{children:e.label}),e.children,e.description&&jsxRuntime.jsx(C,{children:e.description}),jsxRuntime.jsx(m,{children:typeof e.errorMessage=="function"?void 0:e.errorMessage})]})}function sa({isDisabled:e}){return `flex gap-2 items-center group text-sm transition ${e?"text-text-disabled":"text-text-caption"}`}function la({isSelected:e,isInvalid:o,isDisabled:t,isIndeterminate:r,variant:n="default"}){let a="w-5 h-5 flex-shrink-0 rounded-[var(--control-border-radius)] flex items-center justify-center border-2 transition ring-offset-2 focus:ring-2",i=n==="brand"?"focus:ring-action-brand":"focus:ring-action-default",s="";if(t)s="border-border-muted bg-background-muted";else if(o)s="border-feedback-error-border bg-feedback-error-background";else if(e||r){let c=n==="brand"?"action-brand":"action-default";s=`bg-${c} border-${c} hover:bg-${c}-hover hover:border-${c}-hover`;}else s="bg-background-input border-border-input hover:border-border-focus";return `${a} ${i} ${s}`}var oo="w-4 h-4 text-text-onPrimary group-disabled:text-text-disabled";function ao(e){let{children:o,variant:t="default",...r}=e;return jsxRuntime.jsx(reactAriaComponents.Checkbox,{...r,className:reactAriaComponents.composeRenderProps(e.className,(n,a)=>`${sa(a)} ${n||""}`),children:n=>{let{isSelected:a,isIndeterminate:i,...s}=n,c=jsxRuntime.jsx("div",{className:la({isSelected:a,isIndeterminate:i,variant:t,...s}),children:i?jsxRuntime.jsx(lucideReact.Minus,{"aria-hidden":true,className:oo}):a?jsxRuntime.jsx(lucideReact.Check,{"aria-hidden":true,className:oo}):null});return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[c,typeof o=="function"?o(n):o]})}})}function Hl({name:e,defaultValue:o,errorBelow:t=false,...r}){let{control:n,formState:a}=reactHookForm.useFormContext(),i=V(a.errors,e);return jsxRuntime.jsx(reactHookForm.Controller,{control:n,name:e,defaultValue:o,render:({field:s})=>jsxRuntime.jsxs("div",{className:"flex flex-col gap-1",children:[jsxRuntime.jsx(ao,{...r,isSelected:!!s.value,onChange:c=>s.onChange(c),"aria-invalid":!!i,children:r.children}),t&&i&&jsxRuntime.jsx(m,{children:i})]})})}function Kl({name:e,defaultValue:o,...t}){let{control:r,formState:n}=reactHookForm.useFormContext(),a=V(n.errors,e);return jsxRuntime.jsx(reactHookForm.Controller,{control:r,name:e,defaultValue:o,render:({field:i})=>jsxRuntime.jsx(ro,{...t,value:i.value||[],onChange:s=>i.onChange(s),errorMessage:a,children:t.children})})}function Ce(e){if(!e)return false;let o=e.startsWith("#")?e.slice(1):e;return /^[0-9A-Fa-f]{3}$|^[0-9A-Fa-f]{6}$/.test(o)}function ut(e){if(!e)return "";let o=e.startsWith("#")?e.slice(1):e;return o.length===3&&(o=o.split("").map(t=>t+t).join("")),`#${o.toUpperCase()}`}function lo({label:e,description:o,errorMessage:t,size:r="md",tooltip:n,isRequired:a,transparent:i,className:s,validationResult:c,value:l,defaultValue:u,onChange:d,placeholder:x="#000000",showColorSwatch:f=true,reserveErrorSpace:p=true,...S}){let[P,b]=ce.useState(u||""),[h,v]=ce.useState(l||u||""),[E,N]=ce.useState(false),[g,T]=ce.useState(null),{isFocused:Q,handleFocus:j,handleBlur:ae}=se(),H=l!==void 0?l:P;ce.useEffect(()=>{l!==void 0&&v(l);},[l]);let de=H?!Ce(H):false,te=ce.useCallback($=>{if(v($),Ce($)){let y=ut($);d?d(y):b(y);}else $===""&&(d?d(""):b(""));},[d]),q=ce.useCallback($=>{let y=ut($);v(y),d?d(y):b(y);},[d]),ge=ce.useCallback($=>{if(Ce(h)){let y=ut(h);v(y),d&&y!==H?d(y):!d&&y!==P&&b(y);}ae($,S.onBlur);},[h,H,P,d,ae,S.onBlur]);return jsxRuntime.jsx(reactAriaComponents.TextField,{...S,isRequired:a,className:L(s,"group flex flex-col"),children:({isDisabled:$})=>jsxRuntime.jsxs("div",{className:"flex flex-col",children:[e&&jsxRuntime.jsx(A,{size:r,tooltip:n,isRequired:a,children:e}),jsxRuntime.jsx(Y,{children:jsxRuntime.jsxs("div",{className:"flex gap-2",children:[jsxRuntime.jsxs("div",{className:"flex-1 relative",children:[jsxRuntime.jsx(Be,{size:r,disabled:$,type:"text",value:h,placeholder:x,onFocus:y=>j(y,S.onFocus),onBlur:ge,onChange:y=>te(y.target.value),className:tailwindMerge.twMerge(_({isInvalid:de,isDisabled:$,isFocused:Q,size:r,transparent:i}),f?"pr-12":"pr-3","pl-3")}),f&&jsxRuntime.jsx("div",{className:"absolute right-3 top-1/2 -translate-y-1/2 pointer-events-none",style:{width:k[r].height},children:jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("w-6 h-6 rounded border shadow-sm",Ce(H)?"border-border-default":"border-border-default bg-background-muted"),style:Ce(H)?{backgroundColor:H}:void 0,"aria-hidden":"true",children:!Ce(H)&&jsxRuntime.jsx("div",{className:"w-full h-full flex items-center justify-center",children:jsxRuntime.jsx("div",{className:"w-3 h-3 rounded-full border-2 border-border-muted"})})})})]}),jsxRuntime.jsx("div",{ref:T,children:jsxRuntime.jsx(w,{variant:"secondary",size:r,icon:"Palette",onPress:()=>N(!E),isDisabled:$,className:"flex-shrink-0",children:"Pick"})})]})}),p?jsxRuntime.jsx("div",{className:"mt-1 min-h-[20px]",children:typeof t=="string"?jsxRuntime.jsx(m,{size:r,children:t}):typeof t=="function"&&c?jsxRuntime.jsx(m,{size:r,children:t(c)}):o?jsxRuntime.jsx(C,{size:r,children:o}):null}):jsxRuntime.jsx(jsxRuntime.Fragment,{children:typeof t=="string"?jsxRuntime.jsx(m,{size:r,className:"mt-1",children:t}):typeof t=="function"&&c?jsxRuntime.jsx(m,{size:r,className:"mt-1",children:t(c)}):o?jsxRuntime.jsx(C,{size:r,className:"mt-1",children:o}):null}),E&&g&&jsxRuntime.jsx(Fe,{triggerRef:{current:g},isOpen:E,onOpenChange:N,placement:"bottom end",className:"bg-background-input shadow-xl border border-border-input/20 backdrop-blur-sm rounded-lg p-4",children:jsxRuntime.jsxs("div",{className:"flex flex-col gap-4",children:[jsxRuntime.jsx(reactColorful.HexColorPicker,{color:H||"#000000",onChange:q,style:{width:"200px",height:"200px"}}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("div",{className:"w-10 h-10 rounded border border-border-default shadow-sm flex-shrink-0",style:{backgroundColor:H||"#000000"}}),jsxRuntime.jsx("div",{className:"flex-1 text-text-body text-[length:var(--control-text-sm)] font-mono",children:H||"#000000"})]})]})})]})})}function dd({name:e,defaultValue:o,...t}){let{control:r,formState:n}=reactHookForm.useFormContext(),a=V(n.errors,e);return jsxRuntime.jsx(reactHookForm.Controller,{control:r,name:e,defaultValue:o,render:({field:i})=>jsxRuntime.jsx(lo,{...t,value:i.value??"",onChange:s=>i.onChange(s),isInvalid:!!a,errorMessage:a})})}function Ia({isSelected:e,isDisabled:o}){let t=[ue,"w-9 h-9 text-sm cursor-default rounded-sm flex items-center justify-center forced-color-adjust-none font-semibold"];return o?t.push("text-text-disabled forced-colors:text-[GrayText]"):e?t.push("bg-action-default text-text-onPrimary invalid:bg-feedback-error-border forced-colors:bg-[Highlight] forced-colors:invalid:bg-[Mark] forced-colors:text-[HighlightText]"):t.push("text-text-body hover:bg-background-hover pressed:bg-background-selected"),t.join(" ")}function pt({errorMessage:e,...o}){return jsxRuntime.jsxs(reactAriaComponents.Calendar,{...o,children:[jsxRuntime.jsx(uo,{}),jsxRuntime.jsxs(reactAriaComponents.CalendarGrid,{className:"border-separate [border-spacing:0] [&_td]:p-0 [&_td]:!border-0",children:[jsxRuntime.jsx(mo,{}),jsxRuntime.jsx(reactAriaComponents.CalendarGridBody,{children:t=>jsxRuntime.jsx(reactAriaComponents.CalendarCell,{date:t,className:({isSelected:r,isDisabled:n})=>`${Ia({isSelected:r,isDisabled:n})} border-0`})})]}),e&&jsxRuntime.jsx(reactAriaComponents.Text,{slot:"errorMessage",className:"text-sm text-red-600",children:e})]})}function uo(){let{direction:e}=reactAriaComponents.useLocale(),o=18;return jsxRuntime.jsxs("header",{className:"flex w-full items-center gap-1 px-1 pb-4",children:[jsxRuntime.jsx(w,{variant:"icon",slot:"previous",className:"pl-0",children:e==="rtl"?jsxRuntime.jsx(F,{name:"CaretRight","aria-hidden":true,size:o}):jsxRuntime.jsx(F,{name:"CaretLeft","aria-hidden":true,size:o})}),jsxRuntime.jsx(reactAriaComponents.Heading,{className:"text-md mx-2 flex-1 text-center font-semibold text-zinc-900 dark:text-zinc-200"}),jsxRuntime.jsx(w,{variant:"icon",slot:"next",className:"pr-0",children:e==="rtl"?jsxRuntime.jsx(F,{name:"CaretLeft","aria-hidden":true,size:o}):jsxRuntime.jsx(F,{name:"CaretRight","aria-hidden":true,size:o})})]})}function mo(){return jsxRuntime.jsx(reactAriaComponents.CalendarGridHeader,{children:e=>jsxRuntime.jsx(reactAriaComponents.CalendarHeaderCell,{className:"text-xs font-semibold text-text-caption",children:e})})}function bt({label:e,description:o,errorMessage:t,size:r="md",tooltip:n,isRequired:a,isDisabled:i,isInvalid:s,showCalendar:c=true,reserveErrorSpace:l=true,validationResult:u,className:d,...x}){let[f,p]=ce.useState(false),S=P=>{x.onChange&&P&&x.onChange(P),p(false);};return jsxRuntime.jsxs(reactAriaComponents.DateField,{...x,isDisabled:i,isRequired:a,isInvalid:s,className:L(d,"flex flex-col gap-1"),children:[e&&jsxRuntime.jsx(A,{size:r,tooltip:n,isRequired:a,children:e}),jsxRuntime.jsx(Y,{children:jsxRuntime.jsxs("div",{className:"relative w-full",children:[jsxRuntime.jsx(fo,{size:r,isDisabled:i,isInvalid:s,hasCalendar:c}),c&&!i&&jsxRuntime.jsxs(reactAriaComponents.DialogTrigger,{isOpen:f,onOpenChange:p,children:[jsxRuntime.jsx(w,{variant:"unstyled",className:"absolute right-2 top-1/2 -translate-y-1/2 flex h-8 w-8 items-center justify-center rounded hover:bg-background-hover text-text-muted hover:text-text-body transition-colors","aria-label":"Open calendar",children:jsxRuntime.jsx(F,{name:"Calendar",size:18})}),jsxRuntime.jsx(reactAriaComponents.Popover,{className:"bg-background-surface rounded-lg border border-border-default shadow-xl",children:jsxRuntime.jsx(reactAriaComponents.Dialog,{className:"p-4 outline-none",children:jsxRuntime.jsx(pt,{value:x.value,onChange:S,minValue:x.minValue,maxValue:x.maxValue,isDisabled:i,isReadOnly:x.isReadOnly,isDateUnavailable:x.isDateUnavailable})})})]})]})}),l?jsxRuntime.jsx("div",{className:"mt-1 min-h-[20px]",children:typeof t=="string"?jsxRuntime.jsx(m,{size:r,children:t}):typeof t=="function"&&u?jsxRuntime.jsx(m,{size:r,children:t(u)}):o?jsxRuntime.jsx(C,{size:r,children:o}):null}):jsxRuntime.jsx(jsxRuntime.Fragment,{children:typeof t=="string"?jsxRuntime.jsx(m,{size:r,className:"mt-1",children:t}):typeof t=="function"&&u?jsxRuntime.jsx(m,{size:r,className:"mt-1",children:t(u)}):o?jsxRuntime.jsx(C,{size:r,className:"mt-1",children:o}):null})]})}function za({isPlaceholder:e,isDisabled:o,size:t="md"}){return tailwindMerge.twMerge("inline-block box-content px-0.5 rounded outline-none tabular-nums text-center transition-colors",{sm:"text-xs",md:"text-sm",lg:"text-base",xl:"text-lg"}[t],e?"text-text-placeholder italic":"text-text-body",o?"text-text-disabled cursor-not-allowed":"cursor-text",!o&&"hover:bg-background-hover","data-[focused]:bg-background-selected data-[focused]:text-text-body")}function fo({size:e="md",isDisabled:o,isInvalid:t,hasCalendar:r,className:n,...a}){return jsxRuntime.jsx(reactAriaComponents.DateInput,{className:tailwindMerge.twMerge(ve({isInvalid:t,isDisabled:o}),"px-3 py-2 flex items-center gap-0.5 w-full",r&&"pr-10",n),...a,children:i=>jsxRuntime.jsx(reactAriaComponents.DateSegment,{segment:i,className:za({isPlaceholder:i.isPlaceholder,isDisabled:!i.isEditable||o,size:e})})})}function Od({name:e,defaultValue:o,...t}){let{control:r,formState:n}=reactHookForm.useFormContext(),a=V(n.errors,e);return jsxRuntime.jsx(reactHookForm.Controller,{control:r,name:e,defaultValue:o,render:({field:i})=>jsxRuntime.jsx(bt,{...t,value:i.value??null,onChange:s=>i.onChange(s),isInvalid:!!a,errorMessage:a})})}function xt({value:e,onChange:o,onUrlChange:t,accept:r="image/*",maxSize:n,isDisabled:a=false,onUpload:i,className:s,showPreview:c=true,placeholder:l="Drop files here or click to browse"}){let[u,d]=ce.useState(false),[x,f]=ce.useState(false),[p,S]=ce.useState(null),[P,b]=ce.useState(e),h=ce.useRef(null),v=async g=>{if(S(null),n&&g.size>n){S(`File size must be less than ${(n/1024/1024).toFixed(2)}MB`);return}if(c&&g.type.startsWith("image/")){let T=new FileReader;T.onloadend=()=>{b(T.result);},T.readAsDataURL(g);}if(i){f(true);try{let T=await i(g);b(T),t?.(T);}catch(T){S("Failed to upload file"),console.error("Upload error:",T);}finally{f(false);}}o?.(g,P);},E=g=>{let T=g.items;if(T.length>0){let Q=T[0];if(Q.kind==="file"){let j=Q.getAsFile();j&&v(j);}}d(false);},N=()=>{b(void 0),S(null),o?.(null),t?.(""),h.current&&(h.current.value="");};return jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("w-full",s),children:[jsxRuntime.jsxs(reactAriaComponents.DropZone,{className:tailwindMerge.twMerge("relative flex min-h-[200px] w-full flex-col items-center justify-center rounded-lg border-2 border-dashed transition-colors",u?"border-action-brand bg-action-brand/5":"border-border-muted hover:border-border-default",a&&"pointer-events-none opacity-50",p&&"border-feedback-error-border bg-feedback-error-background/50"),onDrop:E,onDropEnter:()=>d(true),onDropExit:()=>d(false),children:[P?jsxRuntime.jsxs("div",{className:"relative flex h-full w-full items-center justify-center p-4",children:[c&&P.startsWith("data:image")?jsxRuntime.jsx("img",{src:P,alt:"Preview",className:"max-h-48 max-w-full rounded-md object-contain"}):jsxRuntime.jsxs("div",{className:"flex flex-col items-center gap-2",children:[jsxRuntime.jsx(lucideReact.Image,{className:"h-12 w-12 text-text-muted"}),jsxRuntime.jsx("span",{className:"text-sm text-text-muted",children:"File uploaded"})]}),!a&&jsxRuntime.jsx(w,{variant:"icon",size:"sm",onPress:N,className:"absolute right-2 top-2 bg-background-surface shadow-md",children:jsxRuntime.jsx(lucideReact.X,{className:"h-4 w-4"})})]}):jsxRuntime.jsxs("div",{className:"flex flex-col items-center gap-4 p-6",children:[jsxRuntime.jsx(lucideReact.Upload,{className:"h-12 w-12 text-text-muted"}),jsxRuntime.jsxs("div",{className:"text-center",children:[jsxRuntime.jsx("p",{className:"text-sm text-text-body",children:l}),jsxRuntime.jsx("p",{className:"mt-1 text-xs text-text-muted",children:r==="image/*"?"PNG, JPG, GIF up to 10MB":`Accepts ${r}`})]}),jsxRuntime.jsx(reactAriaComponents.FileTrigger,{acceptedFileTypes:r.split(","),onSelect:g=>{let T=Array.from(g||[]);T.length>0&&v(T[0]);},children:jsxRuntime.jsx(w,{variant:"secondary",size:"sm",isDisabled:a,children:"Choose File"})})]}),x&&jsxRuntime.jsx("div",{className:"absolute inset-0 flex items-center justify-center rounded-lg bg-background-surface/80",children:jsxRuntime.jsxs("div",{className:"flex flex-col items-center gap-2",children:[jsxRuntime.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-2 border-action-brand border-t-transparent"}),jsxRuntime.jsx("span",{className:"text-sm text-text-muted",children:"Uploading..."})]})})]}),p&&jsxRuntime.jsx("p",{className:"mt-2 text-sm text-feedback-error-text",children:p})]})}function ac({name:e,defaultValue:o,errorBelow:t=true,...r}){let{control:n,formState:a}=reactHookForm.useFormContext(),i=V(a.errors,e);return jsxRuntime.jsx(reactHookForm.Controller,{control:n,name:e,defaultValue:o,render:({field:s})=>jsxRuntime.jsxs("div",{className:"flex flex-col gap-1",children:[jsxRuntime.jsx(xt,{...r,value:s.value??"",onChange:(c,l)=>s.onChange(l||"")}),t&&i&&jsxRuntime.jsx(m,{children:i})]})})}var on=e=>{let o=_({isInvalid:e.isInvalid,isDisabled:e.isDisabled,isFocused:e.isFocused,transparent:e.transparent,size:e.size});return tailwindMerge.twMerge(o,"pr-9","[appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none",e.className)};function vt({label:e,description:o,errorMessage:t,size:r="md",tooltip:n,isRequired:a,transparent:i,validationResult:s,reserveErrorSpace:c=true,...l}){let u=ce.useId(),{isFocused:d,handleFocus:x,handleBlur:f}=se();return jsxRuntime.jsx(reactAriaComponents.NumberField,{...l,id:u,isRequired:a,className:L(l.className,"group flex flex-col gap-1"),step:l.step??1,onChange:p=>{typeof p=="number"&&(l.maxValue!=null&&p>l.maxValue?l.onChange?.(l.maxValue):l.minValue!=null&&p<l.minValue?l.onChange?.(l.minValue):l.onChange?.(p));},isInvalid:!!t||typeof l.value=="number"&&(l.maxValue!=null&&l.value>l.maxValue||l.minValue!=null&&l.value<l.minValue),children:({isDisabled:p,isInvalid:S})=>jsxRuntime.jsxs("div",{className:"flex flex-col",children:[e&&jsxRuntime.jsx(A,{size:r,tooltip:n,isRequired:a,htmlFor:u,children:e}),jsxRuntime.jsx("div",{className:"relative",children:jsxRuntime.jsxs(reactAriaComponents.Group,{className:"relative",children:[jsxRuntime.jsx(reactAriaComponents.Input,{onFocus:b=>x(b,l.onFocus),onBlur:b=>f(b,l.onBlur),className:on({isInvalid:S||!!t,isDisabled:p,isFocused:d,transparent:i,size:r,className:typeof l.className=="string"?l.className:void 0})}),jsxRuntime.jsxs("div",{className:"absolute inset-y-[2px] right-[2px] flex flex-col divide-y divide-border-default border-l border-border-default overflow-hidden rounded-r-[calc(var(--control-border-radius)-2px)]",children:[jsxRuntime.jsx(reactAriaComponents.Button,{slot:"increment",isDisabled:p,className:"flex h-1/2 w-7 items-center justify-center bg-background-input hover:bg-background-input-hover active:bg-background-input-active disabled:cursor-not-allowed disabled:opacity-50",children:jsxRuntime.jsx(F,{name:"CaretUp",size:14})}),jsxRuntime.jsx(reactAriaComponents.Button,{slot:"decrement",isDisabled:p,className:"flex h-1/2 w-7 items-center justify-center bg-background-input hover:bg-background-input-hover active:bg-background-input-active disabled:cursor-not-allowed disabled:opacity-50",children:jsxRuntime.jsx(F,{name:"CaretDown",size:14})})]})]})}),c?jsxRuntime.jsx("div",{className:"mt-1 min-h-[20px]",children:t?jsxRuntime.jsx(m,{size:r,children:typeof t=="function"?t(s):t}):o?jsxRuntime.jsx(C,{size:r,children:o}):null}):jsxRuntime.jsx(jsxRuntime.Fragment,{children:t?jsxRuntime.jsx(m,{size:r,className:"mt-1",children:typeof t=="function"?t(s):t}):o?jsxRuntime.jsx(C,{size:r,className:"mt-1",children:o}):null})]})})}function Cc({name:e,defaultValue:o,...t}){let{control:r,formState:n}=reactHookForm.useFormContext(),a=V(n.errors,e);return jsxRuntime.jsx(reactHookForm.Controller,{control:r,name:e,defaultValue:o,render:({field:i})=>jsxRuntime.jsx(vt,{...t,value:typeof i.value=="number"?i.value:void 0,onChange:s=>i.onChange(s),isInvalid:!!a,errorMessage:a,isRequired:t.isRequired})})}var dn=ce.createContext({variant:"brand"});function yt(e){let{variant:o="default",...t}=e;return jsxRuntime.jsx(dn.Provider,{value:{variant:o},children:jsxRuntime.jsxs(reactAriaComponents.RadioGroup,{...t,className:L(e.className,"group flex flex-col gap-2"),children:[jsxRuntime.jsx(A,{children:e.label}),jsxRuntime.jsx("div",{className:"flex gap-2 group-orientation-horizontal:gap-4 group-orientation-vertical:flex-col",children:e.children}),e.description&&jsxRuntime.jsx(C,{children:e.description}),jsxRuntime.jsx(m,{children:typeof e.errorMessage=="function"&&e.validationResult?e.errorMessage(e.validationResult):typeof e.errorMessage=="string"?e.errorMessage:null})]})})}function Wc({name:e,defaultValue:o,...t}){let{control:r,formState:n}=reactHookForm.useFormContext(),a=V(n.errors,e);return jsxRuntime.jsx(reactHookForm.Controller,{control:r,name:e,defaultValue:o,render:({field:i})=>jsxRuntime.jsx(yt,{...t,value:i.value,onChange:s=>i.onChange(s),errorMessage:a,children:t.children})})}function _c({name:e,defaultValue:o,...t}){let{control:r,formState:n}=reactHookForm.useFormContext(),a=V(n.errors,e);return jsxRuntime.jsx(reactHookForm.Controller,{control:r,name:e,defaultValue:o,render:({field:i})=>jsxRuntime.jsx(ot,{...t,selectedKey:i.value??null,onSelectionChange:s=>i.onChange(s),showErrors:!!a,errorMessage:a})})}var Pt={sm:{track:"h-4 w-7",handle:"h-3.5 w-3.5",text:"text-xs"},md:{track:"h-5 w-9",handle:"h-4 w-4",text:"text-sm"},lg:{track:"h-6 w-11",handle:"h-5 w-5",text:"text-base"},xl:{track:"h-7 w-14",handle:"h-6 w-6",text:"text-lg"}};function xn({isSelected:e,isDisabled:o,variant:t="default",size:r="md"}){let n="flex px-px items-center shrink-0 cursor-default rounded-full transition duration-200 ease-in-out shadow-inner border border-transparent",a=Pt[r].track,i=ue,s=t==="brand"?"focus-visible:outline-action-brand":"focus-visible:outline-action-default",c="";return e?t==="brand"?c="bg-action-brand forced-colors:!bg-[Highlight] group-pressed:bg-action-brand-hover":c="bg-action-default forced-colors:!bg-[Highlight] group-pressed:bg-action-default-hover":c="bg-gray-400 dark:bg-zinc-400 group-pressed:bg-gray-500 dark:group-pressed:bg-zinc-300",[n,a,i,s,c,o?"bg-gray-200 dark:bg-zinc-700 forced-colors:group-selected:!bg-[GrayText] forced-colors:border-[GrayText]":""].filter(Boolean).join(" ")}function gn({isSelected:e,isDisabled:o,size:t="md"}){let r="transform rounded-full bg-white dark:bg-zinc-900 outline-none shadow transition duration-200 ease-in-out",n=Pt[t].handle;return [r,n,e?"translate-x-[100%]":"translate-x-0",o?"forced-colors:outline-[GrayText]":""].filter(Boolean).join(" ")}function Ct({children:e,variant:o="default",size:t="md",...r}){return jsxRuntime.jsx(reactAriaComponents.Switch,{...r,className:L(r.className,`group flex items-center gap-2 ${Pt[t].text} text-gray-800 transition disabled:text-gray-300 dark:text-zinc-200 dark:disabled:text-zinc-600 forced-colors:disabled:text-[GrayText]`),children:n=>jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:xn({...n,variant:o,size:t}),children:jsxRuntime.jsx("span",{className:gn({...n,size:t})})}),e]})})}function uu({name:e,defaultValue:o,...t}){let{control:r}=reactHookForm.useFormContext();return jsxRuntime.jsx(reactHookForm.Controller,{control:r,name:e,defaultValue:o,render:({field:n})=>jsxRuntime.jsx(Ct,{...t,isSelected:!!n.value,onChange:a=>n.onChange(a),children:t.children})})}var Cn=e=>{let o=_({isInvalid:e.isInvalid,isDisabled:e.isDisabled,isFocused:e.isFocused,transparent:e.transparent,size:e.size}),t=`min-h-[100px] py-2 ${e.isDisabled?"resize-none":e.isResizable?"resize-y":"resize-none"}`;return tailwindMerge.twMerge(o,t,e.className)};function St({label:e,description:o,errorMessage:t,size:r="md",tooltip:n,required:a,transparent:i,isInvalid:s,isDisabled:c,isResizable:l=false,className:u,validationResult:d,reserveErrorSpace:x=true,...f}){let{isFocused:p,handleFocus:S,handleBlur:P}=se();return jsxRuntime.jsx("div",{className:"group flex flex-col",children:jsxRuntime.jsxs("div",{className:"flex flex-col",children:[e&&jsxRuntime.jsx(A,{size:r,tooltip:n,isRequired:a,children:e}),jsxRuntime.jsx(Y,{children:jsxRuntime.jsx("textarea",{...f,required:a,onFocus:b=>{f.onFocus&&f.onFocus(b),S(b);},onBlur:b=>{f.onBlur&&f.onBlur(b),P(b);},className:Cn({isInvalid:s,isDisabled:c,isResizable:l,isFocused:p,size:r,transparent:i,className:u}),disabled:c})}),x?jsxRuntime.jsx("div",{className:"mt-1 min-h-[20px]",children:typeof t=="string"?jsxRuntime.jsx(m,{size:r,children:t}):typeof t=="function"&&d?jsxRuntime.jsx(m,{size:r,children:t(d)}):o?jsxRuntime.jsx(C,{size:r,children:o}):null}):jsxRuntime.jsx(jsxRuntime.Fragment,{children:typeof t=="string"?jsxRuntime.jsx(m,{size:r,className:"mt-1",children:t}):typeof t=="function"&&d?jsxRuntime.jsx(m,{size:r,className:"mt-1",children:t(d)}):o?jsxRuntime.jsx(C,{size:r,className:"mt-1",children:o}):null})]})})}function Su({name:e,defaultValue:o,...t}){let{control:r,formState:n}=reactHookForm.useFormContext(),a=V(n.errors,e);return jsxRuntime.jsx(reactHookForm.Controller,{control:r,name:e,defaultValue:o,render:({field:i})=>jsxRuntime.jsx(St,{...t,value:i.value??"",onChange:s=>i.onChange(s.target.value),onBlur:s=>{i.onBlur(),t.onBlur?.(s);},isInvalid:!!a,errorMessage:a,required:t.required})})}var $n=e=>{let o=_({isInvalid:e.isInvalid,isDisabled:e.isDisabled,isFocused:e.isFocused,transparent:e.transparent,size:e.size}),t=[e.showSearchIcon?"pl-8":"pl-3",e.isClearable&&e.hasValue||e.isPassword?"pr-8":"pr-3"].join(" ");return tailwindMerge.twMerge(o,t,e.className)};function Rt({label:e,description:o,errorMessage:t,size:r="md",tooltip:n,isRequired:a,transparent:i,showSearchIcon:s,isClearable:c,onClear:l,type:u,validationResult:d,reserveErrorSpace:x=true,...f}){let[p,S]=ce__namespace.default.useState(false),{isFocused:P,handleFocus:b,handleBlur:h}=se(),v=u==="password";return jsxRuntime.jsx(reactAriaComponents.TextField,{...f,isRequired:a,className:L(f.className,"group flex flex-col"),children:({isDisabled:E,isInvalid:N})=>jsxRuntime.jsxs("div",{className:"flex flex-col",children:[e&&jsxRuntime.jsx(A,{size:r,tooltip:n,isRequired:a,children:e}),jsxRuntime.jsxs(Y,{children:[s&&jsxRuntime.jsx("div",{className:"pointer-events-none absolute left-2 top-1/2 -translate-y-[calc(50%+1px)] transform",children:jsxRuntime.jsx(F,{name:"MagnifyingGlass",className:"h-4 w-4 text-text-muted"})}),jsxRuntime.jsx(Be,{size:r,disabled:E,type:v?p?"text":"password":u,value:f.value,defaultValue:f.defaultValue,placeholder:f.placeholder,onFocus:g=>b(g,f.onFocus),onBlur:g=>h(g,f.onBlur),onChange:g=>f.onChange?.(g.target.value),className:$n({isInvalid:N,isDisabled:E,isFocused:P,size:r,transparent:i,showSearchIcon:s,isClearable:c,hasValue:!!f.value,isPassword:v,className:typeof f.className=="string"?f.className:void 0})}),c&&f.value&&!E&&jsxRuntime.jsx(Mt,{onClick:()=>{l?l():f.onChange&&f.onChange("");},size:r}),v&&!E&&jsxRuntime.jsx("button",{type:"button",onClick:()=>S(!p),className:"absolute right-3 top-1/2 -translate-y-1/2 transform text-text-muted hover:text-text-body","aria-label":p?"Hide password":"Show password",onMouseDown:g=>{g.preventDefault(),g.stopPropagation();},children:jsxRuntime.jsx(F,{name:p?"EyeSlash":"Eye",size:r==="sm"?16:20,className:"text-text-body"})})]}),x?jsxRuntime.jsx("div",{className:"mt-1 min-h-[20px]",children:typeof t=="string"?jsxRuntime.jsx(m,{size:r,children:t}):typeof t=="function"&&d?jsxRuntime.jsx(m,{size:r,children:t(d)}):o?jsxRuntime.jsx(C,{size:r,children:o}):null}):jsxRuntime.jsx(jsxRuntime.Fragment,{children:typeof t=="string"?jsxRuntime.jsx(m,{size:r,className:"mt-1",children:t}):typeof t=="function"&&d?jsxRuntime.jsx(m,{size:r,className:"mt-1",children:t(d)}):o?jsxRuntime.jsx(C,{size:r,className:"mt-1",children:o}):null})]})})}function Mu({name:e,defaultValue:o,...t}){let{control:r,formState:n}=reactHookForm.useFormContext(),a=V(n.errors,e);return jsxRuntime.jsx(reactHookForm.Controller,{control:r,name:e,defaultValue:o,render:({field:i})=>jsxRuntime.jsx(Rt,{...t,value:i.value??"",onChange:s=>i.onChange(s),onBlur:s=>{i.onBlur(),t.onBlur?.(s);},isInvalid:!!a,errorMessage:a,isRequired:t.isRequired})})}function zn({isPlaceholder:e,isDisabled:o,size:t="md"}){return tailwindMerge.twMerge("inline-block box-content px-0.5 rounded outline-none tabular-nums text-center transition-colors",{sm:"text-xs",md:"text-sm",lg:"text-base",xl:"text-lg"}[t],e?"text-text-placeholder italic":"text-text-body",o?"text-text-disabled cursor-not-allowed":"cursor-text",!o&&"hover:bg-background-hover","data-[focused]:bg-background-selected data-[focused]:text-text-body")}function Nt({label:e,description:o,errorMessage:t,size:r="md",tooltip:n,isRequired:a,isDisabled:i,isInvalid:s,reserveErrorSpace:c=true,validationResult:l,className:u,...d}){return jsxRuntime.jsxs(reactAriaComponents.TimeField,{...d,isDisabled:i,isRequired:a,isInvalid:s,className:L(u,"flex flex-col gap-1"),children:[e&&jsxRuntime.jsx(A,{size:r,tooltip:n,isRequired:a,children:e}),jsxRuntime.jsx(Y,{children:jsxRuntime.jsx(reactAriaComponents.DateInput,{className:tailwindMerge.twMerge(ve({isInvalid:s,isDisabled:i}),"px-3 py-2 flex items-center gap-0.5 w-full"),children:x=>jsxRuntime.jsx(reactAriaComponents.DateSegment,{segment:x,className:zn({isPlaceholder:x.isPlaceholder,isDisabled:!x.isEditable||i,size:r})})})}),c?jsxRuntime.jsx("div",{className:"mt-1 min-h-[20px]",children:typeof t=="string"?jsxRuntime.jsx(m,{size:r,children:t}):typeof t=="function"&&l?jsxRuntime.jsx(m,{size:r,children:t(l)}):o?jsxRuntime.jsx(C,{size:r,children:o}):null}):jsxRuntime.jsx(jsxRuntime.Fragment,{children:typeof t=="string"?jsxRuntime.jsx(m,{size:r,className:"mt-1",children:t}):typeof t=="function"&&l?jsxRuntime.jsx(m,{size:r,className:"mt-1",children:t(l)}):o?jsxRuntime.jsx(C,{size:r,className:"mt-1",children:o}):null})]})}function sm({name:e,...o}){let{control:t,formState:{errors:r}}=reactHookForm.useFormContext(),n=r[e],a=n?.message;return jsxRuntime.jsx(reactHookForm.Controller,{name:e,control:t,render:({field:i})=>jsxRuntime.jsx(Nt,{...o,value:i.value,onChange:i.onChange,isInvalid:!!n,errorMessage:a})})}function mm({className:e,title:o="Please fix the following errors:",autoFocus:t=true}){let{formState:r}=reactHookForm.useFormContext(),n=ce__namespace.useRef(null),a=r.errors,i=Object.entries(a||{}),s=i.length>0;if(ce__namespace.useEffect(()=>{t&&s&&n.current?.focus();},[t,s]),!s)return null;let c=l=>{let u=`[name="${CSS.escape(l)}"]`,d=document.querySelector(u);d&&(d.focus(),d.scrollIntoView({block:"center",behavior:"smooth"}));};return jsxRuntime.jsxs("div",{ref:n,role:"alert",tabIndex:-1,className:tailwindMerge.twMerge("rounded-md border border-feedback-error-border bg-feedback-error-background p-3 text-sm text-feedback-error-text",e),children:[jsxRuntime.jsx("div",{className:"font-medium",children:o}),jsxRuntime.jsx("ul",{className:"mt-2 list-disc pl-5",children:i.map(([l,u])=>{let d=u?.message||"Invalid value";return jsxRuntime.jsx("li",{children:jsxRuntime.jsx("button",{type:"button",className:"underline underline-offset-2",onClick:()=>c(l),children:d})},l)})})]})}function gm({formId:e,disableWhenInvalid:o,disableWhenPristine:t,isDisabled:r,children:n,...a}){let{formState:i}=reactHookForm.useFormContext(),s=r||i.isSubmitting||o&&!i.isValid||t&&!i.isDirty;return jsxRuntime.jsx(w,{type:"submit",form:e,isDisabled:s,...a,children:n})}var Yn={xs:"text-lg font-semibold",sm:"text-xl font-semibold",md:"text-2xl font-semibold",lg:"text-3xl font-semibold",xl:"text-4xl font-semibold"},Xn={page:"h-16 leading-[62px]"};function Tt({tag:e="h1",size:o="lg",height:t,className:r="",children:n}){let a=Yn[o],i=t?Xn[t]:"";return jsxRuntime.jsx(e,{className:tailwindMerge.twMerge(a,i,r),children:n})}var ee=({width:e,height:o,variant:t="rect",animation:r="pulse",gradient:n=false,flex:a=false,stack:i,responsive:s,delay:c=0,adjustAnimationSpeedBasedOnWidth:l=false,ariaLabel:u,className:d,"data-testid":x})=>{let[f,p]=ce.useState(c===0);if(ce.useEffect(()=>{if(c>0){let N=setTimeout(()=>p(true),c);return ()=>clearTimeout(N)}},[c]),!f)return null;let S=n?"bg-gradient-to-r from-[var(--color-skeleton-base)] via-[var(--color-skeleton-highlight)] to-[var(--color-skeleton-base)]":"bg-[var(--color-skeleton-base)]",P=l&&e?(()=>{let N=typeof e=="number"?e:parseFloat(String(e));return isNaN(N)?"":`animation-duration-[${Math.max(.8,N/100)}s]`})():"",b=r==="pulse"?`animate-pulse ${P}`:r==="wave"?`relative overflow-hidden before:absolute before:inset-0 before:bg-gradient-to-r before:from-transparent before:via-[var(--color-skeleton-wave)] before:to-transparent before:animate-wave ${P}`:"",h="rounded-sm";t==="circle"&&(h="rounded-full"),t==="text"&&(h="h-4 w-full rounded-sm");let v=a?"flex-1 min-w-0":"",E=s?Object.entries(s).map(([N,g])=>`${N}:w-[${g}]`).join(" "):"";return i?jsxRuntime.jsx("div",{className:"space-y-2","data-testid":x,children:i.map((N,g)=>jsxRuntime.jsx("div",{className:tailwindMerge.twMerge(S,b,h,v,E,d),style:{width:N,height:o}},g))}):jsxRuntime.jsx("div",{className:tailwindMerge.twMerge(S,b,h,v,E,d),style:{width:e,height:o},role:"presentation","aria-hidden":!u,"aria-label":u??void 0,"data-testid":x})};var ei={outlined:"bg-background-surface border border-border-default",elevated:"bg-background-surface border-0 shadow-md",filled:"bg-background-muted border-0",ghost:"bg-transparent border-0 shadow-none"},ti="rounded-lg",wt={square:"aspect-square",video:"aspect-video",wide:"aspect-[2/1]",auto:""},oi={start:"justify-start",end:"justify-end",center:"justify-center",between:"justify-between"};function be({variant:e="outlined",className:o,children:t,isLoading:r=false}){return jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("w-full overflow-hidden",ei[e],ti,o),"data-testid":"card",children:r?jsxRuntime.jsx(ee,{width:"100%",height:"100%",className:"rounded-none"}):t})}function He({title:e,subtitle:o,actions:t,className:r,isLoading:n=false}){return n?jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("p-6 pb-4",r),children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-start mb-1",children:[jsxRuntime.jsx(ee,{width:120,height:20}),jsxRuntime.jsx(ee,{width:24,height:24})]}),o&&jsxRuntime.jsx(ee,{width:200,height:16})]}):!e&&!o&&!t?null:jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("p-6 pb-4",r),children:jsxRuntime.jsxs("div",{className:"flex justify-between items-start gap-4",children:[jsxRuntime.jsxs("div",{className:"min-w-0 flex-1",children:[e&&jsxRuntime.jsx("div",{className:"mb-1",children:typeof e=="string"?jsxRuntime.jsx(Tt,{tag:"h3",size:"sm",className:"text-text-heading",children:e}):e}),o&&jsxRuntime.jsx("div",{className:"text-sm text-text-muted",children:o})]}),t&&jsxRuntime.jsx("div",{className:"flex-shrink-0",children:t})]})})}function ko({src:e,alt:o,aspectRatio:t="auto",className:r,children:n,isLoading:a=false}){return a?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("bg-background-muted",wt[t],r),children:jsxRuntime.jsx(ee,{width:"100%",height:"100%"})}):n?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("overflow-hidden",wt[t],r),children:n}):e?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("overflow-hidden",wt[t],r),children:jsxRuntime.jsx("img",{src:e,alt:o||"",className:"w-full h-full object-cover",loading:"lazy"})}):null}function Ge({className:e,children:o,isLoading:t=false}){let n=e?.match(/p(?:t|b|l|r|x|y)?-(?:\d+(?:\.\d+)?|px|\[.+?\])/)?"":"px-6 py-4";return t?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge(n,e),children:jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx(ee,{width:"100%",height:16}),jsxRuntime.jsx(ee,{width:"80%",height:16}),jsxRuntime.jsx(ee,{width:"60%",height:16})]})}):o?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("px-6 py-4 text-text-body",e),children:o}):null}function wo({className:e,children:o,align:t="end",isLoading:r=false}){return r?jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("px-6 py-4 flex gap-2 justify-end",e),children:[jsxRuntime.jsx(ee,{width:80,height:32}),jsxRuntime.jsx(ee,{width:60,height:32})]}):o?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("px-6 py-4 flex items-center gap-2",oi[t],e),children:o}):null}be.Header=He;be.Media=ko;be.Content=Ge;be.Footer=wo;function Gm({name:e,getItemTitle:o,renderItem:t,onAdd:r}){let{control:n}=reactHookForm.useFormContext(),{fields:a,append:i,remove:s,swap:c}=reactHookForm.useFieldArray({control:n,name:e});return jsxRuntime.jsxs("div",{className:"flex flex-col gap-3",children:[a.map((l,u)=>jsxRuntime.jsxs(be,{children:[jsxRuntime.jsx(He,{title:o?o(u):`Item ${u+1}`,actions:jsxRuntime.jsxs("div",{className:"flex gap-2",children:[u>0&&jsxRuntime.jsx(w,{size:"sm",variant:"secondary",onPress:()=>c(u,u-1),children:"Up"}),u<a.length-1&&jsxRuntime.jsx(w,{size:"sm",variant:"secondary",onPress:()=>c(u,u+1),children:"Down"}),jsxRuntime.jsx(w,{size:"sm",variant:"secondary",onPress:()=>s(u),children:"Remove"})]})}),jsxRuntime.jsx(Ge,{children:t(u)})]},l.id)),jsxRuntime.jsx("div",{children:jsxRuntime.jsx(w,{variant:"secondary",onPress:()=>i(r?.()||{}),children:"Add item"})})]})}function $t(e){return jsxRuntime.jsx(reactAriaComponents.Form,{validationBehavior:"aria",...e,className:tailwindMerge.twMerge("flex flex-col gap-6",e.className)})}function Io(e){let o=e.querySelector("[aria-invalid='true'], .aria-invalid, [data-invalid='true']")||e.querySelector("input[aria-invalid='true'], select[aria-invalid='true'], textarea[aria-invalid='true']")||e.querySelector("input, select, textarea");o&&(o.focus({preventScroll:false}),o instanceof HTMLElement&&o.scrollIntoView({block:"center",behavior:"smooth"}));}function ep({id:e,onSubmit:o,onInvalid:t,children:r,shouldFocusError:n=true,className:a,...i}){let s=reactHookForm.useForm(i),c=(l,u)=>{if(n&&e){let d=document.getElementById(e);d&&Io(d);}t?.(l,u);};return jsxRuntime.jsx(reactHookForm.FormProvider,{...s,children:jsxRuntime.jsx($t,{id:e,className:a,onSubmit:s.handleSubmit(o,c),children:r})})}function Bo({formId:e,show:o,isSubmitting:t,onCancel:r,primaryLabel:n="Save changes",secondaryLabel:a="Cancel",className:i}){return o?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("fixed inset-x-0 bottom-0 z-40 border-t border-border-muted bg-background-surface/95 backdrop-blur supports-[backdrop-filter]:bg-background-surface/70",i),children:jsxRuntime.jsxs("div",{className:"mx-auto flex max-w-screen-lg items-center justify-between gap-3 p-3",children:[jsxRuntime.jsx("div",{className:"text-sm text-text-muted",children:"You have unsaved changes"}),jsxRuntime.jsxs("div",{className:"flex gap-2",children:[jsxRuntime.jsx(w,{variant:"secondary",onPress:r,children:a}),jsxRuntime.jsx(w,{type:"submit",form:e,isDisabled:!!t,children:t?"Saving...":n})]})]})}):null}function dp({formId:e,onCancel:o,primaryLabel:t,secondaryLabel:r,className:n}){let{formState:a}=reactHookForm.useFormContext();return jsxRuntime.jsx(Bo,{formId:e,show:a.isDirty,isSubmitting:a.isSubmitting,onCancel:o,primaryLabel:t,secondaryLabel:r,className:n})}function pp(e=true){let{formState:o}=reactHookForm.useFormContext();ce__namespace.useEffect(()=>{if(!e||!o.isSubmitted||!o.errors||Object.keys(o.errors).length===0)return;let t=document.querySelector("[aria-invalid='true'], .aria-invalid, [data-invalid='true']")||document.querySelector("input[aria-invalid='true'], select[aria-invalid='true'], textarea[aria-invalid='true']");t&&t.scrollIntoView({block:"center",behavior:"smooth"});},[e,o.isSubmitted,o.errors]);}function xp({delayMs:e=800,onAutoSave:o}){let{watch:t,formState:r,getValues:n}=reactHookForm.useFormContext(),a=ce__namespace.useRef(void 0);ce__namespace.useEffect(()=>{let i=t(()=>{r.isDirty&&(a.current&&window.clearTimeout(a.current),a.current=window.setTimeout(async()=>{let s=n();await o(s);},e));});return ()=>{i.unsubscribe(),a.current&&window.clearTimeout(a.current);}},[t,r.isDirty,n,e,o]);}exports.ErrorSummary=mm;exports.FieldArrayList=Gm;exports.FormAutocomplete=Pl;exports.FormCheckbox=Hl;exports.FormCheckboxGroup=Kl;exports.FormColorField=dd;exports.FormDateField=Od;exports.FormFileUpload=ac;exports.FormNumberField=Cc;exports.FormProvider=ep;exports.FormRadioGroup=Wc;exports.FormSaveBar=dp;exports.FormSelect=_c;exports.FormSwitch=uu;exports.FormTextArea=Su;exports.FormTextField=Mu;exports.FormTimeField=sm;exports.SubmitButton=gm;exports.focusFirstError=Io;exports.useAutoSave=xp;exports.useScrollIntoViewOnError=pp;//# sourceMappingURL=index.cjs.map
1
+ 'use strict';var reactHookForm=require('react-hook-form'),me=require('react'),reactAriaComponents=require('react-aria-components'),reactStately=require('react-stately'),tailwindMerge=require('tailwind-merge'),gr=require('@phosphor-icons/react'),jsxRuntime=require('react/jsx-runtime'),lucideReact=require('lucide-react'),reactColorful=require('react-colorful'),En=require('@tiptap/extension-link'),react=require('@tiptap/react'),menus=require('@tiptap/react/menus'),zn=require('@tiptap/starter-kit');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}var me__namespace=/*#__PURE__*/_interopNamespace(me);var gr__namespace=/*#__PURE__*/_interopNamespace(gr);var En__default=/*#__PURE__*/_interopDefault(En);var zn__default=/*#__PURE__*/_interopDefault(zn);var ze={prefix:String(Math.round(Math.random()*1e10)),current:0},Gt=me__namespace.default.createContext(ze),Qo=me__namespace.default.createContext(false);var Xo=!!(typeof window<"u"&&window.document&&window.document.createElement),Je=new WeakMap;function Yo(e=false){let o=me.useContext(Gt),t=me.useRef(null);if(t.current===null&&!e){var r,n;let a=(n=me__namespace.default.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED)===null||n===void 0||(r=n.ReactCurrentOwner)===null||r===void 0?void 0:r.current;if(a){let i=Je.get(a);i==null?Je.set(a,{id:o.current,state:a.memoizedState}):a.memoizedState!==i.state&&(o.current=i.id,Je.delete(a));}t.current=++o.current;}return t.current}function Jo(e){let o=me.useContext(Gt);o===ze&&!Xo&&process.env.NODE_ENV!=="production"&&console.warn("When server rendering, you must wrap your application in an <SSRProvider> to ensure consistent ids are generated between the client and server.");let t=Yo(!!e),r=o===ze&&process.env.NODE_ENV==="test"?"react-aria":`react-aria${o.prefix}`;return e||`${r}-${t}`}function Zo(e){let o=me__namespace.default.useId(),[t]=me.useState(Me()),r=t||process.env.NODE_ENV==="test"?"react-aria":`react-aria${ze.prefix}`;return e||`${r}-${o}`}typeof me__namespace.default.useId=="function"?Zo:Jo;function tr(){return false}function or(){return true}function rr(e){return ()=>{}}function Me(){return typeof me__namespace.default.useSyncExternalStore=="function"?me__namespace.default.useSyncExternalStore(rr,tr,or):me.useContext(Qo)}var ar=new Set(["Arab","Syrc","Samr","Mand","Thaa","Mend","Nkoo","Adlm","Rohg","Hebr"]),nr=new Set(["ae","ar","arc","bcc","bqi","ckb","dv","fa","glk","he","ku","mzn","nqo","pnb","ps","sd","ug","ur","yi"]);function et(e){if(Intl.Locale){let t=new Intl.Locale(e).maximize(),r=typeof t.getTextInfo=="function"?t.getTextInfo():t.textInfo;if(r)return r.direction==="rtl";if(t.script)return ar.has(t.script)}let o=e.split("-")[0];return nr.has(o)}var lr=Symbol.for("react-aria.i18n.locale");function qt(){let e=typeof window<"u"&&window[lr]||typeof navigator<"u"&&(navigator.language||navigator.userLanguage)||"en-US";try{Intl.DateTimeFormat.supportedLocalesOf([e]);}catch{e="en-US";}return {locale:e,direction:et(e)?"rtl":"ltr"}}var tt=qt(),we=new Set;function Ot(){tt=qt();for(let e of we)e(tt);}function _t(){let e=Me(),[o,t]=me.useState(tt);return me.useEffect(()=>(we.size===0&&window.addEventListener("languagechange",Ot),we.add(t),()=>{we.delete(t),we.size===0&&window.removeEventListener("languagechange",Ot);}),[]),e?{locale:"en-US",direction:"ltr"}:o}var ur=me__namespace.default.createContext(null);function ot(){let e=_t();return me.useContext(ur)||e}var rt=new Map;function at(e){let{locale:o}=ot(),t=o+(e?Object.entries(e).sort((n,a)=>n[0]<a[0]?-1:1).join():"");if(rt.has(t))return rt.get(t);let r=new Intl.Collator(o,e);return rt.set(t,r),r}function He(e){let o=at({usage:"search",...e}),t=me.useCallback((a,i)=>i.length===0?true:(a=a.normalize("NFC"),i=i.normalize("NFC"),o.compare(a.slice(0,i.length),i)===0),[o]),r=me.useCallback((a,i)=>i.length===0?true:(a=a.normalize("NFC"),i=i.normalize("NFC"),o.compare(a.slice(-i.length),i)===0),[o]),n=me.useCallback((a,i)=>{if(i.length===0)return true;a=a.normalize("NFC"),i=i.normalize("NFC");let s=0,l=i.length;for(;s+l<=a.length;s++){let d=a.slice(s,s+l);if(o.compare(i,d)===0)return true}return false},[o]);return me.useMemo(()=>({startsWith:t,endsWith:r,contains:n}),[t,r,n])}function Wt(e,o=300){let[t,r]=me.useState(e);return me.useEffect(()=>{let n=setTimeout(()=>r(e),o);return ()=>clearTimeout(n)},[e,o]),t}function pe(e=false){return `${e?"outline outline-1 outline-border-input data-[focus-visible]:outline-2 data-[focus-visible]:outline-action-default data-[focus-visible]:outline-offset-0 invalid:outline-2 invalid:outline-feedback-error-border group-invalid:outline-2 group-invalid:outline-feedback-error-border forced-colors:focus:outline-[Highlight] forced-colors:focus:outline-2 forced-colors:focus:outline-offset-2":"outline-none data-[focus-visible]:outline data-[focus-visible]:outline-2 data-[focus-visible]:outline-action-default data-[focus-visible]:outline-offset-0 invalid:outline-2 invalid:outline-feedback-error-border group-invalid:outline-2 group-invalid:outline-feedback-error-border forced-colors:focus:outline-[Highlight] forced-colors:focus:outline-2 forced-colors:focus:outline-offset-2"}`}function A(e,o){return reactAriaComponents.composeRenderProps(e,t=>tailwindMerge.twMerge(o,t))}var $={sm:{text:"text-[length:var(--control-text-sm)]",height:"h-[var(--control-sm-height)]",padding:"px-[var(--control-padding-sm)]",paddingY:"py-[var(--control-gap-sm)]",gap:"gap-[var(--control-gap-sm)]"},md:{text:"text-[length:var(--control-text-md)]",height:"h-[var(--control-md-height)]",padding:"px-[var(--control-padding-md)]",paddingY:"py-[var(--control-gap-md)]",gap:"gap-[var(--control-gap-md)]"},lg:{text:"text-[length:var(--control-text-lg)]",height:"h-[var(--control-lg-height)]",padding:"px-[var(--control-padding-lg)]",paddingY:"py-[var(--control-gap-lg)]",gap:"gap-[var(--control-gap-lg)]"},xl:{text:"text-[length:var(--control-text-xl)]",height:"h-[var(--control-xl-height)]",padding:"px-[var(--control-padding-xl)]",paddingY:"py-[var(--control-gap-xl)]",gap:"gap-[var(--control-gap-xl)]"}};var Pe={xs:16,sm:20,md:24,lg:32,xl:40,"2xl":48},b=me.memo(({name:e,size:o="md",color:t,weight:r="regular",className:n,ariaLabel:a,...i})=>{let s=gr__namespace[e];if(!s)return process.env.NODE_ENV==="development"&&console.error(`Icon "${e}" not found in @phosphor-icons/react`),null;let l=typeof o=="string"&&o in Pe?Pe[o]:o,d=tailwindMerge.twMerge("inline-block flex-shrink-0",!t&&"text-current",n);return jsxRuntime.jsx(s,{...i,size:l,color:t,weight:r,className:d,"aria-label":a||`${e} icon`,"data-testid":`icon-${e}`})});b.displayName="Icon";var jt=me.memo(({variant:e="subtle",shape:o="square",containerSize:t,containerClassName:r,size:n="md",className:a,name:i,color:s,weight:l,ariaLabel:d,ref:u,...c})=>{let g=typeof n=="string"&&n in Pe?Pe[n]:n,f=t?typeof t=="string"&&t in Pe?Pe[t]:t:g*1.75,p=tailwindMerge.twMerge("inline-flex items-center justify-center flex-shrink-0",o==="circle"?"rounded-full":"rounded-lg",e==="subtle"&&"bg-gray-100 dark:bg-gray-800",e==="solid"&&"bg-brand text-white",e==="outline"&&"border-2 border-current",r);return jsxRuntime.jsx("div",{className:p,style:{width:f,height:f},children:jsxRuntime.jsx(b,{...c,name:i,size:n,color:s,weight:l,className:a,ariaLabel:d})})});jt.displayName="IconWithContainer";function de(){let[e,o]=me__namespace.default.useState(false),t=me__namespace.default.useCallback((n,a)=>{o(true),a?.(n);},[]),r=me__namespace.default.useCallback((n,a)=>{o(false),a?.(n);},[]);return {isFocused:e,handleFocus:t,handleBlur:r}}function X({children:e,className:o}){return jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("relative w-full",o),children:e})}function Qt({onClick:e,size:o="md",className:t}){return jsxRuntime.jsx("button",{type:"button",onClick:r=>{r.preventDefault(),r.stopPropagation(),e();},className:tailwindMerge.twMerge("absolute right-2 top-1/2 -translate-y-1/2 transform text-text-muted hover:text-text-body",t),"aria-label":"Clear input",onMouseDown:r=>{r.preventDefault(),r.stopPropagation();},children:jsxRuntime.jsx(b,{name:"X",size:o==="sm"?16:20})})}function Fe(e){let{isInvalid:o,isDisabled:t,isFocused:r}=e,n="border rounded-[var(--control-border-radius)] !outline-none ";return t?`${n} border-border-muted`:o&&r?`${n} border-feedback-error-border shadow-[inset_0_0_0_1px_var(--color-feedback-error-border)]`:o?`${n} border-feedback-error-border`:r?`${n} border-border-focus shadow-[inset_0_0_0_1px_var(--color-border-focus)]`:`${n} border-border-input`}function Xt(e){return e.isDisabled?"bg-background-muted":e.transparent?"bg-transparent":"bg-background-input"}function ee(e){let{isInvalid:o,isDisabled:t,isFocused:r,transparent:n,size:a="md",className:i}=e;return tailwindMerge.twMerge("w-full",Fe({isInvalid:o,isDisabled:t,isFocused:r}),Xt({transparent:n,isDisabled:t}),$[a].text,$[a].height,$[a].padding,i)}function Yt(e){let{size:o="md",isFocusWithin:t,isInvalid:r,isDisabled:n,transparent:a,className:i}=e;return tailwindMerge.twMerge("group flex items-center rounded-[var(--control-border-radius)] overflow-hidden",Xt({transparent:a,isDisabled:n}),$[o].height,Fe({isFocused:t,isInvalid:r,isDisabled:n}),i)}function z({children:e,size:o="md",tooltip:t,isRequired:r,className:n,htmlFor:a}){return jsxRuntime.jsxs("label",{htmlFor:a,className:tailwindMerge.twMerge($[o].text,"!text-text-label font-semibold flex items-center gap-1",n),children:[e,r&&jsxRuntime.jsx("span",{children:"*"}),t&&jsxRuntime.jsx("span",{className:"text-text-muted",children:jsxRuntime.jsx(b,{name:"Info",size:o==="sm"?16:20})})]})}function S({size:e="md",className:o,children:t,...r}){return jsxRuntime.jsx("div",{...r,className:tailwindMerge.twMerge("leading-[2.25] text-text-caption",$[e].text,o),children:t})}function m({children:e,size:o="md",className:t}){return jsxRuntime.jsx("div",{role:"alert",className:tailwindMerge.twMerge($[o].text,"text-feedback-error-text",t),children:e})}function Ge({size:e="md",isInvalid:o,isDisabled:t,isFocused:r,transparent:n,className:a,...i}){return jsxRuntime.jsx("input",{className:ee({isInvalid:o,isDisabled:t,isFocused:r,transparent:n,size:e,className:a}),...i})}var Pr="flex font-medium justify-center items-center gap-2 text-center transition rounded-[var(--control-border-radius)] whitespace-nowrap box-border",Fr={default:"bg-action-default text-[color:var(--color-action-default-text)] hover:bg-action-default-hover forced-colors:bg-[ButtonText] forced-colors:text-[ButtonFace] border-2 border-transparent",brand:"bg-action-brand text-[color:var(--color-action-brand-text)] hover:bg-action-brand-hover forced-colors:bg-[ButtonText] forced-colors:text-[ButtonFace] border-2 border-transparent",secondary:"bg-transparent text-text-body border-2 border-border-muted hover:bg-text-body/5 forced-colors:border-[ButtonBorder] forced-colors:bg-[ButtonFace] forced-colors:text-[ButtonText]",ghost:"border-none text-text-body hover:bg-text-body/5 forced-colors:text-[ButtonText] forced-colors:hover:bg-[ButtonFace]",destructive:"bg-transparent text-feedback-error-text border-2 border-border-muted hover:bg-feedback-error-background/50 forced-colors:border-[ButtonBorder] forced-colors:bg-[ButtonFace] forced-colors:text-[Mark]",link:"!text-action-brand hover:text-action-brand/90 hover:underline hover:decoration-2 hover:underline-offset-4",icon:"border-none text-text-body hover:bg-background-hover hover:text-text-heading forced-colors:text-[ButtonText] forced-colors:hover:bg-[ButtonFace] p-1 flex-shrink-0 rounded-[var(--control-border-radius)]",unstyled:"bg-transparent"},Zt={full:"w-full",default:"w-fit"},Cr="opacity-50 cursor-not-allowed pointer-events-none",Rr="opacity-100 cursor-pointer",Sr={"top-right":"-right-2 -top-2","top-left":"-left-2 -top-2","bottom-right":"-right-2 -bottom-2","bottom-left":"-left-2 -bottom-2"},Nr={primary:"bg-action-brand text-white",destructive:"bg-action-destructive text-white"};function Tr(e){return e?e==="primary"?"brand":e:"default"}function kr(e){let{variant:o="default",size:t="md",isDisabled:r,fullWidth:n=false,isLoading:a=false}=e,i=Tr(o),s=i==="unstyled"?"":`${Pr} ${Fr[i]}`;i!=="unstyled"&&(s+=` ${$[t].text} ${$[t].height} ${$[t].padding} ${$[t].gap}`),r||a?s+=` ${Cr}`:s+=` ${Rr}`,n?s+=` ${Zt.full}`:s+=` ${Zt.default}`;let l=i==="brand"?"focus-visible:outline-action-brand":void 0;return [s,pe(),l].filter(Boolean).join(" ")}function v(e){let{icon:o,children:t,isLoading:r=false,loadingText:n,loadingIndicator:a,size:i="md",iconPosition:s="left",iconWeight:l,href:d,className:u,badgeNumber:c,badgeVariant:g="primary",badgePosition:f="top-right",style:p,target:N,rel:R,...x}=e,P=o?jsxRuntime.jsx(b,{name:o,size:i,weight:l}):null,F=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[s==="left"&&P,typeof t=="function"?null:t,s==="right"&&P]}),L=jsxRuntime.jsxs("div",{className:"relative inline-flex items-center justify-center",children:[jsxRuntime.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:a||jsxRuntime.jsx(b,{name:"CircleNotch",size:i,className:"animate-spin","aria-hidden":"true"})}),jsxRuntime.jsx("div",{className:"invisible","aria-hidden":"true",children:F}),n&&jsxRuntime.jsx("span",{className:"sr-only",role:"status","aria-live":"polite",children:n})]}),k=(c??0)>0,h=tailwindMerge.twMerge(kr(e),u),w=d?{href:d,target:N,rel:R,...x}:{};if(d){let{onPress:j,onPressStart:ie,onPressEnd:H,onPressChange:ue,onPressUp:oe,onAuxClick:_,onContextMenu:ye,onDoubleClick:V,...C}=x;Object.assign(w,C);}let Q=d?jsxRuntime.jsx(reactAriaComponents.Link,{...w,...r&&{"aria-busy":true},style:k?void 0:p,className:h,children:r?L:typeof t=="function"?(function(j){return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[s==="left"&&P,t(j),s==="right"&&P]})}):F}):jsxRuntime.jsx(reactAriaComponents.Button,{...x,...r&&{"aria-busy":true},style:k?void 0:p,className:h,children:r?L:typeof t=="function"?(function(j){return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[s==="left"&&P,t(j),s==="right"&&P]})}):F});return k?jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("relative flex",u),style:p,children:[Q,jsxRuntime.jsx("span",{className:`absolute ${Sr[f]} flex h-5 w-5 items-center justify-center rounded-full ${Nr[g]} text-xs font-medium`,"aria-label":`${c} items`,children:c})]}):Q}function $e({transparent:e=false,className:o,children:t,...r}){return jsxRuntime.jsx(reactAriaComponents.ModalOverlay,{...r,className:reactAriaComponents.composeRenderProps(o,(n,a)=>tailwindMerge.twMerge("fixed inset-0 z-50",e?"bg-transparent":["bg-gradient-to-br from-black/20 via-black/15 to-black/20","backdrop-blur-[2px]","supports-[backdrop-filter]:bg-black/15"].join(" "),a.isEntering&&["animate-in fade-in","duration-300 ease-out"].join(" "),a.isExiting&&["animate-out fade-out","duration-200 ease-in"].join(" "),n)),children:t})}function Mr({isEntering:e,isExiting:o,className:t="",disableGroup:r=false}){let n=[!r&&"group","bg-background-surface","forced-colors:bg-[Canvas]","shadow-lg","rounded-[var(--control-border-radius)]","bg-clip-padding","border","border-border-default","outline-none"].filter(Boolean).join(" "),a=e?["animate-in","fade-in","placement-bottom:slide-in-from-top-1","placement-top:slide-in-from-bottom-1","placement-left:slide-in-from-right-1","placement-right:slide-in-from-left-1","ease-out","duration-200"].join(" "):"",i=o?["animate-out","fade-out","placement-bottom:slide-out-to-top-1","placement-top:slide-out-to-bottom-1","placement-left:slide-out-to-right-1","placement-right:slide-out-to-left-1","ease-in","duration-150"].join(" "):"";return [n,a,i,t].filter(Boolean).join(" ")}function Re({children:e,showArrow:o=false,withBackdrop:t=false,className:r,isDismissable:n=true,disableGroup:a=false,...i}){let l=reactAriaComponents.useSlottedContext(reactAriaComponents.PopoverContext)?.trigger==="SubmenuTrigger",d=o?12:8;d=l?d-6:d;let u=jsxRuntime.jsxs(reactAriaComponents.Popover,{offset:d,...i,className:reactAriaComponents.composeRenderProps(r,(c,g)=>Mr({...g,className:c,disableGroup:a})),children:[o&&jsxRuntime.jsx(reactAriaComponents.OverlayArrow,{children:jsxRuntime.jsx("svg",{width:12,height:12,viewBox:"0 0 12 12",className:"block fill-background-surface stroke-border-default stroke-1 group-placement-left:-rotate-90 group-placement-right:rotate-90 group-placement-bottom:rotate-180 forced-colors:fill-[Canvas] forced-colors:stroke-[ButtonBorder]",children:jsxRuntime.jsx("path",{d:"M0 0 L6 6 L12 0"})})}),e]});return t?jsxRuntime.jsx($e,{isDismissable:n,children:jsxRuntime.jsx(reactAriaComponents.Modal,{isDismissable:n,children:u})}):u}var no=me.createContext("md");function io(){return me.useContext(no)}function Kr(e="md"){return `flex-1 text-start data-[placeholder]:text-text-placeholder overflow-hidden text-ellipsis whitespace-nowrap ${$[e].text}`}function Ur(){let e=me__namespace.default.useCallback((t,r)=>{r?.(t);},[]),o=me__namespace.default.useCallback((t,r)=>{r?.(t);},[]);return {handleFocus:e,handleBlur:o}}function dt({label:e,description:o,errorMessage:t,children:r,items:n,renderItem:a,size:i="md",selectedKey:s,defaultSelectedKey:l,onSelectionChange:d,placeholder:u,showErrors:c=false,tooltip:g,isRequired:f,transparent:p,reserveErrorSpace:N=false,placement:R="bottom start",shouldFlip:x=true,menuWidth:P="match",...F}){let[L,k]=me.useState(null),[h,w]=me.useState(null),Q=s??L??l,{handleFocus:j,handleBlur:ie}=Ur(),H=_=>{d&&_!==null&&d(_),d||k(_);},ue=me.useRef(null),oe=me.useRef(null);return jsxRuntime.jsx(reactAriaComponents.Select,{...F,selectedKey:Q,defaultSelectedKey:l,onSelectionChange:H,placeholder:u,className:A(F.className,"group flex w-full flex-col"),ref:ue,onOpenChange:_=>{_&&oe.current?w(oe.current.offsetWidth):_||ue.current?.blur();},children:({isDisabled:_,isInvalid:ye,isOpen:V})=>jsxRuntime.jsxs("div",{className:"flex flex-col",children:[e&&jsxRuntime.jsx(z,{size:i,tooltip:g,isRequired:f,children:e}),jsxRuntime.jsx(X,{children:jsxRuntime.jsx("div",{ref:oe,children:jsxRuntime.jsxs(v,{variant:"unstyled",className:tailwindMerge.twMerge(ee({isInvalid:ye||c&&!!t,isDisabled:_,isFocused:V,transparent:p,size:i}),"flex items-center text-start gap-4 cursor-pointer pl-[var(--control-padding-sm)]"),onFocus:C=>j(C,F.onFocus),onBlur:C=>ie(C,F.onBlur),"data-open":V,children:[jsxRuntime.jsx(reactAriaComponents.SelectValue,{className:Kr(i)}),jsxRuntime.jsx(b,{name:"CaretDown","aria-hidden":true,className:tailwindMerge.twMerge("h-4 w-4 text-text-body group-disabled:text-gray-200 forced-colors:text-[ButtonText] transition-transform",V&&"rotate-180")})]})})}),N?jsxRuntime.jsx("div",{className:"mt-1 min-h-[20px]",children:c?jsxRuntime.jsx(m,{size:i,className:"text-feedback-error-text",children:typeof t=="function"&&F.validationResult?t(F.validationResult):typeof t=="string"?t:null}):o?jsxRuntime.jsx(S,{size:i,children:o}):null}):jsxRuntime.jsx(jsxRuntime.Fragment,{children:c?jsxRuntime.jsx(m,{size:i,className:"mt-1 text-feedback-error-text",children:typeof t=="function"&&F.validationResult?t(F.validationResult):typeof t=="string"?t:null}):o?jsxRuntime.jsx(S,{size:i,className:"mt-1",children:o}):null}),jsxRuntime.jsx(Re,{className:"bg-background-input shadow-xl border border-border-input/20 backdrop-blur-sm rounded-[var(--control-border-radius)]",style:{width:P==="match"&&h?`${h}px`:void 0,minWidth:P==="auto"&&h?`${h}px`:void 0,maxWidth:P==="auto"?"min(600px, 90vw)":void 0},placement:R,shouldFlip:x,children:jsxRuntime.jsx(no.Provider,{value:i,children:jsxRuntime.jsx(reactAriaComponents.ListBox,{items:n,className:"w-full max-h-[300px] overflow-auto bg-background-input p-0 outline-0",children:a&&n?C=>jsxRuntime.jsx(Ce,{id:C.id,textValue:C.label,size:i,children:jsxRuntime.jsx("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap min-w-0 flex-1",children:a(C)})},C.id):r})})})]})})}function Ce({size:e,className:o,...t}){let r=io(),n=e??r;return jsxRuntime.jsx(reactAriaComponents.ListBoxItem,{...t,className:tailwindMerge.twMerge("flex cursor-default items-center gap-2 rounded-sm px-3 outline-none text-text-body data-[focused]:bg-background-hover data-[focus-visible]:ring-2 data-[focus-visible]:ring-action-default data-[focus-visible]:ring-inset data-[selected]:bg-background-selected data-[selected]:font-medium overflow-hidden",$[n].paddingY,$[n].text,o)})}var na={sm:"h-4 w-4",md:"h-5 w-5",lg:"h-6 w-6",xl:"h-7 w-7"},ia={sm:"pl-7",md:"pl-9",lg:"pl-10",xl:"pl-12"},so={sm:"py-1",md:"py-2",lg:"py-3",xl:"py-4"};function sa(){let e=me__namespace.default.useContext(reactAriaComponents.ComboBoxStateContext);return jsxRuntime.jsx(reactAriaComponents.Button,{slot:null,className:"clear-button","aria-label":"Clear",onPress:()=>e?.setSelectedKey(null),children:"\u2715"})}var pt=(e,o,t)=>{if(e==null||e==="")return "";let n=(t?t.flatMap(a=>a.items):o||[]).find(a=>a.id===e);return n?n.name:""};async function la(e,o,t){try{let r=e.url.replace("{q}",o),n=new URLSearchParams;e.extraParams&&Object.entries(e.extraParams).forEach(([l,d])=>{n.append(l,d.toString());});let a=`${r}${n.toString()?"?"+n.toString():""}`,i=await fetch(a,{method:"GET",headers:e.headers,signal:t});if(!i.ok)throw new Error(`HTTP error! status: ${i.status}`);let s=await i.json();return {items:e.transformResponse(s)}}catch(r){console.error("Error in REST request:",r);let n=r instanceof Error?r.message:"Unknown error occurred";return {items:[],error:n}}}async function da(e,o,t){try{let r=e.graphqlQuery.replace(`$${e.variableKey||"filter"}`,`"${o}"`),n=await fetch(e.url,{method:"POST",headers:{"Content-Type":"application/json",...e.headers},body:JSON.stringify({query:r}),signal:t});if(!n.ok)throw new Error(`HTTP error! status: ${n.status}`);let a=await n.json();if(a.errors)throw new Error(a.errors[0]?.message||"GraphQL error occurred");return e.responsePath&&(a=e.responsePath.split(".").reduce((i,s)=>i?.[s],a)),{items:e.transformResponse(a)}}catch(r){console.error("Error in GraphQL request:",r);let n=r instanceof Error?r.message:"Unknown error occurred";return {items:[],error:n}}}function bt({label:e,staticItems:o=[],sections:t,selectedKey:r,defaultSelectedKey:n,onSelectionChange:a,requestConfig:i,defaultFilter:s,placeholder:l,errorMessage:d,description:u,size:c="md",tooltip:g,isRequired:f,isDisabled:p,isInvalid:N,validationResult:R,showErrors:x=true,renderItem:P,renderLeftIcon:F,renderSection:L,autoFocus:k=false,reserveErrorSpace:h=false}){let w=me__namespace.default.useRef(null),[Q,j]=me__namespace.default.useState(),[ie,H]=me.useState(()=>pt(r||n,o,t)),[ue,oe]=me.useState(false),_=Wt(ie),{contains:ye}=He({sensitivity:"base"}),[V,C]=me.useState(),Ye=$[c].text,Ht=$[c].height,le=null;me.useEffect(()=>{k&&oe(true);},[k]),me.useEffect(()=>{let O=()=>{w.current&&j(w.current.offsetWidth);};return O(),window.addEventListener("resize",O),()=>window.removeEventListener("resize",O)},[]),me.useEffect(()=>{le&&le.setFilterText(_);},[_,le]),i&&(le=reactStately.useAsyncList({async load({signal:O,filterText:D=""}){if(!i.url||i.shouldLoad&&!i.shouldLoad(D))return {items:[]};try{let Z;return i.requestType==="GraphQL"?Z=await da(i,D,O):Z=await la(i,D,O),C(Z.error),{items:Z.items}}catch(Z){return console.error("Error loading items:",Z),C(Z instanceof Error?Z.message:"Unknown error occurred"),{items:[]}}},initialFilterText:""})),_===""&&(le=null);let Wo=O=>{let D=pt(O,o,t);H(D),a&&a(O);},Ko=O=>{H(O);let D=pt(r,o,t);r!=null&&O!==D&&a&&a(null);};return jsxRuntime.jsx(reactAriaComponents.ComboBox,{onSelectionChange:Wo,selectedKey:r||void 0,defaultSelectedKey:n||void 0,defaultItems:t?t.flatMap(O=>O.items):o,items:le?le.items:void 0,className:A("group flex flex-col","w-full"),menuTrigger:"focus",isDisabled:p,isInvalid:N||!!d,inputValue:ie,onInputChange:Ko,autoFocus:k,defaultFilter:s||ye,"aria-label":e||l||"Autocomplete",children:O=>jsxRuntime.jsxs("div",{className:"flex flex-col",children:[e&&jsxRuntime.jsx(z,{size:c,tooltip:g,isRequired:f,children:e}),jsxRuntime.jsxs(reactAriaComponents.Group,{ref:w,className:Yt({size:c,isInvalid:N||!!d,isDisabled:p,isFocusWithin:ue||O.isOpen,className:"w-full cursor-pointer"}),"aria-label":e||l||"Autocomplete",style:{position:"relative"},children:[F?jsxRuntime.jsx("div",{className:"absolute left-3",children:F(!!le?.isLoading)}):jsxRuntime.jsx(b,{name:"MagnifyingGlass",className:`${na[c]} absolute left-3 text-inherit`}),jsxRuntime.jsx(reactAriaComponents.Input,{className:`flex-1 min-w-0 border-none pr-3 outline-0 placeholder:text-text-placeholder ${ia[c]} ${Ye} ${Ht} ${p?"bg-background-muted":"bg-background-input"}`,placeholder:l,disabled:p,onFocus:()=>oe(true),onBlur:()=>oe(false)}),ie&&!p&&jsxRuntime.jsx(sa,{}),jsxRuntime.jsx(reactAriaComponents.Button,{className:`px-2 text-text-body ${Ye} ${Ht} ${p?"bg-background-muted":"bg-background-input"}`,"aria-label":"Toggle menu",isDisabled:p,children:({isPressed:D})=>jsxRuntime.jsx(b,{name:D?"CaretUp":"CaretDown",className:"h-4 w-4"})})]}),h?jsxRuntime.jsx("div",{className:"mt-1 min-h-[20px]",children:x&&V?jsxRuntime.jsx(m,{size:c,className:"text-feedback-error-text",children:V}):x&&typeof d=="string"?jsxRuntime.jsx(m,{size:c,className:"text-feedback-error-text",children:d}):x&&typeof d=="function"&&R?jsxRuntime.jsx(m,{size:c,className:"text-feedback-error-text",children:d(R)}):u?jsxRuntime.jsx(S,{size:c,children:u}):null}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[u&&jsxRuntime.jsx(S,{size:c,className:"mt-1",children:u}),x&&V&&jsxRuntime.jsx(m,{size:c,className:"text-feedback-error-text mt-1",children:V}),x&&typeof d=="string"&&jsxRuntime.jsx(m,{size:c,className:"text-feedback-error-text mt-1",children:d}),x&&typeof d=="function"&&R&&jsxRuntime.jsx(m,{size:c,className:"text-feedback-error-text mt-1",children:d(R)})]}),jsxRuntime.jsx(Re,{className:"bg-background-input shadow-xl border border-border-input/20 backdrop-blur-sm ring-1 ring-black/5 rounded-[var(--control-border-radius)]",style:{minWidth:Q?`${Q}px`:void 0},children:jsxRuntime.jsx(reactAriaComponents.ListBox,{className:`max-h-[300px] overflow-auto bg-background-input outline-none ${Ye}`,children:t?t.map(D=>{let Z=D.items.map(re=>jsxRuntime.jsx(Ce,{id:re.id,textValue:re.name,size:c,className:`flex cursor-default items-center gap-2 px-3 ${so[c]} text-text-body outline-none data-[focused]:bg-background-hover data-[selected]:bg-background-selected data-[selected]:font-medium`,children:P?P(re):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[re.name,jsxRuntime.jsx(b,{name:"X",className:"ml-auto h-4 w-4 text-text-muted opacity-0 data-[focused]:opacity-100 data-[selected]:opacity-100"})]})},re.id));if(L){let re=L(D,Z);return me__namespace.default.isValidElement(re)&&re.type===reactAriaComponents.ListBoxSection?re:jsxRuntime.jsx(reactAriaComponents.ListBoxSection,{children:re},D.name)}return jsxRuntime.jsxs(reactAriaComponents.ListBoxSection,{children:[jsxRuntime.jsx(reactAriaComponents.Header,{className:"px-3 py-1 text-sm font-bold text-text-muted",children:D.name}),Z]},D.name)}):D=>jsxRuntime.jsx(Ce,{id:D.id,textValue:D.name,size:c,className:`flex cursor-default items-center gap-2 px-3 ${so[c]} text-text-body outline-none data-[focused]:bg-background-hover data-[selected]:bg-background-selected data-[selected]:font-medium`,children:P?P(D):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[D.name,jsxRuntime.jsx(b,{name:"X",className:"ml-auto h-4 w-4 text-text-muted opacity-0 data-[focused]:opacity-100 data-[selected]:opacity-100"})]})},D.id)})})]})})}function I(e,o){let t=o.split("."),r=e;for(let a of t)if(r&&typeof r=="object"&&a in r)r=r[a];else {r=void 0;break}let n=r?.message;return typeof n=="string"?n:void 0}function Ul({name:e,defaultValue:o,...t}){let{control:r,formState:n}=reactHookForm.useFormContext(),a=I(n.errors,e);return jsxRuntime.jsx(reactHookForm.Controller,{control:r,name:e,defaultValue:o,render:({field:i})=>jsxRuntime.jsx(bt,{...t,selectedKey:i.value??null,onSelectionChange:s=>i.onChange(s),showErrors:!!a,errorMessage:a})})}function mo(e){return jsxRuntime.jsxs(reactAriaComponents.CheckboxGroup,{...e,className:A(e.className,"flex flex-col gap-2"),children:[jsxRuntime.jsx(z,{children:e.label}),e.children,e.description&&jsxRuntime.jsx(S,{children:e.description}),jsxRuntime.jsx(m,{children:typeof e.errorMessage=="function"?void 0:e.errorMessage})]})}function ga({isDisabled:e}){return `flex gap-2 items-center group text-sm transition ${e?"text-text-disabled":"text-text-caption"}`}function ha({isSelected:e,isInvalid:o,isDisabled:t,isIndeterminate:r,variant:n="default"}){let a="w-5 h-5 flex-shrink-0 rounded-[var(--control-border-radius)] flex items-center justify-center border-2 transition ring-offset-2 focus:ring-2",i=n==="brand"?"focus:ring-action-brand":"focus:ring-action-default",s="";if(t)s="border-border-muted bg-background-muted";else if(o)s="border-feedback-error-border bg-feedback-error-background";else if(e||r){let l=n==="brand"?"action-brand":"action-default";s=`bg-${l} border-${l} hover:bg-${l}-hover hover:border-${l}-hover`;}else s="bg-background-input border-border-input hover:border-border-focus";return `${a} ${i} ${s}`}var uo="w-4 h-4 text-text-onPrimary group-disabled:text-text-disabled";function po(e){let{children:o,variant:t="default",...r}=e;return jsxRuntime.jsx(reactAriaComponents.Checkbox,{...r,className:reactAriaComponents.composeRenderProps(e.className,(n,a)=>`${ga(a)} ${n||""}`),children:n=>{let{isSelected:a,isIndeterminate:i,...s}=n,l=jsxRuntime.jsx("div",{className:ha({isSelected:a,isIndeterminate:i,variant:t,...s}),children:i?jsxRuntime.jsx(lucideReact.Minus,{"aria-hidden":true,className:uo}):a?jsxRuntime.jsx(lucideReact.Check,{"aria-hidden":true,className:uo}):null});return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[l,typeof o=="function"?o(n):o]})}})}function cd({name:e,defaultValue:o,errorBelow:t=false,...r}){let{control:n,formState:a}=reactHookForm.useFormContext(),i=I(a.errors,e);return jsxRuntime.jsx(reactHookForm.Controller,{control:n,name:e,defaultValue:o,render:({field:s})=>jsxRuntime.jsxs("div",{className:"flex flex-col gap-1",children:[jsxRuntime.jsx(po,{...r,isSelected:!!s.value,onChange:l=>s.onChange(l),"aria-invalid":!!i,children:r.children}),t&&i&&jsxRuntime.jsx(m,{children:i})]})})}function xd({name:e,defaultValue:o,...t}){let{control:r,formState:n}=reactHookForm.useFormContext(),a=I(n.errors,e);return jsxRuntime.jsx(reactHookForm.Controller,{control:r,name:e,defaultValue:o,render:({field:i})=>jsxRuntime.jsx(mo,{...t,value:i.value||[],onChange:s=>i.onChange(s),errorMessage:a,children:t.children})})}function Ne(e){if(!e)return false;let o=e.startsWith("#")?e.slice(1):e;return /^[0-9A-Fa-f]{3}$|^[0-9A-Fa-f]{6}$/.test(o)}function ht(e){if(!e)return "";let o=e.startsWith("#")?e.slice(1):e;return o.length===3&&(o=o.split("").map(t=>t+t).join("")),`#${o.toUpperCase()}`}function go({label:e,description:o,errorMessage:t,size:r="md",tooltip:n,isRequired:a,transparent:i,className:s,validationResult:l,value:d,defaultValue:u,onChange:c,placeholder:g="#000000",showColorSwatch:f=true,reserveErrorSpace:p=true,...N}){let[R,x]=me.useState(u||""),[P,F]=me.useState(d||u||""),[L,k]=me.useState(false),[h,w]=me.useState(null),{isFocused:Q,handleFocus:j,handleBlur:ie}=de(),H=d!==void 0?d:R;me.useEffect(()=>{d!==void 0&&F(d);},[d]);let ue=H?!Ne(H):false,oe=me.useCallback(V=>{if(F(V),Ne(V)){let C=ht(V);c?c(C):x(C);}else V===""&&(c?c(""):x(""));},[c]),_=me.useCallback(V=>{let C=ht(V);F(C),c?c(C):x(C);},[c]),ye=me.useCallback(V=>{if(Ne(P)){let C=ht(P);F(C),c&&C!==H?c(C):!c&&C!==R&&x(C);}ie(V,N.onBlur);},[P,H,R,c,ie,N.onBlur]);return jsxRuntime.jsx(reactAriaComponents.TextField,{...N,isRequired:a,className:A(s,"group flex flex-col"),children:({isDisabled:V})=>jsxRuntime.jsxs("div",{className:"flex flex-col",children:[e&&jsxRuntime.jsx(z,{size:r,tooltip:n,isRequired:a,children:e}),jsxRuntime.jsx(X,{children:jsxRuntime.jsxs("div",{className:"flex gap-2",children:[jsxRuntime.jsxs("div",{className:"flex-1 relative",children:[jsxRuntime.jsx(Ge,{size:r,disabled:V,type:"text",value:P,placeholder:g,onFocus:C=>j(C,N.onFocus),onBlur:ye,onChange:C=>oe(C.target.value),className:tailwindMerge.twMerge(ee({isInvalid:ue,isDisabled:V,isFocused:Q,size:r,transparent:i}),f?"pr-12":"pr-3","pl-3")}),f&&jsxRuntime.jsx("div",{className:"absolute right-3 top-1/2 -translate-y-1/2 pointer-events-none",style:{width:$[r].height},children:jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("w-6 h-6 rounded border shadow-sm",Ne(H)?"border-border-default":"border-border-default bg-background-muted"),style:Ne(H)?{backgroundColor:H}:void 0,"aria-hidden":"true",children:!Ne(H)&&jsxRuntime.jsx("div",{className:"w-full h-full flex items-center justify-center",children:jsxRuntime.jsx("div",{className:"w-3 h-3 rounded-full border-2 border-border-muted"})})})})]}),jsxRuntime.jsx("div",{ref:w,children:jsxRuntime.jsx(v,{variant:"secondary",size:r,icon:"Palette",onPress:()=>k(!L),isDisabled:V,className:"flex-shrink-0",children:"Pick"})})]})}),p?jsxRuntime.jsx("div",{className:"mt-1 min-h-[20px]",children:typeof t=="string"?jsxRuntime.jsx(m,{size:r,children:t}):typeof t=="function"&&l?jsxRuntime.jsx(m,{size:r,children:t(l)}):o?jsxRuntime.jsx(S,{size:r,children:o}):null}):jsxRuntime.jsx(jsxRuntime.Fragment,{children:typeof t=="string"?jsxRuntime.jsx(m,{size:r,className:"mt-1",children:t}):typeof t=="function"&&l?jsxRuntime.jsx(m,{size:r,className:"mt-1",children:t(l)}):o?jsxRuntime.jsx(S,{size:r,className:"mt-1",children:o}):null}),L&&h&&jsxRuntime.jsx(Re,{triggerRef:{current:h},isOpen:L,onOpenChange:k,placement:"bottom end",className:"bg-background-input shadow-xl border border-border-input/20 backdrop-blur-sm rounded-lg p-4",children:jsxRuntime.jsxs("div",{className:"flex flex-col gap-4",children:[jsxRuntime.jsx(reactColorful.HexColorPicker,{color:H||"#000000",onChange:_,style:{width:"200px",height:"200px"}}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("div",{className:"w-10 h-10 rounded border border-border-default shadow-sm flex-shrink-0",style:{backgroundColor:H||"#000000"}}),jsxRuntime.jsx("div",{className:"flex-1 text-text-body text-[length:var(--control-text-sm)] font-mono",children:H||"#000000"})]})]})})]})})}function Ed({name:e,defaultValue:o,...t}){let{control:r,formState:n}=reactHookForm.useFormContext(),a=I(n.errors,e);return jsxRuntime.jsx(reactHookForm.Controller,{control:r,name:e,defaultValue:o,render:({field:i})=>jsxRuntime.jsx(go,{...t,value:i.value??"",onChange:s=>i.onChange(s),isInvalid:!!a,errorMessage:a})})}function Ha({isSelected:e,isDisabled:o}){let t=[pe,"w-9 h-9 text-sm cursor-default rounded-sm flex items-center justify-center forced-color-adjust-none font-semibold"];return o?t.push("text-text-disabled forced-colors:text-[GrayText]"):e?t.push("bg-action-default text-text-onPrimary invalid:bg-feedback-error-border forced-colors:bg-[Highlight] forced-colors:invalid:bg-[Mark] forced-colors:text-[HighlightText]"):t.push("text-text-body hover:bg-background-hover pressed:bg-background-selected"),t.join(" ")}function yt({errorMessage:e,...o}){return jsxRuntime.jsxs(reactAriaComponents.Calendar,{...o,children:[jsxRuntime.jsx(vo,{}),jsxRuntime.jsxs(reactAriaComponents.CalendarGrid,{className:"border-separate [border-spacing:0] [&_td]:p-0 [&_td]:!border-0",children:[jsxRuntime.jsx(yo,{}),jsxRuntime.jsx(reactAriaComponents.CalendarGridBody,{children:t=>jsxRuntime.jsx(reactAriaComponents.CalendarCell,{date:t,className:({isSelected:r,isDisabled:n})=>`${Ha({isSelected:r,isDisabled:n})} border-0`})})]}),e&&jsxRuntime.jsx(reactAriaComponents.Text,{slot:"errorMessage",className:"text-sm text-red-600",children:e})]})}function vo(){let{direction:e}=reactAriaComponents.useLocale(),o=18;return jsxRuntime.jsxs("header",{className:"flex w-full items-center gap-1 px-1 pb-4",children:[jsxRuntime.jsx(v,{variant:"icon",slot:"previous",className:"pl-0",children:e==="rtl"?jsxRuntime.jsx(b,{name:"CaretRight","aria-hidden":true,size:o}):jsxRuntime.jsx(b,{name:"CaretLeft","aria-hidden":true,size:o})}),jsxRuntime.jsx(reactAriaComponents.Heading,{className:"text-md mx-2 flex-1 text-center font-semibold text-zinc-900 dark:text-zinc-200"}),jsxRuntime.jsx(v,{variant:"icon",slot:"next",className:"pr-0",children:e==="rtl"?jsxRuntime.jsx(b,{name:"CaretLeft","aria-hidden":true,size:o}):jsxRuntime.jsx(b,{name:"CaretRight","aria-hidden":true,size:o})})]})}function yo(){return jsxRuntime.jsx(reactAriaComponents.CalendarGridHeader,{children:e=>jsxRuntime.jsx(reactAriaComponents.CalendarHeaderCell,{className:"text-xs font-semibold text-text-caption",children:e})})}function Ft({label:e,description:o,errorMessage:t,size:r="md",tooltip:n,isRequired:a,isDisabled:i,isInvalid:s,showCalendar:l=true,reserveErrorSpace:d=true,validationResult:u,className:c,...g}){let[f,p]=me.useState(false),N=R=>{g.onChange&&R&&g.onChange(R),p(false);};return jsxRuntime.jsxs(reactAriaComponents.DateField,{...g,isDisabled:i,isRequired:a,isInvalid:s,className:A(c,"flex flex-col gap-1"),children:[e&&jsxRuntime.jsx(z,{size:r,tooltip:n,isRequired:a,children:e}),jsxRuntime.jsx(X,{children:jsxRuntime.jsxs("div",{className:"relative w-full",children:[jsxRuntime.jsx(Fo,{size:r,isDisabled:i,isInvalid:s,hasCalendar:l}),l&&!i&&jsxRuntime.jsxs(reactAriaComponents.DialogTrigger,{isOpen:f,onOpenChange:p,children:[jsxRuntime.jsx(v,{variant:"unstyled",className:"absolute right-2 top-1/2 -translate-y-1/2 flex h-8 w-8 items-center justify-center rounded hover:bg-background-hover text-text-muted hover:text-text-body transition-colors","aria-label":"Open calendar",children:jsxRuntime.jsx(b,{name:"Calendar",size:18})}),jsxRuntime.jsx(reactAriaComponents.Popover,{className:"bg-background-surface rounded-lg border border-border-default shadow-xl",children:jsxRuntime.jsx(reactAriaComponents.Dialog,{className:"p-4 outline-none",children:jsxRuntime.jsx(yt,{value:g.value,onChange:N,minValue:g.minValue,maxValue:g.maxValue,isDisabled:i,isReadOnly:g.isReadOnly,isDateUnavailable:g.isDateUnavailable})})})]})]})}),d?jsxRuntime.jsx("div",{className:"mt-1 min-h-[20px]",children:typeof t=="string"?jsxRuntime.jsx(m,{size:r,children:t}):typeof t=="function"&&u?jsxRuntime.jsx(m,{size:r,children:t(u)}):o?jsxRuntime.jsx(S,{size:r,children:o}):null}):jsxRuntime.jsx(jsxRuntime.Fragment,{children:typeof t=="string"?jsxRuntime.jsx(m,{size:r,className:"mt-1",children:t}):typeof t=="function"&&u?jsxRuntime.jsx(m,{size:r,className:"mt-1",children:t(u)}):o?jsxRuntime.jsx(S,{size:r,className:"mt-1",children:o}):null})]})}function ja({isPlaceholder:e,isDisabled:o,size:t="md"}){return tailwindMerge.twMerge("inline-block box-content px-0.5 rounded outline-none tabular-nums text-center transition-colors",{sm:"text-xs",md:"text-sm",lg:"text-base",xl:"text-lg"}[t],e?"text-text-placeholder italic":"text-text-body",o?"text-text-disabled cursor-not-allowed":"cursor-text",!o&&"hover:bg-background-hover","data-[focused]:bg-background-selected data-[focused]:text-text-body")}function Fo({size:e="md",isDisabled:o,isInvalid:t,hasCalendar:r,className:n,...a}){return jsxRuntime.jsx(reactAriaComponents.DateInput,{className:tailwindMerge.twMerge(Fe({isInvalid:t,isDisabled:o}),"px-3 py-2 flex items-center gap-0.5 w-full",r&&"pr-10",n),...a,children:i=>jsxRuntime.jsx(reactAriaComponents.DateSegment,{segment:i,className:ja({isPlaceholder:i.isPlaceholder,isDisabled:!i.isEditable||o,size:e})})})}function pc({name:e,defaultValue:o,...t}){let{control:r,formState:n}=reactHookForm.useFormContext(),a=I(n.errors,e);return jsxRuntime.jsx(reactHookForm.Controller,{control:r,name:e,defaultValue:o,render:({field:i})=>jsxRuntime.jsx(Ft,{...t,value:i.value??null,onChange:s=>i.onChange(s),isInvalid:!!a,errorMessage:a})})}function Ct({value:e,onChange:o,onUrlChange:t,accept:r="image/*",maxSize:n,isDisabled:a=false,onUpload:i,className:s,showPreview:l=true,placeholder:d="Drop files here or click to browse"}){let[u,c]=me.useState(false),[g,f]=me.useState(false),[p,N]=me.useState(null),[R,x]=me.useState(e),P=me.useRef(null),F=async h=>{if(N(null),n&&h.size>n){N(`File size must be less than ${(n/1024/1024).toFixed(2)}MB`);return}if(l&&h.type.startsWith("image/")){let w=new FileReader;w.onloadend=()=>{x(w.result);},w.readAsDataURL(h);}if(i){f(true);try{let w=await i(h);x(w),t?.(w);}catch(w){N("Failed to upload file"),console.error("Upload error:",w);}finally{f(false);}}o?.(h,R);},L=h=>{let w=h.items;if(w.length>0){let Q=w[0];if(Q.kind==="file"){let j=Q.getAsFile();j&&F(j);}}c(false);},k=()=>{x(void 0),N(null),o?.(null),t?.(""),P.current&&(P.current.value="");};return jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("w-full",s),children:[jsxRuntime.jsxs(reactAriaComponents.DropZone,{className:tailwindMerge.twMerge("relative flex min-h-[200px] w-full flex-col items-center justify-center rounded-lg border-2 border-dashed transition-colors",u?"border-action-brand bg-action-brand/5":"border-border-muted hover:border-border-default",a&&"pointer-events-none opacity-50",p&&"border-feedback-error-border bg-feedback-error-background/50"),onDrop:L,onDropEnter:()=>c(true),onDropExit:()=>c(false),children:[R?jsxRuntime.jsxs("div",{className:"relative flex h-full w-full items-center justify-center p-4",children:[l&&R.startsWith("data:image")?jsxRuntime.jsx("img",{src:R,alt:"Preview",className:"max-h-48 max-w-full rounded-md object-contain"}):jsxRuntime.jsxs("div",{className:"flex flex-col items-center gap-2",children:[jsxRuntime.jsx(lucideReact.Image,{className:"h-12 w-12 text-text-muted"}),jsxRuntime.jsx("span",{className:"text-sm text-text-muted",children:"File uploaded"})]}),!a&&jsxRuntime.jsx(v,{variant:"icon",size:"sm",onPress:k,className:"absolute right-2 top-2 bg-background-surface shadow-md",children:jsxRuntime.jsx(lucideReact.X,{className:"h-4 w-4"})})]}):jsxRuntime.jsxs("div",{className:"flex flex-col items-center gap-4 p-6",children:[jsxRuntime.jsx(lucideReact.Upload,{className:"h-12 w-12 text-text-muted"}),jsxRuntime.jsxs("div",{className:"text-center",children:[jsxRuntime.jsx("p",{className:"text-sm text-text-body",children:d}),jsxRuntime.jsx("p",{className:"mt-1 text-xs text-text-muted",children:r==="image/*"?"PNG, JPG, GIF up to 10MB":`Accepts ${r}`})]}),jsxRuntime.jsx(reactAriaComponents.FileTrigger,{acceptedFileTypes:r.split(","),onSelect:h=>{let w=Array.from(h||[]);w.length>0&&F(w[0]);},children:jsxRuntime.jsx(v,{variant:"secondary",size:"sm",isDisabled:a,children:"Choose File"})})]}),g&&jsxRuntime.jsx("div",{className:"absolute inset-0 flex items-center justify-center rounded-lg bg-background-surface/80",children:jsxRuntime.jsxs("div",{className:"flex flex-col items-center gap-2",children:[jsxRuntime.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-2 border-action-brand border-t-transparent"}),jsxRuntime.jsx("span",{className:"text-sm text-text-muted",children:"Uploading..."})]})})]}),p&&jsxRuntime.jsx("p",{className:"mt-2 text-sm text-feedback-error-text",children:p})]})}function wc({name:e,defaultValue:o,errorBelow:t=true,...r}){let{control:n,formState:a}=reactHookForm.useFormContext(),i=I(a.errors,e);return jsxRuntime.jsx(reactHookForm.Controller,{control:n,name:e,defaultValue:o,render:({field:s})=>jsxRuntime.jsxs("div",{className:"flex flex-col gap-1",children:[jsxRuntime.jsx(Ct,{...r,value:s.value??"",onChange:(l,d)=>s.onChange(d||"")}),t&&i&&jsxRuntime.jsx(m,{children:i})]})})}var pn=e=>{let o=ee({isInvalid:e.isInvalid,isDisabled:e.isDisabled,isFocused:e.isFocused,transparent:e.transparent,size:e.size});return tailwindMerge.twMerge(o,"pr-9","[appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none",e.className)};function Nt({label:e,description:o,errorMessage:t,size:r="md",tooltip:n,isRequired:a,transparent:i,validationResult:s,reserveErrorSpace:l=true,...d}){let u=me.useId(),{isFocused:c,handleFocus:g,handleBlur:f}=de();return jsxRuntime.jsx(reactAriaComponents.NumberField,{...d,id:u,isRequired:a,className:A(d.className,"group flex flex-col gap-1"),step:d.step??1,onChange:p=>{typeof p=="number"&&(d.maxValue!=null&&p>d.maxValue?d.onChange?.(d.maxValue):d.minValue!=null&&p<d.minValue?d.onChange?.(d.minValue):d.onChange?.(p));},isInvalid:!!t||typeof d.value=="number"&&(d.maxValue!=null&&d.value>d.maxValue||d.minValue!=null&&d.value<d.minValue),children:({isDisabled:p,isInvalid:N})=>jsxRuntime.jsxs("div",{className:"flex flex-col",children:[e&&jsxRuntime.jsx(z,{size:r,tooltip:n,isRequired:a,htmlFor:u,children:e}),jsxRuntime.jsx("div",{className:"relative",children:jsxRuntime.jsxs(reactAriaComponents.Group,{className:"relative",children:[jsxRuntime.jsx(reactAriaComponents.Input,{onFocus:x=>g(x,d.onFocus),onBlur:x=>f(x,d.onBlur),className:pn({isInvalid:N||!!t,isDisabled:p,isFocused:c,transparent:i,size:r,className:typeof d.className=="string"?d.className:void 0})}),jsxRuntime.jsxs("div",{className:"absolute inset-y-[2px] right-[2px] flex flex-col divide-y divide-border-default border-l border-border-default overflow-hidden rounded-r-[calc(var(--control-border-radius)-2px)]",children:[jsxRuntime.jsx(reactAriaComponents.Button,{slot:"increment",isDisabled:p,className:"flex h-1/2 w-7 items-center justify-center bg-background-input hover:bg-background-input-hover active:bg-background-input-active disabled:cursor-not-allowed disabled:opacity-50",children:jsxRuntime.jsx(b,{name:"CaretUp",size:14})}),jsxRuntime.jsx(reactAriaComponents.Button,{slot:"decrement",isDisabled:p,className:"flex h-1/2 w-7 items-center justify-center bg-background-input hover:bg-background-input-hover active:bg-background-input-active disabled:cursor-not-allowed disabled:opacity-50",children:jsxRuntime.jsx(b,{name:"CaretDown",size:14})})]})]})}),l?jsxRuntime.jsx("div",{className:"mt-1 min-h-[20px]",children:t?jsxRuntime.jsx(m,{size:r,children:typeof t=="function"?t(s):t}):o?jsxRuntime.jsx(S,{size:r,children:o}):null}):jsxRuntime.jsx(jsxRuntime.Fragment,{children:t?jsxRuntime.jsx(m,{size:r,className:"mt-1",children:typeof t=="function"?t(s):t}):o?jsxRuntime.jsx(S,{size:r,className:"mt-1",children:o}):null})]})})}function jc({name:e,defaultValue:o,...t}){let{control:r,formState:n}=reactHookForm.useFormContext(),a=I(n.errors,e);return jsxRuntime.jsx(reactHookForm.Controller,{control:r,name:e,defaultValue:o,render:({field:i})=>jsxRuntime.jsx(Nt,{...t,value:typeof i.value=="number"?i.value:void 0,onChange:s=>i.onChange(s),isInvalid:!!a,errorMessage:a,isRequired:t.isRequired})})}var vn=me.createContext({variant:"brand"});function Tt(e){let{variant:o="default",...t}=e;return jsxRuntime.jsx(vn.Provider,{value:{variant:o},children:jsxRuntime.jsxs(reactAriaComponents.RadioGroup,{...t,className:A(e.className,"group flex flex-col gap-2"),children:[jsxRuntime.jsx(z,{children:e.label}),jsxRuntime.jsx("div",{className:"flex gap-2 group-orientation-horizontal:gap-4 group-orientation-vertical:flex-col",children:e.children}),e.description&&jsxRuntime.jsx(S,{children:e.description}),jsxRuntime.jsx(m,{children:typeof e.errorMessage=="function"&&e.validationResult?e.errorMessage(e.validationResult):typeof e.errorMessage=="string"?e.errorMessage:null})]})})}function bu({name:e,defaultValue:o,...t}){let{control:r,formState:n}=reactHookForm.useFormContext(),a=I(n.errors,e);return jsxRuntime.jsx(reactHookForm.Controller,{control:r,name:e,defaultValue:o,render:({field:i})=>jsxRuntime.jsx(Tt,{...t,value:i.value,onChange:s=>i.onChange(s),errorMessage:a,children:t.children})})}var Rn={xs:"text-lg font-semibold",sm:"text-xl font-semibold",md:"text-2xl font-semibold",lg:"text-3xl font-semibold",xl:"text-4xl font-semibold"},Sn={page:"h-16 leading-[62px]"};function Le({tag:e="h1",size:o="lg",height:t,className:r="",children:n}){let a=Rn[o],i=t?Sn[t]:"";return jsxRuntime.jsx(e,{className:tailwindMerge.twMerge(a,i,r),children:n})}var kt=({title:e,onClose:o,hideCloseIcon:t=false,titleAlign:r="left",hasBackArrow:n=false,onBack:a,headerContent:i})=>jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("relative flex h-16 w-full flex-shrink-0 items-center justify-between border-b px-6",e&&"border-b",r==="center"?"justify-center":""),children:[n&&jsxRuntime.jsx(v,{variant:"icon",onPress:a,className:"absolute left-6","aria-label":"Go back",children:jsxRuntime.jsx(b,{name:"CaretLeft","data-testid":"back-arrow"})}),i||jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[e&&jsxRuntime.jsx(Le,{size:"xs",children:e}),o&&!t&&jsxRuntime.jsx(v,{variant:"icon",onPress:o,"aria-label":"Close dialog",children:jsxRuntime.jsx(b,{name:"X","data-testid":"close-button"})})]})]});var Bn=e=>{let o=ee({isInvalid:e.isInvalid,isDisabled:e.isDisabled,isFocused:e.isFocused,transparent:e.transparent,size:e.size}),t=[e.showSearchIcon?"pl-8":"pl-3",e.isClearable&&e.hasValue||e.isPassword?"pr-8":"pr-3"].join(" ");return tailwindMerge.twMerge(o,t,e.className)};function Ae({label:e,description:o,errorMessage:t,size:r="md",tooltip:n,isRequired:a,transparent:i,showSearchIcon:s,isClearable:l,onClear:d,type:u,validationResult:c,reserveErrorSpace:g=true,...f}){let[p,N]=me__namespace.default.useState(false),{isFocused:R,handleFocus:x,handleBlur:P}=de(),F=u==="password";return jsxRuntime.jsx(reactAriaComponents.TextField,{...f,isRequired:a,className:A(f.className,"group flex flex-col"),children:({isDisabled:L,isInvalid:k})=>jsxRuntime.jsxs("div",{className:"flex flex-col",children:[e&&jsxRuntime.jsx(z,{size:r,tooltip:n,isRequired:a,children:e}),jsxRuntime.jsxs(X,{children:[s&&jsxRuntime.jsx("div",{className:"pointer-events-none absolute left-2 top-1/2 -translate-y-[calc(50%+1px)] transform",children:jsxRuntime.jsx(b,{name:"MagnifyingGlass",className:"h-4 w-4 text-text-muted"})}),jsxRuntime.jsx(Ge,{size:r,disabled:L,type:F?p?"text":"password":u,value:f.value,defaultValue:f.defaultValue,placeholder:f.placeholder,onFocus:h=>x(h,f.onFocus),onBlur:h=>P(h,f.onBlur),onChange:h=>f.onChange?.(h.target.value),className:Bn({isInvalid:k,isDisabled:L,isFocused:R,size:r,transparent:i,showSearchIcon:s,isClearable:l,hasValue:!!f.value,isPassword:F,className:typeof f.className=="string"?f.className:void 0})}),l&&f.value&&!L&&jsxRuntime.jsx(Qt,{onClick:()=>{d?d():f.onChange&&f.onChange("");},size:r}),F&&!L&&jsxRuntime.jsx("button",{type:"button",onClick:()=>N(!p),className:"absolute right-3 top-1/2 -translate-y-1/2 transform text-text-muted hover:text-text-body","aria-label":p?"Hide password":"Show password",onMouseDown:h=>{h.preventDefault(),h.stopPropagation();},children:jsxRuntime.jsx(b,{name:p?"EyeSlash":"Eye",size:r==="sm"?16:20,className:"text-text-body"})})]}),g?jsxRuntime.jsx("div",{className:"mt-1 min-h-[20px]",children:typeof t=="string"?jsxRuntime.jsx(m,{size:r,children:t}):typeof t=="function"&&c?jsxRuntime.jsx(m,{size:r,children:t(c)}):o?jsxRuntime.jsx(S,{size:r,children:o}):null}):jsxRuntime.jsx(jsxRuntime.Fragment,{children:typeof t=="string"?jsxRuntime.jsx(m,{size:r,className:"mt-1",children:t}):typeof t=="function"&&c?jsxRuntime.jsx(m,{size:r,className:"mt-1",children:t(c)}):o?jsxRuntime.jsx(S,{size:r,className:"mt-1",children:o}):null})]})})}var ge=({isActive:e=false,onPress:o,children:t})=>jsxRuntime.jsx(v,{variant:e?"secondary":"ghost",size:"sm",onPress:o,className:"p-1",children:t});function On({initialUrl:e,isOpen:o,onClose:t,onSubmit:r}){let[n,a]=me.useState(e);return me__namespace.default.useEffect(()=>{a(e);},[e]),jsxRuntime.jsx($e,{isDismissable:true,isOpen:o,onOpenChange:s=>!s&&t(),children:jsxRuntime.jsx(reactAriaComponents.Modal,{isDismissable:true,className:"flex items-center justify-center p-4",children:jsxRuntime.jsx(reactAriaComponents.Dialog,{className:"relative bg-background-surface rounded-lg shadow-xl max-w-md w-full",children:jsxRuntime.jsxs("form",{onSubmit:s=>{s.preventDefault(),r(n),t();},children:[jsxRuntime.jsx(kt,{title:"Insert Link",onClose:t}),jsxRuntime.jsx("div",{className:"p-6",children:jsxRuntime.jsx(Ae,{label:"URL",type:"url",value:n,onChange:a,autoFocus:true,className:"w-full"})}),jsxRuntime.jsxs("div",{className:"flex justify-end gap-2 border-t border-border-muted p-4",children:[jsxRuntime.jsx(v,{variant:"secondary",onPress:t,children:"Cancel"}),jsxRuntime.jsx(v,{type:"submit",children:"Save"})]})]})})})})}function It({initialContent:e="",onChange:o,className:t,isDisabled:r=false,placeholder:n="Start typing...",id:a}){let[i,s]=me.useState(false),l=react.useEditor({immediatelyRender:false,extensions:[zn__default.default.configure({heading:{levels:[1,2]}}),En__default.default.configure({openOnClick:false,HTMLAttributes:{class:"text-text-link-default hover:text-text-link-hover underline decoration-text-link-default/30 hover:decoration-text-link-hover cursor-pointer"}})],content:e,editable:!r,onUpdate:({editor:c})=>{o?.(c.getHTML());},editorProps:{attributes:{class:tailwindMerge.twMerge("prose prose-sm max-w-none","focus:outline-none","[&>*:first-child]:mt-0 [&>*:last-child]:mb-0")}}}),d=()=>{s(true);},u=c=>{c===""?l?.chain().focus().unsetLink().run():l?.chain().focus().setLink({href:c}).run();};return l?jsxRuntime.jsxs("div",{id:a,"data-richtexteditor":true,className:tailwindMerge.twMerge("flex flex-col rounded-md border border-border-input bg-background-input","outline-none focus-within:outline-none focus-within:border-border-input focus-within:ring-0 focus-within:shadow-none",r&&"opacity-50",t),style:{outline:"none"},children:[l&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(menus.BubbleMenu,{editor:l,shouldShow:({editor:c})=>c.isActive("link")&&!i,className:"flex items-center gap-1 rounded-md border border-border-input bg-background-surface p-1 shadow-md",children:[jsxRuntime.jsxs(v,{variant:"ghost",size:"sm",className:"h-8 px-2",onPress:()=>{let c=l.getAttributes("link").href;window.open(c,"_blank");},children:[jsxRuntime.jsx(b,{name:"ArrowSquareOut",className:"mr-1 h-4 w-4"}),"Open"]}),jsxRuntime.jsxs(v,{variant:"ghost",size:"sm",className:"h-8 px-2",onPress:d,children:[jsxRuntime.jsx(b,{name:"PencilSimple",className:"mr-1 h-4 w-4"}),"Edit"]}),jsxRuntime.jsxs(v,{variant:"ghost",size:"sm",className:"h-8 px-2",onPress:()=>l.chain().focus().unsetLink().run(),children:[jsxRuntime.jsx(b,{name:"X",className:"mr-1 h-4 w-4"}),"Remove"]})]}),jsxRuntime.jsx(On,{isOpen:i,onClose:()=>s(false),onSubmit:u,initialUrl:l.getAttributes("link").href||""})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-1 border-b border-border-input p-2",children:[jsxRuntime.jsx(ge,{isActive:l.isActive("heading",{level:1}),onPress:()=>l.chain().focus().toggleHeading({level:1}).run(),children:jsxRuntime.jsx("span",{className:"text-xs font-bold",children:"H1"})}),jsxRuntime.jsx(ge,{isActive:l.isActive("heading",{level:2}),onPress:()=>l.chain().focus().toggleHeading({level:2}).run(),children:jsxRuntime.jsx("span",{className:"text-xs font-bold",children:"H2"})}),jsxRuntime.jsx(ge,{isActive:l.isActive("bold"),onPress:()=>l.chain().focus().toggleBold().run(),children:jsxRuntime.jsx("span",{className:"text-xs font-bold",children:"B"})}),jsxRuntime.jsx(ge,{isActive:l.isActive("italic"),onPress:()=>l.chain().focus().toggleItalic().run(),children:jsxRuntime.jsx("span",{className:"text-xs italic",children:"I"})}),jsxRuntime.jsx("div",{className:"mx-1 h-4 w-px bg-border-muted"}),jsxRuntime.jsx(ge,{isActive:l.isActive("bulletList"),onPress:()=>l.chain().focus().toggleBulletList().run(),children:jsxRuntime.jsx(b,{name:"ListBullets",className:"h-4 w-4"})}),jsxRuntime.jsx(ge,{isActive:l.isActive("orderedList"),onPress:()=>l.chain().focus().toggleOrderedList().run(),children:jsxRuntime.jsx(b,{name:"ListNumbers",className:"h-4 w-4"})}),jsxRuntime.jsx("div",{className:"mx-1 h-4 w-px bg-border-muted"}),jsxRuntime.jsx(ge,{isActive:l.isActive("link"),onPress:d,children:jsxRuntime.jsx(b,{name:"PaperclipHorizontal",className:"h-4 w-4"})})]}),jsxRuntime.jsxs("div",{className:"relative min-h-[200px] w-full outline-none focus:outline-none",children:[jsxRuntime.jsx(react.EditorContent,{editor:l,className:tailwindMerge.twMerge("w-full p-4 outline-none focus:outline-none","[&_.ProseMirror]:min-h-[inherit]","[&_.ProseMirror]:outline-none [&_.ProseMirror]:focus:outline-none","[&_.ProseMirror_h1]:mb-4 [&_.ProseMirror_h1]:text-2xl [&_.ProseMirror_h1]:font-bold","[&_.ProseMirror_h2]:mb-3 [&_.ProseMirror_h2]:text-xl [&_.ProseMirror_h2]:font-semibold","[&_.ProseMirror_p]:mb-2","[&_.ProseMirror_ul]:mb-2 [&_.ProseMirror_ul]:ml-6 [&_.ProseMirror_ul]:list-disc","[&_.ProseMirror_ol]:mb-2 [&_.ProseMirror_ol]:ml-6 [&_.ProseMirror_ol]:list-decimal","[&_.ProseMirror_li]:mb-1","[&_.ProseMirror_blockquote]:border-l-4 [&_.ProseMirror_blockquote]:border-border-muted [&_.ProseMirror_blockquote]:pl-4 [&_.ProseMirror_blockquote]:italic","[&_.ProseMirror_code]:rounded [&_.ProseMirror_code]:bg-background-muted [&_.ProseMirror_code]:px-1 [&_.ProseMirror_code]:py-0.5 [&_.ProseMirror_code]:font-mono [&_.ProseMirror_code]:text-sm","[&_.ProseMirror_pre]:rounded-md [&_.ProseMirror_pre]:bg-background-muted [&_.ProseMirror_pre]:p-3 [&_.ProseMirror_pre]:font-mono [&_.ProseMirror_pre]:text-sm","[&_.ProseMirror_hr]:border-border-muted",r&&"pointer-events-none")}),l.isEmpty&&!r&&jsxRuntime.jsx("div",{className:"pointer-events-none absolute left-4 top-4 text-text-muted",children:n})]})]}):null}function sm({name:e,defaultValue:o,label:t,description:r,reserveErrorSpace:n=true,...a}){let{control:i,formState:s}=reactHookForm.useFormContext(),l=I(s.errors,e);return jsxRuntime.jsx(reactHookForm.Controller,{control:i,name:e,defaultValue:o,render:({field:d})=>jsxRuntime.jsxs("div",{className:"flex flex-col gap-1",children:[t&&jsxRuntime.jsx("label",{htmlFor:e,className:"text-sm font-medium text-text-heading",children:t}),r&&jsxRuntime.jsx("p",{className:"text-sm text-text-muted",children:r}),jsxRuntime.jsx(It,{...a,id:e,initialContent:d.value??"",onChange:u=>d.onChange(u)}),l&&jsxRuntime.jsx("p",{className:"text-sm text-feedback-error-text",children:l}),n&&!l&&jsxRuntime.jsx("div",{className:"h-5"})]})})}function xm({name:e,defaultValue:o,...t}){let{control:r,formState:n}=reactHookForm.useFormContext(),a=I(n.errors,e);return jsxRuntime.jsx(reactHookForm.Controller,{control:r,name:e,defaultValue:o,render:({field:i})=>jsxRuntime.jsx(dt,{...t,selectedKey:i.value??null,onSelectionChange:s=>i.onChange(s),showErrors:!!a,errorMessage:a})})}var Bt={sm:{track:"h-4 w-7",handle:"h-3.5 w-3.5",text:"text-xs"},md:{track:"h-5 w-9",handle:"h-4 w-4",text:"text-sm"},lg:{track:"h-6 w-11",handle:"h-5 w-5",text:"text-base"},xl:{track:"h-7 w-14",handle:"h-6 w-6",text:"text-lg"}};function Xn({isSelected:e,isDisabled:o,variant:t="default",size:r="md"}){let n="flex px-px items-center shrink-0 cursor-default rounded-full transition duration-200 ease-in-out shadow-inner border border-transparent",a=Bt[r].track,i=pe,s=t==="brand"?"focus-visible:outline-action-brand":"focus-visible:outline-action-default",l="";return e?t==="brand"?l="bg-action-brand forced-colors:!bg-[Highlight] group-pressed:bg-action-brand-hover":l="bg-action-default forced-colors:!bg-[Highlight] group-pressed:bg-action-default-hover":l="bg-gray-400 dark:bg-zinc-400 group-pressed:bg-gray-500 dark:group-pressed:bg-zinc-300",[n,a,i,s,l,o?"bg-gray-200 dark:bg-zinc-700 forced-colors:group-selected:!bg-[GrayText] forced-colors:border-[GrayText]":""].filter(Boolean).join(" ")}function Yn({isSelected:e,isDisabled:o,size:t="md"}){let r="transform rounded-full bg-white dark:bg-zinc-900 outline-none shadow transition duration-200 ease-in-out",n=Bt[t].handle;return [r,n,e?"translate-x-[100%]":"translate-x-0",o?"forced-colors:outline-[GrayText]":""].filter(Boolean).join(" ")}function Vt({children:e,variant:o="default",size:t="md",...r}){return jsxRuntime.jsx(reactAriaComponents.Switch,{...r,className:A(r.className,`group flex items-center gap-2 ${Bt[t].text} text-gray-800 transition disabled:text-gray-300 dark:text-zinc-200 dark:disabled:text-zinc-600 forced-colors:disabled:text-[GrayText]`),children:n=>jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:Xn({...n,variant:o,size:t}),children:jsxRuntime.jsx("span",{className:Yn({...n,size:t})})}),e]})})}function km({name:e,defaultValue:o,...t}){let{control:r}=reactHookForm.useFormContext();return jsxRuntime.jsx(reactHookForm.Controller,{control:r,name:e,defaultValue:o,render:({field:n})=>jsxRuntime.jsx(Vt,{...t,isSelected:!!n.value,onChange:a=>n.onChange(a),children:t.children})})}var ri=e=>{let o=ee({isInvalid:e.isInvalid,isDisabled:e.isDisabled,isFocused:e.isFocused,transparent:e.transparent,size:e.size}),t=`min-h-[100px] py-2 ${e.isDisabled?"resize-none":e.isResizable?"resize-y":"resize-none"}`;return tailwindMerge.twMerge(o,t,e.className)};function Et({label:e,description:o,errorMessage:t,size:r="md",tooltip:n,required:a,transparent:i,isInvalid:s,isDisabled:l,isResizable:d=false,className:u,validationResult:c,reserveErrorSpace:g=true,...f}){let{isFocused:p,handleFocus:N,handleBlur:R}=de();return jsxRuntime.jsx("div",{className:"group flex flex-col",children:jsxRuntime.jsxs("div",{className:"flex flex-col",children:[e&&jsxRuntime.jsx(z,{size:r,tooltip:n,isRequired:a,children:e}),jsxRuntime.jsx(X,{children:jsxRuntime.jsx("textarea",{...f,required:a,onFocus:x=>{f.onFocus&&f.onFocus(x),N(x);},onBlur:x=>{f.onBlur&&f.onBlur(x),R(x);},className:ri({isInvalid:s,isDisabled:l,isResizable:d,isFocused:p,size:r,transparent:i,className:u}),disabled:l})}),g?jsxRuntime.jsx("div",{className:"mt-1 min-h-[20px]",children:typeof t=="string"?jsxRuntime.jsx(m,{size:r,children:t}):typeof t=="function"&&c?jsxRuntime.jsx(m,{size:r,children:t(c)}):o?jsxRuntime.jsx(S,{size:r,children:o}):null}):jsxRuntime.jsx(jsxRuntime.Fragment,{children:typeof t=="string"?jsxRuntime.jsx(m,{size:r,className:"mt-1",children:t}):typeof t=="function"&&c?jsxRuntime.jsx(m,{size:r,className:"mt-1",children:t(c)}):o?jsxRuntime.jsx(S,{size:r,className:"mt-1",children:o}):null})]})})}function Gm({name:e,defaultValue:o,...t}){let{control:r,formState:n}=reactHookForm.useFormContext(),a=I(n.errors,e);return jsxRuntime.jsx(reactHookForm.Controller,{control:r,name:e,defaultValue:o,render:({field:i})=>jsxRuntime.jsx(Et,{...t,value:i.value??"",onChange:s=>i.onChange(s.target.value),onBlur:s=>{i.onBlur(),t.onBlur?.(s);},isInvalid:!!a,errorMessage:a,required:t.required})})}function Um({name:e,defaultValue:o,...t}){let{control:r,formState:n}=reactHookForm.useFormContext(),a=I(n.errors,e);return jsxRuntime.jsx(reactHookForm.Controller,{control:r,name:e,defaultValue:o,render:({field:i})=>jsxRuntime.jsx(Ae,{...t,value:i.value??"",onChange:s=>i.onChange(s),onBlur:s=>{i.onBlur(),t.onBlur?.(s);},isInvalid:!!a,errorMessage:a,isRequired:t.isRequired})})}function pi({isPlaceholder:e,isDisabled:o,size:t="md"}){return tailwindMerge.twMerge("inline-block box-content px-0.5 rounded outline-none tabular-nums text-center transition-colors",{sm:"text-xs",md:"text-sm",lg:"text-base",xl:"text-lg"}[t],e?"text-text-placeholder italic":"text-text-body",o?"text-text-disabled cursor-not-allowed":"cursor-text",!o&&"hover:bg-background-hover","data-[focused]:bg-background-selected data-[focused]:text-text-body")}function Lt({label:e,description:o,errorMessage:t,size:r="md",tooltip:n,isRequired:a,isDisabled:i,isInvalid:s,reserveErrorSpace:l=true,validationResult:d,className:u,...c}){return jsxRuntime.jsxs(reactAriaComponents.TimeField,{...c,isDisabled:i,isRequired:a,isInvalid:s,className:A(u,"flex flex-col gap-1"),children:[e&&jsxRuntime.jsx(z,{size:r,tooltip:n,isRequired:a,children:e}),jsxRuntime.jsx(X,{children:jsxRuntime.jsx(reactAriaComponents.DateInput,{className:tailwindMerge.twMerge(Fe({isInvalid:s,isDisabled:i}),"px-3 py-2 flex items-center gap-0.5 w-full"),children:g=>jsxRuntime.jsx(reactAriaComponents.DateSegment,{segment:g,className:pi({isPlaceholder:g.isPlaceholder,isDisabled:!g.isEditable||i,size:r})})})}),l?jsxRuntime.jsx("div",{className:"mt-1 min-h-[20px]",children:typeof t=="string"?jsxRuntime.jsx(m,{size:r,children:t}):typeof t=="function"&&d?jsxRuntime.jsx(m,{size:r,children:t(d)}):o?jsxRuntime.jsx(S,{size:r,children:o}):null}):jsxRuntime.jsx(jsxRuntime.Fragment,{children:typeof t=="string"?jsxRuntime.jsx(m,{size:r,className:"mt-1",children:t}):typeof t=="function"&&d?jsxRuntime.jsx(m,{size:r,className:"mt-1",children:t(d)}):o?jsxRuntime.jsx(S,{size:r,className:"mt-1",children:o}):null})]})}function pp({name:e,...o}){let{control:t,formState:{errors:r}}=reactHookForm.useFormContext(),n=r[e],a=n?.message;return jsxRuntime.jsx(reactHookForm.Controller,{name:e,control:t,render:({field:i})=>jsxRuntime.jsx(Lt,{...o,value:i.value,onChange:i.onChange,isInvalid:!!n,errorMessage:a})})}function hp({className:e,title:o="Please fix the following errors:",autoFocus:t=true}){let{formState:r}=reactHookForm.useFormContext(),n=me__namespace.useRef(null),a=r.errors,i=Object.entries(a||{}),s=i.length>0;if(me__namespace.useEffect(()=>{t&&s&&n.current?.focus();},[t,s]),!s)return null;let l=d=>{let u=`[name="${CSS.escape(d)}"]`,c=document.querySelector(u);c&&(c.focus(),c.scrollIntoView({block:"center",behavior:"smooth"}));};return jsxRuntime.jsxs("div",{ref:n,role:"alert",tabIndex:-1,className:tailwindMerge.twMerge("rounded-md border border-feedback-error-border bg-feedback-error-background p-3 text-sm text-feedback-error-text",e),children:[jsxRuntime.jsx("div",{className:"font-medium",children:o}),jsxRuntime.jsx("ul",{className:"mt-2 list-disc pl-5",children:i.map(([d,u])=>{let c=u?.message||"Invalid value";return jsxRuntime.jsx("li",{children:jsxRuntime.jsx("button",{type:"button",className:"underline underline-offset-2",onClick:()=>l(d),children:c})},d)})})]})}function Cp({formId:e,disableWhenInvalid:o,disableWhenPristine:t,isDisabled:r,children:n,...a}){let{formState:i}=reactHookForm.useFormContext(),s=r||i.isSubmitting||o&&!i.isValid||t&&!i.isDirty;return jsxRuntime.jsx(v,{type:"submit",form:e,isDisabled:s,...a,children:n})}var te=({width:e,height:o,variant:t="rect",animation:r="pulse",gradient:n=false,flex:a=false,stack:i,responsive:s,delay:l=0,adjustAnimationSpeedBasedOnWidth:d=false,ariaLabel:u,className:c,"data-testid":g})=>{let[f,p]=me.useState(l===0);if(me.useEffect(()=>{if(l>0){let k=setTimeout(()=>p(true),l);return ()=>clearTimeout(k)}},[l]),!f)return null;let N=n?"bg-gradient-to-r from-[var(--color-skeleton-base)] via-[var(--color-skeleton-highlight)] to-[var(--color-skeleton-base)]":"bg-[var(--color-skeleton-base)]",R=d&&e?(()=>{let k=typeof e=="number"?e:parseFloat(String(e));return isNaN(k)?"":`animation-duration-[${Math.max(.8,k/100)}s]`})():"",x=r==="pulse"?`animate-pulse ${R}`:r==="wave"?`relative overflow-hidden before:absolute before:inset-0 before:bg-gradient-to-r before:from-transparent before:via-[var(--color-skeleton-wave)] before:to-transparent before:animate-wave ${R}`:"",P="rounded-sm";t==="circle"&&(P="rounded-full"),t==="text"&&(P="h-4 w-full rounded-sm");let F=a?"flex-1 min-w-0":"",L=s?Object.entries(s).map(([k,h])=>`${k}:w-[${h}]`).join(" "):"";return i?jsxRuntime.jsx("div",{className:"space-y-2","data-testid":g,children:i.map((k,h)=>jsxRuntime.jsx("div",{className:tailwindMerge.twMerge(N,x,P,F,L,c),style:{width:k,height:o}},h))}):jsxRuntime.jsx("div",{className:tailwindMerge.twMerge(N,x,P,F,L,c),style:{width:e,height:o},role:"presentation","aria-hidden":!u,"aria-label":u??void 0,"data-testid":g})};var Si={outlined:"bg-background-surface border border-border-default",elevated:"bg-background-surface border-0 shadow-md",filled:"bg-background-muted border-0",ghost:"bg-transparent border-0 shadow-none"},Ni="rounded-lg",At={square:"aspect-square",video:"aspect-video",wide:"aspect-[2/1]",auto:""},Ti={start:"justify-start",end:"justify-end",center:"justify-center",between:"justify-between"};function he({variant:e="outlined",className:o,children:t,isLoading:r=false}){return jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("w-full overflow-hidden",Si[e],Ni,o),"data-testid":"card",children:r?jsxRuntime.jsx(te,{width:"100%",height:"100%",className:"rounded-none"}):t})}function Ue({title:e,subtitle:o,actions:t,className:r,isLoading:n=false}){return n?jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("p-6 pb-4",r),children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-start mb-1",children:[jsxRuntime.jsx(te,{width:120,height:20}),jsxRuntime.jsx(te,{width:24,height:24})]}),o&&jsxRuntime.jsx(te,{width:200,height:16})]}):!e&&!o&&!t?null:jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("p-6 pb-4",r),children:jsxRuntime.jsxs("div",{className:"flex justify-between items-start gap-4",children:[jsxRuntime.jsxs("div",{className:"min-w-0 flex-1",children:[e&&jsxRuntime.jsx("div",{className:"mb-1",children:typeof e=="string"?jsxRuntime.jsx(Le,{tag:"h3",size:"sm",className:"text-text-heading",children:e}):e}),o&&jsxRuntime.jsx("div",{className:"text-sm text-text-muted",children:o})]}),t&&jsxRuntime.jsx("div",{className:"flex-shrink-0",children:t})]})})}function zo({src:e,alt:o,aspectRatio:t="auto",className:r,children:n,isLoading:a=false}){return a?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("bg-background-muted",At[t],r),children:jsxRuntime.jsx(te,{width:"100%",height:"100%"})}):n?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("overflow-hidden",At[t],r),children:n}):e?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("overflow-hidden",At[t],r),children:jsxRuntime.jsx("img",{src:e,alt:o||"",className:"w-full h-full object-cover",loading:"lazy"})}):null}function je({className:e,children:o,isLoading:t=false}){let n=e?.match(/p(?:t|b|l|r|x|y)?-(?:\d+(?:\.\d+)?|px|\[.+?\])/)?"":"px-6 py-4";return t?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge(n,e),children:jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx(te,{width:"100%",height:16}),jsxRuntime.jsx(te,{width:"80%",height:16}),jsxRuntime.jsx(te,{width:"60%",height:16})]})}):o?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("px-6 py-4 text-text-body",e),children:o}):null}function Mo({className:e,children:o,align:t="end",isLoading:r=false}){return r?jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("px-6 py-4 flex gap-2 justify-end",e),children:[jsxRuntime.jsx(te,{width:80,height:32}),jsxRuntime.jsx(te,{width:60,height:32})]}):o?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("px-6 py-4 flex items-center gap-2",Ti[t],e),children:o}):null}he.Header=Ue;he.Media=zo;he.Content=je;he.Footer=Mo;function Gp({name:e,getItemTitle:o,renderItem:t,onAdd:r}){let{control:n}=reactHookForm.useFormContext(),{fields:a,append:i,remove:s,swap:l}=reactHookForm.useFieldArray({control:n,name:e});return jsxRuntime.jsxs("div",{className:"flex flex-col gap-3",children:[a.map((d,u)=>jsxRuntime.jsxs(he,{children:[jsxRuntime.jsx(Ue,{title:o?o(u):`Item ${u+1}`,actions:jsxRuntime.jsxs("div",{className:"flex gap-2",children:[u>0&&jsxRuntime.jsx(v,{size:"sm",variant:"secondary",onPress:()=>l(u,u-1),children:"Up"}),u<a.length-1&&jsxRuntime.jsx(v,{size:"sm",variant:"secondary",onPress:()=>l(u,u+1),children:"Down"}),jsxRuntime.jsx(v,{size:"sm",variant:"secondary",onPress:()=>s(u),children:"Remove"})]})}),jsxRuntime.jsx(je,{children:t(u)})]},d.id)),jsxRuntime.jsx("div",{children:jsxRuntime.jsx(v,{variant:"secondary",onPress:()=>i(r?.()||{}),children:"Add item"})})]})}function Mt(e){return jsxRuntime.jsx(reactAriaComponents.Form,{validationBehavior:"aria",...e,className:tailwindMerge.twMerge("flex flex-col gap-6",e.className)})}function Ho(e){let o=e.querySelector("[aria-invalid='true'], .aria-invalid, [data-invalid='true']")||e.querySelector("input[aria-invalid='true'], select[aria-invalid='true'], textarea[aria-invalid='true']")||e.querySelector("input, select, textarea");o&&(o.focus({preventScroll:false}),o instanceof HTMLElement&&o.scrollIntoView({block:"center",behavior:"smooth"}));}function tf({id:e,onSubmit:o,onInvalid:t,children:r,shouldFocusError:n=true,className:a,...i}){let s=reactHookForm.useForm(i),l=(d,u)=>{if(n&&e){let c=document.getElementById(e);c&&Ho(c);}t?.(d,u);};return jsxRuntime.jsx(reactHookForm.FormProvider,{...s,children:jsxRuntime.jsx(Mt,{id:e,className:a,onSubmit:s.handleSubmit(o,l),children:r})})}function qo({formId:e,show:o,isSubmitting:t,onCancel:r,primaryLabel:n="Save changes",secondaryLabel:a="Cancel",className:i}){return o?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("fixed inset-x-0 bottom-0 z-40 border-t border-border-muted bg-background-surface/95 backdrop-blur supports-[backdrop-filter]:bg-background-surface/70",i),children:jsxRuntime.jsxs("div",{className:"mx-auto flex max-w-screen-lg items-center justify-between gap-3 p-3",children:[jsxRuntime.jsx("div",{className:"text-sm text-text-muted",children:"You have unsaved changes"}),jsxRuntime.jsxs("div",{className:"flex gap-2",children:[jsxRuntime.jsx(v,{variant:"secondary",onPress:r,children:a}),jsxRuntime.jsx(v,{type:"submit",form:e,isDisabled:!!t,children:t?"Saving...":n})]})]})}):null}function uf({formId:e,onCancel:o,primaryLabel:t,secondaryLabel:r,className:n}){let{formState:a}=reactHookForm.useFormContext();return jsxRuntime.jsx(qo,{formId:e,show:a.isDirty,isSubmitting:a.isSubmitting,onCancel:o,primaryLabel:t,secondaryLabel:r,className:n})}function bf(e=true){let{formState:o}=reactHookForm.useFormContext();me__namespace.useEffect(()=>{if(!e||!o.isSubmitted||!o.errors||Object.keys(o.errors).length===0)return;let t=document.querySelector("[aria-invalid='true'], .aria-invalid, [data-invalid='true']")||document.querySelector("input[aria-invalid='true'], select[aria-invalid='true'], textarea[aria-invalid='true']");t&&t.scrollIntoView({block:"center",behavior:"smooth"});},[e,o.isSubmitted,o.errors]);}function hf({delayMs:e=800,onAutoSave:o}){let{watch:t,formState:r,getValues:n}=reactHookForm.useFormContext(),a=me__namespace.useRef(void 0);me__namespace.useEffect(()=>{let i=t(()=>{r.isDirty&&(a.current&&window.clearTimeout(a.current),a.current=window.setTimeout(async()=>{let s=n();await o(s);},e));});return ()=>{i.unsubscribe(),a.current&&window.clearTimeout(a.current);}},[t,r.isDirty,n,e,o]);}exports.ErrorSummary=hp;exports.FieldArrayList=Gp;exports.FormAutocomplete=Ul;exports.FormCheckbox=cd;exports.FormCheckboxGroup=xd;exports.FormColorField=Ed;exports.FormDateField=pc;exports.FormFileUpload=wc;exports.FormNumberField=jc;exports.FormProvider=tf;exports.FormRadioGroup=bu;exports.FormRichTextEditor=sm;exports.FormSaveBar=uf;exports.FormSelect=xm;exports.FormSwitch=km;exports.FormTextArea=Gm;exports.FormTextField=Um;exports.FormTimeField=pp;exports.SubmitButton=Cp;exports.focusFirstError=Ho;exports.useAutoSave=hf;exports.useScrollIntoViewOnError=bf;//# sourceMappingURL=index.cjs.map
2
2
  //# sourceMappingURL=index.cjs.map