Files
echo-nexus/node_modules/framer-motion/dist/size-rollup-dom-animation-assets.js
T

2 lines
25 KiB
JavaScript

const t=(t,e,s)=>s>e?e:s<t?t:s,e={},s=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),n=t=>/^0[^.\s]+$/u.test(t),r=t=>t;class i{constructor(){this.subscriptions=[]}add(t){var e,s;return e=this.subscriptions,s=t,-1===e.indexOf(s)&&e.push(s),()=>function(t,e){const s=t.indexOf(e);s>-1&&t.splice(s,1)}(this.subscriptions,t)}notify(t,e,s){const n=this.subscriptions.length;if(n)if(1===n)this.subscriptions[0](t,e,s);else for(let r=0;r<n;r++){const n=this.subscriptions[r];n&&n(t,e,s)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}function a(t,e){return e?t*(1e3/e):0}const o=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"],h={value:null,addProjectionMetrics:null};function l(t,s){let n=!1,r=!0;const i={delta:0,timestamp:0,isProcessing:!1},a=()=>n=!0,l=o.reduce((t,e)=>(t[e]=function(t,e){let s=new Set,n=new Set,r=!1,i=!1;const a=new WeakSet;let o={delta:0,timestamp:0,isProcessing:!1},l=0;function c(e){a.has(e)&&(u.schedule(e),t()),l++,e(o)}const u={schedule:(t,e=!1,i=!1)=>{const o=i&&r?s:n;return e&&a.add(t),o.has(t)||o.add(t),t},cancel:t=>{n.delete(t),a.delete(t)},process:t=>{o=t,r?i=!0:(r=!0,[s,n]=[n,s],s.forEach(c),e&&h.value&&h.value.frameloop[e].push(l),l=0,s.clear(),r=!1,i&&(i=!1,u.process(t)))}};return u}(a,s?e:void 0),t),{}),{setup:c,read:u,resolveKeyframes:d,preUpdate:p,update:f,preRender:m,render:g,postRender:v}=l,y=()=>{const a=e.useManualTiming?i.timestamp:performance.now();n=!1,e.useManualTiming||(i.delta=r?1e3/60:Math.max(Math.min(a-i.timestamp,40),1)),i.timestamp=a,i.isProcessing=!0,c.process(i),u.process(i),d.process(i),p.process(i),f.process(i),m.process(i),g.process(i),v.process(i),i.isProcessing=!1,n&&s&&(r=!1,t(y))};return{schedule:o.reduce((e,s)=>{const a=l[s];return e[s]=(e,s=!1,o=!1)=>(n||(n=!0,r=!0,i.isProcessing||t(y)),a.schedule(e,s,o)),e},{}),cancel:t=>{for(let e=0;e<o.length;e++)l[o[e]].cancel(t)},state:i,steps:l}}const{schedule:c,cancel:u,state:d,steps:p}=l("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:r,!0);let f;function m(){f=void 0}const g={now:()=>(void 0===f&&g.set(d.isProcessing||e.useManualTiming?d.timestamp:performance.now()),f),set:t=>{f=t,queueMicrotask(m)}},v=t=>e=>"string"==typeof e&&e.startsWith(t),y=v("--"),b=v("var(--"),w=t=>!!b(t)&&V.test(t.split("/*")[0].trim()),V=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function S(t){return"string"==typeof t&&t.split("/*")[0].includes("var(--")}const M={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},C={...M,transform:e=>t(0,1,e)},x={...M,default:1},A=t=>Math.round(1e5*t)/1e5,k=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const F=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,T=(t,e)=>s=>Boolean("string"==typeof s&&F.test(s)&&s.startsWith(t)||e&&!function(t){return null==t}(s)&&Object.prototype.hasOwnProperty.call(s,e)),B=(t,e,s)=>n=>{if("string"!=typeof n)return n;const[r,i,a,o]=n.match(k);return{[t]:parseFloat(r),[e]:parseFloat(i),[s]:parseFloat(a),alpha:void 0!==o?parseFloat(o):1}},R={...M,transform:e=>Math.round((e=>t(0,255,e))(e))},P={test:T("rgb","red"),parse:B("red","green","blue"),transform:({red:t,green:e,blue:s,alpha:n=1})=>"rgba("+R.transform(t)+", "+R.transform(e)+", "+R.transform(s)+", "+A(C.transform(n))+")"};const E={test:T("#"),parse:function(t){let e="",s="",n="",r="";return t.length>5?(e=t.substring(1,3),s=t.substring(3,5),n=t.substring(5,7),r=t.substring(7,9)):(e=t.substring(1,2),s=t.substring(2,3),n=t.substring(3,4),r=t.substring(4,5),e+=e,s+=s,n+=n,r+=r),{red:parseInt(e,16),green:parseInt(s,16),blue:parseInt(n,16),alpha:r?parseInt(r,16)/255:1}},transform:P.transform},I=t=>({test:e=>"string"==typeof e&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),N=I("deg"),Y=I("%"),L=I("px"),X=I("vh"),$=I("vw"),O=(()=>({...Y,parse:t=>Y.parse(t)/100,transform:t=>Y.transform(100*t)}))(),W={test:T("hsl","hue"),parse:B("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:s,alpha:n=1})=>"hsla("+Math.round(t)+", "+Y.transform(A(e))+", "+Y.transform(A(s))+", "+A(C.transform(n))+")"},j={test:t=>P.test(t)||E.test(t)||W.test(t),parse:t=>P.test(t)?P.parse(t):W.test(t)?W.parse(t):E.parse(t),transform:t=>"string"==typeof t?t:t.hasOwnProperty("red")?P.transform(t):W.transform(t),getAnimatableNone:t=>{const e=j.parse(t);return e.alpha=0,j.transform(e)}},U=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;const Z="number",K="color",z=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function D(t){const e=t.toString(),s=[],n={color:[],number:[],var:[]},r=[];let i=0;const a=e.replace(z,t=>(j.test(t)?(n.color.push(i),r.push(K),s.push(j.parse(t))):t.startsWith("var(")?(n.var.push(i),r.push("var"),s.push(t)):(n.number.push(i),r.push(Z),s.push(parseFloat(t))),++i,"${}")).split("${}");return{values:s,split:a,indexes:n,types:r}}function q(t){return D(t).values}function H(t){const{split:e,types:s}=D(t),n=e.length;return t=>{let r="";for(let i=0;i<n;i++)if(r+=e[i],void 0!==t[i]){const e=s[i];r+=e===Z?A(t[i]):e===K?j.transform(t[i]):t[i]}return r}}const G=t=>"number"==typeof t?0:j.test(t)?j.getAnimatableNone(t):t;const J={test:function(t){return isNaN(t)&&"string"==typeof t&&(t.match(k)?.length||0)+(t.match(U)?.length||0)>0},parse:q,createTransformer:H,getAnimatableNone:function(t){const e=q(t);return H(t)(e.map(G))}},Q=(t,e,s)=>t+(e-t)*s;const _=t=>180*t/Math.PI,tt=t=>{const e=_(Math.atan2(t[1],t[0]));return st(e)},et={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:tt,rotateZ:tt,skewX:t=>_(Math.atan(t[1])),skewY:t=>_(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},st=t=>((t%=360)<0&&(t+=360),t),nt=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),rt=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),it={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:nt,scaleY:rt,scale:t=>(nt(t)+rt(t))/2,rotateX:t=>st(_(Math.atan2(t[6],t[5]))),rotateY:t=>st(_(Math.atan2(-t[2],t[0]))),rotateZ:tt,rotate:tt,skewX:t=>_(Math.atan(t[4])),skewY:t=>_(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function at(t){return t.includes("scale")?1:0}function ot(t,e){if(!t||"none"===t)return at(e);const s=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let n,r;if(s)n=it,r=s;else{const e=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);n=et,r=e}if(!r)return at(e);const i=n[e],a=r[1].split(",").map(lt);return"function"==typeof i?i(a):a[i]}const ht=(t,e)=>{const{transform:s="none"}=getComputedStyle(t);return ot(s,e)};function lt(t){return parseFloat(t.trim())}const ct=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],ut=(()=>new Set(ct))(),dt=t=>t===M||t===L,pt=new Set(["x","y","z"]),ft=ct.filter(t=>!pt.has(t));const mt={width:({x:t},{paddingLeft:e="0",paddingRight:s="0"})=>t.max-t.min-parseFloat(e)-parseFloat(s),height:({y:t},{paddingTop:e="0",paddingBottom:s="0"})=>t.max-t.min-parseFloat(e)-parseFloat(s),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:(t,{transform:e})=>ot(e,"x"),y:(t,{transform:e})=>ot(e,"y")};mt.translateX=mt.x,mt.translateY=mt.y;const gt=new Set;let vt=!1,yt=!1,bt=!1;function wt(){if(yt){const t=Array.from(gt).filter(t=>t.needsMeasurement),e=new Set(t.map(t=>t.element)),s=new Map;e.forEach(t=>{const e=function(t){const e=[];return ft.forEach(s=>{const n=t.getValue(s);void 0!==n&&(e.push([s,n.get()]),n.set(s.startsWith("scale")?1:0))}),e}(t);e.length&&(s.set(t,e),t.render())}),t.forEach(t=>t.measureInitialState()),e.forEach(t=>{t.render();const e=s.get(t);e&&e.forEach(([e,s])=>{t.getValue(e)?.set(s)})}),t.forEach(t=>t.measureEndState()),t.forEach(t=>{void 0!==t.suspendedScrollY&&window.scrollTo(0,t.suspendedScrollY)})}yt=!1,vt=!1,gt.forEach(t=>t.complete(bt)),gt.clear()}function Vt(){gt.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(yt=!0)})}function St(){bt=!0,Vt(),wt(),bt=!1}class Mt{constructor(t,e,s,n,r,i=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=e,this.name=s,this.motionValue=n,this.element=r,this.isAsync=i}scheduleResolve(){this.state="scheduled",this.isAsync?(gt.add(this),vt||(vt=!0,c.read(Vt),c.resolveKeyframes(wt))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:e,element:s,motionValue:n}=this;if(null===t[0]){const r=n?.get(),i=t[t.length-1];if(void 0!==r)t[0]=r;else if(s&&e){const n=s.readValue(e,i);null!=n&&(t[0]=n)}void 0===t[0]&&(t[0]=i),n&&void 0===r&&n.set(t[0])}!function(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),gt.delete(this)}cancel(){"scheduled"===this.state&&(gt.delete(this),this.state="pending")}resume(){"pending"===this.state&&this.scheduleResolve()}}class Ct{constructor(t,e={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=t=>{const e=g.now();if(this.updatedAt!==e&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(t),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const t of this.dependents)t.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=e.owner}setCurrent(t){var e;this.current=t,this.updatedAt=g.now(),null===this.canTrackVelocity&&void 0!==t&&(this.canTrackVelocity=(e=this.current,!isNaN(parseFloat(e))))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,e){this.events[t]||(this.events[t]=new i);const s=this.events[t].add(e);return"change"===t?()=>{s(),c.read(()=>{this.events.change.getSize()||this.stop()})}:s}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,e){this.passiveEffect=t,this.stopPassiveEffect=e}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,e,s){this.set(e),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-s}jump(t,e=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,e&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=g.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;const e=Math.min(this.updatedAt-this.prevUpdatedAt,30);return a(parseFloat(this.current)-parseFloat(this.prevFrameValue),e)}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0,this.animation=t(e),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function xt(t,e){return new Ct(t,e)}function At(t){const e=[{},{}];return t?.values.forEach((t,s)=>{e[0][s]=t.get(),e[1][s]=t.getVelocity()}),e}function kt(t,e,s,n){if("function"==typeof e){const[r,i]=At(n);e=e(void 0!==s?s:t.custom,r,i)}if("string"==typeof e&&(e=t.variants&&t.variants[e]),"function"==typeof e){const[r,i]=At(n);e=e(void 0!==s?s:t.custom,r,i)}return e}const Ft=t=>Boolean(t&&t.getVelocity);function Tt(t){return t.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const Bt="data-"+Tt("framerAppearId"),Rt=t=>e=>e.test(t),Pt=[M,L,Y,N,$,X,{test:t=>"auto"===t,parse:t=>t}],Et=t=>Pt.find(Rt(t)),It=new Set(["brightness","contrast","saturate","opacity"]);function Nt(t){const[e,s]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[n]=s.match(k)||[];if(!n)return t;const r=s.replace(n,"");let i=It.has(e)?1:0;return n!==s&&(i*=100),e+"("+i+r+")"}const Yt=/\b([a-z-]*)\(.*?\)/gu,Lt={...J,getAnimatableNone:t=>{const e=t.match(Yt);return e?e.map(Nt).join(" "):t}},Xt={...M,transform:Math.round},$t={borderWidth:L,borderTopWidth:L,borderRightWidth:L,borderBottomWidth:L,borderLeftWidth:L,borderRadius:L,radius:L,borderTopLeftRadius:L,borderTopRightRadius:L,borderBottomRightRadius:L,borderBottomLeftRadius:L,width:L,maxWidth:L,height:L,maxHeight:L,top:L,right:L,bottom:L,left:L,inset:L,insetBlock:L,insetBlockStart:L,insetBlockEnd:L,insetInline:L,insetInlineStart:L,insetInlineEnd:L,padding:L,paddingTop:L,paddingRight:L,paddingBottom:L,paddingLeft:L,paddingBlock:L,paddingBlockStart:L,paddingBlockEnd:L,paddingInline:L,paddingInlineStart:L,paddingInlineEnd:L,margin:L,marginTop:L,marginRight:L,marginBottom:L,marginLeft:L,marginBlock:L,marginBlockStart:L,marginBlockEnd:L,marginInline:L,marginInlineStart:L,marginInlineEnd:L,backgroundPositionX:L,backgroundPositionY:L,...{rotate:N,rotateX:N,rotateY:N,rotateZ:N,scale:x,scaleX:x,scaleY:x,scaleZ:x,skew:N,skewX:N,skewY:N,distance:L,translateX:L,translateY:L,translateZ:L,x:L,y:L,z:L,perspective:L,transformPerspective:L,opacity:C,originX:O,originY:O,originZ:L},zIndex:Xt,fillOpacity:C,strokeOpacity:C,numOctaves:Xt},Ot={...$t,color:j,backgroundColor:j,outlineColor:j,fill:j,stroke:j,borderColor:j,borderTopColor:j,borderRightColor:j,borderBottomColor:j,borderLeftColor:j,filter:Lt,WebkitFilter:Lt},Wt=t=>Ot[t];function jt(t,e){let s=Wt(t);return s!==Lt&&(s=J),s.getAnimatableNone?s.getAnimatableNone(e):void 0}const Ut=(t,e)=>e&&"number"==typeof t?e.transform(t):t,{schedule:Zt,cancel:Kt}=l(queueMicrotask,!1),zt=[...Pt,j,J],Dt=()=>({x:{min:0,max:0},y:{min:0,max:0}}),qt={current:null},Ht={current:!1},Gt="undefined"!=typeof window;const Jt=new WeakMap;function Qt(t){return null!==t&&"object"==typeof t&&"function"==typeof t.start}function _t(t){return"string"==typeof t||Array.isArray(t)}const te=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],ee=["initial",...te];function se(t){return Qt(t.animate)||ee.some(e=>_t(t[e]))}function ne(t){return Boolean(se(t)||t.variants)}const re=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let ie={};function ae(t){ie=t}function oe(){return ie}class he{scrapeMotionValuesFromProps(t,e,s){return{}}constructor({parent:t,props:e,presenceContext:s,reducedMotionConfig:n,blockInitialAnimation:r,visualState:i},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Mt,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const t=g.now();this.renderScheduledAt<t&&(this.renderScheduledAt=t,c.render(this.render,!1,!0))};const{latestValues:o,renderState:h}=i;this.latestValues=o,this.baseTarget={...o},this.initialValues=e.initial?{...o}:{},this.renderState=h,this.parent=t,this.props=e,this.presenceContext=s,this.depth=t?t.depth+1:0,this.reducedMotionConfig=n,this.options=a,this.blockInitialAnimation=Boolean(r),this.isControllingVariants=se(e),this.isVariantNode=ne(e),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const{willChange:l,...u}=this.scrapeMotionValuesFromProps(e,{},this);for(const t in u){const e=u[t];void 0!==o[t]&&Ft(e)&&e.set(o[t])}}mount(t){this.current=t,Jt.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((t,e)=>this.bindToMotionValue(e,t)),"never"===this.reducedMotionConfig?this.shouldReduceMotion=!1:"always"===this.reducedMotionConfig?this.shouldReduceMotion=!0:(Ht.current||function(){if(Ht.current=!0,Gt)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>qt.current=t.matches;t.addEventListener("change",e),e()}else qt.current=!1}(),this.shouldReduceMotion=qt.current),this.parent?.addChild(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),u(this.notifyUpdate),u(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const e=this.features[t];e&&(e.unmount(),e.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,e){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const s=ut.has(t);s&&this.onBindTransform&&this.onBindTransform();const n=e.on("change",e=>{this.latestValues[t]=e,this.props.onUpdate&&c.preRender(this.notifyUpdate),s&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let r;"undefined"!=typeof window&&window.MotionCheckAppearSync&&(r=window.MotionCheckAppearSync(this,t,e)),this.valueSubscriptions.set(t,()=>{n(),r&&r(),e.owner&&e.stop()})}sortNodePosition(t){return this.current&&this.sortInstanceNodePosition&&this.type===t.type?this.sortInstanceNodePosition(this.current,t.current):0}updateFeatures(){let t="animation";for(t in ie){const e=ie[t];if(!e)continue;const{isEnabled:s,Feature:n}=e;if(!this.features[t]&&n&&s(this.props)&&(this.features[t]=new n(this)),this.features[t]){const e=this.features[t];e.isMounted?e.update():(e.mount(),e.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):{x:{min:0,max:0},y:{min:0,max:0}}}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,e){this.latestValues[t]=e}update(t,e){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=e;for(let e=0;e<re.length;e++){const s=re[e];this.propEventSubscriptions[s]&&(this.propEventSubscriptions[s](),delete this.propEventSubscriptions[s]);const n=t["on"+s];n&&(this.propEventSubscriptions[s]=this.on(s,n))}this.prevMotionValues=function(t,e,s){for(const n in e){const r=e[n],i=s[n];if(Ft(r))t.addValue(n,r);else if(Ft(i))t.addValue(n,xt(r,{owner:t}));else if(i!==r)if(t.hasValue(n)){const e=t.getValue(n);!0===e.liveStyle?e.jump(r):e.hasAnimated||e.set(r)}else{const e=t.getStaticValue(n);t.addValue(n,xt(void 0!==e?e:r,{owner:t}))}}for(const n in s)void 0===e[n]&&t.removeValue(n);return e}(this,this.scrapeMotionValuesFromProps(t,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const e=this.getClosestVariantNode();if(e)return e.variantChildren&&e.variantChildren.add(t),()=>e.variantChildren.delete(t)}addValue(t,e){const s=this.values.get(t);e!==s&&(s&&this.removeValue(t),this.bindToMotionValue(t,e),this.values.set(t,e),this.latestValues[t]=e.get())}removeValue(t){this.values.delete(t);const e=this.valueSubscriptions.get(t);e&&(e(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,e){if(this.props.values&&this.props.values[t])return this.props.values[t];let s=this.values.get(t);return void 0===s&&void 0!==e&&(s=xt(null===e?void 0:e,{owner:this}),this.addValue(t,s)),s}readValue(t,e){let r=void 0===this.latestValues[t]&&this.current?this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options):this.latestValues[t];var i;return null!=r&&("string"==typeof r&&(s(r)||n(r))?r=parseFloat(r):(i=r,!zt.find(Rt(i))&&J.test(e)&&(r=jt(t,e))),this.setBaseTarget(t,Ft(r)?r.get():r)),Ft(r)?r.get():r}setBaseTarget(t,e){this.baseTarget[t]=e}getBaseTarget(t){const{initial:e}=this.props;let s;if("string"==typeof e||"object"==typeof e){const n=kt(this.props,e,this.presenceContext?.custom);n&&(s=n[t])}if(e&&void 0!==s)return s;const n=this.getBaseTargetFromProps(this.props,t);return void 0===n||Ft(n)?void 0!==this.initialValues[t]&&void 0===s?void 0:this.baseTarget[t]:n}on(t,e){return this.events[t]||(this.events[t]=new i),this.events[t].add(e)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}scheduleRenderMicrotask(){Zt.render(this.render)}}const le={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},ce=ct.length;function ue(t,e,s){const{style:n,vars:r,transformOrigin:i}=t;let a=!1,o=!1;for(const t in e){const s=e[t];if(ut.has(t))a=!0;else if(y(t))r[t]=s;else{const e=Ut(s,$t[t]);t.startsWith("origin")?(o=!0,i[t]=e):n[t]=e}}if(e.transform||(a||s?n.transform=function(t,e,s){let n="",r=!0;for(let i=0;i<ce;i++){const a=ct[i],o=t[a];if(void 0===o)continue;let h=!0;if(h="number"==typeof o?o===(a.startsWith("scale")?1:0):0===parseFloat(o),!h||s){const t=Ut(o,$t[a]);h||(r=!1,n+=`${le[a]||a}(${t}) `),s&&(e[a]=t)}}return n=n.trim(),s?n=s(e,r?"":n):r&&(n="none"),n}(e,t.transform,s):n.transform&&(n.transform="none")),o){const{originX:t="50%",originY:e="50%",originZ:s=0}=i;n.transformOrigin=`${t} ${e} ${s}`}}function de(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const pe={correct:(t,e)=>{if(!e.target)return t;if("string"==typeof t){if(!L.test(t))return t;t=parseFloat(t)}return`${de(t,e.target.x)}% ${de(t,e.target.y)}%`}},fe={correct:(t,{treeScale:e,projectionDelta:s})=>{const n=t,r=J.parse(t);if(r.length>5)return n;const i=J.createTransformer(t),a="number"!=typeof r[0]?1:0,o=s.x.scale*e.x,h=s.y.scale*e.y;r[0+a]/=o,r[1+a]/=h;const l=Q(o,h,.5);return"number"==typeof r[2+a]&&(r[2+a]/=l),"number"==typeof r[3+a]&&(r[3+a]/=l),i(r)}},me={borderRadius:{...pe,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:pe,borderTopRightRadius:pe,borderBottomLeftRadius:pe,borderBottomRightRadius:pe,boxShadow:fe};function ge(t,{layout:e,layoutId:s}){return ut.has(t)||t.startsWith("origin")||(e||void 0!==s)&&(!!me[t]||"opacity"===t)}function ve(t,e,s){const n=t.style,r=e?.style,i={};if(!n)return i;for(const e in n)(Ft(n[e])||r&&Ft(r[e])||ge(e,t)||void 0!==s?.getValue(e)?.liveStyle)&&(i[e]=n[e]);return i}const ye={offset:"stroke-dashoffset",array:"stroke-dasharray"},be={offset:"strokeDashoffset",array:"strokeDasharray"};const we=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function Ve(t,{attrX:e,attrY:s,attrScale:n,pathLength:r,pathSpacing:i=1,pathOffset:a=0,...o},h,l,c){if(ue(t,o,l),h)return void(t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox));t.attrs=t.style,t.style={};const{attrs:u,style:d}=t;u.transform&&(d.transform=u.transform,delete u.transform),(d.transform||u.transformOrigin)&&(d.transformOrigin=u.transformOrigin??"50% 50%",delete u.transformOrigin),d.transform&&(d.transformBox=c?.transformBox??"fill-box",delete u.transformBox);for(const t of we)void 0!==u[t]&&(d[t]=u[t],delete u[t]);void 0!==e&&(u.x=e),void 0!==s&&(u.y=s),void 0!==n&&(u.scale=n),void 0!==r&&function(t,e,s=1,n=0,r=!0){t.pathLength=1;const i=r?ye:be;t[i.offset]=L.transform(-n);const a=L.transform(e),o=L.transform(s);t[i.array]=`${a} ${o}`}(u,r,i,a,!1)}const Se=t=>"string"==typeof t&&"svg"===t.toLowerCase();function Me(t,e,s){const n=ve(t,e,s);for(const s in t)if(Ft(t[s])||Ft(e[s])){n[-1!==ct.indexOf(s)?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s]=t[s]}return n}const Ce=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function xe(t){return"string"==typeof t&&!t.includes("-")&&!!(Ce.indexOf(t)>-1||/[A-Z]/u.test(t))}export{u as A,d as B,g as C,a as D,t as E,St as F,s as G,ut as H,ct as I,xt as J,Mt as K,n as L,e as M,jt as N,Et as O,S as P,mt as Q,dt as R,at as S,ht as T,y as U,he as V,Tt as W,Dt as X,Wt as Y,ee as Z,te as _,se as a,_t as b,ge as c,ue as d,Ve as e,Se as f,xe as g,ne as h,Ft as i,Qt as j,Me as k,oe as l,ae as m,r as n,Bt as o,Q as p,P as q,kt as r,ve as s,W as t,E as u,w as v,j as w,J as x,D as y,c as z};