@fluidattacks/design 3.1.11 → 3.1.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_commonjsHelpers-C6fGbg64.mjs +6 -0
- package/dist/components/@core/index.js +18 -1
- package/dist/components/accordion/accordion-content/index.js +22 -1
- package/dist/components/accordion/index.js +78 -1
- package/dist/components/alert/index.js +162 -4
- package/dist/components/button/index.js +69 -1
- package/dist/components/card/card-header/index.js +83 -1
- package/dist/components/card/card-with-image/index.js +93 -1
- package/dist/components/card/card-with-input/index.js +106 -3
- package/dist/components/card/card-with-selector/index.js +71 -1
- package/dist/components/card/card-with-switch/index.js +50 -1
- package/dist/components/card/index.js +12 -1
- package/dist/components/carousel/index.js +62 -10
- package/dist/components/checkbox/index.js +118 -3
- package/dist/components/cloud-image/index.js +8 -1
- package/dist/components/code-snippet/index.js +72 -1
- package/dist/components/code-snippet/location-code/index.js +171 -1
- package/dist/components/colors/index.js +224 -1
- package/dist/components/confirm-dialog/index.js +46 -1
- package/dist/components/container/index.js +51 -3
- package/dist/components/content-card/category-tag/index.js +42 -1
- package/dist/components/content-card/event-date/index.js +61 -1
- package/dist/components/content-card/index.js +168 -3
- package/dist/components/content-card-carousel/index.js +95 -1
- package/dist/components/content-card-carousel/scroll-buttons/index.js +9 -1
- package/dist/components/divider/index.js +25 -1
- package/dist/components/empty-state/empty-button/index.js +6 -1
- package/dist/components/empty-state/index.js +58 -8
- package/dist/components/file-preview/index.js +31 -3
- package/dist/components/form/index.js +63 -3
- package/dist/components/grid-container/index.js +46 -5
- package/dist/components/group-selector/index.js +135 -1
- package/dist/components/group-selector/option-container/index.js +12 -1
- package/dist/components/icon/index.js +102 -4
- package/dist/components/icon-button/index.js +76 -3
- package/dist/components/indicator-card/index.js +74 -1
- package/dist/components/info-sidebar/index.js +116 -1
- package/dist/components/inputs/fields/combobox/index.js +146 -1
- package/dist/components/inputs/fields/combobox/option/index.js +8 -1
- package/dist/components/inputs/fields/date/calendar/cell/index.js +27 -1
- package/dist/components/inputs/fields/date/calendar/grid/index.js +26 -1
- package/dist/components/inputs/fields/date/calendar/header/index.js +38 -1
- package/dist/components/inputs/fields/date/calendar/index.js +30 -1
- package/dist/components/inputs/fields/date/index.js +68 -1
- package/dist/components/inputs/fields/date-range/calendar/index.js +35 -1
- package/dist/components/inputs/fields/date-range/index.js +108 -3
- package/dist/components/inputs/fields/date-time/calendar/index.js +60 -5
- package/dist/components/inputs/fields/date-time/index.js +69 -1
- package/dist/components/inputs/fields/editable/index.js +28 -1
- package/dist/components/inputs/fields/input/index.js +77 -1
- package/dist/components/inputs/fields/input-file/index.js +117 -4
- package/dist/components/inputs/fields/input-tags/index.js +63 -2
- package/dist/components/inputs/fields/number/index.js +57 -1
- package/dist/components/inputs/fields/number-range/index.js +49 -1
- package/dist/components/inputs/fields/phone/index.js +574 -11
- package/dist/components/inputs/fields/text-area/index.js +81 -1
- package/dist/components/inputs/index.js +28 -1
- package/dist/components/inputs/label/index.js +38 -1
- package/dist/components/inputs/outline-container/index.js +104 -1
- package/dist/components/inputs/utils/action-button/index.js +31 -1
- package/dist/components/inputs/utils/calendar-button/index.js +37 -1
- package/dist/components/inputs/utils/date-selector/index.js +62 -1
- package/dist/components/inputs/utils/date-time-field/index.js +133 -1
- package/dist/components/inputs/utils/dialog/index.js +14 -1
- package/dist/components/inputs/utils/number-field/index.js +86 -1
- package/dist/components/inputs/utils/popover/index.js +44 -1
- package/dist/components/interactive-card/icon/index.js +7 -1
- package/dist/components/interactive-card/index.js +118 -1
- package/dist/components/language-selector/index.js +37 -1
- package/dist/components/language-selector/item-list/index.js +8 -1
- package/dist/components/link/index.js +106 -7
- package/dist/components/list-item/index.js +67 -1
- package/dist/components/little-flag/index.js +32 -3
- package/dist/components/loading/index.js +55 -14
- package/dist/components/logo/index.js +13 -1
- package/dist/components/logo-carousel/index.js +45 -4
- package/dist/components/lottie/index.js +20 -3
- package/dist/components/menu/index.js +67 -1
- package/dist/components/message-banner/index.js +87 -4
- package/dist/components/modal/index.js +65 -1
- package/dist/components/modal/modal-confirm/index.js +51 -1
- package/dist/components/modal/modal-footer/index.js +25 -1
- package/dist/components/modal/modal-header/index.js +51 -1
- package/dist/components/notification/index.js +113 -5
- package/dist/components/notification-sign/index.js +43 -6
- package/dist/components/number-input/index.js +62 -7
- package/dist/components/oauth-selector/index.js +100 -1
- package/dist/components/oauth-selector/option-container/index.js +76 -1
- package/dist/components/plan-card/index.js +155 -5
- package/dist/components/plan-card/recommended-tag/index.js +31 -1
- package/dist/components/pop-up/description/index.js +51 -1
- package/dist/components/pop-up/index.js +152 -1
- package/dist/components/premium-feature/index.js +85 -3
- package/dist/components/priority-score/index.js +29 -1
- package/dist/components/progress/index.js +36 -3
- package/dist/components/progress-bar/index.js +153 -5
- package/dist/components/radio-button/index.js +125 -3
- package/dist/components/scroll-button/index.js +38 -2
- package/dist/components/search/index.js +105 -7
- package/dist/components/search-bar/index.js +219 -1
- package/dist/components/search-bar/item-searching/index.js +10 -1
- package/dist/components/severity-badge/index.js +74 -1
- package/dist/components/severity-overview/badge/index.js +69 -1
- package/dist/components/severity-overview/index.js +17 -1
- package/dist/components/show-on-hover/index.js +31 -3
- package/dist/components/slide-out-menu/index.js +3456 -3
- package/dist/components/slide-out-menu/menu-item/index.js +67 -1
- package/dist/components/slider/index.js +124 -7
- package/dist/components/slider/thumb/index.js +17 -1
- package/dist/components/step-lapse/index.js +153 -9
- package/dist/components/table-button/index.js +97 -3
- package/dist/components/tabs/fixed-tabs/index.js +29 -1
- package/dist/components/tabs/index.js +57 -1
- package/dist/components/tabs/tab/index.js +39 -1
- package/dist/components/tag/index.js +184 -3
- package/dist/components/timeline/card/index.js +9 -1
- package/dist/components/timeline/index.js +17 -1
- package/dist/components/toggle/index.js +85 -14
- package/dist/components/toggle-buttons/index.js +103 -5
- package/dist/components/tooltip/index.js +13 -1
- package/dist/components/tour/index.js +4549 -4
- package/dist/components/typography/heading/index.js +47 -1
- package/dist/components/typography/index.js +8 -1
- package/dist/components/typography/span/index.js +41 -1
- package/dist/components/typography/text/index.js +47 -1
- package/dist/components/web-form/index.js +68 -7
- package/dist/hooks/index.js +13 -1
- package/dist/index-BMHVi812.mjs +234 -0
- package/dist/index-BzAniA2J.mjs +135 -0
- package/dist/index-C6LbClYh.mjs +146 -0
- package/dist/index-CAIe8hBv.mjs +130 -0
- package/dist/index-CUQBAqt_.mjs +75 -0
- package/dist/index-CWlrSlUk.mjs +68 -0
- package/dist/index-Ckmu1TfV.mjs +86 -0
- package/dist/index-DwznImvK.mjs +1678 -0
- package/dist/index-maWH3JYC.mjs +3561 -0
- package/dist/index.js +206 -1
- package/dist/styles-B2N0JLw1.mjs +114 -0
- package/dist/styles-B64DVBIF.mjs +115 -0
- package/dist/{styles-BAhpqi6C.mjs → styles-BXFVwnWT.mjs} +28 -28
- package/dist/styles-BZQOqe8p.mjs +141 -0
- package/dist/styles-Bdque9TT.mjs +65 -0
- package/dist/styles-BlHspTrz.mjs +144 -0
- package/dist/styles-CROOwXEH.mjs +76 -0
- package/dist/styles-CplEd2kw.mjs +228 -0
- package/dist/styles-D1eTIklB.mjs +110 -0
- package/dist/styles-ePGii_9g.mjs +74 -0
- package/dist/use-carousel-CgAF78h3.mjs +23 -0
- package/dist/use-click-outside-BUll8Ag-.mjs +18 -0
- package/dist/use-cloudinary-image-BCxwj15o.mjs +1176 -0
- package/dist/use-modal-CtgexKnf.mjs +14 -0
- package/dist/use-search-Dj47QDw9.mjs +15 -0
- package/dist/utils-V0EumEPM.mjs +6 -0
- package/package.json +1 -3
- package/dist/_commonjsHelpers-C37NGDzP.js +0 -1
- package/dist/_commonjsHelpers-D6CrkqQz.mjs +0 -6
- package/dist/index-BH27NQKA.mjs +0 -2311
- package/dist/index-Bcw2vW_n.mjs +0 -75
- package/dist/index-C0_LPuYU.mjs +0 -106
- package/dist/index-C8zdgAVH.mjs +0 -82
- package/dist/index-CA_9DXWd.js +0 -5
- package/dist/index-CmylnDrF.js +0 -14
- package/dist/index-DUMgwAbO.js +0 -26
- package/dist/index-DpQYiwGu.js +0 -5
- package/dist/index-Dy8ZUIYs.js +0 -5
- package/dist/index-JPf5Yzg6.js +0 -17
- package/dist/index-OBZtKZuT.mjs +0 -1021
- package/dist/index-SsXlDjK4.mjs +0 -122
- package/dist/index-TKLFHcRp.js +0 -18
- package/dist/index-TnyKqJHo.mjs +0 -61
- package/dist/index-Yr95Cb7Z.mjs +0 -54
- package/dist/index-h9-U5wxq.mjs +0 -209
- package/dist/index-qCiUU4sZ.js +0 -9
- package/dist/index-qe0nJwzl.js +0 -15
- package/dist/styles--Elze-LV.js +0 -3
- package/dist/styles-3pR4Xdvy.js +0 -33
- package/dist/styles-59h91S9m.mjs +0 -65
- package/dist/styles-BCwLWpC3.mjs +0 -126
- package/dist/styles-BJ7-0I5X.mjs +0 -74
- package/dist/styles-BKObp9bh.mjs +0 -76
- package/dist/styles-BWVdbvFu.js +0 -5
- package/dist/styles-Bl-CstrT.js +0 -5
- package/dist/styles-Bn42XCW5.js +0 -7
- package/dist/styles-C2CoGJl7.js +0 -33
- package/dist/styles-CNzziAXG.js +0 -5
- package/dist/styles-CdD9waPD.js +0 -29
- package/dist/styles-CnKTwnFk.mjs +0 -110
- package/dist/styles-D4R-eerv.mjs +0 -77
- package/dist/styles-DNIIhyRC.mjs +0 -144
- package/dist/styles-DV8yOaqV.mjs +0 -131
- package/dist/styles-DYoftbd3.js +0 -42
- package/dist/styles-DlmKLhPh.js +0 -7
- package/dist/styles-be8gOdgy.mjs +0 -106
- package/dist/use-carousel-64dKFW4E.js +0 -1
- package/dist/use-carousel-D7xeL3YZ.mjs +0 -17
- package/dist/use-click-outside-BqkLISED.js +0 -1
- package/dist/use-click-outside-C4Z4pdiW.mjs +0 -18
- package/dist/use-cloudinary-image-DKMl7jbx.mjs +0 -612
- package/dist/use-cloudinary-image-YMMafagv.js +0 -1
- package/dist/use-modal-CNbLSSQb.mjs +0 -14
- package/dist/use-modal-_bYY6M_n.js +0 -1
- package/dist/use-search-75ip5xR-.mjs +0 -12
- package/dist/use-search-DeL4UDMh.js +0 -1
- package/dist/utils-C2whpEd3.js +0 -1
- package/dist/utils-Da0qL35u.mjs +0 -4
|
@@ -1,3 +1,3456 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),e=require("react"),n=require("styled-components"),s=require("./menu-item/index.js"),i=require("../button/index.js"),r=require("../container/index.js"),o=require("../icon-button/index.js");require("../typography/heading/index.js"),require("../typography/span/index.js");const a=require("../typography/text/index.js"),l=require("../../use-click-outside-BqkLISED.js");require("lodash");const u=new Set;function c(t,e,n){t||u.has(e)||u.add(e)}function h(t){return null!==t&&"object"==typeof t&&"function"==typeof t.start}const d=t=>Array.isArray(t);function p(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let s=0;s<n;s++)if(e[s]!==t[s])return!1;return!0}function m(t){return"string"==typeof t||Array.isArray(t)}function f(t){const e=[{},{}];return null==t||t.values.forEach(((t,n)=>{e[0][n]=t.get(),e[1][n]=t.getVelocity()})),e}function v(t,e,n,s){if("function"==typeof e){const[i,r]=f(s);e=e(void 0!==n?n:t.custom,i,r)}if("string"==typeof e&&(e=t.variants&&t.variants[e]),"function"==typeof e){const[i,r]=f(s);e=e(void 0!==n?n:t.custom,i,r)}return e}function y(t,e,n){const s=t.getProps();return v(s,e,void 0!==n?n:s.custom,t)}const g=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],w=["initial",...g],b=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],x=new Set(b),S=t=>1e3*t,T=t=>t/1e3,A={type:"spring",stiffness:500,damping:25,restSpeed:10},C={type:"keyframes",duration:.8},V={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},M=(t,{keyframes:e})=>e.length>2?C:x.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:A:V;function P(t,e){return t?t[e]||t.default||t:void 0}const k=t=>null!==t;function E(t,{repeat:e,repeatType:n="loop"},s){const i=t.filter(k),r=e&&"loop"!==n&&e%2==1?0:i.length-1;return r&&void 0!==s?s:i[r]}const F=t=>t;let O=F,I=F;"production"!==process.env.NODE_ENV&&(O=(t,e)=>{},I=(t,e)=>{if(!t)throw new Error(e)});const R=["read","resolveKeyframes","update","preRender","render","postRender"];function j(t,e){let n=!1,s=!0;const i={delta:0,timestamp:0,isProcessing:!1},r=()=>n=!0,o=R.reduce(((t,e)=>(t[e]=function(t){let e=new Set,n=new Set,s=!1,i=!1;const r=new WeakSet;let o={delta:0,timestamp:0,isProcessing:!1};function a(e){r.has(e)&&(l.schedule(e),t()),e(o)}const l={schedule:(t,i=!1,o=!1)=>{const a=o&&s?e:n;return i&&r.add(t),a.has(t)||a.add(t),t},cancel:t=>{n.delete(t),r.delete(t)},process:t=>{o=t,s?i=!0:(s=!0,[e,n]=[n,e],e.forEach(a),e.clear(),s=!1,i&&(i=!1,l.process(t)))}};return l}(r),t)),{}),{read:a,resolveKeyframes:l,update:u,preRender:c,render:h,postRender:d}=o,p=()=>{const r=performance.now();n=!1,i.delta=s?1e3/60:Math.max(Math.min(r-i.timestamp,40),1),i.timestamp=r,i.isProcessing=!0,a.process(i),l.process(i),u.process(i),c.process(i),h.process(i),d.process(i),i.isProcessing=!1,n&&e&&(s=!1,t(p))};return{schedule:R.reduce(((e,r)=>{const a=o[r];return e[r]=(e,r=!1,o=!1)=>(n||(n=!0,s=!0,i.isProcessing||t(p)),a.schedule(e,r,o)),e}),{}),cancel:t=>{for(let e=0;e<R.length;e++)o[R[e]].cancel(t)},state:i,steps:o}}const{schedule:D,cancel:B,state:N,steps:L}=j("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:F,!0),$=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function K(t,e,n,s){if(t===e&&n===s)return F;return i=>0===i||1===i?i:$(function(t,e,n,s,i){let r,o,a=0;do{o=e+(n-e)/2,r=$(o,s,i)-t,r>0?n=o:e=o}while(Math.abs(r)>1e-7&&++a<12);return o}(i,0,1,t,n),e,s)}const W=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,q=t=>e=>1-t(1-e),U=K(.33,1.53,.69,.99),Y=q(U),z=W(Y),H=t=>(t*=2)<1?.5*Y(t):.5*(2-Math.pow(2,-10*(t-1))),X=t=>1-Math.sin(Math.acos(t)),_=q(X),G=W(X),Z=t=>/^0[^.\s]+$/u.test(t),J=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),Q=t=>e=>"string"==typeof e&&e.startsWith(t),tt=Q("--"),et=Q("var(--"),nt=t=>!!et(t)&&st.test(t.split("/*")[0].trim()),st=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,it=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function rt(t,e,n=1){I(n<=4,`Max CSS variable fallback depth detected in property "${t}". This may indicate a circular fallback dependency.`);const[s,i]=function(t){const e=it.exec(t);if(!e)return[,];const[,n,s,i]=e;return[`--${null!=n?n:s}`,i]}(t);if(!s)return;const r=window.getComputedStyle(e).getPropertyValue(s);if(r){const t=r.trim();return J(t)?parseFloat(t):t}return nt(i)?rt(i,e,n+1):i}const ot=(t,e,n)=>n>e?e:n<t?t:n,at={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},lt={...at,transform:t=>ot(0,1,t)},ut={...at,default:1},ct=t=>({test:e=>"string"==typeof e&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),ht=ct("deg"),dt=ct("%"),pt=ct("px"),mt=ct("vh"),ft=ct("vw"),vt={...dt,parse:t=>dt.parse(t)/100,transform:t=>dt.transform(100*t)},yt=new Set(["width","height","top","left","right","bottom","x","y","translateX","translateY"]),gt=t=>t===at||t===pt,wt=(t,e)=>parseFloat(t.split(", ")[e]),bt=(t,e)=>(n,{transform:s})=>{if("none"===s||!s)return 0;const i=s.match(/^matrix3d\((.+)\)$/u);if(i)return wt(i[1],e);{const e=s.match(/^matrix\((.+)\)$/u);return e?wt(e[1],t):0}},xt=new Set(["x","y","z"]),St=b.filter((t=>!xt.has(t))),Tt={width:({x:t},{paddingLeft:e="0",paddingRight:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),height:({y:t},{paddingTop:e="0",paddingBottom:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),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:bt(4,13),y:bt(5,14)};Tt.translateX=Tt.x,Tt.translateY=Tt.y;const At=t=>e=>e.test(t),Ct=[at,pt,dt,ht,ft,mt,{test:t=>"auto"===t,parse:t=>t}],Vt=t=>Ct.find(At(t)),Mt=new Set;let Pt=!1,kt=!1;function Et(){if(kt){const t=Array.from(Mt).filter((t=>t.needsMeasurement)),e=new Set(t.map((t=>t.element))),n=new Map;e.forEach((t=>{const e=function(t){const e=[];return St.forEach((n=>{const s=t.getValue(n);void 0!==s&&(e.push([n,s.get()]),s.set(n.startsWith("scale")?1:0))})),e}(t);e.length&&(n.set(t,e),t.render())})),t.forEach((t=>t.measureInitialState())),e.forEach((t=>{t.render();const e=n.get(t);e&&e.forEach((([e,n])=>{var s;null===(s=t.getValue(e))||void 0===s||s.set(n)}))})),t.forEach((t=>t.measureEndState())),t.forEach((t=>{void 0!==t.suspendedScrollY&&window.scrollTo(0,t.suspendedScrollY)}))}kt=!1,Pt=!1,Mt.forEach((t=>t.complete())),Mt.clear()}function Ft(){Mt.forEach((t=>{t.readKeyframes(),t.needsMeasurement&&(kt=!0)}))}class Ot{constructor(t,e,n,s,i,r=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...t],this.onComplete=e,this.name=n,this.motionValue=s,this.element=i,this.isAsync=r}scheduleResolve(){this.isScheduled=!0,this.isAsync?(Mt.add(this),Pt||(Pt=!0,D.read(Ft),D.resolveKeyframes(Et))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:e,element:n,motionValue:s}=this;for(let i=0;i<t.length;i++)if(null===t[i])if(0===i){const i=null==s?void 0:s.get(),r=t[t.length-1];if(void 0!==i)t[0]=i;else if(n&&e){const s=n.readValue(e,r);null!=s&&(t[0]=s)}void 0===t[0]&&(t[0]=r),s&&void 0===i&&s.set(t[0])}else t[i]=t[i-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),Mt.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,Mt.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const It=t=>Math.round(1e5*t)/1e5,Rt=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu,jt=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Dt=(t,e)=>n=>Boolean("string"==typeof n&&jt.test(n)&&n.startsWith(t)||e&&!(null==n)&&Object.prototype.hasOwnProperty.call(n,e)),Bt=(t,e,n)=>s=>{if("string"!=typeof s)return s;const[i,r,o,a]=s.match(Rt);return{[t]:parseFloat(i),[e]:parseFloat(r),[n]:parseFloat(o),alpha:void 0!==a?parseFloat(a):1}},Nt={...at,transform:t=>Math.round(ot(0,255,t))},Lt={test:Dt("rgb","red"),parse:Bt("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:s=1})=>"rgba("+Nt.transform(t)+", "+Nt.transform(e)+", "+Nt.transform(n)+", "+It(lt.transform(s))+")"},$t={test:Dt("#"),parse:function(t){let e="",n="",s="",i="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),s=t.substring(5,7),i=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),s=t.substring(3,4),i=t.substring(4,5),e+=e,n+=n,s+=s,i+=i),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(s,16),alpha:i?parseInt(i,16)/255:1}},transform:Lt.transform},Kt={test:Dt("hsl","hue"),parse:Bt("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:s=1})=>"hsla("+Math.round(t)+", "+dt.transform(It(e))+", "+dt.transform(It(n))+", "+It(lt.transform(s))+")"},Wt={test:t=>Lt.test(t)||$t.test(t)||Kt.test(t),parse:t=>Lt.test(t)?Lt.parse(t):Kt.test(t)?Kt.parse(t):$t.parse(t),transform:t=>"string"==typeof t?t:t.hasOwnProperty("red")?Lt.transform(t):Kt.transform(t)},qt=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu,Ut="number",Yt="color",zt=/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 Ht(t){const e=t.toString(),n=[],s={color:[],number:[],var:[]},i=[];let r=0;const o=e.replace(zt,(t=>(Wt.test(t)?(s.color.push(r),i.push(Yt),n.push(Wt.parse(t))):t.startsWith("var(")?(s.var.push(r),i.push("var"),n.push(t)):(s.number.push(r),i.push(Ut),n.push(parseFloat(t))),++r,"${}"))).split("${}");return{values:n,split:o,indexes:s,types:i}}function Xt(t){return Ht(t).values}function _t(t){const{split:e,types:n}=Ht(t),s=e.length;return t=>{let i="";for(let r=0;r<s;r++)if(i+=e[r],void 0!==t[r]){const e=n[r];i+=e===Ut?It(t[r]):e===Yt?Wt.transform(t[r]):t[r]}return i}}const Gt=t=>"number"==typeof t?0:t,Zt={test:function(t){var e,n;return isNaN(t)&&"string"==typeof t&&((null===(e=t.match(Rt))||void 0===e?void 0:e.length)||0)+((null===(n=t.match(qt))||void 0===n?void 0:n.length)||0)>0},parse:Xt,createTransformer:_t,getAnimatableNone:function(t){const e=Xt(t);return _t(t)(e.map(Gt))}},Jt=new Set(["brightness","contrast","saturate","opacity"]);function Qt(t){const[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[s]=n.match(Rt)||[];if(!s)return t;const i=n.replace(s,"");let r=Jt.has(e)?1:0;return s!==n&&(r*=100),e+"("+r+i+")"}const te=/\b([a-z-]*)\(.*?\)/gu,ee={...Zt,getAnimatableNone:t=>{const e=t.match(te);return e?e.map(Qt).join(" "):t}},ne={borderWidth:pt,borderTopWidth:pt,borderRightWidth:pt,borderBottomWidth:pt,borderLeftWidth:pt,borderRadius:pt,radius:pt,borderTopLeftRadius:pt,borderTopRightRadius:pt,borderBottomRightRadius:pt,borderBottomLeftRadius:pt,width:pt,maxWidth:pt,height:pt,maxHeight:pt,top:pt,right:pt,bottom:pt,left:pt,padding:pt,paddingTop:pt,paddingRight:pt,paddingBottom:pt,paddingLeft:pt,margin:pt,marginTop:pt,marginRight:pt,marginBottom:pt,marginLeft:pt,backgroundPositionX:pt,backgroundPositionY:pt},se={rotate:ht,rotateX:ht,rotateY:ht,rotateZ:ht,scale:ut,scaleX:ut,scaleY:ut,scaleZ:ut,skew:ht,skewX:ht,skewY:ht,distance:pt,translateX:pt,translateY:pt,translateZ:pt,x:pt,y:pt,z:pt,perspective:pt,transformPerspective:pt,opacity:lt,originX:vt,originY:vt,originZ:pt},ie={...at,transform:Math.round},re={...ne,...se,zIndex:ie,size:pt,fillOpacity:lt,strokeOpacity:lt,numOctaves:ie},oe={...re,color:Wt,backgroundColor:Wt,outlineColor:Wt,fill:Wt,stroke:Wt,borderColor:Wt,borderTopColor:Wt,borderRightColor:Wt,borderBottomColor:Wt,borderLeftColor:Wt,filter:ee,WebkitFilter:ee},ae=t=>oe[t];function le(t,e){let n=ae(t);return n!==ee&&(n=Zt),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const ue=new Set(["auto","none","0"]);class ce extends Ot{constructor(t,e,n,s,i){super(t,e,n,s,i,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:e,name:n}=this;if(!e||!e.current)return;super.readKeyframes();for(let a=0;a<t.length;a++){let n=t[a];if("string"==typeof n&&(n=n.trim(),nt(n))){const s=rt(n,e.current);void 0!==s&&(t[a]=s),a===t.length-1&&(this.finalKeyframe=n)}}if(this.resolveNoneKeyframes(),!yt.has(n)||2!==t.length)return;const[s,i]=t,r=Vt(s),o=Vt(i);if(r!==o)if(gt(r)&>(o))for(let a=0;a<t.length;a++){const e=t[a];"string"==typeof e&&(t[a]=parseFloat(e))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:e}=this,n=[];for(let i=0;i<t.length;i++)("number"==typeof(s=t[i])?0===s:null===s||"none"===s||"0"===s||Z(s))&&n.push(i);var s;n.length&&function(t,e,n){let s,i=0;for(;i<t.length&&!s;){const e=t[i];"string"==typeof e&&!ue.has(e)&&Ht(e).values.length&&(s=t[i]),i++}if(s&&n)for(const r of e)t[r]=le(n,s)}(t,n,e)}measureInitialState(){const{element:t,unresolvedKeyframes:e,name:n}=this;if(!t||!t.current)return;"height"===n&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Tt[n](t.measureViewportBox(),window.getComputedStyle(t.current)),e[0]=this.measuredOrigin;const s=e[e.length-1];void 0!==s&&t.getValue(n,s).jump(s,!1)}measureEndState(){var t;const{element:e,name:n,unresolvedKeyframes:s}=this;if(!e||!e.current)return;const i=e.getValue(n);i&&i.jump(this.measuredOrigin,!1);const r=s.length-1,o=s[r];s[r]=Tt[n](e.measureViewportBox(),window.getComputedStyle(e.current)),null!==o&&void 0===this.finalKeyframe&&(this.finalKeyframe=o),(null===(t=this.removedTransforms)||void 0===t?void 0:t.length)&&this.removedTransforms.forEach((([t,n])=>{e.getValue(t).set(n)})),this.resolveNoneKeyframes()}}function he(t){return"function"==typeof t}let de;function pe(){de=void 0}const me={now:()=>(void 0===de&&me.set(N.isProcessing?N.timestamp:performance.now()),de),set:t=>{de=t,queueMicrotask(pe)}},fe=(t,e)=>!("zIndex"===e||"number"!=typeof t&&!Array.isArray(t)&&("string"!=typeof t||!Zt.test(t)&&"0"!==t||t.startsWith("url(")));class ve{constructor({autoplay:t=!0,delay:e=0,type:n="keyframes",repeat:s=0,repeatDelay:i=0,repeatType:r="loop",...o}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=me.now(),this.options={autoplay:t,delay:e,type:n,repeat:s,repeatDelay:i,repeatType:r,...o},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt&&this.resolvedAt-this.createdAt>40?this.resolvedAt:this.createdAt}get resolved(){return this._resolved||this.hasAttemptedResolve||(Ft(),Et()),this._resolved}onKeyframesResolved(t,e){this.resolvedAt=me.now(),this.hasAttemptedResolve=!0;const{name:n,type:s,velocity:i,delay:r,onComplete:o,onUpdate:a,isGenerator:l}=this.options;if(!l&&!function(t,e,n,s){const i=t[0];if(null===i)return!1;if("display"===e||"visibility"===e)return!0;const r=t[t.length-1],o=fe(i,e),a=fe(r,e);return O(o===a,`You are trying to animate ${e} from "${i}" to "${r}". ${i} is not an animatable value - to enable this animation set ${i} to a value animatable to ${r} via the \`style\` property.`),!(!o||!a)&&(function(t){const e=t[0];if(1===t.length)return!0;for(let n=0;n<t.length;n++)if(t[n]!==e)return!0}(t)||("spring"===n||he(n))&&s)}(t,n,s,i)){if(!r)return null==a||a(E(t,this.options,e)),null==o||o(),void this.resolveFinishedPromise();this.options.duration=0}const u=this.initPlayback(t,e);!1!==u&&(this._resolved={keyframes:t,finalKeyframe:e,...u},this.onPostResolved())}onPostResolved(){}then(t,e){return this.currentFinishedPromise.then(t,e)}flatten(){this.options.type="keyframes",this.options.ease="linear"}updateFinishedPromise(){this.currentFinishedPromise=new Promise((t=>{this.resolveFinishedPromise=t}))}}const ye=(t,e,n)=>{const s=e-t;return 0===s?1:(n-t)/s},ge=(t,e,n=10)=>{let s="";const i=Math.max(Math.round(e/n),2);for(let r=0;r<i;r++)s+=t(ye(0,i-1,r))+", ";return`linear(${s.substring(0,s.length-2)})`};function we(t,e){return e?t*(1e3/e):0}function be(t,e,n){const s=Math.max(e-5,0);return we(n-t(s),e-s)}const xe=.01,Se=2,Te=.005,Ae=.5;const Ce=12;function Ve(t,e){return t*Math.sqrt(1-e*e)}const Me=2e4;function Pe(t){let e=0,n=t.next(e);for(;!n.done&&e<Me;)e+=50,n=t.next(e);return e>=Me?1/0:e}const ke=["duration","bounce"],Ee=["stiffness","damping","mass"];function Fe(t,e){return e.some((e=>void 0!==t[e]))}function Oe(t=.3,e=.3){const n="object"!=typeof t?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:s,restDelta:i}=n;const r=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],a={done:!1,value:r},{stiffness:l,damping:u,mass:c,duration:h,velocity:d,isResolvedFromDuration:p}=function(t){let e={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...t};if(!Fe(t,Ee)&&Fe(t,ke))if(t.visualDuration){const n=t.visualDuration,s=2*Math.PI/(1.2*n),i=s*s,r=2*ot(.05,1,1-t.bounce)*Math.sqrt(i);e={...e,mass:1,stiffness:i,damping:r}}else{const n=function({duration:t=800,bounce:e=.3,velocity:n=0,mass:s=1}){let i,r;O(t<=S(10),"Spring duration must be 10 seconds or less");let o=1-e;o=ot(.05,1,o),t=ot(.01,10,T(t)),o<1?(i=e=>{const s=e*o,i=s*t;return.001-(s-n)/Ve(e,o)*Math.exp(-i)},r=e=>{const s=e*o*t,r=s*n+n,a=Math.pow(o,2)*Math.pow(e,2)*t,l=Math.exp(-s),u=Ve(Math.pow(e,2),o);return(.001-i(e)>0?-1:1)*((r-a)*l)/u}):(i=e=>Math.exp(-e*t)*((e-n)*t+1)-.001,r=e=>Math.exp(-e*t)*(t*t*(n-e)));const a=function(t,e,n){let s=n;for(let i=1;i<Ce;i++)s-=t(s)/e(s);return s}(i,r,5/t);if(t=S(t),isNaN(a))return{stiffness:100,damping:10,duration:t};{const e=Math.pow(a,2)*s;return{stiffness:e,damping:2*o*Math.sqrt(s*e),duration:t}}}(t);e={...e,...n,mass:1},e.isResolvedFromDuration=!0}return e}({...n,velocity:-T(n.velocity||0)}),m=d||0,f=u/(2*Math.sqrt(l*c)),v=o-r,y=T(Math.sqrt(l/c)),g=Math.abs(v)<5;let w;if(s||(s=g?xe:Se),i||(i=g?Te:Ae),f<1){const t=Ve(y,f);w=e=>{const n=Math.exp(-f*y*e);return o-n*((m+f*y*v)/t*Math.sin(t*e)+v*Math.cos(t*e))}}else if(1===f)w=t=>o-Math.exp(-y*t)*(v+(m+y*v)*t);else{const t=y*Math.sqrt(f*f-1);w=e=>{const n=Math.exp(-f*y*e),s=Math.min(t*e,300);return o-n*((m+f*y*v)*Math.sinh(s)+t*v*Math.cosh(s))/t}}const b={calculatedDuration:p&&h||null,next:t=>{const e=w(t);if(p)a.done=t>=h;else{let n=0;f<1&&(n=0===t?S(m):be(w,t,e));const r=Math.abs(n)<=s,l=Math.abs(o-e)<=i;a.done=r&&l}return a.value=a.done?o:e,a},toString:()=>{const t=Math.min(Pe(b),Me),e=ge((e=>b.next(t*e).value),t,30);return t+"ms "+e}};return b}function Ie({keyframes:t,velocity:e=0,power:n=.8,timeConstant:s=325,bounceDamping:i=10,bounceStiffness:r=500,modifyTarget:o,min:a,max:l,restDelta:u=.5,restSpeed:c}){const h=t[0],d={done:!1,value:h},p=t=>void 0===a?l:void 0===l||Math.abs(a-t)<Math.abs(l-t)?a:l;let m=n*e;const f=h+m,v=void 0===o?f:o(f);v!==f&&(m=v-h);const y=t=>-m*Math.exp(-t/s),g=t=>v+y(t),w=t=>{const e=y(t),n=g(t);d.done=Math.abs(e)<=u,d.value=d.done?v:n};let b,x;const S=t=>{var e;e=d.value,(void 0!==a&&e<a||void 0!==l&&e>l)&&(b=t,x=Oe({keyframes:[d.value,p(d.value)],velocity:be(g,t,d.value),damping:i,stiffness:r,restDelta:u,restSpeed:c}))};return S(0),{calculatedDuration:null,next:t=>{let e=!1;return x||void 0!==b||(e=!0,w(t),S(t)),void 0!==b&&t>=b?x.next(t-b):(!e&&w(t),d)}}}const Re=K(.42,0,1,1),je=K(0,0,.58,1),De=K(.42,0,.58,1),Be=t=>Array.isArray(t)&&"number"==typeof t[0],Ne={linear:F,easeIn:Re,easeInOut:De,easeOut:je,circIn:X,circInOut:G,circOut:_,backIn:Y,backInOut:z,backOut:U,anticipate:H},Le=t=>{if(Be(t)){I(4===t.length,"Cubic bezier arrays must contain four numerical values.");const[e,n,s,i]=t;return K(e,n,s,i)}return"string"==typeof t?(I(void 0!==Ne[t],`Invalid easing type '${t}'`),Ne[t]):t},$e=(t,e)=>n=>e(t(n)),Ke=(...t)=>t.reduce($e),We=(t,e,n)=>t+(e-t)*n;function qe(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function Ue(t,e){return n=>n>0?e:t}const Ye=(t,e,n)=>{const s=t*t,i=n*(e*e-s)+s;return i<0?0:Math.sqrt(i)},ze=[$t,Lt,Kt];function He(t){const e=(n=t,ze.find((t=>t.test(n))));var n;if(O(Boolean(e),`'${t}' is not an animatable color. Use the equivalent color code instead.`),!Boolean(e))return!1;let s=e.parse(t);return e===Kt&&(s=function({hue:t,saturation:e,lightness:n,alpha:s}){t/=360,n/=100;let i=0,r=0,o=0;if(e/=100){const s=n<.5?n*(1+e):n+e-n*e,a=2*n-s;i=qe(a,s,t+1/3),r=qe(a,s,t),o=qe(a,s,t-1/3)}else i=r=o=n;return{red:Math.round(255*i),green:Math.round(255*r),blue:Math.round(255*o),alpha:s}}(s)),s}const Xe=(t,e)=>{const n=He(t),s=He(e);if(!n||!s)return Ue(t,e);const i={...n};return t=>(i.red=Ye(n.red,s.red,t),i.green=Ye(n.green,s.green,t),i.blue=Ye(n.blue,s.blue,t),i.alpha=We(n.alpha,s.alpha,t),Lt.transform(i))},_e=new Set(["none","hidden"]);function Ge(t,e){return n=>We(t,e,n)}function Ze(t){return"number"==typeof t?Ge:"string"==typeof t?nt(t)?Ue:Wt.test(t)?Xe:tn:Array.isArray(t)?Je:"object"==typeof t?Wt.test(t)?Xe:Qe:Ue}function Je(t,e){const n=[...t],s=n.length,i=t.map(((t,n)=>Ze(t)(t,e[n])));return t=>{for(let e=0;e<s;e++)n[e]=i[e](t);return n}}function Qe(t,e){const n={...t,...e},s={};for(const i in n)void 0!==t[i]&&void 0!==e[i]&&(s[i]=Ze(t[i])(t[i],e[i]));return t=>{for(const e in s)n[e]=s[e](t);return n}}const tn=(t,e)=>{const n=Zt.createTransformer(e),s=Ht(t),i=Ht(e);return s.indexes.var.length===i.indexes.var.length&&s.indexes.color.length===i.indexes.color.length&&s.indexes.number.length>=i.indexes.number.length?_e.has(t)&&!i.values.length||_e.has(e)&&!s.values.length?(r=t,o=e,_e.has(r)?t=>t<=0?r:o:t=>t>=1?o:r):Ke(Je(function(t,e){var n;const s=[],i={color:0,var:0,number:0};for(let r=0;r<e.values.length;r++){const o=e.types[r],a=t.indexes[o][i[o]],l=null!==(n=t.values[a])&&void 0!==n?n:0;s[r]=l,i[o]++}return s}(s,i),i.values),n):(O(!0,`Complex values '${t}' and '${e}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`),Ue(t,e));var r,o};function en(t,e,n){return"number"==typeof t&&"number"==typeof e&&"number"==typeof n?We(t,e,n):Ze(t)(t,e)}function nn({duration:t=300,keyframes:e,times:n,ease:s="easeInOut"}){const i=(l=s,Array.isArray(l)&&"number"!=typeof l[0]?s.map(Le):Le(s)),r={done:!1,value:e[0]},o=function(t,e){return t.map((t=>t*e))}(n&&n.length===e.length?n:function(t){const e=[0];return function(t,e){const n=t[t.length-1];for(let s=1;s<=e;s++){const i=ye(0,e,s);t.push(We(n,1,i))}}(e,t.length-1),e}(e),t),a=function(t,e,{clamp:n=!0,ease:s,mixer:i}={}){const r=t.length;if(I(r===e.length,"Both input and output ranges must be the same length"),1===r)return()=>e[0];if(2===r&&t[0]===t[1])return()=>e[1];t[0]>t[r-1]&&(t=[...t].reverse(),e=[...e].reverse());const o=function(t,e,n){const s=[],i=n||en,r=t.length-1;for(let o=0;o<r;o++){let n=i(t[o],t[o+1]);if(e){const t=Array.isArray(e)?e[o]||F:e;n=Ke(t,n)}s.push(n)}return s}(e,s,i),a=o.length,l=e=>{let n=0;if(a>1)for(;n<t.length-2&&!(e<t[n+1]);n++);const s=ye(t[n],t[n+1],e);return o[n](s)};return n?e=>l(ot(t[0],t[r-1],e)):l}(o,e,{ease:Array.isArray(i)?i:(u=e,c=i,u.map((()=>c||De)).splice(0,u.length-1))});var l,u,c;return{calculatedDuration:t,next:e=>(r.value=a(e),r.done=e>=t,r)}}const sn=t=>{const e=({timestamp:e})=>t(e);return{start:()=>D.update(e,!0),stop:()=>B(e),now:()=>N.isProcessing?N.timestamp:me.now()}},rn={decay:Ie,inertia:Ie,tween:nn,keyframes:nn,spring:Oe},on=t=>t/100;class an extends ve{constructor(t){super(t),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,"idle"===this.state)return;this.teardown();const{onStop:t}=this.options;t&&t()};const{name:e,motionValue:n,element:s,keyframes:i}=this.options,r=(null==s?void 0:s.KeyframeResolver)||Ot;this.resolver=new r(i,((t,e)=>this.onKeyframesResolved(t,e)),e,n,s),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(t){const{type:e="keyframes",repeat:n=0,repeatDelay:s=0,repeatType:i,velocity:r=0}=this.options,o=he(e)?e:rn[e]||nn;let a,l;o!==nn&&"number"!=typeof t[0]&&("production"!==process.env.NODE_ENV&&I(2===t.length,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${t}`),a=Ke(on,en(t[0],t[1])),t=[0,100]);const u=o({...this.options,keyframes:t});"mirror"===i&&(l=o({...this.options,keyframes:[...t].reverse(),velocity:-r})),null===u.calculatedDuration&&(u.calculatedDuration=Pe(u));const{calculatedDuration:c}=u,h=c+s;return{generator:u,mirroredGenerator:l,mapPercentToKeyframes:a,calculatedDuration:c,resolvedDuration:h,totalDuration:h*(n+1)-s}}onPostResolved(){const{autoplay:t=!0}=this.options;this.play(),"paused"!==this.pendingPlayState&&t?this.state=this.pendingPlayState:this.pause()}tick(t,e=!1){const{resolved:n}=this;if(!n){const{keyframes:t}=this.options;return{done:!0,value:t[t.length-1]}}const{finalKeyframe:s,generator:i,mirroredGenerator:r,mapPercentToKeyframes:o,keyframes:a,calculatedDuration:l,totalDuration:u,resolvedDuration:c}=n;if(null===this.startTime)return i.next(0);const{delay:h,repeat:d,repeatType:p,repeatDelay:m,onUpdate:f}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-u/this.speed,this.startTime)),e?this.currentTime=t:null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=Math.round(t-this.startTime)*this.speed;const v=this.currentTime-h*(this.speed>=0?1:-1),y=this.speed>=0?v<0:v>u;this.currentTime=Math.max(v,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=u);let g=this.currentTime,w=i;if(d){const t=Math.min(this.currentTime,u)/c;let e=Math.floor(t),n=t%1;!n&&t>=1&&(n=1),1===n&&e--,e=Math.min(e,d+1),Boolean(e%2)&&("reverse"===p?(n=1-n,m&&(n-=m/c)):"mirror"===p&&(w=r)),g=ot(0,1,n)*c}const b=y?{done:!1,value:a[0]}:w.next(g);o&&(b.value=o(b.value));let{done:x}=b;y||null===l||(x=this.speed>=0?this.currentTime>=u:this.currentTime<=0);const S=null===this.holdTime&&("finished"===this.state||"running"===this.state&&x);return S&&void 0!==s&&(b.value=E(a,this.options,s)),f&&f(b.value),S&&this.finish(),b}get duration(){const{resolved:t}=this;return t?T(t.calculatedDuration):0}get time(){return T(this.currentTime)}set time(t){t=S(t),this.currentTime=t,null!==this.holdTime||0===this.speed?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.speed)}get speed(){return this.playbackSpeed}set speed(t){const e=this.playbackSpeed!==t;this.playbackSpeed=t,e&&(this.time=T(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved)return void(this.pendingPlayState="running");if(this.isStopped)return;const{driver:t=sn,onPlay:e,startTime:n}=this.options;this.driver||(this.driver=t((t=>this.tick(t)))),e&&e();const s=this.driver.now();null!==this.holdTime?this.startTime=s-this.holdTime:this.startTime?"finished"===this.state&&(this.startTime=s):this.startTime=null!=n?n:this.calcStartTime(),"finished"===this.state&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var t;this._resolved?(this.state="paused",this.holdTime=null!==(t=this.currentTime)&&void 0!==t?t:0):this.pendingPlayState="paused"}complete(){"running"!==this.state&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:t}=this.options;t&&t()}cancel(){null!==this.cancelTime&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}}const ln=new Set(["opacity","clipPath","filter","transform"]);function un(t){let e;return()=>(void 0===e&&(e=t()),e)}const cn={linearEasing:void 0};const hn=function(t,e){const n=un(t);return()=>{var t;return null!==(t=cn[e])&&void 0!==t?t:n()}}((()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(Ti){return!1}return!0}),"linearEasing");function dn(t){return Boolean("function"==typeof t&&hn()||!t||"string"==typeof t&&(t in mn||hn())||Be(t)||Array.isArray(t)&&t.every(dn))}const pn=([t,e,n,s])=>`cubic-bezier(${t}, ${e}, ${n}, ${s})`,mn={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:pn([0,.65,.55,1]),circOut:pn([.55,0,1,.45]),backIn:pn([.31,.01,.66,-.59]),backOut:pn([.33,1.53,.69,.99])};function fn(t,e){return t?"function"==typeof t&&hn()?ge(t,e):Be(t)?pn(t):Array.isArray(t)?t.map((t=>fn(t,e)||mn.easeOut)):mn[t]:void 0}function vn(t,e,n,{delay:s=0,duration:i=300,repeat:r=0,repeatType:o="loop",ease:a="easeInOut",times:l}={}){const u={[e]:n};l&&(u.offset=l);const c=fn(a,i);return Array.isArray(c)&&(u.easing=c),t.animate(u,{delay:s,duration:i,easing:Array.isArray(c)?"linear":c,fill:"both",iterations:r+1,direction:"reverse"===o?"alternate":"normal"})}function yn(t,e){t.timeline=e,t.onfinish=null}const gn=un((()=>Object.hasOwnProperty.call(Element.prototype,"animate"))),wn={anticipate:H,backInOut:z,circInOut:G};class bn extends ve{constructor(t){super(t);const{name:e,motionValue:n,element:s,keyframes:i}=this.options;this.resolver=new ce(i,((t,e)=>this.onKeyframesResolved(t,e)),e,n,s),this.resolver.scheduleResolve()}initPlayback(t,e){var n;let{duration:s=300,times:i,ease:r,type:o,motionValue:a,name:l,startTime:u}=this.options;if(!(null===(n=a.owner)||void 0===n?void 0:n.current))return!1;var c;if("string"==typeof r&&hn()&&r in wn&&(r=wn[r]),he((c=this.options).type)||"spring"===c.type||!dn(c.ease)){const{onComplete:e,onUpdate:n,motionValue:a,element:l,...u}=this.options,c=function(t,e){const n=new an({...e,keyframes:t,repeat:0,delay:0,isGenerator:!0});let s={done:!1,value:t[0]};const i=[];let r=0;for(;!s.done&&r<2e4;)s=n.sample(r),i.push(s.value),r+=10;return{times:void 0,keyframes:i,duration:r-10,ease:"linear"}}(t,u);1===(t=c.keyframes).length&&(t[1]=t[0]),s=c.duration,i=c.times,r=c.ease,o="keyframes"}const h=vn(a.owner.current,l,t,{...this.options,duration:s,times:i,ease:r});return h.startTime=null!=u?u:this.calcStartTime(),this.pendingTimeline?(yn(h,this.pendingTimeline),this.pendingTimeline=void 0):h.onfinish=()=>{const{onComplete:n}=this.options;a.set(E(t,this.options,e)),n&&n(),this.cancel(),this.resolveFinishedPromise()},{animation:h,duration:s,times:i,type:o,ease:r,keyframes:t}}get duration(){const{resolved:t}=this;if(!t)return 0;const{duration:e}=t;return T(e)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:e}=t;return T(e.currentTime||0)}set time(t){const{resolved:e}=this;if(!e)return;const{animation:n}=e;n.currentTime=S(t)}get speed(){const{resolved:t}=this;if(!t)return 1;const{animation:e}=t;return e.playbackRate}set speed(t){const{resolved:e}=this;if(!e)return;const{animation:n}=e;n.playbackRate=t}get state(){const{resolved:t}=this;if(!t)return"idle";const{animation:e}=t;return e.playState}get startTime(){const{resolved:t}=this;if(!t)return null;const{animation:e}=t;return e.startTime}attachTimeline(t){if(this._resolved){const{resolved:e}=this;if(!e)return F;const{animation:n}=e;yn(n,t)}else this.pendingTimeline=t;return F}play(){if(this.isStopped)return;const{resolved:t}=this;if(!t)return;const{animation:e}=t;"finished"===e.playState&&this.updateFinishedPromise(),e.play()}pause(){const{resolved:t}=this;if(!t)return;const{animation:e}=t;e.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,"idle"===this.state)return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:t}=this;if(!t)return;const{animation:e,keyframes:n,duration:s,type:i,ease:r,times:o}=t;if("idle"===e.playState||"finished"===e.playState)return;if(this.time){const{motionValue:t,onUpdate:e,onComplete:a,element:l,...u}=this.options,c=new an({...u,keyframes:n,duration:s,type:i,ease:r,times:o,isGenerator:!0}),h=S(this.time);t.setWithVelocity(c.sample(h-10).value,c.sample(h).value,10)}const{onStop:a}=this.options;a&&a(),this.cancel()}complete(){const{resolved:t}=this;t&&t.animation.finish()}cancel(){const{resolved:t}=this;t&&t.animation.cancel()}static supports(t){const{motionValue:e,name:n,repeatDelay:s,repeatType:i,damping:r,type:o}=t;return gn()&&n&&ln.has(n)&&e&&e.owner&&e.owner.current instanceof HTMLElement&&!e.owner.getProps().onUpdate&&!s&&"mirror"!==i&&0!==r&&"inertia"!==o}}const xn=un((()=>void 0!==window.ScrollTimeline));class Sn{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}then(t,e){return Promise.all(this.animations).then(t).catch(e)}getAll(t){return this.animations[0][t]}setAll(t,e){for(let n=0;n<this.animations.length;n++)this.animations[n][t]=e}attachTimeline(t,e){const n=this.animations.map((n=>xn()&&n.attachTimeline?n.attachTimeline(t):e(n)));return()=>{n.forEach(((t,e)=>{t&&t(),this.animations[e].stop()}))}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get startTime(){return this.getAll("startTime")}get duration(){let t=0;for(let e=0;e<this.animations.length;e++)t=Math.max(t,this.animations[e].duration);return t}runAll(t){this.animations.forEach((e=>e[t]()))}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}const Tn=(t,e,n,s={},i,r)=>o=>{const a=P(s,t)||{},l=a.delay||s.delay||0;let{elapsed:u=0}=s;u-=S(l);let c={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-u,onUpdate:t=>{e.set(t),a.onUpdate&&a.onUpdate(t)},onComplete:()=>{o(),a.onComplete&&a.onComplete()},name:t,motionValue:e,element:r?void 0:i};(function({when:t,delay:e,delayChildren:n,staggerChildren:s,staggerDirection:i,repeat:r,repeatType:o,repeatDelay:a,from:l,elapsed:u,...c}){return!!Object.keys(c).length})(a)||(c={...c,...M(t,c)}),c.duration&&(c.duration=S(c.duration)),c.repeatDelay&&(c.repeatDelay=S(c.repeatDelay)),void 0!==c.from&&(c.keyframes[0]=c.from);let h=!1;if((!1===c.type||0===c.duration&&!c.repeatDelay)&&(c.duration=0,0===c.delay&&(h=!0)),h&&!r&&void 0!==e.get()){const t=E(c.keyframes,a);if(void 0!==t)return D.update((()=>{c.onUpdate(t),c.onComplete()})),new Sn([])}return!r&&bn.supports(c)?new bn(c):new an(c)};class An{constructor(){this.subscriptions=[]}add(t){var e,n;return e=this.subscriptions,n=t,-1===e.indexOf(n)&&e.push(n),()=>function(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}(this.subscriptions,t)}notify(t,e,n){const s=this.subscriptions.length;if(s)if(1===s)this.subscriptions[0](t,e,n);else for(let i=0;i<s;i++){const s=this.subscriptions[i];s&&s(t,e,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}class Cn{constructor(t,e={}){this.version="11.15.0",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(t,e=!0)=>{const n=me.now();this.updatedAt!==n&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(t),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),e&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(t),this.owner=e.owner}setCurrent(t){var e;this.current=t,this.updatedAt=me.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"production"!==process.env.NODE_ENV&&c(!1,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",t)}on(t,e){this.events[t]||(this.events[t]=new An);const n=this.events[t].add(e);return"change"===t?()=>{n(),D.read((()=>{this.events.change.getSize()||this.stop()}))}:n}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,e){this.passiveEffect=t,this.stopPassiveEffect=e}set(t,e=!0){e&&this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t,e)}setWithVelocity(t,e,n){this.set(e),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-n}jump(t,e=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,e&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=me.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;const e=Math.min(this.updatedAt-this.prevUpdatedAt,30);return we(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.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Vn(t,e){return new Cn(t,e)}function Mn(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,Vn(n))}const Pn=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),kn="data-"+Pn("framerAppearId");function En(t){return t.props[kn]}const Fn=t=>Boolean(t&&t.getVelocity);function On(t,e){const n=t.getValue("willChange");if(s=n,Boolean(Fn(s)&&s.add))return n.add(e);var s}function In({protectedKeys:t,needsAnimating:e},n){const s=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,s}function Rn(t,e,{delay:n=0,transitionOverride:s,type:i}={}){var r;let{transition:o=t.getDefaultTransition(),transitionEnd:a,...l}=e;s&&(o=s);const u=[],c=i&&t.animationState&&t.animationState.getState()[i];for(const h in l){const e=t.getValue(h,null!==(r=t.latestValues[h])&&void 0!==r?r:null),s=l[h];if(void 0===s||c&&In(c,h))continue;const i={delay:n,...P(o||{},h)};let a=!1;if(window.MotionHandoffAnimation){const e=En(t);if(e){const t=window.MotionHandoffAnimation(e,h,D);null!==t&&(i.startTime=t,a=!0)}}On(t,h),e.start(Tn(h,e,s,t.shouldReduceMotion&&x.has(h)?{type:!1}:i,t,a));const d=e.animation;d&&u.push(d)}return a&&Promise.all(u).then((()=>{D.update((()=>{a&&function(t,e){const n=y(t,e);let{transitionEnd:s={},transition:i={},...r}=n||{};r={...r,...s};for(const a in r)Mn(t,a,(o=r[a],d(o)?o[o.length-1]||0:o));var o}(t,a)}))})),u}function jn(t,e,n={}){var s;const i=y(t,e,"exit"===n.type?null===(s=t.presenceContext)||void 0===s?void 0:s.custom:void 0);let{transition:r=t.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(r=n.transitionOverride);const o=i?()=>Promise.all(Rn(t,i,n)):()=>Promise.resolve(),a=t.variantChildren&&t.variantChildren.size?(s=0)=>{const{delayChildren:i=0,staggerChildren:o,staggerDirection:a}=r;return function(t,e,n=0,s=0,i=1,r){const o=[],a=(t.variantChildren.size-1)*s,l=1===i?(t=0)=>t*s:(t=0)=>a-t*s;return Array.from(t.variantChildren).sort(Dn).forEach(((t,s)=>{t.notify("AnimationStart",e),o.push(jn(t,e,{...r,delay:n+l(s)}).then((()=>t.notify("AnimationComplete",e))))})),Promise.all(o)}(t,e,i+s,o,a,n)}:()=>Promise.resolve(),{when:l}=r;if(l){const[t,e]="beforeChildren"===l?[o,a]:[a,o];return t().then((()=>e()))}return Promise.all([o(),a(n.delay)])}function Dn(t,e){return t.sortNodePosition(e)}const Bn=w.length;function Nn(t){if(!t)return;if(!t.isControllingVariants){const e=t.parent&&Nn(t.parent)||{};return void 0!==t.props.initial&&(e.initial=t.props.initial),e}const e={};for(let n=0;n<Bn;n++){const s=w[n],i=t.props[s];(m(i)||!1===i)&&(e[s]=i)}return e}const Ln=[...g].reverse(),$n=g.length;function Kn(t){let e=function(t){return e=>Promise.all(e.map((({animation:e,options:n})=>function(t,e,n={}){let s;if(t.notify("AnimationStart",e),Array.isArray(e)){const i=e.map((e=>jn(t,e,n)));s=Promise.all(i)}else if("string"==typeof e)s=jn(t,e,n);else{const i="function"==typeof e?y(t,e,n.custom):e;s=Promise.all(Rn(t,i,n))}return s.then((()=>{t.notify("AnimationComplete",e)}))}(t,e,n))))}(t),n=Un(),s=!0;const i=e=>(n,s)=>{var i;const r=y(t,s,"exit"===e?null===(i=t.presenceContext)||void 0===i?void 0:i.custom:void 0);if(r){const{transition:t,transitionEnd:e,...s}=r;n={...n,...s,...e}}return n};function r(r){const{props:o}=t,a=Nn(t.parent)||{},l=[],u=new Set;let c={},f=1/0;for(let e=0;e<$n;e++){const v=Ln[e],y=n[v],g=void 0!==o[v]?o[v]:a[v],w=m(g),b=v===r?y.isActive:null;!1===b&&(f=e);let x=g===a[v]&&g!==o[v]&&w;if(x&&s&&t.manuallyAnimateOnMount&&(x=!1),y.protectedKeys={...c},!y.isActive&&null===b||!g&&!y.prevProp||h(g)||"boolean"==typeof g)continue;const S=Wn(y.prevProp,g);let T=S||v===r&&y.isActive&&!x&&w||e>f&&w,A=!1;const C=Array.isArray(g)?g:[g];let V=C.reduce(i(v),{});!1===b&&(V={});const{prevResolvedValues:M={}}=y,P={...M,...V},k=e=>{T=!0,u.has(e)&&(A=!0,u.delete(e)),y.needsAnimating[e]=!0;const n=t.getValue(e);n&&(n.liveStyle=!1)};for(const t in P){const e=V[t],n=M[t];if(c.hasOwnProperty(t))continue;let s=!1;s=d(e)&&d(n)?!p(e,n):e!==n,s?null!=e?k(t):u.add(t):void 0!==e&&u.has(t)?k(t):y.protectedKeys[t]=!0}y.prevProp=g,y.prevResolvedValues=V,y.isActive&&(c={...c,...V}),s&&t.blockInitialAnimation&&(T=!1),T&&(!x||!S||A)&&l.push(...C.map((t=>({animation:t,options:{type:v}}))))}if(u.size){const e={};u.forEach((n=>{const s=t.getBaseTarget(n),i=t.getValue(n);i&&(i.liveStyle=!0),e[n]=null!=s?s:null})),l.push({animation:e})}let v=Boolean(l.length);return!s||!1!==o.initial&&o.initial!==o.animate||t.manuallyAnimateOnMount||(v=!1),s=!1,v?e(l):Promise.resolve()}return{animateChanges:r,setActive:function(e,s){var i;if(n[e].isActive===s)return Promise.resolve();null===(i=t.variantChildren)||void 0===i||i.forEach((t=>{var n;return null===(n=t.animationState)||void 0===n?void 0:n.setActive(e,s)})),n[e].isActive=s;const o=r(e);for(const t in n)n[t].protectedKeys={};return o},setAnimateFunction:function(n){e=n(t)},getState:()=>n,reset:()=>{n=Un(),s=!0}}}function Wn(t,e){return"string"==typeof e?e!==t:!!Array.isArray(e)&&!p(e,t)}function qn(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Un(){return{animate:qn(!0),whileInView:qn(),whileHover:qn(),whileTap:qn(),whileDrag:qn(),whileFocus:qn(),exit:qn()}}class Yn{constructor(t){this.isMounted=!1,this.node=t}update(){}}let zn=0;const Hn={animation:{Feature:class extends Yn{constructor(t){super(t),t.animationState||(t.animationState=Kn(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();h(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:e}=this.node.prevProps||{};t!==e&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),null===(t=this.unmountControls)||void 0===t||t.call(this)}}},exit:{Feature:class extends Yn{constructor(){super(...arguments),this.id=zn++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:e}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===n)return;const s=this.node.animationState.setActive("exit",!t);e&&!t&&s.then((()=>e(this.id)))}mount(){const{register:t}=this.node.presenceContext||{};t&&(this.unmount=t(this.id))}unmount(){}}}};function Xn(t){return{point:{x:t.pageX,y:t.pageY}}}function _n(t,e,n,s={passive:!0}){return t.addEventListener(e,n,s),()=>t.removeEventListener(e,n)}function Gn(t){return t&&"object"==typeof t&&Object.prototype.hasOwnProperty.call(t,"current")}const Zn=()=>({x:{min:0,max:0},y:{min:0,max:0}}),Jn=e.createContext(null),Qn=e.createContext({}),ts=e.createContext({}),es={},{schedule:ns,cancel:ss}=j(queueMicrotask,!1);function is(t){const e=Fn(t)?t.get():t;return n=e,Boolean(n&&"object"==typeof n&&n.mix&&n.toValue)?e.toValue():e;var n}function rs(t,e){const n=function(t){if(t instanceof Element)return[t];if("string"==typeof t){const e=document.querySelectorAll(t);return e?Array.from(e):[]}return Array.from(t)}(t),s=new AbortController;return[n,{passive:!0,...e,signal:s.signal},()=>s.abort()]}function os(t){return e=>{"touch"===e.pointerType||t(e)}}function as(t,e,n){const{props:s}=t;t.animationState&&s.whileHover&&t.animationState.setActive("whileHover","Start"===n);const i=s["onHover"+n];i&&D.postRender((()=>i(e,Xn(e))))}const ls=new WeakSet;function us(t){return e=>{"Enter"===e.key&&t(e)}}function cs(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const hs=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]),ds=(t,e)=>!!e&&(t===e||ds(t,e.parentElement));function ps(t){return("mouse"===(e=t).pointerType?"number"!=typeof e.button||e.button<=0:!1!==e.isPrimary)&&!0;var e}function ms(t,e,n){const{props:s}=t;t.animationState&&s.whileTap&&t.animationState.setActive("whileTap","Start"===n);const i=s["onTap"+("End"===n?"":n)];i&&D.postRender((()=>i(e,Xn(e))))}const fs=new WeakMap,vs=new WeakMap,ys=t=>{const e=fs.get(t.target);e&&e(t)},gs=t=>{t.forEach(ys)};const ws={some:0,all:1},bs={inView:{Feature:class extends Yn{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:e,margin:n,amount:s="some",once:i}=t,r={root:e?e.current:void 0,rootMargin:n,threshold:"number"==typeof s?s:ws[s]};return function(t,e,n){const s=function({root:t,...e}){const n=t||document;vs.has(n)||vs.set(n,{});const s=vs.get(n),i=JSON.stringify(e);return s[i]||(s[i]=new IntersectionObserver(gs,{root:t,...e})),s[i]}(e);return fs.set(t,n),s.observe(t),()=>{fs.delete(t),s.unobserve(t)}}(this.node.current,r,(t=>{const{isIntersecting:e}=t;if(this.isInView===e)return;if(this.isInView=e,i&&!e&&this.hasEnteredView)return;e&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",e);const{onViewportEnter:n,onViewportLeave:s}=this.node.getProps(),r=e?n:s;r&&r(t)}))}mount(){this.startObserver()}update(){if("undefined"==typeof IntersectionObserver)return;const{props:t,prevProps:e}=this.node;["amount","margin","root"].some(function({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}(t,e))&&this.startObserver()}unmount(){}}},tap:{Feature:class extends Yn{mount(){const{current:t}=this.node;t&&(this.unmount=function(t,e,n={}){const[s,i,r]=rs(t,n),o=t=>{const s=t.currentTarget;if(!ps(t)||ls.has(s))return;ls.add(s);const r=e(t),o=(t,e)=>{window.removeEventListener("pointerup",a),window.removeEventListener("pointercancel",l),ps(t)&&ls.has(s)&&(ls.delete(s),r&&r(t,{success:e}))},a=t=>{o(t,n.useGlobalTarget||ds(s,t.target))},l=t=>{o(t,!1)};window.addEventListener("pointerup",a,i),window.addEventListener("pointercancel",l,i)};return s.forEach((t=>{var e;e=t,hs.has(e.tagName)||-1!==e.tabIndex||(t.tabIndex=0),(n.useGlobalTarget?window:t).addEventListener("pointerdown",o,i),t.addEventListener("focus",(t=>((t,e)=>{const n=t.currentTarget;if(!n)return;const s=us((()=>{if(ls.has(n))return;cs(n,"down");const t=us((()=>{cs(n,"up")}));n.addEventListener("keyup",t,e),n.addEventListener("blur",(()=>cs(n,"cancel")),e)}));n.addEventListener("keydown",s,e),n.addEventListener("blur",(()=>n.removeEventListener("keydown",s)),e)})(t,i)),i)})),r}(t,(t=>(ms(this.node,t,"Start"),(t,{success:e})=>ms(this.node,t,e?"End":"Cancel"))),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}},focus:{Feature:class extends Yn{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch(Ai){t=!0}t&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){this.isActive&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Ke(_n(this.node.current,"focus",(()=>this.onFocus())),_n(this.node.current,"blur",(()=>this.onBlur())))}unmount(){}}},hover:{Feature:class extends Yn{mount(){const{current:t}=this.node;t&&(this.unmount=function(t,e,n={}){const[s,i,r]=rs(t,n),o=os((t=>{const{target:n}=t,s=e(t);if(!s||!n)return;const r=os((t=>{s(t),n.removeEventListener("pointerleave",r)}));n.addEventListener("pointerleave",r,i)}));return s.forEach((t=>{t.addEventListener("pointerenter",o,i)})),r}(t,(t=>(as(this.node,t,"Start"),t=>as(this.node,t,"End")))))}unmount(){}}}},xs=e.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"}),Ss=e.createContext({}),Ts="undefined"!=typeof window,As=Ts?e.useLayoutEffect:e.useEffect,Cs=e.createContext({strict:!1});function Vs(t,n,s,i,r){var o,a;const{visualElement:l}=e.useContext(Ss),u=e.useContext(Cs),c=e.useContext(Jn),h=e.useContext(xs).reducedMotion,d=e.useRef(null);i=i||u.renderer,!d.current&&i&&(d.current=i(t,{visualState:n,parent:l,props:s,presenceContext:c,blockInitialAnimation:!!c&&!1===c.initial,reducedMotionConfig:h}));const p=d.current,m=e.useContext(ts);!p||p.projection||!r||"html"!==p.type&&"svg"!==p.type||function(t,e,n,s){const{layoutId:i,layout:r,drag:o,dragConstraints:a,layoutScroll:l,layoutRoot:u}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:Ms(t.parent)),t.projection.setOptions({layoutId:i,layout:r,alwaysMeasureLayout:Boolean(o)||a&&Gn(a),visualElement:t,animationType:"string"==typeof r?r:"both",initialPromotionConfig:s,layoutScroll:l,layoutRoot:u})}(d.current,s,r,m);const f=e.useRef(!1);e.useInsertionEffect((()=>{p&&f.current&&p.update(s,c)}));const v=s[kn],y=e.useRef(Boolean(v)&&!(null===(o=window.MotionHandoffIsComplete)||void 0===o?void 0:o.call(window,v))&&(null===(a=window.MotionHasOptimisedAnimation)||void 0===a?void 0:a.call(window,v)));return As((()=>{p&&(f.current=!0,window.MotionIsMounted=!0,p.updateFeatures(),ns.render(p.render),y.current&&p.animationState&&p.animationState.animateChanges())})),e.useEffect((()=>{p&&(!y.current&&p.animationState&&p.animationState.animateChanges(),y.current&&(queueMicrotask((()=>{var t;null===(t=window.MotionHandoffMarkAsComplete)||void 0===t||t.call(window,v)})),y.current=!1))})),p}function Ms(t){if(t)return!1!==t.options.allowProjection?t.projection:Ms(t.parent)}function Ps(t,n,s){return e.useCallback((e=>{e&&t.mount&&t.mount(e),n&&(e?n.mount(e):n.unmount()),s&&("function"==typeof s?s(e):Gn(s)&&(s.current=e))}),[n])}function ks(t){return h(t.animate)||w.some((e=>m(t[e])))}function Es(t){return Boolean(ks(t)||t.variants)}function Fs(t){return Array.isArray(t)?t.join(" "):t}const Os={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},Is={};for(const ki in Os)Is[ki]={isEnabled:t=>Os[ki].some((e=>!!t[e]))};function Rs(t){for(const e in t)Is[e]={...Is[e],...t[e]}}const js=Symbol.for("motionComponentSymbol");function Ds({preloadedFeatures:n,createVisualElement:s,useRender:i,useVisualState:r,Component:o}){n&&Rs(n);const a=e.forwardRef((function(a,l){let u;const c={...e.useContext(xs),...a,layoutId:Bs(a)},{isStatic:h}=c,d=function(t){const{initial:n,animate:s}=function(t,e){if(ks(t)){const{initial:e,animate:n}=t;return{initial:!1===e||m(e)?e:void 0,animate:m(n)?n:void 0}}return!1!==t.inherit?e:{}}(t,e.useContext(Ss));return e.useMemo((()=>({initial:n,animate:s})),[Fs(n),Fs(s)])}(a),p=r(a,h);if(!h&&Ts){!function(t,n){const s=e.useContext(Cs).strict;if("production"!==process.env.NODE_ENV&&n&&s){const e="You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";t.ignoreStrict?O(!1,e):I(!1,e)}}(c,n);const t=function(t){const{drag:e,layout:n}=Is;if(!e&&!n)return{};const s={...e,...n};return{MeasureLayout:(null==e?void 0:e.isEnabled(t))||(null==n?void 0:n.isEnabled(t))?s.MeasureLayout:void 0,ProjectionNode:s.ProjectionNode}}(c);u=t.MeasureLayout,d.visualElement=Vs(o,p,c,s,t.ProjectionNode)}return t.jsxs(Ss.Provider,{value:d,children:[u&&d.visualElement?t.jsx(u,{visualElement:d.visualElement,...c}):null,i(o,a,Ps(p,d.visualElement,l),p,h,d.visualElement)]})}));return a[js]=o,a}function Bs({layoutId:t}){const n=e.useContext(Qn).id;return n&&void 0!==t?n+"-"+t:t}const Ns=["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 Ls(t){return"string"==typeof t&&!t.includes("-")&&!!(Ns.indexOf(t)>-1||/[A-Z]/u.test(t))}function $s(t,{style:e,vars:n},s,i){Object.assign(t.style,e,i&&i.getProjectionStyles(s));for(const r in n)t.style.setProperty(r,n[r])}const Ks=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function Ws(t,e,n,s){$s(t,e,void 0,s);for(const i in e.attrs)t.setAttribute(Ks.has(i)?i:Pn(i),e.attrs[i])}function qs(t,{layout:e,layoutId:n}){return x.has(t)||t.startsWith("origin")||(e||void 0!==n)&&(!!es[t]||"opacity"===t)}function Us(t,e,n){var s;const{style:i}=t,r={};for(const o in i)(Fn(i[o])||e.style&&Fn(e.style[o])||qs(o,t)||void 0!==(null===(s=null==n?void 0:n.getValue(o))||void 0===s?void 0:s.liveStyle))&&(r[o]=i[o]);return r}function Ys(t,e,n){const s=Us(t,e,n);for(const i in t)(Fn(t[i])||Fn(e[i]))&&(s[-1!==b.indexOf(i)?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i]=t[i]);return s}const zs=t=>(n,s)=>{const i=e.useContext(Ss),r=e.useContext(Jn),o=()=>function({scrapeMotionValuesFromProps:t,createRenderState:e,onMount:n},s,i,r){const o={latestValues:Hs(s,i,r,t),renderState:e()};return n&&(o.mount=t=>n(s,t,o)),o}(t,n,i,r);return s?o():function(t){const n=e.useRef(null);return null===n.current&&(n.current=t()),n.current}(o)};function Hs(t,e,n,s){const i={},r=s(t,{});for(const h in r)i[h]=is(r[h]);let{initial:o,animate:a}=t;const l=ks(t),u=Es(t);e&&u&&!l&&!1!==t.inherit&&(void 0===o&&(o=e.initial),void 0===a&&(a=e.animate));let c=!!n&&!1===n.initial;c=c||!1===o;const d=c?a:o;if(d&&"boolean"!=typeof d&&!h(d)){const e=Array.isArray(d)?d:[d];for(let n=0;n<e.length;n++){const s=v(t,e[n]);if(s){const{transitionEnd:t,transition:e,...n}=s;for(const s in n){let t=n[s];Array.isArray(t)&&(t=t[c?t.length-1:0]),null!==t&&(i[s]=t)}for(const s in t)i[s]=t[s]}}}return i}const Xs=(t,e)=>e&&"number"==typeof t?e.transform(t):t,_s={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Gs=b.length;function Zs(t,e,n){const{style:s,vars:i,transformOrigin:r}=t;let o=!1,a=!1;for(const l in e){const t=e[l];if(x.has(l))o=!0;else if(tt(l))i[l]=t;else{const e=Xs(t,re[l]);l.startsWith("origin")?(a=!0,r[l]=e):s[l]=e}}if(e.transform||(o||n?s.transform=function(t,e,n){let s="",i=!0;for(let r=0;r<Gs;r++){const o=b[r],a=t[o];if(void 0===a)continue;let l=!0;if(l="number"==typeof a?a===(o.startsWith("scale")?1:0):0===parseFloat(a),!l||n){const t=Xs(a,re[o]);l||(i=!1,s+=`${_s[o]||o}(${t}) `),n&&(e[o]=t)}}return s=s.trim(),n?s=n(e,i?"":s):i&&(s="none"),s}(e,t.transform,n):s.transform&&(s.transform="none")),a){const{originX:t="50%",originY:e="50%",originZ:n=0}=r;s.transformOrigin=`${t} ${e} ${n}`}}function Js(t,e,n){return"string"==typeof t?t:pt.transform(e+n*t)}const Qs={offset:"stroke-dashoffset",array:"stroke-dasharray"},ti={offset:"strokeDashoffset",array:"strokeDasharray"};function ei(t,{attrX:e,attrY:n,attrScale:s,originX:i,originY:r,pathLength:o,pathSpacing:a=1,pathOffset:l=0,...u},c,h){if(Zs(t,u,h),c)return void(t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox));t.attrs=t.style,t.style={};const{attrs:d,style:p,dimensions:m}=t;var f,v;d.transform&&(m&&(p.transform=d.transform),delete d.transform),m&&(void 0!==i||void 0!==r||p.transform)&&(p.transformOrigin=(v=void 0!==r?r:.5,`${Js(void 0!==i?i:.5,(f=m).x,f.width)} ${Js(v,f.y,f.height)}`)),void 0!==e&&(d.x=e),void 0!==n&&(d.y=n),void 0!==s&&(d.scale=s),void 0!==o&&function(t,e,n=1,s=0,i=!0){t.pathLength=1;const r=i?Qs:ti;t[r.offset]=pt.transform(-s);const o=pt.transform(e),a=pt.transform(n);t[r.array]=`${o} ${a}`}(d,o,a,l,!1)}const ni=t=>"string"==typeof t&&"svg"===t.toLowerCase(),si={useVisualState:zs({scrapeMotionValuesFromProps:Ys,createRenderState:()=>({style:{},transform:{},transformOrigin:{},vars:{},attrs:{}}),onMount:(t,e,{renderState:n,latestValues:s})=>{D.read((()=>{try{n.dimensions="function"==typeof e.getBBox?e.getBBox():e.getBoundingClientRect()}catch(t){n.dimensions={x:0,y:0,width:0,height:0}}})),D.render((()=>{ei(n,s,ni(e.tagName),t.transformTemplate),Ws(e,n)}))}})},ii={useVisualState:zs({scrapeMotionValuesFromProps:Us,createRenderState:()=>({style:{},transform:{},transformOrigin:{},vars:{}})})};function ri(t,e,n){for(const s in e)Fn(e[s])||qs(s,n)||(t[s]=e[s])}function oi(t,n){const s={},i=function(t,n){const s={};return ri(s,t.style||{},t),Object.assign(s,function({transformTemplate:t},n){return e.useMemo((()=>{const e={style:{},transform:{},transformOrigin:{},vars:{}};return Zs(e,n,t),Object.assign({},e.vars,e.style)}),[n])}(t,n)),s}(t,n);return t.drag&&!1!==t.dragListener&&(s.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.touchAction=!0===t.drag?"none":"pan-"+("x"===t.drag?"y":"x")),void 0===t.tabIndex&&(t.onTap||t.onTapStart||t.whileTap)&&(s.tabIndex=0),s.style=i,s}const ai=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function li(t){return t.startsWith("while")||t.startsWith("drag")&&"draggable"!==t||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||ai.has(t)}let ui=t=>!li(t);try{(ci=require("@emotion/is-prop-valid").default)&&(ui=t=>t.startsWith("on")?!li(t):ci(t))}catch(Ti){}var ci;function hi(t,n,s,i){const r=e.useMemo((()=>{const e={style:{},transform:{},transformOrigin:{},vars:{},attrs:{}};return ei(e,n,ni(i),t.transformTemplate),{...e.attrs,style:{...e.style}}}),[n]);if(t.style){const e={};ri(e,t.style,t),r.style={...e,...r.style}}return r}function di(t=!1){return(n,s,i,{latestValues:r},o)=>{const a=(Ls(n)?hi:oi)(s,r,o,n),l=function(t,e,n){const s={};for(const i in t)"values"===i&&"object"==typeof t.values||(ui(i)||!0===n&&li(i)||!e&&!li(i)||t.draggable&&i.startsWith("onDrag"))&&(s[i]=t[i]);return s}(s,"string"==typeof n,t),u=n!==e.Fragment?{...l,...a,ref:i}:{},{children:c}=s,h=e.useMemo((()=>Fn(c)?c.get():c),[c]);return e.createElement(n,{...u,children:h})}}const pi={current:null},mi={current:!1},fi=new WeakMap,vi=[...Ct,Wt,Zt],yi=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class gi{scrapeMotionValuesFromProps(t,e,n){return{}}constructor({parent:t,props:e,presenceContext:n,reducedMotionConfig:s,blockInitialAnimation:i,visualState:r},o={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Ot,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=me.now();this.renderScheduledAt<t&&(this.renderScheduledAt=t,D.render(this.render,!1,!0))};const{latestValues:a,renderState:l}=r;this.latestValues=a,this.baseTarget={...a},this.initialValues=e.initial?{...a}:{},this.renderState=l,this.parent=t,this.props=e,this.presenceContext=n,this.depth=t?t.depth+1:0,this.reducedMotionConfig=s,this.options=o,this.blockInitialAnimation=Boolean(i),this.isControllingVariants=ks(e),this.isVariantNode=Es(e),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const{willChange:u,...c}=this.scrapeMotionValuesFromProps(e,{},this);for(const h in c){const t=c[h];void 0!==a[h]&&Fn(t)&&t.set(a[h],!1)}}mount(t){this.current=t,fi.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))),mi.current||function(){if(mi.current=!0,Ts)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>pi.current=t.matches;t.addListener(e),e()}else pi.current=!1}(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||pi.current),"production"!==process.env.NODE_ENV&&c(!0!==this.shouldReduceMotion,"You have Reduced Motion enabled on your device. Animations may not appear as expected."),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){fi.delete(this.current),this.projection&&this.projection.unmount(),B(this.notifyUpdate),B(this.render),this.valueSubscriptions.forEach((t=>t())),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(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}bindToMotionValue(t,e){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const n=x.has(t),s=e.on("change",(e=>{this.latestValues[t]=e,this.props.onUpdate&&D.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0)})),i=e.on("renderRequest",this.scheduleRender);let r;window.MotionCheckAppearSync&&(r=window.MotionCheckAppearSync(this,t,e)),this.valueSubscriptions.set(t,(()=>{s(),i(),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 Is){const e=Is[t];if(!e)continue;const{isEnabled:n,Feature:s}=e;if(!this.features[t]&&s&&n(this.props)&&(this.features[t]=new s(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 n=0;n<yi.length;n++){const e=yi[n];this.propEventSubscriptions[e]&&(this.propEventSubscriptions[e](),delete this.propEventSubscriptions[e]);const s=t["on"+e];s&&(this.propEventSubscriptions[e]=this.on(e,s))}this.prevMotionValues=function(t,e,n){for(const s in e){const i=e[s],r=n[s];if(Fn(i))t.addValue(s,i),"development"===process.env.NODE_ENV&&c("11.15.0"===i.version,`Attempting to mix Motion versions ${i.version} with 11.15.0 may not work as expected.`);else if(Fn(r))t.addValue(s,Vn(i,{owner:t}));else if(r!==i)if(t.hasValue(s)){const e=t.getValue(s);!0===e.liveStyle?e.jump(i):e.hasAnimated||e.set(i)}else{const e=t.getStaticValue(s);t.addValue(s,Vn(void 0!==e?e:i,{owner:t}))}}for(const s in n)void 0===e[s]&&t.removeValue(s);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 n=this.values.get(t);e!==n&&(n&&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 n=this.values.get(t);return void 0===n&&void 0!==e&&(n=Vn(null===e?void 0:e,{owner:this}),this.addValue(t,n)),n}readValue(t,e){var n;let s=void 0===this.latestValues[t]&&this.current?null!==(n=this.getBaseTargetFromProps(this.props,t))&&void 0!==n?n:this.readValueFromInstance(this.current,t,this.options):this.latestValues[t];var i;return null!=s&&("string"==typeof s&&(J(s)||Z(s))?s=parseFloat(s):(i=s,!vi.find(At(i))&&Zt.test(e)&&(s=le(t,e))),this.setBaseTarget(t,Fn(s)?s.get():s)),Fn(s)?s.get():s}setBaseTarget(t,e){this.baseTarget[t]=e}getBaseTarget(t){var e;const{initial:n}=this.props;let s;if("string"==typeof n||"object"==typeof n){const i=v(this.props,n,null===(e=this.presenceContext)||void 0===e?void 0:e.custom);i&&(s=i[t])}if(n&&void 0!==s)return s;const i=this.getBaseTargetFromProps(this.props,t);return void 0===i||Fn(i)?void 0!==this.initialValues[t]&&void 0===s?void 0:this.baseTarget[t]:i}on(t,e){return this.events[t]||(this.events[t]=new An),this.events[t].add(e)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}}class wi extends gi{constructor(){super(...arguments),this.KeyframeResolver=ce}sortInstanceNodePosition(t,e){return 2&t.compareDocumentPosition(e)?1:-1}getBaseTargetFromProps(t,e){return t.style?t.style[e]:void 0}removeValueFromRenderState(t,{vars:e,style:n}){delete e[t],delete n[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Fn(t)&&(this.childSubscription=t.on("change",(t=>{this.current&&(this.current.textContent=`${t}`)})))}}class bi extends wi{constructor(){super(...arguments),this.type="html",this.renderInstance=$s}readValueFromInstance(t,e){if(x.has(e)){const t=ae(e);return t&&t.default||0}{const s=(n=t,window.getComputedStyle(n)),i=(tt(e)?s.getPropertyValue(e):s[e])||0;return"string"==typeof i?i.trim():i}var n}measureInstanceViewportBox(t,{transformPagePoint:e}){return n=e,function({top:t,left:e,right:n,bottom:s}){return{x:{min:e,max:n},y:{min:t,max:s}}}(function(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),s=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:s.y,right:s.x}}(t.getBoundingClientRect(),n));var n}build(t,e,n){Zs(t,e,n.transformTemplate)}scrapeMotionValuesFromProps(t,e,n){return Us(t,e,n)}}class xi extends wi{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Zn}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){if(x.has(e)){const t=ae(e);return t&&t.default||0}return e=Ks.has(e)?e:Pn(e),t.getAttribute(e)}scrapeMotionValuesFromProps(t,e,n){return Ys(t,e,n)}build(t,e,n){ei(t,e,this.isSVGTag,n.transformTemplate)}renderInstance(t,e,n,s){Ws(t,e,0,s)}mount(t){this.isSVGTag=ni(t.tagName),super.mount(t)}}const Si=function(t){if("undefined"==typeof Proxy)return t;const e=new Map;return new Proxy(((...e)=>("production"!==process.env.NODE_ENV&&c(!1,"motion() is deprecated. Use motion.create() instead."),t(...e))),{get:(n,s)=>"create"===s?t:(e.has(s)||e.set(s,t(s)),e.get(s))})}((function(t,{forwardMotionProps:e}={forwardMotionProps:!1}){return Ds({...Ls(t)?si:ii,preloadedFeatures:Ti,useRender:di(e),createVisualElement:Ai,Component:t})}));var Ti,Ai;function Ci({children:n,features:s,strict:i=!1}){const[,r]=e.useState(!Vi(s)),o=e.useRef(void 0);if(!Vi(s)){const{renderer:t,...e}=s;o.current=t,Rs(e)}return e.useEffect((()=>{Vi(s)&&s().then((({renderer:t,...e})=>{Rs(e),o.current=t,r(!0)}))}),[]),t.jsx(Cs.Provider,{value:{renderer:o.current,strict:i},children:n})}function Vi(t){return"function"==typeof t}const Mi={renderer:(t,n)=>Ls(t)?new xi(n):new bi(n,{allowProjection:t!==e.Fragment}),...Hn,...bs},Pi=n.styled(Si.div)`
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { jsxs as Y, jsx as E } from "react/jsx-runtime";
|
|
2
|
+
import { createContext as te, useLayoutEffect as xs, useEffect as nt, useContext as O, useRef as Z, useInsertionEffect as As, useCallback as fn, useMemo as Ae, forwardRef as Ms, Fragment as hn, createElement as Cs, useState as Ps } from "react";
|
|
3
|
+
import { styled as Fs, useTheme as Ds } from "styled-components";
|
|
4
|
+
import { MenuItem as Rs } from "./menu-item/index.js";
|
|
5
|
+
import { Button as Rt } from "../button/index.js";
|
|
6
|
+
import { Container as q } from "../container/index.js";
|
|
7
|
+
import { IconButton as Is } from "../icon-button/index.js";
|
|
8
|
+
import "../typography/heading/index.js";
|
|
9
|
+
import "../typography/span/index.js";
|
|
10
|
+
import { Text as Os } from "../typography/text/index.js";
|
|
11
|
+
import { u as Es } from "../../use-click-outside-BUll8Ag-.mjs";
|
|
12
|
+
import "lodash";
|
|
13
|
+
const It = /* @__PURE__ */ new Set();
|
|
14
|
+
function Me(t, e, n) {
|
|
15
|
+
t || It.has(e) || (console.warn(e), It.add(e));
|
|
16
|
+
}
|
|
17
|
+
function ks(t) {
|
|
18
|
+
if (typeof Proxy > "u")
|
|
19
|
+
return t;
|
|
20
|
+
const e = /* @__PURE__ */ new Map(), n = (...s) => (process.env.NODE_ENV !== "production" && Me(!1, "motion() is deprecated. Use motion.create() instead."), t(...s));
|
|
21
|
+
return new Proxy(n, {
|
|
22
|
+
/**
|
|
23
|
+
* Called when `motion` is referenced with a prop: `motion.div`, `motion.input` etc.
|
|
24
|
+
* The prop name is passed through as `key` and we can use that to generate a `motion`
|
|
25
|
+
* DOM component with that name.
|
|
26
|
+
*/
|
|
27
|
+
get: (s, i) => i === "create" ? t : (e.has(i) || e.set(i, t(i)), e.get(i))
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
function Ce(t) {
|
|
31
|
+
return t !== null && typeof t == "object" && typeof t.start == "function";
|
|
32
|
+
}
|
|
33
|
+
const je = (t) => Array.isArray(t);
|
|
34
|
+
function pn(t, e) {
|
|
35
|
+
if (!Array.isArray(e))
|
|
36
|
+
return !1;
|
|
37
|
+
const n = e.length;
|
|
38
|
+
if (n !== t.length)
|
|
39
|
+
return !1;
|
|
40
|
+
for (let s = 0; s < n; s++)
|
|
41
|
+
if (e[s] !== t[s])
|
|
42
|
+
return !1;
|
|
43
|
+
return !0;
|
|
44
|
+
}
|
|
45
|
+
function ue(t) {
|
|
46
|
+
return typeof t == "string" || Array.isArray(t);
|
|
47
|
+
}
|
|
48
|
+
function Ot(t) {
|
|
49
|
+
const e = [{}, {}];
|
|
50
|
+
return t == null || t.values.forEach((n, s) => {
|
|
51
|
+
e[0][s] = n.get(), e[1][s] = n.getVelocity();
|
|
52
|
+
}), e;
|
|
53
|
+
}
|
|
54
|
+
function st(t, e, n, s) {
|
|
55
|
+
if (typeof e == "function") {
|
|
56
|
+
const [i, r] = Ot(s);
|
|
57
|
+
e = e(n !== void 0 ? n : t.custom, i, r);
|
|
58
|
+
}
|
|
59
|
+
if (typeof e == "string" && (e = t.variants && t.variants[e]), typeof e == "function") {
|
|
60
|
+
const [i, r] = Ot(s);
|
|
61
|
+
e = e(n !== void 0 ? n : t.custom, i, r);
|
|
62
|
+
}
|
|
63
|
+
return e;
|
|
64
|
+
}
|
|
65
|
+
function Pe(t, e, n) {
|
|
66
|
+
const s = t.getProps();
|
|
67
|
+
return st(s, e, n !== void 0 ? n : s.custom, t);
|
|
68
|
+
}
|
|
69
|
+
const it = [
|
|
70
|
+
"animate",
|
|
71
|
+
"whileInView",
|
|
72
|
+
"whileFocus",
|
|
73
|
+
"whileHover",
|
|
74
|
+
"whileTap",
|
|
75
|
+
"whileDrag",
|
|
76
|
+
"exit"
|
|
77
|
+
], rt = ["initial", ...it], fe = [
|
|
78
|
+
"transformPerspective",
|
|
79
|
+
"x",
|
|
80
|
+
"y",
|
|
81
|
+
"z",
|
|
82
|
+
"translateX",
|
|
83
|
+
"translateY",
|
|
84
|
+
"translateZ",
|
|
85
|
+
"scale",
|
|
86
|
+
"scaleX",
|
|
87
|
+
"scaleY",
|
|
88
|
+
"rotate",
|
|
89
|
+
"rotateX",
|
|
90
|
+
"rotateY",
|
|
91
|
+
"rotateZ",
|
|
92
|
+
"skew",
|
|
93
|
+
"skewX",
|
|
94
|
+
"skewY"
|
|
95
|
+
], z = new Set(fe), L = (t) => t * 1e3, B = (t) => t / 1e3, Ls = {
|
|
96
|
+
type: "spring",
|
|
97
|
+
stiffness: 500,
|
|
98
|
+
damping: 25,
|
|
99
|
+
restSpeed: 10
|
|
100
|
+
}, Ns = (t) => ({
|
|
101
|
+
type: "spring",
|
|
102
|
+
stiffness: 550,
|
|
103
|
+
damping: t === 0 ? 2 * Math.sqrt(550) : 30,
|
|
104
|
+
restSpeed: 10
|
|
105
|
+
}), Bs = {
|
|
106
|
+
type: "keyframes",
|
|
107
|
+
duration: 0.8
|
|
108
|
+
}, Ks = {
|
|
109
|
+
type: "keyframes",
|
|
110
|
+
ease: [0.25, 0.1, 0.35, 1],
|
|
111
|
+
duration: 0.3
|
|
112
|
+
}, _s = (t, { keyframes: e }) => e.length > 2 ? Bs : z.has(t) ? t.startsWith("scale") ? Ns(e[1]) : Ls : Ks;
|
|
113
|
+
function mn(t, e) {
|
|
114
|
+
return t ? t[e] || t.default || t : void 0;
|
|
115
|
+
}
|
|
116
|
+
const $s = {
|
|
117
|
+
skipAnimations: !1,
|
|
118
|
+
useManualTiming: !1
|
|
119
|
+
}, js = (t) => t !== null;
|
|
120
|
+
function Fe(t, { repeat: e, repeatType: n = "loop" }, s) {
|
|
121
|
+
const i = t.filter(js), r = e && n !== "loop" && e % 2 === 1 ? 0 : i.length - 1;
|
|
122
|
+
return !r || s === void 0 ? i[r] : s;
|
|
123
|
+
}
|
|
124
|
+
const _ = (t) => t;
|
|
125
|
+
let ne = _, G = _;
|
|
126
|
+
process.env.NODE_ENV !== "production" && (ne = (t, e) => {
|
|
127
|
+
!t && typeof console < "u" && console.warn(e);
|
|
128
|
+
}, G = (t, e) => {
|
|
129
|
+
if (!t)
|
|
130
|
+
throw new Error(e);
|
|
131
|
+
});
|
|
132
|
+
function Ws(t) {
|
|
133
|
+
let e = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Set(), s = !1, i = !1;
|
|
134
|
+
const r = /* @__PURE__ */ new WeakSet();
|
|
135
|
+
let o = {
|
|
136
|
+
delta: 0,
|
|
137
|
+
timestamp: 0,
|
|
138
|
+
isProcessing: !1
|
|
139
|
+
};
|
|
140
|
+
function a(u) {
|
|
141
|
+
r.has(u) && (l.schedule(u), t()), u(o);
|
|
142
|
+
}
|
|
143
|
+
const l = {
|
|
144
|
+
/**
|
|
145
|
+
* Schedule a process to run on the next frame.
|
|
146
|
+
*/
|
|
147
|
+
schedule: (u, c = !1, f = !1) => {
|
|
148
|
+
const h = f && s ? e : n;
|
|
149
|
+
return c && r.add(u), h.has(u) || h.add(u), u;
|
|
150
|
+
},
|
|
151
|
+
/**
|
|
152
|
+
* Cancel the provided callback from running on the next frame.
|
|
153
|
+
*/
|
|
154
|
+
cancel: (u) => {
|
|
155
|
+
n.delete(u), r.delete(u);
|
|
156
|
+
},
|
|
157
|
+
/**
|
|
158
|
+
* Execute all schedule callbacks.
|
|
159
|
+
*/
|
|
160
|
+
process: (u) => {
|
|
161
|
+
if (o = u, s) {
|
|
162
|
+
i = !0;
|
|
163
|
+
return;
|
|
164
|
+
}
|
|
165
|
+
s = !0, [e, n] = [n, e], e.forEach(a), e.clear(), s = !1, i && (i = !1, l.process(u));
|
|
166
|
+
}
|
|
167
|
+
};
|
|
168
|
+
return l;
|
|
169
|
+
}
|
|
170
|
+
const me = [
|
|
171
|
+
"read",
|
|
172
|
+
// Read
|
|
173
|
+
"resolveKeyframes",
|
|
174
|
+
// Write/Read/Write/Read
|
|
175
|
+
"update",
|
|
176
|
+
// Compute
|
|
177
|
+
"preRender",
|
|
178
|
+
// Compute
|
|
179
|
+
"render",
|
|
180
|
+
// Write
|
|
181
|
+
"postRender"
|
|
182
|
+
// Compute
|
|
183
|
+
], Gs = 40;
|
|
184
|
+
function gn(t, e) {
|
|
185
|
+
let n = !1, s = !0;
|
|
186
|
+
const i = {
|
|
187
|
+
delta: 0,
|
|
188
|
+
timestamp: 0,
|
|
189
|
+
isProcessing: !1
|
|
190
|
+
}, r = () => n = !0, o = me.reduce((p, g) => (p[g] = Ws(r), p), {}), { read: a, resolveKeyframes: l, update: u, preRender: c, render: f, postRender: d } = o, h = () => {
|
|
191
|
+
const p = performance.now();
|
|
192
|
+
n = !1, i.delta = s ? 1e3 / 60 : Math.max(Math.min(p - i.timestamp, Gs), 1), i.timestamp = p, i.isProcessing = !0, a.process(i), l.process(i), u.process(i), c.process(i), f.process(i), d.process(i), i.isProcessing = !1, n && e && (s = !1, t(h));
|
|
193
|
+
}, y = () => {
|
|
194
|
+
n = !0, s = !0, i.isProcessing || t(h);
|
|
195
|
+
};
|
|
196
|
+
return { schedule: me.reduce((p, g) => {
|
|
197
|
+
const V = o[g];
|
|
198
|
+
return p[g] = (A, w = !1, S = !1) => (n || y(), V.schedule(A, w, S)), p;
|
|
199
|
+
}, {}), cancel: (p) => {
|
|
200
|
+
for (let g = 0; g < me.length; g++)
|
|
201
|
+
o[me[g]].cancel(p);
|
|
202
|
+
}, state: i, steps: o };
|
|
203
|
+
}
|
|
204
|
+
const { schedule: R, cancel: We, state: ve, steps: Ca } = gn(typeof requestAnimationFrame < "u" ? requestAnimationFrame : _, !0), yn = (t, e, n) => (((1 - 3 * n + 3 * e) * t + (3 * n - 6 * e)) * t + 3 * e) * t, Us = 1e-7, zs = 12;
|
|
205
|
+
function Hs(t, e, n, s, i) {
|
|
206
|
+
let r, o, a = 0;
|
|
207
|
+
do
|
|
208
|
+
o = e + (n - e) / 2, r = yn(o, s, i) - t, r > 0 ? n = o : e = o;
|
|
209
|
+
while (Math.abs(r) > Us && ++a < zs);
|
|
210
|
+
return o;
|
|
211
|
+
}
|
|
212
|
+
function he(t, e, n, s) {
|
|
213
|
+
if (t === e && n === s)
|
|
214
|
+
return _;
|
|
215
|
+
const i = (r) => Hs(r, 0, 1, t, n);
|
|
216
|
+
return (r) => r === 0 || r === 1 ? r : yn(i(r), e, s);
|
|
217
|
+
}
|
|
218
|
+
const vn = (t) => (e) => e <= 0.5 ? t(2 * e) / 2 : (2 - t(2 * (1 - e))) / 2, bn = (t) => (e) => 1 - t(1 - e), wn = /* @__PURE__ */ he(0.33, 1.53, 0.69, 0.99), ot = /* @__PURE__ */ bn(wn), Tn = /* @__PURE__ */ vn(ot), Vn = (t) => (t *= 2) < 1 ? 0.5 * ot(t) : 0.5 * (2 - Math.pow(2, -10 * (t - 1))), at = (t) => 1 - Math.sin(Math.acos(t)), qs = bn(at), Sn = vn(at), xn = (t) => /^0[^.\s]+$/u.test(t);
|
|
219
|
+
function Ys(t) {
|
|
220
|
+
return typeof t == "number" ? t === 0 : t !== null ? t === "none" || t === "0" || xn(t) : !0;
|
|
221
|
+
}
|
|
222
|
+
const An = (t) => /^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t), Mn = (t) => (e) => typeof e == "string" && e.startsWith(t), Cn = /* @__PURE__ */ Mn("--"), Xs = /* @__PURE__ */ Mn("var(--"), lt = (t) => Xs(t) ? Zs.test(t.split("/*")[0].trim()) : !1, Zs = /var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu, Js = (
|
|
223
|
+
// eslint-disable-next-line redos-detector/no-unsafe-regex -- false positive, as it can match a lot of words
|
|
224
|
+
/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u
|
|
225
|
+
);
|
|
226
|
+
function Qs(t) {
|
|
227
|
+
const e = Js.exec(t);
|
|
228
|
+
if (!e)
|
|
229
|
+
return [,];
|
|
230
|
+
const [, n, s, i] = e;
|
|
231
|
+
return [`--${n ?? s}`, i];
|
|
232
|
+
}
|
|
233
|
+
const ei = 4;
|
|
234
|
+
function Pn(t, e, n = 1) {
|
|
235
|
+
G(n <= ei, `Max CSS variable fallback depth detected in property "${t}". This may indicate a circular fallback dependency.`);
|
|
236
|
+
const [s, i] = Qs(t);
|
|
237
|
+
if (!s)
|
|
238
|
+
return;
|
|
239
|
+
const r = window.getComputedStyle(e).getPropertyValue(s);
|
|
240
|
+
if (r) {
|
|
241
|
+
const o = r.trim();
|
|
242
|
+
return An(o) ? parseFloat(o) : o;
|
|
243
|
+
}
|
|
244
|
+
return lt(i) ? Pn(i, e, n + 1) : i;
|
|
245
|
+
}
|
|
246
|
+
const U = (t, e, n) => n > e ? e : n < t ? t : n, se = {
|
|
247
|
+
test: (t) => typeof t == "number",
|
|
248
|
+
parse: parseFloat,
|
|
249
|
+
transform: (t) => t
|
|
250
|
+
}, ce = {
|
|
251
|
+
...se,
|
|
252
|
+
transform: (t) => U(0, 1, t)
|
|
253
|
+
}, ge = {
|
|
254
|
+
...se,
|
|
255
|
+
default: 1
|
|
256
|
+
}, pe = (t) => ({
|
|
257
|
+
test: (e) => typeof e == "string" && e.endsWith(t) && e.split(" ").length === 1,
|
|
258
|
+
parse: parseFloat,
|
|
259
|
+
transform: (e) => `${e}${t}`
|
|
260
|
+
}), N = /* @__PURE__ */ pe("deg"), J = /* @__PURE__ */ pe("%"), m = /* @__PURE__ */ pe("px"), ti = /* @__PURE__ */ pe("vh"), ni = /* @__PURE__ */ pe("vw"), Et = {
|
|
261
|
+
...J,
|
|
262
|
+
parse: (t) => J.parse(t) / 100,
|
|
263
|
+
transform: (t) => J.transform(t * 100)
|
|
264
|
+
}, si = /* @__PURE__ */ new Set([
|
|
265
|
+
"width",
|
|
266
|
+
"height",
|
|
267
|
+
"top",
|
|
268
|
+
"left",
|
|
269
|
+
"right",
|
|
270
|
+
"bottom",
|
|
271
|
+
"x",
|
|
272
|
+
"y",
|
|
273
|
+
"translateX",
|
|
274
|
+
"translateY"
|
|
275
|
+
]), kt = (t) => t === se || t === m, Lt = (t, e) => parseFloat(t.split(", ")[e]), Nt = (t, e) => (n, { transform: s }) => {
|
|
276
|
+
if (s === "none" || !s)
|
|
277
|
+
return 0;
|
|
278
|
+
const i = s.match(/^matrix3d\((.+)\)$/u);
|
|
279
|
+
if (i)
|
|
280
|
+
return Lt(i[1], e);
|
|
281
|
+
{
|
|
282
|
+
const r = s.match(/^matrix\((.+)\)$/u);
|
|
283
|
+
return r ? Lt(r[1], t) : 0;
|
|
284
|
+
}
|
|
285
|
+
}, ii = /* @__PURE__ */ new Set(["x", "y", "z"]), ri = fe.filter((t) => !ii.has(t));
|
|
286
|
+
function oi(t) {
|
|
287
|
+
const e = [];
|
|
288
|
+
return ri.forEach((n) => {
|
|
289
|
+
const s = t.getValue(n);
|
|
290
|
+
s !== void 0 && (e.push([n, s.get()]), s.set(n.startsWith("scale") ? 1 : 0));
|
|
291
|
+
}), e;
|
|
292
|
+
}
|
|
293
|
+
const Q = {
|
|
294
|
+
// Dimensions
|
|
295
|
+
width: ({ x: t }, { paddingLeft: e = "0", paddingRight: n = "0" }) => t.max - t.min - parseFloat(e) - parseFloat(n),
|
|
296
|
+
height: ({ y: t }, { paddingTop: e = "0", paddingBottom: n = "0" }) => t.max - t.min - parseFloat(e) - parseFloat(n),
|
|
297
|
+
top: (t, { top: e }) => parseFloat(e),
|
|
298
|
+
left: (t, { left: e }) => parseFloat(e),
|
|
299
|
+
bottom: ({ y: t }, { top: e }) => parseFloat(e) + (t.max - t.min),
|
|
300
|
+
right: ({ x: t }, { left: e }) => parseFloat(e) + (t.max - t.min),
|
|
301
|
+
// Transform
|
|
302
|
+
x: Nt(4, 13),
|
|
303
|
+
y: Nt(5, 14)
|
|
304
|
+
};
|
|
305
|
+
Q.translateX = Q.x;
|
|
306
|
+
Q.translateY = Q.y;
|
|
307
|
+
const Fn = (t) => (e) => e.test(t), ai = {
|
|
308
|
+
test: (t) => t === "auto",
|
|
309
|
+
parse: (t) => t
|
|
310
|
+
}, Dn = [se, m, J, N, ni, ti, ai], Bt = (t) => Dn.find(Fn(t)), W = /* @__PURE__ */ new Set();
|
|
311
|
+
let Ge = !1, Ue = !1;
|
|
312
|
+
function Rn() {
|
|
313
|
+
if (Ue) {
|
|
314
|
+
const t = Array.from(W).filter((s) => s.needsMeasurement), e = new Set(t.map((s) => s.element)), n = /* @__PURE__ */ new Map();
|
|
315
|
+
e.forEach((s) => {
|
|
316
|
+
const i = oi(s);
|
|
317
|
+
i.length && (n.set(s, i), s.render());
|
|
318
|
+
}), t.forEach((s) => s.measureInitialState()), e.forEach((s) => {
|
|
319
|
+
s.render();
|
|
320
|
+
const i = n.get(s);
|
|
321
|
+
i && i.forEach(([r, o]) => {
|
|
322
|
+
var a;
|
|
323
|
+
(a = s.getValue(r)) === null || a === void 0 || a.set(o);
|
|
324
|
+
});
|
|
325
|
+
}), t.forEach((s) => s.measureEndState()), t.forEach((s) => {
|
|
326
|
+
s.suspendedScrollY !== void 0 && window.scrollTo(0, s.suspendedScrollY);
|
|
327
|
+
});
|
|
328
|
+
}
|
|
329
|
+
Ue = !1, Ge = !1, W.forEach((t) => t.complete()), W.clear();
|
|
330
|
+
}
|
|
331
|
+
function In() {
|
|
332
|
+
W.forEach((t) => {
|
|
333
|
+
t.readKeyframes(), t.needsMeasurement && (Ue = !0);
|
|
334
|
+
});
|
|
335
|
+
}
|
|
336
|
+
function li() {
|
|
337
|
+
In(), Rn();
|
|
338
|
+
}
|
|
339
|
+
class ut {
|
|
340
|
+
constructor(e, n, s, i, r, o = !1) {
|
|
341
|
+
this.isComplete = !1, this.isAsync = !1, this.needsMeasurement = !1, this.isScheduled = !1, this.unresolvedKeyframes = [...e], this.onComplete = n, this.name = s, this.motionValue = i, this.element = r, this.isAsync = o;
|
|
342
|
+
}
|
|
343
|
+
scheduleResolve() {
|
|
344
|
+
this.isScheduled = !0, this.isAsync ? (W.add(this), Ge || (Ge = !0, R.read(In), R.resolveKeyframes(Rn))) : (this.readKeyframes(), this.complete());
|
|
345
|
+
}
|
|
346
|
+
readKeyframes() {
|
|
347
|
+
const { unresolvedKeyframes: e, name: n, element: s, motionValue: i } = this;
|
|
348
|
+
for (let r = 0; r < e.length; r++)
|
|
349
|
+
if (e[r] === null)
|
|
350
|
+
if (r === 0) {
|
|
351
|
+
const o = i == null ? void 0 : i.get(), a = e[e.length - 1];
|
|
352
|
+
if (o !== void 0)
|
|
353
|
+
e[0] = o;
|
|
354
|
+
else if (s && n) {
|
|
355
|
+
const l = s.readValue(n, a);
|
|
356
|
+
l != null && (e[0] = l);
|
|
357
|
+
}
|
|
358
|
+
e[0] === void 0 && (e[0] = a), i && o === void 0 && i.set(e[0]);
|
|
359
|
+
} else
|
|
360
|
+
e[r] = e[r - 1];
|
|
361
|
+
}
|
|
362
|
+
setFinalKeyframe() {
|
|
363
|
+
}
|
|
364
|
+
measureInitialState() {
|
|
365
|
+
}
|
|
366
|
+
renderEndStyles() {
|
|
367
|
+
}
|
|
368
|
+
measureEndState() {
|
|
369
|
+
}
|
|
370
|
+
complete() {
|
|
371
|
+
this.isComplete = !0, this.onComplete(this.unresolvedKeyframes, this.finalKeyframe), W.delete(this);
|
|
372
|
+
}
|
|
373
|
+
cancel() {
|
|
374
|
+
this.isComplete || (this.isScheduled = !1, W.delete(this));
|
|
375
|
+
}
|
|
376
|
+
resume() {
|
|
377
|
+
this.isComplete || this.scheduleResolve();
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
const le = (t) => Math.round(t * 1e5) / 1e5, ct = /-?(?:\d+(?:\.\d+)?|\.\d+)/gu;
|
|
381
|
+
function ui(t) {
|
|
382
|
+
return t == null;
|
|
383
|
+
}
|
|
384
|
+
const ci = /^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu, dt = (t, e) => (n) => !!(typeof n == "string" && ci.test(n) && n.startsWith(t) || e && !ui(n) && Object.prototype.hasOwnProperty.call(n, e)), On = (t, e, n) => (s) => {
|
|
385
|
+
if (typeof s != "string")
|
|
386
|
+
return s;
|
|
387
|
+
const [i, r, o, a] = s.match(ct);
|
|
388
|
+
return {
|
|
389
|
+
[t]: parseFloat(i),
|
|
390
|
+
[e]: parseFloat(r),
|
|
391
|
+
[n]: parseFloat(o),
|
|
392
|
+
alpha: a !== void 0 ? parseFloat(a) : 1
|
|
393
|
+
};
|
|
394
|
+
}, di = (t) => U(0, 255, t), Le = {
|
|
395
|
+
...se,
|
|
396
|
+
transform: (t) => Math.round(di(t))
|
|
397
|
+
}, j = {
|
|
398
|
+
test: /* @__PURE__ */ dt("rgb", "red"),
|
|
399
|
+
parse: /* @__PURE__ */ On("red", "green", "blue"),
|
|
400
|
+
transform: ({ red: t, green: e, blue: n, alpha: s = 1 }) => "rgba(" + Le.transform(t) + ", " + Le.transform(e) + ", " + Le.transform(n) + ", " + le(ce.transform(s)) + ")"
|
|
401
|
+
};
|
|
402
|
+
function fi(t) {
|
|
403
|
+
let e = "", n = "", s = "", i = "";
|
|
404
|
+
return t.length > 5 ? (e = t.substring(1, 3), n = t.substring(3, 5), s = t.substring(5, 7), i = t.substring(7, 9)) : (e = t.substring(1, 2), n = t.substring(2, 3), s = t.substring(3, 4), i = t.substring(4, 5), e += e, n += n, s += s, i += i), {
|
|
405
|
+
red: parseInt(e, 16),
|
|
406
|
+
green: parseInt(n, 16),
|
|
407
|
+
blue: parseInt(s, 16),
|
|
408
|
+
alpha: i ? parseInt(i, 16) / 255 : 1
|
|
409
|
+
};
|
|
410
|
+
}
|
|
411
|
+
const ze = {
|
|
412
|
+
test: /* @__PURE__ */ dt("#"),
|
|
413
|
+
parse: fi,
|
|
414
|
+
transform: j.transform
|
|
415
|
+
}, X = {
|
|
416
|
+
test: /* @__PURE__ */ dt("hsl", "hue"),
|
|
417
|
+
parse: /* @__PURE__ */ On("hue", "saturation", "lightness"),
|
|
418
|
+
transform: ({ hue: t, saturation: e, lightness: n, alpha: s = 1 }) => "hsla(" + Math.round(t) + ", " + J.transform(le(e)) + ", " + J.transform(le(n)) + ", " + le(ce.transform(s)) + ")"
|
|
419
|
+
}, C = {
|
|
420
|
+
test: (t) => j.test(t) || ze.test(t) || X.test(t),
|
|
421
|
+
parse: (t) => j.test(t) ? j.parse(t) : X.test(t) ? X.parse(t) : ze.parse(t),
|
|
422
|
+
transform: (t) => typeof t == "string" ? t : t.hasOwnProperty("red") ? j.transform(t) : X.transform(t)
|
|
423
|
+
}, hi = /(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;
|
|
424
|
+
function pi(t) {
|
|
425
|
+
var e, n;
|
|
426
|
+
return isNaN(t) && typeof t == "string" && (((e = t.match(ct)) === null || e === void 0 ? void 0 : e.length) || 0) + (((n = t.match(hi)) === null || n === void 0 ? void 0 : n.length) || 0) > 0;
|
|
427
|
+
}
|
|
428
|
+
const En = "number", kn = "color", mi = "var", gi = "var(", Kt = "${}", yi = /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;
|
|
429
|
+
function de(t) {
|
|
430
|
+
const e = t.toString(), n = [], s = {
|
|
431
|
+
color: [],
|
|
432
|
+
number: [],
|
|
433
|
+
var: []
|
|
434
|
+
}, i = [];
|
|
435
|
+
let r = 0;
|
|
436
|
+
const a = e.replace(yi, (l) => (C.test(l) ? (s.color.push(r), i.push(kn), n.push(C.parse(l))) : l.startsWith(gi) ? (s.var.push(r), i.push(mi), n.push(l)) : (s.number.push(r), i.push(En), n.push(parseFloat(l))), ++r, Kt)).split(Kt);
|
|
437
|
+
return { values: n, split: a, indexes: s, types: i };
|
|
438
|
+
}
|
|
439
|
+
function Ln(t) {
|
|
440
|
+
return de(t).values;
|
|
441
|
+
}
|
|
442
|
+
function Nn(t) {
|
|
443
|
+
const { split: e, types: n } = de(t), s = e.length;
|
|
444
|
+
return (i) => {
|
|
445
|
+
let r = "";
|
|
446
|
+
for (let o = 0; o < s; o++)
|
|
447
|
+
if (r += e[o], i[o] !== void 0) {
|
|
448
|
+
const a = n[o];
|
|
449
|
+
a === En ? r += le(i[o]) : a === kn ? r += C.transform(i[o]) : r += i[o];
|
|
450
|
+
}
|
|
451
|
+
return r;
|
|
452
|
+
};
|
|
453
|
+
}
|
|
454
|
+
const vi = (t) => typeof t == "number" ? 0 : t;
|
|
455
|
+
function bi(t) {
|
|
456
|
+
const e = Ln(t);
|
|
457
|
+
return Nn(t)(e.map(vi));
|
|
458
|
+
}
|
|
459
|
+
const ie = {
|
|
460
|
+
test: pi,
|
|
461
|
+
parse: Ln,
|
|
462
|
+
createTransformer: Nn,
|
|
463
|
+
getAnimatableNone: bi
|
|
464
|
+
}, wi = /* @__PURE__ */ new Set(["brightness", "contrast", "saturate", "opacity"]);
|
|
465
|
+
function Ti(t) {
|
|
466
|
+
const [e, n] = t.slice(0, -1).split("(");
|
|
467
|
+
if (e === "drop-shadow")
|
|
468
|
+
return t;
|
|
469
|
+
const [s] = n.match(ct) || [];
|
|
470
|
+
if (!s)
|
|
471
|
+
return t;
|
|
472
|
+
const i = n.replace(s, "");
|
|
473
|
+
let r = wi.has(e) ? 1 : 0;
|
|
474
|
+
return s !== n && (r *= 100), e + "(" + r + i + ")";
|
|
475
|
+
}
|
|
476
|
+
const Vi = /\b([a-z-]*)\(.*?\)/gu, He = {
|
|
477
|
+
...ie,
|
|
478
|
+
getAnimatableNone: (t) => {
|
|
479
|
+
const e = t.match(Vi);
|
|
480
|
+
return e ? e.map(Ti).join(" ") : t;
|
|
481
|
+
}
|
|
482
|
+
}, Si = {
|
|
483
|
+
// Border props
|
|
484
|
+
borderWidth: m,
|
|
485
|
+
borderTopWidth: m,
|
|
486
|
+
borderRightWidth: m,
|
|
487
|
+
borderBottomWidth: m,
|
|
488
|
+
borderLeftWidth: m,
|
|
489
|
+
borderRadius: m,
|
|
490
|
+
radius: m,
|
|
491
|
+
borderTopLeftRadius: m,
|
|
492
|
+
borderTopRightRadius: m,
|
|
493
|
+
borderBottomRightRadius: m,
|
|
494
|
+
borderBottomLeftRadius: m,
|
|
495
|
+
// Positioning props
|
|
496
|
+
width: m,
|
|
497
|
+
maxWidth: m,
|
|
498
|
+
height: m,
|
|
499
|
+
maxHeight: m,
|
|
500
|
+
top: m,
|
|
501
|
+
right: m,
|
|
502
|
+
bottom: m,
|
|
503
|
+
left: m,
|
|
504
|
+
// Spacing props
|
|
505
|
+
padding: m,
|
|
506
|
+
paddingTop: m,
|
|
507
|
+
paddingRight: m,
|
|
508
|
+
paddingBottom: m,
|
|
509
|
+
paddingLeft: m,
|
|
510
|
+
margin: m,
|
|
511
|
+
marginTop: m,
|
|
512
|
+
marginRight: m,
|
|
513
|
+
marginBottom: m,
|
|
514
|
+
marginLeft: m,
|
|
515
|
+
// Misc
|
|
516
|
+
backgroundPositionX: m,
|
|
517
|
+
backgroundPositionY: m
|
|
518
|
+
}, xi = {
|
|
519
|
+
rotate: N,
|
|
520
|
+
rotateX: N,
|
|
521
|
+
rotateY: N,
|
|
522
|
+
rotateZ: N,
|
|
523
|
+
scale: ge,
|
|
524
|
+
scaleX: ge,
|
|
525
|
+
scaleY: ge,
|
|
526
|
+
scaleZ: ge,
|
|
527
|
+
skew: N,
|
|
528
|
+
skewX: N,
|
|
529
|
+
skewY: N,
|
|
530
|
+
distance: m,
|
|
531
|
+
translateX: m,
|
|
532
|
+
translateY: m,
|
|
533
|
+
translateZ: m,
|
|
534
|
+
x: m,
|
|
535
|
+
y: m,
|
|
536
|
+
z: m,
|
|
537
|
+
perspective: m,
|
|
538
|
+
transformPerspective: m,
|
|
539
|
+
opacity: ce,
|
|
540
|
+
originX: Et,
|
|
541
|
+
originY: Et,
|
|
542
|
+
originZ: m
|
|
543
|
+
}, _t = {
|
|
544
|
+
...se,
|
|
545
|
+
transform: Math.round
|
|
546
|
+
}, ft = {
|
|
547
|
+
...Si,
|
|
548
|
+
...xi,
|
|
549
|
+
zIndex: _t,
|
|
550
|
+
size: m,
|
|
551
|
+
// SVG
|
|
552
|
+
fillOpacity: ce,
|
|
553
|
+
strokeOpacity: ce,
|
|
554
|
+
numOctaves: _t
|
|
555
|
+
}, Ai = {
|
|
556
|
+
...ft,
|
|
557
|
+
// Color props
|
|
558
|
+
color: C,
|
|
559
|
+
backgroundColor: C,
|
|
560
|
+
outlineColor: C,
|
|
561
|
+
fill: C,
|
|
562
|
+
stroke: C,
|
|
563
|
+
// Border props
|
|
564
|
+
borderColor: C,
|
|
565
|
+
borderTopColor: C,
|
|
566
|
+
borderRightColor: C,
|
|
567
|
+
borderBottomColor: C,
|
|
568
|
+
borderLeftColor: C,
|
|
569
|
+
filter: He,
|
|
570
|
+
WebkitFilter: He
|
|
571
|
+
}, ht = (t) => Ai[t];
|
|
572
|
+
function Bn(t, e) {
|
|
573
|
+
let n = ht(t);
|
|
574
|
+
return n !== He && (n = ie), n.getAnimatableNone ? n.getAnimatableNone(e) : void 0;
|
|
575
|
+
}
|
|
576
|
+
const Mi = /* @__PURE__ */ new Set(["auto", "none", "0"]);
|
|
577
|
+
function Ci(t, e, n) {
|
|
578
|
+
let s = 0, i;
|
|
579
|
+
for (; s < t.length && !i; ) {
|
|
580
|
+
const r = t[s];
|
|
581
|
+
typeof r == "string" && !Mi.has(r) && de(r).values.length && (i = t[s]), s++;
|
|
582
|
+
}
|
|
583
|
+
if (i && n)
|
|
584
|
+
for (const r of e)
|
|
585
|
+
t[r] = Bn(n, i);
|
|
586
|
+
}
|
|
587
|
+
class Kn extends ut {
|
|
588
|
+
constructor(e, n, s, i, r) {
|
|
589
|
+
super(e, n, s, i, r, !0);
|
|
590
|
+
}
|
|
591
|
+
readKeyframes() {
|
|
592
|
+
const { unresolvedKeyframes: e, element: n, name: s } = this;
|
|
593
|
+
if (!n || !n.current)
|
|
594
|
+
return;
|
|
595
|
+
super.readKeyframes();
|
|
596
|
+
for (let l = 0; l < e.length; l++) {
|
|
597
|
+
let u = e[l];
|
|
598
|
+
if (typeof u == "string" && (u = u.trim(), lt(u))) {
|
|
599
|
+
const c = Pn(u, n.current);
|
|
600
|
+
c !== void 0 && (e[l] = c), l === e.length - 1 && (this.finalKeyframe = u);
|
|
601
|
+
}
|
|
602
|
+
}
|
|
603
|
+
if (this.resolveNoneKeyframes(), !si.has(s) || e.length !== 2)
|
|
604
|
+
return;
|
|
605
|
+
const [i, r] = e, o = Bt(i), a = Bt(r);
|
|
606
|
+
if (o !== a)
|
|
607
|
+
if (kt(o) && kt(a))
|
|
608
|
+
for (let l = 0; l < e.length; l++) {
|
|
609
|
+
const u = e[l];
|
|
610
|
+
typeof u == "string" && (e[l] = parseFloat(u));
|
|
611
|
+
}
|
|
612
|
+
else
|
|
613
|
+
this.needsMeasurement = !0;
|
|
614
|
+
}
|
|
615
|
+
resolveNoneKeyframes() {
|
|
616
|
+
const { unresolvedKeyframes: e, name: n } = this, s = [];
|
|
617
|
+
for (let i = 0; i < e.length; i++)
|
|
618
|
+
Ys(e[i]) && s.push(i);
|
|
619
|
+
s.length && Ci(e, s, n);
|
|
620
|
+
}
|
|
621
|
+
measureInitialState() {
|
|
622
|
+
const { element: e, unresolvedKeyframes: n, name: s } = this;
|
|
623
|
+
if (!e || !e.current)
|
|
624
|
+
return;
|
|
625
|
+
s === "height" && (this.suspendedScrollY = window.pageYOffset), this.measuredOrigin = Q[s](e.measureViewportBox(), window.getComputedStyle(e.current)), n[0] = this.measuredOrigin;
|
|
626
|
+
const i = n[n.length - 1];
|
|
627
|
+
i !== void 0 && e.getValue(s, i).jump(i, !1);
|
|
628
|
+
}
|
|
629
|
+
measureEndState() {
|
|
630
|
+
var e;
|
|
631
|
+
const { element: n, name: s, unresolvedKeyframes: i } = this;
|
|
632
|
+
if (!n || !n.current)
|
|
633
|
+
return;
|
|
634
|
+
const r = n.getValue(s);
|
|
635
|
+
r && r.jump(this.measuredOrigin, !1);
|
|
636
|
+
const o = i.length - 1, a = i[o];
|
|
637
|
+
i[o] = Q[s](n.measureViewportBox(), window.getComputedStyle(n.current)), a !== null && this.finalKeyframe === void 0 && (this.finalKeyframe = a), !((e = this.removedTransforms) === null || e === void 0) && e.length && this.removedTransforms.forEach(([l, u]) => {
|
|
638
|
+
n.getValue(l).set(u);
|
|
639
|
+
}), this.resolveNoneKeyframes();
|
|
640
|
+
}
|
|
641
|
+
}
|
|
642
|
+
function pt(t) {
|
|
643
|
+
return typeof t == "function";
|
|
644
|
+
}
|
|
645
|
+
let ye;
|
|
646
|
+
function Pi() {
|
|
647
|
+
ye = void 0;
|
|
648
|
+
}
|
|
649
|
+
const K = {
|
|
650
|
+
now: () => (ye === void 0 && K.set(ve.isProcessing || $s.useManualTiming ? ve.timestamp : performance.now()), ye),
|
|
651
|
+
set: (t) => {
|
|
652
|
+
ye = t, queueMicrotask(Pi);
|
|
653
|
+
}
|
|
654
|
+
}, $t = (t, e) => e === "zIndex" ? !1 : !!(typeof t == "number" || Array.isArray(t) || typeof t == "string" && // It's animatable if we have a string
|
|
655
|
+
(ie.test(t) || t === "0") && // And it contains numbers and/or colors
|
|
656
|
+
!t.startsWith("url("));
|
|
657
|
+
function Fi(t) {
|
|
658
|
+
const e = t[0];
|
|
659
|
+
if (t.length === 1)
|
|
660
|
+
return !0;
|
|
661
|
+
for (let n = 0; n < t.length; n++)
|
|
662
|
+
if (t[n] !== e)
|
|
663
|
+
return !0;
|
|
664
|
+
}
|
|
665
|
+
function Di(t, e, n, s) {
|
|
666
|
+
const i = t[0];
|
|
667
|
+
if (i === null)
|
|
668
|
+
return !1;
|
|
669
|
+
if (e === "display" || e === "visibility")
|
|
670
|
+
return !0;
|
|
671
|
+
const r = t[t.length - 1], o = $t(i, e), a = $t(r, e);
|
|
672
|
+
return ne(o === a, `You are trying to animate ${e} from "${i}" to "${r}". ${i} is not an animatable value - to enable this animation set ${i} to a value animatable to ${r} via the \`style\` property.`), !o || !a ? !1 : Fi(t) || (n === "spring" || pt(n)) && s;
|
|
673
|
+
}
|
|
674
|
+
const Ri = 40;
|
|
675
|
+
class _n {
|
|
676
|
+
constructor({ autoplay: e = !0, delay: n = 0, type: s = "keyframes", repeat: i = 0, repeatDelay: r = 0, repeatType: o = "loop", ...a }) {
|
|
677
|
+
this.isStopped = !1, this.hasAttemptedResolve = !1, this.createdAt = K.now(), this.options = {
|
|
678
|
+
autoplay: e,
|
|
679
|
+
delay: n,
|
|
680
|
+
type: s,
|
|
681
|
+
repeat: i,
|
|
682
|
+
repeatDelay: r,
|
|
683
|
+
repeatType: o,
|
|
684
|
+
...a
|
|
685
|
+
}, this.updateFinishedPromise();
|
|
686
|
+
}
|
|
687
|
+
/**
|
|
688
|
+
* This method uses the createdAt and resolvedAt to calculate the
|
|
689
|
+
* animation startTime. *Ideally*, we would use the createdAt time as t=0
|
|
690
|
+
* as the following frame would then be the first frame of the animation in
|
|
691
|
+
* progress, which would feel snappier.
|
|
692
|
+
*
|
|
693
|
+
* However, if there's a delay (main thread work) between the creation of
|
|
694
|
+
* the animation and the first commited frame, we prefer to use resolvedAt
|
|
695
|
+
* to avoid a sudden jump into the animation.
|
|
696
|
+
*/
|
|
697
|
+
calcStartTime() {
|
|
698
|
+
return this.resolvedAt ? this.resolvedAt - this.createdAt > Ri ? this.resolvedAt : this.createdAt : this.createdAt;
|
|
699
|
+
}
|
|
700
|
+
/**
|
|
701
|
+
* A getter for resolved data. If keyframes are not yet resolved, accessing
|
|
702
|
+
* this.resolved will synchronously flush all pending keyframe resolvers.
|
|
703
|
+
* This is a deoptimisation, but at its worst still batches read/writes.
|
|
704
|
+
*/
|
|
705
|
+
get resolved() {
|
|
706
|
+
return !this._resolved && !this.hasAttemptedResolve && li(), this._resolved;
|
|
707
|
+
}
|
|
708
|
+
/**
|
|
709
|
+
* A method to be called when the keyframes resolver completes. This method
|
|
710
|
+
* will check if its possible to run the animation and, if not, skip it.
|
|
711
|
+
* Otherwise, it will call initPlayback on the implementing class.
|
|
712
|
+
*/
|
|
713
|
+
onKeyframesResolved(e, n) {
|
|
714
|
+
this.resolvedAt = K.now(), this.hasAttemptedResolve = !0;
|
|
715
|
+
const { name: s, type: i, velocity: r, delay: o, onComplete: a, onUpdate: l, isGenerator: u } = this.options;
|
|
716
|
+
if (!u && !Di(e, s, i, r))
|
|
717
|
+
if (o)
|
|
718
|
+
this.options.duration = 0;
|
|
719
|
+
else {
|
|
720
|
+
l == null || l(Fe(e, this.options, n)), a == null || a(), this.resolveFinishedPromise();
|
|
721
|
+
return;
|
|
722
|
+
}
|
|
723
|
+
const c = this.initPlayback(e, n);
|
|
724
|
+
c !== !1 && (this._resolved = {
|
|
725
|
+
keyframes: e,
|
|
726
|
+
finalKeyframe: n,
|
|
727
|
+
...c
|
|
728
|
+
}, this.onPostResolved());
|
|
729
|
+
}
|
|
730
|
+
onPostResolved() {
|
|
731
|
+
}
|
|
732
|
+
/**
|
|
733
|
+
* Allows the returned animation to be awaited or promise-chained. Currently
|
|
734
|
+
* resolves when the animation finishes at all but in a future update could/should
|
|
735
|
+
* reject if its cancels.
|
|
736
|
+
*/
|
|
737
|
+
then(e, n) {
|
|
738
|
+
return this.currentFinishedPromise.then(e, n);
|
|
739
|
+
}
|
|
740
|
+
flatten() {
|
|
741
|
+
this.options.type = "keyframes", this.options.ease = "linear";
|
|
742
|
+
}
|
|
743
|
+
updateFinishedPromise() {
|
|
744
|
+
this.currentFinishedPromise = new Promise((e) => {
|
|
745
|
+
this.resolveFinishedPromise = e;
|
|
746
|
+
});
|
|
747
|
+
}
|
|
748
|
+
}
|
|
749
|
+
const mt = (t, e, n) => {
|
|
750
|
+
const s = e - t;
|
|
751
|
+
return s === 0 ? 1 : (n - t) / s;
|
|
752
|
+
}, $n = (t, e, n = 10) => {
|
|
753
|
+
let s = "";
|
|
754
|
+
const i = Math.max(Math.round(e / n), 2);
|
|
755
|
+
for (let r = 0; r < i; r++)
|
|
756
|
+
s += t(mt(0, i - 1, r)) + ", ";
|
|
757
|
+
return `linear(${s.substring(0, s.length - 2)})`;
|
|
758
|
+
};
|
|
759
|
+
function jn(t, e) {
|
|
760
|
+
return e ? t * (1e3 / e) : 0;
|
|
761
|
+
}
|
|
762
|
+
const Ii = 5;
|
|
763
|
+
function Wn(t, e, n) {
|
|
764
|
+
const s = Math.max(e - Ii, 0);
|
|
765
|
+
return jn(n - t(s), e - s);
|
|
766
|
+
}
|
|
767
|
+
const x = {
|
|
768
|
+
// Default spring physics
|
|
769
|
+
stiffness: 100,
|
|
770
|
+
damping: 10,
|
|
771
|
+
mass: 1,
|
|
772
|
+
velocity: 0,
|
|
773
|
+
// Default duration/bounce-based options
|
|
774
|
+
duration: 800,
|
|
775
|
+
// in ms
|
|
776
|
+
bounce: 0.3,
|
|
777
|
+
visualDuration: 0.3,
|
|
778
|
+
// in seconds
|
|
779
|
+
// Rest thresholds
|
|
780
|
+
restSpeed: {
|
|
781
|
+
granular: 0.01,
|
|
782
|
+
default: 2
|
|
783
|
+
},
|
|
784
|
+
restDelta: {
|
|
785
|
+
granular: 5e-3,
|
|
786
|
+
default: 0.5
|
|
787
|
+
},
|
|
788
|
+
// Limits
|
|
789
|
+
minDuration: 0.01,
|
|
790
|
+
// in seconds
|
|
791
|
+
maxDuration: 10,
|
|
792
|
+
// in seconds
|
|
793
|
+
minDamping: 0.05,
|
|
794
|
+
maxDamping: 1
|
|
795
|
+
}, jt = 1e-3;
|
|
796
|
+
function Oi({ duration: t = x.duration, bounce: e = x.bounce, velocity: n = x.velocity, mass: s = x.mass }) {
|
|
797
|
+
let i, r;
|
|
798
|
+
ne(t <= L(x.maxDuration), "Spring duration must be 10 seconds or less");
|
|
799
|
+
let o = 1 - e;
|
|
800
|
+
o = U(x.minDamping, x.maxDamping, o), t = U(x.minDuration, x.maxDuration, B(t)), o < 1 ? (i = (u) => {
|
|
801
|
+
const c = u * o, f = c * t, d = c - n, h = qe(u, o), y = Math.exp(-f);
|
|
802
|
+
return jt - d / h * y;
|
|
803
|
+
}, r = (u) => {
|
|
804
|
+
const f = u * o * t, d = f * n + n, h = Math.pow(o, 2) * Math.pow(u, 2) * t, y = Math.exp(-f), v = qe(Math.pow(u, 2), o);
|
|
805
|
+
return (-i(u) + jt > 0 ? -1 : 1) * ((d - h) * y) / v;
|
|
806
|
+
}) : (i = (u) => {
|
|
807
|
+
const c = Math.exp(-u * t), f = (u - n) * t + 1;
|
|
808
|
+
return -1e-3 + c * f;
|
|
809
|
+
}, r = (u) => {
|
|
810
|
+
const c = Math.exp(-u * t), f = (n - u) * (t * t);
|
|
811
|
+
return c * f;
|
|
812
|
+
});
|
|
813
|
+
const a = 5 / t, l = ki(i, r, a);
|
|
814
|
+
if (t = L(t), isNaN(l))
|
|
815
|
+
return {
|
|
816
|
+
stiffness: x.stiffness,
|
|
817
|
+
damping: x.damping,
|
|
818
|
+
duration: t
|
|
819
|
+
};
|
|
820
|
+
{
|
|
821
|
+
const u = Math.pow(l, 2) * s;
|
|
822
|
+
return {
|
|
823
|
+
stiffness: u,
|
|
824
|
+
damping: o * 2 * Math.sqrt(s * u),
|
|
825
|
+
duration: t
|
|
826
|
+
};
|
|
827
|
+
}
|
|
828
|
+
}
|
|
829
|
+
const Ei = 12;
|
|
830
|
+
function ki(t, e, n) {
|
|
831
|
+
let s = n;
|
|
832
|
+
for (let i = 1; i < Ei; i++)
|
|
833
|
+
s = s - t(s) / e(s);
|
|
834
|
+
return s;
|
|
835
|
+
}
|
|
836
|
+
function qe(t, e) {
|
|
837
|
+
return t * Math.sqrt(1 - e * e);
|
|
838
|
+
}
|
|
839
|
+
const Ye = 2e4;
|
|
840
|
+
function Gn(t) {
|
|
841
|
+
let e = 0;
|
|
842
|
+
const n = 50;
|
|
843
|
+
let s = t.next(e);
|
|
844
|
+
for (; !s.done && e < Ye; )
|
|
845
|
+
e += n, s = t.next(e);
|
|
846
|
+
return e >= Ye ? 1 / 0 : e;
|
|
847
|
+
}
|
|
848
|
+
const Li = ["duration", "bounce"], Ni = ["stiffness", "damping", "mass"];
|
|
849
|
+
function Wt(t, e) {
|
|
850
|
+
return e.some((n) => t[n] !== void 0);
|
|
851
|
+
}
|
|
852
|
+
function Bi(t) {
|
|
853
|
+
let e = {
|
|
854
|
+
velocity: x.velocity,
|
|
855
|
+
stiffness: x.stiffness,
|
|
856
|
+
damping: x.damping,
|
|
857
|
+
mass: x.mass,
|
|
858
|
+
isResolvedFromDuration: !1,
|
|
859
|
+
...t
|
|
860
|
+
};
|
|
861
|
+
if (!Wt(t, Ni) && Wt(t, Li))
|
|
862
|
+
if (t.visualDuration) {
|
|
863
|
+
const n = t.visualDuration, s = 2 * Math.PI / (n * 1.2), i = s * s, r = 2 * U(0.05, 1, 1 - t.bounce) * Math.sqrt(i);
|
|
864
|
+
e = {
|
|
865
|
+
...e,
|
|
866
|
+
mass: x.mass,
|
|
867
|
+
stiffness: i,
|
|
868
|
+
damping: r
|
|
869
|
+
};
|
|
870
|
+
} else {
|
|
871
|
+
const n = Oi(t);
|
|
872
|
+
e = {
|
|
873
|
+
...e,
|
|
874
|
+
...n,
|
|
875
|
+
mass: x.mass
|
|
876
|
+
}, e.isResolvedFromDuration = !0;
|
|
877
|
+
}
|
|
878
|
+
return e;
|
|
879
|
+
}
|
|
880
|
+
function Un(t = x.visualDuration, e = x.bounce) {
|
|
881
|
+
const n = typeof t != "object" ? {
|
|
882
|
+
visualDuration: t,
|
|
883
|
+
keyframes: [0, 1],
|
|
884
|
+
bounce: e
|
|
885
|
+
} : t;
|
|
886
|
+
let { restSpeed: s, restDelta: i } = n;
|
|
887
|
+
const r = n.keyframes[0], o = n.keyframes[n.keyframes.length - 1], a = { done: !1, value: r }, { stiffness: l, damping: u, mass: c, duration: f, velocity: d, isResolvedFromDuration: h } = Bi({
|
|
888
|
+
...n,
|
|
889
|
+
velocity: -B(n.velocity || 0)
|
|
890
|
+
}), y = d || 0, v = u / (2 * Math.sqrt(l * c)), b = o - r, p = B(Math.sqrt(l / c)), g = Math.abs(b) < 5;
|
|
891
|
+
s || (s = g ? x.restSpeed.granular : x.restSpeed.default), i || (i = g ? x.restDelta.granular : x.restDelta.default);
|
|
892
|
+
let V;
|
|
893
|
+
if (v < 1) {
|
|
894
|
+
const w = qe(p, v);
|
|
895
|
+
V = (S) => {
|
|
896
|
+
const M = Math.exp(-v * p * S);
|
|
897
|
+
return o - M * ((y + v * p * b) / w * Math.sin(w * S) + b * Math.cos(w * S));
|
|
898
|
+
};
|
|
899
|
+
} else if (v === 1)
|
|
900
|
+
V = (w) => o - Math.exp(-p * w) * (b + (y + p * b) * w);
|
|
901
|
+
else {
|
|
902
|
+
const w = p * Math.sqrt(v * v - 1);
|
|
903
|
+
V = (S) => {
|
|
904
|
+
const M = Math.exp(-v * p * S), T = Math.min(w * S, 300);
|
|
905
|
+
return o - M * ((y + v * p * b) * Math.sinh(T) + w * b * Math.cosh(T)) / w;
|
|
906
|
+
};
|
|
907
|
+
}
|
|
908
|
+
const A = {
|
|
909
|
+
calculatedDuration: h && f || null,
|
|
910
|
+
next: (w) => {
|
|
911
|
+
const S = V(w);
|
|
912
|
+
if (h)
|
|
913
|
+
a.done = w >= f;
|
|
914
|
+
else {
|
|
915
|
+
let M = 0;
|
|
916
|
+
v < 1 && (M = w === 0 ? L(y) : Wn(V, w, S));
|
|
917
|
+
const T = Math.abs(M) <= s, D = Math.abs(o - S) <= i;
|
|
918
|
+
a.done = T && D;
|
|
919
|
+
}
|
|
920
|
+
return a.value = a.done ? o : S, a;
|
|
921
|
+
},
|
|
922
|
+
toString: () => {
|
|
923
|
+
const w = Math.min(Gn(A), Ye), S = $n((M) => A.next(w * M).value, w, 30);
|
|
924
|
+
return w + "ms " + S;
|
|
925
|
+
}
|
|
926
|
+
};
|
|
927
|
+
return A;
|
|
928
|
+
}
|
|
929
|
+
function Gt({ keyframes: t, velocity: e = 0, power: n = 0.8, timeConstant: s = 325, bounceDamping: i = 10, bounceStiffness: r = 500, modifyTarget: o, min: a, max: l, restDelta: u = 0.5, restSpeed: c }) {
|
|
930
|
+
const f = t[0], d = {
|
|
931
|
+
done: !1,
|
|
932
|
+
value: f
|
|
933
|
+
}, h = (T) => a !== void 0 && T < a || l !== void 0 && T > l, y = (T) => a === void 0 ? l : l === void 0 || Math.abs(a - T) < Math.abs(l - T) ? a : l;
|
|
934
|
+
let v = n * e;
|
|
935
|
+
const b = f + v, p = o === void 0 ? b : o(b);
|
|
936
|
+
p !== b && (v = p - f);
|
|
937
|
+
const g = (T) => -v * Math.exp(-T / s), V = (T) => p + g(T), A = (T) => {
|
|
938
|
+
const D = g(T), I = V(T);
|
|
939
|
+
d.done = Math.abs(D) <= u, d.value = d.done ? p : I;
|
|
940
|
+
};
|
|
941
|
+
let w, S;
|
|
942
|
+
const M = (T) => {
|
|
943
|
+
h(d.value) && (w = T, S = Un({
|
|
944
|
+
keyframes: [d.value, y(d.value)],
|
|
945
|
+
velocity: Wn(V, T, d.value),
|
|
946
|
+
// TODO: This should be passing * 1000
|
|
947
|
+
damping: i,
|
|
948
|
+
stiffness: r,
|
|
949
|
+
restDelta: u,
|
|
950
|
+
restSpeed: c
|
|
951
|
+
}));
|
|
952
|
+
};
|
|
953
|
+
return M(0), {
|
|
954
|
+
calculatedDuration: null,
|
|
955
|
+
next: (T) => {
|
|
956
|
+
let D = !1;
|
|
957
|
+
return !S && w === void 0 && (D = !0, A(T), M(T)), w !== void 0 && T >= w ? S.next(T - w) : (!D && A(T), d);
|
|
958
|
+
}
|
|
959
|
+
};
|
|
960
|
+
}
|
|
961
|
+
const Ki = /* @__PURE__ */ he(0.42, 0, 1, 1), _i = /* @__PURE__ */ he(0, 0, 0.58, 1), zn = /* @__PURE__ */ he(0.42, 0, 0.58, 1), $i = (t) => Array.isArray(t) && typeof t[0] != "number", gt = (t) => Array.isArray(t) && typeof t[0] == "number", Ut = {
|
|
962
|
+
linear: _,
|
|
963
|
+
easeIn: Ki,
|
|
964
|
+
easeInOut: zn,
|
|
965
|
+
easeOut: _i,
|
|
966
|
+
circIn: at,
|
|
967
|
+
circInOut: Sn,
|
|
968
|
+
circOut: qs,
|
|
969
|
+
backIn: ot,
|
|
970
|
+
backInOut: Tn,
|
|
971
|
+
backOut: wn,
|
|
972
|
+
anticipate: Vn
|
|
973
|
+
}, zt = (t) => {
|
|
974
|
+
if (gt(t)) {
|
|
975
|
+
G(t.length === 4, "Cubic bezier arrays must contain four numerical values.");
|
|
976
|
+
const [e, n, s, i] = t;
|
|
977
|
+
return he(e, n, s, i);
|
|
978
|
+
} else if (typeof t == "string")
|
|
979
|
+
return G(Ut[t] !== void 0, `Invalid easing type '${t}'`), Ut[t];
|
|
980
|
+
return t;
|
|
981
|
+
}, ji = (t, e) => (n) => e(t(n)), De = (...t) => t.reduce(ji), Re = (t, e, n) => t + (e - t) * n;
|
|
982
|
+
function Ne(t, e, n) {
|
|
983
|
+
return n < 0 && (n += 1), n > 1 && (n -= 1), n < 1 / 6 ? t + (e - t) * 6 * n : n < 1 / 2 ? e : n < 2 / 3 ? t + (e - t) * (2 / 3 - n) * 6 : t;
|
|
984
|
+
}
|
|
985
|
+
function Wi({ hue: t, saturation: e, lightness: n, alpha: s }) {
|
|
986
|
+
t /= 360, e /= 100, n /= 100;
|
|
987
|
+
let i = 0, r = 0, o = 0;
|
|
988
|
+
if (!e)
|
|
989
|
+
i = r = o = n;
|
|
990
|
+
else {
|
|
991
|
+
const a = n < 0.5 ? n * (1 + e) : n + e - n * e, l = 2 * n - a;
|
|
992
|
+
i = Ne(l, a, t + 1 / 3), r = Ne(l, a, t), o = Ne(l, a, t - 1 / 3);
|
|
993
|
+
}
|
|
994
|
+
return {
|
|
995
|
+
red: Math.round(i * 255),
|
|
996
|
+
green: Math.round(r * 255),
|
|
997
|
+
blue: Math.round(o * 255),
|
|
998
|
+
alpha: s
|
|
999
|
+
};
|
|
1000
|
+
}
|
|
1001
|
+
function be(t, e) {
|
|
1002
|
+
return (n) => n > 0 ? e : t;
|
|
1003
|
+
}
|
|
1004
|
+
const Be = (t, e, n) => {
|
|
1005
|
+
const s = t * t, i = n * (e * e - s) + s;
|
|
1006
|
+
return i < 0 ? 0 : Math.sqrt(i);
|
|
1007
|
+
}, Gi = [ze, j, X], Ui = (t) => Gi.find((e) => e.test(t));
|
|
1008
|
+
function Ht(t) {
|
|
1009
|
+
const e = Ui(t);
|
|
1010
|
+
if (ne(!!e, `'${t}' is not an animatable color. Use the equivalent color code instead.`), !e)
|
|
1011
|
+
return !1;
|
|
1012
|
+
let n = e.parse(t);
|
|
1013
|
+
return e === X && (n = Wi(n)), n;
|
|
1014
|
+
}
|
|
1015
|
+
const qt = (t, e) => {
|
|
1016
|
+
const n = Ht(t), s = Ht(e);
|
|
1017
|
+
if (!n || !s)
|
|
1018
|
+
return be(t, e);
|
|
1019
|
+
const i = { ...n };
|
|
1020
|
+
return (r) => (i.red = Be(n.red, s.red, r), i.green = Be(n.green, s.green, r), i.blue = Be(n.blue, s.blue, r), i.alpha = Re(n.alpha, s.alpha, r), j.transform(i));
|
|
1021
|
+
}, Xe = /* @__PURE__ */ new Set(["none", "hidden"]);
|
|
1022
|
+
function zi(t, e) {
|
|
1023
|
+
return Xe.has(t) ? (n) => n <= 0 ? t : e : (n) => n >= 1 ? e : t;
|
|
1024
|
+
}
|
|
1025
|
+
function Hi(t, e) {
|
|
1026
|
+
return (n) => Re(t, e, n);
|
|
1027
|
+
}
|
|
1028
|
+
function yt(t) {
|
|
1029
|
+
return typeof t == "number" ? Hi : typeof t == "string" ? lt(t) ? be : C.test(t) ? qt : Xi : Array.isArray(t) ? Hn : typeof t == "object" ? C.test(t) ? qt : qi : be;
|
|
1030
|
+
}
|
|
1031
|
+
function Hn(t, e) {
|
|
1032
|
+
const n = [...t], s = n.length, i = t.map((r, o) => yt(r)(r, e[o]));
|
|
1033
|
+
return (r) => {
|
|
1034
|
+
for (let o = 0; o < s; o++)
|
|
1035
|
+
n[o] = i[o](r);
|
|
1036
|
+
return n;
|
|
1037
|
+
};
|
|
1038
|
+
}
|
|
1039
|
+
function qi(t, e) {
|
|
1040
|
+
const n = { ...t, ...e }, s = {};
|
|
1041
|
+
for (const i in n)
|
|
1042
|
+
t[i] !== void 0 && e[i] !== void 0 && (s[i] = yt(t[i])(t[i], e[i]));
|
|
1043
|
+
return (i) => {
|
|
1044
|
+
for (const r in s)
|
|
1045
|
+
n[r] = s[r](i);
|
|
1046
|
+
return n;
|
|
1047
|
+
};
|
|
1048
|
+
}
|
|
1049
|
+
function Yi(t, e) {
|
|
1050
|
+
var n;
|
|
1051
|
+
const s = [], i = { color: 0, var: 0, number: 0 };
|
|
1052
|
+
for (let r = 0; r < e.values.length; r++) {
|
|
1053
|
+
const o = e.types[r], a = t.indexes[o][i[o]], l = (n = t.values[a]) !== null && n !== void 0 ? n : 0;
|
|
1054
|
+
s[r] = l, i[o]++;
|
|
1055
|
+
}
|
|
1056
|
+
return s;
|
|
1057
|
+
}
|
|
1058
|
+
const Xi = (t, e) => {
|
|
1059
|
+
const n = ie.createTransformer(e), s = de(t), i = de(e);
|
|
1060
|
+
return s.indexes.var.length === i.indexes.var.length && s.indexes.color.length === i.indexes.color.length && s.indexes.number.length >= i.indexes.number.length ? Xe.has(t) && !i.values.length || Xe.has(e) && !s.values.length ? zi(t, e) : De(Hn(Yi(s, i), i.values), n) : (ne(!0, `Complex values '${t}' and '${e}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`), be(t, e));
|
|
1061
|
+
};
|
|
1062
|
+
function qn(t, e, n) {
|
|
1063
|
+
return typeof t == "number" && typeof e == "number" && typeof n == "number" ? Re(t, e, n) : yt(t)(t, e);
|
|
1064
|
+
}
|
|
1065
|
+
function Zi(t, e, n) {
|
|
1066
|
+
const s = [], i = n || qn, r = t.length - 1;
|
|
1067
|
+
for (let o = 0; o < r; o++) {
|
|
1068
|
+
let a = i(t[o], t[o + 1]);
|
|
1069
|
+
if (e) {
|
|
1070
|
+
const l = Array.isArray(e) ? e[o] || _ : e;
|
|
1071
|
+
a = De(l, a);
|
|
1072
|
+
}
|
|
1073
|
+
s.push(a);
|
|
1074
|
+
}
|
|
1075
|
+
return s;
|
|
1076
|
+
}
|
|
1077
|
+
function Ji(t, e, { clamp: n = !0, ease: s, mixer: i } = {}) {
|
|
1078
|
+
const r = t.length;
|
|
1079
|
+
if (G(r === e.length, "Both input and output ranges must be the same length"), r === 1)
|
|
1080
|
+
return () => e[0];
|
|
1081
|
+
if (r === 2 && t[0] === t[1])
|
|
1082
|
+
return () => e[1];
|
|
1083
|
+
t[0] > t[r - 1] && (t = [...t].reverse(), e = [...e].reverse());
|
|
1084
|
+
const o = Zi(e, s, i), a = o.length, l = (u) => {
|
|
1085
|
+
let c = 0;
|
|
1086
|
+
if (a > 1)
|
|
1087
|
+
for (; c < t.length - 2 && !(u < t[c + 1]); c++)
|
|
1088
|
+
;
|
|
1089
|
+
const f = mt(t[c], t[c + 1], u);
|
|
1090
|
+
return o[c](f);
|
|
1091
|
+
};
|
|
1092
|
+
return n ? (u) => l(U(t[0], t[r - 1], u)) : l;
|
|
1093
|
+
}
|
|
1094
|
+
function Qi(t, e) {
|
|
1095
|
+
const n = t[t.length - 1];
|
|
1096
|
+
for (let s = 1; s <= e; s++) {
|
|
1097
|
+
const i = mt(0, e, s);
|
|
1098
|
+
t.push(Re(n, 1, i));
|
|
1099
|
+
}
|
|
1100
|
+
}
|
|
1101
|
+
function er(t) {
|
|
1102
|
+
const e = [0];
|
|
1103
|
+
return Qi(e, t.length - 1), e;
|
|
1104
|
+
}
|
|
1105
|
+
function tr(t, e) {
|
|
1106
|
+
return t.map((n) => n * e);
|
|
1107
|
+
}
|
|
1108
|
+
function nr(t, e) {
|
|
1109
|
+
return t.map(() => e || zn).splice(0, t.length - 1);
|
|
1110
|
+
}
|
|
1111
|
+
function we({ duration: t = 300, keyframes: e, times: n, ease: s = "easeInOut" }) {
|
|
1112
|
+
const i = $i(s) ? s.map(zt) : zt(s), r = {
|
|
1113
|
+
done: !1,
|
|
1114
|
+
value: e[0]
|
|
1115
|
+
}, o = tr(
|
|
1116
|
+
// Only use the provided offsets if they're the correct length
|
|
1117
|
+
// TODO Maybe we should warn here if there's a length mismatch
|
|
1118
|
+
n && n.length === e.length ? n : er(e),
|
|
1119
|
+
t
|
|
1120
|
+
), a = Ji(o, e, {
|
|
1121
|
+
ease: Array.isArray(i) ? i : nr(e, i)
|
|
1122
|
+
});
|
|
1123
|
+
return {
|
|
1124
|
+
calculatedDuration: t,
|
|
1125
|
+
next: (l) => (r.value = a(l), r.done = l >= t, r)
|
|
1126
|
+
};
|
|
1127
|
+
}
|
|
1128
|
+
const sr = (t) => {
|
|
1129
|
+
const e = ({ timestamp: n }) => t(n);
|
|
1130
|
+
return {
|
|
1131
|
+
start: () => R.update(e, !0),
|
|
1132
|
+
stop: () => We(e),
|
|
1133
|
+
/**
|
|
1134
|
+
* If we're processing this frame we can use the
|
|
1135
|
+
* framelocked timestamp to keep things in sync.
|
|
1136
|
+
*/
|
|
1137
|
+
now: () => ve.isProcessing ? ve.timestamp : K.now()
|
|
1138
|
+
};
|
|
1139
|
+
}, ir = {
|
|
1140
|
+
decay: Gt,
|
|
1141
|
+
inertia: Gt,
|
|
1142
|
+
tween: we,
|
|
1143
|
+
keyframes: we,
|
|
1144
|
+
spring: Un
|
|
1145
|
+
}, rr = (t) => t / 100;
|
|
1146
|
+
class vt extends _n {
|
|
1147
|
+
constructor(e) {
|
|
1148
|
+
super(e), this.holdTime = null, this.cancelTime = null, this.currentTime = 0, this.playbackSpeed = 1, this.pendingPlayState = "running", this.startTime = null, this.state = "idle", this.stop = () => {
|
|
1149
|
+
if (this.resolver.cancel(), this.isStopped = !0, this.state === "idle")
|
|
1150
|
+
return;
|
|
1151
|
+
this.teardown();
|
|
1152
|
+
const { onStop: l } = this.options;
|
|
1153
|
+
l && l();
|
|
1154
|
+
};
|
|
1155
|
+
const { name: n, motionValue: s, element: i, keyframes: r } = this.options, o = (i == null ? void 0 : i.KeyframeResolver) || ut, a = (l, u) => this.onKeyframesResolved(l, u);
|
|
1156
|
+
this.resolver = new o(r, a, n, s, i), this.resolver.scheduleResolve();
|
|
1157
|
+
}
|
|
1158
|
+
flatten() {
|
|
1159
|
+
super.flatten(), this._resolved && Object.assign(this._resolved, this.initPlayback(this._resolved.keyframes));
|
|
1160
|
+
}
|
|
1161
|
+
initPlayback(e) {
|
|
1162
|
+
const { type: n = "keyframes", repeat: s = 0, repeatDelay: i = 0, repeatType: r, velocity: o = 0 } = this.options, a = pt(n) ? n : ir[n] || we;
|
|
1163
|
+
let l, u;
|
|
1164
|
+
a !== we && typeof e[0] != "number" && (process.env.NODE_ENV !== "production" && G(e.length === 2, `Only two keyframes currently supported with spring and inertia animations. Trying to animate ${e}`), l = De(rr, qn(e[0], e[1])), e = [0, 100]);
|
|
1165
|
+
const c = a({ ...this.options, keyframes: e });
|
|
1166
|
+
r === "mirror" && (u = a({
|
|
1167
|
+
...this.options,
|
|
1168
|
+
keyframes: [...e].reverse(),
|
|
1169
|
+
velocity: -o
|
|
1170
|
+
})), c.calculatedDuration === null && (c.calculatedDuration = Gn(c));
|
|
1171
|
+
const { calculatedDuration: f } = c, d = f + i, h = d * (s + 1) - i;
|
|
1172
|
+
return {
|
|
1173
|
+
generator: c,
|
|
1174
|
+
mirroredGenerator: u,
|
|
1175
|
+
mapPercentToKeyframes: l,
|
|
1176
|
+
calculatedDuration: f,
|
|
1177
|
+
resolvedDuration: d,
|
|
1178
|
+
totalDuration: h
|
|
1179
|
+
};
|
|
1180
|
+
}
|
|
1181
|
+
onPostResolved() {
|
|
1182
|
+
const { autoplay: e = !0 } = this.options;
|
|
1183
|
+
this.play(), this.pendingPlayState === "paused" || !e ? this.pause() : this.state = this.pendingPlayState;
|
|
1184
|
+
}
|
|
1185
|
+
tick(e, n = !1) {
|
|
1186
|
+
const { resolved: s } = this;
|
|
1187
|
+
if (!s) {
|
|
1188
|
+
const { keyframes: T } = this.options;
|
|
1189
|
+
return { done: !0, value: T[T.length - 1] };
|
|
1190
|
+
}
|
|
1191
|
+
const { finalKeyframe: i, generator: r, mirroredGenerator: o, mapPercentToKeyframes: a, keyframes: l, calculatedDuration: u, totalDuration: c, resolvedDuration: f } = s;
|
|
1192
|
+
if (this.startTime === null)
|
|
1193
|
+
return r.next(0);
|
|
1194
|
+
const { delay: d, repeat: h, repeatType: y, repeatDelay: v, onUpdate: b } = this.options;
|
|
1195
|
+
this.speed > 0 ? this.startTime = Math.min(this.startTime, e) : this.speed < 0 && (this.startTime = Math.min(e - c / this.speed, this.startTime)), n ? this.currentTime = e : this.holdTime !== null ? this.currentTime = this.holdTime : this.currentTime = Math.round(e - this.startTime) * this.speed;
|
|
1196
|
+
const p = this.currentTime - d * (this.speed >= 0 ? 1 : -1), g = this.speed >= 0 ? p < 0 : p > c;
|
|
1197
|
+
this.currentTime = Math.max(p, 0), this.state === "finished" && this.holdTime === null && (this.currentTime = c);
|
|
1198
|
+
let V = this.currentTime, A = r;
|
|
1199
|
+
if (h) {
|
|
1200
|
+
const T = Math.min(this.currentTime, c) / f;
|
|
1201
|
+
let D = Math.floor(T), I = T % 1;
|
|
1202
|
+
!I && T >= 1 && (I = 1), I === 1 && D--, D = Math.min(D, h + 1), !!(D % 2) && (y === "reverse" ? (I = 1 - I, v && (I -= v / f)) : y === "mirror" && (A = o)), V = U(0, 1, I) * f;
|
|
1203
|
+
}
|
|
1204
|
+
const w = g ? { done: !1, value: l[0] } : A.next(V);
|
|
1205
|
+
a && (w.value = a(w.value));
|
|
1206
|
+
let { done: S } = w;
|
|
1207
|
+
!g && u !== null && (S = this.speed >= 0 ? this.currentTime >= c : this.currentTime <= 0);
|
|
1208
|
+
const M = this.holdTime === null && (this.state === "finished" || this.state === "running" && S);
|
|
1209
|
+
return M && i !== void 0 && (w.value = Fe(l, this.options, i)), b && b(w.value), M && this.finish(), w;
|
|
1210
|
+
}
|
|
1211
|
+
get duration() {
|
|
1212
|
+
const { resolved: e } = this;
|
|
1213
|
+
return e ? B(e.calculatedDuration) : 0;
|
|
1214
|
+
}
|
|
1215
|
+
get time() {
|
|
1216
|
+
return B(this.currentTime);
|
|
1217
|
+
}
|
|
1218
|
+
set time(e) {
|
|
1219
|
+
e = L(e), this.currentTime = e, this.holdTime !== null || this.speed === 0 ? this.holdTime = e : this.driver && (this.startTime = this.driver.now() - e / this.speed);
|
|
1220
|
+
}
|
|
1221
|
+
get speed() {
|
|
1222
|
+
return this.playbackSpeed;
|
|
1223
|
+
}
|
|
1224
|
+
set speed(e) {
|
|
1225
|
+
const n = this.playbackSpeed !== e;
|
|
1226
|
+
this.playbackSpeed = e, n && (this.time = B(this.currentTime));
|
|
1227
|
+
}
|
|
1228
|
+
play() {
|
|
1229
|
+
if (this.resolver.isScheduled || this.resolver.resume(), !this._resolved) {
|
|
1230
|
+
this.pendingPlayState = "running";
|
|
1231
|
+
return;
|
|
1232
|
+
}
|
|
1233
|
+
if (this.isStopped)
|
|
1234
|
+
return;
|
|
1235
|
+
const { driver: e = sr, onPlay: n, startTime: s } = this.options;
|
|
1236
|
+
this.driver || (this.driver = e((r) => this.tick(r))), n && n();
|
|
1237
|
+
const i = this.driver.now();
|
|
1238
|
+
this.holdTime !== null ? this.startTime = i - this.holdTime : this.startTime ? this.state === "finished" && (this.startTime = i) : this.startTime = s ?? this.calcStartTime(), this.state === "finished" && this.updateFinishedPromise(), this.cancelTime = this.startTime, this.holdTime = null, this.state = "running", this.driver.start();
|
|
1239
|
+
}
|
|
1240
|
+
pause() {
|
|
1241
|
+
var e;
|
|
1242
|
+
if (!this._resolved) {
|
|
1243
|
+
this.pendingPlayState = "paused";
|
|
1244
|
+
return;
|
|
1245
|
+
}
|
|
1246
|
+
this.state = "paused", this.holdTime = (e = this.currentTime) !== null && e !== void 0 ? e : 0;
|
|
1247
|
+
}
|
|
1248
|
+
complete() {
|
|
1249
|
+
this.state !== "running" && this.play(), this.pendingPlayState = this.state = "finished", this.holdTime = null;
|
|
1250
|
+
}
|
|
1251
|
+
finish() {
|
|
1252
|
+
this.teardown(), this.state = "finished";
|
|
1253
|
+
const { onComplete: e } = this.options;
|
|
1254
|
+
e && e();
|
|
1255
|
+
}
|
|
1256
|
+
cancel() {
|
|
1257
|
+
this.cancelTime !== null && this.tick(this.cancelTime), this.teardown(), this.updateFinishedPromise();
|
|
1258
|
+
}
|
|
1259
|
+
teardown() {
|
|
1260
|
+
this.state = "idle", this.stopDriver(), this.resolveFinishedPromise(), this.updateFinishedPromise(), this.startTime = this.cancelTime = null, this.resolver.cancel();
|
|
1261
|
+
}
|
|
1262
|
+
stopDriver() {
|
|
1263
|
+
this.driver && (this.driver.stop(), this.driver = void 0);
|
|
1264
|
+
}
|
|
1265
|
+
sample(e) {
|
|
1266
|
+
return this.startTime = 0, this.tick(e, !0);
|
|
1267
|
+
}
|
|
1268
|
+
}
|
|
1269
|
+
const or = /* @__PURE__ */ new Set([
|
|
1270
|
+
"opacity",
|
|
1271
|
+
"clipPath",
|
|
1272
|
+
"filter",
|
|
1273
|
+
"transform"
|
|
1274
|
+
// TODO: Can be accelerated but currently disabled until https://issues.chromium.org/issues/41491098 is resolved
|
|
1275
|
+
// or until we implement support for linear() easing.
|
|
1276
|
+
// "background-color"
|
|
1277
|
+
]);
|
|
1278
|
+
function bt(t) {
|
|
1279
|
+
let e;
|
|
1280
|
+
return () => (e === void 0 && (e = t()), e);
|
|
1281
|
+
}
|
|
1282
|
+
const ar = {
|
|
1283
|
+
linearEasing: void 0
|
|
1284
|
+
};
|
|
1285
|
+
function lr(t, e) {
|
|
1286
|
+
const n = bt(t);
|
|
1287
|
+
return () => {
|
|
1288
|
+
var s;
|
|
1289
|
+
return (s = ar[e]) !== null && s !== void 0 ? s : n();
|
|
1290
|
+
};
|
|
1291
|
+
}
|
|
1292
|
+
const Te = /* @__PURE__ */ lr(() => {
|
|
1293
|
+
try {
|
|
1294
|
+
document.createElement("div").animate({ opacity: 0 }, { easing: "linear(0, 1)" });
|
|
1295
|
+
} catch {
|
|
1296
|
+
return !1;
|
|
1297
|
+
}
|
|
1298
|
+
return !0;
|
|
1299
|
+
}, "linearEasing");
|
|
1300
|
+
function Yn(t) {
|
|
1301
|
+
return !!(typeof t == "function" && Te() || !t || typeof t == "string" && (t in Ze || Te()) || gt(t) || Array.isArray(t) && t.every(Yn));
|
|
1302
|
+
}
|
|
1303
|
+
const oe = ([t, e, n, s]) => `cubic-bezier(${t}, ${e}, ${n}, ${s})`, Ze = {
|
|
1304
|
+
linear: "linear",
|
|
1305
|
+
ease: "ease",
|
|
1306
|
+
easeIn: "ease-in",
|
|
1307
|
+
easeOut: "ease-out",
|
|
1308
|
+
easeInOut: "ease-in-out",
|
|
1309
|
+
circIn: /* @__PURE__ */ oe([0, 0.65, 0.55, 1]),
|
|
1310
|
+
circOut: /* @__PURE__ */ oe([0.55, 0, 1, 0.45]),
|
|
1311
|
+
backIn: /* @__PURE__ */ oe([0.31, 0.01, 0.66, -0.59]),
|
|
1312
|
+
backOut: /* @__PURE__ */ oe([0.33, 1.53, 0.69, 0.99])
|
|
1313
|
+
};
|
|
1314
|
+
function Xn(t, e) {
|
|
1315
|
+
if (t)
|
|
1316
|
+
return typeof t == "function" && Te() ? $n(t, e) : gt(t) ? oe(t) : Array.isArray(t) ? t.map((n) => Xn(n, e) || Ze.easeOut) : Ze[t];
|
|
1317
|
+
}
|
|
1318
|
+
function ur(t, e, n, { delay: s = 0, duration: i = 300, repeat: r = 0, repeatType: o = "loop", ease: a = "easeInOut", times: l } = {}) {
|
|
1319
|
+
const u = { [e]: n };
|
|
1320
|
+
l && (u.offset = l);
|
|
1321
|
+
const c = Xn(a, i);
|
|
1322
|
+
return Array.isArray(c) && (u.easing = c), t.animate(u, {
|
|
1323
|
+
delay: s,
|
|
1324
|
+
duration: i,
|
|
1325
|
+
easing: Array.isArray(c) ? "linear" : c,
|
|
1326
|
+
fill: "both",
|
|
1327
|
+
iterations: r + 1,
|
|
1328
|
+
direction: o === "reverse" ? "alternate" : "normal"
|
|
1329
|
+
});
|
|
1330
|
+
}
|
|
1331
|
+
function Yt(t, e) {
|
|
1332
|
+
t.timeline = e, t.onfinish = null;
|
|
1333
|
+
}
|
|
1334
|
+
const cr = /* @__PURE__ */ bt(() => Object.hasOwnProperty.call(Element.prototype, "animate")), Ve = 10, dr = 2e4;
|
|
1335
|
+
function fr(t) {
|
|
1336
|
+
return pt(t.type) || t.type === "spring" || !Yn(t.ease);
|
|
1337
|
+
}
|
|
1338
|
+
function hr(t, e) {
|
|
1339
|
+
const n = new vt({
|
|
1340
|
+
...e,
|
|
1341
|
+
keyframes: t,
|
|
1342
|
+
repeat: 0,
|
|
1343
|
+
delay: 0,
|
|
1344
|
+
isGenerator: !0
|
|
1345
|
+
});
|
|
1346
|
+
let s = { done: !1, value: t[0] };
|
|
1347
|
+
const i = [];
|
|
1348
|
+
let r = 0;
|
|
1349
|
+
for (; !s.done && r < dr; )
|
|
1350
|
+
s = n.sample(r), i.push(s.value), r += Ve;
|
|
1351
|
+
return {
|
|
1352
|
+
times: void 0,
|
|
1353
|
+
keyframes: i,
|
|
1354
|
+
duration: r - Ve,
|
|
1355
|
+
ease: "linear"
|
|
1356
|
+
};
|
|
1357
|
+
}
|
|
1358
|
+
const Zn = {
|
|
1359
|
+
anticipate: Vn,
|
|
1360
|
+
backInOut: Tn,
|
|
1361
|
+
circInOut: Sn
|
|
1362
|
+
};
|
|
1363
|
+
function pr(t) {
|
|
1364
|
+
return t in Zn;
|
|
1365
|
+
}
|
|
1366
|
+
class Xt extends _n {
|
|
1367
|
+
constructor(e) {
|
|
1368
|
+
super(e);
|
|
1369
|
+
const { name: n, motionValue: s, element: i, keyframes: r } = this.options;
|
|
1370
|
+
this.resolver = new Kn(r, (o, a) => this.onKeyframesResolved(o, a), n, s, i), this.resolver.scheduleResolve();
|
|
1371
|
+
}
|
|
1372
|
+
initPlayback(e, n) {
|
|
1373
|
+
var s;
|
|
1374
|
+
let { duration: i = 300, times: r, ease: o, type: a, motionValue: l, name: u, startTime: c } = this.options;
|
|
1375
|
+
if (!(!((s = l.owner) === null || s === void 0) && s.current))
|
|
1376
|
+
return !1;
|
|
1377
|
+
if (typeof o == "string" && Te() && pr(o) && (o = Zn[o]), fr(this.options)) {
|
|
1378
|
+
const { onComplete: d, onUpdate: h, motionValue: y, element: v, ...b } = this.options, p = hr(e, b);
|
|
1379
|
+
e = p.keyframes, e.length === 1 && (e[1] = e[0]), i = p.duration, r = p.times, o = p.ease, a = "keyframes";
|
|
1380
|
+
}
|
|
1381
|
+
const f = ur(l.owner.current, u, e, { ...this.options, duration: i, times: r, ease: o });
|
|
1382
|
+
return f.startTime = c ?? this.calcStartTime(), this.pendingTimeline ? (Yt(f, this.pendingTimeline), this.pendingTimeline = void 0) : f.onfinish = () => {
|
|
1383
|
+
const { onComplete: d } = this.options;
|
|
1384
|
+
l.set(Fe(e, this.options, n)), d && d(), this.cancel(), this.resolveFinishedPromise();
|
|
1385
|
+
}, {
|
|
1386
|
+
animation: f,
|
|
1387
|
+
duration: i,
|
|
1388
|
+
times: r,
|
|
1389
|
+
type: a,
|
|
1390
|
+
ease: o,
|
|
1391
|
+
keyframes: e
|
|
1392
|
+
};
|
|
1393
|
+
}
|
|
1394
|
+
get duration() {
|
|
1395
|
+
const { resolved: e } = this;
|
|
1396
|
+
if (!e)
|
|
1397
|
+
return 0;
|
|
1398
|
+
const { duration: n } = e;
|
|
1399
|
+
return B(n);
|
|
1400
|
+
}
|
|
1401
|
+
get time() {
|
|
1402
|
+
const { resolved: e } = this;
|
|
1403
|
+
if (!e)
|
|
1404
|
+
return 0;
|
|
1405
|
+
const { animation: n } = e;
|
|
1406
|
+
return B(n.currentTime || 0);
|
|
1407
|
+
}
|
|
1408
|
+
set time(e) {
|
|
1409
|
+
const { resolved: n } = this;
|
|
1410
|
+
if (!n)
|
|
1411
|
+
return;
|
|
1412
|
+
const { animation: s } = n;
|
|
1413
|
+
s.currentTime = L(e);
|
|
1414
|
+
}
|
|
1415
|
+
get speed() {
|
|
1416
|
+
const { resolved: e } = this;
|
|
1417
|
+
if (!e)
|
|
1418
|
+
return 1;
|
|
1419
|
+
const { animation: n } = e;
|
|
1420
|
+
return n.playbackRate;
|
|
1421
|
+
}
|
|
1422
|
+
set speed(e) {
|
|
1423
|
+
const { resolved: n } = this;
|
|
1424
|
+
if (!n)
|
|
1425
|
+
return;
|
|
1426
|
+
const { animation: s } = n;
|
|
1427
|
+
s.playbackRate = e;
|
|
1428
|
+
}
|
|
1429
|
+
get state() {
|
|
1430
|
+
const { resolved: e } = this;
|
|
1431
|
+
if (!e)
|
|
1432
|
+
return "idle";
|
|
1433
|
+
const { animation: n } = e;
|
|
1434
|
+
return n.playState;
|
|
1435
|
+
}
|
|
1436
|
+
get startTime() {
|
|
1437
|
+
const { resolved: e } = this;
|
|
1438
|
+
if (!e)
|
|
1439
|
+
return null;
|
|
1440
|
+
const { animation: n } = e;
|
|
1441
|
+
return n.startTime;
|
|
1442
|
+
}
|
|
1443
|
+
/**
|
|
1444
|
+
* Replace the default DocumentTimeline with another AnimationTimeline.
|
|
1445
|
+
* Currently used for scroll animations.
|
|
1446
|
+
*/
|
|
1447
|
+
attachTimeline(e) {
|
|
1448
|
+
if (!this._resolved)
|
|
1449
|
+
this.pendingTimeline = e;
|
|
1450
|
+
else {
|
|
1451
|
+
const { resolved: n } = this;
|
|
1452
|
+
if (!n)
|
|
1453
|
+
return _;
|
|
1454
|
+
const { animation: s } = n;
|
|
1455
|
+
Yt(s, e);
|
|
1456
|
+
}
|
|
1457
|
+
return _;
|
|
1458
|
+
}
|
|
1459
|
+
play() {
|
|
1460
|
+
if (this.isStopped)
|
|
1461
|
+
return;
|
|
1462
|
+
const { resolved: e } = this;
|
|
1463
|
+
if (!e)
|
|
1464
|
+
return;
|
|
1465
|
+
const { animation: n } = e;
|
|
1466
|
+
n.playState === "finished" && this.updateFinishedPromise(), n.play();
|
|
1467
|
+
}
|
|
1468
|
+
pause() {
|
|
1469
|
+
const { resolved: e } = this;
|
|
1470
|
+
if (!e)
|
|
1471
|
+
return;
|
|
1472
|
+
const { animation: n } = e;
|
|
1473
|
+
n.pause();
|
|
1474
|
+
}
|
|
1475
|
+
stop() {
|
|
1476
|
+
if (this.resolver.cancel(), this.isStopped = !0, this.state === "idle")
|
|
1477
|
+
return;
|
|
1478
|
+
this.resolveFinishedPromise(), this.updateFinishedPromise();
|
|
1479
|
+
const { resolved: e } = this;
|
|
1480
|
+
if (!e)
|
|
1481
|
+
return;
|
|
1482
|
+
const { animation: n, keyframes: s, duration: i, type: r, ease: o, times: a } = e;
|
|
1483
|
+
if (n.playState === "idle" || n.playState === "finished")
|
|
1484
|
+
return;
|
|
1485
|
+
if (this.time) {
|
|
1486
|
+
const { motionValue: u, onUpdate: c, onComplete: f, element: d, ...h } = this.options, y = new vt({
|
|
1487
|
+
...h,
|
|
1488
|
+
keyframes: s,
|
|
1489
|
+
duration: i,
|
|
1490
|
+
type: r,
|
|
1491
|
+
ease: o,
|
|
1492
|
+
times: a,
|
|
1493
|
+
isGenerator: !0
|
|
1494
|
+
}), v = L(this.time);
|
|
1495
|
+
u.setWithVelocity(y.sample(v - Ve).value, y.sample(v).value, Ve);
|
|
1496
|
+
}
|
|
1497
|
+
const { onStop: l } = this.options;
|
|
1498
|
+
l && l(), this.cancel();
|
|
1499
|
+
}
|
|
1500
|
+
complete() {
|
|
1501
|
+
const { resolved: e } = this;
|
|
1502
|
+
e && e.animation.finish();
|
|
1503
|
+
}
|
|
1504
|
+
cancel() {
|
|
1505
|
+
const { resolved: e } = this;
|
|
1506
|
+
e && e.animation.cancel();
|
|
1507
|
+
}
|
|
1508
|
+
static supports(e) {
|
|
1509
|
+
const { motionValue: n, name: s, repeatDelay: i, repeatType: r, damping: o, type: a } = e;
|
|
1510
|
+
return cr() && s && or.has(s) && n && n.owner && n.owner.current instanceof HTMLElement && /**
|
|
1511
|
+
* If we're outputting values to onUpdate then we can't use WAAPI as there's
|
|
1512
|
+
* no way to read the value from WAAPI every frame.
|
|
1513
|
+
*/
|
|
1514
|
+
!n.owner.getProps().onUpdate && !i && r !== "mirror" && o !== 0 && a !== "inertia";
|
|
1515
|
+
}
|
|
1516
|
+
}
|
|
1517
|
+
const mr = bt(() => window.ScrollTimeline !== void 0);
|
|
1518
|
+
class gr {
|
|
1519
|
+
constructor(e) {
|
|
1520
|
+
this.stop = () => this.runAll("stop"), this.animations = e.filter(Boolean);
|
|
1521
|
+
}
|
|
1522
|
+
then(e, n) {
|
|
1523
|
+
return Promise.all(this.animations).then(e).catch(n);
|
|
1524
|
+
}
|
|
1525
|
+
/**
|
|
1526
|
+
* TODO: Filter out cancelled or stopped animations before returning
|
|
1527
|
+
*/
|
|
1528
|
+
getAll(e) {
|
|
1529
|
+
return this.animations[0][e];
|
|
1530
|
+
}
|
|
1531
|
+
setAll(e, n) {
|
|
1532
|
+
for (let s = 0; s < this.animations.length; s++)
|
|
1533
|
+
this.animations[s][e] = n;
|
|
1534
|
+
}
|
|
1535
|
+
attachTimeline(e, n) {
|
|
1536
|
+
const s = this.animations.map((i) => mr() && i.attachTimeline ? i.attachTimeline(e) : n(i));
|
|
1537
|
+
return () => {
|
|
1538
|
+
s.forEach((i, r) => {
|
|
1539
|
+
i && i(), this.animations[r].stop();
|
|
1540
|
+
});
|
|
1541
|
+
};
|
|
1542
|
+
}
|
|
1543
|
+
get time() {
|
|
1544
|
+
return this.getAll("time");
|
|
1545
|
+
}
|
|
1546
|
+
set time(e) {
|
|
1547
|
+
this.setAll("time", e);
|
|
1548
|
+
}
|
|
1549
|
+
get speed() {
|
|
1550
|
+
return this.getAll("speed");
|
|
1551
|
+
}
|
|
1552
|
+
set speed(e) {
|
|
1553
|
+
this.setAll("speed", e);
|
|
1554
|
+
}
|
|
1555
|
+
get startTime() {
|
|
1556
|
+
return this.getAll("startTime");
|
|
1557
|
+
}
|
|
1558
|
+
get duration() {
|
|
1559
|
+
let e = 0;
|
|
1560
|
+
for (let n = 0; n < this.animations.length; n++)
|
|
1561
|
+
e = Math.max(e, this.animations[n].duration);
|
|
1562
|
+
return e;
|
|
1563
|
+
}
|
|
1564
|
+
runAll(e) {
|
|
1565
|
+
this.animations.forEach((n) => n[e]());
|
|
1566
|
+
}
|
|
1567
|
+
flatten() {
|
|
1568
|
+
this.runAll("flatten");
|
|
1569
|
+
}
|
|
1570
|
+
play() {
|
|
1571
|
+
this.runAll("play");
|
|
1572
|
+
}
|
|
1573
|
+
pause() {
|
|
1574
|
+
this.runAll("pause");
|
|
1575
|
+
}
|
|
1576
|
+
cancel() {
|
|
1577
|
+
this.runAll("cancel");
|
|
1578
|
+
}
|
|
1579
|
+
complete() {
|
|
1580
|
+
this.runAll("complete");
|
|
1581
|
+
}
|
|
1582
|
+
}
|
|
1583
|
+
function yr({ when: t, delay: e, delayChildren: n, staggerChildren: s, staggerDirection: i, repeat: r, repeatType: o, repeatDelay: a, from: l, elapsed: u, ...c }) {
|
|
1584
|
+
return !!Object.keys(c).length;
|
|
1585
|
+
}
|
|
1586
|
+
const vr = (t, e, n, s = {}, i, r) => (o) => {
|
|
1587
|
+
const a = mn(s, t) || {}, l = a.delay || s.delay || 0;
|
|
1588
|
+
let { elapsed: u = 0 } = s;
|
|
1589
|
+
u = u - L(l);
|
|
1590
|
+
let c = {
|
|
1591
|
+
keyframes: Array.isArray(n) ? n : [null, n],
|
|
1592
|
+
ease: "easeOut",
|
|
1593
|
+
velocity: e.getVelocity(),
|
|
1594
|
+
...a,
|
|
1595
|
+
delay: -u,
|
|
1596
|
+
onUpdate: (d) => {
|
|
1597
|
+
e.set(d), a.onUpdate && a.onUpdate(d);
|
|
1598
|
+
},
|
|
1599
|
+
onComplete: () => {
|
|
1600
|
+
o(), a.onComplete && a.onComplete();
|
|
1601
|
+
},
|
|
1602
|
+
name: t,
|
|
1603
|
+
motionValue: e,
|
|
1604
|
+
element: r ? void 0 : i
|
|
1605
|
+
};
|
|
1606
|
+
yr(a) || (c = {
|
|
1607
|
+
...c,
|
|
1608
|
+
..._s(t, c)
|
|
1609
|
+
}), c.duration && (c.duration = L(c.duration)), c.repeatDelay && (c.repeatDelay = L(c.repeatDelay)), c.from !== void 0 && (c.keyframes[0] = c.from);
|
|
1610
|
+
let f = !1;
|
|
1611
|
+
if ((c.type === !1 || c.duration === 0 && !c.repeatDelay) && (c.duration = 0, c.delay === 0 && (f = !0)), f && !r && e.get() !== void 0) {
|
|
1612
|
+
const d = Fe(c.keyframes, a);
|
|
1613
|
+
if (d !== void 0)
|
|
1614
|
+
return R.update(() => {
|
|
1615
|
+
c.onUpdate(d), c.onComplete();
|
|
1616
|
+
}), new gr([]);
|
|
1617
|
+
}
|
|
1618
|
+
return !r && Xt.supports(c) ? new Xt(c) : new vt(c);
|
|
1619
|
+
}, br = (t) => !!(t && typeof t == "object" && t.mix && t.toValue), wr = (t) => je(t) ? t[t.length - 1] || 0 : t;
|
|
1620
|
+
function Tr(t, e) {
|
|
1621
|
+
t.indexOf(e) === -1 && t.push(e);
|
|
1622
|
+
}
|
|
1623
|
+
function Vr(t, e) {
|
|
1624
|
+
const n = t.indexOf(e);
|
|
1625
|
+
n > -1 && t.splice(n, 1);
|
|
1626
|
+
}
|
|
1627
|
+
class Jn {
|
|
1628
|
+
constructor() {
|
|
1629
|
+
this.subscriptions = [];
|
|
1630
|
+
}
|
|
1631
|
+
add(e) {
|
|
1632
|
+
return Tr(this.subscriptions, e), () => Vr(this.subscriptions, e);
|
|
1633
|
+
}
|
|
1634
|
+
notify(e, n, s) {
|
|
1635
|
+
const i = this.subscriptions.length;
|
|
1636
|
+
if (i)
|
|
1637
|
+
if (i === 1)
|
|
1638
|
+
this.subscriptions[0](e, n, s);
|
|
1639
|
+
else
|
|
1640
|
+
for (let r = 0; r < i; r++) {
|
|
1641
|
+
const o = this.subscriptions[r];
|
|
1642
|
+
o && o(e, n, s);
|
|
1643
|
+
}
|
|
1644
|
+
}
|
|
1645
|
+
getSize() {
|
|
1646
|
+
return this.subscriptions.length;
|
|
1647
|
+
}
|
|
1648
|
+
clear() {
|
|
1649
|
+
this.subscriptions.length = 0;
|
|
1650
|
+
}
|
|
1651
|
+
}
|
|
1652
|
+
const Zt = 30, Sr = (t) => !isNaN(parseFloat(t));
|
|
1653
|
+
class xr {
|
|
1654
|
+
/**
|
|
1655
|
+
* @param init - The initiating value
|
|
1656
|
+
* @param config - Optional configuration options
|
|
1657
|
+
*
|
|
1658
|
+
* - `transformer`: A function to transform incoming values with.
|
|
1659
|
+
*
|
|
1660
|
+
* @internal
|
|
1661
|
+
*/
|
|
1662
|
+
constructor(e, n = {}) {
|
|
1663
|
+
this.version = "11.15.0", this.canTrackVelocity = null, this.events = {}, this.updateAndNotify = (s, i = !0) => {
|
|
1664
|
+
const r = K.now();
|
|
1665
|
+
this.updatedAt !== r && this.setPrevFrameValue(), this.prev = this.current, this.setCurrent(s), this.current !== this.prev && this.events.change && this.events.change.notify(this.current), i && this.events.renderRequest && this.events.renderRequest.notify(this.current);
|
|
1666
|
+
}, this.hasAnimated = !1, this.setCurrent(e), this.owner = n.owner;
|
|
1667
|
+
}
|
|
1668
|
+
setCurrent(e) {
|
|
1669
|
+
this.current = e, this.updatedAt = K.now(), this.canTrackVelocity === null && e !== void 0 && (this.canTrackVelocity = Sr(this.current));
|
|
1670
|
+
}
|
|
1671
|
+
setPrevFrameValue(e = this.current) {
|
|
1672
|
+
this.prevFrameValue = e, this.prevUpdatedAt = this.updatedAt;
|
|
1673
|
+
}
|
|
1674
|
+
/**
|
|
1675
|
+
* Adds a function that will be notified when the `MotionValue` is updated.
|
|
1676
|
+
*
|
|
1677
|
+
* It returns a function that, when called, will cancel the subscription.
|
|
1678
|
+
*
|
|
1679
|
+
* When calling `onChange` inside a React component, it should be wrapped with the
|
|
1680
|
+
* `useEffect` hook. As it returns an unsubscribe function, this should be returned
|
|
1681
|
+
* from the `useEffect` function to ensure you don't add duplicate subscribers..
|
|
1682
|
+
*
|
|
1683
|
+
* ```jsx
|
|
1684
|
+
* export const MyComponent = () => {
|
|
1685
|
+
* const x = useMotionValue(0)
|
|
1686
|
+
* const y = useMotionValue(0)
|
|
1687
|
+
* const opacity = useMotionValue(1)
|
|
1688
|
+
*
|
|
1689
|
+
* useEffect(() => {
|
|
1690
|
+
* function updateOpacity() {
|
|
1691
|
+
* const maxXY = Math.max(x.get(), y.get())
|
|
1692
|
+
* const newOpacity = transform(maxXY, [0, 100], [1, 0])
|
|
1693
|
+
* opacity.set(newOpacity)
|
|
1694
|
+
* }
|
|
1695
|
+
*
|
|
1696
|
+
* const unsubscribeX = x.on("change", updateOpacity)
|
|
1697
|
+
* const unsubscribeY = y.on("change", updateOpacity)
|
|
1698
|
+
*
|
|
1699
|
+
* return () => {
|
|
1700
|
+
* unsubscribeX()
|
|
1701
|
+
* unsubscribeY()
|
|
1702
|
+
* }
|
|
1703
|
+
* }, [])
|
|
1704
|
+
*
|
|
1705
|
+
* return <motion.div style={{ x }} />
|
|
1706
|
+
* }
|
|
1707
|
+
* ```
|
|
1708
|
+
*
|
|
1709
|
+
* @param subscriber - A function that receives the latest value.
|
|
1710
|
+
* @returns A function that, when called, will cancel this subscription.
|
|
1711
|
+
*
|
|
1712
|
+
* @deprecated
|
|
1713
|
+
*/
|
|
1714
|
+
onChange(e) {
|
|
1715
|
+
return process.env.NODE_ENV !== "production" && Me(!1, 'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'), this.on("change", e);
|
|
1716
|
+
}
|
|
1717
|
+
on(e, n) {
|
|
1718
|
+
this.events[e] || (this.events[e] = new Jn());
|
|
1719
|
+
const s = this.events[e].add(n);
|
|
1720
|
+
return e === "change" ? () => {
|
|
1721
|
+
s(), R.read(() => {
|
|
1722
|
+
this.events.change.getSize() || this.stop();
|
|
1723
|
+
});
|
|
1724
|
+
} : s;
|
|
1725
|
+
}
|
|
1726
|
+
clearListeners() {
|
|
1727
|
+
for (const e in this.events)
|
|
1728
|
+
this.events[e].clear();
|
|
1729
|
+
}
|
|
1730
|
+
/**
|
|
1731
|
+
* Attaches a passive effect to the `MotionValue`.
|
|
1732
|
+
*
|
|
1733
|
+
* @internal
|
|
1734
|
+
*/
|
|
1735
|
+
attach(e, n) {
|
|
1736
|
+
this.passiveEffect = e, this.stopPassiveEffect = n;
|
|
1737
|
+
}
|
|
1738
|
+
/**
|
|
1739
|
+
* Sets the state of the `MotionValue`.
|
|
1740
|
+
*
|
|
1741
|
+
* @remarks
|
|
1742
|
+
*
|
|
1743
|
+
* ```jsx
|
|
1744
|
+
* const x = useMotionValue(0)
|
|
1745
|
+
* x.set(10)
|
|
1746
|
+
* ```
|
|
1747
|
+
*
|
|
1748
|
+
* @param latest - Latest value to set.
|
|
1749
|
+
* @param render - Whether to notify render subscribers. Defaults to `true`
|
|
1750
|
+
*
|
|
1751
|
+
* @public
|
|
1752
|
+
*/
|
|
1753
|
+
set(e, n = !0) {
|
|
1754
|
+
!n || !this.passiveEffect ? this.updateAndNotify(e, n) : this.passiveEffect(e, this.updateAndNotify);
|
|
1755
|
+
}
|
|
1756
|
+
setWithVelocity(e, n, s) {
|
|
1757
|
+
this.set(n), this.prev = void 0, this.prevFrameValue = e, this.prevUpdatedAt = this.updatedAt - s;
|
|
1758
|
+
}
|
|
1759
|
+
/**
|
|
1760
|
+
* Set the state of the `MotionValue`, stopping any active animations,
|
|
1761
|
+
* effects, and resets velocity to `0`.
|
|
1762
|
+
*/
|
|
1763
|
+
jump(e, n = !0) {
|
|
1764
|
+
this.updateAndNotify(e), this.prev = e, this.prevUpdatedAt = this.prevFrameValue = void 0, n && this.stop(), this.stopPassiveEffect && this.stopPassiveEffect();
|
|
1765
|
+
}
|
|
1766
|
+
/**
|
|
1767
|
+
* Returns the latest state of `MotionValue`
|
|
1768
|
+
*
|
|
1769
|
+
* @returns - The latest state of `MotionValue`
|
|
1770
|
+
*
|
|
1771
|
+
* @public
|
|
1772
|
+
*/
|
|
1773
|
+
get() {
|
|
1774
|
+
return this.current;
|
|
1775
|
+
}
|
|
1776
|
+
/**
|
|
1777
|
+
* @public
|
|
1778
|
+
*/
|
|
1779
|
+
getPrevious() {
|
|
1780
|
+
return this.prev;
|
|
1781
|
+
}
|
|
1782
|
+
/**
|
|
1783
|
+
* Returns the latest velocity of `MotionValue`
|
|
1784
|
+
*
|
|
1785
|
+
* @returns - The latest velocity of `MotionValue`. Returns `0` if the state is non-numerical.
|
|
1786
|
+
*
|
|
1787
|
+
* @public
|
|
1788
|
+
*/
|
|
1789
|
+
getVelocity() {
|
|
1790
|
+
const e = K.now();
|
|
1791
|
+
if (!this.canTrackVelocity || this.prevFrameValue === void 0 || e - this.updatedAt > Zt)
|
|
1792
|
+
return 0;
|
|
1793
|
+
const n = Math.min(this.updatedAt - this.prevUpdatedAt, Zt);
|
|
1794
|
+
return jn(parseFloat(this.current) - parseFloat(this.prevFrameValue), n);
|
|
1795
|
+
}
|
|
1796
|
+
/**
|
|
1797
|
+
* Registers a new animation to control this `MotionValue`. Only one
|
|
1798
|
+
* animation can drive a `MotionValue` at one time.
|
|
1799
|
+
*
|
|
1800
|
+
* ```jsx
|
|
1801
|
+
* value.start()
|
|
1802
|
+
* ```
|
|
1803
|
+
*
|
|
1804
|
+
* @param animation - A function that starts the provided animation
|
|
1805
|
+
*
|
|
1806
|
+
* @internal
|
|
1807
|
+
*/
|
|
1808
|
+
start(e) {
|
|
1809
|
+
return this.stop(), new Promise((n) => {
|
|
1810
|
+
this.hasAnimated = !0, this.animation = e(n), this.events.animationStart && this.events.animationStart.notify();
|
|
1811
|
+
}).then(() => {
|
|
1812
|
+
this.events.animationComplete && this.events.animationComplete.notify(), this.clearAnimation();
|
|
1813
|
+
});
|
|
1814
|
+
}
|
|
1815
|
+
/**
|
|
1816
|
+
* Stop the currently active animation.
|
|
1817
|
+
*
|
|
1818
|
+
* @public
|
|
1819
|
+
*/
|
|
1820
|
+
stop() {
|
|
1821
|
+
this.animation && (this.animation.stop(), this.events.animationCancel && this.events.animationCancel.notify()), this.clearAnimation();
|
|
1822
|
+
}
|
|
1823
|
+
/**
|
|
1824
|
+
* Returns `true` if this value is currently animating.
|
|
1825
|
+
*
|
|
1826
|
+
* @public
|
|
1827
|
+
*/
|
|
1828
|
+
isAnimating() {
|
|
1829
|
+
return !!this.animation;
|
|
1830
|
+
}
|
|
1831
|
+
clearAnimation() {
|
|
1832
|
+
delete this.animation;
|
|
1833
|
+
}
|
|
1834
|
+
/**
|
|
1835
|
+
* Destroy and clean up subscribers to this `MotionValue`.
|
|
1836
|
+
*
|
|
1837
|
+
* The `MotionValue` hooks like `useMotionValue` and `useTransform` automatically
|
|
1838
|
+
* handle the lifecycle of the returned `MotionValue`, so this method is only necessary if you've manually
|
|
1839
|
+
* created a `MotionValue` via the `motionValue` function.
|
|
1840
|
+
*
|
|
1841
|
+
* @public
|
|
1842
|
+
*/
|
|
1843
|
+
destroy() {
|
|
1844
|
+
this.clearListeners(), this.stop(), this.stopPassiveEffect && this.stopPassiveEffect();
|
|
1845
|
+
}
|
|
1846
|
+
}
|
|
1847
|
+
function Se(t, e) {
|
|
1848
|
+
return new xr(t, e);
|
|
1849
|
+
}
|
|
1850
|
+
function Ar(t, e, n) {
|
|
1851
|
+
t.hasValue(e) ? t.getValue(e).set(n) : t.addValue(e, Se(n));
|
|
1852
|
+
}
|
|
1853
|
+
function Mr(t, e) {
|
|
1854
|
+
const n = Pe(t, e);
|
|
1855
|
+
let { transitionEnd: s = {}, transition: i = {}, ...r } = n || {};
|
|
1856
|
+
r = { ...r, ...s };
|
|
1857
|
+
for (const o in r) {
|
|
1858
|
+
const a = wr(r[o]);
|
|
1859
|
+
Ar(t, o, a);
|
|
1860
|
+
}
|
|
1861
|
+
}
|
|
1862
|
+
const wt = (t) => t.replace(/([a-z])([A-Z])/gu, "$1-$2").toLowerCase(), Cr = "framerAppearId", Qn = "data-" + wt(Cr);
|
|
1863
|
+
function Pr(t) {
|
|
1864
|
+
return t.props[Qn];
|
|
1865
|
+
}
|
|
1866
|
+
const F = (t) => !!(t && t.getVelocity);
|
|
1867
|
+
function Fr(t) {
|
|
1868
|
+
return !!(F(t) && t.add);
|
|
1869
|
+
}
|
|
1870
|
+
function Dr(t, e) {
|
|
1871
|
+
const n = t.getValue("willChange");
|
|
1872
|
+
if (Fr(n))
|
|
1873
|
+
return n.add(e);
|
|
1874
|
+
}
|
|
1875
|
+
function Rr({ protectedKeys: t, needsAnimating: e }, n) {
|
|
1876
|
+
const s = t.hasOwnProperty(n) && e[n] !== !0;
|
|
1877
|
+
return e[n] = !1, s;
|
|
1878
|
+
}
|
|
1879
|
+
function es(t, e, { delay: n = 0, transitionOverride: s, type: i } = {}) {
|
|
1880
|
+
var r;
|
|
1881
|
+
let { transition: o = t.getDefaultTransition(), transitionEnd: a, ...l } = e;
|
|
1882
|
+
s && (o = s);
|
|
1883
|
+
const u = [], c = i && t.animationState && t.animationState.getState()[i];
|
|
1884
|
+
for (const f in l) {
|
|
1885
|
+
const d = t.getValue(f, (r = t.latestValues[f]) !== null && r !== void 0 ? r : null), h = l[f];
|
|
1886
|
+
if (h === void 0 || c && Rr(c, f))
|
|
1887
|
+
continue;
|
|
1888
|
+
const y = {
|
|
1889
|
+
delay: n,
|
|
1890
|
+
...mn(o || {}, f)
|
|
1891
|
+
};
|
|
1892
|
+
let v = !1;
|
|
1893
|
+
if (window.MotionHandoffAnimation) {
|
|
1894
|
+
const p = Pr(t);
|
|
1895
|
+
if (p) {
|
|
1896
|
+
const g = window.MotionHandoffAnimation(p, f, R);
|
|
1897
|
+
g !== null && (y.startTime = g, v = !0);
|
|
1898
|
+
}
|
|
1899
|
+
}
|
|
1900
|
+
Dr(t, f), d.start(vr(f, d, h, t.shouldReduceMotion && z.has(f) ? { type: !1 } : y, t, v));
|
|
1901
|
+
const b = d.animation;
|
|
1902
|
+
b && u.push(b);
|
|
1903
|
+
}
|
|
1904
|
+
return a && Promise.all(u).then(() => {
|
|
1905
|
+
R.update(() => {
|
|
1906
|
+
a && Mr(t, a);
|
|
1907
|
+
});
|
|
1908
|
+
}), u;
|
|
1909
|
+
}
|
|
1910
|
+
function Je(t, e, n = {}) {
|
|
1911
|
+
var s;
|
|
1912
|
+
const i = Pe(t, e, n.type === "exit" ? (s = t.presenceContext) === null || s === void 0 ? void 0 : s.custom : void 0);
|
|
1913
|
+
let { transition: r = t.getDefaultTransition() || {} } = i || {};
|
|
1914
|
+
n.transitionOverride && (r = n.transitionOverride);
|
|
1915
|
+
const o = i ? () => Promise.all(es(t, i, n)) : () => Promise.resolve(), a = t.variantChildren && t.variantChildren.size ? (u = 0) => {
|
|
1916
|
+
const { delayChildren: c = 0, staggerChildren: f, staggerDirection: d } = r;
|
|
1917
|
+
return Ir(t, e, c + u, f, d, n);
|
|
1918
|
+
} : () => Promise.resolve(), { when: l } = r;
|
|
1919
|
+
if (l) {
|
|
1920
|
+
const [u, c] = l === "beforeChildren" ? [o, a] : [a, o];
|
|
1921
|
+
return u().then(() => c());
|
|
1922
|
+
} else
|
|
1923
|
+
return Promise.all([o(), a(n.delay)]);
|
|
1924
|
+
}
|
|
1925
|
+
function Ir(t, e, n = 0, s = 0, i = 1, r) {
|
|
1926
|
+
const o = [], a = (t.variantChildren.size - 1) * s, l = i === 1 ? (u = 0) => u * s : (u = 0) => a - u * s;
|
|
1927
|
+
return Array.from(t.variantChildren).sort(Or).forEach((u, c) => {
|
|
1928
|
+
u.notify("AnimationStart", e), o.push(Je(u, e, {
|
|
1929
|
+
...r,
|
|
1930
|
+
delay: n + l(c)
|
|
1931
|
+
}).then(() => u.notify("AnimationComplete", e)));
|
|
1932
|
+
}), Promise.all(o);
|
|
1933
|
+
}
|
|
1934
|
+
function Or(t, e) {
|
|
1935
|
+
return t.sortNodePosition(e);
|
|
1936
|
+
}
|
|
1937
|
+
function Er(t, e, n = {}) {
|
|
1938
|
+
t.notify("AnimationStart", e);
|
|
1939
|
+
let s;
|
|
1940
|
+
if (Array.isArray(e)) {
|
|
1941
|
+
const i = e.map((r) => Je(t, r, n));
|
|
1942
|
+
s = Promise.all(i);
|
|
1943
|
+
} else if (typeof e == "string")
|
|
1944
|
+
s = Je(t, e, n);
|
|
1945
|
+
else {
|
|
1946
|
+
const i = typeof e == "function" ? Pe(t, e, n.custom) : e;
|
|
1947
|
+
s = Promise.all(es(t, i, n));
|
|
1948
|
+
}
|
|
1949
|
+
return s.then(() => {
|
|
1950
|
+
t.notify("AnimationComplete", e);
|
|
1951
|
+
});
|
|
1952
|
+
}
|
|
1953
|
+
const kr = rt.length;
|
|
1954
|
+
function ts(t) {
|
|
1955
|
+
if (!t)
|
|
1956
|
+
return;
|
|
1957
|
+
if (!t.isControllingVariants) {
|
|
1958
|
+
const n = t.parent ? ts(t.parent) || {} : {};
|
|
1959
|
+
return t.props.initial !== void 0 && (n.initial = t.props.initial), n;
|
|
1960
|
+
}
|
|
1961
|
+
const e = {};
|
|
1962
|
+
for (let n = 0; n < kr; n++) {
|
|
1963
|
+
const s = rt[n], i = t.props[s];
|
|
1964
|
+
(ue(i) || i === !1) && (e[s] = i);
|
|
1965
|
+
}
|
|
1966
|
+
return e;
|
|
1967
|
+
}
|
|
1968
|
+
const Lr = [...it].reverse(), Nr = it.length;
|
|
1969
|
+
function Br(t) {
|
|
1970
|
+
return (e) => Promise.all(e.map(({ animation: n, options: s }) => Er(t, n, s)));
|
|
1971
|
+
}
|
|
1972
|
+
function Kr(t) {
|
|
1973
|
+
let e = Br(t), n = Jt(), s = !0;
|
|
1974
|
+
const i = (l) => (u, c) => {
|
|
1975
|
+
var f;
|
|
1976
|
+
const d = Pe(t, c, l === "exit" ? (f = t.presenceContext) === null || f === void 0 ? void 0 : f.custom : void 0);
|
|
1977
|
+
if (d) {
|
|
1978
|
+
const { transition: h, transitionEnd: y, ...v } = d;
|
|
1979
|
+
u = { ...u, ...v, ...y };
|
|
1980
|
+
}
|
|
1981
|
+
return u;
|
|
1982
|
+
};
|
|
1983
|
+
function r(l) {
|
|
1984
|
+
e = l(t);
|
|
1985
|
+
}
|
|
1986
|
+
function o(l) {
|
|
1987
|
+
const { props: u } = t, c = ts(t.parent) || {}, f = [], d = /* @__PURE__ */ new Set();
|
|
1988
|
+
let h = {}, y = 1 / 0;
|
|
1989
|
+
for (let b = 0; b < Nr; b++) {
|
|
1990
|
+
const p = Lr[b], g = n[p], V = u[p] !== void 0 ? u[p] : c[p], A = ue(V), w = p === l ? g.isActive : null;
|
|
1991
|
+
w === !1 && (y = b);
|
|
1992
|
+
let S = V === c[p] && V !== u[p] && A;
|
|
1993
|
+
if (S && s && t.manuallyAnimateOnMount && (S = !1), g.protectedKeys = { ...h }, // If it isn't active and hasn't *just* been set as inactive
|
|
1994
|
+
!g.isActive && w === null || // If we didn't and don't have any defined prop for this animation type
|
|
1995
|
+
!V && !g.prevProp || // Or if the prop doesn't define an animation
|
|
1996
|
+
Ce(V) || typeof V == "boolean")
|
|
1997
|
+
continue;
|
|
1998
|
+
const M = _r(g.prevProp, V);
|
|
1999
|
+
let T = M || // If we're making this variant active, we want to always make it active
|
|
2000
|
+
p === l && g.isActive && !S && A || // If we removed a higher-priority variant (i is in reverse order)
|
|
2001
|
+
b > y && A, D = !1;
|
|
2002
|
+
const I = Array.isArray(V) ? V : [V];
|
|
2003
|
+
let H = I.reduce(i(p), {});
|
|
2004
|
+
w === !1 && (H = {});
|
|
2005
|
+
const { prevResolvedValues: Ft = {} } = g, Ss = {
|
|
2006
|
+
...Ft,
|
|
2007
|
+
...H
|
|
2008
|
+
}, Dt = (P) => {
|
|
2009
|
+
T = !0, d.has(P) && (D = !0, d.delete(P)), g.needsAnimating[P] = !0;
|
|
2010
|
+
const k = t.getValue(P);
|
|
2011
|
+
k && (k.liveStyle = !1);
|
|
2012
|
+
};
|
|
2013
|
+
for (const P in Ss) {
|
|
2014
|
+
const k = H[P], Ee = Ft[P];
|
|
2015
|
+
if (h.hasOwnProperty(P))
|
|
2016
|
+
continue;
|
|
2017
|
+
let ke = !1;
|
|
2018
|
+
je(k) && je(Ee) ? ke = !pn(k, Ee) : ke = k !== Ee, ke ? k != null ? Dt(P) : d.add(P) : k !== void 0 && d.has(P) ? Dt(P) : g.protectedKeys[P] = !0;
|
|
2019
|
+
}
|
|
2020
|
+
g.prevProp = V, g.prevResolvedValues = H, g.isActive && (h = { ...h, ...H }), s && t.blockInitialAnimation && (T = !1), T && (!(S && M) || D) && f.push(...I.map((P) => ({
|
|
2021
|
+
animation: P,
|
|
2022
|
+
options: { type: p }
|
|
2023
|
+
})));
|
|
2024
|
+
}
|
|
2025
|
+
if (d.size) {
|
|
2026
|
+
const b = {};
|
|
2027
|
+
d.forEach((p) => {
|
|
2028
|
+
const g = t.getBaseTarget(p), V = t.getValue(p);
|
|
2029
|
+
V && (V.liveStyle = !0), b[p] = g ?? null;
|
|
2030
|
+
}), f.push({ animation: b });
|
|
2031
|
+
}
|
|
2032
|
+
let v = !!f.length;
|
|
2033
|
+
return s && (u.initial === !1 || u.initial === u.animate) && !t.manuallyAnimateOnMount && (v = !1), s = !1, v ? e(f) : Promise.resolve();
|
|
2034
|
+
}
|
|
2035
|
+
function a(l, u) {
|
|
2036
|
+
var c;
|
|
2037
|
+
if (n[l].isActive === u)
|
|
2038
|
+
return Promise.resolve();
|
|
2039
|
+
(c = t.variantChildren) === null || c === void 0 || c.forEach((d) => {
|
|
2040
|
+
var h;
|
|
2041
|
+
return (h = d.animationState) === null || h === void 0 ? void 0 : h.setActive(l, u);
|
|
2042
|
+
}), n[l].isActive = u;
|
|
2043
|
+
const f = o(l);
|
|
2044
|
+
for (const d in n)
|
|
2045
|
+
n[d].protectedKeys = {};
|
|
2046
|
+
return f;
|
|
2047
|
+
}
|
|
2048
|
+
return {
|
|
2049
|
+
animateChanges: o,
|
|
2050
|
+
setActive: a,
|
|
2051
|
+
setAnimateFunction: r,
|
|
2052
|
+
getState: () => n,
|
|
2053
|
+
reset: () => {
|
|
2054
|
+
n = Jt(), s = !0;
|
|
2055
|
+
}
|
|
2056
|
+
};
|
|
2057
|
+
}
|
|
2058
|
+
function _r(t, e) {
|
|
2059
|
+
return typeof e == "string" ? e !== t : Array.isArray(e) ? !pn(e, t) : !1;
|
|
2060
|
+
}
|
|
2061
|
+
function $(t = !1) {
|
|
2062
|
+
return {
|
|
2063
|
+
isActive: t,
|
|
2064
|
+
protectedKeys: {},
|
|
2065
|
+
needsAnimating: {},
|
|
2066
|
+
prevResolvedValues: {}
|
|
2067
|
+
};
|
|
2068
|
+
}
|
|
2069
|
+
function Jt() {
|
|
2070
|
+
return {
|
|
2071
|
+
animate: $(!0),
|
|
2072
|
+
whileInView: $(),
|
|
2073
|
+
whileHover: $(),
|
|
2074
|
+
whileTap: $(),
|
|
2075
|
+
whileDrag: $(),
|
|
2076
|
+
whileFocus: $(),
|
|
2077
|
+
exit: $()
|
|
2078
|
+
};
|
|
2079
|
+
}
|
|
2080
|
+
class re {
|
|
2081
|
+
constructor(e) {
|
|
2082
|
+
this.isMounted = !1, this.node = e;
|
|
2083
|
+
}
|
|
2084
|
+
update() {
|
|
2085
|
+
}
|
|
2086
|
+
}
|
|
2087
|
+
class $r extends re {
|
|
2088
|
+
/**
|
|
2089
|
+
* We dynamically generate the AnimationState manager as it contains a reference
|
|
2090
|
+
* to the underlying animation library. We only want to load that if we load this,
|
|
2091
|
+
* so people can optionally code split it out using the `m` component.
|
|
2092
|
+
*/
|
|
2093
|
+
constructor(e) {
|
|
2094
|
+
super(e), e.animationState || (e.animationState = Kr(e));
|
|
2095
|
+
}
|
|
2096
|
+
updateAnimationControlsSubscription() {
|
|
2097
|
+
const { animate: e } = this.node.getProps();
|
|
2098
|
+
Ce(e) && (this.unmountControls = e.subscribe(this.node));
|
|
2099
|
+
}
|
|
2100
|
+
/**
|
|
2101
|
+
* Subscribe any provided AnimationControls to the component's VisualElement
|
|
2102
|
+
*/
|
|
2103
|
+
mount() {
|
|
2104
|
+
this.updateAnimationControlsSubscription();
|
|
2105
|
+
}
|
|
2106
|
+
update() {
|
|
2107
|
+
const { animate: e } = this.node.getProps(), { animate: n } = this.node.prevProps || {};
|
|
2108
|
+
e !== n && this.updateAnimationControlsSubscription();
|
|
2109
|
+
}
|
|
2110
|
+
unmount() {
|
|
2111
|
+
var e;
|
|
2112
|
+
this.node.animationState.reset(), (e = this.unmountControls) === null || e === void 0 || e.call(this);
|
|
2113
|
+
}
|
|
2114
|
+
}
|
|
2115
|
+
let jr = 0;
|
|
2116
|
+
class Wr extends re {
|
|
2117
|
+
constructor() {
|
|
2118
|
+
super(...arguments), this.id = jr++;
|
|
2119
|
+
}
|
|
2120
|
+
update() {
|
|
2121
|
+
if (!this.node.presenceContext)
|
|
2122
|
+
return;
|
|
2123
|
+
const { isPresent: e, onExitComplete: n } = this.node.presenceContext, { isPresent: s } = this.node.prevPresenceContext || {};
|
|
2124
|
+
if (!this.node.animationState || e === s)
|
|
2125
|
+
return;
|
|
2126
|
+
const i = this.node.animationState.setActive("exit", !e);
|
|
2127
|
+
n && !e && i.then(() => n(this.id));
|
|
2128
|
+
}
|
|
2129
|
+
mount() {
|
|
2130
|
+
const { register: e } = this.node.presenceContext || {};
|
|
2131
|
+
e && (this.unmount = e(this.id));
|
|
2132
|
+
}
|
|
2133
|
+
unmount() {
|
|
2134
|
+
}
|
|
2135
|
+
}
|
|
2136
|
+
const Gr = {
|
|
2137
|
+
animation: {
|
|
2138
|
+
Feature: $r
|
|
2139
|
+
},
|
|
2140
|
+
exit: {
|
|
2141
|
+
Feature: Wr
|
|
2142
|
+
}
|
|
2143
|
+
}, Ur = {
|
|
2144
|
+
x: !1,
|
|
2145
|
+
y: !1
|
|
2146
|
+
};
|
|
2147
|
+
function zr() {
|
|
2148
|
+
return Ur.y;
|
|
2149
|
+
}
|
|
2150
|
+
const Hr = (t) => t.pointerType === "mouse" ? typeof t.button != "number" || t.button <= 0 : t.isPrimary !== !1;
|
|
2151
|
+
function ns(t) {
|
|
2152
|
+
return {
|
|
2153
|
+
point: {
|
|
2154
|
+
x: t.pageX,
|
|
2155
|
+
y: t.pageY
|
|
2156
|
+
}
|
|
2157
|
+
};
|
|
2158
|
+
}
|
|
2159
|
+
function Qt(t, e, n, s = { passive: !0 }) {
|
|
2160
|
+
return t.addEventListener(e, n, s), () => t.removeEventListener(e, n);
|
|
2161
|
+
}
|
|
2162
|
+
function ss(t) {
|
|
2163
|
+
return t && typeof t == "object" && Object.prototype.hasOwnProperty.call(t, "current");
|
|
2164
|
+
}
|
|
2165
|
+
const en = () => ({ min: 0, max: 0 }), is = () => ({
|
|
2166
|
+
x: en(),
|
|
2167
|
+
y: en()
|
|
2168
|
+
});
|
|
2169
|
+
function qr({ top: t, left: e, right: n, bottom: s }) {
|
|
2170
|
+
return {
|
|
2171
|
+
x: { min: e, max: n },
|
|
2172
|
+
y: { min: t, max: s }
|
|
2173
|
+
};
|
|
2174
|
+
}
|
|
2175
|
+
function Yr(t, e) {
|
|
2176
|
+
if (!e)
|
|
2177
|
+
return t;
|
|
2178
|
+
const n = e({ x: t.left, y: t.top }), s = e({ x: t.right, y: t.bottom });
|
|
2179
|
+
return {
|
|
2180
|
+
top: n.y,
|
|
2181
|
+
left: n.x,
|
|
2182
|
+
bottom: s.y,
|
|
2183
|
+
right: s.x
|
|
2184
|
+
};
|
|
2185
|
+
}
|
|
2186
|
+
function Xr(t, e) {
|
|
2187
|
+
return qr(Yr(t.getBoundingClientRect(), e));
|
|
2188
|
+
}
|
|
2189
|
+
const rs = te(null), Zr = te({}), Jr = te({}), Qr = {}, { schedule: eo, cancel: Pa } = gn(queueMicrotask, !1);
|
|
2190
|
+
function to(t) {
|
|
2191
|
+
const e = F(t) ? t.get() : t;
|
|
2192
|
+
return br(e) ? e.toValue() : e;
|
|
2193
|
+
}
|
|
2194
|
+
function no(t, e, n) {
|
|
2195
|
+
var s;
|
|
2196
|
+
if (t instanceof Element)
|
|
2197
|
+
return [t];
|
|
2198
|
+
if (typeof t == "string") {
|
|
2199
|
+
let i = document;
|
|
2200
|
+
const r = (s = void 0) !== null && s !== void 0 ? s : i.querySelectorAll(t);
|
|
2201
|
+
return r ? Array.from(r) : [];
|
|
2202
|
+
}
|
|
2203
|
+
return Array.from(t);
|
|
2204
|
+
}
|
|
2205
|
+
function os(t, e) {
|
|
2206
|
+
const n = no(t), s = new AbortController(), i = {
|
|
2207
|
+
passive: !0,
|
|
2208
|
+
...e,
|
|
2209
|
+
signal: s.signal
|
|
2210
|
+
};
|
|
2211
|
+
return [n, i, () => s.abort()];
|
|
2212
|
+
}
|
|
2213
|
+
function tn(t) {
|
|
2214
|
+
return (e) => {
|
|
2215
|
+
e.pointerType === "touch" || zr() || t(e);
|
|
2216
|
+
};
|
|
2217
|
+
}
|
|
2218
|
+
function so(t, e, n = {}) {
|
|
2219
|
+
const [s, i, r] = os(t, n), o = tn((a) => {
|
|
2220
|
+
const { target: l } = a, u = e(a);
|
|
2221
|
+
if (!u || !l)
|
|
2222
|
+
return;
|
|
2223
|
+
const c = tn((f) => {
|
|
2224
|
+
u(f), l.removeEventListener("pointerleave", c);
|
|
2225
|
+
});
|
|
2226
|
+
l.addEventListener("pointerleave", c, i);
|
|
2227
|
+
});
|
|
2228
|
+
return s.forEach((a) => {
|
|
2229
|
+
a.addEventListener("pointerenter", o, i);
|
|
2230
|
+
}), r;
|
|
2231
|
+
}
|
|
2232
|
+
function nn(t, e, n) {
|
|
2233
|
+
const { props: s } = t;
|
|
2234
|
+
t.animationState && s.whileHover && t.animationState.setActive("whileHover", n === "Start");
|
|
2235
|
+
const i = "onHover" + n, r = s[i];
|
|
2236
|
+
r && R.postRender(() => r(e, ns(e)));
|
|
2237
|
+
}
|
|
2238
|
+
class io extends re {
|
|
2239
|
+
mount() {
|
|
2240
|
+
const { current: e } = this.node;
|
|
2241
|
+
e && (this.unmount = so(e, (n) => (nn(this.node, n, "Start"), (s) => nn(this.node, s, "End"))));
|
|
2242
|
+
}
|
|
2243
|
+
unmount() {
|
|
2244
|
+
}
|
|
2245
|
+
}
|
|
2246
|
+
class ro extends re {
|
|
2247
|
+
constructor() {
|
|
2248
|
+
super(...arguments), this.isActive = !1;
|
|
2249
|
+
}
|
|
2250
|
+
onFocus() {
|
|
2251
|
+
let e = !1;
|
|
2252
|
+
try {
|
|
2253
|
+
e = this.node.current.matches(":focus-visible");
|
|
2254
|
+
} catch {
|
|
2255
|
+
e = !0;
|
|
2256
|
+
}
|
|
2257
|
+
!e || !this.node.animationState || (this.node.animationState.setActive("whileFocus", !0), this.isActive = !0);
|
|
2258
|
+
}
|
|
2259
|
+
onBlur() {
|
|
2260
|
+
!this.isActive || !this.node.animationState || (this.node.animationState.setActive("whileFocus", !1), this.isActive = !1);
|
|
2261
|
+
}
|
|
2262
|
+
mount() {
|
|
2263
|
+
this.unmount = De(Qt(this.node.current, "focus", () => this.onFocus()), Qt(this.node.current, "blur", () => this.onBlur()));
|
|
2264
|
+
}
|
|
2265
|
+
unmount() {
|
|
2266
|
+
}
|
|
2267
|
+
}
|
|
2268
|
+
const ae = /* @__PURE__ */ new WeakSet();
|
|
2269
|
+
function sn(t) {
|
|
2270
|
+
return (e) => {
|
|
2271
|
+
e.key === "Enter" && t(e);
|
|
2272
|
+
};
|
|
2273
|
+
}
|
|
2274
|
+
function Ke(t, e) {
|
|
2275
|
+
t.dispatchEvent(new PointerEvent("pointer" + e, { isPrimary: !0, bubbles: !0 }));
|
|
2276
|
+
}
|
|
2277
|
+
const oo = (t, e) => {
|
|
2278
|
+
const n = t.currentTarget;
|
|
2279
|
+
if (!n)
|
|
2280
|
+
return;
|
|
2281
|
+
const s = sn(() => {
|
|
2282
|
+
if (ae.has(n))
|
|
2283
|
+
return;
|
|
2284
|
+
Ke(n, "down");
|
|
2285
|
+
const i = sn(() => {
|
|
2286
|
+
Ke(n, "up");
|
|
2287
|
+
}), r = () => Ke(n, "cancel");
|
|
2288
|
+
n.addEventListener("keyup", i, e), n.addEventListener("blur", r, e);
|
|
2289
|
+
});
|
|
2290
|
+
n.addEventListener("keydown", s, e), n.addEventListener("blur", () => n.removeEventListener("keydown", s), e);
|
|
2291
|
+
}, ao = /* @__PURE__ */ new Set([
|
|
2292
|
+
"BUTTON",
|
|
2293
|
+
"INPUT",
|
|
2294
|
+
"SELECT",
|
|
2295
|
+
"TEXTAREA",
|
|
2296
|
+
"A"
|
|
2297
|
+
]);
|
|
2298
|
+
function lo(t) {
|
|
2299
|
+
return ao.has(t.tagName) || t.tabIndex !== -1;
|
|
2300
|
+
}
|
|
2301
|
+
const as = (t, e) => e ? t === e ? !0 : as(t, e.parentElement) : !1;
|
|
2302
|
+
function rn(t) {
|
|
2303
|
+
return Hr(t) && !0;
|
|
2304
|
+
}
|
|
2305
|
+
function uo(t, e, n = {}) {
|
|
2306
|
+
const [s, i, r] = os(t, n), o = (a) => {
|
|
2307
|
+
const l = a.currentTarget;
|
|
2308
|
+
if (!rn(a) || ae.has(l))
|
|
2309
|
+
return;
|
|
2310
|
+
ae.add(l);
|
|
2311
|
+
const u = e(a), c = (h, y) => {
|
|
2312
|
+
window.removeEventListener("pointerup", f), window.removeEventListener("pointercancel", d), !(!rn(h) || !ae.has(l)) && (ae.delete(l), u && u(h, { success: y }));
|
|
2313
|
+
}, f = (h) => {
|
|
2314
|
+
c(h, n.useGlobalTarget || as(l, h.target));
|
|
2315
|
+
}, d = (h) => {
|
|
2316
|
+
c(h, !1);
|
|
2317
|
+
};
|
|
2318
|
+
window.addEventListener("pointerup", f, i), window.addEventListener("pointercancel", d, i);
|
|
2319
|
+
};
|
|
2320
|
+
return s.forEach((a) => {
|
|
2321
|
+
lo(a) || (a.tabIndex = 0), (n.useGlobalTarget ? window : a).addEventListener("pointerdown", o, i), a.addEventListener("focus", (u) => oo(u, i), i);
|
|
2322
|
+
}), r;
|
|
2323
|
+
}
|
|
2324
|
+
function on(t, e, n) {
|
|
2325
|
+
const { props: s } = t;
|
|
2326
|
+
t.animationState && s.whileTap && t.animationState.setActive("whileTap", n === "Start");
|
|
2327
|
+
const i = "onTap" + (n === "End" ? "" : n), r = s[i];
|
|
2328
|
+
r && R.postRender(() => r(e, ns(e)));
|
|
2329
|
+
}
|
|
2330
|
+
class co extends re {
|
|
2331
|
+
mount() {
|
|
2332
|
+
const { current: e } = this.node;
|
|
2333
|
+
e && (this.unmount = uo(e, (n) => (on(this.node, n, "Start"), (s, { success: i }) => on(this.node, s, i ? "End" : "Cancel")), { useGlobalTarget: this.node.props.globalTapTarget }));
|
|
2334
|
+
}
|
|
2335
|
+
unmount() {
|
|
2336
|
+
}
|
|
2337
|
+
}
|
|
2338
|
+
const Qe = /* @__PURE__ */ new WeakMap(), _e = /* @__PURE__ */ new WeakMap(), fo = (t) => {
|
|
2339
|
+
const e = Qe.get(t.target);
|
|
2340
|
+
e && e(t);
|
|
2341
|
+
}, ho = (t) => {
|
|
2342
|
+
t.forEach(fo);
|
|
2343
|
+
};
|
|
2344
|
+
function po({ root: t, ...e }) {
|
|
2345
|
+
const n = t || document;
|
|
2346
|
+
_e.has(n) || _e.set(n, {});
|
|
2347
|
+
const s = _e.get(n), i = JSON.stringify(e);
|
|
2348
|
+
return s[i] || (s[i] = new IntersectionObserver(ho, { root: t, ...e })), s[i];
|
|
2349
|
+
}
|
|
2350
|
+
function mo(t, e, n) {
|
|
2351
|
+
const s = po(e);
|
|
2352
|
+
return Qe.set(t, n), s.observe(t), () => {
|
|
2353
|
+
Qe.delete(t), s.unobserve(t);
|
|
2354
|
+
};
|
|
2355
|
+
}
|
|
2356
|
+
const go = {
|
|
2357
|
+
some: 0,
|
|
2358
|
+
all: 1
|
|
2359
|
+
};
|
|
2360
|
+
class yo extends re {
|
|
2361
|
+
constructor() {
|
|
2362
|
+
super(...arguments), this.hasEnteredView = !1, this.isInView = !1;
|
|
2363
|
+
}
|
|
2364
|
+
startObserver() {
|
|
2365
|
+
this.unmount();
|
|
2366
|
+
const { viewport: e = {} } = this.node.getProps(), { root: n, margin: s, amount: i = "some", once: r } = e, o = {
|
|
2367
|
+
root: n ? n.current : void 0,
|
|
2368
|
+
rootMargin: s,
|
|
2369
|
+
threshold: typeof i == "number" ? i : go[i]
|
|
2370
|
+
}, a = (l) => {
|
|
2371
|
+
const { isIntersecting: u } = l;
|
|
2372
|
+
if (this.isInView === u || (this.isInView = u, r && !u && this.hasEnteredView))
|
|
2373
|
+
return;
|
|
2374
|
+
u && (this.hasEnteredView = !0), this.node.animationState && this.node.animationState.setActive("whileInView", u);
|
|
2375
|
+
const { onViewportEnter: c, onViewportLeave: f } = this.node.getProps(), d = u ? c : f;
|
|
2376
|
+
d && d(l);
|
|
2377
|
+
};
|
|
2378
|
+
return mo(this.node.current, o, a);
|
|
2379
|
+
}
|
|
2380
|
+
mount() {
|
|
2381
|
+
this.startObserver();
|
|
2382
|
+
}
|
|
2383
|
+
update() {
|
|
2384
|
+
if (typeof IntersectionObserver > "u")
|
|
2385
|
+
return;
|
|
2386
|
+
const { props: e, prevProps: n } = this.node;
|
|
2387
|
+
["amount", "margin", "root"].some(vo(e, n)) && this.startObserver();
|
|
2388
|
+
}
|
|
2389
|
+
unmount() {
|
|
2390
|
+
}
|
|
2391
|
+
}
|
|
2392
|
+
function vo({ viewport: t = {} }, { viewport: e = {} } = {}) {
|
|
2393
|
+
return (n) => t[n] !== e[n];
|
|
2394
|
+
}
|
|
2395
|
+
const bo = {
|
|
2396
|
+
inView: {
|
|
2397
|
+
Feature: yo
|
|
2398
|
+
},
|
|
2399
|
+
tap: {
|
|
2400
|
+
Feature: co
|
|
2401
|
+
},
|
|
2402
|
+
focus: {
|
|
2403
|
+
Feature: ro
|
|
2404
|
+
},
|
|
2405
|
+
hover: {
|
|
2406
|
+
Feature: io
|
|
2407
|
+
}
|
|
2408
|
+
}, ls = te({
|
|
2409
|
+
transformPagePoint: (t) => t,
|
|
2410
|
+
isStatic: !1,
|
|
2411
|
+
reducedMotion: "never"
|
|
2412
|
+
}), Ie = te({}), Tt = typeof window < "u", wo = Tt ? xs : nt, Vt = te({ strict: !1 });
|
|
2413
|
+
function To(t, e, n, s, i) {
|
|
2414
|
+
var r, o;
|
|
2415
|
+
const { visualElement: a } = O(Ie), l = O(Vt), u = O(rs), c = O(ls).reducedMotion, f = Z(null);
|
|
2416
|
+
s = s || l.renderer, !f.current && s && (f.current = s(t, {
|
|
2417
|
+
visualState: e,
|
|
2418
|
+
parent: a,
|
|
2419
|
+
props: n,
|
|
2420
|
+
presenceContext: u,
|
|
2421
|
+
blockInitialAnimation: u ? u.initial === !1 : !1,
|
|
2422
|
+
reducedMotionConfig: c
|
|
2423
|
+
}));
|
|
2424
|
+
const d = f.current, h = O(Jr);
|
|
2425
|
+
d && !d.projection && i && (d.type === "html" || d.type === "svg") && Vo(f.current, n, i, h);
|
|
2426
|
+
const y = Z(!1);
|
|
2427
|
+
As(() => {
|
|
2428
|
+
d && y.current && d.update(n, u);
|
|
2429
|
+
});
|
|
2430
|
+
const v = n[Qn], b = Z(!!v && !(!((r = window.MotionHandoffIsComplete) === null || r === void 0) && r.call(window, v)) && ((o = window.MotionHasOptimisedAnimation) === null || o === void 0 ? void 0 : o.call(window, v)));
|
|
2431
|
+
return wo(() => {
|
|
2432
|
+
d && (y.current = !0, window.MotionIsMounted = !0, d.updateFeatures(), eo.render(d.render), b.current && d.animationState && d.animationState.animateChanges());
|
|
2433
|
+
}), nt(() => {
|
|
2434
|
+
d && (!b.current && d.animationState && d.animationState.animateChanges(), b.current && (queueMicrotask(() => {
|
|
2435
|
+
var p;
|
|
2436
|
+
(p = window.MotionHandoffMarkAsComplete) === null || p === void 0 || p.call(window, v);
|
|
2437
|
+
}), b.current = !1));
|
|
2438
|
+
}), d;
|
|
2439
|
+
}
|
|
2440
|
+
function Vo(t, e, n, s) {
|
|
2441
|
+
const { layoutId: i, layout: r, drag: o, dragConstraints: a, layoutScroll: l, layoutRoot: u } = e;
|
|
2442
|
+
t.projection = new n(t.latestValues, e["data-framer-portal-id"] ? void 0 : us(t.parent)), t.projection.setOptions({
|
|
2443
|
+
layoutId: i,
|
|
2444
|
+
layout: r,
|
|
2445
|
+
alwaysMeasureLayout: !!o || a && ss(a),
|
|
2446
|
+
visualElement: t,
|
|
2447
|
+
/**
|
|
2448
|
+
* TODO: Update options in an effect. This could be tricky as it'll be too late
|
|
2449
|
+
* to update by the time layout animations run.
|
|
2450
|
+
* We also need to fix this safeToRemove by linking it up to the one returned by usePresence,
|
|
2451
|
+
* ensuring it gets called if there's no potential layout animations.
|
|
2452
|
+
*
|
|
2453
|
+
*/
|
|
2454
|
+
animationType: typeof r == "string" ? r : "both",
|
|
2455
|
+
initialPromotionConfig: s,
|
|
2456
|
+
layoutScroll: l,
|
|
2457
|
+
layoutRoot: u
|
|
2458
|
+
});
|
|
2459
|
+
}
|
|
2460
|
+
function us(t) {
|
|
2461
|
+
if (t)
|
|
2462
|
+
return t.options.allowProjection !== !1 ? t.projection : us(t.parent);
|
|
2463
|
+
}
|
|
2464
|
+
function So(t, e, n) {
|
|
2465
|
+
return fn(
|
|
2466
|
+
(s) => {
|
|
2467
|
+
s && t.mount && t.mount(s), e && (s ? e.mount(s) : e.unmount()), n && (typeof n == "function" ? n(s) : ss(n) && (n.current = s));
|
|
2468
|
+
},
|
|
2469
|
+
/**
|
|
2470
|
+
* Only pass a new ref callback to React if we've received a visual element
|
|
2471
|
+
* factory. Otherwise we'll be mounting/remounting every time externalRef
|
|
2472
|
+
* or other dependencies change.
|
|
2473
|
+
*/
|
|
2474
|
+
[e]
|
|
2475
|
+
);
|
|
2476
|
+
}
|
|
2477
|
+
function Oe(t) {
|
|
2478
|
+
return Ce(t.animate) || rt.some((e) => ue(t[e]));
|
|
2479
|
+
}
|
|
2480
|
+
function cs(t) {
|
|
2481
|
+
return !!(Oe(t) || t.variants);
|
|
2482
|
+
}
|
|
2483
|
+
function xo(t, e) {
|
|
2484
|
+
if (Oe(t)) {
|
|
2485
|
+
const { initial: n, animate: s } = t;
|
|
2486
|
+
return {
|
|
2487
|
+
initial: n === !1 || ue(n) ? n : void 0,
|
|
2488
|
+
animate: ue(s) ? s : void 0
|
|
2489
|
+
};
|
|
2490
|
+
}
|
|
2491
|
+
return t.inherit !== !1 ? e : {};
|
|
2492
|
+
}
|
|
2493
|
+
function Ao(t) {
|
|
2494
|
+
const { initial: e, animate: n } = xo(t, O(Ie));
|
|
2495
|
+
return Ae(() => ({ initial: e, animate: n }), [an(e), an(n)]);
|
|
2496
|
+
}
|
|
2497
|
+
function an(t) {
|
|
2498
|
+
return Array.isArray(t) ? t.join(" ") : t;
|
|
2499
|
+
}
|
|
2500
|
+
const ln = {
|
|
2501
|
+
animation: [
|
|
2502
|
+
"animate",
|
|
2503
|
+
"variants",
|
|
2504
|
+
"whileHover",
|
|
2505
|
+
"whileTap",
|
|
2506
|
+
"exit",
|
|
2507
|
+
"whileInView",
|
|
2508
|
+
"whileFocus",
|
|
2509
|
+
"whileDrag"
|
|
2510
|
+
],
|
|
2511
|
+
exit: ["exit"],
|
|
2512
|
+
drag: ["drag", "dragControls"],
|
|
2513
|
+
focus: ["whileFocus"],
|
|
2514
|
+
hover: ["whileHover", "onHoverStart", "onHoverEnd"],
|
|
2515
|
+
tap: ["whileTap", "onTap", "onTapStart", "onTapCancel"],
|
|
2516
|
+
pan: ["onPan", "onPanStart", "onPanSessionStart", "onPanEnd"],
|
|
2517
|
+
inView: ["whileInView", "onViewportEnter", "onViewportLeave"],
|
|
2518
|
+
layout: ["layout", "layoutId"]
|
|
2519
|
+
}, ee = {};
|
|
2520
|
+
for (const t in ln)
|
|
2521
|
+
ee[t] = {
|
|
2522
|
+
isEnabled: (e) => ln[t].some((n) => !!e[n])
|
|
2523
|
+
};
|
|
2524
|
+
function et(t) {
|
|
2525
|
+
for (const e in t)
|
|
2526
|
+
ee[e] = {
|
|
2527
|
+
...ee[e],
|
|
2528
|
+
...t[e]
|
|
2529
|
+
};
|
|
2530
|
+
}
|
|
2531
|
+
const Mo = Symbol.for("motionComponentSymbol");
|
|
2532
|
+
function Co({ preloadedFeatures: t, createVisualElement: e, useRender: n, useVisualState: s, Component: i }) {
|
|
2533
|
+
t && et(t);
|
|
2534
|
+
function r(a, l) {
|
|
2535
|
+
let u;
|
|
2536
|
+
const c = {
|
|
2537
|
+
...O(ls),
|
|
2538
|
+
...a,
|
|
2539
|
+
layoutId: Po(a)
|
|
2540
|
+
}, { isStatic: f } = c, d = Ao(a), h = s(a, f);
|
|
2541
|
+
if (!f && Tt) {
|
|
2542
|
+
Fo(c, t);
|
|
2543
|
+
const y = Do(c);
|
|
2544
|
+
u = y.MeasureLayout, d.visualElement = To(i, h, c, e, y.ProjectionNode);
|
|
2545
|
+
}
|
|
2546
|
+
return Y(Ie.Provider, { value: d, children: [u && d.visualElement ? E(u, { visualElement: d.visualElement, ...c }) : null, n(i, a, So(h, d.visualElement, l), h, f, d.visualElement)] });
|
|
2547
|
+
}
|
|
2548
|
+
const o = Ms(r);
|
|
2549
|
+
return o[Mo] = i, o;
|
|
2550
|
+
}
|
|
2551
|
+
function Po({ layoutId: t }) {
|
|
2552
|
+
const e = O(Zr).id;
|
|
2553
|
+
return e && t !== void 0 ? e + "-" + t : t;
|
|
2554
|
+
}
|
|
2555
|
+
function Fo(t, e) {
|
|
2556
|
+
const n = O(Vt).strict;
|
|
2557
|
+
if (process.env.NODE_ENV !== "production" && e && n) {
|
|
2558
|
+
const s = "You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";
|
|
2559
|
+
t.ignoreStrict ? ne(!1, s) : G(!1, s);
|
|
2560
|
+
}
|
|
2561
|
+
}
|
|
2562
|
+
function Do(t) {
|
|
2563
|
+
const { drag: e, layout: n } = ee;
|
|
2564
|
+
if (!e && !n)
|
|
2565
|
+
return {};
|
|
2566
|
+
const s = { ...e, ...n };
|
|
2567
|
+
return {
|
|
2568
|
+
MeasureLayout: e != null && e.isEnabled(t) || n != null && n.isEnabled(t) ? s.MeasureLayout : void 0,
|
|
2569
|
+
ProjectionNode: s.ProjectionNode
|
|
2570
|
+
};
|
|
2571
|
+
}
|
|
2572
|
+
const Ro = [
|
|
2573
|
+
"animate",
|
|
2574
|
+
"circle",
|
|
2575
|
+
"defs",
|
|
2576
|
+
"desc",
|
|
2577
|
+
"ellipse",
|
|
2578
|
+
"g",
|
|
2579
|
+
"image",
|
|
2580
|
+
"line",
|
|
2581
|
+
"filter",
|
|
2582
|
+
"marker",
|
|
2583
|
+
"mask",
|
|
2584
|
+
"metadata",
|
|
2585
|
+
"path",
|
|
2586
|
+
"pattern",
|
|
2587
|
+
"polygon",
|
|
2588
|
+
"polyline",
|
|
2589
|
+
"rect",
|
|
2590
|
+
"stop",
|
|
2591
|
+
"switch",
|
|
2592
|
+
"symbol",
|
|
2593
|
+
"svg",
|
|
2594
|
+
"text",
|
|
2595
|
+
"tspan",
|
|
2596
|
+
"use",
|
|
2597
|
+
"view"
|
|
2598
|
+
];
|
|
2599
|
+
function St(t) {
|
|
2600
|
+
return (
|
|
2601
|
+
/**
|
|
2602
|
+
* If it's not a string, it's a custom React component. Currently we only support
|
|
2603
|
+
* HTML custom React components.
|
|
2604
|
+
*/
|
|
2605
|
+
typeof t != "string" || /**
|
|
2606
|
+
* If it contains a dash, the element is a custom HTML webcomponent.
|
|
2607
|
+
*/
|
|
2608
|
+
t.includes("-") ? !1 : (
|
|
2609
|
+
/**
|
|
2610
|
+
* If it's in our list of lowercase SVG tags, it's an SVG component
|
|
2611
|
+
*/
|
|
2612
|
+
!!(Ro.indexOf(t) > -1 || /**
|
|
2613
|
+
* If it contains a capital letter, it's an SVG component
|
|
2614
|
+
*/
|
|
2615
|
+
/[A-Z]/u.test(t))
|
|
2616
|
+
)
|
|
2617
|
+
);
|
|
2618
|
+
}
|
|
2619
|
+
function ds(t, { style: e, vars: n }, s, i) {
|
|
2620
|
+
Object.assign(t.style, e, i && i.getProjectionStyles(s));
|
|
2621
|
+
for (const r in n)
|
|
2622
|
+
t.style.setProperty(r, n[r]);
|
|
2623
|
+
}
|
|
2624
|
+
const fs = /* @__PURE__ */ new Set([
|
|
2625
|
+
"baseFrequency",
|
|
2626
|
+
"diffuseConstant",
|
|
2627
|
+
"kernelMatrix",
|
|
2628
|
+
"kernelUnitLength",
|
|
2629
|
+
"keySplines",
|
|
2630
|
+
"keyTimes",
|
|
2631
|
+
"limitingConeAngle",
|
|
2632
|
+
"markerHeight",
|
|
2633
|
+
"markerWidth",
|
|
2634
|
+
"numOctaves",
|
|
2635
|
+
"targetX",
|
|
2636
|
+
"targetY",
|
|
2637
|
+
"surfaceScale",
|
|
2638
|
+
"specularConstant",
|
|
2639
|
+
"specularExponent",
|
|
2640
|
+
"stdDeviation",
|
|
2641
|
+
"tableValues",
|
|
2642
|
+
"viewBox",
|
|
2643
|
+
"gradientTransform",
|
|
2644
|
+
"pathLength",
|
|
2645
|
+
"startOffset",
|
|
2646
|
+
"textLength",
|
|
2647
|
+
"lengthAdjust"
|
|
2648
|
+
]);
|
|
2649
|
+
function hs(t, e, n, s) {
|
|
2650
|
+
ds(t, e, void 0, s);
|
|
2651
|
+
for (const i in e.attrs)
|
|
2652
|
+
t.setAttribute(fs.has(i) ? i : wt(i), e.attrs[i]);
|
|
2653
|
+
}
|
|
2654
|
+
function ps(t, { layout: e, layoutId: n }) {
|
|
2655
|
+
return z.has(t) || t.startsWith("origin") || (e || n !== void 0) && (!!Qr[t] || t === "opacity");
|
|
2656
|
+
}
|
|
2657
|
+
function xt(t, e, n) {
|
|
2658
|
+
var s;
|
|
2659
|
+
const { style: i } = t, r = {};
|
|
2660
|
+
for (const o in i)
|
|
2661
|
+
(F(i[o]) || e.style && F(e.style[o]) || ps(o, t) || ((s = n == null ? void 0 : n.getValue(o)) === null || s === void 0 ? void 0 : s.liveStyle) !== void 0) && (r[o] = i[o]);
|
|
2662
|
+
return r;
|
|
2663
|
+
}
|
|
2664
|
+
function ms(t, e, n) {
|
|
2665
|
+
const s = xt(t, e, n);
|
|
2666
|
+
for (const i in t)
|
|
2667
|
+
if (F(t[i]) || F(e[i])) {
|
|
2668
|
+
const r = fe.indexOf(i) !== -1 ? "attr" + i.charAt(0).toUpperCase() + i.substring(1) : i;
|
|
2669
|
+
s[r] = t[i];
|
|
2670
|
+
}
|
|
2671
|
+
return s;
|
|
2672
|
+
}
|
|
2673
|
+
function Io(t) {
|
|
2674
|
+
const e = Z(null);
|
|
2675
|
+
return e.current === null && (e.current = t()), e.current;
|
|
2676
|
+
}
|
|
2677
|
+
function Oo({ scrapeMotionValuesFromProps: t, createRenderState: e, onMount: n }, s, i, r) {
|
|
2678
|
+
const o = {
|
|
2679
|
+
latestValues: Eo(s, i, r, t),
|
|
2680
|
+
renderState: e()
|
|
2681
|
+
};
|
|
2682
|
+
return n && (o.mount = (a) => n(s, a, o)), o;
|
|
2683
|
+
}
|
|
2684
|
+
const gs = (t) => (e, n) => {
|
|
2685
|
+
const s = O(Ie), i = O(rs), r = () => Oo(t, e, s, i);
|
|
2686
|
+
return n ? r() : Io(r);
|
|
2687
|
+
};
|
|
2688
|
+
function Eo(t, e, n, s) {
|
|
2689
|
+
const i = {}, r = s(t, {});
|
|
2690
|
+
for (const d in r)
|
|
2691
|
+
i[d] = to(r[d]);
|
|
2692
|
+
let { initial: o, animate: a } = t;
|
|
2693
|
+
const l = Oe(t), u = cs(t);
|
|
2694
|
+
e && u && !l && t.inherit !== !1 && (o === void 0 && (o = e.initial), a === void 0 && (a = e.animate));
|
|
2695
|
+
let c = n ? n.initial === !1 : !1;
|
|
2696
|
+
c = c || o === !1;
|
|
2697
|
+
const f = c ? a : o;
|
|
2698
|
+
if (f && typeof f != "boolean" && !Ce(f)) {
|
|
2699
|
+
const d = Array.isArray(f) ? f : [f];
|
|
2700
|
+
for (let h = 0; h < d.length; h++) {
|
|
2701
|
+
const y = st(t, d[h]);
|
|
2702
|
+
if (y) {
|
|
2703
|
+
const { transitionEnd: v, transition: b, ...p } = y;
|
|
2704
|
+
for (const g in p) {
|
|
2705
|
+
let V = p[g];
|
|
2706
|
+
if (Array.isArray(V)) {
|
|
2707
|
+
const A = c ? V.length - 1 : 0;
|
|
2708
|
+
V = V[A];
|
|
2709
|
+
}
|
|
2710
|
+
V !== null && (i[g] = V);
|
|
2711
|
+
}
|
|
2712
|
+
for (const g in v)
|
|
2713
|
+
i[g] = v[g];
|
|
2714
|
+
}
|
|
2715
|
+
}
|
|
2716
|
+
}
|
|
2717
|
+
return i;
|
|
2718
|
+
}
|
|
2719
|
+
const At = () => ({
|
|
2720
|
+
style: {},
|
|
2721
|
+
transform: {},
|
|
2722
|
+
transformOrigin: {},
|
|
2723
|
+
vars: {}
|
|
2724
|
+
}), ys = () => ({
|
|
2725
|
+
...At(),
|
|
2726
|
+
attrs: {}
|
|
2727
|
+
}), vs = (t, e) => e && typeof t == "number" ? e.transform(t) : t, ko = {
|
|
2728
|
+
x: "translateX",
|
|
2729
|
+
y: "translateY",
|
|
2730
|
+
z: "translateZ",
|
|
2731
|
+
transformPerspective: "perspective"
|
|
2732
|
+
}, Lo = fe.length;
|
|
2733
|
+
function No(t, e, n) {
|
|
2734
|
+
let s = "", i = !0;
|
|
2735
|
+
for (let r = 0; r < Lo; r++) {
|
|
2736
|
+
const o = fe[r], a = t[o];
|
|
2737
|
+
if (a === void 0)
|
|
2738
|
+
continue;
|
|
2739
|
+
let l = !0;
|
|
2740
|
+
if (typeof a == "number" ? l = a === (o.startsWith("scale") ? 1 : 0) : l = parseFloat(a) === 0, !l || n) {
|
|
2741
|
+
const u = vs(a, ft[o]);
|
|
2742
|
+
if (!l) {
|
|
2743
|
+
i = !1;
|
|
2744
|
+
const c = ko[o] || o;
|
|
2745
|
+
s += `${c}(${u}) `;
|
|
2746
|
+
}
|
|
2747
|
+
n && (e[o] = u);
|
|
2748
|
+
}
|
|
2749
|
+
}
|
|
2750
|
+
return s = s.trim(), n ? s = n(e, i ? "" : s) : i && (s = "none"), s;
|
|
2751
|
+
}
|
|
2752
|
+
function Mt(t, e, n) {
|
|
2753
|
+
const { style: s, vars: i, transformOrigin: r } = t;
|
|
2754
|
+
let o = !1, a = !1;
|
|
2755
|
+
for (const l in e) {
|
|
2756
|
+
const u = e[l];
|
|
2757
|
+
if (z.has(l)) {
|
|
2758
|
+
o = !0;
|
|
2759
|
+
continue;
|
|
2760
|
+
} else if (Cn(l)) {
|
|
2761
|
+
i[l] = u;
|
|
2762
|
+
continue;
|
|
2763
|
+
} else {
|
|
2764
|
+
const c = vs(u, ft[l]);
|
|
2765
|
+
l.startsWith("origin") ? (a = !0, r[l] = c) : s[l] = c;
|
|
2766
|
+
}
|
|
2767
|
+
}
|
|
2768
|
+
if (e.transform || (o || n ? s.transform = No(e, t.transform, n) : s.transform && (s.transform = "none")), a) {
|
|
2769
|
+
const { originX: l = "50%", originY: u = "50%", originZ: c = 0 } = r;
|
|
2770
|
+
s.transformOrigin = `${l} ${u} ${c}`;
|
|
2771
|
+
}
|
|
2772
|
+
}
|
|
2773
|
+
function un(t, e, n) {
|
|
2774
|
+
return typeof t == "string" ? t : m.transform(e + n * t);
|
|
2775
|
+
}
|
|
2776
|
+
function Bo(t, e, n) {
|
|
2777
|
+
const s = un(e, t.x, t.width), i = un(n, t.y, t.height);
|
|
2778
|
+
return `${s} ${i}`;
|
|
2779
|
+
}
|
|
2780
|
+
const Ko = {
|
|
2781
|
+
offset: "stroke-dashoffset",
|
|
2782
|
+
array: "stroke-dasharray"
|
|
2783
|
+
}, _o = {
|
|
2784
|
+
offset: "strokeDashoffset",
|
|
2785
|
+
array: "strokeDasharray"
|
|
2786
|
+
};
|
|
2787
|
+
function $o(t, e, n = 1, s = 0, i = !0) {
|
|
2788
|
+
t.pathLength = 1;
|
|
2789
|
+
const r = i ? Ko : _o;
|
|
2790
|
+
t[r.offset] = m.transform(-s);
|
|
2791
|
+
const o = m.transform(e), a = m.transform(n);
|
|
2792
|
+
t[r.array] = `${o} ${a}`;
|
|
2793
|
+
}
|
|
2794
|
+
function Ct(t, {
|
|
2795
|
+
attrX: e,
|
|
2796
|
+
attrY: n,
|
|
2797
|
+
attrScale: s,
|
|
2798
|
+
originX: i,
|
|
2799
|
+
originY: r,
|
|
2800
|
+
pathLength: o,
|
|
2801
|
+
pathSpacing: a = 1,
|
|
2802
|
+
pathOffset: l = 0,
|
|
2803
|
+
// This is object creation, which we try to avoid per-frame.
|
|
2804
|
+
...u
|
|
2805
|
+
}, c, f) {
|
|
2806
|
+
if (Mt(t, u, f), c) {
|
|
2807
|
+
t.style.viewBox && (t.attrs.viewBox = t.style.viewBox);
|
|
2808
|
+
return;
|
|
2809
|
+
}
|
|
2810
|
+
t.attrs = t.style, t.style = {};
|
|
2811
|
+
const { attrs: d, style: h, dimensions: y } = t;
|
|
2812
|
+
d.transform && (y && (h.transform = d.transform), delete d.transform), y && (i !== void 0 || r !== void 0 || h.transform) && (h.transformOrigin = Bo(y, i !== void 0 ? i : 0.5, r !== void 0 ? r : 0.5)), e !== void 0 && (d.x = e), n !== void 0 && (d.y = n), s !== void 0 && (d.scale = s), o !== void 0 && $o(d, o, a, l, !1);
|
|
2813
|
+
}
|
|
2814
|
+
const Pt = (t) => typeof t == "string" && t.toLowerCase() === "svg", jo = {
|
|
2815
|
+
useVisualState: gs({
|
|
2816
|
+
scrapeMotionValuesFromProps: ms,
|
|
2817
|
+
createRenderState: ys,
|
|
2818
|
+
onMount: (t, e, { renderState: n, latestValues: s }) => {
|
|
2819
|
+
R.read(() => {
|
|
2820
|
+
try {
|
|
2821
|
+
n.dimensions = typeof e.getBBox == "function" ? e.getBBox() : e.getBoundingClientRect();
|
|
2822
|
+
} catch {
|
|
2823
|
+
n.dimensions = {
|
|
2824
|
+
x: 0,
|
|
2825
|
+
y: 0,
|
|
2826
|
+
width: 0,
|
|
2827
|
+
height: 0
|
|
2828
|
+
};
|
|
2829
|
+
}
|
|
2830
|
+
}), R.render(() => {
|
|
2831
|
+
Ct(n, s, Pt(e.tagName), t.transformTemplate), hs(e, n);
|
|
2832
|
+
});
|
|
2833
|
+
}
|
|
2834
|
+
})
|
|
2835
|
+
}, Wo = {
|
|
2836
|
+
useVisualState: gs({
|
|
2837
|
+
scrapeMotionValuesFromProps: xt,
|
|
2838
|
+
createRenderState: At
|
|
2839
|
+
})
|
|
2840
|
+
};
|
|
2841
|
+
function bs(t, e, n) {
|
|
2842
|
+
for (const s in e)
|
|
2843
|
+
!F(e[s]) && !ps(s, n) && (t[s] = e[s]);
|
|
2844
|
+
}
|
|
2845
|
+
function Go({ transformTemplate: t }, e) {
|
|
2846
|
+
return Ae(() => {
|
|
2847
|
+
const n = At();
|
|
2848
|
+
return Mt(n, e, t), Object.assign({}, n.vars, n.style);
|
|
2849
|
+
}, [e]);
|
|
2850
|
+
}
|
|
2851
|
+
function Uo(t, e) {
|
|
2852
|
+
const n = t.style || {}, s = {};
|
|
2853
|
+
return bs(s, n, t), Object.assign(s, Go(t, e)), s;
|
|
2854
|
+
}
|
|
2855
|
+
function zo(t, e) {
|
|
2856
|
+
const n = {}, s = Uo(t, e);
|
|
2857
|
+
return t.drag && t.dragListener !== !1 && (n.draggable = !1, s.userSelect = s.WebkitUserSelect = s.WebkitTouchCallout = "none", s.touchAction = t.drag === !0 ? "none" : `pan-${t.drag === "x" ? "y" : "x"}`), t.tabIndex === void 0 && (t.onTap || t.onTapStart || t.whileTap) && (n.tabIndex = 0), n.style = s, n;
|
|
2858
|
+
}
|
|
2859
|
+
const Ho = /* @__PURE__ */ new Set([
|
|
2860
|
+
"animate",
|
|
2861
|
+
"exit",
|
|
2862
|
+
"variants",
|
|
2863
|
+
"initial",
|
|
2864
|
+
"style",
|
|
2865
|
+
"values",
|
|
2866
|
+
"variants",
|
|
2867
|
+
"transition",
|
|
2868
|
+
"transformTemplate",
|
|
2869
|
+
"custom",
|
|
2870
|
+
"inherit",
|
|
2871
|
+
"onBeforeLayoutMeasure",
|
|
2872
|
+
"onAnimationStart",
|
|
2873
|
+
"onAnimationComplete",
|
|
2874
|
+
"onUpdate",
|
|
2875
|
+
"onDragStart",
|
|
2876
|
+
"onDrag",
|
|
2877
|
+
"onDragEnd",
|
|
2878
|
+
"onMeasureDragConstraints",
|
|
2879
|
+
"onDirectionLock",
|
|
2880
|
+
"onDragTransitionEnd",
|
|
2881
|
+
"_dragX",
|
|
2882
|
+
"_dragY",
|
|
2883
|
+
"onHoverStart",
|
|
2884
|
+
"onHoverEnd",
|
|
2885
|
+
"onViewportEnter",
|
|
2886
|
+
"onViewportLeave",
|
|
2887
|
+
"globalTapTarget",
|
|
2888
|
+
"ignoreStrict",
|
|
2889
|
+
"viewport"
|
|
2890
|
+
]);
|
|
2891
|
+
function xe(t) {
|
|
2892
|
+
return t.startsWith("while") || t.startsWith("drag") && t !== "draggable" || t.startsWith("layout") || t.startsWith("onTap") || t.startsWith("onPan") || t.startsWith("onLayout") || Ho.has(t);
|
|
2893
|
+
}
|
|
2894
|
+
let ws = (t) => !xe(t);
|
|
2895
|
+
function qo(t) {
|
|
2896
|
+
t && (ws = (e) => e.startsWith("on") ? !xe(e) : t(e));
|
|
2897
|
+
}
|
|
2898
|
+
try {
|
|
2899
|
+
qo(require("@emotion/is-prop-valid").default);
|
|
2900
|
+
} catch {
|
|
2901
|
+
}
|
|
2902
|
+
function Yo(t, e, n) {
|
|
2903
|
+
const s = {};
|
|
2904
|
+
for (const i in t)
|
|
2905
|
+
i === "values" && typeof t.values == "object" || (ws(i) || n === !0 && xe(i) || !e && !xe(i) || // If trying to use native HTML drag events, forward drag listeners
|
|
2906
|
+
t.draggable && i.startsWith("onDrag")) && (s[i] = t[i]);
|
|
2907
|
+
return s;
|
|
2908
|
+
}
|
|
2909
|
+
function Xo(t, e, n, s) {
|
|
2910
|
+
const i = Ae(() => {
|
|
2911
|
+
const r = ys();
|
|
2912
|
+
return Ct(r, e, Pt(s), t.transformTemplate), {
|
|
2913
|
+
...r.attrs,
|
|
2914
|
+
style: { ...r.style }
|
|
2915
|
+
};
|
|
2916
|
+
}, [e]);
|
|
2917
|
+
if (t.style) {
|
|
2918
|
+
const r = {};
|
|
2919
|
+
bs(r, t.style, t), i.style = { ...r, ...i.style };
|
|
2920
|
+
}
|
|
2921
|
+
return i;
|
|
2922
|
+
}
|
|
2923
|
+
function Zo(t = !1) {
|
|
2924
|
+
return (n, s, i, { latestValues: r }, o) => {
|
|
2925
|
+
const l = (St(n) ? Xo : zo)(s, r, o, n), u = Yo(s, typeof n == "string", t), c = n !== hn ? { ...u, ...l, ref: i } : {}, { children: f } = s, d = Ae(() => F(f) ? f.get() : f, [f]);
|
|
2926
|
+
return Cs(n, {
|
|
2927
|
+
...c,
|
|
2928
|
+
children: d
|
|
2929
|
+
});
|
|
2930
|
+
};
|
|
2931
|
+
}
|
|
2932
|
+
function Jo(t, e) {
|
|
2933
|
+
return function(s, { forwardMotionProps: i } = { forwardMotionProps: !1 }) {
|
|
2934
|
+
const o = {
|
|
2935
|
+
...St(s) ? jo : Wo,
|
|
2936
|
+
preloadedFeatures: t,
|
|
2937
|
+
useRender: Zo(i),
|
|
2938
|
+
createVisualElement: e,
|
|
2939
|
+
Component: s
|
|
2940
|
+
};
|
|
2941
|
+
return Co(o);
|
|
2942
|
+
};
|
|
2943
|
+
}
|
|
2944
|
+
const tt = { current: null }, Ts = { current: !1 };
|
|
2945
|
+
function Qo() {
|
|
2946
|
+
if (Ts.current = !0, !!Tt)
|
|
2947
|
+
if (window.matchMedia) {
|
|
2948
|
+
const t = window.matchMedia("(prefers-reduced-motion)"), e = () => tt.current = t.matches;
|
|
2949
|
+
t.addListener(e), e();
|
|
2950
|
+
} else
|
|
2951
|
+
tt.current = !1;
|
|
2952
|
+
}
|
|
2953
|
+
function ea(t, e, n) {
|
|
2954
|
+
for (const s in e) {
|
|
2955
|
+
const i = e[s], r = n[s];
|
|
2956
|
+
if (F(i))
|
|
2957
|
+
t.addValue(s, i), process.env.NODE_ENV === "development" && Me(i.version === "11.15.0", `Attempting to mix Motion versions ${i.version} with 11.15.0 may not work as expected.`);
|
|
2958
|
+
else if (F(r))
|
|
2959
|
+
t.addValue(s, Se(i, { owner: t }));
|
|
2960
|
+
else if (r !== i)
|
|
2961
|
+
if (t.hasValue(s)) {
|
|
2962
|
+
const o = t.getValue(s);
|
|
2963
|
+
o.liveStyle === !0 ? o.jump(i) : o.hasAnimated || o.set(i);
|
|
2964
|
+
} else {
|
|
2965
|
+
const o = t.getStaticValue(s);
|
|
2966
|
+
t.addValue(s, Se(o !== void 0 ? o : i, { owner: t }));
|
|
2967
|
+
}
|
|
2968
|
+
}
|
|
2969
|
+
for (const s in n)
|
|
2970
|
+
e[s] === void 0 && t.removeValue(s);
|
|
2971
|
+
return e;
|
|
2972
|
+
}
|
|
2973
|
+
const cn = /* @__PURE__ */ new WeakMap(), ta = [...Dn, C, ie], na = (t) => ta.find(Fn(t)), dn = [
|
|
2974
|
+
"AnimationStart",
|
|
2975
|
+
"AnimationComplete",
|
|
2976
|
+
"Update",
|
|
2977
|
+
"BeforeLayoutMeasure",
|
|
2978
|
+
"LayoutMeasure",
|
|
2979
|
+
"LayoutAnimationStart",
|
|
2980
|
+
"LayoutAnimationComplete"
|
|
2981
|
+
];
|
|
2982
|
+
class sa {
|
|
2983
|
+
/**
|
|
2984
|
+
* This method takes React props and returns found MotionValues. For example, HTML
|
|
2985
|
+
* MotionValues will be found within the style prop, whereas for Three.js within attribute arrays.
|
|
2986
|
+
*
|
|
2987
|
+
* This isn't an abstract method as it needs calling in the constructor, but it is
|
|
2988
|
+
* intended to be one.
|
|
2989
|
+
*/
|
|
2990
|
+
scrapeMotionValuesFromProps(e, n, s) {
|
|
2991
|
+
return {};
|
|
2992
|
+
}
|
|
2993
|
+
constructor({ parent: e, props: n, presenceContext: s, reducedMotionConfig: i, blockInitialAnimation: r, visualState: o }, a = {}) {
|
|
2994
|
+
this.current = null, this.children = /* @__PURE__ */ new Set(), this.isVariantNode = !1, this.isControllingVariants = !1, this.shouldReduceMotion = null, this.values = /* @__PURE__ */ new Map(), this.KeyframeResolver = ut, this.features = {}, this.valueSubscriptions = /* @__PURE__ */ new Map(), this.prevMotionValues = {}, this.events = {}, this.propEventSubscriptions = {}, this.notifyUpdate = () => this.notify("Update", this.latestValues), this.render = () => {
|
|
2995
|
+
this.current && (this.triggerBuild(), this.renderInstance(this.current, this.renderState, this.props.style, this.projection));
|
|
2996
|
+
}, this.renderScheduledAt = 0, this.scheduleRender = () => {
|
|
2997
|
+
const d = K.now();
|
|
2998
|
+
this.renderScheduledAt < d && (this.renderScheduledAt = d, R.render(this.render, !1, !0));
|
|
2999
|
+
};
|
|
3000
|
+
const { latestValues: l, renderState: u } = o;
|
|
3001
|
+
this.latestValues = l, this.baseTarget = { ...l }, this.initialValues = n.initial ? { ...l } : {}, this.renderState = u, this.parent = e, this.props = n, this.presenceContext = s, this.depth = e ? e.depth + 1 : 0, this.reducedMotionConfig = i, this.options = a, this.blockInitialAnimation = !!r, this.isControllingVariants = Oe(n), this.isVariantNode = cs(n), this.isVariantNode && (this.variantChildren = /* @__PURE__ */ new Set()), this.manuallyAnimateOnMount = !!(e && e.current);
|
|
3002
|
+
const { willChange: c, ...f } = this.scrapeMotionValuesFromProps(n, {}, this);
|
|
3003
|
+
for (const d in f) {
|
|
3004
|
+
const h = f[d];
|
|
3005
|
+
l[d] !== void 0 && F(h) && h.set(l[d], !1);
|
|
3006
|
+
}
|
|
3007
|
+
}
|
|
3008
|
+
mount(e) {
|
|
3009
|
+
this.current = e, cn.set(e, this), this.projection && !this.projection.instance && this.projection.mount(e), this.parent && this.isVariantNode && !this.isControllingVariants && (this.removeFromVariantTree = this.parent.addVariantChild(this)), this.values.forEach((n, s) => this.bindToMotionValue(s, n)), Ts.current || Qo(), this.shouldReduceMotion = this.reducedMotionConfig === "never" ? !1 : this.reducedMotionConfig === "always" ? !0 : tt.current, process.env.NODE_ENV !== "production" && Me(this.shouldReduceMotion !== !0, "You have Reduced Motion enabled on your device. Animations may not appear as expected."), this.parent && this.parent.children.add(this), this.update(this.props, this.presenceContext);
|
|
3010
|
+
}
|
|
3011
|
+
unmount() {
|
|
3012
|
+
cn.delete(this.current), this.projection && this.projection.unmount(), We(this.notifyUpdate), We(this.render), this.valueSubscriptions.forEach((e) => e()), this.valueSubscriptions.clear(), this.removeFromVariantTree && this.removeFromVariantTree(), this.parent && this.parent.children.delete(this);
|
|
3013
|
+
for (const e in this.events)
|
|
3014
|
+
this.events[e].clear();
|
|
3015
|
+
for (const e in this.features) {
|
|
3016
|
+
const n = this.features[e];
|
|
3017
|
+
n && (n.unmount(), n.isMounted = !1);
|
|
3018
|
+
}
|
|
3019
|
+
this.current = null;
|
|
3020
|
+
}
|
|
3021
|
+
bindToMotionValue(e, n) {
|
|
3022
|
+
this.valueSubscriptions.has(e) && this.valueSubscriptions.get(e)();
|
|
3023
|
+
const s = z.has(e), i = n.on("change", (a) => {
|
|
3024
|
+
this.latestValues[e] = a, this.props.onUpdate && R.preRender(this.notifyUpdate), s && this.projection && (this.projection.isTransformDirty = !0);
|
|
3025
|
+
}), r = n.on("renderRequest", this.scheduleRender);
|
|
3026
|
+
let o;
|
|
3027
|
+
window.MotionCheckAppearSync && (o = window.MotionCheckAppearSync(this, e, n)), this.valueSubscriptions.set(e, () => {
|
|
3028
|
+
i(), r(), o && o(), n.owner && n.stop();
|
|
3029
|
+
});
|
|
3030
|
+
}
|
|
3031
|
+
sortNodePosition(e) {
|
|
3032
|
+
return !this.current || !this.sortInstanceNodePosition || this.type !== e.type ? 0 : this.sortInstanceNodePosition(this.current, e.current);
|
|
3033
|
+
}
|
|
3034
|
+
updateFeatures() {
|
|
3035
|
+
let e = "animation";
|
|
3036
|
+
for (e in ee) {
|
|
3037
|
+
const n = ee[e];
|
|
3038
|
+
if (!n)
|
|
3039
|
+
continue;
|
|
3040
|
+
const { isEnabled: s, Feature: i } = n;
|
|
3041
|
+
if (!this.features[e] && i && s(this.props) && (this.features[e] = new i(this)), this.features[e]) {
|
|
3042
|
+
const r = this.features[e];
|
|
3043
|
+
r.isMounted ? r.update() : (r.mount(), r.isMounted = !0);
|
|
3044
|
+
}
|
|
3045
|
+
}
|
|
3046
|
+
}
|
|
3047
|
+
triggerBuild() {
|
|
3048
|
+
this.build(this.renderState, this.latestValues, this.props);
|
|
3049
|
+
}
|
|
3050
|
+
/**
|
|
3051
|
+
* Measure the current viewport box with or without transforms.
|
|
3052
|
+
* Only measures axis-aligned boxes, rotate and skew must be manually
|
|
3053
|
+
* removed with a re-render to work.
|
|
3054
|
+
*/
|
|
3055
|
+
measureViewportBox() {
|
|
3056
|
+
return this.current ? this.measureInstanceViewportBox(this.current, this.props) : is();
|
|
3057
|
+
}
|
|
3058
|
+
getStaticValue(e) {
|
|
3059
|
+
return this.latestValues[e];
|
|
3060
|
+
}
|
|
3061
|
+
setStaticValue(e, n) {
|
|
3062
|
+
this.latestValues[e] = n;
|
|
3063
|
+
}
|
|
3064
|
+
/**
|
|
3065
|
+
* Update the provided props. Ensure any newly-added motion values are
|
|
3066
|
+
* added to our map, old ones removed, and listeners updated.
|
|
3067
|
+
*/
|
|
3068
|
+
update(e, n) {
|
|
3069
|
+
(e.transformTemplate || this.props.transformTemplate) && this.scheduleRender(), this.prevProps = this.props, this.props = e, this.prevPresenceContext = this.presenceContext, this.presenceContext = n;
|
|
3070
|
+
for (let s = 0; s < dn.length; s++) {
|
|
3071
|
+
const i = dn[s];
|
|
3072
|
+
this.propEventSubscriptions[i] && (this.propEventSubscriptions[i](), delete this.propEventSubscriptions[i]);
|
|
3073
|
+
const r = "on" + i, o = e[r];
|
|
3074
|
+
o && (this.propEventSubscriptions[i] = this.on(i, o));
|
|
3075
|
+
}
|
|
3076
|
+
this.prevMotionValues = ea(this, this.scrapeMotionValuesFromProps(e, this.prevProps, this), this.prevMotionValues), this.handleChildMotionValue && this.handleChildMotionValue();
|
|
3077
|
+
}
|
|
3078
|
+
getProps() {
|
|
3079
|
+
return this.props;
|
|
3080
|
+
}
|
|
3081
|
+
/**
|
|
3082
|
+
* Returns the variant definition with a given name.
|
|
3083
|
+
*/
|
|
3084
|
+
getVariant(e) {
|
|
3085
|
+
return this.props.variants ? this.props.variants[e] : void 0;
|
|
3086
|
+
}
|
|
3087
|
+
/**
|
|
3088
|
+
* Returns the defined default transition on this component.
|
|
3089
|
+
*/
|
|
3090
|
+
getDefaultTransition() {
|
|
3091
|
+
return this.props.transition;
|
|
3092
|
+
}
|
|
3093
|
+
getTransformPagePoint() {
|
|
3094
|
+
return this.props.transformPagePoint;
|
|
3095
|
+
}
|
|
3096
|
+
getClosestVariantNode() {
|
|
3097
|
+
return this.isVariantNode ? this : this.parent ? this.parent.getClosestVariantNode() : void 0;
|
|
3098
|
+
}
|
|
3099
|
+
/**
|
|
3100
|
+
* Add a child visual element to our set of children.
|
|
3101
|
+
*/
|
|
3102
|
+
addVariantChild(e) {
|
|
3103
|
+
const n = this.getClosestVariantNode();
|
|
3104
|
+
if (n)
|
|
3105
|
+
return n.variantChildren && n.variantChildren.add(e), () => n.variantChildren.delete(e);
|
|
3106
|
+
}
|
|
3107
|
+
/**
|
|
3108
|
+
* Add a motion value and bind it to this visual element.
|
|
3109
|
+
*/
|
|
3110
|
+
addValue(e, n) {
|
|
3111
|
+
const s = this.values.get(e);
|
|
3112
|
+
n !== s && (s && this.removeValue(e), this.bindToMotionValue(e, n), this.values.set(e, n), this.latestValues[e] = n.get());
|
|
3113
|
+
}
|
|
3114
|
+
/**
|
|
3115
|
+
* Remove a motion value and unbind any active subscriptions.
|
|
3116
|
+
*/
|
|
3117
|
+
removeValue(e) {
|
|
3118
|
+
this.values.delete(e);
|
|
3119
|
+
const n = this.valueSubscriptions.get(e);
|
|
3120
|
+
n && (n(), this.valueSubscriptions.delete(e)), delete this.latestValues[e], this.removeValueFromRenderState(e, this.renderState);
|
|
3121
|
+
}
|
|
3122
|
+
/**
|
|
3123
|
+
* Check whether we have a motion value for this key
|
|
3124
|
+
*/
|
|
3125
|
+
hasValue(e) {
|
|
3126
|
+
return this.values.has(e);
|
|
3127
|
+
}
|
|
3128
|
+
getValue(e, n) {
|
|
3129
|
+
if (this.props.values && this.props.values[e])
|
|
3130
|
+
return this.props.values[e];
|
|
3131
|
+
let s = this.values.get(e);
|
|
3132
|
+
return s === void 0 && n !== void 0 && (s = Se(n === null ? void 0 : n, { owner: this }), this.addValue(e, s)), s;
|
|
3133
|
+
}
|
|
3134
|
+
/**
|
|
3135
|
+
* If we're trying to animate to a previously unencountered value,
|
|
3136
|
+
* we need to check for it in our state and as a last resort read it
|
|
3137
|
+
* directly from the instance (which might have performance implications).
|
|
3138
|
+
*/
|
|
3139
|
+
readValue(e, n) {
|
|
3140
|
+
var s;
|
|
3141
|
+
let i = this.latestValues[e] !== void 0 || !this.current ? this.latestValues[e] : (s = this.getBaseTargetFromProps(this.props, e)) !== null && s !== void 0 ? s : this.readValueFromInstance(this.current, e, this.options);
|
|
3142
|
+
return i != null && (typeof i == "string" && (An(i) || xn(i)) ? i = parseFloat(i) : !na(i) && ie.test(n) && (i = Bn(e, n)), this.setBaseTarget(e, F(i) ? i.get() : i)), F(i) ? i.get() : i;
|
|
3143
|
+
}
|
|
3144
|
+
/**
|
|
3145
|
+
* Set the base target to later animate back to. This is currently
|
|
3146
|
+
* only hydrated on creation and when we first read a value.
|
|
3147
|
+
*/
|
|
3148
|
+
setBaseTarget(e, n) {
|
|
3149
|
+
this.baseTarget[e] = n;
|
|
3150
|
+
}
|
|
3151
|
+
/**
|
|
3152
|
+
* Find the base target for a value thats been removed from all animation
|
|
3153
|
+
* props.
|
|
3154
|
+
*/
|
|
3155
|
+
getBaseTarget(e) {
|
|
3156
|
+
var n;
|
|
3157
|
+
const { initial: s } = this.props;
|
|
3158
|
+
let i;
|
|
3159
|
+
if (typeof s == "string" || typeof s == "object") {
|
|
3160
|
+
const o = st(this.props, s, (n = this.presenceContext) === null || n === void 0 ? void 0 : n.custom);
|
|
3161
|
+
o && (i = o[e]);
|
|
3162
|
+
}
|
|
3163
|
+
if (s && i !== void 0)
|
|
3164
|
+
return i;
|
|
3165
|
+
const r = this.getBaseTargetFromProps(this.props, e);
|
|
3166
|
+
return r !== void 0 && !F(r) ? r : this.initialValues[e] !== void 0 && i === void 0 ? void 0 : this.baseTarget[e];
|
|
3167
|
+
}
|
|
3168
|
+
on(e, n) {
|
|
3169
|
+
return this.events[e] || (this.events[e] = new Jn()), this.events[e].add(n);
|
|
3170
|
+
}
|
|
3171
|
+
notify(e, ...n) {
|
|
3172
|
+
this.events[e] && this.events[e].notify(...n);
|
|
3173
|
+
}
|
|
3174
|
+
}
|
|
3175
|
+
class Vs extends sa {
|
|
3176
|
+
constructor() {
|
|
3177
|
+
super(...arguments), this.KeyframeResolver = Kn;
|
|
3178
|
+
}
|
|
3179
|
+
sortInstanceNodePosition(e, n) {
|
|
3180
|
+
return e.compareDocumentPosition(n) & 2 ? 1 : -1;
|
|
3181
|
+
}
|
|
3182
|
+
getBaseTargetFromProps(e, n) {
|
|
3183
|
+
return e.style ? e.style[n] : void 0;
|
|
3184
|
+
}
|
|
3185
|
+
removeValueFromRenderState(e, { vars: n, style: s }) {
|
|
3186
|
+
delete n[e], delete s[e];
|
|
3187
|
+
}
|
|
3188
|
+
handleChildMotionValue() {
|
|
3189
|
+
this.childSubscription && (this.childSubscription(), delete this.childSubscription);
|
|
3190
|
+
const { children: e } = this.props;
|
|
3191
|
+
F(e) && (this.childSubscription = e.on("change", (n) => {
|
|
3192
|
+
this.current && (this.current.textContent = `${n}`);
|
|
3193
|
+
}));
|
|
3194
|
+
}
|
|
3195
|
+
}
|
|
3196
|
+
function ia(t) {
|
|
3197
|
+
return window.getComputedStyle(t);
|
|
3198
|
+
}
|
|
3199
|
+
class ra extends Vs {
|
|
3200
|
+
constructor() {
|
|
3201
|
+
super(...arguments), this.type = "html", this.renderInstance = ds;
|
|
3202
|
+
}
|
|
3203
|
+
readValueFromInstance(e, n) {
|
|
3204
|
+
if (z.has(n)) {
|
|
3205
|
+
const s = ht(n);
|
|
3206
|
+
return s && s.default || 0;
|
|
3207
|
+
} else {
|
|
3208
|
+
const s = ia(e), i = (Cn(n) ? s.getPropertyValue(n) : s[n]) || 0;
|
|
3209
|
+
return typeof i == "string" ? i.trim() : i;
|
|
3210
|
+
}
|
|
3211
|
+
}
|
|
3212
|
+
measureInstanceViewportBox(e, { transformPagePoint: n }) {
|
|
3213
|
+
return Xr(e, n);
|
|
3214
|
+
}
|
|
3215
|
+
build(e, n, s) {
|
|
3216
|
+
Mt(e, n, s.transformTemplate);
|
|
3217
|
+
}
|
|
3218
|
+
scrapeMotionValuesFromProps(e, n, s) {
|
|
3219
|
+
return xt(e, n, s);
|
|
3220
|
+
}
|
|
3221
|
+
}
|
|
3222
|
+
class oa extends Vs {
|
|
3223
|
+
constructor() {
|
|
3224
|
+
super(...arguments), this.type = "svg", this.isSVGTag = !1, this.measureInstanceViewportBox = is;
|
|
3225
|
+
}
|
|
3226
|
+
getBaseTargetFromProps(e, n) {
|
|
3227
|
+
return e[n];
|
|
3228
|
+
}
|
|
3229
|
+
readValueFromInstance(e, n) {
|
|
3230
|
+
if (z.has(n)) {
|
|
3231
|
+
const s = ht(n);
|
|
3232
|
+
return s && s.default || 0;
|
|
3233
|
+
}
|
|
3234
|
+
return n = fs.has(n) ? n : wt(n), e.getAttribute(n);
|
|
3235
|
+
}
|
|
3236
|
+
scrapeMotionValuesFromProps(e, n, s) {
|
|
3237
|
+
return ms(e, n, s);
|
|
3238
|
+
}
|
|
3239
|
+
build(e, n, s) {
|
|
3240
|
+
Ct(e, n, this.isSVGTag, s.transformTemplate);
|
|
3241
|
+
}
|
|
3242
|
+
renderInstance(e, n, s, i) {
|
|
3243
|
+
hs(e, n, s, i);
|
|
3244
|
+
}
|
|
3245
|
+
mount(e) {
|
|
3246
|
+
this.isSVGTag = Pt(e.tagName), super.mount(e);
|
|
3247
|
+
}
|
|
3248
|
+
}
|
|
3249
|
+
const aa = (t, e) => St(t) ? new oa(e) : new ra(e, {
|
|
3250
|
+
allowProjection: t !== hn
|
|
3251
|
+
}), la = /* @__PURE__ */ Jo(), ua = /* @__PURE__ */ ks(la);
|
|
3252
|
+
function ca({ children: t, features: e, strict: n = !1 }) {
|
|
3253
|
+
const [, s] = Ps(!$e(e)), i = Z(void 0);
|
|
3254
|
+
if (!$e(e)) {
|
|
3255
|
+
const { renderer: r, ...o } = e;
|
|
3256
|
+
i.current = r, et(o);
|
|
3257
|
+
}
|
|
3258
|
+
return nt(() => {
|
|
3259
|
+
$e(e) && e().then(({ renderer: r, ...o }) => {
|
|
3260
|
+
et(o), i.current = r, s(!0);
|
|
3261
|
+
});
|
|
3262
|
+
}, []), E(Vt.Provider, { value: { renderer: i.current, strict: n }, children: t });
|
|
3263
|
+
}
|
|
3264
|
+
function $e(t) {
|
|
3265
|
+
return typeof t == "function";
|
|
3266
|
+
}
|
|
3267
|
+
const da = {
|
|
3268
|
+
renderer: aa,
|
|
3269
|
+
...Gr,
|
|
3270
|
+
...bo
|
|
3271
|
+
}, fa = Fs(ua.div)`
|
|
3272
|
+
${({ theme: t }) => `
|
|
3273
|
+
background-color: ${t.palette.white};
|
|
3274
|
+
box-shadow: ${t.shadows.lg};
|
|
3275
|
+
max-width: 350px;
|
|
3276
|
+
min-width: 350px;
|
|
3277
|
+
height: 100%;
|
|
3278
|
+
position: absolute;
|
|
3279
|
+
right: 0;
|
|
3280
|
+
top: 0;
|
|
3281
|
+
overflow: hidden auto;
|
|
3282
|
+
scrollbar-color: ${t.palette.gray[600]} ${t.palette.gray[100]};
|
|
3283
|
+
scroll-padding: ${t.spacing[0.5]};
|
|
3284
|
+
scrollbar-width: thin;
|
|
3285
|
+
z-index: 99999;
|
|
3286
|
+
|
|
3287
|
+
> div {
|
|
3288
|
+
border: 1px solid ${t.palette.gray[100]};
|
|
3289
|
+
width: auto;
|
|
3290
|
+
min-height: 100vh;
|
|
3291
|
+
height: auto;
|
|
3292
|
+
}
|
|
3293
|
+
`}
|
|
3294
|
+
`, Fa = ({
|
|
3295
|
+
children: t,
|
|
3296
|
+
closeIconId: e = "close-menu",
|
|
3297
|
+
isOpen: n,
|
|
3298
|
+
items: s,
|
|
3299
|
+
onClose: i,
|
|
3300
|
+
primaryButtonText: r,
|
|
3301
|
+
primaryOnClick: o,
|
|
3302
|
+
secondaryButtonText: a,
|
|
3303
|
+
secondaryOnClick: l,
|
|
3304
|
+
title: u
|
|
3305
|
+
}) => {
|
|
3306
|
+
const c = Ds(), f = Z(null), d = fn(
|
|
3307
|
+
(h) => () => {
|
|
3308
|
+
h(), i();
|
|
3309
|
+
},
|
|
3310
|
+
[i]
|
|
3311
|
+
);
|
|
3312
|
+
return Es(
|
|
3313
|
+
f.current,
|
|
3314
|
+
() => {
|
|
3315
|
+
i();
|
|
3316
|
+
},
|
|
3317
|
+
!0
|
|
3318
|
+
), /* @__PURE__ */ E(ca, { features: da, children: /* @__PURE__ */ E(
|
|
3319
|
+
fa,
|
|
3320
|
+
{
|
|
3321
|
+
animate: n ? {
|
|
3322
|
+
display: "block",
|
|
3323
|
+
x: 0
|
|
3324
|
+
} : {
|
|
3325
|
+
transitionEnd: {
|
|
3326
|
+
display: "none"
|
|
3327
|
+
},
|
|
3328
|
+
x: "100%"
|
|
3329
|
+
},
|
|
3330
|
+
initial: {
|
|
3331
|
+
display: "none",
|
|
3332
|
+
x: "100%"
|
|
3333
|
+
},
|
|
3334
|
+
ref: f,
|
|
3335
|
+
transition: {
|
|
3336
|
+
bounce: 0,
|
|
3337
|
+
duration: 0.6,
|
|
3338
|
+
type: "spring"
|
|
3339
|
+
},
|
|
3340
|
+
children: /* @__PURE__ */ Y(q, { height: "100%", position: "relative", children: [
|
|
3341
|
+
/* @__PURE__ */ Y(
|
|
3342
|
+
q,
|
|
3343
|
+
{
|
|
3344
|
+
alignItems: "center",
|
|
3345
|
+
bgColor: c.palette.white,
|
|
3346
|
+
borderBottom: "1px solid",
|
|
3347
|
+
borderColor: c.palette.gray[200],
|
|
3348
|
+
display: "flex",
|
|
3349
|
+
gap: 1.25,
|
|
3350
|
+
justify: "space-between",
|
|
3351
|
+
padding: [1.25, 1.25, 1.25, 1.25],
|
|
3352
|
+
position: "sticky",
|
|
3353
|
+
top: "0",
|
|
3354
|
+
zIndex: 40,
|
|
3355
|
+
children: [
|
|
3356
|
+
/* @__PURE__ */ E(
|
|
3357
|
+
Os,
|
|
3358
|
+
{
|
|
3359
|
+
color: c.palette.black,
|
|
3360
|
+
display: "inline",
|
|
3361
|
+
fontWeight: "bold",
|
|
3362
|
+
size: "xl",
|
|
3363
|
+
children: u
|
|
3364
|
+
}
|
|
3365
|
+
),
|
|
3366
|
+
/* @__PURE__ */ E(
|
|
3367
|
+
Is,
|
|
3368
|
+
{
|
|
3369
|
+
icon: "close",
|
|
3370
|
+
iconColor: c.palette.gray[400],
|
|
3371
|
+
iconSize: "xs",
|
|
3372
|
+
iconTransform: "grow-4",
|
|
3373
|
+
iconType: "fa-light",
|
|
3374
|
+
id: e,
|
|
3375
|
+
onClick: i,
|
|
3376
|
+
px: 0.25,
|
|
3377
|
+
py: 0.25,
|
|
3378
|
+
variant: "ghost"
|
|
3379
|
+
}
|
|
3380
|
+
)
|
|
3381
|
+
]
|
|
3382
|
+
}
|
|
3383
|
+
),
|
|
3384
|
+
/* @__PURE__ */ Y(
|
|
3385
|
+
q,
|
|
3386
|
+
{
|
|
3387
|
+
display: "flex",
|
|
3388
|
+
flexDirection: "column",
|
|
3389
|
+
justify: "space-between",
|
|
3390
|
+
minHeight: "100vh",
|
|
3391
|
+
children: [
|
|
3392
|
+
/* @__PURE__ */ Y(q, { py: 1.25, children: [
|
|
3393
|
+
(s ?? []).map(
|
|
3394
|
+
({
|
|
3395
|
+
customBadge: h,
|
|
3396
|
+
description: y,
|
|
3397
|
+
icon: v,
|
|
3398
|
+
onClick: b,
|
|
3399
|
+
requiresUpgrade: p,
|
|
3400
|
+
title: g
|
|
3401
|
+
}) => /* @__PURE__ */ E(
|
|
3402
|
+
Rs,
|
|
3403
|
+
{
|
|
3404
|
+
customBadge: h,
|
|
3405
|
+
description: y,
|
|
3406
|
+
icon: v,
|
|
3407
|
+
onClick: d(b),
|
|
3408
|
+
requiresUpgrade: p,
|
|
3409
|
+
title: g
|
|
3410
|
+
},
|
|
3411
|
+
g
|
|
3412
|
+
)
|
|
3413
|
+
),
|
|
3414
|
+
t && /* @__PURE__ */ E(q, { px: 1.25, children: t })
|
|
3415
|
+
] }),
|
|
3416
|
+
r === void 0 ? void 0 : /* @__PURE__ */ Y(
|
|
3417
|
+
q,
|
|
3418
|
+
{
|
|
3419
|
+
alignItems: "center",
|
|
3420
|
+
bgColor: c.palette.white,
|
|
3421
|
+
borderColor: c.palette.gray[200],
|
|
3422
|
+
borderTop: "1px solid",
|
|
3423
|
+
bottom: "0",
|
|
3424
|
+
display: "flex",
|
|
3425
|
+
gap: 1.25,
|
|
3426
|
+
justify: "end",
|
|
3427
|
+
padding: [1.25, 1.25, 1.25, 1.25],
|
|
3428
|
+
position: "sticky",
|
|
3429
|
+
width: "100%",
|
|
3430
|
+
zIndex: 40,
|
|
3431
|
+
children: [
|
|
3432
|
+
a === void 0 ? void 0 : /* @__PURE__ */ E(
|
|
3433
|
+
Rt,
|
|
3434
|
+
{
|
|
3435
|
+
color: `${c.palette.primary[500]} !important`,
|
|
3436
|
+
onClick: l,
|
|
3437
|
+
pl: 0.5,
|
|
3438
|
+
pr: 0.5,
|
|
3439
|
+
variant: "ghost",
|
|
3440
|
+
children: a
|
|
3441
|
+
}
|
|
3442
|
+
),
|
|
3443
|
+
/* @__PURE__ */ E(Rt, { onClick: o, type: "submit", children: r })
|
|
3444
|
+
]
|
|
3445
|
+
}
|
|
3446
|
+
)
|
|
3447
|
+
]
|
|
3448
|
+
}
|
|
3449
|
+
)
|
|
3450
|
+
] })
|
|
3451
|
+
}
|
|
3452
|
+
) });
|
|
3453
|
+
};
|
|
3454
|
+
export {
|
|
3455
|
+
Fa as SlideOutMenu
|
|
3456
|
+
};
|