@depict-ai/ui 4.10.18 → 4.10.20

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.
@@ -7,7 +7,7 @@ import { createStore as $i7OB2$createStore, reconcile as $i7OB2$reconcile } from
7
7
  /*! Depict.ai search and product listing SDK */
8
8
  import { register_es_version } from "../../multi_import_deduplicator.mjs";
9
9
  register_es_version("ui", "latest");
10
- const $ec291e0010116877$export$83d89fbfd8236492 = "4.10.18";
10
+ const $ec291e0010116877$export$83d89fbfd8236492 = "4.10.20";
11
11
  function $dc9262ef6f786812$export$d9f36cf74e24d595(media_query) {
12
12
  const signal = $i7OB2$createSignal(false);
13
13
  $i7OB2$onCleanup($i7OB2$javascript_media_query(media_query, ({
@@ -2049,6 +2049,7 @@ async function $194bd6b8e4c59830$export$79b1565500412d9b(search_modal, modal_fn_
2049
2049
  const modal_els = $i7OB2$createRoot(dispose => {
2050
2050
  let closing_animation;
2051
2051
  let animation_started;
2052
+ let focus_target_after_close;
2052
2053
  dispose_and_remove = () => {
2053
2054
  const actually_close = () => {
2054
2055
  dispose();
@@ -2067,11 +2068,19 @@ async function $194bd6b8e4c59830$export$79b1565500412d9b(search_modal, modal_fn_
2067
2068
  activeElement?.blur?.();
2068
2069
  el.remove();
2069
2070
  });
2070
- if (should_restore_focus && element_focused_before_open?.isConnected) {
2071
+ const requested_focus_target = focus_target_after_close?.();
2072
+ if (should_restore_focus && (requested_focus_target?.isConnected || element_focused_before_open?.isConnected)) {
2071
2073
  restoring_focus = true;
2072
2074
  try {
2073
2075
  // preventScroll so this can't re-introduce the safari page-jump the blur() above works around
2074
- element_focused_before_open.focus({
2076
+ let focused = false;
2077
+ if (requested_focus_target?.isConnected) {
2078
+ requested_focus_target.focus({
2079
+ preventScroll: true
2080
+ });
2081
+ focused = requested_focus_target.getRootNode().activeElement === requested_focus_target;
2082
+ }
2083
+ if (!focused && element_focused_before_open?.isConnected) element_focused_before_open.focus({
2075
2084
  preventScroll: true
2076
2085
  });
2077
2086
  } finally {
@@ -2092,7 +2101,8 @@ async function $194bd6b8e4c59830$export$79b1565500412d9b(search_modal, modal_fn_
2092
2101
  ...extra_options_for_modal,
2093
2102
  close_modal_: close_modal_,
2094
2103
  open_modal_: open_modal_,
2095
- register_closing_animation_: animation => closing_animation = animation
2104
+ register_closing_animation_: animation => closing_animation = animation,
2105
+ set_focus_target_after_close_: get_target => focus_target_after_close = get_target
2096
2106
  });
2097
2107
  });
2098
2108
  body.append(...modal_els);
@@ -6261,7 +6271,8 @@ function $70bb27cc6be01fc7$export$140423fa4bfb6d63(props) {
6261
6271
  }));
6262
6272
  }
6263
6273
  var $f916989c4b1be9f7$var$_tmpl$ = ["<video", ' disablepictureinpicture="true" class="d-standard-content"></video>'],
6264
- $f916989c4b1be9f7$var$_tmpl$2 = ["<span", ' class="d-standard-content-text"', ">", "</span>"];
6274
+ $f916989c4b1be9f7$var$_tmpl$2 = ["<div", ' class="d-standard-content-text-group"', '><span class="d-standard-content-text"', ">", '</span><span class="d-standard-content-cta"', ">", "</span></div>"],
6275
+ $f916989c4b1be9f7$var$_tmpl$3 = ["<span", ' class="d-standard-content-text"', ">", "</span>"];
6265
6276
  function $f916989c4b1be9f7$export$780a853d15174484({
6266
6277
  link_: link_,
6267
6278
  type_: type_,
@@ -6271,7 +6282,8 @@ function $f916989c4b1be9f7$export$780a853d15174484({
6271
6282
  aspectRatioWhenAloneInRow_: aspectRatioWhenAloneInRow_,
6272
6283
  imageResizer_: imageResizer_,
6273
6284
  text_: text_,
6274
- textPosition_: textPosition_
6285
+ textPosition_: textPosition_,
6286
+ cta_: cta_
6275
6287
  }) {
6276
6288
  let wroteAspectRatioToContainer = false; // Only write this once so we don't get into a aspect ratio changed -> size changed -> image source changed -> aspect ratio slightly changed infinite loop
6277
6289
  const [wrapperSize, setWrapperSize] = $i7OB2$createSignal();
@@ -6333,12 +6345,31 @@ function $f916989c4b1be9f7$export$780a853d15174484({
6333
6345
  }), $i7OB2$createComponent((0, $i7OB2$Show), {
6334
6346
  when: text_,
6335
6347
  get children() {
6336
- return $i7OB2$ssr($f916989c4b1be9f7$var$_tmpl$2, $i7OB2$ssrHydrationKey(), $i7OB2$ssrAttribute("data-position", $i7OB2$escape(textPosition_, true) || "bottom-center", false), $i7OB2$escape(text_));
6348
+ return $i7OB2$createComponent((0, $i7OB2$Show), {
6349
+ when: cta_,
6350
+ get fallback() {
6351
+ return $i7OB2$ssr($f916989c4b1be9f7$var$_tmpl$3, $i7OB2$ssrHydrationKey(), $i7OB2$ssrAttribute("data-position", $i7OB2$escape(textPosition_, true) || "bottom-center", false), $i7OB2$escape(text_));
6352
+ },
6353
+ get children() {
6354
+ return $i7OB2$ssr($f916989c4b1be9f7$var$_tmpl$2, $i7OB2$ssrHydrationKey(), $i7OB2$ssrAttribute("data-position", $i7OB2$escape(textPosition_, true) || "bottom-center", false), $i7OB2$ssrAttribute("data-position", $i7OB2$escape(textPosition_, true) || "bottom-center", false), $i7OB2$escape(text_), $i7OB2$ssrAttribute("data-position", $i7OB2$escape(textPosition_, true) || "bottom-center", false), $i7OB2$escape(cta_));
6355
+ }
6356
+ });
6337
6357
  }
6338
6358
  })];
6339
6359
  }
6340
6360
  }));
6341
6361
  }
6362
+ const $486360b09f0d5729$export$af2c67164f68e9e9 = content => {
6363
+ const {
6364
+ link: link,
6365
+ type: type,
6366
+ url: url,
6367
+ text: text,
6368
+ text_position: text_position,
6369
+ cta: cta
6370
+ } = content;
6371
+ return JSON.stringify([link, type, url, text ?? null, text_position ?? null, cta ?? null]);
6372
+ };
6342
6373
  function $486360b09f0d5729$export$7a92d995f1bf3592(history_content_blocks_, plp_meta, content_blocks_by_row_, router_, products_request_loading_, imageResizer_) {
6343
6374
  let hasSeenContentBlock = false;
6344
6375
  const [historyContentBlocks, setHistoryContentBlocks] = history_content_blocks_;
@@ -6375,13 +6406,11 @@ function $486360b09f0d5729$export$7a92d995f1bf3592(history_content_blocks_, plp_
6375
6406
  type: type,
6376
6407
  url: url,
6377
6408
  text: text,
6378
- text_position: text_position
6409
+ text_position: text_position,
6410
+ cta: cta
6379
6411
  }
6380
6412
  } = row;
6381
- // Key the "content"-component by its rendered inputs, so we can reuse the component (and later downstream the block elements) if it's the same
6382
- // This makes the block not flicker when going backwards/forwards if the content is the same on both pages
6383
- // Also it lets us rewrite the blocks state in the history based on the block aspect ratio without infinite looping
6384
- const componentCacheKey = JSON.stringify([link, type, url, text ?? null, text_position ?? null]);
6413
+ const componentCacheKey = $486360b09f0d5729$export$af2c67164f68e9e9(row.content);
6385
6414
  // The aspect ratio depends only on the media, so its history key must stay the pre-text 3-element shape — widening it would orphan every ratio already persisted in history.state
6386
6415
  const mediaCacheKey = JSON.stringify([link, type, url]);
6387
6416
  let component = contentComponents.get(componentCacheKey);
@@ -6401,7 +6430,8 @@ function $486360b09f0d5729$export$7a92d995f1bf3592(history_content_blocks_, plp_
6401
6430
  })),
6402
6431
  imageResizer_: imageResizer_,
6403
6432
  text_: text,
6404
- textPosition_: text_position
6433
+ textPosition_: text_position,
6434
+ cta_: cta
6405
6435
  });
6406
6436
  contentComponents.set(componentCacheKey, component);
6407
6437
  }
