import{r as m,R as we}from"./vendor.38e754a4.js";/*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */var Ae=function(t,e){return Ae=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(r[o]=n[o])},Ae(t,e)};function _r(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");Ae(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var g=function(){return g=Object.assign||function(e){for(var r,n=1,o=arguments.length;n=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function R(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),o,a=[],i;try{for(;(e===void 0||e-- >0)&&!(o=n.next()).done;)a.push(o.value)}catch(s){i={error:s}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(i)throw i.error}}return a}function K(t,e){for(var r=0,n=e.length,o=t.length;rperformance.now():()=>Date.now(),Yr=typeof window!="undefined"?t=>window.requestAnimationFrame(t):t=>setTimeout(()=>t(Ni()),Kr);function Hi(t){let e=[],r=[],n=0,o=!1,a=!1;const i=new WeakSet,s={schedule:(u,l=!1,c=!1)=>{const v=c&&o,d=v?e:r;return l&&i.add(u),d.indexOf(u)===-1&&(d.push(u),v&&o&&(n=e.length)),u},cancel:u=>{const l=r.indexOf(u);l!==-1&&r.splice(l,1),i.delete(u)},process:u=>{if(o){a=!0;return}if(o=!0,[e,r]=[r,e],r.length=0,n=e.length,n)for(let l=0;l(t[e]=Hi(()=>Lt=!0),t),{}),$=Dt.reduce((t,e)=>{const r=ne[e];return t[e]=(n,o=!1,a=!1)=>(Lt||ki(),r.schedule(n,o,a)),t},{}),St=Dt.reduce((t,e)=>(t[e]=ne[e].cancel,t),{}),De=Dt.reduce((t,e)=>(t[e]=()=>ne[e].process(bt),t),{}),Gi=t=>ne[t].process(bt),Wr=t=>{Lt=!1,bt.delta=Oe?Kr:Math.max(Math.min(t-bt.timestamp,zi),1),bt.timestamp=t,Le=!0,Dt.forEach(Gi),Le=!1,Lt&&(Oe=!1,Yr(Wr))},ki=()=>{Lt=!0,Oe=!0,Le||Yr(Wr)},oe=()=>bt;/*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */function Xr(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(t);oMath.min(Math.max(r,t),e),Ie=.001,Ki=.01,$r=10,Yi=.05,Wi=1;function Xi({duration:t=800,bounce:e=.25,velocity:r=0,mass:n=1}){let o,a;Oi(t<=$r*1e3);let i=1-e;i=ie(Yi,Wi,i),t=ie(Ki,$r,t/1e3),i<1?(o=l=>{const c=l*i,v=c*t,d=c-r,f=Fe(l,i),p=Math.exp(-v);return Ie-d/f*p},a=l=>{const v=l*i*t,d=v*r+r,f=Math.pow(i,2)*Math.pow(l,2)*t,p=Math.exp(-v),h=Fe(Math.pow(l,2),i);return(-o(l)+Ie>0?-1:1)*((d-f)*p)/h}):(o=l=>{const c=Math.exp(-l*t),v=(l-r)*t+1;return-Ie+c*v},a=l=>{const c=Math.exp(-l*t),v=(r-l)*(t*t);return c*v});const s=5/t,u=Zi(o,a,s);if(t=t*1e3,isNaN(u))return{stiffness:100,damping:10,duration:t};{const l=Math.pow(u,2)*n;return{stiffness:l,damping:i*2*Math.sqrt(n*l),duration:t}}}const $i=12;function Zi(t,e,r){let n=r;for(let o=1;o<$i;o++)n=n-t(n)/e(n);return n}function Fe(t,e){return t*Math.sqrt(1-e*e)}const qi=["duration","bounce"],Ji=["stiffness","damping","mass"];function Zr(t,e){return e.some(r=>t[r]!==void 0)}function Qi(t){let e=Object.assign({velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1},t);if(!Zr(t,Ji)&&Zr(t,qi)){const r=Xi(t);e=Object.assign(Object.assign(Object.assign({},e),r),{velocity:0,mass:1}),e.isResolvedFromDuration=!0}return e}function je(t){var{from:e=0,to:r=1,restSpeed:n=2,restDelta:o}=t,a=Xr(t,["from","to","restSpeed","restDelta"]);const i={done:!1,value:e};let{stiffness:s,damping:u,mass:l,velocity:c,duration:v,isResolvedFromDuration:d}=Qi(a),f=qr,p=qr;function h(){const x=c?-(c/1e3):0,y=r-e,b=u/(2*Math.sqrt(s*l)),S=Math.sqrt(s/l)/1e3;if(o!=null||(o=Math.abs(r-e)<=1?.01:.4),b<1){const P=Fe(S,b);f=V=>{const A=Math.exp(-b*S*V);return r-A*((x+b*S*y)/P*Math.sin(P*V)+y*Math.cos(P*V))},p=V=>{const A=Math.exp(-b*S*V);return b*S*A*(Math.sin(P*V)*(x+b*S*y)/P+y*Math.cos(P*V))-A*(Math.cos(P*V)*(x+b*S*y)-P*y*Math.sin(P*V))}}else if(b===1)f=P=>r-Math.exp(-S*P)*(y+(x+S*y)*P);else{const P=S*Math.sqrt(b*b-1);f=V=>{const A=Math.exp(-b*S*V),O=Math.min(P*V,300);return r-A*((x+b*S*y)*Math.sinh(O)+P*y*Math.cosh(O))/P}}}return h(),{next:x=>{const y=f(x);if(d)i.done=x>=v;else{const b=p(x)*1e3,S=Math.abs(b)<=n,P=Math.abs(r-y)<=o;i.done=S&&P}return i.value=i.done?r:y,i},flipTarget:()=>{c=-c,[e,r]=[r,e],h()}}}je.needsInterpolation=(t,e)=>typeof t=="string"||typeof e=="string";const qr=t=>0,It=(t,e,r)=>{const n=e-t;return n===0?1:(r-t)/n},I=(t,e,r)=>-r*t+r*e+t,Jr=(t,e)=>r=>Math.max(Math.min(r,e),t),Ft=t=>t%1?Number(t.toFixed(5)):t,jt=/(-)?([\d]*\.?[\d])+/g,Be=/(#[0-9a-f]{6}|#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2,3}\s*\/*\s*[\d\.]+%?\))/gi,ta=/^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2,3}\s*\/*\s*[\d\.]+%?\))$/i;function Bt(t){return typeof t=="string"}const lt={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},_t=Object.assign(Object.assign({},lt),{transform:Jr(0,1)}),ae=Object.assign(Object.assign({},lt),{default:1}),Ut=t=>({test:e=>Bt(e)&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),nt=Ut("deg"),ot=Ut("%"),C=Ut("px"),ea=Ut("vh"),ra=Ut("vw"),Qr=Object.assign(Object.assign({},ot),{parse:t=>ot.parse(t)/100,transform:t=>ot.transform(t*100)}),_e=(t,e)=>r=>Boolean(Bt(r)&&ta.test(r)&&r.startsWith(t)||e&&Object.prototype.hasOwnProperty.call(r,e)),tn=(t,e,r)=>n=>{if(!Bt(n))return n;const[o,a,i,s]=n.match(jt);return{[t]:parseFloat(o),[e]:parseFloat(a),[r]:parseFloat(i),alpha:s!==void 0?parseFloat(s):1}},ct={test:_e("hsl","hue"),parse:tn("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:r,alpha:n=1})=>"hsla("+Math.round(t)+", "+ot.transform(Ft(e))+", "+ot.transform(Ft(r))+", "+Ft(_t.transform(n))+")"},na=Jr(0,255),Ue=Object.assign(Object.assign({},lt),{transform:t=>Math.round(na(t))}),it={test:_e("rgb","red"),parse:tn("red","green","blue"),transform:({red:t,green:e,blue:r,alpha:n=1})=>"rgba("+Ue.transform(t)+", "+Ue.transform(e)+", "+Ue.transform(r)+", "+Ft(_t.transform(n))+")"};function oa(t){let e="",r="",n="",o="";return t.length>5?(e=t.substr(1,2),r=t.substr(3,2),n=t.substr(5,2),o=t.substr(7,2)):(e=t.substr(1,1),r=t.substr(2,1),n=t.substr(3,1),o=t.substr(4,1),e+=e,r+=r,n+=n,o+=o),{red:parseInt(e,16),green:parseInt(r,16),blue:parseInt(n,16),alpha:o?parseInt(o,16)/255:1}}const Ne={test:_e("#"),parse:oa,transform:it.transform},H={test:t=>it.test(t)||Ne.test(t)||ct.test(t),parse:t=>it.test(t)?it.parse(t):ct.test(t)?ct.parse(t):Ne.parse(t),transform:t=>Bt(t)?t:t.hasOwnProperty("red")?it.transform(t):ct.transform(t)},en="${c}",rn="${n}";function ia(t){var e,r,n,o;return isNaN(t)&&Bt(t)&&((r=(e=t.match(jt))===null||e===void 0?void 0:e.length)!==null&&r!==void 0?r:0)+((o=(n=t.match(Be))===null||n===void 0?void 0:n.length)!==null&&o!==void 0?o:0)>0}function nn(t){typeof t=="number"&&(t=`${t}`);const e=[];let r=0;const n=t.match(Be);n&&(r=n.length,t=t.replace(Be,en),e.push(...n.map(H.parse)));const o=t.match(jt);return o&&(t=t.replace(jt,rn),e.push(...o.map(lt.parse))),{values:e,numColors:r,tokenised:t}}function on(t){return nn(t).values}function an(t){const{values:e,numColors:r,tokenised:n}=nn(t),o=e.length;return a=>{let i=n;for(let s=0;stypeof t=="number"?0:t;function sa(t){const e=on(t);return an(t)(e.map(aa))}const tt={test:ia,parse:on,createTransformer:an,getAnimatableNone:sa},ua=new Set(["brightness","contrast","saturate","opacity"]);function la(t){let[e,r]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[n]=r.match(jt)||[];if(!n)return t;const o=r.replace(n,"");let a=ua.has(e)?1:0;return n!==r&&(a*=100),e+"("+a+o+")"}const ca=/([a-z-]*)\(.*?\)/g,He=Object.assign(Object.assign({},tt),{getAnimatableNone:t=>{const e=t.match(ca);return e?e.map(la).join(" "):t}});function ze(t,e,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+(e-t)*6*r:r<1/2?e:r<2/3?t+(e-t)*(2/3-r)*6:t}function sn({hue:t,saturation:e,lightness:r,alpha:n}){t/=360,e/=100,r/=100;let o=0,a=0,i=0;if(!e)o=a=i=r;else{const s=r<.5?r*(1+e):r+e-r*e,u=2*r-s;o=ze(u,s,t+1/3),a=ze(u,s,t),i=ze(u,s,t-1/3)}return{red:Math.round(o*255),green:Math.round(a*255),blue:Math.round(i*255),alpha:n}}const fa=(t,e,r)=>{const n=t*t,o=e*e;return Math.sqrt(Math.max(0,r*(o-n)+n))},da=[Ne,it,ct],un=t=>da.find(e=>e.test(t)),ln=(t,e)=>{let r=un(t),n=un(e),o=r.parse(t),a=n.parse(e);r===ct&&(o=sn(o),r=it),n===ct&&(a=sn(a),n=it);const i=Object.assign({},o);return s=>{for(const u in i)u!=="alpha"&&(i[u]=fa(o[u],a[u],s));return i.alpha=I(o.alpha,a.alpha,s),r.transform(i)}},Ge=t=>typeof t=="number",va=(t,e)=>r=>e(t(r)),se=(...t)=>t.reduce(va);function cn(t,e){return Ge(t)?r=>I(t,e,r):H.test(t)?ln(t,e):vn(t,e)}const fn=(t,e)=>{const r=[...t],n=r.length,o=t.map((a,i)=>cn(a,e[i]));return a=>{for(let i=0;i{const r=Object.assign(Object.assign({},t),e),n={};for(const o in r)t[o]!==void 0&&e[o]!==void 0&&(n[o]=cn(t[o],e[o]));return o=>{for(const a in n)r[a]=n[a](o);return r}};function dn(t){const e=tt.parse(t),r=e.length;let n=0,o=0,a=0;for(let i=0;i{const r=tt.createTransformer(e),n=dn(t),o=dn(e);return n.numHSL===o.numHSL&&n.numRGB===o.numRGB&&n.numNumbers>=o.numNumbers?se(fn(n.parsed,o.parsed),r):i=>`${i>0?e:t}`},ha=(t,e)=>r=>I(t,e,r);function ma(t){if(typeof t=="number")return ha;if(typeof t=="string")return H.test(t)?ln:vn;if(Array.isArray(t))return fn;if(typeof t=="object")return pa}function ga(t,e,r){const n=[],o=r||ma(t[0]),a=t.length-1;for(let i=0;ir(It(t,e,n))}function xa(t,e){const r=t.length,n=r-1;return o=>{let a=0,i=!1;if(o<=t[0]?i=!0:o>=t[n]&&(a=n-1,i=!0),!i){let u=1;for(;uo||u===n);u++);a=u-1}const s=It(t[a],t[a+1],o);return e[a](s)}}function ke(t,e,{clamp:r=!0,ease:n,mixer:o}={}){const a=t.length;Jt(a===e.length),Jt(!n||!Array.isArray(n)||n.length===a-1),t[0]>t[a-1]&&(t=[].concat(t),e=[].concat(e),t.reverse(),e.reverse());const i=ga(e,n,o),s=a===2?ya(t,i):xa(t,i);return r?u=>s(ie(t[0],t[a-1],u)):s}const ue=t=>e=>1-t(1-e),Ke=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,ba=t=>e=>Math.pow(e,t),pn=t=>e=>e*e*((t+1)*e-t),Sa=t=>{const e=pn(t);return r=>(r*=2)<1?.5*e(r):.5*(2-Math.pow(2,-10*(r-1)))},hn=1.525,Pa=4/11,Ta=8/11,Va=9/10,Ye=t=>t,We=ba(2),Ca=ue(We),mn=Ke(We),gn=t=>1-Math.sin(Math.acos(t)),Xe=ue(gn),Ea=Ke(Xe),$e=pn(hn),wa=ue($e),Aa=Ke($e),Ma=Sa(hn),Ra=4356/361,Oa=35442/1805,La=16061/1805,le=t=>{if(t===1||t===0)return t;const e=t*t;return tt<.5?.5*(1-le(1-t*2)):.5*le(t*2-1)+.5;function Fa(t,e){return t.map(()=>e||mn).splice(0,t.length-1)}function ja(t){const e=t.length;return t.map((r,n)=>n!==0?n/(e-1):0)}function Ba(t,e){return t.map(r=>r*e)}function ce({from:t=0,to:e=1,ease:r,offset:n,duration:o=300}){const a={done:!1,value:t},i=Array.isArray(e)?e:[t,e],s=Ba(n&&n.length===i.length?n:ja(i),o);function u(){return ke(s,i,{ease:Array.isArray(r)?r:Fa(i,r)})}let l=u();return{next:c=>(a.value=l(c),a.done=c>=o,a),flipTarget:()=>{i.reverse(),l=u()}}}function _a({velocity:t=0,from:e=0,power:r=.8,timeConstant:n=350,restDelta:o=.5,modifyTarget:a}){const i={done:!1,value:e};let s=r*t;const u=e+s,l=a===void 0?u:a(u);return l!==u&&(s=l-e),{next:c=>{const v=-s*Math.exp(-c/n);return i.done=!(v>o||v<-o),i.value=i.done?l:l+v,i},flipTarget:()=>{}}}const yn={keyframes:ce,spring:je,decay:_a};function Ua(t){if(Array.isArray(t.to))return ce;if(yn[t.type])return yn[t.type];const e=new Set(Object.keys(t));return e.has("ease")||e.has("duration")&&!e.has("dampingRatio")?ce:e.has("dampingRatio")||e.has("stiffness")||e.has("mass")||e.has("damping")||e.has("restSpeed")||e.has("restDelta")?je:ce}function xn(t,e,r=0){return t-e-r}function Na(t,e,r=0,n=!0){return n?xn(e+-t,e,r):e-(t-e)+r}function Ha(t,e,r,n){return n?t>=e+r:t<=-r}const za=t=>{const e=({delta:r})=>t(r);return{start:()=>$.update(e,!0),stop:()=>St.update(e)}};function Ze(t){var e,r,{from:n,autoplay:o=!0,driver:a=za,elapsed:i=0,repeat:s=0,repeatType:u="loop",repeatDelay:l=0,onPlay:c,onStop:v,onComplete:d,onRepeat:f,onUpdate:p}=t,h=Xr(t,["from","autoplay","driver","elapsed","repeat","repeatType","repeatDelay","onPlay","onStop","onComplete","onRepeat","onUpdate"]);let{to:x}=h,y,b=0,S=h.duration,P,V=!1,A=!0,O;const w=Ua(h);((r=(e=w).needsInterpolation)===null||r===void 0?void 0:r.call(e,n,x))&&(O=ke([0,100],[n,x],{clamp:!1}),n=0,x=100);const M=w(Object.assign(Object.assign({},h),{from:n,to:x}));function F(){b++,u==="reverse"?(A=b%2==0,i=Na(i,S,l,A)):(i=xn(i,S,l),u==="mirror"&&M.flipTarget()),V=!1,f&&f()}function _(){y.stop(),d&&d()}function z(Z){if(A||(Z=-Z),i+=Z,!V){const rt=M.next(Math.max(0,i));P=rt.value,O&&(P=O(P)),V=A?rt.done:i<=0}p==null||p(P),V&&(b===0&&(S!=null||(S=i)),b{v==null||v(),y.stop()}}}function bn(t,e){return e?t*(1e3/e):0}function Ga({from:t=0,velocity:e=0,min:r,max:n,power:o=.8,timeConstant:a=750,bounceStiffness:i=500,bounceDamping:s=10,restDelta:u=1,modifyTarget:l,driver:c,onUpdate:v,onComplete:d,onStop:f}){let p;function h(S){return r!==void 0&&Sn}function x(S){return r===void 0?n:n===void 0||Math.abs(r-S){var V;v==null||v(P),(V=S.onUpdate)===null||V===void 0||V.call(S,P)},onComplete:d,onStop:f}))}function b(S){y(Object.assign({type:"spring",stiffness:i,damping:s,restDelta:u},S))}if(h(t))b({from:t,velocity:e,to:x(t)});else{let S=o*e+t;typeof l!="undefined"&&(S=l(S));const P=x(S),V=P===r?-1:1;let A,O;const w=M=>{A=O,O=M,e=bn(M-A,oe().delta),(V===1&&M>P||V===-1&&Mp==null?void 0:p.stop()}}const qe=t=>t.hasOwnProperty("x")&&t.hasOwnProperty("y"),Sn=t=>qe(t)&&t.hasOwnProperty("z"),fe=(t,e)=>Math.abs(t-e);function Pn(t,e){if(Ge(t)&&Ge(e))return fe(t,e);if(qe(t)&&qe(e)){const r=fe(t.x,e.x),n=fe(t.y,e.y),o=Sn(t)&&Sn(e)?fe(t.z,e.z):0;return Math.sqrt(Math.pow(r,2)+Math.pow(n,2)+Math.pow(o,2))}}const ka=(t,e,r)=>{const n=e-t;return((r-t)%n+n)%n+t},Tn=(t,e)=>1-3*e+3*t,Vn=(t,e)=>3*e-6*t,Cn=t=>3*t,de=(t,e,r)=>((Tn(e,r)*t+Vn(e,r))*t+Cn(e))*t,En=(t,e,r)=>3*Tn(e,r)*t*t+2*Vn(e,r)*t+Cn(e),Ka=1e-7,Ya=10;function Wa(t,e,r,n,o){let a,i,s=0;do i=e+(r-e)/2,a=de(i,n,o)-t,a>0?r=i:e=i;while(Math.abs(a)>Ka&&++s=$a?Za(i,v,t,r):d===0?v:Wa(i,s,s+pe,t,r)}return i=>i===0||i===1?i:de(a(i),e,n)}function Je(t,e){t.indexOf(e)===-1&&t.push(e)}function Qe(t,e){var r=t.indexOf(e);r>-1&&t.splice(r,1)}function Ja(t,e,r){var n=R(t),o=n.slice(0),a=e<0?o.length+e:e;if(a>=0&&ae?1:r(It(t,e,n))}}function Bn(t,e){t.min=e.min,t.max=e.max}function q(t,e){Bn(t.x,e.x),Bn(t.y,e.y)}function ir(t){return t===void 0||t===1}function _n(t){var e=t.scale,r=t.scaleX,n=t.scaleY;return!ir(e)||!ir(r)||!ir(n)}function at(t){return _n(t)||Un(t.x)||Un(t.y)||t.z||t.rotate||t.rotateX||t.rotateY}function Un(t){return t&&t!=="0%"}function ge(t,e,r){var n=t-r,o=e*n;return r+o}function Nn(t,e,r,n,o){return o!==void 0&&(t=ge(t,o,n)),ge(t,r,n)+e}function ar(t,e,r,n,o){e===void 0&&(e=0),r===void 0&&(r=1),t.min=Nn(t.min,e,r,n,o),t.max=Nn(t.max,e,r,n,o)}function Hn(t,e){var r=e.x,n=e.y;ar(t.x,r.translate,r.scale,r.originPoint),ar(t.y,n.translate,n.scale,n.originPoint)}function gs(t,e,r,n){var o,a;n===void 0&&(n=!1);var i=r.length;if(!!i){e.x=e.y=1;for(var s,u,l=0;l=0;o--){var a=this.members[o];if(a.isPresent!==!1){n=a;break}}return n?(this.promote(n),!0):!1},t.prototype.promote=function(e,r){var n,o=this.lead;if(e!==o&&(this.prevLead=o,this.lead=e,e.show(),o)){o.instance&&o.scheduleRender(),e.scheduleRender(),e.resumeFrom=o,r&&(e.resumeFrom.preserveOpacity=!0),o.snapshot&&(e.snapshot=o.snapshot,e.snapshot.latestValues=o.animationValues||o.latestValues,e.snapshot.isShared=!0),((n=e.root)===null||n===void 0?void 0:n.isUpdating)&&(e.isLayoutDirty=!0);var a=e.options.crossfade;a===!1&&o.hide()}},t.prototype.exitAnimationComplete=function(){this.members.forEach(function(e){var r,n,o,a,i;(n=(r=e.options).onExitComplete)===null||n===void 0||n.call(r),(i=(o=e.resumingFrom)===null||o===void 0?void 0:(a=o.options).onExitComplete)===null||i===void 0||i.call(a)})},t.prototype.scheduleRender=function(){this.members.forEach(function(e){e.instance&&e.scheduleRender(!1)})},t.prototype.removeLeadSnapshot=function(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)},t}(),ye={};function Cs(t){Object.assign(ye,t)}var Es="translate3d(0px, 0px, 0) scale(1, 1)";function eo(t,e,r){var n=t.x.translate/e.x,o=t.y.translate/e.y,a="translate3d("+n+"px, "+o+"px, 0) ";if(r){var i=r.rotate,s=r.rotateX,u=r.rotateY;i&&(a+="rotate("+i+"deg) "),s&&(a+="rotateX("+s+"deg) "),u&&(a+="rotateY("+u+"deg) ")}return a+="scale("+t.x.scale+", "+t.y.scale+")",a===Es?"none":a}function J(t){return[t("x"),t("y")]}var sr=["","X","Y","Z"],ws=["translate","scale","rotate","skew"],Kt=["transformPerspective","x","y","z"];ws.forEach(function(t){return sr.forEach(function(e){return Kt.push(t+e)})});function As(t,e){return Kt.indexOf(t)-Kt.indexOf(e)}var Ms=new Set(Kt);function xe(t){return Ms.has(t)}var Rs=new Set(["originX","originY","originZ"]);function ro(t){return Rs.has(t)}var Os=function(t,e){return t.depth-e.depth},Ls=function(){function t(){this.children=[],this.isDirty=!1}return t.prototype.add=function(e){Je(this.children,e),this.isDirty=!0},t.prototype.remove=function(e){Qe(this.children,e),this.isDirty=!0},t.prototype.forEach=function(e){this.isDirty&&this.children.sort(Os),this.isDirty=!1,this.children.forEach(e)},t}(),Ds=function(t){return Boolean(t&&typeof t=="object"&&t.mix&&t.toValue)},Is=function(t){return Ht(t)?t[t.length-1]||0:t};function be(t){var e=W(t)?t.get():t;return Ds(e)?e.toValue():e}var no=1e3,Yt={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function oo(t){var e=t.attachResizeListener,r=t.defaultParent,n=t.measureScroll,o=t.resetTransform;return function(){function a(i,s,u){var l=this;s===void 0&&(s={}),u===void 0&&(u=r==null?void 0:r()),this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.potentialNodes=new Map,this.checkUpdateFailed=function(){l.isUpdating&&(l.isUpdating=!1,l.clearAllSnapshots())},this.updateProjection=function(){l.nodes.forEach(Ns),l.nodes.forEach(Hs)},this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.id=i,this.latestValues=s,this.root=u?u.root||u:this,this.path=u?K(K([],R(u.path),!1),[u]):[],this.parent=u,this.depth=u?u.depth+1:0,i&&this.root.registerPotentialNode(i,this);for(var c=0;c=0;n--)if(Boolean(t.path[n].instance)){r=t.path[n];break}var o=r&&r!==t.root?r.instance:document,a=o.querySelector('[data-projection-id="'+e+'"]');a&&t.mount(a,!0)}function uo(t){t.min=Math.round(t.min),t.max=Math.round(t.max)}function lo(t){uo(t.x),uo(t.y)}var Xs=1;function $s(){return j(function(){if(Yt.hasEverUpdated)return Xs++})}var Wt=m.exports.createContext({}),co=m.exports.createContext({});function Zs(t,e,r,n){var o,a=e.layoutId,i=e.layout,s=e.drag,u=e.dragConstraints,l=e.layoutScroll,c=m.exports.useContext(co);!n||!r||(r==null?void 0:r.projection)||(r.projection=new n(t,r.getLatestValues(),(o=r.parent)===null||o===void 0?void 0:o.projection),r.projection.setOptions({layoutId:a,layout:i,alwaysMeasureLayout:Boolean(s)||u&&xt(u),visualElement:r,scheduleRender:function(){return r.scheduleRender()},animationType:typeof i=="string"?i:"both",initialPromotionConfig:c,layoutScroll:l}))}var qs=function(t){_r(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getSnapshotBeforeUpdate=function(){return this.updateProps(),null},e.prototype.componentDidUpdate=function(){},e.prototype.updateProps=function(){var r=this.props,n=r.visualElement,o=r.props;n&&n.setProps(o)},e.prototype.render=function(){return this.props.children},e}(we.Component);function fo(t){var e=t.preloadedFeatures,r=t.createVisualElement,n=t.projectionNodeConstructor,o=t.useRender,a=t.useVisualState,i=t.Component;e&&Me(e);function s(u,l){var c=Js(u);u=g(g({},u),{layoutId:c});var v=m.exports.useContext(gt),d=null,f=Ui(u),p=$s(),h=a(u,v.isStatic);return!v.isStatic&&Ot&&(f.visualElement=Ii(i,h,g(g({},v),u),r),Zs(p,u,f.visualElement,n||Rt.projectionNodeConstructor),d=Di(u,f.visualElement)),m.exports.createElement(qs,{visualElement:f.visualElement,props:g(g({},v),u)},d,m.exports.createElement(Qt.Provider,{value:f},o(i,u,p,Fi(h,f.visualElement,l),h,v.isStatic)))}return m.exports.forwardRef(s)}function Js(t){var e,r=t.layoutId,n=(e=m.exports.useContext(Wt))===null||e===void 0?void 0:e.id;return n&&r!==void 0?n+"-"+r:r}function vo(t){function e(n,o){return o===void 0&&(o={}),fo(t(n,o))}var r=new Map;return new Proxy(e,{get:function(n,o){return r.has(o)||r.set(o,e(o)),r.get(o)}})}var Qs=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","svg","switch","symbol","text","tspan","use","view"];function ur(t){return typeof t!="string"||t.includes("-")?!1:!!(Qs.indexOf(t)>-1||/[A-Z]/.test(t))}function po(t,e){var r=e.layout,n=e.layoutId;return xe(t)||ro(t)||(r||n!==void 0)&&(!!ye[t]||t==="opacity")}var tu={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"};function eu(t,e,r,n){var o=t.transform,a=t.transformKeys,i=e.enableHardwareAcceleration,s=i===void 0?!0:i,u=e.allowTransformNone,l=u===void 0?!0:u,c="";a.sort(As);for(var v=!1,d=a.length,f=0;fb&&_,rt=Array.isArray(F)?F:[F],ut=rt.reduce(a,{});z===!1&&(ut={});var At=M.prevResolvedValues,ht=At===void 0?{}:At,Zt=g(g({},ht),ut),mt=function(E){Z=!0,x.delete(E),M.needsAnimating[E]=!0};for(var G in Zt){var L=ut[G],T=ht[G];y.hasOwnProperty(G)||(L!==T?Ht(L)&&Ht(T)?Uo(L,T)?M.protectedKeys[G]=!0:mt(G):L!==void 0?mt(G):x.add(G):L!==void 0&&x.has(G)?mt(G):M.protectedKeys[G]=!0)}M.prevProp=F,M.prevResolvedValues=ut,M.isActive&&(y=g(g({},y),ut)),o&&t.blockInitialAnimation&&(Z=!1),Z&&!N&&h.push.apply(h,K([],R(rt.map(function(E){return{animation:E,options:g({type:w},c)}}))))},P=0;P=3;if(!(!f&&!p)){var h=d.point,x=oe().timestamp;o.history.push(g(g({},h),{timestamp:x}));var y=o.handlers,b=y.onStart,S=y.onMove;f||(b&&b(o.lastMoveEvent,d),o.startEvent=o.lastMoveEvent),S&&S(o.lastMoveEvent,d)}}},this.handlePointerMove=function(d,f){if(o.lastMoveEvent=d,o.lastMoveEventInfo=Er(f,o.transformPagePoint),Eo(d)&&d.buttons===0){o.handlePointerUp(d,f);return}$.update(o.updatePoint,!0)},this.handlePointerUp=function(d,f){o.end();var p=o.handlers,h=p.onEnd,x=p.onSessionEnd,y=wr(Er(f,o.transformPagePoint),o.history);o.startEvent&&h&&h(d,y),x&&x(d,y)},!(wo(e)&&e.touches.length>1)){this.handlers=r,this.transformPagePoint=i;var s=gr(e),u=Er(s,this.transformPagePoint),l=u.point,c=oe().timestamp;this.history=[g(g({},l),{timestamp:c})];var v=r.onSessionStart;v&&v(e,wr(u,this.history)),this.removeListeners=se(Vt(window,"pointermove",this.handlePointerMove),Vt(window,"pointerup",this.handlePointerUp),Vt(window,"pointercancel",this.handlePointerUp))}}return t.prototype.updateHandlers=function(e){this.handlers=e},t.prototype.end=function(){this.removeListeners&&this.removeListeners(),St.update(this.updatePoint)},t}();function Er(t,e){return e?{point:e(t.point)}:t}function Wo(t,e){return{x:t.x-e.x,y:t.y-e.y}}function wr(t,e){var r=t.point;return{point:r,delta:Wo(r,Xo(e)),offset:Wo(r,ll(e)),velocity:cl(e,.1)}}function ll(t){return t[0]}function Xo(t){return t[t.length-1]}function cl(t,e){if(t.length<2)return{x:0,y:0};for(var r=t.length-1,n=null,o=Xo(t);r>=0&&(n=t[r],!(o.timestamp-n.timestamp>he(e)));)r--;if(!n)return{x:0,y:0};var a=(o.timestamp-n.timestamp)/1e3;if(a===0)return{x:0,y:0};var i={x:(o.x-n.x)/a,y:(o.y-n.y)/a};return i.x===1/0&&(i.x=0),i.y===1/0&&(i.y=0),i}function fl(t,e,r){var n=e.min,o=e.max;return n!==void 0&&to&&(t=r?I(o,t,r.max):Math.min(t,o)),t}function $o(t,e,r){return{min:e!==void 0?t.min+e:void 0,max:r!==void 0?t.max+r-(t.max-t.min):void 0}}function dl(t,e){var r=e.top,n=e.left,o=e.bottom,a=e.right;return{x:$o(t.x,n,a),y:$o(t.y,r,o)}}function Zo(t,e){var r,n=e.min-t.min,o=e.max-t.max;return e.max-e.minn?r=It(e.min,e.max-n,t.min):n>o&&(r=It(t.min,t.max-o,e.min)),ie(0,1,r)}function hl(t,e){var r={};return e.min!==void 0&&(r.min=e.min-t.min),e.max!==void 0&&(r.max=e.max-t.min),r}var Ar=.35;function ml(t){return t===void 0&&(t=Ar),t===!1?t=0:t===!0&&(t=Ar),{x:qo(t,"left","right"),y:qo(t,"top","bottom")}}function qo(t,e,r){return{min:Jo(t,e),max:Jo(t,r)}}function Jo(t,e){var r;return typeof t=="number"?t:(r=t[e])!==null&&r!==void 0?r:0}function Qo(t){var e=t.top,r=t.left,n=t.right,o=t.bottom;return{x:{min:r,max:n},y:{min:e,max:o}}}function gl(t){var e=t.x,r=t.y;return{top:r.min,right:e.max,bottom:r.max,left:e.min}}function yl(t,e){if(!e)return t;var r=e({x:t.left,y:t.top}),n=e({x:t.right,y:t.bottom});return{top:r.y,left:r.x,bottom:n.y,right:n.x}}function ti(t,e){return Qo(yl(t.getBoundingClientRect(),e))}function xl(t,e,r){var n=ti(t,r),o=e.scroll;return o&&(Pt(n.x,o.x),Pt(n.y,o.y)),n}var bl=new WeakMap,Sl=function(){function t(e){this.openGlobalLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=B(),this.visualElement=e}return t.prototype.start=function(e,r){var n=this,o=r===void 0?{}:r,a=o.snapToCursor,i=a===void 0?!1:a;if(this.visualElement.isPresent!==!1){var s=function(v){n.stopAnimation(),i&&n.snapToCursor(gr(v,"page").point)},u=function(v,d){var f,p=n.getProps(),h=p.drag,x=p.dragPropagation,y=p.onDragStart;h&&!x&&(n.openGlobalLock&&n.openGlobalLock(),n.openGlobalLock=Do(h),!n.openGlobalLock)||(n.isDragging=!0,n.currentDirection=null,n.resolveConstraints(),n.visualElement.projection&&(n.visualElement.projection.isAnimationBlocked=!0,n.visualElement.projection.target=void 0),J(function(b){var S,P,V=n.getAxisMotionValue(b).get()||0;if(ot.test(V)){var A=(P=(S=n.visualElement.projection)===null||S===void 0?void 0:S.layout)===null||P===void 0?void 0:P.actual[b];if(A){var O=et(A);V=O*(parseFloat(V)/100)}}n.originPoint[b]=V}),y==null||y(v,d),(f=n.visualElement.animationState)===null||f===void 0||f.setActive(D.Drag,!0))},l=function(v,d){var f=n.getProps(),p=f.dragPropagation,h=f.dragDirectionLock,x=f.onDirectionLock,y=f.onDrag;if(!(!p&&!n.openGlobalLock)){var b=d.offset;if(h&&n.currentDirection===null){n.currentDirection=Pl(b),n.currentDirection!==null&&(x==null||x(n.currentDirection));return}n.updateAxis("x",d.point,b),n.updateAxis("y",d.point,b),n.visualElement.syncRender(),y==null||y(v,d)}},c=function(v,d){return n.stop(v,d)};this.panSession=new Yo(e,{onSessionStart:s,onStart:u,onMove:l,onSessionEnd:c},{transformPagePoint:this.visualElement.getTransformPagePoint()})}},t.prototype.stop=function(e,r){var n=this.isDragging;if(this.cancel(),!!n){var o=r.velocity;this.startAnimation(o);var a=this.getProps().onDragEnd;a==null||a(e,r)}},t.prototype.cancel=function(){var e,r;this.isDragging=!1,this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!1),(e=this.panSession)===null||e===void 0||e.end(),this.panSession=void 0;var n=this.getProps().dragPropagation;!n&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),(r=this.visualElement.animationState)===null||r===void 0||r.setActive(D.Drag,!1)},t.prototype.updateAxis=function(e,r,n){var o=this.getProps().drag;if(!(!n||!Te(e,o,this.currentDirection))){var a=this.getAxisMotionValue(e),i=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(i=fl(i,this.constraints[e],this.elastic[e])),a.set(i)}},t.prototype.resolveConstraints=function(){var e=this,r=this.getProps(),n=r.dragConstraints,o=r.dragElastic,a=(this.visualElement.projection||{}).layout,i=this.constraints;n&&xt(n)?this.constraints||(this.constraints=this.resolveRefConstraints()):n&&a?this.constraints=dl(a.actual,n):this.constraints=!1,this.elastic=ml(o),i!==this.constraints&&a&&this.constraints&&!this.hasMutatedConstraints&&J(function(s){e.getAxisMotionValue(s)&&(e.constraints[s]=hl(a.actual[s],e.constraints[s]))})},t.prototype.resolveRefConstraints=function(){var e=this.getProps(),r=e.dragConstraints,n=e.onMeasureDragConstraints;if(!r||!xt(r))return!1;var o=r.current,a=this.visualElement.projection;if(!a||!a.layout)return!1;var i=xl(o,a.root,this.visualElement.getTransformPagePoint()),s=vl(a.layout.actual,i);if(n){var u=n(gl(s));this.hasMutatedConstraints=!!u,u&&(s=Qo(u))}return s},t.prototype.startAnimation=function(e){var r=this,n=this.getProps(),o=n.drag,a=n.dragMomentum,i=n.dragElastic,s=n.dragTransition,u=n.dragSnapToOrigin,l=n.onDragTransitionEnd,c=this.constraints||{},v=J(function(d){var f;if(!!Te(d,o,r.currentDirection)){var p=(f=c==null?void 0:c[d])!==null&&f!==void 0?f:{};u&&(p={min:0,max:0});var h=i?200:1e6,x=i?40:1e7,y=g(g({type:"inertia",velocity:a?e[d]:0,bounceStiffness:h,bounceDamping:x,timeConstant:750,restDelta:1,restSpeed:10},s),p);return r.startAxisValueAnimation(d,y)}});return Promise.all(v).then(l)},t.prototype.startAxisValueAnimation=function(e,r){var n=this.getAxisMotionValue(e);return or(e,n,0,r)},t.prototype.stopAnimation=function(){var e=this;J(function(r){return e.getAxisMotionValue(r).stop()})},t.prototype.getAxisMotionValue=function(e){var r,n,o="_drag"+e.toUpperCase(),a=this.visualElement.getProps()[o];return a||this.visualElement.getValue(e,(n=(r=this.visualElement.getProps().initial)===null||r===void 0?void 0:r[e])!==null&&n!==void 0?n:0)},t.prototype.snapToCursor=function(e){var r=this;J(function(n){var o=r.getProps().drag;if(!!Te(n,o,r.currentDirection)){var a=r.visualElement.projection,i=r.getAxisMotionValue(n);if(a&&a.layout){var s=a.layout.actual[n],u=s.min,l=s.max;i.set(e[n]-I(u,l,.5))}}})},t.prototype.scalePositionWithinConstraints=function(){var e=this,r,n=this.getProps(),o=n.drag,a=n.dragConstraints,i=this.visualElement.projection;if(!(!xt(a)||!i||!this.constraints)){this.stopAnimation();var s={x:0,y:0};J(function(l){var c=e.getAxisMotionValue(l);if(c){var v=c.get();s[l]=pl({min:v,max:v},e.constraints[l])}});var u=this.visualElement.getProps().transformTemplate;this.visualElement.getInstance().style.transform=u?u({},""):"none",(r=i.root)===null||r===void 0||r.updateScroll(),i.updateLayout(),this.resolveConstraints(),J(function(l){if(!!Te(l,o,null)){var c=e.getAxisMotionValue(l),v=e.constraints[l],d=v.min,f=v.max;c.set(I(d,f,s[l]))}})}},t.prototype.addListeners=function(){var e=this,r;bl.set(this.visualElement,this);var n=this.visualElement.getInstance(),o=Vt(n,"pointerdown",function(l){var c=e.getProps(),v=c.drag,d=c.dragListener,f=d===void 0?!0:d;v&&f&&e.start(l)}),a=function(){var l=e.getProps().dragConstraints;xt(l)&&(e.constraints=e.resolveRefConstraints())},i=this.visualElement.projection,s=i.addEventListener("measure",a);i&&!i.layout&&((r=i.root)===null||r===void 0||r.updateScroll(),i.updateLayout()),a();var u=dt(window,"resize",function(){e.scalePositionWithinConstraints()});return i.addEventListener("didUpdate",function(l){var c=l.delta,v=l.hasLayoutChanged;e.isDragging&&v&&(J(function(d){var f=e.getAxisMotionValue(d);!f||(e.originPoint[d]+=c[d].translate,f.set(f.get()+c[d].translate))}),e.visualElement.syncRender())}),function(){u(),o(),s()}},t.prototype.getProps=function(){var e=this.visualElement.getProps(),r=e.drag,n=r===void 0?!1:r,o=e.dragDirectionLock,a=o===void 0?!1:o,i=e.dragPropagation,s=i===void 0?!1:i,u=e.dragConstraints,l=u===void 0?!1:u,c=e.dragElastic,v=c===void 0?Ar:c,d=e.dragMomentum,f=d===void 0?!0:d;return g(g({},e),{drag:n,dragDirectionLock:a,dragPropagation:s,dragConstraints:l,dragElastic:v,dragMomentum:f})},t}();function Te(t,e,r){return(e===!0||e===t)&&(r===null||r===t)}function Pl(t,e){e===void 0&&(e=10);var r=null;return Math.abs(t.y)>e?r="y":Math.abs(t.x)>e&&(r="x"),r}function Tl(t){var e=t.dragControls,r=t.visualElement,n=j(function(){return new Sl(r)});m.exports.useEffect(function(){return e&&e.subscribe(n)},[n,e]),m.exports.useEffect(function(){return n.addListeners()},[n])}function Vl(t){var e=t.onPan,r=t.onPanStart,n=t.onPanEnd,o=t.onPanSessionStart,a=t.visualElement,i=e||r||n||o,s=m.exports.useRef(null),u=m.exports.useContext(gt).transformPagePoint,l={onSessionStart:o,onStart:r,onMove:e,onEnd:function(v,d){s.current=null,n&&n(v,d)}};m.exports.useEffect(function(){s.current!==null&&s.current.updateHandlers(l)});function c(v){s.current=new Yo(v,l,{transformPagePoint:u})}Pe(a,"pointerdown",i&&c),yr(function(){return s.current&&s.current.end()})}var ei={pan:st(Vl),drag:st(Tl)},Ve=["LayoutMeasure","BeforeLayoutMeasure","LayoutUpdate","ViewportBoxUpdate","Update","Render","AnimationComplete","LayoutAnimationComplete","AnimationStart","SetAxisTarget","Unmount"];function Cl(){var t=Ve.map(function(){return new Nt}),e={},r={clearAllListeners:function(){return t.forEach(function(n){return n.clear()})},updatePropListeners:function(n){Ve.forEach(function(o){var a,i="on"+o,s=n[i];(a=e[o])===null||a===void 0||a.call(e),s&&(e[o]=r[i](s))})}};return t.forEach(function(n,o){r["on"+Ve[o]]=function(a){return n.add(a)},r["notify"+Ve[o]]=function(){for(var a=[],i=0;i5)return o;var u=tt.createTransformer(t),l=typeof s[0]!="number"?1:0,c=n.x.scale*r.x,v=n.y.scale*r.y;s[0+l]/=c,s[1+l]/=v;var d=I(c,v,.5);typeof s[2+l]=="number"&&(s[2+l]/=d),typeof s[3+l]=="number"&&(s[3+l]/=d);var f=u(s);if(a){var p=0;f=f.replace(vi,function(){var h=i[p];return p++,h})}return f}},Gl=function(t){_r(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.componentDidMount=function(){var r=this,n=this.props,o=n.visualElement,a=n.layoutGroup,i=n.switchLayoutGroup,s=n.layoutId,u=o.projection;Cs(Kl),u&&((a==null?void 0:a.group)&&a.group.add(u),(i==null?void 0:i.register)&&s&&i.register(u),u.root.didUpdate(),u.addEventListener("animationComplete",function(){r.safeToRemove()}),u.setOptions(g(g({},u.options),{onExitComplete:function(){return r.safeToRemove()}}))),Yt.hasEverUpdated=!0},e.prototype.getSnapshotBeforeUpdate=function(r){var n=this,o=this.props,a=o.layoutDependency,i=o.visualElement,s=o.drag,u=o.isPresent,l=i.projection;return l&&(l.isPresent=u,s||r.layoutDependency!==a||a===void 0?l.willUpdate():this.safeToRemove(),r.isPresent!==u&&(u?l.promote():l.relegate()||$.postRender(function(){var c;((c=l.getStack())===null||c===void 0?void 0:c.members.length)||n.safeToRemove()}))),null},e.prototype.componentDidUpdate=function(){var r=this.props.visualElement.projection;r&&(r.root.didUpdate(),!r.currentAnimation&&r.isLead()&&this.safeToRemove())},e.prototype.componentWillUnmount=function(){var r=this.props,n=r.visualElement,o=r.layoutGroup,a=r.switchLayoutGroup,i=n.projection;i&&(i.scheduleCheckAfterUnmount(),(o==null?void 0:o.group)&&o.group.remove(i),(a==null?void 0:a.deregister)&&a.deregister(i))},e.prototype.safeToRemove=function(){var r=this.props.safeToRemove;r==null||r()},e.prototype.render=function(){return null},e}(we.Component);function kl(t){var e=R(_o(),2),r=e[0],n=e[1],o=m.exports.useContext(Wt);return we.createElement(Gl,g({},t,{layoutGroup:o,switchLayoutGroup:m.exports.useContext(co),isPresent:r,safeToRemove:n}))}var Kl={borderRadius:g(g({},$t),{applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]}),borderTopLeftRadius:$t,borderTopRightRadius:$t,borderBottomLeftRadius:$t,borderBottomRightRadius:$t,boxShadow:zl},pi={measureLayout:kl},Yl=oo({attachResizeListener:function(t,e){return t.addEventListener("resize",e,{passive:!0}),function(){return t.removeEventListener("resize",e)}},measureScroll:function(){return{x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}}}),pt={current:void 0},Dr=oo({measureScroll:function(t){return{x:t.scrollLeft,y:t.scrollTop}},defaultParent:function(){if(!pt.current){var t=new Yl(0,{});t.mount(window),t.setOptions({layoutScroll:!0}),pt.current=t}return pt.current},resetTransform:function(t,e){t.style.transform=e!=null?e:"none"}}),hi=g(g(g(g({},Ko),Bo),ei),pi),mi=vo(function(t,e){return hr(t,e,hi,Lr,Dr)});function Ec(t){return fo(hr(t,{forwardMotionProps:!1},hi,Lr,Dr))}var wc=vo(hr);function gi(){var t=m.exports.useRef(!1),e=R(m.exports.useState(0),2),r=e[0],n=e[1];return yr(function(){return t.current=!0}),[m.exports.useCallback(function(){!t.current&&n(r+1)},[r]),r]}var yi=0;function Wl(){var t=yi;return yi++,t}var Ir=function(t){var e=t.children,r=t.initial,n=t.isPresent,o=t.onExitComplete,a=t.custom,i=t.presenceAffectsLayout,s=j(Xl),u=j(Wl),l=m.exports.useMemo(function(){return{id:u,initial:r,isPresent:n,custom:a,onExitComplete:function(c){var v,d;s.set(c,!0);try{for(var f=Ri(s.values()),p=f.next();!p.done;p=f.next()){var h=p.value;if(!h)return}}catch(x){v={error:x}}finally{try{p&&!p.done&&(d=f.return)&&d.call(f)}finally{if(v)throw v.error}}o==null||o()},register:function(c){return s.set(c,!1),function(){return s.delete(c)}}}},i?void 0:[n]);return m.exports.useMemo(function(){s.forEach(function(c,v){return s.set(v,!1)})},[n]),m.exports.useEffect(function(){!n&&!s.size&&(o==null||o())},[n]),m.exports.createElement(yt.Provider,{value:l},e)};function Xl(){return new Map}function Ct(t){return t.key||""}function $l(t,e){t.forEach(function(r){var n=Ct(r);e.set(n,r)})}function Zl(t){var e=[];return m.exports.Children.forEach(t,function(r){m.exports.isValidElement(r)&&e.push(r)}),e}var Ac=function(t){var e=t.children,r=t.custom,n=t.initial,o=n===void 0?!0:n,a=t.onExitComplete,i=t.exitBeforeEnter,s=t.presenceAffectsLayout,u=s===void 0?!0:s,l=R(gi(),1),c=l[0],v=m.exports.useContext(Wt).forceRender;v&&(c=v);var d=m.exports.useRef(!0),f=m.exports.useRef(!0);m.exports.useEffect(function(){return function(){f.current=!1}},[]);var p=Zl(e),h=m.exports.useRef(p),x=m.exports.useRef(new Map).current,y=m.exports.useRef(new Set).current;if($l(p,x),d.current)return d.current=!1,m.exports.createElement(m.exports.Fragment,null,p.map(function(w){return m.exports.createElement(Ir,{key:Ct(w),isPresent:!0,initial:o?void 0:!1,presenceAffectsLayout:u},w)}));for(var b=K([],R(p)),S=h.current.map(Ct),P=p.map(Ct),V=S.length,A=0;A0?1:-1,i=t[o+a];if(!i)return t;var s=t[o],u=i.layout,l=I(u.min,u.max,.5);return a===1&&s.layout.max+r>l||a===-1&&s.layout.min+r.001?1/t:Tc};function Yc(t){var e=Et(1),r=Et(1),n=Nr();t?(e=t.scaleX||e,r=t.scaleY||r):n&&(e=n.getValue("scaleX",1),r=n.getValue("scaleY",1));var o=jr(e,Mi),a=jr(r,Mi);return{scaleX:o,scaleY:a}}export{Ac as AnimatePresence,Mc as AnimateSharedLayout,ql as DeprecatedLayoutGroupContext,yc as DragControls,Ls as FlatTree,Ql as LayoutGroup,Wt as LayoutGroupContext,Oc as LazyMotion,Rc as MotionConfig,gt as MotionConfigContext,ts as MotionValue,yt as PresenceContext,Lc as Reorder,co as SwitchLayoutGroupContext,Cs as addScaleCorrector,ds as animate,Tr as animateVisualElement,gc as animationControls,Ec as createDomMotionComponent,fo as createMotionComponent,dc as domAnimation,Dc as domMax,Se as isValidMotionProp,wc as m,mi as motion,Y as motionValue,be as resolveMotionValue,uc as transform,Nc as useAnimation,Hc as useCycle,Kc as useDeprecatedAnimatedState,Yc as useDeprecatedInvertedScale,mr as useDomEvent,zc as useDragControls,Bc as useElementScroll,Gc as useInstantLayoutTransition,Cc as useIsPresent,Ic as useMotionTemplate,Et as useMotionValue,_o as usePresence,Uc as useReducedMotion,kc as useResetProjection,Fc as useSpring,jr as useTransform,jc as useVelocity,_c as useViewportScroll,Mr as visualElement};