@travel-match/ui 0.2.0 → 0.4.0

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.
Files changed (54) hide show
  1. package/dist/components/CtaSentence/CtaSentence.cjs +1 -1
  2. package/dist/components/CtaSentence/CtaSentence.cjs.map +1 -1
  3. package/dist/components/CtaSentence/CtaSentence.js +142 -69
  4. package/dist/components/CtaSentence/CtaSentence.js.map +1 -1
  5. package/dist/components/HeroColumns/heroMotion.cjs +1 -1
  6. package/dist/components/HeroColumns/heroMotion.cjs.map +1 -1
  7. package/dist/components/HeroColumns/heroMotion.js +7 -44
  8. package/dist/components/HeroColumns/heroMotion.js.map +1 -1
  9. package/dist/components/HeroMap/HeroMap.cjs +1 -1
  10. package/dist/components/HeroMap/HeroMap.cjs.map +1 -1
  11. package/dist/components/HeroMap/HeroMap.js +58 -67
  12. package/dist/components/HeroMap/HeroMap.js.map +1 -1
  13. package/dist/components/HeroSwitcher/HeroSwitcher.cjs +1 -1
  14. package/dist/components/HeroSwitcher/HeroSwitcher.cjs.map +1 -1
  15. package/dist/components/HeroSwitcher/HeroSwitcher.js +85 -92
  16. package/dist/components/HeroSwitcher/HeroSwitcher.js.map +1 -1
  17. package/dist/components/HowItWorksSteps/HowItWorksSteps.cjs +1 -1
  18. package/dist/components/HowItWorksSteps/HowItWorksSteps.cjs.map +1 -1
  19. package/dist/components/HowItWorksSteps/HowItWorksSteps.js +84 -102
  20. package/dist/components/HowItWorksSteps/HowItWorksSteps.js.map +1 -1
  21. package/dist/components/LogoAnimation/LogoAnimation.cjs +2 -0
  22. package/dist/components/LogoAnimation/LogoAnimation.cjs.map +1 -0
  23. package/dist/components/LogoAnimation/LogoAnimation.js +202 -0
  24. package/dist/components/LogoAnimation/LogoAnimation.js.map +1 -0
  25. package/dist/components/LogoAnimation/LogoAnimationArtwork.cjs +2 -0
  26. package/dist/components/LogoAnimation/LogoAnimationArtwork.cjs.map +1 -0
  27. package/dist/components/LogoAnimation/LogoAnimationArtwork.js +57 -0
  28. package/dist/components/LogoAnimation/LogoAnimationArtwork.js.map +1 -0
  29. package/dist/components/LogoAnimation/motion.cjs +2 -0
  30. package/dist/components/LogoAnimation/motion.cjs.map +1 -0
  31. package/dist/components/LogoAnimation/motion.js +180 -0
  32. package/dist/components/LogoAnimation/motion.js.map +1 -0
  33. package/dist/components/PackageAnimation/PackageAnimation.cjs +1 -1
  34. package/dist/components/PackageAnimation/PackageAnimation.cjs.map +1 -1
  35. package/dist/components/PackageAnimation/PackageAnimation.js +31 -40
  36. package/dist/components/PackageAnimation/PackageAnimation.js.map +1 -1
  37. package/dist/components/PartnerCarousel/PartnerCarousel.cjs +1 -1
  38. package/dist/components/PartnerCarousel/PartnerCarousel.cjs.map +1 -1
  39. package/dist/components/PartnerCarousel/PartnerCarousel.js +94 -101
  40. package/dist/components/PartnerCarousel/PartnerCarousel.js.map +1 -1
  41. package/dist/components/PartnerCarousel/autoplay.cjs +1 -1
  42. package/dist/components/PartnerCarousel/autoplay.cjs.map +1 -1
  43. package/dist/components/PartnerCarousel/autoplay.js +13 -9
  44. package/dist/components/PartnerCarousel/autoplay.js.map +1 -1
  45. package/dist/index.cjs +1 -1
  46. package/dist/index.d.cts +62 -55
  47. package/dist/index.d.ts +62 -55
  48. package/dist/index.js +100 -99
  49. package/dist/styles.css +1 -1
  50. package/package.json +1 -1
  51. package/dist/components/PartnerCarousel/AutoplayToggle.cjs +0 -2
  52. package/dist/components/PartnerCarousel/AutoplayToggle.cjs.map +0 -1
  53. package/dist/components/PartnerCarousel/AutoplayToggle.js +0 -36
  54. package/dist/components/PartnerCarousel/AutoplayToggle.js.map +0 -1
@@ -31,129 +31,111 @@ var l = /* @__PURE__ */ n(function({ icon: e, className: n, children: r, ...i },
31
31
  document.removeEventListener("visibilitychange", n), i?.disconnect();
32
32
  };
33
33
  }, [e, t]), n && a;