@@ -8718,6 +8748,7 @@ function $081752ca508a876f$export$f7658c347b037c3f(props = {}) {
8718
8748
  var $5285d2814d0fac0c$var$_tmpl$ = ["<div", ' style="', '" class="spacer"></div>'],
8719
8749
  $5285d2814d0fac0c$var$_tmpl$2 = ['<div class="field"><!--$-->', "<!--/-->", "<!--$-->", "<!--/--></div>"],
8720
8750
  $5285d2814d0fac0c$var$_tmpl$3 = ["<button", ' class="submit major" type="button"', ">", "</button>"];
8751
+ const $5285d2814d0fac0c$var$keys_not_opening_modal = new Set(["Tab", "Shift", "Control", "Alt", "AltGraph", "Meta", "CapsLock", "Escape", "ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight", "PageUp", "PageDown", "Home", "End", "Insert", "ContextMenu", "NumLock", "ScrollLock", "Pause", "PrintScreen"]);
8721
8752
  function $5285d2814d0fac0c$export$b94867ecbd698f21({
8722
8753
  search_field_value_: [searchFieldValue, setSearchFieldValue],
8723
8754
  input_field_ref_: input_field_ref_,
@@ -8859,6 +8890,31 @@ function $512b994d501f412b$export$93d9bfd0c9c1a5b8(close_modal, search_query_url
8859
8890
  }
8860
8891
  })();
8861
8892
  }
