@osm-editor-kit/street-imagery-react 0.1.0-alpha.13 → 0.1.0-alpha.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -2,7 +2,7 @@ import { useStreetImageryI18n } from './chunk-3DFVM6VK.js';
2
2
  export { STREET_IMAGERY_MESSAGES, StreetImageryLocaleProvider, useStreetImageryI18n } from './chunk-3DFVM6VK.js';
3
3
  export { useViewerActions, useViewerBearing, useViewerHfov, useViewerLngLat } from './chunk-GYUS2JVV.js';
4
4
  import { c } from 'react/compiler-runtime';
5
- import { distanceMeters, sequencesToFeatureCollection, emptyLineCollection, adapterById, providerById, providerCoversBbox, fetchedSequencesMinZoom, viewShapeRadiusMeters, viewConeGeoJson, viewfieldLayerId, photoLayerId, photoTargetLayerId, featureLayerId, PROVIDER_IDS, mapFeatureMatchesDateRange, isBrowserAvailableProvider, photoFilter, photoFullUrlQueryKey, photoThumbnailQueryKey, formatLocalDateTime, formatRelativeDate, formatDateTooltip, formatMonth, mapillaryPhotoSource, buildViewSuggestions, yearsToMs, SIGN_TARGET, bestTargetImage, MAP_FEATURE_COLOR, mapillaryValueName, mapillaryIconUrl, dateRangeToSliderPositions, sliderPositionsToDateRange, dateSliderBins, dateSliderPosition, yearsAgoMs, parseIsoDateStartMs, findLocationOpener, formatDate, isIsoDate, alignLineToPoints, setStreetImageryConfig, fetchImageDetections, fetchMapFeatureImages, fetchMapillaryMapFeaturesInBbox, bboxAround, resolvePhotoPanoramaUrl, resolvePhotoThumbnailUrl, coneRadiusMeters, openLocationInNewTab, buildMapFeatureLayerFilter, featureSourceId, viewfieldZoomStep, buildPhotoLayerFilter, photoSourceId, viewfieldSourceId, sequenceTilesSourceId, renameExpressionProperties, sequenceTilesLayerId, sequenceSourceId, sequenceLayerId, viewfieldLineLayerId, emptyPointCollection, mapFeaturesToFeatureCollection, VIEWFIELD_MIN_ZOOM, photosToFeatureCollection, photosToViewfieldsFeatureCollection, emptyPolygonCollection, bboxIntersects } from '@osm-editor-kit/street-imagery';
5
+ import { distanceMeters, sequencesToFeatureCollection, emptyLineCollection, adapterById, providerById, providerCoversBbox, fetchedSequencesMinZoom, viewShapeRadiusMeters, viewConeGeoJson, viewfieldLayerId, photoLayerId, photoTargetLayerId, featureLayerId, PROVIDER_IDS, mapFeatureMatchesDateRange, isBrowserAvailableProvider, photoFilter, photoFullUrlQueryKey, photoThumbnailQueryKey, formatLocalDateTime, formatRelativeDate, formatDateTooltip, formatMonth, mapillaryPhotoSource, buildViewSuggestions, yearsToMs, rankPhotosLookingAt, SIGN_TARGET, bestTargetImage, MAP_FEATURE_COLOR, mapillaryValueName, mapillaryIconUrl, dateRangeToSliderPositions, sliderPositionsToDateRange, dateSliderBins, dateSliderPosition, yearsAgoMs, parseIsoDateStartMs, findLocationOpener, formatDate, isIsoDate, alignLineToPoints, setStreetImageryConfig, fetchImageDetections, fetchMapFeatureImages, fetchMapillaryMapFeaturesInBbox, bboxAround, resolvePhotoPanoramaUrl, resolvePhotoThumbnailUrl, coneRadiusMeters, openLocationInNewTab, buildMapFeatureLayerFilter, featureSourceId, viewfieldZoomStep, buildPhotoLayerFilter, photoSourceId, viewfieldSourceId, sequenceTilesSourceId, renameExpressionProperties, sequenceTilesLayerId, sequenceSourceId, sequenceLayerId, viewfieldLineLayerId, emptyPointCollection, mapFeaturesToFeatureCollection, VIEWFIELD_MIN_ZOOM, photosToFeatureCollection, photosToViewfieldsFeatureCollection, emptyPolygonCollection, bboxIntersects } from '@osm-editor-kit/street-imagery';
6
6
  import { useMap, Source, Layer } from 'react-map-gl/maplibre';
7
7
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
8
8
  import { lazy, useEffect, useSyncExternalStore, useState, useRef, useEffectEvent, Fragment as Fragment$1, Suspense } from 'react';