34
- }, p = /* @__PURE__ */ n(function({ items: n, value: l, defaultValue: p, onValueChange: m, autoPlay: h = !1, interval: g = 2200, paused: _ = !1, label: v, pauseLabel: y = "Pause", playLabel: b = "Play", collapseBelow: x, className: S, style: C, onPointerEnter: w, onPointerLeave: T, onFocus: E, onBlur: D, ...O }, k) {
35
- let A = a(null), j = r((e) => {
36
- A.current = e, typeof k == "function" ? k(e) : k && (k.current = e);
37
- }, [k]), [M, N] = o(p), [P, F] = o(!1), [I, L] = o(!1), [R, z] = o(!1), B = d(), V = f(A, h), H = n.length, U = l === void 0 ? M : l, W = n.findIndex((e) => e.value === U), G = W === -1 ? 0 : W, K = (e) => {
34
+ }, p = /* @__PURE__ */ n(function({ items: n, value: l, defaultValue: p, onValueChange: m, autoPlay: h = !0, interval: g = 2200, paused: _ = !1, label: v, collapseBelow: y, className: b, style: x, onPointerEnter: S, onPointerLeave: C, onFocus: w, onBlur: T, ...E }, D) {
35
+ let O = a(null), k = r((e) => {
36
+ O.current = e, typeof D == "function" ? D(e) : D && (D.current = e);
37
+ }, [D]), [A, j] = o(p), [M, N] = o(!1), [P, F] = o(!1), I = d(), L = f(O, h), R = n.length, z = l === void 0 ? A : l, B = n.findIndex((e) => e.value === z), V = B === -1 ? 0 : B, H = (e) => {
38
38
  let t = n[e];
39
- t && e !== G && (l === void 0 && N(t.value), m?.(t.value));
40
- }, q = a(K);
41
- q.current = K;
42
- let J = h && H > 1 && !B, Y = J && !P && !_ && !I && !R && V;
39
+ t && e !== V && (l === void 0 && j(t.value), m?.(t.value));
40
+ }, U = a(H);
41
+ U.current = H;
42
+ let W = h && R > 1 && !I && !_ && !M && !P && L;
43
43
  if (i(() => {
44
- if (!Y) return;
45
- let e = window.setTimeout(() => q.current((G + 1) % H), Math.max(g, 0) + u);
44
+ if (!W) return;
45
+ let e = window.setTimeout(() => U.current((V + 1) % R), Math.max(g, 0) + u);
46
46
  return () => window.clearTimeout(e);
47
47
  }, [
48
- Y,
49
- G,
50
- H,
48
+ W,
49
+ V,
50
+ R,
51
51
  g
52
- ]), H === 0) return null;
53
- let X = Math.max(480, x ?? H * 136 + (H - 1) * 16), Z = {
54
- "--_count": H,
55
- "--_progress": H > 1 ? G / (H - 1) : 0,
56
- "--_collapse": X,
57
- ...C
52
+ ]), R === 0) return null;
53
+ let G = Math.max(480, y ?? R * 136 + (R - 1) * 16), K = {
54
+ "--_count": R,
55
+ "--_progress": R > 1 ? V / (R - 1) : 0,
56
+ "--_collapse": G,
57
+ ...x
58
58
  };
59
59
  return /* @__PURE__ */ s("div", {
60
- ref: j,
61
- className: t("tm-how-it-works-steps", S),
62
- style: Z,
63
- "data-playing": Y ? "" : void 0,
60
+ ref: k,
61
+ className: t("tm-how-it-works-steps", b),
62
+ style: K,
63
+ "data-playing": W ? "" : void 0,
64
64
  onPointerEnter: (e) => {
65
- w?.(e), e.pointerType !== "touch" && L(!0);
65
+ S?.(e), e.pointerType !== "touch" && N(!0);
66
66
  },
67
67
  onPointerLeave: (e) => {
68
- T?.(e), L(!1);
68
+ C?.(e), N(!1);
69
69
  },
70
70
  onFocus: (e) => {
71
- E?.(e), z(!0);
71
+ w?.(e);
72
+ let t = !0;
73
+ try {
74
+ t = e.target.matches(":focus-visible");
75
+ } catch {}
76
+ t && F(!0);
72
77
  },
73
78
  onBlur: (e) => {
74
- D?.(e), e.currentTarget.contains(e.relatedTarget) || z(!1);
79
+ T?.(e), e.currentTarget.contains(e.relatedTarget) || F(!1);
75
80
  },
76
- ...O,
81
+ ...E,
77
82
  children: /* @__PURE__ */ s("div", {
78
83
  className: "tm-how-it-works-steps__frame",
79
84
  children: /* @__PURE__ */ c("div", {
80
85
  className: "tm-how-it-works-steps__inner",
81
- children: [
82
- J ? /* @__PURE__ */ s("div", {
83
- className: "tm-how-it-works-steps__controls",
84
- children: /* @__PURE__ */ s("button", {
85
- type: "button",
86
- className: "tm-how-it-works-steps__toggle",
87
- "aria-label": P ? b : y,
88
- onClick: () => F((e) => !e),
89
- children: /* @__PURE__ */ s("svg", {
90
- viewBox: "0 0 16 16",
91
- width: "16",
92
- height: "16",
93
- fill: "currentColor",
94
- "aria-hidden": "true",
95
- focusable: "false",
96
- children: P ? /* @__PURE__ */ s("path", { d: "M5 3.2v9.6a.6.6 0 0 0 .92.5l7.4-4.8a.6.6 0 0 0 0-1L5.92 2.7a.6.6 0 0 0-.92.5Z" }) : /* @__PURE__ */ s("path", { d: "M4 3h3v10H4zM9 3h3v10H9z" })
86
+ children: [/* @__PURE__ */ c("div", {
87
+ className: "tm-how-it-works-steps__rail",
88
+ "aria-hidden": "true",
89
+ "data-tm-icon-size": "sm",
90
+ children: [
91
+ /* @__PURE__ */ s("span", { className: "tm-how-it-works-steps__track" }),
92
+ /* @__PURE__ */ s("span", { className: "tm-how-it-works-steps__progress" }),
93
+ n.map((t, n) => /* @__PURE__ */ c("span", {
94
+ className: "tm-how-it-works-steps__node",
95
+ "data-state": n < V ? "done" : n === V ? "current" : "upcoming",
96
+ children: [/* @__PURE__ */ s("span", {
97
+ className: "tm-how-it-works-steps__number",
98
+ children: n + 1
99
+ }), /* @__PURE__ */ s(e, { className: "tm-how-it-works-steps__check" })]
100
+ }, t.value))
101
+ ]
102
+ }), /* @__PURE__ */ s("ol", {
103
+ className: "tm-how-it-works-steps__list",
104
+ "aria-label": v,
105
+ children: n.map((e, t) => {
106
+ let n = t === V;
107
+ return /* @__PURE__ */ s("li", {
108
+ className: "tm-how-it-works-steps__item",
109
+ children: /* @__PURE__ */ c("button", {
110
+ type: "button",
111
+ className: "tm-how-it-works-steps__card",
112
+ "aria-current": n ? "step" : void 0,
113
+ "data-current": n ? "" : void 0,
114
+ onClick: () => H(t),
115
+ children: [/* @__PURE__ */ c("span", {
116
+ className: "tm-how-it-works-steps__main",
117
+ children: [e.icon ? /* @__PURE__ */ s("span", {
118
+ className: "tm-how-it-works-steps__icon",
119
+ "data-tm-icon-size": "md",
120
+ children: e.icon
121
+ }) : null, /* @__PURE__ */ c("span", {
122
+ className: "tm-how-it-works-steps__text",
123
+ children: [/* @__PURE__ */ s("span", {
124
+ className: "tm-how-it-works-steps__title",
125
+ children: e.title
126
+ }), e.description ? /* @__PURE__ */ s("span", {
127
+ className: "tm-how-it-works-steps__description",
128
+ children: e.description
129
+ }) : null]
130
+ })]
131
+ }), e.badge ? /* @__PURE__ */ s("span", {
132
+ className: "tm-how-it-works-steps__badge",
133
+ children: e.badge
134
+ }) : null]
97
135
  })
98
- })
99
- }) : null,
100
- /* @__PURE__ */ c("div", {
101
- className: "tm-how-it-works-steps__rail",
102
- "aria-hidden": "true",
103
- "data-tm-icon-size": "sm",
104
- children: [
105
- /* @__PURE__ */ s("span", { className: "tm-how-it-works-steps__track" }),
106
- /* @__PURE__ */ s("span", { className: "tm-how-it-works-steps__progress" }),
107
- n.map((t, n) => /* @__PURE__ */ c("span", {
108
- className: "tm-how-it-works-steps__node",
109
- "data-state": n < G ? "done" : n === G ? "current" : "upcoming",
110
- children: [/* @__PURE__ */ s("span", {
111
- className: "tm-how-it-works-steps__number",
112
- children: n + 1
113
- }), /* @__PURE__ */ s(e, { className: "tm-how-it-works-steps__check" })]
114
- }, t.value))
115
- ]
116
- }),
117
- /* @__PURE__ */ s("ol", {
118
- className: "tm-how-it-works-steps__list",
119
- "aria-label": v,
120
- children: n.map((e, t) => {
121
- let n = t === G;
122
- return /* @__PURE__ */ s("li", {
123
- className: "tm-how-it-works-steps__item",
124
- children: /* @__PURE__ */ c("button", {
125
- type: "button",
126
- className: "tm-how-it-works-steps__card",
127
- "aria-current": n ? "step" : void 0,
128
- "data-current": n ? "" : void 0,
129
- onClick: () => {
130
- F(!0), K(t);
131
- },
132
- children: [/* @__PURE__ */ c("span", {
133
- className: "tm-how-it-works-steps__main",
134
- children: [e.icon ? /* @__PURE__ */ s("span", {
135
- className: "tm-how-it-works-steps__icon",
136
- "data-tm-icon-size": "md",
137
- children: e.icon
138
- }) : null, /* @__PURE__ */ c("span", {
139
- className: "tm-how-it-works-steps__text",
140
- children: [/* @__PURE__ */ s("span", {
141
- className: "tm-how-it-works-steps__title",
142
- children: e.title
143
- }), e.description ? /* @__PURE__ */ s("span", {
144
- className: "tm-how-it-works-steps__description",
145
- children: e.description
146
- }) : null]
147
- })]
148
- }), e.badge ? /* @__PURE__ */ s("span", {
149
- className: "tm-how-it-works-steps__badge",
150
- children: e.badge
151
- }) : null]
152
- })
153
- }, e.value);
154
- })
136
+ }, e.value);
155
137
  })
156
- ]
138
+ })]
157
139
  })
158
140
  })
159
141
  });
@@ -1 +1 @@
1
- {"version":3,"file":"HowItWorksSteps.js","names":["HowItWorksStepTag","props","cn","className","icon","children","STEP_DURATION","useReducedMotion","reduced","setReduced","useState","useEffect","query","update","useOnScreen","inView","setInView","tabVisible","setTabVisible","enabled","observer","ref","entry","HowItWorksSteps","rootRef","useRef","setRef","useCallback","node","uncontrolled","setUncontrolled","defaultValue","stopped","setStopped","hovered","setHovered","focused","setFocused","reducedMotion","onScreen","autoPlay","count","items","requested","value","found","item","activeIndex","select","next","index","onValueChange","selectRef","canPlay","playing","paused","timer","interval","threshold","collapseBelow","rootStyle","style","onPointerEnter","event","onPointerLeave","onFocus","onBlur","playLabel","pauseLabel","current","CheckmarkIcon","label","isCurrent"],"sources":["../../../src/components/HowItWorksSteps/HowItWorksSteps.tsx"],"sourcesContent":["import {\n forwardRef,\n useCallback,\n useEffect,\n useRef,\n useState,\n type CSSProperties,\n type FocusEvent,\n type HTMLAttributes,\n type PointerEvent,\n type ReactNode,\n} from 'react';\nimport { CheckmarkIcon } from '../../icons';\nimport { cn } from '../../utils/cn';\nimport './HowItWorksSteps.css';\n\nexport interface HowItWorksStepItem {\n /** Identifies the step in `value` / `onValueChange`. */\n value: string;\n /** One icon from `@travel-match/ui` for the icon tile, e.g. `<PaperIcon />`. */\n icon?: ReactNode;\n /** Step name, e.g. \"Submit a request\". Phrasing content only — it is rendered inside a button. */\n title: ReactNode;\n /** One or two sentences about the step. Phrasing content only. */\n description?: ReactNode;\n /** Pill at the bottom of the card, e.g. a `<RequestStatus>` or a `<Tag>`. Must not be interactive. */\n badge?: ReactNode;\n}\n\nexport interface HowItWorksStepsProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children' | 'defaultValue' | 'onChange'> {\n /** The steps, in order. Nothing is rendered for an empty list. */\n items: HowItWorksStepItem[];\n /** Controlled: `value` of the current step (Figma \"Step\"). */\n value?: string;\n /** Uncontrolled: `value` of the step that starts current. Defaults to the first one. */\n defaultValue?: string;\n /** Called with the `value` of the step that became current, by a click or by auto-play. */\n onValueChange?: (value: string) => void;\n /** Advances to the next step on a timer and loops. Stops for good once the user picks a step or presses pause. */\n autoPlay?: boolean;\n /** Time a step rests once its 500ms transition has finished, in ms (Figma: 2200 — a new step every 2.7s). */\n interval?: number;\n /** Holds auto-play without unmounting it (e.g. while a dialog is open). */\n paused?: boolean;\n /** Accessible name of the list of steps, e.g. \"How it works\". */\n label?: string;\n /** Accessible name of the pause button shown while auto-playing. Translate it in the app. */\n pauseLabel?: string;\n /** Accessible name of the same button once auto-play is paused. Translate it in the app. */\n playLabel?: string;\n /** Width of the component in px below which the steps stack (the Figma mobile layout). Default: 136px per step plus the gaps, at least 480. */\n collapseBelow?: number;\n}\n\nexport interface HowItWorksStepTagProps extends HTMLAttributes<HTMLSpanElement> {\n /** One icon from `@travel-match/ui`, e.g. `<CompareIcon />`. */\n icon?: ReactNode;\n}\n\n/** The tinted pill Figma draws at the bottom of the steps that have no request status (\"Up to 3 offers\"). Use it as a step's `badge`. */\nexport const HowItWorksStepTag = /* @__PURE__ */ forwardRef<HTMLSpanElement, HowItWorksStepTagProps>(function HowItWorksStepTag(\n { icon, className, children, ...props },\n ref,\n) {\n return (\n <span ref={ref} className={cn('tm-how-it-works-steps__tag', className)} data-tm-icon-size=\"sm\" {...props}>\n {icon}\n {children}\n </span>\n );\n});\n\n/** Figma prototype: Smart animate, ease in and out, 500ms. Keep in sync with `--_duration` in the stylesheet. */\nconst STEP_DURATION = 500;\n\nconst useReducedMotion = () => {\n const [reduced, setReduced] = useState(false);\n useEffect(() => {\n if (typeof window === 'undefined' || typeof window.matchMedia !== 'function') return;\n const query = window.matchMedia('(prefers-reduced-motion: reduce)');\n const update = () => setReduced(query.matches);\n update();\n query.addEventListener?.('change', update);\n return () => query.removeEventListener?.('change', update);\n }, []);\n return reduced;\n};\n\n/** True while the element is on screen and the tab is visible — the only time a timer should run. */\nconst useOnScreen = (ref: { current: Element | null }, enabled: boolean) => {\n const [inView, setInView] = useState(true);\n const [tabVisible, setTabVisible] = useState(true);\n useEffect(() => {\n if (!enabled) return;\n const update = () => setTabVisible(document.visibilityState !== 'hidden');\n update();\n document.addEventListener('visibilitychange', update);\n let observer: IntersectionObserver | undefined;\n if (ref.current && typeof IntersectionObserver === 'function') {\n observer = new IntersectionObserver(([entry]) => setInView(entry.isIntersecting));\n observer.observe(ref.current);\n }\n return () => {\n document.removeEventListener('visibilitychange', update);\n observer?.disconnect();\n };\n }, [ref, enabled]);\n return inView && tabVisible;\n};\n\n/**\n * The request journey as a numbered rail over a row of step cards, one of which is current\n * (Figma \"How it works / Steps\"; its \"Step=1…7\" variants are the `value`). Every card is a button that makes its step\n * current; with `autoPlay` the steps also advance on a timer until the user takes over. Below `collapseBelow` the\n * cards stack and the rail is dropped (Figma \"Mobile / How it works / Steps\").\n */\nexport const HowItWorksSteps = /* @__PURE__ */ forwardRef<HTMLDivElement, HowItWorksStepsProps>(function HowItWorksSteps(\n {\n items,\n value,\n defaultValue,\n onValueChange,\n autoPlay = false,\n interval = 2200,\n paused = false,\n label,\n pauseLabel = 'Pause',\n playLabel = 'Play',\n collapseBelow,\n className,\n style,\n onPointerEnter,\n onPointerLeave,\n onFocus,\n onBlur,\n ...props\n },\n ref,\n) {\n const rootRef = useRef<HTMLDivElement | null>(null);\n const setRef = useCallback(\n (node: HTMLDivElement | null) => {\n rootRef.current = node;\n if (typeof ref === 'function') ref(node);\n else if (ref) ref.current = node;\n },\n [ref],\n );\n\n const [uncontrolled, setUncontrolled] = useState(defaultValue);\n const [stopped, setStopped] = useState(false);\n const [hovered, setHovered] = useState(false);\n const [focused, setFocused] = useState(false);\n const reducedMotion = useReducedMotion();\n const onScreen = useOnScreen(rootRef, autoPlay);\n\n const count = items.length;\n const requested = value !== undefined ? value : uncontrolled;\n const found = items.findIndex((item) => item.value === requested);\n // One step is always current: an unknown or missing value falls back to the first step.\n const activeIndex = found === -1 ? 0 : found;\n\n const select = (index: number) => {\n const next = items[index];\n if (!next || index === activeIndex) return;\n if (value === undefined) setUncontrolled(next.value);\n onValueChange?.(next.value);\n };\n const selectRef = useRef(select);\n selectRef.current = select;\n\n const canPlay = autoPlay && count > 1 && !reducedMotion;\n const playing = canPlay && !stopped && !paused && !hovered && !focused && onScreen;\n\n useEffect(() => {\n if (!playing) return;\n const timer = window.setTimeout(() => selectRef.current((activeIndex + 1) % count), Math.max(interval, 0) + STEP_DURATION);\n return () => window.clearTimeout(timer);\n }, [playing, activeIndex, count, interval]);\n\n if (count === 0) return null;\n\n // 136px per step keeps the Figma card (157px at 1200) readable; below that the row would crush the text.\n const threshold = Math.max(480, collapseBelow ?? count * 136 + (count - 1) * 16);\n const rootStyle = {\n '--_count': count,\n '--_progress': count > 1 ? activeIndex / (count - 1) : 0,\n '--_collapse': threshold,\n ...style,\n } as CSSProperties;\n\n return (\n <div\n ref={setRef}\n className={cn('tm-how-it-works-steps', className)}\n style={rootStyle}\n data-playing={playing ? '' : undefined}\n onPointerEnter={(event: PointerEvent<HTMLDivElement>) => {\n onPointerEnter?.(event);\n // A touch \"enters\" just before it taps; only a resting mouse or pen holds the timer.\n if (event.pointerType !== 'touch') setHovered(true);\n }}\n onPointerLeave={(event: PointerEvent<HTMLDivElement>) => {\n onPointerLeave?.(event);\n setHovered(false);\n }}\n onFocus={(event: FocusEvent<HTMLDivElement>) => {\n onFocus?.(event);\n setFocused(true);\n }}\n onBlur={(event: FocusEvent<HTMLDivElement>) => {\n onBlur?.(event);\n if (!event.currentTarget.contains(event.relatedTarget)) setFocused(false);\n }}\n {...props}\n >\n <div className=\"tm-how-it-works-steps__frame\">\n <div className=\"tm-how-it-works-steps__inner\">\n {canPlay ? (\n <div className=\"tm-how-it-works-steps__controls\">\n <button\n type=\"button\"\n className=\"tm-how-it-works-steps__toggle\"\n aria-label={stopped ? playLabel : pauseLabel}\n onClick={() => setStopped((current) => !current)}\n >\n <svg viewBox=\"0 0 16 16\" width=\"16\" height=\"16\" fill=\"currentColor\" aria-hidden=\"true\" focusable=\"false\">\n {stopped ? <path d=\"M5 3.2v9.6a.6.6 0 0 0 .92.5l7.4-4.8a.6.6 0 0 0 0-1L5.92 2.7a.6.6 0 0 0-.92.5Z\" /> : <path d=\"M4 3h3v10H4zM9 3h3v10H9z\" />}\n </svg>\n </button>\n </div>\n ) : null}\n\n {/* The rail repeats what the list below already says (order, current step), so it is decorative. */}\n <div className=\"tm-how-it-works-steps__rail\" aria-hidden=\"true\" data-tm-icon-size=\"sm\">\n <span className=\"tm-how-it-works-steps__track\" />\n <span className=\"tm-how-it-works-steps__progress\" />\n {items.map((item, index) => (\n <span\n key={item.value}\n className=\"tm-how-it-works-steps__node\"\n data-state={index < activeIndex ? 'done' : index === activeIndex ? 'current' : 'upcoming'}\n >\n <span className=\"tm-how-it-works-steps__number\">{index + 1}</span>\n <CheckmarkIcon className=\"tm-how-it-works-steps__check\" />\n </span>\n ))}\n </div>\n\n <ol className=\"tm-how-it-works-steps__list\" aria-label={label}>\n {items.map((item, index) => {\n const isCurrent = index === activeIndex;\n return (\n <li key={item.value} className=\"tm-how-it-works-steps__item\">\n <button\n type=\"button\"\n className=\"tm-how-it-works-steps__card\"\n aria-current={isCurrent ? 'step' : undefined}\n data-current={isCurrent ? '' : undefined}\n onClick={() => {\n // The user has taken over: auto-play does not fight their choice.\n setStopped(true);\n select(index);\n }}\n >\n <span className=\"tm-how-it-works-steps__main\">\n {item.icon ? (\n <span className=\"tm-how-it-works-steps__icon\" data-tm-icon-size=\"md\">\n {item.icon}\n </span>\n ) : null}\n <span className=\"tm-how-it-works-steps__text\">\n <span className=\"tm-how-it-works-steps__title\">{item.title}</span>\n {item.description ? <span className=\"tm-how-it-works-steps__description\">{item.description}</span> : null}\n </span>\n </span>\n {item.badge ? <span className=\"tm-how-it-works-steps__badge\">{item.badge}</span> : null}\n </button>\n </li>\n );\n })}\n </ol>\n </div>\n </div>\n </div>\n );\n});\n"],"mappings":";;;;;;;AA4DA,IAAaA,IAAoC,kBAAoD,SACnG,EAAE,SAAM,cAAW,aAAU,GAAGC,KAChC,GACA;CACA,OACE,kBAAC,QAAD;EAAW;EAAK,WAAWC,EAAG,8BAA8BC,CAAS;EAAG,qBAAkB;EAAK,GAAIF;EAAnG,UAAA,CACGG,GACAC,CACG;;AAEV,CAAC,GAGKC,IAAgB,KAEhBC,UAAyB;CAC7B,IAAM,CAACC,GAASC,KAAcC,EAAS,EAAK;CAS5C,OARAC,QAAgB;EACd,IAAI,OAAO,SAAW,OAAe,OAAO,OAAO,cAAe,YAAY;EAC9E,IAAMC,IAAQ,OAAO,WAAW,kCAAkC,GAC5DC,UAAeJ,EAAWG,EAAM,OAAO;EAG7C,OAFAC,EAAO,GACPD,EAAM,mBAAmB,UAAUC,CAAM,SAC5BD,EAAM,sBAAsB,UAAUC,CAAM;CAC3D,GAAG,CAAC,CAAC,GACEL;AACT,GAGMM,KAAe,GAAkC,MAAqB;CAC1E,IAAM,CAACC,GAAQC,KAAaN,EAAS,EAAI,GACnC,CAACO,GAAYC,KAAiBR,EAAS,EAAI;CAgBjD,OAfAC,QAAgB;EACd,IAAI,CAACQ,GAAS;EACd,IAAMN,UAAeK,EAAc,SAAS,oBAAoB,QAAQ;EAExE,AADAL,EAAO,GACP,SAAS,iBAAiB,oBAAoBA,CAAM;EACpD,IAAIO;EAKJ,OAJIC,EAAI,WAAW,OAAO,wBAAyB,eACjD,IAAW,IAAI,sBAAsB,CAACC,OAAWN,EAAUM,EAAM,cAAc,CAAC,GAChFF,EAAS,QAAQC,EAAI,OAAO,UAEjB;GAEX,AADA,SAAS,oBAAoB,oBAAoBR,CAAM,GACvDO,GAAU,WAAW;EACvB;CACF,GAAG,CAAC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AK,QAAQ,kBAAC,QAAD;UAAM,WAAU;UAAgC,UAAAA,EAAK;SAAY,CAAA,IAAI,IAC7E;;OACN,GAzBKA,EAAK,KAyBV;MAER,CAAC;KACC,CAAA;IACD;;EACF,CAAA;CACF,CAAA;AAET,CAAC"}
1
+ {"version":3,"file":"HowItWorksSteps.js","names":["HowItWorksStepTag","props","cn","className","icon","children","STEP_DURATION","useReducedMotion","reduced","setReduced","useState","useEffect","query","update","useOnScreen","inView","setInView","tabVisible","setTabVisible","enabled","observer","ref","entry","HowItWorksSteps","rootRef","useRef","setRef","useCallback","node","uncontrolled","setUncontrolled","defaultValue","hovered","setHovered","focused","setFocused","reducedMotion","onScreen","autoPlay","count","items","requested","value","found","item","activeIndex","select","next","index","onValueChange","selectRef","playing","paused","timer","interval","threshold","collapseBelow","rootStyle","style","onPointerEnter","event","onPointerLeave","keyboard","onBlur","CheckmarkIcon","label","isCurrent"],"sources":["../../../src/components/HowItWorksSteps/HowItWorksSteps.tsx"],"sourcesContent":["import {\n forwardRef,\n useCallback,\n useEffect,\n useRef,\n useState,\n type CSSProperties,\n type FocusEvent,\n type HTMLAttributes,\n type PointerEvent,\n type ReactNode,\n} from 'react';\nimport { CheckmarkIcon } from '../../icons';\nimport { cn } from '../../utils/cn';\nimport './HowItWorksSteps.css';\n\nexport interface HowItWorksStepItem {\n /** Identifies the step in `value` / `onValueChange`. */\n value: string;\n /** One icon from `@travel-match/ui` for the icon tile, e.g. `<PaperIcon />`. */\n icon?: ReactNode;\n /** Step name, e.g. \"Submit a request\". Phrasing content only — it is rendered inside a button. */\n title: ReactNode;\n /** One or two sentences about the step. Phrasing content only. */\n description?: ReactNode;\n /** Pill at the bottom of the card, e.g. a `<RequestStatus>` or a `<Tag>`. Must not be interactive. */\n badge?: ReactNode;\n}\n\nexport interface HowItWorksStepsProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children' | 'defaultValue' | 'onChange'> {\n /** The steps, in order. Nothing is rendered for an empty list. */\n items: HowItWorksStepItem[];\n /** Controlled: `value` of the current step (Figma \"Step\"). */\n value?: string;\n /** Uncontrolled: `value` of the step that starts current. Defaults to the first one. */\n defaultValue?: string;\n /** Called with the `value` of the step that became current, by a click or by auto-play. */\n onValueChange?: (value: string) => void;\n /** Advances to the next step on a timer, in an endless loop (on by default); after the user picks a step it carries on from that step. */\n autoPlay?: boolean;\n /** Time a step rests once its 500ms transition has finished, in ms (Figma: 2200 — a new step every 2.7s). */\n interval?: number;\n /** Holds auto-play without unmounting it (e.g. while a dialog is open); it carries on once this is `false` again. */\n paused?: boolean;\n /** Accessible name of the list of steps, e.g. \"How it works\". */\n label?: string;\n /** Width of the component in px below which the steps stack (the Figma mobile layout). Default: 136px per step plus the gaps, at least 480. */\n collapseBelow?: number;\n}\n\nexport interface HowItWorksStepTagProps extends HTMLAttributes<HTMLSpanElement> {\n /** One icon from `@travel-match/ui`, e.g. `<CompareIcon />`. */\n icon?: ReactNode;\n}\n\n/** The tinted pill Figma draws at the bottom of the steps that have no request status (\"Up to 3 offers\"). Use it as a step's `badge`. */\nexport const HowItWorksStepTag = /* @__PURE__ */ forwardRef<HTMLSpanElement, HowItWorksStepTagProps>(function HowItWorksStepTag(\n { icon, className, children, ...props },\n ref,\n) {\n return (\n <span ref={ref} className={cn('tm-how-it-works-steps__tag', className)} data-tm-icon-size=\"sm\" {...props}>\n {icon}\n {children}\n </span>\n );\n});\n\n/** Figma prototype: Smart animate, ease in and out, 500ms. Keep in sync with `--_duration` in the stylesheet. */\nconst STEP_DURATION = 500;\n\nconst useReducedMotion = () => {\n const [reduced, setReduced] = useState(false);\n useEffect(() => {\n if (typeof window === 'undefined' || typeof window.matchMedia !== 'function') return;\n const query = window.matchMedia('(prefers-reduced-motion: reduce)');\n const update = () => setReduced(query.matches);\n update();\n query.addEventListener?.('change', update);\n return () => query.removeEventListener?.('change', update);\n }, []);\n return reduced;\n};\n\n/** True while the element is on screen and the tab is visible — the only time a timer should run. */\nconst useOnScreen = (ref: { current: Element | null }, enabled: boolean) => {\n const [inView, setInView] = useState(true);\n const [tabVisible, setTabVisible] = useState(true);\n useEffect(() => {\n if (!enabled) return;\n const update = () => setTabVisible(document.visibilityState !== 'hidden');\n update();\n document.addEventListener('visibilitychange', update);\n let observer: IntersectionObserver | undefined;\n if (ref.current && typeof IntersectionObserver === 'function') {\n observer = new IntersectionObserver(([entry]) => setInView(entry.isIntersecting));\n observer.observe(ref.current);\n }\n return () => {\n document.removeEventListener('visibilitychange', update);\n observer?.disconnect();\n };\n }, [ref, enabled]);\n return inView && tabVisible;\n};\n\n/**\n * The request journey as a numbered rail over a row of step cards, one of which is current\n * (Figma \"How it works / Steps\"; its \"Step=1…7\" variants are the `value`). Every card is a button that makes its step\n * current; with `autoPlay` the steps also advance on a timer in an endless loop, which holds while the pointer or\n * keyboard focus is inside and carries on from the step the user picked. Below `collapseBelow` the cards stack and the\n * rail is dropped (Figma \"Mobile / How it works / Steps\").\n */\nexport const HowItWorksSteps = /* @__PURE__ */ forwardRef<HTMLDivElement, HowItWorksStepsProps>(function HowItWorksSteps(\n {\n items,\n value,\n defaultValue,\n onValueChange,\n autoPlay = true,\n interval = 2200,\n paused = false,\n label,\n collapseBelow,\n className,\n style,\n onPointerEnter,\n onPointerLeave,\n onFocus,\n onBlur,\n ...props\n },\n ref,\n) {\n const rootRef = useRef<HTMLDivElement | null>(null);\n const setRef = useCallback(\n (node: HTMLDivElement | null) => {\n rootRef.current = node;\n if (typeof ref === 'function') ref(node);\n else if (ref) ref.current = node;\n },\n [ref],\n );\n\n const [uncontrolled, setUncontrolled] = useState(defaultValue);\n const [hovered, setHovered] = useState(false);\n const [focused, setFocused] = useState(false);\n const reducedMotion = useReducedMotion();\n const onScreen = useOnScreen(rootRef, autoPlay);\n\n const count = items.length;\n const requested = value !== undefined ? value : uncontrolled;\n const found = items.findIndex((item) => item.value === requested);\n // One step is always current: an unknown or missing value falls back to the first step.\n const activeIndex = found === -1 ? 0 : found;\n\n const select = (index: number) => {\n const next = items[index];\n if (!next || index === activeIndex) return;\n if (value === undefined) setUncontrolled(next.value);\n onValueChange?.(next.value);\n };\n const selectRef = useRef(select);\n selectRef.current = select;\n\n const playing = autoPlay && count > 1 && !reducedMotion && !paused && !hovered && !focused && onScreen;\n\n useEffect(() => {\n if (!playing) return;\n const timer = window.setTimeout(() => selectRef.current((activeIndex + 1) % count), Math.max(interval, 0) + STEP_DURATION);\n return () => window.clearTimeout(timer);\n }, [playing, activeIndex, count, interval]);\n\n if (count === 0) return null;\n\n // 136px per step keeps the Figma card (157px at 1200) readable; below that the row would crush the text.\n const threshold = Math.max(480, collapseBelow ?? count * 136 + (count - 1) * 16);\n const rootStyle = {\n '--_count': count,\n '--_progress': count > 1 ? activeIndex / (count - 1) : 0,\n '--_collapse': threshold,\n ...style,\n } as CSSProperties;\n\n return (\n <div\n ref={setRef}\n className={cn('tm-how-it-works-steps', className)}\n style={rootStyle}\n data-playing={playing ? '' : undefined}\n onPointerEnter={(event: PointerEvent<HTMLDivElement>) => {\n onPointerEnter?.(event);\n // A touch \"enters\" just before it taps; only a resting mouse or pen holds the timer.\n if (event.pointerType !== 'touch') setHovered(true);\n }}\n onPointerLeave={(event: PointerEvent<HTMLDivElement>) => {\n onPointerLeave?.(event);\n setHovered(false);\n }}\n onFocus={(event: FocusEvent<HTMLDivElement>) => {\n onFocus?.(event);\n // Keyboard focus only: the focus a click or a tap leaves on a card must not hold auto-play until the next blur.\n let keyboard = true;\n try {\n keyboard = event.target.matches(':focus-visible');\n } catch {\n /* :focus-visible unsupported — treat every focus as keyboard focus */\n }\n if (keyboard) setFocused(true);\n }}\n onBlur={(event: FocusEvent<HTMLDivElement>) => {\n onBlur?.(event);\n if (!event.currentTarget.contains(event.relatedTarget)) setFocused(false);\n }}\n {...props}\n >\n <div className=\"tm-how-it-works-steps__frame\">\n <div className=\"tm-how-it-works-steps__inner\">\n {/* The rail repeats what the list below already says (order, current step), so it is decorative. */}\n <div className=\"tm-how-it-works-steps__rail\" aria-hidden=\"true\" data-tm-icon-size=\"sm\">\n <span className=\"tm-how-it-works-steps__track\" />\n <span className=\"tm-how-it-works-steps__progress\" />\n {items.map((item, index) => (\n <span\n key={item.value}\n className=\"tm-how-it-works-steps__node\"\n data-state={index < activeIndex ? 'done' : index === activeIndex ? 'current' : 'upcoming'}\n >\n <span className=\"tm-how-it-works-steps__number\">{index + 1}</span>\n <CheckmarkIcon className=\"tm-how-it-works-steps__check\" />\n </span>\n ))}\n </div>\n\n <ol className=\"tm-how-it-works-steps__list\" aria-label={label}>\n {items.map((item, index) => {\n const isCurrent = index === activeIndex;\n return (\n <li key={item.value} className=\"tm-how-it-works-steps__item\">\n <button\n type=\"button\"\n className=\"tm-how-it-works-steps__card\"\n aria-current={isCurrent ? 'step' : undefined}\n data-current={isCurrent ? '' : undefined}\n // Shows the chosen step; auto-play carries on from it once the pointer and keyboard focus have left.\n onClick={() => select(index)}\n >\n <span className=\"tm-how-it-works-steps__main\">\n {item.icon ? (\n <span className=\"tm-how-it-works-steps__icon\" data-tm-icon-size=\"md\">\n {item.icon}\n </span>\n ) : null}\n <span className=\"tm-how-it-works-steps__text\">\n <span className=\"tm-how-it-works-steps__title\">{item.title}</span>\n {item.description ? <span className=\"tm-how-it-works-steps__description\">{item.description}</span> : null}\n </span>\n </span>\n {item.badge ? <span className=\"tm-how-it-works-steps__badge\">{item.badge}</span> : null}\n </button>\n </li>\n );\n })}\n </ol>\n </div>\n </div>\n </div>\n );\n});\n"],"mappings":";;;;;;;AAwDA,IAAaA,IAAoC,kBAAoD,SACnG,EAAE,SAAM,cAAW,aAAU,GAAGC,KAChC,GACA;CACA,OACE,kBAAC,QAAD;EAAW;EAAK,WAAWC,EAAG,8BAA8BC,CAAS;EAAG,qBAAkB;EAAK,GAAIF;EAAnG,UAAA,CACGG,GACAC,CACG;;AAEV,CAAC,GAGKC,IAAgB,KAEhBC,UAAyB;CAC7B,IAAM,CAACC,GAASC,KAAcC,EAAS,EAAK;CAS5C,OARAC,QAAgB;EACd,IAAI,OA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EAAK,OACJ,kBAAC,QAAD;UAAM,WAAU;UAA8B,qBAAkB;UAC7D,UAAAA,EAAK;SACF,CAAA,IACJ,MACJ,kBAAC,QAAD;UAAM,WAAU;UAAhB,UAAA,CACE,kBAAC,QAAD;WAAM,WAAU;WAAgC,UAAAA,EAAK;UAAY,CAAA,GAChEA,EAAK,cAAc,kBAAC,QAAD;WAAM,WAAU;WAAsC,UAAAA,EAAK;UAAkB,CAAA,IAAI,IACjG;SACF,CAAA,CAAA;QACL,CAAA,GAAAA,EAAK,QAAQ,kBAAC,QAAD;SAAM,WAAU;SAAgC,UAAAA,EAAK;QAAY,CAAA,IAAI,IAC7E;;MACN,GAtBKA,EAAK,KAsBV;KAER,CAAC;IACC,CAAA,CACD;;EACF,CAAA;CACF,CAAA;AAET,CAAC"}
@@ -0,0 +1,2 @@
1
+ "use client";const e=require("../../utils/cn.cjs"),t=require("../Logo/LogoArtwork.cjs"),n=require("../PartnerCarousel/autoplay.cjs"),r=require("./LogoAnimationArtwork.cjs"),i=require("./motion.cjs");;/* empty css */let a=require("react"),o=require("react/jsx-runtime");var s=`tm-logo-animation__`,c=`(prefers-reduced-motion: reduce)`,l=(0,a.forwardRef)(function({mode:l=`once`,size:u=160,delay:d=0,title:f,className:p,...m},h){let g=`tm-logo-animation-${(0,a.useId)().replace(/[^a-zA-Z0-9_-]/g,``)}`,_=f??(l===`loop`?`Loading`:`TravelMatch`),v=(0,a.useRef)(null),y=n.usePrefersReducedMotion(),b=n.useInView(v),x=n.usePageVisible(),S=(0,a.useRef)(null),C=(0,a.useRef)(null),w=(0,a.useRef)(0);(0,a.useEffect)(()=>{let e=v.current;if(!e)return;let t=t=>e.querySelector(`.${s}${t}`);return S.current={route:t(`route`),routeMask:t(`route-mask`),leg:t(`leg-mask`),routeCap:t(`route-cap`),legCap:t(`leg-cap`),dot:t(`dot`),parts:t(`parts`),final:t(`final`),trail:Array.from(e.querySelectorAll(`.${s}puff`)),plane:t(`plane`)},C.current=i.createLogoMotion(S.current,l,d),w.current=0,()=>{C.current=null}},[l,d]),(0,a.useEffect)(()=>{let e=S.current;if(!e)return;let t=C.current,n=y||typeof window.matchMedia==`function`&&window.matchMedia(c).matches;if(!t||n){i.showFinal(e),t&&l===`once`&&(w.current=t.end);return}if(w.current>=t.end){t.render(1e3);return}if(t.render(w.current),!b||!x)return;let r=0,a=null,o=e=>{a!==null&&(w.current+=Math.min(.25,Math.max(0,(e-a)/1e3))),a=e,w.current>=t.end?t.render(1e3):(t.render(w.current),r=requestAnimationFrame(o))};return r=requestAnimationFrame(o),()=>cancelAnimationFrame(r)},[l,d,y,b,x]);let T={fill:`none`,stroke:`#fff`,strokeWidth:5.6,strokeLinecap:`butt`},E=`url(#${g}-g)`;return(0,o.jsxs)(`svg`,{ref:e=>{v.current=e,typeof h==`function`?h(e):h&&(h.current=e)},xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 40 52`,width:u,height:Math.round(u*1.3*100)/100,overflow:`visible`,fill:`none`,className:e.cn(`tm-logo-animation`,p),"data-mode":l,role:_?`img`:void 0,"aria-label":_||void 0,"aria-hidden":!_||void 0,focusable:`false`,...m,children:[(0,o.jsxs)(`defs`,{children:[(0,o.jsxs)(`linearGradient`,{id:`${g}-g`,x1:`12.9902`,y1:`-1.17862`,x2:`28.2362`,y2:`52.8384`,gradientUnits:`userSpaceOnUse`,children:[(0,o.jsx)(`stop`,{stopColor:`#2136D2`}),(0,o.jsx)(`stop`,{offset:`1`,stopColor:`#21B2FF`})]}),(0,o.jsx)(`clipPath`,{id:`${g}-cm`,children:(0,o.jsx)(`path`,{clipRule:`evenodd`,d:`M-20 -20H60V80H-20Z ${r.LEG_POLY}`})}),(0,o.jsx)(`clipPath`,{id:`${g}-cl`,children:(0,o.jsx)(`path`,{d:r.LEG_POLY2})}),(0,o.jsxs)(`mask`,{id:`${g}-mm`,maskUnits:`userSpaceOnUse`,x:`-20`,y:`-20`,width:`80`,height:`100`,children:[(0,o.jsx)(`path`,{className:`${s}route-mask`,d:r.ROUTE_X,...T,strokeLinejoin:`round`,style:{opacity:0}}),(0,o.jsx)(`circle`,{className:`${s}route-cap`,r:`0`,fill:`#fff`}),(0,o.jsx)(`circle`,{className:`${s}dot`,cx:r.DOT[0],cy:r.DOT[1],r:l===`loop`?4.3:0,fill:`#fff`})]}),(0,o.jsxs)(`mask`,{id:`${g}-ml`,maskUnits:`userSpaceOnUse`,x:`-20`,y:`-20`,width:`80`,height:`100`,children:[(0,o.jsx)(`path`,{className:`${s}leg-mask`,d:r.LEG_D,...T,style:{opacity:0}}),(0,o.jsx)(`circle`,{className:`${s}leg-cap`,r:`0`,fill:`#fff`})]})]}),(0,o.jsxs)(`g`,{className:`${s}parts`,children:[(0,o.jsx)(`g`,{mask:`url(#${g}-mm)`,children:(0,o.jsx)(`path`,{d:r.PIN_D,fill:E,clipPath:`url(#${g}-cm)`})}),(0,o.jsx)(`g`,{mask:`url(#${g}-ml)`,children:(0,o.jsx)(`path`,{d:r.PIN_D,fill:E,clipPath:`url(#${g}-cl)`})})]}),(0,o.jsx)(`g`,{className:`${s}final`,style:{display:`none`},children:(0,o.jsx)(t.LogoMark,{gradientId:`${g}-mark`})}),(0,o.jsx)(`path`,{className:`${s}route`,d:r.ROUTE_D,fill:`none`,stroke:`none`}),(0,o.jsx)(`g`,{children:[0,1,2].map(e=>(0,o.jsx)(`circle`,{className:`${s}puff`,fill:E,style:{opacity:0}},e))}),(0,o.jsx)(`g`,{className:`${s}plane`,style:{opacity:0},children:(0,o.jsx)(`path`,{d:r.PLANE_D,fill:E})})]})});exports.LogoAnimation=l;
2
+ //# sourceMappingURL=LogoAnimation.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LogoAnimation.cjs","names":["useId","useRef","usePrefersReducedMotion","useInView","usePageVisible","createLogoMotion","cn","LEG_POLY","LEG_POLY2","ROUTE_X","DOT","LEG_D","PIN_D","LogoMark","ROUTE_D","PLANE_D","require_cn","require_LogoArtwork","require_autoplay","require_LogoAnimationArtwork","require_motion","react","react_jsx_runtime","PART","REDUCED_MOTION","LogoAnimation","props","id","label","title","mode","rootRef","reduced","inView","pageVisible","elements","motion","clock","svg","q","part","delay","els","m","reducedNow","raf","last","tick","now","stroke","gradient","node","ref","size","className","i"],"sources":["../../../src/components/LogoAnimation/LogoAnimation.tsx"],"sourcesContent":["import { forwardRef, useEffect, useId, useRef, type SVGProps } from 'react';\nimport { cn } from '../../utils/cn';\nimport { LogoMark } from '../Logo/LogoArtwork';\nimport { useInView, usePageVisible, usePrefersReducedMotion } from '../PartnerCarousel/autoplay';\nimport { DOT, LEG_D, LEG_POLY, LEG_POLY2, PIN_D, PLANE_D, ROUTE_D, ROUTE_X } from './LogoAnimationArtwork';\nimport { createLogoMotion, showFinal, type LogoMotion, type LogoMotionElements, type LogoMotionMode } from './motion';\nimport './LogoAnimation.css';\n\n/** `once`: the intro — the plane draws the logo, lands and the logo stays. `loop`: the loader — it flies out, the line rewinds and it starts again. */\nexport type LogoAnimationMode = LogoMotionMode;\n\nexport interface LogoAnimationProps extends Omit<SVGProps<SVGSVGElement>, 'ref' | 'children' | 'width' | 'height' | 'viewBox' | 'mode'> {\n /** `once` (intro, holds the final logo) or `loop` (loader, repeats forever). Both play by themselves. */\n mode?: LogoAnimationMode;\n /** Width in px. The height follows the 40 × 52 mark: `size × 1.3`. */\n size?: number;\n /** Seconds to wait before the dot appears. */\n delay?: number;\n /**\n * Accessible name. Defaults to \"TravelMatch\" for `once` and \"Loading\" for `loop`; pass a translated string, or an\n * empty string when the animation is decorative (it is then hidden from assistive technology).\n */\n title?: string;\n}\n\nconst PART = 'tm-logo-animation__';\nconst REDUCED_MOTION = '(prefers-reduced-motion: reduce)';\n\n/**\n * The TravelMatch mark drawn by its paper plane: the dot appears, the plane takes off from it, draws the pin and grows\n * the lower-left branch, then lands in the exact logo pose (the `Logo` mark artwork). `once` holds the logo; `loop`\n * flies the plane out with a few puffs while the line rewinds into the dot, and starts again.\n *\n * - Plays by itself — there is no play or pause control. Frames stop while the tab is hidden or the logo is\n * off-screen and pick up where they were, so an intro below the fold plays when it is scrolled into view.\n * - `prefers-reduced-motion`: both modes show the still logo straight away (CSS does this from the first paint, before\n * hydration). The loader keeps its \"Loading\" name for assistive technology.\n * - Server rendering: the markup is the first frame (an empty, size-reserving box for `once`; the dot for `loop`), so\n * hydration continues from it without a flash. Paths are measured and frames run in effects only.\n */\nexport const LogoAnimation = /* @__PURE__ */ forwardRef<SVGSVGElement, LogoAnimationProps>(function LogoAnimation(\n { mode = 'once', size = 160, delay = 0, title, className, ...props },\n ref,\n) {\n // Masks, clip paths and gradients are referenced by id, so every instance needs its own.\n const id = `tm-logo-animation-${useId().replace(/[^a-zA-Z0-9_-]/g, '')}`;\n const label = title ?? (mode === 'loop' ? 'Loading' : 'TravelMatch');\n\n const rootRef = useRef<SVGSVGElement | null>(null);\n const reduced = usePrefersReducedMotion();\n const inView = useInView(rootRef);\n const pageVisible = usePageVisible();\n const elements = useRef<LogoMotionElements | null>(null);\n const motion = useRef<LogoMotion | null>(null);\n /** Animation time in seconds; kept while frames are paused (hidden tab, off-screen). */\n const clock = useRef(0);\n\n // Measure the paths and build the frame renderer; a new mode or delay starts from the beginning.\n useEffect(() => {\n const svg = rootRef.current;\n if (!svg) return;\n const q = <T extends Element>(part: string) => svg.querySelector(`.${PART}${part}`) as T;\n elements.current = {\n route: q('route'),\n routeMask: q('route-mask'),\n leg: q('leg-mask'),\n routeCap: q('route-cap'),\n legCap: q('leg-cap'),\n dot: q('dot'),\n parts: q('parts'),\n final: q('final'),\n trail: Array.from(svg.querySelectorAll<SVGCircleElement>(`.${PART}puff`)),\n plane: q('plane'),\n };\n motion.current = createLogoMotion(elements.current, mode, delay);\n clock.current = 0;\n return () => {\n motion.current = null;\n };\n }, [mode, delay]);\n\n // Run the frames.\n useEffect(() => {\n const els = elements.current;\n if (!els) return;\n const m = motion.current;\n // The hook answers `false` on the first render (server markup must match); ask directly so no frame runs at all.\n const reducedNow = reduced || (typeof window.matchMedia === 'function' && window.matchMedia(REDUCED_MOTION).matches);\n if (!m || reducedNow) {\n // Reduced motion, or a browser that cannot measure SVG paths: the still logo. A finished intro stays finished.\n showFinal(els);\n if (m && mode === 'once') clock.current = m.end;\n return;\n }\n if (clock.current >= m.end) {\n m.render(1e3);\n return;\n }\n m.render(clock.current);\n if (!inView || !pageVisible) return;\n\n let raf = 0;\n let last: number | null = null;\n const tick = (now: number) => {\n // A long gap (throttled tab) must not skip the animation ahead.\n if (last !== null) clock.current += Math.min(0.25, Math.max(0, (now - last) / 1000));\n last = now;\n if (clock.current >= m.end) {\n m.render(1e3);\n return;\n }\n m.render(clock.current);\n raf = requestAnimationFrame(tick);\n };\n raf = requestAnimationFrame(tick);\n return () => cancelAnimationFrame(raf);\n }, [mode, delay, reduced, inView, pageVisible]);\n\n const stroke = { fill: 'none', stroke: '#fff', strokeWidth: 5.6, strokeLinecap: 'butt' } as const;\n const gradient = `url(#${id}-g)`;\n\n return (\n <svg\n ref={(node) => {\n rootRef.current = node;\n if (typeof ref === 'function') ref(node);\n else if (ref) ref.current = node;\n }}\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 40 52\"\n width={size}\n height={Math.round(size * 1.3 * 100) / 100}\n overflow=\"visible\"\n fill=\"none\"\n className={cn('tm-logo-animation', className)}\n data-mode={mode}\n role={label ? 'img' : undefined}\n aria-label={label || undefined}\n aria-hidden={label ? undefined : true}\n focusable=\"false\"\n {...props}\n >\n {/* The server markup is the first frame: lines and plane hidden, the dot shown only by the loader. */}\n <defs>\n {/* Same gradient as the Logo mark (#2136D2 → #21B2FF), so the landing swap is seamless. */}\n <linearGradient id={`${id}-g`} x1=\"12.9902\" y1=\"-1.17862\" x2=\"28.2362\" y2=\"52.8384\" gradientUnits=\"userSpaceOnUse\">\n <stop stopColor=\"#2136D2\" />\n <stop offset=\"1\" stopColor=\"#21B2FF\" />\n </linearGradient>\n <clipPath id={`${id}-cm`}>\n <path clipRule=\"evenodd\" d={`M-20 -20H60V80H-20Z ${LEG_POLY}`} />\n </clipPath>\n <clipPath id={`${id}-cl`}>\n <path d={LEG_POLY2} />\n </clipPath>\n <mask id={`${id}-mm`} maskUnits=\"userSpaceOnUse\" x=\"-20\" y=\"-20\" width=\"80\" height=\"100\">\n <path className={`${PART}route-mask`} d={ROUTE_X} {...stroke} strokeLinejoin=\"round\" style={{ opacity: 0 }} />\n <circle className={`${PART}route-cap`} r=\"0\" fill=\"#fff\" />\n <circle className={`${PART}dot`} cx={DOT[0]} cy={DOT[1]} r={mode === 'loop' ? 4.3 : 0} fill=\"#fff\" />\n </mask>\n <mask id={`${id}-ml`} maskUnits=\"userSpaceOnUse\" x=\"-20\" y=\"-20\" width=\"80\" height=\"100\">\n <path className={`${PART}leg-mask`} d={LEG_D} {...stroke} style={{ opacity: 0 }} />\n <circle className={`${PART}leg-cap`} r=\"0\" fill=\"#fff\" />\n </mask>\n </defs>\n <g className={`${PART}parts`}>\n <g mask={`url(#${id}-mm)`}>\n <path d={PIN_D} fill={gradient} clipPath={`url(#${id}-cm)`} />\n </g>\n <g mask={`url(#${id}-ml)`}>\n <path d={PIN_D} fill={gradient} clipPath={`url(#${id}-cl)`} />\n </g>\n </g>\n <g className={`${PART}final`} style={{ display: 'none' }}>\n <LogoMark gradientId={`${id}-mark`} />\n </g>\n <path className={`${PART}route`} d={ROUTE_D} fill=\"none\" stroke=\"none\" />\n <g>\n {[0, 1, 2].map((i) => (\n <circle key={i} className={`${PART}puff`} fill={gradient} style={{ opacity: 0 }} />\n ))}\n </g>\n <g className={`${PART}plane`} style={{ opacity: 0 }}>\n <path d={PLANE_D} fill={gradient} />\n </g>\n </svg>\n );\n});\n"],"mappings":"A,gSAyBA,IAAMuB,EAAO,sBACPC,EAAiB,mCAcVC,GAAgC,EAAAJ,EAAA,WAAA,CAA8C,SACzF,CAAE,OAAO,OAAQ,OAAO,IAAK,QAAQ,EAAG,QAAO,YAAW,GAAGK,GAC7D,EACA,CAEA,IAAMC,EAAK,sBAAA,EAAq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AA,EAAA,IAAA,CAAC,SAAD,CAAgB,UAAW,GAAGC,EAAK,MAAO,KAAM2B,EAAU,MAAO,CAAE,QAAS,CAAE,CAAI,EAArEK,CAAqE,CACnF,CACA,CAAA,GACH,EAAAjC,EAAA,IAAA,CAAC,IAAD,CAAG,UAAW,GAAGC,EAAK,OAAQ,MAAO,CAAE,QAAS,CAAE,EAChD,UAAA,EAAAD,EAAA,IAAA,CAAC,OAAD,CAAM,EAAGP,EAAAA,QAAS,KAAMmC,CAAW,CAAA,CAClC,CAAA,CACA,C,EAET,CAAC,E"}
@@ -0,0 +1,202 @@
1
+ "use client";
2
+ import { cn as e } from "../../utils/cn.js";
3
+ import { LogoMark as t } from "../Logo/LogoArtwork.js";
4
+ import { useInView as n, usePageVisible as r, usePrefersReducedMotion as i } from "../PartnerCarousel/autoplay.js";
5
+ import { DOT as a, LEG_D as o, LEG_POLY as s, LEG_POLY2 as c, PIN_D as l, PLANE_D as u, ROUTE_D as d, ROUTE_X as f } from "./LogoAnimationArtwork.js";
6
+ import { createLogoMotion as p, showFinal as m } from "./motion.js";
7
+ /* empty css */
8
+ import { forwardRef as h, useEffect as g, useId as _, useRef as v } from "react";
9
+ import { jsx as y, jsxs as b } from "react/jsx-runtime";
10
+ // src/components/LogoAnimation/LogoAnimation.tsx
11
+ var x = "tm-logo-animation__", S = "(prefers-reduced-motion: reduce)", C = /* @__PURE__ */ h(function({ mode: h = "once", size: C = 160, delay: w = 0, title: T, className: E, ...D }, O) {
12
+ let k = `tm-logo-animation-${_().replace(/[^a-zA-Z0-9_-]/g, "")}`, A = T ?? (h === "loop" ? "Loading" : "TravelMatch"), j = v(null), M = i(), N = n(j), P = r(), F = v(null), I = v(null), L = v(0);
13
+ g(() => {
14
+ let e = j.current;
15
+ if (!e) return;
16
+ let t = (t) => e.querySelector(`.${x}${t}`);
17
+ return F.current = {
18
+ route: t("route"),
19
+ routeMask: t("route-mask"),
20
+ leg: t("leg-mask"),
21
+ routeCap: t("route-cap"),
22
+ legCap: t("leg-cap"),
23
+ dot: t("dot"),
24
+ parts: t("parts"),
25
+ final: t("final"),
26
+ trail: Array.from(e.querySelectorAll(`.${x}puff`)),
27
+ plane: t("plane")
28
+ }, I.current = p(F.current, h, w), L.current = 0, () => {
29
+ I.current = null;
30
+ };
31
+ }, [h, w]), g(() => {
32
+ let e = F.current;
33
+ if (!e) return;
34
+ let t = I.current, n = M || typeof window.matchMedia == "function" && window.matchMedia(S).matches;
35
+ if (!t || n) {
36
+ m(e), t && h === "once" && (L.current = t.end);
37
+ return;
38
+ }
39
+ if (L.current >= t.end) {
40
+ t.render(1e3);
41
+ return;
42
+ }
43
+ if (t.render(L.current), !N || !P) return;
44
+ let r = 0, i = null, a = (e) => {
45
+ i !== null && (L.current += Math.min(.25, Math.max(0, (e - i) / 1e3))), i = e, L.current >= t.end ? t.render(1e3) : (t.render(L.current), r = requestAnimationFrame(a));
46
+ };
47
+ return r = requestAnimationFrame(a), () => cancelAnimationFrame(r);
48
+ }, [
49
+ h,
50
+ w,
51
+ M,
52
+ N,
53
+ P
54
+ ]);
55
+ let R = {
56
+ fill: "none",
57
+ stroke: "#fff",
58
+ strokeWidth: 5.6,
59
+ strokeLinecap: "butt"
60
+ }, z = `url(#${k}-g)`;
61
+ return /* @__PURE__ */ b("svg", {
62
+ ref: (e) => {
63
+ j.current = e, typeof O == "function" ? O(e) : O && (O.current = e);
64
+ },
65
+ xmlns: "http://www.w3.org/2000/svg",
66
+ viewBox: "0 0 40 52",
67
+ width: C,
68
+ height: Math.round(C * 1.3 * 100) / 100,
69
+ overflow: "visible",
70
+ fill: "none",
71
+ className: e("tm-logo-animation", E),
72
+ "data-mode": h,
73
+ role: A ? "img" : void 0,
74
+ "aria-label": A || void 0,
75
+ "aria-hidden": !A || void 0,
76
+ focusable: "false",
77
+ ...D,
78
+ children: [
79
+ /* @__PURE__ */ b("defs", { children: [
80
+ /* @__PURE__ */ b("linearGradient", {
81
+ id: `${k}-g`,
82
+ x1: "12.9902",
83
+ y1: "-1.17862",
84
+ x2: "28.2362",
85
+ y2: "52.8384",
86
+ gradientUnits: "userSpaceOnUse",
87
+ children: [/* @__PURE__ */ y("stop", { stopColor: "#2136D2" }), /* @__PURE__ */ y("stop", {
88
+ offset: "1",
89
+ stopColor: "#21B2FF"
90
+ })]
91
+ }),
92
+ /* @__PURE__ */ y("clipPath", {
93
+ id: `${k}-cm`,
94
+ children: /* @__PURE__ */ y("path", {
95
+ clipRule: "evenodd",
96
+ d: `M-20 -20H60V80H-20Z ${s}`
97
+ })
98
+ }),
99
+ /* @__PURE__ */ y("clipPath", {
100
+ id: `${k}-cl`,
101
+ children: /* @__PURE__ */ y("path", { d: c })
102
+ }),
103
+ /* @__PURE__ */ b("mask", {
104
+ id: `${k}-mm`,
105
+ maskUnits: "userSpaceOnUse",
106
+ x: "-20",
107
+ y: "-20",
108
+ width: "80",
109
+ height: "100",
110
+ children: [
111
+ /* @__PURE__ */ y("path", {
112
+ className: `${x}route-mask`,
113
+ d: f,
114
+ ...R,
115
+ strokeLinejoin: "round",
116
+ style: { opacity: 0 }
117
+ }),
118
+ /* @__PURE__ */ y("circle", {
119
+ className: `${x}route-cap`,
120
+ r: "0",
121
+ fill: "#fff"
122
+ }),
123
+ /* @__PURE__ */ y("circle", {
124
+ className: `${x}dot`,
125
+ cx: a[0],
126
+ cy: a[1],
127
+ r: h === "loop" ? 4.3 : 0,
128
+ fill: "#fff"
129
+ })
130
+ ]
131
+ }),
132
+ /* @__PURE__ */ b("mask", {
133
+ id: `${k}-ml`,
134
+ maskUnits: "userSpaceOnUse",
135
+ x: "-20",
136
+ y: "-20",
137
+ width: "80",
138
+ height: "100",
139
+ children: [/* @__PURE__ */ y("path", {
140
+ className: `${x}leg-mask`,
141
+ d: o,
142
+ ...R,
143
+ style: { opacity: 0 }
144
+ }), /* @__PURE__ */ y("circle", {
145
+ className: `${x}leg-cap`,
146
+ r: "0",
147
+ fill: "#fff"
148
+ })]
149
+ })
150
+ ] }),
151
+ /* @__PURE__ */ b("g", {
152
+ className: `${x}parts`,
153
+ children: [/* @__PURE__ */ y("g", {
154
+ mask: `url(#${k}-mm)`,
155
+ children: /* @__PURE__ */ y("path", {
156
+ d: l,
157
+ fill: z,
158
+ clipPath: `url(#${k}-cm)`
159
+ })
160
+ }), /* @__PURE__ */ y("g", {
161
+ mask: `url(#${k}-ml)`,
162
+ children: /* @__PURE__ */ y("path", {
163
+ d: l,
164
+ fill: z,
165
+ clipPath: `url(#${k}-cl)`
166
+ })
167
+ })]
168
+ }),
169
+ /* @__PURE__ */ y("g", {
170
+ className: `${x}final`,
171
+ style: { display: "none" },
172
+ children: /* @__PURE__ */ y(t, { gradientId: `${k}-mark` })
173
+ }),
174
+ /* @__PURE__ */ y("path", {
175
+ className: `${x}route`,
176
+ d,
177
+ fill: "none",
178
+ stroke: "none"
179
+ }),
180
+ /* @__PURE__ */ y("g", { children: [
181
+ 0,
182
+ 1,
183
+ 2
184
+ ].map((e) => /* @__PURE__ */ y("circle", {
185
+ className: `${x}puff`,
186
+ fill: z,
187
+ style: { opacity: 0 }
188
+ }, e)) }),
189
+ /* @__PURE__ */ y("g", {
190
+ className: `${x}plane`,
191
+ style: { opacity: 0 },
192
+ children: /* @__PURE__ */ y("path", {
193
+ d: u,
194
+ fill: z
195
+ })
196
+ })
197
+ ]
198
+ });
199
+ });
200
+ export { C as LogoAnimation };
201
+
202
+ //# sourceMappingURL=LogoAnimation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LogoAnimation.js","names":["PART","REDUCED_MOTION","LogoAnimation","props","id","useId","label","title","mode","rootRef","useRef","reduced","usePrefersReducedMotion","inView","useInView","pageVisible","usePageVisible","elements","motion","clock","useEffect","svg","q","part","createLogoMotion","delay","els","m","reducedNow","showFinal","raf","last","tick","now","stroke","gradient","node","ref","size","cn","className","LEG_POLY","LEG_POLY2","ROUTE_X","DOT","LEG_D","PIN_D","LogoMark","ROUTE_D","i","PLANE_D"],"sources":["../../../src/components/LogoAnimation/LogoAnimation.tsx"],"sourcesContent":["import { forwardRef, useEffect, useId, useRef, type SVGProps } from 'react';\nimport { cn } from '../../utils/cn';\nimport { LogoMark } from '../Logo/LogoArtwork';\nimport { useInView, usePageVisible, usePrefersReducedMotion } from '../PartnerCarousel/autoplay';\nimport { DOT, LEG_D, LEG_POLY, LEG_POLY2, PIN_D, PLANE_D, ROUTE_D, ROUTE_X } from './LogoAnimationArtwork';\nimport { createLogoMotion, showFinal, type LogoMotion, type LogoMotionElements, type LogoMotionMode } from './motion';\nimport './LogoAnimation.css';\n\n/** `once`: the intro — the plane draws the logo, lands and the logo stays. `loop`: the loader — it flies out, the line rewinds and it starts again. */\nexport type LogoAnimationMode = LogoMotionMode;\n\nexport interface LogoAnimationProps extends Omit<SVGProps<SVGSVGElement>, 'ref' | 'children' | 'width' | 'height' | 'viewBox' | 'mode'> {\n /** `once` (intro, holds the final logo) or `loop` (loader, repeats forever). Both play by themselves. */\n mode?: LogoAnimationMode;\n /** Width in px. The height follows the 40 × 52 mark: `size × 1.3`. */\n size?: number;\n /** Seconds to wait before the dot appears. */\n delay?: number;\n /**\n * Accessible name. Defaults to \"TravelMatch\" for `once` and \"Loading\" for `loop`; pass a translated string, or an\n * empty string when the animation is decorative (it is then hidden from assistive technology).\n */\n title?: string;\n}\n\nconst PART = 'tm-logo-animation__';\nconst REDUCED_MOTION = '(prefers-reduced-motion: reduce)';\n\n/**\n * The TravelMatch mark drawn by its paper plane: the dot appears, the plane takes off from it, draws the pin and grows\n * the lower-left branch, then lands in the exact logo pose (the `Logo` mark artwork). `once` holds the logo; `loop`\n * flies the plane out with a few puffs while the line rewinds into the dot, and starts again.\n *\n * - Plays by itself — there is no play or pause control. Frames stop while the tab is hidden or the logo is\n * off-screen and pick up where they were, so an intro below the fold plays when it is scrolled into view.\n * - `prefers-reduced-motion`: both modes show the still logo straight away (CSS does this from the first paint, before\n * hydration). The loader keeps its \"Loading\" name for assistive technology.\n * - Server rendering: the markup is the first frame (an empty, size-reserving box for `once`; the dot for `loop`), so\n * hydration continues from it without a flash. Paths are measured and frames run in effects only.\n */\nexport const LogoAnimation = /* @__PURE__ */ forwardRef<SVGSVGElement, LogoAnimationProps>(function LogoAnimation(\n { mode = 'once', size = 160, delay = 0, title, className, ...props },\n ref,\n) {\n // Masks, clip paths and gradients are referenced by id, so every instance needs its own.\n const id = `tm-logo-animation-${useId().replace(/[^a-zA-Z0-9_-]/g, '')}`;\n const label = title ?? (mode === 'loop' ? 'Loading' : 'TravelMatch');\n\n const rootRef = useRef<SVGSVGElement | null>(null);\n const reduced = usePrefersReducedMotion();\n const inView = useInView(rootRef);\n const pageVisible = usePageVisible();\n const elements = useRef<LogoMotionElements | null>(null);\n const motion = useRef<LogoMotion | null>(null);\n /** Animation time in seconds; kept while frames are paused (hidden tab, off-screen). */\n const clock = useRef(0);\n\n // Measure the paths and build the frame renderer; a new mode or delay starts from the beginning.\n useEffect(() => {\n const svg = rootRef.current;\n if (!svg) return;\n const q = <T extends Element>(part: string) => svg.querySelector(`.${PART}${part}`) as T;\n elements.current = {\n route: q('route'),\n routeMask: q('route-mask'),\n leg: q('leg-mask'),\n routeCap: q('route-cap'),\n legCap: q('leg-cap'),\n dot: q('dot'),\n parts: q('parts'),\n final: q('final'),\n trail: Array.from(svg.querySelectorAll<SVGCircleElement>(`.${PART}puff`)),\n plane: q('plane'),\n };\n motion.current = createLogoMotion(elements.current, mode, delay);\n clock.current = 0;\n return () => {\n motion.current = null;\n };\n }, [mode, delay]);\n\n // Run the frames.\n useEffect(() => {\n const els = elements.current;\n if (!els) return;\n const m = motion.current;\n // The hook answers `false` on the first render (server markup must match); ask directly so no frame runs at all.\n const reducedNow = reduced || (typeof window.matchMedia === 'function' && window.matchMedia(REDUCED_MOTION).matches);\n if (!m || reducedNow) {\n // Reduced motion, or a browser that cannot measure SVG paths: the still logo. A finished intro stays finished.\n showFinal(els);\n if (m && mode === 'once') clock.current = m.end;\n return;\n }\n if (clock.current >= m.end) {\n m.render(1e3);\n return;\n }\n m.render(clock.current);\n if (!inView || !pageVisible) return;\n\n let raf = 0;\n let last: number | null = null;\n const tick = (now: number) => {\n // A long gap (throttled tab) must not skip the animation ahead.\n if (last !== null) clock.current += Math.min(0.25, Math.max(0, (now - last) / 1000));\n last = now;\n if (clock.current >= m.end) {\n m.render(1e3);\n return;\n }\n m.render(clock.current);\n raf = requestAnimationFrame(tick);\n };\n raf = requestAnimationFrame(tick);\n return () => cancelAnimationFrame(raf);\n }, [mode, delay, reduced, inView, pageVisible]);\n\n const stroke = { fill: 'none', stroke: '#fff', strokeWidth: 5.6, strokeLinecap: 'butt' } as const;\n const gradient = `url(#${id}-g)`;\n\n return (\n <svg\n ref={(node) => {\n rootRef.current = node;\n if (typeof ref === 'function') ref(node);\n else if (ref) ref.current = node;\n }}\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 40 52\"\n width={size}\n height={Math.round(size * 1.3 * 100) / 100}\n overflow=\"visible\"\n fill=\"none\"\n className={cn('tm-logo-animation', className)}\n data-mode={mode}\n role={label ? 'img' : undefined}\n aria-label={label || undefined}\n aria-hidden={label ? undefined : true}\n focusable=\"false\"\n {...props}\n >\n {/* The server markup is the first frame: lines and plane hidden, the dot shown only by the loader. */}\n <defs>\n {/* Same gradient as the Logo mark (#2136D2 → #21B2FF), so the landing swap is seamless. */}\n <linearGradient id={`${id}-g`} x1=\"12.9902\" y1=\"-1.17862\" x2=\"28.2362\" y2=\"52.8384\" gradientUnits=\"userSpaceOnUse\">\n <stop stopColor=\"#2136D2\" />\n <stop offset=\"1\" stopColor=\"#21B2FF\" />\n </linearGradient>\n <clipPath id={`${id}-cm`}>\n <path clipRule=\"evenodd\" d={`M-20 -20H60V80H-20Z ${LEG_POLY}`} />\n </clipPath>\n <clipPath id={`${id}-cl`}>\n <path d={LEG_POLY2} />\n </clipPath>\n <mask id={`${id}-mm`} maskUnits=\"userSpaceOnUse\" x=\"-20\" y=\"-20\" width=\"80\" height=\"100\">\n <path className={`${PART}route-mask`} d={ROUTE_X} {...stroke} strokeLinejoin=\"round\" style={{ opacity: 0 }} />\n <circle className={`${PART}route-cap`} r=\"0\" fill=\"#fff\" />\n <circle className={`${PART}dot`} cx={DOT[0]} cy={DOT[1]} r={mode === 'loop' ? 4.3 : 0} fill=\"#fff\" />\n </mask>\n <mask id={`${id}-ml`} maskUnits=\"userSpaceOnUse\" x=\"-20\" y=\"-20\" width=\"80\" height=\"100\">\n <path className={`${PART}leg-mask`} d={LEG_D} {...stroke} style={{ opacity: 0 }} />\n <circle className={`${PART}leg-cap`} r=\"0\" fill=\"#fff\" />\n </mask>\n </defs>\n <g className={`${PART}parts`}>\n <g mask={`url(#${id}-mm)`}>\n <path d={PIN_D} fill={gradient} clipPath={`url(#${id}-cm)`} />\n </g>\n <g mask={`url(#${id}-ml)`}>\n <path d={PIN_D} fill={gradient} clipPath={`url(#${id}-cl)`} />\n </g>\n </g>\n <g className={`${PART}final`} style={{ display: 'none' }}>\n <LogoMark gradientId={`${id}-mark`} />\n </g>\n <path className={`${PART}route`} d={ROUTE_D} fill=\"none\" stroke=\"none\" />\n <g>\n {[0, 1, 2].map((i) => (\n <circle key={i} className={`${PART}puff`} fill={gradient} style={{ opacity: 0 }} />\n ))}\n </g>\n <g className={`${PART}plane`} style={{ opacity: 0 }}>\n <path d={PLANE_D} fill={gradient} />\n </g>\n </svg>\n );\n});\n"],"mappings":";;;;;;;;;;AAyBA,IAAMA,IAAO,uBACPC,IAAiB,oCAcVC,IAAgC,kBAA8C,SACzF,EAAE,UAAO,QAAQ,UAAO,KAAK,WAAQ,GAAG,UAAO,cAAW,GAAGC,KAC7D,GACA;CAEA,IAAMC,IAAK,qBAAqBC,EAAM,CAAC,CAAC,QAAQ,mBAAmB,EAAE,KAC/DC,IAAQC,MAAUC,MAAS,SAAS,YAAY,gBAEhDC,IAAUC,EAA6B,IAAI,GAC3CC,IAAUC,EAAwB,GAClCC,IAASC,EAAUL,CAAO,GAC1BM,IAAcC,EAAe,GAC7BC,IAAWP,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IAC5D,CAAA,CACF;;GACH,kBAAC,KAAD;IAAG,WAAW,GAAGJ,EAAK;IAAQ,OAAO,EAAE,SAAS,OAAO;IACrD,UAAA,kBAAC+C,GAAD,EAAU,YAAY,GAAG3C,EAAG,OAAS,CAAA;GACpC,CAAA;GACH,kBAAC,QAAD;IAAM,WAAW,GAAGJ,EAAK;IAAWgD;IAAS,MAAK;IAAO,QAAO;GAAQ,CAAA;GACxE,kBAAC,KAAD,EAAA,UACG;IAAC;IAAG;IAAG;GAAC,CAAC,CAAC,KAAK,MACd,kBAAC,UAAD;IAAgB,WAAW,GAAGhD,EAAK;IAAO,MAAMmC;IAAU,OAAO,EAAE,SAAS,EAAE;GAAI,GAArEc,CAAqE,CACnF,EACA,CAAA;GACH,kBAAC,KAAD;IAAG,WAAW,GAAGjD,EAAK;IAAQ,OAAO,EAAE,SAAS,EAAE;IAChD,UAAA,kBAAC,QAAD;KAAM,GAAGkD;KAAS,MAAMf;IAAW,CAAA;GAClC,CAAA;EACA;;AAET,CAAC"}
@@ -0,0 +1,2 @@
1
+ "use client";var e=`M22.3252 24.4694C22.3252 24.4694 22.4142 25.3934 22.5202 26.2554C22.7902 28.4354 22.7862 28.5414 22.4152 29.0094C22.0352 29.4884 21.8652 29.6294 21.7782 29.5384C21.7092 29.4664 21.3502 28.6554 20.3172 26.2344C19.8222 25.0744 19.1002 23.7904 18.9422 23.7894C18.9162 23.7894 18.0692 24.4494 17.0592 25.2574L15.2222 26.7264L15.2482 27.9014L15.2632 28.5794C15.2702 28.8964 15.1462 29.2024 14.9172 29.4224C14.8712 29.4664 14.7752 29.5504 14.7202 29.5714C14.6482 29.5994 14.4742 29.5544 14.4402 29.4644C14.1612 28.7424 14.1312 28.6764 14.0762 28.6144L11.3482 25.7904L11.1282 25.6494C10.9222 25.5174 10.9202 25.2174 11.1242 25.0824C11.4022 24.8984 11.7392 24.8284 12.0672 24.8854L12.4872 24.9594C12.9992 25.0494 13.5182 25.1434 13.6412 25.1684C13.8472 25.2104 13.9902 25.0884 15.5052 23.5834C16.4072 22.6864 17.1442 21.9164 17.1412 21.8724C17.1302 21.6784 16.1102 20.9604 14.9312 20.3174C12.5572 19.0234 11.5742 18.4554 11.5742 18.3794C11.5742 18.2594 12.4242 17.7504 12.6982 17.7064C12.8502 17.6824 13.7132 17.8384 14.8982 18.1044L16.8482 18.5424L18.5762 18.8914C19.5452 19.1144 19.7972 19.1654 19.9332 19.1654C20.0192 19.1654 20.5312 18.7914 21.0712 18.3334C23.1202 16.5934 23.6702 16.2134 24.5132 15.9544C25.2132 15.7384 25.5812 15.7514 25.8312 16.0004C26.0562 16.2524 26.0242 16.5594 25.6252 17.3874C25.3842 17.8874 25.2062 18.1124 24.2982 19.0174C23.7112 19.6024 22.9422 20.3424 22.5892 20.6624L21.9472 21.2434L22.0292 21.9484L22.3292 24.4704L22.3252 24.4694Z`,t=`M14.0762 28.6144C14.0412 28.5754 13.8212 28.7204 13.5792 28.9404C12.6222 29.8134 11.2312 30.5604 10.0332 30.8454C8.65123 31.1744 7.01323 31.0224 5.79123 30.4514C2.92923 29.1144 0.804227 25.4994 0.103227 20.7734C-0.0497729 19.7414 -0.0287729 16.9264 0.140227 15.8364C0.960227 10.5364 3.82723 6.02138 8.21723 3.11138C10.3782 1.67938 12.5172 0.824384 15.2052 0.320384C15.2052 0.320384 17.1452 0.0133843 18.4022 0.000384324C19.6582 -0.0116157 21.6212 0.261384 21.6212 0.261384C23.6042 0.611384 24.9552 1.04838 26.6802 1.89538C32.2512 4.63138 35.9422 9.66838 36.8982 15.8374C37.0982 17.1274 37.0782 19.3074 36.8562 20.5774C36.2052 24.2874 34.6432 27.5644 31.6092 31.5814C29.9942 33.7194 28.6262 35.2914 25.7492 38.3174C25.0122 39.0924 24.1402 40.0094 23.8132 40.3534C21.8852 42.3834 21.0552 43.3834 20.7252 44.0734C20.4982 44.5484 20.4822 44.6404 20.4842 45.4444C20.4862 46.1554 20.5182 46.3844 20.6662 46.7564C20.9162 47.3824 21.5052 48.0024 22.1492 48.3184C22.6002 48.5404 22.7632 48.5764 23.4212 48.6024C24.0692 48.6284 24.2542 48.6054 24.7302 48.4404C25.8402 48.0544 26.7512 47.2604 28.5242 45.1304C29.6172 43.8174 31.2162 42.1474 31.9532 41.5504L32.4382 41.1564L32.3932 40.6214C32.3042 39.5574 32.6222 38.6544 33.3602 37.8824C34.7502 36.4284 36.9732 36.4274 38.3632 37.8824C38.8442 38.3854 39.0682 38.7824 39.2372 39.4274C39.7142 41.2564 38.5902 43.1914 36.7662 43.6814C36.2222 43.8274 35.3712 43.7944 34.8082 43.6054C34.3372 43.4464 34.3062 43.4454 34.1082 43.5754C33.6692 43.8624 31.7202 45.8964 30.6282 47.2064C28.9112 49.2664 27.8682 50.1944 26.5232 50.8554C25.1112 51.5494 23.6002 51.7284 22.1502 51.3724C20.9452 51.0774 19.5702 50.2404 18.7512 49.3034C18.5802 49.1084 17.9402 48.4164 17.3302 47.7654C15.0412 45.3284 12.1172 41.8154 9.95323 38.9044C8.73323 37.2624 7.24823 35.1324 7.12923 34.8544C6.90323 34.3224 7.06323 33.6224 7.50523 33.2124C8.10823 32.6534 9.24323 32.7894 9.72823 33.4794C9.84223 33.6414 10.3312 34.3384 10.8152 35.0284C12.4422 37.3464 14.2312 39.6604 16.1142 41.8814C17.2302 43.1974 17.6012 43.6044 17.6862 43.6044C17.7222 43.6044 17.8142 43.4374 17.8902 43.2324C18.3712 41.9324 18.8812 41.3094 23.4552 36.4394C26.8352 32.8404 27.4492 32.1484 28.7692 30.4444C31.9322 26.3644 33.5292 23.0424 33.9762 19.6154C34.1262 18.4634 34.1272 17.9024 33.9812 16.6584C33.7422 14.6194 33.2932 13.1444 32.3572 11.3224C30.2832 7.28338 26.1822 4.16338 21.7752 3.27138C19.3992 2.79038 16.9572 2.84638 14.6542 3.43338C8.66023 4.96138 4.18023 9.84338 3.12523 15.9964C2.92023 17.1944 2.93523 19.6144 3.15723 20.8944C3.80423 24.6334 5.39323 27.2594 7.42223 27.9434C8.38123 28.2664 9.69823 28.0674 10.7622 27.4364C11.2872 27.1254 12.2002 26.3044 12.0832 26.2494C12.0402 26.2294 11.7092 26.0224 11.3482 25.7904Z`,n=[[35.85,40.1],[33.2,42.4],[31.2,44.4],[29,46.8],[26.6,49],[24.2,50.1],[22,49.8],[20.3,48.4],[19.4,46.2],[19.6,43.9],[21.6,41.2],[24.6,37.4],[28,33.6],[30.6,30],[33.2,25.6],[34.9,21.2],[35.4,17.6],[34.6,13],[32.4,8.8],[28.8,5.2],[24,2.4],[18.4,1.5],[13.2,2.2],[8.6,4.6],[4.8,8.4],[2.4,13],[1.5,18],[1.9,22.8],[3.4,26.6],[5.8,29],[8.8,29.6],[11.2,28.6],[12.8,27.6]],r=[[20,49],[18.6,47.4],[16.2,44.6],[13.4,41.2],[10.6,37.6],[8.3,34.2],[6.4,31.4]],i=[12.8,27.6],a=[35.85,40.1],o=`M18.05 42.95 C17.4 44.6 17.55 47.7 19.65 50.2 L-6 50.3 L-6 31.8 L14 31.8 Z`,s=`M18.3 42.95 C17.65 44.6 17.8 47.7 19.9 50.2 L-6 50.3 L-6 31.8 L14 31.8 Z`;function c(e){let t=`M${e[0][0]} ${e[0][1]}`;for(let n=0;n<e.length-1;n++){let r=e[n-1]||e[n],i=e[n],a=e[n+1],o=e[n+2]||a;t+=`C${(i[0]+(a[0]-r[0])/6).toFixed(3)} ${(i[1]+(a[1]-r[1])/6).toFixed(3)} ${(a[0]-(o[0]-i[0])/6).toFixed(3)} ${(a[1]-(o[1]-i[1])/6).toFixed(3)} ${a[0]} ${a[1]}`}return t}var l=c(n),u=c(n.concat([[14.5,26.55]])),d=c(r);exports.ANCHOR=i,exports.DOT=a,exports.LEG=r,exports.LEG_D=d,exports.LEG_POLY=o,exports.LEG_POLY2=s,exports.PIN_D=t,exports.PLANE_D=e,exports.ROUTE=n,exports.ROUTE_D=l,exports.ROUTE_X=u;
2
+ //# sourceMappingURL=LogoAnimationArtwork.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LogoAnimationArtwork.cjs","names":["PLANE_D","PIN_D","ROUTE","LEG","ANCHOR","DOT","LEG_POLY","LEG_POLY2","catmullRom","d","p","i","a","b","c","e","ROUTE_D","ROUTE_X","LEG_D"],"sources":["../../../src/components/LogoAnimation/LogoAnimationArtwork.ts"],"sourcesContent":["/* Shapes of the logo animation, from the approved animation demo (TravelMatch logo animation, \"TMLogo\").\n Everything is drawn in the 40×52 box of the mark (LogoArtwork.tsx); the landed pose is the mark itself (`LogoMark`).\n Path data is verbatim — do not edit by hand. */\n\ntype Point = readonly [number, number];\n\n/** The paper plane alone: the part of the mark that flies. */\nexport const PLANE_D =\n 'M22.3252 24.4694C22.3252 24.4694 22.4142 25.3934 22.5202 26.2554C22.7902 28.4354 22.7862 28.5414 22.4152 29.0094C22.0352 29.4884 21.8652 29.6294 21.7782 29.5384C21.7092 29.4664 21.3502 28.6554 20.3172 26.2344C19.8222 25.0744 19.1002 23.7904 18.9422 23.7894C18.9162 23.7894 18.0692 24.4494 17.0592 25.2574L15.2222 26.7264L15.2482 27.9014L15.2632 28.5794C15.2702 28.8964 15.1462 29.2024 14.9172 29.4224C14.8712 29.4664 14.7752 29.5504 14.7202 29.5714C14.6482 29.5994 14.4742 29.5544 14.4402 29.4644C14.1612 28.7424 14.1312 28.6764 14.0762 28.6144L11.3482 25.7904L11.1282 25.6494C10.9222 25.5174 10.9202 25.2174 11.1242 25.0824C11.4022 24.8984 11.7392 24.8284 12.0672 24.8854L12.4872 24.9594C12.9992 25.0494 13.5182 25.1434 13.6412 25.1684C13.8472 25.2104 13.9902 25.0884 15.5052 23.5834C16.4072 22.6864 17.1442 21.9164 17.1412 21.8724C17.1302 21.6784 16.1102 20.9604 14.9312 20.3174C12.5572 19.0234 11.5742 18.4554 11.5742 18.3794C11.5742 18.2594 12.4242 17.7504 12.6982 17.7064C12.8502 17.6824 13.7132 17.8384 14.8982 18.1044L16.8482 18.5424L18.5762 18.8914C19.5452 19.1144 19.7972 19.1654 19.9332 19.1654C20.0192 19.1654 20.5312 18.7914 21.0712 18.3334C23.1202 16.5934 23.6702 16.2134 24.5132 15.9544C25.2132 15.7384 25.5812 15.7514 25.8312 16.0004C26.0562 16.2524 26.0242 16.5594 25.6252 17.3874C25.3842 17.8874 25.2062 18.1124 24.2982 19.0174C23.7112 19.6024 22.9422 20.3424 22.5892 20.6624L21.9472 21.2434L22.0292 21.9484L22.3292 24.4704L22.3252 24.4694Z';\n\n/** The pin alone (the mark without the plane): revealed by the line the plane draws. */\nexport const PIN_D =\n 'M14.0762 28.6144C14.0412 28.5754 13.8212 28.7204 13.5792 28.9404C12.6222 29.8134 11.2312 30.5604 10.0332 30.8454C8.65123 31.1744 7.01323 31.0224 5.79123 30.4514C2.92923 29.1144 0.804227 25.4994 0.103227 20.7734C-0.0497729 19.7414 -0.0287729 16.9264 0.140227 15.8364C0.960227 10.5364 3.82723 6.02138 8.21723 3.11138C10.3782 1.67938 12.5172 0.824384 15.2052 0.320384C15.2052 0.320384 17.1452 0.0133843 18.4022 0.000384324C19.6582 -0.0116157 21.6212 0.261384 21.6212 0.261384C23.6042 0.611384 24.9552 1.04838 26.6802 1.89538C32.2512 4.63138 35.9422 9.66838 36.8982 15.8374C37.0982 17.1274 37.0782 19.3074 36.8562 20.5774C36.2052 24.2874 34.6432 27.5644 31.6092 31.5814C29.9942 33.7194 28.6262 35.2914 25.7492 38.3174C25.0122 39.0924 24.1402 40.0094 23.8132 40.3534C21.8852 42.3834 21.0552 43.3834 20.7252 44.0734C20.4982 44.5484 20.4822 44.6404 20.4842 45.4444C20.4862 46.1554 20.5182 46.3844 20.6662 46.7564C20.9162 47.3824 21.5052 48.0024 22.1492 48.3184C22.6002 48.5404 22.7632 48.5764 23.4212 48.6024C24.0692 48.6284 24.2542 48.6054 24.7302 48.4404C25.8402 48.0544 26.7512 47.2604 28.5242 45.1304C29.6172 43.8174 31.2162 42.1474 31.9532 41.5504L32.4382 41.1564L32.3932 40.6214C32.3042 39.5574 32.6222 38.6544 33.3602 37.8824C34.7502 36.4284 36.9732 36.4274 38.3632 37.8824C38.8442 38.3854 39.0682 38.7824 39.2372 39.4274C39.7142 41.2564 38.5902 43.1914 36.7662 43.6814C36.2222 43.8274 35.3712 43.7944 34.8082 43.6054C34.3372 43.4464 34.3062 43.4454 34.1082 43.5754C33.6692 43.8624 31.7202 45.8964 30.6282 47.2064C28.9112 49.2664 27.8682 50.1944 26.5232 50.8554C25.1112 51.5494 23.6002 51.7284 22.1502 51.3724C20.9452 51.0774 19.5702 50.2404 18.7512 49.3034C18.5802 49.1084 17.9402 48.4164 17.3302 47.7654C15.0412 45.3284 12.1172 41.8154 9.95323 38.9044C8.73323 37.2624 7.24823 35.1324 7.12923 34.8544C6.90323 34.3224 7.06323 33.6224 7.50523 33.2124C8.10823 32.6534 9.24323 32.7894 9.72823 33.4794C9.84223 33.6414 10.3312 34.3384 10.8152 35.0284C12.4422 37.3464 14.2312 39.6604 16.1142 41.8814C17.2302 43.1974 17.6012 43.6044 17.6862 43.6044C17.7222 43.6044 17.8142 43.4374 17.8902 43.2324C18.3712 41.9324 18.8812 41.3094 23.4552 36.4394C26.8352 32.8404 27.4492 32.1484 28.7692 30.4444C31.9322 26.3644 33.5292 23.0424 33.9762 19.6154C34.1262 18.4634 34.1272 17.9024 33.9812 16.6584C33.7422 14.6194 33.2932 13.1444 32.3572 11.3224C30.2832 7.28338 26.1822 4.16338 21.7752 3.27138C19.3992 2.79038 16.9572 2.84638 14.6542 3.43338C8.66023 4.96138 4.18023 9.84338 3.12523 15.9964C2.92023 17.1944 2.93523 19.6144 3.15723 20.8944C3.80423 24.6334 5.39323 27.2594 7.42223 27.9434C8.38123 28.2664 9.69823 28.0674 10.7622 27.4364C11.2872 27.1254 12.2002 26.3044 12.0832 26.2494C12.0402 26.2294 11.7092 26.0224 11.3482 25.7904Z';\n\n/** Centreline of the line the plane draws: dot → bottom → right side → top → left side → turn right → landing. */\nexport const ROUTE: readonly Point[] = [\n [35.85, 40.1], [33.2, 42.4], [31.2, 44.4], [29, 46.8], [26.6, 49], [24.2, 50.1], [22, 49.8], [20.3, 48.4], [19.4, 46.2],\n [19.6, 43.9], [21.6, 41.2], [24.6, 37.4], [28, 33.6], [30.6, 30], [33.2, 25.6], [34.9, 21.2], [35.4, 17.6], [34.6, 13],\n [32.4, 8.8], [28.8, 5.2], [24, 2.4], [18.4, 1.5], [13.2, 2.2], [8.6, 4.6], [4.8, 8.4], [2.4, 13], [1.5, 18], [1.9, 22.8],\n [3.4, 26.6], [5.8, 29], [8.8, 29.6], [11.2, 28.6], [12.8, 27.6],\n];\n\n/** Lower-left branch: root at the bottom junction → free end. */\nexport const LEG: readonly Point[] = [[20.0, 49.0], [18.6, 47.4], [16.2, 44.6], [13.4, 41.2], [10.6, 37.6], [8.3, 34.2], [6.4, 31.4]];\n\n/** Tail anchor of the plane and its heading (degrees) in the logo. */\nexport const ANCHOR: Point = [12.8, 27.6];\nexport const HEAD0 = -41;\n\n/** Centre of the dot the plane takes off from. */\nexport const DOT: Point = [35.85, 40.1];\n\n/** Area of the lower-left branch: cut out of the main line (`LEG_POLY`) and given to the branch (`LEG_POLY2`). */\nexport const LEG_POLY = 'M18.05 42.95 C17.4 44.6 17.55 47.7 19.65 50.2 L-6 50.3 L-6 31.8 L14 31.8 Z';\nexport const LEG_POLY2 = 'M18.3 42.95 C17.65 44.6 17.8 47.7 19.9 50.2 L-6 50.3 L-6 31.8 L14 31.8 Z';\n\n/** Smooth path through the points (Catmull-Rom as cubic Béziers). */\nfunction catmullRom(p: readonly Point[]): string {\n let d = `M${p[0][0]} ${p[0][1]}`;\n for (let i = 0; i < p.length - 1; i++) {\n const a = p[i - 1] || p[i];\n const b = p[i];\n const c = p[i + 1];\n const e = p[i + 2] || c;\n d += `C${(b[0] + (c[0] - a[0]) / 6).toFixed(3)} ${(b[1] + (c[1] - a[1]) / 6).toFixed(3)} ${(c[0] - (e[0] - b[0]) / 6).toFixed(3)} ${(c[1] - (e[1] - b[1]) / 6).toFixed(3)} ${c[0]} ${c[1]}`;\n }\n return d;\n}\n\n/** The route the plane follows (measured, never painted). */\nexport const ROUTE_D = /* @__PURE__ */ catmullRom(ROUTE);\n/** The route plus a short run-out under the plane's tail: the stroke of the mask that reveals the line. */\nexport const ROUTE_X = /* @__PURE__ */ catmullRom(ROUTE.concat([[14.5, 26.55]]));\n/** The branch centreline: the stroke of the mask that reveals the branch. */\nexport const LEG_D = /* @__PURE__ */ catmullRom(LEG);\n"],"mappings":"A,aAOA,IAAaA,EACX,o7CAGWC,EACX,6pFAGWC,EAA0B,CACrC,CAAC,MAAO,IAAI,EAAG,CAAC,KAAM,IAAI,EAAG,CAAC,KAAM,IAAI,EAAG,CAAC,GAAI,IAAI,EAAG,CAAC,KAAM,EAAE,EAAG,CAAC,KAAM,IAAI,EAAG,CAAC,GAAI,IAAI,EAAG,CAAC,KAAM,IAAI,EAAG,CAAC,KAAM,IAAI,EACtH,CAAC,KAAM,IAAI,EAAG,CAAC,KAAM,IAAI,EAAG,CAAC,KAAM,IAAI,EAAG,CAAC,GAAI,IAAI,EAAG,CAAC,KAAM,EAAE,EAAG,CAAC,KAAM,IAAI,EAAG,CAAC,KAAM,IAAI,EAAG,CAAC,KAAM,IAAI,EAAG,CAAC,KAAM,EAAE,EACrH,CAAC,KAAM,GAAG,EAAG,CAAC,KAAM,GAAG,EAAG,CAAC,GAAI,GAAG,EAAG,CAAC,KAAM,GAAG,EAAG,CAAC,KAAM,GAAG,EAAG,CAAC,IAAK,GAAG,EAAG,CAAC,IAAK,GAAG,EAAG,CAAC,IAAK,EAAE,EAAG,CAAC,IAAK,EAAE,EAAG,CAAC,IAAK,IAAI,EACvH,CAAC,IAAK,IAAI,EAAG,CAAC,IAAK,EAAE,EAAG,CAAC,IAAK,IAAI,EAAG,CAAC,KAAM,IAAI,EAAG,CAAC,KAAM,IAAI,CAChE,EAGaC,EAAwB,CAAC,CAAC,GAAM,EAAI,EAAG,CAAC,KAAM,IAAI,EAAG,CAAC,KAAM,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