@planningcenter/topbar 12.4.1 → 12.5.0-qa-994.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.
package/dist/topbar.js CHANGED
@@ -7,16 +7,18 @@ var general = require('@planningcenter/icons/paths/general');
7
7
  var Jolt = require('@planningcenter/jolt-client');
8
8
  var shim = require('use-sync-external-store/shim');
9
9
  require('react/jsx-runtime');
10
+ var toolbar = require('@planningcenter/icons/paths/toolbar');
11
+ var datetimeFmt = require('@planningcenter/datetime-fmt');
12
+ var pluralize = require('pluralize');
13
+ var logomarks = require('@planningcenter/icons/paths/logomark');
10
14
  var tapestryReact = require('@planningcenter/tapestry-react');
11
15
  var addOns = require('@planningcenter/add-ons');
12
16
  var churchCenter = require('@planningcenter/icons/paths/church-center');
13
17
  var people = require('@planningcenter/icons/paths/people');
14
- var toolbar = require('@planningcenter/icons/paths/toolbar');
15
18
  var reactCalendly = require('react-calendly');
16
19
  var algoliasearch = require('algoliasearch');
17
20
  var reactInstantsearchCore = require('react-instantsearch-core');
18
21
  var reactTransitionGroup = require('react-transition-group');
19
- var datetimeFmt = require('@planningcenter/datetime-fmt');
20
22
 