8893
+ function $8b2ecf1919837863$export$9e9e2ae069cf2fe1({
8894
+ props_search_field_value_: props_search_field_value_,
8895
+ props_submit_query_: props_submit_query_,
8896
+ dont_sync_search_field_value_except_on_submit_: dont_sync_search_field_value_except_on_submit_,
8897
+ set_focus_target_after_close_: set_focus_target_after_close_,
8898
+ get_search_page_input_element_: get_search_page_input_element_
8899
+ }) {
8900
+ const search_field_value_ = dont_sync_search_field_value_except_on_submit_ ? $i7OB2$createSignal("") : props_search_field_value_;
8901
+ let submits_in_flight = 0;
8902
+ const submit_query_ = async (new_query = $i7OB2$untrack(search_field_value_[0])) => {
8903
+ submits_in_flight++;
8904
+ try {
8905
+ return await props_submit_query_(new_query, () => set_focus_target_after_close_(get_search_page_input_element_));
8906
+ } finally {
8907
+ submits_in_flight--;
8908
+ }
8909
+ };
8910
+ if (dont_sync_search_field_value_except_on_submit_) $i7OB2$createEffect($i7OB2$on(search_field_value_[0], value => submits_in_flight > 0 && props_search_field_value_[1](value), {
8911
+ defer: true
8912
+ }));
8913
+ return {
8914
+ search_field_value_: search_field_value_,
8915
+ submit_query_: submit_query_
8916
+ };
8917
+ }
8862
8918
  var $42912431795f188e$var$_tmpl$ = ["<div", ' class="discover-more"><button class="major" type="button">', "</button></div>"],
