motion-plus-vue 1.4.0 → 1.5.0-beta.1
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/cjs/index.js +2 -2
- package/dist/components/Carousel/Carousel.d.ts +28 -0
- package/dist/components/Carousel/CarouselView.d.ts +32 -0
- package/dist/components/Carousel/const.d.ts +3 -0
- package/dist/components/Carousel/context.d.ts +15 -0
- package/dist/components/Carousel/index.d.ts +3 -0
- package/dist/components/Carousel/utils/calc-current-page.d.ts +1 -0
- package/dist/components/Carousel/utils/calc-page-insets.d.ts +5 -0
- package/dist/components/Carousel/utils/find-current-index.d.ts +2 -0
- package/dist/components/Carousel/utils/find-next-page.d.ts +3 -0
- package/dist/components/Carousel/utils/find-prev-page.d.ts +3 -0
- package/dist/components/Cursor/Cursor.d.ts +2 -2
- package/dist/components/Ticker/DefaultTickerItem.d.ts +14 -0
- package/dist/components/Ticker/Ticker.d.ts +60 -5
- package/dist/components/Ticker/TickerItem.d.ts +59 -13
- package/dist/components/Ticker/const.d.ts +3 -0
- package/dist/components/Ticker/context.d.ts +4259 -2
- package/dist/components/Ticker/index.d.ts +1 -1
- package/dist/components/Ticker/types.d.ts +16 -1
- package/dist/components/Ticker/utils/layout-strategy.d.ts +2 -0
- package/dist/components/Typewriter/Typewriter.d.ts +1 -1
- package/dist/es/components/Carousel/Carousel.vue.mjs +79 -0
- package/dist/es/components/Carousel/Carousel.vue2.mjs +4 -0
- package/dist/es/components/Carousel/CarouselView.vue.mjs +115 -0
- package/dist/es/components/Carousel/CarouselView.vue2.mjs +4 -0
- package/dist/es/components/Carousel/const.mjs +13 -0
- package/dist/es/components/Carousel/context.mjs +6 -0
- package/dist/es/components/Carousel/utils/calc-current-page.mjs +13 -0
- package/dist/es/components/Carousel/utils/calc-page-insets.mjs +42 -0
- package/dist/es/components/Carousel/utils/find-current-index.mjs +13 -0
- package/dist/es/components/Carousel/utils/find-next-page.mjs +26 -0
- package/dist/es/components/Carousel/utils/find-prev-page.mjs +31 -0
- package/dist/es/components/Ticker/Ticker.vue.mjs +270 -111
- package/dist/es/components/Ticker/TickerItem.vue.mjs +68 -36
- package/dist/es/components/Ticker/const.mjs +12 -3
- package/dist/es/components/Ticker/context.mjs +5 -3
- package/dist/es/components/Ticker/utils/layout-strategy.mjs +57 -0
- package/dist/es/index.mjs +21 -16
- package/dist/es/utils/flatten-slots.mjs +22 -16
- package/dist/index.d.ts +1 -0
- package/package.json +3 -3
- package/dist/es/components/Ticker/use-item-offset.mjs +0 -12
- package/dist/es/components/Ticker/utils/get-cumulative-offset.mjs +0 -9
package/dist/cjs/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),r=require("motion-v"),ae=require("motion-plus-dom");function Be(n,{locales:t,format:o},i,s){const l=new Intl.NumberFormat(t,o).formatToParts(Number(n));i&&l.unshift({type:"prefix",value:i}),s&&l.push({type:"suffix",value:s});const d=[],y=[],h=[],x=[],c={},f=v=>`${v}:${c[v]=(c[v]??-1)+1}`;let u="",k=!1,g=!1,m=0;for(const v of l){u+=v.value;const p=v.type==="minusSign"||v.type==="plusSign"?"sign":v.type;switch(p){case"integer":k=!0,y.push(...v.value.split("").map(b=>({type:p,value:parseInt(b)})));break;case"group":y.push({type:p,value:v.value});break;case"decimal":g=!0,h.push({type:p,value:v.value,key:f(p),originalIndex:m++});break;case"fraction":h.push(...v.value.split("").map(b=>({type:p,value:parseInt(b),key:f(p),originalIndex:m++})));break;default:(k||g?x:d).push({type:p,value:v.value,key:f(p),originalIndex:m++})}}const C=[];for(let v=y.length-1;v>=0;v--){const p=f(y[v].type);C.unshift({...y[v],key:p,originalIndex:v})}return{pre:d,integer:C,fraction:h,post:x,formatted:u}}const[be,Se]=r.createContext("SectionContext");function ge(){const n={current:!0};return e.onMounted(()=>{n.current=!1}),n}function G(n){const{width:t,fontSize:o}=getComputedStyle(n);return`${parseFloat(t)/parseFloat(o)}em`}const P="var(--mask-height, 0.15em)",U="var(--mask-width, 0.5em)",_=`calc(${U} / var(--invert-x, 1))`,j="#000 0, transparent 71%",Ie=`linear-gradient(to right, transparent 0, #000 ${_}, #000 calc(100% - ${_}), transparent),linear-gradient(to bottom, transparent 0, #000 ${P}, #000 calc(100% - ${P}), transparent 100%),radial-gradient(at bottom right, ${j}),radial-gradient(at bottom left, ${j}), radial-gradient(at top left, ${j}), radial-gradient(at top right, ${j})`,Le=`100% calc(100% - ${P} * 2),calc(100% - ${_} * 2) 100%,${_} ${P},${_} ${P},${_} ${P},${_} ${P}`;r.addScaleCorrector({"--invert-x":{correct:(n,{treeScale:t,projectionDelta:o})=>o.x.scale*t.x}});const se={display:"flex",flexDirection:"column",alignItems:"center",position:"absolute",width:"100%"};function he(n){const t=e.ref();function o(s){t.value=s==null?void 0:s.$el}e.watch(()=>n.isPresent,s=>{var a;t.value&&((a=r.mountedStates.get(t.value))==null||a.setActive("exit",!s))});function i(s){var a;s.detail.isExit&&!n.isPresent&&((a=n.onRemove)==null||a.call(n,n.partKey,s.target))}return{root:t,getRoot:o,handleComplete:i}}const Te=e.defineComponent({__name:"NumberSymbol",props:{partKey:{},type:{},value:{},isPresent:{type:Boolean},onRemove:{type:Function},style:{},layoutDependency:{},preInitial:{type:Boolean}},setup(n){const t=n,{justify:o}=be(),{getRoot:i,handleComplete:s}=he(t);return(a,l)=>(e.openBlock(),e.createBlock(e.unref(r.motion).span,{ref:e.unref(i),layout:"position","layout-dependency":a.layoutDependency,"data-state":a.isPresent?void 0:"exiting",style:e.normalizeStyle({display:"inline-flex",justifyContent:e.unref(o),padding:`calc(${e.unref(P)}/2) 0`,position:"relative",pointerEvents:a.isPresent?void 0:"none"}),"aria-hidden":!a.isPresent,onMotioncomplete:e.unref(s)},{default:e.withCtx(()=>[e.createVNode(e.unref(r.AnimatePresence),{mode:"popLayout","anchor-x":e.unref(o),initial:a.preInitial},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.unref(r.motion).span,{key:a.value,layout:e.unref(o)==="right"?"position":!1,"layout-dependency":a.layoutDependency,initial:{opacity:0,left:e.unref(o)==="right"&&a.preInitial===void 0?"-100%":void 0},animate:{opacity:[null,1],left:0},exit:{opacity:[null,0],transition:{opacity:{duration:.4}}},style:{display:"inline-block",whiteSpace:"pre",position:"relative"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.value),1)]),_:1},8,["layout","layout-dependency","initial"]))]),_:1},8,["anchor-x","initial"])]),_:1},8,["layout-dependency","data-state","style","aria-hidden","onMotioncomplete"]))}}),Ee=new WeakMap,ze=e.defineComponent({__name:"NumberDigit",props:{value:{},initialValue:{default:void 0},isPresent:{type:Boolean},partKey:{},onRemove:{},style:{},layoutDependency:{}},setup(n){const t=n,o=t.initialValue??t.value,i=ge(),s=r.useMotionConfig(),a=e.ref(),l=e.ref(Array(10).fill(null)),d=e.ref(),{getRoot:y,handleComplete:h,root:x}=he(t);let c=o;const f=e.ref(o);e.watch([()=>t.value,()=>t.isPresent],([m,C])=>{if(!C)return f.value=0;if(i.current)return e.nextTick(()=>{f.value=m});f.value=m},{immediate:!0});function u(m){var b;if(!a.value||m===c)return;const C=a.value.getBoundingClientRect(),v=(b=x.value)==null?void 0:b.getBoundingClientRect(),p=C.height*(m-c)+(C.top-(v?v.top||0:C.top));r.animate(a.value,{y:[p,0]},s.value.transition)}function k(m){if(i.current&&o===m||!l.value[m])return;const C=G(l.value[m]);x.value&&(Ee.set(x.value,C),x.value.style.width=C),d.value=C}e.watch(f,m=>{k(m)},{immediate:!0,flush:"sync"}),e.watch(f,async(m,C,v)=>{await e.nextTick(),u(m),v(()=>{c=m})},{immediate:!0,flush:"sync"});function g(m){return()=>e.createVNode("span",{key:m,style:{display:"inline-block",padding:`calc(${P}/2) 0`},ref:C=>{l.value[m]=C}},[m])}return(m,C)=>(e.openBlock(),e.createBlock(e.unref(r.motion).span,{ref:e.unref(y),layout:"position","layout-dependency":m.layoutDependency,"data-state":m.isPresent?void 0:"exiting","data-key":m.partKey,style:e.normalizeStyle({display:"inline-flex",justifyContent:"center",width:d.value,pointerEvents:m.isPresent?void 0:"none"}),"aria-hidden":!m.isPresent,onMotioncomplete:e.unref(h)},{default:e.withCtx(()=>[e.createElementVNode("span",{ref_key:"scope",ref:a,style:{display:"inline-flex",justifyContent:"center",flexDirection:"column",alignItems:"center",position:"relative"}},[f.value!==0?(e.openBlock(),e.createElementBlock("span",{key:0,style:e.normalizeStyle({...e.unref(se),bottom:"100%",left:0})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,v=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(g(v-1)),{key:v-1}))),128))],4)):e.createCommentVNode("",!0),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(g(f.value)))),f.value!==9?(e.openBlock(),e.createElementBlock("span",{key:1,style:e.normalizeStyle({...e.unref(se),top:"100%",left:0})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(9-f.value,v=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(g(f.value+v)),{key:f.value+v}))),128))],4)):e.createCommentVNode("",!0)],512)]),_:1},8,["layout-dependency","data-state","data-key","style","aria-hidden","onMotioncomplete"]))}}),H=e.defineComponent({__name:"NumberSection",props:{parts:{},justify:{default:"left"},mode:{},name:{},style:{},layoutDependency:{}},setup(n){var x;const t=n,o=e.ref(),i=r.useDomRef(),s=e.ref(),a=ge(),l=e.ref(t.parts);let d=t.name==="pre"&&!((x=t.parts)!=null&&x.length)?void 0:!1;e.watch(()=>t.parts,c=>{const f=new Map(c.map(g=>[g.key,{...g,isPresent:!0}])),u=l.value.filter(g=>!f.get(g.key)).map(g=>({...g,isPresent:!1})),k=c.sort((g,m)=>g.originalIndex-m.originalIndex);l.value=u.concat(k)},{flush:"pre"}),e.watch(()=>{var c;return(c=t.parts)==null?void 0:c.map(f=>f.value).join("")},async(c,f)=>{if(await e.nextTick(),d=!1,!s.value)return;if(a.current){i.value&&(i.value.style.width=G(s.value));return}const u=Array.from(s.value.children).map(g=>{if(g instanceof HTMLElement&&g.dataset.state==="exiting"){const m=g.nextSibling;return g.remove(),()=>{s.value&&s.value.insertBefore(g,m)}}}),k=G(s.value);o.value=k;for(let g=u.length-1;g>=0;g--){const m=u[g];m&&m()}},{flush:"post"});const y=e.toRef(t,"justify");Se({justify:y});function h(c,f){var u;l.value=l.value.filter(k=>k.key!==c),(u=f==null?void 0:f.parentElement)==null||u.removeChild(f)}return(c,f)=>(e.openBlock(),e.createBlock(e.unref(r.motion).span,{ref:e.unref(i),class:e.normalizeClass(`number-section-${c.name}`),style:e.normalizeStyle({...c.style,display:"inline-flex",justifyContent:y.value,width:o.value}),layout:"position","layout-dependency":c.layoutDependency},{default:e.withCtx(()=>[e.createElementVNode("span",{ref_key:"measuredRef",ref:s,style:{display:"inline-flex",justifyContent:"inherit",position:"relative"}},[f[0]||(f[0]=e.createTextVNode(" ")),e.createVNode(e.unref(r.AnimatePresence),{mode:c.mode,"anchor-x":y.value,initial:!1},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value,u=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:u.key},[u.type==="integer"||u.type==="fraction"?(e.openBlock(),e.createBlock(ze,{key:u.key,"part-key":u.key,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},value:u.value,"is-present":u.isPresent??!0,"initial-value":e.unref(a).current?void 0:0,"layout-dependency":c.layoutDependency,onRemove:h},null,8,["part-key","value","is-present","initial-value","layout-dependency"])):(e.openBlock(),e.createBlock(Te,{key:u.type==="literal"?`${u.key}:${u.value}`:u.key,type:u.type,"part-key":u.key,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},value:u.value,"is-present":u.isPresent??!0,"pre-initial":e.unref(d),"layout-dependency":c.layoutDependency,onRemove:h},null,8,["type","part-key","value","is-present","pre-initial","layout-dependency"]))],64))),128))]),_:1},8,["mode","anchor-x"])],512)]),_:1},8,["class","style","layout-dependency"]))}}),Pe=e.defineComponent({__name:"Mask",props:{layoutDependency:{}},setup(n){return(t,o)=>(e.openBlock(),e.createBlock(e.unref(r.motion).span,{layout:"","layout-dependency":t.layoutDependency,"aria-hidden":!0,style:e.normalizeStyle({display:"inline-flex","--invert-x":1,margin:`0 calc(-1*${e.unref(U)})`,padding:`calc(${e.unref(P)}/2) ${e.unref(U)}`,position:"relative",zIndex:-1,overflow:"clip",webkitMaskImage:e.unref(Ie),webkitMaskSize:e.unref(Le),webkitMaskPosition:"center, center, top left, top right, bottom right, bottom left",webkitMaskRepeat:"no-repeat"})},{default:e.withCtx(()=>[e.renderSlot(t.$slots,"default")]),_:3},8,["layout-dependency","style"]))}}),$e=e.defineComponent({name:"AnimateNumber",inheritAttrs:!1,__name:"AnimateNumber",props:{locales:{},format:{},transition:{},suffix:{},prefix:{},value:{},style:{},layoutDependency:{}},setup(n){const t={opacity:{duration:1,ease:r.easeOut},layout:{type:"spring",duration:1,bounce:0},y:{type:"spring",duration:1,bounce:0}},o=n,i=e.computed(()=>{const y=o.value;return Be(y,{locales:o.locales,format:o.format},o.prefix,o.suffix)}),s=r.useMotionConfig(),a=e.computed(()=>o.transition??s.value.transition??t);function l(){const{format:y,prefix:h,suffix:x,locales:c,value:f,layoutDependency:u,...k}=o;return k}const d=e.computed(()=>{if(o.layoutDependency!==void 0)return{layoutDependency:o.layoutDependency,value:o.value}});return(y,h)=>(e.openBlock(),e.createBlock(e.unref(r.LayoutGroup),null,{default:e.withCtx(()=>[e.createVNode(e.unref(r.MotionConfig),{transition:a.value},{default:e.withCtx(()=>[e.createVNode(e.unref(r.motion).div,e.mergeProps({...y.$attrs,...l()},{layout:"","layout-dependency":d.value,style:{lineHeight:"1",...y.style,display:"inline-flex",isolation:"isolate",whiteSpace:"nowrap"}}),{default:e.withCtx(()=>[e.createVNode(e.unref(r.motion).div,{layout:"","layout-dependency":d.value,"aria-label":i.value.formatted,style:{display:"inline-flex",direction:"ltr",isolation:"isolate",position:"relative",zIndex:-1}},{default:e.withCtx(()=>[e.createVNode(H,{"layout-dependency":d.value,style:e.normalizeStyle({padding:`calc(${e.unref(P)}/2) 0`}),"aria-hidden":!0,justify:"right",mode:"popLayout",parts:i.value.pre,name:"pre"},null,8,["layout-dependency","style","parts"]),e.createVNode(Pe,{"layout-dependency":d.value},{default:e.withCtx(()=>[e.createVNode(H,{"layout-dependency":d.value,justify:"right",parts:i.value.integer,name:"integer",mode:"popLayout"},null,8,["layout-dependency","parts"]),e.createVNode(H,{"layout-dependency":d.value,layout:"position",parts:i.value.fraction,name:"fraction",mode:"popLayout"},null,8,["layout-dependency","parts"])]),_:1},8,["layout-dependency"]),e.createVNode(H,{"layout-dependency":d.value,style:e.normalizeStyle({padding:`calc(${e.unref(P)}/2) 0`}),"aria-hidden":!0,layout:"position",mode:"popLayout",parts:i.value.post,name:"post"},null,8,["layout-dependency","style","parts"])]),_:1},8,["layout-dependency","aria-label"])]),_:1},16,["layout-dependency","style"])]),_:1},8,["transition"])]),_:1}))}}),Me=$e;function Ve(){const n=document.createElement("style");return n.textContent=`
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),s=require("motion-v"),ge=require("motion-plus-dom");function rt(o,{locales:t,format:n},a,i){const c=new Intl.NumberFormat(t,n).formatToParts(Number(o));a&&c.unshift({type:"prefix",value:a}),i&&c.push({type:"suffix",value:i});const l=[],p=[],y=[],m=[],u={},f=v=>`${v}:${u[v]=(u[v]??-1)+1}`;let d="",k=!1,x=!1,g=0;for(const v of c){d+=v.value;const h=v.type==="minusSign"||v.type==="plusSign"?"sign":v.type;switch(h){case"integer":k=!0,p.push(...v.value.split("").map(L=>({type:h,value:parseInt(L)})));break;case"group":p.push({type:h,value:v.value});break;case"decimal":x=!0,y.push({type:h,value:v.value,key:f(h),originalIndex:g++});break;case"fraction":y.push(...v.value.split("").map(L=>({type:h,value:parseInt(L),key:f(h),originalIndex:g++})));break;default:(k||x?m:l).push({type:h,value:v.value,key:f(h),originalIndex:g++})}}const w=[];for(let v=p.length-1;v>=0;v--){const h=f(p[v].type);w.unshift({...p[v],key:h,originalIndex:v})}return{pre:l,integer:w,fraction:y,post:m,formatted:d}}const[it,st]=s.createContext("SectionContext");function Xe(){const o={current:!0};return e.onMounted(()=>{o.current=!1}),o}function ye(o){const{width:t,fontSize:n}=getComputedStyle(o);return`${parseFloat(t)/parseFloat(n)}em`}const R="var(--mask-height, 0.15em)",ve="var(--mask-width, 0.5em)",H=`calc(${ve} / var(--invert-x, 1))`,ee="#000 0, transparent 71%",lt=`linear-gradient(to right, transparent 0, #000 ${H}, #000 calc(100% - ${H}), transparent),linear-gradient(to bottom, transparent 0, #000 ${R}, #000 calc(100% - ${R}), transparent 100%),radial-gradient(at bottom right, ${ee}),radial-gradient(at bottom left, ${ee}), radial-gradient(at top left, ${ee}), radial-gradient(at top right, ${ee})`,ut=`100% calc(100% - ${R} * 2),calc(100% - ${H} * 2) 100%,${H} ${R},${H} ${R},${H} ${R},${H} ${R}`;s.addScaleCorrector({"--invert-x":{correct:(o,{treeScale:t,projectionDelta:n})=>n.x.scale*t.x}});const $e={display:"flex",flexDirection:"column",alignItems:"center",position:"absolute",width:"100%"};function Ye(o){const t=e.ref();function n(i){t.value=i==null?void 0:i.$el}e.watch(()=>o.isPresent,i=>{var r;t.value&&((r=s.mountedStates.get(t.value))==null||r.setActive("exit",!i))});function a(i){var r;i.detail.isExit&&!o.isPresent&&((r=o.onRemove)==null||r.call(o,o.partKey,i.target))}return{root:t,getRoot:n,handleComplete:a}}const ct=e.defineComponent({__name:"NumberSymbol",props:{partKey:{},type:{},value:{},isPresent:{type:Boolean},onRemove:{type:Function},style:{},layoutDependency:{},preInitial:{type:Boolean}},setup(o){const t=o,{justify:n}=it(),{getRoot:a,handleComplete:i}=Ye(t);return(r,c)=>(e.openBlock(),e.createBlock(e.unref(s.motion).span,{ref:e.unref(a),layout:"position","layout-dependency":r.layoutDependency,"data-state":r.isPresent?void 0:"exiting",style:e.normalizeStyle({display:"inline-flex",justifyContent:e.unref(n),padding:`calc(${e.unref(R)}/2) 0`,position:"relative",pointerEvents:r.isPresent?void 0:"none"}),"aria-hidden":!r.isPresent,onMotioncomplete:e.unref(i)},{default:e.withCtx(()=>[e.createVNode(e.unref(s.AnimatePresence),{mode:"popLayout","anchor-x":e.unref(n),initial:r.preInitial},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.unref(s.motion).span,{key:r.value,layout:e.unref(n)==="right"?"position":!1,"layout-dependency":r.layoutDependency,initial:{opacity:0,left:e.unref(n)==="right"&&r.preInitial===void 0?"-100%":void 0},animate:{opacity:[null,1],left:0},exit:{opacity:[null,0],transition:{opacity:{duration:.4}}},style:{display:"inline-block",whiteSpace:"pre",position:"relative"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(r.value),1)]),_:1},8,["layout","layout-dependency","initial"]))]),_:1},8,["anchor-x","initial"])]),_:1},8,["layout-dependency","data-state","style","aria-hidden","onMotioncomplete"]))}}),ft=new WeakMap,dt=e.defineComponent({__name:"NumberDigit",props:{value:{},initialValue:{default:void 0},isPresent:{type:Boolean},partKey:{},onRemove:{},style:{},layoutDependency:{}},setup(o){const t=o,n=t.initialValue??t.value,a=Xe(),i=s.useMotionConfig(),r=e.ref(),c=e.ref(Array(10).fill(null)),l=e.ref(),{getRoot:p,handleComplete:y,root:m}=Ye(t);let u=n;const f=e.ref(n);e.watch([()=>t.value,()=>t.isPresent],([g,w])=>{if(!w)return f.value=0;if(a.current)return e.nextTick(()=>{f.value=g});f.value=g},{immediate:!0});function d(g){var L;if(!r.value||g===u)return;const w=r.value.getBoundingClientRect(),v=(L=m.value)==null?void 0:L.getBoundingClientRect(),h=w.height*(g-u)+(w.top-(v?v.top||0:w.top));s.animate(r.value,{y:[h,0]},i.value.transition)}function k(g){if(a.current&&n===g||!c.value[g])return;const w=ye(c.value[g]);m.value&&(ft.set(m.value,w),m.value.style.width=w),l.value=w}e.watch(f,g=>{k(g)},{immediate:!0,flush:"sync"}),e.watch(f,async(g,w,v)=>{await e.nextTick(),d(g),v(()=>{u=g})},{immediate:!0,flush:"sync"});function x(g){return()=>e.createVNode("span",{key:g,style:{display:"inline-block",padding:`calc(${R}/2) 0`},ref:w=>{c.value[g]=w}},[g])}return(g,w)=>(e.openBlock(),e.createBlock(e.unref(s.motion).span,{ref:e.unref(p),layout:"position","layout-dependency":g.layoutDependency,"data-state":g.isPresent?void 0:"exiting","data-key":g.partKey,style:e.normalizeStyle({display:"inline-flex",justifyContent:"center",width:l.value,pointerEvents:g.isPresent?void 0:"none"}),"aria-hidden":!g.isPresent,onMotioncomplete:e.unref(y)},{default:e.withCtx(()=>[e.createElementVNode("span",{ref_key:"scope",ref:r,style:{display:"inline-flex",justifyContent:"center",flexDirection:"column",alignItems:"center",position:"relative"}},[f.value!==0?(e.openBlock(),e.createElementBlock("span",{key:0,style:e.normalizeStyle({...e.unref($e),bottom:"100%",left:0})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,v=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(x(v-1)),{key:v-1}))),128))],4)):e.createCommentVNode("",!0),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(x(f.value)))),f.value!==9?(e.openBlock(),e.createElementBlock("span",{key:1,style:e.normalizeStyle({...e.unref($e),top:"100%",left:0})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(9-f.value,v=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(x(f.value+v)),{key:f.value+v}))),128))],4)):e.createCommentVNode("",!0)],512)]),_:1},8,["layout-dependency","data-state","data-key","style","aria-hidden","onMotioncomplete"]))}}),te=e.defineComponent({__name:"NumberSection",props:{parts:{},justify:{default:"left"},mode:{},name:{},style:{},layoutDependency:{}},setup(o){var m;const t=o,n=e.ref(),a=s.useDomRef(),i=e.ref(),r=Xe(),c=e.ref(t.parts);let l=t.name==="pre"&&!((m=t.parts)!=null&&m.length)?void 0:!1;e.watch(()=>t.parts,u=>{const f=new Map(u.map(x=>[x.key,{...x,isPresent:!0}])),d=c.value.filter(x=>!f.get(x.key)).map(x=>({...x,isPresent:!1})),k=u.sort((x,g)=>x.originalIndex-g.originalIndex);c.value=d.concat(k)},{flush:"pre"}),e.watch(()=>{var u;return(u=t.parts)==null?void 0:u.map(f=>f.value).join("")},async(u,f)=>{if(await e.nextTick(),l=!1,!i.value)return;if(r.current){a.value&&(a.value.style.width=ye(i.value));return}const d=Array.from(i.value.children).map(x=>{if(x instanceof HTMLElement&&x.dataset.state==="exiting"){const g=x.nextSibling;return x.remove(),()=>{i.value&&i.value.insertBefore(x,g)}}}),k=ye(i.value);n.value=k;for(let x=d.length-1;x>=0;x--){const g=d[x];g&&g()}},{flush:"post"});const p=e.toRef(t,"justify");st({justify:p});function y(u,f){var d;c.value=c.value.filter(k=>k.key!==u),(d=f==null?void 0:f.parentElement)==null||d.removeChild(f)}return(u,f)=>(e.openBlock(),e.createBlock(e.unref(s.motion).span,{ref:e.unref(a),class:e.normalizeClass(`number-section-${u.name}`),style:e.normalizeStyle({...u.style,display:"inline-flex",justifyContent:p.value,width:n.value}),layout:"position","layout-dependency":u.layoutDependency},{default:e.withCtx(()=>[e.createElementVNode("span",{ref_key:"measuredRef",ref:i,style:{display:"inline-flex",justifyContent:"inherit",position:"relative"}},[f[0]||(f[0]=e.createTextVNode(" ")),e.createVNode(e.unref(s.AnimatePresence),{mode:u.mode,"anchor-x":p.value,initial:!1},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,d=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:d.key},[d.type==="integer"||d.type==="fraction"?(e.openBlock(),e.createBlock(dt,{key:d.key,"part-key":d.key,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},value:d.value,"is-present":d.isPresent??!0,"initial-value":e.unref(r).current?void 0:0,"layout-dependency":u.layoutDependency,onRemove:y},null,8,["part-key","value","is-present","initial-value","layout-dependency"])):(e.openBlock(),e.createBlock(ct,{key:d.type==="literal"?`${d.key}:${d.value}`:d.key,type:d.type,"part-key":d.key,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},value:d.value,"is-present":d.isPresent??!0,"pre-initial":e.unref(l),"layout-dependency":u.layoutDependency,onRemove:y},null,8,["type","part-key","value","is-present","pre-initial","layout-dependency"]))],64))),128))]),_:1},8,["mode","anchor-x"])],512)]),_:1},8,["class","style","layout-dependency"]))}}),pt=e.defineComponent({__name:"Mask",props:{layoutDependency:{}},setup(o){return(t,n)=>(e.openBlock(),e.createBlock(e.unref(s.motion).span,{layout:"","layout-dependency":t.layoutDependency,"aria-hidden":!0,style:e.normalizeStyle({display:"inline-flex","--invert-x":1,margin:`0 calc(-1*${e.unref(ve)})`,padding:`calc(${e.unref(R)}/2) ${e.unref(ve)}`,position:"relative",zIndex:-1,overflow:"clip",webkitMaskImage:e.unref(lt),webkitMaskSize:e.unref(ut),webkitMaskPosition:"center, center, top left, top right, bottom right, bottom left",webkitMaskRepeat:"no-repeat"})},{default:e.withCtx(()=>[e.renderSlot(t.$slots,"default")]),_:3},8,["layout-dependency","style"]))}}),mt=e.defineComponent({name:"AnimateNumber",inheritAttrs:!1,__name:"AnimateNumber",props:{locales:{},format:{},transition:{},suffix:{},prefix:{},value:{},style:{},layoutDependency:{}},setup(o){const t={opacity:{duration:1,ease:s.easeOut},layout:{type:"spring",duration:1,bounce:0},y:{type:"spring",duration:1,bounce:0}},n=o,a=e.computed(()=>{const p=n.value;return rt(p,{locales:n.locales,format:n.format},n.prefix,n.suffix)}),i=s.useMotionConfig(),r=e.computed(()=>n.transition??i.value.transition??t);function c(){const{format:p,prefix:y,suffix:m,locales:u,value:f,layoutDependency:d,...k}=n;return k}const l=e.computed(()=>{if(n.layoutDependency!==void 0)return{layoutDependency:n.layoutDependency,value:n.value}});return(p,y)=>(e.openBlock(),e.createBlock(e.unref(s.LayoutGroup),null,{default:e.withCtx(()=>[e.createVNode(e.unref(s.MotionConfig),{transition:r.value},{default:e.withCtx(()=>[e.createVNode(e.unref(s.motion).div,e.mergeProps({...p.$attrs,...c()},{layout:"","layout-dependency":l.value,style:{lineHeight:"1",...p.style,display:"inline-flex",isolation:"isolate",whiteSpace:"nowrap"}}),{default:e.withCtx(()=>[e.createVNode(e.unref(s.motion).div,{layout:"","layout-dependency":l.value,"aria-label":a.value.formatted,style:{display:"inline-flex",direction:"ltr",isolation:"isolate",position:"relative",zIndex:-1}},{default:e.withCtx(()=>[e.createVNode(te,{"layout-dependency":l.value,style:e.normalizeStyle({padding:`calc(${e.unref(R)}/2) 0`}),"aria-hidden":!0,justify:"right",mode:"popLayout",parts:a.value.pre,name:"pre"},null,8,["layout-dependency","style","parts"]),e.createVNode(pt,{"layout-dependency":l.value},{default:e.withCtx(()=>[e.createVNode(te,{"layout-dependency":l.value,justify:"right",parts:a.value.integer,name:"integer",mode:"popLayout"},null,8,["layout-dependency","parts"]),e.createVNode(te,{"layout-dependency":l.value,layout:"position",parts:a.value.fraction,name:"fraction",mode:"popLayout"},null,8,["layout-dependency","parts"])]),_:1},8,["layout-dependency"]),e.createVNode(te,{"layout-dependency":l.value,style:e.normalizeStyle({padding:`calc(${e.unref(R)}/2) 0`}),"aria-hidden":!0,layout:"position",mode:"popLayout",parts:a.value.post,name:"post"},null,8,["layout-dependency","style","parts"])]),_:1},8,["layout-dependency","aria-label"])]),_:1},16,["layout-dependency","style"])]),_:1},8,["transition"])]),_:1}))}}),gt=mt;function yt(){const o=document.createElement("style");return o.textContent=`
|
|
2
2
|
* {
|
|
3
3
|
cursor: none !important;
|
|
4
4
|
}
|
|
@@ -6,4 +6,4 @@
|
|
|
6
6
|
[data-motion-cursor="pointer"] {
|
|
7
7
|
background-color: #333;
|
|
8
8
|
}
|
|
9
|
-
`,document.head.appendChild(n),()=>{document.head.removeChild(n)}}function Ne(n){e.watch(n,(t,o,i)=>{const s=t?Ve():r.noop;return i(()=>{s()})},{immediate:!0,flush:"post"})}function ee(n){return t=>{t.pointerType==="mouse"&&n(t)}}function le(n){return ee(t=>{t.button===0&&n(t)})}let K,Z;function De(){K=r.motionValue(0),Z=r.motionValue(0);let n=0,t=0;function o(){K.set(n),Z.set(t)}typeof window<"u"&&window.addEventListener("pointermove",ee(i=>{n=i.clientX,t=i.clientY,r.frame.update(o)}))}function te(){return K||De(),{x:K,y:Z}}function Re(n,t){return{x:r.useTransform(()=>n.x.get()+t.value.x),y:r.useTransform(()=>n.y.get()+t.value.y)}}function _e(n){return n.closest("[data-cursor]")}function Fe(n){return n.closest('a, button, input[type="button"]:not(:disabled)')}function Oe(n){return window.getComputedStyle(n).userSelect==="none"?null:n.closest("p, textarea:not(:disabled), input[type='text']:not(:disabled), h1, h2, h3, h4, h5, h6")}function Ae(n){let t=_e(n);return t?[t.dataset.cursor,t]:(t=Fe(n),t?["pointer",t]:(t=Oe(n),t?["text",t]:["default",null]))}let Y=null,z={type:"default",isPressed:!1,fontSize:null,targetBoundingBox:null,target:null,zone:null};function je(n){let t=null;if("closest"in n){const o=n.closest("[data-cursor-zone]");o instanceof HTMLElement&&(t=o.dataset.cursorZone||null)}return t}function He(){if(typeof window>"u")return{onChange:()=>()=>{}};const n=new Set;function t(d){z={...z,...d},n.forEach(y=>y(z))}const o=le(()=>{z.isPressed||t({isPressed:!0})}),i=le(()=>{z.isPressed&&t({isPressed:!1})}),s=ee(({target:d})=>{if(!d)return;const[y,h]=Ae(d);let x=!1;const c={target:h,zone:je(d)};y!==z.type&&(c.type=y,x=!0),c.zone!==z.zone&&(z.zone=c.zone,x=!0);const f=y==="pointer"&&h?h.getBoundingClientRect():null;if(f!==z.targetBoundingBox&&(c.targetBoundingBox=f,x=!0),y==="text"){const{fontSize:u}=window.getComputedStyle(d),k=u?parseInt(u):null;k!==z.fontSize&&(c.fontSize=k,x=!0)}else z.fontSize&&(c.fontSize=null,x=!0);x&&t(c)});function a(){typeof window>"u"||(window.addEventListener("pointerover",s),window.addEventListener("pointerdown",o),window.addEventListener("pointerup",i))}function l(){window.removeEventListener("pointerover",s),window.removeEventListener("pointerdown",o),window.removeEventListener("pointerup",i)}return{onChange:d=>(n.size||a(),n.add(d),()=>{n.delete(d),n.size||l()})}}function We(){return Y||(Y=He()),Y}function ne(){const n=e.ref({...z});return e.watch(n,()=>We().onChange(t=>{n.value=t}),{immediate:!0,flush:"post"}),n}let q=null;function Ke(){const n=new Set;function t(){n.forEach(a=>a.show())}function o(){n.forEach(a=>a.hide())}function i(){document.body.addEventListener("mouseenter",t),document.body.addEventListener("mouseleave",o)}function s(){document.body.removeEventListener("mouseenter",t),document.body.removeEventListener("mouseleave",o)}return{on:a=>typeof window>"u"?r.noop:(n.size||i(),n.add(a),()=>{n.delete(a),n.size===0&&s()})}}function Xe(){return q||(q=Ke()),q}function xe(n){const t=e.ref(!0);return e.watch(t,()=>Xe().on({show:()=>{t.value||(n(),t.value=!0)},hide:()=>t.value=!1}),{immediate:!0}),t}const ue={x:0,y:0},Ye={x:.5,y:.5},qe={duration:0},Ge={stiffness:1e3,damping:100},Ue={duration:.15,ease:[.38,.12,.29,1]},ce={magneticOptions:{morph:!0,padding:5,snap:.8}},de=17,fe=31,pe=4,Ze=20;function W(n,t,o){const i={width:(o==null?void 0:o.width)??n,height:(o==null?void 0:o.height)??t};return typeof i.width=="number"&&(i.width=`${i.width}px`),typeof i.height=="number"&&(i.height=`${i.height}px`),i}function Je({type:n,state:t,hasChildren:o,style:i,isMagnetic:s,magneticOptions:a,matchTextSize:l}){const d=s&&t.targetBoundingBox;if(o&&!d)return W("auto","auto",i);const{padding:y,morph:h}=a;switch(n){case"pointer":if(s&&h&&t.targetBoundingBox){const{width:x,height:c}=t.targetBoundingBox;return{width:`${x+y*2}px`,height:`${c+y*2}px`}}return W(fe,fe,i);case"text":return l&&t.fontSize?{width:`${pe}px`,height:`${t.fontSize}px`}:W(pe,Ze,i);default:return W(de,de,i)}}function Qe({x:n,y:t},o){const i=e.ref(n.prev!==void 0||t.prev!==void 0);return e.watch(i,()=>{if(i.value)return;const s=()=>{i.value=!0,o(),a()},a=r.pipe(n.on("change",s),t.on("change",s));return()=>a()},{immediate:!0}),i}function et(n,t,o){return r.useTransform(()=>r.mix(n.value.get(),t.get(),o.get()))}function me(n,t,o){const i=r.useSpring(0,{stiffness:600,damping:50}),s=r.useMotionValue(0),a=et(n,i,s);return e.watch(()=>o==null?void 0:o.value,(l,d)=>{l?(!d&&!s.isAnimating()?i.jump(l):i.set(l),r.animate(s,t.value||0)):r.animate(s,0)},{immediate:!0,flush:"sync"}),a}function tt(n,t,o,i){const s=me(e.computed(()=>n.value.x),i,e.computed(()=>o.value.targetBoundingBox?o.value.targetBoundingBox.left+o.value.targetBoundingBox.width/2:void 0)),a=me(e.computed(()=>n.value.y),i,e.computed(()=>o.value.targetBoundingBox?o.value.targetBoundingBox.top+o.value.targetBoundingBox.height/2:void 0));return e.computed(()=>t.value?{x:s,y:a}:n.value)}const nt=e.defineComponent({name:"Cursor",inheritAttrs:!1,__name:"Cursor",props:{follow:{type:Boolean,default:!1},center:{default:({follow:n})=>n?ue:Ye},offset:{default:()=>ue},spring:{type:[Boolean,Object],default:({follow:n})=>n?Ge:!1},matchTextSize:{type:Boolean,default:!0},magnetic:{type:[Boolean,Object],default:!1},transition:{},variants:{},style:{},show:{type:Boolean,default:!0}},setup(n){const t=n,{offset:o,magnetic:i}=e.toRefs(t),s=r.useReducedMotion();Ne(()=>!s.value&&!t.follow);const a=te(),l=Re(a,o),d=r.useSpring(l.x,t.spring||void 0),y=r.useSpring(l.y,t.spring||void 0),h=e.computed(()=>typeof t.magnetic=="object"?{...ce.magneticOptions,...t.magnetic}:ce.magneticOptions);function x(){const p=l.x.on("change",L=>{d.jump(L),p()}),b=l.y.on("change",L=>{y.jump(L),b()})}const c=ne(),f=xe(x),u=tt(e.computed(()=>t.spring?{x:d,y}:a),e.computed(()=>!!i.value),c,e.computed(()=>h.value&&h.value.snap)),k=e.useSlots(),g=e.computed(()=>{var L,T;const p=(T=(L=k.default)==null?void 0:L.call(k))==null?void 0:T.filter(V=>V.type!==Symbol.for("v-cmt"));return Je({type:c.value.type,state:c.value,hasChildren:!!(p!=null&&p.length),isMagnetic:!!t.magnetic,style:t.style,magneticOptions:h.value,matchTextSize:t.matchTextSize})}),m=Qe(a,x);function C(p){return(b,L)=>`translate(-${p.x*100}%, -${p.y*100}%) ${L}`}function v(){const{follow:p,center:b,offset:L,spring:T,matchTextSize:V,magnetic:F,...O}=t;return O}return(p,b)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.unref(m)?(e.openBlock(),e.createBlock(e.unref(r.LayoutGroup),{key:0},{default:e.withCtx(()=>[e.createVNode(e.unref(r.MotionConfig),{transition:e.unref(s)?e.unref(qe):p.transition||e.unref(Ue)},{default:e.withCtx(()=>{var L,T;return[e.createVNode(e.unref(r.motion).div,e.mergeProps({layout:"","data-motion-cursor":p.follow?"follow":"pointer","data-framer-portal-id":"motion-cursor",initial:"exit",exit:"exit"},{...p.$attrs,...v()},{variants:{pressed:p.follow?{}:{scale:.9},...p.variants,default:{opacity:1,scale:1,...(L=p.variants)==null?void 0:L.default},exit:{opacity:0,scale:0,...(T=p.variants)==null?void 0:T.exit}},animate:["default",e.unref(c).type,e.unref(i)&&e.unref(c).targetBoundingBox?"magnetic":"",!e.unref(f)||!p.show?"exit":e.unref(c).isPressed?"pressed":""],"transform-template":C(p.center),style:{borderRadius:p.follow?0:20,zIndex:p.follow?99998:99999,willChange:"transform",contain:"layout",originX:p.center.x,originY:p.center.y,...p.style,width:g.value.width,height:g.value.height,x:e.unref(u).x,y:e.unref(u).y,top:0,left:0,position:"fixed",pointerEvents:"none"}}),{default:e.withCtx(()=>[e.createVNode(e.unref(r.AnimatePresence),null,{default:e.withCtx(()=>[e.renderSlot(p.$slots,"default")]),_:3})]),_:3},16,["data-motion-cursor","variants","animate","transform-template","style"])]}),_:3},8,["transition"])]),_:3})):e.createCommentVNode("",!0)]))}});function ye(n,t,o){const i=r.useMotionValue(0),s=r.useMotionValue(0),a=r.useMotionValue(0);return e.watch(()=>o==null?void 0:o.value,l=>{if(typeof l=="number"){r.animate(a,1);const d=()=>{s.set(t*(n.get()-l))};return d(),n.on("change",d)}else r.animate(a,0)},{immediate:!0,flush:"post"}),r.useTransform(()=>r.mix(i.get(),s.get(),a.get()))}function ot(n,t=.1){const o=ne(),i=te(),s=e.computed(()=>o.value.targetBoundingBox&&o.value.target===n.value),a=ye(i.x,t,e.computed(()=>s.value?o.value.targetBoundingBox.left+o.value.targetBoundingBox.width/2:void 0)),l=ye(i.y,t,e.computed(()=>s.value?o.value.targetBoundingBox.top+o.value.targetBoundingBox.height/2:void 0));return{x:a,y:l}}const[it,rt]=r.createContext("TickerItemContext"),J=e.defineComponent({__name:"TickerItem",props:{offset:{},axis:{},listSize:{},inset:{},bounds:{},itemIndex:{},cloneIndex:{},alignItems:{},itemSize:{default:"auto"}},setup(n){const t=n,o=r.useTransform(()=>{const l=t.offset.get(),{start:d,end:y}=t.bounds;return!d&&!y||!t.listSize?0:l+y<=-t.inset?t.listSize:0}),i=r.useTransform(()=>{const{start:l,end:d}=t.bounds,y=t.offset.get(),h=o.get();return!l&&!d||!t.listSize?0:y+l+h}),s=e.computed(()=>t.alignItems==="stretch"?"100%":"fit-content"),a=e.computed(()=>t.cloneIndex!==void 0);return rt({offset:i}),(l,d)=>(e.openBlock(),e.createBlock(e.unref(r.motion).li,e.mergeProps(l.$attrs,{class:l.cloneIndex===void 0?"ticker-item":"clone-item","aria-hidden":a.value?!0:void 0,style:{flexGrow:0,flexShrink:0,flexBasis:l.itemSize==="fill"?"100%":void 0,display:l.itemSize==="fill"?"flex":void 0,height:l.axis==="x"?s.value:void 0,width:l.axis==="y"?s.value:void 0,x:l.axis==="x"?e.unref(o):0,y:l.axis==="y"?e.unref(o):0}}),{default:e.withCtx(()=>[e.renderSlot(l.$slots,"default")]),_:3},16,["class","aria-hidden","style"]))}});function at(n,t,o,i,s){let a=!1;e.watch(n,(l,d,y)=>{if(!l)return;let h=!1;const x=new AbortController,c={signal:x.signal},f={...c,capture:!0},u=t.value==="x"?"scrollLeft":"scrollTop",k=t.value==="x"?"offsetLeft":"offsetTop",g=t.value==="x"?"ArrowLeft":"ArrowUp",m=t.value==="x"?"ArrowRight":"ArrowDown";let C=[],v=0;const p=async()=>{const w=C[v];w.focus(),await e.nextTick(),o.set(-w[k]),l[u]=0},b=w=>{if(w.key==="Tab"){w.preventDefault(),V();const B=Array.from(document.querySelectorAll('a, button, input, textarea, select, [tabindex]:not([tabindex="-1"]), [contenteditable="true"]')).filter(r.isHTMLElement);B.sort(st);const I=B[w.shiftKey?0:B.length-1],E=w.shiftKey?B.length-1:0;if(l.contains(I)){B[E].focus();return}else{const N=B.indexOf(C[v]),$=w.shiftKey?-1:1;for(let M=N;M<B.length&&M>=0;M+=$){const D=B[M];if(!l.contains(D)){D.focus();return}}}return}else w.key===g?v--:w.key===m&&v++;v=r.wrap(0,C.length,v),p()},L=()=>{a||(s(!0),a=!0,C=Array.from(l.querySelectorAll('.ticker-item a, .ticker-item button, .ticker-item input, .ticker-item textarea, .ticker-item select, .ticker-item [tabindex]:not([tabindex="-1"]), .ticker-item [contenteditable="true"]')).filter(r.isHTMLElement),v=0,p(),window.addEventListener("focus",T,f),window.addEventListener("blur",T,f),l.addEventListener("keydown",b,c))},T=w=>{(!w.target||!(w.target instanceof HTMLElement)||!l.contains(w.target))&&V()},V=()=>{a&&(a=!1,s(!1),i.value.set(o.get()),window.removeEventListener("focus",T),window.removeEventListener("blur",T),l.removeEventListener("keydown",b))},F=w=>{const{target:B}=w;r.isHTMLElement(B)&&(a||L())},O=()=>{h||(h=!0,l.addEventListener("focus",F,f),window.addEventListener("pointermove",A,c))},A=()=>{h&&(h=!1,l.removeEventListener("focus",F,!0),window.removeEventListener("pointermove",A,c))},S=w=>{const I=w.target.closest('[aria-hidden="true"]');I&&I.removeAttribute("aria-hidden")};window.addEventListener("keydown",O,c),l.addEventListener("pointerdown",S,c),y(()=>{x.abort(),V()})},{flush:"post"})}function st(n,t){return n.tabIndex>=1&&t.tabIndex>=1?n.tabIndex-t.tabIndex:n.tabIndex>=1&&t.tabIndex<=0?-1:t.tabIndex>=1&&n.tabIndex<=0?1:0}const ve={start:0,end:0},lt={start:"flex-start",end:"flex-end"};function ut(n){return n.end-n.start}function we(n){return n.length?n[n.length-1].end-n[0].start:0}function ct(n,t,o){const i=we(t),s=Math.max(...t.map(ut));let a=0,l=0;for(;l<n;)l=(i+o)*(a+1)-s,a++;return Math.max(a-1,0)}function dt(n=[]){const t=[];for(const o of n)o.type!==e.Comment&&t.push(o);return t}function Q(n){var o;const t=[];for(const i of n)if(i.type===e.Fragment){const s=Array.isArray(i.children)?i.children:(o=i.children)==null?void 0:o.default();t.push(...Q(s))}else t.push(i);return t}function ft(n,t){let o=0,i=n;for(;i;)o+=t==="x"?i.offsetLeft:i.offsetTop,i=i.offsetParent;return o}function pt(n){return typeof n=="function"||Object.prototype.toString.call(n)==="[object Object]"&&!e.isVNode(n)}const mt=e.defineComponent({__name:"Ticker",props:{axis:{default:"x"},style:{},velocity:{default:50},hoverFactor:{default:1},gap:{default:10},align:{default:"center"},offset:{},itemSize:{default:"auto"},overflow:{type:Boolean,default:!1}},setup(n){const t=n,o=e.reactive({visibleLength:0,inset:0,totalItemLength:0,itemPositions:[]}),i=e.computed(()=>lt[t.align]||t.align),s=e.useSlots(),a=e.computed(()=>{var S;return dt((S=s.default)==null?void 0:S.call(s))}),l=e.ref(!1),d=r.useMotionValue(1),y=r.useMotionValue(0),h=e.computed(()=>t.offset??y),x=r.useTransform(()=>r.wrap(-o.totalItemLength-t.gap-o.inset,-o.inset,h.value.get())),c=r.useMotionValue(0),f=e.computed(()=>l.value?c:x),u=r.useDomRef(),k=r.useDomRef(),g=r.useInView(u,{margin:"100px"}),m=r.usePageInView(),C=e.computed(()=>g.value&&m.value),v=r.useReducedMotion();function p(){if(!u.value||!k.value)return;const S=t.axis==="x"?"innerWidth":"innerHeight",w=t.axis==="x"?"offsetWidth":"offsetHeight",B=t.axis==="x"?"offsetLeft":"offsetTop",I=t.axis==="x"?"paddingLeft":"paddingTop",E=u.value,$=k.value.querySelectorAll(".ticker-item");if(!$.length)return;let M=!1;const D=[];for(let R=0;R<$.length;R++){const X=$[R];D.push({start:X[B],end:X[B]+X[w]}),(!o.itemPositions[R]||D[R].start!==o.itemPositions[R].start||D[R].end!==o.itemPositions[R].end)&&(M=!0)}const oe=t.overflow?window[S]:Math.min(E[w],window[S]),ie=we(D),ke=window.getComputedStyle(E),Ce=parseInt(ke[I]??"0"),re=t.overflow?ft($[0],t.axis):Ce;(oe!==o.visibleLength||ie!==o.totalItemLength||re!==o.inset||M)&&(o.visibleLength=oe,o.itemPositions=D,o.totalItemLength=ie,o.inset=re)}e.watch([a,C],(S,w,B)=>{if(!C.value||!u.value)return;p();const I=t.overflow?r.resize(p):void 0,E=r.resize(u.value,p);B(()=>{I==null||I(),E()})},{immediate:!0,flush:"post"});const b=e.computed(()=>o.totalItemLength>0);r.useAnimationFrame((S,w)=>{if(b.value&&C.value&&h.value===y&&!v.value){const B=w/1e3*(t.velocity*d.get());h.value.set(h.value.get()-B)}});const L=e.computed(()=>!b.value||!o.visibleLength?0:ct(o.visibleLength,o.itemPositions,t.gap)),T=e.computed(()=>o.totalItemLength===0?0:(o.totalItemLength+t.gap)*(L.value+1)),V=e.computed(()=>{const S=[];for(let w=0;w<L.value;w++)a.value.forEach((B,I)=>{let E;const N=o.itemPositions[I],$=(o.totalItemLength+t.gap)*(w+1),M=N?{start:N.start+$,end:N.end+$}:ve;S.push(e.createVNode(J,{key:`clone-${w}-${I}`,offset:f.value,axis:t.axis,listSize:T.value,cloneIndex:I,bounds:M,inset:o.inset,alignItems:i.value,itemSize:t.itemSize},pt(E=Q([B]))?E:{default:()=>[E]}))});return S}),F=e.toRef(t,"axis");at(u,F,c,h,S=>{l.value=S});const O={display:"flex",position:"relative"},A=e.computed(()=>({display:"flex",position:"relative",willChange:b.value&&C.value?"transform":void 0,listStyleType:"none",padding:0,margin:0,justifyContent:"flex-start",flexDirection:t.axis==="x"?"row":"column",gap:`${t.gap}px`,alignItems:i.value,x:t.axis==="x"?f.value:0,y:t.axis==="y"?f.value:0,opacity:b.value?1:0,width:"100%",height:"100%",maxHeight:"100%",maxWidth:"100%"}));return(S,w)=>(e.openBlock(),e.createBlock(e.unref(r.motion).div,e.mergeProps(S.$attrs,{ref_key:"containerRef",ref:u,style:{...O,...t.style,overflow:t.overflow?"visible":"hidden"},onPointerenter:w[0]||(w[0]=()=>{e.unref(r.animate)(e.unref(d),S.hoverFactor)}),onPointerleave:w[1]||(w[1]=()=>{e.unref(r.animate)(e.unref(d),1)})}),{default:e.withCtx(()=>[e.createVNode(e.unref(r.motion).ul,{ref_key:"listRef",ref:k,style:e.normalizeStyle(A.value)},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value,(B,I)=>(e.openBlock(),e.createBlock(J,{key:`original-${I}`,axis:F.value,offset:f.value,"list-size":T.value,"item-index":I,bounds:o.itemPositions[I]??e.unref(ve),inset:o.inset,"align-items":i.value,"item-size":S.itemSize},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(Q)([B]),(E,N)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(E),{key:N}))),128))]),_:2},1032,["axis","offset","list-size","item-index","bounds","inset","align-items","item-size"]))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(V.value,B=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(B),{key:B.key}))),128))]),_:1},8,["style"])]),_:1},16,["style"]))}});function yt(){const n=it(null);return r.invariant(!!n,"useItemOffset must be used within a TickerItem"),n==null?void 0:n.offset}const vt=mt,gt={slow:130,normal:75,fast:30},ht=e.defineComponent({__name:"Typewriter",props:e.mergeDefaults({as:{},speed:{},variance:{},play:{type:Boolean},cursorClassName:{},cursorStyle:{},textClassName:{},textStyle:{},cursorBlinkDuration:{},onComplete:{type:Function},replace:{},backspace:{},backspaceFactor:{}},{as:"span",speed:"normal",variance:"natural",cursorClassName:"motion-typewriter-cursor",play:!0,cursorBlinkDuration:.5,replace:"type",backspace:"character",backspaceFactor:.2}),setup(n){const t=n,o=e.useSlots();function i(){var k;return(((k=o==null?void 0:o.default)==null?void 0:k.call(o))??[]).map(g=>typeof g.children=="string"?g.children:"").join("")}let s=i();const a=r.useMotionValue("");e.watchEffect(()=>{const u=i();t.replace==="all"&&u!==s&&a.set(""),s=u});const l=e.ref();let d=null;const y=e.computed(()=>typeof t.speed=="number"?t.speed:gt[t.speed]);function h(){l.value&&(d=r.animate(l.value,{opacity:[1,1,0,0]},{duration:t.cursorBlinkDuration,times:[0,.5,.5,1],ease:"linear",repeat:1/0,repeatType:"reverse"}))}let x=null;function c(){x==null||x(),x=null}function f(){if(!t.play){h(),c();return}d==null||d.cancel();const u=i(),k=()=>{var C;const m=ae.getNextText(a.get(),u,t.replace,t.backspace);a.set(m),m!==u?g():(h(),(C=t.onComplete)==null||C.call(t))},g=()=>{x=r.delayInMs(k,ae.getTypewriterDelay(u,a.get(),y.value,t.variance,t.backspaceFactor))};x||g()}return e.watchEffect(u=>{f(),u(c)}),e.onMounted(()=>{f()}),(u,k)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.as),{"aria-label":e.unref(s)},{default:e.withCtx(()=>[e.createElementVNode("span",{class:e.normalizeClass(t.textClassName),style:e.normalizeStyle(t.textStyle)},[e.createVNode(e.unref(r.RowValue),{value:e.unref(a)},null,8,["value"])],6),e.createElementVNode("span",{ref_key:"cursorRef",ref:l,class:e.normalizeClass(t.cursorClassName),style:e.normalizeStyle({display:"inline-block",width:"2px",height:"1em",backgroundColor:"currentColor",position:"relative",top:"0.1em",left:"0.2em",...t.cursorStyle})},null,6)]),_:1},8,["aria-label"]))}});exports.AnimateNumber=Me;exports.Cursor=nt;exports.Ticker=vt;exports.TickerItem=J;exports.Typewriter=ht;exports.useCursorIsInView=xe;exports.useCursorState=ne;exports.useItemOffset=yt;exports.useMagneticPull=ot;exports.usePointerPosition=te;
|
|
9
|
+
`,document.head.appendChild(o),()=>{document.head.removeChild(o)}}function vt(o){e.watch(o,(t,n,a)=>{const i=t?yt():s.noop;return a(()=>{i()})},{immediate:!0,flush:"post"})}function Ce(o){return t=>{t.pointerType==="mouse"&&o(t)}}function Oe(o){return Ce(t=>{t.button===0&&o(t)})}let oe,he;function ht(){oe=s.motionValue(0),he=s.motionValue(0);let o=0,t=0;function n(){oe.set(o),he.set(t)}typeof window<"u"&&window.addEventListener("pointermove",Ce(a=>{o=a.clientX,t=a.clientY,s.frame.update(n)}))}function Se(){return oe||ht(),{x:oe,y:he}}function xt(o,t){return{x:s.useTransform(()=>o.x.get()+t.value.x),y:s.useTransform(()=>o.y.get()+t.value.y)}}function wt(o){return o.closest("[data-cursor]")}function kt(o){return o.closest('a, button, input[type="button"]:not(:disabled)')}function It(o){return window.getComputedStyle(o).userSelect==="none"?null:o.closest("p, textarea:not(:disabled), input[type='text']:not(:disabled), h1, h2, h3, h4, h5, h6")}function Ct(o){let t=wt(o);return t?[t.dataset.cursor,t]:(t=kt(o),t?["pointer",t]:(t=It(o),t?["text",t]:["default",null]))}let pe=null,D={type:"default",isPressed:!1,fontSize:null,targetBoundingBox:null,target:null,zone:null};function St(o){let t=null;if("closest"in o){const n=o.closest("[data-cursor-zone]");n instanceof HTMLElement&&(t=n.dataset.cursorZone||null)}return t}function bt(){if(typeof window>"u")return{onChange:()=>()=>{}};const o=new Set;function t(l){D={...D,...l},o.forEach(p=>p(D))}const n=Oe(()=>{D.isPressed||t({isPressed:!0})}),a=Oe(()=>{D.isPressed&&t({isPressed:!1})}),i=Ce(({target:l})=>{if(!l)return;const[p,y]=Ct(l);let m=!1;const u={target:y,zone:St(l)};p!==D.type&&(u.type=p,m=!0),u.zone!==D.zone&&(D.zone=u.zone,m=!0);const f=p==="pointer"&&y?y.getBoundingClientRect():null;if(f!==D.targetBoundingBox&&(u.targetBoundingBox=f,m=!0),p==="text"){const{fontSize:d}=window.getComputedStyle(l),k=d?parseInt(d):null;k!==D.fontSize&&(u.fontSize=k,m=!0)}else D.fontSize&&(u.fontSize=null,m=!0);m&&t(u)});function r(){typeof window>"u"||(window.addEventListener("pointerover",i),window.addEventListener("pointerdown",n),window.addEventListener("pointerup",a))}function c(){window.removeEventListener("pointerover",i),window.removeEventListener("pointerdown",n),window.removeEventListener("pointerup",a)}return{onChange:l=>(o.size||r(),o.add(l),()=>{o.delete(l),o.size||c()})}}function Bt(){return pe||(pe=bt()),pe}function be(){const o=e.ref({...D});return e.watch(o,()=>Bt().onChange(t=>{o.value=t}),{immediate:!0,flush:"post"}),o}let me=null;function Tt(){const o=new Set;function t(){o.forEach(r=>r.show())}function n(){o.forEach(r=>r.hide())}function a(){document.body.addEventListener("mouseenter",t),document.body.addEventListener("mouseleave",n)}function i(){document.body.removeEventListener("mouseenter",t),document.body.removeEventListener("mouseleave",n)}return{on:r=>typeof window>"u"?s.noop:(o.size||a(),o.add(r),()=>{o.delete(r),o.size===0&&i()})}}function Lt(){return me||(me=Tt()),me}function Ke(o){const t=e.ref(!0);return e.watch(t,()=>Lt().on({show:()=>{t.value||(o(),t.value=!0)},hide:()=>t.value=!1}),{immediate:!0}),t}const Ve={x:0,y:0},Pt={x:.5,y:.5},Et={duration:0},Mt={stiffness:1e3,damping:100},zt={duration:.15,ease:[.38,.12,.29,1]},Ne={magneticOptions:{morph:!0,padding:5,snap:.8}},De=17,Re=31,_e=4,$t=20;function ne(o,t,n){const a={width:(n==null?void 0:n.width)??o,height:(n==null?void 0:n.height)??t};return typeof a.width=="number"&&(a.width=`${a.width}px`),typeof a.height=="number"&&(a.height=`${a.height}px`),a}function Ot({type:o,state:t,hasChildren:n,style:a,isMagnetic:i,magneticOptions:r,matchTextSize:c}){const l=i&&t.targetBoundingBox;if(n&&!l)return ne("auto","auto",a);const{padding:p,morph:y}=r;switch(o){case"pointer":if(i&&y&&t.targetBoundingBox){const{width:m,height:u}=t.targetBoundingBox;return{width:`${m+p*2}px`,height:`${u+p*2}px`}}return ne(Re,Re,a);case"text":return c&&t.fontSize?{width:`${_e}px`,height:`${t.fontSize}px`}:ne(_e,$t,a);default:return ne(De,De,a)}}function Vt({x:o,y:t},n){const a=e.ref(o.prev!==void 0||t.prev!==void 0);return e.watch(a,()=>{if(a.value)return;const i=()=>{a.value=!0,n(),r()},r=s.pipe(o.on("change",i),t.on("change",i));return()=>r()},{immediate:!0}),a}function Nt(o,t,n){return s.useTransform(()=>s.mix(o.value.get(),t.get(),n.get()))}function Ae(o,t,n){const a=s.useSpring(0,{stiffness:600,damping:50}),i=s.useMotionValue(0),r=Nt(o,a,i);return e.watch(()=>n==null?void 0:n.value,(c,l)=>{c?(!l&&!i.isAnimating()?a.jump(c):a.set(c),s.animate(i,t.value||0)):s.animate(i,0)},{immediate:!0,flush:"sync"}),r}function Dt(o,t,n,a){const i=Ae(e.computed(()=>o.value.x),a,e.computed(()=>n.value.targetBoundingBox?n.value.targetBoundingBox.left+n.value.targetBoundingBox.width/2:void 0)),r=Ae(e.computed(()=>o.value.y),a,e.computed(()=>n.value.targetBoundingBox?n.value.targetBoundingBox.top+n.value.targetBoundingBox.height/2:void 0));return e.computed(()=>t.value?{x:i,y:r}:o.value)}const Rt=e.defineComponent({name:"Cursor",inheritAttrs:!1,__name:"Cursor",props:{follow:{type:Boolean,default:!1},center:{default:({follow:o})=>o?Ve:Pt},offset:{default:()=>Ve},spring:{type:[Boolean,Object],default:({follow:o})=>o?Mt:!1},matchTextSize:{type:Boolean,default:!0},magnetic:{type:[Boolean,Object],default:!1},transition:{},variants:{},style:{},show:{type:Boolean,default:!0}},setup(o){const t=o,{offset:n,magnetic:a}=e.toRefs(t),i=s.useReducedMotion();vt(()=>!i.value&&!t.follow);const r=Se(),c=xt(r,n),l=s.useSpring(c.x,t.spring||void 0),p=s.useSpring(c.y,t.spring||void 0),y=e.computed(()=>typeof t.magnetic=="object"?{...Ne.magneticOptions,...t.magnetic}:Ne.magneticOptions);function m(){const h=c.x.on("change",P=>{l.jump(P),h()}),L=c.y.on("change",P=>{p.jump(P),L()})}const u=be(),f=Ke(m),d=Dt(e.computed(()=>t.spring?{x:l,y:p}:r),e.computed(()=>!!a.value),u,e.computed(()=>y.value&&y.value.snap)),k=e.useSlots(),x=e.computed(()=>{var P,M;const h=(M=(P=k.default)==null?void 0:P.call(k))==null?void 0:M.filter(C=>C.type!==Symbol.for("v-cmt"));return Ot({type:u.value.type,state:u.value,hasChildren:!!(h!=null&&h.length),isMagnetic:!!t.magnetic,style:t.style,magneticOptions:y.value,matchTextSize:t.matchTextSize})}),g=Vt(r,m);function w(h){return(L,P)=>`translate(-${h.x*100}%, -${h.y*100}%) ${P}`}function v(){const{follow:h,center:L,offset:P,spring:M,matchTextSize:C,magnetic:z,...S}=t;return S}return(h,L)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.unref(g)?(e.openBlock(),e.createBlock(e.unref(s.LayoutGroup),{key:0},{default:e.withCtx(()=>[e.createVNode(e.unref(s.MotionConfig),{transition:e.unref(i)?e.unref(Et):h.transition||e.unref(zt)},{default:e.withCtx(()=>{var P,M;return[e.createVNode(e.unref(s.motion).div,e.mergeProps({layout:"","data-motion-cursor":h.follow?"follow":"pointer","data-framer-portal-id":"motion-cursor",initial:"exit",exit:"exit"},{...h.$attrs,...v()},{variants:{pressed:h.follow?{}:{scale:.9},...h.variants,default:{opacity:1,scale:1,...(P=h.variants)==null?void 0:P.default},exit:{opacity:0,scale:0,...(M=h.variants)==null?void 0:M.exit}},animate:["default",e.unref(u).type,e.unref(a)&&e.unref(u).targetBoundingBox?"magnetic":"",!e.unref(f)||!h.show?"exit":e.unref(u).isPressed?"pressed":""],"transform-template":w(h.center),style:{borderRadius:h.follow?0:20,zIndex:h.follow?99998:99999,willChange:"transform",contain:"layout",originX:h.center.x,originY:h.center.y,...h.style,width:x.value.width,height:x.value.height,x:e.unref(d).x,y:e.unref(d).y,top:0,left:0,position:"fixed",pointerEvents:"none"}}),{default:e.withCtx(()=>[e.createVNode(e.unref(s.AnimatePresence),null,{default:e.withCtx(()=>[e.renderSlot(h.$slots,"default")]),_:3})]),_:3},16,["data-motion-cursor","variants","animate","transform-template","style"])]}),_:3},8,["transition"])]),_:3})):e.createCommentVNode("",!0)]))}});function Fe(o,t,n){const a=s.useMotionValue(0),i=s.useMotionValue(0),r=s.useMotionValue(0);return e.watch(()=>n==null?void 0:n.value,c=>{if(typeof c=="number"){s.animate(r,1);const l=()=>{i.set(t*(o.get()-c))};return l(),o.on("change",l)}else s.animate(r,0)},{immediate:!0,flush:"post"}),s.useTransform(()=>s.mix(a.get(),i.get(),r.get()))}function _t(o,t=.1){const n=be(),a=Se(),i=e.computed(()=>n.value.targetBoundingBox&&n.value.target===o.value),r=Fe(a.x,t,e.computed(()=>i.value?n.value.targetBoundingBox.left+n.value.targetBoundingBox.width/2:void 0)),c=Fe(a.y,t,e.computed(()=>i.value?n.value.targetBoundingBox.top+n.value.targetBoundingBox.height/2:void 0));return{x:r,y:c}}const[At,Ft]=s.createContext("TickerItemContext"),[Be,jt]=s.createContext("TickerInfo");function Ge(o,t,n,a,i){return{sign:1,direction:i,lengthProp:t,viewportLengthProp:n,paddingStartProp:a,measureItem:r=>({start:r[o],end:r[o]+r[t]}),getCumulativeInset:r=>{let c=0,l=r;for(;l;)c+=l[o],l=l.offsetParent;return c}}}const qe=Ge("offsetLeft","offsetWidth","innerWidth","paddingLeft","right"),Ht=Ge("offsetTop","offsetHeight","innerHeight","paddingTop","bottom");function je(o,t){return((t==null?void 0:t.offsetWidth)??window.innerWidth)-(o.offsetLeft+o.offsetWidth)}const Wt={...qe,sign:-1,direction:"left",paddingStartProp:"paddingRight",measureItem:(o,t)=>{const n=o.offsetWidth,a=je(o,t);return{start:a,end:a+n}},getCumulativeInset:o=>{let t=0,n=o;for(;n;)t+=je(n,n.offsetParent),n=n.offsetParent;return t}};function G(o,t){return o==="y"?Ht:t==="ltr"?qe:Wt}const xe=e.defineComponent({__name:"TickerItem",props:{offset:{},axis:{},listSize:{default:0},bounds:{},numItems:{default:0},itemIndex:{},cloneIndex:{},alignItems:{},size:{default:"auto"},safeMargin:{},reproject:{type:Boolean,default:!0}},setup(o){const t=o,{state:n}=Be(),a=e.computed(()=>G(t.axis,n.direction).sign),i=s.useTransform(()=>{if(!t.reproject)return 0;const{offset:u,bounds:f,listSize:d,safeMargin:k}=t,{start:x,end:g}=f;if(!x&&!g||!d)return 0;const w=u.get();if(w*a.value+g<=-n.inset-k)return d*a.value;if(k>0){const v=n.visibleLength-k-n.inset;if(w*a.value+f.start>=v)return-d*a.value}return 0}),r=s.useTransform(()=>{const u=t.offset.get(),f=i.get();return!t.bounds.start&&!t.bounds.end||!t.listSize?0:u*a.value+t.bounds.start+f*a.value}),c=e.computed(()=>t.cloneIndex===void 0?{"aria-hidden":!1,"aria-posinset":t.itemIndex+1,"aria-setsize":t.numItems}:{"aria-hidden":!0}),l=e.computed(()=>{const u=t.size==="fill",f=t.alignItems==="stretch"?"100%":"fit-content";return{class:t.cloneIndex===void 0?"ticker-item":"clone-item",style:{flexGrow:0,flexShrink:0,position:"relative",flexBasis:u?"100%":void 0,display:u?"grid":void 0,gridTemplateColumns:u?"1fr":void 0,gridTemplateRows:u?"1fr":void 0,minWidth:u?0:void 0,minHeight:u?0:void 0,height:t.axis==="x"?f:void 0,width:t.axis==="y"?f:void 0,x:t.axis==="x"?i:0,y:t.axis==="y"?i:0},...c.value}}),{bounds:p,itemIndex:y,cloneIndex:m}=e.toRefs(t);return Ft({offset:r,bounds:p,projection:i,itemIndex:y,cloneIndex:m,props:l}),(u,f)=>u.size==="manual"?e.renderSlot(u.$slots,"default",{key:0}):(e.openBlock(),e.createBlock(e.unref(s.motion).li,e.normalizeProps(e.mergeProps({key:1},l.value)),{default:e.withCtx(()=>[e.renderSlot(u.$slots,"default")]),_:3},16))}});function Xt(o,t,n,a,i){let r=!1;e.watch(o,(c,l,p)=>{if(!c)return;let y=!1;const m=new AbortController,u={signal:m.signal},f={...u,capture:!0},d=t.value==="x"?"scrollLeft":"scrollTop",k=t.value==="x"?"offsetLeft":"offsetTop",x=t.value==="x"?"ArrowLeft":"ArrowUp",g=t.value==="x"?"ArrowRight":"ArrowDown";let w=[],v=0;const h=async()=>{const B=w[v];B.focus(),await e.nextTick(),n.set(-B[k]),c[d]=0},L=B=>{if(B.key==="Tab"){B.preventDefault(),C();const $=Array.from(document.querySelectorAll('a, button, input, textarea, select, [tabindex]:not([tabindex="-1"]), [contenteditable="true"]')).filter(s.isHTMLElement);$.sort(Yt);const A=$[B.shiftKey?0:$.length-1],Y=B.shiftKey?$.length-1:0;if(c.contains(A)){$[Y].focus();return}else{const q=$.indexOf(w[v]),ae=B.shiftKey?-1:1;for(let W=q;W<$.length&&W>=0;W+=ae){const X=$[W];if(!c.contains(X)){X.focus();return}}}return}else B.key===x?v--:B.key===g&&v++;v=s.wrap(0,w.length,v),h()},P=()=>{r||(i(!0),r=!0,w=Array.from(c.querySelectorAll('.ticker-item a, .ticker-item button, .ticker-item input, .ticker-item textarea, .ticker-item select, .ticker-item [tabindex]:not([tabindex="-1"]), .ticker-item [contenteditable="true"]')).filter(s.isHTMLElement),v=0,h(),window.addEventListener("focus",M,f),window.addEventListener("blur",M,f),c.addEventListener("keydown",L,u))},M=B=>{(!B.target||!(B.target instanceof HTMLElement)||!c.contains(B.target))&&C()},C=()=>{r&&(r=!1,i(!1),a.value.set(n.get()),window.removeEventListener("focus",M),window.removeEventListener("blur",M),c.removeEventListener("keydown",L))},z=B=>{const{target:$}=B;s.isHTMLElement($)&&(r||P())},S=()=>{y||(y=!0,c.addEventListener("focus",z,f),window.addEventListener("pointermove",V,u))},V=()=>{y&&(y=!1,c.removeEventListener("focus",z,!0),window.removeEventListener("pointermove",V,u))},j=B=>{const A=B.target.closest('[aria-hidden="true"]');A&&A.removeAttribute("aria-hidden")};window.addEventListener("keydown",S,u),c.addEventListener("pointerdown",j,u),p(()=>{m.abort(),C()})},{flush:"post"})}function Yt(o,t){return o.tabIndex>=1&&t.tabIndex>=1?o.tabIndex-t.tabIndex:o.tabIndex>=1&&t.tabIndex<=0?-1:t.tabIndex>=1&&o.tabIndex<=0?1:0}const He={start:0,end:0},Kt={start:"flex-start",end:"flex-end"},Gt={duration:.2,ease:"linear"},qt={type:"spring",stiffness:400,damping:40};function Ut(o){return o.end-o.start}function Ue(o){return o.length?o[o.length-1].end-o[0].start:0}function Zt(o,t,n){const a=Ue(t),i=Math.max(...t.map(Ut));let r=0,c=0;for(;c<o;)c=(a+n)*(r+1)-i,r++;return Math.max(r-1,0)}function Ze(o=[]){var n;const t=[];for(const a of o)if(a.type!==e.Comment)if(a.type===e.Fragment){const i=Array.isArray(a.children)?a.children:(n=a.children)==null?void 0:n.default();t.push(...Ze(i))}else t.push(a);return t}function we(o){var n;const t=[];for(const a of o)if(a.type===e.Fragment){const i=Array.isArray(a.children)?a.children:(n=a.children)==null?void 0:n.default();t.push(...we(i))}else t.push(a);return t}function Je(o,t,n){const a=Math.floor(o/n),i=a*n;let r=0;for(let c=0;c<t.length;c++){const{end:l}=t[c];if(r=c,l+i>o)break}return r+a*t.length}function ke(o,t,n,a){var u;if(t.length===0)return 0;const r=t[t.length-1].end+n,c=a??o+(((u=t[0])==null?void 0:u.end)??0);let p=Je(o,t,r)+1,y=0,m=!1;for(;!m;){const{start:f,end:d}=t[s.wrap(0,t.length,p)],x=Math.floor(p/t.length)*r;y=f+x,d+x>c?m=!0:p++}return y}function Jt(o,t,n,a){const i=o+t;return ke(o,n,a,i)}function Ie(o,t,n,a,i){if(t.length===0)return 0;const c=t[t.length-1].end+n,l=a??o-(i??0);let y=Je(o,t,c),m=o,u=!1;for(;!u;){const{start:f,end:d}=t[s.wrap(0,t.length,y)],k=d-f,g=Math.floor(y/t.length)*c,w=f+g;l<=w+n||w>=o?(m=w,y--):l<=w?(m=w,u=!0):((i&&k>i||m===o&&l>=w)&&(m=w),u=!0)}return m}function Qt(o,t,n,a){const i=o-t;return Ie(o,n,a,i,t)}function We(o){return typeof o=="function"||Object.prototype.toString.call(o)==="[object Object]"&&!e.isVNode(o)}const en=e.defineComponent({__name:"Ticker",props:{axis:{default:"x"},velocity:{default:50},hoverFactor:{default:1},gap:{default:10},align:{default:"center"},offset:{},itemSize:{default:"auto"},overflow:{type:Boolean,default:!1},loop:{type:Boolean,default:!0},safeMargin:{default:0},fade:{default:0},fadeTransition:{default:()=>Gt},pageTransition:{default:()=>qt},_dragX:{type:[Object,Boolean]},_dragY:{type:[Object,Boolean]},snap:{type:[String,Boolean]},as:{default:"div"},style:{},onDragEnd:{},drag:{type:[Boolean,String]},dragConstraints:{type:[Boolean,Object]},dragMomentum:{type:Boolean}},setup(o){const t=o,n=e.reactive({direction:"ltr",visibleLength:0,inset:0,totalItemLength:0,containerLength:0,itemPositions:[],isMeasured:!1,maxInset:null}),a=e.computed(()=>Kt[t.align]||t.align),i=e.computed(()=>G(t.axis,n.direction).sign),r=e.ref(!1),c=s.useMotionValue(1),l=s.useMotionValue(0),p=e.computed(()=>t.offset??l),y=s.useTransform(()=>n.direction==="rtl"?s.wrap(n.totalItemLength+t.gap+n.inset,n.inset,p.value.get()):s.wrap(-n.totalItemLength-t.gap-n.inset,-n.inset,p.value.get())),m=s.useMotionValue(0),u=e.computed(()=>r.value?m:t.loop?y:p.value),f=s.useDomRef(),d=s.useDomRef(),k=s.useInView(f,{margin:"100px"}),x=s.usePageInView(),g=e.computed(()=>k.value&&x.value),w=s.useReducedMotion(),v=e.useSlots(),h=e.computed(()=>{var I;return Ze((I=v.default)==null?void 0:I.call(v))});function L(){if(!f.value||!d.value)return;const I=window.getComputedStyle(f.value).direction,{measureItem:E,lengthProp:b,viewportLengthProp:T,getCumulativeInset:N}=G(t.axis,I),{safeMargin:O,overflow:_,loop:K}=t,U=S.value==="x"?"paddingLeft":"paddingTop",ie=S.value==="x"?"paddingRight":"paddingBottom",se=f.value,Z=d.value.querySelectorAll(".ticker-item");if(!Z.length)return;let Pe=!1;const J=[];for(let Q=0;Q<Z.length;Q++){const fe=E(Z[Q],se);J.push(fe);const de=n.itemPositions[Q];(!de||fe.start!==de.start||fe.end!==de.end)&&(Pe=!0)}const le=Math.min(se[b],window[T]);let ue=t.overflow?window[T]:le;O>0&&(ue+=O*2);const ce=Ue(J),Ee=window.getComputedStyle(se),Me=parseInt(Ee[U]??0),ot=parseInt(Ee[ie]??0),ze=_?N(Z[0]):Me,at=K===!1?Math.max(0,ce-le+Me+ot):null;(ue!==n.visibleLength||ce!==n.totalItemLength||ze!==n.inset||n.itemPositions.length!==J.length||Pe)&&(n.direction=I,n.visibleLength=ue,n.itemPositions=J,n.totalItemLength=ce,n.inset=ze,n.containerLength=le,n.maxInset=at,n.isMeasured=!0)}e.watch([h,g,()=>t.overflow],(I,E,b)=>{if(!g.value||!f.value)return;L();const T=t.overflow?s.resize(L):void 0,N=s.resize(f.value,L);b(()=>{T==null||T(),N()})},{immediate:!0,flush:"post"});const P=e.computed(()=>n.totalItemLength>0);s.useAnimationFrame((I,E)=>{if(P.value&&g.value&&p.value===l&&!w.value){const b=E/1e3*(t.velocity*i.value*c.get());p.value.set(p.value.get()-b)}});const M=e.computed(()=>!P.value||!n.visibleLength?0:Zt(n.visibleLength,n.itemPositions,t.gap)),C=e.computed(()=>n.totalItemLength===0?0:(n.totalItemLength+t.gap)*(M.value+1)),z=e.computed(()=>{if(!t.loop)return[];const I=[];for(let E=0;E<M.value;E++){const b=[];h.value.forEach((N,O)=>{let _;const K=n.itemPositions[O],U=(n.totalItemLength+t.gap)*(E+1),ie=K?{start:K.start+U,end:K.end+U}:He;b.push(e.createVNode(xe,{key:`clone-${E}-${O}`,offset:u.value,axis:t.axis,listSize:C.value,itemIndex:O,cloneIndex:O,bounds:ie,alignItems:a.value,size:t.itemSize,safeMargin:t.safeMargin,numItems:h.value.length},We(_=we([N]))?_:{default:()=>[_]}))});const T=`ticker-group-${E}`;I.push(e.createVNode(s.LayoutGroup,{key:T,id:T},We(b)?b:{default:()=>[b]}))}return I}),S=e.toRef(t,"axis");Xt(f,S,m,p,I=>{r.value=I});const V={display:"flex",position:"relative"},j={display:"flex",position:"relative",willChange:"transform",listStyleType:"none",padding:0,margin:0,justifyContent:"flex-start"};function B(I){return n.maxInset!==null?s.clamp(-n.maxInset,0,I):I}jt({state:n,gap:e.computed(()=>t.gap),clampOffset:B,renderedOffset:u});const $=e.computed(()=>t.axis==="x"?t==null?void 0:t._dragX:t==null?void 0:t._dragY);let A=null;const Y=e.computed(()=>n.maxInset!==null?S.value==="x"?i.value>0?{left:n.maxInset*-1,right:0}:{right:n.maxInset,left:0}:{top:n.maxInset*-1,bottom:0}:{});function q(){A&&(A.stop(),A=null)}const ae=e.computed(()=>!t.onDragEnd&&t.drag&&$?()=>{$.value.jump(p.value.get()),q()}:t.onPointerDown),W=e.computed(()=>!t.onDragEnd&&t.drag&&$?(I,{velocity:E})=>{const b=p.value.get();q(),s.frame.postRender(()=>{let T=b+E[S.value]*(t.snap?.3:.8);if(t.snap)if(E[S.value]<0)T=-ke(-b,n.itemPositions,t.gap,-T);else if(E[S.value]>0)T=-Ie(-b,n.itemPositions,t.gap,-T,n.containerLength);else{const O=-ke(-b,n.itemPositions,t.gap,-b),_=-Ie(-b,n.itemPositions,t.gap,-b,n.containerLength);T=Math.abs(b-O)<Math.abs(b-_)?O:_}const N=t.loop?{}:i.value>0?{max:0,min:Y.value[S.value==="x"?"left":"top"]}:{min:0,max:Y.value.right};A=s.animate($,B(T*i.value)*i.value,t.snap?t.pageTransition:{type:"inertia",velocity:E[S.value],modifyTarget:()=>T,bounceDamping:40,bounceStiffness:400,...N})})}:t.onDragEnd),X=s.useMotionValue(t.loop?0:1),re=s.useMotionValue(0),tt=e.computed(()=>G(S.value,n.direction)),Te=e.computed(()=>typeof t.fade=="number"?"px":""),Le=s.useTransform(()=>`linear-gradient(to ${tt.value.direction}, rgba(0,0,0,${X.get()}) 0px, black ${t.fade}${Te.value}, black calc(100% - ${t.fade}${Te.value}), rgba(0,0,0,${re.get()}) 100%)`),nt=e.computed(()=>t.fade?{maskImage:Le,WebkitMaskImage:Le}:{}),F={start:!0,end:!1};return e.watch(u,(I,E,b)=>{const T=O=>{if(n.maxInset===null)return;const _=n.maxInset*-1;O*=i.value,O<0?F.start&&(s.animate(X,0,t.fadeTransition),F.start=!1):F.start||(s.animate(X,1,t.fadeTransition),F.start=!0),O>_?F.end&&(s.animate(re,0,t.fadeTransition),F.end=!1):F.end||(s.animate(re,1,t.fadeTransition),F.end=!0)};let N=()=>{};I&&(N=I.on("change",T)),b(N)},{immediate:!0}),(I,E)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(e.unref(s.Motion),e.mergeProps(I.$attrs,{ref_key:"containerRef",ref:f,as:I.as,style:{overflowX:!I.overflow&&S.value==="x"?"clip":void 0,overflowY:!I.overflow&&S.value==="y"?"clip":void 0,...V,...t.style,...nt.value},drag:I.drag,_dragX:I._dragX,_dragY:I._dragY,"drag-constraints":Y.value,"drag-momentum":I.dragMomentum,onPointerenter:E[0]||(E[0]=()=>{e.unref(s.animate)(e.unref(c),I.hoverFactor)}),onPointerleave:E[1]||(E[1]=()=>{e.unref(s.animate)(e.unref(c),1)}),onPointerdown:ae.value,onDragEnd:W.value}),{default:e.withCtx(()=>[e.createVNode(e.unref(s.motion).ul,{ref_key:"listRef",ref:d,role:"group",style:e.normalizeStyle({...j,flexDirection:S.value==="x"?"row":"column",gap:`${I.gap}px`,x:S.value==="x"?u.value:0,y:S.value==="y"?u.value:0,opacity:P.value?1:0,alignItems:a.value,willChange:P.value&&g.value?"transform":void 0,width:"100%",height:"100%",maxHeight:"100%",maxWidth:"100%"})},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,(b,T)=>(e.openBlock(),e.createBlock(xe,{key:`original-${T}`,axis:S.value,offset:u.value,"list-size":C.value,"item-index":T,bounds:n.itemPositions[T]??e.unref(He),"align-items":a.value,size:I.itemSize,reproject:I.loop,"safe-margin":I.safeMargin,"num-items":h.value.length},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(we)([b]),(N,O)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(N),{key:O}))),128))]),_:2},1032,["axis","offset","list-size","item-index","bounds","align-items","size","reproject","safe-margin","num-items"]))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(z.value,b=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(b),{key:b.key}))),128))]),_:1},8,["style"])]),_:1},16,["as","style","drag","_dragX","_dragY","drag-constraints","drag-momentum","onPointerdown","onDragEnd"]),e.renderSlot(I.$slots,"after")],64))}}),Qe=en,tn={slow:130,normal:75,fast:30},nn=e.defineComponent({__name:"Typewriter",props:e.mergeDefaults({as:{},speed:{},variance:{},play:{type:Boolean},cursorClassName:{},cursorStyle:{},textClassName:{},textStyle:{},cursorBlinkDuration:{},onComplete:{type:Function},replace:{},backspace:{},backspaceFactor:{}},{as:"span",speed:"normal",variance:"natural",cursorClassName:"motion-typewriter-cursor",play:!0,cursorBlinkDuration:.5,replace:"type",backspace:"character",backspaceFactor:.2}),setup(o){const t=o,n=e.useSlots();function a(){var k;return(((k=n==null?void 0:n.default)==null?void 0:k.call(n))??[]).map(x=>typeof x.children=="string"?x.children:"").join("")}let i=a();const r=s.useMotionValue("");e.watchEffect(()=>{const d=a();t.replace==="all"&&d!==i&&r.set(""),i=d});const c=e.ref();let l=null;const p=e.computed(()=>typeof t.speed=="number"?t.speed:tn[t.speed]);function y(){c.value&&(l=s.animate(c.value,{opacity:[1,1,0,0]},{duration:t.cursorBlinkDuration,times:[0,.5,.5,1],ease:"linear",repeat:1/0,repeatType:"reverse"}))}let m=null;function u(){m==null||m(),m=null}function f(){if(!t.play){y(),u();return}l==null||l.cancel();const d=a(),k=()=>{var w;const g=ge.getNextText(r.get(),d,t.replace,t.backspace);r.set(g),g!==d?x():(y(),(w=t.onComplete)==null||w.call(t))},x=()=>{m=s.delayInMs(k,ge.getTypewriterDelay(d,r.get(),p.value,t.variance,t.backspaceFactor))};m||x()}return e.watchEffect(d=>{f(),d(u)}),e.onMounted(()=>{f()}),(d,k)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.as),{"aria-label":e.unref(i)},{default:e.withCtx(()=>[e.createElementVNode("span",{class:e.normalizeClass(t.textClassName),style:e.normalizeStyle(t.textStyle)},[e.createVNode(e.unref(s.RowValue),{value:e.unref(r)},null,8,["value"])],6),e.createElementVNode("span",{ref_key:"cursorRef",ref:c,class:e.normalizeClass(t.cursorClassName),style:e.normalizeStyle({display:"inline-block",width:"2px",height:"1em",backgroundColor:"currentColor",position:"relative",top:"0.1em",left:"0.2em",...t.cursorStyle})},null,6)]),_:1},8,["aria-label"]))}}),[on,an]=s.createContext("CarouselContext"),rn={type:"spring",stiffness:200,damping:40},sn={type:"spring",stiffness:80,damping:10};function et(o,t,n,a=!0){const i={insets:[],visibleLength:t};if(o.length===0)return i;const r=[o[0].start];for(let c=1;c<o.length;c++){const{start:l,end:p}=o[c];if(r[r.length-1]+t<p)if(n!==null)if(l<=n)r.push(l);else{r.push(n);break}else r.push(l)}if(a&&n!==null&&r.length>1){const c=r[r.length-1],l=[];for(let m=0;m<r.length-1;m++)l.push(r[m+1]-r[m]);const p=l.reduce((m,u)=>m+u,0)/l.length;if(n-c<p*.5){const m=et(o,t*.75,n,!1);if(m.insets.length===r.length)return m}}return{insets:r,visibleLength:t}}function ln(o,t,n,a){const i=-o,r=a===null?Math.floor(i/n):0,c=r*n;for(let l=t.length-1;l>=0;l--){const p=t[l]+c,y=s.wrap(0,t.length,l-1),u=(l===0?r-1:r)*n,f=t[y]+u,d=(p-f)/2,k=s.wrap(0,t.length,l+1),g=(l===t.length-1?r+1:r)*n,w=t[k]+g,v=(w-p)/2;if(i<w-v&&i>=f+d)return l}return 0}const un=e.defineComponent({__name:"CarouselView",props:{offset:{},targetOffset:{},tugOffset:{},loop:{type:Boolean},transition:{},axis:{default:"x"},snap:{type:[String,Boolean],default:"page"},tickerRef:{}},setup(o){const t=o;let n=!0;const{state:a,gap:i,clampOffset:r}=Be(),c=e.computed(()=>a.totalItemLength+i.value),l=e.computed(()=>et(a.itemPositions,a.containerLength,a.maxInset)),p=e.computed(()=>l.value.insets.length),y=e.computed(()=>G(t.axis,a.direction).sign);function m(C){const z=ln(C*y.value,l.value.insets,c.value,a.maxInset),S=t.loop?!0:C*-y.value<a.maxInset,V=t.loop?!0:C*-y.value>0;return{current:z,isNextActive:S,isPrevActive:V}}const u=e.ref(m(t.targetOffset.get()));function f(){const C=m(t.targetOffset.get());(C.current!==u.value.current||C.isNextActive!==u.value.isNextActive||C.isPrevActive!==u.value.isPrevActive)&&(u.value=C)}e.watch([()=>a.containerLength,()=>a.totalItemLength],f,{immediate:!0,flush:"post"}),s.useMotionValueEvent(t.targetOffset,"change",C=>{t.offset.set(C),f()});let d=null;function k(){d&&(d.stop(),d=null)}e.onMounted(()=>{t.offset.attach((C,z)=>{k(),n?z(C):d=new s.JSAnimation({keyframes:[t.offset.get(),C],velocity:s.clamp(-2e3,2e3,t.offset.getVelocity()),...t.transition,onUpdate:z,onComplete:()=>{d=null}}),n=!0},k)});function x(C){const z=r(C);t.targetOffset.stop(),n=!1,t.targetOffset.set(z*y.value)}function g(C,z){const S=-C(-t.targetOffset.get()*y.value,l.value.visibleLength,a.itemPositions,i.value),V=r(S);V*y.value===t.targetOffset.get()?s.animate(t.tugOffset,0,{velocity:z*y.value*400,...sn}):x(V)}const w=()=>g(Jt,-1),v=()=>g(Qt,1);function h(C){const S=(t.loop?Math.floor(-t.targetOffset.get()*y.value/c.value):0)*-c.value;x(-l.value.insets[C]+S)}const{axis:L,snap:P,offset:M}=e.toRefs(t);return e.watch([L,P,M,y,()=>t.tickerRef],(C,z,S)=>{t.tickerRef&&S(ge.wheel(t.tickerRef,{axis:L.value,onSwipe:P.value?V=>{V*y.value===1?w():v()}:void 0,onWheel:V=>{const j=M.value.get()+V,B=y.value>0?r(j):s.clamp(0,a.maxInset,j);t.targetOffset.jump(a.maxInset?B:j)}}))},{immediate:!0,flush:"post"}),an({paginationState:u,totalPages:p,nextPage:w,prevPage:v,gotoPage:h,targetOffset:t.targetOffset}),(C,z)=>e.renderSlot(C.$slots,"default")}}),cn=e.defineComponent({name:"Carousel",inheritAttrs:!1,__name:"Carousel",props:{snap:{type:[String,Boolean],default:"page"},transition:{default:()=>({...rn})},axis:{default:"x"},gap:{},align:{},itemSize:{},overflow:{type:Boolean},loop:{type:Boolean,default:!0},safeMargin:{},fade:{},fadeTransition:{},pageTransition:{},_dragX:{type:[Object,Boolean]},_dragY:{type:[Object,Boolean]},as:{},style:{},onDragEnd:{},drag:{type:[Boolean,String]},dragConstraints:{type:[Boolean,Object]},dragMomentum:{type:Boolean}},setup(o){const t=o,n=s.useMotionValue(0),a=s.useMotionValue(0),i=s.useMotionValue(0),r=s.useTransform(()=>i.get()+a.get()),c=s.useDomRef();return(l,p)=>(e.openBlock(),e.createBlock(e.unref(Qe),e.mergeProps({...t,...l.$attrs},{ref_key:"tickerRef",ref:c,role:"region","aria-roledescription":"carousel",offset:e.unref(r),loop:l.loop,axis:l.axis,drag:l.axis,"_drag-x":l.axis==="x"?e.unref(n):!1,"_drag-y":l.axis==="y"?e.unref(n):!1,snap:l.snap,"page-transition":l.transition}),{after:e.withCtx(()=>[e.createVNode(un,{"ticker-ref":e.unref(c),loop:l.loop,offset:e.unref(a),"tug-offset":e.unref(i),"target-offset":e.unref(n),transition:l.transition,snap:l.snap,axis:l.axis},{default:e.withCtx(()=>[e.renderSlot(l.$slots,"after")]),_:3},8,["ticker-ref","loop","offset","tug-offset","target-offset","transition","snap","axis"])]),default:e.withCtx(()=>[e.renderSlot(l.$slots,"default")]),_:3},16,["offset","loop","axis","drag","_drag-x","_drag-y","snap","page-transition"]))}});exports.AnimateNumber=gt;exports.Carousel=cn;exports.Cursor=Rt;exports.Ticker=Qe;exports.TickerItem=xe;exports.Typewriter=nn;exports.useCarousel=on;exports.useCursorIsInView=Ke;exports.useCursorState=be;exports.useMagneticPull=_t;exports.usePointerPosition=Se;exports.useTicker=Be;exports.useTickerItem=At;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Transition } from 'motion-v';
|
|
2
|
+
import { TickerProps } from '../Ticker';
|
|
3
|
+
export interface CarouselProps extends Omit<TickerProps, 'velocity' | 'offset' | 'hoverFactor' | 'transition'> {
|
|
4
|
+
/**
|
|
5
|
+
* The snap type to use for the carousel while
|
|
6
|
+
* free-scrolling.
|
|
7
|
+
*
|
|
8
|
+
* - "page" - Snap to the next or previous page of items.
|
|
9
|
+
* - "loose" - Use normal scroll momentum, resting on the closest item to the natural scroll resting point.
|
|
10
|
+
* - false - No snapping.
|
|
11
|
+
*
|
|
12
|
+
* @default: "page"
|
|
13
|
+
*/
|
|
14
|
+
snap?: 'page' | 'loose' | false;
|
|
15
|
+
transition?: Transition;
|
|
16
|
+
}
|
|
17
|
+
declare const _default: __VLS_WithSlots<import('vue').DefineComponent<CarouselProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<CarouselProps> & Readonly<{}>, {
|
|
18
|
+
transition: Transition;
|
|
19
|
+
axis: "x" | "y";
|
|
20
|
+
loop: boolean;
|
|
21
|
+
snap: "page" | "loose" | false;
|
|
22
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>, __VLS_PrettifyGlobal<any>>;
|
|
23
|
+
export default _default;
|
|
24
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
25
|
+
new (): {
|
|
26
|
+
$slots: S;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { MotionValue, Transition } from 'motion-v';
|
|
2
|
+
import { Axis } from '../Ticker/types';
|
|
3
|
+
interface CarouselViewProps {
|
|
4
|
+
offset: MotionValue<number>;
|
|
5
|
+
targetOffset: MotionValue<number>;
|
|
6
|
+
tugOffset: MotionValue<number>;
|
|
7
|
+
loop?: boolean;
|
|
8
|
+
transition?: Transition;
|
|
9
|
+
axis?: Axis;
|
|
10
|
+
snap?: 'page' | 'loose' | false;
|
|
11
|
+
tickerRef?: HTMLDivElement;
|
|
12
|
+
}
|
|
13
|
+
declare const __VLS_ctx: InstanceType<__VLS_PickNotAny<typeof __VLS_self, new () => {}>>;
|
|
14
|
+
declare var __VLS_1: {};
|
|
15
|
+
type __VLS_Slots = __VLS_PrettifyGlobal<__VLS_OmitStringIndex<typeof __VLS_ctx.$slots> & {
|
|
16
|
+
default?: (props: typeof __VLS_1) => any;
|
|
17
|
+
}>;
|
|
18
|
+
declare const __VLS_self: import('vue').DefineComponent<CarouselViewProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<CarouselViewProps> & Readonly<{}>, {
|
|
19
|
+
axis: Axis;
|
|
20
|
+
snap: "page" | "loose" | false;
|
|
21
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
22
|
+
declare const __VLS_component: import('vue').DefineComponent<CarouselViewProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<CarouselViewProps> & Readonly<{}>, {
|
|
23
|
+
axis: Axis;
|
|
24
|
+
snap: "page" | "loose" | false;
|
|
25
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
26
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
27
|
+
export default _default;
|
|
28
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
29
|
+
new (): {
|
|
30
|
+
$slots: S;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { MotionValue } from 'motion-v';
|
|
2
|
+
import { ComputedRef, Ref } from 'vue';
|
|
3
|
+
export interface CarouselInfo {
|
|
4
|
+
paginationState: Ref<{
|
|
5
|
+
current: number;
|
|
6
|
+
isNextActive: boolean;
|
|
7
|
+
isPrevActive: boolean;
|
|
8
|
+
}>;
|
|
9
|
+
totalPages: ComputedRef<number>;
|
|
10
|
+
nextPage: () => void;
|
|
11
|
+
prevPage: () => void;
|
|
12
|
+
gotoPage: (page: number) => void;
|
|
13
|
+
targetOffset: MotionValue<number>;
|
|
14
|
+
}
|
|
15
|
+
export declare const useCarousel: <T extends CarouselInfo | null | undefined = CarouselInfo>(fallback?: T | undefined) => T extends null ? CarouselInfo | null : CarouselInfo, provideCarousel: (contextValue: CarouselInfo) => CarouselInfo;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function calcCurrentPage(targetOffset: number, pageInsets: number[], wrapInset: number, maxInset: number | null): number;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { ItemPosition } from '../../Ticker/types';
|
|
2
|
+
export declare function findNextItemInset(currentInset: number, itemPositions: ItemPosition[], gap: number, targetInset?: number): number;
|
|
3
|
+
export declare function findNextPageInset(currentInset: number, containerLength: number, itemPositions: ItemPosition[], gap: number): number;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { ItemPosition } from '../../Ticker/types';
|
|
2
|
+
export declare function findPrevItemInset(currentInset: number, itemPositions: ItemPosition[], gap: number, targetInset?: number, containerLength?: number): number;
|
|
3
|
+
export declare function findPrevPageInset(currentInset: number, containerLength: number, itemPositions: ItemPosition[], gap: number): number;
|
|
@@ -50,20 +50,20 @@ declare const __VLS_self: import('vue').DefineComponent<CursorProps, {
|
|
|
50
50
|
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<CursorProps> & Readonly<{}>, {
|
|
51
51
|
offset: Point;
|
|
52
52
|
center: Point;
|
|
53
|
-
show: boolean;
|
|
54
53
|
spring: false | SpringOptions;
|
|
55
54
|
matchTextSize: boolean;
|
|
56
55
|
follow: boolean;
|
|
57
56
|
magnetic: boolean | Partial<MagneticOptions>;
|
|
57
|
+
show: boolean;
|
|
58
58
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
59
59
|
declare const __VLS_component: import('vue').DefineComponent<CursorProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<CursorProps> & Readonly<{}>, {
|
|
60
60
|
offset: Point;
|
|
61
61
|
center: Point;
|
|
62
|
-
show: boolean;
|
|
63
62
|
spring: false | SpringOptions;
|
|
64
63
|
matchTextSize: boolean;
|
|
65
64
|
follow: boolean;
|
|
66
65
|
magnetic: boolean | Partial<MagneticOptions>;
|
|
66
|
+
show: boolean;
|
|
67
67
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
68
68
|
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
69
69
|
export default _default;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
declare const __VLS_ctx: InstanceType<__VLS_PickNotAny<typeof __VLS_self, new () => {}>>;
|
|
2
|
+
declare var __VLS_1: {};
|
|
3
|
+
type __VLS_Slots = __VLS_PrettifyGlobal<__VLS_OmitStringIndex<typeof __VLS_ctx.$slots> & {
|
|
4
|
+
default?: (props: typeof __VLS_1) => any;
|
|
5
|
+
}>;
|
|
6
|
+
declare const __VLS_self: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
7
|
+
declare const __VLS_component: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
8
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
9
|
+
export default _default;
|
|
10
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
11
|
+
new (): {
|
|
12
|
+
$slots: S;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { MotionValue } from 'motion-v';
|
|
1
|
+
import { MotionProps, MotionValue, Transition } from 'motion-v';
|
|
3
2
|
import { ItemSize } from './types';
|
|
4
3
|
/**
|
|
5
4
|
* Props for the Ticker component.
|
|
@@ -9,7 +8,6 @@ export interface TickerProps {
|
|
|
9
8
|
* The axis along which the ticker scrolls. Defaults to "x".
|
|
10
9
|
*/
|
|
11
10
|
axis?: 'x' | 'y';
|
|
12
|
-
style?: CSSProperties;
|
|
13
11
|
/**
|
|
14
12
|
* The velocity of the ticker scroll in pixels per second. Defaults to 50.
|
|
15
13
|
*/
|
|
@@ -38,14 +36,71 @@ export interface TickerProps {
|
|
|
38
36
|
* Show items that overflow the container.
|
|
39
37
|
*/
|
|
40
38
|
overflow?: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Allow the carousel to loop through its items.
|
|
41
|
+
* If this is disabled, the carousel will not clone
|
|
42
|
+
* any additional children.
|
|
43
|
+
*
|
|
44
|
+
* @default true
|
|
45
|
+
*/
|
|
46
|
+
loop?: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* By default, ticker items that disappear off the start of the visible area
|
|
49
|
+
* will be reprojected to the end of the ticker items to reduce or eliminate
|
|
50
|
+
* cloned items.
|
|
51
|
+
*
|
|
52
|
+
* The calculation for this is based on an item's layout. If for some reason
|
|
53
|
+
* the item is transformed back within the visible area, this reprojection
|
|
54
|
+
* might be visible. By setting a safe margin, you can extend the effective
|
|
55
|
+
* visible area.
|
|
56
|
+
*
|
|
57
|
+
* @default 0
|
|
58
|
+
*/
|
|
59
|
+
safeMargin?: number;
|
|
60
|
+
/**
|
|
61
|
+
* The length of the fade at each end of the container.
|
|
62
|
+
*
|
|
63
|
+
* When looping is disabled, the fade will automatically animate
|
|
64
|
+
* away when the content is scrolled to each end of the container.
|
|
65
|
+
*
|
|
66
|
+
* @default 0
|
|
67
|
+
*/
|
|
68
|
+
fade?: number | `${number}%`;
|
|
69
|
+
/**
|
|
70
|
+
* The transition to use when fading the edges of the container.
|
|
71
|
+
*
|
|
72
|
+
* @default { duration: 0.2, ease: "linear" }
|
|
73
|
+
*/
|
|
74
|
+
fadeTransition?: Transition;
|
|
75
|
+
/**
|
|
76
|
+
* The transition to use when paginating the container.
|
|
77
|
+
*
|
|
78
|
+
* @default { type: "spring", stiffness: 400, damping: 40 }
|
|
79
|
+
*/
|
|
80
|
+
pageTransition?: Transition;
|
|
81
|
+
_dragX?: MotionValue<number> | boolean;
|
|
82
|
+
_dragY?: MotionValue<number> | boolean;
|
|
83
|
+
snap?: 'page' | 'loose' | false;
|
|
84
|
+
as?: any;
|
|
85
|
+
style?: MotionProps['style'];
|
|
86
|
+
onDragEnd?: MotionProps['onDragEnd'];
|
|
87
|
+
drag?: MotionProps['drag'];
|
|
88
|
+
dragConstraints?: MotionProps['dragConstraints'];
|
|
89
|
+
dragMomentum?: MotionProps['dragMomentum'];
|
|
41
90
|
}
|
|
42
91
|
declare const _default: import('vue').DefineComponent<TickerProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<TickerProps> & Readonly<{}>, {
|
|
43
92
|
gap: number;
|
|
44
93
|
overflow: boolean;
|
|
45
|
-
|
|
94
|
+
as: any;
|
|
46
95
|
axis: "x" | "y";
|
|
47
|
-
|
|
96
|
+
velocity: number;
|
|
48
97
|
hoverFactor: number;
|
|
49
98
|
align: "start" | "center" | "end" | "stretch";
|
|
99
|
+
itemSize: ItemSize;
|
|
100
|
+
loop: boolean;
|
|
101
|
+
safeMargin: number;
|
|
102
|
+
fade: number | `${number}%`;
|
|
103
|
+
fadeTransition: Transition;
|
|
104
|
+
pageTransition: Transition;
|
|
50
105
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
51
106
|
export default _default;
|
|
@@ -4,34 +4,80 @@ export interface TickerItemProps {
|
|
|
4
4
|
offset: MotionValue<number>;
|
|
5
5
|
axis: 'x' | 'y';
|
|
6
6
|
listSize: number;
|
|
7
|
-
inset: number;
|
|
8
7
|
bounds: {
|
|
9
8
|
start: number;
|
|
10
9
|
end: number;
|
|
11
10
|
};
|
|
12
|
-
|
|
11
|
+
numItems: number;
|
|
12
|
+
itemIndex: number;
|
|
13
13
|
cloneIndex?: number;
|
|
14
14
|
alignItems: 'flex-start' | 'center' | 'flex-end' | 'stretch';
|
|
15
|
-
|
|
15
|
+
size: ItemSize;
|
|
16
|
+
safeMargin: number;
|
|
17
|
+
reproject?: boolean;
|
|
16
18
|
}
|
|
17
|
-
declare const
|
|
18
|
-
|
|
19
|
-
|
|
19
|
+
declare const ItemProps: import('vue').ComputedRef<{
|
|
20
|
+
'aria-hidden': boolean;
|
|
21
|
+
'aria-posinset': number;
|
|
22
|
+
'aria-setsize': number;
|
|
23
|
+
class: string;
|
|
24
|
+
style: {
|
|
25
|
+
flexGrow: number;
|
|
26
|
+
flexShrink: number;
|
|
27
|
+
position: string;
|
|
28
|
+
flexBasis: string | undefined;
|
|
29
|
+
display: string | undefined;
|
|
30
|
+
gridTemplateColumns: string | undefined;
|
|
31
|
+
gridTemplateRows: string | undefined;
|
|
32
|
+
minWidth: number | undefined;
|
|
33
|
+
minHeight: number | undefined;
|
|
34
|
+
height: string | undefined;
|
|
35
|
+
width: string | undefined;
|
|
36
|
+
x: number | MotionValue<number>;
|
|
37
|
+
y: number | MotionValue<number>;
|
|
38
|
+
};
|
|
39
|
+
} | {
|
|
40
|
+
'aria-hidden': boolean;
|
|
41
|
+
'aria-posinset'?: undefined;
|
|
42
|
+
'aria-setsize'?: undefined;
|
|
43
|
+
class: string;
|
|
44
|
+
style: {
|
|
45
|
+
flexGrow: number;
|
|
46
|
+
flexShrink: number;
|
|
47
|
+
position: string;
|
|
48
|
+
flexBasis: string | undefined;
|
|
49
|
+
display: string | undefined;
|
|
50
|
+
gridTemplateColumns: string | undefined;
|
|
51
|
+
gridTemplateRows: string | undefined;
|
|
52
|
+
minWidth: number | undefined;
|
|
53
|
+
minHeight: number | undefined;
|
|
54
|
+
height: string | undefined;
|
|
55
|
+
width: string | undefined;
|
|
56
|
+
x: number | MotionValue<number>;
|
|
57
|
+
y: number | MotionValue<number>;
|
|
58
|
+
};
|
|
59
|
+
}>;
|
|
20
60
|
declare const __VLS_ctx: InstanceType<__VLS_PickNotAny<typeof __VLS_self, new () => {}>>;
|
|
21
|
-
declare var
|
|
61
|
+
declare var __VLS_1: {}, __VLS_8: {};
|
|
22
62
|
type __VLS_Slots = __VLS_PrettifyGlobal<__VLS_OmitStringIndex<typeof __VLS_ctx.$slots> & {
|
|
23
|
-
default?: (props: typeof
|
|
63
|
+
default?: (props: typeof __VLS_1) => any;
|
|
64
|
+
} & {
|
|
65
|
+
default?: (props: typeof __VLS_8) => any;
|
|
24
66
|
}>;
|
|
25
67
|
declare const __VLS_self: import('vue').DefineComponent<TickerItemProps, {
|
|
26
68
|
motion: typeof motion;
|
|
27
|
-
|
|
28
|
-
itemWrapperOffAxisSize: typeof itemWrapperOffAxisSize;
|
|
29
|
-
isClone: typeof isClone;
|
|
69
|
+
ItemProps: typeof ItemProps;
|
|
30
70
|
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<TickerItemProps> & Readonly<{}>, {
|
|
31
|
-
|
|
71
|
+
size: ItemSize;
|
|
72
|
+
listSize: number;
|
|
73
|
+
numItems: number;
|
|
74
|
+
reproject: boolean;
|
|
32
75
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
33
76
|
declare const __VLS_component: import('vue').DefineComponent<TickerItemProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<TickerItemProps> & Readonly<{}>, {
|
|
34
|
-
|
|
77
|
+
size: ItemSize;
|
|
78
|
+
listSize: number;
|
|
79
|
+
numItems: number;
|
|
80
|
+
reproject: boolean;
|
|
35
81
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
36
82
|
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
37
83
|
export default _default;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Transition } from 'motion-v';
|
|
1
2
|
export declare const defaultBounds: {
|
|
2
3
|
start: number;
|
|
3
4
|
end: number;
|
|
@@ -6,3 +7,5 @@ export declare const alignAlias: {
|
|
|
6
7
|
readonly start: "flex-start";
|
|
7
8
|
readonly end: "flex-end";
|
|
8
9
|
};
|
|
10
|
+
export declare const defaultFadeTransition: Transition;
|
|
11
|
+
export declare const defaultPageTransition: Transition;
|