@juejin-opensource/jusage 0.1.5 → 0.1.6-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ import{r,j as e,k as l,B as S,bb as F}from"./index-DpG68XJd.js";import{r as E,d as T,a as O,g as $,f as q,D as y,m as K,b as Y,G as Q,L as X,c as ee}from"./downloads-DRt36RTZ.js";import{P as i,C as M,a as v}from"./ChevronDown-raqOGGZY.js";const se=a=>r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:"none",viewBox:"0 0 16 16"},a),r.createElement("path",{fill:"currentColor",fillRule:"evenodd",d:"M12 2.5H8A1.5 1.5 0 0 0 6.5 4v1H8a3 3 0 0 1 3 3v1.5h1A1.5 1.5 0 0 0 13.5 8V4A1.5 1.5 0 0 0 12 2.5M11 11h1a3 3 0 0 0 3-3V4a3 3 0 0 0-3-3H8a3 3 0 0 0-3 3v1H4a3 3 0 0 0-3 3v4a3 3 0 0 0 3 3h4a3 3 0 0 0 3-3zM4 6.5h4A1.5 1.5 0 0 1 9.5 8v4A1.5 1.5 0 0 1 8 13.5H4A1.5 1.5 0 0 1 2.5 12V8A1.5 1.5 0 0 1 4 6.5",clipRule:"evenodd"})),ae={new_user:{badge:"Juejin Usage",headline:["Cursor、Claude、Codex","多工具 Token 与费用","本地面板一张表看完。"],description:"汇总你实际在用的 AI 编码工具用量与趋势,安装后即可查看。"},uninstalled:{badge:"客户端暂未连接",headline:["客户端暂未连接","启动后继续","同步本机用量。"],description:"下载并打开 Juejin Usage,即可把本机 AI 用量同步回这块面板。"}},te="/e1.png",j=[{id:"install-start",label:"npm",command:"npm i -g @juejin-opensource/jusage && jusage service start"},{id:"npx",label:"npx",command:"npx @juejin-opensource/jusage start"}],D="tud.downloadTarget";function H(){try{const a=sessionStorage.getItem(D);if(a&&y.some(o=>o.id===a))return a}catch{}return null}function ne(a){try{sessionStorage.setItem(D,a)}catch{}}function re({reason:a}){const o=ae[a],[m,k]=r.useState(()=>{const s=H();return s||(typeof navigator>"u"?"macos-arm":E(O(navigator.userAgent,navigator.platform),T(navigator.userAgent)))}),[_,L]=r.useState({}),[P,G]=r.useState(),[h,C]=r.useState(!1),[p,A]=r.useState(!1),[z,B]=r.useState("npx"),[d,g]=r.useState(!1),I=r.useRef(H()!==null),u=$(m),U=ee(P),b=j.find(s=>s.id===z)??j[0];r.useEffect(()=>{var c,f;let s=!1;const t=navigator,n=(x,W)=>{var R;s||I.current||k(E(O(t.userAgent,t.platform,W??((R=t.userAgentData)==null?void 0:R.platform)??""),T(t.userAgent,x)))};return n(),(f=(c=t.userAgentData)==null?void 0:c.getHighEntropyValues)==null||f.call(c,["architecture","platform"]).then(x=>{n(x.architecture,x.platform)}).catch(()=>{}),()=>{s=!0}},[]),r.useEffect(()=>{let s=!1;return q().then(t=>{if(s)return;const n={};for(const c of y){const f=K(t.assets,c.id);f&&(n[c.id]=f)}L(n),G(t.source)}).catch(()=>{}),()=>{s=!0}},[]),r.useEffect(()=>{if(!d)return;const s=window.setTimeout(()=>g(!1),1600);return()=>window.clearTimeout(s)},[d]);const Z=s=>{const t=_[s]??U,n=document.createElement("a");n.href=t,n.rel="noopener noreferrer",n.target="_blank",_[s]&&(n.download=""),document.body.append(n),n.click(),n.remove()},J=async()=>{try{await navigator.clipboard.writeText(b.command),g(!0)}catch{g(!1)}};return e.jsx("section",{className:"flex min-h-[calc(100svh-9rem)] items-start pt-4 pb-10 sm:pt-6 sm:pb-14 lg:pt-8",children:e.jsxs("div",{className:"grid w-full items-start gap-10 lg:grid-cols-[minmax(0,1fr)_minmax(0,1.15fr)] lg:gap-16 xl:gap-20",children:[e.jsxs("div",{className:"max-w-2xl motion-safe:animate-[fade-up_420ms_ease-out] lg:max-w-none",children:[e.jsxs("p",{className:"flex flex-wrap items-center gap-x-2 gap-y-1 text-base text-muted",children:[e.jsx("span",{children:o.badge}),e.jsx("span",{"aria-hidden":"true",className:"text-foreground/25",children:"·"}),u.os==="windows"?e.jsx(N,{className:"size-4 text-foreground/70"}):e.jsx(w,{className:"size-4 text-foreground/70"}),e.jsxs("span",{children:["适用于 ",u.badgePlatform]})]}),e.jsxs("h1",{className:"mt-6 text-[2.15rem] leading-[1.15] font-semibold tracking-tight text-foreground sm:text-5xl sm:leading-[1.12] lg:text-[3.15rem] lg:leading-[1.1]",children:[o.headline[0],e.jsx("br",{}),o.headline[1],e.jsx("br",{}),o.headline[2]]}),e.jsx("p",{className:"mt-5 max-w-xl text-lg leading-8 text-muted",children:o.description}),e.jsxs("div",{className:"mt-9 flex flex-col gap-4",children:[e.jsxs("div",{"aria-label":"下载客户端",className:"inline-flex max-w-full shrink-0 overflow-hidden rounded-full shadow-[0_1px_2px_rgb(0_0_0/0.06)]",role:"group",children:[e.jsxs("button",{className:l(V,"rounded-l-full ps-6 pe-5"),type:"button",onClick:()=>Z(m),children:[u.os==="windows"?e.jsx(N,{className:"size-4.5"}):e.jsx(w,{className:"size-4.5"}),u.label]}),e.jsxs(i,{isOpen:h,onOpenChange:C,children:[e.jsx(S,{"aria-expanded":h,"aria-haspopup":"menu","aria-label":"选择其它系统",className:l(V,"h-14! min-h-14! min-w-14 rounded-l-none rounded-r-full border-0 p-0 shadow-none","bg-[#1e80ff]! text-white! hover:bg-[#1171ee]!","relative before:absolute before:inset-y-2.5 before:left-0 before:w-px before:bg-white/30","dark:bg-[#4b9cff]! dark:hover:bg-[#3a8ff0]!"),isIconOnly:!0,variant:"primary",children:e.jsx(M,{"aria-hidden":"true",className:l("size-4.5 transition-transform duration-200 motion-reduce:transition-none",h&&"rotate-180")})}),e.jsx(i.Content,{className:"min-w-56 overflow-hidden rounded-[10px] border-0 bg-overlay p-0 text-overlay-foreground shadow-surface",placement:"bottom start",children:e.jsxs(i.Dialog,{className:"p-0 outline-none",children:[e.jsx(i.Heading,{className:"sr-only",children:"选择下载平台"}),e.jsx("div",{className:"flex flex-col py-1",role:"menu",children:y.map(s=>{const t=s.id===m;return e.jsxs("button",{"aria-current":t?"true":void 0,className:l("flex min-h-11 w-full cursor-pointer items-center gap-2 px-3 text-left text-sm","transition-colors duration-150","hover:bg-surface-secondary","focus-visible:bg-surface-secondary focus-visible:outline-none",t?"text-foreground":"text-foreground/80"),role:"menuitem",type:"button",onClick:()=>{I.current=!0,ne(s.id),k(s.id),C(!1)},children:[s.os==="windows"?e.jsx(N,{className:"size-4 text-foreground/70"}):e.jsx(w,{className:"size-4 text-foreground/70"}),e.jsx("span",{className:"min-w-0 flex-1",children:s.menuLabel}),t?e.jsx(v,{"aria-hidden":"true",className:"size-4 text-[#1e80ff] dark:text-[#4b9cff]"}):null]},s.id)})})]})})]})]}),e.jsxs("div",{className:"flex min-h-14 min-w-0 max-w-2xl items-center gap-2 rounded-2xl border border-border bg-surface-secondary/80 p-2 ps-3 dark:bg-overlay/60",children:[e.jsxs(i,{isOpen:p,onOpenChange:A,children:[e.jsxs(S,{"aria-expanded":p,"aria-haspopup":"menu","aria-label":"选择 CLI 启动方式",className:"h-10 min-h-10 shrink-0 gap-1 rounded-full bg-background/80 px-3 text-xs font-medium text-foreground shadow-none hover:bg-background dark:bg-black/10 dark:hover:bg-black/20",variant:"secondary",children:[e.jsx("span",{children:b.label}),e.jsx(M,{"aria-hidden":"true",className:l("size-3.5 transition-transform duration-200 motion-reduce:transition-none",p&&"rotate-180")})]}),e.jsx(i.Content,{className:"min-w-60 overflow-hidden rounded-[10px] border-0 bg-overlay p-0 text-overlay-foreground shadow-surface",placement:"bottom start",children:e.jsxs(i.Dialog,{className:"p-0 outline-none",children:[e.jsx(i.Heading,{className:"sr-only",children:"选择 CLI 启动方式"}),e.jsx("div",{className:"flex flex-col py-1",role:"menu",children:j.map(s=>{const t=s.id===z;return e.jsxs("button",{"aria-current":t?"true":void 0,className:l("flex min-h-11 w-full cursor-pointer items-center gap-2 px-3 text-left text-sm","transition-colors duration-150 hover:bg-surface-secondary","focus-visible:bg-surface-secondary focus-visible:outline-none",t?"text-foreground":"text-foreground/80"),role:"menuitem",type:"button",onClick:()=>{B(s.id),A(!1)},children:[e.jsx("span",{className:"min-w-0 flex-1",children:s.label}),t?e.jsx(v,{"aria-hidden":"true",className:"size-4 text-[#1e80ff] dark:text-[#4b9cff]"}):null]},s.id)})})]})})]}),e.jsx("div",{className:"min-w-0 flex-1 overflow-hidden rounded-xl bg-background/75 px-3 py-2 dark:bg-black/10",children:e.jsxs("code",{className:"block overflow-x-auto whitespace-nowrap font-mono text-sm text-foreground/85 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:["$ ",b.command]})}),e.jsx("button",{"aria-label":d?"安装命令已复制":"复制 CLI 安装命令",className:l("inline-flex size-11 shrink-0 items-center justify-center rounded-full","text-muted transition-colors duration-150","hover:bg-background hover:text-foreground","focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-accent","touch-manipulation"),type:"button",onClick:()=>{J()},children:d?e.jsx(v,{"aria-hidden":"true",className:"size-4 text-[#1e80ff] dark:text-[#4b9cff]"}):e.jsx(se,{"aria-hidden":"true",className:"size-4"})})]})]}),e.jsx("p",{"aria-live":"polite",className:"sr-only",children:d?"安装命令已复制":""}),e.jsxs("p",{className:"mt-5 flex flex-wrap items-center gap-x-2 gap-y-1 text-sm text-muted",children:[e.jsxs("span",{className:"inline-flex items-center gap-2",children:[e.jsx("a",{"aria-label":"前往 Gitee 仓库",className:"inline-flex size-8 items-center justify-center rounded-full text-foreground/70 transition-colors hover:bg-surface-secondary hover:text-foreground focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-accent",href:Y,rel:"noopener noreferrer",target:"_blank",children:e.jsx(oe,{className:"size-4.5"})}),e.jsx("a",{"aria-label":"前往 GitHub 仓库",className:"inline-flex size-8 items-center justify-center rounded-full text-foreground/70 transition-colors hover:bg-surface-secondary hover:text-foreground focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-accent",href:Q,rel:"noopener noreferrer",target:"_blank",children:e.jsx(X,{"aria-hidden":"true",className:"size-4.5"})})]}),e.jsx("span",{"aria-hidden":"true",children:"·"}),e.jsx("span",{children:u.requirement}),e.jsx("span",{"aria-hidden":"true",children:"·"}),e.jsx("span",{children:"CLI 需 Node.js 20+"})]})]}),e.jsx("div",{className:"min-w-0 motion-safe:animate-[fade-up_520ms_ease-out]",children:e.jsx("figure",{className:"overflow-hidden rounded-2xl border border-border/80 bg-surface shadow-[0_24px_48px_-28px_rgb(15_23_42/0.45)] dark:shadow-[0_24px_48px_-24px_rgb(0_0_0/0.65)]",children:e.jsx("img",{alt:"Juejin Usage 用量看板界面预览:费用、Token、热力图与趋势图",className:"h-auto w-full",decoding:"async",fetchPriority:"high",height:1560,src:te,width:2102})})})]})})}const V=l("inline-flex h-14 min-h-14 cursor-pointer items-center justify-center gap-2.5","bg-[#1e80ff] text-base font-medium whitespace-nowrap text-white","transition-colors duration-200 motion-reduce:transition-none","hover:bg-[#1171ee] active:brightness-[0.96]","focus-visible:z-10 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[#1e80ff]","dark:bg-[#4b9cff] dark:hover:bg-[#3a8ff0] dark:focus-visible:outline-[#4b9cff]","touch-manipulation");function w({className:a}){return e.jsx("svg",{"aria-hidden":"true",className:a,fill:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{d:"M12.152 6.896c-.948 0-2.415-1.078-3.96-1.04-2.04.027-3.91 1.183-4.961 3.014-2.117 3.675-.546 9.103 1.519 12.09 1.013 1.454 2.208 3.09 3.792 3.039 1.52-.065 2.09-.987 3.935-.987 1.831 0 2.35.987 3.96.948 1.637-.026 2.676-1.48 3.676-2.948 1.156-1.688 1.636-3.325 1.662-3.415-.039-.013-3.182-1.221-3.22-4.857-.026-3.04 2.48-4.494 2.597-4.559-1.429-2.09-3.623-2.324-4.39-2.376-2-.156-3.675 1.09-4.61 1.09zM15.53 3.83c.843-1.012 1.4-2.427 1.245-3.83-1.207.052-2.662.805-3.532 1.818-.78.896-1.454 2.338-1.273 3.714 1.338.104 2.715-.688 3.559-1.701"})})}function oe({className:a}){return e.jsx("svg",{"aria-hidden":"true",className:a,fill:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{d:"M11.984 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0a12 12 0 0 0-.016 0zm6.09 5.333c.328 0 .593.266.592.593v1.482a.594.594 0 0 1-.593.592H9.777c-.982 0-1.778.796-1.778 1.778v5.63c0 .327.266.592.593.592h5.63c.982 0 1.778-.796 1.778-1.778v-.296a.593.593 0 0 0-.592-.593h-4.15a.592.592 0 0 1-.592-.592v-1.482a.593.593 0 0 1 .593-.592h6.815c.327 0 .593.265.593.592v3.408a4 4 0 0 1-4 4H5.926a.593.593 0 0 1-.593-.593V9.778a4.444 4.444 0 0 1 4.445-4.444h8.296z"})})}function N({className:a}){return e.jsx("svg",{"aria-hidden":"true",className:a,fill:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{d:"M3 5.2 11.2 4v7.4H3V5.2Zm8.9-1.4L21 2.6v8.8h-9.1V3.8ZM3 13.4h8.2V21L3 19.7v-6.3Zm8.9 0H21V21.4l-9.1-1.3v-6.7Z"})})}function de(){const a=F(),o=(a==null?void 0:a.reason)==="uninstalled"?"uninstalled":"new_user";return e.jsx(re,{reason:o})}export{de as component};
@@ -0,0 +1 @@
1
+ import{r as u}from"./index-DpG68XJd.js";const T=e=>u.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:"none",viewBox:"0 0 16 16"},e),u.createElement("path",{fill:"currentColor",fillRule:"evenodd",d:"M10.418 2.489c.9-1.196 2.382-1.724 3.154-1.391.852.367 1.539 2.08 1.054 3.702a4 4 0 0 1-2.616 5.559c.309.471.49 1.035.49 1.641v2.25a.75.75 0 0 1-1.5 0V12a1.5 1.5 0 0 0-3 0v2.25a.75.75 0 0 1-1.5 0v-.75h-.876a2.626 2.626 0 0 1-2.625-2.625c0-.621-.504-1.125-1.125-1.125h-.125a.75.75 0 0 1 0-1.5h.125a2.625 2.625 0 0 1 2.625 2.625c0 .621.504 1.125 1.125 1.125H6.5c0-.606.18-1.17.488-1.641A4 4 0 0 1 4.373 4.8c-.484-1.623.202-3.335 1.054-3.702.772-.333 2.254.195 3.155 1.39zm2.549.02a1.4 1.4 0 0 0-.35.098 2.5 2.5 0 0 0-1 .784l-.451.598H7.834l-.45-.598a2.5 2.5 0 0 0-1.001-.784 1.4 1.4 0 0 0-.352-.099c-.063.088-.14.231-.204.429a2.5 2.5 0 0 0-.016 1.434l.163.546-.242.517c-.13.279-.21.586-.228.913l-.004.142a2.5 2.5 0 0 0 2.5 2.5h3a2.5 2.5 0 0 0 2.267-3.555l-.242-.517.163-.547a2.5 2.5 0 0 0-.016-1.433 1.6 1.6 0 0 0-.205-.429",clipRule:"evenodd"})),f="https://gitee.com/juejin-cn/juejin-usage",p=`${f}/releases`,h="https://gitee.com/api/v5/repos/juejin-cn/juejin-usage/releases?per_page=8",b="https://github.com/juejin-cn/juejin-usage",g=`${b}/releases`,E="https://api.github.com/repos/juejin-cn/juejin-usage/releases?per_page=8",_=8e3,d=[{id:"macos-arm",os:"macos",label:"下载 macOS",menuLabel:"macOS(Apple Silicon)",badgePlatform:"macOS",requirement:"macOS 14+"},{id:"macos-intel",os:"macos",label:"下载 macOS(Intel)",menuLabel:"macOS(Intel)",badgePlatform:"macOS",requirement:"macOS 14+"},{id:"windows",os:"windows",label:"下载 Windows",menuLabel:"Windows",badgePlatform:"Windows",requirement:"Windows 10+"}],R=new Map(d.map(e=>[e.id,e]));function O(e){return R.get(e)??d[0]}function $(e,n="",t=""){const s=`${t} ${n} ${e}`.toLowerCase();return/\bwin(?:dows|32|64|ce)?\b/.test(s)||s.includes("windows")?"windows":s.includes("mac")||s.includes("darwin")||s.includes("iphone")||s.includes("ipad")||s.includes("ipod")?"macos":"other"}function I(e,n=""){const t=n.toLowerCase();return t.includes("arm")?"arm":t.includes("x86")||t.includes("x64")||t.includes("amd64")||/\bintel\b/i.test(e)?"x64":"unknown"}function x(e,n="unknown"){return e==="windows"?"windows":e==="macos"&&n==="x64"?"macos-intel":"macos-arm"}function S(e){return e.find(n=>!n.draft)??null}function w(e){return!/\.(blockmap|yml|yaml|zip|tar\.gz)$/i.test(e)}function c(e){return e.some(n=>w(n.name)&&/\.(dmg|exe)$/i.test(n.name))}function v(e,n){var s,r,l,o;const t=e.filter(a=>w(a.name));if(n==="windows"){const a=t.find(i=>/\.exe$/i.test(i.name)&&/setup/i.test(i.name)&&!/portable/i.test(i.name));return a?a.browser_download_url:((s=t.find(i=>/\.exe$/i.test(i.name)&&!/portable/i.test(i.name)))==null?void 0:s.browser_download_url)??null}return n==="macos-arm"?((r=t.find(a=>/arm64\.dmg$/i.test(a.name)))==null?void 0:r.browser_download_url)??null:((l=t.find(a=>/x64\.dmg$/i.test(a.name)))==null?void 0:l.browser_download_url)??((o=t.find(a=>/\.dmg$/i.test(a.name)&&!/arm64/i.test(a.name)))==null?void 0:o.browser_download_url)??null}function k(e){return e==="github"?g:p}function j(e,n){return{source:e,tagName:n.tag_name,assets:n.assets??[]}}function A(e,n){if(e&&c(e.assets))return e;if(n&&c(n.assets))return n;throw new Error("No published desktop release")}async function m(e,n){const t=new AbortController,s=setTimeout(()=>t.abort(),_);try{const r=await fetch(e,{headers:{Accept:n==="github"?"application/vnd.github+json":"application/json"},signal:t.signal});if(!r.ok)throw new Error(`${n} releases ${r.status}`);const l=await r.json(),o=S(l);if(!o)throw new Error(`No published ${n} release`);return j(n,o)}finally{clearTimeout(s)}}async function G(){let e=null;try{e=await m(h,"gitee")}catch{e=null}if(e&&c(e.assets))return e;const n=await m(E,"github");return A(e,n)}export{d as D,b as G,T as L,$ as a,f as b,k as c,I as d,G as f,O as g,v as m,x as r};
@@ -1 +1 @@
1
- import{t as k,R as u,j as c,b4 as O,a9 as N,r as o,bE as ie,y as G,Z as ce,_ as de,aE as fe,aX as ue,bF as be,a1 as $e,F as _,L as I,G as B,H as C,a2 as Z,a4 as pe,a6 as he,E as me,z as F,bG as xe,a7 as V,bH as ve,bI as ge,aT as we,bJ as Pe,ac as Ce,J as Q,bK as ye,au as Re,bL as Te,bM as Ee,bN as Se,bO as Oe,bP as Ne,bQ as je,bp as De,T as R}from"./index-DS0F5-Qw.js";import{u as z}from"./index-D_BPUazE.js";const Ie=k({defaultVariants:{color:"default",variant:"secondary"},slots:{base:"chip",label:"chip__label"},variants:{color:{accent:{base:"chip--accent"},danger:{base:"chip--danger"},default:{base:"chip--default"},success:{base:"chip--success"},warning:{base:"chip--warning"}},size:{lg:{base:"chip--lg"},md:{base:"chip--md"},sm:{base:"chip--sm"}},variant:{primary:{base:"chip--primary"},secondary:{base:"chip--secondary"},soft:{base:"chip--soft"},tertiary:{base:"chip--tertiary"}}}}),Me=k({defaultVariants:{size:"md"},slots:{base:"switch",content:"switch__content",control:"switch__control",icon:"switch__icon",thumb:"switch__thumb"},variants:{size:{lg:{base:"switch--lg"},md:{base:"switch--md"},sm:{base:"switch--sm"}}}}),Ae=k({slots:{base:"tooltip",trigger:"tooltip__trigger"}}),X=o.createContext({}),U=({children:e,className:t,color:a,size:n,variant:r,...s})=>{const l=u.useMemo(()=>Ie({color:a,size:n,variant:r}),[a,n,r]),f=u.useMemo(()=>typeof e=="string"||typeof e=="number"?c.jsx(Y,{children:e}):e,[e]);return c.jsx(X,{value:{slots:l},children:c.jsx(O.span,{...s,className:N(l.base,t),"data-slot":"chip",children:f})})},Y=({children:e,className:t,...a})=>{const{slots:n}=o.use(X);return c.jsx(O.span,{className:N(n==null?void 0:n.label,t),"data-slot":"chip-label",...a,children:e})},st=Object.assign(U,{Root:U,Label:Y});function He(e,t,a){let{labelProps:n,inputProps:r,isSelected:s,...l}=ie(e,t,a);return{labelProps:n,inputProps:{...r,role:"switch",checked:s},isSelected:s,...l}}const ke=o.createContext(null),ee=o.createContext(null),te=o.createContext(null),_e=o.forwardRef(function(t,a){let{inputRef:n=null,...r}=t;[t,a]=G(r,a,ke);let{validationBehavior:s}=ce(de)||{},l=t.validationBehavior??s??"native",f=fe(ue(n,t.inputRef!==void 0?t.inputRef:null)),i=be(t),d=He({...$e(t),children:typeof t.children=="function"?!0:t.children,validationBehavior:l},i,f),{descriptionProps:$,errorMessageProps:h,isSelected:m,isDisabled:p,isReadOnly:x,isInvalid:w,validationDetails:b,validationErrors:y}=d,v=_({...t,defaultClassName:"react-aria-SwitchField",values:{isSelected:m,isDisabled:p,isReadOnly:x,isInvalid:w,isRequired:t.isRequired||!1,state:i}}),P=I(t,{global:!0});return delete P.id,delete P.onClick,u.createElement(B.div,{...C(P,v),ref:a,slot:t.slot||void 0,"data-selected":m||void 0,"data-disabled":p||void 0,"data-readonly":x||void 0,"data-invalid":w||void 0,"data-required":t.isRequired||void 0},u.createElement(Z,{values:[[ee,i],[te,{...d,inputRef:f,defaultClassName:"react-aria-SwitchButton",isRequired:t.isRequired}],[pe,{slots:{description:$,errorMessage:h}}],[he,{isInvalid:w,validationDetails:b,validationErrors:y}]]},v.children))}),Be=o.forwardRef(function(t,a){let{labelProps:n,inputProps:r,isSelected:s,isDisabled:l,isReadOnly:f,isPressed:i,isInvalid:d,inputRef:$,defaultClassName:h,isRequired:m}=o.useContext(te),{isFocused:p,isFocusVisible:x,focusProps:w}=me(),b=l||f,y=o.useContext(ee),{hoverProps:v,isHovered:P}=F({...t,isDisabled:b}),q=_({...t,defaultClassName:h,values:{isSelected:s,isPressed:i,isHovered:P,isFocused:p,isFocusVisible:x,isDisabled:l,isReadOnly:f,isInvalid:d,isRequired:m||!1,state:y}}),M=I(t,{global:!0});return delete M.id,delete M.onClick,u.createElement(B.label,{...C(M,n,v,q),ref:a,slot:t.slot||void 0,"data-selected":s||void 0,"data-pressed":i||void 0,"data-hovered":P||void 0,"data-focused":p||void 0,"data-focus-visible":x||void 0,"data-disabled":l||void 0,"data-readonly":f||void 0,"data-invalid":d||void 0,"data-required":m||void 0},u.createElement(xe,{elementType:"span"},u.createElement("input",{...C(r,w),ref:$})),q.children)}),D=o.createContext({}),A=({children:e,className:t,size:a,...n})=>{const r=u.useMemo(()=>Me({size:a}),[a]);return c.jsx(_e,{"data-slot":"switch",...n,className:V(t,r.base()),children:s=>c.jsx(D,{value:{slots:r,state:s},children:typeof e=="function"?e(s):e})})};A.displayName="HeroUI.Switch";const ae=({children:e,className:t,...a})=>{const{slots:n}=o.use(D);return c.jsx(Be,{"data-slot":"switch-content",...a,className:V(t,n==null?void 0:n.content()),children:e})};ae.displayName="HeroUI.Switch.Content";const ne=({children:e,className:t,...a})=>{const{slots:n}=o.use(D);return c.jsx(O.span,{className:N(n==null?void 0:n.control,t),"data-slot":"switch-control",...a,children:e})};ne.displayName="HeroUI.Switch.Control";const oe=({children:e,className:t,...a})=>{const{slots:n}=o.use(D);return c.jsx(O.span,{className:N(n==null?void 0:n.thumb,t),"data-slot":"switch-thumb",...a,children:e})};oe.displayName="HeroUI.Switch.Thumb";const re=({children:e,className:t,...a})=>{const{slots:n}=o.use(D);return c.jsx(O.span,{className:N(n==null?void 0:n.icon,t),"data-slot":"switch-icon",...a,children:e})};re.displayName="HeroUI.Switch.Icon";const lt=Object.assign(A,{Root:A,Content:ae,Control:ne,Thumb:oe,Icon:re}),H=u.createContext(null);function Fe(e){let{children:t}=e,a=o.useContext(H),[n,r]=o.useState(0),s=o.useMemo(()=>({parent:a,modalCount:n,addModal(){r(l=>l+1),a&&a.addModal()},removeModal(){r(l=>l-1),a&&a.removeModal()}}),[a,n]);return u.createElement(H.Provider,{value:s},t)}function Ve(){let e=o.useContext(H);return{modalProviderProps:{"aria-hidden":e&&e.modalCount>0?!0:void 0}}}function Le(e){let{modalProviderProps:t}=Ve();return u.createElement("div",{"data-overlay-container":!0,...e,...t})}function qe(e){return u.createElement(Fe,null,u.createElement(Le,e))}function ze(e){let t=ve(),{portalContainer:a=t?null:document.body,...n}=e,{getContainer:r}=ge();if(!e.portalContainer&&r&&(a=r()),u.useEffect(()=>{if(a!=null&&a.closest("[data-overlay-container]"))throw new Error("An OverlayContainer must not be inside another container. Please change the portalContainer prop.")},[a]),!a)return null;let s=u.createElement(qe,n);return we.createPortal(s,a)}const Ue=1500,W=500;let T={},We=0,S=!1,g=null,E=null;function se(e={}){let{delay:t=Ue,closeDelay:a=W}=e,{isOpen:n,open:r,close:s}=Pe(e),[l,f]=o.useState(!1),i=o.useMemo(()=>`${++We}`,[]),d=o.useRef(null),$=o.useRef(s),h=()=>{T[i]=x},m=()=>{for(let b in T)b!==i&&(T[b](!0,!0),delete T[b])},p=b=>{d.current&&clearTimeout(d.current),d.current=null,m(),h(),f(!!b),S=!0,r(),g&&(clearTimeout(g),g=null),E&&(clearTimeout(E),E=null)},x=(b,y)=>{f(!!y),b||a<=0?(d.current&&clearTimeout(d.current),d.current=null,$.current()):d.current||(d.current=setTimeout(()=>{d.current=null,$.current()},a)),g&&(clearTimeout(g),g=null),S&&(E&&clearTimeout(E),E=setTimeout(()=>{delete T[i],E=null,S=!1},Math.max(W,a)))},w=()=>{m(),h(),!n&&!S?(g&&clearTimeout(g),g=setTimeout(()=>{g=null,S=!0,p(!1)},t)):n||p(!0)};return o.useEffect(()=>{$.current=s},[s]),o.useEffect(()=>()=>{d.current&&clearTimeout(d.current),T[i]&&delete T[i]},[i]),{isOpen:n,shouldSkipAnimation:l,open:b=>{!b&&t>0&&!d.current?w():p(S)},close:x}}function Ke(e,t){let a=I(e,{labelable:!0}),{hoverProps:n}=F({onHoverStart:()=>t==null?void 0:t.open(!0),onHoverEnd:()=>t==null?void 0:t.close()});return{tooltipProps:C(a,n,{role:"tooltip"})}}function Je(e,t,a){let{isDisabled:n,trigger:r,shouldCloseOnPress:s=!0}=e,l=Ce(),f=o.useRef(!1),i=o.useRef(!1),d=()=>{(f.current||i.current)&&t.open(i.current)},$=v=>{!f.current&&!i.current&&t.close(v)};o.useEffect(()=>{let v=P=>{a&&a.current&&P.key==="Escape"&&(P.stopPropagation(),t.close(!0))};if(t.isOpen)return document.addEventListener("keydown",v,!0),()=>{document.removeEventListener("keydown",v,!0)}},[a,t]);let h=()=>{r!=="focus"&&(ye()==="pointer"?f.current=!0:f.current=!1,d())},m=()=>{r!=="focus"&&(i.current=!1,f.current=!1,$())},p=()=>{s&&(i.current=!1,f.current=!1,$(!0))},x=()=>{Re()&&(i.current=!0,d())},w=()=>{i.current=!1,f.current=!1,$(!0)},{hoverProps:b}=F({isDisabled:n,onHoverStart:h,onHoverEnd:m}),{focusableProps:y}=Q({isDisabled:n,onFocus:x,onBlur:w},a);return{triggerProps:{"aria-describedby":t.isOpen?l:void 0,...C(y,b,{onPointerDown:p,onKeyDown:p}),tabIndex:void 0},tooltipProps:{id:l}}}const j=o.createContext(null),le=o.createContext(null);function Ge(e){let t=se(e),a=o.useRef(null),{triggerProps:n,tooltipProps:r}=Je(e,t,a);return u.createElement(Z,{values:[[j,t],[le,{...r,triggerRef:a}]]},u.createElement(Te,{...n,ref:a},e.children))}const Ze=o.forwardRef(function({UNSTABLE_portalContainer:t,...a},n){[a,n]=G(a,n,le);let r=o.useContext(j),s=se(a),l=a.isOpen!=null||a.defaultOpen!=null||!r?s:r,f=Ee(n,l.isOpen),i=a.isExiting||!l.shouldSkipAnimation&&f||!1;return!l.isOpen&&!i?null:u.createElement(ze,{portalContainer:t},u.createElement(Qe,{...a,tooltipRef:n,isExiting:i}))});function Qe(e){let t=o.useContext(j),a=o.useRef(null),{overlayProps:n,arrowProps:r,placement:s,triggerAnchorPoint:l}=Se({placement:e.placement||"top",targetRef:e.triggerRef,overlayRef:e.tooltipRef,arrowRef:a,offset:e.offset,crossOffset:e.crossOffset,isOpen:t.isOpen,arrowBoundaryOffset:e.arrowBoundaryOffset,shouldFlip:e.shouldFlip,containerPadding:e.containerPadding,onClose:()=>t.close(!0)}),f=Oe(e.tooltipRef,!!s),i=e.isEntering||!t.shouldSkipAnimation&&f||!1,d=_({...e,defaultClassName:"react-aria-Tooltip",values:{placement:s,isEntering:i,isExiting:e.isExiting,state:t}});e=C(e,n);let{tooltipProps:$}=Ke(e,t),h=I(e,{global:!0});return u.createElement(B.div,{...C(h,d,$),ref:e.tooltipRef,style:{...n.style,"--trigger-anchor-point":l?`${l.x}px ${l.y}px`:void 0,...d.style},"data-placement":s??void 0,"data-entering":i||void 0,"data-exiting":e.isExiting||void 0},u.createElement(Ne.Provider,{value:{...r,placement:s,ref:a}},d.children))}const K=e=>{if(!e)return;const t=e.trim(),a=parseFloat(t);if(!Number.isNaN(a))return t.endsWith("ms")?a:t.endsWith("s")?a*1e3:a},L=o.createContext({}),Xe=({children:e,shouldSkipAnimation:t})=>{const a=o.use(j);return!a||t?e:c.jsx(j,{value:{...a,shouldSkipAnimation:!1},children:e})},J=({children:e,closeDelay:t,delay:a,shouldSkipAnimation:n=!1,...r})=>{const s=u.useMemo(()=>Ae(),[]),l=z("--tooltip-delay"),f=z("--tooltip-close-delay"),i=a??K(l),d=t??K(f);return c.jsx(L,{value:{slots:s},children:c.jsx(Ge,{closeDelay:d,"data-slot":"tooltip-root",delay:i,...r,children:c.jsx(Xe,{shouldSkipAnimation:n,children:e})})})},Ye=({children:e,className:t,offset:a,showArrow:n=!1,...r})=>{const{slots:s}=o.use(L),l=a||(n?7:3);return c.jsx(Ze,{...r,className:V(t,s==null?void 0:s.base()),offset:l,children:e})},et=({children:e,className:t,...a})=>{const n=c.jsx("svg",{"data-slot":"overlay-arrow",fill:"none",height:"12",viewBox:"0 0 12 12",width:"12",xmlns:"http://www.w3.org/2000/svg",children:c.jsx("path",{d:"M0 0C5.48483 8 6.5 8 12 0Z"})}),r=u.isValidElement(e)?u.cloneElement(e,{"data-slot":"overlay-arrow"}):n;return c.jsx(je,{"data-slot":"tooltip-arrow",...a,className:t,children:r})},tt=({children:e,className:t,...a})=>{const{slots:n}=o.use(L),r=o.useRef(null),{focusableProps:s}=Q({},r);return c.jsx(O.div,{ref:r,className:N(n==null?void 0:n.trigger,t),"data-slot":"tooltip-trigger",role:"button",...C(s,a),children:e})},it=Object.assign(J,{Root:J,Trigger:tt,Content:Ye,Arrow:et}),at=e=>o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:"none",viewBox:"0 0 16 16"},e),o.createElement("path",{fill:"currentColor",fillRule:"evenodd",d:"M8 13.5a5.5 5.5 0 0 0 2.263-10.514 5.5 5.5 0 0 1-7.278 7.278A5.5 5.5 0 0 0 8 13.5M1.045 8.795a7.001 7.001 0 1 0 7.75-7.75l-.028-.003A7 7 0 0 0 8 1c-.527 0-.59.842-.185 1.18a4 4 0 0 1 .342.322A4 4 0 1 1 2.18 7.814C1.842 7.41 1 7.474 1 8a7 7 0 0 0 .045.794",clipRule:"evenodd"})),nt=e=>o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:"none",viewBox:"0 0 16 16"},e),o.createElement("path",{fill:"currentColor",fillRule:"evenodd",d:"M8 3a.75.75 0 0 1-.75-.75V.75a.75.75 0 0 1 1.5 0v1.5A.75.75 0 0 1 8 3m0 7.5a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5M8 12a4 4 0 1 0 0-8 4 4 0 0 0 0 8m-.75 3.25a.75.75 0 0 0 1.5 0v-1.5a.75.75 0 0 0-1.5 0zM13 8a.75.75 0 0 1 .75-.75h1.5a.75.75 0 0 1 0 1.5h-1.5A.75.75 0 0 1 13 8M.75 7.25a.75.75 0 0 0 0 1.5h1.5a.75.75 0 0 0 0-1.5zm10.786-2.786a.75.75 0 0 1 0-1.06l1.06-1.06a.75.75 0 0 1 1.06 1.06l-1.06 1.06a.75.75 0 0 1-1.06 0m-9.193 8.132a.75.75 0 0 0 1.06 1.06l1.062-1.06a.75.75 0 0 0-1.061-1.06zm9.193-1.06a.75.75 0 0 1 1.06 0l1.06 1.06a.75.75 0 0 1-1.06 1.06l-1.06-1.06a.75.75 0 0 1 0-1.06M3.404 2.343a.75.75 0 0 0-1.06 1.06l1.06 1.061a.75.75 0 1 0 1.06-1.06z",clipRule:"evenodd"}));function ct(){const{theme:e,setTheme:t}=De(),a=n=>{const r=n;(r==="light"||r==="dark")&&t(r)};return c.jsx(R,{className:"w-fit shrink-0 text-center",selectedKey:e,onSelectionChange:n=>a(String(n)),children:c.jsx(R.ListContainer,{children:c.jsxs(R.List,{"aria-label":"页面主题",className:"w-fit",children:[c.jsxs(R.Tab,{"aria-label":"使用亮色模式",className:"h-6 w-6 px-0 text-xs data-[selected=true]:text-accent-foreground",id:"light",children:[c.jsx(nt,{className:"size-3.5"}),c.jsx(R.Indicator,{className:"bg-accent"})]}),c.jsxs(R.Tab,{"aria-label":"使用暗色模式",className:"h-6 w-6 px-0 text-xs data-[selected=true]:text-accent-foreground",id:"dark",children:[c.jsx(at,{className:"size-3.5"}),c.jsx(R.Indicator,{className:"bg-accent"})]})]})})})}function dt(){return!1}export{st as C,lt as S,it as T,ct as a,dt as i};
1
+ import{t as k,R as u,j as c,b4 as O,a9 as N,r as o,bE as ie,y as G,Z as ce,_ as de,aE as fe,aX as ue,bF as be,a1 as $e,F as _,L as I,G as B,H as C,a2 as Z,a4 as pe,a6 as he,E as me,z as F,bG as xe,a7 as V,bH as ve,bI as ge,aT as we,bJ as Pe,ac as Ce,J as Q,bK as ye,au as Re,bL as Te,bM as Ee,bN as Se,bO as Oe,bP as Ne,bQ as je,bp as De,T as R}from"./index-DpG68XJd.js";import{u as z}from"./index-C28OANM4.js";const Ie=k({defaultVariants:{color:"default",variant:"secondary"},slots:{base:"chip",label:"chip__label"},variants:{color:{accent:{base:"chip--accent"},danger:{base:"chip--danger"},default:{base:"chip--default"},success:{base:"chip--success"},warning:{base:"chip--warning"}},size:{lg:{base:"chip--lg"},md:{base:"chip--md"},sm:{base:"chip--sm"}},variant:{primary:{base:"chip--primary"},secondary:{base:"chip--secondary"},soft:{base:"chip--soft"},tertiary:{base:"chip--tertiary"}}}}),Me=k({defaultVariants:{size:"md"},slots:{base:"switch",content:"switch__content",control:"switch__control",icon:"switch__icon",thumb:"switch__thumb"},variants:{size:{lg:{base:"switch--lg"},md:{base:"switch--md"},sm:{base:"switch--sm"}}}}),Ae=k({slots:{base:"tooltip",trigger:"tooltip__trigger"}}),X=o.createContext({}),U=({children:e,className:t,color:a,size:n,variant:r,...s})=>{const l=u.useMemo(()=>Ie({color:a,size:n,variant:r}),[a,n,r]),f=u.useMemo(()=>typeof e=="string"||typeof e=="number"?c.jsx(Y,{children:e}):e,[e]);return c.jsx(X,{value:{slots:l},children:c.jsx(O.span,{...s,className:N(l.base,t),"data-slot":"chip",children:f})})},Y=({children:e,className:t,...a})=>{const{slots:n}=o.use(X);return c.jsx(O.span,{className:N(n==null?void 0:n.label,t),"data-slot":"chip-label",...a,children:e})},st=Object.assign(U,{Root:U,Label:Y});function He(e,t,a){let{labelProps:n,inputProps:r,isSelected:s,...l}=ie(e,t,a);return{labelProps:n,inputProps:{...r,role:"switch",checked:s},isSelected:s,...l}}const ke=o.createContext(null),ee=o.createContext(null),te=o.createContext(null),_e=o.forwardRef(function(t,a){let{inputRef:n=null,...r}=t;[t,a]=G(r,a,ke);let{validationBehavior:s}=ce(de)||{},l=t.validationBehavior??s??"native",f=fe(ue(n,t.inputRef!==void 0?t.inputRef:null)),i=be(t),d=He({...$e(t),children:typeof t.children=="function"?!0:t.children,validationBehavior:l},i,f),{descriptionProps:$,errorMessageProps:h,isSelected:m,isDisabled:p,isReadOnly:x,isInvalid:w,validationDetails:b,validationErrors:y}=d,v=_({...t,defaultClassName:"react-aria-SwitchField",values:{isSelected:m,isDisabled:p,isReadOnly:x,isInvalid:w,isRequired:t.isRequired||!1,state:i}}),P=I(t,{global:!0});return delete P.id,delete P.onClick,u.createElement(B.div,{...C(P,v),ref:a,slot:t.slot||void 0,"data-selected":m||void 0,"data-disabled":p||void 0,"data-readonly":x||void 0,"data-invalid":w||void 0,"data-required":t.isRequired||void 0},u.createElement(Z,{values:[[ee,i],[te,{...d,inputRef:f,defaultClassName:"react-aria-SwitchButton",isRequired:t.isRequired}],[pe,{slots:{description:$,errorMessage:h}}],[he,{isInvalid:w,validationDetails:b,validationErrors:y}]]},v.children))}),Be=o.forwardRef(function(t,a){let{labelProps:n,inputProps:r,isSelected:s,isDisabled:l,isReadOnly:f,isPressed:i,isInvalid:d,inputRef:$,defaultClassName:h,isRequired:m}=o.useContext(te),{isFocused:p,isFocusVisible:x,focusProps:w}=me(),b=l||f,y=o.useContext(ee),{hoverProps:v,isHovered:P}=F({...t,isDisabled:b}),q=_({...t,defaultClassName:h,values:{isSelected:s,isPressed:i,isHovered:P,isFocused:p,isFocusVisible:x,isDisabled:l,isReadOnly:f,isInvalid:d,isRequired:m||!1,state:y}}),M=I(t,{global:!0});return delete M.id,delete M.onClick,u.createElement(B.label,{...C(M,n,v,q),ref:a,slot:t.slot||void 0,"data-selected":s||void 0,"data-pressed":i||void 0,"data-hovered":P||void 0,"data-focused":p||void 0,"data-focus-visible":x||void 0,"data-disabled":l||void 0,"data-readonly":f||void 0,"data-invalid":d||void 0,"data-required":m||void 0},u.createElement(xe,{elementType:"span"},u.createElement("input",{...C(r,w),ref:$})),q.children)}),D=o.createContext({}),A=({children:e,className:t,size:a,...n})=>{const r=u.useMemo(()=>Me({size:a}),[a]);return c.jsx(_e,{"data-slot":"switch",...n,className:V(t,r.base()),children:s=>c.jsx(D,{value:{slots:r,state:s},children:typeof e=="function"?e(s):e})})};A.displayName="HeroUI.Switch";const ae=({children:e,className:t,...a})=>{const{slots:n}=o.use(D);return c.jsx(Be,{"data-slot":"switch-content",...a,className:V(t,n==null?void 0:n.content()),children:e})};ae.displayName="HeroUI.Switch.Content";const ne=({children:e,className:t,...a})=>{const{slots:n}=o.use(D);return c.jsx(O.span,{className:N(n==null?void 0:n.control,t),"data-slot":"switch-control",...a,children:e})};ne.displayName="HeroUI.Switch.Control";const oe=({children:e,className:t,...a})=>{const{slots:n}=o.use(D);return c.jsx(O.span,{className:N(n==null?void 0:n.thumb,t),"data-slot":"switch-thumb",...a,children:e})};oe.displayName="HeroUI.Switch.Thumb";const re=({children:e,className:t,...a})=>{const{slots:n}=o.use(D);return c.jsx(O.span,{className:N(n==null?void 0:n.icon,t),"data-slot":"switch-icon",...a,children:e})};re.displayName="HeroUI.Switch.Icon";const lt=Object.assign(A,{Root:A,Content:ae,Control:ne,Thumb:oe,Icon:re}),H=u.createContext(null);function Fe(e){let{children:t}=e,a=o.useContext(H),[n,r]=o.useState(0),s=o.useMemo(()=>({parent:a,modalCount:n,addModal(){r(l=>l+1),a&&a.addModal()},removeModal(){r(l=>l-1),a&&a.removeModal()}}),[a,n]);return u.createElement(H.Provider,{value:s},t)}function Ve(){let e=o.useContext(H);return{modalProviderProps:{"aria-hidden":e&&e.modalCount>0?!0:void 0}}}function Le(e){let{modalProviderProps:t}=Ve();return u.createElement("div",{"data-overlay-container":!0,...e,...t})}function qe(e){return u.createElement(Fe,null,u.createElement(Le,e))}function ze(e){let t=ve(),{portalContainer:a=t?null:document.body,...n}=e,{getContainer:r}=ge();if(!e.portalContainer&&r&&(a=r()),u.useEffect(()=>{if(a!=null&&a.closest("[data-overlay-container]"))throw new Error("An OverlayContainer must not be inside another container. Please change the portalContainer prop.")},[a]),!a)return null;let s=u.createElement(qe,n);return we.createPortal(s,a)}const Ue=1500,W=500;let T={},We=0,S=!1,g=null,E=null;function se(e={}){let{delay:t=Ue,closeDelay:a=W}=e,{isOpen:n,open:r,close:s}=Pe(e),[l,f]=o.useState(!1),i=o.useMemo(()=>`${++We}`,[]),d=o.useRef(null),$=o.useRef(s),h=()=>{T[i]=x},m=()=>{for(let b in T)b!==i&&(T[b](!0,!0),delete T[b])},p=b=>{d.current&&clearTimeout(d.current),d.current=null,m(),h(),f(!!b),S=!0,r(),g&&(clearTimeout(g),g=null),E&&(clearTimeout(E),E=null)},x=(b,y)=>{f(!!y),b||a<=0?(d.current&&clearTimeout(d.current),d.current=null,$.current()):d.current||(d.current=setTimeout(()=>{d.current=null,$.current()},a)),g&&(clearTimeout(g),g=null),S&&(E&&clearTimeout(E),E=setTimeout(()=>{delete T[i],E=null,S=!1},Math.max(W,a)))},w=()=>{m(),h(),!n&&!S?(g&&clearTimeout(g),g=setTimeout(()=>{g=null,S=!0,p(!1)},t)):n||p(!0)};return o.useEffect(()=>{$.current=s},[s]),o.useEffect(()=>()=>{d.current&&clearTimeout(d.current),T[i]&&delete T[i]},[i]),{isOpen:n,shouldSkipAnimation:l,open:b=>{!b&&t>0&&!d.current?w():p(S)},close:x}}function Ke(e,t){let a=I(e,{labelable:!0}),{hoverProps:n}=F({onHoverStart:()=>t==null?void 0:t.open(!0),onHoverEnd:()=>t==null?void 0:t.close()});return{tooltipProps:C(a,n,{role:"tooltip"})}}function Je(e,t,a){let{isDisabled:n,trigger:r,shouldCloseOnPress:s=!0}=e,l=Ce(),f=o.useRef(!1),i=o.useRef(!1),d=()=>{(f.current||i.current)&&t.open(i.current)},$=v=>{!f.current&&!i.current&&t.close(v)};o.useEffect(()=>{let v=P=>{a&&a.current&&P.key==="Escape"&&(P.stopPropagation(),t.close(!0))};if(t.isOpen)return document.addEventListener("keydown",v,!0),()=>{document.removeEventListener("keydown",v,!0)}},[a,t]);let h=()=>{r!=="focus"&&(ye()==="pointer"?f.current=!0:f.current=!1,d())},m=()=>{r!=="focus"&&(i.current=!1,f.current=!1,$())},p=()=>{s&&(i.current=!1,f.current=!1,$(!0))},x=()=>{Re()&&(i.current=!0,d())},w=()=>{i.current=!1,f.current=!1,$(!0)},{hoverProps:b}=F({isDisabled:n,onHoverStart:h,onHoverEnd:m}),{focusableProps:y}=Q({isDisabled:n,onFocus:x,onBlur:w},a);return{triggerProps:{"aria-describedby":t.isOpen?l:void 0,...C(y,b,{onPointerDown:p,onKeyDown:p}),tabIndex:void 0},tooltipProps:{id:l}}}const j=o.createContext(null),le=o.createContext(null);function Ge(e){let t=se(e),a=o.useRef(null),{triggerProps:n,tooltipProps:r}=Je(e,t,a);return u.createElement(Z,{values:[[j,t],[le,{...r,triggerRef:a}]]},u.createElement(Te,{...n,ref:a},e.children))}const Ze=o.forwardRef(function({UNSTABLE_portalContainer:t,...a},n){[a,n]=G(a,n,le);let r=o.useContext(j),s=se(a),l=a.isOpen!=null||a.defaultOpen!=null||!r?s:r,f=Ee(n,l.isOpen),i=a.isExiting||!l.shouldSkipAnimation&&f||!1;return!l.isOpen&&!i?null:u.createElement(ze,{portalContainer:t},u.createElement(Qe,{...a,tooltipRef:n,isExiting:i}))});function Qe(e){let t=o.useContext(j),a=o.useRef(null),{overlayProps:n,arrowProps:r,placement:s,triggerAnchorPoint:l}=Se({placement:e.placement||"top",targetRef:e.triggerRef,overlayRef:e.tooltipRef,arrowRef:a,offset:e.offset,crossOffset:e.crossOffset,isOpen:t.isOpen,arrowBoundaryOffset:e.arrowBoundaryOffset,shouldFlip:e.shouldFlip,containerPadding:e.containerPadding,onClose:()=>t.close(!0)}),f=Oe(e.tooltipRef,!!s),i=e.isEntering||!t.shouldSkipAnimation&&f||!1,d=_({...e,defaultClassName:"react-aria-Tooltip",values:{placement:s,isEntering:i,isExiting:e.isExiting,state:t}});e=C(e,n);let{tooltipProps:$}=Ke(e,t),h=I(e,{global:!0});return u.createElement(B.div,{...C(h,d,$),ref:e.tooltipRef,style:{...n.style,"--trigger-anchor-point":l?`${l.x}px ${l.y}px`:void 0,...d.style},"data-placement":s??void 0,"data-entering":i||void 0,"data-exiting":e.isExiting||void 0},u.createElement(Ne.Provider,{value:{...r,placement:s,ref:a}},d.children))}const K=e=>{if(!e)return;const t=e.trim(),a=parseFloat(t);if(!Number.isNaN(a))return t.endsWith("ms")?a:t.endsWith("s")?a*1e3:a},L=o.createContext({}),Xe=({children:e,shouldSkipAnimation:t})=>{const a=o.use(j);return!a||t?e:c.jsx(j,{value:{...a,shouldSkipAnimation:!1},children:e})},J=({children:e,closeDelay:t,delay:a,shouldSkipAnimation:n=!1,...r})=>{const s=u.useMemo(()=>Ae(),[]),l=z("--tooltip-delay"),f=z("--tooltip-close-delay"),i=a??K(l),d=t??K(f);return c.jsx(L,{value:{slots:s},children:c.jsx(Ge,{closeDelay:d,"data-slot":"tooltip-root",delay:i,...r,children:c.jsx(Xe,{shouldSkipAnimation:n,children:e})})})},Ye=({children:e,className:t,offset:a,showArrow:n=!1,...r})=>{const{slots:s}=o.use(L),l=a||(n?7:3);return c.jsx(Ze,{...r,className:V(t,s==null?void 0:s.base()),offset:l,children:e})},et=({children:e,className:t,...a})=>{const n=c.jsx("svg",{"data-slot":"overlay-arrow",fill:"none",height:"12",viewBox:"0 0 12 12",width:"12",xmlns:"http://www.w3.org/2000/svg",children:c.jsx("path",{d:"M0 0C5.48483 8 6.5 8 12 0Z"})}),r=u.isValidElement(e)?u.cloneElement(e,{"data-slot":"overlay-arrow"}):n;return c.jsx(je,{"data-slot":"tooltip-arrow",...a,className:t,children:r})},tt=({children:e,className:t,...a})=>{const{slots:n}=o.use(L),r=o.useRef(null),{focusableProps:s}=Q({},r);return c.jsx(O.div,{ref:r,className:N(n==null?void 0:n.trigger,t),"data-slot":"tooltip-trigger",role:"button",...C(s,a),children:e})},it=Object.assign(J,{Root:J,Trigger:tt,Content:Ye,Arrow:et}),at=e=>o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:"none",viewBox:"0 0 16 16"},e),o.createElement("path",{fill:"currentColor",fillRule:"evenodd",d:"M8 13.5a5.5 5.5 0 0 0 2.263-10.514 5.5 5.5 0 0 1-7.278 7.278A5.5 5.5 0 0 0 8 13.5M1.045 8.795a7.001 7.001 0 1 0 7.75-7.75l-.028-.003A7 7 0 0 0 8 1c-.527 0-.59.842-.185 1.18a4 4 0 0 1 .342.322A4 4 0 1 1 2.18 7.814C1.842 7.41 1 7.474 1 8a7 7 0 0 0 .045.794",clipRule:"evenodd"})),nt=e=>o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:"none",viewBox:"0 0 16 16"},e),o.createElement("path",{fill:"currentColor",fillRule:"evenodd",d:"M8 3a.75.75 0 0 1-.75-.75V.75a.75.75 0 0 1 1.5 0v1.5A.75.75 0 0 1 8 3m0 7.5a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5M8 12a4 4 0 1 0 0-8 4 4 0 0 0 0 8m-.75 3.25a.75.75 0 0 0 1.5 0v-1.5a.75.75 0 0 0-1.5 0zM13 8a.75.75 0 0 1 .75-.75h1.5a.75.75 0 0 1 0 1.5h-1.5A.75.75 0 0 1 13 8M.75 7.25a.75.75 0 0 0 0 1.5h1.5a.75.75 0 0 0 0-1.5zm10.786-2.786a.75.75 0 0 1 0-1.06l1.06-1.06a.75.75 0 0 1 1.06 1.06l-1.06 1.06a.75.75 0 0 1-1.06 0m-9.193 8.132a.75.75 0 0 0 1.06 1.06l1.062-1.06a.75.75 0 0 0-1.061-1.06zm9.193-1.06a.75.75 0 0 1 1.06 0l1.06 1.06a.75.75 0 0 1-1.06 1.06l-1.06-1.06a.75.75 0 0 1 0-1.06M3.404 2.343a.75.75 0 0 0-1.06 1.06l1.06 1.061a.75.75 0 1 0 1.06-1.06z",clipRule:"evenodd"}));function ct(){const{theme:e,setTheme:t}=De(),a=n=>{const r=n;(r==="light"||r==="dark")&&t(r)};return c.jsx(R,{className:"w-fit shrink-0 text-center",selectedKey:e,onSelectionChange:n=>a(String(n)),children:c.jsx(R.ListContainer,{children:c.jsxs(R.List,{"aria-label":"页面主题",className:"w-fit",children:[c.jsxs(R.Tab,{"aria-label":"使用亮色模式",className:"h-6 w-6 px-0 text-xs data-[selected=true]:text-accent-foreground",id:"light",children:[c.jsx(nt,{className:"size-3.5"}),c.jsx(R.Indicator,{className:"bg-accent"})]}),c.jsxs(R.Tab,{"aria-label":"使用暗色模式",className:"h-6 w-6 px-0 text-xs data-[selected=true]:text-accent-foreground",id:"dark",children:[c.jsx(at,{className:"size-3.5"}),c.jsx(R.Indicator,{className:"bg-accent"})]})]})})})}function dt(){return!1}export{st as C,lt as S,it as T,ct as a,dt as i};
@@ -1 +1 @@
1
- import{r as s,$ as bl,aL as gl,aw as $l,t as L,x as X,y as T,G as w,R as f,ac as z,aA as hl,aV as xl,bR as Ee,H as R,bS as pl,bT as vl,bU as ml,Y as J,U as Se,v as Me,bV as ge,bW as j,aM as $e,ak as H,al as yl,ag as Pl,L as K,bX as Dl,bY as O,ao as Bl,az as Re,z as Ae,au as he,bZ as Cl,aS as Fe,aK as El,aD as Sl,b_ as Ml,b$ as Rl,aF as Q,E as we,F as k,aY as Al,a2 as ee,c0 as Fl,aZ as wl,c1 as Ke,a0 as ke,aO as ze,c2 as Kl,aE as Le,c3 as kl,a4 as U,aI as zl,aJ as Ll,aP as Il,aQ as Vl,c4 as Tl,am as Nl,c5 as jl,aC as Ol,N as Ul,O as Zl,bJ as _l,I as ql,K as Wl,Z as Ie,_ as Gl,a1 as Yl,a3 as Ve,c6 as Xl,c7 as Jl,a6 as Hl,j as B,bH as Ql,b4 as Te,a9 as Y,a7 as I,be as ea,c8 as ta,c9 as xe,ca as la,cb as aa}from"./index-DS0F5-Qw.js";function ra(l,e){let{collection:a,onLoadMore:t,scrollOffset:r=1,direction:o="end"}=l,i=s.useRef(null),u=bl(n=>{for(let b of n)b.isIntersecting&&t&&t()});gl(()=>{if(e.current){const n=100*r,b=o==="start"?`${n}% 0px 0px 0px`:`0px ${n}% ${n}% ${n}%`;i.current=new IntersectionObserver(u,{root:$l(e==null?void 0:e.current),rootMargin:b}),i.current.observe(e.current)}return()=>{i.current&&i.current.disconnect()}},[a,e,r,o])}const oa=L({base:"label",defaultVariants:{isDisabled:!1,isInvalid:!1,isRequired:!1},variants:{isDisabled:{true:"label--disabled"},isInvalid:{true:"label--invalid"},isRequired:{true:"label--required"}}}),ia=L({base:"list-box",defaultVariants:{variant:"default"},variants:{variant:{danger:"list-box--danger",default:"list-box--default"}}}),sa=L({defaultVariants:{variant:"default"},slots:{indicator:"list-box-item__indicator",item:"list-box-item"},variants:{variant:{danger:{item:"list-box-item--danger"},default:{item:"list-box-item--default"}}}}),na=L({base:"list-box-section"}),ua=L({defaultVariants:{fullWidth:!1,variant:"primary"},slots:{base:"select",indicator:"select__indicator",popover:"select__popover",trigger:"select__trigger",value:"select__value"},variants:{fullWidth:{false:{},true:{base:"select--full-width",trigger:"select__trigger--full-width"}},variant:{primary:{base:"select--primary"},secondary:{base:"select--secondary"}}}}),ca=L({defaultVariants:{animationType:"shimmer"},slots:{base:"skeleton"},variants:{animationType:{none:"skeleton--none",pulse:"skeleton--pulse",shimmer:"skeleton--shimmer"}}}),te=s.createContext({}),da=X(function(e,a){[e,a]=T(e,a,te);let{elementType:t="label",...r}=e,o=w[t];return f.createElement(o,{className:"react-aria-Label",...r,ref:a})});function Ne(l){let{id:e,label:a,"aria-labelledby":t,"aria-label":r,labelElementType:o="label"}=l;e=z(e);let i=z(),u={};a&&(t=t?`${i} ${t}`:i,u={id:i,htmlFor:o==="label"?e:void 0});let n=hl({id:e,"aria-label":r,"aria-labelledby":t});return{labelProps:u,fieldProps:n}}const fa=s.createContext(null),ar=s.createContext(null),ba=s.createContext({}),ga=s.createContext({}),ue=class ue extends xl{filter(e,a){let t=a.getItem(this.prevKey);if(t&&t.type!=="separator"){let r=this.clone();return a.addDescendants(r,e),r}return null}};ue.type="separator";let pe=ue;var je={};je={longPressMessage:"اضغط مطولاً أو اضغط على Alt + السهم لأسفل لفتح القائمة"};var Oe={};Oe={longPressMessage:"Натиснете продължително или натиснете Alt+ стрелка надолу, за да отворите менюто"};var Ue={};Ue={longPressMessage:"Dlouhým stiskem nebo stisknutím kláves Alt + šipka dolů otevřete nabídku"};var Ze={};Ze={longPressMessage:"Langt tryk eller tryk på Alt + pil ned for at åbne menuen"};var _e={};_e={longPressMessage:"Drücken Sie lange oder drücken Sie Alt + Nach-unten, um das Menü zu öffnen"};var qe={};qe={longPressMessage:"Πιέστε παρατεταμένα ή πατήστε Alt + κάτω βέλος για να ανοίξετε το μενού"};var We={};We={longPressMessage:"Long press or press Alt + ArrowDown to open menu"};var Ge={};Ge={longPressMessage:"Mantenga pulsado o pulse Alt + flecha abajo para abrir el menú"};var Ye={};Ye={longPressMessage:"Menüü avamiseks vajutage pikalt või vajutage klahve Alt + allanool"};var Xe={};Xe={longPressMessage:"Avaa valikko painamalla pohjassa tai näppäinyhdistelmällä Alt + Alanuoli"};var Je={};Je={longPressMessage:"Appuyez de manière prolongée ou appuyez sur Alt + Flèche vers le bas pour ouvrir le menu."};var He={};He={longPressMessage:"לחץ לחיצה ארוכה או הקש Alt + ArrowDown כדי לפתוח את התפריט"};var Qe={};Qe={longPressMessage:"Dugo pritisnite ili pritisnite Alt + strelicu prema dolje za otvaranje izbornika"};var et={};et={longPressMessage:"Nyomja meg hosszan, vagy nyomja meg az Alt + lefele nyíl gombot a menü megnyitásához"};var tt={};tt={longPressMessage:"Premi a lungo o premi Alt + Freccia giù per aprire il menu"};var lt={};lt={longPressMessage:"長押しまたは Alt+下矢印キーでメニューを開く"};var at={};at={longPressMessage:"길게 누르거나 Alt + 아래쪽 화살표를 눌러 메뉴 열기"};var rt={};rt={longPressMessage:"Norėdami atidaryti meniu, nuspaudę palaikykite arba paspauskite „Alt + ArrowDown“."};var ot={};ot={longPressMessage:"Lai atvērtu izvēlni, turiet nospiestu vai nospiediet taustiņu kombināciju Alt + lejupvērstā bultiņa"};var it={};it={longPressMessage:"Langt trykk eller trykk Alt + PilNed for å åpne menyen"};var st={};st={longPressMessage:"Druk lang op Alt + pijl-omlaag of druk op Alt om het menu te openen"};var nt={};nt={longPressMessage:"Naciśnij i przytrzymaj lub naciśnij klawisze Alt + Strzałka w dół, aby otworzyć menu"};var ut={};ut={longPressMessage:"Pressione e segure ou pressione Alt + Seta para baixo para abrir o menu"};var ct={};ct={longPressMessage:"Prima continuamente ou prima Alt + Seta Para Baixo para abrir o menu"};var dt={};dt={longPressMessage:"Apăsați lung sau apăsați pe Alt + săgeată în jos pentru a deschide meniul"};var ft={};ft={longPressMessage:"Нажмите и удерживайте или нажмите Alt + Стрелка вниз, чтобы открыть меню"};var bt={};bt={longPressMessage:"Ponuku otvoríte dlhým stlačením alebo stlačením klávesu Alt + klávesu so šípkou nadol"};var gt={};gt={longPressMessage:"Za odprtje menija pritisnite in držite gumb ali pritisnite Alt+puščica navzdol"};var $t={};$t={longPressMessage:"Dugo pritisnite ili pritisnite Alt + strelicu prema dole da otvorite meni"};var ht={};ht={longPressMessage:"Håll nedtryckt eller tryck på Alt + pil nedåt för att öppna menyn"};var xt={};xt={longPressMessage:"Menüyü açmak için uzun basın veya Alt + Aşağı Ok tuşuna basın"};var pt={};pt={longPressMessage:"Довго або звичайно натисніть комбінацію клавіш Alt і стрілка вниз, щоб відкрити меню"};var vt={};vt={longPressMessage:"长按或按 Alt + 向下方向键以打开菜单"};var mt={};mt={longPressMessage:"長按或按 Alt+向下鍵以開啟功能表"};var yt={};yt={"ar-AE":je,"bg-BG":Oe,"cs-CZ":Ue,"da-DK":Ze,"de-DE":_e,"el-GR":qe,"en-US":We,"es-ES":Ge,"et-EE":Ye,"fi-FI":Xe,"fr-FR":Je,"he-IL":He,"hr-HR":Qe,"hu-HU":et,"it-IT":tt,"ja-JP":lt,"ko-KR":at,"lt-LT":rt,"lv-LV":ot,"nb-NO":it,"nl-NL":st,"pl-PL":nt,"pt-BR":ut,"pt-PT":ct,"ro-RO":dt,"ru-RU":ft,"sk-SK":bt,"sl-SI":gt,"sr-SP":$t,"sv-SE":ht,"tr-TR":xt,"uk-UA":pt,"zh-CN":vt,"zh-TW":mt};function $a(l){let{onContextMenu:e}=l,a=s.useRef(!1),{longPressProps:t}=Ee({onLongPressStart(){a.current=!1},onLongPress(r){a.current?a.current=!1:e==null||e({target:r.target,x:r.x,y:r.y})}});return e?{contextMenuProps:R(pl()?t:{},{onContextMenu(r){r.stopPropagation(),r.preventDefault(),a.current=!0;let o=r.currentTarget.getBoundingClientRect();e({target:r.currentTarget,x:r.clientX-o.x,y:r.clientY-o.y})},onKeyDown(r){if(vl()&&r.ctrlKey&&r.key==="Enter"){a.current=!1;let o=r.currentTarget;r.stopPropagation(),setTimeout(()=>{if(a.current)a.current=!1;else{let i=o.getBoundingClientRect();e({target:o,x:i.width/2,y:i.height/2})}},10)}}})}:{contextMenuProps:{}}}function ha(l){return l&&l.__esModule?l.default:l}function xa(l,e,a){let{type:t="menu",isDisabled:r,trigger:o="press"}=l,i=z(),{triggerProps:u,overlayProps:n}=ml({type:t},e,a),b=(c,m,P="first")=>{if(!c||m.isDefaultPrevented())return!1;e.toggle(P)},{keyboardProps:d}=J({isDisabled:r,shortcuts:{Enter:c=>b(o!=="longPress",c,"first")," ":c=>b(o!=="longPress",c,"first"),ArrowDown:c=>b(o!=="longPress",c,"first"),ArrowUp:c=>b(o!=="longPress",c,"last"),"Alt+Enter":c=>b(o==="longPress",c,"first"),"Alt+ ":c=>b(o==="longPress",c,"first"),"Alt+ArrowDown":c=>b(!0,c,"first"),"Alt+ArrowUp":c=>b(!0,c,"last")}}),$=Se(ha(yt),"@react-aria/menu"),{longPressProps:x}=Ee({isDisabled:r||o!=="longPress",accessibilityDescription:$.format("longPressMessage"),onLongPressStart(){e.close()},onLongPress(){e.open("first")}}),g={preventFocusOnPress:!0,onPressStart(c){c.pointerType!=="touch"&&c.pointerType!=="keyboard"&&!r&&(ge(c.target),e.open(c.pointerType==="virtual"?"first":null))},onPress(c){c.pointerType==="touch"&&!r&&(ge(c.target),e.toggle())}};delete u.onPress;let{contextMenuProps:p}=$a({onContextMenu(c){let m=c.target.getBoundingClientRect();e.setPoint({x:m.x+c.x,y:m.y+c.y}),e.open()}});s.useEffect(()=>{if(e.isOpen&&o==="contextMenu"){let c=m=>{(m.button===2||m.button===0&&m.ctrlKey===!0)&&Me(m)===document.body&&e.close()};return document.addEventListener("mousedown",c),()=>document.removeEventListener("mousedown",c)}},[e,o]);let v;if(o==="press")v={...g,...d};else if(o==="longPress")v={...x,...d};else if(o==="contextMenu"){v=p;let{"aria-haspopup":c,"aria-expanded":m,"aria-controls":P,...h}=u;u=h}return{menuTriggerProps:{...u,...v,id:i},menuProps:{...n,"aria-labelledby":i,autoFocus:e.focusStrategy||!0,onClose:e.close}}}class ve{constructor(e){this.ref=e}getItemRect(e){let a=this.ref.current;if(!a)return null;let t=e!=null?j(this.ref,e):null;if(!t)return null;let r=a.getBoundingClientRect(),o=t.getBoundingClientRect();return{x:o.left-r.left-a.clientLeft+a.scrollLeft,y:o.top-r.top-a.clientTop+a.scrollTop,width:o.width,height:o.height}}getContentSize(){let e=this.ref.current;return{width:(e==null?void 0:e.scrollWidth)??0,height:(e==null?void 0:e.scrollHeight)??0}}getVisibleRect(){let e=this.ref.current;return{x:(e==null?void 0:e.scrollLeft)??0,y:(e==null?void 0:e.scrollTop)??0,width:(e==null?void 0:e.clientWidth)??0,height:(e==null?void 0:e.clientHeight)??0}}}class le{constructor(...e){if(e.length===1){let a=e[0];this.collection=a.collection,this.ref=a.ref,this.collator=a.collator,this.disabledKeys=a.disabledKeys||new Set,this.disabledBehavior=a.disabledBehavior||"all",this.orientation=a.orientation||"vertical",this.direction=a.direction,this.layout=a.layout||"stack",this.layoutDelegate=a.layoutDelegate||new ve(a.ref)}else this.collection=e[0],this.disabledKeys=e[1],this.ref=e[2],this.collator=e[3],this.layout="stack",this.orientation="vertical",this.disabledBehavior="all",this.layoutDelegate=new ve(this.ref);this.layout==="stack"&&this.orientation==="vertical"&&(this.getKeyLeftOf=void 0,this.getKeyRightOf=void 0)}isDisabled(e){var a,t;return this.disabledBehavior==="all"&&(((a=e.props)==null?void 0:a.isDisabled)||this.disabledKeys.has(e.key))&&((t=e.props)==null?void 0:t.disabledBehavior)!=="selection"}findNextNonDisabled(e,a,t=!1){let r=e;for(;r!=null;){let o=this.collection.getItem(r);if((o==null?void 0:o.type)==="item"&&(t||!this.isDisabled(o)))return r;r=a(r)}return null}getNextKey(e,a){let t=e;return t=this.collection.getKeyAfter(t),this.findNextNonDisabled(t,r=>this.collection.getKeyAfter(r),a==null?void 0:a.includeDisabled)}getPreviousKey(e,a){let t=e;return t=this.collection.getKeyBefore(t),this.findNextNonDisabled(t,r=>this.collection.getKeyBefore(r),a==null?void 0:a.includeDisabled)}findKey(e,a,t){let r=e,o=this.layoutDelegate.getItemRect(r);if(!o||r==null)return null;let i=o;do{if(r=a(r),r==null)break;o=this.layoutDelegate.getItemRect(r)}while(o&&t(i,o)&&r!=null);return r}isSameRow(e,a){return e.y===a.y||e.x!==a.x}isSameColumn(e,a){return e.x===a.x||e.y!==a.y}isReversed(e){let a=this.getNextKey(e),t=j(this.ref,e);if(a!=null){let o=j(this.ref,a);return!t||!o?!1:t.getBoundingClientRect().top>o.getBoundingClientRect().top}let r=this.getPreviousKey(e);if(r!=null){let o=j(this.ref,r);return!t||!o?!1:o.getBoundingClientRect().top>t.getBoundingClientRect().top}return!1}getKeyBelow(e,a){return this.layout==="grid"&&this.orientation==="vertical"?this.findKey(e,t=>this.getNextKey(t,a),this.isSameRow):this.orientation==="vertical"?this.isReversed(e)?this.getPreviousKey(e,a):this.getNextKey(e,a):this.getNextKey(e,a)}getKeyAbove(e,a){return this.layout==="grid"&&this.orientation==="vertical"?this.findKey(e,t=>this.getPreviousKey(t,a),this.isSameRow):this.orientation==="vertical"?this.isReversed(e)?this.getNextKey(e,a):this.getPreviousKey(e,a):this.getPreviousKey(e,a)}getNextColumn(e,a,t){return a?this.getPreviousKey(e,t):this.getNextKey(e,t)}getKeyRightOf(e,a){let t=this.direction==="ltr"?"getKeyRightOf":"getKeyLeftOf";return this.layoutDelegate[t]?(e=this.layoutDelegate[t](e),this.findNextNonDisabled(e,r=>this.layoutDelegate[t](r),a==null?void 0:a.includeDisabled)):this.layout==="grid"?this.orientation==="vertical"?this.getNextColumn(e,this.direction==="rtl",a):this.findKey(e,r=>this.getNextColumn(r,this.direction==="rtl",a),this.isSameColumn):this.orientation==="horizontal"?this.getNextColumn(e,this.direction==="rtl",a):null}getKeyLeftOf(e,a){let t=this.direction==="ltr"?"getKeyLeftOf":"getKeyRightOf";return this.layoutDelegate[t]?(e=this.layoutDelegate[t](e),this.findNextNonDisabled(e,r=>this.layoutDelegate[t](r),a==null?void 0:a.includeDisabled)):this.layout==="grid"?this.orientation==="vertical"?this.getNextColumn(e,this.direction==="ltr",a):this.findKey(e,r=>this.getNextColumn(r,this.direction==="ltr",a),this.isSameColumn):this.orientation==="horizontal"?this.getNextColumn(e,this.direction==="ltr",a):null}getFirstKey(){let e=this.collection.getFirstKey();return this.findNextNonDisabled(e,a=>this.collection.getKeyAfter(a))}getLastKey(){let e=this.collection.getLastKey();return this.findNextNonDisabled(e,a=>this.collection.getKeyBefore(a))}getKeyPageAbove(e){let a=this.ref.current,t=this.layoutDelegate.getItemRect(e);if(!t)return null;let r=this.isReversed(e);if(a&&!$e(a))return this.getFirstKey();let o=e;if(this.orientation==="horizontal"){let i=Math.max(0,t.x+t.width-this.layoutDelegate.getVisibleRect().width);for(;t&&t.x>i&&o!=null;)o=this.getKeyAbove(o),t=o==null?null:this.layoutDelegate.getItemRect(o)}else{let i=this.layoutDelegate.getVisibleRect(),u=r?t.y-i.height:Math.max(0,t.y+t.height-i.height);for(;t&&t.y>u&&o!=null;)o=this.getKeyAbove(o),t=o==null?null:this.layoutDelegate.getItemRect(o)}return o??(r?this.getLastKey():this.getFirstKey())}getKeyPageBelow(e){let a=this.ref.current,t=this.layoutDelegate.getItemRect(e);if(!t)return null;let r=this.isReversed(e);if(a&&!$e(a))return this.getLastKey();let o=e;if(this.orientation==="horizontal"){let i=Math.min(this.layoutDelegate.getContentSize().width,t.x-t.width+this.layoutDelegate.getVisibleRect().width);for(;t&&t.x<i&&o!=null;)o=this.getKeyBelow(o),t=o==null?null:this.layoutDelegate.getItemRect(o)}else{let i=Math.min(this.layoutDelegate.getContentSize().height,t.y-t.height+this.layoutDelegate.getVisibleRect().height);for(;t&&t.y<i&&o!=null;)o=this.getKeyBelow(o),t=o==null?null:this.layoutDelegate.getItemRect(o)}return o??(r?this.getFirstKey():this.getLastKey())}getKeyForSearch(e,a){if(!this.collator)return null;let t=this.collection,r=a||this.getFirstKey();for(;r!=null;){let o=t.getItem(r);if(!o)return null;let i=o.textValue.slice(0,e.length);if(o.textValue&&this.collator.compare(i,e)===0)return r;r=this.getNextKey(r)}return null}}let W=new Map;function ae(l){let{locale:e}=H(),a=e+(l?Object.entries(l).sort((r,o)=>r[0]<o[0]?-1:1).join():"");if(W.has(a))return W.get(a);let t=new Intl.Collator(e,l);return W.set(a,t),t}function pa(l){let{selectionManager:e,collection:a,disabledKeys:t,ref:r,keyboardDelegate:o,layoutDelegate:i,orientation:u}=l,n=ae({usage:"search",sensitivity:"base"}),b=e.disabledBehavior,d=s.useMemo(()=>o||new le({collection:a,disabledKeys:t,disabledBehavior:b,ref:r,collator:n,layoutDelegate:i,orientation:u}),[o,i,a,t,r,n,b,u]),{collectionProps:$}=yl({...l,ref:r,selectionManager:e,keyboardDelegate:d});return{listProps:$}}const me=new WeakMap;function va(l){let e=me.get(l);if(e!=null)return e;let a=0,t=r=>{for(let o of r)o.type==="section"?t(Pl(o,l)):o.type==="item"&&a++};return t(l),me.set(l,a),a}var Pt={};Pt={colorSwatchPicker:"تغييرات الألوان",dropzoneLabel:"DropZone",selectPlaceholder:"حدد عنصرًا",tableResizer:"أداة تغيير الحجم"};var Dt={};Dt={colorSwatchPicker:"Цветови мостри",dropzoneLabel:"DropZone",selectPlaceholder:"Изберете предмет",tableResizer:"Преоразмерител"};var Bt={};Bt={colorSwatchPicker:"Vzorky barev",dropzoneLabel:"Místo pro přetažení",selectPlaceholder:"Vyberte položku",tableResizer:"Změna velikosti"};var Ct={};Ct={colorSwatchPicker:"Farveprøver",dropzoneLabel:"DropZone",selectPlaceholder:"Vælg et element",tableResizer:"Størrelsesændring"};var Et={};Et={colorSwatchPicker:"Farbfelder",dropzoneLabel:"Ablegebereich",selectPlaceholder:"Element wählen",tableResizer:"Größenanpassung"};var St={};St={colorSwatchPicker:"Χρωματικά δείγματα",dropzoneLabel:"DropZone",selectPlaceholder:"Επιλέξτε ένα αντικείμενο",tableResizer:"Αλλαγή μεγέθους"};var Mt={};Mt={selectPlaceholder:"Select an item",tableResizer:"Resizer",dropzoneLabel:"DropZone",colorSwatchPicker:"Color swatches"};var Rt={};Rt={colorSwatchPicker:"Muestras de colores",dropzoneLabel:"DropZone",selectPlaceholder:"Seleccionar un artículo",tableResizer:"Cambiador de tamaño"};var At={};At={colorSwatchPicker:"Värvinäidised",dropzoneLabel:"DropZone",selectPlaceholder:"Valige üksus",tableResizer:"Suuruse muutja"};var Ft={};Ft={colorSwatchPicker:"Värimallit",dropzoneLabel:"DropZone",selectPlaceholder:"Valitse kohde",tableResizer:"Koon muuttaja"};var wt={};wt={colorSwatchPicker:"Échantillons de couleurs",dropzoneLabel:"DropZone",selectPlaceholder:"Sélectionner un élément",tableResizer:"Redimensionneur"};var Kt={};Kt={colorSwatchPicker:"דוגמיות צבע",dropzoneLabel:"DropZone",selectPlaceholder:"בחר פריט",tableResizer:"שינוי גודל"};var kt={};kt={colorSwatchPicker:"Uzorci boja",dropzoneLabel:"Zona spuštanja",selectPlaceholder:"Odaberite stavku",tableResizer:"Promjena veličine"};var zt={};zt={colorSwatchPicker:"Színtárak",dropzoneLabel:"DropZone",selectPlaceholder:"Válasszon ki egy elemet",tableResizer:"Átméretező"};var Lt={};Lt={colorSwatchPicker:"Campioni di colore",dropzoneLabel:"Zona di rilascio",selectPlaceholder:"Seleziona un elemento",tableResizer:"Ridimensionamento"};var It={};It={colorSwatchPicker:"カラースウォッチ",dropzoneLabel:"ドロップゾーン",selectPlaceholder:"項目を選択",tableResizer:"サイズ変更ツール"};var Vt={};Vt={colorSwatchPicker:"색상 견본",dropzoneLabel:"드롭 영역",selectPlaceholder:"항목 선택",tableResizer:"크기 조정기"};var Tt={};Tt={colorSwatchPicker:"Spalvų pavyzdžiai",dropzoneLabel:"„DropZone“",selectPlaceholder:"Pasirinkite elementą",tableResizer:"Dydžio keitiklis"};var Nt={};Nt={colorSwatchPicker:"Krāsu paraugi",dropzoneLabel:"DropZone",selectPlaceholder:"Izvēlēties vienumu",tableResizer:"Izmēra mainītājs"};var jt={};jt={colorSwatchPicker:"Fargekart",dropzoneLabel:"Droppsone",selectPlaceholder:"Velg et element",tableResizer:"Størrelsesendrer"};var Ot={};Ot={colorSwatchPicker:"kleurstalen",dropzoneLabel:"DropZone",selectPlaceholder:"Selecteer een item",tableResizer:"Resizer"};var Ut={};Ut={colorSwatchPicker:"Próbki kolorów",dropzoneLabel:"Strefa upuszczania",selectPlaceholder:"Wybierz element",tableResizer:"Zmiana rozmiaru"};var Zt={};Zt={colorSwatchPicker:"Amostras de cores",dropzoneLabel:"DropZone",selectPlaceholder:"Selecione um item",tableResizer:"Redimensionador"};var _t={};_t={colorSwatchPicker:"Amostras de cores",dropzoneLabel:"DropZone",selectPlaceholder:"Selecione um item",tableResizer:"Redimensionador"};var qt={};qt={colorSwatchPicker:"Specimene de culoare",dropzoneLabel:"Zonă de plasare",selectPlaceholder:"Selectați un element",tableResizer:"Instrument de redimensionare"};var Wt={};Wt={colorSwatchPicker:"Цветовые образцы",dropzoneLabel:"DropZone",selectPlaceholder:"Выберите элемент",tableResizer:"Средство изменения размера"};var Gt={};Gt={colorSwatchPicker:"Vzorkovníky farieb",dropzoneLabel:"DropZone",selectPlaceholder:"Vyberte položku",tableResizer:"Nástroj na zmenu veľkosti"};var Yt={};Yt={colorSwatchPicker:"Barvne palete",dropzoneLabel:"DropZone",selectPlaceholder:"Izberite element",tableResizer:"Spreminjanje velikosti"};var Xt={};Xt={colorSwatchPicker:"Uzorci boje",dropzoneLabel:"DropZone",selectPlaceholder:"Izaberite stavku",tableResizer:"Promena veličine"};var Jt={};Jt={colorSwatchPicker:"Färgrutor",dropzoneLabel:"DropZone",selectPlaceholder:"Välj en artikel",tableResizer:"Storleksändrare"};var Ht={};Ht={colorSwatchPicker:"Renk örnekleri",dropzoneLabel:"Bırakma Bölgesi",selectPlaceholder:"Bir öğe seçin",tableResizer:"Yeniden boyutlandırıcı"};var Qt={};Qt={colorSwatchPicker:"Зразки кольорів",dropzoneLabel:"DropZone",selectPlaceholder:"Виберіть елемент",tableResizer:"Засіб змінення розміру"};var el={};el={colorSwatchPicker:"颜色色板",dropzoneLabel:"放置区域",selectPlaceholder:"选择一个项目",tableResizer:"尺寸调整器"};var tl={};tl={colorSwatchPicker:"色票",dropzoneLabel:"放置區",selectPlaceholder:"選取項目",tableResizer:"大小調整器"};var ll={};ll={"ar-AE":Pt,"bg-BG":Dt,"cs-CZ":Bt,"da-DK":Ct,"de-DE":Et,"el-GR":St,"en-US":Mt,"es-ES":Rt,"et-EE":At,"fi-FI":Ft,"fr-FR":wt,"he-IL":Kt,"hr-HR":kt,"hu-HU":zt,"it-IT":Lt,"ja-JP":It,"ko-KR":Vt,"lt-LT":Tt,"lv-LV":Nt,"nb-NO":jt,"nl-NL":Ot,"pl-PL":Ut,"pt-BR":Zt,"pt-PT":_t,"ro-RO":qt,"ru-RU":Wt,"sk-SK":Gt,"sl-SI":Yt,"sr-SP":Xt,"sv-SE":Jt,"tr-TR":Ht,"uk-UA":Qt,"zh-CN":el,"zh-TW":tl};const Z=s.createContext({}),al=s.createContext(null),ma=s.forwardRef(function(e,a){let{render:t}=s.useContext(al);return f.createElement(f.Fragment,null,t(e,a))});function rl(l,e){var o;let a=l==null?void 0:l.renderDropIndicator,t=(o=l==null?void 0:l.isVirtualDragging)==null?void 0:o.call(l),r=s.useCallback(i=>{if(t||e!=null&&e.isDropTarget(i))return a?a(i):f.createElement(ma,{target:i})},[e==null?void 0:e.target,t,a]);return l!=null&&l.useDropIndicator?r:void 0}function ya(l,e,a){var o,i,u;let t=l.focusedKey,r=null;if((o=e==null?void 0:e.isVirtualDragging)!=null&&o.call(e)&&((i=a==null?void 0:a.target)==null?void 0:i.type)==="item"&&(r=a.target.key,a.target.dropPosition==="after")){let n=a.collection.getKeyAfter(r),b=null;if(n!=null){let d=((u=a.collection.getItem(r))==null?void 0:u.level)??0;for(;n!=null;){let $=a.collection.getItem(n);if(!$)break;if($.type!=="item"){n=a.collection.getKeyAfter(n);continue}if(($.level??0)<=d)break;b=n,n=a.collection.getKeyAfter(n)}}r=n??b??r}return s.useMemo(()=>new Set([t,r].filter(n=>n!=null)),[t,r])}const re=new WeakMap;function Pa(l){return typeof l=="string"?l.replace(/\s*/g,""):""+l}function Da(l,e){let a=re.get(l);if(!a)throw new Error("Unknown list");return`${a.id}-option-${Pa(e)}`}function Ba(l,e,a){let t=K(l,{labelable:!0}),r=l.selectionBehavior||"toggle",o=l.orientation||"vertical",i=l.linkBehavior||(r==="replace"?"action":"override");r==="toggle"&&i==="action"&&(i="override");let{listProps:u}=pa({...l,ref:a,selectionManager:e.selectionManager,collection:e.collection,disabledKeys:e.disabledKeys,linkBehavior:i}),{focusWithinProps:n}=Dl({onFocusWithin:l.onFocus,onBlurWithin:l.onBlur,onFocusWithinChange:l.onFocusChange}),b=z(l.id);re.set(e,{id:b,shouldUseVirtualFocus:l.shouldUseVirtualFocus,shouldSelectOnPressUp:l.shouldSelectOnPressUp,shouldFocusOnHover:l.shouldFocusOnHover,isVirtualized:l.isVirtualized,onAction:l.onAction,linkBehavior:i,UNSTABLE_itemBehavior:l.UNSTABLE_itemBehavior});let{labelProps:d,fieldProps:$}=Ne({...l,id:b,labelElementType:"span"});return{labelProps:d,listBoxProps:R(t,n,e.selectionManager.selectionMode==="multiple"?{"aria-multiselectable":"true"}:{},{role:"listbox","aria-orientation":o,...R($,u)})}}function Ca(l,e,a){var y,A;let{key:t}=l,r=re.get(e),o=l.isDisabled??e.selectionManager.isDisabled(t),i=l.isSelected??e.selectionManager.isSelected(t),u=l.shouldSelectOnPressUp??(r==null?void 0:r.shouldSelectOnPressUp),n=l.shouldFocusOnHover??(r==null?void 0:r.shouldFocusOnHover),b=l.shouldUseVirtualFocus??(r==null?void 0:r.shouldUseVirtualFocus),d=l.isVirtualized??(r==null?void 0:r.isVirtualized),$=O(),x=O(),g={role:"option","aria-disabled":o||void 0,"aria-selected":e.selectionManager.selectionMode!=="none"?i:void 0,"aria-label":l["aria-label"],"aria-labelledby":$,"aria-describedby":x},p=e.collection.getItem(t);if(d){let S=Number(p==null?void 0:p.index);g["aria-posinset"]=Number.isNaN(S)?void 0:S+1,g["aria-setsize"]=va(e.collection)}let v=r!=null&&r.onAction?()=>{var S;return(S=r==null?void 0:r.onAction)==null?void 0:S.call(r,t)}:void 0,c=Da(e,t),{itemProps:m,isPressed:P,isFocused:h,hasAction:E,allowsSelection:C}=Bl({selectionManager:e.selectionManager,key:t,ref:a,shouldSelectOnPressUp:u,allowsDifferentPressOrigin:u&&n,isVirtualized:d,shouldUseVirtualFocus:b,isDisabled:o,onAction:v||(y=p==null?void 0:p.props)!=null&&y.onAction?Re((A=p==null?void 0:p.props)==null?void 0:A.onAction,v):void 0,linkBehavior:r==null?void 0:r.linkBehavior,UNSTABLE_itemBehavior:r==null?void 0:r.UNSTABLE_itemBehavior,id:c}),{hoverProps:M}=Ae({isDisabled:o||!n,onHoverStart(){he()||(e.selectionManager.setFocused(!0),e.selectionManager.setFocusedKey(t))}}),D=K(p==null?void 0:p.props);delete D.id;let F=Cl(p==null?void 0:p.props);return{optionProps:{...g,...R(D,m,M,F),id:c},labelProps:{id:$},descriptionProps:{id:x},isFocused:h,isFocusVisible:h&&e.selectionManager.isFocused&&he(),isSelected:i,isDisabled:o,isPressed:P,allowsSelection:C,hasAction:E}}function Ea(l){let{heading:e,"aria-label":a}=l,t=z();return{itemProps:{role:"presentation"},headingProps:e?{id:t,role:"presentation",onMouseDown:r=>{r.preventDefault()}}:{},groupProps:{role:"group","aria-label":a,"aria-labelledby":e?t:void 0}}}const oe=s.createContext(null),V=s.createContext(null),Sa=s.forwardRef(function(e,a){[e,a]=T(e,a,oe);let t=s.useContext(V);return t?f.createElement(ol,{state:t,props:e,listBoxRef:a}):f.createElement(Fe,{content:f.createElement(El,e)},r=>f.createElement(Ma,{props:e,listBoxRef:a,collection:r}))});function Ma({props:l,listBoxRef:e,collection:a}){l={...l,collection:a,children:null,items:null};let{layoutDelegate:t}=s.useContext(Q),r=Ke({...l,layoutDelegate:t});return f.createElement(ol,{state:r,props:l,listBoxRef:e})}function ol({state:l,props:e,listBoxRef:a}){[e,a]=T(e,a,fa);let{dragAndDropHooks:t,layout:r="stack",orientation:o="vertical",filter:i}=e,u=Rl(l,i),{collection:n,selectionManager:b}=u,d=!!(t!=null&&t.useDraggableCollectionState),$=!!(t!=null&&t.useDroppableCollectionState),{direction:x}=H(),{disabledBehavior:g,disabledKeys:p}=b,v=ae({usage:"search",sensitivity:"base"}),{isVirtualized:c,layoutDelegate:m,dropTargetDelegate:P,CollectionRoot:h}=s.useContext(Q),E=s.useMemo(()=>e.keyboardDelegate||new le({collection:n,collator:v,ref:a,disabledKeys:p,disabledBehavior:g,layout:r,orientation:o,direction:x,layoutDelegate:m}),[n,v,a,g,p,o,x,e.keyboardDelegate,r,m]),{listBoxProps:C}=Ba({...e,shouldSelectOnPressUp:d||e.shouldSelectOnPressUp,keyboardDelegate:E,isVirtualized:c},u,a);s.useRef(d),s.useRef($),s.useEffect(()=>{},[d,$]);let M,D,F,y=!1,A=null,S=s.useRef(null);if(d&&t){M=t.useDraggableCollectionState({collection:n,selectionManager:b,preview:t.renderDragPreview?S:void 0}),t.useDraggableCollection({},M,a);let q=t.DragPreview;A=t.renderDragPreview?f.createElement(q,{ref:S},t.renderDragPreview):null}if($&&t){D=t.useDroppableCollectionState({collection:n,selectionManager:b});let q=t.dropTargetDelegate||P||new t.ListDropTargetDelegate(n,a,{orientation:o,layout:r,direction:x});F=t.useDroppableCollection({keyboardDelegate:E,dropTargetDelegate:q},D,a),y=D.isDropTarget({type:"root"})}let{focusProps:cl,isFocused:ce,isFocusVisible:de}=we(),_=u.collection.size===0,fe={isDropTarget:y,isEmpty:_,isFocused:ce,isFocusVisible:de,layout:e.layout||"stack",orientation:o,state:u},dl=k({...e,children:void 0,defaultClassName:"react-aria-ListBox",values:fe}),be=null;_&&e.renderEmptyState&&(be=f.createElement("div",{role:"option",style:{display:"contents"}},e.renderEmptyState(fe)));let fl=K(e,{global:!0});return f.createElement(Al,null,f.createElement(w.div,{...R(fl,dl,C,cl,F==null?void 0:F.collectionProps),ref:a,slot:e.slot||void 0,onScroll:e.onScroll,"data-drop-target":y||void 0,"data-empty":_||void 0,"data-focused":ce||void 0,"data-focus-visible":de||void 0,"data-layout":e.layout||"stack","data-orientation":o},f.createElement(ee,{values:[[oe,e],[V,u],[Z,{dragAndDropHooks:t,dragState:M,dropState:D}],[ga,{elementType:"div"}],[al,{render:Fa}],[Fl,{name:"ListBoxSection",render:il}]]},f.createElement(wl,null,f.createElement(h,{collection:n,scrollRef:a,persistedKeys:ya(b,t,D),renderDropIndicator:rl(t,D)}))),be,A))}function il(l,e,a,t="react-aria-ListBoxSection"){let r=s.useContext(V),{dragAndDropHooks:o,dropState:i}=s.useContext(Z),{CollectionBranch:u}=s.useContext(Q),[n,b]=ke(),{headingProps:d,groupProps:$}=Ea({heading:b,"aria-label":l["aria-label"]??void 0}),x=k({...l,id:void 0,children:void 0,defaultClassName:t,values:void 0}),g=K(l,{global:!0});return delete g.id,f.createElement(w.section,{...R(g,x,$),ref:e},f.createElement(ba.Provider,{value:{...d,ref:n}},f.createElement(u,{collection:r.collection,parent:a,renderDropIndicator:rl(o,i)})))}const Ra=Sl(Ml,il),Aa=ze(Kl,function(e,a,t){let r=Le(a),o=s.useContext(V),{dragAndDropHooks:i,dragState:u,dropState:n}=s.useContext(Z),b=u&&!(u.isDisabled||u.selectionManager.isDisabled(t.key)),{optionProps:d,labelProps:$,descriptionProps:x,...g}=Ca({key:t.key,"aria-label":e==null?void 0:e["aria-label"]},o,r),{hoverProps:p,isHovered:v}=Ae({isDisabled:!g.allowsSelection&&!g.hasAction&&!b,onHoverStart:t.props.onHoverStart,onHoverChange:t.props.onHoverChange,onHoverEnd:t.props.onHoverEnd}),{keyboardProps:c}=J(e),{focusProps:m}=kl(e),P=null;u&&i&&(P=i.useDraggableItem({key:t.key,hasAction:g.hasAction},u));let h=null;n&&i&&(h=i.useDroppableItem({target:{type:"item",key:t.key,dropPosition:"on"}},n,r));let E=u&&u.isDragging(t.key),C=k({...e,id:void 0,children:e.children,defaultClassName:"react-aria-ListBoxItem",values:{...g,isHovered:v,selectionMode:o.selectionManager.selectionMode,selectionBehavior:o.selectionManager.selectionBehavior,allowsDragging:!!u,isDragging:E,isDropTarget:h==null?void 0:h.isDropTarget}});s.useEffect(()=>{t.textValue},[t.textValue]);let M=e.href?w.a:w.div,D=K(e,{global:!0});return delete D.id,delete D.onClick,e.href&&d.tabIndex==null&&(d.tabIndex=-1),f.createElement(M,{...R(D,C,d,p,c,m,P==null?void 0:P.dragProps,h==null?void 0:h.dropProps),ref:r,"data-allows-dragging":!!u||void 0,"data-selected":g.isSelected||void 0,"data-disabled":g.isDisabled||void 0,"data-hovered":v||void 0,"data-focused":g.isFocused||void 0,"data-focus-visible":g.isFocusVisible||void 0,"data-pressed":g.isPressed||void 0,"data-dragging":E||void 0,"data-drop-target":(h==null?void 0:h.isDropTarget)||void 0,"data-selection-mode":o.selectionManager.selectionMode==="none"?void 0:o.selectionManager.selectionMode},f.createElement(ee,{values:[[U,{slots:{[Ll]:$,label:$,description:x}}],[zl,{isSelected:g.isSelected}]]},C.children))});function Fa(l,e){e=Le(e);let{dragAndDropHooks:a,dropState:t}=s.useContext(Z),{dropIndicatorProps:r,isHidden:o,isDropTarget:i}=a.useDropIndicator(l,t,e);return o?null:f.createElement(Ka,{...l,dropIndicatorProps:r,isDropTarget:i,ref:e})}function wa(l,e){let{dropIndicatorProps:a,isDropTarget:t,...r}=l,o=k({...r,defaultClassName:"react-aria-DropIndicator",values:{isDropTarget:t}});return f.createElement(f.Fragment,null,f.createElement(w.div,{...a,...o,role:"option",ref:e,"data-drop-target":t||void 0}))}const Ka=s.forwardRef(wa);ze(Il,function(e,a,t){let r=s.useContext(V),{isLoading:o,onLoadMore:i,scrollOffset:u,...n}=e,b=s.useRef(null),d=s.useMemo(()=>({onLoadMore:i,collection:r==null?void 0:r.collection,sentinelRef:b,scrollOffset:u}),[i,u,r==null?void 0:r.collection]);ra(d,b);let $=k({...n,id:void 0,children:t.rendered,defaultClassName:"react-aria-ListBoxLoadingIndicator",values:void 0}),x={tabIndex:-1};return f.createElement(f.Fragment,null,f.createElement("div",{style:{position:"relative",width:0,height:0},inert:Vl(!0)},f.createElement("div",{"data-testid":"loadMoreSentinel",ref:b,style:{position:"absolute",height:1,width:1}})),o&&$.children&&f.createElement(f.Fragment,null,f.createElement(w.div,{...R(K(e,{global:!0}),x),...$,role:"option",ref:a},$.children)))});function ka(l){let{description:e,errorMessage:a,isInvalid:t,validationState:r}=l,{labelProps:o,fieldProps:i}=Ne(l),u=O([!!e,!!a,t,r]),n=O([!!e,!!a,t,r]);return i=R(i,{"aria-describedby":[u,n,l["aria-describedby"]].filter(Boolean).join(" ")||void 0}),{labelProps:o,fieldProps:i,descriptionProps:{id:u},errorMessageProps:{id:n}}}const ie=new WeakMap;function za(l,e,a){let{keyboardDelegate:t,isDisabled:r,isRequired:o,name:i,form:u,validationBehavior:n="aria"}=l,b=ae({usage:"search",sensitivity:"base"}),d=s.useMemo(()=>t||new le(e.collection,e.disabledKeys,a,b),[t,e.collection,e.disabledKeys,b,a]),{menuTriggerProps:$,menuProps:x}=xa({isDisabled:r,type:"listbox"},e,a),{keyboardProps:g}=J({shortcuts:{ArrowLeft:()=>{var A,S;if(e.selectionManager.selectionMode==="multiple")return!1;let y=e.selectedKey!=null?(A=d.getKeyAbove)==null?void 0:A.call(d,e.selectedKey):(S=d.getFirstKey)==null?void 0:S.call(d);y!=null&&e.setSelectedKey(y)},ArrowRight:()=>{var A,S;if(e.selectionManager.selectionMode==="multiple")return!1;let y=e.selectedKey!=null?(A=d.getKeyBelow)==null?void 0:A.call(d,e.selectedKey):(S=d.getFirstKey)==null?void 0:S.call(d);y!=null&&e.setSelectedKey(y)}},allowRepeats:!0,onKeyDown:l.onKeyDown,onKeyUp:l.onKeyUp}),{typeSelectProps:p}=Tl({keyboardDelegate:d,selectionManager:e.selectionManager,onTypeSelect(y){e.setSelectedKey(y)}}),{isInvalid:v,validationErrors:c,validationDetails:m}=e.displayValidation,{labelProps:P,fieldProps:h,descriptionProps:E,errorMessageProps:C}=ka({...l,labelElementType:"span",isInvalid:v,errorMessage:l.errorMessage||c});e.selectionManager.selectionMode==="multiple"&&(p={});let M=K(l,{labelable:!0}),D=R(p,$,h),F=z();return ie.set(e,{isDisabled:r,isRequired:o,name:i,form:u,validationBehavior:n}),{labelProps:{...P,onClick:()=>{var y;l.isDisabled||((y=a.current)==null||y.focus(),jl("keyboard"))}},triggerProps:R(M,{...D,isDisabled:r,onKeyDown:Re(D.onKeyDown,g.onKeyDown),onKeyUp:g.onKeyUp,"aria-labelledby":[F,D["aria-labelledby"],D["aria-label"]&&!D["aria-labelledby"]?D.id:null].filter(Boolean).join(" "),onFocus(y){e.isFocused||(l.onFocus&&l.onFocus(y),l.onFocusChange&&l.onFocusChange(!0),e.setFocused(!0))},onBlur(y){e.isOpen||(l.onBlur&&l.onBlur(y),l.onFocusChange&&l.onFocusChange(!1),e.setFocused(!1))}}),valueProps:{id:F},menuProps:{...x,onAction:void 0,autoFocus:e.focusStrategy||!0,shouldSelectOnPressUp:!0,shouldFocusOnHover:!0,disallowEmptySelection:!0,linkBehavior:"selection",onBlur:y=>{Nl(y.currentTarget,y.relatedTarget)||(l.onBlur&&l.onBlur(y),l.onFocusChange&&l.onFocusChange(!1),e.setFocused(!1))},"aria-labelledby":[h["aria-labelledby"],D["aria-label"]&&!h["aria-labelledby"]?D.id:null].filter(Boolean).join(" ")},descriptionProps:E,errorMessageProps:C,isInvalid:v,validationErrors:c,validationDetails:m,hiddenSelectProps:{isDisabled:r,name:i,label:l.label,state:e,triggerRef:a,form:u}}}function La(l,e,a){let t=ie.get(e)||{},{autoComplete:r,name:o=t.name,form:i=t.form,isDisabled:u=t.isDisabled}=l,{validationBehavior:n,isRequired:b}=t,{visuallyHiddenProps:d}=Ol({style:{position:"fixed",top:0,left:0}});Ul(l.selectRef,e.defaultValue,e.setValue),Zl({validationBehavior:n,focus:()=>{var g;return(g=a.current)==null?void 0:g.focus()}},e,l.selectRef);let $=e.setValue,x=s.useCallback(g=>{let p=Me(g);p.multiple?$(Array.from(p.selectedOptions,v=>v.value)):$(g.currentTarget.value)},[$]);return{containerProps:{...d,"aria-hidden":!0,"data-react-aria-prevent-focus":!0,"data-a11y-ignore":"aria-hidden-focus"},inputProps:{style:{display:"none"}},selectProps:{tabIndex:-1,autoComplete:r,disabled:u,multiple:e.selectionManager.selectionMode==="multiple",required:n==="native"&&b,name:o,form:i,value:e.value??"",onChange:x,onInput:x}}}function Ia(l){let{state:e,triggerRef:a,label:t,name:r,form:o,isDisabled:i}=l,u=s.useRef(null),n=s.useRef(null),{containerProps:b,selectProps:d}=La({...l,selectRef:e.collection.size<=300?u:n},e,a),$=Array.isArray(e.value)?e.value:[e.value];if(e.collection.size<=300)return f.createElement("div",{...b,"data-testid":"hidden-select-container"},f.createElement("label",null,t,f.createElement("select",{...d,ref:u},f.createElement("option",{value:"",label:" "}," "),[...e.collection.getKeys()].map(x=>{let g=e.collection.getItem(x);if(g&&g.type==="item")return f.createElement("option",{key:g.key,value:g.key},g.textValue)}),e.collection.size===0&&r&&$.map((x,g)=>f.createElement("option",{key:g,value:x??""})))));if(r){let x=ie.get(e)||{},{validationBehavior:g}=x;$.length===0&&($=[null]);let p=$.map((v,c)=>{let m={type:"hidden",autoComplete:d.autoComplete,name:r,form:o,disabled:i,value:v??""};return g==="native"?f.createElement("input",{key:c,...m,ref:c===0?n:null,style:{display:"none"},type:"text",required:c===0?d.required:!1,onChange:()=>{}}):f.createElement("input",{key:c,...m,ref:c===0?n:null})});return f.createElement(f.Fragment,null,p)}return null}function Va(l){let{selectionMode:e="single",shouldCloseOnSelect:a=e==="single"}=l,t=_l(l),[r,o]=s.useState(null),i=s.useMemo(()=>l.defaultValue!==void 0?l.defaultValue:e==="single"?l.defaultSelectedKey??null:[],[l.defaultValue,l.defaultSelectedKey,e]),u=s.useMemo(()=>l.value!==void 0?l.value:e==="single"?l.selectedKey:void 0,[l.value,l.selectedKey,e]),[n,b]=ql(u,i,l.onChange),d=e==="single"&&Array.isArray(n)?n[0]:n,$=h=>{var E;if(e==="single"){let C=Array.isArray(h)?h[0]??null:h;b(C),C!==d&&((E=l.onSelectionChange)==null||E.call(l,C))}else{let C=[];Array.isArray(h)?C=h:h!=null&&(C=[h]),b(C)}},x=Ke({...l,selectionMode:e,disallowEmptySelection:e==="single",allowDuplicateSelectionEvents:!0,selectedKeys:s.useMemo(()=>Ta(d),[d]),onSelectionChange:h=>{if(h!=="all"){if(e==="single"){let E=h.values().next().value??null;$(E)}else $([...h]);a&&t.close(),v.commitValidation()}}}),g=x.selectionManager.firstSelectedKey,p=s.useMemo(()=>[...x.selectionManager.selectedKeys].map(h=>x.collection.getItem(h)).filter(h=>h!=null),[x.selectionManager.selectedKeys,x.collection]),v=Wl({...l,value:Array.isArray(d)&&d.length===0?null:d}),[c,m]=s.useState(!1),[P]=s.useState(d);return{...v,...x,...t,value:d,defaultValue:i??P,setValue:$,selectedKey:g,setSelectedKey:$,selectedItem:p[0]??null,selectedItems:p,defaultSelectedKey:l.defaultSelectedKey??(l.selectionMode==="single"?P:null),focusStrategy:r,open(h=null){(x.collection.size!==0||l.allowsEmptyCollection)&&(o(h),t.open())},toggle(h=null){(x.collection.size!==0||l.allowsEmptyCollection)&&(o(h),t.toggle())},isFocused:c,setFocused:m}}function Ta(l){if(l!==void 0)return l===null?[]:Array.isArray(l)?l:[l]}function Na(l={}){let{locale:e}=H();return s.useMemo(()=>new Intl.ListFormat(e,l),[e,l])}function ja(l){return l&&l.__esModule?l.default:l}const se=s.createContext(null),ne=s.createContext(null),Oa=X(function(e,a){[e,a]=T(e,a,se);let{children:t,isDisabled:r=!1,isInvalid:o=!1,isRequired:i=!1}=e,u=s.useMemo(()=>typeof t=="function"?t({isOpen:!1,isDisabled:r,isInvalid:o,isRequired:i,isFocused:!1,isFocusVisible:!1,defaultChildren:null}):t,[t,r,o,i]);return f.createElement(Fe,{content:u},n=>f.createElement(Za,{props:e,collection:n,selectRef:a}))}),Ua=[te,Ve,U];function Za({props:l,selectRef:e,collection:a}){let{validationBehavior:t}=Ie(Gl)||{},r=l.validationBehavior??t??"native",o=Va({...l,collection:a,children:void 0,validationBehavior:r}),{isFocusVisible:i,focusProps:u}=we({within:!0}),n=s.useRef(null),[b,d]=ke(!l["aria-label"]&&!l["aria-labelledby"]),{labelProps:$,triggerProps:x,valueProps:g,menuProps:p,descriptionProps:v,errorMessageProps:c,hiddenSelectProps:m,...P}=za({...Yl(l),label:d,validationBehavior:r},o,n),h=s.useMemo(()=>({isOpen:o.isOpen,isFocused:o.isFocused,isFocusVisible:i,isDisabled:l.isDisabled||!1,isInvalid:P.isInvalid||!1,isRequired:l.isRequired||!1}),[o.isOpen,o.isFocused,i,l.isDisabled,P.isInvalid,l.isRequired]),E=k({...l,values:h,defaultClassName:"react-aria-Select"}),C=K(l,{global:!0});delete C.id;let M=s.useRef(null);return f.createElement(ee,{values:[[se,l],[ne,o],[sl,g],[te,{...$,ref:b,elementType:"span"}],[Ve,{...x,ref:n,isPressed:o.isOpen,autoFocus:l.autoFocus}],[Xl,o],[Jl,{trigger:"Select",triggerRef:n,scrollRef:M,placement:"bottom start","aria-labelledby":p["aria-labelledby"],clearContexts:Ua}],[oe,{...p,ref:M}],[V,o],[U,{slots:{description:v,errorMessage:c}}],[Hl,P]]},f.createElement(w.div,{...R(C,E,u),ref:e,slot:l.slot||void 0,"data-focused":o.isFocused||void 0,"data-focus-visible":i||void 0,"data-open":o.isOpen||void 0,"data-disabled":l.isDisabled||void 0,"data-invalid":P.isInvalid||void 0,"data-required":l.isRequired||void 0},E.children,f.createElement(Ia,{...m,autoComplete:l.autoComplete})))}const sl=s.createContext(null),_a=X(function(e,a){var p;[e,a]=T(e,a,sl);let t=s.useContext(ne),{placeholder:r}=Ie(se),o=t.selectedItems.map(v=>{var m;let c=(m=v.props)==null?void 0:m.children;return typeof c=="function"&&(c=c({isHovered:!1,isPressed:!1,isSelected:!1,isFocused:!1,isFocusVisible:!1,isDisabled:!1,selectionMode:"single",selectionBehavior:"toggle"})),c}),i=Na(),u=s.useMemo(()=>t.selectedItems.map(v=>v==null?void 0:v.textValue),[t.selectedItems]),n=t.selectionManager.selectionMode,b=s.useMemo(()=>n==="single"?u[0]??"":i.format(u),[n,i,u]),d=s.useMemo(()=>{if(n==="single")return o[0];let v=i.formatToParts(u);if(v.length===0)return null;let c=0;return v.map(m=>m.type==="element"?f.createElement(s.Fragment,{key:c},o[c++]):m.value)},[n,i,u,o]),$=Se(ja(ll),"react-aria-components"),x=k({...e,defaultChildren:d??r??$.format("selectPlaceholder"),defaultClassName:"react-aria-SelectValue",values:{selectedItem:((p=t.selectedItems[0])==null?void 0:p.value)??null,selectedItems:s.useMemo(()=>t.selectedItems.map(v=>v.value??null),[t.selectedItems]),selectedText:b,isPlaceholder:t.selectedItems.length===0,state:t}}),g=K(e,{global:!0});return f.createElement(w.span,{ref:a,...g,...x,"data-placeholder":t.selectedItems.length===0||void 0},f.createElement(U.Provider,{value:void 0},x.children))}),qa=s.createContext(!1),Wa=({children:l})=>B.jsx(qa,{value:!0,children:l}),G=new Map;function Ga(l,e,a=!0){const t=Ql();return s.useMemo(()=>{if(e!==void 0)return e;if(!t){if(a&&G.has(l))return G.get(l);try{const r=document.documentElement,o=getComputedStyle(r).getPropertyValue(l).trim()||void 0;return a&&G.set(l,o),o}catch{return}}},[l,e,t,a])}const ye=({animationType:l,className:e,...a})=>{const t=Ga("--skeleton-animation",l),r=f.useMemo(()=>ca({animationType:t}),[t]);return B.jsx(Te.div,{className:r.base({className:e}),...a})},rr=Object.assign(ye,{Root:ye}),Pe=({children:l,className:e,isDisabled:a,isInvalid:t,isRequired:r,...o})=>B.jsx(da,{className:oa({isRequired:r,isDisabled:a,isInvalid:t,className:e}),"data-slot":"label",...o,children:l}),or=Object.assign(Pe,{Root:Pe}),nl=s.createContext({}),De=({children:l,className:e,variant:a,...t})=>{const r=f.useMemo(()=>sa({variant:a}),[a]);return B.jsx(Aa,{className:I(e,r.item()),"data-slot":"list-box-item",...t,children:o=>B.jsx(nl,{value:{slots:r,state:o},children:typeof l=="function"?l(o):l})})},ul=({children:l,className:e,...a})=>{const{slots:t,state:r}=s.use(nl),o=r==null?void 0:r.isSelected,i=typeof l=="function"?l(r??{}):l||B.jsx("svg",{"aria-hidden":"true","data-slot":"list-box-item-indicator--checkmark",fill:"none",role:"presentation",stroke:"currentColor",strokeDasharray:22,strokeDashoffset:o?44:66,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,viewBox:"0 0 17 18",children:B.jsx("polyline",{points:"1 9 7 14 15 4"})});return B.jsx(Te.span,{"aria-hidden":"true",className:Y(t==null?void 0:t.indicator,e),"data-slot":"list-box-item-indicator","data-visible":o||void 0,...a,children:i})},Ya=Object.assign(De,{Root:De,Indicator:ul}),Xa=({children:l,className:e,...a})=>{const t=f.useMemo(()=>na({class:typeof e=="string"?e:void 0}),[e]);return B.jsx(Ra,{className:t,...a,children:l})},Ja=Xa;function Be({className:l,variant:e,...a}){const t=f.useMemo(()=>ia({variant:e}),[e]);return B.jsx(Sa,{className:I(l,t),"data-slot":"list-box",...a})}const ir=Object.assign(Be,{Root:Be,Item:Ya,ItemIndicator:ul,Section:Ja}),N=s.createContext({}),Ce=({children:l,className:e,fullWidth:a,variant:t,...r})=>{const o=f.useMemo(()=>ua({fullWidth:a,variant:t}),[a,t]);return B.jsx(Wa,{children:B.jsx(N,{value:{slots:o},children:B.jsx(Oa,{"data-slot":"select",...r,className:I(e,o==null?void 0:o.base()),children:i=>B.jsx(B.Fragment,{children:typeof l=="function"?l(i):l})})})})},Ha=({children:l,className:e,...a})=>{const{slots:t}=s.use(N);return B.jsx(aa,{className:I(e,t==null?void 0:t.trigger()),"data-slot":"select-trigger",...a,children:r=>B.jsx(B.Fragment,{children:typeof l=="function"?l(r):l})})},Qa=({children:l,className:e,...a})=>{const{slots:t}=s.use(N);return B.jsx(_a,{className:I(e,t==null?void 0:t.value()),"data-slot":"select-value",...a,children:l})},er=({children:l,className:e,...a})=>{const{slots:t}=s.use(N),r=s.use(ne);return l&&f.isValidElement(l)?f.cloneElement(l,{...a,className:Y(t==null?void 0:t.indicator,e),"data-slot":"select-indicator","data-open":xe(r==null?void 0:r.isOpen)}):B.jsx(la,{className:Y(t==null?void 0:t.indicator,e),"data-open":xe(r==null?void 0:r.isOpen),"data-slot":"select-default-indicator",...a})},tr=({children:l,className:e,placement:a="bottom",...t})=>{const{slots:r}=s.use(N);return B.jsx(ea,{value:{variant:"default"},children:B.jsx(ta,{...t,className:I(e,r==null?void 0:r.popover()),"data-slot":"select-popover",placement:a,children:l})})},sr=Object.assign(Ce,{Root:Ce,Trigger:Ha,Value:Qa,Indicator:er,Popover:tr});export{ka as $,or as L,rr as S,sr as a,ir as b,ar as c,te as d,ve as e,ae as f,Z as g,ra as h,rl as i,fa as j,le as k,al as l,ya as m,ll as n,Ga as u};
1
+ import{r as s,$ as bl,aL as gl,aw as $l,t as L,x as X,y as T,G as w,R as f,ac as z,aA as hl,aV as xl,bR as Ee,H as R,bS as pl,bT as vl,bU as ml,Y as J,U as Se,v as Me,bV as ge,bW as j,aM as $e,ak as H,al as yl,ag as Pl,L as K,bX as Dl,bY as O,ao as Bl,az as Re,z as Ae,au as he,bZ as Cl,aS as Fe,aK as El,aD as Sl,b_ as Ml,b$ as Rl,aF as Q,E as we,F as k,aY as Al,a2 as ee,c0 as Fl,aZ as wl,c1 as Ke,a0 as ke,aO as ze,c2 as Kl,aE as Le,c3 as kl,a4 as U,aI as zl,aJ as Ll,aP as Il,aQ as Vl,c4 as Tl,am as Nl,c5 as jl,aC as Ol,N as Ul,O as Zl,bJ as _l,I as ql,K as Wl,Z as Ie,_ as Gl,a1 as Yl,a3 as Ve,c6 as Xl,c7 as Jl,a6 as Hl,j as B,bH as Ql,b4 as Te,a9 as Y,a7 as I,be as ea,c8 as ta,c9 as xe,ca as la,cb as aa}from"./index-DpG68XJd.js";function ra(l,e){let{collection:a,onLoadMore:t,scrollOffset:r=1,direction:o="end"}=l,i=s.useRef(null),u=bl(n=>{for(let b of n)b.isIntersecting&&t&&t()});gl(()=>{if(e.current){const n=100*r,b=o==="start"?`${n}% 0px 0px 0px`:`0px ${n}% ${n}% ${n}%`;i.current=new IntersectionObserver(u,{root:$l(e==null?void 0:e.current),rootMargin:b}),i.current.observe(e.current)}return()=>{i.current&&i.current.disconnect()}},[a,e,r,o])}const oa=L({base:"label",defaultVariants:{isDisabled:!1,isInvalid:!1,isRequired:!1},variants:{isDisabled:{true:"label--disabled"},isInvalid:{true:"label--invalid"},isRequired:{true:"label--required"}}}),ia=L({base:"list-box",defaultVariants:{variant:"default"},variants:{variant:{danger:"list-box--danger",default:"list-box--default"}}}),sa=L({defaultVariants:{variant:"default"},slots:{indicator:"list-box-item__indicator",item:"list-box-item"},variants:{variant:{danger:{item:"list-box-item--danger"},default:{item:"list-box-item--default"}}}}),na=L({base:"list-box-section"}),ua=L({defaultVariants:{fullWidth:!1,variant:"primary"},slots:{base:"select",indicator:"select__indicator",popover:"select__popover",trigger:"select__trigger",value:"select__value"},variants:{fullWidth:{false:{},true:{base:"select--full-width",trigger:"select__trigger--full-width"}},variant:{primary:{base:"select--primary"},secondary:{base:"select--secondary"}}}}),ca=L({defaultVariants:{animationType:"shimmer"},slots:{base:"skeleton"},variants:{animationType:{none:"skeleton--none",pulse:"skeleton--pulse",shimmer:"skeleton--shimmer"}}}),te=s.createContext({}),da=X(function(e,a){[e,a]=T(e,a,te);let{elementType:t="label",...r}=e,o=w[t];return f.createElement(o,{className:"react-aria-Label",...r,ref:a})});function Ne(l){let{id:e,label:a,"aria-labelledby":t,"aria-label":r,labelElementType:o="label"}=l;e=z(e);let i=z(),u={};a&&(t=t?`${i} ${t}`:i,u={id:i,htmlFor:o==="label"?e:void 0});let n=hl({id:e,"aria-label":r,"aria-labelledby":t});return{labelProps:u,fieldProps:n}}const fa=s.createContext(null),ar=s.createContext(null),ba=s.createContext({}),ga=s.createContext({}),ue=class ue extends xl{filter(e,a){let t=a.getItem(this.prevKey);if(t&&t.type!=="separator"){let r=this.clone();return a.addDescendants(r,e),r}return null}};ue.type="separator";let pe=ue;var je={};je={longPressMessage:"اضغط مطولاً أو اضغط على Alt + السهم لأسفل لفتح القائمة"};var Oe={};Oe={longPressMessage:"Натиснете продължително или натиснете Alt+ стрелка надолу, за да отворите менюто"};var Ue={};Ue={longPressMessage:"Dlouhým stiskem nebo stisknutím kláves Alt + šipka dolů otevřete nabídku"};var Ze={};Ze={longPressMessage:"Langt tryk eller tryk på Alt + pil ned for at åbne menuen"};var _e={};_e={longPressMessage:"Drücken Sie lange oder drücken Sie Alt + Nach-unten, um das Menü zu öffnen"};var qe={};qe={longPressMessage:"Πιέστε παρατεταμένα ή πατήστε Alt + κάτω βέλος για να ανοίξετε το μενού"};var We={};We={longPressMessage:"Long press or press Alt + ArrowDown to open menu"};var Ge={};Ge={longPressMessage:"Mantenga pulsado o pulse Alt + flecha abajo para abrir el menú"};var Ye={};Ye={longPressMessage:"Menüü avamiseks vajutage pikalt või vajutage klahve Alt + allanool"};var Xe={};Xe={longPressMessage:"Avaa valikko painamalla pohjassa tai näppäinyhdistelmällä Alt + Alanuoli"};var Je={};Je={longPressMessage:"Appuyez de manière prolongée ou appuyez sur Alt + Flèche vers le bas pour ouvrir le menu."};var He={};He={longPressMessage:"לחץ לחיצה ארוכה או הקש Alt + ArrowDown כדי לפתוח את התפריט"};var Qe={};Qe={longPressMessage:"Dugo pritisnite ili pritisnite Alt + strelicu prema dolje za otvaranje izbornika"};var et={};et={longPressMessage:"Nyomja meg hosszan, vagy nyomja meg az Alt + lefele nyíl gombot a menü megnyitásához"};var tt={};tt={longPressMessage:"Premi a lungo o premi Alt + Freccia giù per aprire il menu"};var lt={};lt={longPressMessage:"長押しまたは Alt+下矢印キーでメニューを開く"};var at={};at={longPressMessage:"길게 누르거나 Alt + 아래쪽 화살표를 눌러 메뉴 열기"};var rt={};rt={longPressMessage:"Norėdami atidaryti meniu, nuspaudę palaikykite arba paspauskite „Alt + ArrowDown“."};var ot={};ot={longPressMessage:"Lai atvērtu izvēlni, turiet nospiestu vai nospiediet taustiņu kombināciju Alt + lejupvērstā bultiņa"};var it={};it={longPressMessage:"Langt trykk eller trykk Alt + PilNed for å åpne menyen"};var st={};st={longPressMessage:"Druk lang op Alt + pijl-omlaag of druk op Alt om het menu te openen"};var nt={};nt={longPressMessage:"Naciśnij i przytrzymaj lub naciśnij klawisze Alt + Strzałka w dół, aby otworzyć menu"};var ut={};ut={longPressMessage:"Pressione e segure ou pressione Alt + Seta para baixo para abrir o menu"};var ct={};ct={longPressMessage:"Prima continuamente ou prima Alt + Seta Para Baixo para abrir o menu"};var dt={};dt={longPressMessage:"Apăsați lung sau apăsați pe Alt + săgeată în jos pentru a deschide meniul"};var ft={};ft={longPressMessage:"Нажмите и удерживайте или нажмите Alt + Стрелка вниз, чтобы открыть меню"};var bt={};bt={longPressMessage:"Ponuku otvoríte dlhým stlačením alebo stlačením klávesu Alt + klávesu so šípkou nadol"};var gt={};gt={longPressMessage:"Za odprtje menija pritisnite in držite gumb ali pritisnite Alt+puščica navzdol"};var $t={};$t={longPressMessage:"Dugo pritisnite ili pritisnite Alt + strelicu prema dole da otvorite meni"};var ht={};ht={longPressMessage:"Håll nedtryckt eller tryck på Alt + pil nedåt för att öppna menyn"};var xt={};xt={longPressMessage:"Menüyü açmak için uzun basın veya Alt + Aşağı Ok tuşuna basın"};var pt={};pt={longPressMessage:"Довго або звичайно натисніть комбінацію клавіш Alt і стрілка вниз, щоб відкрити меню"};var vt={};vt={longPressMessage:"长按或按 Alt + 向下方向键以打开菜单"};var mt={};mt={longPressMessage:"長按或按 Alt+向下鍵以開啟功能表"};var yt={};yt={"ar-AE":je,"bg-BG":Oe,"cs-CZ":Ue,"da-DK":Ze,"de-DE":_e,"el-GR":qe,"en-US":We,"es-ES":Ge,"et-EE":Ye,"fi-FI":Xe,"fr-FR":Je,"he-IL":He,"hr-HR":Qe,"hu-HU":et,"it-IT":tt,"ja-JP":lt,"ko-KR":at,"lt-LT":rt,"lv-LV":ot,"nb-NO":it,"nl-NL":st,"pl-PL":nt,"pt-BR":ut,"pt-PT":ct,"ro-RO":dt,"ru-RU":ft,"sk-SK":bt,"sl-SI":gt,"sr-SP":$t,"sv-SE":ht,"tr-TR":xt,"uk-UA":pt,"zh-CN":vt,"zh-TW":mt};function $a(l){let{onContextMenu:e}=l,a=s.useRef(!1),{longPressProps:t}=Ee({onLongPressStart(){a.current=!1},onLongPress(r){a.current?a.current=!1:e==null||e({target:r.target,x:r.x,y:r.y})}});return e?{contextMenuProps:R(pl()?t:{},{onContextMenu(r){r.stopPropagation(),r.preventDefault(),a.current=!0;let o=r.currentTarget.getBoundingClientRect();e({target:r.currentTarget,x:r.clientX-o.x,y:r.clientY-o.y})},onKeyDown(r){if(vl()&&r.ctrlKey&&r.key==="Enter"){a.current=!1;let o=r.currentTarget;r.stopPropagation(),setTimeout(()=>{if(a.current)a.current=!1;else{let i=o.getBoundingClientRect();e({target:o,x:i.width/2,y:i.height/2})}},10)}}})}:{contextMenuProps:{}}}function ha(l){return l&&l.__esModule?l.default:l}function xa(l,e,a){let{type:t="menu",isDisabled:r,trigger:o="press"}=l,i=z(),{triggerProps:u,overlayProps:n}=ml({type:t},e,a),b=(c,m,P="first")=>{if(!c||m.isDefaultPrevented())return!1;e.toggle(P)},{keyboardProps:d}=J({isDisabled:r,shortcuts:{Enter:c=>b(o!=="longPress",c,"first")," ":c=>b(o!=="longPress",c,"first"),ArrowDown:c=>b(o!=="longPress",c,"first"),ArrowUp:c=>b(o!=="longPress",c,"last"),"Alt+Enter":c=>b(o==="longPress",c,"first"),"Alt+ ":c=>b(o==="longPress",c,"first"),"Alt+ArrowDown":c=>b(!0,c,"first"),"Alt+ArrowUp":c=>b(!0,c,"last")}}),$=Se(ha(yt),"@react-aria/menu"),{longPressProps:x}=Ee({isDisabled:r||o!=="longPress",accessibilityDescription:$.format("longPressMessage"),onLongPressStart(){e.close()},onLongPress(){e.open("first")}}),g={preventFocusOnPress:!0,onPressStart(c){c.pointerType!=="touch"&&c.pointerType!=="keyboard"&&!r&&(ge(c.target),e.open(c.pointerType==="virtual"?"first":null))},onPress(c){c.pointerType==="touch"&&!r&&(ge(c.target),e.toggle())}};delete u.onPress;let{contextMenuProps:p}=$a({onContextMenu(c){let m=c.target.getBoundingClientRect();e.setPoint({x:m.x+c.x,y:m.y+c.y}),e.open()}});s.useEffect(()=>{if(e.isOpen&&o==="contextMenu"){let c=m=>{(m.button===2||m.button===0&&m.ctrlKey===!0)&&Me(m)===document.body&&e.close()};return document.addEventListener("mousedown",c),()=>document.removeEventListener("mousedown",c)}},[e,o]);let v;if(o==="press")v={...g,...d};else if(o==="longPress")v={...x,...d};else if(o==="contextMenu"){v=p;let{"aria-haspopup":c,"aria-expanded":m,"aria-controls":P,...h}=u;u=h}return{menuTriggerProps:{...u,...v,id:i},menuProps:{...n,"aria-labelledby":i,autoFocus:e.focusStrategy||!0,onClose:e.close}}}class ve{constructor(e){this.ref=e}getItemRect(e){let a=this.ref.current;if(!a)return null;let t=e!=null?j(this.ref,e):null;if(!t)return null;let r=a.getBoundingClientRect(),o=t.getBoundingClientRect();return{x:o.left-r.left-a.clientLeft+a.scrollLeft,y:o.top-r.top-a.clientTop+a.scrollTop,width:o.width,height:o.height}}getContentSize(){let e=this.ref.current;return{width:(e==null?void 0:e.scrollWidth)??0,height:(e==null?void 0:e.scrollHeight)??0}}getVisibleRect(){let e=this.ref.current;return{x:(e==null?void 0:e.scrollLeft)??0,y:(e==null?void 0:e.scrollTop)??0,width:(e==null?void 0:e.clientWidth)??0,height:(e==null?void 0:e.clientHeight)??0}}}class le{constructor(...e){if(e.length===1){let a=e[0];this.collection=a.collection,this.ref=a.ref,this.collator=a.collator,this.disabledKeys=a.disabledKeys||new Set,this.disabledBehavior=a.disabledBehavior||"all",this.orientation=a.orientation||"vertical",this.direction=a.direction,this.layout=a.layout||"stack",this.layoutDelegate=a.layoutDelegate||new ve(a.ref)}else this.collection=e[0],this.disabledKeys=e[1],this.ref=e[2],this.collator=e[3],this.layout="stack",this.orientation="vertical",this.disabledBehavior="all",this.layoutDelegate=new ve(this.ref);this.layout==="stack"&&this.orientation==="vertical"&&(this.getKeyLeftOf=void 0,this.getKeyRightOf=void 0)}isDisabled(e){var a,t;return this.disabledBehavior==="all"&&(((a=e.props)==null?void 0:a.isDisabled)||this.disabledKeys.has(e.key))&&((t=e.props)==null?void 0:t.disabledBehavior)!=="selection"}findNextNonDisabled(e,a,t=!1){let r=e;for(;r!=null;){let o=this.collection.getItem(r);if((o==null?void 0:o.type)==="item"&&(t||!this.isDisabled(o)))return r;r=a(r)}return null}getNextKey(e,a){let t=e;return t=this.collection.getKeyAfter(t),this.findNextNonDisabled(t,r=>this.collection.getKeyAfter(r),a==null?void 0:a.includeDisabled)}getPreviousKey(e,a){let t=e;return t=this.collection.getKeyBefore(t),this.findNextNonDisabled(t,r=>this.collection.getKeyBefore(r),a==null?void 0:a.includeDisabled)}findKey(e,a,t){let r=e,o=this.layoutDelegate.getItemRect(r);if(!o||r==null)return null;let i=o;do{if(r=a(r),r==null)break;o=this.layoutDelegate.getItemRect(r)}while(o&&t(i,o)&&r!=null);return r}isSameRow(e,a){return e.y===a.y||e.x!==a.x}isSameColumn(e,a){return e.x===a.x||e.y!==a.y}isReversed(e){let a=this.getNextKey(e),t=j(this.ref,e);if(a!=null){let o=j(this.ref,a);return!t||!o?!1:t.getBoundingClientRect().top>o.getBoundingClientRect().top}let r=this.getPreviousKey(e);if(r!=null){let o=j(this.ref,r);return!t||!o?!1:o.getBoundingClientRect().top>t.getBoundingClientRect().top}return!1}getKeyBelow(e,a){return this.layout==="grid"&&this.orientation==="vertical"?this.findKey(e,t=>this.getNextKey(t,a),this.isSameRow):this.orientation==="vertical"?this.isReversed(e)?this.getPreviousKey(e,a):this.getNextKey(e,a):this.getNextKey(e,a)}getKeyAbove(e,a){return this.layout==="grid"&&this.orientation==="vertical"?this.findKey(e,t=>this.getPreviousKey(t,a),this.isSameRow):this.orientation==="vertical"?this.isReversed(e)?this.getNextKey(e,a):this.getPreviousKey(e,a):this.getPreviousKey(e,a)}getNextColumn(e,a,t){return a?this.getPreviousKey(e,t):this.getNextKey(e,t)}getKeyRightOf(e,a){let t=this.direction==="ltr"?"getKeyRightOf":"getKeyLeftOf";return this.layoutDelegate[t]?(e=this.layoutDelegate[t](e),this.findNextNonDisabled(e,r=>this.layoutDelegate[t](r),a==null?void 0:a.includeDisabled)):this.layout==="grid"?this.orientation==="vertical"?this.getNextColumn(e,this.direction==="rtl",a):this.findKey(e,r=>this.getNextColumn(r,this.direction==="rtl",a),this.isSameColumn):this.orientation==="horizontal"?this.getNextColumn(e,this.direction==="rtl",a):null}getKeyLeftOf(e,a){let t=this.direction==="ltr"?"getKeyLeftOf":"getKeyRightOf";return this.layoutDelegate[t]?(e=this.layoutDelegate[t](e),this.findNextNonDisabled(e,r=>this.layoutDelegate[t](r),a==null?void 0:a.includeDisabled)):this.layout==="grid"?this.orientation==="vertical"?this.getNextColumn(e,this.direction==="ltr",a):this.findKey(e,r=>this.getNextColumn(r,this.direction==="ltr",a),this.isSameColumn):this.orientation==="horizontal"?this.getNextColumn(e,this.direction==="ltr",a):null}getFirstKey(){let e=this.collection.getFirstKey();return this.findNextNonDisabled(e,a=>this.collection.getKeyAfter(a))}getLastKey(){let e=this.collection.getLastKey();return this.findNextNonDisabled(e,a=>this.collection.getKeyBefore(a))}getKeyPageAbove(e){let a=this.ref.current,t=this.layoutDelegate.getItemRect(e);if(!t)return null;let r=this.isReversed(e);if(a&&!$e(a))return this.getFirstKey();let o=e;if(this.orientation==="horizontal"){let i=Math.max(0,t.x+t.width-this.layoutDelegate.getVisibleRect().width);for(;t&&t.x>i&&o!=null;)o=this.getKeyAbove(o),t=o==null?null:this.layoutDelegate.getItemRect(o)}else{let i=this.layoutDelegate.getVisibleRect(),u=r?t.y-i.height:Math.max(0,t.y+t.height-i.height);for(;t&&t.y>u&&o!=null;)o=this.getKeyAbove(o),t=o==null?null:this.layoutDelegate.getItemRect(o)}return o??(r?this.getLastKey():this.getFirstKey())}getKeyPageBelow(e){let a=this.ref.current,t=this.layoutDelegate.getItemRect(e);if(!t)return null;let r=this.isReversed(e);if(a&&!$e(a))return this.getLastKey();let o=e;if(this.orientation==="horizontal"){let i=Math.min(this.layoutDelegate.getContentSize().width,t.x-t.width+this.layoutDelegate.getVisibleRect().width);for(;t&&t.x<i&&o!=null;)o=this.getKeyBelow(o),t=o==null?null:this.layoutDelegate.getItemRect(o)}else{let i=Math.min(this.layoutDelegate.getContentSize().height,t.y-t.height+this.layoutDelegate.getVisibleRect().height);for(;t&&t.y<i&&o!=null;)o=this.getKeyBelow(o),t=o==null?null:this.layoutDelegate.getItemRect(o)}return o??(r?this.getFirstKey():this.getLastKey())}getKeyForSearch(e,a){if(!this.collator)return null;let t=this.collection,r=a||this.getFirstKey();for(;r!=null;){let o=t.getItem(r);if(!o)return null;let i=o.textValue.slice(0,e.length);if(o.textValue&&this.collator.compare(i,e)===0)return r;r=this.getNextKey(r)}return null}}let W=new Map;function ae(l){let{locale:e}=H(),a=e+(l?Object.entries(l).sort((r,o)=>r[0]<o[0]?-1:1).join():"");if(W.has(a))return W.get(a);let t=new Intl.Collator(e,l);return W.set(a,t),t}function pa(l){let{selectionManager:e,collection:a,disabledKeys:t,ref:r,keyboardDelegate:o,layoutDelegate:i,orientation:u}=l,n=ae({usage:"search",sensitivity:"base"}),b=e.disabledBehavior,d=s.useMemo(()=>o||new le({collection:a,disabledKeys:t,disabledBehavior:b,ref:r,collator:n,layoutDelegate:i,orientation:u}),[o,i,a,t,r,n,b,u]),{collectionProps:$}=yl({...l,ref:r,selectionManager:e,keyboardDelegate:d});return{listProps:$}}const me=new WeakMap;function va(l){let e=me.get(l);if(e!=null)return e;let a=0,t=r=>{for(let o of r)o.type==="section"?t(Pl(o,l)):o.type==="item"&&a++};return t(l),me.set(l,a),a}var Pt={};Pt={colorSwatchPicker:"تغييرات الألوان",dropzoneLabel:"DropZone",selectPlaceholder:"حدد عنصرًا",tableResizer:"أداة تغيير الحجم"};var Dt={};Dt={colorSwatchPicker:"Цветови мостри",dropzoneLabel:"DropZone",selectPlaceholder:"Изберете предмет",tableResizer:"Преоразмерител"};var Bt={};Bt={colorSwatchPicker:"Vzorky barev",dropzoneLabel:"Místo pro přetažení",selectPlaceholder:"Vyberte položku",tableResizer:"Změna velikosti"};var Ct={};Ct={colorSwatchPicker:"Farveprøver",dropzoneLabel:"DropZone",selectPlaceholder:"Vælg et element",tableResizer:"Størrelsesændring"};var Et={};Et={colorSwatchPicker:"Farbfelder",dropzoneLabel:"Ablegebereich",selectPlaceholder:"Element wählen",tableResizer:"Größenanpassung"};var St={};St={colorSwatchPicker:"Χρωματικά δείγματα",dropzoneLabel:"DropZone",selectPlaceholder:"Επιλέξτε ένα αντικείμενο",tableResizer:"Αλλαγή μεγέθους"};var Mt={};Mt={selectPlaceholder:"Select an item",tableResizer:"Resizer",dropzoneLabel:"DropZone",colorSwatchPicker:"Color swatches"};var Rt={};Rt={colorSwatchPicker:"Muestras de colores",dropzoneLabel:"DropZone",selectPlaceholder:"Seleccionar un artículo",tableResizer:"Cambiador de tamaño"};var At={};At={colorSwatchPicker:"Värvinäidised",dropzoneLabel:"DropZone",selectPlaceholder:"Valige üksus",tableResizer:"Suuruse muutja"};var Ft={};Ft={colorSwatchPicker:"Värimallit",dropzoneLabel:"DropZone",selectPlaceholder:"Valitse kohde",tableResizer:"Koon muuttaja"};var wt={};wt={colorSwatchPicker:"Échantillons de couleurs",dropzoneLabel:"DropZone",selectPlaceholder:"Sélectionner un élément",tableResizer:"Redimensionneur"};var Kt={};Kt={colorSwatchPicker:"דוגמיות צבע",dropzoneLabel:"DropZone",selectPlaceholder:"בחר פריט",tableResizer:"שינוי גודל"};var kt={};kt={colorSwatchPicker:"Uzorci boja",dropzoneLabel:"Zona spuštanja",selectPlaceholder:"Odaberite stavku",tableResizer:"Promjena veličine"};var zt={};zt={colorSwatchPicker:"Színtárak",dropzoneLabel:"DropZone",selectPlaceholder:"Válasszon ki egy elemet",tableResizer:"Átméretező"};var Lt={};Lt={colorSwatchPicker:"Campioni di colore",dropzoneLabel:"Zona di rilascio",selectPlaceholder:"Seleziona un elemento",tableResizer:"Ridimensionamento"};var It={};It={colorSwatchPicker:"カラースウォッチ",dropzoneLabel:"ドロップゾーン",selectPlaceholder:"項目を選択",tableResizer:"サイズ変更ツール"};var Vt={};Vt={colorSwatchPicker:"색상 견본",dropzoneLabel:"드롭 영역",selectPlaceholder:"항목 선택",tableResizer:"크기 조정기"};var Tt={};Tt={colorSwatchPicker:"Spalvų pavyzdžiai",dropzoneLabel:"„DropZone“",selectPlaceholder:"Pasirinkite elementą",tableResizer:"Dydžio keitiklis"};var Nt={};Nt={colorSwatchPicker:"Krāsu paraugi",dropzoneLabel:"DropZone",selectPlaceholder:"Izvēlēties vienumu",tableResizer:"Izmēra mainītājs"};var jt={};jt={colorSwatchPicker:"Fargekart",dropzoneLabel:"Droppsone",selectPlaceholder:"Velg et element",tableResizer:"Størrelsesendrer"};var Ot={};Ot={colorSwatchPicker:"kleurstalen",dropzoneLabel:"DropZone",selectPlaceholder:"Selecteer een item",tableResizer:"Resizer"};var Ut={};Ut={colorSwatchPicker:"Próbki kolorów",dropzoneLabel:"Strefa upuszczania",selectPlaceholder:"Wybierz element",tableResizer:"Zmiana rozmiaru"};var Zt={};Zt={colorSwatchPicker:"Amostras de cores",dropzoneLabel:"DropZone",selectPlaceholder:"Selecione um item",tableResizer:"Redimensionador"};var _t={};_t={colorSwatchPicker:"Amostras de cores",dropzoneLabel:"DropZone",selectPlaceholder:"Selecione um item",tableResizer:"Redimensionador"};var qt={};qt={colorSwatchPicker:"Specimene de culoare",dropzoneLabel:"Zonă de plasare",selectPlaceholder:"Selectați un element",tableResizer:"Instrument de redimensionare"};var Wt={};Wt={colorSwatchPicker:"Цветовые образцы",dropzoneLabel:"DropZone",selectPlaceholder:"Выберите элемент",tableResizer:"Средство изменения размера"};var Gt={};Gt={colorSwatchPicker:"Vzorkovníky farieb",dropzoneLabel:"DropZone",selectPlaceholder:"Vyberte položku",tableResizer:"Nástroj na zmenu veľkosti"};var Yt={};Yt={colorSwatchPicker:"Barvne palete",dropzoneLabel:"DropZone",selectPlaceholder:"Izberite element",tableResizer:"Spreminjanje velikosti"};var Xt={};Xt={colorSwatchPicker:"Uzorci boje",dropzoneLabel:"DropZone",selectPlaceholder:"Izaberite stavku",tableResizer:"Promena veličine"};var Jt={};Jt={colorSwatchPicker:"Färgrutor",dropzoneLabel:"DropZone",selectPlaceholder:"Välj en artikel",tableResizer:"Storleksändrare"};var Ht={};Ht={colorSwatchPicker:"Renk örnekleri",dropzoneLabel:"Bırakma Bölgesi",selectPlaceholder:"Bir öğe seçin",tableResizer:"Yeniden boyutlandırıcı"};var Qt={};Qt={colorSwatchPicker:"Зразки кольорів",dropzoneLabel:"DropZone",selectPlaceholder:"Виберіть елемент",tableResizer:"Засіб змінення розміру"};var el={};el={colorSwatchPicker:"颜色色板",dropzoneLabel:"放置区域",selectPlaceholder:"选择一个项目",tableResizer:"尺寸调整器"};var tl={};tl={colorSwatchPicker:"色票",dropzoneLabel:"放置區",selectPlaceholder:"選取項目",tableResizer:"大小調整器"};var ll={};ll={"ar-AE":Pt,"bg-BG":Dt,"cs-CZ":Bt,"da-DK":Ct,"de-DE":Et,"el-GR":St,"en-US":Mt,"es-ES":Rt,"et-EE":At,"fi-FI":Ft,"fr-FR":wt,"he-IL":Kt,"hr-HR":kt,"hu-HU":zt,"it-IT":Lt,"ja-JP":It,"ko-KR":Vt,"lt-LT":Tt,"lv-LV":Nt,"nb-NO":jt,"nl-NL":Ot,"pl-PL":Ut,"pt-BR":Zt,"pt-PT":_t,"ro-RO":qt,"ru-RU":Wt,"sk-SK":Gt,"sl-SI":Yt,"sr-SP":Xt,"sv-SE":Jt,"tr-TR":Ht,"uk-UA":Qt,"zh-CN":el,"zh-TW":tl};const Z=s.createContext({}),al=s.createContext(null),ma=s.forwardRef(function(e,a){let{render:t}=s.useContext(al);return f.createElement(f.Fragment,null,t(e,a))});function rl(l,e){var o;let a=l==null?void 0:l.renderDropIndicator,t=(o=l==null?void 0:l.isVirtualDragging)==null?void 0:o.call(l),r=s.useCallback(i=>{if(t||e!=null&&e.isDropTarget(i))return a?a(i):f.createElement(ma,{target:i})},[e==null?void 0:e.target,t,a]);return l!=null&&l.useDropIndicator?r:void 0}function ya(l,e,a){var o,i,u;let t=l.focusedKey,r=null;if((o=e==null?void 0:e.isVirtualDragging)!=null&&o.call(e)&&((i=a==null?void 0:a.target)==null?void 0:i.type)==="item"&&(r=a.target.key,a.target.dropPosition==="after")){let n=a.collection.getKeyAfter(r),b=null;if(n!=null){let d=((u=a.collection.getItem(r))==null?void 0:u.level)??0;for(;n!=null;){let $=a.collection.getItem(n);if(!$)break;if($.type!=="item"){n=a.collection.getKeyAfter(n);continue}if(($.level??0)<=d)break;b=n,n=a.collection.getKeyAfter(n)}}r=n??b??r}return s.useMemo(()=>new Set([t,r].filter(n=>n!=null)),[t,r])}const re=new WeakMap;function Pa(l){return typeof l=="string"?l.replace(/\s*/g,""):""+l}function Da(l,e){let a=re.get(l);if(!a)throw new Error("Unknown list");return`${a.id}-option-${Pa(e)}`}function Ba(l,e,a){let t=K(l,{labelable:!0}),r=l.selectionBehavior||"toggle",o=l.orientation||"vertical",i=l.linkBehavior||(r==="replace"?"action":"override");r==="toggle"&&i==="action"&&(i="override");let{listProps:u}=pa({...l,ref:a,selectionManager:e.selectionManager,collection:e.collection,disabledKeys:e.disabledKeys,linkBehavior:i}),{focusWithinProps:n}=Dl({onFocusWithin:l.onFocus,onBlurWithin:l.onBlur,onFocusWithinChange:l.onFocusChange}),b=z(l.id);re.set(e,{id:b,shouldUseVirtualFocus:l.shouldUseVirtualFocus,shouldSelectOnPressUp:l.shouldSelectOnPressUp,shouldFocusOnHover:l.shouldFocusOnHover,isVirtualized:l.isVirtualized,onAction:l.onAction,linkBehavior:i,UNSTABLE_itemBehavior:l.UNSTABLE_itemBehavior});let{labelProps:d,fieldProps:$}=Ne({...l,id:b,labelElementType:"span"});return{labelProps:d,listBoxProps:R(t,n,e.selectionManager.selectionMode==="multiple"?{"aria-multiselectable":"true"}:{},{role:"listbox","aria-orientation":o,...R($,u)})}}function Ca(l,e,a){var y,A;let{key:t}=l,r=re.get(e),o=l.isDisabled??e.selectionManager.isDisabled(t),i=l.isSelected??e.selectionManager.isSelected(t),u=l.shouldSelectOnPressUp??(r==null?void 0:r.shouldSelectOnPressUp),n=l.shouldFocusOnHover??(r==null?void 0:r.shouldFocusOnHover),b=l.shouldUseVirtualFocus??(r==null?void 0:r.shouldUseVirtualFocus),d=l.isVirtualized??(r==null?void 0:r.isVirtualized),$=O(),x=O(),g={role:"option","aria-disabled":o||void 0,"aria-selected":e.selectionManager.selectionMode!=="none"?i:void 0,"aria-label":l["aria-label"],"aria-labelledby":$,"aria-describedby":x},p=e.collection.getItem(t);if(d){let S=Number(p==null?void 0:p.index);g["aria-posinset"]=Number.isNaN(S)?void 0:S+1,g["aria-setsize"]=va(e.collection)}let v=r!=null&&r.onAction?()=>{var S;return(S=r==null?void 0:r.onAction)==null?void 0:S.call(r,t)}:void 0,c=Da(e,t),{itemProps:m,isPressed:P,isFocused:h,hasAction:E,allowsSelection:C}=Bl({selectionManager:e.selectionManager,key:t,ref:a,shouldSelectOnPressUp:u,allowsDifferentPressOrigin:u&&n,isVirtualized:d,shouldUseVirtualFocus:b,isDisabled:o,onAction:v||(y=p==null?void 0:p.props)!=null&&y.onAction?Re((A=p==null?void 0:p.props)==null?void 0:A.onAction,v):void 0,linkBehavior:r==null?void 0:r.linkBehavior,UNSTABLE_itemBehavior:r==null?void 0:r.UNSTABLE_itemBehavior,id:c}),{hoverProps:M}=Ae({isDisabled:o||!n,onHoverStart(){he()||(e.selectionManager.setFocused(!0),e.selectionManager.setFocusedKey(t))}}),D=K(p==null?void 0:p.props);delete D.id;let F=Cl(p==null?void 0:p.props);return{optionProps:{...g,...R(D,m,M,F),id:c},labelProps:{id:$},descriptionProps:{id:x},isFocused:h,isFocusVisible:h&&e.selectionManager.isFocused&&he(),isSelected:i,isDisabled:o,isPressed:P,allowsSelection:C,hasAction:E}}function Ea(l){let{heading:e,"aria-label":a}=l,t=z();return{itemProps:{role:"presentation"},headingProps:e?{id:t,role:"presentation",onMouseDown:r=>{r.preventDefault()}}:{},groupProps:{role:"group","aria-label":a,"aria-labelledby":e?t:void 0}}}const oe=s.createContext(null),V=s.createContext(null),Sa=s.forwardRef(function(e,a){[e,a]=T(e,a,oe);let t=s.useContext(V);return t?f.createElement(ol,{state:t,props:e,listBoxRef:a}):f.createElement(Fe,{content:f.createElement(El,e)},r=>f.createElement(Ma,{props:e,listBoxRef:a,collection:r}))});function Ma({props:l,listBoxRef:e,collection:a}){l={...l,collection:a,children:null,items:null};let{layoutDelegate:t}=s.useContext(Q),r=Ke({...l,layoutDelegate:t});return f.createElement(ol,{state:r,props:l,listBoxRef:e})}function ol({state:l,props:e,listBoxRef:a}){[e,a]=T(e,a,fa);let{dragAndDropHooks:t,layout:r="stack",orientation:o="vertical",filter:i}=e,u=Rl(l,i),{collection:n,selectionManager:b}=u,d=!!(t!=null&&t.useDraggableCollectionState),$=!!(t!=null&&t.useDroppableCollectionState),{direction:x}=H(),{disabledBehavior:g,disabledKeys:p}=b,v=ae({usage:"search",sensitivity:"base"}),{isVirtualized:c,layoutDelegate:m,dropTargetDelegate:P,CollectionRoot:h}=s.useContext(Q),E=s.useMemo(()=>e.keyboardDelegate||new le({collection:n,collator:v,ref:a,disabledKeys:p,disabledBehavior:g,layout:r,orientation:o,direction:x,layoutDelegate:m}),[n,v,a,g,p,o,x,e.keyboardDelegate,r,m]),{listBoxProps:C}=Ba({...e,shouldSelectOnPressUp:d||e.shouldSelectOnPressUp,keyboardDelegate:E,isVirtualized:c},u,a);s.useRef(d),s.useRef($),s.useEffect(()=>{},[d,$]);let M,D,F,y=!1,A=null,S=s.useRef(null);if(d&&t){M=t.useDraggableCollectionState({collection:n,selectionManager:b,preview:t.renderDragPreview?S:void 0}),t.useDraggableCollection({},M,a);let q=t.DragPreview;A=t.renderDragPreview?f.createElement(q,{ref:S},t.renderDragPreview):null}if($&&t){D=t.useDroppableCollectionState({collection:n,selectionManager:b});let q=t.dropTargetDelegate||P||new t.ListDropTargetDelegate(n,a,{orientation:o,layout:r,direction:x});F=t.useDroppableCollection({keyboardDelegate:E,dropTargetDelegate:q},D,a),y=D.isDropTarget({type:"root"})}let{focusProps:cl,isFocused:ce,isFocusVisible:de}=we(),_=u.collection.size===0,fe={isDropTarget:y,isEmpty:_,isFocused:ce,isFocusVisible:de,layout:e.layout||"stack",orientation:o,state:u},dl=k({...e,children:void 0,defaultClassName:"react-aria-ListBox",values:fe}),be=null;_&&e.renderEmptyState&&(be=f.createElement("div",{role:"option",style:{display:"contents"}},e.renderEmptyState(fe)));let fl=K(e,{global:!0});return f.createElement(Al,null,f.createElement(w.div,{...R(fl,dl,C,cl,F==null?void 0:F.collectionProps),ref:a,slot:e.slot||void 0,onScroll:e.onScroll,"data-drop-target":y||void 0,"data-empty":_||void 0,"data-focused":ce||void 0,"data-focus-visible":de||void 0,"data-layout":e.layout||"stack","data-orientation":o},f.createElement(ee,{values:[[oe,e],[V,u],[Z,{dragAndDropHooks:t,dragState:M,dropState:D}],[ga,{elementType:"div"}],[al,{render:Fa}],[Fl,{name:"ListBoxSection",render:il}]]},f.createElement(wl,null,f.createElement(h,{collection:n,scrollRef:a,persistedKeys:ya(b,t,D),renderDropIndicator:rl(t,D)}))),be,A))}function il(l,e,a,t="react-aria-ListBoxSection"){let r=s.useContext(V),{dragAndDropHooks:o,dropState:i}=s.useContext(Z),{CollectionBranch:u}=s.useContext(Q),[n,b]=ke(),{headingProps:d,groupProps:$}=Ea({heading:b,"aria-label":l["aria-label"]??void 0}),x=k({...l,id:void 0,children:void 0,defaultClassName:t,values:void 0}),g=K(l,{global:!0});return delete g.id,f.createElement(w.section,{...R(g,x,$),ref:e},f.createElement(ba.Provider,{value:{...d,ref:n}},f.createElement(u,{collection:r.collection,parent:a,renderDropIndicator:rl(o,i)})))}const Ra=Sl(Ml,il),Aa=ze(Kl,function(e,a,t){let r=Le(a),o=s.useContext(V),{dragAndDropHooks:i,dragState:u,dropState:n}=s.useContext(Z),b=u&&!(u.isDisabled||u.selectionManager.isDisabled(t.key)),{optionProps:d,labelProps:$,descriptionProps:x,...g}=Ca({key:t.key,"aria-label":e==null?void 0:e["aria-label"]},o,r),{hoverProps:p,isHovered:v}=Ae({isDisabled:!g.allowsSelection&&!g.hasAction&&!b,onHoverStart:t.props.onHoverStart,onHoverChange:t.props.onHoverChange,onHoverEnd:t.props.onHoverEnd}),{keyboardProps:c}=J(e),{focusProps:m}=kl(e),P=null;u&&i&&(P=i.useDraggableItem({key:t.key,hasAction:g.hasAction},u));let h=null;n&&i&&(h=i.useDroppableItem({target:{type:"item",key:t.key,dropPosition:"on"}},n,r));let E=u&&u.isDragging(t.key),C=k({...e,id:void 0,children:e.children,defaultClassName:"react-aria-ListBoxItem",values:{...g,isHovered:v,selectionMode:o.selectionManager.selectionMode,selectionBehavior:o.selectionManager.selectionBehavior,allowsDragging:!!u,isDragging:E,isDropTarget:h==null?void 0:h.isDropTarget}});s.useEffect(()=>{t.textValue},[t.textValue]);let M=e.href?w.a:w.div,D=K(e,{global:!0});return delete D.id,delete D.onClick,e.href&&d.tabIndex==null&&(d.tabIndex=-1),f.createElement(M,{...R(D,C,d,p,c,m,P==null?void 0:P.dragProps,h==null?void 0:h.dropProps),ref:r,"data-allows-dragging":!!u||void 0,"data-selected":g.isSelected||void 0,"data-disabled":g.isDisabled||void 0,"data-hovered":v||void 0,"data-focused":g.isFocused||void 0,"data-focus-visible":g.isFocusVisible||void 0,"data-pressed":g.isPressed||void 0,"data-dragging":E||void 0,"data-drop-target":(h==null?void 0:h.isDropTarget)||void 0,"data-selection-mode":o.selectionManager.selectionMode==="none"?void 0:o.selectionManager.selectionMode},f.createElement(ee,{values:[[U,{slots:{[Ll]:$,label:$,description:x}}],[zl,{isSelected:g.isSelected}]]},C.children))});function Fa(l,e){e=Le(e);let{dragAndDropHooks:a,dropState:t}=s.useContext(Z),{dropIndicatorProps:r,isHidden:o,isDropTarget:i}=a.useDropIndicator(l,t,e);return o?null:f.createElement(Ka,{...l,dropIndicatorProps:r,isDropTarget:i,ref:e})}function wa(l,e){let{dropIndicatorProps:a,isDropTarget:t,...r}=l,o=k({...r,defaultClassName:"react-aria-DropIndicator",values:{isDropTarget:t}});return f.createElement(f.Fragment,null,f.createElement(w.div,{...a,...o,role:"option",ref:e,"data-drop-target":t||void 0}))}const Ka=s.forwardRef(wa);ze(Il,function(e,a,t){let r=s.useContext(V),{isLoading:o,onLoadMore:i,scrollOffset:u,...n}=e,b=s.useRef(null),d=s.useMemo(()=>({onLoadMore:i,collection:r==null?void 0:r.collection,sentinelRef:b,scrollOffset:u}),[i,u,r==null?void 0:r.collection]);ra(d,b);let $=k({...n,id:void 0,children:t.rendered,defaultClassName:"react-aria-ListBoxLoadingIndicator",values:void 0}),x={tabIndex:-1};return f.createElement(f.Fragment,null,f.createElement("div",{style:{position:"relative",width:0,height:0},inert:Vl(!0)},f.createElement("div",{"data-testid":"loadMoreSentinel",ref:b,style:{position:"absolute",height:1,width:1}})),o&&$.children&&f.createElement(f.Fragment,null,f.createElement(w.div,{...R(K(e,{global:!0}),x),...$,role:"option",ref:a},$.children)))});function ka(l){let{description:e,errorMessage:a,isInvalid:t,validationState:r}=l,{labelProps:o,fieldProps:i}=Ne(l),u=O([!!e,!!a,t,r]),n=O([!!e,!!a,t,r]);return i=R(i,{"aria-describedby":[u,n,l["aria-describedby"]].filter(Boolean).join(" ")||void 0}),{labelProps:o,fieldProps:i,descriptionProps:{id:u},errorMessageProps:{id:n}}}const ie=new WeakMap;function za(l,e,a){let{keyboardDelegate:t,isDisabled:r,isRequired:o,name:i,form:u,validationBehavior:n="aria"}=l,b=ae({usage:"search",sensitivity:"base"}),d=s.useMemo(()=>t||new le(e.collection,e.disabledKeys,a,b),[t,e.collection,e.disabledKeys,b,a]),{menuTriggerProps:$,menuProps:x}=xa({isDisabled:r,type:"listbox"},e,a),{keyboardProps:g}=J({shortcuts:{ArrowLeft:()=>{var A,S;if(e.selectionManager.selectionMode==="multiple")return!1;let y=e.selectedKey!=null?(A=d.getKeyAbove)==null?void 0:A.call(d,e.selectedKey):(S=d.getFirstKey)==null?void 0:S.call(d);y!=null&&e.setSelectedKey(y)},ArrowRight:()=>{var A,S;if(e.selectionManager.selectionMode==="multiple")return!1;let y=e.selectedKey!=null?(A=d.getKeyBelow)==null?void 0:A.call(d,e.selectedKey):(S=d.getFirstKey)==null?void 0:S.call(d);y!=null&&e.setSelectedKey(y)}},allowRepeats:!0,onKeyDown:l.onKeyDown,onKeyUp:l.onKeyUp}),{typeSelectProps:p}=Tl({keyboardDelegate:d,selectionManager:e.selectionManager,onTypeSelect(y){e.setSelectedKey(y)}}),{isInvalid:v,validationErrors:c,validationDetails:m}=e.displayValidation,{labelProps:P,fieldProps:h,descriptionProps:E,errorMessageProps:C}=ka({...l,labelElementType:"span",isInvalid:v,errorMessage:l.errorMessage||c});e.selectionManager.selectionMode==="multiple"&&(p={});let M=K(l,{labelable:!0}),D=R(p,$,h),F=z();return ie.set(e,{isDisabled:r,isRequired:o,name:i,form:u,validationBehavior:n}),{labelProps:{...P,onClick:()=>{var y;l.isDisabled||((y=a.current)==null||y.focus(),jl("keyboard"))}},triggerProps:R(M,{...D,isDisabled:r,onKeyDown:Re(D.onKeyDown,g.onKeyDown),onKeyUp:g.onKeyUp,"aria-labelledby":[F,D["aria-labelledby"],D["aria-label"]&&!D["aria-labelledby"]?D.id:null].filter(Boolean).join(" "),onFocus(y){e.isFocused||(l.onFocus&&l.onFocus(y),l.onFocusChange&&l.onFocusChange(!0),e.setFocused(!0))},onBlur(y){e.isOpen||(l.onBlur&&l.onBlur(y),l.onFocusChange&&l.onFocusChange(!1),e.setFocused(!1))}}),valueProps:{id:F},menuProps:{...x,onAction:void 0,autoFocus:e.focusStrategy||!0,shouldSelectOnPressUp:!0,shouldFocusOnHover:!0,disallowEmptySelection:!0,linkBehavior:"selection",onBlur:y=>{Nl(y.currentTarget,y.relatedTarget)||(l.onBlur&&l.onBlur(y),l.onFocusChange&&l.onFocusChange(!1),e.setFocused(!1))},"aria-labelledby":[h["aria-labelledby"],D["aria-label"]&&!h["aria-labelledby"]?D.id:null].filter(Boolean).join(" ")},descriptionProps:E,errorMessageProps:C,isInvalid:v,validationErrors:c,validationDetails:m,hiddenSelectProps:{isDisabled:r,name:i,label:l.label,state:e,triggerRef:a,form:u}}}function La(l,e,a){let t=ie.get(e)||{},{autoComplete:r,name:o=t.name,form:i=t.form,isDisabled:u=t.isDisabled}=l,{validationBehavior:n,isRequired:b}=t,{visuallyHiddenProps:d}=Ol({style:{position:"fixed",top:0,left:0}});Ul(l.selectRef,e.defaultValue,e.setValue),Zl({validationBehavior:n,focus:()=>{var g;return(g=a.current)==null?void 0:g.focus()}},e,l.selectRef);let $=e.setValue,x=s.useCallback(g=>{let p=Me(g);p.multiple?$(Array.from(p.selectedOptions,v=>v.value)):$(g.currentTarget.value)},[$]);return{containerProps:{...d,"aria-hidden":!0,"data-react-aria-prevent-focus":!0,"data-a11y-ignore":"aria-hidden-focus"},inputProps:{style:{display:"none"}},selectProps:{tabIndex:-1,autoComplete:r,disabled:u,multiple:e.selectionManager.selectionMode==="multiple",required:n==="native"&&b,name:o,form:i,value:e.value??"",onChange:x,onInput:x}}}function Ia(l){let{state:e,triggerRef:a,label:t,name:r,form:o,isDisabled:i}=l,u=s.useRef(null),n=s.useRef(null),{containerProps:b,selectProps:d}=La({...l,selectRef:e.collection.size<=300?u:n},e,a),$=Array.isArray(e.value)?e.value:[e.value];if(e.collection.size<=300)return f.createElement("div",{...b,"data-testid":"hidden-select-container"},f.createElement("label",null,t,f.createElement("select",{...d,ref:u},f.createElement("option",{value:"",label:" "}," "),[...e.collection.getKeys()].map(x=>{let g=e.collection.getItem(x);if(g&&g.type==="item")return f.createElement("option",{key:g.key,value:g.key},g.textValue)}),e.collection.size===0&&r&&$.map((x,g)=>f.createElement("option",{key:g,value:x??""})))));if(r){let x=ie.get(e)||{},{validationBehavior:g}=x;$.length===0&&($=[null]);let p=$.map((v,c)=>{let m={type:"hidden",autoComplete:d.autoComplete,name:r,form:o,disabled:i,value:v??""};return g==="native"?f.createElement("input",{key:c,...m,ref:c===0?n:null,style:{display:"none"},type:"text",required:c===0?d.required:!1,onChange:()=>{}}):f.createElement("input",{key:c,...m,ref:c===0?n:null})});return f.createElement(f.Fragment,null,p)}return null}function Va(l){let{selectionMode:e="single",shouldCloseOnSelect:a=e==="single"}=l,t=_l(l),[r,o]=s.useState(null),i=s.useMemo(()=>l.defaultValue!==void 0?l.defaultValue:e==="single"?l.defaultSelectedKey??null:[],[l.defaultValue,l.defaultSelectedKey,e]),u=s.useMemo(()=>l.value!==void 0?l.value:e==="single"?l.selectedKey:void 0,[l.value,l.selectedKey,e]),[n,b]=ql(u,i,l.onChange),d=e==="single"&&Array.isArray(n)?n[0]:n,$=h=>{var E;if(e==="single"){let C=Array.isArray(h)?h[0]??null:h;b(C),C!==d&&((E=l.onSelectionChange)==null||E.call(l,C))}else{let C=[];Array.isArray(h)?C=h:h!=null&&(C=[h]),b(C)}},x=Ke({...l,selectionMode:e,disallowEmptySelection:e==="single",allowDuplicateSelectionEvents:!0,selectedKeys:s.useMemo(()=>Ta(d),[d]),onSelectionChange:h=>{if(h!=="all"){if(e==="single"){let E=h.values().next().value??null;$(E)}else $([...h]);a&&t.close(),v.commitValidation()}}}),g=x.selectionManager.firstSelectedKey,p=s.useMemo(()=>[...x.selectionManager.selectedKeys].map(h=>x.collection.getItem(h)).filter(h=>h!=null),[x.selectionManager.selectedKeys,x.collection]),v=Wl({...l,value:Array.isArray(d)&&d.length===0?null:d}),[c,m]=s.useState(!1),[P]=s.useState(d);return{...v,...x,...t,value:d,defaultValue:i??P,setValue:$,selectedKey:g,setSelectedKey:$,selectedItem:p[0]??null,selectedItems:p,defaultSelectedKey:l.defaultSelectedKey??(l.selectionMode==="single"?P:null),focusStrategy:r,open(h=null){(x.collection.size!==0||l.allowsEmptyCollection)&&(o(h),t.open())},toggle(h=null){(x.collection.size!==0||l.allowsEmptyCollection)&&(o(h),t.toggle())},isFocused:c,setFocused:m}}function Ta(l){if(l!==void 0)return l===null?[]:Array.isArray(l)?l:[l]}function Na(l={}){let{locale:e}=H();return s.useMemo(()=>new Intl.ListFormat(e,l),[e,l])}function ja(l){return l&&l.__esModule?l.default:l}const se=s.createContext(null),ne=s.createContext(null),Oa=X(function(e,a){[e,a]=T(e,a,se);let{children:t,isDisabled:r=!1,isInvalid:o=!1,isRequired:i=!1}=e,u=s.useMemo(()=>typeof t=="function"?t({isOpen:!1,isDisabled:r,isInvalid:o,isRequired:i,isFocused:!1,isFocusVisible:!1,defaultChildren:null}):t,[t,r,o,i]);return f.createElement(Fe,{content:u},n=>f.createElement(Za,{props:e,collection:n,selectRef:a}))}),Ua=[te,Ve,U];function Za({props:l,selectRef:e,collection:a}){let{validationBehavior:t}=Ie(Gl)||{},r=l.validationBehavior??t??"native",o=Va({...l,collection:a,children:void 0,validationBehavior:r}),{isFocusVisible:i,focusProps:u}=we({within:!0}),n=s.useRef(null),[b,d]=ke(!l["aria-label"]&&!l["aria-labelledby"]),{labelProps:$,triggerProps:x,valueProps:g,menuProps:p,descriptionProps:v,errorMessageProps:c,hiddenSelectProps:m,...P}=za({...Yl(l),label:d,validationBehavior:r},o,n),h=s.useMemo(()=>({isOpen:o.isOpen,isFocused:o.isFocused,isFocusVisible:i,isDisabled:l.isDisabled||!1,isInvalid:P.isInvalid||!1,isRequired:l.isRequired||!1}),[o.isOpen,o.isFocused,i,l.isDisabled,P.isInvalid,l.isRequired]),E=k({...l,values:h,defaultClassName:"react-aria-Select"}),C=K(l,{global:!0});delete C.id;let M=s.useRef(null);return f.createElement(ee,{values:[[se,l],[ne,o],[sl,g],[te,{...$,ref:b,elementType:"span"}],[Ve,{...x,ref:n,isPressed:o.isOpen,autoFocus:l.autoFocus}],[Xl,o],[Jl,{trigger:"Select",triggerRef:n,scrollRef:M,placement:"bottom start","aria-labelledby":p["aria-labelledby"],clearContexts:Ua}],[oe,{...p,ref:M}],[V,o],[U,{slots:{description:v,errorMessage:c}}],[Hl,P]]},f.createElement(w.div,{...R(C,E,u),ref:e,slot:l.slot||void 0,"data-focused":o.isFocused||void 0,"data-focus-visible":i||void 0,"data-open":o.isOpen||void 0,"data-disabled":l.isDisabled||void 0,"data-invalid":P.isInvalid||void 0,"data-required":l.isRequired||void 0},E.children,f.createElement(Ia,{...m,autoComplete:l.autoComplete})))}const sl=s.createContext(null),_a=X(function(e,a){var p;[e,a]=T(e,a,sl);let t=s.useContext(ne),{placeholder:r}=Ie(se),o=t.selectedItems.map(v=>{var m;let c=(m=v.props)==null?void 0:m.children;return typeof c=="function"&&(c=c({isHovered:!1,isPressed:!1,isSelected:!1,isFocused:!1,isFocusVisible:!1,isDisabled:!1,selectionMode:"single",selectionBehavior:"toggle"})),c}),i=Na(),u=s.useMemo(()=>t.selectedItems.map(v=>v==null?void 0:v.textValue),[t.selectedItems]),n=t.selectionManager.selectionMode,b=s.useMemo(()=>n==="single"?u[0]??"":i.format(u),[n,i,u]),d=s.useMemo(()=>{if(n==="single")return o[0];let v=i.formatToParts(u);if(v.length===0)return null;let c=0;return v.map(m=>m.type==="element"?f.createElement(s.Fragment,{key:c},o[c++]):m.value)},[n,i,u,o]),$=Se(ja(ll),"react-aria-components"),x=k({...e,defaultChildren:d??r??$.format("selectPlaceholder"),defaultClassName:"react-aria-SelectValue",values:{selectedItem:((p=t.selectedItems[0])==null?void 0:p.value)??null,selectedItems:s.useMemo(()=>t.selectedItems.map(v=>v.value??null),[t.selectedItems]),selectedText:b,isPlaceholder:t.selectedItems.length===0,state:t}}),g=K(e,{global:!0});return f.createElement(w.span,{ref:a,...g,...x,"data-placeholder":t.selectedItems.length===0||void 0},f.createElement(U.Provider,{value:void 0},x.children))}),qa=s.createContext(!1),Wa=({children:l})=>B.jsx(qa,{value:!0,children:l}),G=new Map;function Ga(l,e,a=!0){const t=Ql();return s.useMemo(()=>{if(e!==void 0)return e;if(!t){if(a&&G.has(l))return G.get(l);try{const r=document.documentElement,o=getComputedStyle(r).getPropertyValue(l).trim()||void 0;return a&&G.set(l,o),o}catch{return}}},[l,e,t,a])}const ye=({animationType:l,className:e,...a})=>{const t=Ga("--skeleton-animation",l),r=f.useMemo(()=>ca({animationType:t}),[t]);return B.jsx(Te.div,{className:r.base({className:e}),...a})},rr=Object.assign(ye,{Root:ye}),Pe=({children:l,className:e,isDisabled:a,isInvalid:t,isRequired:r,...o})=>B.jsx(da,{className:oa({isRequired:r,isDisabled:a,isInvalid:t,className:e}),"data-slot":"label",...o,children:l}),or=Object.assign(Pe,{Root:Pe}),nl=s.createContext({}),De=({children:l,className:e,variant:a,...t})=>{const r=f.useMemo(()=>sa({variant:a}),[a]);return B.jsx(Aa,{className:I(e,r.item()),"data-slot":"list-box-item",...t,children:o=>B.jsx(nl,{value:{slots:r,state:o},children:typeof l=="function"?l(o):l})})},ul=({children:l,className:e,...a})=>{const{slots:t,state:r}=s.use(nl),o=r==null?void 0:r.isSelected,i=typeof l=="function"?l(r??{}):l||B.jsx("svg",{"aria-hidden":"true","data-slot":"list-box-item-indicator--checkmark",fill:"none",role:"presentation",stroke:"currentColor",strokeDasharray:22,strokeDashoffset:o?44:66,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,viewBox:"0 0 17 18",children:B.jsx("polyline",{points:"1 9 7 14 15 4"})});return B.jsx(Te.span,{"aria-hidden":"true",className:Y(t==null?void 0:t.indicator,e),"data-slot":"list-box-item-indicator","data-visible":o||void 0,...a,children:i})},Ya=Object.assign(De,{Root:De,Indicator:ul}),Xa=({children:l,className:e,...a})=>{const t=f.useMemo(()=>na({class:typeof e=="string"?e:void 0}),[e]);return B.jsx(Ra,{className:t,...a,children:l})},Ja=Xa;function Be({className:l,variant:e,...a}){const t=f.useMemo(()=>ia({variant:e}),[e]);return B.jsx(Sa,{className:I(l,t),"data-slot":"list-box",...a})}const ir=Object.assign(Be,{Root:Be,Item:Ya,ItemIndicator:ul,Section:Ja}),N=s.createContext({}),Ce=({children:l,className:e,fullWidth:a,variant:t,...r})=>{const o=f.useMemo(()=>ua({fullWidth:a,variant:t}),[a,t]);return B.jsx(Wa,{children:B.jsx(N,{value:{slots:o},children:B.jsx(Oa,{"data-slot":"select",...r,className:I(e,o==null?void 0:o.base()),children:i=>B.jsx(B.Fragment,{children:typeof l=="function"?l(i):l})})})})},Ha=({children:l,className:e,...a})=>{const{slots:t}=s.use(N);return B.jsx(aa,{className:I(e,t==null?void 0:t.trigger()),"data-slot":"select-trigger",...a,children:r=>B.jsx(B.Fragment,{children:typeof l=="function"?l(r):l})})},Qa=({children:l,className:e,...a})=>{const{slots:t}=s.use(N);return B.jsx(_a,{className:I(e,t==null?void 0:t.value()),"data-slot":"select-value",...a,children:l})},er=({children:l,className:e,...a})=>{const{slots:t}=s.use(N),r=s.use(ne);return l&&f.isValidElement(l)?f.cloneElement(l,{...a,className:Y(t==null?void 0:t.indicator,e),"data-slot":"select-indicator","data-open":xe(r==null?void 0:r.isOpen)}):B.jsx(la,{className:Y(t==null?void 0:t.indicator,e),"data-open":xe(r==null?void 0:r.isOpen),"data-slot":"select-default-indicator",...a})},tr=({children:l,className:e,placement:a="bottom",...t})=>{const{slots:r}=s.use(N);return B.jsx(ea,{value:{variant:"default"},children:B.jsx(ta,{...t,className:I(e,r==null?void 0:r.popover()),"data-slot":"select-popover",placement:a,children:l})})},sr=Object.assign(Ce,{Root:Ce,Trigger:Ha,Value:Qa,Indicator:er,Popover:tr});export{ka as $,or as L,rr as S,sr as a,ir as b,ar as c,te as d,ve as e,ae as f,Z as g,ra as h,rl as i,fa as j,le as k,al as l,ya as m,ll as n,Ga as u};