UNPKG

nhfs

Version:

NHFS — A sleek HTTP file server for the web built with Next.js and HeroUI. (Alpha)

3 lines (2 loc) 46.2 kB
(globalThis.TURBOPACK=globalThis.TURBOPACK||[]).push(["object"==typeof document?document.currentScript:void 0,{816916:[t=>{"use strict";t.s({motion:()=>ej},816916);var e=t.i(60331),i=t.i(295902);t.s({drag:()=>eD},132800);var s=t.i(732953);t.i(576254);var o=t.i(796254),r=t.i(61342);t.i(682361);var n=t.i(123205),a=t.i(399136),l=t.i(412285),h=t.i(621015),u=t.i(938955);t.s({distance:()=>c,distance2D:()=>d},516462);let c=(t,e)=>Math.abs(t-e);function d(t,e){return Math.sqrt(c(t.x,e.x)**2+c(t.y,e.y)**2)}var m=t.i(45752),p=t.i(570119);class v{updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),(0,p.cancelFrame)(this.updatePoint)}constructor(t,e,{transformPagePoint:i,contextWindow:s,dragSnapToOrigin:o=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let t=y(this.lastMoveEventInfo,this.history),e=null!==this.startEvent,i=d(t.offset,{x:0,y:0})>=3;if(!e&&!i)return;let{point:s}=t,{timestamp:o}=p.frameData;this.history.push({...s,timestamp:o});let{onStart:r,onMove:n}=this.handlers;e||(r&&r(this.lastMoveEvent,t),this.startEvent=this.lastMoveEvent),n&&n(this.lastMoveEvent,t)},this.handlePointerMove=(t,e)=>{this.lastMoveEvent=t,this.lastMoveEventInfo=g(e,this.transformPagePoint),p.frame.update(this.updatePoint,!0)},this.handlePointerUp=(t,e)=>{this.end();let{onEnd:i,onSessionEnd:s,resumeAnimation:o}=this.handlers;if(this.dragSnapToOrigin&&o&&o(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let r=y("pointercancel"===t.type?this.lastMoveEventInfo:g(e,this.transformPagePoint),this.history);this.startEvent&&i&&i(t,r),s&&s(t,r)},!(0,m.isPrimaryPointer)(t))return;this.dragSnapToOrigin=o,this.handlers=e,this.transformPagePoint=i,this.contextWindow=s||window;let r=g((0,a.extractEventInfo)(t),this.transformPagePoint),{point:n}=r,{timestamp:l}=p.frameData;this.history=[{...n,timestamp:l}];let{onSessionStart:c}=e;c&&c(t,y(r,this.history)),this.removeListeners=(0,u.pipe)((0,h.addPointerEvent)(this.contextWindow,"pointermove",this.handlePointerMove),(0,h.addPointerEvent)(this.contextWindow,"pointerup",this.handlePointerUp),(0,h.addPointerEvent)(this.contextWindow,"pointercancel",this.handlePointerUp))}}function g(t,e){return e?{point:e(t.point)}:t}function f(t,e){return{x:t.x-e.x,y:t.y-e.y}}function y(t,e){let{point:i}=t;return{point:i,delta:f(i,x(e)),offset:f(i,e[0]),velocity:function(t,e){if(t.length<2)return{x:0,y:0};let i=t.length-1,s=null,o=x(t);for(;i>=0&&(s=t[i],!(o.timestamp-s.timestamp>(0,l.secondsToMilliseconds)(.1)));)i--;if(!s)return{x:0,y:0};let r=(0,l.millisecondsToSeconds)(o.timestamp-s.timestamp);if(0===r)return{x:0,y:0};let n={x:(o.x-s.x)/r,y:(o.y-s.y)/r};return n.x===1/0&&(n.x=0),n.y===1/0&&(n.y=0),n}(e,.1)}}function x(t){return t[t.length-1]}var P=t.i(366290),T=t.i(740620);t.s({calcBoxDelta:()=>S,calcLength:()=>E,calcRelativeBox:()=>j,calcRelativePosition:()=>V,isNear:()=>R},697246);var D=t.i(519783);function E(t){return t.max-t.min}function R(t,e,i){return Math.abs(t-e)<=i}function A(t,e,i){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:.5;t.origin=s,t.originPoint=(0,D.mixNumber)(e.min,e.max,t.origin),t.scale=E(i)/E(e),t.translate=(0,D.mixNumber)(i.min,i.max,t.origin)-t.originPoint,(t.scale>=.9999&&t.scale<=1.0001||isNaN(t.scale))&&(t.scale=1),(t.translate>=-.01&&t.translate<=.01||isNaN(t.translate))&&(t.translate=0)}function S(t,e,i,s){A(t.x,e.x,i.x,s?s.originX:void 0),A(t.y,e.y,i.y,s?s.originY:void 0)}function B(t,e,i){t.min=i.min+e.min,t.max=t.min+E(e)}function j(t,e,i){B(t.x,e.x,i.x),B(t.y,e.y,i.y)}function L(t,e,i){t.min=e.min-i.min,t.max=t.min+E(e)}function V(t,e,i){L(t.x,e.x,i.x),L(t.y,e.y,i.y)}var w=t.i(499228);function b(t,e,i){return{min:void 0!==e?t.min+e:void 0,max:void 0!==i?t.max+i-(t.max-t.min):void 0}}function M(t,e){let i=e.min-t.min,s=e.max-t.max;return e.max-e.min<t.max-t.min&&([i,s]=[s,i]),{min:i,max:s}}function C(t,e,i){return{min:k(t,e),max:k(t,i)}}function k(t,e){return"number"==typeof t?t:t[e]||0}var U=t.i(710147);function F(t){return[t("x"),t("y")]}var O=t.i(850528),N=t.i(674547),I=t.i(821856),W=t.i(623940),z=t.i(898011);let G=t=>{let{current:e}=t;return e?e.ownerDocument.defaultView:null};var H=t.i(307409);let X=new WeakMap;class Y{start(t){let{snapToCursor:e=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{presenceContext:i}=this.visualElement;if(i&&!1===i.isPresent)return;let s=t=>{let{dragSnapToOrigin:i}=this.getProps();i?this.pauseAnimation():this.stopAnimation(),e&&this.snapToCursor((0,a.extractEventInfo)(t).point)},o=(t,e)=>{let{drag:i,dragPropagation:s,onDragStart:o}=this.getProps();if(i&&!s&&(this.openDragLock&&this.openDragLock(),this.openDragLock=(0,n.setDragLock)(i),!this.openDragLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),F(t=>{let e=this.getAxisMotionValue(t).get()||0;if(W.percent.test(e)){let{projection:i}=this.visualElement;if(i&&i.layout){let s=i.layout.layoutBox[t];s&&(e=E(s)*(parseFloat(e)/100))}}this.originPoint[t]=e}),o&&p.frame.postRender(()=>o(t,e)),(0,H.addValueToWillChange)(this.visualElement,"transform");let{animationState:r}=this.visualElement;r&&r.setActive("whileDrag",!0)},r=(t,e)=>{let{dragPropagation:i,dragDirectionLock:s,onDirectionLock:o,onDrag:r}=this.getProps();if(!i&&!this.openDragLock)return;let{offset:n}=e;if(s&&null===this.currentDirection){this.currentDirection=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10,i=null;return Math.abs(t.y)>e?i="y":Math.abs(t.x)>e&&(i="x"),i}(n),null!==this.currentDirection&&o&&o(this.currentDirection);return}this.updateAxis("x",e.point,n),this.updateAxis("y",e.point,n),this.visualElement.render(),r&&r(t,e)},l=(t,e)=>this.stop(t,e),h=()=>F(t=>{var e;return"paused"===this.getAnimationState(t)&&(null==(e=this.getAxisMotionValue(t).animation)?void 0:e.play())}),{dragSnapToOrigin:u}=this.getProps();this.panSession=new v(t,{onSessionStart:s,onStart:o,onMove:r,onSessionEnd:l,resumeAnimation:h},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,contextWindow:G(this.visualElement)})}stop(t,e){let i=this.isDragging;if(this.cancel(),!i)return;let{velocity:s}=e;this.startAnimation(s);let{onDragEnd:o}=this.getProps();o&&p.frame.postRender(()=>o(t,e))}cancel(){this.isDragging=!1;let{projection:t,animationState:e}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;let{dragPropagation:i}=this.getProps();!i&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),e&&e.setActive("whileDrag",!1)}updateAxis(t,e,i){let{drag:s}=this.getProps();if(!i||!q(t,s,this.currentDirection))return;let o=this.getAxisMotionValue(t),r=this.originPoint[t]+i[t];this.constraints&&this.constraints[t]&&(r=function(t,e,i){let{min:s,max:o}=e;return void 0!==s&&t<s?t=i?(0,D.mixNumber)(s,t,i.min):Math.max(t,s):void 0!==o&&t>o&&(t=i?(0,D.mixNumber)(o,t,i.max):Math.min(t,o)),t}(r,this.constraints[t],this.elastic[t])),o.set(r)}resolveConstraints(){var t;let{dragConstraints:e,dragElastic:i}=this.getProps(),s=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):null==(t=this.visualElement.projection)?void 0:t.layout,o=this.constraints;e&&(0,P.isRefObject)(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&s?this.constraints=function(t,e){let{top:i,left:s,bottom:o,right:r}=e;return{x:b(t.x,s,r),y:b(t.y,i,o)}}(s.layoutBox,e):this.constraints=!1,this.elastic=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:.35;return!1===t?t=0:!0===t&&(t=.35),{x:C(t,"left","right"),y:C(t,"top","bottom")}}(i),o!==this.constraints&&s&&this.constraints&&!this.hasMutatedConstraints&&F(t=>{!1!==this.constraints&&this.getAxisMotionValue(t)&&(this.constraints[t]=function(t,e){let i={};return void 0!==e.min&&(i.min=e.min-t.min),void 0!==e.max&&(i.max=e.max-t.min),i}(s.layoutBox[t],this.constraints[t]))})}resolveRefConstraints(){var t;let{dragConstraints:e,onMeasureDragConstraints:i}=this.getProps();if(!e||!(0,P.isRefObject)(e))return!1;let s=e.current;(0,r.invariant)(null!==s,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.");let{projection:o}=this.visualElement;if(!o||!o.layout)return!1;let n=(0,O.measurePageBox)(s,o.root,this.visualElement.getTransformPagePoint()),a=(t=o.layout.layoutBox,{x:M(t.x,n.x),y:M(t.y,n.y)});if(i){let t=i((0,N.convertBoxToBoundingBox)(a));this.hasMutatedConstraints=!!t,t&&(a=(0,N.convertBoundingBoxToBox)(t))}return a}startAnimation(t){let{drag:e,dragMomentum:i,dragElastic:s,dragTransition:o,dragSnapToOrigin:r,onDragTransitionEnd:n}=this.getProps(),a=this.constraints||{};return Promise.all(F(n=>{if(!q(n,e,this.currentDirection))return;let l=a&&a[n]||{};r&&(l={min:0,max:0});let h={type:"inertia",velocity:i?t[n]:0,bounceStiffness:s?200:1e6,bounceDamping:s?40:1e7,timeConstant:750,restDelta:1,restSpeed:10,...o,...l};return this.startAxisValueAnimation(n,h)})).then(n)}startAxisValueAnimation(t,e){let i=this.getAxisMotionValue(t);return(0,H.addValueToWillChange)(this.visualElement,t),i.start((0,z.animateMotionValue)(t,i,0,e,this.visualElement,!1))}stopAnimation(){F(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){F(t=>{var e;return null==(e=this.getAxisMotionValue(t).animation)?void 0:e.pause()})}getAnimationState(t){var e;return null==(e=this.getAxisMotionValue(t).animation)?void 0:e.state}getAxisMotionValue(t){let e="_drag".concat(t.toUpperCase()),i=this.visualElement.getProps();return i[e]||this.visualElement.getValue(t,(i.initial?i.initial[t]:void 0)||0)}snapToCursor(t){F(e=>{let{drag:i}=this.getProps();if(!q(e,i,this.currentDirection))return;let{projection:s}=this.visualElement,o=this.getAxisMotionValue(e);if(s&&s.layout){let{min:i,max:r}=s.layout.layoutBox[e];o.set(t[e]-(0,D.mixNumber)(i,r,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:t,dragConstraints:e}=this.getProps(),{projection:i}=this.visualElement;if(!(0,P.isRefObject)(e)||!i||!this.constraints)return;this.stopAnimation();let s={x:0,y:0};F(t=>{let e=this.getAxisMotionValue(t);if(e&&!1!==this.constraints){let i=e.get();s[t]=function(t,e){let i=.5,s=E(t),o=E(e);return o>s?i=(0,T.progress)(e.min,e.max-s,t.min):s>o&&(i=(0,T.progress)(t.min,t.max-o,e.min)),(0,w.clamp)(0,1,i)}({min:i,max:i},this.constraints[t])}});let{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",i.root&&i.root.updateScroll(),i.updateLayout(),this.resolveConstraints(),F(e=>{if(!q(e,t,null))return;let i=this.getAxisMotionValue(e),{min:o,max:r}=this.constraints[e];i.set((0,D.mixNumber)(o,r,s[e]))})}addListeners(){if(!this.visualElement.current)return;X.set(this.visualElement,this);let t=this.visualElement.current,e=(0,h.addPointerEvent)(t,"pointerdown",t=>{let{drag:e,dragListener:i=!0}=this.getProps();e&&i&&this.start(t)}),i=()=>{let{dragConstraints:t}=this.getProps();(0,P.isRefObject)(t)&&t.current&&(this.constraints=this.resolveRefConstraints())},{projection:s}=this.visualElement,o=s.addEventListener("measure",i);s&&!s.layout&&(s.root&&s.root.updateScroll(),s.updateLayout()),p.frame.read(i);let r=(0,I.addDomEvent)(window,"resize",()=>this.scalePositionWithinConstraints()),n=s.addEventListener("didUpdate",t=>{let{delta:e,hasLayoutChanged:i}=t;this.isDragging&&i&&(F(t=>{let i=this.getAxisMotionValue(t);i&&(this.originPoint[t]+=e[t].translate,i.set(i.get()+e[t].translate))}),this.visualElement.render())});return()=>{r(),e(),o(),n&&n()}}getProps(){let t=this.visualElement.getProps(),{drag:e=!1,dragDirectionLock:i=!1,dragPropagation:s=!1,dragConstraints:o=!1,dragElastic:r=.35,dragMomentum:n=!0}=t;return{...t,drag:e,dragDirectionLock:i,dragPropagation:s,dragConstraints:o,dragElastic:r,dragMomentum:n}}constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=(0,U.createBox)(),this.visualElement=t}}function q(t,e,i){return(!0===e||e===t)&&(null===i||i===t)}class K extends s.Feature{mount(){let{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||o.noop}unmount(){this.removeGroupControls(),this.removeListeners()}constructor(t){super(t),this.removeGroupControls=o.noop,this.removeListeners=o.noop,this.controls=new Y(t)}}var Z=s;let _=t=>(e,i)=>{t&&p.frame.postRender(()=>t(e,i))};class J extends Z.Feature{onPointerDown(t){this.session=new v(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:G(this.node)})}createPanHandlers(){let{onPanSessionStart:t,onPanStart:e,onPan:i,onPanEnd:s}=this.node.getProps();return{onSessionStart:_(t),onStart:_(e),onMove:i,onEnd:(t,e)=>{delete this.session,s&&p.frame.postRender(()=>s(t,e))}}}mount(){this.removePointerDownListener=(0,h.addPointerEvent)(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}constructor(){super(...arguments),this.removePointerDownListener=o.noop}}var Q=t.i(731636),$=t.i(838653);t.s({useIsPresent:()=>ti,usePresence:()=>te},968242);var tt=t.i(139204);function te(){let t=(0,$.useContext)(tt.PresenceContext);if(null===t)return[!0,null];let{isPresent:e,onExitComplete:i,register:s}=t,o=(0,$.useId)();(0,$.useEffect)(()=>s(o),[]);let r=(0,$.useCallback)(()=>i&&i(o),[o,i]);return!e&&i?[!1,r]:[!0]}function ti(){var t;return null===(t=(0,$.useContext)(tt.PresenceContext))||t.isPresent}var ts=t.i(348074),to=t.i(584579);let tr={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function tn(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}let ta={correct:(t,e)=>{if(!e.target)return t;if("string"==typeof t)if(!W.px.test(t))return t;else t=parseFloat(t);let i=tn(t,e.target.x),s=tn(t,e.target.y);return"".concat(i,"% ").concat(s,"%")}};var tl=t.i(855854),th=t.i(656351),tu=t.i(786022);class tc extends $.Component{componentDidMount(){let{visualElement:t,layoutGroup:e,switchLayoutGroup:i,layoutId:s}=this.props,{projection:o}=t;(0,th.addScaleCorrector)(tm),o&&(e.group&&e.group.add(o),i&&i.register&&s&&i.register(o),o.root.didUpdate(),o.addEventListener("animationComplete",()=>{this.safeToRemove()}),o.setOptions({...o.options,onExitComplete:()=>this.safeToRemove()})),tr.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){let{layoutDependency:e,visualElement:i,drag:s,isPresent:o}=this.props,r=i.projection;return r&&(r.isPresent=o,s||t.layoutDependency!==e||void 0===e?r.willUpdate():this.safeToRemove(),t.isPresent!==o&&(o?r.promote():r.relegate()||p.frame.postRender(()=>{let t=r.getStack();t&&t.members.length||this.safeToRemove()}))),null}componentDidUpdate(){let{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),tu.microtask.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:t,layoutGroup:e,switchLayoutGroup:i}=this.props,{projection:s}=t;s&&(s.scheduleCheckAfterUnmount(),e&&e.group&&e.group.remove(s),i&&i.deregister&&i.deregister(s))}safeToRemove(){let{safeToRemove:t}=this.props;t&&t()}render(){return null}}function td(t){let[e,i]=te(),s=(0,$.useContext)(ts.LayoutGroupContext);return(0,Q.jsx)(tc,{...t,layoutGroup:s,switchLayoutGroup:(0,$.useContext)(to.SwitchLayoutGroupContext),isPresent:e,safeToRemove:i})}let tm={borderRadius:{...ta,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:ta,borderTopRightRadius:ta,borderBottomLeftRadius:ta,borderBottomRightRadius:ta,boxShadow:{correct:(t,e)=>{let{treeScale:i,projectionDelta:s}=e,o=tl.complex.parse(t);if(o.length>5)return t;let r=tl.complex.createTransformer(t),n=+("number"!=typeof o[0]),a=s.x.scale*i.x,l=s.y.scale*i.y;o[0+n]/=a,o[1+n]/=l;let h=(0,D.mixNumber)(a,l,.5);return"number"==typeof o[2+n]&&(o[2+n]/=h),"number"==typeof o[3+n]&&(o[3+n]/=h),r(o)}}};t.s({HTMLProjectionNode:()=>eT,rootProjectionNode:()=>eP},478040);var tp=t.i(80863),tv=t.i(992382);let tg=["TopLeft","TopRight","BottomLeft","BottomRight"],tf=tg.length,ty=t=>"string"==typeof t?parseFloat(t):t,tx=t=>"number"==typeof t||W.px.test(t);function tP(t,e){return void 0!==t[e]?t[e]:t.borderRadius}let tT=tE(0,.5,tv.circOut),tD=tE(.5,.95,o.noop);function tE(t,e,i){return s=>s<t?0:s>e?1:i((0,T.progress)(t,e,s))}function tR(t,e){t.min=e.min,t.max=e.max}function tA(t,e){tR(t.x,e.x),tR(t.y,e.y)}function tS(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}var tB=t.i(854898);function tj(t,e,i,s,o){return t-=e,t=(0,tB.scalePoint)(t,1/i,s),void 0!==o&&(t=(0,tB.scalePoint)(t,1/o,s)),t}function tL(t,e,i,s,o){let[r,n,a]=i;!function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:.5,o=arguments.length>4?arguments[4]:void 0,r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:t,n=arguments.length>6&&void 0!==arguments[6]?arguments[6]:t;if(W.percent.test(e)&&(e=parseFloat(e),e=(0,D.mixNumber)(n.min,n.max,e/100)-n.min),"number"!=typeof e)return;let a=(0,D.mixNumber)(r.min,r.max,s);t===r&&(a-=e),t.min=tj(t.min,e,i,a,o),t.max=tj(t.max,e,i,a,o)}(t,e[r],e[n],e[a],e.scale,s,o)}let tV=["x","scaleX","originX"],tw=["y","scaleY","originY"];function tb(t,e,i,s){tL(t.x,e,tV,i?i.x:void 0,s?s.x:void 0),tL(t.y,e,tw,i?i.y:void 0,s?s.y:void 0)}var tM=t.i(324167);function tC(t){return 0===t.translate&&1===t.scale}function tk(t){return tC(t.x)&&tC(t.y)}function tU(t,e){return t.min===e.min&&t.max===e.max}function tF(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function tO(t,e){return tF(t.x,e.x)&&tF(t.y,e.y)}function tN(t){return E(t.x)/E(t.y)}function tI(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}var tW=t.i(667252);class tz{add(t){(0,tW.addUniqueItem)(this.members,t),t.scheduleRender()}remove(t){if((0,tW.removeItem)(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){let t=this.members[this.members.length-1];t&&this.promote(t)}}relegate(t){let e,i=this.members.findIndex(e=>t===e);if(0===i)return!1;for(let t=i;t>=0;t--){let i=this.members[t];if(!1!==i.isPresent){e=i;break}}return!!e&&(this.promote(e),!0)}promote(t,e){let i=this.lead;if(t!==i&&(this.prevLead=i,this.lead=t,t.show(),i)){i.instance&&i.scheduleRender(),t.scheduleRender(),t.resumeFrom=i,e&&(t.resumeFrom.preserveOpacity=!0),i.snapshot&&(t.snapshot=i.snapshot,t.snapshot.latestValues=i.animationValues||i.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);let{crossfade:s}=t.options;!1===s&&i.hide()}}exitAnimationComplete(){this.members.forEach(t=>{let{options:e,resumingFrom:i}=t;e.onExitComplete&&e.onExitComplete(),i&&i.options.onExitComplete&&i.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}constructor(){this.members=[]}}var tG=t.i(432024);t.s({FlatTree:()=>tX},836491);let tH=(t,e)=>t.depth-e.depth;class tX{add(t){(0,tW.addUniqueItem)(this.children,t),this.isDirty=!0}remove(t){(0,tW.removeItem)(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(tH),this.isDirty=!1,this.children.forEach(t)}constructor(){this.children=[],this.isDirty=!1}}var tY=t.i(312379);t.s({delay:()=>tK},410633);var tq=t.i(888590);function tK(t,e){let i=tq.time.now(),s=o=>{let{timestamp:r}=o,n=r-i;n>=e&&((0,p.cancelFrame)(s),t(n-e))};return p.frame.read(s,!0),()=>(0,p.cancelFrame)(s)}function tZ(t){return t instanceof SVGElement&&"svg"!==t.tagName}t.s({isSVGElement:()=>tZ},533268),t.s({animateSingleValue:()=>tQ},190786);var t_=t.i(33121),tJ=t.i(746581);function tQ(t,e,i){let s=(0,tJ.isMotionValue)(t)?t:(0,t_.motionValue)(t);return s.start((0,z.animateMotionValue)("",s,e,i)),s.animation}var t$=t.i(425705);let t0={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},t1="undefined"!=typeof window&&void 0!==window.MotionDebug,t2=["","X","Y","Z"],t3={visibility:"hidden"},t5=0;function t6(t,e,i,s){let{latestValues:o}=e;o[t]&&(i[t]=o[t],e.setStaticValue(t,0),s&&(s[t]=0))}function t8(t){let{attachResizeListener:e,defaultParent:i,measureScroll:s,checkIsScrollRoot:o,resetTransform:r}=t;return class{addEventListener(t,e){return this.eventHandlers.has(t)||this.eventHandlers.set(t,new tp.SubscriptionManager),this.eventHandlers.get(t).add(e)}notifyListeners(t){for(var e=arguments.length,i=Array(e>1?e-1:0),s=1;s<e;s++)i[s-1]=arguments[s];let o=this.eventHandlers.get(t);o&&o.notify(...i)}hasListeners(t){return this.eventHandlers.has(t)}mount(t){let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.root.hasTreeAnimated;if(this.instance)return;this.isSVG=tZ(t),this.instance=t;let{layoutId:s,layout:o,visualElement:r}=this.options;if(r&&!r.current&&r.mount(t),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),i&&(o||s)&&(this.isLayoutDirty=!0),e){let i,s=()=>this.root.updateBlockedByResize=!1;e(t,()=>{this.root.updateBlockedByResize=!0,i&&i(),i=tK(s,250),tr.hasAnimatedSinceResize&&(tr.hasAnimatedSinceResize=!1,this.nodes.forEach(er))})}s&&this.root.registerSharedNode(s,this),!1!==this.options.animate&&r&&(s||o)&&this.addEventListener("didUpdate",t=>{let{delta:e,hasLayoutChanged:i,hasRelativeTargetChanged:s,layout:o}=t;if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}let n=this.options.transition||r.getDefaultTransition()||em,{onLayoutAnimationStart:a,onLayoutAnimationComplete:l}=r.getProps(),h=!this.targetLayout||!tO(this.targetLayout,o)||s,u=!i&&s;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||u||i&&(h||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(e,u);let t={...(0,tM.getValueTransition)(n,"layout"),onPlay:a,onComplete:l};(r.shouldReduceMotion||this.options.layoutRoot)&&(t.delay=0,t.type=!1),this.startAnimation(t)}else i||er(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=o})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);let t=this.getStack();t&&t.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,(0,p.cancelFrame)(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){!this.isUpdateBlocked()&&(this.isUpdating=!0,this.nodes&&this.nodes.forEach(el),this.animationId++)}getTransformTemplate(){let{visualElement:t}=this.options;return t&&t.getProps().transformTemplate}willUpdate(){let t=!(arguments.length>0)||void 0===arguments[0]||arguments[0];if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&function t(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;let{visualElement:i}=e.options;if(!i)return;let s=(0,t$.getOptimisedAppearId)(i);if(window.MotionHasOptimisedAnimation(s,"transform")){let{layout:t,layoutId:i}=e.options;window.MotionCancelOptimisedAnimation(s,"transform",p.frame,!(t||i))}let{parent:o}=e;o&&!o.hasCheckedOptimisedAppear&&t(o)}(this),this.root.isUpdating||this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let t=0;t<this.path.length;t++){let e=this.path[t];e.shouldResetTransform=!0,e.updateScroll("snapshot"),e.options.layoutRoot&&e.willUpdate(!1)}let{layoutId:e,layout:i}=this.options;if(void 0===e&&!i)return;let s=this.getTransformTemplate();this.prevTransformTemplateValue=s?s(this.latestValues,""):void 0,this.updateSnapshot(),t&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(ei);return}this.isUpdating||this.nodes.forEach(es),this.isUpdating=!1,this.nodes.forEach(eo),this.nodes.forEach(t4),this.nodes.forEach(t9),this.clearAllSnapshots();let t=tq.time.now();p.frameData.delta=(0,w.clamp)(0,1e3/60,t-p.frameData.timestamp),p.frameData.timestamp=t,p.frameData.isProcessing=!0,p.frameSteps.update.process(p.frameData),p.frameSteps.preRender.process(p.frameData),p.frameSteps.render.process(p.frameData),p.frameData.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,tu.microtask.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(ee),this.sharedNodes.forEach(eh)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,p.frame.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){p.frame.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let t=0;t<this.path.length;t++)this.path[t].updateScroll();let t=this.layout;this.layout=this.measure(!1),this.layoutCorrected=(0,U.createBox)(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);let{visualElement:e}=this.options;e&&e.notify("LayoutMeasure",this.layout.layoutBox,t?t.layoutBox:void 0)}updateScroll(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"measure",e=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===t&&(e=!1),e){let e=o(this.instance);this.scroll={animationId:this.root.animationId,phase:t,isRoot:e,offset:s(this.instance),wasRoot:this.scroll?this.scroll.isRoot:e}}}resetTransform(){if(!r)return;let t=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,e=this.projectionDelta&&!tk(this.projectionDelta),i=this.getTransformTemplate(),s=i?i(this.latestValues,""):void 0,o=s!==this.prevTransformTemplateValue;t&&(e||(0,tG.hasTransform)(this.latestValues)||o)&&(r(this.instance,s),this.shouldResetTransform=!1,this.scheduleRender())}measure(){var t;let e=!(arguments.length>0)||void 0===arguments[0]||arguments[0],i=this.measurePageBox(),s=this.removeElementScroll(i);return e&&(s=this.removeTransform(s)),eg((t=s).x),eg(t.y),{animationId:this.root.animationId,measuredBox:i,layoutBox:s,latestValues:{},source:this.id}}measurePageBox(){var t;let{visualElement:e}=this.options;if(!e)return(0,U.createBox)();let i=e.measureViewportBox();if(!((null==(t=this.scroll)?void 0:t.wasRoot)||this.path.some(ey))){let{scroll:t}=this.root;t&&((0,tB.translateAxis)(i.x,t.offset.x),(0,tB.translateAxis)(i.y,t.offset.y))}return i}removeElementScroll(t){var e;let i=(0,U.createBox)();if(tA(i,t),null==(e=this.scroll)?void 0:e.wasRoot)return i;for(let e=0;e<this.path.length;e++){let s=this.path[e],{scroll:o,options:r}=s;s!==this.root&&o&&r.layoutScroll&&(o.wasRoot&&tA(i,t),(0,tB.translateAxis)(i.x,o.offset.x),(0,tB.translateAxis)(i.y,o.offset.y))}return i}applyTransform(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=(0,U.createBox)();tA(i,t);for(let t=0;t<this.path.length;t++){let s=this.path[t];!e&&s.options.layoutScroll&&s.scroll&&s!==s.root&&(0,tB.transformBox)(i,{x:-s.scroll.offset.x,y:-s.scroll.offset.y}),(0,tG.hasTransform)(s.latestValues)&&(0,tB.transformBox)(i,s.latestValues)}return(0,tG.hasTransform)(this.latestValues)&&(0,tB.transformBox)(i,this.latestValues),i}removeTransform(t){let e=(0,U.createBox)();tA(e,t);for(let t=0;t<this.path.length;t++){let i=this.path[t];if(!i.instance||!(0,tG.hasTransform)(i.latestValues))continue;(0,tG.hasScale)(i.latestValues)&&i.updateSnapshot();let s=(0,U.createBox)();tA(s,i.measurePageBox()),tb(e,i.latestValues,i.snapshot?i.snapshot.layoutBox:void 0,s)}return(0,tG.hasTransform)(this.latestValues)&&tb(e,this.latestValues),e}setTargetDelta(t){this.targetDelta=t,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(t){this.options={...this.options,...t,crossfade:void 0===t.crossfade||t.crossfade}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==p.frameData.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(){var t;let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],i=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=i.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=i.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=i.isSharedProjectionDirty);let s=!!this.resumingFrom||this!==i;if(!(e||s&&this.isSharedProjectionDirty||this.isProjectionDirty||(null==(t=this.parent)?void 0:t.isProjectionDirty)||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;let{layout:o,layoutId:r}=this.options;if(this.layout&&(o||r)){if(this.resolvedRelativeTargetAt=p.frameData.timestamp,!this.targetDelta&&!this.relativeTarget){let t=this.getClosestProjectingParent();t&&t.layout&&1!==this.animationProgress?(this.relativeParent=t,this.forceRelativeParentToResolveTarget(),this.relativeTarget=(0,U.createBox)(),this.relativeTargetOrigin=(0,U.createBox)(),V(this.relativeTargetOrigin,this.layout.layoutBox,t.layout.layoutBox),tA(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(this.relativeTarget||this.targetDelta){if(this.target||(this.target=(0,U.createBox)(),this.targetWithTransforms=(0,U.createBox)()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),j(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):tA(this.target,this.layout.layoutBox),(0,tB.applyBoxDelta)(this.target,this.targetDelta)):tA(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;let t=this.getClosestProjectingParent();t&&!!t.resumingFrom==!!this.resumingFrom&&!t.options.layoutScroll&&t.target&&1!==this.animationProgress?(this.relativeParent=t,this.forceRelativeParentToResolveTarget(),this.relativeTarget=(0,U.createBox)(),this.relativeTargetOrigin=(0,U.createBox)(),V(this.relativeTargetOrigin,this.target,t.target),tA(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}t1&&t0.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||(0,tG.hasScale)(this.parent.latestValues)||(0,tG.has2DTranslate)(this.parent.latestValues)))if(this.parent.isProjecting())return this.parent;else return this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var t;let e=this.getLead(),i=!!this.resumingFrom||this!==e,s=!0;if((this.isProjectionDirty||(null==(t=this.parent)?void 0:t.isProjectionDirty))&&(s=!1),i&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(s=!1),this.resolvedRelativeTargetAt===p.frameData.timestamp&&(s=!1),s)return;let{layout:o,layoutId:r}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(o||r))return;tA(this.layoutCorrected,this.layout.layoutBox);let n=this.treeScale.x,a=this.treeScale.y;(0,tB.applyTreeDeltas)(this.layoutCorrected,this.treeScale,this.path,i),e.layout&&!e.target&&(1!==this.treeScale.x||1!==this.treeScale.y)&&(e.target=e.layout.layoutBox,e.targetWithTransforms=(0,U.createBox)());let{target:l}=e;if(!l){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}this.projectionDelta&&this.prevProjectionDelta?(tS(this.prevProjectionDelta.x,this.projectionDelta.x),tS(this.prevProjectionDelta.y,this.projectionDelta.y)):this.createProjectionDeltas(),S(this.projectionDelta,this.layoutCorrected,l,this.latestValues),this.treeScale.x===n&&this.treeScale.y===a&&tI(this.projectionDelta.x,this.prevProjectionDelta.x)&&tI(this.projectionDelta.y,this.prevProjectionDelta.y)||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",l)),t1&&t0.recalculatedProjection++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(){var t;let e=!(arguments.length>0)||void 0===arguments[0]||arguments[0];if(null==(t=this.options.visualElement)||t.scheduleRender(),e){let t=this.getStack();t&&t.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=(0,U.createDelta)(),this.projectionDelta=(0,U.createDelta)(),this.projectionDeltaWithTransform=(0,U.createDelta)()}setAnimationOrigin(t){let e,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1],s=this.snapshot,o=s?s.latestValues:{},r={...this.latestValues},n=(0,U.createDelta)();this.relativeParent&&this.relativeParent.options.layoutRoot||(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!i;let a=(0,U.createBox)(),l=(s?s.source:void 0)!==(this.layout?this.layout.source:void 0),h=this.getStack(),u=!h||h.members.length<=1,c=!!(l&&!u&&!0===this.options.crossfade&&!this.path.some(ed));this.animationProgress=0,this.mixTargetDelta=i=>{let s=i/1e3;if(eu(n.x,t.x,s),eu(n.y,t.y,s),this.setTargetDelta(n),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout){var h,d,m,p,v,g;V(a,this.layout.layoutBox,this.relativeParent.layout.layoutBox),m=this.relativeTarget,p=this.relativeTargetOrigin,v=a,g=s,ec(m.x,p.x,v.x,g),ec(m.y,p.y,v.y,g),e&&(h=this.relativeTarget,d=e,tU(h.x,d.x)&&tU(h.y,d.y))&&(this.isProjectionDirty=!1),e||(e=(0,U.createBox)()),tA(e,this.relativeTarget)}l&&(this.animationValues=r,function(t,e,i,s,o,r){o?(t.opacity=(0,D.mixNumber)(0,void 0!==i.opacity?i.opacity:1,tT(s)),t.opacityExit=(0,D.mixNumber)(void 0!==e.opacity?e.opacity:1,0,tD(s))):r&&(t.opacity=(0,D.mixNumber)(void 0!==e.opacity?e.opacity:1,void 0!==i.opacity?i.opacity:1,s));for(let o=0;o<tf;o++){let r="border".concat(tg[o],"Radius"),n=tP(e,r),a=tP(i,r);(void 0!==n||void 0!==a)&&(n||(n=0),a||(a=0),0===n||0===a||tx(n)===tx(a)?(t[r]=Math.max((0,D.mixNumber)(ty(n),ty(a),s),0),(W.percent.test(a)||W.percent.test(n))&&(t[r]+="%")):t[r]=a)}(e.rotate||i.rotate)&&(t.rotate=(0,D.mixNumber)(e.rotate||0,i.rotate||0,s))}(r,o,this.latestValues,s,c,u)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=s},this.mixTargetDelta(1e3*!!this.options.layoutRoot)}startAnimation(t){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&((0,p.cancelFrame)(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=p.frame.update(()=>{tr.hasAnimatedSinceResize=!0,this.currentAnimation=tQ(0,1e3,{...t,onUpdate:e=>{this.mixTargetDelta(e),t.onUpdate&&t.onUpdate(e)},onComplete:()=>{t.onComplete&&t.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);let t=this.getStack();t&&t.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){let t=this.getLead(),{targetWithTransforms:e,target:i,layout:s,latestValues:o}=t;if(e&&i&&s){if(this!==t&&this.layout&&s&&ef(this.options.animationType,this.layout.layoutBox,s.layoutBox)){i=this.target||(0,U.createBox)();let e=E(this.layout.layoutBox.x);i.x.min=t.target.x.min,i.x.max=i.x.min+e;let s=E(this.layout.layoutBox.y);i.y.min=t.target.y.min,i.y.max=i.y.min+s}tA(e,i),(0,tB.transformBox)(e,o),S(this.projectionDeltaWithTransform,this.layoutCorrected,e,o)}}registerSharedNode(t,e){this.sharedNodes.has(t)||this.sharedNodes.set(t,new tz),this.sharedNodes.get(t).add(e);let i=e.options.initialPromotionConfig;e.promote({transition:i?i.transition:void 0,preserveFollowOpacity:i&&i.shouldPreserveFollowOpacity?i.shouldPreserveFollowOpacity(e):void 0})}isLead(){let t=this.getStack();return!t||t.lead===this}getLead(){var t;let{layoutId:e}=this.options;return e&&(null==(t=this.getStack())?void 0:t.lead)||this}getPrevLead(){var t;let{layoutId:e}=this.options;return e?null==(t=this.getStack())?void 0:t.prevLead:void 0}getStack(){let{layoutId:t}=this.options;if(t)return this.root.sharedNodes.get(t)}promote(){let{needsReset:t,transition:e,preserveFollowOpacity:i}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},s=this.getStack();s&&s.promote(this,i),t&&(this.projectionDelta=void 0,this.needsReset=!0),e&&this.setOptions({transition:e})}relegate(){let t=this.getStack();return!!t&&t.relegate(this)}resetSkewAndRotation(){let{visualElement:t}=this.options;if(!t)return;let e=!1,{latestValues:i}=t;if((i.z||i.rotate||i.rotateX||i.rotateY||i.rotateZ||i.skewX||i.skewY)&&(e=!0),!e)return;let s={};i.z&&t6("z",t,s,this.animationValues);for(let e=0;e<t2.length;e++)t6("rotate".concat(t2[e]),t,s,this.animationValues),t6("skew".concat(t2[e]),t,s,this.animationValues);for(let e in t.render(),s)t.setStaticValue(e,s[e]),this.animationValues&&(this.animationValues[e]=s[e]);t.scheduleRender()}getProjectionStyles(t){var e,i;if(!this.instance||this.isSVG)return;if(!this.isVisible)return t3;let s={visibility:""},o=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,s.opacity="",s.pointerEvents=(0,tY.resolveMotionValue)(null==t?void 0:t.pointerEvents)||"",s.transform=o?o(this.latestValues,""):"none",s;let r=this.getLead();if(!this.projectionDelta||!this.layout||!r.target){let e={};return this.options.layoutId&&(e.opacity=void 0!==this.latestValues.opacity?this.latestValues.opacity:1,e.pointerEvents=(0,tY.resolveMotionValue)(null==t?void 0:t.pointerEvents)||""),this.hasProjected&&!(0,tG.hasTransform)(this.latestValues)&&(e.transform=o?o({},""):"none",this.hasProjected=!1),e}let n=r.animationValues||r.latestValues;this.applyTransformsToTarget(),s.transform=function(t,e,i){let s="",o=t.x.translate/e.x,r=t.y.translate/e.y,n=(null==i?void 0:i.z)||0;if((o||r||n)&&(s="translate3d(".concat(o,"px, ").concat(r,"px, ").concat(n,"px) ")),(1!==e.x||1!==e.y)&&(s+="scale(".concat(1/e.x,", ").concat(1/e.y,") ")),i){let{transformPerspective:t,rotate:e,rotateX:o,rotateY:r,skewX:n,skewY:a}=i;t&&(s="perspective(".concat(t,"px) ").concat(s)),e&&(s+="rotate(".concat(e,"deg) ")),o&&(s+="rotateX(".concat(o,"deg) ")),r&&(s+="rotateY(".concat(r,"deg) ")),n&&(s+="skewX(".concat(n,"deg) ")),a&&(s+="skewY(".concat(a,"deg) "))}let a=t.x.scale*e.x,l=t.y.scale*e.y;return(1!==a||1!==l)&&(s+="scale(".concat(a,", ").concat(l,")")),s||"none"}(this.projectionDeltaWithTransform,this.treeScale,n),o&&(s.transform=o(n,s.transform));let{x:a,y:l}=this.projectionDelta;for(let t in s.transformOrigin="".concat(100*a.origin,"% ").concat(100*l.origin,"% 0"),r.animationValues?s.opacity=r===this?null!=(i=null!=(e=n.opacity)?e:this.latestValues.opacity)?i:1:this.preserveOpacity?this.latestValues.opacity:n.opacityExit:s.opacity=r===this?void 0!==n.opacity?n.opacity:"":void 0!==n.opacityExit?n.opacityExit:0,th.scaleCorrectors){if(void 0===n[t])continue;let{correct:e,applyTo:i}=th.scaleCorrectors[t],o="none"===s.transform?n[t]:e(n[t],r);if(i){let t=i.length;for(let e=0;e<t;e++)s[i[e]]=o}else s[t]=o}return this.options.layoutId&&(s.pointerEvents=r===this?(0,tY.resolveMotionValue)(null==t?void 0:t.pointerEvents)||"":"none"),s}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(t=>{var e;return null==(e=t.currentAnimation)?void 0:e.stop()}),this.root.nodes.forEach(ei),this.root.sharedNodes.clear()}constructor(t={},e=null==i?void 0:i()){this.id=t5++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,t1&&(t0.totalNodes=t0.resolvedTargetDeltas=t0.recalculatedProjection=0),this.nodes.forEach(t7),this.nodes.forEach(en),this.nodes.forEach(ea),this.nodes.forEach(et),t1&&window.MotionDebug.record(t0)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=t,this.root=e?e.root||e:this,this.path=e?[...e.path,e]:[],this.parent=e,this.depth=e?e.depth+1:0;for(let t=0;t<this.path.length;t++)this.path[t].shouldResetTransform=!0;this.root===this&&(this.nodes=new tX)}}}function t4(t){t.updateLayout()}function t9(t){var e;let i=(null==(e=t.resumeFrom)?void 0:e.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&i&&t.hasListeners("didUpdate")){let{layoutBox:e,measuredBox:s}=t.layout,{animationType:o}=t.options,r=i.source!==t.layout.source;"size"===o?F(t=>{let s=r?i.measuredBox[t]:i.layoutBox[t],o=E(s);s.min=e[t].min,s.max=s.min+o}):ef(o,i.layoutBox,e)&&F(s=>{let o=r?i.measuredBox[s]:i.layoutBox[s],n=E(e[s]);o.max=o.min+n,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[s].max=t.relativeTarget[s].min+n)});let n=(0,U.createDelta)();S(n,e,i.layoutBox);let a=(0,U.createDelta)();r?S(a,t.applyTransform(s,!0),i.measuredBox):S(a,e,i.layoutBox);let l=!tk(n),h=!1;if(!t.resumeFrom){let s=t.getClosestProjectingParent();if(s&&!s.resumeFrom){let{snapshot:o,layout:r}=s;if(o&&r){let n=(0,U.createBox)();V(n,i.layoutBox,o.layoutBox);let a=(0,U.createBox)();V(a,e,r.layoutBox),tO(n,a)||(h=!0),s.options.layoutRoot&&(t.relativeTarget=a,t.relativeTargetOrigin=n,t.relativeParent=s)}}}t.notifyListeners("didUpdate",{layout:e,snapshot:i,delta:a,layoutDelta:n,hasLayoutChanged:l,hasRelativeTargetChanged:h})}else if(t.isLead()){let{onExitComplete:e}=t.options;e&&e()}t.options.transition=void 0}function t7(t){t1&&t0.totalNodes++,t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function et(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function ee(t){t.clearSnapshot()}function ei(t){t.clearMeasurements()}function es(t){t.isLayoutDirty=!1}function eo(t){let{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function er(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function en(t){t.resolveTargetDelta()}function ea(t){t.calcProjection()}function el(t){t.resetSkewAndRotation()}function eh(t){t.removeLeadSnapshot()}function eu(t,e,i){t.translate=(0,D.mixNumber)(e.translate,0,i),t.scale=(0,D.mixNumber)(e.scale,1,i),t.origin=e.origin,t.originPoint=e.originPoint}function ec(t,e,i,s){t.min=(0,D.mixNumber)(e.min,i.min,s),t.max=(0,D.mixNumber)(e.max,i.max,s)}function ed(t){return t.animationValues&&void 0!==t.animationValues.opacityExit}let em={duration:.45,ease:[.4,0,.1,1]},ep=t=>"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),ev=ep("applewebkit/")&&!ep("chrome/")?Math.round:o.noop;function eg(t){t.min=ev(t.min),t.max=ev(t.max)}function ef(t,e,i){return"position"===t||"preserve-aspect"===t&&!R(tN(e),tN(i),.2)}function ey(t){var e;return t!==t.root&&(null==(e=t.scroll)?void 0:e.wasRoot)}let ex=t8({attachResizeListener:(t,e)=>(0,I.addDomEvent)(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),eP={current:void 0},eT=t8({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!eP.current){let t=new ex({});t.mount(window),t.setOptions({layoutScroll:!0}),eP.current=t}return eP.current},resetTransform:(t,e)=>{t.style.transform=void 0!==e?e:"none"},checkIsScrollRoot:t=>"fixed"===window.getComputedStyle(t).position}),eD={pan:{Feature:J},drag:{Feature:K,ProjectionNode:eT,MeasureLayout:td}};var eE=t.i(277);t.s({layout:()=>eR},500788);let eR={layout:{ProjectionNode:eT,MeasureLayout:td}};var eA=t.i(829817),eS=t.i(397129);let eB=(0,eA.createMotionComponentFactory)({...i.animations,...eE.gestureAnimations,...eD,...eR},eS.createDomVisualElement),ej=(0,e.createDOMMotionComponentProxy)(eB)},[516462,697246,968242,836491,410633,533268,190786,478040,132800,500788]]}]); //# sourceMappingURL=4f84ce39f338c120.js.map