col-browser 2.9.0 → 2.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. package/README.md +29 -1
  2. package/basemap/style.json +1 -1
  3. package/es/bibtex.js +1 -1
  4. package/es/chunks/{BibTex-Bmiqb90o.js → BibTex-2E8oB2c5.js} +2 -2
  5. package/es/chunks/{BibTex-Bmiqb90o.js.map → BibTex-2E8oB2c5.js.map} +1 -1
  6. package/es/chunks/{DatasetCitation-BtDwIIDX.js → DatasetCitation-CqEmtLlj.js} +3 -3
  7. package/es/chunks/{DatasetCitation-BtDwIIDX.js.map → DatasetCitation-CqEmtLlj.js.map} +1 -1
  8. package/es/chunks/{DatasetlogoWithFallback-CMPmcG2C.js → DatasetlogoWithFallback-DLNEhUlR.js} +2 -2
  9. package/es/chunks/{DatasetlogoWithFallback-CMPmcG2C.js.map → DatasetlogoWithFallback-DLNEhUlR.js.map} +1 -1
  10. package/es/chunks/Distributions-mIlSFgUC.js +230 -0
  11. package/es/chunks/Distributions-mIlSFgUC.js.map +1 -0
  12. package/es/chunks/{ErrorMsg-B-kvpMgH.js → ErrorMsg-Co668fRd.js} +8 -7
  13. package/es/chunks/{ErrorMsg-B-kvpMgH.js.map → ErrorMsg-Co668fRd.js.map} +1 -1
  14. package/es/chunks/{MetricsPresentation-DKCJQOtf.js → MetricsPresentation-D0lWPxCu.js} +2 -2
  15. package/es/chunks/{MetricsPresentation-DKCJQOtf.js.map → MetricsPresentation-D0lWPxCu.js.map} +1 -1
  16. package/es/chunks/{TaxonBreakdown-CILXbINQ.js → TaxonBreakdown-C2tMPpaB.js} +16 -15
  17. package/es/chunks/{TaxonBreakdown-CILXbINQ.js.map → TaxonBreakdown-C2tMPpaB.js.map} +1 -1
  18. package/es/chunks/{XrGutter-CPe8vyRy.js → XrGutter-CQdnOGIa.js} +2 -2
  19. package/es/chunks/{XrGutter-CPe8vyRy.js.map → XrGutter-CQdnOGIa.js.map} +1 -1
  20. package/es/chunks/client-CTn6s1A6.js +57 -0
  21. package/es/chunks/client-CTn6s1A6.js.map +1 -0
  22. package/es/chunks/{config-DFtvmQdF.js → config-9UwXwMRq.js} +2 -2
  23. package/es/chunks/{config-DFtvmQdF.js.map → config-9UwXwMRq.js.map} +1 -1
  24. package/es/chunks/{dataset-BKggpI8E.js → dataset-Dz2EA1A4.js} +3 -3
  25. package/es/chunks/{dataset-BKggpI8E.js.map → dataset-Dz2EA1A4.js.map} +1 -1
  26. package/es/chunks/{enumeration-aHxx2gjA.js → enumeration-DV0R7nXc.js} +3 -3
  27. package/es/chunks/{enumeration-aHxx2gjA.js.map → enumeration-DV0R7nXc.js.map} +1 -1
  28. package/es/chunks/index-CJZY-Eu5.js +1107 -0
  29. package/es/chunks/index-CJZY-Eu5.js.map +1 -0
  30. package/es/chunks/router-2hWSOoof.js +56 -0
  31. package/es/chunks/router-2hWSOoof.js.map +1 -0
  32. package/es/chunks/{sector-DdCBeUzI.js → sector-CRBn67UW.js} +3 -3
  33. package/es/chunks/{sector-DdCBeUzI.js.map → sector-CRBn67UW.js.map} +1 -1
  34. package/es/col-browser.css +1 -1
  35. package/es/config.js +1 -1
  36. package/es/index.js +1 -1
  37. package/es/map.js +30 -0
  38. package/es/map.js.map +1 -0
  39. package/es/search.js +99 -98
  40. package/es/search.js.map +1 -1
  41. package/es/sourceDataset.js +24 -23
  42. package/es/sourceDataset.js.map +1 -1
  43. package/es/sourceDatasetList.js +29 -28
  44. package/es/sourceDatasetList.js.map +1 -1
  45. package/es/taxon.js +52 -51
  46. package/es/taxon.js.map +1 -1
  47. package/es/taxonBreakdown.js +9 -8
  48. package/es/taxonBreakdown.js.map +1 -1
  49. package/es/taxonDistribution.js +18 -17
  50. package/es/taxonDistribution.js.map +1 -1
  51. package/es/tree.js +9 -8
  52. package/es/tree.js.map +1 -1
  53. package/package.json +5 -1
  54. package/types/map.d.ts +99 -0
  55. package/umd/col-browser.js +974 -233
  56. package/umd/col-browser.js.map +1 -1
  57. package/umd/col-browser.min.js +5 -5
  58. package/umd/col-browser.min.js.map +1 -1
  59. package/umd/main.css +2 -23
  60. package/es/chunks/Distributions-D_yRCeZ3.js +0 -1232
  61. package/es/chunks/Distributions-D_yRCeZ3.js.map +0 -1
  62. package/es/chunks/router-CssZk5qZ.js +0 -109
  63. package/es/chunks/router-CssZk5qZ.js.map +0 -1
@@ -2219,7 +2219,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
2219
2219
  clipboardData: function(event) {
2220
2220
  return "clipboardData" in event ? event.clipboardData : window.clipboardData;
2221
2221
  }
