2 lines
30 KiB
JavaScript
2 lines
30 KiB
JavaScript
const t=(t,e,s)=>s>e?e:s<t?t:s;function e(t,e){return e?`${t}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${e}`:t}let s=()=>{},n=()=>{};"undefined"!=typeof process&&"production"!==process.env?.NODE_ENV&&(s=(t,s,n)=>{t||"undefined"==typeof console||console.warn(e(s,n))},n=(t,s,n)=>{if(!t)throw new Error(e(s,n))});const i={},r=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),a=t=>/^0[^.\s]+$/u.test(t);function o(t){let e;return()=>(void 0===e&&(e=t()),e)}const h=t=>t;class l{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 i=0;i<n;i++){const n=this.subscriptions[i];n&&n(t,e,s)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const u=t=>1e3*t,c=t=>t/1e3;function d(t,e){return e?t*(1e3/e):0}const p=t=>Array.isArray(t)&&"number"==typeof t[0],f=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"],m={value:null,addProjectionMetrics:null};function g(t,e){let s=!1,n=!0;const r={delta:0,timestamp:0,isProcessing:!1},a=()=>s=!0,o=f.reduce((t,s)=>(t[s]=function(t,e){let s=new Set,n=new Set,i=!1,r=!1;const a=new WeakSet;let o={delta:0,timestamp:0,isProcessing:!1},h=0;function l(e){a.has(e)&&(u.schedule(e),t()),h++,e(o)}const u={schedule:(t,e=!1,r=!1)=>{const o=r&&i?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,i?r=!0:(i=!0,[s,n]=[n,s],s.forEach(l),e&&m.value&&m.value.frameloop[e].push(h),h=0,s.clear(),i=!1,r&&(r=!1,u.process(t)))}};return u}(a,e?s:void 0),t),{}),{setup:h,read:l,resolveKeyframes:u,preUpdate:c,update:d,preRender:p,render:g,postRender:v}=o,y=()=>{const a=i.useManualTiming?r.timestamp:performance.now();s=!1,i.useManualTiming||(r.delta=n?1e3/60:Math.max(Math.min(a-r.timestamp,40),1)),r.timestamp=a,r.isProcessing=!0,h.process(r),l.process(r),u.process(r),c.process(r),d.process(r),p.process(r),g.process(r),v.process(r),r.isProcessing=!1,s&&e&&(n=!1,t(y))};return{schedule:f.reduce((e,i)=>{const a=o[i];return e[i]=(e,i=!1,o=!1)=>(s||(s=!0,n=!0,r.isProcessing||t(y)),a.schedule(e,i,o)),e},{}),cancel:t=>{for(let e=0;e<f.length;e++)o[f[e]].cancel(t)},state:r,steps:o}}const{schedule:v,cancel:y,state:b,steps:w}=g("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:h,!0);let V;function S(){V=void 0}const M={now:()=>(void 0===V&&M.set(b.isProcessing||i.useManualTiming?b.timestamp:performance.now()),V),set:t=>{V=t,queueMicrotask(S)}},T=t=>e=>"string"==typeof e&&e.startsWith(t),A=T("--"),C=T("var(--"),k=t=>!!C(t)&&x.test(t.split("/*")[0].trim()),x=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function F(t){return"string"==typeof t&&t.split("/*")[0].includes("var(--")}const E={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},B={...E,transform:e=>t(0,1,e)},P={...E,default:1},R=t=>Math.round(1e5*t)/1e5,I=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const N=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,O=(t,e)=>s=>Boolean("string"==typeof s&&N.test(s)&&s.startsWith(t)||e&&!function(t){return null==t}(s)&&Object.prototype.hasOwnProperty.call(s,e)),$=(t,e,s)=>n=>{if("string"!=typeof n)return n;const[i,r,a,o]=n.match(I);return{[t]:parseFloat(i),[e]:parseFloat(r),[s]:parseFloat(a),alpha:void 0!==o?parseFloat(o):1}},L={...E,transform:e=>Math.round((e=>t(0,255,e))(e))},Y={test:O("rgb","red"),parse:$("red","green","blue"),transform:({red:t,green:e,blue:s,alpha:n=1})=>"rgba("+L.transform(t)+", "+L.transform(e)+", "+L.transform(s)+", "+R(B.transform(n))+")"};const W={test:O("#"),parse:function(t){let e="",s="",n="",i="";return t.length>5?(e=t.substring(1,3),s=t.substring(3,5),n=t.substring(5,7),i=t.substring(7,9)):(e=t.substring(1,2),s=t.substring(2,3),n=t.substring(3,4),i=t.substring(4,5),e+=e,s+=s,n+=n,i+=i),{red:parseInt(e,16),green:parseInt(s,16),blue:parseInt(n,16),alpha:i?parseInt(i,16)/255:1}},transform:Y.transform},X=t=>({test:e=>"string"==typeof e&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),j=X("deg"),K=X("%"),U=X("px"),Z=X("vh"),z=X("vw"),D=(()=>({...K,parse:t=>K.parse(t)/100,transform:t=>K.transform(100*t)}))(),q={test:O("hsl","hue"),parse:$("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:s,alpha:n=1})=>"hsla("+Math.round(t)+", "+K.transform(R(e))+", "+K.transform(R(s))+", "+R(B.transform(n))+")"},H={test:t=>Y.test(t)||W.test(t)||q.test(t),parse:t=>Y.test(t)?Y.parse(t):q.test(t)?q.parse(t):W.parse(t),transform:t=>"string"==typeof t?t:t.hasOwnProperty("red")?Y.transform(t):q.transform(t),getAnimatableNone:t=>{const e=H.parse(t);return e.alpha=0,H.transform(e)}},_=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;const G="number",J="color",Q=/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 tt(t){const e=t.toString(),s=[],n={color:[],number:[],var:[]},i=[];let r=0;const a=e.replace(Q,t=>(H.test(t)?(n.color.push(r),i.push(J),s.push(H.parse(t))):t.startsWith("var(")?(n.var.push(r),i.push("var"),s.push(t)):(n.number.push(r),i.push(G),s.push(parseFloat(t))),++r,"${}")).split("${}");return{values:s,split:a,indexes:n,types:i}}function et(t){return tt(t).values}function st(t){const{split:e,types:s}=tt(t),n=e.length;return t=>{let i="";for(let r=0;r<n;r++)if(i+=e[r],void 0!==t[r]){const e=s[r];i+=e===G?R(t[r]):e===J?H.transform(t[r]):t[r]}return i}}const nt=t=>"number"==typeof t?0:H.test(t)?H.getAnimatableNone(t):t;const it={test:function(t){return isNaN(t)&&"string"==typeof t&&(t.match(I)?.length||0)+(t.match(_)?.length||0)>0},parse:et,createTransformer:st,getAnimatableNone:function(t){const e=et(t);return st(t)(e.map(nt))}},rt=(t,e,s)=>t+(e-t)*s,at=(t,e,s=10)=>{let n="";const i=Math.max(Math.round(e/s),2);for(let e=0;e<i;e++)n+=Math.round(1e4*t(e/(i-1)))/1e4+", ";return`linear(${n.substring(0,n.length-2)})`},ot=t=>null!==t;function ht(t,{repeat:e,repeatType:s="loop"},n,i=1){const r=t.filter(ot),a=i<0||e&&"loop"!==s&&e%2==1?0:r.length-1;return a&&void 0!==n?n:r[a]}class lt{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,e){return this.finished.then(t,e)}}const ut=t=>180*t/Math.PI,ct=t=>{const e=ut(Math.atan2(t[1],t[0]));return pt(e)},dt={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:ct,rotateZ:ct,skewX:t=>ut(Math.atan(t[1])),skewY:t=>ut(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},pt=t=>((t%=360)<0&&(t+=360),t),ft=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),mt=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),gt={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:ft,scaleY:mt,scale:t=>(ft(t)+mt(t))/2,rotateX:t=>pt(ut(Math.atan2(t[6],t[5]))),rotateY:t=>pt(ut(Math.atan2(-t[2],t[0]))),rotateZ:ct,rotate:ct,skewX:t=>ut(Math.atan(t[4])),skewY:t=>ut(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function vt(t){return t.includes("scale")?1:0}function yt(t,e){if(!t||"none"===t)return vt(e);const s=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let n,i;if(s)n=gt,i=s;else{const e=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);n=dt,i=e}if(!i)return vt(e);const r=n[e],a=i[1].split(",").map(wt);return"function"==typeof r?r(a):a[r]}const bt=(t,e)=>{const{transform:s="none"}=getComputedStyle(t);return yt(s,e)};function wt(t){return parseFloat(t.trim())}const Vt=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],St=(()=>new Set(Vt))(),Mt=t=>t===E||t===U,Tt=new Set(["x","y","z"]),At=Vt.filter(t=>!Tt.has(t));const Ct={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})=>yt(e,"x"),y:(t,{transform:e})=>yt(e,"y")};Ct.translateX=Ct.x,Ct.translateY=Ct.y;const kt=new Set;let xt=!1,Ft=!1,Et=!1;function Bt(){if(Ft){const t=Array.from(kt).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 At.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)})}Ft=!1,xt=!1,kt.forEach(t=>t.complete(Et)),kt.clear()}function Pt(){kt.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(Ft=!0)})}function Rt(){Et=!0,Pt(),Bt(),Et=!1}class It{constructor(t,e,s,n,i,r=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=e,this.name=s,this.motionValue=n,this.element=i,this.isAsync=r}scheduleResolve(){this.state="scheduled",this.isAsync?(kt.add(this),xt||(xt=!0,v.read(Pt),v.resolveKeyframes(Bt))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:e,element:s,motionValue:n}=this;if(null===t[0]){const i=n?.get(),r=t[t.length-1];if(void 0!==i)t[0]=i;else if(s&&e){const n=s.readValue(e,r);null!=n&&(t[0]=n)}void 0===t[0]&&(t[0]=r),n&&void 0===i&&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),kt.delete(this)}cancel(){"scheduled"===this.state&&(kt.delete(this),this.state="pending")}resume(){"pending"===this.state&&this.scheduleResolve()}}const Nt={};function Ot(t,e){const s=o(t);return()=>Nt[e]??s()}const $t=Ot(()=>void 0!==window.ScrollTimeline,"scrollTimeline"),Lt=Ot(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0},"linearEasing"),Yt=([t,e,s,n])=>`cubic-bezier(${t}, ${e}, ${s}, ${n})`,Wt={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Yt([0,.65,.55,1]),circOut:Yt([.55,0,1,.45]),backIn:Yt([.31,.01,.66,-.59]),backOut:Yt([.33,1.53,.69,.99])};function Xt(t,e){return t?"function"==typeof t?Lt()?at(t,e):"ease-out":p(t)?Yt(t):Array.isArray(t)?t.map(t=>Xt(t,e)||Wt.easeOut):Wt[t]:void 0}function jt(t,e,s,{delay:n=0,duration:i=300,repeat:r=0,repeatType:a="loop",ease:o="easeOut",times:h}={},l=void 0){const u={[e]:s};h&&(u.offset=h);const c=Xt(o,i);Array.isArray(c)&&(u.easing=c);const d={delay:n,duration:i,easing:Array.isArray(c)?"linear":c,fill:"both",iterations:r+1,direction:"reverse"===a?"alternate":"normal"};l&&(d.pseudoElement=l);return t.animate(u,d)}function Kt(t){return"function"==typeof t&&"applyToOptions"in t}class Ut extends lt{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:e,name:s,keyframes:i,pseudoElement:r,allowFlatten:a=!1,finalKeyframe:o,onComplete:h}=t;this.isPseudoElement=Boolean(r),this.allowFlatten=a,this.options=t,n("string"!=typeof t.type,'Mini animate() doesn\'t support "type" as a string.',"mini-spring");const l=function({type:t,...e}){return Kt(t)&&Lt()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}(t);this.animation=jt(e,s,i,l,r),!1===l.autoplay&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!r){const t=ht(i,this.options,o,this.speed);this.updateMotionValue?this.updateMotionValue(t):function(t,e,s){(t=>t.startsWith("--"))(e)?t.style.setProperty(e,s):t.style[e]=s}(e,s,t),this.animation.cancel()}h?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),"finished"===this.state&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch(t){}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;"idle"!==t&&"finished"!==t&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){const t=this.options?.element;!this.isPseudoElement&&t?.isConnected&&this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return c(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+c(t)}get time(){return c(Number(this.animation.currentTime)||0)}set time(t){this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=u(t)}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return null!==this.finishedTime?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,observe:e}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&$t()?(this.animation.timeline=t,h):e(this)}}function Zt(t){const e=[{},{}];return t?.values.forEach((t,s)=>{e[0][s]=t.get(),e[1][s]=t.getVelocity()}),e}function zt(t,e,s,n){if("function"==typeof e){const[i,r]=Zt(n);e=e(void 0!==s?s:t.custom,i,r)}if("string"==typeof e&&(e=t.variants&&t.variants[e]),"function"==typeof e){const[i,r]=Zt(n);e=e(void 0!==s?s:t.custom,i,r)}return e}class Dt{constructor(t,e={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=t=>{const e=M.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=M.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 l);const s=this.events[t].add(e);return"change"===t?()=>{s(),v.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=M.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;const e=Math.min(this.updatedAt-this.prevUpdatedAt,30);return d(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 qt(t,e){return new Dt(t,e)}const Ht=t=>Boolean(t&&t.getVelocity);function _t(t){return t.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const Gt="data-"+_t("framerAppearId"),Jt=t=>e=>e.test(t),Qt=[E,U,K,j,z,Z,{test:t=>"auto"===t,parse:t=>t}],te=t=>Qt.find(Jt(t)),ee=new Set(["brightness","contrast","saturate","opacity"]);function se(t){const[e,s]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[n]=s.match(I)||[];if(!n)return t;const i=s.replace(n,"");let r=ee.has(e)?1:0;return n!==s&&(r*=100),e+"("+r+i+")"}const ne=/\b([a-z-]*)\(.*?\)/gu,ie={...it,getAnimatableNone:t=>{const e=t.match(ne);return e?e.map(se).join(" "):t}},re={...it,getAnimatableNone:t=>{const e=it.parse(t);return it.createTransformer(t)(e.map(t=>"number"==typeof t?0:"object"==typeof t?{...t,alpha:1}:t))}},ae={...E,transform:Math.round},oe={borderWidth:U,borderTopWidth:U,borderRightWidth:U,borderBottomWidth:U,borderLeftWidth:U,borderRadius:U,borderTopLeftRadius:U,borderTopRightRadius:U,borderBottomRightRadius:U,borderBottomLeftRadius:U,width:U,maxWidth:U,height:U,maxHeight:U,top:U,right:U,bottom:U,left:U,inset:U,insetBlock:U,insetBlockStart:U,insetBlockEnd:U,insetInline:U,insetInlineStart:U,insetInlineEnd:U,padding:U,paddingTop:U,paddingRight:U,paddingBottom:U,paddingLeft:U,paddingBlock:U,paddingBlockStart:U,paddingBlockEnd:U,paddingInline:U,paddingInlineStart:U,paddingInlineEnd:U,margin:U,marginTop:U,marginRight:U,marginBottom:U,marginLeft:U,marginBlock:U,marginBlockStart:U,marginBlockEnd:U,marginInline:U,marginInlineStart:U,marginInlineEnd:U,fontSize:U,backgroundPositionX:U,backgroundPositionY:U,...{rotate:j,rotateX:j,rotateY:j,rotateZ:j,scale:P,scaleX:P,scaleY:P,scaleZ:P,skew:j,skewX:j,skewY:j,distance:U,translateX:U,translateY:U,translateZ:U,x:U,y:U,z:U,perspective:U,transformPerspective:U,opacity:B,originX:D,originY:D,originZ:U},zIndex:ae,fillOpacity:B,strokeOpacity:B,numOctaves:ae},he={...oe,color:H,backgroundColor:H,outlineColor:H,fill:H,stroke:H,borderColor:H,borderTopColor:H,borderRightColor:H,borderBottomColor:H,borderLeftColor:H,filter:ie,WebkitFilter:ie,mask:re,WebkitMask:re},le=t=>he[t],ue=new Set([ie,re]);function ce(t,e){let s=le(t);return ue.has(s)||(s=it),s.getAnimatableNone?s.getAnimatableNone(e):void 0}const de=new Set(["opacity","clipPath","filter","transform"]),pe=(t,e)=>e&&"number"==typeof t?e.transform(t):t,{schedule:fe,cancel:me}=g(queueMicrotask,!1),ge=[...Qt,H,it],ve=()=>({x:{min:0,max:0},y:{min:0,max:0}}),ye=new WeakMap;function be(t){return null!==t&&"object"==typeof t&&"function"==typeof t.start}function we(t){return"string"==typeof t||Array.isArray(t)}const Ve=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Se=["initial",...Ve];function Me(t){return be(t.animate)||Se.some(e=>we(t[e]))}function Te(t){return Boolean(Me(t)||t.variants)}const Ae={current:null},Ce={current:!1},ke="undefined"!=typeof window;const xe=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let Fe={};function Ee(t){Fe=t}function Be(){return Fe}class Pe{scrapeMotionValuesFromProps(t,e,s){return{}}constructor({parent:t,props:e,presenceContext:s,reducedMotionConfig:n,skipAnimations:i,blockInitialAnimation:r,visualState:a},o={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=It,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,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=M.now();this.renderScheduledAt<t&&(this.renderScheduledAt=t,v.render(this.render,!1,!0))};const{latestValues:h,renderState:l}=a;this.latestValues=h,this.baseTarget={...h},this.initialValues=e.initial?{...h}:{},this.renderState=l,this.parent=t,this.props=e,this.presenceContext=s,this.depth=t?t.depth+1:0,this.reducedMotionConfig=n,this.skipAnimationsConfig=i,this.options=o,this.blockInitialAnimation=Boolean(r),this.isControllingVariants=Me(e),this.isVariantNode=Te(e),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const{willChange:u,...c}=this.scrapeMotionValuesFromProps(e,{},this);for(const t in c){const e=c[t];void 0!==h[t]&&Ht(e)&&e.set(h[t])}}mount(t){if(this.hasBeenMounted)for(const t in this.initialValues)this.values.get(t)?.jump(this.initialValues[t]),this.latestValues[t]=this.initialValues[t];this.current=t,ye.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:(Ce.current||function(){if(Ce.current=!0,ke)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Ae.current=t.matches;t.addEventListener("change",e),e()}else Ae.current=!1}(),this.shouldReduceMotion=Ae.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),y(this.notifyUpdate),y(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){if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),e.accelerate&&de.has(t)&&this.current instanceof HTMLElement){const{factory:s,keyframes:n,times:i,ease:r,duration:a}=e.accelerate,o=new Ut({element:this.current,name:t,keyframes:n,times:i,ease:r,duration:u(a)}),h=s(o);return void this.valueSubscriptions.set(t,()=>{h(),o.cancel()})}const s=St.has(t);s&&this.onBindTransform&&this.onBindTransform();const n=e.on("change",e=>{this.latestValues[t]=e,this.props.onUpdate&&v.preRender(this.notifyUpdate),s&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let i;"undefined"!=typeof window&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,t,e)),this.valueSubscriptions.set(t,()=>{n(),i&&i(),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 Fe){const e=Fe[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<xe.length;e++){const s=xe[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 i=e[n],r=s[n];if(Ht(i))t.addValue(n,i);else if(Ht(r))t.addValue(n,qt(i,{owner:t}));else if(r!==i)if(t.hasValue(n)){const e=t.getValue(n);!0===e.liveStyle?e.jump(i):e.hasAnimated||e.set(i)}else{const e=t.getStaticValue(n);t.addValue(n,qt(void 0!==e?e:i,{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=qt(null===e?void 0:e,{owner:this}),this.addValue(t,s)),s}readValue(t,e){let s=void 0===this.latestValues[t]&&this.current?this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options):this.latestValues[t];var n;return null!=s&&("string"==typeof s&&(r(s)||a(s))?s=parseFloat(s):(n=s,!ge.find(Jt(n))&&it.test(e)&&(s=ce(t,e))),this.setBaseTarget(t,Ht(s)?s.get():s)),Ht(s)?s.get():s}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=zt(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||Ht(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 l),this.events[t].add(e)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}scheduleRenderMicrotask(){fe.render(this.render)}}const Re={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Ie=Vt.length;function Ne(t,e,s){const{style:n,vars:i,transformOrigin:r}=t;let a=!1,o=!1;for(const t in e){const s=e[t];if(St.has(t))a=!0;else if(A(t))i[t]=s;else{const e=pe(s,oe[t]);t.startsWith("origin")?(o=!0,r[t]=e):n[t]=e}}if(e.transform||(a||s?n.transform=function(t,e,s){let n="",i=!0;for(let r=0;r<Ie;r++){const a=Vt[r],o=t[a];if(void 0===o)continue;let h=!0;if("number"==typeof o)h=o===(a.startsWith("scale")?1:0);else{const t=parseFloat(o);h=a.startsWith("scale")?1===t:0===t}if(!h||s){const t=pe(o,oe[a]);h||(i=!1,n+=`${Re[a]||a}(${t}) `),s&&(e[a]=t)}}return n=n.trim(),s?n=s(e,i?"":n):i&&(n="none"),n}(e,t.transform,s):n.transform&&(n.transform="none")),o){const{originX:t="50%",originY:e="50%",originZ:s=0}=r;n.transformOrigin=`${t} ${e} ${s}`}}function Oe(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const $e={correct:(t,e)=>{if(!e.target)return t;if("string"==typeof t){if(!U.test(t))return t;t=parseFloat(t)}return`${Oe(t,e.target.x)}% ${Oe(t,e.target.y)}%`}},Le={correct:(t,{treeScale:e,projectionDelta:s})=>{const n=t,i=it.parse(t);if(i.length>5)return n;const r=it.createTransformer(t),a="number"!=typeof i[0]?1:0,o=s.x.scale*e.x,h=s.y.scale*e.y;i[0+a]/=o,i[1+a]/=h;const l=rt(o,h,.5);return"number"==typeof i[2+a]&&(i[2+a]/=l),"number"==typeof i[3+a]&&(i[3+a]/=l),r(i)}},Ye={borderRadius:{...$e,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:$e,borderTopRightRadius:$e,borderBottomLeftRadius:$e,borderBottomRightRadius:$e,boxShadow:Le};function We(t,{layout:e,layoutId:s}){return St.has(t)||t.startsWith("origin")||(e||void 0!==s)&&(!!Ye[t]||"opacity"===t)}function Xe(t,e,s){const n=t.style,i=e?.style,r={};if(!n)return r;for(const e in n)(Ht(n[e])||i&&Ht(i[e])||We(e,t)||void 0!==s?.getValue(e)?.liveStyle)&&(r[e]=n[e]);return r}const je={offset:"stroke-dashoffset",array:"stroke-dasharray"},Ke={offset:"strokeDashoffset",array:"strokeDasharray"};const Ue=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function Ze(t,{attrX:e,attrY:s,attrScale:n,pathLength:i,pathSpacing:r=1,pathOffset:a=0,...o},h,l,u){if(Ne(t,o,l),h)return void(t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox));t.attrs=t.style,t.style={};const{attrs:c,style:d}=t;c.transform&&(d.transform=c.transform,delete c.transform),(d.transform||c.transformOrigin)&&(d.transformOrigin=c.transformOrigin??"50% 50%",delete c.transformOrigin),d.transform&&(d.transformBox=u?.transformBox??"fill-box",delete c.transformBox);for(const t of Ue)void 0!==c[t]&&(d[t]=c[t],delete c[t]);void 0!==e&&(c.x=e),void 0!==s&&(c.y=s),void 0!==n&&(c.scale=n),void 0!==i&&function(t,e,s=1,n=0,i=!0){t.pathLength=1;const r=i?je:Ke;t[r.offset]=""+-n,t[r.array]=`${e} ${s}`}(c,i,r,a,!1)}const ze=t=>"string"==typeof t&&"svg"===t.toLowerCase();function De(t,e,s){const n=Xe(t,e,s);for(const s in t)if(Ht(t[s])||Ht(e[s])){n[-1!==Vt.indexOf(s)?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s]=t[s]}return n}const qe=["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 He(t){return"string"==typeof t&&!t.includes("-")&&!!(qe.indexOf(t)>-1||/[A-Z]/u.test(t))}export{Ct as $,it as A,tt as B,v as C,y as D,b as E,M as F,c as G,d as H,u as I,t as J,at as K,ht as L,i as M,Ut as N,Kt as O,o as P,It as Q,Rt as R,r as S,St as T,Vt as U,qt as V,lt as W,a as X,ce as Y,te as Z,F as _,Me as a,Mt as a0,Pe as a1,vt as a2,bt as a3,A as a4,_t as a5,ve as a6,le as a7,Se as a8,Ve as a9,we as b,We as c,Ne as d,Ze as e,ze as f,He as g,Te as h,Ht as i,be as j,De as k,Be as l,Ee as m,h as n,Gt as o,p,n as q,zt as r,Xe as s,rt as t,Y as u,q as v,s as w,W as x,k as y,H as z};
|