@texturehq/edges 5.10.0 → 5.11.0
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.
- package/dist/form/index.cjs +1 -1
- package/dist/form/index.cjs.map +1 -1
- package/dist/form/index.js +1 -1
- package/dist/form/index.js.map +1 -1
- package/dist/index.cjs +7 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -1
- package/dist/index.d.ts +6 -1
- package/dist/index.js +7 -7
- package/dist/index.js.map +1 -1
- package/dist/rhf/index.cjs +2 -2
- package/dist/rhf/index.cjs.map +1 -1
- package/dist/rhf/index.js +2 -2
- package/dist/rhf/index.js.map +1 -1
- package/dist/server.cjs.map +1 -1
- package/dist/server.js.map +1 -1
- package/package.json +1 -1
package/dist/rhf/index.cjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
'use strict';var reactHookForm=require('react-hook-form'),Pt=require('react'),reactAria=require('react-aria'),reactAriaComponents=require('react-aria-components'),reactStately=require('react-stately'),tailwindMerge=require('tailwind-merge'),Jo=require('@phosphor-icons/react'),jsxRuntime=require('react/jsx-runtime'),lucideReact=require('lucide-react'),reactColorful=require('react-colorful'),el=require('@tiptap/extension-link'),react=require('@tiptap/react'),menus=require('@tiptap/react/menus'),nl=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 Pt__namespace=/*#__PURE__*/_interopNamespace(Pt);var Jo__namespace=/*#__PURE__*/_interopNamespace(Jo);var el__default=/*#__PURE__*/_interopDefault(el);var nl__default=/*#__PURE__*/_interopDefault(nl);var mn=Object.defineProperty;var fn=(e,o,t)=>o in e?mn(e,o,{enumerable:true,configurable:true,writable:true,value:t}):e[o]=t;var Xt=(e,o,t)=>fn(e,typeof o!="symbol"?o+"":o,t);function Je(e,o=false){let[t,r]=Pt.useState(o);return Pt.useEffect(()=>{if(typeof window>"u")return;let n=window.matchMedia(e);r(n.matches);let i=a=>{r(a.matches);};return n.addEventListener("change",i),()=>{n.removeEventListener("change",i);}},[e]),t}var pt={sm:"640px",md:"768px",lg:"1024px",xl:"1280px","2xl":"1536px"};function Nt(e="base"){let o=Je(`(min-width: ${pt.sm})`,e!=="base"),t=Je(`(min-width: ${pt.md})`,["md","lg","xl","2xl"].includes(e)),r=Je(`(min-width: ${pt.lg})`,["lg","xl","2xl"].includes(e)),n=Je(`(min-width: ${pt.xl})`,["xl","2xl"].includes(e)),i=Je(`(min-width: ${pt["2xl"]})`,e==="2xl"),a=!t,s=t,l="base";return i?l="2xl":n?l="xl":r?l="lg":t?l="md":o&&(l="sm"),{current:l,isSm:o,isMd:t,isLg:r,isXl:n,is2Xl:i,isMobile:a,isDesktop:s}}function Ko(e,o=300){let[t,r]=Pt.useState(e);return Pt.useEffect(()=>{let n=setTimeout(()=>r(e),o);return ()=>clearTimeout(n)},[e,o]),t}function wt(e,o=300){let[t,r]=Pt.useState(false);return Pt.useEffect(()=>{if(e){let n=setTimeout(()=>{r(true);},o);return ()=>clearTimeout(n)}r(false);},[e,o]),t}function It(...e){return e.filter(Boolean).join(" ")}var Ie={displayXl:"text-display-xl",displayLg:"text-display-lg",displayMd:"text-display-md",displaySm:"text-display-sm",headingXl:"text-heading-xl",headingLg:"text-heading-lg",headingMd:"text-heading-md",headingSm:"text-heading-sm",bodyLg:"text-body-lg",bodyMd:"text-body-md",bodySm:"text-body-sm",labelLg:"text-label-lg",labelMd:"text-label-md",labelSm:"text-label-sm",code:"text-code",agent:"text-agent"};function Yo(e,...o){return It(Ie[e],...o)}function We(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 Y(e,o){return reactAriaComponents.composeRenderProps(e,t=>tailwindMerge.twMerge(o,t))}var O={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)]"}};function te(e,o){let t=Pt.forwardRef(({size:r=24,color:n="currentColor",className:i,mirrored:a,alt:s,...l},c)=>{let u=!!s||"aria-label"in l;return jsxRuntime.jsx("svg",{ref:c,xmlns:"http://www.w3.org/2000/svg",width:r,height:r,viewBox:"0 0 256 256",fill:n,className:i,transform:a?"scale(-1, 1)":void 0,"aria-hidden":u?void 0:true,role:u?"img":void 0,"aria-label":s,...l,children:o})});return t.displayName=e,t}var Et=()=>jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("path",{d:"M12 128h44M200 128h44",fill:"none",stroke:"currentColor",strokeWidth:"16",strokeLinecap:"round"}),jsxRuntime.jsx("circle",{cx:"76",cy:"128",r:"20",fill:"none",stroke:"currentColor",strokeWidth:"16"}),jsxRuntime.jsx("circle",{cx:"180",cy:"128",r:"20",fill:"none",stroke:"currentColor",strokeWidth:"16"})]}),jo=()=>jsxRuntime.jsx("path",{d:"M166 120 88 70",fill:"none",stroke:"currentColor",strokeWidth:"16",strokeLinecap:"round"}),Qo=()=>jsxRuntime.jsx("path",{d:"M162 122 92 128",fill:"none",stroke:"currentColor",strokeWidth:"16",strokeLinecap:"round"}),Xo=()=>jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("path",{d:"M112 85.7 A32 32 0 1 1 144 85.7",fill:"none",stroke:"currentColor",strokeWidth:"16",strokeLinecap:"round"}),jsxRuntime.jsx("circle",{cx:"128",cy:"58",r:"8",fill:"currentColor",stroke:"none"})]}),Sn=te("TextureRecloser",jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("rect",{x:"36",y:"36",width:"184",height:"184",fill:"none",stroke:"currentColor",strokeWidth:"16"}),jsxRuntime.jsx("text",{x:"128",y:"126",textAnchor:"middle",dominantBaseline:"central",fontFamily:"ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif",fontSize:"140",fontWeight:"700",fill:"currentColor",stroke:"none",children:"R"})]})),kn=te("TextureFuse",jsxRuntime.jsx("path",{d:"M20 128h72q18 -84 36 0q18 84 36 0h72",fill:"none",stroke:"currentColor",strokeWidth:"16",strokeLinecap:"round",strokeLinejoin:"round"})),Tn=te("TextureBreaker",jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("rect",{x:"36",y:"36",width:"184",height:"184",fill:"none",stroke:"currentColor",strokeWidth:"16"}),jsxRuntime.jsx("text",{x:"128",y:"126",textAnchor:"middle",dominantBaseline:"central",fontFamily:"ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif",fontSize:"140",fontWeight:"700",fill:"currentColor",stroke:"none",children:"B"})]})),Nn=te("TextureSource",jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("path",{d:"M4 128h40M212 128h40",fill:"none",stroke:"currentColor",strokeWidth:"16",strokeLinecap:"round"}),jsxRuntime.jsx("circle",{cx:"128",cy:"128",r:"84",fill:"none",stroke:"currentColor",strokeWidth:"16"}),jsxRuntime.jsx("path",{d:"M92 128q18 -84 36 0q18 84 36 0",fill:"none",stroke:"currentColor",strokeWidth:"16",strokeLinecap:"round",strokeLinejoin:"round"})]})),wn=te("TextureCapacitor",jsxRuntime.jsx(jsxRuntime.Fragment,{children:jsxRuntime.jsx("path",{d:"M4 128h106M146 128h106M110 72v112M146 72v112",fill:"none",stroke:"currentColor",strokeWidth:"16",strokeLinecap:"round"})})),In=te("TextureRegulator",jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("circle",{cx:"128",cy:"128",r:"92",fill:"none",stroke:"currentColor",strokeWidth:"16"}),jsxRuntime.jsx("text",{x:"128",y:"126",textAnchor:"middle",dominantBaseline:"central",fontFamily:"ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif",fontSize:"128",fontWeight:"700",fill:"currentColor",stroke:"none",children:"V"})]})),En=te("TextureSwitch",jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Et,{}),jsxRuntime.jsx(jo,{})]})),Vn=te("TextureSwitchClosed",jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Et,{}),jsxRuntime.jsx(Qo,{})]})),Ln=te("TextureOpenPoint",jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("path",{d:"M112 52 C 74 92, 74 164, 112 204",fill:"none",stroke:"currentColor",strokeWidth:"18",strokeLinecap:"round"}),jsxRuntime.jsx("path",{d:"M144 52 C 182 92, 182 164, 144 204",fill:"none",stroke:"currentColor",strokeWidth:"18",strokeLinecap:"round"})]})),Bn=te("TextureSectionalizerOpen",jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Et,{}),jsxRuntime.jsx(jo,{}),jsxRuntime.jsx(Xo,{})]})),Mn=te("TextureSectionalizerClosed",jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Et,{}),jsxRuntime.jsx(Qo,{}),jsxRuntime.jsx(Xo,{})]})),Dn=te("TextureTransformer",jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("path",{d:"M40 64H88A22 22 0 0 1 88 108A22 22 0 0 1 88 152A22 22 0 0 1 88 196H40",fill:"none",stroke:"currentColor",strokeWidth:"16",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx("path",{d:"M216 64H168A22 22 0 0 0 168 108A22 22 0 0 0 168 152A22 22 0 0 0 168 196H216",fill:"none",stroke:"currentColor",strokeWidth:"16",strokeLinecap:"round",strokeLinejoin:"round"})]})),Ze={1:[128],2:[110,146],3:[92,128,164]},Jt=e=>jsxRuntime.jsx("path",{d:`M24 ${e}h208`,fill:"none",stroke:"currentColor",strokeWidth:"16",strokeLinecap:"round"},e),Zt=e=>jsxRuntime.jsx("path",{d:`M24 ${e}h208`,fill:"none",stroke:"currentColor",strokeWidth:"16",strokeLinecap:"round",pathLength:100,strokeDasharray:"20 20"},e),An=te("TextureSinglePhaseOverheadLine",jsxRuntime.jsx(jsxRuntime.Fragment,{children:Ze[1].map(Jt)})),_n=te("TextureTwoPhaseOverheadLine",jsxRuntime.jsx(jsxRuntime.Fragment,{children:Ze[2].map(Jt)})),zn=te("TextureThreePhaseOverheadLine",jsxRuntime.jsx(jsxRuntime.Fragment,{children:Ze[3].map(Jt)})),Hn=te("TextureSinglePhaseUndergroundLine",jsxRuntime.jsx(jsxRuntime.Fragment,{children:Ze[1].map(Zt)})),On=te("TextureTwoPhaseUndergroundLine",jsxRuntime.jsx(jsxRuntime.Fragment,{children:Ze[2].map(Zt)})),$n=te("TextureThreePhaseUndergroundLine",jsxRuntime.jsx(jsxRuntime.Fragment,{children:Ze[3].map(Zt)})),Gn=te("TextureSupportStructure",jsxRuntime.jsx("circle",{cx:"128",cy:"128",r:"40",fill:"currentColor",stroke:"none"})),Vt={TextureRecloser:Sn,TextureFuse:kn,TextureBreaker:Tn,TextureSource:Nn,TextureCapacitor:wn,TextureRegulator:In,TextureSwitch:En,TextureSwitchClosed:Vn,TextureOpenPoint:Ln,TextureSectionalizerOpen:Bn,TextureSectionalizerClosed:Mn,TextureTransformer:Dn,TextureSinglePhaseOverheadLine:An,TextureTwoPhaseOverheadLine:_n,TextureThreePhaseOverheadLine:zn,TextureSinglePhaseUndergroundLine:Hn,TextureTwoPhaseUndergroundLine:On,TextureThreePhaseUndergroundLine:$n,TextureSupportStructure:Gn};if(process.env.NODE_ENV==="development")for(let e of Object.keys(Vt))e in Jo__namespace&&console.error(`Custom icon "${e}" collides with a Phosphor icon of the same name. Rename it (use the "Texture" prefix) to keep the icon namespace unambiguous.`);var et={xs:16,sm:20,md:24,lg:32,xl:40,"2xl":48},y=Pt.memo(({name:e,size:o="md",color:t,weight:r="regular",className:n,ariaLabel:i,...a})=>{let s=Vt[e]??Jo__namespace[e];if(!s)return process.env.NODE_ENV==="development"&&console.error(`Icon "${e}" not found in @phosphor-icons/react or the custom icon registry`),null;let l=typeof o=="string"&&o in et?et[o]:o,c=tailwindMerge.twMerge("inline-block flex-shrink-0",!t&&"text-current",n);return jsxRuntime.jsx(s,{...a,size:l,color:t,weight:r,className:c,"aria-label":i||`${e} icon`,"data-testid":`icon-${e}`})});y.displayName="Icon";var Wn=Pt.memo(({variant:e="subtle",shape:o="square",containerSize:t,containerClassName:r,size:n="md",className:i,name:a,color:s,weight:l,ariaLabel:c,ref:u,...d})=>{let b=typeof n=="string"&&n in et?et[n]:n,v=t?typeof t=="string"&&t in et?et[t]:t:b*1.75,m=tailwindMerge.twMerge("inline-flex items-center justify-center flex-shrink-0",o==="circle"?"rounded-full":"rounded-lg",e==="subtle"&&"bg-background-muted",e==="solid"&&"bg-action-brand text-[color:var(--color-action-brand-text)]",e==="outline"&&"border-2 border-current",r);return jsxRuntime.jsx("div",{className:m,style:{width:v,height:v},children:jsxRuntime.jsx(y,{...d,name:a,size:n,color:s,weight:l,className:i,ariaLabel:c})})});Wn.displayName="IconWithContainer";var jn=({isEntering:e,isExiting:o,className:t})=>["max-w-[200px] group bg-action-default border border-action-default-hover text-[color:var(--color-action-default-text)] text-sm rounded-lg drop-shadow-lg will-change-transform px-3 py-1",e?"animate-in fade-in placement-bottom:slide-in-from-top-0.5 placement-top:slide-in-from-bottom-0.5 placement-left:slide-in-from-right-0.5 placement-right:slide-in-from-left-0.5 ease-out duration-200":"",o?"animate-out fade-out placement-bottom:slide-out-to-top-0.5 placement-top:slide-out-to-bottom-0.5 placement-left:slide-out-to-right-0.5 placement-right:slide-out-to-left-0.5 ease-in duration-150":"",t].filter(Boolean).join(" ");function or({children:e,content:o,...t}){return jsxRuntime.jsxs(reactAriaComponents.TooltipTrigger,{delay:200,children:[e,jsxRuntime.jsxs(reactAriaComponents.Tooltip,{...t,offset:10,className:reactAriaComponents.composeRenderProps(t.className,(r,n)=>jn({...n,className:r})),children:[jsxRuntime.jsx(reactAriaComponents.OverlayArrow,{children:jsxRuntime.jsx("svg",{width:8,height:8,viewBox:"0 0 8 8",className:"fill-action-default stroke-action-default-hover 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 L4 4 L8 0"})})}),o]})]})}function Ee(){let[e,o]=Pt__namespace.default.useState(false),t=Pt__namespace.default.useCallback((n,i)=>{o(true),i?.(n);},[]),r=Pt__namespace.default.useCallback((n,i)=>{o(false),i?.(n);},[]);return {isFocused:e,handleFocus:t,handleBlur:r}}var ae=Pt__namespace.default.forwardRef(({children:e,className:o},t)=>jsxRuntime.jsx("div",{ref:t,className:tailwindMerge.twMerge("relative w-full",o),children:e}));ae.displayName="InputWrapper";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-[48%] -translate-y-1/2 transform text-text-secondary hover:text-text-primary cursor-pointer",t),"aria-label":"Clear input",onMouseDown:r=>{r.preventDefault(),r.stopPropagation();},children:jsxRuntime.jsx(y,{name:"X",size:o==="sm"?16:20})})}function ft(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 Qn(e){return e.isDisabled?"bg-background-muted":e.transparent?"bg-transparent":"bg-background-input"}function Xn(e){return e==="sm"?"!text-base md:!text-[length:var(--control-text-sm)]":e==="md"?"!text-base md:!text-[length:var(--control-text-md)]":""}function pe(e){let{isInvalid:o,isDisabled:t,isFocused:r,transparent:n,size:i="md",className:a}=e;return tailwindMerge.twMerge("w-full",ft({isInvalid:o,isDisabled:t,isFocused:r}),Qn({transparent:n,isDisabled:t}),O[i].text,O[i].height,O[i].padding,Xn(i),a)}function q({children:e,size:o="md",tooltip:t,description:r,descriptionPlacement:n="below",isRequired:i,className:a,htmlFor:s}){let l=t||r&&n==="tooltip",c=t||r,u=r&&n==="inline",d=jsxRuntime.jsxs("label",{htmlFor:s,className:tailwindMerge.twMerge(O[o].text,"!text-text-label font-semibold flex items-center gap-1",a),children:[e,i&&jsxRuntime.jsx("span",{children:"*"}),l&&jsxRuntime.jsx("span",{className:"inline-flex items-center text-text-secondary",children:jsxRuntime.jsx(y,{name:"Info",size:o==="sm"?16:20})}),u&&jsxRuntime.jsx("span",{className:"text-text-secondary font-normal ml-1",children:r})]});return l&&c?jsxRuntime.jsx(or,{content:c,children:d}):d}function N({size:e="md",className:o,children:t,...r}){return jsxRuntime.jsx("div",{...r,className:tailwindMerge.twMerge("leading-[2.25] text-text-secondary",O[e].text,o),children:t})}function g({children:e,size:o="md",className:t}){return jsxRuntime.jsx("div",{role:"alert",className:tailwindMerge.twMerge(O[o].text,"text-feedback-error-text",t),children:e})}function Bt({size:e="md",isInvalid:o,isDisabled:t,isFocused:r,transparent:n,className:i,...a}){return jsxRuntime.jsx("input",{className:pe({isInvalid:o,isDisabled:t,isFocused:r,transparent:n,size:e,className:i}),...a})}var ta="flex font-medium justify-center items-center gap-2 text-center transition rounded-[var(--control-border-radius)] whitespace-nowrap box-border",oa="bg-action-primary text-[color:var(--color-action-primary-text)] hover:bg-action-primary-hover forced-colors:bg-[ButtonText] forced-colors:text-[ButtonFace] border-2 border-transparent",ra={primary:oa,secondary:"bg-action-secondary text-[color:var(--color-action-secondary-text)] border-2 border-border-muted hover:bg-action-secondary-hover forced-colors:border-[ButtonBorder] forced-colors:bg-[ButtonFace] forced-colors:text-[ButtonText]",ghost:"border-none text-text-primary hover:bg-text-primary/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-primary hover:text-action-primary/90 hover:underline hover:decoration-2 hover:underline-offset-4",icon:"border-none text-text-primary hover:bg-background-hover hover:text-text-primary forced-colors:text-[ButtonText] forced-colors:hover:bg-[ButtonFace] p-1 flex-shrink-0 rounded-[var(--control-border-radius)]",unstyled:"bg-transparent"},nr={full:"w-full",default:"w-fit"},na="opacity-50 cursor-not-allowed pointer-events-none",aa="opacity-100 cursor-pointer",ia={"top-right":"-right-2 -top-2","top-left":"-left-2 -top-2","bottom-right":"-right-2 -bottom-2","bottom-left":"-left-2 -bottom-2"},sa={primary:"bg-action-primary text-[color:var(--color-action-primary-text)]",destructive:"bg-feedback-error-border text-text-inverse"};function la(e){return !e||e==="default"||e==="brand"?"primary":e}function da(e){let{variant:o="primary",size:t="md",isDisabled:r,fullWidth:n=false,isLoading:i=false}=e,a=la(o),s=a==="unstyled"?"":`${ta} ${ra[a]}`;a!=="unstyled"&&(s+=` ${O[t].text} ${O[t].height} ${O[t].padding} ${O[t].gap}`),r||i?s+=` ${na}`:s+=` ${aa}`,n?s+=` ${nr.full}`:s+=` ${nr.default}`;let l=a==="primary"?"focus-visible:outline-action-primary":void 0;return [s,We(),l].filter(Boolean).join(" ")}function k(e){let{icon:o,children:t,isLoading:r=false,loadingText:n,loadingIndicator:i,size:a="md",iconPosition:s="left",iconWeight:l,href:c,className:u,badgeNumber:d,badgeVariant:b="primary",badgePosition:v="top-right",style:m,target:f,rel:h,...C}=e,R=o?jsxRuntime.jsx(y,{name:o,size:a,weight:l}):null,A=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[s==="left"&&R,typeof t=="function"?null:t,s==="right"&&R]}),M=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:i||jsxRuntime.jsx(y,{name:"CircleNotch",size:a,className:"animate-spin","aria-hidden":"true"})}),jsxRuntime.jsx("div",{className:"invisible","aria-hidden":"true",children:A}),n&&jsxRuntime.jsx("span",{className:"sr-only",role:"status","aria-live":"polite",children:n})]}),L=(d??0)>0,T=tailwindMerge.twMerge(da(e),u),w=c?{href:c,target:f,rel:h,...C}:{};if(c){let{onPress:I,onPressStart:se,onPressEnd:H,onPressChange:me,onPressUp:J,onAuxClick:K,onContextMenu:fe,onDoubleClick:$,...F}=C;Object.assign(w,F);}let X=c?jsxRuntime.jsx(reactAriaComponents.Link,{...w,...r&&{"aria-busy":true},style:L?void 0:m,className:T,children:r?M:typeof t=="function"?(function(I){return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[s==="left"&&R,t(I),s==="right"&&R]})}):A}):jsxRuntime.jsx(reactAriaComponents.Button,{...C,...r&&{"aria-busy":true},style:L?void 0:m,className:T,children:r?M:typeof t=="function"?(function(I){return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[s==="left"&&R,t(I),s==="right"&&R]})}):A});return L?jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("relative flex",u),style:m,children:[X,jsxRuntime.jsx("span",{className:`absolute ${ia[v]} flex h-5 w-5 items-center justify-center rounded-full ${sa[b]} text-xs font-medium`,"aria-label":`${d} items`,children:d})]}):X}function qe({transparent:e=false,className:o,children:t,...r}){return jsxRuntime.jsx(reactAriaComponents.ModalOverlay,{...r,className:reactAriaComponents.composeRenderProps(o,(n,i)=>tailwindMerge.twMerge("fixed inset-0 z-50","outline-none focus:outline-none focus-visible:outline-none ring-0 focus:ring-0 focus-visible:ring-0",e?"bg-transparent":["bg-gradient-to-br from-background-modal/20 via-background-modal/15 to-background-modal/20","backdrop-blur-[2px]","supports-[backdrop-filter]:bg-background-modal/15"].join(" "),i.isEntering&&["animate-in fade-in","duration-300 ease-out"].join(" "),i.isExiting&&["animate-out fade-out","duration-200 ease-in"].join(" "),n)),children:t})}function va({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(" "),i=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(" "):"",a=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,i,a,t].filter(Boolean).join(" ")}function ot({children:e,showArrow:o=false,withBackdrop:t=false,className:r,isDismissable:n=true,disableGroup:i=false,...a}){let l=reactAriaComponents.useSlottedContext(reactAriaComponents.PopoverContext)?.trigger==="SubmenuTrigger",c=o?12:8;c=l?c-6:c;let u=jsxRuntime.jsxs(reactAriaComponents.Popover,{offset:c,...a,className:reactAriaComponents.composeRenderProps(r,(d,b)=>va({...b,className:d,disableGroup:i})),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(qe,{isDismissable:n,children:jsxRuntime.jsx(reactAriaComponents.Modal,{className:"outline-none focus:outline-none focus-visible:outline-none ring-0 focus:ring-0 focus-visible:ring-0",isDismissable:n,children:u})}):u}function ar(e=true){let[o,t]=Pt.useState(null);return Pt.useEffect(()=>{if(!e){t(null);return}let r=typeof window<"u"?window.visualViewport:null;if(!r)return;let n=()=>{let i=Math.max(0,window.innerHeight-r.height-(r.offsetTop??0));t({height:r.height,keyboardOffset:i});};return n(),r.addEventListener("resize",n),r.addEventListener("scroll",n),()=>{r.removeEventListener("resize",n),r.removeEventListener("scroll",n);}},[e]),o}function ro({action:e,defaultVariant:o,defaultSize:t="lg"}){let r=!!e.formId;return jsxRuntime.jsx(k,{type:r?"submit":"button",form:r?e.formId:void 0,size:e.size||t,variant:e.variant||o,onPress:r?void 0:e.onPress,isLoading:e.isLoading,isDisabled:e.isDisabled,children:e.label})}function ao({primaryAction:e,secondaryAction:o,tertiaryAction:t,footerContent:r}){let n=e||o||t;return !n&&!r?null:jsxRuntime.jsxs("div",{className:`flex w-full flex-col items-center justify-center border-t p-4 ${r?"h-28":""}`,children:[r&&jsxRuntime.jsx("div",{className:"flex h-10 justify-center",children:r}),n&&jsxRuntime.jsxs("div",{className:"flex w-full items-center justify-between gap-3",children:[jsxRuntime.jsx("div",{children:t&&jsxRuntime.jsx(ro,{action:t,defaultVariant:"destructive"})}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[o&&jsxRuntime.jsx(ro,{action:o,defaultVariant:"secondary"}),e&&jsxRuntime.jsx(ro,{action:e,defaultVariant:"primary"})]})]})]})}var Fa={heading:{sm:Ie.headingSm,md:Ie.headingMd,lg:Ie.headingLg,xl:Ie.headingXl},display:{sm:Ie.displaySm,md:Ie.displayMd,lg:Ie.displayLg,xl:Ie.displayXl}},Sa={page:"h-16 leading-[62px]"};function xt({tag:e="h1",variant:o="heading",size:t="lg",height:r,className:n="",children:i}){let a=t==="xs"?"sm":t,s=Fa[o][a],l=r?Sa[r]:"";return jsxRuntime.jsx(e,{className:It(s,"text-text-primary",l,n),children:i})}var nt=({title:e,onClose:o,hideCloseIcon:t=false,titleAlign:r="left",hasBackArrow:n=false,onBack:i,headerContent:a})=>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(k,{variant:"icon",onPress:i,className:"absolute left-6","aria-label":"Go back",children:jsxRuntime.jsx(y,{name:"CaretLeft","data-testid":"back-arrow"})}),a||jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[e&&jsxRuntime.jsx(xt,{size:"xs",children:e}),o&&!t&&jsxRuntime.jsx(k,{variant:"icon",onPress:o,"aria-label":"Close dialog",children:jsxRuntime.jsx(y,{name:"X","data-testid":"close-button"})})]})]});var Ia=Pt.createContext(false);function sr({children:e}){return jsxRuntime.jsx(Ia.Provider,{value:true,children:e})}var ke=({width:e,height:o,variant:t="rect",animation:r="pulse",gradient:n=false,flex:i=false,stack:a,responsive:s,delay:l=0,adjustAnimationSpeedBasedOnWidth:c=false,ariaLabel:u,className:d,"data-testid":b})=>{let[v,m]=Pt.useState(l===0);if(Pt.useEffect(()=>{if(l>0){let L=setTimeout(()=>m(true),l);return ()=>clearTimeout(L)}},[l]),!v)return null;let f=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)]",h=c&&e?(()=>{let L=typeof e=="number"?e:parseFloat(String(e));return isNaN(L)?"":`animation-duration-[${Math.max(.8,L/100)}s]`})():"",C=r==="pulse"?`animate-pulse ${h}`: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 ${h}`:"",R="rounded-sm";t==="circle"&&(R="rounded-full"),t==="text"&&(R="h-4 w-full rounded-sm");let A=i?"flex-1 min-w-0":"",M=s?Object.entries(s).map(([L,T])=>`${L}:w-[${T}]`).join(" "):"";return a?jsxRuntime.jsx("div",{className:"space-y-2","data-testid":b,children:a.map((L,T)=>jsxRuntime.jsx("div",{className:tailwindMerge.twMerge(f,C,R,A,M,d),style:{width:L,height:o}},T))}):jsxRuntime.jsx("div",{className:tailwindMerge.twMerge(f,C,R,A,M,d),style:{width:e,height:o},role:"presentation","aria-hidden":!u,"aria-label":u??void 0,"data-testid":b})};var Ba={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"},Ma="rounded-lg",so={square:"aspect-square",video:"aspect-video",wide:"aspect-[2/1]",auto:""},Da={start:"justify-start",end:"justify-end",center:"justify-center",between:"justify-between"};function Aa(e){return Pt__namespace.default.Children.toArray(e).some(o=>Pt__namespace.default.isValidElement(o)&&o.type===yt&&!!o.props.title)}function Te({variant:e="outlined",className:o,children:t,isLoading:r=false,layout:n="default"}){let i=Aa(t)?jsxRuntime.jsx(sr,{children:t}):t;return jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("w-full overflow-hidden",Ba[e],Ma,n==="flex"&&"flex flex-col",o),"data-testid":"card",children:r?jsxRuntime.jsx(ke,{width:"100%",height:"100%",className:"rounded-none"}):i})}function yt({title:e,subtitle:o,actions:t,leading:r,className:n,isLoading:i=false}){return i?jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("p-6 pb-4",n),children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-start mb-1",children:[jsxRuntime.jsx(ke,{width:120,height:20}),jsxRuntime.jsx(ke,{width:24,height:24})]}),o&&jsxRuntime.jsx(ke,{width:200,height:16})]}):!e&&!o&&!t&&!r?null:jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("p-6 pb-4",n),children:jsxRuntime.jsxs("div",{className:"flex justify-between items-start gap-4",children:[r&&jsxRuntime.jsx("div",{className:"flex-shrink-0",children:r}),jsxRuntime.jsxs("div",{className:"min-w-0 flex-1",children:[e&&jsxRuntime.jsx("div",{className:"mb-1",children:typeof e=="string"?jsxRuntime.jsx(xt,{tag:"h3",size:"sm",className:"text-text-primary",children:e}):e}),o&&jsxRuntime.jsx("div",{className:Yo("bodySm","text-text-secondary"),children:o})]}),t&&jsxRuntime.jsx("div",{className:"flex-shrink-0",children:t})]})})}function cr({src:e,alt:o,aspectRatio:t="auto",className:r,children:n,isLoading:i=false}){return i?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("bg-background-muted",so[t],r),children:jsxRuntime.jsx(ke,{width:"100%",height:"100%"})}):n?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("overflow-hidden",so[t],r),children:n}):e?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("overflow-hidden",so[t],r),children:jsxRuntime.jsx("img",{src:e,alt:o||"",className:"w-full h-full object-cover",loading:"lazy"})}):null}function Mt({className:e,children:o,isLoading:t=false,fill:r=false,style:n}){let a=e?.match(/p(?:t|b|l|r|x|y)?-(?:\d+(?:\.\d+)?|px|\[.+?\])/)?"":"px-6 py-4";return t?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge(a,r&&"flex-1 flex flex-col min-h-0",e),style:n,children:jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx(ke,{width:"100%",height:16}),jsxRuntime.jsx(ke,{width:"80%",height:16}),jsxRuntime.jsx(ke,{width:"60%",height:16})]})}):o?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge(a,"text-text-primary",r&&"flex-1 flex flex-col min-h-0",e),style:n,children:o}):null}function ur({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(ke,{width:80,height:32}),jsxRuntime.jsx(ke,{width:60,height:32})]}):o?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("px-6 py-4 flex items-center gap-2",Da[t],e),children:o}):null}Te.Header=yt;Te.Media=cr;Te.Content=Mt;Te.Footer=ur;var vt=class extends Pt.Component{constructor(){super(...arguments);Xt(this,"state",{hasError:false});Xt(this,"handleRetry",()=>{this.setState({hasError:false,error:void 0}),typeof window<"u"&&window.location.reload();});}static getDerivedStateFromError(t){return {hasError:true,error:t}}componentDidCatch(t,r){console.error("Error Boundary caught an error:",t,r);}render(){return this.state.hasError?this.props.fallback?this.props.fallback:jsxRuntime.jsxs(Te,{children:[this.props.title&&jsxRuntime.jsx(Te.Header,{title:this.props.title}),jsxRuntime.jsx(Te.Content,{children:jsxRuntime.jsxs("div",{className:"flex flex-col items-center justify-center gap-4","data-testid":"error-boundary",children:[jsxRuntime.jsx("p",{className:"text-feedback-error-text",children:this.state.error?.message||"Something went wrong"}),jsxRuntime.jsx("button",{className:"rounded bg-action-default px-4 py-2 text-[color:var(--color-action-default-text)] hover:bg-action-default-hover",onClick:this.handleRetry,children:"Retry"})]})})]}):this.props.children}};var Oa=.3,$a=.5;function it({children:e,title:o,headerContent:t,titleAlign:r="left",hideCloseIcon:n=false,hasBackArrow:i=false,onBack:a,isOpen:s,onClose:l,isDismissable:c=true,transparentOverlay:u=false,primaryAction:d,secondaryAction:b,footerContent:v,maxHeight:m="80vh",height:f,maxWidth:h="640px",contentPadding:C=true,showHandle:R=true,animationVariant:A="scale",className:M}){let[L,T]=Pt.useState(false),[w,X]=Pt.useState(0),[I,se]=Pt.useState(false),H=ar(s),me=H?.height??null,J=H?.keyboardOffset??0,K=Pt.useRef(null),fe=Pt.useRef(null),$=Pt.useRef(null),F=Pt.useRef({isDragging:false,startY:0,startTime:0,pointerId:null});Pt.useEffect(()=>{if(s){let x=setTimeout(()=>{T(true),setTimeout(()=>T(false),600);},400);return ()=>clearTimeout(x)}},[s]),Pt.useEffect(()=>{s||(X(0),se(false),F.current={isDragging:false,startY:0,startTime:0,pointerId:null});},[s]),Pt.useEffect(()=>{let x=fe.current;if(!x||!s)return;let Q=null,G=Z=>{let ve=Z.target;ve&&["INPUT","TEXTAREA","SELECT"].includes(ve.tagName)&&(Q&&clearTimeout(Q),Q=setTimeout(()=>{ve.scrollIntoView({block:"nearest",behavior:"smooth"});},320));};return x.addEventListener("focusin",G),()=>{x.removeEventListener("focusin",G),Q&&clearTimeout(Q);}},[s]);let oe=Pt.useCallback(x=>{c&&(x.pointerType!=="touch"&&x.pointerType!=="pen"||($.current&&(clearTimeout($.current),$.current=null),F.current={isDragging:true,startY:x.clientY,startTime:Date.now(),pointerId:x.pointerId},se(false),x.currentTarget.setPointerCapture(x.pointerId)));},[c]),we=Pt.useCallback(x=>{let{isDragging:Q,startY:G,pointerId:Z}=F.current;if(!Q||x.pointerId!==Z)return;let ve=x.clientY-G;X(Math.max(0,ve));},[]),le=Pt.useCallback(x=>{let{isDragging:Q,startY:G,startTime:Z,pointerId:ve}=F.current;if(!Q||x.pointerId!==ve)return;let S=x.clientY-G,Fe=Date.now()-Z,De=S/Fe;F.current={isDragging:false,startY:0,startTime:0,pointerId:null};let Ae=(K.current?.getBoundingClientRect().height??0)*Oa;(S>Ae||De>$a&&S>50)&&c?(l?.(),X(0)):(se(true),X(0),$.current=setTimeout(()=>{se(false),$.current=null;},200));},[c,l]);if(!s)return null;let de=o||t,ue=d||b||v;return jsxRuntime.jsx(vt,{children:jsxRuntime.jsx(qe,{isOpen:s,onOpenChange:x=>{x||l?.();},isDismissable:c,transparent:u,style:{paddingBottom:J>0?`${J}px`:void 0,transition:"padding-bottom 0.25s ease-out"},className:"flex items-end justify-center p-0 sm:p-4",children:jsxRuntime.jsx(reactAriaComponents.Modal,{className:"w-full max-w-full p-0 sm:p-2 outline-none focus:outline-none focus-visible:outline-none ring-0 focus:ring-0 focus-visible:ring-0",isDismissable:c,children:jsxRuntime.jsx("div",{ref:K,className:tailwindMerge.twMerge("w-full",I&&"transition-transform duration-200"),style:{transform:w>0?`translateY(${w}px)`:void 0},children:jsxRuntime.jsxs(reactAriaComponents.Dialog,{className:tailwindMerge.twMerge("relative flex w-full flex-col overflow-hidden","bg-background-surface","shadow-2xl shadow-black/30 dark:shadow-black/60","border-t border-x border-border-default/40","outline-none focus:outline-none focus-visible:outline-none ring-0 focus:ring-0 focus-visible:ring-0 focus:shadow-none","origin-bottom",A==="scale"?"animate-[tray-enter-scale_400ms_cubic-bezier(0.32,0.72,0,1)]":"animate-[tray-enter_400ms_cubic-bezier(0.32,0.72,0,1)]",A==="scale"?"data-[exiting]:animate-[tray-exit-scale_250ms_cubic-bezier(0.32,0,0.67,0)]":"data-[exiting]:animate-[tray-exit_250ms_cubic-bezier(0.32,0,0.67,0)]",M),style:{maxWidth:h,...f?{height:f}:{maxHeight:/\d/.test(m)?me!==null?`min(${m}, ${Math.max(me-8,0)}px, 100dvh)`:`min(${m}, 100dvh)`:m}},children:[R&&jsxRuntime.jsx("div",{className:"absolute top-0 left-0 right-0 h-8 z-10 flex justify-center items-start pt-2 touch-none cursor-grab active:cursor-grabbing",onPointerDown:oe,onPointerMove:we,onPointerUp:le,onPointerCancel:le,children:jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("h-1 w-12 rounded-full bg-border-muted transition-all duration-300","hover:bg-border-default hover:w-16",L&&"animate-[handle-wiggle_0.6s_ease-in-out]")})}),de&&(i?jsxRuntime.jsx(nt,{title:o,headerContent:t,titleAlign:r,hideCloseIcon:n||!l,hasBackArrow:true,onBack:a??(()=>{}),onClose:l||(()=>{})}):jsxRuntime.jsx(nt,{title:o,headerContent:t,titleAlign:r,hideCloseIcon:n||!l,onClose:l||(()=>{})})),jsxRuntime.jsx("div",{ref:fe,className:tailwindMerge.twMerge("flex-1 min-h-0 overflow-y-auto overscroll-contain",C?"p-4":"p-0"),children:e}),ue&&jsxRuntime.jsx(ao,{primaryAction:d,secondaryAction:b,footerContent:v})]})})})})})}it.displayName="Tray";var bo=Pt.createContext("md");function xr(){return Pt.useContext(bo)}function mo(e="md"){let o=e==="sm"?"!text-base md:!text-[length:var(--control-text-sm)]":e==="md"?"!text-base md:!text-[length:var(--control-text-md)]":"";return `flex-1 text-start data-[placeholder]:text-text-disabled overflow-hidden text-ellipsis whitespace-nowrap ${O[e].text} ${o}`}function Ya(){let e=Pt__namespace.default.useCallback((t,r)=>{r?.(t);},[]),o=Pt__namespace.default.useCallback((t,r)=>{r?.(t);},[]);return {handleFocus:e,handleBlur:o}}function xo({label:e,description:o,errorMessage:t,children:r,items:n,renderItem:i,renderSelectedValue:a,size:s="md",selectedKey:l,defaultSelectedKey:c,onSelectionChange:u,placeholder:d,showErrors:b=false,tooltip:v,isRequired:m,transparent:f,reserveErrorSpace:h=false,placement:C="bottom start",shouldFlip:R=true,menuWidth:A="match",descriptionPlacement:M="below",useMobileTray:L=true,...T}){let[w,X]=Pt.useState(null),[I,se]=Pt.useState(null),[H,me]=Pt.useState(false),J=l??w??c,{handleFocus:K,handleBlur:fe}=Ya(),{isMobile:$}=Nt(),F=L&&$,oe=Pt__namespace.default.useMemo(()=>!a||!J||!n?null:Array.from(n).find(Q=>Q.id===J)??null,[a,J,n]),we=x=>{u&&x!==null&&u(x),u||X(x);},le=Pt.useRef(null),de=Pt.useRef(null),ue=()=>{F&&me(!H);};return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(reactAriaComponents.Select,{...T,selectedKey:J,defaultSelectedKey:c,onSelectionChange:we,placeholder:d,className:Y(T.className,"group flex w-full flex-col"),ref:le,onOpenChange:x=>{F||(x&&de.current?se(de.current.offsetWidth):x||le.current?.blur());},children:({isDisabled:x,isInvalid:Q,isOpen:G})=>jsxRuntime.jsxs("div",{className:"flex flex-col",children:[e&&jsxRuntime.jsx(q,{size:s,tooltip:v,description:M==="tooltip"||M==="inline"?o:void 0,descriptionPlacement:M,isRequired:m,children:e}),jsxRuntime.jsx(ae,{children:jsxRuntime.jsx("div",{ref:de,children:jsxRuntime.jsxs(k,{variant:"unstyled",className:tailwindMerge.twMerge(pe({isInvalid:Q||b&&!!t,isDisabled:x,isFocused:F?H:G,transparent:f,size:s}),"flex items-center text-start gap-4 cursor-pointer pl-[var(--control-padding-sm)]"),onFocus:Z=>K(Z,T.onFocus),onBlur:Z=>fe(Z,T.onBlur),onPress:F?ue:void 0,"data-open":F?H:G,children:[a&&oe?jsxRuntime.jsx("div",{className:mo(s),children:a(oe)}):F&&J?jsxRuntime.jsx("div",{className:mo(s),children:n?Array.from(n).find(S=>S.id===J)?.label:String(J)}):jsxRuntime.jsx(reactAriaComponents.SelectValue,{className:mo(s)}),jsxRuntime.jsx(y,{name:"CaretDown","aria-hidden":true,className:tailwindMerge.twMerge("h-4 w-4 text-text-primary group-disabled:text-text-disabled forced-colors:text-[ButtonText] transition-transform",(F?H:G)&&"rotate-180")})]})})}),h?jsxRuntime.jsx("div",{className:"mt-1 min-h-[20px]",children:b?jsxRuntime.jsx(g,{size:s,className:"text-feedback-error-text",children:typeof t=="function"&&T.validationResult?t(T.validationResult):typeof t=="string"?t:null}):o&&M==="below"?jsxRuntime.jsx(N,{size:s,children:o}):null}):jsxRuntime.jsx(jsxRuntime.Fragment,{children:b?jsxRuntime.jsx(g,{size:s,className:"mt-1 text-feedback-error-text",children:typeof t=="function"&&T.validationResult?t(T.validationResult):typeof t=="string"?t:null}):o&&M==="below"?jsxRuntime.jsx(N,{size:s,className:"mt-1",children:o}):null}),F?null:jsxRuntime.jsx(ot,{className:"bg-background-input shadow-xl border border-border-input/20 backdrop-blur-sm rounded-[var(--control-border-radius)]",style:{width:A==="match"&&I?`${I}px`:void 0,minWidth:A==="auto"&&I?`${I}px`:void 0,maxWidth:A==="auto"?"min(600px, 90vw)":void 0},placement:C,shouldFlip:R,children:jsxRuntime.jsx(bo.Provider,{value:"md",children:jsxRuntime.jsx(reactAriaComponents.ListBox,{items:n,className:"w-full max-h-[300px] overflow-auto bg-background-input p-0 outline-0",children:i&&n?Z=>jsxRuntime.jsx($e,{id:Z.id,textValue:Z.label,children:jsxRuntime.jsx("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap min-w-0 flex-1",children:i(Z)})},Z.id):r})})})]})}),F&&jsxRuntime.jsx(it,{isOpen:H,onClose:()=>me(false),title:e??"Select an option",contentPadding:false,children:jsxRuntime.jsx(bo.Provider,{value:"md",children:jsxRuntime.jsx(reactAriaComponents.ListBox,{items:n,className:"w-full bg-background-surface p-0 outline-0 [&_[role=option]]:border-b [&_[role=option]]:border-border-default [&_[role=option]:last-child]:border-0 [&_[role=option]]:!px-6 [&_[role=option]]:!py-4 [&_[role=option]]:rounded-none",selectionMode:"single",selectedKeys:J!=null?[J]:[],onSelectionChange:x=>{let Q=Array.from(x)[0];Q!=null&&(we(Q),me(false));},children:i&&n?x=>jsxRuntime.jsx($e,{id:x.id,textValue:x.label,children:jsxRuntime.jsx("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap min-w-0 flex-1",children:i(x)})},x.id):r})})})]})}function $e({size:e,className:o,...t}){let r=xr(),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-primary 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",O[n].paddingY,O[n].text,o)})}var Me=({className:e,size:o=24,color:t="text-action-brand"})=>jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("inline-block animate-spin rounded-full border-2 border-solid border-current border-r-transparent",t,e),style:{width:o,height:o},role:"status","aria-label":"loading",children:jsxRuntime.jsx("span",{className:"sr-only",children:"Loading..."})});var si=[],li={sm:"h-4 w-4",md:"h-5 w-5",lg:"h-6 w-6",xl:"h-7 w-7"},di={sm:"pl-8",md:"pl-10",lg:"pl-11",xl:"pl-13"},vr={sm:"py-1",md:"py-2",lg:"py-3",xl:"py-4"},yo=(e,o,t)=>{if(e==null||e==="")return "";let n=(t?t.flatMap(i=>i.items):o||[]).find(i=>i.id===e);return n?n.name:""};async function ci(e,o,t){try{let r=e.url.replace("{q}",o),n=new URLSearchParams;e.extraParams&&Object.entries(e.extraParams).forEach(([l,c])=>{n.append(l,c.toString());});let i=`${r}${n.toString()?"?"+n.toString():""}`,a=await fetch(i,{method:"GET",headers:e.headers,signal:t});if(!a.ok)throw new Error(`HTTP error! status: ${a.status}`);let s=await a.json();return {items:e.transformResponse(s)}}catch(r){if(r instanceof Error&&r.name==="AbortError")return {items:[]};console.error("Error in REST request:",r);let n=r instanceof Error?r.message:"Unknown error occurred";return {items:[],error:n}}}async function ui(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 i=await n.json();if(i.errors)throw new Error(i.errors[0]?.message||"GraphQL error occurred");return e.responsePath&&(i=e.responsePath.split(".").reduce((a,s)=>a?.[s],i)),{items:e.transformResponse(i)}}catch(r){if(r instanceof Error&&r.name==="AbortError")return {items:[]};console.error("Error in GraphQL request:",r);let n=r instanceof Error?r.message:"Unknown error occurred";return {items:[],error:n}}}function vo({label:e,staticItems:o=si,sections:t,selectedKey:r,defaultSelectedKey:n,onSelectionChange:i,requestConfig:a,defaultFilter:s,placeholder:l,errorMessage:c,description:u,size:d="md",tooltip:b,isRequired:v,isDisabled:m,isInvalid:f,validationResult:h,showErrors:C=true,renderItem:R,renderLeftIcon:A,renderSection:M,autoFocus:L=false,reserveErrorSpace:T=false,hideChevron:w=false,useMobileTray:X=true,className:I}){let se=Pt__namespace.default.useRef(null),H=Pt__namespace.default.useRef(null),[me,J]=Pt__namespace.default.useState(),[K,fe]=Pt.useState(()=>yo(r||n,o,t)),[$,F]=Pt.useState(false),[oe,we]=Pt.useState(false),le=Ko(K),{contains:de}=reactAria.useFilter({sensitivity:"base"}),[ue,x]=Pt.useState(),{isMobile:Q}=Nt(),G=X&&Q,Z=O[d].text,ve=reactStately.useAsyncList({async load({signal:V,filterText:D=""}){if(!a)return {items:[]};if(!a.url||a.shouldLoad&&!a.shouldLoad(D))return {items:[]};try{let re;return a.requestType==="GraphQL"?re=await ui(a,D,V):re=await ci(a,D,V),x(re.error),{items:re.items}}catch(re){return re instanceof Error&&re.name==="AbortError"?{items:[]}:(console.error("Error loading items:",re),x(re instanceof Error?re.message:"Unknown error occurred"),{items:[]})}},initialFilterText:""}),S=a&&le!==""?ve:null,Fe=false,De=Pt.useRef("");Pt.useEffect(()=>{L&&F(true);},[L]),Pt.useEffect(()=>{let V=yo(r,o,t);V!==K&&fe(V);},[r,o,t]),Pt.useEffect(()=>{let V=()=>{se.current&&J(se.current.offsetWidth);};return V(),window.addEventListener("resize",V),()=>window.removeEventListener("resize",V)},[]),Pt.useEffect(()=>{le===""?De.current="":S&&le!==De.current&&(De.current=le,S.setFilterText(le));},[le,S]),Fe=wt(!!S?.isLoading,300);let he=Pt__namespace.default.useMemo(()=>{if(!G||!K)return S?S.items:o;let V=S?S.items:o,D=s??(a?()=>true:de);return V.filter(re=>D(re.name,K))},[G,K,S,o,s,de]),Ae=V=>{let D=yo(V,o,t);fe(D),i&&i(V);},_e=V=>{fe(V);},ze=()=>{G&&we(true);};return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(reactAriaComponents.ComboBox,{onSelectionChange:Ae,selectedKey:r||void 0,defaultSelectedKey:n||void 0,items:S?S.items:t?t.flatMap(V=>V.items):o,className:Y(I,"group flex flex-col w-full"),menuTrigger:G?"manual":a?"input":"focus",allowsEmptyCollection:!!a,isDisabled:m,isInvalid:f||!!c,inputValue:K,onInputChange:_e,autoFocus:L&&!G,defaultFilter:s??(a?()=>true:de),"aria-label":e||l||"Autocomplete",children:V=>jsxRuntime.jsxs("div",{className:"flex flex-col",children:[e&&jsxRuntime.jsx(q,{size:d,tooltip:b,isRequired:v,children:e}),jsxRuntime.jsxs(ae,{ref:se,children:[A?jsxRuntime.jsx("div",{className:"pointer-events-none absolute left-3 top-[45%] -translate-y-1/2 z-10",children:A(Fe)}):jsxRuntime.jsx("div",{className:"pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 z-10 flex items-center",children:Fe?jsxRuntime.jsx(Me,{size:16,color:"text-text-secondary"}):jsxRuntime.jsx(y,{name:"MagnifyingGlass",className:`${li[d]} text-text-secondary`})}),jsxRuntime.jsx(reactAriaComponents.Input,{className:pe({isInvalid:f||!!c,isDisabled:m,isFocused:$||(G?oe:V.isOpen),size:d,className:tailwindMerge.twMerge(di[d],K&&!m||!w&&!K?"pr-10":"pr-3",G&&"cursor-pointer",I)}),placeholder:l,disabled:m,onFocus:D=>{F(true),G&&(D.currentTarget.blur(),ze());},onBlur:()=>{F(false);},onClick:G?ze:void 0,readOnly:G,"aria-label":e||l||"Autocomplete"}),K&&!m&&jsxRuntime.jsx(mt,{onClick:()=>{fe(""),i?.(null);},size:d}),!w&&!K&&jsxRuntime.jsx(reactAriaComponents.Button,{className:"absolute right-3 top-[46%] -translate-y-1/2 transform text-text-secondary hover:text-text-primary","aria-label":"Toggle menu",isDisabled:m,children:({isPressed:D})=>jsxRuntime.jsx(y,{name:D?"CaretUp":"CaretDown",className:"h-4 w-4"})})]}),T?jsxRuntime.jsx("div",{className:"mt-1 min-h-[20px]",children:C&&ue?jsxRuntime.jsx(g,{size:d,className:"text-feedback-error-text",children:ue}):C&&typeof c=="string"?jsxRuntime.jsx(g,{size:d,className:"text-feedback-error-text",children:c}):C&&typeof c=="function"&&h?jsxRuntime.jsx(g,{size:d,className:"text-feedback-error-text",children:c(h)}):u?jsxRuntime.jsx(N,{size:d,children:u}):null}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[u&&jsxRuntime.jsx(N,{size:d,className:"mt-1",children:u}),C&&ue&&jsxRuntime.jsx(g,{size:d,className:"text-feedback-error-text mt-1",children:ue}),C&&typeof c=="string"&&jsxRuntime.jsx(g,{size:d,className:"text-feedback-error-text mt-1",children:c}),C&&typeof c=="function"&&h&&jsxRuntime.jsx(g,{size:d,className:"text-feedback-error-text mt-1",children:c(h)})]}),!G&&jsxRuntime.jsx(ot,{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:me?`${me}px`:void 0,zIndex:9999},children:jsxRuntime.jsx(reactAriaComponents.ListBox,{"aria-label":e||l||"Suggestions",className:`max-h-[300px] overflow-auto bg-background-input outline-none ${Z}`,children:t?t.map(D=>{let re=D.items.map(ye=>jsxRuntime.jsx($e,{id:ye.id,textValue:ye.name,size:d,className:`flex cursor-default items-center gap-2 px-3 ${vr[d]} text-text-primary outline-none data-[focused]:bg-background-hover data-[selected]:bg-background-selected data-[selected]:font-medium data-[focus-visible]:ring-0`,children:R?R(ye):ye.name},ye.id));if(M){let ye=M(D,re);return Pt__namespace.default.isValidElement(ye)&&ye.type===reactAriaComponents.ListBoxSection?ye:jsxRuntime.jsx(reactAriaComponents.ListBoxSection,{children:ye},D.name)}return jsxRuntime.jsxs(reactAriaComponents.ListBoxSection,{children:[jsxRuntime.jsx(reactAriaComponents.Header,{className:"px-3 py-1 text-sm font-bold text-text-secondary",children:D.name}),re]},D.name)}):D=>jsxRuntime.jsx($e,{id:D.id,textValue:D.name,size:d,className:`flex cursor-default items-center gap-2 px-3 ${vr[d]} text-text-primary outline-none data-[focused]:bg-background-hover data-[selected]:bg-background-selected data-[selected]:font-medium data-[focus-visible]:ring-0`,children:R?R(D):D.name},D.id)})})]})}),G&&jsxRuntime.jsx(it,{isOpen:oe,onClose:()=>we(false),title:e??l??"Search",contentPadding:false,height:"80vh",children:jsxRuntime.jsxs("div",{className:"flex flex-col h-full",children:[jsxRuntime.jsx("div",{className:"p-4 border-b border-border-default",children:jsxRuntime.jsxs(ae,{children:[jsxRuntime.jsx("div",{className:"pointer-events-none absolute left-3 top-[45%] -translate-y-1/2 z-10 flex items-center",children:Fe?jsxRuntime.jsx(Me,{size:16,color:"text-text-secondary"}):jsxRuntime.jsx(y,{name:"MagnifyingGlass",className:"h-4 w-4 text-text-secondary"})}),jsxRuntime.jsx("input",{ref:H,type:"text",value:K,onChange:V=>_e(V.target.value),placeholder:l,autoFocus:true,className:pe({isInvalid:false,isDisabled:false,isFocused:true,size:"md",className:"pl-10 pr-10"})}),K&&jsxRuntime.jsx(mt,{onClick:()=>{fe(""),i?.(null);},size:"md"})]})}),jsxRuntime.jsx("div",{className:"flex-1 overflow-auto",children:jsxRuntime.jsx(reactAriaComponents.ListBox,{"aria-label":e||l||"Suggestions",items:he,selectedKeys:r?[r]:[],selectionMode:"single",onSelectionChange:V=>{let D=Array.from(V)[0];D&&(Ae(D),we(false));},className:"bg-background-input outline-none",children:V=>jsxRuntime.jsx($e,{id:V.id,textValue:V.name,size:"md",className:"flex cursor-default items-center gap-2 px-4 py-3 text-text-primary outline-none data-[focused]:bg-background-hover data-[selected]:bg-background-selected data-[selected]:font-medium data-[focus-visible]:ring-0",children:R?R(V):V.name},V.id)})})]})})]})}function _(e,o){let t=o.split("."),r=e;for(let i of t)if(r&&typeof r=="object"&&i in r)r=r[i];else {r=void 0;break}let n=r?.message;return typeof n=="string"?n:void 0}function Tp({name:e,defaultValue:o,...t}){let{control:r,formState:n}=reactHookForm.useFormContext(),i=_(n.errors,e);return jsxRuntime.jsx(reactHookForm.Controller,{control:r,name:e,defaultValue:o,render:({field:a})=>jsxRuntime.jsx(vo,{...t,selectedKey:a.value??null,onSelectionChange:s=>a.onChange(s),showErrors:!!i,errorMessage:i})})}var yi="focus:ring-action-primary",vi="bg-action-primary border-action-primary text-[color:var(--color-action-primary-text)] hover:bg-action-primary-hover hover:border-action-primary-hover";function Fr(e){return jsxRuntime.jsxs(reactAriaComponents.CheckboxGroup,{...e,className:Y(e.className,"flex flex-col gap-2"),children:[jsxRuntime.jsx(q,{children:e.label}),e.children,e.description&&jsxRuntime.jsx(N,{children:e.description}),jsxRuntime.jsx(g,{children:typeof e.errorMessage=="function"?void 0:e.errorMessage})]})}function Pi({isDisabled:e}){return `relative flex gap-2 items-center group text-sm transition ${e?"text-text-disabled":"text-text-secondary"}`}function Ci({isSelected:e,isInvalid:o,isDisabled:t,isIndeterminate:r}){let n="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=yi,a="";return t?a="border-border-muted bg-background-muted":o?a="border-feedback-error-border bg-feedback-error-background":e||r?a=vi:a="bg-background-input border-border-input hover:border-border-focus",`${n} ${i} ${a}`}var Rr="w-4 h-4 text-current group-disabled:text-text-disabled";function Po({className:e,...o}){return jsxRuntime.jsx("div",{"aria-hidden":"true",className:`${Ci(o)} ${e||""}`,children:o.isIndeterminate?jsxRuntime.jsx(lucideReact.Minus,{"aria-hidden":true,className:Rr}):o.isSelected?jsxRuntime.jsx(lucideReact.Check,{"aria-hidden":true,className:Rr}):null})}function Sr(e){let{children:o,variant:t,...r}=e;return jsxRuntime.jsx(reactAriaComponents.Checkbox,{...r,className:reactAriaComponents.composeRenderProps(e.className,(n,i)=>`${Pi(i)} ${n||""}`),children:n=>{let{isSelected:i,isIndeterminate:a,isDisabled:s,isInvalid:l}=n;return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Po,{isSelected:i,isIndeterminate:a,isDisabled:s,isInvalid:l}),typeof o=="function"?o(n):o]})}})}function Wp({name:e,defaultValue:o,errorBelow:t=false,...r}){let{control:n,formState:i}=reactHookForm.useFormContext(),a=_(i.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(Sr,{...r,isSelected:!!s.value,onChange:l=>s.onChange(l),"aria-invalid":!!a,children:r.children}),t&&a&&jsxRuntime.jsx(g,{children:a})]})})}function Qp({name:e,defaultValue:o,...t}){let{control:r,formState:n}=reactHookForm.useFormContext(),i=_(n.errors,e);return jsxRuntime.jsx(reactHookForm.Controller,{control:r,name:e,defaultValue:o,render:({field:a})=>jsxRuntime.jsx(Fr,{...t,value:a.value||[],onChange:s=>a.onChange(s),errorMessage:i,children:t.children})})}function st(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 Fo(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 wr({label:e,description:o,errorMessage:t,size:r="md",tooltip:n,isRequired:i,transparent:a,className:s,validationResult:l,value:c,defaultValue:u,onChange:d,placeholder:b="#000000",showColorSwatch:v=true,reserveErrorSpace:m=true,...f}){let[h,C]=Pt.useState(u||""),[R,A]=Pt.useState(c||u||""),[M,L]=Pt.useState(false),[T,w]=Pt.useState(null),{isFocused:X,handleFocus:I,handleBlur:se}=Ee(),H=c!==void 0?c:h;Pt.useEffect(()=>{c!==void 0&&A(c);},[c]);let me=H?!st(H):false,J=Pt.useCallback($=>{if(A($),st($)){let F=Fo($);d?d(F):C(F);}else $===""&&(d?d(""):C(""));},[d]),K=Pt.useCallback($=>{let F=Fo($);A(F),d?d(F):C(F);},[d]),fe=Pt.useCallback($=>{if(st(R)){let F=Fo(R);A(F),d&&F!==H?d(F):!d&&F!==h&&C(F);}se($,f.onBlur);},[R,H,h,d,se,f.onBlur]);return jsxRuntime.jsx(reactAriaComponents.TextField,{...f,isRequired:i,className:Y(s,"group flex flex-col"),children:({isDisabled:$})=>jsxRuntime.jsxs("div",{className:"flex flex-col",children:[e&&jsxRuntime.jsx(q,{size:r,tooltip:n,isRequired:i,children:e}),jsxRuntime.jsx(ae,{children:jsxRuntime.jsxs("div",{className:"flex gap-2",children:[jsxRuntime.jsxs("div",{className:"flex-1 relative",children:[jsxRuntime.jsx(Bt,{size:r,disabled:$,type:"text",value:R,placeholder:b,onFocus:F=>I(F,f.onFocus),onBlur:fe,onChange:F=>J(F.target.value),className:tailwindMerge.twMerge(pe({isInvalid:me,isDisabled:$,isFocused:X,size:r,transparent:a}),v?"pr-12":"pr-3","pl-3")}),v&&jsxRuntime.jsx("div",{className:"absolute right-3 top-1/2 -translate-y-1/2 pointer-events-none",style:{width:O[r].height},children:jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("w-6 h-6 rounded border shadow-sm",st(H)?"border-border-default":"border-border-default bg-background-muted"),style:st(H)?{backgroundColor:H}:void 0,"aria-hidden":"true",children:!st(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(k,{variant:"secondary",size:r,icon:"Palette",onPress:()=>L(!M),isDisabled:$,className:"flex-shrink-0",children:"Pick"})})]})}),m?jsxRuntime.jsx("div",{className:"mt-1 min-h-[20px]",children:typeof t=="string"?jsxRuntime.jsx(g,{size:r,children:t}):typeof t=="function"&&l?jsxRuntime.jsx(g,{size:r,children:t(l)}):o?jsxRuntime.jsx(N,{size:r,children:o}):null}):jsxRuntime.jsx(jsxRuntime.Fragment,{children:typeof t=="string"?jsxRuntime.jsx(g,{size:r,className:"mt-1",children:t}):typeof t=="function"&&l?jsxRuntime.jsx(g,{size:r,className:"mt-1",children:t(l)}):o?jsxRuntime.jsx(N,{size:r,className:"mt-1",children:o}):null}),M&&T&&jsxRuntime.jsx(ot,{triggerRef:{current:T},isOpen:M,onOpenChange:L,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:K,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-primary text-[length:var(--control-text-sm)] font-mono",children:H||"#000000"})]})]})})]})})}function fm({name:e,defaultValue:o,...t}){let{control:r,formState:n}=reactHookForm.useFormContext(),i=_(n.errors,e);return jsxRuntime.jsx(reactHookForm.Controller,{control:r,name:e,defaultValue:o,render:({field:a})=>jsxRuntime.jsx(wr,{...t,value:a.value??"",onChange:s=>a.onChange(s),isInvalid:!!i,errorMessage:i})})}function Wi({isSelected:e,isDisabled:o}){let t=[We,"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-inverse invalid:bg-feedback-error-border forced-colors:bg-[Highlight] forced-colors:invalid:bg-[Mark] forced-colors:text-[HighlightText]"):t.push("text-text-primary hover:bg-background-hover pressed:bg-background-selected"),t.join(" ")}function ko({errorMessage:e,...o}){return jsxRuntime.jsxs(reactAriaComponents.Calendar,{...o,children:[jsxRuntime.jsx(Er,{}),jsxRuntime.jsxs(reactAriaComponents.CalendarGrid,{className:"border-separate [border-spacing:0] [&_td]:p-0 [&_td]:!border-0",children:[jsxRuntime.jsx(Vr,{}),jsxRuntime.jsx(reactAriaComponents.CalendarGridBody,{children:t=>jsxRuntime.jsx(reactAriaComponents.CalendarCell,{date:t,className:({isSelected:r,isDisabled:n})=>`${Wi({isSelected:r,isDisabled:n})} border-0`})})]}),e&&jsxRuntime.jsx(reactAriaComponents.Text,{slot:"errorMessage",className:"text-sm text-feedback-error-text",children:e})]})}function Er(){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(k,{variant:"icon",slot:"previous",className:"pl-0",children:e==="rtl"?jsxRuntime.jsx(y,{name:"CaretRight","aria-hidden":true,size:o}):jsxRuntime.jsx(y,{name:"CaretLeft","aria-hidden":true,size:o})}),jsxRuntime.jsx(reactAriaComponents.Heading,{className:"text-md mx-2 flex-1 text-center font-semibold text-text-primary"}),jsxRuntime.jsx(k,{variant:"icon",slot:"next",className:"pr-0",children:e==="rtl"?jsxRuntime.jsx(y,{name:"CaretLeft","aria-hidden":true,size:o}):jsxRuntime.jsx(y,{name:"CaretRight","aria-hidden":true,size:o})})]})}function Vr(){return jsxRuntime.jsx(reactAriaComponents.CalendarGridHeader,{children:e=>jsxRuntime.jsx(reactAriaComponents.CalendarHeaderCell,{className:"text-xs font-semibold text-text-secondary",children:e})})}function No({label:e,description:o,errorMessage:t,size:r="md",tooltip:n,isRequired:i,isDisabled:a,isInvalid:s,showCalendar:l=true,reserveErrorSpace:c=true,validationResult:u,className:d,...b}){let[v,m]=Pt.useState(false),f=h=>{b.onChange&&h&&b.onChange(h),m(false);};return jsxRuntime.jsxs(reactAriaComponents.DateField,{...b,isDisabled:a,isRequired:i,isInvalid:s,className:Y(d,"flex flex-col gap-1"),children:[e&&jsxRuntime.jsx(q,{size:r,tooltip:n,isRequired:i,children:e}),jsxRuntime.jsx(ae,{children:jsxRuntime.jsxs("div",{className:"relative w-full",children:[jsxRuntime.jsx(Br,{size:r,isDisabled:a,isInvalid:s,hasCalendar:l}),l&&!a&&jsxRuntime.jsxs(reactAriaComponents.DialogTrigger,{isOpen:v,onOpenChange:m,children:[jsxRuntime.jsx(k,{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-secondary hover:text-text-primary transition-colors","aria-label":"Open calendar",children:jsxRuntime.jsx(y,{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(ko,{value:b.value,onChange:f,minValue:b.minValue,maxValue:b.maxValue,isDisabled:a,isReadOnly:b.isReadOnly,isDateUnavailable:b.isDateUnavailable})})})]})]})}),c?jsxRuntime.jsx("div",{className:"mt-1 min-h-[20px]",children:typeof t=="string"?jsxRuntime.jsx(g,{size:r,children:t}):typeof t=="function"&&u?jsxRuntime.jsx(g,{size:r,children:t(u)}):o?jsxRuntime.jsx(N,{size:r,children:o}):null}):jsxRuntime.jsx(jsxRuntime.Fragment,{children:typeof t=="string"?jsxRuntime.jsx(g,{size:r,className:"mt-1",children:t}):typeof t=="function"&&u?jsxRuntime.jsx(g,{size:r,className:"mt-1",children:t(u)}):o?jsxRuntime.jsx(N,{size:r,className:"mt-1",children:o}):null})]})}function Ji({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-base md:text-xs",md:"text-base md:text-sm",lg:"text-base",xl:"text-lg"}[t],e?"text-text-disabled italic":"text-text-primary",o?"text-text-disabled cursor-not-allowed":"cursor-text",!o&&"hover:bg-background-hover","data-[focused]:bg-background-selected data-[focused]:text-text-primary")}function Br({size:e="md",isDisabled:o,isInvalid:t,hasCalendar:r,className:n,...i}){return jsxRuntime.jsx(reactAriaComponents.DateInput,{className:tailwindMerge.twMerge(ft({isInvalid:t,isDisabled:o}),"px-3 py-2 flex items-center gap-0.5 w-full",r&&"pr-10",n),...i,children:a=>jsxRuntime.jsx(reactAriaComponents.DateSegment,{segment:a,className:Ji({isPlaceholder:a.isPlaceholder,isDisabled:!a.isEditable||o,size:e})})})}function Km({name:e,defaultValue:o,...t}){let{control:r,formState:n}=reactHookForm.useFormContext(),i=_(n.errors,e);return jsxRuntime.jsx(reactHookForm.Controller,{control:r,name:e,defaultValue:o,render:({field:a})=>jsxRuntime.jsx(No,{...t,value:a.value??null,onChange:s=>a.onChange(s),isInvalid:!!i,errorMessage:i})})}function wo({value:e,onChange:o,onUrlChange:t,accept:r="image/*",maxSize:n,isDisabled:i=false,onUpload:a,className:s,showPreview:l=true,placeholder:c="Drop files here or click to browse"}){let[u,d]=Pt.useState(false),[b,v]=Pt.useState(false),[m,f]=Pt.useState(null),[h,C]=Pt.useState(e),R=Pt.useRef(null),A=async T=>{if(f(null),n&&T.size>n){f(`File size must be less than ${(n/1024/1024).toFixed(2)}MB`);return}if(l&&T.type.startsWith("image/")){let w=new FileReader;w.onloadend=()=>{C(w.result);},w.readAsDataURL(T);}if(a){v(true);try{let w=await a(T);C(w),t?.(w);}catch(w){f("Failed to upload file"),console.error("Upload error:",w);}finally{v(false);}}o?.(T,h);},M=async T=>{try{let w=T.items;if(w.length>0){let X=w[0];if(X.kind==="file"){let I=await X.getFile();I&&A(I);}}}catch(w){f("Failed to upload file"),console.error("Upload error:",w);}finally{d(false);}},L=()=>{C(void 0),f(null),o?.(null),t?.(""),R.current&&(R.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",i&&"pointer-events-none opacity-50",m&&"border-feedback-error-border bg-feedback-error-background/50"),onDrop:M,onDropEnter:()=>d(true),onDropExit:()=>d(false),children:[h?jsxRuntime.jsxs("div",{className:"relative flex h-full w-full items-center justify-center p-4",children:[l&&(h.startsWith("data:image")||h.startsWith("http"))?jsxRuntime.jsx("img",{src:h,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-secondary"}),jsxRuntime.jsx("span",{className:"text-sm text-text-secondary",children:"File uploaded"})]}),!i&&jsxRuntime.jsx(k,{variant:"icon",size:"sm",onPress:L,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-secondary"}),jsxRuntime.jsxs("div",{className:"text-center",children:[jsxRuntime.jsx("p",{className:"text-sm text-text-primary",children:c}),jsxRuntime.jsx("p",{className:"mt-1 text-xs text-text-secondary",children:r==="image/*"?"PNG, JPG, GIF up to 10MB":`Accepts ${r}`})]}),jsxRuntime.jsx(reactAriaComponents.FileTrigger,{acceptedFileTypes:r.split(","),onSelect:T=>{let w=Array.from(T||[]);w.length>0&&A(w[0]);},children:jsxRuntime.jsx(k,{variant:"secondary",size:"sm",isDisabled:i,children:"Choose File"})})]}),b&&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-secondary",children:"Uploading..."})]})})]}),m&&jsxRuntime.jsx("p",{className:"mt-2 text-sm text-feedback-error-text",children:m})]})}function cf({name:e,defaultValue:o,errorBelow:t=true,...r}){let{control:n,formState:i}=reactHookForm.useFormContext(),a=_(i.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(wo,{...r,value:s.value??"",onChange:(l,c)=>s.onChange(c||"")}),t&&a&&jsxRuntime.jsx(g,{children:a})]})})}var ps={primary:"bg-action-primary/10 text-action-primary border border-action-primary/20 hover:bg-action-primary/15",secondary:"bg-action-secondary text-[color:var(--color-action-secondary-text)] border border-border-muted hover:bg-action-secondary-hover",info:"bg-feedback-info-background text-feedback-info-text border border-feedback-info-border hover:bg-feedback-info-background/80"};function Ar(e){return !e||e==="default"?"secondary":e==="brand"?"primary":e}var ms={xs:"px-1.5 py-[2px] gap-0.5",sm:"px-2 py-1 gap-1",md:"px-3 py-1.5 gap-1.5",lg:"px-3 py-2 gap-2",xl:"px-4 py-2.5 gap-2"},fs="opacity-75 cursor-not-allowed pointer-events-none";function _r(e){let{variant:o,size:t,isDisabled:r,isClickable:n,className:i}=e,a=t==="xs"?"text-xs":O[t].text;return tailwindMerge.twMerge("inline-flex items-center justify-center rounded-full font-medium transition-colors","whitespace-nowrap select-none",ms[t],a,ps[o],n&&!r&&"cursor-pointer",r&&fs,i)}function zr({children:e,onRemove:o,removeLabel:t="Remove",size:r="md",variant:n="secondary",isRemovable:i=true,isDisabled:a=false,className:s,onClick:l}){let c=!!l&&!a,u=i&&o&&!a,d=h=>{h.stopPropagation(),h.preventDefault(),o&&!a&&o();},b=()=>{l&&!a&&l();},v=r==="xs"?10:r==="sm"?12:r==="md"?14:16,f=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("span",{className:"truncate",children:e}),u?c?jsxRuntime.jsx("span",{onClick:d,onKeyDown:h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),d(h));},role:"button",tabIndex:0,className:"flex-shrink-0 rounded-full p-0.5 hover:bg-text-primary/10 transition-colors cursor-pointer","aria-label":t,title:t,children:jsxRuntime.jsx(y,{name:"X",size:v,className:"text-current opacity-70 hover:opacity-100"})}):jsxRuntime.jsx("button",{type:"button",onClick:d,className:"flex-shrink-0 rounded-full p-0.5 hover:bg-text-primary/10 transition-colors cursor-pointer","aria-label":t,title:t,tabIndex:-1,children:jsxRuntime.jsx(y,{name:"X",size:v,className:"text-current opacity-70 hover:opacity-100"})}):null]});return c?jsxRuntime.jsx("button",{type:"button",onClick:b,className:_r({variant:Ar(n),size:r,isDisabled:a,isClickable:c,className:s}),disabled:a,children:f}):jsxRuntime.jsx("span",{className:_r({variant:Ar(n),size:r,isDisabled:a,isClickable:c,className:s}),children:f})}var xs=(e,o)=>e.toLocaleLowerCase().includes(o.toLocaleLowerCase());function hs(e){return [e.value,e.label]}function Hr(e,o,t=xs){let r=o.trim();return r===""?[...e]:e.filter(n=>hs(n).some(i=>t(i,r)))}function Or(e){let o=e.query.trim();if(o==="")return false;let t=o.toLocaleLowerCase();return e.options.some(n=>n.value.toLocaleLowerCase()===t||n.label.toLocaleLowerCase()===t)?false:!e.selected.some(n=>n.toLocaleLowerCase()===t)}function $r(e,o){return e.map(t=>{let r=o.find(n=>n.value===t);return r?r.count===void 0?{value:t,label:r.label,isUnknown:false}:{value:t,label:r.label,count:r.count,isUnknown:false}:{value:t,label:t,isUnknown:true}})}var Cs=e=>e.kind==="literal"?`literal:${e.value}`:`option:${e.option.value}`,Eo=e=>e.kind==="literal"?e.value:e.option.value,Gr=e=>e.kind==="literal"?e.value:e.option.label,Rs={sm:"h-4 w-4",md:"h-5 w-5",lg:"h-6 w-6",xl:"h-7 w-7"},Fs={sm:"pl-8",md:"pl-10",lg:"pl-11",xl:"pl-13"},Ss={sm:"xs",md:"xs",lg:"sm",xl:"sm"};function Vo({options:e,value:o,defaultValue:t,onChange:r,label:n,placeholder:i,size:a="md",loading:s=false,disabled:l=false,maxSelected:c,allowLiteral:u=false,onSearchChange:d,truncated:b=false,totalCount:v,emptyMessage:m,showSelectAll:f=false,description:h,errorMessage:C,isRequired:R=false,onBlur:A,inputRef:M,labelHidden:L=false,className:T,id:w}){let X=Pt.useId(),I=w??`multiselect-${X}`,se=`${I}-input`,H=`${I}-listbox`,me=Pt.useRef(null),J=Pt.useCallback(p=>{me.current=p,typeof M=="function"?M(p):M&&(M.current=p);},[M]),{contains:K}=reactAria.useFilter({sensitivity:"base"}),{isFocused:fe,handleFocus:$,handleBlur:F}=Ee(),[oe,we]=Pt.useState(""),[le,de]=Pt.useState(true),[ue,x]=Pt.useState(null),[Q,G]=Pt.useState(""),[Z,ve]=Pt.useState(()=>[...t??[]]),S=Pt.useMemo(()=>o?[...o]:Z,[o,Z]),Fe=Pt.useMemo(()=>Hr(e,oe,K),[e,oe,K]),De=u&&!s&&Or({query:oe,options:e,selected:S}),he=Pt.useMemo(()=>{let p=Fe.map(ee=>({kind:"option",option:ee}));return De?[{kind:"literal",value:oe.trim()},...p]:p},[Fe,De,oe]),Ae=Pt.useMemo(()=>$r(S,e),[S,e]),_e=c!==void 0&&S.length>=c,ze=Pt.useCallback((p,ee)=>{o||ve(p),G(`${ee} ${p.length} selected.`),r(p);},[r,o]),V=Pt.useCallback((p,ee)=>{if(!l){if(S.includes(p)){ze(S.filter(He=>He!==p),`${ee} removed.`);return}_e||ze([...S,p],`${ee} selected.`);}},[_e,ze,l,S]),D=Pt.useCallback(p=>{p.kind==="option"&&p.option.disabled||V(Eo(p),Gr(p));},[V]),re=p=>{if(l||p.length===0)return;let ee=new Set(p),He=p.map(Be=>Ae.find(Qt=>Qt.value===Be)?.label??Be);ze(S.filter(Be=>!ee.has(Be)),`${He.join(", ")} removed.`);},ye=p=>{we(p),x(null),de(true),d?.(p);},Uo=p=>{if(he.length===0){x(null);return}x(ee=>ee===null?p>0?0:he.length-1:(ee+p+he.length)%he.length);},ln=p=>{if(l)return;let ee=ue===null?void 0:he[ue];switch(p.key){case "ArrowDown":p.preventDefault(),de(true),Uo(1);break;case "ArrowUp":p.preventDefault(),de(true),Uo(-1);break;case "Home":he.length>0&&(p.preventDefault(),de(true),x(0));break;case "End":he.length>0&&(p.preventDefault(),de(true),x(he.length-1));break;case "Enter":ee&&(p.preventDefault(),D(ee));break;case " ":oe===""&&ee&&(p.preventDefault(),D(ee));break;case "Escape":p.preventDefault(),oe!==""?ye(""):(de(false),x(null));break;case "Backspace":oe===""&&S.length>0&&(p.preventDefault(),re([S[S.length-1]]));break;}},Xe=Fe.filter(p=>!p.disabled&&!S.includes(p.value)).map(p=>p.value),dn=c===void 0?Xe.length:Math.max(0,c-S.length),ut=Math.min(Xe.length,dn),cn=ut===Xe.length?`Select all ${Xe.length} matching`:`Select ${ut} of ${Xe.length} matching`,un=()=>{if(l||ut===0)return;let p=Xe.slice(0,ut);ze([...S,...p],`${p.length} matching options selected.`);},jt=s?"loading":e.length===0?"empty":Fe.length===0&&oe.trim()!==""?"no-match":null,pn=O[a].text;return jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("flex w-full flex-col gap-1",T),"data-testid":"multiselect",children:[jsxRuntime.jsx(q,{size:a,htmlFor:se,isRequired:R,...L?{className:"sr-only"}:{},children:n}),jsxRuntime.jsxs(ae,{children:[jsxRuntime.jsx("div",{className:"pointer-events-none absolute left-3 top-1/2 z-10 flex -translate-y-1/2 items-center",children:s?jsxRuntime.jsx(Me,{size:16,color:"text-text-secondary"}):jsxRuntime.jsx(y,{name:"MagnifyingGlass",className:tailwindMerge.twMerge(Rs[a],"text-text-secondary")})}),jsxRuntime.jsx("input",{ref:J,id:se,type:"text",role:"combobox",autoComplete:"off","aria-expanded":le,"aria-controls":H,"aria-haspopup":"listbox","aria-autocomplete":"list","aria-activedescendant":le&&ue!==null&&he[ue]?`${I}-row-${ue}`:void 0,"aria-required":R||void 0,"aria-invalid":C?true:void 0,value:oe,placeholder:i,disabled:l,onChange:p=>ye(p.target.value),onKeyDown:ln,onFocus:p=>{de(true),$(p);},onBlur:p=>{F(p),A?.(p);},className:pe({isDisabled:l,isFocused:fe,isInvalid:!!C,size:a,className:tailwindMerge.twMerge(Fs[a],"pr-3")})})]}),Ae.length>0&&jsxRuntime.jsx("div",{"data-testid":"multiselect-selection-region",role:"group","aria-label":`Selected ${n}`,className:"flex flex-wrap gap-1.5 rounded-[var(--control-border-radius)] border border-border-default bg-background-muted p-2",children:Ae.map(p=>jsxRuntime.jsx(zr,{size:Ss[a],variant:"primary",isDisabled:l,removeLabel:`Remove ${p.label}`,onRemove:()=>re([p.value]),className:"shrink-0",children:p.isUnknown?jsxRuntime.jsx("span",{"data-testid":`multiselect-selection-unknown-${p.value}`,title:"Not in the current option list",children:`${p.label} (custom)`}):p.label},p.value))}),f&&jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(k,{variant:"link",size:a,onPress:un,isDisabled:l||ut===0,children:cn}),jsxRuntime.jsx(k,{variant:"link",size:a,onPress:()=>re(S),isDisabled:l||S.length===0,children:"Clear all"})]}),jsxRuntime.jsx("div",{id:H,role:"listbox","aria-multiselectable":"true","aria-label":`${n} options`,hidden:!le,className:tailwindMerge.twMerge(pn,"max-h-[260px] overflow-y-auto rounded-[var(--control-border-radius)] border border-border-input bg-background-input"),children:le&&he.map((p,ee)=>{let He=S.includes(Eo(p)),Be=l||p.kind==="option"&&p.option.disabled===true||!He&&_e;return jsxRuntime.jsxs("div",{id:`${I}-row-${ee}`,role:"option","aria-selected":He,"aria-disabled":Be||void 0,"data-value":Eo(p),"data-literal":p.kind==="literal"?"true":void 0,"data-active":ue===ee?"true":void 0,onMouseDown:Qt=>Qt.preventDefault(),onClick:()=>{Be||(D(p),me.current?.focus());},className:tailwindMerge.twMerge("flex cursor-default items-center gap-2 px-3",O[a].paddingY,"text-text-primary",ue===ee&&"bg-background-hover",He&&"bg-background-selected font-medium",Be&&"text-text-disabled"),children:[jsxRuntime.jsx(Po,{isSelected:He,isDisabled:Be,className:"!w-4 !h-4"}),jsxRuntime.jsx("span",{className:"flex-1 truncate",children:Gr(p)}),p.kind==="literal"&&jsxRuntime.jsx("span",{"data-testid":"multiselect-literal-badge",className:"italic text-text-secondary",children:"Use as typed"}),p.kind==="option"&&p.option.count!==void 0&&jsxRuntime.jsx("span",{"data-testid":`multiselect-count-${p.option.value}`,className:"text-text-secondary",children:p.option.count.toLocaleString()})]},Cs(p))})}),jt==="loading"&&jsxRuntime.jsx("div",{"data-testid":"multiselect-status-loading","data-status":"loading",children:jsxRuntime.jsxs(N,{size:a,className:"flex items-center gap-2",children:[jsxRuntime.jsx(Me,{size:14,color:"text-text-secondary"}),jsxRuntime.jsx("span",{children:"Loading options\u2026"})]})}),jt==="empty"&&jsxRuntime.jsx("div",{"data-testid":"multiselect-status-empty","data-status":"empty",children:jsxRuntime.jsxs(N,{size:a,className:"flex items-center gap-2",children:[jsxRuntime.jsx(y,{name:"Tray",className:"h-4 w-4"}),jsxRuntime.jsx("span",{children:m??"No options available"})]})}),jt==="no-match"&&jsxRuntime.jsx("div",{"data-testid":"multiselect-status-no-match","data-status":"no-match",children:jsxRuntime.jsxs(N,{size:a,className:"flex items-center gap-2 text-feedback-warning-text",children:[jsxRuntime.jsx(y,{name:"MagnifyingGlass",className:"h-4 w-4"}),jsxRuntime.jsx("span",{children:`No options match \u201C${oe.trim()}\u201D`})]})}),b&&jsxRuntime.jsx("div",{"data-testid":"multiselect-truncation",children:jsxRuntime.jsx(N,{size:a,children:v===void 0?"Showing a partial list \u2014 refine your search to see more":`Showing ${e.length} of ${v} \u2014 refine your search to see more`})}),c!==void 0&&jsxRuntime.jsx("div",{"data-testid":"multiselect-limit",children:jsxRuntime.jsx(N,{size:a,children:_e?`${S.length} of ${c} selected \u2014 limit reached, remove one to choose another`:`${S.length} of ${c} selected`})}),h&&jsxRuntime.jsx(N,{size:a,children:h}),C&&jsxRuntime.jsx(g,{size:a,children:C}),jsxRuntime.jsx("div",{"data-testid":"multiselect-live-region",role:"status","aria-live":"polite",className:"sr-only",children:Q})]})}function Hf({name:e,defaultValue:o,...t}){let{control:r,formState:n}=reactHookForm.useFormContext(),i=_(n.errors,e);return jsxRuntime.jsx(reactHookForm.Controller,{control:r,name:e,defaultValue:o,render:({field:a})=>jsxRuntime.jsx(Vo,{...t,value:a.value??[],onChange:s=>a.onChange(s),onBlur:s=>{a.onBlur(),t.onBlur?.(s);},inputRef:a.ref,errorMessage:i})})}var Ls=e=>{let o=pe({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 Bo({label:e,description:o,errorMessage:t,size:r="md",tooltip:n,isRequired:i,transparent:a,validationResult:s,reserveErrorSpace:l=true,descriptionPlacement:c="below",...u}){let d=Pt.useId(),{isFocused:b,handleFocus:v,handleBlur:m}=Ee();return jsxRuntime.jsx(reactAriaComponents.NumberField,{...u,id:d,isRequired:i,className:Y(u.className,"group flex flex-col gap-1"),step:u.step??1,onChange:f=>{typeof f=="number"&&(u.maxValue!=null&&f>u.maxValue?u.onChange?.(u.maxValue):u.minValue!=null&&f<u.minValue?u.onChange?.(u.minValue):u.onChange?.(f));},isInvalid:!!t||typeof u.value=="number"&&(u.maxValue!=null&&u.value>u.maxValue||u.minValue!=null&&u.value<u.minValue),children:({isDisabled:f,isInvalid:h})=>jsxRuntime.jsxs("div",{className:"flex flex-col gap-1",children:[e&&jsxRuntime.jsx(q,{size:r,tooltip:n,description:c==="tooltip"||c==="inline"?o:void 0,descriptionPlacement:c,isRequired:i,htmlFor:d,children:e}),jsxRuntime.jsx("div",{className:"relative",children:jsxRuntime.jsxs(reactAriaComponents.Group,{className:"relative",children:[jsxRuntime.jsx(reactAriaComponents.Input,{onFocus:R=>v(R,u.onFocus),onBlur:R=>m(R,u.onBlur),className:Ls({isInvalid:h||!!t,isDisabled:f,isFocused:b,transparent:a,size:r,className:typeof u.className=="string"?u.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:f,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(y,{name:"CaretUp",size:14})}),jsxRuntime.jsx(reactAriaComponents.Button,{slot:"decrement",isDisabled:f,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(y,{name:"CaretDown",size:14})})]})]})}),l?jsxRuntime.jsx("div",{className:"mt-1 min-h-[20px]",children:t?jsxRuntime.jsx(g,{size:r,children:typeof t=="function"?t(s):t}):o&&c==="below"?jsxRuntime.jsx(N,{size:r,children:o}):null}):jsxRuntime.jsx(jsxRuntime.Fragment,{children:t?jsxRuntime.jsx(g,{size:r,className:"mt-1",children:typeof t=="function"?t(s):t}):o&&c==="below"?jsxRuntime.jsx(N,{size:r,className:"mt-1",children:o}):null})]})})}function ag({name:e,defaultValue:o,...t}){let{control:r,formState:n}=reactHookForm.useFormContext(),i=_(n.errors,e);return jsxRuntime.jsx(reactHookForm.Controller,{control:r,name:e,defaultValue:o,render:({field:a})=>jsxRuntime.jsx(Bo,{...t,value:typeof a.value=="number"?a.value:void 0,onChange:s=>a.onChange(s),isInvalid:!!i,errorMessage:i,isRequired:t.isRequired})})}function Do({value:e,defaultValue:o,onChange:t,isDisabled:r,isReadOnly:n,isRequired:i,className:a,children:s,size:l="2",variant:c="primary",columns:u="repeat(auto-fit, minmax(160px, 1fr))",gap:d="1"}){return jsxRuntime.jsx(reactAriaComponents.RadioGroup,{value:e,defaultValue:o,onChange:t,isDisabled:r,isReadOnly:n,isRequired:i,className:Y(a,"grid"),style:{gridTemplateColumns:/^\d+$/.test(String(u))?`repeat(${u}, minmax(0, 1fr))`:u,gap:d==="1"?"0.25rem":d==="2"?"0.5rem":d==="3"?"0.75rem":d==="4"?"1rem":typeof d=="number"?`${d}px`:d},children:Pt__namespace.default.Children.map(s,b=>Pt__namespace.default.isValidElement(b)?Pt__namespace.default.cloneElement(b,{size:l,variant:c}):b)})}function Rg({name:e,defaultValue:o,label:t,description:r,children:n,...i}){let{control:a,formState:s}=reactHookForm.useFormContext(),l=_(s.errors,e);return jsxRuntime.jsx(reactHookForm.Controller,{control:a,name:e,defaultValue:o,render:({field:c})=>jsxRuntime.jsxs("div",{className:"flex flex-col gap-1",children:[t&&jsxRuntime.jsx(q,{children:t}),r&&jsxRuntime.jsx(N,{children:r}),jsxRuntime.jsx(Do,{...i,value:c.value,onChange:u=>c.onChange(u),children:n}),l&&jsxRuntime.jsx(g,{children:l})]})})}function Ws(e){return "primary"}var qs=Pt.createContext({variant:"primary"});function Ao(e){let{variant:o="primary",...t}=e,r=Ws();return jsxRuntime.jsx(qs.Provider,{value:{variant:r},children:jsxRuntime.jsxs(reactAriaComponents.RadioGroup,{...t,className:Y(e.className,"group flex flex-col gap-2"),children:[jsxRuntime.jsx(q,{children:e.label}),jsxRuntime.jsx("div",{className:`flex ${t.orientation==="horizontal"?"flex-row gap-4":"flex-col gap-2"}`,children:e.children}),e.description&&jsxRuntime.jsx(N,{children:e.description}),jsxRuntime.jsx(g,{children:typeof e.errorMessage=="function"&&e.validationResult?e.errorMessage(e.validationResult):typeof e.errorMessage=="string"?e.errorMessage:null})]})})}function Wg({name:e,defaultValue:o,...t}){let{control:r,formState:n}=reactHookForm.useFormContext(),i=_(n.errors,e);return jsxRuntime.jsx(reactHookForm.Controller,{control:r,name:e,defaultValue:o,render:({field:a})=>jsxRuntime.jsx(Ao,{...t,value:a.value,onChange:s=>a.onChange(s),errorMessage:i,children:t.children})})}var Js=e=>{let o=pe({isInvalid:e.isInvalid,isDisabled:e.isDisabled,isFocused:e.isFocused,transparent:e.transparent,size:e.size}),t=[e.showSearchIcon?"":"pl-3",e.isClearable&&e.hasValue||e.isPassword?"pr-8":"pr-3"].join(" ");return tailwindMerge.twMerge(o,t,e.className)};function Tt({label:e,description:o,errorMessage:t,size:r="md",tooltip:n,isRequired:i,transparent:a,showSearchIcon:s,isClearable:l,onClear:c,type:u,validationResult:d,reserveErrorSpace:b=true,isLoading:v=false,descriptionPlacement:m="below",...f}){let[h,C]=Pt__namespace.default.useState(false),{isFocused:R,handleFocus:A,handleBlur:M}=Ee(),L=u==="password",T=wt(v,300);return jsxRuntime.jsx(reactAriaComponents.TextField,{...f,isRequired:i,className:Y(f.className,"group flex flex-col"),children:({isDisabled:w,isInvalid:X})=>jsxRuntime.jsxs("div",{className:"flex flex-col",children:[e&&jsxRuntime.jsx(q,{size:r,tooltip:n,description:m==="tooltip"||m==="inline"?o:void 0,descriptionPlacement:m,isRequired:i,children:e}),jsxRuntime.jsxs(ae,{children:[s&&jsxRuntime.jsx("div",{className:"pointer-events-none absolute top-1/2 -translate-y-1/2 transform flex items-center z-10",style:{left:9},children:(()=>{let I={sm:14,md:16,lg:18,xl:20}[r];return T?jsxRuntime.jsx(Me,{size:I,color:"text-text-secondary"}):jsxRuntime.jsx(y,{name:"MagnifyingGlass",size:I,className:`transition-colors ${R?"text-action-brand":"text-text-secondary"}`})})()}),jsxRuntime.jsx(Bt,{size:r,disabled:w,type:L?h?"text":"password":u,name:f.name,autoComplete:f.autoComplete,value:f.value,defaultValue:f.defaultValue,placeholder:f.placeholder,onFocus:I=>A(I,f.onFocus),onBlur:I=>M(I,f.onBlur),onChange:I=>f.onChange?.(I.target.value),style:s?{paddingLeft:{sm:28,md:32,lg:36,xl:37}[r]}:void 0,className:Js({isInvalid:X,isDisabled:w,isFocused:R,size:r,transparent:a,showSearchIcon:s,isClearable:l,hasValue:!!f.value,isPassword:L,className:typeof f.className=="string"?f.className:void 0})}),l&&f.value&&!w&&jsxRuntime.jsx(mt,{onClick:()=>{c?c():f.onChange&&f.onChange("");},size:r}),L&&!w&&jsxRuntime.jsx("button",{type:"button",onClick:()=>C(!h),className:"absolute right-3 top-1/2 -translate-y-1/2 transform text-text-secondary hover:text-text-primary","aria-label":h?"Hide password":"Show password",onMouseDown:I=>{I.preventDefault(),I.stopPropagation();},children:jsxRuntime.jsx(y,{name:h?"EyeSlash":"Eye",size:r==="sm"?16:20,className:"text-text-primary"})})]}),b?jsxRuntime.jsx("div",{className:"mt-1 min-h-[20px]",children:typeof t=="string"?jsxRuntime.jsx(g,{size:r,children:t}):typeof t=="function"&&d?jsxRuntime.jsx(g,{size:r,children:t(d)}):o&&m==="below"?jsxRuntime.jsx(N,{size:r,children:o}):null}):jsxRuntime.jsx(jsxRuntime.Fragment,{children:typeof t=="string"?jsxRuntime.jsx(g,{size:r,className:"mt-1",children:t}):typeof t=="function"&&d?jsxRuntime.jsx(g,{size:r,className:"mt-1",children:t(d)}):o&&m==="below"?jsxRuntime.jsx(N,{size:r,className:"mt-1",children:o}):null})]})})}var ll={sm:{toolbar:"p-1.5",contentWrapper:"min-h-[100px]",contentPadding:"p-3",placeholderPos:"left-3 top-3",prose:"prose-xs",h1:"[&_.ProseMirror_h1]:mb-2 [&_.ProseMirror_h1]:text-base [&_.ProseMirror_h1]:font-bold",h2:"[&_.ProseMirror_h2]:mb-1.5 [&_.ProseMirror_h2]:text-sm [&_.ProseMirror_h2]:font-semibold",p:"[&_.ProseMirror_p]:mb-1",list:"[&_.ProseMirror_ul]:mb-1 [&_.ProseMirror_ul]:ml-4 [&_.ProseMirror_ol]:mb-1 [&_.ProseMirror_ol]:ml-4",li:"[&_.ProseMirror_li]:mb-0.5",placeholderText:"text-xs"},md:{toolbar:"p-2",contentWrapper:"min-h-[200px]",contentPadding:"p-4",placeholderPos:"left-4 top-4",prose:"prose-sm",h1:"[&_.ProseMirror_h1]:mb-4 [&_.ProseMirror_h1]:text-2xl [&_.ProseMirror_h1]:font-bold",h2:"[&_.ProseMirror_h2]:mb-3 [&_.ProseMirror_h2]:text-xl [&_.ProseMirror_h2]:font-semibold",p:"[&_.ProseMirror_p]:mb-2",list:"[&_.ProseMirror_ul]:mb-2 [&_.ProseMirror_ul]:ml-6 [&_.ProseMirror_ol]:mb-2 [&_.ProseMirror_ol]:ml-6",li:"[&_.ProseMirror_li]:mb-1",placeholderText:"text-sm"},lg:{toolbar:"p-2.5",contentWrapper:"min-h-[250px]",contentPadding:"p-5",placeholderPos:"left-5 top-5",prose:"prose-base",h1:"[&_.ProseMirror_h1]:mb-5 [&_.ProseMirror_h1]:text-3xl [&_.ProseMirror_h1]:font-bold",h2:"[&_.ProseMirror_h2]:mb-4 [&_.ProseMirror_h2]:text-2xl [&_.ProseMirror_h2]:font-semibold",p:"[&_.ProseMirror_p]:mb-3",list:"[&_.ProseMirror_ul]:mb-3 [&_.ProseMirror_ul]:ml-6 [&_.ProseMirror_ol]:mb-3 [&_.ProseMirror_ol]:ml-6",li:"[&_.ProseMirror_li]:mb-1.5",placeholderText:"text-base"},xl:{toolbar:"p-3",contentWrapper:"min-h-[300px]",contentPadding:"p-6",placeholderPos:"left-6 top-6",prose:"prose-lg",h1:"[&_.ProseMirror_h1]:mb-6 [&_.ProseMirror_h1]:text-4xl [&_.ProseMirror_h1]:font-bold",h2:"[&_.ProseMirror_h2]:mb-5 [&_.ProseMirror_h2]:text-3xl [&_.ProseMirror_h2]:font-semibold",p:"[&_.ProseMirror_p]:mb-3",list:"[&_.ProseMirror_ul]:mb-3 [&_.ProseMirror_ul]:ml-8 [&_.ProseMirror_ol]:mb-3 [&_.ProseMirror_ol]:ml-8",li:"[&_.ProseMirror_li]:mb-2",placeholderText:"text-lg"}},dt=({isActive:e=false,onPress:o,children:t})=>jsxRuntime.jsx(k,{variant:e?"secondary":"ghost",size:"sm",onPress:o,className:"p-1",children:t});function dl({initialUrl:e,isOpen:o,onClose:t,onSubmit:r}){let[n,i]=Pt.useState(e);return Pt__namespace.default.useEffect(()=>{i(e);},[e]),jsxRuntime.jsx(qe,{isDismissable:true,isOpen:o,onOpenChange:s=>!s&&t(),children:jsxRuntime.jsx(reactAriaComponents.Modal,{className:"flex items-center justify-center p-4 outline-none focus:outline-none focus-visible:outline-none ring-0 focus:ring-0 focus-visible:ring-0",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(nt,{title:"Insert Link",onClose:t}),jsxRuntime.jsx("div",{className:"p-6",children:jsxRuntime.jsx(Tt,{label:"URL",type:"url",value:n,onChange:i,autoFocus:true,className:"w-full"})}),jsxRuntime.jsxs("div",{className:"flex justify-end gap-2 border-t border-border-muted p-4",children:[jsxRuntime.jsx(k,{variant:"secondary",onPress:t,children:"Cancel"}),jsxRuntime.jsx(k,{type:"submit",children:"Save"})]})]})})})})}function _o({initialContent:e="",onChange:o,className:t,isDisabled:r=false,placeholder:n="Start typing...",id:i,size:a="md",headingLevels:s=[1,2]}){let l=ll[a],[c,u]=Pt.useState(false),d=react.useEditor({immediatelyRender:false,extensions:[nl__default.default.configure({heading:s.length>0?{levels:s}:false}),el__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:m})=>{o?.(m.getHTML());},editorProps:{attributes:{class:tailwindMerge.twMerge(`prose ${l.prose} max-w-none`,"focus:outline-none","[&>*:first-child]:mt-0 [&>*:last-child]:mb-0")}}}),b=()=>{u(true);},v=m=>{m===""?d?.chain().focus().unsetLink().run():d?.chain().focus().setLink({href:m}).run();};return d?jsxRuntime.jsxs("div",{id:i,"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:[!r&&d&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(menus.BubbleMenu,{editor:d,shouldShow:({editor:m})=>m.isActive("link")&&!c,className:"flex items-center gap-1 rounded-md border border-border-input bg-background-surface p-1 shadow-md",children:[jsxRuntime.jsxs(k,{variant:"ghost",size:"sm",className:"h-8 px-2",onPress:()=>{let m=d.getAttributes("link").href;m&&window.open(m,"_blank","noopener,noreferrer");},children:[jsxRuntime.jsx(y,{name:"ArrowSquareOut",className:"mr-1 h-4 w-4"}),"Open"]}),jsxRuntime.jsxs(k,{variant:"ghost",size:"sm",className:"h-8 px-2",onPress:b,children:[jsxRuntime.jsx(y,{name:"PencilSimple",className:"mr-1 h-4 w-4"}),"Edit"]}),jsxRuntime.jsxs(k,{variant:"ghost",size:"sm",className:"h-8 px-2",onPress:()=>d.chain().focus().unsetLink().run(),children:[jsxRuntime.jsx(y,{name:"X",className:"mr-1 h-4 w-4"}),"Remove"]})]}),jsxRuntime.jsx(dl,{isOpen:c,onClose:()=>u(false),onSubmit:v,initialUrl:d.getAttributes("link").href||""})]}),jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("flex items-center gap-1 border-b border-border-input",l.toolbar),children:[s.map(m=>jsxRuntime.jsx(dt,{isActive:d.isActive("heading",{level:m}),onPress:()=>d.chain().focus().toggleHeading({level:m}).run(),children:jsxRuntime.jsxs("span",{className:"text-xs font-bold",children:["H",m]})},m)),jsxRuntime.jsx(dt,{isActive:d.isActive("bold"),onPress:()=>d.chain().focus().toggleBold().run(),children:jsxRuntime.jsx("span",{className:"text-xs font-bold",children:"B"})}),jsxRuntime.jsx(dt,{isActive:d.isActive("italic"),onPress:()=>d.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(dt,{isActive:d.isActive("bulletList"),onPress:()=>d.chain().focus().toggleBulletList().run(),children:jsxRuntime.jsx(y,{name:"ListBullets",className:"h-4 w-4"})}),jsxRuntime.jsx(dt,{isActive:d.isActive("orderedList"),onPress:()=>d.chain().focus().toggleOrderedList().run(),children:jsxRuntime.jsx(y,{name:"ListNumbers",className:"h-4 w-4"})}),jsxRuntime.jsx("div",{className:"mx-1 h-4 w-px bg-border-muted"}),jsxRuntime.jsx(dt,{isActive:d.isActive("link"),onPress:b,children:jsxRuntime.jsx(y,{name:"PaperclipHorizontal",className:"h-4 w-4"})})]}),jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("relative w-full outline-none focus:outline-none",l.contentWrapper),children:[jsxRuntime.jsx(react.EditorContent,{editor:d,className:tailwindMerge.twMerge("w-full outline-none focus:outline-none",l.contentPadding,"[&_.ProseMirror]:min-h-[inherit]","[&_.ProseMirror]:outline-none [&_.ProseMirror]:focus:outline-none",l.h1,l.h2,l.p,"[&_.ProseMirror_ul]:list-disc","[&_.ProseMirror_ol]:list-decimal",l.list,l.li,"[&_.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")}),d.isEmpty&&!r&&jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("pointer-events-none absolute text-text-secondary",l.placeholderPos,l.placeholderText),children:n})]})]}):null}function Sb({name:e,defaultValue:o,label:t,description:r,reserveErrorSpace:n=true,...i}){let{control:a,formState:s}=reactHookForm.useFormContext(),l=_(s.errors,e);return jsxRuntime.jsx(reactHookForm.Controller,{control:a,name:e,defaultValue:o,render:({field:c})=>jsxRuntime.jsxs("div",{className:"flex flex-col gap-1",children:[t&&jsxRuntime.jsx("label",{htmlFor:e,className:"text-sm font-medium text-text-primary",children:t}),r&&jsxRuntime.jsx("p",{className:"text-sm text-text-secondary",children:r}),jsxRuntime.jsx(_o,{...i,id:e,initialContent:c.value??"",onChange:u=>c.onChange(u)}),l&&jsxRuntime.jsx("p",{className:"text-sm text-feedback-error-text",children:l}),n&&!l&&jsxRuntime.jsx("div",{className:"h-5"})]})})}function Lb({name:e,defaultValue:o,onValueChange:t,...r}){let{control:n,formState:i}=reactHookForm.useFormContext(),a=_(i.errors,e);return jsxRuntime.jsx(reactHookForm.Controller,{control:n,name:e,defaultValue:o,render:({field:s})=>jsxRuntime.jsx(xo,{...r,selectedKey:s.value??null,onSelectionChange:l=>{s.onChange(l),t?.(l);},showErrors:!!a,errorMessage:a})})}var Ho={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 xl({isSelected:e,isDisabled:o,size:t="md"}){let r="flex px-px items-center shrink-0 cursor-default rounded-full transition duration-200 ease-in-out shadow-inner border border-transparent",n=Ho[t].track,i=We,a="focus-visible:outline-action-primary",s="";return e?s="bg-action-primary forced-colors:!bg-[Highlight] group-pressed:bg-action-primary-hover":s="bg-border-input group-pressed:bg-border-focus",[r,n,i,a,s,o?"bg-background-muted forced-colors:group-selected:!bg-[GrayText] forced-colors:border-[GrayText]":""].filter(Boolean).join(" ")}function hl({isSelected:e,isDisabled:o,size:t="md"}){let r="transform rounded-full bg-background-surface outline-none shadow transition duration-200 ease-in-out",n=Ho[t].handle;return [r,n,e?"translate-x-[100%]":"translate-x-0",o?"forced-colors:outline-[GrayText]":""].filter(Boolean).join(" ")}function Oo({children:e,variant:o="primary",size:t="md",...r}){return jsxRuntime.jsx(reactAriaComponents.Switch,{...r,className:Y(r.className,`relative group flex items-center gap-2 ${Ho[t].text} text-text-primary transition disabled:text-text-disabled forced-colors:disabled:text-[GrayText]`),children:n=>jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:xl({...n,size:t}),children:jsxRuntime.jsx("span",{className:hl({...n,size:t})})}),e]})})}function qb({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(Oo,{...t,isSelected:!!n.value,onChange:i=>n.onChange(i),children:t.children})})}var Fl=e=>{let o=pe({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 $o({label:e,description:o,errorMessage:t,size:r="md",tooltip:n,required:i,transparent:a,isInvalid:s,isDisabled:l,isResizable:c=false,className:u,validationResult:d,reserveErrorSpace:b=true,...v}){let{isFocused:m,handleFocus:f,handleBlur:h}=Ee();return jsxRuntime.jsx("div",{className:"group flex flex-col",children:jsxRuntime.jsxs("div",{className:"flex flex-col",children:[e&&jsxRuntime.jsx(q,{size:r,tooltip:n,isRequired:i,children:e}),jsxRuntime.jsx(ae,{children:jsxRuntime.jsx("textarea",{...v,required:i,onFocus:C=>{v.onFocus&&v.onFocus(C),f(C);},onBlur:C=>{v.onBlur&&v.onBlur(C),h(C);},className:Fl({isInvalid:s,isDisabled:l,isResizable:c,isFocused:m,size:r,transparent:a,className:u}),disabled:l})}),b?jsxRuntime.jsx("div",{className:"mt-1 min-h-[20px]",children:typeof t=="string"?jsxRuntime.jsx(g,{size:r,children:t}):typeof t=="function"&&d?jsxRuntime.jsx(g,{size:r,children:t(d)}):o?jsxRuntime.jsx(N,{size:r,children:o}):null}):jsxRuntime.jsx(jsxRuntime.Fragment,{children:typeof t=="string"?jsxRuntime.jsx(g,{size:r,className:"mt-1",children:t}):typeof t=="function"&&d?jsxRuntime.jsx(g,{size:r,className:"mt-1",children:t(d)}):o?jsxRuntime.jsx(N,{size:r,className:"mt-1",children:o}):null})]})})}function nx({name:e,defaultValue:o,...t}){let{control:r,formState:n}=reactHookForm.useFormContext(),i=_(n.errors,e);return jsxRuntime.jsx(reactHookForm.Controller,{control:r,name:e,defaultValue:o,render:({field:a})=>jsxRuntime.jsx($o,{...t,value:a.value??"",onChange:s=>a.onChange(s.target.value),onBlur:s=>{a.onBlur(),t.onBlur?.(s);},isInvalid:!!i,errorMessage:i,required:t.required})})}function cx({name:e,defaultValue:o,...t}){let{control:r,formState:n}=reactHookForm.useFormContext(),i=_(n.errors,e);return jsxRuntime.jsx(reactHookForm.Controller,{control:r,name:e,defaultValue:o,render:({field:a})=>jsxRuntime.jsx(Tt,{...t,value:a.value??"",onChange:s=>a.onChange(s),onBlur:s=>{a.onBlur(),t.onBlur?.(s);},isInvalid:!!i,errorMessage:i,isRequired:t.isRequired})})}function Bl({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-base md:text-xs",md:"text-base md:text-sm",lg:"text-base",xl:"text-lg"}[t],e?"text-text-disabled italic":"text-text-primary",o?"text-text-disabled cursor-not-allowed":"cursor-text",!o&&"hover:bg-background-hover","data-[focused]:bg-background-selected data-[focused]:text-text-primary")}function Go({label:e,description:o,errorMessage:t,size:r="md",tooltip:n,isRequired:i,isDisabled:a,isInvalid:s,reserveErrorSpace:l=true,validationResult:c,className:u,descriptionPlacement:d="below",...b}){return jsxRuntime.jsxs(reactAriaComponents.TimeField,{...b,isDisabled:a,isRequired:i,isInvalid:s,className:Y(u,"flex flex-col gap-1"),children:[e&&jsxRuntime.jsx(q,{size:r,tooltip:n,description:d==="tooltip"||d==="inline"?o:void 0,descriptionPlacement:d,isRequired:i,children:e}),jsxRuntime.jsx(ae,{children:jsxRuntime.jsx(reactAriaComponents.DateInput,{className:tailwindMerge.twMerge(ft({isInvalid:s,isDisabled:a}),"px-3 py-2 flex items-center gap-0.5 w-full"),children:v=>jsxRuntime.jsx(reactAriaComponents.DateSegment,{segment:v,className:Bl({isPlaceholder:v.isPlaceholder,isDisabled:!v.isEditable||a,size:r})})})}),l?jsxRuntime.jsx("div",{className:"mt-1 min-h-[20px]",children:typeof t=="string"?jsxRuntime.jsx(g,{size:r,children:t}):typeof t=="function"&&c?jsxRuntime.jsx(g,{size:r,children:t(c)}):o&&d==="below"?jsxRuntime.jsx(N,{size:r,children:o}):null}):jsxRuntime.jsx(jsxRuntime.Fragment,{children:typeof t=="string"?jsxRuntime.jsx(g,{size:r,className:"mt-1",children:t}):typeof t=="function"&&c?jsxRuntime.jsx(g,{size:r,className:"mt-1",children:t(c)}):o&&d==="below"?jsxRuntime.jsx(N,{size:r,className:"mt-1",children:o}):null})]})}function Ix({name:e,...o}){let{control:t,formState:{errors:r}}=reactHookForm.useFormContext(),n=r[e],i=n?.message;return jsxRuntime.jsx(reactHookForm.Controller,{name:e,control:t,render:({field:a})=>jsxRuntime.jsx(Go,{...o,value:a.value,onChange:a.onChange,isInvalid:!!n,errorMessage:i})})}function Mx({className:e,title:o="Please fix the following errors:",autoFocus:t=true}){let{formState:r}=reactHookForm.useFormContext(),n=Pt__namespace.useRef(null),i=r.errors,a=Object.entries(i||{}),s=a.length>0;if(Pt__namespace.useEffect(()=>{t&&s&&n.current?.focus();},[t,s]),!s)return null;let l=c=>{let u=`[name="${CSS.escape(c)}"]`,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:a.map(([c,u])=>{let d=u?.message||"Invalid value";return jsxRuntime.jsx("li",{children:jsxRuntime.jsx("button",{type:"button",className:"underline underline-offset-2",onClick:()=>l(c),children:d})},c)})})]})}function Hx({formId:e,disableWhenInvalid:o,disableWhenPristine:t,isDisabled:r,children:n,...i}){let{formState:a}=reactHookForm.useFormContext(),s=r||a.isSubmitting||o&&!a.isValid||t&&!a.isDirty;return jsxRuntime.jsx(k,{type:"submit",form:e,isDisabled:s,...i,children:n})}function Ux({name:e,getItemTitle:o,renderItem:t,onAdd:r}){let{control:n}=reactHookForm.useFormContext(),{fields:i,append:a,remove:s,swap:l}=reactHookForm.useFieldArray({control:n,name:e});return jsxRuntime.jsxs("div",{className:"flex flex-col gap-3",children:[i.map((c,u)=>jsxRuntime.jsxs(Te,{children:[jsxRuntime.jsx(yt,{title:o?o(u):`Item ${u+1}`,actions:jsxRuntime.jsxs("div",{className:"flex gap-2",children:[u>0&&jsxRuntime.jsx(k,{size:"sm",variant:"secondary",onPress:()=>l(u,u-1),children:"Up"}),u<i.length-1&&jsxRuntime.jsx(k,{size:"sm",variant:"secondary",onPress:()=>l(u,u+1),children:"Down"}),jsxRuntime.jsx(k,{size:"sm",variant:"secondary",onPress:()=>s(u),children:"Remove"})]})}),jsxRuntime.jsx(Mt,{children:t(u)})]},c.id)),jsxRuntime.jsx("div",{children:jsxRuntime.jsx(k,{variant:"secondary",onPress:()=>a(r?.()||{}),children:"Add item"})})]})}function qo(e){return jsxRuntime.jsx(reactAriaComponents.Form,{validationBehavior:"aria",...e,className:tailwindMerge.twMerge("flex flex-col gap-6",e.className)})}function on(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 ih({id:e,onSubmit:o,onInvalid:t,children:r,shouldFocusError:n=true,className:i,...a}){let s=reactHookForm.useForm(a),l=(c,u)=>{if(n&&e){let d=document.getElementById(e);d&&on(d);}t?.(c,u);};return jsxRuntime.jsx(reactHookForm.FormProvider,{...s,children:jsxRuntime.jsx(qo,{id:e,className:i,onSubmit:s.handleSubmit(o,l),children:r})})}function an({formId:e,show:o,isSubmitting:t,onCancel:r,primaryLabel:n="Save changes",secondaryLabel:i="Cancel",className:a}){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",a),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-secondary",children:"You have unsaved changes"}),jsxRuntime.jsxs("div",{className:"flex gap-2",children:[jsxRuntime.jsx(k,{variant:"secondary",onPress:r,children:i}),jsxRuntime.jsx(k,{type:"submit",form:e,isDisabled:!!t,children:t?"Saving...":n})]})]})}):null}function gh({formId:e,onCancel:o,primaryLabel:t,secondaryLabel:r,className:n}){let{formState:i}=reactHookForm.useFormContext();return jsxRuntime.jsx(an,{formId:e,show:i.isDirty,isSubmitting:i.isSubmitting,onCancel:o,primaryLabel:t,secondaryLabel:r,className:n})}function yh(e=true){let{formState:o}=reactHookForm.useFormContext();Pt__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 Ch({delayMs:e=800,onAutoSave:o}){let{watch:t,formState:r,getValues:n}=reactHookForm.useFormContext(),i=Pt__namespace.useRef(void 0);Pt__namespace.useEffect(()=>{let a=t(()=>{r.isDirty&&(i.current&&window.clearTimeout(i.current),i.current=window.setTimeout(async()=>{let s=n();await o(s);},e));});return ()=>{a.unsubscribe(),i.current&&window.clearTimeout(i.current);}},[t,r.isDirty,n,e,o]);}
|
|
2
|
-
Object.defineProperty(exports,"Controller",{enumerable:true,get:function(){return reactHookForm.Controller}});Object.defineProperty(exports,"useFieldArray",{enumerable:true,get:function(){return reactHookForm.useFieldArray}});Object.defineProperty(exports,"useFormContext",{enumerable:true,get:function(){return reactHookForm.useFormContext}});Object.defineProperty(exports,"useWatch",{enumerable:true,get:function(){return reactHookForm.useWatch}});exports.ErrorSummary=Mx;exports.FieldArrayList=Ux;exports.FormAutocomplete=Tp;exports.FormCheckbox=Wp;exports.FormCheckboxGroup=Qp;exports.FormColorField=fm;exports.FormDateField=Km;exports.FormFileUpload=cf;exports.FormMultiSelect=Hf;exports.FormNumberField=ag;exports.FormProvider=ih;exports.FormRadioCardGroup=Rg;exports.FormRadioGroup=Wg;exports.FormRichTextEditor=Sb;exports.FormSaveBar=gh;exports.FormSelect=Lb;exports.FormSwitch=qb;exports.FormTextArea=nx;exports.FormTextField=cx;exports.FormTimeField=Ix;exports.SubmitButton=Hx;exports.focusFirstError=
|
|
1
|
+
'use strict';var reactHookForm=require('react-hook-form'),Pt=require('react'),reactAria=require('react-aria'),reactAriaComponents=require('react-aria-components'),reactStately=require('react-stately'),tailwindMerge=require('tailwind-merge'),Zo=require('@phosphor-icons/react'),jsxRuntime=require('react/jsx-runtime'),lucideReact=require('lucide-react'),reactColorful=require('react-colorful'),el=require('@tiptap/extension-link'),react=require('@tiptap/react'),menus=require('@tiptap/react/menus'),nl=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 Pt__namespace=/*#__PURE__*/_interopNamespace(Pt);var Zo__namespace=/*#__PURE__*/_interopNamespace(Zo);var el__default=/*#__PURE__*/_interopDefault(el);var nl__default=/*#__PURE__*/_interopDefault(nl);var fn=Object.defineProperty;var gn=(e,o,t)=>o in e?fn(e,o,{enumerable:true,configurable:true,writable:true,value:t}):e[o]=t;var Xt=(e,o,t)=>gn(e,typeof o!="symbol"?o+"":o,t);function Je(e,o=false){let[t,r]=Pt.useState(o);return Pt.useEffect(()=>{if(typeof window>"u")return;let n=window.matchMedia(e);r(n.matches);let i=a=>{r(a.matches);};return n.addEventListener("change",i),()=>{n.removeEventListener("change",i);}},[e]),t}var pt={sm:"640px",md:"768px",lg:"1024px",xl:"1280px","2xl":"1536px"};function Nt(e="base"){let o=Je(`(min-width: ${pt.sm})`,e!=="base"),t=Je(`(min-width: ${pt.md})`,["md","lg","xl","2xl"].includes(e)),r=Je(`(min-width: ${pt.lg})`,["lg","xl","2xl"].includes(e)),n=Je(`(min-width: ${pt.xl})`,["xl","2xl"].includes(e)),i=Je(`(min-width: ${pt["2xl"]})`,e==="2xl"),a=!t,s=t,l="base";return i?l="2xl":n?l="xl":r?l="lg":t?l="md":o&&(l="sm"),{current:l,isSm:o,isMd:t,isLg:r,isXl:n,is2Xl:i,isMobile:a,isDesktop:s}}function Yo(e,o=300){let[t,r]=Pt.useState(e);return Pt.useEffect(()=>{let n=setTimeout(()=>r(e),o);return ()=>clearTimeout(n)},[e,o]),t}function wt(e,o=300){let[t,r]=Pt.useState(false);return Pt.useEffect(()=>{if(e){let n=setTimeout(()=>{r(true);},o);return ()=>clearTimeout(n)}r(false);},[e,o]),t}function It(...e){return e.filter(Boolean).join(" ")}var Ie={displayXl:"text-display-xl",displayLg:"text-display-lg",displayMd:"text-display-md",displaySm:"text-display-sm",headingXl:"text-heading-xl",headingLg:"text-heading-lg",headingMd:"text-heading-md",headingSm:"text-heading-sm",bodyLg:"text-body-lg",bodyMd:"text-body-md",bodySm:"text-body-sm",labelLg:"text-label-lg",labelMd:"text-label-md",labelSm:"text-label-sm",code:"text-code",agent:"text-agent"};function jo(e,...o){return It(Ie[e],...o)}function We(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 Y(e,o){return reactAriaComponents.composeRenderProps(e,t=>tailwindMerge.twMerge(o,t))}var O={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)]"}};function te(e,o){let t=Pt.forwardRef(({size:r=24,color:n="currentColor",className:i,mirrored:a,alt:s,...l},c)=>{let u=!!s||"aria-label"in l;return jsxRuntime.jsx("svg",{ref:c,xmlns:"http://www.w3.org/2000/svg",width:r,height:r,viewBox:"0 0 256 256",fill:n,className:i,transform:a?"scale(-1, 1)":void 0,"aria-hidden":u?void 0:true,role:u?"img":void 0,"aria-label":s,...l,children:o})});return t.displayName=e,t}var Et=()=>jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("path",{d:"M12 128h44M200 128h44",fill:"none",stroke:"currentColor",strokeWidth:"16",strokeLinecap:"round"}),jsxRuntime.jsx("circle",{cx:"76",cy:"128",r:"20",fill:"none",stroke:"currentColor",strokeWidth:"16"}),jsxRuntime.jsx("circle",{cx:"180",cy:"128",r:"20",fill:"none",stroke:"currentColor",strokeWidth:"16"})]}),Qo=()=>jsxRuntime.jsx("path",{d:"M166 120 88 70",fill:"none",stroke:"currentColor",strokeWidth:"16",strokeLinecap:"round"}),Xo=()=>jsxRuntime.jsx("path",{d:"M162 122 92 128",fill:"none",stroke:"currentColor",strokeWidth:"16",strokeLinecap:"round"}),Jo=()=>jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("path",{d:"M112 85.7 A32 32 0 1 1 144 85.7",fill:"none",stroke:"currentColor",strokeWidth:"16",strokeLinecap:"round"}),jsxRuntime.jsx("circle",{cx:"128",cy:"58",r:"8",fill:"currentColor",stroke:"none"})]}),kn=te("TextureRecloser",jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("rect",{x:"36",y:"36",width:"184",height:"184",fill:"none",stroke:"currentColor",strokeWidth:"16"}),jsxRuntime.jsx("text",{x:"128",y:"126",textAnchor:"middle",dominantBaseline:"central",fontFamily:"ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif",fontSize:"140",fontWeight:"700",fill:"currentColor",stroke:"none",children:"R"})]})),Tn=te("TextureFuse",jsxRuntime.jsx("path",{d:"M20 128h72q18 -84 36 0q18 84 36 0h72",fill:"none",stroke:"currentColor",strokeWidth:"16",strokeLinecap:"round",strokeLinejoin:"round"})),Nn=te("TextureBreaker",jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("rect",{x:"36",y:"36",width:"184",height:"184",fill:"none",stroke:"currentColor",strokeWidth:"16"}),jsxRuntime.jsx("text",{x:"128",y:"126",textAnchor:"middle",dominantBaseline:"central",fontFamily:"ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif",fontSize:"140",fontWeight:"700",fill:"currentColor",stroke:"none",children:"B"})]})),wn=te("TextureSource",jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("path",{d:"M4 128h40M212 128h40",fill:"none",stroke:"currentColor",strokeWidth:"16",strokeLinecap:"round"}),jsxRuntime.jsx("circle",{cx:"128",cy:"128",r:"84",fill:"none",stroke:"currentColor",strokeWidth:"16"}),jsxRuntime.jsx("path",{d:"M92 128q18 -84 36 0q18 84 36 0",fill:"none",stroke:"currentColor",strokeWidth:"16",strokeLinecap:"round",strokeLinejoin:"round"})]})),In=te("TextureCapacitor",jsxRuntime.jsx(jsxRuntime.Fragment,{children:jsxRuntime.jsx("path",{d:"M4 128h106M146 128h106M110 72v112M146 72v112",fill:"none",stroke:"currentColor",strokeWidth:"16",strokeLinecap:"round"})})),En=te("TextureRegulator",jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("circle",{cx:"128",cy:"128",r:"92",fill:"none",stroke:"currentColor",strokeWidth:"16"}),jsxRuntime.jsx("text",{x:"128",y:"126",textAnchor:"middle",dominantBaseline:"central",fontFamily:"ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif",fontSize:"128",fontWeight:"700",fill:"currentColor",stroke:"none",children:"V"})]})),Vn=te("TextureSwitch",jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Et,{}),jsxRuntime.jsx(Qo,{})]})),Ln=te("TextureSwitchClosed",jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Et,{}),jsxRuntime.jsx(Xo,{})]})),Bn=te("TextureOpenPoint",jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("path",{d:"M112 52 C 74 92, 74 164, 112 204",fill:"none",stroke:"currentColor",strokeWidth:"18",strokeLinecap:"round"}),jsxRuntime.jsx("path",{d:"M144 52 C 182 92, 182 164, 144 204",fill:"none",stroke:"currentColor",strokeWidth:"18",strokeLinecap:"round"})]})),Mn=te("TextureSectionalizerOpen",jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Et,{}),jsxRuntime.jsx(Qo,{}),jsxRuntime.jsx(Jo,{})]})),Dn=te("TextureSectionalizerClosed",jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Et,{}),jsxRuntime.jsx(Xo,{}),jsxRuntime.jsx(Jo,{})]})),An=te("TextureTransformer",jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("path",{d:"M40 64H88A22 22 0 0 1 88 108A22 22 0 0 1 88 152A22 22 0 0 1 88 196H40",fill:"none",stroke:"currentColor",strokeWidth:"16",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx("path",{d:"M216 64H168A22 22 0 0 0 168 108A22 22 0 0 0 168 152A22 22 0 0 0 168 196H216",fill:"none",stroke:"currentColor",strokeWidth:"16",strokeLinecap:"round",strokeLinejoin:"round"})]})),Ze={1:[128],2:[110,146],3:[92,128,164]},Jt=e=>jsxRuntime.jsx("path",{d:`M24 ${e}h208`,fill:"none",stroke:"currentColor",strokeWidth:"16",strokeLinecap:"round"},e),Zt=e=>jsxRuntime.jsx("path",{d:`M24 ${e}h208`,fill:"none",stroke:"currentColor",strokeWidth:"16",strokeLinecap:"round",pathLength:100,strokeDasharray:"20 20"},e),_n=te("TextureSinglePhaseOverheadLine",jsxRuntime.jsx(jsxRuntime.Fragment,{children:Ze[1].map(Jt)})),zn=te("TextureTwoPhaseOverheadLine",jsxRuntime.jsx(jsxRuntime.Fragment,{children:Ze[2].map(Jt)})),Hn=te("TextureThreePhaseOverheadLine",jsxRuntime.jsx(jsxRuntime.Fragment,{children:Ze[3].map(Jt)})),On=te("TextureSinglePhaseUndergroundLine",jsxRuntime.jsx(jsxRuntime.Fragment,{children:Ze[1].map(Zt)})),$n=te("TextureTwoPhaseUndergroundLine",jsxRuntime.jsx(jsxRuntime.Fragment,{children:Ze[2].map(Zt)})),Gn=te("TextureThreePhaseUndergroundLine",jsxRuntime.jsx(jsxRuntime.Fragment,{children:Ze[3].map(Zt)})),Wn=te("TextureSupportStructure",jsxRuntime.jsx("circle",{cx:"128",cy:"128",r:"40",fill:"currentColor",stroke:"none"})),Vt={TextureRecloser:kn,TextureFuse:Tn,TextureBreaker:Nn,TextureSource:wn,TextureCapacitor:In,TextureRegulator:En,TextureSwitch:Vn,TextureSwitchClosed:Ln,TextureOpenPoint:Bn,TextureSectionalizerOpen:Mn,TextureSectionalizerClosed:Dn,TextureTransformer:An,TextureSinglePhaseOverheadLine:_n,TextureTwoPhaseOverheadLine:zn,TextureThreePhaseOverheadLine:Hn,TextureSinglePhaseUndergroundLine:On,TextureTwoPhaseUndergroundLine:$n,TextureThreePhaseUndergroundLine:Gn,TextureSupportStructure:Wn};if(process.env.NODE_ENV==="development")for(let e of Object.keys(Vt))e in Zo__namespace&&console.error(`Custom icon "${e}" collides with a Phosphor icon of the same name. Rename it (use the "Texture" prefix) to keep the icon namespace unambiguous.`);var et={xs:16,sm:20,md:24,lg:32,xl:40,"2xl":48},y=Pt.memo(({name:e,size:o="md",color:t,weight:r="regular",className:n,ariaLabel:i,...a})=>{let s=Vt[e]??Zo__namespace[e];if(!s)return process.env.NODE_ENV==="development"&&console.error(`Icon "${e}" not found in @phosphor-icons/react or the custom icon registry`),null;let l=typeof o=="string"&&o in et?et[o]:o,c=tailwindMerge.twMerge("inline-block flex-shrink-0",!t&&"text-current",n);return jsxRuntime.jsx(s,{...a,size:l,color:t,weight:r,className:c,"aria-label":i||`${e} icon`,"data-testid":`icon-${e}`})});y.displayName="Icon";var qn=Pt.memo(({variant:e="subtle",shape:o="square",containerSize:t,containerClassName:r,size:n="md",className:i,name:a,color:s,weight:l,ariaLabel:c,ref:u,...d})=>{let b=typeof n=="string"&&n in et?et[n]:n,v=t?typeof t=="string"&&t in et?et[t]:t:b*1.75,m=tailwindMerge.twMerge("inline-flex items-center justify-center flex-shrink-0",o==="circle"?"rounded-full":"rounded-lg",e==="subtle"&&"bg-background-muted",e==="solid"&&"bg-action-brand text-[color:var(--color-action-brand-text)]",e==="outline"&&"border-2 border-current",r);return jsxRuntime.jsx("div",{className:m,style:{width:v,height:v},children:jsxRuntime.jsx(y,{...d,name:a,size:n,color:s,weight:l,className:i,ariaLabel:c})})});qn.displayName="IconWithContainer";var Qn=({isEntering:e,isExiting:o,className:t})=>["max-w-[200px] group bg-action-default border border-action-default-hover text-[color:var(--color-action-default-text)] text-sm rounded-lg drop-shadow-lg will-change-transform px-3 py-1",e?"animate-in fade-in placement-bottom:slide-in-from-top-0.5 placement-top:slide-in-from-bottom-0.5 placement-left:slide-in-from-right-0.5 placement-right:slide-in-from-left-0.5 ease-out duration-200":"",o?"animate-out fade-out placement-bottom:slide-out-to-top-0.5 placement-top:slide-out-to-bottom-0.5 placement-left:slide-out-to-right-0.5 placement-right:slide-out-to-left-0.5 ease-in duration-150":"",t].filter(Boolean).join(" ");function rr({children:e,content:o,...t}){return jsxRuntime.jsxs(reactAriaComponents.TooltipTrigger,{delay:200,children:[e,jsxRuntime.jsxs(reactAriaComponents.Tooltip,{...t,offset:10,className:reactAriaComponents.composeRenderProps(t.className,(r,n)=>Qn({...n,className:r})),children:[jsxRuntime.jsx(reactAriaComponents.OverlayArrow,{children:jsxRuntime.jsx("svg",{width:8,height:8,viewBox:"0 0 8 8",className:"fill-action-default stroke-action-default-hover 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 L4 4 L8 0"})})}),o]})]})}function Ee(){let[e,o]=Pt__namespace.default.useState(false),t=Pt__namespace.default.useCallback((n,i)=>{o(true),i?.(n);},[]),r=Pt__namespace.default.useCallback((n,i)=>{o(false),i?.(n);},[]);return {isFocused:e,handleFocus:t,handleBlur:r}}var ae=Pt__namespace.default.forwardRef(({children:e,className:o},t)=>jsxRuntime.jsx("div",{ref:t,className:tailwindMerge.twMerge("relative w-full",o),children:e}));ae.displayName="InputWrapper";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-[48%] -translate-y-1/2 transform text-text-secondary hover:text-text-primary cursor-pointer",t),"aria-label":"Clear input",onMouseDown:r=>{r.preventDefault(),r.stopPropagation();},children:jsxRuntime.jsx(y,{name:"X",size:o==="sm"?16:20})})}function ft(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 Xn(e){return e.isDisabled?"bg-background-muted":e.transparent?"bg-transparent":"bg-background-input"}function Jn(e){return e==="sm"?"!text-base md:!text-[length:var(--control-text-sm)]":e==="md"?"!text-base md:!text-[length:var(--control-text-md)]":""}function pe(e){let{isInvalid:o,isDisabled:t,isFocused:r,transparent:n,size:i="md",className:a}=e;return tailwindMerge.twMerge("w-full",ft({isInvalid:o,isDisabled:t,isFocused:r}),Xn({transparent:n,isDisabled:t}),O[i].text,O[i].height,O[i].padding,Jn(i),a)}function q({children:e,size:o="md",tooltip:t,description:r,descriptionPlacement:n="below",isRequired:i,className:a,htmlFor:s}){let l=t||r&&n==="tooltip",c=t||r,u=r&&n==="inline",d=jsxRuntime.jsxs("label",{htmlFor:s,className:tailwindMerge.twMerge(O[o].text,"!text-text-label font-semibold flex items-center gap-1",a),children:[e,i&&jsxRuntime.jsx("span",{children:"*"}),l&&jsxRuntime.jsx("span",{className:"inline-flex items-center text-text-secondary",children:jsxRuntime.jsx(y,{name:"Info",size:o==="sm"?16:20})}),u&&jsxRuntime.jsx("span",{className:"text-text-secondary font-normal ml-1",children:r})]});return l&&c?jsxRuntime.jsx(rr,{content:c,children:d}):d}function N({size:e="md",className:o,children:t,...r}){return jsxRuntime.jsx("div",{...r,className:tailwindMerge.twMerge("leading-[2.25] text-text-secondary",O[e].text,o),children:t})}function g({children:e,size:o="md",className:t}){return jsxRuntime.jsx("div",{role:"alert",className:tailwindMerge.twMerge(O[o].text,"text-feedback-error-text",t),children:e})}function Bt({size:e="md",isInvalid:o,isDisabled:t,isFocused:r,transparent:n,className:i,...a}){return jsxRuntime.jsx("input",{className:pe({isInvalid:o,isDisabled:t,isFocused:r,transparent:n,size:e,className:i}),...a})}var oa="flex font-medium justify-center items-center gap-2 text-center transition rounded-[var(--control-border-radius)] whitespace-nowrap box-border",ra="bg-action-primary text-[color:var(--color-action-primary-text)] hover:bg-action-primary-hover forced-colors:bg-[ButtonText] forced-colors:text-[ButtonFace] border-2 border-transparent",na={primary:ra,secondary:"bg-action-secondary text-[color:var(--color-action-secondary-text)] border-2 border-border-muted hover:bg-action-secondary-hover forced-colors:border-[ButtonBorder] forced-colors:bg-[ButtonFace] forced-colors:text-[ButtonText]",ghost:"border-none text-text-primary hover:bg-text-primary/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-primary hover:text-action-primary/90 hover:underline hover:decoration-2 hover:underline-offset-4",icon:"border-none text-text-primary hover:bg-background-hover hover:text-text-primary forced-colors:text-[ButtonText] forced-colors:hover:bg-[ButtonFace] p-1 flex-shrink-0 rounded-[var(--control-border-radius)]",unstyled:"bg-transparent"},ar={full:"w-full",default:"w-fit"},aa="opacity-50 cursor-not-allowed pointer-events-none",ia="opacity-100 cursor-pointer",sa={"top-right":"-right-2 -top-2","top-left":"-left-2 -top-2","bottom-right":"-right-2 -bottom-2","bottom-left":"-left-2 -bottom-2"},la={primary:"bg-action-primary text-[color:var(--color-action-primary-text)]",destructive:"bg-feedback-error-border text-text-inverse"};function da(e){return !e||e==="default"||e==="brand"?"primary":e}function ca(e){let{variant:o="primary",size:t="md",isDisabled:r,fullWidth:n=false,isLoading:i=false}=e,a=da(o),s=a==="unstyled"?"":`${oa} ${na[a]}`;a!=="unstyled"&&(s+=` ${O[t].text} ${O[t].height} ${O[t].padding} ${O[t].gap}`),r||i?s+=` ${aa}`:s+=` ${ia}`,n?s+=` ${ar.full}`:s+=` ${ar.default}`;let l=a==="primary"?"focus-visible:outline-action-primary":void 0;return [s,We(),l].filter(Boolean).join(" ")}function k(e){let{icon:o,children:t,isLoading:r=false,loadingText:n,loadingIndicator:i,size:a="md",iconPosition:s="left",iconWeight:l,href:c,className:u,badgeNumber:d,badgeVariant:b="primary",badgePosition:v="top-right",style:m,target:f,rel:h,...C}=e,R=o?jsxRuntime.jsx(y,{name:o,size:a,weight:l}):null,A=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[s==="left"&&R,typeof t=="function"?null:t,s==="right"&&R]}),M=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:i||jsxRuntime.jsx(y,{name:"CircleNotch",size:a,className:"animate-spin","aria-hidden":"true"})}),jsxRuntime.jsx("div",{className:"invisible","aria-hidden":"true",children:A}),n&&jsxRuntime.jsx("span",{className:"sr-only",role:"status","aria-live":"polite",children:n})]}),L=(d??0)>0,T=tailwindMerge.twMerge(ca(e),u),w=c?{href:c,target:f,rel:h,...C}:{};if(c){let{onPress:I,onPressStart:se,onPressEnd:H,onPressChange:me,onPressUp:J,onAuxClick:K,onContextMenu:fe,onDoubleClick:$,...F}=C;Object.assign(w,F);}let X=c?jsxRuntime.jsx(reactAriaComponents.Link,{...w,...r&&{"aria-busy":true},style:L?void 0:m,className:T,children:r?M:typeof t=="function"?(function(I){return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[s==="left"&&R,t(I),s==="right"&&R]})}):A}):jsxRuntime.jsx(reactAriaComponents.Button,{...C,...r&&{"aria-busy":true},style:L?void 0:m,className:T,children:r?M:typeof t=="function"?(function(I){return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[s==="left"&&R,t(I),s==="right"&&R]})}):A});return L?jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("relative flex",u),style:m,children:[X,jsxRuntime.jsx("span",{className:`absolute ${sa[v]} flex h-5 w-5 items-center justify-center rounded-full ${la[b]} text-xs font-medium`,"aria-label":`${d} items`,children:d})]}):X}function qe({transparent:e=false,className:o,children:t,...r}){return jsxRuntime.jsx(reactAriaComponents.ModalOverlay,{...r,className:reactAriaComponents.composeRenderProps(o,(n,i)=>tailwindMerge.twMerge("fixed inset-0 z-50","outline-none focus:outline-none focus-visible:outline-none ring-0 focus:ring-0 focus-visible:ring-0",e?"bg-transparent":["bg-gradient-to-br from-background-modal/20 via-background-modal/15 to-background-modal/20","backdrop-blur-[2px]","supports-[backdrop-filter]:bg-background-modal/15"].join(" "),i.isEntering&&["animate-in fade-in","duration-300 ease-out"].join(" "),i.isExiting&&["animate-out fade-out","duration-200 ease-in"].join(" "),n)),children:t})}function Pa({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(" "),i=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(" "):"",a=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,i,a,t].filter(Boolean).join(" ")}function ot({children:e,showArrow:o=false,withBackdrop:t=false,className:r,isDismissable:n=true,disableGroup:i=false,...a}){let l=reactAriaComponents.useSlottedContext(reactAriaComponents.PopoverContext)?.trigger==="SubmenuTrigger",c=o?12:8;c=l?c-6:c;let u=jsxRuntime.jsxs(reactAriaComponents.Popover,{offset:c,...a,className:reactAriaComponents.composeRenderProps(r,(d,b)=>Pa({...b,className:d,disableGroup:i})),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(qe,{isDismissable:n,children:jsxRuntime.jsx(reactAriaComponents.Modal,{className:"outline-none focus:outline-none focus-visible:outline-none ring-0 focus:ring-0 focus-visible:ring-0",isDismissable:n,children:u})}):u}function ir(e=true){let[o,t]=Pt.useState(null);return Pt.useEffect(()=>{if(!e){t(null);return}let r=typeof window<"u"?window.visualViewport:null;if(!r)return;let n=()=>{let i=Math.max(0,window.innerHeight-r.height-(r.offsetTop??0));t({height:r.height,keyboardOffset:i});};return n(),r.addEventListener("resize",n),r.addEventListener("scroll",n),()=>{r.removeEventListener("resize",n),r.removeEventListener("scroll",n);}},[e]),o}function ro({action:e,defaultVariant:o,defaultSize:t="lg"}){let r=!!e.formId;return jsxRuntime.jsx(k,{type:r?"submit":"button",form:r?e.formId:void 0,size:e.size||t,variant:e.variant||o,onPress:r?void 0:e.onPress,isLoading:e.isLoading,isDisabled:e.isDisabled,children:e.label})}function ao({primaryAction:e,secondaryAction:o,tertiaryAction:t,footerContent:r}){let n=e||o||t;return !n&&!r?null:jsxRuntime.jsxs("div",{className:`flex w-full flex-col items-center justify-center border-t p-4 ${r?"h-28":""}`,children:[r&&jsxRuntime.jsx("div",{className:"flex h-10 justify-center",children:r}),n&&jsxRuntime.jsxs("div",{className:"flex w-full items-center justify-between gap-3",children:[jsxRuntime.jsx("div",{children:t&&jsxRuntime.jsx(ro,{action:t,defaultVariant:"destructive"})}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[o&&jsxRuntime.jsx(ro,{action:o,defaultVariant:"secondary"}),e&&jsxRuntime.jsx(ro,{action:e,defaultVariant:"primary"})]})]})]})}var Sa={heading:{sm:Ie.headingSm,md:Ie.headingMd,lg:Ie.headingLg,xl:Ie.headingXl},display:{sm:Ie.displaySm,md:Ie.displayMd,lg:Ie.displayLg,xl:Ie.displayXl}},ka={page:"h-16 leading-[62px]"};function xt({tag:e="h1",variant:o="heading",size:t="lg",height:r,className:n="",children:i}){let a=t==="xs"?"sm":t,s=Sa[o][a],l=r?ka[r]:"";return jsxRuntime.jsx(e,{className:It(s,"text-text-primary",l,n),children:i})}var nt=({title:e,onClose:o,hideCloseIcon:t=false,titleAlign:r="left",hasBackArrow:n=false,onBack:i,headerContent:a})=>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(k,{variant:"icon",onPress:i,className:"absolute left-6","aria-label":"Go back",children:jsxRuntime.jsx(y,{name:"CaretLeft","data-testid":"back-arrow"})}),a||jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[e&&jsxRuntime.jsx(xt,{size:"xs",children:e}),o&&!t&&jsxRuntime.jsx(k,{variant:"icon",onPress:o,"aria-label":"Close dialog",children:jsxRuntime.jsx(y,{name:"X","data-testid":"close-button"})})]})]});var Ea=Pt.createContext(false);function lr({children:e}){return jsxRuntime.jsx(Ea.Provider,{value:true,children:e})}var ke=({width:e,height:o,variant:t="rect",animation:r="pulse",gradient:n=false,flex:i=false,stack:a,responsive:s,delay:l=0,adjustAnimationSpeedBasedOnWidth:c=false,ariaLabel:u,className:d,"data-testid":b})=>{let[v,m]=Pt.useState(l===0);if(Pt.useEffect(()=>{if(l>0){let L=setTimeout(()=>m(true),l);return ()=>clearTimeout(L)}},[l]),!v)return null;let f=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)]",h=c&&e?(()=>{let L=typeof e=="number"?e:parseFloat(String(e));return isNaN(L)?"":`animation-duration-[${Math.max(.8,L/100)}s]`})():"",C=r==="pulse"?`animate-pulse ${h}`: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 ${h}`:"",R="rounded-sm";t==="circle"&&(R="rounded-full"),t==="text"&&(R="h-4 w-full rounded-sm");let A=i?"flex-1 min-w-0":"",M=s?Object.entries(s).map(([L,T])=>`${L}:w-[${T}]`).join(" "):"";return a?jsxRuntime.jsx("div",{className:"space-y-2","data-testid":b,children:a.map((L,T)=>jsxRuntime.jsx("div",{className:tailwindMerge.twMerge(f,C,R,A,M,d),style:{width:L,height:o}},T))}):jsxRuntime.jsx("div",{className:tailwindMerge.twMerge(f,C,R,A,M,d),style:{width:e,height:o},role:"presentation","aria-hidden":!u,"aria-label":u??void 0,"data-testid":b})};var Ma={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"},Da="rounded-lg",lo={square:"aspect-square",video:"aspect-video",wide:"aspect-[2/1]",auto:""},Aa={start:"justify-start",end:"justify-end",center:"justify-center",between:"justify-between"};function cr(e){return Pt__namespace.default.Children.toArray(e).some(o=>Pt__namespace.default.isValidElement(o)?o.type===Pt__namespace.default.Fragment?cr(o.props.children):o.type===yt&&!!o.props.title:false)}function Te({variant:e="outlined",className:o,children:t,isLoading:r=false,layout:n="default"}){let i=cr(t)?jsxRuntime.jsx(lr,{children:t}):t;return jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("w-full overflow-hidden",Ma[e],Da,n==="flex"&&"flex flex-col",o),"data-testid":"card",children:r?jsxRuntime.jsx(ke,{width:"100%",height:"100%",className:"rounded-none"}):i})}function yt({title:e,subtitle:o,actions:t,leading:r,className:n,isLoading:i=false}){return i?jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("p-6 pb-4",n),children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-start mb-1",children:[jsxRuntime.jsx(ke,{width:120,height:20}),jsxRuntime.jsx(ke,{width:24,height:24})]}),o&&jsxRuntime.jsx(ke,{width:200,height:16})]}):!e&&!o&&!t&&!r?null:jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("p-6 pb-4",n),children:jsxRuntime.jsxs("div",{className:"flex justify-between items-start gap-4",children:[r&&jsxRuntime.jsx("div",{className:"flex-shrink-0",children:r}),jsxRuntime.jsxs("div",{className:"min-w-0 flex-1",children:[e&&jsxRuntime.jsx("div",{className:"mb-1",children:typeof e=="string"?jsxRuntime.jsx(xt,{tag:"h3",size:"sm",className:"text-text-primary",children:e}):e}),o&&jsxRuntime.jsx("div",{className:jo("bodySm","text-text-secondary"),children:o})]}),t&&jsxRuntime.jsx("div",{className:"flex-shrink-0",children:t})]})})}function ur({src:e,alt:o,aspectRatio:t="auto",className:r,children:n,isLoading:i=false}){return i?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("bg-background-muted",lo[t],r),children:jsxRuntime.jsx(ke,{width:"100%",height:"100%"})}):n?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("overflow-hidden",lo[t],r),children:n}):e?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("overflow-hidden",lo[t],r),children:jsxRuntime.jsx("img",{src:e,alt:o||"",className:"w-full h-full object-cover",loading:"lazy"})}):null}function Mt({className:e,children:o,isLoading:t=false,fill:r=false,style:n}){let a=e?.match(/p(?:t|b|l|r|x|y)?-(?:\d+(?:\.\d+)?|px|\[.+?\])/)?"":"px-6 py-4";return t?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge(a,r&&"flex-1 flex flex-col min-h-0",e),style:n,children:jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx(ke,{width:"100%",height:16}),jsxRuntime.jsx(ke,{width:"80%",height:16}),jsxRuntime.jsx(ke,{width:"60%",height:16})]})}):o?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge(a,"text-text-primary",r&&"flex-1 flex flex-col min-h-0",e),style:n,children:o}):null}function pr({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(ke,{width:80,height:32}),jsxRuntime.jsx(ke,{width:60,height:32})]}):o?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("px-6 py-4 flex items-center gap-2",Aa[t],e),children:o}):null}Te.Header=yt;Te.Media=ur;Te.Content=Mt;Te.Footer=pr;var vt=class extends Pt.Component{constructor(){super(...arguments);Xt(this,"state",{hasError:false});Xt(this,"handleRetry",()=>{this.setState({hasError:false,error:void 0}),typeof window<"u"&&window.location.reload();});}static getDerivedStateFromError(t){return {hasError:true,error:t}}componentDidCatch(t,r){console.error("Error Boundary caught an error:",t,r);}render(){return this.state.hasError?this.props.fallback?this.props.fallback:jsxRuntime.jsxs(Te,{children:[this.props.title&&jsxRuntime.jsx(Te.Header,{title:this.props.title}),jsxRuntime.jsx(Te.Content,{children:jsxRuntime.jsxs("div",{className:"flex flex-col items-center justify-center gap-4","data-testid":"error-boundary",children:[jsxRuntime.jsx("p",{className:"text-feedback-error-text",children:this.state.error?.message||"Something went wrong"}),jsxRuntime.jsx("button",{className:"rounded bg-action-default px-4 py-2 text-[color:var(--color-action-default-text)] hover:bg-action-default-hover",onClick:this.handleRetry,children:"Retry"})]})})]}):this.props.children}};var Oa=.3,$a=.5;function it({children:e,title:o,headerContent:t,titleAlign:r="left",hideCloseIcon:n=false,hasBackArrow:i=false,onBack:a,isOpen:s,onClose:l,isDismissable:c=true,transparentOverlay:u=false,primaryAction:d,secondaryAction:b,footerContent:v,maxHeight:m="80vh",height:f,maxWidth:h="640px",contentPadding:C=true,showHandle:R=true,animationVariant:A="scale",className:M}){let[L,T]=Pt.useState(false),[w,X]=Pt.useState(0),[I,se]=Pt.useState(false),H=ir(s),me=H?.height??null,J=H?.keyboardOffset??0,K=Pt.useRef(null),fe=Pt.useRef(null),$=Pt.useRef(null),F=Pt.useRef({isDragging:false,startY:0,startTime:0,pointerId:null});Pt.useEffect(()=>{if(s){let x=setTimeout(()=>{T(true),setTimeout(()=>T(false),600);},400);return ()=>clearTimeout(x)}},[s]),Pt.useEffect(()=>{s||(X(0),se(false),F.current={isDragging:false,startY:0,startTime:0,pointerId:null});},[s]),Pt.useEffect(()=>{let x=fe.current;if(!x||!s)return;let Q=null,G=Z=>{let ve=Z.target;ve&&["INPUT","TEXTAREA","SELECT"].includes(ve.tagName)&&(Q&&clearTimeout(Q),Q=setTimeout(()=>{ve.scrollIntoView({block:"nearest",behavior:"smooth"});},320));};return x.addEventListener("focusin",G),()=>{x.removeEventListener("focusin",G),Q&&clearTimeout(Q);}},[s]);let oe=Pt.useCallback(x=>{c&&(x.pointerType!=="touch"&&x.pointerType!=="pen"||($.current&&(clearTimeout($.current),$.current=null),F.current={isDragging:true,startY:x.clientY,startTime:Date.now(),pointerId:x.pointerId},se(false),x.currentTarget.setPointerCapture(x.pointerId)));},[c]),we=Pt.useCallback(x=>{let{isDragging:Q,startY:G,pointerId:Z}=F.current;if(!Q||x.pointerId!==Z)return;let ve=x.clientY-G;X(Math.max(0,ve));},[]),le=Pt.useCallback(x=>{let{isDragging:Q,startY:G,startTime:Z,pointerId:ve}=F.current;if(!Q||x.pointerId!==ve)return;let S=x.clientY-G,Fe=Date.now()-Z,De=S/Fe;F.current={isDragging:false,startY:0,startTime:0,pointerId:null};let Ae=(K.current?.getBoundingClientRect().height??0)*Oa;(S>Ae||De>$a&&S>50)&&c?(l?.(),X(0)):(se(true),X(0),$.current=setTimeout(()=>{se(false),$.current=null;},200));},[c,l]);if(!s)return null;let de=o||t,ue=d||b||v;return jsxRuntime.jsx(vt,{children:jsxRuntime.jsx(qe,{isOpen:s,onOpenChange:x=>{x||l?.();},isDismissable:c,transparent:u,style:{paddingBottom:J>0?`${J}px`:void 0,transition:"padding-bottom 0.25s ease-out"},className:"flex items-end justify-center p-0 sm:p-4",children:jsxRuntime.jsx(reactAriaComponents.Modal,{className:"w-full max-w-full p-0 sm:p-2 outline-none focus:outline-none focus-visible:outline-none ring-0 focus:ring-0 focus-visible:ring-0",isDismissable:c,children:jsxRuntime.jsx("div",{ref:K,className:tailwindMerge.twMerge("w-full",I&&"transition-transform duration-200"),style:{transform:w>0?`translateY(${w}px)`:void 0},children:jsxRuntime.jsxs(reactAriaComponents.Dialog,{className:tailwindMerge.twMerge("relative flex w-full flex-col overflow-hidden","bg-background-surface","shadow-2xl shadow-black/30 dark:shadow-black/60","border-t border-x border-border-default/40","outline-none focus:outline-none focus-visible:outline-none ring-0 focus:ring-0 focus-visible:ring-0 focus:shadow-none","origin-bottom",A==="scale"?"animate-[tray-enter-scale_400ms_cubic-bezier(0.32,0.72,0,1)]":"animate-[tray-enter_400ms_cubic-bezier(0.32,0.72,0,1)]",A==="scale"?"data-[exiting]:animate-[tray-exit-scale_250ms_cubic-bezier(0.32,0,0.67,0)]":"data-[exiting]:animate-[tray-exit_250ms_cubic-bezier(0.32,0,0.67,0)]",M),style:{maxWidth:h,...f?{height:f}:{maxHeight:/\d/.test(m)?me!==null?`min(${m}, ${Math.max(me-8,0)}px, 100dvh)`:`min(${m}, 100dvh)`:m}},children:[R&&jsxRuntime.jsx("div",{className:"absolute top-0 left-0 right-0 h-8 z-10 flex justify-center items-start pt-2 touch-none cursor-grab active:cursor-grabbing",onPointerDown:oe,onPointerMove:we,onPointerUp:le,onPointerCancel:le,children:jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("h-1 w-12 rounded-full bg-border-muted transition-all duration-300","hover:bg-border-default hover:w-16",L&&"animate-[handle-wiggle_0.6s_ease-in-out]")})}),de&&(i?jsxRuntime.jsx(nt,{title:o,headerContent:t,titleAlign:r,hideCloseIcon:n||!l,hasBackArrow:true,onBack:a??(()=>{}),onClose:l||(()=>{})}):jsxRuntime.jsx(nt,{title:o,headerContent:t,titleAlign:r,hideCloseIcon:n||!l,onClose:l||(()=>{})})),jsxRuntime.jsx("div",{ref:fe,className:tailwindMerge.twMerge("flex-1 min-h-0 overflow-y-auto overscroll-contain",C?"p-4":"p-0"),children:e}),ue&&jsxRuntime.jsx(ao,{primaryAction:d,secondaryAction:b,footerContent:v})]})})})})})}it.displayName="Tray";var xo=Pt.createContext("md");function hr(){return Pt.useContext(xo)}function fo(e="md"){let o=e==="sm"?"!text-base md:!text-[length:var(--control-text-sm)]":e==="md"?"!text-base md:!text-[length:var(--control-text-md)]":"";return `flex-1 text-start data-[placeholder]:text-text-disabled overflow-hidden text-ellipsis whitespace-nowrap ${O[e].text} ${o}`}function Ya(){let e=Pt__namespace.default.useCallback((t,r)=>{r?.(t);},[]),o=Pt__namespace.default.useCallback((t,r)=>{r?.(t);},[]);return {handleFocus:e,handleBlur:o}}function ho({label:e,description:o,errorMessage:t,children:r,items:n,renderItem:i,renderSelectedValue:a,size:s="md",selectedKey:l,defaultSelectedKey:c,onSelectionChange:u,placeholder:d,showErrors:b=false,tooltip:v,isRequired:m,transparent:f,reserveErrorSpace:h=false,placement:C="bottom start",shouldFlip:R=true,menuWidth:A="match",descriptionPlacement:M="below",useMobileTray:L=true,...T}){let[w,X]=Pt.useState(null),[I,se]=Pt.useState(null),[H,me]=Pt.useState(false),J=l??w??c,{handleFocus:K,handleBlur:fe}=Ya(),{isMobile:$}=Nt(),F=L&&$,oe=Pt__namespace.default.useMemo(()=>!a||!J||!n?null:Array.from(n).find(Q=>Q.id===J)??null,[a,J,n]),we=x=>{u&&x!==null&&u(x),u||X(x);},le=Pt.useRef(null),de=Pt.useRef(null),ue=()=>{F&&me(!H);};return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(reactAriaComponents.Select,{...T,selectedKey:J,defaultSelectedKey:c,onSelectionChange:we,placeholder:d,className:Y(T.className,"group flex w-full flex-col"),ref:le,onOpenChange:x=>{F||(x&&de.current?se(de.current.offsetWidth):x||le.current?.blur());},children:({isDisabled:x,isInvalid:Q,isOpen:G})=>jsxRuntime.jsxs("div",{className:"flex flex-col",children:[e&&jsxRuntime.jsx(q,{size:s,tooltip:v,description:M==="tooltip"||M==="inline"?o:void 0,descriptionPlacement:M,isRequired:m,children:e}),jsxRuntime.jsx(ae,{children:jsxRuntime.jsx("div",{ref:de,children:jsxRuntime.jsxs(k,{variant:"unstyled",className:tailwindMerge.twMerge(pe({isInvalid:Q||b&&!!t,isDisabled:x,isFocused:F?H:G,transparent:f,size:s}),"flex items-center text-start gap-4 cursor-pointer pl-[var(--control-padding-sm)]"),onFocus:Z=>K(Z,T.onFocus),onBlur:Z=>fe(Z,T.onBlur),onPress:F?ue:void 0,"data-open":F?H:G,children:[a&&oe?jsxRuntime.jsx("div",{className:fo(s),children:a(oe)}):F&&J?jsxRuntime.jsx("div",{className:fo(s),children:n?Array.from(n).find(S=>S.id===J)?.label:String(J)}):jsxRuntime.jsx(reactAriaComponents.SelectValue,{className:fo(s)}),jsxRuntime.jsx(y,{name:"CaretDown","aria-hidden":true,className:tailwindMerge.twMerge("h-4 w-4 text-text-primary group-disabled:text-text-disabled forced-colors:text-[ButtonText] transition-transform",(F?H:G)&&"rotate-180")})]})})}),h?jsxRuntime.jsx("div",{className:"mt-1 min-h-[20px]",children:b?jsxRuntime.jsx(g,{size:s,className:"text-feedback-error-text",children:typeof t=="function"&&T.validationResult?t(T.validationResult):typeof t=="string"?t:null}):o&&M==="below"?jsxRuntime.jsx(N,{size:s,children:o}):null}):jsxRuntime.jsx(jsxRuntime.Fragment,{children:b?jsxRuntime.jsx(g,{size:s,className:"mt-1 text-feedback-error-text",children:typeof t=="function"&&T.validationResult?t(T.validationResult):typeof t=="string"?t:null}):o&&M==="below"?jsxRuntime.jsx(N,{size:s,className:"mt-1",children:o}):null}),F?null:jsxRuntime.jsx(ot,{className:"bg-background-input shadow-xl border border-border-input/20 backdrop-blur-sm rounded-[var(--control-border-radius)]",style:{width:A==="match"&&I?`${I}px`:void 0,minWidth:A==="auto"&&I?`${I}px`:void 0,maxWidth:A==="auto"?"min(600px, 90vw)":void 0},placement:C,shouldFlip:R,children:jsxRuntime.jsx(xo.Provider,{value:"md",children:jsxRuntime.jsx(reactAriaComponents.ListBox,{items:n,className:"w-full max-h-[300px] overflow-auto bg-background-input p-0 outline-0",children:i&&n?Z=>jsxRuntime.jsx($e,{id:Z.id,textValue:Z.label,children:jsxRuntime.jsx("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap min-w-0 flex-1",children:i(Z)})},Z.id):r})})})]})}),F&&jsxRuntime.jsx(it,{isOpen:H,onClose:()=>me(false),title:e??"Select an option",contentPadding:false,children:jsxRuntime.jsx(xo.Provider,{value:"md",children:jsxRuntime.jsx(reactAriaComponents.ListBox,{items:n,className:"w-full bg-background-surface p-0 outline-0 [&_[role=option]]:border-b [&_[role=option]]:border-border-default [&_[role=option]:last-child]:border-0 [&_[role=option]]:!px-6 [&_[role=option]]:!py-4 [&_[role=option]]:rounded-none",selectionMode:"single",selectedKeys:J!=null?[J]:[],onSelectionChange:x=>{let Q=Array.from(x)[0];Q!=null&&(we(Q),me(false));},children:i&&n?x=>jsxRuntime.jsx($e,{id:x.id,textValue:x.label,children:jsxRuntime.jsx("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap min-w-0 flex-1",children:i(x)})},x.id):r})})})]})}function $e({size:e,className:o,...t}){let r=hr(),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-primary 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",O[n].paddingY,O[n].text,o)})}var Me=({className:e,size:o=24,color:t="text-action-brand"})=>jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("inline-block animate-spin rounded-full border-2 border-solid border-current border-r-transparent",t,e),style:{width:o,height:o},role:"status","aria-label":"loading",children:jsxRuntime.jsx("span",{className:"sr-only",children:"Loading..."})});var si=[],li={sm:"h-4 w-4",md:"h-5 w-5",lg:"h-6 w-6",xl:"h-7 w-7"},di={sm:"pl-8",md:"pl-10",lg:"pl-11",xl:"pl-13"},Pr={sm:"py-1",md:"py-2",lg:"py-3",xl:"py-4"},vo=(e,o,t)=>{if(e==null||e==="")return "";let n=(t?t.flatMap(i=>i.items):o||[]).find(i=>i.id===e);return n?n.name:""};async function ci(e,o,t){try{let r=e.url.replace("{q}",o),n=new URLSearchParams;e.extraParams&&Object.entries(e.extraParams).forEach(([l,c])=>{n.append(l,c.toString());});let i=`${r}${n.toString()?"?"+n.toString():""}`,a=await fetch(i,{method:"GET",headers:e.headers,signal:t});if(!a.ok)throw new Error(`HTTP error! status: ${a.status}`);let s=await a.json();return {items:e.transformResponse(s)}}catch(r){if(r instanceof Error&&r.name==="AbortError")return {items:[]};console.error("Error in REST request:",r);let n=r instanceof Error?r.message:"Unknown error occurred";return {items:[],error:n}}}async function ui(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 i=await n.json();if(i.errors)throw new Error(i.errors[0]?.message||"GraphQL error occurred");return e.responsePath&&(i=e.responsePath.split(".").reduce((a,s)=>a?.[s],i)),{items:e.transformResponse(i)}}catch(r){if(r instanceof Error&&r.name==="AbortError")return {items:[]};console.error("Error in GraphQL request:",r);let n=r instanceof Error?r.message:"Unknown error occurred";return {items:[],error:n}}}function Po({label:e,staticItems:o=si,sections:t,selectedKey:r,defaultSelectedKey:n,onSelectionChange:i,requestConfig:a,defaultFilter:s,placeholder:l,errorMessage:c,description:u,size:d="md",tooltip:b,isRequired:v,isDisabled:m,isInvalid:f,validationResult:h,showErrors:C=true,renderItem:R,renderLeftIcon:A,renderSection:M,autoFocus:L=false,reserveErrorSpace:T=false,hideChevron:w=false,useMobileTray:X=true,className:I}){let se=Pt__namespace.default.useRef(null),H=Pt__namespace.default.useRef(null),[me,J]=Pt__namespace.default.useState(),[K,fe]=Pt.useState(()=>vo(r||n,o,t)),[$,F]=Pt.useState(false),[oe,we]=Pt.useState(false),le=Yo(K),{contains:de}=reactAria.useFilter({sensitivity:"base"}),[ue,x]=Pt.useState(),{isMobile:Q}=Nt(),G=X&&Q,Z=O[d].text,ve=reactStately.useAsyncList({async load({signal:V,filterText:D=""}){if(!a)return {items:[]};if(!a.url||a.shouldLoad&&!a.shouldLoad(D))return {items:[]};try{let re;return a.requestType==="GraphQL"?re=await ui(a,D,V):re=await ci(a,D,V),x(re.error),{items:re.items}}catch(re){return re instanceof Error&&re.name==="AbortError"?{items:[]}:(console.error("Error loading items:",re),x(re instanceof Error?re.message:"Unknown error occurred"),{items:[]})}},initialFilterText:""}),S=a&&le!==""?ve:null,Fe=false,De=Pt.useRef("");Pt.useEffect(()=>{L&&F(true);},[L]),Pt.useEffect(()=>{let V=vo(r,o,t);V!==K&&fe(V);},[r,o,t]),Pt.useEffect(()=>{let V=()=>{se.current&&J(se.current.offsetWidth);};return V(),window.addEventListener("resize",V),()=>window.removeEventListener("resize",V)},[]),Pt.useEffect(()=>{le===""?De.current="":S&&le!==De.current&&(De.current=le,S.setFilterText(le));},[le,S]),Fe=wt(!!S?.isLoading,300);let he=Pt__namespace.default.useMemo(()=>{if(!G||!K)return S?S.items:o;let V=S?S.items:o,D=s??(a?()=>true:de);return V.filter(re=>D(re.name,K))},[G,K,S,o,s,de]),Ae=V=>{let D=vo(V,o,t);fe(D),i&&i(V);},_e=V=>{fe(V);},ze=()=>{G&&we(true);};return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(reactAriaComponents.ComboBox,{onSelectionChange:Ae,selectedKey:r||void 0,defaultSelectedKey:n||void 0,items:S?S.items:t?t.flatMap(V=>V.items):o,className:Y(I,"group flex flex-col w-full"),menuTrigger:G?"manual":a?"input":"focus",allowsEmptyCollection:!!a,isDisabled:m,isInvalid:f||!!c,inputValue:K,onInputChange:_e,autoFocus:L&&!G,defaultFilter:s??(a?()=>true:de),"aria-label":e||l||"Autocomplete",children:V=>jsxRuntime.jsxs("div",{className:"flex flex-col",children:[e&&jsxRuntime.jsx(q,{size:d,tooltip:b,isRequired:v,children:e}),jsxRuntime.jsxs(ae,{ref:se,children:[A?jsxRuntime.jsx("div",{className:"pointer-events-none absolute left-3 top-[45%] -translate-y-1/2 z-10",children:A(Fe)}):jsxRuntime.jsx("div",{className:"pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 z-10 flex items-center",children:Fe?jsxRuntime.jsx(Me,{size:16,color:"text-text-secondary"}):jsxRuntime.jsx(y,{name:"MagnifyingGlass",className:`${li[d]} text-text-secondary`})}),jsxRuntime.jsx(reactAriaComponents.Input,{className:pe({isInvalid:f||!!c,isDisabled:m,isFocused:$||(G?oe:V.isOpen),size:d,className:tailwindMerge.twMerge(di[d],K&&!m||!w&&!K?"pr-10":"pr-3",G&&"cursor-pointer",I)}),placeholder:l,disabled:m,onFocus:D=>{F(true),G&&(D.currentTarget.blur(),ze());},onBlur:()=>{F(false);},onClick:G?ze:void 0,readOnly:G,"aria-label":e||l||"Autocomplete"}),K&&!m&&jsxRuntime.jsx(mt,{onClick:()=>{fe(""),i?.(null);},size:d}),!w&&!K&&jsxRuntime.jsx(reactAriaComponents.Button,{className:"absolute right-3 top-[46%] -translate-y-1/2 transform text-text-secondary hover:text-text-primary","aria-label":"Toggle menu",isDisabled:m,children:({isPressed:D})=>jsxRuntime.jsx(y,{name:D?"CaretUp":"CaretDown",className:"h-4 w-4"})})]}),T?jsxRuntime.jsx("div",{className:"mt-1 min-h-[20px]",children:C&&ue?jsxRuntime.jsx(g,{size:d,className:"text-feedback-error-text",children:ue}):C&&typeof c=="string"?jsxRuntime.jsx(g,{size:d,className:"text-feedback-error-text",children:c}):C&&typeof c=="function"&&h?jsxRuntime.jsx(g,{size:d,className:"text-feedback-error-text",children:c(h)}):u?jsxRuntime.jsx(N,{size:d,children:u}):null}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[u&&jsxRuntime.jsx(N,{size:d,className:"mt-1",children:u}),C&&ue&&jsxRuntime.jsx(g,{size:d,className:"text-feedback-error-text mt-1",children:ue}),C&&typeof c=="string"&&jsxRuntime.jsx(g,{size:d,className:"text-feedback-error-text mt-1",children:c}),C&&typeof c=="function"&&h&&jsxRuntime.jsx(g,{size:d,className:"text-feedback-error-text mt-1",children:c(h)})]}),!G&&jsxRuntime.jsx(ot,{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:me?`${me}px`:void 0,zIndex:9999},children:jsxRuntime.jsx(reactAriaComponents.ListBox,{"aria-label":e||l||"Suggestions",className:`max-h-[300px] overflow-auto bg-background-input outline-none ${Z}`,children:t?t.map(D=>{let re=D.items.map(ye=>jsxRuntime.jsx($e,{id:ye.id,textValue:ye.name,size:d,className:`flex cursor-default items-center gap-2 px-3 ${Pr[d]} text-text-primary outline-none data-[focused]:bg-background-hover data-[selected]:bg-background-selected data-[selected]:font-medium data-[focus-visible]:ring-0`,children:R?R(ye):ye.name},ye.id));if(M){let ye=M(D,re);return Pt__namespace.default.isValidElement(ye)&&ye.type===reactAriaComponents.ListBoxSection?ye:jsxRuntime.jsx(reactAriaComponents.ListBoxSection,{children:ye},D.name)}return jsxRuntime.jsxs(reactAriaComponents.ListBoxSection,{children:[jsxRuntime.jsx(reactAriaComponents.Header,{className:"px-3 py-1 text-sm font-bold text-text-secondary",children:D.name}),re]},D.name)}):D=>jsxRuntime.jsx($e,{id:D.id,textValue:D.name,size:d,className:`flex cursor-default items-center gap-2 px-3 ${Pr[d]} text-text-primary outline-none data-[focused]:bg-background-hover data-[selected]:bg-background-selected data-[selected]:font-medium data-[focus-visible]:ring-0`,children:R?R(D):D.name},D.id)})})]})}),G&&jsxRuntime.jsx(it,{isOpen:oe,onClose:()=>we(false),title:e??l??"Search",contentPadding:false,height:"80vh",children:jsxRuntime.jsxs("div",{className:"flex flex-col h-full",children:[jsxRuntime.jsx("div",{className:"p-4 border-b border-border-default",children:jsxRuntime.jsxs(ae,{children:[jsxRuntime.jsx("div",{className:"pointer-events-none absolute left-3 top-[45%] -translate-y-1/2 z-10 flex items-center",children:Fe?jsxRuntime.jsx(Me,{size:16,color:"text-text-secondary"}):jsxRuntime.jsx(y,{name:"MagnifyingGlass",className:"h-4 w-4 text-text-secondary"})}),jsxRuntime.jsx("input",{ref:H,type:"text",value:K,onChange:V=>_e(V.target.value),placeholder:l,autoFocus:true,className:pe({isInvalid:false,isDisabled:false,isFocused:true,size:"md",className:"pl-10 pr-10"})}),K&&jsxRuntime.jsx(mt,{onClick:()=>{fe(""),i?.(null);},size:"md"})]})}),jsxRuntime.jsx("div",{className:"flex-1 overflow-auto",children:jsxRuntime.jsx(reactAriaComponents.ListBox,{"aria-label":e||l||"Suggestions",items:he,selectedKeys:r?[r]:[],selectionMode:"single",onSelectionChange:V=>{let D=Array.from(V)[0];D&&(Ae(D),we(false));},className:"bg-background-input outline-none",children:V=>jsxRuntime.jsx($e,{id:V.id,textValue:V.name,size:"md",className:"flex cursor-default items-center gap-2 px-4 py-3 text-text-primary outline-none data-[focused]:bg-background-hover data-[selected]:bg-background-selected data-[selected]:font-medium data-[focus-visible]:ring-0",children:R?R(V):V.name},V.id)})})]})})]})}function _(e,o){let t=o.split("."),r=e;for(let i of t)if(r&&typeof r=="object"&&i in r)r=r[i];else {r=void 0;break}let n=r?.message;return typeof n=="string"?n:void 0}function Tp({name:e,defaultValue:o,...t}){let{control:r,formState:n}=reactHookForm.useFormContext(),i=_(n.errors,e);return jsxRuntime.jsx(reactHookForm.Controller,{control:r,name:e,defaultValue:o,render:({field:a})=>jsxRuntime.jsx(Po,{...t,selectedKey:a.value??null,onSelectionChange:s=>a.onChange(s),showErrors:!!i,errorMessage:i})})}var yi="focus:ring-action-primary",vi="bg-action-primary border-action-primary text-[color:var(--color-action-primary-text)] hover:bg-action-primary-hover hover:border-action-primary-hover";function Sr(e){return jsxRuntime.jsxs(reactAriaComponents.CheckboxGroup,{...e,className:Y(e.className,"flex flex-col gap-2"),children:[jsxRuntime.jsx(q,{children:e.label}),e.children,e.description&&jsxRuntime.jsx(N,{children:e.description}),jsxRuntime.jsx(g,{children:typeof e.errorMessage=="function"?void 0:e.errorMessage})]})}function Pi({isDisabled:e}){return `relative flex gap-2 items-center group text-sm transition ${e?"text-text-disabled":"text-text-secondary"}`}function Ci({isSelected:e,isInvalid:o,isDisabled:t,isIndeterminate:r}){let n="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=yi,a="";return t?a="border-border-muted bg-background-muted":o?a="border-feedback-error-border bg-feedback-error-background":e||r?a=vi:a="bg-background-input border-border-input hover:border-border-focus",`${n} ${i} ${a}`}var Fr="w-4 h-4 text-current group-disabled:text-text-disabled";function Co({className:e,...o}){return jsxRuntime.jsx("div",{"aria-hidden":"true",className:`${Ci(o)} ${e||""}`,children:o.isIndeterminate?jsxRuntime.jsx(lucideReact.Minus,{"aria-hidden":true,className:Fr}):o.isSelected?jsxRuntime.jsx(lucideReact.Check,{"aria-hidden":true,className:Fr}):null})}function kr(e){let{children:o,variant:t,...r}=e;return jsxRuntime.jsx(reactAriaComponents.Checkbox,{...r,className:reactAriaComponents.composeRenderProps(e.className,(n,i)=>`${Pi(i)} ${n||""}`),children:n=>{let{isSelected:i,isIndeterminate:a,isDisabled:s,isInvalid:l}=n;return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Co,{isSelected:i,isIndeterminate:a,isDisabled:s,isInvalid:l}),typeof o=="function"?o(n):o]})}})}function Wp({name:e,defaultValue:o,errorBelow:t=false,...r}){let{control:n,formState:i}=reactHookForm.useFormContext(),a=_(i.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(kr,{...r,isSelected:!!s.value,onChange:l=>s.onChange(l),"aria-invalid":!!a,children:r.children}),t&&a&&jsxRuntime.jsx(g,{children:a})]})})}function Qp({name:e,defaultValue:o,...t}){let{control:r,formState:n}=reactHookForm.useFormContext(),i=_(n.errors,e);return jsxRuntime.jsx(reactHookForm.Controller,{control:r,name:e,defaultValue:o,render:({field:a})=>jsxRuntime.jsx(Sr,{...t,value:a.value||[],onChange:s=>a.onChange(s),errorMessage:i,children:t.children})})}function st(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 So(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 Ir({label:e,description:o,errorMessage:t,size:r="md",tooltip:n,isRequired:i,transparent:a,className:s,validationResult:l,value:c,defaultValue:u,onChange:d,placeholder:b="#000000",showColorSwatch:v=true,reserveErrorSpace:m=true,...f}){let[h,C]=Pt.useState(u||""),[R,A]=Pt.useState(c||u||""),[M,L]=Pt.useState(false),[T,w]=Pt.useState(null),{isFocused:X,handleFocus:I,handleBlur:se}=Ee(),H=c!==void 0?c:h;Pt.useEffect(()=>{c!==void 0&&A(c);},[c]);let me=H?!st(H):false,J=Pt.useCallback($=>{if(A($),st($)){let F=So($);d?d(F):C(F);}else $===""&&(d?d(""):C(""));},[d]),K=Pt.useCallback($=>{let F=So($);A(F),d?d(F):C(F);},[d]),fe=Pt.useCallback($=>{if(st(R)){let F=So(R);A(F),d&&F!==H?d(F):!d&&F!==h&&C(F);}se($,f.onBlur);},[R,H,h,d,se,f.onBlur]);return jsxRuntime.jsx(reactAriaComponents.TextField,{...f,isRequired:i,className:Y(s,"group flex flex-col"),children:({isDisabled:$})=>jsxRuntime.jsxs("div",{className:"flex flex-col",children:[e&&jsxRuntime.jsx(q,{size:r,tooltip:n,isRequired:i,children:e}),jsxRuntime.jsx(ae,{children:jsxRuntime.jsxs("div",{className:"flex gap-2",children:[jsxRuntime.jsxs("div",{className:"flex-1 relative",children:[jsxRuntime.jsx(Bt,{size:r,disabled:$,type:"text",value:R,placeholder:b,onFocus:F=>I(F,f.onFocus),onBlur:fe,onChange:F=>J(F.target.value),className:tailwindMerge.twMerge(pe({isInvalid:me,isDisabled:$,isFocused:X,size:r,transparent:a}),v?"pr-12":"pr-3","pl-3")}),v&&jsxRuntime.jsx("div",{className:"absolute right-3 top-1/2 -translate-y-1/2 pointer-events-none",style:{width:O[r].height},children:jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("w-6 h-6 rounded border shadow-sm",st(H)?"border-border-default":"border-border-default bg-background-muted"),style:st(H)?{backgroundColor:H}:void 0,"aria-hidden":"true",children:!st(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(k,{variant:"secondary",size:r,icon:"Palette",onPress:()=>L(!M),isDisabled:$,className:"flex-shrink-0",children:"Pick"})})]})}),m?jsxRuntime.jsx("div",{className:"mt-1 min-h-[20px]",children:typeof t=="string"?jsxRuntime.jsx(g,{size:r,children:t}):typeof t=="function"&&l?jsxRuntime.jsx(g,{size:r,children:t(l)}):o?jsxRuntime.jsx(N,{size:r,children:o}):null}):jsxRuntime.jsx(jsxRuntime.Fragment,{children:typeof t=="string"?jsxRuntime.jsx(g,{size:r,className:"mt-1",children:t}):typeof t=="function"&&l?jsxRuntime.jsx(g,{size:r,className:"mt-1",children:t(l)}):o?jsxRuntime.jsx(N,{size:r,className:"mt-1",children:o}):null}),M&&T&&jsxRuntime.jsx(ot,{triggerRef:{current:T},isOpen:M,onOpenChange:L,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:K,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-primary text-[length:var(--control-text-sm)] font-mono",children:H||"#000000"})]})]})})]})})}function fm({name:e,defaultValue:o,...t}){let{control:r,formState:n}=reactHookForm.useFormContext(),i=_(n.errors,e);return jsxRuntime.jsx(reactHookForm.Controller,{control:r,name:e,defaultValue:o,render:({field:a})=>jsxRuntime.jsx(Ir,{...t,value:a.value??"",onChange:s=>a.onChange(s),isInvalid:!!i,errorMessage:i})})}function Wi({isSelected:e,isDisabled:o}){let t=[We,"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-inverse invalid:bg-feedback-error-border forced-colors:bg-[Highlight] forced-colors:invalid:bg-[Mark] forced-colors:text-[HighlightText]"):t.push("text-text-primary hover:bg-background-hover pressed:bg-background-selected"),t.join(" ")}function To({errorMessage:e,...o}){return jsxRuntime.jsxs(reactAriaComponents.Calendar,{...o,children:[jsxRuntime.jsx(Vr,{}),jsxRuntime.jsxs(reactAriaComponents.CalendarGrid,{className:"border-separate [border-spacing:0] [&_td]:p-0 [&_td]:!border-0",children:[jsxRuntime.jsx(Lr,{}),jsxRuntime.jsx(reactAriaComponents.CalendarGridBody,{children:t=>jsxRuntime.jsx(reactAriaComponents.CalendarCell,{date:t,className:({isSelected:r,isDisabled:n})=>`${Wi({isSelected:r,isDisabled:n})} border-0`})})]}),e&&jsxRuntime.jsx(reactAriaComponents.Text,{slot:"errorMessage",className:"text-sm text-feedback-error-text",children:e})]})}function Vr(){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(k,{variant:"icon",slot:"previous",className:"pl-0",children:e==="rtl"?jsxRuntime.jsx(y,{name:"CaretRight","aria-hidden":true,size:o}):jsxRuntime.jsx(y,{name:"CaretLeft","aria-hidden":true,size:o})}),jsxRuntime.jsx(reactAriaComponents.Heading,{className:"text-md mx-2 flex-1 text-center font-semibold text-text-primary"}),jsxRuntime.jsx(k,{variant:"icon",slot:"next",className:"pr-0",children:e==="rtl"?jsxRuntime.jsx(y,{name:"CaretLeft","aria-hidden":true,size:o}):jsxRuntime.jsx(y,{name:"CaretRight","aria-hidden":true,size:o})})]})}function Lr(){return jsxRuntime.jsx(reactAriaComponents.CalendarGridHeader,{children:e=>jsxRuntime.jsx(reactAriaComponents.CalendarHeaderCell,{className:"text-xs font-semibold text-text-secondary",children:e})})}function wo({label:e,description:o,errorMessage:t,size:r="md",tooltip:n,isRequired:i,isDisabled:a,isInvalid:s,showCalendar:l=true,reserveErrorSpace:c=true,validationResult:u,className:d,...b}){let[v,m]=Pt.useState(false),f=h=>{b.onChange&&h&&b.onChange(h),m(false);};return jsxRuntime.jsxs(reactAriaComponents.DateField,{...b,isDisabled:a,isRequired:i,isInvalid:s,className:Y(d,"flex flex-col gap-1"),children:[e&&jsxRuntime.jsx(q,{size:r,tooltip:n,isRequired:i,children:e}),jsxRuntime.jsx(ae,{children:jsxRuntime.jsxs("div",{className:"relative w-full",children:[jsxRuntime.jsx(Mr,{size:r,isDisabled:a,isInvalid:s,hasCalendar:l}),l&&!a&&jsxRuntime.jsxs(reactAriaComponents.DialogTrigger,{isOpen:v,onOpenChange:m,children:[jsxRuntime.jsx(k,{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-secondary hover:text-text-primary transition-colors","aria-label":"Open calendar",children:jsxRuntime.jsx(y,{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(To,{value:b.value,onChange:f,minValue:b.minValue,maxValue:b.maxValue,isDisabled:a,isReadOnly:b.isReadOnly,isDateUnavailable:b.isDateUnavailable})})})]})]})}),c?jsxRuntime.jsx("div",{className:"mt-1 min-h-[20px]",children:typeof t=="string"?jsxRuntime.jsx(g,{size:r,children:t}):typeof t=="function"&&u?jsxRuntime.jsx(g,{size:r,children:t(u)}):o?jsxRuntime.jsx(N,{size:r,children:o}):null}):jsxRuntime.jsx(jsxRuntime.Fragment,{children:typeof t=="string"?jsxRuntime.jsx(g,{size:r,className:"mt-1",children:t}):typeof t=="function"&&u?jsxRuntime.jsx(g,{size:r,className:"mt-1",children:t(u)}):o?jsxRuntime.jsx(N,{size:r,className:"mt-1",children:o}):null})]})}function Ji({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-base md:text-xs",md:"text-base md:text-sm",lg:"text-base",xl:"text-lg"}[t],e?"text-text-disabled italic":"text-text-primary",o?"text-text-disabled cursor-not-allowed":"cursor-text",!o&&"hover:bg-background-hover","data-[focused]:bg-background-selected data-[focused]:text-text-primary")}function Mr({size:e="md",isDisabled:o,isInvalid:t,hasCalendar:r,className:n,...i}){return jsxRuntime.jsx(reactAriaComponents.DateInput,{className:tailwindMerge.twMerge(ft({isInvalid:t,isDisabled:o}),"px-3 py-2 flex items-center gap-0.5 w-full",r&&"pr-10",n),...i,children:a=>jsxRuntime.jsx(reactAriaComponents.DateSegment,{segment:a,className:Ji({isPlaceholder:a.isPlaceholder,isDisabled:!a.isEditable||o,size:e})})})}function Km({name:e,defaultValue:o,...t}){let{control:r,formState:n}=reactHookForm.useFormContext(),i=_(n.errors,e);return jsxRuntime.jsx(reactHookForm.Controller,{control:r,name:e,defaultValue:o,render:({field:a})=>jsxRuntime.jsx(wo,{...t,value:a.value??null,onChange:s=>a.onChange(s),isInvalid:!!i,errorMessage:i})})}function Io({value:e,onChange:o,onUrlChange:t,accept:r="image/*",maxSize:n,isDisabled:i=false,onUpload:a,className:s,showPreview:l=true,placeholder:c="Drop files here or click to browse"}){let[u,d]=Pt.useState(false),[b,v]=Pt.useState(false),[m,f]=Pt.useState(null),[h,C]=Pt.useState(e),R=Pt.useRef(null),A=async T=>{if(f(null),n&&T.size>n){f(`File size must be less than ${(n/1024/1024).toFixed(2)}MB`);return}if(l&&T.type.startsWith("image/")){let w=new FileReader;w.onloadend=()=>{C(w.result);},w.readAsDataURL(T);}if(a){v(true);try{let w=await a(T);C(w),t?.(w);}catch(w){f("Failed to upload file"),console.error("Upload error:",w);}finally{v(false);}}o?.(T,h);},M=async T=>{try{let w=T.items;if(w.length>0){let X=w[0];if(X.kind==="file"){let I=await X.getFile();I&&A(I);}}}catch(w){f("Failed to upload file"),console.error("Upload error:",w);}finally{d(false);}},L=()=>{C(void 0),f(null),o?.(null),t?.(""),R.current&&(R.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",i&&"pointer-events-none opacity-50",m&&"border-feedback-error-border bg-feedback-error-background/50"),onDrop:M,onDropEnter:()=>d(true),onDropExit:()=>d(false),children:[h?jsxRuntime.jsxs("div",{className:"relative flex h-full w-full items-center justify-center p-4",children:[l&&(h.startsWith("data:image")||h.startsWith("http"))?jsxRuntime.jsx("img",{src:h,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-secondary"}),jsxRuntime.jsx("span",{className:"text-sm text-text-secondary",children:"File uploaded"})]}),!i&&jsxRuntime.jsx(k,{variant:"icon",size:"sm",onPress:L,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-secondary"}),jsxRuntime.jsxs("div",{className:"text-center",children:[jsxRuntime.jsx("p",{className:"text-sm text-text-primary",children:c}),jsxRuntime.jsx("p",{className:"mt-1 text-xs text-text-secondary",children:r==="image/*"?"PNG, JPG, GIF up to 10MB":`Accepts ${r}`})]}),jsxRuntime.jsx(reactAriaComponents.FileTrigger,{acceptedFileTypes:r.split(","),onSelect:T=>{let w=Array.from(T||[]);w.length>0&&A(w[0]);},children:jsxRuntime.jsx(k,{variant:"secondary",size:"sm",isDisabled:i,children:"Choose File"})})]}),b&&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-secondary",children:"Uploading..."})]})})]}),m&&jsxRuntime.jsx("p",{className:"mt-2 text-sm text-feedback-error-text",children:m})]})}function cf({name:e,defaultValue:o,errorBelow:t=true,...r}){let{control:n,formState:i}=reactHookForm.useFormContext(),a=_(i.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(Io,{...r,value:s.value??"",onChange:(l,c)=>s.onChange(c||"")}),t&&a&&jsxRuntime.jsx(g,{children:a})]})})}var ps={primary:"bg-action-primary/10 text-action-primary border border-action-primary/20 hover:bg-action-primary/15",secondary:"bg-action-secondary text-[color:var(--color-action-secondary-text)] border border-border-muted hover:bg-action-secondary-hover",info:"bg-feedback-info-background text-feedback-info-text border border-feedback-info-border hover:bg-feedback-info-background/80"};function _r(e){return !e||e==="default"?"secondary":e==="brand"?"primary":e}var ms={xs:"px-1.5 py-[2px] gap-0.5",sm:"px-2 py-1 gap-1",md:"px-3 py-1.5 gap-1.5",lg:"px-3 py-2 gap-2",xl:"px-4 py-2.5 gap-2"},fs="opacity-75 cursor-not-allowed pointer-events-none";function zr(e){let{variant:o,size:t,isDisabled:r,isClickable:n,className:i}=e,a=t==="xs"?"text-xs":O[t].text;return tailwindMerge.twMerge("inline-flex items-center justify-center rounded-full font-medium transition-colors","whitespace-nowrap select-none",ms[t],a,ps[o],n&&!r&&"cursor-pointer",r&&fs,i)}function Hr({children:e,onRemove:o,removeLabel:t="Remove",size:r="md",variant:n="secondary",isRemovable:i=true,isDisabled:a=false,className:s,onClick:l}){let c=!!l&&!a,u=i&&o&&!a,d=h=>{h.stopPropagation(),h.preventDefault(),o&&!a&&o();},b=()=>{l&&!a&&l();},v=r==="xs"?10:r==="sm"?12:r==="md"?14:16,f=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("span",{className:"truncate",children:e}),u?c?jsxRuntime.jsx("span",{onClick:d,onKeyDown:h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),d(h));},role:"button",tabIndex:0,className:"flex-shrink-0 rounded-full p-0.5 hover:bg-text-primary/10 transition-colors cursor-pointer","aria-label":t,title:t,children:jsxRuntime.jsx(y,{name:"X",size:v,className:"text-current opacity-70 hover:opacity-100"})}):jsxRuntime.jsx("button",{type:"button",onClick:d,className:"flex-shrink-0 rounded-full p-0.5 hover:bg-text-primary/10 transition-colors cursor-pointer","aria-label":t,title:t,tabIndex:-1,children:jsxRuntime.jsx(y,{name:"X",size:v,className:"text-current opacity-70 hover:opacity-100"})}):null]});return c?jsxRuntime.jsx("button",{type:"button",onClick:b,className:zr({variant:_r(n),size:r,isDisabled:a,isClickable:c,className:s}),disabled:a,children:f}):jsxRuntime.jsx("span",{className:zr({variant:_r(n),size:r,isDisabled:a,isClickable:c,className:s}),children:f})}var xs=(e,o)=>e.toLocaleLowerCase().includes(o.toLocaleLowerCase());function hs(e){return [e.value,e.label]}function Or(e,o,t=xs){let r=o.trim();return r===""?[...e]:e.filter(n=>hs(n).some(i=>t(i,r)))}function $r(e){let o=e.query.trim();if(o==="")return false;let t=o.toLocaleLowerCase();return e.options.some(n=>n.value.toLocaleLowerCase()===t||n.label.toLocaleLowerCase()===t)?false:!e.selected.some(n=>n.toLocaleLowerCase()===t)}function Gr(e,o){return e.map(t=>{let r=o.find(n=>n.value===t);return r?r.count===void 0?{value:t,label:r.label,isUnknown:false}:{value:t,label:r.label,count:r.count,isUnknown:false}:{value:t,label:t,isUnknown:true}})}var Cs=e=>e.kind==="literal"?`literal:${e.value}`:`option:${e.option.value}`,Vo=e=>e.kind==="literal"?e.value:e.option.value,Wr=e=>e.kind==="literal"?e.value:e.option.label,Rs={sm:"h-4 w-4",md:"h-5 w-5",lg:"h-6 w-6",xl:"h-7 w-7"},Fs={sm:"pl-8",md:"pl-10",lg:"pl-11",xl:"pl-13"},Ss={sm:"xs",md:"xs",lg:"sm",xl:"sm"};function Lo({options:e,value:o,defaultValue:t,onChange:r,label:n,placeholder:i,size:a="md",loading:s=false,disabled:l=false,maxSelected:c,allowLiteral:u=false,onSearchChange:d,truncated:b=false,totalCount:v,emptyMessage:m,showSelectAll:f=false,description:h,errorMessage:C,isRequired:R=false,onBlur:A,inputRef:M,labelHidden:L=false,className:T,id:w}){let X=Pt.useId(),I=w??`multiselect-${X}`,se=`${I}-input`,H=`${I}-listbox`,me=Pt.useRef(null),J=Pt.useCallback(p=>{me.current=p,typeof M=="function"?M(p):M&&(M.current=p);},[M]),{contains:K}=reactAria.useFilter({sensitivity:"base"}),{isFocused:fe,handleFocus:$,handleBlur:F}=Ee(),[oe,we]=Pt.useState(""),[le,de]=Pt.useState(true),[ue,x]=Pt.useState(null),[Q,G]=Pt.useState(""),[Z,ve]=Pt.useState(()=>[...t??[]]),S=Pt.useMemo(()=>o?[...o]:Z,[o,Z]),Fe=Pt.useMemo(()=>Or(e,oe,K),[e,oe,K]),De=u&&!s&&$r({query:oe,options:e,selected:S}),he=Pt.useMemo(()=>{let p=Fe.map(ee=>({kind:"option",option:ee}));return De?[{kind:"literal",value:oe.trim()},...p]:p},[Fe,De,oe]),Ae=Pt.useMemo(()=>Gr(S,e),[S,e]),_e=c!==void 0&&S.length>=c,ze=Pt.useCallback((p,ee)=>{o||ve(p),G(`${ee} ${p.length} selected.`),r(p);},[r,o]),V=Pt.useCallback((p,ee)=>{if(!l){if(S.includes(p)){ze(S.filter(He=>He!==p),`${ee} removed.`);return}_e||ze([...S,p],`${ee} selected.`);}},[_e,ze,l,S]),D=Pt.useCallback(p=>{p.kind==="option"&&p.option.disabled||V(Vo(p),Wr(p));},[V]),re=p=>{if(l||p.length===0)return;let ee=new Set(p),He=p.map(Be=>Ae.find(Qt=>Qt.value===Be)?.label??Be);ze(S.filter(Be=>!ee.has(Be)),`${He.join(", ")} removed.`);},ye=p=>{we(p),x(null),de(true),d?.(p);},Ko=p=>{if(he.length===0){x(null);return}x(ee=>ee===null?p>0?0:he.length-1:(ee+p+he.length)%he.length);},dn=p=>{if(l)return;let ee=ue===null?void 0:he[ue];switch(p.key){case "ArrowDown":p.preventDefault(),de(true),Ko(1);break;case "ArrowUp":p.preventDefault(),de(true),Ko(-1);break;case "Home":he.length>0&&(p.preventDefault(),de(true),x(0));break;case "End":he.length>0&&(p.preventDefault(),de(true),x(he.length-1));break;case "Enter":ee&&(p.preventDefault(),D(ee));break;case " ":oe===""&&ee&&(p.preventDefault(),D(ee));break;case "Escape":p.preventDefault(),oe!==""?ye(""):(de(false),x(null));break;case "Backspace":oe===""&&S.length>0&&(p.preventDefault(),re([S[S.length-1]]));break;}},Xe=Fe.filter(p=>!p.disabled&&!S.includes(p.value)).map(p=>p.value),cn=c===void 0?Xe.length:Math.max(0,c-S.length),ut=Math.min(Xe.length,cn),un=ut===Xe.length?`Select all ${Xe.length} matching`:`Select ${ut} of ${Xe.length} matching`,pn=()=>{if(l||ut===0)return;let p=Xe.slice(0,ut);ze([...S,...p],`${p.length} matching options selected.`);},jt=s?"loading":e.length===0?"empty":Fe.length===0&&oe.trim()!==""?"no-match":null,mn=O[a].text;return jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("flex w-full flex-col gap-1",T),"data-testid":"multiselect",children:[jsxRuntime.jsx(q,{size:a,htmlFor:se,isRequired:R,...L?{className:"sr-only"}:{},children:n}),jsxRuntime.jsxs(ae,{children:[jsxRuntime.jsx("div",{className:"pointer-events-none absolute left-3 top-1/2 z-10 flex -translate-y-1/2 items-center",children:s?jsxRuntime.jsx(Me,{size:16,color:"text-text-secondary"}):jsxRuntime.jsx(y,{name:"MagnifyingGlass",className:tailwindMerge.twMerge(Rs[a],"text-text-secondary")})}),jsxRuntime.jsx("input",{ref:J,id:se,type:"text",role:"combobox",autoComplete:"off","aria-expanded":le,"aria-controls":H,"aria-haspopup":"listbox","aria-autocomplete":"list","aria-activedescendant":le&&ue!==null&&he[ue]?`${I}-row-${ue}`:void 0,"aria-required":R||void 0,"aria-invalid":C?true:void 0,value:oe,placeholder:i,disabled:l,onChange:p=>ye(p.target.value),onKeyDown:dn,onFocus:p=>{de(true),$(p);},onBlur:p=>{F(p),A?.(p);},className:pe({isDisabled:l,isFocused:fe,isInvalid:!!C,size:a,className:tailwindMerge.twMerge(Fs[a],"pr-3")})})]}),Ae.length>0&&jsxRuntime.jsx("div",{"data-testid":"multiselect-selection-region",role:"group","aria-label":`Selected ${n}`,className:"flex flex-wrap gap-1.5 rounded-[var(--control-border-radius)] border border-border-default bg-background-muted p-2",children:Ae.map(p=>jsxRuntime.jsx(Hr,{size:Ss[a],variant:"primary",isDisabled:l,removeLabel:`Remove ${p.label}`,onRemove:()=>re([p.value]),className:"shrink-0",children:p.isUnknown?jsxRuntime.jsx("span",{"data-testid":`multiselect-selection-unknown-${p.value}`,title:"Not in the current option list",children:`${p.label} (custom)`}):p.label},p.value))}),f&&jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(k,{variant:"link",size:a,onPress:pn,isDisabled:l||ut===0,children:un}),jsxRuntime.jsx(k,{variant:"link",size:a,onPress:()=>re(S),isDisabled:l||S.length===0,children:"Clear all"})]}),jsxRuntime.jsx("div",{id:H,role:"listbox","aria-multiselectable":"true","aria-label":`${n} options`,hidden:!le,className:tailwindMerge.twMerge(mn,"max-h-[260px] overflow-y-auto rounded-[var(--control-border-radius)] border border-border-input bg-background-input"),children:le&&he.map((p,ee)=>{let He=S.includes(Vo(p)),Be=l||p.kind==="option"&&p.option.disabled===true||!He&&_e;return jsxRuntime.jsxs("div",{id:`${I}-row-${ee}`,role:"option","aria-selected":He,"aria-disabled":Be||void 0,"data-value":Vo(p),"data-literal":p.kind==="literal"?"true":void 0,"data-active":ue===ee?"true":void 0,onMouseDown:Qt=>Qt.preventDefault(),onClick:()=>{Be||(D(p),me.current?.focus());},className:tailwindMerge.twMerge("flex cursor-default items-center gap-2 px-3",O[a].paddingY,"text-text-primary",ue===ee&&"bg-background-hover",He&&"bg-background-selected font-medium",Be&&"text-text-disabled"),children:[jsxRuntime.jsx(Co,{isSelected:He,isDisabled:Be,className:"!w-4 !h-4"}),jsxRuntime.jsx("span",{className:"flex-1 truncate",children:Wr(p)}),p.kind==="literal"&&jsxRuntime.jsx("span",{"data-testid":"multiselect-literal-badge",className:"italic text-text-secondary",children:"Use as typed"}),p.kind==="option"&&p.option.count!==void 0&&jsxRuntime.jsx("span",{"data-testid":`multiselect-count-${p.option.value}`,className:"text-text-secondary",children:p.option.count.toLocaleString()})]},Cs(p))})}),jt==="loading"&&jsxRuntime.jsx("div",{"data-testid":"multiselect-status-loading","data-status":"loading",children:jsxRuntime.jsxs(N,{size:a,className:"flex items-center gap-2",children:[jsxRuntime.jsx(Me,{size:14,color:"text-text-secondary"}),jsxRuntime.jsx("span",{children:"Loading options\u2026"})]})}),jt==="empty"&&jsxRuntime.jsx("div",{"data-testid":"multiselect-status-empty","data-status":"empty",children:jsxRuntime.jsxs(N,{size:a,className:"flex items-center gap-2",children:[jsxRuntime.jsx(y,{name:"Tray",className:"h-4 w-4"}),jsxRuntime.jsx("span",{children:m??"No options available"})]})}),jt==="no-match"&&jsxRuntime.jsx("div",{"data-testid":"multiselect-status-no-match","data-status":"no-match",children:jsxRuntime.jsxs(N,{size:a,className:"flex items-center gap-2 text-feedback-warning-text",children:[jsxRuntime.jsx(y,{name:"MagnifyingGlass",className:"h-4 w-4"}),jsxRuntime.jsx("span",{children:`No options match \u201C${oe.trim()}\u201D`})]})}),b&&jsxRuntime.jsx("div",{"data-testid":"multiselect-truncation",children:jsxRuntime.jsx(N,{size:a,children:v===void 0?"Showing a partial list \u2014 refine your search to see more":`Showing ${e.length} of ${v} \u2014 refine your search to see more`})}),c!==void 0&&jsxRuntime.jsx("div",{"data-testid":"multiselect-limit",children:jsxRuntime.jsx(N,{size:a,children:_e?`${S.length} of ${c} selected \u2014 limit reached, remove one to choose another`:`${S.length} of ${c} selected`})}),h&&jsxRuntime.jsx(N,{size:a,children:h}),C&&jsxRuntime.jsx(g,{size:a,children:C}),jsxRuntime.jsx("div",{"data-testid":"multiselect-live-region",role:"status","aria-live":"polite",className:"sr-only",children:Q})]})}function Hf({name:e,defaultValue:o,...t}){let{control:r,formState:n}=reactHookForm.useFormContext(),i=_(n.errors,e);return jsxRuntime.jsx(reactHookForm.Controller,{control:r,name:e,defaultValue:o,render:({field:a})=>jsxRuntime.jsx(Lo,{...t,value:a.value??[],onChange:s=>a.onChange(s),onBlur:s=>{a.onBlur(),t.onBlur?.(s);},inputRef:a.ref,errorMessage:i})})}var Ls=e=>{let o=pe({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 Mo({label:e,description:o,errorMessage:t,size:r="md",tooltip:n,isRequired:i,transparent:a,validationResult:s,reserveErrorSpace:l=true,descriptionPlacement:c="below",...u}){let d=Pt.useId(),{isFocused:b,handleFocus:v,handleBlur:m}=Ee();return jsxRuntime.jsx(reactAriaComponents.NumberField,{...u,id:d,isRequired:i,className:Y(u.className,"group flex flex-col gap-1"),step:u.step??1,onChange:f=>{typeof f=="number"&&(u.maxValue!=null&&f>u.maxValue?u.onChange?.(u.maxValue):u.minValue!=null&&f<u.minValue?u.onChange?.(u.minValue):u.onChange?.(f));},isInvalid:!!t||typeof u.value=="number"&&(u.maxValue!=null&&u.value>u.maxValue||u.minValue!=null&&u.value<u.minValue),children:({isDisabled:f,isInvalid:h})=>jsxRuntime.jsxs("div",{className:"flex flex-col gap-1",children:[e&&jsxRuntime.jsx(q,{size:r,tooltip:n,description:c==="tooltip"||c==="inline"?o:void 0,descriptionPlacement:c,isRequired:i,htmlFor:d,children:e}),jsxRuntime.jsx("div",{className:"relative",children:jsxRuntime.jsxs(reactAriaComponents.Group,{className:"relative",children:[jsxRuntime.jsx(reactAriaComponents.Input,{onFocus:R=>v(R,u.onFocus),onBlur:R=>m(R,u.onBlur),className:Ls({isInvalid:h||!!t,isDisabled:f,isFocused:b,transparent:a,size:r,className:typeof u.className=="string"?u.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:f,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(y,{name:"CaretUp",size:14})}),jsxRuntime.jsx(reactAriaComponents.Button,{slot:"decrement",isDisabled:f,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(y,{name:"CaretDown",size:14})})]})]})}),l?jsxRuntime.jsx("div",{className:"mt-1 min-h-[20px]",children:t?jsxRuntime.jsx(g,{size:r,children:typeof t=="function"?t(s):t}):o&&c==="below"?jsxRuntime.jsx(N,{size:r,children:o}):null}):jsxRuntime.jsx(jsxRuntime.Fragment,{children:t?jsxRuntime.jsx(g,{size:r,className:"mt-1",children:typeof t=="function"?t(s):t}):o&&c==="below"?jsxRuntime.jsx(N,{size:r,className:"mt-1",children:o}):null})]})})}function ag({name:e,defaultValue:o,...t}){let{control:r,formState:n}=reactHookForm.useFormContext(),i=_(n.errors,e);return jsxRuntime.jsx(reactHookForm.Controller,{control:r,name:e,defaultValue:o,render:({field:a})=>jsxRuntime.jsx(Mo,{...t,value:typeof a.value=="number"?a.value:void 0,onChange:s=>a.onChange(s),isInvalid:!!i,errorMessage:i,isRequired:t.isRequired})})}function Ao({value:e,defaultValue:o,onChange:t,isDisabled:r,isReadOnly:n,isRequired:i,className:a,children:s,size:l="2",variant:c="primary",columns:u="repeat(auto-fit, minmax(160px, 1fr))",gap:d="1"}){return jsxRuntime.jsx(reactAriaComponents.RadioGroup,{value:e,defaultValue:o,onChange:t,isDisabled:r,isReadOnly:n,isRequired:i,className:Y(a,"grid"),style:{gridTemplateColumns:/^\d+$/.test(String(u))?`repeat(${u}, minmax(0, 1fr))`:u,gap:d==="1"?"0.25rem":d==="2"?"0.5rem":d==="3"?"0.75rem":d==="4"?"1rem":typeof d=="number"?`${d}px`:d},children:Pt__namespace.default.Children.map(s,b=>Pt__namespace.default.isValidElement(b)?Pt__namespace.default.cloneElement(b,{size:l,variant:c}):b)})}function Rg({name:e,defaultValue:o,label:t,description:r,children:n,...i}){let{control:a,formState:s}=reactHookForm.useFormContext(),l=_(s.errors,e);return jsxRuntime.jsx(reactHookForm.Controller,{control:a,name:e,defaultValue:o,render:({field:c})=>jsxRuntime.jsxs("div",{className:"flex flex-col gap-1",children:[t&&jsxRuntime.jsx(q,{children:t}),r&&jsxRuntime.jsx(N,{children:r}),jsxRuntime.jsx(Ao,{...i,value:c.value,onChange:u=>c.onChange(u),children:n}),l&&jsxRuntime.jsx(g,{children:l})]})})}function Ws(e){return "primary"}var qs=Pt.createContext({variant:"primary"});function _o(e){let{variant:o="primary",...t}=e,r=Ws();return jsxRuntime.jsx(qs.Provider,{value:{variant:r},children:jsxRuntime.jsxs(reactAriaComponents.RadioGroup,{...t,className:Y(e.className,"group flex flex-col gap-2"),children:[jsxRuntime.jsx(q,{children:e.label}),jsxRuntime.jsx("div",{className:`flex ${t.orientation==="horizontal"?"flex-row gap-4":"flex-col gap-2"}`,children:e.children}),e.description&&jsxRuntime.jsx(N,{children:e.description}),jsxRuntime.jsx(g,{children:typeof e.errorMessage=="function"&&e.validationResult?e.errorMessage(e.validationResult):typeof e.errorMessage=="string"?e.errorMessage:null})]})})}function Wg({name:e,defaultValue:o,...t}){let{control:r,formState:n}=reactHookForm.useFormContext(),i=_(n.errors,e);return jsxRuntime.jsx(reactHookForm.Controller,{control:r,name:e,defaultValue:o,render:({field:a})=>jsxRuntime.jsx(_o,{...t,value:a.value,onChange:s=>a.onChange(s),errorMessage:i,children:t.children})})}var Js=e=>{let o=pe({isInvalid:e.isInvalid,isDisabled:e.isDisabled,isFocused:e.isFocused,transparent:e.transparent,size:e.size}),t=[e.showSearchIcon?"":"pl-3",e.isClearable&&e.hasValue||e.isPassword?"pr-8":"pr-3"].join(" ");return tailwindMerge.twMerge(o,t,e.className)};function Tt({label:e,description:o,errorMessage:t,size:r="md",tooltip:n,isRequired:i,transparent:a,showSearchIcon:s,isClearable:l,onClear:c,type:u,validationResult:d,reserveErrorSpace:b=true,isLoading:v=false,descriptionPlacement:m="below",...f}){let[h,C]=Pt__namespace.default.useState(false),{isFocused:R,handleFocus:A,handleBlur:M}=Ee(),L=u==="password",T=wt(v,300);return jsxRuntime.jsx(reactAriaComponents.TextField,{...f,isRequired:i,className:Y(f.className,"group flex flex-col"),children:({isDisabled:w,isInvalid:X})=>jsxRuntime.jsxs("div",{className:"flex flex-col",children:[e&&jsxRuntime.jsx(q,{size:r,tooltip:n,description:m==="tooltip"||m==="inline"?o:void 0,descriptionPlacement:m,isRequired:i,children:e}),jsxRuntime.jsxs(ae,{children:[s&&jsxRuntime.jsx("div",{className:"pointer-events-none absolute top-1/2 -translate-y-1/2 transform flex items-center z-10",style:{left:9},children:(()=>{let I={sm:14,md:16,lg:18,xl:20}[r];return T?jsxRuntime.jsx(Me,{size:I,color:"text-text-secondary"}):jsxRuntime.jsx(y,{name:"MagnifyingGlass",size:I,className:`transition-colors ${R?"text-action-brand":"text-text-secondary"}`})})()}),jsxRuntime.jsx(Bt,{size:r,disabled:w,type:L?h?"text":"password":u,name:f.name,autoComplete:f.autoComplete,value:f.value,defaultValue:f.defaultValue,placeholder:f.placeholder,onFocus:I=>A(I,f.onFocus),onBlur:I=>M(I,f.onBlur),onChange:I=>f.onChange?.(I.target.value),style:s?{paddingLeft:{sm:28,md:32,lg:36,xl:37}[r]}:void 0,className:Js({isInvalid:X,isDisabled:w,isFocused:R,size:r,transparent:a,showSearchIcon:s,isClearable:l,hasValue:!!f.value,isPassword:L,className:typeof f.className=="string"?f.className:void 0})}),l&&f.value&&!w&&jsxRuntime.jsx(mt,{onClick:()=>{c?c():f.onChange&&f.onChange("");},size:r}),L&&!w&&jsxRuntime.jsx("button",{type:"button",onClick:()=>C(!h),className:"absolute right-3 top-1/2 -translate-y-1/2 transform text-text-secondary hover:text-text-primary","aria-label":h?"Hide password":"Show password",onMouseDown:I=>{I.preventDefault(),I.stopPropagation();},children:jsxRuntime.jsx(y,{name:h?"EyeSlash":"Eye",size:r==="sm"?16:20,className:"text-text-primary"})})]}),b?jsxRuntime.jsx("div",{className:"mt-1 min-h-[20px]",children:typeof t=="string"?jsxRuntime.jsx(g,{size:r,children:t}):typeof t=="function"&&d?jsxRuntime.jsx(g,{size:r,children:t(d)}):o&&m==="below"?jsxRuntime.jsx(N,{size:r,children:o}):null}):jsxRuntime.jsx(jsxRuntime.Fragment,{children:typeof t=="string"?jsxRuntime.jsx(g,{size:r,className:"mt-1",children:t}):typeof t=="function"&&d?jsxRuntime.jsx(g,{size:r,className:"mt-1",children:t(d)}):o&&m==="below"?jsxRuntime.jsx(N,{size:r,className:"mt-1",children:o}):null})]})})}var ll={sm:{toolbar:"p-1.5",contentWrapper:"min-h-[100px]",contentPadding:"p-3",placeholderPos:"left-3 top-3",prose:"prose-xs",h1:"[&_.ProseMirror_h1]:mb-2 [&_.ProseMirror_h1]:text-base [&_.ProseMirror_h1]:font-bold",h2:"[&_.ProseMirror_h2]:mb-1.5 [&_.ProseMirror_h2]:text-sm [&_.ProseMirror_h2]:font-semibold",p:"[&_.ProseMirror_p]:mb-1",list:"[&_.ProseMirror_ul]:mb-1 [&_.ProseMirror_ul]:ml-4 [&_.ProseMirror_ol]:mb-1 [&_.ProseMirror_ol]:ml-4",li:"[&_.ProseMirror_li]:mb-0.5",placeholderText:"text-xs"},md:{toolbar:"p-2",contentWrapper:"min-h-[200px]",contentPadding:"p-4",placeholderPos:"left-4 top-4",prose:"prose-sm",h1:"[&_.ProseMirror_h1]:mb-4 [&_.ProseMirror_h1]:text-2xl [&_.ProseMirror_h1]:font-bold",h2:"[&_.ProseMirror_h2]:mb-3 [&_.ProseMirror_h2]:text-xl [&_.ProseMirror_h2]:font-semibold",p:"[&_.ProseMirror_p]:mb-2",list:"[&_.ProseMirror_ul]:mb-2 [&_.ProseMirror_ul]:ml-6 [&_.ProseMirror_ol]:mb-2 [&_.ProseMirror_ol]:ml-6",li:"[&_.ProseMirror_li]:mb-1",placeholderText:"text-sm"},lg:{toolbar:"p-2.5",contentWrapper:"min-h-[250px]",contentPadding:"p-5",placeholderPos:"left-5 top-5",prose:"prose-base",h1:"[&_.ProseMirror_h1]:mb-5 [&_.ProseMirror_h1]:text-3xl [&_.ProseMirror_h1]:font-bold",h2:"[&_.ProseMirror_h2]:mb-4 [&_.ProseMirror_h2]:text-2xl [&_.ProseMirror_h2]:font-semibold",p:"[&_.ProseMirror_p]:mb-3",list:"[&_.ProseMirror_ul]:mb-3 [&_.ProseMirror_ul]:ml-6 [&_.ProseMirror_ol]:mb-3 [&_.ProseMirror_ol]:ml-6",li:"[&_.ProseMirror_li]:mb-1.5",placeholderText:"text-base"},xl:{toolbar:"p-3",contentWrapper:"min-h-[300px]",contentPadding:"p-6",placeholderPos:"left-6 top-6",prose:"prose-lg",h1:"[&_.ProseMirror_h1]:mb-6 [&_.ProseMirror_h1]:text-4xl [&_.ProseMirror_h1]:font-bold",h2:"[&_.ProseMirror_h2]:mb-5 [&_.ProseMirror_h2]:text-3xl [&_.ProseMirror_h2]:font-semibold",p:"[&_.ProseMirror_p]:mb-3",list:"[&_.ProseMirror_ul]:mb-3 [&_.ProseMirror_ul]:ml-8 [&_.ProseMirror_ol]:mb-3 [&_.ProseMirror_ol]:ml-8",li:"[&_.ProseMirror_li]:mb-2",placeholderText:"text-lg"}},dt=({isActive:e=false,onPress:o,children:t})=>jsxRuntime.jsx(k,{variant:e?"secondary":"ghost",size:"sm",onPress:o,className:"p-1",children:t});function dl({initialUrl:e,isOpen:o,onClose:t,onSubmit:r}){let[n,i]=Pt.useState(e);return Pt__namespace.default.useEffect(()=>{i(e);},[e]),jsxRuntime.jsx(qe,{isDismissable:true,isOpen:o,onOpenChange:s=>!s&&t(),children:jsxRuntime.jsx(reactAriaComponents.Modal,{className:"flex items-center justify-center p-4 outline-none focus:outline-none focus-visible:outline-none ring-0 focus:ring-0 focus-visible:ring-0",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(nt,{title:"Insert Link",onClose:t}),jsxRuntime.jsx("div",{className:"p-6",children:jsxRuntime.jsx(Tt,{label:"URL",type:"url",value:n,onChange:i,autoFocus:true,className:"w-full"})}),jsxRuntime.jsxs("div",{className:"flex justify-end gap-2 border-t border-border-muted p-4",children:[jsxRuntime.jsx(k,{variant:"secondary",onPress:t,children:"Cancel"}),jsxRuntime.jsx(k,{type:"submit",children:"Save"})]})]})})})})}function zo({initialContent:e="",onChange:o,className:t,isDisabled:r=false,placeholder:n="Start typing...",id:i,size:a="md",headingLevels:s=[1,2]}){let l=ll[a],[c,u]=Pt.useState(false),d=react.useEditor({immediatelyRender:false,extensions:[nl__default.default.configure({heading:s.length>0?{levels:s}:false}),el__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:m})=>{o?.(m.getHTML());},editorProps:{attributes:{class:tailwindMerge.twMerge(`prose ${l.prose} max-w-none`,"focus:outline-none","[&>*:first-child]:mt-0 [&>*:last-child]:mb-0")}}}),b=()=>{u(true);},v=m=>{m===""?d?.chain().focus().unsetLink().run():d?.chain().focus().setLink({href:m}).run();};return d?jsxRuntime.jsxs("div",{id:i,"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:[!r&&d&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(menus.BubbleMenu,{editor:d,shouldShow:({editor:m})=>m.isActive("link")&&!c,className:"flex items-center gap-1 rounded-md border border-border-input bg-background-surface p-1 shadow-md",children:[jsxRuntime.jsxs(k,{variant:"ghost",size:"sm",className:"h-8 px-2",onPress:()=>{let m=d.getAttributes("link").href;m&&window.open(m,"_blank","noopener,noreferrer");},children:[jsxRuntime.jsx(y,{name:"ArrowSquareOut",className:"mr-1 h-4 w-4"}),"Open"]}),jsxRuntime.jsxs(k,{variant:"ghost",size:"sm",className:"h-8 px-2",onPress:b,children:[jsxRuntime.jsx(y,{name:"PencilSimple",className:"mr-1 h-4 w-4"}),"Edit"]}),jsxRuntime.jsxs(k,{variant:"ghost",size:"sm",className:"h-8 px-2",onPress:()=>d.chain().focus().unsetLink().run(),children:[jsxRuntime.jsx(y,{name:"X",className:"mr-1 h-4 w-4"}),"Remove"]})]}),jsxRuntime.jsx(dl,{isOpen:c,onClose:()=>u(false),onSubmit:v,initialUrl:d.getAttributes("link").href||""})]}),jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("flex items-center gap-1 border-b border-border-input",l.toolbar),children:[s.map(m=>jsxRuntime.jsx(dt,{isActive:d.isActive("heading",{level:m}),onPress:()=>d.chain().focus().toggleHeading({level:m}).run(),children:jsxRuntime.jsxs("span",{className:"text-xs font-bold",children:["H",m]})},m)),jsxRuntime.jsx(dt,{isActive:d.isActive("bold"),onPress:()=>d.chain().focus().toggleBold().run(),children:jsxRuntime.jsx("span",{className:"text-xs font-bold",children:"B"})}),jsxRuntime.jsx(dt,{isActive:d.isActive("italic"),onPress:()=>d.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(dt,{isActive:d.isActive("bulletList"),onPress:()=>d.chain().focus().toggleBulletList().run(),children:jsxRuntime.jsx(y,{name:"ListBullets",className:"h-4 w-4"})}),jsxRuntime.jsx(dt,{isActive:d.isActive("orderedList"),onPress:()=>d.chain().focus().toggleOrderedList().run(),children:jsxRuntime.jsx(y,{name:"ListNumbers",className:"h-4 w-4"})}),jsxRuntime.jsx("div",{className:"mx-1 h-4 w-px bg-border-muted"}),jsxRuntime.jsx(dt,{isActive:d.isActive("link"),onPress:b,children:jsxRuntime.jsx(y,{name:"PaperclipHorizontal",className:"h-4 w-4"})})]}),jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("relative w-full outline-none focus:outline-none",l.contentWrapper),children:[jsxRuntime.jsx(react.EditorContent,{editor:d,className:tailwindMerge.twMerge("w-full outline-none focus:outline-none",l.contentPadding,"[&_.ProseMirror]:min-h-[inherit]","[&_.ProseMirror]:outline-none [&_.ProseMirror]:focus:outline-none",l.h1,l.h2,l.p,"[&_.ProseMirror_ul]:list-disc","[&_.ProseMirror_ol]:list-decimal",l.list,l.li,"[&_.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")}),d.isEmpty&&!r&&jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("pointer-events-none absolute text-text-secondary",l.placeholderPos,l.placeholderText),children:n})]})]}):null}function Sb({name:e,defaultValue:o,label:t,description:r,reserveErrorSpace:n=true,...i}){let{control:a,formState:s}=reactHookForm.useFormContext(),l=_(s.errors,e);return jsxRuntime.jsx(reactHookForm.Controller,{control:a,name:e,defaultValue:o,render:({field:c})=>jsxRuntime.jsxs("div",{className:"flex flex-col gap-1",children:[t&&jsxRuntime.jsx("label",{htmlFor:e,className:"text-sm font-medium text-text-primary",children:t}),r&&jsxRuntime.jsx("p",{className:"text-sm text-text-secondary",children:r}),jsxRuntime.jsx(zo,{...i,id:e,initialContent:c.value??"",onChange:u=>c.onChange(u)}),l&&jsxRuntime.jsx("p",{className:"text-sm text-feedback-error-text",children:l}),n&&!l&&jsxRuntime.jsx("div",{className:"h-5"})]})})}function Lb({name:e,defaultValue:o,onValueChange:t,...r}){let{control:n,formState:i}=reactHookForm.useFormContext(),a=_(i.errors,e);return jsxRuntime.jsx(reactHookForm.Controller,{control:n,name:e,defaultValue:o,render:({field:s})=>jsxRuntime.jsx(ho,{...r,selectedKey:s.value??null,onSelectionChange:l=>{s.onChange(l),t?.(l);},showErrors:!!a,errorMessage:a})})}var Oo={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 xl({isSelected:e,isDisabled:o,size:t="md"}){let r="flex px-px items-center shrink-0 cursor-default rounded-full transition duration-200 ease-in-out shadow-inner border border-transparent",n=Oo[t].track,i=We,a="focus-visible:outline-action-primary",s="";return e?s="bg-action-primary forced-colors:!bg-[Highlight] group-pressed:bg-action-primary-hover":s="bg-border-input group-pressed:bg-border-focus",[r,n,i,a,s,o?"bg-background-muted forced-colors:group-selected:!bg-[GrayText] forced-colors:border-[GrayText]":""].filter(Boolean).join(" ")}function hl({isSelected:e,isDisabled:o,size:t="md"}){let r="transform rounded-full bg-background-surface outline-none shadow transition duration-200 ease-in-out",n=Oo[t].handle;return [r,n,e?"translate-x-[100%]":"translate-x-0",o?"forced-colors:outline-[GrayText]":""].filter(Boolean).join(" ")}function $o({children:e,variant:o="primary",size:t="md",...r}){return jsxRuntime.jsx(reactAriaComponents.Switch,{...r,className:Y(r.className,`relative group flex items-center gap-2 ${Oo[t].text} text-text-primary transition disabled:text-text-disabled forced-colors:disabled:text-[GrayText]`),children:n=>jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:xl({...n,size:t}),children:jsxRuntime.jsx("span",{className:hl({...n,size:t})})}),e]})})}function qb({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($o,{...t,isSelected:!!n.value,onChange:i=>n.onChange(i),children:t.children})})}var Fl=e=>{let o=pe({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 Go({label:e,description:o,errorMessage:t,size:r="md",tooltip:n,required:i,transparent:a,isInvalid:s,isDisabled:l,isResizable:c=false,className:u,validationResult:d,reserveErrorSpace:b=true,...v}){let{isFocused:m,handleFocus:f,handleBlur:h}=Ee();return jsxRuntime.jsx("div",{className:"group flex flex-col",children:jsxRuntime.jsxs("div",{className:"flex flex-col",children:[e&&jsxRuntime.jsx(q,{size:r,tooltip:n,isRequired:i,children:e}),jsxRuntime.jsx(ae,{children:jsxRuntime.jsx("textarea",{...v,required:i,onFocus:C=>{v.onFocus&&v.onFocus(C),f(C);},onBlur:C=>{v.onBlur&&v.onBlur(C),h(C);},className:Fl({isInvalid:s,isDisabled:l,isResizable:c,isFocused:m,size:r,transparent:a,className:u}),disabled:l})}),b?jsxRuntime.jsx("div",{className:"mt-1 min-h-[20px]",children:typeof t=="string"?jsxRuntime.jsx(g,{size:r,children:t}):typeof t=="function"&&d?jsxRuntime.jsx(g,{size:r,children:t(d)}):o?jsxRuntime.jsx(N,{size:r,children:o}):null}):jsxRuntime.jsx(jsxRuntime.Fragment,{children:typeof t=="string"?jsxRuntime.jsx(g,{size:r,className:"mt-1",children:t}):typeof t=="function"&&d?jsxRuntime.jsx(g,{size:r,className:"mt-1",children:t(d)}):o?jsxRuntime.jsx(N,{size:r,className:"mt-1",children:o}):null})]})})}function nx({name:e,defaultValue:o,...t}){let{control:r,formState:n}=reactHookForm.useFormContext(),i=_(n.errors,e);return jsxRuntime.jsx(reactHookForm.Controller,{control:r,name:e,defaultValue:o,render:({field:a})=>jsxRuntime.jsx(Go,{...t,value:a.value??"",onChange:s=>a.onChange(s.target.value),onBlur:s=>{a.onBlur(),t.onBlur?.(s);},isInvalid:!!i,errorMessage:i,required:t.required})})}function cx({name:e,defaultValue:o,...t}){let{control:r,formState:n}=reactHookForm.useFormContext(),i=_(n.errors,e);return jsxRuntime.jsx(reactHookForm.Controller,{control:r,name:e,defaultValue:o,render:({field:a})=>jsxRuntime.jsx(Tt,{...t,value:a.value??"",onChange:s=>a.onChange(s),onBlur:s=>{a.onBlur(),t.onBlur?.(s);},isInvalid:!!i,errorMessage:i,isRequired:t.isRequired})})}function Bl({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-base md:text-xs",md:"text-base md:text-sm",lg:"text-base",xl:"text-lg"}[t],e?"text-text-disabled italic":"text-text-primary",o?"text-text-disabled cursor-not-allowed":"cursor-text",!o&&"hover:bg-background-hover","data-[focused]:bg-background-selected data-[focused]:text-text-primary")}function Wo({label:e,description:o,errorMessage:t,size:r="md",tooltip:n,isRequired:i,isDisabled:a,isInvalid:s,reserveErrorSpace:l=true,validationResult:c,className:u,descriptionPlacement:d="below",...b}){return jsxRuntime.jsxs(reactAriaComponents.TimeField,{...b,isDisabled:a,isRequired:i,isInvalid:s,className:Y(u,"flex flex-col gap-1"),children:[e&&jsxRuntime.jsx(q,{size:r,tooltip:n,description:d==="tooltip"||d==="inline"?o:void 0,descriptionPlacement:d,isRequired:i,children:e}),jsxRuntime.jsx(ae,{children:jsxRuntime.jsx(reactAriaComponents.DateInput,{className:tailwindMerge.twMerge(ft({isInvalid:s,isDisabled:a}),"px-3 py-2 flex items-center gap-0.5 w-full"),children:v=>jsxRuntime.jsx(reactAriaComponents.DateSegment,{segment:v,className:Bl({isPlaceholder:v.isPlaceholder,isDisabled:!v.isEditable||a,size:r})})})}),l?jsxRuntime.jsx("div",{className:"mt-1 min-h-[20px]",children:typeof t=="string"?jsxRuntime.jsx(g,{size:r,children:t}):typeof t=="function"&&c?jsxRuntime.jsx(g,{size:r,children:t(c)}):o&&d==="below"?jsxRuntime.jsx(N,{size:r,children:o}):null}):jsxRuntime.jsx(jsxRuntime.Fragment,{children:typeof t=="string"?jsxRuntime.jsx(g,{size:r,className:"mt-1",children:t}):typeof t=="function"&&c?jsxRuntime.jsx(g,{size:r,className:"mt-1",children:t(c)}):o&&d==="below"?jsxRuntime.jsx(N,{size:r,className:"mt-1",children:o}):null})]})}function Ix({name:e,...o}){let{control:t,formState:{errors:r}}=reactHookForm.useFormContext(),n=r[e],i=n?.message;return jsxRuntime.jsx(reactHookForm.Controller,{name:e,control:t,render:({field:a})=>jsxRuntime.jsx(Wo,{...o,value:a.value,onChange:a.onChange,isInvalid:!!n,errorMessage:i})})}function Mx({className:e,title:o="Please fix the following errors:",autoFocus:t=true}){let{formState:r}=reactHookForm.useFormContext(),n=Pt__namespace.useRef(null),i=r.errors,a=Object.entries(i||{}),s=a.length>0;if(Pt__namespace.useEffect(()=>{t&&s&&n.current?.focus();},[t,s]),!s)return null;let l=c=>{let u=`[name="${CSS.escape(c)}"]`,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:a.map(([c,u])=>{let d=u?.message||"Invalid value";return jsxRuntime.jsx("li",{children:jsxRuntime.jsx("button",{type:"button",className:"underline underline-offset-2",onClick:()=>l(c),children:d})},c)})})]})}function Hx({formId:e,disableWhenInvalid:o,disableWhenPristine:t,isDisabled:r,children:n,...i}){let{formState:a}=reactHookForm.useFormContext(),s=r||a.isSubmitting||o&&!a.isValid||t&&!a.isDirty;return jsxRuntime.jsx(k,{type:"submit",form:e,isDisabled:s,...i,children:n})}function Ux({name:e,getItemTitle:o,renderItem:t,onAdd:r}){let{control:n}=reactHookForm.useFormContext(),{fields:i,append:a,remove:s,swap:l}=reactHookForm.useFieldArray({control:n,name:e});return jsxRuntime.jsxs("div",{className:"flex flex-col gap-3",children:[i.map((c,u)=>jsxRuntime.jsxs(Te,{children:[jsxRuntime.jsx(yt,{title:o?o(u):`Item ${u+1}`,actions:jsxRuntime.jsxs("div",{className:"flex gap-2",children:[u>0&&jsxRuntime.jsx(k,{size:"sm",variant:"secondary",onPress:()=>l(u,u-1),children:"Up"}),u<i.length-1&&jsxRuntime.jsx(k,{size:"sm",variant:"secondary",onPress:()=>l(u,u+1),children:"Down"}),jsxRuntime.jsx(k,{size:"sm",variant:"secondary",onPress:()=>s(u),children:"Remove"})]})}),jsxRuntime.jsx(Mt,{children:t(u)})]},c.id)),jsxRuntime.jsx("div",{children:jsxRuntime.jsx(k,{variant:"secondary",onPress:()=>a(r?.()||{}),children:"Add item"})})]})}function Uo(e){return jsxRuntime.jsx(reactAriaComponents.Form,{validationBehavior:"aria",...e,className:tailwindMerge.twMerge("flex flex-col gap-6",e.className)})}function rn(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 ih({id:e,onSubmit:o,onInvalid:t,children:r,shouldFocusError:n=true,className:i,...a}){let s=reactHookForm.useForm(a),l=(c,u)=>{if(n&&e){let d=document.getElementById(e);d&&rn(d);}t?.(c,u);};return jsxRuntime.jsx(reactHookForm.FormProvider,{...s,children:jsxRuntime.jsx(Uo,{id:e,className:i,onSubmit:s.handleSubmit(o,l),children:r})})}function sn({formId:e,show:o,isSubmitting:t,onCancel:r,primaryLabel:n="Save changes",secondaryLabel:i="Cancel",className:a}){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",a),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-secondary",children:"You have unsaved changes"}),jsxRuntime.jsxs("div",{className:"flex gap-2",children:[jsxRuntime.jsx(k,{variant:"secondary",onPress:r,children:i}),jsxRuntime.jsx(k,{type:"submit",form:e,isDisabled:!!t,children:t?"Saving...":n})]})]})}):null}function gh({formId:e,onCancel:o,primaryLabel:t,secondaryLabel:r,className:n}){let{formState:i}=reactHookForm.useFormContext();return jsxRuntime.jsx(sn,{formId:e,show:i.isDirty,isSubmitting:i.isSubmitting,onCancel:o,primaryLabel:t,secondaryLabel:r,className:n})}function yh(e=true){let{formState:o}=reactHookForm.useFormContext();Pt__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 Ch({delayMs:e=800,onAutoSave:o}){let{watch:t,formState:r,getValues:n}=reactHookForm.useFormContext(),i=Pt__namespace.useRef(void 0);Pt__namespace.useEffect(()=>{let a=t(()=>{r.isDirty&&(i.current&&window.clearTimeout(i.current),i.current=window.setTimeout(async()=>{let s=n();await o(s);},e));});return ()=>{a.unsubscribe(),i.current&&window.clearTimeout(i.current);}},[t,r.isDirty,n,e,o]);}
|
|
2
|
+
Object.defineProperty(exports,"Controller",{enumerable:true,get:function(){return reactHookForm.Controller}});Object.defineProperty(exports,"useFieldArray",{enumerable:true,get:function(){return reactHookForm.useFieldArray}});Object.defineProperty(exports,"useFormContext",{enumerable:true,get:function(){return reactHookForm.useFormContext}});Object.defineProperty(exports,"useWatch",{enumerable:true,get:function(){return reactHookForm.useWatch}});exports.ErrorSummary=Mx;exports.FieldArrayList=Ux;exports.FormAutocomplete=Tp;exports.FormCheckbox=Wp;exports.FormCheckboxGroup=Qp;exports.FormColorField=fm;exports.FormDateField=Km;exports.FormFileUpload=cf;exports.FormMultiSelect=Hf;exports.FormNumberField=ag;exports.FormProvider=ih;exports.FormRadioCardGroup=Rg;exports.FormRadioGroup=Wg;exports.FormRichTextEditor=Sb;exports.FormSaveBar=gh;exports.FormSelect=Lb;exports.FormSwitch=qb;exports.FormTextArea=nx;exports.FormTextField=cx;exports.FormTimeField=Ix;exports.SubmitButton=Hx;exports.focusFirstError=rn;exports.useAutoSave=Ch;exports.useScrollIntoViewOnError=yh;//# sourceMappingURL=index.cjs.map
|
|
3
3
|
//# sourceMappingURL=index.cjs.map
|