2222
- }), SyntheticClipboardEvent = createSyntheticEvent(ClipboardEventInterface), CompositionEventInterface = assign2({}, EventInterface, { data: 0 }), SyntheticCompositionEvent = createSyntheticEvent(CompositionEventInterface), normalizeKey2 = {
2222
+ }), SyntheticClipboardEvent = createSyntheticEvent(ClipboardEventInterface), CompositionEventInterface = assign2({}, EventInterface, { data: 0 }), SyntheticCompositionEvent = createSyntheticEvent(CompositionEventInterface), normalizeKey = {
2223
2223
  Esc: "Escape",
2224
2224
  Spacebar: " ",
2225
2225
  Left: "ArrowLeft",
@@ -2285,7 +2285,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
2285
2285
  var KeyboardEventInterface = assign2({}, UIEventInterface, {
2286
2286
  key: function(nativeEvent) {
2287
2287
  if (nativeEvent.key) {
2288
- var key2 = normalizeKey2[nativeEvent.key] || nativeEvent.key;
2288
+ var key2 = normalizeKey[nativeEvent.key] || nativeEvent.key;
2289
2289
  if ("Unidentified" !== key2) return key2;
2290
2290
  }
2291
2291
  return "keypress" === nativeEvent.type ? (nativeEvent = getEventCharCode(nativeEvent), 13 === nativeEvent ? "Enter" : String.fromCharCode(nativeEvent)) : "keydown" === nativeEvent.type || "keyup" === nativeEvent.type ? translateToKey[nativeEvent.keyCode] || "Unidentified" : "";
@@ -19350,7 +19350,7 @@ ${mergedStyleStr}
19350
19350
  }
19351
19351
  };
19352
19352
  };
19353
- const prepareComponentToken$k = (token2) => {
19353
+ const prepareComponentToken$l = (token2) => {
19354
19354
  const paddingHorizontal = 12;
19355
19355
  return {
19356
19356
  withDescriptionIconSize: token2.fontSizeHeading3,
@@ -19358,7 +19358,7 @@ ${mergedStyleStr}
19358
19358
  withDescriptionPadding: `${token2.paddingMD}px ${token2.paddingContentHorizontalLG}px`
19359
19359
  };
19360
19360
  };
19361
- const useStyle$s = genStyleHooks("Alert", (token2) => [genBaseStyle$6(token2), genTypeStyle(token2), genActionStyle(token2)], prepareComponentToken$k);
19361
+ const useStyle$t = genStyleHooks("Alert", (token2) => [genBaseStyle$6(token2), genTypeStyle(token2), genActionStyle(token2)], prepareComponentToken$l);
19362
19362
  const IconNode = (props) => {
19363
19363
  const {
19364
19364
  icon,
@@ -19447,7 +19447,7 @@ ${mergedStyleStr}
19447
19447
  errorIcon
19448
19448
  } = useComponentConfig("alert");
19449
19449
  const prefixCls = getPrefixCls("alert", customizePrefixCls);
19450
- const [hashId, cssVarCls] = useStyle$s(prefixCls);
19450
+ const [hashId, cssVarCls] = useStyle$t(prefixCls);
19451
19451
  const {
19452
19452
  onClose: closableOnClose,
19453
19453
  afterClose: closableAfterClose
@@ -24086,7 +24086,7 @@ html body {
24086
24086
  };
24087
24087
  };
24088
24088
  const DEFAULT_COLLAPSED_STACK_VISIBLE_COUNT = 3;
24089
- const prepareComponentToken$j = (token2) => ({
24089
+ const prepareComponentToken$k = (token2) => ({
24090
24090
  zIndexPopup: token2.zIndexPopupBase + CONTAINER_MAX_OFFSET + 50,
24091
24091
  width: 384,
24092
24092
  progressBg: `linear-gradient(90deg, ${token2.colorPrimaryBorderHover}, ${token2.colorPrimary})`,
@@ -24220,7 +24220,7 @@ html body {
24220
24220
  }
24221
24221
  };
24222
24222
  };
24223
- genSubStyleComponent(["Notification", "PurePanel"], (token2) => genPurePanelStyle(prepareNotificationToken(token2)), prepareComponentToken$j);
24223
+ genSubStyleComponent(["Notification", "PurePanel"], (token2) => genPurePanelStyle(prepareNotificationToken(token2)), prepareComponentToken$k);
24224
24224
  const sharedGenerateStyle = (token2, config2) => {
24225
24225
  const itemStyle = config2.itemStyle ?? genNotificationStyle;
24226
24226
  return [genNotificationListStyle(token2, config2), itemStyle(token2), genNotificationPlacementStyle(token2)];
@@ -24230,7 +24230,7 @@ html body {
24230
24230
  return sharedGenerateStyle(notificationToken, {
24231
24231
  listWidthKey: "width"
24232
24232
  });
24233
- }, prepareComponentToken$j);
24233
+ }, prepareComponentToken$k);
24234
24234
  const prepareMessageToken = (token2) => {
24235
24235
  const messagePaddingVertical = token2.calc(token2.controlHeightLG).sub(token2.calc(token2.fontSize).mul(token2.lineHeight)).div(2).equal();
24236
24236
  const messagePaddingHorizontal = token2.paddingSM;
@@ -24241,7 +24241,7 @@ html body {
24241
24241
  notificationPaddingHorizontal: messagePaddingHorizontal
24242
24242
  });
24243
24243
  };
24244
- const prepareComponentToken$i = (token2) => ({
24244
+ const prepareComponentToken$j = (token2) => ({
24245
24245
  zIndexPopup: token2.zIndexPopupBase + CONTAINER_MAX_OFFSET + 10,
24246
24246
  contentBg: token2.colorBgElevated,
24247
24247
  contentPadding: `${(token2.controlHeightLG - token2.fontSize * token2.lineHeight) / 2}px ${token2.paddingSM}px`
@@ -24342,17 +24342,17 @@ html body {
24342
24342
  }
24343
24343
  };
24344
24344
  };
24345
- const PurePanelStyle = genSubStyleComponent(["Message", "PurePanel"], (token2) => generateMessagePurePanelStyle(prepareMessageToken(token2)), prepareComponentToken$i);
24345
+ const PurePanelStyle = genSubStyleComponent(["Message", "PurePanel"], (token2) => generateMessagePurePanelStyle(prepareMessageToken(token2)), prepareComponentToken$j);
24346
24346
  const generateMessageStyle = (token2) => ({
24347
24347
  [token2.componentCls]: genMessageItemStyle(token2)
24348
24348
  });
24349
- const useStyle$r = genStyleHooks("Message", (token2) => {
24349
+ const useStyle$s = genStyleHooks("Message", (token2) => {
24350
24350
  const messageToken = prepareMessageToken(token2);
24351
24351
  return [sharedGenerateStyle(messageToken, {
24352
24352
  stackVisibleCount: 1,
24353
24353
  itemStyle: generateMessageStyle
24354
24354
  }), generateMessageStackStyle(messageToken)];
24355
- }, prepareComponentToken$i);
24355
+ }, prepareComponentToken$j);
24356
24356
  const TypeIcon = {
24357
24357
  info: /* @__PURE__ */ reactExports.createElement(RefIcon$t, null),
24358
24358
  success: /* @__PURE__ */ reactExports.createElement(RefIcon$x, null),
@@ -24383,7 +24383,7 @@ html body {
24383
24383
  const prefixCls = staticPrefixCls || getPrefixCls("message");
24384
24384
  const noticePrefixCls = `${prefixCls}-notice`;
24385
24385
  const rootCls = useCSSVarCls(prefixCls);
24386
- const [hashId, cssVarCls] = useStyle$r(prefixCls, rootCls);
24386
+ const [hashId, cssVarCls] = useStyle$s(prefixCls, rootCls);
24387
24387
  const [mergedClassNames, mergedStyles] = useMergeSemantic([contextClassNames, messageClassNames], [contextStyles, styles2], {
24388
24388
  props
24389
24389
  });
@@ -24446,7 +24446,7 @@ html body {
24446
24446
  prefixCls
24447
24447
  }) => {
24448
24448
  const rootCls = useCSSVarCls(prefixCls);
24449
- const [hashId, cssVarCls] = useStyle$r(prefixCls, rootCls);
24449
+ const [hashId, cssVarCls] = useStyle$s(prefixCls, rootCls);
24450
24450
  return /* @__PURE__ */ reactExports.createElement(NotificationProvider, {
24451
24451
  classNames: {
24452
24452
  list: clsx(hashId, cssVarCls, rootCls)
@@ -24725,7 +24725,7 @@ html body {
24725
24725
  }
24726
24726
  };
24727
24727
  };
24728
- const useStyle$q = genComponentStyleHook("Wave", genWaveStyle);
24728
+ const useStyle$r = genComponentStyleHook("Wave", genWaveStyle);
24729
24729
  const TARGET_CLS = `${defaultPrefixCls}-wave-target`;
24730
24730
  const isValidWaveColor = (color) => {
24731
24731
  if (!color) {
@@ -24919,7 +24919,7 @@ html body {
24919
24919
  } = reactExports.useContext(ConfigContext);
24920
24920
  const containerRef = reactExports.useRef(null);
24921
24921
  const prefixCls = getPrefixCls("wave");
24922
- const hashId = useStyle$q(prefixCls);
24922
+ const hashId = useStyle$r(prefixCls);
24923
24923
  const showWave = useWave(containerRef, clsx(prefixCls, hashId), component, colorSource);
24924
24924
  React.useEffect(() => {
24925
24925
  const node2 = containerRef.current;
@@ -24983,7 +24983,7 @@ html body {
24983
24983
  }
24984
24984
  };
24985
24985
  };
24986
- const useStyle$p = genStyleHooks(["Space", "Compact"], genSpaceCompactStyle, () => ({}), {
24986
+ const useStyle$q = genStyleHooks(["Space", "Compact"], genSpaceCompactStyle, () => ({}), {
24987
24987
  // Space component don't apply extra font style
24988
24988
  // https://github.com/ant-design/ant-design/issues/40315
24989
24989
  resetStyle: false
@@ -25050,7 +25050,7 @@ html body {
25050
25050
  const [mergedOrientation, mergedVertical] = useOrientation(orientation, vertical, direction);
25051
25051
  const mergedSize = useSize((ctx) => size ?? ctx);
25052
25052
  const prefixCls = getPrefixCls("space-compact", customizePrefixCls);
25053
- const [hashId] = useStyle$p(prefixCls);
25053
+ const [hashId] = useStyle$q(prefixCls);
25054
25054
  const clx = clsx(prefixCls, hashId, {
25055
25055
  [`${prefixCls}-rtl`]: directionConfig === "rtl",
25056
25056
  [`${prefixCls}-block`]: block,
@@ -26117,7 +26117,7 @@ html body {
26117
26117
  });
26118
26118
  return buttonToken;
26119
26119
  };
26120
- const prepareComponentToken$h = (token2) => {
26120
+ const prepareComponentToken$i = (token2) => {
26121
26121
  const contentFontSize = token2.contentFontSize ?? token2.fontSize;
26122
26122
  const contentFontSizeSM = token2.contentFontSizeSM ?? token2.fontSize;
26123
26123
  const contentFontSizeLG = token2.contentFontSizeLG ?? token2.fontSizeLG;
@@ -26635,7 +26635,7 @@ html body {
26635
26635
  }
26636
26636
  };
26637
26637
  };
26638
- const useStyle$o = genStyleHooks("Button", (token2) => {
26638
+ const useStyle$p = genStyleHooks("Button", (token2) => {
26639
26639
  const buttonToken = prepareToken$4(token2);
26640
26640
  return [
26641
26641
  // Shared
@@ -26651,7 +26651,7 @@ html body {
26651
26651
  // Button Group
26652
26652
  genGroupStyle$1(buttonToken)
26653
26653
  ];
26654
- }, prepareComponentToken$h, {
26654
+ }, prepareComponentToken$i, {
26655
26655
  unitless: {
26656
26656
  fontWeight: true,
26657
26657
  contentLineHeight: true,
@@ -26839,7 +26839,7 @@ html body {
26839
26839
  genCompactItemVerticalStyle(buttonToken),
26840
26840
  genButtonCompactStyle(buttonToken)
26841
26841
  ];
26842
- }, prepareComponentToken$h);
26842
+ }, prepareComponentToken$i);
26843
26843
  function getLoadingConfig(loading) {
26844
26844
  if (isPlainObject$1(loading)) {
26845
26845
  let delay = loading == null ? void 0 : loading.delay;
@@ -26939,7 +26939,7 @@ html body {
26939
26939
  const mergedColorText = isDanger ? "dangerous" : mergedColor;
26940
26940
  const mergedInsertSpace = autoInsertSpace ?? contextAutoInsertSpace ?? true;
26941
26941
  const prefixCls = getPrefixCls("btn", customizePrefixCls);
26942
- const [hashId, cssVarCls] = useStyle$o(prefixCls);
26942
+ const [hashId, cssVarCls] = useStyle$p(prefixCls);
26943
26943
  const disabled = reactExports.useContext(DisabledContext);
26944
26944
  const mergedDisabled = customDisabled ?? disabled;
26945
26945
  const groupSize = reactExports.useContext(GroupSizeContext);
@@ -31373,7 +31373,7 @@ html body {
31373
31373
  }
31374
31374
  };
31375
31375
  };
31376
- const prepareComponentToken$g = (token2) => {
31376
+ const prepareComponentToken$h = (token2) => {
31377
31377
  const {
31378
31378
  colorFillContent,
31379
31379
  colorFill
@@ -31391,7 +31391,7 @@ html body {
31391
31391
  paragraphLiHeight: token2.controlHeight / 2
31392
31392
  };
31393
31393
  };
31394
- const useStyle$n = genStyleHooks("Skeleton", (token2) => {
31394
+ const useStyle$o = genStyleHooks("Skeleton", (token2) => {
31395
31395
  const {
31396
31396
  componentCls,
31397
31397
  calc
@@ -31411,7 +31411,7 @@ html body {
31411
31411
  skeletonLoadingMotionDuration: "1.4s"
31412
31412
  });
31413
31413
  return genBaseStyle$5(skeletonToken);
31414
- }, prepareComponentToken$g, {
31414
+ }, prepareComponentToken$h, {
31415
31415
  deprecatedTokens: [["color", "gradientFromColor"], ["colorGradientEnd", "gradientToColor"]]
31416
31416
  });
31417
31417
  const SkeletonAvatar = (props) => {
@@ -31431,7 +31431,7 @@ html body {
31431
31431
  getPrefixCls
31432
31432
  } = reactExports.useContext(ConfigContext);
31433
31433
  const prefixCls = getPrefixCls("skeleton", customizePrefixCls);
31434
- const [hashId, cssVarCls] = useStyle$n(prefixCls);
31434
+ const [hashId, cssVarCls] = useStyle$o(prefixCls);
31435
31435
  const mergedSize = useSize((ctx) => customSize ?? ctx);
31436
31436
  const cls = clsx(prefixCls, `${prefixCls}-element`, {
31437
31437
  [`${prefixCls}-active`]: active
@@ -31468,7 +31468,7 @@ html body {
31468
31468
  getPrefixCls
31469
31469
  } = reactExports.useContext(ConfigContext);
31470
31470
  const prefixCls = getPrefixCls("skeleton", customizePrefixCls);
31471
- const [hashId, cssVarCls] = useStyle$n(prefixCls);
31471
+ const [hashId, cssVarCls] = useStyle$o(prefixCls);
31472
31472
  const mergedSize = useSize((ctx) => customSize ?? ctx);
31473
31473
  const cls = clsx(prefixCls, `${prefixCls}-element`, {
31474
31474
  [`${prefixCls}-active`]: active,
@@ -31504,7 +31504,7 @@ html body {
31504
31504
  getPrefixCls
31505
31505
  } = reactExports.useContext(ConfigContext);
31506
31506
  const prefixCls = getPrefixCls("skeleton", customizePrefixCls);
31507
- const [hashId, cssVarCls] = useStyle$n(prefixCls);
31507
+ const [hashId, cssVarCls] = useStyle$o(prefixCls);
31508
31508
  const cls = clsx(prefixCls, `${prefixCls}-element`, {
31509
31509
  [`${prefixCls}-active`]: active
31510
31510
  }, hashId, classNames == null ? void 0 : classNames.root, className, rootClassName, cssVarCls);
@@ -31553,7 +31553,7 @@ html body {
31553
31553
  getPrefixCls
31554
31554
  } = reactExports.useContext(ConfigContext);
31555
31555
  const prefixCls = getPrefixCls("skeleton", customizePrefixCls);
31556
- const [hashId, cssVarCls] = useStyle$n(prefixCls);
31556
+ const [hashId, cssVarCls] = useStyle$o(prefixCls);
31557
31557
  const mergedSize = useSize((ctx) => customSize ?? ctx);
31558
31558
  const cls = clsx(prefixCls, `${prefixCls}-element`, {
31559
31559
  [`${prefixCls}-active`]: active,
@@ -31686,7 +31686,7 @@ html body {
31686
31686
  styles: contextStyles
31687
31687
  } = useComponentConfig("skeleton");
31688
31688
  const prefixCls = getPrefixCls("skeleton", customizePrefixCls);
31689
- const [hashId, cssVarCls] = useStyle$n(prefixCls);
31689
+ const [hashId, cssVarCls] = useStyle$o(prefixCls);
31690
31690
  const mergedProps = {
31691
31691
  ...props,
31692
31692
  avatar,
@@ -32321,7 +32321,7 @@ html body {
32321
32321
  });
32322
32322
  return modalToken;
32323
32323
  };
32324
- const prepareComponentToken$f = (token2) => ({
32324
+ const prepareComponentToken$g = (token2) => ({
32325
32325
  footerBg: "transparent",
32326
32326
  headerBg: "transparent",
32327
32327
  titleLineHeight: token2.lineHeightHeading5,
@@ -32343,10 +32343,10 @@ html body {
32343
32343
  confirmBtnsMarginTop: token2.wireframe ? token2.marginLG : token2.marginSM,
32344
32344
  mask: true
32345
32345
  });
32346
- const useStyle$m = genStyleHooks("Modal", (token2) => {
32346
+ const useStyle$n = genStyleHooks("Modal", (token2) => {
32347
32347
  const modalToken = prepareToken$3(token2);
32348
32348
  return [genModalStyle(modalToken), genRTLStyle(modalToken), genModalMaskStyle(modalToken), initZoomMotion(modalToken, "zoom"), genResponsiveWidthStyle(modalToken)];
32349
- }, prepareComponentToken$f, {
32349
+ }, prepareComponentToken$g, {
32350
32350
  unitless: {
32351
32351
  titleLineHeight: true
32352
32352
  }
@@ -32441,7 +32441,7 @@ html body {
32441
32441
  onClose == null ? void 0 : onClose();
32442
32442
  };
32443
32443
  const rootCls = useCSSVarCls(prefixCls);
32444
- const [hashId, cssVarCls] = useStyle$m(prefixCls, rootCls);
32444
+ const [hashId, cssVarCls] = useStyle$n(prefixCls, rootCls);
32445
32445
  const wrapClassNameExtended = clsx(wrapClassName, {
32446
32446
  [`${prefixCls}-centered`]: centered ?? contextCentered,
32447
32447
  [`${prefixCls}-wrap-rtl`]: direction === "rtl"
@@ -32655,7 +32655,7 @@ html body {
32655
32655
  const Confirm = genSubStyleComponent(["Modal", "confirm"], (token2) => {
32656
32656
  const modalToken = prepareToken$3(token2);
32657
32657
  return genModalConfirmStyle(modalToken);
32658
- }, prepareComponentToken$f, {
32658
+ }, prepareComponentToken$g, {
32659
32659
  // confirm is weak than modal since no conflict here
32660
32660
  order: -1e3
32661
32661
  });
@@ -37546,7 +37546,7 @@ html body {
37546
37546
  }
37547
37547
  };
37548
37548
  };
37549
- const useStyle$l = genStyleHooks("Empty", (token2) => {
37549
+ const useStyle$m = genStyleHooks("Empty", (token2) => {
37550
37550
  const {
37551
37551
  componentCls,
37552
37552
  controlHeightLG,
@@ -37586,7 +37586,7 @@ html body {
37586
37586
  image: contextImage
37587
37587
  } = useComponentConfig("empty");
37588
37588
  const prefixCls = getPrefixCls("empty", customizePrefixCls);
37589
- const [hashId, cssVarCls] = useStyle$l(prefixCls);
37589
+ const [hashId, cssVarCls] = useStyle$m(prefixCls);
37590
37590
  const [mergedClassNames, mergedStyles] = useMergeSemantic([contextClassNames, classNames], [contextStyles, styles2], {
37591
37591
  props
37592
37592
  });
@@ -38389,7 +38389,7 @@ html body {
38389
38389
  ]
38390
38390
  };
38391
38391
  };
38392
- const prepareComponentToken$e = (token2) => {
38392
+ const prepareComponentToken$f = (token2) => {
38393
38393
  const {
38394
38394
  fontSize,
38395
38395
  lineHeight,
@@ -38573,7 +38573,7 @@ html body {
38573
38573
  selectHeight: token2.controlHeight
38574
38574
  });
38575
38575
  return [genSelectStyle(selectToken), genSelectInputStyle(selectToken)];
38576
- }, prepareComponentToken$e, {
38576
+ }, prepareComponentToken$f, {
38577
38577
  unitless: {
38578
38578
  optionLineHeight: true,
38579
38579
  optionSelectedFontWeight: true
@@ -39945,7 +39945,7 @@ html body {
39945
39945
  }
39946
39946
  ];
39947
39947
  };
39948
- const prepareComponentToken$d = (token2) => ({
39948
+ const prepareComponentToken$e = (token2) => ({
39949
39949
  zIndexPopup: token2.zIndexPopupBase + 70,
39950
39950
  maxWidth: 250,
39951
39951
  ...getArrowOffsetToken({
@@ -39956,7 +39956,7 @@ html body {
39956
39956
  borderRadiusOuter: Math.min(token2.borderRadiusOuter, 4)
39957
39957
  }))
39958
39958
  });
39959
- const useStyle$k = (prefixCls, rootCls, injectStyle = true) => {
39959
+ const useStyle$l = (prefixCls, rootCls, injectStyle = true) => {
39960
39960
  const useStyle2 = genStyleHooks("Tooltip", (token2) => {
39961
39961
  const {
39962
39962
  borderRadius,
@@ -39972,7 +39972,7 @@ html body {
39972
39972
  tooltipBg: colorBgSpotlight
39973
39973
  });
39974
39974
  return [genTooltipStyle(TooltipToken), initZoomMotion(token2, "zoom-big-fast")];
39975
- }, prepareComponentToken$d, {
39975
+ }, prepareComponentToken$e, {
39976
39976
  resetStyle: false,
39977
39977
  // Popover use Tooltip as internal component. We do not need to handle this.
39978
39978
  injectStyle
@@ -40029,7 +40029,7 @@ html body {
40029
40029
  const prefixCls = getPrefixCls("tooltip", customizePrefixCls);
40030
40030
  const rootPrefixCls = getPrefixCls();
40031
40031
  const rootCls = useCSSVarCls(prefixCls);
40032
- const [hashId, cssVarCls] = useStyle$k(prefixCls, rootCls);
40032
+ const [hashId, cssVarCls] = useStyle$l(prefixCls, rootCls);
40033
40033
  const colorInfo = parseColor(rootPrefixCls, prefixCls, color);
40034
40034
  const arrowContentStyle = colorInfo.arrowStyle;
40035
40035
  const innerStyles = reactExports.useMemo(() => {
@@ -40177,7 +40177,7 @@ html body {
40177
40177
  const childProps = child.props;
40178
40178
  const childCls = !childProps.className || typeof childProps.className === "string" ? clsx(childProps.className, openClassName || `${prefixCls}-open`) : childProps.className;
40179
40179
  const rootCls = useCSSVarCls(prefixCls);
40180
- const [hashId, cssVarCls] = useStyle$k(prefixCls, rootCls, !injectFromPopover);
40180
+ const [hashId, cssVarCls] = useStyle$l(prefixCls, rootCls, !injectFromPopover);
40181
40181
  const colorInfo = parseColor(rootPrefixCls, prefixCls, color);
40182
40182
  const arrowContentStyle = colorInfo.arrowStyle;
40183
40183
  const themeCls = clsx(rootCls, hashId, cssVarCls);
@@ -40352,7 +40352,7 @@ html body {
40352
40352
  })
40353
40353
  };
40354
40354
  };
40355
- const prepareComponentToken$c = (token2) => {
40355
+ const prepareComponentToken$d = (token2) => {
40356
40356
  const {
40357
40357
  lineWidth,
40358
40358
  controlHeight,
@@ -40386,7 +40386,7 @@ html body {
40386
40386
  innerContentPadding: wireframe ? `${paddingSM}px ${popoverPaddingHorizontal}px` : 0
40387
40387
  };
40388
40388
  };
40389
- const useStyle$j = genStyleHooks("Popover", (token2) => {
40389
+ const useStyle$k = genStyleHooks("Popover", (token2) => {
40390
40390
  const {
40391
40391
  colorBgElevated,
40392
40392
  colorText
@@ -40396,7 +40396,7 @@ html body {
40396
40396
  popoverColor: colorText
40397
40397
  });
40398
40398
  return [genBaseStyle$3(popoverToken), genColorStyle(popoverToken), initZoomMotion(popoverToken, "zoom-big")];
40399
- }, prepareComponentToken$c, {
40399
+ }, prepareComponentToken$d, {
40400
40400
  resetStyle: false,
40401
40401
  deprecatedTokens: [["width", "titleMinWidth"], ["minWidth", "titleMinWidth"]]
40402
40402
  });
@@ -40471,7 +40471,7 @@ html body {
40471
40471
  getPrefixCls
40472
40472
  } = reactExports.useContext(ConfigContext);
40473
40473
  const prefixCls = getPrefixCls("popover", customizePrefixCls);
40474
- const [hashId, cssVarCls] = useStyle$j(prefixCls);
40474
+ const [hashId, cssVarCls] = useStyle$k(prefixCls);
40475
40475
  return /* @__PURE__ */ reactExports.createElement(RawPurePanel, {
40476
40476
  ...restProps,
40477
40477
  prefixCls,
@@ -40508,7 +40508,7 @@ html body {
40508
40508
  trigger: contextTrigger
40509
40509
  } = useComponentConfig("popover");
40510
40510
  const prefixCls = getPrefixCls("popover", customizePrefixCls);
40511
- const [hashId, cssVarCls] = useStyle$j(prefixCls);
40511
+ const [hashId, cssVarCls] = useStyle$k(prefixCls);
40512
40512
  const rootPrefixCls = getPrefixCls();
40513
40513
  const mergedArrow = useMergedArrow(popoverArrow, contextArrow);
40514
40514
  const mergedTrigger = trigger || contextTrigger || "hover";
@@ -43533,7 +43533,7 @@ html body {
43533
43533
  }
43534
43534
  ];
43535
43535
  };
43536
- const prepareComponentToken$b = (token2) => {
43536
+ const prepareComponentToken$c = (token2) => {
43537
43537
  const {
43538
43538
  colorPrimary,
43539
43539
  colorError,
@@ -43650,7 +43650,7 @@ html body {
43650
43650
  itemWidth: activeBarWidth ? `calc(100% + ${activeBarBorderWidth}px)` : `calc(100% - ${itemMarginInline * 2}px)`
43651
43651
  };
43652
43652
  };
43653
- const useStyle$i = (prefixCls, rootCls = prefixCls, injectStyle = true) => {
43653
+ const useStyle$j = (prefixCls, rootCls = prefixCls, injectStyle = true) => {
43654
43654
  const useStyle2 = genStyleHooks("Menu", (token2) => {
43655
43655
  const {
43656
43656
  colorBgElevated,
@@ -43729,7 +43729,7 @@ html body {
43729
43729
  initSlideMotion(menuToken, "slide-down"),
43730
43730
  initZoomMotion(menuToken, "zoom-big")
43731
43731
  ];
43732
- }, prepareComponentToken$b, {
43732
+ }, prepareComponentToken$c, {
43733
43733
  deprecatedTokens: [["colorGroupTitle", "groupTitleColor"], ["radiusItem", "itemBorderRadius"], ["radiusSubMenuItem", "subMenuItemBorderRadius"], ["colorItemText", "itemColor"], ["colorItemTextHover", "itemHoverColor"], ["colorItemTextHoverHorizontal", "horizontalItemHoverColor"], ["colorItemTextSelected", "itemSelectedColor"], ["colorItemTextSelectedHorizontal", "horizontalItemSelectedColor"], ["colorItemTextDisabled", "itemDisabledColor"], ["colorDangerItemText", "dangerItemColor"], ["colorDangerItemTextHover", "dangerItemHoverColor"], ["colorDangerItemTextSelected", "dangerItemSelectedColor"], ["colorDangerItemBgActive", "dangerItemActiveBg"], ["colorDangerItemBgSelected", "dangerItemSelectedBg"], ["colorItemBg", "itemBg"], ["colorItemBgHover", "itemHoverBg"], ["colorSubItemBg", "subMenuItemBg"], ["colorItemBgActive", "itemActiveBg"], ["colorItemBgSelectedHorizontal", "horizontalItemSelectedBg"], ["colorActiveBarWidth", "activeBarWidth"], ["colorActiveBarHeight", "activeBarHeight"], ["colorActiveBarBorderSize", "activeBarBorderWidth"], ["colorItemBgSelected", "itemSelectedBg"]],
43734
43734
  // Dropdown will handle menu style self. We do not need to handle this.
43735
43735
  injectStyle,
@@ -43886,7 +43886,7 @@ html body {
43886
43886
  };
43887
43887
  const prefixCls = getPrefixCls("menu", customizePrefixCls || overrideObj.prefixCls);
43888
43888
  const rootCls = useCSSVarCls(prefixCls);
43889
- const [hashId, cssVarCls] = useStyle$i(prefixCls, rootCls, !override);
43889
+ const [hashId, cssVarCls] = useStyle$j(prefixCls, rootCls, !override);
43890
43890
  const menuClassName = clsx(`${prefixCls}-${theme}`, contextClassName, className);
43891
43891
  const mergedExpandIcon = reactExports.useMemo(() => {
43892
43892
  var _a3;
@@ -44260,7 +44260,7 @@ html body {
44260
44260
  [initSlideMotion(token2, "slide-up"), initSlideMotion(token2, "slide-down"), initMoveMotion(token2, "move-up"), initMoveMotion(token2, "move-down"), initZoomMotion(token2, "zoom-big")]
44261
44261
  ];
44262
44262
  };
44263
- const prepareComponentToken$a = (token2) => ({
44263
+ const prepareComponentToken$b = (token2) => ({
44264
44264
  zIndexPopup: token2.zIndexPopupBase + 50,
44265
44265
  paddingBlock: (token2.controlHeight - token2.fontSize * token2.lineHeight) / 2,
44266
44266
  ...getArrowOffsetToken({
@@ -44269,7 +44269,7 @@ html body {
44269
44269
  }),
44270
44270
  ...getArrowToken(token2)
44271
44271
  });
44272
- const useStyle$h = genStyleHooks("Dropdown", (token2) => {
44272
+ const useStyle$i = genStyleHooks("Dropdown", (token2) => {
44273
44273
  const {
44274
44274
  marginXXS,
44275
44275
  sizePopupArrow,
@@ -44282,7 +44282,7 @@ html body {
44282
44282
  dropdownEdgeChildPadding: paddingXXS
44283
44283
  });
44284
44284
  return [genBaseStyle$2(dropdownToken), genStatusStyle(dropdownToken)];
44285
- }, prepareComponentToken$a, {
44285
+ }, prepareComponentToken$b, {
44286
44286
  resetStyle: false
44287
44287
  });
44288
44288
  const Dropdown$1 = /* @__PURE__ */ reactExports.forwardRef((props, ref) => {
@@ -44357,7 +44357,7 @@ html body {
44357
44357
  }, [placement, direction]);
44358
44358
  const prefixCls = getPrefixCls("dropdown", customizePrefixCls);
44359
44359
  const rootCls = useCSSVarCls(prefixCls);
44360
- const [hashId, cssVarCls] = useStyle$h(prefixCls, rootCls);
44360
+ const [hashId, cssVarCls] = useStyle$i(prefixCls, rootCls);
44361
44361
  const [, token2] = useToken();
44362
44362
  const child = reactExports.Children.only(isPrimitive(children) ? /* @__PURE__ */ reactExports.createElement("span", null, children) : children);
44363
44363
  const composedRef = useComposeRef(ref, child.ref);
@@ -45319,7 +45319,7 @@ html body {
45319
45319
  }
45320
45320
  };
45321
45321
  };
45322
- const prepareComponentToken$9 = (token2) => {
45322
+ const prepareComponentToken$a = (token2) => {
45323
45323
  const {
45324
45324
  wireframe,
45325
45325
  padding,
@@ -45361,7 +45361,7 @@ html body {
45361
45361
  radioBgColor: wireframe ? colorBgContainer : colorPrimary
45362
45362
  };
45363
45363
  };
45364
- const useStyle$g = genStyleHooks("Radio", (token2) => {
45364
+ const useStyle$h = genStyleHooks("Radio", (token2) => {
45365
45365
  const {
45366
45366
  controlOutline,
45367
45367
  controlOutlineWidth
@@ -45373,7 +45373,7 @@ html body {
45373
45373
  radioButtonFocusShadow
45374
45374
  });
45375
45375
  return [getGroupRadioStyle(radioToken), getRadioBasicStyle(radioToken), getRadioButtonStyle(radioToken)];
45376
- }, prepareComponentToken$9, {
45376
+ }, prepareComponentToken$a, {
45377
45377
  unitless: {
45378
45378
  radioSize: true,
45379
45379
  dotSize: true
@@ -45415,7 +45415,7 @@ html body {
45415
45415
  const isButtonType = ((groupContext == null ? void 0 : groupContext.optionType) || radioOptionTypeContext) === "button";
45416
45416
  const prefixCls = isButtonType ? `${radioPrefixCls}-button` : radioPrefixCls;
45417
45417
  const rootCls = useCSSVarCls(radioPrefixCls);
45418
- const [hashId, cssVarCls] = useStyle$g(radioPrefixCls, rootCls);
45418
+ const [hashId, cssVarCls] = useStyle$h(radioPrefixCls, rootCls);
45419
45419
  const radioProps = {
45420
45420
  ...restProps
45421
45421
  };
@@ -45523,7 +45523,7 @@ html body {
45523
45523
  const prefixCls = getPrefixCls("radio", customizePrefixCls);
45524
45524
  const groupPrefixCls = `${prefixCls}-group`;
45525
45525
  const rootCls = useCSSVarCls(prefixCls);
45526
- const [hashId, cssVarCls] = useStyle$g(prefixCls, rootCls);
45526
+ const [hashId, cssVarCls] = useStyle$h(prefixCls, rootCls);
45527
45527
  let childrenToRender = children;
45528
45528
  if (options && options.length > 0) {
45529
45529
  childrenToRender = options.map((option) => {
@@ -46537,7 +46537,7 @@ html body {
46537
46537
  }, initComponentToken$1, {
46538
46538
  resetFont: false
46539
46539
  });
46540
- const useStyle$f = genStyleHooks(["Input", "Component"], (token2) => {
46540
+ const useStyle$g = genStyleHooks(["Input", "Component"], (token2) => {
46541
46541
  const inputToken = merge$1(token2, initInputToken(token2));
46542
46542
  return [
46543
46543
  genGroupStyle(inputToken),
@@ -47290,7 +47290,7 @@ html body {
47290
47290
  });
47291
47291
  return genCheckboxStyle(checkboxToken);
47292
47292
  }
47293
- const useStyle$e = genStyleHooks("Checkbox", (token2, {
47293
+ const useStyle$f = genStyleHooks("Checkbox", (token2, {
47294
47294
  prefixCls
47295
47295
  }) => [getStyle(prefixCls, token2)]);
47296
47296
  const GroupContext = /* @__PURE__ */ React.createContext(null);
@@ -47367,7 +47367,7 @@ html body {
47367
47367
  }, [indeterminate]);
47368
47368
  const prefixCls = getPrefixCls("checkbox", customizePrefixCls);
47369
47369
  const rootCls = useCSSVarCls(prefixCls);
47370
- const [hashId, cssVarCls] = useStyle$e(prefixCls, rootCls);
47370
+ const [hashId, cssVarCls] = useStyle$f(prefixCls, rootCls);
47371
47371
  const checkboxProps = {
47372
47372
  ...restProps
47373
47373
  };
@@ -47480,7 +47480,7 @@ html body {
47480
47480
  const prefixCls = getPrefixCls("checkbox", customizePrefixCls);
47481
47481
  const groupPrefixCls = `${prefixCls}-group`;
47482
47482
  const rootCls = useCSSVarCls(prefixCls);
47483
- const [hashId, cssVarCls] = useStyle$e(prefixCls, rootCls);
47483
+ const [hashId, cssVarCls] = useStyle$f(prefixCls, rootCls);
47484
47484
  const domProps = omit(restProps, ["value", "disabled"]);
47485
47485
  const childrenNode = options.length ? memoizedOptions.map((option) => /* @__PURE__ */ reactExports.createElement(Checkbox$1, {
47486
47486
  prefixCls,
@@ -47883,18 +47883,18 @@ html body {
47883
47883
  }
47884
47884
  };
47885
47885
  };
47886
- const prepareComponentToken$8 = (token2) => ({
47886
+ const prepareComponentToken$9 = (token2) => ({
47887
47887
  textPaddingInline: "1em",
47888
47888
  orientationMargin: 0.05,
47889
47889
  verticalMarginInline: token2.marginXS
47890
47890
  });
47891
- const useStyle$d = genStyleHooks("Divider", (token2) => {
47891
+ const useStyle$e = genStyleHooks("Divider", (token2) => {
47892
47892
  const dividerToken = merge$1(token2, {
47893
47893
  dividerHorizontalWithTextGutterMargin: token2.margin,
47894
47894
  sizePaddingEdgeHorizontal: 0
47895
47895
  });
47896
47896
  return [genSharedDividerStyle(dividerToken), genSizeDividerStyle(dividerToken)];
47897
- }, prepareComponentToken$8, {
47897
+ }, prepareComponentToken$9, {
47898
47898
  unitless: {
47899
47899
  orientationMargin: true
47900
47900
  }
@@ -47930,7 +47930,7 @@ html body {
47930
47930
  } = props;
47931
47931
  const prefixCls = getPrefixCls("divider", customizePrefixCls);
47932
47932
  const railCls = `${prefixCls}-rail`;
47933
- const [hashId, cssVarCls] = useStyle$d(prefixCls);
47933
+ const [hashId, cssVarCls] = useStyle$e(prefixCls);
47934
47934
  const sizeFullName = useSize(customSize);
47935
47935
  const hasChildren = !!children;
47936
47936
  const validTitlePlacement = titlePlacementList.includes(orientation || "");
@@ -48007,6 +48007,681 @@ html body {
48007
48007
  style: mergedStyles.rail
48008
48008
  })));
48009
48009
  };
48010
+ const calcThumbStyle = (targetElement, vertical) => {
48011
+ if (!targetElement) return null;
48012
+ const style2 = {
48013
+ left: targetElement.offsetLeft,
48014
+ right: targetElement.parentElement.clientWidth - targetElement.clientWidth - targetElement.offsetLeft,
48015
+ width: targetElement.clientWidth,
48016
+ top: targetElement.offsetTop,
48017
+ bottom: targetElement.parentElement.clientHeight - targetElement.clientHeight - targetElement.offsetTop,
48018
+ height: targetElement.clientHeight
48019
+ };
48020
+ if (vertical) {
48021
+ return {
48022
+ left: 0,
48023
+ right: 0,
48024
+ width: 0,
48025
+ top: style2.top,
48026
+ bottom: style2.bottom,
48027
+ height: style2.height
48028
+ };
48029
+ }
48030
+ return {
48031
+ left: style2.left,
48032
+ right: style2.right,
48033
+ width: style2.width,
48034
+ top: 0,
48035
+ bottom: 0,
48036
+ height: 0
48037
+ };
48038
+ };
48039
+ const toPX = (value) => value !== void 0 ? `${value}px` : void 0;
48040
+ function MotionThumb(props) {
48041
+ const {
48042
+ prefixCls,
48043
+ containerRef,
48044
+ value,
48045
+ getValueIndex,
48046
+ motionName,
48047
+ onMotionStart,
48048
+ onMotionEnd,
48049
+ direction,
48050
+ vertical = false
48051
+ } = props;
48052
+ const thumbRef = reactExports.useRef(null);
48053
+ const [prevValue, setPrevValue] = reactExports.useState(value);
48054
+ const findValueElement = (val) => {
48055
+ var _a2;
48056
+ const index2 = getValueIndex(val);
48057
+ const ele = (_a2 = containerRef.current) == null ? void 0 : _a2.querySelectorAll(`.${prefixCls}-item`)[index2];
48058
+ return (ele == null ? void 0 : ele.offsetParent) && ele;
48059
+ };
48060
+ const [prevStyle, setPrevStyle] = reactExports.useState(null);
48061
+ const [nextStyle, setNextStyle] = reactExports.useState(null);
48062
+ useLayoutEffect(() => {
48063
+ if (prevValue !== value) {
48064
+ const prev2 = findValueElement(prevValue);
48065
+ const next2 = findValueElement(value);
48066
+ const calcPrevStyle = calcThumbStyle(prev2, vertical);
48067
+ const calcNextStyle = calcThumbStyle(next2, vertical);
48068
+ setPrevValue(value);
48069
+ setPrevStyle(calcPrevStyle);
48070
+ setNextStyle(calcNextStyle);
48071
+ if (prev2 && next2) {
48072
+ onMotionStart();
48073
+ } else {
48074
+ onMotionEnd();
48075
+ }
48076
+ }
48077
+ }, [value]);
48078
+ const thumbStart = reactExports.useMemo(() => {
48079
+ if (vertical) {
48080
+ return toPX((prevStyle == null ? void 0 : prevStyle.top) ?? 0);
48081
+ }
48082
+ if (direction === "rtl") {
48083
+ return toPX(-(prevStyle == null ? void 0 : prevStyle.right));
48084
+ }
48085
+ return toPX(prevStyle == null ? void 0 : prevStyle.left);
48086
+ }, [vertical, direction, prevStyle]);
48087
+ const thumbActive = reactExports.useMemo(() => {
48088
+ if (vertical) {
48089
+ return toPX((nextStyle == null ? void 0 : nextStyle.top) ?? 0);
48090
+ }
48091
+ if (direction === "rtl") {
48092
+ return toPX(-(nextStyle == null ? void 0 : nextStyle.right));
48093
+ }
48094
+ return toPX(nextStyle == null ? void 0 : nextStyle.left);
48095
+ }, [vertical, direction, nextStyle]);
48096
+ const onAppearStart = () => {
48097
+ if (vertical) {
48098
+ return {
48099
+ transform: "translateY(var(--thumb-start-top))",
48100
+ height: "var(--thumb-start-height)"
48101
+ };
48102
+ }
48103
+ return {
48104
+ transform: "translateX(var(--thumb-start-left))",
48105
+ width: "var(--thumb-start-width)"
48106
+ };
48107
+ };
48108
+ const onAppearActive = () => {
48109
+ if (vertical) {
48110
+ return {
48111
+ transform: "translateY(var(--thumb-active-top))",
48112
+ height: "var(--thumb-active-height)"
48113
+ };
48114
+ }
48115
+ return {
48116
+ transform: "translateX(var(--thumb-active-left))",
48117
+ width: "var(--thumb-active-width)"
48118
+ };
48119
+ };
48120
+ const onVisibleChanged = () => {
48121
+ setPrevStyle(null);
48122
+ setNextStyle(null);
48123
+ onMotionEnd();
48124
+ };
48125
+ if (!prevStyle || !nextStyle) {
48126
+ return null;
48127
+ }
48128
+ return /* @__PURE__ */ reactExports.createElement(CSSMotion, {
48129
+ visible: true,
48130
+ motionName,
48131
+ motionAppear: true,
48132
+ onAppearStart,
48133
+ onAppearActive,
48134
+ onVisibleChanged
48135
+ }, ({
48136
+ className: motionClassName,
48137
+ style: motionStyle
48138
+ }, ref) => {
48139
+ const mergedStyle = {
48140
+ ...motionStyle,
48141
+ "--thumb-start-left": thumbStart,
48142
+ "--thumb-start-width": toPX(prevStyle == null ? void 0 : prevStyle.width),
48143
+ "--thumb-active-left": thumbActive,
48144
+ "--thumb-active-width": toPX(nextStyle == null ? void 0 : nextStyle.width),
48145
+ "--thumb-start-top": thumbStart,
48146
+ "--thumb-start-height": toPX(prevStyle == null ? void 0 : prevStyle.height),
48147
+ "--thumb-active-top": thumbActive,
48148
+ "--thumb-active-height": toPX(nextStyle == null ? void 0 : nextStyle.height)
48149
+ };
48150
+ const motionProps = {
48151
+ ref: composeRef(thumbRef, ref),
48152
+ style: mergedStyle,
48153
+ className: clsx(`${prefixCls}-thumb`, motionClassName)
48154
+ };
48155
+ return /* @__PURE__ */ reactExports.createElement("div", motionProps);
48156
+ });
48157
+ }
48158
+ function getValidTitle(option) {
48159
+ var _a2;
48160
+ if (typeof option.title !== "undefined") {
48161
+ return option.title;
48162
+ }
48163
+ if (typeof option.label !== "object") {
48164
+ return (_a2 = option.label) == null ? void 0 : _a2.toString();
48165
+ }
48166
+ }
48167
+ function normalizeOptions(options) {
48168
+ return options.map((option) => {
48169
+ if (typeof option === "object" && option !== null) {
48170
+ const validTitle = getValidTitle(option);
48171
+ return {
48172
+ ...option,
48173
+ title: validTitle
48174
+ };
48175
+ }
48176
+ return {
48177
+ label: option == null ? void 0 : option.toString(),
48178
+ title: option == null ? void 0 : option.toString(),
48179
+ value: option
48180
+ };
48181
+ });
48182
+ }
48183
+ const InternalSegmentedOption = ({
48184
+ prefixCls,
48185
+ className,
48186
+ style: style2,
48187
+ styles: styles2,
48188
+ classNames: segmentedClassNames,
48189
+ data,
48190
+ disabled,
48191
+ checked,
48192
+ label,
48193
+ title,
48194
+ value,
48195
+ name,
48196
+ onChange,
48197
+ onFocus,
48198
+ onBlur,
48199
+ onKeyDown: onKeyDown2,
48200
+ onKeyUp,
48201
+ onMouseDown,
48202
+ itemRender = (node2) => node2
48203
+ }) => {
48204
+ const handleChange = (event) => {
48205
+ if (disabled) {
48206
+ return;
48207
+ }
48208
+ onChange(event, value);
48209
+ };
48210
+ const itemContent = /* @__PURE__ */ reactExports.createElement("label", {
48211
+ className: clsx(className, {
48212
+ [`${prefixCls}-item-disabled`]: disabled
48213
+ }),
48214
+ style: style2,
48215
+ onMouseDown
48216
+ }, /* @__PURE__ */ reactExports.createElement("input", {
48217
+ name,
48218
+ className: `${prefixCls}-item-input`,
48219
+ type: "radio",
48220
+ disabled,
48221
+ checked,
48222
+ onChange: handleChange,
48223
+ onFocus,
48224
+ onBlur,
48225
+ onKeyDown: onKeyDown2,
48226
+ onKeyUp
48227
+ }), /* @__PURE__ */ reactExports.createElement("div", {
48228
+ className: clsx(`${prefixCls}-item-label`, segmentedClassNames == null ? void 0 : segmentedClassNames.label),
48229
+ title,
48230
+ style: styles2 == null ? void 0 : styles2.label
48231
+ }, label));
48232
+ return itemRender(itemContent, {
48233
+ item: data
48234
+ });
48235
+ };
48236
+ const Segmented$1 = /* @__PURE__ */ reactExports.forwardRef((props, ref) => {
48237
+ var _a2;
48238
+ const {
48239
+ prefixCls = "rc-segmented",
48240
+ direction,
48241
+ vertical,
48242
+ options = [],
48243
+ disabled,
48244
+ defaultValue,
48245
+ value,
48246
+ name,
48247
+ onChange,
48248
+ className = "",
48249
+ style: style2,
48250
+ styles: styles2,
48251
+ classNames: segmentedClassNames,
48252
+ motionName = "thumb-motion",
48253
+ itemRender,
48254
+ ...restProps
48255
+ } = props;
48256
+ const containerRef = reactExports.useRef(null);
48257
+ const mergedRef = reactExports.useMemo(() => composeRef(containerRef, ref), [containerRef, ref]);
48258
+ const segmentedOptions = reactExports.useMemo(() => {
48259
+ return normalizeOptions(options);
48260
+ }, [options]);
48261
+ const [rawValue, setRawValue] = useControlledState(defaultValue ?? ((_a2 = segmentedOptions[0]) == null ? void 0 : _a2.value), value);
48262
+ const [thumbShow, setThumbShow] = reactExports.useState(false);
48263
+ const handleChange = (event, val) => {
48264
+ setRawValue(val);
48265
+ onChange == null ? void 0 : onChange(val);
48266
+ };
48267
+ const divProps = omit(restProps, ["children"]);
48268
+ const [isKeyboard, setIsKeyboard] = reactExports.useState(false);
48269
+ const [isFocused, setIsFocused] = reactExports.useState(false);
48270
+ const handleFocus = () => {
48271
+ setIsFocused(true);
48272
+ };
48273
+ const handleBlur = () => {
48274
+ setIsFocused(false);
48275
+ };
48276
+ const handleMouseDown = () => {
48277
+ setIsKeyboard(false);
48278
+ };
48279
+ const handleKeyUp = (event) => {
48280
+ if (event.key === "Tab") {
48281
+ setIsKeyboard(true);
48282
+ }
48283
+ };
48284
+ const onOffset = (offset2) => {
48285
+ const currentIndex = segmentedOptions.findIndex((option) => option.value === rawValue);
48286
+ const total = segmentedOptions.length;
48287
+ const nextIndex = (currentIndex + offset2 + total) % total;
48288
+ const nextOption = segmentedOptions[nextIndex];
48289
+ if (nextOption) {
48290
+ setRawValue(nextOption.value);
48291
+ onChange == null ? void 0 : onChange(nextOption.value);
48292
+ }
48293
+ };
48294
+ const handleKeyDown = (event) => {
48295
+ switch (event.key) {
48296
+ case "ArrowLeft":
48297
+ case "ArrowUp":
48298
+ onOffset(-1);
48299
+ break;
48300
+ case "ArrowRight":
48301
+ case "ArrowDown":
48302
+ onOffset(1);
48303
+ break;
48304
+ }
48305
+ };
48306
+ const renderOption = (segmentedOption) => {
48307
+ const {
48308
+ value: optionValue,
48309
+ disabled: optionDisabled
48310
+ } = segmentedOption;
48311
+ return /* @__PURE__ */ reactExports.createElement(InternalSegmentedOption, _extends$19({}, segmentedOption, {
48312
+ name,
48313
+ data: segmentedOption,
48314
+ itemRender,
48315
+ key: optionValue,
48316
+ prefixCls,
48317
+ className: clsx(segmentedOption.className, `${prefixCls}-item`, segmentedClassNames == null ? void 0 : segmentedClassNames.item, {
48318
+ [`${prefixCls}-item-selected`]: optionValue === rawValue && !thumbShow,
48319
+ [`${prefixCls}-item-focused`]: isFocused && isKeyboard && optionValue === rawValue
48320
+ }),
48321
+ style: styles2 == null ? void 0 : styles2.item,
48322
+ classNames: segmentedClassNames,
48323
+ styles: styles2,
48324
+ checked: optionValue === rawValue,
48325
+ onChange: handleChange,
48326
+ onFocus: handleFocus,
48327
+ onBlur: handleBlur,
48328
+ onKeyDown: handleKeyDown,
48329
+ onKeyUp: handleKeyUp,
48330
+ onMouseDown: handleMouseDown,
48331
+ disabled: !!disabled || !!optionDisabled
48332
+ }));
48333
+ };
48334
+ return /* @__PURE__ */ reactExports.createElement("div", _extends$19({
48335
+ role: "radiogroup",
48336
+ "aria-label": "segmented control",
48337
+ tabIndex: disabled ? void 0 : 0,
48338
+ "aria-orientation": vertical ? "vertical" : "horizontal",
48339
+ style: style2
48340
+ }, divProps, {
48341
+ className: clsx(prefixCls, {
48342
+ [`${prefixCls}-rtl`]: direction === "rtl",
48343
+ [`${prefixCls}-disabled`]: disabled,
48344
+ [`${prefixCls}-vertical`]: vertical
48345
+ }, className),
48346
+ ref: mergedRef
48347
+ }), /* @__PURE__ */ reactExports.createElement("div", {
48348
+ className: `${prefixCls}-group`
48349
+ }, /* @__PURE__ */ reactExports.createElement(MotionThumb, {
48350
+ vertical,
48351
+ prefixCls,
48352
+ value: rawValue,
48353
+ containerRef,
48354
+ motionName: `${prefixCls}-${motionName}`,
48355
+ direction,
48356
+ getValueIndex: (val) => segmentedOptions.findIndex((n2) => n2.value === val),
48357
+ onMotionStart: () => {
48358
+ setThumbShow(true);
48359
+ },
48360
+ onMotionEnd: () => {
48361
+ setThumbShow(false);
48362
+ }
48363
+ }), segmentedOptions.map(renderOption)));
48364
+ });
48365
+ const TypedSegmented = Segmented$1;
48366
+ function getItemDisabledStyle(cls, token2) {
48367
+ return {
48368
+ [`${cls}, ${cls}:hover, ${cls}:focus`]: {
48369
+ color: token2.colorTextDisabled,
48370
+ cursor: "not-allowed"
48371
+ }
48372
+ };
48373
+ }
48374
+ const getItemSelectedStyle = (token2) => {
48375
+ return {
48376
+ background: token2.itemSelectedBg,
48377
+ boxShadow: token2.boxShadowTertiary
48378
+ };
48379
+ };
48380
+ const segmentedTextEllipsisCss = {
48381
+ overflow: "hidden",
48382
+ // handle text ellipsis
48383
+ ...textEllipsis
48384
+ };
48385
+ const genSegmentedStyle = (token2) => {
48386
+ const {
48387
+ componentCls,
48388
+ motionDurationSlow,
48389
+ motionEaseInOut,
48390
+ motionDurationMid
48391
+ } = token2;
48392
+ const labelHeight = token2.calc(token2.controlHeight).sub(token2.calc(token2.trackPadding).mul(2)).equal();
48393
+ const labelHeightLG = token2.calc(token2.controlHeightLG).sub(token2.calc(token2.trackPadding).mul(2)).equal();
48394
+ const labelHeightSM = token2.calc(token2.controlHeightSM).sub(token2.calc(token2.trackPadding).mul(2)).equal();
48395
+ return {
48396
+ [componentCls]: {
48397
+ ...resetComponent(token2),
48398
+ display: "inline-block",
48399
+ padding: token2.trackPadding,
48400
+ color: token2.itemColor,
48401
+ background: token2.trackBg,
48402
+ borderRadius: token2.borderRadius,
48403
+ transition: `all ${motionDurationMid}`,
48404
+ ...genFocusStyle(token2),
48405
+ [`${componentCls}-group`]: {
48406
+ position: "relative",
48407
+ display: "flex",
48408
+ alignItems: "stretch",
48409
+ justifyItems: "flex-start",
48410
+ flexDirection: "row",
48411
+ width: "100%"
48412
+ },
48413
+ // RTL styles
48414
+ [`&${componentCls}-rtl`]: {
48415
+ direction: "rtl"
48416
+ },
48417
+ [`&${componentCls}-vertical`]: {
48418
+ [`${componentCls}-group`]: {
48419
+ flexDirection: "column"
48420
+ },
48421
+ [`${componentCls}-thumb`]: {
48422
+ width: "100%",
48423
+ height: 0,
48424
+ padding: `0 ${unit$1(token2.paddingXXS)}`
48425
+ }
48426
+ },
48427
+ // block styles
48428
+ [`&${componentCls}-block`]: {
48429
+ display: "flex"
48430
+ },
48431
+ [`&${componentCls}-block ${componentCls}-item`]: {
48432
+ flex: 1,
48433
+ minWidth: 0
48434
+ },
48435
+ // item styles
48436
+ [`${componentCls}-item`]: {
48437
+ position: "relative",
48438
+ textAlign: "center",
48439
+ cursor: "pointer",
48440
+ transition: `color ${motionDurationMid}`,
48441
+ borderRadius: token2.borderRadiusSM,
48442
+ // Fix Safari render bug
48443
+ // https://github.com/ant-design/ant-design/issues/45250
48444
+ transform: "translateZ(0)",
48445
+ "&-selected": {
48446
+ ...getItemSelectedStyle(token2),
48447
+ color: token2.itemSelectedColor
48448
+ },
48449
+ "&-focused": genFocusOutline(token2),
48450
+ "&::after": {
48451
+ content: '""',
48452
+ position: "absolute",
48453
+ zIndex: -1,
48454
+ width: "100%",
48455
+ height: "100%",
48456
+ top: 0,
48457
+ insetInlineStart: 0,
48458
+ borderRadius: "inherit",
48459
+ opacity: 0,
48460
+ // This is mandatory to make it not clickable or hoverable
48461
+ // Ref: https://github.com/ant-design/ant-design/issues/40888
48462
+ pointerEvents: "none",
48463
+ transition: ["opacity", "background-color"].map((prop) => `${prop} ${motionDurationMid}`).join(", ")
48464
+ },
48465
+ [`&:not(${componentCls}-item-selected):not(${componentCls}-item-disabled)`]: {
48466
+ "&:hover, &:active": {
48467
+ color: token2.itemHoverColor
48468
+ },
48469
+ "&:hover::after": {
48470
+ opacity: 1,
48471
+ backgroundColor: token2.itemHoverBg
48472
+ },
48473
+ "&:active::after": {
48474
+ opacity: 1,
48475
+ backgroundColor: token2.itemActiveBg
48476
+ }
48477
+ },
48478
+ "&-label": {
48479
+ minHeight: labelHeight,
48480
+ lineHeight: unit$1(labelHeight),
48481
+ padding: `0 ${unit$1(token2.segmentedPaddingHorizontal)}`,
48482
+ ...segmentedTextEllipsisCss
48483
+ },
48484
+ // syntactic sugar to add `icon` for Segmented Item
48485
+ "&-icon + *": {
48486
+ marginInlineStart: token2.calc(token2.marginSM).div(2).equal()
48487
+ },
48488
+ "&-input": {
48489
+ position: "absolute",
48490
+ insetBlockStart: 0,
48491
+ insetInlineStart: 0,
48492
+ width: 0,
48493
+ height: 0,
48494
+ opacity: 0,
48495
+ pointerEvents: "none"
48496
+ }
48497
+ },
48498
+ // thumb styles
48499
+ [`${componentCls}-thumb`]: {
48500
+ ...getItemSelectedStyle(token2),
48501
+ position: "absolute",
48502
+ insetBlockStart: 0,
48503
+ insetInlineStart: 0,
48504
+ width: 0,
48505
+ height: "100%",
48506
+ padding: `${unit$1(token2.paddingXXS)} 0`,
48507
+ borderRadius: token2.borderRadiusSM,
48508
+ [`& ~ ${componentCls}-item:not(${componentCls}-item-selected):not(${componentCls}-item-disabled)::after`]: {
48509
+ backgroundColor: "transparent"
48510
+ }
48511
+ },
48512
+ // size styles
48513
+ [`&${componentCls}-lg`]: {
48514
+ borderRadius: token2.borderRadiusLG,
48515
+ [`${componentCls}-item-label`]: {
48516
+ minHeight: labelHeightLG,
48517
+ lineHeight: unit$1(labelHeightLG),
48518
+ padding: `0 ${unit$1(token2.segmentedPaddingHorizontal)}`,
48519
+ fontSize: token2.fontSizeLG
48520
+ },
48521
+ [`${componentCls}-item, ${componentCls}-thumb`]: {
48522
+ borderRadius: token2.borderRadius
48523
+ }
48524
+ },
48525
+ [`&${componentCls}-sm`]: {
48526
+ borderRadius: token2.borderRadiusSM,
48527
+ [`${componentCls}-item-label`]: {
48528
+ minHeight: labelHeightSM,
48529
+ lineHeight: unit$1(labelHeightSM),
48530
+ padding: `0 ${unit$1(token2.segmentedPaddingHorizontalSM)}`
48531
+ },
48532
+ [`${componentCls}-item, ${componentCls}-thumb`]: {
48533
+ borderRadius: token2.borderRadiusXS
48534
+ }
48535
+ },
48536
+ // disabled styles
48537
+ ...getItemDisabledStyle(`&-disabled ${componentCls}-item`, token2),
48538
+ ...getItemDisabledStyle(`${componentCls}-item-disabled`, token2),
48539
+ // transition effect when `appear-active`
48540
+ [`${componentCls}-thumb-motion-appear-active`]: {
48541
+ willChange: "transform, width",
48542
+ transition: [`transform`, `width`].map((prop) => `${prop} ${motionDurationSlow} ${motionEaseInOut}`).join(", ")
48543
+ },
48544
+ [`&${componentCls}-shape-round`]: {
48545
+ borderRadius: 9999,
48546
+ [`${componentCls}-item, ${componentCls}-thumb`]: {
48547
+ borderRadius: 9999
48548
+ }
48549
+ }
48550
+ }
48551
+ };
48552
+ };
48553
+ const prepareComponentToken$8 = (token2) => {
48554
+ const {
48555
+ colorTextLabel,
48556
+ colorText,
48557
+ colorFillSecondary,
48558
+ colorBgElevated,
48559
+ colorFill,
48560
+ lineWidthBold,
48561
+ colorBgLayout
48562
+ } = token2;
48563
+ return {
48564
+ trackPadding: lineWidthBold,
48565
+ trackBg: colorBgLayout,
48566
+ itemColor: colorTextLabel,
48567
+ itemHoverColor: colorText,
48568
+ itemHoverBg: colorFillSecondary,
48569
+ itemSelectedBg: colorBgElevated,
48570
+ itemActiveBg: colorFill,
48571
+ itemSelectedColor: colorText
48572
+ };
48573
+ };
48574
+ const useStyle$d = genStyleHooks("Segmented", (token2) => {
48575
+ const {
48576
+ lineWidth,
48577
+ calc
48578
+ } = token2;
48579
+ const segmentedToken = merge$1(token2, {
48580
+ segmentedPaddingHorizontal: calc(token2.controlPaddingHorizontal).sub(lineWidth).equal(),
48581
+ segmentedPaddingHorizontalSM: calc(token2.controlPaddingHorizontalSM).sub(lineWidth).equal()
48582
+ });
48583
+ return genSegmentedStyle(segmentedToken);
48584
+ }, prepareComponentToken$8);
48585
+ function isSegmentedLabeledOptionWithIcon(option) {
48586
+ return isPlainObject$1(option) && !!(option == null ? void 0 : option.icon);
48587
+ }
48588
+ const InternalSegmented = /* @__PURE__ */ reactExports.forwardRef((props, ref) => {
48589
+ const defaultName = useId();
48590
+ const {
48591
+ prefixCls: customizePrefixCls,
48592
+ className,
48593
+ rootClassName,
48594
+ block,
48595
+ options = [],
48596
+ size: customSize,
48597
+ style: style2,
48598
+ vertical,
48599
+ orientation,
48600
+ shape = "default",
48601
+ name = defaultName,
48602
+ styles: styles2,
48603
+ classNames,
48604
+ ...restProps
48605
+ } = props;
48606
+ const {
48607
+ getPrefixCls,
48608
+ direction,
48609
+ className: contextClassName,
48610
+ style: contextStyle,
48611
+ classNames: contextClassNames,
48612
+ styles: contextStyles
48613
+ } = useComponentConfig("segmented");
48614
+ const mergedProps = {
48615
+ ...props,
48616
+ options,
48617
+ size: customSize,
48618
+ shape
48619
+ };
48620
+ const [mergedClassNames, mergedStyles] = useMergeSemantic([contextClassNames, classNames], [contextStyles, styles2], {
48621
+ props: mergedProps
48622
+ });
48623
+ const prefixCls = getPrefixCls("segmented", customizePrefixCls);
48624
+ const [hashId, cssVarCls] = useStyle$d(prefixCls);
48625
+ const mergedSize = useSize(customSize);
48626
+ const extendedOptions = reactExports.useMemo(() => options.map((option) => {
48627
+ if (isSegmentedLabeledOptionWithIcon(option)) {
48628
+ const {
48629
+ icon,
48630
+ label,
48631
+ ...restOption
48632
+ } = option;
48633
+ return {
48634
+ ...restOption,
48635
+ label: /* @__PURE__ */ reactExports.createElement(reactExports.Fragment, null, /* @__PURE__ */ reactExports.createElement("span", {
48636
+ className: clsx(`${prefixCls}-item-icon`, mergedClassNames.icon),
48637
+ style: mergedStyles.icon
48638
+ }, icon), label && /* @__PURE__ */ reactExports.createElement("span", null, label))
48639
+ };
48640
+ }
48641
+ return option;
48642
+ }), [options, prefixCls, mergedClassNames.icon, mergedStyles.icon]);
48643
+ const [, mergedVertical] = useOrientation(orientation, vertical);
48644
+ const cls = clsx(className, rootClassName, contextClassName, mergedClassNames.root, {
48645
+ [`${prefixCls}-block`]: block,
48646
+ [`${prefixCls}-sm`]: mergedSize === "small",
48647
+ [`${prefixCls}-lg`]: mergedSize === "large",
48648
+ [`${prefixCls}-vertical`]: mergedVertical,
48649
+ [`${prefixCls}-shape-${shape}`]: shape === "round"
48650
+ }, hashId, cssVarCls);
48651
+ const mergedStyle = {
48652
+ ...mergedStyles.root,
48653
+ ...contextStyle,
48654
+ ...style2
48655
+ };
48656
+ const itemRender = (node2, {
48657
+ item
48658
+ }) => {
48659
+ if (!item.tooltip) {
48660
+ return node2;
48661
+ }
48662
+ const tooltipProps = isPlainObject$1(item.tooltip) ? item.tooltip : {
48663
+ title: item.tooltip
48664
+ };
48665
+ return /* @__PURE__ */ reactExports.createElement(Tooltip, {
48666
+ ...tooltipProps
48667
+ }, node2);
48668
+ };
48669
+ return /* @__PURE__ */ reactExports.createElement(TypedSegmented, {
48670
+ ...restProps,
48671
+ name,
48672
+ className: cls,
48673
+ style: mergedStyle,
48674
+ classNames: mergedClassNames,
48675
+ styles: mergedStyles,
48676
+ itemRender,
48677
+ options: extendedOptions,
48678
+ ref,
48679
+ prefixCls,
48680
+ direction,
48681
+ vertical: mergedVertical
48682
+ });
48683
+ });
48684
+ const Segmented = InternalSegmented;
48010
48685
  var UpOutlined$1 = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M890.5 755.3L537.9 269.2c-12.8-17.6-39-17.6-51.7 0L133.5 755.3A8 8 0 00140 768h75c5.1 0 9.9-2.5 12.9-6.6L512 369.8l284.1 391.6c3 4.1 7.8 6.6 12.9 6.6h75c6.5 0 10.3-7.4 6.5-12.7z" } }] }, "name": "up", "theme": "outlined" };
48011
48686
  function _extends$H() {
48012
48687
  _extends$H = Object.assign ? Object.assign.bind() : function(target) {
@@ -49125,7 +49800,7 @@ html body {
49125
49800
  const inputRef = reactExports.useRef(null);
49126
49801
  const rootCls = useCSSVarCls(prefixCls);
49127
49802
  const [hashId, cssVarCls] = useSharedStyle(prefixCls, rootClassName);
49128
- useStyle$f(prefixCls, rootCls);
49803
+ useStyle$g(prefixCls, rootCls);
49129
49804
  const {
49130
49805
  compactSize,
49131
49806
  compactItemClassnames
@@ -51136,7 +51811,7 @@ html body {
51136
51811
  } = props;
51137
51812
  const prefixCls = getPrefixCls("input-group", customizePrefixCls);
51138
51813
  const inputPrefixCls = getPrefixCls("input");
51139
- const [hashId, cssVarCls] = useStyle$f(inputPrefixCls);
51814
+ const [hashId, cssVarCls] = useStyle$g(inputPrefixCls);
51140
51815
  const cls = clsx(prefixCls, cssVarCls, {
51141
51816
  [`${prefixCls}-lg`]: props.size === "large",
51142
51817
  [`${prefixCls}-sm`]: props.size === "small",
@@ -53990,7 +54665,7 @@ html body {
53990
54665
  } = useComponentConfig("message");
53991
54666
  const prefixCls = getPrefixCls("message");
53992
54667
  const rootCls = useCSSVarCls(prefixCls);
53993
- const [hashId, cssVarCls] = useStyle$r(prefixCls, rootCls);
54668
+ const [hashId, cssVarCls] = useStyle$s(prefixCls, rootCls);
53994
54669
  const noticePrefixCls = `${prefixCls}-notice`;
53995
54670
  const configList = items.map((item) => {
53996
54671
  const {
@@ -54274,7 +54949,7 @@ html body {
54274
54949
  const rootPrefixCls = getPrefixCls();
54275
54950
  const prefixCls = customizePrefixCls || getPrefixCls("modal");
54276
54951
  const rootCls = useCSSVarCls(rootPrefixCls);
54277
- const [hashId, cssVarCls] = useStyle$m(prefixCls, rootCls);
54952
+ const [hashId, cssVarCls] = useStyle$n(prefixCls, rootCls);
54278
54953
  const [mergedClassNames, mergedStyles] = useMergeSemantic([contextClassNames, classNames], [contextStyles, styles2], {
54279
54954
  props
54280
54955
  });
@@ -67811,7 +68486,7 @@ html body {
67811
68486
  };
67812
68487
  const client = makeClient(true);
67813
68488
  const publicClient = makeClient(false);
67814
- const version = "2.9.0";
68489
+ const version = "2.10.0";
67815
68490
  const DEFAULT_BASEMAP_STYLE = `https://cdn.jsdelivr.net/npm/col-browser@${version}/basemap/style.json`;
67816
68491
  const config = {
67817
68492
  dataApi: "https://api.checklistbank.org/",
@@ -78058,7 +78733,7 @@ html body {
78058
78733
  });
78059
78734
  };
78060
78735
  const POOL_SIZE = 16;
78061
- const isMappable$1 = (r2) => {
78736
+ const isMappable = (r2) => {
78062
78737
  var _a2, _b2;
78063
78738
  return ((_a2 = r2 == null ? void 0 : r2.area) == null ? void 0 : _a2.gazetteer) !== "text" && !!((_b2 = r2 == null ? void 0 : r2.area) == null ? void 0 : _b2.globalId);
78064
78739
  };
@@ -78075,7 +78750,8 @@ html body {
78075
78750
  await Promise.all(runners);
78076
78751
  return results;
78077
78752
  };
78078
- const searchDescendants = async (datasetKey, focalId, ranks2) => {
78753
+ const clientJson = (url) => client(url).then((res) => res == null ? void 0 : res.data);
78754
+ const searchDescendants = async (fetchJson, datasetKey, focalId, ranks2) => {
78079
78755
  var _a2;
78080
78756
  if (ranks2.length === 0) return [];
78081
78757
  const params = new URLSearchParams();
@@ -78086,8 +78762,7 @@ html body {
78086
78762
  );
78087
78763
  params.append("limit", "1000");
78088
78764
  const url = `${config.dataApi}dataset/${datasetKey}/nameusage/search?${params}`;
78089
- const res = await client(url);
78090
- const list = ((_a2 = res == null ? void 0 : res.data) == null ? void 0 : _a2.result) || [];
78765
+ const list = ((_a2 = await fetchJson(url)) == null ? void 0 : _a2.result) || [];
78091
78766
  return list.filter((u) => {
78092
78767
  var _a3;
78093
78768
  return (_a3 = u == null ? void 0 : u.usage) == null ? void 0 : _a3.id;
@@ -78101,34 +78776,39 @@ html body {
78101
78776
  };
78102
78777
  });
78103
78778
  };
78104
- const fetchDistributions = async (datasetKey, taxonId) => {
78779
+ const fetchDistributions = async (fetchJson, datasetKey, taxonId) => {
78105
78780
  const url = `${config.dataApi}dataset/${datasetKey}/taxon/${encodeURIComponent(taxonId)}/distribution`;
78106
78781
  try {
78107
- const res = await client(url);
78108
- return Array.isArray(res == null ? void 0 : res.data) ? res.data : [];
78782
+ const data = await fetchJson(url);
78783
+ return Array.isArray(data) ? data : [];
78109
78784
  } catch {
78110
78785
  return [];
78111
78786
  }
78112
78787
  };
78113
- const fetchDescendants = async ({ datasetKey, focalTaxon, rankOrder }) => {
78788
+ const fetchDescendants = async ({
78789
+ datasetKey,
78790
+ focalTaxon,
78791
+ rankOrder,
78792
+ fetchJson = clientJson
78793
+ }) => {
78114
78794
  var _a2;
78115
78795
  const ranks2 = getDescendantRanks((_a2 = focalTaxon == null ? void 0 : focalTaxon.name) == null ? void 0 : _a2.rank, rankOrder);
78116
78796
  let descendantsFailed = false;
78117
78797
  let list = [];
78118
78798
  try {
78119
- list = await searchDescendants(datasetKey, focalTaxon.id, ranks2);
78799
+ list = await searchDescendants(fetchJson, datasetKey, focalTaxon.id, ranks2);
78120
78800
  } catch {
78121
78801
  descendantsFailed = true;
78122
78802
  return { taxa: [], descendantsFailed };
78123
78803
  }
78124
78804
  const distributions = await runPool(
78125
78805
  list,
78126
- (t2) => fetchDistributions(datasetKey, t2.id),
78806
+ (t2) => fetchDistributions(fetchJson, datasetKey, t2.id),
78127
78807
  POOL_SIZE
78128
78808
  );
78129
78809
  const taxa = list.map((t2, i) => {
78130
78810
  const all = distributions[i] || [];
78131
- return { ...t2, distributions: all, mappable: all.filter(isMappable$1) };
78811
+ return { ...t2, distributions: all, mappable: all.filter(isMappable) };
78132
78812
  });
78133
78813
  return { taxa, descendantsFailed };
78134
78814
  };
@@ -78181,6 +78861,53 @@ html body {
78181
78861
  return { url: parsed.toString() };
78182
78862
  };
78183
78863
  };
78864
+ const FILTER = "hasCoordinate=true&hasGeospatialIssue=false&occurrenceStatus=PRESENT";
78865
+ const taxonQuery = (checklistKey, taxonKey) => `checklistKey=${encodeURIComponent(checklistKey)}&taxonKey=${encodeURIComponent(taxonKey)}`;
78866
+ const gbifTileUrl = (checklistKey, taxonKey) => `${config.gbifApi}/v2/map/occurrence/density/{z}/{x}/{y}@1x.png?srs=EPSG%3A3857&style=iNaturalist.poly&bin=hex&hexPerTile=64&${FILTER}&${taxonQuery(checklistKey, taxonKey)}`;
78867
+ const gbifSearchUrl = (checklistKey, taxonKey) => `${config.gbifPortal}/occurrence/search?checklist_key=${encodeURIComponent(
78868
+ checklistKey
78869
+ )}&taxon_key=${encodeURIComponent(
78870
+ taxonKey
78871
+ )}&has_coordinate=true&has_geospatial_issue=false&occurrence_status=present`;
78872
+ const fetchGbifCount = async (checklistKey, taxonKey) => {
78873
+ var _a2;
78874
+ try {
78875
+ const res = await fetch(
78876
+ `${config.gbifApi}/v1/occurrence/search?${taxonQuery(checklistKey, taxonKey)}&${FILTER}&limit=0`
78877
+ );
78878
+ if (!res.ok) return null;
78879
+ return ((_a2 = await res.json()) == null ? void 0 : _a2.count) ?? 0;
78880
+ } catch {
78881
+ return null;
78882
+ }
78883
+ };
78884
+ const useGbifCount = (checklistKey, taxonKey) => {
78885
+ const [count, setCount] = reactExports.useState(null);
78886
+ reactExports.useEffect(() => {
78887
+ setCount(null);
78888
+ if (!checklistKey || !taxonKey) return void 0;
78889
+ let cancelled = false;
78890
+ fetchGbifCount(checklistKey, taxonKey).then((c) => {
78891
+ if (!cancelled) setCount(c);
78892
+ });
78893
+ return () => {
78894
+ cancelled = true;
78895
+ };
78896
+ }, [checklistKey, taxonKey]);
78897
+ return count;
78898
+ };
78899
+ const GbifLegendEntry = ({ style: style2 }) => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { style: { display: "flex", alignItems: "center", gap: 6, ...style2 }, children: [
78900
+ /* @__PURE__ */ jsxRuntimeExports.jsx("svg", { width: "12", height: "12", viewBox: "0 0 12 12", "aria-hidden": "true", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
78901
+ "polygon",
78902
+ {
78903
+ points: "3,1 9,1 11,6 9,11 3,11 1,6",
78904
+ fill: "#de1e6e",
78905
+ stroke: "rgba(0,0,0,0.25)",
78906
+ strokeWidth: "0.75"
78907
+ }
78908
+ ) }),
78909
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: "GBIF occurrences" })
78910
+ ] });
78184
78911
  const wrapStyle = {
78185
78912
  position: "absolute",
78186
78913
  bottom: 8,
@@ -78246,18 +78973,6 @@ html body {
78246
78973
  paddingLeft: 4
78247
78974
  };
78248
78975
  const totalCount = (groups) => groups.reduce((sum, g2) => sum + g2.taxa.length, 0);
78249
- const GbifHexEntry = () => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { style: rowStyle, children: [
78250
- /* @__PURE__ */ jsxRuntimeExports.jsx("svg", { width: "12", height: "12", viewBox: "0 0 12 12", "aria-hidden": "true", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
78251
- "polygon",
78252
- {
78253
- points: "3,1 9,1 11,6 9,11 3,11 1,6",
78254
- fill: "#de1e6e",
78255
- stroke: "rgba(0,0,0,0.25)",
78256
- strokeWidth: "0.75"
78257
- }
78258
- ) }),
78259
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: "GBIF occurrences" })
78260
- ] });
78261
78976
  const IncludedTaxaLegend = ({ visibleGroups, unmappableGroups, showGbif }) => {
78262
78977
  const [showUnmappable, setShowUnmappable] = reactExports.useState(false);
78263
78978
  const visibleCount = totalCount(visibleGroups);
@@ -78272,7 +78987,7 @@ html body {
78272
78987
  /* @__PURE__ */ jsxRuntimeExports.jsx("span", { style: { fontStyle: "italic" }, children: t2.displayName || t2.scientificName })
78273
78988
  ] }, t2.id))
78274
78989
  ] }, g2.rank)),
78275
- showGbif && /* @__PURE__ */ jsxRuntimeExports.jsx(GbifHexEntry, {})
78990
+ showGbif && /* @__PURE__ */ jsxRuntimeExports.jsx(GbifLegendEntry, { style: rowStyle })
78276
78991
  ] }),
78277
78992
  unmappableCount > 0 && /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
78278
78993
  /* @__PURE__ */ jsxRuntimeExports.jsxs(
@@ -78321,14 +79036,35 @@ html body {
78321
79036
  if (cached === null) cached = probe();
78322
79037
  return cached;
78323
79038
  };
78324
- const POPUP_FIELDS = [
78325
- "establishmentMeans",
78326
- "degreeOfEstablishment",
78327
- "pathway",
78328
- "threatStatus",
78329
- "year",
78330
- "lifeStage"
78331
- ];
79039
+ const computeBounds = (features) => {
79040
+ var _a2;
79041
+ let minLng = Infinity, minLat = Infinity, maxLng = -Infinity, maxLat = -Infinity;
79042
+ const visit = (coords) => {
79043
+ if (typeof coords[0] === "number") {
79044
+ const [lng, lat] = coords;
79045
+ if (lng < minLng) minLng = lng;
79046
+ if (lng > maxLng) maxLng = lng;
79047
+ if (lat < minLat) minLat = lat;
79048
+ if (lat > maxLat) maxLat = lat;
79049
+ } else {
79050
+ for (let i = 0; i < coords.length; i++) visit(coords[i]);
79051
+ }
79052
+ };
79053
+ for (let i = 0; i < features.length; i++) {
79054
+ const g2 = (_a2 = features[i]) == null ? void 0 : _a2.geometry;
79055
+ if (g2 == null ? void 0 : g2.coordinates) visit(g2.coordinates);
79056
+ }
79057
+ if (minLng === Infinity) return null;
79058
+ return [
79059
+ [minLng, minLat],
79060
+ [maxLng, maxLat]
79061
+ ];
79062
+ };
79063
+ const flattenFeatures = (geojson) => {
79064
+ if (!geojson) return [];
79065
+ if (geojson.type === "FeatureCollection") return geojson.features || [];
79066
+ return [geojson];
79067
+ };
78332
79068
  const ESTABLISHMENT_MEANS = [
78333
79069
  { key: "nativeendemic", label: "Native endemic", color: "#0F8554" },
78334
79070
  { key: "native", label: "Native", color: "#87C55F" },
@@ -78342,25 +79078,65 @@ html body {
78342
79078
  { key: "vagrant", label: "Vagrant", color: "#F6CF71" },
78343
79079
  { key: "uncertain", label: "Uncertain", color: "#8BE0A4" }
78344
79080
  ];
78345
- const ESTABLISHMENT_COLORS = Object.fromEntries(
78346
- ESTABLISHMENT_MEANS.map((m2) => [m2.key, m2.color])
78347
- );
79081
+ const COLORS = Object.fromEntries(ESTABLISHMENT_MEANS.map((m2) => [m2.key, m2.color]));
78348
79082
  const MISSING_COLOR = "#66C5CC";
78349
- const normalizeKey = (v2) => String(v2 || "").toLowerCase().replace(/[^a-z]/g, "");
78350
- const resolveKey = (record) => {
78351
- const raw = record == null ? void 0 : record.establishmentMeans;
78352
- if (raw == null || raw === "") return null;
78353
- const k = normalizeKey(raw);
78354
- return ESTABLISHMENT_COLORS[k] ? k : "uncertain";
78355
- };
78356
- const colorFor = (record) => {
78357
- const k = resolveKey(record);
78358
- return k == null ? MISSING_COLOR : ESTABLISHMENT_COLORS[k];
79083
+ const meansKey = (value) => {
79084
+ if (value == null || value === "") return null;
79085
+ const k = String(value).toLowerCase().replace(/[^a-z]/g, "");
79086
+ return COLORS[k] ? k : "uncertain";
79087
+ };
79088
+ const meansColor = (value) => {
79089
+ const k = meansKey(value);
79090
+ return k == null ? MISSING_COLOR : COLORS[k];
79091
+ };
79092
+ const LAND = "land";
79093
+ const EEZ = "eez";
79094
+ const hasEezVariant = (area) => (area == null ? void 0 : area.gazetteer) === "iso" && /^[A-Z]{2}$/i.test((area == null ? void 0 : area.id) || "");
79095
+ const shapeUrl = (area, variant = LAND) => `${config.dataApi}vocab/area/${area.gazetteer}:${encodeURIComponent(
79096
+ area.id
79097
+ )}.geojson${variant === EEZ && hasEezVariant(area) ? "?variant=eez" : ""}`;
79098
+ const isMarine = (environments) => Array.isArray(environments) && environments.some((e2) => String(e2).toLowerCase() === "marine");
79099
+ const defaultVariant = (environments) => isMarine(environments) ? EEZ : LAND;
79100
+ const cache = /* @__PURE__ */ new Map();
79101
+ const fetchShape = (area, variant = LAND) => {
79102
+ const url = shapeUrl(area, variant);
79103
+ if (!cache.has(url)) {
79104
+ cache.set(
79105
+ url,
79106
+ fetch(url).then((r2) => r2.ok ? r2.json() : null).catch(() => null)
79107
+ );
79108
+ }
79109
+ return cache.get(url);
78359
79110
  };
79111
+ const OPTIONS = [
79112
+ { label: "Land", value: LAND },
79113
+ {
79114
+ label: /* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip, { title: "Countries with their exclusive economic zone, as GBIF uses them", children: "EEZ" }),
79115
+ value: EEZ
79116
+ }
79117
+ ];
79118
+ const AreaVariantSwitch = ({ value, onChange, style: style2 }) => /* @__PURE__ */ jsxRuntimeExports.jsx(
79119
+ Segmented,
79120
+ {
79121
+ size: "small",
79122
+ options: OPTIONS,
79123
+ value,
79124
+ onChange,
79125
+ style: style2
79126
+ }
79127
+ );
79128
+ const POPUP_FIELDS = [
79129
+ "establishmentMeans",
79130
+ "degreeOfEstablishment",
79131
+ "pathway",
79132
+ "threatStatus",
79133
+ "year",
79134
+ "lifeStage"
79135
+ ];
79136
+ const colorFor = (record) => meansColor(record == null ? void 0 : record.establishmentMeans);
78360
79137
  const GBIF_VISIBLE_KEY = "gbif-visible";
78361
79138
  const readStoredGbifVisible = (defaultValue) => readSetting(GBIF_VISIBLE_KEY, defaultValue);
78362
79139
  const writeStoredGbifVisible = (visible) => writeSetting(GBIF_VISIBLE_KEY, visible);
78363
- const GBIF_TILE_PATH = "/v2/map/occurrence/density/{z}/{x}/{y}@1x.png?srs=EPSG%3A3857&style=iNaturalist.poly&bin=hex&hexPerTile=64&hasCoordinate=true&hasGeospatialIssue=false&occurrenceStatus=PRESENT&checklistKey={checklistKey}&taxonKey={taxonKey}";
78364
79140
  const FOCAL_SOURCE = "col-focal-distributions";
78365
79141
  const FOCAL_FILL = "col-focal-fill";
78366
79142
  const FOCAL_LINE = "col-focal-line";
@@ -78369,20 +79145,6 @@ html body {
78369
79145
  const descendantSourceId = (id) => `col-descendant-${id}`;
78370
79146
  const descendantFillId = (id) => `col-descendant-fill-${id}`;
78371
79147
  const descendantLineId = (id) => `col-descendant-line-${id}`;
78372
- const cache = /* @__PURE__ */ new Map();
78373
- const fetchShape = (gazetteer, id) => {
78374
- const key2 = `${gazetteer}:${id}`;
78375
- if (cache.has(key2)) return cache.get(key2);
78376
- const url = `${config.dataApi}vocab/area/${key2}`;
78377
- const p = client(url, {
78378
- headers: { Accept: "application/geo+json" }
78379
- }).then(
78380
- (r2) => r2.data,
78381
- () => null
78382
- );
78383
- cache.set(key2, p);
78384
- return p;
78385
- };
78386
79148
  const escapeHtml = (s) => String(s).replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
78387
79149
  const popupHtml = (record) => {
78388
79150
  var _a2, _b2;
@@ -78414,54 +79176,17 @@ html body {
78414
79176
  const tokens = scientificName.trim().split(/\s+/);
78415
79177
  return tokens[tokens.length - 1];
78416
79178
  };
78417
- const GbifLegendEntry = () => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { style: { display: "flex", alignItems: "center", gap: 6 }, children: [
78418
- /* @__PURE__ */ jsxRuntimeExports.jsx("svg", { width: "12", height: "12", viewBox: "0 0 12 12", "aria-hidden": "true", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
78419
- "polygon",
78420
- {
78421
- points: "3,1 9,1 11,6 9,11 3,11 1,6",
78422
- fill: "#de1e6e",
78423
- stroke: "rgba(0,0,0,0.25)",
78424
- strokeWidth: "0.75"
78425
- }
78426
- ) }),
78427
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: "GBIF occurrences" })
78428
- ] });
78429
- const computeBounds = (features) => {
78430
- var _a2;
78431
- let minLng = Infinity, minLat = Infinity, maxLng = -Infinity, maxLat = -Infinity;
78432
- const visit = (coords) => {
78433
- if (typeof coords[0] === "number") {
78434
- const [lng, lat] = coords;
78435
- if (lng < minLng) minLng = lng;
78436
- if (lng > maxLng) maxLng = lng;
78437
- if (lat < minLat) minLat = lat;
78438
- if (lat > maxLat) maxLat = lat;
78439
- } else {
78440
- for (let i = 0; i < coords.length; i++) visit(coords[i]);
78441
- }
78442
- };
78443
- for (let i = 0; i < features.length; i++) {
78444
- const g2 = (_a2 = features[i]) == null ? void 0 : _a2.geometry;
78445
- if (g2 == null ? void 0 : g2.coordinates) visit(g2.coordinates);
78446
- }
78447
- if (minLng === Infinity) return null;
78448
- return [
78449
- [minLng, minLat],
78450
- [maxLng, maxLat]
78451
- ];
78452
- };
78453
- const flattenFeatures = (geojson) => {
78454
- if (!geojson) return [];
78455
- if (geojson.type === "FeatureCollection") return geojson.features || [];
78456
- return [geojson];
78457
- };
78458
79179
  const DistributionsMap = ({
78459
79180
  records,
78460
79181
  onUnmappable,
78461
79182
  datasetKey,
78462
79183
  focalTaxon,
78463
79184
  rankOrder,
79185
+ // GBIF checklist the occurrence layer uses; without one there is no layer.
78464
79186
  gbifChecklistKey,
79187
+ // The taxon key in that checklist. Defaults to the focal taxon's id, which
79188
+ // fits datasets keyed by the same ids as the checklist, e.g. COL releases.
79189
+ gbifTaxonKey,
78465
79190
  // true | null → show GBIF layer; false → GBIF API returned 0 occurrences,
78466
79191
  // grey out the toggle and skip loading tiles. Defaults to true so the
78467
79192
  // component works without the count check.
@@ -78470,7 +79195,11 @@ html body {
78470
79195
  // `configure({ basemapStyle })` value. Changing it rebuilds the map.
78471
79196
  basemapStyle,
78472
79197
  // Called from the no-WebGL notice to switch the host to its list view.
78473
- onShowList
79198
+ onShowList,
79199
+ showListLabel = "Show distributions as a list",
79200
+ // `fetchJson(url)` loads the descendants and their distributions. Defaults
79201
+ // to the library's client; a host can pass its own to send its credentials.
79202
+ fetchJson
78474
79203
  }) => {
78475
79204
  var _a2;
78476
79205
  const containerRef = reactExports.useRef(null);
@@ -78483,6 +79212,7 @@ html body {
78483
79212
  const focalAttachedRef = reactExports.useRef(false);
78484
79213
  const gbifAttachedRef = reactExports.useRef(false);
78485
79214
  const descendantLayersRef = reactExports.useRef(/* @__PURE__ */ new Set());
79215
+ const fittedRecordsRef = reactExports.useRef(null);
78486
79216
  const [webglFailed, setWebglFailed] = reactExports.useState(false);
78487
79217
  const [readyMap, setReadyMap] = reactExports.useState(null);
78488
79218
  const [focalReady, setFocalReady] = reactExports.useState(false);
@@ -78492,7 +79222,19 @@ html body {
78492
79222
  taxa: []
78493
79223
  });
78494
79224
  const [focalVisible, setFocalVisible] = reactExports.useState(true);
78495
- const isGbifOnly = !!gbifChecklistKey && (!records || records.length === 0);
79225
+ const [fullscreen, setFullscreen] = reactExports.useState(false);
79226
+ const gbifKey = gbifTaxonKey ?? (focalTaxon == null ? void 0 : focalTaxon.id);
79227
+ const gbifEnabled = !!gbifChecklistKey && !!gbifKey;
79228
+ const isGbifOnly = gbifEnabled && (!records || records.length === 0);
79229
+ const [variantChoice, setVariantChoice] = reactExports.useState(null);
79230
+ reactExports.useEffect(() => setVariantChoice(null), [focalTaxon == null ? void 0 : focalTaxon.id]);
79231
+ const variant = variantChoice ?? defaultVariant(focalTaxon == null ? void 0 : focalTaxon.environments);
79232
+ const hasEez = reactExports.useMemo(
79233
+ () => (records || []).some((r2) => hasEezVariant(r2.area)) || descendantState.taxa.some(
79234
+ (t2) => t2.mappable.some((r2) => hasEezVariant(r2.area))
79235
+ ),
79236
+ [records, descendantState]
79237
+ );
78496
79238
  const [gbifVisible, setGbifVisible] = reactExports.useState(
78497
79239
  () => readStoredGbifVisible(true)
78498
79240
  );
@@ -78514,7 +79256,7 @@ html body {
78514
79256
  if (!(records == null ? void 0 : records.length)) return [];
78515
79257
  const seen = /* @__PURE__ */ new Set();
78516
79258
  records.forEach((r2) => {
78517
- const k = resolveKey(r2);
79259
+ const k = meansKey(r2 == null ? void 0 : r2.establishmentMeans);
78518
79260
  if (k != null) seen.add(k);
78519
79261
  });
78520
79262
  return ESTABLISHMENT_MEANS.filter((m2) => seen.has(m2.key));
@@ -78611,9 +79353,22 @@ html body {
78611
79353
  focalAttachedRef.current = false;
78612
79354
  gbifAttachedRef.current = false;
78613
79355
  descendantLayersRef.current = /* @__PURE__ */ new Set();
79356
+ fittedRecordsRef.current = null;
78614
79357
  setReadyMap(null);
78615
79358
  };
78616
79359
  }, [styleKey]);
79360
+ reactExports.useEffect(() => {
79361
+ const onChange = () => {
79362
+ const el2 = document.fullscreenElement || document.webkitFullscreenElement;
79363
+ setFullscreen(!!el2 && el2 === wrapperRef.current);
79364
+ };
79365
+ document.addEventListener("fullscreenchange", onChange);
79366
+ document.addEventListener("webkitfullscreenchange", onChange);
79367
+ return () => {
79368
+ document.removeEventListener("fullscreenchange", onChange);
79369
+ document.removeEventListener("webkitfullscreenchange", onChange);
79370
+ };
79371
+ }, []);
78617
79372
  reactExports.useEffect(() => {
78618
79373
  const map = readyMap;
78619
79374
  if (!map || !(records == null ? void 0 : records.length)) return;
@@ -78621,7 +79376,7 @@ html body {
78621
79376
  setFocalReady(false);
78622
79377
  Promise.allSettled(
78623
79378
  records.map(
78624
- (r2) => fetchShape(r2.area.gazetteer, r2.area.id).then((geojson) => ({
79379
+ (r2) => fetchShape(r2.area, variant).then((geojson) => ({
78625
79380
  record: r2,
78626
79381
  geojson
78627
79382
  }))
@@ -78687,7 +79442,8 @@ html body {
78687
79442
  map.on("mouseleave", FOCAL_FILL, onMouseLeave);
78688
79443
  focalAttachedRef.current = true;
78689
79444
  }
78690
- if (features.length > 0) {
79445
+ if (features.length > 0 && fittedRecordsRef.current !== records) {
79446
+ fittedRecordsRef.current = records;
78691
79447
  const bounds = computeBounds(features);
78692
79448
  if (bounds) map.fitBounds(bounds, { padding: 20, animate: false });
78693
79449
  }
@@ -78697,7 +79453,7 @@ html body {
78697
79453
  return () => {
78698
79454
  cancelled = true;
78699
79455
  };
78700
- }, [readyMap, records]);
79456
+ }, [readyMap, records, variant]);
78701
79457
  const onFocalClick = (e2) => {
78702
79458
  var _a3, _b2;
78703
79459
  const map = mapRef.current;
@@ -78733,13 +79489,12 @@ html body {
78733
79489
  gbifAttachedRef.current = false;
78734
79490
  };
78735
79491
  removeGbif();
78736
- if (!gbifChecklistKey || !(focalTaxon == null ? void 0 : focalTaxon.id)) return;
79492
+ if (!gbifEnabled) return;
78737
79493
  if (gbifAvailable === false) return;
78738
- const url = (config.gbifApi + GBIF_TILE_PATH).replace("{checklistKey}", encodeURIComponent(gbifChecklistKey)).replace("{taxonKey}", encodeURIComponent(focalTaxon.id));
78739
- const searchUrl = config.gbifPortal + "/occurrence/search?checklist_key=" + encodeURIComponent(gbifChecklistKey) + "&taxon_key=" + encodeURIComponent(focalTaxon.id);
79494
+ const searchUrl = gbifSearchUrl(gbifChecklistKey, gbifKey);
78740
79495
  map.addSource(GBIF_SOURCE, {
78741
79496
  type: "raster",
78742
- tiles: [url],
79497
+ tiles: [gbifTileUrl(gbifChecklistKey, gbifKey)],
78743
79498
  tileSize: 256,
78744
79499
  attribution: '<a href="' + searchUrl + '" target="_blank" rel="noopener">GBIF</a> occurrence data'
78745
79500
  });
@@ -78751,7 +79506,7 @@ html body {
78751
79506
  layout: { visibility: gbifVisible ? "visible" : "none" }
78752
79507
  });
78753
79508
  gbifAttachedRef.current = true;
78754
- }, [readyMap, gbifChecklistKey, focalTaxon == null ? void 0 : focalTaxon.id, gbifAvailable]);
79509
+ }, [readyMap, gbifChecklistKey, gbifKey, gbifAvailable]);
78755
79510
  reactExports.useEffect(() => {
78756
79511
  const map = mapRef.current;
78757
79512
  if (!map || !gbifAttachedRef.current) return;
@@ -78777,7 +79532,7 @@ html body {
78777
79532
  descendantTaxonMapRef.current.set(t2.id, t2);
78778
79533
  Promise.allSettled(
78779
79534
  t2.mappable.map(
78780
- (rec) => fetchShape(rec.area.gazetteer, rec.area.id).then((geojson) => ({
79535
+ (rec) => fetchShape(rec.area, variant).then((geojson) => ({
78781
79536
  record: rec,
78782
79537
  geojson
78783
79538
  }))
@@ -78837,7 +79592,7 @@ html body {
78837
79592
  }
78838
79593
  });
78839
79594
  });
78840
- }, [readyMap, descendantState, descendantColors]);
79595
+ }, [readyMap, descendantState, descendantColors, variant]);
78841
79596
  const onDescendantClick = (e2) => {
78842
79597
  var _a3, _b2;
78843
79598
  const map = mapRef.current;
@@ -78873,7 +79628,7 @@ html body {
78873
79628
  if (ranks2.length === 0) return;
78874
79629
  fetchTriggeredRef.current = true;
78875
79630
  setDescendantState({ status: "loading", taxa: [] });
78876
- fetchDescendants({ datasetKey, focalTaxon, rankOrder }).then(
79631
+ fetchDescendants({ datasetKey, focalTaxon, rankOrder, fetchJson }).then(
78877
79632
  ({ taxa, descendantsFailed }) => {
78878
79633
  if (descendantsFailed) {
78879
79634
  setDescendantState({ status: "error", taxa: [] });
@@ -78942,7 +79697,7 @@ html body {
78942
79697
  "This usually means hardware acceleration is turned off or the graphics drivers aren't set up for WebGL.",
78943
79698
  typeof onShowList === "function" && /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
78944
79699
  " ",
78945
- /* @__PURE__ */ jsxRuntimeExports.jsx("a", { onClick: onShowList, style: { cursor: "pointer" }, children: "Show distributions as a list" })
79700
+ /* @__PURE__ */ jsxRuntimeExports.jsx("a", { onClick: onShowList, style: { cursor: "pointer" }, children: showListLabel })
78946
79701
  ] })
78947
79702
  ]
78948
79703
  }
@@ -78992,14 +79747,33 @@ html body {
78992
79747
  {
78993
79748
  className: "col-distributions-map",
78994
79749
  ref: wrapperRef,
78995
- style: { position: "relative" },
79750
+ style: fullscreen ? { position: "relative", width: "100%", height: "100%", background: "#fff" } : { position: "relative" },
78996
79751
  children: [
78997
79752
  /* @__PURE__ */ jsxRuntimeExports.jsx(
78998
79753
  "div",
78999
79754
  {
79000
79755
  ref: containerRef,
79001
79756
  className: "col-distributions-map__canvas",
79002
- style: { height: 360, width: "100%", background: "#f5f5f5" }
79757
+ style: {
79758
+ height: fullscreen ? "100%" : 360,
79759
+ width: "100%",
79760
+ background: "#f5f5f5"
79761
+ }
79762
+ }
79763
+ ),
79764
+ hasEez && /* @__PURE__ */ jsxRuntimeExports.jsx(
79765
+ AreaVariantSwitch,
79766
+ {
79767
+ value: variant,
79768
+ onChange: setVariantChoice,
79769
+ style: {
79770
+ position: "absolute",
79771
+ // Left of the fullscreen control, top right.
79772
+ top: 10,
79773
+ right: 50,
79774
+ zIndex: 2,
79775
+ boxShadow: "0 1px 4px rgba(0,0,0,0.2)"
79776
+ }
79003
79777
  }
79004
79778
  ),
79005
79779
  /* @__PURE__ */ jsxRuntimeExports.jsx(
@@ -79012,7 +79786,7 @@ html body {
79012
79786
  focalReady,
79013
79787
  focalVisible,
79014
79788
  onToggleFocal: () => setFocalVisible((v2) => !v2),
79015
- gbifEnabled: !!gbifChecklistKey,
79789
+ gbifEnabled,
79016
79790
  gbifVisible,
79017
79791
  gbifAvailable,
79018
79792
  onToggleGbif: handleToggleGbif,
@@ -79029,7 +79803,7 @@ html body {
79029
79803
  }
79030
79804
  }
79031
79805
  ),
79032
- !showDescendantLegend && (presentMeans.length > 0 || gbifChecklistKey && gbifAvailable !== false && gbifVisible) && /* @__PURE__ */ jsxRuntimeExports.jsxs(
79806
+ !showDescendantLegend && (presentMeans.length > 0 || gbifEnabled && gbifAvailable !== false && gbifVisible) && /* @__PURE__ */ jsxRuntimeExports.jsxs(
79033
79807
  "div",
79034
79808
  {
79035
79809
  style: {
@@ -79068,7 +79842,7 @@ html body {
79068
79842
  },
79069
79843
  m2.key
79070
79844
  )),
79071
- gbifChecklistKey && gbifAvailable !== false && gbifVisible && /* @__PURE__ */ jsxRuntimeExports.jsx(GbifLegendEntry, {})
79845
+ gbifEnabled && gbifAvailable !== false && gbifVisible && /* @__PURE__ */ jsxRuntimeExports.jsx(GbifLegendEntry, {})
79072
79846
  ]
79073
79847
  }
79074
79848
  ),
@@ -79077,7 +79851,7 @@ html body {
79077
79851
  {
79078
79852
  visibleGroups: descendantLegend.visibleGroups,
79079
79853
  unmappableGroups: descendantLegend.unmappableGroups,
79080
- showGbif: !!gbifChecklistKey && gbifAvailable !== false && gbifVisible
79854
+ showGbif: gbifEnabled && gbifAvailable !== false && gbifVisible
79081
79855
  }
79082
79856
  )
79083
79857
  ]
@@ -79266,10 +80040,6 @@ html body {
79266
80040
  }
79267
80041
  );
79268
80042
  };
79269
- const isMappable = (r2) => {
79270
- var _a2, _b2;
79271
- return ((_a2 = r2 == null ? void 0 : r2.area) == null ? void 0 : _a2.gazetteer) !== "text" && !!((_b2 = r2 == null ? void 0 : r2.area) == null ? void 0 : _b2.globalId);
79272
- };
79273
80043
  const ListView = ({ datasetKey, data }) => {
79274
80044
  const [iso3Map, setIso3Map] = reactExports.useState({});
79275
80045
  reactExports.useEffect(() => {
@@ -79322,7 +80092,7 @@ html body {
79322
80092
  label,
79323
80093
  md: md2
79324
80094
  }) => {
79325
- const mappable = data.filter(isMappable);
80095
+ const mappable = reactExports.useMemo(() => data.filter(isMappable), [data]);
79326
80096
  const baseUnmappable = data.length - mappable.length;
79327
80097
  const hasGbifConfigured = !!gbifChecklistKey;
79328
80098
  const hasAnyRecords = data.length > 0;
@@ -79330,36 +80100,7 @@ html body {
79330
80100
  () => isWebglSupported() ? "map" : "list"
79331
80101
  );
79332
80102
  const [fetchFailures, setFetchFailures] = reactExports.useState(0);
79333
- const [gbifCount, setGbifCount] = reactExports.useState(null);
79334
- reactExports.useEffect(() => {
79335
- if (!gbifChecklistKey || !(focalTaxon == null ? void 0 : focalTaxon.id)) {
79336
- setGbifCount(null);
79337
- return void 0;
79338
- }
79339
- setGbifCount(null);
79340
- let cancelled = false;
79341
- publicClient.get(`${config.gbifApi}/v1/occurrence/search`, {
79342
- params: {
79343
- checklistKey: gbifChecklistKey,
79344
- taxonKey: focalTaxon.id,
79345
- hasCoordinate: true,
79346
- hasGeospatialIssue: false,
79347
- occurrenceStatus: "PRESENT",
79348
- limit: 0
79349
- }
79350
- }).then(
79351
- (res) => {
79352
- var _a2;
79353
- if (!cancelled) setGbifCount(((_a2 = res == null ? void 0 : res.data) == null ? void 0 : _a2.count) ?? 0);
79354
- },
79355
- () => {
79356
- if (!cancelled) setGbifCount(null);
79357
- }
79358
- );
79359
- return () => {
79360
- cancelled = true;
79361
- };
79362
- }, [gbifChecklistKey, focalTaxon == null ? void 0 : focalTaxon.id]);
80103
+ const gbifCount = useGbifCount(gbifChecklistKey, focalTaxon == null ? void 0 : focalTaxon.id);
79363
80104
  const gbifAvailable = !hasGbifConfigured ? false : gbifCount === null || gbifCount > 0;
79364
80105
  const allMappableFailed = mappable.length > 0 && fetchFailures >= mappable.length;
79365
80106
  const showMap = showDistributionMap && (mappable.length > 0 || gbifAvailable) && !(mappable.length > 0 && allMappableFailed && !gbifAvailable);