(function(b,M){typeof exports=="object"&&typeof module<"u"?M(exports,require("react/jsx-runtime"),require("react")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react"],M):(b=typeof globalThis<"u"?globalThis:b||self,M(b.ReactStickyToParent={},b.jsxRuntime,b.React))})(this,function(b,M,p){"use strict";var ve=typeof global=="object"&&global&&global.Object===Object&&global,rt=typeof self=="object"&&self&&self.Object===Object&&self,j=ve||rt||Function("return this")(),z=j.Symbol,_e=Object.prototype,ot=_e.hasOwnProperty,it=_e.toString,U=z?z.toStringTag:void 0;function at(e){var t=ot.call(e,U),n=e[U];try{e[U]=void 0;var r=!0}catch{}var a=it.call(e);return r&&(t?e[U]=n:delete e[U]),a}var st=Object.prototype,ut=st.toString;function ct(e){return ut.call(e)}var ft="[object Null]",lt="[object Undefined]",ye=z?z.toStringTag:void 0;function N(e){return e==null?e===void 0?lt:ft:ye&&ye in Object(e)?at(e):ct(e)}function G(e){return e!=null&&typeof e=="object"}var W=Array.isArray;function we(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var dt="[object AsyncFunction]",pt="[object Function]",ht="[object GeneratorFunction]",gt="[object Proxy]";function Se(e){if(!we(e))return!1;var t=N(e);return t==pt||t==ht||t==dt||t==gt}var ee=j["__core-js_shared__"],Ee=function(){var e=/[^.]+$/.exec(ee&&ee.keys&&ee.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function vt(e){return!!Ee&&Ee in e}var _t=Function.prototype,yt=_t.toString;function F(e){if(e!=null){try{return yt.call(e)}catch{}try{return e+""}catch{}}return""}var wt=/[\\^$.*+?()[\]{}|]/g,St=/^\[object .+?Constructor\]$/,Et=Function.prototype,mt=Object.prototype,bt=Et.toString,Ot=mt.hasOwnProperty,Tt=RegExp("^"+bt.call(Ot).replace(wt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function At(e){if(!we(e)||vt(e))return!1;var t=Se(e)?Tt:St;return t.test(F(e))}function xt(e,t){return e==null?void 0:e[t]}function B(e,t){var n=xt(e,t);return At(n)?n:void 0}var te=B(j,"WeakMap"),jt=9007199254740991,Ct=/^(?:0|[1-9]\d*)$/;function Rt(e,t){var n=typeof e;return t=t??jt,!!t&&(n=="number"||n!="symbol"&&Ct.test(e))&&e>-1&&e%1==0&&e-1&&e%1==0&&e<=Pt}function Lt(e){return e!=null&&be(e.length)&&!Se(e)}var Ft=Object.prototype;function Dt(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||Ft;return e===n}function It(e,t){for(var n=-1,r=Array(e);++n-1}function Kn(e,t){var n=this.__data__,r=$(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function C(e){var t=-1,n=e==null?0:e.length;for(this.clear();++ts))return!1;var c=i.get(e),l=i.get(t);if(c&&l)return c==t&&l==e;var f=-1,d=!0,v=n&Er?new X:void 0;for(i.set(e,t),i.set(t,e);++f"u")){o=Z({},t,o),typeof o.expires=="number"&&(o.expires=new Date(Date.now()+o.expires*864e5)),o.expires&&(o.expires=o.expires.toUTCString()),a=encodeURIComponent(a).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var s="";for(var u in o)o[u]&&(s+="; "+u,o[u]!==!0&&(s+="="+o[u].split(";")[0]));return document.cookie=a+"="+e.write(i,a)+s}}function r(a){if(!(typeof document>"u"||arguments.length&&!a)){for(var i=document.cookie?document.cookie.split("; "):[],o={},s=0;s"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?c:s;return fe.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:l,fe}var le={};/** * @license React * use-sync-external-store-shim.development.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var Xe;function Jr(){return Xe||(Xe=1,process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var e=p,t=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function n(S){{for(var g=arguments.length,m=new Array(g>1?g-1:0),y=1;y{const t=p.useRef(e);return t.current=e,t};var Je,Ze;function pe(e){return typeof e=="function"}const Qe=process.env.NODE_ENV==="development"||process.env.NODE_ENV==="test",Q=typeof window<"u",Qr=typeof navigator<"u";Q&&(!((Ze=window)==null||(Je=Ze.navigator)==null)&&Je.userAgent)&&/iP(?:ad|hone|od)/.test(window.navigator.userAgent);function qr(e,...t){e&&e.addEventListener&&e.addEventListener(...t)}function kr(e,...t){e&&e.removeEventListener&&e.removeEventListener(...t)}const qe=Q?window:void 0,q={};function he(e,t){if(!Q)return;if(!e)return t;let n;return pe(e)?n=e():"current"in e?n=e.current:n=e,n}const eo=(e,t,n)=>{process.env.NODE_ENV!=="production"&&((!Array.isArray(t)||!t.length)&&console.warn("`useCustomCompareEffect` should not be used with no dependencies. Use React.useEffect instead."),typeof n!="function"&&console.warn("`useCustomCompareEffect` should be used with depsEqual callback for comparing deps list"));const r=p.useRef(void 0);(!r.current||!n(t,r.current))&&(r.current=t),p.useEffect(e,r.current)},ke=(e,t)=>{process.env.NODE_ENV!=="production"&&(!Array.isArray(t)||!t.length)&&console.warn("`useDeepCompareEffect` should not be used with no dependencies. Use React.useEffect instead."),eo(e,t,Wr)};function to(e,t,n,r=q){const a=de(t);ke(()=>{const i=he(n,qe);if(!(i&&i.addEventListener))return;const o=s=>a.current(s);return qr(i,e,o,r),()=>{i&&i.removeEventListener&&kr(i,e,o)}},[e,n,r])}const et=Q?p.useLayoutEffect:p.useEffect,no=e=>{Qe&&(pe(e)||console.error(`useEvent expected parameter is a function, got ${typeof e}`));const t=p.useRef(e);return et(()=>{t.current=e},[e]),p.useCallback((...n)=>{const r=t.current;return r(...n)},[])};function ro(e){Qe&&(pe(e)||console.error(`useUnmount expected parameter is a function, got ${typeof e}`));const t=de(e);p.useEffect(()=>()=>{t.current()},[t])}const tt=(e,t,n=q)=>{const r=de(t),a=p.useRef(),i=p.useCallback(()=>{a.current&&a.current.disconnect()},[]);return ke(()=>{const o=he(e);if(o)return a.current=new ResizeObserver(r.current),a.current.observe(o,n),i},[r,i,e,n]),i},oo=(e,t=q)=>{const{reset:n=!0,windowResize:r=!0,windowScroll:a=!0,immediate:i=!0}=t,[o,s]=p.useState(0),[u,c]=p.useState(0),[l,f]=p.useState(0),[d,v]=p.useState(0),[w,h]=p.useState(0),[E,O]=p.useState(0),[A,S]=p.useState(0),[g,m]=p.useState(0),y=no(()=>{const L=he(e);if(!L){n&&(s(0),c(0),f(0),v(0),h(0),O(0),S(0),m(0));return}const T=L.getBoundingClientRect();s(T.height),c(T.bottom),f(T.left),v(T.right),h(T.top),O(T.width),S(T.x),m(T.y)});return tt(e,y),p.useEffect(()=>{i&&y()},[i,y]),p.useEffect(()=>(a&&window.addEventListener("scroll",y,{passive:!0}),r&&window.addEventListener("resize",y,{passive:!0}),()=>{a&&window.removeEventListener("scroll",y),r&&window.removeEventListener("resize",y)}),[y,r,a]),{height:o,bottom:u,left:l,right:d,top:w,width:E,x:A,y:g,update:y}},nt=(e,t=q)=>{const{box:n="content-box"}=t,[r,a]=p.useState(0),[i,o]=p.useState(0);return tt(e,([s])=>{const u=n==="border-box"?s.borderBoxSize:n==="content-box"?s.contentBoxSize:s.devicePixelContentBoxSize;u?(a(u.reduce((c,{inlineSize:l})=>c+l,0)),o(u.reduce((c,{blockSize:l})=>c+l,0))):(a(s.contentRect.width),o(s.contentRect.height))},t),[r,i]};function io(e){const t=p.useRef(0),[n,r]=p.useState(e),a=p.useCallback(i=>{cancelAnimationFrame(t.current),t.current=requestAnimationFrame(()=>{r(i)})},[]);return ro(()=>{cancelAnimationFrame(t.current)}),[n,a]}const k=Qr?navigator:void 0;k&&(k.connection||k.mozConnection||k.webkitConnection);const ao={capture:!1,passive:!0};function so(){const[e,t]=io(()=>({x:0,y:0})),n=()=>{t({x:window.scrollX,y:window.scrollY})};return to("scroll",n,qe,ao),et(()=>{n()},[]),e}function uo(e){return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}}const co=()=>{const e=p.useRef({}).current,t=p.useRef({width:0,height:0}),n=(a,i)=>{for(const o in e){const s=o;if(i[s]!==a[s])return!1}return!0},r=Zr.useSyncExternalStore(uo,()=>{const a={width:window.innerWidth,height:window.innerHeight};return n(t.current,a)?t.current:(t.current=a,a)},()=>t.current);return{get width(){return e.width=!0,r.width},get height(){return e.height=!0,r.height}}};p.use;function fo({parent:e,children:t}){var w;const n=p.useRef(null),r=e,{y:a}=so(),{height:i}=co(),[,o]=nt(n),[,s]=nt(r),{left:u,right:c}=oo(r),l=(((w=r==null?void 0:r.current)==null?void 0:w.getBoundingClientRect().top)??0)+a,f=l+s-i,v=(()=>{const h=Math.max(f-(l+o-i),0),E=0,O=o>i?a+i-o-l:a-l;return O>=E&&O<=h?{...o>i?{bottom:0}:{top:0},position:"fixed",left:`${u}px`,right:`${c}px`}:{top:`${O