@depict-ai/utilishared 1.0.51 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ES10/index.cjs +55 -183
- package/ES10/index.d.ts +9 -25
- package/ES10/index.js +52 -174
- package/latest/index.cjs +54 -183
- package/latest/index.d.ts +9 -25
- package/latest/index.js +51 -174
- package/package.json +4 -4
package/ES10/index.cjs
CHANGED
|
@@ -5,7 +5,7 @@ var $bBfCy$babelruntimehelpersdefineProperty = require("@babel/runtime/helpers/d
|
|
|
5
5
|
require("../multi_import_deduplicator.cjs").register_es_version("utilishared", "ES10");
|
|
6
6
|
function $parcel$exportWildcard(dest, source) {
|
|
7
7
|
Object.keys(source).forEach(function (key) {
|
|
8
|
-
if (key === 'default' || key === '__esModule' ||
|
|
8
|
+
if (key === 'default' || key === '__esModule' || Object.prototype.hasOwnProperty.call(dest, key)) {
|
|
9
9
|
return;
|
|
10
10
|
}
|
|
11
11
|
Object.defineProperty(dest, key, {
|
|
@@ -49,9 +49,9 @@ $parcel$export(module.exports, "simplified_template_tool", () => $ebe64dbcfb106f
|
|
|
49
49
|
$parcel$export(module.exports, "insert_styling_into_slider", () => $3f49f9b73bfc2a38$export$f1b8b9fd75ddcab1);
|
|
50
50
|
$parcel$export(module.exports, "RR_Slider", () => $bbf8331c74194de9$export$cd12721587f4f16d);
|
|
51
51
|
$parcel$export(module.exports, "Depict", () => $a782ed55f4206a68$export$1a8782481a9af507);
|
|
52
|
-
$parcel$export(module.exports, "get_recs_with_template", () => $
|
|
53
|
-
$parcel$export(module.exports, "default_post_processor", () => $
|
|
54
|
-
$parcel$export(module.exports, "default_pre_processor", () => $
|
|
52
|
+
$parcel$export(module.exports, "get_recs_with_template", () => $14c1124272475590$export$30933c637c977eef);
|
|
53
|
+
$parcel$export(module.exports, "default_post_processor", () => $14c1124272475590$export$c410ce1205e5118a);
|
|
54
|
+
$parcel$export(module.exports, "default_pre_processor", () => $14c1124272475590$export$4f39078bdc72ecd0);
|
|
55
55
|
$parcel$export(module.exports, "wpff", () => $a68e8b02bee90bb2$export$2e2bcd8739ae039);
|
|
56
56
|
$parcel$export(module.exports, "ElementObserver", () => $523564fcfb9c3bb9$export$12e07a2a9f87578a);
|
|
57
57
|
$parcel$export(module.exports, "observer", () => $03c157d68c9fcbac$export$b6ae1bc530f4c149);
|
|
@@ -119,10 +119,6 @@ $parcel$export(module.exports, "AIO", () => $7c971cc277292c10$export$29a6094e0bd
|
|
|
119
119
|
$parcel$export(module.exports, "paint_red", () => $7c971cc277292c10$export$6ebd242c09192cec);
|
|
120
120
|
$parcel$export(module.exports, "bind_to_a2c_button", () => $1ea91dfed6983398$export$2c34560c3749dc63);
|
|
121
121
|
$parcel$export(module.exports, "bind_tracking_to_link", () => $1ea91dfed6983398$export$82a685f2da2fb027);
|
|
122
|
-
$parcel$export(module.exports, "set_depict_id_fn", () => $335c248bb07a3509$export$336e7ad40bae0652);
|
|
123
|
-
$parcel$export(module.exports, "set_user_id_fn", () => $335c248bb07a3509$export$8a96793bf9f87d90);
|
|
124
|
-
$parcel$export(module.exports, "get_depict_id", () => $335c248bb07a3509$export$6399bdb2291895e0);
|
|
125
|
-
$parcel$export(module.exports, "get_user_id", () => $335c248bb07a3509$export$adc61a405a4cabed);
|
|
126
122
|
$parcel$export(module.exports, "depict_click", () => $335c248bb07a3509$export$15f8a0cd5a8c0ebb);
|
|
127
123
|
$parcel$export(module.exports, "depict_prefilled", () => $335c248bb07a3509$export$82badda1f9923310);
|
|
128
124
|
$parcel$export(module.exports, "depict_add_to_cart", () => $335c248bb07a3509$export$9028351cb994757e);
|
|
@@ -164,7 +160,6 @@ $parcel$export(module.exports, "datalayer_interceptor", () => $78fd85c1f4513422$
|
|
|
164
160
|
$parcel$export(module.exports, "datalayer_transaction_id_extractor", () => $78fd85c1f4513422$export$b11248fa13a8a86c);
|
|
165
161
|
$parcel$export(module.exports, "orderpage_transaction_id_extractor", () => $78fd85c1f4513422$export$3ebd86018b39d9d2);
|
|
166
162
|
$parcel$export(module.exports, "url_transaction_id_extractor", () => $78fd85c1f4513422$export$ff8673d5dea82bd4);
|
|
167
|
-
$parcel$export(module.exports, "send_product_unavailable_to_depict", () => $3cb1cfeb94b7f96b$export$d63b08f4f29ddba5);
|
|
168
163
|
$parcel$export(module.exports, "send_page_view_if_needed", () => $c15d2edce69e632a$export$eee4c4d924348b05);
|
|
169
164
|
$parcel$export(module.exports, "send_page_view_on_navigation", () => $c15d2edce69e632a$export$f7cb1bd47199ec38);
|
|
170
165
|
$parcel$export(module.exports, "DepictAPIWS", () => $bd0a305620de4c2a$export$1d9c6fddbff3441f);
|
|
@@ -276,10 +271,9 @@ $parcel$export(module.exports, "hsb_to_rgb", () => $b5388c1e3ff41e88$export$486b
|
|
|
276
271
|
$parcel$export(module.exports, "hex_to_rgb", () => $b5388c1e3ff41e88$export$ca305c142c6fc3cf);
|
|
277
272
|
$parcel$export(module.exports, "version", () => $ce0ab19b284b64fa$export$83d89fbfd8236492);
|
|
278
273
|
$parcel$export(module.exports, "add_to_version_info", () => $045fb30107c9eecc$export$2cefb7e61fcbae00);
|
|
279
|
-
$parcel$export(module.exports, "edit_current_page_meta_tags", () => $0126fdc29a9f7f2d$export$ef73ea4f975745ba);
|
|
280
274
|
$parcel$export(module.exports, "sync_el_content_with_accessor", () => $84d13ab567309a50$export$c3f56a35e076f139);
|
|
281
275
|
$parcel$export(module.exports, "use_href_accessor", () => $59b7011b96010a8e$export$e35115e6d0715f77);
|
|
282
|
-
const $ce0ab19b284b64fa$export$83d89fbfd8236492 = "
|
|
276
|
+
const $ce0ab19b284b64fa$export$83d89fbfd8236492 = "2.0.1";
|
|
283
277
|
const $9e9538f4aff6f83c$export$55fe61489d2c7417 = /*@__PURE__*/((_globalThis$document, _globalThis$document$, _globalThis$document$2, _globalThis$localStor, _globalThis$localStor2) => process.env.STRIP_DEBUG === "true" ? false : process.env.DEBUG === "true" || process.env.NODE_ENV === "development" || process.env.BUILD_TARGET !== "node" && ((globalThis === null || globalThis === void 0 ? void 0 : (_globalThis$document = globalThis.document) === null || _globalThis$document === void 0 ? void 0 : (_globalThis$document$ = _globalThis$document.currentScript) === null || _globalThis$document$ === void 0 ? void 0 : (_globalThis$document$2 = _globalThis$document$.dataset) === null || _globalThis$document$2 === void 0 ? void 0 : _globalThis$document$2.debug) === "true" || (globalThis === null || globalThis === void 0 ? void 0 : (_globalThis$localStor = globalThis.localStorage) === null || _globalThis$localStor === void 0 ? void 0 : (_globalThis$localStor2 = _globalThis$localStor.getItem) === null || _globalThis$localStor2 === void 0 ? void 0 : _globalThis$localStor2.call(_globalThis$localStor, "debug")) === "true"))();
|
|
284
278
|
const $7f95f77417d06249$var$browser_prefix_styling = "color: #fff;";
|
|
285
279
|
let $7f95f77417d06249$var$browser_prefix = "[Depict]";
|
|
@@ -1302,7 +1296,7 @@ function $a13f25507f352177$export$a6db784f019668ba() {
|
|
|
1302
1296
|
const $62869a3ed703f236$export$362abebb4b313340 = process.env.BASE_URL || "https://api.depict.ai";
|
|
1303
1297
|
const $49880c4ce4bb7db2$var$c = (0, $3b52ccc10510b32a$export$b3bbfd758f11cfa9);
|
|
1304
1298
|
const $49880c4ce4bb7db2$var$ws_instance = /*@__PURE__*/$49880c4ce4bb7db2$var$c(() => new (0, $bd0a305620de4c2a$export$1d9c6fddbff3441f)("wss://ws.depict.ai/ws/create-events"))();
|
|
1305
|
-
const $49880c4ce4bb7db2$var$allowed_keys = ["tenant", "market", "type", "
|
|
1299
|
+
const $49880c4ce4bb7db2$var$allowed_keys = ["tenant", "market", "type", "session_id", "product_id", "entity_identifiers", "url", "entity_price", "currency", "document_referrer", "document_width", "attribution_id", "recommendation_id", "click_location", "ab_test_group", "variant_ids", "transaction_id", "error_type", "detail", "recommendation_type", "search_result_id", "product_listing_result_id"];
|
|
1306
1300
|
const $49880c4ce4bb7db2$export$72036d950e1fae95 = /*@__PURE__*/$49880c4ce4bb7db2$var$c(payload => {
|
|
1307
1301
|
if (process.env.DEPICT === "false") return;
|
|
1308
1302
|
return payload.map(body => Object.fromEntries(Object.entries(body).filter(_ref => {
|
|
@@ -1377,13 +1371,14 @@ const $49880c4ce4bb7db2$export$28cacbd9b4306ffc = /*@__PURE__*/$49880c4ce4bb7db2
|
|
|
1377
1371
|
// filter_depict_payload will only return undefined if process.env.DEPICT === "false"
|
|
1378
1372
|
return $49880c4ce4bb7db2$export$608478473a3304a0($49880c4ce4bb7db2$export$72036d950e1fae95(payload), use_ws);
|
|
1379
1373
|
});
|
|
1380
|
-
let $335c248bb07a3509$export$
|
|
1374
|
+
let $335c248bb07a3509$export$61e7e1f11e96692f = () => {
|
|
1381
1375
|
if (typeof document === "undefined") return "server";
|
|
1382
1376
|
let id = "";
|
|
1383
1377
|
let localstorage_error;
|
|
1384
1378
|
let cookie_error;
|
|
1385
1379
|
try {
|
|
1386
1380
|
var _localStorage;
|
|
1381
|
+
// localStorage._dep_id also accessed directly by depict-purchase-tracking Shopify web pixel
|
|
1387
1382
|
id = (_localStorage = localStorage)._dep_id || (_localStorage._dep_id = $a13f25507f352177$export$656831b7e9c341c3());
|
|
1388
1383
|
} catch (e) {
|
|
1389
1384
|
$7f95f77417d06249$export$de56f1198d121036("Can't use localStorage", e);
|
|
@@ -1417,17 +1412,11 @@ let $335c248bb07a3509$export$6399bdb2291895e0 = () => {
|
|
|
1417
1412
|
if (!id) id = $a13f25507f352177$export$656831b7e9c341c3();
|
|
1418
1413
|
return id;
|
|
1419
1414
|
};
|
|
1420
|
-
let $335c248bb07a3509$export$adc61a405a4cabed = $335c248bb07a3509$export$6399bdb2291895e0;
|
|
1421
|
-
let $335c248bb07a3509$export$61e7e1f11e96692f = () => undefined;
|
|
1422
|
-
const $335c248bb07a3509$export$336e7ad40bae0652 = /*@__PURE__*/$3b52ccc10510b32a$export$b3bbfd758f11cfa9(newfn => $335c248bb07a3509$export$6399bdb2291895e0 = newfn);
|
|
1423
|
-
const $335c248bb07a3509$export$8a96793bf9f87d90 = /*@__PURE__*/$3b52ccc10510b32a$export$b3bbfd758f11cfa9(newfn => $335c248bb07a3509$export$adc61a405a4cabed = newfn);
|
|
1424
1415
|
const $335c248bb07a3509$export$93ae15b1ae509334 = /*@__PURE__*/$3b52ccc10510b32a$export$b3bbfd758f11cfa9(newfn => $335c248bb07a3509$export$61e7e1f11e96692f = newfn);
|
|
1425
1416
|
const $335c248bb07a3509$export$8c6f26a5b6921b95 = /*@__PURE__*/() => {
|
|
1426
1417
|
var _document;
|
|
1427
1418
|
return {
|
|
1428
1419
|
session_id: $335c248bb07a3509$export$61e7e1f11e96692f(),
|
|
1429
|
-
user_id: $335c248bb07a3509$export$adc61a405a4cabed(),
|
|
1430
|
-
dsid: $335c248bb07a3509$export$6399bdb2291895e0(),
|
|
1431
1420
|
url: document.location.href,
|
|
1432
1421
|
document_width: window.innerWidth,
|
|
1433
1422
|
document_referrer: (_document = document) === null || _document === void 0 ? void 0 : _document.referrer
|
|
@@ -2808,14 +2797,12 @@ const $2e81c18d82b25372$export$abec7fd9f0b9cc22 = /*@__PURE__*/$3b52ccc10510b32a
|
|
|
2808
2797
|
let anon_id = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "anonymous";
|
|
2809
2798
|
$7f95f77417d06249$export$de56f1198d121036("Initializing Cookiebot tracking");
|
|
2810
2799
|
if (!$2e81c18d82b25372$var$required_consent_level) return $7f95f77417d06249$export$de56f1198d121036("No consent level set for Depict tracking. Ignoring consent and tracking everything.");
|
|
2811
|
-
const
|
|
2812
|
-
|
|
2813
|
-
$335c248bb07a3509$export$336e7ad40bae0652(() => $2e81c18d82b25372$var$has_consent ? original_get_depict_id() : anon_id);
|
|
2814
|
-
$335c248bb07a3509$export$8a96793bf9f87d90(() => $2e81c18d82b25372$var$has_consent ? original_get_user_id() : anon_id);
|
|
2800
|
+
const original_get_session_id = (0, $335c248bb07a3509$export$61e7e1f11e96692f);
|
|
2801
|
+
$335c248bb07a3509$export$93ae15b1ae509334(() => $2e81c18d82b25372$var$has_consent ? original_get_session_id() : anon_id);
|
|
2815
2802
|
for await (const consent_obj of $2e81c18d82b25372$export$8827362e5e938d26()) {
|
|
2816
2803
|
// Changing this will change the return value of function given to set_depict_id_fn above
|
|
2817
2804
|
$2e81c18d82b25372$var$has_consent = consent_obj[$2e81c18d82b25372$var$required_consent_level];
|
|
2818
|
-
if (!$2e81c18d82b25372$var$has_consent) $7f95f77417d06249$export$de56f1198d121036('dsid
|
|
2805
|
+
if (!$2e81c18d82b25372$var$has_consent) $7f95f77417d06249$export$de56f1198d121036('dsid will be set to, "'.concat(anon_id, '", until Cookiebot has consent for "').concat($2e81c18d82b25372$var$required_consent_level, '"'));else $7f95f77417d06249$export$de56f1198d121036('Cookiebot obtained consent for "'.concat($2e81c18d82b25372$var$required_consent_level, '", will use true dsid/session_id'));
|
|
2819
2806
|
}
|
|
2820
2807
|
});
|
|
2821
2808
|
const $e9ab1681652f3fca$var$required_consent_level = process.env.DEPICT_TRACKING_CONSENT_LEVEL;
|
|
@@ -2878,14 +2865,12 @@ const $e9ab1681652f3fca$export$f0f6c846d96fdbec = /*@__PURE__*/$3b52ccc10510b32a
|
|
|
2878
2865
|
let anon_id = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "anonymous";
|
|
2879
2866
|
$7f95f77417d06249$export$de56f1198d121036("Initializing OptAnon tracking");
|
|
2880
2867
|
if (!$e9ab1681652f3fca$var$required_consent_level) return $7f95f77417d06249$export$de56f1198d121036("No consent level set for Depict tracking. Ignoring consent and tracking everything.");
|
|
2881
|
-
const
|
|
2882
|
-
|
|
2883
|
-
$335c248bb07a3509$export$336e7ad40bae0652(() => $e9ab1681652f3fca$var$has_consent ? original_get_depict_id() : anon_id);
|
|
2884
|
-
$335c248bb07a3509$export$8a96793bf9f87d90(() => $e9ab1681652f3fca$var$has_consent ? original_get_user_id() : anon_id);
|
|
2868
|
+
const original_get_session_id = (0, $335c248bb07a3509$export$61e7e1f11e96692f);
|
|
2869
|
+
$335c248bb07a3509$export$93ae15b1ae509334(() => $e9ab1681652f3fca$var$has_consent ? original_get_session_id() : anon_id);
|
|
2885
2870
|
for await (const consent_obj of $e9ab1681652f3fca$export$7e4427e80d5fc619()) {
|
|
2886
2871
|
// Changing this will change the return value of function given to set_depict_id_fn above
|
|
2887
2872
|
$e9ab1681652f3fca$var$has_consent = consent_obj[$e9ab1681652f3fca$var$required_consent_level];
|
|
2888
|
-
if (!$e9ab1681652f3fca$var$has_consent) $7f95f77417d06249$export$de56f1198d121036('dsid/
|
|
2873
|
+
if (!$e9ab1681652f3fca$var$has_consent) $7f95f77417d06249$export$de56f1198d121036('dsid/session_id will be set to, "'.concat(anon_id, '", until Optanon has consent for "').concat($e9ab1681652f3fca$var$required_consent_level, '"'));else $7f95f77417d06249$export$de56f1198d121036('Optanon obtained consent for "'.concat($e9ab1681652f3fca$var$required_consent_level, '", will use true dsid/session_id'));
|
|
2889
2874
|
}
|
|
2890
2875
|
});
|
|
2891
2876
|
const $99b61a0622560fcf$var$g = typeof globalThis == "object" && globalThis || window;
|
|
@@ -3505,15 +3490,11 @@ async function $d72c9a0d8e9c5a95$export$1bc0df10745d5412(t, options, headers) {
|
|
|
3505
3490
|
}
|
|
3506
3491
|
async function $d72c9a0d8e9c5a95$export$d40679eb4cf32f09(t, options, headers) {
|
|
3507
3492
|
let get_url = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : $d72c9a0d8e9c5a95$var$default_get_fetch_url;
|
|
3508
|
-
const dsid = $335c248bb07a3509$export$6399bdb2291895e0();
|
|
3509
3493
|
const session_id = options.session_id || $335c248bb07a3509$export$61e7e1f11e96692f();
|
|
3510
|
-
const user_id = options.user_id || dsid;
|
|
3511
3494
|
const body = {
|
|
3512
3495
|
tenant: t.tenant,
|
|
3513
3496
|
market: t.market,
|
|
3514
|
-
user_id: user_id,
|
|
3515
3497
|
session_id: session_id,
|
|
3516
|
-
dsid: dsid,
|
|
3517
3498
|
document_referrer: document.referrer,
|
|
3518
3499
|
...options
|
|
3519
3500
|
};
|
|
@@ -4153,7 +4134,7 @@ class $bc463df3122a418b$export$3be7054c61590ee3 {
|
|
|
4153
4134
|
for (let i = 0; i < mutations.length; i++) {
|
|
4154
4135
|
const matching_added_els = $8b27923e1d1e6b99$export$5e63aea0cac01fa0(mutations[i].addedNodes, this.selector);
|
|
4155
4136
|
if (matching_added_els.length) {
|
|
4156
|
-
if ($parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldGet)(this, $bc463df3122a418b$var$_verbose)) $7f95f77417d06249$export$de56f1198d121036("New elements", matching_added_els, " matching selector", this.selector, "were aded to", container, "lazyloading
|
|
4137
|
+
if ($parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldGet)(this, $bc463df3122a418b$var$_verbose)) $7f95f77417d06249$export$de56f1198d121036("New elements", matching_added_els, " matching selector", this.selector, "were aded to", container, "lazyloading\u2026");
|
|
4157
4138
|
this.lazyfinder.elements.push(...matching_added_els);
|
|
4158
4139
|
matching_added_els.forEach($bc463df3122a418b$var$_classPrivateMethodGet(this, $bc463df3122a418b$var$_initiate_new_image, $bc463df3122a418b$var$_initiate_new_image2).bind(this));
|
|
4159
4140
|
}
|
|
@@ -5357,7 +5338,7 @@ class $a782ed55f4206a68$export$1a8782481a9af507 {
|
|
|
5357
5338
|
let itemTemplate;
|
|
5358
5339
|
if (item.sale_price !== item.original_price) {
|
|
5359
5340
|
itemTemplate = template.replaceAll($a782ed55f4206a68$var$discountMatcher, "$1").replaceAll($a782ed55f4206a68$var$noDiscountMatcher, "");
|
|
5360
|
-
item.discount = "
|
|
5341
|
+
item.discount = "\u2013".concat(Math.round(100 * (1 - item.sale_price / item.original_price)), "%");
|
|
5361
5342
|
} else {
|
|
5362
5343
|
itemTemplate = template.replaceAll($a782ed55f4206a68$var$discountMatcher, "").replaceAll($a782ed55f4206a68$var$noDiscountMatcher, "$1");
|
|
5363
5344
|
item.discount = "";
|
|
@@ -5451,8 +5432,8 @@ $ebe64dbcfb106f16$export$2e2bcd8739ae039 = async options => {
|
|
|
5451
5432
|
};
|
|
5452
5433
|
|
|
5453
5434
|
// @ts-ignore
|
|
5454
|
-
var $
|
|
5455
|
-
$
|
|
5435
|
+
var $d64ae53fcd29bba1$exports = {};
|
|
5436
|
+
$d64ae53fcd29bba1$exports = ".depict .rec_outer.noautospacing {\n width: 6cm;\n max-width: 46vw;\n margin-left: 1%;\n margin-right: 1%;\n}\n\n.depict .rec_outer.noautospacing:nth-child(1) {\n margin-left: 0;\n}\n\n.depict .rec_outer.noautospacing:nth-last-child(1) {\n margin-right: 0;\n}\n\n.depict-slider .slider_snap {\n scroll-snap-type: x mandatory;\n}\n\n.depict-slider {\n width: 100%;\n position: relative;\n}\n\n.depict-slider .sliding::-webkit-scrollbar {\n display: none;\n}\n\n.depict-slider .sliding {\n scroll-behavior: smooth;\n -ms-overflow-style: none;\n scrollbar-width: none;\n flex-flow: row;\n margin-top: -1%;\n margin-bottom: -2%;\n padding-top: 1%;\n padding-bottom: 2%;\n display: flex;\n overflow-x: scroll;\n}\n\n.depict-slider .sliding > * {\n box-sizing: border-box;\n flex: none;\n}\n\n.depict-slider button.right {\n right: 0;\n}\n\n.depict-slider button.left, .depict-slider button.right {\n z-index: 2;\n touch-action: manipulation;\n width: 1cm;\n height: 1cm;\n cursor: pointer;\n background: #fff;\n border: none;\n padding: .5%;\n transition-duration: .2s;\n position: absolute;\n top: 50%;\n transform: translateY(-50%);\n}\n\n.depict-slider button.left.hidden, .depict-slider button.right.hidden {\n opacity: 0;\n cursor: default;\n}\n\n.depict-slider button.left {\n left: 0;\n transform: translateY(-50%)rotate(180deg);\n}\n\n.depict-slider button.left img, .depict-slider button.right img {\n width: 100%;\n height: 100%;\n}\n\n.depict-slider .rec_outer {\n margin-top: 0 !important;\n}\n\n";
|
|
5456
5437
|
const $3f49f9b73bfc2a38$var$default_image_src = "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAyMy4wLjYsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iTGF5ZXJfMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeD0iMHB4IiB5PSIwcHgiDQoJIHZpZXdCb3g9IjAgMCAxNiAxNiIgc3R5bGU9ImVuYWJsZS1iYWNrZ3JvdW5kOm5ldyAwIDAgMTYgMTY7IiB4bWw6c3BhY2U9InByZXNlcnZlIj4NCjxwb2x5Z29uIHBvaW50cz0iOSwyLjYgOC4zLDMuNCAxMi40LDcuNSAxLjYsNy41IDEuNiw4LjUgMTIuNCw4LjUgOC4zLDEyLjYgOSwxMy40IDE0LjQsOCAiLz4NCjwvc3ZnPg0K";
|
|
5457
5438
|
class $3f49f9b73bfc2a38$export$4d41c6499d53639c extends (0, $817cb0cb4b98187e$export$68babfc5be0de5da) {
|
|
5458
5439
|
constructor(static_options, override_lazyfier_options) {
|
|
@@ -5484,7 +5465,7 @@ class $3f49f9b73bfc2a38$export$4d41c6499d53639c extends (0, $817cb0cb4b98187e$ex
|
|
|
5484
5465
|
function $3f49f9b73bfc2a38$export$f1b8b9fd75ddcab1(slider) {
|
|
5485
5466
|
const style_elem = document.createElement("style");
|
|
5486
5467
|
style_elem.type = "text/css";
|
|
5487
|
-
style_elem.append((0, /*@__PURE__*/$parcel$interopDefault($
|
|
5468
|
+
style_elem.append((0, /*@__PURE__*/$parcel$interopDefault($d64ae53fcd29bba1$exports)));
|
|
5488
5469
|
slider.container.appendChild(style_elem);
|
|
5489
5470
|
}
|
|
5490
5471
|
async function $bbf8331c74194de9$export$cd12721587f4f16d(t, rendering_options, options_for_us, slider_options, override_lazyfier_options) {
|
|
@@ -5532,7 +5513,7 @@ async function $bbf8331c74194de9$export$cd12721587f4f16d(t, rendering_options, o
|
|
|
5532
5513
|
elements: container ? container : [slider.container]
|
|
5533
5514
|
};
|
|
5534
5515
|
}
|
|
5535
|
-
async function $
|
|
5516
|
+
async function $14c1124272475590$export$30933c637c977eef(_ref) {
|
|
5536
5517
|
var _template_tool$data;
|
|
5537
5518
|
let {
|
|
5538
5519
|
t: t,
|
|
@@ -5551,7 +5532,8 @@ async function $51509cd9b5d4acc7$export$30933c637c977eef(_ref) {
|
|
|
5551
5532
|
template,
|
|
5552
5533
|
// recommendation template
|
|
5553
5534
|
chunk_size_for_load_more = 4,
|
|
5554
|
-
insertion_promise: insertion_promise
|
|
5535
|
+
insertion_promise: insertion_promise,
|
|
5536
|
+
view_more_text: view_more_text
|
|
5555
5537
|
} = _ref;
|
|
5556
5538
|
const {
|
|
5557
5539
|
catchify: catchify,
|
|
@@ -5623,8 +5605,8 @@ async function $51509cd9b5d4acc7$export$30933c637c977eef(_ref) {
|
|
|
5623
5605
|
}, items);
|
|
5624
5606
|
}
|
|
5625
5607
|
});
|
|
5626
|
-
if (with_loadmore) catchify($
|
|
5627
|
-
if (infinite_scroll) catchify($
|
|
5608
|
+
if (with_loadmore) catchify($14c1124272475590$var$setup_load_more)(t, root, chunk_size_for_load_more, view_more_text);
|
|
5609
|
+
if (infinite_scroll) catchify($14c1124272475590$var$setup_infinite_scroll)(t, root);
|
|
5628
5610
|
if (title) {
|
|
5629
5611
|
const [title_element] = $8b27923e1d1e6b99$export$5e63aea0cac01fa0(container, "h1.title, h2.title, h3.title, h4.title, h5.title, h6.title");
|
|
5630
5612
|
if (title_element) {
|
|
@@ -5633,7 +5615,7 @@ async function $51509cd9b5d4acc7$export$30933c637c977eef(_ref) {
|
|
|
5633
5615
|
}
|
|
5634
5616
|
if (template_tool !== null && template_tool !== void 0 && (_template_tool$data = template_tool.data) !== null && _template_tool$data !== void 0 && _template_tool$data.length) return container;else dlog("Didn't get recs from API", template_tool);
|
|
5635
5617
|
}
|
|
5636
|
-
function $
|
|
5618
|
+
function $14c1124272475590$var$setup_infinite_scroll(t, root) {
|
|
5637
5619
|
const {
|
|
5638
5620
|
dlog: dlog,
|
|
5639
5621
|
catchify: catchify
|
|
@@ -5649,14 +5631,14 @@ function $51509cd9b5d4acc7$var$setup_infinite_scroll(t, root) {
|
|
|
5649
5631
|
records.forEach(record => {
|
|
5650
5632
|
if (record.isIntersecting && record.target == get_last_visible_el()) {
|
|
5651
5633
|
dlog("Loading more recs because of", record);
|
|
5652
|
-
if ($
|
|
5634
|
+
if ($14c1124272475590$var$load_more_elements(root)) $14c1124272475590$var$setup_infinite_scroll(t, root);
|
|
5653
5635
|
}
|
|
5654
5636
|
});
|
|
5655
5637
|
}));
|
|
5656
5638
|
dlog("starting to intersection observe", last_visible_el, "for infinite scroll");
|
|
5657
5639
|
intersection_observer.observe(last_visible_el);
|
|
5658
5640
|
}
|
|
5659
|
-
function $
|
|
5641
|
+
function $14c1124272475590$var$load_more_elements(root) {
|
|
5660
5642
|
let chunk_size = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 4;
|
|
5661
5643
|
const hidden_elements = root.querySelectorAll("a.rec_outer.not_visible");
|
|
5662
5644
|
let i = 0;
|
|
@@ -5668,22 +5650,26 @@ function $51509cd9b5d4acc7$var$load_more_elements(root) {
|
|
|
5668
5650
|
const has_more = i >= chunk_size && hidden_elements.length > chunk_size;
|
|
5669
5651
|
return has_more;
|
|
5670
5652
|
}
|
|
5671
|
-
function $
|
|
5653
|
+
function $14c1124272475590$var$setup_load_more(t, root, chunk_size) {
|
|
5654
|
+
let view_more_text = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : "Visa mer";
|
|
5672
5655
|
const {
|
|
5673
5656
|
catchify: catchify
|
|
5674
5657
|
} = t,
|
|
5675
5658
|
load_more_cont = $8b27923e1d1e6b99$export$d3e2a0560cbf4787('<div class="load-more-container"></div>'),
|
|
5676
|
-
load_button = load_more_cont.appendChild($
|
|
5659
|
+
load_button = load_more_cont.appendChild($f0d9ae7bf9bd697d$export$34b9dba7ce09269b("button", {
|
|
5660
|
+
class: "load_more",
|
|
5661
|
+
children: view_more_text
|
|
5662
|
+
}));
|
|
5677
5663
|
load_button.addEventListener("click", catchify(load_more_recs_and_hide_button_if_needed));
|
|
5678
5664
|
root.after(load_more_cont);
|
|
5679
5665
|
load_more_recs_and_hide_button_if_needed();
|
|
5680
5666
|
function load_more_recs_and_hide_button_if_needed() {
|
|
5681
|
-
if (!$
|
|
5667
|
+
if (!$14c1124272475590$var$load_more_elements(root, chunk_size))
|
|
5682
5668
|
// there aren't any recs left to display
|
|
5683
5669
|
load_button.classList.add("not_visible");
|
|
5684
5670
|
}
|
|
5685
5671
|
}
|
|
5686
|
-
function $
|
|
5672
|
+
function $14c1124272475590$export$4f39078bdc72ecd0(_t, d, i, with_loadmore, with_slider, infinite_scroll) {
|
|
5687
5673
|
d.class || (d.class = "");
|
|
5688
5674
|
if (infinite_scroll) d.class = i >= 4 ? "not_visible" : ""; // this will make it hold image loading until .load_image is called on .rec_outer
|
|
5689
5675
|
if (with_loadmore) d.class = "not_visible";
|
|
@@ -5691,7 +5677,7 @@ function $51509cd9b5d4acc7$export$4f39078bdc72ecd0(_t, d, i, with_loadmore, with
|
|
|
5691
5677
|
if (!d.percentage_off || d.percentage_off < 10) d.percentage_off = "";
|
|
5692
5678
|
return d;
|
|
5693
5679
|
}
|
|
5694
|
-
function $
|
|
5680
|
+
function $14c1124272475590$export$c410ce1205e5118a(_t, itms, d, slider) {
|
|
5695
5681
|
for (const item of itms) {
|
|
5696
5682
|
const {
|
|
5697
5683
|
image_url: image_url
|
|
@@ -6114,8 +6100,8 @@ async function $79e67f88d50f1879$export$b0a773486c1c2312(t, recommendation_rende
|
|
|
6114
6100
|
}
|
|
6115
6101
|
|
|
6116
6102
|
// @ts-ignore
|
|
6117
|
-
var $
|
|
6118
|
-
$
|
|
6103
|
+
var $2f73869d45c5c974$exports = {};
|
|
6104
|
+
$2f73869d45c5c974$exports = ".depict-slider {\n width: 100%;\n position: relative;\n}\n\n.depict-slider .sliding {\n scroll-behavior: smooth;\n -ms-overflow-style: none;\n scrollbar-width: none;\n flex-flow: row;\n display: flex;\n overflow-x: scroll;\n}\n\n.depict-slider .sliding::-webkit-scrollbar {\n display: none;\n}\n\n.depict-slider .sliding > * {\n box-sizing: border-box;\n flex: none;\n}\n\n";
|
|
6119
6105
|
let $87dd73b8c244f3d2$var$slider_styling_was_inserted = false;
|
|
6120
6106
|
async function $87dd73b8c244f3d2$export$82cfdc85a4d15688(t, recommendation_renderer_options, _ref) {
|
|
6121
6107
|
let {
|
|
@@ -6139,7 +6125,7 @@ async function $87dd73b8c244f3d2$export$82cfdc85a4d15688(t, recommendation_rende
|
|
|
6139
6125
|
if (!elements) return rendering_result;
|
|
6140
6126
|
if (!$87dd73b8c244f3d2$var$slider_styling_was_inserted) {
|
|
6141
6127
|
$87dd73b8c244f3d2$var$slider_styling_was_inserted = true;
|
|
6142
|
-
$e45474c7d6e21cfa$export$59ba1eb2c083f0cd((0, /*@__PURE__*/$parcel$interopDefault($
|
|
6128
|
+
$e45474c7d6e21cfa$export$59ba1eb2c083f0cd((0, /*@__PURE__*/$parcel$interopDefault($2f73869d45c5c974$exports)));
|
|
6143
6129
|
}
|
|
6144
6130
|
insertion_point.replaceWith(slider.container);
|
|
6145
6131
|
slider.insert_here.append(...elements);
|
|
@@ -7056,7 +7042,7 @@ function $78fd85c1f4513422$export$3ebd86018b39d9d2(t, selector, filter) {
|
|
|
7056
7042
|
element: element
|
|
7057
7043
|
} = eoe;
|
|
7058
7044
|
const the_id = element.innerText;
|
|
7059
|
-
$78fd85c1f4513422$export$1ac466d53a6636ac(t, the_id, $335c248bb07a3509$export$
|
|
7045
|
+
$78fd85c1f4513422$export$1ac466d53a6636ac(t, the_id, $335c248bb07a3509$export$61e7e1f11e96692f(), filter);
|
|
7060
7046
|
});
|
|
7061
7047
|
}
|
|
7062
7048
|
function $78fd85c1f4513422$export$b11248fa13a8a86c(tenant, id_extractor) {
|
|
@@ -7093,7 +7079,7 @@ function $78fd85c1f4513422$export$ff8673d5dea82bd4(tenant, id_extractor) {
|
|
|
7093
7079
|
})().catch(e => $3b52ccc10510b32a$export$f18d5b0af29128b7([e, "Extracting and sending transaction IDs from URL failed"], "warning"));
|
|
7094
7080
|
}
|
|
7095
7081
|
function $78fd85c1f4513422$export$1ac466d53a6636ac(t, input_id) {
|
|
7096
|
-
let
|
|
7082
|
+
let session_id = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : $335c248bb07a3509$export$61e7e1f11e96692f();
|
|
7097
7083
|
let filter = arguments.length > 3 ? arguments[3] : undefined;
|
|
7098
7084
|
const transaction_id = typeof filter == "function" ? filter(input_id) : input_id;
|
|
7099
7085
|
if (!transaction_id) {
|
|
@@ -7107,7 +7093,7 @@ function $78fd85c1f4513422$export$1ac466d53a6636ac(t, input_id) {
|
|
|
7107
7093
|
events: [{
|
|
7108
7094
|
event_type: "transaction_mapping",
|
|
7109
7095
|
transaction_id: transaction_id,
|
|
7110
|
-
|
|
7096
|
+
session_id: session_id
|
|
7111
7097
|
}]
|
|
7112
7098
|
};
|
|
7113
7099
|
$49880c4ce4bb7db2$export$cc3b6ddf805f6156((0, $62869a3ed703f236$export$362abebb4b313340) + "/v2/track", payload);
|
|
@@ -7152,7 +7138,7 @@ function $138f1061348967b4$var$make_tracker_send_to_depict(ga_tracker, t, filter
|
|
|
7152
7138
|
originalSendHitTask(model);
|
|
7153
7139
|
// console.log('Sent original hit, now sending to depict');
|
|
7154
7140
|
try {
|
|
7155
|
-
const dsid = $335c248bb07a3509$export$
|
|
7141
|
+
const dsid = $335c248bb07a3509$export$61e7e1f11e96692f();
|
|
7156
7142
|
const payload = model.get("hitPayload");
|
|
7157
7143
|
const sp = new URLSearchParams(payload);
|
|
7158
7144
|
const id = sp.get("ti");
|
|
@@ -7165,22 +7151,6 @@ function $138f1061348967b4$var$make_tracker_send_to_depict(ga_tracker, t, filter
|
|
|
7165
7151
|
}
|
|
7166
7152
|
});
|
|
7167
7153
|
}
|
|
7168
|
-
async function $3cb1cfeb94b7f96b$export$d63b08f4f29ddba5(t, unavailability_type) {
|
|
7169
|
-
const product_id = await t.get_product_id();
|
|
7170
|
-
$7f95f77417d06249$export$de56f1198d121036("Notifying Depict that product id: ".concat(product_id, " is ").concat(unavailability_type));
|
|
7171
|
-
const payload = {
|
|
7172
|
-
"tenant": t.tenant,
|
|
7173
|
-
"market": t.market,
|
|
7174
|
-
"events": [{
|
|
7175
|
-
event_type: "product_unavailable",
|
|
7176
|
-
product_id: product_id,
|
|
7177
|
-
unavailability_type: unavailability_type,
|
|
7178
|
-
user_id: $335c248bb07a3509$export$adc61a405a4cabed(),
|
|
7179
|
-
dsid: $335c248bb07a3509$export$6399bdb2291895e0()
|
|
7180
|
-
}]
|
|
7181
|
-
};
|
|
7182
|
-
$49880c4ce4bb7db2$export$cc3b6ddf805f6156((0, $62869a3ed703f236$export$362abebb4b313340) + "/v2/track", payload);
|
|
7183
|
-
}
|
|
7184
7154
|
function $89eca8044393f350$var$_classPrivateFieldInitSpec(obj, privateMap, value) {
|
|
7185
7155
|
$89eca8044393f350$var$_checkPrivateRedeclaration(obj, privateMap);
|
|
7186
7156
|
privateMap.set(obj, value);
|
|
@@ -7691,7 +7661,7 @@ function $51fea29d5f0a339b$var$deal_w_removal_of_node_array(node_array, push_dis
|
|
|
7691
7661
|
push_disconnector(disconnect_observer);
|
|
7692
7662
|
}
|
|
7693
7663
|
}
|
|
7694
|
-
const $bb8d2c77db19a4c0$export$3b75288f46cadd96 = () => new Array($c0c9a890763623b3$export$bb0a9c36cf454ea0(3, 8)).fill("
|
|
7664
|
+
const $bb8d2c77db19a4c0$export$3b75288f46cadd96 = () => new Array($c0c9a890763623b3$export$bb0a9c36cf454ea0(3, 8)).fill("\u2B1C").join("");
|
|
7695
7665
|
const $bb8d2c77db19a4c0$var$make_sel = (image_url, attribute) => "[".concat(attribute, "=").concat(JSON.stringify(image_url), "]");
|
|
7696
7666
|
const $bb8d2c77db19a4c0$export$a4eccf92efefa04d = function (image_width, image_height) {
|
|
7697
7667
|
let color = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "#f6f7f8";
|
|
@@ -8123,10 +8093,10 @@ function $dc92594b01eacde3$export$cd1adfb8059b5fcd(promise, ms) {
|
|
|
8123
8093
|
const $eedabd28f7a8a073$var$get_voyado_id = () => {
|
|
8124
8094
|
var _exec;
|
|
8125
8095
|
const va = (_exec = /\b_vaI=([^;]+)/.exec(document.cookie)) === null || _exec === void 0 ? void 0 : _exec[1];
|
|
8126
|
-
return va || $335c248bb07a3509$export$
|
|
8096
|
+
return va || $335c248bb07a3509$export$61e7e1f11e96692f();
|
|
8127
8097
|
};
|
|
8128
8098
|
const $eedabd28f7a8a073$export$a739d9a07da7f9ce = /*@__PURE__*/$3b52ccc10510b32a$export$b3bbfd758f11cfa9(() => {
|
|
8129
|
-
$335c248bb07a3509$export$
|
|
8099
|
+
$335c248bb07a3509$export$93ae15b1ae509334($eedabd28f7a8a073$var$get_voyado_id);
|
|
8130
8100
|
});
|
|
8131
8101
|
function $102c3c26150518b7$export$4a3043e508dd72f0(_ref) {
|
|
8132
8102
|
let {
|
|
@@ -8274,8 +8244,8 @@ async function $468dbae10b24d59f$export$c068ad5361be7646(_ref) {
|
|
|
8274
8244
|
on_close_(exit_oos_iterator);
|
|
8275
8245
|
}));
|
|
8276
8246
|
}
|
|
8277
|
-
var $
|
|
8278
|
-
$
|
|
8247
|
+
var $6c1103c313edcc81$exports = {};
|
|
8248
|
+
$6c1103c313edcc81$exports = ".depict-placeholder {\n will-change: mask, -webkit-mask;\n mask-position-x: 125%;\n mask-position-y: center;\n background: #ddd;\n animation: 1.5s linear infinite depict-placeholder;\n display: inline-block;\n position: relative;\n overflow: hidden;\n -webkit-mask: linear-gradient(-60deg, #000 30%, #0005, #000 70%) 125% / 300% 100%;\n -webkit-mask-image: ;\n mask-image: ;\n -webkit-mask-size: ;\n mask-size: ;\n}\n\n@keyframes depict-placeholder {\n 0% {\n mask-position-x: 125%;\n -webkit-mask-position-x: 125%;\n }\n\n 10% {\n mask-position-x: 125%;\n -webkit-mask-position-x: 125%;\n }\n\n 90% {\n mask-position-x: -25%;\n -webkit-mask-position-x: -25%;\n }\n\n 100% {\n mask-position-x: -25%;\n -webkit-mask-position-x: -25%;\n }\n}\n\n";
|
|
8279
8249
|
let $ba9b4cd7e24de87e$var$inserted = false;
|
|
8280
8250
|
const $ba9b4cd7e24de87e$export$84712d0562a614b8 = _ref => {
|
|
8281
8251
|
let {
|
|
@@ -8287,7 +8257,7 @@ const $ba9b4cd7e24de87e$export$84712d0562a614b8 = _ref => {
|
|
|
8287
8257
|
} = _ref;
|
|
8288
8258
|
if (!$ba9b4cd7e24de87e$var$inserted) {
|
|
8289
8259
|
// Insert styling on first import
|
|
8290
|
-
$e45474c7d6e21cfa$export$59ba1eb2c083f0cd((0, /*@__PURE__*/$parcel$interopDefault($
|
|
8260
|
+
$e45474c7d6e21cfa$export$59ba1eb2c083f0cd((0, /*@__PURE__*/$parcel$interopDefault($6c1103c313edcc81$exports)));
|
|
8291
8261
|
$ba9b4cd7e24de87e$var$inserted = true;
|
|
8292
8262
|
}
|
|
8293
8263
|
return (
|
|
@@ -8526,8 +8496,8 @@ const $151f8676c5d42e80$export$237455ad7e59d4e5 = function () {
|
|
|
8526
8496
|
collapse: collapse
|
|
8527
8497
|
};
|
|
8528
8498
|
};
|
|
8529
|
-
var $
|
|
8530
|
-
$
|
|
8499
|
+
var $4f104a7ebe4cdc54$exports = {};
|
|
8500
|
+
$4f104a7ebe4cdc54$exports = ".depict-img-cont {\n width: 100%;\n height: 100%;\n position: absolute;\n}\n\n.depict-img-filler {\n width: 100%;\n height: auto;\n display: inline-block;\n}\n\n.depict-img-comp {\n width: auto;\n height: auto;\n max-width: 100%;\n max-height: 100%;\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n}\n\n.depict-img-mod {\n width: 100%;\n height: 100%;\n object-fit: contain;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n}\n\n";
|
|
8531
8501
|
const $b42b9f62e8b6cb2d$export$3d13beba9b52c947 = "https://img.depict.ai/ResizeImage" + (process.env.TENANT ? "/" + process.env.TENANT : "");
|
|
8532
8502
|
const $b42b9f62e8b6cb2d$export$a98fc8a2c818d3d8 = /*@__PURE__*/(() => typeof navigator === "undefined" ? false : /^((?!chrome|android).)*safari/i.test(navigator.userAgent))(); // https://stackoverflow.com/a/23522755
|
|
8533
8503
|
function $b42b9f62e8b6cb2d$export$f39a7d0667e924a(what_to_watch) {
|
|
@@ -8690,7 +8660,7 @@ const $dfce76a4aeb41067$export$788756b42446dc2d = _ref => {
|
|
|
8690
8660
|
} = _ref;
|
|
8691
8661
|
if (!$dfce76a4aeb41067$var$inserted) {
|
|
8692
8662
|
// Insert styling on first import
|
|
8693
|
-
$e45474c7d6e21cfa$export$59ba1eb2c083f0cd((0, /*@__PURE__*/$parcel$interopDefault($
|
|
8663
|
+
$e45474c7d6e21cfa$export$59ba1eb2c083f0cd((0, /*@__PURE__*/$parcel$interopDefault($4f104a7ebe4cdc54$exports)));
|
|
8694
8664
|
$dfce76a4aeb41067$var$inserted = true;
|
|
8695
8665
|
}
|
|
8696
8666
|
const img = process.env.BUILD_TARGET === "modern" || process.env.BUILD_TARGET === "dev" ? $dfce76a4aeb41067$var$Image(options) : $dfce76a4aeb41067$var$CompatibleImage(options);
|
|
@@ -8777,8 +8747,8 @@ function $dfce76a4aeb41067$var$srcset_comp_from_map_or_new(rendering_options) {
|
|
|
8777
8747
|
}
|
|
8778
8748
|
return sourceset_component;
|
|
8779
8749
|
}
|
|
8780
|
-
var $
|
|
8781
|
-
$
|
|
8750
|
+
var $be5deeed4683b89f$exports = {};
|
|
8751
|
+
$be5deeed4683b89f$exports = ".depict .images-container {\n position: relative;\n}\n\n.depict .second-image-container {\n width: 100%;\n opacity: 0;\n position: absolute;\n top: 0;\n}\n\n.depict .hovering .main-image-container {\n opacity: 0;\n}\n\n.depict .hovering .second-image-container {\n opacity: 1;\n}\n\n";
|
|
8782
8752
|
|
|
8783
8753
|
// Saving bytez
|
|
8784
8754
|
// Maybe? @Daniel
|
|
@@ -8912,7 +8882,7 @@ const $8928a1027461fba4$export$2369f6fc1c911576 = _ref => {
|
|
|
8912
8882
|
...options
|
|
8913
8883
|
} = _ref;
|
|
8914
8884
|
if (!$8928a1027461fba4$var$styling_inserted) {
|
|
8915
|
-
$e45474c7d6e21cfa$export$59ba1eb2c083f0cd((0, /*@__PURE__*/$parcel$interopDefault($
|
|
8885
|
+
$e45474c7d6e21cfa$export$59ba1eb2c083f0cd((0, /*@__PURE__*/$parcel$interopDefault($be5deeed4683b89f$exports)));
|
|
8916
8886
|
$8928a1027461fba4$var$styling_inserted = true;
|
|
8917
8887
|
}
|
|
8918
8888
|
const main_image = $dfce76a4aeb41067$export$788756b42446dc2d({
|
|
@@ -9021,104 +8991,6 @@ function $b5388c1e3ff41e88$export$ca305c142c6fc3cf(hex) {
|
|
|
9021
8991
|
if (!((rgb === null || rgb === void 0 ? void 0 : rgb.length) === 3 && rgb.every(x => typeof x === "number" && x >= 0 && x <= 255))) return null;
|
|
9022
8992
|
return rgb;
|
|
9023
8993
|
}
|
|
9024
|
-
const $0126fdc29a9f7f2d$var$MAX_SYNC_RETRIES = 10;
|
|
9025
|
-
/*
|
|
9026
|
-
# Reference material:
|
|
9027
|
-
|
|
9028
|
-
Google has some mixed communication around editing meta tags with JavaScript, as seen in these quotes:
|
|
9029
|
-
|
|
9030
|
-
https://developers.google.com/search/docs/crawling-indexing/special-tags#other-points-to-note
|
|
9031
|
-
> If you're considering using JavaScript to inject or change meta tags, proceed with caution. We recommend that you avoid using JavaScript to inject or change meta tags whenever possible ...
|
|
9032
|
-
https://developers.google.com/search/docs/crawling-indexing/javascript/javascript-seo-basics#titles-and-snippets
|
|
9033
|
-
> You can use JavaScript to set or change the meta description as well as the <title> element.
|
|
9034
|
-
|
|
9035
|
-
The only thing we can do is test that it works.
|
|
9036
|
-
|
|
9037
|
-
This page has a really nice table that describes the different meta tags used by Google: https://developers.google.com/search/docs/crawling-indexing/special-tags#meta-tags
|
|
9038
|
-
*/
|
|
9039
|
-
const $0126fdc29a9f7f2d$var$tags = {
|
|
9040
|
-
title: [{
|
|
9041
|
-
selector: 'meta[name="twitter:title"]',
|
|
9042
|
-
create: () => document.createElement("meta"),
|
|
9043
|
-
configure: (element, value) => {
|
|
9044
|
-
element.name = "twitter:title";
|
|
9045
|
-
element.content = value;
|
|
9046
|
-
},
|
|
9047
|
-
isConfigured: (element, value) => element.content === value && element.name === "twitter:title"
|
|
9048
|
-
}, {
|
|
9049
|
-
selector: 'meta[property="og:title"]',
|
|
9050
|
-
create: () => document.createElement("meta"),
|
|
9051
|
-
configure: (element, value) => {
|
|
9052
|
-
element.setAttribute("property", "og:title");
|
|
9053
|
-
element.content = value;
|
|
9054
|
-
},
|
|
9055
|
-
isConfigured: (element, value) => element.content === value && element.getAttribute("property") === "og:title"
|
|
9056
|
-
}, {
|
|
9057
|
-
selector: "title",
|
|
9058
|
-
create: () => document.createElement("title"),
|
|
9059
|
-
configure: (element, value) => element.textContent = value,
|
|
9060
|
-
isConfigured: (element, value) => element.textContent === value
|
|
9061
|
-
}],
|
|
9062
|
-
description: [{
|
|
9063
|
-
selector: 'meta[name="description"]',
|
|
9064
|
-
create: () => document.createElement("meta"),
|
|
9065
|
-
configure: (element, value) => {
|
|
9066
|
-
element.name = "description";
|
|
9067
|
-
element.content = value;
|
|
9068
|
-
},
|
|
9069
|
-
isConfigured: (element, value) => element.content === value && element.name === "description"
|
|
9070
|
-
}, {
|
|
9071
|
-
selector: 'meta[property="og:description"]',
|
|
9072
|
-
create: () => document.createElement("meta"),
|
|
9073
|
-
configure: (element, value) => {
|
|
9074
|
-
element.setAttribute("property", "og:description");
|
|
9075
|
-
element.content = value;
|
|
9076
|
-
},
|
|
9077
|
-
isConfigured: (element, value) => element.content === value && element.getAttribute("property") === "og:description"
|
|
9078
|
-
}]
|
|
9079
|
-
};
|
|
9080
|
-
let $0126fdc29a9f7f2d$var$running_writers = 0;
|
|
9081
|
-
function $0126fdc29a9f7f2d$export$ef73ea4f975745ba(meta_data) {
|
|
9082
|
-
if ($0126fdc29a9f7f2d$var$running_writers >= 1) return;
|
|
9083
|
-
$0126fdc29a9f7f2d$var$running_writers++;
|
|
9084
|
-
$bBfCy$solidjs.onCleanup(() => $0126fdc29a9f7f2d$var$running_writers--);
|
|
9085
|
-
const disconnectors = [];
|
|
9086
|
-
$bBfCy$solidjs.createEffect($3b52ccc10510b32a$export$b3bbfd758f11cfa9(() => {
|
|
9087
|
-
if (!meta_data()) return;
|
|
9088
|
-
$bBfCy$solidjs.onCleanup(() => {
|
|
9089
|
-
disconnectors.forEach(d => d());
|
|
9090
|
-
});
|
|
9091
|
-
for (const [type, content] of Object.entries(meta_data())) for (const opts of $0126fdc29a9f7f2d$var$tags[type]) {
|
|
9092
|
-
if (!type || !content) return;
|
|
9093
|
-
let retries = 0;
|
|
9094
|
-
/** Ensures that there is at least one occurrence of the element. Multiple are allowed, 0 is not.
|
|
9095
|
-
* Also ensures that each occurrence is configured (has correct content)
|
|
9096
|
-
* It's preferred not to kill any conflicting meta tags because frameworks might go apeshit.
|
|
9097
|
-
* Things seem to work when only changing the meta values though */
|
|
9098
|
-
const sync_elements_to_head = () => {
|
|
9099
|
-
if (retries++ > $0126fdc29a9f7f2d$var$MAX_SYNC_RETRIES) return $7f95f77417d06249$export$de56f1198d121036("Failed to sync meta tag to head. Hit max retries.", opts.selector, content);
|
|
9100
|
-
const existing_elements = document.head.querySelectorAll(opts.selector);
|
|
9101
|
-
const elements = existing_elements.length ? existing_elements : [opts.create()];
|
|
9102
|
-
elements.forEach(el => {
|
|
9103
|
-
if (!opts.isConfigured(el, content)) opts.configure(el, content);
|
|
9104
|
-
});
|
|
9105
|
-
if (!existing_elements.length) {
|
|
9106
|
-
elements[0].dataset.depictMeta = "1";
|
|
9107
|
-
document.head.appendChild(elements[0]);
|
|
9108
|
-
} else if (existing_elements.length > 1) {
|
|
9109
|
-
// In this case, we should try to remove our own tag if it exists.
|
|
9110
|
-
// This is to avoid duplicate meta tags, which might be bad for SEO
|
|
9111
|
-
// We can't remove the other tags because they might be used by frameworks
|
|
9112
|
-
const depict_elements = Array.from(existing_elements).filter(el => el.dataset.depictMeta);
|
|
9113
|
-
// We only want to remove the Depict elements if there are other elements
|
|
9114
|
-
if (depict_elements.length && depict_elements.length < existing_elements.length) depict_elements.forEach(el => el.remove());
|
|
9115
|
-
}
|
|
9116
|
-
};
|
|
9117
|
-
sync_elements_to_head();
|
|
9118
|
-
disconnectors.push((0, $03c157d68c9fcbac$export$b6ae1bc530f4c149).onremoved(opts.selector, sync_elements_to_head), (0, $03c157d68c9fcbac$export$b6ae1bc530f4c149).onchange(opts.selector, sync_elements_to_head), (0, $03c157d68c9fcbac$export$b6ae1bc530f4c149).onexists(opts.selector, sync_elements_to_head));
|
|
9119
|
-
}
|
|
9120
|
-
}, "Meta tag writing crashed"));
|
|
9121
|
-
}
|
|
9122
8994
|
const $84d13ab567309a50$var$MAX_SYNC_RETRIES = 15;
|
|
9123
8995
|
function $84d13ab567309a50$export$c3f56a35e076f139(selector, data, opts) {
|
|
9124
8996
|
const {
|