ynotsoft-dynamic-form 1.0.121 → 1.0.130

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- (function(me,c){typeof exports=="object"&&typeof module<"u"?c(exports,require("react/jsx-runtime"),require("react"),require("react-hot-toast"),require("dayjs"),require("react-select"),require("react-select/animated"),require("react-dom"),require("@tiptap/react"),require("@tiptap/starter-kit"),require("@tiptap/extension-underline"),require("@tiptap/extension-character-count"),require("react-day-picker"),require("react-day-picker/dist/style.css")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react","react-hot-toast","dayjs","react-select","react-select/animated","react-dom","@tiptap/react","@tiptap/starter-kit","@tiptap/extension-underline","@tiptap/extension-character-count","react-day-picker","react-day-picker/dist/style.css"],c):(me=typeof globalThis<"u"?globalThis:me||self,c(me.YnotsoftDynamicForm={},me.jsxRuntime,me.React,me.ReactHotToast,me.dayjs,me.ReactSelect,me.ReactSelectAnimated,me.ReactDOM,me.TiptapReact,me.StarterKit,null,me.CharacterCount,me.ReactDayPicker))})(this,(function(me,c,R,nn,vt,Xi,Qi,lo,uo,Zi,Hh,Ji,Zn){"use strict";function fo(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const f=fo(R),rn=fo(lo);function ec(e){return c.jsx("input",{type:"hidden",name:e.name,value:e.value},e.name)}function tc({field:e,formValues:t,handleChange:n,handleBlur:r,error:o,disabled:s}){const a=e.disabled&&typeof e.disabled=="function"?e.disabled(t):e.disabled,i=s||a,l=e.options||[],d=Qi(),u=t[e.name]||e.value||[],h=p=>Array.isArray(p)&&p.length>0&&typeof p[0]=="object"&&p[0]!==null&&"value"in p[0];let g;return h(u)?g=u:g=u.filter(p=>p!=null).map(p=>l.find(b=>b.value===p)).filter(p=>p!==void 0),c.jsx("div",{className:`mb-4 ${e.fieldClass?e.fieldClass:"col-span-full"}`,children:c.jsx(Xi,{components:d,isMulti:!0,isDisabled:i,name:e.label,value:g,onChange:p=>{const b=p.map(m=>m.value);n(e.name,b)},options:l,placeholder:e.placeholder,closeMenuOnSelect:!1,onBlur:()=>r(e.name),classNamePrefix:"react-select",classNames:{control:p=>`!rounded-lg !min-h-[42px] transition duration-150 !shadow-sm
1
+ (function(me,c){typeof exports=="object"&&typeof module<"u"?c(exports,require("react/jsx-runtime"),require("react"),require("react-hot-toast"),require("dayjs"),require("react-select"),require("react-select/animated"),require("react-dom"),require("@tiptap/react"),require("@tiptap/starter-kit"),require("@tiptap/extension-underline"),require("@tiptap/extension-character-count"),require("react-day-picker"),require("react-day-picker/dist/style.css")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react","react-hot-toast","dayjs","react-select","react-select/animated","react-dom","@tiptap/react","@tiptap/starter-kit","@tiptap/extension-underline","@tiptap/extension-character-count","react-day-picker","react-day-picker/dist/style.css"],c):(me=typeof globalThis<"u"?globalThis:me||self,c(me.YnotsoftDynamicForm={},me.jsxRuntime,me.React,me.ReactHotToast,me.dayjs,me.ReactSelect,me.ReactSelectAnimated,me.ReactDOM,me.TiptapReact,me.StarterKit,null,me.CharacterCount,me.ReactDayPicker))})(this,(function(me,c,R,nn,vt,Xi,Qi,lo,uo,Zi,Hh,Ji,Zn){"use strict";function fo(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const f=fo(R),rn=fo(lo);function ec(e){return c.jsx("input",{type:"hidden",name:e.name,value:e.value},e.name)}function tc({field:e,formValues:t,handleChange:n,handleBlur:r,error:o,disabled:s}){const a=e.disabled&&typeof e.disabled=="function"?e.disabled(t):e.disabled,i=s||a,l=e.options||[],u=Qi(),d=t[e.name]||e.value||[],h=p=>Array.isArray(p)&&p.length>0&&typeof p[0]=="object"&&p[0]!==null&&"value"in p[0];let g;return h(d)?g=d:g=d.filter(p=>p!=null).map(p=>l.find(b=>b.value===p)).filter(p=>p!==void 0),c.jsx("div",{className:`mb-4 ${e.fieldClass?e.fieldClass:"col-span-full"}`,children:c.jsx(Xi,{components:u,isMulti:!0,isDisabled:i,name:e.label,value:g,onChange:p=>{const b=p.map(m=>m.value);n(e.name,b)},options:l,placeholder:e.placeholder,closeMenuOnSelect:!1,onBlur:()=>r(e.name),classNamePrefix:"react-select",classNames:{control:p=>`!rounded-lg !min-h-[42px] transition duration-150 !shadow-sm
2
2
  ${o?"!border-red-500":"!border-gray-300"}
3
3
  ${i?"!bg-gray-100 !cursor-not-allowed":"!bg-white"}
4
4
  ${!i&&p.isFocused?"!border-blue-500 ring-2 ring-blue-200":""}
@@ -6,19 +6,19 @@
6
6
  `,valueContainer:()=>"py-0.5 px-2",placeholder:()=>"text-gray-400",dropdownIndicator:()=>"!text-gray-400 hover:!text-gray-600",multiValue:()=>"!bg-blue-100 !text-blue-800 !rounded-md",multiValueLabel:()=>"!text-blue-800 !pr-1",multiValueRemove:()=>"!text-blue-500 hover:!bg-blue-200 hover:!text-blue-700 !rounded-r-md",menu:()=>"!shadow-lg !rounded-lg !mt-2 !z-50",option:p=>`!py-2 !px-3 !text-sm !cursor-pointer
7
7
  ${p.isSelected?"!bg-blue-500 !text-white":""}
8
8
  ${p.isFocused&&!p.isSelected?"!bg-gray-100 !text-gray-800":""}
9
- `}})})}const nc=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),rc=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),po=e=>{const t=rc(e);return t.charAt(0).toUpperCase()+t.slice(1)},mo=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),oc=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var sc={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const ac=R.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:s,iconNode:a,...i},l)=>R.createElement("svg",{ref:l,...sc,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:mo("lucide",o),...!s&&!oc(i)&&{"aria-hidden":"true"},...i},[...a.map(([d,u])=>R.createElement(d,u)),...Array.isArray(s)?s:[s]]));const ae=(e,t)=>{const n=R.forwardRef(({className:r,...o},s)=>R.createElement(ac,{ref:s,iconNode:t,className:mo(`lucide-${nc(po(e))}`,`lucide-${e}`,r),...o}));return n.displayName=po(e),n};const ic=ae("bold",[["path",{d:"M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8",key:"mg9rjx"}]]);const ho=ae("calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);const cc=ae("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);const on=ae("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);const lc=ae("circle-alert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);const dc=ae("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);const uc=ae("circle-x",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);const fc=ae("circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);const pc=ae("cloud-upload",[["path",{d:"M12 13v8",key:"1l5pq0"}],["path",{d:"M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242",key:"1pljnt"}],["path",{d:"m8 17 4-4 4 4",key:"1quai1"}]]);const mc=ae("code",[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]]);const hc=ae("grip-horizontal",[["circle",{cx:"12",cy:"9",r:"1",key:"124mty"}],["circle",{cx:"19",cy:"9",r:"1",key:"1ruzo2"}],["circle",{cx:"5",cy:"9",r:"1",key:"1a8b28"}],["circle",{cx:"12",cy:"15",r:"1",key:"1e56xg"}],["circle",{cx:"19",cy:"15",r:"1",key:"1a92ep"}],["circle",{cx:"5",cy:"15",r:"1",key:"5r1jwy"}]]);const gc=ae("heading-1",[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"m17 12 3-2v8",key:"1hhhft"}]]);const bc=ae("heading-2",[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"M21 18h-4c0-4 4-3 4-6 0-1.5-2-2.5-4-1",key:"9jr5yi"}]]);const yc=ae("heading-3",[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"M17.5 10.5c1.7-1 3.5 0 3.5 1.5a2 2 0 0 1-2 2",key:"68ncm8"}],["path",{d:"M17 17.5c2 1.5 4 .3 4-1.5a2 2 0 0 0-2-2",key:"1ejuhz"}]]);const vc=ae("info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);const wc=ae("italic",[["line",{x1:"19",x2:"10",y1:"4",y2:"4",key:"15jd3p"}],["line",{x1:"14",x2:"5",y1:"20",y2:"20",key:"bu0au3"}],["line",{x1:"15",x2:"9",y1:"4",y2:"20",key:"uljnxc"}]]);const xc=ae("list-ordered",[["path",{d:"M11 5h10",key:"1cz7ny"}],["path",{d:"M11 12h10",key:"1438ji"}],["path",{d:"M11 19h10",key:"11t30w"}],["path",{d:"M4 4h1v5",key:"10yrso"}],["path",{d:"M4 9h2",key:"r1h2o0"}],["path",{d:"M6.5 20H3.4c0-1 2.6-1.925 2.6-3.5a1.5 1.5 0 0 0-2.6-1.02",key:"xtkcd5"}]]);const Sc=ae("list",[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]]);const go=ae("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);const Cc=ae("message-square-quote",[["path",{d:"M14 14a2 2 0 0 0 2-2V8h-2",key:"1r06pg"}],["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}],["path",{d:"M8 14a2 2 0 0 0 2-2V8H8",key:"1jzu5j"}]]);const Ec=ae("redo",[["path",{d:"M21 7v6h-6",key:"3ptur4"}],["path",{d:"M3 17a9 9 0 0 1 9-9 9 9 0 0 1 6 2.3l3 2.7",key:"1kgawr"}]]);const Nc=ae("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]);const kc=ae("strikethrough",[["path",{d:"M16 4H9a3 3 0 0 0-2.83 4",key:"43sutm"}],["path",{d:"M14 12a4 4 0 0 1 0 8H6",key:"nlfj13"}],["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}]]);const Ac=ae("underline",[["path",{d:"M6 4v6a6 6 0 0 0 12 0V4",key:"9kb039"}],["line",{x1:"4",x2:"20",y1:"20",y2:"20",key:"nun2al"}]]);const Tc=ae("undo",[["path",{d:"M3 7v6h6",key:"1v2h90"}],["path",{d:"M21 17a9 9 0 0 0-9-9 9 9 0 0 0-6 2.3L3 13",key:"1r6uu6"}]]);const Jn=ae("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function Pc({field:e,formValues:t,handleChange:n,handleBlur:r,error:o,disabled:s,apiClient:a,...i}){const l=s,d=e.selectMode!=="multiple",u=e.returnValueOnly===!0,[h,g]=R.useState([]),[p,b]=R.useState(!1),[m,v]=R.useState(!1),[C,N]=R.useState(""),[E,x]=R.useState(-1),[S,A]=R.useState({}),_=R.useRef(null),P=R.useRef(null),$=R.useRef(null),z=t[e.name],G=R.useCallback(()=>z?(Array.isArray(z)?z:[z]).map(F=>{if(F&&typeof F=="object"&&F.value!==void 0)return{value:F.value,label:F.label||F.value};const M=h.find(q=>q.value===F);return M||(S[F]?S[F]:{value:F,label:F})}):[],[z,h,S])(),w=R.useCallback(async(T="")=>{if(e.onSearch){const F=await e.onSearch(T,t);g((F||[]).map(M=>({value:M[e.valueId||"value"]??M.value??M.id,label:M[e.labelId||"label"]??M.label??M.name,description:M.description})));return}if(!e.optionsUrl||!a){const F=(e.options||[]).map(M=>({value:M[e.valueId||"value"]||M.value||M.id,label:M[e.labelId||"label"]||M.label||M.name,description:M.description}));g(T?F.filter(M=>String(M.label).toLowerCase().includes(T.toLowerCase())):F);return}b(!0);try{const F=e.searchParam||"search",M=e.optionsUrl.includes("?")?"&":"?",q=`${e.optionsUrl}${M}${F}=${encodeURIComponent(T)}`,de=await a(q),Z=de.data||de,ge=Array.isArray(Z)?Z:[];g(ge.map(Y=>({value:Y[e.valueId||"value"]||Y.value||Y.id,label:Y[e.labelId||"label"]||Y.label||Y.name,description:Y.description})))}catch{g([])}finally{b(!1)}},[e,a,t]),k=R.useCallback(T=>{if(!T)return;A(q=>({...q,[T.value]:T}));const F=u?T.value:{value:T.value,label:T.label};let M;if(d)M=[F],v(!1);else{const q=Array.isArray(z)?z:[];M=q.some(Z=>(Z?.value??Z)===T.value)?q.filter(Z=>(Z?.value??Z)!==T.value):[...q,F]}n(e.name,M),r(e.name),e.clearSearchOnSelect&&N("")},[z,e.clearSearchOnSelect,e.name,n,r,d,u]),D=T=>{if(!l)switch(T.key){case"ArrowDown":T.preventDefault(),m?x(F=>F<h.length-1?F+1:F):v(!0);break;case"ArrowUp":T.preventDefault(),m&&x(F=>F>0?F-1:0);break;case"Enter":T.preventDefault(),m&&E>=0&&h[E]?k(h[E]):m||v(!0);break;case"Escape":v(!1);break;case"Tab":v(!1),r(e.name);break}},O=T=>{const F=T.target.value;N(F),x(-1),$.current&&clearTimeout($.current),$.current=setTimeout(()=>w(F),300)};R.useEffect(()=>{if(m){w(C);const T=setTimeout(()=>P.current?.focus(),50);return()=>clearTimeout(T)}else x(-1)},[m,w,C]),R.useEffect(()=>{if(!m)return;const T=F=>{_.current&&!_.current.contains(F.target)&&(v(!1),r(e.name))};return document.addEventListener("mousedown",T),()=>document.removeEventListener("mousedown",T)},[m,e.name,r]);const I=(T,F)=>{T.stopPropagation();const M=Array.isArray(z)?z:[],q=d?[]:M.filter(de=>(de?.value??de)!==F);n(e.name,q),r(e.name)};return c.jsxs("div",{className:`mb-4 relative ${e.fieldClass||"col-span-full"}`,ref:_,children:[c.jsxs("div",{role:"combobox","aria-expanded":m,"aria-haspopup":"listbox","aria-controls":`${e.name}-listbox`,tabIndex:l?-1:0,onClick:()=>!l&&v(!m),onKeyDown:D,className:`
9
+ `}})})}const nc=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),rc=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),po=e=>{const t=rc(e);return t.charAt(0).toUpperCase()+t.slice(1)},mo=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),oc=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var sc={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const ac=R.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:s,iconNode:a,...i},l)=>R.createElement("svg",{ref:l,...sc,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:mo("lucide",o),...!s&&!oc(i)&&{"aria-hidden":"true"},...i},[...a.map(([u,d])=>R.createElement(u,d)),...Array.isArray(s)?s:[s]]));const ie=(e,t)=>{const n=R.forwardRef(({className:r,...o},s)=>R.createElement(ac,{ref:s,iconNode:t,className:mo(`lucide-${nc(po(e))}`,`lucide-${e}`,r),...o}));return n.displayName=po(e),n};const ic=ie("bold",[["path",{d:"M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8",key:"mg9rjx"}]]);const ho=ie("calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);const cc=ie("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);const on=ie("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);const lc=ie("circle-alert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);const uc=ie("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);const dc=ie("circle-x",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);const fc=ie("circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);const pc=ie("cloud-upload",[["path",{d:"M12 13v8",key:"1l5pq0"}],["path",{d:"M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242",key:"1pljnt"}],["path",{d:"m8 17 4-4 4 4",key:"1quai1"}]]);const mc=ie("code",[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]]);const hc=ie("grip-horizontal",[["circle",{cx:"12",cy:"9",r:"1",key:"124mty"}],["circle",{cx:"19",cy:"9",r:"1",key:"1ruzo2"}],["circle",{cx:"5",cy:"9",r:"1",key:"1a8b28"}],["circle",{cx:"12",cy:"15",r:"1",key:"1e56xg"}],["circle",{cx:"19",cy:"15",r:"1",key:"1a92ep"}],["circle",{cx:"5",cy:"15",r:"1",key:"5r1jwy"}]]);const gc=ie("heading-1",[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"m17 12 3-2v8",key:"1hhhft"}]]);const bc=ie("heading-2",[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"M21 18h-4c0-4 4-3 4-6 0-1.5-2-2.5-4-1",key:"9jr5yi"}]]);const yc=ie("heading-3",[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"M17.5 10.5c1.7-1 3.5 0 3.5 1.5a2 2 0 0 1-2 2",key:"68ncm8"}],["path",{d:"M17 17.5c2 1.5 4 .3 4-1.5a2 2 0 0 0-2-2",key:"1ejuhz"}]]);const vc=ie("info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);const wc=ie("italic",[["line",{x1:"19",x2:"10",y1:"4",y2:"4",key:"15jd3p"}],["line",{x1:"14",x2:"5",y1:"20",y2:"20",key:"bu0au3"}],["line",{x1:"15",x2:"9",y1:"4",y2:"20",key:"uljnxc"}]]);const xc=ie("list-ordered",[["path",{d:"M11 5h10",key:"1cz7ny"}],["path",{d:"M11 12h10",key:"1438ji"}],["path",{d:"M11 19h10",key:"11t30w"}],["path",{d:"M4 4h1v5",key:"10yrso"}],["path",{d:"M4 9h2",key:"r1h2o0"}],["path",{d:"M6.5 20H3.4c0-1 2.6-1.925 2.6-3.5a1.5 1.5 0 0 0-2.6-1.02",key:"xtkcd5"}]]);const Sc=ie("list",[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]]);const go=ie("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);const Cc=ie("message-square-quote",[["path",{d:"M14 14a2 2 0 0 0 2-2V8h-2",key:"1r06pg"}],["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}],["path",{d:"M8 14a2 2 0 0 0 2-2V8H8",key:"1jzu5j"}]]);const Ec=ie("redo",[["path",{d:"M21 7v6h-6",key:"3ptur4"}],["path",{d:"M3 17a9 9 0 0 1 9-9 9 9 0 0 1 6 2.3l3 2.7",key:"1kgawr"}]]);const Nc=ie("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]);const kc=ie("strikethrough",[["path",{d:"M16 4H9a3 3 0 0 0-2.83 4",key:"43sutm"}],["path",{d:"M14 12a4 4 0 0 1 0 8H6",key:"nlfj13"}],["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}]]);const Ac=ie("underline",[["path",{d:"M6 4v6a6 6 0 0 0 12 0V4",key:"9kb039"}],["line",{x1:"4",x2:"20",y1:"20",y2:"20",key:"nun2al"}]]);const Tc=ie("undo",[["path",{d:"M3 7v6h6",key:"1v2h90"}],["path",{d:"M21 17a9 9 0 0 0-9-9 9 9 0 0 0-6 2.3L3 13",key:"1r6uu6"}]]);const Jn=ie("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function Pc({field:e,formValues:t,handleChange:n,handleBlur:r,error:o,disabled:s,apiClient:a,...i}){const l=s,u=e.selectMode!=="multiple",d=e.returnValueOnly===!0,[h,g]=R.useState([]),[p,b]=R.useState(!1),[m,v]=R.useState(!1),[S,k]=R.useState(""),[E,w]=R.useState(-1),[x,A]=R.useState({}),O=R.useRef(null),T=R.useRef(null),$=R.useRef(null),z=t[e.name],Y=R.useCallback(()=>z?(Array.isArray(z)?z:[z]).map(M=>{if(M&&typeof M=="object"&&M.value!==void 0)return{value:M.value,label:M.label||M.value};const I=h.find(j=>j.value===M);return I||(x[M]?x[M]:{value:M,label:M})}):[],[z,h,x])(),D=R.useCallback(async(N="")=>{if(e.onSearch){const M=await e.onSearch(N,t);g((M||[]).map(I=>({value:I[e.valueId||"value"]??I.value??I.id,label:I[e.labelId||"label"]??I.label??I.name,description:I.description})));return}if(!e.optionsUrl||!a){const M=(e.options||[]).map(I=>({value:I[e.valueId||"value"]||I.value||I.id,label:I[e.labelId||"label"]||I.label||I.name,description:I.description}));g(N?M.filter(I=>String(I.label).toLowerCase().includes(N.toLowerCase())):M);return}b(!0);try{const M=e.searchParam||"search",I=e.optionsUrl.includes("?")?"&":"?",j=`${e.optionsUrl}${I}${M}=${encodeURIComponent(N)}`,se=await a(j),Z=se.data||se,ge=Array.isArray(Z)?Z:[];g(ge.map(q=>({value:q[e.valueId||"value"]||q.value||q.id,label:q[e.labelId||"label"]||q.label||q.name,description:q.description})))}catch{g([])}finally{b(!1)}},[e,a,t]),C=R.useCallback(N=>{if(!N)return;A(j=>({...j,[N.value]:N}));const M=d?N.value:{value:N.value,label:N.label};let I;if(u)I=[M],v(!1);else{const j=Array.isArray(z)?z:[];I=j.some(Z=>(Z?.value??Z)===N.value)?j.filter(Z=>(Z?.value??Z)!==N.value):[...j,M]}n(e.name,I),r(e.name),e.clearSearchOnSelect&&k("")},[z,e.clearSearchOnSelect,e.name,n,r,u,d]),P=N=>{if(!l)switch(N.key){case"ArrowDown":N.preventDefault(),m?w(M=>M<h.length-1?M+1:M):v(!0);break;case"ArrowUp":N.preventDefault(),m&&w(M=>M>0?M-1:0);break;case"Enter":N.preventDefault(),m&&E>=0&&h[E]?C(h[E]):m||v(!0);break;case"Escape":v(!1);break;case"Tab":v(!1),r(e.name);break}},_=N=>{const M=N.target.value;k(M),w(-1),$.current&&clearTimeout($.current),$.current=setTimeout(()=>D(M),300)};R.useEffect(()=>{if(m){D(S);const N=setTimeout(()=>T.current?.focus(),50);return()=>clearTimeout(N)}else w(-1)},[m,D,S]),R.useEffect(()=>{if(!m)return;const N=M=>{O.current&&!O.current.contains(M.target)&&(v(!1),r(e.name))};return document.addEventListener("mousedown",N),()=>document.removeEventListener("mousedown",N)},[m,e.name,r]);const F=(N,M)=>{N.stopPropagation();const I=Array.isArray(z)?z:[],j=u?[]:I.filter(se=>(se?.value??se)!==M);n(e.name,j),r(e.name)};return c.jsxs("div",{className:`mb-4 relative ${e.fieldClass||"col-span-full"}`,ref:O,children:[c.jsxs("div",{role:"combobox","aria-expanded":m,"aria-haspopup":"listbox","aria-controls":`${e.name}-listbox`,tabIndex:l?-1:0,onClick:()=>!l&&v(!m),onKeyDown:P,className:`
10
10
  w-full min-h-10 px-2 py-1 border rounded-lg bg-background cursor-pointer
11
11
  flex items-center flex-wrap gap-2 transition-all outline-none
12
12
  ${o?"border-destructive ring-1 ring-destructive":"border-input hover:border-accent-foreground/20"}
13
13
  ${m?"ring-2 ring-ring border-primary":"focus-visible:ring-2 focus-visible:ring-ring"}
14
14
  ${l?"bg-muted opacity-60 cursor-not-allowed":""}
15
- `,children:[G.length>0?G.map(T=>c.jsxs("span",{className:"inline-flex items-center px-2 py-0.5 bg-primary/10 text-primary text-xs rounded-sm border border-primary/20",children:[T.label,!l&&c.jsx("button",{type:"button","aria-label":`Remove ${T.label}`,onClick:F=>I(F,T.value),className:"ml-1 p-0.5 hover:bg-primary/20 rounded-full transition-colors",children:c.jsx(Jn,{className:"w-3 h-3"})})]},T.value)):c.jsx("span",{className:"text-muted-foreground text-sm leading-tight",children:e.placeholder||"Select..."}),c.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[p&&c.jsx(go,{className:"w-4 h-4 animate-spin text-muted-foreground"}),c.jsx(on,{className:`w-4 h-4 text-muted-foreground transition-transform ${m?"rotate-180":""}`})]})]}),m&&!l&&c.jsxs("div",{className:"absolute z-50 w-full mt-1 bg-popover border border-border rounded-lg shadow-xl overflow-hidden",children:[c.jsx("div",{className:"p-2 border-b border-border bg-muted/30",children:c.jsxs("div",{className:"relative flex items-center",children:[c.jsx(Nc,{className:"absolute left-3 w-4 h-4 text-muted-foreground"}),c.jsx("input",{ref:P,type:"search","aria-autocomplete":"list","aria-controls":`${e.name}-listbox`,"aria-activedescendant":E>=0?`${e.name}-opt-${E}`:void 0,value:C,onChange:O,onKeyDown:D,className:"w-full h-9 pl-9 pr-3 text-sm bg-transparent border border-input rounded-md focus:outline-none focus:ring-1 focus:ring-ring",placeholder:"Type to search..."})]})}),c.jsx("div",{id:`${e.name}-listbox`,role:"listbox","aria-label":e.label,className:"max-h-60 overflow-y-auto p-1",children:h.length>0?h.map((T,F)=>{const M=G.some(de=>de.value===T.value),q=F===E;return c.jsxs("div",{id:`${e.name}-opt-${F}`,role:"option",tabIndex:-1,"aria-selected":M,onClick:()=>k(T),onKeyDown:de=>de.key==="Enter"&&k(T),onMouseEnter:()=>x(F),className:`
15
+ `,children:[Y.length>0?Y.map(N=>c.jsxs("span",{className:"inline-flex items-center px-2 py-0.5 bg-primary/10 text-primary text-xs rounded-sm border border-primary/20",children:[N.label,!l&&c.jsx("button",{type:"button","aria-label":`Remove ${N.label}`,onClick:M=>F(M,N.value),className:"ml-1 p-0.5 hover:bg-primary/20 rounded-full transition-colors",children:c.jsx(Jn,{className:"w-3 h-3"})})]},N.value)):c.jsx("span",{className:"text-muted-foreground text-sm leading-tight",children:e.placeholder||"Select..."}),c.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[p&&c.jsx(go,{className:"w-4 h-4 animate-spin text-muted-foreground"}),c.jsx(on,{className:`w-4 h-4 text-muted-foreground transition-transform ${m?"rotate-180":""}`})]})]}),m&&!l&&c.jsxs("div",{className:"absolute z-50 w-full mt-1 bg-popover border border-border rounded-lg shadow-xl overflow-hidden",children:[c.jsx("div",{className:"p-2 border-b border-border bg-muted/30",children:c.jsxs("div",{className:"relative flex items-center",children:[c.jsx(Nc,{className:"absolute left-3 w-4 h-4 text-muted-foreground"}),c.jsx("input",{ref:T,type:"search","aria-autocomplete":"list","aria-controls":`${e.name}-listbox`,"aria-activedescendant":E>=0?`${e.name}-opt-${E}`:void 0,value:S,onChange:_,onKeyDown:P,className:"w-full h-9 pl-9 pr-3 text-sm bg-transparent border border-input rounded-md focus:outline-none focus:ring-1 focus:ring-ring",placeholder:"Type to search..."})]})}),c.jsx("div",{id:`${e.name}-listbox`,role:"listbox","aria-label":e.label,className:"max-h-60 overflow-y-auto p-1",children:h.length>0?h.map((N,M)=>{const I=Y.some(se=>se.value===N.value),j=M===E;return c.jsxs("div",{id:`${e.name}-opt-${M}`,role:"option",tabIndex:-1,"aria-selected":I,onClick:()=>C(N),onKeyDown:se=>se.key==="Enter"&&C(N),onMouseEnter:()=>w(M),className:`
16
16
  px-3 py-2 text-sm rounded-md cursor-pointer flex items-center justify-between transition-colors outline-none
17
- ${q?"bg-accent text-accent-foreground":""}
18
- ${M?"text-primary font-medium":"text-foreground"}
19
- ${!q&&!M?"hover:bg-muted":""}
20
- `,children:[c.jsxs("div",{className:"flex flex-col min-w-0",children:[c.jsx("span",{className:"truncate",children:T.label}),T.description&&c.jsx("span",{className:"text-xs text-muted-foreground truncate",children:T.description})]}),M&&c.jsx(cc,{className:"w-4 h-4 text-primary shrink-0 ml-2"})]},T.value)}):c.jsx("output",{className:"block py-8 text-center text-sm text-muted-foreground",children:p?"Searching...":"No results found"})})]})]})}function bo(e,[t,n]){return Math.min(n,Math.max(t,e))}function J(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e?.(o),n===!1||!o.defaultPrevented)return t?.(o)}}function ct(e,t=[]){let n=[];function r(s,a){const i=f.createContext(a),l=n.length;n=[...n,a];const d=h=>{const{scope:g,children:p,...b}=h,m=g?.[e]?.[l]||i,v=f.useMemo(()=>b,Object.values(b));return c.jsx(m.Provider,{value:v,children:p})};d.displayName=s+"Provider";function u(h,g){const p=g?.[e]?.[l]||i,b=f.useContext(p);if(b)return b;if(a!==void 0)return a;throw new Error(`\`${h}\` must be used within \`${s}\``)}return[d,u]}const o=()=>{const s=n.map(a=>f.createContext(a));return function(i){const l=i?.[e]||s;return f.useMemo(()=>({[`__scope${e}`]:{...i,[e]:l}}),[i,l])}};return o.scopeName=e,[r,_c(o,...t)]}function _c(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const a=r.reduce((i,{useScope:l,scopeName:d})=>{const h=l(s)[`__scope${d}`];return{...i,...h}},{});return f.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}function yo(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function er(...e){return t=>{let n=!1;const r=e.map(o=>{const s=yo(o,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o<r.length;o++){const s=r[o];typeof s=="function"?s():yo(e[o],null)}}}}function ie(...e){return f.useCallback(er(...e),e)}function Ce(e){const t=Oc(e),n=f.forwardRef((r,o)=>{const{children:s,...a}=r,i=f.Children.toArray(s),l=i.find(Dc);if(l){const d=l.props.children,u=i.map(h=>h===l?f.Children.count(d)>1?f.Children.only(null):f.isValidElement(d)?d.props.children:null:h);return c.jsx(t,{...a,ref:o,children:f.isValidElement(d)?f.cloneElement(d,void 0,u):null})}return c.jsx(t,{...a,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}function Oc(e){const t=f.forwardRef((n,r)=>{const{children:o,...s}=n;if(f.isValidElement(o)){const a=Lc(o),i=Ic(s,o.props);return o.type!==f.Fragment&&(i.ref=r?er(r,a):a),f.cloneElement(o,i)}return f.Children.count(o)>1?f.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Mc=Symbol("radix.slottable");function Dc(e){return f.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Mc}function Ic(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...i)=>{const l=s(...i);return o(...i),l}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function Lc(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function vo(e){const t=e+"CollectionProvider",[n,r]=ct(t),[o,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),a=m=>{const{scope:v,children:C}=m,N=R.useRef(null),E=R.useRef(new Map).current;return c.jsx(o,{scope:v,itemMap:E,collectionRef:N,children:C})};a.displayName=t;const i=e+"CollectionSlot",l=Ce(i),d=R.forwardRef((m,v)=>{const{scope:C,children:N}=m,E=s(i,C),x=ie(v,E.collectionRef);return c.jsx(l,{ref:x,children:N})});d.displayName=i;const u=e+"CollectionItemSlot",h="data-radix-collection-item",g=Ce(u),p=R.forwardRef((m,v)=>{const{scope:C,children:N,...E}=m,x=R.useRef(null),S=ie(v,x),A=s(u,C);return R.useEffect(()=>(A.itemMap.set(x,{ref:x,...E}),()=>{A.itemMap.delete(x)})),c.jsx(g,{[h]:"",ref:S,children:N})});p.displayName=u;function b(m){const v=s(e+"CollectionConsumer",m);return R.useCallback(()=>{const N=v.collectionRef.current;if(!N)return[];const E=Array.from(N.querySelectorAll(`[${h}]`));return Array.from(v.itemMap.values()).sort((A,_)=>E.indexOf(A.ref.current)-E.indexOf(_.ref.current))},[v.collectionRef,v.itemMap])}return[{Provider:a,Slot:d,ItemSlot:p},b,r]}var Fc=f.createContext(void 0);function tr(e){const t=f.useContext(Fc);return e||t||"ltr"}var $c=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],wo=$c.reduce((e,t)=>{const n=Ce(`Primitive.${t}`),r=f.forwardRef((o,s)=>{const{asChild:a,...i}=o,l=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(l,{...i,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function zc(e,t){e&&rn.flushSync(()=>e.dispatchEvent(t))}function Ke(e){const t=f.useRef(e);return f.useEffect(()=>{t.current=e}),f.useMemo(()=>(...n)=>t.current?.(...n),[])}function Rc(e,t=globalThis?.document){const n=Ke(e);f.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var Wc="DismissableLayer",nr="dismissableLayer.update",Bc="dismissableLayer.pointerDownOutside",Hc="dismissableLayer.focusOutside",xo,So=f.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),rr=f.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:a,onDismiss:i,...l}=e,d=f.useContext(So),[u,h]=f.useState(null),g=u?.ownerDocument??globalThis?.document,[,p]=f.useState({}),b=ie(t,_=>h(_)),m=Array.from(d.layers),[v]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),C=m.indexOf(v),N=u?m.indexOf(u):-1,E=d.layersWithOutsidePointerEventsDisabled.size>0,x=N>=C,S=jc(_=>{const P=_.target,$=[...d.branches].some(z=>z.contains(P));!x||$||(o?.(_),a?.(_),_.defaultPrevented||i?.())},g),A=Gc(_=>{const P=_.target;[...d.branches].some(z=>z.contains(P))||(s?.(_),a?.(_),_.defaultPrevented||i?.())},g);return Rc(_=>{N===d.layers.size-1&&(r?.(_),!_.defaultPrevented&&i&&(_.preventDefault(),i()))},g),f.useEffect(()=>{if(u)return n&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(xo=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(u)),d.layers.add(u),Co(),()=>{n&&d.layersWithOutsidePointerEventsDisabled.size===1&&(g.body.style.pointerEvents=xo)}},[u,g,n,d]),f.useEffect(()=>()=>{u&&(d.layers.delete(u),d.layersWithOutsidePointerEventsDisabled.delete(u),Co())},[u,d]),f.useEffect(()=>{const _=()=>p({});return document.addEventListener(nr,_),()=>document.removeEventListener(nr,_)},[]),c.jsx(wo.div,{...l,ref:b,style:{pointerEvents:E?x?"auto":"none":void 0,...e.style},onFocusCapture:J(e.onFocusCapture,A.onFocusCapture),onBlurCapture:J(e.onBlurCapture,A.onBlurCapture),onPointerDownCapture:J(e.onPointerDownCapture,S.onPointerDownCapture)})});rr.displayName=Wc;var Uc="DismissableLayerBranch",Vc=f.forwardRef((e,t)=>{const n=f.useContext(So),r=f.useRef(null),o=ie(t,r);return f.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),c.jsx(wo.div,{...e,ref:o})});Vc.displayName=Uc;function jc(e,t=globalThis?.document){const n=Ke(e),r=f.useRef(!1),o=f.useRef(()=>{});return f.useEffect(()=>{const s=i=>{if(i.target&&!r.current){let l=function(){Eo(Bc,n,d,{discrete:!0})};const d={originalEvent:i};i.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=l,t.addEventListener("click",o.current,{once:!0})):l()}else t.removeEventListener("click",o.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",s),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function Gc(e,t=globalThis?.document){const n=Ke(e),r=f.useRef(!1);return f.useEffect(()=>{const o=s=>{s.target&&!r.current&&Eo(Hc,n,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Co(){const e=new CustomEvent(nr);document.dispatchEvent(e)}function Eo(e,t,n,{discrete:r}){const o=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?zc(o,s):o.dispatchEvent(s)}var or=0;function No(){f.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??ko()),document.body.insertAdjacentElement("beforeend",e[1]??ko()),or++,()=>{or===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),or--}},[])}function ko(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Yc=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],qc=Yc.reduce((e,t)=>{const n=Ce(`Primitive.${t}`),r=f.forwardRef((o,s)=>{const{asChild:a,...i}=o,l=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(l,{...i,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),sr="focusScope.autoFocusOnMount",ar="focusScope.autoFocusOnUnmount",Ao={bubbles:!1,cancelable:!0},Kc="FocusScope",ir=f.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:s,...a}=e,[i,l]=f.useState(null),d=Ke(o),u=Ke(s),h=f.useRef(null),g=ie(t,m=>l(m)),p=f.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;f.useEffect(()=>{if(r){let m=function(E){if(p.paused||!i)return;const x=E.target;i.contains(x)?h.current=x:Xe(h.current,{select:!0})},v=function(E){if(p.paused||!i)return;const x=E.relatedTarget;x!==null&&(i.contains(x)||Xe(h.current,{select:!0}))},C=function(E){if(document.activeElement===document.body)for(const S of E)S.removedNodes.length>0&&Xe(i)};document.addEventListener("focusin",m),document.addEventListener("focusout",v);const N=new MutationObserver(C);return i&&N.observe(i,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",m),document.removeEventListener("focusout",v),N.disconnect()}}},[r,i,p.paused]),f.useEffect(()=>{if(i){_o.add(p);const m=document.activeElement;if(!i.contains(m)){const C=new CustomEvent(sr,Ao);i.addEventListener(sr,d),i.dispatchEvent(C),C.defaultPrevented||(Xc(tl(To(i)),{select:!0}),document.activeElement===m&&Xe(i))}return()=>{i.removeEventListener(sr,d),setTimeout(()=>{const C=new CustomEvent(ar,Ao);i.addEventListener(ar,u),i.dispatchEvent(C),C.defaultPrevented||Xe(m??document.body,{select:!0}),i.removeEventListener(ar,u),_o.remove(p)},0)}}},[i,d,u,p]);const b=f.useCallback(m=>{if(!n&&!r||p.paused)return;const v=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,C=document.activeElement;if(v&&C){const N=m.currentTarget,[E,x]=Qc(N);E&&x?!m.shiftKey&&C===x?(m.preventDefault(),n&&Xe(E,{select:!0})):m.shiftKey&&C===E&&(m.preventDefault(),n&&Xe(x,{select:!0})):C===N&&m.preventDefault()}},[n,r,p.paused]);return c.jsx(qc.div,{tabIndex:-1,...a,ref:g,onKeyDown:b})});ir.displayName=Kc;function Xc(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Xe(r,{select:t}),document.activeElement!==n)return}function Qc(e){const t=To(e),n=Po(t,e),r=Po(t.reverse(),e);return[n,r]}function To(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Po(e,t){for(const n of e)if(!Zc(n,{upTo:t}))return n}function Zc(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function Jc(e){return e instanceof HTMLInputElement&&"select"in e}function Xe(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Jc(e)&&t&&e.select()}}var _o=el();function el(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=Oo(e,t),e.unshift(t)},remove(t){e=Oo(e,t),e[0]?.resume()}}}function Oo(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function tl(e){return e.filter(t=>t.tagName!=="A")}var ye=globalThis?.document?f.useLayoutEffect:()=>{},nl=f[" useId ".trim().toString()]||(()=>{}),rl=0;function Ft(e){const[t,n]=f.useState(nl());return ye(()=>{n(r=>r??String(rl++))},[e]),e||(t?`radix-${t}`:"")}const ol=["top","right","bottom","left"],Qe=Math.min,Ne=Math.max,sn=Math.round,an=Math.floor,$e=e=>({x:e,y:e}),sl={left:"right",right:"left",bottom:"top",top:"bottom"};function cr(e,t,n){return Ne(e,Qe(t,n))}function Ve(e,t){return typeof e=="function"?e(t):e}function je(e){return e.split("-")[0]}function wt(e){return e.split("-")[1]}function lr(e){return e==="x"?"y":"x"}function dr(e){return e==="y"?"height":"width"}function ze(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function ur(e){return lr(ze(e))}function al(e,t,n){n===void 0&&(n=!1);const r=wt(e),o=ur(e),s=dr(o);let a=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(a=cn(a)),[a,cn(a)]}function il(e){const t=cn(e);return[fr(e),t,fr(t)]}function fr(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const Mo=["left","right"],Do=["right","left"],cl=["top","bottom"],ll=["bottom","top"];function dl(e,t,n){switch(e){case"top":case"bottom":return n?t?Do:Mo:t?Mo:Do;case"left":case"right":return t?cl:ll;default:return[]}}function ul(e,t,n,r){const o=wt(e);let s=dl(je(e),n==="start",r);return o&&(s=s.map(a=>a+"-"+o),t&&(s=s.concat(s.map(fr)))),s}function cn(e){const t=je(e);return sl[t]+e.slice(t.length)}function fl(e){return{top:0,right:0,bottom:0,left:0,...e}}function Io(e){return typeof e!="number"?fl(e):{top:e,right:e,bottom:e,left:e}}function ln(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function Lo(e,t,n){let{reference:r,floating:o}=e;const s=ze(t),a=ur(t),i=dr(a),l=je(t),d=s==="y",u=r.x+r.width/2-o.width/2,h=r.y+r.height/2-o.height/2,g=r[i]/2-o[i]/2;let p;switch(l){case"top":p={x:u,y:r.y-o.height};break;case"bottom":p={x:u,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:h};break;case"left":p={x:r.x-o.width,y:h};break;default:p={x:r.x,y:r.y}}switch(wt(t)){case"start":p[a]-=g*(n&&d?-1:1);break;case"end":p[a]+=g*(n&&d?-1:1);break}return p}async function pl(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:s,rects:a,elements:i,strategy:l}=e,{boundary:d="clippingAncestors",rootBoundary:u="viewport",elementContext:h="floating",altBoundary:g=!1,padding:p=0}=Ve(t,e),b=Io(p),v=i[g?h==="floating"?"reference":"floating":h],C=ln(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(v)))==null||n?v:v.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(i.floating)),boundary:d,rootBoundary:u,strategy:l})),N=h==="floating"?{x:r,y:o,width:a.floating.width,height:a.floating.height}:a.reference,E=await(s.getOffsetParent==null?void 0:s.getOffsetParent(i.floating)),x=await(s.isElement==null?void 0:s.isElement(E))?await(s.getScale==null?void 0:s.getScale(E))||{x:1,y:1}:{x:1,y:1},S=ln(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:i,rect:N,offsetParent:E,strategy:l}):N);return{top:(C.top-S.top+b.top)/x.y,bottom:(S.bottom-C.bottom+b.bottom)/x.y,left:(C.left-S.left+b.left)/x.x,right:(S.right-C.right+b.right)/x.x}}const ml=50,hl=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:a}=n,i=a.detectOverflow?a:{...a,detectOverflow:pl},l=await(a.isRTL==null?void 0:a.isRTL(t));let d=await a.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:h}=Lo(d,r,l),g=r,p=0;const b={};for(let m=0;m<s.length;m++){const v=s[m];if(!v)continue;const{name:C,fn:N}=v,{x:E,y:x,data:S,reset:A}=await N({x:u,y:h,initialPlacement:r,placement:g,strategy:o,middlewareData:b,rects:d,platform:i,elements:{reference:e,floating:t}});u=E??u,h=x??h,b[C]={...b[C],...S},A&&p<ml&&(p++,typeof A=="object"&&(A.placement&&(g=A.placement),A.rects&&(d=A.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:o}):A.rects),{x:u,y:h}=Lo(d,g,l)),m=-1)}return{x:u,y:h,placement:g,strategy:o,middlewareData:b}},gl=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:s,platform:a,elements:i,middlewareData:l}=t,{element:d,padding:u=0}=Ve(e,t)||{};if(d==null)return{};const h=Io(u),g={x:n,y:r},p=ur(o),b=dr(p),m=await a.getDimensions(d),v=p==="y",C=v?"top":"left",N=v?"bottom":"right",E=v?"clientHeight":"clientWidth",x=s.reference[b]+s.reference[p]-g[p]-s.floating[b],S=g[p]-s.reference[p],A=await(a.getOffsetParent==null?void 0:a.getOffsetParent(d));let _=A?A[E]:0;(!_||!await(a.isElement==null?void 0:a.isElement(A)))&&(_=i.floating[E]||s.floating[b]);const P=x/2-S/2,$=_/2-m[b]/2-1,z=Qe(h[C],$),H=Qe(h[N],$),G=z,w=_-m[b]-H,k=_/2-m[b]/2+P,D=cr(G,k,w),O=!l.arrow&&wt(o)!=null&&k!==D&&s.reference[b]/2-(k<G?z:H)-m[b]/2<0,I=O?k<G?k-G:k-w:0;return{[p]:g[p]+I,data:{[p]:D,centerOffset:k-D-I,...O&&{alignmentOffset:I}},reset:O}}}),bl=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:s,rects:a,initialPlacement:i,platform:l,elements:d}=t,{mainAxis:u=!0,crossAxis:h=!0,fallbackPlacements:g,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:b="none",flipAlignment:m=!0,...v}=Ve(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const C=je(o),N=ze(i),E=je(i)===i,x=await(l.isRTL==null?void 0:l.isRTL(d.floating)),S=g||(E||!m?[cn(i)]:il(i)),A=b!=="none";!g&&A&&S.push(...ul(i,m,b,x));const _=[i,...S],P=await l.detectOverflow(t,v),$=[];let z=((r=s.flip)==null?void 0:r.overflows)||[];if(u&&$.push(P[C]),h){const k=al(o,a,x);$.push(P[k[0]],P[k[1]])}if(z=[...z,{placement:o,overflows:$}],!$.every(k=>k<=0)){var H,G;const k=(((H=s.flip)==null?void 0:H.index)||0)+1,D=_[k];if(D&&(!(h==="alignment"?N!==ze(D):!1)||z.every(T=>ze(T.placement)===N?T.overflows[0]>0:!0)))return{data:{index:k,overflows:z},reset:{placement:D}};let O=(G=z.filter(I=>I.overflows[0]<=0).sort((I,T)=>I.overflows[1]-T.overflows[1])[0])==null?void 0:G.placement;if(!O)switch(p){case"bestFit":{var w;const I=(w=z.filter(T=>{if(A){const F=ze(T.placement);return F===N||F==="y"}return!0}).map(T=>[T.placement,T.overflows.filter(F=>F>0).reduce((F,M)=>F+M,0)]).sort((T,F)=>T[1]-F[1])[0])==null?void 0:w[0];I&&(O=I);break}case"initialPlacement":O=i;break}if(o!==O)return{reset:{placement:O}}}return{}}}};function Fo(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function $o(e){return ol.some(t=>e[t]>=0)}const yl=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:o="referenceHidden",...s}=Ve(e,t);switch(o){case"referenceHidden":{const a=await r.detectOverflow(t,{...s,elementContext:"reference"}),i=Fo(a,n.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:$o(i)}}}case"escaped":{const a=await r.detectOverflow(t,{...s,altBoundary:!0}),i=Fo(a,n.floating);return{data:{escapedOffsets:i,escaped:$o(i)}}}default:return{}}}}},zo=new Set(["left","top"]);async function vl(e,t){const{placement:n,platform:r,elements:o}=e,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),a=je(n),i=wt(n),l=ze(n)==="y",d=zo.has(a)?-1:1,u=s&&l?-1:1,h=Ve(t,e);let{mainAxis:g,crossAxis:p,alignmentAxis:b}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return i&&typeof b=="number"&&(p=i==="end"?b*-1:b),l?{x:p*u,y:g*d}:{x:g*d,y:p*u}}const wl=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:s,placement:a,middlewareData:i}=t,l=await vl(t,e);return a===((n=i.offset)==null?void 0:n.placement)&&(r=i.arrow)!=null&&r.alignmentOffset?{}:{x:o+l.x,y:s+l.y,data:{...l,placement:a}}}}},xl=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o,platform:s}=t,{mainAxis:a=!0,crossAxis:i=!1,limiter:l={fn:C=>{let{x:N,y:E}=C;return{x:N,y:E}}},...d}=Ve(e,t),u={x:n,y:r},h=await s.detectOverflow(t,d),g=ze(je(o)),p=lr(g);let b=u[p],m=u[g];if(a){const C=p==="y"?"top":"left",N=p==="y"?"bottom":"right",E=b+h[C],x=b-h[N];b=cr(E,b,x)}if(i){const C=g==="y"?"top":"left",N=g==="y"?"bottom":"right",E=m+h[C],x=m-h[N];m=cr(E,m,x)}const v=l.fn({...t,[p]:b,[g]:m});return{...v,data:{x:v.x-n,y:v.y-r,enabled:{[p]:a,[g]:i}}}}}},Sl=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:s,middlewareData:a}=t,{offset:i=0,mainAxis:l=!0,crossAxis:d=!0}=Ve(e,t),u={x:n,y:r},h=ze(o),g=lr(h);let p=u[g],b=u[h];const m=Ve(i,t),v=typeof m=="number"?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(l){const E=g==="y"?"height":"width",x=s.reference[g]-s.floating[E]+v.mainAxis,S=s.reference[g]+s.reference[E]-v.mainAxis;p<x?p=x:p>S&&(p=S)}if(d){var C,N;const E=g==="y"?"width":"height",x=zo.has(je(o)),S=s.reference[h]-s.floating[E]+(x&&((C=a.offset)==null?void 0:C[h])||0)+(x?0:v.crossAxis),A=s.reference[h]+s.reference[E]+(x?0:((N=a.offset)==null?void 0:N[h])||0)-(x?v.crossAxis:0);b<S?b=S:b>A&&(b=A)}return{[g]:p,[h]:b}}}},Cl=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:s,platform:a,elements:i}=t,{apply:l=()=>{},...d}=Ve(e,t),u=await a.detectOverflow(t,d),h=je(o),g=wt(o),p=ze(o)==="y",{width:b,height:m}=s.floating;let v,C;h==="top"||h==="bottom"?(v=h,C=g===(await(a.isRTL==null?void 0:a.isRTL(i.floating))?"start":"end")?"left":"right"):(C=h,v=g==="end"?"top":"bottom");const N=m-u.top-u.bottom,E=b-u.left-u.right,x=Qe(m-u[v],N),S=Qe(b-u[C],E),A=!t.middlewareData.shift;let _=x,P=S;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(P=E),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(_=N),A&&!g){const z=Ne(u.left,0),H=Ne(u.right,0),G=Ne(u.top,0),w=Ne(u.bottom,0);p?P=b-2*(z!==0||H!==0?z+H:Ne(u.left,u.right)):_=m-2*(G!==0||w!==0?G+w:Ne(u.top,u.bottom))}await l({...t,availableWidth:P,availableHeight:_});const $=await a.getDimensions(i.floating);return b!==$.width||m!==$.height?{reset:{rects:!0}}:{}}}};function dn(){return typeof window<"u"}function xt(e){return Ro(e)?(e.nodeName||"").toLowerCase():"#document"}function ke(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Re(e){var t;return(t=(Ro(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Ro(e){return dn()?e instanceof Node||e instanceof ke(e).Node:!1}function _e(e){return dn()?e instanceof Element||e instanceof ke(e).Element:!1}function Ge(e){return dn()?e instanceof HTMLElement||e instanceof ke(e).HTMLElement:!1}function Wo(e){return!dn()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ke(e).ShadowRoot}function $t(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Oe(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&o!=="inline"&&o!=="contents"}function El(e){return/^(table|td|th)$/.test(xt(e))}function un(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const Nl=/transform|translate|scale|rotate|perspective|filter/,kl=/paint|layout|strict|content/,lt=e=>!!e&&e!=="none";let pr;function mr(e){const t=_e(e)?Oe(e):e;return lt(t.transform)||lt(t.translate)||lt(t.scale)||lt(t.rotate)||lt(t.perspective)||!hr()&&(lt(t.backdropFilter)||lt(t.filter))||Nl.test(t.willChange||"")||kl.test(t.contain||"")}function Al(e){let t=Ze(e);for(;Ge(t)&&!St(t);){if(mr(t))return t;if(un(t))return null;t=Ze(t)}return null}function hr(){return pr==null&&(pr=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),pr}function St(e){return/^(html|body|#document)$/.test(xt(e))}function Oe(e){return ke(e).getComputedStyle(e)}function fn(e){return _e(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ze(e){if(xt(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Wo(e)&&e.host||Re(e);return Wo(t)?t.host:t}function Bo(e){const t=Ze(e);return St(t)?e.ownerDocument?e.ownerDocument.body:e.body:Ge(t)&&$t(t)?t:Bo(t)}function zt(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=Bo(e),s=o===((r=e.ownerDocument)==null?void 0:r.body),a=ke(o);if(s){const i=gr(a);return t.concat(a,a.visualViewport||[],$t(o)?o:[],i&&n?zt(i):[])}else return t.concat(o,zt(o,[],n))}function gr(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Ho(e){const t=Oe(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Ge(e),s=o?e.offsetWidth:n,a=o?e.offsetHeight:r,i=sn(n)!==s||sn(r)!==a;return i&&(n=s,r=a),{width:n,height:r,$:i}}function br(e){return _e(e)?e:e.contextElement}function Ct(e){const t=br(e);if(!Ge(t))return $e(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=Ho(t);let a=(s?sn(n.width):n.width)/r,i=(s?sn(n.height):n.height)/o;return(!a||!Number.isFinite(a))&&(a=1),(!i||!Number.isFinite(i))&&(i=1),{x:a,y:i}}const Tl=$e(0);function Uo(e){const t=ke(e);return!hr()||!t.visualViewport?Tl:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Pl(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==ke(e)?!1:t}function dt(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=br(e);let a=$e(1);t&&(r?_e(r)&&(a=Ct(r)):a=Ct(e));const i=Pl(s,n,r)?Uo(s):$e(0);let l=(o.left+i.x)/a.x,d=(o.top+i.y)/a.y,u=o.width/a.x,h=o.height/a.y;if(s){const g=ke(s),p=r&&_e(r)?ke(r):r;let b=g,m=gr(b);for(;m&&r&&p!==b;){const v=Ct(m),C=m.getBoundingClientRect(),N=Oe(m),E=C.left+(m.clientLeft+parseFloat(N.paddingLeft))*v.x,x=C.top+(m.clientTop+parseFloat(N.paddingTop))*v.y;l*=v.x,d*=v.y,u*=v.x,h*=v.y,l+=E,d+=x,b=ke(m),m=gr(b)}}return ln({width:u,height:h,x:l,y:d})}function pn(e,t){const n=fn(e).scrollLeft;return t?t.left+n:dt(Re(e)).left+n}function Vo(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-pn(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function _l(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const s=o==="fixed",a=Re(r),i=t?un(t.floating):!1;if(r===a||i&&s)return n;let l={scrollLeft:0,scrollTop:0},d=$e(1);const u=$e(0),h=Ge(r);if((h||!h&&!s)&&((xt(r)!=="body"||$t(a))&&(l=fn(r)),h)){const p=dt(r);d=Ct(r),u.x=p.x+r.clientLeft,u.y=p.y+r.clientTop}const g=a&&!h&&!s?Vo(a,l):$e(0);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-l.scrollLeft*d.x+u.x+g.x,y:n.y*d.y-l.scrollTop*d.y+u.y+g.y}}function Ol(e){return Array.from(e.getClientRects())}function Ml(e){const t=Re(e),n=fn(e),r=e.ownerDocument.body,o=Ne(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=Ne(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+pn(e);const i=-n.scrollTop;return Oe(r).direction==="rtl"&&(a+=Ne(t.clientWidth,r.clientWidth)-o),{width:o,height:s,x:a,y:i}}const jo=25;function Dl(e,t){const n=ke(e),r=Re(e),o=n.visualViewport;let s=r.clientWidth,a=r.clientHeight,i=0,l=0;if(o){s=o.width,a=o.height;const u=hr();(!u||u&&t==="fixed")&&(i=o.offsetLeft,l=o.offsetTop)}const d=pn(r);if(d<=0){const u=r.ownerDocument,h=u.body,g=getComputedStyle(h),p=u.compatMode==="CSS1Compat"&&parseFloat(g.marginLeft)+parseFloat(g.marginRight)||0,b=Math.abs(r.clientWidth-h.clientWidth-p);b<=jo&&(s-=b)}else d<=jo&&(s+=d);return{width:s,height:a,x:i,y:l}}function Il(e,t){const n=dt(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,s=Ge(e)?Ct(e):$e(1),a=e.clientWidth*s.x,i=e.clientHeight*s.y,l=o*s.x,d=r*s.y;return{width:a,height:i,x:l,y:d}}function Go(e,t,n){let r;if(t==="viewport")r=Dl(e,n);else if(t==="document")r=Ml(Re(e));else if(_e(t))r=Il(t,n);else{const o=Uo(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return ln(r)}function Yo(e,t){const n=Ze(e);return n===t||!_e(n)||St(n)?!1:Oe(n).position==="fixed"||Yo(n,t)}function Ll(e,t){const n=t.get(e);if(n)return n;let r=zt(e,[],!1).filter(i=>_e(i)&&xt(i)!=="body"),o=null;const s=Oe(e).position==="fixed";let a=s?Ze(e):e;for(;_e(a)&&!St(a);){const i=Oe(a),l=mr(a);!l&&i.position==="fixed"&&(o=null),(s?!l&&!o:!l&&i.position==="static"&&!!o&&(o.position==="absolute"||o.position==="fixed")||$t(a)&&!l&&Yo(e,a))?r=r.filter(u=>u!==a):o=i,a=Ze(a)}return t.set(e,r),r}function Fl(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const a=[...n==="clippingAncestors"?un(t)?[]:Ll(t,this._c):[].concat(n),r],i=Go(t,a[0],o);let l=i.top,d=i.right,u=i.bottom,h=i.left;for(let g=1;g<a.length;g++){const p=Go(t,a[g],o);l=Ne(p.top,l),d=Qe(p.right,d),u=Qe(p.bottom,u),h=Ne(p.left,h)}return{width:d-h,height:u-l,x:h,y:l}}function $l(e){const{width:t,height:n}=Ho(e);return{width:t,height:n}}function zl(e,t,n){const r=Ge(t),o=Re(t),s=n==="fixed",a=dt(e,!0,s,t);let i={scrollLeft:0,scrollTop:0};const l=$e(0);function d(){l.x=pn(o)}if(r||!r&&!s)if((xt(t)!=="body"||$t(o))&&(i=fn(t)),r){const p=dt(t,!0,s,t);l.x=p.x+t.clientLeft,l.y=p.y+t.clientTop}else o&&d();s&&!r&&o&&d();const u=o&&!r&&!s?Vo(o,i):$e(0),h=a.left+i.scrollLeft-l.x-u.x,g=a.top+i.scrollTop-l.y-u.y;return{x:h,y:g,width:a.width,height:a.height}}function yr(e){return Oe(e).position==="static"}function qo(e,t){if(!Ge(e)||Oe(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Re(e)===n&&(n=n.ownerDocument.body),n}function Ko(e,t){const n=ke(e);if(un(e))return n;if(!Ge(e)){let o=Ze(e);for(;o&&!St(o);){if(_e(o)&&!yr(o))return o;o=Ze(o)}return n}let r=qo(e,t);for(;r&&El(r)&&yr(r);)r=qo(r,t);return r&&St(r)&&yr(r)&&!mr(r)?n:r||Al(e)||n}const Rl=async function(e){const t=this.getOffsetParent||Ko,n=this.getDimensions,r=await n(e.floating);return{reference:zl(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Wl(e){return Oe(e).direction==="rtl"}const Bl={convertOffsetParentRelativeRectToViewportRelativeRect:_l,getDocumentElement:Re,getClippingRect:Fl,getOffsetParent:Ko,getElementRects:Rl,getClientRects:Ol,getDimensions:$l,getScale:Ct,isElement:_e,isRTL:Wl};function Xo(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Hl(e,t){let n=null,r;const o=Re(e);function s(){var i;clearTimeout(r),(i=n)==null||i.disconnect(),n=null}function a(i,l){i===void 0&&(i=!1),l===void 0&&(l=1),s();const d=e.getBoundingClientRect(),{left:u,top:h,width:g,height:p}=d;if(i||t(),!g||!p)return;const b=an(h),m=an(o.clientWidth-(u+g)),v=an(o.clientHeight-(h+p)),C=an(u),E={rootMargin:-b+"px "+-m+"px "+-v+"px "+-C+"px",threshold:Ne(0,Qe(1,l))||1};let x=!0;function S(A){const _=A[0].intersectionRatio;if(_!==l){if(!x)return a();_?a(!1,_):r=setTimeout(()=>{a(!1,1e-7)},1e3)}_===1&&!Xo(d,e.getBoundingClientRect())&&a(),x=!1}try{n=new IntersectionObserver(S,{...E,root:o.ownerDocument})}catch{n=new IntersectionObserver(S,E)}n.observe(e)}return a(!0),s}function Ul(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:i=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,d=br(e),u=o||s?[...d?zt(d):[],...t?zt(t):[]]:[];u.forEach(C=>{o&&C.addEventListener("scroll",n,{passive:!0}),s&&C.addEventListener("resize",n)});const h=d&&i?Hl(d,n):null;let g=-1,p=null;a&&(p=new ResizeObserver(C=>{let[N]=C;N&&N.target===d&&p&&t&&(p.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var E;(E=p)==null||E.observe(t)})),n()}),d&&!l&&p.observe(d),t&&p.observe(t));let b,m=l?dt(e):null;l&&v();function v(){const C=dt(e);m&&!Xo(m,C)&&n(),m=C,b=requestAnimationFrame(v)}return n(),()=>{var C;u.forEach(N=>{o&&N.removeEventListener("scroll",n),s&&N.removeEventListener("resize",n)}),h?.(),(C=p)==null||C.disconnect(),p=null,l&&cancelAnimationFrame(b)}}const Vl=wl,jl=xl,Gl=bl,Yl=Cl,ql=yl,Qo=gl,Kl=Sl,Xl=(e,t,n)=>{const r=new Map,o={platform:Bl,...n},s={...o.platform,_c:r};return hl(e,t,{...o,platform:s})};var Ql=typeof document<"u",Zl=function(){},mn=Ql?R.useLayoutEffect:Zl;function hn(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!hn(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const s=o[r];if(!(s==="_owner"&&e.$$typeof)&&!hn(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function Zo(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Jo(e,t){const n=Zo(e);return Math.round(t*n)/n}function vr(e){const t=f.useRef(e);return mn(()=>{t.current=e}),t}function Jl(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:s,floating:a}={},transform:i=!0,whileElementsMounted:l,open:d}=e,[u,h]=f.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[g,p]=f.useState(r);hn(g,r)||p(r);const[b,m]=f.useState(null),[v,C]=f.useState(null),N=f.useCallback(T=>{T!==A.current&&(A.current=T,m(T))},[]),E=f.useCallback(T=>{T!==_.current&&(_.current=T,C(T))},[]),x=s||b,S=a||v,A=f.useRef(null),_=f.useRef(null),P=f.useRef(u),$=l!=null,z=vr(l),H=vr(o),G=vr(d),w=f.useCallback(()=>{if(!A.current||!_.current)return;const T={placement:t,strategy:n,middleware:g};H.current&&(T.platform=H.current),Xl(A.current,_.current,T).then(F=>{const M={...F,isPositioned:G.current!==!1};k.current&&!hn(P.current,M)&&(P.current=M,rn.flushSync(()=>{h(M)}))})},[g,t,n,H,G]);mn(()=>{d===!1&&P.current.isPositioned&&(P.current.isPositioned=!1,h(T=>({...T,isPositioned:!1})))},[d]);const k=f.useRef(!1);mn(()=>(k.current=!0,()=>{k.current=!1}),[]),mn(()=>{if(x&&(A.current=x),S&&(_.current=S),x&&S){if(z.current)return z.current(x,S,w);w()}},[x,S,w,z,$]);const D=f.useMemo(()=>({reference:A,floating:_,setReference:N,setFloating:E}),[N,E]),O=f.useMemo(()=>({reference:x,floating:S}),[x,S]),I=f.useMemo(()=>{const T={position:n,left:0,top:0};if(!O.floating)return T;const F=Jo(O.floating,u.x),M=Jo(O.floating,u.y);return i?{...T,transform:"translate("+F+"px, "+M+"px)",...Zo(O.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:F,top:M}},[n,i,O.floating,u.x,u.y]);return f.useMemo(()=>({...u,update:w,refs:D,elements:O,floatingStyles:I}),[u,w,D,O,I])}const ed=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?Qo({element:r.current,padding:o}).fn(n):{}:r?Qo({element:r,padding:o}).fn(n):{}}}},td=(e,t)=>{const n=Vl(e);return{name:n.name,fn:n.fn,options:[e,t]}},nd=(e,t)=>{const n=jl(e);return{name:n.name,fn:n.fn,options:[e,t]}},rd=(e,t)=>({fn:Kl(e).fn,options:[e,t]}),od=(e,t)=>{const n=Gl(e);return{name:n.name,fn:n.fn,options:[e,t]}},sd=(e,t)=>{const n=Yl(e);return{name:n.name,fn:n.fn,options:[e,t]}},ad=(e,t)=>{const n=ql(e);return{name:n.name,fn:n.fn,options:[e,t]}},id=(e,t)=>{const n=ed(e);return{name:n.name,fn:n.fn,options:[e,t]}};var cd=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ld=cd.reduce((e,t)=>{const n=Ce(`Primitive.${t}`),r=f.forwardRef((o,s)=>{const{asChild:a,...i}=o,l=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(l,{...i,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),dd="Arrow",es=f.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...s}=e;return c.jsx(ld.svg,{...s,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:c.jsx("polygon",{points:"0,0 30,0 15,10"})})});es.displayName=dd;var ud=es,fd=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ts=fd.reduce((e,t)=>{const n=Ce(`Primitive.${t}`),r=f.forwardRef((o,s)=>{const{asChild:a,...i}=o,l=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(l,{...i,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function ns(e){const[t,n]=f.useState(void 0);return ye(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const s=o[0];let a,i;if("borderBoxSize"in s){const l=s.borderBoxSize,d=Array.isArray(l)?l[0]:l;a=d.inlineSize,i=d.blockSize}else a=e.offsetWidth,i=e.offsetHeight;n({width:a,height:i})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var wr="Popper",[rs,gn]=ct(wr),[pd,os]=rs(wr),ss=e=>{const{__scopePopper:t,children:n}=e,[r,o]=f.useState(null);return c.jsx(pd,{scope:t,anchor:r,onAnchorChange:o,children:n})};ss.displayName=wr;var as="PopperAnchor",is=f.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,s=os(as,n),a=f.useRef(null),i=ie(t,a),l=f.useRef(null);return f.useEffect(()=>{const d=l.current;l.current=r?.current||a.current,d!==l.current&&s.onAnchorChange(l.current)}),r?null:c.jsx(ts.div,{...o,ref:i})});is.displayName=as;var xr="PopperContent",[md,hd]=rs(xr),cs=f.forwardRef((e,t)=>{const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:s="center",alignOffset:a=0,arrowPadding:i=0,avoidCollisions:l=!0,collisionBoundary:d=[],collisionPadding:u=0,sticky:h="partial",hideWhenDetached:g=!1,updatePositionStrategy:p="optimized",onPlaced:b,...m}=e,v=os(xr,n),[C,N]=f.useState(null),E=ie(t,V=>N(V)),[x,S]=f.useState(null),A=ns(x),_=A?.width??0,P=A?.height??0,$=r+(s!=="center"?"-"+s:""),z=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},H=Array.isArray(d)?d:[d],G=H.length>0,w={padding:z,boundary:H.filter(bd),altBoundary:G},{refs:k,floatingStyles:D,placement:O,isPositioned:I,middlewareData:T}=Jl({strategy:"fixed",placement:$,whileElementsMounted:(...V)=>Ul(...V,{animationFrame:p==="always"}),elements:{reference:v.anchor},middleware:[td({mainAxis:o+P,alignmentAxis:a}),l&&nd({mainAxis:!0,crossAxis:!1,limiter:h==="partial"?rd():void 0,...w}),l&&od({...w}),sd({...w,apply:({elements:V,rects:ee,availableWidth:Q,availableHeight:te})=>{const{width:ne,height:se}=ee.reference,ce=V.floating.style;ce.setProperty("--radix-popper-available-width",`${Q}px`),ce.setProperty("--radix-popper-available-height",`${te}px`),ce.setProperty("--radix-popper-anchor-width",`${ne}px`),ce.setProperty("--radix-popper-anchor-height",`${se}px`)}}),x&&id({element:x,padding:i}),yd({arrowWidth:_,arrowHeight:P}),g&&ad({strategy:"referenceHidden",...w})]}),[F,M]=us(O),q=Ke(b);ye(()=>{I&&q?.()},[I,q]);const de=T.arrow?.x,Z=T.arrow?.y,ge=T.arrow?.centerOffset!==0,[Y,oe]=f.useState();return ye(()=>{C&&oe(window.getComputedStyle(C).zIndex)},[C]),c.jsx("div",{ref:k.setFloating,"data-radix-popper-content-wrapper":"",style:{...D,transform:I?D.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Y,"--radix-popper-transform-origin":[T.transformOrigin?.x,T.transformOrigin?.y].join(" "),...T.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:c.jsx(md,{scope:n,placedSide:F,onArrowChange:S,arrowX:de,arrowY:Z,shouldHideArrow:ge,children:c.jsx(ts.div,{"data-side":F,"data-align":M,...m,ref:E,style:{...m.style,animation:I?void 0:"none"}})})})});cs.displayName=xr;var ls="PopperArrow",gd={top:"bottom",right:"left",bottom:"top",left:"right"},ds=f.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,s=hd(ls,r),a=gd[s.placedSide];return c.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:c.jsx(ud,{...o,ref:n,style:{...o.style,display:"block"}})})});ds.displayName=ls;function bd(e){return e!==null}var yd=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:o}=t,a=o.arrow?.centerOffset!==0,i=a?0:e.arrowWidth,l=a?0:e.arrowHeight,[d,u]=us(n),h={start:"0%",center:"50%",end:"100%"}[u],g=(o.arrow?.x??0)+i/2,p=(o.arrow?.y??0)+l/2;let b="",m="";return d==="bottom"?(b=a?h:`${g}px`,m=`${-l}px`):d==="top"?(b=a?h:`${g}px`,m=`${r.floating.height+l}px`):d==="right"?(b=`${-l}px`,m=a?h:`${p}px`):d==="left"&&(b=`${r.floating.width+l}px`,m=a?h:`${p}px`),{data:{x:b,y:m}}}});function us(e){const[t,n="center"]=e.split("-");return[t,n]}var fs=ss,Sr=is,ps=cs,ms=ds,vd=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],wd=vd.reduce((e,t)=>{const n=Ce(`Primitive.${t}`),r=f.forwardRef((o,s)=>{const{asChild:a,...i}=o,l=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(l,{...i,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),xd="Portal",Cr=f.forwardRef((e,t)=>{const{container:n,...r}=e,[o,s]=f.useState(!1);ye(()=>s(!0),[]);const a=n||o&&globalThis?.document?.body;return a?lo.createPortal(c.jsx(wd.div,{...r,ref:t}),a):null});Cr.displayName=xd;var Sd=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ae=Sd.reduce((e,t)=>{const n=Ce(`Primitive.${t}`),r=f.forwardRef((o,s)=>{const{asChild:a,...i}=o,l=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(l,{...i,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),Cd=f[" useInsertionEffect ".trim().toString()]||ye;function Rt({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,s,a]=Ed({defaultProp:t,onChange:n}),i=e!==void 0,l=i?e:o;{const u=f.useRef(e!==void 0);f.useEffect(()=>{const h=u.current;h!==i&&console.warn(`${r} is changing from ${h?"controlled":"uncontrolled"} to ${i?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),u.current=i},[i,r])}const d=f.useCallback(u=>{if(i){const h=Nd(u)?u(e):u;h!==e&&a.current?.(h)}else s(u)},[i,e,s,a]);return[l,d]}function Ed({defaultProp:e,onChange:t}){const[n,r]=f.useState(e),o=f.useRef(n),s=f.useRef(t);return Cd(()=>{s.current=t},[t]),f.useEffect(()=>{o.current!==n&&(s.current?.(n),o.current=n)},[n,o]),[n,r,s]}function Nd(e){return typeof e=="function"}function hs(e){const t=f.useRef({value:e,previous:e});return f.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var kd=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ad=kd.reduce((e,t)=>{const n=Ce(`Primitive.${t}`),r=f.forwardRef((o,s)=>{const{asChild:a,...i}=o,l=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(l,{...i,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),gs=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),Td="VisuallyHidden",Pd=f.forwardRef((e,t)=>c.jsx(Ad.span,{...e,ref:t,style:{...gs,...e.style}}));Pd.displayName=Td;var _d=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Et=new WeakMap,bn=new WeakMap,yn={},Er=0,bs=function(e){return e&&(e.host||bs(e.parentNode))},Od=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=bs(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},Md=function(e,t,n,r){var o=Od(t,Array.isArray(e)?e:[e]);yn[n]||(yn[n]=new WeakMap);var s=yn[n],a=[],i=new Set,l=new Set(o),d=function(h){!h||i.has(h)||(i.add(h),d(h.parentNode))};o.forEach(d);var u=function(h){!h||l.has(h)||Array.prototype.forEach.call(h.children,function(g){if(i.has(g))u(g);else try{var p=g.getAttribute(r),b=p!==null&&p!=="false",m=(Et.get(g)||0)+1,v=(s.get(g)||0)+1;Et.set(g,m),s.set(g,v),a.push(g),m===1&&b&&bn.set(g,!0),v===1&&g.setAttribute(n,"true"),b||g.setAttribute(r,"true")}catch(C){console.error("aria-hidden: cannot operate on ",g,C)}})};return u(t),i.clear(),Er++,function(){a.forEach(function(h){var g=Et.get(h)-1,p=s.get(h)-1;Et.set(h,g),s.set(h,p),g||(bn.has(h)||h.removeAttribute(r),bn.delete(h)),p||h.removeAttribute(n)}),Er--,Er||(Et=new WeakMap,Et=new WeakMap,bn=new WeakMap,yn={})}},ys=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=_d(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),Md(r,o,n,"aria-hidden")):function(){return null}},We=function(){return We=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},We.apply(this,arguments)};function vs(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function Dd(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,s;r<o;r++)(s||!(r in t))&&(s||(s=Array.prototype.slice.call(t,0,r)),s[r]=t[r]);return e.concat(s||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;var vn="right-scroll-bar-position",wn="width-before-scroll-bar",Id="with-scroll-bars-hidden",Ld="--removed-body-scroll-bar-size";function Nr(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Fd(e,t){var n=R.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}var $d=typeof window<"u"?f.useLayoutEffect:f.useEffect,ws=new WeakMap;function zd(e,t){var n=Fd(null,function(r){return e.forEach(function(o){return Nr(o,r)})});return $d(function(){var r=ws.get(n);if(r){var o=new Set(r),s=new Set(e),a=n.current;o.forEach(function(i){s.has(i)||Nr(i,null)}),s.forEach(function(i){o.has(i)||Nr(i,a)})}ws.set(n,e)},[e]),n}function Rd(e){return e}function Wd(e,t){t===void 0&&(t=Rd);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(s){var a=t(s,r);return n.push(a),function(){n=n.filter(function(i){return i!==a})}},assignSyncMedium:function(s){for(r=!0;n.length;){var a=n;n=[],a.forEach(s)}n={push:function(i){return s(i)},filter:function(){return n}}},assignMedium:function(s){r=!0;var a=[];if(n.length){var i=n;n=[],i.forEach(s),a=n}var l=function(){var u=a;a=[],u.forEach(s)},d=function(){return Promise.resolve().then(l)};d(),n={push:function(u){a.push(u),d()},filter:function(u){return a=a.filter(u),n}}}};return o}function Bd(e){e===void 0&&(e={});var t=Wd(null);return t.options=We({async:!0,ssr:!1},e),t}var xs=function(e){var t=e.sideCar,n=vs(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return f.createElement(r,We({},n))};xs.isSideCarExport=!0;function Hd(e,t){return e.useMedium(t),xs}var Ss=Bd(),kr=function(){},xn=f.forwardRef(function(e,t){var n=f.useRef(null),r=f.useState({onScrollCapture:kr,onWheelCapture:kr,onTouchMoveCapture:kr}),o=r[0],s=r[1],a=e.forwardProps,i=e.children,l=e.className,d=e.removeScrollBar,u=e.enabled,h=e.shards,g=e.sideCar,p=e.noRelative,b=e.noIsolation,m=e.inert,v=e.allowPinchZoom,C=e.as,N=C===void 0?"div":C,E=e.gapMode,x=vs(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),S=g,A=zd([n,t]),_=We(We({},x),o);return f.createElement(f.Fragment,null,u&&f.createElement(S,{sideCar:Ss,removeScrollBar:d,shards:h,noRelative:p,noIsolation:b,inert:m,setCallbacks:s,allowPinchZoom:!!v,lockRef:n,gapMode:E}),a?f.cloneElement(f.Children.only(i),We(We({},_),{ref:A})):f.createElement(N,We({},_,{className:l,ref:A}),i))});xn.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},xn.classNames={fullWidth:wn,zeroRight:vn};var Ud=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Vd(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Ud();return t&&e.setAttribute("nonce",t),e}function jd(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Gd(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Yd=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Vd())&&(jd(t,n),Gd(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},qd=function(){var e=Yd();return function(t,n){f.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Cs=function(){var e=qd(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},Kd={left:0,top:0,right:0,gap:0},Ar=function(e){return parseInt(e||"",10)||0},Xd=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[Ar(n),Ar(r),Ar(o)]},Qd=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Kd;var t=Xd(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Zd=Cs(),Nt="data-scroll-locked",Jd=function(e,t,n,r){var o=e.left,s=e.top,a=e.right,i=e.gap;return n===void 0&&(n="margin"),`
21
- .`.concat(Id,` {
17
+ ${j?"bg-accent text-accent-foreground":""}
18
+ ${I?"text-primary font-medium":"text-foreground"}
19
+ ${!j&&!I?"hover:bg-muted":""}
20
+ `,children:[c.jsxs("div",{className:"flex flex-col min-w-0",children:[c.jsx("span",{className:"truncate",children:N.label}),N.description&&c.jsx("span",{className:"text-xs text-muted-foreground truncate",children:N.description})]}),I&&c.jsx(cc,{className:"w-4 h-4 text-primary shrink-0 ml-2"})]},N.value)}):c.jsx("output",{className:"block py-8 text-center text-sm text-muted-foreground",children:p?"Searching...":"No results found"})})]})]})}function bo(e,[t,n]){return Math.min(n,Math.max(t,e))}function J(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e?.(o),n===!1||!o.defaultPrevented)return t?.(o)}}function ct(e,t=[]){let n=[];function r(s,a){const i=f.createContext(a),l=n.length;n=[...n,a];const u=h=>{const{scope:g,children:p,...b}=h,m=g?.[e]?.[l]||i,v=f.useMemo(()=>b,Object.values(b));return c.jsx(m.Provider,{value:v,children:p})};u.displayName=s+"Provider";function d(h,g){const p=g?.[e]?.[l]||i,b=f.useContext(p);if(b)return b;if(a!==void 0)return a;throw new Error(`\`${h}\` must be used within \`${s}\``)}return[u,d]}const o=()=>{const s=n.map(a=>f.createContext(a));return function(i){const l=i?.[e]||s;return f.useMemo(()=>({[`__scope${e}`]:{...i,[e]:l}}),[i,l])}};return o.scopeName=e,[r,_c(o,...t)]}function _c(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const a=r.reduce((i,{useScope:l,scopeName:u})=>{const h=l(s)[`__scope${u}`];return{...i,...h}},{});return f.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}function yo(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function er(...e){return t=>{let n=!1;const r=e.map(o=>{const s=yo(o,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o<r.length;o++){const s=r[o];typeof s=="function"?s():yo(e[o],null)}}}}function ce(...e){return f.useCallback(er(...e),e)}function Ce(e){const t=Oc(e),n=f.forwardRef((r,o)=>{const{children:s,...a}=r,i=f.Children.toArray(s),l=i.find(Dc);if(l){const u=l.props.children,d=i.map(h=>h===l?f.Children.count(u)>1?f.Children.only(null):f.isValidElement(u)?u.props.children:null:h);return c.jsx(t,{...a,ref:o,children:f.isValidElement(u)?f.cloneElement(u,void 0,d):null})}return c.jsx(t,{...a,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}function Oc(e){const t=f.forwardRef((n,r)=>{const{children:o,...s}=n;if(f.isValidElement(o)){const a=Lc(o),i=Ic(s,o.props);return o.type!==f.Fragment&&(i.ref=r?er(r,a):a),f.cloneElement(o,i)}return f.Children.count(o)>1?f.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Mc=Symbol("radix.slottable");function Dc(e){return f.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Mc}function Ic(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...i)=>{const l=s(...i);return o(...i),l}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function Lc(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function vo(e){const t=e+"CollectionProvider",[n,r]=ct(t),[o,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),a=m=>{const{scope:v,children:S}=m,k=R.useRef(null),E=R.useRef(new Map).current;return c.jsx(o,{scope:v,itemMap:E,collectionRef:k,children:S})};a.displayName=t;const i=e+"CollectionSlot",l=Ce(i),u=R.forwardRef((m,v)=>{const{scope:S,children:k}=m,E=s(i,S),w=ce(v,E.collectionRef);return c.jsx(l,{ref:w,children:k})});u.displayName=i;const d=e+"CollectionItemSlot",h="data-radix-collection-item",g=Ce(d),p=R.forwardRef((m,v)=>{const{scope:S,children:k,...E}=m,w=R.useRef(null),x=ce(v,w),A=s(d,S);return R.useEffect(()=>(A.itemMap.set(w,{ref:w,...E}),()=>{A.itemMap.delete(w)})),c.jsx(g,{[h]:"",ref:x,children:k})});p.displayName=d;function b(m){const v=s(e+"CollectionConsumer",m);return R.useCallback(()=>{const k=v.collectionRef.current;if(!k)return[];const E=Array.from(k.querySelectorAll(`[${h}]`));return Array.from(v.itemMap.values()).sort((A,O)=>E.indexOf(A.ref.current)-E.indexOf(O.ref.current))},[v.collectionRef,v.itemMap])}return[{Provider:a,Slot:u,ItemSlot:p},b,r]}var Fc=f.createContext(void 0);function tr(e){const t=f.useContext(Fc);return e||t||"ltr"}var $c=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],wo=$c.reduce((e,t)=>{const n=Ce(`Primitive.${t}`),r=f.forwardRef((o,s)=>{const{asChild:a,...i}=o,l=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(l,{...i,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function zc(e,t){e&&rn.flushSync(()=>e.dispatchEvent(t))}function Ke(e){const t=f.useRef(e);return f.useEffect(()=>{t.current=e}),f.useMemo(()=>(...n)=>t.current?.(...n),[])}function Rc(e,t=globalThis?.document){const n=Ke(e);f.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var Wc="DismissableLayer",nr="dismissableLayer.update",Bc="dismissableLayer.pointerDownOutside",Hc="dismissableLayer.focusOutside",xo,So=f.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),rr=f.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:a,onDismiss:i,...l}=e,u=f.useContext(So),[d,h]=f.useState(null),g=d?.ownerDocument??globalThis?.document,[,p]=f.useState({}),b=ce(t,O=>h(O)),m=Array.from(u.layers),[v]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),S=m.indexOf(v),k=d?m.indexOf(d):-1,E=u.layersWithOutsidePointerEventsDisabled.size>0,w=k>=S,x=jc(O=>{const T=O.target,$=[...u.branches].some(z=>z.contains(T));!w||$||(o?.(O),a?.(O),O.defaultPrevented||i?.())},g),A=Gc(O=>{const T=O.target;[...u.branches].some(z=>z.contains(T))||(s?.(O),a?.(O),O.defaultPrevented||i?.())},g);return Rc(O=>{k===u.layers.size-1&&(r?.(O),!O.defaultPrevented&&i&&(O.preventDefault(),i()))},g),f.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(xo=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),Co(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(g.body.style.pointerEvents=xo)}},[d,g,n,u]),f.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),Co())},[d,u]),f.useEffect(()=>{const O=()=>p({});return document.addEventListener(nr,O),()=>document.removeEventListener(nr,O)},[]),c.jsx(wo.div,{...l,ref:b,style:{pointerEvents:E?w?"auto":"none":void 0,...e.style},onFocusCapture:J(e.onFocusCapture,A.onFocusCapture),onBlurCapture:J(e.onBlurCapture,A.onBlurCapture),onPointerDownCapture:J(e.onPointerDownCapture,x.onPointerDownCapture)})});rr.displayName=Wc;var Uc="DismissableLayerBranch",Vc=f.forwardRef((e,t)=>{const n=f.useContext(So),r=f.useRef(null),o=ce(t,r);return f.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),c.jsx(wo.div,{...e,ref:o})});Vc.displayName=Uc;function jc(e,t=globalThis?.document){const n=Ke(e),r=f.useRef(!1),o=f.useRef(()=>{});return f.useEffect(()=>{const s=i=>{if(i.target&&!r.current){let l=function(){Eo(Bc,n,u,{discrete:!0})};const u={originalEvent:i};i.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=l,t.addEventListener("click",o.current,{once:!0})):l()}else t.removeEventListener("click",o.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",s),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function Gc(e,t=globalThis?.document){const n=Ke(e),r=f.useRef(!1);return f.useEffect(()=>{const o=s=>{s.target&&!r.current&&Eo(Hc,n,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Co(){const e=new CustomEvent(nr);document.dispatchEvent(e)}function Eo(e,t,n,{discrete:r}){const o=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?zc(o,s):o.dispatchEvent(s)}var or=0;function No(){f.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??ko()),document.body.insertAdjacentElement("beforeend",e[1]??ko()),or++,()=>{or===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),or--}},[])}function ko(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Yc=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],qc=Yc.reduce((e,t)=>{const n=Ce(`Primitive.${t}`),r=f.forwardRef((o,s)=>{const{asChild:a,...i}=o,l=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(l,{...i,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),sr="focusScope.autoFocusOnMount",ar="focusScope.autoFocusOnUnmount",Ao={bubbles:!1,cancelable:!0},Kc="FocusScope",ir=f.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:s,...a}=e,[i,l]=f.useState(null),u=Ke(o),d=Ke(s),h=f.useRef(null),g=ce(t,m=>l(m)),p=f.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;f.useEffect(()=>{if(r){let m=function(E){if(p.paused||!i)return;const w=E.target;i.contains(w)?h.current=w:Xe(h.current,{select:!0})},v=function(E){if(p.paused||!i)return;const w=E.relatedTarget;w!==null&&(i.contains(w)||Xe(h.current,{select:!0}))},S=function(E){if(document.activeElement===document.body)for(const x of E)x.removedNodes.length>0&&Xe(i)};document.addEventListener("focusin",m),document.addEventListener("focusout",v);const k=new MutationObserver(S);return i&&k.observe(i,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",m),document.removeEventListener("focusout",v),k.disconnect()}}},[r,i,p.paused]),f.useEffect(()=>{if(i){_o.add(p);const m=document.activeElement;if(!i.contains(m)){const S=new CustomEvent(sr,Ao);i.addEventListener(sr,u),i.dispatchEvent(S),S.defaultPrevented||(Xc(tl(To(i)),{select:!0}),document.activeElement===m&&Xe(i))}return()=>{i.removeEventListener(sr,u),setTimeout(()=>{const S=new CustomEvent(ar,Ao);i.addEventListener(ar,d),i.dispatchEvent(S),S.defaultPrevented||Xe(m??document.body,{select:!0}),i.removeEventListener(ar,d),_o.remove(p)},0)}}},[i,u,d,p]);const b=f.useCallback(m=>{if(!n&&!r||p.paused)return;const v=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,S=document.activeElement;if(v&&S){const k=m.currentTarget,[E,w]=Qc(k);E&&w?!m.shiftKey&&S===w?(m.preventDefault(),n&&Xe(E,{select:!0})):m.shiftKey&&S===E&&(m.preventDefault(),n&&Xe(w,{select:!0})):S===k&&m.preventDefault()}},[n,r,p.paused]);return c.jsx(qc.div,{tabIndex:-1,...a,ref:g,onKeyDown:b})});ir.displayName=Kc;function Xc(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Xe(r,{select:t}),document.activeElement!==n)return}function Qc(e){const t=To(e),n=Po(t,e),r=Po(t.reverse(),e);return[n,r]}function To(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Po(e,t){for(const n of e)if(!Zc(n,{upTo:t}))return n}function Zc(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function Jc(e){return e instanceof HTMLInputElement&&"select"in e}function Xe(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Jc(e)&&t&&e.select()}}var _o=el();function el(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=Oo(e,t),e.unshift(t)},remove(t){e=Oo(e,t),e[0]?.resume()}}}function Oo(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function tl(e){return e.filter(t=>t.tagName!=="A")}var ye=globalThis?.document?f.useLayoutEffect:()=>{},nl=f[" useId ".trim().toString()]||(()=>{}),rl=0;function Ft(e){const[t,n]=f.useState(nl());return ye(()=>{n(r=>r??String(rl++))},[e]),e||(t?`radix-${t}`:"")}const ol=["top","right","bottom","left"],Qe=Math.min,Ne=Math.max,sn=Math.round,an=Math.floor,$e=e=>({x:e,y:e}),sl={left:"right",right:"left",bottom:"top",top:"bottom"};function cr(e,t,n){return Ne(e,Qe(t,n))}function Ve(e,t){return typeof e=="function"?e(t):e}function je(e){return e.split("-")[0]}function wt(e){return e.split("-")[1]}function lr(e){return e==="x"?"y":"x"}function ur(e){return e==="y"?"height":"width"}function ze(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function dr(e){return lr(ze(e))}function al(e,t,n){n===void 0&&(n=!1);const r=wt(e),o=dr(e),s=ur(o);let a=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(a=cn(a)),[a,cn(a)]}function il(e){const t=cn(e);return[fr(e),t,fr(t)]}function fr(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const Mo=["left","right"],Do=["right","left"],cl=["top","bottom"],ll=["bottom","top"];function ul(e,t,n){switch(e){case"top":case"bottom":return n?t?Do:Mo:t?Mo:Do;case"left":case"right":return t?cl:ll;default:return[]}}function dl(e,t,n,r){const o=wt(e);let s=ul(je(e),n==="start",r);return o&&(s=s.map(a=>a+"-"+o),t&&(s=s.concat(s.map(fr)))),s}function cn(e){const t=je(e);return sl[t]+e.slice(t.length)}function fl(e){return{top:0,right:0,bottom:0,left:0,...e}}function Io(e){return typeof e!="number"?fl(e):{top:e,right:e,bottom:e,left:e}}function ln(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function Lo(e,t,n){let{reference:r,floating:o}=e;const s=ze(t),a=dr(t),i=ur(a),l=je(t),u=s==="y",d=r.x+r.width/2-o.width/2,h=r.y+r.height/2-o.height/2,g=r[i]/2-o[i]/2;let p;switch(l){case"top":p={x:d,y:r.y-o.height};break;case"bottom":p={x:d,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:h};break;case"left":p={x:r.x-o.width,y:h};break;default:p={x:r.x,y:r.y}}switch(wt(t)){case"start":p[a]-=g*(n&&u?-1:1);break;case"end":p[a]+=g*(n&&u?-1:1);break}return p}async function pl(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:s,rects:a,elements:i,strategy:l}=e,{boundary:u="clippingAncestors",rootBoundary:d="viewport",elementContext:h="floating",altBoundary:g=!1,padding:p=0}=Ve(t,e),b=Io(p),v=i[g?h==="floating"?"reference":"floating":h],S=ln(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(v)))==null||n?v:v.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(i.floating)),boundary:u,rootBoundary:d,strategy:l})),k=h==="floating"?{x:r,y:o,width:a.floating.width,height:a.floating.height}:a.reference,E=await(s.getOffsetParent==null?void 0:s.getOffsetParent(i.floating)),w=await(s.isElement==null?void 0:s.isElement(E))?await(s.getScale==null?void 0:s.getScale(E))||{x:1,y:1}:{x:1,y:1},x=ln(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:i,rect:k,offsetParent:E,strategy:l}):k);return{top:(S.top-x.top+b.top)/w.y,bottom:(x.bottom-S.bottom+b.bottom)/w.y,left:(S.left-x.left+b.left)/w.x,right:(x.right-S.right+b.right)/w.x}}const ml=50,hl=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:a}=n,i=a.detectOverflow?a:{...a,detectOverflow:pl},l=await(a.isRTL==null?void 0:a.isRTL(t));let u=await a.getElementRects({reference:e,floating:t,strategy:o}),{x:d,y:h}=Lo(u,r,l),g=r,p=0;const b={};for(let m=0;m<s.length;m++){const v=s[m];if(!v)continue;const{name:S,fn:k}=v,{x:E,y:w,data:x,reset:A}=await k({x:d,y:h,initialPlacement:r,placement:g,strategy:o,middlewareData:b,rects:u,platform:i,elements:{reference:e,floating:t}});d=E??d,h=w??h,b[S]={...b[S],...x},A&&p<ml&&(p++,typeof A=="object"&&(A.placement&&(g=A.placement),A.rects&&(u=A.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:o}):A.rects),{x:d,y:h}=Lo(u,g,l)),m=-1)}return{x:d,y:h,placement:g,strategy:o,middlewareData:b}},gl=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:s,platform:a,elements:i,middlewareData:l}=t,{element:u,padding:d=0}=Ve(e,t)||{};if(u==null)return{};const h=Io(d),g={x:n,y:r},p=dr(o),b=ur(p),m=await a.getDimensions(u),v=p==="y",S=v?"top":"left",k=v?"bottom":"right",E=v?"clientHeight":"clientWidth",w=s.reference[b]+s.reference[p]-g[p]-s.floating[b],x=g[p]-s.reference[p],A=await(a.getOffsetParent==null?void 0:a.getOffsetParent(u));let O=A?A[E]:0;(!O||!await(a.isElement==null?void 0:a.isElement(A)))&&(O=i.floating[E]||s.floating[b]);const T=w/2-x/2,$=O/2-m[b]/2-1,z=Qe(h[S],$),H=Qe(h[k],$),Y=z,D=O-m[b]-H,C=O/2-m[b]/2+T,P=cr(Y,C,D),_=!l.arrow&&wt(o)!=null&&C!==P&&s.reference[b]/2-(C<Y?z:H)-m[b]/2<0,F=_?C<Y?C-Y:C-D:0;return{[p]:g[p]+F,data:{[p]:P,centerOffset:C-P-F,..._&&{alignmentOffset:F}},reset:_}}}),bl=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:s,rects:a,initialPlacement:i,platform:l,elements:u}=t,{mainAxis:d=!0,crossAxis:h=!0,fallbackPlacements:g,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:b="none",flipAlignment:m=!0,...v}=Ve(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const S=je(o),k=ze(i),E=je(i)===i,w=await(l.isRTL==null?void 0:l.isRTL(u.floating)),x=g||(E||!m?[cn(i)]:il(i)),A=b!=="none";!g&&A&&x.push(...dl(i,m,b,w));const O=[i,...x],T=await l.detectOverflow(t,v),$=[];let z=((r=s.flip)==null?void 0:r.overflows)||[];if(d&&$.push(T[S]),h){const C=al(o,a,w);$.push(T[C[0]],T[C[1]])}if(z=[...z,{placement:o,overflows:$}],!$.every(C=>C<=0)){var H,Y;const C=(((H=s.flip)==null?void 0:H.index)||0)+1,P=O[C];if(P&&(!(h==="alignment"?k!==ze(P):!1)||z.every(N=>ze(N.placement)===k?N.overflows[0]>0:!0)))return{data:{index:C,overflows:z},reset:{placement:P}};let _=(Y=z.filter(F=>F.overflows[0]<=0).sort((F,N)=>F.overflows[1]-N.overflows[1])[0])==null?void 0:Y.placement;if(!_)switch(p){case"bestFit":{var D;const F=(D=z.filter(N=>{if(A){const M=ze(N.placement);return M===k||M==="y"}return!0}).map(N=>[N.placement,N.overflows.filter(M=>M>0).reduce((M,I)=>M+I,0)]).sort((N,M)=>N[1]-M[1])[0])==null?void 0:D[0];F&&(_=F);break}case"initialPlacement":_=i;break}if(o!==_)return{reset:{placement:_}}}return{}}}};function Fo(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function $o(e){return ol.some(t=>e[t]>=0)}const yl=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:o="referenceHidden",...s}=Ve(e,t);switch(o){case"referenceHidden":{const a=await r.detectOverflow(t,{...s,elementContext:"reference"}),i=Fo(a,n.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:$o(i)}}}case"escaped":{const a=await r.detectOverflow(t,{...s,altBoundary:!0}),i=Fo(a,n.floating);return{data:{escapedOffsets:i,escaped:$o(i)}}}default:return{}}}}},zo=new Set(["left","top"]);async function vl(e,t){const{placement:n,platform:r,elements:o}=e,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),a=je(n),i=wt(n),l=ze(n)==="y",u=zo.has(a)?-1:1,d=s&&l?-1:1,h=Ve(t,e);let{mainAxis:g,crossAxis:p,alignmentAxis:b}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return i&&typeof b=="number"&&(p=i==="end"?b*-1:b),l?{x:p*d,y:g*u}:{x:g*u,y:p*d}}const wl=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:s,placement:a,middlewareData:i}=t,l=await vl(t,e);return a===((n=i.offset)==null?void 0:n.placement)&&(r=i.arrow)!=null&&r.alignmentOffset?{}:{x:o+l.x,y:s+l.y,data:{...l,placement:a}}}}},xl=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o,platform:s}=t,{mainAxis:a=!0,crossAxis:i=!1,limiter:l={fn:S=>{let{x:k,y:E}=S;return{x:k,y:E}}},...u}=Ve(e,t),d={x:n,y:r},h=await s.detectOverflow(t,u),g=ze(je(o)),p=lr(g);let b=d[p],m=d[g];if(a){const S=p==="y"?"top":"left",k=p==="y"?"bottom":"right",E=b+h[S],w=b-h[k];b=cr(E,b,w)}if(i){const S=g==="y"?"top":"left",k=g==="y"?"bottom":"right",E=m+h[S],w=m-h[k];m=cr(E,m,w)}const v=l.fn({...t,[p]:b,[g]:m});return{...v,data:{x:v.x-n,y:v.y-r,enabled:{[p]:a,[g]:i}}}}}},Sl=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:s,middlewareData:a}=t,{offset:i=0,mainAxis:l=!0,crossAxis:u=!0}=Ve(e,t),d={x:n,y:r},h=ze(o),g=lr(h);let p=d[g],b=d[h];const m=Ve(i,t),v=typeof m=="number"?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(l){const E=g==="y"?"height":"width",w=s.reference[g]-s.floating[E]+v.mainAxis,x=s.reference[g]+s.reference[E]-v.mainAxis;p<w?p=w:p>x&&(p=x)}if(u){var S,k;const E=g==="y"?"width":"height",w=zo.has(je(o)),x=s.reference[h]-s.floating[E]+(w&&((S=a.offset)==null?void 0:S[h])||0)+(w?0:v.crossAxis),A=s.reference[h]+s.reference[E]+(w?0:((k=a.offset)==null?void 0:k[h])||0)-(w?v.crossAxis:0);b<x?b=x:b>A&&(b=A)}return{[g]:p,[h]:b}}}},Cl=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:s,platform:a,elements:i}=t,{apply:l=()=>{},...u}=Ve(e,t),d=await a.detectOverflow(t,u),h=je(o),g=wt(o),p=ze(o)==="y",{width:b,height:m}=s.floating;let v,S;h==="top"||h==="bottom"?(v=h,S=g===(await(a.isRTL==null?void 0:a.isRTL(i.floating))?"start":"end")?"left":"right"):(S=h,v=g==="end"?"top":"bottom");const k=m-d.top-d.bottom,E=b-d.left-d.right,w=Qe(m-d[v],k),x=Qe(b-d[S],E),A=!t.middlewareData.shift;let O=w,T=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(T=E),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(O=k),A&&!g){const z=Ne(d.left,0),H=Ne(d.right,0),Y=Ne(d.top,0),D=Ne(d.bottom,0);p?T=b-2*(z!==0||H!==0?z+H:Ne(d.left,d.right)):O=m-2*(Y!==0||D!==0?Y+D:Ne(d.top,d.bottom))}await l({...t,availableWidth:T,availableHeight:O});const $=await a.getDimensions(i.floating);return b!==$.width||m!==$.height?{reset:{rects:!0}}:{}}}};function un(){return typeof window<"u"}function xt(e){return Ro(e)?(e.nodeName||"").toLowerCase():"#document"}function ke(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Re(e){var t;return(t=(Ro(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Ro(e){return un()?e instanceof Node||e instanceof ke(e).Node:!1}function _e(e){return un()?e instanceof Element||e instanceof ke(e).Element:!1}function Ge(e){return un()?e instanceof HTMLElement||e instanceof ke(e).HTMLElement:!1}function Wo(e){return!un()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ke(e).ShadowRoot}function $t(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Oe(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&o!=="inline"&&o!=="contents"}function El(e){return/^(table|td|th)$/.test(xt(e))}function dn(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const Nl=/transform|translate|scale|rotate|perspective|filter/,kl=/paint|layout|strict|content/,lt=e=>!!e&&e!=="none";let pr;function mr(e){const t=_e(e)?Oe(e):e;return lt(t.transform)||lt(t.translate)||lt(t.scale)||lt(t.rotate)||lt(t.perspective)||!hr()&&(lt(t.backdropFilter)||lt(t.filter))||Nl.test(t.willChange||"")||kl.test(t.contain||"")}function Al(e){let t=Ze(e);for(;Ge(t)&&!St(t);){if(mr(t))return t;if(dn(t))return null;t=Ze(t)}return null}function hr(){return pr==null&&(pr=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),pr}function St(e){return/^(html|body|#document)$/.test(xt(e))}function Oe(e){return ke(e).getComputedStyle(e)}function fn(e){return _e(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ze(e){if(xt(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Wo(e)&&e.host||Re(e);return Wo(t)?t.host:t}function Bo(e){const t=Ze(e);return St(t)?e.ownerDocument?e.ownerDocument.body:e.body:Ge(t)&&$t(t)?t:Bo(t)}function zt(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=Bo(e),s=o===((r=e.ownerDocument)==null?void 0:r.body),a=ke(o);if(s){const i=gr(a);return t.concat(a,a.visualViewport||[],$t(o)?o:[],i&&n?zt(i):[])}else return t.concat(o,zt(o,[],n))}function gr(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Ho(e){const t=Oe(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Ge(e),s=o?e.offsetWidth:n,a=o?e.offsetHeight:r,i=sn(n)!==s||sn(r)!==a;return i&&(n=s,r=a),{width:n,height:r,$:i}}function br(e){return _e(e)?e:e.contextElement}function Ct(e){const t=br(e);if(!Ge(t))return $e(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=Ho(t);let a=(s?sn(n.width):n.width)/r,i=(s?sn(n.height):n.height)/o;return(!a||!Number.isFinite(a))&&(a=1),(!i||!Number.isFinite(i))&&(i=1),{x:a,y:i}}const Tl=$e(0);function Uo(e){const t=ke(e);return!hr()||!t.visualViewport?Tl:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Pl(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==ke(e)?!1:t}function ut(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=br(e);let a=$e(1);t&&(r?_e(r)&&(a=Ct(r)):a=Ct(e));const i=Pl(s,n,r)?Uo(s):$e(0);let l=(o.left+i.x)/a.x,u=(o.top+i.y)/a.y,d=o.width/a.x,h=o.height/a.y;if(s){const g=ke(s),p=r&&_e(r)?ke(r):r;let b=g,m=gr(b);for(;m&&r&&p!==b;){const v=Ct(m),S=m.getBoundingClientRect(),k=Oe(m),E=S.left+(m.clientLeft+parseFloat(k.paddingLeft))*v.x,w=S.top+(m.clientTop+parseFloat(k.paddingTop))*v.y;l*=v.x,u*=v.y,d*=v.x,h*=v.y,l+=E,u+=w,b=ke(m),m=gr(b)}}return ln({width:d,height:h,x:l,y:u})}function pn(e,t){const n=fn(e).scrollLeft;return t?t.left+n:ut(Re(e)).left+n}function Vo(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-pn(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function _l(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const s=o==="fixed",a=Re(r),i=t?dn(t.floating):!1;if(r===a||i&&s)return n;let l={scrollLeft:0,scrollTop:0},u=$e(1);const d=$e(0),h=Ge(r);if((h||!h&&!s)&&((xt(r)!=="body"||$t(a))&&(l=fn(r)),h)){const p=ut(r);u=Ct(r),d.x=p.x+r.clientLeft,d.y=p.y+r.clientTop}const g=a&&!h&&!s?Vo(a,l):$e(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+d.x+g.x,y:n.y*u.y-l.scrollTop*u.y+d.y+g.y}}function Ol(e){return Array.from(e.getClientRects())}function Ml(e){const t=Re(e),n=fn(e),r=e.ownerDocument.body,o=Ne(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=Ne(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+pn(e);const i=-n.scrollTop;return Oe(r).direction==="rtl"&&(a+=Ne(t.clientWidth,r.clientWidth)-o),{width:o,height:s,x:a,y:i}}const jo=25;function Dl(e,t){const n=ke(e),r=Re(e),o=n.visualViewport;let s=r.clientWidth,a=r.clientHeight,i=0,l=0;if(o){s=o.width,a=o.height;const d=hr();(!d||d&&t==="fixed")&&(i=o.offsetLeft,l=o.offsetTop)}const u=pn(r);if(u<=0){const d=r.ownerDocument,h=d.body,g=getComputedStyle(h),p=d.compatMode==="CSS1Compat"&&parseFloat(g.marginLeft)+parseFloat(g.marginRight)||0,b=Math.abs(r.clientWidth-h.clientWidth-p);b<=jo&&(s-=b)}else u<=jo&&(s+=u);return{width:s,height:a,x:i,y:l}}function Il(e,t){const n=ut(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,s=Ge(e)?Ct(e):$e(1),a=e.clientWidth*s.x,i=e.clientHeight*s.y,l=o*s.x,u=r*s.y;return{width:a,height:i,x:l,y:u}}function Go(e,t,n){let r;if(t==="viewport")r=Dl(e,n);else if(t==="document")r=Ml(Re(e));else if(_e(t))r=Il(t,n);else{const o=Uo(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return ln(r)}function Yo(e,t){const n=Ze(e);return n===t||!_e(n)||St(n)?!1:Oe(n).position==="fixed"||Yo(n,t)}function Ll(e,t){const n=t.get(e);if(n)return n;let r=zt(e,[],!1).filter(i=>_e(i)&&xt(i)!=="body"),o=null;const s=Oe(e).position==="fixed";let a=s?Ze(e):e;for(;_e(a)&&!St(a);){const i=Oe(a),l=mr(a);!l&&i.position==="fixed"&&(o=null),(s?!l&&!o:!l&&i.position==="static"&&!!o&&(o.position==="absolute"||o.position==="fixed")||$t(a)&&!l&&Yo(e,a))?r=r.filter(d=>d!==a):o=i,a=Ze(a)}return t.set(e,r),r}function Fl(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const a=[...n==="clippingAncestors"?dn(t)?[]:Ll(t,this._c):[].concat(n),r],i=Go(t,a[0],o);let l=i.top,u=i.right,d=i.bottom,h=i.left;for(let g=1;g<a.length;g++){const p=Go(t,a[g],o);l=Ne(p.top,l),u=Qe(p.right,u),d=Qe(p.bottom,d),h=Ne(p.left,h)}return{width:u-h,height:d-l,x:h,y:l}}function $l(e){const{width:t,height:n}=Ho(e);return{width:t,height:n}}function zl(e,t,n){const r=Ge(t),o=Re(t),s=n==="fixed",a=ut(e,!0,s,t);let i={scrollLeft:0,scrollTop:0};const l=$e(0);function u(){l.x=pn(o)}if(r||!r&&!s)if((xt(t)!=="body"||$t(o))&&(i=fn(t)),r){const p=ut(t,!0,s,t);l.x=p.x+t.clientLeft,l.y=p.y+t.clientTop}else o&&u();s&&!r&&o&&u();const d=o&&!r&&!s?Vo(o,i):$e(0),h=a.left+i.scrollLeft-l.x-d.x,g=a.top+i.scrollTop-l.y-d.y;return{x:h,y:g,width:a.width,height:a.height}}function yr(e){return Oe(e).position==="static"}function qo(e,t){if(!Ge(e)||Oe(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Re(e)===n&&(n=n.ownerDocument.body),n}function Ko(e,t){const n=ke(e);if(dn(e))return n;if(!Ge(e)){let o=Ze(e);for(;o&&!St(o);){if(_e(o)&&!yr(o))return o;o=Ze(o)}return n}let r=qo(e,t);for(;r&&El(r)&&yr(r);)r=qo(r,t);return r&&St(r)&&yr(r)&&!mr(r)?n:r||Al(e)||n}const Rl=async function(e){const t=this.getOffsetParent||Ko,n=this.getDimensions,r=await n(e.floating);return{reference:zl(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Wl(e){return Oe(e).direction==="rtl"}const Bl={convertOffsetParentRelativeRectToViewportRelativeRect:_l,getDocumentElement:Re,getClippingRect:Fl,getOffsetParent:Ko,getElementRects:Rl,getClientRects:Ol,getDimensions:$l,getScale:Ct,isElement:_e,isRTL:Wl};function Xo(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Hl(e,t){let n=null,r;const o=Re(e);function s(){var i;clearTimeout(r),(i=n)==null||i.disconnect(),n=null}function a(i,l){i===void 0&&(i=!1),l===void 0&&(l=1),s();const u=e.getBoundingClientRect(),{left:d,top:h,width:g,height:p}=u;if(i||t(),!g||!p)return;const b=an(h),m=an(o.clientWidth-(d+g)),v=an(o.clientHeight-(h+p)),S=an(d),E={rootMargin:-b+"px "+-m+"px "+-v+"px "+-S+"px",threshold:Ne(0,Qe(1,l))||1};let w=!0;function x(A){const O=A[0].intersectionRatio;if(O!==l){if(!w)return a();O?a(!1,O):r=setTimeout(()=>{a(!1,1e-7)},1e3)}O===1&&!Xo(u,e.getBoundingClientRect())&&a(),w=!1}try{n=new IntersectionObserver(x,{...E,root:o.ownerDocument})}catch{n=new IntersectionObserver(x,E)}n.observe(e)}return a(!0),s}function Ul(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:i=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,u=br(e),d=o||s?[...u?zt(u):[],...t?zt(t):[]]:[];d.forEach(S=>{o&&S.addEventListener("scroll",n,{passive:!0}),s&&S.addEventListener("resize",n)});const h=u&&i?Hl(u,n):null;let g=-1,p=null;a&&(p=new ResizeObserver(S=>{let[k]=S;k&&k.target===u&&p&&t&&(p.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var E;(E=p)==null||E.observe(t)})),n()}),u&&!l&&p.observe(u),t&&p.observe(t));let b,m=l?ut(e):null;l&&v();function v(){const S=ut(e);m&&!Xo(m,S)&&n(),m=S,b=requestAnimationFrame(v)}return n(),()=>{var S;d.forEach(k=>{o&&k.removeEventListener("scroll",n),s&&k.removeEventListener("resize",n)}),h?.(),(S=p)==null||S.disconnect(),p=null,l&&cancelAnimationFrame(b)}}const Vl=wl,jl=xl,Gl=bl,Yl=Cl,ql=yl,Qo=gl,Kl=Sl,Xl=(e,t,n)=>{const r=new Map,o={platform:Bl,...n},s={...o.platform,_c:r};return hl(e,t,{...o,platform:s})};var Ql=typeof document<"u",Zl=function(){},mn=Ql?R.useLayoutEffect:Zl;function hn(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!hn(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const s=o[r];if(!(s==="_owner"&&e.$$typeof)&&!hn(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function Zo(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Jo(e,t){const n=Zo(e);return Math.round(t*n)/n}function vr(e){const t=f.useRef(e);return mn(()=>{t.current=e}),t}function Jl(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:s,floating:a}={},transform:i=!0,whileElementsMounted:l,open:u}=e,[d,h]=f.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[g,p]=f.useState(r);hn(g,r)||p(r);const[b,m]=f.useState(null),[v,S]=f.useState(null),k=f.useCallback(N=>{N!==A.current&&(A.current=N,m(N))},[]),E=f.useCallback(N=>{N!==O.current&&(O.current=N,S(N))},[]),w=s||b,x=a||v,A=f.useRef(null),O=f.useRef(null),T=f.useRef(d),$=l!=null,z=vr(l),H=vr(o),Y=vr(u),D=f.useCallback(()=>{if(!A.current||!O.current)return;const N={placement:t,strategy:n,middleware:g};H.current&&(N.platform=H.current),Xl(A.current,O.current,N).then(M=>{const I={...M,isPositioned:Y.current!==!1};C.current&&!hn(T.current,I)&&(T.current=I,rn.flushSync(()=>{h(I)}))})},[g,t,n,H,Y]);mn(()=>{u===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,h(N=>({...N,isPositioned:!1})))},[u]);const C=f.useRef(!1);mn(()=>(C.current=!0,()=>{C.current=!1}),[]),mn(()=>{if(w&&(A.current=w),x&&(O.current=x),w&&x){if(z.current)return z.current(w,x,D);D()}},[w,x,D,z,$]);const P=f.useMemo(()=>({reference:A,floating:O,setReference:k,setFloating:E}),[k,E]),_=f.useMemo(()=>({reference:w,floating:x}),[w,x]),F=f.useMemo(()=>{const N={position:n,left:0,top:0};if(!_.floating)return N;const M=Jo(_.floating,d.x),I=Jo(_.floating,d.y);return i?{...N,transform:"translate("+M+"px, "+I+"px)",...Zo(_.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:M,top:I}},[n,i,_.floating,d.x,d.y]);return f.useMemo(()=>({...d,update:D,refs:P,elements:_,floatingStyles:F}),[d,D,P,_,F])}const eu=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?Qo({element:r.current,padding:o}).fn(n):{}:r?Qo({element:r,padding:o}).fn(n):{}}}},tu=(e,t)=>{const n=Vl(e);return{name:n.name,fn:n.fn,options:[e,t]}},nu=(e,t)=>{const n=jl(e);return{name:n.name,fn:n.fn,options:[e,t]}},ru=(e,t)=>({fn:Kl(e).fn,options:[e,t]}),ou=(e,t)=>{const n=Gl(e);return{name:n.name,fn:n.fn,options:[e,t]}},su=(e,t)=>{const n=Yl(e);return{name:n.name,fn:n.fn,options:[e,t]}},au=(e,t)=>{const n=ql(e);return{name:n.name,fn:n.fn,options:[e,t]}},iu=(e,t)=>{const n=eu(e);return{name:n.name,fn:n.fn,options:[e,t]}};var cu=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],lu=cu.reduce((e,t)=>{const n=Ce(`Primitive.${t}`),r=f.forwardRef((o,s)=>{const{asChild:a,...i}=o,l=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(l,{...i,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),uu="Arrow",es=f.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...s}=e;return c.jsx(lu.svg,{...s,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:c.jsx("polygon",{points:"0,0 30,0 15,10"})})});es.displayName=uu;var du=es,fu=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ts=fu.reduce((e,t)=>{const n=Ce(`Primitive.${t}`),r=f.forwardRef((o,s)=>{const{asChild:a,...i}=o,l=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(l,{...i,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function ns(e){const[t,n]=f.useState(void 0);return ye(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const s=o[0];let a,i;if("borderBoxSize"in s){const l=s.borderBoxSize,u=Array.isArray(l)?l[0]:l;a=u.inlineSize,i=u.blockSize}else a=e.offsetWidth,i=e.offsetHeight;n({width:a,height:i})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var wr="Popper",[rs,gn]=ct(wr),[pu,os]=rs(wr),ss=e=>{const{__scopePopper:t,children:n}=e,[r,o]=f.useState(null);return c.jsx(pu,{scope:t,anchor:r,onAnchorChange:o,children:n})};ss.displayName=wr;var as="PopperAnchor",is=f.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,s=os(as,n),a=f.useRef(null),i=ce(t,a),l=f.useRef(null);return f.useEffect(()=>{const u=l.current;l.current=r?.current||a.current,u!==l.current&&s.onAnchorChange(l.current)}),r?null:c.jsx(ts.div,{...o,ref:i})});is.displayName=as;var xr="PopperContent",[mu,hu]=rs(xr),cs=f.forwardRef((e,t)=>{const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:s="center",alignOffset:a=0,arrowPadding:i=0,avoidCollisions:l=!0,collisionBoundary:u=[],collisionPadding:d=0,sticky:h="partial",hideWhenDetached:g=!1,updatePositionStrategy:p="optimized",onPlaced:b,...m}=e,v=os(xr,n),[S,k]=f.useState(null),E=ce(t,V=>k(V)),[w,x]=f.useState(null),A=ns(w),O=A?.width??0,T=A?.height??0,$=r+(s!=="center"?"-"+s:""),z=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},H=Array.isArray(u)?u:[u],Y=H.length>0,D={padding:z,boundary:H.filter(bu),altBoundary:Y},{refs:C,floatingStyles:P,placement:_,isPositioned:F,middlewareData:N}=Jl({strategy:"fixed",placement:$,whileElementsMounted:(...V)=>Ul(...V,{animationFrame:p==="always"}),elements:{reference:v.anchor},middleware:[tu({mainAxis:o+T,alignmentAxis:a}),l&&nu({mainAxis:!0,crossAxis:!1,limiter:h==="partial"?ru():void 0,...D}),l&&ou({...D}),su({...D,apply:({elements:V,rects:ee,availableWidth:Q,availableHeight:te})=>{const{width:ne,height:ae}=ee.reference,le=V.floating.style;le.setProperty("--radix-popper-available-width",`${Q}px`),le.setProperty("--radix-popper-available-height",`${te}px`),le.setProperty("--radix-popper-anchor-width",`${ne}px`),le.setProperty("--radix-popper-anchor-height",`${ae}px`)}}),w&&iu({element:w,padding:i}),yu({arrowWidth:O,arrowHeight:T}),g&&au({strategy:"referenceHidden",...D})]}),[M,I]=ds(_),j=Ke(b);ye(()=>{F&&j?.()},[F,j]);const se=N.arrow?.x,Z=N.arrow?.y,ge=N.arrow?.centerOffset!==0,[q,oe]=f.useState();return ye(()=>{S&&oe(window.getComputedStyle(S).zIndex)},[S]),c.jsx("div",{ref:C.setFloating,"data-radix-popper-content-wrapper":"",style:{...P,transform:F?P.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:q,"--radix-popper-transform-origin":[N.transformOrigin?.x,N.transformOrigin?.y].join(" "),...N.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:c.jsx(mu,{scope:n,placedSide:M,onArrowChange:x,arrowX:se,arrowY:Z,shouldHideArrow:ge,children:c.jsx(ts.div,{"data-side":M,"data-align":I,...m,ref:E,style:{...m.style,animation:F?void 0:"none"}})})})});cs.displayName=xr;var ls="PopperArrow",gu={top:"bottom",right:"left",bottom:"top",left:"right"},us=f.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,s=hu(ls,r),a=gu[s.placedSide];return c.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:c.jsx(du,{...o,ref:n,style:{...o.style,display:"block"}})})});us.displayName=ls;function bu(e){return e!==null}var yu=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:o}=t,a=o.arrow?.centerOffset!==0,i=a?0:e.arrowWidth,l=a?0:e.arrowHeight,[u,d]=ds(n),h={start:"0%",center:"50%",end:"100%"}[d],g=(o.arrow?.x??0)+i/2,p=(o.arrow?.y??0)+l/2;let b="",m="";return u==="bottom"?(b=a?h:`${g}px`,m=`${-l}px`):u==="top"?(b=a?h:`${g}px`,m=`${r.floating.height+l}px`):u==="right"?(b=`${-l}px`,m=a?h:`${p}px`):u==="left"&&(b=`${r.floating.width+l}px`,m=a?h:`${p}px`),{data:{x:b,y:m}}}});function ds(e){const[t,n="center"]=e.split("-");return[t,n]}var fs=ss,Sr=is,ps=cs,ms=us,vu=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],wu=vu.reduce((e,t)=>{const n=Ce(`Primitive.${t}`),r=f.forwardRef((o,s)=>{const{asChild:a,...i}=o,l=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(l,{...i,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),xu="Portal",Cr=f.forwardRef((e,t)=>{const{container:n,...r}=e,[o,s]=f.useState(!1);ye(()=>s(!0),[]);const a=n||o&&globalThis?.document?.body;return a?lo.createPortal(c.jsx(wu.div,{...r,ref:t}),a):null});Cr.displayName=xu;var Su=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ae=Su.reduce((e,t)=>{const n=Ce(`Primitive.${t}`),r=f.forwardRef((o,s)=>{const{asChild:a,...i}=o,l=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(l,{...i,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),Cu=f[" useInsertionEffect ".trim().toString()]||ye;function Rt({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,s,a]=Eu({defaultProp:t,onChange:n}),i=e!==void 0,l=i?e:o;{const d=f.useRef(e!==void 0);f.useEffect(()=>{const h=d.current;h!==i&&console.warn(`${r} is changing from ${h?"controlled":"uncontrolled"} to ${i?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),d.current=i},[i,r])}const u=f.useCallback(d=>{if(i){const h=Nu(d)?d(e):d;h!==e&&a.current?.(h)}else s(d)},[i,e,s,a]);return[l,u]}function Eu({defaultProp:e,onChange:t}){const[n,r]=f.useState(e),o=f.useRef(n),s=f.useRef(t);return Cu(()=>{s.current=t},[t]),f.useEffect(()=>{o.current!==n&&(s.current?.(n),o.current=n)},[n,o]),[n,r,s]}function Nu(e){return typeof e=="function"}function hs(e){const t=f.useRef({value:e,previous:e});return f.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var ku=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Au=ku.reduce((e,t)=>{const n=Ce(`Primitive.${t}`),r=f.forwardRef((o,s)=>{const{asChild:a,...i}=o,l=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(l,{...i,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),gs=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),Tu="VisuallyHidden",Pu=f.forwardRef((e,t)=>c.jsx(Au.span,{...e,ref:t,style:{...gs,...e.style}}));Pu.displayName=Tu;var _u=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Et=new WeakMap,bn=new WeakMap,yn={},Er=0,bs=function(e){return e&&(e.host||bs(e.parentNode))},Ou=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=bs(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},Mu=function(e,t,n,r){var o=Ou(t,Array.isArray(e)?e:[e]);yn[n]||(yn[n]=new WeakMap);var s=yn[n],a=[],i=new Set,l=new Set(o),u=function(h){!h||i.has(h)||(i.add(h),u(h.parentNode))};o.forEach(u);var d=function(h){!h||l.has(h)||Array.prototype.forEach.call(h.children,function(g){if(i.has(g))d(g);else try{var p=g.getAttribute(r),b=p!==null&&p!=="false",m=(Et.get(g)||0)+1,v=(s.get(g)||0)+1;Et.set(g,m),s.set(g,v),a.push(g),m===1&&b&&bn.set(g,!0),v===1&&g.setAttribute(n,"true"),b||g.setAttribute(r,"true")}catch(S){console.error("aria-hidden: cannot operate on ",g,S)}})};return d(t),i.clear(),Er++,function(){a.forEach(function(h){var g=Et.get(h)-1,p=s.get(h)-1;Et.set(h,g),s.set(h,p),g||(bn.has(h)||h.removeAttribute(r),bn.delete(h)),p||h.removeAttribute(n)}),Er--,Er||(Et=new WeakMap,Et=new WeakMap,bn=new WeakMap,yn={})}},ys=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=_u(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),Mu(r,o,n,"aria-hidden")):function(){return null}},We=function(){return We=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},We.apply(this,arguments)};function vs(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function Du(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,s;r<o;r++)(s||!(r in t))&&(s||(s=Array.prototype.slice.call(t,0,r)),s[r]=t[r]);return e.concat(s||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;var vn="right-scroll-bar-position",wn="width-before-scroll-bar",Iu="with-scroll-bars-hidden",Lu="--removed-body-scroll-bar-size";function Nr(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Fu(e,t){var n=R.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}var $u=typeof window<"u"?f.useLayoutEffect:f.useEffect,ws=new WeakMap;function zu(e,t){var n=Fu(null,function(r){return e.forEach(function(o){return Nr(o,r)})});return $u(function(){var r=ws.get(n);if(r){var o=new Set(r),s=new Set(e),a=n.current;o.forEach(function(i){s.has(i)||Nr(i,null)}),s.forEach(function(i){o.has(i)||Nr(i,a)})}ws.set(n,e)},[e]),n}function Ru(e){return e}function Wu(e,t){t===void 0&&(t=Ru);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(s){var a=t(s,r);return n.push(a),function(){n=n.filter(function(i){return i!==a})}},assignSyncMedium:function(s){for(r=!0;n.length;){var a=n;n=[],a.forEach(s)}n={push:function(i){return s(i)},filter:function(){return n}}},assignMedium:function(s){r=!0;var a=[];if(n.length){var i=n;n=[],i.forEach(s),a=n}var l=function(){var d=a;a=[],d.forEach(s)},u=function(){return Promise.resolve().then(l)};u(),n={push:function(d){a.push(d),u()},filter:function(d){return a=a.filter(d),n}}}};return o}function Bu(e){e===void 0&&(e={});var t=Wu(null);return t.options=We({async:!0,ssr:!1},e),t}var xs=function(e){var t=e.sideCar,n=vs(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return f.createElement(r,We({},n))};xs.isSideCarExport=!0;function Hu(e,t){return e.useMedium(t),xs}var Ss=Bu(),kr=function(){},xn=f.forwardRef(function(e,t){var n=f.useRef(null),r=f.useState({onScrollCapture:kr,onWheelCapture:kr,onTouchMoveCapture:kr}),o=r[0],s=r[1],a=e.forwardProps,i=e.children,l=e.className,u=e.removeScrollBar,d=e.enabled,h=e.shards,g=e.sideCar,p=e.noRelative,b=e.noIsolation,m=e.inert,v=e.allowPinchZoom,S=e.as,k=S===void 0?"div":S,E=e.gapMode,w=vs(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),x=g,A=zu([n,t]),O=We(We({},w),o);return f.createElement(f.Fragment,null,d&&f.createElement(x,{sideCar:Ss,removeScrollBar:u,shards:h,noRelative:p,noIsolation:b,inert:m,setCallbacks:s,allowPinchZoom:!!v,lockRef:n,gapMode:E}),a?f.cloneElement(f.Children.only(i),We(We({},O),{ref:A})):f.createElement(k,We({},O,{className:l,ref:A}),i))});xn.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},xn.classNames={fullWidth:wn,zeroRight:vn};var Uu=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Vu(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Uu();return t&&e.setAttribute("nonce",t),e}function ju(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Gu(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Yu=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Vu())&&(ju(t,n),Gu(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},qu=function(){var e=Yu();return function(t,n){f.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Cs=function(){var e=qu(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},Ku={left:0,top:0,right:0,gap:0},Ar=function(e){return parseInt(e||"",10)||0},Xu=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[Ar(n),Ar(r),Ar(o)]},Qu=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Ku;var t=Xu(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Zu=Cs(),Nt="data-scroll-locked",Ju=function(e,t,n,r){var o=e.left,s=e.top,a=e.right,i=e.gap;return n===void 0&&(n="margin"),`
21
+ .`.concat(Iu,` {
22
22
  overflow: hidden `).concat(r,`;
23
23
  padding-right: `).concat(i,"px ").concat(r,`;
24
24
  }
@@ -52,18 +52,18 @@
52
52
  }
53
53
 
54
54
  body[`).concat(Nt,`] {
55
- `).concat(Ld,": ").concat(i,`px;
55
+ `).concat(Lu,": ").concat(i,`px;
56
56
  }
57
- `)},Es=function(){var e=parseInt(document.body.getAttribute(Nt)||"0",10);return isFinite(e)?e:0},eu=function(){f.useEffect(function(){return document.body.setAttribute(Nt,(Es()+1).toString()),function(){var e=Es()-1;e<=0?document.body.removeAttribute(Nt):document.body.setAttribute(Nt,e.toString())}},[])},tu=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;eu();var s=f.useMemo(function(){return Qd(o)},[o]);return f.createElement(Zd,{styles:Jd(s,!t,o,n?"":"!important")})},Tr=!1;if(typeof window<"u")try{var Sn=Object.defineProperty({},"passive",{get:function(){return Tr=!0,!0}});window.addEventListener("test",Sn,Sn),window.removeEventListener("test",Sn,Sn)}catch{Tr=!1}var kt=Tr?{passive:!1}:!1,nu=function(e){return e.tagName==="TEXTAREA"},Ns=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!nu(e)&&n[t]==="visible")},ru=function(e){return Ns(e,"overflowY")},ou=function(e){return Ns(e,"overflowX")},ks=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=As(e,r);if(o){var s=Ts(e,r),a=s[1],i=s[2];if(a>i)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},su=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},au=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},As=function(e,t){return e==="v"?ru(t):ou(t)},Ts=function(e,t){return e==="v"?su(t):au(t)},iu=function(e,t){return e==="h"&&t==="rtl"?-1:1},cu=function(e,t,n,r,o){var s=iu(e,window.getComputedStyle(t).direction),a=s*r,i=n.target,l=t.contains(i),d=!1,u=a>0,h=0,g=0;do{if(!i)break;var p=Ts(e,i),b=p[0],m=p[1],v=p[2],C=m-v-s*b;(b||C)&&As(e,i)&&(h+=C,g+=b);var N=i.parentNode;i=N&&N.nodeType===Node.DOCUMENT_FRAGMENT_NODE?N.host:N}while(!l&&i!==document.body||l&&(t.contains(i)||t===i));return(u&&Math.abs(h)<1||!u&&Math.abs(g)<1)&&(d=!0),d},Cn=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Ps=function(e){return[e.deltaX,e.deltaY]},_s=function(e){return e&&"current"in e?e.current:e},lu=function(e,t){return e[0]===t[0]&&e[1]===t[1]},du=function(e){return`
57
+ `)},Es=function(){var e=parseInt(document.body.getAttribute(Nt)||"0",10);return isFinite(e)?e:0},ed=function(){f.useEffect(function(){return document.body.setAttribute(Nt,(Es()+1).toString()),function(){var e=Es()-1;e<=0?document.body.removeAttribute(Nt):document.body.setAttribute(Nt,e.toString())}},[])},td=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;ed();var s=f.useMemo(function(){return Qu(o)},[o]);return f.createElement(Zu,{styles:Ju(s,!t,o,n?"":"!important")})},Tr=!1;if(typeof window<"u")try{var Sn=Object.defineProperty({},"passive",{get:function(){return Tr=!0,!0}});window.addEventListener("test",Sn,Sn),window.removeEventListener("test",Sn,Sn)}catch{Tr=!1}var kt=Tr?{passive:!1}:!1,nd=function(e){return e.tagName==="TEXTAREA"},Ns=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!nd(e)&&n[t]==="visible")},rd=function(e){return Ns(e,"overflowY")},od=function(e){return Ns(e,"overflowX")},ks=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=As(e,r);if(o){var s=Ts(e,r),a=s[1],i=s[2];if(a>i)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},sd=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},ad=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},As=function(e,t){return e==="v"?rd(t):od(t)},Ts=function(e,t){return e==="v"?sd(t):ad(t)},id=function(e,t){return e==="h"&&t==="rtl"?-1:1},cd=function(e,t,n,r,o){var s=id(e,window.getComputedStyle(t).direction),a=s*r,i=n.target,l=t.contains(i),u=!1,d=a>0,h=0,g=0;do{if(!i)break;var p=Ts(e,i),b=p[0],m=p[1],v=p[2],S=m-v-s*b;(b||S)&&As(e,i)&&(h+=S,g+=b);var k=i.parentNode;i=k&&k.nodeType===Node.DOCUMENT_FRAGMENT_NODE?k.host:k}while(!l&&i!==document.body||l&&(t.contains(i)||t===i));return(d&&Math.abs(h)<1||!d&&Math.abs(g)<1)&&(u=!0),u},Cn=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Ps=function(e){return[e.deltaX,e.deltaY]},_s=function(e){return e&&"current"in e?e.current:e},ld=function(e,t){return e[0]===t[0]&&e[1]===t[1]},ud=function(e){return`
58
58
  .block-interactivity-`.concat(e,` {pointer-events: none;}
59
59
  .allow-interactivity-`).concat(e,` {pointer-events: all;}
60
- `)},uu=0,At=[];function fu(e){var t=f.useRef([]),n=f.useRef([0,0]),r=f.useRef(),o=f.useState(uu++)[0],s=f.useState(Cs)[0],a=f.useRef(e);f.useEffect(function(){a.current=e},[e]),f.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var m=Dd([e.lockRef.current],(e.shards||[]).map(_s),!0).filter(Boolean);return m.forEach(function(v){return v.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),m.forEach(function(v){return v.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var i=f.useCallback(function(m,v){if("touches"in m&&m.touches.length===2||m.type==="wheel"&&m.ctrlKey)return!a.current.allowPinchZoom;var C=Cn(m),N=n.current,E="deltaX"in m?m.deltaX:N[0]-C[0],x="deltaY"in m?m.deltaY:N[1]-C[1],S,A=m.target,_=Math.abs(E)>Math.abs(x)?"h":"v";if("touches"in m&&_==="h"&&A.type==="range")return!1;var P=window.getSelection(),$=P&&P.anchorNode,z=$?$===A||$.contains(A):!1;if(z)return!1;var H=ks(_,A);if(!H)return!0;if(H?S=_:(S=_==="v"?"h":"v",H=ks(_,A)),!H)return!1;if(!r.current&&"changedTouches"in m&&(E||x)&&(r.current=S),!S)return!0;var G=r.current||S;return cu(G,v,m,G==="h"?E:x)},[]),l=f.useCallback(function(m){var v=m;if(!(!At.length||At[At.length-1]!==s)){var C="deltaY"in v?Ps(v):Cn(v),N=t.current.filter(function(S){return S.name===v.type&&(S.target===v.target||v.target===S.shadowParent)&&lu(S.delta,C)})[0];if(N&&N.should){v.cancelable&&v.preventDefault();return}if(!N){var E=(a.current.shards||[]).map(_s).filter(Boolean).filter(function(S){return S.contains(v.target)}),x=E.length>0?i(v,E[0]):!a.current.noIsolation;x&&v.cancelable&&v.preventDefault()}}},[]),d=f.useCallback(function(m,v,C,N){var E={name:m,delta:v,target:C,should:N,shadowParent:pu(C)};t.current.push(E),setTimeout(function(){t.current=t.current.filter(function(x){return x!==E})},1)},[]),u=f.useCallback(function(m){n.current=Cn(m),r.current=void 0},[]),h=f.useCallback(function(m){d(m.type,Ps(m),m.target,i(m,e.lockRef.current))},[]),g=f.useCallback(function(m){d(m.type,Cn(m),m.target,i(m,e.lockRef.current))},[]);f.useEffect(function(){return At.push(s),e.setCallbacks({onScrollCapture:h,onWheelCapture:h,onTouchMoveCapture:g}),document.addEventListener("wheel",l,kt),document.addEventListener("touchmove",l,kt),document.addEventListener("touchstart",u,kt),function(){At=At.filter(function(m){return m!==s}),document.removeEventListener("wheel",l,kt),document.removeEventListener("touchmove",l,kt),document.removeEventListener("touchstart",u,kt)}},[]);var p=e.removeScrollBar,b=e.inert;return f.createElement(f.Fragment,null,b?f.createElement(s,{styles:du(o)}):null,p?f.createElement(tu,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function pu(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const mu=Hd(Ss,fu);var Pr=f.forwardRef(function(e,t){return f.createElement(xn,We({},e,{ref:t,sideCar:mu}))});Pr.classNames=xn.classNames;var hu=[" ","Enter","ArrowUp","ArrowDown"],gu=[" ","Enter"],ut="Select",[En,Nn,bu]=vo(ut),[Tt]=ct(ut,[bu,gn]),kn=gn(),[yu,Je]=Tt(ut),[vu,wu]=Tt(ut),Os=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:o,onOpenChange:s,value:a,defaultValue:i,onValueChange:l,dir:d,name:u,autoComplete:h,disabled:g,required:p,form:b}=e,m=kn(t),[v,C]=f.useState(null),[N,E]=f.useState(null),[x,S]=f.useState(!1),A=tr(d),[_,P]=Rt({prop:r,defaultProp:o??!1,onChange:s,caller:ut}),[$,z]=Rt({prop:a,defaultProp:i,onChange:l,caller:ut}),H=f.useRef(null),G=v?b||!!v.closest("form"):!0,[w,k]=f.useState(new Set),D=Array.from(w).map(O=>O.props.value).join(";");return c.jsx(fs,{...m,children:c.jsxs(yu,{required:p,scope:t,trigger:v,onTriggerChange:C,valueNode:N,onValueNodeChange:E,valueNodeHasChildren:x,onValueNodeHasChildrenChange:S,contentId:Ft(),value:$,onValueChange:z,open:_,onOpenChange:P,dir:A,triggerPointerDownPosRef:H,disabled:g,children:[c.jsx(En.Provider,{scope:t,children:c.jsx(vu,{scope:e.__scopeSelect,onNativeOptionAdd:f.useCallback(O=>{k(I=>new Set(I).add(O))},[]),onNativeOptionRemove:f.useCallback(O=>{k(I=>{const T=new Set(I);return T.delete(O),T})},[]),children:n})}),G?c.jsxs(ta,{"aria-hidden":!0,required:p,tabIndex:-1,name:u,autoComplete:h,value:$,onChange:O=>z(O.target.value),disabled:g,form:b,children:[$===void 0?c.jsx("option",{value:""}):null,Array.from(w)]},D):null]})})};Os.displayName=ut;var Ms="SelectTrigger",Ds=f.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...o}=e,s=kn(n),a=Je(Ms,n),i=a.disabled||r,l=ie(t,a.onTriggerChange),d=Nn(n),u=f.useRef("touch"),[h,g,p]=ra(m=>{const v=d().filter(E=>!E.disabled),C=v.find(E=>E.value===a.value),N=oa(v,m,C);N!==void 0&&a.onValueChange(N.value)}),b=m=>{i||(a.onOpenChange(!0),p()),m&&(a.triggerPointerDownPosRef.current={x:Math.round(m.pageX),y:Math.round(m.pageY)})};return c.jsx(Sr,{asChild:!0,...s,children:c.jsx(Ae.button,{type:"button",role:"combobox","aria-controls":a.contentId,"aria-expanded":a.open,"aria-required":a.required,"aria-autocomplete":"none",dir:a.dir,"data-state":a.open?"open":"closed",disabled:i,"data-disabled":i?"":void 0,"data-placeholder":na(a.value)?"":void 0,...o,ref:l,onClick:J(o.onClick,m=>{m.currentTarget.focus(),u.current!=="mouse"&&b(m)}),onPointerDown:J(o.onPointerDown,m=>{u.current=m.pointerType;const v=m.target;v.hasPointerCapture(m.pointerId)&&v.releasePointerCapture(m.pointerId),m.button===0&&m.ctrlKey===!1&&m.pointerType==="mouse"&&(b(m),m.preventDefault())}),onKeyDown:J(o.onKeyDown,m=>{const v=h.current!=="";!(m.ctrlKey||m.altKey||m.metaKey)&&m.key.length===1&&g(m.key),!(v&&m.key===" ")&&hu.includes(m.key)&&(b(),m.preventDefault())})})})});Ds.displayName=Ms;var Is="SelectValue",Ls=f.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,children:s,placeholder:a="",...i}=e,l=Je(Is,n),{onValueNodeHasChildrenChange:d}=l,u=s!==void 0,h=ie(t,l.onValueNodeChange);return ye(()=>{d(u)},[d,u]),c.jsx(Ae.span,{...i,ref:h,style:{pointerEvents:"none"},children:na(l.value)?c.jsx(c.Fragment,{children:a}):s})});Ls.displayName=Is;var xu="SelectIcon",Fs=f.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...o}=e;return c.jsx(Ae.span,{"aria-hidden":!0,...o,ref:t,children:r||"▼"})});Fs.displayName=xu;var Su="SelectPortal",$s=e=>c.jsx(Cr,{asChild:!0,...e});$s.displayName=Su;var ft="SelectContent",zs=f.forwardRef((e,t)=>{const n=Je(ft,e.__scopeSelect),[r,o]=f.useState();if(ye(()=>{o(new DocumentFragment)},[]),!n.open){const s=r;return s?rn.createPortal(c.jsx(Rs,{scope:e.__scopeSelect,children:c.jsx(En.Slot,{scope:e.__scopeSelect,children:c.jsx("div",{children:e.children})})}),s):null}return c.jsx(Ws,{...e,ref:t})});zs.displayName=ft;var Me=10,[Rs,et]=Tt(ft),Cu="SelectContentImpl",Eu=Ce("SelectContent.RemoveScroll"),Ws=f.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:s,onPointerDownOutside:a,side:i,sideOffset:l,align:d,alignOffset:u,arrowPadding:h,collisionBoundary:g,collisionPadding:p,sticky:b,hideWhenDetached:m,avoidCollisions:v,...C}=e,N=Je(ft,n),[E,x]=f.useState(null),[S,A]=f.useState(null),_=ie(t,V=>x(V)),[P,$]=f.useState(null),[z,H]=f.useState(null),G=Nn(n),[w,k]=f.useState(!1),D=f.useRef(!1);f.useEffect(()=>{if(E)return ys(E)},[E]),No();const O=f.useCallback(V=>{const[ee,...Q]=G().map(se=>se.ref.current),[te]=Q.slice(-1),ne=document.activeElement;for(const se of V)if(se===ne||(se?.scrollIntoView({block:"nearest"}),se===ee&&S&&(S.scrollTop=0),se===te&&S&&(S.scrollTop=S.scrollHeight),se?.focus(),document.activeElement!==ne))return},[G,S]),I=f.useCallback(()=>O([P,E]),[O,P,E]);f.useEffect(()=>{w&&I()},[w,I]);const{onOpenChange:T,triggerPointerDownPosRef:F}=N;f.useEffect(()=>{if(E){let V={x:0,y:0};const ee=te=>{V={x:Math.abs(Math.round(te.pageX)-(F.current?.x??0)),y:Math.abs(Math.round(te.pageY)-(F.current?.y??0))}},Q=te=>{V.x<=10&&V.y<=10?te.preventDefault():E.contains(te.target)||T(!1),document.removeEventListener("pointermove",ee),F.current=null};return F.current!==null&&(document.addEventListener("pointermove",ee),document.addEventListener("pointerup",Q,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ee),document.removeEventListener("pointerup",Q,{capture:!0})}}},[E,T,F]),f.useEffect(()=>{const V=()=>T(!1);return window.addEventListener("blur",V),window.addEventListener("resize",V),()=>{window.removeEventListener("blur",V),window.removeEventListener("resize",V)}},[T]);const[M,q]=ra(V=>{const ee=G().filter(ne=>!ne.disabled),Q=ee.find(ne=>ne.ref.current===document.activeElement),te=oa(ee,V,Q);te&&setTimeout(()=>te.ref.current.focus())}),de=f.useCallback((V,ee,Q)=>{const te=!D.current&&!Q;(N.value!==void 0&&N.value===ee||te)&&($(V),te&&(D.current=!0))},[N.value]),Z=f.useCallback(()=>E?.focus(),[E]),ge=f.useCallback((V,ee,Q)=>{const te=!D.current&&!Q;(N.value!==void 0&&N.value===ee||te)&&H(V)},[N.value]),Y=r==="popper"?_r:Bs,oe=Y===_r?{side:i,sideOffset:l,align:d,alignOffset:u,arrowPadding:h,collisionBoundary:g,collisionPadding:p,sticky:b,hideWhenDetached:m,avoidCollisions:v}:{};return c.jsx(Rs,{scope:n,content:E,viewport:S,onViewportChange:A,itemRefCallback:de,selectedItem:P,onItemLeave:Z,itemTextRefCallback:ge,focusSelectedItem:I,selectedItemText:z,position:r,isPositioned:w,searchRef:M,children:c.jsx(Pr,{as:Eu,allowPinchZoom:!0,children:c.jsx(ir,{asChild:!0,trapped:N.open,onMountAutoFocus:V=>{V.preventDefault()},onUnmountAutoFocus:J(o,V=>{N.trigger?.focus({preventScroll:!0}),V.preventDefault()}),children:c.jsx(rr,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:a,onFocusOutside:V=>V.preventDefault(),onDismiss:()=>N.onOpenChange(!1),children:c.jsx(Y,{role:"listbox",id:N.contentId,"data-state":N.open?"open":"closed",dir:N.dir,onContextMenu:V=>V.preventDefault(),...C,...oe,onPlaced:()=>k(!0),ref:_,style:{display:"flex",flexDirection:"column",outline:"none",...C.style},onKeyDown:J(C.onKeyDown,V=>{const ee=V.ctrlKey||V.altKey||V.metaKey;if(V.key==="Tab"&&V.preventDefault(),!ee&&V.key.length===1&&q(V.key),["ArrowUp","ArrowDown","Home","End"].includes(V.key)){let te=G().filter(ne=>!ne.disabled).map(ne=>ne.ref.current);if(["ArrowUp","End"].includes(V.key)&&(te=te.slice().reverse()),["ArrowUp","ArrowDown"].includes(V.key)){const ne=V.target,se=te.indexOf(ne);te=te.slice(se+1)}setTimeout(()=>O(te)),V.preventDefault()}})})})})})})});Ws.displayName=Cu;var Nu="SelectItemAlignedPosition",Bs=f.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...o}=e,s=Je(ft,n),a=et(ft,n),[i,l]=f.useState(null),[d,u]=f.useState(null),h=ie(t,_=>u(_)),g=Nn(n),p=f.useRef(!1),b=f.useRef(!0),{viewport:m,selectedItem:v,selectedItemText:C,focusSelectedItem:N}=a,E=f.useCallback(()=>{if(s.trigger&&s.valueNode&&i&&d&&m&&v&&C){const _=s.trigger.getBoundingClientRect(),P=d.getBoundingClientRect(),$=s.valueNode.getBoundingClientRect(),z=C.getBoundingClientRect();if(s.dir!=="rtl"){const ne=z.left-P.left,se=$.left-ne,ce=_.left-se,he=_.width+ce,Le=Math.max(he,P.width),gt=window.innerWidth-Me,bt=bo(se,[Me,Math.max(Me,gt-Le)]);i.style.minWidth=he+"px",i.style.left=bt+"px"}else{const ne=P.right-z.right,se=window.innerWidth-$.right-ne,ce=window.innerWidth-_.right-se,he=_.width+ce,Le=Math.max(he,P.width),gt=window.innerWidth-Me,bt=bo(se,[Me,Math.max(Me,gt-Le)]);i.style.minWidth=he+"px",i.style.right=bt+"px"}const H=g(),G=window.innerHeight-Me*2,w=m.scrollHeight,k=window.getComputedStyle(d),D=parseInt(k.borderTopWidth,10),O=parseInt(k.paddingTop,10),I=parseInt(k.borderBottomWidth,10),T=parseInt(k.paddingBottom,10),F=D+O+w+T+I,M=Math.min(v.offsetHeight*5,F),q=window.getComputedStyle(m),de=parseInt(q.paddingTop,10),Z=parseInt(q.paddingBottom,10),ge=_.top+_.height/2-Me,Y=G-ge,oe=v.offsetHeight/2,V=v.offsetTop+oe,ee=D+O+V,Q=F-ee;if(ee<=ge){const ne=H.length>0&&v===H[H.length-1].ref.current;i.style.bottom="0px";const se=d.clientHeight-m.offsetTop-m.offsetHeight,ce=Math.max(Y,oe+(ne?Z:0)+se+I),he=ee+ce;i.style.height=he+"px"}else{const ne=H.length>0&&v===H[0].ref.current;i.style.top="0px";const ce=Math.max(ge,D+m.offsetTop+(ne?de:0)+oe)+Q;i.style.height=ce+"px",m.scrollTop=ee-ge+m.offsetTop}i.style.margin=`${Me}px 0`,i.style.minHeight=M+"px",i.style.maxHeight=G+"px",r?.(),requestAnimationFrame(()=>p.current=!0)}},[g,s.trigger,s.valueNode,i,d,m,v,C,s.dir,r]);ye(()=>E(),[E]);const[x,S]=f.useState();ye(()=>{d&&S(window.getComputedStyle(d).zIndex)},[d]);const A=f.useCallback(_=>{_&&b.current===!0&&(E(),N?.(),b.current=!1)},[E,N]);return c.jsx(Au,{scope:n,contentWrapper:i,shouldExpandOnScrollRef:p,onScrollButtonChange:A,children:c.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:x},children:c.jsx(Ae.div,{...o,ref:h,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});Bs.displayName=Nu;var ku="SelectPopperPosition",_r=f.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=Me,...s}=e,a=kn(n);return c.jsx(ps,{...a,...s,ref:t,align:r,collisionPadding:o,style:{boxSizing:"border-box",...s.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});_r.displayName=ku;var[Au,Or]=Tt(ft,{}),Mr="SelectViewport",Hs=f.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...o}=e,s=et(Mr,n),a=Or(Mr,n),i=ie(t,s.onViewportChange),l=f.useRef(0);return c.jsxs(c.Fragment,{children:[c.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),c.jsx(En.Slot,{scope:n,children:c.jsx(Ae.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:i,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:J(o.onScroll,d=>{const u=d.currentTarget,{contentWrapper:h,shouldExpandOnScrollRef:g}=a;if(g?.current&&h){const p=Math.abs(l.current-u.scrollTop);if(p>0){const b=window.innerHeight-Me*2,m=parseFloat(h.style.minHeight),v=parseFloat(h.style.height),C=Math.max(m,v);if(C<b){const N=C+p,E=Math.min(b,N),x=N-E;h.style.height=E+"px",h.style.bottom==="0px"&&(u.scrollTop=x>0?x:0,h.style.justifyContent="flex-end")}}}l.current=u.scrollTop})})})]})});Hs.displayName=Mr;var Us="SelectGroup",[Tu,Pu]=Tt(Us),Vs=f.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Ft();return c.jsx(Tu,{scope:n,id:o,children:c.jsx(Ae.div,{role:"group","aria-labelledby":o,...r,ref:t})})});Vs.displayName=Us;var js="SelectLabel",Gs=f.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Pu(js,n);return c.jsx(Ae.div,{id:o.id,...r,ref:t})});Gs.displayName=js;var An="SelectItem",[_u,Ys]=Tt(An),qs=f.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:o=!1,textValue:s,...a}=e,i=Je(An,n),l=et(An,n),d=i.value===r,[u,h]=f.useState(s??""),[g,p]=f.useState(!1),b=ie(t,N=>l.itemRefCallback?.(N,r,o)),m=Ft(),v=f.useRef("touch"),C=()=>{o||(i.onValueChange(r),i.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return c.jsx(_u,{scope:n,value:r,disabled:o,textId:m,isSelected:d,onItemTextChange:f.useCallback(N=>{h(E=>E||(N?.textContent??"").trim())},[]),children:c.jsx(En.ItemSlot,{scope:n,value:r,disabled:o,textValue:u,children:c.jsx(Ae.div,{role:"option","aria-labelledby":m,"data-highlighted":g?"":void 0,"aria-selected":d&&g,"data-state":d?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...a,ref:b,onFocus:J(a.onFocus,()=>p(!0)),onBlur:J(a.onBlur,()=>p(!1)),onClick:J(a.onClick,()=>{v.current!=="mouse"&&C()}),onPointerUp:J(a.onPointerUp,()=>{v.current==="mouse"&&C()}),onPointerDown:J(a.onPointerDown,N=>{v.current=N.pointerType}),onPointerMove:J(a.onPointerMove,N=>{v.current=N.pointerType,o?l.onItemLeave?.():v.current==="mouse"&&N.currentTarget.focus({preventScroll:!0})}),onPointerLeave:J(a.onPointerLeave,N=>{N.currentTarget===document.activeElement&&l.onItemLeave?.()}),onKeyDown:J(a.onKeyDown,N=>{l.searchRef?.current!==""&&N.key===" "||(gu.includes(N.key)&&C(),N.key===" "&&N.preventDefault())})})})})});qs.displayName=An;var Wt="SelectItemText",Ks=f.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,...s}=e,a=Je(Wt,n),i=et(Wt,n),l=Ys(Wt,n),d=wu(Wt,n),[u,h]=f.useState(null),g=ie(t,C=>h(C),l.onItemTextChange,C=>i.itemTextRefCallback?.(C,l.value,l.disabled)),p=u?.textContent,b=f.useMemo(()=>c.jsx("option",{value:l.value,disabled:l.disabled,children:p},l.value),[l.disabled,l.value,p]),{onNativeOptionAdd:m,onNativeOptionRemove:v}=d;return ye(()=>(m(b),()=>v(b)),[m,v,b]),c.jsxs(c.Fragment,{children:[c.jsx(Ae.span,{id:l.textId,...s,ref:g}),l.isSelected&&a.valueNode&&!a.valueNodeHasChildren?rn.createPortal(s.children,a.valueNode):null]})});Ks.displayName=Wt;var Xs="SelectItemIndicator",Ou=f.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return Ys(Xs,n).isSelected?c.jsx(Ae.span,{"aria-hidden":!0,...r,ref:t}):null});Ou.displayName=Xs;var Dr="SelectScrollUpButton",Qs=f.forwardRef((e,t)=>{const n=et(Dr,e.__scopeSelect),r=Or(Dr,e.__scopeSelect),[o,s]=f.useState(!1),a=ie(t,r.onScrollButtonChange);return ye(()=>{if(n.viewport&&n.isPositioned){let i=function(){const d=l.scrollTop>0;s(d)};const l=n.viewport;return i(),l.addEventListener("scroll",i),()=>l.removeEventListener("scroll",i)}},[n.viewport,n.isPositioned]),o?c.jsx(Zs,{...e,ref:a,onAutoScroll:()=>{const{viewport:i,selectedItem:l}=n;i&&l&&(i.scrollTop=i.scrollTop-l.offsetHeight)}}):null});Qs.displayName=Dr;var Ir="SelectScrollDownButton",Mu=f.forwardRef((e,t)=>{const n=et(Ir,e.__scopeSelect),r=Or(Ir,e.__scopeSelect),[o,s]=f.useState(!1),a=ie(t,r.onScrollButtonChange);return ye(()=>{if(n.viewport&&n.isPositioned){let i=function(){const d=l.scrollHeight-l.clientHeight,u=Math.ceil(l.scrollTop)<d;s(u)};const l=n.viewport;return i(),l.addEventListener("scroll",i),()=>l.removeEventListener("scroll",i)}},[n.viewport,n.isPositioned]),o?c.jsx(Zs,{...e,ref:a,onAutoScroll:()=>{const{viewport:i,selectedItem:l}=n;i&&l&&(i.scrollTop=i.scrollTop+l.offsetHeight)}}):null});Mu.displayName=Ir;var Zs=f.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...o}=e,s=et("SelectScrollButton",n),a=f.useRef(null),i=Nn(n),l=f.useCallback(()=>{a.current!==null&&(window.clearInterval(a.current),a.current=null)},[]);return f.useEffect(()=>()=>l(),[l]),ye(()=>{i().find(u=>u.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[i]),c.jsx(Ae.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:J(o.onPointerDown,()=>{a.current===null&&(a.current=window.setInterval(r,50))}),onPointerMove:J(o.onPointerMove,()=>{s.onItemLeave?.(),a.current===null&&(a.current=window.setInterval(r,50))}),onPointerLeave:J(o.onPointerLeave,()=>{l()})})}),Du="SelectSeparator",Js=f.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return c.jsx(Ae.div,{"aria-hidden":!0,...r,ref:t})});Js.displayName=Du;var Lr="SelectArrow",ea=f.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=kn(n),s=Je(Lr,n),a=et(Lr,n);return s.open&&a.position==="popper"?c.jsx(ms,{...o,...r,ref:t}):null});ea.displayName=Lr;var Iu="SelectBubbleInput",ta=f.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const o=f.useRef(null),s=ie(r,o),a=hs(t);return f.useEffect(()=>{const i=o.current;if(!i)return;const l=window.HTMLSelectElement.prototype,u=Object.getOwnPropertyDescriptor(l,"value").set;if(a!==t&&u){const h=new Event("change",{bubbles:!0});u.call(i,t),i.dispatchEvent(h)}},[a,t]),c.jsx(Ae.select,{...n,style:{...gs,...n.style},ref:s,defaultValue:t})});ta.displayName=Iu;function na(e){return e===""||e===void 0}function ra(e){const t=Ke(e),n=f.useRef(""),r=f.useRef(0),o=f.useCallback(a=>{const i=n.current+a;t(i),(function l(d){n.current=d,window.clearTimeout(r.current),d!==""&&(r.current=window.setTimeout(()=>l(""),1e3))})(i)},[t]),s=f.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return f.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,o,s]}function oa(e,t,n){const o=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let a=Lu(e,Math.max(s,0));o.length===1&&(a=a.filter(d=>d!==n));const l=a.find(d=>d.textValue.toLowerCase().startsWith(o.toLowerCase()));return l!==n?l:void 0}function Lu(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Fu=Os,$u=Ds,zu=Ls,Ru=Fs,Wu=$s,Bu=zs,Hu=Hs,Uu=Vs,Vu=Gs,ju=qs,Gu=Ks,Yu=Qs,qu=Js,sa=ea;function Ku({field:e,formValues:t,handleChange:n,handleBlur:r,error:o,apiClient:s}){const a=t[e.name]||"",i=typeof e.disabled=="function"?e.disabled(t):e.disabled,[l,d]=R.useState(e.options||[]),[u,h]=R.useState(!1),g=typeof e.refresh=="function"?e.refresh(t):e.refresh;return R.useEffect(()=>{(async()=>{if(!e.optionsUrl||!s){e.options&&d(e.options);return}h(!0);try{let b=e.optionsUrl,m={};if(e.queryParams){const x=typeof e.queryParams=="function"?e.queryParams(t):e.queryParams;typeof x=="string"?b+=x.startsWith("?")?x:`?${x}`:m={params:x}}const v=await s(b,m),C=v.data||v,E=(Array.isArray(C)?C:[]).map(x=>({value:x[e.valueId||"key"]||x.key,label:x[e.labelId||"value"]||x.value}));d(E),e.name+"_count"in t&&n(e.name+"_count",E.length)}catch(b){console.error("Failed to load options for SelectField:",b),d(e.options||[])}finally{h(!1)}})()},[e.optionsUrl,e.options,s,e.valueId,e.labelId,JSON.stringify(g),JSON.stringify(typeof e.queryParams=="function"?e.queryParams(t):e.queryParams)]),c.jsx(c.Fragment,{children:c.jsxs(Fu,{value:a,onValueChange:p=>n(e.name,p),disabled:i,children:[c.jsxs($u,{id:e.name,onBlur:()=>r(e.name),className:`inline-flex items-center justify-between w-full h-10 rounded-md border px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 bg-background transition-all
60
+ `)},dd=0,At=[];function fd(e){var t=f.useRef([]),n=f.useRef([0,0]),r=f.useRef(),o=f.useState(dd++)[0],s=f.useState(Cs)[0],a=f.useRef(e);f.useEffect(function(){a.current=e},[e]),f.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var m=Du([e.lockRef.current],(e.shards||[]).map(_s),!0).filter(Boolean);return m.forEach(function(v){return v.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),m.forEach(function(v){return v.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var i=f.useCallback(function(m,v){if("touches"in m&&m.touches.length===2||m.type==="wheel"&&m.ctrlKey)return!a.current.allowPinchZoom;var S=Cn(m),k=n.current,E="deltaX"in m?m.deltaX:k[0]-S[0],w="deltaY"in m?m.deltaY:k[1]-S[1],x,A=m.target,O=Math.abs(E)>Math.abs(w)?"h":"v";if("touches"in m&&O==="h"&&A.type==="range")return!1;var T=window.getSelection(),$=T&&T.anchorNode,z=$?$===A||$.contains(A):!1;if(z)return!1;var H=ks(O,A);if(!H)return!0;if(H?x=O:(x=O==="v"?"h":"v",H=ks(O,A)),!H)return!1;if(!r.current&&"changedTouches"in m&&(E||w)&&(r.current=x),!x)return!0;var Y=r.current||x;return cd(Y,v,m,Y==="h"?E:w)},[]),l=f.useCallback(function(m){var v=m;if(!(!At.length||At[At.length-1]!==s)){var S="deltaY"in v?Ps(v):Cn(v),k=t.current.filter(function(x){return x.name===v.type&&(x.target===v.target||v.target===x.shadowParent)&&ld(x.delta,S)})[0];if(k&&k.should){v.cancelable&&v.preventDefault();return}if(!k){var E=(a.current.shards||[]).map(_s).filter(Boolean).filter(function(x){return x.contains(v.target)}),w=E.length>0?i(v,E[0]):!a.current.noIsolation;w&&v.cancelable&&v.preventDefault()}}},[]),u=f.useCallback(function(m,v,S,k){var E={name:m,delta:v,target:S,should:k,shadowParent:pd(S)};t.current.push(E),setTimeout(function(){t.current=t.current.filter(function(w){return w!==E})},1)},[]),d=f.useCallback(function(m){n.current=Cn(m),r.current=void 0},[]),h=f.useCallback(function(m){u(m.type,Ps(m),m.target,i(m,e.lockRef.current))},[]),g=f.useCallback(function(m){u(m.type,Cn(m),m.target,i(m,e.lockRef.current))},[]);f.useEffect(function(){return At.push(s),e.setCallbacks({onScrollCapture:h,onWheelCapture:h,onTouchMoveCapture:g}),document.addEventListener("wheel",l,kt),document.addEventListener("touchmove",l,kt),document.addEventListener("touchstart",d,kt),function(){At=At.filter(function(m){return m!==s}),document.removeEventListener("wheel",l,kt),document.removeEventListener("touchmove",l,kt),document.removeEventListener("touchstart",d,kt)}},[]);var p=e.removeScrollBar,b=e.inert;return f.createElement(f.Fragment,null,b?f.createElement(s,{styles:ud(o)}):null,p?f.createElement(td,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function pd(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const md=Hu(Ss,fd);var Pr=f.forwardRef(function(e,t){return f.createElement(xn,We({},e,{ref:t,sideCar:md}))});Pr.classNames=xn.classNames;var hd=[" ","Enter","ArrowUp","ArrowDown"],gd=[" ","Enter"],dt="Select",[En,Nn,bd]=vo(dt),[Tt]=ct(dt,[bd,gn]),kn=gn(),[yd,Je]=Tt(dt),[vd,wd]=Tt(dt),Os=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:o,onOpenChange:s,value:a,defaultValue:i,onValueChange:l,dir:u,name:d,autoComplete:h,disabled:g,required:p,form:b}=e,m=kn(t),[v,S]=f.useState(null),[k,E]=f.useState(null),[w,x]=f.useState(!1),A=tr(u),[O,T]=Rt({prop:r,defaultProp:o??!1,onChange:s,caller:dt}),[$,z]=Rt({prop:a,defaultProp:i,onChange:l,caller:dt}),H=f.useRef(null),Y=v?b||!!v.closest("form"):!0,[D,C]=f.useState(new Set),P=Array.from(D).map(_=>_.props.value).join(";");return c.jsx(fs,{...m,children:c.jsxs(yd,{required:p,scope:t,trigger:v,onTriggerChange:S,valueNode:k,onValueNodeChange:E,valueNodeHasChildren:w,onValueNodeHasChildrenChange:x,contentId:Ft(),value:$,onValueChange:z,open:O,onOpenChange:T,dir:A,triggerPointerDownPosRef:H,disabled:g,children:[c.jsx(En.Provider,{scope:t,children:c.jsx(vd,{scope:e.__scopeSelect,onNativeOptionAdd:f.useCallback(_=>{C(F=>new Set(F).add(_))},[]),onNativeOptionRemove:f.useCallback(_=>{C(F=>{const N=new Set(F);return N.delete(_),N})},[]),children:n})}),Y?c.jsxs(ta,{"aria-hidden":!0,required:p,tabIndex:-1,name:d,autoComplete:h,value:$,onChange:_=>z(_.target.value),disabled:g,form:b,children:[$===void 0?c.jsx("option",{value:""}):null,Array.from(D)]},P):null]})})};Os.displayName=dt;var Ms="SelectTrigger",Ds=f.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...o}=e,s=kn(n),a=Je(Ms,n),i=a.disabled||r,l=ce(t,a.onTriggerChange),u=Nn(n),d=f.useRef("touch"),[h,g,p]=ra(m=>{const v=u().filter(E=>!E.disabled),S=v.find(E=>E.value===a.value),k=oa(v,m,S);k!==void 0&&a.onValueChange(k.value)}),b=m=>{i||(a.onOpenChange(!0),p()),m&&(a.triggerPointerDownPosRef.current={x:Math.round(m.pageX),y:Math.round(m.pageY)})};return c.jsx(Sr,{asChild:!0,...s,children:c.jsx(Ae.button,{type:"button",role:"combobox","aria-controls":a.contentId,"aria-expanded":a.open,"aria-required":a.required,"aria-autocomplete":"none",dir:a.dir,"data-state":a.open?"open":"closed",disabled:i,"data-disabled":i?"":void 0,"data-placeholder":na(a.value)?"":void 0,...o,ref:l,onClick:J(o.onClick,m=>{m.currentTarget.focus(),d.current!=="mouse"&&b(m)}),onPointerDown:J(o.onPointerDown,m=>{d.current=m.pointerType;const v=m.target;v.hasPointerCapture(m.pointerId)&&v.releasePointerCapture(m.pointerId),m.button===0&&m.ctrlKey===!1&&m.pointerType==="mouse"&&(b(m),m.preventDefault())}),onKeyDown:J(o.onKeyDown,m=>{const v=h.current!=="";!(m.ctrlKey||m.altKey||m.metaKey)&&m.key.length===1&&g(m.key),!(v&&m.key===" ")&&hd.includes(m.key)&&(b(),m.preventDefault())})})})});Ds.displayName=Ms;var Is="SelectValue",Ls=f.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,children:s,placeholder:a="",...i}=e,l=Je(Is,n),{onValueNodeHasChildrenChange:u}=l,d=s!==void 0,h=ce(t,l.onValueNodeChange);return ye(()=>{u(d)},[u,d]),c.jsx(Ae.span,{...i,ref:h,style:{pointerEvents:"none"},children:na(l.value)?c.jsx(c.Fragment,{children:a}):s})});Ls.displayName=Is;var xd="SelectIcon",Fs=f.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...o}=e;return c.jsx(Ae.span,{"aria-hidden":!0,...o,ref:t,children:r||"▼"})});Fs.displayName=xd;var Sd="SelectPortal",$s=e=>c.jsx(Cr,{asChild:!0,...e});$s.displayName=Sd;var ft="SelectContent",zs=f.forwardRef((e,t)=>{const n=Je(ft,e.__scopeSelect),[r,o]=f.useState();if(ye(()=>{o(new DocumentFragment)},[]),!n.open){const s=r;return s?rn.createPortal(c.jsx(Rs,{scope:e.__scopeSelect,children:c.jsx(En.Slot,{scope:e.__scopeSelect,children:c.jsx("div",{children:e.children})})}),s):null}return c.jsx(Ws,{...e,ref:t})});zs.displayName=ft;var Me=10,[Rs,et]=Tt(ft),Cd="SelectContentImpl",Ed=Ce("SelectContent.RemoveScroll"),Ws=f.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:s,onPointerDownOutside:a,side:i,sideOffset:l,align:u,alignOffset:d,arrowPadding:h,collisionBoundary:g,collisionPadding:p,sticky:b,hideWhenDetached:m,avoidCollisions:v,...S}=e,k=Je(ft,n),[E,w]=f.useState(null),[x,A]=f.useState(null),O=ce(t,V=>w(V)),[T,$]=f.useState(null),[z,H]=f.useState(null),Y=Nn(n),[D,C]=f.useState(!1),P=f.useRef(!1);f.useEffect(()=>{if(E)return ys(E)},[E]),No();const _=f.useCallback(V=>{const[ee,...Q]=Y().map(ae=>ae.ref.current),[te]=Q.slice(-1),ne=document.activeElement;for(const ae of V)if(ae===ne||(ae?.scrollIntoView({block:"nearest"}),ae===ee&&x&&(x.scrollTop=0),ae===te&&x&&(x.scrollTop=x.scrollHeight),ae?.focus(),document.activeElement!==ne))return},[Y,x]),F=f.useCallback(()=>_([T,E]),[_,T,E]);f.useEffect(()=>{D&&F()},[D,F]);const{onOpenChange:N,triggerPointerDownPosRef:M}=k;f.useEffect(()=>{if(E){let V={x:0,y:0};const ee=te=>{V={x:Math.abs(Math.round(te.pageX)-(M.current?.x??0)),y:Math.abs(Math.round(te.pageY)-(M.current?.y??0))}},Q=te=>{V.x<=10&&V.y<=10?te.preventDefault():E.contains(te.target)||N(!1),document.removeEventListener("pointermove",ee),M.current=null};return M.current!==null&&(document.addEventListener("pointermove",ee),document.addEventListener("pointerup",Q,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ee),document.removeEventListener("pointerup",Q,{capture:!0})}}},[E,N,M]),f.useEffect(()=>{const V=()=>N(!1);return window.addEventListener("blur",V),window.addEventListener("resize",V),()=>{window.removeEventListener("blur",V),window.removeEventListener("resize",V)}},[N]);const[I,j]=ra(V=>{const ee=Y().filter(ne=>!ne.disabled),Q=ee.find(ne=>ne.ref.current===document.activeElement),te=oa(ee,V,Q);te&&setTimeout(()=>te.ref.current.focus())}),se=f.useCallback((V,ee,Q)=>{const te=!P.current&&!Q;(k.value!==void 0&&k.value===ee||te)&&($(V),te&&(P.current=!0))},[k.value]),Z=f.useCallback(()=>E?.focus(),[E]),ge=f.useCallback((V,ee,Q)=>{const te=!P.current&&!Q;(k.value!==void 0&&k.value===ee||te)&&H(V)},[k.value]),q=r==="popper"?_r:Bs,oe=q===_r?{side:i,sideOffset:l,align:u,alignOffset:d,arrowPadding:h,collisionBoundary:g,collisionPadding:p,sticky:b,hideWhenDetached:m,avoidCollisions:v}:{};return c.jsx(Rs,{scope:n,content:E,viewport:x,onViewportChange:A,itemRefCallback:se,selectedItem:T,onItemLeave:Z,itemTextRefCallback:ge,focusSelectedItem:F,selectedItemText:z,position:r,isPositioned:D,searchRef:I,children:c.jsx(Pr,{as:Ed,allowPinchZoom:!0,children:c.jsx(ir,{asChild:!0,trapped:k.open,onMountAutoFocus:V=>{V.preventDefault()},onUnmountAutoFocus:J(o,V=>{k.trigger?.focus({preventScroll:!0}),V.preventDefault()}),children:c.jsx(rr,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:a,onFocusOutside:V=>V.preventDefault(),onDismiss:()=>k.onOpenChange(!1),children:c.jsx(q,{role:"listbox",id:k.contentId,"data-state":k.open?"open":"closed",dir:k.dir,onContextMenu:V=>V.preventDefault(),...S,...oe,onPlaced:()=>C(!0),ref:O,style:{display:"flex",flexDirection:"column",outline:"none",...S.style},onKeyDown:J(S.onKeyDown,V=>{const ee=V.ctrlKey||V.altKey||V.metaKey;if(V.key==="Tab"&&V.preventDefault(),!ee&&V.key.length===1&&j(V.key),["ArrowUp","ArrowDown","Home","End"].includes(V.key)){let te=Y().filter(ne=>!ne.disabled).map(ne=>ne.ref.current);if(["ArrowUp","End"].includes(V.key)&&(te=te.slice().reverse()),["ArrowUp","ArrowDown"].includes(V.key)){const ne=V.target,ae=te.indexOf(ne);te=te.slice(ae+1)}setTimeout(()=>_(te)),V.preventDefault()}})})})})})})});Ws.displayName=Cd;var Nd="SelectItemAlignedPosition",Bs=f.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...o}=e,s=Je(ft,n),a=et(ft,n),[i,l]=f.useState(null),[u,d]=f.useState(null),h=ce(t,O=>d(O)),g=Nn(n),p=f.useRef(!1),b=f.useRef(!0),{viewport:m,selectedItem:v,selectedItemText:S,focusSelectedItem:k}=a,E=f.useCallback(()=>{if(s.trigger&&s.valueNode&&i&&u&&m&&v&&S){const O=s.trigger.getBoundingClientRect(),T=u.getBoundingClientRect(),$=s.valueNode.getBoundingClientRect(),z=S.getBoundingClientRect();if(s.dir!=="rtl"){const ne=z.left-T.left,ae=$.left-ne,le=O.left-ae,he=O.width+le,Le=Math.max(he,T.width),gt=window.innerWidth-Me,bt=bo(ae,[Me,Math.max(Me,gt-Le)]);i.style.minWidth=he+"px",i.style.left=bt+"px"}else{const ne=T.right-z.right,ae=window.innerWidth-$.right-ne,le=window.innerWidth-O.right-ae,he=O.width+le,Le=Math.max(he,T.width),gt=window.innerWidth-Me,bt=bo(ae,[Me,Math.max(Me,gt-Le)]);i.style.minWidth=he+"px",i.style.right=bt+"px"}const H=g(),Y=window.innerHeight-Me*2,D=m.scrollHeight,C=window.getComputedStyle(u),P=parseInt(C.borderTopWidth,10),_=parseInt(C.paddingTop,10),F=parseInt(C.borderBottomWidth,10),N=parseInt(C.paddingBottom,10),M=P+_+D+N+F,I=Math.min(v.offsetHeight*5,M),j=window.getComputedStyle(m),se=parseInt(j.paddingTop,10),Z=parseInt(j.paddingBottom,10),ge=O.top+O.height/2-Me,q=Y-ge,oe=v.offsetHeight/2,V=v.offsetTop+oe,ee=P+_+V,Q=M-ee;if(ee<=ge){const ne=H.length>0&&v===H[H.length-1].ref.current;i.style.bottom="0px";const ae=u.clientHeight-m.offsetTop-m.offsetHeight,le=Math.max(q,oe+(ne?Z:0)+ae+F),he=ee+le;i.style.height=he+"px"}else{const ne=H.length>0&&v===H[0].ref.current;i.style.top="0px";const le=Math.max(ge,P+m.offsetTop+(ne?se:0)+oe)+Q;i.style.height=le+"px",m.scrollTop=ee-ge+m.offsetTop}i.style.margin=`${Me}px 0`,i.style.minHeight=I+"px",i.style.maxHeight=Y+"px",r?.(),requestAnimationFrame(()=>p.current=!0)}},[g,s.trigger,s.valueNode,i,u,m,v,S,s.dir,r]);ye(()=>E(),[E]);const[w,x]=f.useState();ye(()=>{u&&x(window.getComputedStyle(u).zIndex)},[u]);const A=f.useCallback(O=>{O&&b.current===!0&&(E(),k?.(),b.current=!1)},[E,k]);return c.jsx(Ad,{scope:n,contentWrapper:i,shouldExpandOnScrollRef:p,onScrollButtonChange:A,children:c.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:w},children:c.jsx(Ae.div,{...o,ref:h,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});Bs.displayName=Nd;var kd="SelectPopperPosition",_r=f.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=Me,...s}=e,a=kn(n);return c.jsx(ps,{...a,...s,ref:t,align:r,collisionPadding:o,style:{boxSizing:"border-box",...s.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});_r.displayName=kd;var[Ad,Or]=Tt(ft,{}),Mr="SelectViewport",Hs=f.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...o}=e,s=et(Mr,n),a=Or(Mr,n),i=ce(t,s.onViewportChange),l=f.useRef(0);return c.jsxs(c.Fragment,{children:[c.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),c.jsx(En.Slot,{scope:n,children:c.jsx(Ae.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:i,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:J(o.onScroll,u=>{const d=u.currentTarget,{contentWrapper:h,shouldExpandOnScrollRef:g}=a;if(g?.current&&h){const p=Math.abs(l.current-d.scrollTop);if(p>0){const b=window.innerHeight-Me*2,m=parseFloat(h.style.minHeight),v=parseFloat(h.style.height),S=Math.max(m,v);if(S<b){const k=S+p,E=Math.min(b,k),w=k-E;h.style.height=E+"px",h.style.bottom==="0px"&&(d.scrollTop=w>0?w:0,h.style.justifyContent="flex-end")}}}l.current=d.scrollTop})})})]})});Hs.displayName=Mr;var Us="SelectGroup",[Td,Pd]=Tt(Us),Vs=f.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Ft();return c.jsx(Td,{scope:n,id:o,children:c.jsx(Ae.div,{role:"group","aria-labelledby":o,...r,ref:t})})});Vs.displayName=Us;var js="SelectLabel",Gs=f.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Pd(js,n);return c.jsx(Ae.div,{id:o.id,...r,ref:t})});Gs.displayName=js;var An="SelectItem",[_d,Ys]=Tt(An),qs=f.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:o=!1,textValue:s,...a}=e,i=Je(An,n),l=et(An,n),u=i.value===r,[d,h]=f.useState(s??""),[g,p]=f.useState(!1),b=ce(t,k=>l.itemRefCallback?.(k,r,o)),m=Ft(),v=f.useRef("touch"),S=()=>{o||(i.onValueChange(r),i.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return c.jsx(_d,{scope:n,value:r,disabled:o,textId:m,isSelected:u,onItemTextChange:f.useCallback(k=>{h(E=>E||(k?.textContent??"").trim())},[]),children:c.jsx(En.ItemSlot,{scope:n,value:r,disabled:o,textValue:d,children:c.jsx(Ae.div,{role:"option","aria-labelledby":m,"data-highlighted":g?"":void 0,"aria-selected":u&&g,"data-state":u?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...a,ref:b,onFocus:J(a.onFocus,()=>p(!0)),onBlur:J(a.onBlur,()=>p(!1)),onClick:J(a.onClick,()=>{v.current!=="mouse"&&S()}),onPointerUp:J(a.onPointerUp,()=>{v.current==="mouse"&&S()}),onPointerDown:J(a.onPointerDown,k=>{v.current=k.pointerType}),onPointerMove:J(a.onPointerMove,k=>{v.current=k.pointerType,o?l.onItemLeave?.():v.current==="mouse"&&k.currentTarget.focus({preventScroll:!0})}),onPointerLeave:J(a.onPointerLeave,k=>{k.currentTarget===document.activeElement&&l.onItemLeave?.()}),onKeyDown:J(a.onKeyDown,k=>{l.searchRef?.current!==""&&k.key===" "||(gd.includes(k.key)&&S(),k.key===" "&&k.preventDefault())})})})})});qs.displayName=An;var Wt="SelectItemText",Ks=f.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,...s}=e,a=Je(Wt,n),i=et(Wt,n),l=Ys(Wt,n),u=wd(Wt,n),[d,h]=f.useState(null),g=ce(t,S=>h(S),l.onItemTextChange,S=>i.itemTextRefCallback?.(S,l.value,l.disabled)),p=d?.textContent,b=f.useMemo(()=>c.jsx("option",{value:l.value,disabled:l.disabled,children:p},l.value),[l.disabled,l.value,p]),{onNativeOptionAdd:m,onNativeOptionRemove:v}=u;return ye(()=>(m(b),()=>v(b)),[m,v,b]),c.jsxs(c.Fragment,{children:[c.jsx(Ae.span,{id:l.textId,...s,ref:g}),l.isSelected&&a.valueNode&&!a.valueNodeHasChildren?rn.createPortal(s.children,a.valueNode):null]})});Ks.displayName=Wt;var Xs="SelectItemIndicator",Od=f.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return Ys(Xs,n).isSelected?c.jsx(Ae.span,{"aria-hidden":!0,...r,ref:t}):null});Od.displayName=Xs;var Dr="SelectScrollUpButton",Qs=f.forwardRef((e,t)=>{const n=et(Dr,e.__scopeSelect),r=Or(Dr,e.__scopeSelect),[o,s]=f.useState(!1),a=ce(t,r.onScrollButtonChange);return ye(()=>{if(n.viewport&&n.isPositioned){let i=function(){const u=l.scrollTop>0;s(u)};const l=n.viewport;return i(),l.addEventListener("scroll",i),()=>l.removeEventListener("scroll",i)}},[n.viewport,n.isPositioned]),o?c.jsx(Zs,{...e,ref:a,onAutoScroll:()=>{const{viewport:i,selectedItem:l}=n;i&&l&&(i.scrollTop=i.scrollTop-l.offsetHeight)}}):null});Qs.displayName=Dr;var Ir="SelectScrollDownButton",Md=f.forwardRef((e,t)=>{const n=et(Ir,e.__scopeSelect),r=Or(Ir,e.__scopeSelect),[o,s]=f.useState(!1),a=ce(t,r.onScrollButtonChange);return ye(()=>{if(n.viewport&&n.isPositioned){let i=function(){const u=l.scrollHeight-l.clientHeight,d=Math.ceil(l.scrollTop)<u;s(d)};const l=n.viewport;return i(),l.addEventListener("scroll",i),()=>l.removeEventListener("scroll",i)}},[n.viewport,n.isPositioned]),o?c.jsx(Zs,{...e,ref:a,onAutoScroll:()=>{const{viewport:i,selectedItem:l}=n;i&&l&&(i.scrollTop=i.scrollTop+l.offsetHeight)}}):null});Md.displayName=Ir;var Zs=f.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...o}=e,s=et("SelectScrollButton",n),a=f.useRef(null),i=Nn(n),l=f.useCallback(()=>{a.current!==null&&(window.clearInterval(a.current),a.current=null)},[]);return f.useEffect(()=>()=>l(),[l]),ye(()=>{i().find(d=>d.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[i]),c.jsx(Ae.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:J(o.onPointerDown,()=>{a.current===null&&(a.current=window.setInterval(r,50))}),onPointerMove:J(o.onPointerMove,()=>{s.onItemLeave?.(),a.current===null&&(a.current=window.setInterval(r,50))}),onPointerLeave:J(o.onPointerLeave,()=>{l()})})}),Dd="SelectSeparator",Js=f.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return c.jsx(Ae.div,{"aria-hidden":!0,...r,ref:t})});Js.displayName=Dd;var Lr="SelectArrow",ea=f.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=kn(n),s=Je(Lr,n),a=et(Lr,n);return s.open&&a.position==="popper"?c.jsx(ms,{...o,...r,ref:t}):null});ea.displayName=Lr;var Id="SelectBubbleInput",ta=f.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const o=f.useRef(null),s=ce(r,o),a=hs(t);return f.useEffect(()=>{const i=o.current;if(!i)return;const l=window.HTMLSelectElement.prototype,d=Object.getOwnPropertyDescriptor(l,"value").set;if(a!==t&&d){const h=new Event("change",{bubbles:!0});d.call(i,t),i.dispatchEvent(h)}},[a,t]),c.jsx(Ae.select,{...n,style:{...gs,...n.style},ref:s,defaultValue:t})});ta.displayName=Id;function na(e){return e===""||e===void 0}function ra(e){const t=Ke(e),n=f.useRef(""),r=f.useRef(0),o=f.useCallback(a=>{const i=n.current+a;t(i),(function l(u){n.current=u,window.clearTimeout(r.current),u!==""&&(r.current=window.setTimeout(()=>l(""),1e3))})(i)},[t]),s=f.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return f.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,o,s]}function oa(e,t,n){const o=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let a=Ld(e,Math.max(s,0));o.length===1&&(a=a.filter(u=>u!==n));const l=a.find(u=>u.textValue.toLowerCase().startsWith(o.toLowerCase()));return l!==n?l:void 0}function Ld(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Fd=Os,$d=Ds,zd=Ls,Rd=Fs,Wd=$s,Bd=zs,Hd=Hs,Ud=Vs,Vd=Gs,jd=qs,Gd=Ks,Yd=Qs,qd=Js,sa=ea;function Kd({field:e,formValues:t,handleChange:n,handleBlur:r,error:o,apiClient:s}){const a=t[e.name]||"",i=typeof e.disabled=="function"?e.disabled(t):e.disabled,[l,u]=R.useState(e.options||[]),[d,h]=R.useState(!1),g=typeof e.refresh=="function"?e.refresh(t):e.refresh;return R.useEffect(()=>{(async()=>{if(!e.optionsUrl||!s){e.options&&u(e.options);return}h(!0);try{let b=e.optionsUrl,m={};if(e.queryParams){const w=typeof e.queryParams=="function"?e.queryParams(t):e.queryParams;typeof w=="string"?b+=w.startsWith("?")?w:`?${w}`:m={params:w}}const v=await s(b,m),S=v.data||v,E=(Array.isArray(S)?S:[]).map(w=>({value:w[e.valueId||"key"]||w.key,label:w[e.labelId||"value"]||w.value}));u(E),e.name+"_count"in t&&n(e.name+"_count",E.length)}catch(b){console.error("Failed to load options for SelectField:",b),u(e.options||[])}finally{h(!1)}})()},[e.optionsUrl,e.options,s,e.valueId,e.labelId,JSON.stringify(g),JSON.stringify(typeof e.queryParams=="function"?e.queryParams(t):e.queryParams)]),c.jsx(c.Fragment,{children:c.jsxs(Fd,{value:a,onValueChange:p=>n(e.name,p),disabled:i,children:[c.jsxs($d,{id:e.name,onBlur:()=>r(e.name),className:`inline-flex items-center justify-between w-full h-10 rounded-md border px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 bg-background transition-all
61
61
  ${o?"border-red-500 focus-visible:ring-red-500":"border-input focus-visible:ring-blue-500"}
62
62
  ${i?"cursor-not-allowed opacity-50":""}
63
- `,children:[c.jsx(zu,{placeholder:u?"Loading...":e.placeholder||`Select ${e.label?.toLowerCase()||""}`}),c.jsx(Ru,{className:"ml-2 text-gray-500 flex items-center",children:u?c.jsx(go,{className:"w-4 h-4 animate-spin"}):c.jsx(on,{className:"w-4 h-4"})})]}),c.jsx(Wu,{children:c.jsxs(Bu,{className:"bg-white border border-gray-200 rounded-md shadow-lg z-50 min-w-[var(--radix-select-trigger-width)]",position:"popper",sideOffset:5,children:[c.jsx(Yu,{className:"flex items-center justify-center h-6 text-gray-500 bg-gray-50",children:c.jsx(sa,{className:"fill-white stroke-gray-200"})}),c.jsxs(Hu,{className:"p-1",children:[e.groupLabel&&c.jsx(Uu,{children:c.jsx(Vu,{className:"px-2 py-1 text-xs text-gray-500 uppercase tracking-wide",children:e.groupLabel})}),l.map(p=>c.jsx(ju,{value:p.value,className:`relative flex items-center px-3 py-2 text-sm rounded cursor-pointer select-none
63
+ `,children:[c.jsx(zd,{placeholder:d?"Loading...":e.placeholder||`Select ${e.label?.toLowerCase()||""}`}),c.jsx(Rd,{className:"ml-2 text-gray-500 flex items-center",children:d?c.jsx(go,{className:"w-4 h-4 animate-spin"}):c.jsx(on,{className:"w-4 h-4"})})]}),c.jsx(Wd,{children:c.jsxs(Bd,{className:"bg-white border border-gray-200 rounded-md shadow-lg z-50 min-w-[var(--radix-select-trigger-width)]",position:"popper",sideOffset:5,children:[c.jsx(Yd,{className:"flex items-center justify-center h-6 text-gray-500 bg-gray-50",children:c.jsx(sa,{className:"fill-white stroke-gray-200"})}),c.jsxs(Hd,{className:"p-1",children:[e.groupLabel&&c.jsx(Ud,{children:c.jsx(Vd,{className:"px-2 py-1 text-xs text-gray-500 uppercase tracking-wide",children:e.groupLabel})}),l.map(p=>c.jsx(jd,{value:p.value,className:`relative flex items-center px-3 py-2 text-sm rounded cursor-pointer select-none
64
64
  data-[state=checked]:bg-blue-50
65
65
  data-[state=checked]:text-blue-600
66
- `,children:c.jsx(Gu,{children:p.label})},p.value)),e.separator&&c.jsx(qu,{className:"my-1 h-px bg-gray-200"})]}),c.jsx(sa,{className:"fill-white stroke-gray-200"})]})})]})})}function Xu({field:e,formValues:t,handleChange:n,handleBlur:r,error:o,disabled:s}){const a=s;return c.jsx(c.Fragment,{children:c.jsx("input",{...e.props,type:"email",value:t[e.name]||"",onChange:i=>{a||n(e.name,i.target.value)},onBlur:()=>r(e.name),disabled:a,readOnly:a,name:e.name,placeholder:e.placeholder,className:`flex h-10 w-full rounded-md border px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 ${o?"border-red-500 focus-visible:ring-red-500":"border-input focus-visible:ring-blue-500"} ${a?"bg-gray-100 text-gray-500 cursor-not-allowed":"bg-background"}`})})}function aa({field:e,formValues:t,handleChange:n,handleBlur:r,error:o,disabled:s,...a}){const{apiClient:i,api_URL:l,charCount:d,setCharCounts:u,fileInputRefs:h,...g}=a,p=s,b=g["aria-describedby"];return c.jsx("input",{...e.props,...g,id:e.name,name:e.name,type:e.type||"text",value:t[e.name]||"",onChange:m=>n(e.name,m.target.value),onBlur:()=>r(e.name),disabled:p,placeholder:e.placeholder||"",minLength:e.minLength,maxLength:e.maxLength,"aria-invalid":!!o,"aria-describedby":o?b:void 0,className:`
66
+ `,children:c.jsx(Gd,{children:p.label})},p.value)),e.separator&&c.jsx(qd,{className:"my-1 h-px bg-gray-200"})]}),c.jsx(sa,{className:"fill-white stroke-gray-200"})]})})]})})}function Xd({field:e,formValues:t,handleChange:n,handleBlur:r,error:o,disabled:s}){const a=s;return c.jsx(c.Fragment,{children:c.jsx("input",{...e.props,type:"email",value:t[e.name]||"",onChange:i=>{a||n(e.name,i.target.value)},onBlur:()=>r(e.name),disabled:a,readOnly:a,name:e.name,placeholder:e.placeholder,className:`flex h-10 w-full rounded-md border px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 ${o?"border-red-500 focus-visible:ring-red-500":"border-input focus-visible:ring-blue-500"} ${a?"bg-gray-100 text-gray-500 cursor-not-allowed":"bg-background"}`})})}function aa({field:e,formValues:t,handleChange:n,handleBlur:r,error:o,disabled:s,...a}){const{apiClient:i,api_URL:l,charCount:u,setCharCounts:d,fileInputRefs:h,...g}=a,p=s,b=g["aria-describedby"];return c.jsx("input",{...e.props,...g,id:e.name,name:e.name,type:e.type||"text",value:t[e.name]||"",onChange:m=>n(e.name,m.target.value),onBlur:()=>r(e.name),disabled:p,placeholder:e.placeholder||"",minLength:e.minLength,maxLength:e.maxLength,"aria-invalid":!!o,"aria-describedby":o?b:void 0,className:`
67
67
  flex h-10 w-full rounded-md border px-3 py-2 text-sm
68
68
  transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium
69
69
  placeholder:text-muted-foreground
@@ -72,7 +72,7 @@
72
72
  ${o?"border-destructive focus-visible:ring-destructive":"border-input focus-visible:ring-ring"}
73
73
  ${p?"bg-muted text-muted-foreground":"bg-background text-foreground"}
74
74
  ${e.className||""}
75
- `})}function Qu({field:e,formValues:t,handleChange:n,handleBlur:r,error:o,disabled:s,...a}){const{apiClient:i,api_URL:l,charCount:d,setCharCounts:u,fileInputRefs:h,...g}=a,p=s,b=g["aria-describedby"];return c.jsx("input",{...e.props,...g,id:e.name,name:e.name,type:"number",value:t[e.name]??"",onChange:m=>n(e.name,m.target.value),onBlur:()=>r(e.name),disabled:p,placeholder:e.placeholder||"",min:e.min,max:e.max,step:e.step||"any","aria-invalid":!!o,"aria-describedby":o?b:void 0,className:`
75
+ `})}function Qd({field:e,formValues:t,handleChange:n,handleBlur:r,error:o,disabled:s,...a}){const{apiClient:i,api_URL:l,charCount:u,setCharCounts:d,fileInputRefs:h,...g}=a,p=s,b=g["aria-describedby"];return c.jsx("input",{...e.props,...g,id:e.name,name:e.name,type:"number",value:t[e.name]??"",onChange:m=>n(e.name,m.target.value),onBlur:()=>r(e.name),disabled:p,placeholder:e.placeholder||"",min:e.min,max:e.max,step:e.step||"any","aria-invalid":!!o,"aria-describedby":o?b:void 0,className:`
76
76
  flex h-10 w-full rounded-md border px-3 py-2 text-sm
77
77
  transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium
78
78
  placeholder:text-muted-foreground
@@ -81,22 +81,22 @@
81
81
  ${o?"border-destructive focus-visible:ring-destructive":"border-input focus-visible:ring-ring"}
82
82
  ${p?"bg-muted text-muted-foreground":"bg-background text-foreground"}
83
83
  ${e.className||""}
84
- `})}const{entries:ia,setPrototypeOf:ca,isFrozen:Zu,getPrototypeOf:Ju,getOwnPropertyDescriptor:ef}=Object;let{freeze:we,seal:Pe,create:Bt}=Object,{apply:Fr,construct:$r}=typeof Reflect<"u"&&Reflect;we||(we=function(t){return t}),Pe||(Pe=function(t){return t}),Fr||(Fr=function(t,n){for(var r=arguments.length,o=new Array(r>2?r-2:0),s=2;s<r;s++)o[s-2]=arguments[s];return t.apply(n,o)}),$r||($r=function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return new t(...r)});const Ht=Se(Array.prototype.forEach),tf=Se(Array.prototype.lastIndexOf),la=Se(Array.prototype.pop),Ut=Se(Array.prototype.push),nf=Se(Array.prototype.splice),Tn=Se(String.prototype.toLowerCase),zr=Se(String.prototype.toString),Rr=Se(String.prototype.match),Pt=Se(String.prototype.replace),rf=Se(String.prototype.indexOf),of=Se(String.prototype.trim),De=Se(Object.prototype.hasOwnProperty),xe=Se(RegExp.prototype.test),Vt=sf(TypeError);function Se(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return Fr(e,t,r)}}function sf(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return $r(e,n)}}function X(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Tn;ca&&ca(e,null);let r=t.length;for(;r--;){let o=t[r];if(typeof o=="string"){const s=n(o);s!==o&&(Zu(t)||(t[r]=s),o=s)}e[o]=!0}return e}function af(e){for(let t=0;t<e.length;t++)De(e,t)||(e[t]=null);return e}function Be(e){const t=Bt(null);for(const[n,r]of ia(e))De(e,n)&&(Array.isArray(r)?t[n]=af(r):r&&typeof r=="object"&&r.constructor===Object?t[n]=Be(r):t[n]=r);return t}function jt(e,t){for(;e!==null;){const r=ef(e,t);if(r){if(r.get)return Se(r.get);if(typeof r.value=="function")return Se(r.value)}e=Ju(e)}function n(){return null}return n}const da=we(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Wr=we(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Br=we(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),cf=we(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Hr=we(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),lf=we(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),ua=we(["#text"]),fa=we(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),Ur=we(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),pa=we(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Pn=we(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),df=Pe(/\{\{[\w\W]*|[\w\W]*\}\}/gm),uf=Pe(/<%[\w\W]*|[\w\W]*%>/gm),ff=Pe(/\$\{[\w\W]*/gm),pf=Pe(/^data-[\-\w.\u00B7-\uFFFF]+$/),mf=Pe(/^aria-[\-\w]+$/),ma=Pe(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),hf=Pe(/^(?:\w+script|data):/i),gf=Pe(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),ha=Pe(/^html$/i),bf=Pe(/^[a-z][.\w]*(-[.\w]+)+$/i);var ga=Object.freeze({__proto__:null,ARIA_ATTR:mf,ATTR_WHITESPACE:gf,CUSTOM_ELEMENT:bf,DATA_ATTR:pf,DOCTYPE_NAME:ha,ERB_EXPR:uf,IS_ALLOWED_URI:ma,IS_SCRIPT_OR_DATA:hf,MUSTACHE_EXPR:df,TMPLIT_EXPR:ff});const Gt={element:1,text:3,progressingInstruction:7,comment:8,document:9},yf=function(){return typeof window>"u"?null:window},vf=function(t,n){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let r=null;const o="data-tt-policy-suffix";n&&n.hasAttribute(o)&&(r=n.getAttribute(o));const s="dompurify"+(r?"#"+r:"");try{return t.createPolicy(s,{createHTML(a){return a},createScriptURL(a){return a}})}catch{return console.warn("TrustedTypes policy "+s+" could not be created."),null}},ba=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function ya(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:yf();const t=j=>ya(j);if(t.version="3.4.0",t.removed=[],!e||!e.document||e.document.nodeType!==Gt.document||!e.Element)return t.isSupported=!1,t;let{document:n}=e;const r=n,o=r.currentScript,{DocumentFragment:s,HTMLTemplateElement:a,Node:i,Element:l,NodeFilter:d,NamedNodeMap:u=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:h,DOMParser:g,trustedTypes:p}=e,b=l.prototype,m=jt(b,"cloneNode"),v=jt(b,"remove"),C=jt(b,"nextSibling"),N=jt(b,"childNodes"),E=jt(b,"parentNode");if(typeof a=="function"){const j=n.createElement("template");j.content&&j.content.ownerDocument&&(n=j.content.ownerDocument)}let x,S="";const{implementation:A,createNodeIterator:_,createDocumentFragment:P,getElementsByTagName:$}=n,{importNode:z}=r;let H=ba();t.isSupported=typeof ia=="function"&&typeof E=="function"&&A&&A.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:G,ERB_EXPR:w,TMPLIT_EXPR:k,DATA_ATTR:D,ARIA_ATTR:O,IS_SCRIPT_OR_DATA:I,ATTR_WHITESPACE:T,CUSTOM_ELEMENT:F}=ga;let{IS_ALLOWED_URI:M}=ga,q=null;const de=X({},[...da,...Wr,...Br,...Hr,...ua]);let Z=null;const ge=X({},[...fa,...Ur,...pa,...Pn]);let Y=Object.seal(Bt(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),oe=null,V=null;const ee=Object.seal(Bt(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Q=!0,te=!0,ne=!1,se=!0,ce=!1,he=!0,Le=!1,gt=!1,bt=!1,Mt=!1,Gn=!1,Yn=!1,Di=!0,Ii=!1;const Lh="user-content-";let eo=!0,en=!1,Dt={},He=null;const to=X({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Li=null;const Fi=X({},["audio","video","img","source","image","track"]);let no=null;const $i=X({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),qn="http://www.w3.org/1998/Math/MathML",Kn="http://www.w3.org/2000/svg",Ue="http://www.w3.org/1999/xhtml";let It=Ue,ro=!1,oo=null;const Fh=X({},[qn,Kn,Ue],zr);let Xn=X({},["mi","mo","mn","ms","mtext"]),Qn=X({},["annotation-xml"]);const $h=X({},["title","style","font","a","script"]);let tn=null;const zh=["application/xhtml+xml","text/html"],Rh="text/html";let pe=null,Lt=null;const Wh=n.createElement("form"),zi=function(y){return y instanceof RegExp||y instanceof Function},so=function(){let y=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Lt&&Lt===y)){if((!y||typeof y!="object")&&(y={}),y=Be(y),tn=zh.indexOf(y.PARSER_MEDIA_TYPE)===-1?Rh:y.PARSER_MEDIA_TYPE,pe=tn==="application/xhtml+xml"?zr:Tn,q=De(y,"ALLOWED_TAGS")?X({},y.ALLOWED_TAGS,pe):de,Z=De(y,"ALLOWED_ATTR")?X({},y.ALLOWED_ATTR,pe):ge,oo=De(y,"ALLOWED_NAMESPACES")?X({},y.ALLOWED_NAMESPACES,zr):Fh,no=De(y,"ADD_URI_SAFE_ATTR")?X(Be($i),y.ADD_URI_SAFE_ATTR,pe):$i,Li=De(y,"ADD_DATA_URI_TAGS")?X(Be(Fi),y.ADD_DATA_URI_TAGS,pe):Fi,He=De(y,"FORBID_CONTENTS")?X({},y.FORBID_CONTENTS,pe):to,oe=De(y,"FORBID_TAGS")?X({},y.FORBID_TAGS,pe):Be({}),V=De(y,"FORBID_ATTR")?X({},y.FORBID_ATTR,pe):Be({}),Dt=De(y,"USE_PROFILES")?y.USE_PROFILES:!1,Q=y.ALLOW_ARIA_ATTR!==!1,te=y.ALLOW_DATA_ATTR!==!1,ne=y.ALLOW_UNKNOWN_PROTOCOLS||!1,se=y.ALLOW_SELF_CLOSE_IN_ATTR!==!1,ce=y.SAFE_FOR_TEMPLATES||!1,he=y.SAFE_FOR_XML!==!1,Le=y.WHOLE_DOCUMENT||!1,Mt=y.RETURN_DOM||!1,Gn=y.RETURN_DOM_FRAGMENT||!1,Yn=y.RETURN_TRUSTED_TYPE||!1,bt=y.FORCE_BODY||!1,Di=y.SANITIZE_DOM!==!1,Ii=y.SANITIZE_NAMED_PROPS||!1,eo=y.KEEP_CONTENT!==!1,en=y.IN_PLACE||!1,M=y.ALLOWED_URI_REGEXP||ma,It=y.NAMESPACE||Ue,Xn=y.MATHML_TEXT_INTEGRATION_POINTS||Xn,Qn=y.HTML_INTEGRATION_POINTS||Qn,Y=y.CUSTOM_ELEMENT_HANDLING||Bt(null),y.CUSTOM_ELEMENT_HANDLING&&zi(y.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(Y.tagNameCheck=y.CUSTOM_ELEMENT_HANDLING.tagNameCheck),y.CUSTOM_ELEMENT_HANDLING&&zi(y.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(Y.attributeNameCheck=y.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),y.CUSTOM_ELEMENT_HANDLING&&typeof y.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(Y.allowCustomizedBuiltInElements=y.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),ce&&(te=!1),Gn&&(Mt=!0),Dt&&(q=X({},ua),Z=Bt(null),Dt.html===!0&&(X(q,da),X(Z,fa)),Dt.svg===!0&&(X(q,Wr),X(Z,Ur),X(Z,Pn)),Dt.svgFilters===!0&&(X(q,Br),X(Z,Ur),X(Z,Pn)),Dt.mathMl===!0&&(X(q,Hr),X(Z,pa),X(Z,Pn))),ee.tagCheck=null,ee.attributeCheck=null,y.ADD_TAGS&&(typeof y.ADD_TAGS=="function"?ee.tagCheck=y.ADD_TAGS:(q===de&&(q=Be(q)),X(q,y.ADD_TAGS,pe))),y.ADD_ATTR&&(typeof y.ADD_ATTR=="function"?ee.attributeCheck=y.ADD_ATTR:(Z===ge&&(Z=Be(Z)),X(Z,y.ADD_ATTR,pe))),y.ADD_URI_SAFE_ATTR&&X(no,y.ADD_URI_SAFE_ATTR,pe),y.FORBID_CONTENTS&&(He===to&&(He=Be(He)),X(He,y.FORBID_CONTENTS,pe)),y.ADD_FORBID_CONTENTS&&(He===to&&(He=Be(He)),X(He,y.ADD_FORBID_CONTENTS,pe)),eo&&(q["#text"]=!0),Le&&X(q,["html","head","body"]),q.table&&(X(q,["tbody"]),delete oe.tbody),y.TRUSTED_TYPES_POLICY){if(typeof y.TRUSTED_TYPES_POLICY.createHTML!="function")throw Vt('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof y.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Vt('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');x=y.TRUSTED_TYPES_POLICY,S=x.createHTML("")}else x===void 0&&(x=vf(p,o)),x!==null&&typeof S=="string"&&(S=x.createHTML(""));we&&we(y),Lt=y}},Ri=X({},[...Wr,...Br,...cf]),Wi=X({},[...Hr,...lf]),Bh=function(y){let L=E(y);(!L||!L.tagName)&&(L={namespaceURI:It,tagName:"template"});const U=Tn(y.tagName),le=Tn(L.tagName);return oo[y.namespaceURI]?y.namespaceURI===Kn?L.namespaceURI===Ue?U==="svg":L.namespaceURI===qn?U==="svg"&&(le==="annotation-xml"||Xn[le]):!!Ri[U]:y.namespaceURI===qn?L.namespaceURI===Ue?U==="math":L.namespaceURI===Kn?U==="math"&&Qn[le]:!!Wi[U]:y.namespaceURI===Ue?L.namespaceURI===Kn&&!Qn[le]||L.namespaceURI===qn&&!Xn[le]?!1:!Wi[U]&&($h[U]||!Ri[U]):!!(tn==="application/xhtml+xml"&&oo[y.namespaceURI]):!1},Fe=function(y){Ut(t.removed,{element:y});try{E(y).removeChild(y)}catch{v(y)}},yt=function(y,L){try{Ut(t.removed,{attribute:L.getAttributeNode(y),from:L})}catch{Ut(t.removed,{attribute:null,from:L})}if(L.removeAttribute(y),y==="is")if(Mt||Gn)try{Fe(L)}catch{}else try{L.setAttribute(y,"")}catch{}},Bi=function(y){let L=null,U=null;if(bt)y="<remove></remove>"+y;else{const ue=Rr(y,/^[\r\n\t ]+/);U=ue&&ue[0]}tn==="application/xhtml+xml"&&It===Ue&&(y='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+y+"</body></html>");const le=x?x.createHTML(y):y;if(It===Ue)try{L=new g().parseFromString(le,tn)}catch{}if(!L||!L.documentElement){L=A.createDocument(It,"template",null);try{L.documentElement.innerHTML=ro?S:le}catch{}}const ve=L.body||L.documentElement;return y&&U&&ve.insertBefore(n.createTextNode(U),ve.childNodes[0]||null),It===Ue?$.call(L,Le?"html":"body")[0]:Le?L.documentElement:ve},Hi=function(y){return _.call(y.ownerDocument||y,y,d.SHOW_ELEMENT|d.SHOW_COMMENT|d.SHOW_TEXT|d.SHOW_PROCESSING_INSTRUCTION|d.SHOW_CDATA_SECTION,null)},ao=function(y){return y instanceof h&&(typeof y.nodeName!="string"||typeof y.textContent!="string"||typeof y.removeChild!="function"||!(y.attributes instanceof u)||typeof y.removeAttribute!="function"||typeof y.setAttribute!="function"||typeof y.namespaceURI!="string"||typeof y.insertBefore!="function"||typeof y.hasChildNodes!="function")},io=function(y){return typeof i=="function"&&y instanceof i};function qe(j,y,L){Ht(j,U=>{U.call(t,y,L,Lt)})}const Ui=function(y){let L=null;if(qe(H.beforeSanitizeElements,y,null),ao(y))return Fe(y),!0;const U=pe(y.nodeName);if(qe(H.uponSanitizeElement,y,{tagName:U,allowedTags:q}),he&&y.hasChildNodes()&&!io(y.firstElementChild)&&xe(/<[/\w!]/g,y.innerHTML)&&xe(/<[/\w!]/g,y.textContent)||he&&y.namespaceURI===Ue&&U==="style"&&io(y.firstElementChild)||y.nodeType===Gt.progressingInstruction||he&&y.nodeType===Gt.comment&&xe(/<[/\w]/g,y.data))return Fe(y),!0;if(oe[U]||!(ee.tagCheck instanceof Function&&ee.tagCheck(U))&&!q[U]){if(!oe[U]&&ji(U)&&(Y.tagNameCheck instanceof RegExp&&xe(Y.tagNameCheck,U)||Y.tagNameCheck instanceof Function&&Y.tagNameCheck(U)))return!1;if(eo&&!He[U]){const le=E(y)||y.parentNode,ve=N(y)||y.childNodes;if(ve&&le){const ue=ve.length;for(let Ee=ue-1;Ee>=0;--Ee){const Te=m(ve[Ee],!0);Te.__removalCount=(y.__removalCount||0)+1,le.insertBefore(Te,C(y))}}}return Fe(y),!0}return y instanceof l&&!Bh(y)||(U==="noscript"||U==="noembed"||U==="noframes")&&xe(/<\/no(script|embed|frames)/i,y.innerHTML)?(Fe(y),!0):(ce&&y.nodeType===Gt.text&&(L=y.textContent,Ht([G,w,k],le=>{L=Pt(L,le," ")}),y.textContent!==L&&(Ut(t.removed,{element:y.cloneNode()}),y.textContent=L)),qe(H.afterSanitizeElements,y,null),!1)},Vi=function(y,L,U){if(V[L]||Di&&(L==="id"||L==="name")&&(U in n||U in Wh))return!1;if(!(te&&!V[L]&&xe(D,L))){if(!(Q&&xe(O,L))){if(!(ee.attributeCheck instanceof Function&&ee.attributeCheck(L,y))){if(!Z[L]||V[L]){if(!(ji(y)&&(Y.tagNameCheck instanceof RegExp&&xe(Y.tagNameCheck,y)||Y.tagNameCheck instanceof Function&&Y.tagNameCheck(y))&&(Y.attributeNameCheck instanceof RegExp&&xe(Y.attributeNameCheck,L)||Y.attributeNameCheck instanceof Function&&Y.attributeNameCheck(L,y))||L==="is"&&Y.allowCustomizedBuiltInElements&&(Y.tagNameCheck instanceof RegExp&&xe(Y.tagNameCheck,U)||Y.tagNameCheck instanceof Function&&Y.tagNameCheck(U))))return!1}else if(!no[L]){if(!xe(M,Pt(U,T,""))){if(!((L==="src"||L==="xlink:href"||L==="href")&&y!=="script"&&rf(U,"data:")===0&&Li[y])){if(!(ne&&!xe(I,Pt(U,T,"")))){if(U)return!1}}}}}}}return!0},ji=function(y){return y!=="annotation-xml"&&Rr(y,F)},Gi=function(y){qe(H.beforeSanitizeAttributes,y,null);const{attributes:L}=y;if(!L||ao(y))return;const U={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Z,forceKeepAttr:void 0};let le=L.length;for(;le--;){const ve=L[le],{name:ue,namespaceURI:Ee,value:Te}=ve,it=pe(ue),co=Te;let be=ue==="value"?co:of(co);if(U.attrName=it,U.attrValue=be,U.keepAttr=!0,U.forceKeepAttr=void 0,qe(H.uponSanitizeAttribute,y,U),be=U.attrValue,Ii&&(it==="id"||it==="name")&&(yt(ue,y),be=Lh+be),he&&xe(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,be)){yt(ue,y);continue}if(it==="attributename"&&Rr(be,"href")){yt(ue,y);continue}if(U.forceKeepAttr)continue;if(!U.keepAttr){yt(ue,y);continue}if(!se&&xe(/\/>/i,be)){yt(ue,y);continue}ce&&Ht([G,w,k],Ki=>{be=Pt(be,Ki," ")});const qi=pe(y.nodeName);if(!Vi(qi,it,be)){yt(ue,y);continue}if(x&&typeof p=="object"&&typeof p.getAttributeType=="function"&&!Ee)switch(p.getAttributeType(qi,it)){case"TrustedHTML":{be=x.createHTML(be);break}case"TrustedScriptURL":{be=x.createScriptURL(be);break}}if(be!==co)try{Ee?y.setAttributeNS(Ee,ue,be):y.setAttribute(ue,be),ao(y)?Fe(y):la(t.removed)}catch{yt(ue,y)}}qe(H.afterSanitizeAttributes,y,null)},Yi=function(y){let L=null;const U=Hi(y);for(qe(H.beforeSanitizeShadowDOM,y,null);L=U.nextNode();)qe(H.uponSanitizeShadowNode,L,null),Ui(L),Gi(L),L.content instanceof s&&Yi(L.content);qe(H.afterSanitizeShadowDOM,y,null)};return t.sanitize=function(j){let y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},L=null,U=null,le=null,ve=null;if(ro=!j,ro&&(j="<!-->"),typeof j!="string"&&!io(j))if(typeof j.toString=="function"){if(j=j.toString(),typeof j!="string")throw Vt("dirty is not a string, aborting")}else throw Vt("toString is not a function");if(!t.isSupported)return j;if(gt||so(y),t.removed=[],typeof j=="string"&&(en=!1),en){if(j.nodeName){const Te=pe(j.nodeName);if(!q[Te]||oe[Te])throw Vt("root node is forbidden and cannot be sanitized in-place")}}else if(j instanceof i)L=Bi("<!---->"),U=L.ownerDocument.importNode(j,!0),U.nodeType===Gt.element&&U.nodeName==="BODY"||U.nodeName==="HTML"?L=U:L.appendChild(U);else{if(!Mt&&!ce&&!Le&&j.indexOf("<")===-1)return x&&Yn?x.createHTML(j):j;if(L=Bi(j),!L)return Mt?null:Yn?S:""}L&&bt&&Fe(L.firstChild);const ue=Hi(en?j:L);for(;le=ue.nextNode();)Ui(le),Gi(le),le.content instanceof s&&Yi(le.content);if(en)return j;if(Mt){if(ce){L.normalize();let Te=L.innerHTML;Ht([G,w,k],it=>{Te=Pt(Te,it," ")}),L.innerHTML=Te}if(Gn)for(ve=P.call(L.ownerDocument);L.firstChild;)ve.appendChild(L.firstChild);else ve=L;return(Z.shadowroot||Z.shadowrootmode)&&(ve=z.call(r,ve,!0)),ve}let Ee=Le?L.outerHTML:L.innerHTML;return Le&&q["!doctype"]&&L.ownerDocument&&L.ownerDocument.doctype&&L.ownerDocument.doctype.name&&xe(ha,L.ownerDocument.doctype.name)&&(Ee="<!DOCTYPE "+L.ownerDocument.doctype.name+`>
85
- `+Ee),ce&&Ht([G,w,k],Te=>{Ee=Pt(Ee,Te," ")}),x&&Yn?x.createHTML(Ee):Ee},t.setConfig=function(){let j=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};so(j),gt=!0},t.clearConfig=function(){Lt=null,gt=!1},t.isValidAttribute=function(j,y,L){Lt||so({});const U=pe(j),le=pe(y);return Vi(U,le,L)},t.addHook=function(j,y){typeof y=="function"&&Ut(H[j],y)},t.removeHook=function(j,y){if(y!==void 0){const L=tf(H[j],y);return L===-1?void 0:nf(H[j],L,1)[0]}return la(H[j])},t.removeHooks=function(j){H[j]=[]},t.removeAllHooks=function(){H=ba()},t}var wf=ya();const xf=({editor:e,error:t})=>{const[,n]=R.useState(0);if(R.useEffect(()=>{if(!e)return;const s=()=>n(a=>a+1);return e.on("transaction",s),()=>e.off("transaction",s)},[e]),!e)return null;const r=s=>`p-2 rounded-sm transition-colors duration-200 focus-visible:ring-1 focus-visible:ring-ring/40 focus-visible:outline-none ${s?"bg-primary text-primary-foreground":"hover:bg-accent hover:text-accent-foreground text-muted-foreground"}`.trim(),o=()=>c.jsx("div",{className:"w-px h-4 bg-border mx-1 self-center","aria-hidden":"true"});return c.jsxs("div",{className:`flex flex-wrap gap-1 p-1.5 border-b bg-muted/30 rounded-t-lg transition-colors ${t?"border-red-500/50":"border-input"}`,role:"toolbar","aria-label":"Text formatting options",children:[c.jsxs("div",{className:"flex gap-1",children:[c.jsx("button",{type:"button",onClick:()=>e.chain().focus().toggleBold().run(),className:r(e.isActive("bold")),"aria-label":"Bold","aria-pressed":e.isActive("bold"),children:c.jsx(ic,{size:14})}),c.jsx("button",{type:"button",onClick:()=>e.chain().focus().toggleItalic().run(),className:r(e.isActive("italic")),"aria-label":"Italic","aria-pressed":e.isActive("italic"),children:c.jsx(wc,{size:14})}),c.jsx("button",{type:"button",onClick:()=>e.chain().focus().toggleUnderline().run(),className:r(e.isActive("underline")),"aria-label":"Underline","aria-pressed":e.isActive("underline"),children:c.jsx(Ac,{size:14})}),c.jsx("button",{type:"button",onClick:()=>e.chain().focus().toggleStrike().run(),className:r(e.isActive("strike")),"aria-label":"Strikethrough","aria-pressed":e.isActive("strike"),children:c.jsx(kc,{size:14})})]}),c.jsx(o,{}),c.jsx("div",{className:"flex gap-1",children:[1,2,3].map(s=>c.jsxs("button",{type:"button",onClick:()=>e.chain().focus().toggleHeading({level:s}).run(),className:r(e.isActive("heading",{level:s})),"aria-label":`Heading level ${s}`,"aria-pressed":e.isActive("heading",{level:s}),children:[s===1&&c.jsx(gc,{size:16}),s===2&&c.jsx(bc,{size:16}),s===3&&c.jsx(yc,{size:14})]},s))}),c.jsx(o,{}),c.jsxs("div",{className:"flex gap-1",children:[c.jsx("button",{type:"button",onClick:()=>e.chain().focus().toggleBulletList().run(),className:r(e.isActive("bulletList")),"aria-label":"Bullet list","aria-pressed":e.isActive("bulletList"),children:c.jsx(Sc,{size:14})}),c.jsx("button",{type:"button",onClick:()=>e.chain().focus().toggleOrderedList().run(),className:r(e.isActive("orderedList")),"aria-label":"Numbered list","aria-pressed":e.isActive("orderedList"),children:c.jsx(xc,{size:14})}),c.jsx("button",{type:"button",onClick:()=>e.chain().focus().toggleBlockquote().run(),className:r(e.isActive("blockquote")),"aria-label":"Quote","aria-pressed":e.isActive("blockquote"),children:c.jsx(Cc,{size:14})})]}),c.jsx(o,{}),c.jsx("div",{className:"flex gap-1",children:c.jsx("button",{type:"button",onClick:()=>e.chain().focus().toggleCodeBlock().run(),className:r(e.isActive("codeBlock")),"aria-label":"Code block","aria-pressed":e.isActive("codeBlock"),children:c.jsx(mc,{size:14})})}),c.jsxs("div",{className:"flex gap-1 ml-auto",children:[c.jsx(o,{}),c.jsx("button",{type:"button",onClick:()=>e.chain().focus().undo().run(),className:r(!1),"aria-label":"Undo",children:c.jsx(Tc,{size:14})}),c.jsx("button",{type:"button",onClick:()=>e.chain().focus().redo().run(),className:r(!1),"aria-label":"Redo",children:c.jsx(Ec,{size:14})})]})]})};function Sf({field:e,formValues:t,handleChange:n,handleBlur:r,error:o,disabled:s}){const a=!!s,i=t[e.name],l=typeof i=="string"?i:e.content||"",[d,u]=R.useState(150),[h,g]=R.useState(!1),p=m=>{m.preventDefault(),g(!0)};R.useEffect(()=>{if(!h)return;const m=C=>{const N=Math.max(150,Math.min(600,d+C.movementY));u(N)},v=()=>{g(!1)};return document.body.style.userSelect="none",document.body.style.cursor="ns-resize",document.addEventListener("mousemove",m),document.addEventListener("mouseup",v),()=>{document.body.style.userSelect="",document.body.style.cursor="",document.removeEventListener("mousemove",m),document.removeEventListener("mouseup",v)}},[h,d]);const b=uo.useEditor({extensions:[Zi.configure({heading:{levels:[1,2,3]},codeBlock:!0,blockquote:!0,strike:!0}),Ji.configure({limit:e.maxLength||null})],content:wf.sanitize(l),editable:!a,onUpdate:({editor:m})=>{const v=m.getHTML(),C=m.getText().trim().length===0;n(e.name,C?"":v)},onBlur:()=>{r(e.name)},editorProps:{attributes:{class:"prose prose-sm dark:prose-invert max-w-none focus:outline-none overflow-y-auto p-4 text-foreground",style:`min-height: ${d}px; max-height: ${d}px;`,role:"textbox","aria-multiline":"true","aria-label":e.label||"Rich text editor","aria-readonly":a?"true":"false","aria-invalid":o?"true":"false",id:e.name}}});return R.useEffect(()=>{b&&t[e.name]!==b.getHTML()&&b.commands.setContent(t[e.name]||"")},[t[e.name],b]),R.useEffect(()=>{b&&b.setEditable(!a)},[a,b]),c.jsx("div",{className:`mb-4 ${e.fieldClass||"col-span-full"}`,id:`${e.name}_id`,children:c.jsxs("div",{className:`w-full border rounded-lg overflow-hidden transition-all duration-200 ${o?"border-red-500 focus-within:ring-1 focus-within:ring-red-500":"border-input focus-within:border-ring/40 focus-within:shadow-[0_0_0_1px_rgba(var(--ring),0.1)]"} ${a?"opacity-70 bg-muted cursor-not-allowed":"bg-background"}`,children:[!a&&c.jsx(xf,{editor:b,error:o}),c.jsx(uo.EditorContent,{editor:b}),!a&&c.jsx("div",{className:`flex justify-center items-center py-1 cursor-ns-resize border-t border-b transition-colors ${h?"bg-primary/10 border-primary/50":"hover:bg-muted/50 border-border"}`,onMouseDown:p,role:"separator","aria-orientation":"horizontal","aria-label":"Resize editor",children:c.jsx(hc,{size:16,className:"text-muted-foreground"})}),c.jsx("div",{className:`flex justify-end px-4 py-2 text-[10px] uppercase tracking-wider ${o?"bg-red-50/50 border-red-500/50 text-red-500":"bg-muted/20 border-input/50 text-muted-foreground"}`,children:b&&c.jsxs("div",{"aria-live":"polite",children:[b.storage.characterCount.characters(),e.maxLength?` / ${e.maxLength}`:""," characters"]})})]})})}function Cf({field:e,formValues:t,handleChange:n,handleBlur:r,error:o,disabled:s,...a}){const{apiClient:i,api_URL:l,charCount:d,setCharCounts:u,fileInputRefs:h,...g}=a,p=s,b=e.options||[],m=e.inline||e.layout==="inline",v=g["aria-describedby"],C=`
84
+ `})}const{entries:ia,setPrototypeOf:ca,isFrozen:Zd,getPrototypeOf:Jd,getOwnPropertyDescriptor:ef}=Object;let{freeze:we,seal:Pe,create:Bt}=Object,{apply:Fr,construct:$r}=typeof Reflect<"u"&&Reflect;we||(we=function(t){return t}),Pe||(Pe=function(t){return t}),Fr||(Fr=function(t,n){for(var r=arguments.length,o=new Array(r>2?r-2:0),s=2;s<r;s++)o[s-2]=arguments[s];return t.apply(n,o)}),$r||($r=function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return new t(...r)});const Ht=Se(Array.prototype.forEach),tf=Se(Array.prototype.lastIndexOf),la=Se(Array.prototype.pop),Ut=Se(Array.prototype.push),nf=Se(Array.prototype.splice),Tn=Se(String.prototype.toLowerCase),zr=Se(String.prototype.toString),Rr=Se(String.prototype.match),Pt=Se(String.prototype.replace),rf=Se(String.prototype.indexOf),of=Se(String.prototype.trim),De=Se(Object.prototype.hasOwnProperty),xe=Se(RegExp.prototype.test),Vt=sf(TypeError);function Se(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return Fr(e,t,r)}}function sf(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return $r(e,n)}}function X(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Tn;ca&&ca(e,null);let r=t.length;for(;r--;){let o=t[r];if(typeof o=="string"){const s=n(o);s!==o&&(Zd(t)||(t[r]=s),o=s)}e[o]=!0}return e}function af(e){for(let t=0;t<e.length;t++)De(e,t)||(e[t]=null);return e}function Be(e){const t=Bt(null);for(const[n,r]of ia(e))De(e,n)&&(Array.isArray(r)?t[n]=af(r):r&&typeof r=="object"&&r.constructor===Object?t[n]=Be(r):t[n]=r);return t}function jt(e,t){for(;e!==null;){const r=ef(e,t);if(r){if(r.get)return Se(r.get);if(typeof r.value=="function")return Se(r.value)}e=Jd(e)}function n(){return null}return n}const ua=we(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Wr=we(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Br=we(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),cf=we(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Hr=we(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),lf=we(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),da=we(["#text"]),fa=we(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),Ur=we(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),pa=we(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Pn=we(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),uf=Pe(/\{\{[\w\W]*|[\w\W]*\}\}/gm),df=Pe(/<%[\w\W]*|[\w\W]*%>/gm),ff=Pe(/\$\{[\w\W]*/gm),pf=Pe(/^data-[\-\w.\u00B7-\uFFFF]+$/),mf=Pe(/^aria-[\-\w]+$/),ma=Pe(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),hf=Pe(/^(?:\w+script|data):/i),gf=Pe(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),ha=Pe(/^html$/i),bf=Pe(/^[a-z][.\w]*(-[.\w]+)+$/i);var ga=Object.freeze({__proto__:null,ARIA_ATTR:mf,ATTR_WHITESPACE:gf,CUSTOM_ELEMENT:bf,DATA_ATTR:pf,DOCTYPE_NAME:ha,ERB_EXPR:df,IS_ALLOWED_URI:ma,IS_SCRIPT_OR_DATA:hf,MUSTACHE_EXPR:uf,TMPLIT_EXPR:ff});const Gt={element:1,text:3,progressingInstruction:7,comment:8,document:9},yf=function(){return typeof window>"u"?null:window},vf=function(t,n){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let r=null;const o="data-tt-policy-suffix";n&&n.hasAttribute(o)&&(r=n.getAttribute(o));const s="dompurify"+(r?"#"+r:"");try{return t.createPolicy(s,{createHTML(a){return a},createScriptURL(a){return a}})}catch{return console.warn("TrustedTypes policy "+s+" could not be created."),null}},ba=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function ya(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:yf();const t=G=>ya(G);if(t.version="3.4.0",t.removed=[],!e||!e.document||e.document.nodeType!==Gt.document||!e.Element)return t.isSupported=!1,t;let{document:n}=e;const r=n,o=r.currentScript,{DocumentFragment:s,HTMLTemplateElement:a,Node:i,Element:l,NodeFilter:u,NamedNodeMap:d=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:h,DOMParser:g,trustedTypes:p}=e,b=l.prototype,m=jt(b,"cloneNode"),v=jt(b,"remove"),S=jt(b,"nextSibling"),k=jt(b,"childNodes"),E=jt(b,"parentNode");if(typeof a=="function"){const G=n.createElement("template");G.content&&G.content.ownerDocument&&(n=G.content.ownerDocument)}let w,x="";const{implementation:A,createNodeIterator:O,createDocumentFragment:T,getElementsByTagName:$}=n,{importNode:z}=r;let H=ba();t.isSupported=typeof ia=="function"&&typeof E=="function"&&A&&A.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:Y,ERB_EXPR:D,TMPLIT_EXPR:C,DATA_ATTR:P,ARIA_ATTR:_,IS_SCRIPT_OR_DATA:F,ATTR_WHITESPACE:N,CUSTOM_ELEMENT:M}=ga;let{IS_ALLOWED_URI:I}=ga,j=null;const se=X({},[...ua,...Wr,...Br,...Hr,...da]);let Z=null;const ge=X({},[...fa,...Ur,...pa,...Pn]);let q=Object.seal(Bt(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),oe=null,V=null;const ee=Object.seal(Bt(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Q=!0,te=!0,ne=!1,ae=!0,le=!1,he=!0,Le=!1,gt=!1,bt=!1,Mt=!1,Gn=!1,Yn=!1,Di=!0,Ii=!1;const Lh="user-content-";let eo=!0,en=!1,Dt={},He=null;const to=X({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Li=null;const Fi=X({},["audio","video","img","source","image","track"]);let no=null;const $i=X({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),qn="http://www.w3.org/1998/Math/MathML",Kn="http://www.w3.org/2000/svg",Ue="http://www.w3.org/1999/xhtml";let It=Ue,ro=!1,oo=null;const Fh=X({},[qn,Kn,Ue],zr);let Xn=X({},["mi","mo","mn","ms","mtext"]),Qn=X({},["annotation-xml"]);const $h=X({},["title","style","font","a","script"]);let tn=null;const zh=["application/xhtml+xml","text/html"],Rh="text/html";let pe=null,Lt=null;const Wh=n.createElement("form"),zi=function(y){return y instanceof RegExp||y instanceof Function},so=function(){let y=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Lt&&Lt===y)){if((!y||typeof y!="object")&&(y={}),y=Be(y),tn=zh.indexOf(y.PARSER_MEDIA_TYPE)===-1?Rh:y.PARSER_MEDIA_TYPE,pe=tn==="application/xhtml+xml"?zr:Tn,j=De(y,"ALLOWED_TAGS")?X({},y.ALLOWED_TAGS,pe):se,Z=De(y,"ALLOWED_ATTR")?X({},y.ALLOWED_ATTR,pe):ge,oo=De(y,"ALLOWED_NAMESPACES")?X({},y.ALLOWED_NAMESPACES,zr):Fh,no=De(y,"ADD_URI_SAFE_ATTR")?X(Be($i),y.ADD_URI_SAFE_ATTR,pe):$i,Li=De(y,"ADD_DATA_URI_TAGS")?X(Be(Fi),y.ADD_DATA_URI_TAGS,pe):Fi,He=De(y,"FORBID_CONTENTS")?X({},y.FORBID_CONTENTS,pe):to,oe=De(y,"FORBID_TAGS")?X({},y.FORBID_TAGS,pe):Be({}),V=De(y,"FORBID_ATTR")?X({},y.FORBID_ATTR,pe):Be({}),Dt=De(y,"USE_PROFILES")?y.USE_PROFILES:!1,Q=y.ALLOW_ARIA_ATTR!==!1,te=y.ALLOW_DATA_ATTR!==!1,ne=y.ALLOW_UNKNOWN_PROTOCOLS||!1,ae=y.ALLOW_SELF_CLOSE_IN_ATTR!==!1,le=y.SAFE_FOR_TEMPLATES||!1,he=y.SAFE_FOR_XML!==!1,Le=y.WHOLE_DOCUMENT||!1,Mt=y.RETURN_DOM||!1,Gn=y.RETURN_DOM_FRAGMENT||!1,Yn=y.RETURN_TRUSTED_TYPE||!1,bt=y.FORCE_BODY||!1,Di=y.SANITIZE_DOM!==!1,Ii=y.SANITIZE_NAMED_PROPS||!1,eo=y.KEEP_CONTENT!==!1,en=y.IN_PLACE||!1,I=y.ALLOWED_URI_REGEXP||ma,It=y.NAMESPACE||Ue,Xn=y.MATHML_TEXT_INTEGRATION_POINTS||Xn,Qn=y.HTML_INTEGRATION_POINTS||Qn,q=y.CUSTOM_ELEMENT_HANDLING||Bt(null),y.CUSTOM_ELEMENT_HANDLING&&zi(y.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(q.tagNameCheck=y.CUSTOM_ELEMENT_HANDLING.tagNameCheck),y.CUSTOM_ELEMENT_HANDLING&&zi(y.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(q.attributeNameCheck=y.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),y.CUSTOM_ELEMENT_HANDLING&&typeof y.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(q.allowCustomizedBuiltInElements=y.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),le&&(te=!1),Gn&&(Mt=!0),Dt&&(j=X({},da),Z=Bt(null),Dt.html===!0&&(X(j,ua),X(Z,fa)),Dt.svg===!0&&(X(j,Wr),X(Z,Ur),X(Z,Pn)),Dt.svgFilters===!0&&(X(j,Br),X(Z,Ur),X(Z,Pn)),Dt.mathMl===!0&&(X(j,Hr),X(Z,pa),X(Z,Pn))),ee.tagCheck=null,ee.attributeCheck=null,y.ADD_TAGS&&(typeof y.ADD_TAGS=="function"?ee.tagCheck=y.ADD_TAGS:(j===se&&(j=Be(j)),X(j,y.ADD_TAGS,pe))),y.ADD_ATTR&&(typeof y.ADD_ATTR=="function"?ee.attributeCheck=y.ADD_ATTR:(Z===ge&&(Z=Be(Z)),X(Z,y.ADD_ATTR,pe))),y.ADD_URI_SAFE_ATTR&&X(no,y.ADD_URI_SAFE_ATTR,pe),y.FORBID_CONTENTS&&(He===to&&(He=Be(He)),X(He,y.FORBID_CONTENTS,pe)),y.ADD_FORBID_CONTENTS&&(He===to&&(He=Be(He)),X(He,y.ADD_FORBID_CONTENTS,pe)),eo&&(j["#text"]=!0),Le&&X(j,["html","head","body"]),j.table&&(X(j,["tbody"]),delete oe.tbody),y.TRUSTED_TYPES_POLICY){if(typeof y.TRUSTED_TYPES_POLICY.createHTML!="function")throw Vt('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof y.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Vt('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');w=y.TRUSTED_TYPES_POLICY,x=w.createHTML("")}else w===void 0&&(w=vf(p,o)),w!==null&&typeof x=="string"&&(x=w.createHTML(""));we&&we(y),Lt=y}},Ri=X({},[...Wr,...Br,...cf]),Wi=X({},[...Hr,...lf]),Bh=function(y){let L=E(y);(!L||!L.tagName)&&(L={namespaceURI:It,tagName:"template"});const U=Tn(y.tagName),ue=Tn(L.tagName);return oo[y.namespaceURI]?y.namespaceURI===Kn?L.namespaceURI===Ue?U==="svg":L.namespaceURI===qn?U==="svg"&&(ue==="annotation-xml"||Xn[ue]):!!Ri[U]:y.namespaceURI===qn?L.namespaceURI===Ue?U==="math":L.namespaceURI===Kn?U==="math"&&Qn[ue]:!!Wi[U]:y.namespaceURI===Ue?L.namespaceURI===Kn&&!Qn[ue]||L.namespaceURI===qn&&!Xn[ue]?!1:!Wi[U]&&($h[U]||!Ri[U]):!!(tn==="application/xhtml+xml"&&oo[y.namespaceURI]):!1},Fe=function(y){Ut(t.removed,{element:y});try{E(y).removeChild(y)}catch{v(y)}},yt=function(y,L){try{Ut(t.removed,{attribute:L.getAttributeNode(y),from:L})}catch{Ut(t.removed,{attribute:null,from:L})}if(L.removeAttribute(y),y==="is")if(Mt||Gn)try{Fe(L)}catch{}else try{L.setAttribute(y,"")}catch{}},Bi=function(y){let L=null,U=null;if(bt)y="<remove></remove>"+y;else{const de=Rr(y,/^[\r\n\t ]+/);U=de&&de[0]}tn==="application/xhtml+xml"&&It===Ue&&(y='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+y+"</body></html>");const ue=w?w.createHTML(y):y;if(It===Ue)try{L=new g().parseFromString(ue,tn)}catch{}if(!L||!L.documentElement){L=A.createDocument(It,"template",null);try{L.documentElement.innerHTML=ro?x:ue}catch{}}const ve=L.body||L.documentElement;return y&&U&&ve.insertBefore(n.createTextNode(U),ve.childNodes[0]||null),It===Ue?$.call(L,Le?"html":"body")[0]:Le?L.documentElement:ve},Hi=function(y){return O.call(y.ownerDocument||y,y,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT|u.SHOW_PROCESSING_INSTRUCTION|u.SHOW_CDATA_SECTION,null)},ao=function(y){return y instanceof h&&(typeof y.nodeName!="string"||typeof y.textContent!="string"||typeof y.removeChild!="function"||!(y.attributes instanceof d)||typeof y.removeAttribute!="function"||typeof y.setAttribute!="function"||typeof y.namespaceURI!="string"||typeof y.insertBefore!="function"||typeof y.hasChildNodes!="function")},io=function(y){return typeof i=="function"&&y instanceof i};function qe(G,y,L){Ht(G,U=>{U.call(t,y,L,Lt)})}const Ui=function(y){let L=null;if(qe(H.beforeSanitizeElements,y,null),ao(y))return Fe(y),!0;const U=pe(y.nodeName);if(qe(H.uponSanitizeElement,y,{tagName:U,allowedTags:j}),he&&y.hasChildNodes()&&!io(y.firstElementChild)&&xe(/<[/\w!]/g,y.innerHTML)&&xe(/<[/\w!]/g,y.textContent)||he&&y.namespaceURI===Ue&&U==="style"&&io(y.firstElementChild)||y.nodeType===Gt.progressingInstruction||he&&y.nodeType===Gt.comment&&xe(/<[/\w]/g,y.data))return Fe(y),!0;if(oe[U]||!(ee.tagCheck instanceof Function&&ee.tagCheck(U))&&!j[U]){if(!oe[U]&&ji(U)&&(q.tagNameCheck instanceof RegExp&&xe(q.tagNameCheck,U)||q.tagNameCheck instanceof Function&&q.tagNameCheck(U)))return!1;if(eo&&!He[U]){const ue=E(y)||y.parentNode,ve=k(y)||y.childNodes;if(ve&&ue){const de=ve.length;for(let Ee=de-1;Ee>=0;--Ee){const Te=m(ve[Ee],!0);Te.__removalCount=(y.__removalCount||0)+1,ue.insertBefore(Te,S(y))}}}return Fe(y),!0}return y instanceof l&&!Bh(y)||(U==="noscript"||U==="noembed"||U==="noframes")&&xe(/<\/no(script|embed|frames)/i,y.innerHTML)?(Fe(y),!0):(le&&y.nodeType===Gt.text&&(L=y.textContent,Ht([Y,D,C],ue=>{L=Pt(L,ue," ")}),y.textContent!==L&&(Ut(t.removed,{element:y.cloneNode()}),y.textContent=L)),qe(H.afterSanitizeElements,y,null),!1)},Vi=function(y,L,U){if(V[L]||Di&&(L==="id"||L==="name")&&(U in n||U in Wh))return!1;if(!(te&&!V[L]&&xe(P,L))){if(!(Q&&xe(_,L))){if(!(ee.attributeCheck instanceof Function&&ee.attributeCheck(L,y))){if(!Z[L]||V[L]){if(!(ji(y)&&(q.tagNameCheck instanceof RegExp&&xe(q.tagNameCheck,y)||q.tagNameCheck instanceof Function&&q.tagNameCheck(y))&&(q.attributeNameCheck instanceof RegExp&&xe(q.attributeNameCheck,L)||q.attributeNameCheck instanceof Function&&q.attributeNameCheck(L,y))||L==="is"&&q.allowCustomizedBuiltInElements&&(q.tagNameCheck instanceof RegExp&&xe(q.tagNameCheck,U)||q.tagNameCheck instanceof Function&&q.tagNameCheck(U))))return!1}else if(!no[L]){if(!xe(I,Pt(U,N,""))){if(!((L==="src"||L==="xlink:href"||L==="href")&&y!=="script"&&rf(U,"data:")===0&&Li[y])){if(!(ne&&!xe(F,Pt(U,N,"")))){if(U)return!1}}}}}}}return!0},ji=function(y){return y!=="annotation-xml"&&Rr(y,M)},Gi=function(y){qe(H.beforeSanitizeAttributes,y,null);const{attributes:L}=y;if(!L||ao(y))return;const U={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Z,forceKeepAttr:void 0};let ue=L.length;for(;ue--;){const ve=L[ue],{name:de,namespaceURI:Ee,value:Te}=ve,it=pe(de),co=Te;let be=de==="value"?co:of(co);if(U.attrName=it,U.attrValue=be,U.keepAttr=!0,U.forceKeepAttr=void 0,qe(H.uponSanitizeAttribute,y,U),be=U.attrValue,Ii&&(it==="id"||it==="name")&&(yt(de,y),be=Lh+be),he&&xe(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,be)){yt(de,y);continue}if(it==="attributename"&&Rr(be,"href")){yt(de,y);continue}if(U.forceKeepAttr)continue;if(!U.keepAttr){yt(de,y);continue}if(!ae&&xe(/\/>/i,be)){yt(de,y);continue}le&&Ht([Y,D,C],Ki=>{be=Pt(be,Ki," ")});const qi=pe(y.nodeName);if(!Vi(qi,it,be)){yt(de,y);continue}if(w&&typeof p=="object"&&typeof p.getAttributeType=="function"&&!Ee)switch(p.getAttributeType(qi,it)){case"TrustedHTML":{be=w.createHTML(be);break}case"TrustedScriptURL":{be=w.createScriptURL(be);break}}if(be!==co)try{Ee?y.setAttributeNS(Ee,de,be):y.setAttribute(de,be),ao(y)?Fe(y):la(t.removed)}catch{yt(de,y)}}qe(H.afterSanitizeAttributes,y,null)},Yi=function(y){let L=null;const U=Hi(y);for(qe(H.beforeSanitizeShadowDOM,y,null);L=U.nextNode();)qe(H.uponSanitizeShadowNode,L,null),Ui(L),Gi(L),L.content instanceof s&&Yi(L.content);qe(H.afterSanitizeShadowDOM,y,null)};return t.sanitize=function(G){let y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},L=null,U=null,ue=null,ve=null;if(ro=!G,ro&&(G="<!-->"),typeof G!="string"&&!io(G))if(typeof G.toString=="function"){if(G=G.toString(),typeof G!="string")throw Vt("dirty is not a string, aborting")}else throw Vt("toString is not a function");if(!t.isSupported)return G;if(gt||so(y),t.removed=[],typeof G=="string"&&(en=!1),en){if(G.nodeName){const Te=pe(G.nodeName);if(!j[Te]||oe[Te])throw Vt("root node is forbidden and cannot be sanitized in-place")}}else if(G instanceof i)L=Bi("<!---->"),U=L.ownerDocument.importNode(G,!0),U.nodeType===Gt.element&&U.nodeName==="BODY"||U.nodeName==="HTML"?L=U:L.appendChild(U);else{if(!Mt&&!le&&!Le&&G.indexOf("<")===-1)return w&&Yn?w.createHTML(G):G;if(L=Bi(G),!L)return Mt?null:Yn?x:""}L&&bt&&Fe(L.firstChild);const de=Hi(en?G:L);for(;ue=de.nextNode();)Ui(ue),Gi(ue),ue.content instanceof s&&Yi(ue.content);if(en)return G;if(Mt){if(le){L.normalize();let Te=L.innerHTML;Ht([Y,D,C],it=>{Te=Pt(Te,it," ")}),L.innerHTML=Te}if(Gn)for(ve=T.call(L.ownerDocument);L.firstChild;)ve.appendChild(L.firstChild);else ve=L;return(Z.shadowroot||Z.shadowrootmode)&&(ve=z.call(r,ve,!0)),ve}let Ee=Le?L.outerHTML:L.innerHTML;return Le&&j["!doctype"]&&L.ownerDocument&&L.ownerDocument.doctype&&L.ownerDocument.doctype.name&&xe(ha,L.ownerDocument.doctype.name)&&(Ee="<!DOCTYPE "+L.ownerDocument.doctype.name+`>
85
+ `+Ee),le&&Ht([Y,D,C],Te=>{Ee=Pt(Ee,Te," ")}),w&&Yn?w.createHTML(Ee):Ee},t.setConfig=function(){let G=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};so(G),gt=!0},t.clearConfig=function(){Lt=null,gt=!1},t.isValidAttribute=function(G,y,L){Lt||so({});const U=pe(G),ue=pe(y);return Vi(U,ue,L)},t.addHook=function(G,y){typeof y=="function"&&Ut(H[G],y)},t.removeHook=function(G,y){if(y!==void 0){const L=tf(H[G],y);return L===-1?void 0:nf(H[G],L,1)[0]}return la(H[G])},t.removeHooks=function(G){H[G]=[]},t.removeAllHooks=function(){H=ba()},t}var wf=ya();const xf=({editor:e,error:t})=>{const[,n]=R.useState(0);if(R.useEffect(()=>{if(!e)return;const s=()=>n(a=>a+1);return e.on("transaction",s),()=>e.off("transaction",s)},[e]),!e)return null;const r=s=>`p-2 rounded-sm transition-colors duration-200 focus-visible:ring-1 focus-visible:ring-ring/40 focus-visible:outline-none ${s?"bg-primary text-primary-foreground":"hover:bg-accent hover:text-accent-foreground text-muted-foreground"}`.trim(),o=()=>c.jsx("div",{className:"w-px h-4 bg-border mx-1 self-center","aria-hidden":"true"});return c.jsxs("div",{className:`flex flex-wrap gap-1 p-1.5 border-b bg-muted/30 rounded-t-lg transition-colors ${t?"border-red-500/50":"border-input"}`,role:"toolbar","aria-label":"Text formatting options",children:[c.jsxs("div",{className:"flex gap-1",children:[c.jsx("button",{type:"button",onClick:()=>e.chain().focus().toggleBold().run(),className:r(e.isActive("bold")),"aria-label":"Bold","aria-pressed":e.isActive("bold"),children:c.jsx(ic,{size:14})}),c.jsx("button",{type:"button",onClick:()=>e.chain().focus().toggleItalic().run(),className:r(e.isActive("italic")),"aria-label":"Italic","aria-pressed":e.isActive("italic"),children:c.jsx(wc,{size:14})}),c.jsx("button",{type:"button",onClick:()=>e.chain().focus().toggleUnderline().run(),className:r(e.isActive("underline")),"aria-label":"Underline","aria-pressed":e.isActive("underline"),children:c.jsx(Ac,{size:14})}),c.jsx("button",{type:"button",onClick:()=>e.chain().focus().toggleStrike().run(),className:r(e.isActive("strike")),"aria-label":"Strikethrough","aria-pressed":e.isActive("strike"),children:c.jsx(kc,{size:14})})]}),c.jsx(o,{}),c.jsx("div",{className:"flex gap-1",children:[1,2,3].map(s=>c.jsxs("button",{type:"button",onClick:()=>e.chain().focus().toggleHeading({level:s}).run(),className:r(e.isActive("heading",{level:s})),"aria-label":`Heading level ${s}`,"aria-pressed":e.isActive("heading",{level:s}),children:[s===1&&c.jsx(gc,{size:16}),s===2&&c.jsx(bc,{size:16}),s===3&&c.jsx(yc,{size:14})]},s))}),c.jsx(o,{}),c.jsxs("div",{className:"flex gap-1",children:[c.jsx("button",{type:"button",onClick:()=>e.chain().focus().toggleBulletList().run(),className:r(e.isActive("bulletList")),"aria-label":"Bullet list","aria-pressed":e.isActive("bulletList"),children:c.jsx(Sc,{size:14})}),c.jsx("button",{type:"button",onClick:()=>e.chain().focus().toggleOrderedList().run(),className:r(e.isActive("orderedList")),"aria-label":"Numbered list","aria-pressed":e.isActive("orderedList"),children:c.jsx(xc,{size:14})}),c.jsx("button",{type:"button",onClick:()=>e.chain().focus().toggleBlockquote().run(),className:r(e.isActive("blockquote")),"aria-label":"Quote","aria-pressed":e.isActive("blockquote"),children:c.jsx(Cc,{size:14})})]}),c.jsx(o,{}),c.jsx("div",{className:"flex gap-1",children:c.jsx("button",{type:"button",onClick:()=>e.chain().focus().toggleCodeBlock().run(),className:r(e.isActive("codeBlock")),"aria-label":"Code block","aria-pressed":e.isActive("codeBlock"),children:c.jsx(mc,{size:14})})}),c.jsxs("div",{className:"flex gap-1 ml-auto",children:[c.jsx(o,{}),c.jsx("button",{type:"button",onClick:()=>e.chain().focus().undo().run(),className:r(!1),"aria-label":"Undo",children:c.jsx(Tc,{size:14})}),c.jsx("button",{type:"button",onClick:()=>e.chain().focus().redo().run(),className:r(!1),"aria-label":"Redo",children:c.jsx(Ec,{size:14})})]})]})};function Sf({field:e,formValues:t,handleChange:n,handleBlur:r,error:o,disabled:s}){const a=!!s,i=t[e.name],l=typeof i=="string"?i:e.content||"",[u,d]=R.useState(150),[h,g]=R.useState(!1),p=m=>{m.preventDefault(),g(!0)};R.useEffect(()=>{if(!h)return;const m=S=>{const k=Math.max(150,Math.min(600,u+S.movementY));d(k)},v=()=>{g(!1)};return document.body.style.userSelect="none",document.body.style.cursor="ns-resize",document.addEventListener("mousemove",m),document.addEventListener("mouseup",v),()=>{document.body.style.userSelect="",document.body.style.cursor="",document.removeEventListener("mousemove",m),document.removeEventListener("mouseup",v)}},[h,u]);const b=uo.useEditor({extensions:[Zi.configure({heading:{levels:[1,2,3]},codeBlock:!0,blockquote:!0,strike:!0}),Ji.configure({limit:e.maxLength||null})],content:wf.sanitize(l),editable:!a,onUpdate:({editor:m})=>{const v=m.getHTML(),S=m.getText().trim().length===0;n(e.name,S?"":v)},onBlur:()=>{r(e.name)},editorProps:{attributes:{class:"prose prose-sm dark:prose-invert max-w-none focus:outline-none overflow-y-auto p-4 text-foreground",style:`min-height: ${u}px; max-height: ${u}px;`,role:"textbox","aria-multiline":"true","aria-label":e.label||"Rich text editor","aria-readonly":a?"true":"false","aria-invalid":o?"true":"false",id:e.name}}});return R.useEffect(()=>{b&&t[e.name]!==b.getHTML()&&b.commands.setContent(t[e.name]||"")},[t[e.name],b]),R.useEffect(()=>{b&&b.setEditable(!a)},[a,b]),c.jsx("div",{className:`mb-4 ${e.fieldClass||"col-span-full"}`,id:`${e.name}_id`,children:c.jsxs("div",{className:`w-full border rounded-lg overflow-hidden transition-all duration-200 ${o?"border-red-500 focus-within:ring-1 focus-within:ring-red-500":"border-input focus-within:border-ring/40 focus-within:shadow-[0_0_0_1px_rgba(var(--ring),0.1)]"} ${a?"opacity-70 bg-muted cursor-not-allowed":"bg-background"}`,children:[!a&&c.jsx(xf,{editor:b,error:o}),c.jsx(uo.EditorContent,{editor:b}),!a&&c.jsx("div",{className:`flex justify-center items-center py-1 cursor-ns-resize border-t border-b transition-colors ${h?"bg-primary/10 border-primary/50":"hover:bg-muted/50 border-border"}`,onMouseDown:p,role:"separator","aria-orientation":"horizontal","aria-label":"Resize editor",children:c.jsx(hc,{size:16,className:"text-muted-foreground"})}),c.jsx("div",{className:`flex justify-end px-4 py-2 text-[10px] uppercase tracking-wider ${o?"bg-red-50/50 border-red-500/50 text-red-500":"bg-muted/20 border-input/50 text-muted-foreground"}`,children:b&&c.jsxs("div",{"aria-live":"polite",children:[b.storage.characterCount.characters(),e.maxLength?` / ${e.maxLength}`:""," characters"]})})]})})}function Cf({field:e,formValues:t,handleChange:n,handleBlur:r,error:o,disabled:s,...a}){const{apiClient:i,api_URL:l,charCount:u,setCharCounts:d,fileInputRefs:h,...g}=a,p=s,b=e.options||[],m=e.inline||e.layout==="inline",v=g["aria-describedby"],S=`
86
86
  size-4 rounded border-input bg-background transition-all accent-primary
87
87
  focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2
88
88
  disabled:cursor-not-allowed disabled:opacity-50
89
- `;if(b.length>0){const N=Array.isArray(t[e.name])?t[e.name]:[],E=(x,S)=>{let A=S?[...N,x]:N.filter(_=>_!==x);n(e.name,A),r(e.name)};return c.jsxs("fieldset",{className:"mt-2","aria-invalid":!!o,"aria-describedby":o?v:void 0,children:[c.jsx("legend",{className:"sr-only",children:e.label}),c.jsx("div",{className:m?"flex flex-wrap gap-x-6 gap-y-3":"space-y-4",children:b.map(x=>{const S=typeof x=="object"?x.value:x,A=typeof x=="object"?x.label:x,_=typeof x=="object"?x.description:null,P=`${e.name}-${S}`,$=N.includes(S);return c.jsxs("div",{className:"relative flex items-start group",children:[c.jsx("div",{className:"flex h-6 items-center",children:c.jsx("input",{...e.props,...g,type:"checkbox",id:P,checked:$,onChange:z=>E(S,z.target.checked),onBlur:()=>r(e.name),disabled:p,className:`${C} ${!p&&"cursor-pointer hover:border-primary/50"} ${o?"border-destructive ring-destructive/20":"border-input"}`})}),c.jsxs("div",{className:"ml-3 text-sm leading-6",children:[c.jsx("label",{htmlFor:P,className:`font-medium select-none transition-colors ${p?"text-muted-foreground":"text-foreground cursor-pointer group-hover:text-primary"}`,children:A}),_&&!m&&c.jsx("p",{className:`text-xs ${p?"text-muted-foreground/60":"text-muted-foreground"}`,children:_})]})]},S)})})]})}return c.jsxs("div",{className:"mt-1 flex items-start group",children:[c.jsx("div",{className:"flex h-6 items-center",children:c.jsx("input",{...e.props,...g,id:e.name,type:"checkbox",checked:!!t[e.name],onChange:N=>{n(e.name,N.target.checked),r(e.name)},onBlur:()=>r(e.name),disabled:p,className:`${C} ${!p&&"cursor-pointer hover:border-primary/50"} ${o?"border-destructive":"border-input"}`})}),c.jsx("div",{className:"ml-3 text-sm leading-6",children:c.jsxs("label",{htmlFor:e.name,className:`font-medium select-none transition-colors ${p?"text-muted-foreground":"text-foreground cursor-pointer group-hover:text-primary"}`,children:[e.label,e.required&&c.jsx("span",{className:"text-destructive ml-1","aria-hidden":"true",children:"*"})]})})]})}const va=6048e5,Ef=864e5,wa=Symbol.for("constructDateFrom");function tt(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&wa in e?e[wa](t):e instanceof Date?new e.constructor(t):new Date(t)}function Ie(e,t){return tt(t||e,e)}let Nf={};function _n(){return Nf}function Yt(e,t){const n=_n(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,o=Ie(e,t?.in),s=o.getDay(),a=(s<r?7:0)+s-r;return o.setDate(o.getDate()-a),o.setHours(0,0,0,0),o}function On(e,t){return Yt(e,{...t,weekStartsOn:1})}function xa(e,t){const n=Ie(e,t?.in),r=n.getFullYear(),o=tt(n,0);o.setFullYear(r+1,0,4),o.setHours(0,0,0,0);const s=On(o),a=tt(n,0);a.setFullYear(r,0,4),a.setHours(0,0,0,0);const i=On(a);return n.getTime()>=s.getTime()?r+1:n.getTime()>=i.getTime()?r:r-1}function Sa(e){const t=Ie(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function kf(e,...t){const n=tt.bind(null,t.find(r=>typeof r=="object"));return t.map(n)}function Ca(e,t){const n=Ie(e,t?.in);return n.setHours(0,0,0,0),n}function Af(e,t,n){const[r,o]=kf(n?.in,e,t),s=Ca(r),a=Ca(o),i=+s-Sa(s),l=+a-Sa(a);return Math.round((i-l)/Ef)}function Tf(e,t){const n=xa(e,t),r=tt(e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),On(r)}function Pf(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function qt(e){return!(!Pf(e)&&typeof e!="number"||isNaN(+Ie(e)))}function _f(e,t){const n=Ie(e,t?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}const Of={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},Mf=(e,t,n)=>{let r;const o=Of[e];return typeof o=="string"?r=o:t===1?r=o.one:r=o.other.replace("{{count}}",t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function Vr(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const Df={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},If={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Lf={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Ff={date:Vr({formats:Df,defaultWidth:"full"}),time:Vr({formats:If,defaultWidth:"full"}),dateTime:Vr({formats:Lf,defaultWidth:"full"})},$f={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},zf=(e,t,n,r)=>$f[e];function Kt(e){return(t,n)=>{const r=n?.context?String(n.context):"standalone";let o;if(r==="formatting"&&e.formattingValues){const a=e.defaultFormattingWidth||e.defaultWidth,i=n?.width?String(n.width):a;o=e.formattingValues[i]||e.formattingValues[a]}else{const a=e.defaultWidth,i=n?.width?String(n.width):e.defaultWidth;o=e.values[i]||e.values[a]}const s=e.argumentCallback?e.argumentCallback(t):t;return o[s]}}const Rf={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Wf={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Bf={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},Hf={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},Uf={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},Vf={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},jf={ordinalNumber:(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:Kt({values:Rf,defaultWidth:"wide"}),quarter:Kt({values:Wf,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Kt({values:Bf,defaultWidth:"wide"}),day:Kt({values:Hf,defaultWidth:"wide"}),dayPeriod:Kt({values:Uf,defaultWidth:"wide",formattingValues:Vf,defaultFormattingWidth:"wide"})};function Xt(e){return(t,n={})=>{const r=n.width,o=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],s=t.match(o);if(!s)return null;const a=s[0],i=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(i)?Yf(i,h=>h.test(a)):Gf(i,h=>h.test(a));let d;d=e.valueCallback?e.valueCallback(l):l,d=n.valueCallback?n.valueCallback(d):d;const u=t.slice(a.length);return{value:d,rest:u}}}function Gf(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function Yf(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function qf(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const o=r[0],s=t.match(e.parsePattern);if(!s)return null;let a=e.valueCallback?e.valueCallback(s[0]):s[0];a=n.valueCallback?n.valueCallback(a):a;const i=t.slice(o.length);return{value:a,rest:i}}}const Kf=/^(\d+)(th|st|nd|rd)?/i,Xf=/\d+/i,Qf={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},Zf={any:[/^b/i,/^(a|c)/i]},Jf={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},ep={any:[/1/i,/2/i,/3/i,/4/i]},tp={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},np={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},rp={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},op={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},sp={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},ap={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},ip={ordinalNumber:qf({matchPattern:Kf,parsePattern:Xf,valueCallback:e=>parseInt(e,10)}),era:Xt({matchPatterns:Qf,defaultMatchWidth:"wide",parsePatterns:Zf,defaultParseWidth:"any"}),quarter:Xt({matchPatterns:Jf,defaultMatchWidth:"wide",parsePatterns:ep,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Xt({matchPatterns:tp,defaultMatchWidth:"wide",parsePatterns:np,defaultParseWidth:"any"}),day:Xt({matchPatterns:rp,defaultMatchWidth:"wide",parsePatterns:op,defaultParseWidth:"any"}),dayPeriod:Xt({matchPatterns:sp,defaultMatchWidth:"any",parsePatterns:ap,defaultParseWidth:"any"})},cp={code:"en-US",formatDistance:Mf,formatLong:Ff,formatRelative:zf,localize:jf,match:ip,options:{weekStartsOn:0,firstWeekContainsDate:1}};function lp(e,t){const n=Ie(e,t?.in);return Af(n,_f(n))+1}function dp(e,t){const n=Ie(e,t?.in),r=+On(n)-+Tf(n);return Math.round(r/va)+1}function Ea(e,t){const n=Ie(e,t?.in),r=n.getFullYear(),o=_n(),s=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??o.firstWeekContainsDate??o.locale?.options?.firstWeekContainsDate??1,a=tt(t?.in||e,0);a.setFullYear(r+1,0,s),a.setHours(0,0,0,0);const i=Yt(a,t),l=tt(t?.in||e,0);l.setFullYear(r,0,s),l.setHours(0,0,0,0);const d=Yt(l,t);return+n>=+i?r+1:+n>=+d?r:r-1}function up(e,t){const n=_n(),r=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,o=Ea(e,t),s=tt(t?.in||e,0);return s.setFullYear(o,0,r),s.setHours(0,0,0,0),Yt(s,t)}function fp(e,t){const n=Ie(e,t?.in),r=+Yt(n,t)-+up(n,t);return Math.round(r/va)+1}function re(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const nt={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return re(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):re(n+1,2)},d(e,t){return re(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];default:return n==="am"?"a.m.":"p.m."}},h(e,t){return re(e.getHours()%12||12,t.length)},H(e,t){return re(e.getHours(),t.length)},m(e,t){return re(e.getMinutes(),t.length)},s(e,t){return re(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),o=Math.trunc(r*Math.pow(10,n-3));return re(o,t.length)}},_t={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Na={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const r=e.getFullYear(),o=r>0?r:1-r;return n.ordinalNumber(o,{unit:"year"})}return nt.y(e,t)},Y:function(e,t,n,r){const o=Ea(e,r),s=o>0?o:1-o;if(t==="YY"){const a=s%100;return re(a,2)}return t==="Yo"?n.ordinalNumber(s,{unit:"year"}):re(s,t.length)},R:function(e,t){const n=xa(e);return re(n,t.length)},u:function(e,t){const n=e.getFullYear();return re(n,t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return re(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return re(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return nt.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return re(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const o=fp(e,r);return t==="wo"?n.ordinalNumber(o,{unit:"week"}):re(o,t.length)},I:function(e,t,n){const r=dp(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):re(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):nt.d(e,t)},D:function(e,t,n){const r=lp(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):re(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const o=e.getDay(),s=(o-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(s);case"ee":return re(s,2);case"eo":return n.ordinalNumber(s,{unit:"day"});case"eee":return n.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(o,{width:"short",context:"formatting"});default:return n.day(o,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const o=e.getDay(),s=(o-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(s);case"cc":return re(s,t.length);case"co":return n.ordinalNumber(s,{unit:"day"});case"ccc":return n.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(o,{width:"narrow",context:"standalone"});case"cccccc":return n.day(o,{width:"short",context:"standalone"});default:return n.day(o,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),o=r===0?7:r;switch(t){case"i":return String(o);case"ii":return re(o,t.length);case"io":return n.ordinalNumber(o,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const o=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(o,{width:"narrow",context:"formatting"});default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let o;switch(r===12?o=_t.noon:r===0?o=_t.midnight:o=r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(o,{width:"narrow",context:"formatting"});default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let o;switch(r>=17?o=_t.evening:r>=12?o=_t.afternoon:r>=4?o=_t.morning:o=_t.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(o,{width:"narrow",context:"formatting"});default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let r=e.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return nt.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):nt.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):re(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):re(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):nt.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):nt.s(e,t)},S:function(e,t){return nt.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return Aa(r);case"XXXX":case"XX":return pt(r);default:return pt(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return Aa(r);case"xxxx":case"xx":return pt(r);default:return pt(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+ka(r,":");default:return"GMT"+pt(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+ka(r,":");default:return"GMT"+pt(r,":")}},t:function(e,t,n){const r=Math.trunc(+e/1e3);return re(r,t.length)},T:function(e,t,n){return re(+e,t.length)}};function ka(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),o=Math.trunc(r/60),s=r%60;return s===0?n+String(o):n+String(o)+t+re(s,2)}function Aa(e,t){return e%60===0?(e>0?"-":"+")+re(Math.abs(e)/60,2):pt(e,t)}function pt(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),o=re(Math.trunc(r/60),2),s=re(r%60,2);return n+o+t+s}const Ta=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}},Pa=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}},pp={p:Pa,P:(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],o=n[2];if(!o)return Ta(e,t);let s;switch(r){case"P":s=t.dateTime({width:"short"});break;case"PP":s=t.dateTime({width:"medium"});break;case"PPP":s=t.dateTime({width:"long"});break;default:s=t.dateTime({width:"full"});break}return s.replace("{{date}}",Ta(r,t)).replace("{{time}}",Pa(o,t))}},mp=/^D+$/,hp=/^Y+$/,gp=["D","DD","YY","YYYY"];function bp(e){return mp.test(e)}function yp(e){return hp.test(e)}function vp(e,t,n){const r=wp(e,t,n);if(console.warn(r),gp.includes(e))throw new RangeError(r)}function wp(e,t,n){const r=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const xp=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Sp=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Cp=/^'([^]*?)'?$/,Ep=/''/g,Np=/[a-zA-Z]/;function Mn(e,t,n){const r=_n(),o=r.locale??cp,s=r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,a=r.weekStartsOn??r.locale?.options?.weekStartsOn??0,i=Ie(e,n?.in);if(!qt(i))throw new RangeError("Invalid time value");let l=t.match(Sp).map(u=>{const h=u[0];if(h==="p"||h==="P"){const g=pp[h];return g(u,o.formatLong)}return u}).join("").match(xp).map(u=>{if(u==="''")return{isToken:!1,value:"'"};const h=u[0];if(h==="'")return{isToken:!1,value:kp(u)};if(Na[h])return{isToken:!0,value:u};if(h.match(Np))throw new RangeError("Format string contains an unescaped latin alphabet character `"+h+"`");return{isToken:!1,value:u}});o.localize.preprocessor&&(l=o.localize.preprocessor(i,l));const d={firstWeekContainsDate:s,weekStartsOn:a,locale:o};return l.map(u=>{if(!u.isToken)return u.value;const h=u.value;(yp(h)||bp(h))&&vp(h,t,String(e));const g=Na[h[0]];return g(i,h,o.localize,d)}).join("")}function kp(e){const t=e.match(Cp);return t?t[1].replace(Ep,"'"):e}function Ap(e,t){return f.useReducer((n,r)=>t[n][r]??n,e)}var Dn=e=>{const{present:t,children:n}=e,r=Tp(t),o=typeof n=="function"?n({present:r.isPresent}):f.Children.only(n),s=ie(r.ref,Pp(o));return typeof n=="function"||r.isPresent?f.cloneElement(o,{ref:s}):null};Dn.displayName="Presence";function Tp(e){const[t,n]=f.useState(),r=f.useRef(null),o=f.useRef(e),s=f.useRef("none"),a=e?"mounted":"unmounted",[i,l]=Ap(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return f.useEffect(()=>{const d=In(r.current);s.current=i==="mounted"?d:"none"},[i]),ye(()=>{const d=r.current,u=o.current;if(u!==e){const g=s.current,p=In(d);e?l("MOUNT"):p==="none"||d?.display==="none"?l("UNMOUNT"):l(u&&g!==p?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),ye(()=>{if(t){let d;const u=t.ownerDocument.defaultView??window,h=p=>{const m=In(r.current).includes(CSS.escape(p.animationName));if(p.target===t&&m&&(l("ANIMATION_END"),!o.current)){const v=t.style.animationFillMode;t.style.animationFillMode="forwards",d=u.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=v)})}},g=p=>{p.target===t&&(s.current=In(r.current))};return t.addEventListener("animationstart",g),t.addEventListener("animationcancel",h),t.addEventListener("animationend",h),()=>{u.clearTimeout(d),t.removeEventListener("animationstart",g),t.removeEventListener("animationcancel",h),t.removeEventListener("animationend",h)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(i),ref:f.useCallback(d=>{r.current=d?getComputedStyle(d):null,n(d)},[])}}function In(e){return e?.animationName||"none"}function Pp(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var _p=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],_a=_p.reduce((e,t)=>{const n=Ce(`Primitive.${t}`),r=f.forwardRef((o,s)=>{const{asChild:a,...i}=o,l=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(l,{...i,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),Ln="Popover",[Oa]=ct(Ln,[gn]),Qt=gn(),[Op,rt]=Oa(Ln),Ma=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:o,onOpenChange:s,modal:a=!1}=e,i=Qt(t),l=f.useRef(null),[d,u]=f.useState(!1),[h,g]=Rt({prop:r,defaultProp:o??!1,onChange:s,caller:Ln});return c.jsx(fs,{...i,children:c.jsx(Op,{scope:t,contentId:Ft(),triggerRef:l,open:h,onOpenChange:g,onOpenToggle:f.useCallback(()=>g(p=>!p),[g]),hasCustomAnchor:d,onCustomAnchorAdd:f.useCallback(()=>u(!0),[]),onCustomAnchorRemove:f.useCallback(()=>u(!1),[]),modal:a,children:n})})};Ma.displayName=Ln;var Da="PopoverAnchor",Mp=f.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=rt(Da,n),s=Qt(n),{onCustomAnchorAdd:a,onCustomAnchorRemove:i}=o;return f.useEffect(()=>(a(),()=>i()),[a,i]),c.jsx(Sr,{...s,...r,ref:t})});Mp.displayName=Da;var Ia="PopoverTrigger",La=f.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=rt(Ia,n),s=Qt(n),a=ie(t,o.triggerRef),i=c.jsx(_a.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":Wa(o.open),...r,ref:a,onClick:J(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?i:c.jsx(Sr,{asChild:!0,...s,children:i})});La.displayName=Ia;var jr="PopoverPortal",[Dp,Ip]=Oa(jr,{forceMount:void 0}),Fa=e=>{const{__scopePopover:t,forceMount:n,children:r,container:o}=e,s=rt(jr,t);return c.jsx(Dp,{scope:t,forceMount:n,children:c.jsx(Dn,{present:n||s.open,children:c.jsx(Cr,{asChild:!0,container:o,children:r})})})};Fa.displayName=jr;var Ot="PopoverContent",$a=f.forwardRef((e,t)=>{const n=Ip(Ot,e.__scopePopover),{forceMount:r=n.forceMount,...o}=e,s=rt(Ot,e.__scopePopover);return c.jsx(Dn,{present:r||s.open,children:s.modal?c.jsx(Fp,{...o,ref:t}):c.jsx($p,{...o,ref:t})})});$a.displayName=Ot;var Lp=Ce("PopoverContent.RemoveScroll"),Fp=f.forwardRef((e,t)=>{const n=rt(Ot,e.__scopePopover),r=f.useRef(null),o=ie(t,r),s=f.useRef(!1);return f.useEffect(()=>{const a=r.current;if(a)return ys(a)},[]),c.jsx(Pr,{as:Lp,allowPinchZoom:!0,children:c.jsx(za,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:J(e.onCloseAutoFocus,a=>{a.preventDefault(),s.current||n.triggerRef.current?.focus()}),onPointerDownOutside:J(e.onPointerDownOutside,a=>{const i=a.detail.originalEvent,l=i.button===0&&i.ctrlKey===!0,d=i.button===2||l;s.current=d},{checkForDefaultPrevented:!1}),onFocusOutside:J(e.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1})})})}),$p=f.forwardRef((e,t)=>{const n=rt(Ot,e.__scopePopover),r=f.useRef(!1),o=f.useRef(!1);return c.jsx(za,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{e.onCloseAutoFocus?.(s),s.defaultPrevented||(r.current||n.triggerRef.current?.focus(),s.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:s=>{e.onInteractOutside?.(s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const a=s.target;n.triggerRef.current?.contains(a)&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&o.current&&s.preventDefault()}})}),za=f.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:s,disableOutsidePointerEvents:a,onEscapeKeyDown:i,onPointerDownOutside:l,onFocusOutside:d,onInteractOutside:u,...h}=e,g=rt(Ot,n),p=Qt(n);return No(),c.jsx(ir,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:s,children:c.jsx(rr,{asChild:!0,disableOutsidePointerEvents:a,onInteractOutside:u,onEscapeKeyDown:i,onPointerDownOutside:l,onFocusOutside:d,onDismiss:()=>g.onOpenChange(!1),children:c.jsx(ps,{"data-state":Wa(g.open),role:"dialog",id:g.contentId,...p,...h,ref:t,style:{...h.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),Ra="PopoverClose",zp=f.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=rt(Ra,n);return c.jsx(_a.button,{type:"button",...r,ref:t,onClick:J(e.onClick,()=>o.onOpenChange(!1))})});zp.displayName=Ra;var Rp="PopoverArrow",Wp=f.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=Qt(n);return c.jsx(ms,{...o,...r,ref:t})});Wp.displayName=Rp;function Wa(e){return e?"open":"closed"}var Bp=Ma,Hp=La,Up=Fa,Vp=$a;function Ba(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=Ba(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function jp(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=Ba(e))&&(r&&(r+=" "),r+=t);return r}const Gp=(e,t)=>{const n=new Array(e.length+t.length);for(let r=0;r<e.length;r++)n[r]=e[r];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},Yp=(e,t)=>({classGroupId:e,validator:t}),Ha=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Fn="-",Ua=[],qp="arbitrary..",Kp=e=>{const t=Qp(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:a=>{if(a.startsWith("[")&&a.endsWith("]"))return Xp(a);const i=a.split(Fn),l=i[0]===""&&i.length>1?1:0;return Va(i,l,t)},getConflictingClassGroupIds:(a,i)=>{if(i){const l=r[a],d=n[a];return l?d?Gp(d,l):l:d||Ua}return n[a]||Ua}}},Va=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const o=e[t],s=n.nextPart.get(o);if(s){const d=Va(e,t+1,s);if(d)return d}const a=n.validators;if(a===null)return;const i=t===0?e.join(Fn):e.slice(t).join(Fn),l=a.length;for(let d=0;d<l;d++){const u=a[d];if(u.validator(i))return u.classGroupId}},Xp=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),r=t.slice(0,n);return r?qp+r:void 0})(),Qp=e=>{const{theme:t,classGroups:n}=e;return Zp(n,t)},Zp=(e,t)=>{const n=Ha();for(const r in e){const o=e[r];Gr(o,n,r,t)}return n},Gr=(e,t,n,r)=>{const o=e.length;for(let s=0;s<o;s++){const a=e[s];Jp(a,t,n,r)}},Jp=(e,t,n,r)=>{if(typeof e=="string"){em(e,t,n);return}if(typeof e=="function"){tm(e,t,n,r);return}nm(e,t,n,r)},em=(e,t,n)=>{const r=e===""?t:ja(t,e);r.classGroupId=n},tm=(e,t,n,r)=>{if(rm(e)){Gr(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(Yp(n,e))},nm=(e,t,n,r)=>{const o=Object.entries(e),s=o.length;for(let a=0;a<s;a++){const[i,l]=o[a];Gr(l,ja(t,i),n,r)}},ja=(e,t)=>{let n=e;const r=t.split(Fn),o=r.length;for(let s=0;s<o;s++){const a=r[s];let i=n.nextPart.get(a);i||(i=Ha(),n.nextPart.set(a,i)),n=i}return n},rm=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,om=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const o=(s,a)=>{n[s]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(s){let a=n[s];if(a!==void 0)return a;if((a=r[s])!==void 0)return o(s,a),a},set(s,a){s in n?n[s]=a:o(s,a)}}},Yr="!",Ga=":",sm=[],Ya=(e,t,n,r,o)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:o}),am=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=o=>{const s=[];let a=0,i=0,l=0,d;const u=o.length;for(let m=0;m<u;m++){const v=o[m];if(a===0&&i===0){if(v===Ga){s.push(o.slice(l,m)),l=m+1;continue}if(v==="/"){d=m;continue}}v==="["?a++:v==="]"?a--:v==="("?i++:v===")"&&i--}const h=s.length===0?o:o.slice(l);let g=h,p=!1;h.endsWith(Yr)?(g=h.slice(0,-1),p=!0):h.startsWith(Yr)&&(g=h.slice(1),p=!0);const b=d&&d>l?d-l:void 0;return Ya(s,p,g,b)};if(t){const o=t+Ga,s=r;r=a=>a.startsWith(o)?s(a.slice(o.length)):Ya(sm,!1,a,void 0,!0)}if(n){const o=r;r=s=>n({className:s,parseClassName:o})}return r},im=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let o=[];for(let s=0;s<n.length;s++){const a=n[s],i=a[0]==="[",l=t.has(a);i||l?(o.length>0&&(o.sort(),r.push(...o),o=[]),r.push(a)):o.push(a)}return o.length>0&&(o.sort(),r.push(...o)),r}},cm=e=>({cache:om(e.cacheSize),parseClassName:am(e),sortModifiers:im(e),...Kp(e)}),lm=/\s+/,dm=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o,sortModifiers:s}=t,a=[],i=e.trim().split(lm);let l="";for(let d=i.length-1;d>=0;d-=1){const u=i[d],{isExternal:h,modifiers:g,hasImportantModifier:p,baseClassName:b,maybePostfixModifierPosition:m}=n(u);if(h){l=u+(l.length>0?" "+l:l);continue}let v=!!m,C=r(v?b.substring(0,m):b);if(!C){if(!v){l=u+(l.length>0?" "+l:l);continue}if(C=r(b),!C){l=u+(l.length>0?" "+l:l);continue}v=!1}const N=g.length===0?"":g.length===1?g[0]:s(g).join(":"),E=p?N+Yr:N,x=E+C;if(a.indexOf(x)>-1)continue;a.push(x);const S=o(C,v);for(let A=0;A<S.length;++A){const _=S[A];a.push(E+_)}l=u+(l.length>0?" "+l:l)}return l},um=(...e)=>{let t=0,n,r,o="";for(;t<e.length;)(n=e[t++])&&(r=qa(n))&&(o&&(o+=" "),o+=r);return o},qa=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=qa(e[r]))&&(n&&(n+=" "),n+=t);return n},fm=(e,...t)=>{let n,r,o,s;const a=l=>{const d=t.reduce((u,h)=>h(u),e());return n=cm(d),r=n.cache.get,o=n.cache.set,s=i,i(l)},i=l=>{const d=r(l);if(d)return d;const u=dm(l,n);return o(l,u),u};return s=a,(...l)=>s(um(...l))},pm=[],fe=e=>{const t=n=>n[e]||pm;return t.isThemeGetter=!0,t},Ka=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Xa=/^\((?:(\w[\w-]*):)?(.+)\)$/i,mm=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,hm=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,gm=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,bm=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,ym=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,vm=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ot=e=>mm.test(e),K=e=>!!e&&!Number.isNaN(Number(e)),st=e=>!!e&&Number.isInteger(Number(e)),qr=e=>e.endsWith("%")&&K(e.slice(0,-1)),Ye=e=>hm.test(e),Qa=()=>!0,wm=e=>gm.test(e)&&!bm.test(e),Kr=()=>!1,xm=e=>ym.test(e),Sm=e=>vm.test(e),Cm=e=>!W(e)&&!B(e),Em=e=>at(e,ri,Kr),W=e=>Ka.test(e),mt=e=>at(e,oi,wm),Za=e=>at(e,Mm,K),Nm=e=>at(e,ai,Qa),km=e=>at(e,si,Kr),Ja=e=>at(e,ti,Kr),Am=e=>at(e,ni,Sm),$n=e=>at(e,ii,xm),B=e=>Xa.test(e),Zt=e=>ht(e,oi),Tm=e=>ht(e,si),ei=e=>ht(e,ti),Pm=e=>ht(e,ri),_m=e=>ht(e,ni),zn=e=>ht(e,ii,!0),Om=e=>ht(e,ai,!0),at=(e,t,n)=>{const r=Ka.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},ht=(e,t,n=!1)=>{const r=Xa.exec(e);return r?r[1]?t(r[1]):n:!1},ti=e=>e==="position"||e==="percentage",ni=e=>e==="image"||e==="url",ri=e=>e==="length"||e==="size"||e==="bg-size",oi=e=>e==="length",Mm=e=>e==="number",si=e=>e==="family-name",ai=e=>e==="number"||e==="weight",ii=e=>e==="shadow",Dm=fm(()=>{const e=fe("color"),t=fe("font"),n=fe("text"),r=fe("font-weight"),o=fe("tracking"),s=fe("leading"),a=fe("breakpoint"),i=fe("container"),l=fe("spacing"),d=fe("radius"),u=fe("shadow"),h=fe("inset-shadow"),g=fe("text-shadow"),p=fe("drop-shadow"),b=fe("blur"),m=fe("perspective"),v=fe("aspect"),C=fe("ease"),N=fe("animate"),E=()=>["auto","avoid","all","avoid-page","page","left","right","column"],x=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],S=()=>[...x(),B,W],A=()=>["auto","hidden","clip","visible","scroll"],_=()=>["auto","contain","none"],P=()=>[B,W,l],$=()=>[ot,"full","auto",...P()],z=()=>[st,"none","subgrid",B,W],H=()=>["auto",{span:["full",st,B,W]},st,B,W],G=()=>[st,"auto",B,W],w=()=>["auto","min","max","fr",B,W],k=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],D=()=>["start","end","center","stretch","center-safe","end-safe"],O=()=>["auto",...P()],I=()=>[ot,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...P()],T=()=>[ot,"screen","full","dvw","lvw","svw","min","max","fit",...P()],F=()=>[ot,"screen","full","lh","dvh","lvh","svh","min","max","fit",...P()],M=()=>[e,B,W],q=()=>[...x(),ei,Ja,{position:[B,W]}],de=()=>["no-repeat",{repeat:["","x","y","space","round"]}],Z=()=>["auto","cover","contain",Pm,Em,{size:[B,W]}],ge=()=>[qr,Zt,mt],Y=()=>["","none","full",d,B,W],oe=()=>["",K,Zt,mt],V=()=>["solid","dashed","dotted","double"],ee=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Q=()=>[K,qr,ei,Ja],te=()=>["","none",b,B,W],ne=()=>["none",K,B,W],se=()=>["none",K,B,W],ce=()=>[K,B,W],he=()=>[ot,"full",...P()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Ye],breakpoint:[Ye],color:[Qa],container:[Ye],"drop-shadow":[Ye],ease:["in","out","in-out"],font:[Cm],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Ye],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Ye],shadow:[Ye],spacing:["px",K],text:[Ye],"text-shadow":[Ye],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",ot,W,B,v]}],container:["container"],columns:[{columns:[K,W,B,i]}],"break-after":[{"break-after":E()}],"break-before":[{"break-before":E()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:S()}],overflow:[{overflow:A()}],"overflow-x":[{"overflow-x":A()}],"overflow-y":[{"overflow-y":A()}],overscroll:[{overscroll:_()}],"overscroll-x":[{"overscroll-x":_()}],"overscroll-y":[{"overscroll-y":_()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:$()}],"inset-x":[{"inset-x":$()}],"inset-y":[{"inset-y":$()}],start:[{"inset-s":$(),start:$()}],end:[{"inset-e":$(),end:$()}],"inset-bs":[{"inset-bs":$()}],"inset-be":[{"inset-be":$()}],top:[{top:$()}],right:[{right:$()}],bottom:[{bottom:$()}],left:[{left:$()}],visibility:["visible","invisible","collapse"],z:[{z:[st,"auto",B,W]}],basis:[{basis:[ot,"full","auto",i,...P()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[K,ot,"auto","initial","none",W]}],grow:[{grow:["",K,B,W]}],shrink:[{shrink:["",K,B,W]}],order:[{order:[st,"first","last","none",B,W]}],"grid-cols":[{"grid-cols":z()}],"col-start-end":[{col:H()}],"col-start":[{"col-start":G()}],"col-end":[{"col-end":G()}],"grid-rows":[{"grid-rows":z()}],"row-start-end":[{row:H()}],"row-start":[{"row-start":G()}],"row-end":[{"row-end":G()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":w()}],"auto-rows":[{"auto-rows":w()}],gap:[{gap:P()}],"gap-x":[{"gap-x":P()}],"gap-y":[{"gap-y":P()}],"justify-content":[{justify:[...k(),"normal"]}],"justify-items":[{"justify-items":[...D(),"normal"]}],"justify-self":[{"justify-self":["auto",...D()]}],"align-content":[{content:["normal",...k()]}],"align-items":[{items:[...D(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...D(),{baseline:["","last"]}]}],"place-content":[{"place-content":k()}],"place-items":[{"place-items":[...D(),"baseline"]}],"place-self":[{"place-self":["auto",...D()]}],p:[{p:P()}],px:[{px:P()}],py:[{py:P()}],ps:[{ps:P()}],pe:[{pe:P()}],pbs:[{pbs:P()}],pbe:[{pbe:P()}],pt:[{pt:P()}],pr:[{pr:P()}],pb:[{pb:P()}],pl:[{pl:P()}],m:[{m:O()}],mx:[{mx:O()}],my:[{my:O()}],ms:[{ms:O()}],me:[{me:O()}],mbs:[{mbs:O()}],mbe:[{mbe:O()}],mt:[{mt:O()}],mr:[{mr:O()}],mb:[{mb:O()}],ml:[{ml:O()}],"space-x":[{"space-x":P()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":P()}],"space-y-reverse":["space-y-reverse"],size:[{size:I()}],"inline-size":[{inline:["auto",...T()]}],"min-inline-size":[{"min-inline":["auto",...T()]}],"max-inline-size":[{"max-inline":["none",...T()]}],"block-size":[{block:["auto",...F()]}],"min-block-size":[{"min-block":["auto",...F()]}],"max-block-size":[{"max-block":["none",...F()]}],w:[{w:[i,"screen",...I()]}],"min-w":[{"min-w":[i,"screen","none",...I()]}],"max-w":[{"max-w":[i,"screen","none","prose",{screen:[a]},...I()]}],h:[{h:["screen","lh",...I()]}],"min-h":[{"min-h":["screen","lh","none",...I()]}],"max-h":[{"max-h":["screen","lh",...I()]}],"font-size":[{text:["base",n,Zt,mt]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,Om,Nm]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",qr,W]}],"font-family":[{font:[Tm,km,t]}],"font-features":[{"font-features":[W]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[o,B,W]}],"line-clamp":[{"line-clamp":[K,"none",B,Za]}],leading:[{leading:[s,...P()]}],"list-image":[{"list-image":["none",B,W]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",B,W]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:M()}],"text-color":[{text:M()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...V(),"wavy"]}],"text-decoration-thickness":[{decoration:[K,"from-font","auto",B,mt]}],"text-decoration-color":[{decoration:M()}],"underline-offset":[{"underline-offset":[K,"auto",B,W]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:P()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",B,W]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",B,W]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:q()}],"bg-repeat":[{bg:de()}],"bg-size":[{bg:Z()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},st,B,W],radial:["",B,W],conic:[st,B,W]},_m,Am]}],"bg-color":[{bg:M()}],"gradient-from-pos":[{from:ge()}],"gradient-via-pos":[{via:ge()}],"gradient-to-pos":[{to:ge()}],"gradient-from":[{from:M()}],"gradient-via":[{via:M()}],"gradient-to":[{to:M()}],rounded:[{rounded:Y()}],"rounded-s":[{"rounded-s":Y()}],"rounded-e":[{"rounded-e":Y()}],"rounded-t":[{"rounded-t":Y()}],"rounded-r":[{"rounded-r":Y()}],"rounded-b":[{"rounded-b":Y()}],"rounded-l":[{"rounded-l":Y()}],"rounded-ss":[{"rounded-ss":Y()}],"rounded-se":[{"rounded-se":Y()}],"rounded-ee":[{"rounded-ee":Y()}],"rounded-es":[{"rounded-es":Y()}],"rounded-tl":[{"rounded-tl":Y()}],"rounded-tr":[{"rounded-tr":Y()}],"rounded-br":[{"rounded-br":Y()}],"rounded-bl":[{"rounded-bl":Y()}],"border-w":[{border:oe()}],"border-w-x":[{"border-x":oe()}],"border-w-y":[{"border-y":oe()}],"border-w-s":[{"border-s":oe()}],"border-w-e":[{"border-e":oe()}],"border-w-bs":[{"border-bs":oe()}],"border-w-be":[{"border-be":oe()}],"border-w-t":[{"border-t":oe()}],"border-w-r":[{"border-r":oe()}],"border-w-b":[{"border-b":oe()}],"border-w-l":[{"border-l":oe()}],"divide-x":[{"divide-x":oe()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":oe()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...V(),"hidden","none"]}],"divide-style":[{divide:[...V(),"hidden","none"]}],"border-color":[{border:M()}],"border-color-x":[{"border-x":M()}],"border-color-y":[{"border-y":M()}],"border-color-s":[{"border-s":M()}],"border-color-e":[{"border-e":M()}],"border-color-bs":[{"border-bs":M()}],"border-color-be":[{"border-be":M()}],"border-color-t":[{"border-t":M()}],"border-color-r":[{"border-r":M()}],"border-color-b":[{"border-b":M()}],"border-color-l":[{"border-l":M()}],"divide-color":[{divide:M()}],"outline-style":[{outline:[...V(),"none","hidden"]}],"outline-offset":[{"outline-offset":[K,B,W]}],"outline-w":[{outline:["",K,Zt,mt]}],"outline-color":[{outline:M()}],shadow:[{shadow:["","none",u,zn,$n]}],"shadow-color":[{shadow:M()}],"inset-shadow":[{"inset-shadow":["none",h,zn,$n]}],"inset-shadow-color":[{"inset-shadow":M()}],"ring-w":[{ring:oe()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:M()}],"ring-offset-w":[{"ring-offset":[K,mt]}],"ring-offset-color":[{"ring-offset":M()}],"inset-ring-w":[{"inset-ring":oe()}],"inset-ring-color":[{"inset-ring":M()}],"text-shadow":[{"text-shadow":["none",g,zn,$n]}],"text-shadow-color":[{"text-shadow":M()}],opacity:[{opacity:[K,B,W]}],"mix-blend":[{"mix-blend":[...ee(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ee()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[K]}],"mask-image-linear-from-pos":[{"mask-linear-from":Q()}],"mask-image-linear-to-pos":[{"mask-linear-to":Q()}],"mask-image-linear-from-color":[{"mask-linear-from":M()}],"mask-image-linear-to-color":[{"mask-linear-to":M()}],"mask-image-t-from-pos":[{"mask-t-from":Q()}],"mask-image-t-to-pos":[{"mask-t-to":Q()}],"mask-image-t-from-color":[{"mask-t-from":M()}],"mask-image-t-to-color":[{"mask-t-to":M()}],"mask-image-r-from-pos":[{"mask-r-from":Q()}],"mask-image-r-to-pos":[{"mask-r-to":Q()}],"mask-image-r-from-color":[{"mask-r-from":M()}],"mask-image-r-to-color":[{"mask-r-to":M()}],"mask-image-b-from-pos":[{"mask-b-from":Q()}],"mask-image-b-to-pos":[{"mask-b-to":Q()}],"mask-image-b-from-color":[{"mask-b-from":M()}],"mask-image-b-to-color":[{"mask-b-to":M()}],"mask-image-l-from-pos":[{"mask-l-from":Q()}],"mask-image-l-to-pos":[{"mask-l-to":Q()}],"mask-image-l-from-color":[{"mask-l-from":M()}],"mask-image-l-to-color":[{"mask-l-to":M()}],"mask-image-x-from-pos":[{"mask-x-from":Q()}],"mask-image-x-to-pos":[{"mask-x-to":Q()}],"mask-image-x-from-color":[{"mask-x-from":M()}],"mask-image-x-to-color":[{"mask-x-to":M()}],"mask-image-y-from-pos":[{"mask-y-from":Q()}],"mask-image-y-to-pos":[{"mask-y-to":Q()}],"mask-image-y-from-color":[{"mask-y-from":M()}],"mask-image-y-to-color":[{"mask-y-to":M()}],"mask-image-radial":[{"mask-radial":[B,W]}],"mask-image-radial-from-pos":[{"mask-radial-from":Q()}],"mask-image-radial-to-pos":[{"mask-radial-to":Q()}],"mask-image-radial-from-color":[{"mask-radial-from":M()}],"mask-image-radial-to-color":[{"mask-radial-to":M()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":x()}],"mask-image-conic-pos":[{"mask-conic":[K]}],"mask-image-conic-from-pos":[{"mask-conic-from":Q()}],"mask-image-conic-to-pos":[{"mask-conic-to":Q()}],"mask-image-conic-from-color":[{"mask-conic-from":M()}],"mask-image-conic-to-color":[{"mask-conic-to":M()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:q()}],"mask-repeat":[{mask:de()}],"mask-size":[{mask:Z()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",B,W]}],filter:[{filter:["","none",B,W]}],blur:[{blur:te()}],brightness:[{brightness:[K,B,W]}],contrast:[{contrast:[K,B,W]}],"drop-shadow":[{"drop-shadow":["","none",p,zn,$n]}],"drop-shadow-color":[{"drop-shadow":M()}],grayscale:[{grayscale:["",K,B,W]}],"hue-rotate":[{"hue-rotate":[K,B,W]}],invert:[{invert:["",K,B,W]}],saturate:[{saturate:[K,B,W]}],sepia:[{sepia:["",K,B,W]}],"backdrop-filter":[{"backdrop-filter":["","none",B,W]}],"backdrop-blur":[{"backdrop-blur":te()}],"backdrop-brightness":[{"backdrop-brightness":[K,B,W]}],"backdrop-contrast":[{"backdrop-contrast":[K,B,W]}],"backdrop-grayscale":[{"backdrop-grayscale":["",K,B,W]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[K,B,W]}],"backdrop-invert":[{"backdrop-invert":["",K,B,W]}],"backdrop-opacity":[{"backdrop-opacity":[K,B,W]}],"backdrop-saturate":[{"backdrop-saturate":[K,B,W]}],"backdrop-sepia":[{"backdrop-sepia":["",K,B,W]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":P()}],"border-spacing-x":[{"border-spacing-x":P()}],"border-spacing-y":[{"border-spacing-y":P()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",B,W]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[K,"initial",B,W]}],ease:[{ease:["linear","initial",C,B,W]}],delay:[{delay:[K,B,W]}],animate:[{animate:["none",N,B,W]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[m,B,W]}],"perspective-origin":[{"perspective-origin":S()}],rotate:[{rotate:ne()}],"rotate-x":[{"rotate-x":ne()}],"rotate-y":[{"rotate-y":ne()}],"rotate-z":[{"rotate-z":ne()}],scale:[{scale:se()}],"scale-x":[{"scale-x":se()}],"scale-y":[{"scale-y":se()}],"scale-z":[{"scale-z":se()}],"scale-3d":["scale-3d"],skew:[{skew:ce()}],"skew-x":[{"skew-x":ce()}],"skew-y":[{"skew-y":ce()}],transform:[{transform:[B,W,"","none","gpu","cpu"]}],"transform-origin":[{origin:S()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:he()}],"translate-x":[{"translate-x":he()}],"translate-y":[{"translate-y":he()}],"translate-z":[{"translate-z":he()}],"translate-none":["translate-none"],accent:[{accent:M()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:M()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",B,W]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":P()}],"scroll-mx":[{"scroll-mx":P()}],"scroll-my":[{"scroll-my":P()}],"scroll-ms":[{"scroll-ms":P()}],"scroll-me":[{"scroll-me":P()}],"scroll-mbs":[{"scroll-mbs":P()}],"scroll-mbe":[{"scroll-mbe":P()}],"scroll-mt":[{"scroll-mt":P()}],"scroll-mr":[{"scroll-mr":P()}],"scroll-mb":[{"scroll-mb":P()}],"scroll-ml":[{"scroll-ml":P()}],"scroll-p":[{"scroll-p":P()}],"scroll-px":[{"scroll-px":P()}],"scroll-py":[{"scroll-py":P()}],"scroll-ps":[{"scroll-ps":P()}],"scroll-pe":[{"scroll-pe":P()}],"scroll-pbs":[{"scroll-pbs":P()}],"scroll-pbe":[{"scroll-pbe":P()}],"scroll-pt":[{"scroll-pt":P()}],"scroll-pr":[{"scroll-pr":P()}],"scroll-pb":[{"scroll-pb":P()}],"scroll-pl":[{"scroll-pl":P()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",B,W]}],fill:[{fill:["none",...M()]}],"stroke-w":[{stroke:[K,Zt,mt,Za]}],stroke:[{stroke:["none",...M()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}});function Rn(...e){return Dm(jp(e))}function Wn({...e}){return c.jsx(Bp,{"data-slot":"popover",...e})}function Bn({...e}){return c.jsx(Hp,{"data-slot":"popover-trigger",...e})}function Hn({className:e,align:t="center",sideOffset:n=4,...r}){return c.jsx(Up,{children:c.jsx(Vp,{"data-slot":"popover-content",align:t,sideOffset:n,className:Rn("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",e),...r})})}function Im({field:e,formValues:t,handleChange:n,handleBlur:r,error:o,disabled:s}){const[a,i]=R.useState(!1),l=p=>{if(!p)return;if(p instanceof Date)return qt(p)?p:void 0;if(typeof p=="string"){const m=p.match(/^(\d{4})-(\d{2})-(\d{2})$/);if(m){const[,N,E,x]=m,S=new Date(Number(N),Number(E)-1,Number(x));return qt(S)?S:void 0}const v=p.includes("T")?p:p.replace(" ","T"),C=new Date(v);return qt(C)?C:void 0}const b=new Date(p);return qt(b)?b:void 0},d=t[e.name],u=R.useMemo(()=>{const p={from:void 0,to:void 0};if(!d)return p;if(Array.isArray(d)){const b=d[0]?.startDate||d[0],m=d[0]?.endDate||d[1];return{from:l(b),to:l(m)}}return{from:l(d.from),to:l(d.to)}},[d]),h=p=>{p.preventDefault(),p.stopPropagation(),n(e.name,{from:void 0,to:void 0}),r(e.name)},g=[];if(e.maxDate){const p=l(e.maxDate);p&&g.push({after:p})}if(e.minDate){const p=l(e.minDate);p&&g.push({before:p})}return c.jsx("div",{className:"relative w-full",children:c.jsxs(Wn,{open:s?!1:a,onOpenChange:p=>{s||i(p)},children:[c.jsx(Bn,{asChild:!0,children:c.jsxs("div",{role:"combobox","aria-expanded":a,"aria-haspopup":"dialog","aria-controls":`${e.name}-popover`,tabIndex:s?-1:0,onClick:()=>!s&&i(!0),onKeyDown:p=>{s||(p.key==="Enter"||p.key===" ")&&(p.preventDefault(),i(!0))},className:`
89
+ `;if(b.length>0){const k=Array.isArray(t[e.name])?t[e.name]:[],E=(w,x)=>{let A=x?[...k,w]:k.filter(O=>O!==w);n(e.name,A),r(e.name)};return c.jsxs("fieldset",{className:"mt-2","aria-invalid":!!o,"aria-describedby":o?v:void 0,children:[c.jsx("legend",{className:"sr-only",children:e.label}),c.jsx("div",{className:m?"flex flex-wrap gap-x-6 gap-y-3":"space-y-4",children:b.map(w=>{const x=typeof w=="object"?w.value:w,A=typeof w=="object"?w.label:w,O=typeof w=="object"?w.description:null,T=`${e.name}-${x}`,$=k.includes(x);return c.jsxs("div",{className:"relative flex items-start group",children:[c.jsx("div",{className:"flex h-6 items-center",children:c.jsx("input",{...e.props,...g,type:"checkbox",id:T,checked:$,onChange:z=>E(x,z.target.checked),onBlur:()=>r(e.name),disabled:p,className:`${S} ${!p&&"cursor-pointer hover:border-primary/50"} ${o?"border-destructive ring-destructive/20":"border-input"}`})}),c.jsxs("div",{className:"ml-3 text-sm leading-6",children:[c.jsx("label",{htmlFor:T,className:`font-medium select-none transition-colors ${p?"text-muted-foreground":"text-foreground cursor-pointer group-hover:text-primary"}`,children:A}),O&&!m&&c.jsx("p",{className:`text-xs ${p?"text-muted-foreground/60":"text-muted-foreground"}`,children:O})]})]},x)})})]})}return c.jsxs("div",{className:"mt-1 flex items-start group",children:[c.jsx("div",{className:"flex h-6 items-center",children:c.jsx("input",{...e.props,...g,id:e.name,type:"checkbox",checked:!!t[e.name],onChange:k=>{n(e.name,k.target.checked),r(e.name)},onBlur:()=>r(e.name),disabled:p,className:`${S} ${!p&&"cursor-pointer hover:border-primary/50"} ${o?"border-destructive":"border-input"}`})}),c.jsx("div",{className:"ml-3 text-sm leading-6",children:c.jsxs("label",{htmlFor:e.name,className:`font-medium select-none transition-colors ${p?"text-muted-foreground":"text-foreground cursor-pointer group-hover:text-primary"}`,children:[e.label,e.required&&c.jsx("span",{className:"text-destructive ml-1","aria-hidden":"true",children:"*"})]})})]})}const va=6048e5,Ef=864e5,wa=Symbol.for("constructDateFrom");function tt(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&wa in e?e[wa](t):e instanceof Date?new e.constructor(t):new Date(t)}function Ie(e,t){return tt(t||e,e)}let Nf={};function _n(){return Nf}function Yt(e,t){const n=_n(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,o=Ie(e,t?.in),s=o.getDay(),a=(s<r?7:0)+s-r;return o.setDate(o.getDate()-a),o.setHours(0,0,0,0),o}function On(e,t){return Yt(e,{...t,weekStartsOn:1})}function xa(e,t){const n=Ie(e,t?.in),r=n.getFullYear(),o=tt(n,0);o.setFullYear(r+1,0,4),o.setHours(0,0,0,0);const s=On(o),a=tt(n,0);a.setFullYear(r,0,4),a.setHours(0,0,0,0);const i=On(a);return n.getTime()>=s.getTime()?r+1:n.getTime()>=i.getTime()?r:r-1}function Sa(e){const t=Ie(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function kf(e,...t){const n=tt.bind(null,t.find(r=>typeof r=="object"));return t.map(n)}function Ca(e,t){const n=Ie(e,t?.in);return n.setHours(0,0,0,0),n}function Af(e,t,n){const[r,o]=kf(n?.in,e,t),s=Ca(r),a=Ca(o),i=+s-Sa(s),l=+a-Sa(a);return Math.round((i-l)/Ef)}function Tf(e,t){const n=xa(e,t),r=tt(e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),On(r)}function Pf(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function qt(e){return!(!Pf(e)&&typeof e!="number"||isNaN(+Ie(e)))}function _f(e,t){const n=Ie(e,t?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}const Of={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},Mf=(e,t,n)=>{let r;const o=Of[e];return typeof o=="string"?r=o:t===1?r=o.one:r=o.other.replace("{{count}}",t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function Vr(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const Df={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},If={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Lf={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Ff={date:Vr({formats:Df,defaultWidth:"full"}),time:Vr({formats:If,defaultWidth:"full"}),dateTime:Vr({formats:Lf,defaultWidth:"full"})},$f={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},zf=(e,t,n,r)=>$f[e];function Kt(e){return(t,n)=>{const r=n?.context?String(n.context):"standalone";let o;if(r==="formatting"&&e.formattingValues){const a=e.defaultFormattingWidth||e.defaultWidth,i=n?.width?String(n.width):a;o=e.formattingValues[i]||e.formattingValues[a]}else{const a=e.defaultWidth,i=n?.width?String(n.width):e.defaultWidth;o=e.values[i]||e.values[a]}const s=e.argumentCallback?e.argumentCallback(t):t;return o[s]}}const Rf={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Wf={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Bf={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},Hf={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},Uf={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},Vf={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},jf={ordinalNumber:(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:Kt({values:Rf,defaultWidth:"wide"}),quarter:Kt({values:Wf,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Kt({values:Bf,defaultWidth:"wide"}),day:Kt({values:Hf,defaultWidth:"wide"}),dayPeriod:Kt({values:Uf,defaultWidth:"wide",formattingValues:Vf,defaultFormattingWidth:"wide"})};function Xt(e){return(t,n={})=>{const r=n.width,o=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],s=t.match(o);if(!s)return null;const a=s[0],i=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(i)?Yf(i,h=>h.test(a)):Gf(i,h=>h.test(a));let u;u=e.valueCallback?e.valueCallback(l):l,u=n.valueCallback?n.valueCallback(u):u;const d=t.slice(a.length);return{value:u,rest:d}}}function Gf(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function Yf(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function qf(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const o=r[0],s=t.match(e.parsePattern);if(!s)return null;let a=e.valueCallback?e.valueCallback(s[0]):s[0];a=n.valueCallback?n.valueCallback(a):a;const i=t.slice(o.length);return{value:a,rest:i}}}const Kf=/^(\d+)(th|st|nd|rd)?/i,Xf=/\d+/i,Qf={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},Zf={any:[/^b/i,/^(a|c)/i]},Jf={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},ep={any:[/1/i,/2/i,/3/i,/4/i]},tp={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},np={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},rp={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},op={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},sp={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},ap={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},ip={ordinalNumber:qf({matchPattern:Kf,parsePattern:Xf,valueCallback:e=>parseInt(e,10)}),era:Xt({matchPatterns:Qf,defaultMatchWidth:"wide",parsePatterns:Zf,defaultParseWidth:"any"}),quarter:Xt({matchPatterns:Jf,defaultMatchWidth:"wide",parsePatterns:ep,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Xt({matchPatterns:tp,defaultMatchWidth:"wide",parsePatterns:np,defaultParseWidth:"any"}),day:Xt({matchPatterns:rp,defaultMatchWidth:"wide",parsePatterns:op,defaultParseWidth:"any"}),dayPeriod:Xt({matchPatterns:sp,defaultMatchWidth:"any",parsePatterns:ap,defaultParseWidth:"any"})},cp={code:"en-US",formatDistance:Mf,formatLong:Ff,formatRelative:zf,localize:jf,match:ip,options:{weekStartsOn:0,firstWeekContainsDate:1}};function lp(e,t){const n=Ie(e,t?.in);return Af(n,_f(n))+1}function up(e,t){const n=Ie(e,t?.in),r=+On(n)-+Tf(n);return Math.round(r/va)+1}function Ea(e,t){const n=Ie(e,t?.in),r=n.getFullYear(),o=_n(),s=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??o.firstWeekContainsDate??o.locale?.options?.firstWeekContainsDate??1,a=tt(t?.in||e,0);a.setFullYear(r+1,0,s),a.setHours(0,0,0,0);const i=Yt(a,t),l=tt(t?.in||e,0);l.setFullYear(r,0,s),l.setHours(0,0,0,0);const u=Yt(l,t);return+n>=+i?r+1:+n>=+u?r:r-1}function dp(e,t){const n=_n(),r=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,o=Ea(e,t),s=tt(t?.in||e,0);return s.setFullYear(o,0,r),s.setHours(0,0,0,0),Yt(s,t)}function fp(e,t){const n=Ie(e,t?.in),r=+Yt(n,t)-+dp(n,t);return Math.round(r/va)+1}function re(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const nt={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return re(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):re(n+1,2)},d(e,t){return re(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];default:return n==="am"?"a.m.":"p.m."}},h(e,t){return re(e.getHours()%12||12,t.length)},H(e,t){return re(e.getHours(),t.length)},m(e,t){return re(e.getMinutes(),t.length)},s(e,t){return re(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),o=Math.trunc(r*Math.pow(10,n-3));return re(o,t.length)}},_t={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Na={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const r=e.getFullYear(),o=r>0?r:1-r;return n.ordinalNumber(o,{unit:"year"})}return nt.y(e,t)},Y:function(e,t,n,r){const o=Ea(e,r),s=o>0?o:1-o;if(t==="YY"){const a=s%100;return re(a,2)}return t==="Yo"?n.ordinalNumber(s,{unit:"year"}):re(s,t.length)},R:function(e,t){const n=xa(e);return re(n,t.length)},u:function(e,t){const n=e.getFullYear();return re(n,t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return re(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return re(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return nt.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return re(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const o=fp(e,r);return t==="wo"?n.ordinalNumber(o,{unit:"week"}):re(o,t.length)},I:function(e,t,n){const r=up(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):re(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):nt.d(e,t)},D:function(e,t,n){const r=lp(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):re(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const o=e.getDay(),s=(o-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(s);case"ee":return re(s,2);case"eo":return n.ordinalNumber(s,{unit:"day"});case"eee":return n.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(o,{width:"short",context:"formatting"});default:return n.day(o,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const o=e.getDay(),s=(o-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(s);case"cc":return re(s,t.length);case"co":return n.ordinalNumber(s,{unit:"day"});case"ccc":return n.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(o,{width:"narrow",context:"standalone"});case"cccccc":return n.day(o,{width:"short",context:"standalone"});default:return n.day(o,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),o=r===0?7:r;switch(t){case"i":return String(o);case"ii":return re(o,t.length);case"io":return n.ordinalNumber(o,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const o=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(o,{width:"narrow",context:"formatting"});default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let o;switch(r===12?o=_t.noon:r===0?o=_t.midnight:o=r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(o,{width:"narrow",context:"formatting"});default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let o;switch(r>=17?o=_t.evening:r>=12?o=_t.afternoon:r>=4?o=_t.morning:o=_t.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(o,{width:"narrow",context:"formatting"});default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let r=e.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return nt.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):nt.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):re(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):re(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):nt.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):nt.s(e,t)},S:function(e,t){return nt.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return Aa(r);case"XXXX":case"XX":return pt(r);default:return pt(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return Aa(r);case"xxxx":case"xx":return pt(r);default:return pt(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+ka(r,":");default:return"GMT"+pt(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+ka(r,":");default:return"GMT"+pt(r,":")}},t:function(e,t,n){const r=Math.trunc(+e/1e3);return re(r,t.length)},T:function(e,t,n){return re(+e,t.length)}};function ka(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),o=Math.trunc(r/60),s=r%60;return s===0?n+String(o):n+String(o)+t+re(s,2)}function Aa(e,t){return e%60===0?(e>0?"-":"+")+re(Math.abs(e)/60,2):pt(e,t)}function pt(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),o=re(Math.trunc(r/60),2),s=re(r%60,2);return n+o+t+s}const Ta=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}},Pa=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}},pp={p:Pa,P:(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],o=n[2];if(!o)return Ta(e,t);let s;switch(r){case"P":s=t.dateTime({width:"short"});break;case"PP":s=t.dateTime({width:"medium"});break;case"PPP":s=t.dateTime({width:"long"});break;default:s=t.dateTime({width:"full"});break}return s.replace("{{date}}",Ta(r,t)).replace("{{time}}",Pa(o,t))}},mp=/^D+$/,hp=/^Y+$/,gp=["D","DD","YY","YYYY"];function bp(e){return mp.test(e)}function yp(e){return hp.test(e)}function vp(e,t,n){const r=wp(e,t,n);if(console.warn(r),gp.includes(e))throw new RangeError(r)}function wp(e,t,n){const r=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const xp=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Sp=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Cp=/^'([^]*?)'?$/,Ep=/''/g,Np=/[a-zA-Z]/;function Mn(e,t,n){const r=_n(),o=r.locale??cp,s=r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,a=r.weekStartsOn??r.locale?.options?.weekStartsOn??0,i=Ie(e,n?.in);if(!qt(i))throw new RangeError("Invalid time value");let l=t.match(Sp).map(d=>{const h=d[0];if(h==="p"||h==="P"){const g=pp[h];return g(d,o.formatLong)}return d}).join("").match(xp).map(d=>{if(d==="''")return{isToken:!1,value:"'"};const h=d[0];if(h==="'")return{isToken:!1,value:kp(d)};if(Na[h])return{isToken:!0,value:d};if(h.match(Np))throw new RangeError("Format string contains an unescaped latin alphabet character `"+h+"`");return{isToken:!1,value:d}});o.localize.preprocessor&&(l=o.localize.preprocessor(i,l));const u={firstWeekContainsDate:s,weekStartsOn:a,locale:o};return l.map(d=>{if(!d.isToken)return d.value;const h=d.value;(yp(h)||bp(h))&&vp(h,t,String(e));const g=Na[h[0]];return g(i,h,o.localize,u)}).join("")}function kp(e){const t=e.match(Cp);return t?t[1].replace(Ep,"'"):e}function Ap(e,t){return f.useReducer((n,r)=>t[n][r]??n,e)}var Dn=e=>{const{present:t,children:n}=e,r=Tp(t),o=typeof n=="function"?n({present:r.isPresent}):f.Children.only(n),s=ce(r.ref,Pp(o));return typeof n=="function"||r.isPresent?f.cloneElement(o,{ref:s}):null};Dn.displayName="Presence";function Tp(e){const[t,n]=f.useState(),r=f.useRef(null),o=f.useRef(e),s=f.useRef("none"),a=e?"mounted":"unmounted",[i,l]=Ap(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return f.useEffect(()=>{const u=In(r.current);s.current=i==="mounted"?u:"none"},[i]),ye(()=>{const u=r.current,d=o.current;if(d!==e){const g=s.current,p=In(u);e?l("MOUNT"):p==="none"||u?.display==="none"?l("UNMOUNT"):l(d&&g!==p?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),ye(()=>{if(t){let u;const d=t.ownerDocument.defaultView??window,h=p=>{const m=In(r.current).includes(CSS.escape(p.animationName));if(p.target===t&&m&&(l("ANIMATION_END"),!o.current)){const v=t.style.animationFillMode;t.style.animationFillMode="forwards",u=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=v)})}},g=p=>{p.target===t&&(s.current=In(r.current))};return t.addEventListener("animationstart",g),t.addEventListener("animationcancel",h),t.addEventListener("animationend",h),()=>{d.clearTimeout(u),t.removeEventListener("animationstart",g),t.removeEventListener("animationcancel",h),t.removeEventListener("animationend",h)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(i),ref:f.useCallback(u=>{r.current=u?getComputedStyle(u):null,n(u)},[])}}function In(e){return e?.animationName||"none"}function Pp(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var _p=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],_a=_p.reduce((e,t)=>{const n=Ce(`Primitive.${t}`),r=f.forwardRef((o,s)=>{const{asChild:a,...i}=o,l=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(l,{...i,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),Ln="Popover",[Oa]=ct(Ln,[gn]),Qt=gn(),[Op,rt]=Oa(Ln),Ma=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:o,onOpenChange:s,modal:a=!1}=e,i=Qt(t),l=f.useRef(null),[u,d]=f.useState(!1),[h,g]=Rt({prop:r,defaultProp:o??!1,onChange:s,caller:Ln});return c.jsx(fs,{...i,children:c.jsx(Op,{scope:t,contentId:Ft(),triggerRef:l,open:h,onOpenChange:g,onOpenToggle:f.useCallback(()=>g(p=>!p),[g]),hasCustomAnchor:u,onCustomAnchorAdd:f.useCallback(()=>d(!0),[]),onCustomAnchorRemove:f.useCallback(()=>d(!1),[]),modal:a,children:n})})};Ma.displayName=Ln;var Da="PopoverAnchor",Mp=f.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=rt(Da,n),s=Qt(n),{onCustomAnchorAdd:a,onCustomAnchorRemove:i}=o;return f.useEffect(()=>(a(),()=>i()),[a,i]),c.jsx(Sr,{...s,...r,ref:t})});Mp.displayName=Da;var Ia="PopoverTrigger",La=f.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=rt(Ia,n),s=Qt(n),a=ce(t,o.triggerRef),i=c.jsx(_a.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":Wa(o.open),...r,ref:a,onClick:J(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?i:c.jsx(Sr,{asChild:!0,...s,children:i})});La.displayName=Ia;var jr="PopoverPortal",[Dp,Ip]=Oa(jr,{forceMount:void 0}),Fa=e=>{const{__scopePopover:t,forceMount:n,children:r,container:o}=e,s=rt(jr,t);return c.jsx(Dp,{scope:t,forceMount:n,children:c.jsx(Dn,{present:n||s.open,children:c.jsx(Cr,{asChild:!0,container:o,children:r})})})};Fa.displayName=jr;var Ot="PopoverContent",$a=f.forwardRef((e,t)=>{const n=Ip(Ot,e.__scopePopover),{forceMount:r=n.forceMount,...o}=e,s=rt(Ot,e.__scopePopover);return c.jsx(Dn,{present:r||s.open,children:s.modal?c.jsx(Fp,{...o,ref:t}):c.jsx($p,{...o,ref:t})})});$a.displayName=Ot;var Lp=Ce("PopoverContent.RemoveScroll"),Fp=f.forwardRef((e,t)=>{const n=rt(Ot,e.__scopePopover),r=f.useRef(null),o=ce(t,r),s=f.useRef(!1);return f.useEffect(()=>{const a=r.current;if(a)return ys(a)},[]),c.jsx(Pr,{as:Lp,allowPinchZoom:!0,children:c.jsx(za,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:J(e.onCloseAutoFocus,a=>{a.preventDefault(),s.current||n.triggerRef.current?.focus()}),onPointerDownOutside:J(e.onPointerDownOutside,a=>{const i=a.detail.originalEvent,l=i.button===0&&i.ctrlKey===!0,u=i.button===2||l;s.current=u},{checkForDefaultPrevented:!1}),onFocusOutside:J(e.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1})})})}),$p=f.forwardRef((e,t)=>{const n=rt(Ot,e.__scopePopover),r=f.useRef(!1),o=f.useRef(!1);return c.jsx(za,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{e.onCloseAutoFocus?.(s),s.defaultPrevented||(r.current||n.triggerRef.current?.focus(),s.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:s=>{e.onInteractOutside?.(s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const a=s.target;n.triggerRef.current?.contains(a)&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&o.current&&s.preventDefault()}})}),za=f.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:s,disableOutsidePointerEvents:a,onEscapeKeyDown:i,onPointerDownOutside:l,onFocusOutside:u,onInteractOutside:d,...h}=e,g=rt(Ot,n),p=Qt(n);return No(),c.jsx(ir,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:s,children:c.jsx(rr,{asChild:!0,disableOutsidePointerEvents:a,onInteractOutside:d,onEscapeKeyDown:i,onPointerDownOutside:l,onFocusOutside:u,onDismiss:()=>g.onOpenChange(!1),children:c.jsx(ps,{"data-state":Wa(g.open),role:"dialog",id:g.contentId,...p,...h,ref:t,style:{...h.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),Ra="PopoverClose",zp=f.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=rt(Ra,n);return c.jsx(_a.button,{type:"button",...r,ref:t,onClick:J(e.onClick,()=>o.onOpenChange(!1))})});zp.displayName=Ra;var Rp="PopoverArrow",Wp=f.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=Qt(n);return c.jsx(ms,{...o,...r,ref:t})});Wp.displayName=Rp;function Wa(e){return e?"open":"closed"}var Bp=Ma,Hp=La,Up=Fa,Vp=$a;function Ba(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=Ba(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function jp(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=Ba(e))&&(r&&(r+=" "),r+=t);return r}const Gp=(e,t)=>{const n=new Array(e.length+t.length);for(let r=0;r<e.length;r++)n[r]=e[r];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},Yp=(e,t)=>({classGroupId:e,validator:t}),Ha=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Fn="-",Ua=[],qp="arbitrary..",Kp=e=>{const t=Qp(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:a=>{if(a.startsWith("[")&&a.endsWith("]"))return Xp(a);const i=a.split(Fn),l=i[0]===""&&i.length>1?1:0;return Va(i,l,t)},getConflictingClassGroupIds:(a,i)=>{if(i){const l=r[a],u=n[a];return l?u?Gp(u,l):l:u||Ua}return n[a]||Ua}}},Va=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const o=e[t],s=n.nextPart.get(o);if(s){const u=Va(e,t+1,s);if(u)return u}const a=n.validators;if(a===null)return;const i=t===0?e.join(Fn):e.slice(t).join(Fn),l=a.length;for(let u=0;u<l;u++){const d=a[u];if(d.validator(i))return d.classGroupId}},Xp=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),r=t.slice(0,n);return r?qp+r:void 0})(),Qp=e=>{const{theme:t,classGroups:n}=e;return Zp(n,t)},Zp=(e,t)=>{const n=Ha();for(const r in e){const o=e[r];Gr(o,n,r,t)}return n},Gr=(e,t,n,r)=>{const o=e.length;for(let s=0;s<o;s++){const a=e[s];Jp(a,t,n,r)}},Jp=(e,t,n,r)=>{if(typeof e=="string"){em(e,t,n);return}if(typeof e=="function"){tm(e,t,n,r);return}nm(e,t,n,r)},em=(e,t,n)=>{const r=e===""?t:ja(t,e);r.classGroupId=n},tm=(e,t,n,r)=>{if(rm(e)){Gr(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(Yp(n,e))},nm=(e,t,n,r)=>{const o=Object.entries(e),s=o.length;for(let a=0;a<s;a++){const[i,l]=o[a];Gr(l,ja(t,i),n,r)}},ja=(e,t)=>{let n=e;const r=t.split(Fn),o=r.length;for(let s=0;s<o;s++){const a=r[s];let i=n.nextPart.get(a);i||(i=Ha(),n.nextPart.set(a,i)),n=i}return n},rm=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,om=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const o=(s,a)=>{n[s]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(s){let a=n[s];if(a!==void 0)return a;if((a=r[s])!==void 0)return o(s,a),a},set(s,a){s in n?n[s]=a:o(s,a)}}},Yr="!",Ga=":",sm=[],Ya=(e,t,n,r,o)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:o}),am=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=o=>{const s=[];let a=0,i=0,l=0,u;const d=o.length;for(let m=0;m<d;m++){const v=o[m];if(a===0&&i===0){if(v===Ga){s.push(o.slice(l,m)),l=m+1;continue}if(v==="/"){u=m;continue}}v==="["?a++:v==="]"?a--:v==="("?i++:v===")"&&i--}const h=s.length===0?o:o.slice(l);let g=h,p=!1;h.endsWith(Yr)?(g=h.slice(0,-1),p=!0):h.startsWith(Yr)&&(g=h.slice(1),p=!0);const b=u&&u>l?u-l:void 0;return Ya(s,p,g,b)};if(t){const o=t+Ga,s=r;r=a=>a.startsWith(o)?s(a.slice(o.length)):Ya(sm,!1,a,void 0,!0)}if(n){const o=r;r=s=>n({className:s,parseClassName:o})}return r},im=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let o=[];for(let s=0;s<n.length;s++){const a=n[s],i=a[0]==="[",l=t.has(a);i||l?(o.length>0&&(o.sort(),r.push(...o),o=[]),r.push(a)):o.push(a)}return o.length>0&&(o.sort(),r.push(...o)),r}},cm=e=>({cache:om(e.cacheSize),parseClassName:am(e),sortModifiers:im(e),...Kp(e)}),lm=/\s+/,um=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o,sortModifiers:s}=t,a=[],i=e.trim().split(lm);let l="";for(let u=i.length-1;u>=0;u-=1){const d=i[u],{isExternal:h,modifiers:g,hasImportantModifier:p,baseClassName:b,maybePostfixModifierPosition:m}=n(d);if(h){l=d+(l.length>0?" "+l:l);continue}let v=!!m,S=r(v?b.substring(0,m):b);if(!S){if(!v){l=d+(l.length>0?" "+l:l);continue}if(S=r(b),!S){l=d+(l.length>0?" "+l:l);continue}v=!1}const k=g.length===0?"":g.length===1?g[0]:s(g).join(":"),E=p?k+Yr:k,w=E+S;if(a.indexOf(w)>-1)continue;a.push(w);const x=o(S,v);for(let A=0;A<x.length;++A){const O=x[A];a.push(E+O)}l=d+(l.length>0?" "+l:l)}return l},dm=(...e)=>{let t=0,n,r,o="";for(;t<e.length;)(n=e[t++])&&(r=qa(n))&&(o&&(o+=" "),o+=r);return o},qa=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=qa(e[r]))&&(n&&(n+=" "),n+=t);return n},fm=(e,...t)=>{let n,r,o,s;const a=l=>{const u=t.reduce((d,h)=>h(d),e());return n=cm(u),r=n.cache.get,o=n.cache.set,s=i,i(l)},i=l=>{const u=r(l);if(u)return u;const d=um(l,n);return o(l,d),d};return s=a,(...l)=>s(dm(...l))},pm=[],fe=e=>{const t=n=>n[e]||pm;return t.isThemeGetter=!0,t},Ka=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Xa=/^\((?:(\w[\w-]*):)?(.+)\)$/i,mm=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,hm=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,gm=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,bm=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,ym=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,vm=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ot=e=>mm.test(e),K=e=>!!e&&!Number.isNaN(Number(e)),st=e=>!!e&&Number.isInteger(Number(e)),qr=e=>e.endsWith("%")&&K(e.slice(0,-1)),Ye=e=>hm.test(e),Qa=()=>!0,wm=e=>gm.test(e)&&!bm.test(e),Kr=()=>!1,xm=e=>ym.test(e),Sm=e=>vm.test(e),Cm=e=>!W(e)&&!B(e),Em=e=>at(e,ri,Kr),W=e=>Ka.test(e),mt=e=>at(e,oi,wm),Za=e=>at(e,Mm,K),Nm=e=>at(e,ai,Qa),km=e=>at(e,si,Kr),Ja=e=>at(e,ti,Kr),Am=e=>at(e,ni,Sm),$n=e=>at(e,ii,xm),B=e=>Xa.test(e),Zt=e=>ht(e,oi),Tm=e=>ht(e,si),ei=e=>ht(e,ti),Pm=e=>ht(e,ri),_m=e=>ht(e,ni),zn=e=>ht(e,ii,!0),Om=e=>ht(e,ai,!0),at=(e,t,n)=>{const r=Ka.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},ht=(e,t,n=!1)=>{const r=Xa.exec(e);return r?r[1]?t(r[1]):n:!1},ti=e=>e==="position"||e==="percentage",ni=e=>e==="image"||e==="url",ri=e=>e==="length"||e==="size"||e==="bg-size",oi=e=>e==="length",Mm=e=>e==="number",si=e=>e==="family-name",ai=e=>e==="number"||e==="weight",ii=e=>e==="shadow",Dm=fm(()=>{const e=fe("color"),t=fe("font"),n=fe("text"),r=fe("font-weight"),o=fe("tracking"),s=fe("leading"),a=fe("breakpoint"),i=fe("container"),l=fe("spacing"),u=fe("radius"),d=fe("shadow"),h=fe("inset-shadow"),g=fe("text-shadow"),p=fe("drop-shadow"),b=fe("blur"),m=fe("perspective"),v=fe("aspect"),S=fe("ease"),k=fe("animate"),E=()=>["auto","avoid","all","avoid-page","page","left","right","column"],w=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],x=()=>[...w(),B,W],A=()=>["auto","hidden","clip","visible","scroll"],O=()=>["auto","contain","none"],T=()=>[B,W,l],$=()=>[ot,"full","auto",...T()],z=()=>[st,"none","subgrid",B,W],H=()=>["auto",{span:["full",st,B,W]},st,B,W],Y=()=>[st,"auto",B,W],D=()=>["auto","min","max","fr",B,W],C=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],P=()=>["start","end","center","stretch","center-safe","end-safe"],_=()=>["auto",...T()],F=()=>[ot,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...T()],N=()=>[ot,"screen","full","dvw","lvw","svw","min","max","fit",...T()],M=()=>[ot,"screen","full","lh","dvh","lvh","svh","min","max","fit",...T()],I=()=>[e,B,W],j=()=>[...w(),ei,Ja,{position:[B,W]}],se=()=>["no-repeat",{repeat:["","x","y","space","round"]}],Z=()=>["auto","cover","contain",Pm,Em,{size:[B,W]}],ge=()=>[qr,Zt,mt],q=()=>["","none","full",u,B,W],oe=()=>["",K,Zt,mt],V=()=>["solid","dashed","dotted","double"],ee=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Q=()=>[K,qr,ei,Ja],te=()=>["","none",b,B,W],ne=()=>["none",K,B,W],ae=()=>["none",K,B,W],le=()=>[K,B,W],he=()=>[ot,"full",...T()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Ye],breakpoint:[Ye],color:[Qa],container:[Ye],"drop-shadow":[Ye],ease:["in","out","in-out"],font:[Cm],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Ye],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Ye],shadow:[Ye],spacing:["px",K],text:[Ye],"text-shadow":[Ye],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",ot,W,B,v]}],container:["container"],columns:[{columns:[K,W,B,i]}],"break-after":[{"break-after":E()}],"break-before":[{"break-before":E()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:x()}],overflow:[{overflow:A()}],"overflow-x":[{"overflow-x":A()}],"overflow-y":[{"overflow-y":A()}],overscroll:[{overscroll:O()}],"overscroll-x":[{"overscroll-x":O()}],"overscroll-y":[{"overscroll-y":O()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:$()}],"inset-x":[{"inset-x":$()}],"inset-y":[{"inset-y":$()}],start:[{"inset-s":$(),start:$()}],end:[{"inset-e":$(),end:$()}],"inset-bs":[{"inset-bs":$()}],"inset-be":[{"inset-be":$()}],top:[{top:$()}],right:[{right:$()}],bottom:[{bottom:$()}],left:[{left:$()}],visibility:["visible","invisible","collapse"],z:[{z:[st,"auto",B,W]}],basis:[{basis:[ot,"full","auto",i,...T()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[K,ot,"auto","initial","none",W]}],grow:[{grow:["",K,B,W]}],shrink:[{shrink:["",K,B,W]}],order:[{order:[st,"first","last","none",B,W]}],"grid-cols":[{"grid-cols":z()}],"col-start-end":[{col:H()}],"col-start":[{"col-start":Y()}],"col-end":[{"col-end":Y()}],"grid-rows":[{"grid-rows":z()}],"row-start-end":[{row:H()}],"row-start":[{"row-start":Y()}],"row-end":[{"row-end":Y()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":D()}],"auto-rows":[{"auto-rows":D()}],gap:[{gap:T()}],"gap-x":[{"gap-x":T()}],"gap-y":[{"gap-y":T()}],"justify-content":[{justify:[...C(),"normal"]}],"justify-items":[{"justify-items":[...P(),"normal"]}],"justify-self":[{"justify-self":["auto",...P()]}],"align-content":[{content:["normal",...C()]}],"align-items":[{items:[...P(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...P(),{baseline:["","last"]}]}],"place-content":[{"place-content":C()}],"place-items":[{"place-items":[...P(),"baseline"]}],"place-self":[{"place-self":["auto",...P()]}],p:[{p:T()}],px:[{px:T()}],py:[{py:T()}],ps:[{ps:T()}],pe:[{pe:T()}],pbs:[{pbs:T()}],pbe:[{pbe:T()}],pt:[{pt:T()}],pr:[{pr:T()}],pb:[{pb:T()}],pl:[{pl:T()}],m:[{m:_()}],mx:[{mx:_()}],my:[{my:_()}],ms:[{ms:_()}],me:[{me:_()}],mbs:[{mbs:_()}],mbe:[{mbe:_()}],mt:[{mt:_()}],mr:[{mr:_()}],mb:[{mb:_()}],ml:[{ml:_()}],"space-x":[{"space-x":T()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":T()}],"space-y-reverse":["space-y-reverse"],size:[{size:F()}],"inline-size":[{inline:["auto",...N()]}],"min-inline-size":[{"min-inline":["auto",...N()]}],"max-inline-size":[{"max-inline":["none",...N()]}],"block-size":[{block:["auto",...M()]}],"min-block-size":[{"min-block":["auto",...M()]}],"max-block-size":[{"max-block":["none",...M()]}],w:[{w:[i,"screen",...F()]}],"min-w":[{"min-w":[i,"screen","none",...F()]}],"max-w":[{"max-w":[i,"screen","none","prose",{screen:[a]},...F()]}],h:[{h:["screen","lh",...F()]}],"min-h":[{"min-h":["screen","lh","none",...F()]}],"max-h":[{"max-h":["screen","lh",...F()]}],"font-size":[{text:["base",n,Zt,mt]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,Om,Nm]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",qr,W]}],"font-family":[{font:[Tm,km,t]}],"font-features":[{"font-features":[W]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[o,B,W]}],"line-clamp":[{"line-clamp":[K,"none",B,Za]}],leading:[{leading:[s,...T()]}],"list-image":[{"list-image":["none",B,W]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",B,W]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:I()}],"text-color":[{text:I()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...V(),"wavy"]}],"text-decoration-thickness":[{decoration:[K,"from-font","auto",B,mt]}],"text-decoration-color":[{decoration:I()}],"underline-offset":[{"underline-offset":[K,"auto",B,W]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:T()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",B,W]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",B,W]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:j()}],"bg-repeat":[{bg:se()}],"bg-size":[{bg:Z()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},st,B,W],radial:["",B,W],conic:[st,B,W]},_m,Am]}],"bg-color":[{bg:I()}],"gradient-from-pos":[{from:ge()}],"gradient-via-pos":[{via:ge()}],"gradient-to-pos":[{to:ge()}],"gradient-from":[{from:I()}],"gradient-via":[{via:I()}],"gradient-to":[{to:I()}],rounded:[{rounded:q()}],"rounded-s":[{"rounded-s":q()}],"rounded-e":[{"rounded-e":q()}],"rounded-t":[{"rounded-t":q()}],"rounded-r":[{"rounded-r":q()}],"rounded-b":[{"rounded-b":q()}],"rounded-l":[{"rounded-l":q()}],"rounded-ss":[{"rounded-ss":q()}],"rounded-se":[{"rounded-se":q()}],"rounded-ee":[{"rounded-ee":q()}],"rounded-es":[{"rounded-es":q()}],"rounded-tl":[{"rounded-tl":q()}],"rounded-tr":[{"rounded-tr":q()}],"rounded-br":[{"rounded-br":q()}],"rounded-bl":[{"rounded-bl":q()}],"border-w":[{border:oe()}],"border-w-x":[{"border-x":oe()}],"border-w-y":[{"border-y":oe()}],"border-w-s":[{"border-s":oe()}],"border-w-e":[{"border-e":oe()}],"border-w-bs":[{"border-bs":oe()}],"border-w-be":[{"border-be":oe()}],"border-w-t":[{"border-t":oe()}],"border-w-r":[{"border-r":oe()}],"border-w-b":[{"border-b":oe()}],"border-w-l":[{"border-l":oe()}],"divide-x":[{"divide-x":oe()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":oe()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...V(),"hidden","none"]}],"divide-style":[{divide:[...V(),"hidden","none"]}],"border-color":[{border:I()}],"border-color-x":[{"border-x":I()}],"border-color-y":[{"border-y":I()}],"border-color-s":[{"border-s":I()}],"border-color-e":[{"border-e":I()}],"border-color-bs":[{"border-bs":I()}],"border-color-be":[{"border-be":I()}],"border-color-t":[{"border-t":I()}],"border-color-r":[{"border-r":I()}],"border-color-b":[{"border-b":I()}],"border-color-l":[{"border-l":I()}],"divide-color":[{divide:I()}],"outline-style":[{outline:[...V(),"none","hidden"]}],"outline-offset":[{"outline-offset":[K,B,W]}],"outline-w":[{outline:["",K,Zt,mt]}],"outline-color":[{outline:I()}],shadow:[{shadow:["","none",d,zn,$n]}],"shadow-color":[{shadow:I()}],"inset-shadow":[{"inset-shadow":["none",h,zn,$n]}],"inset-shadow-color":[{"inset-shadow":I()}],"ring-w":[{ring:oe()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:I()}],"ring-offset-w":[{"ring-offset":[K,mt]}],"ring-offset-color":[{"ring-offset":I()}],"inset-ring-w":[{"inset-ring":oe()}],"inset-ring-color":[{"inset-ring":I()}],"text-shadow":[{"text-shadow":["none",g,zn,$n]}],"text-shadow-color":[{"text-shadow":I()}],opacity:[{opacity:[K,B,W]}],"mix-blend":[{"mix-blend":[...ee(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ee()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[K]}],"mask-image-linear-from-pos":[{"mask-linear-from":Q()}],"mask-image-linear-to-pos":[{"mask-linear-to":Q()}],"mask-image-linear-from-color":[{"mask-linear-from":I()}],"mask-image-linear-to-color":[{"mask-linear-to":I()}],"mask-image-t-from-pos":[{"mask-t-from":Q()}],"mask-image-t-to-pos":[{"mask-t-to":Q()}],"mask-image-t-from-color":[{"mask-t-from":I()}],"mask-image-t-to-color":[{"mask-t-to":I()}],"mask-image-r-from-pos":[{"mask-r-from":Q()}],"mask-image-r-to-pos":[{"mask-r-to":Q()}],"mask-image-r-from-color":[{"mask-r-from":I()}],"mask-image-r-to-color":[{"mask-r-to":I()}],"mask-image-b-from-pos":[{"mask-b-from":Q()}],"mask-image-b-to-pos":[{"mask-b-to":Q()}],"mask-image-b-from-color":[{"mask-b-from":I()}],"mask-image-b-to-color":[{"mask-b-to":I()}],"mask-image-l-from-pos":[{"mask-l-from":Q()}],"mask-image-l-to-pos":[{"mask-l-to":Q()}],"mask-image-l-from-color":[{"mask-l-from":I()}],"mask-image-l-to-color":[{"mask-l-to":I()}],"mask-image-x-from-pos":[{"mask-x-from":Q()}],"mask-image-x-to-pos":[{"mask-x-to":Q()}],"mask-image-x-from-color":[{"mask-x-from":I()}],"mask-image-x-to-color":[{"mask-x-to":I()}],"mask-image-y-from-pos":[{"mask-y-from":Q()}],"mask-image-y-to-pos":[{"mask-y-to":Q()}],"mask-image-y-from-color":[{"mask-y-from":I()}],"mask-image-y-to-color":[{"mask-y-to":I()}],"mask-image-radial":[{"mask-radial":[B,W]}],"mask-image-radial-from-pos":[{"mask-radial-from":Q()}],"mask-image-radial-to-pos":[{"mask-radial-to":Q()}],"mask-image-radial-from-color":[{"mask-radial-from":I()}],"mask-image-radial-to-color":[{"mask-radial-to":I()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":w()}],"mask-image-conic-pos":[{"mask-conic":[K]}],"mask-image-conic-from-pos":[{"mask-conic-from":Q()}],"mask-image-conic-to-pos":[{"mask-conic-to":Q()}],"mask-image-conic-from-color":[{"mask-conic-from":I()}],"mask-image-conic-to-color":[{"mask-conic-to":I()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:j()}],"mask-repeat":[{mask:se()}],"mask-size":[{mask:Z()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",B,W]}],filter:[{filter:["","none",B,W]}],blur:[{blur:te()}],brightness:[{brightness:[K,B,W]}],contrast:[{contrast:[K,B,W]}],"drop-shadow":[{"drop-shadow":["","none",p,zn,$n]}],"drop-shadow-color":[{"drop-shadow":I()}],grayscale:[{grayscale:["",K,B,W]}],"hue-rotate":[{"hue-rotate":[K,B,W]}],invert:[{invert:["",K,B,W]}],saturate:[{saturate:[K,B,W]}],sepia:[{sepia:["",K,B,W]}],"backdrop-filter":[{"backdrop-filter":["","none",B,W]}],"backdrop-blur":[{"backdrop-blur":te()}],"backdrop-brightness":[{"backdrop-brightness":[K,B,W]}],"backdrop-contrast":[{"backdrop-contrast":[K,B,W]}],"backdrop-grayscale":[{"backdrop-grayscale":["",K,B,W]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[K,B,W]}],"backdrop-invert":[{"backdrop-invert":["",K,B,W]}],"backdrop-opacity":[{"backdrop-opacity":[K,B,W]}],"backdrop-saturate":[{"backdrop-saturate":[K,B,W]}],"backdrop-sepia":[{"backdrop-sepia":["",K,B,W]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":T()}],"border-spacing-x":[{"border-spacing-x":T()}],"border-spacing-y":[{"border-spacing-y":T()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",B,W]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[K,"initial",B,W]}],ease:[{ease:["linear","initial",S,B,W]}],delay:[{delay:[K,B,W]}],animate:[{animate:["none",k,B,W]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[m,B,W]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:ne()}],"rotate-x":[{"rotate-x":ne()}],"rotate-y":[{"rotate-y":ne()}],"rotate-z":[{"rotate-z":ne()}],scale:[{scale:ae()}],"scale-x":[{"scale-x":ae()}],"scale-y":[{"scale-y":ae()}],"scale-z":[{"scale-z":ae()}],"scale-3d":["scale-3d"],skew:[{skew:le()}],"skew-x":[{"skew-x":le()}],"skew-y":[{"skew-y":le()}],transform:[{transform:[B,W,"","none","gpu","cpu"]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:he()}],"translate-x":[{"translate-x":he()}],"translate-y":[{"translate-y":he()}],"translate-z":[{"translate-z":he()}],"translate-none":["translate-none"],accent:[{accent:I()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:I()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",B,W]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":T()}],"scroll-mx":[{"scroll-mx":T()}],"scroll-my":[{"scroll-my":T()}],"scroll-ms":[{"scroll-ms":T()}],"scroll-me":[{"scroll-me":T()}],"scroll-mbs":[{"scroll-mbs":T()}],"scroll-mbe":[{"scroll-mbe":T()}],"scroll-mt":[{"scroll-mt":T()}],"scroll-mr":[{"scroll-mr":T()}],"scroll-mb":[{"scroll-mb":T()}],"scroll-ml":[{"scroll-ml":T()}],"scroll-p":[{"scroll-p":T()}],"scroll-px":[{"scroll-px":T()}],"scroll-py":[{"scroll-py":T()}],"scroll-ps":[{"scroll-ps":T()}],"scroll-pe":[{"scroll-pe":T()}],"scroll-pbs":[{"scroll-pbs":T()}],"scroll-pbe":[{"scroll-pbe":T()}],"scroll-pt":[{"scroll-pt":T()}],"scroll-pr":[{"scroll-pr":T()}],"scroll-pb":[{"scroll-pb":T()}],"scroll-pl":[{"scroll-pl":T()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",B,W]}],fill:[{fill:["none",...I()]}],"stroke-w":[{stroke:[K,Zt,mt,Za]}],stroke:[{stroke:["none",...I()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}});function Rn(...e){return Dm(jp(e))}function Wn({...e}){return c.jsx(Bp,{"data-slot":"popover",...e})}function Bn({...e}){return c.jsx(Hp,{"data-slot":"popover-trigger",...e})}function Hn({className:e,align:t="center",sideOffset:n=4,...r}){return c.jsx(Up,{children:c.jsx(Vp,{"data-slot":"popover-content",align:t,sideOffset:n,className:Rn("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",e),...r})})}function Im({field:e,formValues:t,handleChange:n,handleBlur:r,error:o,disabled:s}){const[a,i]=R.useState(!1),l=p=>{if(!p)return;if(p instanceof Date)return qt(p)?p:void 0;if(typeof p=="string"){const m=p.match(/^(\d{4})-(\d{2})-(\d{2})$/);if(m){const[,k,E,w]=m,x=new Date(Number(k),Number(E)-1,Number(w));return qt(x)?x:void 0}const v=p.includes("T")?p:p.replace(" ","T"),S=new Date(v);return qt(S)?S:void 0}const b=new Date(p);return qt(b)?b:void 0},u=t[e.name],d=R.useMemo(()=>{const p={from:void 0,to:void 0};if(!u)return p;if(Array.isArray(u)){const b=u[0]?.startDate||u[0],m=u[0]?.endDate||u[1];return{from:l(b),to:l(m)}}return{from:l(u.from),to:l(u.to)}},[u]),h=p=>{p.preventDefault(),p.stopPropagation(),n(e.name,{from:void 0,to:void 0}),r(e.name)},g=[];if(e.maxDate){const p=l(e.maxDate);p&&g.push({after:p})}if(e.minDate){const p=l(e.minDate);p&&g.push({before:p})}return c.jsx("div",{className:"relative w-full",children:c.jsxs(Wn,{open:s?!1:a,onOpenChange:p=>{s||i(p)},children:[c.jsx(Bn,{asChild:!0,children:c.jsxs("div",{role:"combobox","aria-expanded":a,"aria-haspopup":"dialog","aria-controls":`${e.name}-popover`,tabIndex:s?-1:0,onClick:()=>!s&&i(!0),onKeyDown:p=>{s||(p.key==="Enter"||p.key===" ")&&(p.preventDefault(),i(!0))},className:`
90
90
  flex h-10 w-full items-center justify-between rounded-md border px-3 py-2 text-sm
91
91
  transition-all outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2
92
92
  ${s?"bg-muted text-muted-foreground cursor-not-allowed opacity-50":"bg-background text-foreground hover:border-primary/50 cursor-pointer"}
93
93
  ${o?"border-destructive focus-visible:ring-destructive":"border-input"}
94
- `,children:[c.jsxs("div",{className:"flex items-center gap-2 overflow-hidden pointer-events-none",children:[c.jsx(ho,{className:"h-4 w-4 shrink-0 text-muted-foreground","aria-hidden":"true"}),c.jsx("div",{className:"truncate",children:u?.from?c.jsxs("span",{children:[Mn(u.from,"PP"),u.to?` - ${Mn(u.to,"PP")}`:""]}):c.jsx("span",{className:"text-muted-foreground",children:e.placeholder||"Select range"})})]}),c.jsxs("div",{className:"flex items-center gap-1",children:[u?.from&&!s&&c.jsx("button",{type:"button","aria-label":"Clear selection",onClick:h,className:"p-1 hover:bg-muted rounded-full transition-colors focus-visible:ring-1 focus-visible:ring-ring outline-none",children:c.jsx(Jn,{className:"h-3.5 w-3.5 text-muted-foreground","aria-hidden":"true"})}),c.jsx(on,{className:`h-4 w-4 shrink-0 opacity-50 transition-transform ${a?"rotate-180":""}`})]})]})}),c.jsxs(Hn,{align:"start",className:"w-auto p-0",children:[c.jsx("div",{className:"p-3",children:c.jsx(Zn.DayPicker,{mode:"range",selected:u,onSelect:p=>n(e.name,p||{from:void 0,to:void 0}),showOutsideDays:!0,disabled:g,classNames:{day_range_start:"bg-primary text-primary-foreground rounded-l-md",day_range_end:"bg-primary text-primary-foreground rounded-r-md",day_range_middle:"bg-primary/20 text-foreground !rounded-none",day_selected:"bg-primary text-primary-foreground",day_today:"bg-accent text-accent-foreground font-bold",day:"h-9 w-9 p-0 font-normal hover:bg-muted rounded-md transition-colors"}})}),c.jsx("div",{className:"flex items-center justify-end gap-2 border-t p-3 bg-muted/20",children:c.jsx("button",{type:"button",onClick:()=>i(!1),className:"text-xs font-medium px-4 py-2 rounded-md bg-primary text-primary-foreground hover:opacity-90",children:"Done"})})]})]})})}function ci({field:e,formValues:t,error:n,fileUploads:r,fileInputRefs:o,handleChange:s,onFieldsChange:a,api_URL:i,disabled:l}){const d=l,u=e.type==="multifile",h=r?.[e.name]||{},g=t[e.name],p=u?g||[]:[g].filter(Boolean),[b,m]=R.useState(!1),v=i?`${i}uploads`:null;!v&&e.uploadEndpoint&&console.error(`api_URL prop is required when using FileField with upload functionality for field "${e.name}"`);const C=w=>{if(w===0)return"0 Bytes";const k=1024,D=["Bytes","KB","MB","GB"],O=Math.floor(Math.log(w)/Math.log(k));return`${parseFloat((w/k**O).toFixed(2))} ${D[O]}`},N=async w=>{const k=new FormData;k.append("file",w);const D=await fetch(`${v}`,{method:"POST",body:k});if(!D.ok)throw nn.toast.error("Upload failed"),new Error("Upload failed");return await D.json()},E=async(w,k)=>{if(!k)return;if(w.maxSize&&k.size>w.maxSize)throw new Error(`File size must not exceed ${C(w.maxSize)}`);const D=await N(k),O={...t,[w.name]:D};s(w.name,D),a(O)},x=async(w,k)=>{const D=t[w.name]||[];if(w.maxFiles&&D.length+k.length>w.maxFiles)throw new Error(`Maximum ${w.maxFiles} files allowed`);k.forEach(T=>{if(w.maxSize&&T.size>w.maxSize)throw new Error(`Each file must not exceed ${C(w.maxSize)}`)});const O=await Promise.all(k.map(T=>N(T))),I=[...D,...O];s(w.name,I),a({...t,[w.name]:I})},S=async(w,k)=>{if(d)return;const D=Array.from(k);try{e.type==="multifile"?await x(e,D):await E(e,D[0]),o.current?.[w]&&(o.current[w].value="")}catch(O){nn.toast.error(`Upload failed: ${O.message}`)}},A=async(w,k)=>{if(d)return;let D;e.type==="file"?D="":D=(t[w]||[]).filter(I=>I!==k),s(w,D),a({...t,[w]:D}),o.current?.[w]&&(o.current[w].value="")},_=w=>{w.preventDefault(),d||m(!0)},P=w=>{w.preventDefault(),d||m(!1)},$=w=>{w.preventDefault(),m(!1),!d&&w.dataTransfer.files&&w.dataTransfer.files.length>0&&S(e.name,w.dataTransfer.files)},z=e.accept?e.accept.split(",").map(w=>w.split("/")[1]||w.split(".")[1]||w).join(", ").toUpperCase():"PNG, JPG, PDF",H=e.maxSize?`, up to ${C(e.maxSize)}`:"",G=`
94
+ `,children:[c.jsxs("div",{className:"flex items-center gap-2 overflow-hidden pointer-events-none",children:[c.jsx(ho,{className:"h-4 w-4 shrink-0 text-muted-foreground","aria-hidden":"true"}),c.jsx("div",{className:"truncate",children:d?.from?c.jsxs("span",{children:[Mn(d.from,"PP"),d.to?` - ${Mn(d.to,"PP")}`:""]}):c.jsx("span",{className:"text-muted-foreground",children:e.placeholder||"Select range"})})]}),c.jsxs("div",{className:"flex items-center gap-1",children:[d?.from&&!s&&c.jsx("button",{type:"button","aria-label":"Clear selection",onClick:h,className:"p-1 hover:bg-muted rounded-full transition-colors focus-visible:ring-1 focus-visible:ring-ring outline-none",children:c.jsx(Jn,{className:"h-3.5 w-3.5 text-muted-foreground","aria-hidden":"true"})}),c.jsx(on,{className:`h-4 w-4 shrink-0 opacity-50 transition-transform ${a?"rotate-180":""}`})]})]})}),c.jsxs(Hn,{align:"start",className:"w-auto p-0",children:[c.jsx("div",{className:"p-3",children:c.jsx(Zn.DayPicker,{mode:"range",selected:d,onSelect:p=>n(e.name,p||{from:void 0,to:void 0}),showOutsideDays:!0,disabled:g,classNames:{day_range_start:"bg-primary text-primary-foreground rounded-l-md",day_range_end:"bg-primary text-primary-foreground rounded-r-md",day_range_middle:"bg-primary/20 text-foreground !rounded-none",day_selected:"bg-primary text-primary-foreground",day_today:"bg-accent text-accent-foreground font-bold",day:"h-9 w-9 p-0 font-normal hover:bg-muted rounded-md transition-colors"}})}),c.jsx("div",{className:"flex items-center justify-end gap-2 border-t p-3 bg-muted/20",children:c.jsx("button",{type:"button",onClick:()=>i(!1),className:"text-xs font-medium px-4 py-2 rounded-md bg-primary text-primary-foreground hover:opacity-90",children:"Done"})})]})]})})}function ci({field:e,formValues:t,error:n,fileUploads:r,fileInputRefs:o,handleChange:s,onFieldsChange:a,api_URL:i,disabled:l}){const u=l,d=e.type==="multifile",h=r?.[e.name]||{},g=t[e.name],p=d?g||[]:[g].filter(Boolean),[b,m]=R.useState(!1),v=i?`${i}uploads`:null;!v&&e.uploadEndpoint&&console.error(`api_URL prop is required when using FileField with upload functionality for field "${e.name}"`);const S=D=>{if(D===0)return"0 Bytes";const C=1024,P=["Bytes","KB","MB","GB"],_=Math.floor(Math.log(D)/Math.log(C));return`${parseFloat((D/C**_).toFixed(2))} ${P[_]}`},k=async D=>{const C=new FormData;C.append("file",D);const P=await fetch(`${v}`,{method:"POST",body:C});if(!P.ok)throw nn.toast.error("Upload failed"),new Error("Upload failed");return await P.json()},E=async(D,C)=>{if(!C)return;if(D.maxSize&&C.size>D.maxSize)throw new Error(`File size must not exceed ${S(D.maxSize)}`);const P=await k(C),_={...t,[D.name]:P};s(D.name,P),a(_)},w=async(D,C)=>{const P=t[D.name]||[];if(D.maxFiles&&P.length+C.length>D.maxFiles)throw new Error(`Maximum ${D.maxFiles} files allowed`);C.forEach(N=>{if(D.maxSize&&N.size>D.maxSize)throw new Error(`Each file must not exceed ${S(D.maxSize)}`)});const _=await Promise.all(C.map(N=>k(N))),F=[...P,..._];s(D.name,F),a({...t,[D.name]:F})},x=async(D,C)=>{if(u)return;const P=Array.from(C);try{e.type==="multifile"?await w(e,P):await E(e,P[0]),o.current?.[D]&&(o.current[D].value="")}catch(_){nn.toast.error(`Upload failed: ${_.message}`)}},A=async(D,C)=>{if(u)return;let P;e.type==="file"?P="":P=(t[D]||[]).filter(F=>F!==C),s(D,P),a({...t,[D]:P}),o.current?.[D]&&(o.current[D].value="")},O=D=>{D.preventDefault(),u||m(!0)},T=D=>{D.preventDefault(),u||m(!1)},$=D=>{D.preventDefault(),m(!1),!u&&D.dataTransfer.files&&D.dataTransfer.files.length>0&&x(e.name,D.dataTransfer.files)},z=e.accept?e.accept.split(",").map(D=>D.split("/")[1]||D.split(".")[1]||D).join(", ").toUpperCase():"PNG, JPG, PDF",H=e.maxSize?`, up to ${S(e.maxSize)}`:"",Y=`
95
95
  w-full flex flex-col items-center justify-center p-6 border-2 border-dashed rounded-lg transition-all duration-200
96
96
  // Ensure focus styling is handled correctly for the button element
97
97
  focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-opacity-50
98
- ${d?"bg-gray-50 border-gray-300 text-gray-400 cursor-not-allowed opacity-70":b?"bg-blue-50 border-blue-500 text-blue-600":"bg-white border-gray-300 hover:border-blue-400 hover:bg-gray-50 cursor-pointer"}
99
- `;return c.jsx("div",{className:`mb-4 ${e.fieldClass||"col-span-full"}`,children:c.jsxs("div",{className:"space-y-3",children:[c.jsxs("button",{type:"button",className:G,onClick:()=>{d||o?.current?.[e.name]?.click()},onDragOver:_,onDragEnter:_,onDragLeave:P,onDrop:$,disabled:d,children:[c.jsx("div",{className:"border-gray-400 border p-1 mb-3 rounded-md bg-gray-100 shadow-md ",children:c.jsx(pc,{size:24,className:"m-1"})}),c.jsxs("p",{className:"text-sm font-normal",children:[c.jsxs("span",{className:d?"text-gray-400":"text-blue-600 hover:text-blue-700 underline",children:["Upload ",u?"Files":"a file"]}),c.jsx("span",{className:"font-light",children:" or drag and drop"})]}),c.jsxs("p",{className:"text-xs mt-1 text-gray-500",children:[z,H,u&&e.maxFiles&&`, Max ${e.maxFiles} files`]})]}),c.jsx("input",{ref:w=>{w&&o&&o.current&&(o.current[e.name]=w)},id:e.name,type:"file",accept:e.accept,multiple:u,className:"sr-only",onChange:w=>S(e.name,w.target.files),disabled:d}),p.length>0&&c.jsx("div",{className:"space-y-2 pt-2 border-t border-gray-200",children:p.map((w,k)=>{const D=w.original_name||w.name||"File",O=w.size||null;return c.jsxs("div",{className:"flex items-center justify-between p-2 bg-gray-50 rounded",children:[c.jsxs("div",{className:"flex items-center space-x-2 min-w-0",children:[c.jsx("span",{className:"text-sm truncate",children:D}),O&&c.jsxs("span",{className:"text-xs text-gray-500 flex-shrink-0",children:["(",C(O),")"]})]}),c.jsx("button",{type:"button",onClick:()=>A(e.name,w),className:`text-red-500 hover:text-red-700 ml-3 flex-shrink-0 ${d?"cursor-not-allowed opacity-50":""}`,disabled:d,children:"Remove"})]},w.url||w.original_name||k)})}),Object.entries(h).map(([w,k])=>k.status==="uploading"?c.jsxs("div",{className:"relative pt-1",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("span",{className:"text-xs font-semibold inline-block text-blue-600",children:["Uploading ",w]}),c.jsxs("span",{className:"text-xs font-semibold inline-block text-blue-600",children:[k.progress,"%"]})]}),c.jsx("div",{className:"overflow-hidden h-2 mt-1 text-xs flex rounded bg-blue-200",children:c.jsx("div",{className:"shadow-none flex flex-col text-center whitespace-nowrap text-white justify-center bg-blue-500",style:{width:`${k.progress}%`}})})]},w):null)]})},e.name)}function Lm({field:e,formValues:t,handleChange:n,handleBlur:r,error:o,charCount:s,setCharCounts:a}){const i=R.useRef(null),l=t[e.name]||"",d=typeof e.disabled=="function"?e.disabled(t):e.disabled||e.readOnly,u=()=>{const g=i.current;g&&(g.style.height="auto",g.style.height=`${g.scrollHeight+2}px`)};R.useEffect(()=>{u()},[l]);const h=g=>{n(e.name,g.target.value),u(),a&&a(p=>({...p,[e.name]:g.target.value.length}))};return c.jsxs("div",{className:"space-y-2",children:[c.jsx("textarea",{...e.props,ref:i,id:e.name,name:e.name,placeholder:e.placeholder||"",value:l,onChange:h,onBlur:()=>r(e.name),disabled:d,maxLength:e.maxLength,rows:e.rows||3,className:`flex w-full rounded-md border px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 resize-none overflow-y-auto ${o?"border-red-500 focus-visible:ring-red-500":"border-input focus-visible:ring-blue-500"} ${d?"bg-gray-50 text-gray-500":"bg-background"}`,style:{minHeight:"80px",maxHeight:"400px"}}),c.jsx("div",{className:"flex justify-between items-center",children:e.maxLength&&!e.readOnly&&c.jsxs("span",{className:"text-xs text-gray-500",children:[s||0,"/",e.maxLength," characters"]})})]})}function Fm({field:e,formValues:t,handleChange:n,handleBlur:r,error:o}){const[s,a]=R.useState(!1),i=A=>{if(!A)return null;if(A instanceof Date)return Number.isNaN(A.getTime())?null:A;if(typeof A=="string"){const P=A.match(/^(\d{4})-(\d{2})-(\d{2})$/);if(P){const[,H,G,w]=P,k=new Date(Number(H),Number(G)-1,Number(w));return Number.isNaN(k.getTime())?null:k}const $=A.includes("T")?A:A.replace(" ","T"),z=new Date($);return Number.isNaN(z.getTime())?null:z}const _=new Date(A);return Number.isNaN(_.getTime())?null:_},l=t[e.name],d=i(l),u=d?(d.getHours()%12||12).toString().padStart(2,"0"):"12",h=d?d.getMinutes().toString().padStart(2,"0"):"00",g=d?d.getHours()>=12?"PM":"AM":"PM",p=A=>{if(!A){n(e.name,null);return}const _=new Date(A);d?(_.setHours(d.getHours()),_.setMinutes(d.getMinutes())):(_.setHours(12),_.setMinutes(0)),n(e.name,_)},b=(A,_,P)=>{const $=d?new Date(d):new Date;let z=parseInt(A);P==="PM"&&z!==12&&(z+=12),P==="AM"&&z===12&&(z=0),$.setHours(z),$.setMinutes(parseInt(_)),n(e.name,$)},m=()=>{let A=parseInt(u);A=A%12+1,b(A.toString(),h,g)},v=()=>{let A=parseInt(u);A=A===1?12:A-1,b(A.toString(),h,g)},C=()=>{let A=parseInt(h);A=(A+5)%60,b(u,A.toString(),g)},N=()=>{let A=parseInt(h);A=A===0?55:A-5,b(u,A.toString(),g)},E=()=>{b(u,h,g==="AM"?"PM":"AM")},x=()=>n(e.name,null),S=[];if(e.maxDate){const A=i(e.maxDate);A&&S.push({after:A})}if(e.minDate){const A=i(e.minDate);A&&S.push({before:A})}return c.jsxs("div",{className:"relative",children:[c.jsxs(Wn,{open:e.disabled?!1:s,onOpenChange:A=>{e.disabled||a(A)},children:[c.jsx(Bn,{asChild:!0,children:c.jsxs("button",{type:"button",id:e.name,disabled:e.disabled,"aria-haspopup":"dialog","aria-expanded":s,onClick:()=>!e.disabled&&a(!0),onKeyDown:A=>!e.disabled&&A.key==="Enter"&&a(!0),className:`
98
+ ${u?"bg-gray-50 border-gray-300 text-gray-400 cursor-not-allowed opacity-70":b?"bg-blue-50 border-blue-500 text-blue-600":"bg-white border-gray-300 hover:border-blue-400 hover:bg-gray-50 cursor-pointer"}
99
+ `;return c.jsx("div",{className:`mb-4 ${e.fieldClass||"col-span-full"}`,children:c.jsxs("div",{className:"space-y-3",children:[c.jsxs("button",{type:"button",className:Y,onClick:()=>{u||o?.current?.[e.name]?.click()},onDragOver:O,onDragEnter:O,onDragLeave:T,onDrop:$,disabled:u,children:[c.jsx("div",{className:"border-gray-400 border p-1 mb-3 rounded-md bg-gray-100 shadow-md ",children:c.jsx(pc,{size:24,className:"m-1"})}),c.jsxs("p",{className:"text-sm font-normal",children:[c.jsxs("span",{className:u?"text-gray-400":"text-blue-600 hover:text-blue-700 underline",children:["Upload ",d?"Files":"a file"]}),c.jsx("span",{className:"font-light",children:" or drag and drop"})]}),c.jsxs("p",{className:"text-xs mt-1 text-gray-500",children:[z,H,d&&e.maxFiles&&`, Max ${e.maxFiles} files`]})]}),c.jsx("input",{ref:D=>{D&&o&&o.current&&(o.current[e.name]=D)},id:e.name,type:"file",accept:e.accept,multiple:d,className:"sr-only",onChange:D=>x(e.name,D.target.files),disabled:u}),p.length>0&&c.jsx("div",{className:"space-y-2 pt-2 border-t border-gray-200",children:p.map((D,C)=>{const P=D.original_name||D.name||"File",_=D.size||null;return c.jsxs("div",{className:"flex items-center justify-between p-2 bg-gray-50 rounded",children:[c.jsxs("div",{className:"flex items-center space-x-2 min-w-0",children:[c.jsx("span",{className:"text-sm truncate",children:P}),_&&c.jsxs("span",{className:"text-xs text-gray-500 flex-shrink-0",children:["(",S(_),")"]})]}),c.jsx("button",{type:"button",onClick:()=>A(e.name,D),className:`text-red-500 hover:text-red-700 ml-3 flex-shrink-0 ${u?"cursor-not-allowed opacity-50":""}`,disabled:u,children:"Remove"})]},D.url||D.original_name||C)})}),Object.entries(h).map(([D,C])=>C.status==="uploading"?c.jsxs("div",{className:"relative pt-1",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("span",{className:"text-xs font-semibold inline-block text-blue-600",children:["Uploading ",D]}),c.jsxs("span",{className:"text-xs font-semibold inline-block text-blue-600",children:[C.progress,"%"]})]}),c.jsx("div",{className:"overflow-hidden h-2 mt-1 text-xs flex rounded bg-blue-200",children:c.jsx("div",{className:"shadow-none flex flex-col text-center whitespace-nowrap text-white justify-center bg-blue-500",style:{width:`${C.progress}%`}})})]},D):null)]})},e.name)}function Lm({field:e,formValues:t,handleChange:n,handleBlur:r,error:o,charCount:s,setCharCounts:a}){const i=R.useRef(null),l=t[e.name]||"",u=typeof e.disabled=="function"?e.disabled(t):e.disabled||e.readOnly,d=()=>{const g=i.current;g&&(g.style.height="auto",g.style.height=`${g.scrollHeight+2}px`)};R.useEffect(()=>{d()},[l]);const h=g=>{n(e.name,g.target.value),d(),a&&a(p=>({...p,[e.name]:g.target.value.length}))};return c.jsxs("div",{className:"space-y-2",children:[c.jsx("textarea",{...e.props,ref:i,id:e.name,name:e.name,placeholder:e.placeholder||"",value:l,onChange:h,onBlur:()=>r(e.name),disabled:u,maxLength:e.maxLength,rows:e.rows||3,className:`flex w-full rounded-md border px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 resize-none overflow-y-auto ${o?"border-red-500 focus-visible:ring-red-500":"border-input focus-visible:ring-blue-500"} ${u?"bg-gray-50 text-gray-500":"bg-background"}`,style:{minHeight:"80px",maxHeight:"400px"}}),c.jsx("div",{className:"flex justify-between items-center",children:e.maxLength&&!e.readOnly&&c.jsxs("span",{className:"text-xs text-gray-500",children:[s||0,"/",e.maxLength," characters"]})})]})}function Fm({field:e,formValues:t,handleChange:n,handleBlur:r,error:o}){const[s,a]=R.useState(!1),i=A=>{if(!A)return null;if(A instanceof Date)return Number.isNaN(A.getTime())?null:A;if(typeof A=="string"){const T=A.match(/^(\d{4})-(\d{2})-(\d{2})$/);if(T){const[,H,Y,D]=T,C=new Date(Number(H),Number(Y)-1,Number(D));return Number.isNaN(C.getTime())?null:C}const $=A.includes("T")?A:A.replace(" ","T"),z=new Date($);return Number.isNaN(z.getTime())?null:z}const O=new Date(A);return Number.isNaN(O.getTime())?null:O},l=t[e.name],u=i(l),d=u?(u.getHours()%12||12).toString().padStart(2,"0"):"12",h=u?u.getMinutes().toString().padStart(2,"0"):"00",g=u?u.getHours()>=12?"PM":"AM":"PM",p=A=>{if(!A){n(e.name,null);return}const O=new Date(A);u?(O.setHours(u.getHours()),O.setMinutes(u.getMinutes())):(O.setHours(12),O.setMinutes(0)),n(e.name,O)},b=(A,O,T)=>{const $=u?new Date(u):new Date;let z=parseInt(A);T==="PM"&&z!==12&&(z+=12),T==="AM"&&z===12&&(z=0),$.setHours(z),$.setMinutes(parseInt(O)),n(e.name,$)},m=()=>{let A=parseInt(d);A=A%12+1,b(A.toString(),h,g)},v=()=>{let A=parseInt(d);A=A===1?12:A-1,b(A.toString(),h,g)},S=()=>{let A=parseInt(h);A=(A+5)%60,b(d,A.toString(),g)},k=()=>{let A=parseInt(h);A=A===0?55:A-5,b(d,A.toString(),g)},E=()=>{b(d,h,g==="AM"?"PM":"AM")},w=()=>n(e.name,null),x=[];if(e.maxDate){const A=i(e.maxDate);A&&x.push({after:A})}if(e.minDate){const A=i(e.minDate);A&&x.push({before:A})}return c.jsxs("div",{className:"relative",children:[c.jsxs(Wn,{open:e.disabled?!1:s,onOpenChange:A=>{e.disabled||a(A)},children:[c.jsx(Bn,{asChild:!0,children:c.jsxs("button",{type:"button",id:e.name,disabled:e.disabled,"aria-haspopup":"dialog","aria-expanded":s,onClick:()=>!e.disabled&&a(!0),onKeyDown:A=>!e.disabled&&A.key==="Enter"&&a(!0),className:`
100
100
  group inline-flex items-center justify-between gap-2
101
101
  w-full h-10 rounded-lg border bg-white
102
102
  px-3 py-2 text-sm font-normal shadow-sm transition-all
@@ -104,31 +104,31 @@
104
104
  focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2
105
105
  disabled:cursor-not-allowed disabled:opacity-50
106
106
  ${o?"border-red-500 focus-visible:ring-red-500":"border-slate-200 focus-visible:ring-blue-500"}
107
- `,children:[d?c.jsx("span",{className:"text-slate-900 ",children:d.toLocaleString()}):c.jsx("span",{className:"text-slate-400",children:e.placeholder||"Select date and time"}),c.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"lucide lucide-calendar text-slate-400 group-hover:text-slate-600 transition-colors",children:[c.jsx("rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",ry:"2"}),c.jsx("line",{x1:"16",x2:"16",y1:"2",y2:"6"}),c.jsx("line",{x1:"8",x2:"8",y1:"2",y2:"6"}),c.jsx("line",{x1:"3",x2:"21",y1:"10",y2:"10"})]})]})}),c.jsxs(Hn,{align:"start",sideOffset:4,className:"z-50 w-auto p-0 bg-white rounded-xl shadow-xl border border-slate-200",children:[c.jsx("div",{className:"p-3",children:c.jsx(Zn.DayPicker,{mode:"single",selected:d,onSelect:p,showOutsideDays:!0,disabled:S,className:"p-0",classNames:{day_selected:"bg-blue-600 text-white hover:bg-blue-600 hover:text-white focus:bg-blue-600 focus:text-white rounded-md",day_today:"bg-slate-100 text-slate-900 font-bold rounded-md",day:"h-9 w-9 p-0 font-normal aria-selected:opacity-100 hover:bg-slate-100 rounded-md transition-colors",head_cell:"text-slate-500 rounded-md w-9 font-normal text-[0.8rem]"}})}),c.jsx("div",{className:"border-t border-slate-100 p-4 bg-slate-50/50",children:c.jsxs("div",{className:"flex items-center justify-center gap-4",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsxs("div",{className:"flex flex-col items-center gap-1",children:[c.jsx("button",{type:"button",onClick:m,className:"p-1 h-6 w-6 flex items-center justify-center text-slate-400 hover:text-slate-700 hover:bg-slate-200 rounded-full transition-all",children:c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:c.jsx("path",{d:"m18 15-6-6-6 6"})})}),c.jsx("div",{className:"w-12 h-10 flex items-center justify-center bg-white border border-slate-200 rounded-lg text-lg font-semibold shadow-sm text-slate-700",children:u}),c.jsx("button",{type:"button",onClick:v,className:"p-1 h-6 w-6 flex items-center justify-center text-slate-400 hover:text-slate-700 hover:bg-slate-200 rounded-full transition-all",children:c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:c.jsx("path",{d:"m6 9 6 6 6-6"})})})]}),c.jsx("span",{className:"text-xl font-medium text-slate-300 pb-1",children:":"}),c.jsxs("div",{className:"flex flex-col items-center gap-1",children:[c.jsx("button",{type:"button",onClick:C,className:"p-1 h-6 w-6 flex items-center justify-center text-slate-400 hover:text-slate-700 hover:bg-slate-200 rounded-full transition-all",children:c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:c.jsx("path",{d:"m18 15-6-6-6 6"})})}),c.jsx("div",{className:"w-12 h-10 flex items-center justify-center bg-white border border-slate-200 rounded-lg text-lg font-semibold shadow-sm text-slate-700",children:h}),c.jsx("button",{type:"button",onClick:N,className:"p-1 h-6 w-6 flex items-center justify-center text-slate-400 hover:text-slate-700 hover:bg-slate-200 rounded-full transition-all",children:c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:c.jsx("path",{d:"m6 9 6 6 6-6"})})})]})]}),c.jsxs("div",{className:"flex flex-col gap-1 bg-white p-1 rounded-lg border border-slate-200 shadow-sm",children:[c.jsx("button",{type:"button",onClick:()=>g!=="AM"&&E(),className:`px-3 py-1 text-xs font-bold rounded-md transition-all ${g==="AM"?"bg-blue-50 text-blue-600":"text-slate-400 hover:text-slate-600"}`,children:"AM"}),c.jsx("button",{type:"button",onClick:()=>g!=="PM"&&E(),className:`px-3 py-1 text-xs font-bold rounded-md transition-all ${g==="PM"?"bg-blue-50 text-blue-600":"text-slate-400 hover:text-slate-600"}`,children:"PM"})]})]})}),c.jsxs("div",{className:"flex items-center justify-between gap-2 border-t border-slate-100 p-3 bg-white rounded-b-xl",children:[c.jsx("button",{type:"button",onClick:x,className:"inline-flex items-center justify-center rounded-lg text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 text-slate-500 hover:text-slate-900 hover:bg-slate-100 h-9 px-4 py-2",children:"Clear"}),c.jsx("button",{type:"button",onClick:()=>a(!1),className:"inline-flex items-center justify-center rounded-lg text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 bg-blue-600 text-white hover:bg-blue-700 shadow-sm h-9 px-6 py-2",children:"Done"})]})]})]}),o&&c.jsx("p",{className:"mt-1 text-sm text-red-500",children:o})]})}var $m=Symbol.for("react.lazy"),Un=f[" use ".trim().toString()];function zm(e){return typeof e=="object"&&e!==null&&"then"in e}function li(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===$m&&"_payload"in e&&zm(e._payload)}function Rm(e){const t=Wm(e),n=f.forwardRef((r,o)=>{let{children:s,...a}=r;li(s)&&typeof Un=="function"&&(s=Un(s._payload));const i=f.Children.toArray(s),l=i.find(Hm);if(l){const d=l.props.children,u=i.map(h=>h===l?f.Children.count(d)>1?f.Children.only(null):f.isValidElement(d)?d.props.children:null:h);return c.jsx(t,{...a,ref:o,children:f.isValidElement(d)?f.cloneElement(d,void 0,u):null})}return c.jsx(t,{...a,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}function Wm(e){const t=f.forwardRef((n,r)=>{let{children:o,...s}=n;if(li(o)&&typeof Un=="function"&&(o=Un(o._payload)),f.isValidElement(o)){const a=Vm(o),i=Um(s,o.props);return o.type!==f.Fragment&&(i.ref=r?er(r,a):a),f.cloneElement(o,i)}return f.Children.count(o)>1?f.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Bm=Symbol("radix.slottable");function Hm(e){return f.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Bm}function Um(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...i)=>{const l=s(...i);return o(...i),l}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function Vm(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var jm=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Gm=jm.reduce((e,t)=>{const n=Rm(`Primitive.${t}`),r=f.forwardRef((o,s)=>{const{asChild:a,...i}=o,l=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(l,{...i,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),Ym="Separator",di="horizontal",qm=["horizontal","vertical"],ui=f.forwardRef((e,t)=>{const{decorative:n,orientation:r=di,...o}=e,s=Km(r)?r:di,i=n?{role:"none"}:{"aria-orientation":s==="vertical"?s:void 0,role:"separator"};return c.jsx(Gm.div,{"data-orientation":s,...i,...o,ref:t})});ui.displayName=Ym;function Km(e){return qm.includes(e)}var Xm=ui;function Xr({className:e,orientation:t="horizontal",decorative:n=!0,...r}){return c.jsx(Xm,{"data-slot":"separator",decorative:n,orientation:t,className:Rn("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",e),...r})}function Qm({field:e}){return e?.label?c.jsxs("div",{className:"relative flex items-center py-4",children:[c.jsx(Xr,{className:"flex-1 h-px bg-gray-300"}),c.jsx("span",{className:"px-3 font-medium text-gray-600 bg-white",children:e.label}),c.jsx(Xr,{className:"flex-1 h-px bg-gray-300"})]}):c.jsx(Xr,{className:"my-4 h-px bg-gray-300"})}var Zm=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Vn=Zm.reduce((e,t)=>{const n=Ce(`Primitive.${t}`),r=f.forwardRef((o,s)=>{const{asChild:a,...i}=o,l=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(l,{...i,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),Jm=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],fi=Jm.reduce((e,t)=>{const n=Ce(`Primitive.${t}`),r=f.forwardRef((o,s)=>{const{asChild:a,...i}=o,l=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(l,{...i,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),Qr="rovingFocusGroup.onEntryFocus",eh={bubbles:!1,cancelable:!0},Jt="RovingFocusGroup",[Zr,pi,th]=vo(Jt),[nh,mi]=ct(Jt,[th]),[rh,oh]=nh(Jt),hi=f.forwardRef((e,t)=>c.jsx(Zr.Provider,{scope:e.__scopeRovingFocusGroup,children:c.jsx(Zr.Slot,{scope:e.__scopeRovingFocusGroup,children:c.jsx(sh,{...e,ref:t})})}));hi.displayName=Jt;var sh=f.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:s,currentTabStopId:a,defaultCurrentTabStopId:i,onCurrentTabStopIdChange:l,onEntryFocus:d,preventScrollOnEntryFocus:u=!1,...h}=e,g=f.useRef(null),p=ie(t,g),b=tr(s),[m,v]=Rt({prop:a,defaultProp:i??null,onChange:l,caller:Jt}),[C,N]=f.useState(!1),E=Ke(d),x=pi(n),S=f.useRef(!1),[A,_]=f.useState(0);return f.useEffect(()=>{const P=g.current;if(P)return P.addEventListener(Qr,E),()=>P.removeEventListener(Qr,E)},[E]),c.jsx(rh,{scope:n,orientation:r,dir:b,loop:o,currentTabStopId:m,onItemFocus:f.useCallback(P=>v(P),[v]),onItemShiftTab:f.useCallback(()=>N(!0),[]),onFocusableItemAdd:f.useCallback(()=>_(P=>P+1),[]),onFocusableItemRemove:f.useCallback(()=>_(P=>P-1),[]),children:c.jsx(fi.div,{tabIndex:C||A===0?-1:0,"data-orientation":r,...h,ref:p,style:{outline:"none",...e.style},onMouseDown:J(e.onMouseDown,()=>{S.current=!0}),onFocus:J(e.onFocus,P=>{const $=!S.current;if(P.target===P.currentTarget&&$&&!C){const z=new CustomEvent(Qr,eh);if(P.currentTarget.dispatchEvent(z),!z.defaultPrevented){const H=x().filter(O=>O.focusable),G=H.find(O=>O.active),w=H.find(O=>O.id===m),D=[G,w,...H].filter(Boolean).map(O=>O.ref.current);yi(D,u)}}S.current=!1}),onBlur:J(e.onBlur,()=>N(!1))})})}),gi="RovingFocusGroupItem",bi=f.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:s,children:a,...i}=e,l=Ft(),d=s||l,u=oh(gi,n),h=u.currentTabStopId===d,g=pi(n),{onFocusableItemAdd:p,onFocusableItemRemove:b,currentTabStopId:m}=u;return f.useEffect(()=>{if(r)return p(),()=>b()},[r,p,b]),c.jsx(Zr.ItemSlot,{scope:n,id:d,focusable:r,active:o,children:c.jsx(fi.span,{tabIndex:h?0:-1,"data-orientation":u.orientation,...i,ref:t,onMouseDown:J(e.onMouseDown,v=>{r?u.onItemFocus(d):v.preventDefault()}),onFocus:J(e.onFocus,()=>u.onItemFocus(d)),onKeyDown:J(e.onKeyDown,v=>{if(v.key==="Tab"&&v.shiftKey){u.onItemShiftTab();return}if(v.target!==v.currentTarget)return;const C=ch(v,u.orientation,u.dir);if(C!==void 0){if(v.metaKey||v.ctrlKey||v.altKey||v.shiftKey)return;v.preventDefault();let E=g().filter(x=>x.focusable).map(x=>x.ref.current);if(C==="last")E.reverse();else if(C==="prev"||C==="next"){C==="prev"&&E.reverse();const x=E.indexOf(v.currentTarget);E=u.loop?lh(E,x+1):E.slice(x+1)}setTimeout(()=>yi(E))}}),children:typeof a=="function"?a({isCurrentTabStop:h,hasTabStop:m!=null}):a})})});bi.displayName=gi;var ah={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function ih(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function ch(e,t,n){const r=ih(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return ah[r]}function yi(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function lh(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var dh=hi,uh=bi,Jr="Radio",[fh,vi]=ct(Jr),[ph,mh]=fh(Jr),wi=f.forwardRef((e,t)=>{const{__scopeRadio:n,name:r,checked:o=!1,required:s,disabled:a,value:i="on",onCheck:l,form:d,...u}=e,[h,g]=f.useState(null),p=ie(t,v=>g(v)),b=f.useRef(!1),m=h?d||!!h.closest("form"):!0;return c.jsxs(ph,{scope:n,checked:o,disabled:a,children:[c.jsx(Vn.button,{type:"button",role:"radio","aria-checked":o,"data-state":Ei(o),"data-disabled":a?"":void 0,disabled:a,value:i,...u,ref:p,onClick:J(e.onClick,v=>{o||l?.(),m&&(b.current=v.isPropagationStopped(),b.current||v.stopPropagation())})}),m&&c.jsx(Ci,{control:h,bubbles:!b.current,name:r,value:i,checked:o,required:s,disabled:a,form:d,style:{transform:"translateX(-100%)"}})]})});wi.displayName=Jr;var xi="RadioIndicator",Si=f.forwardRef((e,t)=>{const{__scopeRadio:n,forceMount:r,...o}=e,s=mh(xi,n);return c.jsx(Dn,{present:r||s.checked,children:c.jsx(Vn.span,{"data-state":Ei(s.checked),"data-disabled":s.disabled?"":void 0,...o,ref:t})})});Si.displayName=xi;var hh="RadioBubbleInput",Ci=f.forwardRef(({__scopeRadio:e,control:t,checked:n,bubbles:r=!0,...o},s)=>{const a=f.useRef(null),i=ie(a,s),l=hs(n),d=ns(t);return f.useEffect(()=>{const u=a.current;if(!u)return;const h=window.HTMLInputElement.prototype,p=Object.getOwnPropertyDescriptor(h,"checked").set;if(l!==n&&p){const b=new Event("click",{bubbles:r});p.call(u,n),u.dispatchEvent(b)}},[l,n,r]),c.jsx(Vn.input,{type:"radio","aria-hidden":!0,defaultChecked:n,...o,tabIndex:-1,ref:i,style:{...o.style,...d,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});Ci.displayName=hh;function Ei(e){return e?"checked":"unchecked"}var gh=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],jn="RadioGroup",[bh]=ct(jn,[mi,vi]),Ni=mi(),ki=vi(),[yh,vh]=bh(jn),Ai=f.forwardRef((e,t)=>{const{__scopeRadioGroup:n,name:r,defaultValue:o,value:s,required:a=!1,disabled:i=!1,orientation:l,dir:d,loop:u=!0,onValueChange:h,...g}=e,p=Ni(n),b=tr(d),[m,v]=Rt({prop:s,defaultProp:o??null,onChange:h,caller:jn});return c.jsx(yh,{scope:n,name:r,required:a,disabled:i,value:m,onValueChange:v,children:c.jsx(dh,{asChild:!0,...p,orientation:l,dir:b,loop:u,children:c.jsx(Vn.div,{role:"radiogroup","aria-required":a,"aria-orientation":l,"data-disabled":i?"":void 0,dir:b,...g,ref:t})})})});Ai.displayName=jn;var Ti="RadioGroupItem",Pi=f.forwardRef((e,t)=>{const{__scopeRadioGroup:n,disabled:r,...o}=e,s=vh(Ti,n),a=s.disabled||r,i=Ni(n),l=ki(n),d=f.useRef(null),u=ie(t,d),h=s.value===o.value,g=f.useRef(!1);return f.useEffect(()=>{const p=m=>{gh.includes(m.key)&&(g.current=!0)},b=()=>g.current=!1;return document.addEventListener("keydown",p),document.addEventListener("keyup",b),()=>{document.removeEventListener("keydown",p),document.removeEventListener("keyup",b)}},[]),c.jsx(uh,{asChild:!0,...i,focusable:!a,active:h,children:c.jsx(wi,{disabled:a,required:s.required,checked:h,...l,...o,name:s.name,ref:u,onCheck:()=>s.onValueChange(o.value),onKeyDown:J(p=>{p.key==="Enter"&&p.preventDefault()}),onFocus:J(o.onFocus,()=>{g.current&&d.current?.click()})})})});Pi.displayName=Ti;var wh="RadioGroupIndicator",_i=f.forwardRef((e,t)=>{const{__scopeRadioGroup:n,...r}=e,o=ki(n);return c.jsx(Si,{...o,...r,ref:t})});_i.displayName=wh;var xh=Ai,Sh=Pi,Ch=_i;function Eh({className:e,...t}){return c.jsx(xh,{"data-slot":"radio-group",className:Rn("grid gap-3",e),...t})}function Oi({className:e,...t}){return c.jsx(Sh,{"data-slot":"radio-group-item",className:Rn("border-input text-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 aspect-square size-4 shrink-0 rounded-full border shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:c.jsx(Ch,{"data-slot":"radio-group-indicator",className:"relative flex items-center justify-center",children:c.jsx(fc,{className:"fill-primary absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2"})})})}function Nh({field:e,formValues:t,handleChange:n,handleBlur:r,error:o,disabled:s,...a}){const{apiClient:i,api_URL:l,charCount:d,setCharCounts:u,fileInputRefs:h,...g}=a,p=t[e.name]??"",b=s,m=e.options||[],v=e.inline||!1,C=e.renderType==="segment",N=g["aria-describedby"],E=C?"mt-2 inline-flex w-full p-1 rounded-lg bg-muted/50 border border-border shadow-inner":v?"flex flex-wrap gap-6 mt-2":"space-y-4 mt-2";return c.jsxs("fieldset",{className:`mb-4 ${e.fieldClass?e.fieldClass:"col-span-full"}`,"aria-labelledby":`${e.name}-legend`,"aria-describedby":o?N:void 0,children:[c.jsx("legend",{className:"sr-only",children:e.label}),c.jsx(Eh,{...g,value:String(p),onValueChange:x=>{const S=m.find(_=>String(typeof _=="object"?_.value:_)===x),A=S?typeof S=="object"?S.value:S:x;n(e.name,A),r(e.name)},disabled:b,className:E,children:m.map(x=>{const S=typeof x=="object"?x.value:x,A=typeof x=="object"?x.label:x,_=typeof x=="object"?x.description:null,P=`${e.name}-${String(S)}`,$=String(p)===String(S);return C?c.jsxs("label",{htmlFor:P,className:`
107
+ `,children:[u?c.jsx("span",{className:"text-slate-900 ",children:u.toLocaleString()}):c.jsx("span",{className:"text-slate-400",children:e.placeholder||"Select date and time"}),c.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"lucide lucide-calendar text-slate-400 group-hover:text-slate-600 transition-colors",children:[c.jsx("rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",ry:"2"}),c.jsx("line",{x1:"16",x2:"16",y1:"2",y2:"6"}),c.jsx("line",{x1:"8",x2:"8",y1:"2",y2:"6"}),c.jsx("line",{x1:"3",x2:"21",y1:"10",y2:"10"})]})]})}),c.jsxs(Hn,{align:"start",sideOffset:4,className:"z-50 w-auto p-0 bg-white rounded-xl shadow-xl border border-slate-200",children:[c.jsx("div",{className:"p-3",children:c.jsx(Zn.DayPicker,{mode:"single",selected:u,onSelect:p,showOutsideDays:!0,disabled:x,className:"p-0",classNames:{day_selected:"bg-blue-600 text-white hover:bg-blue-600 hover:text-white focus:bg-blue-600 focus:text-white rounded-md",day_today:"bg-slate-100 text-slate-900 font-bold rounded-md",day:"h-9 w-9 p-0 font-normal aria-selected:opacity-100 hover:bg-slate-100 rounded-md transition-colors",head_cell:"text-slate-500 rounded-md w-9 font-normal text-[0.8rem]"}})}),c.jsx("div",{className:"border-t border-slate-100 p-4 bg-slate-50/50",children:c.jsxs("div",{className:"flex items-center justify-center gap-4",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsxs("div",{className:"flex flex-col items-center gap-1",children:[c.jsx("button",{type:"button",onClick:m,className:"p-1 h-6 w-6 flex items-center justify-center text-slate-400 hover:text-slate-700 hover:bg-slate-200 rounded-full transition-all",children:c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:c.jsx("path",{d:"m18 15-6-6-6 6"})})}),c.jsx("div",{className:"w-12 h-10 flex items-center justify-center bg-white border border-slate-200 rounded-lg text-lg font-semibold shadow-sm text-slate-700",children:d}),c.jsx("button",{type:"button",onClick:v,className:"p-1 h-6 w-6 flex items-center justify-center text-slate-400 hover:text-slate-700 hover:bg-slate-200 rounded-full transition-all",children:c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:c.jsx("path",{d:"m6 9 6 6 6-6"})})})]}),c.jsx("span",{className:"text-xl font-medium text-slate-300 pb-1",children:":"}),c.jsxs("div",{className:"flex flex-col items-center gap-1",children:[c.jsx("button",{type:"button",onClick:S,className:"p-1 h-6 w-6 flex items-center justify-center text-slate-400 hover:text-slate-700 hover:bg-slate-200 rounded-full transition-all",children:c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:c.jsx("path",{d:"m18 15-6-6-6 6"})})}),c.jsx("div",{className:"w-12 h-10 flex items-center justify-center bg-white border border-slate-200 rounded-lg text-lg font-semibold shadow-sm text-slate-700",children:h}),c.jsx("button",{type:"button",onClick:k,className:"p-1 h-6 w-6 flex items-center justify-center text-slate-400 hover:text-slate-700 hover:bg-slate-200 rounded-full transition-all",children:c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:c.jsx("path",{d:"m6 9 6 6 6-6"})})})]})]}),c.jsxs("div",{className:"flex flex-col gap-1 bg-white p-1 rounded-lg border border-slate-200 shadow-sm",children:[c.jsx("button",{type:"button",onClick:()=>g!=="AM"&&E(),className:`px-3 py-1 text-xs font-bold rounded-md transition-all ${g==="AM"?"bg-blue-50 text-blue-600":"text-slate-400 hover:text-slate-600"}`,children:"AM"}),c.jsx("button",{type:"button",onClick:()=>g!=="PM"&&E(),className:`px-3 py-1 text-xs font-bold rounded-md transition-all ${g==="PM"?"bg-blue-50 text-blue-600":"text-slate-400 hover:text-slate-600"}`,children:"PM"})]})]})}),c.jsxs("div",{className:"flex items-center justify-between gap-2 border-t border-slate-100 p-3 bg-white rounded-b-xl",children:[c.jsx("button",{type:"button",onClick:w,className:"inline-flex items-center justify-center rounded-lg text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 text-slate-500 hover:text-slate-900 hover:bg-slate-100 h-9 px-4 py-2",children:"Clear"}),c.jsx("button",{type:"button",onClick:()=>a(!1),className:"inline-flex items-center justify-center rounded-lg text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 bg-blue-600 text-white hover:bg-blue-700 shadow-sm h-9 px-6 py-2",children:"Done"})]})]})]}),o&&c.jsx("p",{className:"mt-1 text-sm text-red-500",children:o})]})}var $m=Symbol.for("react.lazy"),Un=f[" use ".trim().toString()];function zm(e){return typeof e=="object"&&e!==null&&"then"in e}function li(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===$m&&"_payload"in e&&zm(e._payload)}function Rm(e){const t=Wm(e),n=f.forwardRef((r,o)=>{let{children:s,...a}=r;li(s)&&typeof Un=="function"&&(s=Un(s._payload));const i=f.Children.toArray(s),l=i.find(Hm);if(l){const u=l.props.children,d=i.map(h=>h===l?f.Children.count(u)>1?f.Children.only(null):f.isValidElement(u)?u.props.children:null:h);return c.jsx(t,{...a,ref:o,children:f.isValidElement(u)?f.cloneElement(u,void 0,d):null})}return c.jsx(t,{...a,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}function Wm(e){const t=f.forwardRef((n,r)=>{let{children:o,...s}=n;if(li(o)&&typeof Un=="function"&&(o=Un(o._payload)),f.isValidElement(o)){const a=Vm(o),i=Um(s,o.props);return o.type!==f.Fragment&&(i.ref=r?er(r,a):a),f.cloneElement(o,i)}return f.Children.count(o)>1?f.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Bm=Symbol("radix.slottable");function Hm(e){return f.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Bm}function Um(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...i)=>{const l=s(...i);return o(...i),l}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function Vm(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var jm=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Gm=jm.reduce((e,t)=>{const n=Rm(`Primitive.${t}`),r=f.forwardRef((o,s)=>{const{asChild:a,...i}=o,l=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(l,{...i,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),Ym="Separator",ui="horizontal",qm=["horizontal","vertical"],di=f.forwardRef((e,t)=>{const{decorative:n,orientation:r=ui,...o}=e,s=Km(r)?r:ui,i=n?{role:"none"}:{"aria-orientation":s==="vertical"?s:void 0,role:"separator"};return c.jsx(Gm.div,{"data-orientation":s,...i,...o,ref:t})});di.displayName=Ym;function Km(e){return qm.includes(e)}var Xm=di;function Xr({className:e,orientation:t="horizontal",decorative:n=!0,...r}){return c.jsx(Xm,{"data-slot":"separator",decorative:n,orientation:t,className:Rn("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",e),...r})}function Qm({field:e}){return e?.label?c.jsxs("div",{className:"relative flex items-center py-4",children:[c.jsx(Xr,{className:"flex-1 h-px bg-gray-300"}),c.jsx("span",{className:"px-3 font-medium text-gray-600 bg-white",children:e.label}),c.jsx(Xr,{className:"flex-1 h-px bg-gray-300"})]}):c.jsx(Xr,{className:"my-4 h-px bg-gray-300"})}var Zm=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Vn=Zm.reduce((e,t)=>{const n=Ce(`Primitive.${t}`),r=f.forwardRef((o,s)=>{const{asChild:a,...i}=o,l=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(l,{...i,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),Jm=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],fi=Jm.reduce((e,t)=>{const n=Ce(`Primitive.${t}`),r=f.forwardRef((o,s)=>{const{asChild:a,...i}=o,l=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(l,{...i,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),Qr="rovingFocusGroup.onEntryFocus",eh={bubbles:!1,cancelable:!0},Jt="RovingFocusGroup",[Zr,pi,th]=vo(Jt),[nh,mi]=ct(Jt,[th]),[rh,oh]=nh(Jt),hi=f.forwardRef((e,t)=>c.jsx(Zr.Provider,{scope:e.__scopeRovingFocusGroup,children:c.jsx(Zr.Slot,{scope:e.__scopeRovingFocusGroup,children:c.jsx(sh,{...e,ref:t})})}));hi.displayName=Jt;var sh=f.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:s,currentTabStopId:a,defaultCurrentTabStopId:i,onCurrentTabStopIdChange:l,onEntryFocus:u,preventScrollOnEntryFocus:d=!1,...h}=e,g=f.useRef(null),p=ce(t,g),b=tr(s),[m,v]=Rt({prop:a,defaultProp:i??null,onChange:l,caller:Jt}),[S,k]=f.useState(!1),E=Ke(u),w=pi(n),x=f.useRef(!1),[A,O]=f.useState(0);return f.useEffect(()=>{const T=g.current;if(T)return T.addEventListener(Qr,E),()=>T.removeEventListener(Qr,E)},[E]),c.jsx(rh,{scope:n,orientation:r,dir:b,loop:o,currentTabStopId:m,onItemFocus:f.useCallback(T=>v(T),[v]),onItemShiftTab:f.useCallback(()=>k(!0),[]),onFocusableItemAdd:f.useCallback(()=>O(T=>T+1),[]),onFocusableItemRemove:f.useCallback(()=>O(T=>T-1),[]),children:c.jsx(fi.div,{tabIndex:S||A===0?-1:0,"data-orientation":r,...h,ref:p,style:{outline:"none",...e.style},onMouseDown:J(e.onMouseDown,()=>{x.current=!0}),onFocus:J(e.onFocus,T=>{const $=!x.current;if(T.target===T.currentTarget&&$&&!S){const z=new CustomEvent(Qr,eh);if(T.currentTarget.dispatchEvent(z),!z.defaultPrevented){const H=w().filter(_=>_.focusable),Y=H.find(_=>_.active),D=H.find(_=>_.id===m),P=[Y,D,...H].filter(Boolean).map(_=>_.ref.current);yi(P,d)}}x.current=!1}),onBlur:J(e.onBlur,()=>k(!1))})})}),gi="RovingFocusGroupItem",bi=f.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:s,children:a,...i}=e,l=Ft(),u=s||l,d=oh(gi,n),h=d.currentTabStopId===u,g=pi(n),{onFocusableItemAdd:p,onFocusableItemRemove:b,currentTabStopId:m}=d;return f.useEffect(()=>{if(r)return p(),()=>b()},[r,p,b]),c.jsx(Zr.ItemSlot,{scope:n,id:u,focusable:r,active:o,children:c.jsx(fi.span,{tabIndex:h?0:-1,"data-orientation":d.orientation,...i,ref:t,onMouseDown:J(e.onMouseDown,v=>{r?d.onItemFocus(u):v.preventDefault()}),onFocus:J(e.onFocus,()=>d.onItemFocus(u)),onKeyDown:J(e.onKeyDown,v=>{if(v.key==="Tab"&&v.shiftKey){d.onItemShiftTab();return}if(v.target!==v.currentTarget)return;const S=ch(v,d.orientation,d.dir);if(S!==void 0){if(v.metaKey||v.ctrlKey||v.altKey||v.shiftKey)return;v.preventDefault();let E=g().filter(w=>w.focusable).map(w=>w.ref.current);if(S==="last")E.reverse();else if(S==="prev"||S==="next"){S==="prev"&&E.reverse();const w=E.indexOf(v.currentTarget);E=d.loop?lh(E,w+1):E.slice(w+1)}setTimeout(()=>yi(E))}}),children:typeof a=="function"?a({isCurrentTabStop:h,hasTabStop:m!=null}):a})})});bi.displayName=gi;var ah={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function ih(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function ch(e,t,n){const r=ih(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return ah[r]}function yi(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function lh(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var uh=hi,dh=bi,Jr="Radio",[fh,vi]=ct(Jr),[ph,mh]=fh(Jr),wi=f.forwardRef((e,t)=>{const{__scopeRadio:n,name:r,checked:o=!1,required:s,disabled:a,value:i="on",onCheck:l,form:u,...d}=e,[h,g]=f.useState(null),p=ce(t,v=>g(v)),b=f.useRef(!1),m=h?u||!!h.closest("form"):!0;return c.jsxs(ph,{scope:n,checked:o,disabled:a,children:[c.jsx(Vn.button,{type:"button",role:"radio","aria-checked":o,"data-state":Ei(o),"data-disabled":a?"":void 0,disabled:a,value:i,...d,ref:p,onClick:J(e.onClick,v=>{o||l?.(),m&&(b.current=v.isPropagationStopped(),b.current||v.stopPropagation())})}),m&&c.jsx(Ci,{control:h,bubbles:!b.current,name:r,value:i,checked:o,required:s,disabled:a,form:u,style:{transform:"translateX(-100%)"}})]})});wi.displayName=Jr;var xi="RadioIndicator",Si=f.forwardRef((e,t)=>{const{__scopeRadio:n,forceMount:r,...o}=e,s=mh(xi,n);return c.jsx(Dn,{present:r||s.checked,children:c.jsx(Vn.span,{"data-state":Ei(s.checked),"data-disabled":s.disabled?"":void 0,...o,ref:t})})});Si.displayName=xi;var hh="RadioBubbleInput",Ci=f.forwardRef(({__scopeRadio:e,control:t,checked:n,bubbles:r=!0,...o},s)=>{const a=f.useRef(null),i=ce(a,s),l=hs(n),u=ns(t);return f.useEffect(()=>{const d=a.current;if(!d)return;const h=window.HTMLInputElement.prototype,p=Object.getOwnPropertyDescriptor(h,"checked").set;if(l!==n&&p){const b=new Event("click",{bubbles:r});p.call(d,n),d.dispatchEvent(b)}},[l,n,r]),c.jsx(Vn.input,{type:"radio","aria-hidden":!0,defaultChecked:n,...o,tabIndex:-1,ref:i,style:{...o.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});Ci.displayName=hh;function Ei(e){return e?"checked":"unchecked"}var gh=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],jn="RadioGroup",[bh]=ct(jn,[mi,vi]),Ni=mi(),ki=vi(),[yh,vh]=bh(jn),Ai=f.forwardRef((e,t)=>{const{__scopeRadioGroup:n,name:r,defaultValue:o,value:s,required:a=!1,disabled:i=!1,orientation:l,dir:u,loop:d=!0,onValueChange:h,...g}=e,p=Ni(n),b=tr(u),[m,v]=Rt({prop:s,defaultProp:o??null,onChange:h,caller:jn});return c.jsx(yh,{scope:n,name:r,required:a,disabled:i,value:m,onValueChange:v,children:c.jsx(uh,{asChild:!0,...p,orientation:l,dir:b,loop:d,children:c.jsx(Vn.div,{role:"radiogroup","aria-required":a,"aria-orientation":l,"data-disabled":i?"":void 0,dir:b,...g,ref:t})})})});Ai.displayName=jn;var Ti="RadioGroupItem",Pi=f.forwardRef((e,t)=>{const{__scopeRadioGroup:n,disabled:r,...o}=e,s=vh(Ti,n),a=s.disabled||r,i=Ni(n),l=ki(n),u=f.useRef(null),d=ce(t,u),h=s.value===o.value,g=f.useRef(!1);return f.useEffect(()=>{const p=m=>{gh.includes(m.key)&&(g.current=!0)},b=()=>g.current=!1;return document.addEventListener("keydown",p),document.addEventListener("keyup",b),()=>{document.removeEventListener("keydown",p),document.removeEventListener("keyup",b)}},[]),c.jsx(dh,{asChild:!0,...i,focusable:!a,active:h,children:c.jsx(wi,{disabled:a,required:s.required,checked:h,...l,...o,name:s.name,ref:d,onCheck:()=>s.onValueChange(o.value),onKeyDown:J(p=>{p.key==="Enter"&&p.preventDefault()}),onFocus:J(o.onFocus,()=>{g.current&&u.current?.click()})})})});Pi.displayName=Ti;var wh="RadioGroupIndicator",_i=f.forwardRef((e,t)=>{const{__scopeRadioGroup:n,...r}=e,o=ki(n);return c.jsx(Si,{...o,...r,ref:t})});_i.displayName=wh;var xh=Ai,Sh=Pi,Ch=_i;function Eh({className:e,...t}){return c.jsx(xh,{"data-slot":"radio-group",className:Rn("grid gap-3",e),...t})}function Oi({className:e,...t}){return c.jsx(Sh,{"data-slot":"radio-group-item",className:Rn("border-input text-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 aspect-square size-4 shrink-0 rounded-full border shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:c.jsx(Ch,{"data-slot":"radio-group-indicator",className:"relative flex items-center justify-center",children:c.jsx(fc,{className:"fill-primary absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2"})})})}function Nh({field:e,formValues:t,handleChange:n,handleBlur:r,error:o,disabled:s,...a}){const{apiClient:i,api_URL:l,charCount:u,setCharCounts:d,fileInputRefs:h,...g}=a,p=t[e.name]??"",b=s,m=e.options||[],v=e.inline||!1,S=e.renderType==="segment",k=g["aria-describedby"],E=S?"mt-2 inline-flex w-full p-1 rounded-lg bg-muted/50 border border-border shadow-inner":v?"flex flex-wrap gap-6 mt-2":"space-y-4 mt-2";return c.jsxs("fieldset",{className:`mb-4 ${e.fieldClass?e.fieldClass:"col-span-full"}`,"aria-labelledby":`${e.name}-legend`,"aria-describedby":o?k:void 0,children:[c.jsx("legend",{className:"sr-only",children:e.label}),c.jsx(Eh,{...g,value:String(p),onValueChange:w=>{const x=m.find(O=>String(typeof O=="object"?O.value:O)===w),A=x?typeof x=="object"?x.value:x:w;n(e.name,A),r(e.name)},disabled:b,className:E,children:m.map(w=>{const x=typeof w=="object"?w.value:w,A=typeof w=="object"?w.label:w,O=typeof w=="object"?w.description:null,T=`${e.name}-${String(x)}`,$=String(p)===String(x);return S?c.jsxs("label",{htmlFor:T,className:`
108
108
  relative flex-1 min-w-max text-center px-4 py-2 rounded-md text-sm font-medium
109
109
  transition-all duration-200 cursor-pointer select-none
110
110
  focus-within:ring-2 focus-within:ring-ring focus-within:ring-offset-2
111
111
  ${$?"bg-background text-primary shadow-sm":"text-muted-foreground hover:text-foreground"}
112
112
  ${b?"opacity-40 cursor-not-allowed":""}
113
- `,children:[c.jsx(Oi,{value:String(S),id:P,disabled:b,className:"sr-only"}),A]},String(S)):c.jsxs("div",{className:"relative flex items-start group",children:[c.jsx("div",{className:"flex h-6 items-center",children:c.jsx(Oi,{value:String(S),id:P,disabled:b,className:`
113
+ `,children:[c.jsx(Oi,{value:String(x),id:T,disabled:b,className:"sr-only"}),A]},String(x)):c.jsxs("div",{className:"relative flex items-start group",children:[c.jsx("div",{className:"flex h-6 items-center",children:c.jsx(Oi,{value:String(x),id:T,disabled:b,className:`
114
114
  size-4 flex items-center justify-center rounded-full border border-input transition-all
115
115
  focus:ring-2 focus:ring-ring focus:ring-offset-2
116
116
  ${b?"bg-muted opacity-50":"bg-background cursor-pointer hover:border-primary/50"}
117
117
  ${o?"border-destructive":""}
118
- `})}),c.jsxs("div",{className:"ml-3 text-sm leading-6",children:[c.jsx("label",{htmlFor:P,className:`font-medium transition-colors ${b?"text-muted-foreground":"text-foreground cursor-pointer group-hover:text-primary"}`,children:A}),_&&!v&&c.jsx("p",{className:`text-xs ${b?"text-muted-foreground/60":"text-muted-foreground"}`,children:_})]})]},String(S))})})]})}function kh({field:e}){const t=e.text||e.label||"",n=e.description||"",r=e.size||"lg",o=e.underline||!1,s=e.align||"left",a=e.className||"",i={sm:"text-xl font-bold",base:"text-2xl font-bold",lg:"text-3xl font-bold"},l={left:"text-left",center:"text-center",right:"text-right"},d=`
118
+ `})}),c.jsxs("div",{className:"ml-3 text-sm leading-6",children:[c.jsx("label",{htmlFor:T,className:`font-medium transition-colors ${b?"text-muted-foreground":"text-foreground cursor-pointer group-hover:text-primary"}`,children:A}),O&&!v&&c.jsx("p",{className:`text-xs ${b?"text-muted-foreground/60":"text-muted-foreground"}`,children:O})]})]},String(x))})})]})}function kh({field:e}){const t=e.text||e.label||"",n=e.description||"",r=e.size||"lg",o=e.underline||!1,s=e.align||"left",a=e.className||"",i={sm:"text-xl font-bold",base:"text-2xl font-bold",lg:"text-3xl font-bold"},l={left:"text-left",center:"text-center",right:"text-right"},u=`
119
119
  ${i[r]||i.lg}
120
120
  ${l[s]||l.left}
121
121
  ${a}
122
122
  text-gray-900 tracking-tight w-full
123
- `.trim(),u=`
123
+ `.trim(),d=`
124
124
  mt-1 text-sm text-gray-500 w-full
125
125
  ${l[s]||l.left}
126
- `.trim();return c.jsxs("div",{className:`my-6 col-span-full w-full ${o?"border-b border-gray-200 pb-3":""}`,children:[c.jsx("h2",{className:d,children:t}),n&&c.jsx("p",{className:u,children:n})]})}function Ah({field:e,formValues:t,handleChange:n,handleBlur:r,error:o,disabled:s,...a}){const i=S=>{if(!S)return null;if(S instanceof Date)return Number.isNaN(S.getTime())?null:S;if(typeof S=="string"){const _=S.match(/^(\d{4})-(\d{2})-(\d{2})$/);if(_){const[,z,H,G]=_,w=new Date(Number(z),Number(H)-1,Number(G));return Number.isNaN(w.getTime())?null:w}const P=S.includes("T")?S:S.replace(" ","T"),$=new Date(P);return Number.isNaN($.getTime())?null:$}const A=new Date(S);return Number.isNaN(A.getTime())?null:A},l=S=>!(S instanceof Date)||Number.isNaN(S.getTime())?null:Mn(S,"yyyy-MM-dd"),d=S=>i(S),[u,h]=R.useState(!1),g=s,p=t[e.name],b=R.useMemo(()=>d(p),[p]),[m,v]=R.useState(b||new Date);a["aria-describedby"],R.useEffect(()=>{if(u){const S=b||new Date;v(A=>A.getFullYear()===S.getFullYear()&&A.getMonth()===S.getMonth()?A:S)}},[u,b]);const C=[];if(e.maxDate){const S=i(e.maxDate);S&&C.push({after:S})}if(e.minDate){const S=i(e.minDate);S&&C.push({before:S})}const N=S=>{n(e.name,S?l(S):null),S&&v(S),e.closeOnSelect!==!1&&h(!1),r(e.name)},E=()=>{const S=new Date;n(e.name,l(S)),v(S),e.closeOnSelect!==!1&&h(!1),r(e.name)},x=S=>{S.preventDefault(),S.stopPropagation(),n(e.name,null),v(new Date),r(e.name)};return c.jsx("div",{className:"relative w-full",children:c.jsxs(Wn,{open:g?!1:u,onOpenChange:S=>{g||(h(S),S||r(e.name))},children:[c.jsx(Bn,{asChild:!0,children:c.jsxs("div",{role:"combobox","aria-expanded":u,"aria-haspopup":"dialog","aria-controls":e.name+"-calendar",tabIndex:g?-1:0,onClick:()=>!g&&h(!0),onKeyDown:S=>{g||(S.key==="Enter"||S.key===" ")&&(S.preventDefault(),h(!0))},className:`
126
+ `.trim();return c.jsxs("div",{className:`my-6 col-span-full w-full ${o?"border-b border-gray-200 pb-3":""}`,children:[c.jsx("h2",{className:u,children:t}),n&&c.jsx("p",{className:d,children:n})]})}function Ah({field:e,formValues:t,handleChange:n,handleBlur:r,error:o,disabled:s,...a}){const i=x=>{if(!x)return null;if(x instanceof Date)return Number.isNaN(x.getTime())?null:x;if(typeof x=="string"){const O=x.match(/^(\d{4})-(\d{2})-(\d{2})$/);if(O){const[,z,H,Y]=O,D=new Date(Number(z),Number(H)-1,Number(Y));return Number.isNaN(D.getTime())?null:D}const T=x.includes("T")?x:x.replace(" ","T"),$=new Date(T);return Number.isNaN($.getTime())?null:$}const A=new Date(x);return Number.isNaN(A.getTime())?null:A},l=x=>!(x instanceof Date)||Number.isNaN(x.getTime())?null:Mn(x,"yyyy-MM-dd"),u=x=>i(x),[d,h]=R.useState(!1),g=s,p=t[e.name],b=R.useMemo(()=>u(p),[p]),[m,v]=R.useState(b||new Date);a["aria-describedby"],R.useEffect(()=>{if(d){const x=b||new Date;v(A=>A.getFullYear()===x.getFullYear()&&A.getMonth()===x.getMonth()?A:x)}},[d,b]);const S=[];if(e.maxDate){const x=i(e.maxDate);x&&S.push({after:x})}if(e.minDate){const x=i(e.minDate);x&&S.push({before:x})}const k=x=>{n(e.name,x?l(x):null),x&&v(x),e.closeOnSelect!==!1&&h(!1),r(e.name)},E=()=>{const x=new Date;n(e.name,l(x)),v(x),e.closeOnSelect!==!1&&h(!1),r(e.name)},w=x=>{x.preventDefault(),x.stopPropagation(),n(e.name,null),v(new Date),r(e.name)};return c.jsx("div",{className:"relative w-full",children:c.jsxs(Wn,{open:g?!1:d,onOpenChange:x=>{g||(h(x),x||r(e.name))},children:[c.jsx(Bn,{asChild:!0,children:c.jsxs("div",{role:"combobox","aria-expanded":d,"aria-haspopup":"dialog","aria-controls":e.name+"-calendar",tabIndex:g?-1:0,onClick:()=>!g&&h(!0),onKeyDown:x=>{g||(x.key==="Enter"||x.key===" ")&&(x.preventDefault(),h(!0))},className:`
127
127
  flex h-10 w-full items-center justify-between rounded-md border px-3 py-2 text-sm
128
128
  transition-all outline-none focus-within:ring-2 focus-within:ring-ring focus-within:ring-offset-2
129
129
  ${g?"bg-muted text-muted-foreground cursor-not-allowed opacity-50":"bg-background text-foreground hover:border-primary/50 cursor-pointer"}
130
130
  ${o?"border-destructive focus-within:ring-destructive":"border-input"}
131
- `,children:[c.jsxs("div",{className:"flex items-center gap-2 overflow-hidden pointer-events-none",children:[c.jsx(ho,{className:`h-4 w-4 shrink-0 ${o?"text-destructive":"text-muted-foreground"}`,"aria-hidden":"true"}),b?c.jsx("span",{className:"truncate",children:Mn(b,"PPP")}):c.jsx("span",{className:"text-muted-foreground truncate",children:e.placeholder||"Pick a date"})]}),c.jsxs("div",{className:"flex items-center gap-1",children:[b&&!g&&c.jsx("button",{type:"button","aria-label":"Clear selected date",onClick:x,className:"p-1 hover:bg-muted rounded-full transition-colors focus-visible:ring-1 focus-visible:ring-ring outline-none relative z-10",children:c.jsx(Jn,{className:"h-3.5 w-3.5 text-muted-foreground","aria-hidden":"true"})}),c.jsx(on,{className:`h-4 w-4 shrink-0 opacity-50 transition-transform duration-200 ${u?"rotate-180":""}`,"aria-hidden":"true"})]})]})}),c.jsxs(Hn,{align:"start",sideOffset:4,className:"z-50 w-auto p-0 bg-popover border border-border rounded-lg shadow-xl",children:[c.jsx("div",{className:"p-3",children:c.jsx(Zn.DayPicker,{mode:"single",selected:b,month:m,onMonthChange:v,onSelect:N,showOutsideDays:!0,disabled:C,classNames:{day_selected:"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground",day_today:"bg-accent text-accent-foreground font-bold",day:"h-9 w-9 p-0 font-normal hover:bg-muted rounded-md transition-colors",nav_button:"h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100 border border-input rounded-md flex items-center justify-center",caption_label:"text-sm font-medium"}})}),c.jsxs("div",{className:"flex items-center justify-between gap-2 border-t border-border p-3 bg-muted/20",children:[c.jsx("button",{type:"button",onClick:E,className:"text-xs font-medium px-4 py-2 rounded-md border border-input bg-background hover:bg-muted transition-all focus-visible:ring-2 focus-visible:ring-ring",children:"Today"}),c.jsx("button",{type:"button",onClick:()=>h(!1),className:"text-xs font-medium px-4 py-2 rounded-md bg-primary text-primary-foreground hover:opacity-90 transition-all focus-visible:ring-2 focus-visible:ring-ring",children:"Done"})]})]})]})})}function Th({field:e,formValues:t,handleChange:n,handleBlur:r,error:o}){const[s,a]=R.useState(!1),[i,l]=R.useState("12"),[d,u]=R.useState("00"),[h,g]=R.useState("PM"),p=t[e.name]||"";R.useEffect(()=>{if(p){const x=p.match(/(\d{1,2}):(\d{2})\s*(AM|PM)/i);x&&(l(x[1].padStart(2,"0")),u(x[2]),g(x[3].toUpperCase()))}},[p]);const b=()=>{const x=`${i}:${d} ${h}`;n(e.name,x),a(!1)},m=()=>{n(e.name,""),l("12"),u("00"),g("PM")},v=()=>{const x=parseInt(i);l((x%12+1).toString().padStart(2,"0"))},C=()=>{const x=parseInt(i);l((x===1?12:x-1).toString().padStart(2,"0"))},N=()=>{const x=parseInt(d);u(((x+5)%60).toString().padStart(2,"0"))},E=()=>{const x=parseInt(d);u((x===0?55:x-5).toString().padStart(2,"0"))};return c.jsx("div",{children:c.jsxs(Wn,{open:s,onOpenChange:a,children:[c.jsx(Bn,{asChild:!0,children:c.jsxs("button",{type:"button",id:e.name,"aria-haspopup":"dialog","aria-expanded":s,onClick:()=>a(!0),className:`
131
+ `,children:[c.jsxs("div",{className:"flex items-center gap-2 overflow-hidden pointer-events-none",children:[c.jsx(ho,{className:`h-4 w-4 shrink-0 ${o?"text-destructive":"text-muted-foreground"}`,"aria-hidden":"true"}),b?c.jsx("span",{className:"truncate",children:Mn(b,"PPP")}):c.jsx("span",{className:"text-muted-foreground truncate",children:e.placeholder||"Pick a date"})]}),c.jsxs("div",{className:"flex items-center gap-1",children:[b&&!g&&c.jsx("button",{type:"button","aria-label":"Clear selected date",onClick:w,className:"p-1 hover:bg-muted rounded-full transition-colors focus-visible:ring-1 focus-visible:ring-ring outline-none relative z-10",children:c.jsx(Jn,{className:"h-3.5 w-3.5 text-muted-foreground","aria-hidden":"true"})}),c.jsx(on,{className:`h-4 w-4 shrink-0 opacity-50 transition-transform duration-200 ${d?"rotate-180":""}`,"aria-hidden":"true"})]})]})}),c.jsxs(Hn,{align:"start",sideOffset:4,className:"z-50 w-auto p-0 bg-popover border border-border rounded-lg shadow-xl",children:[c.jsx("div",{className:"p-3",children:c.jsx(Zn.DayPicker,{mode:"single",selected:b,month:m,onMonthChange:v,onSelect:k,showOutsideDays:!0,disabled:S,classNames:{day_selected:"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground",day_today:"bg-accent text-accent-foreground font-bold",day:"h-9 w-9 p-0 font-normal hover:bg-muted rounded-md transition-colors",nav_button:"h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100 border border-input rounded-md flex items-center justify-center",caption_label:"text-sm font-medium"}})}),c.jsxs("div",{className:"flex items-center justify-between gap-2 border-t border-border p-3 bg-muted/20",children:[c.jsx("button",{type:"button",onClick:E,className:"text-xs font-medium px-4 py-2 rounded-md border border-input bg-background hover:bg-muted transition-all focus-visible:ring-2 focus-visible:ring-ring",children:"Today"}),c.jsx("button",{type:"button",onClick:()=>h(!1),className:"text-xs font-medium px-4 py-2 rounded-md bg-primary text-primary-foreground hover:opacity-90 transition-all focus-visible:ring-2 focus-visible:ring-ring",children:"Done"})]})]})]})})}function Th({field:e,formValues:t,handleChange:n,handleBlur:r,error:o}){const[s,a]=R.useState(!1),[i,l]=R.useState("12"),[u,d]=R.useState("00"),[h,g]=R.useState("PM"),p=t[e.name]||"";R.useEffect(()=>{if(p){const w=p.match(/(\d{1,2}):(\d{2})\s*(AM|PM)/i);w&&(l(w[1].padStart(2,"0")),d(w[2]),g(w[3].toUpperCase()))}},[p]);const b=()=>{const w=`${i}:${u} ${h}`;n(e.name,w),a(!1)},m=()=>{n(e.name,""),l("12"),d("00"),g("PM")},v=()=>{const w=parseInt(i);l((w%12+1).toString().padStart(2,"0"))},S=()=>{const w=parseInt(i);l((w===1?12:w-1).toString().padStart(2,"0"))},k=()=>{const w=parseInt(u);d(((w+5)%60).toString().padStart(2,"0"))},E=()=>{const w=parseInt(u);d((w===0?55:w-5).toString().padStart(2,"0"))};return c.jsx("div",{children:c.jsxs(Wn,{open:s,onOpenChange:a,children:[c.jsx(Bn,{asChild:!0,children:c.jsxs("button",{type:"button",id:e.name,"aria-haspopup":"dialog","aria-expanded":s,onClick:()=>a(!0),className:`
132
132
  inline-flex items-center justify-between gap-2
133
133
  w-full h-9 rounded-md border bg-white
134
134
  px-3 py-2 text-sm font-normal shadow-sm
@@ -136,10 +136,10 @@
136
136
  focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2
137
137
  disabled:cursor-not-allowed disabled:opacity-50
138
138
  ${o?"border-red-500 focus-visible:ring-red-500":"border-gray-300 focus-visible:ring-blue-500"}
139
- `,children:[p?c.jsx("span",{children:p}):c.jsx("span",{className:"text-gray-400",children:e.placeholder||"Select time"}),c.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"lucide lucide-clock opacity-70",children:[c.jsx("circle",{cx:"12",cy:"12",r:"10"}),c.jsx("polyline",{points:"12 6 12 12 16 14"})]})]})}),c.jsx(Hn,{align:"start",sideOffset:2,className:"z-50 rounded-md border border-gray-200 bg-white p-4 shadow-md w-64",children:c.jsxs("div",{className:"flex flex-col gap-4",children:[c.jsxs("div",{className:"flex items-center justify-center gap-2",children:[c.jsxs("div",{className:"flex flex-col items-center",children:[c.jsx("button",{type:"button",onClick:v,className:"p-1 hover:bg-gray-100 rounded",children:c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:c.jsx("polyline",{points:"18 15 12 9 6 15"})})}),c.jsx("input",{type:"text",value:i,onChange:x=>{const S=x.target.value.replace(/\D/g,"");(S===""||parseInt(S)>=1&&parseInt(S)<=12)&&l(S.padStart(2,"0"))},className:"w-14 text-center text-2xl font-semibold border-0 focus:outline-none focus:ring-2 focus:ring-blue-500 rounded py-2",maxLength:"2"}),c.jsx("button",{type:"button",onClick:C,className:"p-1 hover:bg-gray-100 rounded",children:c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:c.jsx("polyline",{points:"6 9 12 15 18 9"})})})]}),c.jsx("span",{className:"text-2xl font-semibold",children:":"}),c.jsxs("div",{className:"flex flex-col items-center",children:[c.jsx("button",{type:"button",onClick:N,className:"p-1 hover:bg-gray-100 rounded",children:c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:c.jsx("polyline",{points:"18 15 12 9 6 15"})})}),c.jsx("input",{type:"text",value:d,onChange:x=>{const S=x.target.value.replace(/\D/g,"");(S===""||parseInt(S)>=0&&parseInt(S)<=59)&&u(S.padStart(2,"0"))},className:"w-14 text-center text-2xl font-semibold border-0 focus:outline-none focus:ring-2 focus:ring-blue-500 rounded py-2",maxLength:"2"}),c.jsx("button",{type:"button",onClick:E,className:"p-1 hover:bg-gray-100 rounded",children:c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:c.jsx("polyline",{points:"6 9 12 15 18 9"})})})]}),c.jsxs("div",{className:"flex flex-col gap-1 ml-2",children:[c.jsx("button",{type:"button",onClick:()=>g("AM"),className:`
139
+ `,children:[p?c.jsx("span",{children:p}):c.jsx("span",{className:"text-gray-400",children:e.placeholder||"Select time"}),c.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"lucide lucide-clock opacity-70",children:[c.jsx("circle",{cx:"12",cy:"12",r:"10"}),c.jsx("polyline",{points:"12 6 12 12 16 14"})]})]})}),c.jsx(Hn,{align:"start",sideOffset:2,className:"z-50 rounded-md border border-gray-200 bg-white p-4 shadow-md w-64",children:c.jsxs("div",{className:"flex flex-col gap-4",children:[c.jsxs("div",{className:"flex items-center justify-center gap-2",children:[c.jsxs("div",{className:"flex flex-col items-center",children:[c.jsx("button",{type:"button",onClick:v,className:"p-1 hover:bg-gray-100 rounded",children:c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:c.jsx("polyline",{points:"18 15 12 9 6 15"})})}),c.jsx("input",{type:"text",value:i,onChange:w=>{const x=w.target.value.replace(/\D/g,"");(x===""||parseInt(x)>=1&&parseInt(x)<=12)&&l(x.padStart(2,"0"))},className:"w-14 text-center text-2xl font-semibold border-0 focus:outline-none focus:ring-2 focus:ring-blue-500 rounded py-2",maxLength:"2"}),c.jsx("button",{type:"button",onClick:S,className:"p-1 hover:bg-gray-100 rounded",children:c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:c.jsx("polyline",{points:"6 9 12 15 18 9"})})})]}),c.jsx("span",{className:"text-2xl font-semibold",children:":"}),c.jsxs("div",{className:"flex flex-col items-center",children:[c.jsx("button",{type:"button",onClick:k,className:"p-1 hover:bg-gray-100 rounded",children:c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:c.jsx("polyline",{points:"18 15 12 9 6 15"})})}),c.jsx("input",{type:"text",value:u,onChange:w=>{const x=w.target.value.replace(/\D/g,"");(x===""||parseInt(x)>=0&&parseInt(x)<=59)&&d(x.padStart(2,"0"))},className:"w-14 text-center text-2xl font-semibold border-0 focus:outline-none focus:ring-2 focus:ring-blue-500 rounded py-2",maxLength:"2"}),c.jsx("button",{type:"button",onClick:E,className:"p-1 hover:bg-gray-100 rounded",children:c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:c.jsx("polyline",{points:"6 9 12 15 18 9"})})})]}),c.jsxs("div",{className:"flex flex-col gap-1 ml-2",children:[c.jsx("button",{type:"button",onClick:()=>g("AM"),className:`
140
140
  px-3 py-1 text-sm font-medium rounded
141
141
  ${h==="AM"?"bg-blue-600 text-white":"bg-gray-100 text-gray-700 hover:bg-gray-200"}
142
142
  `,children:"AM"}),c.jsx("button",{type:"button",onClick:()=>g("PM"),className:`
143
143
  px-3 py-1 text-sm font-medium rounded
144
144
  ${h==="PM"?"bg-blue-600 text-white":"bg-gray-100 text-gray-700 hover:bg-gray-200"}
145
- `,children:"PM"})]})]}),c.jsxs("div",{className:"flex items-center justify-between gap-2 border-t border-gray-200 pt-3",children:[c.jsx("button",{type:"button",onClick:m,className:"inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 border border-gray-300 bg-white hover:bg-gray-100 hover:text-gray-900 h-9 px-4 py-2",children:"Clear"}),c.jsx("button",{type:"button",onClick:b,className:"inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 bg-blue-600 text-white hover:bg-blue-700 h-9 px-4 py-2",children:"Done"})]})]})})]})})}function Ph({message:e}){return c.jsx("div",{className:"rounded-lg bg-red-50 border border-red-100 p-4 shadow-sm",children:c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx(uc,{"aria-hidden":"true",className:"size-5 text-red-500 shrink-0"}),c.jsx("span",{className:"text-sm font-medium text-red-900",children:e})]})})}function _h({message:e}){return c.jsx("div",{className:"rounded-lg bg-amber-50 border border-amber-100 p-4 shadow-sm",children:c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx(lc,{"aria-hidden":"true",className:"size-5 text-amber-600 shrink-0"}),c.jsx("span",{className:"text-sm font-medium text-amber-900",children:e})]})})}function Oh({message:e}){return c.jsx("div",{className:"rounded-lg bg-green-50 border border-green-100 p-4 shadow-sm",children:c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx(dc,{"aria-hidden":"true",className:"size-5 text-green-600 shrink-0"}),c.jsx("span",{className:"text-sm font-medium text-green-900",children:e})]})})}function Mh({message:e}){return c.jsx("div",{className:"rounded-lg bg-blue-50 border border-blue-100 p-4 shadow-sm",children:c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx(vc,{"aria-hidden":"true",className:"size-5 text-blue-600 shrink-0"}),c.jsx("span",{className:"text-sm font-medium text-blue-900",children:e})]})})}function Dh({field:e}){const{variant:t="info",message:n,content:r}=e,o=n||r||"";switch(t.toLowerCase()){case"error":case"danger":return c.jsx(Ph,{message:o});case"success":return c.jsx(Oh,{message:o});case"warning":case"warn":return c.jsx(_h,{message:o});default:return c.jsx(Mh,{message:o})}}function Ih(e){if(e instanceof Date)return e;if(typeof e=="string"&&e){const t=e.match(/^(\d{4})-(\d{2})-(\d{2})$/);if(t){const[,o,s,a]=t,i=new Date(Number(o),Number(s)-1,Number(a));if(!isNaN(i.getTime()))return i}const n=e.includes("T")?e:e.replace(" ","T"),r=new Date(n);if(!isNaN(r.getTime()))return r}return null}const Mi=({apiClient:e,api_URL:t,footerMode:n="normal",formDefinition:r,returnType:o=!1,sendFormValues:s=()=>{},children:a,defaultValues:i={},onFieldsChange:l=()=>{},debugMode:d=!1})=>{const[u,h]=R.useState({...i}),[g,p]=R.useState({}),[b,m]=R.useState({}),[v,C]=R.useState({}),N=R.useRef({}),E=["hidden","linebreak","header","alert"],x=R.useMemo(()=>({file:ci,multifile:ci,dateRange:Im,date:Ah,dayTimePicker:Fm,time:Th,hidden:ec,multiselect:tc,searchselect:Pc,select:Ku,email:Xu,html:Sf,checkbox:Cf,radiogroup:Nh,input:aa,number:Qu,textarea:Lm,header:kh,alert:Dh,linebreak:Qm}),[]),S=async(w,k=null)=>{if(!(w.optionsUrl&&!w.preloadOptions)){if(!e){const D=`apiClient prop is required when using fields with optionsUrl. Field "${w.name}" requires optionsUrl but no apiClient was provided.`;d&&console.error(D),nn.toast.error(D);return}try{const D=await e(`/${w.optionsUrl}`);let O=[];w.type==="select"?O=[{value:"",label:`Select ${w.label.toLowerCase()}`},...D.data]:O=[...D.data.map(I=>({value:I.value,label:I.label}))],r.fields.forEach(I=>{I&&I.name===w.name&&(I.options=O)})}catch(D){d&&console.error(`Failed to load options for ${w.name}:`,D)}}};R.useEffect(()=>{if(r?.fields&&r.fields.length>0){if(!r.fields.some(D=>D&&D.value))return;r.fields.forEach(D=>{D&&D.optionsUrl&&S(D)});const k={};r.fields.forEach(D=>{if(!D||!D.name)return;const O=D.type==="multiselect"||D.type==="searchselect"||D.type==="checkbox"&&D.options&&D.options.length>0;let I=i[D.name]??D.value??(O?[]:"");["date","datetime","datepicker"].includes(D.type?.toLowerCase())&&I&&(I=Ih(I)||I),k[D.name]=I}),h(k)}},[r]);const A=(w,k,D)=>{const O=typeof k=="object"&&k!==null&&!Array.isArray(k)&&!(k instanceof Date),I=k==null||typeof k=="string"&&k.trim()===""||Array.isArray(k)&&k.length===0||w.type==="checkbox"&&k===!1||O&&Object.keys(k).length===0;if(w.required&&I)return d&&console.warn(`VALIDATION FAILED (REQUIRED): ${w.name} is empty.`),`${w.label} is required`;if(I&&!w.required)return null;if(w.validate){const T=w.validate(k,D);if(T)return T}if(w.type==="email"&&k&&!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(k))return"Please enter a valid email address";if(w.type==="number"){if(w.min!==void 0&&k<w.min)return`${w.label} must be at least ${w.min}`;if(w.max!==void 0&&k>w.max)return`${w.label} must be no more than ${w.max}`}return w.type==="date"&&k&&!vt(k).isValid()?`${w.label} must be a valid date`:w.maxLength&&k&&k.length>w.maxLength?`${w.label} must not exceed ${w.maxLength} characters`:null},_=(w,k)=>{const D=r.fields.find(I=>I&&I.name===w);if(!D)return;const O={...u};D.type==="multiselect"||D.type==="searchselect"?Array.isArray(k)?O[w]=k:k&&k.target&&k.target.selectedOptions?O[w]=Array.from(k.target.selectedOptions).map(I=>I.value):O[w]=k:D.type==="dateRange"?O[w]=[{startDate:k.from,endDate:k.to||k.from,key:"selection"}]:D.type==="dayTimePicker"?O[w]=k?vt(k).format("YYYY-MM-DD HH:mm:ss"):"":D.type==="number"?O[w]=k===""?"":Number(k):O[w]=k,D.type==="select"&&r.fields.forEach(I=>{if(I&&I.showIf&&!I.showIf(O)){const T=I.type==="multiselect"||I.type==="searchselect"||I.type==="checkbox"&&I.options&&I.options.length>0;O[I.name]=T?[]:""}}),r.fields.forEach(I=>{if(I&&typeof I.disabled=="function"&&I.disabled(O)){const T=I.type==="multiselect"||I.type==="searchselect"||I.type==="checkbox"&&I.options&&I.options.length>0;O[I.name]=T?[]:""}}),h(O)},P=w=>{m({...b,[w]:!0})},$=w=>{w.preventDefault();const k={};r.fields.forEach(O=>{O&&O.name&&(k[O.name]=!0)}),m(k);const D={};if(r.fields.forEach(O=>{if(!(!O||!O.name)&&(!O.showIf||O.showIf(u))){const I=A(O,u[O.name],u);I&&(D[O.name]=I)}}),p(D),Object.keys(D).length===0){const O=(T,F)=>{if(T===""||T===null||T===void 0)return null;const M=F?.toLowerCase();if(Array.isArray(T))return M==="number"||M==="integer"?T.map(q=>q===""?null:Number(q)):T;switch(M){case"number":case"integer":case"float":return Number(T);case"boolean":case"bool":return String(T).toLowerCase()==="true"||T===!0;case"date":case"datepicker":return vt(T).isValid()?vt(T).format("YYYY-MM-DD"):T;case"datetime":return vt(T).isValid()?vt(T).format("YYYY-MM-DDTHH:mm:ss"):T;default:return T}},I={};r.fields.forEach(T=>{if(T&&T.name){const F=u[T.name],M=T.type||"string",q=O(F,M);o?I[T.name]={value:q,fieldType:M}:I[T.name]=q}}),d?console.log("Form submitted with values:",I):s(I)}else nn.toast.error("Please correct the errors in the form")};R.useEffect(()=>{l(u)},[u,l]);const z={green:"border-green-500 bg-green-50",blue:"border-blue-500 bg-blue-50",red:"border-red-500 bg-red-50",yellow:"border-yellow-500 bg-yellow-50",purple:"border-purple-500 bg-purple-50",indigo:"border-indigo-500 bg-indigo-50",gray:"border-gray-500 bg-gray-50",pink:"border-pink-500 bg-pink-50",orange:"border-orange-500 bg-orange-50"};function H(w,k,D){const O=`${k.name}-error`;if(d&&(D?console.log(`[fieldFormat RENDER] Rendering error for ${k.name}: ${D}`):g[k.name]&&console.log(`[fieldFormat RENDER] Error exists in state for ${k.name} but not passed in props!`)),E.includes(k.type))return c.jsx("div",{className:k.class||"col-span-full",children:w});const I=k.containerStyle,T=k.color||"blue",F=I==="card"?`rounded-lg border text-card-foreground shadow-sm p-4 ${k.containerClassName||z[T]||z.blue}`:"",M=c.jsxs(c.Fragment,{children:[k.label&&c.jsxs("label",{htmlFor:k.name,className:"block text-sm font-medium mb-1",children:[k.label,k.required&&c.jsx("span",{className:"text-red-500 ml-1","aria-hidden":"true",children:"*"})]}),c.jsx("div",{children:R.cloneElement(w,{"aria-describedby":D?O:void 0,"aria-invalid":!!D,"aria-required":k.required})}),k.description&&c.jsx("p",{className:"text-xs mt-1.5 text-gray-400",children:k.description}),D&&c.jsx("p",{id:O,className:"text-sm text-red-500 mt-1",role:"alert",children:D})]});return c.jsx("div",{className:"mb-4",children:I==="card"?c.jsx("div",{className:F,children:M}):M})}const G=w=>{if(w.showIf&&!w.showIf(u))return null;const k=x[w.type]||aa;if(u[w.name]===void 0){const I=w.type==="multiselect"||w.type==="searchselect"||w.type==="checkbox"&&w.options&&w.options.length>0;u[w.name]=w.value!==void 0?w.value:I?[]:""}const D=g[w.name]?g[w.name]:null,O=typeof w.disabled=="function"?w.disabled(u):!!w.disabled;return H(c.jsx(k,{field:w,formValues:u,handleChange:_,handleBlur:()=>P(w.name),setCharCounts:C,charCount:v[w.name]||0,api_URL:t,error:D,fileInputRefs:N,disabled:O,apiClient:e}),w,D)};return c.jsxs("form",{onSubmit:$,className:"grid grid-cols-12 gap-x-4 mx-auto w-full  ",children:[r?r.fields.filter(w=>w).map(w=>c.jsx("div",{className:`${w.class||"col-span-full"} `,children:G(w)},w.name+w.type)):c.jsx("div",{children:"Loading..."}),c.jsx("div",{className:n==="sticky"?"absolute col-span-full w-full bottom-0  bg-white py-4 flex justify-end gap-2 z-50":"col-span-full mt-4 flex justify-end gap-2",children:R.Children.map(a,w=>R.isValidElement(w)&&w.props.onClick?R.cloneElement(w,{onClick:k=>{w.props.onClick(u,k)}}):w)})]})};me.DynamicForm=Mi,me.default=Mi,Object.defineProperties(me,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
145
+ `,children:"PM"})]})]}),c.jsxs("div",{className:"flex items-center justify-between gap-2 border-t border-gray-200 pt-3",children:[c.jsx("button",{type:"button",onClick:m,className:"inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 border border-gray-300 bg-white hover:bg-gray-100 hover:text-gray-900 h-9 px-4 py-2",children:"Clear"}),c.jsx("button",{type:"button",onClick:b,className:"inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 bg-blue-600 text-white hover:bg-blue-700 h-9 px-4 py-2",children:"Done"})]})]})})]})})}function Ph({message:e}){return c.jsx("div",{className:"rounded-lg bg-red-50 border border-red-100 p-4 shadow-sm",children:c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx(dc,{"aria-hidden":"true",className:"size-5 text-red-500 shrink-0"}),c.jsx("span",{className:"text-sm font-medium text-red-900",children:e})]})})}function _h({message:e}){return c.jsx("div",{className:"rounded-lg bg-amber-50 border border-amber-100 p-4 shadow-sm",children:c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx(lc,{"aria-hidden":"true",className:"size-5 text-amber-600 shrink-0"}),c.jsx("span",{className:"text-sm font-medium text-amber-900",children:e})]})})}function Oh({message:e}){return c.jsx("div",{className:"rounded-lg bg-green-50 border border-green-100 p-4 shadow-sm",children:c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx(uc,{"aria-hidden":"true",className:"size-5 text-green-600 shrink-0"}),c.jsx("span",{className:"text-sm font-medium text-green-900",children:e})]})})}function Mh({message:e}){return c.jsx("div",{className:"rounded-lg bg-blue-50 border border-blue-100 p-4 shadow-sm",children:c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx(vc,{"aria-hidden":"true",className:"size-5 text-blue-600 shrink-0"}),c.jsx("span",{className:"text-sm font-medium text-blue-900",children:e})]})})}function Dh({field:e}){const{variant:t="info",message:n,content:r}=e,o=n||r||"";switch(t.toLowerCase()){case"error":case"danger":return c.jsx(Ph,{message:o});case"success":return c.jsx(Oh,{message:o});case"warning":case"warn":return c.jsx(_h,{message:o});default:return c.jsx(Mh,{message:o})}}function Ih(e){if(e instanceof Date)return e;if(typeof e=="string"&&e){const t=e.match(/^(\d{4})-(\d{2})-(\d{2})$/);if(t){const[,o,s,a]=t,i=new Date(Number(o),Number(s)-1,Number(a));if(!isNaN(i.getTime()))return i}const n=e.includes("T")?e:e.replace(" ","T"),r=new Date(n);if(!isNaN(r.getTime()))return r}return null}const Mi=({apiClient:e,api_URL:t,footerMode:n="normal",formDefinition:r,returnType:o=!1,sendFormValues:s=()=>{},children:a,defaultValues:i={},onFieldsChange:l=()=>{},debugMode:u=!1})=>{const[d,h]=R.useState({...i}),[g,p]=R.useState({}),[b,m]=R.useState({}),[v,S]=R.useState({}),k=R.useRef({}),E=R.useRef(!1),w=["hidden","linebreak","header","alert"],x=R.useMemo(()=>({file:ci,multifile:ci,dateRange:Im,date:Ah,dayTimePicker:Fm,time:Th,hidden:ec,multiselect:tc,searchselect:Pc,select:Kd,email:Xd,html:Sf,checkbox:Cf,radiogroup:Nh,input:aa,number:Qd,textarea:Lm,header:kh,alert:Dh,linebreak:Qm}),[]),A=async(C,P=null)=>{if(!(C.optionsUrl&&!C.preloadOptions)){if(!e){const _=`apiClient prop is required when using fields with optionsUrl. Field "${C.name}" requires optionsUrl but no apiClient was provided.`;u&&console.error(_),nn.toast.error(_);return}try{const _=await e(`/${C.optionsUrl}`);let F=[];C.type==="select"?F=[{value:"",label:`Select ${C.label.toLowerCase()}`},..._.data]:F=[..._.data.map(N=>({value:N.value,label:N.label}))],r.fields.forEach(N=>{N&&N.name===C.name&&(N.options=F)})}catch(_){u&&console.error(`Failed to load options for ${C.name}:`,_)}}};R.useEffect(()=>{if(!E.current&&r?.fields&&r.fields.length>0){if(!r.fields.some(_=>_&&_.value))return;r.fields.forEach(_=>{_&&_.optionsUrl&&A(_)});const P={};r.fields.forEach(_=>{if(!_||!_.name)return;const F=_.type==="multiselect"||_.type==="searchselect"||_.type==="checkbox"&&_.options&&_.options.length>0;let N=i[_.name]??_.value??(F?[]:"");["date","datetime","datepicker"].includes(_.type?.toLowerCase())&&N&&(N=Ih(N)||N),P[_.name]=N}),h(P),E.current=!0}},[r]);const O=(C,P,_)=>{const F=typeof P=="object"&&P!==null&&!Array.isArray(P)&&!(P instanceof Date),N=P==null||typeof P=="string"&&P.trim()===""||Array.isArray(P)&&P.length===0||C.type==="checkbox"&&P===!1||F&&Object.keys(P).length===0;if(C.required&&N)return u&&console.warn(`VALIDATION FAILED (REQUIRED): ${C.name} is empty.`),`${C.label} is required`;if(N&&!C.required)return null;if(C.validate){const M=C.validate(P,_);if(M)return M}if(C.type==="email"&&P&&!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(P))return"Please enter a valid email address";if(C.type==="number"){if(C.min!==void 0&&P<C.min)return`${C.label} must be at least ${C.min}`;if(C.max!==void 0&&P>C.max)return`${C.label} must be no more than ${C.max}`}return C.type==="date"&&P&&!vt(P).isValid()?`${C.label} must be a valid date`:C.maxLength&&P&&P.length>C.maxLength?`${C.label} must not exceed ${C.maxLength} characters`:null},T=(C,P)=>{const _=r.fields.find(N=>N&&N.name===C);if(!_)return;const F={...d};_.type==="multiselect"||_.type==="searchselect"?Array.isArray(P)?F[C]=P:P&&P.target&&P.target.selectedOptions?F[C]=Array.from(P.target.selectedOptions).map(N=>N.value):F[C]=P:_.type==="dateRange"?F[C]=[{startDate:P.from,endDate:P.to||P.from,key:"selection"}]:_.type==="dayTimePicker"?F[C]=P?vt(P).format("YYYY-MM-DD HH:mm:ss"):"":_.type==="number"?F[C]=P===""?"":Number(P):F[C]=P,_.type==="select"&&r.fields.forEach(N=>{if(N&&N.showIf&&!N.showIf(F)){const M=N.type==="multiselect"||N.type==="searchselect"||N.type==="checkbox"&&N.options&&N.options.length>0;F[N.name]=M?[]:""}}),r.fields.forEach(N=>{if(N&&typeof N.disabled=="function"&&N.disabled(F)){const M=N.type==="multiselect"||N.type==="searchselect"||N.type==="checkbox"&&N.options&&N.options.length>0;F[N.name]=M?[]:""}}),h(F)},$=C=>{m({...b,[C]:!0})},z=C=>{C.preventDefault();const P={};r.fields.forEach(F=>{F&&F.name&&(P[F.name]=!0)}),m(P);const _={};if(r.fields.forEach(F=>{if(!(!F||!F.name)&&(!F.showIf||F.showIf(d))){const N=O(F,d[F.name],d);N&&(_[F.name]=N)}}),p(_),Object.keys(_).length===0){const F=(M,I)=>{if(M===""||M===null||M===void 0)return null;const j=I?.toLowerCase();if(Array.isArray(M))return j==="number"||j==="integer"?M.map(se=>se===""?null:Number(se)):M;switch(j){case"number":case"integer":case"float":return Number(M);case"boolean":case"bool":return String(M).toLowerCase()==="true"||M===!0;case"date":case"datepicker":return vt(M).isValid()?vt(M).format("YYYY-MM-DD"):M;case"datetime":return vt(M).isValid()?vt(M).format("YYYY-MM-DDTHH:mm:ss"):M;default:return M}},N={};r.fields.forEach(M=>{if(M&&M.name){const I=d[M.name],j=M.type||"string",se=F(I,j);o?N[M.name]={value:se,fieldType:j}:N[M.name]=se}}),u?console.log("Form submitted with values:",N):s(N)}else nn.toast.error("Please correct the errors in the form")};R.useEffect(()=>{l(d)},[d,l]);const H={green:"border-green-500 bg-green-50",blue:"border-blue-500 bg-blue-50",red:"border-red-500 bg-red-50",yellow:"border-yellow-500 bg-yellow-50",purple:"border-purple-500 bg-purple-50",indigo:"border-indigo-500 bg-indigo-50",gray:"border-gray-500 bg-gray-50",pink:"border-pink-500 bg-pink-50",orange:"border-orange-500 bg-orange-50"};function Y(C,P,_){const F=`${P.name}-error`;if(u&&(_?console.log(`[fieldFormat RENDER] Rendering error for ${P.name}: ${_}`):g[P.name]&&console.log(`[fieldFormat RENDER] Error exists in state for ${P.name} but not passed in props!`)),w.includes(P.type))return c.jsx("div",{className:P.class||"col-span-full",children:C});const N=P.containerStyle,M=P.color||"blue",I=N==="card"?`rounded-lg border text-card-foreground shadow-sm p-4 ${P.containerClassName||H[M]||H.blue}`:"",j=c.jsxs(c.Fragment,{children:[P.label&&c.jsxs("label",{htmlFor:P.name,className:"block text-sm font-medium mb-1",children:[P.label,P.required&&c.jsx("span",{className:"text-red-500 ml-1","aria-hidden":"true",children:"*"})]}),c.jsx("div",{children:R.cloneElement(C,{"aria-describedby":_?F:void 0,"aria-invalid":!!_,"aria-required":P.required})}),P.description&&c.jsx("p",{className:"text-xs mt-1.5 text-gray-400",children:P.description}),_&&c.jsx("p",{id:F,className:"text-sm text-red-500 mt-1",role:"alert",children:_})]});return c.jsx("div",{className:"mb-4",children:N==="card"?c.jsx("div",{className:I,children:j}):j})}const D=C=>{if(C.showIf&&!C.showIf(d))return null;const P=x[C.type]||aa;if(d[C.name]===void 0){const N=C.type==="multiselect"||C.type==="searchselect"||C.type==="checkbox"&&C.options&&C.options.length>0;d[C.name]=C.value!==void 0?C.value:N?[]:""}const _=g[C.name]?g[C.name]:null,F=typeof C.disabled=="function"?C.disabled(d):!!C.disabled;return Y(c.jsx(P,{field:C,formValues:d,handleChange:T,handleBlur:()=>$(C.name),setCharCounts:S,charCount:v[C.name]||0,api_URL:t,error:_,fileInputRefs:k,disabled:F,apiClient:e}),C,_)};return c.jsxs("form",{onSubmit:z,className:"grid grid-cols-12 gap-x-4 mx-auto w-full  ",children:[r?r.fields.filter(C=>C).map(C=>c.jsx("div",{className:`${C.class||"col-span-full"} `,children:D(C)},C.name+C.type)):c.jsx("div",{children:"Loading..."}),c.jsx("div",{className:n==="sticky"?"absolute col-span-full w-full bottom-0  bg-white py-4 flex justify-end gap-2 z-50":"col-span-full mt-4 flex justify-end gap-2",children:R.Children.map(a,C=>R.isValidElement(C)&&C.props.onClick?R.cloneElement(C,{onClick:P=>{C.props.onClick(d,P)}}):C)})]})};me.DynamicForm=Mi,me.default=Mi,Object.defineProperties(me,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));