@@ -1490,10 +1490,10 @@ var StreetLevelImagerySourcesAndLayers = (t0) => {
1490
1490
  function _temp(id) {
1491
1491
  return providerById[id].kind === "photo" && adapterById[id]?.fetchPhotos;
1492
1492
  }
1493
- var MapillaryPanel = lazy(() => import('./MapillaryPanel-FQR4TTEW.js').then((module) => ({
1493
+ var MapillaryPanel = lazy(() => import('./MapillaryPanel-SOHGB7JA.js').then((module) => ({
1494
1494
  default: module.MapillaryPanel
1495
1495
  })));
1496
- var PanoramaxPanel = lazy(() => import('./PanoramaxPanel-GO4GSVFE.js').then((module) => ({
1496
+ var PanoramaxPanel = lazy(() => import('./PanoramaxPanel-5P5LWMRY.js').then((module) => ({
1497
1497
  default: module.PanoramaxPanel
1498
1498
  })));
1499
1499
  var ViewerPanelPlaceholder = () => {
@@ -1512,13 +1512,14 @@ var ViewerPanelPlaceholder = () => {
1512
1512
  return t0;
1513
1513
  };
1514
1514
  var StreetLevelImageryViewer = (t0) => {
1515
- const $ = c(20);
1515
+ const $ = c(22);
1516
1516
  const {
1517
1517
  photo,
1518
1518
  groupPhotos,
1519
1519
  onPhotoSelected,
1520
1520
  onEaseMapToPoint,
1521
1521
  onViewerPhoto,
1522
+ onViewerView,
1522
1523
  lookAtBearing,
1523
1524
  lookAt,
1524
1525
  outlines,
@@ -1534,8 +1535,8 @@ var StreetLevelImageryViewer = (t0) => {
1534
1535
  t1 = $[0];
1535
1536
  }
1536
1537
  let t2;
1537
- if ($[1] !== groupPhotos || $[2] !== hideAttribution || $[3] !== lookAt || $[4] !== lookAtBearing || $[5] !== onEaseMapToPoint || $[6] !== onPhotoSelected || $[7] !== onViewerPhoto || $[8] !== outlines || $[9] !== photo) {
1538
- t2 = /* @__PURE__ */ jsx(Suspense, { fallback: t1, children: /* @__PURE__ */ jsx(MapillaryPanel, { groupPhotos, hideAttribution, onEaseMapToPoint, onPhotoSelected, lookAt, lookAtBearing, outlines, onViewerPhoto, photo }) });
1538
+ if ($[1] !== groupPhotos || $[2] !== hideAttribution || $[3] !== lookAt || $[4] !== lookAtBearing || $[5] !== onEaseMapToPoint || $[6] !== onPhotoSelected || $[7] !== onViewerPhoto || $[8] !== onViewerView || $[9] !== outlines || $[10] !== photo) {
1539
+ t2 = /* @__PURE__ */ jsx(Suspense, { fallback: t1, children: /* @__PURE__ */ jsx(MapillaryPanel, { groupPhotos, hideAttribution, onEaseMapToPoint, onPhotoSelected, lookAt, lookAtBearing, outlines, onViewerPhoto, onViewerView, photo }) });
1539
1540
  $[1] = groupPhotos;
1540
1541
  $[2] = hideAttribution;
1541
1542
  $[3] = lookAt;
@@ -1543,36 +1544,38 @@ var StreetLevelImageryViewer = (t0) => {
1543
1544
  $[5] = onEaseMapToPoint;
1544
1545
  $[6] = onPhotoSelected;
1545
1546
  $[7] = onViewerPhoto;
1546
- $[8] = outlines;
1547
- $[9] = photo;
1548
- $[10] = t2;
1547
+ $[8] = onViewerView;
1548
+ $[9] = outlines;
1549
+ $[10] = photo;
1550
+ $[11] = t2;
1549
1551
  } else {
1550
- t2 = $[10];
1552
+ t2 = $[11];
1551
1553
  }
1552
1554
  return t2;
1553
1555
  }
1554
1556
  if (photo.providerId === "panoramax") {
1555
1557
  const Panel = PanoramaxPanelOverride ?? PanoramaxPanel;
1556
1558
  let t1;
1557
- if ($[11] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
1559
+ if ($[12] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
1558
1560
  t1 = /* @__PURE__ */ jsx(ViewerPanelPlaceholder, {});
1559
- $[11] = t1;
1561
+ $[12] = t1;
1560
1562
  } else {
1561
- t1 = $[11];
1563
+ t1 = $[12];
1562
1564
  }
1563
1565
  let t2;
1564
- if ($[12] !== Panel || $[13] !== groupPhotos || $[14] !== hideAttribution || $[15] !== onEaseMapToPoint || $[16] !== onPhotoSelected || $[17] !== onViewerPhoto || $[18] !== photo) {
1565
- t2 = /* @__PURE__ */ jsx(Suspense, { fallback: t1, children: /* @__PURE__ */ jsx(Panel, { groupPhotos, hideAttribution, onViewerPhoto, onEaseMapToPoint, onPhotoSelected, photo }) });
1566
- $[12] = Panel;
1567
- $[13] = groupPhotos;
1568
- $[14] = hideAttribution;
1569
- $[15] = onEaseMapToPoint;
1570
- $[16] = onPhotoSelected;
1571
- $[17] = onViewerPhoto;
1572
- $[18] = photo;
1573
- $[19] = t2;
1566
+ if ($[13] !== Panel || $[14] !== groupPhotos || $[15] !== hideAttribution || $[16] !== onEaseMapToPoint || $[17] !== onPhotoSelected || $[18] !== onViewerPhoto || $[19] !== onViewerView || $[20] !== photo) {
1567
+ t2 = /* @__PURE__ */ jsx(Suspense, { fallback: t1, children: /* @__PURE__ */ jsx(Panel, { groupPhotos, hideAttribution, onViewerPhoto, onViewerView, onEaseMapToPoint, onPhotoSelected, photo }) });
1568
+ $[13] = Panel;
1569
+ $[14] = groupPhotos;
1570
+ $[15] = hideAttribution;
1571
+ $[16] = onEaseMapToPoint;
1572
+ $[17] = onPhotoSelected;
1573
+ $[18] = onViewerPhoto;
1574
+ $[19] = onViewerView;
1575
+ $[20] = photo;
1576
+ $[21] = t2;
1574
1577
  } else {
1575
- t2 = $[19];
1578
+ t2 = $[21];
1576
1579
  }
1577
1580
  return t2;
1578
1581
  }
@@ -1929,6 +1932,24 @@ ${formatRelativeDate(timestamp, locale)}` : formatDateTooltip(timestamp, locale)
1929
1932
  return t5;
1930
1933
  };
1931
1934
 
1935
+ // src/viewpoints/floatingViewerPosition.ts
1936
+ var FLOATING_VIEWER_EDGE = 8;
1937
+ var clampFloatingViewerPosition = ({
1938
+ right,
1939
+ bottom
1940
+ }, box, container, minVisibleShare) => {
1941
+ if (minVisibleShare === void 0) {
1942
+ return {
1943
+ right: Math.max(FLOATING_VIEWER_EDGE, right),
1944
+ bottom: Math.max(FLOATING_VIEWER_EDGE, bottom)
1945
+ };
1946
+ }
1947
+ return {
1948
+ right: Math.min(container.width - box.width * minVisibleShare, Math.max(-box.width * (1 - minVisibleShare), right)),
1949
+ bottom: Math.min(container.height - box.height, Math.max(-box.height * (1 - minVisibleShare), bottom))
1950
+ };
1951
+ };
1952
+
1932
1953
  // src/viewpoints/viewDirectionLabels.ts
1933
1954
  var viewSuggestionLabel = ({
1934
1955
  viewpoint,
@@ -1941,7 +1962,16 @@ var DEFAULT_LAYOUT = {
1941
1962
  minimized: false
1942
1963
  };
1943
1964
  var MIN_WIDTH = 280;
1944
- var EDGE = 8;
1965
+ var BUTTON_DRAG_SLOP = 4;
1966
+ var EDGE = FLOATING_VIEWER_EDGE;
1967
+ var MINIMIZED_WIDTH = "6rem";
1968
+ var containerSize = (box, position) => {
1969
+ const container = position === "fixed" ? document.documentElement : box.offsetParent;
1970
+ return {
1971
+ width: container?.clientWidth ?? 0,
1972
+ height: container?.clientHeight ?? 0
1973
+ };
1974
+ };
1945
1975
  var hasStoredLayout = (storageKey) => {
1946
1976
  try {
1947
1977
  return localStorage.getItem(storageKey) != null;
@@ -2013,7 +2043,7 @@ var ToolbarButton = (t0) => {
2013
2043
  } = t0;
2014
2044
  let t1;
2015
2045
  if ($[0] !== children || $[1] !== disabled || $[2] !== label || $[3] !== onClick) {
2016
- t1 = /* @__PURE__ */ jsx("button", { "aria-label": label, className: "inline-flex size-7 items-center justify-center rounded-md text-slate-600 hover:bg-slate-100 hover:text-slate-900 disabled:cursor-not-allowed disabled:opacity-30 disabled:hover:bg-transparent", disabled, onClick, title: label, type: "button", children });
2046
+ t1 = /* @__PURE__ */ jsx("button", { "aria-label": label, className: "inline-flex size-7 shrink-0 items-center justify-center rounded-md text-slate-600 hover:bg-slate-100 hover:text-slate-900 disabled:cursor-not-allowed disabled:opacity-30 disabled:hover:bg-transparent", disabled, onClick, title: label, type: "button", children });
2017
2047
  $[0] = children;
2018
2048
  $[1] = disabled;
2019
2049
  $[2] = label;
@@ -2246,16 +2276,16 @@ var FloatingViewerInfoButton = (t0) => {
2246
2276
  return t2;
2247
2277
  };
2248
2278
  var FloatingPhotoViewer = (t0) => {
2249
- const $ = c(109);
2279
+ const $ = c(136);
2250
2280
  const {
2251
2281
  title,
2252
2282
  titleActions,
2253
- suggestions,
2283
+ suggestions: t1,
2254
2284
  activeDirectionKey,
2255
2285
  onSelectSuggestion,
2256
2286
  shownPhotoId,
2257
- canGoBack: t1,
2258
- canGoForward: t2,
2287
+ canGoBack: t2,
2288
+ canGoForward: t3,
2259
2289
  onBack,
2260
2290
  onForward,
2261
2291
  onClose,
@@ -2265,70 +2295,99 @@ var FloatingPhotoViewer = (t0) => {
2265
2295
  children,
2266
2296
  footer,
2267
2297
  drawer,
2268
- storageKey: t3,
2269
- defaultPosition
2298
+ storageKey: t4,
2299
+ defaultPosition,
2300
+ position: t5,
2301
+ minVisibleShare
2270
2302
  } = t0;
2271
- const canGoBack = t1 === void 0 ? false : t1;
2272
- const canGoForward = t2 === void 0 ? false : t2;
2273
- const storageKey = t3 === void 0 ? "street-imagery:floating-viewer" : t3;
2303
+ let t6;
2304
+ if ($[0] !== t1) {
2305
+ t6 = t1 === void 0 ? [] : t1;
2306
+ $[0] = t1;
2307
+ $[1] = t6;
2308
+ } else {
2309
+ t6 = $[1];
2310
+ }
2311
+ const suggestions = t6;
2312
+ const canGoBack = t2 === void 0 ? false : t2;
2313
+ const canGoForward = t3 === void 0 ? false : t3;
2314
+ const storageKey = t4 === void 0 ? "street-imagery:floating-viewer" : t4;
2315
+ const position = t5 === void 0 ? "absolute" : t5;
2274
2316
  const {
2275
2317
  messages
2276
2318
  } = useStreetImageryI18n();
2277
2319
  const severalViewpoints = new Set(suggestions.map(_temp3)).size > 1;
2278
- let t4;
2279
- if ($[0] !== storageKey) {
2280
- t4 = () => readLayout(storageKey);
2281
- $[0] = storageKey;
2282
- $[1] = t4;
2320
+ let t7;
2321
+ if ($[2] !== storageKey) {
2322
+ t7 = () => readLayout(storageKey);
2323
+ $[2] = storageKey;
2324
+ $[3] = t7;
2283
2325
  } else {
2284
- t4 = $[1];
2326
+ t7 = $[3];
2285
2327
  }
2286
- const [layout, setLayout] = useState(t4);
2328
+ const [layout, setLayout] = useState(t7);
2287
2329
  const [drawerOpen, setDrawerOpen] = useState(false);
2288
- let t5;
2289
- if ($[2] !== storageKey) {
2290
- t5 = () => hasStoredLayout(storageKey);
2291
- $[2] = storageKey;
2292
- $[3] = t5;
2330
+ let t8;
2331
+ if ($[4] !== storageKey) {
2332
+ t8 = () => hasStoredLayout(storageKey);
2333
+ $[4] = storageKey;
2334
+ $[5] = t8;
2293
2335
  } else {
2294
- t5 = $[3];
2336
+ t8 = $[5];
2295
2337
  }
2296
- const [moved, setMoved] = useState(t5);
2338
+ const [moved, setMoved] = useState(t8);
2297
2339
  const atTopLeft = defaultPosition?.corner === "top-left" && !moved;
2298
- let t6;
2299
- if ($[4] !== atTopLeft || $[5] !== defaultPosition || $[6] !== layout.bottom || $[7] !== layout.right) {
2300
- t6 = atTopLeft ? {
2340
+ let t9;
2341
+ if ($[6] !== atTopLeft || $[7] !== defaultPosition || $[8] !== layout.bottom || $[9] !== layout.right) {
2342
+ t9 = atTopLeft ? {
2301
2343
  left: defaultPosition.left ?? EDGE,
2302
2344
  top: defaultPosition.top ?? EDGE
2303
2345
  } : {
2304
2346
  right: layout.right,
2305
2347
  bottom: layout.bottom
2306
2348
  };
2307
- $[4] = atTopLeft;
2308
- $[5] = defaultPosition;
2309
- $[6] = layout.bottom;
2310
- $[7] = layout.right;
2311
- $[8] = t6;
2349
+ $[6] = atTopLeft;
2350
+ $[7] = defaultPosition;
2351
+ $[8] = layout.bottom;
2352
+ $[9] = layout.right;
2353
+ $[10] = t9;
2312
2354
  } else {
2313
- t6 = $[8];
2355
+ t9 = $[10];
2314
2356
  }
2315
- const position = t6;
2357
+ const placement = t9;
2358
+ let t10;
2359
+ if ($[11] !== atTopLeft || $[12] !== layout.bottom || $[13] !== layout.right || $[14] !== minVisibleShare || $[15] !== placement) {
2360
+ t10 = minVisibleShare === void 0 || atTopLeft ? placement : {
2361
+ right: `clamp(${EDGE}px, ${layout.right}px, calc(100% - ${MINIMIZED_WIDTH}))`,
2362
+ bottom: Math.max(EDGE, layout.bottom)
2363
+ };
2364
+ $[11] = atTopLeft;
2365
+ $[12] = layout.bottom;
2366
+ $[13] = layout.right;
2367
+ $[14] = minVisibleShare;
2368
+ $[15] = placement;
2369
+ $[16] = t10;
2370
+ } else {
2371
+ t10 = $[16];
2372
+ }
2373
+ const minimizedPlacement = t10;
2374
+ const boxRef = useRef(null);
2316
2375
  const dragRef = useRef(null);
2317
- let t7;
2318
- if ($[9] !== storageKey) {
2319
- t7 = (next) => {
2376
+ let t11;
2377
+ if ($[17] !== storageKey) {
2378
+ t11 = (next) => {
2320
2379
  setLayout(next);
2321
2380
  writeLayout(storageKey, next);
2322
2381
  };
2323
- $[9] = storageKey;
2324
- $[10] = t7;
2382
+ $[17] = storageKey;
2383
+ $[18] = t11;
2325
2384
  } else {
2326
- t7 = $[10];
2385
+ t11 = $[18];
2327
2386
  }
2328
- const updateLayout = t7;
2329
- let t8;
2330
- if ($[11] !== canGoBack || $[12] !== canGoForward || $[13] !== onBack || $[14] !== onClose || $[15] !== onForward || $[16] !== step) {
2331
- t8 = (event) => {
2387
+ const updateLayout = t11;
2388
+ let t12;
2389
+ if ($[19] !== canGoBack || $[20] !== canGoForward || $[21] !== onBack || $[22] !== onClose || $[23] !== onForward || $[24] !== step) {
2390
+ t12 = (event) => {
2332
2391
  const target = event.target;
2333
2392
  if (target instanceof Element && target.closest('input, textarea, select, [contenteditable="true"]')) {
2334
2393
  return;
@@ -2353,382 +2412,492 @@ var FloatingPhotoViewer = (t0) => {
2353
2412
  }
2354
2413
  }
2355
2414
  };
2356
- $[11] = canGoBack;
2357
- $[12] = canGoForward;
2358
- $[13] = onBack;
2359
- $[14] = onClose;
2360
- $[15] = onForward;
2361
- $[16] = step;
2362
- $[17] = t8;
2415
+ $[19] = canGoBack;
2416
+ $[20] = canGoForward;
2417
+ $[21] = onBack;
2418
+ $[22] = onClose;
2419
+ $[23] = onForward;
2420
+ $[24] = step;
2421
+ $[25] = t12;
2363
2422
  } else {
2364
- t8 = $[17];
2423
+ t12 = $[25];
2365
2424
  }
2366
- const onShortcut = useEffectEvent(t8);
2367
- let t9;
2368
- if ($[18] !== onShortcut) {
2369
- t9 = function subscribeKeyboardShortcuts() {
2425
+ const onShortcut = useEffectEvent(t12);
2426
+ let t13;
2427
+ if ($[26] !== onShortcut) {
2428
+ t13 = function subscribeKeyboardShortcuts() {
2370
2429
  window.addEventListener("keydown", onShortcut);
2371
2430
  return () => window.removeEventListener("keydown", onShortcut);
2372
2431
  };
2373
- $[18] = onShortcut;
2374
- $[19] = t9;
2432
+ $[26] = onShortcut;
2433
+ $[27] = t13;
2375
2434
  } else {
2376
- t9 = $[19];
2435
+ t13 = $[27];
2377
2436
  }
2378
- let t10;
2379
- if ($[20] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
2380
- t10 = [];
2381
- $[20] = t10;
2437
+ let t14;
2438
+ if ($[28] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
2439
+ t14 = [];
2440
+ $[28] = t14;
2382
2441
  } else {
2383
- t10 = $[20];
2442
+ t14 = $[28];
2384
2443
  }
2385
- useEffect(t9, t10);
2386
- let t11;
2387
- if ($[21] !== atTopLeft || $[22] !== layout) {
2388
- t11 = (event_0, mode) => {
2389
- if (event_0.button !== 0 || event_0.target.closest("button")) {
2444
+ useEffect(t13, t14);
2445
+ let t15;
2446
+ if ($[29] !== atTopLeft || $[30] !== layout || $[31] !== minVisibleShare || $[32] !== position) {
2447
+ t15 = () => {
2448
+ const box = boxRef.current;
2449
+ if (!box || atTopLeft) {
2450
+ return;
2451
+ }
2452
+ const {
2453
+ right,
2454
+ bottom
2455
+ } = clampFloatingViewerPosition(layout, {
2456
+ width: box.offsetWidth,
2457
+ height: box.offsetHeight
2458
+ }, containerSize(box, position), minVisibleShare);
2459
+ if (right !== layout.right || bottom !== layout.bottom) {
2460
+ setLayout({
2461
+ ...layout,
2462
+ right,
2463
+ bottom
2464
+ });
2465
+ }
2466
+ };
2467
+ $[29] = atTopLeft;
2468
+ $[30] = layout;
2469
+ $[31] = minVisibleShare;
2470
+ $[32] = position;
2471
+ $[33] = t15;
2472
+ } else {
2473
+ t15 = $[33];
2474
+ }
2475
+ const keepOnScreen = useEffectEvent(t15);
2476
+ const isFree = minVisibleShare !== void 0;
2477
+ let t16;
2478
+ if ($[34] !== isFree || $[35] !== keepOnScreen) {
2479
+ t16 = function followBoxAndContainerSize() {
2480
+ const box_0 = boxRef.current;
2481
+ if (!isFree || !box_0) {
2482
+ return;
2483
+ }
2484
+ const observer = new ResizeObserver(() => keepOnScreen());
2485
+ observer.observe(box_0);
2486
+ if (box_0.offsetParent) {
2487
+ observer.observe(box_0.offsetParent);
2488
+ }
2489
+ window.addEventListener("resize", keepOnScreen);
2490
+ return () => {
2491
+ observer.disconnect();
2492
+ window.removeEventListener("resize", keepOnScreen);
2493
+ };
2494
+ };
2495
+ $[34] = isFree;
2496
+ $[35] = keepOnScreen;
2497
+ $[36] = t16;
2498
+ } else {
2499
+ t16 = $[36];
2500
+ }
2501
+ let t17;
2502
+ if ($[37] !== isFree || $[38] !== layout.minimized) {
2503
+ t17 = [isFree, layout.minimized];
2504
+ $[37] = isFree;
2505
+ $[38] = layout.minimized;
2506
+ $[39] = t17;
2507
+ } else {
2508
+ t17 = $[39];
2509
+ }
2510
+ useEffect(t16, t17);
2511
+ let t18;
2512
+ if ($[40] !== atTopLeft || $[41] !== layout || $[42] !== position) {
2513
+ t18 = (event_0, mode) => {
2514
+ const target_0 = event_0.target;
2515
+ if (event_0.button !== 0 || target_0.closest("a")) {
2390
2516
  return;
2391
2517
  }
2392
- event_0.currentTarget.setPointerCapture(event_0.pointerId);
2393
- const box = event_0.currentTarget.closest("section");
2394
- const container = box?.offsetParent;
2395
- const start = atTopLeft && box && container ? {
2518
+ const button = target_0.closest("button");
2519
+ const onButton = button !== null;
2520
+ (button ?? event_0.currentTarget).setPointerCapture(event_0.pointerId);
2521
+ const box_1 = boxRef.current;
2522
+ const container = box_1 ? containerSize(box_1, position) : null;
2523
+ const start = atTopLeft && box_1 && container ? {
2396
2524
  ...layout,
2397
- right: container.clientWidth - box.offsetLeft - box.offsetWidth,
2398
- bottom: container.clientHeight - box.offsetTop - box.offsetHeight
2525
+ right: container.width - box_1.offsetLeft - box_1.offsetWidth,
2526
+ bottom: container.height - box_1.offsetTop - box_1.offsetHeight
2399
2527
  } : layout;
2400
- setLayout(start);
2401
- setMoved(true);
2402
2528
  dragRef.current = {
2403
2529
  x: event_0.clientX,
2404
2530
  y: event_0.clientY,
2405
2531
  layout: start,
2406
- mode
2532
+ mode,
2533
+ onButton
2407
2534
  };
2535
+ if (!onButton) {
2536
+ setLayout(start);
2537
+ setMoved(true);
2538
+ }
2408
2539
  };
2409
- $[21] = atTopLeft;
2410
- $[22] = layout;
2411
- $[23] = t11;
2540
+ $[40] = atTopLeft;
2541
+ $[41] = layout;
2542
+ $[42] = position;
2543
+ $[43] = t18;
2412
2544
  } else {
2413
- t11 = $[23];
2545
+ t18 = $[43];
2414
2546
  }
2415
- const startDrag = t11;
2416
- let t12;
2417
- if ($[24] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
2418
- t12 = (event_1) => {
2547
+ const startDrag = t18;
2548
+ let t19;
2549
+ if ($[44] !== minVisibleShare || $[45] !== position) {
2550
+ t19 = (event_1) => {
2419
2551
  const drag = dragRef.current;
2420
2552
  if (!drag) {
2421
2553
  return;
2422
2554
  }
2423
2555
  const dx = event_1.clientX - drag.x;
2424
2556
  const dy = event_1.clientY - drag.y;
2425
- setLayout(drag.mode === "move" ? {
2426
- ...drag.layout,
2427
- right: Math.max(EDGE, drag.layout.right - dx),
2428
- bottom: Math.max(EDGE, drag.layout.bottom - dy)
2429
- } : {
2430
- ...drag.layout,
2431
- width: Math.max(MIN_WIDTH, drag.layout.width - dx)
2432
- });
2557
+ if (drag.onButton) {
2558
+ if (Math.hypot(dx, dy) < BUTTON_DRAG_SLOP) {
2559
+ return;
2560
+ }
2561
+ event_1.currentTarget.setPointerCapture(event_1.pointerId);
2562
+ drag.onButton = false;
2563
+ setMoved(true);
2564
+ }
2565
+ const box_2 = boxRef.current;
2566
+ if (drag.mode === "resize") {
2567
+ setLayout({
2568
+ ...drag.layout,
2569
+ width: Math.max(MIN_WIDTH, drag.layout.width - dx)
2570
+ });
2571
+ } else {
2572
+ if (box_2) {
2573
+ const next_0 = clampFloatingViewerPosition({
2574
+ right: drag.layout.right - dx,
2575
+ bottom: drag.layout.bottom - dy
2576
+ }, {
2577
+ width: box_2.offsetWidth,
2578
+ height: box_2.offsetHeight
2579
+ }, containerSize(box_2, position), minVisibleShare);
2580
+ setLayout({
2581
+ ...drag.layout,
2582
+ ...next_0
2583
+ });
2584
+ }
2585
+ }
2433
2586
  };
2434
- $[24] = t12;
2587
+ $[44] = minVisibleShare;
2588
+ $[45] = position;
2589
+ $[46] = t19;
2435
2590
  } else {
2436
- t12 = $[24];
2591
+ t19 = $[46];
2437
2592
  }
2438
- const onDrag = t12;
2439
- let t13;
2440
- if ($[25] !== layout || $[26] !== storageKey) {
2441
- t13 = () => {
2442
- if (dragRef.current) {
2443
- dragRef.current = null;
2593
+ const onDrag = t19;
2594
+ let t20;
2595
+ if ($[47] !== layout || $[48] !== storageKey) {
2596
+ t20 = () => {
2597
+ const wasDragged = dragRef.current?.onButton === false;
2598
+ dragRef.current = null;
2599
+ if (wasDragged) {
2444
2600
  writeLayout(storageKey, layout);
2445
2601
  }
2446
2602
  };
2447
- $[25] = layout;
2448
- $[26] = storageKey;
2449
- $[27] = t13;
2603
+ $[47] = layout;
2604
+ $[48] = storageKey;
2605
+ $[49] = t20;
2450
2606
  } else {
2451
- t13 = $[27];
2607
+ t20 = $[49];
2452
2608
  }
2453
- const endDrag = t13;
2454
- let t14;
2455
- if ($[28] !== endDrag) {
2456
- t14 = {
2609
+ const endDrag = t20;
2610
+ let t21;
2611
+ if ($[50] !== endDrag || $[51] !== onDrag) {
2612
+ t21 = {
2457
2613
  onPointerMove: onDrag,
2458
2614
  onPointerUp: endDrag,
2459
2615
  onPointerCancel: endDrag
2460
2616
  };
2461
- $[28] = endDrag;
2462
- $[29] = t14;
2617
+ $[50] = endDrag;
2618
+ $[51] = onDrag;
2619
+ $[52] = t21;
2463
2620
  } else {
2464
- t14 = $[29];
2621
+ t21 = $[52];
2465
2622
  }
2466
- const dragHandlers = t14;
2623
+ const dragHandlers = t21;
2467
2624
  if (layout.minimized) {
2468
- let t152;
2469
- if ($[30] !== layout || $[31] !== updateLayout) {
2470
- t152 = () => updateLayout({
2625
+ const t222 = `${position} z-10 inline-flex items-center gap-2 rounded-full bg-white px-3 py-1.5 text-sm font-medium text-slate-800 shadow-lg ring-1 ring-slate-200 hover:bg-slate-50`;
2626
+ let t232;
2627
+ if ($[53] !== layout || $[54] !== updateLayout) {
2628
+ t232 = () => updateLayout({
2471
2629
  ...layout,
2472
2630
  minimized: false
2473
2631
  });
2474
- $[30] = layout;
2475
- $[31] = updateLayout;
2476
- $[32] = t152;
2632
+ $[53] = layout;
2633
+ $[54] = updateLayout;
2634
+ $[55] = t232;
2477
2635
  } else {
2478
- t152 = $[32];
2636
+ t232 = $[55];
2479
2637
  }
2480
- let t162;
2481
- if ($[33] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
2482
- t162 = /* @__PURE__ */ jsx(Icon, { path: ICONS.expand });
2483
- $[33] = t162;
2638
+ let t242;
2639
+ if ($[56] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
2640
+ t242 = /* @__PURE__ */ jsx(Icon, { path: ICONS.expand });
2641
+ $[56] = t242;
2484
2642
  } else {
2485
- t162 = $[33];
2643
+ t242 = $[56];
2486
2644
  }
2487
- let t172;
2488
- if ($[34] !== position || $[35] !== t152 || $[36] !== title) {
2489
- t172 = /* @__PURE__ */ jsxs("button", { className: "absolute z-10 inline-flex items-center gap-2 rounded-full bg-white px-3 py-1.5 text-sm font-medium text-slate-800 shadow-lg ring-1 ring-slate-200 hover:bg-slate-50", onClick: t152, style: position, type: "button", children: [
2490
- t162,
2645
+ let t252;
2646
+ if ($[57] !== minimizedPlacement || $[58] !== t222 || $[59] !== t232 || $[60] !== title) {
2647
+ t252 = /* @__PURE__ */ jsxs("button", { className: t222, onClick: t232, style: minimizedPlacement, type: "button", children: [
2648
+ t242,
2491
2649
  title
2492
2650
  ] });
2493
- $[34] = position;
2494
- $[35] = t152;
2495
- $[36] = title;
2496
- $[37] = t172;
2651
+ $[57] = minimizedPlacement;
2652
+ $[58] = t222;
2653
+ $[59] = t232;
2654
+ $[60] = title;
2655
+ $[61] = t252;
2497
2656
  } else {
2498
- t172 = $[37];
2657
+ t252 = $[61];
2499
2658
  }
2500
- return t172;
2659
+ return t252;
2501
2660
  }
2502
- const t15 = `min(${layout.width}px, calc(100% - 1rem))`;
2503
- let t16;
2504
- if ($[38] !== position || $[39] !== t15) {
2505
- t16 = {
2506
- ...position,
2507
- width: t15
2661
+ const t22 = `${position} z-10 flex max-h-[calc(100%-1rem)] flex-col overflow-hidden rounded-xl bg-white shadow-xl ring-1 ring-slate-200`;
2662
+ const t23 = `min(${layout.width}px, calc(100% - 1rem))`;
2663
+ let t24;
2664
+ if ($[62] !== placement || $[63] !== t23) {
2665
+ t24 = {
2666
+ ...placement,
2667
+ width: t23
2508
2668
  };
2509
- $[38] = position;
2510
- $[39] = t15;
2511
- $[40] = t16;
2669
+ $[62] = placement;
2670
+ $[63] = t23;
2671
+ $[64] = t24;
2512
2672
  } else {
2513
- t16 = $[40];
2673
+ t24 = $[64];
2514
2674
  }
2515
- let t17;
2516
- if ($[41] !== startDrag) {
2517
- t17 = (event_2) => startDrag(event_2, "resize");
2518
- $[41] = startDrag;
2519
- $[42] = t17;
2675
+ let t25;
2676
+ if ($[65] !== startDrag) {
2677
+ t25 = (event_2) => startDrag(event_2, "resize");
2678
+ $[65] = startDrag;
2679
+ $[66] = t25;
2520
2680
  } else {
2521
- t17 = $[42];
2681
+ t25 = $[66];
2522
2682
  }
2523
- let t18;
2524
- if ($[43] !== dragHandlers || $[44] !== t17) {
2525
- t18 = /* @__PURE__ */ jsx("div", { "aria-hidden": true, className: "absolute inset-y-0 left-0 z-10 w-1.5 cursor-ew-resize hover:bg-fuchsia-500/20", onPointerDown: t17, ...dragHandlers });
2526
- $[43] = dragHandlers;
2527
- $[44] = t17;
2528
- $[45] = t18;
2683
+ let t26;
2684
+ if ($[67] !== dragHandlers || $[68] !== t25) {
2685
+ t26 = /* @__PURE__ */ jsx("div", { "aria-hidden": true, className: "absolute inset-y-0 left-0 z-10 w-1.5 cursor-ew-resize hover:bg-fuchsia-500/20", onPointerDown: t25, ...dragHandlers });
2686
+ $[67] = dragHandlers;
2687
+ $[68] = t25;
2688
+ $[69] = t26;
2529
2689
  } else {
2530
- t18 = $[45];
2690
+ t26 = $[69];
2531
2691
  }
2532
- let t19;
2533
- if ($[46] !== startDrag) {
2534
- t19 = (event_3) => startDrag(event_3, "move");
2535
- $[46] = startDrag;
2536
- $[47] = t19;
2692
+ let t27;
2693
+ if ($[70] !== startDrag) {
2694
+ t27 = (event_3) => startDrag(event_3, "move");
2695
+ $[70] = startDrag;
2696
+ $[71] = t27;
2537
2697
  } else {
2538
- t19 = $[47];
2698
+ t27 = $[71];
2539
2699
  }
2540
- let t20;
2541
- if ($[48] !== step) {
2542
- t20 = step ? /* @__PURE__ */ jsxs(Fragment, { children: [
2700
+ let t28;
2701
+ if ($[72] !== step) {
2702
+ t28 = step ? /* @__PURE__ */ jsxs(Fragment, { children: [
2543
2703
  /* @__PURE__ */ jsx(ToolbarButton, { disabled: !step.onPrevious, label: step.previousLabel, onClick: () => step.onPrevious?.(), children: /* @__PURE__ */ jsx(Icon, { path: ICONS.back }) }),
2544
2704
  /* @__PURE__ */ jsx(ToolbarButton, { disabled: !step.onNext, label: step.nextLabel, onClick: () => step.onNext?.(), children: /* @__PURE__ */ jsx(Icon, { path: ICONS.forward }) })
2545
2705
  ] }) : null;
2546
- $[48] = step;
2547
- $[49] = t20;
2706
+ $[72] = step;
2707
+ $[73] = t28;
2548
2708
  } else {
2549
- t20 = $[49];
2709
+ t28 = $[73];
2550
2710
  }
2551
- let t21;
2552
- if ($[50] !== title) {
2553
- t21 = /* @__PURE__ */ jsx("h2", { className: "min-w-0 truncate px-1 text-sm font-semibold text-slate-800", children: title });
2554
- $[50] = title;
2555
- $[51] = t21;
2711
+ let t29;
2712
+ if ($[74] !== title) {
2713
+ t29 = /* @__PURE__ */ jsx("h2", { className: "min-w-0 truncate px-1 text-sm font-semibold text-slate-800", children: title });
2714
+ $[74] = title;
2715
+ $[75] = t29;
2556
2716
  } else {
2557
- t21 = $[51];
2717
+ t29 = $[75];
2558
2718
  }
2559
- let t22;
2560
- if ($[52] !== t21 || $[53] !== titleActions) {
2561
- t22 = /* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-1 items-center gap-0.5", children: [
2562
- t21,
2563
- titleActions
2719
+ let t30;
2720
+ if ($[76] !== titleActions) {
2721
+ t30 = titleActions ? /* @__PURE__ */ jsx("div", { className: "flex shrink-0 items-center gap-0.5", children: titleActions }) : null;
2722
+ $[76] = titleActions;
2723
+ $[77] = t30;
2724
+ } else {
2725
+ t30 = $[77];
2726
+ }
2727
+ let t31;
2728
+ if ($[78] !== t29 || $[79] !== t30) {
2729
+ t31 = /* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-1 items-center gap-0.5", children: [
2730
+ t29,
2731
+ t30
2564
2732
  ] });
2565
- $[52] = t21;
2566
- $[53] = titleActions;
2567
- $[54] = t22;
2733
+ $[78] = t29;
2734
+ $[79] = t30;
2735
+ $[80] = t31;
2568
2736
  } else {
2569
- t22 = $[54];
2737
+ t31 = $[80];
2570
2738
  }
2571
- let t23;
2572
- if ($[55] !== canGoBack || $[56] !== canGoForward || $[57] !== messages.viewer.backInHistory || $[58] !== messages.viewer.forwardInHistory || $[59] !== onBack || $[60] !== onForward) {
2573
- t23 = onBack && onForward ? /* @__PURE__ */ jsxs(Fragment, { children: [
2739
+ let t32;
2740
+ if ($[81] !== canGoBack || $[82] !== canGoForward || $[83] !== messages.viewer.backInHistory || $[84] !== messages.viewer.forwardInHistory || $[85] !== onBack || $[86] !== onForward) {
2741
+ t32 = onBack && onForward ? /* @__PURE__ */ jsxs(Fragment, { children: [
2574
2742
  /* @__PURE__ */ jsx(ToolbarButton, { disabled: !canGoBack, label: messages.viewer.backInHistory, onClick: onBack, children: /* @__PURE__ */ jsx(Icon, { path: ICONS.undo }) }),
2575
2743
  /* @__PURE__ */ jsx(ToolbarButton, { disabled: !canGoForward, label: messages.viewer.forwardInHistory, onClick: onForward, children: /* @__PURE__ */ jsx(Icon, { path: ICONS.redo }) })
2576
2744
  ] }) : null;
2577
- $[55] = canGoBack;
2578
- $[56] = canGoForward;
2579
- $[57] = messages.viewer.backInHistory;
2580
- $[58] = messages.viewer.forwardInHistory;
2581
- $[59] = onBack;
2582
- $[60] = onForward;
2583
- $[61] = t23;
2745
+ $[81] = canGoBack;
2746
+ $[82] = canGoForward;
2747
+ $[83] = messages.viewer.backInHistory;
2748
+ $[84] = messages.viewer.forwardInHistory;
2749
+ $[85] = onBack;
2750
+ $[86] = onForward;
2751
+ $[87] = t32;
2584
2752
  } else {
2585
- t23 = $[61];
2753
+ t32 = $[87];
2586
2754
  }
2587
- let t24;
2588
- if ($[62] !== layout || $[63] !== updateLayout) {
2589
- t24 = () => updateLayout({
2755
+ let t33;
2756
+ if ($[88] !== layout || $[89] !== updateLayout) {
2757
+ t33 = () => updateLayout({
2590
2758
  ...layout,
2591
2759
  minimized: true
2592
2760
  });
2593
- $[62] = layout;
2594
- $[63] = updateLayout;
2595
- $[64] = t24;
2596
- } else {
2597
- t24 = $[64];
2598
- }
2599
- let t25;
2600
- if ($[65] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
2601
- t25 = /* @__PURE__ */ jsx(Icon, { path: ICONS.minimize });
2602
- $[65] = t25;
2761
+ $[88] = layout;
2762
+ $[89] = updateLayout;
2763
+ $[90] = t33;
2603
2764
  } else {
2604
- t25 = $[65];
2765
+ t33 = $[90];
2605
2766
  }
2606
- let t26;
2607
- if ($[66] !== messages.viewer.minimize || $[67] !== t24) {
2608
- t26 = /* @__PURE__ */ jsx(ToolbarButton, { label: messages.viewer.minimize, onClick: t24, children: t25 });
2609
- $[66] = messages.viewer.minimize;
2610
- $[67] = t24;
2611
- $[68] = t26;
2612
- } else {
2613
- t26 = $[68];
2614
- }
2615
- let t27;
2616
- if ($[69] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
2617
- t27 = /* @__PURE__ */ jsx(Icon, { path: ICONS.close });
2618
- $[69] = t27;
2619
- } else {
2620
- t27 = $[69];
2621
- }
2622
- let t28;
2623
- if ($[70] !== messages.viewer.close || $[71] !== onClose) {
2624
- t28 = /* @__PURE__ */ jsx(ToolbarButton, { label: messages.viewer.close, onClick: onClose, children: t27 });
2625
- $[70] = messages.viewer.close;
2626
- $[71] = onClose;
2627
- $[72] = t28;
2767
+ let t34;
2768
+ if ($[91] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
2769
+ t34 = /* @__PURE__ */ jsx(Icon, { path: ICONS.minimize });
2770
+ $[91] = t34;
2628
2771
  } else {
2629
- t28 = $[72];
2772
+ t34 = $[91];
2630
2773
  }
2631
- let t29;
2632
- if ($[73] !== dragHandlers || $[74] !== t19 || $[75] !== t20 || $[76] !== t22 || $[77] !== t23 || $[78] !== t26 || $[79] !== t28) {
2633
- t29 = /* @__PURE__ */ jsxs("header", { className: "flex cursor-move touch-none items-center gap-1 border-b border-slate-100 px-2 py-1.5 select-none", onPointerDown: t19, ...dragHandlers, children: [
2634
- t20,
2635
- t22,
2636
- t23,
2637
- t26,
2638
- t28
2774
+ let t35;
2775
+ if ($[92] !== messages.viewer.minimize || $[93] !== t33) {
2776
+ t35 = /* @__PURE__ */ jsx(ToolbarButton, { label: messages.viewer.minimize, onClick: t33, children: t34 });
2777
+ $[92] = messages.viewer.minimize;
2778
+ $[93] = t33;
2779
+ $[94] = t35;
2780
+ } else {
2781
+ t35 = $[94];
2782
+ }
2783
+ let t36;
2784
+ if ($[95] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
2785
+ t36 = /* @__PURE__ */ jsx(Icon, { path: ICONS.close });
2786
+ $[95] = t36;
2787
+ } else {
2788
+ t36 = $[95];
2789
+ }
2790
+ let t37;
2791
+ if ($[96] !== messages.viewer.close || $[97] !== onClose) {
2792
+ t37 = /* @__PURE__ */ jsx(ToolbarButton, { label: messages.viewer.close, onClick: onClose, children: t36 });
2793
+ $[96] = messages.viewer.close;
2794
+ $[97] = onClose;
2795
+ $[98] = t37;
2796
+ } else {
2797
+ t37 = $[98];
2798
+ }
2799
+ let t38;
2800
+ if ($[99] !== dragHandlers || $[100] !== t27 || $[101] !== t28 || $[102] !== t31 || $[103] !== t32 || $[104] !== t35 || $[105] !== t37) {
2801
+ t38 = /* @__PURE__ */ jsxs("header", { className: "flex cursor-move touch-none items-center gap-1 border-b border-slate-100 px-2 py-1.5 select-none", onPointerDown: t27, ...dragHandlers, children: [
2802
+ t28,
2803
+ t31,
2804
+ t32,
2805
+ t35,
2806
+ t37
2639
2807
  ] });
2640
- $[73] = dragHandlers;
2641
- $[74] = t19;
2642
- $[75] = t20;
2643
- $[76] = t22;
2644
- $[77] = t23;
2645
- $[78] = t26;
2646
- $[79] = t28;
2647
- $[80] = t29;
2648
- } else {
2649
- t29 = $[80];
2650
- }
2651
- let t30;
2652
- if ($[81] !== activeDirectionKey || $[82] !== messages.viewer.suggestedViews || $[83] !== messages.viewer.suggestedViewsHint || $[84] !== onSelectSuggestion || $[85] !== severalViewpoints || $[86] !== shownPhotoId || $[87] !== suggestions || $[88] !== toolbar) {
2653
- t30 = toolbar ? /* @__PURE__ */ jsx("div", { className: "border-b border-slate-100 px-2 py-1.5", children: toolbar }) : suggestions.length > 0 ? /* @__PURE__ */ jsx("nav", { "aria-label": messages.viewer.suggestedViews, className: "grid grid-cols-[repeat(auto-fit,minmax(5.25rem,1fr))] gap-1 border-b border-slate-100 px-2 py-1.5", title: messages.viewer.suggestedViewsHint, children: suggestions.map((suggestion_0) => /* @__PURE__ */ jsx(SuggestionChip, { active: suggestion_0.direction.key === activeDirectionKey, onSelect: (candidate) => onSelectSuggestion(suggestion_0, candidate), shownPhotoId, showPlace: severalViewpoints, suggestion: suggestion_0 }, suggestion_0.direction.key)) }) : null;
2654
- $[81] = activeDirectionKey;
2655
- $[82] = messages.viewer.suggestedViews;
2656
- $[83] = messages.viewer.suggestedViewsHint;
2657
- $[84] = onSelectSuggestion;
2658
- $[85] = severalViewpoints;
2659
- $[86] = shownPhotoId;
2660
- $[87] = suggestions;
2661
- $[88] = toolbar;
2662
- $[89] = t30;
2663
- } else {
2664
- t30 = $[89];
2665
- }
2666
- let t31;
2667
- if ($[90] !== status) {
2668
- t31 = status ? /* @__PURE__ */ jsx("p", { className: "px-3 py-2 text-xs text-slate-500", role: "status", children: status }) : null;
2669
- $[90] = status;
2670
- $[91] = t31;
2671
- } else {
2672
- t31 = $[91];
2673
- }
2674
- let t32;
2675
- if ($[92] !== footer) {
2676
- t32 = footer ? /* @__PURE__ */ jsx("div", { className: "px-3 py-2 text-xs text-slate-600", children: footer }) : null;
2677
- $[92] = footer;
2678
- $[93] = t32;
2679
- } else {
2680
- t32 = $[93];
2681
- }
2682
- let t33;
2683
- if ($[94] !== drawer || $[95] !== drawerOpen) {
2684
- t33 = drawer ? /* @__PURE__ */ jsxs("div", { className: "border-t border-slate-100", children: [
2808
+ $[99] = dragHandlers;
2809
+ $[100] = t27;
2810
+ $[101] = t28;
2811
+ $[102] = t31;
2812
+ $[103] = t32;
2813
+ $[104] = t35;
2814
+ $[105] = t37;
2815
+ $[106] = t38;
2816
+ } else {
2817
+ t38 = $[106];
2818
+ }
2819
+ let t39;
2820
+ if ($[107] !== activeDirectionKey || $[108] !== messages.viewer.suggestedViews || $[109] !== messages.viewer.suggestedViewsHint || $[110] !== onSelectSuggestion || $[111] !== severalViewpoints || $[112] !== shownPhotoId || $[113] !== suggestions || $[114] !== toolbar) {
2821
+ t39 = toolbar ? /* @__PURE__ */ jsx("div", { className: "border-b border-slate-100 px-2 py-1.5", children: toolbar }) : suggestions.length > 0 ? /* @__PURE__ */ jsx("nav", { "aria-label": messages.viewer.suggestedViews, className: "grid grid-cols-[repeat(auto-fit,minmax(5.25rem,1fr))] gap-1 border-b border-slate-100 px-2 py-1.5", title: messages.viewer.suggestedViewsHint, children: suggestions.map((suggestion_0) => /* @__PURE__ */ jsx(SuggestionChip, { active: suggestion_0.direction.key === activeDirectionKey, onSelect: (candidate) => onSelectSuggestion?.(suggestion_0, candidate), shownPhotoId, showPlace: severalViewpoints, suggestion: suggestion_0 }, suggestion_0.direction.key)) }) : null;
2822
+ $[107] = activeDirectionKey;
2823
+ $[108] = messages.viewer.suggestedViews;
2824
+ $[109] = messages.viewer.suggestedViewsHint;
2825
+ $[110] = onSelectSuggestion;
2826
+ $[111] = severalViewpoints;
2827
+ $[112] = shownPhotoId;
2828
+ $[113] = suggestions;
2829
+ $[114] = toolbar;
2830
+ $[115] = t39;
2831
+ } else {
2832
+ t39 = $[115];
2833
+ }
2834
+ let t40;
2835
+ if ($[116] !== status) {
2836
+ t40 = status ? /* @__PURE__ */ jsx("p", { className: "px-3 py-2 text-xs text-slate-500", role: "status", children: status }) : null;
2837
+ $[116] = status;
2838
+ $[117] = t40;
2839
+ } else {
2840
+ t40 = $[117];
2841
+ }
2842
+ let t41;
2843
+ if ($[118] !== footer) {
2844
+ t41 = footer ? /* @__PURE__ */ jsx("div", { className: "px-3 py-2 text-xs text-slate-600", children: footer }) : null;
2845
+ $[118] = footer;
2846
+ $[119] = t41;
2847
+ } else {
2848
+ t41 = $[119];
2849
+ }
2850
+ let t42;
2851
+ if ($[120] !== drawer || $[121] !== drawerOpen) {
2852
+ t42 = drawer ? /* @__PURE__ */ jsxs("div", { className: "border-t border-slate-100", children: [
2685
2853
  /* @__PURE__ */ jsxs("button", { "aria-expanded": drawerOpen, className: "flex w-full items-center justify-between px-3 py-2 text-xs font-medium text-slate-700 hover:bg-slate-50", onClick: () => setDrawerOpen(_temp22), type: "button", children: [
2686
2854
  drawer.label,
2687
2855
  /* @__PURE__ */ jsx("span", { "aria-hidden": true, className: drawerOpen ? "inline-flex rotate-90" : "inline-flex", children: /* @__PURE__ */ jsx(Icon, { className: "size-3.5", path: ICONS.forward }) })
2688
2856
  ] }),
2689
2857
  drawerOpen ? /* @__PURE__ */ jsx("div", { className: "px-2 pb-2", children: drawer.content }) : null
2690
2858
  ] }) : null;
2691
- $[94] = drawer;
2692
- $[95] = drawerOpen;
2693
- $[96] = t33;
2859
+ $[120] = drawer;
2860
+ $[121] = drawerOpen;
2861
+ $[122] = t42;
2694
2862
  } else {
2695
- t33 = $[96];
2863
+ t42 = $[122];
2696
2864
  }
2697
- let t34;
2698
- if ($[97] !== children || $[98] !== t31 || $[99] !== t32 || $[100] !== t33) {
2699
- t34 = /* @__PURE__ */ jsxs("div", { className: "min-h-0 overflow-y-auto", children: [
2700
- t31,
2865
+ let t43;
2866
+ if ($[123] !== children || $[124] !== t40 || $[125] !== t41 || $[126] !== t42) {
2867
+ t43 = /* @__PURE__ */ jsxs("div", { className: "min-h-0 overflow-y-auto", children: [
2868
+ t40,
2701
2869
  children,
2702
- t32,
2703
- t33
2870
+ t41,
2871
+ t42
2704
2872
  ] });
2705
- $[97] = children;
2706
- $[98] = t31;
2707
- $[99] = t32;
2708
- $[100] = t33;
2709
- $[101] = t34;
2873
+ $[123] = children;
2874
+ $[124] = t40;
2875
+ $[125] = t41;
2876
+ $[126] = t42;
2877
+ $[127] = t43;
2710
2878
  } else {
2711
- t34 = $[101];
2879
+ t43 = $[127];
2712
2880
  }
2713
- let t35;
2714
- if ($[102] !== messages.viewer.regionLabel || $[103] !== t16 || $[104] !== t18 || $[105] !== t29 || $[106] !== t30 || $[107] !== t34) {
2715
- t35 = /* @__PURE__ */ jsxs("section", { "aria-label": messages.viewer.regionLabel, className: "absolute z-10 flex max-h-[calc(100%-1rem)] flex-col overflow-hidden rounded-xl bg-white shadow-xl ring-1 ring-slate-200", style: t16, children: [
2716
- t18,
2717
- t29,
2718
- t30,
2719
- t34
2881
+ let t44;
2882
+ if ($[128] !== messages.viewer.regionLabel || $[129] !== t22 || $[130] !== t24 || $[131] !== t26 || $[132] !== t38 || $[133] !== t39 || $[134] !== t43) {
2883
+ t44 = /* @__PURE__ */ jsxs("section", { "aria-label": messages.viewer.regionLabel, className: t22, ref: boxRef, style: t24, children: [
2884
+ t26,
2885
+ t38,
2886
+ t39,
2887
+ t43
2720
2888
  ] });
2721
- $[102] = messages.viewer.regionLabel;
2722
- $[103] = t16;
2723
- $[104] = t18;
2724
- $[105] = t29;
2725
- $[106] = t30;
2726
- $[107] = t34;
2727
- $[108] = t35;
2728
- } else {
2729
- t35 = $[108];
2730
- }
2731
- return t35;
2889
+ $[128] = messages.viewer.regionLabel;
2890
+ $[129] = t22;
2891
+ $[130] = t24;
2892
+ $[131] = t26;
2893
+ $[132] = t38;
2894
+ $[133] = t39;
2895
+ $[134] = t43;
2896
+ $[135] = t44;
2897
+ } else {
2898
+ t44 = $[135];
2899
+ }
2900
+ return t44;
2732
2901
  };
2733
2902
  function _temp3(suggestion) {
2734
2903
  return suggestion.viewpoint.id;
@@ -3255,6 +3424,141 @@ function _temp24(query) {
3255
3424
  function _temp33(query_0) {
3256
3425
  return query_0.isError;
3257
3426
  }
3427
+ var DEFAULT_SOURCES2 = [mapillaryPhotoSource];
3428
+ var usePhotosLookingAt = (place, t0) => {
3429
+ const $ = c(30);
3430
+ let t1;
3431
+ if ($[0] !== t0) {
3432
+ t1 = t0 === void 0 ? {} : t0;
3433
+ $[0] = t0;
3434
+ $[1] = t1;
3435
+ } else {
3436
+ t1 = $[1];
3437
+ }
3438
+ const {
3439
+ maxAgeYears,
3440
+ photoTypes,
3441
+ maxDistanceMeters,
3442
+ maxFlatAngleDeg,
3443
+ limit,
3444
+ filterPhoto,
3445
+ sources: t2,
3446
+ enabled: t3
3447
+ } = t1;
3448
+ const sources = t2 === void 0 ? DEFAULT_SOURCES2 : t2;
3449
+ const enabled = t3 === void 0 ? true : t3;
3450
+ const [now] = useState(_temp8);
3451
+ const active = enabled && place != null;
3452
+ let t4;
3453
+ if ($[2] !== active || $[3] !== place || $[4] !== sources) {
3454
+ let t52;
3455
+ if ($[6] !== active || $[7] !== place) {
3456
+ t52 = (source) => ({
3457
+ queryKey: ["street-imagery", "photos-near", source.id, place?.[0], place?.[1]],
3458
+ queryFn: (t62) => {
3459
+ const {
3460
+ signal
3461
+ } = t62;
3462
+ return place ? source.fetchNear(place, signal) : Promise.resolve([]);
3463
+ },
3464
+ enabled: active,
3465
+ staleTime: 6e5
3466
+ });
3467
+ $[6] = active;
3468
+ $[7] = place;
3469
+ $[8] = t52;
3470
+ } else {
3471
+ t52 = $[8];
3472
+ }
3473
+ t4 = sources.map(t52);
3474
+ $[2] = active;
3475
+ $[3] = place;
3476
+ $[4] = sources;
3477
+ $[5] = t4;
3478
+ } else {
3479
+ t4 = $[5];
3480
+ }
3481
+ let t5;
3482
+ if ($[9] !== t4) {
3483
+ t5 = {
3484
+ queries: t4
3485
+ };
3486
+ $[9] = t4;
3487
+ $[10] = t5;
3488
+ } else {
3489
+ t5 = $[10];
3490
+ }
3491
+ const queries = useQueries(t5);
3492
+ let t6;
3493
+ if ($[11] !== filterPhoto || $[12] !== limit || $[13] !== maxAgeYears || $[14] !== maxDistanceMeters || $[15] !== maxFlatAngleDeg || $[16] !== now || $[17] !== photoTypes || $[18] !== place || $[19] !== queries) {
3494
+ const photos = queries.flatMap(_temp25);
3495
+ const kept = filterPhoto ? photos.filter(filterPhoto) : photos;
3496
+ t6 = place ? rankPhotosLookingAt(place, kept, {
3497
+ now,
3498
+ maxAgeMs: maxAgeYears == null ? void 0 : yearsToMs(maxAgeYears),
3499
+ maxDistanceMeters,
3500
+ maxFlatAngleDeg,
3501
+ photoTypes,
3502
+ limit
3503
+ }) : [];
3504
+ $[11] = filterPhoto;
3505
+ $[12] = limit;
3506
+ $[13] = maxAgeYears;
3507
+ $[14] = maxDistanceMeters;
3508
+ $[15] = maxFlatAngleDeg;
3509
+ $[16] = now;
3510
+ $[17] = photoTypes;
3511
+ $[18] = place;
3512
+ $[19] = queries;
3513
+ $[20] = t6;
3514
+ } else {
3515
+ t6 = $[20];
3516
+ }
3517
+ let t7;
3518
+ if ($[21] !== active || $[22] !== queries) {
3519
+ t7 = active && queries.some(_temp34);
3520
+ $[21] = active;
3521
+ $[22] = queries;
3522
+ $[23] = t7;
3523
+ } else {
3524
+ t7 = $[23];
3525
+ }
3526
+ let t8;
3527
+ if ($[24] !== queries) {
3528
+ t8 = queries.length > 0 && queries.every(_temp43);
3529
+ $[24] = queries;
3530
+ $[25] = t8;
3531
+ } else {
3532
+ t8 = $[25];
3533
+ }
3534
+ let t9;
3535
+ if ($[26] !== t6 || $[27] !== t7 || $[28] !== t8) {
3536
+ t9 = {
3537
+ candidates: t6,
3538
+ isLoading: t7,
3539
+ isError: t8
3540
+ };
3541
+ $[26] = t6;
3542
+ $[27] = t7;
3543
+ $[28] = t8;
3544
+ $[29] = t9;
3545
+ } else {
3546
+ t9 = $[29];
3547
+ }
3548
+ return t9;
3549
+ };
3550
+ function _temp8() {
3551
+ return Date.now();
3552
+ }
3553
+ function _temp25(query) {
3554
+ return query.data ?? [];
3555
+ }
3556
+ function _temp34(query_0) {
3557
+ return query_0.isPending;
3558
+ }
3559
+ function _temp43(query_1) {
3560
+ return query_1.isError;
3561
+ }
3258
3562
  var STALE_TIME = 10 * 60 * 1e3;
3259
3563
  var useMapillaryMapFeatureImages = (featureId, t0) => {
3260
3564
  const $ = c(10);
@@ -3342,7 +3646,7 @@ var useMapillaryMapFeaturesNear = (lngLat, t0) => {
3342
3646
  return features.map((feature) => ({
3343
3647
  ...feature,
3344
3648
  distanceMeters: distanceMeters(center, feature.lngLat)
3345
- })).filter((feature_0) => feature_0.distanceMeters <= radiusMeters).sort(_temp8);
3649
+ })).filter((feature_0) => feature_0.distanceMeters <= radiusMeters).sort(_temp9);
3346
3650
  };
3347
3651
  $[2] = lngLat;
3348
3652
  $[3] = objectValues;
@@ -3498,7 +3802,7 @@ var useSelectedMapillaryFeature = (t0) => {
3498
3802
  }
3499
3803
  return t5;
3500
3804
  };
3501
- function _temp8(a, b) {
3805
+ function _temp9(a, b) {
3502
3806
  return a.distanceMeters - b.distanceMeters;
3503
3807
  }
3504
3808
  var useLocationPickStore = create()((set) => ({
@@ -3516,15 +3820,15 @@ var useLocationPickStore = create()((set) => ({
3516
3820
  }
3517
3821
  }));
3518
3822
  var useArmedLocationOpenerId = () => {
3519
- return useLocationPickStore(_temp9);
3823
+ return useLocationPickStore(_temp10);
3520
3824
  };
3521
3825
  var useLocationPickActions = () => {
3522
- return useLocationPickStore(_temp25);
3826
+ return useLocationPickStore(_temp26);
3523
3827
  };
3524
- function _temp9(state) {
3828
+ function _temp10(state) {
3525
3829
  return state.armedOpenerId;
3526
3830
  }
3527
- function _temp25(state) {
3831
+ function _temp26(state) {
3528
3832
  return state.actions;
3529
3833
  }
3530
3834
 
@@ -3777,7 +4081,7 @@ var MapillaryFeatureBar = (t0) => {
3777
4081
  }
3778
4082
  let t6;
3779
4083
  if ($[9] !== feature.value || $[10] !== t5) {
3780
- t6 = /* @__PURE__ */ jsx("img", { alt: "", className: "size-7 shrink-0", onError: _temp10, src: t5 }, t4);
4084
+ t6 = /* @__PURE__ */ jsx("img", { alt: "", className: "size-7 shrink-0", onError: _temp11, src: t5 }, t4);
3781
4085
  $[9] = feature.value;
3782
4086
  $[10] = t5;
3783
4087
  $[11] = t6;
@@ -3855,49 +4159,82 @@ ${labels.dayPhotos(day.images.length, active && day.images.length > 1)}`, type:
3855
4159
  }
3856
4160
  return t2;
3857
4161
  };
3858
- function _temp10(event) {
4162
+ function _temp11(event) {
3859
4163
  event.currentTarget.style.display = "none";
3860
4164
  }
4165
+
4166
+ // src/filters/dateSliderPointer.ts
4167
+ var DATE_SLIDER_STEP = 1e-3;
4168
+ var HANDLE_PX = 16;
4169
+ var GRAB_RADIUS_PX = 22;
4170
+ var stepped = (position) => Math.round(position / DATE_SLIDER_STEP) * DATE_SLIDER_STEP;
4171
+ var clamped = (position) => Math.min(1, Math.max(0, position));
4172
+ var closeTo = (a, b, widthPx, px) => Math.abs(a - b) * widthPx <= px;
4173
+ var positionOnTrack = (leftPx, widthPx) => stepped(clamped(leftPx / widthPx));
4174
+ var moveHandle = (positions, handle, position) => handle === "from" ? {
4175
+ ...positions,
4176
+ from: Math.min(position, positions.to)
4177
+ } : {
4178
+ ...positions,
4179
+ to: Math.max(position, positions.from)
4180
+ };
4181
+ var nearestHandle = (positions, press) => press < (positions.from + positions.to) / 2 ? "from" : "to";
4182
+ var pressedHandle = (positions, press, widthPx) => {
4183
+ const overlap = closeTo(positions.from, positions.to, widthPx, HANDLE_PX);
4184
+ const middle = (positions.from + positions.to) / 2;
4185
+ return overlap && closeTo(press, middle, widthPx, GRAB_RADIUS_PX) ? null : nearestHandle(positions, press);
4186
+ };
4187
+ var handleOfDrag = (deltaPx) => deltaPx < 0 ? "from" : "to";
4188
+ var dragPositions = (start, press, handle, deltaPx, widthPx) => {
4189
+ const grabbed = closeTo(press, start[handle], widthPx, GRAB_RADIUS_PX);
4190
+ const origin = grabbed ? start[handle] : press;
4191
+ return moveHandle(start, handle, stepped(clamped(origin + deltaPx / widthPx)));
4192
+ };
4193
+ var tapPositions = (start, press, widthPx) => {
4194
+ const handle = nearestHandle(start, press);
4195
+ const onHandle = closeTo(press, start[handle], widthPx, HANDLE_PX / 2);
4196
+ return {
4197
+ handle,
4198
+ positions: onHandle ? null : moveHandle(start, handle, press)
4199
+ };
4200
+ };
3861
4201
  var DEFAULT_YEAR_LINES = [1, 2, 3, 4];
3862
4202
  var BINS = 60;
3863
- var STEP = 1e-3;
3864
4203
  var CHART_HEIGHT_PX = 36;
3865
4204
  var RED = "#dc2626";
3866
- var HANDLE_CLASS = "pointer-events-none absolute inset-0 m-0 h-full w-full cursor-pointer appearance-none bg-transparent focus:outline-none [&::-webkit-slider-runnable-track]:appearance-none [&::-webkit-slider-runnable-track]:bg-transparent [&::-moz-range-track]:bg-transparent [&::-webkit-slider-thumb]:pointer-events-auto [&::-webkit-slider-thumb]:size-4 [&::-webkit-slider-thumb]:cursor-grab [&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:border-2 [&::-webkit-slider-thumb]:border-white [&::-webkit-slider-thumb]:bg-slate-800 [&::-webkit-slider-thumb]:shadow [&::-moz-range-thumb]:pointer-events-auto [&::-moz-range-thumb]:box-border [&::-moz-range-thumb]:size-4 [&::-moz-range-thumb]:cursor-grab [&::-moz-range-thumb]:rounded-full [&::-moz-range-thumb]:border-2 [&::-moz-range-thumb]:border-white [&::-moz-range-thumb]:bg-slate-800 [&::-moz-range-thumb]:shadow focus-visible:[&::-webkit-slider-thumb]:ring-2 focus-visible:[&::-webkit-slider-thumb]:ring-sky-500 focus-visible:[&::-moz-range-thumb]:ring-2 focus-visible:[&::-moz-range-thumb]:ring-sky-500";
4205
+ var DRAG_SLOP_PX = 4;
4206
+ var HANDLE_CLASS = "pointer-events-none absolute inset-0 m-0 h-full w-full appearance-none bg-transparent focus:outline-none [&::-webkit-slider-runnable-track]:appearance-none [&::-webkit-slider-runnable-track]:bg-transparent [&::-moz-range-track]:bg-transparent [&::-webkit-slider-thumb]:size-4 [&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:border-2 [&::-webkit-slider-thumb]:border-white [&::-webkit-slider-thumb]:bg-slate-800 [&::-webkit-slider-thumb]:shadow [&::-moz-range-thumb]:box-border [&::-moz-range-thumb]:size-4 [&::-moz-range-thumb]:rounded-full [&::-moz-range-thumb]:border-2 [&::-moz-range-thumb]:border-white [&::-moz-range-thumb]:bg-slate-800 [&::-moz-range-thumb]:shadow focus-visible:[&::-webkit-slider-thumb]:ring-2 focus-visible:[&::-webkit-slider-thumb]:ring-sky-500 focus-visible:[&::-moz-range-thumb]:ring-2 focus-visible:[&::-moz-range-thumb]:ring-sky-500";
3867
4207
  var percent = (position) => `${position * 100}%`;
3868
- var PhotoDateRangeFilter = (t0) => {
3869
- const $ = c(80);
4208
+ var trackBox = (area) => {
3870
4209
  const {
3871
- value,
3872
- onChange,
3873
- capturedAt,
3874
- yearLines: t1,
3875
- recommendedMaxAgeYears,
3876
- markers: t2,
3877
- maxYears,
3878
- now: nowProp,
3879
- dateInputs: t3,
3880
- className,
3881
- allDatesAction: t4
3882
- } = t0;
3883
- const yearLines = t1 === void 0 ? DEFAULT_YEAR_LINES : t1;
3884
- let t5;
3885
- if ($[0] !== t2) {
3886
- t5 = t2 === void 0 ? [] : t2;
3887
- $[0] = t2;
3888
- $[1] = t5;
3889
- } else {
3890
- t5 = $[1];
3891
- }
3892
- const markers = t5;
3893
- const dateInputs = t3 === void 0 ? "collapsed" : t3;
3894
- const allDatesAction = t4 === void 0 ? true : t4;
4210
+ left,
4211
+ width
4212
+ } = area.getBoundingClientRect();
4213
+ const inset = HANDLE_PX / 2;
4214
+ return {
4215
+ left: left + inset,
4216
+ width: Math.max(1, width - 2 * inset)
4217
+ };
4218
+ };
4219
+ var PhotoDateRangeFilter = ({
4220
+ value,
4221
+ onChange,
4222
+ capturedAt,
4223
+ yearLines = DEFAULT_YEAR_LINES,
4224
+ recommendedMaxAgeYears,
4225
+ markers = [],
4226
+ maxYears,
4227
+ now: nowProp,
4228
+ dateInputs = "collapsed",
4229
+ className,
4230
+ allDatesAction = true
4231
+ }) => {
3895
4232
  const {
3896
4233
  locale,
3897
4234
  messages
3898
4235
  } = useStreetImageryI18n();
3899
4236
  const text = messages.dateFilter;
3900
- const [startNow] = useState(_temp11);
4237
+ const [startNow] = useState(() => Date.now());
3901
4238
  const now = nowProp ?? startNow;
3902
4239
  const scale = {
3903
4240
  now,
@@ -3906,396 +4243,236 @@ var PhotoDateRangeFilter = (t0) => {
3906
4243
  const [dragged, setDragged] = useState(null);
3907
4244
  const fromInput = useRef(null);
3908
4245
  const toInput = useRef(null);
4246
+ const press = useRef(null);
3909
4247
  const positions = dragged ?? dateRangeToSliderPositions(value, scale);
3910
4248
  const shownRange = dragged ? sliderPositionsToDateRange(dragged, scale) : value;
3911
- let t6;
3912
- if ($[2] !== positions.from || $[3] !== positions.to) {
3913
- t6 = (moved) => {
3914
- const from = Number(fromInput.current?.value ?? positions.from);
3915
- const to = Number(toInput.current?.value ?? positions.to);
3916
- return moved === "from" ? {
3917
- from: Math.min(from, to),
3918
- to
3919
- } : {
3920
- from,
3921
- to: Math.max(from, to)
3922
- };
4249
+ const readPositions = (moved) => {
4250
+ const from = Number(fromInput.current?.value ?? positions.from);
4251
+ const to = Number(toInput.current?.value ?? positions.to);
4252
+ return moved === "from" ? {
4253
+ from: Math.min(from, to),
4254
+ to
4255
+ } : {
4256
+ from,
4257
+ to: Math.max(from, to)
3923
4258
  };
3924
- $[2] = positions.from;
3925
- $[3] = positions.to;
3926
- $[4] = t6;
3927
- } else {
3928
- t6 = $[4];
3929
- }
3930
- const readPositions = t6;
3931
- const commitOnRelease = (moved_0) => (input) => {
4259
+ };
4260
+ const commit = (moved_0, next) => {
4261
+ setDragged(null);
4262
+ const range = sliderPositionsToDateRange(next, scale);
4263
+ const other = moved_0 === "from" ? "to" : "from";
4264
+ onChange({
4265
+ ...range,
4266
+ [other]: value[other]
4267
+ });
4268
+ };
4269
+ const commitOnRelease = (moved_1) => (input) => {
3932
4270
  if (!input) {
3933
- return;
4271
+ return void 0;
3934
4272
  }
3935
- const commit = () => {
3936
- setDragged(null);
3937
- const next = sliderPositionsToDateRange(readPositions(moved_0), scale);
3938
- const other = moved_0 === "from" ? "to" : "from";
3939
- onChange({
3940
- ...next,
3941
- [other]: value[other]
3942
- });
4273
+ const onRelease = () => {
4274
+ commit(moved_1, readPositions(moved_1));
3943
4275
  };
3944
- input.addEventListener("change", commit);
4276
+ input.addEventListener("change", onRelease);
3945
4277
  return () => {
3946
- input.removeEventListener("change", commit);
4278
+ input.removeEventListener("change", onRelease);
3947
4279
  };
3948
4280
  };
3949
- let t7;
3950
- if ($[5] !== readPositions) {
3951
- t7 = (moved_1, event) => {
3952
- if (event.type === "input") {
3953
- setDragged(readPositions(moved_1));
3954
- }
4281
+ const trackDrag = (moved_2, event) => {
4282
+ if (event.type === "input") {
4283
+ setDragged(readPositions(moved_2));
4284
+ }
4285
+ };
4286
+ const onPressStart = (event_0) => {
4287
+ if (event_0.button !== 0 || press.current) {
4288
+ return;
4289
+ }
4290
+ const track = trackBox(event_0.currentTarget);
4291
+ const position = positionOnTrack(event_0.clientX - track.left, track.width);
4292
+ event_0.currentTarget.setPointerCapture(event_0.pointerId);
4293
+ press.current = {
4294
+ pointerId: event_0.pointerId,
4295
+ x: event_0.clientX,
4296
+ position,
4297
+ start: positions,
4298
+ handle: pressedHandle(positions, position, track.width),
4299
+ dragging: false
3955
4300
  };
3956
- $[5] = readPositions;
3957
- $[6] = t7;
3958
- } else {
3959
- t7 = $[6];
3960
- }
3961
- const trackDrag = t7;
4301
+ };
4302
+ const onPressMove = (event_1) => {
4303
+ const current = press.current;
4304
+ if (current?.pointerId !== event_1.pointerId) {
4305
+ return;
4306
+ }
4307
+ const deltaPx = event_1.clientX - current.x;
4308
+ if (!current.dragging && Math.abs(deltaPx) < DRAG_SLOP_PX) {
4309
+ return;
4310
+ }
4311
+ current.dragging = true;
4312
+ current.handle ??= handleOfDrag(deltaPx);
4313
+ const {
4314
+ width
4315
+ } = trackBox(event_1.currentTarget);
4316
+ setDragged(dragPositions(current.start, current.position, current.handle, deltaPx, width));
4317
+ };
4318
+ const onPressEnd = (event_2) => {
4319
+ const current_0 = press.current;
4320
+ if (current_0?.pointerId !== event_2.pointerId) {
4321
+ return;
4322
+ }
4323
+ press.current = null;
4324
+ const {
4325
+ width: width_0
4326
+ } = trackBox(event_2.currentTarget);
4327
+ const {
4328
+ handle,
4329
+ positions: next_0
4330
+ } = current_0.dragging && current_0.handle ? {
4331
+ handle: current_0.handle,
4332
+ positions: dragPositions(current_0.start, current_0.position, current_0.handle, event_2.clientX - current_0.x, width_0)
4333
+ } : tapPositions(current_0.start, current_0.position, width_0);
4334
+ if (next_0) {
4335
+ commit(handle, next_0);
4336
+ }
4337
+ const input_0 = handle === "from" ? fromInput : toInput;
4338
+ input_0.current?.focus({
4339
+ preventScroll: true
4340
+ });
4341
+ };
4342
+ const onPressCancel = (event_3) => {
4343
+ if (press.current?.pointerId === event_3.pointerId) {
4344
+ press.current = null;
4345
+ setDragged(null);
4346
+ }
4347
+ };
3962
4348
  const bins = capturedAt ? dateSliderBins(capturedAt, scale, BINS) : [];
3963
4349
  const maxCount = Math.max(1, ...bins);
3964
4350
  const years = [...new Set(recommendedMaxAgeYears ? [...yearLines, recommendedMaxAgeYears] : yearLines)].map((count) => ({
3965
4351
  count,
3966
4352
  position: dateSliderPosition(yearsAgoMs(count, now), scale)
3967
- })).filter(_temp26);
4353
+ })).filter(({
4354
+ position: position_0
4355
+ }) => position_0 > 0 && position_0 < 1);
3968
4356
  const shownMarkers = markers.map((marker) => {
3969
4357
  const time = typeof marker.date === "number" ? marker.date : parseIsoDateStartMs(marker.date);
3970
4358
  return {
3971
4359
  ...marker,
3972
4360
  position: dateSliderPosition(time, scale)
3973
4361
  };
3974
- }).filter(_temp34);
3975
- let t8;
3976
- if ($[7] !== locale) {
3977
- t8 = (isoDate) => formatDate(parseIsoDateStartMs(isoDate), locale);
3978
- $[7] = locale;
3979
- $[8] = t8;
3980
- } else {
3981
- t8 = $[8];
3982
- }
3983
- const day = t8;
3984
- let t9;
3985
- if ($[9] !== day || $[10] !== shownRange.from || $[11] !== shownRange.to || $[12] !== text) {
3986
- t9 = shownRange.from && shownRange.to ? text.between(day(shownRange.from), day(shownRange.to)) : shownRange.from ? text.since(day(shownRange.from)) : shownRange.to ? text.until(day(shownRange.to)) : text.allDates;
3987
- $[9] = day;
3988
- $[10] = shownRange.from;
3989
- $[11] = shownRange.to;
3990
- $[12] = text;
3991
- $[13] = t9;
3992
- } else {
3993
- t9 = $[13];
3994
- }
3995
- const rangeLabel = t9;
4362
+ }).filter(({
4363
+ position: position_1
4364
+ }) => position_1 > 0 && position_1 < 1);
4365
+ const day = (isoDate) => formatDate(parseIsoDateStartMs(isoDate), locale);
4366
+ const rangeLabel = shownRange.from && shownRange.to ? text.between(day(shownRange.from), day(shownRange.to)) : shownRange.from ? text.since(day(shownRange.from)) : shownRange.to ? text.until(day(shownRange.to)) : text.allDates;
3996
4367
  const setYears = (count_0) => {
3997
4368
  onChange({
3998
4369
  from: new Date(yearsAgoMs(count_0, now)).toISOString().slice(0, 10)
3999
4370
  });
4000
4371
  };
4001
- let t10;
4002
- if ($[14] !== onChange || $[15] !== value) {
4003
- t10 = (key, input_0) => {
4004
- if (input_0 === "") {
4005
- onChange({
4006
- ...value,
4007
- [key]: void 0
4008
- });
4009
- } else {
4010
- if (isIsoDate(input_0)) {
4011
- onChange({
4012
- ...value,
4013
- [key]: input_0
4014
- });
4015
- }
4016
- }
4017
- };
4018
- $[14] = onChange;
4019
- $[15] = value;
4020
- $[16] = t10;
4021
- } else {
4022
- t10 = $[16];
4023
- }
4024
- const setDay = t10;
4372
+ const setDay = (key, input_1) => {
4373
+ if (input_1 === "") {
4374
+ onChange({
4375
+ ...value,
4376
+ [key]: void 0
4377
+ });
4378
+ } else if (isIsoDate(input_1)) {
4379
+ onChange({
4380
+ ...value,
4381
+ [key]: input_1
4382
+ });
4383
+ }
4384
+ };
4025
4385
  const isAllDates = !shownRange.from && !shownRange.to;
4026
- const t11 = shownMarkers.length > 0 ? 14 : 0;
4027
- let t12;
4028
- if ($[17] !== t11) {
4029
- t12 = {
4030
- height: CHART_HEIGHT_PX,
4031
- marginTop: t11
4032
- };
4033
- $[17] = t11;
4034
- $[18] = t12;
4035
- } else {
4036
- t12 = $[18];
4037
- }
4038
- let t13;
4039
- if ($[19] !== maxCount || $[20] !== positions.from || $[21] !== positions.to || $[22] !== text) {
4040
- t13 = (count_1, index) => {
4041
- const start = index / BINS;
4042
- const inRange = start + 1 / BINS > positions.from && start < positions.to;
4043
- return /* @__PURE__ */ jsx("div", { className: `flex-1 rounded-t-[1px] ${inRange ? "bg-slate-500" : "bg-slate-300"}`, style: {
4044
- height: count_1 === 0 ? 0 : Math.max(2, Math.log1p(count_1) / Math.log1p(maxCount) * CHART_HEIGHT_PX)
4045
- }, title: count_1 > 0 ? text.photoCount(count_1) : void 0 }, index);
4046
- };
4047
- $[19] = maxCount;
4048
- $[20] = positions.from;
4049
- $[21] = positions.to;
4050
- $[22] = text;
4051
- $[23] = t13;
4052
- } else {
4053
- t13 = $[23];
4054
- }
4055
- let t15;
4056
- if ($[24] !== positions.from) {
4057
- t15 = percent(positions.from);
4058
- $[24] = positions.from;
4059
- $[25] = t15;
4060
- } else {
4061
- t15 = $[25];
4062
- }
4063
- const t16 = 1 - positions.to;
4064
- let t17;
4065
- if ($[26] !== t16) {
4066
- t17 = percent(t16);
4067
- $[26] = t16;
4068
- $[27] = t17;
4069
- } else {
4070
- t17 = $[27];
4071
- }
4072
- let t18;
4073
- if ($[28] !== t15 || $[29] !== t17) {
4074
- t18 = /* @__PURE__ */ jsx("div", { className: "absolute inset-x-2 top-1/2 h-1 -translate-y-1/2 rounded-full bg-slate-200", children: /* @__PURE__ */ jsx("div", { className: "absolute inset-y-0 rounded-full bg-slate-700", style: {
4075
- left: t15,
4076
- right: t17
4077
- } }) });
4078
- $[28] = t15;
4079
- $[29] = t17;
4080
- $[30] = t18;
4081
- } else {
4082
- t18 = $[30];
4083
- }
4084
- let t19;
4085
- if ($[31] !== day || $[32] !== shownRange.from || $[33] !== text.allDates) {
4086
- t19 = shownRange.from ? day(shownRange.from) : text.allDates;
4087
- $[31] = day;
4088
- $[32] = shownRange.from;
4089
- $[33] = text.allDates;
4090
- $[34] = t19;
4091
- } else {
4092
- t19 = $[34];
4093
- }
4094
- let t20;
4095
- if ($[35] !== trackDrag) {
4096
- t20 = (event_0) => {
4097
- trackDrag("from", event_0.nativeEvent);
4098
- };
4099
- $[35] = trackDrag;
4100
- $[36] = t20;
4101
- } else {
4102
- t20 = $[36];
4103
- }
4104
- let t21;
4105
- if ($[37] !== commitOnRelease) {
4106
- t21 = (input_1) => {
4107
- fromInput.current = input_1;
4108
- return commitOnRelease("from")(input_1);
4109
- };
4110
- $[37] = commitOnRelease;
4111
- $[38] = t21;
4112
- } else {
4113
- t21 = $[38];
4114
- }
4115
- let t22;
4116
- if ($[39] !== positions.from || $[40] !== t19 || $[41] !== t20 || $[42] !== t21 || $[43] !== text.fromHandle) {
4117
- t22 = /* @__PURE__ */ jsx("input", { "aria-label": text.fromHandle, "aria-valuetext": t19, className: HANDLE_CLASS, max: 1, min: 0, onChange: t20, ref: t21, step: STEP, type: "range", value: positions.from });
4118
- $[39] = positions.from;
4119
- $[40] = t19;
4120
- $[41] = t20;
4121
- $[42] = t21;
4122
- $[43] = text.fromHandle;
4123
- $[44] = t22;
4124
- } else {
4125
- t22 = $[44];
4126
- }
4127
- let t23;
4128
- if ($[45] !== day || $[46] !== shownRange.to || $[47] !== text.allDates) {
4129
- t23 = shownRange.to ? day(shownRange.to) : text.allDates;
4130
- $[45] = day;
4131
- $[46] = shownRange.to;
4132
- $[47] = text.allDates;
4133
- $[48] = t23;
4134
- } else {
4135
- t23 = $[48];
4136
- }
4137
- let t24;
4138
- if ($[49] !== trackDrag) {
4139
- t24 = (event_1) => {
4140
- trackDrag("to", event_1.nativeEvent);
4141
- };
4142
- $[49] = trackDrag;
4143
- $[50] = t24;
4144
- } else {
4145
- t24 = $[50];
4146
- }
4147
- let t25;
4148
- if ($[51] !== commitOnRelease) {
4149
- t25 = (input_2) => {
4150
- toInput.current = input_2;
4151
- return commitOnRelease("to")(input_2);
4152
- };
4153
- $[51] = commitOnRelease;
4154
- $[52] = t25;
4155
- } else {
4156
- t25 = $[52];
4157
- }
4158
- let t26;
4159
- if ($[53] !== positions.to || $[54] !== t23 || $[55] !== t24 || $[56] !== t25 || $[57] !== text.toHandle) {
4160
- t26 = /* @__PURE__ */ jsx("input", { "aria-label": text.toHandle, "aria-valuetext": t23, className: HANDLE_CLASS, max: 1, min: 0, onChange: t24, ref: t25, step: STEP, type: "range", value: positions.to });
4161
- $[53] = positions.to;
4162
- $[54] = t23;
4163
- $[55] = t24;
4164
- $[56] = t25;
4165
- $[57] = text.toHandle;
4166
- $[58] = t26;
4167
- } else {
4168
- t26 = $[58];
4169
- }
4170
- let t27;
4171
- if ($[59] !== t18 || $[60] !== t22 || $[61] !== t26) {
4172
- t27 = /* @__PURE__ */ jsxs("div", { className: "relative h-4", children: [
4173
- t18,
4174
- t22,
4175
- t26
4176
- ] });
4177
- $[59] = t18;
4178
- $[60] = t22;
4179
- $[61] = t26;
4180
- $[62] = t27;
4181
- } else {
4182
- t27 = $[62];
4183
- }
4184
- const t28 = "relative mx-2 h-4";
4185
- const t30 = years.map((t29) => {
4186
- const {
4386
+ return /* @__PURE__ */ jsxs("div", { className, children: [
4387
+ /* @__PURE__ */ jsxs(
4388
+ "div",
4389
+ {
4390
+ className: `-mb-3.5 touch-pan-y pb-3.5 select-none ${dragged ? "cursor-grabbing" : "cursor-pointer"}`,
4391
+ onPointerCancel: onPressCancel,
4392
+ onPointerDown: onPressStart,
4393
+ onPointerMove: onPressMove,
4394
+ onPointerUp: onPressEnd,
4395
+ onClick: () => {
4396
+ },
4397
+ children: [
4398
+ /* @__PURE__ */ jsx("div", { className: "mx-2", children: /* @__PURE__ */ jsxs("div", { className: "relative", style: {
4399
+ height: CHART_HEIGHT_PX,
4400
+ marginTop: shownMarkers.length > 0 ? 14 : 0
4401
+ }, children: [
4402
+ /* @__PURE__ */ jsx("div", { "aria-hidden": true, className: "absolute inset-0 flex items-end", children: bins.map((count_1, index) => {
4403
+ const start = index / BINS;
4404
+ const inRange = start + 1 / BINS > positions.from && start < positions.to;
4405
+ return /* @__PURE__ */ jsx(
4406
+ "div",
4407
+ {
4408
+ className: `flex-1 rounded-t-[1px] ${inRange ? "bg-slate-500" : "bg-slate-300"}`,
4409
+ style: {
4410
+ height: count_1 === 0 ? 0 : Math.max(2, Math.log1p(count_1) / Math.log1p(maxCount) * CHART_HEIGHT_PX)
4411
+ },
4412
+ title: count_1 > 0 ? text.photoCount(count_1) : void 0
4413
+ },
4414
+ index
4415
+ );
4416
+ }) }),
4417
+ years.map(({
4418
+ count: count_2,
4419
+ position: position_2
4420
+ }) => /* @__PURE__ */ jsx("div", { "aria-hidden": true, className: "pointer-events-none absolute inset-y-0 w-px -translate-x-1/2", style: {
4421
+ left: percent(position_2),
4422
+ backgroundColor: count_2 === recommendedMaxAgeYears ? RED : "rgb(148 163 184 / 0.7)"
4423
+ } }, count_2)),
4424
+ shownMarkers.map((marker_0) => /* @__PURE__ */ jsx("div", { className: "pointer-events-none absolute inset-y-0 w-0 border-l-2 border-dashed", style: {
4425
+ left: percent(marker_0.position),
4426
+ borderColor: marker_0.color ?? RED
4427
+ }, children: /* @__PURE__ */ jsx("span", { className: "absolute -top-3.5 -translate-x-1/2 text-[10px] leading-none whitespace-nowrap", style: {
4428
+ color: marker_0.color ?? RED
4429
+ }, children: marker_0.label }) }, `${marker_0.date}-${marker_0.label}`))
4430
+ ] }) }),
4431
+ /* @__PURE__ */ jsxs("div", { className: "relative h-4", children: [
4432
+ /* @__PURE__ */ jsx("div", { className: "absolute inset-x-2 top-1/2 h-1 -translate-y-1/2 rounded-full bg-slate-200", children: /* @__PURE__ */ jsx("div", { className: "absolute inset-y-0 rounded-full bg-slate-700", style: {
4433
+ left: percent(positions.from),
4434
+ right: percent(1 - positions.to)
4435
+ } }) }),
4436
+ /* @__PURE__ */ jsx("input", { "aria-label": text.fromHandle, "aria-valuetext": shownRange.from ? day(shownRange.from) : text.allDates, className: HANDLE_CLASS, max: 1, min: 0, onChange: (event_4) => {
4437
+ trackDrag("from", event_4.nativeEvent);
4438
+ }, ref: (input_2) => {
4439
+ fromInput.current = input_2;
4440
+ return commitOnRelease("from")(input_2);
4441
+ }, step: DATE_SLIDER_STEP, type: "range", value: positions.from }),
4442
+ /* @__PURE__ */ jsx("input", { "aria-label": text.toHandle, "aria-valuetext": shownRange.to ? day(shownRange.to) : text.allDates, className: HANDLE_CLASS, max: 1, min: 0, onChange: (event_5) => {
4443
+ trackDrag("to", event_5.nativeEvent);
4444
+ }, ref: (input_3) => {
4445
+ toInput.current = input_3;
4446
+ return commitOnRelease("to")(input_3);
4447
+ }, step: DATE_SLIDER_STEP, type: "range", value: positions.to })
4448
+ ] })
4449
+ ]
4450
+ }
4451
+ ),
4452
+ /* @__PURE__ */ jsx("div", { className: "pointer-events-none relative mx-2 h-4", children: years.map(({
4187
4453
  count: count_3,
4188
- position: position_2
4189
- } = t29;
4190
- return /* @__PURE__ */ jsx("button", { className: `absolute top-0 -translate-x-1/2 rounded px-0.5 text-[10px] leading-4 whitespace-nowrap hover:underline ${count_3 === recommendedMaxAgeYears ? "font-semibold text-red-600" : "text-slate-500 hover:text-slate-900"}`, onClick: () => {
4454
+ position: position_3
4455
+ }) => /* @__PURE__ */ jsx("button", { className: `pointer-events-auto absolute top-0 -translate-x-1/2 rounded px-0.5 text-[10px] leading-4 whitespace-nowrap hover:underline ${count_3 === recommendedMaxAgeYears ? "font-semibold text-red-600" : "text-slate-500 hover:text-slate-900"}`, onClick: () => {
4191
4456
  setYears(count_3);
4192
4457
  }, style: {
4193
- left: percent(position_2)
4194
- }, title: count_3 === recommendedMaxAgeYears ? text.recommendedMaxAge(count_3) : text.lastYears(count_3), type: "button", children: text.yearsShort(count_3) }, count_3);
4195
- });
4196
- let t31;
4197
- if ($[63] !== t30) {
4198
- t31 = /* @__PURE__ */ jsx("div", { className: t28, children: t30 });
4199
- $[63] = t30;
4200
- $[64] = t31;
4201
- } else {
4202
- t31 = $[64];
4203
- }
4204
- let t32;
4205
- if ($[65] !== rangeLabel) {
4206
- t32 = /* @__PURE__ */ jsx("span", { className: "font-medium text-slate-700", children: rangeLabel });
4207
- $[65] = rangeLabel;
4208
- $[66] = t32;
4209
- } else {
4210
- t32 = $[66];
4211
- }
4212
- let t33;
4213
- if ($[67] !== allDatesAction || $[68] !== isAllDates || $[69] !== onChange || $[70] !== text.allDates) {
4214
- t33 = isAllDates || !allDatesAction ? null : /* @__PURE__ */ jsx("button", { className: "shrink-0 font-medium text-slate-600 underline decoration-slate-300 underline-offset-2 hover:text-slate-900", onClick: () => {
4215
- onChange({});
4216
- }, type: "button", children: text.allDates });
4217
- $[67] = allDatesAction;
4218
- $[68] = isAllDates;
4219
- $[69] = onChange;
4220
- $[70] = text.allDates;
4221
- $[71] = t33;
4222
- } else {
4223
- t33 = $[71];
4224
- }
4225
- let t34;
4226
- if ($[72] !== t32 || $[73] !== t33) {
4227
- t34 = /* @__PURE__ */ jsxs("div", { className: "mt-1 flex items-baseline justify-between gap-2 text-xs", children: [
4228
- t32,
4229
- t33
4230
- ] });
4231
- $[72] = t32;
4232
- $[73] = t33;
4233
- $[74] = t34;
4234
- } else {
4235
- t34 = $[74];
4236
- }
4237
- let t35;
4238
- if ($[75] !== dateInputs || $[76] !== setDay || $[77] !== text || $[78] !== value) {
4239
- t35 = dateInputs === "none" ? null : /* @__PURE__ */ jsxs("details", { className: "mt-1 text-xs text-slate-600", open: dateInputs === "open" || void 0, children: [
4458
+ left: percent(position_3)
4459
+ }, title: count_3 === recommendedMaxAgeYears ? text.recommendedMaxAge(count_3) : text.lastYears(count_3), type: "button", children: text.yearsShort(count_3) }, count_3)) }),
4460
+ /* @__PURE__ */ jsxs("div", { className: "mt-1 flex items-baseline justify-between gap-2 text-xs", children: [
4461
+ /* @__PURE__ */ jsx("span", { className: "font-medium text-slate-700", children: rangeLabel }),
4462
+ isAllDates || !allDatesAction ? null : /* @__PURE__ */ jsx("button", { className: "shrink-0 font-medium text-slate-600 underline decoration-slate-300 underline-offset-2 hover:text-slate-900", onClick: () => {
4463
+ onChange({});
4464
+ }, type: "button", children: text.allDates })
4465
+ ] }),
4466
+ dateInputs === "none" ? null : /* @__PURE__ */ jsxs("details", { className: "mt-1 text-xs text-slate-600", open: dateInputs === "open" || void 0, children: [
4240
4467
  /* @__PURE__ */ jsx("summary", { className: "cursor-pointer select-none hover:text-slate-900", children: text.exactDates }),
4241
4468
  /* @__PURE__ */ jsx("div", { className: "mt-1.5 grid grid-cols-2 gap-2", children: ["from", "to"].map((key_0) => /* @__PURE__ */ jsxs("label", { className: "flex flex-col gap-1", children: [
4242
4469
  text[key_0],
4243
- /* @__PURE__ */ jsx("input", { className: "rounded-md border border-slate-200 px-2 py-1.5 text-sm text-slate-800", onChange: (event_2) => {
4244
- setDay(key_0, event_2.target.value);
4470
+ /* @__PURE__ */ jsx("input", { className: "rounded-md border border-slate-200 px-2 py-1.5 text-sm text-slate-800", onChange: (event_6) => {
4471
+ setDay(key_0, event_6.target.value);
4245
4472
  }, type: "date", value: value[key_0] ?? "" })
4246
4473
  ] }, key_0)) })
4247
- ] });
4248
- $[75] = dateInputs;
4249
- $[76] = setDay;
4250
- $[77] = text;
4251
- $[78] = value;
4252
- $[79] = t35;
4253
- } else {
4254
- t35 = $[79];
4255
- }
4256
- return /* @__PURE__ */ jsxs("div", { className, children: [
4257
- /* @__PURE__ */ jsx("div", { className: "mx-2", children: /* @__PURE__ */ jsxs("div", { className: "relative", style: t12, children: [
4258
- /* @__PURE__ */ jsx("div", { "aria-hidden": true, className: "absolute inset-0 flex items-end", children: bins.map(t13) }),
4259
- years.map((t14) => {
4260
- const {
4261
- count: count_2,
4262
- position: position_1
4263
- } = t14;
4264
- return /* @__PURE__ */ jsx("div", { "aria-hidden": true, className: "pointer-events-none absolute inset-y-0 w-px -translate-x-1/2", style: {
4265
- left: percent(position_1),
4266
- backgroundColor: count_2 === recommendedMaxAgeYears ? RED : "rgb(148 163 184 / 0.7)"
4267
- } }, count_2);
4268
- }),
4269
- shownMarkers.map(_temp43)
4270
- ] }) }),
4271
- t27,
4272
- t31,
4273
- t34,
4274
- t35
4474
+ ] })
4275
4475
  ] });
4276
4476
  };
4277
- function _temp11() {
4278
- return Date.now();
4279
- }
4280
- function _temp26(t0) {
4281
- const {
4282
- position
4283
- } = t0;
4284
- return position > 0 && position < 1;
4285
- }
4286
- function _temp34(t0) {
4287
- const {
4288
- position: position_0
4289
- } = t0;
4290
- return position_0 > 0 && position_0 < 1;
4291
- }
4292
- function _temp43(marker_0) {
4293
- return /* @__PURE__ */ jsx("div", { className: "pointer-events-none absolute inset-y-0 w-0 border-l-2 border-dashed", style: {
4294
- left: percent(marker_0.position),
4295
- borderColor: marker_0.color ?? RED
4296
- }, children: /* @__PURE__ */ jsx("span", { className: "absolute -top-3.5 -translate-x-1/2 text-[10px] leading-none whitespace-nowrap", style: {
4297
- color: marker_0.color ?? RED
4298
- }, children: marker_0.label }) }, `${marker_0.date}-${marker_0.label}`);
4299
- }
4300
4477
 
4301
- export { BASE_COLOR, FloatingPhotoViewer, FloatingViewerInfoButton, LocationPickOnMap, MAPILLARY_FEATURE_BAR_LABELS, MapillaryFeatureBar, PhotoCount, PhotoDate, PhotoDateRangeFilter, SELECTION_COLOR, SelectedMapFeatureLayer, StreetLevelImagerySelectionOverlay, StreetLevelImagerySourcesAndLayers, StreetLevelImageryViewCone, StreetLevelImageryViewer, VIEWPOINT_DEFAULT_COLOR, VIEWPOINT_DIRECTION_LAYER_ID, VIEW_SHAPE_FILL_OPACITY, ViewpointLayer, getViewpointSession, previousDataWhile, queryStreetImageryFeatures, resolveSelectedSequence, streetImageryInteractiveLayerIds, useActiveDirectionKey, useAllProviderMapFeatures, useAllProviderPhotos, useArmedLocationOpenerId, useCanGoBack, useCanGoForward, useCurrentHistoryEntry, useLocationPickActions, useMapViewportBbox, useMapillaryImageDetections, useMapillaryMapFeatureImages, useMapillaryMapFeaturesNear, usePhotoFullUrl, usePhotoThumbnail, useProviderMapFeatures, useProviderPhotos, useProviderSequences, useSelectedMapillaryFeature, useViewSuggestions, useViewpointLine, useViewpoints, viewDirectionKeyFromFeatures, viewSuggestionLabel };
4478
+ export { BASE_COLOR, FloatingPhotoViewer, FloatingViewerInfoButton, LocationPickOnMap, MAPILLARY_FEATURE_BAR_LABELS, MapillaryFeatureBar, PhotoCount, PhotoDate, PhotoDateRangeFilter, SELECTION_COLOR, SelectedMapFeatureLayer, StreetLevelImagerySelectionOverlay, StreetLevelImagerySourcesAndLayers, StreetLevelImageryViewCone, StreetLevelImageryViewer, VIEWPOINT_DEFAULT_COLOR, VIEWPOINT_DIRECTION_LAYER_ID, VIEW_SHAPE_FILL_OPACITY, ViewpointLayer, getViewpointSession, previousDataWhile, queryStreetImageryFeatures, resolveSelectedSequence, streetImageryInteractiveLayerIds, useActiveDirectionKey, useAllProviderMapFeatures, useAllProviderPhotos, useArmedLocationOpenerId, useCanGoBack, useCanGoForward, useCurrentHistoryEntry, useLocationPickActions, useMapViewportBbox, useMapillaryImageDetections, useMapillaryMapFeatureImages, useMapillaryMapFeaturesNear, usePhotoFullUrl, usePhotoThumbnail, usePhotosLookingAt, useProviderMapFeatures, useProviderPhotos, useProviderSequences, useSelectedMapillaryFeature, useViewSuggestions, useViewpointLine, useViewpoints, viewDirectionKeyFromFeatures, viewSuggestionLabel };