Pixel Manager for WooCommerce – Track Google Analytics, Google Ads, Facebook and more - Version 1.16.4

Version Description

07.04.2022

  • Fix: Fixed a bug that prevented disabling user role tracking
Download this release

Release Info

Developer alekv
Plugin Icon 128x128 Pixel Manager for WooCommerce – Track Google Analytics, Google Ads, Facebook and more
Version 1.16.4
Comparing to
See all releases

Code changes from version 1.16.6 to 1.16.4

classes/pixels/trait-product.php CHANGED
@@ -10,7 +10,6 @@ if (!defined('ABSPATH')) {
10
  }
11
 
12
  trait Trait_Product {
13
-
14
  protected function get_formatted_variant_text( $product ) {
15
  $variant_text_array = [];
16
 
@@ -27,8 +26,7 @@ trait Trait_Product {
27
  }
28
 
29
  protected function get_variation_or_product_id( $item, $variations_output = true ) {
30
-
31
- if (0 <> $item['variation_id'] && true === $variations_output) {
32
  return $item['variation_id'];
33
  } else {
34
  return $item['product_id'];
@@ -38,13 +36,19 @@ trait Trait_Product {
38
  // https://stackoverflow.com/a/56278308/4688612
39
  // https://stackoverflow.com/a/39034036/4688612
40
  public function get_brand_name( $product_id ) {
 
 
 
 
41
 
42
  $brand_taxonomy = 'pa_brand';
43
 
44
  if (( new Environment_Check($this->options) )->is_yith_wc_brands_active()) {
45
  $brand_taxonomy = 'yith_product_brand';
46
- } elseif (( new Environment_Check($this->options) )->is_woocommerce_brands_active()) {
47
- $brand_taxonomy = 'product_brand';
 
 
48
  }
49
 
50
  $brand_taxonomy = apply_filters_deprecated('wooptpm_custom_brand_taxonomy', [$brand_taxonomy], '1.13.0', 'wpm_custom_brand_taxonomy');
@@ -52,6 +56,10 @@ trait Trait_Product {
52
  // Use custom brand_taxonomy
53
  $brand_taxonomy = apply_filters('wpm_custom_brand_taxonomy', $brand_taxonomy);
54
 
 
 
 
 
55
  if ($this->get_brand_by_taxonomy($product_id, $brand_taxonomy)) {
56
  return $this->get_brand_by_taxonomy($product_id, $brand_taxonomy);
57
  } elseif ($this->get_brand_by_taxonomy($product_id, 'pa_' . $brand_taxonomy)) {
@@ -62,7 +70,6 @@ trait Trait_Product {
62
  }
63
 
64
  public function get_brand_by_taxonomy( $product_id, $taxonomy ) {
65
-
66
  if (taxonomy_exists($taxonomy)) {
67
  $brand_names = wp_get_post_terms($product_id, $taxonomy, ['fields' => 'names']);
68
  return reset($brand_names);
@@ -73,19 +80,13 @@ trait Trait_Product {
73
 
74
  // get an array with all product categories
75
  public function get_product_category( $product_id ) {
76
-
77
- if ($this->is_variable_product_by_id($product_id)) {
78
- $product = wc_get_product($product_id);
79
- $product_id = $product->get_parent_id();
80
- }
81
-
82
  $prod_cats = get_the_terms($product_id, 'product_cat');
83
  $prod_cats_output = [];
84
 
85
  // only continue with the loop if one or more product categories have been set for the product
86
  if (!empty($prod_cats)) {
87
  foreach ((array) $prod_cats as $key) {
88
- $prod_cats_output[] = $key->name;
89
  }
90
 
91
  // apply filter to the $prod_cats_output array
@@ -95,15 +96,7 @@ trait Trait_Product {
95
  return $prod_cats_output;
96
  }
97
 
98
- protected function is_variable_product_by_id( $product_id ) {
99
-
100
- $product = wc_get_product($product_id);
101
-
102
- return $product->get_type() === 'variable';
103
- }
104
-
105
  protected function get_compiled_product_id( $product_id, $product_sku, $options, $channel = '' ) {
106
-
107
  // depending on setting use product IDs or SKUs
108
  if (0 == $this->options['google']['ads']['product_identifier'] || 'ga_ua' === $channel || 'ga_4' === $channel) {
109
  return (string) $product_id;
@@ -121,7 +114,6 @@ trait Trait_Product {
121
  }
122
 
123
  protected function get_dyn_r_ids( $product ) {
124
-
125
  $dyn_r_ids = [
126
  'post_id' => (string) $product->get_id(),
127
  'sku' => (string) $product->get_sku() ? $product->get_sku() : $product->get_id(),
@@ -135,7 +127,6 @@ trait Trait_Product {
135
  }
136
 
137
  protected function log_problematic_product_id( $product_id = 0 ) {
138
-
139
  wc_get_logger()->debug(
140
  'WooCommerce detects the page ID ' . $product_id . ' as product, but when invoked by wc_get_product( ' . $product_id . ' ) it returns no product object',
141
  ['source' => 'wpm']
@@ -158,6 +149,7 @@ trait Trait_Product {
158
 
159
  $dyn_r_ids = $this->get_dyn_r_ids($product);
160
  $product_id_compiled = $dyn_r_ids[$this->get_dyn_r_id_type()];
 
161
  array_push($order_items_array, $product_id_compiled);
162
  } else {
163
 
@@ -169,7 +161,6 @@ trait Trait_Product {
169
  }
170
 
171
  protected function get_order_items_formatted_for_purchase_event( $order ) {
172
-
173
  $order_items = $this->wpm_get_order_items($order);
174
  $order_items_formatted = [];
175
 
@@ -185,6 +176,7 @@ trait Trait_Product {
185
 
186
  $dyn_r_ids = $this->get_dyn_r_ids($product);
187
  $product_id_compiled = $dyn_r_ids[$this->get_dyn_r_id_type()];
 
188
 
189
  $product_details['id'] = $product_id_compiled;
190
  $product_details['name'] = $product->get_name();
@@ -193,6 +185,8 @@ trait Trait_Product {
193
  $product_details['brand'] = $this->get_brand_name($product_id);
194
  $product_details['category'] = implode(',', $this->get_product_category($product_id));
195
 
 
 
196
  if ($product->is_type('variation')) {
197
  $product_details['variant'] = $this->get_formatted_variant_text($product);
198
 
@@ -205,6 +199,7 @@ trait Trait_Product {
205
  }
206
 
207
  $order_items_formatted[] = $product_details;
 
208
  } else {
209
 
210
  $this->log_problematic_product_id($product_id);
@@ -214,7 +209,9 @@ trait Trait_Product {
214
  return $order_items_formatted;
215
  }
216
 
 
217
  protected function get_dyn_r_id_type( $pixel_name = null ) {
 
218
 
219
  if ($pixel_name) {
220
  $this->pixel_name = $pixel_name;
@@ -238,16 +235,11 @@ trait Trait_Product {
238
  }
239
 
240
  protected function wpm_get_order_items( $order ) {
241
-
242
  $order_items = apply_filters_deprecated('wooptpm_order_items', [$order->get_items(), $order], '1.13.0', 'wpm_order_items');
243
-
244
- // Give option to filter order items
245
- // then return
246
  return apply_filters('wpm_order_items', $order_items, $order);
247
  }
248
 
249
  protected function get_front_end_order_items( $order ) {
250
-
251
  $order_items = $this->wpm_get_order_items($order);
252
  $order_items_formatted = [];
253
 
@@ -289,23 +281,50 @@ trait Trait_Product {
289
  }
290
 
291
  public function get_product_data_layer_script( $product, $set_position = true, $meta_tag = false ) {
292
-
293
  if (!is_object($product)) {
 
 
294
  wc_get_logger()->debug('get_product_data_layer_script received an invalid product', ['source' => 'wpm']);
 
295
  return '';
296
  }
297
 
298
  $data = $this->get_product_details_for_datalayer($product);
299
 
300
- // If placed in <head> it must be a <meta> tag else, it can be an <input> tag
301
- // Added name and content to meta in order to pass W3 validation test at https://validator.w3.org/nu/
 
302
  $tag = $meta_tag ? "meta name='wpm-dataLayer-meta' content='" . $product->get_id() . "'" : "input type='hidden'";
303
 
 
 
 
 
 
 
304
  $this->get_product_data_layer_script_html_part_1($tag, $product, $data, $set_position, $meta_tag);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
305
  }
306
 
307
  protected function get_product_data_layer_script_html_part_1( $tag, $product, $data, $set_position, $meta_tag ) {
308
-
309
  if ($meta_tag) {
310
  ?>
311
  <meta name="pm-dataLayer-meta" content="<?php esc_html_e($product->get_id()); ?>" class="wpmProductId"
@@ -324,16 +343,18 @@ trait Trait_Product {
324
  <?php $set_position ? $this->get_product_data_layer_script_html_part_2($product) : ''; ?>
325
  </script>
326
  <?php
 
327
  }
328
 
329
  protected function get_product_data_layer_script_html_part_2( $product ) {
330
  ?>
331
  window.wpmDataLayer.products[<?php esc_html_e($product->get_id()); ?>]['position'] = window.wpmDataLayer.position++
332
  <?php
 
333
  }
334
 
335
- public function get_product_details_for_datalayer( $product ) {
336
 
 
337
  global $woocommerce_wpml;
338
 
339
  $dyn_r_ids = $this->get_dyn_r_ids($product);
@@ -353,11 +374,11 @@ trait Trait_Product {
353
  'category' => $this->get_product_category($product->get_id()),
354
  'quantity' => 1,
355
  'dyn_r_ids' => $dyn_r_ids,
356
- 'isVariable' => $product->get_type() === 'variable',
357
  'isVariation' => false,
358
  ];
359
 
360
- if ($product->get_type() === 'variation') {
361
 
362
  $parent_product = wc_get_product($product->get_parent_id());
363
  if ($parent_product) {
10
  }
11
 
12
  trait Trait_Product {
 
13
  protected function get_formatted_variant_text( $product ) {
14
  $variant_text_array = [];
15
 
26
  }
27
 
28
  protected function get_variation_or_product_id( $item, $variations_output = true ) {
29
+ if (0 <> $item['variation_id'] && true == $variations_output) {
 
30
  return $item['variation_id'];
31
  } else {
32
  return $item['product_id'];
36
  // https://stackoverflow.com/a/56278308/4688612
37
  // https://stackoverflow.com/a/39034036/4688612
38
  public function get_brand_name( $product_id ) {
39
+ // return $this->get_brand_by_taxonomy($product_id, 'product_brand') ?: // for Woocommerce Brands plugin
40
+ // $this->get_brand_by_taxonomy($product_id, 'yith_product_brand') ?: // for YITH WooCommerce Brands plugin
41
+ // $this->get_brand_by_taxonomy($product_id, 'pa_brand') ?: // for a custom product attribute
42
+ // '';
43
 
44
  $brand_taxonomy = 'pa_brand';
45
 
46
  if (( new Environment_Check($this->options) )->is_yith_wc_brands_active()) {
47
  $brand_taxonomy = 'yith_product_brand';
48
+ } else {
49
+ if (( new Environment_Check($this->options) )->is_woocommerce_brands_active()) {
50
+ $brand_taxonomy = 'product_brand';
51
+ }
52
  }
53
 
54
  $brand_taxonomy = apply_filters_deprecated('wooptpm_custom_brand_taxonomy', [$brand_taxonomy], '1.13.0', 'wpm_custom_brand_taxonomy');
56
  // Use custom brand_taxonomy
57
  $brand_taxonomy = apply_filters('wpm_custom_brand_taxonomy', $brand_taxonomy);
58
 
59
+ // return $this->get_brand_by_taxonomy($product_id, $brand_taxonomy) ?:
60
+ // $this->get_brand_by_taxonomy($product_id, 'pa_' . $brand_taxonomy) ?:
61
+ // '';
62
+
63
  if ($this->get_brand_by_taxonomy($product_id, $brand_taxonomy)) {
64
  return $this->get_brand_by_taxonomy($product_id, $brand_taxonomy);
65
  } elseif ($this->get_brand_by_taxonomy($product_id, 'pa_' . $brand_taxonomy)) {
70
  }
71
 
72
  public function get_brand_by_taxonomy( $product_id, $taxonomy ) {
 
73
  if (taxonomy_exists($taxonomy)) {
74
  $brand_names = wp_get_post_terms($product_id, $taxonomy, ['fields' => 'names']);
75
  return reset($brand_names);
80
 
81
  // get an array with all product categories
82
  public function get_product_category( $product_id ) {
 
 
 
 
 
 
83
  $prod_cats = get_the_terms($product_id, 'product_cat');
84
  $prod_cats_output = [];
85
 
86
  // only continue with the loop if one or more product categories have been set for the product
87
  if (!empty($prod_cats)) {
88
  foreach ((array) $prod_cats as $key) {
89
+ array_push($prod_cats_output, $key->name);
90
  }
91
 
92
  // apply filter to the $prod_cats_output array
96
  return $prod_cats_output;
97
  }
98
 
 
 
 
 
 
 
 
99
  protected function get_compiled_product_id( $product_id, $product_sku, $options, $channel = '' ) {
 
100
  // depending on setting use product IDs or SKUs
101
  if (0 == $this->options['google']['ads']['product_identifier'] || 'ga_ua' === $channel || 'ga_4' === $channel) {
102
  return (string) $product_id;
114
  }
115
 
116
  protected function get_dyn_r_ids( $product ) {
 
117
  $dyn_r_ids = [
118
  'post_id' => (string) $product->get_id(),
119
  'sku' => (string) $product->get_sku() ? $product->get_sku() : $product->get_id(),
127
  }
128
 
129
  protected function log_problematic_product_id( $product_id = 0 ) {
 
130
  wc_get_logger()->debug(
131
  'WooCommerce detects the page ID ' . $product_id . ' as product, but when invoked by wc_get_product( ' . $product_id . ' ) it returns no product object',
132
  ['source' => 'wpm']
149
 
150
  $dyn_r_ids = $this->get_dyn_r_ids($product);
151
  $product_id_compiled = $dyn_r_ids[$this->get_dyn_r_id_type()];
152
+ // $product_id_compiled = $this->get_compiled_product_id($product_id, $product->get_sku(), $this->options, '');
153
  array_push($order_items_array, $product_id_compiled);
154
  } else {
155
 
161
  }
162
 
163
  protected function get_order_items_formatted_for_purchase_event( $order ) {
 
164
  $order_items = $this->wpm_get_order_items($order);
165
  $order_items_formatted = [];
166
 
176
 
177
  $dyn_r_ids = $this->get_dyn_r_ids($product);
178
  $product_id_compiled = $dyn_r_ids[$this->get_dyn_r_id_type()];
179
+ // $product_id_compiled = $this->get_compiled_product_id($product_id, $product->get_sku(), $this->options, '');
180
 
181
  $product_details['id'] = $product_id_compiled;
182
  $product_details['name'] = $product->get_name();
185
  $product_details['brand'] = $this->get_brand_name($product_id);
186
  $product_details['category'] = implode(',', $this->get_product_category($product_id));
187
 
188
+ // error_log('type: ' . $product->get_type());
189
+
190
  if ($product->is_type('variation')) {
191
  $product_details['variant'] = $this->get_formatted_variant_text($product);
192
 
199
  }
200
 
201
  $order_items_formatted[] = $product_details;
202
+ // array_push($order_items_formatted, $product_details);
203
  } else {
204
 
205
  $this->log_problematic_product_id($product_id);
209
  return $order_items_formatted;
210
  }
211
 
212
+
213
  protected function get_dyn_r_id_type( $pixel_name = null ) {
214
+ // $dyn_r_id_type = '';
215
 
216
  if ($pixel_name) {
217
  $this->pixel_name = $pixel_name;
235
  }
236
 
237
  protected function wpm_get_order_items( $order ) {
 
238
  $order_items = apply_filters_deprecated('wooptpm_order_items', [$order->get_items(), $order], '1.13.0', 'wpm_order_items');
 
 
 
239
  return apply_filters('wpm_order_items', $order_items, $order);
240
  }
241
 
242
  protected function get_front_end_order_items( $order ) {
 
243
  $order_items = $this->wpm_get_order_items($order);
244
  $order_items_formatted = [];
245
 
281
  }
282
 
283
  public function get_product_data_layer_script( $product, $set_position = true, $meta_tag = false ) {
 
284
  if (!is_object($product)) {
285
+
286
+ // $this->log_problematic_product_id();
287
  wc_get_logger()->debug('get_product_data_layer_script received an invalid product', ['source' => 'wpm']);
288
+
289
  return '';
290
  }
291
 
292
  $data = $this->get_product_details_for_datalayer($product);
293
 
294
+ // if placed in <head> it must be a <meta> tag else, it can be an <input> tag
295
+ // $tag = $meta_tag ? "meta" : "input";
296
+ // added name and content to meta in order to pass W3 validation test at https://validator.w3.org/nu/
297
  $tag = $meta_tag ? "meta name='wpm-dataLayer-meta' content='" . $product->get_id() . "'" : "input type='hidden'";
298
 
299
+ // $html = "
300
+ // <$tag class='wpmProductId' data-id='" . $product->get_id() . "'>
301
+ // <script type=\"text/javascript\" data-cfasync=\"false\">
302
+ // window.wpmDataLayer.products = window.wpmDataLayer.products || {};
303
+ // window.wpmDataLayer.products[" . $product->get_id() . "] = " . wp_json_encode($data) . ";";
304
+
305
  $this->get_product_data_layer_script_html_part_1($tag, $product, $data, $set_position, $meta_tag);
306
+
307
+ // $html = '
308
+ // <' . $tag . ' class="wpmProductId" data-id="' . $product->get_id() . '">
309
+ // <script type="text/javascript" data-cfasync="false">
310
+ // window.wpmDataLayer.products = window.wpmDataLayer.products || {};
311
+ // window.wpmDataLayer.products[' . $product->get_id() . '] = ' . wp_json_encode($data) . ';';
312
+
313
+ // if (true === $set_position) {
314
+ //
315
+ //// $html .= "
316
+ //// window.wpmDataLayer.products[{$product->get_id()}]['position'] = window.wpmDataLayer.position++;";
317
+ ////
318
+ // $this->get_product_data_layer_script_html_part_2($product);
319
+ // }
320
+
321
+ // $html .= '</script>';
322
+ // echo '</script>';
323
+
324
+ // return $html;
325
  }
326
 
327
  protected function get_product_data_layer_script_html_part_1( $tag, $product, $data, $set_position, $meta_tag ) {
 
328
  if ($meta_tag) {
329
  ?>
330
  <meta name="pm-dataLayer-meta" content="<?php esc_html_e($product->get_id()); ?>" class="wpmProductId"
343
  <?php $set_position ? $this->get_product_data_layer_script_html_part_2($product) : ''; ?>
344
  </script>
345
  <?php
346
+
347
  }
348
 
349
  protected function get_product_data_layer_script_html_part_2( $product ) {
350
  ?>
351
  window.wpmDataLayer.products[<?php esc_html_e($product->get_id()); ?>]['position'] = window.wpmDataLayer.position++
352
  <?php
353
+
354
  }
355
 
 
356
 
357
+ public function get_product_details_for_datalayer( $product ) {
358
  global $woocommerce_wpml;
359
 
360
  $dyn_r_ids = $this->get_dyn_r_ids($product);
374
  'category' => $this->get_product_category($product->get_id()),
375
  'quantity' => 1,
376
  'dyn_r_ids' => $dyn_r_ids,
377
+ 'isVariable' => $product->get_type() == 'variable',
378
  'isVariation' => false,
379
  ];
380
 
381
+ if ($product->get_type() == 'variation') {
382
 
383
  $parent_product = wc_get_product($product->get_parent_id());
384
  if ($parent_product) {
js/admin/wpm-admin-freemius.p1.min.js CHANGED
@@ -1,2 +1,2 @@
1
- (()=>{var e={92:()=>{!function(){try{new MutationObserver((function(e){e.forEach((function(e){"class"===e.attributeName&&jQuery(e.target).prop(e.attributeName).includes("disabled")&&jQuery(".fs-modal").find(".button-deactivate").removeClass("disabled")}))})).observe(jQuery(".fs-modal").find(".button-deactivate")[0],{attributes:!0})}catch(e){console.error(e)}}()}},t={};function r(o){var a=t[o];if(void 0!==a)return a.exports;var n=t[o]={exports:{}};return e[o](n,n.exports,r),n.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var o in t)r.o(t,o)&&!r.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";r(92)})()})();
2
  //# sourceMappingURL=wpm-admin-freemius.p1.min.js.map
1
+ (()=>{var e={309:()=>{!function(){try{new MutationObserver((function(e){e.forEach((function(e){"class"===e.attributeName&&jQuery(e.target).prop(e.attributeName).includes("disabled")&&jQuery(".fs-modal").find(".button-deactivate").removeClass("disabled")}))})).observe(jQuery(".fs-modal").find(".button-deactivate")[0],{attributes:!0})}catch(e){console.error(e)}}()}},t={};function r(o){var a=t[o];if(void 0!==a)return a.exports;var n=t[o]={exports:{}};return e[o](n,n.exports,r),n.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var o in t)r.o(t,o)&&!r.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";r(309)})()})();
2
  //# sourceMappingURL=wpm-admin-freemius.p1.min.js.map
js/admin/wpm-admin-freemius.p1.min.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"wpm-admin-freemius.p1.min.js","mappings":"sBAAA,WACC,IAEgB,IAAIA,kBAAiB,SAAUC,GAC7CA,EAAUC,SAAQ,SAAUC,GACI,UAA3BA,EAASC,eACSC,OAAOF,EAASG,QAAQC,KAAKJ,EAASC,eACxCI,SAAS,aAC3BH,OAAO,aAAaI,KAAK,sBAAsBC,YAAY,kBAMtDC,QAAQN,OAAO,aAAaI,KAAK,sBAAsB,GAAI,CACnEG,YAAY,IAGZ,MAAOC,GACRC,QAAQD,MAAMA,IAnBhB,KCCIE,EAA2B,GAG/B,SAASC,EAAoBC,GAE5B,IAAIC,EAAeH,EAAyBE,GAC5C,QAAqBE,IAAjBD,EACH,OAAOA,EAAaE,QAGrB,IAAIC,EAASN,EAAyBE,GAAY,CAGjDG,QAAS,IAOV,OAHAE,EAAoBL,GAAUI,EAAQA,EAAOD,QAASJ,GAG/CK,EAAOD,QCpBfJ,EAAoBO,EAAKF,IACxB,IAAIG,EAASH,GAAUA,EAAOI,WAC7B,IAAOJ,EAAiB,QACxB,IAAM,EAEP,OADAL,EAAoBU,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,GCLRR,EAAoBU,EAAI,CAACN,EAASQ,KACjC,IAAI,IAAIC,KAAOD,EACXZ,EAAoBc,EAAEF,EAAYC,KAASb,EAAoBc,EAAEV,EAASS,IAC5EE,OAAOC,eAAeZ,EAASS,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,MCJ3Eb,EAAoBc,EAAI,CAACK,EAAK5B,IAAUwB,OAAOK,UAAUC,eAAeC,KAAKH,EAAK5B,G","sources":["webpack://WooCommerce-Pixel-Manager/./src/js/admin/freemius-keep-deactivate-button-enabled.js","webpack://WooCommerce-Pixel-Manager/webpack/bootstrap","webpack://WooCommerce-Pixel-Manager/webpack/runtime/compat get default export","webpack://WooCommerce-Pixel-Manager/webpack/runtime/define property getters","webpack://WooCommerce-Pixel-Manager/webpack/runtime/hasOwnProperty shorthand"],"sourcesContent":["(function () {\n\ttry {\n\n\t\tlet observer = new MutationObserver(function (mutations) {\n\t\t\tmutations.forEach(function (mutation) {\n\t\t\t\tif (mutation.attributeName === \"class\") {\n\t\t\t\t\tlet attributeValue = jQuery(mutation.target).prop(mutation.attributeName);\n\t\t\t\t\tif (attributeValue.includes('disabled')) {\n\t\t\t\t\t\tjQuery('.fs-modal').find('.button-deactivate').removeClass('disabled');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\n\t\tobserver.observe(jQuery('.fs-modal').find('.button-deactivate')[0], {\n\t\t\tattributes: true\n\t\t});\n\n\t} catch (error) {\n\t\tconsole.error(error);\n\t}\n})();\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))"],"names":["MutationObserver","mutations","forEach","mutation","attributeName","jQuery","target","prop","includes","find","removeClass","observe","attributes","error","console","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","exports","module","__webpack_modules__","n","getter","__esModule","d","a","definition","key","o","Object","defineProperty","enumerable","get","obj","prototype","hasOwnProperty","call"],"sourceRoot":""}
1
+ {"version":3,"file":"wpm-admin-freemius.p1.min.js","mappings":"uBAAA,WACC,IAEgB,IAAIA,kBAAiB,SAAUC,GAC7CA,EAAUC,SAAQ,SAAUC,GACI,UAA3BA,EAASC,eACSC,OAAOF,EAASG,QAAQC,KAAKJ,EAASC,eACxCI,SAAS,aAC3BH,OAAO,aAAaI,KAAK,sBAAsBC,YAAY,kBAMtDC,QAAQN,OAAO,aAAaI,KAAK,sBAAsB,GAAI,CACnEG,YAAY,IAGZ,MAAOC,GACRC,QAAQD,MAAMA,IAnBhB,KCCIE,EAA2B,GAG/B,SAASC,EAAoBC,GAE5B,IAAIC,EAAeH,EAAyBE,GAC5C,QAAqBE,IAAjBD,EACH,OAAOA,EAAaE,QAGrB,IAAIC,EAASN,EAAyBE,GAAY,CAGjDG,QAAS,IAOV,OAHAE,EAAoBL,GAAUI,EAAQA,EAAOD,QAASJ,GAG/CK,EAAOD,QCpBfJ,EAAoBO,EAAKF,IACxB,IAAIG,EAASH,GAAUA,EAAOI,WAC7B,IAAOJ,EAAiB,QACxB,IAAM,EAEP,OADAL,EAAoBU,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,GCLRR,EAAoBU,EAAI,CAACN,EAASQ,KACjC,IAAI,IAAIC,KAAOD,EACXZ,EAAoBc,EAAEF,EAAYC,KAASb,EAAoBc,EAAEV,EAASS,IAC5EE,OAAOC,eAAeZ,EAASS,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,MCJ3Eb,EAAoBc,EAAI,CAACK,EAAK5B,IAAUwB,OAAOK,UAAUC,eAAeC,KAAKH,EAAK5B,G","sources":["webpack://WooCommerce-Pixel-Manager/./src/js/admin/freemius-keep-deactivate-button-enabled.js","webpack://WooCommerce-Pixel-Manager/webpack/bootstrap","webpack://WooCommerce-Pixel-Manager/webpack/runtime/compat get default export","webpack://WooCommerce-Pixel-Manager/webpack/runtime/define property getters","webpack://WooCommerce-Pixel-Manager/webpack/runtime/hasOwnProperty shorthand"],"sourcesContent":["(function () {\n\ttry {\n\n\t\tlet observer = new MutationObserver(function (mutations) {\n\t\t\tmutations.forEach(function (mutation) {\n\t\t\t\tif (mutation.attributeName === \"class\") {\n\t\t\t\t\tlet attributeValue = jQuery(mutation.target).prop(mutation.attributeName);\n\t\t\t\t\tif (attributeValue.includes('disabled')) {\n\t\t\t\t\t\tjQuery('.fs-modal').find('.button-deactivate').removeClass('disabled');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\n\t\tobserver.observe(jQuery('.fs-modal').find('.button-deactivate')[0], {\n\t\t\tattributes: true\n\t\t});\n\n\t} catch (error) {\n\t\tconsole.error(error);\n\t}\n})();\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))"],"names":["MutationObserver","mutations","forEach","mutation","attributeName","jQuery","target","prop","includes","find","removeClass","observe","attributes","error","console","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","exports","module","__webpack_modules__","n","getter","__esModule","d","a","definition","key","o","Object","defineProperty","enumerable","get","obj","prototype","hasOwnProperty","call"],"sourceRoot":""}
js/admin/wpm-admin.p1.min.js CHANGED
@@ -1,2 +1,2 @@
1
- (()=>{var e={684:()=>{jQuery((function(){function e(e,t){e.preventDefault();let n={action:"wpm_dismissed_notice_handler",set:t};jQuery.post(ajaxurl,n,(function(e){})),jQuery(".wpm-rating-success-notice").remove()}jQuery(".wpm-rating-success-notice").show(),jQuery(document).on("click","#wpm-rate-it",(function(t){e(t,"rating_done"),window.open("https://wordpress.org/support/view/plugin-reviews/woocommerce-google-adwords-conversion-tracking-tag?rate=5#postform","_blank").focus()})),jQuery(document).on("click","#wpm-already-did",(function(t){e(t,"rating_done")})),jQuery(document).on("click","#wpm-maybe-later",(function(t){e(t,"later")}))}))},940:()=>{function e(e){jQuery.post(ajaxurl,e,(function(e){location.reload()}))}jQuery((function(){jQuery(document).on("click",".incompatible-plugin-error-dismissal-button",(function(t){t.preventDefault(),e({action:"environment_check_handler",disable_warning:jQuery(this).data("plugin-slug")})})),jQuery(document).on("click","#wpm-wp-rocket-js-concatenation-disable",(function(t){t.preventDefault(),e({action:"environment_check_handler",set:"disable_wp_rocket_javascript_concatenation"})})),jQuery(document).on("click","#wpm-dismiss-wp-rocket-js-concatenation-error",(function(t){t.preventDefault(),e({action:"environment_check_handler",set:"dismiss_wp_rocket_javascript_concatenation_error"})})),jQuery(document).on("click","#wpm-litespeed-inline-js-dom-ready-disable",(function(t){t.preventDefault(),e({action:"environment_check_handler",set:"disable_litespeed_inline_js_dom_ready"})})),jQuery(document).on("click","#wpm-dismiss-litespeed-inline-js-dom-ready-error",(function(t){t.preventDefault(),e({action:"environment_check_handler",set:"dismiss_litespeed_inline_js_dom_ready"})})),jQuery(document).on("click","#wpm-paypal-standard-error-dismissal-button",(function(t){t.preventDefault(),e({action:"environment_check_handler",set:"dismiss_paypal_standard_warning"})}))}))},663:()=>{jQuery((function(){jQuery("#debug-info-button").click((function(){jQuery("#debug-info-textarea").select(),document.execCommand("copy")})),jQuery("#wpm_pro_version_demo").on("click",(function(){jQuery("#submit").click()}))}))},958:()=>{function e(){jQuery("#script-blocker-notice").hide()}e(),jQuery((function(){e()}))},966:()=>{function e(){const e=window.location.search,t=new URLSearchParams(e);return!!t.get("section")&&{section:t.get("section"),subsection:t.get("subsection")}}function t(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const i=window.location.search,s=new URLSearchParams(i);s.delete("section"),s.delete("subsection");let a="section="+e;a+=t?"&subsection="+t:"",history.pushState("","wpm"+e,document.location.pathname+"?page=wpm&"+a),jQuery('input[name ="_wp_http_referer"]').val(n()+"?page=wpm&"+a+"&settings-updated=true")}function n(){return new URL(jQuery("#wp-admin-canonical").attr("href")).pathname}jQuery((function(){let n=[],i={};if(jQuery(".section").closest("tr").hide(),jQuery(".section").each((function(){n.push({slug:jQuery(this).data("sectionSlug"),title:jQuery(this).data("sectionTitle")})})),jQuery(".subsection").each((function(){i[jQuery(this).data("sectionSlug")]=i[jQuery(this).data("sectionSlug")]||[],i[jQuery(this).data("sectionSlug")].push({title:jQuery(this).data("subsectionTitle"),slug:jQuery(this).data("subsectionSlug")})})),n.forEach((function(e){jQuery(".nav-tab-wrapper").append('<a href="#" class="nav-tab" data-section-slug="'+e.slug+'">'+e.title+"</a>")})),jQuery(".nav-tab-wrapper").after(function(e){let t=Object.keys(e),n="";return t.forEach((function(t){n+='<ul class="subnav-tabs" data-section-slug="'+t+'">',e[t].forEach((function(e){n+='<li class="subnav-li subnav-li-inactive" data-subsection-slug="'+e.slug+'">'+e.title+"</li>"})),n+="</ul>"})),n}(i)),jQuery(".nav-tab-wrapper a").on("click",(function(e){e.preventDefault(),jQuery(this).addClass("nav-tab-active").siblings().removeClass("nav-tab-active");let s=jQuery(this).data("section-slug");!function(e,n){jQuery("#wpm_settings_form > h2").nextUntil(".submit").andSelf().hide(),jQuery(".subnav-tabs").hide(),jQuery(".subnav-tabs[data-section-slug="+e+"]").show();let i=n.findIndex((t=>t.slug===e));jQuery("div[data-section-slug="+e+"]").closest("table").prevAll("h2:first").next().nextUntil("h2, .submit").andSelf().show(),t(n[i].slug)}(s,n),s in i&&jQuery("ul[data-section-slug="+s+"]").children(":first").trigger("click")})),jQuery(".subnav-li").on("click",(function(e){var n,i;e.preventDefault(),jQuery(this).addClass("subnav-li-active").removeClass("subnav-li-inactive").siblings().addClass("subnav-li-inactive").removeClass("subnav-li-active"),n=jQuery(this).parent().data("section-slug"),i=jQuery(this).data("subsection-slug"),jQuery("#wpm_settings_form > h2").nextUntil(".submit").andSelf().hide(),jQuery("[data-section-slug="+n+"][data-subsection-slug="+i+"]").closest("tr").siblings().andSelf().hide(),jQuery("[data-section-slug="+n+"][data-subsection-slug="+i+"]").closest("table").show(),jQuery("[data-section-slug="+n+"][data-subsection-slug="+i+"]").closest("tr").nextUntil(jQuery("[data-section-slug="+n+"][data-subsection-slug]").closest("tr")).show(),t(n,i)})),e()){let t=e();jQuery("a[data-section-slug="+t.section+"]").trigger("click"),!1!==t.subsection&&jQuery("ul[data-section-slug="+t.section+"]").children("[data-subsection-slug="+t.subsection+"]").trigger("click")}else jQuery("a[data-section-slug="+n[0].slug+"]").trigger("click")}))}},t={};function n(i){var s=t[i];if(void 0!==s)return s.exports;var a=t[i]={exports:{}};return e[i](a,a.exports,n),a.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";n(684),n(940),n(663),n(958),n(966)})()})();
2
  //# sourceMappingURL=wpm-admin.p1.min.js.map
1
+ (()=>{var e={331:()=>{jQuery((function(){function e(e,t){e.preventDefault();let n={action:"wpm_dismissed_notice_handler",set:t};jQuery.post(ajaxurl,n,(function(e){})),jQuery(".wpm-rating-success-notice").remove()}jQuery(".wpm-rating-success-notice").show(),jQuery(document).on("click","#wpm-rate-it",(function(t){e(t,"rating_done"),window.open("https://wordpress.org/support/view/plugin-reviews/woocommerce-google-adwords-conversion-tracking-tag?rate=5#postform","_blank").focus()})),jQuery(document).on("click","#wpm-already-did",(function(t){e(t,"rating_done")})),jQuery(document).on("click","#wpm-maybe-later",(function(t){e(t,"later")}))}))},178:()=>{function e(e){jQuery.post(ajaxurl,e,(function(e){location.reload()}))}jQuery((function(){jQuery(document).on("click",".incompatible-plugin-error-dismissal-button",(function(t){t.preventDefault(),e({action:"environment_check_handler",disable_warning:jQuery(this).data("plugin-slug")})})),jQuery(document).on("click","#wpm-wp-rocket-js-concatenation-disable",(function(t){t.preventDefault(),e({action:"environment_check_handler",set:"disable_wp_rocket_javascript_concatenation"})})),jQuery(document).on("click","#wpm-dismiss-wp-rocket-js-concatenation-error",(function(t){t.preventDefault(),e({action:"environment_check_handler",set:"dismiss_wp_rocket_javascript_concatenation_error"})})),jQuery(document).on("click","#wpm-litespeed-inline-js-dom-ready-disable",(function(t){t.preventDefault(),e({action:"environment_check_handler",set:"disable_litespeed_inline_js_dom_ready"})})),jQuery(document).on("click","#wpm-dismiss-litespeed-inline-js-dom-ready-error",(function(t){t.preventDefault(),e({action:"environment_check_handler",set:"dismiss_litespeed_inline_js_dom_ready"})})),jQuery(document).on("click","#wpm-paypal-standard-error-dismissal-button",(function(t){t.preventDefault(),e({action:"environment_check_handler",set:"dismiss_paypal_standard_warning"})}))}))},649:()=>{jQuery((function(){jQuery("#debug-info-button").click((function(){jQuery("#debug-info-textarea").select(),document.execCommand("copy")})),jQuery("#wpm_pro_version_demo").on("click",(function(){jQuery("#submit").click()}))}))},740:()=>{function e(){jQuery("#script-blocker-notice").hide()}e(),jQuery((function(){e()}))},110:()=>{function e(){const e=window.location.search,t=new URLSearchParams(e);return!!t.get("section")&&{section:t.get("section"),subsection:t.get("subsection")}}function t(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const i=window.location.search,s=new URLSearchParams(i);s.delete("section"),s.delete("subsection");let a="section="+e;a+=t?"&subsection="+t:"",history.pushState("","wpm"+e,document.location.pathname+"?page=wpm&"+a),jQuery('input[name ="_wp_http_referer"]').val(n()+"?page=wpm&"+a+"&settings-updated=true")}function n(){return new URL(jQuery("#wp-admin-canonical").attr("href")).pathname}jQuery((function(){let n=[],i={};if(jQuery(".section").closest("tr").hide(),jQuery(".section").each((function(){n.push({slug:jQuery(this).data("sectionSlug"),title:jQuery(this).data("sectionTitle")})})),jQuery(".subsection").each((function(){i[jQuery(this).data("sectionSlug")]=i[jQuery(this).data("sectionSlug")]||[],i[jQuery(this).data("sectionSlug")].push({title:jQuery(this).data("subsectionTitle"),slug:jQuery(this).data("subsectionSlug")})})),n.forEach((function(e){jQuery(".nav-tab-wrapper").append('<a href="#" class="nav-tab" data-section-slug="'+e.slug+'">'+e.title+"</a>")})),jQuery(".nav-tab-wrapper").after(function(e){let t=Object.keys(e),n="";return t.forEach((function(t){n+='<ul class="subnav-tabs" data-section-slug="'+t+'">',e[t].forEach((function(e){n+='<li class="subnav-li subnav-li-inactive" data-subsection-slug="'+e.slug+'">'+e.title+"</li>"})),n+="</ul>"})),n}(i)),jQuery(".nav-tab-wrapper a").on("click",(function(e){e.preventDefault(),jQuery(this).addClass("nav-tab-active").siblings().removeClass("nav-tab-active");let s=jQuery(this).data("section-slug");!function(e,n){jQuery("#wpm_settings_form > h2").nextUntil(".submit").andSelf().hide(),jQuery(".subnav-tabs").hide(),jQuery(".subnav-tabs[data-section-slug="+e+"]").show();let i=n.findIndex((t=>t.slug===e));jQuery("div[data-section-slug="+e+"]").closest("table").prevAll("h2:first").next().nextUntil("h2, .submit").andSelf().show(),t(n[i].slug)}(s,n),s in i&&jQuery("ul[data-section-slug="+s+"]").children(":first").trigger("click")})),jQuery(".subnav-li").on("click",(function(e){var n,i;e.preventDefault(),jQuery(this).addClass("subnav-li-active").removeClass("subnav-li-inactive").siblings().addClass("subnav-li-inactive").removeClass("subnav-li-active"),n=jQuery(this).parent().data("section-slug"),i=jQuery(this).data("subsection-slug"),jQuery("#wpm_settings_form > h2").nextUntil(".submit").andSelf().hide(),jQuery("[data-section-slug="+n+"][data-subsection-slug="+i+"]").closest("tr").siblings().andSelf().hide(),jQuery("[data-section-slug="+n+"][data-subsection-slug="+i+"]").closest("table").show(),jQuery("[data-section-slug="+n+"][data-subsection-slug="+i+"]").closest("tr").nextUntil(jQuery("[data-section-slug="+n+"][data-subsection-slug]").closest("tr")).show(),t(n,i)})),e()){let t=e();jQuery("a[data-section-slug="+t.section+"]").trigger("click"),!1!==t.subsection&&jQuery("ul[data-section-slug="+t.section+"]").children("[data-subsection-slug="+t.subsection+"]").trigger("click")}else jQuery("a[data-section-slug="+n[0].slug+"]").trigger("click")}))}},t={};function n(i){var s=t[i];if(void 0!==s)return s.exports;var a=t[i]={exports:{}};return e[i](a,a.exports,n),a.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";n(331),n(178),n(649),n(740),n(110)})()})();
2
  //# sourceMappingURL=wpm-admin.p1.min.js.map
js/public/facebook.js ADDED
@@ -0,0 +1,307 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Add functions for Facebook
3
+ * */
4
+
5
+ (function (wpm, $, undefined) {
6
+
7
+ let fBUserData
8
+
9
+ wpm.loadFacebookPixel = function () {
10
+
11
+ try {
12
+ if (wpmDataLayer?.pixels?.facebook?.pixel_id) {
13
+
14
+ wpmDataLayer.pixels.facebook.loaded = true
15
+
16
+ // @formatter:off
17
+ !function(f,b,e,v,n,t,s)
18
+ {if(f.fbq)return;n=f.fbq=function(){n.callMethod?
19
+ n.callMethod.apply(n,arguments):n.queue.push(arguments)};
20
+ if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0';
21
+ n.queue=[];t=b.createElement(e);t.async=!0;
22
+ t.src=v;s=b.getElementsByTagName(e)[0];
23
+ s.parentNode.insertBefore(t,s)}(window, document,'script',
24
+ 'https://connect.facebook.net/en_US/fbevents.js');
25
+ // @formatter:on
26
+
27
+ fbq("init", wpmDataLayer.pixels.facebook.pixel_id)
28
+ fbq("track", "PageView")
29
+ }
30
+ } catch (e) {
31
+ console.error(e)
32
+ }
33
+ }
34
+
35
+ wpm.getRandomEventId = function () {
36
+ return (Math.random() + 1).toString(36).substring(2)
37
+ }
38
+
39
+ wpm.getFbUserData = function () {
40
+ // We need the first one for InitiateCheckout
41
+ // where getting the user_data from the browser is too slow
42
+ // using wpm.getCookie(), so we cache the user_data earlier.
43
+ // And we need the second one because the ViewContent hit happens too fast
44
+ // after adding a variation to the cart because the function to cache
45
+ // the user_data is too slow. But we can get the user_data using wpm.getCookie()
46
+ // because we don't move away from the page and can wait for the browser
47
+ // to get it.
48
+ if (fBUserData) {
49
+ return fBUserData
50
+ } else {
51
+ return wpm.getFbUserDataFromBrowser()
52
+ }
53
+ }
54
+
55
+ wpm.setFbUserData = function () {
56
+ fBUserData = wpm.getFbUserDataFromBrowser()
57
+ }
58
+
59
+ wpm.getFbUserDataFromBrowser = function () {
60
+ return {
61
+ fbp : wpm.getCookie("_fbp"),
62
+ fbc : wpm.getCookie("_fbc"),
63
+ client_user_agent: navigator.userAgent,
64
+ }
65
+ }
66
+
67
+ wpm.fbViewContent = function (product) {
68
+
69
+ try {
70
+ if (!wpmDataLayer?.pixels?.facebook?.loaded) return
71
+
72
+ let eventId = wpm.getRandomEventId()
73
+
74
+ fbq("track", "ViewContent", {
75
+ content_type: "product",
76
+ content_name: product.name,
77
+ // content_category: product.category,
78
+ content_ids: product.dyn_r_ids[wpmDataLayer.pixels.facebook.dynamic_remarketing.id_type],
79
+ currency : wpmDataLayer.shop.currency,
80
+ value : product.price,
81
+ }, {
82
+ eventID: eventId,
83
+ })
84
+
85
+ product["currency"] = wpmDataLayer.shop.currency
86
+
87
+ jQuery(document).trigger("wpmFbCapiEvent", {
88
+ event_name : "ViewContent",
89
+ event_id : eventId,
90
+ user_data : wpm.getFbUserData(),
91
+ product_data : product,
92
+ product_id : product.dyn_r_ids[wpmDataLayer.pixels.facebook.dynamic_remarketing.id_type],
93
+ event_source_url: window.location.href,
94
+ })
95
+ } catch (e) {
96
+ console.error(e)
97
+ }
98
+ }
99
+
100
+ wpm.facebookContentIds = function () {
101
+ let prodIds = []
102
+
103
+ for (const [key, item] of Object.entries(wpmDataLayer.order.items)) {
104
+
105
+ if (wpmDataLayer?.general?.variationsOutput && 0 !== item.variation_id) {
106
+ prodIds.push(String(wpmDataLayer.products[item.variation_id].dyn_r_ids[wpmDataLayer.pixels.facebook.dynamic_remarketing.id_type]))
107
+ } else {
108
+ prodIds.push(String(wpmDataLayer.products[item.id].dyn_r_ids[wpmDataLayer.pixels.facebook.dynamic_remarketing.id_type]))
109
+ }
110
+ }
111
+
112
+ return prodIds
113
+ }
114
+
115
+ }(window.wpm = window.wpm || {}, jQuery));
116
+
117
+
118
+ /**
119
+ * Execute as soon as possible
120
+ * */
121
+
122
+ (function () {
123
+
124
+ jQuery(document).on("wpmLoadPixels", function () {
125
+
126
+ if (wpm.canIFire("ads", "facebook-ads") && !wpmDataLayer?.pixels?.facebook?.loaded) wpm.loadFacebookPixel()
127
+
128
+ })
129
+
130
+ })()
131
+
132
+
133
+ /**
134
+ * All event listeners
135
+ * */
136
+
137
+ // AddToCart event
138
+ jQuery(document).on("wpmAddToCart", function (event, product) {
139
+
140
+ try {
141
+ if (!wpmDataLayer?.pixels?.facebook?.loaded) return
142
+
143
+ let eventId = wpm.getRandomEventId()
144
+
145
+ // console.log('eventId: ' + eventId);
146
+
147
+ fbq("track", "AddToCart", {
148
+ content_type: "product",
149
+ content_name: product.name,
150
+ content_ids : product.dyn_r_ids[wpmDataLayer.pixels.facebook.dynamic_remarketing.id_type],
151
+ value : parseFloat(product.quantity * product.price),
152
+ currency : product.currency,
153
+ }, {
154
+ eventID: eventId,
155
+ })
156
+
157
+
158
+ product["currency"] = wpmDataLayer.shop.currency
159
+
160
+ jQuery(document).trigger("wpmFbCapiEvent", {
161
+ event_name : "AddToCart",
162
+ event_id : eventId,
163
+ user_data : wpm.getFbUserData(),
164
+ product_data : product,
165
+ product_id : product.dyn_r_ids[wpmDataLayer.pixels.facebook.dynamic_remarketing.id_type],
166
+ event_source_url: window.location.href,
167
+ })
168
+ } catch (e) {
169
+ console.error(e)
170
+ }
171
+ })
172
+
173
+ // InitiateCheckout event
174
+ jQuery(document).on("wpmBeginCheckout", function (event) {
175
+
176
+ try {
177
+ // console.log('firing facebook ads InitiateCheckout event');
178
+
179
+ if (!wpmDataLayer?.pixels?.facebook?.loaded) return
180
+
181
+ let eventId = wpm.getRandomEventId()
182
+
183
+ fbq("track", "InitiateCheckout", {}, {
184
+ eventID: eventId,
185
+ })
186
+
187
+ jQuery(document).trigger("wpmFbCapiEvent", {
188
+ event_name : "InitiateCheckout",
189
+ event_id : eventId,
190
+ user_data : wpm.getFbUserData(),
191
+ event_source_url: window.location.href,
192
+ })
193
+ } catch (e) {
194
+ console.error(e)
195
+ }
196
+ })
197
+
198
+ // AddToWishlist event
199
+ jQuery(document).on("wpmAddToWishlist", function (event, product) {
200
+
201
+ try {
202
+ // console.log('firing facebook ads AddToWishlist event');
203
+ // console.log(product);
204
+
205
+ if (!wpmDataLayer?.pixels?.facebook?.loaded) return
206
+
207
+ let eventId = wpm.getRandomEventId()
208
+
209
+ fbq("track", "AddToWishlist", {
210
+ content_type: "product",
211
+ content_name: product.name,
212
+ content_ids : product.dyn_r_ids[wpmDataLayer.pixels.facebook.dynamic_remarketing.id_type],
213
+ value : parseFloat(product.quantity * product.price),
214
+ currency : product.currency,
215
+ }, {
216
+ eventID: eventId,
217
+ })
218
+
219
+
220
+ product["currency"] = wpmDataLayer.shop.currency
221
+
222
+ jQuery(document).trigger("wpmFbCapiEvent", {
223
+ event_name : "AddToWishlist",
224
+ event_id : eventId,
225
+ user_data : wpm.getFbUserData(),
226
+ product_data : product,
227
+ product_id : product.dyn_r_ids[wpmDataLayer.pixels.facebook.dynamic_remarketing.id_type],
228
+ event_source_url: window.location.href,
229
+ })
230
+ } catch (e) {
231
+ console.error(e)
232
+ }
233
+ })
234
+
235
+ // ViewContent event
236
+ jQuery(document).on("wpmViewItem", function (event, product) {
237
+
238
+ try {
239
+ // console.log('firing facebook ads ViewContent event');
240
+ // console.log(product);
241
+
242
+ if (!wpmDataLayer?.pixels?.facebook?.loaded) return
243
+
244
+ wpm.fbViewContent(product)
245
+ } catch (e) {
246
+ console.error(e)
247
+ }
248
+ })
249
+
250
+ // view search event
251
+ jQuery(document).on("wpmSearch", function () {
252
+
253
+ try {
254
+ if (!wpmDataLayer?.pixels?.facebook?.loaded) return
255
+
256
+ let eventId = wpm.getRandomEventId()
257
+
258
+ fbq("track", "Search", {}, {
259
+ eventID: eventId,
260
+ })
261
+
262
+ jQuery(document).trigger("wpmFbCapiEvent", {
263
+ event_name : "Search",
264
+ event_id : eventId,
265
+ user_data : wpm.getFbUserData(),
266
+ event_source_url: window.location.href,
267
+ })
268
+ } catch (e) {
269
+ console.error(e)
270
+ }
271
+ })
272
+
273
+ // load always event
274
+ jQuery(document).on("wpmLoadAlways", function () {
275
+
276
+ try {
277
+ if (!wpmDataLayer?.pixels?.facebook?.loaded) return
278
+
279
+ wpm.setFbUserData()
280
+ } catch (e) {
281
+ console.error(e)
282
+ }
283
+ })
284
+
285
+ // view order received page event
286
+ // https://developers.pinterest.com/docs/tag/conversion/
287
+ jQuery(document).on("wpmOrderReceivedPage", function () {
288
+
289
+ try {
290
+ if (!wpmDataLayer?.pixels?.facebook?.loaded) return
291
+
292
+ fbq("track", "Purchase",
293
+ {
294
+ content_type: "product",
295
+ value : wpmDataLayer.order.value_filtered,
296
+ currency : wpmDataLayer.order.currency,
297
+ content_ids : wpm.facebookContentIds(),
298
+ },
299
+ {eventID: wpmDataLayer.order.id},
300
+ )
301
+
302
+
303
+ // console.log(wpm.facebookContentIds())
304
+ } catch (e) {
305
+ console.error(e)
306
+ }
307
+ })
js/public/google-ads.js ADDED
@@ -0,0 +1,305 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Add functions for Google Ads
3
+ * */
4
+
5
+ (function (wpm, $, undefined) {
6
+
7
+ let conversionIdentifiers = []
8
+
9
+ wpm.getGoogleAdsConversionIdentifiersWithLabel = function () {
10
+ for (const [key, item] of Object.entries(wpmDataLayer.pixels.google.ads.conversionIds)) {
11
+ conversionIdentifiers.push(key + "/" + item)
12
+ }
13
+ return conversionIdentifiers
14
+ }
15
+
16
+ wpm.getGoogleAdsConversionIdentifiers = function () {
17
+
18
+ let conversionIdentifiers = []
19
+ for (const [key, item] of Object.entries(wpmDataLayer.pixels.google.ads.conversionIds)) {
20
+ conversionIdentifiers.push(key)
21
+ }
22
+
23
+ return conversionIdentifiers
24
+ }
25
+
26
+ wpm.getGoogleAdsRegularOrderItems = function () {
27
+ // "id" : "gla_34",
28
+ // "quantity": 1,
29
+ // "price" : 45
30
+
31
+ let orderItems = []
32
+
33
+ for (const [key, item] of Object.entries(wpmDataLayer.order.items)) {
34
+
35
+ let orderItem
36
+
37
+ orderItem = {
38
+ quantity: item.quantity,
39
+ price : item.price,
40
+ }
41
+
42
+ if (wpmDataLayer?.general?.variationsOutput && 0 !== item.variation_id) {
43
+
44
+ orderItem.id = String(wpmDataLayer.products[item.variation_id].dyn_r_ids[wpmDataLayer.pixels.google.ads.dynamic_remarketing.id_type])
45
+ orderItems.push(orderItem)
46
+ } else {
47
+
48
+ orderItem.id = String(wpmDataLayer.products[item.id].dyn_r_ids[wpmDataLayer.pixels.google.ads.dynamic_remarketing.id_type])
49
+ orderItems.push(orderItem)
50
+ }
51
+ }
52
+
53
+ return orderItems
54
+ }
55
+
56
+ wpm.getGoogleAdsDynamicRemarketingOrderItems = function () {
57
+ // "id" : "gla_34",
58
+ // "quantity" : 1,
59
+ // "price" : 45,
60
+ // "google_business_vertical": "retail"
61
+
62
+ let orderItems = []
63
+
64
+ for (const [key, item] of Object.entries(wpmDataLayer.order.items)) {
65
+
66
+ let orderItem
67
+
68
+ orderItem = {
69
+ quantity : item.quantity,
70
+ price : item.price,
71
+ google_business_vertical: wpmDataLayer.pixels.google.ads.google_business_vertical,
72
+ }
73
+
74
+ if (wpmDataLayer?.general?.variationsOutput && 0 !== item.variation_id) {
75
+
76
+ orderItem.id = String(wpmDataLayer.products[item.variation_id].dyn_r_ids[wpmDataLayer.pixels.google.ads.dynamic_remarketing.id_type])
77
+ orderItems.push(orderItem)
78
+ } else {
79
+
80
+ orderItem.id = String(wpmDataLayer.products[item.id].dyn_r_ids[wpmDataLayer.pixels.google.ads.dynamic_remarketing.id_type])
81
+ orderItems.push(orderItem)
82
+ }
83
+ }
84
+
85
+ return orderItems
86
+ }
87
+
88
+ }(window.wpm = window.wpm || {}, jQuery))
89
+
90
+
91
+ /**
92
+ * All event listeners
93
+ * */
94
+
95
+ // view_item_list event
96
+ jQuery(document).on("wpmViewItemList", function (event, product) {
97
+
98
+ try {
99
+ if(jQuery.isEmptyObject(wpmDataLayer?.pixels?.google?.ads?.conversionIds)) return
100
+ if (!wpmDataLayer?.pixels?.google?.ads?.dynamic_remarketing?.status) return
101
+ if (!wpm.googleConfigConditionsMet("ads")) return
102
+
103
+
104
+ if (
105
+ wpmDataLayer?.general?.variationsOutput &&
106
+ product.isVariable &&
107
+ wpmDataLayer.pixels.google.ads.dynamic_remarketing.send_events_with_parent_ids === false
108
+ ) return
109
+
110
+ // try to prevent that WC sends cached hits to Google
111
+ if (!product) return
112
+
113
+ wpm.gtagLoaded().then(function () {
114
+ gtag("event", "view_item_list", {
115
+ send_to: wpm.getGoogleAdsConversionIdentifiers(),
116
+ items : [{
117
+ id : product.dyn_r_ids[wpmDataLayer.pixels.google.ads.dynamic_remarketing.id_type],
118
+ google_business_vertical: wpmDataLayer.pixels.google.ads.google_business_vertical,
119
+ }],
120
+ })
121
+ })
122
+ } catch (e) {
123
+ console.error(e)
124
+ }
125
+ })
126
+
127
+ // add_to_cart event
128
+ jQuery(document).on("wpmAddToCart", function (event, product) {
129
+
130
+ try {
131
+ if(jQuery.isEmptyObject(wpmDataLayer?.pixels?.google?.ads?.conversionIds)) return
132
+ if (!wpmDataLayer?.pixels?.google?.ads?.dynamic_remarketing?.status) return
133
+ if (!wpm.googleConfigConditionsMet("ads")) return
134
+
135
+ wpm.gtagLoaded().then(function () {
136
+ gtag("event", "add_to_cart", {
137
+ send_to: wpm.getGoogleAdsConversionIdentifiers(),
138
+ value : product.quantity * product.price,
139
+ items : [{
140
+ id : product.dyn_r_ids[wpmDataLayer.pixels.google.ads.dynamic_remarketing.id_type],
141
+ quantity : product.quantity,
142
+ price : product.price,
143
+ google_business_vertical: wpmDataLayer.pixels.google.ads.google_business_vertical,
144
+ }],
145
+ })
146
+ })
147
+ } catch (e) {
148
+ console.error(e)
149
+ }
150
+ })
151
+
152
+ // view_item event
153
+ jQuery(document).on("wpmViewItem", function (event, product) {
154
+
155
+ try {
156
+ if(jQuery.isEmptyObject(wpmDataLayer?.pixels?.google?.ads?.conversionIds)) return
157
+ if (!wpmDataLayer?.pixels?.google?.ads?.dynamic_remarketing?.status) return
158
+ if (!wpm.googleConfigConditionsMet("ads")) return
159
+
160
+
161
+ wpm.gtagLoaded().then(function () {
162
+ gtag("event", "view_item", {
163
+ send_to: wpm.getGoogleAdsConversionIdentifiers(),
164
+ value : (product.quantity ? product.quantity : 1) * product.price,
165
+ items : [{
166
+ id : product.dyn_r_ids[wpmDataLayer.pixels.google.ads.dynamic_remarketing.id_type],
167
+ quantity : (product.quantity ? product.quantity : 1),
168
+ price : product.price,
169
+ google_business_vertical: wpmDataLayer.pixels.google.ads.google_business_vertical,
170
+ }],
171
+ })
172
+ })
173
+ } catch (e) {
174
+ console.error(e)
175
+ }
176
+ })
177
+
178
+
179
+ // view search event
180
+ jQuery(document).on("wpmSearch", function () {
181
+
182
+ try {
183
+ if(jQuery.isEmptyObject(wpmDataLayer?.pixels?.google?.ads?.conversionIds)) return
184
+ if (!wpmDataLayer?.pixels?.google?.ads?.dynamic_remarketing?.status) return
185
+ if (!wpm.googleConfigConditionsMet("ads")) return
186
+
187
+
188
+ let products = []
189
+
190
+ for (const [key, product] of Object.entries(wpmDataLayer.products)) {
191
+
192
+ if (
193
+ wpmDataLayer?.general?.variationsOutput &&
194
+ product.isVariable &&
195
+ wpmDataLayer.pixels.google.ads.dynamic_remarketing.send_events_with_parent_ids === false
196
+ ) return
197
+
198
+ products.push({
199
+ id : product.dyn_r_ids[wpmDataLayer.pixels.google.ads.dynamic_remarketing.id_type],
200
+ google_business_vertical: wpmDataLayer.pixels.google.ads.google_business_vertical,
201
+ })
202
+ }
203
+
204
+ // console.log(products);
205
+
206
+ wpm.gtagLoaded().then(function () {
207
+ gtag("event", "view_search_results", {
208
+ send_to: wpm.getGoogleAdsConversionIdentifiers(),
209
+ // value : 1 * product.price,
210
+ items: products,
211
+ })
212
+ })
213
+ } catch (e) {
214
+ console.error(e)
215
+ }
216
+ })
217
+
218
+
219
+ // view order received page event
220
+ // TODO distinguish with or without cart data active
221
+ jQuery(document).on("wpmOrderReceivedPage", function () {
222
+
223
+ try {
224
+ if(jQuery.isEmptyObject(wpmDataLayer?.pixels?.google?.ads?.conversionIds)) return
225
+ if (!wpmDataLayer?.pixels?.google?.ads?.dynamic_remarketing?.status) return
226
+ if (!wpm.googleConfigConditionsMet("ads")) return
227
+
228
+ wpm.gtagLoaded().then(function () {
229
+ gtag("event", "purchase", {
230
+ send_to: wpm.getGoogleAdsConversionIdentifiers(),
231
+ value : wpmDataLayer.order.value_filtered,
232
+ items : wpm.getGoogleAdsDynamicRemarketingOrderItems(),
233
+ })
234
+ })
235
+
236
+ // console.log(wpm.getGoogleAdsDynamicRemarketingOrderItems())
237
+ } catch (e) {
238
+ console.error(e)
239
+ }
240
+ })
241
+
242
+ // user log in event
243
+ jQuery(document).on("wpmLogin", function () {
244
+
245
+ try {
246
+ if(jQuery.isEmptyObject(wpmDataLayer?.pixels?.google?.ads?.conversionIds)) return
247
+ if (!wpmDataLayer?.pixels?.google?.ads?.dynamic_remarketing?.status) return
248
+ if (!wpm.googleConfigConditionsMet("ads")) return
249
+
250
+
251
+ wpm.gtagLoaded().then(function () {
252
+ gtag("event", "login", {
253
+ send_to: wpm.getGoogleAdsConversionIdentifiers(),
254
+ })
255
+ })
256
+ } catch (e) {
257
+ console.error(e)
258
+ }
259
+ })
260
+
261
+ // view order received page event
262
+ // new_customer parameter: https://support.google.com/google-ads/answer/9917012
263
+ jQuery(document).on("wpmOrderReceivedPage", function () {
264
+
265
+ try {
266
+ if(jQuery.isEmptyObject(wpmDataLayer?.pixels?.google?.ads?.conversionIds)) return
267
+ if (!wpm.googleConfigConditionsMet("ads")) return
268
+
269
+ let data_basic = {}
270
+ let data_with_cart = {}
271
+
272
+ data_basic = {
273
+ send_to : wpm.getGoogleAdsConversionIdentifiersWithLabel(),
274
+ transaction_id: wpmDataLayer.order.number,
275
+ value : wpmDataLayer.order.value_filtered,
276
+ currency : wpmDataLayer.order.currency,
277
+ new_customer : wpmDataLayer.order.new_customer,
278
+ }
279
+
280
+ if (wpmDataLayer?.order?.aw_merchant_id) {
281
+ data_with_cart = {
282
+ discount : wpmDataLayer.order.discount,
283
+ aw_merchant_id : wpmDataLayer.order.aw_merchant_id,
284
+ aw_feed_country : wpmDataLayer.order.aw_feed_country,
285
+ aw_feed_language: wpmDataLayer.order.aw_feed_language,
286
+ items : wpm.getGoogleAdsRegularOrderItems(),
287
+ }
288
+ }
289
+
290
+ wpm.gtagLoaded().then(function () {
291
+ gtag("event", "conversion", {...data_basic, ...data_with_cart})
292
+ })
293
+
294
+ // console.log({...data_basic,...data_with_cart})
295
+
296
+ // console.log(wpm.getGoogleAdsOrderItems())
297
+ } catch (e) {
298
+ console.error(e)
299
+ }
300
+ })
301
+
302
+
303
+
304
+
305
+
js/public/google-ga-4.js ADDED
@@ -0,0 +1,83 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Add functions for Google Analytics 4
3
+ * */
4
+
5
+ (function (wpm, $, undefined) {
6
+
7
+ wpm.getGA4OrderItems = function () {
8
+
9
+ // "item_id" : "34",
10
+ // "item_name" : "Hoodie",
11
+ // "quantity" : 1,
12
+ // "item_brand" : "",
13
+ // "item_variant" : "Color: blue | Logo: yes",
14
+ // "price" : 45,
15
+ // "currency" : "CHF",
16
+ // "item_category": "Hoodies"
17
+
18
+
19
+ let orderItems = []
20
+
21
+ for (const [key, item] of Object.entries(wpmDataLayer.order.items)) {
22
+
23
+ let orderItem
24
+
25
+ orderItem = {
26
+ quantity : item.quantity,
27
+ price : item.price,
28
+ item_name : item.name,
29
+ currency : wpmDataLayer.order.currency,
30
+ item_category: wpmDataLayer.products[item.id].category.join("/"),
31
+ }
32
+
33
+ if (wpmDataLayer?.general?.variationsOutput && 0 !== item.variation_id) {
34
+
35
+ orderItem.item_id = String(wpmDataLayer.products[item.variation_id].dyn_r_ids[wpmDataLayer.pixels.google.analytics.id_type])
36
+ orderItem.item_variant = wpmDataLayer.products[item.variation_id].variant_name
37
+ orderItem.item_brand = wpmDataLayer.products[item.variation_id].brand
38
+ } else {
39
+
40
+ orderItem.item_id = String(wpmDataLayer.products[item.id].dyn_r_ids[wpmDataLayer.pixels.google.analytics.id_type])
41
+ orderItem.item_brand = wpmDataLayer.products[item.id].brand
42
+ }
43
+
44
+ orderItems.push(orderItem)
45
+ }
46
+
47
+ return orderItems
48
+ }
49
+
50
+ }(window.wpm = window.wpm || {}, jQuery))
51
+
52
+
53
+ /**
54
+ * All event listeners
55
+ * */
56
+
57
+
58
+ // view order received page event
59
+ jQuery(document).on("wpmOrderReceivedPage", function () {
60
+
61
+ try {
62
+ if (!wpmDataLayer?.pixels?.google?.analytics?.ga4?.measurement_id) return
63
+ if (wpmDataLayer?.pixels?.google?.analytics?.ga4?.mp_active) return
64
+ if (!wpm.googleConfigConditionsMet("analytics")) return
65
+
66
+ wpm.gtagLoaded().then(function () {
67
+ gtag("event", "purchase", {
68
+ send_to : [wpmDataLayer.pixels.google.analytics.ga4.measurement_id],
69
+ transaction_id: wpmDataLayer.order.number,
70
+ affiliation : wpmDataLayer.order.affiliation,
71
+ currency : wpmDataLayer.order.currency,
72
+ value : wpmDataLayer.order.value_regular,
73
+ discount : wpmDataLayer.order.discount,
74
+ tax : wpmDataLayer.order.tax,
75
+ shipping : wpmDataLayer.order.shipping,
76
+ coupon : wpmDataLayer.order.coupon,
77
+ items : wpm.getGA4OrderItems(),
78
+ })
79
+ })
80
+ } catch (e) {
81
+ console.error(e)
82
+ }
83
+ })
js/public/google-ga-ua.js ADDED
@@ -0,0 +1,88 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Add functions for Google Analytics Universal
3
+ * */
4
+
5
+ (function (wpm, $, undefined) {
6
+
7
+ wpm.getGAUAOrderItems = function () {
8
+
9
+ // "id" : "34",
10
+ // "name" : "Hoodie",
11
+ // "brand" : "",
12
+ // "category" : "Hoodies",
13
+ // "list_position": 1,
14
+ // "price" : 45,
15
+ // "quantity" : 1,
16
+ // "variant" : "Color: blue | Logo: yes"
17
+
18
+
19
+ let orderItems = [],
20
+ list_position = 1
21
+
22
+ for (const [key, item] of Object.entries(wpmDataLayer.order.items)) {
23
+
24
+ let orderItem
25
+
26
+ orderItem = {
27
+ quantity : item.quantity,
28
+ price : item.price,
29
+ name : item.name,
30
+ currency : wpmDataLayer.order.currency,
31
+ category : wpmDataLayer.products[item.id].category.join("/"),
32
+ list_position: list_position,
33
+ }
34
+
35
+ if (wpmDataLayer?.general?.variationsOutput && 0 !== item.variation_id) {
36
+
37
+ orderItem.id = String(wpmDataLayer.products[item.variation_id].dyn_r_ids[wpmDataLayer.pixels.google.analytics.id_type])
38
+ orderItem.variant = wpmDataLayer.products[item.variation_id].variant_name
39
+ orderItem.brand = wpmDataLayer.products[item.variation_id].brand
40
+ } else {
41
+
42
+ orderItem.id = String(wpmDataLayer.products[item.id].dyn_r_ids[wpmDataLayer.pixels.google.analytics.id_type])
43
+ orderItem.brand = wpmDataLayer.products[item.id].brand
44
+ }
45
+
46
+ orderItems.push(orderItem)
47
+ list_position++
48
+ }
49
+
50
+ return orderItems
51
+ }
52
+
53
+ }(window.wpm = window.wpm || {}, jQuery))
54
+
55
+
56
+ /**
57
+ * All event listeners
58
+ * */
59
+
60
+
61
+ // view order received page event
62
+ jQuery(document).on("wpmOrderReceivedPage", function () {
63
+
64
+ try {
65
+ if (!wpmDataLayer?.pixels?.google?.analytics?.universal?.property_id) return
66
+ if (wpmDataLayer?.pixels?.google?.analytics?.universal?.mp_active) return
67
+ if (!wpm.googleConfigConditionsMet("analytics")) return
68
+
69
+ wpm.gtagLoaded().then(function () {
70
+ gtag("event", "purchase", {
71
+ send_to : [wpmDataLayer.pixels.google.analytics.universal.property_id],
72
+ transaction_id: wpmDataLayer.order.number,
73
+ affiliation : wpmDataLayer.order.affiliation,
74
+ currency : wpmDataLayer.order.currency,
75
+ value : wpmDataLayer.order.value_regular,
76
+ discount : wpmDataLayer.order.discount,
77
+ tax : wpmDataLayer.order.tax,
78
+ shipping : wpmDataLayer.order.shipping,
79
+ coupon : wpmDataLayer.order.coupon,
80
+ items : wpm.getGAUAOrderItems(),
81
+ })
82
+ })
83
+
84
+ // console.log(wpm.getGAUAOrderItems())
85
+ } catch (e) {
86
+ console.error(e)
87
+ }
88
+ })
js/public/google-optimize.js ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ (function (wpm, $, undefined) {
2
+
3
+ wpm.load_google_optimize_pixel = function () {
4
+
5
+ try {
6
+ if (wpmDataLayer?.pixels?.google?.optimize?.container_id) {
7
+
8
+ wpmDataLayer.pixels.google.optimize.loaded = true
9
+
10
+ wpm.loadScriptAndCacheIt("https://www.googleoptimize.com/optimize.js?id=" + wpmDataLayer.pixels.google.optimize.container_id)
11
+ // .done(function (script, textStatus) {
12
+ // console.log('Google Optimize loaded')
13
+ // });
14
+ }
15
+ } catch (e) {
16
+ console.error(e)
17
+ }
18
+ }
19
+
20
+ }(window.wpm = window.wpm || {}, jQuery));
21
+
22
+
23
+ (function () {
24
+
25
+ jQuery(document).on("wpmLoadPixels", function () {
26
+
27
+ if (wpm.canIFire("analytics", "google-optimize") && !wpmDataLayer?.pixels?.google?.optimize?.loaded) wpm.load_google_optimize_pixel()
28
+
29
+ })
30
+
31
+ })()
32
+
33
+
34
+
js/public/google.js ADDED
@@ -0,0 +1,279 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Add functions for Google
3
+ * */
4
+
5
+ (function (wpm, $, undefined) {
6
+
7
+ wpm.googleConfigConditionsMet = function (type) {
8
+ // always returns true if Google Consent Mode is active
9
+ if (wpmDataLayer?.pixels?.google?.consent_mode?.active) {
10
+ return true
11
+ } else if (wpm.getConsentValues().mode === "category") {
12
+ return wpm.getConsentValues().categories[type] === true
13
+ } else if (wpm.getConsentValues().mode === "pixel") {
14
+ return wpm.getConsentValues().pixels.includes("google-" + type)
15
+ } else {
16
+ return false
17
+ }
18
+ }
19
+
20
+ wpm.getVisitorConsentStatusAndUpdateGoogleConsentSettings = function (google_consent_settings) {
21
+
22
+ if (wpm.getConsentValues().mode === "category") {
23
+ if (wpm.getConsentValues().categories.analytics) google_consent_settings.analytics_storage = "granted"
24
+ if (wpm.getConsentValues().categories.ads) google_consent_settings.ad_storage = "granted"
25
+ } else if ((wpm.getConsentValues().mode === "pixel")) {
26
+ google_consent_settings.analytics_storage = wpm.getConsentValues().pixels.includes("google-analytics") ? "granted" : "denied"
27
+ google_consent_settings.ad_storage = wpm.getConsentValues().pixels.includes("google-ads") ? "granted" : "denied"
28
+ }
29
+
30
+ return google_consent_settings
31
+ }
32
+
33
+ wpm.updateGoogleConsentMode = function (analytics = true, ads = true) {
34
+
35
+ try {
36
+ if (
37
+ !window.gtag ||
38
+ !wpmDataLayer.shop.cookie_consent_mgmt.explicit_consent
39
+ ) return
40
+
41
+ gtag("consent", "update", {
42
+ analytics_storage: analytics ? "granted" : "denied",
43
+ ad_storage : ads ? "granted" : "denied",
44
+ })
45
+ } catch (e) {
46
+ console.error(e)
47
+ }
48
+ }
49
+
50
+ wpm.fireGtagGoogleAds = function () {
51
+ try {
52
+ wpmDataLayer.pixels.google.ads.state = "loading"
53
+
54
+ if (wpmDataLayer?.pixels?.google?.ads?.enhanced_conversions?.active) {
55
+ for (const [key, item] of Object.entries(wpmDataLayer.pixels.google.ads.conversionIds)) {
56
+ gtag("config", key, {"allow_enhanced_conversions": true})
57
+ }
58
+ } else {
59
+ for (const [key, item] of Object.entries(wpmDataLayer.pixels.google.ads.conversionIds)) {
60
+ gtag("config", key)
61
+ }
62
+ }
63
+
64
+ if (wpmDataLayer?.pixels?.google?.ads?.conversionIds && wpmDataLayer?.pixels?.google?.ads?.phone_conversion_label && wpmDataLayer?.pixels?.google?.ads?.phone_conversion_number) {
65
+ gtag("config", Object.keys(wpmDataLayer.pixels.google.ads.conversionIds)[0] + "/" + wpmDataLayer.pixels.google.ads.phone_conversion_label, {
66
+ phone_conversion_number: wpmDataLayer.pixels.google.ads.phone_conversion_number,
67
+ })
68
+ }
69
+
70
+ // ! enhanced_conversion_data needs to be var
71
+ // https://support.google.com/google-ads/answer/9888145#zippy=%2Cvalidate-your-implementation-using-chrome-developer-tools
72
+ if ("order_received_page" === wpmDataLayer.shop.page_type && wpmDataLayer?.order?.google?.ads?.enhanced_conversion_data) {
73
+ window.enhanced_conversion_data = wpmDataLayer.order.google.ads.enhanced_conversion_data
74
+ }
75
+
76
+ wpmDataLayer.pixels.google.ads.state = "ready"
77
+ } catch (e) {
78
+ console.error(e)
79
+ }
80
+ }
81
+
82
+ wpm.fireGtagGoogleAnalyticsUA = function () {
83
+ try {
84
+ wpmDataLayer.pixels.google.analytics.universal.state = "loading"
85
+
86
+ gtag("config", wpmDataLayer.pixels.google.analytics.universal.property_id, wpmDataLayer.pixels.google.analytics.universal.parameters)
87
+ wpmDataLayer.pixels.google.analytics.universal.state = "ready"
88
+ } catch (e) {
89
+ console.error(e)
90
+ }
91
+ }
92
+
93
+ wpm.fireGtagGoogleAnalyticsGA4 = function () {
94
+ try {
95
+ wpmDataLayer.pixels.google.analytics.ga4.state = "loading"
96
+
97
+ gtag("config", wpmDataLayer.pixels.google.analytics.ga4.measurement_id, wpmDataLayer.pixels.google.analytics.ga4.parameters)
98
+ wpmDataLayer.pixels.google.analytics.ga4.state = "ready"
99
+ } catch (e) {
100
+ console.error(e)
101
+ }
102
+ }
103
+
104
+ wpm.isGoogleActive = function () {
105
+ if (
106
+ wpmDataLayer?.pixels?.google?.analytics?.universal?.property_id ||
107
+ wpmDataLayer?.pixels?.google?.analytics?.ga4?.measurement_id ||
108
+ !jQuery.isEmptyObject(wpmDataLayer?.pixels?.google?.ads?.conversionIds)
109
+ ) {
110
+ return true
111
+ } else {
112
+ return false
113
+ }
114
+ }
115
+
116
+ wpm.getGoogleGtagId = function () {
117
+ if (wpmDataLayer?.pixels?.google?.analytics?.universal?.property_id) {
118
+ return wpmDataLayer.pixels.google.analytics.universal.property_id
119
+ } else if (wpmDataLayer?.pixels?.google?.analytics?.ga4?.measurement_id) {
120
+ return wpmDataLayer.pixels.google.analytics.ga4.measurement_id
121
+ } else {
122
+ return Object.keys(wpmDataLayer.pixels.google.ads.conversionIds)[0]
123
+ }
124
+ }
125
+
126
+ wpm.loadGoogle = function () {
127
+
128
+ if (wpm.isGoogleActive()) {
129
+
130
+ wpmDataLayer.pixels.google.state = "loading"
131
+
132
+ wpm.loadScriptAndCacheIt("https://www.googletagmanager.com/gtag/js?id=" + wpm.getGoogleGtagId())
133
+ .done(function (script, textStatus) {
134
+ try {
135
+ // console.log('Google Optimize loaded')
136
+ // alert('Google Optimize loaded')
137
+
138
+ // Initiate Google dataLayer and gtag
139
+ window.dataLayer = window.dataLayer || []
140
+ window.gtag = function gtag() {
141
+ dataLayer.push(arguments)
142
+ }
143
+
144
+ // Google Consent Mode
145
+ if (wpmDataLayer?.pixels?.google?.consent_mode?.active) {
146
+
147
+ let google_consent_settings = {
148
+ "ad_storage" : wpmDataLayer.pixels.google.consent_mode.ad_storage,
149
+ "analytics_storage": wpmDataLayer.pixels.google.consent_mode.analytics_storage,
150
+ "wait_for_update" : wpmDataLayer.pixels.google.consent_mode.wait_for_update,
151
+ }
152
+
153
+ if (wpmDataLayer?.pixels?.google?.consent_mode?.region) {
154
+ google_consent_settings.region = wpmDataLayer.pixels.google.consent_mode.region
155
+ }
156
+ google_consent_settings = wpm.getVisitorConsentStatusAndUpdateGoogleConsentSettings(google_consent_settings)
157
+
158
+ gtag("consent", "default", google_consent_settings)
159
+ gtag("set", "ads_data_redaction", wpmDataLayer.pixels.google.consent_mode.ads_data_redaction)
160
+ gtag("set", "url_passthrough", wpmDataLayer.pixels.google.consent_mode.url_passthrough)
161
+ }
162
+
163
+ // Google Linker
164
+ // https://developers.google.com/gtagjs/devguide/linker
165
+ if (wpmDataLayer?.pixels?.google?.linker?.settings) {
166
+ gtag("set", "linker", wpmDataLayer.pixels.google.linker.settings)
167
+ }
168
+
169
+ gtag("js", new Date())
170
+
171
+ if (wpm.googleConfigConditionsMet("ads") && !jQuery.isEmptyObject(wpmDataLayer?.pixels?.google?.ads?.conversionIds)) wpm.fireGtagGoogleAds()
172
+ if (wpm.googleConfigConditionsMet("analytics") && wpmDataLayer?.pixels?.google?.analytics?.universal?.property_id) wpm.fireGtagGoogleAnalyticsUA()
173
+ if (wpm.googleConfigConditionsMet("analytics") && wpmDataLayer?.pixels?.google?.analytics?.ga4?.measurement_id) wpm.fireGtagGoogleAnalyticsGA4()
174
+
175
+ wpmDataLayer.pixels.google.state = "ready"
176
+ } catch (e) {
177
+ console.error(e)
178
+ }
179
+ })
180
+ }
181
+ }
182
+
183
+ wpm.canGoogleLoad = function () {
184
+
185
+ if (wpmDataLayer?.pixels?.google?.consent_mode?.active) {
186
+ return true
187
+ } else if ("category" === wpm.getConsentValues().mode) {
188
+ return !!(wpm.getConsentValues().categories["ads"] || wpm.getConsentValues().categories["analytics"])
189
+ } else if ("pixel" === wpm.getConsentValues().mode) {
190
+ return wpm.getConsentValues().pixels.includes("google-ads") || wpm.getConsentValues().pixels.includes("google-analytics")
191
+ } else {
192
+ console.error("Couldn't find a valid load condition for Google mode in wpmConsentValues")
193
+ return false
194
+ }
195
+ }
196
+
197
+ wpm.gtagLoaded = function () {
198
+ return new Promise(function (resolve, reject) {
199
+
200
+ if (typeof wpmDataLayer?.pixels?.google?.state === "undefined") reject()
201
+
202
+ let startTime = 0
203
+ let timeout = 5000
204
+ let frequency = 200;
205
+
206
+ (function wait() {
207
+ if (wpmDataLayer?.pixels?.google?.state === "ready") return resolve()
208
+ if (startTime >= timeout) return reject()
209
+ startTime += frequency
210
+ setTimeout(wait, frequency)
211
+ })()
212
+ })
213
+ }
214
+
215
+ // wpm.gtagLoadednew = function () {
216
+ // return Promise.race([
217
+ // new Promise(function (resolve, reject) {
218
+ //
219
+ // if (typeof wpmDataLayer?.pixels?.google?.state === "undefined") reject();
220
+ //
221
+ //
222
+ // (function wait() {
223
+ // if (wpmDataLayer?.pixels?.google?.state === "ready") return resolve()
224
+ // if (to >= 1000) return reject()
225
+ // setTimeout(wait, 100)
226
+ // })()
227
+ // }),
228
+ // new Promise(function (resolve, reject) {
229
+ // setTimeout(() => reject(), 1000)
230
+ // }),
231
+ // ],
232
+ // )
233
+ // // .then((value) => {console.log("race then value: " + value)})
234
+ // .catch(
235
+ // (value) => {
236
+ // console.log("race catch value: " + value)
237
+ // return Promise.reject()
238
+ // })
239
+ // }
240
+
241
+
242
+ // const promise1 = new Promise((resolve, reject) => {
243
+ // setTimeout(resolve, 500, "one")
244
+ // })
245
+ //
246
+ // const promise2 = new Promise((resolve, reject) => {
247
+ // setTimeout(reject, 100, "two")
248
+ // })
249
+ //
250
+ // let onlyRunIfResolves = function () {
251
+ // return Promise.race([promise1, promise2])
252
+ // .catch(() => {
253
+ // })
254
+ // }
255
+ //
256
+ // onlyRunIfResolves()
257
+ // .then(() => {
258
+ // console.log("running function")
259
+ // })
260
+
261
+
262
+ }(window.wpm = window.wpm || {}, jQuery));
263
+
264
+
265
+ (function () {
266
+
267
+ jQuery(document).on("wpmLoadPixels", function () {
268
+
269
+ if (
270
+ wpm.canGoogleLoad() &&
271
+ (typeof wpmDataLayer?.pixels?.google?.state === "undefined")
272
+ ) {
273
+ wpm.loadGoogle()
274
+ }
275
+ })
276
+
277
+ // return wpmDataLayer?.pixels?.google?.state === "undefined";
278
+
279
+ })()
js/public/hotjar.js ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ (function (wpm, $, undefined) {
2
+
3
+ wpm.load_hotjar_pixel = function () {
4
+
5
+ if (wpmDataLayer?.pixels?.hotjar?.site_id) {
6
+
7
+ // console.log('hotjar loaded');
8
+
9
+ wpmDataLayer.pixels.hotjar.loaded = true;
10
+
11
+ // @formatter:off
12
+ (function(h,o,t,j,a,r){
13
+ h.hj=h.hj||function(){(h.hj.q=h.hj.q||[]).push(arguments)};
14
+ h._hjSettings={hjid:wpmDataLayer.pixels.hotjar.site_id,hjsv:6};
15
+ a=o.getElementsByTagName('head')[0];
16
+ r=o.createElement('script');r.async=1;
17
+ r.src=t+h._hjSettings.hjid+j+h._hjSettings.hjsv;
18
+ a.appendChild(r);
19
+ })(window,document,'https://static.hotjar.com/c/hotjar-','.js?sv=');
20
+ // @formatter:on
21
+
22
+ }
23
+ }
24
+
25
+ }(window.wpm = window.wpm || {}, jQuery));
26
+
27
+
28
+ (function () {
29
+
30
+ jQuery(document).on("wpmLoadPixels", function () {
31
+
32
+ if (wpm.canIFire("analytics", "hotjar") && !wpmDataLayer?.pixels?.hotjar?.loaded) wpm.load_hotjar_pixel()
33
+
34
+ })
35
+
36
+ })()
37
+
38
+
39
+
js/public/main-free.js ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Load all free scripts first
3
+ */
4
+
5
+ require("./wpm")
6
+
7
+ /**
8
+ * Load all free scripts
9
+ */
10
+
11
+ require("./google")
12
+ require("./google-ga-ua")
13
+ require("./google-ga-4")
14
+ require("./google-ads")
15
+ require("./facebook")
16
+ require("./hotjar")
17
+ require("./google-optimize")
18
+
19
+ /**
20
+ * Execute the wpm loader. It makes sure that the script flow gets exectuded correctly, no matter how JS "optimizers" shuffle the code.
21
+ */
22
+
23
+ require("./wpm-loader")
24
+
25
+ // console.log('WooCommerce Pixel Manager free version')
26
+
27
+
js/public/main-premium.js ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // TODO Try using the webpack ignore plugin to remove premium imports during compilation
2
+ // https://webpack.js.org/plugins/ignore-plugin/
3
+ // https://stackoverflow.com/questions/65004054/webpack-ignoreplugin-on-multiple-modules
4
+ // https://stackoverflow.com/questions/61822069/conditional-import-import-if-exists
5
+ // https://stackoverflow.com/questions/36367532/how-can-i-conditionally-import-an-es6-module
6
+
7
+
8
+ // console.log(ENV)
9
+ // if (ENV.tier === 'pro') {
10
+ // console.log('tier')
11
+ // }
12
+
13
+ /**
14
+ * Load all essential scripts first
15
+ */
16
+
17
+ require("./wpm")
18
+ require("./wpm__premium_only")
19
+ require("./google__premium_only")
20
+
21
+ /**
22
+ * Load all free scripts
23
+ */
24
+
25
+ require("./google")
26
+ require("./google-ga-ua")
27
+ require("./google-ga-4")
28
+ require("./google-ads")
29
+ require("./facebook")
30
+ require("./hotjar")
31
+ require("./google-optimize")
32
+
33
+ /**
34
+ * Load all premium scripts
35
+ */
36
+
37
+ require("./google-ga-ua-eec__premium_only")
38
+ require("./google-ga-4-eec__premium_only")
39
+ require("./tiktok__premium_only")
40
+ require("./snapchat__premium_only")
41
+ require("./pinterest__premium_only")
42
+ require("./facebook__premium_only")
43
+ require("./microsoft-ads__premium_only.js")
44
+ require("./twitter__premium_only.js")
45
+ require("./google-ads__premium_only.js")
46
+
47
+
48
+ /**
49
+ * Execute the wpm loader. It makes sure that the script flow gets exectuded correctly, no matter how JS "optimizers" shuffle the code.
50
+ */
51
+
52
+ require("./wpm-loader")
53
+
54
+
55
+ // console.log('WooCommerce Pixel Manager premium version')
56
+
57
+
js/public/main.js ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // TODO Try using the webpack ignore plugin to remove premium imports during compilation
2
+ // https://webpack.js.org/plugins/ignore-plugin/
3
+ // https://stackoverflow.com/questions/65004054/webpack-ignoreplugin-on-multiple-modules
4
+ // https://stackoverflow.com/questions/61822069/conditional-import-import-if-exists
5
+ // https://stackoverflow.com/questions/36367532/how-can-i-conditionally-import-an-es6-module
6
+
7
+ // import wpm from "./wpm.js"
8
+ // import wpm_premium from "./wpm__premium_only.js"
9
+ // import google_premium from "./google__premium_only.js"
10
+
11
+ // require("./wpm.js")
12
+ require("./wpm__premium_only.js")
13
+ require("./google__premium_only.js")
14
+
15
+ // if (ENV.tier === 'pro') {
16
+ // console.log('Yo!')
17
+ //
18
+ // }
19
+
20
+ import google_ads from "./google-ads.js"
21
+ import facebook from "./facebook.js"
22
+ import hotjar from "./hotjar.js"
23
+ import google_optimize from "./google-optimize.js"
24
+
25
+ import google_ga_ua_eec_premium from "./google-ga-ua-eec__premium_only.js"
26
+ import google_ga_4_eec_premium from "./google-ga-4-eec__premium_only.js"
27
+ import tiktok_premium from "./tiktok__premium_only.js"
28
+ import snapchat_premium from "./snapchat__premium_only.js"
29
+ import pinterest_premium from "./pinterest__premium_only.js"
30
+ import facebook_premium from "./facebook__premium_only.js"
31
+
32
+
33
+ // console.log('WooCommerce Pixel Manager premium version')
js/public/wpm-loader.js ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * After wpm is loaded
3
+ * we first check if wpmDataLayer is loaded,
4
+ * and as soon as it is, we load the pixels,
5
+ * and as soon as the page load is complete,
6
+ * we fire the wpmLoad event.
7
+ */
8
+ wpm.wpmDataLayerExists()
9
+ .then(function () {
10
+ jQuery(document).trigger("wpmPreLoadPixels", {})
11
+ })
12
+ .then(function () {
13
+ wpm.pageLoaded().then(function () {
14
+ jQuery(document).trigger("wpmLoad", {})
15
+ })
16
+ })
17
+
js/public/wpm-public.p1.min.js CHANGED
@@ -1,2 +1,2 @@
1
- (()=>{var e={164:()=>{jQuery(document).on("wpmLoadPixels",(function(){var e,t,o,a,r,n;null===(e=wpmDataLayer)||void 0===e||null===(t=e.pixels)||void 0===t||null===(o=t.facebook)||void 0===o||!o.pixel_id||null!==(a=wpmDataLayer)&&void 0!==a&&null!==(r=a.pixels)&&void 0!==r&&null!==(n=r.facebook)&&void 0!==n&&n.loaded||wpm.canIFire("ads","facebook-ads")&&wpm.loadFacebookPixel()})),jQuery(document).on("wpmAddToCart",(function(e,t){try{var o,a,r;if(null===(o=wpmDataLayer)||void 0===o||null===(a=o.pixels)||void 0===a||null===(r=a.facebook)||void 0===r||!r.loaded)return;let e=wpm.getRandomEventId();fbq("track","AddToCart",{content_type:"product",content_name:t.name,content_ids:t.dyn_r_ids[wpmDataLayer.pixels.facebook.dynamic_remarketing.id_type],value:parseFloat(t.quantity*t.price),currency:t.currency},{eventID:e}),t.currency=wpmDataLayer.shop.currency,jQuery(document).trigger("wpmFbCapiEvent",{event_name:"AddToCart",event_id:e,user_data:wpm.getFbUserData(),product_data:t,product_id:t.dyn_r_ids[wpmDataLayer.pixels.facebook.dynamic_remarketing.id_type],event_source_url:window.location.href})}catch(e){console.error(e)}})),jQuery(document).on("wpmBeginCheckout",(function(e){try{var t,o,a;if(null===(t=wpmDataLayer)||void 0===t||null===(o=t.pixels)||void 0===o||null===(a=o.facebook)||void 0===a||!a.loaded)return;let e=wpm.getRandomEventId();fbq("track","InitiateCheckout",{},{eventID:e}),jQuery(document).trigger("wpmFbCapiEvent",{event_name:"InitiateCheckout",event_id:e,user_data:wpm.getFbUserData(),event_source_url:window.location.href})}catch(e){console.error(e)}})),jQuery(document).on("wpmAddToWishlist",(function(e,t){try{var o,a,r;if(null===(o=wpmDataLayer)||void 0===o||null===(a=o.pixels)||void 0===a||null===(r=a.facebook)||void 0===r||!r.loaded)return;let e=wpm.getRandomEventId();fbq("track","AddToWishlist",{content_type:"product",content_name:t.name,content_ids:t.dyn_r_ids[wpmDataLayer.pixels.facebook.dynamic_remarketing.id_type],value:parseFloat(t.quantity*t.price),currency:t.currency},{eventID:e}),t.currency=wpmDataLayer.shop.currency,jQuery(document).trigger("wpmFbCapiEvent",{event_name:"AddToWishlist",event_id:e,user_data:wpm.getFbUserData(),product_data:t,product_id:t.dyn_r_ids[wpmDataLayer.pixels.facebook.dynamic_remarketing.id_type],event_source_url:window.location.href})}catch(e){console.error(e)}})),jQuery(document).on("wpmViewItem",(function(e,t){try{var o,a,r;if(null===(o=wpmDataLayer)||void 0===o||null===(a=o.pixels)||void 0===a||null===(r=a.facebook)||void 0===r||!r.loaded)return;wpm.fbViewContent(t)}catch(e){console.error(e)}})),jQuery(document).on("wpmSearch",(function(){try{var e,t,o;if(null===(e=wpmDataLayer)||void 0===e||null===(t=e.pixels)||void 0===t||null===(o=t.facebook)||void 0===o||!o.loaded)return;let a=wpm.getRandomEventId();fbq("track","Search",{},{eventID:a}),jQuery(document).trigger("wpmFbCapiEvent",{event_name:"Search",event_id:a,user_data:wpm.getFbUserData(),event_source_url:window.location.href})}catch(e){console.error(e)}})),jQuery(document).on("wpmLoadAlways",(function(){try{var e,t,o;if(null===(e=wpmDataLayer)||void 0===e||null===(t=e.pixels)||void 0===t||null===(o=t.facebook)||void 0===o||!o.loaded)return;wpm.setFbUserData()}catch(e){console.error(e)}})),jQuery(document).on("wpmOrderReceivedPage",(function(){try{var e,t,o;if(null===(e=wpmDataLayer)||void 0===e||null===(t=e.pixels)||void 0===t||null===(o=t.facebook)||void 0===o||!o.loaded)return;fbq("track","Purchase",{content_type:"product",value:wpmDataLayer.order.value_filtered,currency:wpmDataLayer.order.currency,content_ids:wpm.facebookContentIds()},{eventID:wpmDataLayer.order.id})}catch(e){console.error(e)}}))},1:()=>{!function(e,t,o){let a;e.loadFacebookPixel=function(){try{wpmDataLayer.pixels.facebook.loaded=!0,e=window,t=document,o="script",e.fbq||(a=e.fbq=function(){a.callMethod?a.callMethod.apply(a,arguments):a.queue.push(arguments)},e._fbq||(e._fbq=a),a.push=a,a.loaded=!0,a.version="2.0",a.queue=[],(r=t.createElement(o)).async=!0,r.src="https://connect.facebook.net/en_US/fbevents.js",(n=t.getElementsByTagName(o)[0]).parentNode.insertBefore(r,n)),fbq("init",wpmDataLayer.pixels.facebook.pixel_id),fbq("track","PageView")}catch(o){console.error(o)}var e,t,o,a,r,n},e.getRandomEventId=function(){return(Math.random()+1).toString(36).substring(2)},e.getFbUserData=function(){return a||e.getFbUserDataFromBrowser()},e.setFbUserData=function(){a=e.getFbUserDataFromBrowser()},e.getFbUserDataFromBrowser=function(){return{fbp:e.getCookie("_fbp"),fbc:e.getCookie("_fbc"),client_user_agent:navigator.userAgent}},e.fbViewContent=function(t){try{var o,a,r;if(null===(o=wpmDataLayer)||void 0===o||null===(a=o.pixels)||void 0===a||null===(r=a.facebook)||void 0===r||!r.loaded)return;let n=e.getRandomEventId();fbq("track","ViewContent",{content_type:"product",content_name:t.name,content_ids:t.dyn_r_ids[wpmDataLayer.pixels.facebook.dynamic_remarketing.id_type],currency:wpmDataLayer.shop.currency,value:t.price},{eventID:n}),t.currency=wpmDataLayer.shop.currency,jQuery(document).trigger("wpmFbCapiEvent",{event_name:"ViewContent",event_id:n,user_data:e.getFbUserData(),product_data:t,product_id:t.dyn_r_ids[wpmDataLayer.pixels.facebook.dynamic_remarketing.id_type],event_source_url:window.location.href})}catch(e){console.error(e)}},e.facebookContentIds=function(){let e=[];for(const[a,r]of Object.entries(wpmDataLayer.order.items)){var t,o;null!==(t=wpmDataLayer)&&void 0!==t&&null!==(o=t.general)&&void 0!==o&&o.variationsOutput&&0!==r.variation_id?e.push(String(wpmDataLayer.products[r.variation_id].dyn_r_ids[wpmDataLayer.pixels.facebook.dynamic_remarketing.id_type])):e.push(String(wpmDataLayer.products[r.id].dyn_r_ids[wpmDataLayer.pixels.facebook.dynamic_remarketing.id_type]))}return e}}(window.wpm=window.wpm||{},jQuery)},12:(e,t,o)=>{o(1),o(164)},165:()=>{jQuery(document).on("wpmViewItemList",(function(e,t){try{var o,a,r,n,i,s,d,l,c,u,p;if(jQuery.isEmptyObject(null===(o=wpmDataLayer)||void 0===o||null===(a=o.pixels)||void 0===a||null===(r=a.google)||void 0===r||null===(n=r.ads)||void 0===n?void 0:n.conversionIds))return;if(null===(i=wpmDataLayer)||void 0===i||null===(s=i.pixels)||void 0===s||null===(d=s.google)||void 0===d||null===(l=d.ads)||void 0===l||null===(c=l.dynamic_remarketing)||void 0===c||!c.status)return;if(!wpm.googleConfigConditionsMet("ads"))return;if(null!==(u=wpmDataLayer)&&void 0!==u&&null!==(p=u.general)&&void 0!==p&&p.variationsOutput&&t.isVariable&&!1===wpmDataLayer.pixels.google.ads.dynamic_remarketing.send_events_with_parent_ids)return;if(!t)return;wpm.gtagLoaded().then((function(){gtag("event","view_item_list",{send_to:wpm.getGoogleAdsConversionIdentifiers(),items:[{id:t.dyn_r_ids[wpmDataLayer.pixels.google.ads.dynamic_remarketing.id_type],google_business_vertical:wpmDataLayer.pixels.google.ads.google_business_vertical}]})}))}catch(e){console.error(e)}})),jQuery(document).on("wpmAddToCart",(function(e,t){try{var o,a,r,n,i,s,d,l,c;if(jQuery.isEmptyObject(null===(o=wpmDataLayer)||void 0===o||null===(a=o.pixels)||void 0===a||null===(r=a.google)||void 0===r||null===(n=r.ads)||void 0===n?void 0:n.conversionIds))return;if(null===(i=wpmDataLayer)||void 0===i||null===(s=i.pixels)||void 0===s||null===(d=s.google)||void 0===d||null===(l=d.ads)||void 0===l||null===(c=l.dynamic_remarketing)||void 0===c||!c.status)return;if(!wpm.googleConfigConditionsMet("ads"))return;wpm.gtagLoaded().then((function(){gtag("event","add_to_cart",{send_to:wpm.getGoogleAdsConversionIdentifiers(),value:t.quantity*t.price,items:[{id:t.dyn_r_ids[wpmDataLayer.pixels.google.ads.dynamic_remarketing.id_type],quantity:t.quantity,price:t.price,google_business_vertical:wpmDataLayer.pixels.google.ads.google_business_vertical}]})}))}catch(e){console.error(e)}})),jQuery(document).on("wpmViewItem",(function(e,t){try{var o,a,r,n,i,s,d,l,c;if(jQuery.isEmptyObject(null===(o=wpmDataLayer)||void 0===o||null===(a=o.pixels)||void 0===a||null===(r=a.google)||void 0===r||null===(n=r.ads)||void 0===n?void 0:n.conversionIds))return;if(null===(i=wpmDataLayer)||void 0===i||null===(s=i.pixels)||void 0===s||null===(d=s.google)||void 0===d||null===(l=d.ads)||void 0===l||null===(c=l.dynamic_remarketing)||void 0===c||!c.status)return;if(!wpm.googleConfigConditionsMet("ads"))return;wpm.gtagLoaded().then((function(){gtag("event","view_item",{send_to:wpm.getGoogleAdsConversionIdentifiers(),value:(t.quantity?t.quantity:1)*t.price,items:[{id:t.dyn_r_ids[wpmDataLayer.pixels.google.ads.dynamic_remarketing.id_type],quantity:t.quantity?t.quantity:1,price:t.price,google_business_vertical:wpmDataLayer.pixels.google.ads.google_business_vertical}]})}))}catch(e){console.error(e)}})),jQuery(document).on("wpmSearch",(function(){try{var e,t,o,a,r,n,i,s,d;if(jQuery.isEmptyObject(null===(e=wpmDataLayer)||void 0===e||null===(t=e.pixels)||void 0===t||null===(o=t.google)||void 0===o||null===(a=o.ads)||void 0===a?void 0:a.conversionIds))return;if(null===(r=wpmDataLayer)||void 0===r||null===(n=r.pixels)||void 0===n||null===(i=n.google)||void 0===i||null===(s=i.ads)||void 0===s||null===(d=s.dynamic_remarketing)||void 0===d||!d.status)return;if(!wpm.googleConfigConditionsMet("ads"))return;let u=[];for(const[e,t]of Object.entries(wpmDataLayer.products)){var l,c;if(null!==(l=wpmDataLayer)&&void 0!==l&&null!==(c=l.general)&&void 0!==c&&c.variationsOutput&&t.isVariable&&!1===wpmDataLayer.pixels.google.ads.dynamic_remarketing.send_events_with_parent_ids)return;u.push({id:t.dyn_r_ids[wpmDataLayer.pixels.google.ads.dynamic_remarketing.id_type],google_business_vertical:wpmDataLayer.pixels.google.ads.google_business_vertical})}wpm.gtagLoaded().then((function(){gtag("event","view_search_results",{send_to:wpm.getGoogleAdsConversionIdentifiers(),items:u})}))}catch(e){console.error(e)}})),jQuery(document).on("wpmOrderReceivedPage",(function(){try{var e,t,o,a,r,n,i,s,d;if(jQuery.isEmptyObject(null===(e=wpmDataLayer)||void 0===e||null===(t=e.pixels)||void 0===t||null===(o=t.google)||void 0===o||null===(a=o.ads)||void 0===a?void 0:a.conversionIds))return;if(null===(r=wpmDataLayer)||void 0===r||null===(n=r.pixels)||void 0===n||null===(i=n.google)||void 0===i||null===(s=i.ads)||void 0===s||null===(d=s.dynamic_remarketing)||void 0===d||!d.status)return;if(!wpm.googleConfigConditionsMet("ads"))return;wpm.gtagLoaded().then((function(){gtag("event","purchase",{send_to:wpm.getGoogleAdsConversionIdentifiers(),value:wpmDataLayer.order.value_filtered,items:wpm.getGoogleAdsDynamicRemarketingOrderItems()})}))}catch(e){console.error(e)}})),jQuery(document).on("wpmLogin",(function(){try{var e,t,o,a,r,n,i,s,d;if(jQuery.isEmptyObject(null===(e=wpmDataLayer)||void 0===e||null===(t=e.pixels)||void 0===t||null===(o=t.google)||void 0===o||null===(a=o.ads)||void 0===a?void 0:a.conversionIds))return;if(null===(r=wpmDataLayer)||void 0===r||null===(n=r.pixels)||void 0===n||null===(i=n.google)||void 0===i||null===(s=i.ads)||void 0===s||null===(d=s.dynamic_remarketing)||void 0===d||!d.status)return;if(!wpm.googleConfigConditionsMet("ads"))return;wpm.gtagLoaded().then((function(){gtag("event","login",{send_to:wpm.getGoogleAdsConversionIdentifiers()})}))}catch(e){console.error(e)}})),jQuery(document).on("wpmOrderReceivedPage",(function(){try{var e,t,o,a,r,n;if(jQuery.isEmptyObject(null===(e=wpmDataLayer)||void 0===e||null===(t=e.pixels)||void 0===t||null===(o=t.google)||void 0===o||null===(a=o.ads)||void 0===a?void 0:a.conversionIds))return;if(!wpm.googleConfigConditionsMet("ads"))return;let i={},s={};i={send_to:wpm.getGoogleAdsConversionIdentifiersWithLabel(),transaction_id:wpmDataLayer.order.number,value:wpmDataLayer.order.value_filtered,currency:wpmDataLayer.order.currency,new_customer:wpmDataLayer.order.new_customer},null!==(r=wpmDataLayer)&&void 0!==r&&null!==(n=r.order)&&void 0!==n&&n.aw_merchant_id&&(s={discount:wpmDataLayer.order.discount,aw_merchant_id:wpmDataLayer.order.aw_merchant_id,aw_feed_country:wpmDataLayer.order.aw_feed_country,aw_feed_language:wpmDataLayer.order.aw_feed_language,items:wpm.getGoogleAdsRegularOrderItems()}),wpm.gtagLoaded().then((function(){gtag("event","conversion",{...i,...s})}))}catch(e){console.error(e)}}))},42:()=>{!function(e,t,o){let a=[];e.getGoogleAdsConversionIdentifiersWithLabel=function(){for(const[e,t]of Object.entries(wpmDataLayer.pixels.google.ads.conversionIds))a.push(e+"/"+t);return a},e.getGoogleAdsConversionIdentifiers=function(){let e=[];for(const[t,o]of Object.entries(wpmDataLayer.pixels.google.ads.conversionIds))e.push(t);return e},e.getGoogleAdsRegularOrderItems=function(){let e=[];for(const[a,r]of Object.entries(wpmDataLayer.order.items)){var t,o;let a;a={quantity:r.quantity,price:r.price},null!==(t=wpmDataLayer)&&void 0!==t&&null!==(o=t.general)&&void 0!==o&&o.variationsOutput&&0!==r.variation_id?(a.id=String(wpmDataLayer.products[r.variation_id].dyn_r_ids[wpmDataLayer.pixels.google.ads.dynamic_remarketing.id_type]),e.push(a)):(a.id=String(wpmDataLayer.products[r.id].dyn_r_ids[wpmDataLayer.pixels.google.ads.dynamic_remarketing.id_type]),e.push(a))}return e},e.getGoogleAdsDynamicRemarketingOrderItems=function(){let e=[];for(const[a,r]of Object.entries(wpmDataLayer.order.items)){var t,o;let a;a={quantity:r.quantity,price:r.price,google_business_vertical:wpmDataLayer.pixels.google.ads.google_business_vertical},null!==(t=wpmDataLayer)&&void 0!==t&&null!==(o=t.general)&&void 0!==o&&o.variationsOutput&&0!==r.variation_id?(a.id=String(wpmDataLayer.products[r.variation_id].dyn_r_ids[wpmDataLayer.pixels.google.ads.dynamic_remarketing.id_type]),e.push(a)):(a.id=String(wpmDataLayer.products[r.id].dyn_r_ids[wpmDataLayer.pixels.google.ads.dynamic_remarketing.id_type]),e.push(a))}return e}}(window.wpm=window.wpm||{},jQuery)},190:(e,t,o)=>{o(42),o(165)},625:()=>{jQuery(document).on("wpmOrderReceivedPage",(function(){try{var e,t,o,a,r,n,i,s,d,l;if(null===(e=wpmDataLayer)||void 0===e||null===(t=e.pixels)||void 0===t||null===(o=t.google)||void 0===o||null===(a=o.analytics)||void 0===a||null===(r=a.universal)||void 0===r||!r.property_id)return;if(null!==(n=wpmDataLayer)&&void 0!==n&&null!==(i=n.pixels)&&void 0!==i&&null!==(s=i.google)&&void 0!==s&&null!==(d=s.analytics)&&void 0!==d&&null!==(l=d.universal)&&void 0!==l&&l.mp_active)return;if(!wpm.googleConfigConditionsMet("analytics"))return;wpm.gtagLoaded().then((function(){gtag("event","purchase",{send_to:[wpmDataLayer.pixels.google.analytics.universal.property_id],transaction_id:wpmDataLayer.order.number,affiliation:wpmDataLayer.order.affiliation,currency:wpmDataLayer.order.currency,value:wpmDataLayer.order.value_regular,discount:wpmDataLayer.order.discount,tax:wpmDataLayer.order.tax,shipping:wpmDataLayer.order.shipping,coupon:wpmDataLayer.order.coupon,items:wpm.getGAUAOrderItems()})}))}catch(e){console.error(e)}}))},19:()=>{!function(e,t,o){e.getGAUAOrderItems=function(){let e=[],t=1;for(const[r,n]of Object.entries(wpmDataLayer.order.items)){var o,a;let r;r={quantity:n.quantity,price:n.price,name:n.name,currency:wpmDataLayer.order.currency,category:wpmDataLayer.products[n.id].category.join("/"),list_position:t},null!==(o=wpmDataLayer)&&void 0!==o&&null!==(a=o.general)&&void 0!==a&&a.variationsOutput&&0!==n.variation_id?(r.id=String(wpmDataLayer.products[n.variation_id].dyn_r_ids[wpmDataLayer.pixels.google.analytics.id_type]),r.variant=wpmDataLayer.products[n.variation_id].variant_name,r.brand=wpmDataLayer.products[n.variation_id].brand):(r.id=String(wpmDataLayer.products[n.id].dyn_r_ids[wpmDataLayer.pixels.google.analytics.id_type]),r.brand=wpmDataLayer.products[n.id].brand),e.push(r),t++}return e}}(window.wpm=window.wpm||{},jQuery)},562:(e,t,o)=>{o(19),o(625)},572:()=>{jQuery(document).on("wpmOrderReceivedPage",(function(){try{var e,t,o,a,r,n,i,s,d,l;if(null===(e=wpmDataLayer)||void 0===e||null===(t=e.pixels)||void 0===t||null===(o=t.google)||void 0===o||null===(a=o.analytics)||void 0===a||null===(r=a.ga4)||void 0===r||!r.measurement_id)return;if(null!==(n=wpmDataLayer)&&void 0!==n&&null!==(i=n.pixels)&&void 0!==i&&null!==(s=i.google)&&void 0!==s&&null!==(d=s.analytics)&&void 0!==d&&null!==(l=d.ga4)&&void 0!==l&&l.mp_active)return;if(!wpm.googleConfigConditionsMet("analytics"))return;wpm.gtagLoaded().then((function(){gtag("event","purchase",{send_to:[wpmDataLayer.pixels.google.analytics.ga4.measurement_id],transaction_id:wpmDataLayer.order.number,affiliation:wpmDataLayer.order.affiliation,currency:wpmDataLayer.order.currency,value:wpmDataLayer.order.value_regular,discount:wpmDataLayer.order.discount,tax:wpmDataLayer.order.tax,shipping:wpmDataLayer.order.shipping,coupon:wpmDataLayer.order.coupon,items:wpm.getGA4OrderItems()})}))}catch(e){console.error(e)}}))},228:()=>{!function(e,t,o){e.getGA4OrderItems=function(){let e=[];for(const[a,r]of Object.entries(wpmDataLayer.order.items)){var t,o;let a;a={quantity:r.quantity,price:r.price,item_name:r.name,currency:wpmDataLayer.order.currency,item_category:wpmDataLayer.products[r.id].category.join("/")},null!==(t=wpmDataLayer)&&void 0!==t&&null!==(o=t.general)&&void 0!==o&&o.variationsOutput&&0!==r.variation_id?(a.item_id=String(wpmDataLayer.products[r.variation_id].dyn_r_ids[wpmDataLayer.pixels.google.analytics.id_type]),a.item_variant=wpmDataLayer.products[r.variation_id].variant_name,a.item_brand=wpmDataLayer.products[r.variation_id].brand):(a.item_id=String(wpmDataLayer.products[r.id].dyn_r_ids[wpmDataLayer.pixels.google.analytics.id_type]),a.item_brand=wpmDataLayer.products[r.id].brand),e.push(a)}return e}}(window.wpm=window.wpm||{},jQuery)},522:(e,t,o)=>{o(228),o(572)},774:(e,t,o)=>{o(562),o(522)},294:()=>{jQuery(document).on("wpmLoadPixels",(function(){var e,t,o;void 0===(null===(e=wpmDataLayer)||void 0===e||null===(t=e.pixels)||void 0===t||null===(o=t.google)||void 0===o?void 0:o.state)&&(wpm.canGoogleLoad()?wpm.loadGoogle():wpm.logPreventedPixelLoading("google","analytics / ads"))}))},860:()=>{!function(e,t,o){e.googleConfigConditionsMet=function(t){var o,a,r,n;return!(null===(o=wpmDataLayer)||void 0===o||null===(a=o.pixels)||void 0===a||null===(r=a.google)||void 0===r||null===(n=r.consent_mode)||void 0===n||!n.active)||("category"===e.getConsentValues().mode?!0===e.getConsentValues().categories[t]:"pixel"===e.getConsentValues().mode&&e.getConsentValues().pixels.includes("google-"+t))},e.getVisitorConsentStatusAndUpdateGoogleConsentSettings=function(t){return"category"===e.getConsentValues().mode?(e.getConsentValues().categories.analytics&&(t.analytics_storage="granted"),e.getConsentValues().categories.ads&&(t.ad_storage="granted")):"pixel"===e.getConsentValues().mode&&(t.analytics_storage=e.getConsentValues().pixels.includes("google-analytics")?"granted":"denied",t.ad_storage=e.getConsentValues().pixels.includes("google-ads")?"granted":"denied"),t},e.updateGoogleConsentMode=function(){let e=!(arguments.length>0&&arguments[0]!==o)||arguments[0],t=!(arguments.length>1&&arguments[1]!==o)||arguments[1];try{if(!window.gtag||!wpmDataLayer.shop.cookie_consent_mgmt.explicit_consent)return;gtag("consent","update",{analytics_storage:e?"granted":"denied",ad_storage:t?"granted":"denied"})}catch(e){console.error(e)}},e.fireGtagGoogleAds=function(){try{var e,t,o,a,r,n,i,s,d,l,c,u,p,g,m,y,w,v,f,_,h;if(wpmDataLayer.pixels.google.ads.state="loading",null!==(e=wpmDataLayer)&&void 0!==e&&null!==(t=e.pixels)&&void 0!==t&&null!==(o=t.google)&&void 0!==o&&null!==(a=o.ads)&&void 0!==a&&null!==(r=a.enhanced_conversions)&&void 0!==r&&r.active)for(const[e,t]of Object.entries(wpmDataLayer.pixels.google.ads.conversionIds))gtag("config",e,{allow_enhanced_conversions:!0});else for(const[e,t]of Object.entries(wpmDataLayer.pixels.google.ads.conversionIds))gtag("config",e);null!==(n=wpmDataLayer)&&void 0!==n&&null!==(i=n.pixels)&&void 0!==i&&null!==(s=i.google)&&void 0!==s&&null!==(d=s.ads)&&void 0!==d&&d.conversionIds&&null!==(l=wpmDataLayer)&&void 0!==l&&null!==(c=l.pixels)&&void 0!==c&&null!==(u=c.google)&&void 0!==u&&null!==(p=u.ads)&&void 0!==p&&p.phone_conversion_label&&null!==(g=wpmDataLayer)&&void 0!==g&&null!==(m=g.pixels)&&void 0!==m&&null!==(y=m.google)&&void 0!==y&&null!==(w=y.ads)&&void 0!==w&&w.phone_conversion_number&&gtag("config",Object.keys(wpmDataLayer.pixels.google.ads.conversionIds)[0]+"/"+wpmDataLayer.pixels.google.ads.phone_conversion_label,{phone_conversion_number:wpmDataLayer.pixels.google.ads.phone_conversion_number}),"order_received_page"===wpmDataLayer.shop.page_type&&null!==(v=wpmDataLayer)&&void 0!==v&&null!==(f=v.order)&&void 0!==f&&null!==(_=f.google)&&void 0!==_&&null!==(h=_.ads)&&void 0!==h&&h.enhanced_conversion_data&&(window.enhanced_conversion_data=wpmDataLayer.order.google.ads.enhanced_conversion_data),wpmDataLayer.pixels.google.ads.state="ready"}catch(e){console.error(e)}},e.fireGtagGoogleAnalyticsUA=function(){try{wpmDataLayer.pixels.google.analytics.universal.state="loading",gtag("config",wpmDataLayer.pixels.google.analytics.universal.property_id,wpmDataLayer.pixels.google.analytics.universal.parameters),wpmDataLayer.pixels.google.analytics.universal.state="ready"}catch(e){console.error(e)}},e.fireGtagGoogleAnalyticsGA4=function(){try{wpmDataLayer.pixels.google.analytics.ga4.state="loading",gtag("config",wpmDataLayer.pixels.google.analytics.ga4.measurement_id,wpmDataLayer.pixels.google.analytics.ga4.parameters),wpmDataLayer.pixels.google.analytics.ga4.state="ready"}catch(e){console.error(e)}},e.isGoogleActive=function(){var e,t,o,a,r,n,i,s,d,l,c,u,p,g;return!(!(null!==(e=wpmDataLayer)&&void 0!==e&&null!==(t=e.pixels)&&void 0!==t&&null!==(o=t.google)&&void 0!==o&&null!==(a=o.analytics)&&void 0!==a&&null!==(r=a.universal)&&void 0!==r&&r.property_id||null!==(n=wpmDataLayer)&&void 0!==n&&null!==(i=n.pixels)&&void 0!==i&&null!==(s=i.google)&&void 0!==s&&null!==(d=s.analytics)&&void 0!==d&&null!==(l=d.ga4)&&void 0!==l&&l.measurement_id)&&jQuery.isEmptyObject(null===(c=wpmDataLayer)||void 0===c||null===(u=c.pixels)||void 0===u||null===(p=u.google)||void 0===p||null===(g=p.ads)||void 0===g?void 0:g.conversionIds))},e.getGoogleGtagId=function(){var e,t,o,a,r,n,i,s,d,l;return null!==(e=wpmDataLayer)&&void 0!==e&&null!==(t=e.pixels)&&void 0!==t&&null!==(o=t.google)&&void 0!==o&&null!==(a=o.analytics)&&void 0!==a&&null!==(r=a.universal)&&void 0!==r&&r.property_id?wpmDataLayer.pixels.google.analytics.universal.property_id:null!==(n=wpmDataLayer)&&void 0!==n&&null!==(i=n.pixels)&&void 0!==i&&null!==(s=i.google)&&void 0!==s&&null!==(d=s.analytics)&&void 0!==d&&null!==(l=d.ga4)&&void 0!==l&&l.measurement_id?wpmDataLayer.pixels.google.analytics.ga4.measurement_id:Object.keys(wpmDataLayer.pixels.google.ads.conversionIds)[0]},e.loadGoogle=function(){e.isGoogleActive()&&(wpmDataLayer.pixels.google.state="loading",e.loadScriptAndCacheIt("https://www.googletagmanager.com/gtag/js?id="+e.getGoogleGtagId()).done((function(t,o){try{var a,r,n,i,s,d,l,c,u,p,g,m,y,w,v,f,_,h,L,D,C,b;if(window.dataLayer=window.dataLayer||[],window.gtag=function(){dataLayer.push(arguments)},null!==(a=wpmDataLayer)&&void 0!==a&&null!==(r=a.pixels)&&void 0!==r&&null!==(n=r.google)&&void 0!==n&&null!==(i=n.consent_mode)&&void 0!==i&&i.active){var x,j,k,I;let t={ad_storage:wpmDataLayer.pixels.google.consent_mode.ad_storage,analytics_storage:wpmDataLayer.pixels.google.consent_mode.analytics_storage,wait_for_update:wpmDataLayer.pixels.google.consent_mode.wait_for_update};null!==(x=wpmDataLayer)&&void 0!==x&&null!==(j=x.pixels)&&void 0!==j&&null!==(k=j.google)&&void 0!==k&&null!==(I=k.consent_mode)&&void 0!==I&&I.region&&(t.region=wpmDataLayer.pixels.google.consent_mode.region),t=e.getVisitorConsentStatusAndUpdateGoogleConsentSettings(t),gtag("consent","default",t),gtag("set","ads_data_redaction",wpmDataLayer.pixels.google.consent_mode.ads_data_redaction),gtag("set","url_passthrough",wpmDataLayer.pixels.google.consent_mode.url_passthrough)}null!==(s=wpmDataLayer)&&void 0!==s&&null!==(d=s.pixels)&&void 0!==d&&null!==(l=d.google)&&void 0!==l&&null!==(c=l.linker)&&void 0!==c&&c.settings&&gtag("set","linker",wpmDataLayer.pixels.google.linker.settings),gtag("js",new Date),jQuery.isEmptyObject(null===(u=wpmDataLayer)||void 0===u||null===(p=u.pixels)||void 0===p||null===(g=p.google)||void 0===g||null===(m=g.ads)||void 0===m?void 0:m.conversionIds)||(e.googleConfigConditionsMet("ads")?e.fireGtagGoogleAds():e.logPreventedPixelLoading("google-ads","ads")),null!==(y=wpmDataLayer)&&void 0!==y&&null!==(w=y.pixels)&&void 0!==w&&null!==(v=w.google)&&void 0!==v&&null!==(f=v.analytics)&&void 0!==f&&null!==(_=f.universal)&&void 0!==_&&_.property_id&&(e.googleConfigConditionsMet("analytics")?e.fireGtagGoogleAnalyticsUA():e.logPreventedPixelLoading("google-universal-analytics","analytics")),null!==(h=wpmDataLayer)&&void 0!==h&&null!==(L=h.pixels)&&void 0!==L&&null!==(D=L.google)&&void 0!==D&&null!==(C=D.analytics)&&void 0!==C&&null!==(b=C.ga4)&&void 0!==b&&b.measurement_id&&(e.googleConfigConditionsMet("analytics")?e.fireGtagGoogleAnalyticsGA4():e.logPreventedPixelLoading("ga4","analytics")),wpmDataLayer.pixels.google.state="ready"}catch(e){console.error(e)}})))},e.canGoogleLoad=function(){var t,o,a,r;return!(null===(t=wpmDataLayer)||void 0===t||null===(o=t.pixels)||void 0===o||null===(a=o.google)||void 0===a||null===(r=a.consent_mode)||void 0===r||!r.active)||("category"===e.getConsentValues().mode?!(!e.getConsentValues().categories.ads&&!e.getConsentValues().categories.analytics):"pixel"===e.getConsentValues().mode?e.getConsentValues().pixels.includes("google-ads")||e.getConsentValues().pixels.includes("google-analytics"):(console.error("Couldn't find a valid load condition for Google mode in wpmConsentValues"),!1))},e.gtagLoaded=function(){return new Promise((function(e,t){var o,a,r;void 0===(null===(o=wpmDataLayer)||void 0===o||null===(a=o.pixels)||void 0===a||null===(r=a.google)||void 0===r?void 0:r.state)&&t();let n=0;!function o(){var a,r,i;return"ready"===(null===(a=wpmDataLayer)||void 0===a||null===(r=a.pixels)||void 0===r||null===(i=r.google)||void 0===i?void 0:i.state)?e():n>=5e3?t():(n+=200,void setTimeout(o,200))}()}))}}(window.wpm=window.wpm||{},jQuery)},580:(e,t,o)=>{o(860),o(294)},69:(e,t,o)=>{o(580),o(190),o(774),o(463)},945:()=>{jQuery(document).on("wpmLoadPixels",(function(){var e,t,o,a,r,n,i,s;null===(e=wpmDataLayer)||void 0===e||null===(t=e.pixels)||void 0===t||null===(o=t.google)||void 0===o||null===(a=o.optimize)||void 0===a||!a.container_id||null!==(r=wpmDataLayer)&&void 0!==r&&null!==(n=r.pixels)&&void 0!==n&&null!==(i=n.google)&&void 0!==i&&null!==(s=i.optimize)&&void 0!==s&&s.loaded||wpm.canIFire("analytics","google-optimize")&&wpm.load_google_optimize_pixel()}))},962:()=>{!function(e,t,o){e.load_google_optimize_pixel=function(){try{wpmDataLayer.pixels.google.optimize.loaded=!0,e.loadScriptAndCacheIt("https://www.googleoptimize.com/optimize.js?id="+wpmDataLayer.pixels.google.optimize.container_id)}catch(e){console.error(e)}}}(window.wpm=window.wpm||{},jQuery)},463:(e,t,o)=>{o(962),o(945)},300:()=>{jQuery(document).on("wpmLoadPixels",(function(){var e,t,o,a,r,n,i,s,d;null===(e=wpmDataLayer)||void 0===e||null===(t=e.pixels)||void 0===t||null===(o=t.hotjar)||void 0===o||!o.site_id||null!==(a=wpmDataLayer)&&void 0!==a&&null!==(r=a.pixels)&&void 0!==r&&null!==(n=r.hotjar)&&void 0!==n&&n.loaded||!wpm.canIFire("analytics","hotjar")||null!==(i=wpmDataLayer)&&void 0!==i&&null!==(s=i.pixels)&&void 0!==s&&null!==(d=s.hotjar)&&void 0!==d&&d.loaded||wpm.load_hotjar_pixel()}))},376:()=>{!function(e,t,o){e.load_hotjar_pixel=function(){try{wpmDataLayer.pixels.hotjar.loaded=!0,e=window,t=document,e.hj=e.hj||function(){(e.hj.q=e.hj.q||[]).push(arguments)},e._hjSettings={hjid:wpmDataLayer.pixels.hotjar.site_id,hjsv:6},o=t.getElementsByTagName("head")[0],(a=t.createElement("script")).async=1,a.src="https://static.hotjar.com/c/hotjar-"+e._hjSettings.hjid+".js?sv="+e._hjSettings.hjsv,o.appendChild(a)}catch(e){console.error(e)}var e,t,o,a}}(window.wpm=window.wpm||{},jQuery)},787:(e,t,o)=>{o(376),o(300)},299:()=>{jQuery(document).on("click",".remove_from_cart_button, .remove",(function(){try{let e=new URL(jQuery(this).attr("href")),t=wpm.getProductIdByCartItemKeyUrl(e);wpm.removeProductFromCart(t)}catch(e){console.error(e)}})),jQuery(document).on("click",".add_to_cart_button:not(.product_type_variable), .ajax_add_to_cart, .single_add_to_cart_button",(function(){try{if("product"===wpmDataLayer.shop.page_type){if(void 0!==jQuery(this).attr("href")&&jQuery(this).attr("href").includes("add-to-cart")){let e=1,t=jQuery(this).data("product_id");wpm.addProductToCart(t,e)}else if("simple"===wpmDataLayer.shop.product_type){let e=Number(jQuery(".input-text.qty").val());e||0===e||(e=1);let t=jQuery(this).val();wpm.addProductToCart(t,e)}else if("variable"===wpmDataLayer.shop.product_type){let e=Number(jQuery(".input-text.qty").val());e||0===e||(e=1);let t=jQuery("[name='variation_id']").val();wpm.addProductToCart(t,e)}else if("grouped"===wpmDataLayer.shop.product_type)jQuery(".woocommerce-grouped-product-list-item").each((function(){let e=Number(jQuery(this).find(".input-text.qty").val());e||0===e||(e=1);let t=jQuery(this).attr("class"),o=wpm.getPostIdFromString(t);wpm.addProductToCart(o,e)}));else if("bundle"===wpmDataLayer.shop.product_type){let e=Number(jQuery(".input-text.qty").val());e||0===e||(e=1);let t=jQuery("input[name=add-to-cart]").val();wpm.addProductToCart(t,e)}}else{let e=1,t=jQuery(this).data("product_id");wpm.addProductToCart(t,e)}}catch(e){console.error(e)}})),jQuery(document).one("click","a:not(.add_to_cart_button, .ajax_add_to_cart, .single_add_to_cart_button)",(function(e){try{if(jQuery(e.target).closest("a").attr("href")){let t=jQuery(e.target).closest("a").attr("href");if(t.includes("add-to-cart=")){let e=t.match(/(add-to-cart=)(\d+)/);e&&wpm.addProductToCart(e[2],1)}}}catch(e){console.error(e)}})),jQuery(document).on("click",".woocommerce-LoopProduct-link, .wc-block-grid__product, .product, .product-small, .type-product",(function(){try{let e=jQuery(this).nextAll(".wpmProductId:first").data("id");if(e){if(e=getIdBasedOndVariationsOutputSetting(e),!e)throw Error("Wasn't able to retrieve a productId");if(wpmDataLayer.products&&wpmDataLayer.products[e]){let t=wpm.getProductDetailsFormattedForEvent(e);jQuery(document).trigger("wpmSelectContentGaUa",t),jQuery(document).trigger("wpmSelectItem",t)}}}catch(e){console.error(e)}})),jQuery(document).one("click",".checkout-button, .cart-checkout-button, .button.checkout",(function(){jQuery(document).trigger("wpmBeginCheckout")})),jQuery(document).on("input","#billing_email",(function(){wpm.isEmail(jQuery(this).val())&&(wpm.fireCheckoutProgress(2),wpm.emailSelected=!0)})),jQuery(document).on("click",".wc_payment_methods",(function(){!1===wpm.paymentMethodSelected&&wpm.fireCheckoutProgress(3),wpm.fireCheckoutOption(3,jQuery("input[name='payment_method']:checked").val()),wpm.paymentMethodSelected=!0})),jQuery(document).one("click","#place_order",(function(){!1===wpm.emailSelected&&wpm.fireCheckoutProgress(2),!1===wpm.paymentMethodSelected&&(wpm.fireCheckoutProgress(3),wpm.fireCheckoutOption(3,jQuery("input[name='payment_method']:checked").val())),wpm.fireCheckoutProgress(4)})),jQuery(document).on("click","[name='update_cart']",(function(){try{jQuery(".cart_item").each((function(){let e=new URL(jQuery(this).find(".product-remove").find("a").attr("href")),t=wpm.getProductIdByCartItemKeyUrl(e),o=jQuery(this).find(".qty").val();0===o?wpm.removeProductFromCart(t):o<wpmDataLayer.cart[t].quantity?wpm.removeProductFromCart(t,wpmDataLayer.cart[t].quantity-o):o>wpmDataLayer.cart[t].quantity&&wpm.addProductToCart(t,o-wpmDataLayer.cart[t].quantity)}))}catch(e){console.error(e),wpm.getCartItemsFromBackend()}})),jQuery(document).on("click",".add_to_wishlist, .wl-add-to",(function(){try{let e;if(jQuery(this).data("productid")?e=jQuery(this).data("productid"):jQuery(this).data("product-id")&&(e=jQuery(this).data("product-id")),!e)throw Error("Wasn't able to retrieve a productId");let t=wpm.getProductDetailsFormattedForEvent(e);jQuery(document).trigger("wpmAddToWishlist",t)}catch(e){console.error(e)}})),jQuery(document).on("updated_cart_totals",(function(){jQuery(document).trigger("wpmViewCart")})),jQuery(".single_variation_wrap").on("show_variation",(function(e,t){try{let e=getIdBasedOndVariationsOutputSetting(t.variation_id);if(!e)throw Error("Wasn't able to retrieve a productId");if(wpmDataLayer.products&&wpmDataLayer.products[e]){let t=wpm.getProductDetailsFormattedForEvent(e);jQuery(document).trigger("wpmViewItem",t)}}catch(e){console.error(e)}})),jQuery(".single_variation_wrap").on("hide_variation",(function(){try{var e,t;let o=jQuery("body").attr("class").match(/(postid-)(\d+)/)[2];if(!o)throw Error("Wasn't able to retrieve a productId");if("variable"===wpmDataLayer.shop.product_type&&null!==(e=wpmDataLayer)&&void 0!==e&&null!==(t=e.general)&&void 0!==t&&t.variationsOutput)for(const[e,t]of Object.entries(wpmDataLayer.products))if("parentId"in t){o=t.id;break}if(wpmDataLayer.products&&wpmDataLayer.products[o]){let e=wpm.getProductDetailsFormattedForEvent(o);jQuery(document).trigger("wpmViewItem",e)}}catch(e){console.error(e)}})),jQuery(window).on("wpmLoad",(function(){try{wpm.doesWooCommerceCartExist()&&wpm.getCartItems()}catch(e){console.error(e)}})),jQuery(window).on("wpmLoad",(function(){wpmDataLayer.products=wpmDataLayer.products||{};let e=wpm.getAddToCartLinkProductIds();wpm.getProductsFromBackend(e)})),jQuery(window).on("wpmLoad",(function(){if(!wpm.getCookie("wpmReferrer"))if(document.referrer){let e=new URL(document.referrer).hostname;e!==window.location.host?wpm.setCookie("wpmReferrer",e):wpm.setCookie("wpmReferrer","")}else wpm.setCookie("wpmReferrer","")})),jQuery(window).on("wpmLoad",(function(){try{var e;if("undefined"!=typeof wpmDataLayer&&(null===(e=wpmDataLayer)||void 0===e||!e.wpmLoadFired)){var t,o;if(jQuery(document).trigger("wpmLoadAlways"),"product"===wpmDataLayer.shop.page_type&&"variable"!==wpmDataLayer.shop.product_type&&wpm.getMainProductIdFromProductPage()){let e=wpm.getProductDataForViewItemEvent(wpm.getMainProductIdFromProductPage());jQuery(document).trigger("wpmViewItem",e)}else"product_category"===wpmDataLayer.shop.page_type?jQuery(document).trigger("wpmCategory"):"search"===wpmDataLayer.shop.page_type?jQuery(document).trigger("wpmSearch"):"cart"===wpmDataLayer.shop.page_type?jQuery(document).trigger("wpmViewCart"):"order_received_page"===wpmDataLayer.shop.page_type&&wpmDataLayer.order?wpm.isOrderIdStored(wpmDataLayer.order.id)||(jQuery(document).trigger("wpmOrderReceivedPage"),wpm.writeOrderIdToStorage(wpmDataLayer.order.id)):jQuery(document).trigger("wpmEverywhereElse");null!==(t=wpmDataLayer)&&void 0!==t&&null!==(o=t.user)&&void 0!==o&&o.id&&!wpm.hasLoginEventFired()&&(jQuery(document).trigger("wpmLogin"),wpm.setLoginEventFired()),wpmDataLayer.wpmLoadFired=!0}}catch(e){console.error(e)}})),jQuery(window).on("wpmPreLoadPixels",(function(){var e,t,o;null!==(e=wpmDataLayer)&&void 0!==e&&null!==(t=e.shop)&&void 0!==t&&null!==(o=t.cookie_consent_mgmt)&&void 0!==o&&o.explicit_consent&&wpm.updateConsentCookieValues(!0),jQuery(document).trigger("wpmLoadPixels",{})}))},584:()=>{!function(e,t,o){const a="_wpm_order_ids",r="_wpm_endpoint_available",n="/wp-json/";function i(){return""!==e.getCookie(a)}e.emailSelected=!1,e.paymentMethodSelected=!1,e.useRestEndpoint=function(){return e.isSessionStorageAvailable()&&e.isRestEndpointAvailable()&&e.isBelowRestErrorThreshold()},e.isBelowRestErrorThreshold=function(){return window.sessionStorage.getItem(0)<=10},e.isRestEndpointAvailable=function(){if(window.sessionStorage.getItem(r))return JSON.parse(window.sessionStorage.getItem(r));e.testEndpoint()},e.isSessionStorageAvailable=function(){return!!window.sessionStorage},e.testEndpoint=function(){let e=arguments.length>0&&arguments[0]!==o?arguments[0]:location.protocol+"//"+location.host+n,t=arguments.length>1&&arguments[1]!==o?arguments[1]:r;jQuery.ajax(e,{type:"HEAD",timeout:1e3,statusCode:{200:function(e){window.sessionStorage.setItem(t,JSON.stringify(!0))},404:function(e){window.sessionStorage.setItem(t,JSON.stringify(!1))},0:function(e){window.sessionStorage.setItem(t,JSON.stringify(!1))}}}).then((e=>{}))},e.isWpmRestEndpointAvailable=function(){let t=arguments.length>0&&arguments[0]!==o?arguments[0]:r;return!!e.getCookie(t)},e.writeOrderIdToStorage=function(t){if(window.Storage)if(null===localStorage.getItem(a)){let e=[];e.push(t),window.localStorage.setItem(a,JSON.stringify(e))}else{let e=JSON.parse(localStorage.getItem(a));e.includes(t)||(e.push(t),window.localStorage.setItem(a,JSON.stringify(e)))}else{let o=new Date;o.setDate(o.getDate()+365);let r=[];i()&&(r=JSON.parse(e.getCookie(a))),r.includes(t)||(r.push(t),document.cookie="_wpm_order_ids="+JSON.stringify(r)+";expires="+o.toUTCString())}"function"==typeof e.storeOrderIdOnServer&&wpmDataLayer.orderDeduplication&&e.storeOrderIdOnServer(t)},e.isOrderIdStored=function(t){return wpmDataLayer.orderDeduplication?window.Storage?null!==localStorage.getItem(a)&&JSON.parse(localStorage.getItem(a)).includes(t):!!i()&&JSON.parse(e.getCookie(a)).includes(t):(console.log("order duplication prevention: off"),!1)},e.isEmail=function(e){return/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(e)},e.removeProductFromCart=function(t){let a=arguments.length>1&&arguments[1]!==o?arguments[1]:null;try{if(!t)throw Error("Wasn't able to retrieve a productId");if(!(t=getIdBasedOndVariationsOutputSetting(t)))throw Error("Wasn't able to retrieve a productId");let o;if(o=null==a?wpmDataLayer.cart[t].quantity:a,wpmDataLayer.cart[t]){let r=e.getProductDetailsFormattedForEvent(t,o);jQuery(document).trigger("wpmRemoveFromCart",r),null==a||wpmDataLayer.cart[t].quantity===a?(delete wpmDataLayer.cart[t],sessionStorage&&sessionStorage.setItem("wpmDataLayerCart",JSON.stringify(wpmDataLayer.cart))):(wpmDataLayer.cart[t].quantity=wpmDataLayer.cart[t].quantity-o,sessionStorage&&sessionStorage.setItem("wpmDataLayerCart",JSON.stringify(wpmDataLayer.cart)))}}catch(e){console.error(e)}},getIdBasedOndVariationsOutputSetting=function(e){try{var t,o;return null!==(t=wpmDataLayer)&&void 0!==t&&null!==(o=t.general)&&void 0!==o&&o.variationsOutput?e:wpmDataLayer.products[e].isVariation?wpmDataLayer.products[e].parentId:e}catch(e){console.error(e)}},e.addProductToCart=function(t,o){try{var a;if(!t)throw Error("Wasn't able to retrieve a productId");if(!(t=getIdBasedOndVariationsOutputSetting(t)))throw Error("Wasn't able to retrieve a productId");if(null!==(a=wpmDataLayer)&&void 0!==a&&a.products[t]){var r;let a=e.getProductDetailsFormattedForEvent(t,o);jQuery(document).trigger("wpmAddToCart",a),null!==(r=wpmDataLayer)&&void 0!==r&&r.cart[t]?wpmDataLayer.cart[t].quantity=wpmDataLayer.cart[t].quantity+o:("cart"in wpmDataLayer||(wpmDataLayer.cart={}),wpmDataLayer.cart[t]=e.getProductDetailsFormattedForEvent(t,o)),sessionStorage&&sessionStorage.setItem("wpmDataLayerCart",JSON.stringify(wpmDataLayer.cart))}}catch(t){console.error(t),e.getCartItemsFromBackend()}},e.getCartItems=function(){sessionStorage?sessionStorage.getItem("wpmDataLayerCart")&&"order_received_page"!==wpmDataLayer.shop.page_type?e.saveCartObjectToDataLayer(JSON.parse(sessionStorage.getItem("wpmDataLayerCart"))):sessionStorage.setItem("wpmDataLayerCart",JSON.stringify({})):e.getCartItemsFromBackend()},e.getCartItemsFromBackend=function(){try{let t={action:"wpm_get_cart_items"};jQuery.ajax({type:"get",dataType:"json",url:e.ajax_url,data:t,success:function(t){t.cart||(t.cart={}),e.saveCartObjectToDataLayer(t.cart),sessionStorage&&sessionStorage.setItem("wpmDataLayerCart",JSON.stringify(t.cart))}})}catch(e){console.error(e)}},e.getProductsFromBackend=function(t){if((t=t.filter((e=>!wpmDataLayer.products.hasOwnProperty(e))))&&0!==t.length)try{let o={action:"wpm_get_product_ids",productIds:t};jQuery.ajax({type:"get",dataType:"json",url:e.ajax_url,data:o,success:function(e){wpmDataLayer.products=Object.assign({},wpmDataLayer.products,e)},error:function(e){console.log(e)}})}catch(e){console.error(e)}},e.saveCartObjectToDataLayer=function(e){wpmDataLayer.cart=e,wpmDataLayer.products=Object.assign({},wpmDataLayer.products,e)},e.fireCheckoutOption=function(e){let t=arguments.length>1&&arguments[1]!==o?arguments[1]:null,a=arguments.length>2&&arguments[2]!==o?arguments[2]:null,r={step:e,checkout_option:t,value:a};jQuery(document).trigger("wpmFireCheckoutOption",r)},e.fireCheckoutProgress=function(e){let t={step:e};jQuery(document).trigger("wpmFireCheckoutProgress",t)},e.getPostIdFromString=function(e){try{return e.match(/(post-)(\d+)/)[2]}catch(e){console.error(e)}},e.triggerViewItemList=function(t){if(!t)throw Error("Wasn't able to retrieve a productId");if(!(t=getIdBasedOndVariationsOutputSetting(t)))throw Error("Wasn't able to retrieve a productId");jQuery(document).trigger("wpmViewItemList",e.getProductDataForViewItemEvent(t))},e.getProductDataForViewItemEvent=function(t){if(!t)throw Error("Wasn't able to retrieve a productId");try{if(wpmDataLayer.products[t])return e.getProductDetailsFormattedForEvent(t)}catch(e){console.error(e)}},e.getMainProductIdFromProductPage=function(){try{return["simple","variable","grouped","composite","bundle"].indexOf(wpmDataLayer.shop.product_type)>=0&&jQuery(".wpmProductId:first").data("id")}catch(e){console.error(e)}},e.viewItemListTriggerTestMode=function(e){jQuery(e).css({position:"relative"}),jQuery(e).append('<div id="viewItemListTriggerOverlay"></div>'),jQuery(e).find("#viewItemListTriggerOverlay").css({"z-index":"10",display:"block",position:"absolute",height:"100%",top:"0",left:"0",right:"0",opacity:wpmDataLayer.viewItemListTrigger.opacity,"background-color":wpmDataLayer.viewItemListTrigger.backgroundColor})},e.getSearchTermFromUrl=function(){try{return new URLSearchParams(window.location.search).get("s")}catch(e){console.error(e)}};let s,d={};e.observerCallback=function(t,o){t.forEach((t=>{try{let a,r=jQuery(t.target).data("ioid");if(a=jQuery(t.target).next(".wpmProductId").length?jQuery(t.target).next(".wpmProductId").data("id"):jQuery(t.target).find(".wpmProductId").data("id"),!a)throw Error("wpmProductId element not found");t.isIntersecting?d[r]=setTimeout((()=>{e.triggerViewItemList(a),wpmDataLayer.viewItemListTrigger.testMode&&e.viewItemListTriggerTestMode(t.target),!1===wpmDataLayer.viewItemListTrigger.repeat&&o.unobserve(t.target)}),wpmDataLayer.viewItemListTrigger.timeout):(clearTimeout(d[r]),wpmDataLayer.viewItemListTrigger.testMode&&jQuery(t.target).find("#viewItemListTriggerOverlay").remove())}catch(e){console.error(e)}}))};let l,c=0;e.startIntersectionObserverToWatch=function(){try{e.urlHasParameter("vildemomode")&&(wpmDataLayer.viewItemListTrigger.testMode=!0),s=new IntersectionObserver(e.observerCallback,{threshold:wpmDataLayer.viewItemListTrigger.threshold}),l=jQuery(".wpmProductId").map((function(e,t){return jQuery(t).parent().hasClass("type-product")||jQuery(t).parent().hasClass("product")||jQuery(t).parent().hasClass("product-item-inner")?jQuery(t).parent():jQuery(t).prev().hasClass("wc-block-grid__product")||jQuery(t).prev().hasClass("product")||jQuery(t).prev().hasClass("product-small")||jQuery(t).prev().hasClass("woocommerce-LoopProduct-link")?jQuery(this).prev():jQuery(t).closest(".product").length?jQuery(t).closest(".product"):void 0})),l.each((function(e,t){jQuery(t[0]).data("ioid",c++),s.observe(t[0])}))}catch(e){console.error(e)}},e.startProductsMutationObserverToWatch=function(){try{let e=jQuery(".wpmProductId:eq(0)").parents().has(jQuery(".wpmProductId:eq(1)").parents()).first();e.length&&u.observe(e[0],{attributes:!0,childList:!0,characterData:!0})}catch(e){console.error(e)}};let u=new MutationObserver((function(e){e.forEach((function(e){let t=e.addedNodes;null!==t&&jQuery(t).each((function(){(jQuery(this).hasClass("type-product")||jQuery(this).hasClass("product-small")||jQuery(this).hasClass("wc-block-grid__product"))&&p(this)&&(jQuery(this).data("ioid",c++),s.observe(this))}))}))})),p=function(e){return!(!jQuery(e).find(".wpmProductId").length&&!jQuery(e).siblings(".wpmProductId").length)};e.setCookie=function(e){let t=arguments.length>1&&arguments[1]!==o?arguments[1]:"",a=arguments.length>2&&arguments[2]!==o?arguments[2]:null;if(a){let o=new Date;o.setTime(o.getTime()+24*a*60*60*1e3);let r="expires="+o.toUTCString();document.cookie=e+"="+t+";"+r+";path=/"}else document.cookie=e+"="+t+";path=/"},e.getCookie=function(e){let t=e+"=",o=decodeURIComponent(document.cookie).split(";");for(let e=0;e<o.length;e++){let a=o[e];for(;" "==a.charAt(0);)a=a.substring(1);if(0==a.indexOf(t))return a.substring(t.length,a.length)}return""},e.getWpmSessionData=function(){if(window.sessionStorage){let e=window.sessionStorage.getItem("_wpm");return null!==e?JSON.parse(e):{}}return{}},e.setWpmSessionData=function(e){window.sessionStorage&&window.sessionStorage.setItem("_wpm",JSON.stringify(e))},e.storeOrderIdOnServer=function(t){try{let o={action:"wpm_purchase_pixels_fired",order_id:t,nonce:e.nonce};jQuery.ajax({type:"post",dataType:"json",url:e.ajax_url,data:o,success:function(e){!1===e.success&&console.log(e)},error:function(e){console.log(e)}})}catch(e){console.error(e)}},e.getProductIdByCartItemKeyUrl=function(e){let t,o=new URLSearchParams(e.search).get("remove_item");return t=0===wpmDataLayer.cartItemKeys[o].variation_id?wpmDataLayer.cartItemKeys[o].product_id:wpmDataLayer.cartItemKeys[o].variation_id,t},e.getAddToCartLinkProductIds=function(){return jQuery("a").map((function(){let e=jQuery(this).attr("href");if(e&&e.includes("?add-to-cart=")){let t=e.match(/(add-to-cart=)(\d+)/);if(t)return t[2]}})).get()},e.getProductDetailsFormattedForEvent=function(e){let t=arguments.length>1&&arguments[1]!==o?arguments[1]:1,a={id:e.toString(),dyn_r_ids:wpmDataLayer.products[e].dyn_r_ids,name:wpmDataLayer.products[e].name,list_name:wpmDataLayer.shop.list_name,brand:wpmDataLayer.products[e].brand,category:wpmDataLayer.products[e].category,variant:wpmDataLayer.products[e].variant,list_position:wpmDataLayer.products[e].position,quantity:t,price:wpmDataLayer.products[e].price,currency:wpmDataLayer.shop.currency,isVariable:wpmDataLayer.products[e].isVariable,isVariation:wpmDataLayer.products[e].isVariation,parentId:wpmDataLayer.products[e].parentId};return a.isVariation&&(a.parentId_dyn_r_ids=wpmDataLayer.products[e].parentId_dyn_r_ids),a},e.setReferrerToCookie=function(){e.getCookie("wpmReferrer")||e.setCookie("wpmReferrer",document.referrer)},e.getReferrerFromCookie=function(){return e.getCookie("wpmReferrer")?e.getCookie("wpmReferrer"):null},e.getClidFromBrowser=function(){let t,a=arguments.length>0&&arguments[0]!==o?arguments[0]:"gclid";return t={gclid:"_gcl_aw",dclid:"_gcl_dc"},e.getCookie(t[a])?e.getCookie(t[a]).match(/(GCL.[\d]*.)(.*)/)[2]:""},e.getUserAgent=function(){return navigator.userAgent},e.getViewPort=function(){return{width:Math.max(document.documentElement.clientWidth||0,window.innerWidth||0),height:Math.max(document.documentElement.clientHeight||0,window.innerHeight||0)}};let g=function(){let t=e.getCookie("cmplz_statistics"),o=e.getCookie("cmplz_marketing");return!(!e.getCookie("cmplz_consent_status")&&!e.getCookie("cmplz_banner-status"))&&{analytics:"allow"===t,ads:"allow"===o,visitorHasChosen:!0}},m=function(){let t=e.getCookie("cookielawinfo-checkbox-analytics")||e.getCookie("cookielawinfo-checkbox-analytiques"),o=e.getCookie("cookielawinfo-checkbox-advertisement")||e.getCookie("cookielawinfo-checkbox-publicite"),a=e.getCookie("CookieLawInfoConsent");return!(!t&&!o)&&{analytics:"yes"===t,ads:"yes"===o,visitorHasChosen:!!a}},y={categories:{},pixels:[],mode:"category",visitorHasChosen:!1};e.getConsentValues=function(){return y},e.setConsentValueCategories=function(){let e=arguments.length>0&&arguments[0]!==o&&arguments[0],t=arguments.length>1&&arguments[1]!==o&&arguments[1];y.categories.analytics=e,y.categories.ads=t},e.updateConsentCookieValues=function(){let t,a=arguments.length>0&&arguments[0]!==o&&arguments[0];if(t=e.getCookie("CookieConsent"))t=decodeURI(t),y.categories.analytics=t.indexOf("statistics:true")>=0,y.categories.ads=t.indexOf("marketing:true")>=0,y.visitorHasChosen=!0;else if(t=e.getCookie("CookieScriptConsent"))t=JSON.parse(t),"reject"===t.action?(y.categories.analytics=!1,y.categories.ads=!1):2===t.categories.length?(y.categories.analytics=!0,y.categories.ads=!0):(y.categories.analytics=t.categories.indexOf("performance")>=0,y.categories.ads=t.categories.indexOf("targeting")>=0),y.visitorHasChosen=!0;else if(t=e.getCookie("borlabs-cookie")){var r,n,i,s,d,l,c,u;t=decodeURI(t),t=JSON.parse(t),y.categories.analytics=!(null===(r=t)||void 0===r||null===(n=r.consents)||void 0===n||!n.statistics),y.categories.ads=!(null===(i=t)||void 0===i||null===(s=i.consents)||void 0===s||!s.marketing),y.visitorHasChosen=!0,y.pixels=[...(null===(d=t)||void 0===d||null===(l=d.consents)||void 0===l?void 0:l.statistics)||[],...(null===(c=t)||void 0===c||null===(u=c.consents)||void 0===u?void 0:u.marketing)||[]],y.mode="pixel"}else(t=g())?(y.categories.analytics=!0===t.analytics,y.categories.ads=!0===t.ads,y.visitorHasChosen=t.visitorHasChosen):(t=e.getCookie("cookie_notice_accepted"))?(y.categories.analytics=!0,y.categories.ads=!0,y.visitorHasChosen=!0):(t=e.getCookie("hu-consent"))?(t=JSON.parse(t),y.categories.analytics=!!t.categories[3],y.categories.ads=!!t.categories[4],y.visitorHasChosen=!0):(t=m())?(y.categories.analytics=!0===t.analytics,y.categories.ads=!0===t.ads,y.visitorHasChosen=!0===t.visitorHasChosen):(t=e.getCookie("moove_gdpr_popup"))?(t=JSON.parse(t),y.categories.analytics="1"===t.thirdparty,y.categories.ads="1"===t.advanced,y.visitorHasChosen=!0):(y.categories.analytics=!a,y.categories.ads=!a)},e.updateConsentCookieValues(),e.setConsentDefaultValuesToExplicit=function(){y.categories={analytics:!1,ads:!1}},e.canIFire=function(t,o){let a;return"category"===y.mode?a=!!y.categories[t]:"pixel"===y.mode?a=y.pixels.includes(o):(console.error("Couldn't find a valid consent mode in wpmConsentValues"),a=!1),!!a||(e.logPreventedPixelLoading(o,t),!1)},e.logPreventedPixelLoading=function(e,t){var o,a,r;null!==(o=wpmDataLayer)&&void 0!==o&&null!==(a=o.shop)&&void 0!==a&&null!==(r=a.cookie_consent_mgmt)&&void 0!==r&&r.explicit_consent?console.log('WooCommerce Pixel Manager: The "'+e+" (category: "+t+')" pixel has not fired because you have not given consent for it yet. (WPM is in explicit consent mode.)'):console.log('WooCommerce Pixel Manager: The "'+e+" (category: "+t+')" pixel has not fired because you have removed consent for this pixel. (WPM is in implicit consent mode.)')},e.scriptTagObserver=new MutationObserver((o=>{o.forEach((o=>{let{addedNodes:a}=o;[...a].forEach((o=>{t(o).data("wpm-cookie-category")&&(e.shouldScriptBeActive(o)?e.unblockScript(o):e.blockScript(o))}))}))})),e.scriptTagObserver.observe(document.head,{childList:!0,subtree:!0}),window.addEventListener("DOMContentLoaded",(()=>e.scriptTagObserver.disconnect())),e.shouldScriptBeActive=function(e){var o,a,r,n;return!((wpmDataLayer.shop.cookie_consent_mgmt.explicit_consent||y.visitorHasChosen)&&("category"!==y.mode||!t(e).data("wpm-cookie-category").split(",").some((e=>y.categories[e])))&&("pixel"!==y.mode||!y.pixels.includes(t(e).data("wpm-pixel-name")))&&("pixel"!==y.mode||"google"!==t(e).data("wpm-pixel-name")||!["google-analytics","google-ads"].some((e=>y.pixels.includes(e))))&&(null===(o=wpmDataLayer)||void 0===o||null===(a=o.pixels)||void 0===a||null===(r=a.google)||void 0===r||null===(n=r.consent_mode)||void 0===n||!n.active||"google"!==t(e).data("wpm-pixel-name")))},e.unblockScript=function(e){let a=arguments.length>1&&arguments[1]!==o&&arguments[1];a&&t(e).remove();let r=t(e).data("wpm-src");r&&t(e).attr("src",r),e.type="text/javascript",a&&t(e).appendTo("head"),jQuery(document).trigger("wpmPreLoadPixels",{})},e.blockScript=function(e){let a=arguments.length>1&&arguments[1]!==o&&arguments[1];a&&t(e).remove(),t(e).attr("src")&&t(e).removeAttr("src"),e.type="blocked/javascript",a&&t(e).appendTo("head")},e.unblockAllScripts=function(){let a=!(arguments.length>0&&arguments[0]!==o)||arguments[0],r=!(arguments.length>1&&arguments[1]!==o)||arguments[1];t.each(t('script[type="blocked/javascript"]'),(function(o,n){(t(n).data("wpm-cookie-category").includes("analytics")&&a||t(n).data("wpm-cookie-category").includes("ads")&&r)&&e.unblockScript(n,!0)})),jQuery(document).trigger("wpmPreLoadPixels",{})},e.unblockSelectedPixels=function(){t.each(t('script[type="blocked/javascript"]'),(function(o,a){(y.pixels.includes(t(a).data("wpm-pixel-name"))||"google"===t(a).data("wpm-pixel-name")&&["google-analytics","google-ads"].some((e=>y.pixels.includes(e))))&&e.unblockScript(a,!0)})),jQuery(document).trigger("wpmPreLoadPixels",{})},window.addEventListener("borlabs-cookie-consent-saved",(function(){e.updateConsentCookieValues(),"pixel"===y.mode?(e.unblockSelectedPixels(),e.updateGoogleConsentMode(y.pixels.includes("google-analytics"),y.pixels.includes("google-ads"))):(e.unblockAllScripts(y.categories.analytics,y.categories.ads),e.updateGoogleConsentMode(y.categories.analytics,y.categories.ads))})),window.addEventListener("CookiebotOnAccept",(function(){Cookiebot.consent.statistics&&(y.categories.analytics=!0),Cookiebot.consent.marketing&&(y.categories.ads=!0),e.unblockAllScripts(y.categories.analytics,y.categories.ads),e.updateGoogleConsentMode(y.categories.analytics,y.categories.ads)}),!1),window.addEventListener("CookieScriptAccept",(function(t){t.detail.categories.includes("performance")&&(y.categories.analytics=!0),t.detail.categories.includes("targeting")&&(y.categories.ads=!0),e.unblockAllScripts(y.categories.analytics,y.categories.ads),e.updateGoogleConsentMode(y.categories.analytics,y.categories.ads)})),window.addEventListener("CookieScriptAcceptAll",(function(){e.unblockAllScripts(!0,!0),e.updateGoogleConsentMode(!0,!0)})),document.addEventListener("cmplzStatusChange",(function(){e.updateConsentCookieValues(),e.unblockAllScripts(y.categories.analytics,y.categories.ads),e.updateGoogleConsentMode(y.categories.analytics,y.categories.ads)})),document.addEventListener("setCookieNotice",(function(){e.updateConsentCookieValues(),e.unblockAllScripts(y.categories.analytics,y.categories.ads),e.updateGoogleConsentMode(y.categories.analytics,y.categories.ads)})),e.huObserver=new MutationObserver((function(t){t.forEach((t=>{let{addedNodes:o}=t;[...o].forEach((t=>{"hu"===t.id&&jQuery(".hu-cookies-save").on("click",(function(){e.updateConsentCookieValues(),e.unblockAllScripts(y.categories.analytics,y.categories.ads),e.updateGoogleConsentMode(y.categories.analytics,y.categories.ads)}))}))}))})),window.hu&&e.huObserver.observe(document.documentElement||document.body,{childList:!0,subtree:!0}),e.version=function(){console.log(wpmDataLayer.version)},e.loadScriptAndCacheIt=function(e,t){return t=jQuery.extend(t||{},{dataType:"script",cache:!0,url:e}),jQuery.ajax(t)},e.getOrderItemPrice=function(e){return(e.total+e.total_tax)/e.quantity},e.hasLoginEventFired=function(){let t=e.getWpmSessionData();return null==t?void 0:t.loginEventFired},e.setLoginEventFired=function(){let t=e.getWpmSessionData();t.loginEventFired=!0,e.setWpmSessionData(t)},e.wpmDataLayerExists=function(){return new Promise((function(e){!function t(){if("undefined"!=typeof wpmDataLayer)return e();setTimeout(t,50)}()}))},e.jQueryExists=function(){return new Promise((function(e){!function t(){if("undefined"!=typeof jQuery)return e();setTimeout(t,100)}()}))},e.pageLoaded=function(){return new Promise((function(e){!function t(){if("complete"===document.readyState)return e();setTimeout(t,50)}()}))},e.pageReady=function(){return new Promise((function(e){!function t(){if("interactive"===document.readyState||"complete"===document.readyState)return e();setTimeout(t,50)}()}))},e.isMiniCartActive=function(){if(window.sessionStorage){for(const[e,t]of Object.entries(window.sessionStorage))if(e.includes("wc_fragments"))return!0;return!1}return!1},e.doesWooCommerceCartExist=function(){return document.cookie.includes("woocommerce_items_in_cart")},e.urlHasParameter=function(e){return new URLSearchParams(window.location.search).has(e)},window.wpmLoaded={}}(window.wpm=window.wpm||{},jQuery)},534:(e,t,o)=>{o(584)},207:()=>{wpm.wpmDataLayerExists().then((function(){console.log("WooCommerce Pixel Manager: "+(wpmDataLayer.version.pro?"Pro":"Free")+" Version "+wpmDataLayer.version.number+" loaded"),jQuery(document).trigger("wpmPreLoadPixels",{})})).then((function(){wpm.pageLoaded().then((function(){jQuery(document).trigger("wpmLoad",{})}))})),wpm.pageReady().then((function(){wpm.wpmDataLayerExists().then((function(){wpm.startIntersectionObserverToWatch(),wpm.startProductsMutationObserverToWatch()}))}))}},t={};function o(a){var r=t[a];if(void 0!==r)return r.exports;var n=t[a]={exports:{}};return e[a](n,n.exports,o),n.exports}o(534),wpm.jQueryExists().then((function(){o(299),o(69),o(12),o(787),o(207)}))})();
2
  //# sourceMappingURL=wpm-public.p1.min.js.map
1
+ (()=>{var e={785:()=>{!function(e,t,o){let a;e.loadFacebookPixel=function(){try{var e,t,o;null!==(e=wpmDataLayer)&&void 0!==e&&null!==(t=e.pixels)&&void 0!==t&&null!==(o=t.facebook)&&void 0!==o&&o.pixel_id&&(wpmDataLayer.pixels.facebook.loaded=!0,a=window,r=document,n="script",a.fbq||(i=a.fbq=function(){i.callMethod?i.callMethod.apply(i,arguments):i.queue.push(arguments)},a._fbq||(a._fbq=i),i.push=i,i.loaded=!0,i.version="2.0",i.queue=[],(s=r.createElement(n)).async=!0,s.src="https://connect.facebook.net/en_US/fbevents.js",(d=r.getElementsByTagName(n)[0]).parentNode.insertBefore(s,d)),fbq("init",wpmDataLayer.pixels.facebook.pixel_id),fbq("track","PageView"))}catch(n){console.error(n)}var a,r,n,i,s,d},e.getRandomEventId=function(){return(Math.random()+1).toString(36).substring(2)},e.getFbUserData=function(){return a||e.getFbUserDataFromBrowser()},e.setFbUserData=function(){a=e.getFbUserDataFromBrowser()},e.getFbUserDataFromBrowser=function(){return{fbp:e.getCookie("_fbp"),fbc:e.getCookie("_fbc"),client_user_agent:navigator.userAgent}},e.fbViewContent=function(t){try{var o,a,r;if(null===(o=wpmDataLayer)||void 0===o||null===(a=o.pixels)||void 0===a||null===(r=a.facebook)||void 0===r||!r.loaded)return;let n=e.getRandomEventId();fbq("track","ViewContent",{content_type:"product",content_name:t.name,content_ids:t.dyn_r_ids[wpmDataLayer.pixels.facebook.dynamic_remarketing.id_type],currency:wpmDataLayer.shop.currency,value:t.price},{eventID:n}),t.currency=wpmDataLayer.shop.currency,jQuery(document).trigger("wpmFbCapiEvent",{event_name:"ViewContent",event_id:n,user_data:e.getFbUserData(),product_data:t,product_id:t.dyn_r_ids[wpmDataLayer.pixels.facebook.dynamic_remarketing.id_type],event_source_url:window.location.href})}catch(e){console.error(e)}},e.facebookContentIds=function(){let e=[];for(const[a,r]of Object.entries(wpmDataLayer.order.items)){var t,o;null!==(t=wpmDataLayer)&&void 0!==t&&null!==(o=t.general)&&void 0!==o&&o.variationsOutput&&0!==r.variation_id?e.push(String(wpmDataLayer.products[r.variation_id].dyn_r_ids[wpmDataLayer.pixels.facebook.dynamic_remarketing.id_type])):e.push(String(wpmDataLayer.products[r.id].dyn_r_ids[wpmDataLayer.pixels.facebook.dynamic_remarketing.id_type]))}return e}}(window.wpm=window.wpm||{},jQuery),jQuery(document).on("wpmLoadPixels",(function(){var e,t,o;!wpm.canIFire("ads","facebook-ads")||null!==(e=wpmDataLayer)&&void 0!==e&&null!==(t=e.pixels)&&void 0!==t&&null!==(o=t.facebook)&&void 0!==o&&o.loaded||wpm.loadFacebookPixel()})),jQuery(document).on("wpmAddToCart",(function(e,t){try{var o,a,r;if(null===(o=wpmDataLayer)||void 0===o||null===(a=o.pixels)||void 0===a||null===(r=a.facebook)||void 0===r||!r.loaded)return;let e=wpm.getRandomEventId();fbq("track","AddToCart",{content_type:"product",content_name:t.name,content_ids:t.dyn_r_ids[wpmDataLayer.pixels.facebook.dynamic_remarketing.id_type],value:parseFloat(t.quantity*t.price),currency:t.currency},{eventID:e}),t.currency=wpmDataLayer.shop.currency,jQuery(document).trigger("wpmFbCapiEvent",{event_name:"AddToCart",event_id:e,user_data:wpm.getFbUserData(),product_data:t,product_id:t.dyn_r_ids[wpmDataLayer.pixels.facebook.dynamic_remarketing.id_type],event_source_url:window.location.href})}catch(e){console.error(e)}})),jQuery(document).on("wpmBeginCheckout",(function(e){try{var t,o,a;if(null===(t=wpmDataLayer)||void 0===t||null===(o=t.pixels)||void 0===o||null===(a=o.facebook)||void 0===a||!a.loaded)return;let e=wpm.getRandomEventId();fbq("track","InitiateCheckout",{},{eventID:e}),jQuery(document).trigger("wpmFbCapiEvent",{event_name:"InitiateCheckout",event_id:e,user_data:wpm.getFbUserData(),event_source_url:window.location.href})}catch(e){console.error(e)}})),jQuery(document).on("wpmAddToWishlist",(function(e,t){try{var o,a,r;if(null===(o=wpmDataLayer)||void 0===o||null===(a=o.pixels)||void 0===a||null===(r=a.facebook)||void 0===r||!r.loaded)return;let e=wpm.getRandomEventId();fbq("track","AddToWishlist",{content_type:"product",content_name:t.name,content_ids:t.dyn_r_ids[wpmDataLayer.pixels.facebook.dynamic_remarketing.id_type],value:parseFloat(t.quantity*t.price),currency:t.currency},{eventID:e}),t.currency=wpmDataLayer.shop.currency,jQuery(document).trigger("wpmFbCapiEvent",{event_name:"AddToWishlist",event_id:e,user_data:wpm.getFbUserData(),product_data:t,product_id:t.dyn_r_ids[wpmDataLayer.pixels.facebook.dynamic_remarketing.id_type],event_source_url:window.location.href})}catch(e){console.error(e)}})),jQuery(document).on("wpmViewItem",(function(e,t){try{var o,a,r;if(null===(o=wpmDataLayer)||void 0===o||null===(a=o.pixels)||void 0===a||null===(r=a.facebook)||void 0===r||!r.loaded)return;wpm.fbViewContent(t)}catch(e){console.error(e)}})),jQuery(document).on("wpmSearch",(function(){try{var e,t,o;if(null===(e=wpmDataLayer)||void 0===e||null===(t=e.pixels)||void 0===t||null===(o=t.facebook)||void 0===o||!o.loaded)return;let a=wpm.getRandomEventId();fbq("track","Search",{},{eventID:a}),jQuery(document).trigger("wpmFbCapiEvent",{event_name:"Search",event_id:a,user_data:wpm.getFbUserData(),event_source_url:window.location.href})}catch(e){console.error(e)}})),jQuery(document).on("wpmLoadAlways",(function(){try{var e,t,o;if(null===(e=wpmDataLayer)||void 0===e||null===(t=e.pixels)||void 0===t||null===(o=t.facebook)||void 0===o||!o.loaded)return;wpm.setFbUserData()}catch(e){console.error(e)}})),jQuery(document).on("wpmOrderReceivedPage",(function(){try{var e,t,o;if(null===(e=wpmDataLayer)||void 0===e||null===(t=e.pixels)||void 0===t||null===(o=t.facebook)||void 0===o||!o.loaded)return;fbq("track","Purchase",{content_type:"product",value:wpmDataLayer.order.value_filtered,currency:wpmDataLayer.order.currency,content_ids:wpm.facebookContentIds()},{eventID:wpmDataLayer.order.id})}catch(e){console.error(e)}}))},234:()=>{!function(e,t,o){let a=[];e.getGoogleAdsConversionIdentifiersWithLabel=function(){for(const[e,t]of Object.entries(wpmDataLayer.pixels.google.ads.conversionIds))a.push(e+"/"+t);return a},e.getGoogleAdsConversionIdentifiers=function(){let e=[];for(const[t,o]of Object.entries(wpmDataLayer.pixels.google.ads.conversionIds))e.push(t);return e},e.getGoogleAdsRegularOrderItems=function(){let e=[];for(const[a,r]of Object.entries(wpmDataLayer.order.items)){var t,o;let a;a={quantity:r.quantity,price:r.price},null!==(t=wpmDataLayer)&&void 0!==t&&null!==(o=t.general)&&void 0!==o&&o.variationsOutput&&0!==r.variation_id?(a.id=String(wpmDataLayer.products[r.variation_id].dyn_r_ids[wpmDataLayer.pixels.google.ads.dynamic_remarketing.id_type]),e.push(a)):(a.id=String(wpmDataLayer.products[r.id].dyn_r_ids[wpmDataLayer.pixels.google.ads.dynamic_remarketing.id_type]),e.push(a))}return e},e.getGoogleAdsDynamicRemarketingOrderItems=function(){let e=[];for(const[a,r]of Object.entries(wpmDataLayer.order.items)){var t,o;let a;a={quantity:r.quantity,price:r.price,google_business_vertical:wpmDataLayer.pixels.google.ads.google_business_vertical},null!==(t=wpmDataLayer)&&void 0!==t&&null!==(o=t.general)&&void 0!==o&&o.variationsOutput&&0!==r.variation_id?(a.id=String(wpmDataLayer.products[r.variation_id].dyn_r_ids[wpmDataLayer.pixels.google.ads.dynamic_remarketing.id_type]),e.push(a)):(a.id=String(wpmDataLayer.products[r.id].dyn_r_ids[wpmDataLayer.pixels.google.ads.dynamic_remarketing.id_type]),e.push(a))}return e}}(window.wpm=window.wpm||{},jQuery),jQuery(document).on("wpmViewItemList",(function(e,t){try{var o,a,r,n,i,s,d,l,c,u,p;if(jQuery.isEmptyObject(null===(o=wpmDataLayer)||void 0===o||null===(a=o.pixels)||void 0===a||null===(r=a.google)||void 0===r||null===(n=r.ads)||void 0===n?void 0:n.conversionIds))return;if(null===(i=wpmDataLayer)||void 0===i||null===(s=i.pixels)||void 0===s||null===(d=s.google)||void 0===d||null===(l=d.ads)||void 0===l||null===(c=l.dynamic_remarketing)||void 0===c||!c.status)return;if(!wpm.googleConfigConditionsMet("ads"))return;if(null!==(u=wpmDataLayer)&&void 0!==u&&null!==(p=u.general)&&void 0!==p&&p.variationsOutput&&t.isVariable&&!1===wpmDataLayer.pixels.google.ads.dynamic_remarketing.send_events_with_parent_ids)return;if(!t)return;wpm.gtagLoaded().then((function(){gtag("event","view_item_list",{send_to:wpm.getGoogleAdsConversionIdentifiers(),items:[{id:t.dyn_r_ids[wpmDataLayer.pixels.google.ads.dynamic_remarketing.id_type],google_business_vertical:wpmDataLayer.pixels.google.ads.google_business_vertical}]})}))}catch(e){console.error(e)}})),jQuery(document).on("wpmAddToCart",(function(e,t){try{var o,a,r,n,i,s,d,l,c;if(jQuery.isEmptyObject(null===(o=wpmDataLayer)||void 0===o||null===(a=o.pixels)||void 0===a||null===(r=a.google)||void 0===r||null===(n=r.ads)||void 0===n?void 0:n.conversionIds))return;if(null===(i=wpmDataLayer)||void 0===i||null===(s=i.pixels)||void 0===s||null===(d=s.google)||void 0===d||null===(l=d.ads)||void 0===l||null===(c=l.dynamic_remarketing)||void 0===c||!c.status)return;if(!wpm.googleConfigConditionsMet("ads"))return;wpm.gtagLoaded().then((function(){gtag("event","add_to_cart",{send_to:wpm.getGoogleAdsConversionIdentifiers(),value:t.quantity*t.price,items:[{id:t.dyn_r_ids[wpmDataLayer.pixels.google.ads.dynamic_remarketing.id_type],quantity:t.quantity,price:t.price,google_business_vertical:wpmDataLayer.pixels.google.ads.google_business_vertical}]})}))}catch(e){console.error(e)}})),jQuery(document).on("wpmViewItem",(function(e,t){try{var o,a,r,n,i,s,d,l,c;if(jQuery.isEmptyObject(null===(o=wpmDataLayer)||void 0===o||null===(a=o.pixels)||void 0===a||null===(r=a.google)||void 0===r||null===(n=r.ads)||void 0===n?void 0:n.conversionIds))return;if(null===(i=wpmDataLayer)||void 0===i||null===(s=i.pixels)||void 0===s||null===(d=s.google)||void 0===d||null===(l=d.ads)||void 0===l||null===(c=l.dynamic_remarketing)||void 0===c||!c.status)return;if(!wpm.googleConfigConditionsMet("ads"))return;wpm.gtagLoaded().then((function(){gtag("event","view_item",{send_to:wpm.getGoogleAdsConversionIdentifiers(),value:(t.quantity?t.quantity:1)*t.price,items:[{id:t.dyn_r_ids[wpmDataLayer.pixels.google.ads.dynamic_remarketing.id_type],quantity:t.quantity?t.quantity:1,price:t.price,google_business_vertical:wpmDataLayer.pixels.google.ads.google_business_vertical}]})}))}catch(e){console.error(e)}})),jQuery(document).on("wpmSearch",(function(){try{var e,t,o,a,r,n,i,s,d;if(jQuery.isEmptyObject(null===(e=wpmDataLayer)||void 0===e||null===(t=e.pixels)||void 0===t||null===(o=t.google)||void 0===o||null===(a=o.ads)||void 0===a?void 0:a.conversionIds))return;if(null===(r=wpmDataLayer)||void 0===r||null===(n=r.pixels)||void 0===n||null===(i=n.google)||void 0===i||null===(s=i.ads)||void 0===s||null===(d=s.dynamic_remarketing)||void 0===d||!d.status)return;if(!wpm.googleConfigConditionsMet("ads"))return;let u=[];for(const[e,t]of Object.entries(wpmDataLayer.products)){var l,c;if(null!==(l=wpmDataLayer)&&void 0!==l&&null!==(c=l.general)&&void 0!==c&&c.variationsOutput&&t.isVariable&&!1===wpmDataLayer.pixels.google.ads.dynamic_remarketing.send_events_with_parent_ids)return;u.push({id:t.dyn_r_ids[wpmDataLayer.pixels.google.ads.dynamic_remarketing.id_type],google_business_vertical:wpmDataLayer.pixels.google.ads.google_business_vertical})}wpm.gtagLoaded().then((function(){gtag("event","view_search_results",{send_to:wpm.getGoogleAdsConversionIdentifiers(),items:u})}))}catch(e){console.error(e)}})),jQuery(document).on("wpmOrderReceivedPage",(function(){try{var e,t,o,a,r,n,i,s,d;if(jQuery.isEmptyObject(null===(e=wpmDataLayer)||void 0===e||null===(t=e.pixels)||void 0===t||null===(o=t.google)||void 0===o||null===(a=o.ads)||void 0===a?void 0:a.conversionIds))return;if(null===(r=wpmDataLayer)||void 0===r||null===(n=r.pixels)||void 0===n||null===(i=n.google)||void 0===i||null===(s=i.ads)||void 0===s||null===(d=s.dynamic_remarketing)||void 0===d||!d.status)return;if(!wpm.googleConfigConditionsMet("ads"))return;wpm.gtagLoaded().then((function(){gtag("event","purchase",{send_to:wpm.getGoogleAdsConversionIdentifiers(),value:wpmDataLayer.order.value_filtered,items:wpm.getGoogleAdsDynamicRemarketingOrderItems()})}))}catch(e){console.error(e)}})),jQuery(document).on("wpmLogin",(function(){try{var e,t,o,a,r,n,i,s,d;if(jQuery.isEmptyObject(null===(e=wpmDataLayer)||void 0===e||null===(t=e.pixels)||void 0===t||null===(o=t.google)||void 0===o||null===(a=o.ads)||void 0===a?void 0:a.conversionIds))return;if(null===(r=wpmDataLayer)||void 0===r||null===(n=r.pixels)||void 0===n||null===(i=n.google)||void 0===i||null===(s=i.ads)||void 0===s||null===(d=s.dynamic_remarketing)||void 0===d||!d.status)return;if(!wpm.googleConfigConditionsMet("ads"))return;wpm.gtagLoaded().then((function(){gtag("event","login",{send_to:wpm.getGoogleAdsConversionIdentifiers()})}))}catch(e){console.error(e)}})),jQuery(document).on("wpmOrderReceivedPage",(function(){try{var e,t,o,a,r,n;if(jQuery.isEmptyObject(null===(e=wpmDataLayer)||void 0===e||null===(t=e.pixels)||void 0===t||null===(o=t.google)||void 0===o||null===(a=o.ads)||void 0===a?void 0:a.conversionIds))return;if(!wpm.googleConfigConditionsMet("ads"))return;let i={},s={};i={send_to:wpm.getGoogleAdsConversionIdentifiersWithLabel(),transaction_id:wpmDataLayer.order.number,value:wpmDataLayer.order.value_filtered,currency:wpmDataLayer.order.currency,new_customer:wpmDataLayer.order.new_customer},null!==(r=wpmDataLayer)&&void 0!==r&&null!==(n=r.order)&&void 0!==n&&n.aw_merchant_id&&(s={discount:wpmDataLayer.order.discount,aw_merchant_id:wpmDataLayer.order.aw_merchant_id,aw_feed_country:wpmDataLayer.order.aw_feed_country,aw_feed_language:wpmDataLayer.order.aw_feed_language,items:wpm.getGoogleAdsRegularOrderItems()}),wpm.gtagLoaded().then((function(){gtag("event","conversion",{...i,...s})}))}catch(e){console.error(e)}}))},464:()=>{!function(e,t,o){e.getGA4OrderItems=function(){let e=[];for(const[a,r]of Object.entries(wpmDataLayer.order.items)){var t,o;let a;a={quantity:r.quantity,price:r.price,item_name:r.name,currency:wpmDataLayer.order.currency,item_category:wpmDataLayer.products[r.id].category.join("/")},null!==(t=wpmDataLayer)&&void 0!==t&&null!==(o=t.general)&&void 0!==o&&o.variationsOutput&&0!==r.variation_id?(a.item_id=String(wpmDataLayer.products[r.variation_id].dyn_r_ids[wpmDataLayer.pixels.google.analytics.id_type]),a.item_variant=wpmDataLayer.products[r.variation_id].variant_name,a.item_brand=wpmDataLayer.products[r.variation_id].brand):(a.item_id=String(wpmDataLayer.products[r.id].dyn_r_ids[wpmDataLayer.pixels.google.analytics.id_type]),a.item_brand=wpmDataLayer.products[r.id].brand),e.push(a)}return e}}(window.wpm=window.wpm||{},jQuery),jQuery(document).on("wpmOrderReceivedPage",(function(){try{var e,t,o,a,r,n,i,s,d,l;if(null===(e=wpmDataLayer)||void 0===e||null===(t=e.pixels)||void 0===t||null===(o=t.google)||void 0===o||null===(a=o.analytics)||void 0===a||null===(r=a.ga4)||void 0===r||!r.measurement_id)return;if(null!==(n=wpmDataLayer)&&void 0!==n&&null!==(i=n.pixels)&&void 0!==i&&null!==(s=i.google)&&void 0!==s&&null!==(d=s.analytics)&&void 0!==d&&null!==(l=d.ga4)&&void 0!==l&&l.mp_active)return;if(!wpm.googleConfigConditionsMet("analytics"))return;wpm.gtagLoaded().then((function(){gtag("event","purchase",{send_to:[wpmDataLayer.pixels.google.analytics.ga4.measurement_id],transaction_id:wpmDataLayer.order.number,affiliation:wpmDataLayer.order.affiliation,currency:wpmDataLayer.order.currency,value:wpmDataLayer.order.value_regular,discount:wpmDataLayer.order.discount,tax:wpmDataLayer.order.tax,shipping:wpmDataLayer.order.shipping,coupon:wpmDataLayer.order.coupon,items:wpm.getGA4OrderItems()})}))}catch(e){console.error(e)}}))},354:()=>{!function(e,t,o){e.getGAUAOrderItems=function(){let e=[],t=1;for(const[r,n]of Object.entries(wpmDataLayer.order.items)){var o,a;let r;r={quantity:n.quantity,price:n.price,name:n.name,currency:wpmDataLayer.order.currency,category:wpmDataLayer.products[n.id].category.join("/"),list_position:t},null!==(o=wpmDataLayer)&&void 0!==o&&null!==(a=o.general)&&void 0!==a&&a.variationsOutput&&0!==n.variation_id?(r.id=String(wpmDataLayer.products[n.variation_id].dyn_r_ids[wpmDataLayer.pixels.google.analytics.id_type]),r.variant=wpmDataLayer.products[n.variation_id].variant_name,r.brand=wpmDataLayer.products[n.variation_id].brand):(r.id=String(wpmDataLayer.products[n.id].dyn_r_ids[wpmDataLayer.pixels.google.analytics.id_type]),r.brand=wpmDataLayer.products[n.id].brand),e.push(r),t++}return e}}(window.wpm=window.wpm||{},jQuery),jQuery(document).on("wpmOrderReceivedPage",(function(){try{var e,t,o,a,r,n,i,s,d,l;if(null===(e=wpmDataLayer)||void 0===e||null===(t=e.pixels)||void 0===t||null===(o=t.google)||void 0===o||null===(a=o.analytics)||void 0===a||null===(r=a.universal)||void 0===r||!r.property_id)return;if(null!==(n=wpmDataLayer)&&void 0!==n&&null!==(i=n.pixels)&&void 0!==i&&null!==(s=i.google)&&void 0!==s&&null!==(d=s.analytics)&&void 0!==d&&null!==(l=d.universal)&&void 0!==l&&l.mp_active)return;if(!wpm.googleConfigConditionsMet("analytics"))return;wpm.gtagLoaded().then((function(){gtag("event","purchase",{send_to:[wpmDataLayer.pixels.google.analytics.universal.property_id],transaction_id:wpmDataLayer.order.number,affiliation:wpmDataLayer.order.affiliation,currency:wpmDataLayer.order.currency,value:wpmDataLayer.order.value_regular,discount:wpmDataLayer.order.discount,tax:wpmDataLayer.order.tax,shipping:wpmDataLayer.order.shipping,coupon:wpmDataLayer.order.coupon,items:wpm.getGAUAOrderItems()})}))}catch(e){console.error(e)}}))},497:()=>{!function(e,t,o){e.load_google_optimize_pixel=function(){try{var t,o,a,r;null!==(t=wpmDataLayer)&&void 0!==t&&null!==(o=t.pixels)&&void 0!==o&&null!==(a=o.google)&&void 0!==a&&null!==(r=a.optimize)&&void 0!==r&&r.container_id&&(wpmDataLayer.pixels.google.optimize.loaded=!0,e.loadScriptAndCacheIt("https://www.googleoptimize.com/optimize.js?id="+wpmDataLayer.pixels.google.optimize.container_id))}catch(e){console.error(e)}}}(window.wpm=window.wpm||{},jQuery),jQuery(document).on("wpmLoadPixels",(function(){var e,t,o,a;!wpm.canIFire("analytics","google-optimize")||null!==(e=wpmDataLayer)&&void 0!==e&&null!==(t=e.pixels)&&void 0!==t&&null!==(o=t.google)&&void 0!==o&&null!==(a=o.optimize)&&void 0!==a&&a.loaded||wpm.load_google_optimize_pixel()}))},577:()=>{!function(e,t,o){e.googleConfigConditionsMet=function(t){var o,a,r,n;return!(null===(o=wpmDataLayer)||void 0===o||null===(a=o.pixels)||void 0===a||null===(r=a.google)||void 0===r||null===(n=r.consent_mode)||void 0===n||!n.active)||("category"===e.getConsentValues().mode?!0===e.getConsentValues().categories[t]:"pixel"===e.getConsentValues().mode&&e.getConsentValues().pixels.includes("google-"+t))},e.getVisitorConsentStatusAndUpdateGoogleConsentSettings=function(t){return"category"===e.getConsentValues().mode?(e.getConsentValues().categories.analytics&&(t.analytics_storage="granted"),e.getConsentValues().categories.ads&&(t.ad_storage="granted")):"pixel"===e.getConsentValues().mode&&(t.analytics_storage=e.getConsentValues().pixels.includes("google-analytics")?"granted":"denied",t.ad_storage=e.getConsentValues().pixels.includes("google-ads")?"granted":"denied"),t},e.updateGoogleConsentMode=function(){let e=!(arguments.length>0&&arguments[0]!==o)||arguments[0],t=!(arguments.length>1&&arguments[1]!==o)||arguments[1];try{if(!window.gtag||!wpmDataLayer.shop.cookie_consent_mgmt.explicit_consent)return;gtag("consent","update",{analytics_storage:e?"granted":"denied",ad_storage:t?"granted":"denied"})}catch(e){console.error(e)}},e.fireGtagGoogleAds=function(){try{var e,t,o,a,r,n,i,s,d,l,c,u,p,g,m,y,w,v,f,_,h;if(wpmDataLayer.pixels.google.ads.state="loading",null!==(e=wpmDataLayer)&&void 0!==e&&null!==(t=e.pixels)&&void 0!==t&&null!==(o=t.google)&&void 0!==o&&null!==(a=o.ads)&&void 0!==a&&null!==(r=a.enhanced_conversions)&&void 0!==r&&r.active)for(const[e,t]of Object.entries(wpmDataLayer.pixels.google.ads.conversionIds))gtag("config",e,{allow_enhanced_conversions:!0});else for(const[e,t]of Object.entries(wpmDataLayer.pixels.google.ads.conversionIds))gtag("config",e);null!==(n=wpmDataLayer)&&void 0!==n&&null!==(i=n.pixels)&&void 0!==i&&null!==(s=i.google)&&void 0!==s&&null!==(d=s.ads)&&void 0!==d&&d.conversionIds&&null!==(l=wpmDataLayer)&&void 0!==l&&null!==(c=l.pixels)&&void 0!==c&&null!==(u=c.google)&&void 0!==u&&null!==(p=u.ads)&&void 0!==p&&p.phone_conversion_label&&null!==(g=wpmDataLayer)&&void 0!==g&&null!==(m=g.pixels)&&void 0!==m&&null!==(y=m.google)&&void 0!==y&&null!==(w=y.ads)&&void 0!==w&&w.phone_conversion_number&&gtag("config",Object.keys(wpmDataLayer.pixels.google.ads.conversionIds)[0]+"/"+wpmDataLayer.pixels.google.ads.phone_conversion_label,{phone_conversion_number:wpmDataLayer.pixels.google.ads.phone_conversion_number}),"order_received_page"===wpmDataLayer.shop.page_type&&null!==(v=wpmDataLayer)&&void 0!==v&&null!==(f=v.order)&&void 0!==f&&null!==(_=f.google)&&void 0!==_&&null!==(h=_.ads)&&void 0!==h&&h.enhanced_conversion_data&&(window.enhanced_conversion_data=wpmDataLayer.order.google.ads.enhanced_conversion_data),wpmDataLayer.pixels.google.ads.state="ready"}catch(e){console.error(e)}},e.fireGtagGoogleAnalyticsUA=function(){try{wpmDataLayer.pixels.google.analytics.universal.state="loading",gtag("config",wpmDataLayer.pixels.google.analytics.universal.property_id,wpmDataLayer.pixels.google.analytics.universal.parameters),wpmDataLayer.pixels.google.analytics.universal.state="ready"}catch(e){console.error(e)}},e.fireGtagGoogleAnalyticsGA4=function(){try{wpmDataLayer.pixels.google.analytics.ga4.state="loading",gtag("config",wpmDataLayer.pixels.google.analytics.ga4.measurement_id,wpmDataLayer.pixels.google.analytics.ga4.parameters),wpmDataLayer.pixels.google.analytics.ga4.state="ready"}catch(e){console.error(e)}},e.isGoogleActive=function(){var e,t,o,a,r,n,i,s,d,l,c,u,p,g;return!(!(null!==(e=wpmDataLayer)&&void 0!==e&&null!==(t=e.pixels)&&void 0!==t&&null!==(o=t.google)&&void 0!==o&&null!==(a=o.analytics)&&void 0!==a&&null!==(r=a.universal)&&void 0!==r&&r.property_id||null!==(n=wpmDataLayer)&&void 0!==n&&null!==(i=n.pixels)&&void 0!==i&&null!==(s=i.google)&&void 0!==s&&null!==(d=s.analytics)&&void 0!==d&&null!==(l=d.ga4)&&void 0!==l&&l.measurement_id)&&jQuery.isEmptyObject(null===(c=wpmDataLayer)||void 0===c||null===(u=c.pixels)||void 0===u||null===(p=u.google)||void 0===p||null===(g=p.ads)||void 0===g?void 0:g.conversionIds))},e.getGoogleGtagId=function(){var e,t,o,a,r,n,i,s,d,l;return null!==(e=wpmDataLayer)&&void 0!==e&&null!==(t=e.pixels)&&void 0!==t&&null!==(o=t.google)&&void 0!==o&&null!==(a=o.analytics)&&void 0!==a&&null!==(r=a.universal)&&void 0!==r&&r.property_id?wpmDataLayer.pixels.google.analytics.universal.property_id:null!==(n=wpmDataLayer)&&void 0!==n&&null!==(i=n.pixels)&&void 0!==i&&null!==(s=i.google)&&void 0!==s&&null!==(d=s.analytics)&&void 0!==d&&null!==(l=d.ga4)&&void 0!==l&&l.measurement_id?wpmDataLayer.pixels.google.analytics.ga4.measurement_id:Object.keys(wpmDataLayer.pixels.google.ads.conversionIds)[0]},e.loadGoogle=function(){e.isGoogleActive()&&(wpmDataLayer.pixels.google.state="loading",e.loadScriptAndCacheIt("https://www.googletagmanager.com/gtag/js?id="+e.getGoogleGtagId()).done((function(t,o){try{var a,r,n,i,s,d,l,c,u,p,g,m,y,w,v,f,_,h,L,D,C,b;if(window.dataLayer=window.dataLayer||[],window.gtag=function(){dataLayer.push(arguments)},null!==(a=wpmDataLayer)&&void 0!==a&&null!==(r=a.pixels)&&void 0!==r&&null!==(n=r.google)&&void 0!==n&&null!==(i=n.consent_mode)&&void 0!==i&&i.active){var j,x,k,I;let t={ad_storage:wpmDataLayer.pixels.google.consent_mode.ad_storage,analytics_storage:wpmDataLayer.pixels.google.consent_mode.analytics_storage,wait_for_update:wpmDataLayer.pixels.google.consent_mode.wait_for_update};null!==(j=wpmDataLayer)&&void 0!==j&&null!==(x=j.pixels)&&void 0!==x&&null!==(k=x.google)&&void 0!==k&&null!==(I=k.consent_mode)&&void 0!==I&&I.region&&(t.region=wpmDataLayer.pixels.google.consent_mode.region),t=e.getVisitorConsentStatusAndUpdateGoogleConsentSettings(t),gtag("consent","default",t),gtag("set","ads_data_redaction",wpmDataLayer.pixels.google.consent_mode.ads_data_redaction),gtag("set","url_passthrough",wpmDataLayer.pixels.google.consent_mode.url_passthrough)}null!==(s=wpmDataLayer)&&void 0!==s&&null!==(d=s.pixels)&&void 0!==d&&null!==(l=d.google)&&void 0!==l&&null!==(c=l.linker)&&void 0!==c&&c.settings&&gtag("set","linker",wpmDataLayer.pixels.google.linker.settings),gtag("js",new Date),e.googleConfigConditionsMet("ads")&&!jQuery.isEmptyObject(null===(u=wpmDataLayer)||void 0===u||null===(p=u.pixels)||void 0===p||null===(g=p.google)||void 0===g||null===(m=g.ads)||void 0===m?void 0:m.conversionIds)&&e.fireGtagGoogleAds(),e.googleConfigConditionsMet("analytics")&&null!==(y=wpmDataLayer)&&void 0!==y&&null!==(w=y.pixels)&&void 0!==w&&null!==(v=w.google)&&void 0!==v&&null!==(f=v.analytics)&&void 0!==f&&null!==(_=f.universal)&&void 0!==_&&_.property_id&&e.fireGtagGoogleAnalyticsUA(),e.googleConfigConditionsMet("analytics")&&null!==(h=wpmDataLayer)&&void 0!==h&&null!==(L=h.pixels)&&void 0!==L&&null!==(D=L.google)&&void 0!==D&&null!==(C=D.analytics)&&void 0!==C&&null!==(b=C.ga4)&&void 0!==b&&b.measurement_id&&e.fireGtagGoogleAnalyticsGA4(),wpmDataLayer.pixels.google.state="ready"}catch(e){console.error(e)}})))},e.canGoogleLoad=function(){var t,o,a,r;return!(null===(t=wpmDataLayer)||void 0===t||null===(o=t.pixels)||void 0===o||null===(a=o.google)||void 0===a||null===(r=a.consent_mode)||void 0===r||!r.active)||("category"===e.getConsentValues().mode?!(!e.getConsentValues().categories.ads&&!e.getConsentValues().categories.analytics):"pixel"===e.getConsentValues().mode?e.getConsentValues().pixels.includes("google-ads")||e.getConsentValues().pixels.includes("google-analytics"):(console.error("Couldn't find a valid load condition for Google mode in wpmConsentValues"),!1))},e.gtagLoaded=function(){return new Promise((function(e,t){var o,a,r;void 0===(null===(o=wpmDataLayer)||void 0===o||null===(a=o.pixels)||void 0===a||null===(r=a.google)||void 0===r?void 0:r.state)&&t();let n=0;!function o(){var a,r,i;return"ready"===(null===(a=wpmDataLayer)||void 0===a||null===(r=a.pixels)||void 0===r||null===(i=r.google)||void 0===i?void 0:i.state)?e():n>=5e3?t():(n+=200,void setTimeout(o,200))}()}))}}(window.wpm=window.wpm||{},jQuery),jQuery(document).on("wpmLoadPixels",(function(){var e,t,o;wpm.canGoogleLoad()&&void 0===(null===(e=wpmDataLayer)||void 0===e||null===(t=e.pixels)||void 0===t||null===(o=t.google)||void 0===o?void 0:o.state)&&wpm.loadGoogle()}))},570:()=>{!function(e,t,o){e.load_hotjar_pixel=function(){var e,t,o,a,r,n,i;null!==(e=wpmDataLayer)&&void 0!==e&&null!==(t=e.pixels)&&void 0!==t&&null!==(o=t.hotjar)&&void 0!==o&&o.site_id&&(wpmDataLayer.pixels.hotjar.loaded=!0,a=window,r=document,a.hj=a.hj||function(){(a.hj.q=a.hj.q||[]).push(arguments)},a._hjSettings={hjid:wpmDataLayer.pixels.hotjar.site_id,hjsv:6},n=r.getElementsByTagName("head")[0],(i=r.createElement("script")).async=1,i.src="https://static.hotjar.com/c/hotjar-"+a._hjSettings.hjid+".js?sv="+a._hjSettings.hjsv,n.appendChild(i))}}(window.wpm=window.wpm||{},jQuery),jQuery(document).on("wpmLoadPixels",(function(){var e,t,o;!wpm.canIFire("analytics","hotjar")||null!==(e=wpmDataLayer)&&void 0!==e&&null!==(t=e.pixels)&&void 0!==t&&null!==(o=t.hotjar)&&void 0!==o&&o.loaded||wpm.load_hotjar_pixel()}))},560:()=>{wpm.wpmDataLayerExists().then((function(){jQuery(document).trigger("wpmPreLoadPixels",{})})).then((function(){wpm.pageLoaded().then((function(){jQuery(document).trigger("wpmLoad",{})}))}))},230:()=>{!function(e,t,o){const a="_wpm_order_ids",r="_wpm_endpoint_available",n="/wp-json/";function i(){return""!==e.getCookie(a)}e.emailSelected=!1,e.paymentMethodSelected=!1,e.useRestEndpoint=function(){return e.isSessionStorageAvailable()&&e.isRestEndpointAvailable()&&e.isBelowRestErrorThreshold()},e.isBelowRestErrorThreshold=function(){return window.sessionStorage.getItem(0)<=10},e.isRestEndpointAvailable=function(){if(window.sessionStorage.getItem(r))return JSON.parse(window.sessionStorage.getItem(r));e.testEndpoint()},e.isSessionStorageAvailable=function(){return!!window.sessionStorage},e.testEndpoint=function(){let e=arguments.length>0&&arguments[0]!==o?arguments[0]:location.protocol+"//"+location.host+n,t=arguments.length>1&&arguments[1]!==o?arguments[1]:r;jQuery.ajax(e,{type:"HEAD",timeout:1e3,statusCode:{200:function(e){window.sessionStorage.setItem(t,JSON.stringify(!0))},404:function(e){window.sessionStorage.setItem(t,JSON.stringify(!1))},0:function(e){window.sessionStorage.setItem(t,JSON.stringify(!1))}}}).then((e=>{}))},e.isWpmRestEndpointAvailable=function(){let t=arguments.length>0&&arguments[0]!==o?arguments[0]:r;return!!e.getCookie(t)},e.writeOrderIdToStorage=function(t){if(window.Storage)if(null===localStorage.getItem(a)){let e=[];e.push(t),window.localStorage.setItem(a,JSON.stringify(e))}else{let e=JSON.parse(localStorage.getItem(a));e.includes(t)||(e.push(t),window.localStorage.setItem(a,JSON.stringify(e)))}else{let o=new Date;o.setDate(o.getDate()+365);let r=[];i()&&(r=JSON.parse(e.getCookie(a))),r.includes(t)||(r.push(t),document.cookie="_wpm_order_ids="+JSON.stringify(r)+";expires="+o.toUTCString())}"function"==typeof e.storeOrderIdOnServer&&wpmDataLayer.orderDeduplication&&e.storeOrderIdOnServer(t)},e.isOrderIdStored=function(t){return wpmDataLayer.orderDeduplication?window.Storage?null!==localStorage.getItem(a)&&JSON.parse(localStorage.getItem(a)).includes(t):!!i()&&JSON.parse(e.getCookie(a)).includes(t):(console.log("order duplication prevention: off"),!1)},e.isEmail=function(e){return/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(e)},e.removeProductFromCart=function(t){let a=arguments.length>1&&arguments[1]!==o?arguments[1]:null;try{if(!t)throw Error("Wasn't able to retrieve a productId");if(!(t=getIdBasedOndVariationsOutputSetting(t)))throw Error("Wasn't able to retrieve a productId");let o;if(o=null==a?wpmDataLayer.cart[t].quantity:a,wpmDataLayer.cart[t]){let r=e.getProductDetailsFormattedForEvent(t,o);jQuery(document).trigger("wpmRemoveFromCart",r),null==a||wpmDataLayer.cart[t].quantity===a?(delete wpmDataLayer.cart[t],sessionStorage&&sessionStorage.setItem("wpmDataLayerCart",JSON.stringify(wpmDataLayer.cart))):(wpmDataLayer.cart[t].quantity=wpmDataLayer.cart[t].quantity-o,sessionStorage&&sessionStorage.setItem("wpmDataLayerCart",JSON.stringify(wpmDataLayer.cart)))}}catch(e){console.error(e)}},getIdBasedOndVariationsOutputSetting=function(e){try{var t,o;return null!==(t=wpmDataLayer)&&void 0!==t&&null!==(o=t.general)&&void 0!==o&&o.variationsOutput?e:wpmDataLayer.products[e].isVariation?wpmDataLayer.products[e].parentId:e}catch(e){console.error(e)}},e.addProductToCart=function(t,o){try{var a;if(!t)throw Error("Wasn't able to retrieve a productId");if(!(t=getIdBasedOndVariationsOutputSetting(t)))throw Error("Wasn't able to retrieve a productId");if(null!==(a=wpmDataLayer)&&void 0!==a&&a.products[t]){var r;let a=e.getProductDetailsFormattedForEvent(t,o);jQuery(document).trigger("wpmAddToCart",a),null!==(r=wpmDataLayer)&&void 0!==r&&r.cart[t]?wpmDataLayer.cart[t].quantity=wpmDataLayer.cart[t].quantity+o:("cart"in wpmDataLayer||(wpmDataLayer.cart={}),wpmDataLayer.cart[t]=e.getProductDetailsFormattedForEvent(t,o)),sessionStorage&&sessionStorage.setItem("wpmDataLayerCart",JSON.stringify(wpmDataLayer.cart))}}catch(t){console.error(t),e.getCartItemsFromBackend()}},e.getCartItems=function(){sessionStorage?sessionStorage.getItem("wpmDataLayerCart")&&"order_received_page"!==wpmDataLayer.shop.page_type?e.saveCartObjectToDataLayer(JSON.parse(sessionStorage.getItem("wpmDataLayerCart"))):sessionStorage.setItem("wpmDataLayerCart",JSON.stringify({})):e.getCartItemsFromBackend()},e.getCartItemsFromBackend=function(){try{let t={action:"wpm_get_cart_items"};jQuery.ajax({type:"get",dataType:"json",url:e.ajax_url,data:t,success:function(t){t.cart||(t.cart={}),e.saveCartObjectToDataLayer(t.cart),sessionStorage&&sessionStorage.setItem("wpmDataLayerCart",JSON.stringify(t.cart))}})}catch(e){console.error(e)}},e.getProductsFromBackend=function(t){if((t=t.filter((e=>!wpmDataLayer.products.hasOwnProperty(e))))&&0!==t.length)try{let o={action:"wpm_get_product_ids",productIds:t};jQuery.ajax({type:"get",dataType:"json",url:e.ajax_url,data:o,success:function(e){wpmDataLayer.products=Object.assign({},wpmDataLayer.products,e)},error:function(e){console.log(e)}})}catch(e){console.error(e)}},e.saveCartObjectToDataLayer=function(e){wpmDataLayer.cart=e,wpmDataLayer.products=Object.assign({},wpmDataLayer.products,e)},e.fireCheckoutOption=function(e){let t=arguments.length>1&&arguments[1]!==o?arguments[1]:null,a=arguments.length>2&&arguments[2]!==o?arguments[2]:null,r={step:e,checkout_option:t,value:a};jQuery(document).trigger("wpmFireCheckoutOption",r)},e.fireCheckoutProgress=function(e){let t={step:e};jQuery(document).trigger("wpmFireCheckoutProgress",t)},e.getPostIdFromString=function(e){try{return e.match(/(post-)(\d+)/)[2]}catch(e){console.error(e)}},e.triggerViewItemList=function(t){if(!t)throw Error("Wasn't able to retrieve a productId");if(!(t=getIdBasedOndVariationsOutputSetting(t)))throw Error("Wasn't able to retrieve a productId");jQuery(document).trigger("wpmViewItemList",e.getProductDataForViewItemEvent(t))},e.getProductDataForViewItemEvent=function(t){if(!t)throw Error("Wasn't able to retrieve a productId");try{if(wpmDataLayer.products[t])return e.getProductDetailsFormattedForEvent(t)}catch(e){console.error(e)}},e.getMainProductIdFromProductPage=function(){try{return["simple","variable","grouped","composite","bundle"].indexOf(wpmDataLayer.shop.product_type)>=0&&jQuery(".wpmProductId:first").data("id")}catch(e){console.error(e)}},e.viewItemListTriggerTestMode=function(e){jQuery(e).css({position:"relative"}),jQuery(e).append('<div id="viewItemListTriggerOverlay"></div>'),jQuery(e).find("#viewItemListTriggerOverlay").css({"z-index":"10",display:"block",position:"absolute",height:"100%",top:"0",left:"0",right:"0",opacity:wpmDataLayer.viewItemListTrigger.opacity,"background-color":wpmDataLayer.viewItemListTrigger.backgroundColor})},e.getSearchTermFromUrl=function(){try{return new URLSearchParams(window.location.search).get("s")}catch(e){console.error(e)}};let s,d={};e.observerCallback=function(t,o){t.forEach((t=>{try{let a,r=jQuery(t.target).data("ioid");if(a=jQuery(t.target).next(".wpmProductId").length?jQuery(t.target).next(".wpmProductId").data("id"):jQuery(t.target).find(".wpmProductId").data("id"),!a)throw Error("wpmProductId element not found");t.isIntersecting?d[r]=setTimeout((()=>{e.triggerViewItemList(a),wpmDataLayer.viewItemListTrigger.testMode&&e.viewItemListTriggerTestMode(t.target),!1===wpmDataLayer.viewItemListTrigger.repeat&&o.unobserve(t.target)}),wpmDataLayer.viewItemListTrigger.timeout):(clearTimeout(d[r]),wpmDataLayer.viewItemListTrigger.testMode&&jQuery(t.target).find("#viewItemListTriggerOverlay").remove())}catch(e){console.error(e)}}))};let l,c=0;e.startIntersectionObserverToWatch=function(){try{e.urlHasParameter("vildemomode")&&(wpmDataLayer.viewItemListTrigger.testMode=!0),s=new IntersectionObserver(e.observerCallback,{threshold:wpmDataLayer.viewItemListTrigger.threshold}),l=jQuery(".wpmProductId").map((function(e,t){return jQuery(t).parent().hasClass("type-product")||jQuery(t).parent().hasClass("product")||jQuery(t).parent().hasClass("product-item-inner")?jQuery(t).parent():jQuery(t).prev().hasClass("wc-block-grid__product")||jQuery(t).prev().hasClass("product")||jQuery(t).prev().hasClass("product-small")||jQuery(t).prev().hasClass("woocommerce-LoopProduct-link")?jQuery(this).prev():jQuery(t).closest(".product").length?jQuery(t).closest(".product"):void 0})),l.each((function(e,t){jQuery(t[0]).data("ioid",c++),s.observe(t[0])}))}catch(e){console.error(e)}},e.startProductsMutationObserverToWatch=function(){try{let e=jQuery(".wpmProductId:eq(0)").parents().has(jQuery(".wpmProductId:eq(1)").parents()).first();e.length&&u.observe(e[0],{attributes:!0,childList:!0,characterData:!0})}catch(e){console.error(e)}};let u=new MutationObserver((function(e){e.forEach((function(e){let t=e.addedNodes;null!==t&&jQuery(t).each((function(){(jQuery(this).hasClass("type-product")||jQuery(this).hasClass("product-small")||jQuery(this).hasClass("wc-block-grid__product"))&&p(this)&&(jQuery(this).data("ioid",c++),s.observe(this))}))}))})),p=function(e){return!(!jQuery(e).find(".wpmProductId").length&&!jQuery(e).siblings(".wpmProductId").length)};e.setCookie=function(e){let t=arguments.length>1&&arguments[1]!==o?arguments[1]:"",a=arguments.length>2&&arguments[2]!==o?arguments[2]:null;if(a){let o=new Date;o.setTime(o.getTime()+24*a*60*60*1e3);let r="expires="+o.toUTCString();document.cookie=e+"="+t+";"+r+";path=/"}else document.cookie=e+"="+t+";path=/"},e.getCookie=function(e){let t=e+"=",o=decodeURIComponent(document.cookie).split(";");for(let e=0;e<o.length;e++){let a=o[e];for(;" "==a.charAt(0);)a=a.substring(1);if(0==a.indexOf(t))return a.substring(t.length,a.length)}return""},e.getWpmSessionData=function(){if(window.sessionStorage){let e=window.sessionStorage.getItem("_wpm");return null!==e?JSON.parse(e):{}}return{}},e.setWpmSessionData=function(e){window.sessionStorage&&window.sessionStorage.setItem("_wpm",JSON.stringify(e))},e.storeOrderIdOnServer=function(t){try{let o={action:"wpm_purchase_pixels_fired",order_id:t,nonce:e.nonce};jQuery.ajax({type:"post",dataType:"json",url:e.ajax_url,data:o,success:function(e){!1===e.success&&console.log(e)},error:function(e){console.log(e)}})}catch(e){console.error(e)}},e.getProductIdByCartItemKeyUrl=function(e){let t,o=new URLSearchParams(e.search).get("remove_item");return t=0===wpmDataLayer.cartItemKeys[o].variation_id?wpmDataLayer.cartItemKeys[o].product_id:wpmDataLayer.cartItemKeys[o].variation_id,t},e.getAddToCartLinkProductIds=function(){return jQuery("a").map((function(){let e=jQuery(this).attr("href");if(e&&e.includes("?add-to-cart=")){let t=e.match(/(add-to-cart=)(\d+)/);if(t)return t[2]}})).get()},e.getProductDetailsFormattedForEvent=function(e){let t=arguments.length>1&&arguments[1]!==o?arguments[1]:1,a={id:e.toString(),dyn_r_ids:wpmDataLayer.products[e].dyn_r_ids,name:wpmDataLayer.products[e].name,list_name:wpmDataLayer.shop.list_name,brand:wpmDataLayer.products[e].brand,category:wpmDataLayer.products[e].category,variant:wpmDataLayer.products[e].variant,list_position:wpmDataLayer.products[e].position,quantity:t,price:wpmDataLayer.products[e].price,currency:wpmDataLayer.shop.currency,isVariable:wpmDataLayer.products[e].isVariable,isVariation:wpmDataLayer.products[e].isVariation,parentId:wpmDataLayer.products[e].parentId};return a.isVariation&&(a.parentId_dyn_r_ids=wpmDataLayer.products[e].parentId_dyn_r_ids),a},e.setReferrerToCookie=function(){e.getCookie("wpmReferrer")||e.setCookie("wpmReferrer",document.referrer)},e.getReferrerFromCookie=function(){return e.getCookie("wpmReferrer")?e.getCookie("wpmReferrer"):null},e.getClidFromBrowser=function(){let t,a=arguments.length>0&&arguments[0]!==o?arguments[0]:"gclid";return t={gclid:"_gcl_aw",dclid:"_gcl_dc"},e.getCookie(t[a])?e.getCookie(t[a]).match(/(GCL.[\d]*.)(.*)/)[2]:""},e.getUserAgent=function(){return navigator.userAgent},e.getViewPort=function(){return{width:Math.max(document.documentElement.clientWidth||0,window.innerWidth||0),height:Math.max(document.documentElement.clientHeight||0,window.innerHeight||0)}};let g=function(){let t=e.getCookie("cmplz_statistics"),o=e.getCookie("cmplz_marketing");return!(!e.getCookie("cmplz_consent_status")&&!e.getCookie("cmplz_banner-status"))&&{analytics:"allow"===t,ads:"allow"===o,visitorHasChosen:!0}},m=function(){let t=e.getCookie("cookielawinfo-checkbox-analytics")||e.getCookie("cookielawinfo-checkbox-analytiques"),o=e.getCookie("cookielawinfo-checkbox-advertisement")||e.getCookie("cookielawinfo-checkbox-publicite"),a=e.getCookie("CookieLawInfoConsent");return!(!t&&!o)&&{analytics:"yes"===t,ads:"yes"===o,visitorHasChosen:!!a}},y={categories:{},pixels:[],mode:"category",visitorHasChosen:!1};e.getConsentValues=function(){return y},e.setConsentValueCategories=function(){let e=arguments.length>0&&arguments[0]!==o&&arguments[0],t=arguments.length>1&&arguments[1]!==o&&arguments[1];y.categories.analytics=e,y.categories.ads=t},e.updateConsentCookieValues=function(){let t,a=arguments.length>0&&arguments[0]!==o&&arguments[0];if(t=e.getCookie("CookieConsent"))t=decodeURI(t),y.categories.analytics=t.indexOf("statistics:true")>=0,y.categories.ads=t.indexOf("marketing:true")>=0,y.visitorHasChosen=!0;else if(t=e.getCookie("CookieScriptConsent"))t=JSON.parse(t),"reject"===t.action?(y.categories.analytics=!1,y.categories.ads=!1):2===t.categories.length?(y.categories.analytics=!0,y.categories.ads=!0):(y.categories.analytics=t.categories.indexOf("performance")>=0,y.categories.ads=t.categories.indexOf("targeting")>=0),y.visitorHasChosen=!0;else if(t=e.getCookie("borlabs-cookie")){var r,n,i,s,d,l,c,u;t=decodeURI(t),t=JSON.parse(t),y.categories.analytics=!(null===(r=t)||void 0===r||null===(n=r.consents)||void 0===n||!n.statistics),y.categories.ads=!(null===(i=t)||void 0===i||null===(s=i.consents)||void 0===s||!s.marketing),y.visitorHasChosen=!0,y.pixels=[...(null===(d=t)||void 0===d||null===(l=d.consents)||void 0===l?void 0:l.statistics)||[],...(null===(c=t)||void 0===c||null===(u=c.consents)||void 0===u?void 0:u.marketing)||[]],y.mode="pixel"}else(t=g())?(y.categories.analytics=!0===t.analytics,y.categories.ads=!0===t.ads,y.visitorHasChosen=t.visitorHasChosen):(t=e.getCookie("cookie_notice_accepted"))?(y.categories.analytics=!0,y.categories.ads=!0,y.visitorHasChosen=!0):(t=e.getCookie("hu-consent"))?(t=JSON.parse(t),y.categories.analytics=!!t.categories[3],y.categories.ads=!!t.categories[4],y.visitorHasChosen=!0):(t=m())?(y.categories.analytics=!0===t.analytics,y.categories.ads=!0===t.ads,y.visitorHasChosen=!0===t.visitorHasChosen):(t=e.getCookie("moove_gdpr_popup"))?(t=JSON.parse(t),y.categories.analytics="1"===t.thirdparty,y.categories.ads="1"===t.advanced,y.visitorHasChosen=!0):(y.categories.analytics=!a,y.categories.ads=!a)},e.updateConsentCookieValues(),e.setConsentDefaultValuesToExplicit=function(){y.categories={analytics:!1,ads:!1}},e.canIFire=function(t,o){let a;return"category"===y.mode?a=!!y.categories[t]:"pixel"===y.mode?a=y.pixels.includes(o):(console.error("Couldn't find a valid consent mode in wpmConsentValues"),a=!1),!!a||(e.urlHasParameter("debugConsentMode")&&(null!==(r=wpmDataLayer)&&void 0!==r&&null!==(n=r.shop)&&void 0!==n&&null!==(i=n.cookie_consent_mgmt)&&void 0!==i&&i.explicit_consent?console.log('WooCommerce Pixel Manager: The "'+o+" (category: "+t+')" pixel has not fired because you have not given consent for it yet. (The shop is in explicit consent mode.)'):console.log('WooCommerce Pixel Manager: The "'+o+" (category: "+t+')" pixel has not fired because you have removed consent for this pixel. (The shop is in implicit consent mode.)')),!1);var r,n,i},e.scriptTagObserver=new MutationObserver((o=>{o.forEach((o=>{let{addedNodes:a}=o;[...a].forEach((o=>{t(o).data("wpm-cookie-category")&&(e.shouldScriptBeActive(o)?e.unblockScript(o):e.blockScript(o))}))}))})),e.scriptTagObserver.observe(document.head,{childList:!0,subtree:!0}),window.addEventListener("DOMContentLoaded",(()=>e.scriptTagObserver.disconnect())),e.shouldScriptBeActive=function(e){var o,a,r,n;return!((wpmDataLayer.shop.cookie_consent_mgmt.explicit_consent||y.visitorHasChosen)&&("category"!==y.mode||!t(e).data("wpm-cookie-category").split(",").some((e=>y.categories[e])))&&("pixel"!==y.mode||!y.pixels.includes(t(e).data("wpm-pixel-name")))&&("pixel"!==y.mode||"google"!==t(e).data("wpm-pixel-name")||!["google-analytics","google-ads"].some((e=>y.pixels.includes(e))))&&(null===(o=wpmDataLayer)||void 0===o||null===(a=o.pixels)||void 0===a||null===(r=a.google)||void 0===r||null===(n=r.consent_mode)||void 0===n||!n.active||"google"!==t(e).data("wpm-pixel-name")))},e.unblockScript=function(e){let a=arguments.length>1&&arguments[1]!==o&&arguments[1];a&&t(e).remove();let r=t(e).data("wpm-src");r&&t(e).attr("src",r),e.type="text/javascript",a&&t(e).appendTo("head"),jQuery(document).trigger("wpmPreLoadPixels",{})},e.blockScript=function(e){let a=arguments.length>1&&arguments[1]!==o&&arguments[1];a&&t(e).remove(),t(e).attr("src")&&t(e).removeAttr("src"),e.type="blocked/javascript",a&&t(e).appendTo("head")},e.unblockAllScripts=function(){let a=!(arguments.length>0&&arguments[0]!==o)||arguments[0],r=!(arguments.length>1&&arguments[1]!==o)||arguments[1];t.each(t('script[type="blocked/javascript"]'),(function(o,n){(t(n).data("wpm-cookie-category").includes("analytics")&&a||t(n).data("wpm-cookie-category").includes("ads")&&r)&&e.unblockScript(n,!0)})),jQuery(document).trigger("wpmPreLoadPixels",{})},e.unblockSelectedPixels=function(){t.each(t('script[type="blocked/javascript"]'),(function(o,a){(y.pixels.includes(t(a).data("wpm-pixel-name"))||"google"===t(a).data("wpm-pixel-name")&&["google-analytics","google-ads"].some((e=>y.pixels.includes(e))))&&e.unblockScript(a,!0)})),jQuery(document).trigger("wpmPreLoadPixels",{})},window.addEventListener("borlabs-cookie-consent-saved",(function(t){e.updateConsentCookieValues(),"pixel"===y.mode?(e.unblockSelectedPixels(),e.updateGoogleConsentMode(y.pixels.includes("google-analytics"),y.pixels.includes("google-ads"))):(e.unblockAllScripts(y.categories.analytics,y.categories.ads),e.updateGoogleConsentMode(y.categories.analytics,y.categories.ads))})),window.addEventListener("CookiebotOnAccept",(function(t){Cookiebot.consent.statistics&&(y.categories.analytics=!0),Cookiebot.consent.marketing&&(y.categories.ads=!0),e.unblockAllScripts(y.categories.analytics,y.categories.ads),e.updateGoogleConsentMode(y.categories.analytics,y.categories.ads)}),!1),window.addEventListener("CookieScriptAccept",(function(t){t.detail.categories.includes("performance")&&(y.categories.analytics=!0),t.detail.categories.includes("targeting")&&(y.categories.ads=!0),e.unblockAllScripts(y.categories.analytics,y.categories.ads),e.updateGoogleConsentMode(y.categories.analytics,y.categories.ads)})),window.addEventListener("CookieScriptAcceptAll",(function(t){e.unblockAllScripts(!0,!0),e.updateGoogleConsentMode(!0,!0)})),document.addEventListener("cmplzStatusChange",(function(t){e.updateConsentCookieValues(),e.unblockAllScripts(y.categories.analytics,y.categories.ads),e.updateGoogleConsentMode(y.categories.analytics,y.categories.ads)})),document.addEventListener("setCookieNotice",(function(t){e.updateConsentCookieValues(),e.unblockAllScripts(y.categories.analytics,y.categories.ads),e.updateGoogleConsentMode(y.categories.analytics,y.categories.ads)})),e.huObserver=new MutationObserver((function(t){t.forEach((t=>{let{addedNodes:o}=t;[...o].forEach((t=>{"hu"===t.id&&jQuery(".hu-cookies-save").on("click",(function(t){e.updateConsentCookieValues(),e.unblockAllScripts(y.categories.analytics,y.categories.ads),e.updateGoogleConsentMode(y.categories.analytics,y.categories.ads)}))}))}))})),window.hu&&e.huObserver.observe(document.documentElement||document.body,{childList:!0,subtree:!0}),e.version=function(){console.log(wpmDataLayer.version)},e.loadScriptAndCacheIt=function(e,t){return t=jQuery.extend(t||{},{dataType:"script",cache:!0,url:e}),jQuery.ajax(t)},e.getOrderItemPrice=function(e){return(e.total+e.total_tax)/e.quantity},e.hasLoginEventFired=function(){let t=e.getWpmSessionData();return null==t?void 0:t.loginEventFired},e.setLoginEventFired=function(){let t=e.getWpmSessionData();t.loginEventFired=!0,e.setWpmSessionData(t)},e.wpmDataLayerExists=function(){return new Promise((function(e){!function t(){if("undefined"!=typeof wpmDataLayer)return e();setTimeout(t,50)}()}))},e.pageLoaded=function(){return new Promise((function(e){!function t(){if("complete"===document.readyState)return e();setTimeout(t,50)}()}))},e.pageReady=function(){return new Promise((function(e){!function t(){if("interactive"===document.readyState||"complete"===document.readyState)return e();setTimeout(t,50)}()}))},e.isMiniCartActive=function(){if(window.sessionStorage){for(const[e,t]of Object.entries(window.sessionStorage))if(e.includes("wc_fragments"))return!0;return!1}return!1},e.doesWooCommerceCartExist=function(){return document.cookie.includes("woocommerce_items_in_cart")},e.urlHasParameter=function(e){return new URLSearchParams(window.location.search).has(e)},window.wpmLoaded={}}(window.wpm=window.wpm||{},jQuery),wpm.pageReady().then((function(){wpm.wpmDataLayerExists().then((function(){wpm.startIntersectionObserverToWatch(),wpm.startProductsMutationObserverToWatch()})),jQuery(document).on("click",".remove_from_cart_button, .remove",(function(e){try{let e=new URL(jQuery(this).attr("href")),t=wpm.getProductIdByCartItemKeyUrl(e);wpm.removeProductFromCart(t)}catch(e){console.error(e)}})),jQuery(document).on("click",".add_to_cart_button:not(.product_type_variable), .ajax_add_to_cart, .single_add_to_cart_button",(function(e){try{if("product"===wpmDataLayer.shop.page_type){if(void 0!==jQuery(this).attr("href")&&jQuery(this).attr("href").includes("add-to-cart")){let e=1,t=jQuery(this).data("product_id");wpm.addProductToCart(t,e)}else if("simple"===wpmDataLayer.shop.product_type){let e=Number(jQuery(".input-text.qty").val());e||0===e||(e=1);let t=jQuery(this).val();wpm.addProductToCart(t,e)}else if("variable"===wpmDataLayer.shop.product_type){let e=Number(jQuery(".input-text.qty").val());e||0===e||(e=1);let t=jQuery("[name='variation_id']").val();wpm.addProductToCart(t,e)}else if("grouped"===wpmDataLayer.shop.product_type)jQuery(".woocommerce-grouped-product-list-item").each((function(){let e=Number(jQuery(this).find(".input-text.qty").val());e||0===e||(e=1);let t=jQuery(this).attr("class"),o=wpm.getPostIdFromString(t);wpm.addProductToCart(o,e)}));else if("bundle"===wpmDataLayer.shop.product_type){let e=Number(jQuery(".input-text.qty").val());e||0===e||(e=1);let t=jQuery("input[name=add-to-cart]").val();wpm.addProductToCart(t,e)}}else{let e=1,t=jQuery(this).data("product_id");wpm.addProductToCart(t,e)}}catch(e){console.error(e)}})),jQuery(document).one("click","a:not(.add_to_cart_button, .ajax_add_to_cart, .single_add_to_cart_button)",(function(e){try{if(jQuery(e.target).closest("a").attr("href")){let t=jQuery(e.target).closest("a").attr("href");if(t.includes("add-to-cart=")){let e=t.match(/(add-to-cart=)(\d+)/);e&&wpm.addProductToCart(e[2],1)}}}catch(e){console.error(e)}})),jQuery(document).on("click",".woocommerce-LoopProduct-link, .wc-block-grid__product, .product, .product-small, .type-product",(function(e){try{let e=jQuery(this).nextAll(".wpmProductId:first").data("id");if(e){if(e=getIdBasedOndVariationsOutputSetting(e),!e)throw Error("Wasn't able to retrieve a productId");if(wpmDataLayer.products&&wpmDataLayer.products[e]){let t=wpm.getProductDetailsFormattedForEvent(e);jQuery(document).trigger("wpmSelectContentGaUa",t),jQuery(document).trigger("wpmSelectItem",t)}}}catch(e){console.error(e)}})),jQuery(document).one("click",".checkout-button, .cart-checkout-button, .button.checkout",(function(e){jQuery(document).trigger("wpmBeginCheckout")})),jQuery(document).on("input","#billing_email",(function(){wpm.isEmail(jQuery(this).val())&&(wpm.fireCheckoutProgress(2),wpm.emailSelected=!0)})),jQuery(document).on("click",".wc_payment_methods",(function(){!1===wpm.paymentMethodSelected&&wpm.fireCheckoutProgress(3),wpm.fireCheckoutOption(3,jQuery("input[name='payment_method']:checked").val()),wpm.paymentMethodSelected=!0})),jQuery(document).one("click","#place_order",(function(){!1===wpm.emailSelected&&wpm.fireCheckoutProgress(2),!1===wpm.paymentMethodSelected&&(wpm.fireCheckoutProgress(3),wpm.fireCheckoutOption(3,jQuery("input[name='payment_method']:checked").val())),wpm.fireCheckoutProgress(4)})),jQuery(document).on("click","[name='update_cart']",(function(e){try{jQuery(".cart_item").each((function(){let e=new URL(jQuery(this).find(".product-remove").find("a").attr("href")),t=wpm.getProductIdByCartItemKeyUrl(e),o=jQuery(this).find(".qty").val();0===o?wpm.removeProductFromCart(t):o<wpmDataLayer.cart[t].quantity?wpm.removeProductFromCart(t,wpmDataLayer.cart[t].quantity-o):o>wpmDataLayer.cart[t].quantity&&wpm.addProductToCart(t,o-wpmDataLayer.cart[t].quantity)}))}catch(e){console.error(e),wpm.getCartItemsFromBackend()}})),jQuery(document).on("click",".add_to_wishlist, .wl-add-to",(function(){try{let e;if(jQuery(this).data("productid")?e=jQuery(this).data("productid"):jQuery(this).data("product-id")&&(e=jQuery(this).data("product-id")),!e)throw Error("Wasn't able to retrieve a productId");let t=wpm.getProductDetailsFormattedForEvent(e);jQuery(document).trigger("wpmAddToWishlist",t)}catch(e){console.error(e)}})),jQuery(document).on("updated_cart_totals",(function(){jQuery(document).trigger("wpmViewCart")})),jQuery(".single_variation_wrap").on("show_variation",(function(e,t){try{let e=getIdBasedOndVariationsOutputSetting(t.variation_id);if(!e)throw Error("Wasn't able to retrieve a productId");if(wpmDataLayer.products&&wpmDataLayer.products[e]){let t=wpm.getProductDetailsFormattedForEvent(e);jQuery(document).trigger("wpmViewItem",t)}}catch(e){console.error(e)}})),jQuery(".single_variation_wrap").on("hide_variation",(function(e,t){try{var o,a;let e=jQuery("body").attr("class").match(/(postid-)(\d+)/)[2];if(!e)throw Error("Wasn't able to retrieve a productId");if("variable"===wpmDataLayer.shop.product_type&&null!==(o=wpmDataLayer)&&void 0!==o&&null!==(a=o.general)&&void 0!==a&&a.variationsOutput)for(const[t,o]of Object.entries(wpmDataLayer.products))if("parentId"in o){e=o.id;break}if(wpmDataLayer.products&&wpmDataLayer.products[e]){let t=wpm.getProductDetailsFormattedForEvent(e);jQuery(document).trigger("wpmViewItem",t)}}catch(e){console.error(e)}}))})),jQuery(window).on("wpmLoad",(function(){try{wpm.doesWooCommerceCartExist()&&wpm.getCartItems()}catch(e){console.error(e)}})),jQuery(window).on("wpmLoad",(function(){wpmDataLayer.products=wpmDataLayer.products||{};let e=wpm.getAddToCartLinkProductIds();wpm.getProductsFromBackend(e)})),jQuery(window).on("wpmLoad",(function(){if(!wpm.getCookie("wpmReferrer"))if(document.referrer){let e=new URL(document.referrer).hostname;e!==window.location.host?wpm.setCookie("wpmReferrer",e):wpm.setCookie("wpmReferrer","")}else wpm.setCookie("wpmReferrer","")})),jQuery(window).on("wpmLoad",(function(){try{var e;if("undefined"!=typeof wpmDataLayer&&(null===(e=wpmDataLayer)||void 0===e||!e.wpmLoadFired)){var t,o;if(jQuery(document).trigger("wpmLoadAlways"),"product"===wpmDataLayer.shop.page_type&&"variable"!==wpmDataLayer.shop.product_type&&wpm.getMainProductIdFromProductPage()){let e=wpm.getProductDataForViewItemEvent(wpm.getMainProductIdFromProductPage());jQuery(document).trigger("wpmViewItem",e)}else"product_category"===wpmDataLayer.shop.page_type?jQuery(document).trigger("wpmCategory"):"search"===wpmDataLayer.shop.page_type?jQuery(document).trigger("wpmSearch"):"cart"===wpmDataLayer.shop.page_type?jQuery(document).trigger("wpmViewCart"):"order_received_page"===wpmDataLayer.shop.page_type&&wpmDataLayer.order?wpm.isOrderIdStored(wpmDataLayer.order.id)||(jQuery(document).trigger("wpmOrderReceivedPage"),wpm.writeOrderIdToStorage(wpmDataLayer.order.id)):jQuery(document).trigger("wpmEverywhereElse");null!==(t=wpmDataLayer)&&void 0!==t&&null!==(o=t.user)&&void 0!==o&&o.id&&!wpm.hasLoginEventFired()&&(jQuery(document).trigger("wpmLogin"),wpm.setLoginEventFired()),wpmDataLayer.wpmLoadFired=!0}}catch(e){console.error(e)}})),jQuery(window).on("wpmPreLoadPixels",(function(){var e,t,o;null!==(e=wpmDataLayer)&&void 0!==e&&null!==(t=e.shop)&&void 0!==t&&null!==(o=t.cookie_consent_mgmt)&&void 0!==o&&o.explicit_consent&&wpm.updateConsentCookieValues(!0),jQuery(document).trigger("wpmLoadPixels",{})}))}},t={};function o(a){var r=t[a];if(void 0!==r)return r.exports;var n=t[a]={exports:{}};return e[a](n,n.exports,o),n.exports}o(230),o(577),o(354),o(464),o(234),o(785),o(570),o(497),o(560)})();
2
  //# sourceMappingURL=wpm-public.p1.min.js.map
js/public/wpm-public.p1.min.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"wpm-public.p1.min.js","mappings":"sBAKAA,OAAOC,UAAUC,GAAG,iBAAiB,WAAY,gBAEhC,QAAZ,EAAAC,oBAAA,mBAAcC,cAAd,mBAAsBC,gBAAtB,UAAgCC,UAAY,UAACH,oBAAD,iBAAC,EAAcC,cAAf,iBAAC,EAAs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C6F,EAAQ,M,SCMRrF,IAAIkc,qBACFnW,MAAK,WACL7D,QAAQ6P,IAAI,+BAAiCpS,aAAa2D,QAAQqZ,IAAM,MAAQ,QAAS,YAAchd,aAAa2D,QAAQmD,OAAS,WACrIjH,OAAOC,UAAU6B,QAAQ,mBAAoB,OAE7CyE,MAAK,WACL/F,IAAIsc,aAAavW,MAAK,WACrBvG,OAAOC,UAAU6B,QAAQ,UAAW,UAWvCtB,IAAIwc,YAAYzW,MAAK,WAMpB/F,IAAIkc,qBACFnW,MAAK,WAEL/F,IAAI+U,mCAGJ/U,IAAI0V,+CC1CHkH,EAA2B,GAG/B,SAASC,EAAoBC,GAE5B,IAAIC,EAAeH,EAAyBE,GAC5C,QAAqBna,IAAjBoa,EACH,OAAOA,EAAaC,QAGrB,IAAIC,EAASL,EAAyBE,GAAY,CAGjDE,QAAS,IAOV,OAHAE,EAAoBJ,GAAUG,EAAQA,EAAOD,QAASH,GAG/CI,EAAOD,QCjBf3X,EAAQ,KAGRrF,IAAIoc,eAAerW,MAAK,WAEvBV,EAAQ,KAERA,EAAQ,IACRA,EAAQ,IACRA,EAAQ,KAuBRA,EAAQ,S","sources":["webpack://WooCommerce-Pixel-Manager/./src/js/public/facebook/event_listeners.js","webpack://WooCommerce-Pixel-Manager/./src/js/public/facebook/functions.js","webpack://WooCommerce-Pixel-Manager/./src/js/public/facebook/loader.js","webpack://WooCommerce-Pixel-Manager/./src/js/public/google/ads/event_listeners.js","webpack://WooCommerce-Pixel-Manager/./src/js/public/google/ads/functions.js","webpack://WooCommerce-Pixel-Manager/./src/js/public/google/ads/loader.js","webpack://WooCommerce-Pixel-Manager/./src/js/public/google/analytics/ga3/event_listeners.js","webpack://WooCommerce-Pixel-Manager/./src/js/public/google/analytics/ga3/functions.js","webpack://WooCommerce-Pixel-Manager/./src/js/public/google/analytics/ga3/loader.js","webpack://WooCommerce-Pixel-Manager/./src/js/public/google/analytics/ga4/event_listeners.js","webpack://WooCommerce-Pixel-Manager/./src/js/public/google/analytics/ga4/functions.js","webpack://WooCommerce-Pixel-Manager/./src/js/public/google/analytics/ga4/loader.js","webpack://WooCommerce-Pixel-Manager/./src/js/public/google/analytics/loader.js","webpack://WooCommerce-Pixel-Manager/./src/js/public/google/base/event_listeners.js","webpack://WooCommerce-Pixel-Manager/./src/js/public/google/base/functions.js","webpack://WooCommerce-Pixel-Manager/./src/js/public/google/base/loader.js","webpack://WooCommerce-Pixel-Manager/./src/js/public/google/loader.js","webpack://WooCommerce-Pixel-Manager/./src/js/public/google/optimize/event_listeners.js","webpack://WooCommerce-Pixel-Manager/./src/js/public/google/optimize/functions.js","webpack://WooCommerce-Pixel-Manager/./src/js/public/google/optimize/loader.js","webpack://WooCommerce-Pixel-Manager/./src/js/public/hotjar/event_listeners.js","webpack://WooCommerce-Pixel-Manager/./src/js/public/hotjar/functions.js","webpack://WooCommerce-Pixel-Manager/./src/js/public/hotjar/loader.js","webpack://WooCommerce-Pixel-Manager/./src/js/public/wpm/event_listeners.js","webpack://WooCommerce-Pixel-Manager/./src/js/public/wpm/functions.js","webpack://WooCommerce-Pixel-Manager/./src/js/public/wpm/functions_loader.js","webpack://WooCommerce-Pixel-Manager/./src/js/public/wpm/init.js","webpack://WooCommerce-Pixel-Manager/webpack/bootstrap","webpack://WooCommerce-Pixel-Manager/./src/js/public/main.js"],"sourcesContent":["/**\n * All event listeners\n * */\n\n// Load pixel event\njQuery(document).on(\"wpmLoadPixels\", function () {\n\n\tif (wpmDataLayer?.pixels?.facebook?.pixel_id && !wpmDataLayer?.pixels?.facebook?.loaded) {\n\t\tif (wpm.canIFire(\"ads\", \"facebook-ads\")) wpm.loadFacebookPixel()\n\t}\n})\n\n// AddToCart event\njQuery(document).on(\"wpmAddToCart\", function (event, product) {\n\n\ttry {\n\t\tif (!wpmDataLayer?.pixels?.facebook?.loaded) return\n\n\t\tlet eventId = wpm.getRandomEventId()\n\n\t\t// console.log('eventId: ' + eventId);\n\n\t\tfbq(\"track\", \"AddToCart\", {\n\t\t\tcontent_type: \"product\",\n\t\t\tcontent_name: product.name,\n\t\t\tcontent_ids : product.dyn_r_ids[wpmDataLayer.pixels.facebook.dynamic_remarketing.id_type],\n\t\t\tvalue : parseFloat(product.quantity * product.price),\n\t\t\tcurrency : product.currency,\n\t\t}, {\n\t\t\teventID: eventId,\n\t\t})\n\n\n\t\tproduct[\"currency\"] = wpmDataLayer.shop.currency\n\n\t\tjQuery(document).trigger(\"wpmFbCapiEvent\", {\n\t\t\tevent_name : \"AddToCart\",\n\t\t\tevent_id : eventId,\n\t\t\tuser_data : wpm.getFbUserData(),\n\t\t\tproduct_data : product,\n\t\t\tproduct_id : product.dyn_r_ids[wpmDataLayer.pixels.facebook.dynamic_remarketing.id_type],\n\t\t\tevent_source_url: window.location.href,\n\t\t})\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n\n// InitiateCheckout event\njQuery(document).on(\"wpmBeginCheckout\", function (event) {\n\n\ttry {\n\t\t// console.log('firing facebook ads InitiateCheckout event');\n\n\t\tif (!wpmDataLayer?.pixels?.facebook?.loaded) return\n\n\t\tlet eventId = wpm.getRandomEventId()\n\n\t\tfbq(\"track\", \"InitiateCheckout\", {}, {\n\t\t\teventID: eventId,\n\t\t})\n\n\t\tjQuery(document).trigger(\"wpmFbCapiEvent\", {\n\t\t\tevent_name : \"InitiateCheckout\",\n\t\t\tevent_id : eventId,\n\t\t\tuser_data : wpm.getFbUserData(),\n\t\t\tevent_source_url: window.location.href,\n\t\t})\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n\n// AddToWishlist event\njQuery(document).on(\"wpmAddToWishlist\", function (event, product) {\n\n\ttry {\n\t\t// console.log('firing facebook ads AddToWishlist event');\n\t\t// console.log(product);\n\n\t\tif (!wpmDataLayer?.pixels?.facebook?.loaded) return\n\n\t\tlet eventId = wpm.getRandomEventId()\n\n\t\tfbq(\"track\", \"AddToWishlist\", {\n\t\t\tcontent_type: \"product\",\n\t\t\tcontent_name: product.name,\n\t\t\tcontent_ids : product.dyn_r_ids[wpmDataLayer.pixels.facebook.dynamic_remarketing.id_type],\n\t\t\tvalue : parseFloat(product.quantity * product.price),\n\t\t\tcurrency : product.currency,\n\t\t}, {\n\t\t\teventID: eventId,\n\t\t})\n\n\n\t\tproduct[\"currency\"] = wpmDataLayer.shop.currency\n\n\t\tjQuery(document).trigger(\"wpmFbCapiEvent\", {\n\t\t\tevent_name : \"AddToWishlist\",\n\t\t\tevent_id : eventId,\n\t\t\tuser_data : wpm.getFbUserData(),\n\t\t\tproduct_data : product,\n\t\t\tproduct_id : product.dyn_r_ids[wpmDataLayer.pixels.facebook.dynamic_remarketing.id_type],\n\t\t\tevent_source_url: window.location.href,\n\t\t})\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n\n// ViewContent event\njQuery(document).on(\"wpmViewItem\", function (event, product) {\n\n\ttry {\n\t\t// console.log('firing facebook ads ViewContent event');\n\t\t// console.log(product);\n\n\t\tif (!wpmDataLayer?.pixels?.facebook?.loaded) return\n\n\t\twpm.fbViewContent(product)\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n\n// view search event\njQuery(document).on(\"wpmSearch\", function () {\n\n\ttry {\n\t\tif (!wpmDataLayer?.pixels?.facebook?.loaded) return\n\n\t\tlet eventId = wpm.getRandomEventId()\n\n\t\tfbq(\"track\", \"Search\", {}, {\n\t\t\teventID: eventId,\n\t\t})\n\n\t\tjQuery(document).trigger(\"wpmFbCapiEvent\", {\n\t\t\tevent_name : \"Search\",\n\t\t\tevent_id : eventId,\n\t\t\tuser_data : wpm.getFbUserData(),\n\t\t\tevent_source_url: window.location.href,\n\t\t})\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n\n// load always event\njQuery(document).on(\"wpmLoadAlways\", function () {\n\n\ttry {\n\t\tif (!wpmDataLayer?.pixels?.facebook?.loaded) return\n\n\t\twpm.setFbUserData()\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n\n// view order received page event\n// https://developers.pinterest.com/docs/tag/conversion/\njQuery(document).on(\"wpmOrderReceivedPage\", function () {\n\n\ttry {\n\t\tif (!wpmDataLayer?.pixels?.facebook?.loaded) return\n\n\t\tfbq(\"track\", \"Purchase\",\n\t\t\t{\n\t\t\t\tcontent_type: \"product\",\n\t\t\t\tvalue : wpmDataLayer.order.value_filtered,\n\t\t\t\tcurrency : wpmDataLayer.order.currency,\n\t\t\t\tcontent_ids : wpm.facebookContentIds(),\n\t\t\t},\n\t\t\t{eventID: wpmDataLayer.order.id},\n\t\t)\n\n\n\t\t// console.log(wpm.facebookContentIds())\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n","/**\n * Add functions for Facebook\n * */\n\n(function (wpm, $, undefined) {\n\n\tlet fBUserData\n\n\twpm.loadFacebookPixel = function () {\n\n\t\ttry {\n\t\t\twpmDataLayer.pixels.facebook.loaded = true\n\n\t\t\t// @formatter:off\n\t\t\t!function(f,b,e,v,n,t,s)\n\t\t\t{if(f.fbq)return;n=f.fbq=function(){n.callMethod?\n\t\t\t\tn.callMethod.apply(n,arguments):n.queue.push(arguments)};\n\t\t\t\tif(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0';\n\t\t\t\tn.queue=[];t=b.createElement(e);t.async=!0;\n\t\t\t\tt.src=v;s=b.getElementsByTagName(e)[0];\n\t\t\t\ts.parentNode.insertBefore(t,s)}(window, document,'script',\n\t\t\t\t'https://connect.facebook.net/en_US/fbevents.js');\n\t\t\t// @formatter:on\n\n\t\t\tfbq(\"init\", wpmDataLayer.pixels.facebook.pixel_id)\n\t\t\tfbq(\"track\", \"PageView\")\n\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t}\n\t}\n\n\twpm.getRandomEventId = function () {\n\t\treturn (Math.random() + 1).toString(36).substring(2)\n\t}\n\n\twpm.getFbUserData = function () {\n\t\t// We need the first one for InitiateCheckout\n\t\t// where getting the user_data from the browser is too slow\n\t\t// using wpm.getCookie(), so we cache the user_data earlier.\n\t\t// And we need the second one because the ViewContent hit happens too fast\n\t\t// after adding a variation to the cart because the function to cache\n\t\t// the user_data is too slow. But we can get the user_data using wpm.getCookie()\n\t\t// because we don't move away from the page and can wait for the browser\n\t\t// to get it.\n\t\tif (fBUserData) {\n\t\t\treturn fBUserData\n\t\t} else {\n\t\t\treturn wpm.getFbUserDataFromBrowser()\n\t\t}\n\t}\n\n\twpm.setFbUserData = function () {\n\t\tfBUserData = wpm.getFbUserDataFromBrowser()\n\t}\n\n\twpm.getFbUserDataFromBrowser = function () {\n\t\treturn {\n\t\t\tfbp : wpm.getCookie(\"_fbp\"),\n\t\t\tfbc : wpm.getCookie(\"_fbc\"),\n\t\t\tclient_user_agent: navigator.userAgent,\n\t\t}\n\t}\n\n\twpm.fbViewContent = function (product) {\n\n\t\ttry {\n\t\t\tif (!wpmDataLayer?.pixels?.facebook?.loaded) return\n\n\t\t\tlet eventId = wpm.getRandomEventId()\n\n\t\t\tfbq(\"track\", \"ViewContent\", {\n\t\t\t\tcontent_type: \"product\",\n\t\t\t\tcontent_name: product.name,\n\t\t\t\t// content_category: product.category,\n\t\t\t\tcontent_ids: product.dyn_r_ids[wpmDataLayer.pixels.facebook.dynamic_remarketing.id_type],\n\t\t\t\tcurrency : wpmDataLayer.shop.currency,\n\t\t\t\tvalue : product.price,\n\t\t\t}, {\n\t\t\t\teventID: eventId,\n\t\t\t})\n\n\t\t\tproduct[\"currency\"] = wpmDataLayer.shop.currency\n\n\t\t\tjQuery(document).trigger(\"wpmFbCapiEvent\", {\n\t\t\t\tevent_name : \"ViewContent\",\n\t\t\t\tevent_id : eventId,\n\t\t\t\tuser_data : wpm.getFbUserData(),\n\t\t\t\tproduct_data : product,\n\t\t\t\tproduct_id : product.dyn_r_ids[wpmDataLayer.pixels.facebook.dynamic_remarketing.id_type],\n\t\t\t\tevent_source_url: window.location.href,\n\t\t\t})\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t}\n\t}\n\n\twpm.facebookContentIds = function () {\n\t\tlet prodIds = []\n\n\t\tfor (const [key, item] of Object.entries(wpmDataLayer.order.items)) {\n\n\t\t\tif (wpmDataLayer?.general?.variationsOutput && 0 !== item.variation_id) {\n\t\t\t\tprodIds.push(String(wpmDataLayer.products[item.variation_id].dyn_r_ids[wpmDataLayer.pixels.facebook.dynamic_remarketing.id_type]))\n\t\t\t} else {\n\t\t\t\tprodIds.push(String(wpmDataLayer.products[item.id].dyn_r_ids[wpmDataLayer.pixels.facebook.dynamic_remarketing.id_type]))\n\t\t\t}\n\t\t}\n\n\t\treturn prodIds\n\t}\n\n}(window.wpm = window.wpm || {}, jQuery));\n","/**\n * Facebook loader\n */\n\nrequire(\"./functions\")\nrequire(\"./event_listeners\")\n\n// #if process.env.TIER === 'premium'\n// require(\"./functions_premium\")\n// require(\"./event_listeners_premium\")\n// #endif\n\n","/**\n * Load Google Ads event listeners\n * */\n\n// view_item_list event\njQuery(document).on(\"wpmViewItemList\", function (event, product) {\n\n\ttry {\n\t\tif(jQuery.isEmptyObject(wpmDataLayer?.pixels?.google?.ads?.conversionIds)) return\n\t\tif (!wpmDataLayer?.pixels?.google?.ads?.dynamic_remarketing?.status) return\n\t\tif (!wpm.googleConfigConditionsMet(\"ads\")) return\n\n\n\t\tif (\n\t\t\twpmDataLayer?.general?.variationsOutput &&\n\t\t\tproduct.isVariable &&\n\t\t\twpmDataLayer.pixels.google.ads.dynamic_remarketing.send_events_with_parent_ids === false\n\t\t) return\n\n\t\t// try to prevent that WC sends cached hits to Google\n\t\tif (!product) return\n\n\t\twpm.gtagLoaded().then(function () {\n\t\t\tgtag(\"event\", \"view_item_list\", {\n\t\t\t\tsend_to: wpm.getGoogleAdsConversionIdentifiers(),\n\t\t\t\titems : [{\n\t\t\t\t\tid : product.dyn_r_ids[wpmDataLayer.pixels.google.ads.dynamic_remarketing.id_type],\n\t\t\t\t\tgoogle_business_vertical: wpmDataLayer.pixels.google.ads.google_business_vertical,\n\t\t\t\t}],\n\t\t\t})\n\t\t})\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n\n// add_to_cart event\njQuery(document).on(\"wpmAddToCart\", function (event, product) {\n\n\ttry {\n\t\tif(jQuery.isEmptyObject(wpmDataLayer?.pixels?.google?.ads?.conversionIds)) return\n\t\tif (!wpmDataLayer?.pixels?.google?.ads?.dynamic_remarketing?.status) return\n\t\tif (!wpm.googleConfigConditionsMet(\"ads\")) return\n\n\t\twpm.gtagLoaded().then(function () {\n\t\t\tgtag(\"event\", \"add_to_cart\", {\n\t\t\t\tsend_to: wpm.getGoogleAdsConversionIdentifiers(),\n\t\t\t\tvalue : product.quantity * product.price,\n\t\t\t\titems : [{\n\t\t\t\t\tid : product.dyn_r_ids[wpmDataLayer.pixels.google.ads.dynamic_remarketing.id_type],\n\t\t\t\t\tquantity : product.quantity,\n\t\t\t\t\tprice : product.price,\n\t\t\t\t\tgoogle_business_vertical: wpmDataLayer.pixels.google.ads.google_business_vertical,\n\t\t\t\t}],\n\t\t\t})\n\t\t})\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n\n// view_item event\njQuery(document).on(\"wpmViewItem\", function (event, product) {\n\n\ttry {\n\t\tif(jQuery.isEmptyObject(wpmDataLayer?.pixels?.google?.ads?.conversionIds)) return\n\t\tif (!wpmDataLayer?.pixels?.google?.ads?.dynamic_remarketing?.status) return\n\t\tif (!wpm.googleConfigConditionsMet(\"ads\")) return\n\n\n\t\twpm.gtagLoaded().then(function () {\n\t\t\tgtag(\"event\", \"view_item\", {\n\t\t\t\tsend_to: wpm.getGoogleAdsConversionIdentifiers(),\n\t\t\t\tvalue : (product.quantity ? product.quantity : 1) * product.price,\n\t\t\t\titems : [{\n\t\t\t\t\tid : product.dyn_r_ids[wpmDataLayer.pixels.google.ads.dynamic_remarketing.id_type],\n\t\t\t\t\tquantity : (product.quantity ? product.quantity : 1),\n\t\t\t\t\tprice : product.price,\n\t\t\t\t\tgoogle_business_vertical: wpmDataLayer.pixels.google.ads.google_business_vertical,\n\t\t\t\t}],\n\t\t\t})\n\t\t})\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n\n\n// view search event\njQuery(document).on(\"wpmSearch\", function () {\n\n\ttry {\n\t\tif(jQuery.isEmptyObject(wpmDataLayer?.pixels?.google?.ads?.conversionIds)) return\n\t\tif (!wpmDataLayer?.pixels?.google?.ads?.dynamic_remarketing?.status) return\n\t\tif (!wpm.googleConfigConditionsMet(\"ads\")) return\n\n\n\t\tlet products = []\n\n\t\tfor (const [key, product] of Object.entries(wpmDataLayer.products)) {\n\n\t\t\tif (\n\t\t\t\twpmDataLayer?.general?.variationsOutput &&\n\t\t\t\tproduct.isVariable &&\n\t\t\t\twpmDataLayer.pixels.google.ads.dynamic_remarketing.send_events_with_parent_ids === false\n\t\t\t) return\n\n\t\t\tproducts.push({\n\t\t\t\tid : product.dyn_r_ids[wpmDataLayer.pixels.google.ads.dynamic_remarketing.id_type],\n\t\t\t\tgoogle_business_vertical: wpmDataLayer.pixels.google.ads.google_business_vertical,\n\t\t\t})\n\t\t}\n\n\t\t// console.log(products);\n\n\t\twpm.gtagLoaded().then(function () {\n\t\t\tgtag(\"event\", \"view_search_results\", {\n\t\t\t\tsend_to: wpm.getGoogleAdsConversionIdentifiers(),\n\t\t\t\t// value : 1 * product.price,\n\t\t\t\titems: products,\n\t\t\t})\n\t\t})\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n\n\n// view order received page event\n// TODO distinguish with or without cart data active\njQuery(document).on(\"wpmOrderReceivedPage\", function () {\n\n\ttry {\n\t\tif(jQuery.isEmptyObject(wpmDataLayer?.pixels?.google?.ads?.conversionIds)) return\n\t\tif (!wpmDataLayer?.pixels?.google?.ads?.dynamic_remarketing?.status) return\n\t\tif (!wpm.googleConfigConditionsMet(\"ads\")) return\n\n\t\twpm.gtagLoaded().then(function () {\n\t\t\tgtag(\"event\", \"purchase\", {\n\t\t\t\tsend_to: wpm.getGoogleAdsConversionIdentifiers(),\n\t\t\t\tvalue : wpmDataLayer.order.value_filtered,\n\t\t\t\titems : wpm.getGoogleAdsDynamicRemarketingOrderItems(),\n\t\t\t})\n\t\t})\n\n\t\t// console.log(wpm.getGoogleAdsDynamicRemarketingOrderItems())\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n\n// user log in event\njQuery(document).on(\"wpmLogin\", function () {\n\n\ttry {\n\t\tif(jQuery.isEmptyObject(wpmDataLayer?.pixels?.google?.ads?.conversionIds)) return\n\t\tif (!wpmDataLayer?.pixels?.google?.ads?.dynamic_remarketing?.status) return\n\t\tif (!wpm.googleConfigConditionsMet(\"ads\")) return\n\n\n\t\twpm.gtagLoaded().then(function () {\n\t\t\tgtag(\"event\", \"login\", {\n\t\t\t\tsend_to: wpm.getGoogleAdsConversionIdentifiers(),\n\t\t\t})\n\t\t})\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n\n// view order received page event\n// new_customer parameter: https://support.google.com/google-ads/answer/9917012\njQuery(document).on(\"wpmOrderReceivedPage\", function () {\n\n\ttry {\n\t\tif(jQuery.isEmptyObject(wpmDataLayer?.pixels?.google?.ads?.conversionIds)) return\n\t\tif (!wpm.googleConfigConditionsMet(\"ads\")) return\n\n\t\tlet data_basic = {}\n\t\tlet data_with_cart = {}\n\n\t\tdata_basic = {\n\t\t\tsend_to : wpm.getGoogleAdsConversionIdentifiersWithLabel(),\n\t\t\ttransaction_id: wpmDataLayer.order.number,\n\t\t\tvalue : wpmDataLayer.order.value_filtered,\n\t\t\tcurrency : wpmDataLayer.order.currency,\n\t\t\tnew_customer : wpmDataLayer.order.new_customer,\n\t\t}\n\n\t\tif (wpmDataLayer?.order?.aw_merchant_id) {\n\t\t\tdata_with_cart = {\n\t\t\t\tdiscount : wpmDataLayer.order.discount,\n\t\t\t\taw_merchant_id : wpmDataLayer.order.aw_merchant_id,\n\t\t\t\taw_feed_country : wpmDataLayer.order.aw_feed_country,\n\t\t\t\taw_feed_language: wpmDataLayer.order.aw_feed_language,\n\t\t\t\titems : wpm.getGoogleAdsRegularOrderItems(),\n\t\t\t}\n\t\t}\n\n\t\twpm.gtagLoaded().then(function () {\n\t\t\tgtag(\"event\", \"conversion\", {...data_basic, ...data_with_cart})\n\t\t})\n\n\t\t// console.log({...data_basic,...data_with_cart})\n\n\t\t// console.log(wpm.getGoogleAdsOrderItems())\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n\n\n\n\n\n","/**\n * Load Google Ads functions\n * */\n\n(function (wpm, $, undefined) {\n\n\tlet conversionIdentifiers = []\n\n\twpm.getGoogleAdsConversionIdentifiersWithLabel = function () {\n\t\tfor (const [key, item] of Object.entries(wpmDataLayer.pixels.google.ads.conversionIds)) {\n\t\t\tconversionIdentifiers.push(key + \"/\" + item)\n\t\t}\n\t\treturn conversionIdentifiers\n\t}\n\n\twpm.getGoogleAdsConversionIdentifiers = function () {\n\n\t\tlet conversionIdentifiers = []\n\t\tfor (const [key, item] of Object.entries(wpmDataLayer.pixels.google.ads.conversionIds)) {\n\t\t\tconversionIdentifiers.push(key)\n\t\t}\n\n\t\treturn conversionIdentifiers\n\t}\n\n\twpm.getGoogleAdsRegularOrderItems = function () {\n\t\t// \"id\" : \"gla_34\",\n\t\t// \"quantity\": 1,\n\t\t// \"price\" : 45\n\n\t\tlet orderItems = []\n\n\t\tfor (const [key, item] of Object.entries(wpmDataLayer.order.items)) {\n\n\t\t\tlet orderItem\n\n\t\t\torderItem = {\n\t\t\t\tquantity: item.quantity,\n\t\t\t\tprice : item.price,\n\t\t\t}\n\n\t\t\tif (wpmDataLayer?.general?.variationsOutput && 0 !== item.variation_id) {\n\n\t\t\t\torderItem.id = String(wpmDataLayer.products[item.variation_id].dyn_r_ids[wpmDataLayer.pixels.google.ads.dynamic_remarketing.id_type])\n\t\t\t\torderItems.push(orderItem)\n\t\t\t} else {\n\n\t\t\t\torderItem.id = String(wpmDataLayer.products[item.id].dyn_r_ids[wpmDataLayer.pixels.google.ads.dynamic_remarketing.id_type])\n\t\t\t\torderItems.push(orderItem)\n\t\t\t}\n\t\t}\n\n\t\treturn orderItems\n\t}\n\n\twpm.getGoogleAdsDynamicRemarketingOrderItems = function () {\n\t\t// \"id\" : \"gla_34\",\n\t\t// \"quantity\" : 1,\n\t\t// \"price\" : 45,\n\t\t// \"google_business_vertical\": \"retail\"\n\n\t\tlet orderItems = []\n\n\t\tfor (const [key, item] of Object.entries(wpmDataLayer.order.items)) {\n\n\t\t\tlet orderItem\n\n\t\t\torderItem = {\n\t\t\t\tquantity : item.quantity,\n\t\t\t\tprice : item.price,\n\t\t\t\tgoogle_business_vertical: wpmDataLayer.pixels.google.ads.google_business_vertical,\n\t\t\t}\n\n\t\t\tif (wpmDataLayer?.general?.variationsOutput && 0 !== item.variation_id) {\n\n\t\t\t\torderItem.id = String(wpmDataLayer.products[item.variation_id].dyn_r_ids[wpmDataLayer.pixels.google.ads.dynamic_remarketing.id_type])\n\t\t\t\torderItems.push(orderItem)\n\t\t\t} else {\n\n\t\t\t\torderItem.id = String(wpmDataLayer.products[item.id].dyn_r_ids[wpmDataLayer.pixels.google.ads.dynamic_remarketing.id_type])\n\t\t\t\torderItems.push(orderItem)\n\t\t\t}\n\t\t}\n\n\t\treturn orderItems\n\t}\n\n}(window.wpm = window.wpm || {}, jQuery))\n","/**\n * Load Google Ads\n */\n\n\nrequire(\"./functions\")\nrequire(\"./event_listeners\")\n","/**\n * Load Google Universal Analytics (GA3) event listeners\n * */\n\n\n// view order received page event\njQuery(document).on(\"wpmOrderReceivedPage\", function () {\n\n\ttry {\n\t\tif (!wpmDataLayer?.pixels?.google?.analytics?.universal?.property_id) return\n\t\tif (wpmDataLayer?.pixels?.google?.analytics?.universal?.mp_active) return\n\t\tif (!wpm.googleConfigConditionsMet(\"analytics\")) return\n\n\t\twpm.gtagLoaded().then(function () {\n\t\t\tgtag(\"event\", \"purchase\", {\n\t\t\t\tsend_to : [wpmDataLayer.pixels.google.analytics.universal.property_id],\n\t\t\t\ttransaction_id: wpmDataLayer.order.number,\n\t\t\t\taffiliation : wpmDataLayer.order.affiliation,\n\t\t\t\tcurrency : wpmDataLayer.order.currency,\n\t\t\t\tvalue : wpmDataLayer.order.value_regular,\n\t\t\t\tdiscount : wpmDataLayer.order.discount,\n\t\t\t\ttax : wpmDataLayer.order.tax,\n\t\t\t\tshipping : wpmDataLayer.order.shipping,\n\t\t\t\tcoupon : wpmDataLayer.order.coupon,\n\t\t\t\titems : wpm.getGAUAOrderItems(),\n\t\t\t})\n\t\t})\n\n\t\t// console.log(wpm.getGAUAOrderItems())\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n","/**\n * Add functions for Google Analytics Universal\n * */\n\n(function (wpm, $, undefined) {\n\n\twpm.getGAUAOrderItems = function () {\n\n\t\t// \"id\" : \"34\",\n\t\t// \"name\" : \"Hoodie\",\n\t\t// \"brand\" : \"\",\n\t\t// \"category\" : \"Hoodies\",\n\t\t// \"list_position\": 1,\n\t\t// \"price\" : 45,\n\t\t// \"quantity\" : 1,\n\t\t// \"variant\" : \"Color: blue | Logo: yes\"\n\n\n\t\tlet orderItems = [],\n\t\t\tlist_position = 1\n\n\t\tfor (const [key, item] of Object.entries(wpmDataLayer.order.items)) {\n\n\t\t\tlet orderItem\n\n\t\t\torderItem = {\n\t\t\t\tquantity : item.quantity,\n\t\t\t\tprice : item.price,\n\t\t\t\tname : item.name,\n\t\t\t\tcurrency : wpmDataLayer.order.currency,\n\t\t\t\tcategory : wpmDataLayer.products[item.id].category.join(\"/\"),\n\t\t\t\tlist_position: list_position,\n\t\t\t}\n\n\t\t\tif (wpmDataLayer?.general?.variationsOutput && 0 !== item.variation_id) {\n\n\t\t\t\torderItem.id = String(wpmDataLayer.products[item.variation_id].dyn_r_ids[wpmDataLayer.pixels.google.analytics.id_type])\n\t\t\t\torderItem.variant = wpmDataLayer.products[item.variation_id].variant_name\n\t\t\t\torderItem.brand = wpmDataLayer.products[item.variation_id].brand\n\t\t\t} else {\n\n\t\t\t\torderItem.id = String(wpmDataLayer.products[item.id].dyn_r_ids[wpmDataLayer.pixels.google.analytics.id_type])\n\t\t\t\torderItem.brand = wpmDataLayer.products[item.id].brand\n\t\t\t}\n\n\t\t\torderItems.push(orderItem)\n\t\t\tlist_position++\n\t\t}\n\n\t\treturn orderItems\n\t}\n\n}(window.wpm = window.wpm || {}, jQuery))\n","/**\n * Google Universal Analytics (GA3) loader\n */\n\nrequire(\"./functions\")\nrequire(\"./event_listeners\")\n\n// #if process.env.TIER === 'premium'\n// require(\"./functions_premium\")\n// require(\"./event_listeners_premium\")\n// #endif\n","/**\n * Load GA4 event listeners\n * */\n\n\n// view order received page event\njQuery(document).on(\"wpmOrderReceivedPage\", function () {\n\n\ttry {\n\t\tif (!wpmDataLayer?.pixels?.google?.analytics?.ga4?.measurement_id) return\n\t\tif (wpmDataLayer?.pixels?.google?.analytics?.ga4?.mp_active) return\n\t\tif (!wpm.googleConfigConditionsMet(\"analytics\")) return\n\n\t\twpm.gtagLoaded().then(function () {\n\t\t\tgtag(\"event\", \"purchase\", {\n\t\t\t\tsend_to : [wpmDataLayer.pixels.google.analytics.ga4.measurement_id],\n\t\t\t\ttransaction_id: wpmDataLayer.order.number,\n\t\t\t\taffiliation : wpmDataLayer.order.affiliation,\n\t\t\t\tcurrency : wpmDataLayer.order.currency,\n\t\t\t\tvalue : wpmDataLayer.order.value_regular,\n\t\t\t\tdiscount : wpmDataLayer.order.discount,\n\t\t\t\ttax : wpmDataLayer.order.tax,\n\t\t\t\tshipping : wpmDataLayer.order.shipping,\n\t\t\t\tcoupon : wpmDataLayer.order.coupon,\n\t\t\t\titems : wpm.getGA4OrderItems(),\n\t\t\t})\n\t\t})\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n","/**\n * Load GA4 functions\n * */\n\n(function (wpm, $, undefined) {\n\n\twpm.getGA4OrderItems = function () {\n\n\t\t// \"item_id\" : \"34\",\n\t\t// \"item_name\" : \"Hoodie\",\n\t\t// \"quantity\" : 1,\n\t\t// \"item_brand\" : \"\",\n\t\t// \"item_variant\" : \"Color: blue | Logo: yes\",\n\t\t// \"price\" : 45,\n\t\t// \"currency\" : \"CHF\",\n\t\t// \"item_category\": \"Hoodies\"\n\n\n\t\tlet orderItems = []\n\n\t\tfor (const [key, item] of Object.entries(wpmDataLayer.order.items)) {\n\n\t\t\tlet orderItem\n\n\t\t\torderItem = {\n\t\t\t\tquantity : item.quantity,\n\t\t\t\tprice : item.price,\n\t\t\t\titem_name : item.name,\n\t\t\t\tcurrency : wpmDataLayer.order.currency,\n\t\t\t\titem_category: wpmDataLayer.products[item.id].category.join(\"/\"),\n\t\t\t}\n\n\t\t\tif (wpmDataLayer?.general?.variationsOutput && 0 !== item.variation_id) {\n\n\t\t\t\torderItem.item_id = String(wpmDataLayer.products[item.variation_id].dyn_r_ids[wpmDataLayer.pixels.google.analytics.id_type])\n\t\t\t\torderItem.item_variant = wpmDataLayer.products[item.variation_id].variant_name\n\t\t\t\torderItem.item_brand = wpmDataLayer.products[item.variation_id].brand\n\t\t\t} else {\n\n\t\t\t\torderItem.item_id = String(wpmDataLayer.products[item.id].dyn_r_ids[wpmDataLayer.pixels.google.analytics.id_type])\n\t\t\t\torderItem.item_brand = wpmDataLayer.products[item.id].brand\n\t\t\t}\n\n\t\t\torderItems.push(orderItem)\n\t\t}\n\n\t\treturn orderItems\n\t}\n\n}(window.wpm = window.wpm || {}, jQuery))\n","/**\n * GA4 loader\n */\n\nrequire(\"./functions\")\nrequire(\"./event_listeners\")\n\n// #if process.env.TIER === 'premium'\n// require(\"./functions_premium\")\n// require(\"./event_listeners_premium\")\n// #endif\n","/**\n * Google Analytics loader\n */\n\nrequire(\"./ga3/loader\")\nrequire(\"./ga4/loader\")\n","/**\n * Load Google base event listeners\n */\n\n// Pixel load event listener\njQuery(document).on(\"wpmLoadPixels\", function () {\n\n\tif (typeof wpmDataLayer?.pixels?.google?.state === \"undefined\") {\n\t\tif (wpm.canGoogleLoad()) {\n\t\t\twpm.loadGoogle()\n\t\t} else {\n\t\t\twpm.logPreventedPixelLoading(\"google\", \"analytics / ads\")\n\t\t}\n\t}\n})\n","/**\n * Load Google base functions\n */\n\n(function (wpm, $, undefined) {\n\n\twpm.googleConfigConditionsMet = function (type) {\n\t\t// always returns true if Google Consent Mode is active\n\t\tif (wpmDataLayer?.pixels?.google?.consent_mode?.active) {\n\t\t\treturn true\n\t\t} else if (wpm.getConsentValues().mode === \"category\") {\n\t\t\treturn wpm.getConsentValues().categories[type] === true\n\t\t} else if (wpm.getConsentValues().mode === \"pixel\") {\n\t\t\treturn wpm.getConsentValues().pixels.includes(\"google-\" + type)\n\t\t} else {\n\t\t\treturn false\n\t\t}\n\t}\n\n\twpm.getVisitorConsentStatusAndUpdateGoogleConsentSettings = function (google_consent_settings) {\n\n\t\tif (wpm.getConsentValues().mode === \"category\") {\n\t\t\tif (wpm.getConsentValues().categories.analytics) google_consent_settings.analytics_storage = \"granted\"\n\t\t\tif (wpm.getConsentValues().categories.ads) google_consent_settings.ad_storage = \"granted\"\n\t\t} else if ((wpm.getConsentValues().mode === \"pixel\")) {\n\t\t\tgoogle_consent_settings.analytics_storage = wpm.getConsentValues().pixels.includes(\"google-analytics\") ? \"granted\" : \"denied\"\n\t\t\tgoogle_consent_settings.ad_storage = wpm.getConsentValues().pixels.includes(\"google-ads\") ? \"granted\" : \"denied\"\n\t\t}\n\n\t\treturn google_consent_settings\n\t}\n\n\twpm.updateGoogleConsentMode = function (analytics = true, ads = true) {\n\n\t\ttry {\n\t\t\tif (\n\t\t\t\t!window.gtag ||\n\t\t\t\t!wpmDataLayer.shop.cookie_consent_mgmt.explicit_consent\n\t\t\t) return\n\n\t\t\tgtag(\"consent\", \"update\", {\n\t\t\t\tanalytics_storage: analytics ? \"granted\" : \"denied\",\n\t\t\t\tad_storage : ads ? \"granted\" : \"denied\",\n\t\t\t})\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t}\n\t}\n\n\twpm.fireGtagGoogleAds = function () {\n\t\ttry {\n\t\t\twpmDataLayer.pixels.google.ads.state = \"loading\"\n\n\t\t\tif (wpmDataLayer?.pixels?.google?.ads?.enhanced_conversions?.active) {\n\t\t\t\tfor (const [key, item] of Object.entries(wpmDataLayer.pixels.google.ads.conversionIds)) {\n\t\t\t\t\tgtag(\"config\", key, {\"allow_enhanced_conversions\": true})\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tfor (const [key, item] of Object.entries(wpmDataLayer.pixels.google.ads.conversionIds)) {\n\t\t\t\t\tgtag(\"config\", key)\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (wpmDataLayer?.pixels?.google?.ads?.conversionIds && wpmDataLayer?.pixels?.google?.ads?.phone_conversion_label && wpmDataLayer?.pixels?.google?.ads?.phone_conversion_number) {\n\t\t\t\tgtag(\"config\", Object.keys(wpmDataLayer.pixels.google.ads.conversionIds)[0] + \"/\" + wpmDataLayer.pixels.google.ads.phone_conversion_label, {\n\t\t\t\t\tphone_conversion_number: wpmDataLayer.pixels.google.ads.phone_conversion_number,\n\t\t\t\t})\n\t\t\t}\n\n\t\t\t// ! enhanced_conversion_data needs to be var\n\t\t\t// https://support.google.com/google-ads/answer/9888145#zippy=%2Cvalidate-your-implementation-using-chrome-developer-tools\n\t\t\tif (\"order_received_page\" === wpmDataLayer.shop.page_type && wpmDataLayer?.order?.google?.ads?.enhanced_conversion_data) {\n\t\t\t\twindow.enhanced_conversion_data = wpmDataLayer.order.google.ads.enhanced_conversion_data\n\t\t\t}\n\n\t\t\twpmDataLayer.pixels.google.ads.state = \"ready\"\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t}\n\t}\n\n\twpm.fireGtagGoogleAnalyticsUA = function () {\n\t\ttry {\n\t\t\twpmDataLayer.pixels.google.analytics.universal.state = \"loading\"\n\n\t\t\tgtag(\"config\", wpmDataLayer.pixels.google.analytics.universal.property_id, wpmDataLayer.pixels.google.analytics.universal.parameters)\n\t\t\twpmDataLayer.pixels.google.analytics.universal.state = \"ready\"\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t}\n\t}\n\n\twpm.fireGtagGoogleAnalyticsGA4 = function () {\n\t\ttry {\n\t\t\twpmDataLayer.pixels.google.analytics.ga4.state = \"loading\"\n\n\t\t\tgtag(\"config\", wpmDataLayer.pixels.google.analytics.ga4.measurement_id, wpmDataLayer.pixels.google.analytics.ga4.parameters)\n\t\t\twpmDataLayer.pixels.google.analytics.ga4.state = \"ready\"\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t}\n\t}\n\n\twpm.isGoogleActive = function () {\n\t\tif (\n\t\t\twpmDataLayer?.pixels?.google?.analytics?.universal?.property_id ||\n\t\t\twpmDataLayer?.pixels?.google?.analytics?.ga4?.measurement_id ||\n\t\t\t!jQuery.isEmptyObject(wpmDataLayer?.pixels?.google?.ads?.conversionIds)\n\t\t) {\n\t\t\treturn true\n\t\t} else {\n\t\t\treturn false\n\t\t}\n\t}\n\n\twpm.getGoogleGtagId = function () {\n\t\tif (wpmDataLayer?.pixels?.google?.analytics?.universal?.property_id) {\n\t\t\treturn wpmDataLayer.pixels.google.analytics.universal.property_id\n\t\t} else if (wpmDataLayer?.pixels?.google?.analytics?.ga4?.measurement_id) {\n\t\t\treturn wpmDataLayer.pixels.google.analytics.ga4.measurement_id\n\t\t} else {\n\t\t\treturn Object.keys(wpmDataLayer.pixels.google.ads.conversionIds)[0]\n\t\t}\n\t}\n\n\twpm.loadGoogle = function () {\n\n\t\tif (wpm.isGoogleActive()) {\n\n\t\t\twpmDataLayer.pixels.google.state = \"loading\"\n\n\t\t\twpm.loadScriptAndCacheIt(\"https://www.googletagmanager.com/gtag/js?id=\" + wpm.getGoogleGtagId())\n\t\t\t\t.done(function (script, textStatus) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\t// console.log('Google Optimize loaded')\n\t\t\t\t\t\t// alert('Google Optimize loaded')\n\n\t\t\t\t\t\t// Initiate Google dataLayer and gtag\n\t\t\t\t\t\twindow.dataLayer = window.dataLayer || []\n\t\t\t\t\t\twindow.gtag = function gtag() {\n\t\t\t\t\t\t\tdataLayer.push(arguments)\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Google Consent Mode\n\t\t\t\t\t\tif (wpmDataLayer?.pixels?.google?.consent_mode?.active) {\n\n\t\t\t\t\t\t\tlet google_consent_settings = {\n\t\t\t\t\t\t\t\t\"ad_storage\" : wpmDataLayer.pixels.google.consent_mode.ad_storage,\n\t\t\t\t\t\t\t\t\"analytics_storage\": wpmDataLayer.pixels.google.consent_mode.analytics_storage,\n\t\t\t\t\t\t\t\t\"wait_for_update\" : wpmDataLayer.pixels.google.consent_mode.wait_for_update,\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (wpmDataLayer?.pixels?.google?.consent_mode?.region) {\n\t\t\t\t\t\t\t\tgoogle_consent_settings.region = wpmDataLayer.pixels.google.consent_mode.region\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tgoogle_consent_settings = wpm.getVisitorConsentStatusAndUpdateGoogleConsentSettings(google_consent_settings)\n\n\t\t\t\t\t\t\tgtag(\"consent\", \"default\", google_consent_settings)\n\t\t\t\t\t\t\tgtag(\"set\", \"ads_data_redaction\", wpmDataLayer.pixels.google.consent_mode.ads_data_redaction)\n\t\t\t\t\t\t\tgtag(\"set\", \"url_passthrough\", wpmDataLayer.pixels.google.consent_mode.url_passthrough)\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Google Linker\n\t\t\t\t\t\t// https://developers.google.com/gtagjs/devguide/linker\n\t\t\t\t\t\tif (wpmDataLayer?.pixels?.google?.linker?.settings) {\n\t\t\t\t\t\t\tgtag(\"set\", \"linker\", wpmDataLayer.pixels.google.linker.settings)\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tgtag(\"js\", new Date())\n\n\t\t\t\t\t\t// Google Ads loader\n\t\t\t\t\t\tif (!jQuery.isEmptyObject(wpmDataLayer?.pixels?.google?.ads?.conversionIds)) { // Only run if the pixel has set up\n\t\t\t\t\t\t\tif (wpm.googleConfigConditionsMet(\"ads\")) { \t\t\t\t\t\t\t// Only run if cookie consent has been given\n\t\t\t\t\t\t\t\twpm.fireGtagGoogleAds()\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\twpm.logPreventedPixelLoading(\"google-ads\", \"ads\")\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\n\t\t\t\t\t\t// Google Universal Analytics loader\n\t\t\t\t\t\tif (wpmDataLayer?.pixels?.google?.analytics?.universal?.property_id) { \t\t// Only run if the pixel has set up\n\t\t\t\t\t\t\tif (wpm.googleConfigConditionsMet(\"analytics\")) {\t\t\t\t\t\t// Only run if cookie consent has been given\n\t\t\t\t\t\t\t\twpm.fireGtagGoogleAnalyticsUA()\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\twpm.logPreventedPixelLoading(\"google-universal-analytics\", \"analytics\")\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// GA4 loader\n\t\t\t\t\t\tif (wpmDataLayer?.pixels?.google?.analytics?.ga4?.measurement_id) { \t\t\t// Only run if the pixel has set up\n\t\t\t\t\t\t\tif (wpm.googleConfigConditionsMet(\"analytics\")) {\t\t\t\t\t\t// Only run if cookie consent has been given\n\t\t\t\t\t\t\t\twpm.fireGtagGoogleAnalyticsGA4()\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\twpm.logPreventedPixelLoading(\"ga4\", \"analytics\")\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\twpmDataLayer.pixels.google.state = \"ready\"\n\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\tconsole.error(e)\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t}\n\t}\n\n\twpm.canGoogleLoad = function () {\n\n\t\tif (wpmDataLayer?.pixels?.google?.consent_mode?.active) {\n\t\t\treturn true\n\t\t} else if (\"category\" === wpm.getConsentValues().mode) {\n\t\t\treturn !!(wpm.getConsentValues().categories[\"ads\"] || wpm.getConsentValues().categories[\"analytics\"])\n\t\t} else if (\"pixel\" === wpm.getConsentValues().mode) {\n\t\t\treturn wpm.getConsentValues().pixels.includes(\"google-ads\") || wpm.getConsentValues().pixels.includes(\"google-analytics\")\n\t\t} else {\n\t\t\tconsole.error(\"Couldn't find a valid load condition for Google mode in wpmConsentValues\")\n\t\t\treturn false\n\t\t}\n\t}\n\n\twpm.gtagLoaded = function () {\n\t\treturn new Promise(function (resolve, reject) {\n\n\t\t\tif (typeof wpmDataLayer?.pixels?.google?.state === \"undefined\") reject()\n\n\t\t\tlet startTime = 0\n\t\t\tlet timeout = 5000\n\t\t\tlet frequency = 200;\n\n\t\t\t(function wait() {\n\t\t\t\tif (wpmDataLayer?.pixels?.google?.state === \"ready\") return resolve()\n\t\t\t\tif (startTime >= timeout) return reject()\n\t\t\t\tstartTime += frequency\n\t\t\t\tsetTimeout(wait, frequency)\n\t\t\t})()\n\t\t})\n\t}\n\n\t// wpm.gtagLoadednew = function () {\n\t// \treturn Promise.race([\n\t// \t\t\tnew Promise(function (resolve, reject) {\n\t//\n\t// \t\t\t\tif (typeof wpmDataLayer?.pixels?.google?.state === \"undefined\") reject();\n\t//\n\t//\n\t// \t\t\t\t(function wait() {\n\t// \t\t\t\t\tif (wpmDataLayer?.pixels?.google?.state === \"ready\") return resolve()\n\t// \t\t\t\t\tif (to >= 1000) return reject()\n\t// \t\t\t\t\tsetTimeout(wait, 100)\n\t// \t\t\t\t})()\n\t// \t\t\t}),\n\t// \t\t\tnew Promise(function (resolve, reject) {\n\t// \t\t\t\tsetTimeout(() => reject(), 1000)\n\t// \t\t\t}),\n\t// \t\t],\n\t// \t)\n\t// \t\t// .then((value) => {console.log(\"race then value: \" + value)})\n\t// \t\t.catch(\n\t// \t\t\t(value) => {\n\t// \t\t\t\tconsole.log(\"race catch value: \" + value)\n\t// \t\t\t\treturn Promise.reject()\n\t// \t\t\t})\n\t// }\n\n\n\t// const promise1 = new Promise((resolve, reject) => {\n\t// \tsetTimeout(resolve, 500, \"one\")\n\t// })\n\t//\n\t// const promise2 = new Promise((resolve, reject) => {\n\t// \tsetTimeout(reject, 100, \"two\")\n\t// })\n\t//\n\t// let onlyRunIfResolves = function () {\n\t// \treturn Promise.race([promise1, promise2])\n\t// \t\t.catch(() => {\n\t// \t\t})\n\t// }\n\t//\n\t// onlyRunIfResolves()\n\t// \t.then(() => {\n\t// \t\tconsole.log(\"running function\")\n\t// \t})\n\n\n}(window.wpm = window.wpm || {}, jQuery));\n","/**\n * Load Google base\n */\n\n// Load base\nrequire(\"./functions\")\nrequire(\"./event_listeners\")\n\n// #if process.env.TIER === 'premium'\n// require(\"./functions_premium\")\n// require(\"./event_listeners_premium\")\n// #endif\n","/**\n * Load Google\n */\n\n// Load base\nrequire(\"./base/loader\")\n\n//Load additional Google libraries\nrequire(\"./ads/loader\")\nrequire(\"./analytics/loader\")\nrequire(\"./optimize/loader\")\n\n\n","/**\n * Load Google Optimize event listeners\n */\n\njQuery(document).on(\"wpmLoadPixels\", function () {\n\n\tif (wpmDataLayer?.pixels?.google?.optimize?.container_id && !wpmDataLayer?.pixels?.google?.optimize?.loaded) {\n\t\tif (wpm.canIFire(\"analytics\", \"google-optimize\")) wpm.load_google_optimize_pixel()\n\t}\n})\n","/**\n * Load Google Optimize functions\n */\n\n\n(function (wpm, $, undefined) {\n\n\twpm.load_google_optimize_pixel = function () {\n\n\t\ttry {\n\t\t\twpmDataLayer.pixels.google.optimize.loaded = true\n\n\t\t\twpm.loadScriptAndCacheIt(\"https://www.googleoptimize.com/optimize.js?id=\" + wpmDataLayer.pixels.google.optimize.container_id)\n\t\t\t// .done(function (script, textStatus) {\n\t\t\t// \t\tconsole.log('Google Optimize loaded')\n\t\t\t// });\n\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t}\n\t}\n\n}(window.wpm = window.wpm || {}, jQuery));\n","/**\n * Load Google Optimize\n */\n\nrequire(\"./functions\")\nrequire(\"./event_listeners\")\n","/**\n * Load Hotjar event listeners\n */\n\n// Pixel load event listener\njQuery(document).on(\"wpmLoadPixels\", function () {\n\n\tif (wpmDataLayer?.pixels?.hotjar?.site_id && !wpmDataLayer?.pixels?.hotjar?.loaded) {\n\t\tif (wpm.canIFire(\"analytics\", \"hotjar\") && !wpmDataLayer?.pixels?.hotjar?.loaded) wpm.load_hotjar_pixel()\n\t}\n})\n","/**\n * Load Hotjar functions\n */\n\n(function (wpm, $, undefined) {\n\n\twpm.load_hotjar_pixel = function () {\n\n\t\ttry {\n\t\t\twpmDataLayer.pixels.hotjar.loaded = true;\n\n\t\t\t// @formatter:off\n\t\t\t(function(h,o,t,j,a,r){\n\t\t\t\th.hj=h.hj||function(){(h.hj.q=h.hj.q||[]).push(arguments)};\n\t\t\t\th._hjSettings={hjid:wpmDataLayer.pixels.hotjar.site_id,hjsv:6};\n\t\t\t\ta=o.getElementsByTagName('head')[0];\n\t\t\t\tr=o.createElement('script');r.async=1;\n\t\t\t\tr.src=t+h._hjSettings.hjid+j+h._hjSettings.hjsv;\n\t\t\t\ta.appendChild(r);\n\t\t\t})(window,document,'https://static.hotjar.com/c/hotjar-','.js?sv=');\n\t\t\t// @formatter:on\n\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t}\n\t}\n\n}(window.wpm = window.wpm || {}, jQuery));\n","/**\n * Hotjar loader\n */\n\nrequire(\"./functions\")\nrequire(\"./event_listeners\")\n","/**\n * Register event listeners\n */\n\n// remove_from_cart event\njQuery(document).on(\"click\", \".remove_from_cart_button, .remove\", function () {\n\t// jQuery('.remove_from_cart_button, .remove').on('click', function (e) {\n\n\ttry {\n\t\t// console.log('remove_from_cart: ' + jQuery(this).data('product_id'));\n\n\t\tlet url = new URL(jQuery(this).attr(\"href\"))\n\t\tlet productId = wpm.getProductIdByCartItemKeyUrl(url)\n\n\t\twpm.removeProductFromCart(productId)\n\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n\n\n// add_to_cart event\njQuery(document).on(\"click\", \".add_to_cart_button:not(.product_type_variable), .ajax_add_to_cart, .single_add_to_cart_button\", function () {\n\t// jQuery('.add_to_cart_button:not(.product_type_variable), .ajax_add_to_cart, .js-ajax-add-to-cart, .single_add_to_cart_button, .btn_color-2').on('click', function (e) {\n\n\ttry {\n\t\t// console.log('add_to_cart');\n\n\t\tif (wpmDataLayer.shop.page_type === \"product\") {\n\n\t\t\t// first process related and upsell products\n\t\t\tif (typeof jQuery(this).attr(\"href\") !== \"undefined\" && jQuery(this).attr(\"href\").includes(\"add-to-cart\")) {\n\t\t\t\t// console.log('add-to-cart on upsell and related products');\n\t\t\t\tlet quantity = 1\n\t\t\t\tlet productId = jQuery(this).data(\"product_id\")\n\t\t\t\t// console.log('productId: ' + productId);\n\t\t\t\twpm.addProductToCart(productId, quantity)\n\t\t\t} else {\n\n\t\t\t\tif (wpmDataLayer.shop.product_type === \"simple\") {\n\n\t\t\t\t\t// console.log('test');\n\t\t\t\t\tlet quantity = Number(jQuery(\".input-text.qty\").val())\n\n\t\t\t\t\tif (!quantity && quantity !== 0) quantity = 1\n\n\t\t\t\t\tlet productId = jQuery(this).val()\n\n\t\t\t\t\t// console.log('productId: ' + productId);\n\t\t\t\t\t// console.log('quantity: ' + quantity);\n\n\t\t\t\t\twpm.addProductToCart(productId, quantity)\n\n\t\t\t\t} else if (wpmDataLayer.shop.product_type === \"variable\") {\n\n\t\t\t\t\t// console.log('variable');\n\n\t\t\t\t\tlet quantity = Number(jQuery(\".input-text.qty\").val())\n\n\t\t\t\t\tif (!quantity && quantity !== 0) quantity = 1\n\n\t\t\t\t\tlet productId = jQuery(\"[name='variation_id']\").val()\n\n\t\t\t\t\t// console.log('productId: ' + productId);\n\t\t\t\t\t// console.log('quantity: ' + quantity);\n\n\t\t\t\t\twpm.addProductToCart(productId, quantity)\n\n\t\t\t\t} else if (wpmDataLayer.shop.product_type === \"grouped\") {\n\n\t\t\t\t\t// console.log('grouped');\n\n\t\t\t\t\tjQuery(\".woocommerce-grouped-product-list-item\").each(function () {\n\n\t\t\t\t\t\tlet quantity = Number(jQuery(this).find(\".input-text.qty\").val())\n\n\t\t\t\t\t\tif (!quantity && quantity !== 0) quantity = 1\n\n\t\t\t\t\t\tlet classes = jQuery(this).attr(\"class\")\n\t\t\t\t\t\tlet productId = wpm.getPostIdFromString(classes)\n\n\t\t\t\t\t\t// console.log('productId: ' + productId);\n\t\t\t\t\t\t// console.log('quantity: ' + quantity);\n\n\t\t\t\t\t\twpm.addProductToCart(productId, quantity)\n\t\t\t\t\t})\n\t\t\t\t} else if (wpmDataLayer.shop.product_type === \"bundle\") {\n\n\t\t\t\t\t// console.log('bundle');\n\n\t\t\t\t\tlet quantity = Number(jQuery(\".input-text.qty\").val())\n\n\t\t\t\t\tif (!quantity && quantity !== 0) quantity = 1\n\n\t\t\t\t\tlet productId = jQuery(\"input[name=add-to-cart]\").val()\n\n\t\t\t\t\t// console.log('productId: ' + productId);\n\t\t\t\t\t// console.log('quantity: ' + quantity);\n\n\t\t\t\t\twpm.addProductToCart(productId, quantity)\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\n\t\t\t// console.log('non product page');\n\n\t\t\tlet quantity = 1\n\t\t\tlet productId = jQuery(this).data(\"product_id\")\n\t\t\t// console.log('productId: ' + productId);\n\t\t\twpm.addProductToCart(productId, quantity)\n\t\t}\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n\n// if someone clicks anywhere on a custom /?add-to-cart=123 link\n// trigger the add to cart event\n// body.one('click', function (e) {\n//\n// try {\n// if (jQuery(this)[0].URL) {\n//\n// let href = new URL(jQuery(this)[0].URL);\n// let searchParams = new URLSearchParams(href.search);\n//\n// if (searchParams.has('add-to-cart')) {\n// // console.log('non product page, /?add-to-cart=123 link');\n//\n// let productId = searchParams.get('add-to-cart');\n// wpm.addProductToCart(productId, 1);\n// }\n// }\n// } catch (e) {\n// console.error(e);\n// }\n// });\n\n\n/**\n * If someone clicks anywhere on a custom /?add-to-cart=123 link\n * trigger the add to cart event\n */\njQuery(document).one(\"click\", \"a:not(.add_to_cart_button, .ajax_add_to_cart, .single_add_to_cart_button)\", function (event) {\n\t// jQuery('a:not(.add_to_cart_button, .ajax_add_to_cart, .single_add_to_cart_button)').one('click', function (event) {\n\n\ttry {\n\t\tif (jQuery(event.target).closest(\"a\").attr(\"href\")) {\n\n\t\t\tlet href = jQuery(event.target).closest(\"a\").attr(\"href\")\n\n\t\t\tif (href.includes(\"add-to-cart=\")) {\n\t\t\t\tlet matches = href.match(/(add-to-cart=)(\\d+)/)\n\t\t\t\t// console.log('pid: ' + matches[2])\n\t\t\t\tif (matches) wpm.addProductToCart(matches[2], 1)\n\t\t\t}\n\t\t}\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n\n// select_content GA UA event\n// select_item GA 4 event\n// jQuery(document).on('click', '.woocommerce-LoopProduct-link, .wc-block-grid__product, .product-small.box', function (e) {\njQuery(document).on(\"click\", \".woocommerce-LoopProduct-link, .wc-block-grid__product, .product, .product-small, .type-product\", function () {\n\t// jQuery('.woocommerce-LoopProduct-link, .wc-block-grid__product, .product, .product-small, .type-product').on('click', function (e) {\n\n\ttry {\n\n\t\t/**\n\t\t *\n\t\t * On some pages the event fires multiple times, and on product pages\n\t\t * even on page load. Using e.stopPropagation helps to prevent this,\n\t\t * but I dont know why. We don't even have to use this, since only a real\n\t\t * product click yields a valid productId. So we filter the invalid click\n\t\t * events out later down the code. I'll keep it that way because this is\n\t\t * the most compatible way across shops.\n\t\t * e.stopPropagation();\n\t\t * */\n\n\t\t\t// console.log('select_content and select_item');\n\n\t\tlet productId = jQuery(this).nextAll(\".wpmProductId:first\").data(\"id\")\n\t\t// console.log('select_content and select_item: ' + productId);\n\n\n\t\t/**\n\t\t * On product pages, for some reason, the click event is triggered on the main product on page load.\n\t\t * In that case no ID is found. But we can discard it, since we only want to trigger the event on\n\t\t * related products, which are found below.\n\t\t */\n\n\t\tif (productId) {\n\n\t\t\t// console.log('select_content and select_item: ' + productId);\n\n\t\t\tproductId = getIdBasedOndVariationsOutputSetting(productId)\n\n\t\t\tif (!productId) throw Error(\"Wasn't able to retrieve a productId\")\n\n\t\t\t// console.log('prodid: ' + productId);\n\n\t\t\tif (wpmDataLayer.products && wpmDataLayer.products[productId]) {\n\n\t\t\t\tlet product = wpm.getProductDetailsFormattedForEvent(productId)\n\n\t\t\t\tjQuery(document).trigger(\"wpmSelectContentGaUa\", product)\n\t\t\t\tjQuery(document).trigger(\"wpmSelectItem\", product)\n\t\t\t}\n\t\t}\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n\n// begin_checkout event\njQuery(document).one(\"click\", \".checkout-button, .cart-checkout-button, .button.checkout\", function () {\n\t// jQuery('.checkout-button, .cart-checkout-button, .button.checkout').one('click', function (e) {\n\t// console.log('begin_checkout');\n\n\tjQuery(document).trigger(\"wpmBeginCheckout\")\n})\n\n\n// checkout_progress event\n// track checkout option event: entered valid billing email\njQuery(document).on(\"input\", \"#billing_email\", function () {\n\t// jQuery('#billing_email').on('input', function () {\n\n\tif (wpm.isEmail(jQuery(this).val())) {\n\t\t// wpm.fireCheckoutOption(2);\n\t\twpm.fireCheckoutProgress(2)\n\t\twpm.emailSelected = true\n\t}\n})\n\n// track checkout option event: purchase click\njQuery(document).on(\"click\", \".wc_payment_methods\", function () {\n\t// jQuery('.wc_payment_methods').on('click', function () {\n\n\tif (false === wpm.paymentMethodSelected) {\n\t\twpm.fireCheckoutProgress(3)\n\t}\n\n\twpm.fireCheckoutOption(3, jQuery(\"input[name='payment_method']:checked\").val())\n\twpm.paymentMethodSelected = true\n})\n\n// track checkout option event: purchase click\njQuery(document).one(\"click\", \"#place_order\", function () {\n\t// jQuery('#place_order').one('click', function () {\n\n\tif (false === wpm.emailSelected) {\n\t\twpm.fireCheckoutProgress(2)\n\t}\n\n\tif (false === wpm.paymentMethodSelected) {\n\t\twpm.fireCheckoutProgress(3)\n\t\twpm.fireCheckoutOption(3, jQuery(\"input[name='payment_method']:checked\").val())\n\t}\n\n\twpm.fireCheckoutProgress(4)\n})\n\n// update cart event\njQuery(document).on(\"click\", \"[name='update_cart']\", function () {\n\t// jQuery(\"[name='update_cart']\").on('click', function (e) {\n\n\ttry {\n\t\tjQuery(\".cart_item\").each(function () {\n\n\t\t\t// let productId = jQuery(this).find('[data-product_id]').data('product_id');\n\n\t\t\tlet url = new URL(jQuery(this).find(\".product-remove\").find(\"a\").attr(\"href\"))\n\t\t\tlet productId = wpm.getProductIdByCartItemKeyUrl(url)\n\n\n\t\t\tlet quantity = jQuery(this).find(\".qty\").val()\n\n\t\t\tif (quantity === 0) {\n\t\t\t\twpm.removeProductFromCart(productId)\n\t\t\t} else if (quantity < wpmDataLayer.cart[productId].quantity) {\n\t\t\t\twpm.removeProductFromCart(productId, wpmDataLayer.cart[productId].quantity - quantity)\n\t\t\t} else if (quantity > wpmDataLayer.cart[productId].quantity) {\n\t\t\t\twpm.addProductToCart(productId, quantity - wpmDataLayer.cart[productId].quantity)\n\t\t\t}\n\t\t})\n\t} catch (e) {\n\t\tconsole.error(e)\n\t\twpm.getCartItemsFromBackend()\n\t}\n})\n\n\n// add_to_wishlist\njQuery(document).on(\"click\", \".add_to_wishlist, .wl-add-to\", function () {\n\t// jQuery('.add_to_wishlist, .wl-add-to').on('click', function () {\n\n\ttry {\n\t\t// console.log('add_to_wishlist');\n\t\t// console.log('this:' + jQuery(this).data('product-id'));\n\n\t\tlet productId\n\n\t\tif (jQuery(this).data(\"productid\")) { // for the WooCommerce wishlist plugin\n\t\t\tproductId = jQuery(this).data(\"productid\")\n\t\t} else if (jQuery(this).data(\"product-id\")) { // for the YITH wishlist plugin\n\t\t\tproductId = jQuery(this).data(\"product-id\")\n\t\t}\n\n\t\tif (!productId) throw Error(\"Wasn't able to retrieve a productId\")\n\n\t\tlet product = wpm.getProductDetailsFormattedForEvent(productId)\n\n\t\t// console.log('add_to_wishlist');\n\t\t// console.log(product);\n\n\t\tjQuery(document).trigger(\"wpmAddToWishlist\", product)\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n\njQuery(document).on(\"updated_cart_totals\", function () {\n\tjQuery(document).trigger(\"wpmViewCart\")\n})\n\n\n/**\n * Called when the user selects all the required dropdowns / attributes\n *\n * Has to be hooked after document ready\n *\n * https://stackoverflow.com/a/27849208/4688612\n * https://stackoverflow.com/a/65065335/4688612\n */\njQuery(\".single_variation_wrap\").on(\"show_variation\", function (event, variation) {\n\n\ttry {\n\t\tlet productId = getIdBasedOndVariationsOutputSetting(variation.variation_id)\n\n\t\tif (!productId) throw Error(\"Wasn't able to retrieve a productId\")\n\n\t\tif (wpmDataLayer.products && wpmDataLayer.products[productId]) {\n\n\t\t\t// console.log('productId: ' + productId);\n\n\t\t\tlet product = wpm.getProductDetailsFormattedForEvent(productId)\n\n\t\t\tjQuery(document).trigger(\"wpmViewItem\", product)\n\t\t}\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n\n/**\n * Called on variable products when no selection has been done yet\n * or when the visitor deselects his choice.\n *\n * Has to be hooked after document ready\n */\n\njQuery(\".single_variation_wrap\").on(\"hide_variation\", function () {\n\n\ttry {\n\t\tlet classes = jQuery(\"body\").attr(\"class\")\n\t\tlet productId = classes.match(/(postid-)(\\d+)/)[2]\n\n\t\tif (!productId) throw Error(\"Wasn't able to retrieve a productId\")\n\n\t\t/**\n\t\t * If we have a variable product with no preset,\n\t\t * and variations output is enabled,\n\t\t * then we send a viewItem event with the first\n\t\t * variation we find for the parent.\n\t\t * If variations output is disabled,\n\t\t * we just send the parent ID.\n\t\t */\n\t\tif (\n\t\t\t\"variable\" === wpmDataLayer.shop.product_type &&\n\t\t\twpmDataLayer?.general?.variationsOutput\n\t\t) {\n\t\t\tfor (const [key, product] of Object.entries(wpmDataLayer.products)) {\n\t\t\t\tif (\"parentId\" in product) {\n\t\t\t\t\t// console.log('pid: ' + value.parentId)\n\t\t\t\t\tproductId = product.id\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (wpmDataLayer.products && wpmDataLayer.products[productId]) {\n\n\t\t\t// console.log('productId: ' + productId);\n\n\t\t\tlet product = wpm.getProductDetailsFormattedForEvent(productId)\n\n\t\t\tjQuery(document).trigger(\"wpmViewItem\", product)\n\t\t}\n\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n\n\n/**\n * Set up wpm events\n */\n\n\n// populate the wpmDataLayer with the cart items\njQuery(window).on(\"wpmLoad\", function () {\n\n\ttry {\n\t\t// When a new session is initiated there are no items in the cart,\n\t\t// so we can save the call to get the cart items\n\t\tif (wpm.doesWooCommerceCartExist()) wpm.getCartItems()\n\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n\n// get all add-to-cart= products from backend\njQuery(window).on(\"wpmLoad\", function () {\n\n\twpmDataLayer.products = wpmDataLayer.products || {}\n\n\t// scan page for add-to-cart= links\n\tlet productIds = wpm.getAddToCartLinkProductIds()\n\n\twpm.getProductsFromBackend(productIds)\n})\n\n/**\n * Save the referrer into a cookie\n */\n\njQuery(window).on(\"wpmLoad\", function () {\n\n\t// can't use session storage as we can't read it from the server\n\tif (!wpm.getCookie(\"wpmReferrer\")) {\n\n\t\tif (document.referrer) {\n\t\t\tlet referrerUrl = new URL(document.referrer)\n\t\t\tlet referrerHostname = referrerUrl.hostname\n\n\t\t\tif (referrerHostname !== window.location.host) {\n\t\t\t\twpm.setCookie(\"wpmReferrer\", referrerHostname)\n\t\t\t} else {\n\t\t\t\twpm.setCookie(\"wpmReferrer\", \"\")\n\t\t\t}\n\n\t\t} else {\n\t\t\twpm.setCookie(\"wpmReferrer\", \"\")\n\t\t}\n\t}\n})\n\n\n/**\n * Create our own load event in order to better handle script flow execution when JS \"optimizers\" shuffle the code.\n */\n\njQuery(window).on(\"wpmLoad\", function () {\n\ttry {\n\t\tif (typeof wpmDataLayer != \"undefined\" && !wpmDataLayer?.wpmLoadFired) {\n\n\t\t\tjQuery(document).trigger(\"wpmLoadAlways\")\n\n\t\t\tif (\"product\" === wpmDataLayer.shop.page_type && wpmDataLayer.shop.product_type !== \"variable\" && wpm.getMainProductIdFromProductPage()) {\n\n\t\t\t\tlet product = wpm.getProductDataForViewItemEvent(wpm.getMainProductIdFromProductPage())\n\t\t\t\tjQuery(document).trigger(\"wpmViewItem\", product)\n\n\t\t\t} else if (\"product_category\" === wpmDataLayer.shop.page_type) {\n\n\t\t\t\tjQuery(document).trigger(\"wpmCategory\")\n\n\t\t\t} else if (\"search\" === wpmDataLayer.shop.page_type) {\n\n\t\t\t\tjQuery(document).trigger(\"wpmSearch\")\n\n\t\t\t} else if (\"cart\" === wpmDataLayer.shop.page_type) {\n\n\t\t\t\tjQuery(document).trigger(\"wpmViewCart\")\n\n\t\t\t} else if (\"order_received_page\" === wpmDataLayer.shop.page_type && wpmDataLayer.order) {\n\n\t\t\t\tif (!wpm.isOrderIdStored(wpmDataLayer.order.id)) {\n\n\t\t\t\t\tjQuery(document).trigger(\"wpmOrderReceivedPage\")\n\t\t\t\t\twpm.writeOrderIdToStorage(wpmDataLayer.order.id)\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tjQuery(document).trigger(\"wpmEverywhereElse\")\n\t\t\t}\n\n\t\t\tif (wpmDataLayer?.user?.id && !wpm.hasLoginEventFired()) {\n\t\t\t\tjQuery(document).trigger(\"wpmLogin\")\n\t\t\t\twpm.setLoginEventFired()\n\t\t\t}\n\n\t\t\t// /**\n\t\t\t// * Load mini cart fragments into a wpm session storage key,\n\t\t\t// * after the document load event.\n\t\t\t// */\n\t\t\t// jQuery(document).ajaxSend(function (event, jqxhr, settings) {\n\t\t\t// \t// console.log('settings.url: ' + settings.url);\n\t\t\t//\n\t\t\t// \tif (settings.url.includes(\"get_refreshed_fragments\") && sessionStorage) {\n\t\t\t// \t\tif (!sessionStorage.getItem(\"wpmMiniCartActive\")) {\n\t\t\t// \t\t\tsessionStorage.setItem(\"wpmMiniCartActive\", JSON.stringify(true))\n\t\t\t// \t\t}\n\t\t\t// \t}\n\t\t\t// })\n\n\t\t\twpmDataLayer.wpmLoadFired = true\n\t\t}\n\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n\n// jQuery(window).on(\"load\", function () {\n// \tjQuery(document).trigger(\"wpmLoad\", {})\n// })\n\njQuery(window).on(\"wpmPreLoadPixels\", function () {\n\n\tif (wpmDataLayer?.shop?.cookie_consent_mgmt?.explicit_consent) {\n\t\twpm.updateConsentCookieValues(true)\n\t}\n\tjQuery(document).trigger(\"wpmLoadPixels\", {})\n})\n","/**\n * Create a wpm namespace under which all functions are declared\n */\n\n// https://stackoverflow.com/a/5947280/4688612\n(function (wpm, $, undefined) {\n\n\tconst wpmDeduper = {\n\t\tkeyName : \"_wpm_order_ids\",\n\t\tcookieExpiresDays: 365,\n\t}\n\n\tconst wpmRestSettings = {\n\t\t// cookiesAvailable : '_wpm_cookies_are_available',\n\t\tcookieWpmRestEndpointAvailable: \"_wpm_endpoint_available\",\n\t\trestEndpoint : \"/wp-json/\",\n\t\trestFails : 0,\n\t\trestFailsThreshold : 10,\n\t}\n\n\twpm.emailSelected = false\n\twpm.paymentMethodSelected = false\n\n\t// wpm.checkIfCookiesAvailable = function () {\n\t//\n\t// // read the cookie if previously set, if it is return true, otherwise continue\n\t// if (wpm.getCookie(wpmRestSettings.cookiesAvailable)) {\n\t// return true;\n\t// }\n\t//\n\t// // set the cookie for the session\n\t// Cookies.set(wpmRestSettings.cookiesAvailable, true);\n\t//\n\t// // read cookie, true if ok, false if not ok\n\t// return !!wpm.getCookie(wpmRestSettings.cookiesAvailable);\n\t// }\n\n\twpm.useRestEndpoint = function () {\n\n\t\t// only if sessionStorage is available\n\n\t\t// only if REST API endpoint is generally accessible\n\t\t// check in sessionStorage if we checked before and return answer\n\t\t// otherwise check if the endpoint is available, save answer in sessionStorage and return answer\n\n\t\t// only if not too many REST API errors happened\n\n\t\treturn wpm.isSessionStorageAvailable() &&\n\t\t\twpm.isRestEndpointAvailable() &&\n\t\t\twpm.isBelowRestErrorThreshold()\n\t}\n\n\twpm.isBelowRestErrorThreshold = function () {\n\t\treturn window.sessionStorage.getItem(wpmRestSettings.restFails) <= wpmRestSettings.restFailsThreshold\n\t}\n\n\twpm.isRestEndpointAvailable = function () {\n\n\t\tif (window.sessionStorage.getItem(wpmRestSettings.cookieWpmRestEndpointAvailable)) {\n\t\t\treturn JSON.parse(window.sessionStorage.getItem(wpmRestSettings.cookieWpmRestEndpointAvailable))\n\t\t} else {\n\t\t\t// return wpm.testEndpoint();\n\t\t\t// just set the value whenever possible in order not to wait or block the main thread\n\t\t\twpm.testEndpoint()\n\t\t}\n\t}\n\n\twpm.isSessionStorageAvailable = function () {\n\n\t\treturn !!window.sessionStorage\n\t}\n\n\twpm.testEndpoint = function (\n\t\turl = location.protocol + \"//\" + location.host + wpmRestSettings.restEndpoint,\n\t\tcookieName = wpmRestSettings.cookieWpmRestEndpointAvailable,\n\t) {\n\t\t// console.log('testing endpoint');\n\n\t\tjQuery.ajax(url, {\n\t\t\ttype : \"HEAD\",\n\t\t\ttimeout: 1000,\n\t\t\t// async: false,\n\t\t\tstatusCode: {\n\t\t\t\t200: function (response) {\n\t\t\t\t\t// Cookies.set(cookieName, true);\n\t\t\t\t\t// console.log('endpoint works');\n\t\t\t\t\twindow.sessionStorage.setItem(cookieName, JSON.stringify(true))\n\t\t\t\t},\n\t\t\t\t404: function (response) {\n\t\t\t\t\t// Cookies.set(cookieName, false);\n\t\t\t\t\t// console.log('endpoint doesn\\'t work');\n\t\t\t\t\twindow.sessionStorage.setItem(cookieName, JSON.stringify(false))\n\t\t\t\t},\n\t\t\t\t0 : function (response) {\n\t\t\t\t\t// Cookies.set(cookieName, false);\n\t\t\t\t\t// console.log('endpoint doesn\\'t work');\n\t\t\t\t\twindow.sessionStorage.setItem(cookieName, JSON.stringify(false))\n\t\t\t\t},\n\t\t\t},\n\t\t}).then(response => {\n\t\t\t// console.log('test done')\n\t\t\t// console.log('result: ' + JSON.parse(window.sessionStorage.getItem(cookieName)));\n\t\t\t// return JSON.parse(window.sessionStorage.getItem(cookieName));\n\t\t})\n\t}\n\n\twpm.isWpmRestEndpointAvailable = function (cookieName = wpmRestSettings.cookieWpmRestEndpointAvailable) {\n\n\t\treturn !!wpm.getCookie(cookieName)\n\t}\n\n\twpm.writeOrderIdToStorage = function (orderId, expireDays = 365) {\n\n\t\t// save the order ID in the browser storage\n\n\t\tif (!window.Storage) {\n\t\t\tlet expiresDate = new Date()\n\t\t\texpiresDate.setDate(expiresDate.getDate() + wpmDeduper.cookieExpiresDays)\n\n\t\t\tlet ids = []\n\t\t\tif (checkCookie()) {\n\t\t\t\tids = JSON.parse(wpm.getCookie(wpmDeduper.keyName))\n\t\t\t}\n\n\t\t\tif (!ids.includes(orderId)) {\n\t\t\t\tids.push(orderId)\n\t\t\t\tdocument.cookie = wpmDeduper.keyName + \"=\" + JSON.stringify(ids) + \";expires=\" + expiresDate.toUTCString()\n\t\t\t}\n\n\t\t} else {\n\t\t\tif (localStorage.getItem(wpmDeduper.keyName) === null) {\n\t\t\t\tlet ids = []\n\t\t\t\tids.push(orderId)\n\t\t\t\twindow.localStorage.setItem(wpmDeduper.keyName, JSON.stringify(ids))\n\n\t\t\t} else {\n\t\t\t\tlet ids = JSON.parse(localStorage.getItem(wpmDeduper.keyName))\n\t\t\t\tif (!ids.includes(orderId)) {\n\t\t\t\t\tids.push(orderId)\n\t\t\t\t\twindow.localStorage.setItem(wpmDeduper.keyName, JSON.stringify(ids))\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (typeof wpm.storeOrderIdOnServer === \"function\" && wpmDataLayer.orderDeduplication) {\n\t\t\twpm.storeOrderIdOnServer(orderId)\n\t\t}\n\t}\n\n\tfunction checkCookie() {\n\t\tlet key = wpm.getCookie(wpmDeduper.keyName)\n\t\treturn key !== \"\"\n\t}\n\n\twpm.isOrderIdStored = function (orderId) {\n\n\t\t// console.log('deduper: ' + wpmDataLayer.orderDeduplication);\n\t\tif (wpmDataLayer.orderDeduplication) {\n\t\t\t// console.log('order deduplication: on');\n\t\t\tif (!window.Storage) {\n\n\t\t\t\tif (checkCookie()) {\n\t\t\t\t\tlet ids = JSON.parse(wpm.getCookie(wpmDeduper.keyName))\n\t\t\t\t\treturn ids.includes(orderId)\n\t\t\t\t} else {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (localStorage.getItem(wpmDeduper.keyName) !== null) {\n\t\t\t\t\tlet ids = JSON.parse(localStorage.getItem(wpmDeduper.keyName))\n\t\t\t\t\treturn ids.includes(orderId)\n\t\t\t\t} else {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tconsole.log(\"order duplication prevention: off\")\n\t\t\treturn false\n\t\t}\n\t}\n\n\twpm.isEmail = function (email) {\n\t\t// https://emailregex.com/\n\t\tlet regex = /^(([^<>()\\[\\]\\\\.,;:\\s@\"]+(\\.[^<>()\\[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/\n\t\treturn regex.test(email)\n\t}\n\n\twpm.removeProductFromCart = function (productId, quantityToRemove = null) {\n\t\t// console.log('product_id: ' + productId + ' | quantityToRemove: ' + quantityToRemove);\n\n\t\ttry {\n\n\t\t\tif (!productId) throw Error(\"Wasn't able to retrieve a productId\")\n\n\t\t\tproductId = getIdBasedOndVariationsOutputSetting(productId)\n\n\t\t\tif (!productId) throw Error(\"Wasn't able to retrieve a productId\")\n\n\t\t\tlet quantity\n\n\t\t\tif (quantityToRemove == null) {\n\t\t\t\tquantity = wpmDataLayer.cart[productId].quantity\n\t\t\t} else {\n\t\t\t\tquantity = quantityToRemove\n\t\t\t}\n\n\t\t\t// console.log('product_id: ' + productId + ' | qty: ' + quantity);\n\t\t\t// console.log(productId);\n\t\t\t// console.log(wpmDataLayer.cart);\n\t\t\t// console.log(wpmDataLayer.cart[productId]);\n\n\t\t\tif (wpmDataLayer.cart[productId]) {\n\n\t\t\t\t// let product = {\n\t\t\t\t// id : productId.toString(),\n\t\t\t\t// dyn_r_ids: wpmDataLayer.cart[productId].dyn_r_ids,\n\t\t\t\t// name : wpmDataLayer.cart[productId].name,\n\t\t\t\t// // list_name: wpmDataLayer.shop.list_name, // doesn't make sense on mini_cart\n\t\t\t\t// brand : wpmDataLayer.cart[productId].brand,\n\t\t\t\t// category: wpmDataLayer.cart[productId].category,\n\t\t\t\t// variant : wpmDataLayer.cart[productId].variant,\n\t\t\t\t// // list_position: wpmDataLayer.cart[productId].position, // doesn't make sense on mini_cart\n\t\t\t\t// quantity : quantity,\n\t\t\t\t// price : wpmDataLayer.cart[productId].price,\n\t\t\t\t// isVariation: wpmDataLayer.products[productId].isVariation,\n\t\t\t\t// };\n\t\t\t\t//\n\t\t\t\t// if (product.isVariation) product['parentId_dyn_r_ids'] = wpmDataLayer.products[productId].parentId_dyn_r_ids;\n\n\t\t\t\tlet product = wpm.getProductDetailsFormattedForEvent(productId, quantity)\n\n\t\t\t\t// console.log('removing');\n\t\t\t\t// console.log(data);\n\n\t\t\t\tjQuery(document).trigger(\"wpmRemoveFromCart\", product)\n\n\t\t\t\tif (quantityToRemove == null || wpmDataLayer.cart[productId].quantity === quantityToRemove) {\n\t\t\t\t\tdelete wpmDataLayer.cart[productId]\n\t\t\t\t\tif (sessionStorage) sessionStorage.setItem(\"wpmDataLayerCart\", JSON.stringify(wpmDataLayer.cart))\n\t\t\t\t} else {\n\t\t\t\t\twpmDataLayer.cart[productId].quantity = wpmDataLayer.cart[productId].quantity - quantity\n\t\t\t\t\tif (sessionStorage) sessionStorage.setItem(\"wpmDataLayerCart\", JSON.stringify(wpmDataLayer.cart))\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t\t// console.log('getting cart from back end');\n\t\t\t// wpm.getCartItemsFromBackend();\n\t\t\t// console.log('getting cart from back end done');\n\n\t\t}\n\t}\n\n\tgetIdBasedOndVariationsOutputSetting = function (productId) {\n\n\t\ttry {\n\t\t\tif (wpmDataLayer?.general?.variationsOutput) {\n\t\t\t\t// console.log('test');\n\t\t\t\treturn productId\n\t\t\t} else {\n\t\t\t\tif (wpmDataLayer.products[productId].isVariation) {\n\t\t\t\t\treturn wpmDataLayer.products[productId].parentId\n\t\t\t\t} else {\n\t\t\t\t\treturn productId\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t}\n\t}\n\n\t// add_to_cart\n\twpm.addProductToCart = function (productId, quantity) {\n\n\t\ttry {\n\t\t\t// console.log('productId: ' + productId + ' | qty: ' + quantity);\n\t\t\t// console.log('productId: ' + productId + ' | variationId: ' + variationId + ' | qty: ' + quantity);\n\n\t\t\tif (!productId) throw Error(\"Wasn't able to retrieve a productId\")\n\n\t\t\tproductId = getIdBasedOndVariationsOutputSetting(productId)\n\n\t\t\tif (!productId) throw Error(\"Wasn't able to retrieve a productId\")\n\n\t\t\tif (wpmDataLayer?.products[productId]) {\n\n\t\t\t\tlet product = wpm.getProductDetailsFormattedForEvent(productId, quantity)\n\n\t\t\t\t// console.log(productId)\n\t\t\t\t// console.log(wpmDataLayer.cart)\n\n\t\t\t\tjQuery(document).trigger(\"wpmAddToCart\", product)\n\n\t\t\t\t// add product to cart wpmDataLayer['cart']\n\n\t\t\t\t// if the product already exists in the object, only add the additional quantity\n\t\t\t\t// otherwise create that product object in the wpmDataLayer['cart']\n\t\t\t\tif (wpmDataLayer?.cart[productId]) {\n\t\t\t\t\twpmDataLayer.cart[productId].quantity = wpmDataLayer.cart[productId].quantity + quantity\n\t\t\t\t} else {\n\n\t\t\t\t\tif (!(\"cart\" in wpmDataLayer)) wpmDataLayer.cart = {}\n\t\t\t\t\twpmDataLayer.cart[productId] = wpm.getProductDetailsFormattedForEvent(productId, quantity)\n\t\t\t\t}\n\n\t\t\t\tif (sessionStorage) sessionStorage.setItem(\"wpmDataLayerCart\", JSON.stringify(wpmDataLayer.cart))\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\n\t\t\t// fallback if wpmDataLayer.cart and wpmDataLayer.products got out of sync in case cart caching has an issue\n\t\t\twpm.getCartItemsFromBackend()\n\t\t}\n\t}\n\n\twpm.getCartItems = function () {\n\n\t\t// console.log('get cart items');\n\n\t\tif (sessionStorage) {\n\t\t\tif (!sessionStorage.getItem(\"wpmDataLayerCart\") || wpmDataLayer.shop.page_type === \"order_received_page\") {\n\t\t\t\tsessionStorage.setItem(\"wpmDataLayerCart\", JSON.stringify({}))\n\t\t\t} else {\n\t\t\t\twpm.saveCartObjectToDataLayer(JSON.parse(sessionStorage.getItem(\"wpmDataLayerCart\")))\n\t\t\t}\n\t\t} else {\n\t\t\twpm.getCartItemsFromBackend()\n\t\t}\n\t}\n\n\t// get all cart items from the backend\n\twpm.getCartItemsFromBackend = function () {\n\t\ttry {\n\t\t\tlet data = {\n\t\t\t\taction: \"wpm_get_cart_items\",\n\t\t\t}\n\n\t\t\tjQuery.ajax(\n\t\t\t\t{\n\t\t\t\t\ttype : \"get\",\n\t\t\t\t\tdataType: \"json\",\n\t\t\t\t\t// url : ajax_object.ajax_url,\n\t\t\t\t\turl : wpm.ajax_url,\n\t\t\t\t\tdata : data,\n\t\t\t\t\tsuccess: function (cartItems) {\n\n\t\t\t\t\t\t// save all cart items into wpmDataLayer\n\n\t\t\t\t\t\tif (!cartItems[\"cart\"]) cartItems[\"cart\"] = {}\n\n\t\t\t\t\t\twpm.saveCartObjectToDataLayer(cartItems[\"cart\"])\n\t\t\t\t\t\tif (sessionStorage) sessionStorage.setItem(\"wpmDataLayerCart\", JSON.stringify(cartItems[\"cart\"]))\n\t\t\t\t\t},\n\t\t\t\t})\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t}\n\t}\n\n\twpm.getProductsFromBackend = function (productIds) {\n\t\t// console.log('getting pids from back-end: ' + productIds)\n\t\t// get productIds from the backend\n\n\t\t// reduce productIds by products already in the dataLayer\n\t\tproductIds = productIds.filter(item => !wpmDataLayer.products.hasOwnProperty(item))\n\n\t\t// if no products IDs are in the object, don't try to get anything from the server\n\t\tif (!productIds || productIds.length === 0) return\n\n\t\ttry {\n\t\t\tlet data = {\n\t\t\t\taction : \"wpm_get_product_ids\",\n\t\t\t\tproductIds: productIds,\n\t\t\t}\n\n\t\t\tjQuery.ajax(\n\t\t\t\t{\n\t\t\t\t\ttype : \"get\",\n\t\t\t\t\tdataType: \"json\",\n\t\t\t\t\t// url : ajax_object.ajax_url,\n\t\t\t\t\turl : wpm.ajax_url,\n\t\t\t\t\tdata : data,\n\t\t\t\t\tsuccess: function (products) {\n\n\t\t\t\t\t\t// merge products into wpmDataLayer.products\n\t\t\t\t\t\twpmDataLayer.products = Object.assign({}, wpmDataLayer.products, products)\n\t\t\t\t\t},\n\t\t\t\t\terror : function (response) {\n\t\t\t\t\t\tconsole.log(response)\n\t\t\t\t\t},\n\t\t\t\t})\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t}\n\t}\n\n\twpm.saveCartObjectToDataLayer = function (cartObject) {\n\t\twpmDataLayer.cart = cartObject\n\t\twpmDataLayer.products = Object.assign({}, wpmDataLayer.products, cartObject)\n\t}\n\n\twpm.fireCheckoutOption = function (step, checkout_option = null, value = null) {\n\n\t\tlet data = {\n\t\t\tstep : step,\n\t\t\tcheckout_option: checkout_option,\n\t\t\tvalue : value,\n\t\t}\n\n\t\tjQuery(document).trigger(\"wpmFireCheckoutOption\", data)\n\t}\n\n\twpm.fireCheckoutProgress = function (step) {\n\n\t\tlet data = {\n\t\t\tstep: step,\n\t\t}\n\n\t\tjQuery(document).trigger(\"wpmFireCheckoutProgress\", data)\n\t}\n\n\twpm.getPostIdFromString = function (string) {\n\t\t// console.log(string);\n\t\ttry {\n\t\t\treturn string.match(/(post-)(\\d+)/)[2]\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t}\n\t}\n\n\twpm.triggerViewItemList = function (productId) {\n\n\t\t// productId = null;\n\n\t\tif (!productId) throw Error(\"Wasn't able to retrieve a productId\")\n\n\t\tproductId = getIdBasedOndVariationsOutputSetting(productId)\n\n\t\tif (!productId) throw Error(\"Wasn't able to retrieve a productId\")\n\n\t\tjQuery(document).trigger(\"wpmViewItemList\", wpm.getProductDataForViewItemEvent(productId))\n\t}\n\n\twpm.getProductDataForViewItemEvent = function (productId) {\n\n\t\tif (!productId) throw Error(\"Wasn't able to retrieve a productId\")\n\n\t\ttry {\n\t\t\tif (wpmDataLayer.products[productId]) {\n\n\t\t\t\treturn wpm.getProductDetailsFormattedForEvent(productId)\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t}\n\t}\n\twpm.getMainProductIdFromProductPage = function () {\n\t\ttry {\n\t\t\tif ([\"simple\", \"variable\", \"grouped\", \"composite\", \"bundle\"].indexOf(wpmDataLayer.shop.product_type) >= 0) {\n\t\t\t\treturn jQuery(\".wpmProductId:first\").data(\"id\")\n\t\t\t} else {\n\t\t\t\treturn false\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t}\n\t}\n\n\twpm.viewItemListTriggerTestMode = function (target) {\n\n\t\tjQuery(target).css({\"position\": \"relative\"})\n\t\tjQuery(target).append(\"<div id=\\\"viewItemListTriggerOverlay\\\"></div>\")\n\t\tjQuery(target).find(\"#viewItemListTriggerOverlay\").css({\n\t\t\t\"z-index\" : \"10\",\n\t\t\t\"display\" : \"block\",\n\t\t\t\"position\" : \"absolute\",\n\t\t\t\"height\" : \"100%\",\n\t\t\t\"top\" : \"0\",\n\t\t\t\"left\" : \"0\",\n\t\t\t\"right\" : \"0\",\n\t\t\t\"opacity\" : wpmDataLayer.viewItemListTrigger.opacity,\n\t\t\t\"background-color\": wpmDataLayer.viewItemListTrigger.backgroundColor,\n\t\t})\n\t}\n\n\twpm.getSearchTermFromUrl = function () {\n\t\ttry {\n\t\t\tlet urlParameters = new URLSearchParams(window.location.search)\n\t\t\treturn urlParameters.get(\"s\")\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t}\n\t}\n\n\t// we need this to track timeouts for intersection observers\n\tlet ioTimeouts = {}\n\n\twpm.observerCallback = function (entries, observer) {\n\n\t\tentries.forEach((entry) => {\n\n\t\t\ttry {\n\t\t\t\tlet productId\n\n\t\t\t\tlet elementId = jQuery(entry.target).data(\"ioid\")\n\n\t\t\t\t// Get the productId from next element, if wpmProductId is a sibling, like in Gutenberg blocks\n\t\t\t\t// otherwise go search in children, like in regular WC loop items\n\t\t\t\tif (jQuery(entry.target).next(\".wpmProductId\").length) {\n\t\t\t\t\t// console.log('test 1');\n\t\t\t\t\tproductId = jQuery(entry.target).next(\".wpmProductId\").data(\"id\")\n\t\t\t\t} else {\n\t\t\t\t\tproductId = jQuery(entry.target).find(\".wpmProductId\").data(\"id\")\n\t\t\t\t}\n\n\t\t\t\t// productId = null;\n\n\t\t\t\tif (!productId) throw Error(\"wpmProductId element not found\")\n\n\t\t\t\tif (entry.isIntersecting) {\n\n\t\t\t\t\t// console.log('prodid: ' + productId);\n\t\t\t\t\tioTimeouts[elementId] = setTimeout(() => {\n\t\t\t\t\t\t// console.log('prodid: ' + productId);\n\t\t\t\t\t\twpm.triggerViewItemList(productId)\n\t\t\t\t\t\tif (wpmDataLayer.viewItemListTrigger.testMode) wpm.viewItemListTriggerTestMode(entry.target)\n\t\t\t\t\t\tif (wpmDataLayer.viewItemListTrigger.repeat === false) observer.unobserve(entry.target)\n\t\t\t\t\t}, wpmDataLayer.viewItemListTrigger.timeout)\n\n\t\t\t\t} else {\n\n\t\t\t\t\tclearTimeout(ioTimeouts[elementId])\n\t\t\t\t\tif (wpmDataLayer.viewItemListTrigger.testMode) jQuery(entry.target).find(\"#viewItemListTriggerOverlay\").remove()\n\t\t\t\t}\n\t\t\t} catch (e) {\n\t\t\t\tconsole.error(e)\n\t\t\t}\n\t\t})\n\t}\n\n\t// fire view_item_list only on products that have become visible\n\tlet io\n\tlet ioid = 0\n\tlet allIoElementsToWatch\n\n\tlet getAllElementsToWatch = function () {\n\n\t\tallIoElementsToWatch = jQuery(\".wpmProductId\")\n\t\t\t.map(function (i, elem) {\n\t\t\t\t// console.log(elem);\n\t\t\t\tif (\n\t\t\t\t\tjQuery(elem).parent().hasClass(\"type-product\") ||\n\t\t\t\t\tjQuery(elem).parent().hasClass(\"product\") ||\n\t\t\t\t\tjQuery(elem).parent().hasClass(\"product-item-inner\")\n\t\t\t\t) {\n\t\t\t\t\t// console.log(elem);\n\t\t\t\t\treturn jQuery(elem).parent()\n\t\t\t\t} else if (\n\t\t\t\t\tjQuery(elem).prev().hasClass(\"wc-block-grid__product\") ||\n\t\t\t\t\tjQuery(elem).prev().hasClass(\"product\") ||\n\t\t\t\t\tjQuery(elem).prev().hasClass(\"product-small\") ||\n\t\t\t\t\tjQuery(elem).prev().hasClass(\"woocommerce-LoopProduct-link\")\n\t\t\t\t) {\n\t\t\t\t\treturn jQuery(this).prev()\n\t\t\t\t} else if (jQuery(elem).closest(\".product\").length) {\n\t\t\t\t\treturn jQuery(elem).closest(\".product\")\n\t\t\t\t}\n\t\t\t})\n\t}\n\n\twpm.startIntersectionObserverToWatch = function () {\n\n\t\ttry {\n\t\t\t// enable view_item_list test mode from browser\n\t\t\tif (wpm.urlHasParameter(\"vildemomode\")) wpmDataLayer.viewItemListTrigger.testMode = true\n\n\t\t\t// set up intersection observer\n\t\t\tio = new IntersectionObserver(wpm.observerCallback, {\n\t\t\t\tthreshold: wpmDataLayer.viewItemListTrigger.threshold,\n\t\t\t})\n\n\t\t\tgetAllElementsToWatch()\n\n\t\t\t// console.log(allElementsToWatch);\n\n\t\t\tallIoElementsToWatch.each(function (i, elem) {\n\t\t\t\t// console.log(elem[0]);\n\t\t\t\t// jQuery(elem[0]).attr('data-ioid', ioid++);\n\t\t\t\tjQuery(elem[0]).data(\"ioid\", ioid++)\n\n\t\t\t\tio.observe(elem[0])\n\t\t\t})\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t}\n\t}\n\n\t// watch DOM for new lazy loaded products and add them to the intersection observer\n\twpm.startProductsMutationObserverToWatch = function () {\n\n\t\ttry {\n\t\t\t// Pass in the target node, as well as the observer options\n\n\t\t\t// selects the most common parent node\n\t\t\t// https://stackoverflow.com/a/7648323/4688612\n\t\t\tlet productsNode = jQuery(\".wpmProductId:eq(0)\").parents().has(jQuery(\".wpmProductId:eq(1)\").parents()).first()\n\n\t\t\tif (productsNode.length) {\n\t\t\t\tproductsMutationObserver.observe(productsNode[0], {\n\t\t\t\t\tattributes : true,\n\t\t\t\t\tchildList : true,\n\t\t\t\t\tcharacterData: true,\n\t\t\t\t})\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t}\n\t}\n\n\t// Create an observer instance\n\tlet productsMutationObserver = new MutationObserver(function (mutations) {\n\n\t\tmutations.forEach(function (mutation) {\n\t\t\tlet newNodes = mutation.addedNodes // DOM NodeList\n\t\t\tif (newNodes !== null) { // If there are new nodes added\n\t\t\t\tlet nodes = jQuery(newNodes) // jQuery set\n\t\t\t\tnodes.each(function () {\n\t\t\t\t\tif (\n\t\t\t\t\t\tjQuery(this).hasClass(\"type-product\") ||\n\t\t\t\t\t\tjQuery(this).hasClass(\"product-small\") ||\n\t\t\t\t\t\tjQuery(this).hasClass(\"wc-block-grid__product\")\n\t\t\t\t\t) {\n\t\t\t\t\t\t// check if the node has a child or sibling wpmProductId\n\t\t\t\t\t\t// if yes add it to the intersectionObserver\n\t\t\t\t\t\tif (hasWpmProductIdElement(this)) {\n\t\t\t\t\t\t\tjQuery(this).data(\"ioid\", ioid++)\n\t\t\t\t\t\t\tio.observe(this)\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t}\n\t\t})\n\t})\n\n\tlet hasWpmProductIdElement = function (elem) {\n\t\treturn !!(jQuery(elem).find(\".wpmProductId\").length ||\n\t\t\tjQuery(elem).siblings(\".wpmProductId\").length)\n\t}\n\n\twpm.setCookie = function (cookieName, cookieValue = \"\", expiryDays = null) {\n\t\tif (expiryDays) {\n\t\t\tlet d = new Date()\n\t\t\td.setTime(d.getTime() + (expiryDays * 24 * 60 * 60 * 1000))\n\t\t\tlet expires = \"expires=\" + d.toUTCString()\n\t\t\tdocument.cookie = cookieName + \"=\" + cookieValue + \";\" + expires + \";path=/\"\n\t\t} else {\n\t\t\tdocument.cookie = cookieName + \"=\" + cookieValue + \";path=/\"\n\t\t}\n\t}\n\n\twpm.getCookie = function (cookieName) {\n\t\tlet name = cookieName + \"=\"\n\t\tlet decodedCookie = decodeURIComponent(document.cookie)\n\t\tlet ca = decodedCookie.split(\";\")\n\t\tfor (let i = 0; i < ca.length; i++) {\n\t\t\tlet c = ca[i]\n\t\t\twhile (c.charAt(0) == \" \") {\n\t\t\t\tc = c.substring(1)\n\t\t\t}\n\t\t\tif (c.indexOf(name) == 0) {\n\t\t\t\treturn c.substring(name.length, c.length)\n\t\t\t}\n\t\t}\n\t\treturn \"\"\n\t}\n\n\twpm.getWpmSessionData = function () {\n\t\tif (window.sessionStorage) {\n\n\t\t\tlet data = window.sessionStorage.getItem(\"_wpm\")\n\t\t\tif (data !== null) {\n\t\t\t\treturn JSON.parse(data)\n\t\t\t} else {\n\t\t\t\treturn {}\n\t\t\t}\n\t\t} else {\n\t\t\treturn {}\n\t\t}\n\t}\n\n\twpm.setWpmSessionData = function (data) {\n\t\tif (window.sessionStorage) {\n\t\t\twindow.sessionStorage.setItem(\"_wpm\", JSON.stringify(data))\n\t\t}\n\t}\n\n\twpm.storeOrderIdOnServer = function (orderId) {\n\n\t\t// console.log('saving wpm_purchase_pixels_fired');\n\n\t\t// console.log('url: ' + wpm_premium_only_ajax_object.ajax_url);\n\t\t// console.log('nonce: ' + wpm_premium_only_ajax_object.nonce);\n\t\t// console.log('url: ' + wpm.ajax_url);\n\t\t// console.log('nonce: ' + wpm.nonce);\n\n\t\ttry {\n\t\t\t// save the state in the database\n\t\t\tlet data = {\n\t\t\t\taction : \"wpm_purchase_pixels_fired\",\n\t\t\t\torder_id: orderId,\n\t\t\t\t// nonce : ajax_object.nonce,\n\t\t\t\tnonce: wpm.nonce,\n\t\t\t}\n\n\t\t\tjQuery.ajax(\n\t\t\t\t{\n\t\t\t\t\ttype : \"post\",\n\t\t\t\t\tdataType: \"json\",\n\t\t\t\t\t// url : ajax_object.ajax_url,\n\t\t\t\t\turl : wpm.ajax_url,\n\t\t\t\t\tdata : data,\n\t\t\t\t\tsuccess: function (response) {\n\t\t\t\t\t\tif (response.success === false) {\n\t\t\t\t\t\t\tconsole.log(response)\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\terror : function (response) {\n\t\t\t\t\t\tconsole.log(response)\n\t\t\t\t\t},\n\t\t\t\t})\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t}\n\t}\n\n\twpm.getProductIdByCartItemKeyUrl = function (url) {\n\t\tlet searchParams = new URLSearchParams(url.search)\n\t\tlet cartItemKey = searchParams.get(\"remove_item\")\n\n\t\tlet productId\n\n\t\tif (wpmDataLayer.cartItemKeys[cartItemKey][\"variation_id\"] === 0) {\n\t\t\tproductId = wpmDataLayer.cartItemKeys[cartItemKey][\"product_id\"]\n\t\t} else {\n\t\t\tproductId = wpmDataLayer.cartItemKeys[cartItemKey][\"variation_id\"]\n\t\t}\n\n\t\treturn productId\n\t}\n\n\twpm.getAddToCartLinkProductIds = function () {\n\t\treturn jQuery(\"a\").map(function () {\n\t\t\tlet href = jQuery(this).attr(\"href\")\n\n\t\t\tif (href && href.includes(\"?add-to-cart=\")) {\n\t\t\t\tlet matches = href.match(/(add-to-cart=)(\\d+)/)\n\t\t\t\tif (matches) return matches[2]\n\t\t\t}\n\t\t}).get()\n\t}\n\n\twpm.getProductDetailsFormattedForEvent = function (productId, quantity = 1) {\n\n\t\t// console.log(wpmDataLayer.products[productId].dyn_r_ids)\n\n\t\tlet product = {\n\t\t\tid : productId.toString(),\n\t\t\tdyn_r_ids : wpmDataLayer.products[productId].dyn_r_ids,\n\t\t\tname : wpmDataLayer.products[productId].name,\n\t\t\tlist_name : wpmDataLayer.shop.list_name,\n\t\t\tbrand : wpmDataLayer.products[productId].brand,\n\t\t\tcategory : wpmDataLayer.products[productId].category,\n\t\t\tvariant : wpmDataLayer.products[productId].variant,\n\t\t\tlist_position: wpmDataLayer.products[productId].position,\n\t\t\tquantity : quantity,\n\t\t\tprice : wpmDataLayer.products[productId].price,\n\t\t\tcurrency : wpmDataLayer.shop.currency,\n\t\t\tisVariable : wpmDataLayer.products[productId].isVariable,\n\t\t\tisVariation : wpmDataLayer.products[productId].isVariation,\n\t\t\tparentId : wpmDataLayer.products[productId].parentId,\n\t\t}\n\n\t\tif (product.isVariation) product[\"parentId_dyn_r_ids\"] = wpmDataLayer.products[productId].parentId_dyn_r_ids\n\n\t\treturn product\n\t}\n\n\twpm.setReferrerToCookie = function () {\n\t\t// can't use session storage as we can't read it from the server\n\t\tif (!wpm.getCookie(\"wpmReferrer\")) {\n\t\t\twpm.setCookie(\"wpmReferrer\", document.referrer)\n\t\t}\n\t}\n\n\twpm.getReferrerFromCookie = function () {\n\t\tif (wpm.getCookie(\"wpmReferrer\")) {\n\t\t\treturn wpm.getCookie(\"wpmReferrer\")\n\t\t} else {\n\t\t\treturn null\n\t\t}\n\t}\n\n\twpm.getClidFromBrowser = function (clidId = \"gclid\") {\n\n\t\tlet clidCookieId\n\n\t\tclidCookieId = {\n\t\t\tgclid: \"_gcl_aw\",\n\t\t\tdclid: \"_gcl_dc\",\n\t\t}\n\n\t\tif (wpm.getCookie(clidCookieId[clidId])) {\n\t\t\tlet clidCookie = wpm.getCookie(clidCookieId[clidId])\n\t\t\tlet matches = clidCookie.match(/(GCL.[\\d]*.)(.*)/)\n\t\t\treturn matches[2]\n\t\t} else {\n\t\t\treturn \"\"\n\t\t}\n\t}\n\n\twpm.getUserAgent = function () {\n\t\treturn navigator.userAgent\n\t}\n\n\twpm.getViewPort = function () {\n\t\treturn {\n\t\t\twidth : Math.max(document.documentElement.clientWidth || 0, window.innerWidth || 0),\n\t\t\theight: Math.max(document.documentElement.clientHeight || 0, window.innerHeight || 0),\n\t\t}\n\t}\n\n\t/*\n\t* Handle Cookie Management Platforms\n\t* */\n\n\tlet getComplianzCookies = function () {\n\n\t\tlet cmplz_statistics = wpm.getCookie(\"cmplz_statistics\")\n\t\tlet cmplz_marketing = wpm.getCookie(\"cmplz_marketing\")\n\t\tlet cmplz_consent_status = wpm.getCookie(\"cmplz_consent_status\") || wpm.getCookie(\"cmplz_banner-status\")\n\n\n\t\tif (cmplz_consent_status) {\n\t\t\treturn {\n\t\t\t\tanalytics : cmplz_statistics === \"allow\",\n\t\t\t\tads : cmplz_marketing === \"allow\",\n\t\t\t\tvisitorHasChosen: true,\n\t\t\t}\n\t\t} else {\n\t\t\treturn false\n\t\t}\n\t}\n\n\tlet getCookieLawInfoCookies = function () {\n\n\t\tlet analyticsCookie = wpm.getCookie(\"cookielawinfo-checkbox-analytics\") || wpm.getCookie(\"cookielawinfo-checkbox-analytiques\")\n\t\tlet adsCookie = wpm.getCookie(\"cookielawinfo-checkbox-advertisement\") || wpm.getCookie(\"cookielawinfo-checkbox-publicite\")\n\t\tlet visitorHasChosen = wpm.getCookie(\"CookieLawInfoConsent\")\n\n\t\tif (analyticsCookie || adsCookie) {\n\n\t\t\treturn {\n\t\t\t\tanalytics : analyticsCookie === \"yes\",\n\t\t\t\tads : adsCookie === \"yes\",\n\t\t\t\tvisitorHasChosen: !!visitorHasChosen,\n\t\t\t}\n\t\t} else {\n\t\t\treturn false\n\t\t}\n\t}\n\n\n\tlet\n\t\twpmConsentValues = {}\n\twpmConsentValues.categories = {}\n\twpmConsentValues.pixels = []\n\twpmConsentValues.mode = \"category\"\n\twpmConsentValues.visitorHasChosen = false\n\n\twpm.getConsentValues = function () {\n\t\treturn wpmConsentValues\n\t}\n\n\twpm.setConsentValueCategories = function (analytics = false, ads = false) {\n\t\twpmConsentValues.categories.analytics = analytics\n\t\twpmConsentValues.categories.ads = ads\n\t}\n\n\twpm.updateConsentCookieValues = function (explicitConsent = false) {\n\n\t\t// ad_storage\n\t\t// analytics_storage\n\t\t// functionality_storage\n\t\t// personalization_storage\n\t\t// security_storage\n\n\t\t// console.log('exp cons: ' + explicitConsent)\n\n\t\tlet cookie\n\n\t\tif (cookie = wpm.getCookie(\"CookieConsent\")) {\n\t\t\t// Cookiebot\n\t\t\t// https://wordpress.org/plugins/cookiebot/\n\t\t\tcookie = decodeURI(cookie)\n\n\t\t\t// console.log(cookie.indexOf('statistics:true'))\n\t\t\t// console.log(cookie.indexOf('marketing:true'))\n\n\t\t\twpmConsentValues.categories.analytics = cookie.indexOf(\"statistics:true\") >= 0\n\t\t\twpmConsentValues.categories.ads = cookie.indexOf(\"marketing:true\") >= 0\n\t\t\twpmConsentValues.visitorHasChosen = true\n\n\t\t} else if (cookie = wpm.getCookie(\"CookieScriptConsent\")) {\n\t\t\t// Cookie Script\n\t\t\t// https://wordpress.org/plugins/cookie-script-com/\n\n\t\t\tcookie = JSON.parse(cookie)\n\n\t\t\t// console.log(cookie)\n\t\t\t// console.log(cookie.action)\n\t\t\t// console.log('cat length: ' + cookie.categories.length)\n\t\t\t// console.log(cookie.categories.indexOf('performance'))\n\n\t\t\tif (cookie.action === \"reject\") {\n\t\t\t\twpmConsentValues.categories.analytics = false\n\t\t\t\twpmConsentValues.categories.ads = false\n\t\t\t} else if (cookie.categories.length === 2) {\n\t\t\t\twpmConsentValues.categories.analytics = true\n\t\t\t\twpmConsentValues.categories.ads = true\n\t\t\t} else {\n\t\t\t\twpmConsentValues.categories.analytics = cookie.categories.indexOf(\"performance\") >= 0\n\t\t\t\twpmConsentValues.categories.ads = cookie.categories.indexOf(\"targeting\") >= 0\n\t\t\t}\n\n\t\t\twpmConsentValues.visitorHasChosen = true\n\n\t\t\t// console.log(wpmConsentValues)\n\n\t\t} else if (cookie = wpm.getCookie(\"borlabs-cookie\")) {\n\t\t\t// Borlabs Cookie\n\t\t\t// https://borlabs.io/borlabs-cookie/\n\n\t\t\tcookie = decodeURI(cookie)\n\t\t\tcookie = JSON.parse(cookie)\n\n\t\t\twpmConsentValues.categories.analytics = !!cookie?.consents?.statistics\n\t\t\twpmConsentValues.categories.ads = !!cookie?.consents?.marketing\n\t\t\twpmConsentValues.visitorHasChosen = true\n\t\t\twpmConsentValues.pixels = [...cookie?.consents?.statistics || [], ...cookie?.consents?.marketing || []]\n\t\t\twpmConsentValues.mode = \"pixel\"\n\n\t\t} else if (cookie = getComplianzCookies()) {\n\t\t\t// Complianz Cookie\n\t\t\t// https://wordpress.org/plugins/complianz-gdpr/\n\n\t\t\t// console.log(cookie)\n\n\t\t\twpmConsentValues.categories.analytics = cookie.analytics === true\n\t\t\twpmConsentValues.categories.ads = cookie.ads === true\n\t\t\twpmConsentValues.visitorHasChosen = cookie.visitorHasChosen\n\n\t\t\t// console.log(wpmConsentValues)\n\n\t\t} else if (cookie = wpm.getCookie(\"cookie_notice_accepted\")) {\n\t\t\t// Cookie Compliance (free version)\n\t\t\t// https://wordpress.org/plugins/cookie-notice/\n\n\t\t\twpmConsentValues.categories.analytics = true\n\t\t\twpmConsentValues.categories.ads = true\n\t\t\twpmConsentValues.visitorHasChosen = true\n\n\t\t} else if (cookie = wpm.getCookie(\"hu-consent\")) {\n\t\t\t// Cookie Compliance (pro version)\n\t\t\t// https://wordpress.org/plugins/cookie-notice/\n\n\t\t\tcookie = JSON.parse(cookie)\n\n\t\t\twpmConsentValues.categories.analytics = !!cookie.categories[\"3\"]\n\t\t\twpmConsentValues.categories.ads = !!cookie.categories[\"4\"]\n\t\t\twpmConsentValues.visitorHasChosen = true\n\n\t\t} else if (cookie = getCookieLawInfoCookies()) {\n\t\t\t// CookieYes, GDPR Cookie Consent (Cookie Law Info)\n\t\t\t// https://wordpress.org/plugins/cookie-law-info/\n\n\t\t\twpmConsentValues.categories.analytics = cookie.analytics === true\n\t\t\twpmConsentValues.categories.ads = cookie.ads === true\n\t\t\twpmConsentValues.visitorHasChosen = cookie.visitorHasChosen === true\n\n\t\t} else if (cookie = wpm.getCookie(\"moove_gdpr_popup\")) {\n\t\t\t// GDPR Cookie Compliance Plugin by Moove Agency\n\t\t\t// https://wordpress.org/plugins/gdpr-cookie-compliance/\n\t\t\t// TODO write documentation on how to set up the plugin in order for this to work properly\n\n\t\t\tcookie = JSON.parse(cookie)\n\t\t\t// console.log('moove cookie thirdparty: ' + cookie.thirdparty)\n\t\t\t// console.log('moove cookie advanced: ' + cookie.advanced)\n\n\t\t\twpmConsentValues.categories.analytics = cookie.thirdparty === \"1\"\n\t\t\twpmConsentValues.categories.ads = cookie.advanced === \"1\"\n\t\t\twpmConsentValues.visitorHasChosen = true\n\n\t\t\t// console.log(wpmConsentValues)\n\n\t\t} else {\n\t\t\t// consentValues.categories.analytics = true\n\t\t\t// consentValues.categories.ads = true\n\n\t\t\twpmConsentValues.categories.analytics = !explicitConsent\n\t\t\twpmConsentValues.categories.ads = !explicitConsent\n\t\t}\n\t}\n\n\twpm.updateConsentCookieValues()\n\n\twpm.setConsentDefaultValuesToExplicit = function () {\n\t\twpmConsentValues.categories = {\n\t\t\tanalytics: false,\n\t\t\tads : false,\n\t\t}\n\t}\n\n\twpm.canIFire = function (category, pixelName) {\n\n\t\tlet canIFireMode\n\n\t\tif (\"category\" === wpmConsentValues.mode) {\n\t\t\tcanIFireMode = !!wpmConsentValues.categories[category]\n\t\t} else if (\"pixel\" === wpmConsentValues.mode) {\n\t\t\tcanIFireMode = wpmConsentValues.pixels.includes(pixelName)\n\t\t} else {\n\t\t\tconsole.error(\"Couldn't find a valid consent mode in wpmConsentValues\")\n\t\t\tcanIFireMode = false\n\t\t}\n\n\t\tif (canIFireMode) {\n\t\t\treturn true\n\t\t} else {\n\t\t\tif (true || wpm.urlHasParameter(\"debugConsentMode\")) {\n\t\t\t\twpm.logPreventedPixelLoading(pixelName, category)\n\t\t\t}\n\n\t\t\treturn false\n\t\t}\n\t}\n\n\twpm.logPreventedPixelLoading = function (pixelName, category) {\n\t\tif (wpmDataLayer?.shop?.cookie_consent_mgmt?.explicit_consent) {\n\t\t\tconsole.log(\"WooCommerce Pixel Manager: The \\\"\" + pixelName + \" (category: \" + category + \")\\\" pixel has not fired because you have not given consent for it yet. (WPM is in explicit consent mode.)\")\n\t\t} else {\n\t\t\tconsole.log(\"WooCommerce Pixel Manager: The \\\"\" + pixelName + \" (category: \" + category + \")\\\" pixel has not fired because you have removed consent for this pixel. (WPM is in implicit consent mode.)\")\n\t\t}\n\t}\n\n\t/**\n\t * Runs through each script in <head> and blocks / unblocks it according to the plugin settings\n\t * and user consent.\n\t */\n\n\t// https://stackoverflow.com/q/65453565/4688612\n\twpm.scriptTagObserver = new MutationObserver((mutations) => {\n\t\tmutations.forEach(({addedNodes}) => {\n\t\t\t[...addedNodes]\n\t\t\t\t.forEach(node => {\n\n\t\t\t\t\tif ($(node).data(\"wpm-cookie-category\")) {\n\n\t\t\t\t\t\t// console.log(node)\n\n\t\t\t\t\t\t// If the pixel category has been approved > unblock\n\t\t\t\t\t\t// If the pixel belongs to more than one category, then unblock if one of the categories has been approved\n\t\t\t\t\t\t// If no category has been approved, but the Google Consent Mode is active, then only unblock the Google scripts\n\n\t\t\t\t\t\tif (wpm.shouldScriptBeActive(node)) {\n\t\t\t\t\t\t\twpm.unblockScript(node)\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\twpm.blockScript(node)\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t})\n\t})\n\n\twpm.scriptTagObserver.observe(document.head, {childList: true, subtree: true})\n\twindow.addEventListener(\"DOMContentLoaded\", () => wpm.scriptTagObserver.disconnect())\n\n\twpm.shouldScriptBeActive = function (node) {\n\n\t\tif (\n\t\t\twpmDataLayer.shop.cookie_consent_mgmt.explicit_consent ||\n\t\t\twpmConsentValues.visitorHasChosen\n\t\t) {\n\n\t\t\tif (wpmConsentValues.mode === \"category\" && $(node).data(\"wpm-cookie-category\").split(\",\").some(element => wpmConsentValues.categories[element])) {\n\t\t\t\treturn true\n\t\t\t} else if (wpmConsentValues.mode === \"pixel\" && wpmConsentValues.pixels.includes($(node).data(\"wpm-pixel-name\"))) {\n\t\t\t\treturn true\n\t\t\t} else if (wpmConsentValues.mode === \"pixel\" && $(node).data(\"wpm-pixel-name\") === \"google\" && [\"google-analytics\", \"google-ads\"].some(element => wpmConsentValues.pixels.includes(element))) {\n\t\t\t\treturn true\n\t\t\t} else if (wpmDataLayer?.pixels?.google?.consent_mode?.active && $(node).data(\"wpm-pixel-name\") === \"google\") {\n\t\t\t\treturn true\n\t\t\t} else {\n\t\t\t\treturn false\n\t\t\t}\n\t\t} else {\n\t\t\treturn true\n\t\t}\n\t}\n\n\n\twpm.unblockScript = function (scriptNode, removeAttach = false) {\n\n\t\tif (removeAttach) $(scriptNode).remove()\n\n\t\tlet wpmSrc = $(scriptNode).data(\"wpm-src\")\n\t\tif (wpmSrc) $(scriptNode).attr(\"src\", wpmSrc)\n\n\t\tscriptNode.type = \"text/javascript\"\n\n\t\tif (removeAttach) $(scriptNode).appendTo(\"head\")\n\n\t\tjQuery(document).trigger(\"wpmPreLoadPixels\", {})\n\t}\n\n\twpm.blockScript = function (scriptNode, removeAttach = false) {\n\n\t\tif (removeAttach) $(scriptNode).remove()\n\n\t\tif ($(scriptNode).attr(\"src\")) $(scriptNode).removeAttr(\"src\")\n\t\tscriptNode.type = \"blocked/javascript\"\n\n\t\tif (removeAttach) $(scriptNode).appendTo(\"head\")\n\t}\n\n\twpm.unblockAllScripts = function (analytics = true, ads = true) {\n\t\t// console.log('unblocking all scripts')\n\n\t\t$.each(\n\t\t\t$(\"script[type=\\\"blocked/javascript\\\"]\"), function (index, scriptNode) {\n\n\t\t\t\tif ($(scriptNode).data(\"wpm-cookie-category\").includes(\"analytics\") && analytics) {\n\t\t\t\t\twpm.unblockScript(scriptNode, true)\n\t\t\t\t} else if ($(scriptNode).data(\"wpm-cookie-category\").includes(\"ads\") && ads) {\n\t\t\t\t\twpm.unblockScript(scriptNode, true)\n\t\t\t\t}\n\t\t\t})\n\n\t\tjQuery(document).trigger(\"wpmPreLoadPixels\", {})\n\t}\n\n\twpm.unblockSelectedPixels = function () {\n\t\t$.each(\n\t\t\t$(\"script[type=\\\"blocked/javascript\\\"]\"), function (index, node) {\n\n\t\t\t\tif (wpmConsentValues.pixels.includes($(node).data(\"wpm-pixel-name\"))) {\n\t\t\t\t\twpm.unblockScript(node, true)\n\t\t\t\t} else if ($(node).data(\"wpm-pixel-name\") === \"google\" && [\"google-analytics\", \"google-ads\"].some(element => wpmConsentValues.pixels.includes(element))) {\n\t\t\t\t\twpm.unblockScript(node, true)\n\t\t\t\t}\n\t\t\t})\n\n\t\tjQuery(document).trigger(\"wpmPreLoadPixels\", {})\n\t}\n\n\n\t/**\n\t * Block or unblock scripts for each CMP immediately after cookie consent has been updated\n\t * by the visitor.\n\t */\n\n\t// Borlabs Cookie\n\t// If visitor accepts cookies in Borlabs Cookie unblock the scripts\n\twindow.addEventListener(\"borlabs-cookie-consent-saved\", function () {\n\n\t\twpm.updateConsentCookieValues()\n\n\t\tif (wpmConsentValues.mode === \"pixel\") {\n\n\t\t\twpm.unblockSelectedPixels()\n\t\t\twpm.updateGoogleConsentMode(wpmConsentValues.pixels.includes(\"google-analytics\"), wpmConsentValues.pixels.includes(\"google-ads\"))\n\t\t} else {\n\n\t\t\twpm.unblockAllScripts(wpmConsentValues.categories.analytics, wpmConsentValues.categories.ads)\n\t\t\twpm.updateGoogleConsentMode(wpmConsentValues.categories.analytics, wpmConsentValues.categories.ads)\n\t\t}\n\t})\n\n\t// Cookiebot\n\t// If visitor accepts cookies in Cookiebot unblock the scripts\n\t// https://www.cookiebot.com/en/developer/\n\twindow.addEventListener(\"CookiebotOnAccept\", function () {\n\t\tif (Cookiebot.consent.statistics) wpmConsentValues.categories.analytics = true\n\t\tif (Cookiebot.consent.marketing) wpmConsentValues.categories.ads = true\n\n\t\twpm.unblockAllScripts(wpmConsentValues.categories.analytics, wpmConsentValues.categories.ads)\n\t\twpm.updateGoogleConsentMode(wpmConsentValues.categories.analytics, wpmConsentValues.categories.ads)\n\n\t}, false)\n\n\t/**\n\t * Cookie Script\n\t * If visitor accepts cookies in Cookie Script unblock the scripts\n\t * https://support.cookie-script.com/article/20-custom-events\n\t */\n\twindow.addEventListener(\"CookieScriptAccept\", function (e) {\n\t\tif (e.detail.categories.includes(\"performance\")) wpmConsentValues.categories.analytics = true\n\t\tif (e.detail.categories.includes(\"targeting\")) wpmConsentValues.categories.ads = true\n\n\t\twpm.unblockAllScripts(wpmConsentValues.categories.analytics, wpmConsentValues.categories.ads)\n\t\twpm.updateGoogleConsentMode(wpmConsentValues.categories.analytics, wpmConsentValues.categories.ads)\n\t})\n\n\t/**\n\t * Cookie Script\n\t * If visitor accepts cookies in Cookie Script unblock the scripts\n\t * https://support.cookie-script.com/\n\t */\n\twindow.addEventListener(\"CookieScriptAcceptAll\", function () {\n\t\twpm.unblockAllScripts(true, true)\n\t\twpm.updateGoogleConsentMode(true, true)\n\t})\n\n\t// Complianz Cookie\n\t// If visitor accepts cookies in Complianz unblock the scripts\n\tdocument.addEventListener(\"cmplzStatusChange\", function () {\n\n\t\twpm.updateConsentCookieValues()\n\n\t\t// console.log(wpmConsentValues)\n\n\t\twpm.unblockAllScripts(wpmConsentValues.categories.analytics, wpmConsentValues.categories.ads)\n\t\twpm.updateGoogleConsentMode(wpmConsentValues.categories.analytics, wpmConsentValues.categories.ads)\n\t})\n\n\t// Cookie Compliance by hu-manity.co (free and pro)\n\t// If visitor accepts cookies in Cookie Notice by hu-manity.co unblock the scripts (free version)\n\t// https://wordpress.org/support/topic/events-on-consent-change/#post-15202792\n\tdocument.addEventListener(\"setCookieNotice\", function () {\n\n\t\twpm.updateConsentCookieValues()\n\n\t\t// console.log(wpmConsentValues)\n\n\t\twpm.unblockAllScripts(wpmConsentValues.categories.analytics, wpmConsentValues.categories.ads)\n\t\twpm.updateGoogleConsentMode(wpmConsentValues.categories.analytics, wpmConsentValues.categories.ads)\n\t})\n\n\t/**\n\t * Cookie Compliance by hu-manity.co (free and pro)\n\t * If visitor accepts cookies in Cookie Notice by hu-manity.co unblock the scripts (pro version)\n\t * https://wordpress.org/support/topic/events-on-consent-change/#post-15202792\n\t * Because Cookie Notice has no documented API or event that is being triggered on consent save or update\n\t * we have to solve this by using a mutation observer.\n\t *\n\t * @type {MutationObserver}\n\t */\n\n\twpm.huObserver = new MutationObserver(function (mutations) {\n\t\tmutations.forEach(({addedNodes}) => {\n\t\t\t[...addedNodes]\n\t\t\t\t.forEach(node => {\n\n\t\t\t\t\tif (node.id === \"hu\") {\n\n\t\t\t\t\t\tjQuery(\".hu-cookies-save\").on(\"click\", function () {\n\t\t\t\t\t\t\twpm.updateConsentCookieValues()\n\t\t\t\t\t\t\twpm.unblockAllScripts(wpmConsentValues.categories.analytics, wpmConsentValues.categories.ads)\n\t\t\t\t\t\t\twpm.updateGoogleConsentMode(wpmConsentValues.categories.analytics, wpmConsentValues.categories.ads)\n\t\t\t\t\t\t})\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t})\n\t})\n\n\tif (window.hu) {\n\t\twpm.huObserver.observe(document.documentElement || document.body, {childList: true, subtree: true})\n\t}\n\n\twpm.version = function () {\n\t\tconsole.log(wpmDataLayer.version)\n\t}\n\n\t// https://api.jquery.com/jquery.getscript/\n\twpm.loadScriptAndCacheIt = function (url, options) {\n\n\t\t// Allow user to set any option except for dataType, cache, and url\n\t\toptions = jQuery.extend(options || {}, {\n\t\t\tdataType: \"script\",\n\t\t\tcache : true,\n\t\t\turl : url,\n\t\t})\n\n\t\t// Use $.ajax() since it is more flexible than $.getScript\n\t\t// Return the jqXHR object so we can chain callbacks\n\t\treturn jQuery.ajax(options)\n\t}\n\n\twpm.getOrderItemPrice = function (orderItem) {\n\t\treturn (orderItem.total + orderItem.total_tax) / orderItem.quantity\n\t}\n\n\twpm.hasLoginEventFired = function () {\n\t\tlet data = wpm.getWpmSessionData()\n\t\treturn data?.loginEventFired\n\t}\n\n\twpm.setLoginEventFired = function () {\n\t\tlet data = wpm.getWpmSessionData()\n\t\tdata[\"loginEventFired\"] = true\n\t\twpm.setWpmSessionData(data)\n\t}\n\n\twpm.wpmDataLayerExists = function () {\n\t\treturn new Promise(function (resolve) {\n\t\t\t(function waitForVar() {\n\t\t\t\tif (typeof wpmDataLayer !== \"undefined\") return resolve()\n\t\t\t\tsetTimeout(waitForVar, 50)\n\t\t\t})()\n\t\t})\n\t}\n\n\twpm.jQueryExists = function () {\n\t\treturn new Promise(function (resolve) {\n\t\t\t(function waitForjQuery() {\n\t\t\t\tif (typeof jQuery !== \"undefined\") return resolve()\n\t\t\t\tsetTimeout(waitForjQuery, 100)\n\t\t\t})()\n\t\t})\n\t}\n\n\twpm.pageLoaded = function () {\n\t\treturn new Promise(function (resolve) {\n\t\t\t(function waitForVar() {\n\t\t\t\tif (\"complete\" === document.readyState) return resolve()\n\t\t\t\tsetTimeout(waitForVar, 50)\n\t\t\t})()\n\t\t})\n\t}\n\n\twpm.pageReady = function () {\n\t\treturn new Promise(function (resolve) {\n\t\t\t(function waitForVar() {\n\t\t\t\tif (\"interactive\" === document.readyState || \"complete\" === document.readyState) return resolve()\n\t\t\t\tsetTimeout(waitForVar, 50)\n\t\t\t})()\n\t\t})\n\t}\n\n\twpm.isMiniCartActive = function () {\n\t\tif (window.sessionStorage) {\n\t\t\tfor (const [key, value] of Object.entries(window.sessionStorage)) {\n\t\t\t\tif (key.includes(\"wc_fragments\")) {\n\t\t\t\t\treturn true\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false\n\t\t} else {\n\t\t\treturn false\n\t\t}\n\t}\n\n\twpm.doesWooCommerceCartExist = function () {\n\t\treturn document.cookie.includes(\"woocommerce_items_in_cart\")\n\t}\n\n\twpm.urlHasParameter = function (parameter) {\n\t\tlet urlParams = new URLSearchParams(window.location.search)\n\t\treturn urlParams.has(parameter)\n\t}\n\n\t// wpm['load'] = {\n\t// base: true\n\t// };\n\n\twindow[\"wpmLoaded\"] = {}\n\n\t// return {\n\t// writeOrderIdToStorage : writeOrderIdToStorage,\n\t// isOrderIdStored : isOrderIdStored,\n\t// isEmail : isEmail,\n\t// removeProductFromCart : removeProductFromCart,\n\t// getViewItemProducts : getViewItemProducts,\n\t// addProductToCart : addProductToCart,\n\t// getCartItemsFromBackEnd: getCartItemsFromBackEnd,\n\t// fireCheckoutOption : fireCheckoutOption,\n\t// getCartItems : getCartItems\n\t// }\n\n}(window.wpm = window.wpm || {}, jQuery))\n","/**\n * Load all WPM functions\n *\n * Ignore event listeners. They need to be loaded after\n * we made sure that jQuery has been loaded.\n */\n\nrequire(\"./functions\")\n\n// #if process.env.TIER === 'premium'\n// require(\"./functions_premium\")\n// #endif\n","/**\n * After wpm is loaded\n * we first check if wpmDataLayer is loaded,\n * and as soon as it is, we load the pixels,\n * and as soon as the page load is complete,\n * we fire the wpmLoad event.\n *\n * @param {{pro:bool}} wpmDataLayer.version\n *\n * https://stackoverflow.com/a/25868457/4688612\n * https://stackoverflow.com/a/44093516/4688612\n */\n\nwpm.wpmDataLayerExists()\n\t.then(function () {\n\t\tconsole.log(\"WooCommerce Pixel Manager: \" + (wpmDataLayer.version.pro ? \"Pro\" : \"Free\") +\" Version \" + wpmDataLayer.version.number + \" loaded\")\n\t\tjQuery(document).trigger(\"wpmPreLoadPixels\", {})\n\t})\n\t.then(function () {\n\t\twpm.pageLoaded().then(function () {\n\t\t\tjQuery(document).trigger(\"wpmLoad\", {})\n\t\t})\n\t})\n\n\n\n/**\n * Run when page is ready\n *\n */\n\nwpm.pageReady().then(function () {\n\n\t/**\n\t * Run as soon as wpm namespace is loaded\n\t */\n\n\twpm.wpmDataLayerExists()\n\t\t.then(function () {\n\t\t\t// watch for products visible in viewport\n\t\t\twpm.startIntersectionObserverToWatch()\n\n\t\t\t// watch for lazy loaded products\n\t\t\twpm.startProductsMutationObserverToWatch()\n\t\t})\n})\n\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","/**\n * Load all essential scripts first\n */\n\nrequire(\"./wpm/functions_loader\")\n\n// Only load the event listeners after jQuery has been loaded for sure\nwpm.jQueryExists().then(function () {\n\n\trequire(\"./wpm/event_listeners\")\n\n\trequire(\"./google/loader\")\n\trequire(\"./facebook/loader\")\n\trequire(\"./hotjar/loader\")\n\n\n\t/**\n\t * Load all premium scripts\n\t */\n\n\t// #if process.env.TIER === 'premium'\n// \trequire(\"./microsoft-ads/loader\")\n// \trequire(\"./pinterest/loader\")\n// \trequire(\"./snapchat/loader\")\n// \trequire(\"./tiktok/loader\")\n// \trequire(\"./twitter/loader\")\n\t// #endif\n\n\n\t/**\n\t * Initiate WPM.\n\t *\n\t * It makes sure that the script flow gets executed correctly,\n\t * no matter how JS \"optimizers\" shuffle the code.\n\t */\n\n\trequire(\"./wpm/init\")\n})\n\n"],"names":["jQuery","document","on","wpmDataLayer","pixels","facebook","pixel_id","loaded","wpm","canIFire","loadFacebookPixel","event","product","eventId","getRandomEventId","fbq","content_type","content_name","name","content_ids","dyn_r_ids","dynamic_remarketing","id_type","value","parseFloat","quantity","price","currency","eventID","shop","trigger","event_name","event_id","user_data","getFbUserData","product_data","product_id","event_source_url","window","location","href","e","console","error","fbViewContent","setFbUserData","order","value_filtered","facebookContentIds","id","$","undefined","fBUserData","f","b","n","callMethod","apply","arguments","queue","push","_fbq","version","t","createElement","async","src","s","getElementsByTagName","parentNode","insertBefore","Math","random","toString","substring","getFbUserDataFromBrowser","fbp","getCookie","fbc","client_user_agent","navigator","userAgent","prodIds","key","item","Object","entries","items","general","variationsOutput","variation_id","String","products","require","isEmptyObject","google","ads","conversionIds","status","googleConfigConditionsMet","isVariable","send_events_with_parent_ids","gtagLoaded","then","gtag","send_to","getGoogleAdsConversionIdentifiers","google_business_vertical","getGoogleAdsDynamicRemarketingOrderItems","data_basic","data_with_cart","getGoogleAdsConversionIdentifiersWithLabel","transaction_id","number","new_customer","aw_merchant_id","discount","aw_feed_country","aw_feed_language","getGoogleAdsRegularOrderItems","conversionIdentifiers","orderItems","orderItem","analytics","universal","property_id","mp_active","affiliation","value_regular","tax","shipping","coupon","getGAUAOrderItems","list_position","category","join","variant","variant_name","brand","ga4","measurement_id","getGA4OrderItems","item_name","item_category","item_id","item_variant","item_brand","state","canGoogleLoad","loadGoogle","logPreventedPixelLoading","type","consent_mode","active","getConsentValues","mode","categories","includes","getVisitorConsentStatusAndUpdateGoogleConsentSettings","google_consent_settings","analytics_storage","ad_storage","updateGoogleConsentMode","cookie_consent_mgmt","explicit_consent","fireGtagGoogleAds","enhanced_conversions","phone_conversion_label","phone_conversion_number","keys","page_type","enhanced_conversion_data","fireGtagGoogleAnalyticsUA","parameters","fireGtagGoogleAnalyticsGA4","isGoogleActive","getGoogleGtagId","loadScriptAndCacheIt","done","script","textStatus","dataLayer","wait_for_update","region","ads_data_redaction","url_passthrough","linker","settings","Date","Promise","resolve","reject","startTime","wait","setTimeout","optimize","container_id","load_google_optimize_pixel","hotjar","site_id","load_hotjar_pixel","h","o","hj","q","_hjSettings","hjid","hjsv","a","r","appendChild","url","URL","this","attr","productId","getProductIdByCartItemKeyUrl","removeProductFromCart","data","addProductToCart","product_type","Number","val","each","find","classes","getPostIdFromString","one","target","closest","matches","match","nextAll","getIdBasedOndVariationsOutputSetting","Error","getProductDetailsFormattedForEvent","isEmail","fireCheckoutProgress","emailSelected","paymentMethodSelected","fireCheckoutOption","cart","getCartItemsFromBackend","variation","doesWooCommerceCartExist","getCartItems","productIds","getAddToCartLinkProductIds","getProductsFromBackend","referrer","referrerHostname","hostname","host","setCookie","wpmLoadFired","getMainProductIdFromProductPage","getProductDataForViewItemEvent","isOrderIdStored","writeOrderIdToStorage","user","hasLoginEventFired","setLoginEventFired","updateConsentCookieValues","wpmDeduper","wpmRestSettings","checkCookie","useRestEndpoint","isSessionStorageAvailable","isRestEndpointAvailable","isBelowRestErrorThreshold","sessionStorage","getItem","JSON","parse","testEndpoint","protocol","cookieName","ajax","timeout","statusCode","response","setItem","stringify","isWpmRestEndpointAvailable","orderId","Storage","localStorage","ids","expiresDate","setDate","getDate","cookie","toUTCString","storeOrderIdOnServer","orderDeduplication","log","email","test","quantityToRemove","isVariation","parentId","saveCartObjectToDataLayer","action","dataType","ajax_url","success","cartItems","filter","hasOwnProperty","length","assign","cartObject","step","checkout_option","string","triggerViewItemList","indexOf","viewItemListTriggerTestMode","css","append","viewItemListTrigger","opacity","backgroundColor","getSearchTermFromUrl","URLSearchParams","search","get","io","ioTimeouts","observerCallback","observer","forEach","entry","elementId","next","isIntersecting","testMode","repeat","unobserve","clearTimeout","remove","allIoElementsToWatch","ioid","startIntersectionObserverToWatch","urlHasParameter","IntersectionObserver","threshold","map","i","elem","parent","hasClass","prev","observe","startProductsMutationObserverToWatch","productsNode","parents","has","first","productsMutationObserver","attributes","childList","characterData","MutationObserver","mutations","mutation","newNodes","addedNodes","hasWpmProductIdElement","siblings","cookieValue","expiryDays","d","setTime","getTime","expires","ca","decodeURIComponent","split","c","charAt","getWpmSessionData","setWpmSessionData","order_id","nonce","cartItemKey","cartItemKeys","list_name","position","parentId_dyn_r_ids","setReferrerToCookie","getReferrerFromCookie","getClidFromBrowser","clidCookieId","clidId","gclid","dclid","getUserAgent","getViewPort","width","max","documentElement","clientWidth","innerWidth","height","clientHeight","innerHeight","getComplianzCookies","cmplz_statistics","cmplz_marketing","visitorHasChosen","getCookieLawInfoCookies","analyticsCookie","adsCookie","wpmConsentValues","setConsentValueCategories","explicitConsent","decodeURI","consents","statistics","marketing","thirdparty","advanced","setConsentDefaultValuesToExplicit","pixelName","canIFireMode","scriptTagObserver","node","shouldScriptBeActive","unblockScript","blockScript","head","subtree","addEventListener","disconnect","some","element","scriptNode","removeAttach","wpmSrc","appendTo","removeAttr","unblockAllScripts","index","unblockSelectedPixels","Cookiebot","consent","detail","huObserver","hu","body","options","extend","cache","getOrderItemPrice","total","total_tax","loginEventFired","wpmDataLayerExists","waitForVar","jQueryExists","waitForjQuery","pageLoaded","readyState","pageReady","isMiniCartActive","parameter","pro","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","exports","module","__webpack_modules__"],"sourceRoot":""}
1
+ {"version":3,"file":"wpm-public.p1.min.js","mappings":"uBAIC,SAAUA,EAAKC,EAAGC,GAElB,IAAIC,EAEJH,EAAII,kBAAoB,WAEvB,IAAI,UACH,UAAIC,oBAAJ,iBAAI,EAAcC,cAAlB,iBAAI,EAAsBC,gBAA1B,OAAI,EAAgCC,WAEnCH,aAAaC,OAAOC,SAASE,QAAS,EAGzBC,EAMuBC,OANrBC,EAM6BC,SAN3BC,EAMoC,SAL9CJ,EAAEK,MAAWC,EAAEN,EAAEK,IAAI,WAAWC,EAAEC,WACrCD,EAAEC,WAAWC,MAAMF,EAAEG,WAAWH,EAAEI,MAAMC,KAAKF,YACzCT,EAAEY,OAAKZ,EAAEY,KAAKN,GAAEA,EAAEK,KAAKL,EAAEA,EAAEP,QAAO,EAAGO,EAAEO,QAAQ,MACnDP,EAAEI,MAAM,IAAGI,EAAEZ,EAAEa,cAAcX,IAAKY,OAAM,EACxCF,EAAEG,IAEF,kDAFQC,EAAEhB,EAAEiB,qBAAqBf,GAAG,IAClCgB,WAAWC,aAAaP,EAAEI,IAIhCb,IAAI,OAAQV,aAAaC,OAAOC,SAASC,UACzCO,IAAI,QAAS,aAEb,MAAOD,GACRkB,QAAQC,MAAMnB,GAdT,IAASJ,EAAEE,EAAEE,EAAIE,EAAEQ,EAAEI,GAkB5B5B,EAAIkC,iBAAmB,WACtB,OA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Z,EAAA3D,oBAAA,mBAAcyc,YAAd,SAAoBxX,KAAOtF,IAAI2b,uBAClC5X,OAAOlD,UAAUmD,QAAQ,YACzBhE,IAAI6b,sBAiBLxb,aAAawc,cAAe,GAG5B,MAAO/b,GACRkB,QAAQC,MAAMnB,OAQhBiD,OAAOpD,QAAQ4E,GAAG,oBAAoB,WAAY,UAEjD,UAAIlF,oBAAJ,iBAAI,EAAcsD,YAAlB,iBAAI,EAAoBuG,2BAAxB,OAAI,EAAyCC,kBAC5CnK,IAAIiZ,2BAA0B,GAE/BlV,OAAOlD,UAAUmD,QAAQ,gBAAiB,SC/4DvC+Y,EAA2B,GAG/B,SAASC,EAAoBC,GAE5B,IAAIC,EAAeH,EAAyBE,GAC5C,QAAqB/c,IAAjBgd,EACH,OAAOA,EAAaC,QAGrB,IAAIC,EAASL,EAAyBE,GAAY,CAGjDE,QAAS,IAOV,OAHAE,EAAoBJ,GAAUG,EAAQA,EAAOD,QAASH,GAG/CI,EAAOD,QCjBfG,EAAQ,KAMRA,EAAQ,KACRA,EAAQ,KACRA,EAAQ,KACRA,EAAQ,KACRA,EAAQ,KACRA,EAAQ,KACRA,EAAQ,KAMRA,EAAQ,M","sources":["webpack://WooCommerce-Pixel-Manager/./src/js/public/facebook.js","webpack://WooCommerce-Pixel-Manager/./src/js/public/google-ads.js","webpack://WooCommerce-Pixel-Manager/./src/js/public/google-ga-4.js","webpack://WooCommerce-Pixel-Manager/./src/js/public/google-ga-ua.js","webpack://WooCommerce-Pixel-Manager/./src/js/public/google-optimize.js","webpack://WooCommerce-Pixel-Manager/./src/js/public/google.js","webpack://WooCommerce-Pixel-Manager/./src/js/public/hotjar.js","webpack://WooCommerce-Pixel-Manager/./src/js/public/wpm-loader.js","webpack://WooCommerce-Pixel-Manager/./src/js/public/wpm.js","webpack://WooCommerce-Pixel-Manager/webpack/bootstrap","webpack://WooCommerce-Pixel-Manager/./src/js/public/main-free.js"],"sourcesContent":["/**\n * Add functions for Facebook\n * */\n\n(function (wpm, $, undefined) {\n\n\tlet fBUserData\n\n\twpm.loadFacebookPixel = function () {\n\n\t\ttry {\n\t\t\tif (wpmDataLayer?.pixels?.facebook?.pixel_id) {\n\n\t\t\t\twpmDataLayer.pixels.facebook.loaded = true\n\n\t\t\t\t// @formatter:off\n \t\t\t!function(f,b,e,v,n,t,s)\n \t\t\t{if(f.fbq)return;n=f.fbq=function(){n.callMethod?\n \t\t\t\tn.callMethod.apply(n,arguments):n.queue.push(arguments)};\n \t\t\t\tif(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0';\n \t\t\t\tn.queue=[];t=b.createElement(e);t.async=!0;\n \t\t\t\tt.src=v;s=b.getElementsByTagName(e)[0];\n \t\t\t\ts.parentNode.insertBefore(t,s)}(window, document,'script',\n \t\t\t\t'https://connect.facebook.net/en_US/fbevents.js');\n \t\t\t// @formatter:on\n\n\t\t\t\tfbq(\"init\", wpmDataLayer.pixels.facebook.pixel_id)\n\t\t\t\tfbq(\"track\", \"PageView\")\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t}\n\t}\n\n\twpm.getRandomEventId = function () {\n\t\treturn (Math.random() + 1).toString(36).substring(2)\n\t}\n\n\twpm.getFbUserData = function () {\n\t\t// We need the first one for InitiateCheckout\n\t\t// where getting the user_data from the browser is too slow\n\t\t// using wpm.getCookie(), so we cache the user_data earlier.\n\t\t// And we need the second one because the ViewContent hit happens too fast\n\t\t// after adding a variation to the cart because the function to cache\n\t\t// the user_data is too slow. But we can get the user_data using wpm.getCookie()\n\t\t// because we don't move away from the page and can wait for the browser\n\t\t// to get it.\n\t\tif (fBUserData) {\n\t\t\treturn fBUserData\n\t\t} else {\n\t\t\treturn wpm.getFbUserDataFromBrowser()\n\t\t}\n\t}\n\n\twpm.setFbUserData = function () {\n\t\tfBUserData = wpm.getFbUserDataFromBrowser()\n\t}\n\n\twpm.getFbUserDataFromBrowser = function () {\n\t\treturn {\n\t\t\tfbp : wpm.getCookie(\"_fbp\"),\n\t\t\tfbc : wpm.getCookie(\"_fbc\"),\n\t\t\tclient_user_agent: navigator.userAgent,\n\t\t}\n\t}\n\n\twpm.fbViewContent = function (product) {\n\n\t\ttry {\n\t\t\tif (!wpmDataLayer?.pixels?.facebook?.loaded) return\n\n\t\t\tlet eventId = wpm.getRandomEventId()\n\n\t\t\tfbq(\"track\", \"ViewContent\", {\n\t\t\t\tcontent_type: \"product\",\n\t\t\t\tcontent_name: product.name,\n\t\t\t\t// content_category: product.category,\n\t\t\t\tcontent_ids: product.dyn_r_ids[wpmDataLayer.pixels.facebook.dynamic_remarketing.id_type],\n\t\t\t\tcurrency : wpmDataLayer.shop.currency,\n\t\t\t\tvalue : product.price,\n\t\t\t}, {\n\t\t\t\teventID: eventId,\n\t\t\t})\n\n\t\t\tproduct[\"currency\"] = wpmDataLayer.shop.currency\n\n\t\t\tjQuery(document).trigger(\"wpmFbCapiEvent\", {\n\t\t\t\tevent_name : \"ViewContent\",\n\t\t\t\tevent_id : eventId,\n\t\t\t\tuser_data : wpm.getFbUserData(),\n\t\t\t\tproduct_data : product,\n\t\t\t\tproduct_id : product.dyn_r_ids[wpmDataLayer.pixels.facebook.dynamic_remarketing.id_type],\n\t\t\t\tevent_source_url: window.location.href,\n\t\t\t})\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t}\n\t}\n\n\twpm.facebookContentIds = function () {\n\t\tlet prodIds = []\n\n\t\tfor (const [key, item] of Object.entries(wpmDataLayer.order.items)) {\n\n\t\t\tif (wpmDataLayer?.general?.variationsOutput && 0 !== item.variation_id) {\n\t\t\t\tprodIds.push(String(wpmDataLayer.products[item.variation_id].dyn_r_ids[wpmDataLayer.pixels.facebook.dynamic_remarketing.id_type]))\n\t\t\t} else {\n\t\t\t\tprodIds.push(String(wpmDataLayer.products[item.id].dyn_r_ids[wpmDataLayer.pixels.facebook.dynamic_remarketing.id_type]))\n\t\t\t}\n\t\t}\n\n\t\treturn prodIds\n\t}\n\n}(window.wpm = window.wpm || {}, jQuery));\n\n\n/**\n * Execute as soon as possible\n * */\n\n(function () {\n\n\tjQuery(document).on(\"wpmLoadPixels\", function () {\n\n\t\tif (wpm.canIFire(\"ads\", \"facebook-ads\") && !wpmDataLayer?.pixels?.facebook?.loaded) wpm.loadFacebookPixel()\n\n\t})\n\n})()\n\n\n/**\n * All event listeners\n * */\n\n// AddToCart event\njQuery(document).on(\"wpmAddToCart\", function (event, product) {\n\n\ttry {\n\t\tif (!wpmDataLayer?.pixels?.facebook?.loaded) return\n\n\t\tlet eventId = wpm.getRandomEventId()\n\n\t\t// console.log('eventId: ' + eventId);\n\n\t\tfbq(\"track\", \"AddToCart\", {\n\t\t\tcontent_type: \"product\",\n\t\t\tcontent_name: product.name,\n\t\t\tcontent_ids : product.dyn_r_ids[wpmDataLayer.pixels.facebook.dynamic_remarketing.id_type],\n\t\t\tvalue : parseFloat(product.quantity * product.price),\n\t\t\tcurrency : product.currency,\n\t\t}, {\n\t\t\teventID: eventId,\n\t\t})\n\n\n\t\tproduct[\"currency\"] = wpmDataLayer.shop.currency\n\n\t\tjQuery(document).trigger(\"wpmFbCapiEvent\", {\n\t\t\tevent_name : \"AddToCart\",\n\t\t\tevent_id : eventId,\n\t\t\tuser_data : wpm.getFbUserData(),\n\t\t\tproduct_data : product,\n\t\t\tproduct_id : product.dyn_r_ids[wpmDataLayer.pixels.facebook.dynamic_remarketing.id_type],\n\t\t\tevent_source_url: window.location.href,\n\t\t})\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n\n// InitiateCheckout event\njQuery(document).on(\"wpmBeginCheckout\", function (event) {\n\n\ttry {\n\t\t// console.log('firing facebook ads InitiateCheckout event');\n\n\t\tif (!wpmDataLayer?.pixels?.facebook?.loaded) return\n\n\t\tlet eventId = wpm.getRandomEventId()\n\n\t\tfbq(\"track\", \"InitiateCheckout\", {}, {\n\t\t\teventID: eventId,\n\t\t})\n\n\t\tjQuery(document).trigger(\"wpmFbCapiEvent\", {\n\t\t\tevent_name : \"InitiateCheckout\",\n\t\t\tevent_id : eventId,\n\t\t\tuser_data : wpm.getFbUserData(),\n\t\t\tevent_source_url: window.location.href,\n\t\t})\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n\n// AddToWishlist event\njQuery(document).on(\"wpmAddToWishlist\", function (event, product) {\n\n\ttry {\n\t\t// console.log('firing facebook ads AddToWishlist event');\n\t\t// console.log(product);\n\n\t\tif (!wpmDataLayer?.pixels?.facebook?.loaded) return\n\n\t\tlet eventId = wpm.getRandomEventId()\n\n\t\tfbq(\"track\", \"AddToWishlist\", {\n\t\t\tcontent_type: \"product\",\n\t\t\tcontent_name: product.name,\n\t\t\tcontent_ids : product.dyn_r_ids[wpmDataLayer.pixels.facebook.dynamic_remarketing.id_type],\n\t\t\tvalue : parseFloat(product.quantity * product.price),\n\t\t\tcurrency : product.currency,\n\t\t}, {\n\t\t\teventID: eventId,\n\t\t})\n\n\n\t\tproduct[\"currency\"] = wpmDataLayer.shop.currency\n\n\t\tjQuery(document).trigger(\"wpmFbCapiEvent\", {\n\t\t\tevent_name : \"AddToWishlist\",\n\t\t\tevent_id : eventId,\n\t\t\tuser_data : wpm.getFbUserData(),\n\t\t\tproduct_data : product,\n\t\t\tproduct_id : product.dyn_r_ids[wpmDataLayer.pixels.facebook.dynamic_remarketing.id_type],\n\t\t\tevent_source_url: window.location.href,\n\t\t})\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n\n// ViewContent event\njQuery(document).on(\"wpmViewItem\", function (event, product) {\n\n\ttry {\n\t\t// console.log('firing facebook ads ViewContent event');\n\t\t// console.log(product);\n\n\t\tif (!wpmDataLayer?.pixels?.facebook?.loaded) return\n\n\t\twpm.fbViewContent(product)\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n\n// view search event\njQuery(document).on(\"wpmSearch\", function () {\n\n\ttry {\n\t\tif (!wpmDataLayer?.pixels?.facebook?.loaded) return\n\n\t\tlet eventId = wpm.getRandomEventId()\n\n\t\tfbq(\"track\", \"Search\", {}, {\n\t\t\teventID: eventId,\n\t\t})\n\n\t\tjQuery(document).trigger(\"wpmFbCapiEvent\", {\n\t\t\tevent_name : \"Search\",\n\t\t\tevent_id : eventId,\n\t\t\tuser_data : wpm.getFbUserData(),\n\t\t\tevent_source_url: window.location.href,\n\t\t})\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n\n// load always event\njQuery(document).on(\"wpmLoadAlways\", function () {\n\n\ttry {\n\t\tif (!wpmDataLayer?.pixels?.facebook?.loaded) return\n\n\t\twpm.setFbUserData()\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n\n// view order received page event\n// https://developers.pinterest.com/docs/tag/conversion/\njQuery(document).on(\"wpmOrderReceivedPage\", function () {\n\n\ttry {\n\t\tif (!wpmDataLayer?.pixels?.facebook?.loaded) return\n\n\t\tfbq(\"track\", \"Purchase\",\n\t\t\t{\n\t\t\t\tcontent_type: \"product\",\n\t\t\t\tvalue : wpmDataLayer.order.value_filtered,\n\t\t\t\tcurrency : wpmDataLayer.order.currency,\n\t\t\t\tcontent_ids : wpm.facebookContentIds(),\n\t\t\t},\n\t\t\t{eventID: wpmDataLayer.order.id},\n\t\t)\n\n\n\t\t// console.log(wpm.facebookContentIds())\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n","/**\n * Add functions for Google Ads\n * */\n\n(function (wpm, $, undefined) {\n\n\tlet conversionIdentifiers = []\n\n\twpm.getGoogleAdsConversionIdentifiersWithLabel = function () {\n\t\tfor (const [key, item] of Object.entries(wpmDataLayer.pixels.google.ads.conversionIds)) {\n\t\t\tconversionIdentifiers.push(key + \"/\" + item)\n\t\t}\n\t\treturn conversionIdentifiers\n\t}\n\n\twpm.getGoogleAdsConversionIdentifiers = function () {\n\n\t\tlet conversionIdentifiers = []\n\t\tfor (const [key, item] of Object.entries(wpmDataLayer.pixels.google.ads.conversionIds)) {\n\t\t\tconversionIdentifiers.push(key)\n\t\t}\n\n\t\treturn conversionIdentifiers\n\t}\n\n\twpm.getGoogleAdsRegularOrderItems = function () {\n\t\t// \"id\" : \"gla_34\",\n\t\t// \"quantity\": 1,\n\t\t// \"price\" : 45\n\n\t\tlet orderItems = []\n\n\t\tfor (const [key, item] of Object.entries(wpmDataLayer.order.items)) {\n\n\t\t\tlet orderItem\n\n\t\t\torderItem = {\n\t\t\t\tquantity: item.quantity,\n\t\t\t\tprice : item.price,\n\t\t\t}\n\n\t\t\tif (wpmDataLayer?.general?.variationsOutput && 0 !== item.variation_id) {\n\n\t\t\t\torderItem.id = String(wpmDataLayer.products[item.variation_id].dyn_r_ids[wpmDataLayer.pixels.google.ads.dynamic_remarketing.id_type])\n\t\t\t\torderItems.push(orderItem)\n\t\t\t} else {\n\n\t\t\t\torderItem.id = String(wpmDataLayer.products[item.id].dyn_r_ids[wpmDataLayer.pixels.google.ads.dynamic_remarketing.id_type])\n\t\t\t\torderItems.push(orderItem)\n\t\t\t}\n\t\t}\n\n\t\treturn orderItems\n\t}\n\n\twpm.getGoogleAdsDynamicRemarketingOrderItems = function () {\n\t\t// \"id\" : \"gla_34\",\n\t\t// \"quantity\" : 1,\n\t\t// \"price\" : 45,\n\t\t// \"google_business_vertical\": \"retail\"\n\n\t\tlet orderItems = []\n\n\t\tfor (const [key, item] of Object.entries(wpmDataLayer.order.items)) {\n\n\t\t\tlet orderItem\n\n\t\t\torderItem = {\n\t\t\t\tquantity : item.quantity,\n\t\t\t\tprice : item.price,\n\t\t\t\tgoogle_business_vertical: wpmDataLayer.pixels.google.ads.google_business_vertical,\n\t\t\t}\n\n\t\t\tif (wpmDataLayer?.general?.variationsOutput && 0 !== item.variation_id) {\n\n\t\t\t\torderItem.id = String(wpmDataLayer.products[item.variation_id].dyn_r_ids[wpmDataLayer.pixels.google.ads.dynamic_remarketing.id_type])\n\t\t\t\torderItems.push(orderItem)\n\t\t\t} else {\n\n\t\t\t\torderItem.id = String(wpmDataLayer.products[item.id].dyn_r_ids[wpmDataLayer.pixels.google.ads.dynamic_remarketing.id_type])\n\t\t\t\torderItems.push(orderItem)\n\t\t\t}\n\t\t}\n\n\t\treturn orderItems\n\t}\n\n}(window.wpm = window.wpm || {}, jQuery))\n\n\n/**\n * All event listeners\n * */\n\n// view_item_list event\njQuery(document).on(\"wpmViewItemList\", function (event, product) {\n\n\ttry {\n\t\tif(jQuery.isEmptyObject(wpmDataLayer?.pixels?.google?.ads?.conversionIds)) return\n\t\tif (!wpmDataLayer?.pixels?.google?.ads?.dynamic_remarketing?.status) return\n\t\tif (!wpm.googleConfigConditionsMet(\"ads\")) return\n\n\n\t\tif (\n\t\t\twpmDataLayer?.general?.variationsOutput &&\n\t\t\tproduct.isVariable &&\n\t\t\twpmDataLayer.pixels.google.ads.dynamic_remarketing.send_events_with_parent_ids === false\n\t\t) return\n\n\t\t// try to prevent that WC sends cached hits to Google\n\t\tif (!product) return\n\n\t\twpm.gtagLoaded().then(function () {\n\t\t gtag(\"event\", \"view_item_list\", {\n \t\t\tsend_to: wpm.getGoogleAdsConversionIdentifiers(),\n \t\t\titems : [{\n \t\t\t\tid : product.dyn_r_ids[wpmDataLayer.pixels.google.ads.dynamic_remarketing.id_type],\n \t\t\t\tgoogle_business_vertical: wpmDataLayer.pixels.google.ads.google_business_vertical,\n \t\t\t}],\n \t\t})\n\t\t})\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n\n// add_to_cart event\njQuery(document).on(\"wpmAddToCart\", function (event, product) {\n\n\ttry {\n\t\tif(jQuery.isEmptyObject(wpmDataLayer?.pixels?.google?.ads?.conversionIds)) return\n\t\tif (!wpmDataLayer?.pixels?.google?.ads?.dynamic_remarketing?.status) return\n\t\tif (!wpm.googleConfigConditionsMet(\"ads\")) return\n\n\t\twpm.gtagLoaded().then(function () {\n\t\t gtag(\"event\", \"add_to_cart\", {\n \t\t\tsend_to: wpm.getGoogleAdsConversionIdentifiers(),\n \t\t\tvalue : product.quantity * product.price,\n \t\t\titems : [{\n \t\t\t\tid : product.dyn_r_ids[wpmDataLayer.pixels.google.ads.dynamic_remarketing.id_type],\n \t\t\t\tquantity : product.quantity,\n \t\t\t\tprice : product.price,\n \t\t\t\tgoogle_business_vertical: wpmDataLayer.pixels.google.ads.google_business_vertical,\n \t\t\t}],\n \t\t})\n\t\t})\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n\n// view_item event\njQuery(document).on(\"wpmViewItem\", function (event, product) {\n\n\ttry {\n\t\tif(jQuery.isEmptyObject(wpmDataLayer?.pixels?.google?.ads?.conversionIds)) return\n\t\tif (!wpmDataLayer?.pixels?.google?.ads?.dynamic_remarketing?.status) return\n\t\tif (!wpm.googleConfigConditionsMet(\"ads\")) return\n\n\n\t\twpm.gtagLoaded().then(function () {\n\t\t gtag(\"event\", \"view_item\", {\n \t\t\tsend_to: wpm.getGoogleAdsConversionIdentifiers(),\n \t\t\tvalue : (product.quantity ? product.quantity : 1) * product.price,\n \t\t\titems : [{\n \t\t\t\tid : product.dyn_r_ids[wpmDataLayer.pixels.google.ads.dynamic_remarketing.id_type],\n \t\t\t\tquantity : (product.quantity ? product.quantity : 1),\n \t\t\t\tprice : product.price,\n \t\t\t\tgoogle_business_vertical: wpmDataLayer.pixels.google.ads.google_business_vertical,\n \t\t\t}],\n \t\t})\n\t\t})\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n\n\n// view search event\njQuery(document).on(\"wpmSearch\", function () {\n\n\ttry {\n\t\tif(jQuery.isEmptyObject(wpmDataLayer?.pixels?.google?.ads?.conversionIds)) return\n\t\tif (!wpmDataLayer?.pixels?.google?.ads?.dynamic_remarketing?.status) return\n\t\tif (!wpm.googleConfigConditionsMet(\"ads\")) return\n\n\n\t\tlet products = []\n\n\t\tfor (const [key, product] of Object.entries(wpmDataLayer.products)) {\n\n\t\t\tif (\n\t\t\t\twpmDataLayer?.general?.variationsOutput &&\n\t\t\t\tproduct.isVariable &&\n\t\t\t\twpmDataLayer.pixels.google.ads.dynamic_remarketing.send_events_with_parent_ids === false\n\t\t\t) return\n\n\t\t\tproducts.push({\n\t\t\t\tid : product.dyn_r_ids[wpmDataLayer.pixels.google.ads.dynamic_remarketing.id_type],\n\t\t\t\tgoogle_business_vertical: wpmDataLayer.pixels.google.ads.google_business_vertical,\n\t\t\t})\n\t\t}\n\n\t\t// console.log(products);\n\n\t\twpm.gtagLoaded().then(function () {\n\t\t\tgtag(\"event\", \"view_search_results\", {\n \t\t\tsend_to: wpm.getGoogleAdsConversionIdentifiers(),\n \t\t\t// value : 1 * product.price,\n \t\t\titems: products,\n \t\t})\n\t\t})\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n\n\n// view order received page event\n// TODO distinguish with or without cart data active\njQuery(document).on(\"wpmOrderReceivedPage\", function () {\n\n\ttry {\n\t\tif(jQuery.isEmptyObject(wpmDataLayer?.pixels?.google?.ads?.conversionIds)) return\n\t\tif (!wpmDataLayer?.pixels?.google?.ads?.dynamic_remarketing?.status) return\n\t\tif (!wpm.googleConfigConditionsMet(\"ads\")) return\n\n\t\twpm.gtagLoaded().then(function () {\n\t\t gtag(\"event\", \"purchase\", {\n \t\t\tsend_to: wpm.getGoogleAdsConversionIdentifiers(),\n \t\t\tvalue : wpmDataLayer.order.value_filtered,\n \t\t\titems : wpm.getGoogleAdsDynamicRemarketingOrderItems(),\n \t\t})\n\t\t})\n\n\t\t// console.log(wpm.getGoogleAdsDynamicRemarketingOrderItems())\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n\n// user log in event\njQuery(document).on(\"wpmLogin\", function () {\n\n\ttry {\n\t\tif(jQuery.isEmptyObject(wpmDataLayer?.pixels?.google?.ads?.conversionIds)) return\n\t\tif (!wpmDataLayer?.pixels?.google?.ads?.dynamic_remarketing?.status) return\n\t\tif (!wpm.googleConfigConditionsMet(\"ads\")) return\n\n\n\t\twpm.gtagLoaded().then(function () {\n\t\t gtag(\"event\", \"login\", {\n \t\t\tsend_to: wpm.getGoogleAdsConversionIdentifiers(),\n \t\t})\n\t\t})\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n\n// view order received page event\n// new_customer parameter: https://support.google.com/google-ads/answer/9917012\njQuery(document).on(\"wpmOrderReceivedPage\", function () {\n\n\ttry {\n\t\tif(jQuery.isEmptyObject(wpmDataLayer?.pixels?.google?.ads?.conversionIds)) return\n\t\tif (!wpm.googleConfigConditionsMet(\"ads\")) return\n\n\t\tlet data_basic = {}\n\t\tlet data_with_cart = {}\n\n\t\tdata_basic = {\n\t\t\tsend_to : wpm.getGoogleAdsConversionIdentifiersWithLabel(),\n\t\t\ttransaction_id: wpmDataLayer.order.number,\n\t\t\tvalue : wpmDataLayer.order.value_filtered,\n\t\t\tcurrency : wpmDataLayer.order.currency,\n\t\t\tnew_customer : wpmDataLayer.order.new_customer,\n\t\t}\n\n\t\tif (wpmDataLayer?.order?.aw_merchant_id) {\n\t\t\tdata_with_cart = {\n\t\t\t\tdiscount : wpmDataLayer.order.discount,\n\t\t\t\taw_merchant_id : wpmDataLayer.order.aw_merchant_id,\n\t\t\t\taw_feed_country : wpmDataLayer.order.aw_feed_country,\n\t\t\t\taw_feed_language: wpmDataLayer.order.aw_feed_language,\n\t\t\t\titems : wpm.getGoogleAdsRegularOrderItems(),\n\t\t\t}\n\t\t}\n\n\t\twpm.gtagLoaded().then(function () {\n\t\t\tgtag(\"event\", \"conversion\", {...data_basic, ...data_with_cart})\n\t\t})\n\n\t\t// console.log({...data_basic,...data_with_cart})\n\n\t\t// console.log(wpm.getGoogleAdsOrderItems())\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n\n\n\n\n\n","/**\n * Add functions for Google Analytics 4\n * */\n\n(function (wpm, $, undefined) {\n\n\twpm.getGA4OrderItems = function () {\n\n\t\t// \"item_id\" : \"34\",\n\t\t// \"item_name\" : \"Hoodie\",\n\t\t// \"quantity\" : 1,\n\t\t// \"item_brand\" : \"\",\n\t\t// \"item_variant\" : \"Color: blue | Logo: yes\",\n\t\t// \"price\" : 45,\n\t\t// \"currency\" : \"CHF\",\n\t\t// \"item_category\": \"Hoodies\"\n\n\n\t\tlet orderItems = []\n\n\t\tfor (const [key, item] of Object.entries(wpmDataLayer.order.items)) {\n\n\t\t\tlet orderItem\n\n\t\t\torderItem = {\n\t\t\t\tquantity : item.quantity,\n\t\t\t\tprice : item.price,\n\t\t\t\titem_name : item.name,\n\t\t\t\tcurrency : wpmDataLayer.order.currency,\n\t\t\t\titem_category: wpmDataLayer.products[item.id].category.join(\"/\"),\n\t\t\t}\n\n\t\t\tif (wpmDataLayer?.general?.variationsOutput && 0 !== item.variation_id) {\n\n\t\t\t\torderItem.item_id = String(wpmDataLayer.products[item.variation_id].dyn_r_ids[wpmDataLayer.pixels.google.analytics.id_type])\n\t\t\t\torderItem.item_variant = wpmDataLayer.products[item.variation_id].variant_name\n\t\t\t\torderItem.item_brand = wpmDataLayer.products[item.variation_id].brand\n\t\t\t} else {\n\n\t\t\t\torderItem.item_id = String(wpmDataLayer.products[item.id].dyn_r_ids[wpmDataLayer.pixels.google.analytics.id_type])\n\t\t\t\torderItem.item_brand = wpmDataLayer.products[item.id].brand\n\t\t\t}\n\n\t\t\torderItems.push(orderItem)\n\t\t}\n\n\t\treturn orderItems\n\t}\n\n}(window.wpm = window.wpm || {}, jQuery))\n\n\n/**\n * All event listeners\n * */\n\n\n// view order received page event\njQuery(document).on(\"wpmOrderReceivedPage\", function () {\n\n\ttry {\n\t\tif (!wpmDataLayer?.pixels?.google?.analytics?.ga4?.measurement_id) return\n\t\tif (wpmDataLayer?.pixels?.google?.analytics?.ga4?.mp_active) return\n\t\tif (!wpm.googleConfigConditionsMet(\"analytics\")) return\n\n\t\twpm.gtagLoaded().then(function () {\n\t\t\tgtag(\"event\", \"purchase\", {\n\t\t\t\tsend_to : [wpmDataLayer.pixels.google.analytics.ga4.measurement_id],\n\t\t\t\ttransaction_id: wpmDataLayer.order.number,\n\t\t\t\taffiliation : wpmDataLayer.order.affiliation,\n\t\t\t\tcurrency : wpmDataLayer.order.currency,\n\t\t\t\tvalue : wpmDataLayer.order.value_regular,\n\t\t\t\tdiscount : wpmDataLayer.order.discount,\n\t\t\t\ttax : wpmDataLayer.order.tax,\n\t\t\t\tshipping : wpmDataLayer.order.shipping,\n\t\t\t\tcoupon : wpmDataLayer.order.coupon,\n\t\t\t\titems : wpm.getGA4OrderItems(),\n\t\t\t})\n\t\t})\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n","/**\n * Add functions for Google Analytics Universal\n * */\n\n(function (wpm, $, undefined) {\n\n\twpm.getGAUAOrderItems = function () {\n\n\t\t// \"id\" : \"34\",\n\t\t// \"name\" : \"Hoodie\",\n\t\t// \"brand\" : \"\",\n\t\t// \"category\" : \"Hoodies\",\n\t\t// \"list_position\": 1,\n\t\t// \"price\" : 45,\n\t\t// \"quantity\" : 1,\n\t\t// \"variant\" : \"Color: blue | Logo: yes\"\n\n\n\t\tlet orderItems = [],\n\t\t\tlist_position = 1\n\n\t\tfor (const [key, item] of Object.entries(wpmDataLayer.order.items)) {\n\n\t\t\tlet orderItem\n\n\t\t\torderItem = {\n\t\t\t\tquantity : item.quantity,\n\t\t\t\tprice : item.price,\n\t\t\t\tname : item.name,\n\t\t\t\tcurrency : wpmDataLayer.order.currency,\n\t\t\t\tcategory : wpmDataLayer.products[item.id].category.join(\"/\"),\n\t\t\t\tlist_position: list_position,\n\t\t\t}\n\n\t\t\tif (wpmDataLayer?.general?.variationsOutput && 0 !== item.variation_id) {\n\n\t\t\t\torderItem.id = String(wpmDataLayer.products[item.variation_id].dyn_r_ids[wpmDataLayer.pixels.google.analytics.id_type])\n\t\t\t\torderItem.variant = wpmDataLayer.products[item.variation_id].variant_name\n\t\t\t\torderItem.brand = wpmDataLayer.products[item.variation_id].brand\n\t\t\t} else {\n\n\t\t\t\torderItem.id = String(wpmDataLayer.products[item.id].dyn_r_ids[wpmDataLayer.pixels.google.analytics.id_type])\n\t\t\t\torderItem.brand = wpmDataLayer.products[item.id].brand\n\t\t\t}\n\n\t\t\torderItems.push(orderItem)\n\t\t\tlist_position++\n\t\t}\n\n\t\treturn orderItems\n\t}\n\n}(window.wpm = window.wpm || {}, jQuery))\n\n\n/**\n * All event listeners\n * */\n\n\n// view order received page event\njQuery(document).on(\"wpmOrderReceivedPage\", function () {\n\n\ttry {\n\t\tif (!wpmDataLayer?.pixels?.google?.analytics?.universal?.property_id) return\n\t\tif (wpmDataLayer?.pixels?.google?.analytics?.universal?.mp_active) return\n\t\tif (!wpm.googleConfigConditionsMet(\"analytics\")) return\n\n\t\twpm.gtagLoaded().then(function () {\n\t\t\tgtag(\"event\", \"purchase\", {\n\t\t\t\tsend_to : [wpmDataLayer.pixels.google.analytics.universal.property_id],\n\t\t\t\ttransaction_id: wpmDataLayer.order.number,\n\t\t\t\taffiliation : wpmDataLayer.order.affiliation,\n\t\t\t\tcurrency : wpmDataLayer.order.currency,\n\t\t\t\tvalue : wpmDataLayer.order.value_regular,\n\t\t\t\tdiscount : wpmDataLayer.order.discount,\n\t\t\t\ttax : wpmDataLayer.order.tax,\n\t\t\t\tshipping : wpmDataLayer.order.shipping,\n\t\t\t\tcoupon : wpmDataLayer.order.coupon,\n\t\t\t\titems : wpm.getGAUAOrderItems(),\n\t\t\t})\n\t\t})\n\n\t\t// console.log(wpm.getGAUAOrderItems())\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n","(function (wpm, $, undefined) {\n\n\twpm.load_google_optimize_pixel = function () {\n\n\t\ttry {\n\t\t\tif (wpmDataLayer?.pixels?.google?.optimize?.container_id) {\n\n\t\t\t\twpmDataLayer.pixels.google.optimize.loaded = true\n\n\t\t\t\twpm.loadScriptAndCacheIt(\"https://www.googleoptimize.com/optimize.js?id=\" + wpmDataLayer.pixels.google.optimize.container_id)\n\t\t\t\t// .done(function (script, textStatus) {\n\t\t\t\t// \t\tconsole.log('Google Optimize loaded')\n\t\t\t\t// });\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t}\n\t}\n\n}(window.wpm = window.wpm || {}, jQuery));\n\n\n(function () {\n\n\tjQuery(document).on(\"wpmLoadPixels\", function () {\n\n\t\tif (wpm.canIFire(\"analytics\", \"google-optimize\") && !wpmDataLayer?.pixels?.google?.optimize?.loaded) wpm.load_google_optimize_pixel()\n\n\t})\n\n})()\n\n\n\n","/**\n * Add functions for Google\n * */\n\n(function (wpm, $, undefined) {\n\n\twpm.googleConfigConditionsMet = function (type) {\n\t\t// always returns true if Google Consent Mode is active\n\t\tif (wpmDataLayer?.pixels?.google?.consent_mode?.active) {\n\t\t\treturn true\n\t\t} else if (wpm.getConsentValues().mode === \"category\") {\n\t\t\treturn wpm.getConsentValues().categories[type] === true\n\t\t} else if (wpm.getConsentValues().mode === \"pixel\") {\n\t\t\treturn wpm.getConsentValues().pixels.includes(\"google-\" + type)\n\t\t} else {\n\t\t\treturn false\n\t\t}\n\t}\n\n\twpm.getVisitorConsentStatusAndUpdateGoogleConsentSettings = function (google_consent_settings) {\n\n\t\tif (wpm.getConsentValues().mode === \"category\") {\n\t\t\tif (wpm.getConsentValues().categories.analytics) google_consent_settings.analytics_storage = \"granted\"\n\t\t\tif (wpm.getConsentValues().categories.ads) google_consent_settings.ad_storage = \"granted\"\n\t\t} else if ((wpm.getConsentValues().mode === \"pixel\")) {\n\t\t\tgoogle_consent_settings.analytics_storage = wpm.getConsentValues().pixels.includes(\"google-analytics\") ? \"granted\" : \"denied\"\n\t\t\tgoogle_consent_settings.ad_storage = wpm.getConsentValues().pixels.includes(\"google-ads\") ? \"granted\" : \"denied\"\n\t\t}\n\n\t\treturn google_consent_settings\n\t}\n\n\twpm.updateGoogleConsentMode = function (analytics = true, ads = true) {\n\n\t\ttry {\n\t\t\tif (\n\t\t\t\t!window.gtag ||\n\t\t\t\t!wpmDataLayer.shop.cookie_consent_mgmt.explicit_consent\n\t\t\t) return\n\n\t\t\tgtag(\"consent\", \"update\", {\n\t\t\t\tanalytics_storage: analytics ? \"granted\" : \"denied\",\n\t\t\t\tad_storage : ads ? \"granted\" : \"denied\",\n\t\t\t})\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t}\n\t}\n\n\twpm.fireGtagGoogleAds = function () {\n\t\ttry {\n\t\t\twpmDataLayer.pixels.google.ads.state = \"loading\"\n\n\t\t\tif (wpmDataLayer?.pixels?.google?.ads?.enhanced_conversions?.active) {\n\t\t\t\tfor (const [key, item] of Object.entries(wpmDataLayer.pixels.google.ads.conversionIds)) {\n\t\t\t\t\tgtag(\"config\", key, {\"allow_enhanced_conversions\": true})\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tfor (const [key, item] of Object.entries(wpmDataLayer.pixels.google.ads.conversionIds)) {\n\t\t\t\t\tgtag(\"config\", key)\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (wpmDataLayer?.pixels?.google?.ads?.conversionIds && wpmDataLayer?.pixels?.google?.ads?.phone_conversion_label && wpmDataLayer?.pixels?.google?.ads?.phone_conversion_number) {\n\t\t\t\tgtag(\"config\", Object.keys(wpmDataLayer.pixels.google.ads.conversionIds)[0] + \"/\" + wpmDataLayer.pixels.google.ads.phone_conversion_label, {\n\t\t\t\t\tphone_conversion_number: wpmDataLayer.pixels.google.ads.phone_conversion_number,\n\t\t\t\t})\n\t\t\t}\n\n\t\t\t// ! enhanced_conversion_data needs to be var\n\t\t\t// https://support.google.com/google-ads/answer/9888145#zippy=%2Cvalidate-your-implementation-using-chrome-developer-tools\n\t\t\tif (\"order_received_page\" === wpmDataLayer.shop.page_type && wpmDataLayer?.order?.google?.ads?.enhanced_conversion_data) {\n\t\t\t\twindow.enhanced_conversion_data = wpmDataLayer.order.google.ads.enhanced_conversion_data\n\t\t\t}\n\n\t\t\twpmDataLayer.pixels.google.ads.state = \"ready\"\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t}\n\t}\n\n\twpm.fireGtagGoogleAnalyticsUA = function () {\n\t\ttry {\n\t\t\twpmDataLayer.pixels.google.analytics.universal.state = \"loading\"\n\n\t\t\tgtag(\"config\", wpmDataLayer.pixels.google.analytics.universal.property_id, wpmDataLayer.pixels.google.analytics.universal.parameters)\n\t\t\twpmDataLayer.pixels.google.analytics.universal.state = \"ready\"\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t}\n\t}\n\n\twpm.fireGtagGoogleAnalyticsGA4 = function () {\n\t\ttry {\n\t\t\twpmDataLayer.pixels.google.analytics.ga4.state = \"loading\"\n\n\t\t\tgtag(\"config\", wpmDataLayer.pixels.google.analytics.ga4.measurement_id, wpmDataLayer.pixels.google.analytics.ga4.parameters)\n\t\t\twpmDataLayer.pixels.google.analytics.ga4.state = \"ready\"\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t}\n\t}\n\n\twpm.isGoogleActive = function () {\n\t\tif (\n\t\t\twpmDataLayer?.pixels?.google?.analytics?.universal?.property_id ||\n\t\t\twpmDataLayer?.pixels?.google?.analytics?.ga4?.measurement_id ||\n\t\t\t!jQuery.isEmptyObject(wpmDataLayer?.pixels?.google?.ads?.conversionIds)\n\t\t) {\n\t\t\treturn true\n\t\t} else {\n\t\t\treturn false\n\t\t}\n\t}\n\n\twpm.getGoogleGtagId = function () {\n\t\tif (wpmDataLayer?.pixels?.google?.analytics?.universal?.property_id) {\n\t\t\treturn wpmDataLayer.pixels.google.analytics.universal.property_id\n\t\t} else if (wpmDataLayer?.pixels?.google?.analytics?.ga4?.measurement_id) {\n\t\t\treturn wpmDataLayer.pixels.google.analytics.ga4.measurement_id\n\t\t} else {\n\t\t\treturn Object.keys(wpmDataLayer.pixels.google.ads.conversionIds)[0]\n\t\t}\n\t}\n\n\twpm.loadGoogle = function () {\n\n\t\tif (wpm.isGoogleActive()) {\n\n\t\t\twpmDataLayer.pixels.google.state = \"loading\"\n\n\t\t\twpm.loadScriptAndCacheIt(\"https://www.googletagmanager.com/gtag/js?id=\" + wpm.getGoogleGtagId())\n\t\t\t\t.done(function (script, textStatus) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\t// console.log('Google Optimize loaded')\n\t\t\t\t\t\t// alert('Google Optimize loaded')\n\n\t\t\t\t\t\t// Initiate Google dataLayer and gtag\n\t\t\t\t\t\twindow.dataLayer = window.dataLayer || []\n\t\t\t\t\t\twindow.gtag = function gtag() {\n\t\t\t\t\t\t\tdataLayer.push(arguments)\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Google Consent Mode\n\t\t\t\t\t\tif (wpmDataLayer?.pixels?.google?.consent_mode?.active) {\n\n\t\t\t\t\t\t\tlet google_consent_settings = {\n\t\t\t\t\t\t\t\t\"ad_storage\" : wpmDataLayer.pixels.google.consent_mode.ad_storage,\n\t\t\t\t\t\t\t\t\"analytics_storage\": wpmDataLayer.pixels.google.consent_mode.analytics_storage,\n\t\t\t\t\t\t\t\t\"wait_for_update\" : wpmDataLayer.pixels.google.consent_mode.wait_for_update,\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (wpmDataLayer?.pixels?.google?.consent_mode?.region) {\n\t\t\t\t\t\t\t\tgoogle_consent_settings.region = wpmDataLayer.pixels.google.consent_mode.region\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tgoogle_consent_settings = wpm.getVisitorConsentStatusAndUpdateGoogleConsentSettings(google_consent_settings)\n\n\t\t\t\t\t\t\tgtag(\"consent\", \"default\", google_consent_settings)\n\t\t\t\t\t\t\tgtag(\"set\", \"ads_data_redaction\", wpmDataLayer.pixels.google.consent_mode.ads_data_redaction)\n\t\t\t\t\t\t\tgtag(\"set\", \"url_passthrough\", wpmDataLayer.pixels.google.consent_mode.url_passthrough)\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Google Linker\n\t\t\t\t\t\t// https://developers.google.com/gtagjs/devguide/linker\n\t\t\t\t\t\tif (wpmDataLayer?.pixels?.google?.linker?.settings) {\n\t\t\t\t\t\t\tgtag(\"set\", \"linker\", wpmDataLayer.pixels.google.linker.settings)\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tgtag(\"js\", new Date())\n\n\t\t\t\t\t\tif (wpm.googleConfigConditionsMet(\"ads\") && !jQuery.isEmptyObject(wpmDataLayer?.pixels?.google?.ads?.conversionIds)) wpm.fireGtagGoogleAds()\n\t\t\t\t\t\tif (wpm.googleConfigConditionsMet(\"analytics\") && wpmDataLayer?.pixels?.google?.analytics?.universal?.property_id) wpm.fireGtagGoogleAnalyticsUA()\n\t\t\t\t\t\tif (wpm.googleConfigConditionsMet(\"analytics\") && wpmDataLayer?.pixels?.google?.analytics?.ga4?.measurement_id) wpm.fireGtagGoogleAnalyticsGA4()\n\n\t\t\t\t\t\twpmDataLayer.pixels.google.state = \"ready\"\n\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\tconsole.error(e)\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t}\n\t}\n\n\twpm.canGoogleLoad = function () {\n\n\t\tif (wpmDataLayer?.pixels?.google?.consent_mode?.active) {\n\t\t\treturn true\n\t\t} else if (\"category\" === wpm.getConsentValues().mode) {\n\t\t\treturn !!(wpm.getConsentValues().categories[\"ads\"] || wpm.getConsentValues().categories[\"analytics\"])\n\t\t} else if (\"pixel\" === wpm.getConsentValues().mode) {\n\t\t\treturn wpm.getConsentValues().pixels.includes(\"google-ads\") || wpm.getConsentValues().pixels.includes(\"google-analytics\")\n\t\t} else {\n\t\t\tconsole.error(\"Couldn't find a valid load condition for Google mode in wpmConsentValues\")\n\t\t\treturn false\n\t\t}\n\t}\n\n\twpm.gtagLoaded = function () {\n\t\treturn new Promise(function (resolve, reject) {\n\n\t\t\tif (typeof wpmDataLayer?.pixels?.google?.state === \"undefined\") reject()\n\n\t\t\tlet startTime = 0\n\t\t\tlet timeout = 5000\n\t\t\tlet frequency = 200;\n\n\t\t\t(function wait() {\n\t\t\t\tif (wpmDataLayer?.pixels?.google?.state === \"ready\") return resolve()\n\t\t\t\tif (startTime >= timeout) return reject()\n\t\t\t\tstartTime += frequency\n\t\t\t\tsetTimeout(wait, frequency)\n\t\t\t})()\n\t\t})\n\t}\n\n\t// wpm.gtagLoadednew = function () {\n\t// \treturn Promise.race([\n\t// \t\t\tnew Promise(function (resolve, reject) {\n\t//\n\t// \t\t\t\tif (typeof wpmDataLayer?.pixels?.google?.state === \"undefined\") reject();\n\t//\n\t//\n\t// \t\t\t\t(function wait() {\n\t// \t\t\t\t\tif (wpmDataLayer?.pixels?.google?.state === \"ready\") return resolve()\n\t// \t\t\t\t\tif (to >= 1000) return reject()\n\t// \t\t\t\t\tsetTimeout(wait, 100)\n\t// \t\t\t\t})()\n\t// \t\t\t}),\n\t// \t\t\tnew Promise(function (resolve, reject) {\n\t// \t\t\t\tsetTimeout(() => reject(), 1000)\n\t// \t\t\t}),\n\t// \t\t],\n\t// \t)\n\t// \t\t// .then((value) => {console.log(\"race then value: \" + value)})\n\t// \t\t.catch(\n\t// \t\t\t(value) => {\n\t// \t\t\t\tconsole.log(\"race catch value: \" + value)\n\t// \t\t\t\treturn Promise.reject()\n\t// \t\t\t})\n\t// }\n\n\n\t// const promise1 = new Promise((resolve, reject) => {\n\t// \tsetTimeout(resolve, 500, \"one\")\n\t// })\n\t//\n\t// const promise2 = new Promise((resolve, reject) => {\n\t// \tsetTimeout(reject, 100, \"two\")\n\t// })\n\t//\n\t// let onlyRunIfResolves = function () {\n\t// \treturn Promise.race([promise1, promise2])\n\t// \t\t.catch(() => {\n\t// \t\t})\n\t// }\n\t//\n\t// onlyRunIfResolves()\n\t// \t.then(() => {\n\t// \t\tconsole.log(\"running function\")\n\t// \t})\n\n\n}(window.wpm = window.wpm || {}, jQuery));\n\n\n(function () {\n\n\tjQuery(document).on(\"wpmLoadPixels\", function () {\n\n\t\tif (\n\t\t\twpm.canGoogleLoad() &&\n\t\t\t(typeof wpmDataLayer?.pixels?.google?.state === \"undefined\")\n\t\t) {\n\t\t\twpm.loadGoogle()\n\t\t}\n\t})\n\n\t// return wpmDataLayer?.pixels?.google?.state === \"undefined\";\n\n})()\n","(function (wpm, $, undefined) {\n\n\twpm.load_hotjar_pixel = function () {\n\n\t\tif (wpmDataLayer?.pixels?.hotjar?.site_id) {\n\n\t\t\t// console.log('hotjar loaded');\n\n\t\t\twpmDataLayer.pixels.hotjar.loaded = true;\n\n\t\t\t// @formatter:off\n\t\t\t(function(h,o,t,j,a,r){\n\t\t\t\th.hj=h.hj||function(){(h.hj.q=h.hj.q||[]).push(arguments)};\n\t\t\t\th._hjSettings={hjid:wpmDataLayer.pixels.hotjar.site_id,hjsv:6};\n\t\t\t\ta=o.getElementsByTagName('head')[0];\n\t\t\t\tr=o.createElement('script');r.async=1;\n\t\t\t\tr.src=t+h._hjSettings.hjid+j+h._hjSettings.hjsv;\n\t\t\t\ta.appendChild(r);\n\t\t\t})(window,document,'https://static.hotjar.com/c/hotjar-','.js?sv=');\n\t\t\t// @formatter:on\n\n\t\t}\n\t}\n\n}(window.wpm = window.wpm || {}, jQuery));\n\n\n(function () {\n\n\tjQuery(document).on(\"wpmLoadPixels\", function () {\n\n\t\tif (wpm.canIFire(\"analytics\", \"hotjar\") && !wpmDataLayer?.pixels?.hotjar?.loaded) wpm.load_hotjar_pixel()\n\n\t})\n\n})()\n\n\n\n","/**\n * After wpm is loaded\n * we first check if wpmDataLayer is loaded,\n * and as soon as it is, we load the pixels,\n * and as soon as the page load is complete,\n * we fire the wpmLoad event.\n */\nwpm.wpmDataLayerExists()\n\t.then(function () {\n\t\tjQuery(document).trigger(\"wpmPreLoadPixels\", {})\n\t})\n\t.then(function () {\n\t\twpm.pageLoaded().then(function () {\n\t\t\tjQuery(document).trigger(\"wpmLoad\", {})\n\t\t})\n\t})\n\n","/**\n * Create a wpm namespace under which all functions are declared\n */\n\n// https://stackoverflow.com/a/5947280/4688612\n(function (wpm, $, undefined) {\n\n\tconst wpmDeduper = {\n\t\tkeyName : \"_wpm_order_ids\",\n\t\tcookieExpiresDays: 365,\n\t}\n\n\tconst wpmRestSettings = {\n\t\t// cookiesAvailable : '_wpm_cookies_are_available',\n\t\tcookieWpmRestEndpointAvailable: \"_wpm_endpoint_available\",\n\t\trestEndpoint : \"/wp-json/\",\n\t\trestFails : 0,\n\t\trestFailsThreshold : 10,\n\t}\n\n\twpm.emailSelected = false\n\twpm.paymentMethodSelected = false\n\n\t// wpm.checkIfCookiesAvailable = function () {\n\t//\n\t// // read the cookie if previously set, if it is return true, otherwise continue\n\t// if (wpm.getCookie(wpmRestSettings.cookiesAvailable)) {\n\t// return true;\n\t// }\n\t//\n\t// // set the cookie for the session\n\t// Cookies.set(wpmRestSettings.cookiesAvailable, true);\n\t//\n\t// // read cookie, true if ok, false if not ok\n\t// return !!wpm.getCookie(wpmRestSettings.cookiesAvailable);\n\t// }\n\n\twpm.useRestEndpoint = function () {\n\n\t\t// only if sessionStorage is available\n\n\t\t// only if REST API endpoint is generally accessible\n\t\t// check in sessionStorage if we checked before and return answer\n\t\t// otherwise check if the endpoint is available, save answer in sessionStorage and return answer\n\n\t\t// only if not too many REST API errors happened\n\n\t\treturn wpm.isSessionStorageAvailable() &&\n\t\t\twpm.isRestEndpointAvailable() &&\n\t\t\twpm.isBelowRestErrorThreshold()\n\t}\n\n\twpm.isBelowRestErrorThreshold = function () {\n\t\treturn window.sessionStorage.getItem(wpmRestSettings.restFails) <= wpmRestSettings.restFailsThreshold\n\t}\n\n\twpm.isRestEndpointAvailable = function () {\n\n\t\tif (window.sessionStorage.getItem(wpmRestSettings.cookieWpmRestEndpointAvailable)) {\n\t\t\treturn JSON.parse(window.sessionStorage.getItem(wpmRestSettings.cookieWpmRestEndpointAvailable))\n\t\t} else {\n\t\t\t// return wpm.testEndpoint();\n\t\t\t// just set the value whenever possible in order not to wait or block the main thread\n\t\t\twpm.testEndpoint()\n\t\t}\n\t}\n\n\twpm.isSessionStorageAvailable = function () {\n\n\t\treturn !!window.sessionStorage\n\t}\n\n\twpm.testEndpoint = function (\n\t\turl = location.protocol + \"//\" + location.host + wpmRestSettings.restEndpoint,\n\t\tcookieName = wpmRestSettings.cookieWpmRestEndpointAvailable,\n\t) {\n\t\t// console.log('testing endpoint');\n\n\t\tjQuery.ajax(url, {\n\t\t\ttype : \"HEAD\",\n\t\t\ttimeout: 1000,\n\t\t\t// async: false,\n\t\t\tstatusCode: {\n\t\t\t\t200: function (response) {\n\t\t\t\t\t// Cookies.set(cookieName, true);\n\t\t\t\t\t// console.log('endpoint works');\n\t\t\t\t\twindow.sessionStorage.setItem(cookieName, JSON.stringify(true))\n\t\t\t\t},\n\t\t\t\t404: function (response) {\n\t\t\t\t\t// Cookies.set(cookieName, false);\n\t\t\t\t\t// console.log('endpoint doesn\\'t work');\n\t\t\t\t\twindow.sessionStorage.setItem(cookieName, JSON.stringify(false))\n\t\t\t\t},\n\t\t\t\t0 : function (response) {\n\t\t\t\t\t// Cookies.set(cookieName, false);\n\t\t\t\t\t// console.log('endpoint doesn\\'t work');\n\t\t\t\t\twindow.sessionStorage.setItem(cookieName, JSON.stringify(false))\n\t\t\t\t},\n\t\t\t},\n\t\t}).then(r => {\n\t\t\t// console.log('test done')\n\t\t\t// console.log('result: ' + JSON.parse(window.sessionStorage.getItem(cookieName)));\n\t\t\t// return JSON.parse(window.sessionStorage.getItem(cookieName));\n\t\t})\n\t}\n\n\twpm.isWpmRestEndpointAvailable = function (cookieName = wpmRestSettings.cookieWpmRestEndpointAvailable) {\n\n\t\treturn !!wpm.getCookie(cookieName)\n\t}\n\n\twpm.writeOrderIdToStorage = function (orderId, expireDays = 365) {\n\n\t\t// save the order ID in the browser storage\n\n\t\tif (!window.Storage) {\n\t\t\tlet expiresDate = new Date()\n\t\t\texpiresDate.setDate(expiresDate.getDate() + wpmDeduper.cookieExpiresDays)\n\n\t\t\tlet ids = []\n\t\t\tif (checkCookie()) {\n\t\t\t\tids = JSON.parse(wpm.getCookie(wpmDeduper.keyName))\n\t\t\t}\n\n\t\t\tif (!ids.includes(orderId)) {\n\t\t\t\tids.push(orderId)\n\t\t\t\tdocument.cookie = wpmDeduper.keyName + \"=\" + JSON.stringify(ids) + \";expires=\" + expiresDate.toUTCString()\n\t\t\t}\n\n\t\t} else {\n\t\t\tif (localStorage.getItem(wpmDeduper.keyName) === null) {\n\t\t\t\tlet ids = []\n\t\t\t\tids.push(orderId)\n\t\t\t\twindow.localStorage.setItem(wpmDeduper.keyName, JSON.stringify(ids))\n\n\t\t\t} else {\n\t\t\t\tlet ids = JSON.parse(localStorage.getItem(wpmDeduper.keyName))\n\t\t\t\tif (!ids.includes(orderId)) {\n\t\t\t\t\tids.push(orderId)\n\t\t\t\t\twindow.localStorage.setItem(wpmDeduper.keyName, JSON.stringify(ids))\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (typeof wpm.storeOrderIdOnServer === \"function\" && wpmDataLayer.orderDeduplication) {\n\t\t\twpm.storeOrderIdOnServer(orderId)\n\t\t}\n\t}\n\n\tfunction checkCookie() {\n\t\tlet key = wpm.getCookie(wpmDeduper.keyName)\n\t\treturn key !== \"\"\n\t}\n\n\twpm.isOrderIdStored = function (orderId) {\n\n\t\t// console.log('deduper: ' + wpmDataLayer.orderDeduplication);\n\t\tif (wpmDataLayer.orderDeduplication) {\n\t\t\t// console.log('order deduplication: on');\n\t\t\tif (!window.Storage) {\n\n\t\t\t\tif (checkCookie()) {\n\t\t\t\t\tlet ids = JSON.parse(wpm.getCookie(wpmDeduper.keyName))\n\t\t\t\t\treturn ids.includes(orderId)\n\t\t\t\t} else {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (localStorage.getItem(wpmDeduper.keyName) !== null) {\n\t\t\t\t\tlet ids = JSON.parse(localStorage.getItem(wpmDeduper.keyName))\n\t\t\t\t\treturn ids.includes(orderId)\n\t\t\t\t} else {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tconsole.log(\"order duplication prevention: off\")\n\t\t\treturn false\n\t\t}\n\t}\n\n\twpm.isEmail = function (email) {\n\t\t// https://emailregex.com/\n\t\tlet regex = /^(([^<>()\\[\\]\\\\.,;:\\s@\"]+(\\.[^<>()\\[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/\n\t\treturn regex.test(email)\n\t}\n\n\twpm.removeProductFromCart = function (productId, quantityToRemove = null) {\n\t\t// console.log('product_id: ' + productId + ' | quantityToRemove: ' + quantityToRemove);\n\n\t\ttry {\n\n\t\t\tif (!productId) throw Error(\"Wasn't able to retrieve a productId\")\n\n\t\t\tproductId = getIdBasedOndVariationsOutputSetting(productId)\n\n\t\t\tif (!productId) throw Error(\"Wasn't able to retrieve a productId\")\n\n\t\t\tlet quantity\n\n\t\t\tif (quantityToRemove == null) {\n\t\t\t\tquantity = wpmDataLayer.cart[productId].quantity\n\t\t\t} else {\n\t\t\t\tquantity = quantityToRemove\n\t\t\t}\n\n\t\t\t// console.log('product_id: ' + productId + ' | qty: ' + quantity);\n\t\t\t// console.log(productId);\n\t\t\t// console.log(wpmDataLayer.cart);\n\t\t\t// console.log(wpmDataLayer.cart[productId]);\n\n\t\t\tif (wpmDataLayer.cart[productId]) {\n\n\t\t\t\t// let product = {\n\t\t\t\t// id : productId.toString(),\n\t\t\t\t// dyn_r_ids: wpmDataLayer.cart[productId].dyn_r_ids,\n\t\t\t\t// name : wpmDataLayer.cart[productId].name,\n\t\t\t\t// // list_name: wpmDataLayer.shop.list_name, // doesn't make sense on mini_cart\n\t\t\t\t// brand : wpmDataLayer.cart[productId].brand,\n\t\t\t\t// category: wpmDataLayer.cart[productId].category,\n\t\t\t\t// variant : wpmDataLayer.cart[productId].variant,\n\t\t\t\t// // list_position: wpmDataLayer.cart[productId].position, // doesn't make sense on mini_cart\n\t\t\t\t// quantity : quantity,\n\t\t\t\t// price : wpmDataLayer.cart[productId].price,\n\t\t\t\t// isVariation: wpmDataLayer.products[productId].isVariation,\n\t\t\t\t// };\n\t\t\t\t//\n\t\t\t\t// if (product.isVariation) product['parentId_dyn_r_ids'] = wpmDataLayer.products[productId].parentId_dyn_r_ids;\n\n\t\t\t\tlet product = wpm.getProductDetailsFormattedForEvent(productId, quantity)\n\n\t\t\t\t// console.log('removing');\n\t\t\t\t// console.log(data);\n\n\t\t\t\tjQuery(document).trigger(\"wpmRemoveFromCart\", product)\n\n\t\t\t\tif (quantityToRemove == null || wpmDataLayer.cart[productId].quantity === quantityToRemove) {\n\t\t\t\t\tdelete wpmDataLayer.cart[productId]\n\t\t\t\t\tif (sessionStorage) sessionStorage.setItem(\"wpmDataLayerCart\", JSON.stringify(wpmDataLayer.cart))\n\t\t\t\t} else {\n\t\t\t\t\twpmDataLayer.cart[productId].quantity = wpmDataLayer.cart[productId].quantity - quantity\n\t\t\t\t\tif (sessionStorage) sessionStorage.setItem(\"wpmDataLayerCart\", JSON.stringify(wpmDataLayer.cart))\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t\t// console.log('getting cart from back end');\n\t\t\t// wpm.getCartItemsFromBackend();\n\t\t\t// console.log('getting cart from back end done');\n\n\t\t}\n\t}\n\n\tgetIdBasedOndVariationsOutputSetting = function (productId) {\n\n\t\ttry {\n\t\t\tif (wpmDataLayer?.general?.variationsOutput) {\n\t\t\t\t// console.log('test');\n\t\t\t\treturn productId\n\t\t\t} else {\n\t\t\t\tif (wpmDataLayer.products[productId].isVariation) {\n\t\t\t\t\treturn wpmDataLayer.products[productId].parentId\n\t\t\t\t} else {\n\t\t\t\t\treturn productId\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t}\n\t}\n\n\t// add_to_cart\n\twpm.addProductToCart = function (productId, quantity) {\n\n\t\ttry {\n\t\t\t// console.log('productId: ' + productId + ' | qty: ' + quantity);\n\t\t\t// console.log('productId: ' + productId + ' | variationId: ' + variationId + ' | qty: ' + quantity);\n\n\t\t\tif (!productId) throw Error(\"Wasn't able to retrieve a productId\")\n\n\t\t\tproductId = getIdBasedOndVariationsOutputSetting(productId)\n\n\t\t\tif (!productId) throw Error(\"Wasn't able to retrieve a productId\")\n\n\t\t\tif (wpmDataLayer?.products[productId]) {\n\n\t\t\t\tlet product = wpm.getProductDetailsFormattedForEvent(productId, quantity)\n\n\t\t\t\t// console.log(productId)\n\t\t\t\t// console.log(wpmDataLayer.cart)\n\n\t\t\t\tjQuery(document).trigger(\"wpmAddToCart\", product)\n\n\t\t\t\t// add product to cart wpmDataLayer['cart']\n\n\t\t\t\t// if the product already exists in the object, only add the additional quantity\n\t\t\t\t// otherwise create that product object in the wpmDataLayer['cart']\n\t\t\t\tif (wpmDataLayer?.cart[productId]) {\n\t\t\t\t\twpmDataLayer.cart[productId].quantity = wpmDataLayer.cart[productId].quantity + quantity\n\t\t\t\t} else {\n\n\t\t\t\t\tif (!(\"cart\" in wpmDataLayer)) wpmDataLayer.cart = {}\n\t\t\t\t\twpmDataLayer.cart[productId] = wpm.getProductDetailsFormattedForEvent(productId, quantity)\n\t\t\t\t}\n\n\t\t\t\tif (sessionStorage) sessionStorage.setItem(\"wpmDataLayerCart\", JSON.stringify(wpmDataLayer.cart))\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\n\t\t\t// fallback if wpmDataLayer.cart and wpmDataLayer.products got out of sync in case cart caching has an issue\n\t\t\twpm.getCartItemsFromBackend()\n\t\t}\n\t}\n\n\twpm.getCartItems = function () {\n\n\t\t// console.log('get cart items');\n\n\t\tif (sessionStorage) {\n\t\t\tif (!sessionStorage.getItem(\"wpmDataLayerCart\") || wpmDataLayer.shop.page_type === \"order_received_page\") {\n\t\t\t\tsessionStorage.setItem(\"wpmDataLayerCart\", JSON.stringify({}))\n\t\t\t} else {\n\t\t\t\twpm.saveCartObjectToDataLayer(JSON.parse(sessionStorage.getItem(\"wpmDataLayerCart\")))\n\t\t\t}\n\t\t} else {\n\t\t\twpm.getCartItemsFromBackend()\n\t\t}\n\t}\n\n\t// get all cart items from the backend\n\twpm.getCartItemsFromBackend = function () {\n\t\ttry {\n\t\t\tlet data = {\n\t\t\t\taction: \"wpm_get_cart_items\",\n\t\t\t}\n\n\t\t\tjQuery.ajax(\n\t\t\t\t{\n\t\t\t\t\ttype : \"get\",\n\t\t\t\t\tdataType: \"json\",\n\t\t\t\t\t// url : ajax_object.ajax_url,\n\t\t\t\t\turl : wpm.ajax_url,\n\t\t\t\t\tdata : data,\n\t\t\t\t\tsuccess: function (cartItems) {\n\n\t\t\t\t\t\t// save all cart items into wpmDataLayer\n\n\t\t\t\t\t\tif (!cartItems[\"cart\"]) cartItems[\"cart\"] = {}\n\n\t\t\t\t\t\twpm.saveCartObjectToDataLayer(cartItems[\"cart\"])\n\t\t\t\t\t\tif (sessionStorage) sessionStorage.setItem(\"wpmDataLayerCart\", JSON.stringify(cartItems[\"cart\"]))\n\t\t\t\t\t},\n\t\t\t\t})\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t}\n\t}\n\n\twpm.getProductsFromBackend = function (productIds) {\n\t\t// console.log('getting pids from back-end: ' + productIds)\n\t\t// get productIds from the backend\n\n\t\t// reduce productIds by products already in the dataLayer\n\t\tproductIds = productIds.filter(item => !wpmDataLayer.products.hasOwnProperty(item))\n\n\t\t// if no products IDs are in the object, don't try to get anything from the server\n\t\tif (!productIds || productIds.length === 0) return\n\n\t\ttry {\n\t\t\tlet data = {\n\t\t\t\taction : \"wpm_get_product_ids\",\n\t\t\t\tproductIds: productIds,\n\t\t\t}\n\n\t\t\tjQuery.ajax(\n\t\t\t\t{\n\t\t\t\t\ttype : \"get\",\n\t\t\t\t\tdataType: \"json\",\n\t\t\t\t\t// url : ajax_object.ajax_url,\n\t\t\t\t\turl : wpm.ajax_url,\n\t\t\t\t\tdata : data,\n\t\t\t\t\tsuccess: function (products) {\n\n\t\t\t\t\t\t// merge products into wpmDataLayer.products\n\t\t\t\t\t\twpmDataLayer.products = Object.assign({}, wpmDataLayer.products, products)\n\t\t\t\t\t},\n\t\t\t\t\terror : function (response) {\n\t\t\t\t\t\tconsole.log(response)\n\t\t\t\t\t},\n\t\t\t\t})\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t}\n\t}\n\n\twpm.saveCartObjectToDataLayer = function (cartObject) {\n\t\twpmDataLayer.cart = cartObject\n\t\twpmDataLayer.products = Object.assign({}, wpmDataLayer.products, cartObject)\n\t}\n\n\twpm.fireCheckoutOption = function (step, checkout_option = null, value = null) {\n\n\t\tlet data = {\n\t\t\tstep : step,\n\t\t\tcheckout_option: checkout_option,\n\t\t\tvalue : value,\n\t\t}\n\n\t\tjQuery(document).trigger(\"wpmFireCheckoutOption\", data)\n\t}\n\n\twpm.fireCheckoutProgress = function (step) {\n\n\t\tlet data = {\n\t\t\tstep: step,\n\t\t}\n\n\t\tjQuery(document).trigger(\"wpmFireCheckoutProgress\", data)\n\t}\n\n\twpm.getPostIdFromString = function (string) {\n\t\t// console.log(string);\n\t\ttry {\n\t\t\treturn string.match(/(post-)(\\d+)/)[2]\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t}\n\t}\n\n\twpm.triggerViewItemList = function (productId) {\n\n\t\t// productId = null;\n\n\t\tif (!productId) throw Error(\"Wasn't able to retrieve a productId\")\n\n\t\tproductId = getIdBasedOndVariationsOutputSetting(productId)\n\n\t\tif (!productId) throw Error(\"Wasn't able to retrieve a productId\")\n\n\t\tjQuery(document).trigger(\"wpmViewItemList\", wpm.getProductDataForViewItemEvent(productId))\n\t}\n\n\twpm.getProductDataForViewItemEvent = function (productId) {\n\n\t\tif (!productId) throw Error(\"Wasn't able to retrieve a productId\")\n\n\t\ttry {\n\t\t\tif (wpmDataLayer.products[productId]) {\n\n\t\t\t\treturn wpm.getProductDetailsFormattedForEvent(productId)\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t}\n\t}\n\twpm.getMainProductIdFromProductPage = function () {\n\t\ttry {\n\t\t\tif ([\"simple\", \"variable\", \"grouped\", \"composite\", \"bundle\"].indexOf(wpmDataLayer.shop.product_type) >= 0) {\n\t\t\t\treturn jQuery(\".wpmProductId:first\").data(\"id\")\n\t\t\t} else {\n\t\t\t\treturn false\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t}\n\t}\n\n\twpm.viewItemListTriggerTestMode = function (target) {\n\n\t\tjQuery(target).css({\"position\": \"relative\"})\n\t\tjQuery(target).append(\"<div id=\\\"viewItemListTriggerOverlay\\\"></div>\")\n\t\tjQuery(target).find(\"#viewItemListTriggerOverlay\").css({\n\t\t\t\"z-index\" : \"10\",\n\t\t\t\"display\" : \"block\",\n\t\t\t\"position\" : \"absolute\",\n\t\t\t\"height\" : \"100%\",\n\t\t\t\"top\" : \"0\",\n\t\t\t\"left\" : \"0\",\n\t\t\t\"right\" : \"0\",\n\t\t\t\"opacity\" : wpmDataLayer.viewItemListTrigger.opacity,\n\t\t\t\"background-color\": wpmDataLayer.viewItemListTrigger.backgroundColor,\n\t\t})\n\t}\n\n\twpm.getSearchTermFromUrl = function () {\n\t\ttry {\n\t\t\tlet urlParameters = new URLSearchParams(window.location.search)\n\t\t\treturn urlParameters.get(\"s\")\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t}\n\t}\n\n\t// we need this to track timeouts for intersection observers\n\tlet ioTimeouts = {}\n\n\twpm.observerCallback = function (entries, observer) {\n\n\t\tentries.forEach((entry) => {\n\n\t\t\ttry {\n\t\t\t\tlet productId\n\n\t\t\t\tlet elementId = jQuery(entry.target).data(\"ioid\")\n\n\t\t\t\t// Get the productId from next element, if wpmProductId is a sibling, like in Gutenberg blocks\n\t\t\t\t// otherwise go search in children, like in regular WC loop items\n\t\t\t\tif (jQuery(entry.target).next(\".wpmProductId\").length) {\n\t\t\t\t\t// console.log('test 1');\n\t\t\t\t\tproductId = jQuery(entry.target).next(\".wpmProductId\").data(\"id\")\n\t\t\t\t} else {\n\t\t\t\t\tproductId = jQuery(entry.target).find(\".wpmProductId\").data(\"id\")\n\t\t\t\t}\n\n\t\t\t\t// productId = null;\n\n\t\t\t\tif (!productId) throw Error(\"wpmProductId element not found\")\n\n\t\t\t\tif (entry.isIntersecting) {\n\n\t\t\t\t\t// console.log('prodid: ' + productId);\n\t\t\t\t\tioTimeouts[elementId] = setTimeout(() => {\n\t\t\t\t\t\t// console.log('prodid: ' + productId);\n\t\t\t\t\t\twpm.triggerViewItemList(productId)\n\t\t\t\t\t\tif (wpmDataLayer.viewItemListTrigger.testMode) wpm.viewItemListTriggerTestMode(entry.target)\n\t\t\t\t\t\tif (wpmDataLayer.viewItemListTrigger.repeat === false) observer.unobserve(entry.target)\n\t\t\t\t\t}, wpmDataLayer.viewItemListTrigger.timeout)\n\n\t\t\t\t} else {\n\n\t\t\t\t\tclearTimeout(ioTimeouts[elementId])\n\t\t\t\t\tif (wpmDataLayer.viewItemListTrigger.testMode) jQuery(entry.target).find(\"#viewItemListTriggerOverlay\").remove()\n\t\t\t\t}\n\t\t\t} catch (e) {\n\t\t\t\tconsole.error(e)\n\t\t\t}\n\t\t})\n\t}\n\n\t// fire view_item_list only on products that have become visible\n\tlet io\n\tlet ioid = 0\n\tlet allIoElementsToWatch\n\n\tlet getAllElementsToWatch = function () {\n\n\t\tallIoElementsToWatch = jQuery(\".wpmProductId\")\n\t\t\t.map(function (i, elem) {\n\t\t\t\t// console.log(elem);\n\t\t\t\tif (\n\t\t\t\t\tjQuery(elem).parent().hasClass(\"type-product\") ||\n\t\t\t\t\tjQuery(elem).parent().hasClass(\"product\") ||\n\t\t\t\t\tjQuery(elem).parent().hasClass(\"product-item-inner\")\n\t\t\t\t) {\n\t\t\t\t\t// console.log(elem);\n\t\t\t\t\treturn jQuery(elem).parent()\n\t\t\t\t} else if (\n\t\t\t\t\tjQuery(elem).prev().hasClass(\"wc-block-grid__product\") ||\n\t\t\t\t\tjQuery(elem).prev().hasClass(\"product\") ||\n\t\t\t\t\tjQuery(elem).prev().hasClass(\"product-small\") ||\n\t\t\t\t\tjQuery(elem).prev().hasClass(\"woocommerce-LoopProduct-link\")\n\t\t\t\t) {\n\t\t\t\t\treturn jQuery(this).prev()\n\t\t\t\t} else if (jQuery(elem).closest(\".product\").length) {\n\t\t\t\t\treturn jQuery(elem).closest(\".product\")\n\t\t\t\t}\n\t\t\t})\n\t}\n\n\twpm.startIntersectionObserverToWatch = function () {\n\n\t\ttry {\n\t\t\t// enable view_item_list test mode from browser\n\t\t\tif (wpm.urlHasParameter(\"vildemomode\")) wpmDataLayer.viewItemListTrigger.testMode = true\n\n\t\t\t// set up intersection observer\n\t\t\tio = new IntersectionObserver(wpm.observerCallback, {\n\t\t\t\tthreshold: wpmDataLayer.viewItemListTrigger.threshold,\n\t\t\t})\n\n\t\t\tgetAllElementsToWatch()\n\n\t\t\t// console.log(allElementsToWatch);\n\n\t\t\tallIoElementsToWatch.each(function (i, elem) {\n\t\t\t\t// console.log(elem[0]);\n\t\t\t\t// jQuery(elem[0]).attr('data-ioid', ioid++);\n\t\t\t\tjQuery(elem[0]).data(\"ioid\", ioid++)\n\n\t\t\t\tio.observe(elem[0])\n\t\t\t})\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t}\n\t}\n\n\t// watch DOM for new lazy loaded products and add them to the intersection observer\n\twpm.startProductsMutationObserverToWatch = function () {\n\n\t\ttry {\n\t\t\t// Pass in the target node, as well as the observer options\n\n\t\t\t// selects the most common parent node\n\t\t\t// https://stackoverflow.com/a/7648323/4688612\n\t\t\tlet productsNode = jQuery(\".wpmProductId:eq(0)\").parents().has(jQuery(\".wpmProductId:eq(1)\").parents()).first()\n\n\t\t\tif (productsNode.length) {\n\t\t\t\tproductsMutationObserver.observe(productsNode[0], {\n\t\t\t\t\tattributes : true,\n\t\t\t\t\tchildList : true,\n\t\t\t\t\tcharacterData: true,\n\t\t\t\t})\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t}\n\t}\n\n\t// Create an observer instance\n\tlet productsMutationObserver = new MutationObserver(function (mutations) {\n\n\t\tmutations.forEach(function (mutation) {\n\t\t\tlet newNodes = mutation.addedNodes // DOM NodeList\n\t\t\tif (newNodes !== null) { // If there are new nodes added\n\t\t\t\tlet nodes = jQuery(newNodes) // jQuery set\n\t\t\t\tnodes.each(function () {\n\t\t\t\t\tif (\n\t\t\t\t\t\tjQuery(this).hasClass(\"type-product\") ||\n\t\t\t\t\t\tjQuery(this).hasClass(\"product-small\") ||\n\t\t\t\t\t\tjQuery(this).hasClass(\"wc-block-grid__product\")\n\t\t\t\t\t) {\n\t\t\t\t\t\t// check if the node has a child or sibling wpmProductId\n\t\t\t\t\t\t// if yes add it to the intersectionObserver\n\t\t\t\t\t\tif (hasWpmProductIdElement(this)) {\n\t\t\t\t\t\t\tjQuery(this).data(\"ioid\", ioid++)\n\t\t\t\t\t\t\tio.observe(this)\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t}\n\t\t})\n\t})\n\n\tlet hasWpmProductIdElement = function (elem) {\n\t\treturn !!(jQuery(elem).find(\".wpmProductId\").length ||\n\t\t\tjQuery(elem).siblings(\".wpmProductId\").length)\n\t}\n\n\twpm.setCookie = function (cookieName, cookieValue = \"\", expiryDays = null) {\n\t\tif (expiryDays) {\n\t\t\tlet d = new Date()\n\t\t\td.setTime(d.getTime() + (expiryDays * 24 * 60 * 60 * 1000))\n\t\t\tlet expires = \"expires=\" + d.toUTCString()\n\t\t\tdocument.cookie = cookieName + \"=\" + cookieValue + \";\" + expires + \";path=/\"\n\t\t} else {\n\t\t\tdocument.cookie = cookieName + \"=\" + cookieValue + \";path=/\"\n\t\t}\n\t}\n\n\twpm.getCookie = function (cookieName) {\n\t\tlet name = cookieName + \"=\"\n\t\tlet decodedCookie = decodeURIComponent(document.cookie)\n\t\tlet ca = decodedCookie.split(\";\")\n\t\tfor (let i = 0; i < ca.length; i++) {\n\t\t\tlet c = ca[i]\n\t\t\twhile (c.charAt(0) == \" \") {\n\t\t\t\tc = c.substring(1)\n\t\t\t}\n\t\t\tif (c.indexOf(name) == 0) {\n\t\t\t\treturn c.substring(name.length, c.length)\n\t\t\t}\n\t\t}\n\t\treturn \"\"\n\t}\n\n\twpm.getWpmSessionData = function () {\n\t\tif (window.sessionStorage) {\n\n\t\t\tlet data = window.sessionStorage.getItem(\"_wpm\")\n\t\t\tif (data !== null) {\n\t\t\t\treturn JSON.parse(data)\n\t\t\t} else {\n\t\t\t\treturn {}\n\t\t\t}\n\t\t} else {\n\t\t\treturn {}\n\t\t}\n\t}\n\n\twpm.setWpmSessionData = function (data) {\n\t\tif (window.sessionStorage) {\n\t\t\twindow.sessionStorage.setItem(\"_wpm\", JSON.stringify(data))\n\t\t}\n\t}\n\n\twpm.storeOrderIdOnServer = function (orderId) {\n\n\t\t// console.log('saving wpm_purchase_pixels_fired');\n\n\t\t// console.log('url: ' + wpm_premium_only_ajax_object.ajax_url);\n\t\t// console.log('nonce: ' + wpm_premium_only_ajax_object.nonce);\n\t\t// console.log('url: ' + wpm.ajax_url);\n\t\t// console.log('nonce: ' + wpm.nonce);\n\n\t\ttry {\n\t\t\t// save the state in the database\n\t\t\tlet data = {\n\t\t\t\taction : \"wpm_purchase_pixels_fired\",\n\t\t\t\torder_id: orderId,\n\t\t\t\t// nonce : ajax_object.nonce,\n\t\t\t\tnonce: wpm.nonce,\n\t\t\t}\n\n\t\t\tjQuery.ajax(\n\t\t\t\t{\n\t\t\t\t\ttype : \"post\",\n\t\t\t\t\tdataType: \"json\",\n\t\t\t\t\t// url : ajax_object.ajax_url,\n\t\t\t\t\turl : wpm.ajax_url,\n\t\t\t\t\tdata : data,\n\t\t\t\t\tsuccess: function (response) {\n\t\t\t\t\t\tif (response.success === false) {\n\t\t\t\t\t\t\tconsole.log(response)\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\terror : function (response) {\n\t\t\t\t\t\tconsole.log(response)\n\t\t\t\t\t},\n\t\t\t\t})\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t}\n\t}\n\n\twpm.getProductIdByCartItemKeyUrl = function (url) {\n\t\tlet searchParams = new URLSearchParams(url.search)\n\t\tlet cartItemKey = searchParams.get(\"remove_item\")\n\n\t\tlet productId\n\n\t\tif (wpmDataLayer.cartItemKeys[cartItemKey][\"variation_id\"] === 0) {\n\t\t\tproductId = wpmDataLayer.cartItemKeys[cartItemKey][\"product_id\"]\n\t\t} else {\n\t\t\tproductId = wpmDataLayer.cartItemKeys[cartItemKey][\"variation_id\"]\n\t\t}\n\n\t\treturn productId\n\t}\n\n\twpm.getAddToCartLinkProductIds = function () {\n\t\treturn jQuery(\"a\").map(function () {\n\t\t\tlet href = jQuery(this).attr(\"href\")\n\n\t\t\tif (href && href.includes(\"?add-to-cart=\")) {\n\t\t\t\tlet matches = href.match(/(add-to-cart=)(\\d+)/)\n\t\t\t\tif (matches) return matches[2]\n\t\t\t}\n\t\t}).get()\n\t}\n\n\twpm.getProductDetailsFormattedForEvent = function (productId, quantity = 1) {\n\n\t\t// console.log(wpmDataLayer.products[productId].dyn_r_ids)\n\n\t\tlet product = {\n\t\t\tid : productId.toString(),\n\t\t\tdyn_r_ids : wpmDataLayer.products[productId].dyn_r_ids,\n\t\t\tname : wpmDataLayer.products[productId].name,\n\t\t\tlist_name : wpmDataLayer.shop.list_name,\n\t\t\tbrand : wpmDataLayer.products[productId].brand,\n\t\t\tcategory : wpmDataLayer.products[productId].category,\n\t\t\tvariant : wpmDataLayer.products[productId].variant,\n\t\t\tlist_position: wpmDataLayer.products[productId].position,\n\t\t\tquantity : quantity,\n\t\t\tprice : wpmDataLayer.products[productId].price,\n\t\t\tcurrency : wpmDataLayer.shop.currency,\n\t\t\tisVariable : wpmDataLayer.products[productId].isVariable,\n\t\t\tisVariation : wpmDataLayer.products[productId].isVariation,\n\t\t\tparentId : wpmDataLayer.products[productId].parentId,\n\t\t}\n\n\t\tif (product.isVariation) product[\"parentId_dyn_r_ids\"] = wpmDataLayer.products[productId].parentId_dyn_r_ids\n\n\t\treturn product\n\t}\n\n\twpm.setReferrerToCookie = function () {\n\t\t// can't use session storage as we can't read it from the server\n\t\tif (!wpm.getCookie(\"wpmReferrer\")) {\n\t\t\twpm.setCookie(\"wpmReferrer\", document.referrer)\n\t\t}\n\t}\n\n\twpm.getReferrerFromCookie = function () {\n\t\tif (wpm.getCookie(\"wpmReferrer\")) {\n\t\t\treturn wpm.getCookie(\"wpmReferrer\")\n\t\t} else {\n\t\t\treturn null\n\t\t}\n\t}\n\n\twpm.getClidFromBrowser = function (clidId = \"gclid\") {\n\n\t\tlet clidCookieId\n\n\t\tclidCookieId = {\n\t\t\tgclid: \"_gcl_aw\",\n\t\t\tdclid: \"_gcl_dc\",\n\t\t}\n\n\t\tif (wpm.getCookie(clidCookieId[clidId])) {\n\t\t\tlet clidCookie = wpm.getCookie(clidCookieId[clidId])\n\t\t\tlet matches = clidCookie.match(/(GCL.[\\d]*.)(.*)/)\n\t\t\treturn matches[2]\n\t\t} else {\n\t\t\treturn \"\"\n\t\t}\n\t}\n\n\twpm.getUserAgent = function () {\n\t\treturn navigator.userAgent\n\t}\n\n\twpm.getViewPort = function () {\n\t\treturn {\n\t\t\twidth : Math.max(document.documentElement.clientWidth || 0, window.innerWidth || 0),\n\t\t\theight: Math.max(document.documentElement.clientHeight || 0, window.innerHeight || 0),\n\t\t}\n\t}\n\n\t/*\n\t* Handle Cookie Management Platforms\n\t* */\n\n\tlet getComplianzCookies = function () {\n\n\t\tlet cmplz_statistics = wpm.getCookie(\"cmplz_statistics\")\n\t\tlet cmplz_marketing = wpm.getCookie(\"cmplz_marketing\")\n\t\tlet cmplz_consent_status = wpm.getCookie(\"cmplz_consent_status\") || wpm.getCookie(\"cmplz_banner-status\")\n\n\n\t\tif (cmplz_consent_status) {\n\t\t\treturn {\n\t\t\t\tanalytics : cmplz_statistics === \"allow\",\n\t\t\t\tads : cmplz_marketing === \"allow\",\n\t\t\t\tvisitorHasChosen: true,\n\t\t\t}\n\t\t} else {\n\t\t\treturn false\n\t\t}\n\t}\n\n\tlet getCookieLawInfoCookies = function () {\n\n\t\tlet analyticsCookie = wpm.getCookie(\"cookielawinfo-checkbox-analytics\") || wpm.getCookie(\"cookielawinfo-checkbox-analytiques\")\n\t\tlet adsCookie = wpm.getCookie(\"cookielawinfo-checkbox-advertisement\") || wpm.getCookie(\"cookielawinfo-checkbox-publicite\")\n\t\tlet visitorHasChosen = wpm.getCookie(\"CookieLawInfoConsent\")\n\n\t\tif (analyticsCookie || adsCookie) {\n\n\t\t\treturn {\n\t\t\t\tanalytics : analyticsCookie === \"yes\",\n\t\t\t\tads : adsCookie === \"yes\",\n\t\t\t\tvisitorHasChosen: !!visitorHasChosen,\n\t\t\t}\n\t\t} else {\n\t\t\treturn false\n\t\t}\n\t}\n\n\n\tlet\n\t\twpmConsentValues = {}\n\twpmConsentValues.categories = {}\n\twpmConsentValues.pixels = []\n\twpmConsentValues.mode = \"category\"\n\twpmConsentValues.visitorHasChosen = false\n\n\twpm.getConsentValues = function () {\n\t\treturn wpmConsentValues\n\t}\n\n\twpm.setConsentValueCategories = function (analytics = false, ads = false) {\n\t\twpmConsentValues.categories.analytics = analytics\n\t\twpmConsentValues.categories.ads = ads\n\t}\n\n\twpm.updateConsentCookieValues = function (explicitConsent = false) {\n\n\t\t// ad_storage\n\t\t// analytics_storage\n\t\t// functionality_storage\n\t\t// personalization_storage\n\t\t// security_storage\n\n\t\t// console.log('exp cons: ' + explicitConsent)\n\n\t\tlet cookie\n\n\t\tif (cookie = wpm.getCookie(\"CookieConsent\")) {\n\t\t\t// Cookiebot\n\t\t\t// https://wordpress.org/plugins/cookiebot/\n\t\t\tcookie = decodeURI(cookie)\n\n\t\t\t// console.log(cookie.indexOf('statistics:true'))\n\t\t\t// console.log(cookie.indexOf('marketing:true'))\n\n\t\t\twpmConsentValues.categories.analytics = cookie.indexOf(\"statistics:true\") >= 0\n\t\t\twpmConsentValues.categories.ads = cookie.indexOf(\"marketing:true\") >= 0\n\t\t\twpmConsentValues.visitorHasChosen = true\n\n\t\t} else if (cookie = wpm.getCookie(\"CookieScriptConsent\")) {\n\t\t\t// Cookie Script\n\t\t\t// https://wordpress.org/plugins/cookie-script-com/\n\n\t\t\tcookie = JSON.parse(cookie)\n\n\t\t\t// console.log(cookie)\n\t\t\t// console.log(cookie.action)\n\t\t\t// console.log('cat length: ' + cookie.categories.length)\n\t\t\t// console.log(cookie.categories.indexOf('performance'))\n\n\t\t\tif (cookie.action === \"reject\") {\n\t\t\t\twpmConsentValues.categories.analytics = false\n\t\t\t\twpmConsentValues.categories.ads = false\n\t\t\t} else if (cookie.categories.length === 2) {\n\t\t\t\twpmConsentValues.categories.analytics = true\n\t\t\t\twpmConsentValues.categories.ads = true\n\t\t\t} else {\n\t\t\t\twpmConsentValues.categories.analytics = cookie.categories.indexOf(\"performance\") >= 0\n\t\t\t\twpmConsentValues.categories.ads = cookie.categories.indexOf(\"targeting\") >= 0\n\t\t\t}\n\n\t\t\twpmConsentValues.visitorHasChosen = true\n\n\t\t\t// console.log(wpmConsentValues)\n\n\t\t} else if (cookie = wpm.getCookie(\"borlabs-cookie\")) {\n\t\t\t// Borlabs Cookie\n\t\t\t// https://borlabs.io/borlabs-cookie/\n\n\t\t\tcookie = decodeURI(cookie)\n\t\t\tcookie = JSON.parse(cookie)\n\n\t\t\twpmConsentValues.categories.analytics = !!cookie?.consents?.statistics\n\t\t\twpmConsentValues.categories.ads = !!cookie?.consents?.marketing\n\t\t\twpmConsentValues.visitorHasChosen = true\n\t\t\twpmConsentValues.pixels = [...cookie?.consents?.statistics || [], ...cookie?.consents?.marketing || []]\n\t\t\twpmConsentValues.mode = \"pixel\"\n\n\t\t} else if (cookie = getComplianzCookies()) {\n\t\t\t// Complianz Cookie\n\t\t\t// https://wordpress.org/plugins/complianz-gdpr/\n\n\t\t\t// console.log(cookie)\n\n\t\t\twpmConsentValues.categories.analytics = cookie.analytics === true\n\t\t\twpmConsentValues.categories.ads = cookie.ads === true\n\t\t\twpmConsentValues.visitorHasChosen = cookie.visitorHasChosen\n\n\t\t\t// console.log(wpmConsentValues)\n\n\t\t} else if (cookie = wpm.getCookie(\"cookie_notice_accepted\")) {\n\t\t\t// Cookie Compliance (free version)\n\t\t\t// https://wordpress.org/plugins/cookie-notice/\n\n\t\t\twpmConsentValues.categories.analytics = true\n\t\t\twpmConsentValues.categories.ads = true\n\t\t\twpmConsentValues.visitorHasChosen = true\n\n\t\t} else if (cookie = wpm.getCookie(\"hu-consent\")) {\n\t\t\t// Cookie Compliance (pro version)\n\t\t\t// https://wordpress.org/plugins/cookie-notice/\n\n\t\t\tcookie = JSON.parse(cookie)\n\n\t\t\twpmConsentValues.categories.analytics = !!cookie.categories[\"3\"]\n\t\t\twpmConsentValues.categories.ads = !!cookie.categories[\"4\"]\n\t\t\twpmConsentValues.visitorHasChosen = true\n\n\t\t} else if (cookie = getCookieLawInfoCookies()) {\n\t\t\t// CookieYes, GDPR Cookie Consent (Cookie Law Info)\n\t\t\t// https://wordpress.org/plugins/cookie-law-info/\n\n\t\t\twpmConsentValues.categories.analytics = cookie.analytics === true\n\t\t\twpmConsentValues.categories.ads = cookie.ads === true\n\t\t\twpmConsentValues.visitorHasChosen = cookie.visitorHasChosen === true\n\n\t\t} else if (cookie = wpm.getCookie(\"moove_gdpr_popup\")) {\n\t\t\t// GDPR Cookie Compliance Plugin by Moove Agency\n\t\t\t// https://wordpress.org/plugins/gdpr-cookie-compliance/\n\t\t\t// TODO write documentation on how to set up the plugin in order for this to work properly\n\n\t\t\tcookie = JSON.parse(cookie)\n\t\t\t// console.log('moove cookie thirdparty: ' + cookie.thirdparty)\n\t\t\t// console.log('moove cookie advanced: ' + cookie.advanced)\n\n\t\t\twpmConsentValues.categories.analytics = cookie.thirdparty === \"1\"\n\t\t\twpmConsentValues.categories.ads = cookie.advanced === \"1\"\n\t\t\twpmConsentValues.visitorHasChosen = true\n\n\t\t\t// console.log(wpmConsentValues)\n\n\t\t} else {\n\t\t\t// consentValues.categories.analytics = true\n\t\t\t// consentValues.categories.ads = true\n\n\t\t\twpmConsentValues.categories.analytics = !explicitConsent\n\t\t\twpmConsentValues.categories.ads = !explicitConsent\n\t\t}\n\t}\n\n\twpm.updateConsentCookieValues()\n\n\twpm.setConsentDefaultValuesToExplicit = function () {\n\t\twpmConsentValues.categories = {\n\t\t\tanalytics: false,\n\t\t\tads : false,\n\t\t}\n\t}\n\n\twpm.canIFire = function (category, pixelName) {\n\n\t\tlet canIFireMode\n\n\t\tif (\"category\" === wpmConsentValues.mode) {\n\t\t\tcanIFireMode = !!wpmConsentValues.categories[category]\n\t\t} else if (\"pixel\" === wpmConsentValues.mode) {\n\t\t\tcanIFireMode = wpmConsentValues.pixels.includes(pixelName)\n\t\t} else {\n\t\t\tconsole.error(\"Couldn't find a valid consent mode in wpmConsentValues\")\n\t\t\tcanIFireMode = false\n\t\t}\n\n\t\tif (canIFireMode) {\n\t\t\treturn true\n\t\t} else {\n\t\t\tif (wpm.urlHasParameter(\"debugConsentMode\")) {\n\t\t\t\tif (wpmDataLayer?.shop?.cookie_consent_mgmt?.explicit_consent) {\n\t\t\t\t\tconsole.log(\"WooCommerce Pixel Manager: The \\\"\" + pixelName + \" (category: \" + category + \")\\\" pixel has not fired because you have not given consent for it yet. (The shop is in explicit consent mode.)\")\n\t\t\t\t} else {\n\t\t\t\t\tconsole.log(\"WooCommerce Pixel Manager: The \\\"\" + pixelName + \" (category: \" + category + \")\\\" pixel has not fired because you have removed consent for this pixel. (The shop is in implicit consent mode.)\")\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn false\n\t\t}\n\t}\n\n\t/**\n\t * Runs through each script in <head> and blocks / unblocks it according to the plugin settings\n\t * and user consent.\n\t */\n\n\t// https://stackoverflow.com/q/65453565/4688612\n\twpm.scriptTagObserver = new MutationObserver((mutations) => {\n\t\tmutations.forEach(({addedNodes}) => {\n\t\t\t[...addedNodes]\n\t\t\t\t.forEach(node => {\n\n\t\t\t\t\tif ($(node).data(\"wpm-cookie-category\")) {\n\n\t\t\t\t\t\t// console.log(node)\n\n\t\t\t\t\t\t// If the pixel category has been approved > unblock\n\t\t\t\t\t\t// If the pixel belongs to more than one category, then unblock if one of the categories has been approved\n\t\t\t\t\t\t// If no category has been approved, but the Google Consent Mode is active, then only unblock the Google scripts\n\n\t\t\t\t\t\tif (wpm.shouldScriptBeActive(node)) {\n\t\t\t\t\t\t\twpm.unblockScript(node)\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\twpm.blockScript(node)\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t})\n\t})\n\n\twpm.scriptTagObserver.observe(document.head, {childList: true, subtree: true})\n\twindow.addEventListener(\"DOMContentLoaded\", () => wpm.scriptTagObserver.disconnect())\n\n\twpm.shouldScriptBeActive = function (node) {\n\n\t\tif (\n\t\t\twpmDataLayer.shop.cookie_consent_mgmt.explicit_consent ||\n\t\t\twpmConsentValues.visitorHasChosen\n\t\t) {\n\n\t\t\tif (wpmConsentValues.mode === \"category\" && $(node).data(\"wpm-cookie-category\").split(\",\").some(element => wpmConsentValues.categories[element])) {\n\t\t\t\treturn true\n\t\t\t} else if (wpmConsentValues.mode === \"pixel\" && wpmConsentValues.pixels.includes($(node).data(\"wpm-pixel-name\"))) {\n\t\t\t\treturn true\n\t\t\t} else if (wpmConsentValues.mode === \"pixel\" && $(node).data(\"wpm-pixel-name\") === \"google\" && [\"google-analytics\", \"google-ads\"].some(element => wpmConsentValues.pixels.includes(element))) {\n\t\t\t\treturn true\n\t\t\t} else if (wpmDataLayer?.pixels?.google?.consent_mode?.active && $(node).data(\"wpm-pixel-name\") === \"google\") {\n\t\t\t\treturn true\n\t\t\t} else {\n\t\t\t\treturn false\n\t\t\t}\n\t\t} else {\n\t\t\treturn true\n\t\t}\n\t}\n\n\n\twpm.unblockScript = function (scriptNode, removeAttach = false) {\n\n\t\tif (removeAttach) $(scriptNode).remove()\n\n\t\tlet wpmSrc = $(scriptNode).data(\"wpm-src\")\n\t\tif (wpmSrc) $(scriptNode).attr(\"src\", wpmSrc)\n\n\t\tscriptNode.type = \"text/javascript\"\n\n\t\tif (removeAttach) $(scriptNode).appendTo(\"head\")\n\n\t\tjQuery(document).trigger(\"wpmPreLoadPixels\", {})\n\t}\n\n\twpm.blockScript = function (scriptNode, removeAttach = false) {\n\n\t\tif (removeAttach) $(scriptNode).remove()\n\n\t\tif ($(scriptNode).attr(\"src\")) $(scriptNode).removeAttr(\"src\")\n\t\tscriptNode.type = \"blocked/javascript\"\n\n\t\tif (removeAttach) $(scriptNode).appendTo(\"head\")\n\t}\n\n\twpm.unblockAllScripts = function (analytics = true, ads = true) {\n\t\t// console.log('unblocking all scripts')\n\n\t\t$.each(\n\t\t\t$(\"script[type=\\\"blocked/javascript\\\"]\"), function (index, scriptNode) {\n\n\t\t\t\tif ($(scriptNode).data(\"wpm-cookie-category\").includes(\"analytics\") && analytics) {\n\t\t\t\t\twpm.unblockScript(scriptNode, true)\n\t\t\t\t} else if ($(scriptNode).data(\"wpm-cookie-category\").includes(\"ads\") && ads) {\n\t\t\t\t\twpm.unblockScript(scriptNode, true)\n\t\t\t\t}\n\t\t\t})\n\n\t\tjQuery(document).trigger(\"wpmPreLoadPixels\", {})\n\t}\n\n\twpm.unblockSelectedPixels = function () {\n\t\t$.each(\n\t\t\t$(\"script[type=\\\"blocked/javascript\\\"]\"), function (index, node) {\n\n\t\t\t\tif (wpmConsentValues.pixels.includes($(node).data(\"wpm-pixel-name\"))) {\n\t\t\t\t\twpm.unblockScript(node, true)\n\t\t\t\t} else if ($(node).data(\"wpm-pixel-name\") === \"google\" && [\"google-analytics\", \"google-ads\"].some(element => wpmConsentValues.pixels.includes(element))) {\n\t\t\t\t\twpm.unblockScript(node, true)\n\t\t\t\t}\n\t\t\t})\n\n\t\tjQuery(document).trigger(\"wpmPreLoadPixels\", {})\n\t}\n\n\n\t/**\n\t * Block or unblock scripts for each CMP immediately after cookie consent has been updated\n\t * by the visitor.\n\t */\n\n\t// Borlabs Cookie\n\t// If visitor accepts cookies in Borlabs Cookie unblock the scripts\n\twindow.addEventListener(\"borlabs-cookie-consent-saved\", function (e) {\n\n\t\twpm.updateConsentCookieValues()\n\n\t\tif (wpmConsentValues.mode === \"pixel\") {\n\n\t\t\twpm.unblockSelectedPixels()\n\t\t\twpm.updateGoogleConsentMode(wpmConsentValues.pixels.includes(\"google-analytics\"), wpmConsentValues.pixels.includes(\"google-ads\"))\n\t\t} else {\n\n\t\t\twpm.unblockAllScripts(wpmConsentValues.categories.analytics, wpmConsentValues.categories.ads)\n\t\t\twpm.updateGoogleConsentMode(wpmConsentValues.categories.analytics, wpmConsentValues.categories.ads)\n\t\t}\n\t})\n\n\t// Cookiebot\n\t// If visitor accepts cookies in Cookiebot unblock the scripts\n\t// https://www.cookiebot.com/en/developer/\n\twindow.addEventListener(\"CookiebotOnAccept\", function (e) {\n\t\tif (Cookiebot.consent.statistics) wpmConsentValues.categories.analytics = true\n\t\tif (Cookiebot.consent.marketing) wpmConsentValues.categories.ads = true\n\n\t\twpm.unblockAllScripts(wpmConsentValues.categories.analytics, wpmConsentValues.categories.ads)\n\t\twpm.updateGoogleConsentMode(wpmConsentValues.categories.analytics, wpmConsentValues.categories.ads)\n\n\t}, false)\n\n\t/**\n\t * Cookie Script\n\t * If visitor accepts cookies in Cookie Script unblock the scripts\n\t * https://support.cookie-script.com/article/20-custom-events\n\t */\n\twindow.addEventListener(\"CookieScriptAccept\", function (e) {\n\t\tif (e.detail.categories.includes(\"performance\")) wpmConsentValues.categories.analytics = true\n\t\tif (e.detail.categories.includes(\"targeting\")) wpmConsentValues.categories.ads = true\n\n\t\twpm.unblockAllScripts(wpmConsentValues.categories.analytics, wpmConsentValues.categories.ads)\n\t\twpm.updateGoogleConsentMode(wpmConsentValues.categories.analytics, wpmConsentValues.categories.ads)\n\t})\n\n\t/**\n\t * Cookie Script\n\t * If visitor accepts cookies in Cookie Script unblock the scripts\n\t * https://support.cookie-script.com/\n\t */\n\twindow.addEventListener(\"CookieScriptAcceptAll\", function (e) {\n\t\twpm.unblockAllScripts(true, true)\n\t\twpm.updateGoogleConsentMode(true, true)\n\t})\n\n\t// Complianz Cookie\n\t// If visitor accepts cookies in Complianz unblock the scripts\n\tdocument.addEventListener(\"cmplzStatusChange\", function (e) {\n\n\t\twpm.updateConsentCookieValues()\n\n\t\t// console.log(wpmConsentValues)\n\n\t\twpm.unblockAllScripts(wpmConsentValues.categories.analytics, wpmConsentValues.categories.ads)\n\t\twpm.updateGoogleConsentMode(wpmConsentValues.categories.analytics, wpmConsentValues.categories.ads)\n\t})\n\n\t// Cookie Compliance by hu-manity.co (free and pro)\n\t// If visitor accepts cookies in Cookie Notice by hu-manity.co unblock the scripts (free version)\n\t// https://wordpress.org/support/topic/events-on-consent-change/#post-15202792\n\tdocument.addEventListener(\"setCookieNotice\", function (e) {\n\n\t\twpm.updateConsentCookieValues()\n\n\t\t// console.log(wpmConsentValues)\n\n\t\twpm.unblockAllScripts(wpmConsentValues.categories.analytics, wpmConsentValues.categories.ads)\n\t\twpm.updateGoogleConsentMode(wpmConsentValues.categories.analytics, wpmConsentValues.categories.ads)\n\t})\n\n\t/**\n\t * Cookie Compliance by hu-manity.co (free and pro)\n\t * If visitor accepts cookies in Cookie Notice by hu-manity.co unblock the scripts (pro version)\n\t * https://wordpress.org/support/topic/events-on-consent-change/#post-15202792\n\t * Because Cookie Notice has no documented API or event that is being triggered on consent save or update\n\t * we have to solve this by using a mutation observer.\n\t *\n\t * @type {MutationObserver}\n\t */\n\n\twpm.huObserver = new MutationObserver(function (mutations) {\n\t\tmutations.forEach(({addedNodes}) => {\n\t\t\t[...addedNodes]\n\t\t\t\t.forEach(node => {\n\n\t\t\t\t\tif (node.id === \"hu\") {\n\n\t\t\t\t\t\tjQuery(\".hu-cookies-save\").on(\"click\", function (e) {\n\t\t\t\t\t\t\twpm.updateConsentCookieValues()\n\t\t\t\t\t\t\twpm.unblockAllScripts(wpmConsentValues.categories.analytics, wpmConsentValues.categories.ads)\n\t\t\t\t\t\t\twpm.updateGoogleConsentMode(wpmConsentValues.categories.analytics, wpmConsentValues.categories.ads)\n\t\t\t\t\t\t})\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t})\n\t})\n\n\tif (window.hu) {\n\t\twpm.huObserver.observe(document.documentElement || document.body, {childList: true, subtree: true})\n\t}\n\n\twpm.version = function () {\n\t\tconsole.log(wpmDataLayer.version)\n\t}\n\n\t// https://api.jquery.com/jquery.getscript/\n\twpm.loadScriptAndCacheIt = function (url, options) {\n\n\t\t// Allow user to set any option except for dataType, cache, and url\n\t\toptions = jQuery.extend(options || {}, {\n\t\t\tdataType: \"script\",\n\t\t\tcache : true,\n\t\t\turl : url,\n\t\t})\n\n\t\t// Use $.ajax() since it is more flexible than $.getScript\n\t\t// Return the jqXHR object so we can chain callbacks\n\t\treturn jQuery.ajax(options)\n\t}\n\n\twpm.getOrderItemPrice = function (orderItem) {\n\t\treturn (orderItem.total + orderItem.total_tax) / orderItem.quantity\n\t}\n\n\twpm.hasLoginEventFired = function () {\n\t\tlet data = wpm.getWpmSessionData()\n\t\treturn data?.loginEventFired\n\t}\n\n\twpm.setLoginEventFired = function () {\n\t\tlet data = wpm.getWpmSessionData()\n\t\tdata[\"loginEventFired\"] = true\n\t\twpm.setWpmSessionData(data)\n\t}\n\n\twpm.wpmDataLayerExists = function () {\n\t\treturn new Promise(function (resolve) {\n\t\t\t(function waitForVar() {\n\t\t\t\tif (typeof wpmDataLayer !== \"undefined\") return resolve()\n\t\t\t\tsetTimeout(waitForVar, 50)\n\t\t\t})()\n\t\t})\n\t}\n\n\twpm.pageLoaded = function () {\n\t\treturn new Promise(function (resolve) {\n\t\t\t(function waitForVar() {\n\t\t\t\tif (\"complete\" === document.readyState) return resolve()\n\t\t\t\tsetTimeout(waitForVar, 50)\n\t\t\t})()\n\t\t})\n\t}\n\n\twpm.pageReady = function () {\n\t\treturn new Promise(function (resolve) {\n\t\t\t(function waitForVar() {\n\t\t\t\tif (\"interactive\" === document.readyState || \"complete\" === document.readyState) return resolve()\n\t\t\t\tsetTimeout(waitForVar, 50)\n\t\t\t})()\n\t\t})\n\t}\n\n\twpm.isMiniCartActive = function () {\n\t\tif (window.sessionStorage) {\n\t\t\tfor (const [key, value] of Object.entries(window.sessionStorage)) {\n\t\t\t\tif (key.includes(\"wc_fragments\")) {\n\t\t\t\t\treturn true\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false\n\t\t} else {\n\t\t\treturn false\n\t\t}\n\t}\n\n\twpm.doesWooCommerceCartExist = function () {\n\t\treturn document.cookie.includes(\"woocommerce_items_in_cart\")\n\t}\n\n\twpm.urlHasParameter = function (parameter) {\n\t\tlet urlParams = new URLSearchParams(window.location.search)\n\t\treturn urlParams.has(parameter)\n\t}\n\n\t// wpm['load'] = {\n\t// base: true\n\t// };\n\n\twindow[\"wpmLoaded\"] = {}\n\n\t// return {\n\t// writeOrderIdToStorage : writeOrderIdToStorage,\n\t// isOrderIdStored : isOrderIdStored,\n\t// isEmail : isEmail,\n\t// removeProductFromCart : removeProductFromCart,\n\t// getViewItemProducts : getViewItemProducts,\n\t// addProductToCart : addProductToCart,\n\t// getCartItemsFromBackEnd: getCartItemsFromBackEnd,\n\t// fireCheckoutOption : fireCheckoutOption,\n\t// getCartItems : getCartItems\n\t// }\n\n}(window.wpm = window.wpm || {}, jQuery))\n\n\n/**\n * Run when page is ready\n * */\n\nwpm.pageReady().then(function () {\n\n\n\t/**\n\t * Run as soon as wpm namespace is loaded\n\t */\n\n\twpm.wpmDataLayerExists()\n\t\t.then(function () {\n\t\t\t// watch for products visible in viewport\n\t\t\twpm.startIntersectionObserverToWatch()\n\n\t\t\t// watch for lazy loaded products\n\t\t\twpm.startProductsMutationObserverToWatch()\n\t\t})\n\n\t// let products = jQuery(\".products, .product\")\n\n\n\t// remove_from_cart event\n\tjQuery(document).on(\"click\", \".remove_from_cart_button, .remove\", function (e) {\n\t\t// jQuery('.remove_from_cart_button, .remove').on('click', function (e) {\n\n\t\ttry {\n\t\t\t// console.log('remove_from_cart: ' + jQuery(this).data('product_id'));\n\n\t\t\tlet url = new URL(jQuery(this).attr(\"href\"))\n\t\t\tlet productId = wpm.getProductIdByCartItemKeyUrl(url)\n\n\t\t\twpm.removeProductFromCart(productId)\n\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t}\n\t})\n\n\n\t// add_to_cart event\n\tjQuery(document).on(\"click\", \".add_to_cart_button:not(.product_type_variable), .ajax_add_to_cart, .single_add_to_cart_button\", function (e) {\n\t\t// jQuery('.add_to_cart_button:not(.product_type_variable), .ajax_add_to_cart, .js-ajax-add-to-cart, .single_add_to_cart_button, .btn_color-2').on('click', function (e) {\n\n\t\ttry {\n\t\t\t// console.log('add_to_cart');\n\n\t\t\tif (wpmDataLayer.shop.page_type === \"product\") {\n\n\t\t\t\t// first process related and upsell products\n\t\t\t\tif (typeof jQuery(this).attr(\"href\") !== \"undefined\" && jQuery(this).attr(\"href\").includes(\"add-to-cart\")) {\n\t\t\t\t\t// console.log('add-to-cart on upsell and related products');\n\t\t\t\t\tlet quantity = 1\n\t\t\t\t\tlet productId = jQuery(this).data(\"product_id\")\n\t\t\t\t\t// console.log('productId: ' + productId);\n\t\t\t\t\twpm.addProductToCart(productId, quantity)\n\t\t\t\t} else {\n\n\t\t\t\t\tif (wpmDataLayer.shop.product_type === \"simple\") {\n\n\t\t\t\t\t\t// console.log('test');\n\t\t\t\t\t\tlet quantity = Number(jQuery(\".input-text.qty\").val())\n\n\t\t\t\t\t\tif (!quantity && quantity !== 0) quantity = 1\n\n\t\t\t\t\t\tlet productId = jQuery(this).val()\n\n\t\t\t\t\t\t// console.log('productId: ' + productId);\n\t\t\t\t\t\t// console.log('quantity: ' + quantity);\n\n\t\t\t\t\t\twpm.addProductToCart(productId, quantity)\n\n\t\t\t\t\t} else if (wpmDataLayer.shop.product_type === \"variable\") {\n\n\t\t\t\t\t\t// console.log('variable');\n\n\t\t\t\t\t\tlet quantity = Number(jQuery(\".input-text.qty\").val())\n\n\t\t\t\t\t\tif (!quantity && quantity !== 0) quantity = 1\n\n\t\t\t\t\t\tlet productId = jQuery(\"[name='variation_id']\").val()\n\n\t\t\t\t\t\t// console.log('productId: ' + productId);\n\t\t\t\t\t\t// console.log('quantity: ' + quantity);\n\n\t\t\t\t\t\twpm.addProductToCart(productId, quantity)\n\n\t\t\t\t\t} else if (wpmDataLayer.shop.product_type === \"grouped\") {\n\n\t\t\t\t\t\t// console.log('grouped');\n\n\t\t\t\t\t\tjQuery(\".woocommerce-grouped-product-list-item\").each(function () {\n\n\t\t\t\t\t\t\tlet quantity = Number(jQuery(this).find(\".input-text.qty\").val())\n\n\t\t\t\t\t\t\tif (!quantity && quantity !== 0) quantity = 1\n\n\t\t\t\t\t\t\tlet classes = jQuery(this).attr(\"class\")\n\t\t\t\t\t\t\tlet productId = wpm.getPostIdFromString(classes)\n\n\t\t\t\t\t\t\t// console.log('productId: ' + productId);\n\t\t\t\t\t\t\t// console.log('quantity: ' + quantity);\n\n\t\t\t\t\t\t\twpm.addProductToCart(productId, quantity)\n\t\t\t\t\t\t})\n\t\t\t\t\t} else if (wpmDataLayer.shop.product_type === \"bundle\") {\n\n\t\t\t\t\t\t// console.log('bundle');\n\n\t\t\t\t\t\tlet quantity = Number(jQuery(\".input-text.qty\").val())\n\n\t\t\t\t\t\tif (!quantity && quantity !== 0) quantity = 1\n\n\t\t\t\t\t\tlet productId = jQuery(\"input[name=add-to-cart]\").val()\n\n\t\t\t\t\t\t// console.log('productId: ' + productId);\n\t\t\t\t\t\t// console.log('quantity: ' + quantity);\n\n\t\t\t\t\t\twpm.addProductToCart(productId, quantity)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\n\t\t\t\t// console.log('non product page');\n\n\t\t\t\tlet quantity = 1\n\t\t\t\tlet productId = jQuery(this).data(\"product_id\")\n\t\t\t\t// console.log('productId: ' + productId);\n\t\t\t\twpm.addProductToCart(productId, quantity)\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t}\n\t})\n\n\t// if someone clicks anywhere on a custom /?add-to-cart=123 link\n\t// trigger the add to cart event\n\t// body.one('click', function (e) {\n\t//\n\t// try {\n\t// if (jQuery(this)[0].URL) {\n\t//\n\t// let href = new URL(jQuery(this)[0].URL);\n\t// let searchParams = new URLSearchParams(href.search);\n\t//\n\t// if (searchParams.has('add-to-cart')) {\n\t// // console.log('non product page, /?add-to-cart=123 link');\n\t//\n\t// let productId = searchParams.get('add-to-cart');\n\t// wpm.addProductToCart(productId, 1);\n\t// }\n\t// }\n\t// } catch (e) {\n\t// console.error(e);\n\t// }\n\t// });\n\n\n\t/**\n\t * If someone clicks anywhere on a custom /?add-to-cart=123 link\n\t * trigger the add to cart event\n\t */\n\tjQuery(document).one(\"click\", \"a:not(.add_to_cart_button, .ajax_add_to_cart, .single_add_to_cart_button)\", function (event) {\n\t\t// jQuery('a:not(.add_to_cart_button, .ajax_add_to_cart, .single_add_to_cart_button)').one('click', function (event) {\n\n\t\ttry {\n\t\t\tif (jQuery(event.target).closest(\"a\").attr(\"href\")) {\n\n\t\t\t\tlet href = jQuery(event.target).closest(\"a\").attr(\"href\")\n\n\t\t\t\tif (href.includes(\"add-to-cart=\")) {\n\t\t\t\t\tlet matches = href.match(/(add-to-cart=)(\\d+)/)\n\t\t\t\t\t// console.log('pid: ' + matches[2])\n\t\t\t\t\tif (matches) wpm.addProductToCart(matches[2], 1)\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t}\n\t})\n\n\t// select_content GA UA event\n\t// select_item GA 4 event\n\t// jQuery(document).on('click', '.woocommerce-LoopProduct-link, .wc-block-grid__product, .product-small.box', function (e) {\n\tjQuery(document).on(\"click\", \".woocommerce-LoopProduct-link, .wc-block-grid__product, .product, .product-small, .type-product\", function (e) {\n\t\t// jQuery('.woocommerce-LoopProduct-link, .wc-block-grid__product, .product, .product-small, .type-product').on('click', function (e) {\n\n\t\ttry {\n\n\t\t\t/**\n\t\t\t *\n\t\t\t * On some pages the event fires multiple times, and on product pages\n\t\t\t * even on page load. Using e.stopPropagation helps to prevent this,\n\t\t\t * but I dont know why. We don't even have to use this, since only a real\n\t\t\t * product click yields a valid productId. So we filter the invalid click\n\t\t\t * events out later down the code. I'll keep it that way because this is\n\t\t\t * the most compatible way across shops.\n\t\t\t * e.stopPropagation();\n\t\t\t * */\n\n\t\t\t\t// console.log('select_content and select_item');\n\n\t\t\tlet productId = jQuery(this).nextAll(\".wpmProductId:first\").data(\"id\")\n\t\t\t// console.log('select_content and select_item: ' + productId);\n\n\n\t\t\t/**\n\t\t\t * On product pages, for some reason, the click event is triggered on the main product on page load.\n\t\t\t * In that case no ID is found. But we can discard it, since we only want to trigger the event on\n\t\t\t * related products, which are found below.\n\t\t\t */\n\n\t\t\tif (productId) {\n\n\t\t\t\t// console.log('select_content and select_item: ' + productId);\n\n\t\t\t\tproductId = getIdBasedOndVariationsOutputSetting(productId)\n\n\t\t\t\tif (!productId) throw Error(\"Wasn't able to retrieve a productId\")\n\n\t\t\t\t// console.log('prodid: ' + productId);\n\n\t\t\t\tif (wpmDataLayer.products && wpmDataLayer.products[productId]) {\n\n\t\t\t\t\tlet product = wpm.getProductDetailsFormattedForEvent(productId)\n\n\t\t\t\t\tjQuery(document).trigger(\"wpmSelectContentGaUa\", product)\n\t\t\t\t\tjQuery(document).trigger(\"wpmSelectItem\", product)\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t}\n\t})\n\n\t// begin_checkout event\n\tjQuery(document).one(\"click\", \".checkout-button, .cart-checkout-button, .button.checkout\", function (e) {\n\t\t// jQuery('.checkout-button, .cart-checkout-button, .button.checkout').one('click', function (e) {\n\t\t// console.log('begin_checkout');\n\n\t\tjQuery(document).trigger(\"wpmBeginCheckout\")\n\t})\n\n\n\t// checkout_progress event\n\t// track checkout option event: entered valid billing email\n\tjQuery(document).on(\"input\", \"#billing_email\", function () {\n\t\t// jQuery('#billing_email').on('input', function () {\n\n\t\tif (wpm.isEmail(jQuery(this).val())) {\n\t\t\t// wpm.fireCheckoutOption(2);\n\t\t\twpm.fireCheckoutProgress(2)\n\t\t\twpm.emailSelected = true\n\t\t}\n\t})\n\n\t// track checkout option event: purchase click\n\tjQuery(document).on(\"click\", \".wc_payment_methods\", function () {\n\t\t// jQuery('.wc_payment_methods').on('click', function () {\n\n\t\tif (false === wpm.paymentMethodSelected) {\n\t\t\twpm.fireCheckoutProgress(3)\n\t\t}\n\n\t\twpm.fireCheckoutOption(3, jQuery(\"input[name='payment_method']:checked\").val())\n\t\twpm.paymentMethodSelected = true\n\t})\n\n\t// track checkout option event: purchase click\n\tjQuery(document).one(\"click\", \"#place_order\", function () {\n\t\t// jQuery('#place_order').one('click', function () {\n\n\t\tif (false === wpm.emailSelected) {\n\t\t\twpm.fireCheckoutProgress(2)\n\t\t}\n\n\t\tif (false === wpm.paymentMethodSelected) {\n\t\t\twpm.fireCheckoutProgress(3)\n\t\t\twpm.fireCheckoutOption(3, jQuery(\"input[name='payment_method']:checked\").val())\n\t\t}\n\n\t\twpm.fireCheckoutProgress(4)\n\t})\n\n\t// update cart event\n\tjQuery(document).on(\"click\", \"[name='update_cart']\", function (e) {\n\t\t// jQuery(\"[name='update_cart']\").on('click', function (e) {\n\n\t\ttry {\n\t\t\tjQuery(\".cart_item\").each(function () {\n\n\t\t\t\t// let productId = jQuery(this).find('[data-product_id]').data('product_id');\n\n\t\t\t\tlet url = new URL(jQuery(this).find(\".product-remove\").find(\"a\").attr(\"href\"))\n\t\t\t\tlet productId = wpm.getProductIdByCartItemKeyUrl(url)\n\n\n\t\t\t\tlet quantity = jQuery(this).find(\".qty\").val()\n\n\t\t\t\tif (quantity === 0) {\n\t\t\t\t\twpm.removeProductFromCart(productId)\n\t\t\t\t} else if (quantity < wpmDataLayer.cart[productId].quantity) {\n\t\t\t\t\twpm.removeProductFromCart(productId, wpmDataLayer.cart[productId].quantity - quantity)\n\t\t\t\t} else if (quantity > wpmDataLayer.cart[productId].quantity) {\n\t\t\t\t\twpm.addProductToCart(productId, quantity - wpmDataLayer.cart[productId].quantity)\n\t\t\t\t}\n\t\t\t})\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t\twpm.getCartItemsFromBackend()\n\t\t}\n\t})\n\n\n\t// add_to_wishlist\n\tjQuery(document).on(\"click\", \".add_to_wishlist, .wl-add-to\", function () {\n\t\t// jQuery('.add_to_wishlist, .wl-add-to').on('click', function () {\n\n\t\ttry {\n\t\t\t// console.log('add_to_wishlist');\n\t\t\t// console.log('this:' + jQuery(this).data('product-id'));\n\n\t\t\tlet productId\n\n\t\t\tif (jQuery(this).data(\"productid\")) { // for the WooCommerce wishlist plugin\n\t\t\t\tproductId = jQuery(this).data(\"productid\")\n\t\t\t} else if (jQuery(this).data(\"product-id\")) { // for the YITH wishlist plugin\n\t\t\t\tproductId = jQuery(this).data(\"product-id\")\n\t\t\t}\n\n\t\t\tif (!productId) throw Error(\"Wasn't able to retrieve a productId\")\n\n\t\t\tlet product = wpm.getProductDetailsFormattedForEvent(productId)\n\n\t\t\t// console.log('add_to_wishlist');\n\t\t\t// console.log(product);\n\n\t\t\tjQuery(document).trigger(\"wpmAddToWishlist\", product)\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t}\n\t})\n\n\tjQuery(document).on(\"updated_cart_totals\", function () {\n\t\tjQuery(document).trigger(\"wpmViewCart\")\n\t})\n\n\n\t/**\n\t * Called when the user selects all the required dropdowns / attributes\n\t *\n\t * Has to be hooked after document ready\n\t *\n\t * https://stackoverflow.com/a/27849208/4688612\n\t * https://stackoverflow.com/a/65065335/4688612\n\t */\n\tjQuery(\".single_variation_wrap\").on(\"show_variation\", function (event, variation) {\n\n\t\ttry {\n\t\t\tlet productId = getIdBasedOndVariationsOutputSetting(variation.variation_id)\n\n\t\t\tif (!productId) throw Error(\"Wasn't able to retrieve a productId\")\n\n\t\t\tif (wpmDataLayer.products && wpmDataLayer.products[productId]) {\n\n\t\t\t\t// console.log('productId: ' + productId);\n\n\t\t\t\tlet product = wpm.getProductDetailsFormattedForEvent(productId)\n\n\t\t\t\tjQuery(document).trigger(\"wpmViewItem\", product)\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t}\n\t})\n\n\t/**\n\t * Called on variable products when no selection has been done yet\n\t * or when the visitor deselects his choice.\n\t *\n\t * Has to be hooked after document ready\n\t */\n\n\tjQuery(\".single_variation_wrap\").on(\"hide_variation\", function (event, data) {\n\n\t\ttry {\n\t\t\tlet classes = jQuery(\"body\").attr(\"class\")\n\t\t\tlet productId = classes.match(/(postid-)(\\d+)/)[2]\n\n\t\t\tif (!productId) throw Error(\"Wasn't able to retrieve a productId\")\n\n\t\t\t/**\n\t\t\t * If we have a variable product with no preset,\n\t\t\t * and variations output is enabled,\n\t\t\t * then we send a viewItem event with the first\n\t\t\t * variation we find for the parent.\n\t\t\t * If variations output is disabled,\n\t\t\t * we just send the parent ID.\n\t\t\t */\n\t\t\tif (\n\t\t\t\t\"variable\" === wpmDataLayer.shop.product_type &&\n\t\t\t\twpmDataLayer?.general?.variationsOutput\n\t\t\t) {\n\t\t\t\tfor (const [key, product] of Object.entries(wpmDataLayer.products)) {\n\t\t\t\t\tif (\"parentId\" in product) {\n\t\t\t\t\t\t// console.log('pid: ' + value.parentId)\n\t\t\t\t\t\tproductId = product.id\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (wpmDataLayer.products && wpmDataLayer.products[productId]) {\n\n\t\t\t\t// console.log('productId: ' + productId);\n\n\t\t\t\tlet product = wpm.getProductDetailsFormattedForEvent(productId)\n\n\t\t\t\tjQuery(document).trigger(\"wpmViewItem\", product)\n\t\t\t}\n\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t}\n\t})\n\n}) // End document ready wrap\n\n/**\n * Set up wpm events\n */\n\n\n// populate the wpmDataLayer with the cart items\njQuery(window).on(\"wpmLoad\", function () {\n\n\ttry {\n\t\t// When a new session is initiated there are no items in the cart,\n\t\t// so we can save the call to get the cart items\n\t\tif (wpm.doesWooCommerceCartExist()) wpm.getCartItems()\n\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n\n// get all add-to-cart= products from backend\njQuery(window).on(\"wpmLoad\", function () {\n\n\twpmDataLayer.products = wpmDataLayer.products || {}\n\n\t// scan page for add-to-cart= links\n\tlet productIds = wpm.getAddToCartLinkProductIds()\n\n\twpm.getProductsFromBackend(productIds)\n})\n\n/**\n * Save the referrer into a cookie\n */\n\njQuery(window).on(\"wpmLoad\", function () {\n\n\t// can't use session storage as we can't read it from the server\n\tif (!wpm.getCookie(\"wpmReferrer\")) {\n\n\t\tif (document.referrer) {\n\t\t\tlet referrerUrl = new URL(document.referrer)\n\t\t\tlet referrerHostname = referrerUrl.hostname\n\n\t\t\tif (referrerHostname !== window.location.host) {\n\t\t\t\twpm.setCookie(\"wpmReferrer\", referrerHostname)\n\t\t\t} else {\n\t\t\t\twpm.setCookie(\"wpmReferrer\", \"\")\n\t\t\t}\n\n\t\t} else {\n\t\t\twpm.setCookie(\"wpmReferrer\", \"\")\n\t\t}\n\t}\n})\n\n\n/**\n * Create our own load event in order to better handle script flow execution when JS \"optimizers\" shuffle the code.\n */\n\njQuery(window).on(\"wpmLoad\", function () {\n\ttry {\n\t\tif (typeof wpmDataLayer != \"undefined\" && !wpmDataLayer?.wpmLoadFired) {\n\n\t\t\tjQuery(document).trigger(\"wpmLoadAlways\")\n\n\t\t\tif (\"product\" === wpmDataLayer.shop.page_type && wpmDataLayer.shop.product_type !== \"variable\" && wpm.getMainProductIdFromProductPage()) {\n\n\t\t\t\tlet product = wpm.getProductDataForViewItemEvent(wpm.getMainProductIdFromProductPage())\n\t\t\t\tjQuery(document).trigger(\"wpmViewItem\", product)\n\n\t\t\t} else if (\"product_category\" === wpmDataLayer.shop.page_type) {\n\n\t\t\t\tjQuery(document).trigger(\"wpmCategory\")\n\n\t\t\t} else if (\"search\" === wpmDataLayer.shop.page_type) {\n\n\t\t\t\tjQuery(document).trigger(\"wpmSearch\")\n\n\t\t\t} else if (\"cart\" === wpmDataLayer.shop.page_type) {\n\n\t\t\t\tjQuery(document).trigger(\"wpmViewCart\")\n\n\t\t\t} else if (\"order_received_page\" === wpmDataLayer.shop.page_type && wpmDataLayer.order) {\n\n\t\t\t\tif (!wpm.isOrderIdStored(wpmDataLayer.order.id)) {\n\n\t\t\t\t\tjQuery(document).trigger(\"wpmOrderReceivedPage\")\n\t\t\t\t\twpm.writeOrderIdToStorage(wpmDataLayer.order.id)\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tjQuery(document).trigger(\"wpmEverywhereElse\")\n\t\t\t}\n\n\t\t\tif (wpmDataLayer?.user?.id && !wpm.hasLoginEventFired()) {\n\t\t\t\tjQuery(document).trigger(\"wpmLogin\")\n\t\t\t\twpm.setLoginEventFired()\n\t\t\t}\n\n\t\t\t// /**\n\t\t\t// * Load mini cart fragments into a wpm session storage key,\n\t\t\t// * after the document load event.\n\t\t\t// */\n\t\t\t// jQuery(document).ajaxSend(function (event, jqxhr, settings) {\n\t\t\t// \t// console.log('settings.url: ' + settings.url);\n\t\t\t//\n\t\t\t// \tif (settings.url.includes(\"get_refreshed_fragments\") && sessionStorage) {\n\t\t\t// \t\tif (!sessionStorage.getItem(\"wpmMiniCartActive\")) {\n\t\t\t// \t\t\tsessionStorage.setItem(\"wpmMiniCartActive\", JSON.stringify(true))\n\t\t\t// \t\t}\n\t\t\t// \t}\n\t\t\t// })\n\n\t\t\twpmDataLayer.wpmLoadFired = true\n\t\t}\n\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n\n// jQuery(window).on(\"load\", function () {\n// \tjQuery(document).trigger(\"wpmLoad\", {})\n// })\n\njQuery(window).on(\"wpmPreLoadPixels\", function () {\n\n\tif (wpmDataLayer?.shop?.cookie_consent_mgmt?.explicit_consent) {\n\t\twpm.updateConsentCookieValues(true)\n\t}\n\tjQuery(document).trigger(\"wpmLoadPixels\", {})\n})\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","/**\n * Load all free scripts first\n */\n\nrequire(\"./wpm\")\n\n/**\n * Load all free scripts\n */\n\nrequire(\"./google\")\nrequire(\"./google-ga-ua\")\nrequire(\"./google-ga-4\")\nrequire(\"./google-ads\")\nrequire(\"./facebook\")\nrequire(\"./hotjar\")\nrequire(\"./google-optimize\")\n\n/**\n * Execute the wpm loader. It makes sure that the script flow gets exectuded correctly, no matter how JS \"optimizers\" shuffle the code.\n */\n\nrequire(\"./wpm-loader\")\n\n// console.log('WooCommerce Pixel Manager free version')\n\n\n"],"names":["wpm","$","undefined","fBUserData","loadFacebookPixel","wpmDataLayer","pixels","facebook","pixel_id","loaded","f","window","b","document","e","fbq","n","callMethod","apply","arguments","queue","push","_fbq","version","t","createElement","async","src","s","getElementsByTagName","parentNode","insertBefore","console","error","getRandomEventId","Math","random","toString","substring","getFbUserData","getFbUserDataFromBrowser","setFbUserData","fbp","getCookie","fbc","client_user_agent","navigator","userAgent","fbViewContent","product","eventId","content_type","content_name","name","content_ids","dyn_r_ids","dynamic_remarketing","id_type","currency","shop","value","price","eventID","jQuery","trigger","event_name","event_id","user_data","product_data","product_id","event_source_url","location","href","facebookContentIds","prodIds","key","item","Object","entries","order","items","general","variationsOutput","variation_id","String","products","id","on","canIFire","event","parseFloat","quantity","value_filtered","conversionIdentifiers","getGoogleAdsConversionIdentifiersWithLabel","google","ads","conversionIds","getGoogleAdsConversionIdentifiers","getGoogleAdsRegularOrderItems","orderItems","orderItem","getGoogleAdsDynamicRemarketingOrderItems","google_business_vertical","isEmptyObject","status","googleConfigConditionsMet","isVariable","send_events_with_parent_ids","gtagLoaded","then","gtag","send_to","data_basic","data_with_cart","transaction_id","number","new_customer","aw_merchant_id","discount","aw_feed_country","aw_feed_language","getGA4OrderItems","item_name","item_category","category","join","item_id","analytics","item_variant","variant_name","item_brand","brand","ga4","measurement_id","mp_active","affiliation","value_regular","tax","shipping","coupon","getGAUAOrderItems","list_position","variant","universal","property_id","load_google_optimize_pixel","optimize","container_id","loadScriptAndCacheIt","type","consent_mode","active","getConsentValues","mode","categories","includes","getVisitorConsentStatusAndUpdateGoogleConsentSettings","google_consent_settings","analytics_storage","ad_storage","updateGoogleConsentMode","cookie_consent_mgmt","explicit_consent","fireGtagGoogleAds","state","enhanced_conversions","phone_conversion_label","phone_conversion_number","keys","page_type","enhanced_conversion_data","fireGtagGoogleAnalyticsUA","parameters","fireGtagGoogleAnalyticsGA4","isGoogleActive","getGoogleGtagId","loadGoogle","done","script","textStatus","dataLayer","wait_for_update","region","ads_data_redaction","url_passthrough","linker","settings","Date","canGoogleLoad","Promise","resolve","reject","startTime","wait","setTimeout","load_hotjar_pixel","h","o","a","r","hotjar","site_id","hj","q","_hjSettings","hjid","hjsv","appendChild","wpmDataLayerExists","pageLoaded","wpmDeduper","wpmRestSettings","checkCookie","emailSelected","paymentMethodSelected","useRestEndpoint","isSessionStorageAvailable","isRestEndpointAvailable","isBelowRestErrorThreshold","sessionStorage","getItem","JSON","parse","testEndpoint","url","protocol","host","cookieName","ajax","timeout","statusCode","response","setItem","stringify","isWpmRestEndpointAvailable","writeOrderIdToStorage","orderId","Storage","localStorage","ids","expiresDate","setDate","getDate","cookie","toUTCString","storeOrderIdOnServer","orderDeduplication","isOrderIdStored","log","isEmail","email","test","removeProductFromCart","productId","quantityToRemove","Error","getIdBasedOndVariationsOutputSetting","cart","getProductDetailsFormattedForEvent","isVariation","parentId","addProductToCart","getCartItemsFromBackend","getCartItems","saveCartObjectToDataLayer","data","action","dataType","ajax_url","success","cartItems","getProductsFromBackend","productIds","filter","hasOwnProperty","length","assign","cartObject","fireCheckoutOption","step","checkout_option","fireCheckoutProgress","getPostIdFromString","string","match","triggerViewItemList","getProductDataForViewItemEvent","getMainProductIdFromProductPage","indexOf","product_type","viewItemListTriggerTestMode","target","css","append","find","viewItemListTrigger","opacity","backgroundColor","getSearchTermFromUrl","URLSearchParams","search","get","io","ioTimeouts","observerCallback","observer","forEach","entry","elementId","next","isIntersecting","testMode","repeat","unobserve","clearTimeout","remove","allIoElementsToWatch","ioid","startIntersectionObserverToWatch","urlHasParameter","IntersectionObserver","threshold","map","i","elem","parent","hasClass","prev","this","closest","each","observe","startProductsMutationObserverToWatch","productsNode","parents","has","first","productsMutationObserver","attributes","childList","characterData","MutationObserver","mutations","mutation","newNodes","addedNodes","hasWpmProductIdElement","siblings","setCookie","cookieValue","expiryDays","d","setTime","getTime","expires","ca","decodeURIComponent","split","c","charAt","getWpmSessionData","setWpmSessionData","order_id","nonce","getProductIdByCartItemKeyUrl","cartItemKey","cartItemKeys","getAddToCartLinkProductIds","attr","matches","list_name","position","parentId_dyn_r_ids","setReferrerToCookie","referrer","getReferrerFromCookie","getClidFromBrowser","clidCookieId","clidId","gclid","dclid","getUserAgent","getViewPort","width","max","documentElement","clientWidth","innerWidth","height","clientHeight","innerHeight","getComplianzCookies","cmplz_statistics","cmplz_marketing","visitorHasChosen","getCookieLawInfoCookies","analyticsCookie","adsCookie","wpmConsentValues","setConsentValueCategories","updateConsentCookieValues","explicitConsent","decodeURI","consents","statistics","marketing","thirdparty","advanced","setConsentDefaultValuesToExplicit","pixelName","canIFireMode","scriptTagObserver","node","shouldScriptBeActive","unblockScript","blockScript","head","subtree","addEventListener","disconnect","some","element","scriptNode","removeAttach","wpmSrc","appendTo","removeAttr","unblockAllScripts","index","unblockSelectedPixels","Cookiebot","consent","detail","huObserver","hu","body","options","extend","cache","getOrderItemPrice","total","total_tax","hasLoginEventFired","loginEventFired","setLoginEventFired","waitForVar","readyState","pageReady","isMiniCartActive","doesWooCommerceCartExist","parameter","URL","Number","val","classes","one","nextAll","variation","referrerHostname","hostname","wpmLoadFired","user","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","exports","module","__webpack_modules__","require"],"sourceRoot":""}
js/public/wpm-public__premium_only.p1.min.js ADDED
@@ -0,0 +1,2 @@
 
 
1
+ (()=>{var e={785:()=>{!function(e,t,a){let o;e.loadFacebookPixel=function(){try{var e,t,a;null!==(e=wpmDataLayer)&&void 0!==e&&null!==(t=e.pixels)&&void 0!==t&&null!==(a=t.facebook)&&void 0!==a&&a.pixel_id&&(wpmDataLayer.pixels.facebook.loaded=!0,o=window,r=document,i="script",o.fbq||(n=o.fbq=function(){n.callMethod?n.callMethod.apply(n,arguments):n.queue.push(arguments)},o._fbq||(o._fbq=n),n.push=n,n.loaded=!0,n.version="2.0",n.queue=[],(l=r.createElement(i)).async=!0,l.src="https://connect.facebook.net/en_US/fbevents.js",(d=r.getElementsByTagName(i)[0]).parentNode.insertBefore(l,d)),fbq("init",wpmDataLayer.pixels.facebook.pixel_id),fbq("track","PageView"))}catch(i){console.error(i)}var o,r,i,n,l,d},e.getRandomEventId=function(){return(Math.random()+1).toString(36).substring(2)},e.getFbUserData=function(){return o||e.getFbUserDataFromBrowser()},e.setFbUserData=function(){o=e.getFbUserDataFromBrowser()},e.getFbUserDataFromBrowser=function(){return{fbp:e.getCookie("_fbp"),fbc:e.getCookie("_fbc"),client_user_agent:navigator.userAgent}},e.fbViewContent=function(t){try{var a,o,r;if(null===(a=wpmDataLayer)||void 0===a||null===(o=a.pixels)||void 0===o||null===(r=o.facebook)||void 0===r||!r.loaded)return;let i=e.getRandomEventId();fbq("track","ViewContent",{content_type:"product",content_name:t.name,content_ids:t.dyn_r_ids[wpmDataLayer.pixels.facebook.dynamic_remarketing.id_type],currency:wpmDataLayer.shop.currency,value:t.price},{eventID:i}),t.currency=wpmDataLayer.shop.currency,jQuery(document).trigger("wpmFbCapiEvent",{event_name:"ViewContent",event_id:i,user_data:e.getFbUserData(),product_data:t,product_id:t.dyn_r_ids[wpmDataLayer.pixels.facebook.dynamic_remarketing.id_type],event_source_url:window.location.href})}catch(e){console.error(e)}},e.facebookContentIds=function(){let e=[];for(const[o,r]of Object.entries(wpmDataLayer.order.items)){var t,a;null!==(t=wpmDataLayer)&&void 0!==t&&null!==(a=t.general)&&void 0!==a&&a.variationsOutput&&0!==r.variation_id?e.push(String(wpmDataLayer.products[r.variation_id].dyn_r_ids[wpmDataLayer.pixels.facebook.dynamic_remarketing.id_type])):e.push(String(wpmDataLayer.products[r.id].dyn_r_ids[wpmDataLayer.pixels.facebook.dynamic_remarketing.id_type]))}return e}}(window.wpm=window.wpm||{},jQuery),jQuery(document).on("wpmLoadPixels",(function(){var e,t,a;!wpm.canIFire("ads","facebook-ads")||null!==(e=wpmDataLayer)&&void 0!==e&&null!==(t=e.pixels)&&void 0!==t&&null!==(a=t.facebook)&&void 0!==a&&a.loaded||wpm.loadFacebookPixel()})),jQuery(document).on("wpmAddToCart",(function(e,t){try{var a,o,r;if(null===(a=wpmDataLayer)||void 0===a||null===(o=a.pixels)||void 0===o||null===(r=o.facebook)||void 0===r||!r.loaded)return;let e=wpm.getRandomEventId();fbq("track","AddToCart",{content_type:"product",content_name:t.name,content_ids:t.dyn_r_ids[wpmDataLayer.pixels.facebook.dynamic_remarketing.id_type],value:parseFloat(t.quantity*t.price),currency:t.currency},{eventID:e}),t.currency=wpmDataLayer.shop.currency,jQuery(document).trigger("wpmFbCapiEvent",{event_name:"AddToCart",event_id:e,user_data:wpm.getFbUserData(),product_data:t,product_id:t.dyn_r_ids[wpmDataLayer.pixels.facebook.dynamic_remarketing.id_type],event_source_url:window.location.href})}catch(e){console.error(e)}})),jQuery(document).on("wpmBeginCheckout",(function(e){try{var t,a,o;if(null===(t=wpmDataLayer)||void 0===t||null===(a=t.pixels)||void 0===a||null===(o=a.facebook)||void 0===o||!o.loaded)return;let e=wpm.getRandomEventId();fbq("track","InitiateCheckout",{},{eventID:e}),jQuery(document).trigger("wpmFbCapiEvent",{event_name:"InitiateCheckout",event_id:e,user_data:wpm.getFbUserData(),event_source_url:window.location.href})}catch(e){console.error(e)}})),jQuery(document).on("wpmAddToWishlist",(function(e,t){try{var a,o,r;if(null===(a=wpmDataLayer)||void 0===a||null===(o=a.pixels)||void 0===o||null===(r=o.facebook)||void 0===r||!r.loaded)return;let e=wpm.getRandomEventId();fbq("track","AddToWishlist",{content_type:"product",content_name:t.name,content_ids:t.dyn_r_ids[wpmDataLayer.pixels.facebook.dynamic_remarketing.id_type],value:parseFloat(t.quantity*t.price),currency:t.currency},{eventID:e}),t.currency=wpmDataLayer.shop.currency,jQuery(document).trigger("wpmFbCapiEvent",{event_name:"AddToWishlist",event_id:e,user_data:wpm.getFbUserData(),product_data:t,product_id:t.dyn_r_ids[wpmDataLayer.pixels.facebook.dynamic_remarketing.id_type],event_source_url:window.location.href})}catch(e){console.error(e)}})),jQuery(document).on("wpmViewItem",(function(e,t){try{var a,o,r;if(null===(a=wpmDataLayer)||void 0===a||null===(o=a.pixels)||void 0===o||null===(r=o.facebook)||void 0===r||!r.loaded)return;wpm.fbViewContent(t)}catch(e){console.error(e)}})),jQuery(document).on("wpmSearch",(function(){try{var e,t,a;if(null===(e=wpmDataLayer)||void 0===e||null===(t=e.pixels)||void 0===t||null===(a=t.facebook)||void 0===a||!a.loaded)return;let o=wpm.getRandomEventId();fbq("track","Search",{},{eventID:o}),jQuery(document).trigger("wpmFbCapiEvent",{event_name:"Search",event_id:o,user_data:wpm.getFbUserData(),event_source_url:window.location.href})}catch(e){console.error(e)}})),jQuery(document).on("wpmLoadAlways",(function(){try{var e,t,a;if(null===(e=wpmDataLayer)||void 0===e||null===(t=e.pixels)||void 0===t||null===(a=t.facebook)||void 0===a||!a.loaded)return;wpm.setFbUserData()}catch(e){console.error(e)}})),jQuery(document).on("wpmOrderReceivedPage",(function(){try{var e,t,a;if(null===(e=wpmDataLayer)||void 0===e||null===(t=e.pixels)||void 0===t||null===(a=t.facebook)||void 0===a||!a.loaded)return;fbq("track","Purchase",{content_type:"product",value:wpmDataLayer.order.value_filtered,currency:wpmDataLayer.order.currency,content_ids:wpm.facebookContentIds()},{eventID:wpmDataLayer.order.id})}catch(e){console.error(e)}}))},317:()=>{!function(e,t,a){e.setFacebookIdentifiersOnServer=function(){try{let t={action:"wpm_facebook_set_session_identifiers",nonce:e.nonce,fbp:e.getCookie("_fbp"),fbc:e.getCookie("_fbc")};if(t.fbp&&window.sessionStorage&&window.sessionStorage.getItem("wpm_fb_session_id_"+t.fbp+"_set"))return;jQuery.ajax({type:"post",dataType:"json",url:e.ajax_url,data:t,success:function(e){window.sessionStorage&&!0===e.success&&window.sessionStorage.setItem("wpm_fb_session_id_"+t.fbp+"_set",JSON.stringify(!0))},error:function(e){}})}catch(e){console.error(e)}}}(window.wpm=window.wpm||{},jQuery),jQuery(document).on("wpmAddToWishlist",(function(e,t){try{var a,o,r;if(null===(a=wpmDataLayer)||void 0===a||null===(o=a.pixels)||void 0===o||null===(r=o.facebook)||void 0===r||!r.loaded)return;fbq("track","AddToWishlist",{content_name:t.name,content_category:t.category,content_ids:t.dyn_r_ids[wpmDataLayer.pixels.facebook.dynamic_remarketing.id_type],currency:t.currency,value:t.price})}catch(e){console.error(e)}})),jQuery(document).on("wpmFbCapiEvent",(function(e,t){try{if(!wpmDataLayer.pixels.facebook.capi)return;let e={action:"wpm_facebook_capi_event",data:t,nonce:wpm.nonce};jQuery.ajax({type:"post",dataType:"json",url:wpm.ajax_url,data:e,success:function(e){},error:function(e){}})}catch(e){console.error(e)}})),jQuery(window).on("wpmLoadAlways",(function(){try{var e,t,a;null!==(e=wpmDataLayer)&&void 0!==e&&null!==(t=e.pixels)&&void 0!==t&&null!==(a=t.facebook)&&void 0!==a&&a.pixel_id&&wpmDataLayer.pixels.facebook.capi&&["cart","checkout"].indexOf(wpmDataLayer.shop.page_type)>=0&&wpm.setFacebookIdentifiersOnServer()}catch(e){console.error(e)}}))},234:()=>{!function(e,t,a){let o=[];e.getGoogleAdsConversionIdentifiersWithLabel=function(){for(const[e,t]of Object.entries(wpmDataLayer.pixels.google.ads.conversionIds))o.push(e+"/"+t);return o},e.getGoogleAdsConversionIdentifiers=function(){let e=[];for(const[t,a]of Object.entries(wpmDataLayer.pixels.google.ads.conversionIds))e.push(t);return e},e.getGoogleAdsRegularOrderItems=function(){let e=[];for(const[o,r]of Object.entries(wpmDataLayer.order.items)){var t,a;let o;o={quantity:r.quantity,price:r.price},null!==(t=wpmDataLayer)&&void 0!==t&&null!==(a=t.general)&&void 0!==a&&a.variationsOutput&&0!==r.variation_id?(o.id=String(wpmDataLayer.products[r.variation_id].dyn_r_ids[wpmDataLayer.pixels.google.ads.dynamic_remarketing.id_type]),e.push(o)):(o.id=String(wpmDataLayer.products[r.id].dyn_r_ids[wpmDataLayer.pixels.google.ads.dynamic_remarketing.id_type]),e.push(o))}return e},e.getGoogleAdsDynamicRemarketingOrderItems=function(){let e=[];for(const[o,r]of Object.entries(wpmDataLayer.order.items)){var t,a;let o;o={quantity:r.quantity,price:r.price,google_business_vertical:wpmDataLayer.pixels.google.ads.google_business_vertical},null!==(t=wpmDataLayer)&&void 0!==t&&null!==(a=t.general)&&void 0!==a&&a.variationsOutput&&0!==r.variation_id?(o.id=String(wpmDataLayer.products[r.variation_id].dyn_r_ids[wpmDataLayer.pixels.google.ads.dynamic_remarketing.id_type]),e.push(o)):(o.id=String(wpmDataLayer.products[r.id].dyn_r_ids[wpmDataLayer.pixels.google.ads.dynamic_remarketing.id_type]),e.push(o))}return e}}(window.wpm=window.wpm||{},jQuery),jQuery(document).on("wpmViewItemList",(function(e,t){try{var a,o,r,i,n,l,d,s,c,u,p;if(jQuery.isEmptyObject(null===(a=wpmDataLayer)||void 0===a||null===(o=a.pixels)||void 0===o||null===(r=o.google)||void 0===r||null===(i=r.ads)||void 0===i?void 0:i.conversionIds))return;if(null===(n=wpmDataLayer)||void 0===n||null===(l=n.pixels)||void 0===l||null===(d=l.google)||void 0===d||null===(s=d.ads)||void 0===s||null===(c=s.dynamic_remarketing)||void 0===c||!c.status)return;if(!wpm.googleConfigConditionsMet("ads"))return;if(null!==(u=wpmDataLayer)&&void 0!==u&&null!==(p=u.general)&&void 0!==p&&p.variationsOutput&&t.isVariable&&!1===wpmDataLayer.pixels.google.ads.dynamic_remarketing.send_events_with_parent_ids)return;if(!t)return;wpm.gtagLoaded().then((function(){gtag("event","view_item_list",{send_to:wpm.getGoogleAdsConversionIdentifiers(),items:[{id:t.dyn_r_ids[wpmDataLayer.pixels.google.ads.dynamic_remarketing.id_type],google_business_vertical:wpmDataLayer.pixels.google.ads.google_business_vertical}]})}))}catch(e){console.error(e)}})),jQuery(document).on("wpmAddToCart",(function(e,t){try{var a,o,r,i,n,l,d,s,c;if(jQuery.isEmptyObject(null===(a=wpmDataLayer)||void 0===a||null===(o=a.pixels)||void 0===o||null===(r=o.google)||void 0===r||null===(i=r.ads)||void 0===i?void 0:i.conversionIds))return;if(null===(n=wpmDataLayer)||void 0===n||null===(l=n.pixels)||void 0===l||null===(d=l.google)||void 0===d||null===(s=d.ads)||void 0===s||null===(c=s.dynamic_remarketing)||void 0===c||!c.status)return;if(!wpm.googleConfigConditionsMet("ads"))return;wpm.gtagLoaded().then((function(){gtag("event","add_to_cart",{send_to:wpm.getGoogleAdsConversionIdentifiers(),value:t.quantity*t.price,items:[{id:t.dyn_r_ids[wpmDataLayer.pixels.google.ads.dynamic_remarketing.id_type],quantity:t.quantity,price:t.price,google_business_vertical:wpmDataLayer.pixels.google.ads.google_business_vertical}]})}))}catch(e){console.error(e)}})),jQuery(document).on("wpmViewItem",(function(e,t){try{var a,o,r,i,n,l,d,s,c;if(jQuery.isEmptyObject(null===(a=wpmDataLayer)||void 0===a||null===(o=a.pixels)||void 0===o||null===(r=o.google)||void 0===r||null===(i=r.ads)||void 0===i?void 0:i.conversionIds))return;if(null===(n=wpmDataLayer)||void 0===n||null===(l=n.pixels)||void 0===l||null===(d=l.google)||void 0===d||null===(s=d.ads)||void 0===s||null===(c=s.dynamic_remarketing)||void 0===c||!c.status)return;if(!wpm.googleConfigConditionsMet("ads"))return;wpm.gtagLoaded().then((function(){gtag("event","view_item",{send_to:wpm.getGoogleAdsConversionIdentifiers(),value:(t.quantity?t.quantity:1)*t.price,items:[{id:t.dyn_r_ids[wpmDataLayer.pixels.google.ads.dynamic_remarketing.id_type],quantity:t.quantity?t.quantity:1,price:t.price,google_business_vertical:wpmDataLayer.pixels.google.ads.google_business_vertical}]})}))}catch(e){console.error(e)}})),jQuery(document).on("wpmSearch",(function(){try{var e,t,a,o,r,i,n,l,d;if(jQuery.isEmptyObject(null===(e=wpmDataLayer)||void 0===e||null===(t=e.pixels)||void 0===t||null===(a=t.google)||void 0===a||null===(o=a.ads)||void 0===o?void 0:o.conversionIds))return;if(null===(r=wpmDataLayer)||void 0===r||null===(i=r.pixels)||void 0===i||null===(n=i.google)||void 0===n||null===(l=n.ads)||void 0===l||null===(d=l.dynamic_remarketing)||void 0===d||!d.status)return;if(!wpm.googleConfigConditionsMet("ads"))return;let u=[];for(const[e,t]of Object.entries(wpmDataLayer.products)){var s,c;if(null!==(s=wpmDataLayer)&&void 0!==s&&null!==(c=s.general)&&void 0!==c&&c.variationsOutput&&t.isVariable&&!1===wpmDataLayer.pixels.google.ads.dynamic_remarketing.send_events_with_parent_ids)return;u.push({id:t.dyn_r_ids[wpmDataLayer.pixels.google.ads.dynamic_remarketing.id_type],google_business_vertical:wpmDataLayer.pixels.google.ads.google_business_vertical})}wpm.gtagLoaded().then((function(){gtag("event","view_search_results",{send_to:wpm.getGoogleAdsConversionIdentifiers(),items:u})}))}catch(e){console.error(e)}})),jQuery(document).on("wpmOrderReceivedPage",(function(){try{var e,t,a,o,r,i,n,l,d;if(jQuery.isEmptyObject(null===(e=wpmDataLayer)||void 0===e||null===(t=e.pixels)||void 0===t||null===(a=t.google)||void 0===a||null===(o=a.ads)||void 0===o?void 0:o.conversionIds))return;if(null===(r=wpmDataLayer)||void 0===r||null===(i=r.pixels)||void 0===i||null===(n=i.google)||void 0===n||null===(l=n.ads)||void 0===l||null===(d=l.dynamic_remarketing)||void 0===d||!d.status)return;if(!wpm.googleConfigConditionsMet("ads"))return;wpm.gtagLoaded().then((function(){gtag("event","purchase",{send_to:wpm.getGoogleAdsConversionIdentifiers(),value:wpmDataLayer.order.value_filtered,items:wpm.getGoogleAdsDynamicRemarketingOrderItems()})}))}catch(e){console.error(e)}})),jQuery(document).on("wpmLogin",(function(){try{var e,t,a,o,r,i,n,l,d;if(jQuery.isEmptyObject(null===(e=wpmDataLayer)||void 0===e||null===(t=e.pixels)||void 0===t||null===(a=t.google)||void 0===a||null===(o=a.ads)||void 0===o?void 0:o.conversionIds))return;if(null===(r=wpmDataLayer)||void 0===r||null===(i=r.pixels)||void 0===i||null===(n=i.google)||void 0===n||null===(l=n.ads)||void 0===l||null===(d=l.dynamic_remarketing)||void 0===d||!d.status)return;if(!wpm.googleConfigConditionsMet("ads"))return;wpm.gtagLoaded().then((function(){gtag("event","login",{send_to:wpm.getGoogleAdsConversionIdentifiers()})}))}catch(e){console.error(e)}})),jQuery(document).on("wpmOrderReceivedPage",(function(){try{var e,t,a,o,r,i;if(jQuery.isEmptyObject(null===(e=wpmDataLayer)||void 0===e||null===(t=e.pixels)||void 0===t||null===(a=t.google)||void 0===a||null===(o=a.ads)||void 0===o?void 0:o.conversionIds))return;if(!wpm.googleConfigConditionsMet("ads"))return;let n={},l={};n={send_to:wpm.getGoogleAdsConversionIdentifiersWithLabel(),transaction_id:wpmDataLayer.order.number,value:wpmDataLayer.order.value_filtered,currency:wpmDataLayer.order.currency,new_customer:wpmDataLayer.order.new_customer},null!==(r=wpmDataLayer)&&void 0!==r&&null!==(i=r.order)&&void 0!==i&&i.aw_merchant_id&&(l={discount:wpmDataLayer.order.discount,aw_merchant_id:wpmDataLayer.order.aw_merchant_id,aw_feed_country:wpmDataLayer.order.aw_feed_country,aw_feed_language:wpmDataLayer.order.aw_feed_language,items:wpm.getGoogleAdsRegularOrderItems()}),wpm.gtagLoaded().then((function(){gtag("event","conversion",{...n,...l})}))}catch(e){console.error(e)}}))},403:()=>{window.wpm=window.wpm||{},jQuery},172:()=>{!function(e,t,a){e.getCartItemsGa4=function(){let t=[];for(const[a,o]of Object.entries(wpmDataLayer.cart)){let a={item_id:o.dyn_r_ids[wpmDataLayer.pixels.google.analytics.id_type],item_name:o.name,quantity:o.quantity,item_brand:o.brand,item_variant:o.variant,price:o.price,currency:wpmDataLayer.shop.currency};a=e.getFormattedGA4Categories(a,o.category),t.push(a)}return t}}(window.wpm=window.wpm||{},jQuery),jQuery(document).on("wpmViewItemList",(function(e,t){try{var a,o,r,i,n,l,d,s,c;if(null===(a=wpmDataLayer)||void 0===a||null===(o=a.pixels)||void 0===o||null===(r=o.google)||void 0===r||null===(i=r.analytics)||void 0===i||!i.eec)return;if(null===(n=wpmDataLayer)||void 0===n||null===(l=n.pixels)||void 0===l||null===(d=l.google)||void 0===d||null===(s=d.analytics)||void 0===s||null===(c=s.ga4)||void 0===c||!c.measurement_id)return;if(!wpm.googleConfigConditionsMet("analytics"))return;let e={item_id:t.dyn_r_ids[wpmDataLayer.pixels.google.analytics.id_type],item_name:t.name,index:t.list_position,item_list_name:wpmDataLayer.shop.list_name,item_list_id:wpmDataLayer.shop.list_id,item_brand:t.brand,item_variant:t.variant,price:t.price,currency:wpmDataLayer.shop.currency,quantity:t.quantity};e=wpm.getFormattedGA4Categories(e,t.category),wpm.gtagLoaded().then((function(){gtag("event","view_item_list",{send_to:wpmDataLayer.pixels.google.analytics.ga4.measurement_id,items:[e],item_list_name:wpmDataLayer.shop.list_name,item_list_id:wpmDataLayer.shop.list_id})}))}catch(e){console.error(e)}})),jQuery(document).on("wpmSelectItem",(function(e,t){try{var a,o,r,i,n,l,d,s,c;if(null===(a=wpmDataLayer)||void 0===a||null===(o=a.pixels)||void 0===o||null===(r=o.google)||void 0===r||null===(i=r.analytics)||void 0===i||!i.eec)return;if(null===(n=wpmDataLayer)||void 0===n||null===(l=n.pixels)||void 0===l||null===(d=l.google)||void 0===d||null===(s=d.analytics)||void 0===s||null===(c=s.ga4)||void 0===c||!c.measurement_id)return;if(!wpm.googleConfigConditionsMet("analytics"))return;let e={item_id:t.dyn_r_ids[wpmDataLayer.pixels.google.analytics.id_type],item_name:t.name,index:t.list_position,item_list_name:wpmDataLayer.shop.list_name,item_list_id:wpmDataLayer.shop.list_id,item_brand:t.brand,item_variant:t.variant,price:t.price,currency:wpmDataLayer.shop.currency,quantity:t.quantity};e=wpm.getFormattedGA4Categories(e,t.category),wpm.gtagLoaded().then((function(){gtag("event","select_item",{send_to:wpmDataLayer.pixels.google.analytics.ga4.measurement_id,items:[e]})}))}catch(e){console.error(e)}})),jQuery(document).on("wpmAddToCart",(function(e,t){try{var a,o,r,i,n,l,d,s,c;if(null===(a=wpmDataLayer)||void 0===a||null===(o=a.pixels)||void 0===o||null===(r=o.google)||void 0===r||null===(i=r.analytics)||void 0===i||!i.eec)return;if(null===(n=wpmDataLayer)||void 0===n||null===(l=n.pixels)||void 0===l||null===(d=l.google)||void 0===d||null===(s=d.analytics)||void 0===s||null===(c=s.ga4)||void 0===c||!c.measurement_id)return;if(!wpm.googleConfigConditionsMet("analytics"))return;let e={item_name:t.name,item_id:t.dyn_r_ids[wpmDataLayer.pixels.google.analytics.id_type],item_list_name:wpmDataLayer.shop.list_name,item_list_id:wpmDataLayer.shop.list_id,item_brand:t.brand,item_variant:t.variant,price:t.price,currency:wpmDataLayer.shop.currency,quantity:t.quantity};e=wpm.getFormattedGA4Categories(e,t.category),wpm.gtagLoaded().then((function(){gtag("event","add_to_cart",{send_to:wpmDataLayer.pixels.google.analytics.ga4.measurement_id,currency:wpmDataLayer.shop.currency,items:[e]})}))}catch(e){console.error(e)}})),jQuery(document).on("wpmViewItem",(function(e,t){try{var a,o,r,i,n,l,d,s,c;if(null===(a=wpmDataLayer)||void 0===a||null===(o=a.pixels)||void 0===o||null===(r=o.google)||void 0===r||null===(i=r.analytics)||void 0===i||!i.eec)return;if(null===(n=wpmDataLayer)||void 0===n||null===(l=n.pixels)||void 0===l||null===(d=l.google)||void 0===d||null===(s=d.analytics)||void 0===s||null===(c=s.ga4)||void 0===c||!c.measurement_id)return;if(!wpm.googleConfigConditionsMet("analytics"))return;let e={item_id:t.dyn_r_ids[wpmDataLayer.pixels.google.analytics.id_type],item_name:t.name,item_brand:t.brand,item_variant:t.variant,price:t.price,currency:wpmDataLayer.shop.currency,quantity:1,item_list_name:wpmDataLayer.shop.list_name,item_list_id:wpmDataLayer.shop.list_id};e=wpm.getFormattedGA4Categories(e,t.category),wpm.gtagLoaded().then((function(){gtag("event","view_item",{send_to:wpmDataLayer.pixels.google.analytics.ga4.measurement_id,currency:wpmDataLayer.shop.currency,items:[e]})}))}catch(e){console.error(e)}})),jQuery(document).on("wpmAddToWishlist",(function(e,t){try{var a,o,r,i,n,l,d,s,c;if(null===(a=wpmDataLayer)||void 0===a||null===(o=a.pixels)||void 0===o||null===(r=o.google)||void 0===r||null===(i=r.analytics)||void 0===i||!i.eec)return;if(null===(n=wpmDataLayer)||void 0===n||null===(l=n.pixels)||void 0===l||null===(d=l.google)||void 0===d||null===(s=d.analytics)||void 0===s||null===(c=s.ga4)||void 0===c||!c.measurement_id)return;if(!wpm.googleConfigConditionsMet("analytics"))return;let e={item_id:t.dyn_r_ids[wpmDataLayer.pixels.google.analytics.id_type],item_name:t.name,quantity:1,item_brand:t.brand,item_variant:t.variant,price:t.price,currency:wpmDataLayer.shop.currency};e=wpm.getFormattedGA4Categories(e,t.category),wpm.gtagLoaded().then((function(){gtag("event","add_to_wishlist",{send_to:wpmDataLayer.pixels.google.analytics.ga4.measurement_id,currency:wpmDataLayer.shop.currency,items:[e]})}))}catch(e){console.error(e)}})),jQuery(document).on("wpmRemoveFromCart",(function(e,t){try{var a,o,r,i,n,l,d,s,c;if(null===(a=wpmDataLayer)||void 0===a||null===(o=a.pixels)||void 0===o||null===(r=o.google)||void 0===r||null===(i=r.analytics)||void 0===i||!i.eec)return;if(null===(n=wpmDataLayer)||void 0===n||null===(l=n.pixels)||void 0===l||null===(d=l.google)||void 0===d||null===(s=d.analytics)||void 0===s||null===(c=s.ga4)||void 0===c||!c.measurement_id)return;if(!wpm.googleConfigConditionsMet("analytics"))return;let e={item_id:t.dyn_r_ids[wpmDataLayer.pixels.google.analytics.id_type],item_name:t.name,item_brand:t.brand,item_variant:t.variant,price:t.price,currency:wpmDataLayer.shop.currency,quantity:t.quantity};e=wpm.getFormattedGA4Categories(e,t.category),wpm.gtagLoaded().then((function(){gtag("event","remove_from_cart",{send_to:wpmDataLayer.pixels.google.analytics.ga4.measurement_id,currency:wpmDataLayer.shop.currency,items:[e]})}))}catch(e){console.error(e)}})),jQuery(document).on("wpmBeginCheckout",(function(e){try{var t,a,o,r,i,n,l,d,s;if(null===(t=wpmDataLayer)||void 0===t||null===(a=t.pixels)||void 0===a||null===(o=a.google)||void 0===o||null===(r=o.analytics)||void 0===r||!r.eec)return;if(null===(i=wpmDataLayer)||void 0===i||null===(n=i.pixels)||void 0===n||null===(l=n.google)||void 0===l||null===(d=l.analytics)||void 0===d||null===(s=d.ga4)||void 0===s||!s.measurement_id)return;if(!wpm.googleConfigConditionsMet("analytics"))return;wpm.gtagLoaded().then((function(){gtag("event","begin_checkout",{send_to:wpmDataLayer.pixels.google.analytics.ga4.measurement_id,currency:wpmDataLayer.shop.currency,items:wpm.getCartItemsGa4()})}))}catch(e){console.error(e)}})),jQuery(document).on("wpmViewCart",(function(e){try{var t,a,o,r,i,n,l,d,s;if(null===(t=wpmDataLayer)||void 0===t||null===(a=t.pixels)||void 0===a||null===(o=a.google)||void 0===o||null===(r=o.analytics)||void 0===r||!r.eec)return;if(null===(i=wpmDataLayer)||void 0===i||null===(n=i.pixels)||void 0===n||null===(l=n.google)||void 0===l||null===(d=l.analytics)||void 0===d||null===(s=d.ga4)||void 0===s||!s.measurement_id)return;if(!wpm.googleConfigConditionsMet("analytics"))return;if(jQuery.isEmptyObject(wpmDataLayer.cart))return;let e=[],c=null;for(const[t,a]of Object.entries(wpmDataLayer.cart)){let t={item_id:a.dyn_r_ids[wpmDataLayer.pixels.google.analytics.id_type],item_name:a.name,quantity:a.quantity,item_brand:a.brand,item_list_name:wpmDataLayer.shop.list_name,item_list_id:wpmDataLayer.shop.list_id,item_variant:a.variant,price:a.price,currency:wpmDataLayer.shop.currency};t=wpm.getFormattedGA4Categories(t,a.category),e.push(t),c+=a.quantity*a.price}wpm.gtagLoaded().then((function(){gtag("event","view_cart",{send_to:wpmDataLayer.pixels.google.analytics.ga4.measurement_id,currency:wpmDataLayer.shop.currency,value:c.toFixed(2),items:e})}))}catch(e){console.error(e)}})),jQuery(document).on("wpmSearch",(function(){try{var e,t,a,o,r,i,n,l,d;if(null===(e=wpmDataLayer)||void 0===e||null===(t=e.pixels)||void 0===t||null===(a=t.google)||void 0===a||null===(o=a.analytics)||void 0===o||!o.eec)return;if(null===(r=wpmDataLayer)||void 0===r||null===(i=r.pixels)||void 0===i||null===(n=i.google)||void 0===n||null===(l=n.analytics)||void 0===l||null===(d=l.ga4)||void 0===d||!d.measurement_id)return;if(!wpm.googleConfigConditionsMet("analytics"))return;let s=[];for(const[e,t]of Object.entries(wpmDataLayer.products)){let e={item_id:t.dyn_r_ids[wpmDataLayer.pixels.google.analytics.id_type],item_name:t.name,quantity:1,index:t.position,item_brand:t.brand,item_list_name:wpmDataLayer.shop.list_name,item_list_id:wpmDataLayer.shop.list_id,item_variant:t.variant,price:t.price,currency:wpmDataLayer.shop.currency};e=wpm.getFormattedGA4Categories(e,t.category),s.push(e)}wpm.gtagLoaded().then((function(){gtag("event","view_search_results",{send_to:wpmDataLayer.pixels.google.analytics.ga4.measurement_id,search_term:wpm.getSearchTermFromUrl(),items:s})}))}catch(e){console.error(e)}})),jQuery(document).on("wpmLogin",(function(){try{var e,t,a,o,r,i,n,l,d;if(null===(e=wpmDataLayer)||void 0===e||null===(t=e.pixels)||void 0===t||null===(a=t.google)||void 0===a||null===(o=a.analytics)||void 0===o||!o.eec)return;if(null===(r=wpmDataLayer)||void 0===r||null===(i=r.pixels)||void 0===i||null===(n=i.google)||void 0===n||null===(l=n.analytics)||void 0===l||null===(d=l.ga4)||void 0===d||!d.measurement_id)return;if(!wpm.googleConfigConditionsMet("analytics"))return;wpm.gtagLoaded().then((function(){gtag("event","login",{send_to:wpmDataLayer.pixels.google.analytics.ga4.measurement_id})}))}catch(e){console.error(e)}}))},464:()=>{!function(e,t,a){e.getGA4OrderItems=function(){let e=[];for(const[o,r]of Object.entries(wpmDataLayer.order.items)){var t,a;let o;o={quantity:r.quantity,price:r.price,item_name:r.name,currency:wpmDataLayer.order.currency,item_category:wpmDataLayer.products[r.id].category.join("/")},null!==(t=wpmDataLayer)&&void 0!==t&&null!==(a=t.general)&&void 0!==a&&a.variationsOutput&&0!==r.variation_id?(o.item_id=String(wpmDataLayer.products[r.variation_id].dyn_r_ids[wpmDataLayer.pixels.google.analytics.id_type]),o.item_variant=wpmDataLayer.products[r.variation_id].variant_name,o.item_brand=wpmDataLayer.products[r.variation_id].brand):(o.item_id=String(wpmDataLayer.products[r.id].dyn_r_ids[wpmDataLayer.pixels.google.analytics.id_type]),o.item_brand=wpmDataLayer.products[r.id].brand),e.push(o)}return e}}(window.wpm=window.wpm||{},jQuery),jQuery(document).on("wpmOrderReceivedPage",(function(){try{var e,t,a,o,r,i,n,l,d,s;if(null===(e=wpmDataLayer)||void 0===e||null===(t=e.pixels)||void 0===t||null===(a=t.google)||void 0===a||null===(o=a.analytics)||void 0===o||null===(r=o.ga4)||void 0===r||!r.measurement_id)return;if(null!==(i=wpmDataLayer)&&void 0!==i&&null!==(n=i.pixels)&&void 0!==n&&null!==(l=n.google)&&void 0!==l&&null!==(d=l.analytics)&&void 0!==d&&null!==(s=d.ga4)&&void 0!==s&&s.mp_active)return;if(!wpm.googleConfigConditionsMet("analytics"))return;wpm.gtagLoaded().then((function(){gtag("event","purchase",{send_to:[wpmDataLayer.pixels.google.analytics.ga4.measurement_id],transaction_id:wpmDataLayer.order.number,affiliation:wpmDataLayer.order.affiliation,currency:wpmDataLayer.order.currency,value:wpmDataLayer.order.value_regular,discount:wpmDataLayer.order.discount,tax:wpmDataLayer.order.tax,shipping:wpmDataLayer.order.shipping,coupon:wpmDataLayer.order.coupon,items:wpm.getGA4OrderItems()})}))}catch(e){console.error(e)}}))},271:()=>{!function(e,t,a){e.getCartItemsGaUa=function(){let e=[];for(const[t,a]of Object.entries(wpmDataLayer.cart))e.push({id:a.dyn_r_ids[wpmDataLayer.pixels.google.analytics.id_type],name:a.name,brand:a.brand,category:a.category.join(","),price:a.price,quantity:a.quantity,variant:a.variant});return e}}(window.wpm=window.wpm||{},jQuery),jQuery(document).on("wpmViewItemList",(function(e,t){try{var a,o,r,i,n,l,d,s,c;if(null===(a=wpmDataLayer)||void 0===a||null===(o=a.pixels)||void 0===o||null===(r=o.google)||void 0===r||null===(i=r.analytics)||void 0===i||!i.eec)return;if(null===(n=wpmDataLayer)||void 0===n||null===(l=n.pixels)||void 0===l||null===(d=l.google)||void 0===d||null===(s=d.analytics)||void 0===s||null===(c=s.universal)||void 0===c||!c.property_id)return;if(!wpm.googleConfigConditionsMet("analytics"))return;wpm.gtagLoaded().then((function(){gtag("event","view_item_list",{send_to:wpmDataLayer.pixels.google.analytics.universal.property_id,items:[{id:t.dyn_r_ids[wpmDataLayer.pixels.google.analytics.id_type],name:t.name,brand:t.brand,category:t.category.join(","),list_name:wpmDataLayer.shop.list_name,list_position:t.list_position,price:t.price,quantity:t.quantity,variant:t.variant}]})}))}catch(e){console.error(e)}})),jQuery(document).on("wpmSelectContentGaUa",(function(e,t){try{var a,o,r,i,n,l,d,s,c;if(null===(a=wpmDataLayer)||void 0===a||null===(o=a.pixels)||void 0===o||null===(r=o.google)||void 0===r||null===(i=r.analytics)||void 0===i||!i.eec)return;if(null===(n=wpmDataLayer)||void 0===n||null===(l=n.pixels)||void 0===l||null===(d=l.google)||void 0===d||null===(s=d.analytics)||void 0===s||null===(c=s.universal)||void 0===c||!c.property_id)return;if(!wpm.googleConfigConditionsMet("analytics"))return;wpm.gtagLoaded().then((function(){gtag("event","select_content",{send_to:wpmDataLayer.pixels.google.analytics.universal.property_id,content_type:"product",items:[{id:t.dyn_r_ids[wpmDataLayer.pixels.google.analytics.id_type],name:t.name,list_name:wpmDataLayer.shop.list_name,brand:t.brand,category:t.category.join(","),variant:t.variant,list_position:t.list_position,quantity:t.quantity,price:t.price}]})}))}catch(e){console.error(e)}})),jQuery(document).on("wpmAddToCart",(function(e,t){try{var a,o,r,i,n,l,d,s,c;if(null===(a=wpmDataLayer)||void 0===a||null===(o=a.pixels)||void 0===o||null===(r=o.google)||void 0===r||null===(i=r.analytics)||void 0===i||!i.eec)return;if(null===(n=wpmDataLayer)||void 0===n||null===(l=n.pixels)||void 0===l||null===(d=l.google)||void 0===d||null===(s=d.analytics)||void 0===s||null===(c=s.universal)||void 0===c||!c.property_id)return;if(!wpm.googleConfigConditionsMet("analytics"))return;wpm.gtagLoaded().then((function(){gtag("event","add_to_cart",{send_to:wpmDataLayer.pixels.google.analytics.universal.property_id,currency:wpmDataLayer.shop.currency,items:[{id:t.dyn_r_ids[wpmDataLayer.pixels.google.analytics.id_type],name:t.name,list_name:wpmDataLayer.shop.list_name,brand:t.brand,category:t.category.join(","),variant:t.variant,list_position:t.list_position,quantity:t.quantity,price:t.price}]})}))}catch(e){console.error(e)}})),jQuery(document).on("wpmViewItem",(function(e,t){try{var a,o,r,i,n,l,d,s,c;if(null===(a=wpmDataLayer)||void 0===a||null===(o=a.pixels)||void 0===o||null===(r=o.google)||void 0===r||null===(i=r.analytics)||void 0===i||!i.eec)return;if(null===(n=wpmDataLayer)||void 0===n||null===(l=n.pixels)||void 0===l||null===(d=l.google)||void 0===d||null===(s=d.analytics)||void 0===s||null===(c=s.universal)||void 0===c||!c.property_id)return;if(!wpm.googleConfigConditionsMet("analytics"))return;wpm.gtagLoaded().then((function(){gtag("event","view_item",{send_to:wpmDataLayer.pixels.google.analytics.universal.property_id,items:[{id:t.dyn_r_ids[wpmDataLayer.pixels.google.analytics.id_type],name:t.name,list_name:wpmDataLayer.shop.list_name,brand:t.brand,category:t.category.join(","),variant:t.variant,list_position:1,quantity:1,price:t.price}]})}))}catch(e){console.error(e)}})),jQuery(document).on("wpmAddToWishlist",(function(e,t){try{var a,o,r,i,n,l,d,s,c;if(null===(a=wpmDataLayer)||void 0===a||null===(o=a.pixels)||void 0===o||null===(r=o.google)||void 0===r||null===(i=r.analytics)||void 0===i||!i.eec)return;if(null===(n=wpmDataLayer)||void 0===n||null===(l=n.pixels)||void 0===l||null===(d=l.google)||void 0===d||null===(s=d.analytics)||void 0===s||null===(c=s.universal)||void 0===c||!c.property_id)return;if(!wpm.googleConfigConditionsMet("analytics"))return;wpm.gtagLoaded().then((function(){gtag("event","add_to_wishlist",{send_to:wpmDataLayer.pixels.google.analytics.universal.property_id,items:[{id:t.dyn_r_ids[wpmDataLayer.pixels.google.analytics.id_type],name:t.name,brand:t.brand,category:t.category.join(","),list_name:wpmDataLayer.shop.list_name,list_position:t.position,price:t.price,quantity:1,variant:t.variant}]})}))}catch(e){console.error(e)}})),jQuery(document).on("wpmRemoveFromCart",(function(e,t){try{var a,o,r,i,n,l,d,s,c;if(null===(a=wpmDataLayer)||void 0===a||null===(o=a.pixels)||void 0===o||null===(r=o.google)||void 0===r||null===(i=r.analytics)||void 0===i||!i.eec)return;if(null===(n=wpmDataLayer)||void 0===n||null===(l=n.pixels)||void 0===l||null===(d=l.google)||void 0===d||null===(s=d.analytics)||void 0===s||null===(c=s.universal)||void 0===c||!c.property_id)return;if(!wpm.googleConfigConditionsMet("analytics"))return;wpm.gtagLoaded().then((function(){gtag("event","remove_from_cart",{send_to:wpmDataLayer.pixels.google.analytics.universal.property_id,currency:wpmDataLayer.shop.currency,items:[{id:t.dyn_r_ids[wpmDataLayer.pixels.google.analytics.id_type],name:t.name,list_name:wpmDataLayer.shop.list_name,brand:t.brand,category:t.category.join(","),variant:t.variant,quantity:t.quantity,price:t.price}]})}))}catch(e){console.error(e)}})),jQuery(document).on("wpmBeginCheckout",(function(e){try{var t,a,o,r,i,n,l,d,s;if(null===(t=wpmDataLayer)||void 0===t||null===(a=t.pixels)||void 0===a||null===(o=a.google)||void 0===o||null===(r=o.analytics)||void 0===r||!r.eec)return;if(null===(i=wpmDataLayer)||void 0===i||null===(n=i.pixels)||void 0===n||null===(l=n.google)||void 0===l||null===(d=l.analytics)||void 0===d||null===(s=d.universal)||void 0===s||!s.property_id)return;if(!wpm.googleConfigConditionsMet("analytics"))return;wpm.gtagLoaded().then((function(){gtag("event","begin_checkout",{send_to:wpmDataLayer.pixels.google.analytics.universal.property_id,currency:wpmDataLayer.shop.currency,items:wpm.getCartItemsGaUa()})}))}catch(e){console.error(e)}})),jQuery(document).on("wpmFireCheckoutOption",(function(e,t){try{var a,o,r,i,n,l,d,s,c;if(null===(a=wpmDataLayer)||void 0===a||null===(o=a.pixels)||void 0===o||null===(r=o.google)||void 0===r||null===(i=r.analytics)||void 0===i||!i.eec)return;if(null===(n=wpmDataLayer)||void 0===n||null===(l=n.pixels)||void 0===l||null===(d=l.google)||void 0===d||null===(s=d.analytics)||void 0===s||null===(c=s.universal)||void 0===c||!c.property_id)return;if(!wpm.googleConfigConditionsMet("analytics"))return;wpm.gtagLoaded().then((function(){gtag("event","set_checkout_option",{send_to:wpmDataLayer.pixels.google.analytics.universal.property_id,checkout_step:t.step,checkout_option:t.checkout_option,value:t.value})}))}catch(e){console.error(e)}})),jQuery(document).on("wpmFireCheckoutProgress",(function(e,t){try{var a,o,r,i,n,l,d,s,c;if(null===(a=wpmDataLayer)||void 0===a||null===(o=a.pixels)||void 0===o||null===(r=o.google)||void 0===r||null===(i=r.analytics)||void 0===i||!i.eec)return;if(null===(n=wpmDataLayer)||void 0===n||null===(l=n.pixels)||void 0===l||null===(d=l.google)||void 0===d||null===(s=d.analytics)||void 0===s||null===(c=s.universal)||void 0===c||!c.property_id)return;if(!wpm.googleConfigConditionsMet("analytics"))return;wpm.gtagLoaded().then((function(){gtag("event","checkout_progress",{send_to:wpmDataLayer.pixels.google.analytics.universal.property_id,checkout_step:t.step})}))}catch(e){console.error(e)}})),jQuery(document).on("wpmSearch",(function(){try{var e,t,a,o,r,i,n,l,d;if(null===(e=wpmDataLayer)||void 0===e||null===(t=e.pixels)||void 0===t||null===(a=t.google)||void 0===a||null===(o=a.analytics)||void 0===o||!o.eec)return;if(null===(r=wpmDataLayer)||void 0===r||null===(i=r.pixels)||void 0===i||null===(n=i.google)||void 0===n||null===(l=n.analytics)||void 0===l||null===(d=l.universal)||void 0===d||!d.property_id)return;if(!wpm.googleConfigConditionsMet("analytics"))return;let s=[];for(const[e,t]of Object.entries(wpmDataLayer.products))s.push({id:t.dyn_r_ids[wpmDataLayer.pixels.google.analytics.id_type],name:t.name,quantity:1,list_position:t.position,brand:t.brand,category:t.category.join(","),list_name:wpmDataLayer.shop.list_name,variant:t.variant,price:t.price});wpm.gtagLoaded().then((function(){gtag("event","view_search_results",{send_to:wpmDataLayer.pixels.google.analytics.universal.property_id,search_term:wpm.getSearchTermFromUrl(),items:s})}))}catch(e){console.error(e)}})),jQuery(document).on("wpmLogin",(function(){try{var e,t,a,o,r,i,n,l,d;if(null===(e=wpmDataLayer)||void 0===e||null===(t=e.pixels)||void 0===t||null===(a=t.google)||void 0===a||null===(o=a.analytics)||void 0===o||!o.eec)return;if(null===(r=wpmDataLayer)||void 0===r||null===(i=r.pixels)||void 0===i||null===(n=i.google)||void 0===n||null===(l=n.analytics)||void 0===l||null===(d=l.universal)||void 0===d||!d.property_id)return;if(!wpm.googleConfigConditionsMet("analytics"))return;wpm.gtagLoaded().then((function(){gtag("event","login",{send_to:wpmDataLayer.pixels.google.analytics.universal.property_id})}))}catch(e){console.error(e)}}))},354:()=>{!function(e,t,a){e.getGAUAOrderItems=function(){let e=[],t=1;for(const[r,i]of Object.entries(wpmDataLayer.order.items)){var a,o;let r;r={quantity:i.quantity,price:i.price,name:i.name,currency:wpmDataLayer.order.currency,category:wpmDataLayer.products[i.id].category.join("/"),list_position:t},null!==(a=wpmDataLayer)&&void 0!==a&&null!==(o=a.general)&&void 0!==o&&o.variationsOutput&&0!==i.variation_id?(r.id=String(wpmDataLayer.products[i.variation_id].dyn_r_ids[wpmDataLayer.pixels.google.analytics.id_type]),r.variant=wpmDataLayer.products[i.variation_id].variant_name,r.brand=wpmDataLayer.products[i.variation_id].brand):(r.id=String(wpmDataLayer.products[i.id].dyn_r_ids[wpmDataLayer.pixels.google.analytics.id_type]),r.brand=wpmDataLayer.products[i.id].brand),e.push(r),t++}return e}}(window.wpm=window.wpm||{},jQuery),jQuery(document).on("wpmOrderReceivedPage",(function(){try{var e,t,a,o,r,i,n,l,d,s;if(null===(e=wpmDataLayer)||void 0===e||null===(t=e.pixels)||void 0===t||null===(a=t.google)||void 0===a||null===(o=a.analytics)||void 0===o||null===(r=o.universal)||void 0===r||!r.property_id)return;if(null!==(i=wpmDataLayer)&&void 0!==i&&null!==(n=i.pixels)&&void 0!==n&&null!==(l=n.google)&&void 0!==l&&null!==(d=l.analytics)&&void 0!==d&&null!==(s=d.universal)&&void 0!==s&&s.mp_active)return;if(!wpm.googleConfigConditionsMet("analytics"))return;wpm.gtagLoaded().then((function(){gtag("event","purchase",{send_to:[wpmDataLayer.pixels.google.analytics.universal.property_id],transaction_id:wpmDataLayer.order.number,affiliation:wpmDataLayer.order.affiliation,currency:wpmDataLayer.order.currency,value:wpmDataLayer.order.value_regular,discount:wpmDataLayer.order.discount,tax:wpmDataLayer.order.tax,shipping:wpmDataLayer.order.shipping,coupon:wpmDataLayer.order.coupon,items:wpm.getGAUAOrderItems()})}))}catch(e){console.error(e)}}))},497:()=>{!function(e,t,a){e.load_google_optimize_pixel=function(){try{var t,a,o,r;null!==(t=wpmDataLayer)&&void 0!==t&&null!==(a=t.pixels)&&void 0!==a&&null!==(o=a.google)&&void 0!==o&&null!==(r=o.optimize)&&void 0!==r&&r.container_id&&(wpmDataLayer.pixels.google.optimize.loaded=!0,e.loadScriptAndCacheIt("https://www.googleoptimize.com/optimize.js?id="+wpmDataLayer.pixels.google.optimize.container_id))}catch(e){console.error(e)}}}(window.wpm=window.wpm||{},jQuery),jQuery(document).on("wpmLoadPixels",(function(){var e,t,a,o;!wpm.canIFire("analytics","google-optimize")||null!==(e=wpmDataLayer)&&void 0!==e&&null!==(t=e.pixels)&&void 0!==t&&null!==(a=t.google)&&void 0!==a&&null!==(o=a.optimize)&&void 0!==o&&o.loaded||wpm.load_google_optimize_pixel()}))},577:()=>{!function(e,t,a){e.googleConfigConditionsMet=function(t){var a,o,r,i;return!(null===(a=wpmDataLayer)||void 0===a||null===(o=a.pixels)||void 0===o||null===(r=o.google)||void 0===r||null===(i=r.consent_mode)||void 0===i||!i.active)||("category"===e.getConsentValues().mode?!0===e.getConsentValues().categories[t]:"pixel"===e.getConsentValues().mode&&e.getConsentValues().pixels.includes("google-"+t))},e.getVisitorConsentStatusAndUpdateGoogleConsentSettings=function(t){return"category"===e.getConsentValues().mode?(e.getConsentValues().categories.analytics&&(t.analytics_storage="granted"),e.getConsentValues().categories.ads&&(t.ad_storage="granted")):"pixel"===e.getConsentValues().mode&&(t.analytics_storage=e.getConsentValues().pixels.includes("google-analytics")?"granted":"denied",t.ad_storage=e.getConsentValues().pixels.includes("google-ads")?"granted":"denied"),t},e.updateGoogleConsentMode=function(){let e=!(arguments.length>0&&arguments[0]!==a)||arguments[0],t=!(arguments.length>1&&arguments[1]!==a)||arguments[1];try{if(!window.gtag||!wpmDataLayer.shop.cookie_consent_mgmt.explicit_consent)return;gtag("consent","update",{analytics_storage:e?"granted":"denied",ad_storage:t?"granted":"denied"})}catch(e){console.error(e)}},e.fireGtagGoogleAds=function(){try{var e,t,a,o,r,i,n,l,d,s,c,u,p,m,y,g,w,v,_,f,L;if(wpmDataLayer.pixels.google.ads.state="loading",null!==(e=wpmDataLayer)&&void 0!==e&&null!==(t=e.pixels)&&void 0!==t&&null!==(a=t.google)&&void 0!==a&&null!==(o=a.ads)&&void 0!==o&&null!==(r=o.enhanced_conversions)&&void 0!==r&&r.active)for(const[e,t]of Object.entries(wpmDataLayer.pixels.google.ads.conversionIds))gtag("config",e,{allow_enhanced_conversions:!0});else for(const[e,t]of Object.entries(wpmDataLayer.pixels.google.ads.conversionIds))gtag("config",e);null!==(i=wpmDataLayer)&&void 0!==i&&null!==(n=i.pixels)&&void 0!==n&&null!==(l=n.google)&&void 0!==l&&null!==(d=l.ads)&&void 0!==d&&d.conversionIds&&null!==(s=wpmDataLayer)&&void 0!==s&&null!==(c=s.pixels)&&void 0!==c&&null!==(u=c.google)&&void 0!==u&&null!==(p=u.ads)&&void 0!==p&&p.phone_conversion_label&&null!==(m=wpmDataLayer)&&void 0!==m&&null!==(y=m.pixels)&&void 0!==y&&null!==(g=y.google)&&void 0!==g&&null!==(w=g.ads)&&void 0!==w&&w.phone_conversion_number&&gtag("config",Object.keys(wpmDataLayer.pixels.google.ads.conversionIds)[0]+"/"+wpmDataLayer.pixels.google.ads.phone_conversion_label,{phone_conversion_number:wpmDataLayer.pixels.google.ads.phone_conversion_number}),"order_received_page"===wpmDataLayer.shop.page_type&&null!==(v=wpmDataLayer)&&void 0!==v&&null!==(_=v.order)&&void 0!==_&&null!==(f=_.google)&&void 0!==f&&null!==(L=f.ads)&&void 0!==L&&L.enhanced_conversion_data&&(window.enhanced_conversion_data=wpmDataLayer.order.google.ads.enhanced_conversion_data),wpmDataLayer.pixels.google.ads.state="ready"}catch(e){console.error(e)}},e.fireGtagGoogleAnalyticsUA=function(){try{wpmDataLayer.pixels.google.analytics.universal.state="loading",gtag("config",wpmDataLayer.pixels.google.analytics.universal.property_id,wpmDataLayer.pixels.google.analytics.universal.parameters),wpmDataLayer.pixels.google.analytics.universal.state="ready"}catch(e){console.error(e)}},e.fireGtagGoogleAnalyticsGA4=function(){try{wpmDataLayer.pixels.google.analytics.ga4.state="loading",gtag("config",wpmDataLayer.pixels.google.analytics.ga4.measurement_id,wpmDataLayer.pixels.google.analytics.ga4.parameters),wpmDataLayer.pixels.google.analytics.ga4.state="ready"}catch(e){console.error(e)}},e.isGoogleActive=function(){var e,t,a,o,r,i,n,l,d,s,c,u,p,m;return!(!(null!==(e=wpmDataLayer)&&void 0!==e&&null!==(t=e.pixels)&&void 0!==t&&null!==(a=t.google)&&void 0!==a&&null!==(o=a.analytics)&&void 0!==o&&null!==(r=o.universal)&&void 0!==r&&r.property_id||null!==(i=wpmDataLayer)&&void 0!==i&&null!==(n=i.pixels)&&void 0!==n&&null!==(l=n.google)&&void 0!==l&&null!==(d=l.analytics)&&void 0!==d&&null!==(s=d.ga4)&&void 0!==s&&s.measurement_id)&&jQuery.isEmptyObject(null===(c=wpmDataLayer)||void 0===c||null===(u=c.pixels)||void 0===u||null===(p=u.google)||void 0===p||null===(m=p.ads)||void 0===m?void 0:m.conversionIds))},e.getGoogleGtagId=function(){var e,t,a,o,r,i,n,l,d,s;return null!==(e=wpmDataLayer)&&void 0!==e&&null!==(t=e.pixels)&&void 0!==t&&null!==(a=t.google)&&void 0!==a&&null!==(o=a.analytics)&&void 0!==o&&null!==(r=o.universal)&&void 0!==r&&r.property_id?wpmDataLayer.pixels.google.analytics.universal.property_id:null!==(i=wpmDataLayer)&&void 0!==i&&null!==(n=i.pixels)&&void 0!==n&&null!==(l=n.google)&&void 0!==l&&null!==(d=l.analytics)&&void 0!==d&&null!==(s=d.ga4)&&void 0!==s&&s.measurement_id?wpmDataLayer.pixels.google.analytics.ga4.measurement_id:Object.keys(wpmDataLayer.pixels.google.ads.conversionIds)[0]},e.loadGoogle=function(){e.isGoogleActive()&&(wpmDataLayer.pixels.google.state="loading",e.loadScriptAndCacheIt("https://www.googletagmanager.com/gtag/js?id="+e.getGoogleGtagId()).done((function(t,a){try{var o,r,i,n,l,d,s,c,u,p,m,y,g,w,v,_,f,L,h,D,x,k;if(window.dataLayer=window.dataLayer||[],window.gtag=function(){dataLayer.push(arguments)},null!==(o=wpmDataLayer)&&void 0!==o&&null!==(r=o.pixels)&&void 0!==r&&null!==(i=r.google)&&void 0!==i&&null!==(n=i.consent_mode)&&void 0!==n&&n.active){var C,b,j,Q;let t={ad_storage:wpmDataLayer.pixels.google.consent_mode.ad_storage,analytics_storage:wpmDataLayer.pixels.google.consent_mode.analytics_storage,wait_for_update:wpmDataLayer.pixels.google.consent_mode.wait_for_update};null!==(C=wpmDataLayer)&&void 0!==C&&null!==(b=C.pixels)&&void 0!==b&&null!==(j=b.google)&&void 0!==j&&null!==(Q=j.consent_mode)&&void 0!==Q&&Q.region&&(t.region=wpmDataLayer.pixels.google.consent_mode.region),t=e.getVisitorConsentStatusAndUpdateGoogleConsentSettings(t),gtag("consent","default",t),gtag("set","ads_data_redaction",wpmDataLayer.pixels.google.consent_mode.ads_data_redaction),gtag("set","url_passthrough",wpmDataLayer.pixels.google.consent_mode.url_passthrough)}null!==(l=wpmDataLayer)&&void 0!==l&&null!==(d=l.pixels)&&void 0!==d&&null!==(s=d.google)&&void 0!==s&&null!==(c=s.linker)&&void 0!==c&&c.settings&&gtag("set","linker",wpmDataLayer.pixels.google.linker.settings),gtag("js",new Date),e.googleConfigConditionsMet("ads")&&!jQuery.isEmptyObject(null===(u=wpmDataLayer)||void 0===u||null===(p=u.pixels)||void 0===p||null===(m=p.google)||void 0===m||null===(y=m.ads)||void 0===y?void 0:y.conversionIds)&&e.fireGtagGoogleAds(),e.googleConfigConditionsMet("analytics")&&null!==(g=wpmDataLayer)&&void 0!==g&&null!==(w=g.pixels)&&void 0!==w&&null!==(v=w.google)&&void 0!==v&&null!==(_=v.analytics)&&void 0!==_&&null!==(f=_.universal)&&void 0!==f&&f.property_id&&e.fireGtagGoogleAnalyticsUA(),e.googleConfigConditionsMet("analytics")&&null!==(L=wpmDataLayer)&&void 0!==L&&null!==(h=L.pixels)&&void 0!==h&&null!==(D=h.google)&&void 0!==D&&null!==(x=D.analytics)&&void 0!==x&&null!==(k=x.ga4)&&void 0!==k&&k.measurement_id&&e.fireGtagGoogleAnalyticsGA4(),wpmDataLayer.pixels.google.state="ready"}catch(e){console.error(e)}})))},e.canGoogleLoad=function(){var t,a,o,r;return!(null===(t=wpmDataLayer)||void 0===t||null===(a=t.pixels)||void 0===a||null===(o=a.google)||void 0===o||null===(r=o.consent_mode)||void 0===r||!r.active)||("category"===e.getConsentValues().mode?!(!e.getConsentValues().categories.ads&&!e.getConsentValues().categories.analytics):"pixel"===e.getConsentValues().mode?e.getConsentValues().pixels.includes("google-ads")||e.getConsentValues().pixels.includes("google-analytics"):(console.error("Couldn't find a valid load condition for Google mode in wpmConsentValues"),!1))},e.gtagLoaded=function(){return new Promise((function(e,t){var a,o,r;void 0===(null===(a=wpmDataLayer)||void 0===a||null===(o=a.pixels)||void 0===o||null===(r=o.google)||void 0===r?void 0:r.state)&&t();let i=0;!function a(){var o,r,n;return"ready"===(null===(o=wpmDataLayer)||void 0===o||null===(r=o.pixels)||void 0===r||null===(n=r.google)||void 0===n?void 0:n.state)?e():i>=5e3?t():(i+=200,void setTimeout(a,200))}()}))}}(window.wpm=window.wpm||{},jQuery),jQuery(document).on("wpmLoadPixels",(function(){var e,t,a;wpm.canGoogleLoad()&&void 0===(null===(e=wpmDataLayer)||void 0===e||null===(t=e.pixels)||void 0===t||null===(a=t.google)||void 0===a?void 0:a.state)&&wpm.loadGoogle()}))},385:()=>{!function(e,t,a){e.getFormattedGA4Categories=function(e,t){if(t=Array.from(new Set(t)),Array.isArray(t)&&t.length){e.item_category=t[0];let a=t.length>5?5:t.length;for(let o=1;o<a;o++)e["item_category"+(o+1)]=t[o]}return e},e.setGoogleCidOnServer=function(){try{var t,a,o,r,i,n,l,d,s,c;let u=[];null!==(t=wpmDataLayer)&&void 0!==t&&null!==(a=t.pixels)&&void 0!==a&&null!==(o=a.google)&&void 0!==o&&null!==(r=o.analytics)&&void 0!==r&&null!==(i=r.ga4)&&void 0!==i&&i.measurement_id&&u.push(wpmDataLayer.pixels.google.analytics.ga4.measurement_id),null!==(n=wpmDataLayer)&&void 0!==n&&null!==(l=n.pixels)&&void 0!==l&&null!==(d=l.google)&&void 0!==d&&null!==(s=d.analytics)&&void 0!==s&&null!==(c=s.universal)&&void 0!==c&&c.property_id&&u.push(wpmDataLayer.pixels.google.analytics.universal.property_id),e.gtagLoaded().then((function(){gtag("get",u[0],"client_id",(t=>{let a={action:"wpm_google_analytics_set_session_data",target_ids:u,client_id:t,referrer:e.getReferrerFromCookie(),gclid:e.getClidFromBrowser("gclid"),userAgent:e.getUserAgent(),viewPortWidth:e.getViewPort().width,viewPortHeight:e.getViewPort().height};jQuery.ajax({type:"post",dataType:"json",url:e.ajax_url,data:a,success:function(a){!0===a.success&&(window.sessionStorage?u.forEach((e=>{window.sessionStorage.setItem("_wpm_ga_cid_set",JSON.stringify(!0)),window.sessionStorage.setItem("wpm_cid_"+e+"_"+t+"_set",JSON.stringify(!0))})):u.forEach((a=>{e.setCookie("wpm_cid_"+a+"_"+t+"_set",!0)})))},error:function(e){console.error(e)}})}))}))}catch(e){console.error(e)}}}(window.wpm=window.wpm||{},jQuery),jQuery(window).on("wpmLoadAlways",(function(){try{var e,t,a,o,r,i,n,l,d,s,c,u,p,m,y,g;null===(e=wpmDataLayer)||void 0===e||null===(t=e.pixels)||void 0===t||null===(a=t.google)||void 0===a||null===(o=a.analytics)||void 0===o||!o.eec||null!==(r=window)&&void 0!==r&&null!==(i=r.sessionStorage)&&void 0!==i&&i.getItem("_wpm_ga_cid_set",JSON.parse(!0))||!(null!==(n=wpmDataLayer)&&void 0!==n&&null!==(l=n.pixels)&&void 0!==l&&null!==(d=l.google)&&void 0!==d&&null!==(s=d.analytics)&&void 0!==s&&null!==(c=s.universal)&&void 0!==c&&c.property_id||null!==(u=wpmDataLayer)&&void 0!==u&&null!==(p=u.pixels)&&void 0!==p&&null!==(m=p.google)&&void 0!==m&&null!==(y=m.analytics)&&void 0!==y&&null!==(g=y.ga4)&&void 0!==g&&g.measurement_id)||["cart","checkout"].indexOf(wpmDataLayer.shop.page_type)>=0&&wpm.setGoogleCidOnServer()}catch(e){console.error(e)}}))},570:()=>{!function(e,t,a){e.load_hotjar_pixel=function(){var e,t,a;null!==(e=wpmDataLayer)&&void 0!==e&&null!==(t=e.pixels)&&void 0!==t&&null!==(a=t.hotjar)&&void 0!==a&&a.site_id&&(wpmDataLayer.pixels.hotjar.loaded=!0,function(e,t,a,o,r,i){e.hj=e.hj||function(){(e.hj.q=e.hj.q||[]).push(arguments)},e._hjSettings={hjid:wpmDataLayer.pixels.hotjar.site_id,hjsv:6},r=t.getElementsByTagName("head")[0],(i=t.createElement("script")).async=1,i.src="https://static.hotjar.com/c/hotjar-"+e._hjSettings.hjid+".js?sv="+e._hjSettings.hjsv,r.appendChild(i)}(window,document))}}(window.wpm=window.wpm||{},jQuery),jQuery(document).on("wpmLoadPixels",(function(){var e,t,a;!wpm.canIFire("analytics","hotjar")||null!==(e=wpmDataLayer)&&void 0!==e&&null!==(t=e.pixels)&&void 0!==t&&null!==(a=t.hotjar)&&void 0!==a&&a.loaded||wpm.load_hotjar_pixel()}))},623:()=>{!function(e,t,a){e.load_bing_pixel=function(){try{var e,t,a;null!==(e=wpmDataLayer)&&void 0!==e&&null!==(t=e.pixels)&&void 0!==t&&null!==(a=t.bing)&&void 0!==a&&a.uet_tag_id&&(wpmDataLayer.pixels.bing.loaded=!0,window.uetq=window.uetq||[],o=window,r=document,i="script",o[n="uetq"]=o[n]||[],l=function(){var e={ti:wpmDataLayer.pixels.bing.uet_tag_id};e.q=o[n],o[n]=new UET(e),o[n].push("pageLoad")},(d=r.createElement(i)).src="//bat.bing.com/bat.js",d.async=1,d.onload=d.onreadystatechange=function(){var e=this.readyState;e&&"loaded"!==e&&"complete"!==e||(l(),d.onload=d.onreadystatechange=null)},(s=r.getElementsByTagName(i)[0]).parentNode.insertBefore(d,s))}catch(e){console.error(e)}var o,r,i,n,l,d,s},e.bing_purchase_ecomm_prodids=function(){let e=[];for(const[o,r]of Object.entries(wpmDataLayer.order.items)){var t,a;null!==(t=wpmDataLayer)&&void 0!==t&&null!==(a=t.general)&&void 0!==a&&a.variationsOutput&&0!==r.variation_id?e.push(String(wpmDataLayer.products[r.variation_id].dyn_r_ids[wpmDataLayer.pixels.bing.dynamic_remarketing.id_type])):e.push(String(wpmDataLayer.products[r.id].dyn_r_ids[wpmDataLayer.pixels.bing.dynamic_remarketing.id_type]))}return e},e.bing_purchase_items=function(){let e=[];for(const[o,r]of Object.entries(wpmDataLayer.order.items)){var t,a;let o;o={quantity:r.quantity,price:r.price},null!==(t=wpmDataLayer)&&void 0!==t&&null!==(a=t.general)&&void 0!==a&&a.variationsOutput&&0!==r.variation_id?(o.id=String(wpmDataLayer.products[r.variation_id].dyn_r_ids[wpmDataLayer.pixels.bing.dynamic_remarketing.id_type]),e.push(o)):(o.id=String(wpmDataLayer.products[r.id].dyn_r_ids[wpmDataLayer.pixels.bing.dynamic_remarketing.id_type]),e.push(o))}return e}}(window.wpm=window.wpm||{},jQuery),jQuery(document).on("wpmLoadPixels",(function(){var e,t,a;!wpm.canIFire("ads","bing-ads")||null!==(e=wpmDataLayer)&&void 0!==e&&null!==(t=e.pixels)&&void 0!==t&&null!==(a=t.bing)&&void 0!==a&&a.loaded||wpm.load_bing_pixel()})),jQuery(document).on("wpmAddToCart",(function(e,t){try{var a,o,r;if(null===(a=wpmDataLayer)||void 0===a||null===(o=a.pixels)||void 0===o||null===(r=o.bing)||void 0===r||!r.loaded)return;window.uetq.push("event","",{ecomm_pagetype:"cart",ecomm_prodid:t.dyn_r_ids[wpmDataLayer.pixels.bing.dynamic_remarketing.id_type]})}catch(e){console.error(e)}})),jQuery(document).on("wpmViewItem",(function(e,t){try{var a,o,r;if(null===(a=wpmDataLayer)||void 0===a||null===(o=a.pixels)||void 0===o||null===(r=o.bing)||void 0===r||!r.loaded)return;window.uetq.push("event","",{ecomm_pagetype:"product",ecomm_prodid:t.dyn_r_ids[wpmDataLayer.pixels.bing.dynamic_remarketing.id_type]})}catch(e){console.error(e)}})),jQuery(document).on("wpmCategory",(function(){try{var e,t,a;if(null===(e=wpmDataLayer)||void 0===e||null===(t=e.pixels)||void 0===t||null===(a=t.bing)||void 0===a||!a.loaded)return;window.uetq.push("event","",{ecomm_pagetype:"category"})}catch(e){console.error(e)}})),jQuery(document).on("wpmSearch",(function(){try{var e,t,a;if(null===(e=wpmDataLayer)||void 0===e||null===(t=e.pixels)||void 0===t||null===(a=t.bing)||void 0===a||!a.loaded)return;window.uetq.push("event","",{ecomm_pagetype:"searchresults"})}catch(e){console.error(e)}})),jQuery(document).on("wpmOrderReceivedPage",(function(){try{var e,t,a;if(null===(e=wpmDataLayer)||void 0===e||null===(t=e.pixels)||void 0===t||null===(a=t.bing)||void 0===a||!a.loaded)return;window.uetq.push("event","purchase",{ecomm_pagetype:"purchase",ecomm_prodid:wpm.bing_purchase_ecomm_prodids(),revenue_value:wpmDataLayer.order.value_filtered,currency:wpmDataLayer.order.currency,items:wpm.bing_purchase_items()})}catch(e){console.error(e)}}))},699:()=>{!function(e,t,a){e.getPinterestProductData=function(e){return e.isVariation?{product_name:e.name,product_variant_id:e.dyn_r_ids[wpmDataLayer.pixels.pinterest.dynamic_remarketing.id_type],product_id:e.parentId_dyn_r_ids[wpmDataLayer.pixels.pinterest.dynamic_remarketing.id_type],product_category:e.category,product_variant:e.variant,product_price:e.price,product_quantity:e.quantity,product_brand:e.brand}:{product_name:e.name,product_id:e.dyn_r_ids[wpmDataLayer.pixels.pinterest.dynamic_remarketing.id_type],product_category:e.category,product_price:e.price,product_quantity:e.quantity,product_brand:e.brand}},e.pinterestFormattedOrderItems=function(){let e=[];for(const[o,r]of Object.entries(wpmDataLayer.order.items)){var t,a;let i;i={product_category:wpmDataLayer.products[o].category.join(","),product_quantity:r.quantity,product_price:r.price},null!==(t=wpmDataLayer)&&void 0!==t&&null!==(a=t.general)&&void 0!==a&&a.variationsOutput&&0!==r.variation_id?(i.product_id=String(wpmDataLayer.products[r.variation_id].dyn_r_ids[wpmDataLayer.pixels.pinterest.dynamic_remarketing.id_type]),i.product_name=wpmDataLayer.products[r.variation_id].name,e.push(i)):(i.product_id=String(wpmDataLayer.products[r.id].dyn_r_ids[wpmDataLayer.pixels.pinterest.dynamic_remarketing.id_type]),i.product_name=wpmDataLayer.products[r.id].name,e.push(i))}return e},e.loadPinterestPixel=function(){try{var t,a,o;null!==(t=wpmDataLayer)&&void 0!==t&&null!==(a=t.pixels)&&void 0!==a&&null!==(o=a.pinterest)&&void 0!==o&&o.pixel_id&&(wpmDataLayer.pixels.pinterest.loaded=!0,function(e){if(!window.pintrk){window.pintrk=function(){window.pintrk.queue.push(Array.prototype.slice.call(arguments))};var t=window.pintrk;t.queue=[],t.version="3.0";var a=document.createElement("script");a.async=!0,a.src="https://s.pinimg.com/ct/core.js";var o=document.getElementsByTagName("script")[0];o.parentNode.insertBefore(a,o)}}(),e.pinterestLoadEvent(),pintrk("page"))}catch(e){console.error(e)}},e.pinterestLoadEvent=function(){try{var e,t,a;(wpmDataLayer.general.userLoggedIn||"order_received_page"===wpmDataLayer.shop.page_type)&&null!==(e=wpmDataLayer)&&void 0!==e&&null!==(t=e.pixels)&&void 0!==t&&null!==(a=t.pinterest)&&void 0!==a&&a.enhanced_match?pintrk("load",wpmDataLayer.pixels.pinterest.pixel_id,{em:wpmDataLayer.pixels.pinterest.enhanced_match_email}):pintrk("load",wpmDataLayer.pixels.pinterest.pixel_id)}catch(e){console.error(e)}}}(window.wpm=window.wpm||{},jQuery),jQuery(document).on("wpmLoadPixels",(function(){var e,t,a;!wpm.canIFire("ads","pinterest-ads")||null!==(e=wpmDataLayer)&&void 0!==e&&null!==(t=e.pixels)&&void 0!==t&&null!==(a=t.pinterest)&&void 0!==a&&a.loaded||wpm.loadPinterestPixel()})),jQuery(document).on("wpmAddToCart",(function(e,t){try{var a,o,r;if(null===(a=wpmDataLayer)||void 0===a||null===(o=a.pixels)||void 0===o||null===(r=o.pinterest)||void 0===r||!r.loaded)return;pintrk("track","addtocart",{value:parseFloat(t.quantity*t.price),currency:t.currency,line_items:[wpm.getPinterestProductData(t)]})}catch(e){console.error(e)}})),jQuery(document).on("wpmViewItem",(function(e,t){try{var a,o,r;if(null===(a=wpmDataLayer)||void 0===a||null===(o=a.pixels)||void 0===o||null===(r=o.pinterest)||void 0===r||!r.loaded)return;pintrk("track","pagevisit",{currency:t.currency,line_items:[wpm.getPinterestProductData(t)]})}catch(e){console.error(e)}})),jQuery(document).on("wpmViewItem",(function(e,t){try{var a,o,r;if(null===(a=wpmDataLayer)||void 0===a||null===(o=a.pixels)||void 0===o||null===(r=o.pinterest)||void 0===r||!r.loaded)return;let e=wpm.getPinterestProductData(t);pintrk("track","pagevisit",{currency:t.currency,line_items:[e]})}catch(e){console.error(e)}})),jQuery(document).on("wpmSearch",(function(){try{var e,t,a;if(null===(e=wpmDataLayer)||void 0===e||null===(t=e.pixels)||void 0===t||null===(a=t.pinterest)||void 0===a||!a.loaded)return;let o=new URLSearchParams(window.location.search);pintrk("track","search",{search_query:o.get("s")})}catch(e){console.error(e)}})),jQuery(document).on("wpmCategory",(function(){try{var e,t,a;if(null===(e=wpmDataLayer)||void 0===e||null===(t=e.pixels)||void 0===t||null===(a=t.pinterest)||void 0===a||!a.loaded)return;pintrk("track","viewcategory")}catch(e){console.error(e)}})),jQuery(document).on("wpmOrderReceivedPage",(function(){try{var e,t,a;if(null===(e=wpmDataLayer)||void 0===e||null===(t=e.pixels)||void 0===t||null===(a=t.pinterest)||void 0===a||!a.loaded)return;pintrk("track","checkout",{value:wpmDataLayer.order.value_filtered,order_quantity:wpmDataLayer.order.quantity,currency:wpmDataLayer.order.currency,order_id:wpmDataLayer.order.id,line_items:wpm.pinterestFormattedOrderItems()})}catch(e){console.error(e)}}))},986:()=>{!function(e,t,a){e.snapchatGetEmail=function(){var e,t;let a={};var o;return null!==(e=wpmDataLayer)&&void 0!==e&&null!==(t=e.user)&&void 0!==t&&t.email_sha256&&(a.user_hashed_email=null===(o=wpmDataLayer.user)||void 0===o?void 0:o.email_sha256),a},e.loadSnapchatPixel=function(){try{var t,a,o;null!==(t=wpmDataLayer)&&void 0!==t&&null!==(a=t.pixels)&&void 0!==a&&null!==(o=a.snapchat)&&void 0!==o&&o.pixel_id&&(wpmDataLayer.pixels.snapchat.loaded=!0,function(e,t,a){if(!e.snaptr){var o=e.snaptr=function(){o.handleRequest?o.handleRequest.apply(o,arguments):o.queue.push(arguments)};o.queue=[];var i="script";r=t.createElement(i),r.async=!0,r.src="https://sc-static.net/scevent.min.js";var n=t.getElementsByTagName(i)[0];n.parentNode.insertBefore(r,n)}}(window,document),snaptr("init",wpmDataLayer.pixels.snapchat.pixel_id,e.snapchatGetEmail()),snaptr("track","PAGE_VIEW"))}catch(e){console.error(e)}},e.getSnapchatOrderItemIds=function(){let e=[];for(const[o,r]of Object.entries(wpmDataLayer.order.items)){var t,a;null!==(t=wpmDataLayer)&&void 0!==t&&null!==(a=t.general)&&void 0!==a&&a.variationsOutput&&0!==r.variation_id?e.push(String(wpmDataLayer.products[r.variation_id].dyn_r_ids[wpmDataLayer.pixels.snapchat.dynamic_remarketing.id_type])):e.push(String(wpmDataLayer.products[r.id].dyn_r_ids[wpmDataLayer.pixels.snapchat.dynamic_remarketing.id_type]))}return e}}(window.wpm=window.wpm||{},jQuery),jQuery(document).on("wpmLoadPixels",(function(){var e,t,a;!wpm.canIFire("ads","snapchat-ads")||null!==(e=wpmDataLayer)&&void 0!==e&&null!==(t=e.pixels)&&void 0!==t&&null!==(a=t.snapchat)&&void 0!==a&&a.loaded||wpm.loadSnapchatPixel()})),jQuery(document).on("wpmAddToCart",(function(e,t){try{var a,o,r;if(null===(a=wpmDataLayer)||void 0===a||null===(o=a.pixels)||void 0===o||null===(r=o.snapchat)||void 0===r||!r.loaded)return;snaptr("track","ADD_CART",{item_ids:[t.dyn_r_ids[wpmDataLayer.pixels.snapchat.dynamic_remarketing.id_type]]})}catch(e){console.error(e)}})),jQuery(document).on("wpmViewItem",(function(e,t){try{var a,o,r;if(null===(a=wpmDataLayer)||void 0===a||null===(o=a.pixels)||void 0===o||null===(r=o.snapchat)||void 0===r||!r.loaded)return;snaptr("track","VIEW_CONTENT",{item_ids:[t.dyn_r_ids[wpmDataLayer.pixels.snapchat.dynamic_remarketing.id_type]]})}catch(e){console.error(e)}})),jQuery(document).on("wpmOrderReceivedPage",(function(){try{var e,t,a;if(null===(e=wpmDataLayer)||void 0===e||null===(t=e.pixels)||void 0===t||null===(a=t.snapchat)||void 0===a||!a.loaded)return;snaptr("track","PURCHASE",{currency:wpmDataLayer.order.currency,price:wpmDataLayer.order.value_filtered,transaction_id:wpmDataLayer.order.id,item_ids:wpm.getSnapchatOrderItemIds()})}catch(e){console.error(e)}}))},657:()=>{!function(e,t,a){e.loadTikTokPixel=function(){try{var e,t,a;null!==(e=wpmDataLayer)&&void 0!==e&&null!==(t=e.pixels)&&void 0!==t&&null!==(a=t.tiktok)&&void 0!==a&&a.pixel_id&&(wpmDataLayer.pixels.tiktok.loaded=!0,function(e,t,a){e.TiktokAnalyticsObject=a;var o=e[a]=e[a]||[];o.methods=["page","track","identify","instances","debug","on","off","once","ready","alias","group","enableCookie","disableCookie"],o.setAndDefer=function(e,t){e[t]=function(){e.push([t].concat(Array.prototype.slice.call(arguments,0)))}};for(var r=0;r<o.methods.length;r++)o.setAndDefer(o,o.methods[r]);o.instance=function(e){for(var t=o._i[e]||[],a=0;a<o.methods.length;a++)o.setAndDefer(t,o.methods[a]);return t},o.load=function(e,t){var r="https://analytics.tiktok.com/i18n/pixel/events.js";o._i=o._i||{},o._i[e]=[],o._i[e]._u=r,o._t=o._t||{},o._t[e]=+new Date,o._o=o._o||{},o._o[e]=t||{};var i=document.createElement("script");i.type="text/javascript",i.async=!0,i.src=r+"?sdkid="+e+"&lib="+a;var n=document.getElementsByTagName("script")[0];n.parentNode.insertBefore(i,n)},o.load(wpmDataLayer.pixels.tiktok.pixel_id),o.page()}(window,document,"ttq"),ttq.track("Browse"))}catch(e){console.error(e)}},e.getTikTokOrderItemIds=function(){let e=[];for(const[o,r]of Object.entries(wpmDataLayer.order.items)){var t,a;let o;o={content_type:"product",quantity:r.quantity,price:r.price},null!==(t=wpmDataLayer)&&void 0!==t&&null!==(a=t.general)&&void 0!==a&&a.variationsOutput&&0!==r.variation_id?(o.content_id=String(wpmDataLayer.products[r.variation_id].dyn_r_ids[wpmDataLayer.pixels.bing.dynamic_remarketing.id_type]),o.content_name=wpmDataLayer.products[r.variation_id].name,e.push(o)):(o.content_id=String(wpmDataLayer.products[r.id].dyn_r_ids[wpmDataLayer.pixels.bing.dynamic_remarketing.id_type]),o.content_name=wpmDataLayer.products[r.id].name,e.push(o))}return e}}(window.wpm=window.wpm||{},jQuery),jQuery(document).on("wpmLoadPixels",(function(){var e,t,a;!wpm.canIFire("ads","tiktok-ads")||null!==(e=wpmDataLayer)&&void 0!==e&&null!==(t=e.pixels)&&void 0!==t&&null!==(a=t.tiktok)&&void 0!==a&&a.loaded||wpm.loadTikTokPixel()})),jQuery(document).on("wpmAddToCart",(function(e,t){try{var a,o,r;if(null===(a=wpmDataLayer)||void 0===a||null===(o=a.pixels)||void 0===o||null===(r=o.tiktok)||void 0===r||!r.loaded)return;ttq.track("AddToCart",{content_id:t.dyn_r_ids[wpmDataLayer.pixels.tiktok.dynamic_remarketing.id_type],content_type:"product",content_name:t.name,quantity:t.quantity,value:t.price,currency:t.currency})}catch(e){console.error(e)}})),jQuery(document).on("wpmBeginCheckout",(function(e){try{var t,a,o;if(null===(t=wpmDataLayer)||void 0===t||null===(a=t.pixels)||void 0===a||null===(o=a.tiktok)||void 0===o||!o.loaded)return;ttq.track("InitiateCheckout")}catch(e){console.error(e)}})),jQuery(document).on("wpmViewItem",(function(e,t){try{var a,o,r;if(null===(a=wpmDataLayer)||void 0===a||null===(o=a.pixels)||void 0===o||null===(r=o.tiktok)||void 0===r||!r.loaded)return;ttq.track("ViewContent",{content_id:t.dyn_r_ids[wpmDataLayer.pixels.tiktok.dynamic_remarketing.id_type],content_type:"product",content_name:t.name,quantity:t.quantity,value:t.price,currency:t.currency})}catch(e){console.error(e)}})),jQuery(document).on("wpmAddToWishlist",(function(e,t){try{var a,o,r;if(null===(a=wpmDataLayer)||void 0===a||null===(o=a.pixels)||void 0===o||null===(r=o.tiktok)||void 0===r||!r.loaded)return;ttq.track("AddToWishlist",{content_id:t.dyn_r_ids[wpmDataLayer.pixels.tiktok.dynamic_remarketing.id_type],content_type:"product",content_name:t.name,quantity:t.quantity,value:t.price,currency:t.currency})}catch(e){console.error(e)}})),jQuery(document).on("wpmSearch",(function(){try{var e,t,a;if(null===(e=wpmDataLayer)||void 0===e||null===(t=e.pixels)||void 0===t||null===(a=t.tiktok)||void 0===a||!a.loaded)return;ttq.track("Search")}catch(e){console.error(e)}})),jQuery(document).on("wpmOrderReceivedPage",(function(){try{var e,t,a;if(null===(e=wpmDataLayer)||void 0===e||null===(t=e.pixels)||void 0===t||null===(a=t.tiktok)||void 0===a||!a.loaded)return;ttq.track(wpmDataLayer.pixels.tiktok.purchase_event_name,{value:wpmDataLayer.order.value_filtered,currency:wpmDataLayer.order.currency,contents:wpm.getTikTokOrderItemIds()})}catch(e){console.error(e)}}))},574:()=>{!function(e,t,a){e.loadTwitterPixel=function(){try{var e,t,a;null!==(e=wpmDataLayer)&&void 0!==e&&null!==(t=e.pixels)&&void 0!==t&&null!==(a=t.twitter)&&void 0!==a&&a.pixel_id&&(wpmDataLayer.pixels.twitter.loaded=!0,o=window,r=document,i="script",o.twq||(n=o.twq=function(){n.exe?n.exe.apply(n,arguments):n.queue.push(arguments)},n.version="1.1",n.queue=[],(l=r.createElement(i)).async=!0,l.src="//static.ads-twitter.com/uwt.js",(d=r.getElementsByTagName(i)[0]).parentNode.insertBefore(l,d)),twq("init",wpmDataLayer.pixels.twitter.pixel_id),twq("track","PageView"))}catch(o){console.error(o)}var o,r,i,n,l,d},e.twitterGetOrderContentIds=function(){let e=[];for(const[o,r]of Object.entries(wpmDataLayer.order.items)){var t,a;null!==(t=wpmDataLayer)&&void 0!==t&&null!==(a=t.general)&&void 0!==a&&a.variationsOutput&&0!==r.variation_id?e.push(String(wpmDataLayer.products[r.variation_id].dyn_r_ids[wpmDataLayer.pixels.twitter.dynamic_remarketing.id_type])):e.push(String(wpmDataLayer.products[r.id].dyn_r_ids[wpmDataLayer.pixels.twitter.dynamic_remarketing.id_type]))}return e}}(window.wpm=window.wpm||{},jQuery),jQuery(document).on("wpmLoadPixels",(function(){var e,t,a;!wpm.canIFire("ads","twitter-ads")||null!==(e=wpmDataLayer)&&void 0!==e&&null!==(t=e.pixels)&&void 0!==t&&null!==(a=t.twitter)&&void 0!==a&&a.loaded||wpm.loadTwitterPixel()})),jQuery(document).on("wpmAddToCart",(function(e,t){try{var a,o,r;if(null===(a=wpmDataLayer)||void 0===a||null===(o=a.pixels)||void 0===o||null===(r=o.twitter)||void 0===r||!r.loaded)return;twq("track","AddToCart")}catch(e){console.error(e)}})),jQuery(document).on("wpmViewItem",(function(e,t){try{var a,o,r;if(null===(a=wpmDataLayer)||void 0===a||null===(o=a.pixels)||void 0===o||null===(r=o.twitter)||void 0===r||!r.loaded)return;twq("track","ViewContent")}catch(e){console.error(e)}})),jQuery(document).on("wpmAddToWishlist",(function(e,t){try{var a,o,r;if(null===(a=wpmDataLayer)||void 0===a||null===(o=a.pixels)||void 0===o||null===(r=o.twitter)||void 0===r||!r.loaded)return;twq("track","AddToWishlist")}catch(e){console.error(e)}})),jQuery(document).on("wpmBeginCheckout",(function(e,t){try{var a,o,r;if(null===(a=wpmDataLayer)||void 0===a||null===(o=a.pixels)||void 0===o||null===(r=o.twitter)||void 0===r||!r.loaded)return;twq("track","InitiateCheckout")}catch(e){console.error(e)}})),jQuery(document).on("wpmSearch",(function(){try{var e,t,a;if(null===(e=wpmDataLayer)||void 0===e||null===(t=e.pixels)||void 0===t||null===(a=t.twitter)||void 0===a||!a.loaded)return;twq("track","Search")}catch(e){console.error(e)}})),jQuery(document).on("wpmOrderReceivedPage",(function(){try{var e,t,a;if(null===(e=wpmDataLayer)||void 0===e||null===(t=e.pixels)||void 0===t||null===(a=t.twitter)||void 0===a||!a.loaded)return;twq("track","Purchase",{order_id:wpmDataLayer.order.id,value:wpmDataLayer.order.value_filtered,currency:wpmDataLayer.order.currency,num_items:wpmDataLayer.order.quantity,content_ids:wpm.twitterGetOrderContentIds()})}catch(e){console.error(e)}}))},560:()=>{wpm.wpmDataLayerExists().then((function(){jQuery(document).trigger("wpmPreLoadPixels",{})})).then((function(){wpm.pageLoaded().then((function(){jQuery(document).trigger("wpmLoad",{})}))}))},230:()=>{!function(e,t,a){const o="_wpm_order_ids",r="_wpm_endpoint_available",i="/wp-json/";function n(){return""!==e.getCookie(o)}e.emailSelected=!1,e.paymentMethodSelected=!1,e.useRestEndpoint=function(){return e.isSessionStorageAvailable()&&e.isRestEndpointAvailable()&&e.isBelowRestErrorThreshold()},e.isBelowRestErrorThreshold=function(){return window.sessionStorage.getItem(0)<=10},e.isRestEndpointAvailable=function(){if(window.sessionStorage.getItem(r))return JSON.parse(window.sessionStorage.getItem(r));e.testEndpoint()},e.isSessionStorageAvailable=function(){return!!window.sessionStorage},e.testEndpoint=function(){let e=arguments.length>0&&arguments[0]!==a?arguments[0]:location.protocol+"//"+location.host+i,t=arguments.length>1&&arguments[1]!==a?arguments[1]:r;jQuery.ajax(e,{type:"HEAD",timeout:1e3,statusCode:{200:function(e){window.sessionStorage.setItem(t,JSON.stringify(!0))},404:function(e){window.sessionStorage.setItem(t,JSON.stringify(!1))},0:function(e){window.sessionStorage.setItem(t,JSON.stringify(!1))}}}).then((e=>{}))},e.isWpmRestEndpointAvailable=function(){let t=arguments.length>0&&arguments[0]!==a?arguments[0]:r;return!!e.getCookie(t)},e.writeOrderIdToStorage=function(t){if(window.Storage)if(null===localStorage.getItem(o)){let e=[];e.push(t),window.localStorage.setItem(o,JSON.stringify(e))}else{let e=JSON.parse(localStorage.getItem(o));e.includes(t)||(e.push(t),window.localStorage.setItem(o,JSON.stringify(e)))}else{let a=new Date;a.setDate(a.getDate()+365);let r=[];n()&&(r=JSON.parse(e.getCookie(o))),r.includes(t)||(r.push(t),document.cookie="_wpm_order_ids="+JSON.stringify(r)+";expires="+a.toUTCString())}"function"==typeof e.storeOrderIdOnServer&&wpmDataLayer.orderDeduplication&&e.storeOrderIdOnServer(t)},e.isOrderIdStored=function(t){return wpmDataLayer.orderDeduplication?window.Storage?null!==localStorage.getItem(o)&&JSON.parse(localStorage.getItem(o)).includes(t):!!n()&&JSON.parse(e.getCookie(o)).includes(t):(console.log("order duplication prevention: off"),!1)},e.isEmail=function(e){return/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(e)},e.removeProductFromCart=function(t){let o=arguments.length>1&&arguments[1]!==a?arguments[1]:null;try{if(!t)throw Error("Wasn't able to retrieve a productId");if(!(t=getIdBasedOndVariationsOutputSetting(t)))throw Error("Wasn't able to retrieve a productId");let a;if(a=null==o?wpmDataLayer.cart[t].quantity:o,wpmDataLayer.cart[t]){let r=e.getProductDetailsFormattedForEvent(t,a);jQuery(document).trigger("wpmRemoveFromCart",r),null==o||wpmDataLayer.cart[t].quantity===o?(delete wpmDataLayer.cart[t],sessionStorage&&sessionStorage.setItem("wpmDataLayerCart",JSON.stringify(wpmDataLayer.cart))):(wpmDataLayer.cart[t].quantity=wpmDataLayer.cart[t].quantity-a,sessionStorage&&sessionStorage.setItem("wpmDataLayerCart",JSON.stringify(wpmDataLayer.cart)))}}catch(e){console.error(e)}},getIdBasedOndVariationsOutputSetting=function(e){try{var t,a;return null!==(t=wpmDataLayer)&&void 0!==t&&null!==(a=t.general)&&void 0!==a&&a.variationsOutput?e:wpmDataLayer.products[e].isVariation?wpmDataLayer.products[e].parentId:e}catch(e){console.error(e)}},e.addProductToCart=function(t,a){try{var o;if(!t)throw Error("Wasn't able to retrieve a productId");if(!(t=getIdBasedOndVariationsOutputSetting(t)))throw Error("Wasn't able to retrieve a productId");if(null!==(o=wpmDataLayer)&&void 0!==o&&o.products[t]){var r;let o=e.getProductDetailsFormattedForEvent(t,a);jQuery(document).trigger("wpmAddToCart",o),null!==(r=wpmDataLayer)&&void 0!==r&&r.cart[t]?wpmDataLayer.cart[t].quantity=wpmDataLayer.cart[t].quantity+a:("cart"in wpmDataLayer||(wpmDataLayer.cart={}),wpmDataLayer.cart[t]=e.getProductDetailsFormattedForEvent(t,a)),sessionStorage&&sessionStorage.setItem("wpmDataLayerCart",JSON.stringify(wpmDataLayer.cart))}}catch(t){console.error(t),e.getCartItemsFromBackend()}},e.getCartItems=function(){sessionStorage?sessionStorage.getItem("wpmDataLayerCart")&&"order_received_page"!==wpmDataLayer.shop.page_type?e.saveCartObjectToDataLayer(JSON.parse(sessionStorage.getItem("wpmDataLayerCart"))):sessionStorage.setItem("wpmDataLayerCart",JSON.stringify({})):e.getCartItemsFromBackend()},e.getCartItemsFromBackend=function(){try{let t={action:"wpm_get_cart_items"};jQuery.ajax({type:"get",dataType:"json",url:e.ajax_url,data:t,success:function(t){t.cart||(t.cart={}),e.saveCartObjectToDataLayer(t.cart),sessionStorage&&sessionStorage.setItem("wpmDataLayerCart",JSON.stringify(t.cart))}})}catch(e){console.error(e)}},e.getProductsFromBackend=function(t){if((t=t.filter((e=>!wpmDataLayer.products.hasOwnProperty(e))))&&0!==t.length)try{let a={action:"wpm_get_product_ids",productIds:t};jQuery.ajax({type:"get",dataType:"json",url:e.ajax_url,data:a,success:function(e){wpmDataLayer.products=Object.assign({},wpmDataLayer.products,e)},error:function(e){console.log(e)}})}catch(e){console.error(e)}},e.saveCartObjectToDataLayer=function(e){wpmDataLayer.cart=e,wpmDataLayer.products=Object.assign({},wpmDataLayer.products,e)},e.fireCheckoutOption=function(e){let t=arguments.length>1&&arguments[1]!==a?arguments[1]:null,o=arguments.length>2&&arguments[2]!==a?arguments[2]:null,r={step:e,checkout_option:t,value:o};jQuery(document).trigger("wpmFireCheckoutOption",r)},e.fireCheckoutProgress=function(e){let t={step:e};jQuery(document).trigger("wpmFireCheckoutProgress",t)},e.getPostIdFromString=function(e){try{return e.match(/(post-)(\d+)/)[2]}catch(e){console.error(e)}},e.triggerViewItemList=function(t){if(!t)throw Error("Wasn't able to retrieve a productId");if(!(t=getIdBasedOndVariationsOutputSetting(t)))throw Error("Wasn't able to retrieve a productId");jQuery(document).trigger("wpmViewItemList",e.getProductDataForViewItemEvent(t))},e.getProductDataForViewItemEvent=function(t){if(!t)throw Error("Wasn't able to retrieve a productId");try{if(wpmDataLayer.products[t])return e.getProductDetailsFormattedForEvent(t)}catch(e){console.error(e)}},e.getMainProductIdFromProductPage=function(){try{return["simple","variable","grouped","composite","bundle"].indexOf(wpmDataLayer.shop.product_type)>=0&&jQuery(".wpmProductId:first").data("id")}catch(e){console.error(e)}},e.viewItemListTriggerTestMode=function(e){jQuery(e).css({position:"relative"}),jQuery(e).append('<div id="viewItemListTriggerOverlay"></div>'),jQuery(e).find("#viewItemListTriggerOverlay").css({"z-index":"10",display:"block",position:"absolute",height:"100%",top:"0",left:"0",right:"0",opacity:wpmDataLayer.viewItemListTrigger.opacity,"background-color":wpmDataLayer.viewItemListTrigger.backgroundColor})},e.getSearchTermFromUrl=function(){try{return new URLSearchParams(window.location.search).get("s")}catch(e){console.error(e)}};let l,d={};e.observerCallback=function(t,a){t.forEach((t=>{try{let o,r=jQuery(t.target).data("ioid");if(o=jQuery(t.target).next(".wpmProductId").length?jQuery(t.target).next(".wpmProductId").data("id"):jQuery(t.target).find(".wpmProductId").data("id"),!o)throw Error("wpmProductId element not found");t.isIntersecting?d[r]=setTimeout((()=>{e.triggerViewItemList(o),wpmDataLayer.viewItemListTrigger.testMode&&e.viewItemListTriggerTestMode(t.target),!1===wpmDataLayer.viewItemListTrigger.repeat&&a.unobserve(t.target)}),wpmDataLayer.viewItemListTrigger.timeout):(clearTimeout(d[r]),wpmDataLayer.viewItemListTrigger.testMode&&jQuery(t.target).find("#viewItemListTriggerOverlay").remove())}catch(e){console.error(e)}}))};let s,c=0;e.startIntersectionObserverToWatch=function(){try{e.urlHasParameter("vildemomode")&&(wpmDataLayer.viewItemListTrigger.testMode=!0),l=new IntersectionObserver(e.observerCallback,{threshold:wpmDataLayer.viewItemListTrigger.threshold}),s=jQuery(".wpmProductId").map((function(e,t){return jQuery(t).parent().hasClass("type-product")||jQuery(t).parent().hasClass("product")||jQuery(t).parent().hasClass("product-item-inner")?jQuery(t).parent():jQuery(t).prev().hasClass("wc-block-grid__product")||jQuery(t).prev().hasClass("product")||jQuery(t).prev().hasClass("product-small")||jQuery(t).prev().hasClass("woocommerce-LoopProduct-link")?jQuery(this).prev():jQuery(t).closest(".product").length?jQuery(t).closest(".product"):void 0})),s.each((function(e,t){jQuery(t[0]).data("ioid",c++),l.observe(t[0])}))}catch(e){console.error(e)}},e.startProductsMutationObserverToWatch=function(){try{let e=jQuery(".wpmProductId:eq(0)").parents().has(jQuery(".wpmProductId:eq(1)").parents()).first();e.length&&u.observe(e[0],{attributes:!0,childList:!0,characterData:!0})}catch(e){console.error(e)}};let u=new MutationObserver((function(e){e.forEach((function(e){let t=e.addedNodes;null!==t&&jQuery(t).each((function(){(jQuery(this).hasClass("type-product")||jQuery(this).hasClass("product-small")||jQuery(this).hasClass("wc-block-grid__product"))&&p(this)&&(jQuery(this).data("ioid",c++),l.observe(this))}))}))})),p=function(e){return!(!jQuery(e).find(".wpmProductId").length&&!jQuery(e).siblings(".wpmProductId").length)};e.setCookie=function(e){let t=arguments.length>1&&arguments[1]!==a?arguments[1]:"",o=arguments.length>2&&arguments[2]!==a?arguments[2]:null;if(o){let a=new Date;a.setTime(a.getTime()+24*o*60*60*1e3);let r="expires="+a.toUTCString();document.cookie=e+"="+t+";"+r+";path=/"}else document.cookie=e+"="+t+";path=/"},e.getCookie=function(e){let t=e+"=",a=decodeURIComponent(document.cookie).split(";");for(let e=0;e<a.length;e++){let o=a[e];for(;" "==o.charAt(0);)o=o.substring(1);if(0==o.indexOf(t))return o.substring(t.length,o.length)}return""},e.getWpmSessionData=function(){if(window.sessionStorage){let e=window.sessionStorage.getItem("_wpm");return null!==e?JSON.parse(e):{}}return{}},e.setWpmSessionData=function(e){window.sessionStorage&&window.sessionStorage.setItem("_wpm",JSON.stringify(e))},e.storeOrderIdOnServer=function(t){try{let a={action:"wpm_purchase_pixels_fired",order_id:t,nonce:e.nonce};jQuery.ajax({type:"post",dataType:"json",url:e.ajax_url,data:a,success:function(e){!1===e.success&&console.log(e)},error:function(e){console.log(e)}})}catch(e){console.error(e)}},e.getProductIdByCartItemKeyUrl=function(e){let t,a=new URLSearchParams(e.search).get("remove_item");return t=0===wpmDataLayer.cartItemKeys[a].variation_id?wpmDataLayer.cartItemKeys[a].product_id:wpmDataLayer.cartItemKeys[a].variation_id,t},e.getAddToCartLinkProductIds=function(){return jQuery("a").map((function(){let e=jQuery(this).attr("href");if(e&&e.includes("?add-to-cart=")){let t=e.match(/(add-to-cart=)(\d+)/);if(t)return t[2]}})).get()},e.getProductDetailsFormattedForEvent=function(e){let t=arguments.length>1&&arguments[1]!==a?arguments[1]:1,o={id:e.toString(),dyn_r_ids:wpmDataLayer.products[e].dyn_r_ids,name:wpmDataLayer.products[e].name,list_name:wpmDataLayer.shop.list_name,brand:wpmDataLayer.products[e].brand,category:wpmDataLayer.products[e].category,variant:wpmDataLayer.products[e].variant,list_position:wpmDataLayer.products[e].position,quantity:t,price:wpmDataLayer.products[e].price,currency:wpmDataLayer.shop.currency,isVariable:wpmDataLayer.products[e].isVariable,isVariation:wpmDataLayer.products[e].isVariation,parentId:wpmDataLayer.products[e].parentId};return o.isVariation&&(o.parentId_dyn_r_ids=wpmDataLayer.products[e].parentId_dyn_r_ids),o},e.setReferrerToCookie=function(){e.getCookie("wpmReferrer")||e.setCookie("wpmReferrer",document.referrer)},e.getReferrerFromCookie=function(){return e.getCookie("wpmReferrer")?e.getCookie("wpmReferrer"):null},e.getClidFromBrowser=function(){let t,o=arguments.length>0&&arguments[0]!==a?arguments[0]:"gclid";return t={gclid:"_gcl_aw",dclid:"_gcl_dc"},e.getCookie(t[o])?e.getCookie(t[o]).match(/(GCL.[\d]*.)(.*)/)[2]:""},e.getUserAgent=function(){return navigator.userAgent},e.getViewPort=function(){return{width:Math.max(document.documentElement.clientWidth||0,window.innerWidth||0),height:Math.max(document.documentElement.clientHeight||0,window.innerHeight||0)}};let m=function(){let t=e.getCookie("cmplz_statistics"),a=e.getCookie("cmplz_marketing");return!(!e.getCookie("cmplz_consent_status")&&!e.getCookie("cmplz_banner-status"))&&{analytics:"allow"===t,ads:"allow"===a,visitorHasChosen:!0}},y=function(){let t=e.getCookie("cookielawinfo-checkbox-analytics")||e.getCookie("cookielawinfo-checkbox-analytiques"),a=e.getCookie("cookielawinfo-checkbox-advertisement")||e.getCookie("cookielawinfo-checkbox-publicite"),o=e.getCookie("CookieLawInfoConsent");return!(!t&&!a)&&{analytics:"yes"===t,ads:"yes"===a,visitorHasChosen:!!o}},g={categories:{},pixels:[],mode:"category",visitorHasChosen:!1};e.getConsentValues=function(){return g},e.setConsentValueCategories=function(){let e=arguments.length>0&&arguments[0]!==a&&arguments[0],t=arguments.length>1&&arguments[1]!==a&&arguments[1];g.categories.analytics=e,g.categories.ads=t},e.updateConsentCookieValues=function(){let t,o=arguments.length>0&&arguments[0]!==a&&arguments[0];if(t=e.getCookie("CookieConsent"))t=decodeURI(t),g.categories.analytics=t.indexOf("statistics:true")>=0,g.categories.ads=t.indexOf("marketing:true")>=0,g.visitorHasChosen=!0;else if(t=e.getCookie("CookieScriptConsent"))t=JSON.parse(t),"reject"===t.action?(g.categories.analytics=!1,g.categories.ads=!1):2===t.categories.length?(g.categories.analytics=!0,g.categories.ads=!0):(g.categories.analytics=t.categories.indexOf("performance")>=0,g.categories.ads=t.categories.indexOf("targeting")>=0),g.visitorHasChosen=!0;else if(t=e.getCookie("borlabs-cookie")){var r,i,n,l,d,s,c,u;t=decodeURI(t),t=JSON.parse(t),g.categories.analytics=!(null===(r=t)||void 0===r||null===(i=r.consents)||void 0===i||!i.statistics),g.categories.ads=!(null===(n=t)||void 0===n||null===(l=n.consents)||void 0===l||!l.marketing),g.visitorHasChosen=!0,g.pixels=[...(null===(d=t)||void 0===d||null===(s=d.consents)||void 0===s?void 0:s.statistics)||[],...(null===(c=t)||void 0===c||null===(u=c.consents)||void 0===u?void 0:u.marketing)||[]],g.mode="pixel"}else(t=m())?(g.categories.analytics=!0===t.analytics,g.categories.ads=!0===t.ads,g.visitorHasChosen=t.visitorHasChosen):(t=e.getCookie("cookie_notice_accepted"))?(g.categories.analytics=!0,g.categories.ads=!0,g.visitorHasChosen=!0):(t=e.getCookie("hu-consent"))?(t=JSON.parse(t),g.categories.analytics=!!t.categories[3],g.categories.ads=!!t.categories[4],g.visitorHasChosen=!0):(t=y())?(g.categories.analytics=!0===t.analytics,g.categories.ads=!0===t.ads,g.visitorHasChosen=!0===t.visitorHasChosen):(t=e.getCookie("moove_gdpr_popup"))?(t=JSON.parse(t),g.categories.analytics="1"===t.thirdparty,g.categories.ads="1"===t.advanced,g.visitorHasChosen=!0):(g.categories.analytics=!o,g.categories.ads=!o)},e.updateConsentCookieValues(),e.setConsentDefaultValuesToExplicit=function(){g.categories={analytics:!1,ads:!1}},e.canIFire=function(t,a){let o;return"category"===g.mode?o=!!g.categories[t]:"pixel"===g.mode?o=g.pixels.includes(a):(console.error("Couldn't find a valid consent mode in wpmConsentValues"),o=!1),!!o||(e.urlHasParameter("debugConsentMode")&&(null!==(r=wpmDataLayer)&&void 0!==r&&null!==(i=r.shop)&&void 0!==i&&null!==(n=i.cookie_consent_mgmt)&&void 0!==n&&n.explicit_consent?console.log('WooCommerce Pixel Manager: The "'+a+" (category: "+t+')" pixel has not fired because you have not given consent for it yet. (The shop is in explicit consent mode.)'):console.log('WooCommerce Pixel Manager: The "'+a+" (category: "+t+')" pixel has not fired because you have removed consent for this pixel. (The shop is in implicit consent mode.)')),!1);var r,i,n},e.scriptTagObserver=new MutationObserver((a=>{a.forEach((a=>{let{addedNodes:o}=a;[...o].forEach((a=>{t(a).data("wpm-cookie-category")&&(e.shouldScriptBeActive(a)?e.unblockScript(a):e.blockScript(a))}))}))})),e.scriptTagObserver.observe(document.head,{childList:!0,subtree:!0}),window.addEventListener("DOMContentLoaded",(()=>e.scriptTagObserver.disconnect())),e.shouldScriptBeActive=function(e){var a,o,r,i;return!((wpmDataLayer.shop.cookie_consent_mgmt.explicit_consent||g.visitorHasChosen)&&("category"!==g.mode||!t(e).data("wpm-cookie-category").split(",").some((e=>g.categories[e])))&&("pixel"!==g.mode||!g.pixels.includes(t(e).data("wpm-pixel-name")))&&("pixel"!==g.mode||"google"!==t(e).data("wpm-pixel-name")||!["google-analytics","google-ads"].some((e=>g.pixels.includes(e))))&&(null===(a=wpmDataLayer)||void 0===a||null===(o=a.pixels)||void 0===o||null===(r=o.google)||void 0===r||null===(i=r.consent_mode)||void 0===i||!i.active||"google"!==t(e).data("wpm-pixel-name")))},e.unblockScript=function(e){let o=arguments.length>1&&arguments[1]!==a&&arguments[1];o&&t(e).remove();let r=t(e).data("wpm-src");r&&t(e).attr("src",r),e.type="text/javascript",o&&t(e).appendTo("head"),jQuery(document).trigger("wpmPreLoadPixels",{})},e.blockScript=function(e){let o=arguments.length>1&&arguments[1]!==a&&arguments[1];o&&t(e).remove(),t(e).attr("src")&&t(e).removeAttr("src"),e.type="blocked/javascript",o&&t(e).appendTo("head")},e.unblockAllScripts=function(){let o=!(arguments.length>0&&arguments[0]!==a)||arguments[0],r=!(arguments.length>1&&arguments[1]!==a)||arguments[1];t.each(t('script[type="blocked/javascript"]'),(function(a,i){(t(i).data("wpm-cookie-category").includes("analytics")&&o||t(i).data("wpm-cookie-category").includes("ads")&&r)&&e.unblockScript(i,!0)})),jQuery(document).trigger("wpmPreLoadPixels",{})},e.unblockSelectedPixels=function(){t.each(t('script[type="blocked/javascript"]'),(function(a,o){(g.pixels.includes(t(o).data("wpm-pixel-name"))||"google"===t(o).data("wpm-pixel-name")&&["google-analytics","google-ads"].some((e=>g.pixels.includes(e))))&&e.unblockScript(o,!0)})),jQuery(document).trigger("wpmPreLoadPixels",{})},window.addEventListener("borlabs-cookie-consent-saved",(function(t){e.updateConsentCookieValues(),"pixel"===g.mode?(e.unblockSelectedPixels(),e.updateGoogleConsentMode(g.pixels.includes("google-analytics"),g.pixels.includes("google-ads"))):(e.unblockAllScripts(g.categories.analytics,g.categories.ads),e.updateGoogleConsentMode(g.categories.analytics,g.categories.ads))})),window.addEventListener("CookiebotOnAccept",(function(t){Cookiebot.consent.statistics&&(g.categories.analytics=!0),Cookiebot.consent.marketing&&(g.categories.ads=!0),e.unblockAllScripts(g.categories.analytics,g.categories.ads),e.updateGoogleConsentMode(g.categories.analytics,g.categories.ads)}),!1),window.addEventListener("CookieScriptAccept",(function(t){t.detail.categories.includes("performance")&&(g.categories.analytics=!0),t.detail.categories.includes("targeting")&&(g.categories.ads=!0),e.unblockAllScripts(g.categories.analytics,g.categories.ads),e.updateGoogleConsentMode(g.categories.analytics,g.categories.ads)})),window.addEventListener("CookieScriptAcceptAll",(function(t){e.unblockAllScripts(!0,!0),e.updateGoogleConsentMode(!0,!0)})),document.addEventListener("cmplzStatusChange",(function(t){e.updateConsentCookieValues(),e.unblockAllScripts(g.categories.analytics,g.categories.ads),e.updateGoogleConsentMode(g.categories.analytics,g.categories.ads)})),document.addEventListener("setCookieNotice",(function(t){e.updateConsentCookieValues(),e.unblockAllScripts(g.categories.analytics,g.categories.ads),e.updateGoogleConsentMode(g.categories.analytics,g.categories.ads)})),e.huObserver=new MutationObserver((function(t){t.forEach((t=>{let{addedNodes:a}=t;[...a].forEach((t=>{"hu"===t.id&&jQuery(".hu-cookies-save").on("click",(function(t){e.updateConsentCookieValues(),e.unblockAllScripts(g.categories.analytics,g.categories.ads),e.updateGoogleConsentMode(g.categories.analytics,g.categories.ads)}))}))}))})),window.hu&&e.huObserver.observe(document.documentElement||document.body,{childList:!0,subtree:!0}),e.version=function(){console.log(wpmDataLayer.version)},e.loadScriptAndCacheIt=function(e,t){return t=jQuery.extend(t||{},{dataType:"script",cache:!0,url:e}),jQuery.ajax(t)},e.getOrderItemPrice=function(e){return(e.total+e.total_tax)/e.quantity},e.hasLoginEventFired=function(){let t=e.getWpmSessionData();return null==t?void 0:t.loginEventFired},e.setLoginEventFired=function(){let t=e.getWpmSessionData();t.loginEventFired=!0,e.setWpmSessionData(t)},e.wpmDataLayerExists=function(){return new Promise((function(e){!function t(){if("undefined"!=typeof wpmDataLayer)return e();setTimeout(t,50)}()}))},e.pageLoaded=function(){return new Promise((function(e){!function t(){if("complete"===document.readyState)return e();setTimeout(t,50)}()}))},e.pageReady=function(){return new Promise((function(e){!function t(){if("interactive"===document.readyState||"complete"===document.readyState)return e();setTimeout(t,50)}()}))},e.isMiniCartActive=function(){if(window.sessionStorage){for(const[e,t]of Object.entries(window.sessionStorage))if(e.includes("wc_fragments"))return!0;return!1}return!1},e.doesWooCommerceCartExist=function(){return document.cookie.includes("woocommerce_items_in_cart")},e.urlHasParameter=function(e){return new URLSearchParams(window.location.search).has(e)},window.wpmLoaded={}}(window.wpm=window.wpm||{},jQuery),wpm.pageReady().then((function(){wpm.wpmDataLayerExists().then((function(){wpm.startIntersectionObserverToWatch(),wpm.startProductsMutationObserverToWatch()})),jQuery(document).on("click",".remove_from_cart_button, .remove",(function(e){try{let e=new URL(jQuery(this).attr("href")),t=wpm.getProductIdByCartItemKeyUrl(e);wpm.removeProductFromCart(t)}catch(e){console.error(e)}})),jQuery(document).on("click",".add_to_cart_button:not(.product_type_variable), .ajax_add_to_cart, .single_add_to_cart_button",(function(e){try{if("product"===wpmDataLayer.shop.page_type){if(void 0!==jQuery(this).attr("href")&&jQuery(this).attr("href").includes("add-to-cart")){let e=1,t=jQuery(this).data("product_id");wpm.addProductToCart(t,e)}else if("simple"===wpmDataLayer.shop.product_type){let e=Number(jQuery(".input-text.qty").val());e||0===e||(e=1);let t=jQuery(this).val();wpm.addProductToCart(t,e)}else if("variable"===wpmDataLayer.shop.product_type){let e=Number(jQuery(".input-text.qty").val());e||0===e||(e=1);let t=jQuery("[name='variation_id']").val();wpm.addProductToCart(t,e)}else if("grouped"===wpmDataLayer.shop.product_type)jQuery(".woocommerce-grouped-product-list-item").each((function(){let e=Number(jQuery(this).find(".input-text.qty").val());e||0===e||(e=1);let t=jQuery(this).attr("class"),a=wpm.getPostIdFromString(t);wpm.addProductToCart(a,e)}));else if("bundle"===wpmDataLayer.shop.product_type){let e=Number(jQuery(".input-text.qty").val());e||0===e||(e=1);let t=jQuery("input[name=add-to-cart]").val();wpm.addProductToCart(t,e)}}else{let e=1,t=jQuery(this).data("product_id");wpm.addProductToCart(t,e)}}catch(e){console.error(e)}})),jQuery(document).one("click","a:not(.add_to_cart_button, .ajax_add_to_cart, .single_add_to_cart_button)",(function(e){try{if(jQuery(e.target).closest("a").attr("href")){let t=jQuery(e.target).closest("a").attr("href");if(t.includes("add-to-cart=")){let e=t.match(/(add-to-cart=)(\d+)/);e&&wpm.addProductToCart(e[2],1)}}}catch(e){console.error(e)}})),jQuery(document).on("click",".woocommerce-LoopProduct-link, .wc-block-grid__product, .product, .product-small, .type-product",(function(e){try{let e=jQuery(this).nextAll(".wpmProductId:first").data("id");if(e){if(e=getIdBasedOndVariationsOutputSetting(e),!e)throw Error("Wasn't able to retrieve a productId");if(wpmDataLayer.products&&wpmDataLayer.products[e]){let t=wpm.getProductDetailsFormattedForEvent(e);jQuery(document).trigger("wpmSelectContentGaUa",t),jQuery(document).trigger("wpmSelectItem",t)}}}catch(e){console.error(e)}})),jQuery(document).one("click",".checkout-button, .cart-checkout-button, .button.checkout",(function(e){jQuery(document).trigger("wpmBeginCheckout")})),jQuery(document).on("input","#billing_email",(function(){wpm.isEmail(jQuery(this).val())&&(wpm.fireCheckoutProgress(2),wpm.emailSelected=!0)})),jQuery(document).on("click",".wc_payment_methods",(function(){!1===wpm.paymentMethodSelected&&wpm.fireCheckoutProgress(3),wpm.fireCheckoutOption(3,jQuery("input[name='payment_method']:checked").val()),wpm.paymentMethodSelected=!0})),jQuery(document).one("click","#place_order",(function(){!1===wpm.emailSelected&&wpm.fireCheckoutProgress(2),!1===wpm.paymentMethodSelected&&(wpm.fireCheckoutProgress(3),wpm.fireCheckoutOption(3,jQuery("input[name='payment_method']:checked").val())),wpm.fireCheckoutProgress(4)})),jQuery(document).on("click","[name='update_cart']",(function(e){try{jQuery(".cart_item").each((function(){let e=new URL(jQuery(this).find(".product-remove").find("a").attr("href")),t=wpm.getProductIdByCartItemKeyUrl(e),a=jQuery(this).find(".qty").val();0===a?wpm.removeProductFromCart(t):a<wpmDataLayer.cart[t].quantity?wpm.removeProductFromCart(t,wpmDataLayer.cart[t].quantity-a):a>wpmDataLayer.cart[t].quantity&&wpm.addProductToCart(t,a-wpmDataLayer.cart[t].quantity)}))}catch(e){console.error(e),wpm.getCartItemsFromBackend()}})),jQuery(document).on("click",".add_to_wishlist, .wl-add-to",(function(){try{let e;if(jQuery(this).data("productid")?e=jQuery(this).data("productid"):jQuery(this).data("product-id")&&(e=jQuery(this).data("product-id")),!e)throw Error("Wasn't able to retrieve a productId");let t=wpm.getProductDetailsFormattedForEvent(e);jQuery(document).trigger("wpmAddToWishlist",t)}catch(e){console.error(e)}})),jQuery(document).on("updated_cart_totals",(function(){jQuery(document).trigger("wpmViewCart")})),jQuery(".single_variation_wrap").on("show_variation",(function(e,t){try{let e=getIdBasedOndVariationsOutputSetting(t.variation_id);if(!e)throw Error("Wasn't able to retrieve a productId");if(wpmDataLayer.products&&wpmDataLayer.products[e]){let t=wpm.getProductDetailsFormattedForEvent(e);jQuery(document).trigger("wpmViewItem",t)}}catch(e){console.error(e)}})),jQuery(".single_variation_wrap").on("hide_variation",(function(e,t){try{var a,o;let e=jQuery("body").attr("class").match(/(postid-)(\d+)/)[2];if(!e)throw Error("Wasn't able to retrieve a productId");if("variable"===wpmDataLayer.shop.product_type&&null!==(a=wpmDataLayer)&&void 0!==a&&null!==(o=a.general)&&void 0!==o&&o.variationsOutput)for(const[t,a]of Object.entries(wpmDataLayer.products))if("parentId"in a){e=a.id;break}if(wpmDataLayer.products&&wpmDataLayer.products[e]){let t=wpm.getProductDetailsFormattedForEvent(e);jQuery(document).trigger("wpmViewItem",t)}}catch(e){console.error(e)}}))})),jQuery(window).on("wpmLoad",(function(){try{wpm.doesWooCommerceCartExist()&&wpm.getCartItems()}catch(e){console.error(e)}})),jQuery(window).on("wpmLoad",(function(){wpmDataLayer.products=wpmDataLayer.products||{};let e=wpm.getAddToCartLinkProductIds();wpm.getProductsFromBackend(e)})),jQuery(window).on("wpmLoad",(function(){if(!wpm.getCookie("wpmReferrer"))if(document.referrer){let e=new URL(document.referrer).hostname;e!==window.location.host?wpm.setCookie("wpmReferrer",e):wpm.setCookie("wpmReferrer","")}else wpm.setCookie("wpmReferrer","")})),jQuery(window).on("wpmLoad",(function(){try{var e;if("undefined"!=typeof wpmDataLayer&&(null===(e=wpmDataLayer)||void 0===e||!e.wpmLoadFired)){var t,a;if(jQuery(document).trigger("wpmLoadAlways"),"product"===wpmDataLayer.shop.page_type&&"variable"!==wpmDataLayer.shop.product_type&&wpm.getMainProductIdFromProductPage()){let e=wpm.getProductDataForViewItemEvent(wpm.getMainProductIdFromProductPage());jQuery(document).trigger("wpmViewItem",e)}else"product_category"===wpmDataLayer.shop.page_type?jQuery(document).trigger("wpmCategory"):"search"===wpmDataLayer.shop.page_type?jQuery(document).trigger("wpmSearch"):"cart"===wpmDataLayer.shop.page_type?jQuery(document).trigger("wpmViewCart"):"order_received_page"===wpmDataLayer.shop.page_type&&wpmDataLayer.order?wpm.isOrderIdStored(wpmDataLayer.order.id)||(jQuery(document).trigger("wpmOrderReceivedPage"),wpm.writeOrderIdToStorage(wpmDataLayer.order.id)):jQuery(document).trigger("wpmEverywhereElse");null!==(t=wpmDataLayer)&&void 0!==t&&null!==(a=t.user)&&void 0!==a&&a.id&&!wpm.hasLoginEventFired()&&(jQuery(document).trigger("wpmLogin"),wpm.setLoginEventFired()),wpmDataLayer.wpmLoadFired=!0}}catch(e){console.error(e)}})),jQuery(window).on("wpmPreLoadPixels",(function(){var e,t,a;null!==(e=wpmDataLayer)&&void 0!==e&&null!==(t=e.shop)&&void 0!==t&&null!==(a=t.cookie_consent_mgmt)&&void 0!==a&&a.explicit_consent&&wpm.updateConsentCookieValues(!0),jQuery(document).trigger("wpmLoadPixels",{})}))},514:()=>{window.wpm=window.wpm||{},jQuery}},t={};function a(o){var r=t[o];if(void 0!==r)return r.exports;var i=t[o]={exports:{}};return e[o](i,i.exports,a),i.exports}a(230),a(514),a(385),a(577),a(354),a(464),a(234),a(785),a(570),a(497),a(271),a(172),a(657),a(986),a(699),a(317),a(623),a(574),a(403),a(560)})();
2
+ //# sourceMappingURL=wpm-public__premium_only.p1.min.js.map
js/public/wpm-public__premium_only.p1.min.js.map ADDED
@@ -0,0 +1 @@
 
1
+ {"version":3,"file":"wpm-public__premium_only.p1.min.js","mappings":"uBAIC,SAAUA,EAAKC,EAAGC,GAElB,IAAIC,EAEJH,EAAII,kBAAoB,WAEvB,IAAI,UACH,UAAIC,oBAAJ,iBAAI,EAAcC,cAAlB,iBAAI,EAAsBC,gBAA1B,OAAI,EAAgCC,WAEnCH,aAAaC,OAAOC,SAASE,QAAS,EAGzBC,EAMuBC,OANrBC,EAM6BC,SAN3BC,EAMoC,SAL9CJ,EAAEK,MAAWC,EAAEN,EAAEK,IAAI,WAAWC,EAAEC,WACrCD,EAAEC,WAAWC,MAAMF,EAAEG,WAAWH,EAAEI,MAAMC,KAAKF,YACzCT,EAAEY,OAAKZ,EAAEY,KAAKN,GAAEA,EAAEK,KAAKL,EAAEA,EAAEP,QAAO,EAAGO,EAAEO,QAAQ,MACnDP,EAAEI,MAAM,IAAGI,EAAEZ,EAAEa,cAAcX,IAAKY,OAAM,EACxCF,EAAEG,IAEF,kDAFQC,EAAEhB,EAAEiB,qBAAqBf,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A,EAAQ,KAMRA,EAAQ,KACRA,EAAQ,KACRA,EAAQ,KACRA,EAAQ,KACRA,EAAQ,KACRA,EAAQ,KACRA,EAAQ,KACRA,EAAQ,KACRA,EAAQ,KAORA,EAAQ,M","sources":["webpack://WooCommerce-Pixel-Manager/./src/js/public/facebook.js","webpack://WooCommerce-Pixel-Manager/./src/js/public/facebook__premium_only.js","webpack://WooCommerce-Pixel-Manager/./src/js/public/google-ads.js","webpack://WooCommerce-Pixel-Manager/./src/js/public/google-ads__premium_only.js","webpack://WooCommerce-Pixel-Manager/./src/js/public/google-ga-4-eec__premium_only.js","webpack://WooCommerce-Pixel-Manager/./src/js/public/google-ga-4.js","webpack://WooCommerce-Pixel-Manager/./src/js/public/google-ga-ua-eec__premium_only.js","webpack://WooCommerce-Pixel-Manager/./src/js/public/google-ga-ua.js","webpack://WooCommerce-Pixel-Manager/./src/js/public/google-optimize.js","webpack://WooCommerce-Pixel-Manager/./src/js/public/google.js","webpack://WooCommerce-Pixel-Manager/./src/js/public/google__premium_only.js","webpack://WooCommerce-Pixel-Manager/./src/js/public/hotjar.js","webpack://WooCommerce-Pixel-Manager/./src/js/public/microsoft-ads__premium_only.js","webpack://WooCommerce-Pixel-Manager/./src/js/public/pinterest__premium_only.js","webpack://WooCommerce-Pixel-Manager/./src/js/public/snapchat__premium_only.js","webpack://WooCommerce-Pixel-Manager/./src/js/public/tiktok__premium_only.js","webpack://WooCommerce-Pixel-Manager/./src/js/public/twitter__premium_only.js","webpack://WooCommerce-Pixel-Manager/./src/js/public/wpm-loader.js","webpack://WooCommerce-Pixel-Manager/./src/js/public/wpm.js","webpack://WooCommerce-Pixel-Manager/./src/js/public/wpm__premium_only.js","webpack://WooCommerce-Pixel-Manager/webpack/bootstrap","webpack://WooCommerce-Pixel-Manager/./src/js/public/main-premium.js"],"sourcesContent":["/**\n * Add functions for Facebook\n * */\n\n(function (wpm, $, undefined) {\n\n\tlet fBUserData\n\n\twpm.loadFacebookPixel = function () {\n\n\t\ttry {\n\t\t\tif (wpmDataLayer?.pixels?.facebook?.pixel_id) {\n\n\t\t\t\twpmDataLayer.pixels.facebook.loaded = true\n\n\t\t\t\t// @formatter:off\n \t\t\t!function(f,b,e,v,n,t,s)\n \t\t\t{if(f.fbq)return;n=f.fbq=function(){n.callMethod?\n \t\t\t\tn.callMethod.apply(n,arguments):n.queue.push(arguments)};\n \t\t\t\tif(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0';\n \t\t\t\tn.queue=[];t=b.createElement(e);t.async=!0;\n \t\t\t\tt.src=v;s=b.getElementsByTagName(e)[0];\n \t\t\t\ts.parentNode.insertBefore(t,s)}(window, document,'script',\n \t\t\t\t'https://connect.facebook.net/en_US/fbevents.js');\n \t\t\t// @formatter:on\n\n\t\t\t\tfbq(\"init\", wpmDataLayer.pixels.facebook.pixel_id)\n\t\t\t\tfbq(\"track\", \"PageView\")\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t}\n\t}\n\n\twpm.getRandomEventId = function () {\n\t\treturn (Math.random() + 1).toString(36).substring(2)\n\t}\n\n\twpm.getFbUserData = function () {\n\t\t// We need the first one for InitiateCheckout\n\t\t// where getting the user_data from the browser is too slow\n\t\t// using wpm.getCookie(), so we cache the user_data earlier.\n\t\t// And we need the second one because the ViewContent hit happens too fast\n\t\t// after adding a variation to the cart because the function to cache\n\t\t// the user_data is too slow. But we can get the user_data using wpm.getCookie()\n\t\t// because we don't move away from the page and can wait for the browser\n\t\t// to get it.\n\t\tif (fBUserData) {\n\t\t\treturn fBUserData\n\t\t} else {\n\t\t\treturn wpm.getFbUserDataFromBrowser()\n\t\t}\n\t}\n\n\twpm.setFbUserData = function () {\n\t\tfBUserData = wpm.getFbUserDataFromBrowser()\n\t}\n\n\twpm.getFbUserDataFromBrowser = function () {\n\t\treturn {\n\t\t\tfbp : wpm.getCookie(\"_fbp\"),\n\t\t\tfbc : wpm.getCookie(\"_fbc\"),\n\t\t\tclient_user_agent: navigator.userAgent,\n\t\t}\n\t}\n\n\twpm.fbViewContent = function (product) {\n\n\t\ttry {\n\t\t\tif (!wpmDataLayer?.pixels?.facebook?.loaded) return\n\n\t\t\tlet eventId = wpm.getRandomEventId()\n\n\t\t\tfbq(\"track\", \"ViewContent\", {\n\t\t\t\tcontent_type: \"product\",\n\t\t\t\tcontent_name: product.name,\n\t\t\t\t// content_category: product.category,\n\t\t\t\tcontent_ids: product.dyn_r_ids[wpmDataLayer.pixels.facebook.dynamic_remarketing.id_type],\n\t\t\t\tcurrency : wpmDataLayer.shop.currency,\n\t\t\t\tvalue : product.price,\n\t\t\t}, {\n\t\t\t\teventID: eventId,\n\t\t\t})\n\n\t\t\tproduct[\"currency\"] = wpmDataLayer.shop.currency\n\n\t\t\tjQuery(document).trigger(\"wpmFbCapiEvent\", {\n\t\t\t\tevent_name : \"ViewContent\",\n\t\t\t\tevent_id : eventId,\n\t\t\t\tuser_data : wpm.getFbUserData(),\n\t\t\t\tproduct_data : product,\n\t\t\t\tproduct_id : product.dyn_r_ids[wpmDataLayer.pixels.facebook.dynamic_remarketing.id_type],\n\t\t\t\tevent_source_url: window.location.href,\n\t\t\t})\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t}\n\t}\n\n\twpm.facebookContentIds = function () {\n\t\tlet prodIds = []\n\n\t\tfor (const [key, item] of Object.entries(wpmDataLayer.order.items)) {\n\n\t\t\tif (wpmDataLayer?.general?.variationsOutput && 0 !== item.variation_id) {\n\t\t\t\tprodIds.push(String(wpmDataLayer.products[item.variation_id].dyn_r_ids[wpmDataLayer.pixels.facebook.dynamic_remarketing.id_type]))\n\t\t\t} else {\n\t\t\t\tprodIds.push(String(wpmDataLayer.products[item.id].dyn_r_ids[wpmDataLayer.pixels.facebook.dynamic_remarketing.id_type]))\n\t\t\t}\n\t\t}\n\n\t\treturn prodIds\n\t}\n\n}(window.wpm = window.wpm || {}, jQuery));\n\n\n/**\n * Execute as soon as possible\n * */\n\n(function () {\n\n\tjQuery(document).on(\"wpmLoadPixels\", function () {\n\n\t\tif (wpm.canIFire(\"ads\", \"facebook-ads\") && !wpmDataLayer?.pixels?.facebook?.loaded) wpm.loadFacebookPixel()\n\n\t})\n\n})()\n\n\n/**\n * All event listeners\n * */\n\n// AddToCart event\njQuery(document).on(\"wpmAddToCart\", function (event, product) {\n\n\ttry {\n\t\tif (!wpmDataLayer?.pixels?.facebook?.loaded) return\n\n\t\tlet eventId = wpm.getRandomEventId()\n\n\t\t// console.log('eventId: ' + eventId);\n\n\t\tfbq(\"track\", \"AddToCart\", {\n\t\t\tcontent_type: \"product\",\n\t\t\tcontent_name: product.name,\n\t\t\tcontent_ids : product.dyn_r_ids[wpmDataLayer.pixels.facebook.dynamic_remarketing.id_type],\n\t\t\tvalue : parseFloat(product.quantity * product.price),\n\t\t\tcurrency : product.currency,\n\t\t}, {\n\t\t\teventID: eventId,\n\t\t})\n\n\n\t\tproduct[\"currency\"] = wpmDataLayer.shop.currency\n\n\t\tjQuery(document).trigger(\"wpmFbCapiEvent\", {\n\t\t\tevent_name : \"AddToCart\",\n\t\t\tevent_id : eventId,\n\t\t\tuser_data : wpm.getFbUserData(),\n\t\t\tproduct_data : product,\n\t\t\tproduct_id : product.dyn_r_ids[wpmDataLayer.pixels.facebook.dynamic_remarketing.id_type],\n\t\t\tevent_source_url: window.location.href,\n\t\t})\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n\n// InitiateCheckout event\njQuery(document).on(\"wpmBeginCheckout\", function (event) {\n\n\ttry {\n\t\t// console.log('firing facebook ads InitiateCheckout event');\n\n\t\tif (!wpmDataLayer?.pixels?.facebook?.loaded) return\n\n\t\tlet eventId = wpm.getRandomEventId()\n\n\t\tfbq(\"track\", \"InitiateCheckout\", {}, {\n\t\t\teventID: eventId,\n\t\t})\n\n\t\tjQuery(document).trigger(\"wpmFbCapiEvent\", {\n\t\t\tevent_name : \"InitiateCheckout\",\n\t\t\tevent_id : eventId,\n\t\t\tuser_data : wpm.getFbUserData(),\n\t\t\tevent_source_url: window.location.href,\n\t\t})\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n\n// AddToWishlist event\njQuery(document).on(\"wpmAddToWishlist\", function (event, product) {\n\n\ttry {\n\t\t// console.log('firing facebook ads AddToWishlist event');\n\t\t// console.log(product);\n\n\t\tif (!wpmDataLayer?.pixels?.facebook?.loaded) return\n\n\t\tlet eventId = wpm.getRandomEventId()\n\n\t\tfbq(\"track\", \"AddToWishlist\", {\n\t\t\tcontent_type: \"product\",\n\t\t\tcontent_name: product.name,\n\t\t\tcontent_ids : product.dyn_r_ids[wpmDataLayer.pixels.facebook.dynamic_remarketing.id_type],\n\t\t\tvalue : parseFloat(product.quantity * product.price),\n\t\t\tcurrency : product.currency,\n\t\t}, {\n\t\t\teventID: eventId,\n\t\t})\n\n\n\t\tproduct[\"currency\"] = wpmDataLayer.shop.currency\n\n\t\tjQuery(document).trigger(\"wpmFbCapiEvent\", {\n\t\t\tevent_name : \"AddToWishlist\",\n\t\t\tevent_id : eventId,\n\t\t\tuser_data : wpm.getFbUserData(),\n\t\t\tproduct_data : product,\n\t\t\tproduct_id : product.dyn_r_ids[wpmDataLayer.pixels.facebook.dynamic_remarketing.id_type],\n\t\t\tevent_source_url: window.location.href,\n\t\t})\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n\n// ViewContent event\njQuery(document).on(\"wpmViewItem\", function (event, product) {\n\n\ttry {\n\t\t// console.log('firing facebook ads ViewContent event');\n\t\t// console.log(product);\n\n\t\tif (!wpmDataLayer?.pixels?.facebook?.loaded) return\n\n\t\twpm.fbViewContent(product)\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n\n// view search event\njQuery(document).on(\"wpmSearch\", function () {\n\n\ttry {\n\t\tif (!wpmDataLayer?.pixels?.facebook?.loaded) return\n\n\t\tlet eventId = wpm.getRandomEventId()\n\n\t\tfbq(\"track\", \"Search\", {}, {\n\t\t\teventID: eventId,\n\t\t})\n\n\t\tjQuery(document).trigger(\"wpmFbCapiEvent\", {\n\t\t\tevent_name : \"Search\",\n\t\t\tevent_id : eventId,\n\t\t\tuser_data : wpm.getFbUserData(),\n\t\t\tevent_source_url: window.location.href,\n\t\t})\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n\n// load always event\njQuery(document).on(\"wpmLoadAlways\", function () {\n\n\ttry {\n\t\tif (!wpmDataLayer?.pixels?.facebook?.loaded) return\n\n\t\twpm.setFbUserData()\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n\n// view order received page event\n// https://developers.pinterest.com/docs/tag/conversion/\njQuery(document).on(\"wpmOrderReceivedPage\", function () {\n\n\ttry {\n\t\tif (!wpmDataLayer?.pixels?.facebook?.loaded) return\n\n\t\tfbq(\"track\", \"Purchase\",\n\t\t\t{\n\t\t\t\tcontent_type: \"product\",\n\t\t\t\tvalue : wpmDataLayer.order.value_filtered,\n\t\t\t\tcurrency : wpmDataLayer.order.currency,\n\t\t\t\tcontent_ids : wpm.facebookContentIds(),\n\t\t\t},\n\t\t\t{eventID: wpmDataLayer.order.id},\n\t\t)\n\n\n\t\t// console.log(wpm.facebookContentIds())\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n","/**\n * Add functions for Facebook (pro)\n * */\n\n(function (wpm, $, undefined) {\n\n\twpm.setFacebookIdentifiersOnServer = function () {\n\n\t\ttry {\n\n\t\t\t// get first party cookies fbp and fbc\n\n\t\t\t// send the cookies to the server in order to save them on the session\n\n\t\t\tlet data = {\n\t\t\t\taction: \"wpm_facebook_set_session_identifiers\",\n\t\t\t\t// nonce : wpm_facebook_premium_only_ajax_object.nonce,\n\t\t\t\tnonce: wpm.nonce,\n\t\t\t\tfbp : wpm.getCookie(\"_fbp\"),\n\t\t\t\tfbc : wpm.getCookie(\"_fbc\"),\n\t\t\t}\n\n\t\t\tif (data.fbp && window.sessionStorage && window.sessionStorage.getItem(\"wpm_fb_session_id_\" + data.fbp + \"_set\")) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tjQuery.ajax(\n\t\t\t\t{\n\t\t\t\t\ttype : \"post\",\n\t\t\t\t\tdataType: \"json\",\n\t\t\t\t\t// url : wpm_facebook_premium_only_ajax_object.ajax_url,\n\t\t\t\t\turl : wpm.ajax_url,\n\t\t\t\t\tdata : data,\n\t\t\t\t\tsuccess: function (response) {\n\t\t\t\t\t\t// console.log(response);\n\n\t\t\t\t\t\tif (window.sessionStorage && response[\"success\"] === true) {\n\t\t\t\t\t\t\t// console.log('setting session storage');\n\t\t\t\t\t\t\twindow.sessionStorage.setItem(\"wpm_fb_session_id_\" + data.fbp + \"_set\", JSON.stringify(true))\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\terror : function (response) {\n\t\t\t\t\t\t// console.log(response);\n\t\t\t\t\t},\n\t\t\t\t})\n\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t}\n\t}\n\n}(window.wpm = window.wpm || {}, jQuery))\n\n\n/**\n * All event listeners\n * */\n\n\n// add_to_cart event\njQuery(document).on(\"wpmAddToWishlist\", function (event, product) {\n\n\ttry {\n\t\tif (!wpmDataLayer?.pixels?.facebook?.loaded) return\n\n\t\tfbq(\"track\", \"AddToWishlist\", {\n\t\t\tcontent_name : product.name,\n\t\t\tcontent_category: product.category,\n\t\t\tcontent_ids : product.dyn_r_ids[wpmDataLayer.pixels.facebook.dynamic_remarketing.id_type],\n\t\t\t// contents : \"\",\n\t\t\tcurrency: product.currency,\n\t\t\tvalue : product.price,\n\t\t})\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n\njQuery(document).on(\"wpmFbCapiEvent\", function (event, eventData) {\n\n\ttry {\n\t\tif (!wpmDataLayer.pixels.facebook.capi) return\n\n\t\t// save the state in the database\n\t\tlet data = {\n\t\t\taction: \"wpm_facebook_capi_event\",\n\t\t\tdata : eventData,\n\t\t\t// nonce : wpm_facebook_premium_only_ajax_object.nonce,\n\t\t\tnonce: wpm.nonce,\n\t\t}\n\n\t\tjQuery.ajax(\n\t\t\t{\n\t\t\t\ttype : \"post\",\n\t\t\t\tdataType: \"json\",\n\t\t\t\t// url : wpm_facebook_premium_only_ajax_object.ajax_url,\n\t\t\t\turl : wpm.ajax_url,\n\t\t\t\tdata : data,\n\t\t\t\tsuccess: function (msg) {\n\t\t\t\t\t// console.log(msg);\n\t\t\t\t},\n\t\t\t\terror : function (msg) {\n\t\t\t\t\t// console.log(msg);\n\t\t\t\t},\n\t\t\t})\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n\n\njQuery(window).on(\"wpmLoadAlways\", function () {\n\n\ttry {\n\t\tif (wpmDataLayer?.pixels?.facebook?.pixel_id && wpmDataLayer.pixels.facebook.capi) {\n\n\t\t\t// We need to be sure that we capture the cid early enough, because the\n\t\t\t// shop might be using a one click checkout button as early as on the product page.\n\t\t\tif ([\"cart\", \"checkout\"].indexOf(wpmDataLayer.shop.page_type) >= 0) {\n\n\t\t\t\twpm.setFacebookIdentifiersOnServer()\n\t\t\t}\n\t\t}\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n","/**\n * Add functions for Google Ads\n * */\n\n(function (wpm, $, undefined) {\n\n\tlet conversionIdentifiers = []\n\n\twpm.getGoogleAdsConversionIdentifiersWithLabel = function () {\n\t\tfor (const [key, item] of Object.entries(wpmDataLayer.pixels.google.ads.conversionIds)) {\n\t\t\tconversionIdentifiers.push(key + \"/\" + item)\n\t\t}\n\t\treturn conversionIdentifiers\n\t}\n\n\twpm.getGoogleAdsConversionIdentifiers = function () {\n\n\t\tlet conversionIdentifiers = []\n\t\tfor (const [key, item] of Object.entries(wpmDataLayer.pixels.google.ads.conversionIds)) {\n\t\t\tconversionIdentifiers.push(key)\n\t\t}\n\n\t\treturn conversionIdentifiers\n\t}\n\n\twpm.getGoogleAdsRegularOrderItems = function () {\n\t\t// \"id\" : \"gla_34\",\n\t\t// \"quantity\": 1,\n\t\t// \"price\" : 45\n\n\t\tlet orderItems = []\n\n\t\tfor (const [key, item] of Object.entries(wpmDataLayer.order.items)) {\n\n\t\t\tlet orderItem\n\n\t\t\torderItem = {\n\t\t\t\tquantity: item.quantity,\n\t\t\t\tprice : item.price,\n\t\t\t}\n\n\t\t\tif (wpmDataLayer?.general?.variationsOutput && 0 !== item.variation_id) {\n\n\t\t\t\torderItem.id = String(wpmDataLayer.products[item.variation_id].dyn_r_ids[wpmDataLayer.pixels.google.ads.dynamic_remarketing.id_type])\n\t\t\t\torderItems.push(orderItem)\n\t\t\t} else {\n\n\t\t\t\torderItem.id = String(wpmDataLayer.products[item.id].dyn_r_ids[wpmDataLayer.pixels.google.ads.dynamic_remarketing.id_type])\n\t\t\t\torderItems.push(orderItem)\n\t\t\t}\n\t\t}\n\n\t\treturn orderItems\n\t}\n\n\twpm.getGoogleAdsDynamicRemarketingOrderItems = function () {\n\t\t// \"id\" : \"gla_34\",\n\t\t// \"quantity\" : 1,\n\t\t// \"price\" : 45,\n\t\t// \"google_business_vertical\": \"retail\"\n\n\t\tlet orderItems = []\n\n\t\tfor (const [key, item] of Object.entries(wpmDataLayer.order.items)) {\n\n\t\t\tlet orderItem\n\n\t\t\torderItem = {\n\t\t\t\tquantity : item.quantity,\n\t\t\t\tprice : item.price,\n\t\t\t\tgoogle_business_vertical: wpmDataLayer.pixels.google.ads.google_business_vertical,\n\t\t\t}\n\n\t\t\tif (wpmDataLayer?.general?.variationsOutput && 0 !== item.variation_id) {\n\n\t\t\t\torderItem.id = String(wpmDataLayer.products[item.variation_id].dyn_r_ids[wpmDataLayer.pixels.google.ads.dynamic_remarketing.id_type])\n\t\t\t\torderItems.push(orderItem)\n\t\t\t} else {\n\n\t\t\t\torderItem.id = String(wpmDataLayer.products[item.id].dyn_r_ids[wpmDataLayer.pixels.google.ads.dynamic_remarketing.id_type])\n\t\t\t\torderItems.push(orderItem)\n\t\t\t}\n\t\t}\n\n\t\treturn orderItems\n\t}\n\n}(window.wpm = window.wpm || {}, jQuery))\n\n\n/**\n * All event listeners\n * */\n\n// view_item_list event\njQuery(document).on(\"wpmViewItemList\", function (event, product) {\n\n\ttry {\n\t\tif(jQuery.isEmptyObject(wpmDataLayer?.pixels?.google?.ads?.conversionIds)) return\n\t\tif (!wpmDataLayer?.pixels?.google?.ads?.dynamic_remarketing?.status) return\n\t\tif (!wpm.googleConfigConditionsMet(\"ads\")) return\n\n\n\t\tif (\n\t\t\twpmDataLayer?.general?.variationsOutput &&\n\t\t\tproduct.isVariable &&\n\t\t\twpmDataLayer.pixels.google.ads.dynamic_remarketing.send_events_with_parent_ids === false\n\t\t) return\n\n\t\t// try to prevent that WC sends cached hits to Google\n\t\tif (!product) return\n\n\t\twpm.gtagLoaded().then(function () {\n\t\t gtag(\"event\", \"view_item_list\", {\n \t\t\tsend_to: wpm.getGoogleAdsConversionIdentifiers(),\n \t\t\titems : [{\n \t\t\t\tid : product.dyn_r_ids[wpmDataLayer.pixels.google.ads.dynamic_remarketing.id_type],\n \t\t\t\tgoogle_business_vertical: wpmDataLayer.pixels.google.ads.google_business_vertical,\n \t\t\t}],\n \t\t})\n\t\t})\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n\n// add_to_cart event\njQuery(document).on(\"wpmAddToCart\", function (event, product) {\n\n\ttry {\n\t\tif(jQuery.isEmptyObject(wpmDataLayer?.pixels?.google?.ads?.conversionIds)) return\n\t\tif (!wpmDataLayer?.pixels?.google?.ads?.dynamic_remarketing?.status) return\n\t\tif (!wpm.googleConfigConditionsMet(\"ads\")) return\n\n\t\twpm.gtagLoaded().then(function () {\n\t\t gtag(\"event\", \"add_to_cart\", {\n \t\t\tsend_to: wpm.getGoogleAdsConversionIdentifiers(),\n \t\t\tvalue : product.quantity * product.price,\n \t\t\titems : [{\n \t\t\t\tid : product.dyn_r_ids[wpmDataLayer.pixels.google.ads.dynamic_remarketing.id_type],\n \t\t\t\tquantity : product.quantity,\n \t\t\t\tprice : product.price,\n \t\t\t\tgoogle_business_vertical: wpmDataLayer.pixels.google.ads.google_business_vertical,\n \t\t\t}],\n \t\t})\n\t\t})\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n\n// view_item event\njQuery(document).on(\"wpmViewItem\", function (event, product) {\n\n\ttry {\n\t\tif(jQuery.isEmptyObject(wpmDataLayer?.pixels?.google?.ads?.conversionIds)) return\n\t\tif (!wpmDataLayer?.pixels?.google?.ads?.dynamic_remarketing?.status) return\n\t\tif (!wpm.googleConfigConditionsMet(\"ads\")) return\n\n\n\t\twpm.gtagLoaded().then(function () {\n\t\t gtag(\"event\", \"view_item\", {\n \t\t\tsend_to: wpm.getGoogleAdsConversionIdentifiers(),\n \t\t\tvalue : (product.quantity ? product.quantity : 1) * product.price,\n \t\t\titems : [{\n \t\t\t\tid : product.dyn_r_ids[wpmDataLayer.pixels.google.ads.dynamic_remarketing.id_type],\n \t\t\t\tquantity : (product.quantity ? product.quantity : 1),\n \t\t\t\tprice : product.price,\n \t\t\t\tgoogle_business_vertical: wpmDataLayer.pixels.google.ads.google_business_vertical,\n \t\t\t}],\n \t\t})\n\t\t})\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n\n\n// view search event\njQuery(document).on(\"wpmSearch\", function () {\n\n\ttry {\n\t\tif(jQuery.isEmptyObject(wpmDataLayer?.pixels?.google?.ads?.conversionIds)) return\n\t\tif (!wpmDataLayer?.pixels?.google?.ads?.dynamic_remarketing?.status) return\n\t\tif (!wpm.googleConfigConditionsMet(\"ads\")) return\n\n\n\t\tlet products = []\n\n\t\tfor (const [key, product] of Object.entries(wpmDataLayer.products)) {\n\n\t\t\tif (\n\t\t\t\twpmDataLayer?.general?.variationsOutput &&\n\t\t\t\tproduct.isVariable &&\n\t\t\t\twpmDataLayer.pixels.google.ads.dynamic_remarketing.send_events_with_parent_ids === false\n\t\t\t) return\n\n\t\t\tproducts.push({\n\t\t\t\tid : product.dyn_r_ids[wpmDataLayer.pixels.google.ads.dynamic_remarketing.id_type],\n\t\t\t\tgoogle_business_vertical: wpmDataLayer.pixels.google.ads.google_business_vertical,\n\t\t\t})\n\t\t}\n\n\t\t// console.log(products);\n\n\t\twpm.gtagLoaded().then(function () {\n\t\t\tgtag(\"event\", \"view_search_results\", {\n \t\t\tsend_to: wpm.getGoogleAdsConversionIdentifiers(),\n \t\t\t// value : 1 * product.price,\n \t\t\titems: products,\n \t\t})\n\t\t})\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n\n\n// view order received page event\n// TODO distinguish with or without cart data active\njQuery(document).on(\"wpmOrderReceivedPage\", function () {\n\n\ttry {\n\t\tif(jQuery.isEmptyObject(wpmDataLayer?.pixels?.google?.ads?.conversionIds)) return\n\t\tif (!wpmDataLayer?.pixels?.google?.ads?.dynamic_remarketing?.status) return\n\t\tif (!wpm.googleConfigConditionsMet(\"ads\")) return\n\n\t\twpm.gtagLoaded().then(function () {\n\t\t gtag(\"event\", \"purchase\", {\n \t\t\tsend_to: wpm.getGoogleAdsConversionIdentifiers(),\n \t\t\tvalue : wpmDataLayer.order.value_filtered,\n \t\t\titems : wpm.getGoogleAdsDynamicRemarketingOrderItems(),\n \t\t})\n\t\t})\n\n\t\t// console.log(wpm.getGoogleAdsDynamicRemarketingOrderItems())\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n\n// user log in event\njQuery(document).on(\"wpmLogin\", function () {\n\n\ttry {\n\t\tif(jQuery.isEmptyObject(wpmDataLayer?.pixels?.google?.ads?.conversionIds)) return\n\t\tif (!wpmDataLayer?.pixels?.google?.ads?.dynamic_remarketing?.status) return\n\t\tif (!wpm.googleConfigConditionsMet(\"ads\")) return\n\n\n\t\twpm.gtagLoaded().then(function () {\n\t\t gtag(\"event\", \"login\", {\n \t\t\tsend_to: wpm.getGoogleAdsConversionIdentifiers(),\n \t\t})\n\t\t})\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n\n// view order received page event\n// new_customer parameter: https://support.google.com/google-ads/answer/9917012\njQuery(document).on(\"wpmOrderReceivedPage\", function () {\n\n\ttry {\n\t\tif(jQuery.isEmptyObject(wpmDataLayer?.pixels?.google?.ads?.conversionIds)) return\n\t\tif (!wpm.googleConfigConditionsMet(\"ads\")) return\n\n\t\tlet data_basic = {}\n\t\tlet data_with_cart = {}\n\n\t\tdata_basic = {\n\t\t\tsend_to : wpm.getGoogleAdsConversionIdentifiersWithLabel(),\n\t\t\ttransaction_id: wpmDataLayer.order.number,\n\t\t\tvalue : wpmDataLayer.order.value_filtered,\n\t\t\tcurrency : wpmDataLayer.order.currency,\n\t\t\tnew_customer : wpmDataLayer.order.new_customer,\n\t\t}\n\n\t\tif (wpmDataLayer?.order?.aw_merchant_id) {\n\t\t\tdata_with_cart = {\n\t\t\t\tdiscount : wpmDataLayer.order.discount,\n\t\t\t\taw_merchant_id : wpmDataLayer.order.aw_merchant_id,\n\t\t\t\taw_feed_country : wpmDataLayer.order.aw_feed_country,\n\t\t\t\taw_feed_language: wpmDataLayer.order.aw_feed_language,\n\t\t\t\titems : wpm.getGoogleAdsRegularOrderItems(),\n\t\t\t}\n\t\t}\n\n\t\twpm.gtagLoaded().then(function () {\n\t\t\tgtag(\"event\", \"conversion\", {...data_basic, ...data_with_cart})\n\t\t})\n\n\t\t// console.log({...data_basic,...data_with_cart})\n\n\t\t// console.log(wpm.getGoogleAdsOrderItems())\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n\n\n\n\n\n","// TODO check all events and add more if there are any\n\n/**\n * Add functions for Snapchat Ads\n * */\n\n(function (wpm, $, undefined) {\n\n\n}(window.wpm = window.wpm || {}, jQuery));\n\n/**\n * Execute as soon as possible\n * */\n\n(function () {\n\t//\n\t//\n\t// if ('order_received_page' === wpmDataLayer.shop.page_type && wpmDataLayer?.order?.google?.ads?.enhanced_conversion_data) {\n\t// \tvar enhanced_conversion_data_2 = wpmDataLayer.order.google.ads.enhanced_conversion_data;\n\t// }\n\n})()\n\n","/**\n * Add functions for Google\n * */\n\n\n(function (wpm, $, undefined) {\n\n\twpm.getCartItemsGa4 = function () {\n\n\t\tlet data = []\n\n\t\tfor (const [productId, product] of Object.entries(wpmDataLayer.cart)) {\n\n\t\t\tlet productItems = {\n\t\t\t\titem_id : product.dyn_r_ids[wpmDataLayer.pixels.google.analytics.id_type],\n\t\t\t\titem_name: product.name,\n\t\t\t\tquantity : product.quantity,\n\t\t\t\t// affiliation : '',\n\t\t\t\t// coupon : '',\n\t\t\t\t// discount : 0,\n\t\t\t\titem_brand : product.brand,\n\t\t\t\titem_variant: product.variant,\n\t\t\t\tprice : product.price,\n\t\t\t\tcurrency : wpmDataLayer.shop.currency,\n\t\t\t}\n\n\t\t\tproductItems = wpm.getFormattedGA4Categories(productItems, product.category)\n\n\t\t\tdata.push(productItems)\n\t\t}\n\n\t\treturn data\n\t}\n\n}(window.wpm = window.wpm || {}, jQuery))\n\n\n/**\n * All event listeners\n * */\n\n// view_item_list event\n// https://developers.google.com/analytics/devguides/collection/ga4/ecommerce?client_type=gtag#view_item_list\njQuery(document).on(\"wpmViewItemList\", function (event, product) {\n\n\ttry {\n\t\tif (!wpmDataLayer?.pixels?.google?.analytics?.eec) return\n\t\tif (!wpmDataLayer?.pixels?.google?.analytics?.ga4?.measurement_id) return\n\t\tif (!wpm.googleConfigConditionsMet(\"analytics\")) return\n\n\t\tlet productItems = {\n\t\t\titem_id : product.dyn_r_ids[wpmDataLayer.pixels.google.analytics.id_type],\n\t\t\titem_name: product.name,\n\t\t\t// coupon : \"\",\n\t\t\t// discount: 0,\n\t\t\tindex : product.list_position, // doesn't make sense on mini_cart\n\t\t\titem_list_name: wpmDataLayer.shop.list_name,\n\t\t\titem_list_id : wpmDataLayer.shop.list_id,\n\t\t\t// affiliation: \"\",\n\t\t\titem_brand : product.brand,\n\t\t\titem_variant: product.variant,\n\t\t\tprice : product.price,\n\t\t\tcurrency : wpmDataLayer.shop.currency,\n\t\t\tquantity : product.quantity,\n\t\t}\n\n\t\tproductItems = wpm.getFormattedGA4Categories(productItems, product.category)\n\n\t\twpm.gtagLoaded().then(function () {\n\t\t gtag(\"event\", \"view_item_list\", {\n \t\t\tsend_to : wpmDataLayer.pixels.google.analytics.ga4.measurement_id,\n \t\t\titems : [productItems],\n \t\t\titem_list_name: wpmDataLayer.shop.list_name, // doesn't make sense on mini_cart\n \t\t\titem_list_id : wpmDataLayer.shop.list_id, // doesn't make sense on mini_cart\n \t\t})\n\t\t})\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n\n// select_item event\n// https://developers.google.com/analytics/devguides/collection/ga4/ecommerce?client_type=gtag#select_item\njQuery(document).on(\"wpmSelectItem\", function (event, product) {\n\n\ttry {\n\t\tif (!wpmDataLayer?.pixels?.google?.analytics?.eec) return\n\t\tif (!wpmDataLayer?.pixels?.google?.analytics?.ga4?.measurement_id) return\n\t\tif (!wpm.googleConfigConditionsMet(\"analytics\")) return\n\n\t\tlet productItems = {\n\t\t\titem_id : product.dyn_r_ids[wpmDataLayer.pixels.google.analytics.id_type],\n\t\t\titem_name: product.name,\n\t\t\t// coupon : \"\",\n\t\t\t// discount: 0,\n\t\t\tindex : product.list_position, // doesn't make sense on mini_cart\n\t\t\titem_list_name: wpmDataLayer.shop.list_name,\n\t\t\titem_list_id : wpmDataLayer.shop.list_id,\n\t\t\t// affiliation: \"\",\n\t\t\titem_brand : product.brand,\n\t\t\titem_variant: product.variant,\n\t\t\tprice : product.price,\n\t\t\tcurrency : wpmDataLayer.shop.currency,\n\t\t\tquantity : product.quantity,\n\t\t}\n\n\t\tproductItems = wpm.getFormattedGA4Categories(productItems, product.category)\n\n\t\twpm.gtagLoaded().then(function () {\n\t\t gtag(\"event\", \"select_item\", {\n \t\t\tsend_to: wpmDataLayer.pixels.google.analytics.ga4.measurement_id,\n \t\t\titems : [productItems],\n \t\t})\n\t\t})\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n\n// add_to_cart event\n// https://developers.google.com/analytics/devguides/collection/ga4/ecommerce?client_type=gtag#add_to_cart\njQuery(document).on(\"wpmAddToCart\", function (event, product) {\n\n\ttry {\n\t\tif (!wpmDataLayer?.pixels?.google?.analytics?.eec) return\n\t\tif (!wpmDataLayer?.pixels?.google?.analytics?.ga4?.measurement_id) return\n\t\tif (!wpm.googleConfigConditionsMet(\"analytics\")) return\n\n\t\tlet productItems = {\n\t\t\titem_name : product.name,\n\t\t\titem_id : product.dyn_r_ids[wpmDataLayer.pixels.google.analytics.id_type],\n\t\t\titem_list_name: wpmDataLayer.shop.list_name,\n\t\t\titem_list_id : wpmDataLayer.shop.list_id,\n\t\t\t// coupon: \"\",\n\t\t\t// discount: 0,\n\t\t\t// affiliation: \"\",\n\t\t\titem_brand : product.brand,\n\t\t\titem_variant: product.variant,\n\t\t\tprice : product.price,\n\t\t\tcurrency : wpmDataLayer.shop.currency,\n\t\t\tquantity : product.quantity,\n\t\t}\n\n\t\tproductItems = wpm.getFormattedGA4Categories(productItems, product.category)\n\n\t\twpm.gtagLoaded().then(function () {\n\t\t gtag(\"event\", \"add_to_cart\", {\n \t\t\tsend_to : wpmDataLayer.pixels.google.analytics.ga4.measurement_id,\n \t\t\tcurrency: wpmDataLayer.shop.currency,\n \t\t\t// value: 0,\n \t\t\titems: [productItems],\n \t\t})\n\t\t})\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n\n// view_item event\n// https://developers.google.com/analytics/devguides/collection/ga4/ecommerce?client_type=gtag#view_item\njQuery(document).on(\"wpmViewItem\", function (event, product) {\n\n\ttry {\n\t\tif (!wpmDataLayer?.pixels?.google?.analytics?.eec) return\n\t\tif (!wpmDataLayer?.pixels?.google?.analytics?.ga4?.measurement_id) return\n\t\tif (!wpm.googleConfigConditionsMet(\"analytics\")) return\n\n\t\tlet productItems = {\n\t\t\titem_id : product.dyn_r_ids[wpmDataLayer.pixels.google.analytics.id_type],\n\t\t\titem_name: product.name,\n\t\t\t// coupon: \"\",\n\t\t\t// discount: 0,\n\t\t\t// affiliation: \"\",\n\t\t\titem_brand : product.brand,\n\t\t\titem_variant : product.variant,\n\t\t\tprice : product.price,\n\t\t\tcurrency : wpmDataLayer.shop.currency,\n\t\t\tquantity : 1,\n\t\t\titem_list_name: wpmDataLayer.shop.list_name,\n\t\t\titem_list_id : wpmDataLayer.shop.list_id,\n\t\t}\n\n\t\tproductItems = wpm.getFormattedGA4Categories(productItems, product.category)\n\n\t\twpm.gtagLoaded().then(function () {\n\t\t gtag(\"event\", \"view_item\", {\n \t\t\tsend_to : wpmDataLayer.pixels.google.analytics.ga4.measurement_id,\n \t\t\tcurrency: wpmDataLayer.shop.currency,\n \t\t\t// value: 0,\n \t\t\titems: [productItems],\n \t\t})\n\t\t})\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n\n// add_to_wishlist event\n// https://developers.google.com/analytics/devguides/collection/ga4/ecommerce?client_type=gtag#add_to_wishlist\njQuery(document).on(\"wpmAddToWishlist\", function (event, product) {\n\n\ttry {\n\t\tif (!wpmDataLayer?.pixels?.google?.analytics?.eec) return\n\t\tif (!wpmDataLayer?.pixels?.google?.analytics?.ga4?.measurement_id) return\n\t\tif (!wpm.googleConfigConditionsMet(\"analytics\")) return\n\n\t\tlet productItems = {\n\t\t\titem_id : product.dyn_r_ids[wpmDataLayer.pixels.google.analytics.id_type],\n\t\t\titem_name: product.name,\n\t\t\tquantity : 1,\n\t\t\t// affiliation: \"\",\n\t\t\t// coupon: \"\",\n\t\t\t// discount: 0,\n\t\t\titem_brand : product.brand,\n\t\t\titem_variant: product.variant,\n\t\t\tprice : product.price,\n\t\t\tcurrency : wpmDataLayer.shop.currency,\n\t\t}\n\n\t\tproductItems = wpm.getFormattedGA4Categories(productItems, product.category)\n\n\t\twpm.gtagLoaded().then(function () {\n\t\t gtag(\"event\", \"add_to_wishlist\", {\n \t\t\tsend_to : wpmDataLayer.pixels.google.analytics.ga4.measurement_id,\n \t\t\tcurrency: wpmDataLayer.shop.currency,\n \t\t\t// value: 0,\n \t\t\titems: [productItems],\n \t\t})\n\t\t})\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n\n// remove_from_cart event\n// https://developers.google.com/analytics/devguides/collection/ga4/ecommerce?client_type=gtag#remove_from_cart\njQuery(document).on(\"wpmRemoveFromCart\", function (event, product) {\n\n\ttry {\n\t\tif (!wpmDataLayer?.pixels?.google?.analytics?.eec) return\n\t\tif (!wpmDataLayer?.pixels?.google?.analytics?.ga4?.measurement_id) return\n\t\tif (!wpm.googleConfigConditionsMet(\"analytics\")) return\n\n\t\tlet productItems = {\n\t\t\titem_id : product.dyn_r_ids[wpmDataLayer.pixels.google.analytics.id_type],\n\t\t\titem_name: product.name,\n\t\t\t// coupon: \"\",\n\t\t\t// discount: 0,\n\t\t\t// affiliation: \"\",\n\t\t\titem_brand : product.brand,\n\t\t\titem_variant: product.variant,\n\t\t\tprice : product.price,\n\t\t\tcurrency : wpmDataLayer.shop.currency,\n\t\t\tquantity : product.quantity,\n\t\t}\n\n\t\tproductItems = wpm.getFormattedGA4Categories(productItems, product.category)\n\n\t\twpm.gtagLoaded().then(function () {\n\t\t gtag(\"event\", \"remove_from_cart\", {\n \t\t\tsend_to : wpmDataLayer.pixels.google.analytics.ga4.measurement_id,\n \t\t\tcurrency: wpmDataLayer.shop.currency,\n \t\t\t// value: 0,\n \t\t\titems: [productItems],\n \t\t})\n\t\t})\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n\n// begin_checkout event\n// https://developers.google.com/analytics/devguides/collection/ga4/ecommerce?client_type=gtag#begin_checkout\njQuery(document).on(\"wpmBeginCheckout\", function (event) {\n\n\ttry {\n\t\tif (!wpmDataLayer?.pixels?.google?.analytics?.eec) return\n\t\tif (!wpmDataLayer?.pixels?.google?.analytics?.ga4?.measurement_id) return\n\t\tif (!wpm.googleConfigConditionsMet(\"analytics\")) return\n\n\t\twpm.gtagLoaded().then(function () {\n\t\t gtag(\"event\", \"begin_checkout\", {\n \t\t\tsend_to: wpmDataLayer.pixels.google.analytics.ga4.measurement_id,\n \t\t\t// coupon: \"\",\n \t\t\tcurrency: wpmDataLayer.shop.currency,\n \t\t\t// value: 0,\n \t\t\titems: wpm.getCartItemsGa4(),\n \t\t})\n\t\t})\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n\n// view_cart event\n// https://developers.google.com/analytics/devguides/collection/ga4/ecommerce?client_type=gtag#view_cart\njQuery(document).on(\"wpmViewCart\", function (event) {\n\n\ttry {\n\t\tif (!wpmDataLayer?.pixels?.google?.analytics?.eec) return\n\t\tif (!wpmDataLayer?.pixels?.google?.analytics?.ga4?.measurement_id) return\n\t\tif (!wpm.googleConfigConditionsMet(\"analytics\")) return\n\n\t\tif (jQuery.isEmptyObject(wpmDataLayer.cart)) return\n\n\t\tlet products = []\n\t\tlet cartValue = null\n\n\t\tfor (const [key, product] of Object.entries(wpmDataLayer.cart)) {\n\t\t\t// console.log(`${key}: ${value}`);\n\n\t\t\tlet productItems = {\n\t\t\t\titem_id : product.dyn_r_ids[wpmDataLayer.pixels.google.analytics.id_type],\n\t\t\t\titem_name: product.name,\n\t\t\t\tquantity : product.quantity,\n\t\t\t\t// affiliation: \"\",\n\t\t\t\t// coupon: \"\",\n\t\t\t\t// discount: 0,\n\t\t\t\t// index : product.position,\n\t\t\t\titem_brand : product.brand,\n\t\t\t\titem_list_name: wpmDataLayer.shop.list_name,\n\t\t\t\titem_list_id : wpmDataLayer.shop.list_id,\n\t\t\t\titem_variant : product.variant,\n\t\t\t\tprice : product.price,\n\t\t\t\tcurrency : wpmDataLayer.shop.currency,\n\t\t\t}\n\n\t\t\tproductItems = wpm.getFormattedGA4Categories(productItems, product.category)\n\n\t\t\tproducts.push(productItems)\n\n\t\t\tcartValue = cartValue + product.quantity * product.price\n\t\t}\n\n\t\t// console.log(products)\n\t\t// console.log('cart value: ' + cartValue.toFixed(2))\n\n\t\twpm.gtagLoaded().then(function () {\n\t\t\tgtag(\"event\", \"view_cart\", {\n\t\t\t\tsend_to : wpmDataLayer.pixels.google.analytics.ga4.measurement_id,\n\t\t\t\tcurrency: wpmDataLayer.shop.currency,\n\t\t\t\tvalue : cartValue.toFixed(2),\n\t\t\t\titems : products,\n\t\t\t})\n\t\t})\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n\n\n// view search event\njQuery(document).on(\"wpmSearch\", function () {\n\n\ttry {\n\t\tif (!wpmDataLayer?.pixels?.google?.analytics?.eec) return\n\t\tif (!wpmDataLayer?.pixels?.google?.analytics?.ga4?.measurement_id) return\n\t\tif (!wpm.googleConfigConditionsMet(\"analytics\")) return\n\n\t\tlet products = []\n\n\t\tfor (const [key, product] of Object.entries(wpmDataLayer.products)) {\n\t\t\t// console.log(`${key}: ${value}`);\n\n\t\t\tlet productItems = {\n\t\t\t\titem_id : product.dyn_r_ids[wpmDataLayer.pixels.google.analytics.id_type],\n\t\t\t\titem_name: product.name,\n\t\t\t\tquantity : 1,\n\t\t\t\t// \"affiliation\": \"\",\n\t\t\t\t// \"coupon\": \"\",\n\t\t\t\t// \"discount\": 0,\n\t\t\t\tindex : product.position,\n\t\t\t\titem_brand : product.brand,\n\t\t\t\titem_list_name: wpmDataLayer.shop.list_name,\n\t\t\t\titem_list_id : wpmDataLayer.shop.list_id,\n\t\t\t\titem_variant : product.variant,\n\t\t\t\tprice : product.price,\n\t\t\t\tcurrency : wpmDataLayer.shop.currency,\n\t\t\t}\n\n\t\t\tproductItems = wpm.getFormattedGA4Categories(productItems, product.category)\n\n\t\t\tproducts.push(productItems)\n\t\t}\n\n\t\twpm.gtagLoaded().then(function () {\n\t\t\tgtag(\"event\", \"view_search_results\", {\n\t\t\t\tsend_to : wpmDataLayer.pixels.google.analytics.ga4.measurement_id,\n\t\t\t\tsearch_term: wpm.getSearchTermFromUrl(),\n\t\t\t\titems : products,\n\t\t\t})\n\n\t\t})\n\n\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n\n// user log in event\njQuery(document).on(\"wpmLogin\", function () {\n\n\ttry {\n\t\tif (!wpmDataLayer?.pixels?.google?.analytics?.eec) return\n\t\tif (!wpmDataLayer?.pixels?.google?.analytics?.ga4?.measurement_id) return\n\t\tif (!wpm.googleConfigConditionsMet(\"analytics\")) return\n\n\n\t\twpm.gtagLoaded().then(function () {\n\t\t\tgtag(\"event\", \"login\", {\n\t\t\t\tsend_to: wpmDataLayer.pixels.google.analytics.ga4.measurement_id,\n\t\t\t})\n\t\t})\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n\n\n","/**\n * Add functions for Google Analytics 4\n * */\n\n(function (wpm, $, undefined) {\n\n\twpm.getGA4OrderItems = function () {\n\n\t\t// \"item_id\" : \"34\",\n\t\t// \"item_name\" : \"Hoodie\",\n\t\t// \"quantity\" : 1,\n\t\t// \"item_brand\" : \"\",\n\t\t// \"item_variant\" : \"Color: blue | Logo: yes\",\n\t\t// \"price\" : 45,\n\t\t// \"currency\" : \"CHF\",\n\t\t// \"item_category\": \"Hoodies\"\n\n\n\t\tlet orderItems = []\n\n\t\tfor (const [key, item] of Object.entries(wpmDataLayer.order.items)) {\n\n\t\t\tlet orderItem\n\n\t\t\torderItem = {\n\t\t\t\tquantity : item.quantity,\n\t\t\t\tprice : item.price,\n\t\t\t\titem_name : item.name,\n\t\t\t\tcurrency : wpmDataLayer.order.currency,\n\t\t\t\titem_category: wpmDataLayer.products[item.id].category.join(\"/\"),\n\t\t\t}\n\n\t\t\tif (wpmDataLayer?.general?.variationsOutput && 0 !== item.variation_id) {\n\n\t\t\t\torderItem.item_id = String(wpmDataLayer.products[item.variation_id].dyn_r_ids[wpmDataLayer.pixels.google.analytics.id_type])\n\t\t\t\torderItem.item_variant = wpmDataLayer.products[item.variation_id].variant_name\n\t\t\t\torderItem.item_brand = wpmDataLayer.products[item.variation_id].brand\n\t\t\t} else {\n\n\t\t\t\torderItem.item_id = String(wpmDataLayer.products[item.id].dyn_r_ids[wpmDataLayer.pixels.google.analytics.id_type])\n\t\t\t\torderItem.item_brand = wpmDataLayer.products[item.id].brand\n\t\t\t}\n\n\t\t\torderItems.push(orderItem)\n\t\t}\n\n\t\treturn orderItems\n\t}\n\n}(window.wpm = window.wpm || {}, jQuery))\n\n\n/**\n * All event listeners\n * */\n\n\n// view order received page event\njQuery(document).on(\"wpmOrderReceivedPage\", function () {\n\n\ttry {\n\t\tif (!wpmDataLayer?.pixels?.google?.analytics?.ga4?.measurement_id) return\n\t\tif (wpmDataLayer?.pixels?.google?.analytics?.ga4?.mp_active) return\n\t\tif (!wpm.googleConfigConditionsMet(\"analytics\")) return\n\n\t\twpm.gtagLoaded().then(function () {\n\t\t\tgtag(\"event\", \"purchase\", {\n\t\t\t\tsend_to : [wpmDataLayer.pixels.google.analytics.ga4.measurement_id],\n\t\t\t\ttransaction_id: wpmDataLayer.order.number,\n\t\t\t\taffiliation : wpmDataLayer.order.affiliation,\n\t\t\t\tcurrency : wpmDataLayer.order.currency,\n\t\t\t\tvalue : wpmDataLayer.order.value_regular,\n\t\t\t\tdiscount : wpmDataLayer.order.discount,\n\t\t\t\ttax : wpmDataLayer.order.tax,\n\t\t\t\tshipping : wpmDataLayer.order.shipping,\n\t\t\t\tcoupon : wpmDataLayer.order.coupon,\n\t\t\t\titems : wpm.getGA4OrderItems(),\n\t\t\t})\n\t\t})\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n","/**\n * Add functions for Google\n * */\n\n(function (wpm, $, undefined) {\n\n\twpm.getCartItemsGaUa = function () {\n\n\t\t// console.log('test')\n\n\t\tlet data = []\n\n\t\tfor (const [productId, product] of Object.entries(wpmDataLayer.cart)) {\n\n\t\t\tdata.push({\n\t\t\t\tid : product.dyn_r_ids[wpmDataLayer.pixels.google.analytics.id_type],\n\t\t\t\tname : product.name,\n\t\t\t\tbrand : product.brand,\n\t\t\t\tcategory: product.category.join(\",\"),\n\t\t\t\t// coupon: '',\n\t\t\t\t// list_name: '',\n\t\t\t\t// list_position: 1,\n\t\t\t\tprice : product.price,\n\t\t\t\tquantity: product.quantity,\n\t\t\t\tvariant : product.variant,\n\t\t\t})\n\t\t}\n\n\t\treturn data\n\t}\n\n}(window.wpm = window.wpm || {}, jQuery))\n\n\n/**\n * All event listeners\n * */\n\n// view_item_list event\njQuery(document).on(\"wpmViewItemList\", function (event, product) {\n\n\ttry {\n\t\tif (!wpmDataLayer?.pixels?.google?.analytics?.eec) return\n\t\tif (!wpmDataLayer?.pixels?.google?.analytics?.universal?.property_id) return\n\t\tif (!wpm.googleConfigConditionsMet(\"analytics\")) return\n\n\t\twpm.gtagLoaded().then(function () {\n\t\t gtag(\"event\", \"view_item_list\", {\n \t\t\tsend_to: wpmDataLayer.pixels.google.analytics.universal.property_id,\n \t\t\titems : [{\n \t\t\t\tid : product.dyn_r_ids[wpmDataLayer.pixels.google.analytics.id_type],\n \t\t\t\tname : product.name,\n \t\t\t\tbrand : product.brand,\n \t\t\t\tcategory: product.category.join(\",\"),\n \t\t\t\t// coupon : \"\",\n \t\t\t\tlist_name : wpmDataLayer.shop.list_name,\n \t\t\t\tlist_position: product.list_position, // doesn't make sense on mini_cart\n \t\t\t\tprice : product.price,\n \t\t\t\tquantity : product.quantity,\n \t\t\t\tvariant : product.variant,\n \t\t\t}],\n \t\t})\n\t\t})\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n\n// select_content event\njQuery(document).on(\"wpmSelectContentGaUa\", function (event, product) {\n\n\ttry {\n\t\tif (!wpmDataLayer?.pixels?.google?.analytics?.eec) return\n\t\tif (!wpmDataLayer?.pixels?.google?.analytics?.universal?.property_id) return\n\t\tif (!wpm.googleConfigConditionsMet(\"analytics\")) return\n\n\t\twpm.gtagLoaded().then(function () {\n\t\t gtag(\"event\", \"select_content\", {\n \t\t\tsend_to : wpmDataLayer.pixels.google.analytics.universal.property_id,\n \t\t\tcontent_type: \"product\",\n \t\t\titems : [\n \t\t\t\t{\n \t\t\t\t\tid : product.dyn_r_ids[wpmDataLayer.pixels.google.analytics.id_type],\n \t\t\t\t\tname : product.name,\n \t\t\t\t\tlist_name : wpmDataLayer.shop.list_name,\n \t\t\t\t\tbrand : product.brand,\n \t\t\t\t\tcategory : product.category.join(\",\"),\n \t\t\t\t\tvariant : product.variant,\n \t\t\t\t\tlist_position: product.list_position, // doesn't make sense on mini_cart\n \t\t\t\t\tquantity : product.quantity,\n \t\t\t\t\tprice : product.price,\n \t\t\t\t},\n \t\t\t],\n \t\t})\n\t\t})\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n\n// add_to_cart event\njQuery(document).on(\"wpmAddToCart\", function (event, product) {\n\n\ttry {\n\t\tif (!wpmDataLayer?.pixels?.google?.analytics?.eec) return\n\t\tif (!wpmDataLayer?.pixels?.google?.analytics?.universal?.property_id) return\n\t\tif (!wpm.googleConfigConditionsMet(\"analytics\")) return\n\n\t\twpm.gtagLoaded().then(function () {\n\t\t gtag(\"event\", \"add_to_cart\", {\n \t\t\tsend_to : wpmDataLayer.pixels.google.analytics.universal.property_id,\n \t\t\tcurrency: wpmDataLayer.shop.currency,\n \t\t\titems : [\n \t\t\t\t{\n \t\t\t\t\tid : product.dyn_r_ids[wpmDataLayer.pixels.google.analytics.id_type],\n \t\t\t\t\tname : product.name,\n \t\t\t\t\tlist_name : wpmDataLayer.shop.list_name,\n \t\t\t\t\tbrand : product.brand,\n \t\t\t\t\tcategory : product.category.join(\",\"),\n \t\t\t\t\tvariant : product.variant,\n \t\t\t\t\tlist_position: product.list_position, // doesn't make sense on mini_cart\n \t\t\t\t\tquantity : product.quantity,\n \t\t\t\t\tprice : product.price,\n \t\t\t\t},\n \t\t\t],\n \t\t})\n\t\t})\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n\n// view_item event\njQuery(document).on(\"wpmViewItem\", function (event, product) {\n\n\ttry {\n\t\tif (!wpmDataLayer?.pixels?.google?.analytics?.eec) return\n\t\tif (!wpmDataLayer?.pixels?.google?.analytics?.universal?.property_id) return\n\t\tif (!wpm.googleConfigConditionsMet(\"analytics\")) return\n\n\t\twpm.gtagLoaded().then(function () {\n\t\t gtag(\"event\", \"view_item\", {\n \t\t\tsend_to: wpmDataLayer.pixels.google.analytics.universal.property_id,\n \t\t\titems : [{\n \t\t\t\tid : product.dyn_r_ids[wpmDataLayer.pixels.google.analytics.id_type],\n \t\t\t\tname : product.name,\n \t\t\t\tlist_name : wpmDataLayer.shop.list_name, // doesn't make sense on mini_cart\n \t\t\t\tbrand : product.brand,\n \t\t\t\tcategory : product.category.join(\",\"),\n \t\t\t\tvariant : product.variant,\n \t\t\t\tlist_position: 1,\n \t\t\t\tquantity : 1,\n \t\t\t\tprice : product.price,\n \t\t\t}],\n \t\t})\n\t\t})\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n\n// add_to_wishlist event\njQuery(document).on(\"wpmAddToWishlist\", function (event, product) {\n\n\ttry {\n\t\tif (!wpmDataLayer?.pixels?.google?.analytics?.eec) return\n\t\tif (!wpmDataLayer?.pixels?.google?.analytics?.universal?.property_id) return\n\t\tif (!wpm.googleConfigConditionsMet(\"analytics\")) return\n\n\t\twpm.gtagLoaded().then(function () {\n\t\t gtag(\"event\", \"add_to_wishlist\", {\n \t\t\tsend_to: wpmDataLayer.pixels.google.analytics.universal.property_id,\n \t\t\titems : [\n \t\t\t\t{\n \t\t\t\t\tid : product.dyn_r_ids[wpmDataLayer.pixels.google.analytics.id_type],\n \t\t\t\t\tname : product.name,\n \t\t\t\t\tbrand : product.brand,\n \t\t\t\t\tcategory: product.category.join(\",\"),\n \t\t\t\t\t// coupon : \"\",\n \t\t\t\t\tlist_name : wpmDataLayer.shop.list_name, // doesn't make sense on mini_cart\n \t\t\t\t\tlist_position: product.position,\n \t\t\t\t\tprice : product.price,\n \t\t\t\t\tquantity : 1,\n \t\t\t\t\tvariant : product.variant,\n \t\t\t\t},\n \t\t\t],\n \t\t})\n\t\t})\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n\n// remove_from_cart event\njQuery(document).on(\"wpmRemoveFromCart\", function (event, product) {\n\n\ttry {\n\t\tif (!wpmDataLayer?.pixels?.google?.analytics?.eec) return\n\t\tif (!wpmDataLayer?.pixels?.google?.analytics?.universal?.property_id) return\n\t\tif (!wpm.googleConfigConditionsMet(\"analytics\")) return\n\n\t\twpm.gtagLoaded().then(function () {\n\t\t gtag(\"event\", \"remove_from_cart\", {\n \t\t\tsend_to : wpmDataLayer.pixels.google.analytics.universal.property_id,\n \t\t\tcurrency: wpmDataLayer.shop.currency,\n \t\t\titems : [\n \t\t\t\t{\n \t\t\t\t\tid : product.dyn_r_ids[wpmDataLayer.pixels.google.analytics.id_type],\n \t\t\t\t\tname : product.name,\n \t\t\t\t\tlist_name: wpmDataLayer.shop.list_name,\n \t\t\t\t\tbrand : product.brand,\n \t\t\t\t\tcategory : product.category.join(\",\"),\n \t\t\t\t\tvariant : product.variant,\n \t\t\t\t\t// list_position: product.list_position, // doesn't make sense on mini_cart\n \t\t\t\t\tquantity: product.quantity,\n \t\t\t\t\tprice : product.price,\n \t\t\t\t},\n \t\t\t],\n \t\t})\n\t\t})\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n\n// begin_checkout event\njQuery(document).on(\"wpmBeginCheckout\", function (event) {\n\n\ttry {\n\t\tif (!wpmDataLayer?.pixels?.google?.analytics?.eec) return\n\t\tif (!wpmDataLayer?.pixels?.google?.analytics?.universal?.property_id) return\n\t\tif (!wpm.googleConfigConditionsMet(\"analytics\")) return\n\n\t\twpm.gtagLoaded().then(function () {\n\t\t gtag(\"event\", \"begin_checkout\", {\n \t\t\tsend_to : wpmDataLayer.pixels.google.analytics.universal.property_id,\n \t\t\tcurrency: wpmDataLayer.shop.currency,\n \t\t\titems : wpm.getCartItemsGaUa(),\n \t\t})\n\t\t})\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n\n// set_checkout_option event\njQuery(document).on(\"wpmFireCheckoutOption\", function (event, data) {\n\n\ttry {\n\t\tif (!wpmDataLayer?.pixels?.google?.analytics?.eec) return\n\t\tif (!wpmDataLayer?.pixels?.google?.analytics?.universal?.property_id) return\n\t\tif (!wpm.googleConfigConditionsMet(\"analytics\")) return\n\n\t\twpm.gtagLoaded().then(function () {\n\t\t gtag(\"event\", \"set_checkout_option\", {\n \t\t\tsend_to : wpmDataLayer.pixels.google.analytics.universal.property_id,\n \t\t\tcheckout_step : data.step,\n \t\t\tcheckout_option: data.checkout_option,\n \t\t\tvalue : data.value,\n \t\t})\n\t\t})\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n\n// checkout_progress event\njQuery(document).on(\"wpmFireCheckoutProgress\", function (event, data) {\n\n\ttry {\n\t\tif (!wpmDataLayer?.pixels?.google?.analytics?.eec) return\n\t\tif (!wpmDataLayer?.pixels?.google?.analytics?.universal?.property_id) return\n\t\tif (!wpm.googleConfigConditionsMet(\"analytics\")) return\n\n\t\twpm.gtagLoaded().then(function () {\n\t\t gtag(\"event\", \"checkout_progress\", {\n \t\t\tsend_to : wpmDataLayer.pixels.google.analytics.universal.property_id,\n \t\t\tcheckout_step: data.step,\n \t\t})\n\t\t})\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n\n// view search event\njQuery(document).on(\"wpmSearch\", function () {\n\n\ttry {\n\t\tif (!wpmDataLayer?.pixels?.google?.analytics?.eec) return\n\t\tif (!wpmDataLayer?.pixels?.google?.analytics?.universal?.property_id) return\n\t\tif (!wpm.googleConfigConditionsMet(\"analytics\")) return\n\n\t\tlet products = []\n\n\t\tfor (const [key, product] of Object.entries(wpmDataLayer.products)) {\n\t\t\t// console.log(`${key}: ${value}`);\n\n\t\t\tproducts.push({\n\t\t\t\tid : product.dyn_r_ids[wpmDataLayer.pixels.google.analytics.id_type],\n\t\t\t\tname : product.name,\n\t\t\t\tquantity: 1,\n\t\t\t\t// affiliation: \"\",\n\t\t\t\t// coupon: \"\",\n\t\t\t\t// discount: 0,\n\t\t\t\tlist_position: product.position,\n\t\t\t\tbrand : product.brand,\n\t\t\t\tcategory : product.category.join(\",\"),\n\t\t\t\tlist_name : wpmDataLayer.shop.list_name,\n\t\t\t\tvariant : product.variant,\n\t\t\t\tprice : product.price,\n\t\t\t})\n\t\t}\n\n\t\twpm.gtagLoaded().then(function () {\n\t\t\tgtag(\"event\", \"view_search_results\", {\n\t\t\t\tsend_to : wpmDataLayer.pixels.google.analytics.universal.property_id,\n\t\t\t\tsearch_term: wpm.getSearchTermFromUrl(),\n\t\t\t\titems : products,\n\t\t\t})\n\t\t})\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n\n// user log in event\njQuery(document).on(\"wpmLogin\", function () {\n\n\ttry {\n\t\tif (!wpmDataLayer?.pixels?.google?.analytics?.eec) return\n\t\tif (!wpmDataLayer?.pixels?.google?.analytics?.universal?.property_id) return\n\t\tif (!wpm.googleConfigConditionsMet(\"analytics\")) return\n\n\n\t\twpm.gtagLoaded().then(function () {\n\t\t gtag(\"event\", \"login\", {\n \t\t\tsend_to: wpmDataLayer.pixels.google.analytics.universal.property_id,\n \t\t})\n\t\t})\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n\n","/**\n * Add functions for Google Analytics Universal\n * */\n\n(function (wpm, $, undefined) {\n\n\twpm.getGAUAOrderItems = function () {\n\n\t\t// \"id\" : \"34\",\n\t\t// \"name\" : \"Hoodie\",\n\t\t// \"brand\" : \"\",\n\t\t// \"category\" : \"Hoodies\",\n\t\t// \"list_position\": 1,\n\t\t// \"price\" : 45,\n\t\t// \"quantity\" : 1,\n\t\t// \"variant\" : \"Color: blue | Logo: yes\"\n\n\n\t\tlet orderItems = [],\n\t\t\tlist_position = 1\n\n\t\tfor (const [key, item] of Object.entries(wpmDataLayer.order.items)) {\n\n\t\t\tlet orderItem\n\n\t\t\torderItem = {\n\t\t\t\tquantity : item.quantity,\n\t\t\t\tprice : item.price,\n\t\t\t\tname : item.name,\n\t\t\t\tcurrency : wpmDataLayer.order.currency,\n\t\t\t\tcategory : wpmDataLayer.products[item.id].category.join(\"/\"),\n\t\t\t\tlist_position: list_position,\n\t\t\t}\n\n\t\t\tif (wpmDataLayer?.general?.variationsOutput && 0 !== item.variation_id) {\n\n\t\t\t\torderItem.id = String(wpmDataLayer.products[item.variation_id].dyn_r_ids[wpmDataLayer.pixels.google.analytics.id_type])\n\t\t\t\torderItem.variant = wpmDataLayer.products[item.variation_id].variant_name\n\t\t\t\torderItem.brand = wpmDataLayer.products[item.variation_id].brand\n\t\t\t} else {\n\n\t\t\t\torderItem.id = String(wpmDataLayer.products[item.id].dyn_r_ids[wpmDataLayer.pixels.google.analytics.id_type])\n\t\t\t\torderItem.brand = wpmDataLayer.products[item.id].brand\n\t\t\t}\n\n\t\t\torderItems.push(orderItem)\n\t\t\tlist_position++\n\t\t}\n\n\t\treturn orderItems\n\t}\n\n}(window.wpm = window.wpm || {}, jQuery))\n\n\n/**\n * All event listeners\n * */\n\n\n// view order received page event\njQuery(document).on(\"wpmOrderReceivedPage\", function () {\n\n\ttry {\n\t\tif (!wpmDataLayer?.pixels?.google?.analytics?.universal?.property_id) return\n\t\tif (wpmDataLayer?.pixels?.google?.analytics?.universal?.mp_active) return\n\t\tif (!wpm.googleConfigConditionsMet(\"analytics\")) return\n\n\t\twpm.gtagLoaded().then(function () {\n\t\t\tgtag(\"event\", \"purchase\", {\n\t\t\t\tsend_to : [wpmDataLayer.pixels.google.analytics.universal.property_id],\n\t\t\t\ttransaction_id: wpmDataLayer.order.number,\n\t\t\t\taffiliation : wpmDataLayer.order.affiliation,\n\t\t\t\tcurrency : wpmDataLayer.order.currency,\n\t\t\t\tvalue : wpmDataLayer.order.value_regular,\n\t\t\t\tdiscount : wpmDataLayer.order.discount,\n\t\t\t\ttax : wpmDataLayer.order.tax,\n\t\t\t\tshipping : wpmDataLayer.order.shipping,\n\t\t\t\tcoupon : wpmDataLayer.order.coupon,\n\t\t\t\titems : wpm.getGAUAOrderItems(),\n\t\t\t})\n\t\t})\n\n\t\t// console.log(wpm.getGAUAOrderItems())\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n","(function (wpm, $, undefined) {\n\n\twpm.load_google_optimize_pixel = function () {\n\n\t\ttry {\n\t\t\tif (wpmDataLayer?.pixels?.google?.optimize?.container_id) {\n\n\t\t\t\twpmDataLayer.pixels.google.optimize.loaded = true\n\n\t\t\t\twpm.loadScriptAndCacheIt(\"https://www.googleoptimize.com/optimize.js?id=\" + wpmDataLayer.pixels.google.optimize.container_id)\n\t\t\t\t// .done(function (script, textStatus) {\n\t\t\t\t// \t\tconsole.log('Google Optimize loaded')\n\t\t\t\t// });\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t}\n\t}\n\n}(window.wpm = window.wpm || {}, jQuery));\n\n\n(function () {\n\n\tjQuery(document).on(\"wpmLoadPixels\", function () {\n\n\t\tif (wpm.canIFire(\"analytics\", \"google-optimize\") && !wpmDataLayer?.pixels?.google?.optimize?.loaded) wpm.load_google_optimize_pixel()\n\n\t})\n\n})()\n\n\n\n","/**\n * Add functions for Google\n * */\n\n(function (wpm, $, undefined) {\n\n\twpm.googleConfigConditionsMet = function (type) {\n\t\t// always returns true if Google Consent Mode is active\n\t\tif (wpmDataLayer?.pixels?.google?.consent_mode?.active) {\n\t\t\treturn true\n\t\t} else if (wpm.getConsentValues().mode === \"category\") {\n\t\t\treturn wpm.getConsentValues().categories[type] === true\n\t\t} else if (wpm.getConsentValues().mode === \"pixel\") {\n\t\t\treturn wpm.getConsentValues().pixels.includes(\"google-\" + type)\n\t\t} else {\n\t\t\treturn false\n\t\t}\n\t}\n\n\twpm.getVisitorConsentStatusAndUpdateGoogleConsentSettings = function (google_consent_settings) {\n\n\t\tif (wpm.getConsentValues().mode === \"category\") {\n\t\t\tif (wpm.getConsentValues().categories.analytics) google_consent_settings.analytics_storage = \"granted\"\n\t\t\tif (wpm.getConsentValues().categories.ads) google_consent_settings.ad_storage = \"granted\"\n\t\t} else if ((wpm.getConsentValues().mode === \"pixel\")) {\n\t\t\tgoogle_consent_settings.analytics_storage = wpm.getConsentValues().pixels.includes(\"google-analytics\") ? \"granted\" : \"denied\"\n\t\t\tgoogle_consent_settings.ad_storage = wpm.getConsentValues().pixels.includes(\"google-ads\") ? \"granted\" : \"denied\"\n\t\t}\n\n\t\treturn google_consent_settings\n\t}\n\n\twpm.updateGoogleConsentMode = function (analytics = true, ads = true) {\n\n\t\ttry {\n\t\t\tif (\n\t\t\t\t!window.gtag ||\n\t\t\t\t!wpmDataLayer.shop.cookie_consent_mgmt.explicit_consent\n\t\t\t) return\n\n\t\t\tgtag(\"consent\", \"update\", {\n\t\t\t\tanalytics_storage: analytics ? \"granted\" : \"denied\",\n\t\t\t\tad_storage : ads ? \"granted\" : \"denied\",\n\t\t\t})\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t}\n\t}\n\n\twpm.fireGtagGoogleAds = function () {\n\t\ttry {\n\t\t\twpmDataLayer.pixels.google.ads.state = \"loading\"\n\n\t\t\tif (wpmDataLayer?.pixels?.google?.ads?.enhanced_conversions?.active) {\n\t\t\t\tfor (const [key, item] of Object.entries(wpmDataLayer.pixels.google.ads.conversionIds)) {\n\t\t\t\t\tgtag(\"config\", key, {\"allow_enhanced_conversions\": true})\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tfor (const [key, item] of Object.entries(wpmDataLayer.pixels.google.ads.conversionIds)) {\n\t\t\t\t\tgtag(\"config\", key)\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (wpmDataLayer?.pixels?.google?.ads?.conversionIds && wpmDataLayer?.pixels?.google?.ads?.phone_conversion_label && wpmDataLayer?.pixels?.google?.ads?.phone_conversion_number) {\n\t\t\t\tgtag(\"config\", Object.keys(wpmDataLayer.pixels.google.ads.conversionIds)[0] + \"/\" + wpmDataLayer.pixels.google.ads.phone_conversion_label, {\n\t\t\t\t\tphone_conversion_number: wpmDataLayer.pixels.google.ads.phone_conversion_number,\n\t\t\t\t})\n\t\t\t}\n\n\t\t\t// ! enhanced_conversion_data needs to be var\n\t\t\t// https://support.google.com/google-ads/answer/9888145#zippy=%2Cvalidate-your-implementation-using-chrome-developer-tools\n\t\t\tif (\"order_received_page\" === wpmDataLayer.shop.page_type && wpmDataLayer?.order?.google?.ads?.enhanced_conversion_data) {\n\t\t\t\twindow.enhanced_conversion_data = wpmDataLayer.order.google.ads.enhanced_conversion_data\n\t\t\t}\n\n\t\t\twpmDataLayer.pixels.google.ads.state = \"ready\"\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t}\n\t}\n\n\twpm.fireGtagGoogleAnalyticsUA = function () {\n\t\ttry {\n\t\t\twpmDataLayer.pixels.google.analytics.universal.state = \"loading\"\n\n\t\t\tgtag(\"config\", wpmDataLayer.pixels.google.analytics.universal.property_id, wpmDataLayer.pixels.google.analytics.universal.parameters)\n\t\t\twpmDataLayer.pixels.google.analytics.universal.state = \"ready\"\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t}\n\t}\n\n\twpm.fireGtagGoogleAnalyticsGA4 = function () {\n\t\ttry {\n\t\t\twpmDataLayer.pixels.google.analytics.ga4.state = \"loading\"\n\n\t\t\tgtag(\"config\", wpmDataLayer.pixels.google.analytics.ga4.measurement_id, wpmDataLayer.pixels.google.analytics.ga4.parameters)\n\t\t\twpmDataLayer.pixels.google.analytics.ga4.state = \"ready\"\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t}\n\t}\n\n\twpm.isGoogleActive = function () {\n\t\tif (\n\t\t\twpmDataLayer?.pixels?.google?.analytics?.universal?.property_id ||\n\t\t\twpmDataLayer?.pixels?.google?.analytics?.ga4?.measurement_id ||\n\t\t\t!jQuery.isEmptyObject(wpmDataLayer?.pixels?.google?.ads?.conversionIds)\n\t\t) {\n\t\t\treturn true\n\t\t} else {\n\t\t\treturn false\n\t\t}\n\t}\n\n\twpm.getGoogleGtagId = function () {\n\t\tif (wpmDataLayer?.pixels?.google?.analytics?.universal?.property_id) {\n\t\t\treturn wpmDataLayer.pixels.google.analytics.universal.property_id\n\t\t} else if (wpmDataLayer?.pixels?.google?.analytics?.ga4?.measurement_id) {\n\t\t\treturn wpmDataLayer.pixels.google.analytics.ga4.measurement_id\n\t\t} else {\n\t\t\treturn Object.keys(wpmDataLayer.pixels.google.ads.conversionIds)[0]\n\t\t}\n\t}\n\n\twpm.loadGoogle = function () {\n\n\t\tif (wpm.isGoogleActive()) {\n\n\t\t\twpmDataLayer.pixels.google.state = \"loading\"\n\n\t\t\twpm.loadScriptAndCacheIt(\"https://www.googletagmanager.com/gtag/js?id=\" + wpm.getGoogleGtagId())\n\t\t\t\t.done(function (script, textStatus) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\t// console.log('Google Optimize loaded')\n\t\t\t\t\t\t// alert('Google Optimize loaded')\n\n\t\t\t\t\t\t// Initiate Google dataLayer and gtag\n\t\t\t\t\t\twindow.dataLayer = window.dataLayer || []\n\t\t\t\t\t\twindow.gtag = function gtag() {\n\t\t\t\t\t\t\tdataLayer.push(arguments)\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Google Consent Mode\n\t\t\t\t\t\tif (wpmDataLayer?.pixels?.google?.consent_mode?.active) {\n\n\t\t\t\t\t\t\tlet google_consent_settings = {\n\t\t\t\t\t\t\t\t\"ad_storage\" : wpmDataLayer.pixels.google.consent_mode.ad_storage,\n\t\t\t\t\t\t\t\t\"analytics_storage\": wpmDataLayer.pixels.google.consent_mode.analytics_storage,\n\t\t\t\t\t\t\t\t\"wait_for_update\" : wpmDataLayer.pixels.google.consent_mode.wait_for_update,\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (wpmDataLayer?.pixels?.google?.consent_mode?.region) {\n\t\t\t\t\t\t\t\tgoogle_consent_settings.region = wpmDataLayer.pixels.google.consent_mode.region\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tgoogle_consent_settings = wpm.getVisitorConsentStatusAndUpdateGoogleConsentSettings(google_consent_settings)\n\n\t\t\t\t\t\t\tgtag(\"consent\", \"default\", google_consent_settings)\n\t\t\t\t\t\t\tgtag(\"set\", \"ads_data_redaction\", wpmDataLayer.pixels.google.consent_mode.ads_data_redaction)\n\t\t\t\t\t\t\tgtag(\"set\", \"url_passthrough\", wpmDataLayer.pixels.google.consent_mode.url_passthrough)\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Google Linker\n\t\t\t\t\t\t// https://developers.google.com/gtagjs/devguide/linker\n\t\t\t\t\t\tif (wpmDataLayer?.pixels?.google?.linker?.settings) {\n\t\t\t\t\t\t\tgtag(\"set\", \"linker\", wpmDataLayer.pixels.google.linker.settings)\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tgtag(\"js\", new Date())\n\n\t\t\t\t\t\tif (wpm.googleConfigConditionsMet(\"ads\") && !jQuery.isEmptyObject(wpmDataLayer?.pixels?.google?.ads?.conversionIds)) wpm.fireGtagGoogleAds()\n\t\t\t\t\t\tif (wpm.googleConfigConditionsMet(\"analytics\") && wpmDataLayer?.pixels?.google?.analytics?.universal?.property_id) wpm.fireGtagGoogleAnalyticsUA()\n\t\t\t\t\t\tif (wpm.googleConfigConditionsMet(\"analytics\") && wpmDataLayer?.pixels?.google?.analytics?.ga4?.measurement_id) wpm.fireGtagGoogleAnalyticsGA4()\n\n\t\t\t\t\t\twpmDataLayer.pixels.google.state = \"ready\"\n\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\tconsole.error(e)\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t}\n\t}\n\n\twpm.canGoogleLoad = function () {\n\n\t\tif (wpmDataLayer?.pixels?.google?.consent_mode?.active) {\n\t\t\treturn true\n\t\t} else if (\"category\" === wpm.getConsentValues().mode) {\n\t\t\treturn !!(wpm.getConsentValues().categories[\"ads\"] || wpm.getConsentValues().categories[\"analytics\"])\n\t\t} else if (\"pixel\" === wpm.getConsentValues().mode) {\n\t\t\treturn wpm.getConsentValues().pixels.includes(\"google-ads\") || wpm.getConsentValues().pixels.includes(\"google-analytics\")\n\t\t} else {\n\t\t\tconsole.error(\"Couldn't find a valid load condition for Google mode in wpmConsentValues\")\n\t\t\treturn false\n\t\t}\n\t}\n\n\twpm.gtagLoaded = function () {\n\t\treturn new Promise(function (resolve, reject) {\n\n\t\t\tif (typeof wpmDataLayer?.pixels?.google?.state === \"undefined\") reject()\n\n\t\t\tlet startTime = 0\n\t\t\tlet timeout = 5000\n\t\t\tlet frequency = 200;\n\n\t\t\t(function wait() {\n\t\t\t\tif (wpmDataLayer?.pixels?.google?.state === \"ready\") return resolve()\n\t\t\t\tif (startTime >= timeout) return reject()\n\t\t\t\tstartTime += frequency\n\t\t\t\tsetTimeout(wait, frequency)\n\t\t\t})()\n\t\t})\n\t}\n\n\t// wpm.gtagLoadednew = function () {\n\t// \treturn Promise.race([\n\t// \t\t\tnew Promise(function (resolve, reject) {\n\t//\n\t// \t\t\t\tif (typeof wpmDataLayer?.pixels?.google?.state === \"undefined\") reject();\n\t//\n\t//\n\t// \t\t\t\t(function wait() {\n\t// \t\t\t\t\tif (wpmDataLayer?.pixels?.google?.state === \"ready\") return resolve()\n\t// \t\t\t\t\tif (to >= 1000) return reject()\n\t// \t\t\t\t\tsetTimeout(wait, 100)\n\t// \t\t\t\t})()\n\t// \t\t\t}),\n\t// \t\t\tnew Promise(function (resolve, reject) {\n\t// \t\t\t\tsetTimeout(() => reject(), 1000)\n\t// \t\t\t}),\n\t// \t\t],\n\t// \t)\n\t// \t\t// .then((value) => {console.log(\"race then value: \" + value)})\n\t// \t\t.catch(\n\t// \t\t\t(value) => {\n\t// \t\t\t\tconsole.log(\"race catch value: \" + value)\n\t// \t\t\t\treturn Promise.reject()\n\t// \t\t\t})\n\t// }\n\n\n\t// const promise1 = new Promise((resolve, reject) => {\n\t// \tsetTimeout(resolve, 500, \"one\")\n\t// })\n\t//\n\t// const promise2 = new Promise((resolve, reject) => {\n\t// \tsetTimeout(reject, 100, \"two\")\n\t// })\n\t//\n\t// let onlyRunIfResolves = function () {\n\t// \treturn Promise.race([promise1, promise2])\n\t// \t\t.catch(() => {\n\t// \t\t})\n\t// }\n\t//\n\t// onlyRunIfResolves()\n\t// \t.then(() => {\n\t// \t\tconsole.log(\"running function\")\n\t// \t})\n\n\n}(window.wpm = window.wpm || {}, jQuery));\n\n\n(function () {\n\n\tjQuery(document).on(\"wpmLoadPixels\", function () {\n\n\t\tif (\n\t\t\twpm.canGoogleLoad() &&\n\t\t\t(typeof wpmDataLayer?.pixels?.google?.state === \"undefined\")\n\t\t) {\n\t\t\twpm.loadGoogle()\n\t\t}\n\t})\n\n\t// return wpmDataLayer?.pixels?.google?.state === \"undefined\";\n\n})()\n","(function (wpm, $, undefined) {\n\n\twpm.getFormattedGA4Categories = function (productItems, categories) {\n\n\t\tlet maxCategories = 5\n\n\t\t// remove categories with equal names from array\n\t\tcategories = Array.from(new Set(categories))\n\n\t\tif (Array.isArray(categories) && categories.length) {\n\n\t\t\tproductItems[\"item_category\"] = categories[0]\n\n\t\t\tlet max = categories.length > maxCategories ? maxCategories : categories.length\n\n\t\t\tfor (let i = 1; i < max; i++) {\n\t\t\t\tproductItems[\"item_category\" + (i + 1)] = categories[i]\n\t\t\t}\n\t\t}\n\n\t\treturn productItems\n\t}\n\n\twpm.setGoogleCidOnServer = function () {\n\n\t\ttry {\n\n\t\t\tlet targetIDs = []\n\n\t\t\tif (wpmDataLayer?.pixels?.google?.analytics?.ga4?.measurement_id) targetIDs.push(wpmDataLayer.pixels.google.analytics.ga4.measurement_id)\n\t\t\tif (wpmDataLayer?.pixels?.google?.analytics?.universal?.property_id) targetIDs.push(wpmDataLayer.pixels.google.analytics.universal.property_id)\n\n\n\t\t\twpm.gtagLoaded().then(function () {\n\t\t\t gtag(\"get\", targetIDs[0], \"client_id\", (clientID) => {\n\n \t\t\t\t// save the state in the database\n \t\t\t\tlet data = {\n \t\t\t\t\taction: \"wpm_google_analytics_set_session_data\",\n \t\t\t\t\t// 'nonce' : wpm_google_premium_only_ajax_object.nonce,\n \t\t\t\t\t// 'nonce' : wpm.nonce,\n \t\t\t\t\ttarget_ids: targetIDs,\n \t\t\t\t\tclient_id : clientID,\n \t\t\t\t\treferrer : wpm.getReferrerFromCookie(),\n \t\t\t\t\tgclid : wpm.getClidFromBrowser(\"gclid\"),\n \t\t\t\t\t// dclid : wpm.getClidFromBrowser('dclid'),\n \t\t\t\t\tuserAgent : wpm.getUserAgent(),\n \t\t\t\t\tviewPortWidth : wpm.getViewPort().width,\n \t\t\t\t\tviewPortHeight: wpm.getViewPort().height,\n \t\t\t\t}\n\n \t\t\t\tjQuery.ajax(\n \t\t\t\t\t{\n \t\t\t\t\t\ttype : \"post\",\n \t\t\t\t\t\tdataType: \"json\",\n \t\t\t\t\t\t// url : wpm_google_premium_only_ajax_object.ajax_url,\n \t\t\t\t\t\turl : wpm.ajax_url,\n \t\t\t\t\t\tdata : data,\n \t\t\t\t\t\tsuccess: function (response) {\n\n \t\t\t\t\t\t\tif (response[\"success\"] === true) {\n \t\t\t\t\t\t\t\tif (window.sessionStorage) {\n \t\t\t\t\t\t\t\t\ttargetIDs.forEach((targetId) => {\n \t\t\t\t\t\t\t\t\t\twindow.sessionStorage.setItem('_wpm_ga_cid_set', JSON.stringify(true))\n \t\t\t\t\t\t\t\t\t\twindow.sessionStorage.setItem(\"wpm_cid_\" + targetId + \"_\" + clientID + \"_set\", JSON.stringify(true))\n \t\t\t\t\t\t\t\t\t})\n \t\t\t\t\t\t\t\t} else {\n \t\t\t\t\t\t\t\t\ttargetIDs.forEach((targetId) => {\n \t\t\t\t\t\t\t\t\t\twpm.setCookie(\"wpm_cid_\" + targetId + \"_\" + clientID + \"_set\", true)\n \t\t\t\t\t\t\t\t\t})\n \t\t\t\t\t\t\t\t}\n \t\t\t\t\t\t\t}\n \t\t\t\t\t\t},\n \t\t\t\t\t\terror : function (response) {\n \t\t\t\t\t\t\tconsole.error(response)\n \t\t\t\t\t\t},\n \t\t\t\t\t})\n\n \t\t\t\t// wp.ajax.post('wpm_google_analytics_set_session_data', data)\n \t\t\t\t// .done(function (response) {\n \t\t\t\t//\n \t\t\t\t// // console.log(response);\n \t\t\t\t//\n \t\t\t\t// if (response === 'success') {\n \t\t\t\t// if (window.sessionStorage) {\n \t\t\t\t// // console.log('setting session storage');\n \t\t\t\t// window.sessionStorage.setItem(cidSetOnServerCookie, JSON.stringify(true));\n \t\t\t\t// } else {\n \t\t\t\t// // console.log('not setting session storage');\n \t\t\t\t//\n \t\t\t\t// wpm.setCookie(cidSetOnServerCookie, true);\n \t\t\t\t// }\n \t\t\t\t// }\n \t\t\t\t// })\n \t\t\t\t// .fail(function (response) {\n \t\t\t\t// console.log(response);\n \t\t\t\t// });\n \t\t\t})\n\t\t\t})\n\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t}\n\t}\n\n}(window.wpm = window.wpm || {}, jQuery))\n\n\njQuery(window).on(\"wpmLoadAlways\", function () {\n\n\ttry {\n\t\tif (\n\t\t\twpmDataLayer?.pixels?.google?.analytics?.eec &&\n\t\t\t!window?.sessionStorage?.getItem('_wpm_ga_cid_set', JSON.parse(true)) &&\n\t\t\t(\n\t\t\t\twpmDataLayer?.pixels?.google?.analytics?.universal?.property_id ||\n\t\t\t\twpmDataLayer?.pixels?.google?.analytics?.ga4?.measurement_id\n\t\t\t)\n\t\t) {\n\t\t\t// We need to be sure that we capture the cid early enough, because the\n\t\t\t// shop might be using a one click checkout button as early as on the product page.\n\t\t\tif ([\"cart\", \"checkout\"].indexOf(wpmDataLayer.shop.page_type) >= 0) {\n\t\t\t\twpm.setGoogleCidOnServer()\n\t\t\t}\n\t\t}\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n\n","(function (wpm, $, undefined) {\n\n\twpm.load_hotjar_pixel = function () {\n\n\t\tif (wpmDataLayer?.pixels?.hotjar?.site_id) {\n\n\t\t\t// console.log('hotjar loaded');\n\n\t\t\twpmDataLayer.pixels.hotjar.loaded = true;\n\n\t\t\t// @formatter:off\n\t\t\t(function(h,o,t,j,a,r){\n\t\t\t\th.hj=h.hj||function(){(h.hj.q=h.hj.q||[]).push(arguments)};\n\t\t\t\th._hjSettings={hjid:wpmDataLayer.pixels.hotjar.site_id,hjsv:6};\n\t\t\t\ta=o.getElementsByTagName('head')[0];\n\t\t\t\tr=o.createElement('script');r.async=1;\n\t\t\t\tr.src=t+h._hjSettings.hjid+j+h._hjSettings.hjsv;\n\t\t\t\ta.appendChild(r);\n\t\t\t})(window,document,'https://static.hotjar.com/c/hotjar-','.js?sv=');\n\t\t\t// @formatter:on\n\n\t\t}\n\t}\n\n}(window.wpm = window.wpm || {}, jQuery));\n\n\n(function () {\n\n\tjQuery(document).on(\"wpmLoadPixels\", function () {\n\n\t\tif (wpm.canIFire(\"analytics\", \"hotjar\") && !wpmDataLayer?.pixels?.hotjar?.loaded) wpm.load_hotjar_pixel()\n\n\t})\n\n})()\n\n\n\n","/**\n * Add functions for Microsoft Ads\n * */\n\n(function (wpm, $, undefined) {\n\n\twpm.load_bing_pixel = function () {\n\n\t\ttry {\n\t\t\tif (wpmDataLayer?.pixels?.bing?.uet_tag_id) {\n\n\t\t\t\twpmDataLayer.pixels.bing.loaded = true\n\n\t\t\t\t// @formatter:off\n \t\t\twindow.uetq = window.uetq || [];\n\n \t\t\t(function(w,d,t,r,u){var f,n,i;w[u]=w[u]||[],f=function(){var o={ti:wpmDataLayer.pixels.bing.uet_tag_id};o.q=w[u],w[u]=new UET(o),w[u].push(\"pageLoad\")},n=d.createElement(t),n.src=r,n.async=1,n.onload=n.onreadystatechange=function(){var s=this.readyState;s&&s!==\"loaded\"&&s!==\"complete\"||(f(),n.onload=n.onreadystatechange=null)},i=d.getElementsByTagName(t)[0],i.parentNode.insertBefore(n,i)})(window,document,\"script\",\"//bat.bing.com/bat.js\",\"uetq\");\n \t\t\t// @formatter:on\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t}\n\t}\n\n\twpm.bing_purchase_ecomm_prodids = function () {\n\n\t\tlet prodIds = []\n\n\t\tfor (const [key, orderItem] of Object.entries(wpmDataLayer.order.items)) {\n\n\t\t\tif (wpmDataLayer?.general?.variationsOutput && 0 !== orderItem.variation_id) {\n\t\t\t\tprodIds.push(String(wpmDataLayer.products[orderItem.variation_id].dyn_r_ids[wpmDataLayer.pixels.bing.dynamic_remarketing.id_type]))\n\t\t\t} else {\n\t\t\t\tprodIds.push(String(wpmDataLayer.products[orderItem.id].dyn_r_ids[wpmDataLayer.pixels.bing.dynamic_remarketing.id_type]))\n\t\t\t}\n\t\t}\n\n\t\treturn prodIds\n\t}\n\n\twpm.bing_purchase_items = function () {\n\n\t\tlet orderItems = []\n\n\t\tfor (const [key, item] of Object.entries(wpmDataLayer.order.items)) {\n\n\t\t\tlet orderItem\n\n\t\t\torderItem = {\n\t\t\t\tquantity: item.quantity,\n\t\t\t\tprice : item.price,\n\t\t\t}\n\n\t\t\tif (wpmDataLayer?.general?.variationsOutput && 0 !== item.variation_id) {\n\n\t\t\t\torderItem.id = String(wpmDataLayer.products[item.variation_id].dyn_r_ids[wpmDataLayer.pixels.bing.dynamic_remarketing.id_type])\n\t\t\t\torderItems.push(orderItem)\n\t\t\t} else {\n\n\t\t\t\torderItem.id = String(wpmDataLayer.products[item.id].dyn_r_ids[wpmDataLayer.pixels.bing.dynamic_remarketing.id_type])\n\t\t\t\torderItems.push(orderItem)\n\t\t\t}\n\t\t}\n\n\t\treturn orderItems\n\t}\n\n}(window.wpm = window.wpm || {}, jQuery));\n\n\n/**\n * Execute as soon as possible\n * */\n\n(function () {\n\n\tjQuery(document).on(\"wpmLoadPixels\", function () {\n\n\t\tif (wpm.canIFire(\"ads\", \"bing-ads\") && !wpmDataLayer?.pixels?.bing?.loaded) wpm.load_bing_pixel()\n\n\t})\n\n})()\n\n\n/**\n * All event listeners\n * */\n\n// add-to-cart event\njQuery(document).on(\"wpmAddToCart\", function (event, product) {\n\n\ttry {\n\t\tif (!wpmDataLayer?.pixels?.bing?.loaded) return\n\n\t\twindow.uetq.push(\"event\", \"\", {\n\t\t\tecomm_pagetype: \"cart\",\n\t\t\tecomm_prodid : product.dyn_r_ids[wpmDataLayer.pixels.bing.dynamic_remarketing.id_type],\n\t\t})\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n\n// view product event\njQuery(document).on(\"wpmViewItem\", function (event, product) {\n\n\ttry {\n\t\tif (!wpmDataLayer?.pixels?.bing?.loaded) return\n\n\t\twindow.uetq.push(\"event\", \"\", {\n\t\t\tecomm_pagetype: \"product\",\n\t\t\tecomm_prodid : product.dyn_r_ids[wpmDataLayer.pixels.bing.dynamic_remarketing.id_type],\n\t\t})\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n\n// view category event\njQuery(document).on(\"wpmCategory\", function () {\n\n\ttry {\n\t\tif (!wpmDataLayer?.pixels?.bing?.loaded) return\n\n\t\twindow.uetq.push(\"event\", \"\", {\n\t\t\tecomm_pagetype: \"category\",\n\t\t})\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n\n// view search event\njQuery(document).on(\"wpmSearch\", function () {\n\n\ttry {\n\t\tif (!wpmDataLayer?.pixels?.bing?.loaded) return\n\n\t\twindow.uetq.push(\"event\", \"\", {\n\t\t\tecomm_pagetype: \"searchresults\",\n\t\t})\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n\n// view order received page event\n// https://help.ads.microsoft.com/#apex/ads/en/60118/-1\njQuery(document).on(\"wpmOrderReceivedPage\", function () {\n\n\ttry {\n\t\tif (!wpmDataLayer?.pixels?.bing?.loaded) return\n\n\t\twindow.uetq.push(\"event\", \"purchase\", {\n\t\t\tecomm_pagetype: \"purchase\",\n\t\t\tecomm_prodid : wpm.bing_purchase_ecomm_prodids(),\n\t\t\trevenue_value : wpmDataLayer.order.value_filtered,\n\t\t\tcurrency : wpmDataLayer.order.currency,\n\t\t\titems : wpm.bing_purchase_items(),\n\t\t})\n\n\t\t// console.log('test')\n\t\t// console.log(wpm.bing_purchase_ecomm_prodids())\n\t\t// console.log(wpm.bing_purchase_items())\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n\n","// TODO add enhanced match email hash to uncached pages like cart and purchase confirmation page\n// TODO check if more values can be passed to product and category pages\n// TODO look into how Pinterest handles variants separately https://developers.pinterest.com/docs/tag/conversion/\n\n/**\n * Add functions for Pinterest\n * */\n\n(function (wpm, $, undefined) {\n\n\twpm.getPinterestProductData = function (product) {\n\n\t\t// console.log(product)\n\n\t\tif (product.isVariation) {\n\t\t\treturn {\n\t\t\t\tproduct_name : product.name,\n\t\t\t\tproduct_variant_id: product.dyn_r_ids[wpmDataLayer.pixels.pinterest.dynamic_remarketing.id_type],\n\t\t\t\t// product_id : wpmDataLayer.products[product.parentId].dyn_r_ids[wpmDataLayer.pixels.pinterest.dynamic_remarketing.id_type],\n\t\t\t\tproduct_id : product.parentId_dyn_r_ids[wpmDataLayer.pixels.pinterest.dynamic_remarketing.id_type],\n\t\t\t\tproduct_category: product.category,\n\t\t\t\tproduct_variant : product.variant,\n\t\t\t\tproduct_price : product.price,\n\t\t\t\tproduct_quantity: product.quantity,\n\t\t\t\tproduct_brand : product.brand,\n\t\t\t}\n\t\t} else {\n\t\t\treturn {\n\t\t\t\tproduct_name : product.name,\n\t\t\t\tproduct_id : product.dyn_r_ids[wpmDataLayer.pixels.pinterest.dynamic_remarketing.id_type],\n\t\t\t\tproduct_category: product.category,\n\t\t\t\tproduct_price : product.price,\n\t\t\t\tproduct_quantity: product.quantity,\n\t\t\t\tproduct_brand : product.brand,\n\t\t\t}\n\t\t}\n\t}\n\n\twpm.pinterestFormattedOrderItems = function () {\n\n\t\tlet orderItems = []\n\n\t\tfor (const [key, item] of Object.entries(wpmDataLayer.order.items)) {\n\n\t\t\tlet orderItem\n\n\t\t\torderItem = {\n\t\t\t\tproduct_category: wpmDataLayer.products[key].category.join(\",\"),\n\t\t\t\t// product_brand : wpmDataLayer.products[key].brand,\n\t\t\t\tproduct_quantity: item.quantity,\n\t\t\t\tproduct_price : item.price,\n\t\t\t}\n\n\t\t\tif (wpmDataLayer?.general?.variationsOutput && 0 !== item.variation_id) {\n\n\t\t\t\torderItem.product_id = String(wpmDataLayer.products[item.variation_id].dyn_r_ids[wpmDataLayer.pixels.pinterest.dynamic_remarketing.id_type])\n\t\t\t\torderItem.product_name = wpmDataLayer.products[item.variation_id].name\n\t\t\t\torderItems.push(orderItem)\n\t\t\t} else {\n\n\t\t\t\torderItem.product_id = String(wpmDataLayer.products[item.id].dyn_r_ids[wpmDataLayer.pixels.pinterest.dynamic_remarketing.id_type])\n\t\t\t\torderItem.product_name = wpmDataLayer.products[item.id].name\n\t\t\t\torderItems.push(orderItem)\n\t\t\t}\n\t\t}\n\n\t\treturn orderItems\n\t}\n\n\t// https://developers.pinterest.com/docs/tag/conversion/\n\twpm.loadPinterestPixel = function () {\n\n\t\ttry {\n\t\t\tif (wpmDataLayer?.pixels?.pinterest?.pixel_id) {\n\n\t\t\t\twpmDataLayer.pixels.pinterest.loaded = true;\n\n\t\t\t\t// @formatter:off\n \t\t\t!function(e){if(!window.pintrk){window.pintrk=function(){window.pintrk.queue.push(\n \t\t\t\tArray.prototype.slice.call(arguments))};var\n \t\t\t\tn=window.pintrk;n.queue=[],n.version=\"3.0\";var\n \t\t\t\tt=document.createElement(\"script\");t.async=!0,t.src=e;var\n \t\t\t\tr=document.getElementsByTagName(\"script\")[0];r.parentNode.insertBefore(t,r)}}(\"https://s.pinimg.com/ct/core.js\");\n\n \t\t\twpm.pinterestLoadEvent();\n \t\t\tpintrk('page');\n \t\t\t// @formatter:on\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t}\n\t}\n\n\twpm.pinterestLoadEvent = function () {\n\t\ttry {\n\t\t\tif (\n\t\t\t\t(\n\t\t\t\t\twpmDataLayer.general.userLoggedIn ||\n\t\t\t\t\t\"order_received_page\" === wpmDataLayer.shop.page_type\n\t\t\t\t)\n\t\t\t\t&& wpmDataLayer?.pixels?.pinterest?.enhanced_match\n\t\t\t) {\n\t\t\t\tpintrk(\"load\", wpmDataLayer.pixels.pinterest.pixel_id, {em: wpmDataLayer.pixels.pinterest.enhanced_match_email})\n\t\t\t} else {\n\t\t\t\tpintrk(\"load\", wpmDataLayer.pixels.pinterest.pixel_id)\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t}\n\t}\n\n}(window.wpm = window.wpm || {}, jQuery));\n\n/**\n * Execute as soon as possible\n * */\n\n(function () {\n\n\tjQuery(document).on(\"wpmLoadPixels\", function () {\n\n\t\tif (wpm.canIFire(\"ads\", \"pinterest-ads\") && !wpmDataLayer?.pixels?.pinterest?.loaded) wpm.loadPinterestPixel()\n\n\t})\n\n})()\n\n\n/**\n * All event listeners\n * */\n\n// https://help.pinterest.com/en/business/article/add-event-codes\n\n// AddToCart event\njQuery(document).on(\"wpmAddToCart\", function (event, product) {\n\n\ttry {\n\t\tif (!wpmDataLayer?.pixels?.pinterest?.loaded) return\n\n\t\t// console.log('firing Pinterest ads AddToCart event');\n\t\t// console.log(product);\n\n\t\tpintrk(\"track\", \"addtocart\", {\n\t\t\tvalue : parseFloat(product.quantity * product.price),\n\t\t\tcurrency : product.currency,\n\t\t\tline_items: [wpm.getPinterestProductData(product)],\n\t\t})\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n\n// pageview event\njQuery(document).on(\"wpmViewItem\", function (event, product) {\n\n\ttry {\n\t\tif (!wpmDataLayer?.pixels?.pinterest?.loaded) return\n\n\t\t// console.log('firing Pinterest pageview event');\n\t\t// console.log(product);\n\n\t\tpintrk(\"track\", \"pagevisit\", {\n\t\t\tcurrency : product.currency,\n\t\t\tline_items: [wpm.getPinterestProductData(product)],\n\t\t})\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n\n// view product event\njQuery(document).on(\"wpmViewItem\", function (event, product) {\n\n\ttry {\n\t\tif (!wpmDataLayer?.pixels?.pinterest?.loaded) return\n\n\t\tlet productData = wpm.getPinterestProductData(product)\n\n\t\tpintrk(\"track\", \"pagevisit\", {\n\t\t\tcurrency : product.currency,\n\t\t\tline_items: [productData],\n\t\t})\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n\n// view search event\njQuery(document).on(\"wpmSearch\", function () {\n\n\ttry {\n\t\tif (!wpmDataLayer?.pixels?.pinterest?.loaded) return\n\n\t\tlet urlParams = new URLSearchParams(window.location.search)\n\n\t\tpintrk(\"track\", \"search\", {\n\t\t\tsearch_query: urlParams.get(\"s\"),\n\t\t})\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n\n// view category event\njQuery(document).on(\"wpmCategory\", function () {\n\n\ttry {\n\t\tif (!wpmDataLayer?.pixels?.pinterest?.loaded) return\n\n\t\tpintrk(\"track\", \"viewcategory\")\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n\n\n// view order received page event\n// https://developers.pinterest.com/docs/tag/conversion/\njQuery(document).on(\"wpmOrderReceivedPage\", function () {\n\n\ttry {\n\t\tif (!wpmDataLayer?.pixels?.pinterest?.loaded) return\n\n\t\tpintrk(\"track\", \"checkout\", {\n\t\t\tvalue : wpmDataLayer.order.value_filtered,\n\t\t\torder_quantity: wpmDataLayer.order.quantity,\n\t\t\tcurrency : wpmDataLayer.order.currency,\n\t\t\torder_id : wpmDataLayer.order.id,\n\t\t\tline_items : wpm.pinterestFormattedOrderItems(),\n\t\t})\n\n\t\t// console.log(wpm.pinterestFormattedOrderItems())\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n","// TODO check all events and add more if there are any\n\n/**\n * Add functions for Snapchat Ads\n * */\n\n(function (wpm, $, undefined) {\n\n\twpm.snapchatGetEmail = function () {\n\t\tlet userInfo = {}\n\n\t\tif (wpmDataLayer?.user?.email_sha256) {\n\t\t\tuserInfo.user_hashed_email = wpmDataLayer.user?.email_sha256\n\t\t}\n\t\t// console.log(userInfo)\n\t\treturn userInfo\n\t}\n\n\twpm.loadSnapchatPixel = function () {\n\n\t\ttry {\n\t\t\tif (wpmDataLayer?.pixels?.snapchat?.pixel_id) {\n\n\t\t\t\twpmDataLayer.pixels.snapchat.loaded = true;\n\n\t\t\t\t// @formatter:off\n \t\t\t(function(e,t,n){if(e.snaptr)return;var a=e.snaptr=function()\n \t\t\t{a.handleRequest?a.handleRequest.apply(a,arguments):a.queue.push(arguments)};\n \t\t\t\ta.queue=[];var s='script';r=t.createElement(s);r.async=!0;\n \t\t\t\tr.src=n;var u=t.getElementsByTagName(s)[0];\n \t\t\t\tu.parentNode.insertBefore(r,u);})(window,document,\n \t\t\t\t'https://sc-static.net/scevent.min.js');\n \t\t\t// @formatter:on\n\n\t\t\t\tsnaptr(\"init\", wpmDataLayer.pixels.snapchat.pixel_id, wpm.snapchatGetEmail())\n\t\t\t\tsnaptr(\"track\", \"PAGE_VIEW\")\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t}\n\t}\n\n\twpm.getSnapchatOrderItemIds = function () {\n\t\tlet contentIds = []\n\n\t\tfor (const [key, item] of Object.entries(wpmDataLayer.order.items)) {\n\n\t\t\tif (wpmDataLayer?.general?.variationsOutput && 0 !== item.variation_id) {\n\t\t\t\tcontentIds.push(String(wpmDataLayer.products[item.variation_id].dyn_r_ids[wpmDataLayer.pixels.snapchat.dynamic_remarketing.id_type]))\n\t\t\t} else {\n\t\t\t\tcontentIds.push(String(wpmDataLayer.products[item.id].dyn_r_ids[wpmDataLayer.pixels.snapchat.dynamic_remarketing.id_type]))\n\t\t\t}\n\t\t}\n\n\t\treturn contentIds\n\t}\n\n}(window.wpm = window.wpm || {}, jQuery));\n\n/**\n * Execute as soon as possible\n * */\n\n(function () {\n\n\tjQuery(document).on(\"wpmLoadPixels\", function () {\n\n\t\tif (wpm.canIFire(\"ads\", \"snapchat-ads\") && !wpmDataLayer?.pixels?.snapchat?.loaded) wpm.loadSnapchatPixel()\n\n\t})\n\n})()\n\n\n/**\n * All event listeners\n * */\n\n// AddToCart event\njQuery(document).on(\"wpmAddToCart\", function (event, product) {\n\n\ttry {\n\t\tif (!wpmDataLayer?.pixels?.snapchat?.loaded) return\n\n\t\tsnaptr(\"track\", \"ADD_CART\", {\n\t\t\titem_ids: [product.dyn_r_ids[wpmDataLayer.pixels.snapchat.dynamic_remarketing.id_type]],\n\t\t})\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n\n// VIEW_CONTENT event\njQuery(document).on(\"wpmViewItem\", function (event, product) {\n\n\ttry {\n\t\tif (!wpmDataLayer?.pixels?.snapchat?.loaded) return\n\n\t\tsnaptr(\"track\", \"VIEW_CONTENT\", {\n\t\t\titem_ids: [product.dyn_r_ids[wpmDataLayer.pixels.snapchat.dynamic_remarketing.id_type]],\n\t\t})\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n\n\n// view order received page event\njQuery(document).on(\"wpmOrderReceivedPage\", function () {\n\n\ttry {\n\t\tif (!wpmDataLayer?.pixels?.snapchat?.loaded) return\n\n\t\tsnaptr(\"track\", \"PURCHASE\", {\n\t\t\tcurrency : wpmDataLayer.order.currency,\n\t\t\tprice : wpmDataLayer.order.value_filtered,\n\t\t\ttransaction_id: wpmDataLayer.order.id,\n\t\t\titem_ids : wpm.getSnapchatOrderItemIds(),\n\t\t})\n\n\t\t// console.log(wpm.getSnapchatOrderItemIds())\n\t\t// console.log({price: wpmDataLayer.order.value_filtered})\n\t\t// console.log({transaction_id: wpmDataLayer.order.id})\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n","// https://ads.tiktok.com/help/article?aid=10028\n\n// TODO check all events and add more if there are any\n\n\n/**\n * Add functions for TikTok Ads\n * */\n\n(function (wpm, $, undefined) {\n\n\twpm.loadTikTokPixel = function () {\n\n\t\ttry {\n\t\t\tif (wpmDataLayer?.pixels?.tiktok?.pixel_id) {\n\n\t\t\t\twpmDataLayer.pixels.tiktok.loaded = true;\n\n\t\t\t\t// @formatter:off\n \t\t\t!function (w, d, t) {\n \t\t\t\tw.TiktokAnalyticsObject=t;var ttq=w[t]=w[t]||[];ttq.methods=[\"page\",\"track\",\"identify\",\"instances\",\"debug\",\"on\",\"off\",\"once\",\"ready\",\"alias\",\"group\",\"enableCookie\",\"disableCookie\"],ttq.setAndDefer=function(t,e){t[e]=function(){t.push([e].concat(Array.prototype.slice.call(arguments,0)))}};for(var i=0;i<ttq.methods.length;i++)ttq.setAndDefer(ttq,ttq.methods[i]);ttq.instance=function(t){for(var e=ttq._i[t]||[],n=0;n<ttq.methods.length;n++)ttq.setAndDefer(e,ttq.methods[n]);return e},ttq.load=function(e,n){var i=\"https://analytics.tiktok.com/i18n/pixel/events.js\";ttq._i=ttq._i||{},ttq._i[e]=[],ttq._i[e]._u=i,ttq._t=ttq._t||{},ttq._t[e]=+new Date,ttq._o=ttq._o||{},ttq._o[e]=n||{};var o=document.createElement(\"script\");o.type=\"text/javascript\",o.async=!0,o.src=i+\"?sdkid=\"+e+\"&lib=\"+t;var a=document.getElementsByTagName(\"script\")[0];a.parentNode.insertBefore(o,a)};\n \t\t\t\tttq.load(wpmDataLayer.pixels.tiktok.pixel_id);\n \t\t\t\tttq.page();\n \t\t\t}(window, document, 'ttq');\n \t\t\t// @formatter:on\n\n\t\t\t\tttq.track(\"Browse\")\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t}\n\t}\n\n\twpm.getTikTokOrderItemIds = function () {\n\n\t\tlet orderItems = []\n\n\t\tfor (const [key, item] of Object.entries(wpmDataLayer.order.items)) {\n\n\t\t\tlet orderItem\n\n\t\t\torderItem = {\n\t\t\t\tcontent_type: \"product\",\n\t\t\t\tquantity : item.quantity,\n\t\t\t\tprice : item.price,\n\t\t\t}\n\n\t\t\tif (wpmDataLayer?.general?.variationsOutput && 0 !== item.variation_id) {\n\n\t\t\t\torderItem.content_id = String(wpmDataLayer.products[item.variation_id].dyn_r_ids[wpmDataLayer.pixels.bing.dynamic_remarketing.id_type])\n\t\t\t\torderItem.content_name = wpmDataLayer.products[item.variation_id].name\n\t\t\t\torderItems.push(orderItem)\n\t\t\t} else {\n\n\t\t\t\torderItem.content_id = String(wpmDataLayer.products[item.id].dyn_r_ids[wpmDataLayer.pixels.bing.dynamic_remarketing.id_type])\n\t\t\t\torderItem.content_name = wpmDataLayer.products[item.id].name\n\t\t\t\torderItems.push(orderItem)\n\t\t\t}\n\t\t}\n\n\t\treturn orderItems\n\t}\n\n}(window.wpm = window.wpm || {}, jQuery));\n\n/**\n * Execute as soon as possible\n * */\n\n(function () {\n\n\tjQuery(document).on(\"wpmLoadPixels\", function () {\n\n\t\tif (wpm.canIFire(\"ads\", \"tiktok-ads\") && !wpmDataLayer?.pixels?.tiktok?.loaded) wpm.loadTikTokPixel()\n\n\t})\n\n})()\n\n/**\n * All event listeners\n * */\n\n// AddToCart event\njQuery(document).on(\"wpmAddToCart\", function (event, product) {\n\n\ttry {\n\t\tif (!wpmDataLayer?.pixels?.tiktok?.loaded) return\n\n\t\tttq.track(\"AddToCart\", {\n\t\t\tcontent_id : product.dyn_r_ids[wpmDataLayer.pixels.tiktok.dynamic_remarketing.id_type],\n\t\t\tcontent_type: \"product\",\n\t\t\tcontent_name: product.name,\n\t\t\tquantity : product.quantity,\n\t\t\tvalue : product.price,\n\t\t\tcurrency : product.currency,\n\t\t})\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n\n// InitiateCheckout event\njQuery(document).on(\"wpmBeginCheckout\", function (event) {\n\n\ttry {\n\t\tif (!wpmDataLayer?.pixels?.tiktok?.loaded) return\n\n\t\tttq.track(\"InitiateCheckout\")\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n\n// ViewContent event\njQuery(document).on(\"wpmViewItem\", function (event, product) {\n\n\ttry {\n\t\tif (!wpmDataLayer?.pixels?.tiktok?.loaded) return\n\n\t\tttq.track(\"ViewContent\", {\n\t\t\tcontent_id : product.dyn_r_ids[wpmDataLayer.pixels.tiktok.dynamic_remarketing.id_type],\n\t\t\tcontent_type: \"product\",\n\t\t\tcontent_name: product.name,\n\t\t\tquantity : product.quantity,\n\t\t\tvalue : product.price,\n\t\t\tcurrency : product.currency,\n\t\t})\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n\n// AddToWishlist event\njQuery(document).on(\"wpmAddToWishlist\", function (event, product) {\n\n\ttry {\n\t\tif (!wpmDataLayer?.pixels?.tiktok?.loaded) return\n\n\t\tttq.track(\"AddToWishlist\", {\n\t\t\tcontent_id : product.dyn_r_ids[wpmDataLayer.pixels.tiktok.dynamic_remarketing.id_type],\n\t\t\tcontent_type: \"product\",\n\t\t\tcontent_name: product.name,\n\t\t\tquantity : product.quantity,\n\t\t\tvalue : product.price,\n\t\t\tcurrency : product.currency,\n\t\t})\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n\n// search event\njQuery(document).on(\"wpmSearch\", function () {\n\n\ttry {\n\t\tif (!wpmDataLayer?.pixels?.tiktok?.loaded) return\n\n\t\tttq.track(\"Search\")\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n\n})\n\n\n// view order received page event\njQuery(document).on(\"wpmOrderReceivedPage\", function () {\n\n\ttry {\n\t\tif (!wpmDataLayer?.pixels?.tiktok?.loaded) return\n\n\t\tttq.track(wpmDataLayer.pixels.tiktok.purchase_event_name, {\n\t\t\tvalue : wpmDataLayer.order.value_filtered,\n\t\t\tcurrency: wpmDataLayer.order.currency,\n\t\t\tcontents: wpm.getTikTokOrderItemIds(),\n\t\t})\n\n\t\t// console.log(wpm.getTikTokOrderItemIds())\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n","// TODO implement AddPaymentInfo event\n// TODO check if more values can be passed to product and cart pages\n\n// https://business.twitter.com/en/help/campaign-measurement-and-analytics/conversion-tracking-for-websites.html\n\n/**\n * Add functions for Twitter Ads\n * */\n\n(function (wpm, $, undefined) {\n\n\twpm.loadTwitterPixel = function () {\n\n\t\ttry {\n\t\t\tif (wpmDataLayer?.pixels?.twitter?.pixel_id) {\n\n\t\t\t\twpmDataLayer.pixels.twitter.loaded = true;\n\n\t\t\t\t// @formatter:off\n \t\t\t!function(e,t,n,s,u,a){e.twq||(s=e.twq=function(){s.exe?s.exe.apply(s,arguments):s.queue.push(arguments);\n \t\t\t},s.version='1.1',s.queue=[],u=t.createElement(n),u.async=!0,u.src='//static.ads-twitter.com/uwt.js',\n \t\t\t\ta=t.getElementsByTagName(n)[0],a.parentNode.insertBefore(u,a))}(window,document,'script');\n\n \t\t\ttwq('init', wpmDataLayer.pixels.twitter.pixel_id);\n \t\t\t// @formatter:on\n\n\t\t\t\ttwq(\"track\", \"PageView\")\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t}\n\t}\n\n\twpm.twitterGetOrderContentIds = function () {\n\t\tlet contentIds = []\n\n\t\tfor (const [key, item] of Object.entries(wpmDataLayer.order.items)) {\n\n\t\t\tif (wpmDataLayer?.general?.variationsOutput && 0 !== item.variation_id) {\n\t\t\t\tcontentIds.push(String(wpmDataLayer.products[item.variation_id].dyn_r_ids[wpmDataLayer.pixels.twitter.dynamic_remarketing.id_type]))\n\t\t\t} else {\n\t\t\t\tcontentIds.push(String(wpmDataLayer.products[item.id].dyn_r_ids[wpmDataLayer.pixels.twitter.dynamic_remarketing.id_type]))\n\t\t\t}\n\t\t}\n\n\t\treturn contentIds\n\t}\n\n}(window.wpm = window.wpm || {}, jQuery));\n\n\n/**\n * Execute as soon as possible\n * */\n\n(function () {\n\n\tjQuery(document).on(\"wpmLoadPixels\", function () {\n\n\t\tif (wpm.canIFire(\"ads\", \"twitter-ads\") && !wpmDataLayer?.pixels?.twitter?.loaded) wpm.loadTwitterPixel()\n\n\t})\n\n})()\n\n\n/**\n * All event listeners\n * */\n\n// add-to-cart event\njQuery(document).on(\"wpmAddToCart\", function (event, product) {\n\n\ttry {\n\t\tif (!wpmDataLayer?.pixels?.twitter?.loaded) return\n\n\t\ttwq(\"track\", \"AddToCart\")\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n\n// view product event\njQuery(document).on(\"wpmViewItem\", function (event, product) {\n\n\ttry {\n\t\tif (!wpmDataLayer?.pixels?.twitter?.loaded) return\n\n\t\ttwq(\"track\", \"ViewContent\")\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n\n// // view category event\n// jQuery(document).on('wpmCategory', function () {\n//\n// \tif (!wpmDataLayer?.pixels?.twitter?.loaded) return;\n//\n// \t// twq('track', 'AddToWishlist');\n// });\n\n// add-to-wishlist event\njQuery(document).on(\"wpmAddToWishlist\", function (event, product) {\n\n\ttry {\n\t\tif (!wpmDataLayer?.pixels?.twitter?.loaded) return\n\n\t\ttwq(\"track\", \"AddToWishlist\")\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n\n// start checkout event\njQuery(document).on(\"wpmBeginCheckout\", function (event, product) {\n\n\ttry {\n\t\tif (!wpmDataLayer?.pixels?.twitter?.loaded) return\n\n\t\ttwq(\"track\", \"InitiateCheckout\")\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n\n// view search event\njQuery(document).on(\"wpmSearch\", function () {\n\n\ttry {\n\t\tif (!wpmDataLayer?.pixels?.twitter?.loaded) return\n\n\t\ttwq(\"track\", \"Search\")\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n\n\n// view order received page event\n// TODO find out under which circumstances to use different values in content_type\njQuery(document).on(\"wpmOrderReceivedPage\", function () {\n\n\ttry {\n\t\tif (!wpmDataLayer?.pixels?.twitter?.loaded) return\n\n\t\ttwq(\"track\", \"Purchase\", {\n\t\t\torder_id: wpmDataLayer.order.id,\n\t\t\t// content_type: 'product',\n\t\t\tvalue : wpmDataLayer.order.value_filtered,\n\t\t\tcurrency : wpmDataLayer.order.currency,\n\t\t\tnum_items : wpmDataLayer.order.quantity,\n\t\t\tcontent_ids: wpm.twitterGetOrderContentIds(),\n\t\t})\n\n\t\t// console.log(wpm.twitterGetOrderContentIds())\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n\n","/**\n * After wpm is loaded\n * we first check if wpmDataLayer is loaded,\n * and as soon as it is, we load the pixels,\n * and as soon as the page load is complete,\n * we fire the wpmLoad event.\n */\nwpm.wpmDataLayerExists()\n\t.then(function () {\n\t\tjQuery(document).trigger(\"wpmPreLoadPixels\", {})\n\t})\n\t.then(function () {\n\t\twpm.pageLoaded().then(function () {\n\t\t\tjQuery(document).trigger(\"wpmLoad\", {})\n\t\t})\n\t})\n\n","/**\n * Create a wpm namespace under which all functions are declared\n */\n\n// https://stackoverflow.com/a/5947280/4688612\n(function (wpm, $, undefined) {\n\n\tconst wpmDeduper = {\n\t\tkeyName : \"_wpm_order_ids\",\n\t\tcookieExpiresDays: 365,\n\t}\n\n\tconst wpmRestSettings = {\n\t\t// cookiesAvailable : '_wpm_cookies_are_available',\n\t\tcookieWpmRestEndpointAvailable: \"_wpm_endpoint_available\",\n\t\trestEndpoint : \"/wp-json/\",\n\t\trestFails : 0,\n\t\trestFailsThreshold : 10,\n\t}\n\n\twpm.emailSelected = false\n\twpm.paymentMethodSelected = false\n\n\t// wpm.checkIfCookiesAvailable = function () {\n\t//\n\t// // read the cookie if previously set, if it is return true, otherwise continue\n\t// if (wpm.getCookie(wpmRestSettings.cookiesAvailable)) {\n\t// return true;\n\t// }\n\t//\n\t// // set the cookie for the session\n\t// Cookies.set(wpmRestSettings.cookiesAvailable, true);\n\t//\n\t// // read cookie, true if ok, false if not ok\n\t// return !!wpm.getCookie(wpmRestSettings.cookiesAvailable);\n\t// }\n\n\twpm.useRestEndpoint = function () {\n\n\t\t// only if sessionStorage is available\n\n\t\t// only if REST API endpoint is generally accessible\n\t\t// check in sessionStorage if we checked before and return answer\n\t\t// otherwise check if the endpoint is available, save answer in sessionStorage and return answer\n\n\t\t// only if not too many REST API errors happened\n\n\t\treturn wpm.isSessionStorageAvailable() &&\n\t\t\twpm.isRestEndpointAvailable() &&\n\t\t\twpm.isBelowRestErrorThreshold()\n\t}\n\n\twpm.isBelowRestErrorThreshold = function () {\n\t\treturn window.sessionStorage.getItem(wpmRestSettings.restFails) <= wpmRestSettings.restFailsThreshold\n\t}\n\n\twpm.isRestEndpointAvailable = function () {\n\n\t\tif (window.sessionStorage.getItem(wpmRestSettings.cookieWpmRestEndpointAvailable)) {\n\t\t\treturn JSON.parse(window.sessionStorage.getItem(wpmRestSettings.cookieWpmRestEndpointAvailable))\n\t\t} else {\n\t\t\t// return wpm.testEndpoint();\n\t\t\t// just set the value whenever possible in order not to wait or block the main thread\n\t\t\twpm.testEndpoint()\n\t\t}\n\t}\n\n\twpm.isSessionStorageAvailable = function () {\n\n\t\treturn !!window.sessionStorage\n\t}\n\n\twpm.testEndpoint = function (\n\t\turl = location.protocol + \"//\" + location.host + wpmRestSettings.restEndpoint,\n\t\tcookieName = wpmRestSettings.cookieWpmRestEndpointAvailable,\n\t) {\n\t\t// console.log('testing endpoint');\n\n\t\tjQuery.ajax(url, {\n\t\t\ttype : \"HEAD\",\n\t\t\ttimeout: 1000,\n\t\t\t// async: false,\n\t\t\tstatusCode: {\n\t\t\t\t200: function (response) {\n\t\t\t\t\t// Cookies.set(cookieName, true);\n\t\t\t\t\t// console.log('endpoint works');\n\t\t\t\t\twindow.sessionStorage.setItem(cookieName, JSON.stringify(true))\n\t\t\t\t},\n\t\t\t\t404: function (response) {\n\t\t\t\t\t// Cookies.set(cookieName, false);\n\t\t\t\t\t// console.log('endpoint doesn\\'t work');\n\t\t\t\t\twindow.sessionStorage.setItem(cookieName, JSON.stringify(false))\n\t\t\t\t},\n\t\t\t\t0 : function (response) {\n\t\t\t\t\t// Cookies.set(cookieName, false);\n\t\t\t\t\t// console.log('endpoint doesn\\'t work');\n\t\t\t\t\twindow.sessionStorage.setItem(cookieName, JSON.stringify(false))\n\t\t\t\t},\n\t\t\t},\n\t\t}).then(r => {\n\t\t\t// console.log('test done')\n\t\t\t// console.log('result: ' + JSON.parse(window.sessionStorage.getItem(cookieName)));\n\t\t\t// return JSON.parse(window.sessionStorage.getItem(cookieName));\n\t\t})\n\t}\n\n\twpm.isWpmRestEndpointAvailable = function (cookieName = wpmRestSettings.cookieWpmRestEndpointAvailable) {\n\n\t\treturn !!wpm.getCookie(cookieName)\n\t}\n\n\twpm.writeOrderIdToStorage = function (orderId, expireDays = 365) {\n\n\t\t// save the order ID in the browser storage\n\n\t\tif (!window.Storage) {\n\t\t\tlet expiresDate = new Date()\n\t\t\texpiresDate.setDate(expiresDate.getDate() + wpmDeduper.cookieExpiresDays)\n\n\t\t\tlet ids = []\n\t\t\tif (checkCookie()) {\n\t\t\t\tids = JSON.parse(wpm.getCookie(wpmDeduper.keyName))\n\t\t\t}\n\n\t\t\tif (!ids.includes(orderId)) {\n\t\t\t\tids.push(orderId)\n\t\t\t\tdocument.cookie = wpmDeduper.keyName + \"=\" + JSON.stringify(ids) + \";expires=\" + expiresDate.toUTCString()\n\t\t\t}\n\n\t\t} else {\n\t\t\tif (localStorage.getItem(wpmDeduper.keyName) === null) {\n\t\t\t\tlet ids = []\n\t\t\t\tids.push(orderId)\n\t\t\t\twindow.localStorage.setItem(wpmDeduper.keyName, JSON.stringify(ids))\n\n\t\t\t} else {\n\t\t\t\tlet ids = JSON.parse(localStorage.getItem(wpmDeduper.keyName))\n\t\t\t\tif (!ids.includes(orderId)) {\n\t\t\t\t\tids.push(orderId)\n\t\t\t\t\twindow.localStorage.setItem(wpmDeduper.keyName, JSON.stringify(ids))\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (typeof wpm.storeOrderIdOnServer === \"function\" && wpmDataLayer.orderDeduplication) {\n\t\t\twpm.storeOrderIdOnServer(orderId)\n\t\t}\n\t}\n\n\tfunction checkCookie() {\n\t\tlet key = wpm.getCookie(wpmDeduper.keyName)\n\t\treturn key !== \"\"\n\t}\n\n\twpm.isOrderIdStored = function (orderId) {\n\n\t\t// console.log('deduper: ' + wpmDataLayer.orderDeduplication);\n\t\tif (wpmDataLayer.orderDeduplication) {\n\t\t\t// console.log('order deduplication: on');\n\t\t\tif (!window.Storage) {\n\n\t\t\t\tif (checkCookie()) {\n\t\t\t\t\tlet ids = JSON.parse(wpm.getCookie(wpmDeduper.keyName))\n\t\t\t\t\treturn ids.includes(orderId)\n\t\t\t\t} else {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (localStorage.getItem(wpmDeduper.keyName) !== null) {\n\t\t\t\t\tlet ids = JSON.parse(localStorage.getItem(wpmDeduper.keyName))\n\t\t\t\t\treturn ids.includes(orderId)\n\t\t\t\t} else {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tconsole.log(\"order duplication prevention: off\")\n\t\t\treturn false\n\t\t}\n\t}\n\n\twpm.isEmail = function (email) {\n\t\t// https://emailregex.com/\n\t\tlet regex = /^(([^<>()\\[\\]\\\\.,;:\\s@\"]+(\\.[^<>()\\[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/\n\t\treturn regex.test(email)\n\t}\n\n\twpm.removeProductFromCart = function (productId, quantityToRemove = null) {\n\t\t// console.log('product_id: ' + productId + ' | quantityToRemove: ' + quantityToRemove);\n\n\t\ttry {\n\n\t\t\tif (!productId) throw Error(\"Wasn't able to retrieve a productId\")\n\n\t\t\tproductId = getIdBasedOndVariationsOutputSetting(productId)\n\n\t\t\tif (!productId) throw Error(\"Wasn't able to retrieve a productId\")\n\n\t\t\tlet quantity\n\n\t\t\tif (quantityToRemove == null) {\n\t\t\t\tquantity = wpmDataLayer.cart[productId].quantity\n\t\t\t} else {\n\t\t\t\tquantity = quantityToRemove\n\t\t\t}\n\n\t\t\t// console.log('product_id: ' + productId + ' | qty: ' + quantity);\n\t\t\t// console.log(productId);\n\t\t\t// console.log(wpmDataLayer.cart);\n\t\t\t// console.log(wpmDataLayer.cart[productId]);\n\n\t\t\tif (wpmDataLayer.cart[productId]) {\n\n\t\t\t\t// let product = {\n\t\t\t\t// id : productId.toString(),\n\t\t\t\t// dyn_r_ids: wpmDataLayer.cart[productId].dyn_r_ids,\n\t\t\t\t// name : wpmDataLayer.cart[productId].name,\n\t\t\t\t// // list_name: wpmDataLayer.shop.list_name, // doesn't make sense on mini_cart\n\t\t\t\t// brand : wpmDataLayer.cart[productId].brand,\n\t\t\t\t// category: wpmDataLayer.cart[productId].category,\n\t\t\t\t// variant : wpmDataLayer.cart[productId].variant,\n\t\t\t\t// // list_position: wpmDataLayer.cart[productId].position, // doesn't make sense on mini_cart\n\t\t\t\t// quantity : quantity,\n\t\t\t\t// price : wpmDataLayer.cart[productId].price,\n\t\t\t\t// isVariation: wpmDataLayer.products[productId].isVariation,\n\t\t\t\t// };\n\t\t\t\t//\n\t\t\t\t// if (product.isVariation) product['parentId_dyn_r_ids'] = wpmDataLayer.products[productId].parentId_dyn_r_ids;\n\n\t\t\t\tlet product = wpm.getProductDetailsFormattedForEvent(productId, quantity)\n\n\t\t\t\t// console.log('removing');\n\t\t\t\t// console.log(data);\n\n\t\t\t\tjQuery(document).trigger(\"wpmRemoveFromCart\", product)\n\n\t\t\t\tif (quantityToRemove == null || wpmDataLayer.cart[productId].quantity === quantityToRemove) {\n\t\t\t\t\tdelete wpmDataLayer.cart[productId]\n\t\t\t\t\tif (sessionStorage) sessionStorage.setItem(\"wpmDataLayerCart\", JSON.stringify(wpmDataLayer.cart))\n\t\t\t\t} else {\n\t\t\t\t\twpmDataLayer.cart[productId].quantity = wpmDataLayer.cart[productId].quantity - quantity\n\t\t\t\t\tif (sessionStorage) sessionStorage.setItem(\"wpmDataLayerCart\", JSON.stringify(wpmDataLayer.cart))\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t\t// console.log('getting cart from back end');\n\t\t\t// wpm.getCartItemsFromBackend();\n\t\t\t// console.log('getting cart from back end done');\n\n\t\t}\n\t}\n\n\tgetIdBasedOndVariationsOutputSetting = function (productId) {\n\n\t\ttry {\n\t\t\tif (wpmDataLayer?.general?.variationsOutput) {\n\t\t\t\t// console.log('test');\n\t\t\t\treturn productId\n\t\t\t} else {\n\t\t\t\tif (wpmDataLayer.products[productId].isVariation) {\n\t\t\t\t\treturn wpmDataLayer.products[productId].parentId\n\t\t\t\t} else {\n\t\t\t\t\treturn productId\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t}\n\t}\n\n\t// add_to_cart\n\twpm.addProductToCart = function (productId, quantity) {\n\n\t\ttry {\n\t\t\t// console.log('productId: ' + productId + ' | qty: ' + quantity);\n\t\t\t// console.log('productId: ' + productId + ' | variationId: ' + variationId + ' | qty: ' + quantity);\n\n\t\t\tif (!productId) throw Error(\"Wasn't able to retrieve a productId\")\n\n\t\t\tproductId = getIdBasedOndVariationsOutputSetting(productId)\n\n\t\t\tif (!productId) throw Error(\"Wasn't able to retrieve a productId\")\n\n\t\t\tif (wpmDataLayer?.products[productId]) {\n\n\t\t\t\tlet product = wpm.getProductDetailsFormattedForEvent(productId, quantity)\n\n\t\t\t\t// console.log(productId)\n\t\t\t\t// console.log(wpmDataLayer.cart)\n\n\t\t\t\tjQuery(document).trigger(\"wpmAddToCart\", product)\n\n\t\t\t\t// add product to cart wpmDataLayer['cart']\n\n\t\t\t\t// if the product already exists in the object, only add the additional quantity\n\t\t\t\t// otherwise create that product object in the wpmDataLayer['cart']\n\t\t\t\tif (wpmDataLayer?.cart[productId]) {\n\t\t\t\t\twpmDataLayer.cart[productId].quantity = wpmDataLayer.cart[productId].quantity + quantity\n\t\t\t\t} else {\n\n\t\t\t\t\tif (!(\"cart\" in wpmDataLayer)) wpmDataLayer.cart = {}\n\t\t\t\t\twpmDataLayer.cart[productId] = wpm.getProductDetailsFormattedForEvent(productId, quantity)\n\t\t\t\t}\n\n\t\t\t\tif (sessionStorage) sessionStorage.setItem(\"wpmDataLayerCart\", JSON.stringify(wpmDataLayer.cart))\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\n\t\t\t// fallback if wpmDataLayer.cart and wpmDataLayer.products got out of sync in case cart caching has an issue\n\t\t\twpm.getCartItemsFromBackend()\n\t\t}\n\t}\n\n\twpm.getCartItems = function () {\n\n\t\t// console.log('get cart items');\n\n\t\tif (sessionStorage) {\n\t\t\tif (!sessionStorage.getItem(\"wpmDataLayerCart\") || wpmDataLayer.shop.page_type === \"order_received_page\") {\n\t\t\t\tsessionStorage.setItem(\"wpmDataLayerCart\", JSON.stringify({}))\n\t\t\t} else {\n\t\t\t\twpm.saveCartObjectToDataLayer(JSON.parse(sessionStorage.getItem(\"wpmDataLayerCart\")))\n\t\t\t}\n\t\t} else {\n\t\t\twpm.getCartItemsFromBackend()\n\t\t}\n\t}\n\n\t// get all cart items from the backend\n\twpm.getCartItemsFromBackend = function () {\n\t\ttry {\n\t\t\tlet data = {\n\t\t\t\taction: \"wpm_get_cart_items\",\n\t\t\t}\n\n\t\t\tjQuery.ajax(\n\t\t\t\t{\n\t\t\t\t\ttype : \"get\",\n\t\t\t\t\tdataType: \"json\",\n\t\t\t\t\t// url : ajax_object.ajax_url,\n\t\t\t\t\turl : wpm.ajax_url,\n\t\t\t\t\tdata : data,\n\t\t\t\t\tsuccess: function (cartItems) {\n\n\t\t\t\t\t\t// save all cart items into wpmDataLayer\n\n\t\t\t\t\t\tif (!cartItems[\"cart\"]) cartItems[\"cart\"] = {}\n\n\t\t\t\t\t\twpm.saveCartObjectToDataLayer(cartItems[\"cart\"])\n\t\t\t\t\t\tif (sessionStorage) sessionStorage.setItem(\"wpmDataLayerCart\", JSON.stringify(cartItems[\"cart\"]))\n\t\t\t\t\t},\n\t\t\t\t})\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t}\n\t}\n\n\twpm.getProductsFromBackend = function (productIds) {\n\t\t// console.log('getting pids from back-end: ' + productIds)\n\t\t// get productIds from the backend\n\n\t\t// reduce productIds by products already in the dataLayer\n\t\tproductIds = productIds.filter(item => !wpmDataLayer.products.hasOwnProperty(item))\n\n\t\t// if no products IDs are in the object, don't try to get anything from the server\n\t\tif (!productIds || productIds.length === 0) return\n\n\t\ttry {\n\t\t\tlet data = {\n\t\t\t\taction : \"wpm_get_product_ids\",\n\t\t\t\tproductIds: productIds,\n\t\t\t}\n\n\t\t\tjQuery.ajax(\n\t\t\t\t{\n\t\t\t\t\ttype : \"get\",\n\t\t\t\t\tdataType: \"json\",\n\t\t\t\t\t// url : ajax_object.ajax_url,\n\t\t\t\t\turl : wpm.ajax_url,\n\t\t\t\t\tdata : data,\n\t\t\t\t\tsuccess: function (products) {\n\n\t\t\t\t\t\t// merge products into wpmDataLayer.products\n\t\t\t\t\t\twpmDataLayer.products = Object.assign({}, wpmDataLayer.products, products)\n\t\t\t\t\t},\n\t\t\t\t\terror : function (response) {\n\t\t\t\t\t\tconsole.log(response)\n\t\t\t\t\t},\n\t\t\t\t})\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t}\n\t}\n\n\twpm.saveCartObjectToDataLayer = function (cartObject) {\n\t\twpmDataLayer.cart = cartObject\n\t\twpmDataLayer.products = Object.assign({}, wpmDataLayer.products, cartObject)\n\t}\n\n\twpm.fireCheckoutOption = function (step, checkout_option = null, value = null) {\n\n\t\tlet data = {\n\t\t\tstep : step,\n\t\t\tcheckout_option: checkout_option,\n\t\t\tvalue : value,\n\t\t}\n\n\t\tjQuery(document).trigger(\"wpmFireCheckoutOption\", data)\n\t}\n\n\twpm.fireCheckoutProgress = function (step) {\n\n\t\tlet data = {\n\t\t\tstep: step,\n\t\t}\n\n\t\tjQuery(document).trigger(\"wpmFireCheckoutProgress\", data)\n\t}\n\n\twpm.getPostIdFromString = function (string) {\n\t\t// console.log(string);\n\t\ttry {\n\t\t\treturn string.match(/(post-)(\\d+)/)[2]\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t}\n\t}\n\n\twpm.triggerViewItemList = function (productId) {\n\n\t\t// productId = null;\n\n\t\tif (!productId) throw Error(\"Wasn't able to retrieve a productId\")\n\n\t\tproductId = getIdBasedOndVariationsOutputSetting(productId)\n\n\t\tif (!productId) throw Error(\"Wasn't able to retrieve a productId\")\n\n\t\tjQuery(document).trigger(\"wpmViewItemList\", wpm.getProductDataForViewItemEvent(productId))\n\t}\n\n\twpm.getProductDataForViewItemEvent = function (productId) {\n\n\t\tif (!productId) throw Error(\"Wasn't able to retrieve a productId\")\n\n\t\ttry {\n\t\t\tif (wpmDataLayer.products[productId]) {\n\n\t\t\t\treturn wpm.getProductDetailsFormattedForEvent(productId)\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t}\n\t}\n\twpm.getMainProductIdFromProductPage = function () {\n\t\ttry {\n\t\t\tif ([\"simple\", \"variable\", \"grouped\", \"composite\", \"bundle\"].indexOf(wpmDataLayer.shop.product_type) >= 0) {\n\t\t\t\treturn jQuery(\".wpmProductId:first\").data(\"id\")\n\t\t\t} else {\n\t\t\t\treturn false\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t}\n\t}\n\n\twpm.viewItemListTriggerTestMode = function (target) {\n\n\t\tjQuery(target).css({\"position\": \"relative\"})\n\t\tjQuery(target).append(\"<div id=\\\"viewItemListTriggerOverlay\\\"></div>\")\n\t\tjQuery(target).find(\"#viewItemListTriggerOverlay\").css({\n\t\t\t\"z-index\" : \"10\",\n\t\t\t\"display\" : \"block\",\n\t\t\t\"position\" : \"absolute\",\n\t\t\t\"height\" : \"100%\",\n\t\t\t\"top\" : \"0\",\n\t\t\t\"left\" : \"0\",\n\t\t\t\"right\" : \"0\",\n\t\t\t\"opacity\" : wpmDataLayer.viewItemListTrigger.opacity,\n\t\t\t\"background-color\": wpmDataLayer.viewItemListTrigger.backgroundColor,\n\t\t})\n\t}\n\n\twpm.getSearchTermFromUrl = function () {\n\t\ttry {\n\t\t\tlet urlParameters = new URLSearchParams(window.location.search)\n\t\t\treturn urlParameters.get(\"s\")\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t}\n\t}\n\n\t// we need this to track timeouts for intersection observers\n\tlet ioTimeouts = {}\n\n\twpm.observerCallback = function (entries, observer) {\n\n\t\tentries.forEach((entry) => {\n\n\t\t\ttry {\n\t\t\t\tlet productId\n\n\t\t\t\tlet elementId = jQuery(entry.target).data(\"ioid\")\n\n\t\t\t\t// Get the productId from next element, if wpmProductId is a sibling, like in Gutenberg blocks\n\t\t\t\t// otherwise go search in children, like in regular WC loop items\n\t\t\t\tif (jQuery(entry.target).next(\".wpmProductId\").length) {\n\t\t\t\t\t// console.log('test 1');\n\t\t\t\t\tproductId = jQuery(entry.target).next(\".wpmProductId\").data(\"id\")\n\t\t\t\t} else {\n\t\t\t\t\tproductId = jQuery(entry.target).find(\".wpmProductId\").data(\"id\")\n\t\t\t\t}\n\n\t\t\t\t// productId = null;\n\n\t\t\t\tif (!productId) throw Error(\"wpmProductId element not found\")\n\n\t\t\t\tif (entry.isIntersecting) {\n\n\t\t\t\t\t// console.log('prodid: ' + productId);\n\t\t\t\t\tioTimeouts[elementId] = setTimeout(() => {\n\t\t\t\t\t\t// console.log('prodid: ' + productId);\n\t\t\t\t\t\twpm.triggerViewItemList(productId)\n\t\t\t\t\t\tif (wpmDataLayer.viewItemListTrigger.testMode) wpm.viewItemListTriggerTestMode(entry.target)\n\t\t\t\t\t\tif (wpmDataLayer.viewItemListTrigger.repeat === false) observer.unobserve(entry.target)\n\t\t\t\t\t}, wpmDataLayer.viewItemListTrigger.timeout)\n\n\t\t\t\t} else {\n\n\t\t\t\t\tclearTimeout(ioTimeouts[elementId])\n\t\t\t\t\tif (wpmDataLayer.viewItemListTrigger.testMode) jQuery(entry.target).find(\"#viewItemListTriggerOverlay\").remove()\n\t\t\t\t}\n\t\t\t} catch (e) {\n\t\t\t\tconsole.error(e)\n\t\t\t}\n\t\t})\n\t}\n\n\t// fire view_item_list only on products that have become visible\n\tlet io\n\tlet ioid = 0\n\tlet allIoElementsToWatch\n\n\tlet getAllElementsToWatch = function () {\n\n\t\tallIoElementsToWatch = jQuery(\".wpmProductId\")\n\t\t\t.map(function (i, elem) {\n\t\t\t\t// console.log(elem);\n\t\t\t\tif (\n\t\t\t\t\tjQuery(elem).parent().hasClass(\"type-product\") ||\n\t\t\t\t\tjQuery(elem).parent().hasClass(\"product\") ||\n\t\t\t\t\tjQuery(elem).parent().hasClass(\"product-item-inner\")\n\t\t\t\t) {\n\t\t\t\t\t// console.log(elem);\n\t\t\t\t\treturn jQuery(elem).parent()\n\t\t\t\t} else if (\n\t\t\t\t\tjQuery(elem).prev().hasClass(\"wc-block-grid__product\") ||\n\t\t\t\t\tjQuery(elem).prev().hasClass(\"product\") ||\n\t\t\t\t\tjQuery(elem).prev().hasClass(\"product-small\") ||\n\t\t\t\t\tjQuery(elem).prev().hasClass(\"woocommerce-LoopProduct-link\")\n\t\t\t\t) {\n\t\t\t\t\treturn jQuery(this).prev()\n\t\t\t\t} else if (jQuery(elem).closest(\".product\").length) {\n\t\t\t\t\treturn jQuery(elem).closest(\".product\")\n\t\t\t\t}\n\t\t\t})\n\t}\n\n\twpm.startIntersectionObserverToWatch = function () {\n\n\t\ttry {\n\t\t\t// enable view_item_list test mode from browser\n\t\t\tif (wpm.urlHasParameter(\"vildemomode\")) wpmDataLayer.viewItemListTrigger.testMode = true\n\n\t\t\t// set up intersection observer\n\t\t\tio = new IntersectionObserver(wpm.observerCallback, {\n\t\t\t\tthreshold: wpmDataLayer.viewItemListTrigger.threshold,\n\t\t\t})\n\n\t\t\tgetAllElementsToWatch()\n\n\t\t\t// console.log(allElementsToWatch);\n\n\t\t\tallIoElementsToWatch.each(function (i, elem) {\n\t\t\t\t// console.log(elem[0]);\n\t\t\t\t// jQuery(elem[0]).attr('data-ioid', ioid++);\n\t\t\t\tjQuery(elem[0]).data(\"ioid\", ioid++)\n\n\t\t\t\tio.observe(elem[0])\n\t\t\t})\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t}\n\t}\n\n\t// watch DOM for new lazy loaded products and add them to the intersection observer\n\twpm.startProductsMutationObserverToWatch = function () {\n\n\t\ttry {\n\t\t\t// Pass in the target node, as well as the observer options\n\n\t\t\t// selects the most common parent node\n\t\t\t// https://stackoverflow.com/a/7648323/4688612\n\t\t\tlet productsNode = jQuery(\".wpmProductId:eq(0)\").parents().has(jQuery(\".wpmProductId:eq(1)\").parents()).first()\n\n\t\t\tif (productsNode.length) {\n\t\t\t\tproductsMutationObserver.observe(productsNode[0], {\n\t\t\t\t\tattributes : true,\n\t\t\t\t\tchildList : true,\n\t\t\t\t\tcharacterData: true,\n\t\t\t\t})\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t}\n\t}\n\n\t// Create an observer instance\n\tlet productsMutationObserver = new MutationObserver(function (mutations) {\n\n\t\tmutations.forEach(function (mutation) {\n\t\t\tlet newNodes = mutation.addedNodes // DOM NodeList\n\t\t\tif (newNodes !== null) { // If there are new nodes added\n\t\t\t\tlet nodes = jQuery(newNodes) // jQuery set\n\t\t\t\tnodes.each(function () {\n\t\t\t\t\tif (\n\t\t\t\t\t\tjQuery(this).hasClass(\"type-product\") ||\n\t\t\t\t\t\tjQuery(this).hasClass(\"product-small\") ||\n\t\t\t\t\t\tjQuery(this).hasClass(\"wc-block-grid__product\")\n\t\t\t\t\t) {\n\t\t\t\t\t\t// check if the node has a child or sibling wpmProductId\n\t\t\t\t\t\t// if yes add it to the intersectionObserver\n\t\t\t\t\t\tif (hasWpmProductIdElement(this)) {\n\t\t\t\t\t\t\tjQuery(this).data(\"ioid\", ioid++)\n\t\t\t\t\t\t\tio.observe(this)\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t}\n\t\t})\n\t})\n\n\tlet hasWpmProductIdElement = function (elem) {\n\t\treturn !!(jQuery(elem).find(\".wpmProductId\").length ||\n\t\t\tjQuery(elem).siblings(\".wpmProductId\").length)\n\t}\n\n\twpm.setCookie = function (cookieName, cookieValue = \"\", expiryDays = null) {\n\t\tif (expiryDays) {\n\t\t\tlet d = new Date()\n\t\t\td.setTime(d.getTime() + (expiryDays * 24 * 60 * 60 * 1000))\n\t\t\tlet expires = \"expires=\" + d.toUTCString()\n\t\t\tdocument.cookie = cookieName + \"=\" + cookieValue + \";\" + expires + \";path=/\"\n\t\t} else {\n\t\t\tdocument.cookie = cookieName + \"=\" + cookieValue + \";path=/\"\n\t\t}\n\t}\n\n\twpm.getCookie = function (cookieName) {\n\t\tlet name = cookieName + \"=\"\n\t\tlet decodedCookie = decodeURIComponent(document.cookie)\n\t\tlet ca = decodedCookie.split(\";\")\n\t\tfor (let i = 0; i < ca.length; i++) {\n\t\t\tlet c = ca[i]\n\t\t\twhile (c.charAt(0) == \" \") {\n\t\t\t\tc = c.substring(1)\n\t\t\t}\n\t\t\tif (c.indexOf(name) == 0) {\n\t\t\t\treturn c.substring(name.length, c.length)\n\t\t\t}\n\t\t}\n\t\treturn \"\"\n\t}\n\n\twpm.getWpmSessionData = function () {\n\t\tif (window.sessionStorage) {\n\n\t\t\tlet data = window.sessionStorage.getItem(\"_wpm\")\n\t\t\tif (data !== null) {\n\t\t\t\treturn JSON.parse(data)\n\t\t\t} else {\n\t\t\t\treturn {}\n\t\t\t}\n\t\t} else {\n\t\t\treturn {}\n\t\t}\n\t}\n\n\twpm.setWpmSessionData = function (data) {\n\t\tif (window.sessionStorage) {\n\t\t\twindow.sessionStorage.setItem(\"_wpm\", JSON.stringify(data))\n\t\t}\n\t}\n\n\twpm.storeOrderIdOnServer = function (orderId) {\n\n\t\t// console.log('saving wpm_purchase_pixels_fired');\n\n\t\t// console.log('url: ' + wpm_premium_only_ajax_object.ajax_url);\n\t\t// console.log('nonce: ' + wpm_premium_only_ajax_object.nonce);\n\t\t// console.log('url: ' + wpm.ajax_url);\n\t\t// console.log('nonce: ' + wpm.nonce);\n\n\t\ttry {\n\t\t\t// save the state in the database\n\t\t\tlet data = {\n\t\t\t\taction : \"wpm_purchase_pixels_fired\",\n\t\t\t\torder_id: orderId,\n\t\t\t\t// nonce : ajax_object.nonce,\n\t\t\t\tnonce: wpm.nonce,\n\t\t\t}\n\n\t\t\tjQuery.ajax(\n\t\t\t\t{\n\t\t\t\t\ttype : \"post\",\n\t\t\t\t\tdataType: \"json\",\n\t\t\t\t\t// url : ajax_object.ajax_url,\n\t\t\t\t\turl : wpm.ajax_url,\n\t\t\t\t\tdata : data,\n\t\t\t\t\tsuccess: function (response) {\n\t\t\t\t\t\tif (response.success === false) {\n\t\t\t\t\t\t\tconsole.log(response)\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\terror : function (response) {\n\t\t\t\t\t\tconsole.log(response)\n\t\t\t\t\t},\n\t\t\t\t})\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t}\n\t}\n\n\twpm.getProductIdByCartItemKeyUrl = function (url) {\n\t\tlet searchParams = new URLSearchParams(url.search)\n\t\tlet cartItemKey = searchParams.get(\"remove_item\")\n\n\t\tlet productId\n\n\t\tif (wpmDataLayer.cartItemKeys[cartItemKey][\"variation_id\"] === 0) {\n\t\t\tproductId = wpmDataLayer.cartItemKeys[cartItemKey][\"product_id\"]\n\t\t} else {\n\t\t\tproductId = wpmDataLayer.cartItemKeys[cartItemKey][\"variation_id\"]\n\t\t}\n\n\t\treturn productId\n\t}\n\n\twpm.getAddToCartLinkProductIds = function () {\n\t\treturn jQuery(\"a\").map(function () {\n\t\t\tlet href = jQuery(this).attr(\"href\")\n\n\t\t\tif (href && href.includes(\"?add-to-cart=\")) {\n\t\t\t\tlet matches = href.match(/(add-to-cart=)(\\d+)/)\n\t\t\t\tif (matches) return matches[2]\n\t\t\t}\n\t\t}).get()\n\t}\n\n\twpm.getProductDetailsFormattedForEvent = function (productId, quantity = 1) {\n\n\t\t// console.log(wpmDataLayer.products[productId].dyn_r_ids)\n\n\t\tlet product = {\n\t\t\tid : productId.toString(),\n\t\t\tdyn_r_ids : wpmDataLayer.products[productId].dyn_r_ids,\n\t\t\tname : wpmDataLayer.products[productId].name,\n\t\t\tlist_name : wpmDataLayer.shop.list_name,\n\t\t\tbrand : wpmDataLayer.products[productId].brand,\n\t\t\tcategory : wpmDataLayer.products[productId].category,\n\t\t\tvariant : wpmDataLayer.products[productId].variant,\n\t\t\tlist_position: wpmDataLayer.products[productId].position,\n\t\t\tquantity : quantity,\n\t\t\tprice : wpmDataLayer.products[productId].price,\n\t\t\tcurrency : wpmDataLayer.shop.currency,\n\t\t\tisVariable : wpmDataLayer.products[productId].isVariable,\n\t\t\tisVariation : wpmDataLayer.products[productId].isVariation,\n\t\t\tparentId : wpmDataLayer.products[productId].parentId,\n\t\t}\n\n\t\tif (product.isVariation) product[\"parentId_dyn_r_ids\"] = wpmDataLayer.products[productId].parentId_dyn_r_ids\n\n\t\treturn product\n\t}\n\n\twpm.setReferrerToCookie = function () {\n\t\t// can't use session storage as we can't read it from the server\n\t\tif (!wpm.getCookie(\"wpmReferrer\")) {\n\t\t\twpm.setCookie(\"wpmReferrer\", document.referrer)\n\t\t}\n\t}\n\n\twpm.getReferrerFromCookie = function () {\n\t\tif (wpm.getCookie(\"wpmReferrer\")) {\n\t\t\treturn wpm.getCookie(\"wpmReferrer\")\n\t\t} else {\n\t\t\treturn null\n\t\t}\n\t}\n\n\twpm.getClidFromBrowser = function (clidId = \"gclid\") {\n\n\t\tlet clidCookieId\n\n\t\tclidCookieId = {\n\t\t\tgclid: \"_gcl_aw\",\n\t\t\tdclid: \"_gcl_dc\",\n\t\t}\n\n\t\tif (wpm.getCookie(clidCookieId[clidId])) {\n\t\t\tlet clidCookie = wpm.getCookie(clidCookieId[clidId])\n\t\t\tlet matches = clidCookie.match(/(GCL.[\\d]*.)(.*)/)\n\t\t\treturn matches[2]\n\t\t} else {\n\t\t\treturn \"\"\n\t\t}\n\t}\n\n\twpm.getUserAgent = function () {\n\t\treturn navigator.userAgent\n\t}\n\n\twpm.getViewPort = function () {\n\t\treturn {\n\t\t\twidth : Math.max(document.documentElement.clientWidth || 0, window.innerWidth || 0),\n\t\t\theight: Math.max(document.documentElement.clientHeight || 0, window.innerHeight || 0),\n\t\t}\n\t}\n\n\t/*\n\t* Handle Cookie Management Platforms\n\t* */\n\n\tlet getComplianzCookies = function () {\n\n\t\tlet cmplz_statistics = wpm.getCookie(\"cmplz_statistics\")\n\t\tlet cmplz_marketing = wpm.getCookie(\"cmplz_marketing\")\n\t\tlet cmplz_consent_status = wpm.getCookie(\"cmplz_consent_status\") || wpm.getCookie(\"cmplz_banner-status\")\n\n\n\t\tif (cmplz_consent_status) {\n\t\t\treturn {\n\t\t\t\tanalytics : cmplz_statistics === \"allow\",\n\t\t\t\tads : cmplz_marketing === \"allow\",\n\t\t\t\tvisitorHasChosen: true,\n\t\t\t}\n\t\t} else {\n\t\t\treturn false\n\t\t}\n\t}\n\n\tlet getCookieLawInfoCookies = function () {\n\n\t\tlet analyticsCookie = wpm.getCookie(\"cookielawinfo-checkbox-analytics\") || wpm.getCookie(\"cookielawinfo-checkbox-analytiques\")\n\t\tlet adsCookie = wpm.getCookie(\"cookielawinfo-checkbox-advertisement\") || wpm.getCookie(\"cookielawinfo-checkbox-publicite\")\n\t\tlet visitorHasChosen = wpm.getCookie(\"CookieLawInfoConsent\")\n\n\t\tif (analyticsCookie || adsCookie) {\n\n\t\t\treturn {\n\t\t\t\tanalytics : analyticsCookie === \"yes\",\n\t\t\t\tads : adsCookie === \"yes\",\n\t\t\t\tvisitorHasChosen: !!visitorHasChosen,\n\t\t\t}\n\t\t} else {\n\t\t\treturn false\n\t\t}\n\t}\n\n\n\tlet\n\t\twpmConsentValues = {}\n\twpmConsentValues.categories = {}\n\twpmConsentValues.pixels = []\n\twpmConsentValues.mode = \"category\"\n\twpmConsentValues.visitorHasChosen = false\n\n\twpm.getConsentValues = function () {\n\t\treturn wpmConsentValues\n\t}\n\n\twpm.setConsentValueCategories = function (analytics = false, ads = false) {\n\t\twpmConsentValues.categories.analytics = analytics\n\t\twpmConsentValues.categories.ads = ads\n\t}\n\n\twpm.updateConsentCookieValues = function (explicitConsent = false) {\n\n\t\t// ad_storage\n\t\t// analytics_storage\n\t\t// functionality_storage\n\t\t// personalization_storage\n\t\t// security_storage\n\n\t\t// console.log('exp cons: ' + explicitConsent)\n\n\t\tlet cookie\n\n\t\tif (cookie = wpm.getCookie(\"CookieConsent\")) {\n\t\t\t// Cookiebot\n\t\t\t// https://wordpress.org/plugins/cookiebot/\n\t\t\tcookie = decodeURI(cookie)\n\n\t\t\t// console.log(cookie.indexOf('statistics:true'))\n\t\t\t// console.log(cookie.indexOf('marketing:true'))\n\n\t\t\twpmConsentValues.categories.analytics = cookie.indexOf(\"statistics:true\") >= 0\n\t\t\twpmConsentValues.categories.ads = cookie.indexOf(\"marketing:true\") >= 0\n\t\t\twpmConsentValues.visitorHasChosen = true\n\n\t\t} else if (cookie = wpm.getCookie(\"CookieScriptConsent\")) {\n\t\t\t// Cookie Script\n\t\t\t// https://wordpress.org/plugins/cookie-script-com/\n\n\t\t\tcookie = JSON.parse(cookie)\n\n\t\t\t// console.log(cookie)\n\t\t\t// console.log(cookie.action)\n\t\t\t// console.log('cat length: ' + cookie.categories.length)\n\t\t\t// console.log(cookie.categories.indexOf('performance'))\n\n\t\t\tif (cookie.action === \"reject\") {\n\t\t\t\twpmConsentValues.categories.analytics = false\n\t\t\t\twpmConsentValues.categories.ads = false\n\t\t\t} else if (cookie.categories.length === 2) {\n\t\t\t\twpmConsentValues.categories.analytics = true\n\t\t\t\twpmConsentValues.categories.ads = true\n\t\t\t} else {\n\t\t\t\twpmConsentValues.categories.analytics = cookie.categories.indexOf(\"performance\") >= 0\n\t\t\t\twpmConsentValues.categories.ads = cookie.categories.indexOf(\"targeting\") >= 0\n\t\t\t}\n\n\t\t\twpmConsentValues.visitorHasChosen = true\n\n\t\t\t// console.log(wpmConsentValues)\n\n\t\t} else if (cookie = wpm.getCookie(\"borlabs-cookie\")) {\n\t\t\t// Borlabs Cookie\n\t\t\t// https://borlabs.io/borlabs-cookie/\n\n\t\t\tcookie = decodeURI(cookie)\n\t\t\tcookie = JSON.parse(cookie)\n\n\t\t\twpmConsentValues.categories.analytics = !!cookie?.consents?.statistics\n\t\t\twpmConsentValues.categories.ads = !!cookie?.consents?.marketing\n\t\t\twpmConsentValues.visitorHasChosen = true\n\t\t\twpmConsentValues.pixels = [...cookie?.consents?.statistics || [], ...cookie?.consents?.marketing || []]\n\t\t\twpmConsentValues.mode = \"pixel\"\n\n\t\t} else if (cookie = getComplianzCookies()) {\n\t\t\t// Complianz Cookie\n\t\t\t// https://wordpress.org/plugins/complianz-gdpr/\n\n\t\t\t// console.log(cookie)\n\n\t\t\twpmConsentValues.categories.analytics = cookie.analytics === true\n\t\t\twpmConsentValues.categories.ads = cookie.ads === true\n\t\t\twpmConsentValues.visitorHasChosen = cookie.visitorHasChosen\n\n\t\t\t// console.log(wpmConsentValues)\n\n\t\t} else if (cookie = wpm.getCookie(\"cookie_notice_accepted\")) {\n\t\t\t// Cookie Compliance (free version)\n\t\t\t// https://wordpress.org/plugins/cookie-notice/\n\n\t\t\twpmConsentValues.categories.analytics = true\n\t\t\twpmConsentValues.categories.ads = true\n\t\t\twpmConsentValues.visitorHasChosen = true\n\n\t\t} else if (cookie = wpm.getCookie(\"hu-consent\")) {\n\t\t\t// Cookie Compliance (pro version)\n\t\t\t// https://wordpress.org/plugins/cookie-notice/\n\n\t\t\tcookie = JSON.parse(cookie)\n\n\t\t\twpmConsentValues.categories.analytics = !!cookie.categories[\"3\"]\n\t\t\twpmConsentValues.categories.ads = !!cookie.categories[\"4\"]\n\t\t\twpmConsentValues.visitorHasChosen = true\n\n\t\t} else if (cookie = getCookieLawInfoCookies()) {\n\t\t\t// CookieYes, GDPR Cookie Consent (Cookie Law Info)\n\t\t\t// https://wordpress.org/plugins/cookie-law-info/\n\n\t\t\twpmConsentValues.categories.analytics = cookie.analytics === true\n\t\t\twpmConsentValues.categories.ads = cookie.ads === true\n\t\t\twpmConsentValues.visitorHasChosen = cookie.visitorHasChosen === true\n\n\t\t} else if (cookie = wpm.getCookie(\"moove_gdpr_popup\")) {\n\t\t\t// GDPR Cookie Compliance Plugin by Moove Agency\n\t\t\t// https://wordpress.org/plugins/gdpr-cookie-compliance/\n\t\t\t// TODO write documentation on how to set up the plugin in order for this to work properly\n\n\t\t\tcookie = JSON.parse(cookie)\n\t\t\t// console.log('moove cookie thirdparty: ' + cookie.thirdparty)\n\t\t\t// console.log('moove cookie advanced: ' + cookie.advanced)\n\n\t\t\twpmConsentValues.categories.analytics = cookie.thirdparty === \"1\"\n\t\t\twpmConsentValues.categories.ads = cookie.advanced === \"1\"\n\t\t\twpmConsentValues.visitorHasChosen = true\n\n\t\t\t// console.log(wpmConsentValues)\n\n\t\t} else {\n\t\t\t// consentValues.categories.analytics = true\n\t\t\t// consentValues.categories.ads = true\n\n\t\t\twpmConsentValues.categories.analytics = !explicitConsent\n\t\t\twpmConsentValues.categories.ads = !explicitConsent\n\t\t}\n\t}\n\n\twpm.updateConsentCookieValues()\n\n\twpm.setConsentDefaultValuesToExplicit = function () {\n\t\twpmConsentValues.categories = {\n\t\t\tanalytics: false,\n\t\t\tads : false,\n\t\t}\n\t}\n\n\twpm.canIFire = function (category, pixelName) {\n\n\t\tlet canIFireMode\n\n\t\tif (\"category\" === wpmConsentValues.mode) {\n\t\t\tcanIFireMode = !!wpmConsentValues.categories[category]\n\t\t} else if (\"pixel\" === wpmConsentValues.mode) {\n\t\t\tcanIFireMode = wpmConsentValues.pixels.includes(pixelName)\n\t\t} else {\n\t\t\tconsole.error(\"Couldn't find a valid consent mode in wpmConsentValues\")\n\t\t\tcanIFireMode = false\n\t\t}\n\n\t\tif (canIFireMode) {\n\t\t\treturn true\n\t\t} else {\n\t\t\tif (wpm.urlHasParameter(\"debugConsentMode\")) {\n\t\t\t\tif (wpmDataLayer?.shop?.cookie_consent_mgmt?.explicit_consent) {\n\t\t\t\t\tconsole.log(\"WooCommerce Pixel Manager: The \\\"\" + pixelName + \" (category: \" + category + \")\\\" pixel has not fired because you have not given consent for it yet. (The shop is in explicit consent mode.)\")\n\t\t\t\t} else {\n\t\t\t\t\tconsole.log(\"WooCommerce Pixel Manager: The \\\"\" + pixelName + \" (category: \" + category + \")\\\" pixel has not fired because you have removed consent for this pixel. (The shop is in implicit consent mode.)\")\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn false\n\t\t}\n\t}\n\n\t/**\n\t * Runs through each script in <head> and blocks / unblocks it according to the plugin settings\n\t * and user consent.\n\t */\n\n\t// https://stackoverflow.com/q/65453565/4688612\n\twpm.scriptTagObserver = new MutationObserver((mutations) => {\n\t\tmutations.forEach(({addedNodes}) => {\n\t\t\t[...addedNodes]\n\t\t\t\t.forEach(node => {\n\n\t\t\t\t\tif ($(node).data(\"wpm-cookie-category\")) {\n\n\t\t\t\t\t\t// console.log(node)\n\n\t\t\t\t\t\t// If the pixel category has been approved > unblock\n\t\t\t\t\t\t// If the pixel belongs to more than one category, then unblock if one of the categories has been approved\n\t\t\t\t\t\t// If no category has been approved, but the Google Consent Mode is active, then only unblock the Google scripts\n\n\t\t\t\t\t\tif (wpm.shouldScriptBeActive(node)) {\n\t\t\t\t\t\t\twpm.unblockScript(node)\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\twpm.blockScript(node)\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t})\n\t})\n\n\twpm.scriptTagObserver.observe(document.head, {childList: true, subtree: true})\n\twindow.addEventListener(\"DOMContentLoaded\", () => wpm.scriptTagObserver.disconnect())\n\n\twpm.shouldScriptBeActive = function (node) {\n\n\t\tif (\n\t\t\twpmDataLayer.shop.cookie_consent_mgmt.explicit_consent ||\n\t\t\twpmConsentValues.visitorHasChosen\n\t\t) {\n\n\t\t\tif (wpmConsentValues.mode === \"category\" && $(node).data(\"wpm-cookie-category\").split(\",\").some(element => wpmConsentValues.categories[element])) {\n\t\t\t\treturn true\n\t\t\t} else if (wpmConsentValues.mode === \"pixel\" && wpmConsentValues.pixels.includes($(node).data(\"wpm-pixel-name\"))) {\n\t\t\t\treturn true\n\t\t\t} else if (wpmConsentValues.mode === \"pixel\" && $(node).data(\"wpm-pixel-name\") === \"google\" && [\"google-analytics\", \"google-ads\"].some(element => wpmConsentValues.pixels.includes(element))) {\n\t\t\t\treturn true\n\t\t\t} else if (wpmDataLayer?.pixels?.google?.consent_mode?.active && $(node).data(\"wpm-pixel-name\") === \"google\") {\n\t\t\t\treturn true\n\t\t\t} else {\n\t\t\t\treturn false\n\t\t\t}\n\t\t} else {\n\t\t\treturn true\n\t\t}\n\t}\n\n\n\twpm.unblockScript = function (scriptNode, removeAttach = false) {\n\n\t\tif (removeAttach) $(scriptNode).remove()\n\n\t\tlet wpmSrc = $(scriptNode).data(\"wpm-src\")\n\t\tif (wpmSrc) $(scriptNode).attr(\"src\", wpmSrc)\n\n\t\tscriptNode.type = \"text/javascript\"\n\n\t\tif (removeAttach) $(scriptNode).appendTo(\"head\")\n\n\t\tjQuery(document).trigger(\"wpmPreLoadPixels\", {})\n\t}\n\n\twpm.blockScript = function (scriptNode, removeAttach = false) {\n\n\t\tif (removeAttach) $(scriptNode).remove()\n\n\t\tif ($(scriptNode).attr(\"src\")) $(scriptNode).removeAttr(\"src\")\n\t\tscriptNode.type = \"blocked/javascript\"\n\n\t\tif (removeAttach) $(scriptNode).appendTo(\"head\")\n\t}\n\n\twpm.unblockAllScripts = function (analytics = true, ads = true) {\n\t\t// console.log('unblocking all scripts')\n\n\t\t$.each(\n\t\t\t$(\"script[type=\\\"blocked/javascript\\\"]\"), function (index, scriptNode) {\n\n\t\t\t\tif ($(scriptNode).data(\"wpm-cookie-category\").includes(\"analytics\") && analytics) {\n\t\t\t\t\twpm.unblockScript(scriptNode, true)\n\t\t\t\t} else if ($(scriptNode).data(\"wpm-cookie-category\").includes(\"ads\") && ads) {\n\t\t\t\t\twpm.unblockScript(scriptNode, true)\n\t\t\t\t}\n\t\t\t})\n\n\t\tjQuery(document).trigger(\"wpmPreLoadPixels\", {})\n\t}\n\n\twpm.unblockSelectedPixels = function () {\n\t\t$.each(\n\t\t\t$(\"script[type=\\\"blocked/javascript\\\"]\"), function (index, node) {\n\n\t\t\t\tif (wpmConsentValues.pixels.includes($(node).data(\"wpm-pixel-name\"))) {\n\t\t\t\t\twpm.unblockScript(node, true)\n\t\t\t\t} else if ($(node).data(\"wpm-pixel-name\") === \"google\" && [\"google-analytics\", \"google-ads\"].some(element => wpmConsentValues.pixels.includes(element))) {\n\t\t\t\t\twpm.unblockScript(node, true)\n\t\t\t\t}\n\t\t\t})\n\n\t\tjQuery(document).trigger(\"wpmPreLoadPixels\", {})\n\t}\n\n\n\t/**\n\t * Block or unblock scripts for each CMP immediately after cookie consent has been updated\n\t * by the visitor.\n\t */\n\n\t// Borlabs Cookie\n\t// If visitor accepts cookies in Borlabs Cookie unblock the scripts\n\twindow.addEventListener(\"borlabs-cookie-consent-saved\", function (e) {\n\n\t\twpm.updateConsentCookieValues()\n\n\t\tif (wpmConsentValues.mode === \"pixel\") {\n\n\t\t\twpm.unblockSelectedPixels()\n\t\t\twpm.updateGoogleConsentMode(wpmConsentValues.pixels.includes(\"google-analytics\"), wpmConsentValues.pixels.includes(\"google-ads\"))\n\t\t} else {\n\n\t\t\twpm.unblockAllScripts(wpmConsentValues.categories.analytics, wpmConsentValues.categories.ads)\n\t\t\twpm.updateGoogleConsentMode(wpmConsentValues.categories.analytics, wpmConsentValues.categories.ads)\n\t\t}\n\t})\n\n\t// Cookiebot\n\t// If visitor accepts cookies in Cookiebot unblock the scripts\n\t// https://www.cookiebot.com/en/developer/\n\twindow.addEventListener(\"CookiebotOnAccept\", function (e) {\n\t\tif (Cookiebot.consent.statistics) wpmConsentValues.categories.analytics = true\n\t\tif (Cookiebot.consent.marketing) wpmConsentValues.categories.ads = true\n\n\t\twpm.unblockAllScripts(wpmConsentValues.categories.analytics, wpmConsentValues.categories.ads)\n\t\twpm.updateGoogleConsentMode(wpmConsentValues.categories.analytics, wpmConsentValues.categories.ads)\n\n\t}, false)\n\n\t/**\n\t * Cookie Script\n\t * If visitor accepts cookies in Cookie Script unblock the scripts\n\t * https://support.cookie-script.com/article/20-custom-events\n\t */\n\twindow.addEventListener(\"CookieScriptAccept\", function (e) {\n\t\tif (e.detail.categories.includes(\"performance\")) wpmConsentValues.categories.analytics = true\n\t\tif (e.detail.categories.includes(\"targeting\")) wpmConsentValues.categories.ads = true\n\n\t\twpm.unblockAllScripts(wpmConsentValues.categories.analytics, wpmConsentValues.categories.ads)\n\t\twpm.updateGoogleConsentMode(wpmConsentValues.categories.analytics, wpmConsentValues.categories.ads)\n\t})\n\n\t/**\n\t * Cookie Script\n\t * If visitor accepts cookies in Cookie Script unblock the scripts\n\t * https://support.cookie-script.com/\n\t */\n\twindow.addEventListener(\"CookieScriptAcceptAll\", function (e) {\n\t\twpm.unblockAllScripts(true, true)\n\t\twpm.updateGoogleConsentMode(true, true)\n\t})\n\n\t// Complianz Cookie\n\t// If visitor accepts cookies in Complianz unblock the scripts\n\tdocument.addEventListener(\"cmplzStatusChange\", function (e) {\n\n\t\twpm.updateConsentCookieValues()\n\n\t\t// console.log(wpmConsentValues)\n\n\t\twpm.unblockAllScripts(wpmConsentValues.categories.analytics, wpmConsentValues.categories.ads)\n\t\twpm.updateGoogleConsentMode(wpmConsentValues.categories.analytics, wpmConsentValues.categories.ads)\n\t})\n\n\t// Cookie Compliance by hu-manity.co (free and pro)\n\t// If visitor accepts cookies in Cookie Notice by hu-manity.co unblock the scripts (free version)\n\t// https://wordpress.org/support/topic/events-on-consent-change/#post-15202792\n\tdocument.addEventListener(\"setCookieNotice\", function (e) {\n\n\t\twpm.updateConsentCookieValues()\n\n\t\t// console.log(wpmConsentValues)\n\n\t\twpm.unblockAllScripts(wpmConsentValues.categories.analytics, wpmConsentValues.categories.ads)\n\t\twpm.updateGoogleConsentMode(wpmConsentValues.categories.analytics, wpmConsentValues.categories.ads)\n\t})\n\n\t/**\n\t * Cookie Compliance by hu-manity.co (free and pro)\n\t * If visitor accepts cookies in Cookie Notice by hu-manity.co unblock the scripts (pro version)\n\t * https://wordpress.org/support/topic/events-on-consent-change/#post-15202792\n\t * Because Cookie Notice has no documented API or event that is being triggered on consent save or update\n\t * we have to solve this by using a mutation observer.\n\t *\n\t * @type {MutationObserver}\n\t */\n\n\twpm.huObserver = new MutationObserver(function (mutations) {\n\t\tmutations.forEach(({addedNodes}) => {\n\t\t\t[...addedNodes]\n\t\t\t\t.forEach(node => {\n\n\t\t\t\t\tif (node.id === \"hu\") {\n\n\t\t\t\t\t\tjQuery(\".hu-cookies-save\").on(\"click\", function (e) {\n\t\t\t\t\t\t\twpm.updateConsentCookieValues()\n\t\t\t\t\t\t\twpm.unblockAllScripts(wpmConsentValues.categories.analytics, wpmConsentValues.categories.ads)\n\t\t\t\t\t\t\twpm.updateGoogleConsentMode(wpmConsentValues.categories.analytics, wpmConsentValues.categories.ads)\n\t\t\t\t\t\t})\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t})\n\t})\n\n\tif (window.hu) {\n\t\twpm.huObserver.observe(document.documentElement || document.body, {childList: true, subtree: true})\n\t}\n\n\twpm.version = function () {\n\t\tconsole.log(wpmDataLayer.version)\n\t}\n\n\t// https://api.jquery.com/jquery.getscript/\n\twpm.loadScriptAndCacheIt = function (url, options) {\n\n\t\t// Allow user to set any option except for dataType, cache, and url\n\t\toptions = jQuery.extend(options || {}, {\n\t\t\tdataType: \"script\",\n\t\t\tcache : true,\n\t\t\turl : url,\n\t\t})\n\n\t\t// Use $.ajax() since it is more flexible than $.getScript\n\t\t// Return the jqXHR object so we can chain callbacks\n\t\treturn jQuery.ajax(options)\n\t}\n\n\twpm.getOrderItemPrice = function (orderItem) {\n\t\treturn (orderItem.total + orderItem.total_tax) / orderItem.quantity\n\t}\n\n\twpm.hasLoginEventFired = function () {\n\t\tlet data = wpm.getWpmSessionData()\n\t\treturn data?.loginEventFired\n\t}\n\n\twpm.setLoginEventFired = function () {\n\t\tlet data = wpm.getWpmSessionData()\n\t\tdata[\"loginEventFired\"] = true\n\t\twpm.setWpmSessionData(data)\n\t}\n\n\twpm.wpmDataLayerExists = function () {\n\t\treturn new Promise(function (resolve) {\n\t\t\t(function waitForVar() {\n\t\t\t\tif (typeof wpmDataLayer !== \"undefined\") return resolve()\n\t\t\t\tsetTimeout(waitForVar, 50)\n\t\t\t})()\n\t\t})\n\t}\n\n\twpm.pageLoaded = function () {\n\t\treturn new Promise(function (resolve) {\n\t\t\t(function waitForVar() {\n\t\t\t\tif (\"complete\" === document.readyState) return resolve()\n\t\t\t\tsetTimeout(waitForVar, 50)\n\t\t\t})()\n\t\t})\n\t}\n\n\twpm.pageReady = function () {\n\t\treturn new Promise(function (resolve) {\n\t\t\t(function waitForVar() {\n\t\t\t\tif (\"interactive\" === document.readyState || \"complete\" === document.readyState) return resolve()\n\t\t\t\tsetTimeout(waitForVar, 50)\n\t\t\t})()\n\t\t})\n\t}\n\n\twpm.isMiniCartActive = function () {\n\t\tif (window.sessionStorage) {\n\t\t\tfor (const [key, value] of Object.entries(window.sessionStorage)) {\n\t\t\t\tif (key.includes(\"wc_fragments\")) {\n\t\t\t\t\treturn true\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false\n\t\t} else {\n\t\t\treturn false\n\t\t}\n\t}\n\n\twpm.doesWooCommerceCartExist = function () {\n\t\treturn document.cookie.includes(\"woocommerce_items_in_cart\")\n\t}\n\n\twpm.urlHasParameter = function (parameter) {\n\t\tlet urlParams = new URLSearchParams(window.location.search)\n\t\treturn urlParams.has(parameter)\n\t}\n\n\t// wpm['load'] = {\n\t// base: true\n\t// };\n\n\twindow[\"wpmLoaded\"] = {}\n\n\t// return {\n\t// writeOrderIdToStorage : writeOrderIdToStorage,\n\t// isOrderIdStored : isOrderIdStored,\n\t// isEmail : isEmail,\n\t// removeProductFromCart : removeProductFromCart,\n\t// getViewItemProducts : getViewItemProducts,\n\t// addProductToCart : addProductToCart,\n\t// getCartItemsFromBackEnd: getCartItemsFromBackEnd,\n\t// fireCheckoutOption : fireCheckoutOption,\n\t// getCartItems : getCartItems\n\t// }\n\n}(window.wpm = window.wpm || {}, jQuery))\n\n\n/**\n * Run when page is ready\n * */\n\nwpm.pageReady().then(function () {\n\n\n\t/**\n\t * Run as soon as wpm namespace is loaded\n\t */\n\n\twpm.wpmDataLayerExists()\n\t\t.then(function () {\n\t\t\t// watch for products visible in viewport\n\t\t\twpm.startIntersectionObserverToWatch()\n\n\t\t\t// watch for lazy loaded products\n\t\t\twpm.startProductsMutationObserverToWatch()\n\t\t})\n\n\t// let products = jQuery(\".products, .product\")\n\n\n\t// remove_from_cart event\n\tjQuery(document).on(\"click\", \".remove_from_cart_button, .remove\", function (e) {\n\t\t// jQuery('.remove_from_cart_button, .remove').on('click', function (e) {\n\n\t\ttry {\n\t\t\t// console.log('remove_from_cart: ' + jQuery(this).data('product_id'));\n\n\t\t\tlet url = new URL(jQuery(this).attr(\"href\"))\n\t\t\tlet productId = wpm.getProductIdByCartItemKeyUrl(url)\n\n\t\t\twpm.removeProductFromCart(productId)\n\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t}\n\t})\n\n\n\t// add_to_cart event\n\tjQuery(document).on(\"click\", \".add_to_cart_button:not(.product_type_variable), .ajax_add_to_cart, .single_add_to_cart_button\", function (e) {\n\t\t// jQuery('.add_to_cart_button:not(.product_type_variable), .ajax_add_to_cart, .js-ajax-add-to-cart, .single_add_to_cart_button, .btn_color-2').on('click', function (e) {\n\n\t\ttry {\n\t\t\t// console.log('add_to_cart');\n\n\t\t\tif (wpmDataLayer.shop.page_type === \"product\") {\n\n\t\t\t\t// first process related and upsell products\n\t\t\t\tif (typeof jQuery(this).attr(\"href\") !== \"undefined\" && jQuery(this).attr(\"href\").includes(\"add-to-cart\")) {\n\t\t\t\t\t// console.log('add-to-cart on upsell and related products');\n\t\t\t\t\tlet quantity = 1\n\t\t\t\t\tlet productId = jQuery(this).data(\"product_id\")\n\t\t\t\t\t// console.log('productId: ' + productId);\n\t\t\t\t\twpm.addProductToCart(productId, quantity)\n\t\t\t\t} else {\n\n\t\t\t\t\tif (wpmDataLayer.shop.product_type === \"simple\") {\n\n\t\t\t\t\t\t// console.log('test');\n\t\t\t\t\t\tlet quantity = Number(jQuery(\".input-text.qty\").val())\n\n\t\t\t\t\t\tif (!quantity && quantity !== 0) quantity = 1\n\n\t\t\t\t\t\tlet productId = jQuery(this).val()\n\n\t\t\t\t\t\t// console.log('productId: ' + productId);\n\t\t\t\t\t\t// console.log('quantity: ' + quantity);\n\n\t\t\t\t\t\twpm.addProductToCart(productId, quantity)\n\n\t\t\t\t\t} else if (wpmDataLayer.shop.product_type === \"variable\") {\n\n\t\t\t\t\t\t// console.log('variable');\n\n\t\t\t\t\t\tlet quantity = Number(jQuery(\".input-text.qty\").val())\n\n\t\t\t\t\t\tif (!quantity && quantity !== 0) quantity = 1\n\n\t\t\t\t\t\tlet productId = jQuery(\"[name='variation_id']\").val()\n\n\t\t\t\t\t\t// console.log('productId: ' + productId);\n\t\t\t\t\t\t// console.log('quantity: ' + quantity);\n\n\t\t\t\t\t\twpm.addProductToCart(productId, quantity)\n\n\t\t\t\t\t} else if (wpmDataLayer.shop.product_type === \"grouped\") {\n\n\t\t\t\t\t\t// console.log('grouped');\n\n\t\t\t\t\t\tjQuery(\".woocommerce-grouped-product-list-item\").each(function () {\n\n\t\t\t\t\t\t\tlet quantity = Number(jQuery(this).find(\".input-text.qty\").val())\n\n\t\t\t\t\t\t\tif (!quantity && quantity !== 0) quantity = 1\n\n\t\t\t\t\t\t\tlet classes = jQuery(this).attr(\"class\")\n\t\t\t\t\t\t\tlet productId = wpm.getPostIdFromString(classes)\n\n\t\t\t\t\t\t\t// console.log('productId: ' + productId);\n\t\t\t\t\t\t\t// console.log('quantity: ' + quantity);\n\n\t\t\t\t\t\t\twpm.addProductToCart(productId, quantity)\n\t\t\t\t\t\t})\n\t\t\t\t\t} else if (wpmDataLayer.shop.product_type === \"bundle\") {\n\n\t\t\t\t\t\t// console.log('bundle');\n\n\t\t\t\t\t\tlet quantity = Number(jQuery(\".input-text.qty\").val())\n\n\t\t\t\t\t\tif (!quantity && quantity !== 0) quantity = 1\n\n\t\t\t\t\t\tlet productId = jQuery(\"input[name=add-to-cart]\").val()\n\n\t\t\t\t\t\t// console.log('productId: ' + productId);\n\t\t\t\t\t\t// console.log('quantity: ' + quantity);\n\n\t\t\t\t\t\twpm.addProductToCart(productId, quantity)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\n\t\t\t\t// console.log('non product page');\n\n\t\t\t\tlet quantity = 1\n\t\t\t\tlet productId = jQuery(this).data(\"product_id\")\n\t\t\t\t// console.log('productId: ' + productId);\n\t\t\t\twpm.addProductToCart(productId, quantity)\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t}\n\t})\n\n\t// if someone clicks anywhere on a custom /?add-to-cart=123 link\n\t// trigger the add to cart event\n\t// body.one('click', function (e) {\n\t//\n\t// try {\n\t// if (jQuery(this)[0].URL) {\n\t//\n\t// let href = new URL(jQuery(this)[0].URL);\n\t// let searchParams = new URLSearchParams(href.search);\n\t//\n\t// if (searchParams.has('add-to-cart')) {\n\t// // console.log('non product page, /?add-to-cart=123 link');\n\t//\n\t// let productId = searchParams.get('add-to-cart');\n\t// wpm.addProductToCart(productId, 1);\n\t// }\n\t// }\n\t// } catch (e) {\n\t// console.error(e);\n\t// }\n\t// });\n\n\n\t/**\n\t * If someone clicks anywhere on a custom /?add-to-cart=123 link\n\t * trigger the add to cart event\n\t */\n\tjQuery(document).one(\"click\", \"a:not(.add_to_cart_button, .ajax_add_to_cart, .single_add_to_cart_button)\", function (event) {\n\t\t// jQuery('a:not(.add_to_cart_button, .ajax_add_to_cart, .single_add_to_cart_button)').one('click', function (event) {\n\n\t\ttry {\n\t\t\tif (jQuery(event.target).closest(\"a\").attr(\"href\")) {\n\n\t\t\t\tlet href = jQuery(event.target).closest(\"a\").attr(\"href\")\n\n\t\t\t\tif (href.includes(\"add-to-cart=\")) {\n\t\t\t\t\tlet matches = href.match(/(add-to-cart=)(\\d+)/)\n\t\t\t\t\t// console.log('pid: ' + matches[2])\n\t\t\t\t\tif (matches) wpm.addProductToCart(matches[2], 1)\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t}\n\t})\n\n\t// select_content GA UA event\n\t// select_item GA 4 event\n\t// jQuery(document).on('click', '.woocommerce-LoopProduct-link, .wc-block-grid__product, .product-small.box', function (e) {\n\tjQuery(document).on(\"click\", \".woocommerce-LoopProduct-link, .wc-block-grid__product, .product, .product-small, .type-product\", function (e) {\n\t\t// jQuery('.woocommerce-LoopProduct-link, .wc-block-grid__product, .product, .product-small, .type-product').on('click', function (e) {\n\n\t\ttry {\n\n\t\t\t/**\n\t\t\t *\n\t\t\t * On some pages the event fires multiple times, and on product pages\n\t\t\t * even on page load. Using e.stopPropagation helps to prevent this,\n\t\t\t * but I dont know why. We don't even have to use this, since only a real\n\t\t\t * product click yields a valid productId. So we filter the invalid click\n\t\t\t * events out later down the code. I'll keep it that way because this is\n\t\t\t * the most compatible way across shops.\n\t\t\t * e.stopPropagation();\n\t\t\t * */\n\n\t\t\t\t// console.log('select_content and select_item');\n\n\t\t\tlet productId = jQuery(this).nextAll(\".wpmProductId:first\").data(\"id\")\n\t\t\t// console.log('select_content and select_item: ' + productId);\n\n\n\t\t\t/**\n\t\t\t * On product pages, for some reason, the click event is triggered on the main product on page load.\n\t\t\t * In that case no ID is found. But we can discard it, since we only want to trigger the event on\n\t\t\t * related products, which are found below.\n\t\t\t */\n\n\t\t\tif (productId) {\n\n\t\t\t\t// console.log('select_content and select_item: ' + productId);\n\n\t\t\t\tproductId = getIdBasedOndVariationsOutputSetting(productId)\n\n\t\t\t\tif (!productId) throw Error(\"Wasn't able to retrieve a productId\")\n\n\t\t\t\t// console.log('prodid: ' + productId);\n\n\t\t\t\tif (wpmDataLayer.products && wpmDataLayer.products[productId]) {\n\n\t\t\t\t\tlet product = wpm.getProductDetailsFormattedForEvent(productId)\n\n\t\t\t\t\tjQuery(document).trigger(\"wpmSelectContentGaUa\", product)\n\t\t\t\t\tjQuery(document).trigger(\"wpmSelectItem\", product)\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t}\n\t})\n\n\t// begin_checkout event\n\tjQuery(document).one(\"click\", \".checkout-button, .cart-checkout-button, .button.checkout\", function (e) {\n\t\t// jQuery('.checkout-button, .cart-checkout-button, .button.checkout').one('click', function (e) {\n\t\t// console.log('begin_checkout');\n\n\t\tjQuery(document).trigger(\"wpmBeginCheckout\")\n\t})\n\n\n\t// checkout_progress event\n\t// track checkout option event: entered valid billing email\n\tjQuery(document).on(\"input\", \"#billing_email\", function () {\n\t\t// jQuery('#billing_email').on('input', function () {\n\n\t\tif (wpm.isEmail(jQuery(this).val())) {\n\t\t\t// wpm.fireCheckoutOption(2);\n\t\t\twpm.fireCheckoutProgress(2)\n\t\t\twpm.emailSelected = true\n\t\t}\n\t})\n\n\t// track checkout option event: purchase click\n\tjQuery(document).on(\"click\", \".wc_payment_methods\", function () {\n\t\t// jQuery('.wc_payment_methods').on('click', function () {\n\n\t\tif (false === wpm.paymentMethodSelected) {\n\t\t\twpm.fireCheckoutProgress(3)\n\t\t}\n\n\t\twpm.fireCheckoutOption(3, jQuery(\"input[name='payment_method']:checked\").val())\n\t\twpm.paymentMethodSelected = true\n\t})\n\n\t// track checkout option event: purchase click\n\tjQuery(document).one(\"click\", \"#place_order\", function () {\n\t\t// jQuery('#place_order').one('click', function () {\n\n\t\tif (false === wpm.emailSelected) {\n\t\t\twpm.fireCheckoutProgress(2)\n\t\t}\n\n\t\tif (false === wpm.paymentMethodSelected) {\n\t\t\twpm.fireCheckoutProgress(3)\n\t\t\twpm.fireCheckoutOption(3, jQuery(\"input[name='payment_method']:checked\").val())\n\t\t}\n\n\t\twpm.fireCheckoutProgress(4)\n\t})\n\n\t// update cart event\n\tjQuery(document).on(\"click\", \"[name='update_cart']\", function (e) {\n\t\t// jQuery(\"[name='update_cart']\").on('click', function (e) {\n\n\t\ttry {\n\t\t\tjQuery(\".cart_item\").each(function () {\n\n\t\t\t\t// let productId = jQuery(this).find('[data-product_id]').data('product_id');\n\n\t\t\t\tlet url = new URL(jQuery(this).find(\".product-remove\").find(\"a\").attr(\"href\"))\n\t\t\t\tlet productId = wpm.getProductIdByCartItemKeyUrl(url)\n\n\n\t\t\t\tlet quantity = jQuery(this).find(\".qty\").val()\n\n\t\t\t\tif (quantity === 0) {\n\t\t\t\t\twpm.removeProductFromCart(productId)\n\t\t\t\t} else if (quantity < wpmDataLayer.cart[productId].quantity) {\n\t\t\t\t\twpm.removeProductFromCart(productId, wpmDataLayer.cart[productId].quantity - quantity)\n\t\t\t\t} else if (quantity > wpmDataLayer.cart[productId].quantity) {\n\t\t\t\t\twpm.addProductToCart(productId, quantity - wpmDataLayer.cart[productId].quantity)\n\t\t\t\t}\n\t\t\t})\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t\twpm.getCartItemsFromBackend()\n\t\t}\n\t})\n\n\n\t// add_to_wishlist\n\tjQuery(document).on(\"click\", \".add_to_wishlist, .wl-add-to\", function () {\n\t\t// jQuery('.add_to_wishlist, .wl-add-to').on('click', function () {\n\n\t\ttry {\n\t\t\t// console.log('add_to_wishlist');\n\t\t\t// console.log('this:' + jQuery(this).data('product-id'));\n\n\t\t\tlet productId\n\n\t\t\tif (jQuery(this).data(\"productid\")) { // for the WooCommerce wishlist plugin\n\t\t\t\tproductId = jQuery(this).data(\"productid\")\n\t\t\t} else if (jQuery(this).data(\"product-id\")) { // for the YITH wishlist plugin\n\t\t\t\tproductId = jQuery(this).data(\"product-id\")\n\t\t\t}\n\n\t\t\tif (!productId) throw Error(\"Wasn't able to retrieve a productId\")\n\n\t\t\tlet product = wpm.getProductDetailsFormattedForEvent(productId)\n\n\t\t\t// console.log('add_to_wishlist');\n\t\t\t// console.log(product);\n\n\t\t\tjQuery(document).trigger(\"wpmAddToWishlist\", product)\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t}\n\t})\n\n\tjQuery(document).on(\"updated_cart_totals\", function () {\n\t\tjQuery(document).trigger(\"wpmViewCart\")\n\t})\n\n\n\t/**\n\t * Called when the user selects all the required dropdowns / attributes\n\t *\n\t * Has to be hooked after document ready\n\t *\n\t * https://stackoverflow.com/a/27849208/4688612\n\t * https://stackoverflow.com/a/65065335/4688612\n\t */\n\tjQuery(\".single_variation_wrap\").on(\"show_variation\", function (event, variation) {\n\n\t\ttry {\n\t\t\tlet productId = getIdBasedOndVariationsOutputSetting(variation.variation_id)\n\n\t\t\tif (!productId) throw Error(\"Wasn't able to retrieve a productId\")\n\n\t\t\tif (wpmDataLayer.products && wpmDataLayer.products[productId]) {\n\n\t\t\t\t// console.log('productId: ' + productId);\n\n\t\t\t\tlet product = wpm.getProductDetailsFormattedForEvent(productId)\n\n\t\t\t\tjQuery(document).trigger(\"wpmViewItem\", product)\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t}\n\t})\n\n\t/**\n\t * Called on variable products when no selection has been done yet\n\t * or when the visitor deselects his choice.\n\t *\n\t * Has to be hooked after document ready\n\t */\n\n\tjQuery(\".single_variation_wrap\").on(\"hide_variation\", function (event, data) {\n\n\t\ttry {\n\t\t\tlet classes = jQuery(\"body\").attr(\"class\")\n\t\t\tlet productId = classes.match(/(postid-)(\\d+)/)[2]\n\n\t\t\tif (!productId) throw Error(\"Wasn't able to retrieve a productId\")\n\n\t\t\t/**\n\t\t\t * If we have a variable product with no preset,\n\t\t\t * and variations output is enabled,\n\t\t\t * then we send a viewItem event with the first\n\t\t\t * variation we find for the parent.\n\t\t\t * If variations output is disabled,\n\t\t\t * we just send the parent ID.\n\t\t\t */\n\t\t\tif (\n\t\t\t\t\"variable\" === wpmDataLayer.shop.product_type &&\n\t\t\t\twpmDataLayer?.general?.variationsOutput\n\t\t\t) {\n\t\t\t\tfor (const [key, product] of Object.entries(wpmDataLayer.products)) {\n\t\t\t\t\tif (\"parentId\" in product) {\n\t\t\t\t\t\t// console.log('pid: ' + value.parentId)\n\t\t\t\t\t\tproductId = product.id\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (wpmDataLayer.products && wpmDataLayer.products[productId]) {\n\n\t\t\t\t// console.log('productId: ' + productId);\n\n\t\t\t\tlet product = wpm.getProductDetailsFormattedForEvent(productId)\n\n\t\t\t\tjQuery(document).trigger(\"wpmViewItem\", product)\n\t\t\t}\n\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t}\n\t})\n\n}) // End document ready wrap\n\n/**\n * Set up wpm events\n */\n\n\n// populate the wpmDataLayer with the cart items\njQuery(window).on(\"wpmLoad\", function () {\n\n\ttry {\n\t\t// When a new session is initiated there are no items in the cart,\n\t\t// so we can save the call to get the cart items\n\t\tif (wpm.doesWooCommerceCartExist()) wpm.getCartItems()\n\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n\n// get all add-to-cart= products from backend\njQuery(window).on(\"wpmLoad\", function () {\n\n\twpmDataLayer.products = wpmDataLayer.products || {}\n\n\t// scan page for add-to-cart= links\n\tlet productIds = wpm.getAddToCartLinkProductIds()\n\n\twpm.getProductsFromBackend(productIds)\n})\n\n/**\n * Save the referrer into a cookie\n */\n\njQuery(window).on(\"wpmLoad\", function () {\n\n\t// can't use session storage as we can't read it from the server\n\tif (!wpm.getCookie(\"wpmReferrer\")) {\n\n\t\tif (document.referrer) {\n\t\t\tlet referrerUrl = new URL(document.referrer)\n\t\t\tlet referrerHostname = referrerUrl.hostname\n\n\t\t\tif (referrerHostname !== window.location.host) {\n\t\t\t\twpm.setCookie(\"wpmReferrer\", referrerHostname)\n\t\t\t} else {\n\t\t\t\twpm.setCookie(\"wpmReferrer\", \"\")\n\t\t\t}\n\n\t\t} else {\n\t\t\twpm.setCookie(\"wpmReferrer\", \"\")\n\t\t}\n\t}\n})\n\n\n/**\n * Create our own load event in order to better handle script flow execution when JS \"optimizers\" shuffle the code.\n */\n\njQuery(window).on(\"wpmLoad\", function () {\n\ttry {\n\t\tif (typeof wpmDataLayer != \"undefined\" && !wpmDataLayer?.wpmLoadFired) {\n\n\t\t\tjQuery(document).trigger(\"wpmLoadAlways\")\n\n\t\t\tif (\"product\" === wpmDataLayer.shop.page_type && wpmDataLayer.shop.product_type !== \"variable\" && wpm.getMainProductIdFromProductPage()) {\n\n\t\t\t\tlet product = wpm.getProductDataForViewItemEvent(wpm.getMainProductIdFromProductPage())\n\t\t\t\tjQuery(document).trigger(\"wpmViewItem\", product)\n\n\t\t\t} else if (\"product_category\" === wpmDataLayer.shop.page_type) {\n\n\t\t\t\tjQuery(document).trigger(\"wpmCategory\")\n\n\t\t\t} else if (\"search\" === wpmDataLayer.shop.page_type) {\n\n\t\t\t\tjQuery(document).trigger(\"wpmSearch\")\n\n\t\t\t} else if (\"cart\" === wpmDataLayer.shop.page_type) {\n\n\t\t\t\tjQuery(document).trigger(\"wpmViewCart\")\n\n\t\t\t} else if (\"order_received_page\" === wpmDataLayer.shop.page_type && wpmDataLayer.order) {\n\n\t\t\t\tif (!wpm.isOrderIdStored(wpmDataLayer.order.id)) {\n\n\t\t\t\t\tjQuery(document).trigger(\"wpmOrderReceivedPage\")\n\t\t\t\t\twpm.writeOrderIdToStorage(wpmDataLayer.order.id)\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tjQuery(document).trigger(\"wpmEverywhereElse\")\n\t\t\t}\n\n\t\t\tif (wpmDataLayer?.user?.id && !wpm.hasLoginEventFired()) {\n\t\t\t\tjQuery(document).trigger(\"wpmLogin\")\n\t\t\t\twpm.setLoginEventFired()\n\t\t\t}\n\n\t\t\t// /**\n\t\t\t// * Load mini cart fragments into a wpm session storage key,\n\t\t\t// * after the document load event.\n\t\t\t// */\n\t\t\t// jQuery(document).ajaxSend(function (event, jqxhr, settings) {\n\t\t\t// \t// console.log('settings.url: ' + settings.url);\n\t\t\t//\n\t\t\t// \tif (settings.url.includes(\"get_refreshed_fragments\") && sessionStorage) {\n\t\t\t// \t\tif (!sessionStorage.getItem(\"wpmMiniCartActive\")) {\n\t\t\t// \t\t\tsessionStorage.setItem(\"wpmMiniCartActive\", JSON.stringify(true))\n\t\t\t// \t\t}\n\t\t\t// \t}\n\t\t\t// })\n\n\t\t\twpmDataLayer.wpmLoadFired = true\n\t\t}\n\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n\n// jQuery(window).on(\"load\", function () {\n// \tjQuery(document).trigger(\"wpmLoad\", {})\n// })\n\njQuery(window).on(\"wpmPreLoadPixels\", function () {\n\n\tif (wpmDataLayer?.shop?.cookie_consent_mgmt?.explicit_consent) {\n\t\twpm.updateConsentCookieValues(true)\n\t}\n\tjQuery(document).trigger(\"wpmLoadPixels\", {})\n})\n","(function (wpm, $, undefined) {\n\n\t// do something\n\n}(window.wpm = window.wpm || {}, jQuery))\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// TODO Try using the webpack ignore plugin to remove premium imports during compilation\n// https://webpack.js.org/plugins/ignore-plugin/\n// https://stackoverflow.com/questions/65004054/webpack-ignoreplugin-on-multiple-modules\n// https://stackoverflow.com/questions/61822069/conditional-import-import-if-exists\n// https://stackoverflow.com/questions/36367532/how-can-i-conditionally-import-an-es6-module\n\n\n// console.log(ENV)\n// if (ENV.tier === 'pro') {\n// console.log('tier')\n// }\n\n/**\n * Load all essential scripts first\n */\n\nrequire(\"./wpm\")\nrequire(\"./wpm__premium_only\")\nrequire(\"./google__premium_only\")\n\n/**\n * Load all free scripts\n */\n\nrequire(\"./google\")\nrequire(\"./google-ga-ua\")\nrequire(\"./google-ga-4\")\nrequire(\"./google-ads\")\nrequire(\"./facebook\")\nrequire(\"./hotjar\")\nrequire(\"./google-optimize\")\n\n/**\n * Load all premium scripts\n */\n\nrequire(\"./google-ga-ua-eec__premium_only\")\nrequire(\"./google-ga-4-eec__premium_only\")\nrequire(\"./tiktok__premium_only\")\nrequire(\"./snapchat__premium_only\")\nrequire(\"./pinterest__premium_only\")\nrequire(\"./facebook__premium_only\")\nrequire(\"./microsoft-ads__premium_only.js\")\nrequire(\"./twitter__premium_only.js\")\nrequire(\"./google-ads__premium_only.js\")\n\n\n/**\n * Execute the wpm loader. It makes sure that the script flow gets exectuded correctly, no matter how JS \"optimizers\" shuffle the code.\n */\n\nrequire(\"./wpm-loader\")\n\n\n// console.log('WooCommerce Pixel Manager premium version')\n\n\n"],"names":["wpm","$","undefined","fBUserData","loadFacebookPixel","wpmDataLayer","pixels","facebook","pixel_id","loaded","f","window","b","document","e","fbq","n","callMethod","apply","arguments","queue","push","_fbq","version","t","createElement","async","src","s","getElementsByTagName","parentNode","insertBefore","console","error","getRandomEventId","Math","random","toString","substring","getFbUserData","getFbUserDataFromBrowser","setFbUserData","fbp","getCookie","fbc","client_user_agent","navigator","userAgent","fbViewContent","product","eventId","content_type","content_name","name","content_ids","dyn_r_ids","dynamic_remarketing","id_type","currency","shop","value","price","eventID","jQuery","trigger","event_name","event_id","user_data","product_data","product_id","event_source_url","location","href","facebookContentIds","prodIds","key","item","Object","entries","order","items","general","variationsOutput","variation_id","String","products","id","on","canIFire","event","parseFloat","quantity","value_filtered","setFacebookIdentifiersOnServer","data","action","nonce","sessionStorage","getItem","ajax","type","dataType","url","ajax_url","success","response","setItem","JSON","stringify","content_category","category","eventData","capi","msg","indexOf","page_type","conversionIdentifiers","getGoogleAdsConversionIdentifiersWithLabel","google","ads","conversionIds","getGoogleAdsConversionIdentifiers","getGoogleAdsRegularOrderItems","orderItems","orderItem","getGoogleAdsDynamicRemarketingOrderItems","google_business_vertical","isEmptyObject","status","googleConfigConditionsMet","isVariable","send_events_with_parent_ids","gtagLoaded","then","gtag","send_to","data_basic","data_with_cart","transaction_id","number","new_customer","aw_merchant_id","discount","aw_feed_country","aw_feed_language","getCartItemsGa4","productId","cart","productItems","item_id","analytics","item_name","item_brand","brand","item_variant","variant","getFormattedGA4Categories","eec","ga4","measurement_id","index","list_position","item_list_name","list_name","item_list_id","list_id","cartValue","toFixed","position","search_term","getSearchTermFromUrl","getGA4OrderItems","item_category","join","variant_name","mp_active","affiliation","value_regular","tax","shipping","coupon","getCartItemsGaUa","universal","property_id","checkout_step","step","checkout_option","getGAUAOrderItems","load_google_optimize_pixel","optimize","container_id","loadScriptAndCacheIt","consent_mode","active","getConsentValues","mode","categories","includes","getVisitorConsentStatusAndUpdateGoogleConsentSettings","google_consent_settings","analytics_storage","ad_storage","updateGoogleConsentMode","cookie_consent_mgmt","explicit_consent","fireGtagGoogleAds","state","enhanced_conversions","phone_conversion_label","phone_conversion_number","keys","enhanced_conversion_data","fireGtagGoogleAnalyticsUA","parameters","fireGtagGoogleAnalyticsGA4","isGoogleActive","getGoogleGtagId","loadGoogle","done","script","textStatus","dataLayer","wait_for_update","region","ads_data_redaction","url_passthrough","linker","settings","Date","canGoogleLoad","Promise","resolve","reject","startTime","wait","setTimeout","Array","from","Set","isArray","length","max","i","setGoogleCidOnServer","targetIDs","clientID","target_ids","client_id","referrer","getReferrerFromCookie","gclid","getClidFromBrowser","getUserAgent","viewPortWidth","getViewPort","width","viewPortHeight","height","forEach","targetId","setCookie","parse","load_hotjar_pixel","hotjar","site_id","h","o","j","a","r","hj","q","_hjSettings","hjid","hjsv","appendChild","load_bing_pixel","bing","uet_tag_id","uetq","w","d","u","ti","UET","onload","onreadystatechange","this","readyState","bing_purchase_ecomm_prodids","bing_purchase_items","ecomm_pagetype","ecomm_prodid","revenue_value","getPinterestProductData","isVariation","product_name","product_variant_id","pinterest","parentId_dyn_r_ids","product_category","product_variant","product_price","product_quantity","product_brand","pinterestFormattedOrderItems","loadPinterestPixel","pintrk","prototype","slice","call","pinterestLoadEvent","userLoggedIn","enhanced_match","em","enhanced_match_email","line_items","productData","urlParams","URLSearchParams","search","search_query","get","order_quantity","order_id","snapchatGetEmail","userInfo","user","email_sha256","user_hashed_email","loadSnapchatPixel","snapchat","snaptr","handleRequest","getSnapchatOrderItemIds","contentIds","item_ids","loadTikTokPixel","tiktok","TiktokAnalyticsObject","ttq","methods","setAndDefer","concat","instance","_i","load","_u","_t","_o","page","track","getTikTokOrderItemIds","content_id","purchase_event_name","contents","loadTwitterPixel","twitter","twq","exe","twitterGetOrderContentIds","num_items","wpmDataLayerExists","pageLoaded","wpmDeduper","wpmRestSettings","checkCookie","emailSelected","paymentMethodSelected","useRestEndpoint","isSessionStorageAvailable","isRestEndpointAvailable","isBelowRestErrorThreshold","testEndpoint","protocol","host","cookieName","timeout","statusCode","isWpmRestEndpointAvailable","writeOrderIdToStorage","orderId","Storage","localStorage","ids","expiresDate","setDate","getDate","cookie","toUTCString","storeOrderIdOnServer","orderDeduplication","isOrderIdStored","log","isEmail","email","test","removeProductFromCart","quantityToRemove","Error","getIdBasedOndVariationsOutputSetting","getProductDetailsFormattedForEvent","parentId","addProductToCart","getCartItemsFromBackend","getCartItems","saveCartObjectToDataLayer","cartItems","getProductsFromBackend","productIds","filter","hasOwnProperty","assign","cartObject","fireCheckoutOption","fireCheckoutProgress","getPostIdFromString","string","match","triggerViewItemList","getProductDataForViewItemEvent","getMainProductIdFromProductPage","product_type","viewItemListTriggerTestMode","target","css","append","find","viewItemListTrigger","opacity","backgroundColor","io","ioTimeouts","observerCallback","observer","entry","elementId","next","isIntersecting","testMode","repeat","unobserve","clearTimeout","remove","allIoElementsToWatch","ioid","startIntersectionObserverToWatch","urlHasParameter","IntersectionObserver","threshold","map","elem","parent","hasClass","prev","closest","each","observe","startProductsMutationObserverToWatch","productsNode","parents","has","first","productsMutationObserver","attributes","childList","characterData","MutationObserver","mutations","mutation","newNodes","addedNodes","hasWpmProductIdElement","siblings","cookieValue","expiryDays","setTime","getTime","expires","ca","decodeURIComponent","split","c","charAt","getWpmSessionData","setWpmSessionData","getProductIdByCartItemKeyUrl","cartItemKey","cartItemKeys","getAddToCartLinkProductIds","attr","matches","setReferrerToCookie","clidCookieId","clidId","dclid","documentElement","clientWidth","innerWidth","clientHeight","innerHeight","getComplianzCookies","cmplz_statistics","cmplz_marketing","visitorHasChosen","getCookieLawInfoCookies","analyticsCookie","adsCookie","wpmConsentValues","setConsentValueCategories","updateConsentCookieValues","explicitConsent","decodeURI","consents","statistics","marketing","thirdparty","advanced","setConsentDefaultValuesToExplicit","pixelName","canIFireMode","scriptTagObserver","node","shouldScriptBeActive","unblockScript","blockScript","head","subtree","addEventListener","disconnect","some","element","scriptNode","removeAttach","wpmSrc","appendTo","removeAttr","unblockAllScripts","unblockSelectedPixels","Cookiebot","consent","detail","huObserver","hu","body","options","extend","cache","getOrderItemPrice","total","total_tax","hasLoginEventFired","loginEventFired","setLoginEventFired","waitForVar","pageReady","isMiniCartActive","doesWooCommerceCartExist","parameter","URL","Number","val","classes","one","nextAll","variation","referrerHostname","hostname","wpmLoadFired","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","exports","module","__webpack_modules__","require"],"sourceRoot":""}
js/public/wpm.js ADDED
@@ -0,0 +1,1938 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Create a wpm namespace under which all functions are declared
3
+ */
4
+
5
+ // https://stackoverflow.com/a/5947280/4688612
6
+ (function (wpm, $, undefined) {
7
+
8
+ const wpmDeduper = {
9
+ keyName : "_wpm_order_ids",
10
+ cookieExpiresDays: 365,
11
+ }
12
+
13
+ const wpmRestSettings = {
14
+ // cookiesAvailable : '_wpm_cookies_are_available',
15
+ cookieWpmRestEndpointAvailable: "_wpm_endpoint_available",
16
+ restEndpoint : "/wp-json/",
17
+ restFails : 0,
18
+ restFailsThreshold : 10,
19
+ }
20
+
21
+ wpm.emailSelected = false
22
+ wpm.paymentMethodSelected = false
23
+
24
+ // wpm.checkIfCookiesAvailable = function () {
25
+ //
26
+ // // read the cookie if previously set, if it is return true, otherwise continue
27
+ // if (wpm.getCookie(wpmRestSettings.cookiesAvailable)) {
28
+ // return true;
29
+ // }
30
+ //
31
+ // // set the cookie for the session
32
+ // Cookies.set(wpmRestSettings.cookiesAvailable, true);
33
+ //
34
+ // // read cookie, true if ok, false if not ok
35
+ // return !!wpm.getCookie(wpmRestSettings.cookiesAvailable);
36
+ // }
37
+
38
+ wpm.useRestEndpoint = function () {
39
+
40
+ // only if sessionStorage is available
41
+
42
+ // only if REST API endpoint is generally accessible
43
+ // check in sessionStorage if we checked before and return answer
44
+ // otherwise check if the endpoint is available, save answer in sessionStorage and return answer
45
+
46
+ // only if not too many REST API errors happened
47
+
48
+ return wpm.isSessionStorageAvailable() &&
49
+ wpm.isRestEndpointAvailable() &&
50
+ wpm.isBelowRestErrorThreshold()
51
+ }
52
+
53
+ wpm.isBelowRestErrorThreshold = function () {
54
+ return window.sessionStorage.getItem(wpmRestSettings.restFails) <= wpmRestSettings.restFailsThreshold
55
+ }
56
+
57
+ wpm.isRestEndpointAvailable = function () {
58
+
59
+ if (window.sessionStorage.getItem(wpmRestSettings.cookieWpmRestEndpointAvailable)) {
60
+ return JSON.parse(window.sessionStorage.getItem(wpmRestSettings.cookieWpmRestEndpointAvailable))
61
+ } else {
62
+ // return wpm.testEndpoint();
63
+ // just set the value whenever possible in order not to wait or block the main thread
64
+ wpm.testEndpoint()
65
+ }
66
+ }
67
+
68
+ wpm.isSessionStorageAvailable = function () {
69
+
70
+ return !!window.sessionStorage
71
+ }
72
+
73
+ wpm.testEndpoint = function (
74
+ url = location.protocol + "//" + location.host + wpmRestSettings.restEndpoint,
75
+ cookieName = wpmRestSettings.cookieWpmRestEndpointAvailable,
76
+ ) {
77
+ // console.log('testing endpoint');
78
+
79
+ jQuery.ajax(url, {
80
+ type : "HEAD",
81
+ timeout: 1000,
82
+ // async: false,
83
+ statusCode: {
84
+ 200: function (response) {
85
+ // Cookies.set(cookieName, true);
86
+ // console.log('endpoint works');
87
+ window.sessionStorage.setItem(cookieName, JSON.stringify(true))
88
+ },
89
+ 404: function (response) {
90
+ // Cookies.set(cookieName, false);
91
+ // console.log('endpoint doesn\'t work');
92
+ window.sessionStorage.setItem(cookieName, JSON.stringify(false))
93
+ },
94
+ 0 : function (response) {
95
+ // Cookies.set(cookieName, false);
96
+ // console.log('endpoint doesn\'t work');
97
+ window.sessionStorage.setItem(cookieName, JSON.stringify(false))
98
+ },
99
+ },
100
+ }).then(r => {
101
+ // console.log('test done')
102
+ // console.log('result: ' + JSON.parse(window.sessionStorage.getItem(cookieName)));
103
+ // return JSON.parse(window.sessionStorage.getItem(cookieName));
104
+ })
105
+ }
106
+
107
+ wpm.isWpmRestEndpointAvailable = function (cookieName = wpmRestSettings.cookieWpmRestEndpointAvailable) {
108
+
109
+ return !!wpm.getCookie(cookieName)
110
+ }
111
+
112
+ wpm.writeOrderIdToStorage = function (orderId, expireDays = 365) {
113
+
114
+ // save the order ID in the browser storage
115
+
116
+ if (!window.Storage) {
117
+ let expiresDate = new Date()
118
+ expiresDate.setDate(expiresDate.getDate() + wpmDeduper.cookieExpiresDays)
119
+
120
+ let ids = []
121
+ if (checkCookie()) {
122
+ ids = JSON.parse(wpm.getCookie(wpmDeduper.keyName))
123
+ }
124
+
125
+ if (!ids.includes(orderId)) {
126
+ ids.push(orderId)
127
+ document.cookie = wpmDeduper.keyName + "=" + JSON.stringify(ids) + ";expires=" + expiresDate.toUTCString()
128
+ }
129
+
130
+ } else {
131
+ if (localStorage.getItem(wpmDeduper.keyName) === null) {
132
+ let ids = []
133
+ ids.push(orderId)
134
+ window.localStorage.setItem(wpmDeduper.keyName, JSON.stringify(ids))
135
+
136
+ } else {
137
+ let ids = JSON.parse(localStorage.getItem(wpmDeduper.keyName))
138
+ if (!ids.includes(orderId)) {
139
+ ids.push(orderId)
140
+ window.localStorage.setItem(wpmDeduper.keyName, JSON.stringify(ids))
141
+ }
142
+ }
143
+ }
144
+
145
+ if (typeof wpm.storeOrderIdOnServer === "function" && wpmDataLayer.orderDeduplication) {
146
+ wpm.storeOrderIdOnServer(orderId)
147
+ }
148
+ }
149
+
150
+ function checkCookie() {
151
+ let key = wpm.getCookie(wpmDeduper.keyName)
152
+ return key !== ""
153
+ }
154
+
155
+ wpm.isOrderIdStored = function (orderId) {
156
+
157
+ // console.log('deduper: ' + wpmDataLayer.orderDeduplication);
158
+ if (wpmDataLayer.orderDeduplication) {
159
+ // console.log('order deduplication: on');
160
+ if (!window.Storage) {
161
+
162
+ if (checkCookie()) {
163
+ let ids = JSON.parse(wpm.getCookie(wpmDeduper.keyName))
164
+ return ids.includes(orderId)
165
+ } else {
166
+ return false
167
+ }
168
+ } else {
169
+ if (localStorage.getItem(wpmDeduper.keyName) !== null) {
170
+ let ids = JSON.parse(localStorage.getItem(wpmDeduper.keyName))
171
+ return ids.includes(orderId)
172
+ } else {
173
+ return false
174
+ }
175
+ }
176
+ } else {
177
+ console.log("order duplication prevention: off")
178
+ return false
179
+ }
180
+ }
181
+
182
+ wpm.isEmail = function (email) {
183
+ // https://emailregex.com/
184
+ let regex = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/
185
+ return regex.test(email)
186
+ }
187
+
188
+ wpm.removeProductFromCart = function (productId, quantityToRemove = null) {
189
+ // console.log('product_id: ' + productId + ' | quantityToRemove: ' + quantityToRemove);
190
+
191
+ try {
192
+
193
+ if (!productId) throw Error("Wasn't able to retrieve a productId")
194
+
195
+ productId = getIdBasedOndVariationsOutputSetting(productId)
196
+
197
+ if (!productId) throw Error("Wasn't able to retrieve a productId")
198
+
199
+ let quantity
200
+
201
+ if (quantityToRemove == null) {
202
+ quantity = wpmDataLayer.cart[productId].quantity
203
+ } else {
204
+ quantity = quantityToRemove
205
+ }
206
+
207
+ // console.log('product_id: ' + productId + ' | qty: ' + quantity);
208
+ // console.log(productId);
209
+ // console.log(wpmDataLayer.cart);
210
+ // console.log(wpmDataLayer.cart[productId]);
211
+
212
+ if (wpmDataLayer.cart[productId]) {
213
+
214
+ // let product = {
215
+ // id : productId.toString(),
216
+ // dyn_r_ids: wpmDataLayer.cart[productId].dyn_r_ids,
217
+ // name : wpmDataLayer.cart[productId].name,
218
+ // // list_name: wpmDataLayer.shop.list_name, // doesn't make sense on mini_cart
219
+ // brand : wpmDataLayer.cart[productId].brand,
220
+ // category: wpmDataLayer.cart[productId].category,
221
+ // variant : wpmDataLayer.cart[productId].variant,
222
+ // // list_position: wpmDataLayer.cart[productId].position, // doesn't make sense on mini_cart
223
+ // quantity : quantity,
224
+ // price : wpmDataLayer.cart[productId].price,
225
+ // isVariation: wpmDataLayer.products[productId].isVariation,
226
+ // };
227
+ //
228
+ // if (product.isVariation) product['parentId_dyn_r_ids'] = wpmDataLayer.products[productId].parentId_dyn_r_ids;
229
+
230
+ let product = wpm.getProductDetailsFormattedForEvent(productId, quantity)
231
+
232
+ // console.log('removing');
233
+ // console.log(data);
234
+
235
+ jQuery(document).trigger("wpmRemoveFromCart", product)
236
+
237
+ if (quantityToRemove == null || wpmDataLayer.cart[productId].quantity === quantityToRemove) {
238
+ delete wpmDataLayer.cart[productId]
239
+ if (sessionStorage) sessionStorage.setItem("wpmDataLayerCart", JSON.stringify(wpmDataLayer.cart))
240
+ } else {
241
+ wpmDataLayer.cart[productId].quantity = wpmDataLayer.cart[productId].quantity - quantity
242
+ if (sessionStorage) sessionStorage.setItem("wpmDataLayerCart", JSON.stringify(wpmDataLayer.cart))
243
+ }
244
+ }
245
+ } catch (e) {
246
+ console.error(e)
247
+ // console.log('getting cart from back end');
248
+ // wpm.getCartItemsFromBackend();
249
+ // console.log('getting cart from back end done');
250
+
251
+ }
252
+ }
253
+
254
+ getIdBasedOndVariationsOutputSetting = function (productId) {
255
+
256
+ try {
257
+ if (wpmDataLayer?.general?.variationsOutput) {
258
+ // console.log('test');
259
+ return productId
260
+ } else {
261
+ if (wpmDataLayer.products[productId].isVariation) {
262
+ return wpmDataLayer.products[productId].parentId
263
+ } else {
264
+ return productId
265
+ }
266
+ }
267
+ } catch (e) {
268
+ console.error(e)
269
+ }
270
+ }
271
+
272
+ // add_to_cart
273
+ wpm.addProductToCart = function (productId, quantity) {
274
+
275
+ try {
276
+ // console.log('productId: ' + productId + ' | qty: ' + quantity);
277
+ // console.log('productId: ' + productId + ' | variationId: ' + variationId + ' | qty: ' + quantity);
278
+
279
+ if (!productId) throw Error("Wasn't able to retrieve a productId")
280
+
281
+ productId = getIdBasedOndVariationsOutputSetting(productId)
282
+
283
+ if (!productId) throw Error("Wasn't able to retrieve a productId")
284
+
285
+ if (wpmDataLayer?.products[productId]) {
286
+
287
+ let product = wpm.getProductDetailsFormattedForEvent(productId, quantity)
288
+
289
+ // console.log(productId)
290
+ // console.log(wpmDataLayer.cart)
291
+
292
+ jQuery(document).trigger("wpmAddToCart", product)
293
+
294
+ // add product to cart wpmDataLayer['cart']
295
+
296
+ // if the product already exists in the object, only add the additional quantity
297
+ // otherwise create that product object in the wpmDataLayer['cart']
298
+ if (wpmDataLayer?.cart[productId]) {
299
+ wpmDataLayer.cart[productId].quantity = wpmDataLayer.cart[productId].quantity + quantity
300
+ } else {
301
+
302
+ if (!("cart" in wpmDataLayer)) wpmDataLayer.cart = {}
303
+ wpmDataLayer.cart[productId] = wpm.getProductDetailsFormattedForEvent(productId, quantity)
304
+ }
305
+
306
+ if (sessionStorage) sessionStorage.setItem("wpmDataLayerCart", JSON.stringify(wpmDataLayer.cart))
307
+ }
308
+ } catch (e) {
309
+ console.error(e)
310
+
311
+ // fallback if wpmDataLayer.cart and wpmDataLayer.products got out of sync in case cart caching has an issue
312
+ wpm.getCartItemsFromBackend()
313
+ }
314
+ }
315
+
316
+ wpm.getCartItems = function () {
317
+
318
+ // console.log('get cart items');
319
+
320
+ if (sessionStorage) {
321
+ if (!sessionStorage.getItem("wpmDataLayerCart") || wpmDataLayer.shop.page_type === "order_received_page") {
322
+ sessionStorage.setItem("wpmDataLayerCart", JSON.stringify({}))
323
+ } else {
324
+ wpm.saveCartObjectToDataLayer(JSON.parse(sessionStorage.getItem("wpmDataLayerCart")))
325
+ }
326
+ } else {
327
+ wpm.getCartItemsFromBackend()
328
+ }
329
+ }
330
+
331
+ // get all cart items from the backend
332
+ wpm.getCartItemsFromBackend = function () {
333
+ try {
334
+ let data = {
335
+ action: "wpm_get_cart_items",
336
+ }
337
+
338
+ jQuery.ajax(
339
+ {
340
+ type : "get",
341
+ dataType: "json",
342
+ // url : ajax_object.ajax_url,
343
+ url : wpm.ajax_url,
344
+ data : data,
345
+ success: function (cartItems) {
346
+
347
+ // save all cart items into wpmDataLayer
348
+
349
+ if (!cartItems["cart"]) cartItems["cart"] = {}
350
+
351
+ wpm.saveCartObjectToDataLayer(cartItems["cart"])
352
+ if (sessionStorage) sessionStorage.setItem("wpmDataLayerCart", JSON.stringify(cartItems["cart"]))
353
+ },
354
+ })
355
+ } catch (e) {
356
+ console.error(e)
357
+ }
358
+ }
359
+
360
+ wpm.getProductsFromBackend = function (productIds) {
361
+ // console.log('getting pids from back-end: ' + productIds)
362
+ // get productIds from the backend
363
+
364
+ // reduce productIds by products already in the dataLayer
365
+ productIds = productIds.filter(item => !wpmDataLayer.products.hasOwnProperty(item))
366
+
367
+ // if no products IDs are in the object, don't try to get anything from the server
368
+ if (!productIds || productIds.length === 0) return
369
+
370
+ try {
371
+ let data = {
372
+ action : "wpm_get_product_ids",
373
+ productIds: productIds,
374
+ }
375
+
376
+ jQuery.ajax(
377
+ {
378
+ type : "get",
379
+ dataType: "json",
380
+ // url : ajax_object.ajax_url,
381
+ url : wpm.ajax_url,
382
+ data : data,
383
+ success: function (products) {
384
+
385
+ // merge products into wpmDataLayer.products
386
+ wpmDataLayer.products = Object.assign({}, wpmDataLayer.products, products)
387
+ },
388
+ error : function (response) {
389
+ console.log(response)
390
+ },
391
+ })
392
+ } catch (e) {
393
+ console.error(e)
394
+ }
395
+ }
396
+
397
+ wpm.saveCartObjectToDataLayer = function (cartObject) {
398
+ wpmDataLayer.cart = cartObject
399
+ wpmDataLayer.products = Object.assign({}, wpmDataLayer.products, cartObject)
400
+ }
401
+
402
+ wpm.fireCheckoutOption = function (step, checkout_option = null, value = null) {
403
+
404
+ let data = {
405
+ step : step,
406
+ checkout_option: checkout_option,
407
+ value : value,
408
+ }
409
+
410
+ jQuery(document).trigger("wpmFireCheckoutOption", data)
411
+ }
412
+
413
+ wpm.fireCheckoutProgress = function (step) {
414
+
415
+ let data = {
416
+ step: step,
417
+ }
418
+
419
+ jQuery(document).trigger("wpmFireCheckoutProgress", data)
420
+ }
421
+
422
+ wpm.getPostIdFromString = function (string) {
423
+ // console.log(string);
424
+ try {
425
+ return string.match(/(post-)(\d+)/)[2]
426
+ } catch (e) {
427
+ console.error(e)
428
+ }
429
+ }
430
+
431
+ wpm.triggerViewItemList = function (productId) {
432
+
433
+ // productId = null;
434
+
435
+ if (!productId) throw Error("Wasn't able to retrieve a productId")
436
+
437
+ productId = getIdBasedOndVariationsOutputSetting(productId)
438
+
439
+ if (!productId) throw Error("Wasn't able to retrieve a productId")
440
+
441
+ jQuery(document).trigger("wpmViewItemList", wpm.getProductDataForViewItemEvent(productId))
442
+ }
443
+
444
+ wpm.getProductDataForViewItemEvent = function (productId) {
445
+
446
+ if (!productId) throw Error("Wasn't able to retrieve a productId")
447
+
448
+ try {
449
+ if (wpmDataLayer.products[productId]) {
450
+
451
+ return wpm.getProductDetailsFormattedForEvent(productId)
452
+ }
453
+ } catch (e) {
454
+ console.error(e)
455
+ }
456
+ }
457
+ wpm.getMainProductIdFromProductPage = function () {
458
+ try {
459
+ if (["simple", "variable", "grouped", "composite", "bundle"].indexOf(wpmDataLayer.shop.product_type) >= 0) {
460
+ return jQuery(".wpmProductId:first").data("id")
461
+ } else {
462
+ return false
463
+ }
464
+ } catch (e) {
465
+ console.error(e)
466
+ }
467
+ }
468
+
469
+ wpm.viewItemListTriggerTestMode = function (target) {
470
+
471
+ jQuery(target).css({"position": "relative"})
472
+ jQuery(target).append("<div id=\"viewItemListTriggerOverlay\"></div>")
473
+ jQuery(target).find("#viewItemListTriggerOverlay").css({
474
+ "z-index" : "10",
475
+ "display" : "block",
476
+ "position" : "absolute",
477
+ "height" : "100%",
478
+ "top" : "0",
479
+ "left" : "0",
480
+ "right" : "0",
481
+ "opacity" : wpmDataLayer.viewItemListTrigger.opacity,
482
+ "background-color": wpmDataLayer.viewItemListTrigger.backgroundColor,
483
+ })
484
+ }
485
+
486
+ wpm.getSearchTermFromUrl = function () {
487
+ try {
488
+ let urlParameters = new URLSearchParams(window.location.search)
489
+ return urlParameters.get("s")
490
+ } catch (e) {
491
+ console.error(e)
492
+ }
493
+ }
494
+
495
+ // we need this to track timeouts for intersection observers
496
+ let ioTimeouts = {}
497
+
498
+ wpm.observerCallback = function (entries, observer) {
499
+
500
+ entries.forEach((entry) => {
501
+
502
+ try {
503
+ let productId
504
+
505
+ let elementId = jQuery(entry.target).data("ioid")
506
+
507
+ // Get the productId from next element, if wpmProductId is a sibling, like in Gutenberg blocks
508
+ // otherwise go search in children, like in regular WC loop items
509
+ if (jQuery(entry.target).next(".wpmProductId").length) {
510
+ // console.log('test 1');
511
+ productId = jQuery(entry.target).next(".wpmProductId").data("id")
512
+ } else {
513
+ productId = jQuery(entry.target).find(".wpmProductId").data("id")
514
+ }
515
+
516
+ // productId = null;
517
+
518
+ if (!productId) throw Error("wpmProductId element not found")
519
+
520
+ if (entry.isIntersecting) {
521
+
522
+ // console.log('prodid: ' + productId);
523
+ ioTimeouts[elementId] = setTimeout(() => {
524
+ // console.log('prodid: ' + productId);
525
+ wpm.triggerViewItemList(productId)
526
+ if (wpmDataLayer.viewItemListTrigger.testMode) wpm.viewItemListTriggerTestMode(entry.target)
527
+ if (wpmDataLayer.viewItemListTrigger.repeat === false) observer.unobserve(entry.target)
528
+ }, wpmDataLayer.viewItemListTrigger.timeout)
529
+
530
+ } else {
531
+
532
+ clearTimeout(ioTimeouts[elementId])
533
+ if (wpmDataLayer.viewItemListTrigger.testMode) jQuery(entry.target).find("#viewItemListTriggerOverlay").remove()
534
+ }
535
+ } catch (e) {
536
+ console.error(e)
537
+ }
538
+ })
539
+ }
540
+
541
+ // fire view_item_list only on products that have become visible
542
+ let io
543
+ let ioid = 0
544
+ let allIoElementsToWatch
545
+
546
+ let getAllElementsToWatch = function () {
547
+
548
+ allIoElementsToWatch = jQuery(".wpmProductId")
549
+ .map(function (i, elem) {
550
+ // console.log(elem);
551
+ if (
552
+ jQuery(elem).parent().hasClass("type-product") ||
553
+ jQuery(elem).parent().hasClass("product") ||
554
+ jQuery(elem).parent().hasClass("product-item-inner")
555
+ ) {
556
+ // console.log(elem);
557
+ return jQuery(elem).parent()
558
+ } else if (
559
+ jQuery(elem).prev().hasClass("wc-block-grid__product") ||
560
+ jQuery(elem).prev().hasClass("product") ||
561
+ jQuery(elem).prev().hasClass("product-small") ||
562
+ jQuery(elem).prev().hasClass("woocommerce-LoopProduct-link")
563
+ ) {
564
+ return jQuery(this).prev()
565
+ } else if (jQuery(elem).closest(".product").length) {
566
+ return jQuery(elem).closest(".product")
567
+ }
568
+ })
569
+ }
570
+
571
+ wpm.startIntersectionObserverToWatch = function () {
572
+
573
+ try {
574
+ // enable view_item_list test mode from browser
575
+ if (wpm.urlHasParameter("vildemomode")) wpmDataLayer.viewItemListTrigger.testMode = true
576
+
577
+ // set up intersection observer
578
+ io = new IntersectionObserver(wpm.observerCallback, {
579
+ threshold: wpmDataLayer.viewItemListTrigger.threshold,
580
+ })
581
+
582
+ getAllElementsToWatch()
583
+
584
+ // console.log(allElementsToWatch);
585
+
586
+ allIoElementsToWatch.each(function (i, elem) {
587
+ // console.log(elem[0]);
588
+ // jQuery(elem[0]).attr('data-ioid', ioid++);
589
+ jQuery(elem[0]).data("ioid", ioid++)
590
+
591
+ io.observe(elem[0])
592
+ })
593
+ } catch (e) {
594
+ console.error(e)
595
+ }
596
+ }
597
+
598
+ // watch DOM for new lazy loaded products and add them to the intersection observer
599
+ wpm.startProductsMutationObserverToWatch = function () {
600
+
601
+ try {
602
+ // Pass in the target node, as well as the observer options
603
+
604
+ // selects the most common parent node
605
+ // https://stackoverflow.com/a/7648323/4688612
606
+ let productsNode = jQuery(".wpmProductId:eq(0)").parents().has(jQuery(".wpmProductId:eq(1)").parents()).first()
607
+
608
+ if (productsNode.length) {
609
+ productsMutationObserver.observe(productsNode[0], {
610
+ attributes : true,
611
+ childList : true,
612
+ characterData: true,
613
+ })
614
+ }
615
+ } catch (e) {
616
+ console.error(e)
617
+ }
618
+ }
619
+
620
+ // Create an observer instance
621
+ let productsMutationObserver = new MutationObserver(function (mutations) {
622
+
623
+ mutations.forEach(function (mutation) {
624
+ let newNodes = mutation.addedNodes // DOM NodeList
625
+ if (newNodes !== null) { // If there are new nodes added
626
+ let nodes = jQuery(newNodes) // jQuery set
627
+ nodes.each(function () {
628
+ if (
629
+ jQuery(this).hasClass("type-product") ||
630
+ jQuery(this).hasClass("product-small") ||
631
+ jQuery(this).hasClass("wc-block-grid__product")
632
+ ) {
633
+ // check if the node has a child or sibling wpmProductId
634
+ // if yes add it to the intersectionObserver
635
+ if (hasWpmProductIdElement(this)) {
636
+ jQuery(this).data("ioid", ioid++)
637
+ io.observe(this)
638
+ }
639
+ }
640
+ })
641
+ }
642
+ })
643
+ })
644
+
645
+ let hasWpmProductIdElement = function (elem) {
646
+ return !!(jQuery(elem).find(".wpmProductId").length ||
647
+ jQuery(elem).siblings(".wpmProductId").length)
648
+ }
649
+
650
+ wpm.setCookie = function (cookieName, cookieValue = "", expiryDays = null) {
651
+ if (expiryDays) {
652
+ let d = new Date()
653
+ d.setTime(d.getTime() + (expiryDays * 24 * 60 * 60 * 1000))
654
+ let expires = "expires=" + d.toUTCString()
655
+ document.cookie = cookieName + "=" + cookieValue + ";" + expires + ";path=/"
656
+ } else {
657
+ document.cookie = cookieName + "=" + cookieValue + ";path=/"
658
+ }
659
+ }
660
+
661
+ wpm.getCookie = function (cookieName) {
662
+ let name = cookieName + "="
663
+ let decodedCookie = decodeURIComponent(document.cookie)
664
+ let ca = decodedCookie.split(";")
665
+ for (let i = 0; i < ca.length; i++) {
666
+ let c = ca[i]
667
+ while (c.charAt(0) == " ") {
668
+ c = c.substring(1)
669
+ }
670
+ if (c.indexOf(name) == 0) {
671
+ return c.substring(name.length, c.length)
672
+ }
673
+ }
674
+ return ""
675
+ }
676
+
677
+ wpm.getWpmSessionData = function () {
678
+ if (window.sessionStorage) {
679
+
680
+ let data = window.sessionStorage.getItem("_wpm")
681
+ if (data !== null) {
682
+ return JSON.parse(data)
683
+ } else {
684
+ return {}
685
+ }
686
+ } else {
687
+ return {}
688
+ }
689
+ }
690
+
691
+ wpm.setWpmSessionData = function (data) {
692
+ if (window.sessionStorage) {
693
+ window.sessionStorage.setItem("_wpm", JSON.stringify(data))
694
+ }
695
+ }
696
+
697
+ wpm.storeOrderIdOnServer = function (orderId) {
698
+
699
+ // console.log('saving wpm_purchase_pixels_fired');
700
+
701
+ // console.log('url: ' + wpm_premium_only_ajax_object.ajax_url);
702
+ // console.log('nonce: ' + wpm_premium_only_ajax_object.nonce);
703
+ // console.log('url: ' + wpm.ajax_url);
704
+ // console.log('nonce: ' + wpm.nonce);
705
+
706
+ try {
707
+ // save the state in the database
708
+ let data = {
709
+ action : "wpm_purchase_pixels_fired",
710
+ order_id: orderId,
711
+ // nonce : ajax_object.nonce,
712
+ nonce: wpm.nonce,
713
+ }
714
+
715
+ jQuery.ajax(
716
+ {
717
+ type : "post",
718
+ dataType: "json",
719
+ // url : ajax_object.ajax_url,
720
+ url : wpm.ajax_url,
721
+ data : data,
722
+ success: function (response) {
723
+ if (response.success === false) {
724
+ console.log(response)
725
+ }
726
+ },
727
+ error : function (response) {
728
+ console.log(response)
729
+ },
730
+ })
731
+ } catch (e) {
732
+ console.error(e)
733
+ }
734
+ }
735
+
736
+ wpm.getProductIdByCartItemKeyUrl = function (url) {
737
+ let searchParams = new URLSearchParams(url.search)
738
+ let cartItemKey = searchParams.get("remove_item")
739
+
740
+ let productId
741
+
742
+ if (wpmDataLayer.cartItemKeys[cartItemKey]["variation_id"] === 0) {
743
+ productId = wpmDataLayer.cartItemKeys[cartItemKey]["product_id"]
744
+ } else {
745
+ productId = wpmDataLayer.cartItemKeys[cartItemKey]["variation_id"]
746
+ }
747
+
748
+ return productId
749
+ }
750
+
751
+ wpm.getAddToCartLinkProductIds = function () {
752
+ return jQuery("a").map(function () {
753
+ let href = jQuery(this).attr("href")
754
+
755
+ if (href && href.includes("?add-to-cart=")) {
756
+ let matches = href.match(/(add-to-cart=)(\d+)/)
757
+ if (matches) return matches[2]
758
+ }
759
+ }).get()
760
+ }
761
+
762
+ wpm.getProductDetailsFormattedForEvent = function (productId, quantity = 1) {
763
+
764
+ // console.log(wpmDataLayer.products[productId].dyn_r_ids)
765
+
766
+ let product = {
767
+ id : productId.toString(),
768
+ dyn_r_ids : wpmDataLayer.products[productId].dyn_r_ids,
769
+ name : wpmDataLayer.products[productId].name,
770
+ list_name : wpmDataLayer.shop.list_name,
771
+ brand : wpmDataLayer.products[productId].brand,
772
+ category : wpmDataLayer.products[productId].category,
773
+ variant : wpmDataLayer.products[productId].variant,
774
+ list_position: wpmDataLayer.products[productId].position,
775
+ quantity : quantity,
776
+ price : wpmDataLayer.products[productId].price,
777
+ currency : wpmDataLayer.shop.currency,
778
+ isVariable : wpmDataLayer.products[productId].isVariable,
779
+ isVariation : wpmDataLayer.products[productId].isVariation,
780
+ parentId : wpmDataLayer.products[productId].parentId,
781
+ }
782
+
783
+ if (product.isVariation) product["parentId_dyn_r_ids"] = wpmDataLayer.products[productId].parentId_dyn_r_ids
784
+
785
+ return product
786
+ }
787
+
788
+ wpm.setReferrerToCookie = function () {
789
+ // can't use session storage as we can't read it from the server
790
+ if (!wpm.getCookie("wpmReferrer")) {
791
+ wpm.setCookie("wpmReferrer", document.referrer)
792
+ }
793
+ }
794
+
795
+ wpm.getReferrerFromCookie = function () {
796
+ if (wpm.getCookie("wpmReferrer")) {
797
+ return wpm.getCookie("wpmReferrer")
798
+ } else {
799
+ return null
800
+ }
801
+ }
802
+
803
+ wpm.getClidFromBrowser = function (clidId = "gclid") {
804
+
805
+ let clidCookieId
806
+
807
+ clidCookieId = {
808
+ gclid: "_gcl_aw",
809
+ dclid: "_gcl_dc",
810
+ }
811
+
812
+ if (wpm.getCookie(clidCookieId[clidId])) {
813
+ let clidCookie = wpm.getCookie(clidCookieId[clidId])
814
+ let matches = clidCookie.match(/(GCL.[\d]*.)(.*)/)
815
+ return matches[2]
816
+ } else {
817
+ return ""
818
+ }
819
+ }
820
+
821
+ wpm.getUserAgent = function () {
822
+ return navigator.userAgent
823
+ }
824
+
825
+ wpm.getViewPort = function () {
826
+ return {
827
+ width : Math.max(document.documentElement.clientWidth || 0, window.innerWidth || 0),
828
+ height: Math.max(document.documentElement.clientHeight || 0, window.innerHeight || 0),
829
+ }
830
+ }
831
+
832
+ /*
833
+ * Handle Cookie Management Platforms
834
+ * */
835
+
836
+ let getComplianzCookies = function () {
837
+
838
+ let cmplz_statistics = wpm.getCookie("cmplz_statistics")
839
+ let cmplz_marketing = wpm.getCookie("cmplz_marketing")
840
+ let cmplz_consent_status = wpm.getCookie("cmplz_consent_status") || wpm.getCookie("cmplz_banner-status")
841
+
842
+
843
+ if (cmplz_consent_status) {
844
+ return {
845
+ analytics : cmplz_statistics === "allow",
846
+ ads : cmplz_marketing === "allow",
847
+ visitorHasChosen: true,
848
+ }
849
+ } else {
850
+ return false
851
+ }
852
+ }
853
+
854
+ let getCookieLawInfoCookies = function () {
855
+
856
+ let analyticsCookie = wpm.getCookie("cookielawinfo-checkbox-analytics") || wpm.getCookie("cookielawinfo-checkbox-analytiques")
857
+ let adsCookie = wpm.getCookie("cookielawinfo-checkbox-advertisement") || wpm.getCookie("cookielawinfo-checkbox-publicite")
858
+ let visitorHasChosen = wpm.getCookie("CookieLawInfoConsent")
859
+
860
+ if (analyticsCookie || adsCookie) {
861
+
862
+ return {
863
+ analytics : analyticsCookie === "yes",
864
+ ads : adsCookie === "yes",
865
+ visitorHasChosen: !!visitorHasChosen,
866
+ }
867
+ } else {
868
+ return false
869
+ }
870
+ }
871
+
872
+
873
+ let
874
+ wpmConsentValues = {}
875
+ wpmConsentValues.categories = {}
876
+ wpmConsentValues.pixels = []
877
+ wpmConsentValues.mode = "category"
878
+ wpmConsentValues.visitorHasChosen = false
879
+
880
+ wpm.getConsentValues = function () {
881
+ return wpmConsentValues
882
+ }
883
+
884
+ wpm.setConsentValueCategories = function (analytics = false, ads = false) {
885
+ wpmConsentValues.categories.analytics = analytics
886
+ wpmConsentValues.categories.ads = ads
887
+ }
888
+
889
+ wpm.updateConsentCookieValues = function (explicitConsent = false) {
890
+
891
+ // ad_storage
892
+ // analytics_storage
893
+ // functionality_storage
894
+ // personalization_storage
895
+ // security_storage
896
+
897
+ // console.log('exp cons: ' + explicitConsent)
898
+
899
+ let cookie
900
+
901
+ if (cookie = wpm.getCookie("CookieConsent")) {
902
+ // Cookiebot
903
+ // https://wordpress.org/plugins/cookiebot/
904
+ cookie = decodeURI(cookie)
905
+
906
+ // console.log(cookie.indexOf('statistics:true'))
907
+ // console.log(cookie.indexOf('marketing:true'))
908
+
909
+ wpmConsentValues.categories.analytics = cookie.indexOf("statistics:true") >= 0
910
+ wpmConsentValues.categories.ads = cookie.indexOf("marketing:true") >= 0
911
+ wpmConsentValues.visitorHasChosen = true
912
+
913
+ } else if (cookie = wpm.getCookie("CookieScriptConsent")) {
914
+ // Cookie Script
915
+ // https://wordpress.org/plugins/cookie-script-com/
916
+
917
+ cookie = JSON.parse(cookie)
918
+
919
+ // console.log(cookie)
920
+ // console.log(cookie.action)
921
+ // console.log('cat length: ' + cookie.categories.length)
922
+ // console.log(cookie.categories.indexOf('performance'))
923
+
924
+ if (cookie.action === "reject") {
925
+ wpmConsentValues.categories.analytics = false
926
+ wpmConsentValues.categories.ads = false
927
+ } else if (cookie.categories.length === 2) {
928
+ wpmConsentValues.categories.analytics = true
929
+ wpmConsentValues.categories.ads = true
930
+ } else {
931
+ wpmConsentValues.categories.analytics = cookie.categories.indexOf("performance") >= 0
932
+ wpmConsentValues.categories.ads = cookie.categories.indexOf("targeting") >= 0
933
+ }
934
+
935
+ wpmConsentValues.visitorHasChosen = true
936
+
937
+ // console.log(wpmConsentValues)
938
+
939
+ } else if (cookie = wpm.getCookie("borlabs-cookie")) {
940
+ // Borlabs Cookie
941
+ // https://borlabs.io/borlabs-cookie/
942
+
943
+ cookie = decodeURI(cookie)
944
+ cookie = JSON.parse(cookie)
945
+
946
+ wpmConsentValues.categories.analytics = !!cookie?.consents?.statistics
947
+ wpmConsentValues.categories.ads = !!cookie?.consents?.marketing
948
+ wpmConsentValues.visitorHasChosen = true
949
+ wpmConsentValues.pixels = [...cookie?.consents?.statistics || [], ...cookie?.consents?.marketing || []]
950
+ wpmConsentValues.mode = "pixel"
951
+
952
+ } else if (cookie = getComplianzCookies()) {
953
+ // Complianz Cookie
954
+ // https://wordpress.org/plugins/complianz-gdpr/
955
+
956
+ // console.log(cookie)
957
+
958
+ wpmConsentValues.categories.analytics = cookie.analytics === true
959
+ wpmConsentValues.categories.ads = cookie.ads === true
960
+ wpmConsentValues.visitorHasChosen = cookie.visitorHasChosen
961
+
962
+ // console.log(wpmConsentValues)
963
+
964
+ } else if (cookie = wpm.getCookie("cookie_notice_accepted")) {
965
+ // Cookie Compliance (free version)
966
+ // https://wordpress.org/plugins/cookie-notice/
967
+
968
+ wpmConsentValues.categories.analytics = true
969
+ wpmConsentValues.categories.ads = true
970
+ wpmConsentValues.visitorHasChosen = true
971
+
972
+ } else if (cookie = wpm.getCookie("hu-consent")) {
973
+ // Cookie Compliance (pro version)
974
+ // https://wordpress.org/plugins/cookie-notice/
975
+
976
+ cookie = JSON.parse(cookie)
977
+
978
+ wpmConsentValues.categories.analytics = !!cookie.categories["3"]
979
+ wpmConsentValues.categories.ads = !!cookie.categories["4"]
980
+ wpmConsentValues.visitorHasChosen = true
981
+
982
+ } else if (cookie = getCookieLawInfoCookies()) {
983
+ // CookieYes, GDPR Cookie Consent (Cookie Law Info)
984
+ // https://wordpress.org/plugins/cookie-law-info/
985
+
986
+ wpmConsentValues.categories.analytics = cookie.analytics === true
987
+ wpmConsentValues.categories.ads = cookie.ads === true
988
+ wpmConsentValues.visitorHasChosen = cookie.visitorHasChosen === true
989
+
990
+ } else if (cookie = wpm.getCookie("moove_gdpr_popup")) {
991
+ // GDPR Cookie Compliance Plugin by Moove Agency
992
+ // https://wordpress.org/plugins/gdpr-cookie-compliance/
993
+ // TODO write documentation on how to set up the plugin in order for this to work properly
994
+
995
+ cookie = JSON.parse(cookie)
996
+ // console.log('moove cookie thirdparty: ' + cookie.thirdparty)
997
+ // console.log('moove cookie advanced: ' + cookie.advanced)
998
+
999
+ wpmConsentValues.categories.analytics = cookie.thirdparty === "1"
1000
+ wpmConsentValues.categories.ads = cookie.advanced === "1"
1001
+ wpmConsentValues.visitorHasChosen = true
1002
+
1003
+ // console.log(wpmConsentValues)
1004
+
1005
+ } else {
1006
+ // consentValues.categories.analytics = true
1007
+ // consentValues.categories.ads = true
1008
+
1009
+ wpmConsentValues.categories.analytics = !explicitConsent
1010
+ wpmConsentValues.categories.ads = !explicitConsent
1011
+ }
1012
+ }
1013
+
1014
+ wpm.updateConsentCookieValues()
1015
+
1016
+ wpm.setConsentDefaultValuesToExplicit = function () {
1017
+ wpmConsentValues.categories = {
1018
+ analytics: false,
1019
+ ads : false,
1020
+ }
1021
+ }
1022
+
1023
+ wpm.canIFire = function (category, pixelName) {
1024
+
1025
+ let canIFireMode
1026
+
1027
+ if ("category" === wpmConsentValues.mode) {
1028
+ canIFireMode = !!wpmConsentValues.categories[category]
1029
+ } else if ("pixel" === wpmConsentValues.mode) {
1030
+ canIFireMode = wpmConsentValues.pixels.includes(pixelName)
1031
+ } else {
1032
+ console.error("Couldn't find a valid consent mode in wpmConsentValues")
1033
+ canIFireMode = false
1034
+ }
1035
+
1036
+ if (canIFireMode) {
1037
+ return true
1038
+ } else {
1039
+ if (wpm.urlHasParameter("debugConsentMode")) {
1040
+ if (wpmDataLayer?.shop?.cookie_consent_mgmt?.explicit_consent) {
1041
+ console.log("WooCommerce Pixel Manager: The \"" + pixelName + " (category: " + category + ")\" pixel has not fired because you have not given consent for it yet. (The shop is in explicit consent mode.)")
1042
+ } else {
1043
+ console.log("WooCommerce Pixel Manager: The \"" + pixelName + " (category: " + category + ")\" pixel has not fired because you have removed consent for this pixel. (The shop is in implicit consent mode.)")
1044
+ }
1045
+ }
1046
+
1047
+ return false
1048
+ }
1049
+ }
1050
+
1051
+ /**
1052
+ * Runs through each script in <head> and blocks / unblocks it according to the plugin settings
1053
+ * and user consent.
1054
+ */
1055
+
1056
+ // https://stackoverflow.com/q/65453565/4688612
1057
+ wpm.scriptTagObserver = new MutationObserver((mutations) => {
1058
+ mutations.forEach(({addedNodes}) => {
1059
+ [...addedNodes]
1060
+ .forEach(node => {
1061
+
1062
+ if ($(node).data("wpm-cookie-category")) {
1063
+
1064
+ // console.log(node)
1065
+
1066
+ // If the pixel category has been approved > unblock
1067
+ // If the pixel belongs to more than one category, then unblock if one of the categories has been approved
1068
+ // If no category has been approved, but the Google Consent Mode is active, then only unblock the Google scripts
1069
+
1070
+ if (wpm.shouldScriptBeActive(node)) {
1071
+ wpm.unblockScript(node)
1072
+ } else {
1073
+ wpm.blockScript(node)
1074
+ }
1075
+ }
1076
+ })
1077
+ })
1078
+ })
1079
+
1080
+ wpm.scriptTagObserver.observe(document.head, {childList: true, subtree: true})
1081
+ window.addEventListener("DOMContentLoaded", () => wpm.scriptTagObserver.disconnect())
1082
+
1083
+ wpm.shouldScriptBeActive = function (node) {
1084
+
1085
+ if (
1086
+ wpmDataLayer.shop.cookie_consent_mgmt.explicit_consent ||
1087
+ wpmConsentValues.visitorHasChosen
1088
+ ) {
1089
+
1090
+ if (wpmConsentValues.mode === "category" && $(node).data("wpm-cookie-category").split(",").some(element => wpmConsentValues.categories[element])) {
1091
+ return true
1092
+ } else if (wpmConsentValues.mode === "pixel" && wpmConsentValues.pixels.includes($(node).data("wpm-pixel-name"))) {
1093
+ return true
1094
+ } else if (wpmConsentValues.mode === "pixel" && $(node).data("wpm-pixel-name") === "google" && ["google-analytics", "google-ads"].some(element => wpmConsentValues.pixels.includes(element))) {
1095
+ return true
1096
+ } else if (wpmDataLayer?.pixels?.google?.consent_mode?.active && $(node).data("wpm-pixel-name") === "google") {
1097
+ return true
1098
+ } else {
1099
+ return false
1100
+ }
1101
+ } else {
1102
+ return true
1103
+ }
1104
+ }
1105
+
1106
+
1107
+ wpm.unblockScript = function (scriptNode, removeAttach = false) {
1108
+
1109
+ if (removeAttach) $(scriptNode).remove()
1110
+
1111
+ let wpmSrc = $(scriptNode).data("wpm-src")
1112
+ if (wpmSrc) $(scriptNode).attr("src", wpmSrc)
1113
+
1114
+ scriptNode.type = "text/javascript"
1115
+
1116
+ if (removeAttach) $(scriptNode).appendTo("head")
1117
+
1118
+ jQuery(document).trigger("wpmPreLoadPixels", {})
1119
+ }
1120
+
1121
+ wpm.blockScript = function (scriptNode, removeAttach = false) {
1122
+
1123
+ if (removeAttach) $(scriptNode).remove()
1124
+
1125
+ if ($(scriptNode).attr("src")) $(scriptNode).removeAttr("src")
1126
+ scriptNode.type = "blocked/javascript"
1127
+
1128
+ if (removeAttach) $(scriptNode).appendTo("head")
1129
+ }
1130
+
1131
+ wpm.unblockAllScripts = function (analytics = true, ads = true) {
1132
+ // console.log('unblocking all scripts')
1133
+
1134
+ $.each(
1135
+ $("script[type=\"blocked/javascript\"]"), function (index, scriptNode) {
1136
+
1137
+ if ($(scriptNode).data("wpm-cookie-category").includes("analytics") && analytics) {
1138
+ wpm.unblockScript(scriptNode, true)
1139
+ } else if ($(scriptNode).data("wpm-cookie-category").includes("ads") && ads) {
1140
+ wpm.unblockScript(scriptNode, true)
1141
+ }
1142
+ })
1143
+
1144
+ jQuery(document).trigger("wpmPreLoadPixels", {})
1145
+ }
1146
+
1147
+ wpm.unblockSelectedPixels = function () {
1148
+ $.each(
1149
+ $("script[type=\"blocked/javascript\"]"), function (index, node) {
1150
+
1151
+ if (wpmConsentValues.pixels.includes($(node).data("wpm-pixel-name"))) {
1152
+ wpm.unblockScript(node, true)
1153
+ } else if ($(node).data("wpm-pixel-name") === "google" && ["google-analytics", "google-ads"].some(element => wpmConsentValues.pixels.includes(element))) {
1154
+ wpm.unblockScript(node, true)
1155
+ }
1156
+ })
1157
+
1158
+ jQuery(document).trigger("wpmPreLoadPixels", {})
1159
+ }
1160
+
1161
+
1162
+ /**
1163
+ * Block or unblock scripts for each CMP immediately after cookie consent has been updated
1164
+ * by the visitor.
1165
+ */
1166
+
1167
+ // Borlabs Cookie
1168
+ // If visitor accepts cookies in Borlabs Cookie unblock the scripts
1169
+ window.addEventListener("borlabs-cookie-consent-saved", function (e) {
1170
+
1171
+ wpm.updateConsentCookieValues()
1172
+
1173
+ if (wpmConsentValues.mode === "pixel") {
1174
+
1175
+ wpm.unblockSelectedPixels()
1176
+ wpm.updateGoogleConsentMode(wpmConsentValues.pixels.includes("google-analytics"), wpmConsentValues.pixels.includes("google-ads"))
1177
+ } else {
1178
+
1179
+ wpm.unblockAllScripts(wpmConsentValues.categories.analytics, wpmConsentValues.categories.ads)
1180
+ wpm.updateGoogleConsentMode(wpmConsentValues.categories.analytics, wpmConsentValues.categories.ads)
1181
+ }
1182
+ })
1183
+
1184
+ // Cookiebot
1185
+ // If visitor accepts cookies in Cookiebot unblock the scripts
1186
+ // https://www.cookiebot.com/en/developer/
1187
+ window.addEventListener("CookiebotOnAccept", function (e) {
1188
+ if (Cookiebot.consent.statistics) wpmConsentValues.categories.analytics = true
1189
+ if (Cookiebot.consent.marketing) wpmConsentValues.categories.ads = true
1190
+
1191
+ wpm.unblockAllScripts(wpmConsentValues.categories.analytics, wpmConsentValues.categories.ads)
1192
+ wpm.updateGoogleConsentMode(wpmConsentValues.categories.analytics, wpmConsentValues.categories.ads)
1193
+
1194
+ }, false)
1195
+
1196
+ /**
1197
+ * Cookie Script
1198
+ * If visitor accepts cookies in Cookie Script unblock the scripts
1199
+ * https://support.cookie-script.com/article/20-custom-events
1200
+ */
1201
+ window.addEventListener("CookieScriptAccept", function (e) {
1202
+ if (e.detail.categories.includes("performance")) wpmConsentValues.categories.analytics = true
1203
+ if (e.detail.categories.includes("targeting")) wpmConsentValues.categories.ads = true
1204
+
1205
+ wpm.unblockAllScripts(wpmConsentValues.categories.analytics, wpmConsentValues.categories.ads)
1206
+ wpm.updateGoogleConsentMode(wpmConsentValues.categories.analytics, wpmConsentValues.categories.ads)
1207
+ })
1208
+
1209
+ /**
1210
+ * Cookie Script
1211
+ * If visitor accepts cookies in Cookie Script unblock the scripts
1212
+ * https://support.cookie-script.com/
1213
+ */
1214
+ window.addEventListener("CookieScriptAcceptAll", function (e) {
1215
+ wpm.unblockAllScripts(true, true)
1216
+ wpm.updateGoogleConsentMode(true, true)
1217
+ })
1218
+
1219
+ // Complianz Cookie
1220
+ // If visitor accepts cookies in Complianz unblock the scripts
1221
+ document.addEventListener("cmplzStatusChange", function (e) {
1222
+
1223
+ wpm.updateConsentCookieValues()
1224
+
1225
+ // console.log(wpmConsentValues)
1226
+
1227
+ wpm.unblockAllScripts(wpmConsentValues.categories.analytics, wpmConsentValues.categories.ads)
1228
+ wpm.updateGoogleConsentMode(wpmConsentValues.categories.analytics, wpmConsentValues.categories.ads)
1229
+ })
1230
+
1231
+ // Cookie Compliance by hu-manity.co (free and pro)
1232
+ // If visitor accepts cookies in Cookie Notice by hu-manity.co unblock the scripts (free version)
1233
+ // https://wordpress.org/support/topic/events-on-consent-change/#post-15202792
1234
+ document.addEventListener("setCookieNotice", function (e) {
1235
+
1236
+ wpm.updateConsentCookieValues()
1237
+
1238
+ // console.log(wpmConsentValues)
1239
+
1240
+ wpm.unblockAllScripts(wpmConsentValues.categories.analytics, wpmConsentValues.categories.ads)
1241
+ wpm.updateGoogleConsentMode(wpmConsentValues.categories.analytics, wpmConsentValues.categories.ads)
1242
+ })
1243
+
1244
+ /**
1245
+ * Cookie Compliance by hu-manity.co (free and pro)
1246
+ * If visitor accepts cookies in Cookie Notice by hu-manity.co unblock the scripts (pro version)
1247
+ * https://wordpress.org/support/topic/events-on-consent-change/#post-15202792
1248
+ * Because Cookie Notice has no documented API or event that is being triggered on consent save or update
1249
+ * we have to solve this by using a mutation observer.
1250
+ *
1251
+ * @type {MutationObserver}
1252
+ */
1253
+
1254
+ wpm.huObserver = new MutationObserver(function (mutations) {
1255
+ mutations.forEach(({addedNodes}) => {
1256
+ [...addedNodes]
1257
+ .forEach(node => {
1258
+
1259
+ if (node.id === "hu") {
1260
+
1261
+ jQuery(".hu-cookies-save").on("click", function (e) {
1262
+ wpm.updateConsentCookieValues()
1263
+ wpm.unblockAllScripts(wpmConsentValues.categories.analytics, wpmConsentValues.categories.ads)
1264
+ wpm.updateGoogleConsentMode(wpmConsentValues.categories.analytics, wpmConsentValues.categories.ads)
1265
+ })
1266
+ }
1267
+ })
1268
+ })
1269
+ })
1270
+
1271
+ if (window.hu) {
1272
+ wpm.huObserver.observe(document.documentElement || document.body, {childList: true, subtree: true})
1273
+ }
1274
+
1275
+ wpm.version = function () {
1276
+ console.log(wpmDataLayer.version)
1277
+ }
1278
+
1279
+ // https://api.jquery.com/jquery.getscript/
1280
+ wpm.loadScriptAndCacheIt = function (url, options) {
1281
+
1282
+ // Allow user to set any option except for dataType, cache, and url
1283
+ options = jQuery.extend(options || {}, {
1284
+ dataType: "script",
1285
+ cache : true,
1286
+ url : url,
1287
+ })
1288
+
1289
+ // Use $.ajax() since it is more flexible than $.getScript
1290
+ // Return the jqXHR object so we can chain callbacks
1291
+ return jQuery.ajax(options)
1292
+ }
1293
+
1294
+ wpm.getOrderItemPrice = function (orderItem) {
1295
+ return (orderItem.total + orderItem.total_tax) / orderItem.quantity
1296
+ }
1297
+
1298
+ wpm.hasLoginEventFired = function () {
1299
+ let data = wpm.getWpmSessionData()
1300
+ return data?.loginEventFired
1301
+ }
1302
+
1303
+ wpm.setLoginEventFired = function () {
1304
+ let data = wpm.getWpmSessionData()
1305
+ data["loginEventFired"] = true
1306
+ wpm.setWpmSessionData(data)
1307
+ }
1308
+
1309
+ wpm.wpmDataLayerExists = function () {
1310
+ return new Promise(function (resolve) {
1311
+ (function waitForVar() {
1312
+ if (typeof wpmDataLayer !== "undefined") return resolve()
1313
+ setTimeout(waitForVar, 50)
1314
+ })()
1315
+ })
1316
+ }
1317
+
1318
+ wpm.pageLoaded = function () {
1319
+ return new Promise(function (resolve) {
1320
+ (function waitForVar() {
1321
+ if ("complete" === document.readyState) return resolve()
1322
+ setTimeout(waitForVar, 50)
1323
+ })()
1324
+ })
1325
+ }
1326
+
1327
+ wpm.pageReady = function () {
1328
+ return new Promise(function (resolve) {
1329
+ (function waitForVar() {
1330
+ if ("interactive" === document.readyState || "complete" === document.readyState) return resolve()
1331
+ setTimeout(waitForVar, 50)
1332
+ })()
1333
+ })
1334
+ }
1335
+
1336
+ wpm.isMiniCartActive = function () {
1337
+ if (window.sessionStorage) {
1338
+ for (const [key, value] of Object.entries(window.sessionStorage)) {
1339
+ if (key.includes("wc_fragments")) {
1340
+ return true
1341
+ }
1342
+ }
1343
+ return false
1344
+ } else {
1345
+ return false
1346
+ }
1347
+ }
1348
+
1349
+ wpm.doesWooCommerceCartExist = function () {
1350
+ return document.cookie.includes("woocommerce_items_in_cart")
1351
+ }
1352
+
1353
+ wpm.urlHasParameter = function (parameter) {
1354
+ let urlParams = new URLSearchParams(window.location.search)
1355
+ return urlParams.has(parameter)
1356
+ }
1357
+
1358
+ // wpm['load'] = {
1359
+ // base: true
1360
+ // };
1361
+
1362
+ window["wpmLoaded"] = {}
1363
+
1364
+ // return {
1365
+ // writeOrderIdToStorage : writeOrderIdToStorage,
1366
+ // isOrderIdStored : isOrderIdStored,
1367
+ // isEmail : isEmail,
1368
+ // removeProductFromCart : removeProductFromCart,
1369
+ // getViewItemProducts : getViewItemProducts,
1370
+ // addProductToCart : addProductToCart,
1371
+ // getCartItemsFromBackEnd: getCartItemsFromBackEnd,
1372
+ // fireCheckoutOption : fireCheckoutOption,
1373
+ // getCartItems : getCartItems
1374
+ // }
1375
+
1376
+ }(window.wpm = window.wpm || {}, jQuery))
1377
+
1378
+
1379
+ /**
1380
+ * Run when page is ready
1381
+ * */
1382
+
1383
+ wpm.pageReady().then(function () {
1384
+
1385
+
1386
+ /**
1387
+ * Run as soon as wpm namespace is loaded
1388
+ */
1389
+
1390
+ wpm.wpmDataLayerExists()
1391
+ .then(function () {
1392
+ // watch for products visible in viewport
1393
+ wpm.startIntersectionObserverToWatch()
1394
+
1395
+ // watch for lazy loaded products
1396
+ wpm.startProductsMutationObserverToWatch()
1397
+ })
1398
+
1399
+ // let products = jQuery(".products, .product")
1400
+
1401
+
1402
+ // remove_from_cart event
1403
+ jQuery(document).on("click", ".remove_from_cart_button, .remove", function (e) {
1404
+ // jQuery('.remove_from_cart_button, .remove').on('click', function (e) {
1405
+
1406
+ try {
1407
+ // console.log('remove_from_cart: ' + jQuery(this).data('product_id'));
1408
+
1409
+ let url = new URL(jQuery(this).attr("href"))
1410
+ let productId = wpm.getProductIdByCartItemKeyUrl(url)
1411
+
1412
+ wpm.removeProductFromCart(productId)
1413
+
1414
+ } catch (e) {
1415
+ console.error(e)
1416
+ }
1417
+ })
1418
+
1419
+
1420
+ // add_to_cart event
1421
+ jQuery(document).on("click", ".add_to_cart_button:not(.product_type_variable), .ajax_add_to_cart, .single_add_to_cart_button", function (e) {
1422
+ // jQuery('.add_to_cart_button:not(.product_type_variable), .ajax_add_to_cart, .js-ajax-add-to-cart, .single_add_to_cart_button, .btn_color-2').on('click', function (e) {
1423
+
1424
+ try {
1425
+ // console.log('add_to_cart');
1426
+
1427
+ if (wpmDataLayer.shop.page_type === "product") {
1428
+
1429
+ // first process related and upsell products
1430
+ if (typeof jQuery(this).attr("href") !== "undefined" && jQuery(this).attr("href").includes("add-to-cart")) {
1431
+ // console.log('add-to-cart on upsell and related products');
1432
+ let quantity = 1
1433
+ let productId = jQuery(this).data("product_id")
1434
+ // console.log('productId: ' + productId);
1435
+ wpm.addProductToCart(productId, quantity)
1436
+ } else {
1437
+
1438
+ if (wpmDataLayer.shop.product_type === "simple") {
1439
+
1440
+ // console.log('test');
1441
+ let quantity = Number(jQuery(".input-text.qty").val())
1442
+
1443
+ if (!quantity && quantity !== 0) quantity = 1
1444
+
1445
+ let productId = jQuery(this).val()
1446
+
1447
+ // console.log('productId: ' + productId);
1448
+ // console.log('quantity: ' + quantity);
1449
+
1450
+ wpm.addProductToCart(productId, quantity)
1451
+
1452
+ } else if (wpmDataLayer.shop.product_type === "variable") {
1453
+
1454
+ // console.log('variable');
1455
+
1456
+ let quantity = Number(jQuery(".input-text.qty").val())
1457
+
1458
+ if (!quantity && quantity !== 0) quantity = 1
1459
+
1460
+ let productId = jQuery("[name='variation_id']").val()
1461
+
1462
+ // console.log('productId: ' + productId);
1463
+ // console.log('quantity: ' + quantity);
1464
+
1465
+ wpm.addProductToCart(productId, quantity)
1466
+
1467
+ } else if (wpmDataLayer.shop.product_type === "grouped") {
1468
+
1469
+ // console.log('grouped');
1470
+
1471
+ jQuery(".woocommerce-grouped-product-list-item").each(function () {
1472
+
1473
+ let quantity = Number(jQuery(this).find(".input-text.qty").val())
1474
+
1475
+ if (!quantity && quantity !== 0) quantity = 1
1476
+
1477
+ let classes = jQuery(this).attr("class")
1478
+ let productId = wpm.getPostIdFromString(classes)
1479
+
1480
+ // console.log('productId: ' + productId);
1481
+ // console.log('quantity: ' + quantity);
1482
+
1483
+ wpm.addProductToCart(productId, quantity)
1484
+ })
1485
+ } else if (wpmDataLayer.shop.product_type === "bundle") {
1486
+
1487
+ // console.log('bundle');
1488
+
1489
+ let quantity = Number(jQuery(".input-text.qty").val())
1490
+
1491
+ if (!quantity && quantity !== 0) quantity = 1
1492
+
1493
+ let productId = jQuery("input[name=add-to-cart]").val()
1494
+
1495
+ // console.log('productId: ' + productId);
1496
+ // console.log('quantity: ' + quantity);
1497
+
1498
+ wpm.addProductToCart(productId, quantity)
1499
+ }
1500
+ }
1501
+ } else {
1502
+
1503
+ // console.log('non product page');
1504
+
1505
+ let quantity = 1
1506
+ let productId = jQuery(this).data("product_id")
1507
+ // console.log('productId: ' + productId);
1508
+ wpm.addProductToCart(productId, quantity)
1509
+ }
1510
+ } catch (e) {
1511
+ console.error(e)
1512
+ }
1513
+ })
1514
+
1515
+ // if someone clicks anywhere on a custom /?add-to-cart=123 link
1516
+ // trigger the add to cart event
1517
+ // body.one('click', function (e) {
1518
+ //
1519
+ // try {
1520
+ // if (jQuery(this)[0].URL) {
1521
+ //
1522
+ // let href = new URL(jQuery(this)[0].URL);
1523
+ // let searchParams = new URLSearchParams(href.search);
1524
+ //
1525
+ // if (searchParams.has('add-to-cart')) {
1526
+ // // console.log('non product page, /?add-to-cart=123 link');
1527
+ //
1528
+ // let productId = searchParams.get('add-to-cart');
1529
+ // wpm.addProductToCart(productId, 1);
1530
+ // }
1531
+ // }
1532
+ // } catch (e) {
1533
+ // console.error(e);
1534
+ // }
1535
+ // });
1536
+
1537
+
1538
+ /**
1539
+ * If someone clicks anywhere on a custom /?add-to-cart=123 link
1540
+ * trigger the add to cart event
1541
+ */
1542
+ jQuery(document).one("click", "a:not(.add_to_cart_button, .ajax_add_to_cart, .single_add_to_cart_button)", function (event) {
1543
+ // jQuery('a:not(.add_to_cart_button, .ajax_add_to_cart, .single_add_to_cart_button)').one('click', function (event) {
1544
+
1545
+ try {
1546
+ if (jQuery(event.target).closest("a").attr("href")) {
1547
+
1548
+ let href = jQuery(event.target).closest("a").attr("href")
1549
+
1550
+ if (href.includes("add-to-cart=")) {
1551
+ let matches = href.match(/(add-to-cart=)(\d+)/)
1552
+ // console.log('pid: ' + matches[2])
1553
+ if (matches) wpm.addProductToCart(matches[2], 1)
1554
+ }
1555
+ }
1556
+ } catch (e) {
1557
+ console.error(e)
1558
+ }
1559
+ })
1560
+
1561
+ // select_content GA UA event
1562
+ // select_item GA 4 event
1563
+ // jQuery(document).on('click', '.woocommerce-LoopProduct-link, .wc-block-grid__product, .product-small.box', function (e) {
1564
+ jQuery(document).on("click", ".woocommerce-LoopProduct-link, .wc-block-grid__product, .product, .product-small, .type-product", function (e) {
1565
+ // jQuery('.woocommerce-LoopProduct-link, .wc-block-grid__product, .product, .product-small, .type-product').on('click', function (e) {
1566
+
1567
+ try {
1568
+
1569
+ /**
1570
+ *
1571
+ * On some pages the event fires multiple times, and on product pages
1572
+ * even on page load. Using e.stopPropagation helps to prevent this,
1573
+ * but I dont know why. We don't even have to use this, since only a real
1574
+ * product click yields a valid productId. So we filter the invalid click
1575
+ * events out later down the code. I'll keep it that way because this is
1576
+ * the most compatible way across shops.
1577
+ * e.stopPropagation();
1578
+ * */
1579
+
1580
+ // console.log('select_content and select_item');
1581
+
1582
+ let productId = jQuery(this).nextAll(".wpmProductId:first").data("id")
1583
+ // console.log('select_content and select_item: ' + productId);
1584
+
1585
+
1586
+ /**
1587
+ * On product pages, for some reason, the click event is triggered on the main product on page load.
1588
+ * In that case no ID is found. But we can discard it, since we only want to trigger the event on
1589
+ * related products, which are found below.
1590
+ */
1591
+
1592
+ if (productId) {
1593
+
1594
+ // console.log('select_content and select_item: ' + productId);
1595
+
1596
+ productId = getIdBasedOndVariationsOutputSetting(productId)
1597
+
1598
+ if (!productId) throw Error("Wasn't able to retrieve a productId")
1599
+
1600
+ // console.log('prodid: ' + productId);
1601
+
1602
+ if (wpmDataLayer.products && wpmDataLayer.products[productId]) {
1603
+
1604
+ let product = wpm.getProductDetailsFormattedForEvent(productId)
1605
+
1606
+ jQuery(document).trigger("wpmSelectContentGaUa", product)
1607
+ jQuery(document).trigger("wpmSelectItem", product)
1608
+ }
1609
+ }
1610
+ } catch (e) {
1611
+ console.error(e)
1612
+ }
1613
+ })
1614
+
1615
+ // begin_checkout event
1616
+ jQuery(document).one("click", ".checkout-button, .cart-checkout-button, .button.checkout", function (e) {
1617
+ // jQuery('.checkout-button, .cart-checkout-button, .button.checkout').one('click', function (e) {
1618
+ // console.log('begin_checkout');
1619
+
1620
+ jQuery(document).trigger("wpmBeginCheckout")
1621
+ })
1622
+
1623
+
1624
+ // checkout_progress event
1625
+ // track checkout option event: entered valid billing email
1626
+ jQuery(document).on("input", "#billing_email", function () {
1627
+ // jQuery('#billing_email').on('input', function () {
1628
+
1629
+ if (wpm.isEmail(jQuery(this).val())) {
1630
+ // wpm.fireCheckoutOption(2);
1631
+ wpm.fireCheckoutProgress(2)
1632
+ wpm.emailSelected = true
1633
+ }
1634
+ })
1635
+
1636
+ // track checkout option event: purchase click
1637
+ jQuery(document).on("click", ".wc_payment_methods", function () {
1638
+ // jQuery('.wc_payment_methods').on('click', function () {
1639
+
1640
+ if (false === wpm.paymentMethodSelected) {
1641
+ wpm.fireCheckoutProgress(3)
1642
+ }
1643
+
1644
+ wpm.fireCheckoutOption(3, jQuery("input[name='payment_method']:checked").val())
1645
+ wpm.paymentMethodSelected = true
1646
+ })
1647
+
1648
+ // track checkout option event: purchase click
1649
+ jQuery(document).one("click", "#place_order", function () {
1650
+ // jQuery('#place_order').one('click', function () {
1651
+
1652
+ if (false === wpm.emailSelected) {
1653
+ wpm.fireCheckoutProgress(2)
1654
+ }
1655
+
1656
+ if (false === wpm.paymentMethodSelected) {
1657
+ wpm.fireCheckoutProgress(3)
1658
+ wpm.fireCheckoutOption(3, jQuery("input[name='payment_method']:checked").val())
1659
+ }
1660
+
1661
+ wpm.fireCheckoutProgress(4)
1662
+ })
1663
+
1664
+ // update cart event
1665
+ jQuery(document).on("click", "[name='update_cart']", function (e) {
1666
+ // jQuery("[name='update_cart']").on('click', function (e) {
1667
+
1668
+ try {
1669
+ jQuery(".cart_item").each(function () {
1670
+
1671
+ // let productId = jQuery(this).find('[data-product_id]').data('product_id');
1672
+
1673
+ let url = new URL(jQuery(this).find(".product-remove").find("a").attr("href"))
1674
+ let productId = wpm.getProductIdByCartItemKeyUrl(url)
1675
+
1676
+
1677
+ let quantity = jQuery(this).find(".qty").val()
1678
+
1679
+ if (quantity === 0) {
1680
+ wpm.removeProductFromCart(productId)
1681
+ } else if (quantity < wpmDataLayer.cart[productId].quantity) {
1682
+ wpm.removeProductFromCart(productId, wpmDataLayer.cart[productId].quantity - quantity)
1683
+ } else if (quantity > wpmDataLayer.cart[productId].quantity) {
1684
+ wpm.addProductToCart(productId, quantity - wpmDataLayer.cart[productId].quantity)
1685
+ }
1686
+ })
1687
+ } catch (e) {
1688
+ console.error(e)
1689
+ wpm.getCartItemsFromBackend()
1690
+ }
1691
+ })
1692
+
1693
+
1694
+ // add_to_wishlist
1695
+ jQuery(document).on("click", ".add_to_wishlist, .wl-add-to", function () {
1696
+ // jQuery('.add_to_wishlist, .wl-add-to').on('click', function () {
1697
+
1698
+ try {
1699
+ // console.log('add_to_wishlist');
1700
+ // console.log('this:' + jQuery(this).data('product-id'));
1701
+
1702
+ let productId
1703
+
1704
+ if (jQuery(this).data("productid")) { // for the WooCommerce wishlist plugin
1705
+ productId = jQuery(this).data("productid")
1706
+ } else if (jQuery(this).data("product-id")) { // for the YITH wishlist plugin
1707
+ productId = jQuery(this).data("product-id")
1708
+ }
1709
+
1710
+ if (!productId) throw Error("Wasn't able to retrieve a productId")
1711
+
1712
+ let product = wpm.getProductDetailsFormattedForEvent(productId)
1713
+
1714
+ // console.log('add_to_wishlist');
1715
+ // console.log(product);
1716
+
1717
+ jQuery(document).trigger("wpmAddToWishlist", product)
1718
+ } catch (e) {
1719
+ console.error(e)
1720
+ }
1721
+ })
1722
+
1723
+ jQuery(document).on("updated_cart_totals", function () {
1724
+ jQuery(document).trigger("wpmViewCart")
1725
+ })
1726
+
1727
+
1728
+ /**
1729
+ * Called when the user selects all the required dropdowns / attributes
1730
+ *
1731
+ * Has to be hooked after document ready
1732
+ *
1733
+ * https://stackoverflow.com/a/27849208/4688612
1734
+ * https://stackoverflow.com/a/65065335/4688612
1735
+ */
1736
+ jQuery(".single_variation_wrap").on("show_variation", function (event, variation) {
1737
+
1738
+ try {
1739
+ let productId = getIdBasedOndVariationsOutputSetting(variation.variation_id)
1740
+
1741
+ if (!productId) throw Error("Wasn't able to retrieve a productId")
1742
+
1743
+ if (wpmDataLayer.products && wpmDataLayer.products[productId]) {
1744
+
1745
+ // console.log('productId: ' + productId);
1746
+
1747
+ let product = wpm.getProductDetailsFormattedForEvent(productId)
1748
+
1749
+ jQuery(document).trigger("wpmViewItem", product)
1750
+ }
1751
+ } catch (e) {
1752
+ console.error(e)
1753
+ }
1754
+ })
1755
+
1756
+ /**
1757
+ * Called on variable products when no selection has been done yet
1758
+ * or when the visitor deselects his choice.
1759
+ *
1760
+ * Has to be hooked after document ready
1761
+ */
1762
+
1763
+ jQuery(".single_variation_wrap").on("hide_variation", function (event, data) {
1764
+
1765
+ try {
1766
+ let classes = jQuery("body").attr("class")
1767
+ let productId = classes.match(/(postid-)(\d+)/)[2]
1768
+
1769
+ if (!productId) throw Error("Wasn't able to retrieve a productId")
1770
+
1771
+ /**
1772
+ * If we have a variable product with no preset,
1773
+ * and variations output is enabled,
1774
+ * then we send a viewItem event with the first
1775
+ * variation we find for the parent.
1776
+ * If variations output is disabled,
1777
+ * we just send the parent ID.
1778
+ */
1779
+ if (
1780
+ "variable" === wpmDataLayer.shop.product_type &&
1781
+ wpmDataLayer?.general?.variationsOutput
1782
+ ) {
1783
+ for (const [key, product] of Object.entries(wpmDataLayer.products)) {
1784
+ if ("parentId" in product) {
1785
+ // console.log('pid: ' + value.parentId)
1786
+ productId = product.id
1787
+ break
1788
+ }
1789
+ }
1790
+ }
1791
+
1792
+ if (wpmDataLayer.products && wpmDataLayer.products[productId]) {
1793
+
1794
+ // console.log('productId: ' + productId);
1795
+
1796
+ let product = wpm.getProductDetailsFormattedForEvent(productId)
1797
+
1798
+ jQuery(document).trigger("wpmViewItem", product)
1799
+ }
1800
+
1801
+ } catch (e) {
1802
+ console.error(e)
1803
+ }
1804
+ })
1805
+
1806
+ }) // End document ready wrap
1807
+
1808
+ /**
1809
+ * Set up wpm events
1810
+ */
1811
+
1812
+
1813
+ // populate the wpmDataLayer with the cart items
1814
+ jQuery(window).on("wpmLoad", function () {
1815
+
1816
+ try {
1817
+ // When a new session is initiated there are no items in the cart,
1818
+ // so we can save the call to get the cart items
1819
+ if (wpm.doesWooCommerceCartExist()) wpm.getCartItems()
1820
+
1821
+ } catch (e) {
1822
+ console.error(e)
1823
+ }
1824
+ })
1825
+
1826
+ // get all add-to-cart= products from backend
1827
+ jQuery(window).on("wpmLoad", function () {
1828
+
1829
+ wpmDataLayer.products = wpmDataLayer.products || {}
1830
+
1831
+ // scan page for add-to-cart= links
1832
+ let productIds = wpm.getAddToCartLinkProductIds()
1833
+
1834
+ wpm.getProductsFromBackend(productIds)
1835
+ })
1836
+
1837
+ /**
1838
+ * Save the referrer into a cookie
1839
+ */
1840
+
1841
+ jQuery(window).on("wpmLoad", function () {
1842
+
1843
+ // can't use session storage as we can't read it from the server
1844
+ if (!wpm.getCookie("wpmReferrer")) {
1845
+
1846
+ if (document.referrer) {
1847
+ let referrerUrl = new URL(document.referrer)
1848
+ let referrerHostname = referrerUrl.hostname
1849
+
1850
+ if (referrerHostname !== window.location.host) {
1851
+ wpm.setCookie("wpmReferrer", referrerHostname)
1852
+ } else {
1853
+ wpm.setCookie("wpmReferrer", "")
1854
+ }
1855
+
1856
+ } else {
1857
+ wpm.setCookie("wpmReferrer", "")
1858
+ }
1859
+ }
1860
+ })
1861
+
1862
+
1863
+ /**
1864
+ * Create our own load event in order to better handle script flow execution when JS "optimizers" shuffle the code.
1865
+ */
1866
+
1867
+ jQuery(window).on("wpmLoad", function () {
1868
+ try {
1869
+ if (typeof wpmDataLayer != "undefined" && !wpmDataLayer?.wpmLoadFired) {
1870
+
1871
+ jQuery(document).trigger("wpmLoadAlways")
1872
+
1873
+ if ("product" === wpmDataLayer.shop.page_type && wpmDataLayer.shop.product_type !== "variable" && wpm.getMainProductIdFromProductPage()) {
1874
+
1875
+ let product = wpm.getProductDataForViewItemEvent(wpm.getMainProductIdFromProductPage())
1876
+ jQuery(document).trigger("wpmViewItem", product)
1877
+
1878
+ } else if ("product_category" === wpmDataLayer.shop.page_type) {
1879
+
1880
+ jQuery(document).trigger("wpmCategory")
1881
+
1882
+ } else if ("search" === wpmDataLayer.shop.page_type) {
1883
+
1884
+ jQuery(document).trigger("wpmSearch")
1885
+
1886
+ } else if ("cart" === wpmDataLayer.shop.page_type) {
1887
+
1888
+ jQuery(document).trigger("wpmViewCart")
1889
+
1890
+ } else if ("order_received_page" === wpmDataLayer.shop.page_type && wpmDataLayer.order) {
1891
+
1892
+ if (!wpm.isOrderIdStored(wpmDataLayer.order.id)) {
1893
+
1894
+ jQuery(document).trigger("wpmOrderReceivedPage")
1895
+ wpm.writeOrderIdToStorage(wpmDataLayer.order.id)
1896
+ }
1897
+ } else {
1898
+ jQuery(document).trigger("wpmEverywhereElse")
1899
+ }
1900
+
1901
+ if (wpmDataLayer?.user?.id && !wpm.hasLoginEventFired()) {
1902
+ jQuery(document).trigger("wpmLogin")
1903
+ wpm.setLoginEventFired()
1904
+ }
1905
+
1906
+ // /**
1907
+ // * Load mini cart fragments into a wpm session storage key,
1908
+ // * after the document load event.
1909
+ // */
1910
+ // jQuery(document).ajaxSend(function (event, jqxhr, settings) {
1911
+ // // console.log('settings.url: ' + settings.url);
1912
+ //
1913
+ // if (settings.url.includes("get_refreshed_fragments") && sessionStorage) {
1914
+ // if (!sessionStorage.getItem("wpmMiniCartActive")) {
1915
+ // sessionStorage.setItem("wpmMiniCartActive", JSON.stringify(true))
1916
+ // }
1917
+ // }
1918
+ // })
1919
+
1920
+ wpmDataLayer.wpmLoadFired = true
1921
+ }
1922
+
1923
+ } catch (e) {
1924
+ console.error(e)
1925
+ }
1926
+ })
1927
+
1928
+ // jQuery(window).on("load", function () {
1929
+ // jQuery(document).trigger("wpmLoad", {})
1930
+ // })
1931
+
1932
+ jQuery(window).on("wpmPreLoadPixels", function () {
1933
+
1934
+ if (wpmDataLayer?.shop?.cookie_consent_mgmt?.explicit_consent) {
1935
+ wpm.updateConsentCookieValues(true)
1936
+ }
1937
+ jQuery(document).trigger("wpmLoadPixels", {})
1938
+ })
readme.txt CHANGED
@@ -4,7 +4,7 @@ Tags: woocommerce, google ads, google analytics, facebook pixel, conversion trac
4
  Requires at least: 3.7
5
  Tested up to: 5.9
6
  Requires PHP: 7.3
7
- Stable tag: 1.16.6
8
  License: GPLv3 or later
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
@@ -186,16 +186,6 @@ You can send the link to the front page of your shop too if you think it would b
186
 
187
  == Changelog ==
188
 
189
- = 1.16.6 = 11.04.2022
190
-
191
- * Tweak: Safeguard for JavaScript optimizers that ignore the jQuery dependency of WPM and load jQuery after WPM
192
- * Tweak: Refactored the WPM JavaScript library (split code logically and into folders)
193
-
194
- = 1.16.5 = 08.04.2022
195
-
196
- * Tweak: More verbose logging of WPM load and pixel consent status into the dev console
197
- * Tweak: Added new logic to retrieve categories for variations
198
-
199
  = 1.16.4 = 07.04.2022
200
 
201
  * Fix: Fixed a bug that prevented disabling user role tracking
4
  Requires at least: 3.7
5
  Tested up to: 5.9
6
  Requires PHP: 7.3
7
+ Stable tag: 1.16.4
8
  License: GPLv3 or later
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
186
 
187
  == Changelog ==
188
 
 
 
 
 
 
 
 
 
 
 
189
  = 1.16.4 = 07.04.2022
190
 
191
  * Fix: Fixed a bug that prevented disabling user role tracking
wgact.php CHANGED
@@ -10,7 +10,7 @@
10
  * Developer URI: https://sweetcode.com
11
  * Text Domain: woocommerce-google-adwords-conversion-tracking-tag
12
  * Domain path: /languages
13
- * * Version: 1.16.6
14
  *
15
  * WC requires at least: 3.7
16
  * WC tested up to: 6.3
@@ -20,7 +20,7 @@
20
  *
21
  *
22
  **/
23
- const WPM_CURRENT_VERSION = '1.16.6' ;
24
  // TODO export settings function
25
  // TODO add option checkbox on uninstall and ask if user wants to delete options from db
26
 
10
  * Developer URI: https://sweetcode.com
11
  * Text Domain: woocommerce-google-adwords-conversion-tracking-tag
12
  * Domain path: /languages
13
+ * * Version: 1.16.4
14
  *
15
  * WC requires at least: 3.7
16
  * WC tested up to: 6.3
20
  *
21
  *
22
  **/
23
+ const WPM_CURRENT_VERSION = '1.16.4' ;
24
  // TODO export settings function
25
  // TODO add option checkbox on uninstall and ask if user wants to delete options from db
26