turbollm 0.7.2 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +497 -463
- package/dist/cli.js +4637 -2047
- package/dist/webdist/assets/ChatScreen-CEMM3c4T.js +41 -0
- package/dist/webdist/assets/CustomizeScreen-QBH-lamm.js +4 -0
- package/dist/webdist/assets/DeveloperScreen-CUSmAT_L.js +1 -0
- package/dist/webdist/assets/EnginesScreen-CxVyQ04U.js +5 -0
- package/dist/webdist/assets/ModelDetailDialog-CtrZ6odT.js +1 -0
- package/dist/webdist/assets/ModelDirs-MIQRpOiQ.js +1 -0
- package/dist/webdist/assets/ModelsScreen-BuZH5fye.js +1 -0
- package/dist/webdist/assets/SettingsScreen-DpyvTxBO.js +1 -0
- package/dist/webdist/assets/alert-dialog-NJbgeueX.js +1 -0
- package/dist/webdist/assets/check-R4c79Xkn.js +1 -0
- package/dist/webdist/assets/circle-x-DoZx722k.js +1 -0
- package/dist/webdist/assets/common-BkuT8XJF.js +1 -0
- package/dist/webdist/assets/copy-button-CvYEyWud.js +1 -0
- package/dist/webdist/assets/external-link-CLr8NpF9.js +1 -0
- package/dist/webdist/assets/index-B3f5udGb.css +1 -0
- package/dist/webdist/assets/index-BhB9CGsv.js +10 -0
- package/dist/webdist/assets/pencil-Co_wjceA.js +1 -0
- package/dist/webdist/assets/personas-D9qR7c_5.js +43 -0
- package/dist/webdist/assets/plus-mxaaevXg.js +1 -0
- package/dist/webdist/assets/radix-RipaNCX7.js +51 -0
- package/dist/webdist/assets/save-d7rhw6iu.js +1 -0
- package/dist/webdist/assets/skeleton-D2X0KEDs.js +1 -0
- package/dist/webdist/assets/sparkles-B3j8q0hr.js +1 -0
- package/dist/webdist/assets/trash-2-Dm-i43d8.js +1 -0
- package/dist/webdist/assets/vendor-D_-14Whs.js +3 -0
- package/dist/webdist/index.html +4 -2
- package/package.json +62 -62
- package/dist/webdist/assets/index-B-GrbX4x.css +0 -1
- package/dist/webdist/assets/index-CbHny3S1.js +0 -149
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as a}from"./index-BhB9CGsv.js";const c=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],o=a("pencil",c);export{o as P};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import{a5 as v,A as w,a as q,q as d,a6 as S}from"./index-BhB9CGsv.js";async function r(e,n){const a={Accept:"application/json",...v(),...n?.headers??{}};let t=n?.body;n&&"json"in n&&n.json!==void 0&&(a["Content-Type"]="application/json",t=JSON.stringify(n.json));const s=await fetch(e,{...n,headers:a,body:t});if(s.status===204)return;const i=await s.text(),c=i?(()=>{try{return JSON.parse(i)}catch{return}})():void 0;if(!s.ok){const o=c;throw new w(o?.error?.code??"http_error",o?.error?.message??`Request failed with status ${s.status}.`,s.status)}return c}function U(e){return r(`/api/v1/conversations${e?`?q=${encodeURIComponent(e)}`:""}`)}function A(e){return r("/api/v1/conversations",{method:"POST",json:e??{}})}function L(){return r("/api/v1/conversations/expert",{method:"POST",json:{}})}function _(e){return r(`/api/v1/conversations/${encodeURIComponent(e)}`)}function $(e,n){return r(`/api/v1/conversations/${encodeURIComponent(e)}`,{method:"PATCH",json:n})}function j(e){return r(`/api/v1/conversations/${encodeURIComponent(e)}`,{method:"DELETE"})}function E(e){return r("/api/v1/chat/stop",{method:"POST",json:{conversationId:e}})}function D(e,n,a){return r(`/api/v1/conversations/${encodeURIComponent(e)}/messages/${encodeURIComponent(n)}`,{method:"PUT",json:{content:a}})}function F(e,n){return r(`/api/v1/conversations/${encodeURIComponent(e)}/messages/${encodeURIComponent(n)}`,{method:"DELETE"})}function M(e){return r(`/api/v1/conversations/${encodeURIComponent(e)}/regenerate`,{method:"POST",json:{}})}async function*W(e,n,a,t,s,i,c){const o=await fetch(`/api/v1/conversations/${encodeURIComponent(e)}/messages`,{method:"POST",headers:{"Content-Type":"application/json",...v()},body:JSON.stringify({content:n,images:t?.length?t:void 0,docContext:s||void 0,textAttachments:i?.length?i:void 0,disableThinking:c||void 0}),signal:a});if(!o.ok||!o.body){const l=await o.text().catch(()=>""),p=(()=>{try{return JSON.parse(l)}catch{return}})();throw new w(p?.error?.code??"http_error",p?.error?.message??`Request failed with status ${o.status}.`,o.status)}const m=o.body.getReader(),h=new TextDecoder;let u="";try{for(;;){const{done:l,value:p}=await m.read();if(l)break;u+=h.decode(p,{stream:!0});const f=u.split(`
|
|
2
|
+
`);u=f.pop()??"";let y="";for(const g of f)if(g.startsWith("event: "))y=g.slice(7).trim();else if(g.startsWith("data: ")){const O=g.slice(6).trim();try{const R=JSON.parse(O);y&&(yield{event:y,data:R})}catch{}y=""}}}finally{m.releaseLock()}}async function*Y(e,n,a){const t=await fetch(`/api/v1/conversations/${encodeURIComponent(e)}/continue`,{method:"POST",headers:{"Content-Type":"application/json",...v()},body:JSON.stringify({disableThinking:a||void 0}),signal:n});if(!t.ok||!t.body){const o=await t.text().catch(()=>""),m=(()=>{try{return JSON.parse(o)}catch{return}})();throw new w(m?.error?.code??"http_error",m?.error?.message??`Request failed with status ${t.status}.`,t.status)}const s=t.body.getReader(),i=new TextDecoder;let c="";try{for(;;){const{done:o,value:m}=await s.read();if(o)break;c+=i.decode(m,{stream:!0});const h=c.split(`
|
|
3
|
+
`);c=h.pop()??"";let u="";for(const l of h)if(l.startsWith("event: "))u=l.slice(7).trim();else if(l.startsWith("data: ")){const p=l.slice(6).trim();try{const f=JSON.parse(p);u&&(yield{event:u,data:f})}catch{}u=""}}}finally{s.releaseLock()}}const b={list:e=>["conversations",e??""],detail:e=>["conversation",e]};function z(e){return S({queryKey:b.list(e),queryFn:()=>U(e),staleTime:0,retry:!1})}function Q(e){return S({queryKey:b.detail(e),queryFn:()=>_(e),enabled:!!e,retry:!1})}function G(){const e=q(),n=()=>{e.invalidateQueries({queryKey:["conversations"]})},a=t=>{e.invalidateQueries({queryKey:b.detail(t)})};return{create:d({mutationFn:t=>A(t),onSuccess:n}),createExpert:d({mutationFn:()=>L(),onSuccess:n}),update:d({mutationFn:t=>$(t.id,t),onSuccess:(t,s)=>{n(),a(s.id)}}),remove:d({mutationFn:t=>j(t),onSuccess:n}),stop:d({mutationFn:t=>E(t)}),editMsg:d({mutationFn:t=>D(t.convId,t.msgId,t.content),onSuccess:(t,s)=>a(s.convId)}),deleteMsg:d({mutationFn:t=>F(t.convId,t.msgId),onSuccess:(t,s)=>a(s.convId)}),regenerate:d({mutationFn:t=>M(t),onSuccess:(t,s)=>a(s)})}}const I=[{id:"default",name:"Default",description:"Balanced and helpful with chart capability and your personalization settings",systemPrompt:""},{id:"blank",name:"Blank",description:"Zero system prompt — raw model output, no instructions injected",systemPrompt:""},{id:"concise",name:"Concise",description:"Shortest possible answers, bullet points over paragraphs",systemPrompt:"Keep answers as short as possible. Use bullet points over paragraphs when listing multiple items. No preamble, no trailing summary. Answer the question and stop."},{id:"detailed",name:"Detailed",description:"Thorough explanations with context, examples, and reasoning",systemPrompt:"Give thorough, educational explanations. Include relevant context, examples, and reasoning. Do not truncate or summarize — explain fully."},{id:"blunt",name:"Blunt",description:"Direct with no filler words or pleasantries",systemPrompt:'Be direct and blunt. Skip preambles and pleasantries — no "Certainly!", "Of course!", "Great question!". Get to the point immediately. If something is wrong, say so plainly.'},{id:"formal",name:"Formal",description:"Professional, polished prose suitable for documents",systemPrompt:"Write in a professional, polished tone. Avoid casual language, contractions, emojis, and conversational filler. Suit your response for a professional document or communication."},{id:"tutor",name:"Tutor",description:"Asks a clarifying question first, then teaches step by step",systemPrompt:"You are a patient teacher. If the question is ambiguous, ask one focused clarifying question before answering. Otherwise, explain step by step as if teaching someone encountering this topic for the first time."},{id:"research",name:"Research",description:"Multi-search deep research — runs 3–5 targeted queries before answering, cites all sources",systemPrompt:`You are a deep research assistant. Every response requires multiple web searches — do NOT compose your answer until you have run at least 3 searches.
|
|
4
|
+
|
|
5
|
+
Required search strategy (follow this every time):
|
|
6
|
+
1. Start with a broad query to get an overview and identify key facts
|
|
7
|
+
2. Run a second targeted query focusing on the most important specific aspect (version, date, number, name, etc.)
|
|
8
|
+
3. Run a third query from a different angle — e.g. "site:reddit.com", comparisons, recent news, or expert opinions
|
|
9
|
+
4. If results are thin or contradict each other, run 1–2 more refined searches to resolve the gaps
|
|
10
|
+
5. Only compose your answer after all searches are done
|
|
11
|
+
|
|
12
|
+
Query craft rules:
|
|
13
|
+
- Use precise terms: model names, version numbers, dates, company names — never vague phrases
|
|
14
|
+
- Vary your query angles across searches: overview → specific fact → alternative perspective
|
|
15
|
+
- If a search returns stale or irrelevant results, rephrase and search again immediately
|
|
16
|
+
|
|
17
|
+
In your answer:
|
|
18
|
+
- Cite every factual claim inline as [source title](url)
|
|
19
|
+
- Note conflicts between sources and which you find more credible and why
|
|
20
|
+
- Clearly separate what search results say from what you already knew
|
|
21
|
+
- If searches failed to answer something, say so explicitly instead of guessing`},{id:"creative",name:"Creative",description:"Imaginative, vivid language with unexpected angles",systemPrompt:"Prioritize imagination and novelty. Use vivid language, explore unexpected angles, and bring a distinct voice. Favor interesting over safe."}],C="tllm.persona.default",P=e=>`tllm.persona.conv.${e}`,T="tllm.personal.assistantName",x="tllm.personal.userName",N="tllm.personal.customInstructions";function k(e){return I.some(n=>n.id===e)}function B(){const e=localStorage.getItem(C);return k(e)?e:"default"}function H(e){localStorage.setItem(C,e)}function V(e){const n=localStorage.getItem(P(e));return k(n)?n:B()}function Z(e,n){localStorage.setItem(P(e),n)}function X(){return{assistantName:localStorage.getItem(T)??"",userName:localStorage.getItem(x)??"",customInstructions:localStorage.getItem(N)??""}}function ee(e){const n=(a,t)=>{t.trim()?localStorage.setItem(a,t.trim()):localStorage.removeItem(a)};n(T,e.assistantName),n(x,e.userName),n(N,e.customInstructions)}const J=`You are running inside TurboLLM, a local-first AI chat app. You can render text-based charts and graphics using Unicode characters. Use them when a visual would genuinely make the response clearer — not by default.
|
|
22
|
+
|
|
23
|
+
A chart is appropriate when:
|
|
24
|
+
- Comparing 3+ items by a numeric metric (rankings, benchmarks, budgets)
|
|
25
|
+
- Showing a trend, distribution, or progression over time or stages
|
|
26
|
+
- Presenting a hierarchy or dependency tree
|
|
27
|
+
- The user asks about data that has a clear pattern hard to read in prose
|
|
28
|
+
|
|
29
|
+
A chart is NOT appropriate for:
|
|
30
|
+
- Conversational replies, opinions, or explanations
|
|
31
|
+
- Data with only 1–2 values (just state the numbers inline)
|
|
32
|
+
- Lists that are purely qualitative (no meaningful numeric comparison)
|
|
33
|
+
|
|
34
|
+
When a chart is warranted:
|
|
35
|
+
- Bar / column charts: use block fill characters █ ▓ ▒ ░ with a numeric scale and axis labels
|
|
36
|
+
- Tables: use box-drawing characters ┌ ─ ┐ │ └ ┘ ├ ┤ ┬ ┴ ┼ for clean borders; align columns
|
|
37
|
+
- Line / trend: sketch with · ╌ ╍ ╱ ╲ characters; mark key points with ●
|
|
38
|
+
- Tree / hierarchy: use └─ ├─ │ connectors
|
|
39
|
+
- Progress / gauge: [████████░░] style with a percentage
|
|
40
|
+
|
|
41
|
+
Always include a title, axis/column labels, and the underlying numbers. Keep charts compact — no wider than ~60 characters. Wrap chart output in a plain code block (\`\`\`) so spacing is preserved.`;function te(e,n){if(e==="blank")return"";const a=I.find(i=>i.id===e),t=new Date().toLocaleDateString("en-US",{weekday:"long",year:"numeric",month:"long",day:"numeric"}),s=[J,`Today's date is ${t}.`];return a?.systemPrompt&&s.push(a.systemPrompt),n.assistantName.trim()&&s.push(`Your name is ${n.assistantName.trim()}.`),n.userName.trim()&&s.push(`The user's name is ${n.userName.trim()}.`),n.customInstructions.trim()&&s.push(n.customInstructions.trim()),s.join(`
|
|
42
|
+
|
|
43
|
+
`)}export{I as P,z as a,Q as b,V as c,Y as d,te as e,X as f,B as g,W as h,H as i,ee as j,Z as s,G as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as e}from"./index-BhB9CGsv.js";const o=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],c=e("plus",o);export{c as P};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import{r as a,R as Xt,a as qt}from"./vendor-D_-14Whs.js";var _t={exports:{}},Le={};var An;function _i(){if(An)return Le;An=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,o,i){var s=null;if(i!==void 0&&(s=""+i),o.key!==void 0&&(s=""+o.key),"key"in o){i={};for(var c in o)c!=="key"&&(i[c]=o[c])}else i=o;return o=i.ref,{$$typeof:e,type:r,key:s,ref:o!==void 0?o:null,props:i}}return Le.Fragment=t,Le.jsx=n,Le.jsxs=n,Le}var Mn;function Ti(){return Mn||(Mn=1,_t.exports=_i()),_t.exports}var h=Ti();function A(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e?.(o),n===!1||!o.defaultPrevented)return t?.(o)}}function _n(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Zt(...e){return t=>{let n=!1;const r=e.map(o=>{const i=_n(o,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let o=0;o<r.length;o++){const i=r[o];typeof i=="function"?i():_n(e[o],null)}}}}function j(...e){return a.useCallback(Zt(...e),e)}function Di(e,t){const n=a.createContext(t);n.displayName=e+"Context";const r=i=>{const{children:s,...c}=i,u=a.useMemo(()=>c,Object.values(c));return h.jsx(n.Provider,{value:u,children:s})};r.displayName=e+"Provider";function o(i){const s=a.useContext(n);if(s)return s;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[r,o]}function ne(e,t=[]){let n=[];function r(i,s){const c=a.createContext(s);c.displayName=i+"Context";const u=n.length;n=[...n,s];const d=l=>{const{scope:p,children:m,...g}=l,v=p?.[e]?.[u]||c,w=a.useMemo(()=>g,Object.values(g));return h.jsx(v.Provider,{value:w,children:m})};d.displayName=i+"Provider";function f(l,p){const m=p?.[e]?.[u]||c,g=a.useContext(m);if(g)return g;if(s!==void 0)return s;throw new Error(`\`${l}\` must be used within \`${i}\``)}return[d,f]}const o=()=>{const i=n.map(s=>a.createContext(s));return function(c){const u=c?.[e]||i;return a.useMemo(()=>({[`__scope${e}`]:{...c,[e]:u}}),[c,u])}};return o.scopeName=e,[r,Oi(o,...t)]}function Oi(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const s=r.reduce((c,{useScope:u,scopeName:d})=>{const l=u(i)[`__scope${d}`];return{...c,...l}},{});return a.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function Me(e){const t=a.forwardRef((n,r)=>{let{children:o,...i}=n,s=null,c=!1;const u=[];Tn(o)&&typeof Xe=="function"&&(o=Xe(o._payload)),a.Children.forEach(o,p=>{if(Li(p)){c=!0;const m=p;let g="child"in m.props?m.props.child:m.props.children;Tn(g)&&typeof Xe=="function"&&(g=Xe(g._payload)),s=Ni(m,g),u.push(s?.props?.children)}else u.push(p)}),s?s=a.cloneElement(s,void 0,u):!c&&a.Children.count(o)===1&&a.isValidElement(o)&&(s=o);const d=s?ki(s):void 0,f=j(r,d);if(!s){if(o||o===0)throw new Error(c?Wi(e):$i(e));return o}const l=Ii(i,s.props??{});return s.type!==a.Fragment&&(l.ref=r?f:d),a.cloneElement(s,l)});return t.displayName=`${e}.Slot`,t}var ju=Me("Slot"),nr=Symbol.for("radix.slottable");function rr(e){const t=n=>"child"in n?n.children(n.child):n.children;return t.displayName=`${e}.Slottable`,t.__radixId=nr,t}var Ni=(e,t)=>{if("child"in e.props){const n=e.props.child;return a.isValidElement(n)?a.cloneElement(n,void 0,e.props.children(n.props.children)):null}return a.isValidElement(t)?t:null};function Ii(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...c)=>{const u=i(...c);return o(...c),u}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function ki(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Li(e){return a.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===nr}var Fi=Symbol.for("react.lazy");function Tn(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===Fi&&"_payload"in e&&ji(e._payload)}function ji(e){return typeof e=="object"&&e!==null&&"then"in e}var $i=e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,Wi=e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,Xe=Xt[" use ".trim().toString()],Bi=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],N=Bi.reduce((e,t)=>{const n=Me(`Primitive.${t}`),r=a.forwardRef((o,i)=>{const{asChild:s,...c}=o,u=s?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),h.jsx(u,{...c,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function or(e,t){e&&qt.flushSync(()=>e.dispatchEvent(t))}function oe(e){const t=a.useRef(e);return a.useEffect(()=>{t.current=e}),a.useMemo(()=>((...n)=>t.current?.(...n)),[])}function Hi(e,t=globalThis?.document){const n=oe(e);a.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var Gi="DismissableLayer",Wt="dismissableLayer.update",Ui="dismissableLayer.pointerDownOutside",Vi="dismissableLayer.focusOutside",Dn,ir=a.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),pt=a.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:s,onDismiss:c,...u}=e,d=a.useContext(ir),[f,l]=a.useState(null),p=f?.ownerDocument??globalThis?.document,[,m]=a.useState({}),g=j(t,R=>l(R)),v=Array.from(d.layers),[w]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),y=v.indexOf(w),x=f?v.indexOf(f):-1,b=d.layersWithOutsidePointerEventsDisabled.size>0,C=x>=y,E=zi(R=>{const M=R.target,O=[...d.branches].some(T=>T.contains(M));!C||O||(o?.(R),s?.(R),R.defaultPrevented||c?.())},p),S=Xi(R=>{const M=R.target;[...d.branches].some(T=>T.contains(M))||(i?.(R),s?.(R),R.defaultPrevented||c?.())},p);return Hi(R=>{x===d.layers.size-1&&(r?.(R),!R.defaultPrevented&&c&&(R.preventDefault(),c()))},p),a.useEffect(()=>{if(f)return n&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(Dn=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(f)),d.layers.add(f),On(),()=>{n&&(d.layersWithOutsidePointerEventsDisabled.delete(f),d.layersWithOutsidePointerEventsDisabled.size===0&&(p.body.style.pointerEvents=Dn))}},[f,p,n,d]),a.useEffect(()=>()=>{f&&(d.layers.delete(f),d.layersWithOutsidePointerEventsDisabled.delete(f),On())},[f,d]),a.useEffect(()=>{const R=()=>m({});return document.addEventListener(Wt,R),()=>document.removeEventListener(Wt,R)},[]),h.jsx(N.div,{...u,ref:g,style:{pointerEvents:b?C?"auto":"none":void 0,...e.style},onFocusCapture:A(e.onFocusCapture,S.onFocusCapture),onBlurCapture:A(e.onBlurCapture,S.onBlurCapture),onPointerDownCapture:A(e.onPointerDownCapture,E.onPointerDownCapture)})});pt.displayName=Gi;var Ki="DismissableLayerBranch",Yi=a.forwardRef((e,t)=>{const n=a.useContext(ir),r=a.useRef(null),o=j(t,r);return a.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),h.jsx(N.div,{...e,ref:o})});Yi.displayName=Ki;function zi(e,t=globalThis?.document){const n=oe(e),r=a.useRef(!1),o=a.useRef(()=>{});return a.useEffect(()=>{const i=c=>{if(c.target&&!r.current){let u=function(){sr(Ui,n,d,{discrete:!0})};const d={originalEvent:c};c.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=u,t.addEventListener("click",o.current,{once:!0})):u()}else t.removeEventListener("click",o.current);r.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",i),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function Xi(e,t=globalThis?.document){const n=oe(e),r=a.useRef(!1);return a.useEffect(()=>{const o=i=>{i.target&&!r.current&&sr(Vi,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function On(){const e=new CustomEvent(Wt);document.dispatchEvent(e)}function sr(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?or(o,i):o.dispatchEvent(i)}var ee=globalThis?.document?a.useLayoutEffect:()=>{},qi=Xt[" useId ".trim().toString()]||(()=>{}),Zi=0;function de(e){const[t,n]=a.useState(qi());return ee(()=>{n(r=>r??String(Zi++))},[e]),e||(t?`radix-${t}`:"")}const Ji=["top","right","bottom","left"],pe=Math.min,U=Math.max,st=Math.round,qe=Math.floor,te=e=>({x:e,y:e}),Qi={left:"right",right:"left",bottom:"top",top:"bottom"};function Bt(e,t,n){return U(e,pe(t,n))}function ie(e,t){return typeof e=="function"?e(t):e}function se(e){return e.split("-")[0]}function De(e){return e.split("-")[1]}function Jt(e){return e==="x"?"y":"x"}function Qt(e){return e==="y"?"height":"width"}function Q(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function en(e){return Jt(Q(e))}function es(e,t,n){n===void 0&&(n=!1);const r=De(e),o=en(e),i=Qt(o);let s=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=at(s)),[s,at(s)]}function ts(e){const t=at(e);return[Ht(e),t,Ht(t)]}function Ht(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const Nn=["left","right"],In=["right","left"],ns=["top","bottom"],rs=["bottom","top"];function os(e,t,n){switch(e){case"top":case"bottom":return n?t?In:Nn:t?Nn:In;case"left":case"right":return t?ns:rs;default:return[]}}function is(e,t,n,r){const o=De(e);let i=os(se(e),n==="start",r);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(Ht)))),i}function at(e){const t=se(e);return Qi[t]+e.slice(t.length)}function ss(e){return{top:0,right:0,bottom:0,left:0,...e}}function ar(e){return typeof e!="number"?ss(e):{top:e,right:e,bottom:e,left:e}}function ct(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function kn(e,t,n){let{reference:r,floating:o}=e;const i=Q(t),s=en(t),c=Qt(s),u=se(t),d=i==="y",f=r.x+r.width/2-o.width/2,l=r.y+r.height/2-o.height/2,p=r[c]/2-o[c]/2;let m;switch(u){case"top":m={x:f,y:r.y-o.height};break;case"bottom":m={x:f,y:r.y+r.height};break;case"right":m={x:r.x+r.width,y:l};break;case"left":m={x:r.x-o.width,y:l};break;default:m={x:r.x,y:r.y}}switch(De(t)){case"start":m[s]-=p*(n&&d?-1:1);break;case"end":m[s]+=p*(n&&d?-1:1);break}return m}async function as(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:i,rects:s,elements:c,strategy:u}=e,{boundary:d="clippingAncestors",rootBoundary:f="viewport",elementContext:l="floating",altBoundary:p=!1,padding:m=0}=ie(t,e),g=ar(m),w=c[p?l==="floating"?"reference":"floating":l],y=ct(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(w)))==null||n?w:w.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(c.floating)),boundary:d,rootBoundary:f,strategy:u})),x=l==="floating"?{x:r,y:o,width:s.floating.width,height:s.floating.height}:s.reference,b=await(i.getOffsetParent==null?void 0:i.getOffsetParent(c.floating)),C=await(i.isElement==null?void 0:i.isElement(b))?await(i.getScale==null?void 0:i.getScale(b))||{x:1,y:1}:{x:1,y:1},E=ct(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:x,offsetParent:b,strategy:u}):x);return{top:(y.top-E.top+g.top)/C.y,bottom:(E.bottom-y.bottom+g.bottom)/C.y,left:(y.left-E.left+g.left)/C.x,right:(E.right-y.right+g.right)/C.x}}const cs=50,ls=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=n,c=s.detectOverflow?s:{...s,detectOverflow:as},u=await(s.isRTL==null?void 0:s.isRTL(t));let d=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:f,y:l}=kn(d,r,u),p=r,m=0;const g={};for(let v=0;v<i.length;v++){const w=i[v];if(!w)continue;const{name:y,fn:x}=w,{x:b,y:C,data:E,reset:S}=await x({x:f,y:l,initialPlacement:r,placement:p,strategy:o,middlewareData:g,rects:d,platform:c,elements:{reference:e,floating:t}});f=b??f,l=C??l,g[y]={...g[y],...E},S&&m<cs&&(m++,typeof S=="object"&&(S.placement&&(p=S.placement),S.rects&&(d=S.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):S.rects),{x:f,y:l}=kn(d,p,u)),v=-1)}return{x:f,y:l,placement:p,strategy:o,middlewareData:g}},us=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:s,elements:c,middlewareData:u}=t,{element:d,padding:f=0}=ie(e,t)||{};if(d==null)return{};const l=ar(f),p={x:n,y:r},m=en(o),g=Qt(m),v=await s.getDimensions(d),w=m==="y",y=w?"top":"left",x=w?"bottom":"right",b=w?"clientHeight":"clientWidth",C=i.reference[g]+i.reference[m]-p[m]-i.floating[g],E=p[m]-i.reference[m],S=await(s.getOffsetParent==null?void 0:s.getOffsetParent(d));let R=S?S[b]:0;(!R||!await(s.isElement==null?void 0:s.isElement(S)))&&(R=c.floating[b]||i.floating[g]);const M=C/2-E/2,O=R/2-v[g]/2-1,T=pe(l[y],O),I=pe(l[x],O),L=T,F=R-v[g]-I,k=R/2-v[g]/2+M,B=Bt(L,k,F),D=!u.arrow&&De(o)!=null&&k!==B&&i.reference[g]/2-(k<L?T:I)-v[g]/2<0,$=D?k<L?k-L:k-F:0;return{[m]:p[m]+$,data:{[m]:B,centerOffset:k-B-$,...D&&{alignmentOffset:$}},reset:D}}}),fs=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:s,initialPlacement:c,platform:u,elements:d}=t,{mainAxis:f=!0,crossAxis:l=!0,fallbackPlacements:p,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:v=!0,...w}=ie(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const y=se(o),x=Q(c),b=se(c)===c,C=await(u.isRTL==null?void 0:u.isRTL(d.floating)),E=p||(b||!v?[at(c)]:ts(c)),S=g!=="none";!p&&S&&E.push(...is(c,v,g,C));const R=[c,...E],M=await u.detectOverflow(t,w),O=[];let T=((r=i.flip)==null?void 0:r.overflows)||[];if(f&&O.push(M[y]),l){const k=es(o,s,C);O.push(M[k[0]],M[k[1]])}if(T=[...T,{placement:o,overflows:O}],!O.every(k=>k<=0)){var I,L;const k=(((I=i.flip)==null?void 0:I.index)||0)+1,B=R[k];if(B&&(!(l==="alignment"?x!==Q(B):!1)||T.every(_=>Q(_.placement)===x?_.overflows[0]>0:!0)))return{data:{index:k,overflows:T},reset:{placement:B}};let D=(L=T.filter($=>$.overflows[0]<=0).sort(($,_)=>$.overflows[1]-_.overflows[1])[0])==null?void 0:L.placement;if(!D)switch(m){case"bestFit":{var F;const $=(F=T.filter(_=>{if(S){const P=Q(_.placement);return P===x||P==="y"}return!0}).map(_=>[_.placement,_.overflows.filter(P=>P>0).reduce((P,W)=>P+W,0)]).sort((_,P)=>_[1]-P[1])[0])==null?void 0:F[0];$&&(D=$);break}case"initialPlacement":D=c;break}if(o!==D)return{reset:{placement:D}}}return{}}}};function Ln(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Fn(e){return Ji.some(t=>e[t]>=0)}const ds=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:o="referenceHidden",...i}=ie(e,t);switch(o){case"referenceHidden":{const s=await r.detectOverflow(t,{...i,elementContext:"reference"}),c=Ln(s,n.reference);return{data:{referenceHiddenOffsets:c,referenceHidden:Fn(c)}}}case"escaped":{const s=await r.detectOverflow(t,{...i,altBoundary:!0}),c=Ln(s,n.floating);return{data:{escapedOffsets:c,escaped:Fn(c)}}}default:return{}}}}},cr=new Set(["left","top"]);async function ps(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),s=se(n),c=De(n),u=Q(n)==="y",d=cr.has(s)?-1:1,f=i&&u?-1:1,l=ie(t,e);let{mainAxis:p,crossAxis:m,alignmentAxis:g}=typeof l=="number"?{mainAxis:l,crossAxis:0,alignmentAxis:null}:{mainAxis:l.mainAxis||0,crossAxis:l.crossAxis||0,alignmentAxis:l.alignmentAxis};return c&&typeof g=="number"&&(m=c==="end"?g*-1:g),u?{x:m*f,y:p*d}:{x:p*d,y:m*f}}const ms=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:s,middlewareData:c}=t,u=await ps(t,e);return s===((n=c.offset)==null?void 0:n.placement)&&(r=c.arrow)!=null&&r.alignmentOffset?{}:{x:o+u.x,y:i+u.y,data:{...u,placement:s}}}}},vs=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o,platform:i}=t,{mainAxis:s=!0,crossAxis:c=!1,limiter:u={fn:y=>{let{x,y:b}=y;return{x,y:b}}},...d}=ie(e,t),f={x:n,y:r},l=await i.detectOverflow(t,d),p=Q(se(o)),m=Jt(p);let g=f[m],v=f[p];if(s){const y=m==="y"?"top":"left",x=m==="y"?"bottom":"right",b=g+l[y],C=g-l[x];g=Bt(b,g,C)}if(c){const y=p==="y"?"top":"left",x=p==="y"?"bottom":"right",b=v+l[y],C=v-l[x];v=Bt(b,v,C)}const w=u.fn({...t,[m]:g,[p]:v});return{...w,data:{x:w.x-n,y:w.y-r,enabled:{[m]:s,[p]:c}}}}}},hs=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:i,middlewareData:s}=t,{offset:c=0,mainAxis:u=!0,crossAxis:d=!0}=ie(e,t),f={x:n,y:r},l=Q(o),p=Jt(l);let m=f[p],g=f[l];const v=ie(c,t),w=typeof v=="number"?{mainAxis:v,crossAxis:0}:{mainAxis:0,crossAxis:0,...v};if(u){const b=p==="y"?"height":"width",C=i.reference[p]-i.floating[b]+w.mainAxis,E=i.reference[p]+i.reference[b]-w.mainAxis;m<C?m=C:m>E&&(m=E)}if(d){var y,x;const b=p==="y"?"width":"height",C=cr.has(se(o)),E=i.reference[l]-i.floating[b]+(C&&((y=s.offset)==null?void 0:y[l])||0)+(C?0:w.crossAxis),S=i.reference[l]+i.reference[b]+(C?0:((x=s.offset)==null?void 0:x[l])||0)-(C?w.crossAxis:0);g<E?g=E:g>S&&(g=S)}return{[p]:m,[l]:g}}}},gs=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:i,platform:s,elements:c}=t,{apply:u=()=>{},...d}=ie(e,t),f=await s.detectOverflow(t,d),l=se(o),p=De(o),m=Q(o)==="y",{width:g,height:v}=i.floating;let w,y;l==="top"||l==="bottom"?(w=l,y=p===(await(s.isRTL==null?void 0:s.isRTL(c.floating))?"start":"end")?"left":"right"):(y=l,w=p==="end"?"top":"bottom");const x=v-f.top-f.bottom,b=g-f.left-f.right,C=pe(v-f[w],x),E=pe(g-f[y],b),S=!t.middlewareData.shift;let R=C,M=E;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(M=b),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(R=x),S&&!p){const T=U(f.left,0),I=U(f.right,0),L=U(f.top,0),F=U(f.bottom,0);m?M=g-2*(T!==0||I!==0?T+I:U(f.left,f.right)):R=v-2*(L!==0||F!==0?L+F:U(f.top,f.bottom))}await u({...t,availableWidth:M,availableHeight:R});const O=await s.getDimensions(c.floating);return g!==O.width||v!==O.height?{reset:{rects:!0}}:{}}}};function mt(){return typeof window<"u"}function Oe(e){return lr(e)?(e.nodeName||"").toLowerCase():"#document"}function V(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function re(e){var t;return(t=(lr(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function lr(e){return mt()?e instanceof Node||e instanceof V(e).Node:!1}function Y(e){return mt()?e instanceof Element||e instanceof V(e).Element:!1}function ae(e){return mt()?e instanceof HTMLElement||e instanceof V(e).HTMLElement:!1}function jn(e){return!mt()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof V(e).ShadowRoot}function He(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=z(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&o!=="inline"&&o!=="contents"}function ws(e){return/^(table|td|th)$/.test(Oe(e))}function vt(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const ys=/transform|translate|scale|rotate|perspective|filter/,xs=/paint|layout|strict|content/,he=e=>!!e&&e!=="none";let Tt;function tn(e){const t=Y(e)?z(e):e;return he(t.transform)||he(t.translate)||he(t.scale)||he(t.rotate)||he(t.perspective)||!nn()&&(he(t.backdropFilter)||he(t.filter))||ys.test(t.willChange||"")||xs.test(t.contain||"")}function bs(e){let t=me(e);for(;ae(t)&&!_e(t);){if(tn(t))return t;if(vt(t))return null;t=me(t)}return null}function nn(){return Tt==null&&(Tt=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Tt}function _e(e){return/^(html|body|#document)$/.test(Oe(e))}function z(e){return V(e).getComputedStyle(e)}function ht(e){return Y(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function me(e){if(Oe(e)==="html")return e;const t=e.assignedSlot||e.parentNode||jn(e)&&e.host||re(e);return jn(t)?t.host:t}function ur(e){const t=me(e);return _e(t)?e.ownerDocument?e.ownerDocument.body:e.body:ae(t)&&He(t)?t:ur(t)}function je(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=ur(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),s=V(o);if(i){const c=Gt(s);return t.concat(s,s.visualViewport||[],He(o)?o:[],c&&n?je(c):[])}else return t.concat(o,je(o,[],n))}function Gt(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function fr(e){const t=z(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=ae(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,c=st(n)!==i||st(r)!==s;return c&&(n=i,r=s),{width:n,height:r,$:c}}function rn(e){return Y(e)?e:e.contextElement}function Se(e){const t=rn(e);if(!ae(t))return te(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=fr(t);let s=(i?st(n.width):n.width)/r,c=(i?st(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!c||!Number.isFinite(c))&&(c=1),{x:s,y:c}}const Cs=te(0);function dr(e){const t=V(e);return!nn()||!t.visualViewport?Cs:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Es(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==V(e)?!1:t}function ge(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=rn(e);let s=te(1);t&&(r?Y(r)&&(s=Se(r)):s=Se(e));const c=Es(i,n,r)?dr(i):te(0);let u=(o.left+c.x)/s.x,d=(o.top+c.y)/s.y,f=o.width/s.x,l=o.height/s.y;if(i){const p=V(i),m=r&&Y(r)?V(r):r;let g=p,v=Gt(g);for(;v&&r&&m!==g;){const w=Se(v),y=v.getBoundingClientRect(),x=z(v),b=y.left+(v.clientLeft+parseFloat(x.paddingLeft))*w.x,C=y.top+(v.clientTop+parseFloat(x.paddingTop))*w.y;u*=w.x,d*=w.y,f*=w.x,l*=w.y,u+=b,d+=C,g=V(v),v=Gt(g)}}return ct({width:f,height:l,x:u,y:d})}function gt(e,t){const n=ht(e).scrollLeft;return t?t.left+n:ge(re(e)).left+n}function pr(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-gt(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function Rs(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i=o==="fixed",s=re(r),c=t?vt(t.floating):!1;if(r===s||c&&i)return n;let u={scrollLeft:0,scrollTop:0},d=te(1);const f=te(0),l=ae(r);if((l||!l&&!i)&&((Oe(r)!=="body"||He(s))&&(u=ht(r)),l)){const m=ge(r);d=Se(r),f.x=m.x+r.clientLeft,f.y=m.y+r.clientTop}const p=s&&!l&&!i?pr(s,u):te(0);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-u.scrollLeft*d.x+f.x+p.x,y:n.y*d.y-u.scrollTop*d.y+f.y+p.y}}function Ss(e){return Array.from(e.getClientRects())}function Ps(e){const t=re(e),n=ht(e),r=e.ownerDocument.body,o=U(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=U(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+gt(e);const c=-n.scrollTop;return z(r).direction==="rtl"&&(s+=U(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:c}}const $n=25;function As(e,t){const n=V(e),r=re(e),o=n.visualViewport;let i=r.clientWidth,s=r.clientHeight,c=0,u=0;if(o){i=o.width,s=o.height;const f=nn();(!f||f&&t==="fixed")&&(c=o.offsetLeft,u=o.offsetTop)}const d=gt(r);if(d<=0){const f=r.ownerDocument,l=f.body,p=getComputedStyle(l),m=f.compatMode==="CSS1Compat"&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,g=Math.abs(r.clientWidth-l.clientWidth-m);g<=$n&&(i-=g)}else d<=$n&&(i+=d);return{width:i,height:s,x:c,y:u}}function Ms(e,t){const n=ge(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=ae(e)?Se(e):te(1),s=e.clientWidth*i.x,c=e.clientHeight*i.y,u=o*i.x,d=r*i.y;return{width:s,height:c,x:u,y:d}}function Wn(e,t,n){let r;if(t==="viewport")r=As(e,n);else if(t==="document")r=Ps(re(e));else if(Y(t))r=Ms(t,n);else{const o=dr(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return ct(r)}function mr(e,t){const n=me(e);return n===t||!Y(n)||_e(n)?!1:z(n).position==="fixed"||mr(n,t)}function _s(e,t){const n=t.get(e);if(n)return n;let r=je(e,[],!1).filter(c=>Y(c)&&Oe(c)!=="body"),o=null;const i=z(e).position==="fixed";let s=i?me(e):e;for(;Y(s)&&!_e(s);){const c=z(s),u=tn(s);!u&&c.position==="fixed"&&(o=null),(i?!u&&!o:!u&&c.position==="static"&&!!o&&(o.position==="absolute"||o.position==="fixed")||He(s)&&!u&&mr(e,s))?r=r.filter(f=>f!==s):o=c,s=me(s)}return t.set(e,r),r}function Ts(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=[...n==="clippingAncestors"?vt(t)?[]:_s(t,this._c):[].concat(n),r],c=Wn(t,s[0],o);let u=c.top,d=c.right,f=c.bottom,l=c.left;for(let p=1;p<s.length;p++){const m=Wn(t,s[p],o);u=U(m.top,u),d=pe(m.right,d),f=pe(m.bottom,f),l=U(m.left,l)}return{width:d-l,height:f-u,x:l,y:u}}function Ds(e){const{width:t,height:n}=fr(e);return{width:t,height:n}}function Os(e,t,n){const r=ae(t),o=re(t),i=n==="fixed",s=ge(e,!0,i,t);let c={scrollLeft:0,scrollTop:0};const u=te(0);function d(){u.x=gt(o)}if(r||!r&&!i)if((Oe(t)!=="body"||He(o))&&(c=ht(t)),r){const m=ge(t,!0,i,t);u.x=m.x+t.clientLeft,u.y=m.y+t.clientTop}else o&&d();i&&!r&&o&&d();const f=o&&!r&&!i?pr(o,c):te(0),l=s.left+c.scrollLeft-u.x-f.x,p=s.top+c.scrollTop-u.y-f.y;return{x:l,y:p,width:s.width,height:s.height}}function Dt(e){return z(e).position==="static"}function Bn(e,t){if(!ae(e)||z(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return re(e)===n&&(n=n.ownerDocument.body),n}function vr(e,t){const n=V(e);if(vt(e))return n;if(!ae(e)){let o=me(e);for(;o&&!_e(o);){if(Y(o)&&!Dt(o))return o;o=me(o)}return n}let r=Bn(e,t);for(;r&&ws(r)&&Dt(r);)r=Bn(r,t);return r&&_e(r)&&Dt(r)&&!tn(r)?n:r||bs(e)||n}const Ns=async function(e){const t=this.getOffsetParent||vr,n=this.getDimensions,r=await n(e.floating);return{reference:Os(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Is(e){return z(e).direction==="rtl"}const ks={convertOffsetParentRelativeRectToViewportRelativeRect:Rs,getDocumentElement:re,getClippingRect:Ts,getOffsetParent:vr,getElementRects:Ns,getClientRects:Ss,getDimensions:Ds,getScale:Se,isElement:Y,isRTL:Is};function hr(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Ls(e,t){let n=null,r;const o=re(e);function i(){var c;clearTimeout(r),(c=n)==null||c.disconnect(),n=null}function s(c,u){c===void 0&&(c=!1),u===void 0&&(u=1),i();const d=e.getBoundingClientRect(),{left:f,top:l,width:p,height:m}=d;if(c||t(),!p||!m)return;const g=qe(l),v=qe(o.clientWidth-(f+p)),w=qe(o.clientHeight-(l+m)),y=qe(f),b={rootMargin:-g+"px "+-v+"px "+-w+"px "+-y+"px",threshold:U(0,pe(1,u))||1};let C=!0;function E(S){const R=S[0].intersectionRatio;if(R!==u){if(!C)return s();R?s(!1,R):r=setTimeout(()=>{s(!1,1e-7)},1e3)}R===1&&!hr(d,e.getBoundingClientRect())&&s(),C=!1}try{n=new IntersectionObserver(E,{...b,root:o.ownerDocument})}catch{n=new IntersectionObserver(E,b)}n.observe(e)}return s(!0),i}function Fs(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:u=!1}=r,d=rn(e),f=o||i?[...d?je(d):[],...t?je(t):[]]:[];f.forEach(y=>{o&&y.addEventListener("scroll",n,{passive:!0}),i&&y.addEventListener("resize",n)});const l=d&&c?Ls(d,n):null;let p=-1,m=null;s&&(m=new ResizeObserver(y=>{let[x]=y;x&&x.target===d&&m&&t&&(m.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var b;(b=m)==null||b.observe(t)})),n()}),d&&!u&&m.observe(d),t&&m.observe(t));let g,v=u?ge(e):null;u&&w();function w(){const y=ge(e);v&&!hr(v,y)&&n(),v=y,g=requestAnimationFrame(w)}return n(),()=>{var y;f.forEach(x=>{o&&x.removeEventListener("scroll",n),i&&x.removeEventListener("resize",n)}),l?.(),(y=m)==null||y.disconnect(),m=null,u&&cancelAnimationFrame(g)}}const js=ms,$s=vs,Ws=fs,Bs=gs,Hs=ds,Hn=us,Gs=hs,Us=(e,t,n)=>{const r=new Map,o={platform:ks,...n},i={...o.platform,_c:r};return ls(e,t,{...o,platform:i})};var Vs=typeof document<"u",Ks=function(){},rt=Vs?a.useLayoutEffect:Ks;function lt(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!lt(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const i=o[r];if(!(i==="_owner"&&e.$$typeof)&&!lt(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function gr(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Gn(e,t){const n=gr(e);return Math.round(t*n)/n}function Ot(e){const t=a.useRef(e);return rt(()=>{t.current=e}),t}function Ys(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:s}={},transform:c=!0,whileElementsMounted:u,open:d}=e,[f,l]=a.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,m]=a.useState(r);lt(p,r)||m(r);const[g,v]=a.useState(null),[w,y]=a.useState(null),x=a.useCallback(_=>{_!==S.current&&(S.current=_,v(_))},[]),b=a.useCallback(_=>{_!==R.current&&(R.current=_,y(_))},[]),C=i||g,E=s||w,S=a.useRef(null),R=a.useRef(null),M=a.useRef(f),O=u!=null,T=Ot(u),I=Ot(o),L=Ot(d),F=a.useCallback(()=>{if(!S.current||!R.current)return;const _={placement:t,strategy:n,middleware:p};I.current&&(_.platform=I.current),Us(S.current,R.current,_).then(P=>{const W={...P,isPositioned:L.current!==!1};k.current&&!lt(M.current,W)&&(M.current=W,qt.flushSync(()=>{l(W)}))})},[p,t,n,I,L]);rt(()=>{d===!1&&M.current.isPositioned&&(M.current.isPositioned=!1,l(_=>({..._,isPositioned:!1})))},[d]);const k=a.useRef(!1);rt(()=>(k.current=!0,()=>{k.current=!1}),[]),rt(()=>{if(C&&(S.current=C),E&&(R.current=E),C&&E){if(T.current)return T.current(C,E,F);F()}},[C,E,F,T,O]);const B=a.useMemo(()=>({reference:S,floating:R,setReference:x,setFloating:b}),[x,b]),D=a.useMemo(()=>({reference:C,floating:E}),[C,E]),$=a.useMemo(()=>{const _={position:n,left:0,top:0};if(!D.floating)return _;const P=Gn(D.floating,f.x),W=Gn(D.floating,f.y);return c?{..._,transform:"translate("+P+"px, "+W+"px)",...gr(D.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:P,top:W}},[n,c,D.floating,f.x,f.y]);return a.useMemo(()=>({...f,update:F,refs:B,elements:D,floatingStyles:$}),[f,F,B,D,$])}const zs=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?Hn({element:r.current,padding:o}).fn(n):{}:r?Hn({element:r,padding:o}).fn(n):{}}}},Xs=(e,t)=>{const n=js(e);return{name:n.name,fn:n.fn,options:[e,t]}},qs=(e,t)=>{const n=$s(e);return{name:n.name,fn:n.fn,options:[e,t]}},Zs=(e,t)=>({fn:Gs(e).fn,options:[e,t]}),Js=(e,t)=>{const n=Ws(e);return{name:n.name,fn:n.fn,options:[e,t]}},Qs=(e,t)=>{const n=Bs(e);return{name:n.name,fn:n.fn,options:[e,t]}},ea=(e,t)=>{const n=Hs(e);return{name:n.name,fn:n.fn,options:[e,t]}},ta=(e,t)=>{const n=zs(e);return{name:n.name,fn:n.fn,options:[e,t]}};var na="Arrow",wr=a.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...i}=e;return h.jsx(N.svg,{...i,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:h.jsx("polygon",{points:"0,0 30,0 15,10"})})});wr.displayName=na;var ra=wr;function yr(e){const[t,n]=a.useState(void 0);return ee(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const i=o[0];let s,c;if("borderBoxSize"in i){const u=i.borderBoxSize,d=Array.isArray(u)?u[0]:u;s=d.inlineSize,c=d.blockSize}else s=e.offsetWidth,c=e.offsetHeight;n({width:s,height:c})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var on="Popper",[xr,wt]=ne(on),[oa,br]=xr(on),Cr=e=>{const{__scopePopper:t,children:n}=e,[r,o]=a.useState(null),[i,s]=a.useState(void 0);return h.jsx(oa,{scope:t,anchor:r,onAnchorChange:o,placementState:i,setPlacementState:s,children:n})};Cr.displayName=on;var Er="PopperAnchor",Rr=a.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,i=br(Er,n),s=a.useRef(null),c=i.onAnchorChange,u=a.useCallback(g=>{s.current=g,g&&c(g)},[c]),d=j(t,u),f=a.useRef(null);a.useEffect(()=>{if(!r)return;const g=f.current;f.current=r.current,g!==f.current&&c(f.current)});const l=i.placementState&&an(i.placementState),p=l?.[0],m=l?.[1];return r?null:h.jsx(N.div,{"data-radix-popper-side":p,"data-radix-popper-align":m,...o,ref:d})});Rr.displayName=Er;var sn="PopperContent",[ia,sa]=xr(sn),Sr=a.forwardRef((e,t)=>{const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:i="center",alignOffset:s=0,arrowPadding:c=0,avoidCollisions:u=!0,collisionBoundary:d,collisionPadding:f=0,sticky:l="partial",hideWhenDetached:p=!1,updatePositionStrategy:m="optimized",onPlaced:g,...v}=e,w=br(sn,n),[y,x]=a.useState(null),b=j(t,ue=>x(ue)),[C,E]=a.useState(null),S=yr(C),R=S?.width??0,M=S?.height??0,O=r+(i!=="center"?"-"+i:""),T=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},I=d?Array.isArray(d)?d:[d]:void 0,L=I!==void 0&&I.length>0,F={padding:T,boundary:I?.filter(ca),altBoundary:L},{refs:k,floatingStyles:B,placement:D,isPositioned:$,middlewareData:_}=Ys({strategy:"fixed",placement:O,whileElementsMounted:(...ue)=>Fs(...ue,{animationFrame:m==="always"}),elements:{reference:w.anchor},middleware:[Xs({mainAxis:o+M,alignmentAxis:s}),u&&qs({mainAxis:!0,crossAxis:!1,limiter:l==="partial"?Zs():void 0,...F}),u&&Js({...F}),Qs({...F,apply:({elements:ue,rects:Pn,availableWidth:Si,availableHeight:Pi})=>{const{width:Ai,height:Mi}=Pn.reference,ze=ue.floating.style;ze.setProperty("--radix-popper-available-width",`${Si}px`),ze.setProperty("--radix-popper-available-height",`${Pi}px`),ze.setProperty("--radix-popper-anchor-width",`${Ai}px`),ze.setProperty("--radix-popper-anchor-height",`${Mi}px`)}}),C&&ta({element:C,padding:c}),la({arrowWidth:R,arrowHeight:M}),p&&ea({strategy:"referenceHidden",...F})]}),P=w.setPlacementState;ee(()=>(P(D),()=>{P(void 0)}),[D,P]);const[W,Z]=an(D),le=oe(g);ee(()=>{$&&le?.()},[$,le]);const Ie=_.arrow?.x,ke=_.arrow?.y,Ye=_.arrow?.centerOffset!==0,[ve,H]=a.useState();return ee(()=>{y&&H(window.getComputedStyle(y).zIndex)},[y]),h.jsx("div",{ref:k.setFloating,"data-radix-popper-content-wrapper":"",style:{...B,transform:$?B.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ve,"--radix-popper-transform-origin":[_.transformOrigin?.x,_.transformOrigin?.y].join(" "),..._.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:h.jsx(ia,{scope:n,placedSide:W,placedAlign:Z,onArrowChange:E,arrowX:Ie,arrowY:ke,shouldHideArrow:Ye,children:h.jsx(N.div,{"data-side":W,"data-align":Z,...v,ref:b,style:{...v.style,animation:$?void 0:"none"}})})})});Sr.displayName=sn;var Pr="PopperArrow",aa={top:"bottom",right:"left",bottom:"top",left:"right"},Ar=a.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,i=sa(Pr,r),s=aa[i.placedSide];return h.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:h.jsx(ra,{...o,ref:n,style:{...o.style,display:"block"}})})});Ar.displayName=Pr;function ca(e){return e!==null}var la=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:o}=t,s=o.arrow?.centerOffset!==0,c=s?0:e.arrowWidth,u=s?0:e.arrowHeight,[d,f]=an(n),l={start:"0%",center:"50%",end:"100%"}[f],p=(o.arrow?.x??0)+c/2,m=(o.arrow?.y??0)+u/2;let g="",v="";return d==="bottom"?(g=s?l:`${p}px`,v=`${-u}px`):d==="top"?(g=s?l:`${p}px`,v=`${r.floating.height+u}px`):d==="right"?(g=`${-u}px`,v=s?l:`${m}px`):d==="left"&&(g=`${r.floating.width+u}px`,v=s?l:`${m}px`),{data:{x:g,y:v}}}});function an(e){const[t,n="center"]=e.split("-");return[t,n]}var Mr=Cr,_r=Rr,Tr=Sr,Dr=Ar,ua="Portal",yt=a.forwardRef((e,t)=>{const{container:n,...r}=e,[o,i]=a.useState(!1);ee(()=>i(!0),[]);const s=n||o&&globalThis?.document?.body;return s?qt.createPortal(h.jsx(N.div,{...r,ref:t}),s):null});yt.displayName=ua;function fa(e,t){return a.useReducer((n,r)=>t[n][r]??n,e)}var X=e=>{const{present:t,children:n}=e,r=da(t),o=typeof n=="function"?n({present:r.isPresent}):a.Children.only(n),i=pa(r.ref,ma(o));return typeof n=="function"||r.isPresent?a.cloneElement(o,{ref:i}):null};X.displayName="Presence";function da(e){const[t,n]=a.useState(),r=a.useRef(null),o=a.useRef(e),i=a.useRef("none"),s=e?"mounted":"unmounted",[c,u]=fa(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return a.useEffect(()=>{const d=Ze(r.current);i.current=c==="mounted"?d:"none"},[c]),ee(()=>{const d=r.current,f=o.current;if(f!==e){const p=i.current,m=Ze(d);e?u("MOUNT"):m==="none"||d?.display==="none"?u("UNMOUNT"):u(f&&p!==m?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,u]),ee(()=>{if(t){let d;const f=t.ownerDocument.defaultView??window,l=m=>{const v=Ze(r.current).includes(CSS.escape(m.animationName));if(m.target===t&&v&&(u("ANIMATION_END"),!o.current)){const w=t.style.animationFillMode;t.style.animationFillMode="forwards",d=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=w)})}},p=m=>{m.target===t&&(i.current=Ze(r.current))};return t.addEventListener("animationstart",p),t.addEventListener("animationcancel",l),t.addEventListener("animationend",l),()=>{f.clearTimeout(d),t.removeEventListener("animationstart",p),t.removeEventListener("animationcancel",l),t.removeEventListener("animationend",l)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:a.useCallback(d=>{r.current=d?getComputedStyle(d):null,n(d)},[])}}function Un(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function pa(...e){const t=a.useRef(e);return t.current=e,a.useCallback(n=>{const r=t.current;let o=!1;const i=r.map(s=>{const c=Un(s,n);return!o&&typeof c=="function"&&(o=!0),c});if(o)return()=>{for(let s=0;s<i.length;s++){const c=i[s];typeof c=="function"?c():Un(r[s],null)}}},[])}function Ze(e){return e?.animationName||"none"}function ma(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var va=Xt[" useInsertionEffect ".trim().toString()]||ee;function Ne({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,i,s]=ha({defaultProp:t,onChange:n}),c=e!==void 0,u=c?e:o;{const f=a.useRef(e!==void 0);a.useEffect(()=>{const l=f.current;l!==c&&console.warn(`${r} is changing from ${l?"controlled":"uncontrolled"} to ${c?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),f.current=c},[c,r])}const d=a.useCallback(f=>{if(c){const l=ga(f)?f(e):f;l!==e&&s.current?.(l)}else i(f)},[c,e,i,s]);return[u,d]}function ha({defaultProp:e,onChange:t}){const[n,r]=a.useState(e),o=a.useRef(n),i=a.useRef(t);return va(()=>{i.current=t},[t]),a.useEffect(()=>{o.current!==n&&(i.current?.(n),o.current=n)},[n,o]),[n,r,i]}function ga(e){return typeof e=="function"}var wa=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),ya="VisuallyHidden",Or=a.forwardRef((e,t)=>h.jsx(N.span,{...e,ref:t,style:{...wa,...e.style}}));Or.displayName=ya;var xa=Or,[xt]=ne("Tooltip",[wt]),bt=wt(),Nr="TooltipProvider",ba=700,Ut="tooltip.open",[Ca,cn]=xt(Nr),Ir=e=>{const{__scopeTooltip:t,delayDuration:n=ba,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:i}=e,s=a.useRef(!0),c=a.useRef(!1),u=a.useRef(0);return a.useEffect(()=>{const d=u.current;return()=>window.clearTimeout(d)},[]),h.jsx(Ca,{scope:t,isOpenDelayedRef:s,delayDuration:n,onOpen:a.useCallback(()=>{r<=0||(window.clearTimeout(u.current),s.current=!1)},[r]),onClose:a.useCallback(()=>{r<=0||(window.clearTimeout(u.current),u.current=window.setTimeout(()=>s.current=!0,r))},[r]),isPointerInTransitRef:c,onPointerInTransitChange:a.useCallback(d=>{c.current=d},[]),disableHoverableContent:o,children:i})};Ir.displayName=Nr;var $e="Tooltip",[Ea,Ge]=xt($e),kr=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:o,onOpenChange:i,disableHoverableContent:s,delayDuration:c}=e,u=cn($e,e.__scopeTooltip),d=bt(t),[f,l]=a.useState(null),p=de(),m=a.useRef(0),g=s??u.disableHoverableContent,v=c??u.delayDuration,w=a.useRef(!1),[y,x]=Ne({prop:r,defaultProp:o??!1,onChange:R=>{R?(u.onOpen(),document.dispatchEvent(new CustomEvent(Ut))):u.onClose(),i?.(R)},caller:$e}),b=a.useMemo(()=>y?w.current?"delayed-open":"instant-open":"closed",[y]),C=a.useCallback(()=>{window.clearTimeout(m.current),m.current=0,w.current=!1,x(!0)},[x]),E=a.useCallback(()=>{window.clearTimeout(m.current),m.current=0,x(!1)},[x]),S=a.useCallback(()=>{window.clearTimeout(m.current),m.current=window.setTimeout(()=>{w.current=!0,x(!0),m.current=0},v)},[v,x]);return a.useEffect(()=>()=>{m.current&&(window.clearTimeout(m.current),m.current=0)},[]),h.jsx(Mr,{...d,children:h.jsx(Ea,{scope:t,contentId:p,open:y,stateAttribute:b,trigger:f,onTriggerChange:l,onTriggerEnter:a.useCallback(()=>{u.isOpenDelayedRef.current?S():C()},[u.isOpenDelayedRef,S,C]),onTriggerLeave:a.useCallback(()=>{g?E():(window.clearTimeout(m.current),m.current=0)},[E,g]),onOpen:C,onClose:E,disableHoverableContent:g,children:n})})};kr.displayName=$e;var Vt="TooltipTrigger",Lr=a.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=Ge(Vt,n),i=cn(Vt,n),s=bt(n),c=a.useRef(null),u=j(t,c,o.onTriggerChange),d=a.useRef(!1),f=a.useRef(!1),l=a.useCallback(()=>d.current=!1,[]);return a.useEffect(()=>()=>document.removeEventListener("pointerup",l),[l]),h.jsx(_r,{asChild:!0,...s,children:h.jsx(N.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:u,onPointerMove:A(e.onPointerMove,p=>{p.pointerType!=="touch"&&!f.current&&!i.isPointerInTransitRef.current&&(o.onTriggerEnter(),f.current=!0)}),onPointerLeave:A(e.onPointerLeave,()=>{o.onTriggerLeave(),f.current=!1}),onPointerDown:A(e.onPointerDown,()=>{o.open&&o.onClose(),d.current=!0,document.addEventListener("pointerup",l,{once:!0})}),onFocus:A(e.onFocus,()=>{d.current||o.onOpen()}),onBlur:A(e.onBlur,o.onClose),onClick:A(e.onClick,o.onClose)})})});Lr.displayName=Vt;var ln="TooltipPortal",[Ra,Sa]=xt(ln,{forceMount:void 0}),Fr=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:o}=e,i=Ge(ln,t);return h.jsx(Ra,{scope:t,forceMount:n,children:h.jsx(X,{present:n||i.open,children:h.jsx(yt,{asChild:!0,container:o,children:r})})})};Fr.displayName=ln;var Te="TooltipContent",jr=a.forwardRef((e,t)=>{const n=Sa(Te,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...i}=e,s=Ge(Te,e.__scopeTooltip);return h.jsx(X,{present:r||s.open,children:s.disableHoverableContent?h.jsx($r,{side:o,...i,ref:t}):h.jsx(Pa,{side:o,...i,ref:t})})}),Pa=a.forwardRef((e,t)=>{const n=Ge(Te,e.__scopeTooltip),r=cn(Te,e.__scopeTooltip),o=a.useRef(null),i=j(t,o),[s,c]=a.useState(null),{trigger:u,onClose:d}=n,f=o.current,{onPointerInTransitChange:l}=r,p=a.useCallback(()=>{c(null),l(!1)},[l]),m=a.useCallback((g,v)=>{const w=g.currentTarget,y={x:g.clientX,y:g.clientY},x=Da(y,w.getBoundingClientRect()),b=Oa(y,x),C=Na(v.getBoundingClientRect()),E=ka([...b,...C]);c(E),l(!0)},[l]);return a.useEffect(()=>()=>p(),[p]),a.useEffect(()=>{if(u&&f){const g=w=>m(w,f),v=w=>m(w,u);return u.addEventListener("pointerleave",g),f.addEventListener("pointerleave",v),()=>{u.removeEventListener("pointerleave",g),f.removeEventListener("pointerleave",v)}}},[u,f,m,p]),a.useEffect(()=>{if(s){const g=v=>{const w=v.target,y={x:v.clientX,y:v.clientY},x=u?.contains(w)||f?.contains(w),b=!Ia(y,s);x?p():b&&(p(),d())};return document.addEventListener("pointermove",g),()=>document.removeEventListener("pointermove",g)}},[u,f,s,d,p]),h.jsx($r,{...e,ref:i})}),[Aa,Ma]=xt($e,{isInside:!1}),_a=rr("TooltipContent"),$r=a.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:i,onPointerDownOutside:s,...c}=e,u=Ge(Te,n),d=bt(n),{onClose:f}=u;return a.useEffect(()=>(document.addEventListener(Ut,f),()=>document.removeEventListener(Ut,f)),[f]),a.useEffect(()=>{if(u.trigger){const l=p=>{p.target instanceof Node&&p.target.contains(u.trigger)&&f()};return window.addEventListener("scroll",l,{capture:!0}),()=>window.removeEventListener("scroll",l,{capture:!0})}},[u.trigger,f]),h.jsx(pt,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:l=>l.preventDefault(),onDismiss:f,children:h.jsxs(Tr,{"data-state":u.stateAttribute,...d,...c,ref:t,style:{...c.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[h.jsx(_a,{children:r}),h.jsx(Aa,{scope:n,isInside:!0,children:h.jsx(xa,{id:u.contentId,role:"tooltip",children:o||r})})]})})});jr.displayName=Te;var Wr="TooltipArrow",Ta=a.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=bt(n);return Ma(Wr,n).isInside?null:h.jsx(Dr,{...o,...r,ref:t})});Ta.displayName=Wr;function Da(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(n,r,o,i)){case i:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function Oa(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function Na(e){const{top:t,right:n,bottom:r,left:o}=e;return[{x:o,y:t},{x:n,y:t},{x:n,y:r},{x:o,y:r}]}function Ia(e,t){const{x:n,y:r}=e;let o=!1;for(let i=0,s=t.length-1;i<t.length;s=i++){const c=t[i],u=t[s],d=c.x,f=c.y,l=u.x,p=u.y;f>r!=p>r&&n<(l-d)*(r-f)/(p-f)+d&&(o=!o)}return o}function ka(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),La(t)}function La(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const o=e[r];for(;t.length>=2;){const i=t[t.length-1],s=t[t.length-2];if((i.x-s.x)*(o.y-s.y)>=(i.y-s.y)*(o.x-s.x))t.pop();else break}t.push(o)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const o=e[r];for(;n.length>=2;){const i=n[n.length-1],s=n[n.length-2];if((i.x-s.x)*(o.y-s.y)>=(i.y-s.y)*(o.x-s.x))n.pop();else break}n.push(o)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var $u=Ir,Wu=kr,Bu=Lr,Hu=Fr,Gu=jr;function Br(e){const t=e+"CollectionProvider",[n,r]=ne(t),[o,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=v=>{const{scope:w,children:y}=v,x=a.useRef(null),b=a.useRef(new Map).current;return h.jsx(o,{scope:w,itemMap:b,collectionRef:x,children:y})};s.displayName=t;const c=e+"CollectionSlot",u=Me(c),d=a.forwardRef((v,w)=>{const{scope:y,children:x}=v,b=i(c,y),C=j(w,b.collectionRef);return h.jsx(u,{ref:C,children:x})});d.displayName=c;const f=e+"CollectionItemSlot",l="data-radix-collection-item",p=Me(f),m=a.forwardRef((v,w)=>{const{scope:y,children:x,...b}=v,C=a.useRef(null),E=j(w,C),S=i(f,y);return a.useEffect(()=>(S.itemMap.set(C,{ref:C,...b}),()=>{S.itemMap.delete(C)})),h.jsx(p,{[l]:"",ref:E,children:x})});m.displayName=f;function g(v){const w=i(e+"CollectionConsumer",v);return a.useCallback(()=>{const x=w.collectionRef.current;if(!x)return[];const b=Array.from(x.querySelectorAll(`[${l}]`));return Array.from(w.itemMap.values()).sort((S,R)=>b.indexOf(S.ref.current)-b.indexOf(R.ref.current))},[w.collectionRef,w.itemMap])}return[{Provider:s,Slot:d,ItemSlot:m},g,r]}var Fa=a.createContext(void 0);function Hr(e){const t=a.useContext(Fa);return e||t||"ltr"}var Je=0,be=null;function Gr(){a.useEffect(()=>{be||(be={start:Vn(),end:Vn()});const{start:e,end:t}=be;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement("afterbegin",e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement("beforeend",t),Je++,()=>{Je===1&&(be?.start.remove(),be?.end.remove(),be=null),Je=Math.max(0,Je-1)}},[])}function Vn(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Nt="focusScope.autoFocusOnMount",It="focusScope.autoFocusOnUnmount",Kn={bubbles:!1,cancelable:!0},ja="FocusScope",un=a.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...s}=e,[c,u]=a.useState(null),d=oe(o),f=oe(i),l=a.useRef(null),p=j(t,v=>u(v)),m=a.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;a.useEffect(()=>{if(r){let v=function(b){if(m.paused||!c)return;const C=b.target;c.contains(C)?l.current=C:fe(l.current,{select:!0})},w=function(b){if(m.paused||!c)return;const C=b.relatedTarget;C!==null&&(c.contains(C)||fe(l.current,{select:!0}))},y=function(b){if(document.activeElement===document.body)for(const E of b)E.removedNodes.length>0&&fe(c)};document.addEventListener("focusin",v),document.addEventListener("focusout",w);const x=new MutationObserver(y);return c&&x.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",v),document.removeEventListener("focusout",w),x.disconnect()}}},[r,c,m.paused]),a.useEffect(()=>{if(c){zn.add(m);const v=document.activeElement;if(!c.contains(v)){const y=new CustomEvent(Nt,Kn);c.addEventListener(Nt,d),c.dispatchEvent(y),y.defaultPrevented||($a(Ua(Ur(c)),{select:!0}),document.activeElement===v&&fe(c))}return()=>{c.removeEventListener(Nt,d),setTimeout(()=>{const y=new CustomEvent(It,Kn);c.addEventListener(It,f),c.dispatchEvent(y),y.defaultPrevented||fe(v??document.body,{select:!0}),c.removeEventListener(It,f),zn.remove(m)},0)}}},[c,d,f,m]);const g=a.useCallback(v=>{if(!n&&!r||m.paused)return;const w=v.key==="Tab"&&!v.altKey&&!v.ctrlKey&&!v.metaKey,y=document.activeElement;if(w&&y){const x=v.currentTarget,[b,C]=Wa(x);b&&C?!v.shiftKey&&y===C?(v.preventDefault(),n&&fe(b,{select:!0})):v.shiftKey&&y===b&&(v.preventDefault(),n&&fe(C,{select:!0})):y===x&&v.preventDefault()}},[n,r,m.paused]);return h.jsx(N.div,{tabIndex:-1,...s,ref:p,onKeyDown:g})});un.displayName=ja;function $a(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(fe(r,{select:t}),document.activeElement!==n)return}function Wa(e){const t=Ur(e),n=Yn(t,e),r=Yn(t.reverse(),e);return[n,r]}function Ur(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Yn(e,t){for(const n of e)if(!Ba(n,{upTo:t}))return n}function Ba(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function Ha(e){return e instanceof HTMLInputElement&&"select"in e}function fe(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Ha(e)&&t&&e.select()}}var zn=Ga();function Ga(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=Xn(e,t),e.unshift(t)},remove(t){e=Xn(e,t),e[0]?.resume()}}}function Xn(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Ua(e){return e.filter(t=>t.tagName!=="A")}var kt="rovingFocusGroup.onEntryFocus",Va={bubbles:!1,cancelable:!0},Ue="RovingFocusGroup",[Kt,Vr,Ka]=Br(Ue),[Ya,Kr]=ne(Ue,[Ka]),[za,Xa]=Ya(Ue),Yr=a.forwardRef((e,t)=>h.jsx(Kt.Provider,{scope:e.__scopeRovingFocusGroup,children:h.jsx(Kt.Slot,{scope:e.__scopeRovingFocusGroup,children:h.jsx(qa,{...e,ref:t})})}));Yr.displayName=Ue;var qa=a.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:i,currentTabStopId:s,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:u,onEntryFocus:d,preventScrollOnEntryFocus:f=!1,...l}=e,p=a.useRef(null),m=j(t,p),g=Hr(i),[v,w]=Ne({prop:s,defaultProp:c??null,onChange:u,caller:Ue}),[y,x]=a.useState(!1),b=oe(d),C=Vr(n),E=a.useRef(!1),[S,R]=a.useState(0);return a.useEffect(()=>{const M=p.current;if(M)return M.addEventListener(kt,b),()=>M.removeEventListener(kt,b)},[b]),h.jsx(za,{scope:n,orientation:r,dir:g,loop:o,currentTabStopId:v,onItemFocus:a.useCallback(M=>w(M),[w]),onItemShiftTab:a.useCallback(()=>x(!0),[]),onFocusableItemAdd:a.useCallback(()=>R(M=>M+1),[]),onFocusableItemRemove:a.useCallback(()=>R(M=>M-1),[]),children:h.jsx(N.div,{tabIndex:y||S===0?-1:0,"data-orientation":r,...l,ref:m,style:{outline:"none",...e.style},onMouseDown:A(e.onMouseDown,()=>{E.current=!0}),onFocus:A(e.onFocus,M=>{const O=!E.current;if(M.target===M.currentTarget&&O&&!y){const T=new CustomEvent(kt,Va);if(M.currentTarget.dispatchEvent(T),!T.defaultPrevented){const I=C().filter(D=>D.focusable),L=I.find(D=>D.active),F=I.find(D=>D.id===v),B=[L,F,...I].filter(Boolean).map(D=>D.ref.current);qr(B,f)}}E.current=!1}),onBlur:A(e.onBlur,()=>x(!1))})})}),zr="RovingFocusGroupItem",Xr=a.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:i,children:s,...c}=e,u=de(),d=i||u,f=Xa(zr,n),l=f.currentTabStopId===d,p=Vr(n),{onFocusableItemAdd:m,onFocusableItemRemove:g,currentTabStopId:v}=f;return a.useEffect(()=>{if(r)return m(),()=>g()},[r,m,g]),h.jsx(Kt.ItemSlot,{scope:n,id:d,focusable:r,active:o,children:h.jsx(N.span,{tabIndex:l?0:-1,"data-orientation":f.orientation,...c,ref:t,onMouseDown:A(e.onMouseDown,w=>{r?f.onItemFocus(d):w.preventDefault()}),onFocus:A(e.onFocus,()=>f.onItemFocus(d)),onKeyDown:A(e.onKeyDown,w=>{if(w.key==="Tab"&&w.shiftKey){f.onItemShiftTab();return}if(w.target!==w.currentTarget)return;const y=Qa(w,f.orientation,f.dir);if(y!==void 0){if(w.metaKey||w.ctrlKey||w.altKey||w.shiftKey)return;w.preventDefault();let b=p().filter(C=>C.focusable).map(C=>C.ref.current);if(y==="last")b.reverse();else if(y==="prev"||y==="next"){y==="prev"&&b.reverse();const C=b.indexOf(w.currentTarget);b=f.loop?ec(b,C+1):b.slice(C+1)}setTimeout(()=>qr(b))}}),children:typeof s=="function"?s({isCurrentTabStop:l,hasTabStop:v!=null}):s})})});Xr.displayName=zr;var Za={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Ja(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Qa(e,t,n){const r=Ja(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return Za[r]}function qr(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function ec(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var tc=Yr,nc=Xr,rc=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Ce=new WeakMap,Qe=new WeakMap,et={},Lt=0,Zr=function(e){return e&&(e.host||Zr(e.parentNode))},oc=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=Zr(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},ic=function(e,t,n,r){var o=oc(t,Array.isArray(e)?e:[e]);et[n]||(et[n]=new WeakMap);var i=et[n],s=[],c=new Set,u=new Set(o),d=function(l){!l||c.has(l)||(c.add(l),d(l.parentNode))};o.forEach(d);var f=function(l){!l||u.has(l)||Array.prototype.forEach.call(l.children,function(p){if(c.has(p))f(p);else try{var m=p.getAttribute(r),g=m!==null&&m!=="false",v=(Ce.get(p)||0)+1,w=(i.get(p)||0)+1;Ce.set(p,v),i.set(p,w),s.push(p),v===1&&g&&Qe.set(p,!0),w===1&&p.setAttribute(n,"true"),g||p.setAttribute(r,"true")}catch(y){console.error("aria-hidden: cannot operate on ",p,y)}})};return f(t),c.clear(),Lt++,function(){s.forEach(function(l){var p=Ce.get(l)-1,m=i.get(l)-1;Ce.set(l,p),i.set(l,m),p||(Qe.has(l)||l.removeAttribute(r),Qe.delete(l)),m||l.removeAttribute(n)}),Lt--,Lt||(Ce=new WeakMap,Ce=new WeakMap,Qe=new WeakMap,et={})}},Jr=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=rc(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),ic(r,o,n,"aria-hidden")):function(){return null}},J=function(){return J=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},J.apply(this,arguments)};function Qr(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function sc(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,i;r<o;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}var ot="right-scroll-bar-position",it="width-before-scroll-bar",ac="with-scroll-bars-hidden",cc="--removed-body-scroll-bar-size";function Ft(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function lc(e,t){var n=a.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}var uc=typeof window<"u"?a.useLayoutEffect:a.useEffect,qn=new WeakMap;function fc(e,t){var n=lc(null,function(r){return e.forEach(function(o){return Ft(o,r)})});return uc(function(){var r=qn.get(n);if(r){var o=new Set(r),i=new Set(e),s=n.current;o.forEach(function(c){i.has(c)||Ft(c,null)}),i.forEach(function(c){o.has(c)||Ft(c,s)})}qn.set(n,e)},[e]),n}function dc(e){return e}function pc(e,t){t===void 0&&(t=dc);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(i){var s=t(i,r);return n.push(s),function(){n=n.filter(function(c){return c!==s})}},assignSyncMedium:function(i){for(r=!0;n.length;){var s=n;n=[],s.forEach(i)}n={push:function(c){return i(c)},filter:function(){return n}}},assignMedium:function(i){r=!0;var s=[];if(n.length){var c=n;n=[],c.forEach(i),s=n}var u=function(){var f=s;s=[],f.forEach(i)},d=function(){return Promise.resolve().then(u)};d(),n={push:function(f){s.push(f),d()},filter:function(f){return s=s.filter(f),n}}}};return o}function mc(e){e===void 0&&(e={});var t=pc(null);return t.options=J({async:!0,ssr:!1},e),t}var eo=function(e){var t=e.sideCar,n=Qr(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return a.createElement(r,J({},n))};eo.isSideCarExport=!0;function vc(e,t){return e.useMedium(t),eo}var to=mc(),jt=function(){},Ct=a.forwardRef(function(e,t){var n=a.useRef(null),r=a.useState({onScrollCapture:jt,onWheelCapture:jt,onTouchMoveCapture:jt}),o=r[0],i=r[1],s=e.forwardProps,c=e.children,u=e.className,d=e.removeScrollBar,f=e.enabled,l=e.shards,p=e.sideCar,m=e.noRelative,g=e.noIsolation,v=e.inert,w=e.allowPinchZoom,y=e.as,x=y===void 0?"div":y,b=e.gapMode,C=Qr(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),E=p,S=fc([n,t]),R=J(J({},C),o);return a.createElement(a.Fragment,null,f&&a.createElement(E,{sideCar:to,removeScrollBar:d,shards:l,noRelative:m,noIsolation:g,inert:v,setCallbacks:i,allowPinchZoom:!!w,lockRef:n,gapMode:b}),s?a.cloneElement(a.Children.only(c),J(J({},R),{ref:S})):a.createElement(x,J({},R,{className:u,ref:S}),c))});Ct.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Ct.classNames={fullWidth:it,zeroRight:ot};var hc=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function gc(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=hc();return t&&e.setAttribute("nonce",t),e}function wc(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function yc(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var xc=function(){var e=0,t=null;return{add:function(n){e==0&&(t=gc())&&(wc(t,n),yc(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},bc=function(){var e=xc();return function(t,n){a.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},no=function(){var e=bc(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},Cc={left:0,top:0,right:0,gap:0},$t=function(e){return parseInt(e||"",10)||0},Ec=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[$t(n),$t(r),$t(o)]},Rc=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Cc;var t=Ec(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Sc=no(),Pe="data-scroll-locked",Pc=function(e,t,n,r){var o=e.left,i=e.top,s=e.right,c=e.gap;return n===void 0&&(n="margin"),`
|
|
2
|
+
.`.concat(ac,` {
|
|
3
|
+
overflow: hidden `).concat(r,`;
|
|
4
|
+
padding-right: `).concat(c,"px ").concat(r,`;
|
|
5
|
+
}
|
|
6
|
+
body[`).concat(Pe,`] {
|
|
7
|
+
overflow: hidden `).concat(r,`;
|
|
8
|
+
overscroll-behavior: contain;
|
|
9
|
+
`).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
|
|
10
|
+
padding-left: `.concat(o,`px;
|
|
11
|
+
padding-top: `).concat(i,`px;
|
|
12
|
+
padding-right: `).concat(s,`px;
|
|
13
|
+
margin-left:0;
|
|
14
|
+
margin-top:0;
|
|
15
|
+
margin-right: `).concat(c,"px ").concat(r,`;
|
|
16
|
+
`),n==="padding"&&"padding-right: ".concat(c,"px ").concat(r,";")].filter(Boolean).join(""),`
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.`).concat(ot,` {
|
|
20
|
+
right: `).concat(c,"px ").concat(r,`;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.`).concat(it,` {
|
|
24
|
+
margin-right: `).concat(c,"px ").concat(r,`;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.`).concat(ot," .").concat(ot,` {
|
|
28
|
+
right: 0 `).concat(r,`;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.`).concat(it," .").concat(it,` {
|
|
32
|
+
margin-right: 0 `).concat(r,`;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
body[`).concat(Pe,`] {
|
|
36
|
+
`).concat(cc,": ").concat(c,`px;
|
|
37
|
+
}
|
|
38
|
+
`)},Zn=function(){var e=parseInt(document.body.getAttribute(Pe)||"0",10);return isFinite(e)?e:0},Ac=function(){a.useEffect(function(){return document.body.setAttribute(Pe,(Zn()+1).toString()),function(){var e=Zn()-1;e<=0?document.body.removeAttribute(Pe):document.body.setAttribute(Pe,e.toString())}},[])},Mc=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;Ac();var i=a.useMemo(function(){return Rc(o)},[o]);return a.createElement(Sc,{styles:Pc(i,!t,o,n?"":"!important")})},Yt=!1;if(typeof window<"u")try{var tt=Object.defineProperty({},"passive",{get:function(){return Yt=!0,!0}});window.addEventListener("test",tt,tt),window.removeEventListener("test",tt,tt)}catch{Yt=!1}var Ee=Yt?{passive:!1}:!1,_c=function(e){return e.tagName==="TEXTAREA"},ro=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!_c(e)&&n[t]==="visible")},Tc=function(e){return ro(e,"overflowY")},Dc=function(e){return ro(e,"overflowX")},Jn=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=oo(e,r);if(o){var i=io(e,r),s=i[1],c=i[2];if(s>c)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Oc=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},Nc=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},oo=function(e,t){return e==="v"?Tc(t):Dc(t)},io=function(e,t){return e==="v"?Oc(t):Nc(t)},Ic=function(e,t){return e==="h"&&t==="rtl"?-1:1},kc=function(e,t,n,r,o){var i=Ic(e,window.getComputedStyle(t).direction),s=i*r,c=n.target,u=t.contains(c),d=!1,f=s>0,l=0,p=0;do{if(!c)break;var m=io(e,c),g=m[0],v=m[1],w=m[2],y=v-w-i*g;(g||y)&&oo(e,c)&&(l+=y,p+=g);var x=c.parentNode;c=x&&x.nodeType===Node.DOCUMENT_FRAGMENT_NODE?x.host:x}while(!u&&c!==document.body||u&&(t.contains(c)||t===c));return(f&&Math.abs(l)<1||!f&&Math.abs(p)<1)&&(d=!0),d},nt=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Qn=function(e){return[e.deltaX,e.deltaY]},er=function(e){return e&&"current"in e?e.current:e},Lc=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Fc=function(e){return`
|
|
39
|
+
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
40
|
+
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
41
|
+
`)},jc=0,Re=[];function $c(e){var t=a.useRef([]),n=a.useRef([0,0]),r=a.useRef(),o=a.useState(jc++)[0],i=a.useState(no)[0],s=a.useRef(e);a.useEffect(function(){s.current=e},[e]),a.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var v=sc([e.lockRef.current],(e.shards||[]).map(er),!0).filter(Boolean);return v.forEach(function(w){return w.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),v.forEach(function(w){return w.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var c=a.useCallback(function(v,w){if("touches"in v&&v.touches.length===2||v.type==="wheel"&&v.ctrlKey)return!s.current.allowPinchZoom;var y=nt(v),x=n.current,b="deltaX"in v?v.deltaX:x[0]-y[0],C="deltaY"in v?v.deltaY:x[1]-y[1],E,S=v.target,R=Math.abs(b)>Math.abs(C)?"h":"v";if("touches"in v&&R==="h"&&S.type==="range")return!1;var M=window.getSelection(),O=M&&M.anchorNode,T=O?O===S||O.contains(S):!1;if(T)return!1;var I=Jn(R,S);if(!I)return!0;if(I?E=R:(E=R==="v"?"h":"v",I=Jn(R,S)),!I)return!1;if(!r.current&&"changedTouches"in v&&(b||C)&&(r.current=E),!E)return!0;var L=r.current||E;return kc(L,w,v,L==="h"?b:C)},[]),u=a.useCallback(function(v){var w=v;if(!(!Re.length||Re[Re.length-1]!==i)){var y="deltaY"in w?Qn(w):nt(w),x=t.current.filter(function(E){return E.name===w.type&&(E.target===w.target||w.target===E.shadowParent)&&Lc(E.delta,y)})[0];if(x&&x.should){w.cancelable&&w.preventDefault();return}if(!x){var b=(s.current.shards||[]).map(er).filter(Boolean).filter(function(E){return E.contains(w.target)}),C=b.length>0?c(w,b[0]):!s.current.noIsolation;C&&w.cancelable&&w.preventDefault()}}},[]),d=a.useCallback(function(v,w,y,x){var b={name:v,delta:w,target:y,should:x,shadowParent:Wc(y)};t.current.push(b),setTimeout(function(){t.current=t.current.filter(function(C){return C!==b})},1)},[]),f=a.useCallback(function(v){n.current=nt(v),r.current=void 0},[]),l=a.useCallback(function(v){d(v.type,Qn(v),v.target,c(v,e.lockRef.current))},[]),p=a.useCallback(function(v){d(v.type,nt(v),v.target,c(v,e.lockRef.current))},[]);a.useEffect(function(){return Re.push(i),e.setCallbacks({onScrollCapture:l,onWheelCapture:l,onTouchMoveCapture:p}),document.addEventListener("wheel",u,Ee),document.addEventListener("touchmove",u,Ee),document.addEventListener("touchstart",f,Ee),function(){Re=Re.filter(function(v){return v!==i}),document.removeEventListener("wheel",u,Ee),document.removeEventListener("touchmove",u,Ee),document.removeEventListener("touchstart",f,Ee)}},[]);var m=e.removeScrollBar,g=e.inert;return a.createElement(a.Fragment,null,g?a.createElement(i,{styles:Fc(o)}):null,m?a.createElement(Mc,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Wc(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Bc=vc(to,$c);var fn=a.forwardRef(function(e,t){return a.createElement(Ct,J({},e,{ref:t,sideCar:Bc}))});fn.classNames=Ct.classNames;var zt=["Enter"," "],Hc=["ArrowDown","PageUp","Home"],so=["ArrowUp","PageDown","End"],Gc=[...Hc,...so],Uc={ltr:[...zt,"ArrowRight"],rtl:[...zt,"ArrowLeft"]},Vc={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Ve="Menu",[We,Kc,Yc]=Br(Ve),[ye,ao]=ne(Ve,[Yc,wt,Kr]),Et=wt(),co=Kr(),[zc,xe]=ye(Ve),[Xc,Ke]=ye(Ve),lo=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:o,onOpenChange:i,modal:s=!0}=e,c=Et(t),[u,d]=a.useState(null),f=a.useRef(!1),l=oe(i),p=Hr(o);return a.useEffect(()=>{const m=()=>{f.current=!0,document.addEventListener("pointerdown",g,{capture:!0,once:!0}),document.addEventListener("pointermove",g,{capture:!0,once:!0})},g=()=>f.current=!1;return document.addEventListener("keydown",m,{capture:!0}),()=>{document.removeEventListener("keydown",m,{capture:!0}),document.removeEventListener("pointerdown",g,{capture:!0}),document.removeEventListener("pointermove",g,{capture:!0})}},[]),h.jsx(Mr,{...c,children:h.jsx(zc,{scope:t,open:n,onOpenChange:l,content:u,onContentChange:d,children:h.jsx(Xc,{scope:t,onClose:a.useCallback(()=>l(!1),[l]),isUsingKeyboardRef:f,dir:p,modal:s,children:r})})})};lo.displayName=Ve;var qc="MenuAnchor",dn=a.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=Et(n);return h.jsx(_r,{...o,...r,ref:t})});dn.displayName=qc;var pn="MenuPortal",[Zc,uo]=ye(pn,{forceMount:void 0}),fo=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:o}=e,i=xe(pn,t);return h.jsx(Zc,{scope:t,forceMount:n,children:h.jsx(X,{present:n||i.open,children:h.jsx(yt,{asChild:!0,container:o,children:r})})})};fo.displayName=pn;var K="MenuContent",[Jc,mn]=ye(K),po=a.forwardRef((e,t)=>{const n=uo(K,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,i=xe(K,e.__scopeMenu),s=Ke(K,e.__scopeMenu);return h.jsx(We.Provider,{scope:e.__scopeMenu,children:h.jsx(X,{present:r||i.open,children:h.jsx(We.Slot,{scope:e.__scopeMenu,children:s.modal?h.jsx(Qc,{...o,ref:t}):h.jsx(el,{...o,ref:t})})})})}),Qc=a.forwardRef((e,t)=>{const n=xe(K,e.__scopeMenu),r=a.useRef(null),o=j(t,r);return a.useEffect(()=>{const i=r.current;if(i)return Jr(i)},[]),h.jsx(vn,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:A(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),el=a.forwardRef((e,t)=>{const n=xe(K,e.__scopeMenu);return h.jsx(vn,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),tl=Me("MenuContent.ScrollLock"),vn=a.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:o,onOpenAutoFocus:i,onCloseAutoFocus:s,disableOutsidePointerEvents:c,onEntryFocus:u,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:l,onInteractOutside:p,onDismiss:m,disableOutsideScroll:g,...v}=e,w=xe(K,n),y=Ke(K,n),x=Et(n),b=co(n),C=Kc(n),[E,S]=a.useState(null),R=a.useRef(null),M=j(t,R,w.onContentChange),O=a.useRef(0),T=a.useRef(""),I=a.useRef(0),L=a.useRef(null),F=a.useRef("right"),k=a.useRef(0),B=g?fn:a.Fragment,D=g?{as:tl,allowPinchZoom:!0}:void 0,$=P=>{const W=T.current+P,Z=C().filter(H=>!H.disabled),le=document.activeElement,Ie=Z.find(H=>H.ref.current===le)?.textValue,ke=Z.map(H=>H.textValue),Ye=pl(ke,W,Ie),ve=Z.find(H=>H.textValue===Ye)?.ref.current;(function H(ue){T.current=ue,window.clearTimeout(O.current),ue!==""&&(O.current=window.setTimeout(()=>H(""),1e3))})(W),ve&&setTimeout(()=>ve.focus())};a.useEffect(()=>()=>window.clearTimeout(O.current),[]),Gr();const _=a.useCallback(P=>F.current===L.current?.side&&vl(P,L.current?.area),[]);return h.jsx(Jc,{scope:n,searchRef:T,onItemEnter:a.useCallback(P=>{_(P)&&P.preventDefault()},[_]),onItemLeave:a.useCallback(P=>{_(P)||(R.current?.focus(),S(null))},[_]),onTriggerLeave:a.useCallback(P=>{_(P)&&P.preventDefault()},[_]),pointerGraceTimerRef:I,onPointerGraceIntentChange:a.useCallback(P=>{L.current=P},[]),children:h.jsx(B,{...D,children:h.jsx(un,{asChild:!0,trapped:o,onMountAutoFocus:A(i,P=>{P.preventDefault(),R.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:s,children:h.jsx(pt,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:l,onInteractOutside:p,onDismiss:m,children:h.jsx(tc,{asChild:!0,...b,dir:y.dir,orientation:"vertical",loop:r,currentTabStopId:E,onCurrentTabStopIdChange:S,onEntryFocus:A(u,P=>{y.isUsingKeyboardRef.current||P.preventDefault()}),preventScrollOnEntryFocus:!0,children:h.jsx(Tr,{role:"menu","aria-orientation":"vertical","data-state":_o(w.open),"data-radix-menu-content":"",dir:y.dir,...x,...v,ref:M,style:{outline:"none",...v.style},onKeyDown:A(v.onKeyDown,P=>{const Z=P.target.closest("[data-radix-menu-content]")===P.currentTarget,le=P.ctrlKey||P.altKey||P.metaKey,Ie=P.key.length===1;Z&&(P.key==="Tab"&&P.preventDefault(),!le&&Ie&&$(P.key));const ke=R.current;if(P.target!==ke||!Gc.includes(P.key))return;P.preventDefault();const ve=C().filter(H=>!H.disabled).map(H=>H.ref.current);so.includes(P.key)&&ve.reverse(),fl(ve)}),onBlur:A(e.onBlur,P=>{P.currentTarget.contains(P.target)||(window.clearTimeout(O.current),T.current="")}),onPointerMove:A(e.onPointerMove,Be(P=>{const W=P.target,Z=k.current!==P.clientX;if(P.currentTarget.contains(W)&&Z){const le=P.clientX>k.current?"right":"left";F.current=le,k.current=P.clientX}}))})})})})})})});po.displayName=K;var nl="MenuGroup",hn=a.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return h.jsx(N.div,{role:"group",...r,ref:t})});hn.displayName=nl;var rl="MenuLabel",mo=a.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return h.jsx(N.div,{...r,ref:t})});mo.displayName=rl;var ut="MenuItem",tr="menu.itemSelect",Rt=a.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...o}=e,i=a.useRef(null),s=Ke(ut,e.__scopeMenu),c=mn(ut,e.__scopeMenu),u=j(t,i),d=a.useRef(!1),f=()=>{const l=i.current;if(!n&&l){const p=new CustomEvent(tr,{bubbles:!0,cancelable:!0});l.addEventListener(tr,m=>r?.(m),{once:!0}),or(l,p),p.defaultPrevented?d.current=!1:s.onClose()}};return h.jsx(vo,{...o,ref:u,disabled:n,onClick:A(e.onClick,f),onPointerDown:l=>{e.onPointerDown?.(l),d.current=!0},onPointerUp:A(e.onPointerUp,l=>{d.current||l.currentTarget?.click()}),onKeyDown:A(e.onKeyDown,l=>{const p=c.searchRef.current!=="";n||p&&l.key===" "||zt.includes(l.key)&&(l.currentTarget.click(),l.preventDefault())})})});Rt.displayName=ut;var vo=a.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:o,...i}=e,s=mn(ut,n),c=co(n),u=a.useRef(null),d=j(t,u),[f,l]=a.useState(!1),[p,m]=a.useState("");return a.useEffect(()=>{const g=u.current;g&&m((g.textContent??"").trim())},[i.children]),h.jsx(We.ItemSlot,{scope:n,disabled:r,textValue:o??p,children:h.jsx(nc,{asChild:!0,...c,focusable:!r,children:h.jsx(N.div,{role:"menuitem","data-highlighted":f?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...i,ref:d,onPointerMove:A(e.onPointerMove,Be(g=>{r?s.onItemLeave(g):(s.onItemEnter(g),g.defaultPrevented||g.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:A(e.onPointerLeave,Be(g=>s.onItemLeave(g))),onFocus:A(e.onFocus,()=>l(!0)),onBlur:A(e.onBlur,()=>l(!1))})})})}),ol="MenuCheckboxItem",ho=a.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...o}=e;return h.jsx(bo,{scope:e.__scopeMenu,checked:n,children:h.jsx(Rt,{role:"menuitemcheckbox","aria-checked":ft(n)?"mixed":n,...o,ref:t,"data-state":wn(n),onSelect:A(o.onSelect,()=>r?.(ft(n)?!0:!n),{checkForDefaultPrevented:!1})})})});ho.displayName=ol;var go="MenuRadioGroup",[il,sl]=ye(go,{value:void 0,onValueChange:()=>{}}),wo=a.forwardRef((e,t)=>{const{value:n,onValueChange:r,...o}=e,i=oe(r);return h.jsx(il,{scope:e.__scopeMenu,value:n,onValueChange:i,children:h.jsx(hn,{...o,ref:t})})});wo.displayName=go;var yo="MenuRadioItem",xo=a.forwardRef((e,t)=>{const{value:n,...r}=e,o=sl(yo,e.__scopeMenu),i=n===o.value;return h.jsx(bo,{scope:e.__scopeMenu,checked:i,children:h.jsx(Rt,{role:"menuitemradio","aria-checked":i,...r,ref:t,"data-state":wn(i),onSelect:A(r.onSelect,()=>o.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});xo.displayName=yo;var gn="MenuItemIndicator",[bo,al]=ye(gn,{checked:!1}),Co=a.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...o}=e,i=al(gn,n);return h.jsx(X,{present:r||ft(i.checked)||i.checked===!0,children:h.jsx(N.span,{...o,ref:t,"data-state":wn(i.checked)})})});Co.displayName=gn;var cl="MenuSeparator",Eo=a.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return h.jsx(N.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});Eo.displayName=cl;var ll="MenuArrow",Ro=a.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=Et(n);return h.jsx(Dr,{...o,...r,ref:t})});Ro.displayName=ll;var ul="MenuSub",[Uu,So]=ye(ul),Fe="MenuSubTrigger",Po=a.forwardRef((e,t)=>{const n=xe(Fe,e.__scopeMenu),r=Ke(Fe,e.__scopeMenu),o=So(Fe,e.__scopeMenu),i=mn(Fe,e.__scopeMenu),s=a.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:u}=i,d={__scopeMenu:e.__scopeMenu},f=a.useCallback(()=>{s.current&&window.clearTimeout(s.current),s.current=null},[]);return a.useEffect(()=>f,[f]),a.useEffect(()=>{const l=c.current;return()=>{window.clearTimeout(l),u(null)}},[c,u]),h.jsx(dn,{asChild:!0,...d,children:h.jsx(vo,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":n.open?o.contentId:void 0,"data-state":_o(n.open),...e,ref:Zt(t,o.onTriggerChange),onClick:l=>{e.onClick?.(l),!(e.disabled||l.defaultPrevented)&&(l.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:A(e.onPointerMove,Be(l=>{i.onItemEnter(l),!l.defaultPrevented&&!e.disabled&&!n.open&&!s.current&&(i.onPointerGraceIntentChange(null),s.current=window.setTimeout(()=>{n.onOpenChange(!0),f()},100))})),onPointerLeave:A(e.onPointerLeave,Be(l=>{f();const p=n.content?.getBoundingClientRect();if(p){const m=n.content?.dataset.side,g=m==="right",v=g?-5:5,w=p[g?"left":"right"],y=p[g?"right":"left"];i.onPointerGraceIntentChange({area:[{x:l.clientX+v,y:l.clientY},{x:w,y:p.top},{x:y,y:p.top},{x:y,y:p.bottom},{x:w,y:p.bottom}],side:m}),window.clearTimeout(c.current),c.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(l),l.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:A(e.onKeyDown,l=>{const p=i.searchRef.current!=="";e.disabled||p&&l.key===" "||Uc[r.dir].includes(l.key)&&(n.onOpenChange(!0),n.content?.focus(),l.preventDefault())})})})});Po.displayName=Fe;var Ao="MenuSubContent",Mo=a.forwardRef((e,t)=>{const n=uo(K,e.__scopeMenu),{forceMount:r=n.forceMount,align:o="start",...i}=e,s=xe(K,e.__scopeMenu),c=Ke(K,e.__scopeMenu),u=So(Ao,e.__scopeMenu),d=a.useRef(null),f=j(t,d);return h.jsx(We.Provider,{scope:e.__scopeMenu,children:h.jsx(X,{present:r||s.open,children:h.jsx(We.Slot,{scope:e.__scopeMenu,children:h.jsx(vn,{id:u.contentId,"aria-labelledby":u.triggerId,...i,ref:f,align:o,side:c.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:l=>{c.isUsingKeyboardRef.current&&d.current?.focus(),l.preventDefault()},onCloseAutoFocus:l=>l.preventDefault(),onFocusOutside:A(e.onFocusOutside,l=>{l.target!==u.trigger&&s.onOpenChange(!1)}),onEscapeKeyDown:A(e.onEscapeKeyDown,l=>{c.onClose(),l.preventDefault()}),onKeyDown:A(e.onKeyDown,l=>{const p=l.currentTarget.contains(l.target),m=Vc[c.dir].includes(l.key);p&&m&&(s.onOpenChange(!1),u.trigger?.focus(),l.preventDefault())})})})})})});Mo.displayName=Ao;function _o(e){return e?"open":"closed"}function ft(e){return e==="indeterminate"}function wn(e){return ft(e)?"indeterminate":e?"checked":"unchecked"}function fl(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function dl(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function pl(e,t,n){const o=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let s=dl(e,Math.max(i,0));o.length===1&&(s=s.filter(d=>d!==n));const u=s.find(d=>d.toLowerCase().startsWith(o.toLowerCase()));return u!==n?u:void 0}function ml(e,t){const{x:n,y:r}=e;let o=!1;for(let i=0,s=t.length-1;i<t.length;s=i++){const c=t[i],u=t[s],d=c.x,f=c.y,l=u.x,p=u.y;f>r!=p>r&&n<(l-d)*(r-f)/(p-f)+d&&(o=!o)}return o}function vl(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return ml(n,t)}function Be(e){return t=>t.pointerType==="mouse"?e(t):void 0}var hl=lo,gl=dn,wl=fo,yl=po,xl=hn,bl=mo,Cl=Rt,El=ho,Rl=wo,Sl=xo,Pl=Co,Al=Eo,Ml=Ro,_l=Po,Tl=Mo,St="DropdownMenu",[Dl]=ne(St,[ao]),G=ao(),[Ol,To]=Dl(St),Do=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:o,defaultOpen:i,onOpenChange:s,modal:c=!0}=e,u=G(t),d=a.useRef(null),[f,l]=Ne({prop:o,defaultProp:i??!1,onChange:s,caller:St});return h.jsx(Ol,{scope:t,triggerId:de(),triggerRef:d,contentId:de(),open:f,onOpenChange:l,onOpenToggle:a.useCallback(()=>l(p=>!p),[l]),modal:c,children:h.jsx(hl,{...u,open:f,onOpenChange:l,dir:r,modal:c,children:n})})};Do.displayName=St;var Oo="DropdownMenuTrigger",No=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...o}=e,i=To(Oo,n),s=G(n);return h.jsx(gl,{asChild:!0,...s,children:h.jsx(N.button,{type:"button",id:i.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":i.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...o,ref:Zt(t,i.triggerRef),onPointerDown:A(e.onPointerDown,c=>{!r&&c.button===0&&c.ctrlKey===!1&&(i.onOpenToggle(),i.open||c.preventDefault())}),onKeyDown:A(e.onKeyDown,c=>{r||(["Enter"," "].includes(c.key)&&i.onOpenToggle(),c.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(c.key)&&c.preventDefault())})})})});No.displayName=Oo;var Nl="DropdownMenuPortal",Io=e=>{const{__scopeDropdownMenu:t,...n}=e,r=G(t);return h.jsx(wl,{...r,...n})};Io.displayName=Nl;var ko="DropdownMenuContent",Lo=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=To(ko,n),i=G(n),s=a.useRef(!1);return h.jsx(yl,{id:o.contentId,"aria-labelledby":o.triggerId,...i,...r,ref:t,onCloseAutoFocus:A(e.onCloseAutoFocus,c=>{s.current||o.triggerRef.current?.focus(),s.current=!1,c.preventDefault()}),onInteractOutside:A(e.onInteractOutside,c=>{const u=c.detail.originalEvent,d=u.button===0&&u.ctrlKey===!0,f=u.button===2||d;(!o.modal||f)&&(s.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Lo.displayName=ko;var Il="DropdownMenuGroup",kl=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=G(n);return h.jsx(xl,{...o,...r,ref:t})});kl.displayName=Il;var Ll="DropdownMenuLabel",Fl=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=G(n);return h.jsx(bl,{...o,...r,ref:t})});Fl.displayName=Ll;var jl="DropdownMenuItem",Fo=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=G(n);return h.jsx(Cl,{...o,...r,ref:t})});Fo.displayName=jl;var $l="DropdownMenuCheckboxItem",Wl=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=G(n);return h.jsx(El,{...o,...r,ref:t})});Wl.displayName=$l;var Bl="DropdownMenuRadioGroup",Hl=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=G(n);return h.jsx(Rl,{...o,...r,ref:t})});Hl.displayName=Bl;var Gl="DropdownMenuRadioItem",Ul=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=G(n);return h.jsx(Sl,{...o,...r,ref:t})});Ul.displayName=Gl;var Vl="DropdownMenuItemIndicator",Kl=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=G(n);return h.jsx(Pl,{...o,...r,ref:t})});Kl.displayName=Vl;var Yl="DropdownMenuSeparator",jo=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=G(n);return h.jsx(Al,{...o,...r,ref:t})});jo.displayName=Yl;var zl="DropdownMenuArrow",Xl=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=G(n);return h.jsx(Ml,{...o,...r,ref:t})});Xl.displayName=zl;var ql="DropdownMenuSubTrigger",Zl=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=G(n);return h.jsx(_l,{...o,...r,ref:t})});Zl.displayName=ql;var Jl="DropdownMenuSubContent",Ql=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=G(n);return h.jsx(Tl,{...o,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Ql.displayName=Jl;var Vu=Do,Ku=No,Yu=Io,zu=Lo,Xu=Fo,qu=jo,Pt="Dialog",[$o,Wo]=ne(Pt),[eu,q]=$o(Pt),Bo=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:i,modal:s=!0}=e,c=a.useRef(null),u=a.useRef(null),[d,f]=Ne({prop:r,defaultProp:o??!1,onChange:i,caller:Pt});return h.jsx(eu,{scope:t,triggerRef:c,contentRef:u,contentId:de(),titleId:de(),descriptionId:de(),open:d,onOpenChange:f,onOpenToggle:a.useCallback(()=>f(l=>!l),[f]),modal:s,children:n})};Bo.displayName=Pt;var Ho="DialogTrigger",Go=a.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=q(Ho,n),i=j(t,o.triggerRef);return h.jsx(N.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,"data-state":bn(o.open),...r,ref:i,onClick:A(e.onClick,o.onOpenToggle)})});Go.displayName=Ho;var yn="DialogPortal",[tu,Uo]=$o(yn,{forceMount:void 0}),Vo=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,i=q(yn,t);return h.jsx(tu,{scope:t,forceMount:n,children:a.Children.map(r,s=>h.jsx(X,{present:n||i.open,children:h.jsx(yt,{asChild:!0,container:o,children:s})}))})};Vo.displayName=yn;var dt="DialogOverlay",Ko=a.forwardRef((e,t)=>{const n=Uo(dt,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=q(dt,e.__scopeDialog);return i.modal?h.jsx(X,{present:r||i.open,children:h.jsx(ru,{...o,ref:t})}):null});Ko.displayName=dt;var nu=Me("DialogOverlay.RemoveScroll"),ru=a.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=q(dt,n);return h.jsx(fn,{as:nu,allowPinchZoom:!0,shards:[o.contentRef],children:h.jsx(N.div,{"data-state":bn(o.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),we="DialogContent",Yo=a.forwardRef((e,t)=>{const n=Uo(we,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=q(we,e.__scopeDialog);return h.jsx(X,{present:r||i.open,children:i.modal?h.jsx(ou,{...o,ref:t}):h.jsx(iu,{...o,ref:t})})});Yo.displayName=we;var ou=a.forwardRef((e,t)=>{const n=q(we,e.__scopeDialog),r=a.useRef(null),o=j(t,n.contentRef,r);return a.useEffect(()=>{const i=r.current;if(i)return Jr(i)},[]),h.jsx(zo,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:A(e.onCloseAutoFocus,i=>{i.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:A(e.onPointerDownOutside,i=>{const s=i.detail.originalEvent,c=s.button===0&&s.ctrlKey===!0;(s.button===2||c)&&i.preventDefault()}),onFocusOutside:A(e.onFocusOutside,i=>i.preventDefault())})}),iu=a.forwardRef((e,t)=>{const n=q(we,e.__scopeDialog),r=a.useRef(!1),o=a.useRef(!1);return h.jsx(zo,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{e.onCloseAutoFocus?.(i),i.defaultPrevented||(r.current||n.triggerRef.current?.focus(),i.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:i=>{e.onInteractOutside?.(i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const s=i.target;n.triggerRef.current?.contains(s)&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault()}})}),zo=a.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:i,...s}=e,c=q(we,n),u=a.useRef(null),d=j(t,u);return Gr(),h.jsxs(h.Fragment,{children:[h.jsx(un,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i,children:h.jsx(pt,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":bn(c.open),...s,ref:d,onDismiss:()=>c.onOpenChange(!1)})}),h.jsxs(h.Fragment,{children:[h.jsx(au,{titleId:c.titleId}),h.jsx(lu,{contentRef:u,descriptionId:c.descriptionId})]})]})}),xn="DialogTitle",Xo=a.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=q(xn,n);return h.jsx(N.h2,{id:o.titleId,...r,ref:t})});Xo.displayName=xn;var qo="DialogDescription",Zo=a.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=q(qo,n);return h.jsx(N.p,{id:o.descriptionId,...r,ref:t})});Zo.displayName=qo;var Jo="DialogClose",Qo=a.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=q(Jo,n);return h.jsx(N.button,{type:"button",...r,ref:t,onClick:A(e.onClick,()=>o.onOpenChange(!1))})});Qo.displayName=Jo;function bn(e){return e?"open":"closed"}var ei="DialogTitleWarning",[su,ti]=Di(ei,{contentName:we,titleName:xn,docsSlug:"dialog"}),au=({titleId:e})=>{const t=ti(ei),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
42
|
+
|
|
43
|
+
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
44
|
+
|
|
45
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return a.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},cu="DialogDescriptionWarning",lu=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${ti(cu).contentName}}.`;return a.useEffect(()=>{const o=e.current?.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},uu=Bo,fu=Go,du=Vo,pu=Ko,mu=Yo,vu=Xo,hu=Zo,ni=Qo,ri="AlertDialog",[gu]=ne(ri,[Wo]),ce=Wo(),oi=e=>{const{__scopeAlertDialog:t,...n}=e,r=ce(t);return h.jsx(uu,{...r,...n,modal:!0})};oi.displayName=ri;var wu="AlertDialogTrigger",yu=a.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=ce(n);return h.jsx(fu,{...o,...r,ref:t})});yu.displayName=wu;var xu="AlertDialogPortal",ii=e=>{const{__scopeAlertDialog:t,...n}=e,r=ce(t);return h.jsx(du,{...r,...n})};ii.displayName=xu;var bu="AlertDialogOverlay",si=a.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=ce(n);return h.jsx(pu,{...o,...r,ref:t})});si.displayName=bu;var Ae="AlertDialogContent",[Cu,Eu]=gu(Ae),Ru=rr("AlertDialogContent"),ai=a.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:r,...o}=e,i=ce(n),s=a.useRef(null),c=j(t,s),u=a.useRef(null);return h.jsx(su,{contentName:Ae,titleName:ci,docsSlug:"alert-dialog",children:h.jsx(Cu,{scope:n,cancelRef:u,children:h.jsxs(mu,{role:"alertdialog",...i,...o,ref:c,onOpenAutoFocus:A(o.onOpenAutoFocus,d=>{d.preventDefault(),u.current?.focus({preventScroll:!0})}),onPointerDownOutside:d=>d.preventDefault(),onInteractOutside:d=>d.preventDefault(),children:[h.jsx(Ru,{children:r}),h.jsx(Pu,{contentRef:s})]})})})});ai.displayName=Ae;var ci="AlertDialogTitle",li=a.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=ce(n);return h.jsx(vu,{...o,...r,ref:t})});li.displayName=ci;var ui="AlertDialogDescription",fi=a.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=ce(n);return h.jsx(hu,{...o,...r,ref:t})});fi.displayName=ui;var Su="AlertDialogAction",di=a.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=ce(n);return h.jsx(ni,{...o,...r,ref:t})});di.displayName=Su;var pi="AlertDialogCancel",mi=a.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:o}=Eu(pi,n),i=ce(n),s=j(t,o);return h.jsx(ni,{...i,...r,ref:s})});mi.displayName=pi;var Pu=({contentRef:e})=>{const t=`\`${Ae}\` requires a description for the component to be accessible for screen reader users.
|
|
46
|
+
|
|
47
|
+
You can add a description to the \`${Ae}\` by passing a \`${ui}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
|
|
48
|
+
|
|
49
|
+
Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${Ae}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.
|
|
50
|
+
|
|
51
|
+
For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return a.useEffect(()=>{document.getElementById(e.current?.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},Zu=oi,Ju=ii,Qu=si,ef=ai,tf=di,nf=mi,rf=li,of=fi,At="Collapsible",[Au]=ne(At),[Mu,Cn]=Au(At),vi=a.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:o,disabled:i,onOpenChange:s,...c}=e,[u,d]=Ne({prop:r,defaultProp:o??!1,onChange:s,caller:At});return h.jsx(Mu,{scope:n,disabled:i,contentId:de(),open:u,onOpenToggle:a.useCallback(()=>d(f=>!f),[d]),children:h.jsx(N.div,{"data-state":Rn(u),"data-disabled":i?"":void 0,...c,ref:t})})});vi.displayName=At;var hi="CollapsibleTrigger",gi=a.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,o=Cn(hi,n);return h.jsx(N.button,{type:"button","aria-controls":o.open?o.contentId:void 0,"aria-expanded":o.open||!1,"data-state":Rn(o.open),"data-disabled":o.disabled?"":void 0,disabled:o.disabled,...r,ref:t,onClick:A(e.onClick,o.onOpenToggle)})});gi.displayName=hi;var En="CollapsibleContent",wi=a.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=Cn(En,e.__scopeCollapsible);return h.jsx(X,{present:n||o.open,children:({present:i})=>h.jsx(_u,{...r,ref:t,present:i})})});wi.displayName=En;var _u=a.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:o,...i}=e,s=Cn(En,n),[c,u]=a.useState(r),d=a.useRef(null),f=j(t,d),l=a.useRef(0),p=l.current,m=a.useRef(0),g=m.current,v=s.open||c,w=a.useRef(v),y=a.useRef(void 0);return a.useEffect(()=>{const x=requestAnimationFrame(()=>w.current=!1);return()=>cancelAnimationFrame(x)},[]),ee(()=>{const x=d.current;if(x){y.current=y.current||{transitionDuration:x.style.transitionDuration,animationName:x.style.animationName},x.style.transitionDuration="0s",x.style.animationName="none";const b=x.getBoundingClientRect();l.current=b.height,m.current=b.width,w.current||(x.style.transitionDuration=y.current.transitionDuration,x.style.animationName=y.current.animationName),u(r)}},[s.open,r]),h.jsx(N.div,{"data-state":Rn(s.open),"data-disabled":s.disabled?"":void 0,id:s.contentId,hidden:!v,...i,ref:f,style:{"--radix-collapsible-content-height":p?`${p}px`:void 0,"--radix-collapsible-content-width":g?`${g}px`:void 0,...e.style},children:v&&o})});function Rn(e){return e?"open":"closed"}var sf=vi,af=gi,cf=wi;function Tu(e){const t=a.useRef({value:e,previous:e});return a.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var Mt="Switch",[Du]=ne(Mt),[Ou,Sn]=Du(Mt);function Nu(e){const{__scopeSwitch:t,checked:n,children:r,defaultChecked:o,disabled:i,form:s,name:c,onCheckedChange:u,required:d,value:f="on",internal_do_not_use_render:l}=e,[p,m]=Ne({prop:n,defaultProp:o??!1,onChange:u,caller:Mt}),[g,v]=a.useState(null),[w,y]=a.useState(null),x=a.useRef(!1),b=g?!!s||!!g.closest("form"):!0,C={checked:p,setChecked:m,disabled:i,control:g,setControl:v,name:c,form:s,value:f,hasConsumerStoppedPropagationRef:x,required:d,defaultChecked:o,isFormControl:b,bubbleInput:w,setBubbleInput:y};return h.jsx(Ou,{scope:t,...C,children:Lu(l)?l(C):r})}var yi="SwitchTrigger",xi=a.forwardRef(({__scopeSwitch:e,onClick:t,...n},r)=>{const{value:o,disabled:i,checked:s,required:c,setControl:u,setChecked:d,hasConsumerStoppedPropagationRef:f,isFormControl:l,bubbleInput:p}=Sn(yi,e),m=j(r,u);return h.jsx(N.button,{type:"button",role:"switch","aria-checked":s,"aria-required":c,"data-state":Ri(s),"data-disabled":i?"":void 0,disabled:i,value:o,...n,ref:m,onClick:A(t,g=>{d(v=>!v),p&&l&&(f.current=g.isPropagationStopped(),f.current||g.stopPropagation())})})});xi.displayName=yi;var Iu=a.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:o,defaultChecked:i,required:s,disabled:c,value:u,onCheckedChange:d,form:f,...l}=e;return h.jsx(Nu,{__scopeSwitch:n,checked:o,defaultChecked:i,disabled:c,required:s,onCheckedChange:d,name:r,form:f,value:u,internal_do_not_use_render:({isFormControl:p})=>h.jsxs(h.Fragment,{children:[h.jsx(xi,{...l,ref:t,__scopeSwitch:n}),p&&h.jsx(Ei,{__scopeSwitch:n})]})})});Iu.displayName=Mt;var bi="SwitchThumb",ku=a.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,o=Sn(bi,n);return h.jsx(N.span,{"data-state":Ri(o.checked),"data-disabled":o.disabled?"":void 0,...r,ref:t})});ku.displayName=bi;var Ci="SwitchBubbleInput",Ei=a.forwardRef(({__scopeSwitch:e,...t},n)=>{const{control:r,hasConsumerStoppedPropagationRef:o,checked:i,defaultChecked:s,required:c,disabled:u,name:d,value:f,form:l,bubbleInput:p,setBubbleInput:m}=Sn(Ci,e),g=j(n,m),v=Tu(i),w=yr(r);a.useEffect(()=>{const x=p;if(!x)return;const b=window.HTMLInputElement.prototype,E=Object.getOwnPropertyDescriptor(b,"checked").set,S=!o.current;if(v!==i&&E){const R=new Event("click",{bubbles:S});E.call(x,i),x.dispatchEvent(R)}},[p,v,i,o]);const y=a.useRef(i);return h.jsx(N.input,{type:"checkbox","aria-hidden":!0,defaultChecked:s??y.current,required:c,disabled:u,name:d,value:f,form:l,...t,tabIndex:-1,ref:g,style:{...t.style,...w,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});Ei.displayName=Ci;function Lu(e){return typeof e=="function"}function Ri(e){return e?"checked":"unchecked"}export{tf as A,Gu as C,hu as D,Xu as I,pu as O,Hu as P,Wu as R,ju as S,Bu as T,$u as a,sf as b,af as c,cf as d,Iu as e,ku as f,Vu as g,Ku as h,Yu as i,h as j,zu as k,qu as l,uu as m,fu as n,ni as o,du as p,mu as q,vu as r,Zu as s,Ju as t,ef as u,rf as v,of as w,nf as x,Qu as y};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as a}from"./index-BhB9CGsv.js";const e=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],o=a("refresh-cw",e);const t=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],h=a("save",t);export{o as R,h as S};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as r,M as n,W as s}from"./index-BhB9CGsv.js";import{j as a}from"./radix-RipaNCX7.js";const i=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],m=r("ellipsis",i),l=s("inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-[12px] font-medium leading-none",{variants:{variant:{default:"bg-panel-2 text-muted",accent:"bg-[color:color-mix(in_srgb,var(--accent)_14%,transparent)] text-accent",mono:"bg-panel-2 text-muted font-mono"}},defaultVariants:{variant:"default"}});function p({className:e,variant:t,...c}){return a.jsx("span",{className:n(l({variant:t}),e),...c})}function u({className:e,...t}){return a.jsx("div",{className:n("tllm-pulse rounded-md bg-panel-2",e),...t})}export{p as B,m as E,u as S};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as a}from"./index-BhB9CGsv.js";const e=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],l=a("sparkles",e);export{l as S};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as a}from"./index-BhB9CGsv.js";const t=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],o=a("trash-2",t);export{o as T};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
function ht(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const a in r)if(a!=="default"&&!(a in e)){const i=Object.getOwnPropertyDescriptor(r,a);i&&Object.defineProperty(e,a,i.get?i:{enumerable:!0,get:()=>r[a]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}function We(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var pe={exports:{}},v={};var $e;function pt(){if($e)return v;$e=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),i=Symbol.for("react.consumer"),s=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),o=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),h=Symbol.for("react.activity"),y=Symbol.iterator;function C(u){return u===null||typeof u!="object"?null:(u=y&&u[y]||u["@@iterator"],typeof u=="function"?u:null)}var E={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,m={};function S(u,p,w){this.props=u,this.context=p,this.refs=m,this.updater=w||E}S.prototype.isReactComponent={},S.prototype.setState=function(u,p){if(typeof u!="object"&&typeof u!="function"&&u!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,u,p,"setState")},S.prototype.forceUpdate=function(u){this.updater.enqueueForceUpdate(this,u,"forceUpdate")};function _(){}_.prototype=S.prototype;function x(u,p,w){this.props=u,this.context=p,this.refs=m,this.updater=w||E}var $=x.prototype=new _;$.constructor=x,g($,S.prototype),$.isPureReactComponent=!0;var k=Array.isArray;function I(){}var P={H:null,A:null,T:null,S:null},W=Object.prototype.hasOwnProperty;function Y(u,p,w){var R=w.ref;return{$$typeof:e,type:u,key:p,ref:R!==void 0?R:null,props:w}}function X(u,p){return Y(u.type,p,u.props)}function Q(u){return typeof u=="object"&&u!==null&&u.$$typeof===e}function he(u){var p={"=":"=0",":":"=2"};return"$"+u.replace(/[=:]/g,function(w){return p[w]})}var Z=/\/+/g;function q(u,p){return typeof u=="object"&&u!==null&&u.key!=null?he(""+u.key):p.toString(36)}function B(u){switch(u.status){case"fulfilled":return u.value;case"rejected":throw u.reason;default:switch(typeof u.status=="string"?u.then(I,I):(u.status="pending",u.then(function(p){u.status==="pending"&&(u.status="fulfilled",u.value=p)},function(p){u.status==="pending"&&(u.status="rejected",u.reason=p)})),u.status){case"fulfilled":return u.value;case"rejected":throw u.reason}}throw u}function K(u,p,w,R,b){var T=typeof u;(T==="undefined"||T==="boolean")&&(u=null);var L=!1;if(u===null)L=!0;else switch(T){case"bigint":case"string":case"number":L=!0;break;case"object":switch(u.$$typeof){case e:case t:L=!0;break;case d:return L=u._init,K(L(u._payload),p,w,R,b)}}if(L)return b=b(u),L=R===""?"."+q(u,0):R,k(b)?(w="",L!=null&&(w=L.replace(Z,"$&/")+"/"),K(b,p,w,"",function(dt){return dt})):b!=null&&(Q(b)&&(b=X(b,w+(b.key==null||u&&u.key===b.key?"":(""+b.key).replace(Z,"$&/")+"/")+L)),p.push(b)),1;L=0;var j=R===""?".":R+":";if(k(u))for(var D=0;D<u.length;D++)R=u[D],T=j+q(R,D),L+=K(R,p,w,T,b);else if(D=C(u),typeof D=="function")for(u=D.call(u),D=0;!(R=u.next()).done;)R=R.value,T=j+q(R,D++),L+=K(R,p,w,T,b);else if(T==="object"){if(typeof u.then=="function")return K(B(u),p,w,R,b);throw p=String(u),Error("Objects are not valid as a React child (found: "+(p==="[object Object]"?"object with keys {"+Object.keys(u).join(", ")+"}":p)+"). If you meant to render a collection of children, use an array instead.")}return L}function ae(u,p,w){if(u==null)return u;var R=[],b=0;return K(u,R,"","",function(T){return p.call(w,T,b++)}),R}function ct(u){if(u._status===-1){var p=u._result;p=p(),p.then(function(w){(u._status===0||u._status===-1)&&(u._status=1,u._result=w)},function(w){(u._status===0||u._status===-1)&&(u._status=2,u._result=w)}),u._status===-1&&(u._status=0,u._result=p)}if(u._status===1)return u._result.default;throw u._result}var ke=typeof reportError=="function"?reportError:function(u){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var p=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof u=="object"&&u!==null&&typeof u.message=="string"?String(u.message):String(u),error:u});if(!window.dispatchEvent(p))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",u);return}console.error(u)},ft={map:ae,forEach:function(u,p,w){ae(u,function(){p.apply(this,arguments)},w)},count:function(u){var p=0;return ae(u,function(){p++}),p},toArray:function(u){return ae(u,function(p){return p})||[]},only:function(u){if(!Q(u))throw Error("React.Children.only expected to receive a single React element child.");return u}};return v.Activity=h,v.Children=ft,v.Component=S,v.Fragment=n,v.Profiler=a,v.PureComponent=x,v.StrictMode=r,v.Suspense=l,v.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=P,v.__COMPILER_RUNTIME={__proto__:null,c:function(u){return P.H.useMemoCache(u)}},v.cache=function(u){return function(){return u.apply(null,arguments)}},v.cacheSignal=function(){return null},v.cloneElement=function(u,p,w){if(u==null)throw Error("The argument must be a React element, but you passed "+u+".");var R=g({},u.props),b=u.key;if(p!=null)for(T in p.key!==void 0&&(b=""+p.key),p)!W.call(p,T)||T==="key"||T==="__self"||T==="__source"||T==="ref"&&p.ref===void 0||(R[T]=p[T]);var T=arguments.length-2;if(T===1)R.children=w;else if(1<T){for(var L=Array(T),j=0;j<T;j++)L[j]=arguments[j+2];R.children=L}return Y(u.type,b,R)},v.createContext=function(u){return u={$$typeof:s,_currentValue:u,_currentValue2:u,_threadCount:0,Provider:null,Consumer:null},u.Provider=u,u.Consumer={$$typeof:i,_context:u},u},v.createElement=function(u,p,w){var R,b={},T=null;if(p!=null)for(R in p.key!==void 0&&(T=""+p.key),p)W.call(p,R)&&R!=="key"&&R!=="__self"&&R!=="__source"&&(b[R]=p[R]);var L=arguments.length-2;if(L===1)b.children=w;else if(1<L){for(var j=Array(L),D=0;D<L;D++)j[D]=arguments[D+2];b.children=j}if(u&&u.defaultProps)for(R in L=u.defaultProps,L)b[R]===void 0&&(b[R]=L[R]);return Y(u,T,b)},v.createRef=function(){return{current:null}},v.forwardRef=function(u){return{$$typeof:f,render:u}},v.isValidElement=Q,v.lazy=function(u){return{$$typeof:d,_payload:{_status:-1,_result:u},_init:ct}},v.memo=function(u,p){return{$$typeof:o,type:u,compare:p===void 0?null:p}},v.startTransition=function(u){var p=P.T,w={};P.T=w;try{var R=u(),b=P.S;b!==null&&b(w,R),typeof R=="object"&&R!==null&&typeof R.then=="function"&&R.then(I,ke)}catch(T){ke(T)}finally{p!==null&&w.types!==null&&(p.types=w.types),P.T=p}},v.unstable_useCacheRefresh=function(){return P.H.useCacheRefresh()},v.use=function(u){return P.H.use(u)},v.useActionState=function(u,p,w){return P.H.useActionState(u,p,w)},v.useCallback=function(u,p){return P.H.useCallback(u,p)},v.useContext=function(u){return P.H.useContext(u)},v.useDebugValue=function(){},v.useDeferredValue=function(u,p){return P.H.useDeferredValue(u,p)},v.useEffect=function(u,p){return P.H.useEffect(u,p)},v.useEffectEvent=function(u){return P.H.useEffectEvent(u)},v.useId=function(){return P.H.useId()},v.useImperativeHandle=function(u,p,w){return P.H.useImperativeHandle(u,p,w)},v.useInsertionEffect=function(u,p){return P.H.useInsertionEffect(u,p)},v.useLayoutEffect=function(u,p){return P.H.useLayoutEffect(u,p)},v.useMemo=function(u,p){return P.H.useMemo(u,p)},v.useOptimistic=function(u,p){return P.H.useOptimistic(u,p)},v.useReducer=function(u,p,w){return P.H.useReducer(u,p,w)},v.useRef=function(u){return P.H.useRef(u)},v.useState=function(u){return P.H.useState(u)},v.useSyncExternalStore=function(u,p,w){return P.H.useSyncExternalStore(u,p,w)},v.useTransition=function(){return P.H.useTransition()},v.version="19.2.7",v}var Ae;function Ye(){return Ae||(Ae=1,pe.exports=pt()),pe.exports}var c=Ye();const mt=We(c),Jr=ht({__proto__:null,default:mt},[c]);var me={exports:{}},A={};var De;function yt(){if(De)return A;De=1;var e=Ye();function t(l){var o="https://react.dev/errors/"+l;if(1<arguments.length){o+="?args[]="+encodeURIComponent(arguments[1]);for(var d=2;d<arguments.length;d++)o+="&args[]="+encodeURIComponent(arguments[d])}return"Minified React error #"+l+"; visit "+o+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var r={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},a=Symbol.for("react.portal");function i(l,o,d){var h=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:h==null?null:""+h,children:l,containerInfo:o,implementation:d}}var s=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function f(l,o){if(l==="font")return"";if(typeof o=="string")return o==="use-credentials"?o:""}return A.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,A.createPortal=function(l,o){var d=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!o||o.nodeType!==1&&o.nodeType!==9&&o.nodeType!==11)throw Error(t(299));return i(l,o,null,d)},A.flushSync=function(l){var o=s.T,d=r.p;try{if(s.T=null,r.p=2,l)return l()}finally{s.T=o,r.p=d,r.d.f()}},A.preconnect=function(l,o){typeof l=="string"&&(o?(o=o.crossOrigin,o=typeof o=="string"?o==="use-credentials"?o:"":void 0):o=null,r.d.C(l,o))},A.prefetchDNS=function(l){typeof l=="string"&&r.d.D(l)},A.preinit=function(l,o){if(typeof l=="string"&&o&&typeof o.as=="string"){var d=o.as,h=f(d,o.crossOrigin),y=typeof o.integrity=="string"?o.integrity:void 0,C=typeof o.fetchPriority=="string"?o.fetchPriority:void 0;d==="style"?r.d.S(l,typeof o.precedence=="string"?o.precedence:void 0,{crossOrigin:h,integrity:y,fetchPriority:C}):d==="script"&&r.d.X(l,{crossOrigin:h,integrity:y,fetchPriority:C,nonce:typeof o.nonce=="string"?o.nonce:void 0})}},A.preinitModule=function(l,o){if(typeof l=="string")if(typeof o=="object"&&o!==null){if(o.as==null||o.as==="script"){var d=f(o.as,o.crossOrigin);r.d.M(l,{crossOrigin:d,integrity:typeof o.integrity=="string"?o.integrity:void 0,nonce:typeof o.nonce=="string"?o.nonce:void 0})}}else o==null&&r.d.M(l)},A.preload=function(l,o){if(typeof l=="string"&&typeof o=="object"&&o!==null&&typeof o.as=="string"){var d=o.as,h=f(d,o.crossOrigin);r.d.L(l,d,{crossOrigin:h,integrity:typeof o.integrity=="string"?o.integrity:void 0,nonce:typeof o.nonce=="string"?o.nonce:void 0,type:typeof o.type=="string"?o.type:void 0,fetchPriority:typeof o.fetchPriority=="string"?o.fetchPriority:void 0,referrerPolicy:typeof o.referrerPolicy=="string"?o.referrerPolicy:void 0,imageSrcSet:typeof o.imageSrcSet=="string"?o.imageSrcSet:void 0,imageSizes:typeof o.imageSizes=="string"?o.imageSizes:void 0,media:typeof o.media=="string"?o.media:void 0})}},A.preloadModule=function(l,o){if(typeof l=="string")if(o){var d=f(o.as,o.crossOrigin);r.d.m(l,{as:typeof o.as=="string"&&o.as!=="script"?o.as:void 0,crossOrigin:d,integrity:typeof o.integrity=="string"?o.integrity:void 0})}else r.d.m(l)},A.requestFormReset=function(l){r.d.r(l)},A.unstable_batchedUpdates=function(l,o){return l(o)},A.useFormState=function(l,o,d){return s.H.useFormState(l,o,d)},A.useFormStatus=function(){return s.H.useHostTransitionStatus()},A.version="19.2.7",A}var Ne;function gt(){if(Ne)return me.exports;Ne=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),me.exports=yt(),me.exports}var Ie="popstate";function Me(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function vt(e={}){function t(r,a){let i=a.state?.masked,{pathname:s,search:f,hash:l}=i||r.location;return Re("",{pathname:s,search:f,hash:l},a.state&&a.state.usr||null,a.state&&a.state.key||"default",i?{pathname:r.location.pathname,search:r.location.search,hash:r.location.hash}:void 0)}function n(r,a){return typeof a=="string"?a:te(a)}return Et(t,n,null,e)}function O(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function M(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function Rt(){return Math.random().toString(36).substring(2,10)}function He(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function Re(e,t,n=null,r,a){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?G(t):t,state:n,key:t&&t.key||r||Rt(),mask:a}}function te({pathname:e="/",search:t="",hash:n=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function G(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function Et(e,t,n,r={}){let{window:a=document.defaultView,v5Compat:i=!1}=r,s=a.history,f="POP",l=null,o=d();o==null&&(o=0,s.replaceState({...s.state,idx:o},""));function d(){return(s.state||{idx:null}).idx}function h(){f="POP";let m=d(),S=m==null?null:m-o;o=m,l&&l({action:f,location:g.location,delta:S})}function y(m,S){f="PUSH";let _=Me(m)?m:Re(g.location,m,S);o=d()+1;let x=He(_,o),$=g.createHref(_.mask||_);try{s.pushState(x,"",$)}catch(k){if(k instanceof DOMException&&k.name==="DataCloneError")throw k;a.location.assign($)}i&&l&&l({action:f,location:g.location,delta:1})}function C(m,S){f="REPLACE";let _=Me(m)?m:Re(g.location,m,S);o=d();let x=He(_,o),$=g.createHref(_.mask||_);s.replaceState(x,"",$),i&&l&&l({action:f,location:g.location,delta:0})}function E(m){return St(a,m)}let g={get action(){return f},get location(){return e(a,s)},listen(m){if(l)throw new Error("A history only accepts one active listener");return a.addEventListener(Ie,h),l=m,()=>{a.removeEventListener(Ie,h),l=null}},createHref(m){return t(a,m)},createURL:E,encodeLocation(m){let S=E(m);return{pathname:S.pathname,search:S.search,hash:S.hash}},push:y,replace:C,go(m){return s.go(m)}};return g}function St(e,t,n=!1){let r="http://localhost";e&&(r=e.location.origin!=="null"?e.location.origin:e.location.href),O(r,"No window.location.(origin|href) available to create URL");let a=typeof t=="string"?t:te(t);return a=a.replace(/ $/,"%20"),!n&&a.startsWith("//")&&(a=r+a),new URL(a,r)}function ze(e,t,n="/"){return wt(e,t,n,!1)}function wt(e,t,n,r,a){let i=typeof t=="string"?G(t):t,s=z(i.pathname||"/",n);if(s==null)return null;let f=Ct(e),l=null,o=Nt(s);for(let d=0;l==null&&d<f.length;++d)l=At(f[d],o,r);return l}function Ct(e){let t=qe(e);return _t(t),t}function qe(e,t=[],n=[],r="",a=!1){let i=(s,f,l=a,o)=>{let d={relativePath:o===void 0?s.path||"":o,caseSensitive:s.caseSensitive===!0,childrenIndex:f,route:s};if(d.relativePath.startsWith("/")){if(!d.relativePath.startsWith(r)&&l)return;O(d.relativePath.startsWith(r),`Absolute route path "${d.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),d.relativePath=d.relativePath.slice(r.length)}let h=H([r,d.relativePath]),y=n.concat(d);s.children&&s.children.length>0&&(O(s.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${h}".`),qe(s.children,t,y,h,l)),!(s.path==null&&!s.index)&&t.push({path:h,score:kt(h,s.index),routesMeta:y})};return e.forEach((s,f)=>{if(s.path===""||!s.path?.includes("?"))i(s,f);else for(let l of Ke(s.path))i(s,f,!0,l)}),t}function Ke(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,a=n.endsWith("?"),i=n.replace(/\?$/,"");if(r.length===0)return a?[i,""]:[i];let s=Ke(r.join("/")),f=[];return f.push(...s.map(l=>l===""?i:[i,l].join("/"))),a&&f.push(...s),f.map(l=>e.startsWith("/")&&l===""?"/":l)}function _t(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:$t(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var xt=/^:[\w-]+$/,Pt=3,bt=2,Tt=1,Lt=10,Ot=-2,Ue=e=>e==="*";function kt(e,t){let n=e.split("/"),r=n.length;return n.some(Ue)&&(r+=Ot),t&&(r+=bt),n.filter(a=>!Ue(a)).reduce((a,i)=>a+(xt.test(i)?Pt:i===""?Tt:Lt),r)}function $t(e,t){return e.length===t.length&&e.slice(0,-1).every((r,a)=>r===t[a])?e[e.length-1]-t[t.length-1]:0}function At(e,t,n=!1){let{routesMeta:r}=e,a={},i="/",s=[];for(let f=0;f<r.length;++f){let l=r[f],o=f===r.length-1,d=i==="/"?t:t.slice(i.length)||"/",h=le({path:l.relativePath,caseSensitive:l.caseSensitive,end:o},d),y=l.route;if(!h&&o&&n&&!r[r.length-1].route.index&&(h=le({path:l.relativePath,caseSensitive:l.caseSensitive,end:!1},d)),!h)return null;Object.assign(a,h.params),s.push({params:a,pathname:H([i,h.pathname]),pathnameBase:Ut(H([i,h.pathnameBase])),route:y}),h.pathnameBase!=="/"&&(i=H([i,h.pathnameBase]))}return s}function le(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=Dt(e.path,e.caseSensitive,e.end),a=t.match(n);if(!a)return null;let i=a[0],s=i.replace(/(.)\/+$/,"$1"),f=a.slice(1);return{params:r.reduce((o,{paramName:d,isOptional:h},y)=>{if(d==="*"){let E=f[y]||"";s=i.slice(0,i.length-E.length).replace(/(.)\/+$/,"$1")}const C=f[y];return h&&!C?o[d]=void 0:o[d]=(C||"").replace(/%2F/g,"/"),o},{}),pathname:i,pathnameBase:s,pattern:e}}function Dt(e,t=!1,n=!0){M(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let r=[],a="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(s,f,l,o,d)=>{if(r.push({paramName:f,isOptional:l!=null}),l){let h=d.charAt(o+s.length);return h&&h!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(r.push({paramName:"*"}),a+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?a+="\\/*$":e!==""&&e!=="/"&&(a+="(?:(?=\\/|$))"),[new RegExp(a,t?void 0:"i"),r]}function Nt(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return M(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function z(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}var It=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function Mt(e,t="/"){let{pathname:n,search:r="",hash:a=""}=typeof e=="string"?G(e):e,i;return n?(n=Ge(n),n.startsWith("/")?i=Fe(n.substring(1),"/"):i=Fe(n,t)):i=t,{pathname:i,search:Ft(r),hash:Bt(a)}}function Fe(e,t){let n=se(t).split("/");return e.split("/").forEach(a=>{a===".."?n.length>1&&n.pop():a!=="."&&n.push(a)}),n.length>1?n.join("/"):"/"}function ye(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function Ht(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function we(e){let t=Ht(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function ce(e,t,n,r=!1){let a;typeof e=="string"?a=G(e):(a={...e},O(!a.pathname||!a.pathname.includes("?"),ye("?","pathname","search",a)),O(!a.pathname||!a.pathname.includes("#"),ye("#","pathname","hash",a)),O(!a.search||!a.search.includes("#"),ye("#","search","hash",a)));let i=e===""||a.pathname==="",s=i?"/":a.pathname,f;if(s==null)f=n;else{let h=t.length-1;if(!r&&s.startsWith("..")){let y=s.split("/");for(;y[0]==="..";)y.shift(),h-=1;a.pathname=y.join("/")}f=h>=0?t[h]:"/"}let l=Mt(a,f),o=s&&s!=="/"&&s.endsWith("/"),d=(i||s===".")&&n.endsWith("/");return!l.pathname.endsWith("/")&&(o||d)&&(l.pathname+="/"),l}var Ge=e=>e.replace(/\/\/+/g,"/"),H=e=>Ge(e.join("/")),se=e=>e.replace(/\/+$/,""),Ut=e=>se(e).replace(/^\/*/,"/"),Ft=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Bt=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,jt=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||"",this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function Wt(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function Yt(e){let t=e.map(n=>n.route.path).filter(Boolean);return H(t)||"/"}var Ve=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Je(e,t){let n=e;if(typeof n!="string"||!It.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,a=!1;if(Ve)try{let i=new URL(window.location.href),s=n.startsWith("//")?new URL(i.protocol+n):new URL(n),f=z(s.pathname,t);s.origin===i.origin&&f!=null?n=f+s.search+s.hash:a=!0}catch{M(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:a,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var Xe=["POST","PUT","PATCH","DELETE"];new Set(Xe);var zt=["GET",...Xe];new Set(zt);var V=c.createContext(null);V.displayName="DataRouter";var fe=c.createContext(null);fe.displayName="DataRouterState";var Qe=c.createContext(!1);function qt(){return c.useContext(Qe)}var Ze=c.createContext({isTransitioning:!1});Ze.displayName="ViewTransition";var Kt=c.createContext(new Map);Kt.displayName="Fetchers";var Gt=c.createContext(null);Gt.displayName="Await";var N=c.createContext(null);N.displayName="Navigation";var re=c.createContext(null);re.displayName="Location";var U=c.createContext({outlet:null,matches:[],isDataRoute:!1});U.displayName="Route";var Ce=c.createContext(null);Ce.displayName="RouteError";var et="REACT_ROUTER_ERROR",Vt="REDIRECT",Jt="ROUTE_ERROR_RESPONSE";function Xt(e){if(e.startsWith(`${et}:${Vt}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.location=="string"&&typeof t.reloadDocument=="boolean"&&typeof t.replace=="boolean")return t}catch{}}function Qt(e){if(e.startsWith(`${et}:${Jt}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new jt(t.status,t.statusText,t.data)}catch{}}function Zt(e,{relative:t}={}){O(J(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=c.useContext(N),{hash:a,pathname:i,search:s}=ne(e,{relative:t}),f=i;return n!=="/"&&(f=i==="/"?n:H([n,i])),r.createHref({pathname:f,search:s,hash:a})}function J(){return c.useContext(re)!=null}function F(){return O(J(),"useLocation() may be used only in the context of a <Router> component."),c.useContext(re).location}var tt="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function rt(e){c.useContext(N).static||c.useLayoutEffect(e)}function _e(){let{isDataRoute:e}=c.useContext(U);return e?dr():er()}function er(){O(J(),"useNavigate() may be used only in the context of a <Router> component.");let e=c.useContext(V),{basename:t,navigator:n}=c.useContext(N),{matches:r}=c.useContext(U),{pathname:a}=F(),i=JSON.stringify(we(r)),s=c.useRef(!1);return rt(()=>{s.current=!0}),c.useCallback((l,o={})=>{if(M(s.current,tt),!s.current)return;if(typeof l=="number"){n.go(l);return}let d=ce(l,JSON.parse(i),a,o.relative==="path");e==null&&t!=="/"&&(d.pathname=d.pathname==="/"?t:H([t,d.pathname])),(o.replace?n.replace:n.push)(d,o.state,o)},[t,n,i,a,e])}c.createContext(null);function Xr(){let{matches:e}=c.useContext(U);return e[e.length-1]?.params??{}}function ne(e,{relative:t}={}){let{matches:n}=c.useContext(U),{pathname:r}=F(),a=JSON.stringify(we(n));return c.useMemo(()=>ce(e,JSON.parse(a),r,t==="path"),[e,a,r,t])}function tr(e,t){return nt(e,t)}function nt(e,t,n){O(J(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:r}=c.useContext(N),{matches:a}=c.useContext(U),i=a[a.length-1],s=i?i.params:{},f=i?i.pathname:"/",l=i?i.pathnameBase:"/",o=i&&i.route;{let m=o&&o.path||"";ot(f,!o||m.endsWith("*")||m.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${f}" (under <Route path="${m}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
2
|
+
|
|
3
|
+
Please change the parent <Route path="${m}"> to <Route path="${m==="/"?"*":`${m}/*`}">.`)}let d=F(),h;if(t){let m=typeof t=="string"?G(t):t;O(l==="/"||m.pathname?.startsWith(l),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${l}" but pathname "${m.pathname}" was given in the \`location\` prop.`),h=m}else h=d;let y=h.pathname||"/",C=y;if(l!=="/"){let m=l.replace(/^\//,"").split("/");C="/"+y.replace(/^\//,"").split("/").slice(m.length).join("/")}let E=n&&n.state.matches.length?n.state.matches.map(m=>Object.assign(m,{route:n.manifest[m.route.id]||m.route})):ze(e,{pathname:C});M(o||E!=null,`No routes matched location "${h.pathname}${h.search}${h.hash}" `),M(E==null||E[E.length-1].route.element!==void 0||E[E.length-1].route.Component!==void 0||E[E.length-1].route.lazy!==void 0,`Matched leaf route at location "${h.pathname}${h.search}${h.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let g=ir(E&&E.map(m=>Object.assign({},m,{params:Object.assign({},s,m.params),pathname:H([l,r.encodeLocation?r.encodeLocation(m.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:m.pathname]),pathnameBase:m.pathnameBase==="/"?l:H([l,r.encodeLocation?r.encodeLocation(m.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:m.pathnameBase])})),a,n);return t&&g?c.createElement(re.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0,...h},navigationType:"POP"}},g):g}function rr(){let e=fr(),t=Wt(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",a={padding:"0.5rem",backgroundColor:r},i={padding:"2px 4px",backgroundColor:r},s=null;return console.error("Error handled by React Router default ErrorBoundary:",e),s=c.createElement(c.Fragment,null,c.createElement("p",null,"💿 Hey developer 👋"),c.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",c.createElement("code",{style:i},"ErrorBoundary")," or"," ",c.createElement("code",{style:i},"errorElement")," prop on your route.")),c.createElement(c.Fragment,null,c.createElement("h2",null,"Unexpected Application Error!"),c.createElement("h3",{style:{fontStyle:"italic"}},t),n?c.createElement("pre",{style:a},n):null,s)}var nr=c.createElement(rr,null),at=class extends c.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const n=Qt(e.digest);n&&(e=n)}let t=e!==void 0?c.createElement(U.Provider,{value:this.props.routeContext},c.createElement(Ce.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?c.createElement(ar,{error:e},t):t}};at.contextType=Qe;var ge=new WeakMap;function ar({children:e,error:t}){let{basename:n}=c.useContext(N);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let r=Xt(t.digest);if(r){let a=ge.get(t);if(a)throw a;let i=Je(r.location,n);if(Ve&&!ge.get(t))if(i.isExternal||r.reloadDocument)window.location.href=i.absoluteURL||i.to;else{const s=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(i.to,{replace:r.replace}));throw ge.set(t,s),s}return c.createElement("meta",{httpEquiv:"refresh",content:`0;url=${i.absoluteURL||i.to}`})}}return e}function or({routeContext:e,match:t,children:n}){let r=c.useContext(V);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),c.createElement(U.Provider,{value:e},n)}function ir(e,t=[],n){let r=n?.state;if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let a=e,i=r?.errors;if(i!=null){let d=a.findIndex(h=>h.route.id&&i?.[h.route.id]!==void 0);O(d>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(i).join(",")}`),a=a.slice(0,Math.min(a.length,d+1))}let s=!1,f=-1;if(n&&r){s=r.renderFallback;for(let d=0;d<a.length;d++){let h=a[d];if((h.route.HydrateFallback||h.route.hydrateFallbackElement)&&(f=d),h.route.id){let{loaderData:y,errors:C}=r,E=h.route.loader&&!y.hasOwnProperty(h.route.id)&&(!C||C[h.route.id]===void 0);if(h.route.lazy||E){n.isStatic&&(s=!0),f>=0?a=a.slice(0,f+1):a=[a[0]];break}}}}let l=n?.onError,o=r&&l?(d,h)=>{l(d,{location:r.location,params:r.matches?.[0]?.params??{},pattern:Yt(r.matches),errorInfo:h})}:void 0;return a.reduceRight((d,h,y)=>{let C,E=!1,g=null,m=null;r&&(C=i&&h.route.id?i[h.route.id]:void 0,g=h.route.errorElement||nr,s&&(f<0&&y===0?(ot("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),E=!0,m=null):f===y&&(E=!0,m=h.route.hydrateFallbackElement||null)));let S=t.concat(a.slice(0,y+1)),_=()=>{let x;return C?x=g:E?x=m:h.route.Component?x=c.createElement(h.route.Component,null):h.route.element?x=h.route.element:x=d,c.createElement(or,{match:h,routeContext:{outlet:d,matches:S,isDataRoute:r!=null},children:x})};return r&&(h.route.ErrorBoundary||h.route.errorElement||y===0)?c.createElement(at,{location:r.location,revalidation:r.revalidation,component:g,error:C,children:_(),routeContext:{outlet:null,matches:S,isDataRoute:!0},onError:o}):_()},null)}function xe(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function ur(e){let t=c.useContext(V);return O(t,xe(e)),t}function lr(e){let t=c.useContext(fe);return O(t,xe(e)),t}function sr(e){let t=c.useContext(U);return O(t,xe(e)),t}function Pe(e){let t=sr(e),n=t.matches[t.matches.length-1];return O(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function cr(){return Pe("useRouteId")}function fr(){let e=c.useContext(Ce),t=lr("useRouteError"),n=Pe("useRouteError");return e!==void 0?e:t.errors?.[n]}function dr(){let{router:e}=ur("useNavigate"),t=Pe("useNavigate"),n=c.useRef(!1);return rt(()=>{n.current=!0}),c.useCallback(async(a,i={})=>{M(n.current,tt),n.current&&(typeof a=="number"?await e.navigate(a):await e.navigate(a,{fromRouteId:t,...i}))},[e,t])}var Be={};function ot(e,t,n){!t&&!Be[e]&&(Be[e]=!0,M(!1,n))}c.memo(hr);function hr({routes:e,manifest:t,future:n,state:r,isStatic:a,onError:i}){return nt(e,void 0,{manifest:t,state:r,isStatic:a,onError:i})}function Qr({to:e,replace:t,state:n,relative:r}){O(J(),"<Navigate> may be used only in the context of a <Router> component.");let{static:a}=c.useContext(N);M(!a,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:i}=c.useContext(U),{pathname:s}=F(),f=_e(),l=ce(e,we(i),s,r==="path"),o=JSON.stringify(l);return c.useEffect(()=>{f(JSON.parse(o),{replace:t,state:n,relative:r})},[f,o,r,t,n]),null}function pr(e){O(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function mr({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:a,static:i=!1,useTransitions:s}){O(!J(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let f=e.replace(/^\/*/,"/"),l=c.useMemo(()=>({basename:f,navigator:a,static:i,useTransitions:s,future:{}}),[f,a,i,s]);typeof n=="string"&&(n=G(n));let{pathname:o="/",search:d="",hash:h="",state:y=null,key:C="default",mask:E}=n,g=c.useMemo(()=>{let m=z(o,f);return m==null?null:{location:{pathname:m,search:d,hash:h,state:y,key:C,mask:E},navigationType:r}},[f,o,d,h,y,C,r,E]);return M(g!=null,`<Router basename="${f}"> is not able to match the URL "${o}${d}${h}" because it does not start with the basename, so the <Router> won't render anything.`),g==null?null:c.createElement(N.Provider,{value:l},c.createElement(re.Provider,{children:t,value:g}))}function Zr({children:e,location:t}){return tr(Ee(e),t)}function Ee(e,t=[]){let n=[];return c.Children.forEach(e,(r,a)=>{if(!c.isValidElement(r))return;let i=[...t,a];if(r.type===c.Fragment){n.push.apply(n,Ee(r.props.children,i));return}O(r.type===pr,`[${typeof r.type=="string"?r.type:r.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),O(!r.props.index||!r.props.children,"An index route cannot have child routes.");let s={id:r.props.id||i.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,middleware:r.props.middleware,loader:r.props.loader,action:r.props.action,hydrateFallbackElement:r.props.hydrateFallbackElement,HydrateFallback:r.props.HydrateFallback,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.hasErrorBoundary===!0||r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(s.children=Ee(r.props.children,i)),n.push(s)}),n}var ie="get",ue="application/x-www-form-urlencoded";function de(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function yr(e){return de(e)&&e.tagName.toLowerCase()==="button"}function gr(e){return de(e)&&e.tagName.toLowerCase()==="form"}function vr(e){return de(e)&&e.tagName.toLowerCase()==="input"}function Rr(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Er(e,t){return e.button===0&&(!t||t==="_self")&&!Rr(e)}function Se(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(a=>[n,a]):[[n,r]])},[]))}function Sr(e,t){let n=Se(e);return t&&t.forEach((r,a)=>{n.has(a)||t.getAll(a).forEach(i=>{n.append(a,i)})}),n}var oe=null;function wr(){if(oe===null)try{new FormData(document.createElement("form"),0),oe=!1}catch{oe=!0}return oe}var Cr=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function ve(e){return e!=null&&!Cr.has(e)?(M(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${ue}"`),null):e}function _r(e,t){let n,r,a,i,s;if(gr(e)){let f=e.getAttribute("action");r=f?z(f,t):null,n=e.getAttribute("method")||ie,a=ve(e.getAttribute("enctype"))||ue,i=new FormData(e)}else if(yr(e)||vr(e)&&(e.type==="submit"||e.type==="image")){let f=e.form;if(f==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let l=e.getAttribute("formaction")||f.getAttribute("action");if(r=l?z(l,t):null,n=e.getAttribute("formmethod")||f.getAttribute("method")||ie,a=ve(e.getAttribute("formenctype"))||ve(f.getAttribute("enctype"))||ue,i=new FormData(f,e),!wr()){let{name:o,type:d,value:h}=e;if(d==="image"){let y=o?`${o}.`:"";i.append(`${y}x`,"0"),i.append(`${y}y`,"0")}else o&&i.append(o,h)}}else{if(de(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=ie,r=null,a=ue,s=e}return i&&a==="text/plain"&&(s=i,i=void 0),{action:r,method:n.toLowerCase(),encType:a,formData:i,body:s}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function be(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function it(e,t,n,r){let a=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return n?a.pathname.endsWith("/")?a.pathname=`${a.pathname}_.${r}`:a.pathname=`${a.pathname}.${r}`:a.pathname==="/"?a.pathname=`_root.${r}`:t&&z(a.pathname,t)==="/"?a.pathname=`${se(t)}/_root.${r}`:a.pathname=`${se(a.pathname)}.${r}`,a}async function xr(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(n){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function Pr(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function br(e,t,n){let r=await Promise.all(e.map(async a=>{let i=t.routes[a.route.id];if(i){let s=await xr(i,n);return s.links?s.links():[]}return[]}));return kr(r.flat(1).filter(Pr).filter(a=>a.rel==="stylesheet"||a.rel==="preload").map(a=>a.rel==="stylesheet"?{...a,rel:"prefetch",as:"style"}:{...a,rel:"prefetch"}))}function je(e,t,n,r,a,i){let s=(l,o)=>n[o]?l.route.id!==n[o].route.id:!0,f=(l,o)=>n[o].pathname!==l.pathname||n[o].route.path?.endsWith("*")&&n[o].params["*"]!==l.params["*"];return i==="assets"?t.filter((l,o)=>s(l,o)||f(l,o)):i==="data"?t.filter((l,o)=>{let d=r.routes[l.route.id];if(!d||!d.hasLoader)return!1;if(s(l,o)||f(l,o))return!0;if(l.route.shouldRevalidate){let h=l.route.shouldRevalidate({currentUrl:new URL(a.pathname+a.search+a.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:l.params,defaultShouldRevalidate:!0});if(typeof h=="boolean")return h}return!0}):[]}function Tr(e,t,{includeHydrateFallback:n}={}){return Lr(e.map(r=>{let a=t.routes[r.route.id];if(!a)return[];let i=[a.module];return a.clientActionModule&&(i=i.concat(a.clientActionModule)),a.clientLoaderModule&&(i=i.concat(a.clientLoaderModule)),n&&a.hydrateFallbackModule&&(i=i.concat(a.hydrateFallbackModule)),a.imports&&(i=i.concat(a.imports)),i}).flat(1))}function Lr(e){return[...new Set(e)]}function Or(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function kr(e,t){let n=new Set;return new Set(t),e.reduce((r,a)=>{let i=JSON.stringify(Or(a));return n.has(i)||(n.add(i),r.push({key:i,link:a})),r},[])}function Te(){let e=c.useContext(V);return be(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function $r(){let e=c.useContext(fe);return be(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var Le=c.createContext(void 0);Le.displayName="FrameworkContext";function Oe(){let e=c.useContext(Le);return be(e,"You must render this element inside a <HydratedRouter> element"),e}function Ar(e,t){let n=c.useContext(Le),[r,a]=c.useState(!1),[i,s]=c.useState(!1),{onFocus:f,onBlur:l,onMouseEnter:o,onMouseLeave:d,onTouchStart:h}=t,y=c.useRef(null);c.useEffect(()=>{if(e==="render"&&s(!0),e==="viewport"){let g=S=>{S.forEach(_=>{s(_.isIntersecting)})},m=new IntersectionObserver(g,{threshold:.5});return y.current&&m.observe(y.current),()=>{m.disconnect()}}},[e]),c.useEffect(()=>{if(r){let g=setTimeout(()=>{s(!0)},100);return()=>{clearTimeout(g)}}},[r]);let C=()=>{a(!0)},E=()=>{a(!1),s(!1)};return n?e!=="intent"?[i,y,{}]:[i,y,{onFocus:ee(f,C),onBlur:ee(l,E),onMouseEnter:ee(o,C),onMouseLeave:ee(d,E),onTouchStart:ee(h,C)}]:[!1,y,{}]}function ee(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function Dr({page:e,...t}){let n=qt(),{router:r}=Te(),a=c.useMemo(()=>ze(r.routes,e,r.basename),[r.routes,e,r.basename]);return a?n?c.createElement(Ir,{page:e,matches:a,...t}):c.createElement(Mr,{page:e,matches:a,...t}):null}function Nr(e){let{manifest:t,routeModules:n}=Oe(),[r,a]=c.useState([]);return c.useEffect(()=>{let i=!1;return br(e,t,n).then(s=>{i||a(s)}),()=>{i=!0}},[e,t,n]),r}function Ir({page:e,matches:t,...n}){let r=F(),{future:a}=Oe(),{basename:i}=Te(),s=c.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let f=it(e,i,a.v8_trailingSlashAwareDataRequests,"rsc"),l=!1,o=[];for(let d of t)typeof d.route.shouldRevalidate=="function"?l=!0:o.push(d.route.id);return l&&o.length>0&&f.searchParams.set("_routes",o.join(",")),[f.pathname+f.search]},[i,a.v8_trailingSlashAwareDataRequests,e,r,t]);return c.createElement(c.Fragment,null,s.map(f=>c.createElement("link",{key:f,rel:"prefetch",as:"fetch",href:f,...n})))}function Mr({page:e,matches:t,...n}){let r=F(),{future:a,manifest:i,routeModules:s}=Oe(),{basename:f}=Te(),{loaderData:l,matches:o}=$r(),d=c.useMemo(()=>je(e,t,o,i,r,"data"),[e,t,o,i,r]),h=c.useMemo(()=>je(e,t,o,i,r,"assets"),[e,t,o,i,r]),y=c.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let g=new Set,m=!1;if(t.forEach(_=>{let x=i.routes[_.route.id];!x||!x.hasLoader||(!d.some($=>$.route.id===_.route.id)&&_.route.id in l&&s[_.route.id]?.shouldRevalidate||x.hasClientLoader?m=!0:g.add(_.route.id))}),g.size===0)return[];let S=it(e,f,a.v8_trailingSlashAwareDataRequests,"data");return m&&g.size>0&&S.searchParams.set("_routes",t.filter(_=>g.has(_.route.id)).map(_=>_.route.id).join(",")),[S.pathname+S.search]},[f,a.v8_trailingSlashAwareDataRequests,l,r,i,d,t,e,s]),C=c.useMemo(()=>Tr(h,i),[h,i]),E=Nr(h);return c.createElement(c.Fragment,null,y.map(g=>c.createElement("link",{key:g,rel:"prefetch",as:"fetch",href:g,...n})),C.map(g=>c.createElement("link",{key:g,rel:"modulepreload",href:g,...n})),E.map(({key:g,link:m})=>c.createElement("link",{key:g,nonce:n.nonce,...m,crossOrigin:m.crossOrigin??n.crossOrigin})))}function Hr(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var Ur=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{Ur&&(window.__reactRouterVersion="7.17.0")}catch{}function en({basename:e,children:t,useTransitions:n,window:r}){let a=c.useRef();a.current==null&&(a.current=vt({window:r,v5Compat:!0}));let i=a.current,[s,f]=c.useState({action:i.action,location:i.location}),l=c.useCallback(o=>{n===!1?f(o):c.startTransition(()=>f(o))},[n]);return c.useLayoutEffect(()=>i.listen(l),[i,l]),c.createElement(mr,{basename:e,children:t,location:s.location,navigationType:s.action,navigator:i,useTransitions:n})}var ut=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,lt=c.forwardRef(function({onClick:t,discover:n="render",prefetch:r="none",relative:a,reloadDocument:i,replace:s,mask:f,state:l,target:o,to:d,preventScrollReset:h,viewTransition:y,defaultShouldRevalidate:C,...E},g){let{basename:m,navigator:S,useTransitions:_}=c.useContext(N),x=typeof d=="string"&&ut.test(d),$=Je(d,m);d=$.to;let k=Zt(d,{relative:a}),I=F(),P=null;if(f){let B=ce(f,[],I.mask?I.mask.pathname:"/",!0);m!=="/"&&(B.pathname=B.pathname==="/"?m:H([m,B.pathname])),P=S.createHref(B)}let[W,Y,X]=Ar(r,E),Q=Wr(d,{replace:s,mask:f,state:l,target:o,preventScrollReset:h,relative:a,viewTransition:y,defaultShouldRevalidate:C,useTransitions:_});function he(B){t&&t(B),B.defaultPrevented||Q(B)}let Z=!($.isExternal||i),q=c.createElement("a",{...E,...X,href:(Z?P:void 0)||$.absoluteURL||k,onClick:Z?he:t,ref:Hr(g,Y),target:o,"data-discover":!x&&n==="render"?"true":void 0});return W&&!x?c.createElement(c.Fragment,null,q,c.createElement(Dr,{page:k})):q});lt.displayName="Link";var Fr=c.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:r="",end:a=!1,style:i,to:s,viewTransition:f,children:l,...o},d){let h=ne(s,{relative:o.relative}),y=F(),C=c.useContext(fe),{navigator:E,basename:g}=c.useContext(N),m=C!=null&&Gr(h)&&f===!0,S=E.encodeLocation?E.encodeLocation(h).pathname:h.pathname,_=y.pathname,x=C&&C.navigation&&C.navigation.location?C.navigation.location.pathname:null;n||(_=_.toLowerCase(),x=x?x.toLowerCase():null,S=S.toLowerCase()),x&&g&&(x=z(x,g)||x);const $=S!=="/"&&S.endsWith("/")?S.length-1:S.length;let k=_===S||!a&&_.startsWith(S)&&_.charAt($)==="/",I=x!=null&&(x===S||!a&&x.startsWith(S)&&x.charAt(S.length)==="/"),P={isActive:k,isPending:I,isTransitioning:m},W=k?t:void 0,Y;typeof r=="function"?Y=r(P):Y=[r,k?"active":null,I?"pending":null,m?"transitioning":null].filter(Boolean).join(" ");let X=typeof i=="function"?i(P):i;return c.createElement(lt,{...o,"aria-current":W,className:Y,ref:d,style:X,to:s,viewTransition:f},typeof l=="function"?l(P):l)});Fr.displayName="NavLink";var Br=c.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:a,state:i,method:s=ie,action:f,onSubmit:l,relative:o,preventScrollReset:d,viewTransition:h,defaultShouldRevalidate:y,...C},E)=>{let{useTransitions:g}=c.useContext(N),m=qr(),S=Kr(f,{relative:o}),_=s.toLowerCase()==="get"?"get":"post",x=typeof f=="string"&&ut.test(f),$=k=>{if(l&&l(k),k.defaultPrevented)return;k.preventDefault();let I=k.nativeEvent.submitter,P=I?.getAttribute("formmethod")||s,W=()=>m(I||k.currentTarget,{fetcherKey:t,method:P,navigate:n,replace:a,state:i,relative:o,preventScrollReset:d,viewTransition:h,defaultShouldRevalidate:y});g&&n!==!1?c.startTransition(()=>W()):W()};return c.createElement("form",{ref:E,method:_,action:S,onSubmit:r?l:$,...C,"data-discover":!x&&e==="render"?"true":void 0})});Br.displayName="Form";function jr(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function st(e){let t=c.useContext(V);return O(t,jr(e)),t}function Wr(e,{target:t,replace:n,mask:r,state:a,preventScrollReset:i,relative:s,viewTransition:f,defaultShouldRevalidate:l,useTransitions:o}={}){let d=_e(),h=F(),y=ne(e,{relative:s});return c.useCallback(C=>{if(Er(C,t)){C.preventDefault();let E=n!==void 0?n:te(h)===te(y),g=()=>d(e,{replace:E,mask:r,state:a,preventScrollReset:i,relative:s,viewTransition:f,defaultShouldRevalidate:l});o?c.startTransition(()=>g()):g()}},[h,d,y,n,r,a,t,e,i,s,f,l,o])}function tn(e){M(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=c.useRef(Se(e)),n=c.useRef(!1),r=F(),a=c.useMemo(()=>Sr(r.search,n.current?null:t.current),[r.search]),i=_e(),s=c.useCallback((f,l)=>{const o=Se(typeof f=="function"?f(new URLSearchParams(a)):f);n.current=!0,i("?"+o,l)},[i,a]);return[a,s]}var Yr=0,zr=()=>`__${String(++Yr)}__`;function qr(){let{router:e}=st("useSubmit"),{basename:t}=c.useContext(N),n=cr(),r=e.fetch,a=e.navigate;return c.useCallback(async(i,s={})=>{let{action:f,method:l,encType:o,formData:d,body:h}=_r(i,t);if(s.navigate===!1){let y=s.fetcherKey||zr();await r(y,n,s.action||f,{defaultShouldRevalidate:s.defaultShouldRevalidate,preventScrollReset:s.preventScrollReset,formData:d,body:h,formMethod:s.method||l,formEncType:s.encType||o,flushSync:s.flushSync})}else await a(s.action||f,{defaultShouldRevalidate:s.defaultShouldRevalidate,preventScrollReset:s.preventScrollReset,formData:d,body:h,formMethod:s.method||l,formEncType:s.encType||o,replace:s.replace,state:s.state,fromRouteId:n,flushSync:s.flushSync,viewTransition:s.viewTransition})},[r,a,t,n])}function Kr(e,{relative:t}={}){let{basename:n}=c.useContext(N),r=c.useContext(U);O(r,"useFormAction must be used inside a RouteContext");let[a]=r.matches.slice(-1),i={...ne(e||".",{relative:t})},s=F();if(e==null){i.search=s.search;let f=new URLSearchParams(i.search),l=f.getAll("index");if(l.some(d=>d==="")){f.delete("index"),l.filter(h=>h).forEach(h=>f.append("index",h));let d=f.toString();i.search=d?`?${d}`:""}}return(!e||e===".")&&a.route.index&&(i.search=i.search?i.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(i.pathname=i.pathname==="/"?n:H([n,i.pathname])),te(i)}function Gr(e,{relative:t}={}){let n=c.useContext(Ze);O(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=st("useViewTransitionState"),a=ne(e,{relative:t});if(!n.isTransitioning)return!1;let i=z(n.currentLocation.pathname,r)||n.currentLocation.pathname,s=z(n.nextLocation.pathname,r)||n.nextLocation.pathname;return le(a.pathname,s)!=null||le(a.pathname,i)!=null}var Vr=gt();const rn=We(Vr);export{en as B,lt as L,Fr as N,Jr as R,Vr as a,Ye as b,gt as c,_e as d,Zr as e,pr as f,Qr as g,mt as h,rn as i,We as j,Xr as k,tn as l,c as r,F as u};
|
package/dist/webdist/index.html
CHANGED
|
@@ -9,8 +9,10 @@
|
|
|
9
9
|
<meta name="theme-color" content="#c96442" />
|
|
10
10
|
<meta name="description" content="TurboLLM - a local-LLM platform: run any GGUF model with a fast browser UI and an OpenAI/Anthropic-compatible API." />
|
|
11
11
|
<title>TurboLLM</title>
|
|
12
|
-
<script type="module" crossorigin src="/assets/index-
|
|
13
|
-
<link rel="
|
|
12
|
+
<script type="module" crossorigin src="/assets/index-BhB9CGsv.js"></script>
|
|
13
|
+
<link rel="modulepreload" crossorigin href="/assets/vendor-D_-14Whs.js">
|
|
14
|
+
<link rel="modulepreload" crossorigin href="/assets/radix-RipaNCX7.js">
|
|
15
|
+
<link rel="stylesheet" crossorigin href="/assets/index-B3f5udGb.css">
|
|
14
16
|
</head>
|
|
15
17
|
<body>
|
|
16
18
|
<div id="root"></div>
|