@petnow/ui 1.7.6 → 1.7.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.css +1 -1
- package/dist/index.es.js +1 -1
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/index.umd.js
CHANGED
|
@@ -45,7 +45,7 @@ Check the top-level render call using <`+R+">.")}return I}}function yc(b,I){{if(
|
|
|
45
45
|
*
|
|
46
46
|
* This source code is licensed under the MIT license found in the
|
|
47
47
|
* LICENSE file in the root directory of this source tree.
|
|
48
|
-
*/var ll;function Up(){return ll||(ll=1,process.env.NODE_ENV!=="production"&&function(){function n(l,u){return l===u&&(l!==0||1/l===1/u)||l!==l&&u!==u}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var r=d,e=typeof Object.is=="function"?Object.is:n,t=r.useSyncExternalStore,o=r.useRef,a=r.useEffect,i=r.useMemo,s=r.useDebugValue;Sa.useSyncExternalStoreWithSelector=function(l,u,c,p,m){var f=o(null);if(f.current===null){var h={hasValue:!1,value:null};f.current=h}else h=f.current;f=i(function(){function g(k){if(!w){if(w=!0,y=k,k=p(k),m!==void 0&&h.hasValue){var C=h.value;if(m(C,k))return x=C}return x=k}if(C=x,e(y,k))return C;var S=p(k);return m!==void 0&&m(C,S)?(y=k,C):(y=k,x=S)}var w=!1,y,x,E=c===void 0?null:c;return[function(){return g(u())},E===null?void 0:function(){return g(E())}]},[u,c,p,m]);var v=t(l,f[0],f[1]);return a(function(){h.hasValue=!0,h.value=v},[v]),s(v),v},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),Sa}var ul;function Qp(){return ul||(ul=1,process.env.NODE_ENV==="production"?Rr.exports=zp():Rr.exports=Up()),Rr.exports}var Kp=Qp(),cl=(n,r,e)=>{if(!r.has(n))throw TypeError("Cannot "+e)},nt=(n,r,e)=>(cl(n,r,"read from private field"),e?e.call(n):r.get(n)),Ca=(n,r,e)=>{if(r.has(n))throw TypeError("Cannot add the same private member more than once");r instanceof WeakSet?r.add(n):r.set(n,e)},dl=(n,r,e,t)=>(cl(n,r,"write to private field"),r.set(n,e),e),Et,Xn,Jn;let fl=class{constructor(r){Ca(this,Et,{}),Ca(this,Xn,new us(()=>new Set)),Ca(this,Jn,new Set),dl(this,Et,r)}get state(){return nt(this,Et)}subscribe(r,e){let t={selector:r,callback:e,current:r(nt(this,Et))};return nt(this,Jn).add(t),()=>{nt(this,Jn).delete(t)}}on(r,e){return nt(this,Xn).get(r).add(e),()=>{nt(this,Xn).get(r).delete(e)}}send(r){dl(this,Et,this.reduce(nt(this,Et),r));for(let e of nt(this,Jn)){let t=e.selector(nt(this,Et));pl(e.current,t)||(e.current=t,e.callback(t))}for(let e of nt(this,Xn).get(r.type))e(nt(this,Et),r)}};Et=new WeakMap,Xn=new WeakMap,Jn=new WeakMap;function pl(n,r){return Object.is(n,r)?!0:typeof n!="object"||n===null||typeof r!="object"||r===null?!1:Array.isArray(n)&&Array.isArray(r)?n.length!==r.length?!1:_a(n[Symbol.iterator](),r[Symbol.iterator]()):n instanceof Map&&r instanceof Map||n instanceof Set&&r instanceof Set?n.size!==r.size?!1:_a(n.entries(),r.entries()):ml(n)&&ml(r)?_a(Object.entries(n)[Symbol.iterator](),Object.entries(r)[Symbol.iterator]()):!1}function _a(n,r){do{let e=n.next(),t=r.next();if(e.done&&t.done)return!0;if(e.done||t.done||!Object.is(e.value,t.value))return!1}while(!0)}function ml(n){if(Object.prototype.toString.call(n)!=="[object Object]")return!1;let r=Object.getPrototypeOf(n);return r===null||Object.getPrototypeOf(r)===null}function Oa(n){let[r,e]=n(),t=et();return(...o)=>{r(...o),t.dispose(),t.microTask(e)}}function ye(n,r,e=pl){return Kp.useSyncExternalStoreWithSelector(V(t=>n.subscribe(qp,t)),V(()=>n.state),V(()=>n.state),V(r),e)}function qp(n){return n}function Gp(n){function r(){document.readyState!=="loading"&&(n(),document.removeEventListener("DOMContentLoaded",r))}typeof window<"u"&&typeof document<"u"&&(document.addEventListener("DOMContentLoaded",r),r())}let lt=[];Gp(()=>{function n(r){if(!(r.target instanceof HTMLElement)||r.target===document.body||lt[0]===r.target)return;let e=r.target;e=e.closest(Pr),lt.unshift(e??r.target),lt=lt.filter(t=>t!=null&&t.isConnected),lt.splice(10)}window.addEventListener("click",n,{capture:!0}),window.addEventListener("mousedown",n,{capture:!0}),window.addEventListener("focus",n,{capture:!0}),document.body.addEventListener("click",n,{capture:!0}),document.body.addEventListener("mousedown",n,{capture:!0}),document.body.addEventListener("focus",n,{capture:!0})});function Xp(n){throw new Error("Unexpected object: "+n)}var se=(n=>(n[n.First=0]="First",n[n.Previous=1]="Previous",n[n.Next=2]="Next",n[n.Last=3]="Last",n[n.Specific=4]="Specific",n[n.Nothing=5]="Nothing",n))(se||{});function Zn(n,r){let e=r.resolveItems();if(e.length<=0)return null;let t=r.resolveActiveIndex(),o=t??-1;switch(n.focus){case 0:{for(let a=0;a<e.length;++a)if(!r.resolveDisabled(e[a],a,e))return a;return t}case 1:{o===-1&&(o=e.length);for(let a=o-1;a>=0;--a)if(!r.resolveDisabled(e[a],a,e))return a;return t}case 2:{for(let a=o+1;a<e.length;++a)if(!r.resolveDisabled(e[a],a,e))return a;return t}case 3:{for(let a=e.length-1;a>=0;--a)if(!r.resolveDisabled(e[a],a,e))return a;return t}case 4:{for(let a=0;a<e.length;++a)if(r.resolveId(e[a],a,e)===n.id)return a;return t}case 5:return null;default:Xp(n)}}var Ma=(n=>(n[n.Left=0]="Left",n[n.Right=2]="Right",n))(Ma||{});function hl(n){let r=V(n),e=d.useRef(!1);d.useEffect(()=>(e.current=!1,()=>{e.current=!0,kr(()=>{e.current&&r()})}),[r])}function Jp(){let n=typeof document>"u";return"useSyncExternalStore"in F?(r=>r.useSyncExternalStore)(F)(()=>()=>{},()=>!1,()=>!n):!1}function er(){let n=Jp(),[r,e]=F.useState(qt.isHandoffComplete);return r&&qt.isHandoffComplete===!1&&e(!1),F.useEffect(()=>{r!==!0&&e(!0)},[r]),F.useEffect(()=>qt.handoff(),[]),n?!1:r}let vl=d.createContext(!1);function Zp(){return d.useContext(vl)}function gl(n){return d.createElement(vl.Provider,{value:n.force},n.children)}function em(n){let r=Zp(),e=d.useContext(yl),[t,o]=d.useState(()=>{var a;if(!r&&e!==null)return(a=e.current)!=null?a:null;if(qt.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 d.useEffect(()=>{t!==null&&(n!=null&&n.body.contains(t)||n==null||n.body.appendChild(t))},[t,n]),d.useEffect(()=>{r||e!==null&&o(e.current)},[e,o,r]),t}let bl=d.Fragment,tm=De(function(n,r){let{ownerDocument:e=null,...t}=n,o=d.useRef(null),a=Le(zd(f=>{o.current=f}),r),i=xt(o),s=e??i,l=em(s),[u]=d.useState(()=>{var f;return qt.isServer?null:(f=s==null?void 0:s.createElement("div"))!=null?f:null}),c=d.useContext(Pa),p=er();ce(()=>{!l||!u||l.contains(u)||(u.setAttribute("data-headlessui-portal",""),l.appendChild(u))},[l,u]),ce(()=>{if(u&&c)return c.register(u)},[c,u]),hl(()=>{var f;!l||!u||(u instanceof Node&&l.contains(u)&&l.removeChild(u),l.childNodes.length<=0&&((f=l.parentElement)==null||f.removeChild(l)))});let m=Ce();return p?!l||!u?null:Se.createPortal(m({ourProps:{ref:a},theirProps:t,slot:{},defaultTag:bl,name:"Portal"}),u):null});function nm(n,r){let e=Le(r),{enabled:t=!0,ownerDocument:o,...a}=n,i=Ce();return t?d.createElement(tm,{...a,ownerDocument:o,ref:e}):i({ourProps:{ref:e},theirProps:a,slot:{},defaultTag:bl,name:"Portal"})}let rm=d.Fragment,yl=d.createContext(null);function om(n,r){let{target:e,...t}=n,o={ref:Le(r)},a=Ce();return d.createElement(yl.Provider,{value:e},a({ourProps:o,theirProps:t,defaultTag:rm,name:"Popover.Group"}))}let Pa=d.createContext(null);function am(){let n=d.useContext(Pa),r=d.useRef([]),e=V(a=>(r.current.push(a),n&&n.register(a),()=>t(a))),t=V(a=>{let i=r.current.indexOf(a);i!==-1&&r.current.splice(i,1),n&&n.unregister(a)}),o=d.useMemo(()=>({register:e,unregister:t,portals:r}),[e,t,r]);return[r,d.useMemo(()=>function({children:a}){return d.createElement(Pa.Provider,{value:o},a)},[o])]}let im=De(nm),wl=De(om),Ta=Object.assign(im,{Group:wl});var sm=Object.defineProperty,lm=(n,r,e)=>r in n?sm(n,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[r]=e,xl=(n,r,e)=>(lm(n,typeof r!="symbol"?r+"":r,e),e),ie=(n=>(n[n.Open=0]="Open",n[n.Closed=1]="Closed",n))(ie||{}),Qe=(n=>(n[n.Single=0]="Single",n[n.Multi=1]="Multi",n))(Qe||{}),jt=(n=>(n[n.Pointer=0]="Pointer",n[n.Focus=1]="Focus",n[n.Other=2]="Other",n))(jt||{}),Dl=(n=>(n[n.OpenCombobox=0]="OpenCombobox",n[n.CloseCombobox=1]="CloseCombobox",n[n.GoToOption=2]="GoToOption",n[n.SetTyping=3]="SetTyping",n[n.RegisterOption=4]="RegisterOption",n[n.UnregisterOption=5]="UnregisterOption",n[n.DefaultToFirstOption=6]="DefaultToFirstOption",n[n.SetActivationTrigger=7]="SetActivationTrigger",n[n.UpdateVirtualConfiguration=8]="UpdateVirtualConfiguration",n[n.SetInputElement=9]="SetInputElement",n[n.SetButtonElement=10]="SetButtonElement",n[n.SetOptionsElement=11]="SetOptionsElement",n))(Dl||{});function Na(n,r=e=>e){let e=n.activeOptionIndex!==null?n.options[n.activeOptionIndex]:null,t=r(n.options.slice()),o=t.length>0&&t[0].dataRef.current.order!==null?t.sort((i,s)=>i.dataRef.current.order-s.dataRef.current.order):ea(t,i=>i.dataRef.current.domRef.current),a=e?o.indexOf(e):null;return a===-1&&(a=null),{options:o,activeOptionIndex:a}}let um={1(n){var r;return(r=n.dataRef.current)!=null&&r.disabled||n.comboboxState===1?n:{...n,activeOptionIndex:null,comboboxState:1,isTyping:!1,activationTrigger:2,__demoMode:!1}},0(n){var r,e;if((r=n.dataRef.current)!=null&&r.disabled||n.comboboxState===0)return n;if((e=n.dataRef.current)!=null&&e.value){let t=n.dataRef.current.calculateIndex(n.dataRef.current.value);if(t!==-1)return{...n,activeOptionIndex:t,comboboxState:0,__demoMode:!1}}return{...n,comboboxState:0,__demoMode:!1}},3(n,r){return n.isTyping===r.isTyping?n:{...n,isTyping:r.isTyping}},2(n,r){var e,t,o,a;if((e=n.dataRef.current)!=null&&e.disabled||n.optionsElement&&!((t=n.dataRef.current)!=null&&t.optionsPropsRef.current.static)&&n.comboboxState===1)return n;if(n.virtual){let{options:u,disabled:c}=n.virtual,p=r.focus===se.Specific?r.idx:Zn(r,{resolveItems:()=>u,resolveActiveIndex:()=>{var f,h;return(h=(f=n.activeOptionIndex)!=null?f:u.findIndex(v=>!c(v)))!=null?h:null},resolveDisabled:c,resolveId(){throw new Error("Function not implemented.")}}),m=(o=r.trigger)!=null?o:2;return n.activeOptionIndex===p&&n.activationTrigger===m?n:{...n,activeOptionIndex:p,activationTrigger:m,isTyping:!1,__demoMode:!1}}let i=Na(n);if(i.activeOptionIndex===null){let u=i.options.findIndex(c=>!c.dataRef.current.disabled);u!==-1&&(i.activeOptionIndex=u)}let s=r.focus===se.Specific?r.idx:Zn(r,{resolveItems:()=>i.options,resolveActiveIndex:()=>i.activeOptionIndex,resolveId:u=>u.id,resolveDisabled:u=>u.dataRef.current.disabled}),l=(a=r.trigger)!=null?a:2;return n.activeOptionIndex===s&&n.activationTrigger===l?n:{...n,...i,isTyping:!1,activeOptionIndex:s,activationTrigger:l,__demoMode:!1}},4:(n,r)=>{var e,t,o,a;if((e=n.dataRef.current)!=null&&e.virtual)return{...n,options:[...n.options,r.payload]};let i=r.payload,s=Na(n,u=>(u.push(i),u));n.activeOptionIndex===null&&(o=(t=n.dataRef.current).isSelected)!=null&&o.call(t,r.payload.dataRef.current.value)&&(s.activeOptionIndex=s.options.indexOf(i));let l={...n,...s,activationTrigger:2};return(a=n.dataRef.current)!=null&&a.__demoMode&&n.dataRef.current.value===void 0&&(l.activeOptionIndex=0),l},5:(n,r)=>{var e;if((e=n.dataRef.current)!=null&&e.virtual)return{...n,options:n.options.filter(o=>o.id!==r.id)};let t=Na(n,o=>{let a=o.findIndex(i=>i.id===r.id);return a!==-1&&o.splice(a,1),o});return{...n,...t,activationTrigger:2}},6:(n,r)=>n.defaultToFirstOption===r.value?n:{...n,defaultToFirstOption:r.value},7:(n,r)=>n.activationTrigger===r.trigger?n:{...n,activationTrigger:r.trigger},8:(n,r)=>{var e,t;if(n.virtual===null)return{...n,virtual:{options:r.options,disabled:(e=r.disabled)!=null?e:()=>!1}};if(n.virtual.options===r.options&&n.virtual.disabled===r.disabled)return n;let o=n.activeOptionIndex;if(n.activeOptionIndex!==null){let a=r.options.indexOf(n.virtual.options[n.activeOptionIndex]);a!==-1?o=a:o=null}return{...n,activeOptionIndex:o,virtual:{options:r.options,disabled:(t=r.disabled)!=null?t:()=>!1}}},9:(n,r)=>n.inputElement===r.element?n:{...n,inputElement:r.element},10:(n,r)=>n.buttonElement===r.element?n:{...n,buttonElement:r.element},11:(n,r)=>n.optionsElement===r.element?n:{...n,optionsElement:r.element}},cm=class Ec extends fl{constructor(){super(...arguments),xl(this,"actions",{onChange:r=>{let{onChange:e,compare:t,mode:o,value:a}=this.state.dataRef.current;return Fe(o,{0:()=>e==null?void 0:e(r),1:()=>{let i=a.slice(),s=i.findIndex(l=>t(l,r));return s===-1?i.push(r):i.splice(s,1),e==null?void 0:e(i)}})},registerOption:(r,e)=>(this.send({type:4,payload:{id:r,dataRef:e}}),()=>{this.state.activeOptionIndex===this.state.dataRef.current.calculateIndex(e.current.value)&&this.send({type:6,value:!0}),this.send({type:5,id:r})}),goToOption:(r,e)=>(this.send({type:6,value:!1}),this.send({type:2,...r,trigger:e})),setIsTyping:r=>{this.send({type:3,isTyping:r})},closeCombobox:()=>{var r,e;this.send({type:1}),this.send({type:6,value:!1}),(e=(r=this.state.dataRef.current).onClose)==null||e.call(r)},openCombobox:()=>{this.send({type:0}),this.send({type:6,value:!0})},setActivationTrigger:r=>{this.send({type:7,trigger:r})},selectActiveOption:()=>{let r=this.selectors.activeOptionIndex(this.state);if(r!==null){if(this.actions.setIsTyping(!1),this.state.virtual)this.actions.onChange(this.state.virtual.options[r]);else{let{dataRef:e}=this.state.options[r];this.actions.onChange(e.current.value)}this.actions.goToOption({focus:se.Specific,idx:r})}},setInputElement:r=>{this.send({type:9,element:r})},setButtonElement:r=>{this.send({type:10,element:r})},setOptionsElement:r=>{this.send({type:11,element:r})}}),xl(this,"selectors",{activeDescendantId:r=>{var e,t;let o=this.selectors.activeOptionIndex(r);if(o!==null)return r.virtual?(t=r.options.find(a=>!a.dataRef.current.disabled&&r.dataRef.current.compare(a.dataRef.current.value,r.virtual.options[o])))==null?void 0:t.id:(e=r.options[o])==null?void 0:e.id},activeOptionIndex:r=>{if(r.defaultToFirstOption&&r.activeOptionIndex===null&&(r.virtual?r.virtual.options.length>0:r.options.length>0)){if(r.virtual){let{options:t,disabled:o}=r.virtual,a=t.findIndex(i=>{var s;return!((s=o==null?void 0:o(i))!=null&&s)});if(a!==-1)return a}let e=r.options.findIndex(t=>!t.dataRef.current.disabled);if(e!==-1)return e}return r.activeOptionIndex},activeOption:r=>{var e,t;let o=this.selectors.activeOptionIndex(r);return o===null?null:r.virtual?r.virtual.options[o??0]:(t=(e=r.options[o])==null?void 0:e.dataRef.current.value)!=null?t:null},isActive:(r,e,t)=>{var o;let a=this.selectors.activeOptionIndex(r);return a===null?!1:r.virtual?a===r.dataRef.current.calculateIndex(e):((o=r.options[a])==null?void 0:o.id)===t},shouldScrollIntoView:(r,e,t)=>!(r.virtual||r.__demoMode||r.comboboxState!==0||r.activationTrigger===0||!this.selectors.isActive(r,e,t))})}static new({virtual:r=null,__demoMode:e=!1}={}){var t;return new Ec({dataRef:{current:{}},comboboxState:e?0:1,isTyping:!1,options:[],virtual:r?{options:r.options,disabled:(t=r.disabled)!=null?t:()=>!1}:null,activeOptionIndex:null,activationTrigger:2,inputElement:null,buttonElement:null,optionsElement:null,__demoMode:e})}reduce(r,e){return Fe(e.type,um,r,e)}};const El=d.createContext(null);function tr(n){let r=d.useContext(El);if(r===null){let e=new Error(`<${n} /> is missing a parent <Combobox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(e,kl),e}return r}function kl({virtual:n=null,__demoMode:r=!1}={}){return d.useMemo(()=>cm.new({virtual:n,__demoMode:r}),[])}let nr=d.createContext(null);nr.displayName="ComboboxDataContext";function kn(n){let r=d.useContext(nr);if(r===null){let e=new Error(`<${n} /> is missing a parent <Combobox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(e,kn),e}return r}let Sl=d.createContext(null);function dm(n){let r=tr("VirtualProvider"),e=kn("VirtualProvider"),{options:t}=e.virtual,o=ye(r,f=>f.optionsElement),[a,i]=d.useMemo(()=>{let f=o;if(!f)return[0,0];let h=window.getComputedStyle(f);return[parseFloat(h.paddingBlockStart||h.paddingTop),parseFloat(h.paddingBlockEnd||h.paddingBottom)]},[o]),s=pf({enabled:t.length!==0,scrollPaddingStart:a,scrollPaddingEnd:i,count:t.length,estimateSize(){return 40},getScrollElement(){return r.state.optionsElement},overscan:12}),[l,u]=d.useState(0);ce(()=>{u(f=>f+1)},[t]);let c=s.getVirtualItems(),p=ye(r,f=>f.activationTrigger===jt.Pointer),m=ye(r,r.selectors.activeOptionIndex);return c.length===0?null:d.createElement(Sl.Provider,{value:s},d.createElement("div",{style:{position:"relative",width:"100%",height:`${s.getTotalSize()}px`},ref:f=>{f&&(p||m!==null&&t.length>m&&s.scrollToIndex(m))}},c.map(f=>{var h;return d.createElement(d.Fragment,{key:f.key},d.cloneElement((h=n.children)==null?void 0:h.call(n,{...n.slot,option:t[f.index]}),{key:`${l}-${f.key}`,"data-index":f.index,"aria-setsize":t.length,"aria-posinset":f.index+1,style:{position:"absolute",top:0,left:0,transform:`translateY(${f.start}px)`,overflowAnchor:"none"}}))})))}let fm=d.Fragment;function pm(n,r){let e=Sr(),{value:t,defaultValue:o,onChange:a,form:i,name:s,by:l,invalid:u=!1,disabled:c=e||!1,onClose:p,__demoMode:m=!1,multiple:f=!1,immediate:h=!1,virtual:v=null,nullable:g,...w}=n,y=Ui(o),[x=f?[]:void 0,E]=zi(t,a,y),k=kl({virtual:v,__demoMode:m}),C=d.useRef({static:!1,hold:!1}),S=ls(l),D=V(Z=>v?l===null?v.options.indexOf(Z):v.options.findIndex(A=>S(A,Z)):k.state.options.findIndex(A=>S(A.dataRef.current.value,Z))),_=d.useCallback(Z=>Fe(Y.mode,{[Qe.Multi]:()=>x.some(A=>S(A,Z)),[Qe.Single]:()=>S(x,Z)}),[x]),O=ye(k,Z=>Z.virtual),T=V(()=>p==null?void 0:p()),Y=d.useMemo(()=>({__demoMode:m,immediate:h,optionsPropsRef:C,value:x,defaultValue:y,disabled:c,invalid:u,mode:f?Qe.Multi:Qe.Single,virtual:v?O:null,onChange:E,isSelected:_,calculateIndex:D,compare:S,onClose:T}),[x,y,c,u,f,E,_,m,k,v,O,T]);ce(()=>{var Z;v&&k.send({type:Dl.UpdateVirtualConfiguration,options:v.options,disabled:(Z=v.disabled)!=null?Z:null})},[v,v==null?void 0:v.options,v==null?void 0:v.disabled]),ce(()=>{k.state.dataRef.current=Y},[Y]);let[W,N,L,$]=ye(k,Z=>[Z.comboboxState,Z.buttonElement,Z.inputElement,Z.optionsElement]),z=W===ie.Open;ta(z,[N,L,$],()=>k.actions.closeCombobox());let P=ye(k,k.selectors.activeOptionIndex),q=ye(k,k.selectors.activeOption),X=d.useMemo(()=>({open:W===ie.Open,disabled:c,invalid:u,activeIndex:P,activeOption:q,value:x}),[Y,c,x,u,q,W]),[G,Oe]=rs(),te=r===null?{}:{ref:r},H=d.useCallback(()=>{if(y!==void 0)return E==null?void 0:E(y)},[E,y]),we=Ce();return d.createElement(Oe,{value:G,props:{htmlFor:L==null?void 0:L.id},slot:{open:W===ie.Open,disabled:c}},d.createElement(ol,null,d.createElement(nr.Provider,{value:Y},d.createElement(El.Provider,{value:k},d.createElement(Ea,{value:Fe(W,{[ie.Open]:Ye.Open,[ie.Closed]:Ye.Closed})},s!=null&&d.createElement(Gi,{disabled:c,data:x!=null?{[s]:x}:{},form:i,onReset:H}),we({ourProps:te,theirProps:w,slot:X,defaultTag:fm,name:"Combobox"}))))))}let mm="input";function hm(n,r){var e,t;let o=tr("Combobox.Input"),a=kn("Combobox.Input"),i=d.useId(),s=Uo(),{id:l=s||`headlessui-combobox-input-${i}`,onChange:u,displayValue:c,disabled:p=a.disabled||!1,autoFocus:m=!1,type:f="text",...h}=n,[v]=ye(o,H=>[H.inputElement]),g=d.useRef(null),w=Le(g,r,el(),o.actions.setInputElement),y=xt(v),[x,E]=ye(o,H=>[H.comboboxState,H.isTyping]),k=Ft(),C=V(()=>{o.actions.onChange(null),o.state.optionsElement&&(o.state.optionsElement.scrollTop=0),o.actions.goToOption({focus:se.Nothing})}),S=d.useMemo(()=>{var H;return typeof c=="function"&&a.value!==void 0?(H=c(a.value))!=null?H:"":typeof a.value=="string"?a.value:""},[a.value,c]);Un(([H,we],[Z,A])=>{if(o.state.isTyping)return;let J=g.current;J&&((A===ie.Open&&we===ie.Closed||H!==Z)&&(J.value=H),requestAnimationFrame(()=>{if(o.state.isTyping||!J||(y==null?void 0:y.activeElement)!==J)return;let{selectionStart:le,selectionEnd:oe}=J;Math.abs((oe??0)-(le??0))===0&&le===0&&J.setSelectionRange(J.value.length,J.value.length)}))},[S,x,y,E]),Un(([H],[we])=>{if(H===ie.Open&&we===ie.Closed){if(o.state.isTyping)return;let Z=g.current;if(!Z)return;let A=Z.value,{selectionStart:J,selectionEnd:le,selectionDirection:oe}=Z;Z.value="",Z.value=A,oe!==null?Z.setSelectionRange(J,le,oe):Z.setSelectionRange(J,le)}},[x]);let D=d.useRef(!1),_=V(()=>{D.current=!0}),O=V(()=>{k.nextFrame(()=>{D.current=!1})}),T=V(H=>{switch(o.actions.setIsTyping(!0),H.key){case de.Enter:if(o.state.comboboxState!==ie.Open||D.current)return;if(H.preventDefault(),H.stopPropagation(),o.selectors.activeOptionIndex(o.state)===null){o.actions.closeCombobox();return}o.actions.selectActiveOption(),a.mode===Qe.Single&&o.actions.closeCombobox();break;case de.ArrowDown:return H.preventDefault(),H.stopPropagation(),Fe(o.state.comboboxState,{[ie.Open]:()=>o.actions.goToOption({focus:se.Next}),[ie.Closed]:()=>o.actions.openCombobox()});case de.ArrowUp:return H.preventDefault(),H.stopPropagation(),Fe(o.state.comboboxState,{[ie.Open]:()=>o.actions.goToOption({focus:se.Previous}),[ie.Closed]:()=>{Se.flushSync(()=>o.actions.openCombobox()),a.value||o.actions.goToOption({focus:se.Last})}});case de.Home:if(H.shiftKey)break;return H.preventDefault(),H.stopPropagation(),o.actions.goToOption({focus:se.First});case de.PageUp:return H.preventDefault(),H.stopPropagation(),o.actions.goToOption({focus:se.First});case de.End:if(H.shiftKey)break;return H.preventDefault(),H.stopPropagation(),o.actions.goToOption({focus:se.Last});case de.PageDown:return H.preventDefault(),H.stopPropagation(),o.actions.goToOption({focus:se.Last});case de.Escape:return o.state.comboboxState!==ie.Open?void 0:(H.preventDefault(),o.state.optionsElement&&!a.optionsPropsRef.current.static&&H.stopPropagation(),a.mode===Qe.Single&&a.value===null&&C(),o.actions.closeCombobox());case de.Tab:if(o.state.comboboxState!==ie.Open)return;a.mode===Qe.Single&&o.state.activationTrigger!==jt.Focus&&o.actions.selectActiveOption(),o.actions.closeCombobox();break}}),Y=V(H=>{u==null||u(H),a.mode===Qe.Single&&H.target.value===""&&C(),o.actions.openCombobox()}),W=V(H=>{var we,Z,A;let J=(we=H.relatedTarget)!=null?we:lt.find(le=>le!==H.currentTarget);if(!((Z=o.state.optionsElement)!=null&&Z.contains(J))&&!((A=o.state.buttonElement)!=null&&A.contains(J))&&o.state.comboboxState===ie.Open)return H.preventDefault(),a.mode===Qe.Single&&a.value===null&&C(),o.actions.closeCombobox()}),N=V(H=>{var we,Z,A;let J=(we=H.relatedTarget)!=null?we:lt.find(le=>le!==H.currentTarget);(Z=o.state.buttonElement)!=null&&Z.contains(J)||(A=o.state.optionsElement)!=null&&A.contains(J)||a.disabled||a.immediate&&o.state.comboboxState!==ie.Open&&k.microTask(()=>{Se.flushSync(()=>o.actions.openCombobox()),o.actions.setActivationTrigger(jt.Focus)})}),L=Bn(),$=es(),{isFocused:z,focusProps:P}=Ro({autoFocus:m}),{isHovered:q,hoverProps:X}=Ho({isDisabled:p}),G=ye(o,H=>H.optionsElement),Oe=d.useMemo(()=>({open:x===ie.Open,disabled:p,invalid:a.invalid,hover:q,focus:z,autofocus:m}),[a,q,z,m,p,a.invalid]),te=Hn({ref:w,id:l,role:"combobox",type:f,"aria-controls":G==null?void 0:G.id,"aria-expanded":x===ie.Open,"aria-activedescendant":ye(o,o.selectors.activeDescendantId),"aria-labelledby":L,"aria-describedby":$,"aria-autocomplete":"list",defaultValue:(t=(e=n.defaultValue)!=null?e:a.defaultValue!==void 0?c==null?void 0:c(a.defaultValue):null)!=null?t:a.defaultValue,disabled:p||void 0,autoFocus:m,onCompositionStart:_,onCompositionEnd:O,onKeyDown:T,onChange:Y,onFocus:N,onBlur:W},P,X);return Ce()({ourProps:te,theirProps:h,slot:Oe,defaultTag:mm,name:"Combobox.Input"})}let vm="button";function gm(n,r){let e=tr("Combobox.Button"),t=kn("Combobox.Button"),[o,a]=d.useState(null),i=Le(r,a,e.actions.setButtonElement),s=d.useId(),{id:l=`headlessui-combobox-button-${s}`,disabled:u=t.disabled||!1,autoFocus:c=!1,...p}=n,m=ye(e,T=>T.inputElement),f=ws(m),h=V(T=>{switch(T.key){case de.Space:case de.Enter:T.preventDefault(),T.stopPropagation(),e.state.comboboxState===ie.Closed&&Se.flushSync(()=>e.actions.openCombobox()),f();return;case de.ArrowDown:T.preventDefault(),T.stopPropagation(),e.state.comboboxState===ie.Closed&&(Se.flushSync(()=>e.actions.openCombobox()),e.state.dataRef.current.value||e.actions.goToOption({focus:se.First})),f();return;case de.ArrowUp:T.preventDefault(),T.stopPropagation(),e.state.comboboxState===ie.Closed&&(Se.flushSync(()=>e.actions.openCombobox()),e.state.dataRef.current.value||e.actions.goToOption({focus:se.Last})),f();return;case de.Escape:if(e.state.comboboxState!==ie.Open)return;T.preventDefault(),e.state.optionsElement&&!t.optionsPropsRef.current.static&&T.stopPropagation(),Se.flushSync(()=>e.actions.closeCombobox()),f();return;default:return}}),v=V(T=>{T.preventDefault(),!Xi(T.currentTarget)&&(T.button===Ma.Left&&(e.state.comboboxState===ie.Open?e.actions.closeCombobox():e.actions.openCombobox()),f())}),g=Bn([l]),{isFocusVisible:w,focusProps:y}=Ro({autoFocus:c}),{isHovered:x,hoverProps:E}=Ho({isDisabled:u}),{pressed:k,pressProps:C}=Bi({disabled:u}),[S,D]=ye(e,T=>[T.comboboxState,T.optionsElement]),_=d.useMemo(()=>({open:S===ie.Open,active:k||S===ie.Open,disabled:u,invalid:t.invalid,value:t.value,hover:x,focus:w}),[t,x,w,k,u,S]),O=Hn({ref:i,id:l,type:xs(n,o),tabIndex:-1,"aria-haspopup":"listbox","aria-controls":D==null?void 0:D.id,"aria-expanded":S===ie.Open,"aria-labelledby":g,disabled:u||void 0,autoFocus:c,onMouseDown:v,onKeyDown:h},y,E,C);return Ce()({ourProps:O,theirProps:p,slot:_,defaultTag:vm,name:"Combobox.Button"})}let bm="div",ym=Lt.RenderStrategy|Lt.Static;function wm(n,r){var e,t,o;let a=d.useId(),{id:i=`headlessui-combobox-options-${a}`,hold:s=!1,anchor:l,portal:u=!1,modal:c=!0,transition:p=!1,...m}=n,f=tr("Combobox.Options"),h=kn("Combobox.Options"),v=Zs(l);v&&(u=!0);let[g,w]=nl(v),[y,x]=d.useState(null),E=tl(),k=Le(r,v?g:null,f.actions.setOptionsElement,x),[C,S,D,_,O]=ye(f,oe=>[oe.comboboxState,oe.inputElement,oe.buttonElement,oe.optionsElement,oe.activationTrigger]),T=xt(S||D),Y=xt(_),W=En(),[N,L]=aa(p,y,W!==null?(W&Ye.Open)===Ye.Open:C===ie.Open);Xo(N,S,f.actions.closeCombobox);let $=h.__demoMode?!1:c&&C===ie.Open;ra($,Y);let z=h.__demoMode?!1:c&&C===ie.Open;Go(z,{allowed:d.useCallback(()=>[S,D,_],[S,D,_])}),ce(()=>{var oe;h.optionsPropsRef.current.static=(oe=n.static)!=null?oe:!1},[h.optionsPropsRef,n.static]),ce(()=>{h.optionsPropsRef.current.hold=s},[h.optionsPropsRef,s]),Lf(C===ie.Open,{container:_,accept(oe){return oe.getAttribute("role")==="option"?NodeFilter.FILTER_REJECT:oe.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT},walk(oe){oe.setAttribute("role","none")}});let P=Bn([D==null?void 0:D.id]),q=d.useMemo(()=>({open:C===ie.Open,option:void 0}),[C]),X=V(()=>{f.actions.setActivationTrigger(jt.Pointer)}),G=V(oe=>{oe.preventDefault(),f.actions.setActivationTrigger(jt.Pointer)}),Oe=Hn(v?E():{},{"aria-labelledby":P,role:"listbox","aria-multiselectable":h.mode===Qe.Multi?!0:void 0,id:i,ref:k,style:{...m.style,...w,"--input-width":Ko(S,!0).width,"--button-width":Ko(D,!0).width},onWheel:O===jt.Pointer?void 0:X,onMouseDown:G,...oa(L)}),te=N&&C===ie.Closed,H=jr(te,(e=h.virtual)==null?void 0:e.options),we=jr(te,h.value),Z=V(oe=>h.compare(we,oe)),A=d.useMemo(()=>{if(!h.virtual)return h;if(H===void 0)throw new Error("Missing `options` in virtual mode");return H!==h.virtual.options?{...h,virtual:{...h.virtual,options:H}}:h},[h,H,(t=h.virtual)==null?void 0:t.options]);h.virtual&&Object.assign(m,{children:d.createElement(nr.Provider,{value:A},d.createElement(dm,{slot:q},m.children))});let J=Ce(),le=d.useMemo(()=>h.mode===Qe.Multi?h:{...h,isSelected:Z},[h,Z]);return d.createElement(Ta,{enabled:u?n.static||N:!1,ownerDocument:T},d.createElement(nr.Provider,{value:le},J({ourProps:Oe,theirProps:{...m,children:d.createElement(Bp,{freeze:te},typeof m.children=="function"?(o=m.children)==null?void 0:o.call(m,q):m.children)},slot:q,defaultTag:bm,features:ym,visible:N,name:"Combobox.Options"})))}let xm="div";function Dm(n,r){var e,t,o;let a=kn("Combobox.Option"),i=tr("Combobox.Option"),s=d.useId(),{id:l=`headlessui-combobox-option-${s}`,value:u,disabled:c=(o=(t=(e=a.virtual)==null?void 0:e.disabled)==null?void 0:t.call(e,u))!=null?o:!1,order:p=null,...m}=n,[f]=ye(i,L=>[L.inputElement]),h=ws(f),v=ye(i,d.useCallback(L=>i.selectors.isActive(L,u,l),[u,l])),g=a.isSelected(u),w=d.useRef(null),y=yt({disabled:c,value:u,domRef:w,order:p}),x=d.useContext(Sl),E=Le(r,w,x?x.measureElement:null),k=V(()=>{i.actions.setIsTyping(!1),i.actions.onChange(u)});ce(()=>i.actions.registerOption(l,y),[y,l]);let C=ye(i,d.useCallback(L=>i.selectors.shouldScrollIntoView(L,u,l),[u,l]));ce(()=>{if(C)return et().requestAnimationFrame(()=>{var L,$;($=(L=w.current)==null?void 0:L.scrollIntoView)==null||$.call(L,{block:"nearest"})})},[C,w]);let S=V(L=>{L.preventDefault(),L.button===Ma.Left&&(c||(k(),gs()||requestAnimationFrame(()=>h()),a.mode===Qe.Single&&i.actions.closeCombobox()))}),D=V(()=>{if(c)return i.actions.goToOption({focus:se.Nothing});let L=a.calculateIndex(u);i.actions.goToOption({focus:se.Specific,idx:L})}),_=Es(),O=V(L=>_.update(L)),T=V(L=>{if(!_.wasMoved(L)||c||v)return;let $=a.calculateIndex(u);i.actions.goToOption({focus:se.Specific,idx:$},jt.Pointer)}),Y=V(L=>{_.wasMoved(L)&&(c||v&&(a.optionsPropsRef.current.hold||i.actions.goToOption({focus:se.Nothing})))}),W=d.useMemo(()=>({active:v,focus:v,selected:g,disabled:c}),[v,g,c]),N={id:l,ref:E,role:"option",tabIndex:c===!0?void 0:-1,"aria-disabled":c===!0?!0:void 0,"aria-selected":g,disabled:void 0,onMouseDown:S,onFocus:D,onPointerEnter:O,onMouseEnter:O,onPointerMove:T,onMouseMove:T,onPointerLeave:Y,onMouseLeave:Y};return Ce()({ourProps:N,theirProps:m,slot:W,defaultTag:xm,name:"Combobox.Option"})}let Em=De(pm),km=De(gm),Cl=De(hm),Sm=Mr,_l=De(wm),Ol=De(Dm),Cm=Object.assign(Em,{Input:Cl,Button:km,Label:Sm,Options:_l,Option:Ol});function _m(n,r=typeof document<"u"?document.defaultView:null,e){let t=vn(n,"escape");na(r,"keydown",o=>{t&&(o.defaultPrevented||o.key===de.Escape&&e(o))})}function Om(){var n;let[r]=d.useState(()=>typeof window<"u"&&typeof window.matchMedia=="function"?window.matchMedia("(pointer: coarse)"):null),[e,t]=d.useState((n=r==null?void 0:r.matches)!=null?n:!1);return ce(()=>{if(!r)return;function o(a){t(a.matches)}return r.addEventListener("change",o),()=>r.removeEventListener("change",o)},[r]),e}function Mm({defaultContainers:n=[],portals:r,mainTreeNode:e}={}){let t=xt(e),o=V(()=>{var a,i;let s=[];for(let l of n)l!==null&&(l instanceof HTMLElement?s.push(l):"current"in l&&l.current instanceof HTMLElement&&s.push(l.current));if(r!=null&&r.current)for(let l of r.current)s.push(l);for(let l of(a=t==null?void 0:t.querySelectorAll("html > *, body > *"))!=null?a:[])l!==document.body&&l!==document.head&&l instanceof HTMLElement&&l.id!=="headlessui-portal-root"&&(e&&(l.contains(e)||l.contains((i=e==null?void 0:e.getRootNode())==null?void 0:i.host))||s.some(u=>l.contains(u))||s.push(l));return s});return{resolveContainers:o,contains:V(a=>o().some(i=>i.contains(a)))}}let Ml=d.createContext(null);function Pl({children:n,node:r}){let[e,t]=d.useState(null),o=Tl(r??e);return d.createElement(Ml.Provider,{value:o},n,o===null&&d.createElement(Rn,{features:mn.Hidden,ref:a=>{var i,s;if(a){for(let l of(s=(i=Gt(a))==null?void 0:i.querySelectorAll("html > *, body > *"))!=null?s:[])if(l!==document.body&&l!==document.head&&l instanceof HTMLElement&&l!=null&&l.contains(a)){t(l);break}}}}))}function Tl(n=null){var r;return(r=d.useContext(Ml))!=null?r:n}function Ia(){let n=d.useRef(!1);return ce(()=>(n.current=!0,()=>{n.current=!1}),[]),n}var rr=(n=>(n[n.Forwards=0]="Forwards",n[n.Backwards=1]="Backwards",n))(rr||{});function Pm(){let n=d.useRef(0);return bs(!0,"keydown",r=>{r.key==="Tab"&&(n.current=r.shiftKey?1:0)},!0),n}function Nl(n){if(!n)return new Set;if(typeof n=="function")return new Set(n());let r=new Set;for(let e of n.current)e.current instanceof HTMLElement&&r.add(e.current);return r}let Tm="div";var tn=(n=>(n[n.None=0]="None",n[n.InitialFocus=1]="InitialFocus",n[n.TabLock=2]="TabLock",n[n.FocusLock=4]="FocusLock",n[n.RestoreFocus=8]="RestoreFocus",n[n.AutoFocus=16]="AutoFocus",n))(tn||{});function Nm(n,r){let e=d.useRef(null),t=Le(e,r),{initialFocus:o,initialFocusFallback:a,containers:i,features:s=15,...l}=n;er()||(s=0);let u=xt(e);$m(s,{ownerDocument:u});let c=Am(s,{ownerDocument:u,container:e,initialFocus:o,initialFocusFallback:a});Ym(s,{ownerDocument:u,container:e,containers:i,previousActiveElement:c});let p=Pm(),m=V(y=>{let x=e.current;x&&(E=>E())(()=>{Fe(p.current,{[rr.Forwards]:()=>{gn(x,tt.First,{skipElements:[y.relatedTarget,a]})},[rr.Backwards]:()=>{gn(x,tt.Last,{skipElements:[y.relatedTarget,a]})}})})}),f=vn(!!(s&2),"focus-trap#tab-lock"),h=Ft(),v=d.useRef(!1),g={ref:t,onKeyDown(y){y.key=="Tab"&&(v.current=!0,h.requestAnimationFrame(()=>{v.current=!1}))},onBlur(y){if(!(s&4))return;let x=Nl(i);e.current instanceof HTMLElement&&x.add(e.current);let E=y.relatedTarget;E instanceof HTMLElement&&E.dataset.headlessuiFocusGuard!=="true"&&(Il(x,E)||(v.current?gn(e.current,Fe(p.current,{[rr.Forwards]:()=>tt.Next,[rr.Backwards]:()=>tt.Previous})|tt.WrapAround,{relativeTo:y.target}):y.target instanceof HTMLElement&&wt(y.target)))}},w=Ce();return d.createElement(d.Fragment,null,f&&d.createElement(Rn,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:m,features:mn.Focusable}),w({ourProps:g,theirProps:l,defaultTag:Tm,name:"FocusTrap"}),f&&d.createElement(Rn,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:m,features:mn.Focusable}))}let Im=De(Nm),Fm=Object.assign(Im,{features:tn});function Lm(n=!0){let r=d.useRef(lt.slice());return Un(([e],[t])=>{t===!0&&e===!1&&kr(()=>{r.current.splice(0)}),t===!1&&e===!0&&(r.current=lt.slice())},[n,lt,r]),V(()=>{var e;return(e=r.current.find(t=>t!=null&&t.isConnected))!=null?e:null})}function $m(n,{ownerDocument:r}){let e=!!(n&8),t=Lm(e);Un(()=>{e||(r==null?void 0:r.activeElement)===(r==null?void 0:r.body)&&wt(t())},[e]),hl(()=>{e&&wt(t())})}function Am(n,{ownerDocument:r,container:e,initialFocus:t,initialFocusFallback:o}){let a=d.useRef(null),i=vn(!!(n&1),"focus-trap#initial-focus"),s=Ia();return Un(()=>{if(n===0)return;if(!i){o!=null&&o.current&&wt(o.current);return}let l=e.current;l&&kr(()=>{if(!s.current)return;let u=r==null?void 0:r.activeElement;if(t!=null&&t.current){if((t==null?void 0:t.current)===u){a.current=u;return}}else if(l.contains(u)){a.current=u;return}if(t!=null&&t.current)wt(t.current);else{if(n&16){if(gn(l,tt.First|tt.AutoFocus)!==Jo.Error)return}else if(gn(l,tt.First)!==Jo.Error)return;if(o!=null&&o.current&&(wt(o.current),(r==null?void 0:r.activeElement)===o.current))return;console.warn("There are no focusable elements inside the <FocusTrap />")}a.current=r==null?void 0:r.activeElement})},[o,i,n]),a}function Ym(n,{ownerDocument:r,container:e,containers:t,previousActiveElement:o}){let a=Ia(),i=!!(n&4);na(r==null?void 0:r.defaultView,"focus",s=>{if(!i||!a.current)return;let l=Nl(t);e.current instanceof HTMLElement&&l.add(e.current);let u=o.current;if(!u)return;let c=s.target;c&&c instanceof HTMLElement?Il(l,c)?(o.current=c,wt(c)):(s.preventDefault(),s.stopPropagation(),wt(u)):wt(o.current)},!0)}function Il(n,r){for(let e of n)if(e.contains(r))return!0;return!1}function Fl(n){var r;return!!(n.enter||n.enterFrom||n.enterTo||n.leave||n.leaveFrom||n.leaveTo)||((r=n.as)!=null?r:$l)!==d.Fragment||d.Children.count(n.children)===1}let Br=d.createContext(null);Br.displayName="TransitionContext";var Wm=(n=>(n.Visible="visible",n.Hidden="hidden",n))(Wm||{});function jm(){let n=d.useContext(Br);if(n===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return n}function Hm(){let n=d.useContext(Vr);if(n===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return n}let Vr=d.createContext(null);Vr.displayName="NestingContext";function zr(n){return"children"in n?zr(n.children):n.current.filter(({el:r})=>r.current!==null).filter(({state:r})=>r==="visible").length>0}function Ll(n,r){let e=yt(n),t=d.useRef([]),o=Ia(),a=Ft(),i=V((f,h=$t.Hidden)=>{let v=t.current.findIndex(({el:g})=>g===f);v!==-1&&(Fe(h,{[$t.Unmount](){t.current.splice(v,1)},[$t.Hidden](){t.current[v].state="hidden"}}),a.microTask(()=>{var g;!zr(t)&&o.current&&((g=e.current)==null||g.call(e))}))}),s=V(f=>{let h=t.current.find(({el:v})=>v===f);return h?h.state!=="visible"&&(h.state="visible"):t.current.push({el:f,state:"visible"}),()=>i(f,$t.Unmount)}),l=d.useRef([]),u=d.useRef(Promise.resolve()),c=d.useRef({enter:[],leave:[]}),p=V((f,h,v)=>{l.current.splice(0),r&&(r.chains.current[h]=r.chains.current[h].filter(([g])=>g!==f)),r==null||r.chains.current[h].push([f,new Promise(g=>{l.current.push(g)})]),r==null||r.chains.current[h].push([f,new Promise(g=>{Promise.all(c.current[h].map(([w,y])=>y)).then(()=>g())})]),h==="enter"?u.current=u.current.then(()=>r==null?void 0:r.wait.current).then(()=>v(h)):v(h)}),m=V((f,h,v)=>{Promise.all(c.current[h].splice(0).map(([g,w])=>w)).then(()=>{var g;(g=l.current.shift())==null||g()}).then(()=>v(h))});return d.useMemo(()=>({children:t,register:s,unregister:i,onStart:p,onStop:m,wait:u,chains:c}),[s,i,t,p,m,c,u])}let $l=d.Fragment,Al=Lt.RenderStrategy;function Rm(n,r){var e,t;let{transition:o=!0,beforeEnter:a,afterEnter:i,beforeLeave:s,afterLeave:l,enter:u,enterFrom:c,enterTo:p,entered:m,leave:f,leaveFrom:h,leaveTo:v,...g}=n,[w,y]=d.useState(null),x=d.useRef(null),E=Fl(n),k=Le(...E?[x,r,y]:r===null?[]:[r]),C=(e=g.unmount)==null||e?$t.Unmount:$t.Hidden,{show:S,appear:D,initial:_}=jm(),[O,T]=d.useState(S?"visible":"hidden"),Y=Hm(),{register:W,unregister:N}=Y;ce(()=>W(x),[W,x]),ce(()=>{if(C===$t.Hidden&&x.current){if(S&&O!=="visible"){T("visible");return}return Fe(O,{hidden:()=>N(x),visible:()=>W(x)})}},[O,x,W,N,S,C]);let L=er();ce(()=>{if(E&&L&&O==="visible"&&x.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[x,O,L,E]);let $=_&&!D,z=D&&S&&_,P=d.useRef(!1),q=Ll(()=>{P.current||(T("hidden"),N(x))},Y),X=V(A=>{P.current=!0;let J=A?"enter":"leave";q.onStart(x,J,le=>{le==="enter"?a==null||a():le==="leave"&&(s==null||s())})}),G=V(A=>{let J=A?"enter":"leave";P.current=!1,q.onStop(x,J,le=>{le==="enter"?i==null||i():le==="leave"&&(l==null||l())}),J==="leave"&&!zr(q)&&(T("hidden"),N(x))});d.useEffect(()=>{E&&o||(X(S),G(S))},[S,E,o]);let Oe=!(!o||!E||!L||$),[,te]=aa(Oe,w,S,{start:X,end:G}),H=At({ref:k,className:((t=Vo(g.className,z&&u,z&&c,te.enter&&u,te.enter&&te.closed&&c,te.enter&&!te.closed&&p,te.leave&&f,te.leave&&!te.closed&&h,te.leave&&te.closed&&v,!te.transition&&S&&m))==null?void 0:t.trim())||void 0,...oa(te)}),we=0;O==="visible"&&(we|=Ye.Open),O==="hidden"&&(we|=Ye.Closed),S&&O==="hidden"&&(we|=Ye.Opening),!S&&O==="visible"&&(we|=Ye.Closing);let Z=Ce();return d.createElement(Vr.Provider,{value:q},d.createElement(Ea,{value:we},Z({ourProps:H,theirProps:g,defaultTag:$l,features:Al,visible:O==="visible",name:"Transition.Child"})))}function Bm(n,r){let{show:e,appear:t=!1,unmount:o=!0,...a}=n,i=d.useRef(null),s=Fl(n),l=Le(...s?[i,r]:r===null?[]:[r]);er();let u=En();if(e===void 0&&u!==null&&(e=(u&Ye.Open)===Ye.Open),e===void 0)throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[c,p]=d.useState(e?"visible":"hidden"),m=Ll(()=>{e||p("hidden")}),[f,h]=d.useState(!0),v=d.useRef([e]);ce(()=>{f!==!1&&v.current[v.current.length-1]!==e&&(v.current.push(e),h(!1))},[v,e]);let g=d.useMemo(()=>({show:e,appear:t,initial:f}),[e,t,f]);ce(()=>{e?p("visible"):!zr(m)&&i.current!==null&&p("hidden")},[e,m]);let w={unmount:o},y=V(()=>{var k;f&&h(!1),(k=n.beforeEnter)==null||k.call(n)}),x=V(()=>{var k;f&&h(!1),(k=n.beforeLeave)==null||k.call(n)}),E=Ce();return d.createElement(Vr.Provider,{value:m},d.createElement(Br.Provider,{value:g},E({ourProps:{...w,as:d.Fragment,children:d.createElement(Yl,{ref:l,...w,...a,beforeEnter:y,beforeLeave:x})},theirProps:{},defaultTag:d.Fragment,features:Al,visible:c==="visible",name:"Transition"})))}function Vm(n,r){let e=d.useContext(Br)!==null,t=En()!==null;return d.createElement(d.Fragment,null,!e&&t?d.createElement(Fa,{ref:r,...n}):d.createElement(Yl,{ref:r,...n}))}let Fa=De(Bm),Yl=De(Rm),La=De(Vm),Wl=Object.assign(Fa,{Child:La,Root:Fa});var zm=(n=>(n[n.Open=0]="Open",n[n.Closed=1]="Closed",n))(zm||{}),Um=(n=>(n[n.SetTitleId=0]="SetTitleId",n))(Um||{});let Qm={0(n,r){return n.titleId===r.id?n:{...n,titleId:r.id}}},$a=d.createContext(null);$a.displayName="DialogContext";function Ur(n){let r=d.useContext($a);if(r===null){let e=new Error(`<${n} /> is missing a parent <Dialog /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(e,Ur),e}return r}function Km(n,r){return Fe(r.type,Qm,n,r)}let jl=De(function(n,r){let e=d.useId(),{id:t=`headlessui-dialog-${e}`,open:o,onClose:a,initialFocus:i,role:s="dialog",autoFocus:l=!0,__demoMode:u=!1,unmount:c=!1,...p}=n,m=d.useRef(!1);s=function(){return s==="dialog"||s==="alertdialog"?s:(m.current||(m.current=!0,console.warn(`Invalid role [${s}] passed to <Dialog />. Only \`dialog\` and and \`alertdialog\` are supported. Using \`dialog\` instead.`)),"dialog")}();let f=En();o===void 0&&f!==null&&(o=(f&Ye.Open)===Ye.Open);let h=d.useRef(null),v=Le(h,r),g=xt(h),w=o?0:1,[y,x]=d.useReducer(Km,{titleId:null,descriptionId:null,panelRef:d.createRef()}),E=V(()=>a(!1)),k=V(G=>x({type:0,id:G})),C=er()?w===0:!1,[S,D]=am(),_={get current(){var G;return(G=y.panelRef.current)!=null?G:h.current}},O=Tl(),{resolveContainers:T}=Mm({mainTreeNode:O,portals:S,defaultContainers:[_]}),Y=f!==null?(f&Ye.Closing)===Ye.Closing:!1;Go(u||Y?!1:C,{allowed:V(()=>{var G,Oe;return[(Oe=(G=h.current)==null?void 0:G.closest("[data-headlessui-portal]"))!=null?Oe:null]}),disallowed:V(()=>{var G;return[(G=O==null?void 0:O.closest("body > *:not(#headlessui-portal-root)"))!=null?G:null]})}),ta(C,T,G=>{G.preventDefault(),E()}),_m(C,g==null?void 0:g.defaultView,G=>{G.preventDefault(),G.stopPropagation(),document.activeElement&&"blur"in document.activeElement&&typeof document.activeElement.blur=="function"&&document.activeElement.blur(),E()}),ra(u||Y?!1:C,g,T),Xo(C,h,E);let[W,N]=Ud(),L=d.useMemo(()=>[{dialogState:w,close:E,setTitleId:k,unmount:c},y],[w,y,E,k,c]),$=d.useMemo(()=>({open:w===0}),[w]),z={ref:v,id:t,role:s,tabIndex:-1,"aria-modal":u?void 0:w===0?!0:void 0,"aria-labelledby":y.titleId,"aria-describedby":W,unmount:c},P=!Om(),q=tn.None;C&&!u&&(q|=tn.RestoreFocus,q|=tn.TabLock,l&&(q|=tn.AutoFocus),P&&(q|=tn.InitialFocus));let X=Ce();return d.createElement(Vp,null,d.createElement(gl,{force:!0},d.createElement(Ta,null,d.createElement($a.Provider,{value:L},d.createElement(wl,{target:h},d.createElement(gl,{force:!1},d.createElement(N,{slot:$},d.createElement(D,null,d.createElement(Fm,{initialFocus:i,initialFocusFallback:h,containers:T,features:q},d.createElement(ef,{value:E},X({ourProps:z,theirProps:p,slot:$,defaultTag:qm,features:Gm,visible:w===0,name:"Dialog"})))))))))))}),qm="div",Gm=Lt.RenderStrategy|Lt.Static;function Xm(n,r){let{transition:e=!1,open:t,...o}=n,a=En(),i=n.hasOwnProperty("open")||a!==null,s=n.hasOwnProperty("onClose");if(!i&&!s)throw new Error("You have to provide an `open` and an `onClose` prop to the `Dialog` component.");if(!i)throw new Error("You provided an `onClose` prop to the `Dialog`, but forgot an `open` prop.");if(!s)throw new Error("You provided an `open` prop to the `Dialog`, but forgot an `onClose` prop.");if(!a&&typeof n.open!="boolean")throw new Error(`You provided an \`open\` prop to the \`Dialog\`, but the value is not a boolean. Received: ${n.open}`);if(typeof n.onClose!="function")throw new Error(`You provided an \`onClose\` prop to the \`Dialog\`, but the value is not a function. Received: ${n.onClose}`);return(t!==void 0||e)&&!o.static?d.createElement(Pl,null,d.createElement(Wl,{show:t,transition:e,unmount:o.unmount},d.createElement(jl,{ref:r,...o}))):d.createElement(Pl,null,d.createElement(jl,{ref:r,open:t,...o}))}let Jm="div";function Zm(n,r){let e=d.useId(),{id:t=`headlessui-dialog-panel-${e}`,transition:o=!1,...a}=n,[{dialogState:i,unmount:s},l]=Ur("Dialog.Panel"),u=Le(r,l.panelRef),c=d.useMemo(()=>({open:i===0}),[i]),p=V(g=>{g.stopPropagation()}),m={ref:u,id:t,onClick:p},f=o?La:d.Fragment,h=o?{unmount:s}:{},v=Ce();return d.createElement(f,{...h},v({ourProps:m,theirProps:a,slot:c,defaultTag:Jm,name:"Dialog.Panel"}))}let eh="div";function th(n,r){let{transition:e=!1,...t}=n,[{dialogState:o,unmount:a}]=Ur("Dialog.Backdrop"),i=d.useMemo(()=>({open:o===0}),[o]),s={ref:r,"aria-hidden":!0},l=e?La:d.Fragment,u=e?{unmount:a}:{},c=Ce();return d.createElement(l,{...u},c({ourProps:s,theirProps:t,slot:i,defaultTag:eh,name:"Dialog.Backdrop"}))}let nh="h2";function rh(n,r){let e=d.useId(),{id:t=`headlessui-dialog-title-${e}`,...o}=n,[{dialogState:a,setTitleId:i}]=Ur("Dialog.Title"),s=Le(r);d.useEffect(()=>(i(t),()=>i(null)),[t,i]);let l=d.useMemo(()=>({open:a===0}),[a]),u={ref:s,id:t};return Ce()({ourProps:u,theirProps:o,slot:l,defaultTag:nh,name:"Dialog.Title"})}let oh=De(Xm),Hl=De(Zm);De(th);let Rl=De(rh),or=Object.assign(oh,{Panel:Hl,Title:Rl,Description:ts});function ah(n,r){let e=d.useRef({left:0,top:0});if(ce(()=>{if(!r)return;let o=r.getBoundingClientRect();o&&(e.current=o)},[n,r]),r==null||!n||r===document.activeElement)return!1;let t=r.getBoundingClientRect();return t.top!==e.current.top||t.left!==e.current.left}let Bl=/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g;function Vl(n){var r,e;let t=(r=n.innerText)!=null?r:"",o=n.cloneNode(!0);if(!(o instanceof HTMLElement))return t;let a=!1;for(let s of o.querySelectorAll('[hidden],[aria-hidden],[role="img"]'))s.remove(),a=!0;let i=a?(e=o.innerText)!=null?e:"":t;return Bl.test(i)&&(i=i.replace(Bl,"")),i}function ih(n){let r=n.getAttribute("aria-label");if(typeof r=="string")return r.trim();let e=n.getAttribute("aria-labelledby");if(e){let t=e.split(" ").map(o=>{let a=document.getElementById(o);if(a){let i=a.getAttribute("aria-label");return typeof i=="string"?i.trim():Vl(a).trim()}return null}).filter(Boolean);if(t.length>0)return t.join(", ")}return Vl(n).trim()}function sh(n){let r=d.useRef(""),e=d.useRef("");return V(()=>{let t=n.current;if(!t)return"";let o=t.innerText;if(r.current===o)return e.current;let a=ih(t).trim().toLowerCase();return r.current=o,e.current=a,a})}var lh=Object.defineProperty,uh=(n,r,e)=>r in n?lh(n,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[r]=e,zl=(n,r,e)=>(uh(n,typeof r!="symbol"?r+"":r,e),e),je=(n=>(n[n.Open=0]="Open",n[n.Closed=1]="Closed",n))(je||{}),ut=(n=>(n[n.Single=0]="Single",n[n.Multi=1]="Multi",n))(ut||{}),Aa=(n=>(n[n.Pointer=0]="Pointer",n[n.Other=1]="Other",n))(Aa||{}),Ul=(n=>(n[n.OpenListbox=0]="OpenListbox",n[n.CloseListbox=1]="CloseListbox",n[n.GoToOption=2]="GoToOption",n[n.Search=3]="Search",n[n.ClearSearch=4]="ClearSearch",n[n.RegisterOptions=5]="RegisterOptions",n[n.UnregisterOptions=6]="UnregisterOptions",n[n.SetButtonElement=7]="SetButtonElement",n[n.SetOptionsElement=8]="SetOptionsElement",n[n.SortOptions=9]="SortOptions",n))(Ul||{});function Ql(n,r=e=>e){let e=n.activeOptionIndex!==null?n.options[n.activeOptionIndex]:null,t=ea(r(n.options.slice()),a=>a.dataRef.current.domRef.current),o=e?t.indexOf(e):null;return o===-1&&(o=null),{options:t,activeOptionIndex:o}}let ch={1(n){return n.dataRef.current.disabled||n.listboxState===1?n:{...n,activeOptionIndex:null,listboxState:1,__demoMode:!1}},0(n){if(n.dataRef.current.disabled||n.listboxState===0)return n;let r=n.activeOptionIndex,{isSelected:e}=n.dataRef.current,t=n.options.findIndex(o=>e(o.dataRef.current.value));return t!==-1&&(r=t),{...n,listboxState:0,activeOptionIndex:r,__demoMode:!1}},2(n,r){var e,t,o,a,i;if(n.dataRef.current.disabled||n.listboxState===1)return n;let s={...n,searchQuery:"",activationTrigger:(e=r.trigger)!=null?e:1,__demoMode:!1};if(r.focus===se.Nothing)return{...s,activeOptionIndex:null};if(r.focus===se.Specific)return{...s,activeOptionIndex:n.options.findIndex(c=>c.id===r.id)};if(r.focus===se.Previous){let c=n.activeOptionIndex;if(c!==null){let p=n.options[c].dataRef.current.domRef,m=Zn(r,{resolveItems:()=>n.options,resolveActiveIndex:()=>n.activeOptionIndex,resolveId:f=>f.id,resolveDisabled:f=>f.dataRef.current.disabled});if(m!==null){let f=n.options[m].dataRef.current.domRef;if(((t=p.current)==null?void 0:t.previousElementSibling)===f.current||((o=f.current)==null?void 0:o.previousElementSibling)===null)return{...s,activeOptionIndex:m}}}}else if(r.focus===se.Next){let c=n.activeOptionIndex;if(c!==null){let p=n.options[c].dataRef.current.domRef,m=Zn(r,{resolveItems:()=>n.options,resolveActiveIndex:()=>n.activeOptionIndex,resolveId:f=>f.id,resolveDisabled:f=>f.dataRef.current.disabled});if(m!==null){let f=n.options[m].dataRef.current.domRef;if(((a=p.current)==null?void 0:a.nextElementSibling)===f.current||((i=f.current)==null?void 0:i.nextElementSibling)===null)return{...s,activeOptionIndex:m}}}}let l=Ql(n),u=Zn(r,{resolveItems:()=>l.options,resolveActiveIndex:()=>l.activeOptionIndex,resolveId:c=>c.id,resolveDisabled:c=>c.dataRef.current.disabled});return{...s,...l,activeOptionIndex:u}},3:(n,r)=>{if(n.dataRef.current.disabled||n.listboxState===1)return n;let e=n.searchQuery!==""?0:1,t=n.searchQuery+r.value.toLowerCase(),o=(n.activeOptionIndex!==null?n.options.slice(n.activeOptionIndex+e).concat(n.options.slice(0,n.activeOptionIndex+e)):n.options).find(i=>{var s;return!i.dataRef.current.disabled&&((s=i.dataRef.current.textValue)==null?void 0:s.startsWith(t))}),a=o?n.options.indexOf(o):-1;return a===-1||a===n.activeOptionIndex?{...n,searchQuery:t}:{...n,searchQuery:t,activeOptionIndex:a,activationTrigger:1}},4(n){return n.dataRef.current.disabled||n.listboxState===1||n.searchQuery===""?n:{...n,searchQuery:""}},5:(n,r)=>{let e=n.options.concat(r.options),t=n.activeOptionIndex;if(n.activeOptionIndex===null){let{isSelected:o}=n.dataRef.current;if(o){let a=e.findIndex(i=>o==null?void 0:o(i.dataRef.current.value));a!==-1&&(t=a)}}return{...n,options:e,activeOptionIndex:t,pendingShouldSort:!0}},6:(n,r)=>{let e=n.options,t=[],o=new Set(r.options);for(let[a,i]of e.entries())if(o.has(i.id)&&(t.push(a),o.delete(i.id),o.size===0))break;if(t.length>0){e=e.slice();for(let a of t.reverse())e.splice(a,1)}return{...n,options:e,activationTrigger:1}},7:(n,r)=>n.buttonElement===r.element?n:{...n,buttonElement:r.element},8:(n,r)=>n.optionsElement===r.element?n:{...n,optionsElement:r.element},9:n=>n.pendingShouldSort?{...n,...Ql(n),pendingShouldSort:!1}:n};class Ya extends fl{constructor(r){super(r),zl(this,"actions",{onChange:e=>{let{onChange:t,compare:o,mode:a,value:i}=this.state.dataRef.current;return Fe(a,{0:()=>t==null?void 0:t(e),1:()=>{let s=i.slice(),l=s.findIndex(u=>o(u,e));return l===-1?s.push(e):s.splice(l,1),t==null?void 0:t(s)}})},registerOption:Oa(()=>{let e=[],t=new Set;return[(o,a)=>{t.has(a)||(t.add(a),e.push({id:o,dataRef:a}))},()=>(t.clear(),this.send({type:5,options:e.splice(0)}))]}),unregisterOption:Oa(()=>{let e=[];return[t=>e.push(t),()=>{this.send({type:6,options:e.splice(0)})}]}),goToOption:Oa(()=>{let e=null;return[(t,o)=>{e={type:2,...t,trigger:o}},()=>e&&this.send(e)]}),closeListbox:()=>{this.send({type:1})},openListbox:()=>{this.send({type:0})},selectActiveOption:()=>{if(this.state.activeOptionIndex!==null){let{dataRef:e,id:t}=this.state.options[this.state.activeOptionIndex];this.actions.onChange(e.current.value),this.send({type:2,focus:se.Specific,id:t})}},selectOption:e=>{let t=this.state.options.find(o=>o.id===e);t&&this.actions.onChange(t.dataRef.current.value)},search:e=>{this.send({type:3,value:e})},clearSearch:()=>{this.send({type:4})},setButtonElement:e=>{this.send({type:7,element:e})},setOptionsElement:e=>{this.send({type:8,element:e})}}),zl(this,"selectors",{activeDescendantId(e){var t;let o=e.activeOptionIndex,a=e.options;return o===null||(t=a[o])==null?void 0:t.id},isActive(e,t){var o;let a=e.activeOptionIndex,i=e.options;return a!==null?((o=i[a])==null?void 0:o.id)===t:!1},shouldScrollIntoView(e,t){return e.__demoMode||e.listboxState!==0||e.activationTrigger===0?!1:this.isActive(e,t)}}),this.on(5,()=>{requestAnimationFrame(()=>{this.send({type:9})})})}static new({__demoMode:r=!1}={}){return new Ya({dataRef:{current:{}},listboxState:r?0:1,options:[],searchQuery:"",activeOptionIndex:null,activationTrigger:1,buttonElement:null,optionsElement:null,__demoMode:r})}reduce(r,e){return Fe(e.type,ch,r,e)}}const Kl=d.createContext(null);function Wa(n){let r=d.useContext(Kl);if(r===null){let e=new Error(`<${n} /> is missing a parent <Listbox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(e,ql),e}return r}function ql({__demoMode:n=!1}={}){return d.useMemo(()=>Ya.new({__demoMode:n}),[])}let Qr=d.createContext(null);Qr.displayName="ListboxDataContext";function ar(n){let r=d.useContext(Qr);if(r===null){let e=new Error(`<${n} /> is missing a parent <Listbox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(e,ar),e}return r}let dh=d.Fragment;function fh(n,r){let e=Sr(),{value:t,defaultValue:o,form:a,name:i,onChange:s,by:l,invalid:u=!1,disabled:c=e||!1,horizontal:p=!1,multiple:m=!1,__demoMode:f=!1,...h}=n;const v=p?"horizontal":"vertical";let g=Le(r),w=Ui(o),[y=m?[]:void 0,x]=zi(t,s,w),E=ql({__demoMode:f}),k=d.useRef({static:!1,hold:!1}),C=d.useRef(new Map),S=ls(l),D=d.useCallback(X=>Fe(_.mode,{[ut.Multi]:()=>y.some(G=>S(G,X)),[ut.Single]:()=>S(y,X)}),[y]),_=d.useMemo(()=>({value:y,disabled:c,invalid:u,mode:m?ut.Multi:ut.Single,orientation:v,onChange:x,compare:S,isSelected:D,optionsPropsRef:k,listRef:C}),[y,c,u,m,v,x,S,D,k,C]);ce(()=>{E.state.dataRef.current=_},[_]);let O=ye(E,X=>X.listboxState),T=O===je.Open,[Y,W]=ye(E,X=>[X.buttonElement,X.optionsElement]);ta(T,[Y,W],(X,G)=>{E.send({type:Ul.CloseListbox}),hs(G,Zo.Loose)||(X.preventDefault(),Y==null||Y.focus())});let N=d.useMemo(()=>({open:O===je.Open,disabled:c,invalid:u,value:y}),[O,c,u,y]),[L,$]=rs({inherit:!0}),z={ref:g},P=d.useCallback(()=>{if(w!==void 0)return x==null?void 0:x(w)},[x,w]),q=Ce();return d.createElement($,{value:L,props:{htmlFor:Y==null?void 0:Y.id},slot:{open:O===je.Open,disabled:c}},d.createElement(ol,null,d.createElement(Kl.Provider,{value:E},d.createElement(Qr.Provider,{value:_},d.createElement(Ea,{value:Fe(O,{[je.Open]:Ye.Open,[je.Closed]:Ye.Closed})},i!=null&&y!=null&&d.createElement(Gi,{disabled:c,data:{[i]:y},form:a,onReset:P}),q({ourProps:z,theirProps:h,slot:N,defaultTag:dh,name:"Listbox"}))))))}let ph="button";function mh(n,r){let e=d.useId(),t=Uo(),o=ar("Listbox.Button"),a=Wa("Listbox.Button"),{id:i=t||`headlessui-listbox-button-${e}`,disabled:s=o.disabled||!1,autoFocus:l=!1,...u}=n,c=Le(r,el(),a.actions.setButtonElement),p=jp(),m=V(N=>{switch(N.key){case de.Enter:Ad(N.currentTarget);break;case de.Space:case de.ArrowDown:N.preventDefault(),Se.flushSync(()=>a.actions.openListbox()),o.value||a.actions.goToOption({focus:se.First});break;case de.ArrowUp:N.preventDefault(),Se.flushSync(()=>a.actions.openListbox()),o.value||a.actions.goToOption({focus:se.Last});break}}),f=V(N=>{switch(N.key){case de.Space:N.preventDefault();break}}),h=V(N=>{var L;if(N.button===0){if(Xi(N.currentTarget))return N.preventDefault();a.state.listboxState===je.Open?(Se.flushSync(()=>a.actions.closeListbox()),(L=a.state.buttonElement)==null||L.focus({preventScroll:!0})):(N.preventDefault(),a.actions.openListbox())}}),v=V(N=>N.preventDefault()),g=Bn([i]),w=es(),{isFocusVisible:y,focusProps:x}=Ro({autoFocus:l}),{isHovered:E,hoverProps:k}=Ho({isDisabled:s}),{pressed:C,pressProps:S}=Bi({disabled:s}),D=ye(a,N=>N.listboxState),_=d.useMemo(()=>({open:D===je.Open,active:C||D===je.Open,disabled:s,invalid:o.invalid,value:o.value,hover:E,focus:y,autofocus:l}),[D,o.value,s,E,y,C,o.invalid,l]),O=ye(a,N=>N.listboxState===je.Open),[T,Y]=ye(a,N=>[N.buttonElement,N.optionsElement]),W=Hn(p(),{ref:c,id:i,type:xs(n,T),"aria-haspopup":"listbox","aria-controls":Y==null?void 0:Y.id,"aria-expanded":O,"aria-labelledby":g,"aria-describedby":w,disabled:s||void 0,autoFocus:l,onKeyDown:m,onKeyUp:f,onKeyPress:v,onMouseDown:h},x,k,S);return Ce()({ourProps:W,theirProps:u,slot:_,defaultTag:ph,name:"Listbox.Button"})}let Gl=d.createContext(!1),hh="div",vh=Lt.RenderStrategy|Lt.Static;function gh(n,r){let e=d.useId(),{id:t=`headlessui-listbox-options-${e}`,anchor:o,portal:a=!1,modal:i=!0,transition:s=!1,...l}=n,u=Zs(o),[c,p]=d.useState(null);u&&(a=!0);let m=ar("Listbox.Options"),f=Wa("Listbox.Options"),[h,v,g,w]=ye(f,A=>[A.listboxState,A.buttonElement,A.optionsElement,A.__demoMode]),y=xt(v),x=xt(g),E=En(),[k,C]=aa(s,c,E!==null?(E&Ye.Open)===Ye.Open:h===je.Open);Xo(k,v,f.actions.closeListbox);let S=w?!1:i&&h===je.Open;ra(S,x);let D=w?!1:i&&h===je.Open;Go(D,{allowed:d.useCallback(()=>[v,g],[v,g])});let _=h!==je.Open,O=ah(_,v)?!1:k,T=k&&h===je.Closed,Y=jr(T,m.value),W=V(A=>m.compare(Y,A)),N=ye(f,A=>{var J;if(u==null||!((J=u==null?void 0:u.to)!=null&&J.includes("selection")))return null;let le=A.options.findIndex(oe=>W(oe.dataRef.current.value));return le===-1&&(le=0),le}),L=(()=>{if(u==null)return;if(N===null)return{...u,inner:void 0};let A=Array.from(m.listRef.current.values());return{...u,inner:{listRef:{current:A},index:N}}})(),[$,z]=nl(L),P=tl(),q=Le(r,u?$:null,f.actions.setOptionsElement,p),X=Ft();d.useEffect(()=>{var A;let J=g;J&&h===je.Open&&J!==((A=Gt(J))==null?void 0:A.activeElement)&&(J==null||J.focus({preventScroll:!0}))},[h,g]);let G=V(A=>{var J,le;switch(X.dispose(),A.key){case de.Space:if(f.state.searchQuery!=="")return A.preventDefault(),A.stopPropagation(),f.actions.search(A.key);case de.Enter:if(A.preventDefault(),A.stopPropagation(),f.state.activeOptionIndex!==null){let{dataRef:oe}=f.state.options[f.state.activeOptionIndex];f.actions.onChange(oe.current.value)}m.mode===ut.Single&&(Se.flushSync(()=>f.actions.closeListbox()),(J=f.state.buttonElement)==null||J.focus({preventScroll:!0}));break;case Fe(m.orientation,{vertical:de.ArrowDown,horizontal:de.ArrowRight}):return A.preventDefault(),A.stopPropagation(),f.actions.goToOption({focus:se.Next});case Fe(m.orientation,{vertical:de.ArrowUp,horizontal:de.ArrowLeft}):return A.preventDefault(),A.stopPropagation(),f.actions.goToOption({focus:se.Previous});case de.Home:case de.PageUp:return A.preventDefault(),A.stopPropagation(),f.actions.goToOption({focus:se.First});case de.End:case de.PageDown:return A.preventDefault(),A.stopPropagation(),f.actions.goToOption({focus:se.Last});case de.Escape:A.preventDefault(),A.stopPropagation(),Se.flushSync(()=>f.actions.closeListbox()),(le=f.state.buttonElement)==null||le.focus({preventScroll:!0});return;case de.Tab:A.preventDefault(),A.stopPropagation(),Se.flushSync(()=>f.actions.closeListbox()),Ef(f.state.buttonElement,A.shiftKey?tt.Previous:tt.Next);break;default:A.key.length===1&&(f.actions.search(A.key),X.setTimeout(()=>f.actions.clearSearch(),350));break}}),Oe=ye(f,A=>{var J;return(J=A.buttonElement)==null?void 0:J.id}),te=d.useMemo(()=>({open:h===je.Open}),[h]),H=Hn(u?P():{},{id:t,ref:q,"aria-activedescendant":ye(f,f.selectors.activeDescendantId),"aria-multiselectable":m.mode===ut.Multi?!0:void 0,"aria-labelledby":Oe,"aria-orientation":m.orientation,onKeyDown:G,role:"listbox",tabIndex:h===je.Open?0:void 0,style:{...l.style,...z,"--button-width":Ko(v,!0).width},...oa(C)}),we=Ce(),Z=d.useMemo(()=>m.mode===ut.Multi?m:{...m,isSelected:W},[m,W]);return d.createElement(Ta,{enabled:a?n.static||k:!1,ownerDocument:y},d.createElement(Qr.Provider,{value:Z},we({ourProps:H,theirProps:l,slot:te,defaultTag:hh,features:vh,visible:O,name:"Listbox.Options"})))}let bh="div";function yh(n,r){let e=d.useId(),{id:t=`headlessui-listbox-option-${e}`,disabled:o=!1,value:a,...i}=n,s=d.useContext(Gl)===!0,l=ar("Listbox.Option"),u=Wa("Listbox.Option"),c=ye(u,O=>u.selectors.isActive(O,t)),p=l.isSelected(a),m=d.useRef(null),f=sh(m),h=yt({disabled:o,value:a,domRef:m,get textValue(){return f()}}),v=Le(r,m,O=>{O?l.listRef.current.set(t,O):l.listRef.current.delete(t)}),g=ye(u,O=>u.selectors.shouldScrollIntoView(O,t));ce(()=>{if(g)return et().requestAnimationFrame(()=>{var O,T;(T=(O=m.current)==null?void 0:O.scrollIntoView)==null||T.call(O,{block:"nearest"})})},[g,m]),ce(()=>{if(!s)return u.actions.registerOption(t,h),()=>u.actions.unregisterOption(t)},[h,t,s]);let w=V(O=>{var T;if(o)return O.preventDefault();u.actions.onChange(a),l.mode===ut.Single&&(Se.flushSync(()=>u.actions.closeListbox()),(T=u.state.buttonElement)==null||T.focus({preventScroll:!0}))}),y=V(()=>{if(o)return u.actions.goToOption({focus:se.Nothing});u.actions.goToOption({focus:se.Specific,id:t})}),x=Es(),E=V(O=>{x.update(O),!o&&(c||u.actions.goToOption({focus:se.Specific,id:t},Aa.Pointer))}),k=V(O=>{x.wasMoved(O)&&(o||c||u.actions.goToOption({focus:se.Specific,id:t},Aa.Pointer))}),C=V(O=>{x.wasMoved(O)&&(o||c&&u.actions.goToOption({focus:se.Nothing}))}),S=d.useMemo(()=>({active:c,focus:c,selected:p,disabled:o,selectedOption:p&&s}),[c,p,o,s]),D=s?{}:{id:t,ref:v,role:"option",tabIndex:o===!0?void 0:-1,"aria-disabled":o===!0?!0:void 0,"aria-selected":p,disabled:void 0,onClick:w,onFocus:y,onPointerEnter:E,onMouseEnter:E,onPointerMove:k,onMouseMove:k,onPointerLeave:C,onMouseLeave:C},_=Ce();return!p&&s?null:_({ourProps:D,theirProps:i,slot:S,defaultTag:bh,name:"Listbox.Option"})}let wh=d.Fragment;function xh(n,r){let{options:e,placeholder:t,...o}=n,a={ref:Le(r)},i=ar("ListboxSelectedOption"),s=d.useMemo(()=>({}),[]),l=i.value===void 0||i.value===null||i.mode===ut.Multi&&Array.isArray(i.value)&&i.value.length===0,u=Ce();return d.createElement(Gl.Provider,{value:!0},u({ourProps:a,theirProps:{...o,children:d.createElement(d.Fragment,null,t&&l?t:e)},slot:s,defaultTag:wh,name:"ListboxSelectedOption"}))}let Dh=De(fh),Xl=De(mh),Eh=Mr,Jl=De(gh),Zl=De(yh),kh=De(xh),Sh=Object.assign(Dh,{Button:Xl,Label:Eh,Options:Jl,Option:Zl,SelectedOption:kh});var eu={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},tu=d.createContext&&d.createContext(eu),Ch=["attr","size","title"];function _h(n,r){if(n==null)return{};var e=Oh(n,r),t,o;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(n);for(o=0;o<a.length;o++)t=a[o],!(r.indexOf(t)>=0)&&Object.prototype.propertyIsEnumerable.call(n,t)&&(e[t]=n[t])}return e}function Oh(n,r){if(n==null)return{};var e={};for(var t in n)if(Object.prototype.hasOwnProperty.call(n,t)){if(r.indexOf(t)>=0)continue;e[t]=n[t]}return e}function Kr(){return Kr=Object.assign?Object.assign.bind():function(n){for(var r=1;r<arguments.length;r++){var e=arguments[r];for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(n[t]=e[t])}return n},Kr.apply(this,arguments)}function nu(n,r){var e=Object.keys(n);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(n);r&&(t=t.filter(function(o){return Object.getOwnPropertyDescriptor(n,o).enumerable})),e.push.apply(e,t)}return e}function qr(n){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?nu(Object(e),!0).forEach(function(t){Mh(n,t,e[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(e)):nu(Object(e)).forEach(function(t){Object.defineProperty(n,t,Object.getOwnPropertyDescriptor(e,t))})}return n}function Mh(n,r,e){return r=Ph(r),r in n?Object.defineProperty(n,r,{value:e,enumerable:!0,configurable:!0,writable:!0}):n[r]=e,n}function Ph(n){var r=Th(n,"string");return typeof r=="symbol"?r:r+""}function Th(n,r){if(typeof n!="object"||!n)return n;var e=n[Symbol.toPrimitive];if(e!==void 0){var t=e.call(n,r);if(typeof t!="object")return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(n)}function ru(n){return n&&n.map((r,e)=>d.createElement(r.tag,qr({key:e},r.attr),ru(r.child)))}function ir(n){return r=>d.createElement(Nh,Kr({attr:qr({},n.attr)},r),ru(n.child))}function Nh(n){var r=e=>{var{attr:t,size:o,title:a}=n,i=_h(n,Ch),s=o||e.size||"1em",l;return e.className&&(l=e.className),n.className&&(l=(l?l+" ":"")+n.className),d.createElement("svg",Kr({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},e.attr,t,i,{className:l,style:qr(qr({color:n.color||e.color},e.style),n.style),height:s,width:s,xmlns:"http://www.w3.org/2000/svg"}),a&&d.createElement("title",null,a),n.children)};return tu!==void 0?d.createElement(tu.Consumer,null,e=>r(e)):r(eu)}function Ih(n){return ir({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"M6.23 20.23 8 22l10-10L8 2 6.23 3.77 14.46 12z"},child:[]}]})(n)}function ou(n){return ir({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"},child:[]}]})(n)}const Fh=({checked:n,label:r,onChange:e,termImageUrl:t})=>{const[o,a]=d.useState(!1);return M.jsxs(M.Fragment,{children:[M.jsx(Lh,{isOpen:o,setIsOpen:a,termImageUrl:t}),M.jsxs("div",{className:"inline-flex items-center",children:[M.jsxs("label",{className:"relative flex cursor-pointer items-center rounded-full p-3",htmlFor:"check",children:[M.jsx("input",{type:"checkbox",className:"before:content[''] border-blue-gray-200 before:bg-blue-gray-500 peer bg-petnow-grey-primary checked:border-petnow-orange-primary checked:bg-petnow-orange-primary checked:before:bg-petnow-orange-primary relative size-6 cursor-pointer appearance-none rounded-xl border transition-all before:absolute before:top-2/4 before:left-2/4 before:block before:h-12 before:w-12 before:-translate-x-2/4 before:-translate-y-2/4 before:rounded-full before:opacity-0 before:transition-opacity",id:r,checked:n,onChange:i=>{e(i.target.checked)}}),M.jsx("span",{className:"text-petnow-grey-secondary pointer-events-none absolute top-2/4 left-2/4 -translate-x-2/4 -translate-y-2/4 transition peer-checked:text-white",children:M.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4",viewBox:"0 0 20 20",fill:"currentColor",stroke:"currentColor",strokeWidth:"1",children:M.jsx("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})})})]}),r&&M.jsxs("div",{className:"flex items-center",children:[M.jsx("label",{className:"cursor-pointer font-medium",htmlFor:r,children:r}),M.jsx(Ih,{onClick:()=>{a(!0)},className:"text-petnow-grey-tertiary mt-[2.5px] ml-2 cursor-pointer",size:24})]})]})]})},Lh=({isOpen:n,setIsOpen:r,termImageUrl:e})=>M.jsxs(or,{open:n,onClose:()=>r(!1),className:"relative z-50",children:[M.jsx("div",{className:"fixed inset-0 bg-black/30","aria-hidden":"true"}),M.jsx("div",{className:"fixed inset-0 w-screen overflow-y-auto",children:M.jsx("div",{className:"flex min-h-full items-center justify-center p-4",children:M.jsxs(or.Panel,{className:"mx-auto flex max-w-sm flex-col items-center gap-8 rounded-sm bg-white",children:[M.jsx("div",{className:"bg-background-tertiary flex h-[36px] w-full flex-row-reverse items-center",children:M.jsx(ou,{size:20,className:"mr-2",onClick:()=>r(!1)})}),M.jsx("img",{src:e,alt:"약관동의 이미지"}),M.jsx(Pi,{text:"닫기",className:"mb-4 w-[90%] text-base focus:outline-hidden",onClick:()=>r(!1)})]})})})]});var ja=function(n,r){return ja=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])},ja(n,r)},Sn=function(){return Sn=Object.assign||function(n){for(var r,e=1,t=arguments.length;e<t;e++)for(var o in r=arguments[e])Object.prototype.hasOwnProperty.call(r,o)&&(n[o]=r[o]);return n},Sn.apply(this,arguments)};function $h(n,r){var e={};for(var t in n)Object.prototype.hasOwnProperty.call(n,t)&&r.indexOf(t)<0&&(e[t]=n[t]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function"){var o=0;for(t=Object.getOwnPropertySymbols(n);o<t.length;o++)r.indexOf(t[o])<0&&Object.prototype.propertyIsEnumerable.call(n,t[o])&&(e[t[o]]=n[t[o]])}return e}var Ha,au="https://t1.daumcdn.net/mapjsapi/bundle/postcode/prod/postcode.v2.js",Ah=(Ha=null,function(n){return n===void 0&&(n=au),Ha||(Ha=new Promise(function(r,e){var t=document.createElement("script");t.src=n,t.onload=function(){var o;if(!((o=window==null?void 0:window.daum)===null||o===void 0)&&o.Postcode)return r(window.daum.Postcode);e(new Error("Script is loaded successfully, but cannot find Postcode module. Check your scriptURL property."))},t.onerror=function(o){return e(o)},t.id="daum_postcode_script",document.body.appendChild(t)}))}),Yh=d.createElement("p",null,"현재 Daum 우편번호 서비스를 이용할 수 없습니다. 잠시 후 다시 시도해주세요."),Wh={width:"100%",height:400},jh={scriptUrl:au,errorMessage:Yh,autoClose:!0},Hh=function(n){function r(){var e=n!==null&&n.apply(this,arguments)||this;return e.mounted=!1,e.wrap=d.createRef(),e.state={hasError:!1,completed:!1},e.initiate=function(t){if(e.wrap.current){var o=e.props;o.scriptUrl,o.className,o.style;var a=o.defaultQuery,i=o.autoClose;o.errorMessage;var s=o.onComplete,l=o.onClose,u=o.onResize,c=o.onSearch,p=$h(o,["scriptUrl","className","style","defaultQuery","autoClose","errorMessage","onComplete","onClose","onResize","onSearch"]);new t(Sn(Sn({},p),{oncomplete:function(m){s&&s(m),e.setState({completed:!0})},onsearch:c,onresize:u,onclose:l,width:"100%",height:"100%"})).embed(e.wrap.current,{q:a,autoClose:i})}},e.onError=function(t){console.error(t),e.setState({hasError:!0})},e}return function(e,t){function o(){this.constructor=e}ja(e,t),e.prototype=t===null?Object.create(t):(o.prototype=t.prototype,new o)}(r,n),r.prototype.componentDidMount=function(){var e=this.initiate,t=this.onError,o=this.props.scriptUrl;o&&(this.mounted||(Ah(o).then(e).catch(t),this.mounted=!0))},r.prototype.render=function(){var e=this.props,t=e.className,o=e.style,a=e.errorMessage,i=e.autoClose,s=this.state,l=s.hasError,u=s.completed;return i===!0&&u===!0?null:d.createElement("div",{ref:this.wrap,className:t,style:Sn(Sn({},Wh),o)},l&&a)},r.defaultProps=jh,r}(d.Component);const Rh=({label:n,value:r,onFrontChange:e,onBackChange:t,onPostalCodeChange:o,disabled:a})=>{const[i,s]=d.useState(!1),l=p=>{let m=p.address,f="";p.addressType==="R"&&(p.bname!==""&&(f+=p.bname),p.buildingName!==""&&(f+=f!==""?`, ${p.buildingName}`:p.buildingName),m+=f!==""?` (${f})`:""),e(m),o&&o(p.zonecode),s(!1)},u=()=>{s(!0)},c=()=>r.front?r.front:M.jsx("p",{className:"text-petnow-grey-primary",children:"주소를 입력해주세요."});return M.jsxs(M.Fragment,{children:[M.jsx(Bh,{isOpen:i,setIsOpen:s,handleComplete:l}),M.jsxs("div",{className:"text-petnow-grey-tertiary",children:[M.jsx("label",{htmlFor:n,className:"text-sm font-bold text-black",children:n}),M.jsxs("div",{className:"relative flex flex-col",children:[M.jsx("div",{className:`bg-background-secondary placeholder:text-petnow-grey-primary mt-4 h-[60px] w-full cursor-pointer overflow-hidden rounded-xl p-4 text-base whitespace-nowrap focus:outline-hidden ${a&&"opacity-50"}`,onClick:u,children:c()}),M.jsx("input",{disabled:!r.front||a,value:r.back,type:"text",name:n,id:n,placeholder:"상세 주소를 입력해주세요.",className:"bg-background-secondary placeholder:text-petnow-grey-primary mt-4 h-[60px] w-full rounded-xl p-4 text-base focus:outline-hidden disabled:opacity-50",autoComplete:"off",onChange:p=>t(p.target.value)})]})]})]})},Bh=n=>{const{isOpen:r,setIsOpen:e,handleComplete:t}=n;return M.jsx(or,{open:r,onClose:()=>e(!1),className:"relateive z-50",children:M.jsx("div",{className:"fixed inset-0 flex w-screen items-center justify-center",children:M.jsx(or.Panel,{children:M.jsxs("div",{children:[M.jsx("div",{className:"bg-background-tertiary flex h-[36px] w-[100vw] flex-row-reverse items-center px-2",onClick:()=>e(!1),children:M.jsx(ou,{size:24,onClick:()=>e(!1)})}),M.jsx(Hh,{onComplete:t,style:{width:"100vw",height:"calc(100vh - 36px)"}})]})})})})},Vh=n=>{const{isOpen:r,setIsOpen:e}=n;return M.jsx(Wl,{show:r,enter:"transition ease-out duration-200",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"transition-opacity ease-in duration-100",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:M.jsxs(or,{onClose:()=>e(!1),className:"relative z-50 focus:outline-hidden",children:[M.jsx("div",{className:"fixed inset-0 bg-black/40","aria-hidden":!r}),M.jsx("div",{className:"fixed inset-0 flex w-screen items-center justify-center p-4",children:M.jsxs(Hl,{className:"ja-break-all flex w-[90vw] max-w-[300px] flex-col gap-[16px] rounded-[16px] bg-white p-[20px]",children:[M.jsxs("div",{className:"flex flex-col gap-[8px]",children:[n.title&&M.jsx(Rl,{className:"text-[18px] leading-[26px] font-bold break-words break-all whitespace-pre-wrap text-black",children:n.title}),n.image&&M.jsx("img",{src:n.image.url,alt:n.image.alt}),n.description&&n.description!==""&&M.jsx(ts,{className:"text-petnow-grey-tertiary text-[16px] leading-[24px] break-all",children:n.description})]}),M.jsxs("div",{className:"flex flex-col gap-[8px]",children:[M.jsx("button",{className:"bg-petnow-orange-primary sm:hover:bg-petnow-orange-40 w-full cursor-pointer rounded-[12px] py-[12px] text-[14px] leading-[22px] font-bold text-white transition duration-200",onClick:n.confirm.onClick,children:n.confirm.text}),n.cancel&&M.jsx("button",{onClick:()=>e(!1),className:"bg-background-tertiary sm:hover:bg-petnow-grey-90 text-petnow-grey-tertiary w-full cursor-pointer rounded-[12px] py-[12px] text-[14px] leading-[22px] font-bold transition duration-200",children:n.cancel.text})]})]})})]})})};function zh(n){return ir({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M256 294.1L383 167c9.4-9.4 24.6-9.4 33.9 0s9.3 24.6 0 34L273 345c-9.1 9.1-23.7 9.3-33.1.7L95 201.1c-4.7-4.7-7-10.9-7-17s2.3-12.3 7-17c9.4-9.4 24.6-9.4 33.9 0l127.1 127z"},child:[]}]})(n)}function Uh(n){return ir({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M256 217.9L383 345c9.4 9.4 24.6 9.4 33.9 0 9.4-9.4 9.3-24.6 0-34L273 167c-9.1-9.1-23.7-9.3-33.1-.7L95 310.9c-4.7 4.7-7 10.9-7 17s2.3 12.3 7 17c9.4 9.4 24.6 9.4 33.9 0l127.1-127z"},child:[]}]})(n)}const Qh=({title:n,description:r,titleTextClassName:e,descriptionTextClassName:t})=>{const[o,a]=d.useState(!1);return M.jsxs("div",{className:"my-2.5 flex w-full cursor-pointer flex-col justify-center rounded-xl px-4 pt-8 shadow-[0_2px_8px_0_rgba(0,0,0,0.08)] md:rounded-2xl md:pt-10",onClick:()=>a(i=>!i),children:[M.jsxs("div",{className:"flex w-full items-center justify-between px-2 pb-8 transition-all duration-300 md:px-4 md:pb-10",children:[M.jsxs("p",{className:wr("mr-4 text-lg font-medium md:text-xl",e),children:[M.jsx("span",{className:"font-semibold",children:"Q."})," ",n]}),o?M.jsx(Uh,{className:"text-petnow-orange-primary min-w-6",size:24}):M.jsx(zh,{className:"text-petnow-orange-primary min-w-6",size:24})]}),M.jsx("p",{className:wr(`text-petnow-grey-secondary w-full overflow-hidden px-2 text-base leading-6 whitespace-pre-wrap transition-all duration-300 md:px-4 md:text-lg ${o?"max-h-[24rem] pb-8 sm:max-h-60 md:pb-10":"max-h-0"}`,t),children:r})]})},iu=6048e5,Kh=864e5,Gr=6e4,Xr=36e5,qh=1e3,su=Symbol.for("constructDateFrom");function ge(n,r){return typeof n=="function"?n(r):n&&typeof n=="object"&&su in n?n[su](r):n instanceof Date?new n.constructor(r):new Date(r)}function K(n,r){return ge(r||n,n)}function rt(n,r,e){const t=K(n,e==null?void 0:e.in);return isNaN(r)?ge((e==null?void 0:e.in)||n,NaN):(r&&t.setDate(t.getDate()+r),t)}function ot(n,r,e){const t=K(n,e==null?void 0:e.in);if(isNaN(r))return ge(n,NaN);if(!r)return t;const o=t.getDate(),a=ge(n,t.getTime());a.setMonth(t.getMonth()+r+1,0);const i=a.getDate();return o>=i?a:(t.setFullYear(a.getFullYear(),a.getMonth(),o),t)}function lu(n,r,e){return ge(n,+K(n)+r)}function Gh(n,r,e){return lu(n,r*Xr)}let Xh={};function nn(){return Xh}function kt(n,r){var s,l,u,c;const e=nn(),t=(r==null?void 0:r.weekStartsOn)??((l=(s=r==null?void 0:r.locale)==null?void 0:s.options)==null?void 0:l.weekStartsOn)??e.weekStartsOn??((c=(u=e.locale)==null?void 0:u.options)==null?void 0:c.weekStartsOn)??0,o=K(n,r==null?void 0:r.in),a=o.getDay(),i=(a<t?7:0)+a-t;return o.setDate(o.getDate()-i),o.setHours(0,0,0,0),o}function Cn(n,r){return kt(n,{...r,weekStartsOn:1})}function uu(n,r){const e=K(n,r==null?void 0:r.in),t=e.getFullYear(),o=ge(e,0);o.setFullYear(t+1,0,4),o.setHours(0,0,0,0);const a=Cn(o),i=ge(e,0);i.setFullYear(t,0,4),i.setHours(0,0,0,0);const s=Cn(i);return e.getTime()>=a.getTime()?t+1:e.getTime()>=s.getTime()?t:t-1}function Jr(n){const r=K(n),e=new Date(Date.UTC(r.getFullYear(),r.getMonth(),r.getDate(),r.getHours(),r.getMinutes(),r.getSeconds(),r.getMilliseconds()));return e.setUTCFullYear(r.getFullYear()),+n-+e}function St(n,...r){const e=ge.bind(null,r.find(t=>typeof t=="object"));return r.map(e)}function rn(n,r){const e=K(n,r==null?void 0:r.in);return e.setHours(0,0,0,0),e}function _n(n,r,e){const[t,o]=St(e==null?void 0:e.in,n,r),a=rn(t),i=rn(o),s=+a-Jr(a),l=+i-Jr(i);return Math.round((s-l)/Kh)}function Jh(n,r){const e=uu(n,r),t=ge(n,0);return t.setFullYear(e,0,4),t.setHours(0,0,0,0),Cn(t)}function Ra(n,r,e){const t=K(n,e==null?void 0:e.in);return t.setTime(t.getTime()+r*Gr),t}function Ba(n,r,e){return ot(n,r*3,e)}function Zh(n,r,e){return lu(n,r*1e3)}function Zr(n,r,e){return rt(n,r*7,e)}function Ct(n,r,e){return ot(n,r*12,e)}function cu(n,r){let e,t=r==null?void 0:r.in;return n.forEach(o=>{!t&&typeof o=="object"&&(t=ge.bind(null,o));const a=K(o,t);(!e||e<a||isNaN(+a))&&(e=a)}),ge(t,e||NaN)}function du(n,r){let e,t=r==null?void 0:r.in;return n.forEach(o=>{!t&&typeof o=="object"&&(t=ge.bind(null,o));const a=K(o,t);(!e||e>a||isNaN(+a))&&(e=a)}),ge(t,e||NaN)}function ev(n,r,e){const[t,o]=St(e==null?void 0:e.in,n,r);return+rn(t)==+rn(o)}function _t(n){return n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]"}function eo(n){return!(!_t(n)&&typeof n!="number"||isNaN(+K(n)))}function to(n,r,e){const[t,o]=St(e==null?void 0:e.in,n,r),a=t.getFullYear()-o.getFullYear(),i=t.getMonth()-o.getMonth();return a*12+i}function on(n,r){const e=K(n,r==null?void 0:r.in);return Math.trunc(e.getMonth()/3)+1}function no(n,r,e){const[t,o]=St(e==null?void 0:e.in,n,r),a=t.getFullYear()-o.getFullYear(),i=on(t)-on(o);return a*4+i}function ro(n,r,e){const[t,o]=St(e==null?void 0:e.in,n,r);return t.getFullYear()-o.getFullYear()}function tv(n,r,e){const[t,o]=St(e==null?void 0:e.in,n,r),a=fu(t,o),i=Math.abs(_n(t,o));t.setDate(t.getDate()-a*i);const s=+(fu(t,o)===-a),l=a*(i-s);return l===0?0:l}function fu(n,r){const e=n.getFullYear()-r.getFullYear()||n.getMonth()-r.getMonth()||n.getDate()-r.getDate()||n.getHours()-r.getHours()||n.getMinutes()-r.getMinutes()||n.getSeconds()-r.getSeconds()||n.getMilliseconds()-r.getMilliseconds();return e<0?-1:e>0?1:e}function pu(n,r){const e=K(n,r==null?void 0:r.in);return e.setHours(23,59,59,999),e}function mu(n,r){const e=K(n,r==null?void 0:r.in),t=e.getMonth();return e.setFullYear(e.getFullYear(),t+1,0),e.setHours(23,59,59,999),e}function Va(n,r){const e=K(n,r==null?void 0:r.in),t=e.getMonth(),o=t-t%3;return e.setMonth(o,1),e.setHours(0,0,0,0),e}function hu(n,r){const e=K(n,r==null?void 0:r.in);return e.setDate(1),e.setHours(0,0,0,0),e}function vu(n,r){const e=K(n,r==null?void 0:r.in),t=e.getFullYear();return e.setFullYear(t+1,0,0),e.setHours(23,59,59,999),e}function oo(n,r){const e=K(n,r==null?void 0:r.in);return e.setFullYear(e.getFullYear(),0,1),e.setHours(0,0,0,0),e}function nv(n,r){var s,l;const e=nn(),t=e.weekStartsOn??((l=(s=e.locale)==null?void 0:s.options)==null?void 0:l.weekStartsOn)??0,o=K(n,r==null?void 0:r.in),a=o.getDay(),i=(a<t?-7:0)+6-(a-t);return o.setDate(o.getDate()+i),o.setHours(23,59,59,999),o}const rv={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},ov=(n,r,e)=>{let t;const o=rv[n];return typeof o=="string"?t=o:r===1?t=o.one:t=o.other.replace("{{count}}",r.toString()),e!=null&&e.addSuffix?e.comparison&&e.comparison>0?"in "+t:t+" ago":t};function On(n){return(r={})=>{const e=r.width?String(r.width):n.defaultWidth;return n.formats[e]||n.formats[n.defaultWidth]}}const av={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},iv={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},sv={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},lv={date:On({formats:av,defaultWidth:"full"}),time:On({formats:iv,defaultWidth:"full"}),dateTime:On({formats:sv,defaultWidth:"full"})},uv={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},cv=(n,r,e,t)=>uv[n];function ct(n){return(r,e)=>{const t=e!=null&&e.context?String(e.context):"standalone";let o;if(t==="formatting"&&n.formattingValues){const i=n.defaultFormattingWidth||n.defaultWidth,s=e!=null&&e.width?String(e.width):i;o=n.formattingValues[s]||n.formattingValues[i]}else{const i=n.defaultWidth,s=e!=null&&e.width?String(e.width):n.defaultWidth;o=n.values[s]||n.values[i]}const a=n.argumentCallback?n.argumentCallback(r):r;return o[a]}}const dv={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},fv={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},pv={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},mv={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},hv={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},vv={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},gv={ordinalNumber:(n,r)=>{const e=Number(n),t=e%100;if(t>20||t<10)switch(t%10){case 1:return e+"st";case 2:return e+"nd";case 3:return e+"rd"}return e+"th"},era:ct({values:dv,defaultWidth:"wide"}),quarter:ct({values:fv,defaultWidth:"wide",argumentCallback:n=>n-1}),month:ct({values:pv,defaultWidth:"wide"}),day:ct({values:mv,defaultWidth:"wide"}),dayPeriod:ct({values:hv,defaultWidth:"wide",formattingValues:vv,defaultFormattingWidth:"wide"})};function dt(n){return(r,e={})=>{const t=e.width,o=t&&n.matchPatterns[t]||n.matchPatterns[n.defaultMatchWidth],a=r.match(o);if(!a)return null;const i=a[0],s=t&&n.parsePatterns[t]||n.parsePatterns[n.defaultParseWidth],l=Array.isArray(s)?yv(s,p=>p.test(i)):bv(s,p=>p.test(i));let u;u=n.valueCallback?n.valueCallback(l):l,u=e.valueCallback?e.valueCallback(u):u;const c=r.slice(i.length);return{value:u,rest:c}}}function bv(n,r){for(const e in n)if(Object.prototype.hasOwnProperty.call(n,e)&&r(n[e]))return e}function yv(n,r){for(let e=0;e<n.length;e++)if(r(n[e]))return e}function gu(n){return(r,e={})=>{const t=r.match(n.matchPattern);if(!t)return null;const o=t[0],a=r.match(n.parsePattern);if(!a)return null;let i=n.valueCallback?n.valueCallback(a[0]):a[0];i=e.valueCallback?e.valueCallback(i):i;const s=r.slice(o.length);return{value:i,rest:s}}}const wv=/^(\d+)(th|st|nd|rd)?/i,xv=/\d+/i,Dv={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},Ev={any:[/^b/i,/^(a|c)/i]},kv={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Sv={any:[/1/i,/2/i,/3/i,/4/i]},Cv={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},_v={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Ov={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},Mv={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Pv={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},Tv={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},Nv={ordinalNumber:gu({matchPattern:wv,parsePattern:xv,valueCallback:n=>parseInt(n,10)}),era:dt({matchPatterns:Dv,defaultMatchWidth:"wide",parsePatterns:Ev,defaultParseWidth:"any"}),quarter:dt({matchPatterns:kv,defaultMatchWidth:"wide",parsePatterns:Sv,defaultParseWidth:"any",valueCallback:n=>n+1}),month:dt({matchPatterns:Cv,defaultMatchWidth:"wide",parsePatterns:_v,defaultParseWidth:"any"}),day:dt({matchPatterns:Ov,defaultMatchWidth:"wide",parsePatterns:Mv,defaultParseWidth:"any"}),dayPeriod:dt({matchPatterns:Pv,defaultMatchWidth:"any",parsePatterns:Tv,defaultParseWidth:"any"})},bu={code:"en-US",formatDistance:ov,formatLong:lv,formatRelative:cv,localize:gv,match:Nv,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Iv(n,r){const e=K(n,r==null?void 0:r.in);return _n(e,oo(e))+1}function za(n,r){const e=K(n,r==null?void 0:r.in),t=+Cn(e)-+Jh(e);return Math.round(t/iu)+1}function Ua(n,r){var c,p,m,f;const e=K(n,r==null?void 0:r.in),t=e.getFullYear(),o=nn(),a=(r==null?void 0:r.firstWeekContainsDate)??((p=(c=r==null?void 0:r.locale)==null?void 0:c.options)==null?void 0:p.firstWeekContainsDate)??o.firstWeekContainsDate??((f=(m=o.locale)==null?void 0:m.options)==null?void 0:f.firstWeekContainsDate)??1,i=ge((r==null?void 0:r.in)||n,0);i.setFullYear(t+1,0,a),i.setHours(0,0,0,0);const s=kt(i,r),l=ge((r==null?void 0:r.in)||n,0);l.setFullYear(t,0,a),l.setHours(0,0,0,0);const u=kt(l,r);return+e>=+s?t+1:+e>=+u?t:t-1}function Fv(n,r){var s,l,u,c;const e=nn(),t=(r==null?void 0:r.firstWeekContainsDate)??((l=(s=r==null?void 0:r.locale)==null?void 0:s.options)==null?void 0:l.firstWeekContainsDate)??e.firstWeekContainsDate??((c=(u=e.locale)==null?void 0:u.options)==null?void 0:c.firstWeekContainsDate)??1,o=Ua(n,r),a=ge((r==null?void 0:r.in)||n,0);return a.setFullYear(o,0,t),a.setHours(0,0,0,0),kt(a,r)}function yu(n,r){const e=K(n,r==null?void 0:r.in),t=+kt(e,r)-+Fv(e,r);return Math.round(t/iu)+1}function be(n,r){const e=n<0?"-":"",t=Math.abs(n).toString().padStart(r,"0");return e+t}const Ht={y(n,r){const e=n.getFullYear(),t=e>0?e:1-e;return be(r==="yy"?t%100:t,r.length)},M(n,r){const e=n.getMonth();return r==="M"?String(e+1):be(e+1,2)},d(n,r){return be(n.getDate(),r.length)},a(n,r){const e=n.getHours()/12>=1?"pm":"am";switch(r){case"a":case"aa":return e.toUpperCase();case"aaa":return e;case"aaaaa":return e[0];case"aaaa":default:return e==="am"?"a.m.":"p.m."}},h(n,r){return be(n.getHours()%12||12,r.length)},H(n,r){return be(n.getHours(),r.length)},m(n,r){return be(n.getMinutes(),r.length)},s(n,r){return be(n.getSeconds(),r.length)},S(n,r){const e=r.length,t=n.getMilliseconds(),o=Math.trunc(t*Math.pow(10,e-3));return be(o,r.length)}},Mn={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wu={G:function(n,r,e){const t=n.getFullYear()>0?1:0;switch(r){case"G":case"GG":case"GGG":return e.era(t,{width:"abbreviated"});case"GGGGG":return e.era(t,{width:"narrow"});case"GGGG":default:return e.era(t,{width:"wide"})}},y:function(n,r,e){if(r==="yo"){const t=n.getFullYear(),o=t>0?t:1-t;return e.ordinalNumber(o,{unit:"year"})}return Ht.y(n,r)},Y:function(n,r,e,t){const o=Ua(n,t),a=o>0?o:1-o;if(r==="YY"){const i=a%100;return be(i,2)}return r==="Yo"?e.ordinalNumber(a,{unit:"year"}):be(a,r.length)},R:function(n,r){const e=uu(n);return be(e,r.length)},u:function(n,r){const e=n.getFullYear();return be(e,r.length)},Q:function(n,r,e){const t=Math.ceil((n.getMonth()+1)/3);switch(r){case"Q":return String(t);case"QQ":return be(t,2);case"Qo":return e.ordinalNumber(t,{unit:"quarter"});case"QQQ":return e.quarter(t,{width:"abbreviated",context:"formatting"});case"QQQQQ":return e.quarter(t,{width:"narrow",context:"formatting"});case"QQQQ":default:return e.quarter(t,{width:"wide",context:"formatting"})}},q:function(n,r,e){const t=Math.ceil((n.getMonth()+1)/3);switch(r){case"q":return String(t);case"qq":return be(t,2);case"qo":return e.ordinalNumber(t,{unit:"quarter"});case"qqq":return e.quarter(t,{width:"abbreviated",context:"standalone"});case"qqqqq":return e.quarter(t,{width:"narrow",context:"standalone"});case"qqqq":default:return e.quarter(t,{width:"wide",context:"standalone"})}},M:function(n,r,e){const t=n.getMonth();switch(r){case"M":case"MM":return Ht.M(n,r);case"Mo":return e.ordinalNumber(t+1,{unit:"month"});case"MMM":return e.month(t,{width:"abbreviated",context:"formatting"});case"MMMMM":return e.month(t,{width:"narrow",context:"formatting"});case"MMMM":default:return e.month(t,{width:"wide",context:"formatting"})}},L:function(n,r,e){const t=n.getMonth();switch(r){case"L":return String(t+1);case"LL":return be(t+1,2);case"Lo":return e.ordinalNumber(t+1,{unit:"month"});case"LLL":return e.month(t,{width:"abbreviated",context:"standalone"});case"LLLLL":return e.month(t,{width:"narrow",context:"standalone"});case"LLLL":default:return e.month(t,{width:"wide",context:"standalone"})}},w:function(n,r,e,t){const o=yu(n,t);return r==="wo"?e.ordinalNumber(o,{unit:"week"}):be(o,r.length)},I:function(n,r,e){const t=za(n);return r==="Io"?e.ordinalNumber(t,{unit:"week"}):be(t,r.length)},d:function(n,r,e){return r==="do"?e.ordinalNumber(n.getDate(),{unit:"date"}):Ht.d(n,r)},D:function(n,r,e){const t=Iv(n);return r==="Do"?e.ordinalNumber(t,{unit:"dayOfYear"}):be(t,r.length)},E:function(n,r,e){const t=n.getDay();switch(r){case"E":case"EE":case"EEE":return e.day(t,{width:"abbreviated",context:"formatting"});case"EEEEE":return e.day(t,{width:"narrow",context:"formatting"});case"EEEEEE":return e.day(t,{width:"short",context:"formatting"});case"EEEE":default:return e.day(t,{width:"wide",context:"formatting"})}},e:function(n,r,e,t){const o=n.getDay(),a=(o-t.weekStartsOn+8)%7||7;switch(r){case"e":return String(a);case"ee":return be(a,2);case"eo":return e.ordinalNumber(a,{unit:"day"});case"eee":return e.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return e.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return e.day(o,{width:"short",context:"formatting"});case"eeee":default:return e.day(o,{width:"wide",context:"formatting"})}},c:function(n,r,e,t){const o=n.getDay(),a=(o-t.weekStartsOn+8)%7||7;switch(r){case"c":return String(a);case"cc":return be(a,r.length);case"co":return e.ordinalNumber(a,{unit:"day"});case"ccc":return e.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return e.day(o,{width:"narrow",context:"standalone"});case"cccccc":return e.day(o,{width:"short",context:"standalone"});case"cccc":default:return e.day(o,{width:"wide",context:"standalone"})}},i:function(n,r,e){const t=n.getDay(),o=t===0?7:t;switch(r){case"i":return String(o);case"ii":return be(o,r.length);case"io":return e.ordinalNumber(o,{unit:"day"});case"iii":return e.day(t,{width:"abbreviated",context:"formatting"});case"iiiii":return e.day(t,{width:"narrow",context:"formatting"});case"iiiiii":return e.day(t,{width:"short",context:"formatting"});case"iiii":default:return e.day(t,{width:"wide",context:"formatting"})}},a:function(n,r,e){const o=n.getHours()/12>=1?"pm":"am";switch(r){case"a":case"aa":return e.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"aaa":return e.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return e.dayPeriod(o,{width:"narrow",context:"formatting"});case"aaaa":default:return e.dayPeriod(o,{width:"wide",context:"formatting"})}},b:function(n,r,e){const t=n.getHours();let o;switch(t===12?o=Mn.noon:t===0?o=Mn.midnight:o=t/12>=1?"pm":"am",r){case"b":case"bb":return e.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"bbb":return e.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return e.dayPeriod(o,{width:"narrow",context:"formatting"});case"bbbb":default:return e.dayPeriod(o,{width:"wide",context:"formatting"})}},B:function(n,r,e){const t=n.getHours();let o;switch(t>=17?o=Mn.evening:t>=12?o=Mn.afternoon:t>=4?o=Mn.morning:o=Mn.night,r){case"B":case"BB":case"BBB":return e.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"BBBBB":return e.dayPeriod(o,{width:"narrow",context:"formatting"});case"BBBB":default:return e.dayPeriod(o,{width:"wide",context:"formatting"})}},h:function(n,r,e){if(r==="ho"){let t=n.getHours()%12;return t===0&&(t=12),e.ordinalNumber(t,{unit:"hour"})}return Ht.h(n,r)},H:function(n,r,e){return r==="Ho"?e.ordinalNumber(n.getHours(),{unit:"hour"}):Ht.H(n,r)},K:function(n,r,e){const t=n.getHours()%12;return r==="Ko"?e.ordinalNumber(t,{unit:"hour"}):be(t,r.length)},k:function(n,r,e){let t=n.getHours();return t===0&&(t=24),r==="ko"?e.ordinalNumber(t,{unit:"hour"}):be(t,r.length)},m:function(n,r,e){return r==="mo"?e.ordinalNumber(n.getMinutes(),{unit:"minute"}):Ht.m(n,r)},s:function(n,r,e){return r==="so"?e.ordinalNumber(n.getSeconds(),{unit:"second"}):Ht.s(n,r)},S:function(n,r){return Ht.S(n,r)},X:function(n,r,e){const t=n.getTimezoneOffset();if(t===0)return"Z";switch(r){case"X":return Du(t);case"XXXX":case"XX":return an(t);case"XXXXX":case"XXX":default:return an(t,":")}},x:function(n,r,e){const t=n.getTimezoneOffset();switch(r){case"x":return Du(t);case"xxxx":case"xx":return an(t);case"xxxxx":case"xxx":default:return an(t,":")}},O:function(n,r,e){const t=n.getTimezoneOffset();switch(r){case"O":case"OO":case"OOO":return"GMT"+xu(t,":");case"OOOO":default:return"GMT"+an(t,":")}},z:function(n,r,e){const t=n.getTimezoneOffset();switch(r){case"z":case"zz":case"zzz":return"GMT"+xu(t,":");case"zzzz":default:return"GMT"+an(t,":")}},t:function(n,r,e){const t=Math.trunc(+n/1e3);return be(t,r.length)},T:function(n,r,e){return be(+n,r.length)}};function xu(n,r=""){const e=n>0?"-":"+",t=Math.abs(n),o=Math.trunc(t/60),a=t%60;return a===0?e+String(o):e+String(o)+r+be(a,2)}function Du(n,r){return n%60===0?(n>0?"-":"+")+be(Math.abs(n)/60,2):an(n,r)}function an(n,r=""){const e=n>0?"-":"+",t=Math.abs(n),o=be(Math.trunc(t/60),2),a=be(t%60,2);return e+o+r+a}const Eu=(n,r)=>{switch(n){case"P":return r.date({width:"short"});case"PP":return r.date({width:"medium"});case"PPP":return r.date({width:"long"});case"PPPP":default:return r.date({width:"full"})}},ku=(n,r)=>{switch(n){case"p":return r.time({width:"short"});case"pp":return r.time({width:"medium"});case"ppp":return r.time({width:"long"});case"pppp":default:return r.time({width:"full"})}},Qa={p:ku,P:(n,r)=>{const e=n.match(/(P+)(p+)?/)||[],t=e[1],o=e[2];if(!o)return Eu(n,r);let a;switch(t){case"P":a=r.dateTime({width:"short"});break;case"PP":a=r.dateTime({width:"medium"});break;case"PPP":a=r.dateTime({width:"long"});break;case"PPPP":default:a=r.dateTime({width:"full"});break}return a.replace("{{date}}",Eu(t,r)).replace("{{time}}",ku(o,r))}},Lv=/^D+$/,$v=/^Y+$/,Av=["D","DD","YY","YYYY"];function Yv(n){return Lv.test(n)}function Wv(n){return $v.test(n)}function jv(n,r,e){const t=Hv(n,r,e);if(console.warn(t),Av.includes(n))throw new RangeError(t)}function Hv(n,r,e){const t=n[0]==="Y"?"years":"days of the month";return`Use \`${n.toLowerCase()}\` instead of \`${n}\` (in \`${r}\`) for formatting ${t} to the input \`${e}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const Rv=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Bv=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Vv=/^'([^]*?)'?$/,zv=/''/g,Uv=/[a-zA-Z]/;function Su(n,r,e){var c,p,m,f,h,v,g,w;const t=nn(),o=(e==null?void 0:e.locale)??t.locale??bu,a=(e==null?void 0:e.firstWeekContainsDate)??((p=(c=e==null?void 0:e.locale)==null?void 0:c.options)==null?void 0:p.firstWeekContainsDate)??t.firstWeekContainsDate??((f=(m=t.locale)==null?void 0:m.options)==null?void 0:f.firstWeekContainsDate)??1,i=(e==null?void 0:e.weekStartsOn)??((v=(h=e==null?void 0:e.locale)==null?void 0:h.options)==null?void 0:v.weekStartsOn)??t.weekStartsOn??((w=(g=t.locale)==null?void 0:g.options)==null?void 0:w.weekStartsOn)??0,s=K(n,e==null?void 0:e.in);if(!eo(s))throw new RangeError("Invalid time value");let l=r.match(Bv).map(y=>{const x=y[0];if(x==="p"||x==="P"){const E=Qa[x];return E(y,o.formatLong)}return y}).join("").match(Rv).map(y=>{if(y==="''")return{isToken:!1,value:"'"};const x=y[0];if(x==="'")return{isToken:!1,value:Qv(y)};if(wu[x])return{isToken:!0,value:y};if(x.match(Uv))throw new RangeError("Format string contains an unescaped latin alphabet character `"+x+"`");return{isToken:!1,value:y}});o.localize.preprocessor&&(l=o.localize.preprocessor(s,l));const u={firstWeekContainsDate:a,weekStartsOn:i,locale:o};return l.map(y=>{if(!y.isToken)return y.value;const x=y.value;(!(e!=null&&e.useAdditionalWeekYearTokens)&&Wv(x)||!(e!=null&&e.useAdditionalDayOfYearTokens)&&Yv(x))&&jv(x,r,String(n));const E=wu[x[0]];return E(s,x,o.localize,u)}).join("")}function Qv(n){const r=n.match(Vv);return r?r[1].replace(zv,"'"):n}function Cu(n,r){return K(n,r==null?void 0:r.in).getDate()}function Kv(n,r){return K(n,r==null?void 0:r.in).getDay()}function qv(n,r){const e=K(n,r==null?void 0:r.in),t=e.getFullYear(),o=e.getMonth(),a=ge(e,0);return a.setFullYear(t,o+1,0),a.setHours(0,0,0,0),a.getDate()}function Gv(){return Object.assign({},nn())}function Ot(n,r){return K(n,r==null?void 0:r.in).getHours()}function Xv(n,r){const e=K(n,r==null?void 0:r.in).getDay();return e===0?7:e}function Mt(n,r){return K(n,r==null?void 0:r.in).getMinutes()}function Be(n,r){return K(n,r==null?void 0:r.in).getMonth()}function Rt(n){return K(n).getSeconds()}function Ka(n){return+K(n)}function ne(n,r){return K(n,r==null?void 0:r.in).getFullYear()}function Bt(n,r){return+K(n)>+K(r)}function sn(n,r){return+K(n)<+K(r)}function Jv(n,r){return+K(n)==+K(r)}function Zv(n,r){const e=eg(r)?new r(0):ge(r,0);return e.setFullYear(n.getFullYear(),n.getMonth(),n.getDate()),e.setHours(n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()),e}function eg(n){var r;return typeof n=="function"&&((r=n.prototype)==null?void 0:r.constructor)===n}const tg=10;class _u{constructor(){B(this,"subPriority",0)}validate(r,e){return!0}}class ng extends _u{constructor(r,e,t,o,a){super(),this.value=r,this.validateValue=e,this.setValue=t,this.priority=o,a&&(this.subPriority=a)}validate(r,e){return this.validateValue(r,this.value,e)}set(r,e,t){return this.setValue(r,e,this.value,t)}}class rg extends _u{constructor(e,t){super();B(this,"priority",tg);B(this,"subPriority",-1);this.context=e||(o=>ge(t,o))}set(e,t){return t.timestampIsSet?e:ge(e,Zv(e,this.context))}}class me{run(r,e,t,o){const a=this.parse(r,e,t,o);return a?{setter:new ng(a.value,this.validate,this.set,this.priority,this.subPriority),rest:a.rest}:null}validate(r,e,t){return!0}}class og extends me{constructor(){super(...arguments);B(this,"priority",140);B(this,"incompatibleTokens",["R","u","t","T"])}parse(e,t,o){switch(t){case"G":case"GG":case"GGG":return o.era(e,{width:"abbreviated"})||o.era(e,{width:"narrow"});case"GGGGG":return o.era(e,{width:"narrow"});case"GGGG":default:return o.era(e,{width:"wide"})||o.era(e,{width:"abbreviated"})||o.era(e,{width:"narrow"})}}set(e,t,o){return t.era=o,e.setFullYear(o,0,1),e.setHours(0,0,0,0),e}}const Te={month:/^(1[0-2]|0?\d)/,date:/^(3[0-1]|[0-2]?\d)/,dayOfYear:/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,week:/^(5[0-3]|[0-4]?\d)/,hour23h:/^(2[0-3]|[0-1]?\d)/,hour24h:/^(2[0-4]|[0-1]?\d)/,hour11h:/^(1[0-1]|0?\d)/,hour12h:/^(1[0-2]|0?\d)/,minute:/^[0-5]?\d/,second:/^[0-5]?\d/,singleDigit:/^\d/,twoDigits:/^\d{1,2}/,threeDigits:/^\d{1,3}/,fourDigits:/^\d{1,4}/,anyDigitsSigned:/^-?\d+/,singleDigitSigned:/^-?\d/,twoDigitsSigned:/^-?\d{1,2}/,threeDigitsSigned:/^-?\d{1,3}/,fourDigitsSigned:/^-?\d{1,4}/},ft={basicOptionalMinutes:/^([+-])(\d{2})(\d{2})?|Z/,basic:/^([+-])(\d{2})(\d{2})|Z/,basicOptionalSeconds:/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,extended:/^([+-])(\d{2}):(\d{2})|Z/,extendedOptionalSeconds:/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/};function Ne(n,r){return n&&{value:r(n.value),rest:n.rest}}function _e(n,r){const e=r.match(n);return e?{value:parseInt(e[0],10),rest:r.slice(e[0].length)}:null}function pt(n,r){const e=r.match(n);if(!e)return null;if(e[0]==="Z")return{value:0,rest:r.slice(1)};const t=e[1]==="+"?1:-1,o=e[2]?parseInt(e[2],10):0,a=e[3]?parseInt(e[3],10):0,i=e[5]?parseInt(e[5],10):0;return{value:t*(o*Xr+a*Gr+i*qh),rest:r.slice(e[0].length)}}function Ou(n){return _e(Te.anyDigitsSigned,n)}function Me(n,r){switch(n){case 1:return _e(Te.singleDigit,r);case 2:return _e(Te.twoDigits,r);case 3:return _e(Te.threeDigits,r);case 4:return _e(Te.fourDigits,r);default:return _e(new RegExp("^\\d{1,"+n+"}"),r)}}function ao(n,r){switch(n){case 1:return _e(Te.singleDigitSigned,r);case 2:return _e(Te.twoDigitsSigned,r);case 3:return _e(Te.threeDigitsSigned,r);case 4:return _e(Te.fourDigitsSigned,r);default:return _e(new RegExp("^-?\\d{1,"+n+"}"),r)}}function qa(n){switch(n){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;case"am":case"midnight":case"night":default:return 0}}function Mu(n,r){const e=r>0,t=e?r:1-r;let o;if(t<=50)o=n||100;else{const a=t+50,i=Math.trunc(a/100)*100,s=n>=a%100;o=n+i-(s?100:0)}return e?o:1-o}function Pu(n){return n%400===0||n%4===0&&n%100!==0}class ag extends me{constructor(){super(...arguments);B(this,"priority",130);B(this,"incompatibleTokens",["Y","R","u","w","I","i","e","c","t","T"])}parse(e,t,o){const a=i=>({year:i,isTwoDigitYear:t==="yy"});switch(t){case"y":return Ne(Me(4,e),a);case"yo":return Ne(o.ordinalNumber(e,{unit:"year"}),a);default:return Ne(Me(t.length,e),a)}}validate(e,t){return t.isTwoDigitYear||t.year>0}set(e,t,o){const a=e.getFullYear();if(o.isTwoDigitYear){const s=Mu(o.year,a);return e.setFullYear(s,0,1),e.setHours(0,0,0,0),e}const i=!("era"in t)||t.era===1?o.year:1-o.year;return e.setFullYear(i,0,1),e.setHours(0,0,0,0),e}}class ig extends me{constructor(){super(...arguments);B(this,"priority",130);B(this,"incompatibleTokens",["y","R","u","Q","q","M","L","I","d","D","i","t","T"])}parse(e,t,o){const a=i=>({year:i,isTwoDigitYear:t==="YY"});switch(t){case"Y":return Ne(Me(4,e),a);case"Yo":return Ne(o.ordinalNumber(e,{unit:"year"}),a);default:return Ne(Me(t.length,e),a)}}validate(e,t){return t.isTwoDigitYear||t.year>0}set(e,t,o,a){const i=Ua(e,a);if(o.isTwoDigitYear){const l=Mu(o.year,i);return e.setFullYear(l,0,a.firstWeekContainsDate),e.setHours(0,0,0,0),kt(e,a)}const s=!("era"in t)||t.era===1?o.year:1-o.year;return e.setFullYear(s,0,a.firstWeekContainsDate),e.setHours(0,0,0,0),kt(e,a)}}class sg extends me{constructor(){super(...arguments);B(this,"priority",130);B(this,"incompatibleTokens",["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"])}parse(e,t){return ao(t==="R"?4:t.length,e)}set(e,t,o){const a=ge(e,0);return a.setFullYear(o,0,4),a.setHours(0,0,0,0),Cn(a)}}class lg extends me{constructor(){super(...arguments);B(this,"priority",130);B(this,"incompatibleTokens",["G","y","Y","R","w","I","i","e","c","t","T"])}parse(e,t){return ao(t==="u"?4:t.length,e)}set(e,t,o){return e.setFullYear(o,0,1),e.setHours(0,0,0,0),e}}class ug extends me{constructor(){super(...arguments);B(this,"priority",120);B(this,"incompatibleTokens",["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"])}parse(e,t,o){switch(t){case"Q":case"QQ":return Me(t.length,e);case"Qo":return o.ordinalNumber(e,{unit:"quarter"});case"QQQ":return o.quarter(e,{width:"abbreviated",context:"formatting"})||o.quarter(e,{width:"narrow",context:"formatting"});case"QQQQQ":return o.quarter(e,{width:"narrow",context:"formatting"});case"QQQQ":default:return o.quarter(e,{width:"wide",context:"formatting"})||o.quarter(e,{width:"abbreviated",context:"formatting"})||o.quarter(e,{width:"narrow",context:"formatting"})}}validate(e,t){return t>=1&&t<=4}set(e,t,o){return e.setMonth((o-1)*3,1),e.setHours(0,0,0,0),e}}class cg extends me{constructor(){super(...arguments);B(this,"priority",120);B(this,"incompatibleTokens",["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"])}parse(e,t,o){switch(t){case"q":case"qq":return Me(t.length,e);case"qo":return o.ordinalNumber(e,{unit:"quarter"});case"qqq":return o.quarter(e,{width:"abbreviated",context:"standalone"})||o.quarter(e,{width:"narrow",context:"standalone"});case"qqqqq":return o.quarter(e,{width:"narrow",context:"standalone"});case"qqqq":default:return o.quarter(e,{width:"wide",context:"standalone"})||o.quarter(e,{width:"abbreviated",context:"standalone"})||o.quarter(e,{width:"narrow",context:"standalone"})}}validate(e,t){return t>=1&&t<=4}set(e,t,o){return e.setMonth((o-1)*3,1),e.setHours(0,0,0,0),e}}class dg extends me{constructor(){super(...arguments);B(this,"incompatibleTokens",["Y","R","q","Q","L","w","I","D","i","e","c","t","T"]);B(this,"priority",110)}parse(e,t,o){const a=i=>i-1;switch(t){case"M":return Ne(_e(Te.month,e),a);case"MM":return Ne(Me(2,e),a);case"Mo":return Ne(o.ordinalNumber(e,{unit:"month"}),a);case"MMM":return o.month(e,{width:"abbreviated",context:"formatting"})||o.month(e,{width:"narrow",context:"formatting"});case"MMMMM":return o.month(e,{width:"narrow",context:"formatting"});case"MMMM":default:return o.month(e,{width:"wide",context:"formatting"})||o.month(e,{width:"abbreviated",context:"formatting"})||o.month(e,{width:"narrow",context:"formatting"})}}validate(e,t){return t>=0&&t<=11}set(e,t,o){return e.setMonth(o,1),e.setHours(0,0,0,0),e}}class fg extends me{constructor(){super(...arguments);B(this,"priority",110);B(this,"incompatibleTokens",["Y","R","q","Q","M","w","I","D","i","e","c","t","T"])}parse(e,t,o){const a=i=>i-1;switch(t){case"L":return Ne(_e(Te.month,e),a);case"LL":return Ne(Me(2,e),a);case"Lo":return Ne(o.ordinalNumber(e,{unit:"month"}),a);case"LLL":return o.month(e,{width:"abbreviated",context:"standalone"})||o.month(e,{width:"narrow",context:"standalone"});case"LLLLL":return o.month(e,{width:"narrow",context:"standalone"});case"LLLL":default:return o.month(e,{width:"wide",context:"standalone"})||o.month(e,{width:"abbreviated",context:"standalone"})||o.month(e,{width:"narrow",context:"standalone"})}}validate(e,t){return t>=0&&t<=11}set(e,t,o){return e.setMonth(o,1),e.setHours(0,0,0,0),e}}function pg(n,r,e){const t=K(n,e==null?void 0:e.in),o=yu(t,e)-r;return t.setDate(t.getDate()-o*7),K(t,e==null?void 0:e.in)}class mg extends me{constructor(){super(...arguments);B(this,"priority",100);B(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","i","t","T"])}parse(e,t,o){switch(t){case"w":return _e(Te.week,e);case"wo":return o.ordinalNumber(e,{unit:"week"});default:return Me(t.length,e)}}validate(e,t){return t>=1&&t<=53}set(e,t,o,a){return kt(pg(e,o,a),a)}}function hg(n,r,e){const t=K(n,e==null?void 0:e.in),o=za(t,e)-r;return t.setDate(t.getDate()-o*7),t}class vg extends me{constructor(){super(...arguments);B(this,"priority",100);B(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"])}parse(e,t,o){switch(t){case"I":return _e(Te.week,e);case"Io":return o.ordinalNumber(e,{unit:"week"});default:return Me(t.length,e)}}validate(e,t){return t>=1&&t<=53}set(e,t,o){return Cn(hg(e,o))}}const gg=[31,28,31,30,31,30,31,31,30,31,30,31],bg=[31,29,31,30,31,30,31,31,30,31,30,31];class yg extends me{constructor(){super(...arguments);B(this,"priority",90);B(this,"subPriority",1);B(this,"incompatibleTokens",["Y","R","q","Q","w","I","D","i","e","c","t","T"])}parse(e,t,o){switch(t){case"d":return _e(Te.date,e);case"do":return o.ordinalNumber(e,{unit:"date"});default:return Me(t.length,e)}}validate(e,t){const o=e.getFullYear(),a=Pu(o),i=e.getMonth();return a?t>=1&&t<=bg[i]:t>=1&&t<=gg[i]}set(e,t,o){return e.setDate(o),e.setHours(0,0,0,0),e}}class wg extends me{constructor(){super(...arguments);B(this,"priority",90);B(this,"subpriority",1);B(this,"incompatibleTokens",["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"])}parse(e,t,o){switch(t){case"D":case"DD":return _e(Te.dayOfYear,e);case"Do":return o.ordinalNumber(e,{unit:"date"});default:return Me(t.length,e)}}validate(e,t){const o=e.getFullYear();return Pu(o)?t>=1&&t<=366:t>=1&&t<=365}set(e,t,o){return e.setMonth(0,o),e.setHours(0,0,0,0),e}}function Ga(n,r,e){var p,m,f,h;const t=nn(),o=(e==null?void 0:e.weekStartsOn)??((m=(p=e==null?void 0:e.locale)==null?void 0:p.options)==null?void 0:m.weekStartsOn)??t.weekStartsOn??((h=(f=t.locale)==null?void 0:f.options)==null?void 0:h.weekStartsOn)??0,a=K(n,e==null?void 0:e.in),i=a.getDay(),l=(r%7+7)%7,u=7-o,c=r<0||r>6?r-(i+u)%7:(l+u)%7-(i+u)%7;return rt(a,c,e)}class xg extends me{constructor(){super(...arguments);B(this,"priority",90);B(this,"incompatibleTokens",["D","i","e","c","t","T"])}parse(e,t,o){switch(t){case"E":case"EE":case"EEE":return o.day(e,{width:"abbreviated",context:"formatting"})||o.day(e,{width:"short",context:"formatting"})||o.day(e,{width:"narrow",context:"formatting"});case"EEEEE":return o.day(e,{width:"narrow",context:"formatting"});case"EEEEEE":return o.day(e,{width:"short",context:"formatting"})||o.day(e,{width:"narrow",context:"formatting"});case"EEEE":default:return o.day(e,{width:"wide",context:"formatting"})||o.day(e,{width:"abbreviated",context:"formatting"})||o.day(e,{width:"short",context:"formatting"})||o.day(e,{width:"narrow",context:"formatting"})}}validate(e,t){return t>=0&&t<=6}set(e,t,o,a){return e=Ga(e,o,a),e.setHours(0,0,0,0),e}}class Dg extends me{constructor(){super(...arguments);B(this,"priority",90);B(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"])}parse(e,t,o,a){const i=s=>{const l=Math.floor((s-1)/7)*7;return(s+a.weekStartsOn+6)%7+l};switch(t){case"e":case"ee":return Ne(Me(t.length,e),i);case"eo":return Ne(o.ordinalNumber(e,{unit:"day"}),i);case"eee":return o.day(e,{width:"abbreviated",context:"formatting"})||o.day(e,{width:"short",context:"formatting"})||o.day(e,{width:"narrow",context:"formatting"});case"eeeee":return o.day(e,{width:"narrow",context:"formatting"});case"eeeeee":return o.day(e,{width:"short",context:"formatting"})||o.day(e,{width:"narrow",context:"formatting"});case"eeee":default:return o.day(e,{width:"wide",context:"formatting"})||o.day(e,{width:"abbreviated",context:"formatting"})||o.day(e,{width:"short",context:"formatting"})||o.day(e,{width:"narrow",context:"formatting"})}}validate(e,t){return t>=0&&t<=6}set(e,t,o,a){return e=Ga(e,o,a),e.setHours(0,0,0,0),e}}class Eg extends me{constructor(){super(...arguments);B(this,"priority",90);B(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"])}parse(e,t,o,a){const i=s=>{const l=Math.floor((s-1)/7)*7;return(s+a.weekStartsOn+6)%7+l};switch(t){case"c":case"cc":return Ne(Me(t.length,e),i);case"co":return Ne(o.ordinalNumber(e,{unit:"day"}),i);case"ccc":return o.day(e,{width:"abbreviated",context:"standalone"})||o.day(e,{width:"short",context:"standalone"})||o.day(e,{width:"narrow",context:"standalone"});case"ccccc":return o.day(e,{width:"narrow",context:"standalone"});case"cccccc":return o.day(e,{width:"short",context:"standalone"})||o.day(e,{width:"narrow",context:"standalone"});case"cccc":default:return o.day(e,{width:"wide",context:"standalone"})||o.day(e,{width:"abbreviated",context:"standalone"})||o.day(e,{width:"short",context:"standalone"})||o.day(e,{width:"narrow",context:"standalone"})}}validate(e,t){return t>=0&&t<=6}set(e,t,o,a){return e=Ga(e,o,a),e.setHours(0,0,0,0),e}}function kg(n,r,e){const t=K(n,e==null?void 0:e.in),o=Xv(t,e),a=r-o;return rt(t,a,e)}class Sg extends me{constructor(){super(...arguments);B(this,"priority",90);B(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"])}parse(e,t,o){const a=i=>i===0?7:i;switch(t){case"i":case"ii":return Me(t.length,e);case"io":return o.ordinalNumber(e,{unit:"day"});case"iii":return Ne(o.day(e,{width:"abbreviated",context:"formatting"})||o.day(e,{width:"short",context:"formatting"})||o.day(e,{width:"narrow",context:"formatting"}),a);case"iiiii":return Ne(o.day(e,{width:"narrow",context:"formatting"}),a);case"iiiiii":return Ne(o.day(e,{width:"short",context:"formatting"})||o.day(e,{width:"narrow",context:"formatting"}),a);case"iiii":default:return Ne(o.day(e,{width:"wide",context:"formatting"})||o.day(e,{width:"abbreviated",context:"formatting"})||o.day(e,{width:"short",context:"formatting"})||o.day(e,{width:"narrow",context:"formatting"}),a)}}validate(e,t){return t>=1&&t<=7}set(e,t,o){return e=kg(e,o),e.setHours(0,0,0,0),e}}class Cg extends me{constructor(){super(...arguments);B(this,"priority",80);B(this,"incompatibleTokens",["b","B","H","k","t","T"])}parse(e,t,o){switch(t){case"a":case"aa":case"aaa":return o.dayPeriod(e,{width:"abbreviated",context:"formatting"})||o.dayPeriod(e,{width:"narrow",context:"formatting"});case"aaaaa":return o.dayPeriod(e,{width:"narrow",context:"formatting"});case"aaaa":default:return o.dayPeriod(e,{width:"wide",context:"formatting"})||o.dayPeriod(e,{width:"abbreviated",context:"formatting"})||o.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,t,o){return e.setHours(qa(o),0,0,0),e}}class _g extends me{constructor(){super(...arguments);B(this,"priority",80);B(this,"incompatibleTokens",["a","B","H","k","t","T"])}parse(e,t,o){switch(t){case"b":case"bb":case"bbb":return o.dayPeriod(e,{width:"abbreviated",context:"formatting"})||o.dayPeriod(e,{width:"narrow",context:"formatting"});case"bbbbb":return o.dayPeriod(e,{width:"narrow",context:"formatting"});case"bbbb":default:return o.dayPeriod(e,{width:"wide",context:"formatting"})||o.dayPeriod(e,{width:"abbreviated",context:"formatting"})||o.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,t,o){return e.setHours(qa(o),0,0,0),e}}class Og extends me{constructor(){super(...arguments);B(this,"priority",80);B(this,"incompatibleTokens",["a","b","t","T"])}parse(e,t,o){switch(t){case"B":case"BB":case"BBB":return o.dayPeriod(e,{width:"abbreviated",context:"formatting"})||o.dayPeriod(e,{width:"narrow",context:"formatting"});case"BBBBB":return o.dayPeriod(e,{width:"narrow",context:"formatting"});case"BBBB":default:return o.dayPeriod(e,{width:"wide",context:"formatting"})||o.dayPeriod(e,{width:"abbreviated",context:"formatting"})||o.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,t,o){return e.setHours(qa(o),0,0,0),e}}class Mg extends me{constructor(){super(...arguments);B(this,"priority",70);B(this,"incompatibleTokens",["H","K","k","t","T"])}parse(e,t,o){switch(t){case"h":return _e(Te.hour12h,e);case"ho":return o.ordinalNumber(e,{unit:"hour"});default:return Me(t.length,e)}}validate(e,t){return t>=1&&t<=12}set(e,t,o){const a=e.getHours()>=12;return a&&o<12?e.setHours(o+12,0,0,0):!a&&o===12?e.setHours(0,0,0,0):e.setHours(o,0,0,0),e}}class Pg extends me{constructor(){super(...arguments);B(this,"priority",70);B(this,"incompatibleTokens",["a","b","h","K","k","t","T"])}parse(e,t,o){switch(t){case"H":return _e(Te.hour23h,e);case"Ho":return o.ordinalNumber(e,{unit:"hour"});default:return Me(t.length,e)}}validate(e,t){return t>=0&&t<=23}set(e,t,o){return e.setHours(o,0,0,0),e}}class Tg extends me{constructor(){super(...arguments);B(this,"priority",70);B(this,"incompatibleTokens",["h","H","k","t","T"])}parse(e,t,o){switch(t){case"K":return _e(Te.hour11h,e);case"Ko":return o.ordinalNumber(e,{unit:"hour"});default:return Me(t.length,e)}}validate(e,t){return t>=0&&t<=11}set(e,t,o){return e.getHours()>=12&&o<12?e.setHours(o+12,0,0,0):e.setHours(o,0,0,0),e}}class Ng extends me{constructor(){super(...arguments);B(this,"priority",70);B(this,"incompatibleTokens",["a","b","h","H","K","t","T"])}parse(e,t,o){switch(t){case"k":return _e(Te.hour24h,e);case"ko":return o.ordinalNumber(e,{unit:"hour"});default:return Me(t.length,e)}}validate(e,t){return t>=1&&t<=24}set(e,t,o){const a=o<=24?o%24:o;return e.setHours(a,0,0,0),e}}class Ig extends me{constructor(){super(...arguments);B(this,"priority",60);B(this,"incompatibleTokens",["t","T"])}parse(e,t,o){switch(t){case"m":return _e(Te.minute,e);case"mo":return o.ordinalNumber(e,{unit:"minute"});default:return Me(t.length,e)}}validate(e,t){return t>=0&&t<=59}set(e,t,o){return e.setMinutes(o,0,0),e}}class Fg extends me{constructor(){super(...arguments);B(this,"priority",50);B(this,"incompatibleTokens",["t","T"])}parse(e,t,o){switch(t){case"s":return _e(Te.second,e);case"so":return o.ordinalNumber(e,{unit:"second"});default:return Me(t.length,e)}}validate(e,t){return t>=0&&t<=59}set(e,t,o){return e.setSeconds(o,0),e}}class Lg extends me{constructor(){super(...arguments);B(this,"priority",30);B(this,"incompatibleTokens",["t","T"])}parse(e,t){const o=a=>Math.trunc(a*Math.pow(10,-t.length+3));return Ne(Me(t.length,e),o)}set(e,t,o){return e.setMilliseconds(o),e}}class $g extends me{constructor(){super(...arguments);B(this,"priority",10);B(this,"incompatibleTokens",["t","T","x"])}parse(e,t){switch(t){case"X":return pt(ft.basicOptionalMinutes,e);case"XX":return pt(ft.basic,e);case"XXXX":return pt(ft.basicOptionalSeconds,e);case"XXXXX":return pt(ft.extendedOptionalSeconds,e);case"XXX":default:return pt(ft.extended,e)}}set(e,t,o){return t.timestampIsSet?e:ge(e,e.getTime()-Jr(e)-o)}}class Ag extends me{constructor(){super(...arguments);B(this,"priority",10);B(this,"incompatibleTokens",["t","T","X"])}parse(e,t){switch(t){case"x":return pt(ft.basicOptionalMinutes,e);case"xx":return pt(ft.basic,e);case"xxxx":return pt(ft.basicOptionalSeconds,e);case"xxxxx":return pt(ft.extendedOptionalSeconds,e);case"xxx":default:return pt(ft.extended,e)}}set(e,t,o){return t.timestampIsSet?e:ge(e,e.getTime()-Jr(e)-o)}}class Yg extends me{constructor(){super(...arguments);B(this,"priority",40);B(this,"incompatibleTokens","*")}parse(e){return Ou(e)}set(e,t,o){return[ge(e,o*1e3),{timestampIsSet:!0}]}}class Wg extends me{constructor(){super(...arguments);B(this,"priority",20);B(this,"incompatibleTokens","*")}parse(e){return Ou(e)}set(e,t,o){return[ge(e,o),{timestampIsSet:!0}]}}const jg={G:new og,y:new ag,Y:new ig,R:new sg,u:new lg,Q:new ug,q:new cg,M:new dg,L:new fg,w:new mg,I:new vg,d:new yg,D:new wg,E:new xg,e:new Dg,c:new Eg,i:new Sg,a:new Cg,b:new _g,B:new Og,h:new Mg,H:new Pg,K:new Tg,k:new Ng,m:new Ig,s:new Fg,S:new Lg,X:new $g,x:new Ag,t:new Yg,T:new Wg},Hg=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Rg=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Bg=/^'([^]*?)'?$/,Vg=/''/g,zg=/\S/,Ug=/[a-zA-Z]/;function Qg(n,r,e,t){var g,w,y,x,E,k,C,S;const o=()=>ge((t==null?void 0:t.in)||e,NaN),a=Gv(),i=(t==null?void 0:t.locale)??a.locale??bu,s=(t==null?void 0:t.firstWeekContainsDate)??((w=(g=t==null?void 0:t.locale)==null?void 0:g.options)==null?void 0:w.firstWeekContainsDate)??a.firstWeekContainsDate??((x=(y=a.locale)==null?void 0:y.options)==null?void 0:x.firstWeekContainsDate)??1,l=(t==null?void 0:t.weekStartsOn)??((k=(E=t==null?void 0:t.locale)==null?void 0:E.options)==null?void 0:k.weekStartsOn)??a.weekStartsOn??((S=(C=a.locale)==null?void 0:C.options)==null?void 0:S.weekStartsOn)??0;if(!r)return n?o():K(e,t==null?void 0:t.in);const u={firstWeekContainsDate:s,weekStartsOn:l,locale:i},c=[new rg(t==null?void 0:t.in,e)],p=r.match(Rg).map(D=>{const _=D[0];if(_ in Qa){const O=Qa[_];return O(D,i.formatLong)}return D}).join("").match(Hg),m=[];for(let D of p){const _=D[0],O=jg[_];if(O){const{incompatibleTokens:T}=O;if(Array.isArray(T)){const W=m.find(N=>T.includes(N.token)||N.token===_);if(W)throw new RangeError(`The format string mustn't contain \`${W.fullToken}\` and \`${D}\` at the same time`)}else if(O.incompatibleTokens==="*"&&m.length>0)throw new RangeError(`The format string mustn't contain \`${D}\` and any other token at the same time`);m.push({token:_,fullToken:D});const Y=O.run(n,D,i.match,u);if(!Y)return o();c.push(Y.setter),n=Y.rest}else{if(_.match(Ug))throw new RangeError("Format string contains an unescaped latin alphabet character `"+_+"`");if(D==="''"?D="'":_==="'"&&(D=Kg(D)),n.indexOf(D)===0)n=n.slice(D.length);else return o()}}if(n.length>0&&zg.test(n))return o();const f=c.map(D=>D.priority).sort((D,_)=>_-D).filter((D,_,O)=>O.indexOf(D)===_).map(D=>c.filter(_=>_.priority===D).sort((_,O)=>O.subPriority-_.subPriority)).map(D=>D[0]);let h=K(e,t==null?void 0:t.in);if(isNaN(+h))return o();const v={};for(const D of f){if(!D.validate(h,u))return o();const _=D.set(h,v,u);Array.isArray(_)?(h=_[0],Object.assign(v,_[1])):h=_}return h}function Kg(n){return n.match(Bg)[1].replace(Vg,"'")}function qg(n,r,e){const[t,o]=St(e==null?void 0:e.in,n,r);return t.getFullYear()===o.getFullYear()&&t.getMonth()===o.getMonth()}function Gg(n,r,e){const[t,o]=St(e==null?void 0:e.in,n,r);return+Va(t)==+Va(o)}function Xg(n,r,e){const[t,o]=St(e==null?void 0:e.in,n,r);return t.getFullYear()===o.getFullYear()}function sr(n,r,e){const t=+K(n,e==null?void 0:e.in),[o,a]=[+K(r.start,e==null?void 0:e.in),+K(r.end,e==null?void 0:e.in)].sort((i,s)=>i-s);return t>=o&&t<=a}function Jg(n,r,e){return rt(n,-1,e)}function Zg(n,r){const e=()=>ge(r==null?void 0:r.in,NaN),o=rb(n);let a;if(o.date){const u=ob(o.date,2);a=ab(u.restDateString,u.year)}if(!a||isNaN(+a))return e();const i=+a;let s=0,l;if(o.time&&(s=ib(o.time),isNaN(s)))return e();if(o.timezone){if(l=sb(o.timezone),isNaN(l))return e()}else{const u=new Date(i+s),c=K(0,r==null?void 0:r.in);return c.setFullYear(u.getUTCFullYear(),u.getUTCMonth(),u.getUTCDate()),c.setHours(u.getUTCHours(),u.getUTCMinutes(),u.getUTCSeconds(),u.getUTCMilliseconds()),c}return K(i+s+l,r==null?void 0:r.in)}const io={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},eb=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,tb=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,nb=/^([+-])(\d{2})(?::?(\d{2}))?$/;function rb(n){const r={},e=n.split(io.dateTimeDelimiter);let t;if(e.length>2)return r;if(/:/.test(e[0])?t=e[0]:(r.date=e[0],t=e[1],io.timeZoneDelimiter.test(r.date)&&(r.date=n.split(io.timeZoneDelimiter)[0],t=n.substr(r.date.length,n.length))),t){const o=io.timezone.exec(t);o?(r.time=t.replace(o[1],""),r.timezone=o[1]):r.time=t}return r}function ob(n,r){const e=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+r)+"})|(\\d{2}|[+-]\\d{"+(2+r)+"})$)"),t=n.match(e);if(!t)return{year:NaN,restDateString:""};const o=t[1]?parseInt(t[1]):null,a=t[2]?parseInt(t[2]):null;return{year:a===null?o:a*100,restDateString:n.slice((t[1]||t[2]).length)}}function ab(n,r){if(r===null)return new Date(NaN);const e=n.match(eb);if(!e)return new Date(NaN);const t=!!e[4],o=lr(e[1]),a=lr(e[2])-1,i=lr(e[3]),s=lr(e[4]),l=lr(e[5])-1;if(t)return fb(r,s,l)?lb(r,s,l):new Date(NaN);{const u=new Date(0);return!cb(r,a,i)||!db(r,o)?new Date(NaN):(u.setUTCFullYear(r,a,Math.max(o,i)),u)}}function lr(n){return n?parseInt(n):1}function ib(n){const r=n.match(tb);if(!r)return NaN;const e=Xa(r[1]),t=Xa(r[2]),o=Xa(r[3]);return pb(e,t,o)?e*Xr+t*Gr+o*1e3:NaN}function Xa(n){return n&&parseFloat(n.replace(",","."))||0}function sb(n){if(n==="Z")return 0;const r=n.match(nb);if(!r)return 0;const e=r[1]==="+"?-1:1,t=parseInt(r[2]),o=r[3]&&parseInt(r[3])||0;return mb(t,o)?e*(t*Xr+o*Gr):NaN}function lb(n,r,e){const t=new Date(0);t.setUTCFullYear(n,0,4);const o=t.getUTCDay()||7,a=(r-1)*7+e+1-o;return t.setUTCDate(t.getUTCDate()+a),t}const ub=[31,null,31,30,31,30,31,31,30,31,30,31];function Tu(n){return n%400===0||n%4===0&&n%100!==0}function cb(n,r,e){return r>=0&&r<=11&&e>=1&&e<=(ub[r]||(Tu(n)?29:28))}function db(n,r){return r>=1&&r<=(Tu(n)?366:365)}function fb(n,r,e){return r>=1&&r<=53&&e>=0&&e<=6}function pb(n,r,e){return n===24?r===0&&e===0:e>=0&&e<60&&r>=0&&r<60&&n>=0&&n<25}function mb(n,r){return r>=0&&r<=59}function Ge(n,r,e){const t=K(n,e==null?void 0:e.in),o=t.getFullYear(),a=t.getDate(),i=ge(n,0);i.setFullYear(o,r,15),i.setHours(0,0,0,0);const s=qv(i);return t.setMonth(r,Math.min(a,s)),t}function so(n,r,e){const t=K(n,e==null?void 0:e.in);return t.setHours(r),t}function lo(n,r,e){const t=K(n,e==null?void 0:e.in);return t.setMinutes(r),t}function Pn(n,r,e){const t=K(n,e==null?void 0:e.in),o=Math.trunc(t.getMonth()/3)+1,a=r-o;return Ge(t,t.getMonth()+a*3)}function uo(n,r,e){const t=K(n,e==null?void 0:e.in);return t.setSeconds(r),t}function mt(n,r,e){const t=K(n,e==null?void 0:e.in);return isNaN(+t)?ge(n,NaN):(t.setFullYear(r),t)}function ln(n,r,e){return ot(n,-r,e)}function Nu(n,r,e){return Ba(n,-1,e)}function Iu(n,r,e){return Zr(n,-1,e)}function Tn(n,r,e){return Ct(n,-r,e)}const hb={lessThanXSeconds:{one:"1초 미만",other:"{{count}}초 미만"},xSeconds:{one:"1초",other:"{{count}}초"},halfAMinute:"30초",lessThanXMinutes:{one:"1분 미만",other:"{{count}}분 미만"},xMinutes:{one:"1분",other:"{{count}}분"},aboutXHours:{one:"약 1시간",other:"약 {{count}}시간"},xHours:{one:"1시간",other:"{{count}}시간"},xDays:{one:"1일",other:"{{count}}일"},aboutXWeeks:{one:"약 1주",other:"약 {{count}}주"},xWeeks:{one:"1주",other:"{{count}}주"},aboutXMonths:{one:"약 1개월",other:"약 {{count}}개월"},xMonths:{one:"1개월",other:"{{count}}개월"},aboutXYears:{one:"약 1년",other:"약 {{count}}년"},xYears:{one:"1년",other:"{{count}}년"},overXYears:{one:"1년 이상",other:"{{count}}년 이상"},almostXYears:{one:"거의 1년",other:"거의 {{count}}년"}},vb=(n,r,e)=>{let t;const o=hb[n];return typeof o=="string"?t=o:r===1?t=o.one:t=o.other.replace("{{count}}",r.toString()),e!=null&&e.addSuffix?e.comparison&&e.comparison>0?t+" 후":t+" 전":t},gb={full:"y년 M월 d일 EEEE",long:"y년 M월 d일",medium:"y.MM.dd",short:"y.MM.dd"},bb={full:"a H시 mm분 ss초 zzzz",long:"a H:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},yb={full:"{{date}} {{time}}",long:"{{date}} {{time}}",medium:"{{date}} {{time}}",short:"{{date}} {{time}}"},wb={date:On({formats:gb,defaultWidth:"full"}),time:On({formats:bb,defaultWidth:"full"}),dateTime:On({formats:yb,defaultWidth:"full"})},xb={lastWeek:"'지난' eeee p",yesterday:"'어제' p",today:"'오늘' p",tomorrow:"'내일' p",nextWeek:"'다음' eeee p",other:"P"},Db=(n,r,e,t)=>xb[n],Eb={narrow:["BC","AD"],abbreviated:["BC","AD"],wide:["기원전","서기"]},kb={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1분기","2분기","3분기","4분기"]},Sb={narrow:["1","2","3","4","5","6","7","8","9","10","11","12"],abbreviated:["1월","2월","3월","4월","5월","6월","7월","8월","9월","10월","11월","12월"],wide:["1월","2월","3월","4월","5월","6월","7월","8월","9월","10월","11월","12월"]},Cb={narrow:["일","월","화","수","목","금","토"],short:["일","월","화","수","목","금","토"],abbreviated:["일","월","화","수","목","금","토"],wide:["일요일","월요일","화요일","수요일","목요일","금요일","토요일"]},_b={narrow:{am:"오전",pm:"오후",midnight:"자정",noon:"정오",morning:"아침",afternoon:"오후",evening:"저녁",night:"밤"},abbreviated:{am:"오전",pm:"오후",midnight:"자정",noon:"정오",morning:"아침",afternoon:"오후",evening:"저녁",night:"밤"},wide:{am:"오전",pm:"오후",midnight:"자정",noon:"정오",morning:"아침",afternoon:"오후",evening:"저녁",night:"밤"}},Ob={narrow:{am:"오전",pm:"오후",midnight:"자정",noon:"정오",morning:"아침",afternoon:"오후",evening:"저녁",night:"밤"},abbreviated:{am:"오전",pm:"오후",midnight:"자정",noon:"정오",morning:"아침",afternoon:"오후",evening:"저녁",night:"밤"},wide:{am:"오전",pm:"오후",midnight:"자정",noon:"정오",morning:"아침",afternoon:"오후",evening:"저녁",night:"밤"}},Mb={ordinalNumber:(n,r)=>{const e=Number(n);switch(String(r==null?void 0:r.unit)){case"minute":case"second":return String(e);case"date":return e+"일";default:return e+"번째"}},era:ct({values:Eb,defaultWidth:"wide"}),quarter:ct({values:kb,defaultWidth:"wide",argumentCallback:n=>n-1}),month:ct({values:Sb,defaultWidth:"wide"}),day:ct({values:Cb,defaultWidth:"wide"}),dayPeriod:ct({values:_b,defaultWidth:"wide",formattingValues:Ob,defaultFormattingWidth:"wide"})},Pb=/^(\d+)(일|번째)?/i,Tb=/\d+/i,Nb={narrow:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(기원전|서기)/i},Ib={any:[/^(bc|기원전)/i,/^(ad|서기)/i]},Fb={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234]사?분기/i},Lb={any:[/1/i,/2/i,/3/i,/4/i]},$b={narrow:/^(1[012]|[123456789])/,abbreviated:/^(1[012]|[123456789])월/i,wide:/^(1[012]|[123456789])월/i},Ab={any:[/^1월?$/,/^2/,/^3/,/^4/,/^5/,/^6/,/^7/,/^8/,/^9/,/^10/,/^11/,/^12/]},Yb={narrow:/^[일월화수목금토]/,short:/^[일월화수목금토]/,abbreviated:/^[일월화수목금토]/,wide:/^[일월화수목금토]요일/},Wb={any:[/^일/,/^월/,/^화/,/^수/,/^목/,/^금/,/^토/]},jb={any:/^(am|pm|오전|오후|자정|정오|아침|저녁|밤)/i},Hb={any:{am:/^(am|오전)/i,pm:/^(pm|오후)/i,midnight:/^자정/i,noon:/^정오/i,morning:/^아침/i,afternoon:/^오후/i,evening:/^저녁/i,night:/^밤/i}},Rb={ordinalNumber:gu({matchPattern:Pb,parsePattern:Tb,valueCallback:n=>parseInt(n,10)}),era:dt({matchPatterns:Nb,defaultMatchWidth:"wide",parsePatterns:Ib,defaultParseWidth:"any"}),quarter:dt({matchPatterns:Fb,defaultMatchWidth:"wide",parsePatterns:Lb,defaultParseWidth:"any",valueCallback:n=>n+1}),month:dt({matchPatterns:$b,defaultMatchWidth:"wide",parsePatterns:Ab,defaultParseWidth:"any"}),day:dt({matchPatterns:Yb,defaultMatchWidth:"wide",parsePatterns:Wb,defaultParseWidth:"any"}),dayPeriod:dt({matchPatterns:jb,defaultMatchWidth:"any",parsePatterns:Hb,defaultParseWidth:"any"})},Bb={code:"ko",formatDistance:vb,formatLong:wb,formatRelative:Db,localize:Mb,match:Rb,options:{weekStartsOn:0,firstWeekContainsDate:1}};var co=typeof document<"u"?d.useLayoutEffect:d.useEffect;const Vb={...F}.useInsertionEffect||(n=>n());function zb(n){const r=F.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return Vb(()=>{r.current=n}),F.useCallback(function(){for(var e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];return r.current==null?void 0:r.current(...t)},[])}const Ub={...F};let Fu=!1,Qb=0;const Lu=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+Qb++;function Kb(){const[n,r]=F.useState(()=>Fu?Lu():void 0);return co(()=>{n==null&&r(Lu())},[]),F.useEffect(()=>{Fu=!0},[]),n}const $u=Ub.useId||Kb;let ur;process.env.NODE_ENV!=="production"&&(ur=new Set);function qb(){for(var n,r=arguments.length,e=new Array(r),t=0;t<r;t++)e[t]=arguments[t];const o="Floating UI: "+e.join(" ");if(!((n=ur)!=null&&n.has(o))){var a;(a=ur)==null||a.add(o),console.warn(o)}}function Gb(){for(var n,r=arguments.length,e=new Array(r),t=0;t<r;t++)e[t]=arguments[t];const o="Floating UI: "+e.join(" ");if(!((n=ur)!=null&&n.has(o))){var a;(a=ur)==null||a.add(o),console.error(o)}}const Xb=F.forwardRef(function(r,e){const{context:{placement:t,elements:{floating:o},middlewareData:{arrow:a,shift:i}},width:s=14,height:l=7,tipRadius:u=0,strokeWidth:c=0,staticOffset:p,stroke:m,d:f,style:{transform:h,...v}={},...g}=r;process.env.NODE_ENV!=="production"&&(e||qb("The `ref` prop is required for `FloatingArrow`."));const w=$u(),[y,x]=F.useState(!1);if(co(()=>{if(!o)return;qe(o).direction==="rtl"&&x(!0)},[o]),!o)return null;const[E,k]=t.split("-"),C=E==="top"||E==="bottom";let S=p;(C&&i!=null&&i.x||!C&&i!=null&&i.y)&&(S=null);const D=c*2,_=D/2,O=s/2*(u/-8+1),T=l/2*u/4,Y=!!f,W=S&&k==="end"?"bottom":"top";let N=S&&k==="end"?"right":"left";S&&y&&(N=k==="end"?"left":"right");const L=(a==null?void 0:a.x)!=null?S||a.x:"",$=(a==null?void 0:a.y)!=null?S||a.y:"",z=f||"M0,0"+(" H"+s)+(" L"+(s-O)+","+(l-T))+(" Q"+s/2+","+l+" "+O+","+(l-T))+" Z",P={top:Y?"rotate(180deg)":"",left:Y?"rotate(90deg)":"rotate(-90deg)",bottom:Y?"":"rotate(180deg)",right:Y?"rotate(-90deg)":"rotate(90deg)"}[E];return M.jsxs("svg",{...g,"aria-hidden":!0,ref:e,width:Y?s:s+D,height:s,viewBox:"0 0 "+s+" "+(l>s?l:s),style:{position:"absolute",pointerEvents:"none",[N]:L,[W]:$,[E]:C||Y?"100%":"calc(100% - "+D/2+"px)",transform:[P,h].filter(q=>!!q).join(" "),...v},children:[D>0&&M.jsx("path",{clipPath:"url(#"+w+")",fill:"none",stroke:m,strokeWidth:D+(f?0:1),d:z}),M.jsx("path",{stroke:D&&!f?g.fill:"none",d:z}),M.jsx("clipPath",{id:w,children:M.jsx("rect",{x:-_,y:_*(Y?-1:1),width:s+D,height:s})})]})});function Jb(){const n=new Map;return{emit(r,e){var t;(t=n.get(r))==null||t.forEach(o=>o(e))},on(r,e){n.has(r)||n.set(r,new Set),n.get(r).add(e)},off(r,e){var t;(t=n.get(r))==null||t.delete(e)}}}const Zb=F.createContext(null),ey=F.createContext(null),ty=()=>{var n;return((n=F.useContext(Zb))==null?void 0:n.id)||null},ny=()=>F.useContext(ey);function ry(n){const{open:r=!1,onOpenChange:e,elements:t}=n,o=$u(),a=F.useRef({}),[i]=F.useState(()=>Jb()),s=ty()!=null;if(process.env.NODE_ENV!=="production"){const f=t.reference;f&&!Pe(f)&&Gb("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[l,u]=F.useState(t.reference),c=zb((f,h,v)=>{a.current.openEvent=f?h:void 0,i.emit("openchange",{open:f,event:h,reason:v,nested:s}),e==null||e(f,h,v)}),p=F.useMemo(()=>({setPositionReference:u}),[]),m=F.useMemo(()=>({reference:l||t.reference||null,floating:t.floating||null,domReference:t.reference}),[l,t.reference,t.floating]);return F.useMemo(()=>({dataRef:a,open:r,onOpenChange:c,elements:m,events:i,floatingId:o,refs:p}),[r,c,m,i,o,p])}function oy(n){n===void 0&&(n={});const{nodeId:r}=n,e=ry({...n,elements:{reference:null,floating:null,...n.elements}}),t=n.rootContext||e,o=t.elements,[a,i]=F.useState(null),[s,l]=F.useState(null),c=(o==null?void 0:o.domReference)||a,p=F.useRef(null),m=ny();co(()=>{c&&(p.current=c)},[c]);const f=Vs({...n,elements:{...o,...s&&{reference:s}}}),h=F.useCallback(x=>{const E=Pe(x)?{getBoundingClientRect:()=>x.getBoundingClientRect(),getClientRects:()=>x.getClientRects(),contextElement:x}:x;l(E),f.refs.setReference(E)},[f.refs]),v=F.useCallback(x=>{(Pe(x)||x===null)&&(p.current=x,i(x)),(Pe(f.refs.reference.current)||f.refs.reference.current===null||x!==null&&!Pe(x))&&f.refs.setReference(x)},[f.refs]),g=F.useMemo(()=>({...f.refs,setReference:v,setPositionReference:h,domReference:p}),[f.refs,v,h]),w=F.useMemo(()=>({...f.elements,domReference:c}),[f.elements,c]),y=F.useMemo(()=>({...f,...t,refs:g,elements:w,nodeId:r}),[f,g,w,r,t]);return co(()=>{t.dataRef.current.floatingContext=y;const x=m==null?void 0:m.nodesRef.current.find(E=>E.id===r);x&&(x.context=y)}),F.useMemo(()=>({...f,context:y,refs:g,elements:w}),[f,g,w,y])}/*!
|
|
48
|
+
*/var ll;function Up(){return ll||(ll=1,process.env.NODE_ENV!=="production"&&function(){function n(l,u){return l===u&&(l!==0||1/l===1/u)||l!==l&&u!==u}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var r=d,e=typeof Object.is=="function"?Object.is:n,t=r.useSyncExternalStore,o=r.useRef,a=r.useEffect,i=r.useMemo,s=r.useDebugValue;Sa.useSyncExternalStoreWithSelector=function(l,u,c,p,m){var f=o(null);if(f.current===null){var h={hasValue:!1,value:null};f.current=h}else h=f.current;f=i(function(){function g(k){if(!w){if(w=!0,y=k,k=p(k),m!==void 0&&h.hasValue){var C=h.value;if(m(C,k))return x=C}return x=k}if(C=x,e(y,k))return C;var S=p(k);return m!==void 0&&m(C,S)?(y=k,C):(y=k,x=S)}var w=!1,y,x,E=c===void 0?null:c;return[function(){return g(u())},E===null?void 0:function(){return g(E())}]},[u,c,p,m]);var v=t(l,f[0],f[1]);return a(function(){h.hasValue=!0,h.value=v},[v]),s(v),v},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),Sa}var ul;function Qp(){return ul||(ul=1,process.env.NODE_ENV==="production"?Rr.exports=zp():Rr.exports=Up()),Rr.exports}var Kp=Qp(),cl=(n,r,e)=>{if(!r.has(n))throw TypeError("Cannot "+e)},nt=(n,r,e)=>(cl(n,r,"read from private field"),e?e.call(n):r.get(n)),Ca=(n,r,e)=>{if(r.has(n))throw TypeError("Cannot add the same private member more than once");r instanceof WeakSet?r.add(n):r.set(n,e)},dl=(n,r,e,t)=>(cl(n,r,"write to private field"),r.set(n,e),e),Et,Xn,Jn;let fl=class{constructor(r){Ca(this,Et,{}),Ca(this,Xn,new us(()=>new Set)),Ca(this,Jn,new Set),dl(this,Et,r)}get state(){return nt(this,Et)}subscribe(r,e){let t={selector:r,callback:e,current:r(nt(this,Et))};return nt(this,Jn).add(t),()=>{nt(this,Jn).delete(t)}}on(r,e){return nt(this,Xn).get(r).add(e),()=>{nt(this,Xn).get(r).delete(e)}}send(r){dl(this,Et,this.reduce(nt(this,Et),r));for(let e of nt(this,Jn)){let t=e.selector(nt(this,Et));pl(e.current,t)||(e.current=t,e.callback(t))}for(let e of nt(this,Xn).get(r.type))e(nt(this,Et),r)}};Et=new WeakMap,Xn=new WeakMap,Jn=new WeakMap;function pl(n,r){return Object.is(n,r)?!0:typeof n!="object"||n===null||typeof r!="object"||r===null?!1:Array.isArray(n)&&Array.isArray(r)?n.length!==r.length?!1:_a(n[Symbol.iterator](),r[Symbol.iterator]()):n instanceof Map&&r instanceof Map||n instanceof Set&&r instanceof Set?n.size!==r.size?!1:_a(n.entries(),r.entries()):ml(n)&&ml(r)?_a(Object.entries(n)[Symbol.iterator](),Object.entries(r)[Symbol.iterator]()):!1}function _a(n,r){do{let e=n.next(),t=r.next();if(e.done&&t.done)return!0;if(e.done||t.done||!Object.is(e.value,t.value))return!1}while(!0)}function ml(n){if(Object.prototype.toString.call(n)!=="[object Object]")return!1;let r=Object.getPrototypeOf(n);return r===null||Object.getPrototypeOf(r)===null}function Oa(n){let[r,e]=n(),t=et();return(...o)=>{r(...o),t.dispose(),t.microTask(e)}}function ye(n,r,e=pl){return Kp.useSyncExternalStoreWithSelector(V(t=>n.subscribe(qp,t)),V(()=>n.state),V(()=>n.state),V(r),e)}function qp(n){return n}function Gp(n){function r(){document.readyState!=="loading"&&(n(),document.removeEventListener("DOMContentLoaded",r))}typeof window<"u"&&typeof document<"u"&&(document.addEventListener("DOMContentLoaded",r),r())}let lt=[];Gp(()=>{function n(r){if(!(r.target instanceof HTMLElement)||r.target===document.body||lt[0]===r.target)return;let e=r.target;e=e.closest(Pr),lt.unshift(e??r.target),lt=lt.filter(t=>t!=null&&t.isConnected),lt.splice(10)}window.addEventListener("click",n,{capture:!0}),window.addEventListener("mousedown",n,{capture:!0}),window.addEventListener("focus",n,{capture:!0}),document.body.addEventListener("click",n,{capture:!0}),document.body.addEventListener("mousedown",n,{capture:!0}),document.body.addEventListener("focus",n,{capture:!0})});function Xp(n){throw new Error("Unexpected object: "+n)}var se=(n=>(n[n.First=0]="First",n[n.Previous=1]="Previous",n[n.Next=2]="Next",n[n.Last=3]="Last",n[n.Specific=4]="Specific",n[n.Nothing=5]="Nothing",n))(se||{});function Zn(n,r){let e=r.resolveItems();if(e.length<=0)return null;let t=r.resolveActiveIndex(),o=t??-1;switch(n.focus){case 0:{for(let a=0;a<e.length;++a)if(!r.resolveDisabled(e[a],a,e))return a;return t}case 1:{o===-1&&(o=e.length);for(let a=o-1;a>=0;--a)if(!r.resolveDisabled(e[a],a,e))return a;return t}case 2:{for(let a=o+1;a<e.length;++a)if(!r.resolveDisabled(e[a],a,e))return a;return t}case 3:{for(let a=e.length-1;a>=0;--a)if(!r.resolveDisabled(e[a],a,e))return a;return t}case 4:{for(let a=0;a<e.length;++a)if(r.resolveId(e[a],a,e)===n.id)return a;return t}case 5:return null;default:Xp(n)}}var Ma=(n=>(n[n.Left=0]="Left",n[n.Right=2]="Right",n))(Ma||{});function hl(n){let r=V(n),e=d.useRef(!1);d.useEffect(()=>(e.current=!1,()=>{e.current=!0,kr(()=>{e.current&&r()})}),[r])}function Jp(){let n=typeof document>"u";return"useSyncExternalStore"in F?(r=>r.useSyncExternalStore)(F)(()=>()=>{},()=>!1,()=>!n):!1}function er(){let n=Jp(),[r,e]=F.useState(qt.isHandoffComplete);return r&&qt.isHandoffComplete===!1&&e(!1),F.useEffect(()=>{r!==!0&&e(!0)},[r]),F.useEffect(()=>qt.handoff(),[]),n?!1:r}let vl=d.createContext(!1);function Zp(){return d.useContext(vl)}function gl(n){return d.createElement(vl.Provider,{value:n.force},n.children)}function em(n){let r=Zp(),e=d.useContext(yl),[t,o]=d.useState(()=>{var a;if(!r&&e!==null)return(a=e.current)!=null?a:null;if(qt.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 d.useEffect(()=>{t!==null&&(n!=null&&n.body.contains(t)||n==null||n.body.appendChild(t))},[t,n]),d.useEffect(()=>{r||e!==null&&o(e.current)},[e,o,r]),t}let bl=d.Fragment,tm=De(function(n,r){let{ownerDocument:e=null,...t}=n,o=d.useRef(null),a=Le(zd(f=>{o.current=f}),r),i=xt(o),s=e??i,l=em(s),[u]=d.useState(()=>{var f;return qt.isServer?null:(f=s==null?void 0:s.createElement("div"))!=null?f:null}),c=d.useContext(Pa),p=er();ce(()=>{!l||!u||l.contains(u)||(u.setAttribute("data-headlessui-portal",""),l.appendChild(u))},[l,u]),ce(()=>{if(u&&c)return c.register(u)},[c,u]),hl(()=>{var f;!l||!u||(u instanceof Node&&l.contains(u)&&l.removeChild(u),l.childNodes.length<=0&&((f=l.parentElement)==null||f.removeChild(l)))});let m=Ce();return p?!l||!u?null:Se.createPortal(m({ourProps:{ref:a},theirProps:t,slot:{},defaultTag:bl,name:"Portal"}),u):null});function nm(n,r){let e=Le(r),{enabled:t=!0,ownerDocument:o,...a}=n,i=Ce();return t?d.createElement(tm,{...a,ownerDocument:o,ref:e}):i({ourProps:{ref:e},theirProps:a,slot:{},defaultTag:bl,name:"Portal"})}let rm=d.Fragment,yl=d.createContext(null);function om(n,r){let{target:e,...t}=n,o={ref:Le(r)},a=Ce();return d.createElement(yl.Provider,{value:e},a({ourProps:o,theirProps:t,defaultTag:rm,name:"Popover.Group"}))}let Pa=d.createContext(null);function am(){let n=d.useContext(Pa),r=d.useRef([]),e=V(a=>(r.current.push(a),n&&n.register(a),()=>t(a))),t=V(a=>{let i=r.current.indexOf(a);i!==-1&&r.current.splice(i,1),n&&n.unregister(a)}),o=d.useMemo(()=>({register:e,unregister:t,portals:r}),[e,t,r]);return[r,d.useMemo(()=>function({children:a}){return d.createElement(Pa.Provider,{value:o},a)},[o])]}let im=De(nm),wl=De(om),Ta=Object.assign(im,{Group:wl});var sm=Object.defineProperty,lm=(n,r,e)=>r in n?sm(n,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[r]=e,xl=(n,r,e)=>(lm(n,typeof r!="symbol"?r+"":r,e),e),ie=(n=>(n[n.Open=0]="Open",n[n.Closed=1]="Closed",n))(ie||{}),Qe=(n=>(n[n.Single=0]="Single",n[n.Multi=1]="Multi",n))(Qe||{}),jt=(n=>(n[n.Pointer=0]="Pointer",n[n.Focus=1]="Focus",n[n.Other=2]="Other",n))(jt||{}),Dl=(n=>(n[n.OpenCombobox=0]="OpenCombobox",n[n.CloseCombobox=1]="CloseCombobox",n[n.GoToOption=2]="GoToOption",n[n.SetTyping=3]="SetTyping",n[n.RegisterOption=4]="RegisterOption",n[n.UnregisterOption=5]="UnregisterOption",n[n.DefaultToFirstOption=6]="DefaultToFirstOption",n[n.SetActivationTrigger=7]="SetActivationTrigger",n[n.UpdateVirtualConfiguration=8]="UpdateVirtualConfiguration",n[n.SetInputElement=9]="SetInputElement",n[n.SetButtonElement=10]="SetButtonElement",n[n.SetOptionsElement=11]="SetOptionsElement",n))(Dl||{});function Na(n,r=e=>e){let e=n.activeOptionIndex!==null?n.options[n.activeOptionIndex]:null,t=r(n.options.slice()),o=t.length>0&&t[0].dataRef.current.order!==null?t.sort((i,s)=>i.dataRef.current.order-s.dataRef.current.order):ea(t,i=>i.dataRef.current.domRef.current),a=e?o.indexOf(e):null;return a===-1&&(a=null),{options:o,activeOptionIndex:a}}let um={1(n){var r;return(r=n.dataRef.current)!=null&&r.disabled||n.comboboxState===1?n:{...n,activeOptionIndex:null,comboboxState:1,isTyping:!1,activationTrigger:2,__demoMode:!1}},0(n){var r,e;if((r=n.dataRef.current)!=null&&r.disabled||n.comboboxState===0)return n;if((e=n.dataRef.current)!=null&&e.value){let t=n.dataRef.current.calculateIndex(n.dataRef.current.value);if(t!==-1)return{...n,activeOptionIndex:t,comboboxState:0,__demoMode:!1}}return{...n,comboboxState:0,__demoMode:!1}},3(n,r){return n.isTyping===r.isTyping?n:{...n,isTyping:r.isTyping}},2(n,r){var e,t,o,a;if((e=n.dataRef.current)!=null&&e.disabled||n.optionsElement&&!((t=n.dataRef.current)!=null&&t.optionsPropsRef.current.static)&&n.comboboxState===1)return n;if(n.virtual){let{options:u,disabled:c}=n.virtual,p=r.focus===se.Specific?r.idx:Zn(r,{resolveItems:()=>u,resolveActiveIndex:()=>{var f,h;return(h=(f=n.activeOptionIndex)!=null?f:u.findIndex(v=>!c(v)))!=null?h:null},resolveDisabled:c,resolveId(){throw new Error("Function not implemented.")}}),m=(o=r.trigger)!=null?o:2;return n.activeOptionIndex===p&&n.activationTrigger===m?n:{...n,activeOptionIndex:p,activationTrigger:m,isTyping:!1,__demoMode:!1}}let i=Na(n);if(i.activeOptionIndex===null){let u=i.options.findIndex(c=>!c.dataRef.current.disabled);u!==-1&&(i.activeOptionIndex=u)}let s=r.focus===se.Specific?r.idx:Zn(r,{resolveItems:()=>i.options,resolveActiveIndex:()=>i.activeOptionIndex,resolveId:u=>u.id,resolveDisabled:u=>u.dataRef.current.disabled}),l=(a=r.trigger)!=null?a:2;return n.activeOptionIndex===s&&n.activationTrigger===l?n:{...n,...i,isTyping:!1,activeOptionIndex:s,activationTrigger:l,__demoMode:!1}},4:(n,r)=>{var e,t,o,a;if((e=n.dataRef.current)!=null&&e.virtual)return{...n,options:[...n.options,r.payload]};let i=r.payload,s=Na(n,u=>(u.push(i),u));n.activeOptionIndex===null&&(o=(t=n.dataRef.current).isSelected)!=null&&o.call(t,r.payload.dataRef.current.value)&&(s.activeOptionIndex=s.options.indexOf(i));let l={...n,...s,activationTrigger:2};return(a=n.dataRef.current)!=null&&a.__demoMode&&n.dataRef.current.value===void 0&&(l.activeOptionIndex=0),l},5:(n,r)=>{var e;if((e=n.dataRef.current)!=null&&e.virtual)return{...n,options:n.options.filter(o=>o.id!==r.id)};let t=Na(n,o=>{let a=o.findIndex(i=>i.id===r.id);return a!==-1&&o.splice(a,1),o});return{...n,...t,activationTrigger:2}},6:(n,r)=>n.defaultToFirstOption===r.value?n:{...n,defaultToFirstOption:r.value},7:(n,r)=>n.activationTrigger===r.trigger?n:{...n,activationTrigger:r.trigger},8:(n,r)=>{var e,t;if(n.virtual===null)return{...n,virtual:{options:r.options,disabled:(e=r.disabled)!=null?e:()=>!1}};if(n.virtual.options===r.options&&n.virtual.disabled===r.disabled)return n;let o=n.activeOptionIndex;if(n.activeOptionIndex!==null){let a=r.options.indexOf(n.virtual.options[n.activeOptionIndex]);a!==-1?o=a:o=null}return{...n,activeOptionIndex:o,virtual:{options:r.options,disabled:(t=r.disabled)!=null?t:()=>!1}}},9:(n,r)=>n.inputElement===r.element?n:{...n,inputElement:r.element},10:(n,r)=>n.buttonElement===r.element?n:{...n,buttonElement:r.element},11:(n,r)=>n.optionsElement===r.element?n:{...n,optionsElement:r.element}},cm=class Ec extends fl{constructor(){super(...arguments),xl(this,"actions",{onChange:r=>{let{onChange:e,compare:t,mode:o,value:a}=this.state.dataRef.current;return Fe(o,{0:()=>e==null?void 0:e(r),1:()=>{let i=a.slice(),s=i.findIndex(l=>t(l,r));return s===-1?i.push(r):i.splice(s,1),e==null?void 0:e(i)}})},registerOption:(r,e)=>(this.send({type:4,payload:{id:r,dataRef:e}}),()=>{this.state.activeOptionIndex===this.state.dataRef.current.calculateIndex(e.current.value)&&this.send({type:6,value:!0}),this.send({type:5,id:r})}),goToOption:(r,e)=>(this.send({type:6,value:!1}),this.send({type:2,...r,trigger:e})),setIsTyping:r=>{this.send({type:3,isTyping:r})},closeCombobox:()=>{var r,e;this.send({type:1}),this.send({type:6,value:!1}),(e=(r=this.state.dataRef.current).onClose)==null||e.call(r)},openCombobox:()=>{this.send({type:0}),this.send({type:6,value:!0})},setActivationTrigger:r=>{this.send({type:7,trigger:r})},selectActiveOption:()=>{let r=this.selectors.activeOptionIndex(this.state);if(r!==null){if(this.actions.setIsTyping(!1),this.state.virtual)this.actions.onChange(this.state.virtual.options[r]);else{let{dataRef:e}=this.state.options[r];this.actions.onChange(e.current.value)}this.actions.goToOption({focus:se.Specific,idx:r})}},setInputElement:r=>{this.send({type:9,element:r})},setButtonElement:r=>{this.send({type:10,element:r})},setOptionsElement:r=>{this.send({type:11,element:r})}}),xl(this,"selectors",{activeDescendantId:r=>{var e,t;let o=this.selectors.activeOptionIndex(r);if(o!==null)return r.virtual?(t=r.options.find(a=>!a.dataRef.current.disabled&&r.dataRef.current.compare(a.dataRef.current.value,r.virtual.options[o])))==null?void 0:t.id:(e=r.options[o])==null?void 0:e.id},activeOptionIndex:r=>{if(r.defaultToFirstOption&&r.activeOptionIndex===null&&(r.virtual?r.virtual.options.length>0:r.options.length>0)){if(r.virtual){let{options:t,disabled:o}=r.virtual,a=t.findIndex(i=>{var s;return!((s=o==null?void 0:o(i))!=null&&s)});if(a!==-1)return a}let e=r.options.findIndex(t=>!t.dataRef.current.disabled);if(e!==-1)return e}return r.activeOptionIndex},activeOption:r=>{var e,t;let o=this.selectors.activeOptionIndex(r);return o===null?null:r.virtual?r.virtual.options[o??0]:(t=(e=r.options[o])==null?void 0:e.dataRef.current.value)!=null?t:null},isActive:(r,e,t)=>{var o;let a=this.selectors.activeOptionIndex(r);return a===null?!1:r.virtual?a===r.dataRef.current.calculateIndex(e):((o=r.options[a])==null?void 0:o.id)===t},shouldScrollIntoView:(r,e,t)=>!(r.virtual||r.__demoMode||r.comboboxState!==0||r.activationTrigger===0||!this.selectors.isActive(r,e,t))})}static new({virtual:r=null,__demoMode:e=!1}={}){var t;return new Ec({dataRef:{current:{}},comboboxState:e?0:1,isTyping:!1,options:[],virtual:r?{options:r.options,disabled:(t=r.disabled)!=null?t:()=>!1}:null,activeOptionIndex:null,activationTrigger:2,inputElement:null,buttonElement:null,optionsElement:null,__demoMode:e})}reduce(r,e){return Fe(e.type,um,r,e)}};const El=d.createContext(null);function tr(n){let r=d.useContext(El);if(r===null){let e=new Error(`<${n} /> is missing a parent <Combobox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(e,kl),e}return r}function kl({virtual:n=null,__demoMode:r=!1}={}){return d.useMemo(()=>cm.new({virtual:n,__demoMode:r}),[])}let nr=d.createContext(null);nr.displayName="ComboboxDataContext";function kn(n){let r=d.useContext(nr);if(r===null){let e=new Error(`<${n} /> is missing a parent <Combobox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(e,kn),e}return r}let Sl=d.createContext(null);function dm(n){let r=tr("VirtualProvider"),e=kn("VirtualProvider"),{options:t}=e.virtual,o=ye(r,f=>f.optionsElement),[a,i]=d.useMemo(()=>{let f=o;if(!f)return[0,0];let h=window.getComputedStyle(f);return[parseFloat(h.paddingBlockStart||h.paddingTop),parseFloat(h.paddingBlockEnd||h.paddingBottom)]},[o]),s=pf({enabled:t.length!==0,scrollPaddingStart:a,scrollPaddingEnd:i,count:t.length,estimateSize(){return 40},getScrollElement(){return r.state.optionsElement},overscan:12}),[l,u]=d.useState(0);ce(()=>{u(f=>f+1)},[t]);let c=s.getVirtualItems(),p=ye(r,f=>f.activationTrigger===jt.Pointer),m=ye(r,r.selectors.activeOptionIndex);return c.length===0?null:d.createElement(Sl.Provider,{value:s},d.createElement("div",{style:{position:"relative",width:"100%",height:`${s.getTotalSize()}px`},ref:f=>{f&&(p||m!==null&&t.length>m&&s.scrollToIndex(m))}},c.map(f=>{var h;return d.createElement(d.Fragment,{key:f.key},d.cloneElement((h=n.children)==null?void 0:h.call(n,{...n.slot,option:t[f.index]}),{key:`${l}-${f.key}`,"data-index":f.index,"aria-setsize":t.length,"aria-posinset":f.index+1,style:{position:"absolute",top:0,left:0,transform:`translateY(${f.start}px)`,overflowAnchor:"none"}}))})))}let fm=d.Fragment;function pm(n,r){let e=Sr(),{value:t,defaultValue:o,onChange:a,form:i,name:s,by:l,invalid:u=!1,disabled:c=e||!1,onClose:p,__demoMode:m=!1,multiple:f=!1,immediate:h=!1,virtual:v=null,nullable:g,...w}=n,y=Ui(o),[x=f?[]:void 0,E]=zi(t,a,y),k=kl({virtual:v,__demoMode:m}),C=d.useRef({static:!1,hold:!1}),S=ls(l),D=V(Z=>v?l===null?v.options.indexOf(Z):v.options.findIndex(A=>S(A,Z)):k.state.options.findIndex(A=>S(A.dataRef.current.value,Z))),_=d.useCallback(Z=>Fe(Y.mode,{[Qe.Multi]:()=>x.some(A=>S(A,Z)),[Qe.Single]:()=>S(x,Z)}),[x]),O=ye(k,Z=>Z.virtual),T=V(()=>p==null?void 0:p()),Y=d.useMemo(()=>({__demoMode:m,immediate:h,optionsPropsRef:C,value:x,defaultValue:y,disabled:c,invalid:u,mode:f?Qe.Multi:Qe.Single,virtual:v?O:null,onChange:E,isSelected:_,calculateIndex:D,compare:S,onClose:T}),[x,y,c,u,f,E,_,m,k,v,O,T]);ce(()=>{var Z;v&&k.send({type:Dl.UpdateVirtualConfiguration,options:v.options,disabled:(Z=v.disabled)!=null?Z:null})},[v,v==null?void 0:v.options,v==null?void 0:v.disabled]),ce(()=>{k.state.dataRef.current=Y},[Y]);let[W,N,L,$]=ye(k,Z=>[Z.comboboxState,Z.buttonElement,Z.inputElement,Z.optionsElement]),z=W===ie.Open;ta(z,[N,L,$],()=>k.actions.closeCombobox());let P=ye(k,k.selectors.activeOptionIndex),q=ye(k,k.selectors.activeOption),X=d.useMemo(()=>({open:W===ie.Open,disabled:c,invalid:u,activeIndex:P,activeOption:q,value:x}),[Y,c,x,u,q,W]),[G,Oe]=rs(),te=r===null?{}:{ref:r},H=d.useCallback(()=>{if(y!==void 0)return E==null?void 0:E(y)},[E,y]),we=Ce();return d.createElement(Oe,{value:G,props:{htmlFor:L==null?void 0:L.id},slot:{open:W===ie.Open,disabled:c}},d.createElement(ol,null,d.createElement(nr.Provider,{value:Y},d.createElement(El.Provider,{value:k},d.createElement(Ea,{value:Fe(W,{[ie.Open]:Ye.Open,[ie.Closed]:Ye.Closed})},s!=null&&d.createElement(Gi,{disabled:c,data:x!=null?{[s]:x}:{},form:i,onReset:H}),we({ourProps:te,theirProps:w,slot:X,defaultTag:fm,name:"Combobox"}))))))}let mm="input";function hm(n,r){var e,t;let o=tr("Combobox.Input"),a=kn("Combobox.Input"),i=d.useId(),s=Uo(),{id:l=s||`headlessui-combobox-input-${i}`,onChange:u,displayValue:c,disabled:p=a.disabled||!1,autoFocus:m=!1,type:f="text",...h}=n,[v]=ye(o,H=>[H.inputElement]),g=d.useRef(null),w=Le(g,r,el(),o.actions.setInputElement),y=xt(v),[x,E]=ye(o,H=>[H.comboboxState,H.isTyping]),k=Ft(),C=V(()=>{o.actions.onChange(null),o.state.optionsElement&&(o.state.optionsElement.scrollTop=0),o.actions.goToOption({focus:se.Nothing})}),S=d.useMemo(()=>{var H;return typeof c=="function"&&a.value!==void 0?(H=c(a.value))!=null?H:"":typeof a.value=="string"?a.value:""},[a.value,c]);Un(([H,we],[Z,A])=>{if(o.state.isTyping)return;let J=g.current;J&&((A===ie.Open&&we===ie.Closed||H!==Z)&&(J.value=H),requestAnimationFrame(()=>{if(o.state.isTyping||!J||(y==null?void 0:y.activeElement)!==J)return;let{selectionStart:le,selectionEnd:oe}=J;Math.abs((oe??0)-(le??0))===0&&le===0&&J.setSelectionRange(J.value.length,J.value.length)}))},[S,x,y,E]),Un(([H],[we])=>{if(H===ie.Open&&we===ie.Closed){if(o.state.isTyping)return;let Z=g.current;if(!Z)return;let A=Z.value,{selectionStart:J,selectionEnd:le,selectionDirection:oe}=Z;Z.value="",Z.value=A,oe!==null?Z.setSelectionRange(J,le,oe):Z.setSelectionRange(J,le)}},[x]);let D=d.useRef(!1),_=V(()=>{D.current=!0}),O=V(()=>{k.nextFrame(()=>{D.current=!1})}),T=V(H=>{switch(o.actions.setIsTyping(!0),H.key){case de.Enter:if(o.state.comboboxState!==ie.Open||D.current)return;if(H.preventDefault(),H.stopPropagation(),o.selectors.activeOptionIndex(o.state)===null){o.actions.closeCombobox();return}o.actions.selectActiveOption(),a.mode===Qe.Single&&o.actions.closeCombobox();break;case de.ArrowDown:return H.preventDefault(),H.stopPropagation(),Fe(o.state.comboboxState,{[ie.Open]:()=>o.actions.goToOption({focus:se.Next}),[ie.Closed]:()=>o.actions.openCombobox()});case de.ArrowUp:return H.preventDefault(),H.stopPropagation(),Fe(o.state.comboboxState,{[ie.Open]:()=>o.actions.goToOption({focus:se.Previous}),[ie.Closed]:()=>{Se.flushSync(()=>o.actions.openCombobox()),a.value||o.actions.goToOption({focus:se.Last})}});case de.Home:if(H.shiftKey)break;return H.preventDefault(),H.stopPropagation(),o.actions.goToOption({focus:se.First});case de.PageUp:return H.preventDefault(),H.stopPropagation(),o.actions.goToOption({focus:se.First});case de.End:if(H.shiftKey)break;return H.preventDefault(),H.stopPropagation(),o.actions.goToOption({focus:se.Last});case de.PageDown:return H.preventDefault(),H.stopPropagation(),o.actions.goToOption({focus:se.Last});case de.Escape:return o.state.comboboxState!==ie.Open?void 0:(H.preventDefault(),o.state.optionsElement&&!a.optionsPropsRef.current.static&&H.stopPropagation(),a.mode===Qe.Single&&a.value===null&&C(),o.actions.closeCombobox());case de.Tab:if(o.state.comboboxState!==ie.Open)return;a.mode===Qe.Single&&o.state.activationTrigger!==jt.Focus&&o.actions.selectActiveOption(),o.actions.closeCombobox();break}}),Y=V(H=>{u==null||u(H),a.mode===Qe.Single&&H.target.value===""&&C(),o.actions.openCombobox()}),W=V(H=>{var we,Z,A;let J=(we=H.relatedTarget)!=null?we:lt.find(le=>le!==H.currentTarget);if(!((Z=o.state.optionsElement)!=null&&Z.contains(J))&&!((A=o.state.buttonElement)!=null&&A.contains(J))&&o.state.comboboxState===ie.Open)return H.preventDefault(),a.mode===Qe.Single&&a.value===null&&C(),o.actions.closeCombobox()}),N=V(H=>{var we,Z,A;let J=(we=H.relatedTarget)!=null?we:lt.find(le=>le!==H.currentTarget);(Z=o.state.buttonElement)!=null&&Z.contains(J)||(A=o.state.optionsElement)!=null&&A.contains(J)||a.disabled||a.immediate&&o.state.comboboxState!==ie.Open&&k.microTask(()=>{Se.flushSync(()=>o.actions.openCombobox()),o.actions.setActivationTrigger(jt.Focus)})}),L=Bn(),$=es(),{isFocused:z,focusProps:P}=Ro({autoFocus:m}),{isHovered:q,hoverProps:X}=Ho({isDisabled:p}),G=ye(o,H=>H.optionsElement),Oe=d.useMemo(()=>({open:x===ie.Open,disabled:p,invalid:a.invalid,hover:q,focus:z,autofocus:m}),[a,q,z,m,p,a.invalid]),te=Hn({ref:w,id:l,role:"combobox",type:f,"aria-controls":G==null?void 0:G.id,"aria-expanded":x===ie.Open,"aria-activedescendant":ye(o,o.selectors.activeDescendantId),"aria-labelledby":L,"aria-describedby":$,"aria-autocomplete":"list",defaultValue:(t=(e=n.defaultValue)!=null?e:a.defaultValue!==void 0?c==null?void 0:c(a.defaultValue):null)!=null?t:a.defaultValue,disabled:p||void 0,autoFocus:m,onCompositionStart:_,onCompositionEnd:O,onKeyDown:T,onChange:Y,onFocus:N,onBlur:W},P,X);return Ce()({ourProps:te,theirProps:h,slot:Oe,defaultTag:mm,name:"Combobox.Input"})}let vm="button";function gm(n,r){let e=tr("Combobox.Button"),t=kn("Combobox.Button"),[o,a]=d.useState(null),i=Le(r,a,e.actions.setButtonElement),s=d.useId(),{id:l=`headlessui-combobox-button-${s}`,disabled:u=t.disabled||!1,autoFocus:c=!1,...p}=n,m=ye(e,T=>T.inputElement),f=ws(m),h=V(T=>{switch(T.key){case de.Space:case de.Enter:T.preventDefault(),T.stopPropagation(),e.state.comboboxState===ie.Closed&&Se.flushSync(()=>e.actions.openCombobox()),f();return;case de.ArrowDown:T.preventDefault(),T.stopPropagation(),e.state.comboboxState===ie.Closed&&(Se.flushSync(()=>e.actions.openCombobox()),e.state.dataRef.current.value||e.actions.goToOption({focus:se.First})),f();return;case de.ArrowUp:T.preventDefault(),T.stopPropagation(),e.state.comboboxState===ie.Closed&&(Se.flushSync(()=>e.actions.openCombobox()),e.state.dataRef.current.value||e.actions.goToOption({focus:se.Last})),f();return;case de.Escape:if(e.state.comboboxState!==ie.Open)return;T.preventDefault(),e.state.optionsElement&&!t.optionsPropsRef.current.static&&T.stopPropagation(),Se.flushSync(()=>e.actions.closeCombobox()),f();return;default:return}}),v=V(T=>{T.preventDefault(),!Xi(T.currentTarget)&&(T.button===Ma.Left&&(e.state.comboboxState===ie.Open?e.actions.closeCombobox():e.actions.openCombobox()),f())}),g=Bn([l]),{isFocusVisible:w,focusProps:y}=Ro({autoFocus:c}),{isHovered:x,hoverProps:E}=Ho({isDisabled:u}),{pressed:k,pressProps:C}=Bi({disabled:u}),[S,D]=ye(e,T=>[T.comboboxState,T.optionsElement]),_=d.useMemo(()=>({open:S===ie.Open,active:k||S===ie.Open,disabled:u,invalid:t.invalid,value:t.value,hover:x,focus:w}),[t,x,w,k,u,S]),O=Hn({ref:i,id:l,type:xs(n,o),tabIndex:-1,"aria-haspopup":"listbox","aria-controls":D==null?void 0:D.id,"aria-expanded":S===ie.Open,"aria-labelledby":g,disabled:u||void 0,autoFocus:c,onMouseDown:v,onKeyDown:h},y,E,C);return Ce()({ourProps:O,theirProps:p,slot:_,defaultTag:vm,name:"Combobox.Button"})}let bm="div",ym=Lt.RenderStrategy|Lt.Static;function wm(n,r){var e,t,o;let a=d.useId(),{id:i=`headlessui-combobox-options-${a}`,hold:s=!1,anchor:l,portal:u=!1,modal:c=!0,transition:p=!1,...m}=n,f=tr("Combobox.Options"),h=kn("Combobox.Options"),v=Zs(l);v&&(u=!0);let[g,w]=nl(v),[y,x]=d.useState(null),E=tl(),k=Le(r,v?g:null,f.actions.setOptionsElement,x),[C,S,D,_,O]=ye(f,oe=>[oe.comboboxState,oe.inputElement,oe.buttonElement,oe.optionsElement,oe.activationTrigger]),T=xt(S||D),Y=xt(_),W=En(),[N,L]=aa(p,y,W!==null?(W&Ye.Open)===Ye.Open:C===ie.Open);Xo(N,S,f.actions.closeCombobox);let $=h.__demoMode?!1:c&&C===ie.Open;ra($,Y);let z=h.__demoMode?!1:c&&C===ie.Open;Go(z,{allowed:d.useCallback(()=>[S,D,_],[S,D,_])}),ce(()=>{var oe;h.optionsPropsRef.current.static=(oe=n.static)!=null?oe:!1},[h.optionsPropsRef,n.static]),ce(()=>{h.optionsPropsRef.current.hold=s},[h.optionsPropsRef,s]),Lf(C===ie.Open,{container:_,accept(oe){return oe.getAttribute("role")==="option"?NodeFilter.FILTER_REJECT:oe.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT},walk(oe){oe.setAttribute("role","none")}});let P=Bn([D==null?void 0:D.id]),q=d.useMemo(()=>({open:C===ie.Open,option:void 0}),[C]),X=V(()=>{f.actions.setActivationTrigger(jt.Pointer)}),G=V(oe=>{oe.preventDefault(),f.actions.setActivationTrigger(jt.Pointer)}),Oe=Hn(v?E():{},{"aria-labelledby":P,role:"listbox","aria-multiselectable":h.mode===Qe.Multi?!0:void 0,id:i,ref:k,style:{...m.style,...w,"--input-width":Ko(S,!0).width,"--button-width":Ko(D,!0).width},onWheel:O===jt.Pointer?void 0:X,onMouseDown:G,...oa(L)}),te=N&&C===ie.Closed,H=jr(te,(e=h.virtual)==null?void 0:e.options),we=jr(te,h.value),Z=V(oe=>h.compare(we,oe)),A=d.useMemo(()=>{if(!h.virtual)return h;if(H===void 0)throw new Error("Missing `options` in virtual mode");return H!==h.virtual.options?{...h,virtual:{...h.virtual,options:H}}:h},[h,H,(t=h.virtual)==null?void 0:t.options]);h.virtual&&Object.assign(m,{children:d.createElement(nr.Provider,{value:A},d.createElement(dm,{slot:q},m.children))});let J=Ce(),le=d.useMemo(()=>h.mode===Qe.Multi?h:{...h,isSelected:Z},[h,Z]);return d.createElement(Ta,{enabled:u?n.static||N:!1,ownerDocument:T},d.createElement(nr.Provider,{value:le},J({ourProps:Oe,theirProps:{...m,children:d.createElement(Bp,{freeze:te},typeof m.children=="function"?(o=m.children)==null?void 0:o.call(m,q):m.children)},slot:q,defaultTag:bm,features:ym,visible:N,name:"Combobox.Options"})))}let xm="div";function Dm(n,r){var e,t,o;let a=kn("Combobox.Option"),i=tr("Combobox.Option"),s=d.useId(),{id:l=`headlessui-combobox-option-${s}`,value:u,disabled:c=(o=(t=(e=a.virtual)==null?void 0:e.disabled)==null?void 0:t.call(e,u))!=null?o:!1,order:p=null,...m}=n,[f]=ye(i,L=>[L.inputElement]),h=ws(f),v=ye(i,d.useCallback(L=>i.selectors.isActive(L,u,l),[u,l])),g=a.isSelected(u),w=d.useRef(null),y=yt({disabled:c,value:u,domRef:w,order:p}),x=d.useContext(Sl),E=Le(r,w,x?x.measureElement:null),k=V(()=>{i.actions.setIsTyping(!1),i.actions.onChange(u)});ce(()=>i.actions.registerOption(l,y),[y,l]);let C=ye(i,d.useCallback(L=>i.selectors.shouldScrollIntoView(L,u,l),[u,l]));ce(()=>{if(C)return et().requestAnimationFrame(()=>{var L,$;($=(L=w.current)==null?void 0:L.scrollIntoView)==null||$.call(L,{block:"nearest"})})},[C,w]);let S=V(L=>{L.preventDefault(),L.button===Ma.Left&&(c||(k(),gs()||requestAnimationFrame(()=>h()),a.mode===Qe.Single&&i.actions.closeCombobox()))}),D=V(()=>{if(c)return i.actions.goToOption({focus:se.Nothing});let L=a.calculateIndex(u);i.actions.goToOption({focus:se.Specific,idx:L})}),_=Es(),O=V(L=>_.update(L)),T=V(L=>{if(!_.wasMoved(L)||c||v)return;let $=a.calculateIndex(u);i.actions.goToOption({focus:se.Specific,idx:$},jt.Pointer)}),Y=V(L=>{_.wasMoved(L)&&(c||v&&(a.optionsPropsRef.current.hold||i.actions.goToOption({focus:se.Nothing})))}),W=d.useMemo(()=>({active:v,focus:v,selected:g,disabled:c}),[v,g,c]),N={id:l,ref:E,role:"option",tabIndex:c===!0?void 0:-1,"aria-disabled":c===!0?!0:void 0,"aria-selected":g,disabled:void 0,onMouseDown:S,onFocus:D,onPointerEnter:O,onMouseEnter:O,onPointerMove:T,onMouseMove:T,onPointerLeave:Y,onMouseLeave:Y};return Ce()({ourProps:N,theirProps:m,slot:W,defaultTag:xm,name:"Combobox.Option"})}let Em=De(pm),km=De(gm),Cl=De(hm),Sm=Mr,_l=De(wm),Ol=De(Dm),Cm=Object.assign(Em,{Input:Cl,Button:km,Label:Sm,Options:_l,Option:Ol});function _m(n,r=typeof document<"u"?document.defaultView:null,e){let t=vn(n,"escape");na(r,"keydown",o=>{t&&(o.defaultPrevented||o.key===de.Escape&&e(o))})}function Om(){var n;let[r]=d.useState(()=>typeof window<"u"&&typeof window.matchMedia=="function"?window.matchMedia("(pointer: coarse)"):null),[e,t]=d.useState((n=r==null?void 0:r.matches)!=null?n:!1);return ce(()=>{if(!r)return;function o(a){t(a.matches)}return r.addEventListener("change",o),()=>r.removeEventListener("change",o)},[r]),e}function Mm({defaultContainers:n=[],portals:r,mainTreeNode:e}={}){let t=xt(e),o=V(()=>{var a,i;let s=[];for(let l of n)l!==null&&(l instanceof HTMLElement?s.push(l):"current"in l&&l.current instanceof HTMLElement&&s.push(l.current));if(r!=null&&r.current)for(let l of r.current)s.push(l);for(let l of(a=t==null?void 0:t.querySelectorAll("html > *, body > *"))!=null?a:[])l!==document.body&&l!==document.head&&l instanceof HTMLElement&&l.id!=="headlessui-portal-root"&&(e&&(l.contains(e)||l.contains((i=e==null?void 0:e.getRootNode())==null?void 0:i.host))||s.some(u=>l.contains(u))||s.push(l));return s});return{resolveContainers:o,contains:V(a=>o().some(i=>i.contains(a)))}}let Ml=d.createContext(null);function Pl({children:n,node:r}){let[e,t]=d.useState(null),o=Tl(r??e);return d.createElement(Ml.Provider,{value:o},n,o===null&&d.createElement(Rn,{features:mn.Hidden,ref:a=>{var i,s;if(a){for(let l of(s=(i=Gt(a))==null?void 0:i.querySelectorAll("html > *, body > *"))!=null?s:[])if(l!==document.body&&l!==document.head&&l instanceof HTMLElement&&l!=null&&l.contains(a)){t(l);break}}}}))}function Tl(n=null){var r;return(r=d.useContext(Ml))!=null?r:n}function Ia(){let n=d.useRef(!1);return ce(()=>(n.current=!0,()=>{n.current=!1}),[]),n}var rr=(n=>(n[n.Forwards=0]="Forwards",n[n.Backwards=1]="Backwards",n))(rr||{});function Pm(){let n=d.useRef(0);return bs(!0,"keydown",r=>{r.key==="Tab"&&(n.current=r.shiftKey?1:0)},!0),n}function Nl(n){if(!n)return new Set;if(typeof n=="function")return new Set(n());let r=new Set;for(let e of n.current)e.current instanceof HTMLElement&&r.add(e.current);return r}let Tm="div";var tn=(n=>(n[n.None=0]="None",n[n.InitialFocus=1]="InitialFocus",n[n.TabLock=2]="TabLock",n[n.FocusLock=4]="FocusLock",n[n.RestoreFocus=8]="RestoreFocus",n[n.AutoFocus=16]="AutoFocus",n))(tn||{});function Nm(n,r){let e=d.useRef(null),t=Le(e,r),{initialFocus:o,initialFocusFallback:a,containers:i,features:s=15,...l}=n;er()||(s=0);let u=xt(e);$m(s,{ownerDocument:u});let c=Am(s,{ownerDocument:u,container:e,initialFocus:o,initialFocusFallback:a});Ym(s,{ownerDocument:u,container:e,containers:i,previousActiveElement:c});let p=Pm(),m=V(y=>{let x=e.current;x&&(E=>E())(()=>{Fe(p.current,{[rr.Forwards]:()=>{gn(x,tt.First,{skipElements:[y.relatedTarget,a]})},[rr.Backwards]:()=>{gn(x,tt.Last,{skipElements:[y.relatedTarget,a]})}})})}),f=vn(!!(s&2),"focus-trap#tab-lock"),h=Ft(),v=d.useRef(!1),g={ref:t,onKeyDown(y){y.key=="Tab"&&(v.current=!0,h.requestAnimationFrame(()=>{v.current=!1}))},onBlur(y){if(!(s&4))return;let x=Nl(i);e.current instanceof HTMLElement&&x.add(e.current);let E=y.relatedTarget;E instanceof HTMLElement&&E.dataset.headlessuiFocusGuard!=="true"&&(Il(x,E)||(v.current?gn(e.current,Fe(p.current,{[rr.Forwards]:()=>tt.Next,[rr.Backwards]:()=>tt.Previous})|tt.WrapAround,{relativeTo:y.target}):y.target instanceof HTMLElement&&wt(y.target)))}},w=Ce();return d.createElement(d.Fragment,null,f&&d.createElement(Rn,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:m,features:mn.Focusable}),w({ourProps:g,theirProps:l,defaultTag:Tm,name:"FocusTrap"}),f&&d.createElement(Rn,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:m,features:mn.Focusable}))}let Im=De(Nm),Fm=Object.assign(Im,{features:tn});function Lm(n=!0){let r=d.useRef(lt.slice());return Un(([e],[t])=>{t===!0&&e===!1&&kr(()=>{r.current.splice(0)}),t===!1&&e===!0&&(r.current=lt.slice())},[n,lt,r]),V(()=>{var e;return(e=r.current.find(t=>t!=null&&t.isConnected))!=null?e:null})}function $m(n,{ownerDocument:r}){let e=!!(n&8),t=Lm(e);Un(()=>{e||(r==null?void 0:r.activeElement)===(r==null?void 0:r.body)&&wt(t())},[e]),hl(()=>{e&&wt(t())})}function Am(n,{ownerDocument:r,container:e,initialFocus:t,initialFocusFallback:o}){let a=d.useRef(null),i=vn(!!(n&1),"focus-trap#initial-focus"),s=Ia();return Un(()=>{if(n===0)return;if(!i){o!=null&&o.current&&wt(o.current);return}let l=e.current;l&&kr(()=>{if(!s.current)return;let u=r==null?void 0:r.activeElement;if(t!=null&&t.current){if((t==null?void 0:t.current)===u){a.current=u;return}}else if(l.contains(u)){a.current=u;return}if(t!=null&&t.current)wt(t.current);else{if(n&16){if(gn(l,tt.First|tt.AutoFocus)!==Jo.Error)return}else if(gn(l,tt.First)!==Jo.Error)return;if(o!=null&&o.current&&(wt(o.current),(r==null?void 0:r.activeElement)===o.current))return;console.warn("There are no focusable elements inside the <FocusTrap />")}a.current=r==null?void 0:r.activeElement})},[o,i,n]),a}function Ym(n,{ownerDocument:r,container:e,containers:t,previousActiveElement:o}){let a=Ia(),i=!!(n&4);na(r==null?void 0:r.defaultView,"focus",s=>{if(!i||!a.current)return;let l=Nl(t);e.current instanceof HTMLElement&&l.add(e.current);let u=o.current;if(!u)return;let c=s.target;c&&c instanceof HTMLElement?Il(l,c)?(o.current=c,wt(c)):(s.preventDefault(),s.stopPropagation(),wt(u)):wt(o.current)},!0)}function Il(n,r){for(let e of n)if(e.contains(r))return!0;return!1}function Fl(n){var r;return!!(n.enter||n.enterFrom||n.enterTo||n.leave||n.leaveFrom||n.leaveTo)||((r=n.as)!=null?r:$l)!==d.Fragment||d.Children.count(n.children)===1}let Br=d.createContext(null);Br.displayName="TransitionContext";var Wm=(n=>(n.Visible="visible",n.Hidden="hidden",n))(Wm||{});function jm(){let n=d.useContext(Br);if(n===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return n}function Hm(){let n=d.useContext(Vr);if(n===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return n}let Vr=d.createContext(null);Vr.displayName="NestingContext";function zr(n){return"children"in n?zr(n.children):n.current.filter(({el:r})=>r.current!==null).filter(({state:r})=>r==="visible").length>0}function Ll(n,r){let e=yt(n),t=d.useRef([]),o=Ia(),a=Ft(),i=V((f,h=$t.Hidden)=>{let v=t.current.findIndex(({el:g})=>g===f);v!==-1&&(Fe(h,{[$t.Unmount](){t.current.splice(v,1)},[$t.Hidden](){t.current[v].state="hidden"}}),a.microTask(()=>{var g;!zr(t)&&o.current&&((g=e.current)==null||g.call(e))}))}),s=V(f=>{let h=t.current.find(({el:v})=>v===f);return h?h.state!=="visible"&&(h.state="visible"):t.current.push({el:f,state:"visible"}),()=>i(f,$t.Unmount)}),l=d.useRef([]),u=d.useRef(Promise.resolve()),c=d.useRef({enter:[],leave:[]}),p=V((f,h,v)=>{l.current.splice(0),r&&(r.chains.current[h]=r.chains.current[h].filter(([g])=>g!==f)),r==null||r.chains.current[h].push([f,new Promise(g=>{l.current.push(g)})]),r==null||r.chains.current[h].push([f,new Promise(g=>{Promise.all(c.current[h].map(([w,y])=>y)).then(()=>g())})]),h==="enter"?u.current=u.current.then(()=>r==null?void 0:r.wait.current).then(()=>v(h)):v(h)}),m=V((f,h,v)=>{Promise.all(c.current[h].splice(0).map(([g,w])=>w)).then(()=>{var g;(g=l.current.shift())==null||g()}).then(()=>v(h))});return d.useMemo(()=>({children:t,register:s,unregister:i,onStart:p,onStop:m,wait:u,chains:c}),[s,i,t,p,m,c,u])}let $l=d.Fragment,Al=Lt.RenderStrategy;function Rm(n,r){var e,t;let{transition:o=!0,beforeEnter:a,afterEnter:i,beforeLeave:s,afterLeave:l,enter:u,enterFrom:c,enterTo:p,entered:m,leave:f,leaveFrom:h,leaveTo:v,...g}=n,[w,y]=d.useState(null),x=d.useRef(null),E=Fl(n),k=Le(...E?[x,r,y]:r===null?[]:[r]),C=(e=g.unmount)==null||e?$t.Unmount:$t.Hidden,{show:S,appear:D,initial:_}=jm(),[O,T]=d.useState(S?"visible":"hidden"),Y=Hm(),{register:W,unregister:N}=Y;ce(()=>W(x),[W,x]),ce(()=>{if(C===$t.Hidden&&x.current){if(S&&O!=="visible"){T("visible");return}return Fe(O,{hidden:()=>N(x),visible:()=>W(x)})}},[O,x,W,N,S,C]);let L=er();ce(()=>{if(E&&L&&O==="visible"&&x.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[x,O,L,E]);let $=_&&!D,z=D&&S&&_,P=d.useRef(!1),q=Ll(()=>{P.current||(T("hidden"),N(x))},Y),X=V(A=>{P.current=!0;let J=A?"enter":"leave";q.onStart(x,J,le=>{le==="enter"?a==null||a():le==="leave"&&(s==null||s())})}),G=V(A=>{let J=A?"enter":"leave";P.current=!1,q.onStop(x,J,le=>{le==="enter"?i==null||i():le==="leave"&&(l==null||l())}),J==="leave"&&!zr(q)&&(T("hidden"),N(x))});d.useEffect(()=>{E&&o||(X(S),G(S))},[S,E,o]);let Oe=!(!o||!E||!L||$),[,te]=aa(Oe,w,S,{start:X,end:G}),H=At({ref:k,className:((t=Vo(g.className,z&&u,z&&c,te.enter&&u,te.enter&&te.closed&&c,te.enter&&!te.closed&&p,te.leave&&f,te.leave&&!te.closed&&h,te.leave&&te.closed&&v,!te.transition&&S&&m))==null?void 0:t.trim())||void 0,...oa(te)}),we=0;O==="visible"&&(we|=Ye.Open),O==="hidden"&&(we|=Ye.Closed),S&&O==="hidden"&&(we|=Ye.Opening),!S&&O==="visible"&&(we|=Ye.Closing);let Z=Ce();return d.createElement(Vr.Provider,{value:q},d.createElement(Ea,{value:we},Z({ourProps:H,theirProps:g,defaultTag:$l,features:Al,visible:O==="visible",name:"Transition.Child"})))}function Bm(n,r){let{show:e,appear:t=!1,unmount:o=!0,...a}=n,i=d.useRef(null),s=Fl(n),l=Le(...s?[i,r]:r===null?[]:[r]);er();let u=En();if(e===void 0&&u!==null&&(e=(u&Ye.Open)===Ye.Open),e===void 0)throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[c,p]=d.useState(e?"visible":"hidden"),m=Ll(()=>{e||p("hidden")}),[f,h]=d.useState(!0),v=d.useRef([e]);ce(()=>{f!==!1&&v.current[v.current.length-1]!==e&&(v.current.push(e),h(!1))},[v,e]);let g=d.useMemo(()=>({show:e,appear:t,initial:f}),[e,t,f]);ce(()=>{e?p("visible"):!zr(m)&&i.current!==null&&p("hidden")},[e,m]);let w={unmount:o},y=V(()=>{var k;f&&h(!1),(k=n.beforeEnter)==null||k.call(n)}),x=V(()=>{var k;f&&h(!1),(k=n.beforeLeave)==null||k.call(n)}),E=Ce();return d.createElement(Vr.Provider,{value:m},d.createElement(Br.Provider,{value:g},E({ourProps:{...w,as:d.Fragment,children:d.createElement(Yl,{ref:l,...w,...a,beforeEnter:y,beforeLeave:x})},theirProps:{},defaultTag:d.Fragment,features:Al,visible:c==="visible",name:"Transition"})))}function Vm(n,r){let e=d.useContext(Br)!==null,t=En()!==null;return d.createElement(d.Fragment,null,!e&&t?d.createElement(Fa,{ref:r,...n}):d.createElement(Yl,{ref:r,...n}))}let Fa=De(Bm),Yl=De(Rm),La=De(Vm),Wl=Object.assign(Fa,{Child:La,Root:Fa});var zm=(n=>(n[n.Open=0]="Open",n[n.Closed=1]="Closed",n))(zm||{}),Um=(n=>(n[n.SetTitleId=0]="SetTitleId",n))(Um||{});let Qm={0(n,r){return n.titleId===r.id?n:{...n,titleId:r.id}}},$a=d.createContext(null);$a.displayName="DialogContext";function Ur(n){let r=d.useContext($a);if(r===null){let e=new Error(`<${n} /> is missing a parent <Dialog /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(e,Ur),e}return r}function Km(n,r){return Fe(r.type,Qm,n,r)}let jl=De(function(n,r){let e=d.useId(),{id:t=`headlessui-dialog-${e}`,open:o,onClose:a,initialFocus:i,role:s="dialog",autoFocus:l=!0,__demoMode:u=!1,unmount:c=!1,...p}=n,m=d.useRef(!1);s=function(){return s==="dialog"||s==="alertdialog"?s:(m.current||(m.current=!0,console.warn(`Invalid role [${s}] passed to <Dialog />. Only \`dialog\` and and \`alertdialog\` are supported. Using \`dialog\` instead.`)),"dialog")}();let f=En();o===void 0&&f!==null&&(o=(f&Ye.Open)===Ye.Open);let h=d.useRef(null),v=Le(h,r),g=xt(h),w=o?0:1,[y,x]=d.useReducer(Km,{titleId:null,descriptionId:null,panelRef:d.createRef()}),E=V(()=>a(!1)),k=V(G=>x({type:0,id:G})),C=er()?w===0:!1,[S,D]=am(),_={get current(){var G;return(G=y.panelRef.current)!=null?G:h.current}},O=Tl(),{resolveContainers:T}=Mm({mainTreeNode:O,portals:S,defaultContainers:[_]}),Y=f!==null?(f&Ye.Closing)===Ye.Closing:!1;Go(u||Y?!1:C,{allowed:V(()=>{var G,Oe;return[(Oe=(G=h.current)==null?void 0:G.closest("[data-headlessui-portal]"))!=null?Oe:null]}),disallowed:V(()=>{var G;return[(G=O==null?void 0:O.closest("body > *:not(#headlessui-portal-root)"))!=null?G:null]})}),ta(C,T,G=>{G.preventDefault(),E()}),_m(C,g==null?void 0:g.defaultView,G=>{G.preventDefault(),G.stopPropagation(),document.activeElement&&"blur"in document.activeElement&&typeof document.activeElement.blur=="function"&&document.activeElement.blur(),E()}),ra(u||Y?!1:C,g,T),Xo(C,h,E);let[W,N]=Ud(),L=d.useMemo(()=>[{dialogState:w,close:E,setTitleId:k,unmount:c},y],[w,y,E,k,c]),$=d.useMemo(()=>({open:w===0}),[w]),z={ref:v,id:t,role:s,tabIndex:-1,"aria-modal":u?void 0:w===0?!0:void 0,"aria-labelledby":y.titleId,"aria-describedby":W,unmount:c},P=!Om(),q=tn.None;C&&!u&&(q|=tn.RestoreFocus,q|=tn.TabLock,l&&(q|=tn.AutoFocus),P&&(q|=tn.InitialFocus));let X=Ce();return d.createElement(Vp,null,d.createElement(gl,{force:!0},d.createElement(Ta,null,d.createElement($a.Provider,{value:L},d.createElement(wl,{target:h},d.createElement(gl,{force:!1},d.createElement(N,{slot:$},d.createElement(D,null,d.createElement(Fm,{initialFocus:i,initialFocusFallback:h,containers:T,features:q},d.createElement(ef,{value:E},X({ourProps:z,theirProps:p,slot:$,defaultTag:qm,features:Gm,visible:w===0,name:"Dialog"})))))))))))}),qm="div",Gm=Lt.RenderStrategy|Lt.Static;function Xm(n,r){let{transition:e=!1,open:t,...o}=n,a=En(),i=n.hasOwnProperty("open")||a!==null,s=n.hasOwnProperty("onClose");if(!i&&!s)throw new Error("You have to provide an `open` and an `onClose` prop to the `Dialog` component.");if(!i)throw new Error("You provided an `onClose` prop to the `Dialog`, but forgot an `open` prop.");if(!s)throw new Error("You provided an `open` prop to the `Dialog`, but forgot an `onClose` prop.");if(!a&&typeof n.open!="boolean")throw new Error(`You provided an \`open\` prop to the \`Dialog\`, but the value is not a boolean. Received: ${n.open}`);if(typeof n.onClose!="function")throw new Error(`You provided an \`onClose\` prop to the \`Dialog\`, but the value is not a function. Received: ${n.onClose}`);return(t!==void 0||e)&&!o.static?d.createElement(Pl,null,d.createElement(Wl,{show:t,transition:e,unmount:o.unmount},d.createElement(jl,{ref:r,...o}))):d.createElement(Pl,null,d.createElement(jl,{ref:r,open:t,...o}))}let Jm="div";function Zm(n,r){let e=d.useId(),{id:t=`headlessui-dialog-panel-${e}`,transition:o=!1,...a}=n,[{dialogState:i,unmount:s},l]=Ur("Dialog.Panel"),u=Le(r,l.panelRef),c=d.useMemo(()=>({open:i===0}),[i]),p=V(g=>{g.stopPropagation()}),m={ref:u,id:t,onClick:p},f=o?La:d.Fragment,h=o?{unmount:s}:{},v=Ce();return d.createElement(f,{...h},v({ourProps:m,theirProps:a,slot:c,defaultTag:Jm,name:"Dialog.Panel"}))}let eh="div";function th(n,r){let{transition:e=!1,...t}=n,[{dialogState:o,unmount:a}]=Ur("Dialog.Backdrop"),i=d.useMemo(()=>({open:o===0}),[o]),s={ref:r,"aria-hidden":!0},l=e?La:d.Fragment,u=e?{unmount:a}:{},c=Ce();return d.createElement(l,{...u},c({ourProps:s,theirProps:t,slot:i,defaultTag:eh,name:"Dialog.Backdrop"}))}let nh="h2";function rh(n,r){let e=d.useId(),{id:t=`headlessui-dialog-title-${e}`,...o}=n,[{dialogState:a,setTitleId:i}]=Ur("Dialog.Title"),s=Le(r);d.useEffect(()=>(i(t),()=>i(null)),[t,i]);let l=d.useMemo(()=>({open:a===0}),[a]),u={ref:s,id:t};return Ce()({ourProps:u,theirProps:o,slot:l,defaultTag:nh,name:"Dialog.Title"})}let oh=De(Xm),Hl=De(Zm);De(th);let Rl=De(rh),or=Object.assign(oh,{Panel:Hl,Title:Rl,Description:ts});function ah(n,r){let e=d.useRef({left:0,top:0});if(ce(()=>{if(!r)return;let o=r.getBoundingClientRect();o&&(e.current=o)},[n,r]),r==null||!n||r===document.activeElement)return!1;let t=r.getBoundingClientRect();return t.top!==e.current.top||t.left!==e.current.left}let Bl=/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g;function Vl(n){var r,e;let t=(r=n.innerText)!=null?r:"",o=n.cloneNode(!0);if(!(o instanceof HTMLElement))return t;let a=!1;for(let s of o.querySelectorAll('[hidden],[aria-hidden],[role="img"]'))s.remove(),a=!0;let i=a?(e=o.innerText)!=null?e:"":t;return Bl.test(i)&&(i=i.replace(Bl,"")),i}function ih(n){let r=n.getAttribute("aria-label");if(typeof r=="string")return r.trim();let e=n.getAttribute("aria-labelledby");if(e){let t=e.split(" ").map(o=>{let a=document.getElementById(o);if(a){let i=a.getAttribute("aria-label");return typeof i=="string"?i.trim():Vl(a).trim()}return null}).filter(Boolean);if(t.length>0)return t.join(", ")}return Vl(n).trim()}function sh(n){let r=d.useRef(""),e=d.useRef("");return V(()=>{let t=n.current;if(!t)return"";let o=t.innerText;if(r.current===o)return e.current;let a=ih(t).trim().toLowerCase();return r.current=o,e.current=a,a})}var lh=Object.defineProperty,uh=(n,r,e)=>r in n?lh(n,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[r]=e,zl=(n,r,e)=>(uh(n,typeof r!="symbol"?r+"":r,e),e),je=(n=>(n[n.Open=0]="Open",n[n.Closed=1]="Closed",n))(je||{}),ut=(n=>(n[n.Single=0]="Single",n[n.Multi=1]="Multi",n))(ut||{}),Aa=(n=>(n[n.Pointer=0]="Pointer",n[n.Other=1]="Other",n))(Aa||{}),Ul=(n=>(n[n.OpenListbox=0]="OpenListbox",n[n.CloseListbox=1]="CloseListbox",n[n.GoToOption=2]="GoToOption",n[n.Search=3]="Search",n[n.ClearSearch=4]="ClearSearch",n[n.RegisterOptions=5]="RegisterOptions",n[n.UnregisterOptions=6]="UnregisterOptions",n[n.SetButtonElement=7]="SetButtonElement",n[n.SetOptionsElement=8]="SetOptionsElement",n[n.SortOptions=9]="SortOptions",n))(Ul||{});function Ql(n,r=e=>e){let e=n.activeOptionIndex!==null?n.options[n.activeOptionIndex]:null,t=ea(r(n.options.slice()),a=>a.dataRef.current.domRef.current),o=e?t.indexOf(e):null;return o===-1&&(o=null),{options:t,activeOptionIndex:o}}let ch={1(n){return n.dataRef.current.disabled||n.listboxState===1?n:{...n,activeOptionIndex:null,listboxState:1,__demoMode:!1}},0(n){if(n.dataRef.current.disabled||n.listboxState===0)return n;let r=n.activeOptionIndex,{isSelected:e}=n.dataRef.current,t=n.options.findIndex(o=>e(o.dataRef.current.value));return t!==-1&&(r=t),{...n,listboxState:0,activeOptionIndex:r,__demoMode:!1}},2(n,r){var e,t,o,a,i;if(n.dataRef.current.disabled||n.listboxState===1)return n;let s={...n,searchQuery:"",activationTrigger:(e=r.trigger)!=null?e:1,__demoMode:!1};if(r.focus===se.Nothing)return{...s,activeOptionIndex:null};if(r.focus===se.Specific)return{...s,activeOptionIndex:n.options.findIndex(c=>c.id===r.id)};if(r.focus===se.Previous){let c=n.activeOptionIndex;if(c!==null){let p=n.options[c].dataRef.current.domRef,m=Zn(r,{resolveItems:()=>n.options,resolveActiveIndex:()=>n.activeOptionIndex,resolveId:f=>f.id,resolveDisabled:f=>f.dataRef.current.disabled});if(m!==null){let f=n.options[m].dataRef.current.domRef;if(((t=p.current)==null?void 0:t.previousElementSibling)===f.current||((o=f.current)==null?void 0:o.previousElementSibling)===null)return{...s,activeOptionIndex:m}}}}else if(r.focus===se.Next){let c=n.activeOptionIndex;if(c!==null){let p=n.options[c].dataRef.current.domRef,m=Zn(r,{resolveItems:()=>n.options,resolveActiveIndex:()=>n.activeOptionIndex,resolveId:f=>f.id,resolveDisabled:f=>f.dataRef.current.disabled});if(m!==null){let f=n.options[m].dataRef.current.domRef;if(((a=p.current)==null?void 0:a.nextElementSibling)===f.current||((i=f.current)==null?void 0:i.nextElementSibling)===null)return{...s,activeOptionIndex:m}}}}let l=Ql(n),u=Zn(r,{resolveItems:()=>l.options,resolveActiveIndex:()=>l.activeOptionIndex,resolveId:c=>c.id,resolveDisabled:c=>c.dataRef.current.disabled});return{...s,...l,activeOptionIndex:u}},3:(n,r)=>{if(n.dataRef.current.disabled||n.listboxState===1)return n;let e=n.searchQuery!==""?0:1,t=n.searchQuery+r.value.toLowerCase(),o=(n.activeOptionIndex!==null?n.options.slice(n.activeOptionIndex+e).concat(n.options.slice(0,n.activeOptionIndex+e)):n.options).find(i=>{var s;return!i.dataRef.current.disabled&&((s=i.dataRef.current.textValue)==null?void 0:s.startsWith(t))}),a=o?n.options.indexOf(o):-1;return a===-1||a===n.activeOptionIndex?{...n,searchQuery:t}:{...n,searchQuery:t,activeOptionIndex:a,activationTrigger:1}},4(n){return n.dataRef.current.disabled||n.listboxState===1||n.searchQuery===""?n:{...n,searchQuery:""}},5:(n,r)=>{let e=n.options.concat(r.options),t=n.activeOptionIndex;if(n.activeOptionIndex===null){let{isSelected:o}=n.dataRef.current;if(o){let a=e.findIndex(i=>o==null?void 0:o(i.dataRef.current.value));a!==-1&&(t=a)}}return{...n,options:e,activeOptionIndex:t,pendingShouldSort:!0}},6:(n,r)=>{let e=n.options,t=[],o=new Set(r.options);for(let[a,i]of e.entries())if(o.has(i.id)&&(t.push(a),o.delete(i.id),o.size===0))break;if(t.length>0){e=e.slice();for(let a of t.reverse())e.splice(a,1)}return{...n,options:e,activationTrigger:1}},7:(n,r)=>n.buttonElement===r.element?n:{...n,buttonElement:r.element},8:(n,r)=>n.optionsElement===r.element?n:{...n,optionsElement:r.element},9:n=>n.pendingShouldSort?{...n,...Ql(n),pendingShouldSort:!1}:n};class Ya extends fl{constructor(r){super(r),zl(this,"actions",{onChange:e=>{let{onChange:t,compare:o,mode:a,value:i}=this.state.dataRef.current;return Fe(a,{0:()=>t==null?void 0:t(e),1:()=>{let s=i.slice(),l=s.findIndex(u=>o(u,e));return l===-1?s.push(e):s.splice(l,1),t==null?void 0:t(s)}})},registerOption:Oa(()=>{let e=[],t=new Set;return[(o,a)=>{t.has(a)||(t.add(a),e.push({id:o,dataRef:a}))},()=>(t.clear(),this.send({type:5,options:e.splice(0)}))]}),unregisterOption:Oa(()=>{let e=[];return[t=>e.push(t),()=>{this.send({type:6,options:e.splice(0)})}]}),goToOption:Oa(()=>{let e=null;return[(t,o)=>{e={type:2,...t,trigger:o}},()=>e&&this.send(e)]}),closeListbox:()=>{this.send({type:1})},openListbox:()=>{this.send({type:0})},selectActiveOption:()=>{if(this.state.activeOptionIndex!==null){let{dataRef:e,id:t}=this.state.options[this.state.activeOptionIndex];this.actions.onChange(e.current.value),this.send({type:2,focus:se.Specific,id:t})}},selectOption:e=>{let t=this.state.options.find(o=>o.id===e);t&&this.actions.onChange(t.dataRef.current.value)},search:e=>{this.send({type:3,value:e})},clearSearch:()=>{this.send({type:4})},setButtonElement:e=>{this.send({type:7,element:e})},setOptionsElement:e=>{this.send({type:8,element:e})}}),zl(this,"selectors",{activeDescendantId(e){var t;let o=e.activeOptionIndex,a=e.options;return o===null||(t=a[o])==null?void 0:t.id},isActive(e,t){var o;let a=e.activeOptionIndex,i=e.options;return a!==null?((o=i[a])==null?void 0:o.id)===t:!1},shouldScrollIntoView(e,t){return e.__demoMode||e.listboxState!==0||e.activationTrigger===0?!1:this.isActive(e,t)}}),this.on(5,()=>{requestAnimationFrame(()=>{this.send({type:9})})})}static new({__demoMode:r=!1}={}){return new Ya({dataRef:{current:{}},listboxState:r?0:1,options:[],searchQuery:"",activeOptionIndex:null,activationTrigger:1,buttonElement:null,optionsElement:null,__demoMode:r})}reduce(r,e){return Fe(e.type,ch,r,e)}}const Kl=d.createContext(null);function Wa(n){let r=d.useContext(Kl);if(r===null){let e=new Error(`<${n} /> is missing a parent <Listbox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(e,ql),e}return r}function ql({__demoMode:n=!1}={}){return d.useMemo(()=>Ya.new({__demoMode:n}),[])}let Qr=d.createContext(null);Qr.displayName="ListboxDataContext";function ar(n){let r=d.useContext(Qr);if(r===null){let e=new Error(`<${n} /> is missing a parent <Listbox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(e,ar),e}return r}let dh=d.Fragment;function fh(n,r){let e=Sr(),{value:t,defaultValue:o,form:a,name:i,onChange:s,by:l,invalid:u=!1,disabled:c=e||!1,horizontal:p=!1,multiple:m=!1,__demoMode:f=!1,...h}=n;const v=p?"horizontal":"vertical";let g=Le(r),w=Ui(o),[y=m?[]:void 0,x]=zi(t,s,w),E=ql({__demoMode:f}),k=d.useRef({static:!1,hold:!1}),C=d.useRef(new Map),S=ls(l),D=d.useCallback(X=>Fe(_.mode,{[ut.Multi]:()=>y.some(G=>S(G,X)),[ut.Single]:()=>S(y,X)}),[y]),_=d.useMemo(()=>({value:y,disabled:c,invalid:u,mode:m?ut.Multi:ut.Single,orientation:v,onChange:x,compare:S,isSelected:D,optionsPropsRef:k,listRef:C}),[y,c,u,m,v,x,S,D,k,C]);ce(()=>{E.state.dataRef.current=_},[_]);let O=ye(E,X=>X.listboxState),T=O===je.Open,[Y,W]=ye(E,X=>[X.buttonElement,X.optionsElement]);ta(T,[Y,W],(X,G)=>{E.send({type:Ul.CloseListbox}),hs(G,Zo.Loose)||(X.preventDefault(),Y==null||Y.focus())});let N=d.useMemo(()=>({open:O===je.Open,disabled:c,invalid:u,value:y}),[O,c,u,y]),[L,$]=rs({inherit:!0}),z={ref:g},P=d.useCallback(()=>{if(w!==void 0)return x==null?void 0:x(w)},[x,w]),q=Ce();return d.createElement($,{value:L,props:{htmlFor:Y==null?void 0:Y.id},slot:{open:O===je.Open,disabled:c}},d.createElement(ol,null,d.createElement(Kl.Provider,{value:E},d.createElement(Qr.Provider,{value:_},d.createElement(Ea,{value:Fe(O,{[je.Open]:Ye.Open,[je.Closed]:Ye.Closed})},i!=null&&y!=null&&d.createElement(Gi,{disabled:c,data:{[i]:y},form:a,onReset:P}),q({ourProps:z,theirProps:h,slot:N,defaultTag:dh,name:"Listbox"}))))))}let ph="button";function mh(n,r){let e=d.useId(),t=Uo(),o=ar("Listbox.Button"),a=Wa("Listbox.Button"),{id:i=t||`headlessui-listbox-button-${e}`,disabled:s=o.disabled||!1,autoFocus:l=!1,...u}=n,c=Le(r,el(),a.actions.setButtonElement),p=jp(),m=V(N=>{switch(N.key){case de.Enter:Ad(N.currentTarget);break;case de.Space:case de.ArrowDown:N.preventDefault(),Se.flushSync(()=>a.actions.openListbox()),o.value||a.actions.goToOption({focus:se.First});break;case de.ArrowUp:N.preventDefault(),Se.flushSync(()=>a.actions.openListbox()),o.value||a.actions.goToOption({focus:se.Last});break}}),f=V(N=>{switch(N.key){case de.Space:N.preventDefault();break}}),h=V(N=>{var L;if(N.button===0){if(Xi(N.currentTarget))return N.preventDefault();a.state.listboxState===je.Open?(Se.flushSync(()=>a.actions.closeListbox()),(L=a.state.buttonElement)==null||L.focus({preventScroll:!0})):(N.preventDefault(),a.actions.openListbox())}}),v=V(N=>N.preventDefault()),g=Bn([i]),w=es(),{isFocusVisible:y,focusProps:x}=Ro({autoFocus:l}),{isHovered:E,hoverProps:k}=Ho({isDisabled:s}),{pressed:C,pressProps:S}=Bi({disabled:s}),D=ye(a,N=>N.listboxState),_=d.useMemo(()=>({open:D===je.Open,active:C||D===je.Open,disabled:s,invalid:o.invalid,value:o.value,hover:E,focus:y,autofocus:l}),[D,o.value,s,E,y,C,o.invalid,l]),O=ye(a,N=>N.listboxState===je.Open),[T,Y]=ye(a,N=>[N.buttonElement,N.optionsElement]),W=Hn(p(),{ref:c,id:i,type:xs(n,T),"aria-haspopup":"listbox","aria-controls":Y==null?void 0:Y.id,"aria-expanded":O,"aria-labelledby":g,"aria-describedby":w,disabled:s||void 0,autoFocus:l,onKeyDown:m,onKeyUp:f,onKeyPress:v,onMouseDown:h},x,k,S);return Ce()({ourProps:W,theirProps:u,slot:_,defaultTag:ph,name:"Listbox.Button"})}let Gl=d.createContext(!1),hh="div",vh=Lt.RenderStrategy|Lt.Static;function gh(n,r){let e=d.useId(),{id:t=`headlessui-listbox-options-${e}`,anchor:o,portal:a=!1,modal:i=!0,transition:s=!1,...l}=n,u=Zs(o),[c,p]=d.useState(null);u&&(a=!0);let m=ar("Listbox.Options"),f=Wa("Listbox.Options"),[h,v,g,w]=ye(f,A=>[A.listboxState,A.buttonElement,A.optionsElement,A.__demoMode]),y=xt(v),x=xt(g),E=En(),[k,C]=aa(s,c,E!==null?(E&Ye.Open)===Ye.Open:h===je.Open);Xo(k,v,f.actions.closeListbox);let S=w?!1:i&&h===je.Open;ra(S,x);let D=w?!1:i&&h===je.Open;Go(D,{allowed:d.useCallback(()=>[v,g],[v,g])});let _=h!==je.Open,O=ah(_,v)?!1:k,T=k&&h===je.Closed,Y=jr(T,m.value),W=V(A=>m.compare(Y,A)),N=ye(f,A=>{var J;if(u==null||!((J=u==null?void 0:u.to)!=null&&J.includes("selection")))return null;let le=A.options.findIndex(oe=>W(oe.dataRef.current.value));return le===-1&&(le=0),le}),L=(()=>{if(u==null)return;if(N===null)return{...u,inner:void 0};let A=Array.from(m.listRef.current.values());return{...u,inner:{listRef:{current:A},index:N}}})(),[$,z]=nl(L),P=tl(),q=Le(r,u?$:null,f.actions.setOptionsElement,p),X=Ft();d.useEffect(()=>{var A;let J=g;J&&h===je.Open&&J!==((A=Gt(J))==null?void 0:A.activeElement)&&(J==null||J.focus({preventScroll:!0}))},[h,g]);let G=V(A=>{var J,le;switch(X.dispose(),A.key){case de.Space:if(f.state.searchQuery!=="")return A.preventDefault(),A.stopPropagation(),f.actions.search(A.key);case de.Enter:if(A.preventDefault(),A.stopPropagation(),f.state.activeOptionIndex!==null){let{dataRef:oe}=f.state.options[f.state.activeOptionIndex];f.actions.onChange(oe.current.value)}m.mode===ut.Single&&(Se.flushSync(()=>f.actions.closeListbox()),(J=f.state.buttonElement)==null||J.focus({preventScroll:!0}));break;case Fe(m.orientation,{vertical:de.ArrowDown,horizontal:de.ArrowRight}):return A.preventDefault(),A.stopPropagation(),f.actions.goToOption({focus:se.Next});case Fe(m.orientation,{vertical:de.ArrowUp,horizontal:de.ArrowLeft}):return A.preventDefault(),A.stopPropagation(),f.actions.goToOption({focus:se.Previous});case de.Home:case de.PageUp:return A.preventDefault(),A.stopPropagation(),f.actions.goToOption({focus:se.First});case de.End:case de.PageDown:return A.preventDefault(),A.stopPropagation(),f.actions.goToOption({focus:se.Last});case de.Escape:A.preventDefault(),A.stopPropagation(),Se.flushSync(()=>f.actions.closeListbox()),(le=f.state.buttonElement)==null||le.focus({preventScroll:!0});return;case de.Tab:A.preventDefault(),A.stopPropagation(),Se.flushSync(()=>f.actions.closeListbox()),Ef(f.state.buttonElement,A.shiftKey?tt.Previous:tt.Next);break;default:A.key.length===1&&(f.actions.search(A.key),X.setTimeout(()=>f.actions.clearSearch(),350));break}}),Oe=ye(f,A=>{var J;return(J=A.buttonElement)==null?void 0:J.id}),te=d.useMemo(()=>({open:h===je.Open}),[h]),H=Hn(u?P():{},{id:t,ref:q,"aria-activedescendant":ye(f,f.selectors.activeDescendantId),"aria-multiselectable":m.mode===ut.Multi?!0:void 0,"aria-labelledby":Oe,"aria-orientation":m.orientation,onKeyDown:G,role:"listbox",tabIndex:h===je.Open?0:void 0,style:{...l.style,...z,"--button-width":Ko(v,!0).width},...oa(C)}),we=Ce(),Z=d.useMemo(()=>m.mode===ut.Multi?m:{...m,isSelected:W},[m,W]);return d.createElement(Ta,{enabled:a?n.static||k:!1,ownerDocument:y},d.createElement(Qr.Provider,{value:Z},we({ourProps:H,theirProps:l,slot:te,defaultTag:hh,features:vh,visible:O,name:"Listbox.Options"})))}let bh="div";function yh(n,r){let e=d.useId(),{id:t=`headlessui-listbox-option-${e}`,disabled:o=!1,value:a,...i}=n,s=d.useContext(Gl)===!0,l=ar("Listbox.Option"),u=Wa("Listbox.Option"),c=ye(u,O=>u.selectors.isActive(O,t)),p=l.isSelected(a),m=d.useRef(null),f=sh(m),h=yt({disabled:o,value:a,domRef:m,get textValue(){return f()}}),v=Le(r,m,O=>{O?l.listRef.current.set(t,O):l.listRef.current.delete(t)}),g=ye(u,O=>u.selectors.shouldScrollIntoView(O,t));ce(()=>{if(g)return et().requestAnimationFrame(()=>{var O,T;(T=(O=m.current)==null?void 0:O.scrollIntoView)==null||T.call(O,{block:"nearest"})})},[g,m]),ce(()=>{if(!s)return u.actions.registerOption(t,h),()=>u.actions.unregisterOption(t)},[h,t,s]);let w=V(O=>{var T;if(o)return O.preventDefault();u.actions.onChange(a),l.mode===ut.Single&&(Se.flushSync(()=>u.actions.closeListbox()),(T=u.state.buttonElement)==null||T.focus({preventScroll:!0}))}),y=V(()=>{if(o)return u.actions.goToOption({focus:se.Nothing});u.actions.goToOption({focus:se.Specific,id:t})}),x=Es(),E=V(O=>{x.update(O),!o&&(c||u.actions.goToOption({focus:se.Specific,id:t},Aa.Pointer))}),k=V(O=>{x.wasMoved(O)&&(o||c||u.actions.goToOption({focus:se.Specific,id:t},Aa.Pointer))}),C=V(O=>{x.wasMoved(O)&&(o||c&&u.actions.goToOption({focus:se.Nothing}))}),S=d.useMemo(()=>({active:c,focus:c,selected:p,disabled:o,selectedOption:p&&s}),[c,p,o,s]),D=s?{}:{id:t,ref:v,role:"option",tabIndex:o===!0?void 0:-1,"aria-disabled":o===!0?!0:void 0,"aria-selected":p,disabled:void 0,onClick:w,onFocus:y,onPointerEnter:E,onMouseEnter:E,onPointerMove:k,onMouseMove:k,onPointerLeave:C,onMouseLeave:C},_=Ce();return!p&&s?null:_({ourProps:D,theirProps:i,slot:S,defaultTag:bh,name:"Listbox.Option"})}let wh=d.Fragment;function xh(n,r){let{options:e,placeholder:t,...o}=n,a={ref:Le(r)},i=ar("ListboxSelectedOption"),s=d.useMemo(()=>({}),[]),l=i.value===void 0||i.value===null||i.mode===ut.Multi&&Array.isArray(i.value)&&i.value.length===0,u=Ce();return d.createElement(Gl.Provider,{value:!0},u({ourProps:a,theirProps:{...o,children:d.createElement(d.Fragment,null,t&&l?t:e)},slot:s,defaultTag:wh,name:"ListboxSelectedOption"}))}let Dh=De(fh),Xl=De(mh),Eh=Mr,Jl=De(gh),Zl=De(yh),kh=De(xh),Sh=Object.assign(Dh,{Button:Xl,Label:Eh,Options:Jl,Option:Zl,SelectedOption:kh});var eu={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},tu=d.createContext&&d.createContext(eu),Ch=["attr","size","title"];function _h(n,r){if(n==null)return{};var e=Oh(n,r),t,o;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(n);for(o=0;o<a.length;o++)t=a[o],!(r.indexOf(t)>=0)&&Object.prototype.propertyIsEnumerable.call(n,t)&&(e[t]=n[t])}return e}function Oh(n,r){if(n==null)return{};var e={};for(var t in n)if(Object.prototype.hasOwnProperty.call(n,t)){if(r.indexOf(t)>=0)continue;e[t]=n[t]}return e}function Kr(){return Kr=Object.assign?Object.assign.bind():function(n){for(var r=1;r<arguments.length;r++){var e=arguments[r];for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(n[t]=e[t])}return n},Kr.apply(this,arguments)}function nu(n,r){var e=Object.keys(n);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(n);r&&(t=t.filter(function(o){return Object.getOwnPropertyDescriptor(n,o).enumerable})),e.push.apply(e,t)}return e}function qr(n){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?nu(Object(e),!0).forEach(function(t){Mh(n,t,e[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(e)):nu(Object(e)).forEach(function(t){Object.defineProperty(n,t,Object.getOwnPropertyDescriptor(e,t))})}return n}function Mh(n,r,e){return r=Ph(r),r in n?Object.defineProperty(n,r,{value:e,enumerable:!0,configurable:!0,writable:!0}):n[r]=e,n}function Ph(n){var r=Th(n,"string");return typeof r=="symbol"?r:r+""}function Th(n,r){if(typeof n!="object"||!n)return n;var e=n[Symbol.toPrimitive];if(e!==void 0){var t=e.call(n,r);if(typeof t!="object")return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(n)}function ru(n){return n&&n.map((r,e)=>d.createElement(r.tag,qr({key:e},r.attr),ru(r.child)))}function ir(n){return r=>d.createElement(Nh,Kr({attr:qr({},n.attr)},r),ru(n.child))}function Nh(n){var r=e=>{var{attr:t,size:o,title:a}=n,i=_h(n,Ch),s=o||e.size||"1em",l;return e.className&&(l=e.className),n.className&&(l=(l?l+" ":"")+n.className),d.createElement("svg",Kr({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},e.attr,t,i,{className:l,style:qr(qr({color:n.color||e.color},e.style),n.style),height:s,width:s,xmlns:"http://www.w3.org/2000/svg"}),a&&d.createElement("title",null,a),n.children)};return tu!==void 0?d.createElement(tu.Consumer,null,e=>r(e)):r(eu)}function Ih(n){return ir({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"M6.23 20.23 8 22l10-10L8 2 6.23 3.77 14.46 12z"},child:[]}]})(n)}function ou(n){return ir({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"},child:[]}]})(n)}const Fh=({checked:n,label:r,onChange:e,termImageUrl:t})=>{const[o,a]=d.useState(!1);return M.jsxs(M.Fragment,{children:[M.jsx(Lh,{isOpen:o,setIsOpen:a,termImageUrl:t}),M.jsxs("div",{className:"inline-flex items-center",children:[M.jsxs("label",{className:"relative flex cursor-pointer items-center rounded-full p-3",htmlFor:"check",children:[M.jsx("input",{type:"checkbox",className:"before:content[''] border-blue-gray-200 before:bg-blue-gray-500 peer bg-petnow-grey-primary checked:border-petnow-orange-primary checked:bg-petnow-orange-primary checked:before:bg-petnow-orange-primary relative size-6 cursor-pointer appearance-none rounded-xl border transition-all before:absolute before:top-2/4 before:left-2/4 before:block before:h-12 before:w-12 before:-translate-x-2/4 before:-translate-y-2/4 before:rounded-full before:opacity-0 before:transition-opacity",id:r,checked:n,onChange:i=>{e(i.target.checked)}}),M.jsx("span",{className:"text-petnow-grey-secondary pointer-events-none absolute top-2/4 left-2/4 -translate-x-2/4 -translate-y-2/4 transition peer-checked:text-white",children:M.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4",viewBox:"0 0 20 20",fill:"currentColor",stroke:"currentColor",strokeWidth:"1",children:M.jsx("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})})})]}),r&&M.jsxs("div",{className:"flex items-center",children:[M.jsx("label",{className:"cursor-pointer font-medium",htmlFor:r,children:r}),M.jsx(Ih,{onClick:()=>{a(!0)},className:"text-petnow-grey-tertiary mt-[2.5px] ml-2 cursor-pointer",size:24})]})]})]})},Lh=({isOpen:n,setIsOpen:r,termImageUrl:e})=>M.jsxs(or,{open:n,onClose:()=>r(!1),className:"relative z-50",children:[M.jsx("div",{className:"fixed inset-0 bg-black/30","aria-hidden":"true"}),M.jsx("div",{className:"fixed inset-0 w-screen overflow-y-auto",children:M.jsx("div",{className:"flex min-h-full items-center justify-center p-4",children:M.jsxs(or.Panel,{className:"mx-auto flex max-w-sm flex-col items-center gap-8 rounded-sm bg-white",children:[M.jsx("div",{className:"bg-background-tertiary flex h-[36px] w-full flex-row-reverse items-center",children:M.jsx(ou,{size:20,className:"mr-2",onClick:()=>r(!1)})}),M.jsx("img",{src:e,alt:"약관동의 이미지"}),M.jsx(Pi,{text:"닫기",className:"mb-4 w-[90%] text-base focus:outline-hidden",onClick:()=>r(!1)})]})})})]});var ja=function(n,r){return ja=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])},ja(n,r)},Sn=function(){return Sn=Object.assign||function(n){for(var r,e=1,t=arguments.length;e<t;e++)for(var o in r=arguments[e])Object.prototype.hasOwnProperty.call(r,o)&&(n[o]=r[o]);return n},Sn.apply(this,arguments)};function $h(n,r){var e={};for(var t in n)Object.prototype.hasOwnProperty.call(n,t)&&r.indexOf(t)<0&&(e[t]=n[t]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function"){var o=0;for(t=Object.getOwnPropertySymbols(n);o<t.length;o++)r.indexOf(t[o])<0&&Object.prototype.propertyIsEnumerable.call(n,t[o])&&(e[t[o]]=n[t[o]])}return e}var Ha,au="https://t1.daumcdn.net/mapjsapi/bundle/postcode/prod/postcode.v2.js",Ah=(Ha=null,function(n){return n===void 0&&(n=au),Ha||(Ha=new Promise(function(r,e){var t=document.createElement("script");t.src=n,t.onload=function(){var o;if(!((o=window==null?void 0:window.daum)===null||o===void 0)&&o.Postcode)return r(window.daum.Postcode);e(new Error("Script is loaded successfully, but cannot find Postcode module. Check your scriptURL property."))},t.onerror=function(o){return e(o)},t.id="daum_postcode_script",document.body.appendChild(t)}))}),Yh=d.createElement("p",null,"현재 Daum 우편번호 서비스를 이용할 수 없습니다. 잠시 후 다시 시도해주세요."),Wh={width:"100%",height:400},jh={scriptUrl:au,errorMessage:Yh,autoClose:!0},Hh=function(n){function r(){var e=n!==null&&n.apply(this,arguments)||this;return e.mounted=!1,e.wrap=d.createRef(),e.state={hasError:!1,completed:!1},e.initiate=function(t){if(e.wrap.current){var o=e.props;o.scriptUrl,o.className,o.style;var a=o.defaultQuery,i=o.autoClose;o.errorMessage;var s=o.onComplete,l=o.onClose,u=o.onResize,c=o.onSearch,p=$h(o,["scriptUrl","className","style","defaultQuery","autoClose","errorMessage","onComplete","onClose","onResize","onSearch"]);new t(Sn(Sn({},p),{oncomplete:function(m){s&&s(m),e.setState({completed:!0})},onsearch:c,onresize:u,onclose:l,width:"100%",height:"100%"})).embed(e.wrap.current,{q:a,autoClose:i})}},e.onError=function(t){console.error(t),e.setState({hasError:!0})},e}return function(e,t){function o(){this.constructor=e}ja(e,t),e.prototype=t===null?Object.create(t):(o.prototype=t.prototype,new o)}(r,n),r.prototype.componentDidMount=function(){var e=this.initiate,t=this.onError,o=this.props.scriptUrl;o&&(this.mounted||(Ah(o).then(e).catch(t),this.mounted=!0))},r.prototype.render=function(){var e=this.props,t=e.className,o=e.style,a=e.errorMessage,i=e.autoClose,s=this.state,l=s.hasError,u=s.completed;return i===!0&&u===!0?null:d.createElement("div",{ref:this.wrap,className:t,style:Sn(Sn({},Wh),o)},l&&a)},r.defaultProps=jh,r}(d.Component);const Rh=({label:n,value:r,onFrontChange:e,onBackChange:t,onPostalCodeChange:o,disabled:a})=>{const[i,s]=d.useState(!1),l=p=>{let m=p.address,f="";p.addressType==="R"&&(p.bname!==""&&(f+=p.bname),p.buildingName!==""&&(f+=f!==""?`, ${p.buildingName}`:p.buildingName),m+=f!==""?` (${f})`:""),e(m),o&&o(p.zonecode),s(!1)},u=()=>{s(!0)},c=()=>r.front?r.front:M.jsx("p",{className:"text-petnow-grey-primary",children:"주소를 입력해주세요."});return M.jsxs(M.Fragment,{children:[M.jsx(Bh,{isOpen:i,setIsOpen:s,handleComplete:l}),M.jsxs("div",{className:"text-petnow-grey-tertiary",children:[M.jsx("label",{htmlFor:n,className:"text-sm font-bold text-black",children:n}),M.jsxs("div",{className:"relative flex flex-col",children:[M.jsx("div",{className:`bg-background-secondary placeholder:text-petnow-grey-primary mt-4 h-[60px] w-full cursor-pointer overflow-hidden rounded-xl p-4 text-base whitespace-nowrap focus:outline-hidden ${a&&"opacity-50"}`,onClick:u,children:c()}),M.jsx("input",{disabled:!r.front||a,value:r.back,type:"text",name:n,id:n,placeholder:"상세 주소를 입력해주세요.",className:"bg-background-secondary placeholder:text-petnow-grey-primary mt-4 h-[60px] w-full rounded-xl p-4 text-base focus:outline-hidden disabled:opacity-50",autoComplete:"off",onChange:p=>t(p.target.value)})]})]})]})},Bh=n=>{const{isOpen:r,setIsOpen:e,handleComplete:t}=n;return M.jsx(or,{open:r,onClose:()=>e(!1),className:"relateive z-50",children:M.jsx("div",{className:"fixed inset-0 flex w-screen items-center justify-center",children:M.jsx(or.Panel,{children:M.jsxs("div",{children:[M.jsx("div",{className:"bg-background-tertiary flex h-[36px] w-[100vw] flex-row-reverse items-center px-2",onClick:()=>e(!1),children:M.jsx(ou,{size:24,onClick:()=>e(!1)})}),M.jsx(Hh,{onComplete:t,style:{width:"100vw",height:"calc(100vh - 36px)"}})]})})})})},Vh=n=>{const{isOpen:r,setIsOpen:e}=n;return M.jsx(Wl,{show:r,enter:"transition ease-out duration-200",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"transition-opacity ease-in duration-100",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:M.jsxs(or,{onClose:()=>e(!1),className:"relative z-50 focus:outline-hidden",children:[M.jsx("div",{className:"fixed inset-0 bg-black/40","aria-hidden":!r}),M.jsx("div",{className:"fixed inset-0 flex w-screen items-center justify-center p-4",children:M.jsxs(Hl,{className:"ja-break-all flex w-[90vw] max-w-[300px] flex-col gap-[16px] rounded-[16px] bg-white p-[20px]",children:[M.jsxs("div",{className:"flex flex-col gap-[8px]",children:[n.title&&M.jsx(Rl,{className:"global-break-all text-[18px] leading-[26px] font-bold text-black",children:n.title}),n.image&&M.jsx("img",{src:n.image.url,alt:n.image.alt}),n.description&&n.description!==""&&M.jsx(ts,{className:"text-petnow-grey-tertiary text-[16px] leading-[24px] break-all",children:n.description})]}),M.jsxs("div",{className:"flex flex-col gap-[8px]",children:[M.jsx("button",{className:"bg-petnow-orange-primary sm:hover:bg-petnow-orange-40 w-full cursor-pointer rounded-[12px] py-[12px] text-[14px] leading-[22px] font-bold text-white transition duration-200",onClick:n.confirm.onClick,children:n.confirm.text}),n.cancel&&M.jsx("button",{onClick:()=>e(!1),className:"bg-background-tertiary sm:hover:bg-petnow-grey-90 text-petnow-grey-tertiary w-full cursor-pointer rounded-[12px] py-[12px] text-[14px] leading-[22px] font-bold transition duration-200",children:n.cancel.text})]})]})})]})})};function zh(n){return ir({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M256 294.1L383 167c9.4-9.4 24.6-9.4 33.9 0s9.3 24.6 0 34L273 345c-9.1 9.1-23.7 9.3-33.1.7L95 201.1c-4.7-4.7-7-10.9-7-17s2.3-12.3 7-17c9.4-9.4 24.6-9.4 33.9 0l127.1 127z"},child:[]}]})(n)}function Uh(n){return ir({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M256 217.9L383 345c9.4 9.4 24.6 9.4 33.9 0 9.4-9.4 9.3-24.6 0-34L273 167c-9.1-9.1-23.7-9.3-33.1-.7L95 310.9c-4.7 4.7-7 10.9-7 17s2.3 12.3 7 17c9.4 9.4 24.6 9.4 33.9 0l127.1-127z"},child:[]}]})(n)}const Qh=({title:n,description:r,titleTextClassName:e,descriptionTextClassName:t})=>{const[o,a]=d.useState(!1);return M.jsxs("div",{className:"my-2.5 flex w-full cursor-pointer flex-col justify-center rounded-xl px-4 pt-8 shadow-[0_2px_8px_0_rgba(0,0,0,0.08)] md:rounded-2xl md:pt-10",onClick:()=>a(i=>!i),children:[M.jsxs("div",{className:"flex w-full items-center justify-between px-2 pb-8 transition-all duration-300 md:px-4 md:pb-10",children:[M.jsxs("p",{className:wr("mr-4 text-lg font-medium md:text-xl",e),children:[M.jsx("span",{className:"font-semibold",children:"Q."})," ",n]}),o?M.jsx(Uh,{className:"text-petnow-orange-primary min-w-6",size:24}):M.jsx(zh,{className:"text-petnow-orange-primary min-w-6",size:24})]}),M.jsx("p",{className:wr(`text-petnow-grey-secondary w-full overflow-hidden px-2 text-base leading-6 whitespace-pre-wrap transition-all duration-300 md:px-4 md:text-lg ${o?"max-h-[24rem] pb-8 sm:max-h-60 md:pb-10":"max-h-0"}`,t),children:r})]})},iu=6048e5,Kh=864e5,Gr=6e4,Xr=36e5,qh=1e3,su=Symbol.for("constructDateFrom");function ge(n,r){return typeof n=="function"?n(r):n&&typeof n=="object"&&su in n?n[su](r):n instanceof Date?new n.constructor(r):new Date(r)}function K(n,r){return ge(r||n,n)}function rt(n,r,e){const t=K(n,e==null?void 0:e.in);return isNaN(r)?ge((e==null?void 0:e.in)||n,NaN):(r&&t.setDate(t.getDate()+r),t)}function ot(n,r,e){const t=K(n,e==null?void 0:e.in);if(isNaN(r))return ge(n,NaN);if(!r)return t;const o=t.getDate(),a=ge(n,t.getTime());a.setMonth(t.getMonth()+r+1,0);const i=a.getDate();return o>=i?a:(t.setFullYear(a.getFullYear(),a.getMonth(),o),t)}function lu(n,r,e){return ge(n,+K(n)+r)}function Gh(n,r,e){return lu(n,r*Xr)}let Xh={};function nn(){return Xh}function kt(n,r){var s,l,u,c;const e=nn(),t=(r==null?void 0:r.weekStartsOn)??((l=(s=r==null?void 0:r.locale)==null?void 0:s.options)==null?void 0:l.weekStartsOn)??e.weekStartsOn??((c=(u=e.locale)==null?void 0:u.options)==null?void 0:c.weekStartsOn)??0,o=K(n,r==null?void 0:r.in),a=o.getDay(),i=(a<t?7:0)+a-t;return o.setDate(o.getDate()-i),o.setHours(0,0,0,0),o}function Cn(n,r){return kt(n,{...r,weekStartsOn:1})}function uu(n,r){const e=K(n,r==null?void 0:r.in),t=e.getFullYear(),o=ge(e,0);o.setFullYear(t+1,0,4),o.setHours(0,0,0,0);const a=Cn(o),i=ge(e,0);i.setFullYear(t,0,4),i.setHours(0,0,0,0);const s=Cn(i);return e.getTime()>=a.getTime()?t+1:e.getTime()>=s.getTime()?t:t-1}function Jr(n){const r=K(n),e=new Date(Date.UTC(r.getFullYear(),r.getMonth(),r.getDate(),r.getHours(),r.getMinutes(),r.getSeconds(),r.getMilliseconds()));return e.setUTCFullYear(r.getFullYear()),+n-+e}function St(n,...r){const e=ge.bind(null,r.find(t=>typeof t=="object"));return r.map(e)}function rn(n,r){const e=K(n,r==null?void 0:r.in);return e.setHours(0,0,0,0),e}function _n(n,r,e){const[t,o]=St(e==null?void 0:e.in,n,r),a=rn(t),i=rn(o),s=+a-Jr(a),l=+i-Jr(i);return Math.round((s-l)/Kh)}function Jh(n,r){const e=uu(n,r),t=ge(n,0);return t.setFullYear(e,0,4),t.setHours(0,0,0,0),Cn(t)}function Ra(n,r,e){const t=K(n,e==null?void 0:e.in);return t.setTime(t.getTime()+r*Gr),t}function Ba(n,r,e){return ot(n,r*3,e)}function Zh(n,r,e){return lu(n,r*1e3)}function Zr(n,r,e){return rt(n,r*7,e)}function Ct(n,r,e){return ot(n,r*12,e)}function cu(n,r){let e,t=r==null?void 0:r.in;return n.forEach(o=>{!t&&typeof o=="object"&&(t=ge.bind(null,o));const a=K(o,t);(!e||e<a||isNaN(+a))&&(e=a)}),ge(t,e||NaN)}function du(n,r){let e,t=r==null?void 0:r.in;return n.forEach(o=>{!t&&typeof o=="object"&&(t=ge.bind(null,o));const a=K(o,t);(!e||e>a||isNaN(+a))&&(e=a)}),ge(t,e||NaN)}function ev(n,r,e){const[t,o]=St(e==null?void 0:e.in,n,r);return+rn(t)==+rn(o)}function _t(n){return n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]"}function eo(n){return!(!_t(n)&&typeof n!="number"||isNaN(+K(n)))}function to(n,r,e){const[t,o]=St(e==null?void 0:e.in,n,r),a=t.getFullYear()-o.getFullYear(),i=t.getMonth()-o.getMonth();return a*12+i}function on(n,r){const e=K(n,r==null?void 0:r.in);return Math.trunc(e.getMonth()/3)+1}function no(n,r,e){const[t,o]=St(e==null?void 0:e.in,n,r),a=t.getFullYear()-o.getFullYear(),i=on(t)-on(o);return a*4+i}function ro(n,r,e){const[t,o]=St(e==null?void 0:e.in,n,r);return t.getFullYear()-o.getFullYear()}function tv(n,r,e){const[t,o]=St(e==null?void 0:e.in,n,r),a=fu(t,o),i=Math.abs(_n(t,o));t.setDate(t.getDate()-a*i);const s=+(fu(t,o)===-a),l=a*(i-s);return l===0?0:l}function fu(n,r){const e=n.getFullYear()-r.getFullYear()||n.getMonth()-r.getMonth()||n.getDate()-r.getDate()||n.getHours()-r.getHours()||n.getMinutes()-r.getMinutes()||n.getSeconds()-r.getSeconds()||n.getMilliseconds()-r.getMilliseconds();return e<0?-1:e>0?1:e}function pu(n,r){const e=K(n,r==null?void 0:r.in);return e.setHours(23,59,59,999),e}function mu(n,r){const e=K(n,r==null?void 0:r.in),t=e.getMonth();return e.setFullYear(e.getFullYear(),t+1,0),e.setHours(23,59,59,999),e}function Va(n,r){const e=K(n,r==null?void 0:r.in),t=e.getMonth(),o=t-t%3;return e.setMonth(o,1),e.setHours(0,0,0,0),e}function hu(n,r){const e=K(n,r==null?void 0:r.in);return e.setDate(1),e.setHours(0,0,0,0),e}function vu(n,r){const e=K(n,r==null?void 0:r.in),t=e.getFullYear();return e.setFullYear(t+1,0,0),e.setHours(23,59,59,999),e}function oo(n,r){const e=K(n,r==null?void 0:r.in);return e.setFullYear(e.getFullYear(),0,1),e.setHours(0,0,0,0),e}function nv(n,r){var s,l;const e=nn(),t=e.weekStartsOn??((l=(s=e.locale)==null?void 0:s.options)==null?void 0:l.weekStartsOn)??0,o=K(n,r==null?void 0:r.in),a=o.getDay(),i=(a<t?-7:0)+6-(a-t);return o.setDate(o.getDate()+i),o.setHours(23,59,59,999),o}const rv={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},ov=(n,r,e)=>{let t;const o=rv[n];return typeof o=="string"?t=o:r===1?t=o.one:t=o.other.replace("{{count}}",r.toString()),e!=null&&e.addSuffix?e.comparison&&e.comparison>0?"in "+t:t+" ago":t};function On(n){return(r={})=>{const e=r.width?String(r.width):n.defaultWidth;return n.formats[e]||n.formats[n.defaultWidth]}}const av={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},iv={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},sv={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},lv={date:On({formats:av,defaultWidth:"full"}),time:On({formats:iv,defaultWidth:"full"}),dateTime:On({formats:sv,defaultWidth:"full"})},uv={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},cv=(n,r,e,t)=>uv[n];function ct(n){return(r,e)=>{const t=e!=null&&e.context?String(e.context):"standalone";let o;if(t==="formatting"&&n.formattingValues){const i=n.defaultFormattingWidth||n.defaultWidth,s=e!=null&&e.width?String(e.width):i;o=n.formattingValues[s]||n.formattingValues[i]}else{const i=n.defaultWidth,s=e!=null&&e.width?String(e.width):n.defaultWidth;o=n.values[s]||n.values[i]}const a=n.argumentCallback?n.argumentCallback(r):r;return o[a]}}const dv={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},fv={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},pv={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},mv={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},hv={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},vv={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},gv={ordinalNumber:(n,r)=>{const e=Number(n),t=e%100;if(t>20||t<10)switch(t%10){case 1:return e+"st";case 2:return e+"nd";case 3:return e+"rd"}return e+"th"},era:ct({values:dv,defaultWidth:"wide"}),quarter:ct({values:fv,defaultWidth:"wide",argumentCallback:n=>n-1}),month:ct({values:pv,defaultWidth:"wide"}),day:ct({values:mv,defaultWidth:"wide"}),dayPeriod:ct({values:hv,defaultWidth:"wide",formattingValues:vv,defaultFormattingWidth:"wide"})};function dt(n){return(r,e={})=>{const t=e.width,o=t&&n.matchPatterns[t]||n.matchPatterns[n.defaultMatchWidth],a=r.match(o);if(!a)return null;const i=a[0],s=t&&n.parsePatterns[t]||n.parsePatterns[n.defaultParseWidth],l=Array.isArray(s)?yv(s,p=>p.test(i)):bv(s,p=>p.test(i));let u;u=n.valueCallback?n.valueCallback(l):l,u=e.valueCallback?e.valueCallback(u):u;const c=r.slice(i.length);return{value:u,rest:c}}}function bv(n,r){for(const e in n)if(Object.prototype.hasOwnProperty.call(n,e)&&r(n[e]))return e}function yv(n,r){for(let e=0;e<n.length;e++)if(r(n[e]))return e}function gu(n){return(r,e={})=>{const t=r.match(n.matchPattern);if(!t)return null;const o=t[0],a=r.match(n.parsePattern);if(!a)return null;let i=n.valueCallback?n.valueCallback(a[0]):a[0];i=e.valueCallback?e.valueCallback(i):i;const s=r.slice(o.length);return{value:i,rest:s}}}const wv=/^(\d+)(th|st|nd|rd)?/i,xv=/\d+/i,Dv={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},Ev={any:[/^b/i,/^(a|c)/i]},kv={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Sv={any:[/1/i,/2/i,/3/i,/4/i]},Cv={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},_v={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Ov={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},Mv={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Pv={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},Tv={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},Nv={ordinalNumber:gu({matchPattern:wv,parsePattern:xv,valueCallback:n=>parseInt(n,10)}),era:dt({matchPatterns:Dv,defaultMatchWidth:"wide",parsePatterns:Ev,defaultParseWidth:"any"}),quarter:dt({matchPatterns:kv,defaultMatchWidth:"wide",parsePatterns:Sv,defaultParseWidth:"any",valueCallback:n=>n+1}),month:dt({matchPatterns:Cv,defaultMatchWidth:"wide",parsePatterns:_v,defaultParseWidth:"any"}),day:dt({matchPatterns:Ov,defaultMatchWidth:"wide",parsePatterns:Mv,defaultParseWidth:"any"}),dayPeriod:dt({matchPatterns:Pv,defaultMatchWidth:"any",parsePatterns:Tv,defaultParseWidth:"any"})},bu={code:"en-US",formatDistance:ov,formatLong:lv,formatRelative:cv,localize:gv,match:Nv,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Iv(n,r){const e=K(n,r==null?void 0:r.in);return _n(e,oo(e))+1}function za(n,r){const e=K(n,r==null?void 0:r.in),t=+Cn(e)-+Jh(e);return Math.round(t/iu)+1}function Ua(n,r){var c,p,m,f;const e=K(n,r==null?void 0:r.in),t=e.getFullYear(),o=nn(),a=(r==null?void 0:r.firstWeekContainsDate)??((p=(c=r==null?void 0:r.locale)==null?void 0:c.options)==null?void 0:p.firstWeekContainsDate)??o.firstWeekContainsDate??((f=(m=o.locale)==null?void 0:m.options)==null?void 0:f.firstWeekContainsDate)??1,i=ge((r==null?void 0:r.in)||n,0);i.setFullYear(t+1,0,a),i.setHours(0,0,0,0);const s=kt(i,r),l=ge((r==null?void 0:r.in)||n,0);l.setFullYear(t,0,a),l.setHours(0,0,0,0);const u=kt(l,r);return+e>=+s?t+1:+e>=+u?t:t-1}function Fv(n,r){var s,l,u,c;const e=nn(),t=(r==null?void 0:r.firstWeekContainsDate)??((l=(s=r==null?void 0:r.locale)==null?void 0:s.options)==null?void 0:l.firstWeekContainsDate)??e.firstWeekContainsDate??((c=(u=e.locale)==null?void 0:u.options)==null?void 0:c.firstWeekContainsDate)??1,o=Ua(n,r),a=ge((r==null?void 0:r.in)||n,0);return a.setFullYear(o,0,t),a.setHours(0,0,0,0),kt(a,r)}function yu(n,r){const e=K(n,r==null?void 0:r.in),t=+kt(e,r)-+Fv(e,r);return Math.round(t/iu)+1}function be(n,r){const e=n<0?"-":"",t=Math.abs(n).toString().padStart(r,"0");return e+t}const Ht={y(n,r){const e=n.getFullYear(),t=e>0?e:1-e;return be(r==="yy"?t%100:t,r.length)},M(n,r){const e=n.getMonth();return r==="M"?String(e+1):be(e+1,2)},d(n,r){return be(n.getDate(),r.length)},a(n,r){const e=n.getHours()/12>=1?"pm":"am";switch(r){case"a":case"aa":return e.toUpperCase();case"aaa":return e;case"aaaaa":return e[0];case"aaaa":default:return e==="am"?"a.m.":"p.m."}},h(n,r){return be(n.getHours()%12||12,r.length)},H(n,r){return be(n.getHours(),r.length)},m(n,r){return be(n.getMinutes(),r.length)},s(n,r){return be(n.getSeconds(),r.length)},S(n,r){const e=r.length,t=n.getMilliseconds(),o=Math.trunc(t*Math.pow(10,e-3));return be(o,r.length)}},Mn={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wu={G:function(n,r,e){const t=n.getFullYear()>0?1:0;switch(r){case"G":case"GG":case"GGG":return e.era(t,{width:"abbreviated"});case"GGGGG":return e.era(t,{width:"narrow"});case"GGGG":default:return e.era(t,{width:"wide"})}},y:function(n,r,e){if(r==="yo"){const t=n.getFullYear(),o=t>0?t:1-t;return e.ordinalNumber(o,{unit:"year"})}return Ht.y(n,r)},Y:function(n,r,e,t){const o=Ua(n,t),a=o>0?o:1-o;if(r==="YY"){const i=a%100;return be(i,2)}return r==="Yo"?e.ordinalNumber(a,{unit:"year"}):be(a,r.length)},R:function(n,r){const e=uu(n);return be(e,r.length)},u:function(n,r){const e=n.getFullYear();return be(e,r.length)},Q:function(n,r,e){const t=Math.ceil((n.getMonth()+1)/3);switch(r){case"Q":return String(t);case"QQ":return be(t,2);case"Qo":return e.ordinalNumber(t,{unit:"quarter"});case"QQQ":return e.quarter(t,{width:"abbreviated",context:"formatting"});case"QQQQQ":return e.quarter(t,{width:"narrow",context:"formatting"});case"QQQQ":default:return e.quarter(t,{width:"wide",context:"formatting"})}},q:function(n,r,e){const t=Math.ceil((n.getMonth()+1)/3);switch(r){case"q":return String(t);case"qq":return be(t,2);case"qo":return e.ordinalNumber(t,{unit:"quarter"});case"qqq":return e.quarter(t,{width:"abbreviated",context:"standalone"});case"qqqqq":return e.quarter(t,{width:"narrow",context:"standalone"});case"qqqq":default:return e.quarter(t,{width:"wide",context:"standalone"})}},M:function(n,r,e){const t=n.getMonth();switch(r){case"M":case"MM":return Ht.M(n,r);case"Mo":return e.ordinalNumber(t+1,{unit:"month"});case"MMM":return e.month(t,{width:"abbreviated",context:"formatting"});case"MMMMM":return e.month(t,{width:"narrow",context:"formatting"});case"MMMM":default:return e.month(t,{width:"wide",context:"formatting"})}},L:function(n,r,e){const t=n.getMonth();switch(r){case"L":return String(t+1);case"LL":return be(t+1,2);case"Lo":return e.ordinalNumber(t+1,{unit:"month"});case"LLL":return e.month(t,{width:"abbreviated",context:"standalone"});case"LLLLL":return e.month(t,{width:"narrow",context:"standalone"});case"LLLL":default:return e.month(t,{width:"wide",context:"standalone"})}},w:function(n,r,e,t){const o=yu(n,t);return r==="wo"?e.ordinalNumber(o,{unit:"week"}):be(o,r.length)},I:function(n,r,e){const t=za(n);return r==="Io"?e.ordinalNumber(t,{unit:"week"}):be(t,r.length)},d:function(n,r,e){return r==="do"?e.ordinalNumber(n.getDate(),{unit:"date"}):Ht.d(n,r)},D:function(n,r,e){const t=Iv(n);return r==="Do"?e.ordinalNumber(t,{unit:"dayOfYear"}):be(t,r.length)},E:function(n,r,e){const t=n.getDay();switch(r){case"E":case"EE":case"EEE":return e.day(t,{width:"abbreviated",context:"formatting"});case"EEEEE":return e.day(t,{width:"narrow",context:"formatting"});case"EEEEEE":return e.day(t,{width:"short",context:"formatting"});case"EEEE":default:return e.day(t,{width:"wide",context:"formatting"})}},e:function(n,r,e,t){const o=n.getDay(),a=(o-t.weekStartsOn+8)%7||7;switch(r){case"e":return String(a);case"ee":return be(a,2);case"eo":return e.ordinalNumber(a,{unit:"day"});case"eee":return e.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return e.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return e.day(o,{width:"short",context:"formatting"});case"eeee":default:return e.day(o,{width:"wide",context:"formatting"})}},c:function(n,r,e,t){const o=n.getDay(),a=(o-t.weekStartsOn+8)%7||7;switch(r){case"c":return String(a);case"cc":return be(a,r.length);case"co":return e.ordinalNumber(a,{unit:"day"});case"ccc":return e.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return e.day(o,{width:"narrow",context:"standalone"});case"cccccc":return e.day(o,{width:"short",context:"standalone"});case"cccc":default:return e.day(o,{width:"wide",context:"standalone"})}},i:function(n,r,e){const t=n.getDay(),o=t===0?7:t;switch(r){case"i":return String(o);case"ii":return be(o,r.length);case"io":return e.ordinalNumber(o,{unit:"day"});case"iii":return e.day(t,{width:"abbreviated",context:"formatting"});case"iiiii":return e.day(t,{width:"narrow",context:"formatting"});case"iiiiii":return e.day(t,{width:"short",context:"formatting"});case"iiii":default:return e.day(t,{width:"wide",context:"formatting"})}},a:function(n,r,e){const o=n.getHours()/12>=1?"pm":"am";switch(r){case"a":case"aa":return e.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"aaa":return e.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return e.dayPeriod(o,{width:"narrow",context:"formatting"});case"aaaa":default:return e.dayPeriod(o,{width:"wide",context:"formatting"})}},b:function(n,r,e){const t=n.getHours();let o;switch(t===12?o=Mn.noon:t===0?o=Mn.midnight:o=t/12>=1?"pm":"am",r){case"b":case"bb":return e.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"bbb":return e.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return e.dayPeriod(o,{width:"narrow",context:"formatting"});case"bbbb":default:return e.dayPeriod(o,{width:"wide",context:"formatting"})}},B:function(n,r,e){const t=n.getHours();let o;switch(t>=17?o=Mn.evening:t>=12?o=Mn.afternoon:t>=4?o=Mn.morning:o=Mn.night,r){case"B":case"BB":case"BBB":return e.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"BBBBB":return e.dayPeriod(o,{width:"narrow",context:"formatting"});case"BBBB":default:return e.dayPeriod(o,{width:"wide",context:"formatting"})}},h:function(n,r,e){if(r==="ho"){let t=n.getHours()%12;return t===0&&(t=12),e.ordinalNumber(t,{unit:"hour"})}return Ht.h(n,r)},H:function(n,r,e){return r==="Ho"?e.ordinalNumber(n.getHours(),{unit:"hour"}):Ht.H(n,r)},K:function(n,r,e){const t=n.getHours()%12;return r==="Ko"?e.ordinalNumber(t,{unit:"hour"}):be(t,r.length)},k:function(n,r,e){let t=n.getHours();return t===0&&(t=24),r==="ko"?e.ordinalNumber(t,{unit:"hour"}):be(t,r.length)},m:function(n,r,e){return r==="mo"?e.ordinalNumber(n.getMinutes(),{unit:"minute"}):Ht.m(n,r)},s:function(n,r,e){return r==="so"?e.ordinalNumber(n.getSeconds(),{unit:"second"}):Ht.s(n,r)},S:function(n,r){return Ht.S(n,r)},X:function(n,r,e){const t=n.getTimezoneOffset();if(t===0)return"Z";switch(r){case"X":return Du(t);case"XXXX":case"XX":return an(t);case"XXXXX":case"XXX":default:return an(t,":")}},x:function(n,r,e){const t=n.getTimezoneOffset();switch(r){case"x":return Du(t);case"xxxx":case"xx":return an(t);case"xxxxx":case"xxx":default:return an(t,":")}},O:function(n,r,e){const t=n.getTimezoneOffset();switch(r){case"O":case"OO":case"OOO":return"GMT"+xu(t,":");case"OOOO":default:return"GMT"+an(t,":")}},z:function(n,r,e){const t=n.getTimezoneOffset();switch(r){case"z":case"zz":case"zzz":return"GMT"+xu(t,":");case"zzzz":default:return"GMT"+an(t,":")}},t:function(n,r,e){const t=Math.trunc(+n/1e3);return be(t,r.length)},T:function(n,r,e){return be(+n,r.length)}};function xu(n,r=""){const e=n>0?"-":"+",t=Math.abs(n),o=Math.trunc(t/60),a=t%60;return a===0?e+String(o):e+String(o)+r+be(a,2)}function Du(n,r){return n%60===0?(n>0?"-":"+")+be(Math.abs(n)/60,2):an(n,r)}function an(n,r=""){const e=n>0?"-":"+",t=Math.abs(n),o=be(Math.trunc(t/60),2),a=be(t%60,2);return e+o+r+a}const Eu=(n,r)=>{switch(n){case"P":return r.date({width:"short"});case"PP":return r.date({width:"medium"});case"PPP":return r.date({width:"long"});case"PPPP":default:return r.date({width:"full"})}},ku=(n,r)=>{switch(n){case"p":return r.time({width:"short"});case"pp":return r.time({width:"medium"});case"ppp":return r.time({width:"long"});case"pppp":default:return r.time({width:"full"})}},Qa={p:ku,P:(n,r)=>{const e=n.match(/(P+)(p+)?/)||[],t=e[1],o=e[2];if(!o)return Eu(n,r);let a;switch(t){case"P":a=r.dateTime({width:"short"});break;case"PP":a=r.dateTime({width:"medium"});break;case"PPP":a=r.dateTime({width:"long"});break;case"PPPP":default:a=r.dateTime({width:"full"});break}return a.replace("{{date}}",Eu(t,r)).replace("{{time}}",ku(o,r))}},Lv=/^D+$/,$v=/^Y+$/,Av=["D","DD","YY","YYYY"];function Yv(n){return Lv.test(n)}function Wv(n){return $v.test(n)}function jv(n,r,e){const t=Hv(n,r,e);if(console.warn(t),Av.includes(n))throw new RangeError(t)}function Hv(n,r,e){const t=n[0]==="Y"?"years":"days of the month";return`Use \`${n.toLowerCase()}\` instead of \`${n}\` (in \`${r}\`) for formatting ${t} to the input \`${e}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const Rv=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Bv=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Vv=/^'([^]*?)'?$/,zv=/''/g,Uv=/[a-zA-Z]/;function Su(n,r,e){var c,p,m,f,h,v,g,w;const t=nn(),o=(e==null?void 0:e.locale)??t.locale??bu,a=(e==null?void 0:e.firstWeekContainsDate)??((p=(c=e==null?void 0:e.locale)==null?void 0:c.options)==null?void 0:p.firstWeekContainsDate)??t.firstWeekContainsDate??((f=(m=t.locale)==null?void 0:m.options)==null?void 0:f.firstWeekContainsDate)??1,i=(e==null?void 0:e.weekStartsOn)??((v=(h=e==null?void 0:e.locale)==null?void 0:h.options)==null?void 0:v.weekStartsOn)??t.weekStartsOn??((w=(g=t.locale)==null?void 0:g.options)==null?void 0:w.weekStartsOn)??0,s=K(n,e==null?void 0:e.in);if(!eo(s))throw new RangeError("Invalid time value");let l=r.match(Bv).map(y=>{const x=y[0];if(x==="p"||x==="P"){const E=Qa[x];return E(y,o.formatLong)}return y}).join("").match(Rv).map(y=>{if(y==="''")return{isToken:!1,value:"'"};const x=y[0];if(x==="'")return{isToken:!1,value:Qv(y)};if(wu[x])return{isToken:!0,value:y};if(x.match(Uv))throw new RangeError("Format string contains an unescaped latin alphabet character `"+x+"`");return{isToken:!1,value:y}});o.localize.preprocessor&&(l=o.localize.preprocessor(s,l));const u={firstWeekContainsDate:a,weekStartsOn:i,locale:o};return l.map(y=>{if(!y.isToken)return y.value;const x=y.value;(!(e!=null&&e.useAdditionalWeekYearTokens)&&Wv(x)||!(e!=null&&e.useAdditionalDayOfYearTokens)&&Yv(x))&&jv(x,r,String(n));const E=wu[x[0]];return E(s,x,o.localize,u)}).join("")}function Qv(n){const r=n.match(Vv);return r?r[1].replace(zv,"'"):n}function Cu(n,r){return K(n,r==null?void 0:r.in).getDate()}function Kv(n,r){return K(n,r==null?void 0:r.in).getDay()}function qv(n,r){const e=K(n,r==null?void 0:r.in),t=e.getFullYear(),o=e.getMonth(),a=ge(e,0);return a.setFullYear(t,o+1,0),a.setHours(0,0,0,0),a.getDate()}function Gv(){return Object.assign({},nn())}function Ot(n,r){return K(n,r==null?void 0:r.in).getHours()}function Xv(n,r){const e=K(n,r==null?void 0:r.in).getDay();return e===0?7:e}function Mt(n,r){return K(n,r==null?void 0:r.in).getMinutes()}function Be(n,r){return K(n,r==null?void 0:r.in).getMonth()}function Rt(n){return K(n).getSeconds()}function Ka(n){return+K(n)}function ne(n,r){return K(n,r==null?void 0:r.in).getFullYear()}function Bt(n,r){return+K(n)>+K(r)}function sn(n,r){return+K(n)<+K(r)}function Jv(n,r){return+K(n)==+K(r)}function Zv(n,r){const e=eg(r)?new r(0):ge(r,0);return e.setFullYear(n.getFullYear(),n.getMonth(),n.getDate()),e.setHours(n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()),e}function eg(n){var r;return typeof n=="function"&&((r=n.prototype)==null?void 0:r.constructor)===n}const tg=10;class _u{constructor(){B(this,"subPriority",0)}validate(r,e){return!0}}class ng extends _u{constructor(r,e,t,o,a){super(),this.value=r,this.validateValue=e,this.setValue=t,this.priority=o,a&&(this.subPriority=a)}validate(r,e){return this.validateValue(r,this.value,e)}set(r,e,t){return this.setValue(r,e,this.value,t)}}class rg extends _u{constructor(e,t){super();B(this,"priority",tg);B(this,"subPriority",-1);this.context=e||(o=>ge(t,o))}set(e,t){return t.timestampIsSet?e:ge(e,Zv(e,this.context))}}class me{run(r,e,t,o){const a=this.parse(r,e,t,o);return a?{setter:new ng(a.value,this.validate,this.set,this.priority,this.subPriority),rest:a.rest}:null}validate(r,e,t){return!0}}class og extends me{constructor(){super(...arguments);B(this,"priority",140);B(this,"incompatibleTokens",["R","u","t","T"])}parse(e,t,o){switch(t){case"G":case"GG":case"GGG":return o.era(e,{width:"abbreviated"})||o.era(e,{width:"narrow"});case"GGGGG":return o.era(e,{width:"narrow"});case"GGGG":default:return o.era(e,{width:"wide"})||o.era(e,{width:"abbreviated"})||o.era(e,{width:"narrow"})}}set(e,t,o){return t.era=o,e.setFullYear(o,0,1),e.setHours(0,0,0,0),e}}const Te={month:/^(1[0-2]|0?\d)/,date:/^(3[0-1]|[0-2]?\d)/,dayOfYear:/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,week:/^(5[0-3]|[0-4]?\d)/,hour23h:/^(2[0-3]|[0-1]?\d)/,hour24h:/^(2[0-4]|[0-1]?\d)/,hour11h:/^(1[0-1]|0?\d)/,hour12h:/^(1[0-2]|0?\d)/,minute:/^[0-5]?\d/,second:/^[0-5]?\d/,singleDigit:/^\d/,twoDigits:/^\d{1,2}/,threeDigits:/^\d{1,3}/,fourDigits:/^\d{1,4}/,anyDigitsSigned:/^-?\d+/,singleDigitSigned:/^-?\d/,twoDigitsSigned:/^-?\d{1,2}/,threeDigitsSigned:/^-?\d{1,3}/,fourDigitsSigned:/^-?\d{1,4}/},ft={basicOptionalMinutes:/^([+-])(\d{2})(\d{2})?|Z/,basic:/^([+-])(\d{2})(\d{2})|Z/,basicOptionalSeconds:/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,extended:/^([+-])(\d{2}):(\d{2})|Z/,extendedOptionalSeconds:/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/};function Ne(n,r){return n&&{value:r(n.value),rest:n.rest}}function _e(n,r){const e=r.match(n);return e?{value:parseInt(e[0],10),rest:r.slice(e[0].length)}:null}function pt(n,r){const e=r.match(n);if(!e)return null;if(e[0]==="Z")return{value:0,rest:r.slice(1)};const t=e[1]==="+"?1:-1,o=e[2]?parseInt(e[2],10):0,a=e[3]?parseInt(e[3],10):0,i=e[5]?parseInt(e[5],10):0;return{value:t*(o*Xr+a*Gr+i*qh),rest:r.slice(e[0].length)}}function Ou(n){return _e(Te.anyDigitsSigned,n)}function Me(n,r){switch(n){case 1:return _e(Te.singleDigit,r);case 2:return _e(Te.twoDigits,r);case 3:return _e(Te.threeDigits,r);case 4:return _e(Te.fourDigits,r);default:return _e(new RegExp("^\\d{1,"+n+"}"),r)}}function ao(n,r){switch(n){case 1:return _e(Te.singleDigitSigned,r);case 2:return _e(Te.twoDigitsSigned,r);case 3:return _e(Te.threeDigitsSigned,r);case 4:return _e(Te.fourDigitsSigned,r);default:return _e(new RegExp("^-?\\d{1,"+n+"}"),r)}}function qa(n){switch(n){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;case"am":case"midnight":case"night":default:return 0}}function Mu(n,r){const e=r>0,t=e?r:1-r;let o;if(t<=50)o=n||100;else{const a=t+50,i=Math.trunc(a/100)*100,s=n>=a%100;o=n+i-(s?100:0)}return e?o:1-o}function Pu(n){return n%400===0||n%4===0&&n%100!==0}class ag extends me{constructor(){super(...arguments);B(this,"priority",130);B(this,"incompatibleTokens",["Y","R","u","w","I","i","e","c","t","T"])}parse(e,t,o){const a=i=>({year:i,isTwoDigitYear:t==="yy"});switch(t){case"y":return Ne(Me(4,e),a);case"yo":return Ne(o.ordinalNumber(e,{unit:"year"}),a);default:return Ne(Me(t.length,e),a)}}validate(e,t){return t.isTwoDigitYear||t.year>0}set(e,t,o){const a=e.getFullYear();if(o.isTwoDigitYear){const s=Mu(o.year,a);return e.setFullYear(s,0,1),e.setHours(0,0,0,0),e}const i=!("era"in t)||t.era===1?o.year:1-o.year;return e.setFullYear(i,0,1),e.setHours(0,0,0,0),e}}class ig extends me{constructor(){super(...arguments);B(this,"priority",130);B(this,"incompatibleTokens",["y","R","u","Q","q","M","L","I","d","D","i","t","T"])}parse(e,t,o){const a=i=>({year:i,isTwoDigitYear:t==="YY"});switch(t){case"Y":return Ne(Me(4,e),a);case"Yo":return Ne(o.ordinalNumber(e,{unit:"year"}),a);default:return Ne(Me(t.length,e),a)}}validate(e,t){return t.isTwoDigitYear||t.year>0}set(e,t,o,a){const i=Ua(e,a);if(o.isTwoDigitYear){const l=Mu(o.year,i);return e.setFullYear(l,0,a.firstWeekContainsDate),e.setHours(0,0,0,0),kt(e,a)}const s=!("era"in t)||t.era===1?o.year:1-o.year;return e.setFullYear(s,0,a.firstWeekContainsDate),e.setHours(0,0,0,0),kt(e,a)}}class sg extends me{constructor(){super(...arguments);B(this,"priority",130);B(this,"incompatibleTokens",["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"])}parse(e,t){return ao(t==="R"?4:t.length,e)}set(e,t,o){const a=ge(e,0);return a.setFullYear(o,0,4),a.setHours(0,0,0,0),Cn(a)}}class lg extends me{constructor(){super(...arguments);B(this,"priority",130);B(this,"incompatibleTokens",["G","y","Y","R","w","I","i","e","c","t","T"])}parse(e,t){return ao(t==="u"?4:t.length,e)}set(e,t,o){return e.setFullYear(o,0,1),e.setHours(0,0,0,0),e}}class ug extends me{constructor(){super(...arguments);B(this,"priority",120);B(this,"incompatibleTokens",["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"])}parse(e,t,o){switch(t){case"Q":case"QQ":return Me(t.length,e);case"Qo":return o.ordinalNumber(e,{unit:"quarter"});case"QQQ":return o.quarter(e,{width:"abbreviated",context:"formatting"})||o.quarter(e,{width:"narrow",context:"formatting"});case"QQQQQ":return o.quarter(e,{width:"narrow",context:"formatting"});case"QQQQ":default:return o.quarter(e,{width:"wide",context:"formatting"})||o.quarter(e,{width:"abbreviated",context:"formatting"})||o.quarter(e,{width:"narrow",context:"formatting"})}}validate(e,t){return t>=1&&t<=4}set(e,t,o){return e.setMonth((o-1)*3,1),e.setHours(0,0,0,0),e}}class cg extends me{constructor(){super(...arguments);B(this,"priority",120);B(this,"incompatibleTokens",["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"])}parse(e,t,o){switch(t){case"q":case"qq":return Me(t.length,e);case"qo":return o.ordinalNumber(e,{unit:"quarter"});case"qqq":return o.quarter(e,{width:"abbreviated",context:"standalone"})||o.quarter(e,{width:"narrow",context:"standalone"});case"qqqqq":return o.quarter(e,{width:"narrow",context:"standalone"});case"qqqq":default:return o.quarter(e,{width:"wide",context:"standalone"})||o.quarter(e,{width:"abbreviated",context:"standalone"})||o.quarter(e,{width:"narrow",context:"standalone"})}}validate(e,t){return t>=1&&t<=4}set(e,t,o){return e.setMonth((o-1)*3,1),e.setHours(0,0,0,0),e}}class dg extends me{constructor(){super(...arguments);B(this,"incompatibleTokens",["Y","R","q","Q","L","w","I","D","i","e","c","t","T"]);B(this,"priority",110)}parse(e,t,o){const a=i=>i-1;switch(t){case"M":return Ne(_e(Te.month,e),a);case"MM":return Ne(Me(2,e),a);case"Mo":return Ne(o.ordinalNumber(e,{unit:"month"}),a);case"MMM":return o.month(e,{width:"abbreviated",context:"formatting"})||o.month(e,{width:"narrow",context:"formatting"});case"MMMMM":return o.month(e,{width:"narrow",context:"formatting"});case"MMMM":default:return o.month(e,{width:"wide",context:"formatting"})||o.month(e,{width:"abbreviated",context:"formatting"})||o.month(e,{width:"narrow",context:"formatting"})}}validate(e,t){return t>=0&&t<=11}set(e,t,o){return e.setMonth(o,1),e.setHours(0,0,0,0),e}}class fg extends me{constructor(){super(...arguments);B(this,"priority",110);B(this,"incompatibleTokens",["Y","R","q","Q","M","w","I","D","i","e","c","t","T"])}parse(e,t,o){const a=i=>i-1;switch(t){case"L":return Ne(_e(Te.month,e),a);case"LL":return Ne(Me(2,e),a);case"Lo":return Ne(o.ordinalNumber(e,{unit:"month"}),a);case"LLL":return o.month(e,{width:"abbreviated",context:"standalone"})||o.month(e,{width:"narrow",context:"standalone"});case"LLLLL":return o.month(e,{width:"narrow",context:"standalone"});case"LLLL":default:return o.month(e,{width:"wide",context:"standalone"})||o.month(e,{width:"abbreviated",context:"standalone"})||o.month(e,{width:"narrow",context:"standalone"})}}validate(e,t){return t>=0&&t<=11}set(e,t,o){return e.setMonth(o,1),e.setHours(0,0,0,0),e}}function pg(n,r,e){const t=K(n,e==null?void 0:e.in),o=yu(t,e)-r;return t.setDate(t.getDate()-o*7),K(t,e==null?void 0:e.in)}class mg extends me{constructor(){super(...arguments);B(this,"priority",100);B(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","i","t","T"])}parse(e,t,o){switch(t){case"w":return _e(Te.week,e);case"wo":return o.ordinalNumber(e,{unit:"week"});default:return Me(t.length,e)}}validate(e,t){return t>=1&&t<=53}set(e,t,o,a){return kt(pg(e,o,a),a)}}function hg(n,r,e){const t=K(n,e==null?void 0:e.in),o=za(t,e)-r;return t.setDate(t.getDate()-o*7),t}class vg extends me{constructor(){super(...arguments);B(this,"priority",100);B(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"])}parse(e,t,o){switch(t){case"I":return _e(Te.week,e);case"Io":return o.ordinalNumber(e,{unit:"week"});default:return Me(t.length,e)}}validate(e,t){return t>=1&&t<=53}set(e,t,o){return Cn(hg(e,o))}}const gg=[31,28,31,30,31,30,31,31,30,31,30,31],bg=[31,29,31,30,31,30,31,31,30,31,30,31];class yg extends me{constructor(){super(...arguments);B(this,"priority",90);B(this,"subPriority",1);B(this,"incompatibleTokens",["Y","R","q","Q","w","I","D","i","e","c","t","T"])}parse(e,t,o){switch(t){case"d":return _e(Te.date,e);case"do":return o.ordinalNumber(e,{unit:"date"});default:return Me(t.length,e)}}validate(e,t){const o=e.getFullYear(),a=Pu(o),i=e.getMonth();return a?t>=1&&t<=bg[i]:t>=1&&t<=gg[i]}set(e,t,o){return e.setDate(o),e.setHours(0,0,0,0),e}}class wg extends me{constructor(){super(...arguments);B(this,"priority",90);B(this,"subpriority",1);B(this,"incompatibleTokens",["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"])}parse(e,t,o){switch(t){case"D":case"DD":return _e(Te.dayOfYear,e);case"Do":return o.ordinalNumber(e,{unit:"date"});default:return Me(t.length,e)}}validate(e,t){const o=e.getFullYear();return Pu(o)?t>=1&&t<=366:t>=1&&t<=365}set(e,t,o){return e.setMonth(0,o),e.setHours(0,0,0,0),e}}function Ga(n,r,e){var p,m,f,h;const t=nn(),o=(e==null?void 0:e.weekStartsOn)??((m=(p=e==null?void 0:e.locale)==null?void 0:p.options)==null?void 0:m.weekStartsOn)??t.weekStartsOn??((h=(f=t.locale)==null?void 0:f.options)==null?void 0:h.weekStartsOn)??0,a=K(n,e==null?void 0:e.in),i=a.getDay(),l=(r%7+7)%7,u=7-o,c=r<0||r>6?r-(i+u)%7:(l+u)%7-(i+u)%7;return rt(a,c,e)}class xg extends me{constructor(){super(...arguments);B(this,"priority",90);B(this,"incompatibleTokens",["D","i","e","c","t","T"])}parse(e,t,o){switch(t){case"E":case"EE":case"EEE":return o.day(e,{width:"abbreviated",context:"formatting"})||o.day(e,{width:"short",context:"formatting"})||o.day(e,{width:"narrow",context:"formatting"});case"EEEEE":return o.day(e,{width:"narrow",context:"formatting"});case"EEEEEE":return o.day(e,{width:"short",context:"formatting"})||o.day(e,{width:"narrow",context:"formatting"});case"EEEE":default:return o.day(e,{width:"wide",context:"formatting"})||o.day(e,{width:"abbreviated",context:"formatting"})||o.day(e,{width:"short",context:"formatting"})||o.day(e,{width:"narrow",context:"formatting"})}}validate(e,t){return t>=0&&t<=6}set(e,t,o,a){return e=Ga(e,o,a),e.setHours(0,0,0,0),e}}class Dg extends me{constructor(){super(...arguments);B(this,"priority",90);B(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"])}parse(e,t,o,a){const i=s=>{const l=Math.floor((s-1)/7)*7;return(s+a.weekStartsOn+6)%7+l};switch(t){case"e":case"ee":return Ne(Me(t.length,e),i);case"eo":return Ne(o.ordinalNumber(e,{unit:"day"}),i);case"eee":return o.day(e,{width:"abbreviated",context:"formatting"})||o.day(e,{width:"short",context:"formatting"})||o.day(e,{width:"narrow",context:"formatting"});case"eeeee":return o.day(e,{width:"narrow",context:"formatting"});case"eeeeee":return o.day(e,{width:"short",context:"formatting"})||o.day(e,{width:"narrow",context:"formatting"});case"eeee":default:return o.day(e,{width:"wide",context:"formatting"})||o.day(e,{width:"abbreviated",context:"formatting"})||o.day(e,{width:"short",context:"formatting"})||o.day(e,{width:"narrow",context:"formatting"})}}validate(e,t){return t>=0&&t<=6}set(e,t,o,a){return e=Ga(e,o,a),e.setHours(0,0,0,0),e}}class Eg extends me{constructor(){super(...arguments);B(this,"priority",90);B(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"])}parse(e,t,o,a){const i=s=>{const l=Math.floor((s-1)/7)*7;return(s+a.weekStartsOn+6)%7+l};switch(t){case"c":case"cc":return Ne(Me(t.length,e),i);case"co":return Ne(o.ordinalNumber(e,{unit:"day"}),i);case"ccc":return o.day(e,{width:"abbreviated",context:"standalone"})||o.day(e,{width:"short",context:"standalone"})||o.day(e,{width:"narrow",context:"standalone"});case"ccccc":return o.day(e,{width:"narrow",context:"standalone"});case"cccccc":return o.day(e,{width:"short",context:"standalone"})||o.day(e,{width:"narrow",context:"standalone"});case"cccc":default:return o.day(e,{width:"wide",context:"standalone"})||o.day(e,{width:"abbreviated",context:"standalone"})||o.day(e,{width:"short",context:"standalone"})||o.day(e,{width:"narrow",context:"standalone"})}}validate(e,t){return t>=0&&t<=6}set(e,t,o,a){return e=Ga(e,o,a),e.setHours(0,0,0,0),e}}function kg(n,r,e){const t=K(n,e==null?void 0:e.in),o=Xv(t,e),a=r-o;return rt(t,a,e)}class Sg extends me{constructor(){super(...arguments);B(this,"priority",90);B(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"])}parse(e,t,o){const a=i=>i===0?7:i;switch(t){case"i":case"ii":return Me(t.length,e);case"io":return o.ordinalNumber(e,{unit:"day"});case"iii":return Ne(o.day(e,{width:"abbreviated",context:"formatting"})||o.day(e,{width:"short",context:"formatting"})||o.day(e,{width:"narrow",context:"formatting"}),a);case"iiiii":return Ne(o.day(e,{width:"narrow",context:"formatting"}),a);case"iiiiii":return Ne(o.day(e,{width:"short",context:"formatting"})||o.day(e,{width:"narrow",context:"formatting"}),a);case"iiii":default:return Ne(o.day(e,{width:"wide",context:"formatting"})||o.day(e,{width:"abbreviated",context:"formatting"})||o.day(e,{width:"short",context:"formatting"})||o.day(e,{width:"narrow",context:"formatting"}),a)}}validate(e,t){return t>=1&&t<=7}set(e,t,o){return e=kg(e,o),e.setHours(0,0,0,0),e}}class Cg extends me{constructor(){super(...arguments);B(this,"priority",80);B(this,"incompatibleTokens",["b","B","H","k","t","T"])}parse(e,t,o){switch(t){case"a":case"aa":case"aaa":return o.dayPeriod(e,{width:"abbreviated",context:"formatting"})||o.dayPeriod(e,{width:"narrow",context:"formatting"});case"aaaaa":return o.dayPeriod(e,{width:"narrow",context:"formatting"});case"aaaa":default:return o.dayPeriod(e,{width:"wide",context:"formatting"})||o.dayPeriod(e,{width:"abbreviated",context:"formatting"})||o.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,t,o){return e.setHours(qa(o),0,0,0),e}}class _g extends me{constructor(){super(...arguments);B(this,"priority",80);B(this,"incompatibleTokens",["a","B","H","k","t","T"])}parse(e,t,o){switch(t){case"b":case"bb":case"bbb":return o.dayPeriod(e,{width:"abbreviated",context:"formatting"})||o.dayPeriod(e,{width:"narrow",context:"formatting"});case"bbbbb":return o.dayPeriod(e,{width:"narrow",context:"formatting"});case"bbbb":default:return o.dayPeriod(e,{width:"wide",context:"formatting"})||o.dayPeriod(e,{width:"abbreviated",context:"formatting"})||o.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,t,o){return e.setHours(qa(o),0,0,0),e}}class Og extends me{constructor(){super(...arguments);B(this,"priority",80);B(this,"incompatibleTokens",["a","b","t","T"])}parse(e,t,o){switch(t){case"B":case"BB":case"BBB":return o.dayPeriod(e,{width:"abbreviated",context:"formatting"})||o.dayPeriod(e,{width:"narrow",context:"formatting"});case"BBBBB":return o.dayPeriod(e,{width:"narrow",context:"formatting"});case"BBBB":default:return o.dayPeriod(e,{width:"wide",context:"formatting"})||o.dayPeriod(e,{width:"abbreviated",context:"formatting"})||o.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,t,o){return e.setHours(qa(o),0,0,0),e}}class Mg extends me{constructor(){super(...arguments);B(this,"priority",70);B(this,"incompatibleTokens",["H","K","k","t","T"])}parse(e,t,o){switch(t){case"h":return _e(Te.hour12h,e);case"ho":return o.ordinalNumber(e,{unit:"hour"});default:return Me(t.length,e)}}validate(e,t){return t>=1&&t<=12}set(e,t,o){const a=e.getHours()>=12;return a&&o<12?e.setHours(o+12,0,0,0):!a&&o===12?e.setHours(0,0,0,0):e.setHours(o,0,0,0),e}}class Pg extends me{constructor(){super(...arguments);B(this,"priority",70);B(this,"incompatibleTokens",["a","b","h","K","k","t","T"])}parse(e,t,o){switch(t){case"H":return _e(Te.hour23h,e);case"Ho":return o.ordinalNumber(e,{unit:"hour"});default:return Me(t.length,e)}}validate(e,t){return t>=0&&t<=23}set(e,t,o){return e.setHours(o,0,0,0),e}}class Tg extends me{constructor(){super(...arguments);B(this,"priority",70);B(this,"incompatibleTokens",["h","H","k","t","T"])}parse(e,t,o){switch(t){case"K":return _e(Te.hour11h,e);case"Ko":return o.ordinalNumber(e,{unit:"hour"});default:return Me(t.length,e)}}validate(e,t){return t>=0&&t<=11}set(e,t,o){return e.getHours()>=12&&o<12?e.setHours(o+12,0,0,0):e.setHours(o,0,0,0),e}}class Ng extends me{constructor(){super(...arguments);B(this,"priority",70);B(this,"incompatibleTokens",["a","b","h","H","K","t","T"])}parse(e,t,o){switch(t){case"k":return _e(Te.hour24h,e);case"ko":return o.ordinalNumber(e,{unit:"hour"});default:return Me(t.length,e)}}validate(e,t){return t>=1&&t<=24}set(e,t,o){const a=o<=24?o%24:o;return e.setHours(a,0,0,0),e}}class Ig extends me{constructor(){super(...arguments);B(this,"priority",60);B(this,"incompatibleTokens",["t","T"])}parse(e,t,o){switch(t){case"m":return _e(Te.minute,e);case"mo":return o.ordinalNumber(e,{unit:"minute"});default:return Me(t.length,e)}}validate(e,t){return t>=0&&t<=59}set(e,t,o){return e.setMinutes(o,0,0),e}}class Fg extends me{constructor(){super(...arguments);B(this,"priority",50);B(this,"incompatibleTokens",["t","T"])}parse(e,t,o){switch(t){case"s":return _e(Te.second,e);case"so":return o.ordinalNumber(e,{unit:"second"});default:return Me(t.length,e)}}validate(e,t){return t>=0&&t<=59}set(e,t,o){return e.setSeconds(o,0),e}}class Lg extends me{constructor(){super(...arguments);B(this,"priority",30);B(this,"incompatibleTokens",["t","T"])}parse(e,t){const o=a=>Math.trunc(a*Math.pow(10,-t.length+3));return Ne(Me(t.length,e),o)}set(e,t,o){return e.setMilliseconds(o),e}}class $g extends me{constructor(){super(...arguments);B(this,"priority",10);B(this,"incompatibleTokens",["t","T","x"])}parse(e,t){switch(t){case"X":return pt(ft.basicOptionalMinutes,e);case"XX":return pt(ft.basic,e);case"XXXX":return pt(ft.basicOptionalSeconds,e);case"XXXXX":return pt(ft.extendedOptionalSeconds,e);case"XXX":default:return pt(ft.extended,e)}}set(e,t,o){return t.timestampIsSet?e:ge(e,e.getTime()-Jr(e)-o)}}class Ag extends me{constructor(){super(...arguments);B(this,"priority",10);B(this,"incompatibleTokens",["t","T","X"])}parse(e,t){switch(t){case"x":return pt(ft.basicOptionalMinutes,e);case"xx":return pt(ft.basic,e);case"xxxx":return pt(ft.basicOptionalSeconds,e);case"xxxxx":return pt(ft.extendedOptionalSeconds,e);case"xxx":default:return pt(ft.extended,e)}}set(e,t,o){return t.timestampIsSet?e:ge(e,e.getTime()-Jr(e)-o)}}class Yg extends me{constructor(){super(...arguments);B(this,"priority",40);B(this,"incompatibleTokens","*")}parse(e){return Ou(e)}set(e,t,o){return[ge(e,o*1e3),{timestampIsSet:!0}]}}class Wg extends me{constructor(){super(...arguments);B(this,"priority",20);B(this,"incompatibleTokens","*")}parse(e){return Ou(e)}set(e,t,o){return[ge(e,o),{timestampIsSet:!0}]}}const jg={G:new og,y:new ag,Y:new ig,R:new sg,u:new lg,Q:new ug,q:new cg,M:new dg,L:new fg,w:new mg,I:new vg,d:new yg,D:new wg,E:new xg,e:new Dg,c:new Eg,i:new Sg,a:new Cg,b:new _g,B:new Og,h:new Mg,H:new Pg,K:new Tg,k:new Ng,m:new Ig,s:new Fg,S:new Lg,X:new $g,x:new Ag,t:new Yg,T:new Wg},Hg=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Rg=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Bg=/^'([^]*?)'?$/,Vg=/''/g,zg=/\S/,Ug=/[a-zA-Z]/;function Qg(n,r,e,t){var g,w,y,x,E,k,C,S;const o=()=>ge((t==null?void 0:t.in)||e,NaN),a=Gv(),i=(t==null?void 0:t.locale)??a.locale??bu,s=(t==null?void 0:t.firstWeekContainsDate)??((w=(g=t==null?void 0:t.locale)==null?void 0:g.options)==null?void 0:w.firstWeekContainsDate)??a.firstWeekContainsDate??((x=(y=a.locale)==null?void 0:y.options)==null?void 0:x.firstWeekContainsDate)??1,l=(t==null?void 0:t.weekStartsOn)??((k=(E=t==null?void 0:t.locale)==null?void 0:E.options)==null?void 0:k.weekStartsOn)??a.weekStartsOn??((S=(C=a.locale)==null?void 0:C.options)==null?void 0:S.weekStartsOn)??0;if(!r)return n?o():K(e,t==null?void 0:t.in);const u={firstWeekContainsDate:s,weekStartsOn:l,locale:i},c=[new rg(t==null?void 0:t.in,e)],p=r.match(Rg).map(D=>{const _=D[0];if(_ in Qa){const O=Qa[_];return O(D,i.formatLong)}return D}).join("").match(Hg),m=[];for(let D of p){const _=D[0],O=jg[_];if(O){const{incompatibleTokens:T}=O;if(Array.isArray(T)){const W=m.find(N=>T.includes(N.token)||N.token===_);if(W)throw new RangeError(`The format string mustn't contain \`${W.fullToken}\` and \`${D}\` at the same time`)}else if(O.incompatibleTokens==="*"&&m.length>0)throw new RangeError(`The format string mustn't contain \`${D}\` and any other token at the same time`);m.push({token:_,fullToken:D});const Y=O.run(n,D,i.match,u);if(!Y)return o();c.push(Y.setter),n=Y.rest}else{if(_.match(Ug))throw new RangeError("Format string contains an unescaped latin alphabet character `"+_+"`");if(D==="''"?D="'":_==="'"&&(D=Kg(D)),n.indexOf(D)===0)n=n.slice(D.length);else return o()}}if(n.length>0&&zg.test(n))return o();const f=c.map(D=>D.priority).sort((D,_)=>_-D).filter((D,_,O)=>O.indexOf(D)===_).map(D=>c.filter(_=>_.priority===D).sort((_,O)=>O.subPriority-_.subPriority)).map(D=>D[0]);let h=K(e,t==null?void 0:t.in);if(isNaN(+h))return o();const v={};for(const D of f){if(!D.validate(h,u))return o();const _=D.set(h,v,u);Array.isArray(_)?(h=_[0],Object.assign(v,_[1])):h=_}return h}function Kg(n){return n.match(Bg)[1].replace(Vg,"'")}function qg(n,r,e){const[t,o]=St(e==null?void 0:e.in,n,r);return t.getFullYear()===o.getFullYear()&&t.getMonth()===o.getMonth()}function Gg(n,r,e){const[t,o]=St(e==null?void 0:e.in,n,r);return+Va(t)==+Va(o)}function Xg(n,r,e){const[t,o]=St(e==null?void 0:e.in,n,r);return t.getFullYear()===o.getFullYear()}function sr(n,r,e){const t=+K(n,e==null?void 0:e.in),[o,a]=[+K(r.start,e==null?void 0:e.in),+K(r.end,e==null?void 0:e.in)].sort((i,s)=>i-s);return t>=o&&t<=a}function Jg(n,r,e){return rt(n,-1,e)}function Zg(n,r){const e=()=>ge(r==null?void 0:r.in,NaN),o=rb(n);let a;if(o.date){const u=ob(o.date,2);a=ab(u.restDateString,u.year)}if(!a||isNaN(+a))return e();const i=+a;let s=0,l;if(o.time&&(s=ib(o.time),isNaN(s)))return e();if(o.timezone){if(l=sb(o.timezone),isNaN(l))return e()}else{const u=new Date(i+s),c=K(0,r==null?void 0:r.in);return c.setFullYear(u.getUTCFullYear(),u.getUTCMonth(),u.getUTCDate()),c.setHours(u.getUTCHours(),u.getUTCMinutes(),u.getUTCSeconds(),u.getUTCMilliseconds()),c}return K(i+s+l,r==null?void 0:r.in)}const io={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},eb=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,tb=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,nb=/^([+-])(\d{2})(?::?(\d{2}))?$/;function rb(n){const r={},e=n.split(io.dateTimeDelimiter);let t;if(e.length>2)return r;if(/:/.test(e[0])?t=e[0]:(r.date=e[0],t=e[1],io.timeZoneDelimiter.test(r.date)&&(r.date=n.split(io.timeZoneDelimiter)[0],t=n.substr(r.date.length,n.length))),t){const o=io.timezone.exec(t);o?(r.time=t.replace(o[1],""),r.timezone=o[1]):r.time=t}return r}function ob(n,r){const e=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+r)+"})|(\\d{2}|[+-]\\d{"+(2+r)+"})$)"),t=n.match(e);if(!t)return{year:NaN,restDateString:""};const o=t[1]?parseInt(t[1]):null,a=t[2]?parseInt(t[2]):null;return{year:a===null?o:a*100,restDateString:n.slice((t[1]||t[2]).length)}}function ab(n,r){if(r===null)return new Date(NaN);const e=n.match(eb);if(!e)return new Date(NaN);const t=!!e[4],o=lr(e[1]),a=lr(e[2])-1,i=lr(e[3]),s=lr(e[4]),l=lr(e[5])-1;if(t)return fb(r,s,l)?lb(r,s,l):new Date(NaN);{const u=new Date(0);return!cb(r,a,i)||!db(r,o)?new Date(NaN):(u.setUTCFullYear(r,a,Math.max(o,i)),u)}}function lr(n){return n?parseInt(n):1}function ib(n){const r=n.match(tb);if(!r)return NaN;const e=Xa(r[1]),t=Xa(r[2]),o=Xa(r[3]);return pb(e,t,o)?e*Xr+t*Gr+o*1e3:NaN}function Xa(n){return n&&parseFloat(n.replace(",","."))||0}function sb(n){if(n==="Z")return 0;const r=n.match(nb);if(!r)return 0;const e=r[1]==="+"?-1:1,t=parseInt(r[2]),o=r[3]&&parseInt(r[3])||0;return mb(t,o)?e*(t*Xr+o*Gr):NaN}function lb(n,r,e){const t=new Date(0);t.setUTCFullYear(n,0,4);const o=t.getUTCDay()||7,a=(r-1)*7+e+1-o;return t.setUTCDate(t.getUTCDate()+a),t}const ub=[31,null,31,30,31,30,31,31,30,31,30,31];function Tu(n){return n%400===0||n%4===0&&n%100!==0}function cb(n,r,e){return r>=0&&r<=11&&e>=1&&e<=(ub[r]||(Tu(n)?29:28))}function db(n,r){return r>=1&&r<=(Tu(n)?366:365)}function fb(n,r,e){return r>=1&&r<=53&&e>=0&&e<=6}function pb(n,r,e){return n===24?r===0&&e===0:e>=0&&e<60&&r>=0&&r<60&&n>=0&&n<25}function mb(n,r){return r>=0&&r<=59}function Ge(n,r,e){const t=K(n,e==null?void 0:e.in),o=t.getFullYear(),a=t.getDate(),i=ge(n,0);i.setFullYear(o,r,15),i.setHours(0,0,0,0);const s=qv(i);return t.setMonth(r,Math.min(a,s)),t}function so(n,r,e){const t=K(n,e==null?void 0:e.in);return t.setHours(r),t}function lo(n,r,e){const t=K(n,e==null?void 0:e.in);return t.setMinutes(r),t}function Pn(n,r,e){const t=K(n,e==null?void 0:e.in),o=Math.trunc(t.getMonth()/3)+1,a=r-o;return Ge(t,t.getMonth()+a*3)}function uo(n,r,e){const t=K(n,e==null?void 0:e.in);return t.setSeconds(r),t}function mt(n,r,e){const t=K(n,e==null?void 0:e.in);return isNaN(+t)?ge(n,NaN):(t.setFullYear(r),t)}function ln(n,r,e){return ot(n,-r,e)}function Nu(n,r,e){return Ba(n,-1,e)}function Iu(n,r,e){return Zr(n,-1,e)}function Tn(n,r,e){return Ct(n,-r,e)}const hb={lessThanXSeconds:{one:"1초 미만",other:"{{count}}초 미만"},xSeconds:{one:"1초",other:"{{count}}초"},halfAMinute:"30초",lessThanXMinutes:{one:"1분 미만",other:"{{count}}분 미만"},xMinutes:{one:"1분",other:"{{count}}분"},aboutXHours:{one:"약 1시간",other:"약 {{count}}시간"},xHours:{one:"1시간",other:"{{count}}시간"},xDays:{one:"1일",other:"{{count}}일"},aboutXWeeks:{one:"약 1주",other:"약 {{count}}주"},xWeeks:{one:"1주",other:"{{count}}주"},aboutXMonths:{one:"약 1개월",other:"약 {{count}}개월"},xMonths:{one:"1개월",other:"{{count}}개월"},aboutXYears:{one:"약 1년",other:"약 {{count}}년"},xYears:{one:"1년",other:"{{count}}년"},overXYears:{one:"1년 이상",other:"{{count}}년 이상"},almostXYears:{one:"거의 1년",other:"거의 {{count}}년"}},vb=(n,r,e)=>{let t;const o=hb[n];return typeof o=="string"?t=o:r===1?t=o.one:t=o.other.replace("{{count}}",r.toString()),e!=null&&e.addSuffix?e.comparison&&e.comparison>0?t+" 후":t+" 전":t},gb={full:"y년 M월 d일 EEEE",long:"y년 M월 d일",medium:"y.MM.dd",short:"y.MM.dd"},bb={full:"a H시 mm분 ss초 zzzz",long:"a H:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},yb={full:"{{date}} {{time}}",long:"{{date}} {{time}}",medium:"{{date}} {{time}}",short:"{{date}} {{time}}"},wb={date:On({formats:gb,defaultWidth:"full"}),time:On({formats:bb,defaultWidth:"full"}),dateTime:On({formats:yb,defaultWidth:"full"})},xb={lastWeek:"'지난' eeee p",yesterday:"'어제' p",today:"'오늘' p",tomorrow:"'내일' p",nextWeek:"'다음' eeee p",other:"P"},Db=(n,r,e,t)=>xb[n],Eb={narrow:["BC","AD"],abbreviated:["BC","AD"],wide:["기원전","서기"]},kb={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1분기","2분기","3분기","4분기"]},Sb={narrow:["1","2","3","4","5","6","7","8","9","10","11","12"],abbreviated:["1월","2월","3월","4월","5월","6월","7월","8월","9월","10월","11월","12월"],wide:["1월","2월","3월","4월","5월","6월","7월","8월","9월","10월","11월","12월"]},Cb={narrow:["일","월","화","수","목","금","토"],short:["일","월","화","수","목","금","토"],abbreviated:["일","월","화","수","목","금","토"],wide:["일요일","월요일","화요일","수요일","목요일","금요일","토요일"]},_b={narrow:{am:"오전",pm:"오후",midnight:"자정",noon:"정오",morning:"아침",afternoon:"오후",evening:"저녁",night:"밤"},abbreviated:{am:"오전",pm:"오후",midnight:"자정",noon:"정오",morning:"아침",afternoon:"오후",evening:"저녁",night:"밤"},wide:{am:"오전",pm:"오후",midnight:"자정",noon:"정오",morning:"아침",afternoon:"오후",evening:"저녁",night:"밤"}},Ob={narrow:{am:"오전",pm:"오후",midnight:"자정",noon:"정오",morning:"아침",afternoon:"오후",evening:"저녁",night:"밤"},abbreviated:{am:"오전",pm:"오후",midnight:"자정",noon:"정오",morning:"아침",afternoon:"오후",evening:"저녁",night:"밤"},wide:{am:"오전",pm:"오후",midnight:"자정",noon:"정오",morning:"아침",afternoon:"오후",evening:"저녁",night:"밤"}},Mb={ordinalNumber:(n,r)=>{const e=Number(n);switch(String(r==null?void 0:r.unit)){case"minute":case"second":return String(e);case"date":return e+"일";default:return e+"번째"}},era:ct({values:Eb,defaultWidth:"wide"}),quarter:ct({values:kb,defaultWidth:"wide",argumentCallback:n=>n-1}),month:ct({values:Sb,defaultWidth:"wide"}),day:ct({values:Cb,defaultWidth:"wide"}),dayPeriod:ct({values:_b,defaultWidth:"wide",formattingValues:Ob,defaultFormattingWidth:"wide"})},Pb=/^(\d+)(일|번째)?/i,Tb=/\d+/i,Nb={narrow:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(기원전|서기)/i},Ib={any:[/^(bc|기원전)/i,/^(ad|서기)/i]},Fb={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234]사?분기/i},Lb={any:[/1/i,/2/i,/3/i,/4/i]},$b={narrow:/^(1[012]|[123456789])/,abbreviated:/^(1[012]|[123456789])월/i,wide:/^(1[012]|[123456789])월/i},Ab={any:[/^1월?$/,/^2/,/^3/,/^4/,/^5/,/^6/,/^7/,/^8/,/^9/,/^10/,/^11/,/^12/]},Yb={narrow:/^[일월화수목금토]/,short:/^[일월화수목금토]/,abbreviated:/^[일월화수목금토]/,wide:/^[일월화수목금토]요일/},Wb={any:[/^일/,/^월/,/^화/,/^수/,/^목/,/^금/,/^토/]},jb={any:/^(am|pm|오전|오후|자정|정오|아침|저녁|밤)/i},Hb={any:{am:/^(am|오전)/i,pm:/^(pm|오후)/i,midnight:/^자정/i,noon:/^정오/i,morning:/^아침/i,afternoon:/^오후/i,evening:/^저녁/i,night:/^밤/i}},Rb={ordinalNumber:gu({matchPattern:Pb,parsePattern:Tb,valueCallback:n=>parseInt(n,10)}),era:dt({matchPatterns:Nb,defaultMatchWidth:"wide",parsePatterns:Ib,defaultParseWidth:"any"}),quarter:dt({matchPatterns:Fb,defaultMatchWidth:"wide",parsePatterns:Lb,defaultParseWidth:"any",valueCallback:n=>n+1}),month:dt({matchPatterns:$b,defaultMatchWidth:"wide",parsePatterns:Ab,defaultParseWidth:"any"}),day:dt({matchPatterns:Yb,defaultMatchWidth:"wide",parsePatterns:Wb,defaultParseWidth:"any"}),dayPeriod:dt({matchPatterns:jb,defaultMatchWidth:"any",parsePatterns:Hb,defaultParseWidth:"any"})},Bb={code:"ko",formatDistance:vb,formatLong:wb,formatRelative:Db,localize:Mb,match:Rb,options:{weekStartsOn:0,firstWeekContainsDate:1}};var co=typeof document<"u"?d.useLayoutEffect:d.useEffect;const Vb={...F}.useInsertionEffect||(n=>n());function zb(n){const r=F.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return Vb(()=>{r.current=n}),F.useCallback(function(){for(var e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];return r.current==null?void 0:r.current(...t)},[])}const Ub={...F};let Fu=!1,Qb=0;const Lu=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+Qb++;function Kb(){const[n,r]=F.useState(()=>Fu?Lu():void 0);return co(()=>{n==null&&r(Lu())},[]),F.useEffect(()=>{Fu=!0},[]),n}const $u=Ub.useId||Kb;let ur;process.env.NODE_ENV!=="production"&&(ur=new Set);function qb(){for(var n,r=arguments.length,e=new Array(r),t=0;t<r;t++)e[t]=arguments[t];const o="Floating UI: "+e.join(" ");if(!((n=ur)!=null&&n.has(o))){var a;(a=ur)==null||a.add(o),console.warn(o)}}function Gb(){for(var n,r=arguments.length,e=new Array(r),t=0;t<r;t++)e[t]=arguments[t];const o="Floating UI: "+e.join(" ");if(!((n=ur)!=null&&n.has(o))){var a;(a=ur)==null||a.add(o),console.error(o)}}const Xb=F.forwardRef(function(r,e){const{context:{placement:t,elements:{floating:o},middlewareData:{arrow:a,shift:i}},width:s=14,height:l=7,tipRadius:u=0,strokeWidth:c=0,staticOffset:p,stroke:m,d:f,style:{transform:h,...v}={},...g}=r;process.env.NODE_ENV!=="production"&&(e||qb("The `ref` prop is required for `FloatingArrow`."));const w=$u(),[y,x]=F.useState(!1);if(co(()=>{if(!o)return;qe(o).direction==="rtl"&&x(!0)},[o]),!o)return null;const[E,k]=t.split("-"),C=E==="top"||E==="bottom";let S=p;(C&&i!=null&&i.x||!C&&i!=null&&i.y)&&(S=null);const D=c*2,_=D/2,O=s/2*(u/-8+1),T=l/2*u/4,Y=!!f,W=S&&k==="end"?"bottom":"top";let N=S&&k==="end"?"right":"left";S&&y&&(N=k==="end"?"left":"right");const L=(a==null?void 0:a.x)!=null?S||a.x:"",$=(a==null?void 0:a.y)!=null?S||a.y:"",z=f||"M0,0"+(" H"+s)+(" L"+(s-O)+","+(l-T))+(" Q"+s/2+","+l+" "+O+","+(l-T))+" Z",P={top:Y?"rotate(180deg)":"",left:Y?"rotate(90deg)":"rotate(-90deg)",bottom:Y?"":"rotate(180deg)",right:Y?"rotate(-90deg)":"rotate(90deg)"}[E];return M.jsxs("svg",{...g,"aria-hidden":!0,ref:e,width:Y?s:s+D,height:s,viewBox:"0 0 "+s+" "+(l>s?l:s),style:{position:"absolute",pointerEvents:"none",[N]:L,[W]:$,[E]:C||Y?"100%":"calc(100% - "+D/2+"px)",transform:[P,h].filter(q=>!!q).join(" "),...v},children:[D>0&&M.jsx("path",{clipPath:"url(#"+w+")",fill:"none",stroke:m,strokeWidth:D+(f?0:1),d:z}),M.jsx("path",{stroke:D&&!f?g.fill:"none",d:z}),M.jsx("clipPath",{id:w,children:M.jsx("rect",{x:-_,y:_*(Y?-1:1),width:s+D,height:s})})]})});function Jb(){const n=new Map;return{emit(r,e){var t;(t=n.get(r))==null||t.forEach(o=>o(e))},on(r,e){n.has(r)||n.set(r,new Set),n.get(r).add(e)},off(r,e){var t;(t=n.get(r))==null||t.delete(e)}}}const Zb=F.createContext(null),ey=F.createContext(null),ty=()=>{var n;return((n=F.useContext(Zb))==null?void 0:n.id)||null},ny=()=>F.useContext(ey);function ry(n){const{open:r=!1,onOpenChange:e,elements:t}=n,o=$u(),a=F.useRef({}),[i]=F.useState(()=>Jb()),s=ty()!=null;if(process.env.NODE_ENV!=="production"){const f=t.reference;f&&!Pe(f)&&Gb("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[l,u]=F.useState(t.reference),c=zb((f,h,v)=>{a.current.openEvent=f?h:void 0,i.emit("openchange",{open:f,event:h,reason:v,nested:s}),e==null||e(f,h,v)}),p=F.useMemo(()=>({setPositionReference:u}),[]),m=F.useMemo(()=>({reference:l||t.reference||null,floating:t.floating||null,domReference:t.reference}),[l,t.reference,t.floating]);return F.useMemo(()=>({dataRef:a,open:r,onOpenChange:c,elements:m,events:i,floatingId:o,refs:p}),[r,c,m,i,o,p])}function oy(n){n===void 0&&(n={});const{nodeId:r}=n,e=ry({...n,elements:{reference:null,floating:null,...n.elements}}),t=n.rootContext||e,o=t.elements,[a,i]=F.useState(null),[s,l]=F.useState(null),c=(o==null?void 0:o.domReference)||a,p=F.useRef(null),m=ny();co(()=>{c&&(p.current=c)},[c]);const f=Vs({...n,elements:{...o,...s&&{reference:s}}}),h=F.useCallback(x=>{const E=Pe(x)?{getBoundingClientRect:()=>x.getBoundingClientRect(),getClientRects:()=>x.getClientRects(),contextElement:x}:x;l(E),f.refs.setReference(E)},[f.refs]),v=F.useCallback(x=>{(Pe(x)||x===null)&&(p.current=x,i(x)),(Pe(f.refs.reference.current)||f.refs.reference.current===null||x!==null&&!Pe(x))&&f.refs.setReference(x)},[f.refs]),g=F.useMemo(()=>({...f.refs,setReference:v,setPositionReference:h,domReference:p}),[f.refs,v,h]),w=F.useMemo(()=>({...f.elements,domReference:c}),[f.elements,c]),y=F.useMemo(()=>({...f,...t,refs:g,elements:w,nodeId:r}),[f,g,w,r,t]);return co(()=>{t.dataRef.current.floatingContext=y;const x=m==null?void 0:m.nodesRef.current.find(E=>E.id===r);x&&(x.context=y)}),F.useMemo(()=>({...f,context:y,refs:g,elements:w}),[f,g,w,y])}/*!
|
|
49
49
|
react-datepicker v8.3.0
|
|
50
50
|
https://github.com/Hacker0x01/react-datepicker
|
|
51
51
|
Released under the MIT License.
|