@telegraph/tag 0.0.90 → 0.0.91

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/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # @telegraph/tag
2
2
 
3
+ ## 0.0.91
4
+
5
+ ### Patch Changes
6
+
7
+ - [#502](https://github.com/knocklabs/telegraph/pull/502) [`6e5d6c3`](https://github.com/knocklabs/telegraph/commit/6e5d6c313f630f2095c7ef3622520daf8e3ab1e2) Thanks [@kylemcd](https://github.com/kylemcd)! - update packages to use react-m and remove animate presence to shrink bundle
8
+
9
+ - [#501](https://github.com/knocklabs/telegraph/pull/501) [`dc12662`](https://github.com/knocklabs/telegraph/commit/dc12662f6f41697d976d0978871a567d564777e8) Thanks [@kylemcd](https://github.com/kylemcd)! - deprecate usage of `@telegraph/motion` in favor of tiny `motion` package
10
+
11
+ - [#498](https://github.com/knocklabs/telegraph/pull/498) [`99e01e3`](https://github.com/knocklabs/telegraph/commit/99e01e3dcf7508af0bfae14e9b62cccff7af3388) Thanks [@kylemcd](https://github.com/kylemcd)! - update imports for the `Lucide` object from `@telegraph/icon` to import icons directly from `lucide-react` instead.
12
+
13
+ - Updated dependencies [[`99e01e3`](https://github.com/knocklabs/telegraph/commit/99e01e3dcf7508af0bfae14e9b62cccff7af3388), [`6e5d6c3`](https://github.com/knocklabs/telegraph/commit/6e5d6c313f630f2095c7ef3622520daf8e3ab1e2), [`e554068`](https://github.com/knocklabs/telegraph/commit/e554068b0f9ca5a1e8fe9d6f27dd2a30373a3cc8), [`dc12662`](https://github.com/knocklabs/telegraph/commit/dc12662f6f41697d976d0978871a567d564777e8), [`99e01e3`](https://github.com/knocklabs/telegraph/commit/99e01e3dcf7508af0bfae14e9b62cccff7af3388), [`2d3e1cd`](https://github.com/knocklabs/telegraph/commit/2d3e1cddd8a6bfac7108e350649f81bdc18f57c8)]:
14
+ - @telegraph/icon@0.1.0
15
+ - @telegraph/tooltip@0.0.52
16
+ - @telegraph/layout@0.1.21
17
+ - @telegraph/button@0.0.83
18
+ - @telegraph/typography@0.1.21
19
+
3
20
  ## 0.0.90
4
21
 
5
22
  ### Patch Changes
package/README.md CHANGED
@@ -147,11 +147,11 @@ import { Tag } from '@telegraph/tag'
147
147
 
148
148
  ```
149
149
  import { Tag } from "@telegraph/tag"
150
- import { Lucide } from '@telegraph/icon'
150
+ import { Add, X } from "lucide-react"
151
151
 
152
152
  <Tag.Root color="blue" variant="solid" size="2">
153
- <Tag.Icon icon={Lucide.Add} alt="Create"/>
153
+ <Tag.Icon icon={Add} alt="Create"/>
154
154
  <Tag.Text>Text</Tag.Text>
155
- <Tag.Button icon={{ icon: Lucide.X, alt: "remove"}} onClick={() => {}}/>
155
+ <Tag.Button icon={{ icon: X, alt: "remove"}} onClick={() => {}}/>
156
156
  </Tag.Root>
157
157
  ```
package/dist/cjs/index.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),g=require("@telegraph/button"),c=require("@telegraph/icon"),B=require("@telegraph/layout"),y=require("@telegraph/motion"),v=require("@telegraph/tooltip"),C=require("@telegraph/typography"),L=require("clsx"),l=require("react"),z={Root:{0:{h:"5"},1:{h:"6"},2:{h:"8"}}},h={Root:{0:"1",1:"2",2:"2"},Text:{0:"1",1:"2",2:"2"}},s={Root:{solid:{default:"gray-12",accent:"accent-9",gray:"gray-9",red:"red-9",blue:"blue-9",green:"green-9",yellow:"yellow-9",purple:"purple-9"},soft:{default:"gray-3",accent:"accent-3",gray:"gray-3",red:"red-3",blue:"blue-3",green:"green-3",yellow:"yellow-3",purple:"purple-3"}},Icon:{solid:{default:"white",gray:"white",red:"white",accent:"white",blue:"white",green:"white",yellow:"white",purple:"white"},soft:{default:"default",gray:"gray",accent:"accent",red:"red",blue:"blue",green:"green",yellow:"yellow",purple:"purple"}},Text:{solid:{default:"white",gray:"white",accent:"white",red:"white",blue:"white",green:"white",yellow:"white",purple:"white"},soft:{default:"default",gray:"gray",accent:"accent",red:"red",blue:"blue",green:"green",yellow:"yellow",purple:"purple"}},Button:{solid:{default:"default",gray:"gray",accent:"accent",red:"red",blue:"blue",green:"green",yellow:"yellow",purple:"purple"},soft:{default:"gray",gray:"gray",accent:"accent",red:"red",blue:"blue",green:"green",yellow:"yellow",purple:"purple"}}},d=l.createContext({size:"1",color:"default",variant:"soft"}),f=({as:i="span",size:t="1",color:a="default",variant:o="soft",className:e,...n})=>r.jsx(d.Provider,{value:{size:t,color:a,variant:o},children:r.jsx(B.Stack,{as:i,align:"center",rounded:"2",display:"inline-flex",pl:h.Root[t],backgroundColor:s.Root[o][a],h:z.Root[t].h,className:L.clsx("tgph-tag",e),...n,"data-tag":!0})}),x=({as:i="span",maxW:t="40",overflow:a="hidden",style:o,...e})=>{const n=l.useContext(d);return r.jsx(C.Text,{as:i,size:n.size,color:s.Text[n.variant][n.color],weight:"medium",mr:h.Text[n.size],maxW:t,overflow:a,internal_optionalAs:!0,style:{whiteSpace:"nowrap",textOverflow:"ellipsis",...o},...e})},w=({onClick:i,textToCopy:t,...a})=>{const o=l.useContext(d),[e,n]=l.useState(!1);return l.useEffect(()=>{if(e){const u=setTimeout(()=>n(!1),2e3);return()=>clearTimeout(u)}},[e]),r.jsx(v.Tooltip,{label:"Copy text",children:r.jsxs(g.Button.Root,{onClick:u=>{var p;i==null||i(u),n(!0),t&&navigator.clipboard.writeText(t),(p=u.currentTarget)==null||p.blur()},size:o.size,color:s.Button[o.variant][o.color],variant:o.variant,roundedTopRight:"3",roundedBottomRight:"3",roundedTopLeft:"0",roundedBottomLeft:"0",position:"relative",overflow:"hidden",p:"2",...a,children:[r.jsx(g.Button.Icon,{as:y.motion.span,initializeWithAnimation:!1,animate:{y:e?0:"150%",opacity:1},transition:{duration:150,type:"spring"},icon:c.Lucide.Check,alt:"Copied text","aria-hidden":!e}),r.jsx(g.Button.Icon,{as:y.motion.span,initializeWithAnimation:!1,animate:{y:e?"-150%":0,opacity:1},transition:{duration:150,type:"spring"},icon:c.Lucide.Copy,position:"absolute",alt:"Copy text","aria-hidden":e})]})})},m=({...i})=>{const t=l.useContext(d);return r.jsx(g.Button,{size:t.size,color:s.Button[t.variant][t.color],variant:t.variant,icon:{icon:c.Lucide.X,alt:"close"},roundedTopRight:"3",roundedBottomRight:"3",roundedTopLeft:"0",roundedBottomLeft:"0",...i})},b=({icon:i,alt:t,"aria-hidden":a,...o})=>{const e=l.useContext(d),n=t?{alt:t}:{"aria-hidden":a};return r.jsx(c.Icon,{icon:i,size:e.size,color:s.Icon[e.variant][e.color],mr:"1",roundedTopRight:"3",roundedBottomRight:"3",roundedTopLeft:"0",roundedBottomLeft:"0",...n,...o})},T=({color:i="default",size:t="1",variant:a="soft",icon:o,onRemove:e,onCopy:n,textToCopy:u,textProps:p={maxW:"40"},children:j,...R})=>r.jsxs(f,{color:i,size:t,variant:a,...R,children:[o&&r.jsx(b,{...o}),r.jsx(x,{as:"span",...p,children:j}),e&&r.jsx(m,{onClick:e,icon:{icon:c.Lucide.X,alt:"Remove"}}),n&&r.jsx(w,{onClick:n,textToCopy:u})]});Object.assign(T,{Root:f,Button:m,Text:x,Icon:b,CopyButton:w});const q=T;exports.Tag=q;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const F=require("react/jsx-runtime"),be=require("@telegraph/button"),Ds=require("@telegraph/icon"),Os=require("@telegraph/layout"),Is=require("@telegraph/tooltip"),Es=require("@telegraph/typography"),ks=require("clsx"),we=require("lucide-react"),y=require("react"),Bs=y.createContext({});function Ls(e){const t=y.useRef(null);return t.current===null&&(t.current=e()),t.current}const rt=typeof window<"u",Ns=rt?y.useLayoutEffect:y.useEffect,cn=y.createContext(null);function Ks(e,t){e.indexOf(t)===-1&&e.push(t)}function js(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const H=(e,t,n)=>n>t?t:n<e?e:n;let Q=()=>{},W=()=>{};process.env.NODE_ENV!=="production"&&(Q=(e,t)=>{!e&&typeof console<"u"&&console.warn(t)},W=(e,t)=>{if(!e)throw new Error(t)});const K={},ln=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function Ws(e){return typeof e=="object"&&e!==null}const fn=e=>/^0[^.\s]+$/u.test(e);function ot(e){let t;return()=>(t===void 0&&(t=e()),t)}const ee=e=>e,$s=(e,t)=>n=>t(e(n)),Pe=(...e)=>e.reduce($s),dn=(e,t,n)=>{const s=t-e;return s===0?1:(n-e)/s};class hn{constructor(){this.subscriptions=[]}add(t){return Ks(this.subscriptions,t),()=>js(this.subscriptions,t)}notify(t,n,s){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](t,n,s);else for(let r=0;r<i;r++){const o=this.subscriptions[r];o&&o(t,n,s)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const B=e=>e*1e3,N=e=>e/1e3;function pn(e,t){return t?e*(1e3/t):0}const Rt=new Set;function mn(e,t,n){e||Rt.has(t)||(console.warn(t),Rt.add(t))}const gn=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,_s=1e-7,zs=12;function Gs(e,t,n,s,i){let r,o,a=0;do o=t+(n-t)/2,r=gn(o,s,i)-e,r>0?n=o:t=o;while(Math.abs(r)>_s&&++a<zs);return o}function de(e,t,n,s){if(e===t&&n===s)return ee;const i=r=>Gs(r,0,1,e,n);return r=>r===0||r===1?r:gn(i(r),t,s)}const yn=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,bn=e=>t=>1-e(1-t),Tn=de(.33,1.53,.69,.99),at=bn(Tn),vn=yn(at),wn=e=>(e*=2)<1?.5*at(e):.5*(2-Math.pow(2,-10*(e-1))),ut=e=>1-Math.sin(Math.acos(e)),Us=bn(ut),xn=yn(ut),Hs=de(.42,0,1,1),qs=de(0,0,.58,1),Sn=de(.42,0,.58,1),Ys=e=>Array.isArray(e)&&typeof e[0]!="number",Vn=e=>Array.isArray(e)&&typeof e[0]=="number",Dt={linear:ee,easeIn:Hs,easeInOut:Sn,easeOut:qs,circIn:ut,circInOut:xn,circOut:Us,backIn:at,backInOut:vn,backOut:Tn,anticipate:wn},Xs=e=>typeof e=="string",Ot=e=>{if(Vn(e)){W(e.length===4,"Cubic bezier arrays must contain four numerical values.");const[t,n,s,i]=e;return de(t,n,s,i)}else if(Xs(e))return W(Dt[e]!==void 0,`Invalid easing type '${e}'`),Dt[e];return e},ge=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function Zs(e,t){let n=new Set,s=new Set,i=!1,r=!1;const o=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function c(u){o.has(u)&&(l.schedule(u),e()),u(a)}const l={schedule:(u,d=!1,f=!1)=>{const b=f&&i?n:s;return d&&o.add(u),b.has(u)||b.add(u),u},cancel:u=>{s.delete(u),o.delete(u)},process:u=>{if(a=u,i){r=!0;return}i=!0,[n,s]=[s,n],n.forEach(c),n.clear(),i=!1,r&&(r=!1,l.process(u))}};return l}const Js=40;function An(e,t){let n=!1,s=!0;const i={delta:0,timestamp:0,isProcessing:!1},r=()=>n=!0,o=ge.reduce((g,A)=>(g[A]=Zs(r),g),{}),{setup:a,read:c,resolveKeyframes:l,preUpdate:u,update:d,preRender:f,render:h,postRender:b}=o,T=()=>{const g=K.useManualTiming?i.timestamp:performance.now();n=!1,K.useManualTiming||(i.delta=s?1e3/60:Math.max(Math.min(g-i.timestamp,Js),1)),i.timestamp=g,i.isProcessing=!0,a.process(i),c.process(i),l.process(i),u.process(i),d.process(i),f.process(i),h.process(i),b.process(i),i.isProcessing=!1,n&&t&&(s=!1,e(T))},w=()=>{n=!0,s=!0,i.isProcessing||e(T)};return{schedule:ge.reduce((g,A)=>{const v=o[A];return g[A]=(V,P=!1,x=!1)=>(n||w(),v.schedule(V,P,x)),g},{}),cancel:g=>{for(let A=0;A<ge.length;A++)o[ge[A]].cancel(g)},state:i,steps:o}}const{schedule:k,cancel:We,state:xe,steps:Ca}=An(typeof requestAnimationFrame<"u"?requestAnimationFrame:ee,!0);let Te;function Qs(){Te=void 0}const E={now:()=>(Te===void 0&&E.set(xe.isProcessing||K.useManualTiming?xe.timestamp:performance.now()),Te),set:e=>{Te=e,queueMicrotask(Qs)}},Mn=e=>t=>typeof t=="string"&&t.startsWith(e),Cn=Mn("--"),ei=Mn("var(--"),ct=e=>ei(e)?ti.test(e.split("/*")[0].trim()):!1,ti=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,te={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},ue={...te,transform:e=>H(0,1,e)},ye={...te,default:1},ae=e=>Math.round(e*1e5)/1e5,lt=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function ni(e){return e==null}const si=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,ft=(e,t)=>n=>!!(typeof n=="string"&&si.test(n)&&n.startsWith(e)||t&&!ni(n)&&Object.prototype.hasOwnProperty.call(n,t)),Pn=(e,t,n)=>s=>{if(typeof s!="string")return s;const[i,r,o,a]=s.match(lt);return{[e]:parseFloat(i),[t]:parseFloat(r),[n]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},ii=e=>H(0,255,e),ke={...te,transform:e=>Math.round(ii(e))},_={test:ft("rgb","red"),parse:Pn("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:s=1})=>"rgba("+ke.transform(e)+", "+ke.transform(t)+", "+ke.transform(n)+", "+ae(ue.transform(s))+")"};function ri(e){let t="",n="",s="",i="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),s=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),s=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,s+=s,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(s,16),alpha:i?parseInt(i,16)/255:1}}const $e={test:ft("#"),parse:ri,transform:_.transform},he=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),j=he("deg"),Z=he("%"),m=he("px"),oi=he("vh"),ai=he("vw"),It={...Z,parse:e=>Z.parse(e)/100,transform:e=>Z.transform(e*100)},Y={test:ft("hsl","hue"),parse:Pn("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:s=1})=>"hsla("+Math.round(e)+", "+Z.transform(ae(t))+", "+Z.transform(ae(n))+", "+ae(ue.transform(s))+")"},C={test:e=>_.test(e)||$e.test(e)||Y.test(e),parse:e=>_.test(e)?_.parse(e):Y.test(e)?Y.parse(e):$e.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?_.transform(e):Y.transform(e),getAnimatableNone:e=>{const t=C.parse(e);return t.alpha=0,C.transform(t)}},ui=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function ci(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(lt))==null?void 0:t.length)||0)+(((n=e.match(ui))==null?void 0:n.length)||0)>0}const Fn="number",Rn="color",li="var",fi="var(",Et="${}",di=/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 ce(e){const t=e.toString(),n=[],s={color:[],number:[],var:[]},i=[];let r=0;const a=t.replace(di,c=>(C.test(c)?(s.color.push(r),i.push(Rn),n.push(C.parse(c))):c.startsWith(fi)?(s.var.push(r),i.push(li),n.push(c)):(s.number.push(r),i.push(Fn),n.push(parseFloat(c))),++r,Et)).split(Et);return{values:n,split:a,indexes:s,types:i}}function Dn(e){return ce(e).values}function On(e){const{split:t,types:n}=ce(e),s=t.length;return i=>{let r="";for(let o=0;o<s;o++)if(r+=t[o],i[o]!==void 0){const a=n[o];a===Fn?r+=ae(i[o]):a===Rn?r+=C.transform(i[o]):r+=i[o]}return r}}const hi=e=>typeof e=="number"?0:C.test(e)?C.getAnimatableNone(e):e;function pi(e){const t=Dn(e);return On(e)(t.map(hi))}const ne={test:ci,parse:Dn,createTransformer:On,getAnimatableNone:pi};function Be(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function mi({hue:e,saturation:t,lightness:n,alpha:s}){e/=360,t/=100,n/=100;let i=0,r=0,o=0;if(!t)i=r=o=n;else{const a=n<.5?n*(1+t):n+t-n*t,c=2*n-a;i=Be(c,a,e+1/3),r=Be(c,a,e),o=Be(c,a,e-1/3)}return{red:Math.round(i*255),green:Math.round(r*255),blue:Math.round(o*255),alpha:s}}function Se(e,t){return n=>n>0?t:e}const Fe=(e,t,n)=>e+(t-e)*n,Le=(e,t,n)=>{const s=e*e,i=n*(t*t-s)+s;return i<0?0:Math.sqrt(i)},gi=[$e,_,Y],yi=e=>gi.find(t=>t.test(e));function kt(e){const t=yi(e);if(Q(!!t,`'${e}' is not an animatable color. Use the equivalent color code instead.`),!t)return!1;let n=t.parse(e);return t===Y&&(n=mi(n)),n}const Bt=(e,t)=>{const n=kt(e),s=kt(t);if(!n||!s)return Se(e,t);const i={...n};return r=>(i.red=Le(n.red,s.red,r),i.green=Le(n.green,s.green,r),i.blue=Le(n.blue,s.blue,r),i.alpha=Fe(n.alpha,s.alpha,r),_.transform(i))},_e=new Set(["none","hidden"]);function bi(e,t){return _e.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function Ti(e,t){return n=>Fe(e,t,n)}function dt(e){return typeof e=="number"?Ti:typeof e=="string"?ct(e)?Se:C.test(e)?Bt:xi:Array.isArray(e)?In:typeof e=="object"?C.test(e)?Bt:vi:Se}function In(e,t){const n=[...e],s=n.length,i=e.map((r,o)=>dt(r)(r,t[o]));return r=>{for(let o=0;o<s;o++)n[o]=i[o](r);return n}}function vi(e,t){const n={...e,...t},s={};for(const i in n)e[i]!==void 0&&t[i]!==void 0&&(s[i]=dt(e[i])(e[i],t[i]));return i=>{for(const r in s)n[r]=s[r](i);return n}}function wi(e,t){const n=[],s={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){const r=t.types[i],o=e.indexes[r][s[r]],a=e.values[o]??0;n[i]=a,s[r]++}return n}const xi=(e,t)=>{const n=ne.createTransformer(t),s=ce(e),i=ce(t);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(e)&&!i.values.length||_e.has(t)&&!s.values.length?bi(e,t):Pe(In(wi(s,i),i.values),n):(Q(!0,`Complex values '${e}' and '${t}' 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.`),Se(e,t))};function En(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?Fe(e,t,n):dt(e)(e,t)}const Si=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>k.update(t,n),stop:()=>We(t),now:()=>xe.isProcessing?xe.timestamp:E.now()}},kn=(e,t,n=10)=>{let s="";const i=Math.max(Math.round(t/n),2);for(let r=0;r<i;r++)s+=Math.round(e(r/(i-1))*1e4)/1e4+", ";return`linear(${s.substring(0,s.length-2)})`},Ve=2e4;function ht(e){let t=0;const n=50;let s=e.next(t);for(;!s.done&&t<Ve;)t+=n,s=e.next(t);return t>=Ve?1/0:t}function Vi(e,t=100,n){const s=n({...e,keyframes:[0,t]}),i=Math.min(ht(s),Ve);return{type:"keyframes",ease:r=>s.next(i*r).value/t,duration:N(i)}}const Ai=5;function Bn(e,t,n){const s=Math.max(t-Ai,0);return pn(n-e(s),t-s)}const M={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},Lt=.001;function Mi({duration:e=M.duration,bounce:t=M.bounce,velocity:n=M.velocity,mass:s=M.mass}){let i,r;Q(e<=B(M.maxDuration),"Spring duration must be 10 seconds or less");let o=1-t;o=H(M.minDamping,M.maxDamping,o),e=H(M.minDuration,M.maxDuration,N(e)),o<1?(i=l=>{const u=l*o,d=u*e,f=u-n,h=ze(l,o),b=Math.exp(-d);return Lt-f/h*b},r=l=>{const d=l*o*e,f=d*n+n,h=Math.pow(o,2)*Math.pow(l,2)*e,b=Math.exp(-d),T=ze(Math.pow(l,2),o);return(-i(l)+Lt>0?-1:1)*((f-h)*b)/T}):(i=l=>{const u=Math.exp(-l*e),d=(l-n)*e+1;return-.001+u*d},r=l=>{const u=Math.exp(-l*e),d=(n-l)*(e*e);return u*d});const a=5/e,c=Pi(i,r,a);if(e=B(e),isNaN(c))return{stiffness:M.stiffness,damping:M.damping,duration:e};{const l=Math.pow(c,2)*s;return{stiffness:l,damping:o*2*Math.sqrt(s*l),duration:e}}}const Ci=12;function Pi(e,t,n){let s=n;for(let i=1;i<Ci;i++)s=s-e(s)/t(s);return s}function ze(e,t){return e*Math.sqrt(1-t*t)}const Fi=["duration","bounce"],Ri=["stiffness","damping","mass"];function Nt(e,t){return t.some(n=>e[n]!==void 0)}function Di(e){let t={velocity:M.velocity,stiffness:M.stiffness,damping:M.damping,mass:M.mass,isResolvedFromDuration:!1,...e};if(!Nt(e,Ri)&&Nt(e,Fi))if(e.visualDuration){const n=e.visualDuration,s=2*Math.PI/(n*1.2),i=s*s,r=2*H(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:M.mass,stiffness:i,damping:r}}else{const n=Mi(e);t={...t,...n,mass:M.mass},t.isResolvedFromDuration=!0}return t}function Ae(e=M.visualDuration,t=M.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:s,restDelta:i}=n;const r=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],a={done:!1,value:r},{stiffness:c,damping:l,mass:u,duration:d,velocity:f,isResolvedFromDuration:h}=Di({...n,velocity:-N(n.velocity||0)}),b=f||0,T=l/(2*Math.sqrt(c*u)),w=o-r,p=N(Math.sqrt(c/u)),S=Math.abs(w)<5;s||(s=S?M.restSpeed.granular:M.restSpeed.default),i||(i=S?M.restDelta.granular:M.restDelta.default);let g;if(T<1){const v=ze(p,T);g=V=>{const P=Math.exp(-T*p*V);return o-P*((b+T*p*w)/v*Math.sin(v*V)+w*Math.cos(v*V))}}else if(T===1)g=v=>o-Math.exp(-p*v)*(w+(b+p*w)*v);else{const v=p*Math.sqrt(T*T-1);g=V=>{const P=Math.exp(-T*p*V),x=Math.min(v*V,300);return o-P*((b+T*p*w)*Math.sinh(x)+v*w*Math.cosh(x))/v}}const A={calculatedDuration:h&&d||null,next:v=>{const V=g(v);if(h)a.done=v>=d;else{let P=v===0?b:0;T<1&&(P=v===0?B(b):Bn(g,v,V));const x=Math.abs(P)<=s,O=Math.abs(o-V)<=i;a.done=x&&O}return a.value=a.done?o:V,a},toString:()=>{const v=Math.min(ht(A),Ve),V=kn(P=>A.next(v*P).value,v,30);return v+"ms "+V},toTransition:()=>{}};return A}Ae.applyToOptions=e=>{const t=Vi(e,100,Ae);return e.ease=t.ease,e.duration=B(t.duration),e.type="keyframes",e};function Ge({keyframes:e,velocity:t=0,power:n=.8,timeConstant:s=325,bounceDamping:i=10,bounceStiffness:r=500,modifyTarget:o,min:a,max:c,restDelta:l=.5,restSpeed:u}){const d=e[0],f={done:!1,value:d},h=x=>a!==void 0&&x<a||c!==void 0&&x>c,b=x=>a===void 0?c:c===void 0||Math.abs(a-x)<Math.abs(c-x)?a:c;let T=n*t;const w=d+T,p=o===void 0?w:o(w);p!==w&&(T=p-d);const S=x=>-T*Math.exp(-x/s),g=x=>p+S(x),A=x=>{const O=S(x),I=g(x);f.done=Math.abs(O)<=l,f.value=f.done?p:I};let v,V;const P=x=>{h(f.value)&&(v=x,V=Ae({keyframes:[f.value,b(f.value)],velocity:Bn(g,x,f.value),damping:i,stiffness:r,restDelta:l,restSpeed:u}))};return P(0),{calculatedDuration:null,next:x=>{let O=!1;return!V&&v===void 0&&(O=!0,A(x),P(x)),v!==void 0&&x>=v?V.next(x-v):(!O&&A(x),f)}}}function Oi(e,t,n){const s=[],i=n||K.mix||En,r=e.length-1;for(let o=0;o<r;o++){let a=i(e[o],e[o+1]);if(t){const c=Array.isArray(t)?t[o]||ee:t;a=Pe(c,a)}s.push(a)}return s}function Ii(e,t,{clamp:n=!0,ease:s,mixer:i}={}){const r=e.length;if(W(r===t.length,"Both input and output ranges must be the same length"),r===1)return()=>t[0];if(r===2&&t[0]===t[1])return()=>t[1];const o=e[0]===e[1];e[0]>e[r-1]&&(e=[...e].reverse(),t=[...t].reverse());const a=Oi(t,s,i),c=a.length,l=u=>{if(o&&u<e[0])return t[0];let d=0;if(c>1)for(;d<e.length-2&&!(u<e[d+1]);d++);const f=dn(e[d],e[d+1],u);return a[d](f)};return n?u=>l(H(e[0],e[r-1],u)):l}function Ei(e,t){const n=e[e.length-1];for(let s=1;s<=t;s++){const i=dn(0,t,s);e.push(Fe(n,1,i))}}function ki(e){const t=[0];return Ei(t,e.length-1),t}function Bi(e,t){return e.map(n=>n*t)}function Li(e,t){return e.map(()=>t||Sn).splice(0,e.length-1)}function X({duration:e=300,keyframes:t,times:n,ease:s="easeInOut"}){const i=Ys(s)?s.map(Ot):Ot(s),r={done:!1,value:t[0]},o=Bi(n&&n.length===t.length?n:ki(t),e),a=Ii(o,t,{ease:Array.isArray(i)?i:Li(t,i)});return{calculatedDuration:e,next:c=>(r.value=a(c),r.done=c>=e,r)}}const Ni=e=>e!==null;function pt(e,{repeat:t,repeatType:n="loop"},s,i=1){const r=e.filter(Ni),a=i<0||t&&n!=="loop"&&t%2===1?0:r.length-1;return!a||s===void 0?r[a]:s}const Ki={decay:Ge,inertia:Ge,tween:X,keyframes:X,spring:Ae};function Ln(e){typeof e.type=="string"&&(e.type=Ki[e.type])}class mt{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,n){return this.finished.then(t,n)}}const ji=e=>e/100;class gt extends mt{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{var s,i;const{motionValue:n}=this.options;n&&n.updatedAt!==E.now()&&this.tick(E.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(i=(s=this.options).onStop)==null||i.call(s))},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;Ln(t);const{type:n=X,repeat:s=0,repeatDelay:i=0,repeatType:r,velocity:o=0}=t;let{keyframes:a}=t;const c=n||X;process.env.NODE_ENV!=="production"&&c!==X&&W(a.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${a}`),c!==X&&typeof a[0]!="number"&&(this.mixKeyframes=Pe(ji,En(a[0],a[1])),a=[0,100]);const l=c({...t,keyframes:a});r==="mirror"&&(this.mirroredGenerator=c({...t,keyframes:[...a].reverse(),velocity:-o})),l.calculatedDuration===null&&(l.calculatedDuration=ht(l));const{calculatedDuration:u}=l;this.calculatedDuration=u,this.resolvedDuration=u+i,this.totalDuration=this.resolvedDuration*(s+1)-i,this.generator=l}updateTime(t){const n=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(t,n=!1){const{generator:s,totalDuration:i,mixKeyframes:r,mirroredGenerator:o,resolvedDuration:a,calculatedDuration:c}=this;if(this.startTime===null)return s.next(0);const{delay:l=0,keyframes:u,repeat:d,repeatType:f,repeatDelay:h,type:b,onUpdate:T,finalKeyframe:w}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-i/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const p=this.currentTime-l*(this.playbackSpeed>=0?1:-1),S=this.playbackSpeed>=0?p<0:p>i;this.currentTime=Math.max(p,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=i);let g=this.currentTime,A=s;if(d){const x=Math.min(this.currentTime,i)/a;let O=Math.floor(x),I=x%1;!I&&x>=1&&(I=1),I===1&&O--,O=Math.min(O,d+1),!!(O%2)&&(f==="reverse"?(I=1-I,h&&(I-=h/a)):f==="mirror"&&(A=o)),g=H(0,1,I)*a}const v=S?{done:!1,value:u[0]}:A.next(g);r&&(v.value=r(v.value));let{done:V}=v;!S&&c!==null&&(V=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);const P=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&V);return P&&b!==Ge&&(v.value=pt(u,this.options,w,this.speed)),T&&T(v.value),P&&this.finish(),v}then(t,n){return this.finished.then(t,n)}get duration(){return N(this.calculatedDuration)}get time(){return N(this.currentTime)}set time(t){var n;t=B(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),(n=this.driver)==null||n.start(!1)}get speed(){return this.playbackSpeed}set speed(t){this.updateTime(E.now());const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=N(this.currentTime))}play(){var i,r;if(this.isStopped)return;const{driver:t=Si,startTime:n}=this.options;this.driver||(this.driver=t(o=>this.tick(o))),(r=(i=this.options).onPlay)==null||r.call(i);const s=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=s):this.holdTime!==null?this.startTime=s-this.holdTime:this.startTime||(this.startTime=n??s),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(E.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var t,n;this.notifyFinished(),this.teardown(),this.state="finished",(n=(t=this.options).onComplete)==null||n.call(t)}cancel(){var t,n;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(n=(t=this.options).onCancel)==null||n.call(t)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){var n;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(n=this.driver)==null||n.stop(),t.observe(this)}}function Wi(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const z=e=>e*180/Math.PI,Ue=e=>{const t=z(Math.atan2(e[1],e[0]));return He(t)},$i={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:Ue,rotateZ:Ue,skewX:e=>z(Math.atan(e[1])),skewY:e=>z(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},He=e=>(e=e%360,e<0&&(e+=360),e),Kt=Ue,jt=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),Wt=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),_i={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:jt,scaleY:Wt,scale:e=>(jt(e)+Wt(e))/2,rotateX:e=>He(z(Math.atan2(e[6],e[5]))),rotateY:e=>He(z(Math.atan2(-e[2],e[0]))),rotateZ:Kt,rotate:Kt,skewX:e=>z(Math.atan(e[4])),skewY:e=>z(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function qe(e){return e.includes("scale")?1:0}function Ye(e,t){if(!e||e==="none")return qe(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let s,i;if(n)s=_i,i=n;else{const a=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);s=$i,i=a}if(!i)return qe(t);const r=s[t],o=i[1].split(",").map(Gi);return typeof r=="function"?r(o):o[r]}const zi=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return Ye(n,t)};function Gi(e){return parseFloat(e.trim())}const se=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],ie=new Set(se),$t=e=>e===te||e===m,Ui=new Set(["x","y","z"]),Hi=se.filter(e=>!Ui.has(e));function qi(e){const t=[];return Hi.forEach(n=>{const s=e.getValue(n);s!==void 0&&(t.push([n,s.get()]),s.set(n.startsWith("scale")?1:0))}),t}const G={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>Ye(t,"x"),y:(e,{transform:t})=>Ye(t,"y")};G.translateX=G.x;G.translateY=G.y;const U=new Set;let Xe=!1,Ze=!1,Je=!1;function Nn(){if(Ze){const e=Array.from(U).filter(s=>s.needsMeasurement),t=new Set(e.map(s=>s.element)),n=new Map;t.forEach(s=>{const i=qi(s);i.length&&(n.set(s,i),s.render())}),e.forEach(s=>s.measureInitialState()),t.forEach(s=>{s.render();const i=n.get(s);i&&i.forEach(([r,o])=>{var a;(a=s.getValue(r))==null||a.set(o)})}),e.forEach(s=>s.measureEndState()),e.forEach(s=>{s.suspendedScrollY!==void 0&&window.scrollTo(0,s.suspendedScrollY)})}Ze=!1,Xe=!1,U.forEach(e=>e.complete(Je)),U.clear()}function Kn(){U.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Ze=!0)})}function Yi(){Je=!0,Kn(),Nn(),Je=!1}class yt{constructor(t,n,s,i,r,o=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=s,this.motionValue=i,this.element=r,this.isAsync=o}scheduleResolve(){this.state="scheduled",this.isAsync?(U.add(this),Xe||(Xe=!0,k.read(Kn),k.resolveKeyframes(Nn))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:s,motionValue:i}=this;if(t[0]===null){const r=i==null?void 0:i.get(),o=t[t.length-1];if(r!==void 0)t[0]=r;else if(s&&n){const a=s.readValue(n,o);a!=null&&(t[0]=a)}t[0]===void 0&&(t[0]=o),i&&r===void 0&&i.set(t[0])}Wi(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),U.delete(this)}cancel(){this.state==="scheduled"&&(U.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const Xi=e=>e.startsWith("--");function Zi(e,t,n){Xi(t)?e.style.setProperty(t,n):e.style[t]=n}const Ji=ot(()=>window.ScrollTimeline!==void 0),Qi={};function er(e,t){const n=ot(e);return()=>Qi[t]??n()}const jn=er(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),oe=([e,t,n,s])=>`cubic-bezier(${e}, ${t}, ${n}, ${s})`,_t={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:oe([0,.65,.55,1]),circOut:oe([.55,0,1,.45]),backIn:oe([.31,.01,.66,-.59]),backOut:oe([.33,1.53,.69,.99])};function Wn(e,t){if(e)return typeof e=="function"?jn()?kn(e,t):"ease-out":Vn(e)?oe(e):Array.isArray(e)?e.map(n=>Wn(n,t)||_t.easeOut):_t[e]}function tr(e,t,n,{delay:s=0,duration:i=300,repeat:r=0,repeatType:o="loop",ease:a="easeOut",times:c}={},l=void 0){const u={[t]:n};c&&(u.offset=c);const d=Wn(a,i);Array.isArray(d)&&(u.easing=d);const f={delay:s,duration:i,easing:Array.isArray(d)?"linear":d,fill:"both",iterations:r+1,direction:o==="reverse"?"alternate":"normal"};return l&&(f.pseudoElement=l),e.animate(u,f)}function $n(e){return typeof e=="function"&&"applyToOptions"in e}function nr({type:e,...t}){return $n(e)&&jn()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class sr extends mt{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,!t)return;const{element:n,name:s,keyframes:i,pseudoElement:r,allowFlatten:o=!1,finalKeyframe:a,onComplete:c}=t;this.isPseudoElement=!!r,this.allowFlatten=o,this.options=t,W(typeof t.type!="string",`animateMini doesn't support "type" as a string. Did you mean to import { spring } from "motion"?`);const l=nr(t);this.animation=tr(n,s,i,l,r),l.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!r){const u=pt(i,this.options,a,this.speed);this.updateMotionValue?this.updateMotionValue(u):Zi(n,s,u),this.animation.cancel()}c==null||c(),this.notifyFinished()}}play(){this.isStopped||(this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var t,n;(n=(t=this.animation).finish)==null||n.call(t)}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var t,n;this.isPseudoElement||(n=(t=this.animation).commitStyles)==null||n.call(t)}get duration(){var n,s;const t=((s=(n=this.animation.effect)==null?void 0:n.getComputedTiming)==null?void 0:s.call(n).duration)||0;return N(Number(t))}get time(){return N(Number(this.animation.currentTime)||0)}set time(t){this.finishedTime=null,this.animation.currentTime=B(t)}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return Number(this.animation.startTime)}set startTime(t){this.animation.startTime=t}attachTimeline({timeline:t,observe:n}){var s;return this.allowFlatten&&((s=this.animation.effect)==null||s.updateTiming({easing:"linear"})),this.animation.onfinish=null,t&&Ji()?(this.animation.timeline=t,ee):n(this)}}const _n={anticipate:wn,backInOut:vn,circInOut:xn};function ir(e){return e in _n}function rr(e){typeof e.ease=="string"&&ir(e.ease)&&(e.ease=_n[e.ease])}const zt=10;class or extends sr{constructor(t){rr(t),Ln(t),super(t),t.startTime&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:s,onComplete:i,element:r,...o}=this.options;if(!n)return;if(t!==void 0){n.set(t);return}const a=new gt({...o,autoplay:!1}),c=B(this.finishedTime??this.time);n.setWithVelocity(a.sample(c-zt).value,a.sample(c).value,zt),a.stop()}}const Gt=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(ne.test(e)||e==="0")&&!e.startsWith("url("));function ar(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function ur(e,t,n,s){const i=e[0];if(i===null)return!1;if(t==="display"||t==="visibility")return!0;const r=e[e.length-1],o=Gt(i,t),a=Gt(r,t);return Q(o===a,`You are trying to animate ${t} 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:ar(e)||(n==="spring"||$n(n))&&s}function zn(e){return Ws(e)&&"offsetHeight"in e}const cr=new Set(["opacity","clipPath","filter","transform"]),lr=ot(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function fr(e){var l;const{motionValue:t,name:n,repeatDelay:s,repeatType:i,damping:r,type:o}=e;if(!zn((l=t==null?void 0:t.owner)==null?void 0:l.current))return!1;const{onUpdate:a,transformTemplate:c}=t.owner.getProps();return lr()&&n&&cr.has(n)&&(n!=="transform"||!c)&&!a&&!s&&i!=="mirror"&&r!==0&&o!=="inertia"}const dr=40;class hr extends mt{constructor({autoplay:t=!0,delay:n=0,type:s="keyframes",repeat:i=0,repeatDelay:r=0,repeatType:o="loop",keyframes:a,name:c,motionValue:l,element:u,...d}){var b;super(),this.stop=()=>{var T,w;this._animation&&(this._animation.stop(),(T=this.stopTimeline)==null||T.call(this)),(w=this.keyframeResolver)==null||w.cancel()},this.createdAt=E.now();const f={autoplay:t,delay:n,type:s,repeat:i,repeatDelay:r,repeatType:o,name:c,motionValue:l,element:u,...d},h=(u==null?void 0:u.KeyframeResolver)||yt;this.keyframeResolver=new h(a,(T,w,p)=>this.onKeyframesResolved(T,w,f,!p),c,l,u),(b=this.keyframeResolver)==null||b.scheduleResolve()}onKeyframesResolved(t,n,s,i){this.keyframeResolver=void 0;const{name:r,type:o,velocity:a,delay:c,isHandoff:l,onUpdate:u}=s;this.resolvedAt=E.now(),ur(t,r,o,a)||((K.instantAnimations||!c)&&(u==null||u(pt(t,s,n))),t[0]=t[t.length-1],s.duration=0,s.repeat=0);const f={startTime:i?this.resolvedAt?this.resolvedAt-this.createdAt>dr?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...s,keyframes:t},h=!l&&fr(f)?new or({...f,element:f.motionValue.owner.current}):new gt(f);h.finished.then(()=>this.notifyFinished()).catch(ee),this.pendingTimeline&&(this.stopTimeline=h.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=h}get finished(){return this._animation?this.animation.finished:this._finished}then(t,n){return this.finished.finally(t).then(()=>{})}get animation(){var t;return this._animation||((t=this.keyframeResolver)==null||t.resume(),Yi()),this._animation}get duration(){return this.animation.duration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){var t;this._animation&&this.animation.cancel(),(t=this.keyframeResolver)==null||t.cancel()}}const pr=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function mr(e){const t=pr.exec(e);if(!t)return[,];const[,n,s,i]=t;return[`--${n??s}`,i]}const gr=4;function Gn(e,t,n=1){W(n<=gr,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`);const[s,i]=mr(e);if(!s)return;const r=window.getComputedStyle(t).getPropertyValue(s);if(r){const o=r.trim();return ln(o)?parseFloat(o):o}return ct(i)?Gn(i,t,n+1):i}function Un(e,t){return(e==null?void 0:e[t])??(e==null?void 0:e.default)??e}const Hn=new Set(["width","height","top","left","right","bottom",...se]),yr={test:e=>e==="auto",parse:e=>e},qn=e=>t=>t.test(e),Yn=[te,m,Z,j,ai,oi,yr],Ut=e=>Yn.find(qn(e));function br(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||fn(e):!0}const Tr=new Set(["brightness","contrast","saturate","opacity"]);function vr(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[s]=n.match(lt)||[];if(!s)return e;const i=n.replace(s,"");let r=Tr.has(t)?1:0;return s!==n&&(r*=100),t+"("+r+i+")"}const wr=/\b([a-z-]*)\(.*?\)/gu,Qe={...ne,getAnimatableNone:e=>{const t=e.match(wr);return t?t.map(vr).join(" "):e}},Ht={...te,transform:Math.round},xr={rotate:j,rotateX:j,rotateY:j,rotateZ:j,scale:ye,scaleX:ye,scaleY:ye,scaleZ:ye,skew:j,skewX:j,skewY:j,distance:m,translateX:m,translateY:m,translateZ:m,x:m,y:m,z:m,perspective:m,transformPerspective:m,opacity:ue,originX:It,originY:It,originZ:m},bt={borderWidth:m,borderTopWidth:m,borderRightWidth:m,borderBottomWidth:m,borderLeftWidth:m,borderRadius:m,radius:m,borderTopLeftRadius:m,borderTopRightRadius:m,borderBottomRightRadius:m,borderBottomLeftRadius:m,width:m,maxWidth:m,height:m,maxHeight:m,top:m,right:m,bottom:m,left:m,padding:m,paddingTop:m,paddingRight:m,paddingBottom:m,paddingLeft:m,margin:m,marginTop:m,marginRight:m,marginBottom:m,marginLeft:m,backgroundPositionX:m,backgroundPositionY:m,...xr,zIndex:Ht,fillOpacity:ue,strokeOpacity:ue,numOctaves:Ht},Sr={...bt,color:C,backgroundColor:C,outlineColor:C,fill:C,stroke:C,borderColor:C,borderTopColor:C,borderRightColor:C,borderBottomColor:C,borderLeftColor:C,filter:Qe,WebkitFilter:Qe},Xn=e=>Sr[e];function Zn(e,t){let n=Xn(e);return n!==Qe&&(n=ne),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const Vr=new Set(["auto","none","0"]);function Ar(e,t,n){let s=0,i;for(;s<e.length&&!i;){const r=e[s];typeof r=="string"&&!Vr.has(r)&&ce(r).values.length&&(i=e[s]),s++}if(i&&n)for(const r of t)e[r]=Zn(n,i)}class Mr extends yt{constructor(t,n,s,i,r){super(t,n,s,i,r,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:s}=this;if(!n||!n.current)return;super.readKeyframes();for(let c=0;c<t.length;c++){let l=t[c];if(typeof l=="string"&&(l=l.trim(),ct(l))){const u=Gn(l,n.current);u!==void 0&&(t[c]=u),c===t.length-1&&(this.finalKeyframe=l)}}if(this.resolveNoneKeyframes(),!Hn.has(s)||t.length!==2)return;const[i,r]=t,o=Ut(i),a=Ut(r);if(o!==a)if($t(o)&&$t(a))for(let c=0;c<t.length;c++){const l=t[c];typeof l=="string"&&(t[c]=parseFloat(l))}else G[s]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,s=[];for(let i=0;i<t.length;i++)(t[i]===null||br(t[i]))&&s.push(i);s.length&&Ar(t,s,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:s}=this;if(!t||!t.current)return;s==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=G[s](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const i=n[n.length-1];i!==void 0&&t.getValue(s,i).jump(i,!1)}measureEndState(){var a;const{element:t,name:n,unresolvedKeyframes:s}=this;if(!t||!t.current)return;const i=t.getValue(n);i&&i.jump(this.measuredOrigin,!1);const r=s.length-1,o=s[r];s[r]=G[n](t.measureViewportBox(),window.getComputedStyle(t.current)),o!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=o),(a=this.removedTransforms)!=null&&a.length&&this.removedTransforms.forEach(([c,l])=>{t.getValue(c).set(l)}),this.resolveNoneKeyframes()}}function Cr(e,t,n){if(e instanceof EventTarget)return[e];if(typeof e=="string"){const i=document.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e)}const Jn=(e,t)=>t&&typeof e=="number"?t.transform(e):e,qt=30,Pr=e=>!isNaN(parseFloat(e));class Fr{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=(s,i=!0)=>{var o,a;const r=E.now();if(this.updatedAt!==r&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(s),this.current!==this.prev&&((o=this.events.change)==null||o.notify(this.current),this.dependents))for(const c of this.dependents)c.dirty();i&&((a=this.events.renderRequest)==null||a.notify(this.current))},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=E.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=Pr(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return process.env.NODE_ENV!=="production"&&mn(!1,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new hn);const s=this.events[t].add(n);return t==="change"?()=>{s(),k.read(()=>{this.events.change.getSize()||this.stop()})}:s}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t,n=!0){!n||!this.passiveEffect?this.updateAndNotify(t,n):this.passiveEffect(t,this.updateAndNotify)}setWithVelocity(t,n,s){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-s}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var t;(t=this.events.change)==null||t.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=E.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>qt)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,qt);return pn(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),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(){var t,n;(t=this.dependents)==null||t.clear(),(n=this.events.destroy)==null||n.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Me(e,t){return new Fr(e,t)}const{schedule:Rr,cancel:Pa}=An(queueMicrotask,!1),Dr={x:!1,y:!1};function Or(){return Dr.y}function Qn(e,t){const n=Cr(e),s=new AbortController,i={passive:!0,...t,signal:s.signal};return[n,i,()=>s.abort()]}function Yt(e){return!(e.pointerType==="touch"||Or())}function Ir(e,t,n={}){const[s,i,r]=Qn(e,n),o=a=>{if(!Yt(a))return;const{target:c}=a,l=t(c,a);if(typeof l!="function"||!c)return;const u=d=>{Yt(d)&&(l(d),c.removeEventListener("pointerleave",u))};c.addEventListener("pointerleave",u,i)};return s.forEach(a=>{a.addEventListener("pointerenter",o,i)}),r}const es=(e,t)=>t?e===t?!0:es(e,t.parentElement):!1,Er=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,kr=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Br(e){return kr.has(e.tagName)||e.tabIndex!==-1}const ve=new WeakSet;function Xt(e){return t=>{t.key==="Enter"&&e(t)}}function Ne(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const Lr=(e,t)=>{const n=e.currentTarget;if(!n)return;const s=Xt(()=>{if(ve.has(n))return;Ne(n,"down");const i=Xt(()=>{Ne(n,"up")}),r=()=>Ne(n,"cancel");n.addEventListener("keyup",i,t),n.addEventListener("blur",r,t)});n.addEventListener("keydown",s,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",s),t)};function Zt(e){return Er(e)&&!0}function Nr(e,t,n={}){const[s,i,r]=Qn(e,n),o=a=>{const c=a.currentTarget;if(!Zt(a))return;ve.add(c);const l=t(c,a),u=(h,b)=>{window.removeEventListener("pointerup",d),window.removeEventListener("pointercancel",f),ve.has(c)&&ve.delete(c),Zt(h)&&typeof l=="function"&&l(h,{success:b})},d=h=>{u(h,c===window||c===document||n.useGlobalTarget||es(c,h.target))},f=h=>{u(h,!1)};window.addEventListener("pointerup",d,i),window.addEventListener("pointercancel",f,i)};return s.forEach(a=>{(n.useGlobalTarget?window:a).addEventListener("pointerdown",o,i),zn(a)&&(a.addEventListener("focus",l=>Lr(l,i)),!Br(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),r}const D=e=>!!(e&&e.getVelocity),Kr=[...Yn,C,ne],jr=e=>Kr.find(qn(e)),ts=y.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"}),Tt=y.createContext({strict:!1}),Jt={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"]},J={};for(const e in Jt)J[e]={isEnabled:t=>Jt[e].some(n=>!!t[n])};function et(e){for(const t in e)J[t]={...J[t],...e[t]}}function Wr({children:e,features:t,strict:n=!1}){const[,s]=y.useState(!Ke(t)),i=y.useRef(void 0);if(!Ke(t)){const{renderer:r,...o}=t;i.current=r,et(o)}return y.useEffect(()=>{Ke(t)&&t().then(({renderer:r,...o})=>{et(o),i.current=r,s(!0)})},[]),F.jsx(Tt.Provider,{value:{renderer:i.current,strict:n},children:e})}function Ke(e){return typeof e=="function"}const $r=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 Ce(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||$r.has(e)}let ns=e=>!Ce(e);function _r(e){typeof e=="function"&&(ns=t=>t.startsWith("on")?!Ce(t):e(t))}try{_r(require("@emotion/is-prop-valid").default)}catch{}function zr(e,t,n){const s={};for(const i in e)i==="values"&&typeof e.values=="object"||(ns(i)||n===!0&&Ce(i)||!t&&!Ce(i)||e.draggable&&i.startsWith("onDrag"))&&(s[i]=e[i]);return s}const Re=y.createContext({});function De(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function le(e){return typeof e=="string"||Array.isArray(e)}const vt=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],wt=["initial",...vt];function Oe(e){return De(e.animate)||wt.some(t=>le(e[t]))}function ss(e){return!!(Oe(e)||e.variants)}function Gr(e,t){if(Oe(e)){const{initial:n,animate:s}=e;return{initial:n===!1||le(n)?n:void 0,animate:le(s)?s:void 0}}return e.inherit!==!1?t:{}}function Ur(e){const{initial:t,animate:n}=Gr(e,y.useContext(Re));return y.useMemo(()=>({initial:t,animate:n}),[Qt(t),Qt(n)])}function Qt(e){return Array.isArray(e)?e.join(" "):e}const Hr=Symbol.for("motionComponentSymbol");function is(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function qr(e,t,n){return y.useCallback(s=>{s&&e.onMount&&e.onMount(s),t&&(s?t.mount(s):t.unmount()),n&&(typeof n=="function"?n(s):is(n)&&(n.current=s))},[t])}const xt=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),Yr="framerAppearId",rs="data-"+xt(Yr),Xr=y.createContext({});function Zr(e,t,n,s,i){var T,w;const{visualElement:r}=y.useContext(Re),o=y.useContext(Tt),a=y.useContext(cn),c=y.useContext(ts).reducedMotion,l=y.useRef(null);s=s||o.renderer,!l.current&&s&&(l.current=s(e,{visualState:t,parent:r,props:n,presenceContext:a,blockInitialAnimation:a?a.initial===!1:!1,reducedMotionConfig:c}));const u=l.current,d=y.useContext(Xr);u&&!u.projection&&i&&(u.type==="html"||u.type==="svg")&&Jr(l.current,n,i,d);const f=y.useRef(!1);y.useInsertionEffect(()=>{u&&f.current&&u.update(n,a)});const h=n[rs],b=y.useRef(!!h&&!((T=window.MotionHandoffIsComplete)!=null&&T.call(window,h))&&((w=window.MotionHasOptimisedAnimation)==null?void 0:w.call(window,h)));return Ns(()=>{u&&(f.current=!0,window.MotionIsMounted=!0,u.updateFeatures(),Rr.render(u.render),b.current&&u.animationState&&u.animationState.animateChanges())}),y.useEffect(()=>{u&&(!b.current&&u.animationState&&u.animationState.animateChanges(),b.current&&(queueMicrotask(()=>{var p;(p=window.MotionHandoffMarkAsComplete)==null||p.call(window,h)}),b.current=!1))}),u}function Jr(e,t,n,s){const{layoutId:i,layout:r,drag:o,dragConstraints:a,layoutScroll:c,layoutRoot:l,layoutCrossfade:u}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:os(e.parent)),e.projection.setOptions({layoutId:i,layout:r,alwaysMeasureLayout:!!o||a&&is(a),visualElement:e,animationType:typeof r=="string"?r:"both",initialPromotionConfig:s,crossfade:u,layoutScroll:c,layoutRoot:l})}function os(e){if(e)return e.options.allowProjection!==!1?e.projection:os(e.parent)}function Qr({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:s,Component:i}){e&&et(e);function r(a,c){let l;const u={...y.useContext(ts),...a,layoutId:eo(a)},{isStatic:d}=u,f=Ur(a),h=s(a,d);if(!d&&rt){to(u,e);const b=no(u);l=b.MeasureLayout,f.visualElement=Zr(i,h,u,t,b.ProjectionNode)}return F.jsxs(Re.Provider,{value:f,children:[l&&f.visualElement?F.jsx(l,{visualElement:f.visualElement,...u}):null,n(i,a,qr(h,f.visualElement,c),h,d,f.visualElement)]})}r.displayName=`motion.${typeof i=="string"?i:`create(${i.displayName??i.name??""})`}`;const o=y.forwardRef(r);return o[Hr]=i,o}function eo({layoutId:e}){const t=y.useContext(Bs).id;return t&&e!==void 0?t+"-"+e:e}function to(e,t){const n=y.useContext(Tt).strict;if(process.env.NODE_ENV!=="production"&&t&&n){const s="You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";e.ignoreStrict?Q(!1,s):W(!1,s)}}function no(e){const{drag:t,layout:n}=J;if(!t&&!n)return{};const s={...t,...n};return{MeasureLayout:t!=null&&t.isEnabled(e)||n!=null&&n.isEnabled(e)?s.MeasureLayout:void 0,ProjectionNode:s.ProjectionNode}}const so={};function as(e,{layout:t,layoutId:n}){return ie.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!so[e]||e==="opacity")}const io={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},ro=se.length;function oo(e,t,n){let s="",i=!0;for(let r=0;r<ro;r++){const o=se[r],a=e[o];if(a===void 0)continue;let c=!0;if(typeof a=="number"?c=a===(o.startsWith("scale")?1:0):c=parseFloat(a)===0,!c||n){const l=Jn(a,bt[o]);if(!c){i=!1;const u=io[o]||o;s+=`${u}(${l}) `}n&&(t[o]=l)}}return s=s.trim(),n?s=n(t,i?"":s):i&&(s="none"),s}function St(e,t,n){const{style:s,vars:i,transformOrigin:r}=e;let o=!1,a=!1;for(const c in t){const l=t[c];if(ie.has(c)){o=!0;continue}else if(Cn(c)){i[c]=l;continue}else{const u=Jn(l,bt[c]);c.startsWith("origin")?(a=!0,r[c]=u):s[c]=u}}if(t.transform||(o||n?s.transform=oo(t,e.transform,n):s.transform&&(s.transform="none")),a){const{originX:c="50%",originY:l="50%",originZ:u=0}=r;s.transformOrigin=`${c} ${l} ${u}`}}const Vt=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function us(e,t,n){for(const s in t)!D(t[s])&&!as(s,n)&&(e[s]=t[s])}function ao({transformTemplate:e},t){return y.useMemo(()=>{const n=Vt();return St(n,t,e),Object.assign({},n.vars,n.style)},[t])}function uo(e,t){const n=e.style||{},s={};return us(s,n,e),Object.assign(s,ao(e,t)),s}function co(e,t){const n={},s=uo(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,s.userSelect=s.WebkitUserSelect=s.WebkitTouchCallout="none",s.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=s,n}const lo={offset:"stroke-dashoffset",array:"stroke-dasharray"},fo={offset:"strokeDashoffset",array:"strokeDasharray"};function ho(e,t,n=1,s=0,i=!0){e.pathLength=1;const r=i?lo:fo;e[r.offset]=m.transform(-s);const o=m.transform(t),a=m.transform(n);e[r.array]=`${o} ${a}`}function cs(e,{attrX:t,attrY:n,attrScale:s,pathLength:i,pathSpacing:r=1,pathOffset:o=0,...a},c,l,u){if(St(e,a,l),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:d,style:f}=e;d.transform&&(f.transform=d.transform,delete d.transform),(f.transform||d.transformOrigin)&&(f.transformOrigin=d.transformOrigin??"50% 50%",delete d.transformOrigin),f.transform&&(f.transformBox=(u==null?void 0:u.transformBox)??"fill-box",delete d.transformBox),t!==void 0&&(d.x=t),n!==void 0&&(d.y=n),s!==void 0&&(d.scale=s),i!==void 0&&ho(d,i,r,o,!1)}const ls=()=>({...Vt(),attrs:{}}),fs=e=>typeof e=="string"&&e.toLowerCase()==="svg";function po(e,t,n,s){const i=y.useMemo(()=>{const r=ls();return cs(r,t,fs(s),e.transformTemplate,e.style),{...r.attrs,style:{...r.style}}},[t]);if(e.style){const r={};us(r,e.style,e),i.style={...r,...i.style}}return i}const mo=["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 At(e){return typeof e!="string"||e.includes("-")?!1:!!(mo.indexOf(e)>-1||/[A-Z]/u.test(e))}function go(e=!1){return(n,s,i,{latestValues:r},o)=>{const c=(At(n)?po:co)(s,r,o,n),l=zr(s,typeof n=="string",e),u=n!==y.Fragment?{...l,...c,ref:i}:{},{children:d}=s,f=y.useMemo(()=>D(d)?d.get():d,[d]);return y.createElement(n,{...u,children:f})}}function en(e){const t=[{},{}];return e==null||e.values.forEach((n,s)=>{t[0][s]=n.get(),t[1][s]=n.getVelocity()}),t}function Mt(e,t,n,s){if(typeof t=="function"){const[i,r]=en(s);t=t(n!==void 0?n:e.custom,i,r)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[i,r]=en(s);t=t(n!==void 0?n:e.custom,i,r)}return t}function yo(e){return D(e)?e.get():e}function bo({scrapeMotionValuesFromProps:e,createRenderState:t},n,s,i){return{latestValues:To(n,s,i,e),renderState:t()}}const ds=e=>(t,n)=>{const s=y.useContext(Re),i=y.useContext(cn),r=()=>bo(e,t,s,i);return n?r():Ls(r)};function To(e,t,n,s){const i={},r=s(e,{});for(const f in r)i[f]=yo(r[f]);let{initial:o,animate:a}=e;const c=Oe(e),l=ss(e);t&&l&&!c&&e.inherit!==!1&&(o===void 0&&(o=t.initial),a===void 0&&(a=t.animate));let u=n?n.initial===!1:!1;u=u||o===!1;const d=u?a:o;if(d&&typeof d!="boolean"&&!De(d)){const f=Array.isArray(d)?d:[d];for(let h=0;h<f.length;h++){const b=Mt(e,f[h]);if(b){const{transitionEnd:T,transition:w,...p}=b;for(const S in p){let g=p[S];if(Array.isArray(g)){const A=u?g.length-1:0;g=g[A]}g!==null&&(i[S]=g)}for(const S in T)i[S]=T[S]}}}return i}function Ct(e,t,n){var r;const{style:s}=e,i={};for(const o in s)(D(s[o])||t.style&&D(t.style[o])||as(o,e)||((r=n==null?void 0:n.getValue(o))==null?void 0:r.liveStyle)!==void 0)&&(i[o]=s[o]);return i}const vo={useVisualState:ds({scrapeMotionValuesFromProps:Ct,createRenderState:Vt})};function hs(e,t,n){const s=Ct(e,t,n);for(const i in e)if(D(e[i])||D(t[i])){const r=se.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;s[r]=e[i]}return s}const wo={useVisualState:ds({scrapeMotionValuesFromProps:hs,createRenderState:ls})};function xo(e,t){return function(s,{forwardMotionProps:i}={forwardMotionProps:!1}){const o={...At(s)?wo:vo,preloadedFeatures:e,useRender:go(i),createVisualElement:t,Component:s};return Qr(o)}}const So=xo();function fe(e,t,n){const s=e.getProps();return Mt(s,t,n!==void 0?n:s.custom,e)}const tt=e=>Array.isArray(e);function Vo(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Me(n))}function Ao(e){return tt(e)?e[e.length-1]||0:e}function Mo(e,t){const n=fe(e,t);let{transitionEnd:s={},transition:i={},...r}=n||{};r={...r,...s};for(const o in r){const a=Ao(r[o]);Vo(e,o,a)}}function Co(e){return!!(D(e)&&e.add)}function Po(e,t){const n=e.getValue("willChange");if(Co(n))return n.add(t);if(!n&&K.WillChange){const s=new K.WillChange("auto");e.addValue("willChange",s),s.add(t)}}function Fo(e){return e.props[rs]}const Ro=e=>e!==null;function Do(e,{repeat:t,repeatType:n="loop"},s){const i=e.filter(Ro),r=t&&n!=="loop"&&t%2===1?0:i.length-1;return i[r]}const Oo={type:"spring",stiffness:500,damping:25,restSpeed:10},Io=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),Eo={type:"keyframes",duration:.8},ko={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Bo=(e,{keyframes:t})=>t.length>2?Eo:ie.has(e)?e.startsWith("scale")?Io(t[1]):Oo:ko;function Lo({when:e,delay:t,delayChildren:n,staggerChildren:s,staggerDirection:i,repeat:r,repeatType:o,repeatDelay:a,from:c,elapsed:l,...u}){return!!Object.keys(u).length}const No=(e,t,n,s={},i,r)=>o=>{const a=Un(s,e)||{},c=a.delay||s.delay||0;let{elapsed:l=0}=s;l=l-B(c);const u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...a,delay:-l,onUpdate:f=>{t.set(f),a.onUpdate&&a.onUpdate(f)},onComplete:()=>{o(),a.onComplete&&a.onComplete()},name:e,motionValue:t,element:r?void 0:i};Lo(a)||Object.assign(u,Bo(e,u)),u.duration&&(u.duration=B(u.duration)),u.repeatDelay&&(u.repeatDelay=B(u.repeatDelay)),u.from!==void 0&&(u.keyframes[0]=u.from);let d=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(u.duration=0,u.delay===0&&(d=!0)),(K.instantAnimations||K.skipAnimations)&&(d=!0,u.duration=0,u.delay=0),u.allowFlatten=!a.type&&!a.ease,d&&!r&&t.get()!==void 0){const f=Do(u.keyframes,a);if(f!==void 0){k.update(()=>{u.onUpdate(f),u.onComplete()});return}}return a.isSync?new gt(u):new hr(u)};function Ko({protectedKeys:e,needsAnimating:t},n){const s=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,s}function ps(e,t,{delay:n=0,transitionOverride:s,type:i}={}){let{transition:r=e.getDefaultTransition(),transitionEnd:o,...a}=t;s&&(r=s);const c=[],l=i&&e.animationState&&e.animationState.getState()[i];for(const u in a){const d=e.getValue(u,e.latestValues[u]??null),f=a[u];if(f===void 0||l&&Ko(l,u))continue;const h={delay:n,...Un(r||{},u)},b=d.get();if(b!==void 0&&!d.isAnimating&&!Array.isArray(f)&&f===b&&!h.velocity)continue;let T=!1;if(window.MotionHandoffAnimation){const p=Fo(e);if(p){const S=window.MotionHandoffAnimation(p,u,k);S!==null&&(h.startTime=S,T=!0)}}Po(e,u),d.start(No(u,d,f,e.shouldReduceMotion&&Hn.has(u)?{type:!1}:h,e,T));const w=d.animation;w&&c.push(w)}return o&&Promise.all(c).then(()=>{k.update(()=>{o&&Mo(e,o)})}),c}function nt(e,t,n={}){var c;const s=fe(e,t,n.type==="exit"?(c=e.presenceContext)==null?void 0:c.custom:void 0);let{transition:i=e.getDefaultTransition()||{}}=s||{};n.transitionOverride&&(i=n.transitionOverride);const r=s?()=>Promise.all(ps(e,s,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(l=0)=>{const{delayChildren:u=0,staggerChildren:d,staggerDirection:f}=i;return jo(e,t,l,u,d,f,n)}:()=>Promise.resolve(),{when:a}=i;if(a){const[l,u]=a==="beforeChildren"?[r,o]:[o,r];return l().then(()=>u())}else return Promise.all([r(),o(n.delay)])}function jo(e,t,n=0,s=0,i=0,r=1,o){const a=[],c=e.variantChildren.size,l=(c-1)*i,u=typeof s=="function",d=u?f=>s(f,c):r===1?(f=0)=>f*i:(f=0)=>l-f*i;return Array.from(e.variantChildren).sort(Wo).forEach((f,h)=>{f.notify("AnimationStart",t),a.push(nt(f,t,{...o,delay:n+(u?0:s)+d(h)}).then(()=>f.notify("AnimationComplete",t)))}),Promise.all(a)}function Wo(e,t){return e.sortNodePosition(t)}function $o(e,t,n={}){e.notify("AnimationStart",t);let s;if(Array.isArray(t)){const i=t.map(r=>nt(e,r,n));s=Promise.all(i)}else if(typeof t=="string")s=nt(e,t,n);else{const i=typeof t=="function"?fe(e,t,n.custom):t;s=Promise.all(ps(e,i,n))}return s.then(()=>{e.notify("AnimationComplete",t)})}function ms(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let s=0;s<n;s++)if(t[s]!==e[s])return!1;return!0}const _o=wt.length;function gs(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?gs(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<_o;n++){const s=wt[n],i=e.props[s];(le(i)||i===!1)&&(t[s]=i)}return t}const zo=[...vt].reverse(),Go=vt.length;function Uo(e){return t=>Promise.all(t.map(({animation:n,options:s})=>$o(e,n,s)))}function Ho(e){let t=Uo(e),n=tn(),s=!0;const i=c=>(l,u)=>{var f;const d=fe(e,u,c==="exit"?(f=e.presenceContext)==null?void 0:f.custom:void 0);if(d){const{transition:h,transitionEnd:b,...T}=d;l={...l,...T,...b}}return l};function r(c){t=c(e)}function o(c){const{props:l}=e,u=gs(e.parent)||{},d=[],f=new Set;let h={},b=1/0;for(let w=0;w<Go;w++){const p=zo[w],S=n[p],g=l[p]!==void 0?l[p]:u[p],A=le(g),v=p===c?S.isActive:null;v===!1&&(b=w);let V=g===u[p]&&g!==l[p]&&A;if(V&&s&&e.manuallyAnimateOnMount&&(V=!1),S.protectedKeys={...h},!S.isActive&&v===null||!g&&!S.prevProp||De(g)||typeof g=="boolean")continue;const P=qo(S.prevProp,g);let x=P||p===c&&S.isActive&&!V&&A||w>b&&A,O=!1;const I=Array.isArray(g)?g:[g];let q=I.reduce(i(p),{});v===!1&&(q={});const{prevResolvedValues:Pt={}}=S,Rs={...Pt,...q},Ft=R=>{x=!0,f.has(R)&&(O=!0,f.delete(R)),S.needsAnimating[R]=!0;const L=e.getValue(R);L&&(L.liveStyle=!1)};for(const R in Rs){const L=q[R],Ie=Pt[R];if(h.hasOwnProperty(R))continue;let Ee=!1;tt(L)&&tt(Ie)?Ee=!ms(L,Ie):Ee=L!==Ie,Ee?L!=null?Ft(R):f.add(R):L!==void 0&&f.has(R)?Ft(R):S.protectedKeys[R]=!0}S.prevProp=g,S.prevResolvedValues=q,S.isActive&&(h={...h,...q}),s&&e.blockInitialAnimation&&(x=!1),x&&(!(V&&P)||O)&&d.push(...I.map(R=>({animation:R,options:{type:p}})))}if(f.size){const w={};if(typeof l.initial!="boolean"){const p=fe(e,Array.isArray(l.initial)?l.initial[0]:l.initial);p&&p.transition&&(w.transition=p.transition)}f.forEach(p=>{const S=e.getBaseTarget(p),g=e.getValue(p);g&&(g.liveStyle=!0),w[p]=S??null}),d.push({animation:w})}let T=!!d.length;return s&&(l.initial===!1||l.initial===l.animate)&&!e.manuallyAnimateOnMount&&(T=!1),s=!1,T?t(d):Promise.resolve()}function a(c,l){var d;if(n[c].isActive===l)return Promise.resolve();(d=e.variantChildren)==null||d.forEach(f=>{var h;return(h=f.animationState)==null?void 0:h.setActive(c,l)}),n[c].isActive=l;const u=o(c);for(const f in n)n[f].protectedKeys={};return u}return{animateChanges:o,setActive:a,setAnimateFunction:r,getState:()=>n,reset:()=>{n=tn(),s=!0}}}function qo(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!ms(t,e):!1}function $(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function tn(){return{animate:$(!0),whileInView:$(),whileHover:$(),whileTap:$(),whileDrag:$(),whileFocus:$(),exit:$()}}class re{constructor(t){this.isMounted=!1,this.node=t}update(){}}class Yo extends re{constructor(t){super(t),t.animationState||(t.animationState=Ho(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();De(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)==null||t.call(this)}}let Xo=0;class Zo extends re{constructor(){super(...arguments),this.id=Xo++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:s}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===s)return;const i=this.node.animationState.setActive("exit",!t);n&&!t&&i.then(()=>{n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const Jo={animation:{Feature:Yo},exit:{Feature:Zo}};function nn(e,t,n,s={passive:!0}){return e.addEventListener(t,n,s),()=>e.removeEventListener(t,n)}function ys(e){return{point:{x:e.pageX,y:e.pageY}}}function Qo({top:e,left:t,right:n,bottom:s}){return{x:{min:t,max:n},y:{min:e,max:s}}}function ea(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),s=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:s.y,right:s.x}}const sn=()=>({min:0,max:0}),bs=()=>({x:sn(),y:sn()});function ta(e,t){return Qo(ea(e.getBoundingClientRect(),t))}function rn(e,t,n){const{props:s}=e;e.animationState&&s.whileHover&&e.animationState.setActive("whileHover",n==="Start");const i="onHover"+n,r=s[i];r&&k.postRender(()=>r(t,ys(t)))}class na extends re{mount(){const{current:t}=this.node;t&&(this.unmount=Ir(t,(n,s)=>(rn(this.node,s,"Start"),i=>rn(this.node,i,"End"))))}unmount(){}}class sa extends re{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{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=Pe(nn(this.node.current,"focus",()=>this.onFocus()),nn(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function on(e,t,n){const{props:s}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&s.whileTap&&e.animationState.setActive("whileTap",n==="Start");const i="onTap"+(n==="End"?"":n),r=s[i];r&&k.postRender(()=>r(t,ys(t)))}class ia extends re{mount(){const{current:t}=this.node;t&&(this.unmount=Nr(t,(n,s)=>(on(this.node,s,"Start"),(i,{success:r})=>on(this.node,i,r?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const st=new WeakMap,je=new WeakMap,ra=e=>{const t=st.get(e.target);t&&t(e)},oa=e=>{e.forEach(ra)};function aa({root:e,...t}){const n=e||document;je.has(n)||je.set(n,{});const s=je.get(n),i=JSON.stringify(t);return s[i]||(s[i]=new IntersectionObserver(oa,{root:e,...t})),s[i]}function ua(e,t,n){const s=aa(t);return st.set(e,n),s.observe(e),()=>{st.delete(e),s.unobserve(e)}}const ca={some:0,all:1};class la extends re{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:s,amount:i="some",once:r}=t,o={root:n?n.current:void 0,rootMargin:s,threshold:typeof i=="number"?i:ca[i]},a=c=>{const{isIntersecting:l}=c;if(this.isInView===l||(this.isInView=l,r&&!l&&this.hasEnteredView))return;l&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",l);const{onViewportEnter:u,onViewportLeave:d}=this.node.getProps(),f=l?u:d;f&&f(c)};return ua(this.node.current,o,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(fa(t,n))&&this.startObserver()}unmount(){}}function fa({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const da={inView:{Feature:la},tap:{Feature:ia},focus:{Feature:sa},hover:{Feature:na}},it={current:null},Ts={current:!1};function ha(){if(Ts.current=!0,!!rt)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>it.current=e.matches;e.addEventListener("change",t),t()}else it.current=!1}const pa=new WeakMap;function ma(e,t,n){for(const s in t){const i=t[s],r=n[s];if(D(i))e.addValue(s,i);else if(D(r))e.addValue(s,Me(i,{owner:e}));else if(r!==i)if(e.hasValue(s)){const o=e.getValue(s);o.liveStyle===!0?o.jump(i):o.hasAnimated||o.set(i)}else{const o=e.getStaticValue(s);e.addValue(s,Me(o!==void 0?o:i,{owner:e}))}}for(const s in n)t[s]===void 0&&e.removeValue(s);return t}const an=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class ga{scrapeMotionValuesFromProps(t,n,s){return{}}constructor({parent:t,props:n,presenceContext:s,reducedMotionConfig:i,blockInitialAnimation:r,visualState:o},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=yt,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 f=E.now();this.renderScheduledAt<f&&(this.renderScheduledAt=f,k.render(this.render,!1,!0))};const{latestValues:c,renderState:l}=o;this.latestValues=c,this.baseTarget={...c},this.initialValues=n.initial?{...c}:{},this.renderState=l,this.parent=t,this.props=n,this.presenceContext=s,this.depth=t?t.depth+1:0,this.reducedMotionConfig=i,this.options=a,this.blockInitialAnimation=!!r,this.isControllingVariants=Oe(n),this.isVariantNode=ss(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:u,...d}=this.scrapeMotionValuesFromProps(n,{},this);for(const f in d){const h=d[f];c[f]!==void 0&&D(h)&&h.set(c[f],!1)}}mount(t){this.current=t,pa.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((n,s)=>this.bindToMotionValue(s,n)),Ts.current||ha(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:it.current,process.env.NODE_ENV!=="production"&&mn(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)}unmount(){this.projection&&this.projection.unmount(),We(this.notifyUpdate),We(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 n=this.features[t];n&&(n.unmount(),n.isMounted=!1)}this.current=null}bindToMotionValue(t,n){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const s=ie.has(t);s&&this.onBindTransform&&this.onBindTransform();const i=n.on("change",a=>{this.latestValues[t]=a,this.props.onUpdate&&k.preRender(this.notifyUpdate),s&&this.projection&&(this.projection.isTransformDirty=!0)}),r=n.on("renderRequest",this.scheduleRender);let o;window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{i(),r(),o&&o(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in J){const n=J[t];if(!n)continue;const{isEnabled:s,Feature:i}=n;if(!this.features[t]&&i&&s(this.props)&&(this.features[t]=new i(this)),this.features[t]){const r=this.features[t];r.isMounted?r.update():(r.mount(),r.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):bs()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let s=0;s<an.length;s++){const i=an[s];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const r="on"+i,o=t[r];o&&(this.propEventSubscriptions[i]=this.on(i,o))}this.prevMotionValues=ma(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 n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const s=this.values.get(t);n!==s&&(s&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let s=this.values.get(t);return s===void 0&&n!==void 0&&(s=Me(n===null?void 0:n,{owner:this}),this.addValue(t,s)),s}readValue(t,n){let s=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return s!=null&&(typeof s=="string"&&(ln(s)||fn(s))?s=parseFloat(s):!jr(s)&&ne.test(n)&&(s=Zn(t,n)),this.setBaseTarget(t,D(s)?s.get():s)),D(s)?s.get():s}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var r;const{initial:n}=this.props;let s;if(typeof n=="string"||typeof n=="object"){const o=Mt(this.props,n,(r=this.presenceContext)==null?void 0:r.custom);o&&(s=o[t])}if(n&&s!==void 0)return s;const i=this.getBaseTargetFromProps(this.props,t);return i!==void 0&&!D(i)?i:this.initialValues[t]!==void 0&&s===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new hn),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class vs extends ga{constructor(){super(...arguments),this.KeyframeResolver=Mr}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:s}){delete n[t],delete s[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;D(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function ws(e,{style:t,vars:n},s,i){const r=e.style;let o;for(o in t)r[o]=t[o];i==null||i.applyProjectionStyles(r,s);for(o in n)r.setProperty(o,n[o])}function ya(e){return window.getComputedStyle(e)}class ba extends vs{constructor(){super(...arguments),this.type="html",this.renderInstance=ws}readValueFromInstance(t,n){var s;if(ie.has(n))return(s=this.projection)!=null&&s.isProjecting?qe(n):zi(t,n);{const i=ya(t),r=(Cn(n)?i.getPropertyValue(n):i[n])||0;return typeof r=="string"?r.trim():r}}measureInstanceViewportBox(t,{transformPagePoint:n}){return ta(t,n)}build(t,n,s){St(t,n,s.transformTemplate)}scrapeMotionValuesFromProps(t,n,s){return Ct(t,n,s)}}const xs=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 Ta(e,t,n,s){ws(e,t,void 0,s);for(const i in t.attrs)e.setAttribute(xs.has(i)?i:xt(i),t.attrs[i])}class va extends vs{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=bs}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(ie.has(n)){const s=Xn(n);return s&&s.default||0}return n=xs.has(n)?n:xt(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,s){return hs(t,n,s)}build(t,n,s){cs(t,n,this.isSVGTag,s.transformTemplate,s.style)}renderInstance(t,n,s,i){Ta(t,n,s,i)}mount(t){this.isSVGTag=fs(t.tagName),super.mount(t)}}const wa=(e,t)=>At(e)?new va(t):new ba(t,{allowProjection:e!==y.Fragment}),xa={renderer:wa,...Jo,...da},un=So("span"),Sa={Root:{0:{h:"5"},1:{h:"6"},2:{h:"8"}}},Ss={Root:{0:"1",1:"2",2:"2"},Text:{0:"1",1:"2",2:"2"}},pe={Root:{solid:{default:"gray-12",accent:"accent-9",gray:"gray-9",red:"red-9",blue:"blue-9",green:"green-9",yellow:"yellow-9",purple:"purple-9"},soft:{default:"gray-3",accent:"accent-3",gray:"gray-3",red:"red-3",blue:"blue-3",green:"green-3",yellow:"yellow-3",purple:"purple-3"}},Icon:{solid:{default:"white",gray:"white",red:"white",accent:"white",blue:"white",green:"white",yellow:"white",purple:"white"},soft:{default:"default",gray:"gray",accent:"accent",red:"red",blue:"blue",green:"green",yellow:"yellow",purple:"purple"}},Text:{solid:{default:"white",gray:"white",accent:"white",red:"white",blue:"white",green:"white",yellow:"white",purple:"white"},soft:{default:"default",gray:"gray",accent:"accent",red:"red",blue:"blue",green:"green",yellow:"yellow",purple:"purple"}},Button:{solid:{default:"default",gray:"gray",accent:"accent",red:"red",blue:"blue",green:"green",yellow:"yellow",purple:"purple"},soft:{default:"gray",gray:"gray",accent:"accent",red:"red",blue:"blue",green:"green",yellow:"yellow",purple:"purple"}}},me=y.createContext({size:"1",color:"default",variant:"soft"}),Vs=({as:e="span",size:t="1",color:n="default",variant:s="soft",className:i,...r})=>F.jsx(me.Provider,{value:{size:t,color:n,variant:s},children:F.jsx(Os.Stack,{as:e,align:"center",rounded:"2",display:"inline-flex",pl:Ss.Root[t],backgroundColor:pe.Root[s][n],h:Sa.Root[t].h,className:ks.clsx("tgph-tag",i),...r,"data-tag":!0})}),As=({as:e="span",maxW:t="40",overflow:n="hidden",style:s,...i})=>{const r=y.useContext(me);return F.jsx(Es.Text,{as:e,size:r.size,color:pe.Text[r.variant][r.color],weight:"medium",mr:Ss.Text[r.size],maxW:t,overflow:n,internal_optionalAs:!0,style:{whiteSpace:"nowrap",textOverflow:"ellipsis",...s},...i})},Ms=({onClick:e,textToCopy:t,...n})=>{const s=y.useContext(me),[i,r]=y.useState(!1);return y.useEffect(()=>{if(i){const o=setTimeout(()=>r(!1),2e3);return()=>clearTimeout(o)}},[i]),F.jsx(Wr,{features:xa,children:F.jsx(Is.Tooltip,{label:"Copy text",children:F.jsxs(be.Button.Root,{onClick:o=>{var a;e==null||e(o),r(!0),t&&navigator.clipboard.writeText(t),(a=o.currentTarget)==null||a.blur()},size:s.size,color:pe.Button[s.variant][s.color],variant:s.variant,roundedTopRight:"3",roundedBottomRight:"3",roundedTopLeft:"0",roundedBottomLeft:"0",position:"relative",overflow:"hidden",p:"2",...n,children:[F.jsx(be.Button.Icon,{as:un,initial:!1,animate:{y:i?0:"150%",opacity:1},transition:{duration:.15,type:"spring",bounce:0},icon:we.Check,alt:"Copied text","aria-hidden":!i}),F.jsx(be.Button.Icon,{as:un,initial:!1,animate:{y:i?"-150%":0,opacity:1},transition:{duration:.15,type:"spring",bounce:0},icon:we.Copy,position:"absolute",alt:"Copy text","aria-hidden":i})]})})})},Cs=({...e})=>{const t=y.useContext(me);return F.jsx(be.Button,{size:t.size,color:pe.Button[t.variant][t.color],variant:t.variant,icon:{icon:we.X,alt:"close"},roundedTopRight:"3",roundedBottomRight:"3",roundedTopLeft:"0",roundedBottomLeft:"0",...e})},Ps=({icon:e,alt:t,"aria-hidden":n,...s})=>{const i=y.useContext(me),r=t?{alt:t}:{"aria-hidden":n};return F.jsx(Ds.Icon,{icon:e,size:i.size,color:pe.Icon[i.variant][i.color],mr:"1",roundedTopRight:"3",roundedBottomRight:"3",roundedTopLeft:"0",roundedBottomLeft:"0",...r,...s})},Fs=({color:e="default",size:t="1",variant:n="soft",icon:s,onRemove:i,onCopy:r,textToCopy:o,textProps:a={maxW:"40"},children:c,...l})=>F.jsxs(Vs,{color:e,size:t,variant:n,...l,children:[s&&F.jsx(Ps,{...s}),F.jsx(As,{as:"span",...a,children:c}),i&&F.jsx(Cs,{onClick:i,icon:{icon:we.X,alt:"Remove"}}),r&&F.jsx(Ms,{onClick:r,textToCopy:o})]});Object.assign(Fs,{Root:Vs,Button:Cs,Text:As,Icon:Ps,CopyButton:Ms});const Va=Fs;exports.Tag=Va;
2
2
  //# sourceMappingURL=index.js.map