skyflytravel.hu/out/_next/static/chunks/9c87745f176c3743.js

9 lines
5.1 KiB
JavaScript

(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,88653,e=>{"use strict";e.i(47167);var t=e.i(43476),r=e.i(71645),n=e.i(31178),o=e.i(47414),i=e.i(74008),s=e.i(21476),l=e.i(72846),u=r,a=e.i(37806);function c(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}class f extends u.Component{getSnapshotBeforeUpdate(e){let t=this.props.childRef.current;if(t&&e.isPresent&&!this.props.isPresent){let e=t.offsetParent,r=(0,l.isHTMLElement)(e)&&e.offsetWidth||0,n=(0,l.isHTMLElement)(e)&&e.offsetHeight||0,o=this.props.sizeRef.current;o.height=t.offsetHeight||0,o.width=t.offsetWidth||0,o.top=t.offsetTop,o.left=t.offsetLeft,o.right=r-o.width-o.left,o.bottom=n-o.height-o.top}return null}componentDidUpdate(){}render(){return this.props.children}}function p({children:e,isPresent:n,anchorX:o,anchorY:i,root:s}){let l=(0,u.useId)(),p=(0,u.useRef)(null),h=(0,u.useRef)({width:0,height:0,top:0,left:0,right:0,bottom:0}),{nonce:d}=(0,u.useContext)(a.MotionConfigContext),m=function(...e){return r.useCallback(function(...e){return t=>{let r=!1,n=e.map(e=>{let n=c(e,t);return r||"function"!=typeof n||(r=!0),n});if(r)return()=>{for(let t=0;t<n.length;t++){let r=n[t];"function"==typeof r?r():c(e[t],null)}}}}(...e),e)}(p,e.props?.ref??e?.ref);return(0,u.useInsertionEffect)(()=>{let{width:e,height:t,top:r,left:u,right:a,bottom:c}=h.current;if(n||!p.current||!e||!t)return;let f="left"===o?`left: ${u}`:`right: ${a}`,m="bottom"===i?`bottom: ${c}`:`top: ${r}`;p.current.dataset.motionPopId=l;let x=document.createElement("style");d&&(x.nonce=d);let g=s??document.head;return g.appendChild(x),x.sheet&&x.sheet.insertRule(`
[data-motion-pop-id="${l}"] {
position: absolute !important;
width: ${e}px !important;
height: ${t}px !important;
${f}px !important;
${m}px !important;
}
`),()=>{g.contains(x)&&g.removeChild(x)}},[n]),(0,t.jsx)(f,{isPresent:n,childRef:p,sizeRef:h,children:u.cloneElement(e,{ref:m})})}let h=({children:e,initial:n,isPresent:i,onExitComplete:l,custom:u,presenceAffectsLayout:a,mode:c,anchorX:f,anchorY:h,root:m})=>{let x=(0,o.useConstant)(d),g=(0,r.useId)(),w=!0,y=(0,r.useMemo)(()=>(w=!1,{id:g,initial:n,isPresent:i,custom:u,onExitComplete:e=>{for(let t of(x.set(e,!0),x.values()))if(!t)return;l&&l()},register:e=>(x.set(e,!1),()=>x.delete(e))}),[i,x,l]);return a&&w&&(y={...y}),(0,r.useMemo)(()=>{x.forEach((e,t)=>x.set(t,!1))},[i]),r.useEffect(()=>{i||x.size||!l||l()},[i]),"popLayout"===c&&(e=(0,t.jsx)(p,{isPresent:i,anchorX:f,anchorY:h,root:m,children:e})),(0,t.jsx)(s.PresenceContext.Provider,{value:y,children:e})};function d(){return new Map}var m=e.i(64978);let x=e=>e.key||"";function g(e){let t=[];return r.Children.forEach(e,e=>{(0,r.isValidElement)(e)&&t.push(e)}),t}let w=({children:e,custom:s,initial:l=!0,onExitComplete:u,presenceAffectsLayout:a=!0,mode:c="sync",propagate:f=!1,anchorX:p="left",anchorY:d="top",root:w})=>{let[y,b]=(0,m.usePresence)(f),v=(0,r.useMemo)(()=>g(e),[e]),C=f&&!y?[]:v.map(x),E=(0,r.useRef)(!0),P=(0,r.useRef)(v),R=(0,o.useConstant)(()=>new Map),j=(0,r.useRef)(new Set),[L,M]=(0,r.useState)(v),[T,$]=(0,r.useState)(v);(0,i.useIsomorphicLayoutEffect)(()=>{E.current=!1,P.current=v;for(let e=0;e<T.length;e++){let t=x(T[e]);C.includes(t)?(R.delete(t),j.current.delete(t)):!0!==R.get(t)&&R.set(t,!1)}},[T,C.length,C.join("-")]);let _=[];if(v!==L){let e=[...v];for(let t=0;t<T.length;t++){let r=T[t],n=x(r);C.includes(n)||(e.splice(t,0,r),_.push(r))}return"wait"===c&&_.length&&(e=_),$(g(e)),M(v),null}let{forceRender:S}=(0,r.useContext)(n.LayoutGroupContext);return(0,t.jsx)(t.Fragment,{children:T.map(e=>{let r=x(e),n=(!f||!!y)&&(v===T||C.includes(r));return(0,t.jsx)(h,{isPresent:n,initial:(!E.current||!!l)&&void 0,custom:s,presenceAffectsLayout:a,mode:c,root:w,onExitComplete:n?void 0:()=>{if(j.current.has(r)||(j.current.add(r),!R.has(r)))return;R.set(r,!0);let e=!0;R.forEach(t=>{t||(e=!1)}),e&&(S?.(),$(P.current),f&&b?.(),u&&u())},anchorX:p,anchorY:d,children:e},r)})})};e.s(["AnimatePresence",()=>w],88653)},34581,e=>{"use strict";var t=e.i(43476),r=e.i(71645);let n=(0,e.i(75254).default)("arrow-up",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);var o=e.i(46932),i=e.i(88653),s=e.i(47163);e.s(["default",0,()=>{let[e,l]=r.useState(!1);return r.useEffect(()=>{let e=()=>{window.scrollY>300?l(!0):l(!1)};return window.addEventListener("scroll",e),()=>window.removeEventListener("scroll",e)},[]),(0,t.jsx)(i.AnimatePresence,{children:e&&(0,t.jsx)(o.motion.button,{initial:{opacity:0,scale:.5,y:20},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.5,y:20},whileHover:{scale:1.1,y:-5},whileTap:{scale:.9},onClick:()=>{window.scrollTo({top:0,behavior:"smooth"})},className:(0,s.cn)("fixed bottom-8 right-8 z-[60] p-4 rounded-2xl","bg-primary text-white shadow-[0_20px_40px_-10px_rgba(217,163,33,0.3)]","backdrop-blur-md border border-white/20","transition-shadow duration-300 hover:shadow-[0_25px_50px_-12px_rgba(217,163,33,0.5)]","flex items-center justify-center group"),"aria-label":"Scroll to top",children:(0,t.jsx)(n,{className:"w-6 h-6 group-hover:animate-bounce"})})})}],34581)}]);