@depict-ai/utilishared 1.0.12 → 1.0.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (5) hide show
  1. package/README.md +130 -130
  2. package/dist/index.d.ts +2429 -2429
  3. package/dist/main.js +143 -143
  4. package/dist/module.js +143 -143
  5. package/package.json +2 -2
package/dist/main.js CHANGED
@@ -280,7 +280,7 @@ $parcel$export(module.exports, "relative_luminance_from_rgb", () => $d73746ee466
280
280
  $parcel$export(module.exports, "hsb_to_rgb", () => $d73746ee466f09ca$export$486b165479b9284f);
281
281
  $parcel$export(module.exports, "version", () => $815f67c61b4c0a42$export$83d89fbfd8236492);
282
282
  $parcel$export(module.exports, "add_to_version_info", () => $e4a18bf12ad092d9$export$2cefb7e61fcbae00);
283
- const $815f67c61b4c0a42$export$83d89fbfd8236492 = "1.0.12";
283
+ const $815f67c61b4c0a42$export$83d89fbfd8236492 = "1.0.14";
284
284
 
285
285
 
286
286
  const $7b5e577a60b81e60$export$55fe61489d2c7417 = /*@__PURE__*/ (()=>process.env.STRIP_DEBUG === "true" ? false : process.env.DEBUG === "true" || process.env.NODE_ENV === "development" || process.env.BUILD_TARGET !== "node" && (globalThis?.document?.currentScript?.dataset?.debug === "true" || globalThis?.localStorage?.getItem?.("debug") === "true"))();
@@ -324,8 +324,8 @@ function $e4a18bf12ad092d9$export$fe609f0216e4ebef(url) {
324
324
 
325
325
 
326
326
  // Source: https://stackoverflow.com/a/30106551
327
- /**
328
- * Encoding UTF8 ⇢ base64
327
+ /**
328
+ * Encoding UTF8 ⇢ base64
329
329
  */ function $ff7c981d968fe09a$export$a1893782a2a6be0d(str) {
330
330
  return btoa(encodeURIComponent(str).replace(/%([0-9A-F]{2})/g, function(match, p1) {
331
331
  return String.fromCharCode(parseInt(p1, 16));
@@ -340,13 +340,13 @@ function $ff7c981d968fe09a$export$a7e53ec3b3fdd030(str) {
340
340
 
341
341
 
342
342
 
343
- /**
344
- * Class containing state that an IPNS operates on. It's only exported for type info and in case that you want to use it for instanceof checks.
345
- * subscribers is an array of functions that get called every time push_value is called with a new value AND all previous subscribers are done
346
- * queue is the queue of values that subscribers gets called with
347
- * last_processed_value is the last value that the subscribers were called with
348
- * push_value adds a new value to the queue and triggers the calling of the subscribers if they're done
349
- * subscriber_done decrements the number of subscribers we are waiting for, if this isn't called call_subscribers will get stuck. It also triggers a new call to call_subscribers
343
+ /**
344
+ * Class containing state that an IPNS operates on. It's only exported for type info and in case that you want to use it for instanceof checks.
345
+ * subscribers is an array of functions that get called every time push_value is called with a new value AND all previous subscribers are done
346
+ * queue is the queue of values that subscribers gets called with
347
+ * last_processed_value is the last value that the subscribers were called with
348
+ * push_value adds a new value to the queue and triggers the calling of the subscribers if they're done
349
+ * subscriber_done decrements the number of subscribers we are waiting for, if this isn't called call_subscribers will get stuck. It also triggers a new call to call_subscribers
350
350
  */ class $5a591e8156b1128c$export$e2c811ae0eb35313 {
351
351
  subscribers_ = [];
352
352
  waiting_for_update_ = 0;
@@ -422,10 +422,10 @@ function $5a591e8156b1128c$export$3e42f5078e3abfc0(state) {
422
422
  }
423
423
 
424
424
 
425
- /**
426
- * You know how you can write `break` inside of a `for await` loop to exit it? Well, this lets you break the loop from outside. Pass any async iterable that never throws and you will get back a function and a specially proxied async iterable. Whenever you call the function all for await loops iterating the returned iterable will break. Note: This will add some extra ticks because awaiting thenable objects takes more ticks than awaiting promises.
427
- * @param async_iterable The async iterable you want to make exitable
428
- * @return An array containing a function, the exit function, and a wrapped async iterable
425
+ /**
426
+ * You know how you can write `break` inside of a `for await` loop to exit it? Well, this lets you break the loop from outside. Pass any async iterable that never throws and you will get back a function and a specially proxied async iterable. Whenever you call the function all for await loops iterating the returned iterable will break. Note: This will add some extra ticks because awaiting thenable objects takes more ticks than awaiting promises.
427
+ * @param async_iterable The async iterable you want to make exitable
428
+ * @return An array containing a function, the exit function, and a wrapped async iterable
429
429
  */ function $bbe52965151ee7f0$export$927664b47117acb0(async_iterable) {
430
430
  const promise_result_setting_functions = new Map();
431
431
  const exit_function = ()=>{
@@ -906,11 +906,11 @@ function $268cbd9e4ade92db$export$f18d5b0af29128b7(msg, severity, input_data = {
906
906
  }
907
907
 
908
908
 
909
- /**
910
- * Gives a random number between min and max (potentially including min and max).
911
- * @param min The minimum number.
912
- * @param max The maximum number.
913
- * @returns a random number
909
+ /**
910
+ * Gives a random number between min and max (potentially including min and max).
911
+ * @param min The minimum number.
912
+ * @param max The maximum number.
913
+ * @returns a random number
914
914
  */ function $3f34dc07544c5857$export$bb0a9c36cf454ea0(min, max) {
915
915
  return Math.floor(Math.random() * (max - min + 1)) + min;
916
916
  }
@@ -1233,9 +1233,9 @@ class $d10801050840d92b$export$1d9c6fddbff3441f extends $d10801050840d92b$export
1233
1233
  }
1234
1234
 
1235
1235
 
1236
- /**
1237
- * Returns a random string
1238
- * @return A random string, containing a-z, 0-9 and occasionally a dot (`.`)
1236
+ /**
1237
+ * Returns a random string
1238
+ * @return A random string, containing a-z, 0-9 and occasionally a dot (`.`)
1239
1239
  */ function $650b64c1b384c895$export$656831b7e9c341c3() {
1240
1240
  return (Math.random() * 2e17).toString(36);
1241
1241
  }
@@ -1487,8 +1487,8 @@ function $dba5a9c0f6fb4324$export$6f051469dd676a8b(tenant, market, type) {
1487
1487
 
1488
1488
 
1489
1489
 
1490
- /**
1491
- * @deprecated this was a stupid idea, it's much easier to read if one just does a quick arrow function that provides the wanted arguments
1490
+ /**
1491
+ * @deprecated this was a stupid idea, it's much easier to read if one just does a quick arrow function that provides the wanted arguments
1492
1492
  */ function $ee1d22bd1fcdd4e1$export$6e7454c733fa1fb2(fn, ...args) {
1493
1493
  return function(...unimportant_args) {
1494
1494
  return fn.apply(this, [
@@ -2281,10 +2281,10 @@ async function $44909e19109bf973$export$8f66c4c7fb96eda2(e, product_id) {
2281
2281
 
2282
2282
 
2283
2283
 
2284
- /**
2285
- * Useful for the `thresholds` option of IntersectionObserver - if you want to be notified at a 10% change, call this and set num_steps to 10. Pls see https://developer.mozilla.org/en-US/docs/Web/API/IntersectionObserver/thresholds
2286
- * @param numSteps How many steps (notifications) there should be between 0 and 100% intersection
2287
- * @return Stuff to give to IntersectionObserver
2284
+ /**
2285
+ * Useful for the `thresholds` option of IntersectionObserver - if you want to be notified at a 10% change, call this and set num_steps to 10. Pls see https://developer.mozilla.org/en-US/docs/Web/API/IntersectionObserver/thresholds
2286
+ * @param numSteps How many steps (notifications) there should be between 0 and 100% intersection
2287
+ * @return Stuff to give to IntersectionObserver
2288
2288
  */ function $0da0cad4f39e8f32$export$f8ea2e7b15b5d129(numSteps) {
2289
2289
  const thresholds = [];
2290
2290
  for(let i = 1.0; i <= numSteps; i++){
@@ -2296,12 +2296,12 @@ async function $44909e19109bf973$export$8f66c4c7fb96eda2(e, product_id) {
2296
2296
  }
2297
2297
 
2298
2298
 
2299
- /**
2300
- * Elements currently intersecting with the viewport.
2301
- * If they are intersecting for the `has_to_be_intersecting_for` duration, we count it as an impression, and call the callback.
2299
+ /**
2300
+ * Elements currently intersecting with the viewport.
2301
+ * If they are intersecting for the `has_to_be_intersecting_for` duration, we count it as an impression, and call the callback.
2302
2302
  */ const $72ed530554068e4f$var$current_intersections = /*@__PURE__*/ new WeakMap();
2303
- /**
2304
- * Currently watched elements by the intersection observer with their respective callback
2303
+ /**
2304
+ * Currently watched elements by the intersection observer with their respective callback
2305
2305
  * */ const $72ed530554068e4f$var$watched_elements = /*@__PURE__*/ new WeakMap();
2306
2306
  const $72ed530554068e4f$var$unwatch_element = (element)=>{
2307
2307
  $72ed530554068e4f$var$intersection_observer?.unobserve(element);
@@ -2366,9 +2366,9 @@ const $72ed530554068e4f$var$intersection_observer_callback = (entries)=>{
2366
2366
  }
2367
2367
  }
2368
2368
  };
2369
- /**
2370
- * Global IntersectionObserver used for all impression tracking.
2371
- * It's faster to use one observer for all elements than to create a new one for each element.
2369
+ /**
2370
+ * Global IntersectionObserver used for all impression tracking.
2371
+ * It's faster to use one observer for all elements than to create a new one for each element.
2372
2372
  */ const $72ed530554068e4f$var$intersection_observer = typeof window === "object" ? /*@__PURE__*/ new IntersectionObserver((0, $268cbd9e4ade92db$export$b3bbfd758f11cfa9)($72ed530554068e4f$var$intersection_observer_callback), {
2373
2373
  threshold: /*@__PURE__*/ (0, /*@__PURE__*/$0da0cad4f39e8f32$export$f8ea2e7b15b5d129)(8)
2374
2374
  }) : undefined;
@@ -2712,17 +2712,17 @@ const $28e42b0009d694b2$export$abec7fd9f0b9cc22 = /*@__PURE__*/ (0, /*@__PURE__*
2712
2712
 
2713
2713
 
2714
2714
  const $2026711c6c2d6204$var$required_consent_level = process.env.DEPICT_TRACKING_CONSENT_LEVEL;
2715
- /*
2716
- The Optanon cookie format can vary slightly between integrations. To figure out the key values used for a particular customer,
2717
- visit their web, finish the consent dialog, then run
2718
- new URLSearchParams(document.cookie.match("(^|;)\\s*OptanonConsent\\s*=\\s*([^;]+)")?.pop()).get("groups")
2719
- in the console. You should see something like
2720
- 'NECES:1,ANALY:1,PERON:1,MARKE:1'
2721
- Which tells you what the key values for each consent level is. Enter them in the correct order, comma separated,
2722
- as OPTANON_KEYS in the tenants .env file. For the cookie output above, the .env entry would be
2723
- OPTANON_KEYS="NECES,ANALY,PERON,MARKE"
2724
- If it's not obvious which consent level each key represents, open the consent dialog again and start de-selecting consent options,
2725
- then check the cookie value again.
2715
+ /*
2716
+ The Optanon cookie format can vary slightly between integrations. To figure out the key values used for a particular customer,
2717
+ visit their web, finish the consent dialog, then run
2718
+ new URLSearchParams(document.cookie.match("(^|;)\\s*OptanonConsent\\s*=\\s*([^;]+)")?.pop()).get("groups")
2719
+ in the console. You should see something like
2720
+ 'NECES:1,ANALY:1,PERON:1,MARKE:1'
2721
+ Which tells you what the key values for each consent level is. Enter them in the correct order, comma separated,
2722
+ as OPTANON_KEYS in the tenants .env file. For the cookie output above, the .env entry would be
2723
+ OPTANON_KEYS="NECES,ANALY,PERON,MARKE"
2724
+ If it's not obvious which consent level each key represents, open the consent dialog again and start de-selecting consent options,
2725
+ then check the cookie value again.
2726
2726
  */ const $2026711c6c2d6204$var$KEY_ORDER = [
2727
2727
  "necessary",
2728
2728
  "statistics",
@@ -3083,8 +3083,8 @@ class $16f3a26cfac77a4c$export$8d42ce4827f43582 {
3083
3083
  });
3084
3084
  })();
3085
3085
  }
3086
- } /**
3087
- * This is a list of alpha-2 country codes plus some two letter combinations commonly used to describe markets
3086
+ } /**
3087
+ * This is a list of alpha-2 country codes plus some two letter combinations commonly used to describe markets
3088
3088
  */ // albania
3089
3089
 
3090
3090
 
@@ -3307,11 +3307,11 @@ const $fbb09973782881cb$export$6ebd242c09192cec = /*@__PURE__*/ (0, /*@__PURE__*
3307
3307
 
3308
3308
 
3309
3309
  // not ideal but can help when debugging via sentry
3310
- /**
3311
- * A function that attempts to "serialize" an object to a text representation that helps with debugging when using sentry
3312
- * @param anything Something to try to serialize - this function is crappy and your mileage may vary
3313
- * @param depth How deep to go when recursing
3314
- * @return An object that is somehow closer to text (better serializable by sentry) or text
3310
+ /**
3311
+ * A function that attempts to "serialize" an object to a text representation that helps with debugging when using sentry
3312
+ * @param anything Something to try to serialize - this function is crappy and your mileage may vary
3313
+ * @param depth How deep to go when recursing
3314
+ * @return An object that is somehow closer to text (better serializable by sentry) or text
3315
3315
  */ function $45e05ec4fd7f1ee7$export$39d526a1194b6499(anything, depth) {
3316
3316
  depth ??= 0;
3317
3317
  depth++;
@@ -3797,8 +3797,8 @@ function $d1ef5fbddf08305d$var$find_last_visible(items) {
3797
3797
 
3798
3798
 
3799
3799
 
3800
- /**
3801
- * @deprecated use async_iterable_ipns instead. This can skip values which yields unexpected results.
3800
+ /**
3801
+ * @deprecated use async_iterable_ipns instead. This can skip values which yields unexpected results.
3802
3802
  */ function $7198207999c01453$export$55621c1ce3cd536b() {
3803
3803
  // the idea is to have a new promise available immediately before one resolves, so to say an infinite promise
3804
3804
  let internal_resolve; // copy and pasted from iconbeauty
@@ -3910,12 +3910,12 @@ async function $8686e45614d71607$export$9eae832ae57fbf(t, css, extra_html) {
3910
3910
 
3911
3911
  // TODO: Move ArrayElement<> to better util place
3912
3912
  // All the supported markets of all the Tenants (all possible markets).
3913
- /**
3914
- * @deprecated please use TwoLetterMarket / readonly arrays/objects instead
3913
+ /**
3914
+ * @deprecated please use TwoLetterMarket / readonly arrays/objects instead
3915
3915
  */ let $e86d825ce508e342$export$3db8c5834c5aa726;
3916
3916
  // All the known locales (add more)
3917
- /**
3918
- * @deprecated please use TwoLetterMarket / readonly arrays/objects instead
3917
+ /**
3918
+ * @deprecated please use TwoLetterMarket / readonly arrays/objects instead
3919
3919
  */ (function(Market) {
3920
3920
  Market["dk"] = "dk";
3921
3921
  Market["uk"] = "uk";
@@ -4028,8 +4028,8 @@ function $e86d825ce508e342$export$47340c0b196bc0f8(market) {
4028
4028
  }
4029
4029
  function $e86d825ce508e342$export$c5b68ecd5c37aa6c(market) {
4030
4030
  return $e86d825ce508e342$export$6eea148df5c7117c[market].currency;
4031
- } /**
4032
- * @deprecated please use TwoLetterMarket / readonly arrays/objects instead
4031
+ } /**
4032
+ * @deprecated please use TwoLetterMarket / readonly arrays/objects instead
4033
4033
  */
4034
4034
 
4035
4035
 
@@ -5272,8 +5272,8 @@ class $0b6a8303b64cced1$export$1a8782481a9af507 {
5272
5272
  }
5273
5273
 
5274
5274
 
5275
- var /**
5276
- * @deprecated Please use RecommendationRenderer instead
5275
+ var /**
5276
+ * @deprecated Please use RecommendationRenderer instead
5277
5277
  */ $52d3be7ce5146924$export$2e2bcd8739ae039 = async (options)=>{
5278
5278
  const depict = new (0, $0b6a8303b64cced1$export$1a8782481a9af507)(options.options), done = new Promise((itsdone)=>{
5279
5279
  document._depict_modify = true;
@@ -5549,14 +5549,14 @@ function $765ddca135d7ab33$export$c410ce1205e5118a(_t, itms, d, slider) {
5549
5549
 
5550
5550
 
5551
5551
 
5552
- var /**
5553
- * @deprecated please use `fetch_retry()` instead
5554
- *
5555
- * Windows proof fetch factory: windows proof fetch is a utility which retries fetch requests 10 times when they fail. Reason for this is a certain windows 10 build where the network stack randomly breaks 20% of https connections
5556
- * (Note: this thing really should be rewritten with exponential backoff and a better API)
5557
- * @param dlog logging function to use
5558
- * @param error_log an array to which errors will be pushed
5559
- * @return a windows proof fetch function
5552
+ var /**
5553
+ * @deprecated please use `fetch_retry()` instead
5554
+ *
5555
+ * Windows proof fetch factory: windows proof fetch is a utility which retries fetch requests 10 times when they fail. Reason for this is a certain windows 10 build where the network stack randomly breaks 20% of https connections
5556
+ * (Note: this thing really should be rewritten with exponential backoff and a better API)
5557
+ * @param dlog logging function to use
5558
+ * @param error_log an array to which errors will be pushed
5559
+ * @return a windows proof fetch function
5560
5560
  */ $c413c7798924612a$export$2e2bcd8739ae039 = (dlog, error_log)=>{
5561
5561
  // https://sentry.io/organizations/depictai-0o/issues/2025371462/?project=5476183&query=is%3Aunresolved
5562
5562
  // https://stackoverflow.com/a/52947884
@@ -5768,10 +5768,10 @@ async function $1cc2444a0f1b992e$export$c84671f46d6a1ca({ rows: rows , container
5768
5768
  }
5769
5769
  });
5770
5770
  }
5771
- /** Getting how many recs should be displayed for a certain row (while taking override rules into account)
5772
- * This returns number of recs for this row and all the previous ones
5773
- * @param row The "index" of the row (counting from the top). Starts at 1.
5774
- * @param options Your cols_at_size layout option
5771
+ /** Getting how many recs should be displayed for a certain row (while taking override rules into account)
5772
+ * This returns number of recs for this row and all the previous ones
5773
+ * @param row The "index" of the row (counting from the top). Starts at 1.
5774
+ * @param options Your cols_at_size layout option
5775
5775
  */ function $1cc2444a0f1b992e$var$get_total_rec_amount_for_row(row, options) {
5776
5776
  const [default_cols, , , , override_obj] = options;
5777
5777
  const overrides = override_obj?.overrides || {};
@@ -5782,8 +5782,8 @@ async function $1cc2444a0f1b992e$export$c84671f46d6a1ca({ rows: rows , container
5782
5782
  }
5783
5783
  return total;
5784
5784
  }
5785
- /**
5786
- * Same as `get_total_rec_amount_for_row` but caps the result to never exceed @param max_recs
5785
+ /**
5786
+ * Same as `get_total_rec_amount_for_row` but caps the result to never exceed @param max_recs
5787
5787
  */ function $1cc2444a0f1b992e$var$get_visible_recs_without_partial_rows(rows, max_recs, options) {
5788
5788
  let visible_recs;
5789
5789
  while((visible_recs = $1cc2444a0f1b992e$var$get_total_rec_amount_for_row(rows--, options)) > max_recs);
@@ -5822,13 +5822,13 @@ function $1cc2444a0f1b992e$export$17c3166a7ebd4688(selector_beginning, default_g
5822
5822
  const overrides = override?.overrides || {};
5823
5823
  const sorted = Object.keys(overrides).sort((r1, r2)=>parseInt(r1) - parseInt(r2));
5824
5824
  const last_override_row = sorted.at(-1);
5825
- /** We run this loop up until the last override rule + 1.
5826
- * The last iteration will create styling rules that apply to every row that comes after it.
5827
- * Let's say we have one override rule for row 2.
5828
- * We:
5829
- * 1. Create styling for row 1
5830
- * 2. Create styling for row 2
5831
- * 3. Create styling for row 3 which will apply to the rest of the rows. Every row will be the same from now on.
5825
+ /** We run this loop up until the last override rule + 1.
5826
+ * The last iteration will create styling rules that apply to every row that comes after it.
5827
+ * Let's say we have one override rule for row 2.
5828
+ * We:
5829
+ * 1. Create styling for row 1
5830
+ * 2. Create styling for row 2
5831
+ * 3. Create styling for row 3 which will apply to the rest of the rows. Every row will be the same from now on.
5832
5832
  */ const max_row = last_override_row ? parseInt(last_override_row) + 1 : 1;
5833
5833
  for(let row = 1; row <= max_row; row++){
5834
5834
  const real_n_cols = overrides[row] || n_cols;
@@ -6781,12 +6781,12 @@ function $3721a5ccba25c247$export$3d04c40e7acc1a32(initial_value) {
6781
6781
 
6782
6782
 
6783
6783
 
6784
- /**
6785
- * A wrapper around window.matchMedia, basically cross browser compatibly adds an event listener to a media query that triggers when it changes
6786
- * @param query The media query (without `@media`)
6787
- * @param catchified_handler The function to execute
6788
- * @param initial_call If the handler should be called instantly with the current state of the media query
6789
- * @return An object containing `remove`, a function which removes the event listener again
6784
+ /**
6785
+ * A wrapper around window.matchMedia, basically cross browser compatibly adds an event listener to a media query that triggers when it changes
6786
+ * @param query The media query (without `@media`)
6787
+ * @param catchified_handler The function to execute
6788
+ * @param initial_call If the handler should be called instantly with the current state of the media query
6789
+ * @return An object containing `remove`, a function which removes the event listener again
6790
6790
  */
6791
6791
  function $93c499898a1702c7$export$515c3ea4d599b05a(// inspired by code in houdinisportswear modify script
6792
6792
  query, handler, initial_call = true) {
@@ -7056,9 +7056,9 @@ async function $8594d423459ba80c$export$d63b08f4f29ddba5(t, unavailability_type)
7056
7056
 
7057
7057
 
7058
7058
 
7059
- /**
7060
- * Set but you can listen for values being added or removed
7061
- * i.e. my_set.addEventListener("add", ({detail}) => console.log(detail, "was added to", my_set));
7059
+ /**
7060
+ * Set but you can listen for values being added or removed
7061
+ * i.e. my_set.addEventListener("add", ({detail}) => console.log(detail, "was added to", my_set));
7062
7062
  */ class $d343f609f5a6614f$export$74108888f38788f3 extends Set {
7063
7063
  #et = new EventTarget();
7064
7064
  addEventListener(event, callback, options) {
@@ -7086,12 +7086,12 @@ async function $8594d423459ba80c$export$d63b08f4f29ddba5(t, unavailability_type)
7086
7086
 
7087
7087
 
7088
7088
 
7089
- /**
7090
- * This does what you'd think Element.closest does. It finds the closest node in the DOM tree matching a selector. So it starts out with the siblings and then goes upwards in the DOM and checks the siblings and their children of the parent until there's no parent anymore.
7091
- * @param element Element to start out at
7092
- * @param selector Selector to search for
7093
- * @param start_right=true In what direction to start: true = right, false = left
7094
- * @return The found element or undefined
7089
+ /**
7090
+ * This does what you'd think Element.closest does. It finds the closest node in the DOM tree matching a selector. So it starts out with the siblings and then goes upwards in the DOM and checks the siblings and their children of the parent until there's no parent anymore.
7091
+ * @param element Element to start out at
7092
+ * @param selector Selector to search for
7093
+ * @param start_right=true In what direction to start: true = right, false = left
7094
+ * @return The found element or undefined
7095
7095
  */ function $14d244e5a13fa0df$export$d9fdc6ce2907f95b(element, selector, start_right = true) {
7096
7096
  for(; element; element = element.parentNode){
7097
7097
  if (element?.matches?.(selector)) return element;
@@ -7144,10 +7144,10 @@ function $1e9d51e365c02476$export$82539d9817116aff(e, url) {
7144
7144
  }
7145
7145
 
7146
7146
 
7147
- /**
7148
- * This module contains utillities for working with ecom sites using shoppify.
7149
- *
7150
- * Shopify cart API reference: https://shopify.dev/api/ajax/reference/cart
7147
+ /**
7148
+ * This module contains utillities for working with ecom sites using shoppify.
7149
+ *
7150
+ * Shopify cart API reference: https://shopify.dev/api/ajax/reference/cart
7151
7151
  */
7152
7152
 
7153
7153
  async function $7ccebf01cfe4f824$export$85be83e1935d93c2(fetch_proxy_handler, // we assume fetch is actually fetch, therefore proxy handler is typed like this
@@ -7881,8 +7881,8 @@ function $2780129735dc272e$export$2a38b176ce969e2c(orig_url_with_trailing_slash)
7881
7881
 
7882
7882
 
7883
7883
 
7884
- /**
7885
- * Recursively sorts the keys in an object (NOT in-place, returns a new object). Do not provide objects containing anything other than primitives or other objects. Do not provide objects that have cyclical values.
7884
+ /**
7885
+ * Recursively sorts the keys in an object (NOT in-place, returns a new object). Do not provide objects containing anything other than primitives or other objects. Do not provide objects that have cyclical values.
7886
7886
  */ function $24daf6f6e6529b9f$export$12b4c6cbc6b8b4e4(maybe_obj) {
7887
7887
  if (!maybe_obj) return maybe_obj;
7888
7888
  if (typeof maybe_obj != "object") return maybe_obj;
@@ -7901,18 +7901,18 @@ function $2780129735dc272e$export$2a38b176ce969e2c(orig_url_with_trailing_slash)
7901
7901
  }
7902
7902
 
7903
7903
 
7904
- /**
7905
- * Tries to figure out the tenant's market (`TwoLetterMarket` for new integrations) through various means.
7906
- *
7907
- * 1. Checks if there is a market in one of the url segments (www.tentant.se/foo/se/bar)
7908
- * 2. Checks if the market is specified in the tenant's domain name (www.tenant-se.com)
7909
- * 3. Checks the toplevel domain (www.tenant.se/foo/bar)
7910
- *
7911
- * @param allowed_markets An array the possible markets for the tenant.
7912
- * Dont forget to specify the allowed market as const (`["se", "en"] as const`) to get the best typing
7913
- * @param url Specify this to overide the url to check, defaults to the current url
7914
- * @param tenant The tenant's name
7915
- * @returns If a market specified in `allowed_markets`was found that is returned, `undefined` otherwise
7904
+ /**
7905
+ * Tries to figure out the tenant's market (`TwoLetterMarket` for new integrations) through various means.
7906
+ *
7907
+ * 1. Checks if there is a market in one of the url segments (www.tentant.se/foo/se/bar)
7908
+ * 2. Checks if the market is specified in the tenant's domain name (www.tenant-se.com)
7909
+ * 3. Checks the toplevel domain (www.tenant.se/foo/bar)
7910
+ *
7911
+ * @param allowed_markets An array the possible markets for the tenant.
7912
+ * Dont forget to specify the allowed market as const (`["se", "en"] as const`) to get the best typing
7913
+ * @param url Specify this to overide the url to check, defaults to the current url
7914
+ * @param tenant The tenant's name
7915
+ * @returns If a market specified in `allowed_markets`was found that is returned, `undefined` otherwise
7916
7916
  */ function $02a3425594231893$export$a422d714c8cb1a5d(allowed_markets, url, tenant = process.env.TENANT) {
7917
7917
  const u_o = url ? new URL(url) : location;
7918
7918
  const { hostname: hostname } = u_o;
@@ -8029,9 +8029,9 @@ function $05802e6cb0fdbdcd$export$3427ec8268623f1(listener) {
8029
8029
 
8030
8030
 
8031
8031
 
8032
- /**
8033
- * Timeout a promise after `ms` milliseconds.
8034
- * If the promise is timed out this function will return `undefined` and not throw.
8032
+ /**
8033
+ * Timeout a promise after `ms` milliseconds.
8034
+ * If the promise is timed out this function will return `undefined` and not throw.
8035
8035
  */ function $9ed7c4b0fbf9ccd8$export$cd1adfb8059b5fcd(promise, ms) {
8036
8036
  const timeout = new Promise((res)=>setTimeout(res, ms));
8037
8037
  return Promise.race([
@@ -8314,9 +8314,9 @@ const $69accc27bcbd6972$export$ddd70fdae1b350e6 = ()=>(0, $107a74aa4ea5902d$expo
8314
8314
 
8315
8315
 
8316
8316
 
8317
- /**
8318
- * Internal color circle used in ColorPicker
8319
- * @see {createColorPicker}
8317
+ /**
8318
+ * Internal color circle used in ColorPicker
8319
+ * @see {createColorPicker}
8320
8320
  */ function $af92e61c7dfccf01$var$ColorCircle({ color: color , onClick: onClick , onHoverUpdate: onHoverUpdate }) {
8321
8321
  const button = (0, $107a74aa4ea5902d$export$34b9dba7ce09269b)("button", {
8322
8322
  class: "color-circle-container",
@@ -8343,9 +8343,9 @@ function $af92e61c7dfccf01$export$590326cc34f49e2d({ colors: colors , initialCol
8343
8343
  ColorPicker () {
8344
8344
  /** The currently active ColorCircle */ let activeCircle = null;
8345
8345
  /** The currently active color object */ let activeColor = null;
8346
- /**
8347
- * Update the currently active color object and HTMLElement
8348
- * Toggles the active class.
8346
+ /**
8347
+ * Update the currently active color object and HTMLElement
8348
+ * Toggles the active class.
8349
8349
  */ const setActive = (e, color)=>{
8350
8350
  if (e !== activeCircle) {
8351
8351
  if (activeCircle) activeCircle.classList.remove("active");
@@ -8358,8 +8358,8 @@ function $af92e61c7dfccf01$export$590326cc34f49e2d({ colors: colors , initialCol
8358
8358
  if (!dontSetActiveOnClick) setActive(clicked, color);
8359
8359
  onSelect(color);
8360
8360
  };
8361
- /**
8362
- * Handles the preview logic.
8361
+ /**
8362
+ * Handles the preview logic.
8363
8363
  */ const handleSelectOnHover = (hovered, color, hovering)=>{
8364
8364
  // Don't do any selection if the hovered circle is already selected
8365
8365
  if (hovered === activeCircle) return;
@@ -8552,9 +8552,9 @@ function $ff973b2032639b5f$export$a62825542f1bfcf5({ what_to_watch: what_to_watc
8552
8552
  2048,
8553
8553
  4096
8554
8554
  ] , sizes_communicator: sizes_communicator , resolution_factor: resolution_factor , market_: market_ , sizes_setter_: sizes_setter_ } = {}) {
8555
- /**
8556
- * We support what_to_watch being optional, meaning we will take the first image we get.
8557
- * For that we need to have created the image before being able to create the sizes setter.
8555
+ /**
8556
+ * We support what_to_watch being optional, meaning we will take the first image we get.
8557
+ * For that we need to have created the image before being able to create the sizes setter.
8558
8558
  */ const local_base_url = market_ ? $ff973b2032639b5f$export$3d13beba9b52c947 + "/" + market_ : $ff973b2032639b5f$export$3d13beba9b52c947;
8559
8559
  return (image_options)=>{
8560
8560
  const raw_src = image_options?.src || image_options?.["data-src"]; // get wanted src
@@ -8736,9 +8736,9 @@ const $a656daa2fa8c279a$var$TOUCHCANCEL = "touchcancel";
8736
8736
  const $a656daa2fa8c279a$var$MOUSEOVER = "mouseover";
8737
8737
  const $a656daa2fa8c279a$var$MOUSELEAVE = "mouseleave";
8738
8738
  const $a656daa2fa8c279a$var$HOVER_CLASS = "hovering";
8739
- /** This number represents how many elements are in front of div.images-container
8740
- * Here are the elements: img.depict-img-mod, div, img.depict-img-mod, div, div.second-image-container, div.main-image-container, div.images-container
8741
- * This number is not very dynamic but much more performant than iterating
8739
+ /** This number represents how many elements are in front of div.images-container
8740
+ * Here are the elements: img.depict-img-mod, div, img.depict-img-mod, div, div.second-image-container, div.main-image-container, div.images-container
8741
+ * This number is not very dynamic but much more performant than iterating
8742
8742
  */ const $a656daa2fa8c279a$var$HOVER_IMAGE_DEPTH = 7;
8743
8743
  const $a656daa2fa8c279a$var$MAX_COLLISION_DETECTION_RATE = 70; // ms
8744
8744
  const $a656daa2fa8c279a$var$touch_hover_elements = /*@__PURE__*/ new WeakMap();
@@ -9038,11 +9038,11 @@ function $12c29616944c2fb7$export$f2ca6fc699ca1fb4(props = {}) {
9038
9038
 
9039
9039
 
9040
9040
 
9041
- /**
9042
- * Shallowly converts all keys in an object from snake_case to camelCase.
9043
- * Does not support symbol keys.
9044
- *
9045
- * @param obj the object. It will be cloned and not modified in-place.
9041
+ /**
9042
+ * Shallowly converts all keys in an object from snake_case to camelCase.
9043
+ * Does not support symbol keys.
9044
+ *
9045
+ * @param obj the object. It will be cloned and not modified in-place.
9046
9046
  */ function $89758b55120b0cbd$export$9dc8f3a0aa3efc85(obj) {
9047
9047
  return Object.fromEntries(Object.entries(obj).map(([key, value])=>[
9048
9048
  key.split("_").map((part, index)=>index ? part[0].toUpperCase() + part.slice(1) : part).join(""),
@@ -9057,9 +9057,9 @@ function $89758b55120b0cbd$export$b481488de1caa85(obj) {
9057
9057
  }
9058
9058
 
9059
9059
 
9060
- /**
9061
- * Converts RGB to HSL
9062
- * Source of function: https://www.30secondsofcode.org/js/s/rgb-to-hsl
9060
+ /**
9061
+ * Converts RGB to HSL
9062
+ * Source of function: https://www.30secondsofcode.org/js/s/rgb-to-hsl
9063
9063
  */ function $d73746ee466f09ca$export$499ef00a6a3417f8(r, g, b) {
9064
9064
  r /= 255;
9065
9065
  g /= 255;