8863
8919
  $42912431795f188e$var$_tmpl$2 = ["<b", ">", "</b>"],
8864
8920
  $42912431795f188e$var$_tmpl$3 = ["<div", ' class="', '"><div class="', '" role="search" aria-label="Search modal with search field, query suggestions and result preview"><!--$-->', '<!--/--><div id="depict-suggestions-and-result-preview" class="padded"><!--$-->', "<!--/--><!--$-->", "<!--/--><!--$-->", "<!--/--></div><!--$-->", "<!--/--></div><!--$-->", "<!--/--></div>"],
@@ -8872,6 +8928,8 @@ function $42912431795f188e$var$RawClassicSearchModal({
8872
8928
  search_query_url_param_name_: search_query_url_param_name_,
8873
8929
  previous_searches_: previous_searches_,
8874
8930
  close_modal_: close_modal_,
8931
+ set_focus_target_after_close_: set_focus_target_after_close_,
8932
+ get_search_page_input_element_: get_search_page_input_element_,
8875
8933
  depict_api_: depict_api_,
8876
8934
  merchant_: merchant_,
8877
8935
  market_: market_,
@@ -8896,15 +8954,16 @@ function $42912431795f188e$var$RawClassicSearchModal({
8896
8954
  // As per feedback from stronger we sometimes want a modal with the search field value disconnected from the one in the rest of the UI, see https://depictaiworkspace.slack.com/archives/C02J16R9XEH/p1679065878487709.
8897
8955
  // This is desired for when the modal is opened from a UI element that visually does not look connected with the search page or current query
8898
8956
  // Basically the UI signals that the button that opens the modal starts a new search.
8899
- const search_field_value_ = dont_sync_search_field_value_except_on_submit_ ? $i7OB2$createSignal("") : props_search_field_value;
8900
- const propagate_search_field_value_back = dont_sync_search_field_value_except_on_submit_ ? () => props_search_field_value[1]($i7OB2$untrack(search_field_value_[0])) // Set actual search field value to the throwaway internal one before submitting
8901
- : undefined;
8902
- const submit_query_ = (...args) => {
8903
- // submit_query expects to read the current search field value which is why we have to write the current one to the signal before calling it
8904
- // It will write the old one back and then write the new one after submit
8905
- propagate_search_field_value_back?.();
8906
- return props_submit_query(...args);
8907
- };
8957
+ const {
8958
+ search_field_value_: search_field_value_,
8959
+ submit_query_: submit_query_
8960
+ } = $8b2ecf1919837863$export$9e9e2ae069cf2fe1({
8961
+ props_search_field_value_: props_search_field_value,
8962
+ props_submit_query_: props_submit_query,
8963
+ dont_sync_search_field_value_except_on_submit_: dont_sync_search_field_value_except_on_submit_,
8964
+ set_focus_target_after_close_: set_focus_target_after_close_,
8965
+ get_search_page_input_element_: get_search_page_input_element_
8966
+ });
8908
8967
  const [input_field, set_input_field] = $i7OB2$createSignal();
8909
8968
  const [get_search_field_value_] = search_field_value_;
8910
8969
  // Search field alignment unused in ClassicSearchModal since the search field spans the whole modal
@@ -9502,6 +9561,8 @@ function $500a16dd18ee5a71$var$RawSearchModalV2({
9502
9561
  search_query_url_param_name_: search_query_url_param_name_,
9503
9562
  previous_searches_: previous_searches_,
9504
9563
  close_modal_: close_modal_,
9564
+ set_focus_target_after_close_: set_focus_target_after_close_,
9565
+ get_search_page_input_element_: get_search_page_input_element_,
9505
9566
  alignmentSignals_: alignmentSignals_,
9506
9567
  depict_api_: depict_api_,
9507
9568
  merchant_: merchant_,
@@ -9532,15 +9593,16 @@ function $500a16dd18ee5a71$var$RawSearchModalV2({
9532
9593
  // As per feedback from stronger we sometimes want a modal with the search field value disconnected from the one in the rest of the UI, see https://depictaiworkspace.slack.com/archives/C02J16R9XEH/p1679065878487709.
9533
9594
  // This is desired for when the modal is opened from a UI element that visually does not look connected with the search page or current query
9534
9595
  // Basically the UI signals that the button that opens the modal starts a new search.
9535
- const search_field_value_ = dont_sync_search_field_value_except_on_submit_ ? $i7OB2$createSignal("") : props_search_field_value;
9536
- const propagate_search_field_value_back = dont_sync_search_field_value_except_on_submit_ ? () => props_search_field_value[1]($i7OB2$untrack(search_field_value_[0])) // Set actual search field value to the throwaway internal one before submitting
9537
- : undefined;
9538
- const submit_query_ = (...args) => {
9539
- // submit_query expects to read the current search field value which is why we have to write the current one to the signal before calling it
9540
- // It will write the old one back and then write the new one after submit
9541
- propagate_search_field_value_back?.();
9542
- return props_submit_query(...args);
9543
- };
9596
+ const {
9597
+ search_field_value_: search_field_value_,
9598
+ submit_query_: submit_query_
9599
+ } = $8b2ecf1919837863$export$9e9e2ae069cf2fe1({
9600
+ props_search_field_value_: props_search_field_value,
9601
+ props_submit_query_: props_submit_query,
9602
+ dont_sync_search_field_value_except_on_submit_: dont_sync_search_field_value_except_on_submit_,
9603
+ set_focus_target_after_close_: set_focus_target_after_close_,
9604
+ get_search_page_input_element_: get_search_page_input_element_
9605
+ });
9544
9606
  const [input_field, set_input_field] = $i7OB2$createSignal();
9545
9607
  const [searching_for_value_, set_searching_for_value_] = $i7OB2$createSignal();
9546
9608
  const [show_stale_content_results_, set_show_stale_content_results_] = $i7OB2$createSignal(false);
@@ -11368,11 +11430,12 @@ function $21f51c14cb3f586f$export$84bba84a7b837187(read_search_query) {
11368
11430
  async function $bfd908d13d90934c$export$e16630ecb9644a1c({
11369
11431
  on_submit_with_unchanged_value_: on_submit_with_unchanged_value_,
11370
11432
  search_param_name_: search_param_name_,
11371
- set_search_field_value_: set_search_field_value_,
11433
+ search_field_value_: search_field_value_,
11372
11434
  get_search_query_: get_search_query_,
11373
11435
  url_transformer_: url_transformer_,
11374
11436
  router_: router_,
11375
11437
  after_submit_: after_submit_,
11438
+ before_navigate_: before_navigate_,
11376
11439
  get_new_query: get_new_query
11377
11440
  }) {
11378
11441
  const new_search_query = get_new_query();
@@ -11380,21 +11443,89 @@ async function $bfd908d13d90934c$export$e16630ecb9644a1c({
11380
11443
  if (previous_query === new_search_query && new URLSearchParams(location.search).has(search_param_name_)) {
11381
11444
  // don't push a history entry / re-search if someone submits a search again
11382
11445
  // do close the modal though
11446
+ search_field_value_.settle_(new_search_query);
11383
11447
  on_submit_with_unchanged_value_?.();
11384
- return;
11448
+ return false;
11385
11449
  }
11386
- set_search_field_value_(previous_query); // restore the value to the previous query since this one goes to the new history entry
11387
11450
  const target_url = new URL(location.href);
11388
11451
  url_transformer_?.(target_url);
11389
11452
  target_url.searchParams.set(search_param_name_, new_search_query);
11390
- await router_.navigate_.go_to_({
11391
- new_url_: target_url,
11392
- is_replace_: false,
11393
- force_spa_navigation_: true
11394
- });
11395
- set_search_field_value_(new_search_query);
11453
+ const end_submit = search_field_value_.begin_submit_(new_search_query, previous_query);
11454
+ before_navigate_?.();
11455
+ let landed;
11456
+ try {
11457
+ await router_.navigate_.go_to_({
11458
+ new_url_: target_url,
11459
+ is_replace_: false,
11460
+ force_spa_navigation_: true
11461
+ });
11462
+ } finally {
11463
+ landed = end_submit();
11464
+ }
11465
+ if (!landed) return false;
11396
11466
  scrollTo(0, 0);
11397
11467
  after_submit_?.();
11468
+ return true;
11469
+ }
11470
+ function $a578366fad1bde47$export$d13a185c53aa5edf(persisted_, get_search_query_) {
11471
+ const [get_persisted, set_persisted] = persisted_;
11472
+ const [get_submitting, set_submitting] = $i7OB2$createSignal();
11473
+ const get_value = $i7OB2$createMemo(() => get_submitting() ?? get_persisted());
11474
+ const set_value = value => {
11475
+ const new_value = typeof value === "function" ? value($i7OB2$untrack(get_value)) : value;
11476
+ if ($i7OB2$untrack(get_submitting) === undefined) set_persisted(new_value);else set_submitting(new_value);
11477
+ return new_value;
11478
+ };
11479
+ let current_submit;
11480
+ const end_submit = landed => {
11481
+ current_submit.landed_ = landed;
11482
+ current_submit = undefined;
11483
+ $i7OB2$batch(() => {
11484
+ const submitting = $i7OB2$untrack(get_submitting);
11485
+ set_submitting(undefined);
11486
+ if (landed && submitting !== undefined) set_persisted(submitting);
11487
+ });
11488
+ };
11489
+ const abort_on_popstate = what_happened => {
11490
+ if (what_happened === "popstate" && current_submit) end_submit(false);
11491
+ };
11492
+ (0, $i7OB2$instant_exec_on_suspect_history_change).add(abort_on_popstate);
11493
+ $i7OB2$onCleanup(() => (0, $i7OB2$instant_exec_on_suspect_history_change).delete(abort_on_popstate));
11494
+ $i7OB2$createEffect($i7OB2$on(get_search_query_, query => {
11495
+ const token = current_submit;
11496
+ if (!token || query !== token.query_) return;
11497
+ queueMicrotask(() => {
11498
+ if (current_submit === token) end_submit(true);
11499
+ });
11500
+ }, {
11501
+ defer: true
11502
+ }));
11503
+ const begin_submit_ = (submitted_query, query_of_current_history_entry) => {
11504
+ const token = current_submit = {
11505
+ query_: submitted_query,
11506
+ landed_: false
11507
+ };
11508
+ $i7OB2$batch(() => {
11509
+ set_submitting(submitted_query);
11510
+ set_persisted(query_of_current_history_entry);
11511
+ });
11512
+ return () => {
11513
+ if (current_submit === token) end_submit(true);
11514
+ return token.landed_;
11515
+ };
11516
+ };
11517
+ const settle_ = query => {
11518
+ if (current_submit) return;
11519
+ $i7OB2$batch(() => {
11520
+ set_submitting(undefined);
11521
+ set_persisted(query);
11522
+ });
11523
+ };
11524
+ return {
11525
+ value_: [get_value, set_value],
11526
+ begin_submit_: begin_submit_,
11527
+ settle_: settle_
11528
+ };
11398
11529
  }
11399
11530
  function $d68658730065de95$export$181cceed5c91919e(callback, alsoRaF, passiveListener) {
11400
11531
  let aligned_this_microtask = false;
@@ -12030,6 +12161,7 @@ function $7097477c78a89208$export$a54ec244c8863715({
12030
12161
  scroll_restoration_data_: scroll_restoration_data_,
12031
12162
  product_card_template_: product_card_template_,
12032
12163
  modalAlignmentSignalsRef_: modalAlignmentSignalsRef_,
12164
+ inputFieldRef_: inputFieldRef_,
12033
12165
  router_: router_,
12034
12166
  content_results_rows_: content_results_rows_,
12035
12167
  content_layout_options_: content_layout_options_,
@@ -12209,6 +12341,8 @@ function $7097477c78a89208$export$a54ec244c8863715({
12209
12341
  if (!search_field) break add_input_field;
12210
12342
  setModalBodyStyle({});
12211
12343
  modalAlignmentSignalsRef_?.(alignmentSignals_);
12344
+ inputFieldRef_?.(input_element);
12345
+ $i7OB2$onCleanup(() => inputFieldRef_?.(undefined));
12212
12346
  const [pollAlignment, setPollAlignment_] = $i7OB2$createSignal(false);
12213
12347
  const align_position = $i7OB2$catchify1((0, $b6d5529b253681aa$export$b3ad617e9036868))(alignmentSignals_, search_field, (0, $b6d5529b253681aa$export$3f238c96c45e6cc6) | (0, $b6d5529b253681aa$export$7895aadd1956b1c7) | (modalVersionUsed_ === 1 ? (0, $b6d5529b253681aa$export$902f8b4a7dae5d78) : (0, $b6d5529b253681aa$export$6060bc6bee850eb6) | (0, $b6d5529b253681aa$export$5097308c5200105a)), true, pollAlignment);
12214
12348
  div_with_field_class.addEventListener("click", $i7OB2$catchify1(e => {
@@ -12510,14 +12644,16 @@ class $806c97b931758897$export$ac6237957a15b3f0 {
12510
12644
  set_search_content_results_rows((0, $49de9d31aeea1b5e$export$70ceae36059a1036));
12511
12645
  }; // do this every time after we have submitted a new query - otherwise there might already be a saved number of rows in the state
12512
12646
  const on_submit_with_unchanged_value_ = () => this.modal_open = false;
12513
- const [get_search_field_value_, set_search_field_value_] = state_.field_value;
12514
- const configured_submit_query_ = new_query => $bfd908d13d90934c$export$e16630ecb9644a1c({
12647
+ const search_field_value_ = $a578366fad1bde47$export$d13a185c53aa5edf(state_.field_value, get_search_query_);
12648
+ const [get_search_field_value_] = search_field_value_.value_;
12649
+ const configured_submit_query_ = (new_query, before_navigate_) => $bfd908d13d90934c$export$e16630ecb9644a1c({
12515
12650
  on_submit_with_unchanged_value_: on_submit_with_unchanged_value_,
12516
- set_search_field_value_: set_search_field_value_,
12651
+ search_field_value_: search_field_value_,
12517
12652
  get_search_query_: get_search_query_,
12518
12653
  search_param_name_: search_query_url_param_name_,
12519
12654
  after_submit_: after_submit_,
12520
- get_new_query: () => new_query || $i7OB2$untrack(get_search_field_value_),
12655
+ before_navigate_: before_navigate_,
12656
+ get_new_query: () => new_query ?? $i7OB2$untrack(get_search_field_value_),
12521
12657
  url_transformer_: url_transformer,
12522
12658
  router_: this.#router
12523
12659
  });
@@ -12536,6 +12672,7 @@ class $806c97b931758897$export$ac6237957a15b3f0 {
12536
12672
  search_query_url_param_name_: search_query_url_param_name_,
12537
12673
  reset_history_state_: reset_history_state_,
12538
12674
  state_: state_,
12675
+ search_field_value_: search_field_value_.value_,
12539
12676
  router_: this.#router,
12540
12677
  url_transformer_: url_transformer,
12541
12678
  depict_api_: depict_api_,
@@ -12559,7 +12696,8 @@ class $806c97b931758897$export$ac6237957a15b3f0 {
12559
12696
  $i7OB2$onCleanup(() => this.modal_open = false);
12560
12697
  return searchModalComponent(...args);
12561
12698
  }, {
12562
- search_field_value_: state_.field_value,
12699
+ search_field_value_: search_field_value_.value_,
12700
+ get_search_page_input_element_: () => $806c97b931758897$export$dde08b2dca8cc1ce.get(this)?.search_page_input_element_,
12563
12701
  get_search_query_: get_search_query_,
12564
12702
  search_query_url_param_name_: search_query_url_param_name_,
12565
12703
  previous_searches_: previous_searches,
@@ -12707,6 +12845,7 @@ function $806c97b931758897$export$f2dc7e4e4aa11abb(props) {
12707
12845
  const {
12708
12846
  state_: state_
12709
12847
  } = shared_properties;
12848
+ let registered_input_element;
12710
12849
  const grid_spacing_override = $i7OB2$createMemo(() => {
12711
12850
  const {
12712
12851
  grid_spacing: grid_spacing
@@ -12735,7 +12874,7 @@ function $806c97b931758897$export$f2dc7e4e4aa11abb(props) {
12735
12874
  min_products_to_fetch_: $806c97b931758897$var$min_products_to_fetch_,
12736
12875
  local_filter_cache_: state_.local_filter_cache,
12737
12876
  content_search_enabled_: () => depict_search.enable_content_search ?? $806c97b931758897$var$content_search_default,
12738
- search_field_value_: state_.field_value,
12877
+ search_field_value_: shared_properties.search_field_value_,
12739
12878
  get_search_query_: shared_properties.get_search_query_,
12740
12879
  clear_filters_on_next_submit_: shared_properties.clear_filters_on_next_submit_,
12741
12880
  open_modal_: (...args) => depict_search.modal_open = args,
@@ -12743,6 +12882,16 @@ function $806c97b931758897$export$f2dc7e4e4aa11abb(props) {
12743
12882
  modalVersionUsed_: shared_properties.modalVersionUsed_,
12744
12883
  showSliderArrow_: () => props.showSliderArrow_,
12745
12884
  i18n_: shared_properties.i18n_,
12885
+ inputFieldRef_: input_element => {
12886
+ const shared_info_right_now = $806c97b931758897$export$dde08b2dca8cc1ce.get(depict_search);
12887
+ if (!shared_info_right_now) return;
12888
+ if (input_element === undefined && shared_info_right_now.search_page_input_element_ !== registered_input_element) return;
12889
+ registered_input_element = input_element;
12890
+ $806c97b931758897$export$dde08b2dca8cc1ce.set(depict_search, {
12891
+ ...shared_info_right_now,
12892
+ search_page_input_element_: input_element
12893
+ });
12894
+ },
12746
12895
  modalAlignmentSignalsRef_: style => {
12747
12896
  const shared_info_right_now = $806c97b931758897$export$dde08b2dca8cc1ce.get(depict_search);
12748
12897
  if (!shared_info_right_now) return;
@@ -13093,7 +13242,7 @@ function $58b3487626e85ece$export$316f6f283ae64765(props) {
13093
13242
  return shared_properties.BackIcon_;
13094
13243
  },
13095
13244
  get search_field_value_() {
13096
- return shared_properties.state_.field_value;
13245
+ return shared_properties.search_field_value_;
13097
13246
  },
13098
13247
  get submit_query_() {
13099
13248
  return shared_properties.configured_submit_query_;
@@ -13136,7 +13285,7 @@ function $58b3487626e85ece$export$316f6f283ae64765(props) {
13136
13285
  return shared_properties.BackIcon_;
13137
13286
  },
13138
13287
  get search_field_value_() {
13139
- return shared_properties.state_.field_value;
13288
+ return shared_properties.search_field_value_;
13140
13289
  },
13141
13290
  get submit_query_() {
13142
13291
  return shared_properties.configured_submit_query_;