21
23
  function _interopNamespaceDefault(e) {
22
24
  var n = Object.create(null);
@@ -37,11 +39,12 @@ function _interopNamespaceDefault(e) {
37
39
 
38
40
  var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);
39
41
  var general__namespace = /*#__PURE__*/_interopNamespaceDefault(general);
42
+ var toolbar__namespace = /*#__PURE__*/_interopNamespaceDefault(toolbar);
43
+ var logomarks__namespace = /*#__PURE__*/_interopNamespaceDefault(logomarks);
40
44
  var churchCenter__namespace = /*#__PURE__*/_interopNamespaceDefault(churchCenter);
41
45
  var people__namespace = /*#__PURE__*/_interopNamespaceDefault(people);
42
- var toolbar__namespace = /*#__PURE__*/_interopNamespaceDefault(toolbar);
43
46
 
44
- var styles$m = {"accessibility-toolbar":"accessibility-toolbar-jgjUG"};
47
+ var styles$u = {"accessibility-toolbar":"accessibility-toolbar-jgjUG"};
45
48
 
46
49
  const AccessibilityToolbar = ({
47
50
  children
@@ -53,7 +56,7 @@ const AccessibilityToolbar = ({
53
56
  (_a = document.getElementById("main-content")) === null || _a === void 0 ? void 0 : _a.focus();
54
57
  };
55
58
  return /*#__PURE__*/React.createElement("div", {
56
- className: styles$m["accessibility-toolbar"]
59
+ className: styles$u["accessibility-toolbar"]
57
60
  }, /*#__PURE__*/React.createElement(tapestry.Link, {
58
61
  href: "#main-content",
59
62
  kind: "primary",
@@ -372,11 +375,11 @@ const X = ({
372
375
  fill: fill
373
376
  })));
374
377
 
375
- var styles$l = {"announcement":"announcement-pI5tM","announcement--platform":"announcement--platform-EcUn2","announcement--promo":"announcement--promo-FarUk","announcement-icon":"announcement-icon-Ov39-","announcement-content":"announcement-content-q2ad6","dismiss":"dismiss-wUAoU","dismiss--promo":"dismiss--promo-7zvO4"};
378
+ var styles$t = {"announcement":"announcement-pI5tM","announcement--platform":"announcement--platform-EcUn2","announcement--promo":"announcement--promo-FarUk","announcement-icon":"announcement-icon-Ov39-","announcement-content":"announcement-content-q2ad6","dismiss":"dismiss-wUAoU","dismiss--promo":"dismiss--promo-7zvO4"};
376
379
 
377
380
  function AnnouncementIcon() {
378
381
  return /*#__PURE__*/React.createElement("svg", {
379
- className: styles$l["announcement-icon"],
382
+ className: styles$t["announcement-icon"],
380
383
  width: "16",
381
384
  height: "16",
382
385
  viewBox: "0 0 16 16",
@@ -501,7 +504,7 @@ let StyledAnnouncement$1 = class StyledAnnouncement extends React.Component {
501
504
  } = this.props;
502
505
  const isPromo = variant === "promo";
503
506
  return /*#__PURE__*/React.createElement("div", {
504
- className: classnames(styles$l["announcement"], styles$l[`announcement--${variant !== null && variant !== void 0 ? variant : "platform"}`]),
507
+ className: classnames(styles$t["announcement"], styles$t[`announcement--${variant !== null && variant !== void 0 ? variant : "platform"}`]),
505
508
  "data-announcement-variant": variant !== null && variant !== void 0 ? variant : "platform",
506
509
  style: isPromo ? {
507
510
  backgroundImage: promoBackgroundUrl,
@@ -510,7 +513,7 @@ let StyledAnnouncement$1 = class StyledAnnouncement extends React.Component {
510
513
  backgroundSize: "cover"
511
514
  } : undefined
512
515
  }, !isPromo && /*#__PURE__*/React.createElement(AnnouncementIcon, null), /*#__PURE__*/React.createElement("div", {
513
- className: styles$l["announcement-content"],
516
+ className: styles$t["announcement-content"],
514
517
  style: style,
515
518
  ...platformProps
516
519
  }));
@@ -559,7 +562,7 @@ function StyledDismissButton$1({
559
562
  const isPromo = variant === "promo";
560
563
  return /*#__PURE__*/React.createElement("button", {
561
564
  type: "button",
562
- className: classnames(styles$l.dismiss, isPromo && styles$l["dismiss--promo"]),
565
+ className: classnames(styles$t.dismiss, isPromo && styles$t["dismiss--promo"]),
563
566
  ...props
564
567
  }, /*#__PURE__*/React.createElement(X, {
565
568
  fill: isPromo ? "currentColor" : "white",
@@ -639,9 +642,9 @@ class StyledAnnouncement extends React.Component {
639
642
  ...platformProps
640
643
  } = this.props;
641
644
  return /*#__PURE__*/React.createElement("div", {
642
- className: styles$l["announcement"]
645
+ className: styles$t["announcement"]
643
646
  }, /*#__PURE__*/React.createElement(AnnouncementIcon, null), /*#__PURE__*/React.createElement("div", {
644
- className: styles$l["announcement-content"],
647
+ className: styles$t["announcement-content"],
645
648
  style: style,
646
649
  ...platformProps
647
650
  }));
@@ -652,7 +655,7 @@ function StyledDismissButton({
652
655
  }) {
653
656
  return /*#__PURE__*/React.createElement("button", {
654
657
  type: "button",
655
- className: styles$l.dismiss,
658
+ className: styles$t.dismiss,
656
659
  ...props
657
660
  }, /*#__PURE__*/React.createElement(X, {
658
661
  fill: "white",
@@ -1774,7 +1777,7 @@ function MonoAppIcon({
1774
1777
  })) : (/*#__PURE__*/React.createElement("div", null, "appName not supported")));
1775
1778
  }
1776
1779
 
1777
- var styles$k = {"icon-slot":"icon-slot-m3ZIk","name":"name-UNqbW"};
1780
+ var styles$s = {"name":"name-UNqbW"};
1778
1781
 
1779
1782
  const AppRow = ({
1780
1783
  appName,
@@ -1782,25 +1785,23 @@ const AppRow = ({
1782
1785
  iconSize = 24
1783
1786
  }) => {
1784
1787
  if (appName === "Accounts") {
1785
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", {
1786
- className: styles$k["icon-slot"]
1787
- }, /*#__PURE__*/React.createElement(MonoAppIcon, {
1788
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(MonoAppIcon, {
1788
1789
  appName: "Accounts",
1789
1790
  colors: colors,
1790
1791
  size: iconSize
1791
- })), /*#__PURE__*/React.createElement("span", {
1792
- className: styles$k.name
1792
+ }), /*#__PURE__*/React.createElement("span", {
1793
+ className: styles$s.name
1793
1794
  }, "Account settings"));
1794
1795
  }
1795
1796
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ColorAppIcon, {
1796
1797
  appName: appName.replace(/[\s-]/, ""),
1797
1798
  size: iconSize
1798
1799
  }), /*#__PURE__*/React.createElement("span", {
1799
- className: styles$k.name
1800
+ className: styles$s.name
1800
1801
  }, appName));
1801
1802
  };
1802
1803
 
1803
- var styles$j = {"button":"button-XMbeQ","label":"label-884of","chevron":"chevron-RRg9k"};
1804
+ var styles$r = {"button":"button-XMbeQ","label":"label-884of","chevron":"chevron-RRg9k"};
1804
1805
 
1805
1806
  const AppsButton = /*#__PURE__*/React.forwardRef(({
1806
1807
  appName,
@@ -1812,27 +1813,27 @@ const AppsButton = /*#__PURE__*/React.forwardRef(({
1812
1813
  ...restProps,
1813
1814
  ref: ref,
1814
1815
  "aria-label": `App switcher: ${appName}`,
1815
- className: styles$j.button,
1816
+ className: styles$r.button,
1816
1817
  kind: "neutral-inline",
1817
1818
  label: /*#__PURE__*/React.createElement("span", {
1818
- className: styles$j.label
1819
+ className: styles$r.label
1819
1820
  }, isAccounts ? "Account settings" : appName),
1820
1821
  prefix: isAccounts ? (/*#__PURE__*/React.createElement(MonoAppIcon, {
1821
1822
  appName: "Accounts",
1822
1823
  colors: colors,
1823
- size: 22
1824
+ size: 24
1824
1825
  })) : (/*#__PURE__*/React.createElement(ColorAppIcon, {
1825
1826
  appName: appName.replace(/[\s-]/, ""),
1826
- size: 22
1827
+ size: 24
1827
1828
  })),
1828
1829
  suffix: /*#__PURE__*/React.createElement(DisclosureChevronIcon, {
1829
- className: `${styles$j.chevron} symbol`
1830
+ className: `${styles$r.chevron} symbol`
1830
1831
  })
1831
1832
  });
1832
1833
  });
1833
1834
  AppsButton.displayName = "AppsButton";
1834
1835
 
1835
- var styles$i = {"nav":"nav-y-6ML","popover-content":"popover-content-jOAAY","list":"list-jUxvp","link":"link-LMp2h","current":"current-4U4VL","accounts-item":"accounts-item-erJW0","accounts-link":"accounts-link-4jwPW"};
1836
+ var styles$q = {"nav":"nav-y-6ML","popover-content":"popover-content-jOAAY","list":"list-jUxvp","link":"link-LMp2h","current":"current-4U4VL","accounts-item":"accounts-item-erJW0","accounts-link":"accounts-link-4jwPW"};
1836
1837
 
1837
1838
  const AppsMenu = ({
1838
1839
  appName,
@@ -1853,8 +1854,8 @@ const AppsMenu = ({
1853
1854
  }, /*#__PURE__*/React.createElement("a", {
1854
1855
  "aria-current": isCurrent ? "page" : undefined,
1855
1856
  "aria-label": name,
1856
- className: classnames(styles$i.link, {
1857
- [styles$i.current]: isCurrent
1857
+ className: classnames(styles$q.link, {
1858
+ [styles$q.current]: isCurrent
1858
1859
  }),
1859
1860
  "data-pendo": `app-switcher--change-app--${name}`,
1860
1861
  "data-turbolinks": false,
@@ -1870,22 +1871,22 @@ const AppsMenu = ({
1870
1871
  colors: colors
1871
1872
  })), /*#__PURE__*/React.createElement(tapestry.PopoverContent, {
1872
1873
  "aria-label": "Switch app",
1873
- className: styles$i["popover-content"],
1874
+ className: styles$q["popover-content"],
1874
1875
  placement: "bottom start"
1875
1876
  }, /*#__PURE__*/React.createElement("nav", {
1876
- className: styles$i.nav,
1877
+ className: styles$q.nav,
1877
1878
  "data-pendo": "app-switcher"
1878
1879
  }, /*#__PURE__*/React.createElement("ul", {
1879
- className: styles$i.list,
1880
+ className: styles$q.list,
1880
1881
  role: "list"
1881
1882
  }, homeProduct && renderProductLink(homeProduct.name), restProducts.map(({
1882
1883
  name
1883
1884
  }) => renderProductLink(name)), accountsProduct && (/*#__PURE__*/React.createElement("li", {
1884
- className: styles$i["accounts-item"]
1885
+ className: styles$q["accounts-item"]
1885
1886
  }, /*#__PURE__*/React.createElement("a", {
1886
1887
  "aria-current": appName === accountsProduct.name ? "page" : undefined,
1887
1888
  "aria-label": "Account settings",
1888
- className: classnames(styles$i.link, styles$i["accounts-link"]),
1889
+ className: classnames(styles$q.link, styles$q["accounts-link"]),
1889
1890
  "data-pendo": "app-switcher--change-app--Accounts",
1890
1891
  "data-turbolinks": false,
1891
1892
  href: pcoUrl$1(env)("accounts") + getAppsSwitchProductPath(accountsProduct.name)
@@ -2093,7 +2094,7 @@ function MonoAppName({
2093
2094
  })) : (/*#__PURE__*/React.createElement("div", null, "appName not supported"));
2094
2095
  }
2095
2096
 
2096
- var styles$h = {"unbutton":"unbutton-lEbTR"};
2097
+ var styles$p = {"unbutton":"unbutton-lEbTR"};
2097
2098
 
2098
2099
  function Unbutton({
2099
2100
  className,
@@ -2102,7 +2103,7 @@ function Unbutton({
2102
2103
  ...nativeProps
2103
2104
  }) {
2104
2105
  return /*#__PURE__*/React.createElement("button", {
2105
- className: classnames(styles$h.unbutton, className),
2106
+ className: classnames(styles$p.unbutton, className),
2106
2107
  style: {
2107
2108
  ...style
2108
2109
  },
@@ -2111,7 +2112,7 @@ function Unbutton({
2111
2112
  });
2112
2113
  }
2113
2114
 
2114
- var styles$g = {"button":"button-wsipc","button-accounts":"button-accounts-zQmBM","chevron":"chevron-obyBF","is-expanded":"is-expanded-PoCQ9"};
2115
+ var styles$o = {"button":"button-wsipc","button-accounts":"button-accounts-zQmBM","chevron":"chevron-obyBF","is-expanded":"is-expanded-PoCQ9"};
2115
2116
 
2116
2117
  const LegacyAppsButton = ({
2117
2118
  appName,
@@ -2126,8 +2127,8 @@ const LegacyAppsButton = ({
2126
2127
  "aria-haspopup": "true",
2127
2128
  "aria-label": `App switcher: ${appName}`,
2128
2129
  onClick: onClick,
2129
- className: classnames(styles$g.button, {
2130
- [styles$g["is-expanded"]]: expanded
2130
+ className: classnames(styles$o.button, {
2131
+ [styles$o["is-expanded"]]: expanded
2131
2132
  }),
2132
2133
  type: "button",
2133
2134
  style: style,
@@ -2136,7 +2137,7 @@ const LegacyAppsButton = ({
2136
2137
  appName: "Accounts",
2137
2138
  colors: colors
2138
2139
  }), /*#__PURE__*/React.createElement("div", {
2139
- className: styles$g["button-accounts"]
2140
+ className: styles$o["button-accounts"]
2140
2141
  }, "Account settings"))) : (/*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ColorAppIcon, {
2141
2142
  appName: appName.replace(/[\s-]/, "")
2142
2143
  }), /*#__PURE__*/React.createElement(MonoAppName, {
@@ -2144,7 +2145,7 @@ const LegacyAppsButton = ({
2144
2145
  key: "mono-app-name",
2145
2146
  size: 24
2146
2147
  }))), /*#__PURE__*/React.createElement(DisclosureChevronIcon, {
2147
- className: styles$g.chevron,
2148
+ className: styles$o.chevron,
2148
2149
  key: "disclosure-chevron-icon"
2149
2150
  }));
2150
2151
  };
@@ -2277,7 +2278,7 @@ class Outsider extends React.Component {
2277
2278
  }
2278
2279
  }
2279
2280
 
2280
- var styles$f = {"popup-root":"popup-root-SeL5u","popup":"popup-nQXYW","is-visible":"is-visible-3DAUP"};
2281
+ var styles$n = {"popup-root":"popup-root-SeL5u","popup":"popup-nQXYW","is-visible":"is-visible-3DAUP"};
2281
2282
 
2282
2283
  const Popup = ({
2283
2284
  className,
@@ -2285,8 +2286,8 @@ const Popup = ({
2285
2286
  isVisible,
2286
2287
  ...nativeProps
2287
2288
  }) => (/*#__PURE__*/React.createElement(C, {
2288
- className: classnames(styles$f.popup, {
2289
- [styles$f["is-visible"]]: isVisible
2289
+ className: classnames(styles$n.popup, {
2290
+ [styles$n["is-visible"]]: isVisible
2290
2291
  }, className),
2291
2292
  ...nativeProps
2292
2293
  }));
@@ -2294,11 +2295,11 @@ const Popup = ({
2294
2295
  const PopupRoot = ({
2295
2296
  ...nativeProps
2296
2297
  }) => (/*#__PURE__*/React.createElement("div", {
2297
- className: styles$f["popup-root"],
2298
+ className: styles$n["popup-root"],
2298
2299
  ...nativeProps
2299
2300
  }));
2300
2301
 
2301
- var styles$e = {"popup":"popup-bVhSa"};
2302
+ var styles$m = {"popup":"popup-bVhSa"};
2302
2303
 
2303
2304
  const LegacyAppsMenu = ({
2304
2305
  appName,
@@ -2336,7 +2337,7 @@ const LegacyAppsMenu = ({
2336
2337
  cleanup: !visible,
2337
2338
  component: Outsider,
2338
2339
  onOutsideClick: toggle,
2339
- className: styles$e.popup,
2340
+ className: styles$m.popup,
2340
2341
  isVisible: visible
2341
2342
  }, /*#__PURE__*/React.createElement("menu", {
2342
2343
  ref: menuRef,
@@ -3246,37 +3247,144 @@ const useUpdateStore = () => React.useCallback(updates => {
3246
3247
  });
3247
3248
  }, []);
3248
3249
 
3250
+ const collections = {
3251
+ general: general__namespace,
3252
+ toolbar: toolbar__namespace
3253
+ };
3254
+ const paths = collections;
3255
+ function Icon({
3256
+ name,
3257
+ size = 16,
3258
+ style,
3259
+ theme,
3260
+ title,
3261
+ ...props
3262
+ }) {
3263
+ const [collection, symbol] = name.split(".");
3264
+ return /*#__PURE__*/React.createElement("svg", {
3265
+ "aria-hidden": title ? undefined : true,
3266
+ fill: "currentColor",
3267
+ height: size,
3268
+ role: title ? "img" : undefined,
3269
+ style: {
3270
+ color: theme && `var(${theme})`,
3271
+ flexShrink: 0,
3272
+ ...style
3273
+ },
3274
+ viewBox: "0 0 16 16",
3275
+ width: size,
3276
+ ...props
3277
+ }, title && /*#__PURE__*/React.createElement("title", null, title), /*#__PURE__*/React.createElement("path", {
3278
+ d: paths[collection][symbol]
3279
+ }));
3280
+ }
3281
+
3282
+ const SEARCHABLE_PRODUCTS = [{
3283
+ appName: "Calendar",
3284
+ slug: "calendar"
3285
+ }, {
3286
+ appName: "Check-Ins",
3287
+ slug: "check-ins"
3288
+ }, {
3289
+ appName: "Giving",
3290
+ slug: "giving"
3291
+ }, {
3292
+ appName: "Groups",
3293
+ slug: "groups"
3294
+ }, {
3295
+ appName: "People",
3296
+ slug: "people"
3297
+ }, {
3298
+ appName: "Publishing",
3299
+ slug: "publishing"
3300
+ }, {
3301
+ appName: "Registrations",
3302
+ slug: "registrations"
3303
+ }, {
3304
+ appName: "Services",
3305
+ slug: "services"
3306
+ }];
3307
+ const KEYBOARD_SHORTCUTS = {
3308
+ copyLink: {
3309
+ key: "c",
3310
+ label: "Copy link",
3311
+ modifierKey: true
3312
+ },
3313
+ openInNewTab: {
3314
+ label: "Open in new tab"},
3315
+ openSearch: {
3316
+ key: "k",
3317
+ label: "Open search",
3318
+ modifierKey: true
3319
+ },
3320
+ select: {
3321
+ label: "Select",
3322
+ modifierKey: false,
3323
+ next: "ArrowDown",
3324
+ previous: "ArrowUp"
3325
+ }
3326
+ };
3327
+
3249
3328
  const isMac = () => /Mac|iPhone|iPad|iPod/.test(navigator.platform);
3250
3329
  const hasCommandKey = event => isMac() ? event.metaKey : event.ctrlKey;
3251
- const commandKeyLabel = () => isMac() ? "⌘" : "Ctrl+";
3252
- const isSearchShortcut = event => event.key.toLowerCase() === "k" && !event.altKey && !event.shiftKey && hasCommandKey(event);
3330
+ const matchesShortcut = (shortcut, event) => {
3331
+ var _a;
3332
+ // Chrome's autofill sends a keydown with no key.
3333
+ return ((_a = event.key) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === shortcut.key && !event.altKey && !event.shiftKey && hasCommandKey(event) === shortcut.modifierKey;
3334
+ };
3335
+ const isSearchShortcut = event => matchesShortcut(KEYBOARD_SHORTCUTS.openSearch, event);
3253
3336
  // Products opened their own search with `/` before this one replaced it.
3254
3337
  const isLegacySearchShortcut = event => event.key === "/" && !event.altKey && !event.ctrlKey && !event.metaKey && !isTypingIn(event.target);
3255
- const isCopyShortcut = event => event.key.toLowerCase() === "c" && !event.altKey && !event.shiftKey && hasCommandKey(event);
3338
+ const isCopyShortcut = event => matchesShortcut(KEYBOARD_SHORTCUTS.copyLink, event);
3256
3339
  const isTypingIn = target => target instanceof Element && target.closest('input, select, textarea, [contenteditable]:not([contenteditable="false"])') !== null;
3257
3340
  const isTypingKey = event => event.key.length === 1 && event.key !== " " && !event.altKey && !event.ctrlKey && !event.metaKey;
3258
3341
  const verticalStep = key => ({
3259
- ArrowDown: 1,
3260
- ArrowUp: -1
3342
+ [KEYBOARD_SHORTCUTS.select.next]: 1,
3343
+ [KEYBOARD_SHORTCUTS.select.previous]: -1
3261
3344
  })[key];
3262
3345
  const horizontalStep = key => ({
3263
3346
  ArrowLeft: -1,
3264
3347
  ArrowRight: 1
3265
3348
  })[key];
3266
3349
 
3350
+ var styles$l = {"searchButton":"searchButton-fYa5-"};
3351
+
3267
3352
  function SearchButton({
3353
+ mobile = false,
3268
3354
  onClick
3269
3355
  }) {
3270
3356
  return /*#__PURE__*/React.createElement("button", {
3271
- "aria-keyshortcuts": `${isMac() ? "Meta+K" : "Control+K"} /`,
3357
+ "aria-keyshortcuts": mobile ? undefined : `${isMac() ? "Meta" : "Control"}+${KEYBOARD_SHORTCUTS.openSearch.key.toUpperCase()} /`,
3272
3358
  "aria-label": "Search",
3359
+ className: styles$l.searchButton,
3360
+ "data-search-button": true,
3273
3361
  onClick: onClick,
3274
3362
  type: "button"
3275
- }, /*#__PURE__*/React.createElement(Spyglass, {
3276
- fill: "currentColor"
3363
+ }, /*#__PURE__*/React.createElement(Icon, {
3364
+ name: "general.search",
3365
+ size: mobile ? 18 : 14
3277
3366
  }));
3278
3367
  }
3279
3368
 
3369
+ // With the search's own debounce, about 1.4 seconds after the last keystroke,
3370
+ // as in GOV.UK's accessible-autocomplete.
3371
+ const ANNOUNCEMENT_DELAY_MS = 1100;
3372
+ // Screen readers echo typing themselves, as each person has set them to, so
3373
+ // the message waits until typing settles instead of talking over it. Waiting
3374
+ // also lets VoiceOver finish what focus had to say, since it often skips a
3375
+ // change made as focus moves, as when a tab with cached results is selected,
3376
+ // and only the tab someone stops on when arrowing through them is announced.
3377
+ // The region empties at once, so a message that comes back is read again.
3378
+ function useAnnouncement(message) {
3379
+ const [announcement, setAnnouncement] = React.useState(null);
3380
+ React.useEffect(() => {
3381
+ setAnnouncement(null);
3382
+ const timeout = setTimeout(() => setAnnouncement(message), ANNOUNCEMENT_DELAY_MS);
3383
+ return () => clearTimeout(timeout);
3384
+ }, [message]);
3385
+ return announcement;
3386
+ }
3387
+
3280
3388
  // useId isn't available on React 17, which our peer range still supports.
3281
3389
  let instanceCount$1 = 0;
3282
3390
  function useInstanceId(prefix) {
@@ -3546,7 +3654,7 @@ const store = createStore(getAllPcoMeta());
3546
3654
  const recentlyVisitableMetadataStore = createStore({
3547
3655
  metadata: getRecentlyVisitableMetadata()
3548
3656
  });
3549
- function sync() {
3657
+ function sync$1() {
3550
3658
  const nextState = getAllPcoMeta();
3551
3659
  if (!shallowCompare(store.getState(), nextState)) store.setState(nextState);
3552
3660
  const metadata = getRecentlyVisitableMetadata();
@@ -3556,7 +3664,7 @@ function sync() {
3556
3664
  });
3557
3665
  }
3558
3666
  }
3559
- const observer = new MutationObserver(sync);
3667
+ const observer = new MutationObserver(sync$1);
3560
3668
  let hasTriggeredObserve = false;
3561
3669
  function observe() {
3562
3670
  if (hasTriggeredObserve) return;
@@ -3567,7 +3675,7 @@ function observe() {
3567
3675
  // never mutate afterward, so the observer alone would never catch them.
3568
3676
  // Re-read once now, since observe() is only called once a consumer is
3569
3677
  // actually mounting, which is always after the document has fully parsed.
3570
- sync();
3678
+ sync$1();
3571
3679
  observer.observe(document.head, {
3572
3680
  attributes: true,
3573
3681
  childList: true,
@@ -3583,21 +3691,19 @@ function useRecentlyVisitableMetadata() {
3583
3691
  return shim.useSyncExternalStore(recentlyVisitableMetadataStore.subscribe, () => recentlyVisitableMetadataStore.getState().metadata);
3584
3692
  }
3585
3693
 
3586
- // Entries match the ones home-mobile stores, so one list can sync across web
3587
- // and mobile.
3588
- const ENTRY_VERSION = 3;
3589
3694
  const MAX_ENTRIES = 50;
3695
+ const MAX_ENTRY_BYTES = 1024;
3590
3696
  const MAX_TEXT_LENGTH = 200;
3591
- const PRODUCTS = ["accounts", "calendar", "check-ins", "giving", "groups", "home", "login", "people", "publishing", "registrations", "services"];
3697
+ const PRODUCTS$1 = ["accounts", "calendar", "check-ins", "giving", "groups", "home", "login", "people", "publishing", "registrations", "services"];
3592
3698
  // Login has no pages worth returning to.
3593
- const APPS = PRODUCTS.filter(product => product !== "login");
3699
+ const APPS = PRODUCTS$1.filter(product => product !== "login");
3594
3700
  function isId(value) {
3595
3701
  return value !== "" && Array.from(value).every(character => character >= "0" && character <= "9");
3596
3702
  }
3597
3703
  // A PCRL looks like `<product>/v2/<resource_type>/<id>`.
3598
3704
  function isPcrl(value) {
3599
3705
  const segments = value.split("/");
3600
- return segments.length === 4 && PRODUCTS.some(product => product === segments[0]) && isId(segments[3]);
3706
+ return segments.length === 4 && PRODUCTS$1.some(product => product === segments[0]) && isId(segments[3]);
3601
3707
  }
3602
3708
  function isApp(value) {
3603
3709
  return APPS.some(app => app === value);
@@ -3633,8 +3739,8 @@ function entryKey(entry) {
3633
3739
  return `page:${entry.app}:${entry.path.split("?")[0]}`;
3634
3740
  }
3635
3741
  }
3636
- function isEntry(value) {
3637
- if (!isRecord(value) || value.version !== ENTRY_VERSION || typeof value.visitedAt !== "string") {
3742
+ function hasEntryShape(value) {
3743
+ if (!isRecord(value) || typeof value.visitedAt !== "string") {
3638
3744
  return false;
3639
3745
  } else if (value.type === "resource") {
3640
3746
  return typeof value.pcrl === "string" && isPcrl(value.pcrl);
@@ -3644,15 +3750,38 @@ function isEntry(value) {
3644
3750
  return false;
3645
3751
  }
3646
3752
  }
3753
+ function utf8Length(value) {
3754
+ return Array.from(value).reduce((length, character) => {
3755
+ var _a;
3756
+ const codePoint = (_a = character.codePointAt(0)) !== null && _a !== void 0 ? _a : 0;
3757
+ if (codePoint < 0x80) {
3758
+ return length + 1;
3759
+ } else if (codePoint < 0x800) {
3760
+ return length + 2;
3761
+ } else if (codePoint < 0x10000) {
3762
+ return length + 3;
3763
+ } else {
3764
+ return length + 4;
3765
+ }
3766
+ }, 0);
3767
+ }
3768
+ function excessBytes(entry) {
3769
+ return utf8Length(JSON.stringify(entry)) - MAX_ENTRY_BYTES;
3770
+ }
3771
+ // user-store-sync rejects a whole write over one entry above its size limit,
3772
+ // so an entry that can't fit isn't one this list can hold.
3773
+ function isEntry(value) {
3774
+ return hasEntryShape(value) && excessBytes(value) <= 0;
3775
+ }
3647
3776
  // Cuts on code points so a surrogate pair is never split.
3648
3777
  function clampText(value) {
3649
3778
  return Array.from(value).slice(0, MAX_TEXT_LENGTH).join("");
3650
3779
  }
3651
- function clampMetadata({
3780
+ function metadataFrom({
3652
3781
  details,
3653
3782
  type
3654
3783
  }) {
3655
- return {
3784
+ const metadata = {
3656
3785
  ...(details && {
3657
3786
  details: clampText(details)
3658
3787
  }),
@@ -3660,39 +3789,124 @@ function clampMetadata({
3660
3789
  type: clampText(type)
3661
3790
  })
3662
3791
  };
3792
+ return Object.keys(metadata).length > 0 ? {
3793
+ metadata
3794
+ } : {};
3795
+ }
3796
+ function pageEntry({
3797
+ app,
3798
+ path,
3799
+ visitedAt
3800
+ }, {
3801
+ details,
3802
+ title,
3803
+ type
3804
+ }) {
3805
+ return {
3806
+ app,
3807
+ ...metadataFrom({
3808
+ details,
3809
+ type
3810
+ }),
3811
+ path,
3812
+ title: clampText(title),
3813
+ type: "page",
3814
+ visitedAt
3815
+ };
3663
3816
  }
3664
- function clampVisit(visit) {
3665
- if (visit.type === "resource") {
3666
- return visit;
3817
+ function texts(entry) {
3818
+ var _a, _b, _c, _d;
3819
+ return {
3820
+ details: (_b = (_a = entry.metadata) === null || _a === void 0 ? void 0 : _a.details) !== null && _b !== void 0 ? _b : "",
3821
+ title: entry.title,
3822
+ type: (_d = (_c = entry.metadata) === null || _c === void 0 ? void 0 : _c.type) !== null && _d !== void 0 ? _d : ""
3823
+ };
3824
+ }
3825
+ function jsonBytes(value) {
3826
+ return utf8Length(JSON.stringify(value)) - 2;
3827
+ }
3828
+ function longestText(entry) {
3829
+ return Object.entries(texts(entry)).reduce((longest, candidate) => jsonBytes(candidate[1]) > jsonBytes(longest[1]) ? candidate : longest);
3830
+ }
3831
+ // Takes whole characters off the end until at least `excess` bytes are gone,
3832
+ // so a surrogate pair is never split.
3833
+ function shortenBy(value, excess, minLength) {
3834
+ var _a;
3835
+ const characters = Array.from(value);
3836
+ let removed = 0;
3837
+ while (characters.length > minLength && removed < excess) {
3838
+ removed += jsonBytes((_a = characters.pop()) !== null && _a !== void 0 ? _a : "");
3839
+ }
3840
+ return characters.join("");
3841
+ }
3842
+ // Trims the longest text field by the overflow, repeating until the entry
3843
+ // fits or the title is down to one character.
3844
+ function trimTexts(entry) {
3845
+ const excess = excessBytes(entry);
3846
+ const [field, value] = longestText(entry);
3847
+ const shortened = shortenBy(value, excess, field === "title" ? 1 : 0);
3848
+ if (excess <= 0 || shortened === value) {
3849
+ return entry;
3667
3850
  } else {
3668
- return {
3669
- ...visit,
3670
- ...(visit.metadata && {
3671
- metadata: clampMetadata(visit.metadata)
3672
- }),
3673
- title: clampText(visit.title.trim())
3674
- };
3851
+ return trimTexts(pageEntry(entry, {
3852
+ ...texts(entry),
3853
+ [field]: shortened
3854
+ }));
3855
+ }
3856
+ }
3857
+ // The query string is the first thing to go, since it's not part of the
3858
+ // page's identity; what's left is trimmed to fit under the service's limit.
3859
+ function fitPage(entry) {
3860
+ if (excessBytes(entry) <= 0) {
3861
+ return entry;
3862
+ } else {
3863
+ return trimTexts({
3864
+ ...entry,
3865
+ path: entry.path.split("?")[0]
3866
+ });
3675
3867
  }
3676
3868
  }
3677
3869
  function toEntry(visit, visitedAt) {
3678
- return {
3679
- ...clampVisit(visit),
3680
- version: ENTRY_VERSION,
3870
+ const entry = {
3871
+ ...visit,
3681
3872
  visitedAt: visitedAt.toISOString()
3682
3873
  };
3874
+ if (entry.type === "resource") {
3875
+ return entry;
3876
+ } else {
3877
+ return fitPage(pageEntry(entry, {
3878
+ ...texts(entry),
3879
+ title: entry.title.trim()
3880
+ }));
3881
+ }
3882
+ }
3883
+ // user-store-sync rejects a whole write over one field it doesn't know, so
3884
+ // anything else an entry carries (like the version older entries stored) is
3885
+ // dropped on the way in.
3886
+ function withKnownFields(entry) {
3887
+ if (entry.type === "resource") {
3888
+ return {
3889
+ pcrl: entry.pcrl,
3890
+ type: entry.type,
3891
+ visitedAt: entry.visitedAt
3892
+ };
3893
+ } else {
3894
+ return pageEntry(entry, texts(entry));
3895
+ }
3683
3896
  }
3684
3897
  // Recents are disposable: anything unexpected reads as an empty list (or, for
3685
3898
  // a single bad entry, a list without it) rather than throwing.
3899
+ function entriesFrom(value) {
3900
+ if (Array.isArray(value)) {
3901
+ return value.filter(isEntry).map(withKnownFields);
3902
+ } else {
3903
+ return [];
3904
+ }
3905
+ }
3686
3906
  function parseRecentlyVisited(value) {
3687
- let parsed = null;
3688
3907
  try {
3689
- parsed = JSON.parse(value !== null && value !== void 0 ? value : "null");
3908
+ return entriesFrom(JSON.parse(value !== null && value !== void 0 ? value : "null"));
3690
3909
  } catch {
3691
- parsed = null;
3692
- }
3693
- if (Array.isArray(parsed)) {
3694
- return parsed.filter(isEntry);
3695
- } else {
3696
3910
  return [];
3697
3911
  }
3698
3912
  }
@@ -3700,6 +3914,39 @@ function addVisit(entries, entry) {
3700
3914
  const key = entryKey(entry);
3701
3915
  return [entry, ...entries.filter(existing => entryKey(existing) !== key)].slice(0, MAX_ENTRIES);
3702
3916
  }
3917
+ // The service may write timestamps with fewer fractional digits than
3918
+ // toISOString, so they're compared as times rather than strings.
3919
+ function visitTime(entry) {
3920
+ return isRecord(entry) && typeof entry.visitedAt === "string" ? Date.parse(entry.visitedAt) || 0 : 0;
3921
+ }
3922
+ function newestFirst(entries) {
3923
+ const seen = new Set();
3924
+ return entries.sort((a, b) => visitTime(b) - visitTime(a)).filter(entry => {
3925
+ if (isEntry(entry)) {
3926
+ const key = entryKey(entry);
3927
+ const isFirst = !seen.has(key);
3928
+ seen.add(key);
3929
+ return isFirst;
3930
+ } else {
3931
+ return true;
3932
+ }
3933
+ }).slice(0, MAX_ENTRIES);
3934
+ }
3935
+ // One list from several, newest visit first wherever it was recorded.
3936
+ function mergeEntries(...lists) {
3937
+ return newestFirst(lists.flat());
3938
+ }
3939
+ // Products pin different topbar versions, so the shared list can hold entries
3940
+ // this build doesn't recognize (a newer app or type). They're kept, as stored,
3941
+ // in what's written back, so an older topbar never erases a newer client's
3942
+ // visits. Recognized entries lose unknown fields, as on any read, since one
3943
+ // unknown field would get every write rejected.
3944
+ function mergeStored(stored, local) {
3945
+ return newestFirst([...(Array.isArray(stored) ? stored : []).map(entry => isEntry(entry) ? withKnownFields(entry) : entry), ...local]);
3946
+ }
3947
+ function isSameList(a, b) {
3948
+ return a.length === b.length && a.every((entry, index) => entryKey(entry) === entryKey(b[index]) && visitTime(entry) === visitTime(b[index]));
3949
+ }
3703
3950
 
3704
3951
  // The app whose URL, in this environment, has the current page's host.
3705
3952
  // Reversing pcoUrl handles every environment @planningcenter/url knows about,
@@ -3810,9 +4057,195 @@ function useCurrentPersonId() {
3810
4057
  return userId == null ? undefined : String(userId);
3811
4058
  }
3812
4059
 
3813
- // Per-origin localStorage is a stopgap: each product keeps its own list until
3814
- // PCA-409 moves this to storage shared across product subdomains. Only this
3815
- // file should need to change when it does.
4060
+ // Tokens last 15 minutes. Refreshing a minute early keeps one from expiring
4061
+ // between reading a token and the service checking it.
4062
+ const REFRESH_MARGIN_MS = 60000;
4063
+ // A failed mint (a CSRF 422, a 5xx, a body that isn't a token) isn't retried
4064
+ // on every visit and panel open; the product is left alone for a while.
4065
+ const MINT_BACKOFF_MS = 5 * 60000;
4066
+ const MAX_ATTEMPTS = 3;
4067
+ // A product without the endpoint answers 404 for the rest of the session, so
4068
+ // it's asked once per tab rather than on every page.
4069
+ const UNAVAILABLE_UNTIL_KEY = "topbar.user_store_sync.unavailable_until";
4070
+ const END_OF_SESSION = Number.MAX_SAFE_INTEGER;
4071
+ // Per person, so switching connected people never writes one person's visits
4072
+ // with another's token.
4073
+ function tokenKey(personId) {
4074
+ return `topbar.user_store_sync.token.${personId}`;
4075
+ }
4076
+ function readSession(key) {
4077
+ try {
4078
+ return sessionStorage.getItem(key);
4079
+ } catch {
4080
+ return null;
4081
+ }
4082
+ }
4083
+ function writeSession(key, value) {
4084
+ try {
4085
+ sessionStorage.setItem(key, value);
4086
+ } catch {
4087
+ // Without sessionStorage the next request just mints again.
4088
+ }
4089
+ }
4090
+ function isUserStoreSyncUnavailable() {
4091
+ return Number(readSession(UNAVAILABLE_UNTIL_KEY)) > Date.now();
4092
+ }
4093
+ function markUnavailable(until) {
4094
+ writeSession(UNAVAILABLE_UNTIL_KEY, String(until));
4095
+ }
4096
+ function isToken(value) {
4097
+ return isRecord(value) && typeof value.token === "string" && typeof value.url === "string" && Number.isFinite(value.expiresAt) && typeof value.readOnly === "boolean";
4098
+ }
4099
+ function cachedToken(personId) {
4100
+ var _a;
4101
+ try {
4102
+ const token = JSON.parse((_a = readSession(tokenKey(personId))) !== null && _a !== void 0 ? _a : "null");
4103
+ if (isToken(token) && token.expiresAt - REFRESH_MARGIN_MS > Date.now()) {
4104
+ return token;
4105
+ } else {
4106
+ return null;
4107
+ }
4108
+ } catch {
4109
+ return null;
4110
+ }
4111
+ }
4112
+ function tokenFrom(json) {
4113
+ if (isRecord(json)) {
4114
+ const token = {
4115
+ expiresAt: typeof json.expires_at === "string" ? Date.parse(json.expires_at) : NaN,
4116
+ readOnly: json.read_only === true,
4117
+ token: json.token,
4118
+ url: json.url
4119
+ };
4120
+ return isToken(token) ? token : null;
4121
+ } else {
4122
+ return null;
4123
+ }
4124
+ }
4125
+ // The JWT's subject is the person's account center id, the same id the
4126
+ // product gives the topbar as `userId`.
4127
+ function subject(token) {
4128
+ var _a;
4129
+ try {
4130
+ const payload = ((_a = token.split(".")[1]) !== null && _a !== void 0 ? _a : "").split("-").join("+").split("_").join("/");
4131
+ const claims = JSON.parse(atob(payload));
4132
+ return isRecord(claims) ? claims.sub : undefined;
4133
+ } catch {
4134
+ return undefined;
4135
+ }
4136
+ }
4137
+ async function mintToken(personId) {
4138
+ const {
4139
+ json,
4140
+ ok,
4141
+ response
4142
+ } = await apiRequest(railsCsrfFetch, `${window.location.origin}/user_store_sync/token`, {
4143
+ method: "POST"
4144
+ });
4145
+ const minted = ok ? tokenFrom(json) : null;
4146
+ // The product mints for whoever the session belongs to now. In a tab left
4147
+ // open after switching to another connected person, that isn't the person
4148
+ // this page rendered for, and syncing with their token would write this
4149
+ // person's visits into their list. The endpoint is working, so there's
4150
+ // nothing to back off from; the next page load picks up the new person.
4151
+ const token = minted && subject(minted.token) === personId ? minted : null;
4152
+ if (token) {
4153
+ writeSession(tokenKey(personId), JSON.stringify(token));
4154
+ } else if ((response === null || response === void 0 ? void 0 : response.status) === 404) {
4155
+ markUnavailable(END_OF_SESSION);
4156
+ } else if (!minted) {
4157
+ markUnavailable(Date.now() + MINT_BACKOFF_MS);
4158
+ }
4159
+ return token;
4160
+ }
4161
+ function hasReadOnlyToken(personId) {
4162
+ var _a;
4163
+ return ((_a = cachedToken(personId)) === null || _a === void 0 ? void 0 : _a.readOnly) === true;
4164
+ }
4165
+ async function request(personId, key, init = {}, isRetry = false) {
4166
+ var _a;
4167
+ const token = isRetry ? await mintToken(personId) : (_a = cachedToken(personId)) !== null && _a !== void 0 ? _a : await mintToken(personId);
4168
+ if (token) {
4169
+ const response = await fetch(`${token.url}/v1/data/${key}`, {
4170
+ ...init,
4171
+ headers: {
4172
+ ...init.headers,
4173
+ Authorization: `Bearer ${token.token}`
4174
+ }
4175
+ });
4176
+ if (response.status === 401 && !isRetry) {
4177
+ return request(personId, key, init, true);
4178
+ } else {
4179
+ return {
4180
+ response,
4181
+ token
4182
+ };
4183
+ }
4184
+ } else {
4185
+ return null;
4186
+ }
4187
+ }
4188
+ // The service answers version 0 for a person with nothing stored yet, and
4189
+ // takes `If-Match: "0"` for the first write. Without a version at all, the
4190
+ // write goes unconditioned.
4191
+ function ifMatch(version) {
4192
+ return typeof version === "number" ? {
4193
+ "If-Match": `"${version}"`
4194
+ } : {};
4195
+ }
4196
+ // Applies `change` to the stored value and writes the result, rereading and
4197
+ // retrying when another tab or device wrote in between. `change` returns null
4198
+ // when there's nothing to write. A read-only token (staff impersonating
4199
+ // someone) only reads, so nothing is written into the person's history.
4200
+ // Resolves to the value now stored, with whether the token was read-only, or
4201
+ // null when the service couldn't be reached.
4202
+ async function updateStoredValue(personId, key, change, attemptsLeft = MAX_ATTEMPTS) {
4203
+ const read = await request(personId, key);
4204
+ if (read === null || read === void 0 ? void 0 : read.response.ok) {
4205
+ const {
4206
+ value,
4207
+ version
4208
+ } = await read.response.json();
4209
+ const {
4210
+ readOnly
4211
+ } = read.token;
4212
+ const next = readOnly ? null : change(value);
4213
+ if (next === null) {
4214
+ return {
4215
+ readOnly,
4216
+ value: Array.isArray(value) ? value : []
4217
+ };
4218
+ } else {
4219
+ const write = await request(personId, key, {
4220
+ body: JSON.stringify({
4221
+ value: next
4222
+ }),
4223
+ headers: {
4224
+ "Content-Type": "application/json",
4225
+ ...ifMatch(version)
4226
+ },
4227
+ method: "PUT"
4228
+ });
4229
+ if (write === null || write === void 0 ? void 0 : write.response.ok) {
4230
+ return {
4231
+ readOnly,
4232
+ value: next
4233
+ };
4234
+ } else if ((write === null || write === void 0 ? void 0 : write.response.status) === 409 && attemptsLeft > 1) {
4235
+ return updateStoredValue(personId, key, change, attemptsLeft - 1);
4236
+ } else {
4237
+ return null;
4238
+ }
4239
+ }
4240
+ } else {
4241
+ return null;
4242
+ }
4243
+ }
4244
+
4245
+ // Each product keeps its own copy in localStorage, and user-store-sync joins
4246
+ // the copies up across products and devices wherever the product can mint a
4247
+ // token for it.
4248
+ const SYNC_KEY = "recently_viewed";
3816
4249
  function storageKey({
3817
4250
  env,
3818
4251
  personId
@@ -3831,17 +4264,65 @@ function readRecentlyVisited(scope) {
3831
4264
  return [];
3832
4265
  }
3833
4266
  }
4267
+ function writeRecentlyVisited(scope, entries) {
4268
+ try {
4269
+ localStorage.setItem(storageKey(scope), JSON.stringify(entries));
4270
+ changes.setState({
4271
+ version: changes.getState().version + 1
4272
+ });
4273
+ } catch {
4274
+ // Storage can be full or blocked; recents are disposable.
4275
+ }
4276
+ }
4277
+ async function syncOnce(scope) {
4278
+ try {
4279
+ const synced = await updateStoredValue(scope.personId, SYNC_KEY, stored => {
4280
+ const shared = entriesFrom(stored);
4281
+ const local = readRecentlyVisited(scope);
4282
+ return isSameList(mergeEntries(shared, local), shared) ? null : mergeStored(stored, local);
4283
+ });
4284
+ if (synced) {
4285
+ const shared = entriesFrom(synced.value);
4286
+ writeRecentlyVisited(scope, synced.readOnly ? shared : mergeEntries(shared, readRecentlyVisited(scope)));
4287
+ }
4288
+ } catch {
4289
+ // The service is best-effort; the local copy stands on its own.
4290
+ }
4291
+ }
4292
+ const syncing = new Map();
4293
+ const syncAgain = new Set();
4294
+ // One sync per list at a time. A visit recorded while one runs schedules a
4295
+ // single follow-up, so it still reaches the service; anything else asking
4296
+ // mid-sync just waits for the one running.
4297
+ function sync(scope, followUp) {
4298
+ const key = storageKey(scope);
4299
+ const running = syncing.get(key);
4300
+ if (isUserStoreSyncUnavailable()) {
4301
+ return Promise.resolve();
4302
+ } else if (running) {
4303
+ if (followUp) syncAgain.add(key);
4304
+ return running;
4305
+ } else {
4306
+ const run = syncOnce(scope).then(() => {
4307
+ syncing.delete(key);
4308
+ return syncAgain.delete(key) ? sync(scope, false) : undefined;
4309
+ });
4310
+ syncing.set(key, run);
4311
+ return run;
4312
+ }
4313
+ }
4314
+ function syncRecentlyVisited(scope) {
4315
+ return sync(scope, false);
4316
+ }
4317
+ // Staff impersonating someone get a read-only token, and their visits stay out
4318
+ // of that person's list. Until the token is minted the visit is kept, and the
4319
+ // sync that mints it replaces the local list with the synced one, so recording
4320
+ // never waits on the network.
3834
4321
  function recordVisit(visit, scope) {
3835
4322
  const entry = toEntry(visit, new Date());
3836
- if (isEntry(entry)) {
3837
- try {
3838
- localStorage.setItem(storageKey(scope), JSON.stringify(addVisit(readRecentlyVisited(scope), entry)));
3839
- changes.setState({
3840
- version: changes.getState().version + 1
3841
- });
3842
- } catch {
3843
- // Storage can be full or blocked; recents are disposable.
3844
- }
4323
+ if (isEntry(entry) && !hasReadOnlyToken(scope.personId)) {
4324
+ writeRecentlyVisited(scope, addVisit(readRecentlyVisited(scope), entry));
4325
+ sync(scope, true);
3845
4326
  }
3846
4327
  }
3847
4328
  function useRecentlyVisited({
@@ -3849,6 +4330,14 @@ function useRecentlyVisited({
3849
4330
  personId
3850
4331
  }) {
3851
4332
  const version = shim.useSyncExternalStore(changes.subscribe, () => changes.getState().version);
4333
+ React.useEffect(() => {
4334
+ if (personId) {
4335
+ syncRecentlyVisited({
4336
+ env,
4337
+ personId
4338
+ });
4339
+ }
4340
+ }, [env, personId]);
3852
4341
  // `version` isn't read, but listing it re-reads storage after each visit.
3853
4342
  return React.useMemo(() => personId ? readRecentlyVisited({
3854
4343
  env,
@@ -3996,7 +4485,13 @@ function hasSelectedText(element) {
3996
4485
  return selectedInField || ((_b = (_a = window.getSelection()) === null || _a === void 0 ? void 0 : _a.toString()) !== null && _b !== void 0 ? _b : "") !== "";
3997
4486
  }
3998
4487
 
3999
- const COPIED_FEEDBACK_MS = 1500;
4488
+ // eslint-disable-next-line sort-keys-fix/sort-keys-fix
4489
+ const COPIED_TIMING = {
4490
+ enter: 240,
4491
+ active: 1000,
4492
+ exit: 240
4493
+ };
4494
+ const COPIED_FEEDBACK_MS = COPIED_TIMING.enter + COPIED_TIMING.active + COPIED_TIMING.exit;
4000
4495
  // `copiedUrl` stays set briefly after a copy so the UI can confirm it.
4001
4496
  function useCopyLink() {
4002
4497
  const [copiedUrl, setCopiedUrl] = React.useState(null);
@@ -4017,25 +4512,46 @@ function useCopyLink() {
4017
4512
  };
4018
4513
  }
4019
4514
 
4515
+ function indexOf(highlight, items, list) {
4516
+ const pinnedIndex = items.findIndex(({
4517
+ key
4518
+ }) => key === highlight.key);
4519
+ if (highlight.list !== list) {
4520
+ return 0;
4521
+ } else if (pinnedIndex >= 0) {
4522
+ return pinnedIndex;
4523
+ } else {
4524
+ return highlight.index;
4525
+ }
4526
+ }
4020
4527
  // Remembering which list the index belongs to puts the highlight back on the
4021
4528
  // first item whenever a new list replaces it, without an effect to reset it.
4022
- // A list that grows or fills in under the same `list` keeps its highlight.
4023
- function useResultNavigation(items, list) {
4529
+ // A list that grows, fills in, or reorders under the same `list` keeps its
4530
+ // highlight on the same item, found again by key.
4531
+ // Disabled, nothing is highlighted and the keys and pointer leave it alone.
4532
+ function useResultNavigation(items, list, enabled = true) {
4024
4533
  const [highlight, setHighlight] = React.useState({
4025
4534
  index: 0,
4026
4535
  list
4027
4536
  });
4028
- const highlightedIndex = highlight.list === list ? highlight.index : 0;
4029
- const highlighted = items[highlightedIndex];
4537
+ const highlightedIndex = indexOf(highlight, items, list);
4538
+ const highlighted = enabled ? items[highlightedIndex] : undefined;
4030
4539
  const {
4031
4540
  copiedUrl,
4032
4541
  copy
4033
4542
  } = useCopyLink();
4034
- const highlightIndex = React.useCallback(index => setHighlight(current => current.list === list && current.index === index ? current : {
4035
- index,
4036
- list
4037
- }), [list]);
4543
+ const highlightIndex = React.useCallback(index => {
4544
+ var _a;
4545
+ if (!enabled) return;
4546
+ const key = (_a = items[index]) === null || _a === void 0 ? void 0 : _a.key;
4547
+ setHighlight(current => current.list === list && current.index === index && current.key === key ? current : {
4548
+ index,
4549
+ key,
4550
+ list
4551
+ });
4552
+ }, [enabled, items, list]);
4038
4553
  const handleKeyDown = event => {
4554
+ if (!enabled) return;
4039
4555
  const step = verticalStep(event.key);
4040
4556
  if (step && items.length > 0) {
4041
4557
  event.preventDefault();
@@ -4059,41 +4575,89 @@ function useResultNavigation(items, list) {
4059
4575
  };
4060
4576
  }
4061
4577
 
4062
- function groupSections(groups = []) {
4578
+ var styles$k = {"modal":"modal-NR3TO","visuallyHidden":"visuallyHidden-C28ju","panel":"panel-HlF7S"};
4579
+
4580
+ const FALLBACK_SLUGS = ["people", "services"];
4581
+ function defaultProduct(products, appName) {
4582
+ var _a;
4583
+ const current = products.find(product => product.appName === appName);
4584
+ const fallback = FALLBACK_SLUGS.map(slug => products.find(product => product.slug === slug)).find(Boolean);
4585
+ return (_a = current !== null && current !== void 0 ? current : fallback) !== null && _a !== void 0 ? _a : products[0];
4586
+ }
4587
+
4588
+ function groupSections(groups = [], timeZone) {
4063
4589
  return groups.map(({
4064
4590
  results,
4065
4591
  type
4066
4592
  }) => ({
4067
4593
  heading: type,
4068
- items: results.map(resultItem),
4594
+ items: results.map(result => resultItem(result, timeZone)),
4069
4595
  key: type
4070
4596
  }));
4071
4597
  }
4072
4598
  function resultItem({
4073
4599
  attributes,
4074
4600
  id
4075
- }) {
4601
+ }, timeZone) {
4076
4602
  return {
4603
+ category: attributes.category,
4604
+ imageUrl: attributes.image_url,
4077
4605
  key: id,
4078
- subtitle: summarize(attributes.metadata),
4606
+ product: attributes.product,
4607
+ subtitle: summarize(attributes, timeZone),
4079
4608
  title: attributes.title,
4080
4609
  url: attributes.url
4081
4610
  };
4082
4611
  }
4083
- function visitItem(visit) {
4612
+ function visitItem(visit, timeZone) {
4084
4613
  return {
4085
4614
  key: entryKey(visit.entry),
4086
- ...describeVisit(visit)
4615
+ ...describeVisit(visit, timeZone)
4616
+ };
4617
+ }
4618
+ const joinParts = (...parts) => parts.filter(Boolean).join(" · ");
4619
+ // Matches home-mobile's search subtitles, so a result reads the same in both.
4620
+ function summarize({
4621
+ category,
4622
+ metadata
4623
+ }, timeZone) {
4624
+ const text = key => {
4625
+ const value = metadata === null || metadata === void 0 ? void 0 : metadata[key];
4626
+ return typeof value === "string" ? value : "";
4087
4627
  };
4628
+ if (category === "profile") {
4629
+ return joinParts(text("phone"), text("email"));
4630
+ } else if (category === "event") {
4631
+ return eventTime(text("starts_at"), text("ends_at"), {
4632
+ recurring: (metadata === null || metadata === void 0 ? void 0 : metadata.recurring) === true,
4633
+ timeZone
4634
+ });
4635
+ } else {
4636
+ return text("details");
4637
+ }
4088
4638
  }
4089
- function summarize(metadata) {
4090
- return Object.values(metadata !== null && metadata !== void 0 ? metadata : {}).filter(value => typeof value === "string" && value !== "").join(" · ");
4639
+ // "Oct 25, 9–10:30am", in the organization's time zone like the rest
4640
+ // of Planning Center.
4641
+ function eventTime(startsAt, endsAt, {
4642
+ recurring,
4643
+ timeZone
4644
+ }) {
4645
+ if (startsAt === "") {
4646
+ return "";
4647
+ } else {
4648
+ const time = datetimeFmt.datetime(startsAt, endsAt || null, {
4649
+ style: "abbreviated",
4650
+ ...(timeZone && {
4651
+ timeZone
4652
+ })
4653
+ });
4654
+ return recurring ? joinParts(time, "Repeating") : time;
4655
+ }
4091
4656
  }
4092
4657
  // Unlike search results, recents come from every product, so each one names
4093
- // its product and type.
4094
- function describeVisit(visit) {
4658
+ // its type. The row's product icon says which product it came from.
4659
+ function describeVisit(visit, timeZone) {
4095
4660
  var _a, _b;
4096
- const subtitle = (...parts) => parts.filter(Boolean).join(" · ");
4097
4661
  if (visit.status === "page") {
4098
4662
  const {
4099
4663
  app,
@@ -4101,65 +4665,313 @@ function describeVisit(visit) {
4101
4665
  title
4102
4666
  } = visit.entry;
4103
4667
  return {
4104
- subtitle: subtitle(productName(app), (_a = metadata === null || metadata === void 0 ? void 0 : metadata.type) !== null && _a !== void 0 ? _a : "", (_b = metadata === null || metadata === void 0 ? void 0 : metadata.details) !== null && _b !== void 0 ? _b : ""),
4668
+ category: "generic",
4669
+ imageUrl: null,
4670
+ product: app,
4671
+ subtitle: joinParts(capitalize((_a = metadata === null || metadata === void 0 ? void 0 : metadata.type) !== null && _a !== void 0 ? _a : ""), (_b = metadata === null || metadata === void 0 ? void 0 : metadata.details) !== null && _b !== void 0 ? _b : ""),
4105
4672
  title,
4106
4673
  url: visit.url
4107
4674
  };
4108
4675
  } else {
4109
4676
  const {
4110
- metadata,
4677
+ attributes
4678
+ } = visit.result;
4679
+ const {
4680
+ category,
4681
+ image_url,
4111
4682
  product,
4112
4683
  title,
4113
4684
  type
4114
- } = visit.result.attributes;
4685
+ } = attributes;
4686
+ // Profiles and events say what they are with a phone number or a date.
4687
+ const kind = category === "generic" ? capitalize(pluralize.singular(type)) : "";
4115
4688
  return {
4116
- subtitle: subtitle(productName(product), type, summarize(metadata)),
4689
+ category,
4690
+ imageUrl: image_url,
4691
+ product,
4692
+ subtitle: joinParts(kind, summarize(attributes, timeZone)),
4117
4693
  title,
4118
4694
  url: visit.url
4119
4695
  };
4120
4696
  }
4121
4697
  }
4122
- // check-ins → Check-Ins
4123
- function productName(slug) {
4124
- return slug.split("-").map(capitalize).join("-");
4125
- }
4126
4698
  function capitalize(word) {
4127
4699
  return word.charAt(0).toUpperCase() + word.slice(1);
4128
4700
  }
4129
4701
 
4130
- const STORAGE_KEY = "topbar.product_search.last_product";
4131
- function readLastProduct() {
4132
- try {
4133
- return localStorage.getItem(STORAGE_KEY);
4134
- } catch {
4135
- return null;
4136
- }
4137
- }
4138
- function saveLastProduct(slug) {
4139
- try {
4140
- localStorage.setItem(STORAGE_KEY, slug);
4141
- } catch {
4142
- // Storage can be full or blocked; search still works without it.
4702
+ var styles$j = {"container":"container-YDdM1","hint":"hint-017Rd","keycap":"keycap-ENJM2","labels":"labels-GHPqL","copied":"copied-DUFa1"};
4703
+
4704
+ const SYMBOLS = {
4705
+ command: {
4706
+ label: "⌘",
4707
+ paths: ["M7 9a2 2 0 1 1 2 -2v10a2 2 0 1 1 -2 -2h10a2 2 0 1 1 -2 2v-10a2 2 0 1 1 2 2h-10"]
4708
+ },
4709
+ down: {
4710
+ label: "↓",
4711
+ paths: ["M12 6l0 12", "M16 14l-4 4", "M8 14l4 4"]
4712
+ },
4713
+ return: {
4714
+ label: "↵",
4715
+ paths: ["M18 6v6a3 3 0 0 1 -3 3h-10l4 -4m0 8l-4 -4"]
4716
+ },
4717
+ up: {
4718
+ label: "↑",
4719
+ paths: ["M12 6l0 12", "M16 10l-4 -4", "M8 10l4 -4"]
4143
4720
  }
4721
+ };
4722
+ function Keycap(props) {
4723
+ return /*#__PURE__*/React.createElement("kbd", {
4724
+ className: styles$j.keycap
4725
+ }, "symbol" in props ? (/*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("svg", {
4726
+ "aria-hidden": true,
4727
+ fill: "none",
4728
+ stroke: "currentColor",
4729
+ strokeLinecap: "round",
4730
+ strokeLinejoin: "round",
4731
+ viewBox: "0 0 24 24"
4732
+ }, SYMBOLS[props.symbol].paths.map(d => (/*#__PURE__*/React.createElement("path", {
4733
+ d: d,
4734
+ key: d
4735
+ })))), /*#__PURE__*/React.createElement("span", {
4736
+ className: styles$k.visuallyHidden
4737
+ }, SYMBOLS[props.symbol].label))) : props.label);
4738
+ }
4739
+ function CommandKey() {
4740
+ return isMac() ? /*#__PURE__*/React.createElement(Keycap, {
4741
+ symbol: "command"
4742
+ }) : /*#__PURE__*/React.createElement(Keycap, {
4743
+ label: "Ctrl"
4744
+ });
4144
4745
  }
4145
- function initialProduct(products) {
4146
- var _a, _b, _c;
4147
- const lastProduct = readLastProduct();
4148
- const bySlug = slug => products.find(product => product.slug === slug);
4149
- return (_c = (_b = (_a = bySlug(lastProduct)) !== null && _a !== void 0 ? _a : bySlug("people")) !== null && _b !== void 0 ? _b : bySlug("services")) !== null && _c !== void 0 ? _c : products[0];
4746
+ function EnterKey() {
4747
+ return isMac() ? /*#__PURE__*/React.createElement(Keycap, {
4748
+ symbol: "return"
4749
+ }) : /*#__PURE__*/React.createElement(Keycap, {
4750
+ label: "Enter"
4751
+ });
4150
4752
  }
4151
-
4753
+ const {
4754
+ copyLink,
4755
+ openInNewTab,
4756
+ openSearch,
4757
+ select
4758
+ } = KEYBOARD_SHORTCUTS;
4152
4759
  function KeyboardHints({
4153
4760
  copied
4154
4761
  }) {
4155
- const command = commandKeyLabel();
4156
- return /*#__PURE__*/React.createElement("p", null, "\u2191\u2193 Select \u00B7 \u21B5 Open \u00B7 ", command, "\u21B5 Open in new tab \u00B7 ", command, "C", " ", /*#__PURE__*/React.createElement("span", {
4762
+ return /*#__PURE__*/React.createElement("ul", {
4763
+ "aria-label": "Keyboard shortcuts",
4764
+ className: styles$j.container,
4765
+ "data-platform": isMac() ? "mac" : "pc"
4766
+ }, /*#__PURE__*/React.createElement("li", {
4767
+ className: styles$j.hint
4768
+ }, /*#__PURE__*/React.createElement(tapestry.Flex, {
4769
+ gap: 0.5
4770
+ }, select.modifierKey, /*#__PURE__*/React.createElement(Keycap, {
4771
+ symbol: "up"
4772
+ }), /*#__PURE__*/React.createElement(Keycap, {
4773
+ symbol: "down"
4774
+ })), select.label), /*#__PURE__*/React.createElement("li", {
4775
+ className: styles$j.hint
4776
+ }, /*#__PURE__*/React.createElement(tapestry.Flex, {
4777
+ gap: 0.5
4778
+ }, /*#__PURE__*/React.createElement(CommandKey, null), /*#__PURE__*/React.createElement(EnterKey, null)), openInNewTab.label), /*#__PURE__*/React.createElement("li", {
4779
+ className: classnames(styles$j.hint, copied && styles$j.copied),
4780
+ style: {
4781
+ "--copied-active": `${COPIED_TIMING.active}ms`,
4782
+ "--copied-enter": `${COPIED_TIMING.enter}ms`,
4783
+ "--copied-exit": `${COPIED_TIMING.exit}ms`
4784
+ }
4785
+ }, /*#__PURE__*/React.createElement(tapestry.Flex, {
4786
+ gap: 0.5
4787
+ }, /*#__PURE__*/React.createElement(CommandKey, null), /*#__PURE__*/React.createElement(Keycap, {
4788
+ label: copyLink.key.toUpperCase()
4789
+ })), /*#__PURE__*/React.createElement("span", {
4790
+ className: styles$j.labels
4791
+ }, /*#__PURE__*/React.createElement("span", {
4792
+ "aria-hidden": copied
4793
+ }, copyLink.label), /*#__PURE__*/React.createElement("span", {
4157
4794
  role: "status"
4158
- }, copied ? "Copied!" : "Copy link"), " \u00B7 ", command, "K Open search");
4795
+ }, copied && "Copied!"))), /*#__PURE__*/React.createElement("li", {
4796
+ className: styles$j.hint
4797
+ }, /*#__PURE__*/React.createElement(tapestry.Flex, {
4798
+ gap: 0.5
4799
+ }, /*#__PURE__*/React.createElement(CommandKey, null), /*#__PURE__*/React.createElement(Keycap, {
4800
+ label: openSearch.key.toUpperCase()
4801
+ })), openSearch.label));
4159
4802
  }
4160
4803
 
4161
- var styles$d = {"tab":"tab-dz8ki"};
4804
+ var styles$i = {"icon":"icon-XKLvN","squircle":"squircle-JCHr6"};
4162
4805
 
4806
+ const PRODUCTS = {
4807
+ accounts: {
4808
+ gradient: "--t-fill-color-product-accounts-gradient-brand",
4809
+ path: logomarks__namespace.accounts
4810
+ },
4811
+ api: {
4812
+ gradient: "--t-fill-color-product-api-gradient-brand",
4813
+ path: logomarks__namespace.api
4814
+ },
4815
+ calendar: {
4816
+ gradient: "--t-fill-color-product-calendar-gradient-brand",
4817
+ path: logomarks__namespace.calendar
4818
+ },
4819
+ "check-ins": {
4820
+ gradient: "--t-fill-color-product-checkins-gradient-brand",
4821
+ path: logomarks__namespace.checkIns
4822
+ },
4823
+ "church-center": {
4824
+ gradient: "--t-fill-color-product-cc-gradient-brand",
4825
+ path: logomarks__namespace.churchCenter
4826
+ },
4827
+ giving: {
4828
+ gradient: "--t-fill-color-product-giving-gradient-brand",
4829
+ path: logomarks__namespace.giving
4830
+ },
4831
+ groups: {
4832
+ gradient: "--t-fill-color-product-groups-gradient-brand",
4833
+ path: logomarks__namespace.groups
4834
+ },
4835
+ home: {
4836
+ gradient: "--t-fill-color-product-home-gradient-brand",
4837
+ path: logomarks__namespace.home
4838
+ },
4839
+ "music-stand": {
4840
+ gradient: "--t-fill-color-product-musicstand-gradient-brand",
4841
+ path: logomarks__namespace.musicStand
4842
+ },
4843
+ people: {
4844
+ gradient: "--t-fill-color-product-people-gradient-brand",
4845
+ path: logomarks__namespace.people
4846
+ },
4847
+ publishing: {
4848
+ gradient: "--t-fill-color-product-publishing-gradient-brand",
4849
+ path: logomarks__namespace.publishing
4850
+ },
4851
+ registrations: {
4852
+ gradient: "--t-fill-color-product-registrations-gradient-brand",
4853
+ path: logomarks__namespace.registrations
4854
+ },
4855
+ services: {
4856
+ gradient: "--t-fill-color-product-services-gradient-brand",
4857
+ path: logomarks__namespace.services
4858
+ }
4859
+ };
4860
+ const isProductIconSlug = slug => Object.prototype.hasOwnProperty.call(PRODUCTS, slug);
4861
+ const maskFor = path => `url("data:image/svg+xml,${encodeURIComponent(`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path d="${path}"/></svg>`)}")`;
4862
+ function ProductIcon({
4863
+ size = 16,
4864
+ slug
4865
+ }) {
4866
+ const {
4867
+ gradient,
4868
+ path
4869
+ } = PRODUCTS[slug];
4870
+ const mask = maskFor(path);
4871
+ return /*#__PURE__*/React.createElement("span", {
4872
+ "aria-hidden": true,
4873
+ className: styles$i.icon,
4874
+ style: {
4875
+ height: size,
4876
+ width: size
4877
+ }
4878
+ }, /*#__PURE__*/React.createElement("span", {
4879
+ className: styles$i.squircle,
4880
+ style: {
4881
+ WebkitMaskImage: mask,
4882
+ background: `var(${gradient})`,
4883
+ maskImage: mask
4884
+ }
4885
+ }));
4886
+ }
4887
+
4888
+ var styles$h = {"picker":"picker-iuzzj","option":"option--7LXg"};
4889
+
4890
+ // Phones have no room for a tab per product, so they pick from a dropdown.
4891
+ // Complex mode renders each option's logomark, in the list and the trigger.
4892
+ function ProductSelect({
4893
+ children,
4894
+ onSelect,
4895
+ products,
4896
+ selected
4897
+ }) {
4898
+ const options = products.map(({
4899
+ appName,
4900
+ slug
4901
+ }) => ({
4902
+ label: (/*#__PURE__*/React.createElement("span", {
4903
+ className: styles$h.option
4904
+ }, /*#__PURE__*/React.createElement(ProductIcon, {
4905
+ slug: slug
4906
+ }), appName)),
4907
+ textValue: appName,
4908
+ value: slug
4909
+ }));
4910
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
4911
+ className: styles$h.picker
4912
+ }, /*#__PURE__*/React.createElement(tapestry.Select, {
4913
+ "aria-label": "Product",
4914
+ complex: true,
4915
+ onChange: event => onSelect(event.target.value),
4916
+ options: options,
4917
+ value: selected.slug
4918
+ })), /*#__PURE__*/React.createElement("div", {
4919
+ className: styles$k.panel
4920
+ }, children));
4921
+ }
4922
+
4923
+ // Browsers match :focus-visible on every focused text field, keyboard or not,
4924
+ // since typing follows either way. So this remembers what last moved focus,
4925
+ // shared by every field and listened for once, in the capture phase so it's
4926
+ // known before focus moves.
4927
+ let lastInteraction = "pointer";
4928
+ let listening = false;
4929
+ function listen() {
4930
+ if (listening) return;
4931
+ listening = true;
4932
+ document.addEventListener("keydown", event => {
4933
+ // Shortcuts like ⌘C don't move focus.
4934
+ if (!event.metaKey && !event.ctrlKey && !event.altKey) {
4935
+ lastInteraction = "keyboard";
4936
+ }
4937
+ }, true);
4938
+ document.addEventListener("pointerdown", () => {
4939
+ lastInteraction = "pointer";
4940
+ }, true);
4941
+ }
4942
+ /**
4943
+ * Whether a field was focused from the keyboard, as by Tab, rather than by a
4944
+ * click or tap. Spread `focusProps` onto the field, and style it by
4945
+ * `data-focus-visible`.
4946
+ */
4947
+ function useKeyboardFocus({
4948
+ onBlur,
4949
+ onFocus
4950
+ } = {}) {
4951
+ const [focusVisible, setFocusVisible] = React.useState(false);
4952
+ React.useEffect(listen, []);
4953
+ return {
4954
+ focusProps: {
4955
+ "data-focus-visible": focusVisible || undefined,
4956
+ onBlur: event => {
4957
+ setFocusVisible(false);
4958
+ onBlur === null || onBlur === void 0 ? void 0 : onBlur(event);
4959
+ },
4960
+ onFocus: event => {
4961
+ const keyboard = lastInteraction === "keyboard";
4962
+ setFocusVisible(keyboard);
4963
+ onFocus === null || onFocus === void 0 ? void 0 : onFocus(event, keyboard);
4964
+ }
4965
+ },
4966
+ focusVisible
4967
+ };
4968
+ }
4969
+
4970
+ var styles$g = {"tablist":"tablist-7ASvc","tab":"tab-dz8ki"};
4971
+
4972
+ // With this many tabs or more, only the selected tab shows its name, so they
4973
+ // all fit. Fewer always fit with their names.
4974
+ const ICON_ONLY_TAB_COUNT = 5;
4163
4975
  function ProductTabs({
4164
4976
  children,
4165
4977
  onKeyDown,
@@ -4170,6 +4982,7 @@ function ProductTabs({
4170
4982
  const id = useInstanceId("product-tabs");
4171
4983
  const tabId = slug => `${id}-tab-${slug}`;
4172
4984
  const tabRefs = React.useRef(new Map());
4985
+ const showAllNames = products.length < ICON_ONLY_TAB_COUNT;
4173
4986
  const handleKeyDown = event => {
4174
4987
  var _a;
4175
4988
  const offset = horizontalStep(event.key);
@@ -4184,13 +4997,13 @@ function ProductTabs({
4184
4997
  }
4185
4998
  };
4186
4999
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
4187
- "aria-label": "Product",
5000
+ "aria-label": "Search in",
5001
+ className: styles$g.tablist,
4188
5002
  onKeyDown: handleKeyDown,
4189
5003
  role: "tablist"
4190
- }, products.map(product => (/*#__PURE__*/React.createElement("button", {
5004
+ }, products.map(product => (/*#__PURE__*/React.createElement(Tab, {
4191
5005
  "aria-controls": `${id}-panel`,
4192
5006
  "aria-selected": product === selected,
4193
- className: styles$d.tab,
4194
5007
  id: tabId(product.slug),
4195
5008
  key: product.slug,
4196
5009
  onClick: () => onSelect(product.slug),
@@ -4201,15 +5014,392 @@ function ProductTabs({
4201
5014
  tabRefs.current.delete(product.slug);
4202
5015
  }
4203
5016
  },
4204
- role: "tab",
4205
- tabIndex: product === selected ? 0 : -1,
4206
- type: "button"
4207
- }, product.appName)))), /*#__PURE__*/React.createElement("div", {
5017
+ tabIndex: product === selected ? 0 : -1
5018
+ }, /*#__PURE__*/React.createElement(ProductIcon, {
5019
+ slug: product.slug
5020
+ }), showAllNames || product === selected ? product.appName : (/*#__PURE__*/React.createElement("span", {
5021
+ className: styles$k.visuallyHidden
5022
+ }, product.appName)))))), /*#__PURE__*/React.createElement("div", {
4208
5023
  "aria-labelledby": tabId(selected.slug),
5024
+ className: styles$k.panel,
4209
5025
  id: `${id}-panel`,
4210
5026
  role: "tabpanel"
4211
5027
  }, children));
4212
5028
  }
5029
+ // The modal's focus scope moves focus here by script when Tab is pressed, and
5030
+ // Safari doesn't match :focus-visible on focus moved by script. So the tab
5031
+ // remembers whether the keyboard brought focus, and the ring keys off that.
5032
+ const Tab = /*#__PURE__*/React.forwardRef(function Tab(props, ref) {
5033
+ const {
5034
+ focusProps
5035
+ } = useKeyboardFocus();
5036
+ return /*#__PURE__*/React.createElement("button", {
5037
+ className: styles$g.tab,
5038
+ ref: ref,
5039
+ role: "tab",
5040
+ type: "button",
5041
+ ...props,
5042
+ ...focusProps
5043
+ });
5044
+ });
5045
+
5046
+ function BlankStateRecentlyVisited(props) {
5047
+ const id = useInstanceId("blank-state-initial");
5048
+ return /*#__PURE__*/React.createElement("svg", {
5049
+ viewBox: "0 0 197 174",
5050
+ fill: "none",
5051
+ "aria-hidden": "true",
5052
+ focusable: "false",
5053
+ ...props
5054
+ }, /*#__PURE__*/React.createElement("path", {
5055
+ d: "M139.863 32.119c10.938 10.028 21.777 20.154 32.912 30.084 8.376 7.373 21.975 15.828 23.157 28.02.592 6.095-2.167 11.993-5.321 17.204-24.635 40.8-81.098 67.148-127.412 48.862-30.646-12.093-76.172-47.387-59.716-85.041 15.865-36.377 64.84-55.056 83.957-57.71 21.876-4.621 34.883 2.457 52.423 18.58Z",
5056
+ fill: "currentColor"
5057
+ }), /*#__PURE__*/React.createElement("g", {
5058
+ clipPath: `url(#${id}-a)`
5059
+ }, /*#__PURE__*/React.createElement("path", {
5060
+ d: "M115.885 109.31c-.478-.686-.01-1.845 1.046-2.589s2.3-.791 2.778-.105c.478.686.009 1.845-1.047 2.589-1.056.744-2.299.791-2.777.105Z",
5061
+ fill: "#333"
5062
+ }), /*#__PURE__*/React.createElement("path", {
5063
+ d: "M123.403 113.599c-3.456 0-6.259-2.817-6.259-6.293 0-3.475 2.803-6.293 6.259-6.293 3.457 0 6.259 2.818 6.259 6.293 0 3.476-2.802 6.293-6.259 6.293Z",
5064
+ fill: "#333"
5065
+ }), /*#__PURE__*/React.createElement("path", {
5066
+ d: "M118.853 100.968a2.85 2.85 0 0 0 2.832-2.484 2.89 2.89 0 0 0-.071-1.115c-2.638-9.955-9.668-9.687-9.964-9.665l.311 5.716h-.104c.119 0 2.853.134 4.254 5.421a2.874 2.874 0 0 0 1.013 1.53 2.846 2.846 0 0 0 1.729.597Z",
5067
+ fill: "#4D4D4D"
5068
+ }), /*#__PURE__*/React.createElement("path", {
5069
+ d: "M114.96 100.503c-.462-5.894 2.796-10.96 7.279-11.315 4.482-.356 8.491 4.134 8.953 10.027.462 5.894-2.796 10.96-7.279 11.315-4.482.356-8.491-4.134-8.953-10.027Z",
5070
+ fill: "#F2F2F2"
5071
+ }), /*#__PURE__*/React.createElement("path", {
5072
+ d: "M125.964 107.738c-4.48.354-8.489-4.135-8.953-10.026a12.893 12.893 0 0 1 1.223-6.707c-2.249 2.046-3.591 5.59-3.283 9.505.463 5.895 4.469 10.384 8.953 10.027 2.594-.205 4.765-1.986 6.055-4.591a6.682 6.682 0 0 1-3.995 1.792Z",
5073
+ fill: "#E6E6E6"
5074
+ }), /*#__PURE__*/React.createElement("path", {
5075
+ d: "M115.885 109.31c-.478-.686-.01-1.845 1.046-2.589s2.3-.791 2.778-.105c.478.686.009 1.845-1.047 2.589-1.056.744-2.299.791-2.777.105Z",
5076
+ fill: "#333"
5077
+ }), /*#__PURE__*/React.createElement("path", {
5078
+ d: "M123.403 113.599c-3.456 0-6.259-2.817-6.259-6.293 0-3.475 2.803-6.293 6.259-6.293 3.457 0 6.259 2.818 6.259 6.293 0 3.476-2.802 6.293-6.259 6.293Z",
5079
+ fill: "#333"
5080
+ }), /*#__PURE__*/React.createElement("path", {
5081
+ d: "M118.853 100.968a2.85 2.85 0 0 0 2.832-2.484 2.89 2.89 0 0 0-.071-1.115c-2.638-9.955-9.668-9.687-9.964-9.665l.311 5.716h-.104c.119 0 2.853.134 4.254 5.421a2.874 2.874 0 0 0 1.013 1.53 2.846 2.846 0 0 0 1.729.597Z",
5082
+ fill: "#4D4D4D"
5083
+ }), /*#__PURE__*/React.createElement("path", {
5084
+ d: "M114.96 100.503c-.462-5.894 2.796-10.96 7.279-11.315 4.482-.356 8.491 4.134 8.953 10.027.462 5.894-2.796 10.96-7.279 11.315-4.482.356-8.491-4.134-8.953-10.027Z",
5085
+ fill: "#F2F2F2"
5086
+ }), /*#__PURE__*/React.createElement("path", {
5087
+ d: "M125.964 107.738c-4.48.354-8.489-4.135-8.953-10.026a12.893 12.893 0 0 1 1.223-6.707c-2.249 2.046-3.591 5.59-3.283 9.505.463 5.895 4.469 10.384 8.953 10.027 2.594-.205 4.765-1.986 6.055-4.591a6.682 6.682 0 0 1-3.995 1.792Z",
5088
+ fill: "#E6E6E6"
5089
+ }), /*#__PURE__*/React.createElement("path", {
5090
+ d: "M89.317 121.331a2.836 2.836 0 0 1-1.92-.752 2.869 2.869 0 0 1-.911-1.857c-.534-5.726 3.527-13.808 3.99-14.713a2.849 2.849 0 0 1 1.666-1.413 2.835 2.835 0 0 1 2.172.185 2.86 2.86 0 0 1 1.405 1.675 2.876 2.876 0 0 1-.184 2.183c-1.46 2.843-3.669 8.492-3.383 11.551a2.868 2.868 0 0 1-1.504 2.797 2.84 2.84 0 0 1-1.064.318 1.378 1.378 0 0 1-.267.026Z",
5091
+ fill: "#4D4D4D"
5092
+ }), /*#__PURE__*/React.createElement("path", {
5093
+ d: "M92.155 112.314c3.308 0 5.989-2.696 5.989-6.021 0-3.326-2.681-6.021-5.989-6.021-3.307 0-5.988 2.695-5.988 6.021 0 3.325 2.681 6.021 5.988 6.021Z",
5094
+ fill: "gray"
5095
+ }), /*#__PURE__*/React.createElement("path", {
5096
+ d: "M80.597 128.771h11.769v3.726a1.118 1.118 0 0 1-1.112 1.118H78.57a1.118 1.118 0 0 1-1.112-1.118v-.566c0-.841.332-1.648.924-2.242a3.144 3.144 0 0 1 2.23-.929l-.015.011Z",
5097
+ fill: "#333"
5098
+ }), /*#__PURE__*/React.createElement("path", {
5099
+ d: "M89.572 132.084s8.075.119 6.3-8.268c-1.775-8.387-12.188-15.351-15.234-6.066-3.046 9.285-1.386 15.232 8.934 14.334Z",
5100
+ fill: "#F2F2F2"
5101
+ }), /*#__PURE__*/React.createElement("path", {
5102
+ d: "M106.67 121.334h-.27a2.84 2.84 0 0 1-1.925-1.025 2.872 2.872 0 0 1-.639-2.093c.285-3.059-1.92-8.708-3.38-11.551a2.873 2.873 0 0 1 1.296-3.721 2.832 2.832 0 0 1 2.102-.199 2.848 2.848 0 0 1 1.66 1.312c.463.906 4.521 8.991 3.988 14.714a2.874 2.874 0 0 1-.926 1.828 2.832 2.832 0 0 1-1.906.735Z",
5103
+ fill: "#4D4D4D"
5104
+ }), /*#__PURE__*/React.createElement("path", {
5105
+ d: "M103.835 112.314c3.307 0 5.988-2.696 5.988-6.021 0-3.326-2.681-6.021-5.988-6.021-3.307 0-5.988 2.695-5.988 6.021 0 3.325 2.681 6.021 5.988 6.021Z",
5106
+ fill: "gray"
5107
+ }), /*#__PURE__*/React.createElement("path", {
5108
+ d: "m117.408 133.652-12.674-.002c-.295 0-.577-.118-.786-.328a1.121 1.121 0 0 1-.325-.79v-3.726l11.773.002c.837 0 1.639.334 2.23.929s.923 1.401.923 2.242v.567a1.116 1.116 0 0 1-1.141 1.106Z",
5109
+ fill: "#333"
5110
+ }), /*#__PURE__*/React.createElement("path", {
5111
+ d: "M106.414 132.084s-8.075.119-6.318-8.268c1.756-8.387 12.195-15.343 15.237-6.062 3.043 9.281 1.405 15.235-8.919 14.33Z",
5112
+ fill: "#F2F2F2"
5113
+ }), /*#__PURE__*/React.createElement("path", {
5114
+ d: "M109.107 94.58a2.305 2.305 0 0 0 2.191 2.412 2.302 2.302 0 0 0 2.399-2.202l.333-7.33a2.306 2.306 0 0 0-2.191-2.412 2.303 2.303 0 0 0-2.4 2.203l-.332 7.328Z",
5115
+ fill: "gray"
5116
+ }), /*#__PURE__*/React.createElement("path", {
5117
+ d: "M80.968 109.31c.478-.686.01-1.845-1.047-2.589-1.056-.744-2.3-.791-2.777-.105-.478.686-.01 1.845 1.046 2.589s2.3.791 2.778.105Z",
5118
+ fill: "#333"
5119
+ }), /*#__PURE__*/React.createElement("path", {
5120
+ d: "M73.448 113.599c3.457 0 6.26-2.817 6.26-6.293 0-3.475-2.803-6.293-6.26-6.293-3.456 0-6.258 2.818-6.258 6.293 0 3.476 2.802 6.293 6.258 6.293Z",
5121
+ fill: "#333"
5122
+ }), /*#__PURE__*/React.createElement("path", {
5123
+ d: "M78 100.968a2.853 2.853 0 0 1-2.832-2.484 2.876 2.876 0 0 1 .07-1.115c2.639-9.955 9.669-9.687 9.965-9.665l-.311 5.716h.104c-.12 0-2.854.134-4.255 5.421a2.87 2.87 0 0 1-1.013 1.53 2.845 2.845 0 0 1-1.729.597Z",
5124
+ fill: "#4D4D4D"
5125
+ }), /*#__PURE__*/React.createElement("path", {
5126
+ d: "M87.37 88.17a2.305 2.305 0 0 0-2.19-2.413 2.302 2.302 0 0 0-2.4 2.202l-.332 7.329a2.305 2.305 0 0 0 2.19 2.413 2.302 2.302 0 0 0 2.4-2.203l.332-7.328Z",
5127
+ fill: "gray"
5128
+ }), /*#__PURE__*/React.createElement("path", {
5129
+ d: "M81.893 100.503c.462-5.894-2.797-10.96-7.28-11.315-4.482-.356-8.49 4.134-8.953 10.027-.462 5.894 2.797 10.96 7.28 11.315 4.482.356 8.49-4.134 8.953-10.027Z",
5130
+ fill: "#F2F2F2"
5131
+ }), /*#__PURE__*/React.createElement("path", {
5132
+ d: "M70.888 107.738c4.48.354 8.49-4.135 8.953-10.026a12.89 12.89 0 0 0-1.223-6.707c2.25 2.046 3.591 5.59 3.284 9.505-.464 5.895-4.47 10.384-8.953 10.027-2.594-.205-4.766-1.986-6.055-4.591a6.682 6.682 0 0 0 3.994 1.792Z",
5133
+ fill: "#E6E6E6"
5134
+ }), /*#__PURE__*/React.createElement("path", {
5135
+ d: "M112.717 94.105c-.511-9.095-7.459-11.703-15.82-11.226-8.36.477-14.97 3.856-14.451 12.951.518 9.095 7.707 16.081 16.067 15.605 8.36-.477 14.719-8.231 14.204-17.33Z",
5136
+ fill: "#F2F2F2"
5137
+ }), /*#__PURE__*/React.createElement("path", {
5138
+ d: "M112.565 92.656c-1.056 7.496-6.799 13.413-14.059 13.812-7.852.451-14.67-5.686-15.897-13.965a14.571 14.571 0 0 0-.17 3.327c.51 9.095 7.704 16.081 16.067 15.605 8.364-.477 14.723-8.235 14.211-17.33a16.83 16.83 0 0 0-.152-1.45Z",
5139
+ fill: "#E6E6E6"
5140
+ }), /*#__PURE__*/React.createElement("path", {
5141
+ d: "M103.546 90.353H91.61a.62.62 0 0 0-.619.623v1.762a.62.62 0 0 0 .62.622h11.935a.62.62 0 0 0 .619-.622v-1.762a.62.62 0 0 0-.619-.623Zm0 5.187H91.61a.62.62 0 0 0-.619.622v1.762a.62.62 0 0 0 .62.623h11.935a.62.62 0 0 0 .619-.623v-1.762a.62.62 0 0 0-.619-.622Zm-.004 5.19H91.606a.62.62 0 0 0-.619.622v1.763a.62.62 0 0 0 .62.622h11.935a.62.62 0 0 0 .619-.622v-1.763a.62.62 0 0 0-.619-.622Z",
5142
+ fill: "#3690EA"
5143
+ }), /*#__PURE__*/React.createElement("path", {
5144
+ d: "M89.317 121.331a2.836 2.836 0 0 1-1.92-.752 2.869 2.869 0 0 1-.911-1.857c-.534-5.726 3.527-13.808 3.99-14.713a2.849 2.849 0 0 1 1.666-1.413 2.835 2.835 0 0 1 2.172.185 2.86 2.86 0 0 1 1.405 1.675 2.876 2.876 0 0 1-.184 2.183c-1.46 2.843-3.669 8.492-3.383 11.551a2.868 2.868 0 0 1-1.504 2.797 2.84 2.84 0 0 1-1.064.318 1.378 1.378 0 0 1-.267.026Z",
5145
+ fill: "#4D4D4D"
5146
+ }), /*#__PURE__*/React.createElement("path", {
5147
+ d: "M92.155 112.314c3.308 0 5.989-2.696 5.989-6.021 0-3.326-2.681-6.021-5.989-6.021-3.307 0-5.988 2.695-5.988 6.021 0 3.325 2.681 6.021 5.988 6.021Z",
5148
+ fill: "gray"
5149
+ }), /*#__PURE__*/React.createElement("path", {
5150
+ d: "M80.597 128.771h11.769v3.726a1.118 1.118 0 0 1-1.112 1.118H78.57a1.118 1.118 0 0 1-1.112-1.118v-.566c0-.841.332-1.648.924-2.242a3.144 3.144 0 0 1 2.23-.929l-.015.011Z",
5151
+ fill: "#333"
5152
+ }), /*#__PURE__*/React.createElement("path", {
5153
+ d: "M89.572 132.084s8.075.119 6.3-8.268c-1.775-8.387-12.188-15.351-15.234-6.066-3.046 9.285-1.386 15.232 8.934 14.334Z",
5154
+ fill: "#F2F2F2"
5155
+ }), /*#__PURE__*/React.createElement("path", {
5156
+ d: "M106.67 121.334h-.27a2.84 2.84 0 0 1-1.925-1.025 2.872 2.872 0 0 1-.639-2.093c.285-3.059-1.92-8.708-3.38-11.551a2.873 2.873 0 0 1 1.296-3.721 2.832 2.832 0 0 1 2.102-.199 2.848 2.848 0 0 1 1.66 1.312c.463.906 4.521 8.991 3.988 14.714a2.874 2.874 0 0 1-.926 1.828 2.832 2.832 0 0 1-1.906.735Z",
5157
+ fill: "#4D4D4D"
5158
+ }), /*#__PURE__*/React.createElement("path", {
5159
+ d: "M103.835 112.314c3.307 0 5.988-2.696 5.988-6.021 0-3.326-2.681-6.021-5.988-6.021-3.307 0-5.988 2.695-5.988 6.021 0 3.325 2.681 6.021 5.988 6.021Z",
5160
+ fill: "gray"
5161
+ }), /*#__PURE__*/React.createElement("path", {
5162
+ d: "m117.408 133.652-12.674-.002c-.295 0-.577-.118-.786-.328a1.121 1.121 0 0 1-.325-.79v-3.726l11.773.002c.837 0 1.639.334 2.23.929s.923 1.401.923 2.242v.567a1.116 1.116 0 0 1-1.141 1.106Z",
5163
+ fill: "#333"
5164
+ }), /*#__PURE__*/React.createElement("path", {
5165
+ d: "M106.414 132.084s-8.075.119-6.318-8.268c1.756-8.387 12.195-15.343 15.237-6.062 3.043 9.281 1.405 15.235-8.919 14.33Z",
5166
+ fill: "#F2F2F2"
5167
+ }), /*#__PURE__*/React.createElement("path", {
5168
+ d: "M109.107 94.58a2.305 2.305 0 0 0 2.191 2.412 2.302 2.302 0 0 0 2.399-2.202l.333-7.33a2.306 2.306 0 0 0-2.191-2.412 2.303 2.303 0 0 0-2.4 2.203l-.332 7.328Z",
5169
+ fill: "gray"
5170
+ }), /*#__PURE__*/React.createElement("path", {
5171
+ d: "M80.968 109.31c.478-.686.01-1.845-1.047-2.589-1.056-.744-2.3-.791-2.777-.105-.478.686-.01 1.845 1.046 2.589s2.3.791 2.778.105Z",
5172
+ fill: "#333"
5173
+ }), /*#__PURE__*/React.createElement("path", {
5174
+ d: "M73.448 113.599c3.457 0 6.26-2.817 6.26-6.293 0-3.475-2.803-6.293-6.26-6.293-3.456 0-6.258 2.818-6.258 6.293 0 3.476 2.802 6.293 6.258 6.293Z",
5175
+ fill: "#333"
5176
+ }), /*#__PURE__*/React.createElement("path", {
5177
+ d: "M78 100.968a2.853 2.853 0 0 1-2.832-2.484 2.876 2.876 0 0 1 .07-1.115c2.639-9.955 9.669-9.687 9.965-9.665l-.311 5.716h.104c-.12 0-2.854.134-4.255 5.421a2.87 2.87 0 0 1-1.013 1.53 2.845 2.845 0 0 1-1.729.597Z",
5178
+ fill: "#4D4D4D"
5179
+ }), /*#__PURE__*/React.createElement("path", {
5180
+ d: "M87.37 88.17a2.305 2.305 0 0 0-2.19-2.413 2.302 2.302 0 0 0-2.4 2.202l-.332 7.329a2.305 2.305 0 0 0 2.19 2.413 2.302 2.302 0 0 0 2.4-2.203l.332-7.328Z",
5181
+ fill: "gray"
5182
+ }), /*#__PURE__*/React.createElement("path", {
5183
+ d: "M81.893 100.503c.462-5.894-2.797-10.96-7.28-11.315-4.482-.356-8.49 4.134-8.953 10.027-.462 5.894 2.797 10.96 7.28 11.315 4.482.356 8.49-4.134 8.953-10.027Z",
5184
+ fill: "#F2F2F2"
5185
+ }), /*#__PURE__*/React.createElement("path", {
5186
+ d: "M70.888 107.738c4.48.354 8.49-4.135 8.953-10.026a12.89 12.89 0 0 0-1.223-6.707c2.25 2.046 3.591 5.59 3.284 9.505-.464 5.895-4.47 10.384-8.953 10.027-2.594-.205-4.766-1.986-6.055-4.591a6.682 6.682 0 0 0 3.994 1.792Z",
5187
+ fill: "#E6E6E6"
5188
+ }), /*#__PURE__*/React.createElement("path", {
5189
+ d: "M112.717 94.105c-.511-9.095-7.459-11.703-15.82-11.226-8.36.477-14.97 3.856-14.451 12.951.518 9.095 7.707 16.081 16.067 15.605 8.36-.477 14.719-8.231 14.204-17.33Z",
5190
+ fill: "#F2F2F2"
5191
+ }), /*#__PURE__*/React.createElement("path", {
5192
+ d: "M112.565 92.656c-1.056 7.496-6.799 13.413-14.059 13.812-7.852.451-14.67-5.686-15.897-13.965a14.571 14.571 0 0 0-.17 3.327c.51 9.095 7.704 16.081 16.067 15.605 8.364-.477 14.723-8.235 14.211-17.33a16.83 16.83 0 0 0-.152-1.45Z",
5193
+ fill: "#E6E6E6"
5194
+ }), /*#__PURE__*/React.createElement("path", {
5195
+ d: "M94.626 78.445c-.114-.488 6.548-.927 5.815.246v.775c0 .746.033 1.49.033 2.258s.037 1.595.044 2.392c.278.593-6.473.935-5.817-.115v-.67c-.015-1.63-.06-3.257-.075-4.886Z",
5196
+ fill: "#999"
5197
+ }), /*#__PURE__*/React.createElement("path", {
5198
+ d: "M103.546 90.353H91.61a.62.62 0 0 0-.619.623v1.762a.62.62 0 0 0 .62.622h11.935a.62.62 0 0 0 .619-.622v-1.762a.62.62 0 0 0-.619-.623Zm0 5.187H91.61a.62.62 0 0 0-.619.622v1.762a.62.62 0 0 0 .62.623h11.935a.62.62 0 0 0 .619-.623v-1.762a.62.62 0 0 0-.619-.622Zm-.004 5.19H91.606a.62.62 0 0 0-.619.622v1.763a.62.62 0 0 0 .62.622h11.935a.62.62 0 0 0 .619-.622v-1.763a.62.62 0 0 0-.619-.622ZM55.773 64.004c4.349 0 7.874-5.285 7.874-11.804s-3.525-11.804-7.874-11.804-7.875 5.285-7.875 11.804c0 6.52 3.526 11.804 7.875 11.804Zm84.17.015c4.349 0 7.874-5.285 7.874-11.804 0-6.52-3.525-11.804-7.874-11.804s-7.875 5.285-7.875 11.804 3.526 11.804 7.875 11.804Z",
5199
+ fill: "#3690EA"
5200
+ }), /*#__PURE__*/React.createElement("path", {
5201
+ d: "M97.962 29.036c7.273 0 13.17-2.224 13.17-4.967 0-2.743-5.897-4.966-13.17-4.966-7.274 0-13.17 2.223-13.17 4.966 0 2.743 5.896 4.967 13.17 4.967Z",
5202
+ fill: "#B3B3B3"
5203
+ }), /*#__PURE__*/React.createElement("path", {
5204
+ d: "M97.962 16.55c4.545 0 8.23-3.705 8.23-8.275S102.507 0 97.962 0c-4.546 0-8.23 3.705-8.23 8.275s3.684 8.275 8.23 8.275Z",
5205
+ fill: "#3690EA"
5206
+ }), /*#__PURE__*/React.createElement("path", {
5207
+ d: "M141.607 59.283V45.147a19.038 19.038 0 0 0-3.687-11.301 18.872 18.872 0 0 0-9.653-6.874c-8.838-2.69-19.203-4.24-30.29-4.244-11.088-.004-21.452 1.546-30.29 4.233a18.871 18.871 0 0 0-9.668 6.866 19.041 19.041 0 0 0-3.699 11.305v14.132a19.03 19.03 0 0 0 3.685 11.303 18.86 18.86 0 0 0 9.656 6.872c8.841 2.694 19.206 4.244 30.29 4.244 11.083 0 21.452-1.542 30.294-4.233a18.858 18.858 0 0 0 9.666-6.863 19.028 19.028 0 0 0 3.696-11.304Z",
5208
+ fill: "#F2F2F2"
5209
+ }), /*#__PURE__*/React.createElement("path", {
5210
+ d: "M97.954 75.051c-10.068 0-19.88-1.371-28.381-3.957a12.353 12.353 0 0 1-6.262-4.485 12.463 12.463 0 0 1-2.41-7.34V45.131c.006-2.642.85-5.214 2.411-7.34a12.345 12.345 0 0 1 6.264-4.482c8.501-2.586 18.317-3.95 28.382-3.95 10.065 0 19.877 1.371 28.382 3.96a12.35 12.35 0 0 1 6.262 4.486 12.46 12.46 0 0 1 2.409 7.34V59.28a12.453 12.453 0 0 1-2.41 7.341 12.343 12.343 0 0 1-6.265 4.482c-8.486 2.585-18.317 3.949-28.382 3.949Z",
5211
+ fill: "#E6E6E6"
5212
+ }), /*#__PURE__*/React.createElement("path", {
5213
+ d: "M100.863 15.992h-5.81v1.293h5.81v-1.293Z",
5214
+ fill: "#F2F2F2"
5215
+ }), /*#__PURE__*/React.createElement("path", {
5216
+ d: "M76.472 66.05c4.327 0 7.834-6.2 7.834-13.846 0-7.647-3.507-13.846-7.834-13.846-4.326 0-7.833 6.2-7.833 13.846s3.507 13.845 7.833 13.845Z",
5217
+ fill: "#1A1A1A"
5218
+ }), /*#__PURE__*/React.createElement("path", {
5219
+ d: "M77.844 52.766c1.743 0 3.157-2.088 3.157-4.664 0-2.577-1.414-4.665-3.157-4.665-1.744 0-3.157 2.088-3.157 4.665 0 2.576 1.413 4.664 3.157 4.664Z",
5220
+ fill: "#fff"
5221
+ }), /*#__PURE__*/React.createElement("path", {
5222
+ d: "M118.662 66.057c4.326 0 7.834-6.2 7.834-13.846s-3.508-13.845-7.834-13.845c-4.327 0-7.834 6.199-7.834 13.845 0 7.647 3.507 13.846 7.834 13.846Z",
5223
+ fill: "#1A1A1A"
5224
+ }), /*#__PURE__*/React.createElement("path", {
5225
+ d: "M120.032 52.774c1.744 0 3.157-2.089 3.157-4.665s-1.413-4.665-3.157-4.665c-1.743 0-3.157 2.089-3.157 4.665s1.414 4.665 3.157 4.665Z",
5226
+ fill: "#fff"
5227
+ }), /*#__PURE__*/React.createElement("path", {
5228
+ d: "M92.674 63.11a10.286 10.286 0 0 0 7.949 1.095 13.2 13.2 0 0 0 2.623-1.118.738.738 0 0 1 1.035.639.748.748 0 0 1-.119.453c-2.224 2.82-6.474 3.625-9.672 2.12a7.284 7.284 0 0 1-2.75-2.12.748.748 0 0 1 .465-1.139.738.738 0 0 1 .469.054v.015Z",
5229
+ fill: "#999"
5230
+ }), /*#__PURE__*/React.createElement("path", {
5231
+ d: "M55.773 64.004c4.349 0 7.874-5.285 7.874-11.804s-3.525-11.804-7.874-11.804-7.875 5.285-7.875 11.804c0 6.52 3.526 11.804 7.875 11.804Zm84.17.015c4.349 0 7.874-5.285 7.874-11.804 0-6.52-3.525-11.804-7.874-11.804s-7.875 5.285-7.875 11.804 3.526 11.804 7.875 11.804Z",
5232
+ fill: "#3690EA"
5233
+ }), /*#__PURE__*/React.createElement("path", {
5234
+ d: "M95.008 14.315c-.115-.488 6.548-.932 5.815.246v.771c0 .745.033 1.51.037 2.262.003.752.033 1.594.04 2.392.282.592-6.474.935-5.818-.116v-.67c-.014-1.629-.055-3.257-.074-4.885Z",
5235
+ fill: "#F2F2F2"
5236
+ }), /*#__PURE__*/React.createElement("path", {
5237
+ d: "M97.962 29.036c7.273 0 13.17-2.224 13.17-4.967 0-2.743-5.897-4.966-13.17-4.966-7.274 0-13.17 2.223-13.17 4.966 0 2.743 5.896 4.967 13.17 4.967Z",
5238
+ fill: "#B3B3B3"
5239
+ }), /*#__PURE__*/React.createElement("path", {
5240
+ d: "M97.962 16.55c4.545 0 8.23-3.705 8.23-8.275S102.507 0 97.962 0c-4.546 0-8.23 3.705-8.23 8.275s3.684 8.275 8.23 8.275Z",
5241
+ fill: "#3690EA"
5242
+ }), /*#__PURE__*/React.createElement("path", {
5243
+ d: "M141.607 59.283V45.147a19.038 19.038 0 0 0-3.687-11.301 18.872 18.872 0 0 0-9.653-6.874c-8.838-2.69-19.203-4.24-30.29-4.244-11.088-.004-21.452 1.546-30.29 4.233a18.871 18.871 0 0 0-9.668 6.866 19.041 19.041 0 0 0-3.699 11.305v14.132a19.03 19.03 0 0 0 3.685 11.303 18.86 18.86 0 0 0 9.656 6.872c8.841 2.694 19.206 4.244 30.29 4.244 11.083 0 21.452-1.542 30.294-4.233a18.858 18.858 0 0 0 9.666-6.863 19.028 19.028 0 0 0 3.696-11.304Z",
5244
+ fill: "#F2F2F2"
5245
+ }), /*#__PURE__*/React.createElement("path", {
5246
+ d: "M97.954 75.051c-10.068 0-19.88-1.371-28.381-3.957a12.353 12.353 0 0 1-6.262-4.485 12.463 12.463 0 0 1-2.41-7.34V45.131c.006-2.642.85-5.214 2.411-7.34a12.345 12.345 0 0 1 6.264-4.482c8.501-2.586 18.317-3.95 28.382-3.95 10.065 0 19.877 1.371 28.382 3.96a12.35 12.35 0 0 1 6.262 4.486 12.46 12.46 0 0 1 2.409 7.34V59.28a12.453 12.453 0 0 1-2.41 7.341 12.343 12.343 0 0 1-6.265 4.482c-8.486 2.585-18.317 3.949-28.382 3.949Zm2.909-59.059h-5.81v1.293h5.81v-1.293Z",
5247
+ fill: "#E6E6E6"
5248
+ }), /*#__PURE__*/React.createElement("path", {
5249
+ d: "M76.472 66.05c4.327 0 7.834-6.2 7.834-13.846 0-7.647-3.507-13.846-7.834-13.846-4.326 0-7.833 6.2-7.833 13.846s3.507 13.845 7.833 13.845Z",
5250
+ fill: "#1A1A1A"
5251
+ }), /*#__PURE__*/React.createElement("path", {
5252
+ d: "M77.844 52.766c1.743 0 3.157-2.088 3.157-4.664 0-2.577-1.414-4.665-3.157-4.665-1.744 0-3.157 2.088-3.157 4.665 0 2.576 1.413 4.664 3.157 4.664Z",
5253
+ fill: "#fff"
5254
+ }), /*#__PURE__*/React.createElement("path", {
5255
+ d: "M118.662 66.057c4.326 0 7.834-6.2 7.834-13.846s-3.508-13.845-7.834-13.845c-4.327 0-7.834 6.199-7.834 13.845 0 7.647 3.507 13.846 7.834 13.846Z",
5256
+ fill: "#1A1A1A"
5257
+ }), /*#__PURE__*/React.createElement("path", {
5258
+ d: "M120.032 52.774c1.744 0 3.157-2.089 3.157-4.665s-1.413-4.665-3.157-4.665c-1.743 0-3.157 2.089-3.157 4.665s1.414 4.665 3.157 4.665Z",
5259
+ fill: "#fff"
5260
+ }), /*#__PURE__*/React.createElement("path", {
5261
+ d: "M92.674 63.11a10.286 10.286 0 0 0 7.949 1.095 13.2 13.2 0 0 0 2.623-1.118.738.738 0 0 1 1.035.639.748.748 0 0 1-.119.453c-2.224 2.82-6.474 3.625-9.672 2.12a7.284 7.284 0 0 1-2.75-2.12.748.748 0 0 1 .465-1.139.738.738 0 0 1 .469.054v.015Z",
5262
+ fill: "#999"
5263
+ }), /*#__PURE__*/React.createElement("path", {
5264
+ d: "M101.117 9.562a3.035 3.035 0 0 0 3.027-3.043 3.035 3.035 0 0 0-3.027-3.043A3.035 3.035 0 0 0 98.09 6.52a3.035 3.035 0 0 0 3.027 3.043ZM51.578 54.84c.801 0 1.45-1.64 1.45-3.66 0-2.023-.649-3.662-1.45-3.662-.802 0-1.451 1.64-1.451 3.661 0 2.022.65 3.66 1.45 3.66Zm93.429 0c.802 0 1.451-1.64 1.451-3.66 0-2.023-.649-3.662-1.451-3.662-.801 0-1.45 1.64-1.45 3.661 0 2.022.649 3.66 1.45 3.66Z",
5265
+ fill: "#4BAAF7"
5266
+ }), /*#__PURE__*/React.createElement("g", {
5267
+ clipPath: `url(#${id}-b)`
5268
+ }, /*#__PURE__*/React.createElement("path", {
5269
+ d: "M52.39 160.841h-2.919a1.774 1.774 0 0 1-1.766-1.782v-7.334h9.035l-2.677 7.911a1.766 1.766 0 0 1-1.671 1.206l-.001-.001Zm91.774 0h2.919c.977 0 1.767-.799 1.767-1.782v-7.334h-9.036l2.677 7.911a1.767 1.767 0 0 0 1.672 1.206l.001-.001Z",
5270
+ fill: "#6D4932"
5271
+ }), /*#__PURE__*/React.createElement("path", {
5272
+ d: "M163.181 108.015H33.375c-2.37 0-4.291 1.479-4.291 3.305v2.216c0 1.825 1.921 3.305 4.29 3.305h129.807c2.369 0 4.29-1.48 4.29-3.305v-2.216c0-1.826-1.921-3.305-4.29-3.305Z",
5273
+ fill: "#A87B5D"
5274
+ }), /*#__PURE__*/React.createElement("path", {
5275
+ d: "M38.282 116.841h119.992v33.16c0 1.648-1.554 2.985-3.469 2.985H41.752c-1.915 0-3.468-1.337-3.468-2.985v-33.16h-.002Z",
5276
+ fill: "#916A50"
5277
+ }), /*#__PURE__*/React.createElement("path", {
5278
+ opacity: ".3",
5279
+ d: "M131.002 109.794h-97.18a.996.996 0 0 0-.992 1.001c0 .552.444 1 .992 1h97.18a.996.996 0 0 0 .991-1 .996.996 0 0 0-.991-1.001Zm30.849 0h-24.24a.996.996 0 0 0-.992 1.001c0 .552.444 1 .992 1h24.24a.996.996 0 0 0 .992-1 .996.996 0 0 0-.992-1.001Z",
5280
+ fill: "#D4B097"
5281
+ })), /*#__PURE__*/React.createElement("g", {
5282
+ clipPath: `url(#${id}-c)`
5283
+ }, /*#__PURE__*/React.createElement("path", {
5284
+ d: "M151.367 97.536h2.894c1.6 0 2.895 1.307 2.895 2.913a2.906 2.906 0 0 1-2.895 2.914h-2.894v-5.827Z",
5285
+ strokeWidth: "6",
5286
+ strokeMiterlimit: "10",
5287
+ stroke: `url(#${id}-d)`
5288
+ }), /*#__PURE__*/React.createElement("path", {
5289
+ d: "M135.876 93.304h17.017a.6.6 0 0 1 .597.602v10.166c0 1.942-1.566 3.522-3.499 3.522h-11.214c-1.933 0-3.499-1.58-3.499-3.522V93.906a.6.6 0 0 1 .598-.602Z",
5290
+ fill: `url(#${id}-e)`
5291
+ })), /*#__PURE__*/React.createElement("path", {
5292
+ d: "m37.492 78.174 38.863-6.725a3.453 3.453 0 0 1 3.455 3.45v30.087H34.04V81.623a3.452 3.452 0 0 1 3.452-3.45Z",
5293
+ fill: `url(#${id}-f)`
5294
+ }), /*#__PURE__*/React.createElement("path", {
5295
+ d: "M34.1 108.015v-3.363h57.697v3.363H34.1Z",
5296
+ fill: `url(#${id}-g)`
5297
+ }), /*#__PURE__*/React.createElement("path", {
5298
+ d: "M79.673 108.015v-3.363h12.124v3.363H79.673Z",
5299
+ fill: `url(#${id}-h)`
5300
+ })), /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("linearGradient", {
5301
+ id: `${id}-d`,
5302
+ x1: "150.254",
5303
+ y1: "100.449",
5304
+ x2: "158.273",
5305
+ y2: "100.449",
5306
+ gradientUnits: "userSpaceOnUse"
5307
+ }, /*#__PURE__*/React.createElement("stop", {
5308
+ stopColor: "#FEFEFE"
5309
+ }), /*#__PURE__*/React.createElement("stop", {
5310
+ offset: "1",
5311
+ stopColor: "#fff"
5312
+ })), /*#__PURE__*/React.createElement("linearGradient", {
5313
+ id: `${id}-e`,
5314
+ x1: "132.629",
5315
+ y1: "100.449",
5316
+ x2: "155.32",
5317
+ y2: "100.449",
5318
+ gradientUnits: "userSpaceOnUse"
5319
+ }, /*#__PURE__*/React.createElement("stop", {
5320
+ stopColor: "#FEFEFE"
5321
+ }), /*#__PURE__*/React.createElement("stop", {
5322
+ offset: "1",
5323
+ stopColor: "#F3F3F3"
5324
+ })), /*#__PURE__*/React.createElement("linearGradient", {
5325
+ id: `${id}-f`,
5326
+ x1: "56.925",
5327
+ y1: "45.291",
5328
+ x2: "56.925",
5329
+ y2: "93.076",
5330
+ gradientUnits: "userSpaceOnUse"
5331
+ }, /*#__PURE__*/React.createElement("stop", {
5332
+ stopColor: "#FEFEFE"
5333
+ }), /*#__PURE__*/React.createElement("stop", {
5334
+ offset: "1",
5335
+ stopColor: "#D1D6E7"
5336
+ })), /*#__PURE__*/React.createElement("linearGradient", {
5337
+ id: `${id}-g`,
5338
+ x1: "62.684",
5339
+ y1: "108.015",
5340
+ x2: "62.684",
5341
+ y2: "104.85",
5342
+ gradientUnits: "userSpaceOnUse"
5343
+ }, /*#__PURE__*/React.createElement("stop", {
5344
+ stopColor: "#D2D6E8"
5345
+ }), /*#__PURE__*/React.createElement("stop", {
5346
+ offset: ".726",
5347
+ stopColor: "#D1D6E7"
5348
+ })), /*#__PURE__*/React.createElement("linearGradient", {
5349
+ id: `${id}-h`,
5350
+ x1: "85.68",
5351
+ y1: "108.015",
5352
+ x2: "85.68",
5353
+ y2: "104.85",
5354
+ gradientUnits: "userSpaceOnUse"
5355
+ }, /*#__PURE__*/React.createElement("stop", {
5356
+ stopColor: "#D8DDF1"
5357
+ }), /*#__PURE__*/React.createElement("stop", {
5358
+ offset: ".726",
5359
+ stopColor: "#E2E6F6"
5360
+ })), /*#__PURE__*/React.createElement("clipPath", {
5361
+ id: `${id}-a`
5362
+ }, /*#__PURE__*/React.createElement("path", {
5363
+ fill: "#fff",
5364
+ transform: "translate(12.006)",
5365
+ d: "M0 0h172v174H0z"
5366
+ })), /*#__PURE__*/React.createElement("clipPath", {
5367
+ id: `${id}-b`
5368
+ }, /*#__PURE__*/React.createElement("path", {
5369
+ fill: "#fff",
5370
+ transform: "translate(29.084 105.073)",
5371
+ d: "M0 0h138.387v68.927H0z"
5372
+ })), /*#__PURE__*/React.createElement("clipPath", {
5373
+ id: `${id}-c`
5374
+ }, /*#__PURE__*/React.createElement("path", {
5375
+ fill: "#fff",
5376
+ transform: "translate(135.278 93.304)",
5377
+ d: "M0 0h22.995v14.29H0z"
5378
+ }))));
5379
+ }
5380
+
5381
+ var styles$f = {"blank_state":"blank_state-wMOWN","image":"image-uy0Fd"};
5382
+
5383
+ function BlankState$1({
5384
+ image,
5385
+ role,
5386
+ subtitle,
5387
+ title
5388
+ }) {
5389
+ return /*#__PURE__*/React.createElement(tapestry.Flex, {
5390
+ role: role,
5391
+ className: styles$f.blank_state,
5392
+ direction: "column",
5393
+ align: "center",
5394
+ gap: 3
5395
+ }, /*#__PURE__*/React.createElement(tapestry.Flex, {
5396
+ className: styles$f.image
5397
+ }, image), /*#__PURE__*/React.createElement(tapestry.Flex, {
5398
+ direction: "column",
5399
+ align: "center",
5400
+ gap: 1
5401
+ }, /*#__PURE__*/React.createElement("h2", null, title), /*#__PURE__*/React.createElement("p", null, subtitle)));
5402
+ }
4213
5403
 
4214
5404
  function EndOfResultsObserver({
4215
5405
  onVisible
@@ -4229,39 +5419,119 @@ function EndOfResultsObserver({
4229
5419
 
4230
5420
  const resultId = (listboxId, index) => `${listboxId}-result-${index}`;
4231
5421
 
4232
- var styles$c = {"result":"result-Thq2C"};
5422
+ var styles$e = {"result":"result-Thq2C","title":"title-KYUEn","subtitle":"subtitle-R2haq","image":"image-KVDor","avatar":"avatar-6Gh62","photo":"photo-FZR3Q","badge":"badge-trUKt"};
4233
5423
 
4234
5424
  function SearchResult({
5425
+ category,
5426
+ describedBy,
5427
+ headingAbove,
4235
5428
  highlighted,
4236
5429
  id,
5430
+ imageUrl,
4237
5431
  onHighlight,
5432
+ onOpen,
5433
+ product,
4238
5434
  subtitle,
4239
5435
  title,
4240
5436
  url
4241
5437
  }) {
4242
5438
  const ref = React.useRef(null);
5439
+ // A hovered result is already under the pointer, and scrolling it clear of
5440
+ // the panel's scroll padding would slide the list out from under the mouse.
5441
+ const highlightedByPointer = React.useRef(false);
4243
5442
  React.useEffect(() => {
4244
- var _a;
4245
- if (highlighted) (_a = ref.current) === null || _a === void 0 ? void 0 : _a.scrollIntoView({
4246
- block: "nearest"
4247
- });
4248
- }, [highlighted]);
5443
+ var _a, _b;
5444
+ if (!highlighted) return;
5445
+ if (highlightedByPointer.current) {
5446
+ highlightedByPointer.current = false;
5447
+ } else {
5448
+ (_a = ref.current) === null || _a === void 0 ? void 0 : _a.scrollIntoView({
5449
+ block: "nearest"
5450
+ });
5451
+ // Scrolling up to a section's first result leaves its heading cut off
5452
+ // above it, so bring that in too. Scrolling down, it's already in view.
5453
+ if (headingAbove) {
5454
+ (_b = document.getElementById(headingAbove)) === null || _b === void 0 ? void 0 : _b.scrollIntoView({
5455
+ block: "nearest"
5456
+ });
5457
+ }
5458
+ }
5459
+ }, [headingAbove, highlighted]);
5460
+ const highlightFromPointer = () => {
5461
+ if (highlighted) return;
5462
+ highlightedByPointer.current = true;
5463
+ onHighlight();
5464
+ };
5465
+ // Closes search before the page goes, so coming back to it doesn't find
5466
+ // search still open. Clicks that open a new tab or window leave it open.
5467
+ const openFromClick = event => {
5468
+ if (event.button !== 0 || event.altKey || event.ctrlKey || event.metaKey || event.shiftKey) return;
5469
+ onOpen();
5470
+ };
4249
5471
  // Focus stays in the search input, which points at the highlighted result
4250
5472
  // with aria-activedescendant, so results are kept out of the tab order.
4251
5473
  // Mouse move rather than enter: arrowing scrolls results under a resting
4252
5474
  // pointer, and that shouldn't steal the highlight.
4253
- return /*#__PURE__*/React.createElement("a", {
4254
- "aria-selected": highlighted,
4255
- className: styles$c.result,
4256
- href: url,
4257
- id: id,
4258
- onMouseMove: onHighlight,
4259
- ref: ref,
4260
- role: "option",
4261
- tabIndex: -1
4262
- }, /*#__PURE__*/React.createElement("div", null, title), /*#__PURE__*/React.createElement("div", null, subtitle));
5475
+ // Results open with a full page load, like Enter does, rather than through
5476
+ // the product's router. Their URLs can go through server redirects, like
5477
+ // People's staff URLs, that Turbo would follow with fetch or prefetch on
5478
+ // hover, and they should open the same way in every product.
5479
+ return (
5480
+ /*#__PURE__*/
5481
+ // Named by the title alone, so screen readers say "Ada Lovelace" rather
5482
+ // than the whole row. The section and subtitle are read after a pause.
5483
+ React.createElement("a", {
5484
+ "aria-describedby": [describedBy, subtitle && `${id}-subtitle`].filter(Boolean).join(" ") || undefined,
5485
+ "aria-labelledby": title ? `${id}-title` : undefined,
5486
+ "aria-selected": highlighted,
5487
+ className: styles$e.result,
5488
+ "data-turbo": "false",
5489
+ href: url,
5490
+ id: id,
5491
+ onClick: openFromClick,
5492
+ onMouseMove: highlightFromPointer,
5493
+ ref: ref,
5494
+ role: "option",
5495
+ tabIndex: -1
5496
+ }, /*#__PURE__*/React.createElement(ResultImage, {
5497
+ category: category,
5498
+ imageUrl: imageUrl,
5499
+ product: product
5500
+ }), /*#__PURE__*/React.createElement("span", {
5501
+ className: styles$e.title,
5502
+ id: `${id}-title`
5503
+ }, title), /*#__PURE__*/React.createElement("span", {
5504
+ className: styles$e.subtitle,
5505
+ id: `${id}-subtitle`
5506
+ }, subtitle))
5507
+ );
5508
+ }
5509
+ // A person's photo or the result's own image, badged with its product, or
5510
+ // just the product's logomark when there's no image.
5511
+ function ResultImage({
5512
+ category,
5513
+ imageUrl,
5514
+ product
5515
+ }) {
5516
+ const icon = size => isProductIconSlug(product) ? (/*#__PURE__*/React.createElement(ProductIcon, {
5517
+ size: size,
5518
+ slug: product
5519
+ })) : null;
5520
+ return /*#__PURE__*/React.createElement("span", {
5521
+ "aria-hidden": true,
5522
+ className: styles$e.image
5523
+ }, imageUrl ? (/*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("img", {
5524
+ alt: "",
5525
+ className: category === "profile" ? styles$e.avatar : styles$e.photo,
5526
+ loading: "lazy",
5527
+ src: imageUrl
5528
+ }), /*#__PURE__*/React.createElement("span", {
5529
+ className: styles$e.badge
5530
+ }, icon(16)))) : icon("100%"));
4263
5531
  }
4264
5532
 
5533
+ var styles$d = {"heading":"heading-LioUF","group":"group-cKChg"};
5534
+
4265
5535
  // Sections with a heading render as labelled groups; ones without render
4266
5536
  // their items straight into the listbox. Indexes run across every section.
4267
5537
  function ResultListbox({
@@ -4271,16 +5541,27 @@ function ResultListbox({
4271
5541
  label,
4272
5542
  labelledBy,
4273
5543
  onHighlight,
5544
+ onOpen,
4274
5545
  sections
4275
5546
  }) {
4276
5547
  let index = 0;
4277
- const renderItem = item => {
5548
+ // With aria-activedescendant, screen readers don't reliably announce the
5549
+ // group a highlighted option is in, so each option names its heading too.
5550
+ const renderItem = (item, indexInSection, headingId) => {
4278
5551
  const itemIndex = index++;
5552
+ // Sections without a heading of their own sit under the listbox's label.
5553
+ const headingAbove = indexInSection > 0 ? undefined : headingId !== null && headingId !== void 0 ? headingId : itemIndex === 0 ? labelledBy : undefined;
4279
5554
  return /*#__PURE__*/React.createElement(SearchResult, {
5555
+ category: item.category,
5556
+ describedBy: headingId,
5557
+ headingAbove: headingAbove,
4280
5558
  highlighted: itemIndex === highlightedIndex,
4281
5559
  id: resultId(id, itemIndex),
5560
+ imageUrl: item.imageUrl,
4282
5561
  key: item.key,
4283
5562
  onHighlight: () => onHighlight(itemIndex),
5563
+ onOpen: onOpen,
5564
+ product: item.product,
4284
5565
  subtitle: item.subtitle,
4285
5566
  title: item.title,
4286
5567
  url: item.url
@@ -4296,16 +5577,18 @@ function ResultListbox({
4296
5577
  if (section.heading === undefined) {
4297
5578
  return /*#__PURE__*/React.createElement(React.Fragment, {
4298
5579
  key: section.key
4299
- }, section.items.map(renderItem));
5580
+ }, section.items.map((item, itemIndex) => renderItem(item, itemIndex)));
4300
5581
  }
4301
5582
  const headingId = `${id}-group-${sectionIndex}`;
4302
5583
  return /*#__PURE__*/React.createElement("div", {
4303
5584
  "aria-labelledby": headingId,
5585
+ className: styles$d.group,
4304
5586
  key: section.key,
4305
5587
  role: "group"
4306
5588
  }, /*#__PURE__*/React.createElement("div", {
5589
+ className: styles$d.heading,
4307
5590
  id: headingId
4308
- }, section.heading), section.items.map(renderItem));
5591
+ }, section.heading), section.items.map((item, itemIndex) => renderItem(item, itemIndex, headingId)));
4309
5592
  }));
4310
5593
  }
4311
5594
 
@@ -4319,9 +5602,14 @@ function RecentlyVisited({
4319
5602
  }) {
4320
5603
  const headingId = `${navigation.id}-heading`;
4321
5604
  if (items.length === 0 && !hasMore && !loading) {
4322
- return /*#__PURE__*/React.createElement("p", null, "Pages you visit will show up here.");
5605
+ return /*#__PURE__*/React.createElement(BlankState$1, {
5606
+ image: /*#__PURE__*/React.createElement(BlankStateRecentlyVisited, null),
5607
+ subtitle: "Pages you visit will show up here.",
5608
+ title: "Recently visited"
5609
+ });
4323
5610
  } else {
4324
5611
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
5612
+ className: styles$d.heading,
4325
5613
  id: headingId
4326
5614
  }, "Recently visited"), /*#__PURE__*/React.createElement(ResultListbox, {
4327
5615
  labelledBy: headingId,
@@ -4337,6 +5625,8 @@ function RecentlyVisited({
4337
5625
  }
4338
5626
  }
4339
5627
 
5628
+ var styles$c = {"row":"row-5P7UQ","header":"header-sXEyG","closeButton":"closeButton-rPJJV","input":"input-YQkTC","clearButton":"clearButton-9Yh9w"};
5629
+
4340
5630
  // A combobox: focus stays here while aria-activedescendant points screen
4341
5631
  // readers at the highlighted result in the listbox it controls.
4342
5632
  function SearchInput({
@@ -4345,29 +5635,441 @@ function SearchInput({
4345
5635
  inputRef,
4346
5636
  listboxId,
4347
5637
  onChange,
5638
+ onClose,
4348
5639
  onFocus,
4349
5640
  onKeyDown,
4350
5641
  value
4351
5642
  }) {
4352
- return /*#__PURE__*/React.createElement("input", {
5643
+ const {
5644
+ focusProps
5645
+ } = useKeyboardFocus({
5646
+ onFocus: (event, keyboard) => {
5647
+ // Tabbing in selects the whole term, which the next keystroke would
5648
+ // replace. Put the cursor after it instead, to keep typing. The
5649
+ // browser selects after the focus event, so this waits a frame and
5650
+ // only undoes that select-all: typing on the tabs moves focus here by
5651
+ // script, which keeps the cursor, and the keystroke may already be in.
5652
+ if (keyboard) {
5653
+ const input = event.currentTarget;
5654
+ requestAnimationFrame(() => {
5655
+ const length = input.value.length;
5656
+ const selectedAll = length > 0 && input.selectionStart === 0 && input.selectionEnd === length;
5657
+ if (document.activeElement !== input || !selectedAll) return;
5658
+ input.setSelectionRange(length, length);
5659
+ });
5660
+ }
5661
+ onFocus();
5662
+ }
5663
+ });
5664
+ return /*#__PURE__*/React.createElement("div", {
5665
+ className: styles$c.row
5666
+ }, /*#__PURE__*/React.createElement("label", {
5667
+ className: styles$c.header,
5668
+ id: "topbar_product_search_label"
5669
+ }, /*#__PURE__*/React.createElement(Icon, {
5670
+ name: "general.search",
5671
+ size: 20,
5672
+ theme: "--t-icon-color-dim"
5673
+ }), /*#__PURE__*/React.createElement("input", {
4353
5674
  "aria-activedescendant": highlightedIndex === null ? undefined : resultId(listboxId, highlightedIndex),
4354
5675
  "aria-autocomplete": "list",
4355
5676
  "aria-controls": expanded ? listboxId : undefined,
4356
5677
  "aria-expanded": expanded,
4357
5678
  "aria-label": "Search",
4358
5679
  autoFocus: true,
5680
+ className: styles$c.input,
5681
+ id: "product_search",
4359
5682
  onChange: event => onChange(event.target.value),
4360
- onFocus: onFocus,
4361
5683
  onKeyDown: onKeyDown,
4362
5684
  placeholder: "Search",
4363
5685
  ref: inputRef,
4364
5686
  role: "combobox",
4365
5687
  type: "search",
4366
- value: value
4367
- });
5688
+ value: value,
5689
+ ...focusProps
5690
+ }), !onClose && value !== "" && (/*#__PURE__*/React.createElement("button", {
5691
+ "aria-label": "Clear search",
5692
+ className: styles$c.clearButton,
5693
+ onClick: () => {
5694
+ var _a;
5695
+ onChange("");
5696
+ (_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
5697
+ },
5698
+ tabIndex: -1,
5699
+ type: "button"
5700
+ }, /*#__PURE__*/React.createElement("svg", {
5701
+ "aria-hidden": true,
5702
+ viewBox: "0 0 20 20"
5703
+ }, /*#__PURE__*/React.createElement("circle", {
5704
+ cx: "10",
5705
+ cy: "10",
5706
+ r: "10"
5707
+ }), /*#__PURE__*/React.createElement("path", {
5708
+ d: "M6.5 6.5l7 7m0 -7l-7 7"
5709
+ }))))), onClose && (/*#__PURE__*/React.createElement(tapestry.IconButton, {
5710
+ "aria-label": "Close search",
5711
+ className: styles$c.closeButton,
5712
+ icon: /*#__PURE__*/React.createElement(Icon, {
5713
+ name: "general.x",
5714
+ theme: "--t-icon-color-dim"
5715
+ }),
5716
+ kind: "ghost",
5717
+ onClick: onClose,
5718
+ size: "md"
5719
+ })));
5720
+ }
5721
+
5722
+ function BlankStateError(props) {
5723
+ const id = useInstanceId("blank-state-error");
5724
+ return /*#__PURE__*/React.createElement("svg", {
5725
+ viewBox: "0 0 197 158",
5726
+ fill: "none",
5727
+ "aria-hidden": "true",
5728
+ focusable: "false",
5729
+ ...props
5730
+ }, /*#__PURE__*/React.createElement("path", {
5731
+ d: "M139.863 26.119c10.938 10.028 21.777 20.154 32.912 30.084 8.376 7.373 21.975 15.828 23.157 28.02.592 6.095-2.167 11.993-5.321 17.204-24.635 40.8-81.098 67.148-127.412 48.862-30.646-12.093-76.172-47.387-59.716-85.041C19.348 28.87 68.323 10.192 87.44 7.538c21.876-4.621 34.883 2.457 52.423 18.58Z",
5732
+ fill: "currentColor"
5733
+ }), /*#__PURE__*/React.createElement("g", {
5734
+ clipPath: `url(#${id}-a)`
5735
+ }, /*#__PURE__*/React.createElement("path", {
5736
+ d: "M76.296 111.268c-2.63 0-5.95-.883-9.822-3.622a3.39 3.39 0 0 1-1.375-2.212 3.375 3.375 0 0 1 .603-2.529 3.44 3.44 0 0 1 4.777-.767c5.305 3.786 7.949 1.838 8.056 1.767a1.23 1.23 0 0 0-.094.08l4.62 5.004a10.434 10.434 0 0 1-6.765 2.279Z",
5737
+ fill: "#4D4D4D"
5738
+ }), /*#__PURE__*/React.createElement("path", {
5739
+ d: "M83.313 102.999a2.751 2.751 0 0 0-2.882-2.611 2.747 2.747 0 0 0-2.63 2.86l.399 8.688a2.751 2.751 0 0 0 2.882 2.611 2.746 2.746 0 0 0 2.63-2.86l-.399-8.688Z",
5740
+ fill: "gray"
5741
+ }), /*#__PURE__*/React.createElement("path", {
5742
+ d: "M119.428 111.268a10.438 10.438 0 0 1-6.751-2.292l4.619-5.005a1.387 1.387 0 0 0-.093-.079c.106.084 2.75 2.032 8.055-1.767a3.439 3.439 0 0 1 4.777.766 3.378 3.378 0 0 1-.772 4.742c-3.885 2.774-7.205 3.635-9.835 3.635Z",
5743
+ fill: "#4D4D4D"
5744
+ }), /*#__PURE__*/React.createElement("path", {
5745
+ d: "M101.658 18.962H94.68v1.533h6.978v-1.533Z",
5746
+ fill: "#F2F2F2"
5747
+ }), /*#__PURE__*/React.createElement("path", {
5748
+ d: "M91.823 74.82a12.502 12.502 0 0 0 9.546 1.299 16.005 16.005 0 0 0 3.151-1.326.894.894 0 0 1 1.035.24.882.882 0 0 1 .064 1.053c-2.67 3.345-7.775 4.294-11.62 2.514a8.803 8.803 0 0 1-3.302-2.513.879.879 0 0 1 .561-1.353.887.887 0 0 1 .565.068v.017Z",
5749
+ fill: "#999"
5750
+ }), /*#__PURE__*/React.createElement("path", {
5751
+ d: "M88.236 143.397a3.433 3.433 0 0 1-2.304-.891 3.383 3.383 0 0 1-1.096-2.201c-.636-6.788 4.237-16.369 4.798-17.442a3.41 3.41 0 0 1 2-1.643 3.442 3.442 0 0 1 2.586.227 3.398 3.398 0 0 1 1.68 1.965 3.368 3.368 0 0 1-.196 2.569c-1.75 3.37-4.402 10.066-4.059 13.693a3.38 3.38 0 0 1-.773 2.479 3.43 3.43 0 0 1-2.31 1.213l-.326.031Z",
5752
+ fill: "#4D4D4D"
5753
+ }), /*#__PURE__*/React.createElement("path", {
5754
+ d: "M91.645 132.708c3.972 0 7.192-3.195 7.192-7.138 0-3.942-3.22-7.137-7.192-7.137s-7.191 3.195-7.191 7.137c0 3.943 3.22 7.138 7.191 7.138Z",
5755
+ fill: "gray"
5756
+ }), /*#__PURE__*/React.createElement("path", {
5757
+ d: "M77.765 152.218h14.134v4.417c0 .351-.141.689-.391.937-.25.249-.59.388-.944.388H75.33a1.34 1.34 0 0 1-.945-.388 1.32 1.32 0 0 1-.39-.937v-.671c0-.997.398-1.953 1.109-2.658a3.801 3.801 0 0 1 2.678-1.101l-.018.013Z",
5758
+ fill: "#333"
5759
+ }), /*#__PURE__*/React.createElement("path", {
5760
+ d: "M88.548 156.141s9.697.141 7.592-9.797c-2.105-9.939-14.641-18.198-18.295-7.191-3.654 11.007-1.695 18.056 10.703 16.988Z",
5761
+ fill: "#F2F2F2"
5762
+ }), /*#__PURE__*/React.createElement("path", {
5763
+ d: "M109.077 143.402h-.325a3.427 3.427 0 0 1-2.313-1.216 3.38 3.38 0 0 1-.771-2.481c.342-3.627-2.305-10.323-4.054-13.693a3.371 3.371 0 0 1-.11-2.514c.29-.821.887-1.5 1.666-1.897a3.44 3.44 0 0 1 2.525-.236 3.413 3.413 0 0 1 1.993 1.555c.556 1.069 5.429 10.654 4.789 17.443a3.383 3.383 0 0 1-1.113 2.167 3.426 3.426 0 0 1-2.287.872Z",
5764
+ fill: "#4D4D4D"
5765
+ }), /*#__PURE__*/React.createElement("path", {
5766
+ d: "M105.672 132.708c3.972 0 7.192-3.195 7.192-7.138 0-3.942-3.22-7.137-7.192-7.137s-7.191 3.195-7.191 7.137c0 3.943 3.219 7.138 7.191 7.138Z",
5767
+ fill: "gray"
5768
+ }), /*#__PURE__*/React.createElement("path", {
5769
+ d: "m121.972 158.007-15.22-.003c-.354 0-.693-.139-.943-.388a1.317 1.317 0 0 1-.391-.937v-4.417l14.139.003c1.004 0 1.967.396 2.678 1.101a3.745 3.745 0 0 1 1.108 2.658v.671c0 .352-.141.689-.391.937-.25.249-.59.388-.944.388l-.036-.013Z",
5770
+ fill: "#333"
5771
+ }), /*#__PURE__*/React.createElement("path", {
5772
+ d: "M108.769 156.145s-9.701.137-7.587-9.801c2.114-9.939 14.645-18.19 18.295-7.187 3.649 11.003 1.682 18.061-10.708 16.988Z",
5773
+ fill: "#F2F2F2"
5774
+ }), /*#__PURE__*/React.createElement("path", {
5775
+ d: "M112.002 111.683c-.07 1.51 1.108 2.791 2.63 2.86a2.75 2.75 0 0 0 2.882-2.611l.399-8.688a2.746 2.746 0 0 0-2.63-2.86 2.75 2.75 0 0 0-2.882 2.611l-.399 8.688Z",
5776
+ fill: "gray"
5777
+ }), /*#__PURE__*/React.createElement("path", {
5778
+ d: "M47.508 75.88c5.223 0 9.457-6.265 9.457-13.994 0-7.728-4.234-13.993-9.457-13.993-5.223 0-9.457 6.265-9.457 13.993 0 7.729 4.234 13.993 9.457 13.993Zm101.082.017c5.223 0 9.457-6.265 9.457-13.993 0-7.728-4.234-13.993-9.457-13.993-5.223 0-9.457 6.265-9.457 13.993 0 7.728 4.234 13.993 9.457 13.993Z",
5779
+ fill: "#3690EA"
5780
+ }), /*#__PURE__*/React.createElement("path", {
5781
+ d: "M94.622 16.97c-.133-.574 7.868-1.1 6.987.296 0 .305 0 .61.022.914 0 .884.04 1.767.04 2.681 0 .915.041 1.886.054 2.832.334.706-7.78 1.113-6.991-.133v-.795c-.036-1.935-.09-3.86-.112-5.795Z",
5782
+ fill: "#F2F2F2"
5783
+ }), /*#__PURE__*/React.createElement("path", {
5784
+ d: "M98.174 34.426c8.734 0 15.816-2.636 15.816-5.888s-7.082-5.888-15.816-5.888c-8.736 0-15.817 2.637-15.817 5.888 0 3.252 7.082 5.888 15.817 5.888Z",
5785
+ fill: "#B3B3B3"
5786
+ }), /*#__PURE__*/React.createElement("path", {
5787
+ d: "M98.174 19.625c5.458 0 9.883-4.393 9.883-9.81 0-5.418-4.425-9.81-9.883-9.81-5.46 0-9.884 4.392-9.884 9.81s4.425 9.81 9.883 9.81Z",
5788
+ fill: "#3690EA"
5789
+ }), /*#__PURE__*/React.createElement("path", {
5790
+ d: "M116.339 111.123c-.614-10.782-8.958-13.874-19.002-13.309-10.044.566-17.979 4.567-17.356 15.354.623 10.786 9.252 19.063 19.296 18.498 10.044-.565 17.676-9.761 17.062-20.543Z",
5791
+ fill: "#F2F2F2"
5792
+ }), /*#__PURE__*/React.createElement("path", {
5793
+ d: "M116.139 109.4c-1.268 8.891-8.171 15.901-16.884 16.378-9.43.53-17.623-6.74-19.096-16.559a17.615 17.615 0 0 0-.205 3.949c.619 10.781 9.257 19.063 19.297 18.498 10.039-.566 17.685-9.762 17.07-20.544a11.69 11.69 0 0 0-.182-1.722Z",
5794
+ fill: "#E6E6E6"
5795
+ }), /*#__PURE__*/React.createElement("path", {
5796
+ d: "M94.609 92.558c-.134-.579 7.868-1.1 6.987.291v.915c0 .883.035 1.789.04 2.68.004.893.04 1.891.053 2.837.334.702-7.779 1.108-6.991-.137v-.796c-.013-1.93-.067-3.86-.089-5.79Z",
5797
+ fill: "#999"
5798
+ }), /*#__PURE__*/React.createElement("path", {
5799
+ d: "M150.588 70.279V53.525a22.366 22.366 0 0 0-4.425-13.4 22.645 22.645 0 0 0-11.596-8.146c-10.613-3.19-23.061-5.027-36.376-5.031-13.315-.004-25.762 1.833-36.38 5.018a22.654 22.654 0 0 0-11.609 8.14 22.374 22.374 0 0 0-4.438 13.401v16.754a22.375 22.375 0 0 0 4.435 13.403 22.654 22.654 0 0 0 11.607 8.143c10.614 3.19 23.061 5.026 36.376 5.031 13.315.004 25.763-1.833 36.376-5.018a22.658 22.658 0 0 0 11.598-8.144 22.377 22.377 0 0 0 4.432-13.397Z",
5800
+ fill: "#F2F2F2"
5801
+ }), /*#__PURE__*/React.createElement("path", {
5802
+ d: "M98.16 88.976c-12.087 0-23.87-1.626-34.08-4.695a14.817 14.817 0 0 1-7.522-5.316 14.635 14.635 0 0 1-2.891-8.704V53.507a14.64 14.64 0 0 1 2.89-8.698 14.82 14.82 0 0 1 7.514-5.317c10.21-3.065 21.993-4.682 34.085-4.682 12.091 0 23.871 1.626 34.079 4.696a14.817 14.817 0 0 1 7.523 5.315 14.635 14.635 0 0 1 2.891 8.704V70.28a14.635 14.635 0 0 1-2.897 8.703 14.824 14.824 0 0 1-7.525 5.312c-10.191 3.047-21.976 4.682-34.067 4.682Zm3.498-70.014H94.68v1.533h6.978v-1.533Z",
5803
+ fill: "#E6E6E6"
5804
+ }), /*#__PURE__*/React.createElement("path", {
5805
+ d: "M72.367 78.304c5.195 0 9.407-7.348 9.407-16.413 0-9.065-4.212-16.414-9.407-16.414-5.196 0-9.408 7.349-9.408 16.414 0 9.065 4.212 16.413 9.408 16.413Z",
5806
+ fill: "#1A1A1A"
5807
+ }), /*#__PURE__*/React.createElement("path", {
5808
+ d: "M74.013 62.558c2.094 0 3.792-2.476 3.792-5.53 0-3.054-1.698-5.53-3.792-5.53s-3.791 2.476-3.791 5.53c0 3.054 1.697 5.53 3.791 5.53Z",
5809
+ fill: "#fff"
5810
+ }), /*#__PURE__*/React.createElement("path", {
5811
+ d: "M123.032 78.313c5.196 0 9.408-7.349 9.408-16.413 0-9.065-4.212-16.414-9.408-16.414-5.195 0-9.407 7.349-9.407 16.414 0 9.065 4.212 16.413 9.407 16.413Z",
5812
+ fill: "#1A1A1A"
5813
+ }), /*#__PURE__*/React.createElement("path", {
5814
+ d: "M124.679 62.567c2.094 0 3.792-2.476 3.792-5.53 0-3.054-1.698-5.53-3.792-5.53s-3.792 2.476-3.792 5.53c0 3.054 1.698 5.53 3.792 5.53Z",
5815
+ fill: "#fff"
5816
+ }), /*#__PURE__*/React.createElement("path", {
5817
+ d: "M105.325 106.675H90.991a.74.74 0 0 0-.743.737v2.089a.74.74 0 0 0 .743.738h14.334a.74.74 0 0 0 .743-.738v-2.089a.74.74 0 0 0-.743-.737Zm0 6.148H90.991a.74.74 0 0 0-.743.738v2.089a.74.74 0 0 0 .743.738h14.334c.41 0 .743-.331.743-.738v-2.089a.74.74 0 0 0-.743-.738Zm-.004 6.153H90.987a.74.74 0 0 0-.744.737v2.09a.74.74 0 0 0 .744.737h14.334a.74.74 0 0 0 .743-.737v-2.09a.74.74 0 0 0-.743-.737Z",
5818
+ fill: "#3690EA"
5819
+ }), /*#__PURE__*/React.createElement("path", {
5820
+ d: "M140.653 109.023c5.67-4.178 7.656-11.053 4.438-15.356-3.219-4.303-10.424-4.405-16.094-.227-5.67 4.177-7.656 11.052-4.438 15.356 3.219 4.303 10.424 4.405 16.094.227Z",
5821
+ fill: "#F2F2F2"
5822
+ }), /*#__PURE__*/React.createElement("path", {
5823
+ d: "M144.211 97.717c-3.217-4.302-10.422-4.417-16.092-.23a15.277 15.277 0 0 0-5.087 6.339c.067-3.613 2.194-7.58 5.964-10.358 5.669-4.174 12.874-4.073 16.092.23 1.86 2.486 1.976 5.83.649 9.019a7.943 7.943 0 0 0-1.526-5Z",
5824
+ fill: "#E6E6E6"
5825
+ }), /*#__PURE__*/React.createElement("path", {
5826
+ d: "M141.051 91.524c.966-1.66.874-3.508-.205-4.126-1.08-.618-2.737.226-3.703 1.887-.966 1.66-.874 3.508.205 4.126 1.079.619 2.737-.226 3.703-1.887Z",
5827
+ fill: "#333"
5828
+ }), /*#__PURE__*/React.createElement("path", {
5829
+ d: "M142.711 103.49c4.151 0 7.517-3.34 7.517-7.46s-3.366-7.46-7.517-7.46-7.516 3.34-7.516 7.46 3.365 7.46 7.516 7.46Z",
5830
+ fill: "#333"
5831
+ }), /*#__PURE__*/React.createElement("path", {
5832
+ d: "M70.234 108.894c3.219-4.303 1.232-11.178-4.437-15.356-5.67-4.178-12.875-4.076-16.094.227-3.219 4.303-1.232 11.179 4.438 15.356 5.67 4.178 12.875 4.076 16.093-.227Z",
5833
+ fill: "#F2F2F2"
5834
+ }), /*#__PURE__*/React.createElement("path", {
5835
+ d: "M50.574 97.717c3.218-4.302 10.422-4.417 16.092-.23a15.273 15.273 0 0 1 5.087 6.339c-.067-3.613-2.194-7.58-5.964-10.358-5.67-4.174-12.874-4.073-16.092.23-1.86 2.486-1.971 5.83-.65 9.019a7.945 7.945 0 0 1 1.527-5Z",
5836
+ fill: "#E6E6E6"
5837
+ }), /*#__PURE__*/React.createElement("path", {
5838
+ d: "M57.434 93.41c1.08-.618 1.171-2.466.206-4.126-.966-1.66-2.624-2.506-3.703-1.887-1.08.618-1.171 2.466-.205 4.126.965 1.66 2.623 2.506 3.702 1.887Z",
5839
+ fill: "#333"
5840
+ }), /*#__PURE__*/React.createElement("path", {
5841
+ d: "M52.074 103.49c4.151 0 7.516-3.34 7.516-7.46s-3.365-7.46-7.516-7.46-7.517 3.34-7.517 7.46 3.366 7.46 7.517 7.46Z",
5842
+ fill: "#333"
5843
+ }), /*#__PURE__*/React.createElement("path", {
5844
+ d: "M98.485 83.08c1.523-.183 2.609-1.544 2.426-3.041-.183-1.497-1.565-2.561-3.088-2.378-1.522.183-2.608 1.544-2.425 3.041.182 1.497 1.565 2.561 3.087 2.378Z",
5845
+ fill: "#1A1A1A"
5846
+ }), /*#__PURE__*/React.createElement("path", {
5847
+ d: "M101.729 11.17c1.733 0 3.138-1.394 3.138-3.113 0-1.72-1.405-3.114-3.138-3.114-1.733 0-3.137 1.394-3.137 3.114s1.404 3.114 3.137 3.114Zm52.37 52.753c.829 0 1.5-1.677 1.5-3.746s-.671-3.746-1.5-3.746c-.828 0-1.499 1.677-1.499 3.746s.671 3.746 1.499 3.746Zm-111.549 0c.829 0 1.5-1.677 1.5-3.746s-.671-3.746-1.5-3.746c-.828 0-1.5 1.677-1.5 3.746s.672 3.746 1.5 3.746Z",
5848
+ fill: "#4BAAF7"
5849
+ })), /*#__PURE__*/React.createElement("mask", {
5850
+ id: `${id}-b`,
5851
+ style: {
5852
+ maskType: "alpha"
5853
+ },
5854
+ maskUnits: "userSpaceOnUse",
5855
+ x: "0",
5856
+ y: "6",
5857
+ width: "197",
5858
+ height: "151"
5859
+ }, /*#__PURE__*/React.createElement("path", {
5860
+ d: "M139.863 26.12c10.938 10.028 21.777 20.154 32.912 30.084 8.376 7.373 21.975 15.828 23.157 28.02.592 6.095-2.167 11.993-5.321 17.204-24.635 40.8-81.098 67.148-127.412 48.862-30.646-12.093-76.172-47.387-59.716-85.041 15.865-36.377 64.84-55.056 83.957-57.71 21.876-4.621 34.883 2.457 52.423 18.58Z",
5861
+ fill: "#CEE1FF",
5862
+ fillOpacity: ".8"
5863
+ })), /*#__PURE__*/React.createElement("g", {
5864
+ mask: `url(#${id}-b)`
5865
+ }, /*#__PURE__*/React.createElement("path", {
5866
+ d: "m59.006 101 8 4m-4 1-4-5h6",
5867
+ stroke: "#FFD463"
5868
+ }), /*#__PURE__*/React.createElement("path", {
5869
+ d: "M60.006 100.999c-14.02-9.35-30.69-13.01-50-11S-26.916 103.01-38.276 115",
5870
+ strokeWidth: "2",
5871
+ stroke: "#fff"
5872
+ }), /*#__PURE__*/React.createElement("path", {
5873
+ d: "m125.304 89-8.08 3.84m1.68-3.77 6.4-.07-3.7 4.72",
5874
+ stroke: "#FFD463"
5875
+ }), /*#__PURE__*/React.createElement("path", {
5876
+ d: "M123.724 89.5c26.45-8.66 23 40.5 47 42.5 22.399 1.867 36.5-31.001 63 12",
5877
+ strokeWidth: "2",
5878
+ stroke: "#fff"
5879
+ })), /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("clipPath", {
5880
+ id: `${id}-a`
5881
+ }, /*#__PURE__*/React.createElement("path", {
5882
+ fill: "#fff",
5883
+ transform: "translate(38.051)",
5884
+ d: "M0 0h120v158H0z"
5885
+ }))));
4368
5886
  }
4369
5887
 
4370
- var styles$b = {"visuallyHidden":"visuallyHidden-S9VG5"};
5888
+ function BlankStateNoResults(props) {
5889
+ const id = useInstanceId("blank-state-no-results");
5890
+ return /*#__PURE__*/React.createElement("svg", {
5891
+ viewBox: "0 0 197 152",
5892
+ fill: "none",
5893
+ "aria-hidden": "true",
5894
+ focusable: "false",
5895
+ ...props
5896
+ }, /*#__PURE__*/React.createElement("path", {
5897
+ d: "M139.863 19.971C150.801 30 161.64 40.126 172.775 50.055c8.376 7.374 21.975 15.829 23.157 28.02.592 6.095-2.167 11.994-5.321 17.205-24.635 40.8-81.098 67.148-127.412 48.862C32.553 132.049-12.973 96.754 3.483 59.1 19.348 22.724 68.323 4.044 87.44 1.39c21.876-4.62 34.883 2.458 52.423 18.581Z",
5898
+ fill: "currentColor"
5899
+ }), /*#__PURE__*/React.createElement("path", {
5900
+ d: "M94.382 27.326c4.859 0 8.797-3.932 8.797-8.783 0-4.85-3.938-8.783-8.797-8.783-4.858 0-8.796 3.933-8.796 8.783 0 4.851 3.938 8.783 8.796 8.783Z",
5901
+ fill: "#3690EA"
5902
+ }), /*#__PURE__*/React.createElement("path", {
5903
+ d: "M97.481 19.861a3.22 3.22 0 0 0 3.222-3.217 3.22 3.22 0 0 0-3.222-3.217 3.22 3.22 0 0 0-3.222 3.217 3.22 3.22 0 0 0 3.222 3.217Z",
5904
+ fill: "#4BAAF7"
5905
+ }), /*#__PURE__*/React.createElement("path", {
5906
+ d: "M97.564 26.688h-6.248v3.565h6.248v-3.565Z",
5907
+ fill: "#F2F2F2"
5908
+ }), /*#__PURE__*/React.createElement("path", {
5909
+ d: "M49.297 77.706c4.649 0 8.417-5.61 8.417-12.53 0-6.921-3.768-12.531-8.417-12.531s-8.417 5.61-8.417 12.53c0 6.92 3.768 12.531 8.417 12.531Zm89.958 0c4.649 0 8.417-5.61 8.417-12.53 0-6.921-3.768-12.531-8.417-12.531s-8.417 5.61-8.417 12.53c0 6.92 3.768 12.531 8.417 12.531Z",
5910
+ fill: "#3690EA"
5911
+ }), /*#__PURE__*/React.createElement("path", {
5912
+ d: "M94.379 40.574c7.774 0 14.076-2.36 14.076-5.271 0-2.912-6.302-5.272-14.076-5.272-7.774 0-14.076 2.36-14.076 5.272 0 2.911 6.302 5.271 14.076 5.271Z",
5913
+ fill: "#B3B3B3"
5914
+ }), /*#__PURE__*/React.createElement("path", {
5915
+ d: "M141.036 72.671V57.672a20.118 20.118 0 0 0-3.949-12 20.166 20.166 0 0 0-10.333-7.29c-9.448-2.852-20.529-4.497-32.379-4.497-11.849 0-22.926 1.645-32.374 4.497a20.167 20.167 0 0 0-10.331 7.29 20.117 20.117 0 0 0-3.95 12v15a20.112 20.112 0 0 0 3.949 12A20.163 20.163 0 0 0 62 91.962c9.448 2.856 20.53 4.496 32.375 4.496 11.844 0 22.93-1.64 32.378-4.496a20.153 20.153 0 0 0 10.333-7.289 20.107 20.107 0 0 0 3.949-12.002Z",
5916
+ fill: "#F2F2F2"
5917
+ }), /*#__PURE__*/React.createElement("path", {
5918
+ d: "M94.387 89.422c-10.76 0-21.248-1.448-30.348-4.193a13.19 13.19 0 0 1-6.698-4.759 13.159 13.159 0 0 1-2.576-7.794v-15a13.163 13.163 0 0 1 2.577-7.793 13.196 13.196 0 0 1 6.697-4.76c9.082-2.744 19.574-4.193 30.348-4.193 10.773 0 21.248 1.449 30.348 4.194a13.2 13.2 0 0 1 6.701 4.757 13.17 13.17 0 0 1 2.582 7.795v15a13.164 13.164 0 0 1-2.577 7.794 13.195 13.195 0 0 1-6.697 4.759c-9.109 2.727-19.597 4.193-30.357 4.193Z",
5919
+ fill: "#E6E6E6"
5920
+ }), /*#__PURE__*/React.createElement("path", {
5921
+ d: "M71.426 79.868c4.624 0 8.373-6.58 8.373-14.696s-3.749-14.696-8.373-14.696c-4.624 0-8.372 6.58-8.372 14.696 0 8.117 3.748 14.697 8.372 14.697Z",
5922
+ fill: "#1A1A1A"
5923
+ }), /*#__PURE__*/React.createElement("path", {
5924
+ d: "M72.894 65.765c1.863 0 3.373-2.217 3.373-4.95 0-2.735-1.51-4.952-3.373-4.952-1.864 0-3.375 2.217-3.375 4.951 0 2.734 1.511 4.95 3.374 4.95Z",
5925
+ fill: "#fff"
5926
+ }), /*#__PURE__*/React.createElement("path", {
5927
+ d: "M116.517 79.868c4.624 0 8.373-6.58 8.373-14.696s-3.749-14.696-8.373-14.696c-4.624 0-8.372 6.58-8.372 14.696 0 8.117 3.748 14.697 8.372 14.697Z",
5928
+ fill: "#1A1A1A"
5929
+ }), /*#__PURE__*/React.createElement("path", {
5930
+ d: "M117.981 65.765c1.864 0 3.374-2.217 3.374-4.95 0-2.735-1.51-4.952-3.374-4.952-1.863 0-3.374 2.217-3.374 4.951 0 2.734 1.511 4.95 3.374 4.95Z",
5931
+ fill: "#fff"
5932
+ }), /*#__PURE__*/React.createElement("path", {
5933
+ d: "M100.012 80.196a14.156 14.156 0 0 0-2.785-1.159 10.598 10.598 0 0 0-5.713 0 14.09 14.09 0 0 0-2.78 1.159h-.027a.773.773 0 0 1-.973-1.159 8.74 8.74 0 0 1 6.639-3.049 8.754 8.754 0 0 1 6.638 3.05.773.773 0 0 1-.977 1.158h-.022Z",
5934
+ fill: "#999"
5935
+ }), /*#__PURE__*/React.createElement("path", {
5936
+ d: "M44.788 67.69c.853 0 1.545-1.731 1.545-3.867 0-2.137-.692-3.868-1.545-3.868-.852 0-1.544 1.731-1.544 3.867 0 2.137.691 3.868 1.544 3.868Zm99.38 0c.853 0 1.544-1.731 1.544-3.867 0-2.137-.691-3.868-1.544-3.868-.853 0-1.544 1.731-1.544 3.867 0 2.137.691 3.868 1.544 3.868Z",
5937
+ fill: "#4BAAF7"
5938
+ }), /*#__PURE__*/React.createElement("path", {
5939
+ d: "M79.596 106.857s-13.835 0-13.835-18.752",
5940
+ strokeWidth: "13.63",
5941
+ strokeMiterlimit: "10",
5942
+ strokeLinecap: "round",
5943
+ stroke: "#4D4D4D"
5944
+ }), /*#__PURE__*/React.createElement("path", {
5945
+ d: "M79.295 99.708h-.004a2.453 2.453 0 0 0-2.34 2.56l.353 7.781a2.453 2.453 0 0 0 2.564 2.337h.004a2.452 2.452 0 0 0 2.34-2.559l-.353-7.782a2.453 2.453 0 0 0-2.564-2.337Z",
5946
+ fill: "gray"
5947
+ }), /*#__PURE__*/React.createElement("path", {
5948
+ d: "M109.137 104.385s3.851 3.681 10.947-1.181",
5949
+ strokeWidth: "13.63",
5950
+ strokeMiterlimit: "10",
5951
+ strokeLinecap: "round",
5952
+ stroke: "#4D4D4D"
5953
+ }), /*#__PURE__*/React.createElement("path", {
5954
+ d: "m107.907 112.125.004.001a2.455 2.455 0 0 0 2.859-1.966l1.414-7.661a2.451 2.451 0 0 0-1.97-2.854h-.004a2.455 2.455 0 0 0-2.859 1.965l-1.413 7.661a2.45 2.45 0 0 0 1.969 2.854Z",
5955
+ fill: "gray"
5956
+ }), /*#__PURE__*/React.createElement("path", {
5957
+ d: "M89.494 121.176s-4.44 8.569-3.936 13.934",
5958
+ strokeWidth: "13.63",
5959
+ strokeMiterlimit: "10",
5960
+ strokeLinecap: "round",
5961
+ stroke: "#4D4D4D"
5962
+ }), /*#__PURE__*/React.createElement("path", {
5963
+ d: "M88.59 128.571c3.535 0 6.4-2.861 6.4-6.39a6.395 6.395 0 0 0-6.4-6.39 6.395 6.395 0 0 0-6.4 6.39 6.395 6.395 0 0 0 6.4 6.39Z",
5964
+ fill: "gray"
5965
+ }), /*#__PURE__*/React.createElement("path", {
5966
+ d: "M76.233 146.043h12.585v3.966a1.205 1.205 0 0 1-1.205 1.204H74.068a1.205 1.205 0 0 1-1.205-1.204v-.601a3.367 3.367 0 0 1 .989-2.378 3.38 3.38 0 0 1 2.38-.987Z",
5967
+ fill: "#333"
5968
+ }), /*#__PURE__*/React.createElement("path", {
5969
+ d: "M85.808 149.557s8.631.125 6.752-8.774c-1.878-8.899-13-16.291-16.263-6.434-3.262 9.857-1.499 16.166 9.511 15.208Z",
5970
+ fill: "#F2F2F2"
5971
+ }), /*#__PURE__*/React.createElement("path", {
5972
+ d: "M100.159 121.176s4.463 8.569 3.937 13.934",
5973
+ strokeWidth: "13.63",
5974
+ strokeMiterlimit: "10",
5975
+ strokeLinecap: "round",
5976
+ stroke: "#4D4D4D"
5977
+ }), /*#__PURE__*/React.createElement("path", {
5978
+ d: "M101.064 128.571c3.534 0 6.4-2.861 6.4-6.39 0-3.529-2.866-6.39-6.4-6.39a6.395 6.395 0 0 0-6.4 6.39 6.395 6.395 0 0 0 6.4 6.39Z",
5979
+ fill: "gray"
5980
+ }), /*#__PURE__*/React.createElement("path", {
5981
+ d: "M115.584 151.216h-13.545a1.206 1.206 0 0 1-1.205-1.203v-3.98h12.586a3.37 3.37 0 0 1 3.374 3.369v.602a1.21 1.21 0 0 1-.745 1.121 1.23 1.23 0 0 1-.465.091Z",
5982
+ fill: "#333"
5983
+ }), /*#__PURE__*/React.createElement("path", {
5984
+ d: "M103.838 149.557s-8.632.125-6.757-8.774c1.874-8.899 13.036-16.291 16.285-6.434 3.249 9.857 1.5 16.166-9.528 15.208Zm6.725-40.315c-.549-9.652-7.975-12.415-16.91-11.907-8.935.508-16.004 4.091-15.455 13.748.549 9.656 8.243 17.067 17.178 16.559 8.935-.508 15.736-8.743 15.187-18.4Z",
5985
+ fill: "#F2F2F2"
5986
+ }), /*#__PURE__*/React.createElement("path", {
5987
+ d: "M110.402 107.707c-1.129 7.958-7.271 14.228-15.027 14.665-8.39.477-15.683-6.034-16.995-14.821a15.77 15.77 0 0 0-.183 3.533c.549 9.652 8.239 17.067 17.178 16.559 8.939-.508 15.736-8.742 15.174-18.399a14.03 14.03 0 0 0-.147-1.537Z",
5988
+ fill: "#E6E6E6"
5989
+ }), /*#__PURE__*/React.createElement("path", {
5990
+ d: "M100.76 105.262H88a.66.66 0 0 0-.66.66v1.871c0 .365.296.66.66.66h12.76a.66.66 0 0 0 .66-.66v-1.871a.66.66 0 0 0-.66-.66Zm0 5.512H88a.66.66 0 0 0-.66.66v1.871c0 .364.296.66.66.66h12.76a.66.66 0 0 0 .66-.66v-1.871a.66.66 0 0 0-.66-.66Zm0 5.505H88a.66.66 0 0 0-.66.66v1.871c0 .364.296.66.66.66h12.76a.66.66 0 0 0 .66-.66v-1.871a.66.66 0 0 0-.66-.66Z",
5991
+ fill: "#3690EA"
5992
+ }), /*#__PURE__*/React.createElement("path", {
5993
+ d: "M133.43 107.146c5.688-4.463 7.529-11.6 4.111-15.943-3.417-4.343-10.799-4.245-16.487.218-5.688 4.463-7.529 11.601-4.111 15.943 3.417 4.343 10.799 4.245 16.487-.218Z",
5994
+ fill: "#F2F2F2"
5995
+ }), /*#__PURE__*/React.createElement("path", {
5996
+ d: "M136.74 95.34c-3.418-4.344-10.8-4.246-16.486.22a15.744 15.744 0 0 0-5.034 6.683c-.031-3.725 2.035-7.87 5.802-10.837 5.69-4.456 13.072-4.559 16.491-.218 1.972 2.508 2.182 5.953.919 9.273a8.246 8.246 0 0 0-1.692-5.12Z",
5997
+ fill: "#E6E6E6"
5998
+ }), /*#__PURE__*/React.createElement("path", {
5999
+ d: "M127.405 89.78c1.87.546 3.824.751 5.766.605v0a16.153 16.153 0 0 0 9.056-3.631",
6000
+ strokeWidth: "13.63",
6001
+ strokeMiterlimit: "10",
6002
+ strokeLinecap: "round",
6003
+ stroke: "#333"
6004
+ }), /*#__PURE__*/React.createElement("path", {
6005
+ d: "M79.875 85.766c2.25-7.476-.567-14.93-6.293-16.649-5.727-1.718-12.194 2.949-14.444 10.425-2.251 7.476.567 14.93 6.293 16.648 5.727 1.719 12.194-2.948 14.444-10.424Z",
6006
+ fill: "#F2F2F2"
6007
+ }), /*#__PURE__*/React.createElement("path", {
6008
+ d: "M69.713 71.558c5.726 1.72 8.542 9.175 6.293 16.652a16.978 16.978 0 0 1-4.74 7.687c3.767-1.435 7.141-5.151 8.627-10.12 2.232-7.477-.567-14.932-6.293-16.648-3.311-.993-6.863.152-9.706 2.736 1.85-.75 3.9-.858 5.82-.307Z",
6009
+ fill: "#E6E6E6"
6010
+ }), /*#__PURE__*/React.createElement("path", {
6011
+ d: "M77.006 68.04a6.195 6.195 0 0 1-4.269-1.866 6.176 6.176 0 0 1 0-8.623 6.195 6.195 0 0 1 4.27-1.867",
6012
+ strokeWidth: "13.63",
6013
+ strokeMiterlimit: "10",
6014
+ strokeLinecap: "round",
6015
+ stroke: "#333"
6016
+ }), /*#__PURE__*/React.createElement("path", {
6017
+ d: "M81.567 54.262c-.103.03-.205.07-.303.106l-.304.112-.303.111-.3.112-.303.111c-.103.031-.2.071-.303.111-.103.04-.201.072-.304.108l-.299.11-.303.112-.304.112c-.102.03-.2.071-.303.111l-.3.107-.303.111-.303.112-.304.111c-.098.031-.2.072-.299.112-.098.04-.205.07-.303.111-.099.04-.201.071-.304.107l-.299.111-.303.112a5.63 5.63 0 0 0-3.824 4.578 5.62 5.62 0 0 0 1.101 4.178 5.578 5.578 0 0 0 2.754 1.956l.303.112.304.111.308.112.303.11.304.112.303.112.304.111.303.112.308.111.304.111.303.112.304.111c.102.036.2.076.303.107l.308.116c.098.036.2.076.303.107.103.031.201.08.304.111.103.031.2.08.303.112.103.03.201.08.304.111.103.031.2.08.303.111.103.032.206.08.308.112a8.12 8.12 0 0 0 10.027-3.863 8.087 8.087 0 0 0-2.619-10.407 8.117 8.117 0 0 0-7.479-.88v.004Z",
6018
+ fill: "#2278D6"
6019
+ }), /*#__PURE__*/React.createElement("path", {
6020
+ d: "M97.105 47.237c-.192.062-.389.138-.58.21-.193.07-.393.142-.585.213-.192.072-.389.138-.585.214-.196.076-.388.138-.58.214-.192.076-.393.138-.585.214-.192.076-.388.138-.584.214-.197.076-.389.138-.585.214-.197.075-.388.138-.58.214-.192.075-.389.138-.585.213-.196.076-.388.139-.585.21-.196.071-.388.143-.58.214-.192.071-.392.138-.584.214-.192.075-.389.138-.585.214-.196.075-.388.138-.585.213-.196.076-.388.139-.58.214-.192.076-.393.139-.585.214-.191.076-.388.138-.584.214-.197.076-.389.138-.585.214-.196.076-.388.134-.58.21-.192.075-.388.138-.585.213a10.762 10.762 0 0 0-3.146 1.65 10.844 10.844 0 0 0-1.674 15.763 10.879 10.879 0 0 0 4.883 3.233c.196.075.388.151.589.213.2.063.388.152.585.214.196.063.392.152.589.219.196.067.388.147.584.214l.59.213c.196.076.388.152.589.214.2.063.388.152.584.214.197.063.388.152.59.214.2.063.388.152.584.219.196.066.388.147.59.213.2.067.387.148.584.214.196.067.388.147.589.214.2.067.388.152.584.214.197.063.393.152.59.214.196.062.388.151.584.218l.59.214c.196.072.388.147.584.214.196.067.393.147.59.214.196.067.387.151.588.214.201.062.388.151.585.214a15.669 15.669 0 0 0 14.439-1.806 15.624 15.624 0 0 0 6.706-12.895 15.597 15.597 0 0 0-1.829-7.256 15.659 15.659 0 0 0-19.454-7.244Z",
6021
+ fill: "#3690EA"
6022
+ }), /*#__PURE__*/React.createElement("path", {
6023
+ d: "M119.065 37.388a25.93 25.93 0 0 0-.978.356c-.326.125-.651.232-.977.357-.326.125-.652.232-.978.356-.325.125-.651.232-.977.361-.326.13-.652.232-.977.357-.326.125-.652.232-.978.356-.326.125-.656.232-.977.357-.322.125-.656.232-.978.36-.321.13-.651.228-.977.357-.326.13-.656.232-.977.357-.322.124-.656.231-.978.356-.321.125-.656.232-.977.357-.321.125-.656.231-.977.36-.322.13-.657.228-.978.357-.321.13-.656.232-.977.357-.322.124-.656.231-.978.356-.321.125-.656.232-.982.361-.325.13-.651.227-.977.357-.326.129-.651.227-.973.356-.321.13-.656.232-.982.357a18.217 18.217 0 0 0-7.281 4.523A18.158 18.158 0 0 0 90.716 72.8a18.097 18.097 0 0 0 8.926 6.314c.326.13.651.254.986.361.335.107.652.254.982.361.33.107.652.25.986.36.335.112.647.25.982.357.335.107.652.254.982.361.33.107.652.25.986.361.335.112.652.25.982.357.33.107.652.254.986.36.335.108.648.25.982.362.335.111.652.25.982.356.33.107.652.254.986.361.335.107.652.25.982.361.331.111.652.25.982.357.33.106.656.253.986.36.331.107.652.254.982.361.331.107.652.25.987.361.334.112.651.25.981.357.331.107.652.254.987.36.334.108.647.25.982.362.334.111.651.25.981.356a26.26 26.26 0 0 0 24.2-3.02 26.2 26.2 0 0 0 8.29-9.42 26.147 26.147 0 0 0-.114-24.35 26.194 26.194 0 0 0-8.377-9.343 26.244 26.244 0 0 0-24.226-2.795l-.022.009Z",
6024
+ fill: "#50B0FF"
6025
+ }), /*#__PURE__*/React.createElement("path", {
6026
+ d: "M128.994 80.692a18.926 18.926 0 0 1-11.736-4.091 18.853 18.853 0 0 1-5.352-22.825 18.889 18.889 0 0 1 8.696-8.867 18.93 18.93 0 0 1 22.967 4.864 18.856 18.856 0 0 1 .514 23.437 18.738 18.738 0 0 1-6.655 5.529 18.772 18.772 0 0 1-8.434 1.953Z",
6027
+ fill: "#D6DEE5"
6028
+ }), /*#__PURE__*/React.createElement("path", {
6029
+ d: "M129.021 45.14a16.719 16.719 0 0 1 10.373 3.604 16.67 16.67 0 0 1 5.887 9.258 16.65 16.65 0 0 1-1.144 10.906 16.687 16.687 0 0 1-7.681 7.838 16.724 16.724 0 0 1-10.896 1.38 16.704 16.704 0 0 1-9.398-5.675 16.657 16.657 0 0 1-.449-20.708 16.64 16.64 0 0 1 13.322-6.604h-.014Zm.014-4.417a21.143 21.143 0 0 0-13.684 5.01 21.066 21.066 0 0 0-4.43 26.958 21.12 21.12 0 0 0 11.363 9.113 21.153 21.153 0 0 0 14.569-.404 21.113 21.113 0 0 0 10.84-9.728 21.063 21.063 0 0 0 1.948-14.422 21.086 21.086 0 0 0-7.869-12.249 20.973 20.973 0 0 0-12.737-4.278Z",
6030
+ fill: "#1B64CE"
6031
+ }), /*#__PURE__*/React.createElement("path", {
6032
+ d: "M131.495 67.397c4.287 0 7.762-3.47 7.762-7.749 0-4.28-3.475-7.75-7.762-7.75-4.286 0-7.761 3.47-7.761 7.75 0 4.28 3.475 7.75 7.761 7.75Z",
6033
+ fill: "#fff"
6034
+ }), /*#__PURE__*/React.createElement("path", {
6035
+ d: "M137.039 56.638a3.996 3.996 0 0 0 3.999-3.993 3.996 3.996 0 0 0-3.999-3.992 3.996 3.996 0 0 0-3.999 3.992 3.996 3.996 0 0 0 3.999 3.993Z",
6036
+ fill: "#fff"
6037
+ }), /*#__PURE__*/React.createElement("mask", {
6038
+ id: `${id}-a`,
6039
+ style: {
6040
+ maskType: "alpha"
6041
+ },
6042
+ maskUnits: "userSpaceOnUse",
6043
+ x: "90",
6044
+ y: "96",
6045
+ width: "9",
6046
+ height: "4"
6047
+ }, /*#__PURE__*/React.createElement("path", {
6048
+ d: "M94.651 96.461c-1.785 0-3.26-.038-3.78-.038v2.897h7.14v-2.897c-.371 0-1.574.038-3.36.038Z",
6049
+ fill: "#000"
6050
+ })), /*#__PURE__*/React.createElement("g", {
6051
+ mask: `url(#${id}-a)`
6052
+ }, /*#__PURE__*/React.createElement("path", {
6053
+ d: "M94.51 95.545c-1.732.049-3.124.25-3.124.494v2.617c0 .245 1.392.446 3.124.495 1.731.049 3.124-.138 3.124-.384v-2.839c0-.245-1.393-.432-3.124-.383Z",
6054
+ fill: "#999"
6055
+ })));
6056
+ }
6057
+
6058
+ var styles$b = {"spinner":"spinner-b5tlz"};
6059
+
6060
+ function LoadingSpinner({
6061
+ size = 48,
6062
+ trackWidth = 6
6063
+ }) {
6064
+ return /*#__PURE__*/React.createElement("span", {
6065
+ "aria-hidden": "true",
6066
+ className: styles$b.spinner,
6067
+ style: {
6068
+ "--spinner-size": `${size}px`,
6069
+ "--spinner-track-width": `${trackWidth}px`
6070
+ }
6071
+ });
6072
+ }
4371
6073
 
4372
6074
  function SearchResults({
4373
6075
  label,
@@ -4388,18 +6090,36 @@ function SearchResults({
4388
6090
  ...navigation
4389
6091
  });
4390
6092
  }
4391
- return /*#__PURE__*/React.createElement("p", {
4392
- role: "status"
4393
- }, "Searching\u2026");
6093
+ return /*#__PURE__*/React.createElement(tapestry.Flex, {
6094
+ role: "status",
6095
+ justify: "center",
6096
+ align: "center",
6097
+ gap: 2,
6098
+ direction: "column",
6099
+ style: {
6100
+ color: "var(--t-text-color-placeholder)",
6101
+ fontSize: "var(--t-font-size-md)",
6102
+ marginTop: 48
6103
+ }
6104
+ }, /*#__PURE__*/React.createElement(LoadingSpinner, {
6105
+ size: 40,
6106
+ trackWidth: 5
6107
+ }), "Searching\u2026");
4394
6108
  case "error":
4395
- return /*#__PURE__*/React.createElement("p", {
4396
- role: "alert"
4397
- }, "Search isn\u2019t working right now. Try again.");
6109
+ return /*#__PURE__*/React.createElement(BlankState$1, {
6110
+ image: /*#__PURE__*/React.createElement(BlankStateError, null),
6111
+ role: "alert",
6112
+ subtitle: "Try again in a moment.",
6113
+ title: "Search isn\u2019t working right now"
6114
+ });
4398
6115
  case "done":
4399
6116
  if (sections.length === 0) {
4400
- return /*#__PURE__*/React.createElement("p", {
4401
- role: "status"
4402
- }, "No results for \u201C", term.trim(), "\u201D");
6117
+ // The panel's result count announces this, so it isn't read twice.
6118
+ return /*#__PURE__*/React.createElement(BlankState$1, {
6119
+ image: /*#__PURE__*/React.createElement(BlankStateNoResults, null),
6120
+ subtitle: "Clear search and try again.",
6121
+ title: `No results for “${term.trim()}”`
6122
+ });
4403
6123
  }
4404
6124
  return /*#__PURE__*/React.createElement(ResultListbox, {
4405
6125
  busy: false,
@@ -4414,31 +6134,43 @@ function SearchResults({
4414
6134
  // stays put as more recents load and as their lookups answer.
4415
6135
  const RECENTS = "recents";
4416
6136
  function SearchPanel({
6137
+ appName,
6138
+ mobile = false,
4417
6139
  env,
6140
+ onClose,
6141
+ onOpenResult,
4418
6142
  products
4419
6143
  }) {
4420
6144
  var _a, _b;
4421
6145
  const listboxId = useInstanceId("product-search-results");
4422
6146
  const [term, setTerm] = React.useState("");
4423
- const [selectedSlug, setSelectedSlug] = React.useState(() => initialProduct(products).slug);
6147
+ const [selectedSlug, setSelectedSlug] = React.useState(() => defaultProduct(products, appName).slug);
4424
6148
  const product = (_a = products.find(({
4425
6149
  slug
4426
6150
  }) => slug === selectedSlug)) !== null && _a !== void 0 ? _a : products[0];
4427
6151
  const hasTerm = term.trim() !== "";
4428
6152
  const search = useProductSearch(product.slug, term);
4429
6153
  const groups = "groups" in search ? search.groups : undefined;
4430
- const sections = React.useMemo(() => groupSections(groups), [groups]);
6154
+ const {
6155
+ organizationTimeZone
6156
+ } = useStore();
6157
+ const sections = React.useMemo(() => groupSections(groups, organizationTimeZone), [groups, organizationTimeZone]);
4431
6158
  const {
4432
6159
  visits,
4433
6160
  ...recents
4434
6161
  } = useRecentVisits(env);
4435
- const recentItems = visits.map(visitItem);
6162
+ const recentItems = visits.map(visit => visitItem(visit, organizationTimeZone));
4436
6163
  const items = hasTerm ? sections.flatMap(section => section.items) : recentItems;
4437
- const navigation = useResultNavigation(items, hasTerm ? sections : RECENTS);
6164
+ // Phones open results by tapping them, with no highlight to arrow through.
6165
+ // A narrow window with a keyboard and mouse keeps both, as does the desktop
6166
+ // layout on a touch device, whose keyboard hints still advertise them.
6167
+ const touchOnly = useMediaQuery("(hover: none) and (pointer: coarse)");
6168
+ const navigation = useResultNavigation(items, hasTerm ? sections : RECENTS, !(mobile && touchOnly));
4438
6169
  const {
4439
6170
  highlightedIndex
4440
6171
  } = navigation;
4441
6172
  const inputRef = React.useRef(null);
6173
+ const resultCount = useAnnouncement(hasTerm && search.status === "done" ? `${items.length === 0 ? "No results" : `${items.length} ${items.length === 1 ? "result" : "results"}`} for “${term.trim()}” in ${product.appName}` : null);
4442
6174
  const [announceHighlight, setAnnounceHighlight] = React.useState(false);
4443
6175
  // The tabs keep focus while arrowing through results, but only the focused
4444
6176
  // input can point screen readers at the highlight, so from the tabs it's
@@ -4454,41 +6186,50 @@ function SearchPanel({
4454
6186
  navigation.handleKeyDown(event);
4455
6187
  }
4456
6188
  };
4457
- React.useEffect(() => {
4458
- if (hasTerm) saveLastProduct(product.slug);
4459
- }, [hasTerm, product.slug]);
6189
+ const results = hasTerm ? (/*#__PURE__*/React.createElement(SearchResults, {
6190
+ highlightedIndex: highlightedIndex,
6191
+ id: listboxId,
6192
+ label: `Results from Planning Center ${product.appName}`,
6193
+ onHighlight: navigation.highlightIndex,
6194
+ onOpen: onOpenResult,
6195
+ sections: sections,
6196
+ status: search.status,
6197
+ term: term
6198
+ })) : (/*#__PURE__*/React.createElement(RecentlyVisited, {
6199
+ highlightedIndex: highlightedIndex,
6200
+ id: listboxId,
6201
+ items: recentItems,
6202
+ onHighlight: navigation.highlightIndex,
6203
+ onOpen: onOpenResult,
6204
+ ...recents
6205
+ }));
4460
6206
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(SearchInput, {
4461
6207
  expanded: items.length > 0,
4462
6208
  highlightedIndex: highlightedIndex,
4463
6209
  inputRef: inputRef,
4464
6210
  listboxId: listboxId,
4465
6211
  onChange: setTerm,
6212
+ onClose: onClose,
4466
6213
  onFocus: () => setAnnounceHighlight(false),
4467
6214
  onKeyDown: navigation.handleKeyDown,
4468
6215
  value: term
4469
- }), /*#__PURE__*/React.createElement(ProductTabs, {
6216
+ }), mobile ? (/*#__PURE__*/React.createElement(ProductSelect, {
6217
+ onSelect: setSelectedSlug,
6218
+ products: products,
6219
+ selected: product
6220
+ }, results)) : (/*#__PURE__*/React.createElement(ProductTabs, {
4470
6221
  onKeyDown: handleTabsKeyDown,
4471
6222
  onSelect: setSelectedSlug,
4472
6223
  products: products,
4473
6224
  selected: product
4474
- }, hasTerm ? (/*#__PURE__*/React.createElement(SearchResults, {
4475
- highlightedIndex: highlightedIndex,
4476
- id: listboxId,
4477
- label: `${product.appName} results`,
4478
- onHighlight: navigation.highlightIndex,
4479
- sections: sections,
4480
- status: search.status,
4481
- term: term
4482
- })) : (/*#__PURE__*/React.createElement(RecentlyVisited, {
4483
- highlightedIndex: highlightedIndex,
4484
- id: listboxId,
4485
- items: recentItems,
4486
- onHighlight: navigation.highlightIndex,
4487
- ...recents
4488
- }))), /*#__PURE__*/React.createElement("div", {
6225
+ }, results)), /*#__PURE__*/React.createElement("div", {
4489
6226
  "aria-live": "polite",
4490
- className: styles$b.visuallyHidden
4491
- }, announceHighlight ? (_b = navigation.highlighted) === null || _b === void 0 ? void 0 : _b.title : null), /*#__PURE__*/React.createElement(KeyboardHints, {
6227
+ className: styles$k.visuallyHidden
6228
+ }, announceHighlight ? (_b = navigation.highlighted) === null || _b === void 0 ? void 0 : _b.title : null), /*#__PURE__*/React.createElement("div", {
6229
+ "aria-live": "polite",
6230
+ className: styles$k.visuallyHidden,
6231
+ "data-testid": "result-count"
6232
+ }, resultCount), mobile ? null : /*#__PURE__*/React.createElement(KeyboardHints, {
4492
6233
  copied: navigation.copied
4493
6234
  }));
4494
6235
  }
@@ -4559,32 +6300,6 @@ function useSearchShortcut(enabled, open, setOpen) {
4559
6300
  }, [enabled, open, setOpen]);
4560
6301
  }
4561
6302
 
4562
- const SEARCHABLE_PRODUCTS = [{
4563
- appName: "Calendar",
4564
- slug: "calendar"
4565
- }, {
4566
- appName: "Check-Ins",
4567
- slug: "check-ins"
4568
- }, {
4569
- appName: "Giving",
4570
- slug: "giving"
4571
- }, {
4572
- appName: "Groups",
4573
- slug: "groups"
4574
- }, {
4575
- appName: "People",
4576
- slug: "people"
4577
- }, {
4578
- appName: "Publishing",
4579
- slug: "publishing"
4580
- }, {
4581
- appName: "Registrations",
4582
- slug: "registrations"
4583
- }, {
4584
- appName: "Services",
4585
- slug: "services"
4586
- }];
4587
-
4588
6303
  const PERMISSION_CHECKS = {
4589
6304
  "check-ins": () => fetchMe("check-ins", "permission").then(({
4590
6305
  permission
@@ -4689,24 +6404,60 @@ function inSwitcherOrder(apps) {
4689
6404
  return groupApps(apps).restProducts.flatMap(app => SEARCHABLE_PRODUCTS.filter(product => product.appName === app.name));
4690
6405
  }
4691
6406
 
6407
+ /**
6408
+ * Writes the height of the visible part of the page to the parent of `ref`'s
6409
+ * element as `--visual-viewport-height`. It shrinks when an on-screen keyboard
6410
+ * opens; `100dvh` doesn't, since mobile Safari draws the keyboard over it.
6411
+ */
6412
+ function useVisualViewportHeight(ref, enabled) {
6413
+ React.useEffect(() => {
6414
+ var _a;
6415
+ const viewport = window.visualViewport;
6416
+ const parent = (_a = ref.current) === null || _a === void 0 ? void 0 : _a.parentElement;
6417
+ if (!enabled || !viewport || !parent) return undefined;
6418
+ const update = () => parent.style.setProperty("--visual-viewport-height", `${viewport.height}px`);
6419
+ update();
6420
+ viewport.addEventListener("resize", update);
6421
+ return () => {
6422
+ viewport.removeEventListener("resize", update);
6423
+ parent.style.removeProperty("--visual-viewport-height");
6424
+ };
6425
+ }, [enabled, ref]);
6426
+ }
6427
+
4692
6428
  function ProductSearch({
6429
+ appName,
4693
6430
  apps,
6431
+ mobile = false,
4694
6432
  env
4695
6433
  }) {
4696
6434
  const searchable = useSearchableProducts(apps);
4697
6435
  const [open, setOpen] = React.useState(false);
6436
+ const modalRef = React.useRef(null);
6437
+ // Sizes Tapestry's modal frame, the dialog's parent, to fit above the keyboard.
6438
+ useVisualViewportHeight(modalRef, mobile && open);
4698
6439
  const available = searchable.status === "done" && searchable.products.length > 0;
4699
6440
  useSearchShortcut(available, open, setOpen);
4700
6441
  if (!available) return null;
4701
6442
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(SearchButton, {
6443
+ mobile: mobile,
4702
6444
  onClick: () => setOpen(true)
4703
6445
  }), /*#__PURE__*/React.createElement(tapestry.Modal, {
4704
6446
  "aria-label": "Search",
6447
+ className: styles$k.modal,
4705
6448
  dismissible: true,
6449
+ id: "product_search_modal",
4706
6450
  onClose: () => setOpen(false),
4707
- open: open
6451
+ open: open,
6452
+ ref: modalRef,
6453
+ size: "lg"
4708
6454
  }, /*#__PURE__*/React.createElement(SearchPanel, {
6455
+ appName: appName,
6456
+ mobile: mobile,
4709
6457
  env: env,
6458
+ // Phones have no Esc, so mobile search gets a close button.
6459
+ onClose: mobile ? () => setOpen(false) : undefined,
6460
+ onOpenResult: () => setOpen(false),
4710
6461
  products: searchable.products
4711
6462
  })));
4712
6463
  }
@@ -5000,6 +6751,7 @@ const NotSmallTopbar = ({
5000
6751
  margin: "auto"
5001
6752
  }
5002
6753
  }), !notificationsEnabled && notifications(), productSearchEnabled ? (/*#__PURE__*/React.createElement(ProductSearch, {
6754
+ appName: props.appName,
5003
6755
  apps: props.apps,
5004
6756
  env: props.env
5005
6757
  })) : search({
@@ -32914,7 +34666,7 @@ ClientStorage.defaultProps = {
32914
34666
  method: "localStorage"
32915
34667
  };
32916
34668
 
32917
- var styles$6 = {"appmenu-button":"appmenu-button-b0UvT","appmenu-layer":"appmenu-layer-0IQpN","appmenu-container":"appmenu-container-gackd","appmenu-scroll":"appmenu-scroll-mPSx0","appmenu-list":"appmenu-list-h7clX","appmenu-list-a":"appmenu-list-a-rGIQN","appmenu-list-a--top":"appmenu-list-a--top-RT-2F","appmenu-list-a--bottom":"appmenu-list-a--bottom-YDeBC","appmenu-close-button":"appmenu-close-button-vv9bV","current-route":"current-route-wpJgz","is-active":"is-active-wy8Bg","routes":"routes-Nmt1S","route":"route-kkknQ","profile-button":"profile-button-a2WO2"};
34669
+ var styles$6 = {"appmenu-button":"appmenu-button-b0UvT","appmenu-layer":"appmenu-layer-0IQpN","appmenu-container":"appmenu-container-gackd","appmenu-scroll":"appmenu-scroll-mPSx0","appmenu-list":"appmenu-list-h7clX","appmenu-list-a":"appmenu-list-a-rGIQN","appmenu-list-a--top":"appmenu-list-a--top-RT-2F","appmenu-list-a--bottom":"appmenu-list-a--bottom-YDeBC","appmenu-close-button":"appmenu-close-button-vv9bV","current-route":"current-route-wpJgz","actions":"actions-INQ7-","is-active":"is-active-wy8Bg","routes":"routes-Nmt1S","route":"route-kkknQ","profile-button":"profile-button-a2WO2"};
32918
34670
 
32919
34671
  function AccountSettingsLink({
32920
34672
  env
@@ -33134,7 +34886,14 @@ const SmallTopbar = ({
33134
34886
  setProductSwitcherVisible(false);
33135
34887
  setRoutesMenuVisible(visible => !visible);
33136
34888
  } : null
33137
- }, /*#__PURE__*/React.createElement(CurrentRouteComponent, null, capitalize$1(currentRouteText)), props.routes.length > 0 && /*#__PURE__*/React.createElement(DisclosureChevronIcon, null)), /*#__PURE__*/React.createElement("button", {
34889
+ }, /*#__PURE__*/React.createElement(CurrentRouteComponent, null, capitalize$1(currentRouteText)), props.routes.length > 0 && /*#__PURE__*/React.createElement(DisclosureChevronIcon, null)), /*#__PURE__*/React.createElement("div", {
34890
+ className: styles$6["actions"]
34891
+ }, productSearchEnabled && (/*#__PURE__*/React.createElement(ProductSearch, {
34892
+ appName: props.appName,
34893
+ apps: props.apps,
34894
+ mobile: true,
34895
+ env: props.env
34896
+ })), /*#__PURE__*/React.createElement("button", {
33138
34897
  type: "button",
33139
34898
  className: styles$6["profile-button"],
33140
34899
  onClick: () => {
@@ -33145,7 +34904,7 @@ const SmallTopbar = ({
33145
34904
  }, /*#__PURE__*/React.createElement(Avatar, {
33146
34905
  env: props.env,
33147
34906
  url: props.userAvatarPath
33148
- })));
34907
+ }))));
33149
34908
  };
33150
34909
  const SmallRoute = ({
33151
34910
  active,
@@ -33635,38 +35394,6 @@ const SwitchView = ({
33635
35394
  }));
33636
35395
  };
33637
35396
 
33638
- const collections = {
33639
- general: general__namespace,
33640
- toolbar: toolbar__namespace
33641
- };
33642
- const paths = collections;
33643
- function Icon({
33644
- name,
33645
- size = 16,
33646
- style,
33647
- theme,
33648
- title,
33649
- ...props
33650
- }) {
33651
- const [collection, symbol] = name.split(".");
33652
- return /*#__PURE__*/React.createElement("svg", {
33653
- "aria-hidden": title ? undefined : true,
33654
- fill: "currentColor",
33655
- height: size,
33656
- role: title ? "img" : undefined,
33657
- style: {
33658
- color: theme && `var(${theme})`,
33659
- flexShrink: 0,
33660
- ...style
33661
- },
33662
- viewBox: "0 0 16 16",
33663
- width: size,
33664
- ...props
33665
- }, title && /*#__PURE__*/React.createElement("title", null, title), /*#__PURE__*/React.createElement("path", {
33666
- d: paths[collection][symbol]
33667
- }));
33668
- }
33669
-
33670
35397
  var styles$3 = {"color-mode-switcher":"color-mode-switcher-JpczO","color-mode-switcher-label":"color-mode-switcher-label-3jPM2","color-mode-switcher-modes":"color-mode-switcher-modes-u-bic"};
33671
35398
 
33672
35399
  const COLOR_MODES = [{
@@ -34879,9 +36606,9 @@ function HelpdeskComponent({
34879
36606
  const Helpdesk = {
34880
36607
  component: HelpdeskComponent,
34881
36608
  icons: {
34882
- staticDotPath: "",
34883
- staticPath: "M16 10C14.9391 10 13.9217 10.4214 13.1716 11.1716C12.4214 11.9217 12 12.9391 12 14H14C14 13.4696 14.2107 12.9609 14.5858 12.5858C14.9609 12.2107 15.4696 12 16 12C16.5304 12 17.0391 12.2107 17.4142 12.5858C17.7893 12.9609 18 13.4696 18 14C18 16 15 15.75 15 19H17C17 16.75 20 16.5 20 14C20 12.9391 19.5786 11.9217 18.8284 11.1716C18.0783 10.4214 17.0609 10 16 10ZM16 24C14.4178 24 12.871 23.5308 11.5554 22.6518C10.2399 21.7727 9.21447 20.5233 8.60897 19.0615C8.00347 17.5997 7.84504 15.9911 8.15372 14.4393C8.4624 12.8874 9.22433 11.462 10.3432 10.3431C11.462 9.22433 12.8874 8.4624 14.4393 8.15372C15.9911 7.84504 17.5997 8.00346 19.0615 8.60896C20.5233 9.21446 21.7727 10.2398 22.6518 11.5554C23.5308 12.871 24 14.4177 24 16C23.9974 18.1209 23.1537 20.1542 21.6539 21.6539C20.1542 23.1537 18.1209 23.9974 16 24ZM16 6C14.0222 6 12.0888 6.58649 10.4443 7.6853C8.79981 8.78412 7.51809 10.3459 6.76121 12.1732C6.00433 14.0004 5.8063 16.0111 6.19215 17.9509C6.578 19.8907 7.53041 21.6725 8.92894 23.0711C10.3275 24.4696 12.1093 25.422 14.0491 25.8079C15.9889 26.1937 17.9996 25.9957 19.8268 25.2388C21.6541 24.4819 23.2159 23.2002 24.3147 21.5557C25.4135 19.9112 26 17.9778 26 16C26 13.3478 24.9464 10.8043 23.0711 8.92893C21.1957 7.05357 18.6522 6 16 6V6ZM15 22H17V20H15V22Z"
36609
+ path: "M16.9997 19.9977v1.9992h-1.9975v-1.9992z m-0.9987-9.9937c1.0595 0.0001 2.0774 0.4207 2.8266 1.1699 0.7492 0.7508 1.1698 1.7671 1.17 2.8266 0 2.4989-2.9979 2.7488-2.9979 4.9969h-1.9975c0-3.2467 2.9978-2.9981 2.9978-4.9969-0.0001-0.5289-0.2112-1.0388-0.5857-1.4133-0.3746-0.3746-0.8828-0.5856-1.4133-0.5857-0.5304 0-1.0387 0.2114-1.4134 0.5857-0.3746 0.3746-0.5856 0.8844-0.5857 1.4133h-1.9991c0.0001-1.0595 0.4222-2.0758 1.1715-2.8266 0.7493-0.7491 1.7672-1.1699 2.8267-1.1699z m0-3.9966c2.6499 0.0001 5.1917 1.0523 7.0651 2.9271 1.8748 1.8733 2.927 4.4151 2.9271 7.0651 0 1.9762-0.5853 3.9094-1.6835 5.5528-1.0983 1.6418-2.6583 2.9236-4.485 3.6794-1.8249 0.7574-3.835 0.9542-5.7726 0.5684-1.9392-0.3859-3.7204-1.3366-5.1178-2.734-1.3974-1.3974-2.3496-3.1785-2.7355-5.1178-0.3858-1.9376-0.1873-3.9477 0.57-5.7726 0.7558-1.8267 2.0375-3.3867 3.6809-4.485 1.6418-1.0982 3.575-1.6834 5.5513-1.6834z m3.059 2.6068c-1.4616-0.6045-3.07-0.7641-4.62-0.4554-1.5499 0.3088-2.9749 1.07-4.0923 2.1891-1.119 1.1175-1.8788 2.5424-2.1876 4.0923-0.3087 1.5501-0.1508 3.1583 0.4539 4.62 0.6045 1.4598 1.6294 2.7072 2.9444 3.5868 1.3154 0.878 2.8618 1.3458 4.4426 1.3458 2.1192-0.0018 4.1516-0.846 5.6486-2.3446 1.4985-1.4971 2.3429-3.5294 2.3445-5.6486 0-1.5806-0.4679-3.1257-1.3458-4.441-0.8796-1.3154-2.1283-2.3398-3.5883-2.9444z"
34884
36610
  },
36611
+ label: "Help and Support",
34885
36612
  name: "Helpdesk",
34886
36613
  storageExemptPaths: ["email", "phone"]
34887
36614
  };
@@ -35154,13 +36881,15 @@ const useNotifications = ({
35154
36881
  return notification.data;
35155
36882
  }
35156
36883
  };
35157
- const updateStateFromJoltMessage = React.useCallback(message => {
36884
+ const updateStateFromJoltMessage = React.useCallback(async message => {
35158
36885
  try {
35159
36886
  const joltMessageNotificationDataPayload = extractPayloadFromJoltMessage(message);
35160
- fetchNotification(joltMessageNotificationDataPayload.data.id).then(resp => {
35161
- const notification = buildNotificationFromApiResponse(resp.data, resp);
35162
- setNotifications(notifications => [...notifications.filter(candidate => candidate.id !== notification.id), notification]);
35163
- });
36887
+ const resp = await fetchNotification(joltMessageNotificationDataPayload.data.id);
36888
+ if (!(resp === null || resp === void 0 ? void 0 : resp.data)) {
36889
+ return;
36890
+ }
36891
+ const notification = buildNotificationFromApiResponse(resp.data, resp);
36892
+ setNotifications(notifications => [...notifications.filter(candidate => candidate.id !== notification.id), notification]);
35164
36893
  } catch (exception) {
35165
36894
  console.error("topbar encountered error when updating state from jolt message", exception);
35166
36895
  }
@@ -35413,13 +37142,12 @@ function NotificationsComponent({
35413
37142
  const Notifications = {
35414
37143
  component: NotificationsComponent,
35415
37144
  icons: {
35416
- staticDotPath: "M18.2189 6.38867C17.5266 6.13717 16.7795 6 16.0003 6C12.4123 6 9.50363 8.90867 9.50363 12.4967V16.5862L6.54505 19.7387C5.34671 21.0156 6.25205 23.1069 8.0032 23.1069H13.3351C13.7865 24.1303 14.8101 24.8438 16.0002 24.8438C17.1903 24.8438 18.2139 24.1303 18.6653 23.1069H23.9974C25.7485 23.1069 26.6539 21.0156 25.4555 19.7387L22.497 16.5863V13.8102C21.7673 13.622 21.0914 13.2999 20.497 12.8718V16.9821V17.3778L20.7679 17.6664L23.9844 21.0938H8.01618L11.2328 17.6663L11.5036 17.3777V16.982V12.4967C11.5036 10.0132 13.5169 8 16.0003 8C16.7262 8 17.4118 8.17197 18.0188 8.47738C18.0064 8.31988 18.0001 8.16068 18.0001 8C18.0001 7.44181 18.0763 6.90141 18.2189 6.38867ZM8.00384 21.1069L8.0048 21.1059V21.1069H8.00384ZM23.9967 21.1069H23.9952V21.1053L23.9967 21.1069Z",
35417
- staticPath: "M16.0003 6C12.4122 6 9.50357 8.90867 9.50357 12.4967V16.5862L6.54499 19.7387C5.34665 21.0156 6.25199 23.1069 8.00314 23.1069H13.335C13.7864 24.1303 14.81 24.8438 16.0001 24.8438C17.1902 24.8438 18.2138 24.1303 18.6653 23.1069H23.9973C25.7484 23.1069 26.6538 21.0156 25.4554 19.7387L22.497 16.5863V12.4967C22.497 8.90867 19.5883 6 16.0003 6ZM11.5036 12.4967C11.5036 10.0132 13.5168 8 16.0003 8C18.4837 8 20.497 10.0132 20.497 12.4967V16.9821V17.3778L20.7678 17.6664L23.9843 21.0938H8.01612L11.2327 17.6663L11.5036 17.3777V16.982V12.4967ZM8.00474 21.1059L8.00378 21.1069H8.00474V21.1059ZM23.9952 21.1069H23.9966L23.9952 21.1053V21.1069Z"
37145
+ path: "M15.9991 6.0078c1.8733 0.0145 3.6659 0.7729 4.9811 2.1075 1.3154 1.3346 2.0464 3.1362 2.0353 5.011v4.4975l2.5078 2.9931c0.2489 0.2923 0.407 0.6509 0.4586 1.0318 0.0515 0.3809-0.0072 0.7691-0.1711 1.118-0.1528 0.3473-0.4041 0.6421-0.7225 0.8496-0.3182 0.2073-0.69 0.3173-1.0693 0.3156h-4.9781c-0.2428 0.6075-0.6612 1.13-1.2029 1.4981-0.5435 0.3666-1.1828 0.5622-1.8389 0.5622-0.6542 0-1.294-0.1957-1.8357-0.5622-0.4742-0.3221-0.8546-0.7629-1.104-1.275l-0.0989-0.2231h-4.9765c-0.3794 0.0032-0.7527-0.1068-1.071-0.314-0.32-0.2074-0.5712-0.5038-0.7239-0.8512-0.1623-0.3489-0.2226-0.7386-0.1712-1.1196 0.0515-0.3808 0.2111-0.7392 0.4585-1.0318l2.5095-2.9915v-4.4975c-0.0111-1.8733 0.7199-3.6764 2.0352-5.011 1.3136-1.3344 3.105-2.0912 4.978-2.1075z m-0.0047 1.9755c-0.6751 0.0001-1.344 0.1338-1.9677 0.3926-0.6239 0.2589-1.1901 0.6374-1.6677 1.115-0.4776 0.4776-0.8561 1.0438-1.1149 1.6677-0.2587 0.6237-0.3894 1.2926-0.3895 1.9677v4.8351c0 0.2395-0.0844 0.4731-0.2387 0.658l-2.712 3.2475 0.0801 0.1476h16.035l0.0768-0.1507-2.7213-3.246c-0.1544-0.1849-0.2388-0.4184-0.2388-0.6595v-4.832c0-0.6752-0.1338-1.3439-0.3925-1.9677-0.2573-0.6238-0.636-1.1902-1.1134-1.6677-0.4775-0.4775-1.0439-0.8561-1.6677-1.115-0.6239-0.2589-1.2939-0.3926-1.9677-0.3926z"
35418
37146
  },
35419
37147
  name: "Notifications"
35420
37148
  };
35421
37149
 
35422
- const SPARKLE_PATH = "M8.7824 18.8791C8.88371 18.5973 9.26996 18.5973 9.37127 18.8791L9.94256 20.465C10.0222 20.6863 10.1914 20.8616 10.4064 20.9435L11.6779 21.4269L11.9484 21.5304L11.9963 21.5539C12.2205 21.6839 12.2047 22.039 11.9484 22.1369L11.6779 22.2394L10.4064 22.7248C10.1915 22.8068 10.0222 22.9812 9.94256 23.2023L9.37127 24.7893L9.34881 24.8381C9.23098 25.054 8.92273 25.0539 8.80486 24.8381L8.7824 24.7893L8.2111 23.2023C8.14141 23.0088 8.0029 22.8513 7.82536 22.76L7.74723 22.7248L6.47573 22.2394L6.20522 22.1369C5.93172 22.0325 5.93164 21.6347 6.20522 21.5304L6.47476 21.4269L7.74723 20.9435C7.96226 20.8616 8.13147 20.6863 8.2111 20.465L8.7824 18.8791ZM17.5706 8.11138C17.8241 7.40747 18.7928 7.40734 19.0462 8.11138L20.472 12.0782C20.6711 12.6318 21.0952 13.0687 21.6331 13.2735L25.4867 14.7413C26.1711 15.002 26.1711 15.9983 25.4867 16.2589L21.6331 17.7267C21.0952 17.9316 20.6711 18.3684 20.472 18.922L19.2649 22.2785L19.0462 22.8889L18.9905 23.0119C18.6956 23.5517 17.9212 23.5515 17.6262 23.0119L17.5706 22.8889L17.3508 22.2795L16.1448 18.922C15.9457 18.3684 15.5206 17.9316 14.9827 17.7267L11.1291 16.2589C10.4449 15.9982 10.4449 15.0021 11.1291 14.7413L14.9827 13.2735C15.4533 13.0943 15.8379 12.7376 16.0598 12.2804L16.1448 12.0782L17.5706 8.11138ZM18.0266 12.755C17.6351 13.8438 16.7916 14.7249 15.6946 15.1427L14.7551 15.5001L15.6946 15.8575C16.7916 16.2753 17.6351 17.1564 18.0266 18.2453L18.3079 19.0275L18.5891 18.2453C18.9806 17.1564 19.8242 16.2753 20.9212 15.8575L21.8597 15.5001L20.9212 15.1427C19.8242 14.7249 18.9806 13.8439 18.5891 12.755L18.3079 11.9718L18.0266 12.755ZM8.7824 6.21097C8.88388 5.9297 9.26982 5.92966 9.37127 6.21097L9.94256 7.7979C10.0222 8.01911 10.1915 8.19346 10.4064 8.27544L11.6779 8.75982L11.8322 9.16607L11.9484 8.86334C12.2218 8.96779 12.2218 9.36542 11.9484 9.46979L11.6779 9.57233L10.4064 10.0567C10.1914 10.1387 10.0222 10.3139 9.94256 10.5352L9.37127 12.1212C9.26996 12.4029 8.88371 12.4029 8.7824 12.1212L8.2111 10.5352C8.14139 10.3415 8.00304 10.1832 7.82536 10.0919L7.74723 10.0567L6.47573 9.57233L6.20522 9.46979C5.9486 9.37195 5.93265 9.01568 6.15737 8.8858L6.20522 8.86334L7.74723 8.27544C7.96214 8.19346 8.13149 8.0191 8.2111 7.7979L8.69451 6.45413L8.7824 6.21097ZM11.9484 8.86334L11.8322 9.16607L11.6779 8.75982L11.9484 8.86334Z";
37150
+ const SPARKLE_PATH = "M9.2474 19.7799c0.2619-0.0002 0.4863 0.1883 0.5324 0.4459 0.0932 0.527 0.2872 0.904 0.5528 1.17 0.2659 0.2658 0.643 0.4594 1.1699 0.5527 0.2577 0.0457 0.447 0.2708 0.4475 0.5325-0.0001 0.2621-0.1893 0.4869-0.4475 0.5322-0.527 0.0928-0.9041 0.2872-1.1699 0.5529-0.2655 0.2656-0.4594 0.6427-0.5528 1.1698-0.0456 0.2583-0.2701 0.4477-0.5324 0.4475-0.2621-0.0002-0.4869-0.1893-0.5323-0.4475-0.0929-0.5274-0.2858-0.9058-0.5512-1.1714-0.2655-0.2653-0.6432-0.4585-1.1699-0.5513-0.2578-0.0457-0.4459-0.2705-0.446-0.5322 0.0005-0.2616 0.1883-0.4868 0.446-0.5325 0.5271-0.0933 0.9043-0.2856 1.1699-0.5512 0.2655-0.2658 0.4584-0.6442 0.5512-1.1715l0.0251-0.0926c0.077-0.2087 0.278-0.3531 0.5072-0.3533z m9.2369-9.6672c0.469 0 0.8756 0.3248 0.9799 0.7821 0.3678 1.6148 1.0327 2.8589 1.9599 3.7861 0.9272 0.9272 2.1714 1.5921 3.7861 1.9598 0.4573 0.1041 0.7818 0.5109 0.782 0.9799 0 0.4691-0.3247 0.8758-0.782 0.98-1.6146 0.3677-2.859 1.0324-3.7861 1.9597-0.9272 0.9275-1.5921 2.1725-1.9599 3.7878-0.104 0.4575-0.5107 0.782-0.9799 0.782-0.469 0-0.8758-0.3247-0.9799-0.782-0.3677-1.6153-1.0324-2.8602-1.9598-3.7878-0.9275-0.9274-2.1724-1.5921-3.7877-1.9597-0.4574-0.1042-0.782-0.5108-0.7821-0.98 0.0001-0.469 0.3247-0.8758 0.7821-0.9799 1.6155-0.3677 2.8602-1.0325 3.7877-1.9598 0.9274-0.9272 1.5921-2.1714 1.9598-3.7861 0.1042-0.4572 0.511-0.7819 0.9799-0.7821z m0 3.9228c-0.4094 0.7713-0.9141 1.4622-1.5185 2.0666-0.6047 0.6045-1.2964 1.1092-2.0682 1.5185 0.7718 0.4094 1.4635 0.914 2.0682 1.5186 0.6043 0.6042 1.1092 1.2954 1.5185 2.0666 0.4092-0.7712 0.9144-1.4624 1.5186-2.0666 0.6045-0.6046 1.2951-1.1107 2.0666-1.5201-0.7711-0.4093-1.4625-0.9128-2.0666-1.517-0.6043-0.6044-1.1092-1.2953-1.5186-2.0666z m-9.2369-7.2189c0.2594 0 0.4822 0.1849 0.5308 0.4397 0.1282 0.6719 0.3843 1.1692 0.7428 1.5279 0.3588 0.3588 0.8571 0.6145 1.5295 0.7428 0.2546 0.0485 0.4395 0.2716 0.4397 0.5308 0 0.2594-0.1849 0.4822-0.4397 0.5308-0.6725 0.1282-1.1707 0.3839-1.5295 0.7427-0.3589 0.3589-0.6146 0.8571-0.7428 1.5296-0.0486 0.2548-0.2714 0.4397-0.5308 0.4397-0.2592-0.0002-0.4822-0.1851-0.5307-0.4397-0.1282-0.6725-0.3842-1.1707-0.7428-1.5296-0.3585-0.3584-0.8552-0.6146-1.5264-0.7427-0.2548-0.0486-0.4397-0.2714-0.4397-0.5308 0.0002-0.2592 0.1851-0.4822 0.4397-0.5308 0.6714-0.1282 1.1679-0.3841 1.5264-0.7428 0.3585-0.3587 0.6145-0.8558 0.7428-1.5279 0.0485-0.2547 0.2716-0.4395 0.5307-0.4397z";
35423
37151
  // Helpdesk reads this context off the email path to open its email form the
35424
37152
  // same way a handoff inside its own drawer does.
35425
37153
  function emailPathWithContext(context = {}) {
@@ -35561,9 +37289,9 @@ function LoadError({
35561
37289
  const Picobot = {
35562
37290
  component: PicobotComponent,
35563
37291
  icons: {
35564
- staticDotPath: SPARKLE_PATH,
35565
- staticPath: SPARKLE_PATH
37292
+ path: SPARKLE_PATH
35566
37293
  },
37294
+ label: "Ask AI",
35567
37295
  name: "Picobot"
35568
37296
  };
35569
37297
 
@@ -35768,8 +37496,7 @@ function JoltEffectV1({
35768
37496
  const Tasks = {
35769
37497
  component: TasksComponent,
35770
37498
  icons: {
35771
- staticDotPath: "M18.3414 6H13.5C12.6716 6 12 6.67157 12 7.5V8H9C7.89543 8 7 8.89543 7 10V24C7 25.1046 7.89543 26 9 26H23C24.1046 26 25 25.1046 25 24V13.917C24.6748 13.9716 24.3407 14 24 14C23.6593 14 23.3252 13.9716 23 13.917V24H9L9 10H12V10.5C12 11.3284 12.6716 12 13.5 12H18.5C18.8029 12 19.0848 11.9102 19.3206 11.7558C18.4944 10.7277 18 9.4216 18 8C18 7.29873 18.1203 6.62556 18.3414 6ZM18 8H14V10H18V8ZM19.0556 14.1464C18.8603 13.9512 18.5437 13.9512 18.3485 14.1464L15.0724 17.4226L13.6642 16.0144C13.469 15.8192 13.1524 15.8192 12.9571 16.0144L11.9433 17.0282C11.7481 17.2235 11.7481 17.5401 11.9433 17.7353L14.7167 20.5088C14.8665 20.6585 15.0875 20.6934 15.2705 20.6135C15.3278 20.5892 15.3814 20.5536 15.4282 20.5069L20.0686 15.8665C20.2638 15.6713 20.2638 15.3547 20.0686 15.1594L19.0556 14.1464Z",
35772
- staticPath: "M14 8V10H18V8H14ZM13.5 6C12.6716 6 12 6.67157 12 7.5V8H9C7.89543 8 7 8.89543 7 10V24C7 25.1046 7.89543 26 9 26H23C24.1046 26 25 25.1046 25 24V10C25 8.89543 24.1046 8 23 8H20V7.5C20 6.67157 19.3284 6 18.5 6H13.5ZM20 10.5V10H23V24H9L9 10H12V10.5C12 11.3284 12.6716 12 13.5 12H18.5C19.3284 12 20 11.3284 20 10.5ZM18.3485 14.1464C18.5437 13.9512 18.8603 13.9512 19.0556 14.1464L20.0686 15.1594C20.2638 15.3547 20.2638 15.6713 20.0686 15.8665L15.4282 20.5069C15.3814 20.5536 15.3278 20.5892 15.2705 20.6135C15.0875 20.6934 14.8665 20.6585 14.7167 20.5088L11.9433 17.7353C11.7481 17.5401 11.7481 17.2235 11.9433 17.0282L12.9571 16.0144C13.1524 15.8192 13.469 15.8192 13.6642 16.0144L15.0724 17.4226L18.3485 14.1464Z"
37499
+ path: "M18.4215 14.5192c0.3756-0.4084 1.0126-0.4352 1.4212-0.0597 0.408 0.3755 0.4345 1.0111 0.0597 1.4196l-3.8537 4.1929c-0.358 0.389-0.957 0.4347-1.3694 0.1037l-2.4827-1.9944c-0.4327-0.3476-0.5014-0.9806-0.1539-1.4134 0.3476-0.4324 0.9807-0.5014 1.4133-0.1539l1.7478 1.404z m-0.3078-8.5114c1.1852 0.0002 2.1569 0.9114 2.255 2.0713h0.9015l0.3282 0.0157c0.7593 0.0756 1.4736 0.4121 2.0178 0.9564 0.6218 0.6221 0.9706 1.4666 0.9706 2.3461v11.2783c-0.0002 0.8798-0.3485 1.7242-0.9706 2.3461-0.622 0.622-1.4664 0.9705-2.346 0.9705h-10.5388c-0.8796 0-1.724-0.3486-2.3461-0.9705-0.622-0.622-0.972-1.4664-0.9721-2.3461v-11.2799c0-0.8798 0.35-1.724 0.9721-2.3461 0.6221-0.6221 1.4663-0.9721 2.3461-0.972h0.9108c0.0988-1.1593 1.0702-2.0697 2.2551-2.0698z m-7.3823 4.0798c-0.3467 0-0.6798 0.138-0.9249 0.3832-0.2451 0.2452-0.3832 0.5783-0.3832 0.9249v11.2799c0.0001 0.3467 0.1381 0.6799 0.3832 0.9249 0.2451 0.2449 0.5785 0.3816 0.9249 0.3816h10.5388c0.3462 0 0.6783-0.137 0.9233-0.3816 0.2451-0.2451 0.383-0.5783 0.3832-0.9249v-11.2783c0-0.3467-0.1381-0.6798-0.3832-0.9249-0.2145-0.2144-0.4956-0.3471-0.7947-0.3769l-0.1286-0.0063h-0.892v0.1822c-0.0003 1.25-1.0145 2.2627-2.2645 2.2628h-4.2164c-1.2502 0-2.2641-1.0127-2.2645-2.2628v-0.1838z m3.1659-2.0697c-0.1403 0-0.2544 0.1141-0.2544 0.2544v1.9991c0.0003 0.14 0.1143 0.2528 0.2544 0.2528h4.2164c0.1399-0.0002 0.2541-0.1129 0.2544-0.2528v-1.1731c-0.0001-0.0047-0.0016-0.0094-0.0016-0.0141 0-0.0052 0.0015-0.0105 0.0016-0.0157v-0.7962c0-0.1402-0.1143-0.2542-0.2544-0.2544z"
35773
37500
  },
35774
37501
  name: "Tasks"
35775
37502
  };
@@ -35892,8 +37619,7 @@ function ChatTool({
35892
37619
  const Chat = {
35893
37620
  component: ChatTool,
35894
37621
  icons: {
35895
- staticDotPath: "M26 13.6586V19C26 20.6569 24.6569 22 23 22H18.9997L17.4141 23.5856L15.9998 24.9998L14.5856 23.5856L13 22H9C7.34315 22 6 20.6569 6 19V10C6 8.34315 7.34315 7 9 7H18.083C18.0284 7.32521 18 7.65929 18 8C18 8.34071 18.0284 8.67479 18.083 9H9C8.44772 9 8 9.44772 8 10V19C8 19.5523 8.44772 20 9 20H13H13.8284L14.4142 20.5858L15.9998 22.1714L17.5855 20.5858L18.1713 20H18.9997H23C23.5523 20 24 19.5523 24 19V14C24.7013 14 25.3744 13.8797 26 13.6586Z",
35896
- staticPath: "M13.8284 20L15.9998 22.1714L18.1713 20H23C23.5523 20 24 19.5523 24 19V10C24 9.44772 23.5523 9 23 9H9C8.44772 9 8 9.44772 8 10V19C8 19.5523 8.44772 20 9 20H13.8284ZM15.9998 24.9998L13 22H9C7.34315 22 6 20.6569 6 19V10C6 8.34315 7.34315 7 9 7H23C24.6569 7 26 8.34315 26 10V19C26 20.6569 24.6569 22 23 22H18.9997L15.9998 24.9998Z"
37622
+ path: "M23.0509 7.005c0.7801 0 1.5293 0.3105 2.0808 0.8621 0.5512 0.5515 0.8605 1.2994 0.8605 2.0792v8.5898c0 0.7797-0.3092 1.5276-0.8605 2.0792-0.5516 0.5516-1.3008 0.8621-2.0808 0.8621h-2.9884l-4.0672 3.5176-4.0688-3.5176h-2.9774c-0.78 0-1.5276-0.3105-2.0792-0.8621-0.5516-0.5516-0.8621-1.2991-0.8621-2.0792v-8.5898c0-0.78 0.3106-1.5276 0.8621-2.0792 0.5516-0.5516 1.2991-0.8621 2.0792-0.8621z m-14.1018 2.01c-0.2469 0-0.4834 0.0986-0.658 0.2733-0.1746 0.1746-0.2732 0.411-0.2732 0.658v8.5898c0 0.2469 0.0986 0.4834 0.2732 0.658 0.1746 0.1746 0.411 0.2732 0.658 0.2733h3.7265l0.2842 0.2449 3.034 2.6241 3.0355-2.6241 0.2842-0.2449h3.7374c0.247 0 0.485-0.0986 0.6596-0.2733 0.1743-0.1746 0.2716-0.4113 0.2716-0.658v-8.5898c0-0.2467-0.0973-0.4834-0.2716-0.658-0.1746-0.1746-0.4126-0.2732-0.6596-0.2733z"
35897
37623
  },
35898
37624
  name: "Chat",
35899
37625
  storageExemptPaths: ["blankstate"]
@@ -36000,8 +37726,7 @@ const usePicobotConfig = ({
36000
37726
  const Profile = {
36001
37727
  component: UserProfile,
36002
37728
  icons: {
36003
- staticDotPath: "",
36004
- staticPath: ""
37729
+ path: ""
36005
37730
  },
36006
37731
  name: "Profile"
36007
37732
  };
@@ -36067,13 +37792,14 @@ function Toolbar({
36067
37792
  } = state;
36068
37793
  const mounted = !!currentContent;
36069
37794
  const storeData = useStore();
37795
+ const devStoreDataOverride = env === "development" ? _storeDataOverride !== null && _storeDataOverride !== void 0 ? _storeDataOverride : {} : {};
36070
37796
  const {
36071
37797
  indicatorVisible,
36072
37798
  joltPromise,
36073
37799
  userId
36074
37800
  } = {
36075
37801
  ...storeData,
36076
- ...(env === "development" ? _storeDataOverride !== null && _storeDataOverride !== void 0 ? _storeDataOverride : {} : {})
37802
+ ...devStoreDataOverride
36077
37803
  };
36078
37804
  const updateStore = useUpdateStore();
36079
37805
  const {
@@ -36331,22 +38057,26 @@ function Toolbar({
36331
38057
  };
36332
38058
  const indicatorState = {
36333
38059
  ...indicatorVisible,
36334
- Chat: unreadIndicator
38060
+ Chat: unreadIndicator,
38061
+ // Chat's dot comes from its own config, so a dev override has to land last.
38062
+ ...devStoreDataOverride.indicatorVisible
36335
38063
  };
36336
38064
  return /*#__PURE__*/React.createElement(tapestryReact.ThemeProvider, {
36337
38065
  theme: topbarTheme
36338
38066
  }, /*#__PURE__*/React.createElement(addOns.UiExtensionDataContext, null, /*#__PURE__*/React.createElement("div", {
36339
38067
  className: styles$2["toolbar"],
36340
38068
  "data-pendo": "toolbar-profile-support-wrapper"
36341
- }, /*#__PURE__*/React.createElement(ToolbarButton, {
36342
- "aria-label": `Open ${userName}’s profile drawer`,
38069
+ }, /*#__PURE__*/React.createElement(ToolbarDrawerButton, {
38070
+ tooltip: "Profile",
38071
+ "aria-label": `Profile, ${userName}`,
36343
38072
  onClick: () => toggleDrawer(Profile),
36344
38073
  "data-pendo": "toolbar-profile",
36345
- className: styles$2["toolbar-button--avatar"]
36346
- }, /*#__PURE__*/React.createElement(Avatar, {
36347
- env: env,
36348
- url: userAvatarPath
36349
- })), /*#__PURE__*/React.createElement(ToolbarButton, {
38074
+ className: styles$2["toolbar-button--avatar"],
38075
+ icon: /*#__PURE__*/React.createElement(Avatar, {
38076
+ env: env,
38077
+ url: userAvatarPath
38078
+ })
38079
+ }), /*#__PURE__*/React.createElement(ToolbarButton, {
36350
38080
  className: styles$2["toolbar-button--home"],
36351
38081
  onClick: () => closeDrawer()
36352
38082
  }, /*#__PURE__*/React.createElement(tapestryReact.Icon, {
@@ -36356,17 +38086,18 @@ function Toolbar({
36356
38086
  var _a;
36357
38087
  const current = open && currentContent === tool;
36358
38088
  const indicator = indicatorState[tool.name];
36359
- return /*#__PURE__*/React.createElement(ToolbarButton, {
38089
+ return /*#__PURE__*/React.createElement(ToolbarDrawerButton, {
36360
38090
  current: current,
36361
38091
  onClick: () => handleToolOnClick(tool),
36362
38092
  id: getDataPendoAttribute(tool.name),
36363
- "aria-label": `Open ${(_a = tool.label) !== null && _a !== void 0 ? _a : tool.name} drawer`,
38093
+ tooltip: (_a = tool.label) !== null && _a !== void 0 ? _a : tool.name,
36364
38094
  "data-pendo": getDataPendoAttribute(tool.name),
36365
- key: tool.name
36366
- }, /*#__PURE__*/React.createElement(ToolbarToolIcon, {
36367
- icons: tool.icons,
36368
- dot: !!indicator
36369
- }));
38095
+ key: tool.name,
38096
+ icon: /*#__PURE__*/React.createElement(ToolbarToolIcon, {
38097
+ icons: tool.icons,
38098
+ dot: !!indicator
38099
+ })
38100
+ });
36370
38101
  })), /*#__PURE__*/React.createElement(DrawerWrap, {
36371
38102
  isVisible: open
36372
38103
  }, mounted && (/*#__PURE__*/React.createElement(Drawer, {
@@ -36390,6 +38121,24 @@ const ToolbarButton = ({
36390
38121
  ...restProps
36391
38122
  }, children);
36392
38123
  };
38124
+ const ToolbarDrawerButton = ({
38125
+ "aria-label": ariaLabel,
38126
+ className,
38127
+ current = false,
38128
+ tooltip,
38129
+ ...restProps
38130
+ }) => {
38131
+ // Below 600px the toolbar sits along the bottom, where tooltips get in the way.
38132
+ const isSideToolbar = useMediaQuery("(min-width: 600px)");
38133
+ return /*#__PURE__*/React.createElement(tapestry.IconButton, {
38134
+ className: classnames(styles$2["toolbar-button"], className, current && styles$2["is-current"]),
38135
+ "aria-label": ariaLabel !== null && ariaLabel !== void 0 ? ariaLabel : tooltip,
38136
+ tooltip: isSideToolbar ? tooltip : undefined,
38137
+ tooltipPlacement: "left",
38138
+ "data-toolbar-link": "true",
38139
+ ...restProps
38140
+ });
38141
+ };
36393
38142
  function ToolbarToolIcon({
36394
38143
  dot,
36395
38144
  icons
@@ -36398,31 +38147,57 @@ function ToolbarToolIcon({
36398
38147
  return /*#__PURE__*/React.createElement(icons.component, null);
36399
38148
  } else {
36400
38149
  return /*#__PURE__*/React.createElement(ToolbarButtonIcon, {
36401
- path: dot ? icons.staticDotPath : icons.staticPath,
38150
+ path: icons.path,
36402
38151
  dot: dot
36403
38152
  });
36404
38153
  }
36405
38154
  }
38155
+ // The dot sits on the icon's top-right corner. A mask knocks a transparent
38156
+ // ring out of the glyph around it, so the gap reads correctly on any button
38157
+ // background (hover, current, dark mode) without a second, pre-cut path.
38158
+ const DOT = {
38159
+ cx: 24,
38160
+ cy: 8,
38161
+ gap: 2,
38162
+ r: 4
38163
+ };
38164
+ // React 17 has no useId, and mask ids are document-global: count instead so
38165
+ // several toolbars (or icons) on one page never share a mask.
38166
+ let dotMaskCount = 0;
36406
38167
  function ToolbarButtonIcon({
36407
38168
  dot,
36408
38169
  path
36409
38170
  }) {
38171
+ const [maskId] = React.useState(() => `topbar-toolbar-dot-mask-${++dotMaskCount}`);
36410
38172
  return /*#__PURE__*/React.createElement("svg", {
36411
38173
  "aria-hidden": "true",
36412
38174
  width: "32",
36413
38175
  height: "32",
36414
38176
  viewBox: "0 0 32 32",
36415
38177
  xmlns: "http://www.w3.org/2000/svg"
36416
- }, /*#__PURE__*/React.createElement("path", {
38178
+ }, dot && (/*#__PURE__*/React.createElement("mask", {
38179
+ id: maskId,
38180
+ maskUnits: "userSpaceOnUse"
38181
+ }, /*#__PURE__*/React.createElement("rect", {
38182
+ width: "32",
38183
+ height: "32",
38184
+ fill: "white"
38185
+ }), /*#__PURE__*/React.createElement("circle", {
38186
+ cx: DOT.cx,
38187
+ cy: DOT.cy,
38188
+ r: DOT.r + DOT.gap,
38189
+ fill: "black"
38190
+ }))), /*#__PURE__*/React.createElement("path", {
36417
38191
  fill: "currentColor",
36418
38192
  fillRule: "evenodd",
36419
38193
  clipRule: "evenodd",
36420
- d: path
38194
+ d: path,
38195
+ mask: dot ? `url(#${maskId})` : undefined
36421
38196
  }), dot && (/*#__PURE__*/React.createElement("circle", {
36422
38197
  fill: "var(--t-icon-color-status-error)",
36423
- cx: "24",
36424
- cy: "8",
36425
- r: "4"
38198
+ cx: DOT.cx,
38199
+ cy: DOT.cy,
38200
+ r: DOT.r
36426
38201
  })));
36427
38202
  }
36428
38203
  function getDataPendoAttribute(toolName) {