@petnow/ui 2.3.0 → 2.3.1

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.umd.js CHANGED
@@ -50,7 +50,7 @@ Valid keys: `+JSON.stringify(Object.keys(M),null," "));var U=Pe(A,X,F,ne,q+"."+
50
50
  also providing a custom height.
51
51
  The custom height has a higher priority than the animateHeight property.
52
52
  So animateHeight is most likely having no effect at all.`);var zt=(0,e.default)({},m.slide,j),ut,Ct;if(X||!P||A)ut="all 0s ease 0s",Ct="all 0s ease 0s";else if(ut=g("transform",W),Ct=g("-webkit-transform",W),H!==0){var jr=", ".concat(g("height",W));ut+=jr,Ct+=jr}var Sn={height:null,WebkitFlexDirection:v.flexDirection[N],flexDirection:v.flexDirection[N],WebkitTransition:Ct,transition:ut};if(!Pe){var kn=v.transform[N](this.indexCurrent*100);Sn.WebkitTransform=kn,Sn.transform=kn}return L&&(Sn.height=H),u.createElement(T.Provider,{value:this.getSwipeableViewsContext()},u.createElement("div",(0,e.default)({ref:this.setRootNode,style:(0,e.default)({},v.root[N],F)},ne,U,Xe,{onScroll:this.handleScroll}),u.createElement("div",{ref:this.setContainerNode,style:(0,e.default)({},Sn,m.container,I),className:"react-swipeable-view-container"},u.Children.map(z,function(Wr,ra){if(Pe&&ra!==G)return null;process.env.NODE_ENV!=="production"&&(0,f.default)(u.isValidElement(Wr),"react-swipeable-view: one of the children provided is invalid: ".concat(Wr,`.
53
- We are expecting a valid React Element`));var Jn,oa=!0;return ra===G&&(oa=!1,L&&(Jn=b.setActiveSlide,zt.overflowY="hidden")),u.createElement("div",{ref:Jn,style:zt,className:Q,"aria-hidden":oa,"data-swipeable":"true"},Wr)}))))}}]),O}(u.Component);$.displayName="ReactSwipableView",$.propTypes=process.env.NODE_ENV!=="production"?{action:c.default.func,animateHeight:c.default.bool,animateTransitions:c.default.bool,axis:c.default.oneOf(["x","x-reverse","y","y-reverse"]),children:c.default.node.isRequired,containerStyle:c.default.object,disabled:c.default.bool,disableLazyLoading:c.default.bool,enableMouseEvents:c.default.bool,hysteresis:c.default.number,ignoreNativeScroll:c.default.bool,index:c.default.number,onChangeIndex:c.default.func,onMouseDown:c.default.func,onMouseLeave:c.default.func,onMouseMove:c.default.func,onMouseUp:c.default.func,onScroll:c.default.func,onSwitching:c.default.func,onTouchEnd:c.default.func,onTouchMove:c.default.func,onTouchStart:c.default.func,onTransitionEnd:c.default.func,resistance:c.default.bool,slideClassName:c.default.string,slideStyle:c.default.object,springConfig:c.default.shape({delay:c.default.string,duration:c.default.string,easeFunction:c.default.string}),style:c.default.object,threshold:c.default.number}:{},$.defaultProps={animateHeight:!1,animateTransitions:!0,axis:"x",disabled:!1,disableLazyLoading:!1,enableMouseEvents:!1,hysteresis:.6,ignoreNativeScroll:!1,index:0,threshold:5,springConfig:{duration:"0.35s",easeFunction:"cubic-bezier(0.15, 0.3, 0.25, 1)",delay:"0s"},resistance:!1};var _=$;return Mt.default=_,Mt}var vl;function xp(){return vl||(vl=1,function(n){var r=Fs();Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"default",{enumerable:!0,get:function(){return e.default}}),Object.defineProperty(n,"SwipeableViewsContext",{enumerable:!0,get:function(){return e.SwipeableViewsContext}});var e=r(wp())}(da)),da}var Ep=xp();const Dp=pf(Ep),Sp=({className:n,tabList:r,isCuratedcontent:e,unswipeableContent:t,defaultIndex:o=0,onTabChange:a,disabled:i})=>{const[s,l]=d.useState(o),u=d.useRef(null),c=p=>{p.current&&window.scrollTo({top:p.current.offsetTop-50,behavior:"smooth"})},f=p=>{l(p),c(u),a==null||a(p)},h=()=>{const m=100/r.length;return{width:`${m}%`,left:`${s*m}%`}};return Y.jsxs("div",{ref:u,className:"w-full",children:[Y.jsxs("div",{className:Ze(n==null?void 0:n.tab,`z-50 mb-[20px] flex w-full flex-col bg-white ${e&&"sticky top-[50px]"}`),children:[Y.jsx("div",{className:"flex",children:r.map((p,m)=>Y.jsx("div",{className:"flex flex-1 flex-col",children:Y.jsx("button",{className:Ze(n==null?void 0:n.tabTitle,`cursor-pointer ${s===m?"text-petnow-grey-30 text-label-large":"text-petnow-grey-70 text-body-large disabled:opacity-40"}`),onClick:()=>f(m),disabled:i,children:p.displayName})},p.key))}),Y.jsx("div",{className:Ze(n==null?void 0:n.underline,`relative h-[2px] w-full ${i?"bg-petnow-grey-70/40":"bg-petnow-grey-70"}`),children:Y.jsx("div",{className:Ze(n==null?void 0:n.selectedUnderline,"bg-petnow-grey-30 absolute h-[2px] transition-all duration-200"),style:h()})})]}),t,Y.jsx(Dp,{index:s,onChangeIndex:p=>{l(p),a==null||a(p)},disabled:i,children:r.map(p=>Y.jsx("div",{children:p.content},p.key))})]})},kp=({className:n,id:r,onChange:e,disabled:t,isChecked:o})=>Y.jsxs("label",{className:"relative flex h-min w-min cursor-pointer items-center rounded-full",htmlFor:r,children:[Y.jsx("input",{type:"checkbox",disabled:t,className:Ze(n,"before:content[''] peer bg-petnow-grey-primary checked:border-petnow-orange-primary checked:bg-petnow-orange-primary checked:before:bg-petnow-orange-primary border-petnow-grey-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-6 before:w-6 before:-translate-x-2/4 before:-translate-y-2/4 before:rounded-full before:opacity-0 before:transition-opacity"),id:r,checked:o,onChange:a=>{e(a.target.checked)}}),Y.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:Y.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:Y.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"})})})]}),_p=({className:n,text:r,isSelected:e,onClick:t,disabled:o})=>Y.jsx("button",{className:Ze(n,`keen-slider__slide text-body-medium rounded-full border-1 px-[12px] py-[6px] whitespace-nowrap ${e?"border-petnow-orange-primary bg-petnow-orange-secondary text-petnow-orange-primary":"border-petnow-grey-90 disabled:opacity-40"}`),onClick:t,style:{width:"min-content",minWidth:"fit-content"},disabled:o,children:r}),gl=typeof document<"u"?d.useLayoutEffect:()=>{};function Cp(n){const r=d.useRef(null);return gl(()=>{r.current=n},[n]),d.useCallback((...e)=>{const t=r.current;return t==null?void 0:t(...e)},[])}const Ut=n=>{var r;return(r=n==null?void 0:n.ownerDocument)!==null&&r!==void 0?r:document},ln=n=>n&&"window"in n&&n.window===n?n:Ut(n).defaultView||window;function Op(n){return n!==null&&typeof n=="object"&&"nodeType"in n&&typeof n.nodeType=="number"}function Mp(n){return Op(n)&&n.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&"host"in n}let Tp=!1;function Ta(){return Tp}function bl(n,r){if(!Ta())return r&&n?n.contains(r):!1;if(!n||!r)return!1;let e=r;for(;e!==null;){if(e===n)return!0;e.tagName==="SLOT"&&e.assignedSlot?e=e.assignedSlot.parentNode:Mp(e)?e=e.host:e=e.parentNode}return!1}const Pa=(n=document)=>{var r;if(!Ta())return n.activeElement;let e=n.activeElement;for(;e&&"shadowRoot"in e&&(!((r=e.shadowRoot)===null||r===void 0)&&r.activeElement);)e=e.shadowRoot.activeElement;return e};function yl(n){return Ta()&&n.target.shadowRoot&&n.composedPath?n.composedPath()[0]:n.target}function eo(n){var r;return typeof window>"u"||window.navigator==null?!1:((r=window.navigator.userAgentData)===null||r===void 0?void 0:r.brands.some(e=>n.test(e.brand)))||n.test(window.navigator.userAgent)}function Ia(n){var r;return typeof window<"u"&&window.navigator!=null?n.test(((r=window.navigator.userAgentData)===null||r===void 0?void 0:r.platform)||window.navigator.platform):!1}function Tt(n){if(process.env.NODE_ENV==="test")return n;let r=null;return()=>(r==null&&(r=n()),r)}const Na=Tt(function(){return Ia(/^Mac/i)}),Pp=Tt(function(){return Ia(/^iPhone/i)}),Ip=Tt(function(){return Ia(/^iPad/i)||Na()&&navigator.maxTouchPoints>1}),Np=Tt(function(){return Pp()||Ip()});Tt(function(){return Na()||Np()}),Tt(function(){return eo(/AppleWebKit/i)&&!Lp()});const Lp=Tt(function(){return eo(/Chrome/i)}),Fp=Tt(function(){return eo(/Android/i)});Tt(function(){return eo(/Firefox/i)});function wl(){let n=d.useRef(new Map),r=d.useCallback((o,a,i,s)=>{let l=s!=null&&s.once?(...u)=>{n.current.delete(i),i(...u)}:i;n.current.set(i,{type:a,eventTarget:o,fn:l,options:s}),o.addEventListener(a,l,s)},[]),e=d.useCallback((o,a,i,s)=>{var l;let u=((l=n.current.get(i))===null||l===void 0?void 0:l.fn)||i;o.removeEventListener(a,u,s),n.current.delete(i)},[]),t=d.useCallback(()=>{n.current.forEach((o,a)=>{e(o.eventTarget,o.type,a,o.options)})},[e]);return d.useEffect(()=>t,[t]),{addGlobalListener:r,removeGlobalListener:e,removeAllGlobalListeners:t}}function $p(n){return n.mozInputSource===0&&n.isTrusted?!0:Fp()&&n.pointerType?n.type==="click"&&n.buttons===1:n.detail===0&&!n.pointerType}function xl(n){let r=n;return r.nativeEvent=n,r.isDefaultPrevented=()=>r.defaultPrevented,r.isPropagationStopped=()=>r.cancelBubble,r.persist=()=>{},r}function Ap(n,r){Object.defineProperty(n,"target",{value:r}),Object.defineProperty(n,"currentTarget",{value:r})}function El(n){let r=d.useRef({isFocused:!1,observer:null});gl(()=>{const t=r.current;return()=>{t.observer&&(t.observer.disconnect(),t.observer=null)}},[]);let e=Cp(t=>{n==null||n(t)});return d.useCallback(t=>{if(t.target instanceof HTMLButtonElement||t.target instanceof HTMLInputElement||t.target instanceof HTMLTextAreaElement||t.target instanceof HTMLSelectElement){r.current.isFocused=!0;let o=t.target,a=i=>{if(r.current.isFocused=!1,o.disabled){let s=xl(i);e(s)}r.current.observer&&(r.current.observer.disconnect(),r.current.observer=null)};o.addEventListener("focusout",a,{once:!0}),r.current.observer=new MutationObserver(()=>{if(r.current.isFocused&&o.disabled){var i;(i=r.current.observer)===null||i===void 0||i.disconnect();let s=o===document.activeElement?null:document.activeElement;o.dispatchEvent(new FocusEvent("blur",{relatedTarget:s})),o.dispatchEvent(new FocusEvent("focusout",{bubbles:!0,relatedTarget:s}))}}),r.current.observer.observe(o,{attributes:!0,attributeFilter:["disabled"]})}},[e])}let Yp=!1,dr=null,La=new Set,fr=new Map,un=!1,Fa=!1;const Rp={Tab:!0,Escape:!0};function $a(n,r){for(let e of La)e(n,r)}function jp(n){return!(n.metaKey||!Na()&&n.altKey||n.ctrlKey||n.key==="Control"||n.key==="Shift"||n.key==="Meta")}function to(n){un=!0,jp(n)&&(dr="keyboard",$a("keyboard",n))}function nt(n){dr="pointer",(n.type==="mousedown"||n.type==="pointerdown")&&(un=!0,$a("pointer",n))}function Dl(n){$p(n)&&(un=!0,dr="virtual")}function Sl(n){n.target===window||n.target===document||Yp||!n.isTrusted||(!un&&!Fa&&(dr="virtual",$a("virtual",n)),un=!1,Fa=!1)}function kl(){un=!1,Fa=!0}function Aa(n){if(typeof window>"u"||fr.get(ln(n)))return;const r=ln(n),e=Ut(n);let t=r.HTMLElement.prototype.focus;r.HTMLElement.prototype.focus=function(){un=!0,t.apply(this,arguments)},e.addEventListener("keydown",to,!0),e.addEventListener("keyup",to,!0),e.addEventListener("click",Dl,!0),r.addEventListener("focus",Sl,!0),r.addEventListener("blur",kl,!1),typeof PointerEvent<"u"?(e.addEventListener("pointerdown",nt,!0),e.addEventListener("pointermove",nt,!0),e.addEventListener("pointerup",nt,!0)):process.env.NODE_ENV==="test"&&(e.addEventListener("mousedown",nt,!0),e.addEventListener("mousemove",nt,!0),e.addEventListener("mouseup",nt,!0)),r.addEventListener("beforeunload",()=>{_l(n)},{once:!0}),fr.set(r,{focus:t})}const _l=(n,r)=>{const e=ln(n),t=Ut(n);r&&t.removeEventListener("DOMContentLoaded",r),fr.has(e)&&(e.HTMLElement.prototype.focus=fr.get(e).focus,t.removeEventListener("keydown",to,!0),t.removeEventListener("keyup",to,!0),t.removeEventListener("click",Dl,!0),e.removeEventListener("focus",Sl,!0),e.removeEventListener("blur",kl,!1),typeof PointerEvent<"u"?(t.removeEventListener("pointerdown",nt,!0),t.removeEventListener("pointermove",nt,!0),t.removeEventListener("pointerup",nt,!0)):process.env.NODE_ENV==="test"&&(t.removeEventListener("mousedown",nt,!0),t.removeEventListener("mousemove",nt,!0),t.removeEventListener("mouseup",nt,!0)),fr.delete(e))};function Wp(n){const r=Ut(n);let e;return r.readyState!=="loading"?Aa(n):(e=()=>{Aa(n)},r.addEventListener("DOMContentLoaded",e)),()=>_l(n,e)}typeof document<"u"&&Wp();function Cl(){return dr!=="pointer"}const Hp=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function Bp(n,r,e){let t=Ut(e==null?void 0:e.target);const o=typeof window<"u"?ln(e==null?void 0:e.target).HTMLInputElement:HTMLInputElement,a=typeof window<"u"?ln(e==null?void 0:e.target).HTMLTextAreaElement:HTMLTextAreaElement,i=typeof window<"u"?ln(e==null?void 0:e.target).HTMLElement:HTMLElement,s=typeof window<"u"?ln(e==null?void 0:e.target).KeyboardEvent:KeyboardEvent;return n=n||t.activeElement instanceof o&&!Hp.has(t.activeElement.type)||t.activeElement instanceof a||t.activeElement instanceof i&&t.activeElement.isContentEditable,!(n&&r==="keyboard"&&e instanceof s&&!Rp[e.key])}function Vp(n,r,e){Aa(),d.useEffect(()=>{let t=(o,a)=>{Bp(!!(e!=null&&e.isTextInput),o,a)&&n(Cl())};return La.add(t),()=>{La.delete(t)}},r)}function zp(n){let{isDisabled:r,onFocus:e,onBlur:t,onFocusChange:o}=n;const a=d.useCallback(l=>{if(l.target===l.currentTarget)return t&&t(l),o&&o(!1),!0},[t,o]),i=El(a),s=d.useCallback(l=>{const u=Ut(l.target),c=u?Pa(u):Pa();l.target===l.currentTarget&&c===yl(l.nativeEvent)&&(e&&e(l),o&&o(!0),i(l))},[o,e,i]);return{focusProps:{onFocus:!r&&(e||o||t)?s:void 0,onBlur:!r&&(t||o)?a:void 0}}}function qp(n){let{isDisabled:r,onBlurWithin:e,onFocusWithin:t,onFocusWithinChange:o}=n,a=d.useRef({isFocusWithin:!1}),{addGlobalListener:i,removeAllGlobalListeners:s}=wl(),l=d.useCallback(f=>{f.currentTarget.contains(f.target)&&a.current.isFocusWithin&&!f.currentTarget.contains(f.relatedTarget)&&(a.current.isFocusWithin=!1,s(),e&&e(f),o&&o(!1))},[e,o,a,s]),u=El(l),c=d.useCallback(f=>{if(!f.currentTarget.contains(f.target))return;const h=Ut(f.target),p=Pa(h);if(!a.current.isFocusWithin&&p===yl(f.nativeEvent)){t&&t(f),o&&o(!0),a.current.isFocusWithin=!0,u(f);let m=f.currentTarget;i(h,"focus",v=>{if(a.current.isFocusWithin&&!bl(m,v.target)){let g=new h.defaultView.FocusEvent("blur",{relatedTarget:v.target});Ap(g,m);let x=xl(g);l(x)}},{capture:!0})}},[t,o,u,i,l]);return r?{focusWithinProps:{onFocus:void 0,onBlur:void 0}}:{focusWithinProps:{onFocus:c,onBlur:l}}}let no=!1,Ya=0;function Ra(){no=!0,setTimeout(()=>{no=!1},50)}function Ol(n){n.pointerType==="touch"&&Ra()}function Up(){if(!(typeof document>"u"))return typeof PointerEvent<"u"?document.addEventListener("pointerup",Ol):process.env.NODE_ENV==="test"&&document.addEventListener("touchend",Ra),Ya++,()=>{Ya--,!(Ya>0)&&(typeof PointerEvent<"u"?document.removeEventListener("pointerup",Ol):process.env.NODE_ENV==="test"&&document.removeEventListener("touchend",Ra))}}function ja(n){let{onHoverStart:r,onHoverChange:e,onHoverEnd:t,isDisabled:o}=n,[a,i]=d.useState(!1),s=d.useRef({isHovered:!1,ignoreEmulatedMouseEvents:!1,pointerType:"",target:null}).current;d.useEffect(Up,[]);let{addGlobalListener:l,removeAllGlobalListeners:u}=wl(),{hoverProps:c,triggerHoverEnd:f}=d.useMemo(()=>{let h=(v,g)=>{if(s.pointerType=g,o||g==="touch"||s.isHovered||!v.currentTarget.contains(v.target))return;s.isHovered=!0;let x=v.currentTarget;s.target=x,l(Ut(v.target),"pointerover",E=>{s.isHovered&&s.target&&!bl(s.target,E.target)&&p(E,E.pointerType)},{capture:!0}),r&&r({type:"hoverstart",target:x,pointerType:g}),e&&e(!0),i(!0)},p=(v,g)=>{let x=s.target;s.pointerType="",s.target=null,!(g==="touch"||!s.isHovered||!x)&&(s.isHovered=!1,u(),t&&t({type:"hoverend",target:x,pointerType:g}),e&&e(!1),i(!1))},m={};return typeof PointerEvent<"u"?(m.onPointerEnter=v=>{no&&v.pointerType==="mouse"||h(v,v.pointerType)},m.onPointerLeave=v=>{!o&&v.currentTarget.contains(v.target)&&p(v,v.pointerType)}):process.env.NODE_ENV==="test"&&(m.onTouchStart=()=>{s.ignoreEmulatedMouseEvents=!0},m.onMouseEnter=v=>{!s.ignoreEmulatedMouseEvents&&!no&&h(v,"mouse"),s.ignoreEmulatedMouseEvents=!1},m.onMouseLeave=v=>{!o&&v.currentTarget.contains(v.target)&&p(v,"mouse")}),{hoverProps:m,triggerHoverEnd:p}},[r,e,t,o,s,l,u]);return d.useEffect(()=>{o&&f({currentTarget:s.target},s.pointerType)},[o]),{hoverProps:c,isHovered:a}}function Wa(n={}){let{autoFocus:r=!1,isTextInput:e,within:t}=n,o=d.useRef({isFocused:!1,isFocusVisible:r||Cl()}),[a,i]=d.useState(!1),[s,l]=d.useState(()=>o.current.isFocused&&o.current.isFocusVisible),u=d.useCallback(()=>l(o.current.isFocused&&o.current.isFocusVisible),[]),c=d.useCallback(p=>{o.current.isFocused=p,i(p),u()},[u]);Vp(p=>{o.current.isFocusVisible=p,u()},[],{isTextInput:e});let{focusProps:f}=zp({isDisabled:t,onFocusChange:c}),{focusWithinProps:h}=qp({isDisabled:!t,onFocusWithinChange:c});return{isFocused:a,isFocusVisible:s,focusProps:t?h:f}}var Qp=Object.defineProperty,Gp=(n,r,e)=>r in n?Qp(n,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[r]=e,Ha=(n,r,e)=>(Gp(n,typeof r!="symbol"?r+"":r,e),e);let Kp=class{constructor(){Ha(this,"current",this.detect()),Ha(this,"handoffState","pending"),Ha(this,"currentId",0)}set(r){this.current!==r&&(this.handoffState="pending",this.currentId=0,this.current=r)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return this.current==="server"}get isClient(){return this.current==="client"}detect(){return typeof window>"u"||typeof document>"u"?"server":"client"}handoff(){this.handoffState==="pending"&&(this.handoffState="complete")}get isHandoffComplete(){return this.handoffState==="complete"}},cn=new Kp;function dn(n){var r,e;return cn.isServer?null:n?"ownerDocument"in n?n.ownerDocument:"current"in n?(e=(r=n.current)==null?void 0:r.ownerDocument)!=null?e:document:null:document}function ro(n){typeof queueMicrotask=="function"?queueMicrotask(n):Promise.resolve().then(n).catch(r=>setTimeout(()=>{throw r}))}function rt(){let n=[],r={addEventListener(e,t,o,a){return e.addEventListener(t,o,a),r.add(()=>e.removeEventListener(t,o,a))},requestAnimationFrame(...e){let t=requestAnimationFrame(...e);return r.add(()=>cancelAnimationFrame(t))},nextFrame(...e){return r.requestAnimationFrame(()=>r.requestAnimationFrame(...e))},setTimeout(...e){let t=setTimeout(...e);return r.add(()=>clearTimeout(t))},microTask(...e){let t={current:!0};return ro(()=>{t.current&&e[0]()}),r.add(()=>{t.current=!1})},style(e,t,o){let a=e.style.getPropertyValue(t);return Object.assign(e.style,{[t]:o}),this.add(()=>{Object.assign(e.style,{[t]:a})})},group(e){let t=rt();return e(t),this.add(()=>t.dispose())},add(e){return n.includes(e)||n.push(e),()=>{let t=n.indexOf(e);if(t>=0)for(let o of n.splice(t,1))o()}},dispose(){for(let e of n.splice(0))e()}};return r}function Qt(){let[n]=d.useState(rt);return d.useEffect(()=>()=>n.dispose(),[n]),n}let fe=(n,r)=>{cn.isServer?d.useEffect(n,r):d.useLayoutEffect(n,r)};function Pt(n){let r=d.useRef(n);return fe(()=>{r.current=n},[n]),r}let ee=function(n){let r=Pt(n);return d.useCallback((...e)=>r.current(...e),[r])};function Xp(n){let r=n.width/2,e=n.height/2;return{top:n.clientY-e,right:n.clientX+r,bottom:n.clientY+e,left:n.clientX-r}}function Jp(n,r){return!(!n||!r||n.right<r.left||n.left>r.right||n.bottom<r.top||n.top>r.bottom)}function Ml({disabled:n=!1}={}){let r=d.useRef(null),[e,t]=d.useState(!1),o=Qt(),a=ee(()=>{r.current=null,t(!1),o.dispose()}),i=ee(s=>{if(o.dispose(),r.current===null){r.current=s.currentTarget,t(!0);{let l=dn(s.currentTarget);o.addEventListener(l,"pointerup",a,!1),o.addEventListener(l,"pointermove",u=>{if(r.current){let c=Xp(u);t(Jp(c,r.current.getBoundingClientRect()))}},!1),o.addEventListener(l,"pointercancel",a,!1)}}});return{pressed:e,pressProps:n?{}:{onPointerDown:i,onPointerUp:a,onClick:a}}}let Zp=d.createContext(void 0);function oo(){return d.useContext(Zp)}function Ba(...n){return Array.from(new Set(n.flatMap(r=>typeof r=="string"?r.split(" "):[]))).filter(Boolean).join(" ")}function Le(n,r,...e){if(n in r){let o=r[n];return typeof o=="function"?o(...e):o}let t=new Error(`Tried to handle "${n}" but there is no handler defined. Only defined handlers are: ${Object.keys(r).map(o=>`"${o}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,Le),t}var Gt=(n=>(n[n.None=0]="None",n[n.RenderStrategy=1]="RenderStrategy",n[n.Static=2]="Static",n))(Gt||{}),Kt=(n=>(n[n.Unmount=0]="Unmount",n[n.Hidden=1]="Hidden",n))(Kt||{});function Me(){let n=th();return d.useCallback(r=>eh({mergeRefs:n,...r}),[n])}function eh({ourProps:n,theirProps:r,slot:e,defaultTag:t,features:o,visible:a=!0,name:i,mergeRefs:s}){s=s??nh;let l=Tl(r,n);if(a)return ao(l,e,t,i,s);let u=o??0;if(u&2){let{static:c=!1,...f}=l;if(c)return ao(f,e,t,i,s)}if(u&1){let{unmount:c=!0,...f}=l;return Le(c?0:1,{0(){return null},1(){return ao({...f,hidden:!0,style:{display:"none"}},e,t,i,s)}})}return ao(l,e,t,i,s)}function ao(n,r={},e,t,o){let{as:a=e,children:i,refName:s="ref",...l}=Va(n,["unmount","static"]),u=n.ref!==void 0?{[s]:n.ref}:{},c=typeof i=="function"?i(r):i;"className"in l&&l.className&&typeof l.className=="function"&&(l.className=l.className(r)),l["aria-labelledby"]&&l["aria-labelledby"]===l.id&&(l["aria-labelledby"]=void 0);let f={};if(r){let h=!1,p=[];for(let[m,v]of Object.entries(r))typeof v=="boolean"&&(h=!0),v===!0&&p.push(m.replace(/([A-Z])/g,g=>`-${g.toLowerCase()}`));if(h){f["data-headlessui-state"]=p.join(" ");for(let m of p)f[`data-${m}`]=""}}if(a===d.Fragment&&(Object.keys(Xt(l)).length>0||Object.keys(Xt(f)).length>0))if(!d.isValidElement(c)||Array.isArray(c)&&c.length>1){if(Object.keys(Xt(l)).length>0)throw new Error(['Passing props on "Fragment"!',"",`The current component <${t} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(Xt(l)).concat(Object.keys(Xt(f))).map(h=>` - ${h}`).join(`
53
+ We are expecting a valid React Element`));var Jn,oa=!0;return ra===G&&(oa=!1,L&&(Jn=b.setActiveSlide,zt.overflowY="hidden")),u.createElement("div",{ref:Jn,style:zt,className:Q,"aria-hidden":oa,"data-swipeable":"true"},Wr)}))))}}]),O}(u.Component);$.displayName="ReactSwipableView",$.propTypes=process.env.NODE_ENV!=="production"?{action:c.default.func,animateHeight:c.default.bool,animateTransitions:c.default.bool,axis:c.default.oneOf(["x","x-reverse","y","y-reverse"]),children:c.default.node.isRequired,containerStyle:c.default.object,disabled:c.default.bool,disableLazyLoading:c.default.bool,enableMouseEvents:c.default.bool,hysteresis:c.default.number,ignoreNativeScroll:c.default.bool,index:c.default.number,onChangeIndex:c.default.func,onMouseDown:c.default.func,onMouseLeave:c.default.func,onMouseMove:c.default.func,onMouseUp:c.default.func,onScroll:c.default.func,onSwitching:c.default.func,onTouchEnd:c.default.func,onTouchMove:c.default.func,onTouchStart:c.default.func,onTransitionEnd:c.default.func,resistance:c.default.bool,slideClassName:c.default.string,slideStyle:c.default.object,springConfig:c.default.shape({delay:c.default.string,duration:c.default.string,easeFunction:c.default.string}),style:c.default.object,threshold:c.default.number}:{},$.defaultProps={animateHeight:!1,animateTransitions:!0,axis:"x",disabled:!1,disableLazyLoading:!1,enableMouseEvents:!1,hysteresis:.6,ignoreNativeScroll:!1,index:0,threshold:5,springConfig:{duration:"0.35s",easeFunction:"cubic-bezier(0.15, 0.3, 0.25, 1)",delay:"0s"},resistance:!1};var _=$;return Mt.default=_,Mt}var vl;function xp(){return vl||(vl=1,function(n){var r=Fs();Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"default",{enumerable:!0,get:function(){return e.default}}),Object.defineProperty(n,"SwipeableViewsContext",{enumerable:!0,get:function(){return e.SwipeableViewsContext}});var e=r(wp())}(da)),da}var Ep=xp();const Dp=pf(Ep),Sp=({className:n,tabList:r,isCuratedcontent:e,unswipeableContent:t,defaultIndex:o=0,onTabChange:a,disabled:i,allowScrollToSection:s=!0})=>{const[l,u]=d.useState(o),c=d.useRef(null),f=m=>{m.current&&window.scrollTo({top:m.current.offsetTop-50,behavior:"smooth"})},h=m=>{u(m),s&&f(c),a==null||a(m)},p=()=>{const v=100/r.length;return{width:`${v}%`,left:`${l*v}%`}};return Y.jsxs("div",{ref:c,className:"w-full",children:[Y.jsxs("div",{className:Ze(n==null?void 0:n.tab,`z-50 mb-[20px] flex w-full flex-col bg-white ${e&&"sticky top-[50px]"}`),children:[Y.jsx("div",{className:"flex",children:r.map((m,v)=>Y.jsx("div",{className:"flex flex-1 flex-col",children:Y.jsx("button",{className:Ze(n==null?void 0:n.tabTitle,`cursor-pointer ${l===v?"text-petnow-grey-30 text-label-large":"text-petnow-grey-70 text-body-large disabled:opacity-40"}`),onClick:()=>h(v),disabled:i,children:m.displayName})},m.key))}),Y.jsx("div",{className:Ze(n==null?void 0:n.underline,`relative h-[2px] w-full ${i?"bg-petnow-grey-70/40":"bg-petnow-grey-70"}`),children:Y.jsx("div",{className:Ze(n==null?void 0:n.selectedUnderline,"bg-petnow-grey-30 absolute h-[2px] transition-all duration-200"),style:p()})})]}),t,Y.jsx(Dp,{index:l,onChangeIndex:m=>{u(m),a==null||a(m)},disabled:i,children:r.map(m=>Y.jsx("div",{children:m.content},m.key))})]})},kp=({className:n,id:r,onChange:e,disabled:t,isChecked:o})=>Y.jsxs("label",{className:"relative flex h-min w-min cursor-pointer items-center rounded-full",htmlFor:r,children:[Y.jsx("input",{type:"checkbox",disabled:t,className:Ze(n,"before:content[''] peer bg-petnow-grey-primary checked:border-petnow-orange-primary checked:bg-petnow-orange-primary checked:before:bg-petnow-orange-primary border-petnow-grey-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-6 before:w-6 before:-translate-x-2/4 before:-translate-y-2/4 before:rounded-full before:opacity-0 before:transition-opacity"),id:r,checked:o,onChange:a=>{e(a.target.checked)}}),Y.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:Y.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:Y.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"})})})]}),_p=({className:n,text:r,isSelected:e,onClick:t,disabled:o})=>Y.jsx("button",{className:Ze(n,`keen-slider__slide text-body-medium rounded-full border-1 px-[12px] py-[6px] whitespace-nowrap ${e?"border-petnow-orange-primary bg-petnow-orange-secondary text-petnow-orange-primary":"border-petnow-grey-90 disabled:opacity-40"}`),onClick:t,style:{width:"min-content",minWidth:"fit-content"},disabled:o,children:r}),gl=typeof document<"u"?d.useLayoutEffect:()=>{};function Cp(n){const r=d.useRef(null);return gl(()=>{r.current=n},[n]),d.useCallback((...e)=>{const t=r.current;return t==null?void 0:t(...e)},[])}const Ut=n=>{var r;return(r=n==null?void 0:n.ownerDocument)!==null&&r!==void 0?r:document},ln=n=>n&&"window"in n&&n.window===n?n:Ut(n).defaultView||window;function Op(n){return n!==null&&typeof n=="object"&&"nodeType"in n&&typeof n.nodeType=="number"}function Mp(n){return Op(n)&&n.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&"host"in n}let Tp=!1;function Ta(){return Tp}function bl(n,r){if(!Ta())return r&&n?n.contains(r):!1;if(!n||!r)return!1;let e=r;for(;e!==null;){if(e===n)return!0;e.tagName==="SLOT"&&e.assignedSlot?e=e.assignedSlot.parentNode:Mp(e)?e=e.host:e=e.parentNode}return!1}const Pa=(n=document)=>{var r;if(!Ta())return n.activeElement;let e=n.activeElement;for(;e&&"shadowRoot"in e&&(!((r=e.shadowRoot)===null||r===void 0)&&r.activeElement);)e=e.shadowRoot.activeElement;return e};function yl(n){return Ta()&&n.target.shadowRoot&&n.composedPath?n.composedPath()[0]:n.target}function eo(n){var r;return typeof window>"u"||window.navigator==null?!1:((r=window.navigator.userAgentData)===null||r===void 0?void 0:r.brands.some(e=>n.test(e.brand)))||n.test(window.navigator.userAgent)}function Ia(n){var r;return typeof window<"u"&&window.navigator!=null?n.test(((r=window.navigator.userAgentData)===null||r===void 0?void 0:r.platform)||window.navigator.platform):!1}function Tt(n){if(process.env.NODE_ENV==="test")return n;let r=null;return()=>(r==null&&(r=n()),r)}const Na=Tt(function(){return Ia(/^Mac/i)}),Pp=Tt(function(){return Ia(/^iPhone/i)}),Ip=Tt(function(){return Ia(/^iPad/i)||Na()&&navigator.maxTouchPoints>1}),Np=Tt(function(){return Pp()||Ip()});Tt(function(){return Na()||Np()}),Tt(function(){return eo(/AppleWebKit/i)&&!Lp()});const Lp=Tt(function(){return eo(/Chrome/i)}),Fp=Tt(function(){return eo(/Android/i)});Tt(function(){return eo(/Firefox/i)});function wl(){let n=d.useRef(new Map),r=d.useCallback((o,a,i,s)=>{let l=s!=null&&s.once?(...u)=>{n.current.delete(i),i(...u)}:i;n.current.set(i,{type:a,eventTarget:o,fn:l,options:s}),o.addEventListener(a,l,s)},[]),e=d.useCallback((o,a,i,s)=>{var l;let u=((l=n.current.get(i))===null||l===void 0?void 0:l.fn)||i;o.removeEventListener(a,u,s),n.current.delete(i)},[]),t=d.useCallback(()=>{n.current.forEach((o,a)=>{e(o.eventTarget,o.type,a,o.options)})},[e]);return d.useEffect(()=>t,[t]),{addGlobalListener:r,removeGlobalListener:e,removeAllGlobalListeners:t}}function $p(n){return n.mozInputSource===0&&n.isTrusted?!0:Fp()&&n.pointerType?n.type==="click"&&n.buttons===1:n.detail===0&&!n.pointerType}function xl(n){let r=n;return r.nativeEvent=n,r.isDefaultPrevented=()=>r.defaultPrevented,r.isPropagationStopped=()=>r.cancelBubble,r.persist=()=>{},r}function Ap(n,r){Object.defineProperty(n,"target",{value:r}),Object.defineProperty(n,"currentTarget",{value:r})}function El(n){let r=d.useRef({isFocused:!1,observer:null});gl(()=>{const t=r.current;return()=>{t.observer&&(t.observer.disconnect(),t.observer=null)}},[]);let e=Cp(t=>{n==null||n(t)});return d.useCallback(t=>{if(t.target instanceof HTMLButtonElement||t.target instanceof HTMLInputElement||t.target instanceof HTMLTextAreaElement||t.target instanceof HTMLSelectElement){r.current.isFocused=!0;let o=t.target,a=i=>{if(r.current.isFocused=!1,o.disabled){let s=xl(i);e(s)}r.current.observer&&(r.current.observer.disconnect(),r.current.observer=null)};o.addEventListener("focusout",a,{once:!0}),r.current.observer=new MutationObserver(()=>{if(r.current.isFocused&&o.disabled){var i;(i=r.current.observer)===null||i===void 0||i.disconnect();let s=o===document.activeElement?null:document.activeElement;o.dispatchEvent(new FocusEvent("blur",{relatedTarget:s})),o.dispatchEvent(new FocusEvent("focusout",{bubbles:!0,relatedTarget:s}))}}),r.current.observer.observe(o,{attributes:!0,attributeFilter:["disabled"]})}},[e])}let Yp=!1,dr=null,La=new Set,fr=new Map,un=!1,Fa=!1;const Rp={Tab:!0,Escape:!0};function $a(n,r){for(let e of La)e(n,r)}function jp(n){return!(n.metaKey||!Na()&&n.altKey||n.ctrlKey||n.key==="Control"||n.key==="Shift"||n.key==="Meta")}function to(n){un=!0,jp(n)&&(dr="keyboard",$a("keyboard",n))}function nt(n){dr="pointer",(n.type==="mousedown"||n.type==="pointerdown")&&(un=!0,$a("pointer",n))}function Dl(n){$p(n)&&(un=!0,dr="virtual")}function Sl(n){n.target===window||n.target===document||Yp||!n.isTrusted||(!un&&!Fa&&(dr="virtual",$a("virtual",n)),un=!1,Fa=!1)}function kl(){un=!1,Fa=!0}function Aa(n){if(typeof window>"u"||fr.get(ln(n)))return;const r=ln(n),e=Ut(n);let t=r.HTMLElement.prototype.focus;r.HTMLElement.prototype.focus=function(){un=!0,t.apply(this,arguments)},e.addEventListener("keydown",to,!0),e.addEventListener("keyup",to,!0),e.addEventListener("click",Dl,!0),r.addEventListener("focus",Sl,!0),r.addEventListener("blur",kl,!1),typeof PointerEvent<"u"?(e.addEventListener("pointerdown",nt,!0),e.addEventListener("pointermove",nt,!0),e.addEventListener("pointerup",nt,!0)):process.env.NODE_ENV==="test"&&(e.addEventListener("mousedown",nt,!0),e.addEventListener("mousemove",nt,!0),e.addEventListener("mouseup",nt,!0)),r.addEventListener("beforeunload",()=>{_l(n)},{once:!0}),fr.set(r,{focus:t})}const _l=(n,r)=>{const e=ln(n),t=Ut(n);r&&t.removeEventListener("DOMContentLoaded",r),fr.has(e)&&(e.HTMLElement.prototype.focus=fr.get(e).focus,t.removeEventListener("keydown",to,!0),t.removeEventListener("keyup",to,!0),t.removeEventListener("click",Dl,!0),e.removeEventListener("focus",Sl,!0),e.removeEventListener("blur",kl,!1),typeof PointerEvent<"u"?(t.removeEventListener("pointerdown",nt,!0),t.removeEventListener("pointermove",nt,!0),t.removeEventListener("pointerup",nt,!0)):process.env.NODE_ENV==="test"&&(t.removeEventListener("mousedown",nt,!0),t.removeEventListener("mousemove",nt,!0),t.removeEventListener("mouseup",nt,!0)),fr.delete(e))};function Wp(n){const r=Ut(n);let e;return r.readyState!=="loading"?Aa(n):(e=()=>{Aa(n)},r.addEventListener("DOMContentLoaded",e)),()=>_l(n,e)}typeof document<"u"&&Wp();function Cl(){return dr!=="pointer"}const Hp=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function Bp(n,r,e){let t=Ut(e==null?void 0:e.target);const o=typeof window<"u"?ln(e==null?void 0:e.target).HTMLInputElement:HTMLInputElement,a=typeof window<"u"?ln(e==null?void 0:e.target).HTMLTextAreaElement:HTMLTextAreaElement,i=typeof window<"u"?ln(e==null?void 0:e.target).HTMLElement:HTMLElement,s=typeof window<"u"?ln(e==null?void 0:e.target).KeyboardEvent:KeyboardEvent;return n=n||t.activeElement instanceof o&&!Hp.has(t.activeElement.type)||t.activeElement instanceof a||t.activeElement instanceof i&&t.activeElement.isContentEditable,!(n&&r==="keyboard"&&e instanceof s&&!Rp[e.key])}function Vp(n,r,e){Aa(),d.useEffect(()=>{let t=(o,a)=>{Bp(!!(e!=null&&e.isTextInput),o,a)&&n(Cl())};return La.add(t),()=>{La.delete(t)}},r)}function zp(n){let{isDisabled:r,onFocus:e,onBlur:t,onFocusChange:o}=n;const a=d.useCallback(l=>{if(l.target===l.currentTarget)return t&&t(l),o&&o(!1),!0},[t,o]),i=El(a),s=d.useCallback(l=>{const u=Ut(l.target),c=u?Pa(u):Pa();l.target===l.currentTarget&&c===yl(l.nativeEvent)&&(e&&e(l),o&&o(!0),i(l))},[o,e,i]);return{focusProps:{onFocus:!r&&(e||o||t)?s:void 0,onBlur:!r&&(t||o)?a:void 0}}}function qp(n){let{isDisabled:r,onBlurWithin:e,onFocusWithin:t,onFocusWithinChange:o}=n,a=d.useRef({isFocusWithin:!1}),{addGlobalListener:i,removeAllGlobalListeners:s}=wl(),l=d.useCallback(f=>{f.currentTarget.contains(f.target)&&a.current.isFocusWithin&&!f.currentTarget.contains(f.relatedTarget)&&(a.current.isFocusWithin=!1,s(),e&&e(f),o&&o(!1))},[e,o,a,s]),u=El(l),c=d.useCallback(f=>{if(!f.currentTarget.contains(f.target))return;const h=Ut(f.target),p=Pa(h);if(!a.current.isFocusWithin&&p===yl(f.nativeEvent)){t&&t(f),o&&o(!0),a.current.isFocusWithin=!0,u(f);let m=f.currentTarget;i(h,"focus",v=>{if(a.current.isFocusWithin&&!bl(m,v.target)){let g=new h.defaultView.FocusEvent("blur",{relatedTarget:v.target});Ap(g,m);let x=xl(g);l(x)}},{capture:!0})}},[t,o,u,i,l]);return r?{focusWithinProps:{onFocus:void 0,onBlur:void 0}}:{focusWithinProps:{onFocus:c,onBlur:l}}}let no=!1,Ya=0;function Ra(){no=!0,setTimeout(()=>{no=!1},50)}function Ol(n){n.pointerType==="touch"&&Ra()}function Up(){if(!(typeof document>"u"))return typeof PointerEvent<"u"?document.addEventListener("pointerup",Ol):process.env.NODE_ENV==="test"&&document.addEventListener("touchend",Ra),Ya++,()=>{Ya--,!(Ya>0)&&(typeof PointerEvent<"u"?document.removeEventListener("pointerup",Ol):process.env.NODE_ENV==="test"&&document.removeEventListener("touchend",Ra))}}function ja(n){let{onHoverStart:r,onHoverChange:e,onHoverEnd:t,isDisabled:o}=n,[a,i]=d.useState(!1),s=d.useRef({isHovered:!1,ignoreEmulatedMouseEvents:!1,pointerType:"",target:null}).current;d.useEffect(Up,[]);let{addGlobalListener:l,removeAllGlobalListeners:u}=wl(),{hoverProps:c,triggerHoverEnd:f}=d.useMemo(()=>{let h=(v,g)=>{if(s.pointerType=g,o||g==="touch"||s.isHovered||!v.currentTarget.contains(v.target))return;s.isHovered=!0;let x=v.currentTarget;s.target=x,l(Ut(v.target),"pointerover",E=>{s.isHovered&&s.target&&!bl(s.target,E.target)&&p(E,E.pointerType)},{capture:!0}),r&&r({type:"hoverstart",target:x,pointerType:g}),e&&e(!0),i(!0)},p=(v,g)=>{let x=s.target;s.pointerType="",s.target=null,!(g==="touch"||!s.isHovered||!x)&&(s.isHovered=!1,u(),t&&t({type:"hoverend",target:x,pointerType:g}),e&&e(!1),i(!1))},m={};return typeof PointerEvent<"u"?(m.onPointerEnter=v=>{no&&v.pointerType==="mouse"||h(v,v.pointerType)},m.onPointerLeave=v=>{!o&&v.currentTarget.contains(v.target)&&p(v,v.pointerType)}):process.env.NODE_ENV==="test"&&(m.onTouchStart=()=>{s.ignoreEmulatedMouseEvents=!0},m.onMouseEnter=v=>{!s.ignoreEmulatedMouseEvents&&!no&&h(v,"mouse"),s.ignoreEmulatedMouseEvents=!1},m.onMouseLeave=v=>{!o&&v.currentTarget.contains(v.target)&&p(v,"mouse")}),{hoverProps:m,triggerHoverEnd:p}},[r,e,t,o,s,l,u]);return d.useEffect(()=>{o&&f({currentTarget:s.target},s.pointerType)},[o]),{hoverProps:c,isHovered:a}}function Wa(n={}){let{autoFocus:r=!1,isTextInput:e,within:t}=n,o=d.useRef({isFocused:!1,isFocusVisible:r||Cl()}),[a,i]=d.useState(!1),[s,l]=d.useState(()=>o.current.isFocused&&o.current.isFocusVisible),u=d.useCallback(()=>l(o.current.isFocused&&o.current.isFocusVisible),[]),c=d.useCallback(p=>{o.current.isFocused=p,i(p),u()},[u]);Vp(p=>{o.current.isFocusVisible=p,u()},[],{isTextInput:e});let{focusProps:f}=zp({isDisabled:t,onFocusChange:c}),{focusWithinProps:h}=qp({isDisabled:!t,onFocusWithinChange:c});return{isFocused:a,isFocusVisible:s,focusProps:t?h:f}}var Qp=Object.defineProperty,Gp=(n,r,e)=>r in n?Qp(n,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[r]=e,Ha=(n,r,e)=>(Gp(n,typeof r!="symbol"?r+"":r,e),e);let Kp=class{constructor(){Ha(this,"current",this.detect()),Ha(this,"handoffState","pending"),Ha(this,"currentId",0)}set(r){this.current!==r&&(this.handoffState="pending",this.currentId=0,this.current=r)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return this.current==="server"}get isClient(){return this.current==="client"}detect(){return typeof window>"u"||typeof document>"u"?"server":"client"}handoff(){this.handoffState==="pending"&&(this.handoffState="complete")}get isHandoffComplete(){return this.handoffState==="complete"}},cn=new Kp;function dn(n){var r,e;return cn.isServer?null:n?"ownerDocument"in n?n.ownerDocument:"current"in n?(e=(r=n.current)==null?void 0:r.ownerDocument)!=null?e:document:null:document}function ro(n){typeof queueMicrotask=="function"?queueMicrotask(n):Promise.resolve().then(n).catch(r=>setTimeout(()=>{throw r}))}function rt(){let n=[],r={addEventListener(e,t,o,a){return e.addEventListener(t,o,a),r.add(()=>e.removeEventListener(t,o,a))},requestAnimationFrame(...e){let t=requestAnimationFrame(...e);return r.add(()=>cancelAnimationFrame(t))},nextFrame(...e){return r.requestAnimationFrame(()=>r.requestAnimationFrame(...e))},setTimeout(...e){let t=setTimeout(...e);return r.add(()=>clearTimeout(t))},microTask(...e){let t={current:!0};return ro(()=>{t.current&&e[0]()}),r.add(()=>{t.current=!1})},style(e,t,o){let a=e.style.getPropertyValue(t);return Object.assign(e.style,{[t]:o}),this.add(()=>{Object.assign(e.style,{[t]:a})})},group(e){let t=rt();return e(t),this.add(()=>t.dispose())},add(e){return n.includes(e)||n.push(e),()=>{let t=n.indexOf(e);if(t>=0)for(let o of n.splice(t,1))o()}},dispose(){for(let e of n.splice(0))e()}};return r}function Qt(){let[n]=d.useState(rt);return d.useEffect(()=>()=>n.dispose(),[n]),n}let fe=(n,r)=>{cn.isServer?d.useEffect(n,r):d.useLayoutEffect(n,r)};function Pt(n){let r=d.useRef(n);return fe(()=>{r.current=n},[n]),r}let ee=function(n){let r=Pt(n);return d.useCallback((...e)=>r.current(...e),[r])};function Xp(n){let r=n.width/2,e=n.height/2;return{top:n.clientY-e,right:n.clientX+r,bottom:n.clientY+e,left:n.clientX-r}}function Jp(n,r){return!(!n||!r||n.right<r.left||n.left>r.right||n.bottom<r.top||n.top>r.bottom)}function Ml({disabled:n=!1}={}){let r=d.useRef(null),[e,t]=d.useState(!1),o=Qt(),a=ee(()=>{r.current=null,t(!1),o.dispose()}),i=ee(s=>{if(o.dispose(),r.current===null){r.current=s.currentTarget,t(!0);{let l=dn(s.currentTarget);o.addEventListener(l,"pointerup",a,!1),o.addEventListener(l,"pointermove",u=>{if(r.current){let c=Xp(u);t(Jp(c,r.current.getBoundingClientRect()))}},!1),o.addEventListener(l,"pointercancel",a,!1)}}});return{pressed:e,pressProps:n?{}:{onPointerDown:i,onPointerUp:a,onClick:a}}}let Zp=d.createContext(void 0);function oo(){return d.useContext(Zp)}function Ba(...n){return Array.from(new Set(n.flatMap(r=>typeof r=="string"?r.split(" "):[]))).filter(Boolean).join(" ")}function Le(n,r,...e){if(n in r){let o=r[n];return typeof o=="function"?o(...e):o}let t=new Error(`Tried to handle "${n}" but there is no handler defined. Only defined handlers are: ${Object.keys(r).map(o=>`"${o}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,Le),t}var Gt=(n=>(n[n.None=0]="None",n[n.RenderStrategy=1]="RenderStrategy",n[n.Static=2]="Static",n))(Gt||{}),Kt=(n=>(n[n.Unmount=0]="Unmount",n[n.Hidden=1]="Hidden",n))(Kt||{});function Me(){let n=th();return d.useCallback(r=>eh({mergeRefs:n,...r}),[n])}function eh({ourProps:n,theirProps:r,slot:e,defaultTag:t,features:o,visible:a=!0,name:i,mergeRefs:s}){s=s??nh;let l=Tl(r,n);if(a)return ao(l,e,t,i,s);let u=o??0;if(u&2){let{static:c=!1,...f}=l;if(c)return ao(f,e,t,i,s)}if(u&1){let{unmount:c=!0,...f}=l;return Le(c?0:1,{0(){return null},1(){return ao({...f,hidden:!0,style:{display:"none"}},e,t,i,s)}})}return ao(l,e,t,i,s)}function ao(n,r={},e,t,o){let{as:a=e,children:i,refName:s="ref",...l}=Va(n,["unmount","static"]),u=n.ref!==void 0?{[s]:n.ref}:{},c=typeof i=="function"?i(r):i;"className"in l&&l.className&&typeof l.className=="function"&&(l.className=l.className(r)),l["aria-labelledby"]&&l["aria-labelledby"]===l.id&&(l["aria-labelledby"]=void 0);let f={};if(r){let h=!1,p=[];for(let[m,v]of Object.entries(r))typeof v=="boolean"&&(h=!0),v===!0&&p.push(m.replace(/([A-Z])/g,g=>`-${g.toLowerCase()}`));if(h){f["data-headlessui-state"]=p.join(" ");for(let m of p)f[`data-${m}`]=""}}if(a===d.Fragment&&(Object.keys(Xt(l)).length>0||Object.keys(Xt(f)).length>0))if(!d.isValidElement(c)||Array.isArray(c)&&c.length>1){if(Object.keys(Xt(l)).length>0)throw new Error(['Passing props on "Fragment"!',"",`The current component <${t} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(Xt(l)).concat(Object.keys(Xt(f))).map(h=>` - ${h}`).join(`
54
54
  `),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".',"Render a single element as the child so that we can forward the props onto that element."].map(h=>` - ${h}`).join(`
55
55
  `)].join(`
56
56
  `))}else{let h=c.props,p=h==null?void 0:h.className,m=typeof p=="function"?(...x)=>Ba(p(...x),l.className):Ba(p,l.className),v=m?{className:m}:{},g=Tl(c.props,Xt(Va(l,["ref"])));for(let x in f)x in g&&delete f[x];return d.cloneElement(c,Object.assign({},g,f,u,{ref:o(rh(c),u.ref)},v))}return d.createElement(a,Object.assign({},Va(l,["ref"]),a!==d.Fragment&&u,a!==d.Fragment&&f),c)}function th(){let n=d.useRef([]),r=d.useCallback(e=>{for(let t of n.current)t!=null&&(typeof t=="function"?t(e):t.current=e)},[]);return(...e)=>{if(!e.every(t=>t==null))return n.current=e,r}}function nh(...n){return n.every(r=>r==null)?void 0:r=>{for(let e of n)e!=null&&(typeof e=="function"?e(r):e.current=r)}}function Tl(...n){if(n.length===0)return{};if(n.length===1)return n[0];let r={},e={};for(let t of n)for(let o in t)o.startsWith("on")&&typeof t[o]=="function"?(e[o]!=null||(e[o]=[]),e[o].push(t[o])):r[o]=t[o];if(r.disabled||r["aria-disabled"])for(let t in e)/^(on(?:Click|Pointer|Mouse|Key)(?:Down|Up|Press)?)$/.test(t)&&(e[t]=[o=>{var a;return(a=o==null?void 0:o.preventDefault)==null?void 0:a.call(o)}]);for(let t in e)Object.assign(r,{[t](o,...a){let i=e[t];for(let s of i){if((o instanceof Event||(o==null?void 0:o.nativeEvent)instanceof Event)&&o.defaultPrevented)return;s(o,...a)}}});return r}function pr(...n){if(n.length===0)return{};if(n.length===1)return n[0];let r={},e={};for(let t of n)for(let o in t)o.startsWith("on")&&typeof t[o]=="function"?(e[o]!=null||(e[o]=[]),e[o].push(t[o])):r[o]=t[o];for(let t in e)Object.assign(r,{[t](...o){let a=e[t];for(let i of a)i==null||i(...o)}});return r}function Ce(n){var r;return Object.assign(d.forwardRef(n),{displayName:(r=n.displayName)!=null?r:n.name})}function Xt(n){let r=Object.assign({},n);for(let e in r)r[e]===void 0&&delete r[e];return r}function Va(n,r=[]){let e=Object.assign({},n);for(let t of r)t in e&&delete e[t];return e}function rh(n){return d.version.split(".")[0]>="19"?n.props.ref:n.ref}function Pl(n,r,e){let[t,o]=d.useState(e),a=n!==void 0,i=d.useRef(a),s=d.useRef(!1),l=d.useRef(!1);return a&&!i.current&&!s.current?(s.current=!0,i.current=a,console.error("A component is changing from uncontrolled to controlled. This may be caused by the value changing from undefined to a defined value, which should not happen.")):!a&&i.current&&!l.current&&(l.current=!0,i.current=a,console.error("A component is changing from controlled to uncontrolled. This may be caused by the value changing from a defined value to undefined, which should not happen.")),[a?n:t,ee(u=>(a||o(u),r==null?void 0:r(u)))]}function Il(n){let[r]=d.useState(n);return r}function Nl(n={},r=null,e=[]){for(let[t,o]of Object.entries(n))Fl(e,Ll(r,t),o);return e}function Ll(n,r){return n?n+"["+r+"]":r}function Fl(n,r,e){if(Array.isArray(e))for(let[t,o]of e.entries())Fl(n,Ll(r,t.toString()),o);else e instanceof Date?n.push([r,e.toISOString()]):typeof e=="boolean"?n.push([r,e?"1":"0"]):typeof e=="string"?n.push([r,e]):typeof e=="number"?n.push([r,`${e}`]):e==null?n.push([r,""]):Nl(e,r,n)}function oh(n){var r,e;let t=(r=n==null?void 0:n.form)!=null?r:n.closest("form");if(t){for(let o of t.elements)if(o!==n&&(o.tagName==="INPUT"&&o.type==="submit"||o.tagName==="BUTTON"&&o.type==="submit"||o.nodeName==="INPUT"&&o.type==="image")){o.click();return}(e=t.requestSubmit)==null||e.call(t)}}let ah="span";var Tn=(n=>(n[n.None=1]="None",n[n.Focusable=2]="Focusable",n[n.Hidden=4]="Hidden",n))(Tn||{});function ih(n,r){var e;let{features:t=1,...o}=n,a={ref:r,"aria-hidden":(t&2)===2?!0:(e=o["aria-hidden"])!=null?e:void 0,hidden:(t&4)===4?!0:void 0,style:{position:"fixed",top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",...(t&4)===4&&(t&2)!==2&&{display:"none"}}};return Me()({ourProps:a,theirProps:o,slot:{},defaultTag:ah,name:"Hidden"})}let hr=Ce(ih),sh=d.createContext(null);function lh({children:n}){let r=d.useContext(sh);if(!r)return d.createElement(d.Fragment,null,n);let{target:e}=r;return e?Ne.createPortal(d.createElement(d.Fragment,null,n),e):null}function $l({data:n,form:r,disabled:e,onReset:t,overrides:o}){let[a,i]=d.useState(null),s=Qt();return d.useEffect(()=>{if(t&&a)return s.addEventListener(a,"reset",t)},[a,r,t]),d.createElement(lh,null,d.createElement(uh,{setForm:i,formId:r}),Nl(n).map(([l,u])=>d.createElement(hr,{features:Tn.Hidden,...Xt({key:l,as:"input",type:"hidden",hidden:!0,readOnly:!0,form:r,disabled:e,name:l,value:u,...o})})))}function uh({setForm:n,formId:r}){return d.useEffect(()=>{if(r){let e=document.getElementById(r);e&&n(e)}},[n,r]),r?null:d.createElement(hr,{features:Tn.Hidden,as:"input",type:"hidden",hidden:!0,readOnly:!0,ref:e=>{if(!e)return;let t=e.closest("form");t&&n(t)}})}let ch=d.createContext(void 0);function za(){return d.useContext(ch)}function qa(n){return typeof n!="object"||n===null?!1:"nodeType"in n}function It(n){return qa(n)&&"tagName"in n}function Ke(n){return It(n)&&"accessKey"in n}function Nt(n){return It(n)&&"tabIndex"in n}function dh(n){return It(n)&&"style"in n}function fh(n){return Ke(n)&&n.nodeName==="IFRAME"}function io(n){return Ke(n)&&n.nodeName==="INPUT"}function Al(n){return Ke(n)&&n.nodeName==="LABEL"}function ph(n){return Ke(n)&&n.nodeName==="FIELDSET"}function Yl(n){return Ke(n)&&n.nodeName==="LEGEND"}function hh(n){return It(n)?n.matches('a[href],audio[controls],button,details,embed,iframe,img[usemap],input:not([type="hidden"]),label,select,textarea,video[controls]'):!1}function Rl(n){let r=n.parentElement,e=null;for(;r&&!ph(r);)Yl(r)&&(e=r),r=r.parentElement;let t=(r==null?void 0:r.getAttribute("disabled"))==="";return t&&mh(e)?!1:t}function mh(n){if(!n)return!1;let r=n.previousElementSibling;for(;r!==null;){if(Yl(r))return!1;r=r.previousElementSibling}return!0}let jl=Symbol();function vh(n,r=!0){return Object.assign(n,{[jl]:r})}function Re(...n){let r=d.useRef(n);d.useEffect(()=>{r.current=n},[n]);let e=ee(t=>{for(let o of r.current)o!=null&&(typeof o=="function"?o(t):o.current=t)});return n.every(t=>t==null||(t==null?void 0:t[jl]))?void 0:e}let so=d.createContext(null);so.displayName="DescriptionContext";function Wl(){let n=d.useContext(so);if(n===null){let r=new Error("You used a <Description /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(r,Wl),r}return n}function Hl(){var n,r;return(r=(n=d.useContext(so))==null?void 0:n.value)!=null?r:void 0}function gh(){let[n,r]=d.useState([]);return[n.length>0?n.join(" "):void 0,d.useMemo(()=>function(e){let t=ee(a=>(r(i=>[...i,a]),()=>r(i=>{let s=i.slice(),l=s.indexOf(a);return l!==-1&&s.splice(l,1),s}))),o=d.useMemo(()=>({register:t,slot:e.slot,name:e.name,props:e.props,value:e.value}),[t,e.slot,e.name,e.props,e.value]);return d.createElement(so.Provider,{value:o},e.children)},[r])]}let bh="p";function yh(n,r){let e=d.useId(),t=oo(),{id:o=`headlessui-description-${e}`,...a}=n,i=Wl(),s=Re(r);fe(()=>i.register(o),[o,i.register]);let l=t||!1,u=d.useMemo(()=>({...i.slot,disabled:l}),[i.slot,l]),c={ref:s,...i.props,id:o};return Me()({ourProps:c,theirProps:a,slot:u,defaultTag:bh,name:i.name||"Description"})}let wh=Ce(yh),Bl=Object.assign(wh,{});var he=(n=>(n.Space=" ",n.Enter="Enter",n.Escape="Escape",n.Backspace="Backspace",n.Delete="Delete",n.ArrowLeft="ArrowLeft",n.ArrowUp="ArrowUp",n.ArrowRight="ArrowRight",n.ArrowDown="ArrowDown",n.Home="Home",n.End="End",n.PageUp="PageUp",n.PageDown="PageDown",n.Tab="Tab",n))(he||{});let lo=d.createContext(null);lo.displayName="LabelContext";function Vl(){let n=d.useContext(lo);if(n===null){let r=new Error("You used a <Label /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(r,Vl),r}return n}function mr(n){var r,e,t;let o=(e=(r=d.useContext(lo))==null?void 0:r.value)!=null?e:void 0;return((t=n==null?void 0:n.length)!=null?t:0)>0?[o,...n].filter(Boolean).join(" "):o}function zl({inherit:n=!1}={}){let r=mr(),[e,t]=d.useState([]),o=n?[r,...e].filter(Boolean):e;return[o.length>0?o.join(" "):void 0,d.useMemo(()=>function(a){let i=ee(l=>(t(u=>[...u,l]),()=>t(u=>{let c=u.slice(),f=c.indexOf(l);return f!==-1&&c.splice(f,1),c}))),s=d.useMemo(()=>({register:i,slot:a.slot,name:a.name,props:a.props,value:a.value}),[i,a.slot,a.name,a.props,a.value]);return d.createElement(lo.Provider,{value:s},a.children)},[t])]}let xh="label";function Eh(n,r){var e;let t=d.useId(),o=Vl(),a=za(),i=oo(),{id:s=`headlessui-label-${t}`,htmlFor:l=a??((e=o.props)==null?void 0:e.htmlFor),passive:u=!1,...c}=n,f=Re(r);fe(()=>o.register(s),[s,o.register]);let h=ee(g=>{let x=g.currentTarget;if(!(g.target!==g.currentTarget&&hh(g.target))&&(Al(x)&&g.preventDefault(),o.props&&"onClick"in o.props&&typeof o.props.onClick=="function"&&o.props.onClick(g),Al(x))){let E=document.getElementById(x.htmlFor);if(E){let w=E.getAttribute("disabled");if(w==="true"||w==="")return;let k=E.getAttribute("aria-disabled");if(k==="true"||k==="")return;(io(E)&&(E.type==="file"||E.type==="radio"||E.type==="checkbox")||E.role==="radio"||E.role==="checkbox"||E.role==="switch")&&E.click(),E.focus({preventScroll:!0})}}}),p=i||!1,m=d.useMemo(()=>({...o.slot,disabled:p}),[o.slot,p]),v={ref:f,...o.props,id:s,htmlFor:l,onClick:h};return u&&("onClick"in v&&(delete v.htmlFor,delete v.onClick),"onClick"in c&&delete c.onClick),Me()({ourProps:v,theirProps:c,slot:m,defaultTag:l?xh:"div",name:o.name||"Label"})}let Dh=Ce(Eh),uo=Object.assign(Dh,{}),Sh=d.createContext(()=>{});function kh({value:n,children:r}){return d.createElement(Sh.Provider,{value:n},r)}function Pn(n,r,e){let t=e.initialDeps??[],o;function a(){var i,s,l,u;let c;e.key&&((i=e.debug)!=null&&i.call(e))&&(c=Date.now());const f=n();if(!(f.length!==t.length||f.some((m,v)=>t[v]!==m)))return o;t=f;let p;if(e.key&&((s=e.debug)!=null&&s.call(e))&&(p=Date.now()),o=r(...f),e.key&&((l=e.debug)!=null&&l.call(e))){const m=Math.round((Date.now()-c)*100)/100,v=Math.round((Date.now()-p)*100)/100,g=v/16,x=(E,w)=>{for(E=String(E);E.length<w;)E=" "+E;return E};console.info(`%c⏱ ${x(v,5)} /${x(m,5)} ms`,`