@depict-ai/utilishared 1.0.6 → 1.0.8

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