sales-frontend-utils 0.0.46 → 0.0.48

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -48,6 +48,9 @@ function debounce(func, delay) {
48
48
 
49
49
  // src/utils/cookie-utils.ts
50
50
  var getCookie = (name) => {
51
+ if (!isClient()) {
52
+ return "";
53
+ }
51
54
  if (typeof document === "undefined") {
52
55
  return "";
53
56
  }
@@ -55,6 +58,9 @@ var getCookie = (name) => {
55
58
  return match ? decodeURIComponent(match[2] || "") : "";
56
59
  };
57
60
  var setCookie = (name, value, options = {}) => {
61
+ if (!isClient()) {
62
+ return;
63
+ }
58
64
  if (typeof document === "undefined") {
59
65
  return;
60
66
  }
@@ -79,6 +85,9 @@ var setCookie = (name, value, options = {}) => {
79
85
  document.cookie = cookieString;
80
86
  };
81
87
  var deleteCookie = (name, options = {}) => {
88
+ if (!isClient()) {
89
+ return;
90
+ }
82
91
  setCookie(name, "", { ...options, expires: -1 });
83
92
  };
84
93
 
@@ -549,7 +558,13 @@ var isIosDevice = () => {
549
558
  if (isClient() === false) {
550
559
  return false;
551
560
  }
552
- return /iPhone|iPad|iPod/i.test(navigator.userAgent);
561
+ const ua = navigator.userAgent;
562
+ if (/Android/i.test(ua)) {
563
+ return false;
564
+ }
565
+ const isDirectIOS = /iPhone|iPad|iPod/i.test(ua);
566
+ const isIPadOS = navigator.platform === "MacIntel" && navigator.maxTouchPoints > 1;
567
+ return isDirectIOS || isIPadOS;
553
568
  };
554
569
  var isAndroidWebView = () => {
555
570
  return getDspExecutionEnvironment() === "android-webview";