From ef995649a6f4ee3c246c8d73321cde96b90959c2 Mon Sep 17 00:00:00 2001 From: RealKai42 Date: Thu, 12 Sep 2024 15:35:03 +0000 Subject: [PATCH] deploy: 92620a74d66205d80591e47cbeae40eb2acf4a0f --- .../{FileSaver.min-eed0e3a4.js => FileSaver.min-f8dc30b5.js} | 2 +- ...ort-import-9a32c9a5.js => dexie-export-import-205d1258.js} | 2 +- assets/{index-665d36e8.js => index-1dd1c93a.js} | 2 +- assets/{index-9db00908.js => index-3ae32782.js} | 4 ++-- assets/{index-9878bcc0.js => index-85f08de1.js} | 2 +- index.html | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) rename assets/{FileSaver.min-eed0e3a4.js => FileSaver.min-f8dc30b5.js} (97%) rename assets/{dexie-export-import-9a32c9a5.js => dexie-export-import-205d1258.js} (99%) rename assets/{index-665d36e8.js => index-1dd1c93a.js} (99%) rename assets/{index-9db00908.js => index-3ae32782.js} (99%) rename assets/{index-9878bcc0.js => index-85f08de1.js} (99%) diff --git a/assets/FileSaver.min-eed0e3a4.js b/assets/FileSaver.min-f8dc30b5.js similarity index 97% rename from assets/FileSaver.min-eed0e3a4.js rename to assets/FileSaver.min-f8dc30b5.js index 3c98f6f8fd..2607d9cfc7 100644 --- a/assets/FileSaver.min-eed0e3a4.js +++ b/assets/FileSaver.min-f8dc30b5.js @@ -1 +1 @@ -import{aC as O,c as d}from"./index-9db00908.js";function A(u,v){for(var l=0;lr[c]})}}}return Object.freeze(Object.defineProperty(u,Symbol.toStringTag,{value:"Module"}))}var E={exports:{}};(function(u,v){(function(l,r){r()})(d,function(){function l(e,t){return typeof t>"u"?t={autoBom:!1}:typeof t!="object"&&(t={autoBom:!t}),t.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob(["\uFEFF",e],{type:e.type}):e}function r(e,t,i){var o=new XMLHttpRequest;o.open("GET",e),o.responseType="blob",o.onload=function(){p(o.response,t,i)},o.onerror=function(){},o.send()}function c(e){var t=new XMLHttpRequest;t.open("HEAD",e,!1);try{t.send()}catch{}return 200<=t.status&&299>=t.status}function s(e){try{e.dispatchEvent(new MouseEvent("click"))}catch{var t=document.createEvent("MouseEvents");t.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),e.dispatchEvent(t)}}var a=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof d=="object"&&d.global===d?d:void 0,y=a.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),p=a.saveAs||(typeof window!="object"||window!==a?function(){}:"download"in HTMLAnchorElement.prototype&&!y?function(e,t,i){var o=a.URL||a.webkitURL,n=document.createElement("a");t=t||e.name||"download",n.download=t,n.rel="noopener",typeof e=="string"?(n.href=e,n.origin===location.origin?s(n):c(n.href)?r(e,t,i):s(n,n.target="_blank")):(n.href=o.createObjectURL(e),setTimeout(function(){o.revokeObjectURL(n.href)},4e4),setTimeout(function(){s(n)},0))}:"msSaveOrOpenBlob"in navigator?function(e,t,i){if(t=t||e.name||"download",typeof e!="string")navigator.msSaveOrOpenBlob(l(e,i),t);else if(c(e))r(e,t,i);else{var o=document.createElement("a");o.href=e,o.target="_blank",setTimeout(function(){s(o)})}}:function(e,t,i,o){if(o=o||open("","_blank"),o&&(o.document.title=o.document.body.innerText="downloading..."),typeof e=="string")return r(e,t,i);var n=e.type==="application/octet-stream",g=/constructor/i.test(a.HTMLElement)||a.safari,b=/CriOS\/[\d]+/.test(navigator.userAgent);if((b||n&&g||y)&&typeof FileReader<"u"){var m=new FileReader;m.onloadend=function(){var f=m.result;f=b?f:f.replace(/^data:[^;]*;/,"data:attachment/file;"),o?o.location.href=f:location=f,o=null},m.readAsDataURL(e)}else{var j=a.URL||a.webkitURL,w=j.createObjectURL(e);o?o.location=w:location.href=w,o=null,setTimeout(function(){j.revokeObjectURL(w)},4e4)}});a.saveAs=p.saveAs=p,u.exports=p})})(E);var h=E.exports;const L=O(h),S=A({__proto__:null,default:L},[h]);export{S as F}; +import{aC as O,c as d}from"./index-3ae32782.js";function A(u,v){for(var l=0;lr[c]})}}}return Object.freeze(Object.defineProperty(u,Symbol.toStringTag,{value:"Module"}))}var E={exports:{}};(function(u,v){(function(l,r){r()})(d,function(){function l(e,t){return typeof t>"u"?t={autoBom:!1}:typeof t!="object"&&(t={autoBom:!t}),t.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob(["\uFEFF",e],{type:e.type}):e}function r(e,t,i){var o=new XMLHttpRequest;o.open("GET",e),o.responseType="blob",o.onload=function(){p(o.response,t,i)},o.onerror=function(){},o.send()}function c(e){var t=new XMLHttpRequest;t.open("HEAD",e,!1);try{t.send()}catch{}return 200<=t.status&&299>=t.status}function s(e){try{e.dispatchEvent(new MouseEvent("click"))}catch{var t=document.createEvent("MouseEvents");t.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),e.dispatchEvent(t)}}var a=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof d=="object"&&d.global===d?d:void 0,y=a.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),p=a.saveAs||(typeof window!="object"||window!==a?function(){}:"download"in HTMLAnchorElement.prototype&&!y?function(e,t,i){var o=a.URL||a.webkitURL,n=document.createElement("a");t=t||e.name||"download",n.download=t,n.rel="noopener",typeof e=="string"?(n.href=e,n.origin===location.origin?s(n):c(n.href)?r(e,t,i):s(n,n.target="_blank")):(n.href=o.createObjectURL(e),setTimeout(function(){o.revokeObjectURL(n.href)},4e4),setTimeout(function(){s(n)},0))}:"msSaveOrOpenBlob"in navigator?function(e,t,i){if(t=t||e.name||"download",typeof e!="string")navigator.msSaveOrOpenBlob(l(e,i),t);else if(c(e))r(e,t,i);else{var o=document.createElement("a");o.href=e,o.target="_blank",setTimeout(function(){s(o)})}}:function(e,t,i,o){if(o=o||open("","_blank"),o&&(o.document.title=o.document.body.innerText="downloading..."),typeof e=="string")return r(e,t,i);var n=e.type==="application/octet-stream",g=/constructor/i.test(a.HTMLElement)||a.safari,b=/CriOS\/[\d]+/.test(navigator.userAgent);if((b||n&&g||y)&&typeof FileReader<"u"){var m=new FileReader;m.onloadend=function(){var f=m.result;f=b?f:f.replace(/^data:[^;]*;/,"data:attachment/file;"),o?o.location.href=f:location=f,o=null},m.readAsDataURL(e)}else{var j=a.URL||a.webkitURL,w=j.createObjectURL(e);o?o.location=w:location.href=w,o=null,setTimeout(function(){j.revokeObjectURL(w)},4e4)}});a.saveAs=p.saveAs=p,u.exports=p})})(E);var h=E.exports;const L=O(h),S=A({__proto__:null,default:L},[h]);export{S as F}; diff --git a/assets/dexie-export-import-9a32c9a5.js b/assets/dexie-export-import-205d1258.js similarity index 99% rename from assets/dexie-export-import-9a32c9a5.js rename to assets/dexie-export-import-205d1258.js index 20c9160fb8..2ea789232f 100644 --- a/assets/dexie-export-import-9a32c9a5.js +++ b/assets/dexie-export-import-205d1258.js @@ -1,4 +1,4 @@ -import{aD as Ce}from"./index-9db00908.js";/*! ***************************************************************************** +import{aD as Ce}from"./index-3ae32782.js";/*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any diff --git a/assets/index-665d36e8.js b/assets/index-1dd1c93a.js similarity index 99% rename from assets/index-665d36e8.js rename to assets/index-1dd1c93a.js index 070c21bba3..33459ab0b9 100644 --- a/assets/index-665d36e8.js +++ b/assets/index-1dd1c93a.js @@ -1,4 +1,4 @@ -import{r as s,m as xo,n as G,_ as E,o as zt,p as Wt,D as Ut,M as Eo,s as Io,I as Yt,v as K,H as Zt,w as qt,y as Jt,T as Fo,x as Po,$,z as Mo,A as To,B as Go,R as Vo,X as Kt,C as No,E as Do,G as ko,J as Q,O as yt,K as fe,N as $t,P as Oo,Q as xt,S as _o,a as p,d as ct,U as Et,j as R,F as Fe,V as M,W as Xt,Y as Qt,Z as en,a0 as tn,a1 as jo,a2 as nn,a3 as Lo,a4 as Ho,a5 as we,e as dt,a6 as on,a7 as rn,a8 as Bo,a9 as an,aa as gt,ab as ln,ac as zo,ad as Wo,ae as Uo,h as ft,k as sn,af as Yo,ag as un,ah as Zo,ai as cn,aj as de,ak as X,al as pt,am as oe,an as qe,ao as N,ap as se,aq as Pe,u as It,ar as qo,as as Jo,at as Ko,au as ht,av as Xo,aw as Qo,ax as dn,ay as er,az as tr,aA as nr,f as or,L as rr,t as ar,aB as ir,l as lr}from"./index-9db00908.js";const sr=s.forwardRef((e,t)=>{var n;const{container:o=globalThis==null||(n=globalThis.document)===null||n===void 0?void 0:n.body,...r}=e;return o?xo.createPortal(s.createElement(G.div,E({},r,{ref:t})),o):null});function ur({container:e,accept:t,walk:n,enabled:o=!0}){let r=s.useRef(t),a=s.useRef(n);s.useEffect(()=>{r.current=t,a.current=n},[t,n]),zt(()=>{if(!e||!o)return;let i=Wt(e);if(!i)return;let l=r.current,u=a.current,d=Object.assign(g=>l(g),{acceptNode:l}),c=i.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,d,!1);for(;c.nextNode();)u(c.currentNode)},[e,o,r,a])}var cr=(e=>(e[e.RegisterOption=0]="RegisterOption",e[e.UnregisterOption=1]="UnregisterOption",e))(cr||{});let dr={[0](e,t){let n=[...e.options,{id:t.id,element:t.element,propsRef:t.propsRef}];return{...e,options:_o(n,o=>o.element.current)}},[1](e,t){let n=e.options.slice(),o=e.options.findIndex(r=>r.id===t.id);return o===-1?e:(n.splice(o,1),{...e,options:n})}},mt=s.createContext(null);mt.displayName="RadioGroupDataContext";function gn(e){let t=s.useContext(mt);if(t===null){let n=new Error(`<${e} /> is missing a parent component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,gn),n}return t}let vt=s.createContext(null);vt.displayName="RadioGroupActionsContext";function fn(e){let t=s.useContext(vt);if(t===null){let n=new Error(`<${e} /> is missing a parent component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,fn),n}return t}function gr(e,t){return ko(t.type,dr,e,t)}let fr="div";function pr(e,t){let n=Yt(),{id:o=`headlessui-radiogroup-${n}`,value:r,defaultValue:a,form:i,name:l,onChange:u,by:d=(I,_)=>I===_,disabled:c=!1,...g}=e,h=K(typeof d=="string"?(I,_)=>{let D=d;return(I==null?void 0:I[D])===(_==null?void 0:_[D])}:d),[m,v]=s.useReducer(gr,{options:[]}),f=m.options,[A,C]=Zt(),[w,S]=qt(),b=s.useRef(null),x=Jt(b,t),[P,F]=Fo(r,u,a),T=s.useMemo(()=>f.find(I=>!I.propsRef.current.disabled),[f]),k=s.useMemo(()=>f.some(I=>h(I.propsRef.current.value,P)),[f,P]),O=K(I=>{var _;if(c||h(I,P))return!1;let D=(_=f.find(J=>h(J.propsRef.current.value,I)))==null?void 0:_.propsRef.current;return D!=null&&D.disabled?!1:(F==null||F(I),!0)});ur({container:b.current,accept(I){return I.getAttribute("role")==="radio"?NodeFilter.FILTER_REJECT:I.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT},walk(I){I.setAttribute("role","none")}});let re=K(I=>{let _=b.current;if(!_)return;let D=Wt(_),J=f.filter(V=>V.propsRef.current.disabled===!1).map(V=>V.element.current);switch(I.key){case Q.Enter:Oo(I.currentTarget);break;case Q.ArrowLeft:case Q.ArrowUp:if(I.preventDefault(),I.stopPropagation(),yt(J,fe.Previous|fe.WrapAround)===$t.Success){let V=f.find(ie=>ie.element.current===(D==null?void 0:D.activeElement));V&&O(V.propsRef.current.value)}break;case Q.ArrowRight:case Q.ArrowDown:if(I.preventDefault(),I.stopPropagation(),yt(J,fe.Next|fe.WrapAround)===$t.Success){let V=f.find(ie=>ie.element.current===(D==null?void 0:D.activeElement));V&&O(V.propsRef.current.value)}break;case Q.Space:{I.preventDefault(),I.stopPropagation();let V=f.find(ie=>ie.element.current===(D==null?void 0:D.activeElement));V&&O(V.propsRef.current.value)}break}}),B=K(I=>(v({type:0,...I}),()=>v({type:1,id:I.id}))),ae=s.useMemo(()=>({value:P,firstOption:T,containsCheckedOption:k,disabled:c,compare:h,...m}),[P,T,k,c,h,m]),Ve=s.useMemo(()=>({registerOption:B,change:O}),[B,O]),W={ref:x,id:o,role:"radiogroup","aria-labelledby":A,"aria-describedby":w,onKeyDown:re},yo=s.useMemo(()=>({value:P}),[P]),ge=s.useRef(null),$o=Po();return s.useEffect(()=>{ge.current&&a!==void 0&&$o.addEventListener(ge.current,"reset",()=>{O(a)})},[ge,O]),$.createElement(S,{name:"RadioGroup.Description"},$.createElement(C,{name:"RadioGroup.Label"},$.createElement(vt.Provider,{value:Ve},$.createElement(mt.Provider,{value:ae},l!=null&&P!=null&&Mo({[l]:P}).map(([I,_],D)=>$.createElement(To,{features:Go.Hidden,ref:D===0?J=>{var V;ge.current=(V=J==null?void 0:J.closest("form"))!=null?V:null}:void 0,...Vo({key:I,as:"input",type:"radio",checked:_!=null,hidden:!0,readOnly:!0,form:i,name:I,value:_})})),Kt({ourProps:W,theirProps:g,slot:yo,defaultTag:fr,name:"RadioGroup"})))))}var hr=(e=>(e[e.Empty=1]="Empty",e[e.Active=2]="Active",e))(hr||{});let mr="div";function vr(e,t){var n;let o=Yt(),{id:r=`headlessui-radiogroup-option-${o}`,value:a,disabled:i=!1,...l}=e,u=s.useRef(null),d=Jt(u,t),[c,g]=Zt(),[h,m]=qt(),{addFlag:v,removeFlag:f,hasFlag:A}=No(1),C=Do({value:a,disabled:i}),w=gn("RadioGroup.Option"),S=fn("RadioGroup.Option");zt(()=>S.registerOption({id:r,element:u,propsRef:C}),[r,S,u,e]);let b=K(B=>{var ae;if(xt(B.currentTarget))return B.preventDefault();S.change(a)&&(v(2),(ae=u.current)==null||ae.focus())}),x=K(B=>{if(xt(B.currentTarget))return B.preventDefault();v(2)}),P=K(()=>f(2)),F=((n=w.firstOption)==null?void 0:n.id)===r,T=w.disabled||i,k=w.compare(w.value,a),O={ref:d,id:r,role:"radio","aria-checked":k?"true":"false","aria-labelledby":c,"aria-describedby":h,"aria-disabled":T?!0:void 0,tabIndex:(()=>T?-1:k||!w.containsCheckedOption&&F?0:-1)(),onClick:T?void 0:b,onFocus:T?void 0:x,onBlur:T?void 0:P},re=s.useMemo(()=>({checked:k,disabled:T,active:A(2)}),[k,T,A]);return $.createElement(m,{name:"RadioGroup.Description"},$.createElement(g,{name:"RadioGroup.Label"},Kt({ourProps:O,theirProps:l,slot:re,defaultTag:mr,name:"RadioGroup.Option"})))}let Ar=Ut(pr),Cr=Ut(vr),Ee=Object.assign(Ar,{Option:Cr,Label:Eo,Description:Io});var br=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},ee=new WeakMap,pe=new WeakMap,he={},Ne=0,pn=function(e){return e&&(e.host||pn(e.parentNode))},wr=function(e,t){return t.map(function(n){if(e.contains(n))return n;var o=pn(n);return o&&e.contains(o)?o:null}).filter(function(n){return!!n})},Sr=function(e,t,n,o){var r=wr(t,Array.isArray(e)?e:[e]);he[n]||(he[n]=new WeakMap);var a=he[n],i=[],l=new Set,u=new Set(r),d=function(g){!g||l.has(g)||(l.add(g),d(g.parentNode))};r.forEach(d);var c=function(g){!g||u.has(g)||Array.prototype.forEach.call(g.children,function(h){if(l.has(h))c(h);else{var m=h.getAttribute(o),v=m!==null&&m!=="false",f=(ee.get(h)||0)+1,A=(a.get(h)||0)+1;ee.set(h,f),a.set(h,A),i.push(h),f===1&&v&&pe.set(h,!0),A===1&&h.setAttribute(n,"true"),v||h.setAttribute(o,"true")}})};return c(t),l.clear(),Ne++,function(){i.forEach(function(g){var h=ee.get(g)-1,m=a.get(g)-1;ee.set(g,h),a.set(g,m),h||(pe.has(g)||g.removeAttribute(o),pe.delete(g)),m||g.removeAttribute(n)}),Ne--,Ne||(ee=new WeakMap,ee=new WeakMap,pe=new WeakMap,he={})}},Rr=function(e,t,n){n===void 0&&(n="data-aria-hidden");var o=Array.from(Array.isArray(e)?e:[e]),r=t||br(e);return r?(o.push.apply(o,Array.from(r.querySelectorAll("[aria-live]"))),Sr(o,r,n,"aria-hidden")):function(){return null}};globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(e,t){return this.cache.has(e)?this.cache.get(e):(this.cache.set(e,t),t)}};function yr({tagList:e,currentTag:t,onChangeCurrentTag:n}){const o=s.useCallback(r=>{n(r)},[n]);return p(Ee,{value:t,onChange:o,children:p("div",{className:"flex items-center space-x-4",children:e.map(r=>p(Ee.Option,{value:r,className:({checked:a})=>`cursor-pointer whitespace-nowrap rounded-[3rem] px-4 py-2 ${a?"bg-indigo-400 text-white":"bg-white text-gray-600 dark:bg-gray-800 dark:text-gray-200"} ${!a&&"hover:bg-indigo-100 dark:hover:bg-gray-600"}`,children:p("p",{className:"font-normal ",children:r})},r))})})}globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(e,t){return this.cache.has(e)?this.cache.get(e):(this.cache.set(e,t),t)}};function $r(e,t,n){const[o,r]=s.useState(null);return s.useEffect(()=>{n&&!o&&(async()=>{const i=await xr(t,e);r(i)})()},[t,e,n]),o}async function xr(e,t){const n=await ct.chapterRecords.where({dict:e,chapter:t}).toArray(),o=n.length,r=n.reduce((u,{wordNumber:d,correctWordIndexes:c})=>u+(d-c.length),0),a=o>0?Et(r/o,2):0,i=n.reduce((u,{wrongCount:d})=>u+(d??0),0),l=o>0?Et(i/o,2):0;return{exerciseCount:o,avgWrongWordCount:a,avgWrongInputCount:l}}globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(e,t){return this.cache.has(e)?this.cache.get(e):(this.cache.set(e,t),t)}};function hn(e,{threshold:t=0,root:n=null,rootMargin:o="0%",freezeOnceVisible:r=!1}){const[a,i]=s.useState(),l=(a==null?void 0:a.isIntersecting)&&r,u=([d])=>{i(d)};return s.useEffect(()=>{const d=e==null?void 0:e.current;if(!!!window.IntersectionObserver||l||!d)return;const g={threshold:t,root:n,rootMargin:o},h=new IntersectionObserver(u,g);return h.observe(d),()=>h.disconnect()},[e==null?void 0:e.current,JSON.stringify(t),n,o,l]),a}const Er=e=>p("svg",{viewBox:"0 0 24 24",width:"1.2em",height:"1.2em",...e,children:p("path",{fill:"currentColor",fillRule:"evenodd",d:"M2.25 12c0-5.385 4.365-9.75 9.75-9.75s9.75 4.365 9.75 9.75s-4.365 9.75-9.75 9.75S2.25 17.385 2.25 12m13.36-1.814a.75.75 0 1 0-1.22-.872l-3.236 4.53L9.53 12.22a.75.75 0 0 0-1.06 1.06l2.25 2.25a.75.75 0 0 0 1.14-.094z",clipRule:"evenodd"})}),Ir=Er;globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(e,t){return this.cache.has(e)?this.cache.get(e):(this.cache.set(e,t),t)}};function Fr({index:e,checked:t,dictID:n,onChange:o}){const r=s.useRef(null),a=hn(r,{}),i=!!(a!=null&&a.isIntersecting),l=$r(e,n,i);return s.useEffect(()=>{var u,d;if(t&&r.current!==null){const c=r.current,g=(d=(u=c.parentElement)==null?void 0:u.parentElement)==null?void 0:d.parentElement;g==null||g.scroll({top:c.offsetTop-g.offsetTop-300,behavior:"smooth"})}},[t]),R("div",{ref:r,className:"relative flex h-16 w-40 cursor-pointer flex-col items-start justify-center overflow-hidden rounded-xl bg-slate-100 px-3 py-2 dark:bg-slate-800",onClick:()=>o(e),children:[R("h1",{children:["第 ",e+1," 章"]}),p("p",{className:"pt-[2px] text-xs text-slate-600",children:l?l.exerciseCount>0?`练习 ${l.exerciseCount} 次`:"未练习":"加载中..."}),t&&p(Ir,{className:"absolute -bottom-4 -right-4 h-18 w-18 text-6xl text-green-500 opacity-40 dark:text-green-300"})]})}function Pr(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function Mr(...e){return t=>e.forEach(n=>Pr(n,t))}var mn=s.forwardRef((e,t)=>{const{children:n,...o}=e,r=s.Children.toArray(n),a=r.find(Gr);if(a){const i=a.props.children,l=r.map(u=>u===a?s.Children.count(i)>1?s.Children.only(null):s.isValidElement(i)?i.props.children:null:u);return p(Je,{...o,ref:t,children:s.isValidElement(i)?s.cloneElement(i,void 0,l):null})}return p(Je,{...o,ref:t,children:n})});mn.displayName="Slot";var Je=s.forwardRef((e,t)=>{const{children:n,...o}=e;if(s.isValidElement(n)){const r=Nr(n);return s.cloneElement(n,{...Vr(o,n.props),ref:t?Mr(t,r):r})}return s.Children.count(n)>1?s.Children.only(null):null});Je.displayName="SlotClone";var Tr=({children:e})=>p(Fe,{children:e});function Gr(e){return s.isValidElement(e)&&e.type===Tr}function Vr(e,t){const n={...t};for(const o in t){const r=e[o],a=t[o];/^on[A-Z]/.test(o)?r&&a?n[o]=(...l)=>{a(...l),r(...l)}:r&&(n[o]=r):o==="style"?n[o]={...r,...a}:o==="className"&&(n[o]=[r,a].filter(Boolean).join(" "))}return{...e,...n}}function Nr(e){var o,r;let t=(o=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(r=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(e,t){return this.cache.has(e)?this.cache.get(e):(this.cache.set(e,t),t)}};const Dr=Xt("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-white transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-slate-950 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 dark:ring-offset-slate-950 dark:focus-visible:ring-slate-300",{variants:{variant:{default:"bg-indigo-500 shadow text-white hover:opacity-90 dark:text-opacity-80 focus:outline-none rounded-lg",destructive:"bg-red-500 text-slate-50 hover:bg-red-500/90 dark:bg-red-900 dark:text-slate-50 dark:hover:bg-red-900/90",outline:"border border-slate-200 bg-white hover:bg-slate-100 hover:text-slate-900 dark:border-slate-800 dark:bg-slate-950 dark:hover:bg-slate-800 dark:hover:text-slate-50",secondary:"bg-slate-100 text-slate-900 hover:bg-slate-100/80 dark:bg-slate-800 dark:text-slate-50 dark:hover:bg-slate-800/80",ghost:"hover:bg-slate-100 hover:text-slate-900 dark:hover:bg-slate-800 dark:hover:text-slate-50",link:"text-slate-900 underline-offset-4 hover:underline dark:text-slate-50"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),ue=s.forwardRef(({className:e,variant:t,size:n,asChild:o=!1,...r},a)=>p(o?mn:"button",{className:M(Dr({variant:t,size:n,className:e})),ref:a,...r}));ue.displayName="Button";const Ft=e=>p("svg",{viewBox:"0 0 256 256",width:"1.2em",height:"1.2em",...e,children:p("path",{fill:"currentColor",d:"M119.39 172.94a8 8 0 0 1-1.73 8.72l-32 32a8 8 0 0 1-11.32 0l-32-32A8 8 0 0 1 48 168h24V48a8 8 0 0 1 16 0v120h24a8 8 0 0 1 7.39 4.94m94.27-98.6l-32-32a8 8 0 0 0-11.32 0l-32 32A8 8 0 0 0 144 88h24v120a8 8 0 0 0 16 0V88h24a8 8 0 0 0 5.66-13.66"})});globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(e,t){return this.cache.has(e)?this.cache.get(e):(this.cache.set(e,t),t)}};const kr=e=>[{accessorKey:"word",size:100,header:({column:t})=>R(ue,{variant:"ghost",className:"p-0",onClick:()=>t.toggleSorting(t.getIsSorted()==="asc"),children:["单词",p(Ft,{className:"ml-1.5 h-4 w-4"})]})},{accessorKey:"trans",size:500,header:"释义"},{accessorKey:"errorCount",size:40,header:({column:t})=>R(ue,{variant:"ghost",className:"p-0",onClick:()=>t.toggleSorting(t.getIsSorted()==="asc"),children:["错误次数",p(Ft,{className:"ml-1.5 h-4 w-4"})]}),cell:({row:t})=>R("span",{className:"flex justify-center",children:[t.original.errorCount," "]})},{accessorKey:"errorChar",header:"易错字母",size:100,cell:({row:t})=>p("p",{children:t.getValue("errorChar").map((n,o)=>p("kbd",{className:"flex justify-center",children:n+" "},`${n}-${o}`))})},{accessorKey:"delete",header:"",size:40,cell:({row:t})=>p(Qt,{children:R(en,{children:[p(tn,{children:p(jo,{className:"cursor-pointer",onClick:()=>e(t.original.word)})}),p(nn,{children:p("p",{children:"Delete Records"})})]})})}];function Or(e){return e.map(t=>({word:t.word,trans:t.originData.trans.join(",")??"",errorCount:t.errorCount,errorChar:t.errorChar}))}globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(e,t){return this.cache.has(e)?this.cache.get(e):(this.cache.set(e,t),t)}};const vn=s.forwardRef(({className:e,...t},n)=>p("div",{className:"relative h-full w-full overflow-auto",children:p("table",{ref:n,className:M("w-full caption-bottom text-sm",e),...t})}));vn.displayName="Table";const An=s.forwardRef(({className:e,...t},n)=>p("thead",{ref:n,className:M("[&_tr]:border-b",e),...t}));An.displayName="TableHeader";const Cn=s.forwardRef(({className:e,...t},n)=>p("tbody",{ref:n,className:M("[&_tr:last-child]:border-0",e),...t}));Cn.displayName="TableBody";const _r=s.forwardRef(({className:e,...t},n)=>p("tfoot",{ref:n,className:M("border-t bg-slate-100/50 font-medium dark:bg-slate-800/50 [&>tr]:last:border-b-0",e),...t}));_r.displayName="TableFooter";const Se=s.forwardRef(({className:e,...t},n)=>p("tr",{ref:n,className:M("border-b transition-colors hover:bg-slate-100/50 data-[state=selected]:bg-slate-100 dark:hover:bg-slate-800/50 dark:data-[state=selected]:bg-slate-800",e),...t}));Se.displayName="TableRow";const bn=s.forwardRef(({className:e,...t},n)=>p("th",{ref:n,className:M("h-12 px-4 text-left align-middle font-medium text-slate-500 dark:text-slate-400 [&:has([role=checkbox])]:pr-0",e),...t}));bn.displayName="TableHead";const Ke=s.forwardRef(({className:e,...t},n)=>p("td",{ref:n,className:M("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));Ke.displayName="TableCell";const jr=s.forwardRef(({className:e,...t},n)=>p("caption",{ref:n,className:M("mt-4 text-sm text-slate-500 dark:text-slate-400",e),...t}));jr.displayName="TableCaption";/** +import{r as s,m as xo,n as G,_ as E,o as zt,p as Wt,D as Ut,M as Eo,s as Io,I as Yt,v as K,H as Zt,w as qt,y as Jt,T as Fo,x as Po,$,z as Mo,A as To,B as Go,R as Vo,X as Kt,C as No,E as Do,G as ko,J as Q,O as yt,K as fe,N as $t,P as Oo,Q as xt,S as _o,a as p,d as ct,U as Et,j as R,F as Fe,V as M,W as Xt,Y as Qt,Z as en,a0 as tn,a1 as jo,a2 as nn,a3 as Lo,a4 as Ho,a5 as we,e as dt,a6 as on,a7 as rn,a8 as Bo,a9 as an,aa as gt,ab as ln,ac as zo,ad as Wo,ae as Uo,h as ft,k as sn,af as Yo,ag as un,ah as Zo,ai as cn,aj as de,ak as X,al as pt,am as oe,an as qe,ao as N,ap as se,aq as Pe,u as It,ar as qo,as as Jo,at as Ko,au as ht,av as Xo,aw as Qo,ax as dn,ay as er,az as tr,aA as nr,f as or,L as rr,t as ar,aB as ir,l as lr}from"./index-3ae32782.js";const sr=s.forwardRef((e,t)=>{var n;const{container:o=globalThis==null||(n=globalThis.document)===null||n===void 0?void 0:n.body,...r}=e;return o?xo.createPortal(s.createElement(G.div,E({},r,{ref:t})),o):null});function ur({container:e,accept:t,walk:n,enabled:o=!0}){let r=s.useRef(t),a=s.useRef(n);s.useEffect(()=>{r.current=t,a.current=n},[t,n]),zt(()=>{if(!e||!o)return;let i=Wt(e);if(!i)return;let l=r.current,u=a.current,d=Object.assign(g=>l(g),{acceptNode:l}),c=i.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,d,!1);for(;c.nextNode();)u(c.currentNode)},[e,o,r,a])}var cr=(e=>(e[e.RegisterOption=0]="RegisterOption",e[e.UnregisterOption=1]="UnregisterOption",e))(cr||{});let dr={[0](e,t){let n=[...e.options,{id:t.id,element:t.element,propsRef:t.propsRef}];return{...e,options:_o(n,o=>o.element.current)}},[1](e,t){let n=e.options.slice(),o=e.options.findIndex(r=>r.id===t.id);return o===-1?e:(n.splice(o,1),{...e,options:n})}},mt=s.createContext(null);mt.displayName="RadioGroupDataContext";function gn(e){let t=s.useContext(mt);if(t===null){let n=new Error(`<${e} /> is missing a parent component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,gn),n}return t}let vt=s.createContext(null);vt.displayName="RadioGroupActionsContext";function fn(e){let t=s.useContext(vt);if(t===null){let n=new Error(`<${e} /> is missing a parent component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,fn),n}return t}function gr(e,t){return ko(t.type,dr,e,t)}let fr="div";function pr(e,t){let n=Yt(),{id:o=`headlessui-radiogroup-${n}`,value:r,defaultValue:a,form:i,name:l,onChange:u,by:d=(I,_)=>I===_,disabled:c=!1,...g}=e,h=K(typeof d=="string"?(I,_)=>{let D=d;return(I==null?void 0:I[D])===(_==null?void 0:_[D])}:d),[m,v]=s.useReducer(gr,{options:[]}),f=m.options,[A,C]=Zt(),[w,S]=qt(),b=s.useRef(null),x=Jt(b,t),[P,F]=Fo(r,u,a),T=s.useMemo(()=>f.find(I=>!I.propsRef.current.disabled),[f]),k=s.useMemo(()=>f.some(I=>h(I.propsRef.current.value,P)),[f,P]),O=K(I=>{var _;if(c||h(I,P))return!1;let D=(_=f.find(J=>h(J.propsRef.current.value,I)))==null?void 0:_.propsRef.current;return D!=null&&D.disabled?!1:(F==null||F(I),!0)});ur({container:b.current,accept(I){return I.getAttribute("role")==="radio"?NodeFilter.FILTER_REJECT:I.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT},walk(I){I.setAttribute("role","none")}});let re=K(I=>{let _=b.current;if(!_)return;let D=Wt(_),J=f.filter(V=>V.propsRef.current.disabled===!1).map(V=>V.element.current);switch(I.key){case Q.Enter:Oo(I.currentTarget);break;case Q.ArrowLeft:case Q.ArrowUp:if(I.preventDefault(),I.stopPropagation(),yt(J,fe.Previous|fe.WrapAround)===$t.Success){let V=f.find(ie=>ie.element.current===(D==null?void 0:D.activeElement));V&&O(V.propsRef.current.value)}break;case Q.ArrowRight:case Q.ArrowDown:if(I.preventDefault(),I.stopPropagation(),yt(J,fe.Next|fe.WrapAround)===$t.Success){let V=f.find(ie=>ie.element.current===(D==null?void 0:D.activeElement));V&&O(V.propsRef.current.value)}break;case Q.Space:{I.preventDefault(),I.stopPropagation();let V=f.find(ie=>ie.element.current===(D==null?void 0:D.activeElement));V&&O(V.propsRef.current.value)}break}}),B=K(I=>(v({type:0,...I}),()=>v({type:1,id:I.id}))),ae=s.useMemo(()=>({value:P,firstOption:T,containsCheckedOption:k,disabled:c,compare:h,...m}),[P,T,k,c,h,m]),Ve=s.useMemo(()=>({registerOption:B,change:O}),[B,O]),W={ref:x,id:o,role:"radiogroup","aria-labelledby":A,"aria-describedby":w,onKeyDown:re},yo=s.useMemo(()=>({value:P}),[P]),ge=s.useRef(null),$o=Po();return s.useEffect(()=>{ge.current&&a!==void 0&&$o.addEventListener(ge.current,"reset",()=>{O(a)})},[ge,O]),$.createElement(S,{name:"RadioGroup.Description"},$.createElement(C,{name:"RadioGroup.Label"},$.createElement(vt.Provider,{value:Ve},$.createElement(mt.Provider,{value:ae},l!=null&&P!=null&&Mo({[l]:P}).map(([I,_],D)=>$.createElement(To,{features:Go.Hidden,ref:D===0?J=>{var V;ge.current=(V=J==null?void 0:J.closest("form"))!=null?V:null}:void 0,...Vo({key:I,as:"input",type:"radio",checked:_!=null,hidden:!0,readOnly:!0,form:i,name:I,value:_})})),Kt({ourProps:W,theirProps:g,slot:yo,defaultTag:fr,name:"RadioGroup"})))))}var hr=(e=>(e[e.Empty=1]="Empty",e[e.Active=2]="Active",e))(hr||{});let mr="div";function vr(e,t){var n;let o=Yt(),{id:r=`headlessui-radiogroup-option-${o}`,value:a,disabled:i=!1,...l}=e,u=s.useRef(null),d=Jt(u,t),[c,g]=Zt(),[h,m]=qt(),{addFlag:v,removeFlag:f,hasFlag:A}=No(1),C=Do({value:a,disabled:i}),w=gn("RadioGroup.Option"),S=fn("RadioGroup.Option");zt(()=>S.registerOption({id:r,element:u,propsRef:C}),[r,S,u,e]);let b=K(B=>{var ae;if(xt(B.currentTarget))return B.preventDefault();S.change(a)&&(v(2),(ae=u.current)==null||ae.focus())}),x=K(B=>{if(xt(B.currentTarget))return B.preventDefault();v(2)}),P=K(()=>f(2)),F=((n=w.firstOption)==null?void 0:n.id)===r,T=w.disabled||i,k=w.compare(w.value,a),O={ref:d,id:r,role:"radio","aria-checked":k?"true":"false","aria-labelledby":c,"aria-describedby":h,"aria-disabled":T?!0:void 0,tabIndex:(()=>T?-1:k||!w.containsCheckedOption&&F?0:-1)(),onClick:T?void 0:b,onFocus:T?void 0:x,onBlur:T?void 0:P},re=s.useMemo(()=>({checked:k,disabled:T,active:A(2)}),[k,T,A]);return $.createElement(m,{name:"RadioGroup.Description"},$.createElement(g,{name:"RadioGroup.Label"},Kt({ourProps:O,theirProps:l,slot:re,defaultTag:mr,name:"RadioGroup.Option"})))}let Ar=Ut(pr),Cr=Ut(vr),Ee=Object.assign(Ar,{Option:Cr,Label:Eo,Description:Io});var br=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},ee=new WeakMap,pe=new WeakMap,he={},Ne=0,pn=function(e){return e&&(e.host||pn(e.parentNode))},wr=function(e,t){return t.map(function(n){if(e.contains(n))return n;var o=pn(n);return o&&e.contains(o)?o:null}).filter(function(n){return!!n})},Sr=function(e,t,n,o){var r=wr(t,Array.isArray(e)?e:[e]);he[n]||(he[n]=new WeakMap);var a=he[n],i=[],l=new Set,u=new Set(r),d=function(g){!g||l.has(g)||(l.add(g),d(g.parentNode))};r.forEach(d);var c=function(g){!g||u.has(g)||Array.prototype.forEach.call(g.children,function(h){if(l.has(h))c(h);else{var m=h.getAttribute(o),v=m!==null&&m!=="false",f=(ee.get(h)||0)+1,A=(a.get(h)||0)+1;ee.set(h,f),a.set(h,A),i.push(h),f===1&&v&&pe.set(h,!0),A===1&&h.setAttribute(n,"true"),v||h.setAttribute(o,"true")}})};return c(t),l.clear(),Ne++,function(){i.forEach(function(g){var h=ee.get(g)-1,m=a.get(g)-1;ee.set(g,h),a.set(g,m),h||(pe.has(g)||g.removeAttribute(o),pe.delete(g)),m||g.removeAttribute(n)}),Ne--,Ne||(ee=new WeakMap,ee=new WeakMap,pe=new WeakMap,he={})}},Rr=function(e,t,n){n===void 0&&(n="data-aria-hidden");var o=Array.from(Array.isArray(e)?e:[e]),r=t||br(e);return r?(o.push.apply(o,Array.from(r.querySelectorAll("[aria-live]"))),Sr(o,r,n,"aria-hidden")):function(){return null}};globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(e,t){return this.cache.has(e)?this.cache.get(e):(this.cache.set(e,t),t)}};function yr({tagList:e,currentTag:t,onChangeCurrentTag:n}){const o=s.useCallback(r=>{n(r)},[n]);return p(Ee,{value:t,onChange:o,children:p("div",{className:"flex items-center space-x-4",children:e.map(r=>p(Ee.Option,{value:r,className:({checked:a})=>`cursor-pointer whitespace-nowrap rounded-[3rem] px-4 py-2 ${a?"bg-indigo-400 text-white":"bg-white text-gray-600 dark:bg-gray-800 dark:text-gray-200"} ${!a&&"hover:bg-indigo-100 dark:hover:bg-gray-600"}`,children:p("p",{className:"font-normal ",children:r})},r))})})}globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(e,t){return this.cache.has(e)?this.cache.get(e):(this.cache.set(e,t),t)}};function $r(e,t,n){const[o,r]=s.useState(null);return s.useEffect(()=>{n&&!o&&(async()=>{const i=await xr(t,e);r(i)})()},[t,e,n]),o}async function xr(e,t){const n=await ct.chapterRecords.where({dict:e,chapter:t}).toArray(),o=n.length,r=n.reduce((u,{wordNumber:d,correctWordIndexes:c})=>u+(d-c.length),0),a=o>0?Et(r/o,2):0,i=n.reduce((u,{wrongCount:d})=>u+(d??0),0),l=o>0?Et(i/o,2):0;return{exerciseCount:o,avgWrongWordCount:a,avgWrongInputCount:l}}globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(e,t){return this.cache.has(e)?this.cache.get(e):(this.cache.set(e,t),t)}};function hn(e,{threshold:t=0,root:n=null,rootMargin:o="0%",freezeOnceVisible:r=!1}){const[a,i]=s.useState(),l=(a==null?void 0:a.isIntersecting)&&r,u=([d])=>{i(d)};return s.useEffect(()=>{const d=e==null?void 0:e.current;if(!!!window.IntersectionObserver||l||!d)return;const g={threshold:t,root:n,rootMargin:o},h=new IntersectionObserver(u,g);return h.observe(d),()=>h.disconnect()},[e==null?void 0:e.current,JSON.stringify(t),n,o,l]),a}const Er=e=>p("svg",{viewBox:"0 0 24 24",width:"1.2em",height:"1.2em",...e,children:p("path",{fill:"currentColor",fillRule:"evenodd",d:"M2.25 12c0-5.385 4.365-9.75 9.75-9.75s9.75 4.365 9.75 9.75s-4.365 9.75-9.75 9.75S2.25 17.385 2.25 12m13.36-1.814a.75.75 0 1 0-1.22-.872l-3.236 4.53L9.53 12.22a.75.75 0 0 0-1.06 1.06l2.25 2.25a.75.75 0 0 0 1.14-.094z",clipRule:"evenodd"})}),Ir=Er;globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(e,t){return this.cache.has(e)?this.cache.get(e):(this.cache.set(e,t),t)}};function Fr({index:e,checked:t,dictID:n,onChange:o}){const r=s.useRef(null),a=hn(r,{}),i=!!(a!=null&&a.isIntersecting),l=$r(e,n,i);return s.useEffect(()=>{var u,d;if(t&&r.current!==null){const c=r.current,g=(d=(u=c.parentElement)==null?void 0:u.parentElement)==null?void 0:d.parentElement;g==null||g.scroll({top:c.offsetTop-g.offsetTop-300,behavior:"smooth"})}},[t]),R("div",{ref:r,className:"relative flex h-16 w-40 cursor-pointer flex-col items-start justify-center overflow-hidden rounded-xl bg-slate-100 px-3 py-2 dark:bg-slate-800",onClick:()=>o(e),children:[R("h1",{children:["第 ",e+1," 章"]}),p("p",{className:"pt-[2px] text-xs text-slate-600",children:l?l.exerciseCount>0?`练习 ${l.exerciseCount} 次`:"未练习":"加载中..."}),t&&p(Ir,{className:"absolute -bottom-4 -right-4 h-18 w-18 text-6xl text-green-500 opacity-40 dark:text-green-300"})]})}function Pr(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function Mr(...e){return t=>e.forEach(n=>Pr(n,t))}var mn=s.forwardRef((e,t)=>{const{children:n,...o}=e,r=s.Children.toArray(n),a=r.find(Gr);if(a){const i=a.props.children,l=r.map(u=>u===a?s.Children.count(i)>1?s.Children.only(null):s.isValidElement(i)?i.props.children:null:u);return p(Je,{...o,ref:t,children:s.isValidElement(i)?s.cloneElement(i,void 0,l):null})}return p(Je,{...o,ref:t,children:n})});mn.displayName="Slot";var Je=s.forwardRef((e,t)=>{const{children:n,...o}=e;if(s.isValidElement(n)){const r=Nr(n);return s.cloneElement(n,{...Vr(o,n.props),ref:t?Mr(t,r):r})}return s.Children.count(n)>1?s.Children.only(null):null});Je.displayName="SlotClone";var Tr=({children:e})=>p(Fe,{children:e});function Gr(e){return s.isValidElement(e)&&e.type===Tr}function Vr(e,t){const n={...t};for(const o in t){const r=e[o],a=t[o];/^on[A-Z]/.test(o)?r&&a?n[o]=(...l)=>{a(...l),r(...l)}:r&&(n[o]=r):o==="style"?n[o]={...r,...a}:o==="className"&&(n[o]=[r,a].filter(Boolean).join(" "))}return{...e,...n}}function Nr(e){var o,r;let t=(o=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(r=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(e,t){return this.cache.has(e)?this.cache.get(e):(this.cache.set(e,t),t)}};const Dr=Xt("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-white transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-slate-950 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 dark:ring-offset-slate-950 dark:focus-visible:ring-slate-300",{variants:{variant:{default:"bg-indigo-500 shadow text-white hover:opacity-90 dark:text-opacity-80 focus:outline-none rounded-lg",destructive:"bg-red-500 text-slate-50 hover:bg-red-500/90 dark:bg-red-900 dark:text-slate-50 dark:hover:bg-red-900/90",outline:"border border-slate-200 bg-white hover:bg-slate-100 hover:text-slate-900 dark:border-slate-800 dark:bg-slate-950 dark:hover:bg-slate-800 dark:hover:text-slate-50",secondary:"bg-slate-100 text-slate-900 hover:bg-slate-100/80 dark:bg-slate-800 dark:text-slate-50 dark:hover:bg-slate-800/80",ghost:"hover:bg-slate-100 hover:text-slate-900 dark:hover:bg-slate-800 dark:hover:text-slate-50",link:"text-slate-900 underline-offset-4 hover:underline dark:text-slate-50"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),ue=s.forwardRef(({className:e,variant:t,size:n,asChild:o=!1,...r},a)=>p(o?mn:"button",{className:M(Dr({variant:t,size:n,className:e})),ref:a,...r}));ue.displayName="Button";const Ft=e=>p("svg",{viewBox:"0 0 256 256",width:"1.2em",height:"1.2em",...e,children:p("path",{fill:"currentColor",d:"M119.39 172.94a8 8 0 0 1-1.73 8.72l-32 32a8 8 0 0 1-11.32 0l-32-32A8 8 0 0 1 48 168h24V48a8 8 0 0 1 16 0v120h24a8 8 0 0 1 7.39 4.94m94.27-98.6l-32-32a8 8 0 0 0-11.32 0l-32 32A8 8 0 0 0 144 88h24v120a8 8 0 0 0 16 0V88h24a8 8 0 0 0 5.66-13.66"})});globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(e,t){return this.cache.has(e)?this.cache.get(e):(this.cache.set(e,t),t)}};const kr=e=>[{accessorKey:"word",size:100,header:({column:t})=>R(ue,{variant:"ghost",className:"p-0",onClick:()=>t.toggleSorting(t.getIsSorted()==="asc"),children:["单词",p(Ft,{className:"ml-1.5 h-4 w-4"})]})},{accessorKey:"trans",size:500,header:"释义"},{accessorKey:"errorCount",size:40,header:({column:t})=>R(ue,{variant:"ghost",className:"p-0",onClick:()=>t.toggleSorting(t.getIsSorted()==="asc"),children:["错误次数",p(Ft,{className:"ml-1.5 h-4 w-4"})]}),cell:({row:t})=>R("span",{className:"flex justify-center",children:[t.original.errorCount," "]})},{accessorKey:"errorChar",header:"易错字母",size:100,cell:({row:t})=>p("p",{children:t.getValue("errorChar").map((n,o)=>p("kbd",{className:"flex justify-center",children:n+" "},`${n}-${o}`))})},{accessorKey:"delete",header:"",size:40,cell:({row:t})=>p(Qt,{children:R(en,{children:[p(tn,{children:p(jo,{className:"cursor-pointer",onClick:()=>e(t.original.word)})}),p(nn,{children:p("p",{children:"Delete Records"})})]})})}];function Or(e){return e.map(t=>({word:t.word,trans:t.originData.trans.join(",")??"",errorCount:t.errorCount,errorChar:t.errorChar}))}globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(e,t){return this.cache.has(e)?this.cache.get(e):(this.cache.set(e,t),t)}};const vn=s.forwardRef(({className:e,...t},n)=>p("div",{className:"relative h-full w-full overflow-auto",children:p("table",{ref:n,className:M("w-full caption-bottom text-sm",e),...t})}));vn.displayName="Table";const An=s.forwardRef(({className:e,...t},n)=>p("thead",{ref:n,className:M("[&_tr]:border-b",e),...t}));An.displayName="TableHeader";const Cn=s.forwardRef(({className:e,...t},n)=>p("tbody",{ref:n,className:M("[&_tr:last-child]:border-0",e),...t}));Cn.displayName="TableBody";const _r=s.forwardRef(({className:e,...t},n)=>p("tfoot",{ref:n,className:M("border-t bg-slate-100/50 font-medium dark:bg-slate-800/50 [&>tr]:last:border-b-0",e),...t}));_r.displayName="TableFooter";const Se=s.forwardRef(({className:e,...t},n)=>p("tr",{ref:n,className:M("border-b transition-colors hover:bg-slate-100/50 data-[state=selected]:bg-slate-100 dark:hover:bg-slate-800/50 dark:data-[state=selected]:bg-slate-800",e),...t}));Se.displayName="TableRow";const bn=s.forwardRef(({className:e,...t},n)=>p("th",{ref:n,className:M("h-12 px-4 text-left align-middle font-medium text-slate-500 dark:text-slate-400 [&:has([role=checkbox])]:pr-0",e),...t}));bn.displayName="TableHead";const Ke=s.forwardRef(({className:e,...t},n)=>p("td",{ref:n,className:M("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));Ke.displayName="TableCell";const jr=s.forwardRef(({className:e,...t},n)=>p("caption",{ref:n,className:M("mt-4 text-sm text-slate-500 dark:text-slate-400",e),...t}));jr.displayName="TableCaption";/** * table-core * * Copyright (c) TanStack diff --git a/assets/index-9db00908.js b/assets/index-3ae32782.js similarity index 99% rename from assets/index-9db00908.js rename to assets/index-3ae32782.js index a5f14ffde8..24837eaba1 100644 --- a/assets/index-9db00908.js +++ b/assets/index-3ae32782.js @@ -108,7 +108,7 @@ From previous: `);return this._state!==null&&(this._stack=e),e}finally{N$=!1}}}, dark:!bg-gray-800 dark:text-gray-300 dark:shadow-lg dark:shadow-gray-700`,children:[I("div",{className:"flex gap-2",children:[y("img",{src:Aee,alt:"alipay",className:" h-44 rounded shadow-lg shadow-gray-300 dark:shadow-gray-700"}),y("img",{src:Tee,alt:"alipay",className:" h-44 rounded shadow-lg shadow-gray-300 dark:shadow-gray-700"})]}),I("span",{className:"mt-3 text-xs font-bold text-gray-500",children:[y(ite,{className:"mb-[3px] mr-1 inline-block"}),"此贴纸非商品,仅用于感谢您的捐赠,不可用于任何商业用途"]})]})]}),lte=""+new URL("redBook-code-376dffeb.jpg",import.meta.url).href;var cte=Object.defineProperty,ute=(e,t,r)=>t in e?cte(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,eb=(e,t,r)=>(ute(e,typeof t!="symbol"?t+"":t,r),r);let dte=class{constructor(){eb(this,"current",this.detect()),eb(this,"handoffState","pending"),eb(this,"currentId",0)}set(t){this.current!==t&&(this.handoffState="pending",this.currentId=0,this.current=t)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return this.current==="server"}get isClient(){return this.current==="client"}detect(){return typeof window>"u"||typeof document>"u"?"server":"client"}handoff(){this.handoffState==="pending"&&(this.handoffState="complete")}get isHandoffComplete(){return this.handoffState==="complete"}},lo=new dte,gt=(e,t)=>{lo.isServer?p.useEffect(e,t):p.useLayoutEffect(e,t)};function dr(e){let t=p.useRef(e);return gt(()=>{t.current=e},[e]),t}function LD(e,t){let[r,n]=p.useState(e),a=dr(e);return gt(()=>n(a.current),[a,n,...t]),r}function Ru(e){typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e).catch(t=>setTimeout(()=>{throw t}))}function _o(){let e=[],t={addEventListener(r,n,a,o){return r.addEventListener(n,a,o),t.add(()=>r.removeEventListener(n,a,o))},requestAnimationFrame(...r){let n=requestAnimationFrame(...r);return t.add(()=>cancelAnimationFrame(n))},nextFrame(...r){return t.requestAnimationFrame(()=>t.requestAnimationFrame(...r))},setTimeout(...r){let n=setTimeout(...r);return t.add(()=>clearTimeout(n))},microTask(...r){let n={current:!0};return Ru(()=>{n.current&&r[0]()}),t.add(()=>{n.current=!1})},style(r,n,a){let o=r.style.getPropertyValue(n);return Object.assign(r.style,{[n]:a}),this.add(()=>{Object.assign(r.style,{[n]:o})})},group(r){let n=_o();return r(n),this.add(()=>n.dispose())},add(r){return e.push(r),()=>{let n=e.indexOf(r);if(n>=0)for(let a of e.splice(n,1))a()}},dispose(){for(let r of e.splice(0))r()}};return t}function Vi(){let[e]=p.useState(_o);return p.useEffect(()=>()=>e.dispose(),[e]),e}let re=function(e){let t=dr(e);return Y.useCallback((...r)=>t.current(...r),[t])};function Ou(){let[e,t]=p.useState(lo.isHandoffComplete);return e&&lo.isHandoffComplete===!1&&t(!1),p.useEffect(()=>{e!==!0&&t(!0)},[e]),p.useEffect(()=>lo.handoff(),[]),e}var nA;let Pt=(nA=Y.useId)!=null?nA:function(){let e=Ou(),[t,r]=Y.useState(e?()=>lo.nextId():null);return gt(()=>{t===null&&r(lo.nextId())},[t]),t!=null?""+t:void 0};function Re(e,t,...r){if(e in t){let a=t[e];return typeof a=="function"?a(...r):a}let n=new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map(a=>`"${a}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,Re),n}function Rh(e){return lo.isServer?null:e instanceof Node?e.ownerDocument:e!=null&&e.hasOwnProperty("current")&&e.current instanceof Node?e.current.ownerDocument:document}let d2=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map(e=>`${e}:not([tabindex='-1'])`).join(",");var et=(e=>(e[e.First=1]="First",e[e.Previous=2]="Previous",e[e.Next=4]="Next",e[e.Last=8]="Last",e[e.WrapAround=16]="WrapAround",e[e.NoScroll=32]="NoScroll",e))(et||{}),to=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))(to||{}),fte=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(fte||{});function V0(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(d2)).sort((t,r)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(r.tabIndex||Number.MAX_SAFE_INTEGER)))}var W0=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(W0||{});function JE(e,t=0){var r;return e===((r=Rh(e))==null?void 0:r.body)?!1:Re(t,{[0](){return e.matches(d2)},[1](){let n=e;for(;n!==null;){if(n.matches(d2))return!0;n=n.parentElement}return!1}})}var hte=(e=>(e[e.Keyboard=0]="Keyboard",e[e.Mouse=1]="Mouse",e))(hte||{});typeof window<"u"&&typeof document<"u"&&(document.addEventListener("keydown",e=>{e.metaKey||e.altKey||e.ctrlKey||(document.documentElement.dataset.headlessuiFocusVisible="")},!0),document.addEventListener("click",e=>{e.detail===1?delete document.documentElement.dataset.headlessuiFocusVisible:e.detail===0&&(document.documentElement.dataset.headlessuiFocusVisible="")},!0));function Ws(e){e==null||e.focus({preventScroll:!0})}let pte=["textarea","input"].join(",");function gte(e){var t,r;return(r=(t=e==null?void 0:e.matches)==null?void 0:t.call(e,pte))!=null?r:!1}function Ns(e,t=r=>r){return e.slice().sort((r,n)=>{let a=t(r),o=t(n);if(a===null||o===null)return 0;let i=a.compareDocumentPosition(o);return i&Node.DOCUMENT_POSITION_FOLLOWING?-1:i&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function qt(e,t,{sorted:r=!0,relativeTo:n=null,skipElements:a=[]}={}){let o=Array.isArray(e)?e.length>0?e[0].ownerDocument:document:e.ownerDocument,i=Array.isArray(e)?r?Ns(e):e:V0(e);a.length>0&&i.length>1&&(i=i.filter(h=>!a.includes(h))),n=n??o.activeElement;let s=(()=>{if(t&5)return 1;if(t&10)return-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),l=(()=>{if(t&1)return 0;if(t&2)return Math.max(0,i.indexOf(n))-1;if(t&4)return Math.max(0,i.indexOf(n))+1;if(t&8)return i.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),u=t&32?{preventScroll:!0}:{},f=0,c=i.length,d;do{if(f>=c||f+c<=0)return 0;let h=l+f;if(t&16)h=(h+c)%c;else{if(h<0)return 3;if(h>=c)return 1}d=i[h],d==null||d.focus(u),f+=s}while(d!==o.activeElement);return t&6&>e(d)&&d.select(),2}function tb(e,t,r){let n=dr(t);p.useEffect(()=>{function a(o){n.current(o)}return document.addEventListener(e,a,r),()=>document.removeEventListener(e,a,r)},[e,r])}function eC(e,t,r=!0){let n=p.useRef(!1);p.useEffect(()=>{requestAnimationFrame(()=>{n.current=r})},[r]);function a(i,s){if(!n.current||i.defaultPrevented)return;let l=function f(c){return typeof c=="function"?f(c()):Array.isArray(c)||c instanceof Set?c:[c]}(e),u=s(i);if(u!==null&&u.getRootNode().contains(u)){for(let f of l){if(f===null)continue;let c=f instanceof HTMLElement?f:f.current;if(c!=null&&c.contains(u)||i.composed&&i.composedPath().includes(c))return}return!JE(u,W0.Loose)&&u.tabIndex!==-1&&i.preventDefault(),t(i,u)}}let o=p.useRef(null);tb("mousedown",i=>{var s,l;n.current&&(o.current=((l=(s=i.composedPath)==null?void 0:s.call(i))==null?void 0:l[0])||i.target)},!0),tb("click",i=>{o.current&&(a(i,()=>o.current),o.current=null)},!0),tb("blur",i=>a(i,()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null),!0)}function aA(e){var t;if(e.type)return e.type;let r=(t=e.as)!=null?t:"button";if(typeof r=="string"&&r.toLowerCase()==="button")return"button"}function H0(e,t){let[r,n]=p.useState(()=>aA(e));return gt(()=>{n(aA(e))},[e.type,e.as]),gt(()=>{r||t.current&&t.current instanceof HTMLButtonElement&&!t.current.hasAttribute("type")&&n("button")},[r,t]),r}let MD=Symbol();function DD(e,t=!0){return Object.assign(e,{[MD]:t})}function We(...e){let t=p.useRef(e);p.useEffect(()=>{t.current=e},[e]);let r=re(n=>{for(let a of t.current)a!=null&&(typeof a=="function"?a(n):a.current=n)});return e.every(n=>n==null||(n==null?void 0:n[MD]))?void 0:r}function vte(e){throw new Error("Unexpected object: "+e)}var Pr=(e=>(e[e.First=0]="First",e[e.Previous=1]="Previous",e[e.Next=2]="Next",e[e.Last=3]="Last",e[e.Specific=4]="Specific",e[e.Nothing=5]="Nothing",e))(Pr||{});function mte(e,t){let r=t.resolveItems();if(r.length<=0)return null;let n=t.resolveActiveIndex(),a=n??-1,o=(()=>{switch(e.focus){case 0:return r.findIndex(i=>!t.resolveDisabled(i));case 1:{let i=r.slice().reverse().findIndex((s,l,u)=>a!==-1&&u.length-l-1>=a?!1:!t.resolveDisabled(s));return i===-1?i:r.length-1-i}case 2:return r.findIndex((i,s)=>s<=a?!1:!t.resolveDisabled(i));case 3:{let i=r.slice().reverse().findIndex(s=>!t.resolveDisabled(s));return i===-1?i:r.length-1-i}case 4:return r.findIndex(i=>t.resolveId(i)===e.id);case 5:return null;default:vte(e)}})();return o===-1?n:o}function f2(...e){return e.filter(Boolean).join(" ")}var Pn=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))(Pn||{}),ro=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(ro||{});function Fe({ourProps:e,theirProps:t,slot:r,defaultTag:n,features:a,visible:o=!0,name:i}){let s=jD(t,e);if(o)return Xp(s,r,n,i);let l=a??0;if(l&2){let{static:u=!1,...f}=s;if(u)return Xp(f,r,n,i)}if(l&1){let{unmount:u=!0,...f}=s;return Re(u?0:1,{[0](){return null},[1](){return Xp({...f,hidden:!0,style:{display:"none"}},r,n,i)}})}return Xp(s,r,n,i)}function Xp(e,t={},r,n){let{as:a=r,children:o,refName:i="ref",...s}=rb(e,["unmount","static"]),l=e.ref!==void 0?{[i]:e.ref}:{},u=typeof o=="function"?o(t):o;"className"in s&&s.className&&typeof s.className=="function"&&(s.className=s.className(t));let f={};if(t){let c=!1,d=[];for(let[h,g]of Object.entries(t))typeof g=="boolean"&&(c=!0),g===!0&&d.push(h);c&&(f["data-headlessui-state"]=d.join(" "))}if(a===p.Fragment&&Object.keys(Sm(s)).length>0){if(!p.isValidElement(u)||Array.isArray(u)&&u.length>1)throw new Error(['Passing props on "Fragment"!',"",`The current component <${n} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(s).map(g=>` - ${g}`).join(` `),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".',"Render a single element as the child so that we can forward the props onto that element."].map(g=>` - ${g}`).join(` `)].join(` -`));let c=u.props,d=typeof(c==null?void 0:c.className)=="function"?(...g)=>f2(c==null?void 0:c.className(...g),s.className):f2(c==null?void 0:c.className,s.className),h=d?{className:d}:{};return p.cloneElement(u,Object.assign({},jD(u.props,Sm(rb(s,["ref"]))),f,l,yte(u.ref,l.ref),h))}return p.createElement(a,Object.assign({},rb(s,["ref"]),a!==p.Fragment&&l,a!==p.Fragment&&f),u)}function yte(...e){return{ref:e.every(t=>t==null)?void 0:t=>{for(let r of e)r!=null&&(typeof r=="function"?r(t):r.current=t)}}}function jD(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={},r={};for(let n of e)for(let a in n)a.startsWith("on")&&typeof n[a]=="function"?(r[a]!=null||(r[a]=[]),r[a].push(n[a])):t[a]=n[a];if(t.disabled||t["aria-disabled"])return Object.assign(t,Object.fromEntries(Object.keys(r).map(n=>[n,void 0])));for(let n in r)Object.assign(t,{[n](a,...o){let i=r[n];for(let s of i){if((a instanceof Event||(a==null?void 0:a.nativeEvent)instanceof Event)&&a.defaultPrevented)return;s(a,...o)}}});return t}function Be(e){var t;return Object.assign(p.forwardRef(e),{displayName:(t=e.displayName)!=null?t:e.name})}function Sm(e){let t=Object.assign({},e);for(let r in t)t[r]===void 0&&delete t[r];return t}function rb(e,t=[]){let r=Object.assign({},e);for(let n of t)n in r&&delete r[n];return r}function Oh(e){let t=e.parentElement,r=null;for(;t&&!(t instanceof HTMLFieldSetElement);)t instanceof HTMLLegendElement&&(r=t),t=t.parentElement;let n=(t==null?void 0:t.getAttribute("disabled"))==="";return n&&bte(r)?!1:n}function bte(e){if(!e)return!1;let t=e.previousElementSibling;for(;t!==null;){if(t instanceof HTMLLegendElement)return!1;t=t.previousElementSibling}return!0}function FD(e={},t=null,r=[]){for(let[n,a]of Object.entries(e))UD(r,BD(t,n),a);return r}function BD(e,t){return e?e+"["+t+"]":t}function UD(e,t,r){if(Array.isArray(r))for(let[n,a]of r.entries())UD(e,BD(t,n.toString()),a);else r instanceof Date?e.push([t,r.toISOString()]):typeof r=="boolean"?e.push([t,r?"1":"0"]):typeof r=="string"?e.push([t,r]):typeof r=="number"?e.push([t,`${r}`]):r==null?e.push([t,""]):FD(r,t,e)}function wte(e){var t;let r=(t=e==null?void 0:e.form)!=null?t:e.closest("form");if(r){for(let n of r.elements)if(n.tagName==="INPUT"&&n.type==="submit"||n.tagName==="BUTTON"&&n.type==="submit"||n.nodeName==="INPUT"&&n.type==="image"){n.click();return}}}let _te="div";var Ca=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(Ca||{});function $te(e,t){let{features:r=1,...n}=e,a={ref:t,"aria-hidden":(r&2)===2?!0:void 0,style:{position:"fixed",top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",...(r&4)===4&&(r&2)!==2&&{display:"none"}}};return Fe({ourProps:a,theirProps:n,slot:{},defaultTag:_te,name:"Hidden"})}let Ta=Be($te),tC=p.createContext(null);tC.displayName="OpenClosedContext";var ut=(e=>(e[e.Open=1]="Open",e[e.Closed=2]="Closed",e[e.Closing=4]="Closing",e[e.Opening=8]="Opening",e))(ut||{});function ku(){return p.useContext(tC)}function rC({value:e,children:t}){return Y.createElement(tC.Provider,{value:e},t)}var ye=(e=>(e.Space=" ",e.Enter="Enter",e.Escape="Escape",e.Backspace="Backspace",e.Delete="Delete",e.ArrowLeft="ArrowLeft",e.ArrowUp="ArrowUp",e.ArrowRight="ArrowRight",e.ArrowDown="ArrowDown",e.Home="Home",e.End="End",e.PageUp="PageUp",e.PageDown="PageDown",e.Tab="Tab",e))(ye||{});function zD(e,t,r){let[n,a]=p.useState(r),o=e!==void 0,i=p.useRef(o),s=p.useRef(!1),l=p.useRef(!1);return o&&!i.current&&!s.current?(s.current=!0,i.current=o):!o&&i.current&&!l.current&&(l.current=!0,i.current=o),[o?e:n,re(u=>(o||a(u),t==null?void 0:t(u)))]}function nC(e,t){let r=p.useRef([]),n=re(e);p.useEffect(()=>{let a=[...r.current];for(let[o,i]of t.entries())if(r.current[o]!==i){let s=n(t,a);return r.current=t,s}},[n,...t])}function oA(e){return[e.screenX,e.screenY]}function xte(){let e=p.useRef([-1,-1]);return{wasMoved(t){let r=oA(t);return e.current[0]===r[0]&&e.current[1]===r[1]?!1:(e.current=r,!0)},update(t){e.current=oA(t)}}}function Ste(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function Ete(e,t,r){let n=dr(t);p.useEffect(()=>{function a(o){n.current(o)}return window.addEventListener(e,a,r),()=>window.removeEventListener(e,a,r)},[e,r])}var Xr=(e=>(e[e.Forwards=0]="Forwards",e[e.Backwards=1]="Backwards",e))(Xr||{});function aC(){let e=p.useRef(0);return Ete("keydown",t=>{t.key==="Tab"&&(e.current=t.shiftKey?1:0)},!0),e}function kh(){let e=p.useRef(!1);return gt(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function vl(...e){return p.useMemo(()=>Rh(...e),[...e])}function oC(e,t,r,n){let a=dr(r);p.useEffect(()=>{e=e??window;function o(i){a.current(i)}return e.addEventListener(t,o,n),()=>e.removeEventListener(t,o,n)},[e,t,n])}function Cte(e){function t(){document.readyState!=="loading"&&(e(),document.removeEventListener("DOMContentLoaded",t))}typeof window<"u"&&typeof document<"u"&&(document.addEventListener("DOMContentLoaded",t),t())}function VD(e){if(!e)return new Set;if(typeof e=="function")return new Set(e());let t=new Set;for(let r of e.current)r.current instanceof HTMLElement&&t.add(r.current);return t}let Tte="div";var WD=(e=>(e[e.None=1]="None",e[e.InitialFocus=2]="InitialFocus",e[e.TabLock=4]="TabLock",e[e.FocusLock=8]="FocusLock",e[e.RestoreFocus=16]="RestoreFocus",e[e.All=30]="All",e))(WD||{});function Ate(e,t){let r=p.useRef(null),n=We(r,t),{initialFocus:a,containers:o,features:i=30,...s}=e;Ou()||(i=1);let l=vl(r);kte({ownerDocument:l},!!(i&16));let u=Pte({ownerDocument:l,container:r,initialFocus:a},!!(i&2));Ite({ownerDocument:l,container:r,containers:o,previousActiveElement:u},!!(i&8));let f=aC(),c=re(m=>{let w=r.current;w&&(v=>v())(()=>{Re(f.current,{[Xr.Forwards]:()=>{qt(w,et.First,{skipElements:[m.relatedTarget]})},[Xr.Backwards]:()=>{qt(w,et.Last,{skipElements:[m.relatedTarget]})}})})}),d=Vi(),h=p.useRef(!1),g={ref:n,onKeyDown(m){m.key=="Tab"&&(h.current=!0,d.requestAnimationFrame(()=>{h.current=!1}))},onBlur(m){let w=VD(o);r.current instanceof HTMLElement&&w.add(r.current);let v=m.relatedTarget;v instanceof HTMLElement&&v.dataset.headlessuiFocusGuard!=="true"&&(HD(w,v)||(h.current?qt(r.current,Re(f.current,{[Xr.Forwards]:()=>et.Next,[Xr.Backwards]:()=>et.Previous})|et.WrapAround,{relativeTo:m.target}):m.target instanceof HTMLElement&&Ws(m.target)))}};return Y.createElement(Y.Fragment,null,!!(i&4)&&Y.createElement(Ta,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:c,features:Ca.Focusable}),Fe({ourProps:g,theirProps:s,defaultTag:Tte,name:"FocusTrap"}),!!(i&4)&&Y.createElement(Ta,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:c,features:Ca.Focusable}))}let Rte=Be(Ate),cd=Object.assign(Rte,{features:WD}),oi=[];Cte(()=>{function e(t){t.target instanceof HTMLElement&&t.target!==document.body&&oi[0]!==t.target&&(oi.unshift(t.target),oi=oi.filter(r=>r!=null&&r.isConnected),oi.splice(10))}window.addEventListener("click",e,{capture:!0}),window.addEventListener("mousedown",e,{capture:!0}),window.addEventListener("focus",e,{capture:!0}),document.body.addEventListener("click",e,{capture:!0}),document.body.addEventListener("mousedown",e,{capture:!0}),document.body.addEventListener("focus",e,{capture:!0})});function Ote(e=!0){let t=p.useRef(oi.slice());return nC(([r],[n])=>{n===!0&&r===!1&&Ru(()=>{t.current.splice(0)}),n===!1&&r===!0&&(t.current=oi.slice())},[e,oi,t]),re(()=>{var r;return(r=t.current.find(n=>n!=null&&n.isConnected))!=null?r:null})}function kte({ownerDocument:e},t){let r=Ote(t);nC(()=>{t||(e==null?void 0:e.activeElement)===(e==null?void 0:e.body)&&Ws(r())},[t]);let n=p.useRef(!1);p.useEffect(()=>(n.current=!1,()=>{n.current=!0,Ru(()=>{n.current&&Ws(r())})}),[])}function Pte({ownerDocument:e,container:t,initialFocus:r},n){let a=p.useRef(null),o=kh();return nC(()=>{if(!n)return;let i=t.current;i&&Ru(()=>{if(!o.current)return;let s=e==null?void 0:e.activeElement;if(r!=null&&r.current){if((r==null?void 0:r.current)===s){a.current=s;return}}else if(i.contains(s)){a.current=s;return}r!=null&&r.current?Ws(r.current):(qt(i,et.First),to.Error),a.current=e==null?void 0:e.activeElement})},[n]),a}function Ite({ownerDocument:e,container:t,containers:r,previousActiveElement:n},a){let o=kh();oC(e==null?void 0:e.defaultView,"focus",i=>{if(!a||!o.current)return;let s=VD(r);t.current instanceof HTMLElement&&s.add(t.current);let l=n.current;if(!l)return;let u=i.target;u&&u instanceof HTMLElement?HD(s,u)?(n.current=u,Ws(u)):(i.preventDefault(),i.stopPropagation(),Ws(l)):Ws(n.current)},!0)}function HD(e,t){for(let r of e)if(r.contains(t))return!0;return!1}let GD=p.createContext(!1);function Nte(){return p.useContext(GD)}function h2(e){return Y.createElement(GD.Provider,{value:e.force},e.children)}function Lte(e){let t=Nte(),r=p.useContext(KD),n=vl(e),[a,o]=p.useState(()=>{if(!t&&r!==null||lo.isServer)return null;let i=n==null?void 0:n.getElementById("headlessui-portal-root");if(i)return i;if(n===null)return null;let s=n.createElement("div");return s.setAttribute("id","headlessui-portal-root"),n.body.appendChild(s)});return p.useEffect(()=>{a!==null&&(n!=null&&n.body.contains(a)||n==null||n.body.appendChild(a))},[a,n]),p.useEffect(()=>{t||r!==null&&o(r.current)},[r,o,t]),a}let Mte=p.Fragment;function Dte(e,t){let r=e,n=p.useRef(null),a=We(DD(f=>{n.current=f}),t),o=vl(n),i=Lte(n),[s]=p.useState(()=>{var f;return lo.isServer?null:(f=o==null?void 0:o.createElement("div"))!=null?f:null}),l=Ou(),u=p.useRef(!1);return gt(()=>{if(u.current=!1,!(!i||!s))return i.contains(s)||(s.setAttribute("data-headlessui-portal",""),i.appendChild(s)),()=>{u.current=!0,Ru(()=>{var f;u.current&&(!i||!s||(s instanceof Node&&i.contains(s)&&i.removeChild(s),i.childNodes.length<=0&&((f=i.parentElement)==null||f.removeChild(i))))})}},[i,s]),l?!i||!s?null:Xi.createPortal(Fe({ourProps:{ref:a},theirProps:r,defaultTag:Mte,name:"Portal"}),s):null}let jte=p.Fragment,KD=p.createContext(null);function Fte(e,t){let{target:r,...n}=e,a={ref:We(t)};return Y.createElement(KD.Provider,{value:r},Fe({ourProps:a,theirProps:n,defaultTag:jte,name:"Popover.Group"}))}let Bte=Be(Dte),Ute=Be(Fte),p2=Object.assign(Bte,{Group:Ute}),qD=p.createContext(null);function YD(){let e=p.useContext(qD);if(e===null){let t=new Error("You used a component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(t,YD),t}return e}function XD(){let[e,t]=p.useState([]);return[e.length>0?e.join(" "):void 0,p.useMemo(()=>function(r){let n=re(o=>(t(i=>[...i,o]),()=>t(i=>{let s=i.slice(),l=s.indexOf(o);return l!==-1&&s.splice(l,1),s}))),a=p.useMemo(()=>({register:n,slot:r.slot,name:r.name,props:r.props}),[n,r.slot,r.name,r.props]);return Y.createElement(qD.Provider,{value:a},r.children)},[t])]}let zte="p";function Vte(e,t){let r=Pt(),{id:n=`headlessui-description-${r}`,...a}=e,o=YD(),i=We(t);gt(()=>o.register(n),[n,o.register]);let s={ref:i,...o.props,id:n};return Fe({ourProps:s,theirProps:a,slot:o.slot||{},defaultTag:zte,name:o.name||"Description"})}let Wte=Be(Vte),ZD=Object.assign(Wte,{}),iC=p.createContext(()=>{});iC.displayName="StackContext";var g2=(e=>(e[e.Add=0]="Add",e[e.Remove=1]="Remove",e))(g2||{});function Hte(){return p.useContext(iC)}function Gte({children:e,onUpdate:t,type:r,element:n,enabled:a}){let o=Hte(),i=re((...s)=>{t==null||t(...s),o(...s)});return gt(()=>{let s=a===void 0||a===!0;return s&&i(0,r,n),()=>{s&&i(1,r,n)}},[i,r,n,a]),Y.createElement(iC.Provider,{value:i},e)}function Kte(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}const qte=typeof Object.is=="function"?Object.is:Kte,{useState:Yte,useEffect:Xte,useLayoutEffect:Zte,useDebugValue:Qte}=qs;function Jte(e,t,r){const n=t(),[{inst:a},o]=Yte({inst:{value:n,getSnapshot:t}});return Zte(()=>{a.value=n,a.getSnapshot=t,nb(a)&&o({inst:a})},[e,n,t]),Xte(()=>(nb(a)&&o({inst:a}),e(()=>{nb(a)&&o({inst:a})})),[e]),Qte(n),n}function nb(e){const t=e.getSnapshot,r=e.value;try{const n=t();return!qte(r,n)}catch{return!0}}function ere(e,t,r){return t()}const tre=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",rre=!tre,nre=rre?ere:Jte,are="useSyncExternalStore"in qs?(e=>e.useSyncExternalStore)(qs):nre;function ore(e){return are(e.subscribe,e.getSnapshot,e.getSnapshot)}function ire(e,t){let r=e(),n=new Set;return{getSnapshot(){return r},subscribe(a){return n.add(a),()=>n.delete(a)},dispatch(a,...o){let i=t[a].call(r,...o);i&&(r=i,n.forEach(s=>s()))}}}function sre(){let e;return{before({doc:t}){var r;let n=t.documentElement;e=((r=t.defaultView)!=null?r:window).innerWidth-n.clientWidth},after({doc:t,d:r}){let n=t.documentElement,a=n.clientWidth-n.offsetWidth,o=e-a;r.style(n,"paddingRight",`${o}px`)}}}function lre(){if(!Ste())return{};let e;return{before(){e=window.pageYOffset},after({doc:t,d:r,meta:n}){function a(i){return n.containers.flatMap(s=>s()).some(s=>s.contains(i))}r.style(t.body,"marginTop",`-${e}px`),window.scrollTo(0,0);let o=null;r.addEventListener(t,"click",i=>{if(i.target instanceof HTMLElement)try{let s=i.target.closest("a");if(!s)return;let{hash:l}=new URL(s.href),u=t.querySelector(l);u&&!a(u)&&(o=u)}catch{}},!0),r.addEventListener(t,"touchmove",i=>{i.target instanceof HTMLElement&&!a(i.target)&&i.preventDefault()},{passive:!1}),r.add(()=>{window.scrollTo(0,window.pageYOffset+e),o&&o.isConnected&&(o.scrollIntoView({block:"nearest"}),o=null)})}}}function cre(){return{before({doc:e,d:t}){t.style(e.documentElement,"overflow","hidden")}}}function ure(e){let t={};for(let r of e)Object.assign(t,r(t));return t}let Ls=ire(()=>new Map,{PUSH(e,t){var r;let n=(r=this.get(e))!=null?r:{doc:e,count:0,d:_o(),meta:new Set};return n.count++,n.meta.add(t),this.set(e,n),this},POP(e,t){let r=this.get(e);return r&&(r.count--,r.meta.delete(t)),this},SCROLL_PREVENT({doc:e,d:t,meta:r}){let n={doc:e,d:t,meta:ure(r)},a=[lre(),sre(),cre()];a.forEach(({before:o})=>o==null?void 0:o(n)),a.forEach(({after:o})=>o==null?void 0:o(n))},SCROLL_ALLOW({d:e}){e.dispose()},TEARDOWN({doc:e}){this.delete(e)}});Ls.subscribe(()=>{let e=Ls.getSnapshot(),t=new Map;for(let[r]of e)t.set(r,r.documentElement.style.overflow);for(let r of e.values()){let n=t.get(r.doc)==="hidden",a=r.count!==0;(a&&!n||!a&&n)&&Ls.dispatch(r.count>0?"SCROLL_PREVENT":"SCROLL_ALLOW",r),r.count===0&&Ls.dispatch("TEARDOWN",r)}});function dre(e,t,r){let n=ore(Ls),a=e?n.get(e):void 0,o=a?a.count>0:!1;return gt(()=>{if(!(!e||!t))return Ls.dispatch("PUSH",e,r),()=>Ls.dispatch("POP",e,r)},[t,e]),o}let ab=new Map,ud=new Map;function iA(e,t=!0){gt(()=>{var r;if(!t)return;let n=typeof e=="function"?e():e.current;if(!n)return;function a(){var i;if(!n)return;let s=(i=ud.get(n))!=null?i:1;if(s===1?ud.delete(n):ud.set(n,s-1),s!==1)return;let l=ab.get(n);l&&(l["aria-hidden"]===null?n.removeAttribute("aria-hidden"):n.setAttribute("aria-hidden",l["aria-hidden"]),n.inert=l.inert,ab.delete(n))}let o=(r=ud.get(n))!=null?r:0;return ud.set(n,o+1),o!==0||(ab.set(n,{"aria-hidden":n.getAttribute("aria-hidden"),inert:n.inert}),n.setAttribute("aria-hidden","true"),n.inert=!0),a},[e,t])}var fre=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(fre||{}),hre=(e=>(e[e.SetTitleId=0]="SetTitleId",e))(hre||{});let pre={[0](e,t){return e.titleId===t.id?e:{...e,titleId:t.id}}},Em=p.createContext(null);Em.displayName="DialogContext";function Ph(e){let t=p.useContext(Em);if(t===null){let r=new Error(`<${e} /> is missing a parent component.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,Ph),r}return t}function gre(e,t,r=()=>[document.body]){dre(e,t,n=>{var a;return{containers:[...(a=n.containers)!=null?a:[],r]}})}function vre(e,t){return Re(t.type,pre,e,t)}let mre="div",yre=Pn.RenderStrategy|Pn.Static;function bre(e,t){let r=Pt(),{id:n=`headlessui-dialog-${r}`,open:a,onClose:o,initialFocus:i,__demoMode:s=!1,...l}=e,[u,f]=p.useState(0),c=ku();a===void 0&&c!==null&&(a=(c&ut.Open)===ut.Open);let d=p.useRef(null),h=We(d,t),g=p.useRef(null),m=vl(d),w=e.hasOwnProperty("open")||c!==null,v=e.hasOwnProperty("onClose");if(!w&&!v)throw new Error("You have to provide an `open` and an `onClose` prop to the `Dialog` component.");if(!w)throw new Error("You provided an `onClose` prop to the `Dialog`, but forgot an `open` prop.");if(!v)throw new Error("You provided an `open` prop to the `Dialog`, but forgot an `onClose` prop.");if(typeof a!="boolean")throw new Error(`You provided an \`open\` prop to the \`Dialog\`, but the value is not a boolean. Received: ${a}`);if(typeof o!="function")throw new Error(`You provided an \`onClose\` prop to the \`Dialog\`, but the value is not a function. Received: ${o}`);let b=a?0:1,[_,$]=p.useReducer(vre,{titleId:null,descriptionId:null,panelRef:p.createRef()}),C=re(()=>o(!1)),O=re(K=>$({type:0,id:K})),x=Ou()?s?!1:b===0:!1,S=u>1,A=p.useContext(Em)!==null,k=S?"parent":"leaf",L=c!==null?(c&ut.Closing)===ut.Closing:!1,P=(()=>A||L?!1:x)(),N=p.useCallback(()=>{var K,Q;return(Q=Array.from((K=m==null?void 0:m.querySelectorAll("body > *"))!=null?K:[]).find(J=>J.id==="headlessui-portal-root"?!1:J.contains(g.current)&&J instanceof HTMLElement))!=null?Q:null},[g]);iA(N,P);let E=(()=>S?!0:x)(),R=p.useCallback(()=>{var K,Q;return(Q=Array.from((K=m==null?void 0:m.querySelectorAll("[data-headlessui-portal]"))!=null?K:[]).find(J=>J.contains(g.current)&&J instanceof HTMLElement))!=null?Q:null},[g]);iA(R,E);let F=re(()=>{var K,Q;return[...Array.from((K=m==null?void 0:m.querySelectorAll("html > *, body > *, [data-headlessui-portal]"))!=null?K:[]).filter(J=>!(J===document.body||J===document.head||!(J instanceof HTMLElement)||J.contains(g.current)||_.panelRef.current&&J.contains(_.panelRef.current))),(Q=_.panelRef.current)!=null?Q:d.current]}),B=(()=>!(!x||S))();eC(()=>F(),C,B);let j=(()=>!(S||b!==0))();oC(m==null?void 0:m.defaultView,"keydown",K=>{j&&(K.defaultPrevented||K.key===ye.Escape&&(K.preventDefault(),K.stopPropagation(),C()))});let M=(()=>!(L||b!==0||A))();gre(m,M,F),p.useEffect(()=>{if(b!==0||!d.current)return;let K=new ResizeObserver(Q=>{for(let J of Q){let de=J.target.getBoundingClientRect();de.x===0&&de.y===0&&de.width===0&&de.height===0&&C()}});return K.observe(d.current),()=>K.disconnect()},[b,d,C]);let[D,U]=XD(),V=p.useMemo(()=>[{dialogState:b,close:C,setTitleId:O},_],[b,_,C,O]),G=p.useMemo(()=>({open:b===0}),[b]),H={ref:h,id:n,role:"dialog","aria-modal":b===0?!0:void 0,"aria-labelledby":_.titleId,"aria-describedby":D};return Y.createElement(Gte,{type:"Dialog",enabled:b===0,element:d,onUpdate:re((K,Q)=>{Q==="Dialog"&&Re(K,{[g2.Add]:()=>f(J=>J+1),[g2.Remove]:()=>f(J=>J-1)})})},Y.createElement(h2,{force:!0},Y.createElement(p2,null,Y.createElement(Em.Provider,{value:V},Y.createElement(p2.Group,{target:d},Y.createElement(h2,{force:!1},Y.createElement(U,{slot:G,name:"Dialog.Description"},Y.createElement(cd,{initialFocus:i,containers:F,features:x?Re(k,{parent:cd.features.RestoreFocus,leaf:cd.features.All&~cd.features.FocusLock}):cd.features.None},Fe({ourProps:H,theirProps:l,slot:G,defaultTag:mre,features:yre,visible:b===0,name:"Dialog"})))))))),Y.createElement(Ta,{features:Ca.Hidden,ref:g}))}let wre="div";function _re(e,t){let r=Pt(),{id:n=`headlessui-dialog-overlay-${r}`,...a}=e,[{dialogState:o,close:i}]=Ph("Dialog.Overlay"),s=We(t),l=re(f=>{if(f.target===f.currentTarget){if(Oh(f.currentTarget))return f.preventDefault();f.preventDefault(),f.stopPropagation(),i()}}),u=p.useMemo(()=>({open:o===0}),[o]);return Fe({ourProps:{ref:s,id:n,"aria-hidden":!0,onClick:l},theirProps:a,slot:u,defaultTag:wre,name:"Dialog.Overlay"})}let $re="div";function xre(e,t){let r=Pt(),{id:n=`headlessui-dialog-backdrop-${r}`,...a}=e,[{dialogState:o},i]=Ph("Dialog.Backdrop"),s=We(t);p.useEffect(()=>{if(i.panelRef.current===null)throw new Error("A component is being used, but a component is missing.")},[i.panelRef]);let l=p.useMemo(()=>({open:o===0}),[o]);return Y.createElement(h2,{force:!0},Y.createElement(p2,null,Fe({ourProps:{ref:s,id:n,"aria-hidden":!0},theirProps:a,slot:l,defaultTag:$re,name:"Dialog.Backdrop"})))}let Sre="div";function Ere(e,t){let r=Pt(),{id:n=`headlessui-dialog-panel-${r}`,...a}=e,[{dialogState:o},i]=Ph("Dialog.Panel"),s=We(t,i.panelRef),l=p.useMemo(()=>({open:o===0}),[o]),u=re(f=>{f.stopPropagation()});return Fe({ourProps:{ref:s,id:n,onClick:u},theirProps:a,slot:l,defaultTag:Sre,name:"Dialog.Panel"})}let Cre="h2";function Tre(e,t){let r=Pt(),{id:n=`headlessui-dialog-title-${r}`,...a}=e,[{dialogState:o,setTitleId:i}]=Ph("Dialog.Title"),s=We(t);p.useEffect(()=>(i(n),()=>i(null)),[n,i]);let l=p.useMemo(()=>({open:o===0}),[o]);return Fe({ourProps:{ref:s,id:n},theirProps:a,slot:l,defaultTag:Cre,name:"Dialog.Title"})}let Are=Be(bre),Rre=Be(xre),Ore=Be(Ere),kre=Be(_re),Pre=Be(Tre),yr=Object.assign(Are,{Backdrop:Rre,Panel:Ore,Overlay:kre,Title:Pre,Description:ZD});var Ire=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(Ire||{}),Nre=(e=>(e[e.Single=0]="Single",e[e.Multi=1]="Multi",e))(Nre||{}),Lre=(e=>(e[e.Pointer=0]="Pointer",e[e.Other=1]="Other",e))(Lre||{}),Mre=(e=>(e[e.OpenListbox=0]="OpenListbox",e[e.CloseListbox=1]="CloseListbox",e[e.GoToOption=2]="GoToOption",e[e.Search=3]="Search",e[e.ClearSearch=4]="ClearSearch",e[e.RegisterOption=5]="RegisterOption",e[e.UnregisterOption=6]="UnregisterOption",e[e.RegisterLabel=7]="RegisterLabel",e))(Mre||{});function ob(e,t=r=>r){let r=e.activeOptionIndex!==null?e.options[e.activeOptionIndex]:null,n=Ns(t(e.options.slice()),o=>o.dataRef.current.domRef.current),a=r?n.indexOf(r):null;return a===-1&&(a=null),{options:n,activeOptionIndex:a}}let Dre={[1](e){return e.dataRef.current.disabled||e.listboxState===1?e:{...e,activeOptionIndex:null,listboxState:1}},[0](e){if(e.dataRef.current.disabled||e.listboxState===0)return e;let t=e.activeOptionIndex,{isSelected:r}=e.dataRef.current,n=e.options.findIndex(a=>r(a.dataRef.current.value));return n!==-1&&(t=n),{...e,listboxState:0,activeOptionIndex:t}},[2](e,t){var r;if(e.dataRef.current.disabled||e.listboxState===1)return e;let n=ob(e),a=mte(t,{resolveItems:()=>n.options,resolveActiveIndex:()=>n.activeOptionIndex,resolveId:o=>o.id,resolveDisabled:o=>o.dataRef.current.disabled});return{...e,...n,searchQuery:"",activeOptionIndex:a,activationTrigger:(r=t.trigger)!=null?r:1}},[3]:(e,t)=>{if(e.dataRef.current.disabled||e.listboxState===1)return e;let r=e.searchQuery!==""?0:1,n=e.searchQuery+t.value.toLowerCase(),a=(e.activeOptionIndex!==null?e.options.slice(e.activeOptionIndex+r).concat(e.options.slice(0,e.activeOptionIndex+r)):e.options).find(i=>{var s;return!i.dataRef.current.disabled&&((s=i.dataRef.current.textValue)==null?void 0:s.startsWith(n))}),o=a?e.options.indexOf(a):-1;return o===-1||o===e.activeOptionIndex?{...e,searchQuery:n}:{...e,searchQuery:n,activeOptionIndex:o,activationTrigger:1}},[4](e){return e.dataRef.current.disabled||e.listboxState===1||e.searchQuery===""?e:{...e,searchQuery:""}},[5]:(e,t)=>{let r={id:t.id,dataRef:t.dataRef},n=ob(e,a=>[...a,r]);return e.activeOptionIndex===null&&e.dataRef.current.isSelected(t.dataRef.current.value)&&(n.activeOptionIndex=n.options.indexOf(r)),{...e,...n}},[6]:(e,t)=>{let r=ob(e,n=>{let a=n.findIndex(o=>o.id===t.id);return a!==-1&&n.splice(a,1),n});return{...e,...r,activationTrigger:1}},[7]:(e,t)=>({...e,labelId:t.id})},sC=p.createContext(null);sC.displayName="ListboxActionsContext";function Ih(e){let t=p.useContext(sC);if(t===null){let r=new Error(`<${e} /> is missing a parent component.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,Ih),r}return t}let lC=p.createContext(null);lC.displayName="ListboxDataContext";function Nh(e){let t=p.useContext(lC);if(t===null){let r=new Error(`<${e} /> is missing a parent component.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,Nh),r}return t}function jre(e,t){return Re(t.type,Dre,e,t)}let Fre=p.Fragment;function Bre(e,t){let{value:r,defaultValue:n,form:a,name:o,onChange:i,by:s=(H,K)=>H===K,disabled:l=!1,horizontal:u=!1,multiple:f=!1,...c}=e;const d=u?"horizontal":"vertical";let h=We(t),[g=f?[]:void 0,m]=zD(r,i,n),[w,v]=p.useReducer(jre,{dataRef:p.createRef(),listboxState:1,options:[],searchQuery:"",labelId:null,activeOptionIndex:null,activationTrigger:1}),b=p.useRef({static:!1,hold:!1}),_=p.useRef(null),$=p.useRef(null),C=p.useRef(null),O=re(typeof s=="string"?(H,K)=>{let Q=s;return(H==null?void 0:H[Q])===(K==null?void 0:K[Q])}:s),x=p.useCallback(H=>Re(S.mode,{[1]:()=>g.some(K=>O(K,H)),[0]:()=>O(g,H)}),[g]),S=p.useMemo(()=>({...w,value:g,disabled:l,mode:f?1:0,orientation:d,compare:O,isSelected:x,optionsPropsRef:b,labelRef:_,buttonRef:$,optionsRef:C}),[g,l,f,w]);gt(()=>{w.dataRef.current=S},[S]),eC([S.buttonRef,S.optionsRef],(H,K)=>{var Q;v({type:1}),JE(K,W0.Loose)||(H.preventDefault(),(Q=S.buttonRef.current)==null||Q.focus())},S.listboxState===0);let A=p.useMemo(()=>({open:S.listboxState===0,disabled:l,value:g}),[S,l,g]),k=re(H=>{let K=S.options.find(Q=>Q.id===H);K&&B(K.dataRef.current.value)}),L=re(()=>{if(S.activeOptionIndex!==null){let{dataRef:H,id:K}=S.options[S.activeOptionIndex];B(H.current.value),v({type:2,focus:Pr.Specific,id:K})}}),P=re(()=>v({type:0})),N=re(()=>v({type:1})),E=re((H,K,Q)=>H===Pr.Specific?v({type:2,focus:Pr.Specific,id:K,trigger:Q}):v({type:2,focus:H,trigger:Q})),R=re((H,K)=>(v({type:5,id:H,dataRef:K}),()=>v({type:6,id:H}))),F=re(H=>(v({type:7,id:H}),()=>v({type:7,id:null}))),B=re(H=>Re(S.mode,{[0](){return m==null?void 0:m(H)},[1](){let K=S.value.slice(),Q=K.findIndex(J=>O(J,H));return Q===-1?K.push(H):K.splice(Q,1),m==null?void 0:m(K)}})),j=re(H=>v({type:3,value:H})),M=re(()=>v({type:4})),D=p.useMemo(()=>({onChange:B,registerOption:R,registerLabel:F,goToOption:E,closeListbox:N,openListbox:P,selectActiveOption:L,selectOption:k,search:j,clearSearch:M}),[]),U={ref:h},V=p.useRef(null),G=Vi();return p.useEffect(()=>{V.current&&n!==void 0&&G.addEventListener(V.current,"reset",()=>{B(n)})},[V,B]),Y.createElement(sC.Provider,{value:D},Y.createElement(lC.Provider,{value:S},Y.createElement(rC,{value:Re(S.listboxState,{[0]:ut.Open,[1]:ut.Closed})},o!=null&&g!=null&&FD({[o]:g}).map(([H,K],Q)=>Y.createElement(Ta,{features:Ca.Hidden,ref:Q===0?J=>{var de;V.current=(de=J==null?void 0:J.closest("form"))!=null?de:null}:void 0,...Sm({key:H,as:"input",type:"hidden",hidden:!0,readOnly:!0,form:a,name:H,value:K})})),Fe({ourProps:U,theirProps:c,slot:A,defaultTag:Fre,name:"Listbox"}))))}let Ure="button";function zre(e,t){var r;let n=Pt(),{id:a=`headlessui-listbox-button-${n}`,...o}=e,i=Nh("Listbox.Button"),s=Ih("Listbox.Button"),l=We(i.buttonRef,t),u=Vi(),f=re(w=>{switch(w.key){case ye.Space:case ye.Enter:case ye.ArrowDown:w.preventDefault(),s.openListbox(),u.nextFrame(()=>{i.value||s.goToOption(Pr.First)});break;case ye.ArrowUp:w.preventDefault(),s.openListbox(),u.nextFrame(()=>{i.value||s.goToOption(Pr.Last)});break}}),c=re(w=>{switch(w.key){case ye.Space:w.preventDefault();break}}),d=re(w=>{if(Oh(w.currentTarget))return w.preventDefault();i.listboxState===0?(s.closeListbox(),u.nextFrame(()=>{var v;return(v=i.buttonRef.current)==null?void 0:v.focus({preventScroll:!0})})):(w.preventDefault(),s.openListbox())}),h=LD(()=>{if(i.labelId)return[i.labelId,a].join(" ")},[i.labelId,a]),g=p.useMemo(()=>({open:i.listboxState===0,disabled:i.disabled,value:i.value}),[i]),m={ref:l,id:a,type:H0(e,i.buttonRef),"aria-haspopup":"listbox","aria-controls":(r=i.optionsRef.current)==null?void 0:r.id,"aria-expanded":i.disabled?void 0:i.listboxState===0,"aria-labelledby":h,disabled:i.disabled,onKeyDown:f,onKeyUp:c,onClick:d};return Fe({ourProps:m,theirProps:o,slot:g,defaultTag:Ure,name:"Listbox.Button"})}let Vre="label";function Wre(e,t){let r=Pt(),{id:n=`headlessui-listbox-label-${r}`,...a}=e,o=Nh("Listbox.Label"),i=Ih("Listbox.Label"),s=We(o.labelRef,t);gt(()=>i.registerLabel(n),[n]);let l=re(()=>{var f;return(f=o.buttonRef.current)==null?void 0:f.focus({preventScroll:!0})}),u=p.useMemo(()=>({open:o.listboxState===0,disabled:o.disabled}),[o]);return Fe({ourProps:{ref:s,id:n,onClick:l},theirProps:a,slot:u,defaultTag:Vre,name:"Listbox.Label"})}let Hre="ul",Gre=Pn.RenderStrategy|Pn.Static;function Kre(e,t){var r;let n=Pt(),{id:a=`headlessui-listbox-options-${n}`,...o}=e,i=Nh("Listbox.Options"),s=Ih("Listbox.Options"),l=We(i.optionsRef,t),u=Vi(),f=Vi(),c=ku(),d=(()=>c!==null?(c&ut.Open)===ut.Open:i.listboxState===0)();p.useEffect(()=>{var v;let b=i.optionsRef.current;b&&i.listboxState===0&&b!==((v=Rh(b))==null?void 0:v.activeElement)&&b.focus({preventScroll:!0})},[i.listboxState,i.optionsRef]);let h=re(v=>{switch(f.dispose(),v.key){case ye.Space:if(i.searchQuery!=="")return v.preventDefault(),v.stopPropagation(),s.search(v.key);case ye.Enter:if(v.preventDefault(),v.stopPropagation(),i.activeOptionIndex!==null){let{dataRef:b}=i.options[i.activeOptionIndex];s.onChange(b.current.value)}i.mode===0&&(s.closeListbox(),_o().nextFrame(()=>{var b;return(b=i.buttonRef.current)==null?void 0:b.focus({preventScroll:!0})}));break;case Re(i.orientation,{vertical:ye.ArrowDown,horizontal:ye.ArrowRight}):return v.preventDefault(),v.stopPropagation(),s.goToOption(Pr.Next);case Re(i.orientation,{vertical:ye.ArrowUp,horizontal:ye.ArrowLeft}):return v.preventDefault(),v.stopPropagation(),s.goToOption(Pr.Previous);case ye.Home:case ye.PageUp:return v.preventDefault(),v.stopPropagation(),s.goToOption(Pr.First);case ye.End:case ye.PageDown:return v.preventDefault(),v.stopPropagation(),s.goToOption(Pr.Last);case ye.Escape:return v.preventDefault(),v.stopPropagation(),s.closeListbox(),u.nextFrame(()=>{var b;return(b=i.buttonRef.current)==null?void 0:b.focus({preventScroll:!0})});case ye.Tab:v.preventDefault(),v.stopPropagation();break;default:v.key.length===1&&(s.search(v.key),f.setTimeout(()=>s.clearSearch(),350));break}}),g=LD(()=>{var v,b,_;return(_=(v=i.labelRef.current)==null?void 0:v.id)!=null?_:(b=i.buttonRef.current)==null?void 0:b.id},[i.labelRef.current,i.buttonRef.current]),m=p.useMemo(()=>({open:i.listboxState===0}),[i]),w={"aria-activedescendant":i.activeOptionIndex===null||(r=i.options[i.activeOptionIndex])==null?void 0:r.id,"aria-multiselectable":i.mode===1?!0:void 0,"aria-labelledby":g,"aria-orientation":i.orientation,id:a,onKeyDown:h,role:"listbox",tabIndex:0,ref:l};return Fe({ourProps:w,theirProps:o,slot:m,defaultTag:Hre,features:Gre,visible:d,name:"Listbox.Options"})}let qre="li";function Yre(e,t){let r=Pt(),{id:n=`headlessui-listbox-option-${r}`,disabled:a=!1,value:o,...i}=e,s=Nh("Listbox.Option"),l=Ih("Listbox.Option"),u=s.activeOptionIndex!==null?s.options[s.activeOptionIndex].id===n:!1,f=s.isSelected(o),c=p.useRef(null),d=dr({disabled:a,value:o,domRef:c,get textValue(){var C,O;return(O=(C=c.current)==null?void 0:C.textContent)==null?void 0:O.toLowerCase()}}),h=We(t,c);gt(()=>{if(s.listboxState!==0||!u||s.activationTrigger===0)return;let C=_o();return C.requestAnimationFrame(()=>{var O,x;(x=(O=c.current)==null?void 0:O.scrollIntoView)==null||x.call(O,{block:"nearest"})}),C.dispose},[c,u,s.listboxState,s.activationTrigger,s.activeOptionIndex]),gt(()=>l.registerOption(n,d),[d,n]);let g=re(C=>{if(a)return C.preventDefault();l.onChange(o),s.mode===0&&(l.closeListbox(),_o().nextFrame(()=>{var O;return(O=s.buttonRef.current)==null?void 0:O.focus({preventScroll:!0})}))}),m=re(()=>{if(a)return l.goToOption(Pr.Nothing);l.goToOption(Pr.Specific,n)}),w=xte(),v=re(C=>w.update(C)),b=re(C=>{w.wasMoved(C)&&(a||u||l.goToOption(Pr.Specific,n,0))}),_=re(C=>{w.wasMoved(C)&&(a||u&&l.goToOption(Pr.Nothing))}),$=p.useMemo(()=>({active:u,selected:f,disabled:a}),[u,f,a]);return Fe({ourProps:{id:n,ref:h,role:"option",tabIndex:a===!0?void 0:-1,"aria-disabled":a===!0?!0:void 0,"aria-selected":f,disabled:void 0,onClick:g,onFocus:m,onPointerEnter:v,onMouseEnter:v,onPointerMove:b,onMouseMove:b,onPointerLeave:_,onMouseLeave:_},theirProps:i,slot:$,defaultTag:qre,name:"Listbox.Option"})}let Xre=Be(Bre),Zre=Be(zre),Qre=Be(Wre),Jre=Be(Kre),ene=Be(Yre),ur=Object.assign(Xre,{Button:Zre,Label:Qre,Options:Jre,Option:ene});var tne=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(tne||{}),rne=(e=>(e[e.TogglePopover=0]="TogglePopover",e[e.ClosePopover=1]="ClosePopover",e[e.SetButton=2]="SetButton",e[e.SetButtonId=3]="SetButtonId",e[e.SetPanel=4]="SetPanel",e[e.SetPanelId=5]="SetPanelId",e))(rne||{});let nne={[0]:e=>({...e,popoverState:Re(e.popoverState,{[0]:1,[1]:0})}),[1](e){return e.popoverState===1?e:{...e,popoverState:1}},[2](e,t){return e.button===t.button?e:{...e,button:t.button}},[3](e,t){return e.buttonId===t.buttonId?e:{...e,buttonId:t.buttonId}},[4](e,t){return e.panel===t.panel?e:{...e,panel:t.panel}},[5](e,t){return e.panelId===t.panelId?e:{...e,panelId:t.panelId}}},cC=p.createContext(null);cC.displayName="PopoverContext";function G0(e){let t=p.useContext(cC);if(t===null){let r=new Error(`<${e} /> is missing a parent component.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,G0),r}return t}let uC=p.createContext(null);uC.displayName="PopoverAPIContext";function dC(e){let t=p.useContext(uC);if(t===null){let r=new Error(`<${e} /> is missing a parent component.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,dC),r}return t}let fC=p.createContext(null);fC.displayName="PopoverGroupContext";function QD(){return p.useContext(fC)}let K0=p.createContext(null);K0.displayName="PopoverPanelContext";function ane(){return p.useContext(K0)}function one(e,t){return Re(t.type,nne,e,t)}let ine="div";function sne(e,t){var r;let n=p.useRef(null),a=We(t,DD(P=>{n.current=P})),o=p.useRef([]),i=p.useReducer(one,{popoverState:1,buttons:o,button:null,buttonId:null,panel:null,panelId:null,beforePanelSentinel:p.createRef(),afterPanelSentinel:p.createRef()}),[{popoverState:s,button:l,buttonId:u,panel:f,panelId:c,beforePanelSentinel:d,afterPanelSentinel:h},g]=i,m=vl((r=n.current)!=null?r:l),w=p.useMemo(()=>{if(!l||!f)return!1;for(let j of document.querySelectorAll("body > *"))if(Number(j==null?void 0:j.contains(l))^Number(j==null?void 0:j.contains(f)))return!0;let P=V0(),N=P.indexOf(l),E=(N+P.length-1)%P.length,R=(N+1)%P.length,F=P[E],B=P[R];return!f.contains(F)&&!f.contains(B)},[l,f]),v=dr(u),b=dr(c),_=p.useMemo(()=>({buttonId:v,panelId:b,close:()=>g({type:1})}),[v,b,g]),$=QD(),C=$==null?void 0:$.registerPopover,O=re(()=>{var P;return(P=$==null?void 0:$.isFocusWithinPopoverGroup())!=null?P:(m==null?void 0:m.activeElement)&&((l==null?void 0:l.contains(m.activeElement))||(f==null?void 0:f.contains(m.activeElement)))});p.useEffect(()=>C==null?void 0:C(_),[C,_]),oC(m==null?void 0:m.defaultView,"focus",P=>{var N,E,R,F;s===0&&(O()||l&&f&&P.target!==window&&((E=(N=d.current)==null?void 0:N.contains)!=null&&E.call(N,P.target)||(F=(R=h.current)==null?void 0:R.contains)!=null&&F.call(R,P.target)||g({type:1})))},!0),eC([l,f],(P,N)=>{g({type:1}),JE(N,W0.Loose)||(P.preventDefault(),l==null||l.focus())},s===0);let x=re(P=>{g({type:1});let N=(()=>P?P instanceof HTMLElement?P:"current"in P&&P.current instanceof HTMLElement?P.current:l:l)();N==null||N.focus()}),S=p.useMemo(()=>({close:x,isPortalled:w}),[x,w]),A=p.useMemo(()=>({open:s===0,close:x}),[s,x]),k=e,L={ref:a};return Y.createElement(K0.Provider,{value:null},Y.createElement(cC.Provider,{value:i},Y.createElement(uC.Provider,{value:S},Y.createElement(rC,{value:Re(s,{[0]:ut.Open,[1]:ut.Closed})},Fe({ourProps:L,theirProps:k,slot:A,defaultTag:ine,name:"Popover"})))))}let lne="button";function cne(e,t){let r=Pt(),{id:n=`headlessui-popover-button-${r}`,...a}=e,[o,i]=G0("Popover.Button"),{isPortalled:s}=dC("Popover.Button"),l=p.useRef(null),u=`headlessui-focus-sentinel-${Pt()}`,f=QD(),c=f==null?void 0:f.closeOthers,d=ane()!==null;p.useEffect(()=>{if(!d)return i({type:3,buttonId:n}),()=>{i({type:3,buttonId:null})}},[d,n,i]);let[h]=p.useState(()=>Symbol()),g=We(l,t,d?null:L=>{if(L)o.buttons.current.push(h);else{let P=o.buttons.current.indexOf(h);P!==-1&&o.buttons.current.splice(P,1)}o.buttons.current.length>1,L&&i({type:2,button:L})}),m=We(l,t),w=vl(l),v=re(L=>{var P,N,E;if(d){if(o.popoverState===1)return;switch(L.key){case ye.Space:case ye.Enter:L.preventDefault(),(N=(P=L.target).click)==null||N.call(P),i({type:1}),(E=o.button)==null||E.focus();break}}else switch(L.key){case ye.Space:case ye.Enter:L.preventDefault(),L.stopPropagation(),o.popoverState===1&&(c==null||c(o.buttonId)),i({type:0});break;case ye.Escape:if(o.popoverState!==0)return c==null?void 0:c(o.buttonId);if(!l.current||w!=null&&w.activeElement&&!l.current.contains(w.activeElement))return;L.preventDefault(),L.stopPropagation(),i({type:1});break}}),b=re(L=>{d||L.key===ye.Space&&L.preventDefault()}),_=re(L=>{var P,N;Oh(L.currentTarget)||e.disabled||(d?(i({type:1}),(P=o.button)==null||P.focus()):(L.preventDefault(),L.stopPropagation(),o.popoverState===1&&(c==null||c(o.buttonId)),i({type:0}),(N=o.button)==null||N.focus()))}),$=re(L=>{L.preventDefault(),L.stopPropagation()}),C=o.popoverState===0,O=p.useMemo(()=>({open:C}),[C]),x=H0(e,l),S=d?{ref:m,type:x,onKeyDown:v,onClick:_}:{ref:g,id:o.buttonId,type:x,"aria-expanded":e.disabled?void 0:o.popoverState===0,"aria-controls":o.panel?o.panelId:void 0,onKeyDown:v,onKeyUp:b,onClick:_,onMouseDown:$},A=aC(),k=re(()=>{let L=o.panel;if(!L)return;function P(){Re(A.current,{[Xr.Forwards]:()=>qt(L,et.First),[Xr.Backwards]:()=>qt(L,et.Last)})===to.Error&&qt(V0().filter(N=>N.dataset.headlessuiFocusGuard!=="true"),Re(A.current,{[Xr.Forwards]:et.Next,[Xr.Backwards]:et.Previous}),{relativeTo:o.button})}P()});return Y.createElement(Y.Fragment,null,Fe({ourProps:S,theirProps:a,slot:O,defaultTag:lne,name:"Popover.Button"}),C&&!d&&s&&Y.createElement(Ta,{id:u,features:Ca.Focusable,"data-headlessui-focus-guard":!0,as:"button",type:"button",onFocus:k}))}let une="div",dne=Pn.RenderStrategy|Pn.Static;function fne(e,t){let r=Pt(),{id:n=`headlessui-popover-overlay-${r}`,...a}=e,[{popoverState:o},i]=G0("Popover.Overlay"),s=We(t),l=ku(),u=(()=>l!==null?(l&ut.Open)===ut.Open:o===0)(),f=re(d=>{if(Oh(d.currentTarget))return d.preventDefault();i({type:1})}),c=p.useMemo(()=>({open:o===0}),[o]);return Fe({ourProps:{ref:s,id:n,"aria-hidden":!0,onClick:f},theirProps:a,slot:c,defaultTag:une,features:dne,visible:u,name:"Popover.Overlay"})}let hne="div",pne=Pn.RenderStrategy|Pn.Static;function gne(e,t){let r=Pt(),{id:n=`headlessui-popover-panel-${r}`,focus:a=!1,...o}=e,[i,s]=G0("Popover.Panel"),{close:l,isPortalled:u}=dC("Popover.Panel"),f=`headlessui-focus-sentinel-before-${Pt()}`,c=`headlessui-focus-sentinel-after-${Pt()}`,d=p.useRef(null),h=We(d,t,x=>{s({type:4,panel:x})}),g=vl(d);gt(()=>(s({type:5,panelId:n}),()=>{s({type:5,panelId:null})}),[n,s]);let m=ku(),w=(()=>m!==null?(m&ut.Open)===ut.Open:i.popoverState===0)(),v=re(x=>{var S;switch(x.key){case ye.Escape:if(i.popoverState!==0||!d.current||g!=null&&g.activeElement&&!d.current.contains(g.activeElement))return;x.preventDefault(),x.stopPropagation(),s({type:1}),(S=i.button)==null||S.focus();break}});p.useEffect(()=>{var x;e.static||i.popoverState===1&&((x=e.unmount)==null||x)&&s({type:4,panel:null})},[i.popoverState,e.unmount,e.static,s]),p.useEffect(()=>{if(!a||i.popoverState!==0||!d.current)return;let x=g==null?void 0:g.activeElement;d.current.contains(x)||qt(d.current,et.First)},[a,d,i.popoverState]);let b=p.useMemo(()=>({open:i.popoverState===0,close:l}),[i,l]),_={ref:h,id:n,onKeyDown:v,onBlur:a&&i.popoverState===0?x=>{var S,A,k,L,P;let N=x.relatedTarget;N&&d.current&&((S=d.current)!=null&&S.contains(N)||(s({type:1}),((k=(A=i.beforePanelSentinel.current)==null?void 0:A.contains)!=null&&k.call(A,N)||(P=(L=i.afterPanelSentinel.current)==null?void 0:L.contains)!=null&&P.call(L,N))&&N.focus({preventScroll:!0})))}:void 0,tabIndex:-1},$=aC(),C=re(()=>{let x=d.current;if(!x)return;function S(){Re($.current,{[Xr.Forwards]:()=>{var A;qt(x,et.First)===to.Error&&((A=i.afterPanelSentinel.current)==null||A.focus())},[Xr.Backwards]:()=>{var A;(A=i.button)==null||A.focus({preventScroll:!0})}})}S()}),O=re(()=>{let x=d.current;if(!x)return;function S(){Re($.current,{[Xr.Forwards]:()=>{var A;if(!i.button)return;let k=V0(),L=k.indexOf(i.button),P=k.slice(0,L+1),N=[...k.slice(L+1),...P];for(let E of N.slice())if(E.dataset.headlessuiFocusGuard==="true"||(A=i.panel)!=null&&A.contains(E)){let R=N.indexOf(E);R!==-1&&N.splice(R,1)}qt(N,et.First,{sorted:!1})},[Xr.Backwards]:()=>{var A;qt(x,et.Previous)===to.Error&&((A=i.button)==null||A.focus())}})}S()});return Y.createElement(K0.Provider,{value:n},w&&u&&Y.createElement(Ta,{id:f,ref:i.beforePanelSentinel,features:Ca.Focusable,"data-headlessui-focus-guard":!0,as:"button",type:"button",onFocus:C}),Fe({ourProps:_,theirProps:o,slot:b,defaultTag:hne,features:pne,visible:w,name:"Popover.Panel"}),w&&u&&Y.createElement(Ta,{id:c,ref:i.afterPanelSentinel,features:Ca.Focusable,"data-headlessui-focus-guard":!0,as:"button",type:"button",onFocus:O}))}let vne="div";function mne(e,t){let r=p.useRef(null),n=We(r,t),[a,o]=p.useState([]),i=re(g=>{o(m=>{let w=m.indexOf(g);if(w!==-1){let v=m.slice();return v.splice(w,1),v}return m})}),s=re(g=>(o(m=>[...m,g]),()=>i(g))),l=re(()=>{var g;let m=Rh(r);if(!m)return!1;let w=m.activeElement;return(g=r.current)!=null&&g.contains(w)?!0:a.some(v=>{var b,_;return((b=m.getElementById(v.buttonId.current))==null?void 0:b.contains(w))||((_=m.getElementById(v.panelId.current))==null?void 0:_.contains(w))})}),u=re(g=>{for(let m of a)m.buttonId.current!==g&&m.close()}),f=p.useMemo(()=>({registerPopover:s,unregisterPopover:i,isFocusWithinPopoverGroup:l,closeOthers:u}),[s,i,l,u]),c=p.useMemo(()=>({}),[]),d=e,h={ref:n};return Y.createElement(fC.Provider,{value:f},Fe({ourProps:h,theirProps:d,slot:c,defaultTag:vne,name:"Popover.Group"}))}let yne=Be(sne),bne=Be(cne),wne=Be(fne),_ne=Be(gne),$ne=Be(mne),An=Object.assign(yne,{Button:bne,Overlay:wne,Panel:_ne,Group:$ne});function xne(e=0){let[t,r]=p.useState(e),n=kh(),a=p.useCallback(l=>{n.current&&r(u=>u|l)},[t,n]),o=p.useCallback(l=>!!(t&l),[t]),i=p.useCallback(l=>{n.current&&r(u=>u&~l)},[r,n]),s=p.useCallback(l=>{n.current&&r(u=>u^l)},[r]);return{flags:t,addFlag:a,hasFlag:o,removeFlag:i,toggleFlag:s}}let JD=p.createContext(null);function e9(){let e=p.useContext(JD);if(e===null){let t=new Error("You used a