@instockng/storefront-ui 1.0.1 → 1.0.2

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/index101.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import i from "./index108.mjs";
2
2
  import m from "./index109.mjs";
3
- import f from "./index62.mjs";
3
+ import f from "./index64.mjs";
4
4
  const h = (t, o, a = 3) => {
5
5
  let r = 0;
6
6
  const c = i(50, 250);
package/dist/index102.mjs CHANGED
@@ -1,10 +1,10 @@
1
1
  import n from "./index88.mjs";
2
- import m from "./index62.mjs";
2
+ import m from "./index64.mjs";
3
3
  import c from "./index110.mjs";
4
4
  import h from "./index111.mjs";
5
5
  import w from "./index84.mjs";
6
- import b from "./index65.mjs";
7
- import C from "./index76.mjs";
6
+ import b from "./index67.mjs";
7
+ import C from "./index78.mjs";
8
8
  import g from "./index81.mjs";
9
9
  const E = (a) => {
10
10
  const e = b({}, a);
package/dist/index103.mjs CHANGED
@@ -1,6 +1,6 @@
1
- import a from "./index68.mjs";
2
- import s from "./index73.mjs";
3
- import m from "./index62.mjs";
1
+ import a from "./index70.mjs";
2
+ import s from "./index75.mjs";
3
+ import m from "./index64.mjs";
4
4
  const h = (e, t) => {
5
5
  const { length: l } = e = e ? e.filter(Boolean) : [];
6
6
  if (t || l) {
package/dist/index105.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import a from "./index95.mjs";
1
+ import a from "./index93.mjs";
2
2
  const e = typeof URLSearchParams < "u" ? URLSearchParams : a;
3
3
  export {
4
4
  e as default
package/dist/index111.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import r from "./index62.mjs";
1
+ import r from "./index64.mjs";
2
2
  import c from "./index88.mjs";
3
3
  const p = c.hasStandardBrowserEnv ? (
4
4
  // Standard browser envs support document.cookie
package/dist/index43.mjs CHANGED
@@ -1,20 +1,20 @@
1
- import a from "./index62.mjs";
2
- import p from "./index63.mjs";
3
- import m from "./index64.mjs";
4
- import i from "./index65.mjs";
5
- import f from "./index66.mjs";
6
- import l from "./index67.mjs";
7
- import c from "./index68.mjs";
8
- import d from "./index69.mjs";
9
- import u from "./index70.mjs";
10
- import { VERSION as x } from "./index71.mjs";
11
- import C from "./index72.mjs";
12
- import A from "./index73.mjs";
13
- import E from "./index74.mjs";
14
- import O from "./index75.mjs";
15
- import S from "./index76.mjs";
16
- import H from "./index77.mjs";
17
- import T from "./index78.mjs";
1
+ import a from "./index64.mjs";
2
+ import p from "./index65.mjs";
3
+ import m from "./index66.mjs";
4
+ import i from "./index67.mjs";
5
+ import f from "./index68.mjs";
6
+ import l from "./index69.mjs";
7
+ import c from "./index70.mjs";
8
+ import d from "./index71.mjs";
9
+ import u from "./index72.mjs";
10
+ import { VERSION as x } from "./index73.mjs";
11
+ import C from "./index74.mjs";
12
+ import A from "./index75.mjs";
13
+ import E from "./index76.mjs";
14
+ import O from "./index77.mjs";
15
+ import S from "./index78.mjs";
16
+ import H from "./index79.mjs";
17
+ import T from "./index80.mjs";
18
18
  function n(o) {
19
19
  const t = new m(o), e = p(m.prototype.request, t);
20
20
  return a.extend(e, m.prototype, t, { allOwnKeys: !0 }), a.extend(e, t, null, { allOwnKeys: !0 }), e.create = function(s) {
package/dist/index44.mjs CHANGED
@@ -1,8 +1,8 @@
1
1
  var p = Object.defineProperty;
2
2
  var k = (r, e, i) => e in r ? p(r, e, { enumerable: !0, configurable: !0, writable: !0, value: i }) : r[e] = i;
3
3
  var h = (r, e, i) => k(r, typeof e != "symbol" ? e + "" : e, i);
4
- import { serialize as j } from "./index79.mjs";
5
- import { mergePath as U, replaceUrlParam as P, buildSearchParams as S, removeIndexString as w, replaceUrlProtocol as x, deepMerge as C } from "./index80.mjs";
4
+ import { serialize as j } from "./index62.mjs";
5
+ import { mergePath as U, replaceUrlParam as P, buildSearchParams as S, removeIndexString as w, replaceUrlProtocol as x, deepMerge as C } from "./index63.mjs";
6
6
  var v = (r, e) => new Proxy(() => {
7
7
  }, {
8
8
  get(t, s) {
package/dist/index62.mjs CHANGED
@@ -1,237 +1,36 @@
1
- import R from "./index63.mjs";
2
- const { toString: T } = Object.prototype, { getPrototypeOf: A } = Object, { iterator: g, toStringTag: S } = Symbol, F = /* @__PURE__ */ ((e) => (t) => {
3
- const n = T.call(t);
4
- return e[n] || (e[n] = n.slice(8, -1).toLowerCase());
5
- })(/* @__PURE__ */ Object.create(null)), f = (e) => (e = e.toLowerCase(), (t) => F(t) === e), O = (e) => (t) => typeof t === e, { isArray: p } = Array, a = O("undefined");
6
- function d(e) {
7
- return e !== null && !a(e) && e.constructor !== null && !a(e.constructor) && c(e.constructor.isBuffer) && e.constructor.isBuffer(e);
8
- }
9
- const B = f("ArrayBuffer");
10
- function M(e) {
11
- let t;
12
- return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? t = ArrayBuffer.isView(e) : t = e && e.buffer && B(e.buffer), t;
13
- }
14
- const k = O("string"), c = O("function"), E = O("number"), y = (e) => e !== null && typeof e == "object", N = (e) => e === !0 || e === !1, w = (e) => {
15
- if (F(e) !== "object")
16
- return !1;
17
- const t = A(e);
18
- return (t === null || t === Object.prototype || Object.getPrototypeOf(t) === null) && !(S in e) && !(g in e);
19
- }, U = (e) => {
20
- if (!y(e) || d(e))
21
- return !1;
22
- try {
23
- return Object.keys(e).length === 0 && Object.getPrototypeOf(e) === Object.prototype;
24
- } catch {
25
- return !1;
1
+ var a = (i, t, e = {}) => {
2
+ let r = `${i}=${t}`;
3
+ if (i.startsWith("__Secure-") && !e.secure)
4
+ throw new Error("__Secure- Cookie must have Secure attributes");
5
+ if (i.startsWith("__Host-")) {
6
+ if (!e.secure)
7
+ throw new Error("__Host- Cookie must have Secure attributes");
8
+ if (e.path !== "/")
9
+ throw new Error('__Host- Cookie must have Path attributes with "/"');
10
+ if (e.domain)
11
+ throw new Error("__Host- Cookie must not have Domain attributes");
26
12
  }
27
- }, I = f("Date"), V = f("File"), _ = f("Blob"), q = f("FileList"), H = (e) => y(e) && c(e.pipe), z = (e) => {
28
- let t;
29
- return e && (typeof FormData == "function" && e instanceof FormData || c(e.append) && ((t = F(e)) === "formdata" || // detect form-data instance
30
- t === "object" && c(e.toString) && e.toString() === "[object FormData]"));
31
- }, J = f("URLSearchParams"), [K, $, W, G] = ["ReadableStream", "Request", "Response", "Headers"].map(f), Q = (e) => e.trim ? e.trim() : e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
32
- function m(e, t, { allOwnKeys: n = !1 } = {}) {
33
- if (e === null || typeof e > "u")
34
- return;
35
- let r, s;
36
- if (typeof e != "object" && (e = [e]), p(e))
37
- for (r = 0, s = e.length; r < s; r++)
38
- t.call(null, e[r], r, e);
39
- else {
40
- if (d(e))
41
- return;
42
- const o = n ? Object.getOwnPropertyNames(e) : Object.keys(e), i = o.length;
43
- let l;
44
- for (r = 0; r < i; r++)
45
- l = o[r], t.call(null, e[l], l, e);
13
+ if (e && typeof e.maxAge == "number" && e.maxAge >= 0) {
14
+ if (e.maxAge > 3456e4)
15
+ throw new Error(
16
+ "Cookies Max-Age SHOULD NOT be greater than 400 days (34560000 seconds) in duration."
17
+ );
18
+ r += `; Max-Age=${e.maxAge | 0}`;
46
19
  }
47
- }
48
- function P(e, t) {
49
- if (d(e))
50
- return null;
51
- t = t.toLowerCase();
52
- const n = Object.keys(e);
53
- let r = n.length, s;
54
- for (; r-- > 0; )
55
- if (s = n[r], t === s.toLowerCase())
56
- return s;
57
- return null;
58
- }
59
- const u = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global, L = (e) => !a(e) && e !== u;
60
- function h() {
61
- const { caseless: e, skipUndefined: t } = L(this) && this || {}, n = {}, r = (s, o) => {
62
- const i = e && P(n, o) || o;
63
- w(n[i]) && w(s) ? n[i] = h(n[i], s) : w(s) ? n[i] = h({}, s) : p(s) ? n[i] = s.slice() : (!t || !a(s)) && (n[i] = s);
64
- };
65
- for (let s = 0, o = arguments.length; s < o; s++)
66
- arguments[s] && m(arguments[s], r);
67
- return n;
68
- }
69
- const X = (e, t, n, { allOwnKeys: r } = {}) => (m(t, (s, o) => {
70
- n && c(s) ? e[o] = R(s, n) : e[o] = s;
71
- }, { allOwnKeys: r }), e), Y = (e) => (e.charCodeAt(0) === 65279 && (e = e.slice(1)), e), Z = (e, t, n, r) => {
72
- e.prototype = Object.create(t.prototype, r), e.prototype.constructor = e, Object.defineProperty(e, "super", {
73
- value: t.prototype
74
- }), n && Object.assign(e.prototype, n);
75
- }, j = (e, t, n, r) => {
76
- let s, o, i;
77
- const l = {};
78
- if (t = t || {}, e == null) return t;
79
- do {
80
- for (s = Object.getOwnPropertyNames(e), o = s.length; o-- > 0; )
81
- i = s[o], (!r || r(i, e, t)) && !l[i] && (t[i] = e[i], l[i] = !0);
82
- e = n !== !1 && A(e);
83
- } while (e && (!n || n(e, t)) && e !== Object.prototype);
84
- return t;
85
- }, v = (e, t, n) => {
86
- e = String(e), (n === void 0 || n > e.length) && (n = e.length), n -= t.length;
87
- const r = e.indexOf(t, n);
88
- return r !== -1 && r === n;
89
- }, ee = (e) => {
90
- if (!e) return null;
91
- if (p(e)) return e;
92
- let t = e.length;
93
- if (!E(t)) return null;
94
- const n = new Array(t);
95
- for (; t-- > 0; )
96
- n[t] = e[t];
97
- return n;
98
- }, te = /* @__PURE__ */ ((e) => (t) => e && t instanceof e)(typeof Uint8Array < "u" && A(Uint8Array)), ne = (e, t) => {
99
- const r = (e && e[g]).call(e);
100
- let s;
101
- for (; (s = r.next()) && !s.done; ) {
102
- const o = s.value;
103
- t.call(e, o[0], o[1]);
20
+ if (e.domain && e.prefix !== "host" && (r += `; Domain=${e.domain}`), e.path && (r += `; Path=${e.path}`), e.expires) {
21
+ if (e.expires.getTime() - Date.now() > 3456e7)
22
+ throw new Error(
23
+ "Cookies Expires SHOULD NOT be greater than 400 days (34560000 seconds) in the future."
24
+ );
25
+ r += `; Expires=${e.expires.toUTCString()}`;
104
26
  }
105
- }, re = (e, t) => {
106
- let n;
107
- const r = [];
108
- for (; (n = e.exec(t)) !== null; )
109
- r.push(n);
110
- return r;
111
- }, se = f("HTMLFormElement"), oe = (e) => e.toLowerCase().replace(
112
- /[-_\s]([a-z\d])(\w*)/g,
113
- function(n, r, s) {
114
- return r.toUpperCase() + s;
27
+ if (e.httpOnly && (r += "; HttpOnly"), e.secure && (r += "; Secure"), e.sameSite && (r += `; SameSite=${e.sameSite.charAt(0).toUpperCase() + e.sameSite.slice(1)}`), e.priority && (r += `; Priority=${e.priority.charAt(0).toUpperCase() + e.priority.slice(1)}`), e.partitioned) {
28
+ if (!e.secure)
29
+ throw new Error("Partitioned Cookie must have Secure attributes");
30
+ r += "; Partitioned";
115
31
  }
116
- ), x = (({ hasOwnProperty: e }) => (t, n) => e.call(t, n))(Object.prototype), ie = f("RegExp"), C = (e, t) => {
117
- const n = Object.getOwnPropertyDescriptors(e), r = {};
118
- m(n, (s, o) => {
119
- let i;
120
- (i = t(s, o, e)) !== !1 && (r[o] = i || s);
121
- }), Object.defineProperties(e, r);
122
- }, ce = (e) => {
123
- C(e, (t, n) => {
124
- if (c(e) && ["arguments", "caller", "callee"].indexOf(n) !== -1)
125
- return !1;
126
- const r = e[n];
127
- if (c(r)) {
128
- if (t.enumerable = !1, "writable" in t) {
129
- t.writable = !1;
130
- return;
131
- }
132
- t.set || (t.set = () => {
133
- throw Error("Can not rewrite read-only method '" + n + "'");
134
- });
135
- }
136
- });
137
- }, fe = (e, t) => {
138
- const n = {}, r = (s) => {
139
- s.forEach((o) => {
140
- n[o] = !0;
141
- });
142
- };
143
- return p(e) ? r(e) : r(String(e).split(t)), n;
144
- }, le = () => {
145
- }, ue = (e, t) => e != null && Number.isFinite(e = +e) ? e : t;
146
- function ae(e) {
147
- return !!(e && c(e.append) && e[S] === "FormData" && e[g]);
148
- }
149
- const pe = (e) => {
150
- const t = new Array(10), n = (r, s) => {
151
- if (y(r)) {
152
- if (t.indexOf(r) >= 0)
153
- return;
154
- if (d(r))
155
- return r;
156
- if (!("toJSON" in r)) {
157
- t[s] = r;
158
- const o = p(r) ? [] : {};
159
- return m(r, (i, l) => {
160
- const b = n(i, s + 1);
161
- !a(b) && (o[l] = b);
162
- }), t[s] = void 0, o;
163
- }
164
- }
165
- return r;
166
- };
167
- return n(e, 0);
168
- }, de = f("AsyncFunction"), ye = (e) => e && (y(e) || c(e)) && c(e.then) && c(e.catch), D = ((e, t) => e ? setImmediate : t ? ((n, r) => (u.addEventListener("message", ({ source: s, data: o }) => {
169
- s === u && o === n && r.length && r.shift()();
170
- }, !1), (s) => {
171
- r.push(s), u.postMessage(n, "*");
172
- }))(`axios@${Math.random()}`, []) : (n) => setTimeout(n))(
173
- typeof setImmediate == "function",
174
- c(u.postMessage)
175
- ), me = typeof queueMicrotask < "u" ? queueMicrotask.bind(u) : typeof process < "u" && process.nextTick || D, we = (e) => e != null && c(e[g]), Fe = {
176
- isArray: p,
177
- isArrayBuffer: B,
178
- isBuffer: d,
179
- isFormData: z,
180
- isArrayBufferView: M,
181
- isString: k,
182
- isNumber: E,
183
- isBoolean: N,
184
- isObject: y,
185
- isPlainObject: w,
186
- isEmptyObject: U,
187
- isReadableStream: K,
188
- isRequest: $,
189
- isResponse: W,
190
- isHeaders: G,
191
- isUndefined: a,
192
- isDate: I,
193
- isFile: V,
194
- isBlob: _,
195
- isRegExp: ie,
196
- isFunction: c,
197
- isStream: H,
198
- isURLSearchParams: J,
199
- isTypedArray: te,
200
- isFileList: q,
201
- forEach: m,
202
- merge: h,
203
- extend: X,
204
- trim: Q,
205
- stripBOM: Y,
206
- inherits: Z,
207
- toFlatObject: j,
208
- kindOf: F,
209
- kindOfTest: f,
210
- endsWith: v,
211
- toArray: ee,
212
- forEachEntry: ne,
213
- matchAll: re,
214
- isHTMLForm: se,
215
- hasOwnProperty: x,
216
- hasOwnProp: x,
217
- // an alias to avoid ESLint no-prototype-builtins detection
218
- reduceDescriptors: C,
219
- freezeMethods: ce,
220
- toObjectSet: fe,
221
- toCamelCase: oe,
222
- noop: le,
223
- toFiniteNumber: ue,
224
- findKey: P,
225
- global: u,
226
- isContextDefined: L,
227
- isSpecCompliantForm: ae,
228
- toJSONObject: pe,
229
- isAsyncFn: de,
230
- isThenable: ye,
231
- setImmediate: D,
232
- asap: me,
233
- isIterable: we
234
- };
32
+ return r;
33
+ }, s = (i, t, e) => (t = encodeURIComponent(t), a(i, t, e));
235
34
  export {
236
- Fe as default
35
+ s as serialize
237
36
  };
package/dist/index63.mjs CHANGED
@@ -1,8 +1,45 @@
1
- function u(n, r) {
2
- return function() {
3
- return n.apply(r, arguments);
4
- };
1
+ var s = (e, r) => (e = e.replace(/\/+$/, ""), e = e + "/", r = r.replace(/^\/+/, ""), e + r), p = (e, r) => {
2
+ for (const [n, t] of Object.entries(r)) {
3
+ const c = new RegExp("/:" + n + "(?:{[^/]+})?\\??");
4
+ e = e.replace(c, t ? `/${t}` : "");
5
+ }
6
+ return e;
7
+ }, f = (e) => {
8
+ const r = new URLSearchParams();
9
+ for (const [n, t] of Object.entries(e))
10
+ if (t !== void 0)
11
+ if (Array.isArray(t))
12
+ for (const c of t)
13
+ r.append(n, c);
14
+ else
15
+ r.set(n, t);
16
+ return r;
17
+ }, i = (e, r) => {
18
+ switch (r) {
19
+ case "ws":
20
+ return e.replace(/^http/, "ws");
21
+ case "http":
22
+ return e.replace(/^ws/, "http");
23
+ }
24
+ }, l = (e) => /^https?:\/\/[^\/]+?\/index(?=\?|$)/.test(e) ? e.replace(/\/index(?=\?|$)/, "/") : e.replace(/\/index(?=\?|$)/, "");
25
+ function a(e) {
26
+ return typeof e == "object" && e !== null && !Array.isArray(e);
27
+ }
28
+ function o(e, r) {
29
+ if (!a(e) && !a(r))
30
+ return r;
31
+ const n = { ...e };
32
+ for (const t in r) {
33
+ const c = r[t];
34
+ a(n[t]) && a(c) ? n[t] = o(n[t], c) : n[t] = c;
35
+ }
36
+ return n;
5
37
  }
6
38
  export {
7
- u as default
39
+ f as buildSearchParams,
40
+ o as deepMerge,
41
+ s as mergePath,
42
+ l as removeIndexString,
43
+ p as replaceUrlParam,
44
+ i as replaceUrlProtocol
8
45
  };