@feedmepos/mf-miniprogram-v2 0.2.12-dev.1 → 0.2.12-dev.3

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.
@@ -1,9 +1,9 @@
1
- import { f as Ne, e as Me } from "./index-DB33ug2V.js";
2
- import { computed as B, reactive as ke } from "vue";
3
- import { k as _, e as ue, h as De } from "./controlPlane-Bn-uDXG_.js";
4
- import { useCoreStore as Be } from "@feedmepos/mf-common";
5
- import { g as Ue, c as Ke } from "./_commonjsHelpers-DaMA6jEr.js";
6
- const le = [
1
+ import { f as ke, e as Be } from "./index-DB33ug2V.js";
2
+ import { computed as B, reactive as Ue } from "vue";
3
+ import { k as R, e as le, h as Ke } from "./controlPlane-Bn-uDXG_.js";
4
+ import { useCoreStore as He } from "@feedmepos/mf-common";
5
+ import { g as Ge, c as Je } from "./_commonjsHelpers-DaMA6jEr.js";
6
+ const ce = [
7
7
  "Inter",
8
8
  "Roboto",
9
9
  "Open Sans",
@@ -26,26 +26,26 @@ const le = [
26
26
  "Noto Sans SC",
27
27
  "Noto Sans TC"
28
28
  ];
29
- function Ge(e) {
29
+ function qe(e) {
30
30
  var o;
31
31
  return ((o = e.split(",")[0]) == null ? void 0 : o.trim().replace(/^(['"])(.*)\1$/, "$2")) || "App default";
32
32
  }
33
- function xt(e) {
33
+ function Lt(e) {
34
34
  const o = ["Playfair Display", "Merriweather", "Lora"].includes(e) ? "serif" : "sans-serif";
35
35
  return `'${e}', ${o === "serif" ? "" : "system-ui, "}${o}`;
36
36
  }
37
- function we(e) {
38
- return `https://fonts.googleapis.com/css2?${[...new Set(e)].sort().map((s) => `family=${encodeURIComponent(s)}:wght@400;500;600;700`).join("&")}&display=swap`;
37
+ function Fe(e) {
38
+ return `https://fonts.googleapis.com/css2?${[...new Set(e)].sort().map((i) => `family=${encodeURIComponent(i)}:wght@400;500;600;700`).join("&")}&display=swap`;
39
39
  }
40
- function He(e) {
40
+ function We(e) {
41
41
  if (!e || typeof e != "object" || !("stylesheet" in e) || typeof e.stylesheet != "string")
42
42
  return !1;
43
43
  try {
44
44
  const o = new URL(e.stylesheet);
45
45
  if (o.hostname !== "fonts.googleapis.com" || !["/css", "/css2"].includes(o.pathname)) return !1;
46
- const s = o.searchParams.getAll("family").flatMap((t) => t.split("|"));
47
- return s.length > 0 && s.every(
48
- (t) => le.some((n) => {
46
+ const i = o.searchParams.getAll("family").flatMap((t) => t.split("|"));
47
+ return i.length > 0 && i.every(
48
+ (t) => ce.some((n) => {
49
49
  var a;
50
50
  return n.toLowerCase() === ((a = t.split(":")[0]) == null ? void 0 : a.trim().toLowerCase());
51
51
  })
@@ -54,23 +54,23 @@ function He(e) {
54
54
  return !1;
55
55
  }
56
56
  }
57
- function Je(e, o) {
58
- const s = ["brand", "heading", "body"].flatMap(
57
+ function Ye(e, o) {
58
+ const i = ["brand", "heading", "body"].flatMap(
59
59
  (n) => (o[n] || "").split(",").flatMap((a) => {
60
- const l = le.find((f) => f.toLowerCase() === Ge(a).toLowerCase());
60
+ const l = ce.find((f) => f.toLowerCase() === qe(a).toLowerCase());
61
61
  return l ? [l] : [];
62
62
  })
63
- ), t = Array.isArray(e) ? e.filter((n) => !He(n)) : [];
64
- return s.length ? [...t, { stylesheet: we(s) }] : t;
63
+ ), t = Array.isArray(e) ? e.filter((n) => !We(n)) : [];
64
+ return i.length ? [...t, { stylesheet: Fe(i) }] : t;
65
65
  }
66
66
  const Z = /* @__PURE__ */ new Map();
67
- function jt(e) {
68
- if (!le.some((t) => t === e)) return Promise.resolve();
67
+ function Nt(e) {
68
+ if (!ce.some((t) => t === e)) return Promise.resolve();
69
69
  const o = Z.get(e);
70
70
  if (o) return o;
71
- const s = new Promise((t, n) => {
71
+ const i = new Promise((t, n) => {
72
72
  const a = document.createElement("link");
73
- a.rel = "stylesheet", a.href = we([e]);
73
+ a.rel = "stylesheet", a.href = Fe([e]);
74
74
  let l = !1;
75
75
  const f = window.setTimeout(() => y(), 15e3), y = () => {
76
76
  l || (l = !0, window.clearTimeout(f), a.remove(), Z.delete(e), n(new Error(`Could not load ${e}`)));
@@ -84,21 +84,21 @@ function jt(e) {
84
84
  }, y);
85
85
  }, document.head.append(a);
86
86
  });
87
- return Z.set(e, s), s;
87
+ return Z.set(e, i), i;
88
88
  }
89
89
  var Oe = { exports: {} };
90
90
  (function(e, o) {
91
- (function(s, t) {
91
+ (function(i, t) {
92
92
  e.exports = t();
93
- })(Ke, function() {
94
- return function(s) {
93
+ })(Je, function() {
94
+ return function(i) {
95
95
  var t = {};
96
96
  function n(a) {
97
97
  if (t[a]) return t[a].exports;
98
98
  var l = t[a] = { i: a, l: !1, exports: {} };
99
- return s[a].call(l.exports, l, l.exports, n), l.l = !0, l.exports;
99
+ return i[a].call(l.exports, l, l.exports, n), l.l = !0, l.exports;
100
100
  }
101
- return n.m = s, n.c = t, n.d = function(a, l, f) {
101
+ return n.m = i, n.c = t, n.d = function(a, l, f) {
102
102
  n.o(a, l) || Object.defineProperty(a, l, { enumerable: !0, get: f });
103
103
  }, n.r = function(a) {
104
104
  typeof Symbol < "u" && Symbol.toStringTag && Object.defineProperty(a, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(a, "__esModule", { value: !0 });
@@ -126,228 +126,228 @@ var Oe = { exports: {} };
126
126
  return Object.prototype.hasOwnProperty.call(a, l);
127
127
  }, n.p = "", n(n.s = 0);
128
128
  }([
129
- function(s, t, n) {
130
- s.exports = n(1);
129
+ function(i, t, n) {
130
+ i.exports = n(1);
131
131
  },
132
- function(s, t, n) {
132
+ function(i, t, n) {
133
133
  function a(r) {
134
- return (a = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(i) {
135
- return typeof i;
136
- } : function(i) {
137
- return i && typeof Symbol == "function" && i.constructor === Symbol && i !== Symbol.prototype ? "symbol" : typeof i;
134
+ return (a = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(s) {
135
+ return typeof s;
136
+ } : function(s) {
137
+ return s && typeof Symbol == "function" && s.constructor === Symbol && s !== Symbol.prototype ? "symbol" : typeof s;
138
138
  })(r);
139
139
  }
140
140
  function l(r) {
141
- var i = "[object " + r + "]";
141
+ var s = "[object " + r + "]";
142
142
  return function(c) {
143
- return Object.prototype.toString.call(c) === i;
143
+ return Object.prototype.toString.call(c) === s;
144
144
  };
145
145
  }
146
146
  n.r(t), n.d(t, "default", function() {
147
- return je;
147
+ return Ne;
148
148
  }), n.d(t, "compare", function() {
149
149
  return pe;
150
150
  }), n.d(t, "comparable", function() {
151
- return V;
151
+ return z;
152
152
  });
153
153
  var f = l("Array"), y = l("Object"), w = l("Function");
154
- function m(r, i) {
155
- return w(r.get) ? r.get(i) : r[i];
154
+ function b(r, s) {
155
+ return w(r.get) ? r.get(s) : r[s];
156
156
  }
157
- function O(r) {
158
- return function(i, c) {
159
- if (!f(c) || !c.length) return r(i, c);
160
- for (var d = 0, p = c.length; d < p; d++)
161
- if (r(i, m(c, d))) return !0;
157
+ function S(r) {
158
+ return function(s, c) {
159
+ if (!f(c) || !c.length) return r(s, c);
160
+ for (var d = 0, h = c.length; d < h; d++)
161
+ if (r(s, b(c, d))) return !0;
162
162
  return !1;
163
163
  };
164
164
  }
165
165
  function $(r) {
166
- return function(i, c) {
167
- if (!f(c) || !c.length) return r(i, c);
168
- for (var d = 0, p = c.length; d < p; d++)
169
- if (!r(i, m(c, d))) return !1;
166
+ return function(s, c) {
167
+ if (!f(c) || !c.length) return r(s, c);
168
+ for (var d = 0, h = c.length; d < h; d++)
169
+ if (!r(s, b(c, d))) return !1;
170
170
  return !0;
171
171
  };
172
172
  }
173
- function b(r, i, c, d) {
174
- return r.validate(r.options, i, c, d);
173
+ function m(r, s, c, d) {
174
+ return r.validate(r.options, s, c, d);
175
175
  }
176
- var I = {
177
- $eq: O(function(r, i) {
178
- return r(i);
176
+ var P = {
177
+ $eq: S(function(r, s) {
178
+ return r(s);
179
179
  }),
180
- $ne: $(function(r, i) {
181
- return r(i);
180
+ $ne: $(function(r, s) {
181
+ return r(s);
182
182
  }),
183
- $gt: O(function(r, i) {
184
- return r(i);
183
+ $gt: S(function(r, s) {
184
+ return r(s);
185
185
  }),
186
- $gte: O(function(r, i) {
187
- return r(i);
186
+ $gte: S(function(r, s) {
187
+ return r(s);
188
188
  }),
189
- $lt: O(function(r, i) {
190
- return r(i);
189
+ $lt: S(function(r, s) {
190
+ return r(s);
191
191
  }),
192
- $lte: O(function(r, i) {
193
- return r(i);
192
+ $lte: S(function(r, s) {
193
+ return r(s);
194
194
  }),
195
- $mod: O(function(r, i) {
196
- return r(i);
195
+ $mod: S(function(r, s) {
196
+ return r(s);
197
197
  }),
198
- $in: function(r, i) {
199
- return r(i);
198
+ $in: function(r, s) {
199
+ return r(s);
200
200
  },
201
- $nin: function(r, i) {
202
- return r(i);
201
+ $nin: function(r, s) {
202
+ return r(s);
203
203
  },
204
- $not: function(r, i, c, d) {
205
- return r(i, c, d);
204
+ $not: function(r, s, c, d) {
205
+ return r(s, c, d);
206
206
  },
207
- $type: function(r, i) {
208
- return r(i);
207
+ $type: function(r, s) {
208
+ return r(s);
209
209
  },
210
- $all: function(r, i, c, d) {
211
- return I.$and(r, i, c, d);
210
+ $all: function(r, s, c, d) {
211
+ return P.$and(r, s, c, d);
212
212
  },
213
- $size: function(r, i) {
214
- return !!i && r === i.length;
213
+ $size: function(r, s) {
214
+ return !!s && r === s.length;
215
215
  },
216
- $or: function(r, i, c, d) {
217
- for (var p = 0, h = r.length; p < h; p++)
218
- if (b(m(r, p), i, c, d)) return !0;
216
+ $or: function(r, s, c, d) {
217
+ for (var h = 0, p = r.length; h < p; h++)
218
+ if (m(b(r, h), s, c, d)) return !0;
219
219
  return !1;
220
220
  },
221
- $nor: function(r, i, c, d) {
222
- return !I.$or(r, i, c, d);
221
+ $nor: function(r, s, c, d) {
222
+ return !P.$or(r, s, c, d);
223
223
  },
224
- $and: function(r, i, c, d) {
225
- for (var p = 0, h = r.length; p < h; p++)
226
- if (!b(m(r, p), i, c, d)) return !1;
224
+ $and: function(r, s, c, d) {
225
+ for (var h = 0, p = r.length; h < p; h++)
226
+ if (!m(b(r, h), s, c, d)) return !1;
227
227
  return !0;
228
228
  },
229
- $regex: O(function(r, i) {
230
- return typeof i == "string" && r.test(i);
229
+ $regex: S(function(r, s) {
230
+ return typeof s == "string" && r.test(s);
231
231
  }),
232
- $where: function(r, i, c, d) {
233
- return r.call(i, i, c, d);
232
+ $where: function(r, s, c, d) {
233
+ return r.call(s, s, c, d);
234
234
  },
235
- $elemMatch: function(r, i, c, d) {
236
- return f(i) ? !!~function(p, h) {
237
- for (var g = 0; g < p.length; g++)
238
- if (m(p, g), b(h, m(p, g))) return g;
235
+ $elemMatch: function(r, s, c, d) {
236
+ return f(s) ? !!~function(h, p) {
237
+ for (var g = 0; g < h.length; g++)
238
+ if (b(h, g), m(p, b(h, g))) return g;
239
239
  return -1;
240
- }(i, r) : b(r, i, c, d);
240
+ }(s, r) : m(r, s, c, d);
241
241
  },
242
- $exists: function(r, i, c, d) {
242
+ $exists: function(r, s, c, d) {
243
243
  return d.hasOwnProperty(c) === r;
244
244
  }
245
- }, C = {
246
- $eq: function(r, i, c) {
247
- var d = c.comparable, p = c.compare;
248
- return r instanceof RegExp ? O(function(h) {
249
- return typeof h == "string" && r.test(h);
250
- }) : r instanceof Function ? O(r) : f(r) && !r.length ? O(function(h) {
251
- return f(h) && !h.length;
252
- }) : O(
253
- r === null ? function(h) {
254
- return h == null;
255
- } : function(h) {
256
- return p(d(h), d(r)) === 0;
245
+ }, A = {
246
+ $eq: function(r, s, c) {
247
+ var d = c.comparable, h = c.compare;
248
+ return r instanceof RegExp ? S(function(p) {
249
+ return typeof p == "string" && r.test(p);
250
+ }) : r instanceof Function ? S(r) : f(r) && !r.length ? S(function(p) {
251
+ return f(p) && !p.length;
252
+ }) : S(
253
+ r === null ? function(p) {
254
+ return p == null;
255
+ } : function(p) {
256
+ return h(d(p), d(r)) === 0;
257
257
  }
258
258
  );
259
259
  },
260
- $gt: function(r, i, c) {
261
- var d = c.comparable, p = c.compare;
262
- return function(h) {
263
- return p(d(h), d(r)) > 0;
260
+ $gt: function(r, s, c) {
261
+ var d = c.comparable, h = c.compare;
262
+ return function(p) {
263
+ return h(d(p), d(r)) > 0;
264
264
  };
265
265
  },
266
- $gte: function(r, i, c) {
267
- var d = c.comparable, p = c.compare;
268
- return function(h) {
269
- return p(d(h), d(r)) >= 0;
266
+ $gte: function(r, s, c) {
267
+ var d = c.comparable, h = c.compare;
268
+ return function(p) {
269
+ return h(d(p), d(r)) >= 0;
270
270
  };
271
271
  },
272
- $lt: function(r, i, c) {
273
- var d = c.comparable, p = c.compare;
274
- return function(h) {
275
- return p(d(h), d(r)) < 0;
272
+ $lt: function(r, s, c) {
273
+ var d = c.comparable, h = c.compare;
274
+ return function(p) {
275
+ return h(d(p), d(r)) < 0;
276
276
  };
277
277
  },
278
- $lte: function(r, i, c) {
279
- var d = c.comparable, p = c.compare;
280
- return function(h) {
281
- return p(d(h), d(r)) <= 0;
278
+ $lte: function(r, s, c) {
279
+ var d = c.comparable, h = c.compare;
280
+ return function(p) {
281
+ return h(d(p), d(r)) <= 0;
282
282
  };
283
283
  },
284
- $in: function(r, i, c) {
284
+ $in: function(r, s, c) {
285
285
  var d = c.comparable;
286
- return function(p) {
287
- if (!(p instanceof Array)) {
288
- var h = d(p);
289
- if (h === p && a(p) === "object") {
286
+ return function(h) {
287
+ if (!(h instanceof Array)) {
288
+ var p = d(h);
289
+ if (p === h && a(h) === "object") {
290
290
  for (v = r.length; v--; )
291
- if (String(r[v]) === String(p) && String(p) !== "[object Object]")
291
+ if (String(r[v]) === String(h) && String(h) !== "[object Object]")
292
292
  return !0;
293
293
  }
294
- if (h === void 0) {
294
+ if (p === void 0) {
295
295
  for (v = r.length; v--; ) if (r[v] == null) return !0;
296
296
  }
297
297
  for (v = r.length; v--; ) {
298
- var g = b(de(m(r, v), c), h, v, r);
299
- if (g && String(g) !== "[object Object]" && String(h) !== "[object Object]")
298
+ var g = m(he(b(r, v), c), p, v, r);
299
+ if (g && String(g) !== "[object Object]" && String(p) !== "[object Object]")
300
300
  return !0;
301
301
  }
302
- return !!~r.indexOf(h);
302
+ return !!~r.indexOf(p);
303
303
  }
304
- for (var v = p.length; v--; )
305
- if (~r.indexOf(d(m(p, v)))) return !0;
304
+ for (var v = h.length; v--; )
305
+ if (~r.indexOf(d(b(h, v)))) return !0;
306
306
  return !1;
307
307
  };
308
308
  },
309
- $nin: function(r, i, c) {
310
- var d = C.$in(r, i, c);
311
- return function(p, h, g, v) {
312
- return !d(p, h, g, v);
309
+ $nin: function(r, s, c) {
310
+ var d = A.$in(r, s, c);
311
+ return function(h, p, g, v) {
312
+ return !d(h, p, g, v);
313
313
  };
314
314
  },
315
315
  $mod: function(r) {
316
- return function(i) {
317
- return i % r[0] == r[1];
316
+ return function(s) {
317
+ return s % r[0] == r[1];
318
318
  };
319
319
  },
320
- $ne: function(r, i, c) {
321
- var d = C.$eq(r, i, c);
322
- return $(function(p, h, g, v) {
323
- return !d(p, h, g, v);
320
+ $ne: function(r, s, c) {
321
+ var d = A.$eq(r, s, c);
322
+ return $(function(h, p, g, v) {
323
+ return !d(h, p, g, v);
324
324
  });
325
325
  },
326
- $and: function(r, i, c) {
326
+ $and: function(r, s, c) {
327
327
  return r.map(T(c));
328
328
  },
329
- $all: function(r, i, c) {
330
- return C.$and(r, i, c);
329
+ $all: function(r, s, c) {
330
+ return A.$and(r, s, c);
331
331
  },
332
- $or: function(r, i, c) {
332
+ $or: function(r, s, c) {
333
333
  return r.map(T(c));
334
334
  },
335
- $nor: function(r, i, c) {
335
+ $nor: function(r, s, c) {
336
336
  return r.map(T(c));
337
337
  },
338
- $not: function(r, i, c) {
338
+ $not: function(r, s, c) {
339
339
  var d = T(c)(r);
340
- return function(p, h, g) {
341
- return !b(d, p, h, g);
340
+ return function(h, p, g) {
341
+ return !m(d, h, p, g);
342
342
  };
343
343
  },
344
344
  $type: function(r) {
345
- return function(i, c, d) {
346
- return i != null && (i instanceof r || i.constructor == r);
345
+ return function(s, c, d) {
346
+ return s != null && (s instanceof r || s.constructor == r);
347
347
  };
348
348
  },
349
- $regex: function(r, i) {
350
- return new RegExp(r, i.$options);
349
+ $regex: function(r, s) {
350
+ return new RegExp(r, s.$options);
351
351
  },
352
352
  $where: function(r) {
353
353
  if (typeof r == "function") return r;
@@ -355,132 +355,132 @@ var Oe = { exports: {} };
355
355
  'In CSP mode, sift does not support strings in "$where" condition'
356
356
  );
357
357
  },
358
- $elemMatch: function(r, i, c) {
358
+ $elemMatch: function(r, s, c) {
359
359
  return T(c)(r);
360
360
  },
361
361
  $exists: function(r) {
362
362
  return !!r;
363
363
  }
364
364
  };
365
- function x(r, i) {
366
- return { options: r, validate: i };
365
+ function x(r, s) {
366
+ return { options: r, validate: s };
367
367
  }
368
- function Ae(r, i) {
369
- var c = r.keyPath, d = r.child, p = r.query, h = [];
370
- if (function he(j, M, k, Te, W) {
371
- if (k === M.length || j == null)
372
- return void W.push([j, M[k - 1], Te]);
373
- var ge = m(M, k);
374
- if (f(j) && isNaN(Number(ge)))
375
- for (var X = 0, Le = j.length; X < Le; X++) he(m(j, X), M, k, j, W);
376
- else he(m(j, ge), M, k + 1, j, W);
377
- }(i, c, 0, i, h), h.length === 1) {
378
- var g = h[0];
379
- return b(d, g[0], g[1], g[2]);
368
+ function Te(r, s) {
369
+ var c = r.keyPath, d = r.child, h = r.query, p = [];
370
+ if (function ge(j, M, D, Me, V) {
371
+ if (D === M.length || j == null)
372
+ return void V.push([j, M[D - 1], Me]);
373
+ var ye = b(M, D);
374
+ if (f(j) && isNaN(Number(ye)))
375
+ for (var X = 0, De = j.length; X < De; X++) ge(b(j, X), M, D, j, V);
376
+ else ge(b(j, ye), M, D + 1, j, V);
377
+ }(s, c, 0, s, p), p.length === 1) {
378
+ var g = p[0];
379
+ return m(d, g[0], g[1], g[2]);
380
380
  }
381
- for (var v = p && p.$ne !== void 0, F = v, S = 0; S < h.length; S++) {
382
- var A = h[S], G = b(d, A[0], A[1], A[2]);
383
- v ? F &= G : F |= G;
381
+ for (var v = h && h.$ne !== void 0, F = v, O = 0; O < p.length; O++) {
382
+ var C = p[O], H = m(d, C[0], C[1], C[2]);
383
+ v ? F &= H : F |= H;
384
384
  }
385
385
  return F;
386
386
  }
387
- function xe(r, i, c) {
388
- return x({ keyPath: r, child: i, query: c }, Ae);
387
+ function Le(r, s, c) {
388
+ return x({ keyPath: r, child: s, query: c }, Te);
389
389
  }
390
390
  function T(r) {
391
- var i = r.comparable, c = r.expressions, d = function(g) {
391
+ var s = r.comparable, c = r.expressions, d = function(g) {
392
392
  var v;
393
393
  return (!g || !(v = g) || v.constructor !== Object && v.constructor !== Array && v.constructor.toString() !== "function Object() { [native code] }" && v.constructor.toString() !== "function Array() { [native code] }" || v.toJSON) && (g = { $eq: g }), g;
394
- }, p = function(g) {
395
- g = i(g);
394
+ }, h = function(g) {
395
+ g = s(g);
396
396
  var v = [];
397
397
  for (var F in g) {
398
- var S = g[F];
398
+ var O = g[F];
399
399
  if (F !== "$options") {
400
- var A = I[F] || r && c && c[F];
401
- if (A) C[F] && (S = C[F](S, g, r)), v.push(x(i(S), A));
400
+ var C = P[F] || r && c && c[F];
401
+ if (C) A[F] && (O = A[F](O, g, r)), v.push(x(s(O), C));
402
402
  else {
403
403
  if (F.charCodeAt(0) === 36)
404
404
  throw new Error("Unknown operation " + F);
405
- var G = F.split(".");
406
- v.push(xe(G, h(S), S));
405
+ var H = F.split(".");
406
+ v.push(Le(H, p(O), O));
407
407
  }
408
408
  }
409
409
  }
410
- return v.length === 1 ? v[0] : x(v, I.$and);
411
- }, h = function(g) {
412
- return g = d(g), function v(F, S) {
413
- if (!y(F)) return S;
414
- for (var A in F) S.push(A), v(F[A], S);
415
- return S;
416
- }(g, []).join(",").search(/[$.]/) === -1 ? x(g, K) : p(g);
410
+ return v.length === 1 ? v[0] : x(v, P.$and);
411
+ }, p = function(g) {
412
+ return g = d(g), function v(F, O) {
413
+ if (!y(F)) return O;
414
+ for (var C in F) O.push(C), v(F[C], O);
415
+ return O;
416
+ }(g, []).join(",").search(/[$.]/) === -1 ? x(g, K) : h(g);
417
417
  };
418
418
  return function(g) {
419
- return p(d(g));
419
+ return h(d(g));
420
420
  };
421
421
  }
422
- function K(r, i) {
423
- if (Object.prototype.toString.call(r) !== Object.prototype.toString.call(i))
422
+ function K(r, s) {
423
+ if (Object.prototype.toString.call(r) !== Object.prototype.toString.call(s))
424
424
  return !1;
425
425
  if (y(r)) {
426
- if (Object.keys(r).length !== Object.keys(i).length) return !1;
427
- for (var c in r) if (!K(r[c], i[c])) return !1;
426
+ if (Object.keys(r).length !== Object.keys(s).length) return !1;
427
+ for (var c in r) if (!K(r[c], s[c])) return !1;
428
428
  return !0;
429
429
  }
430
430
  if (f(r)) {
431
- if (r.length !== i.length) return !1;
432
- for (var d = 0, p = r.length; d < p; d++)
433
- if (!K(r[d], i[d])) return !1;
431
+ if (r.length !== s.length) return !1;
432
+ for (var d = 0, h = r.length; d < h; d++)
433
+ if (!K(r[d], s[d])) return !1;
434
434
  return !0;
435
435
  }
436
- return r === i;
436
+ return r === s;
437
437
  }
438
- function de(r, i) {
439
- var c = T(i)(r);
440
- return i && i.select && (c = {
438
+ function he(r, s) {
439
+ var c = T(s)(r);
440
+ return s && s.select && (c = {
441
441
  options: c,
442
- validate: function(d, p, h, g) {
443
- return b(d, p && i.select(p), h, g);
442
+ validate: function(d, h, p, g) {
443
+ return m(d, h && s.select(h), p, g);
444
444
  }
445
445
  }), c;
446
446
  }
447
- function je(r, i) {
448
- var c = de(r, i = Object.assign({ compare: pe, comparable: V }, i));
449
- return function(d, p, h) {
450
- return b(c, d, p, h);
447
+ function Ne(r, s) {
448
+ var c = he(r, s = Object.assign({ compare: pe, comparable: z }, s));
449
+ return function(d, h, p) {
450
+ return m(c, d, h, p);
451
451
  };
452
452
  }
453
- function pe(r, i) {
454
- if (K(r, i)) return 0;
455
- if (a(r) === a(i)) {
456
- if (r > i) return 1;
457
- if (r < i) return -1;
453
+ function pe(r, s) {
454
+ if (K(r, s)) return 0;
455
+ if (a(r) === a(s)) {
456
+ if (r > s) return 1;
457
+ if (r < s) return -1;
458
458
  }
459
459
  }
460
- function V(r) {
461
- return r instanceof Date ? r.getTime() : f(r) ? r.map(V) : r && typeof r.toJSON == "function" ? r.toJSON() : r;
460
+ function z(r) {
461
+ return r instanceof Date ? r.getTime() : f(r) ? r.map(z) : r && typeof r.toJSON == "function" ? r.toJSON() : r;
462
462
  }
463
463
  }
464
464
  ]);
465
465
  });
466
466
  })(Oe);
467
- var qe = Oe.exports;
468
- const Ye = /* @__PURE__ */ Ue(qe);
469
- function ze(e, o) {
470
- for (var s = 0; s < o.length; s++) {
471
- var t = o[s];
467
+ var ze = Oe.exports;
468
+ const Ve = /* @__PURE__ */ Ge(ze);
469
+ function Xe(e, o) {
470
+ for (var i = 0; i < o.length; i++) {
471
+ var t = o[i];
472
472
  t.enumerable = t.enumerable || !1, t.configurable = !0, "value" in t && (t.writable = !0), Object.defineProperty(e, t.key, t);
473
473
  }
474
474
  }
475
- function Ve(e, o, s) {
476
- return o && ze(e.prototype, o), e;
475
+ function Ze(e, o, i) {
476
+ return o && Xe(e.prototype, o), e;
477
477
  }
478
- function We(e, o) {
478
+ function Qe(e, o) {
479
479
  e.prototype = Object.create(o.prototype), e.prototype.constructor = e, e.__proto__ = o;
480
480
  }
481
481
  function Q(e) {
482
- return Q = Object.setPrototypeOf ? Object.getPrototypeOf : function(s) {
483
- return s.__proto__ || Object.getPrototypeOf(s);
482
+ return Q = Object.setPrototypeOf ? Object.getPrototypeOf : function(i) {
483
+ return i.__proto__ || Object.getPrototypeOf(i);
484
484
  }, Q(e);
485
485
  }
486
486
  function q(e, o) {
@@ -488,7 +488,7 @@ function q(e, o) {
488
488
  return t.__proto__ = n, t;
489
489
  }, q(e, o);
490
490
  }
491
- function Xe() {
491
+ function et() {
492
492
  if (typeof Reflect > "u" || !Reflect.construct || Reflect.construct.sham) return !1;
493
493
  if (typeof Proxy == "function") return !0;
494
494
  try {
@@ -498,21 +498,21 @@ function Xe() {
498
498
  return !1;
499
499
  }
500
500
  }
501
- function J(e, o, s) {
502
- return Xe() ? J = Reflect.construct : J = function(n, a, l) {
501
+ function J(e, o, i) {
502
+ return et() ? J = Reflect.construct : J = function(n, a, l) {
503
503
  var f = [null];
504
504
  f.push.apply(f, a);
505
505
  var y = Function.bind.apply(n, f), w = new y();
506
506
  return l && q(w, l.prototype), w;
507
507
  }, J.apply(null, arguments);
508
508
  }
509
- function Ze(e) {
509
+ function tt(e) {
510
510
  return Function.toString.call(e).indexOf("[native code]") !== -1;
511
511
  }
512
512
  function ee(e) {
513
513
  var o = typeof Map == "function" ? /* @__PURE__ */ new Map() : void 0;
514
514
  return ee = function(t) {
515
- if (t === null || !Ze(t)) return t;
515
+ if (t === null || !tt(t)) return t;
516
516
  if (typeof t != "function")
517
517
  throw new TypeError("Super expression must either be null or a function");
518
518
  if (typeof o < "u") {
@@ -532,16 +532,16 @@ function ee(e) {
532
532
  }), q(n, t);
533
533
  }, ee(e);
534
534
  }
535
- function ye(e) {
535
+ function ve(e) {
536
536
  if (e === void 0)
537
537
  throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
538
538
  return e;
539
539
  }
540
- var Fe = function(o) {
540
+ var Ie = function(o) {
541
541
  return 'Cannot execute "' + o.action + '" on "' + o.subjectName + '"';
542
- }, H = Fe, Qe = /* @__PURE__ */ function(e) {
543
- We(o, e), o.setDefaultMessage = function(n) {
544
- n === null ? H = Fe : H = typeof n == "string" ? function() {
542
+ }, G = Ie, rt = /* @__PURE__ */ function(e) {
543
+ Qe(o, e), o.setDefaultMessage = function(n) {
544
+ n === null ? G = Ie : G = typeof n == "string" ? function() {
545
545
  return n;
546
546
  } : n;
547
547
  }, o.from = function(n) {
@@ -552,12 +552,12 @@ var Fe = function(o) {
552
552
  };
553
553
  function o(t, n) {
554
554
  var a;
555
- return n === void 0 && (n = {}), a = e.call(this, t) || this, a._setMetadata(n), a.message = t || H(ye(a)), a._customMessage = null, typeof Error.captureStackTrace == "function" && (a.name = a.constructor.name, Error.captureStackTrace(ye(a), a.constructor)), a;
555
+ return n === void 0 && (n = {}), a = e.call(this, t) || this, a._setMetadata(n), a.message = t || G(ve(a)), a._customMessage = null, typeof Error.captureStackTrace == "function" && (a.name = a.constructor.name, Error.captureStackTrace(ve(a), a.constructor)), a;
556
556
  }
557
- var s = o.prototype;
558
- return s.setMessage = function(n) {
557
+ var i = o.prototype;
558
+ return i.setMessage = function(n) {
559
559
  return this._customMessage = n, this;
560
- }, s.throwUnlessCan = function(n, a, l) {
560
+ }, i.throwUnlessCan = function(n, a, l) {
561
561
  if (!this.ability)
562
562
  throw new ReferenceError("Cannot throw FordiddenError without respective ability instance");
563
563
  var f = this.ability.relevantRuleFor(n, a, l);
@@ -569,46 +569,46 @@ var Fe = function(o) {
569
569
  subjectName: this.ability.subjectName(a)
570
570
  });
571
571
  var y = f ? f.reason : "";
572
- throw this.message = this._customMessage || y || H(this), this;
572
+ throw this.message = this._customMessage || y || G(this), this;
573
573
  }
574
- }, s._setMetadata = function(n) {
574
+ }, i._setMetadata = function(n) {
575
575
  this.subject = n.subject, this.subjectName = n.subjectName, this.action = n.action, this.field = n.field;
576
576
  }, o;
577
577
  }(ee(Error));
578
578
  function te(e) {
579
579
  return Array.isArray(e) ? e : [e];
580
580
  }
581
- function et(e) {
581
+ function nt(e) {
582
582
  if (!e || typeof e == "string")
583
583
  return e;
584
584
  var o = typeof e == "object" ? e.constructor : e;
585
585
  return o.modelName || o.name;
586
586
  }
587
- function tt(e) {
587
+ function ot(e) {
588
588
  return JSON.parse(JSON.stringify(e));
589
589
  }
590
- var rt = /[-/\\^$+?.()|[\]{}]/g, nt = /\.?\*+\.?/g, ot = /\*+/, at = /\./g;
591
- function it(e, o, s) {
592
- var t = s[0] === "*" || e[0] === "." && e[e.length - 1] === "." ? "+" : "*", n = e.indexOf("**") === -1 ? "[^.]" : ".", a = e.replace(at, "\\$&").replace(ot, n + t);
593
- return o + e.length === s.length ? "(?:" + a + ")?" : a;
590
+ var at = /[-/\\^$+?.()|[\]{}]/g, it = /\.?\*+\.?/g, st = /\*+/, ut = /\./g;
591
+ function lt(e, o, i) {
592
+ var t = i[0] === "*" || e[0] === "." && e[e.length - 1] === "." ? "+" : "*", n = e.indexOf("**") === -1 ? "[^.]" : ".", a = e.replace(ut, "\\$&").replace(st, n + t);
593
+ return o + e.length === i.length ? "(?:" + a + ")?" : a;
594
594
  }
595
- function st(e, o, s) {
596
- return e === "." && (s[o - 1] === "*" || s[o + 1] === "*") ? e : "\\" + e;
595
+ function ct(e, o, i) {
596
+ return e === "." && (i[o - 1] === "*" || i[o + 1] === "*") ? e : "\\" + e;
597
597
  }
598
- function ut(e) {
598
+ function ft(e) {
599
599
  var o = e.map(function(t) {
600
- return t.replace(rt, st).replace(nt, it);
601
- }), s = o.length > 1 ? "(?:" + o.join("|") + ")" : o[0];
602
- return new RegExp("^" + s + "$");
600
+ return t.replace(at, ct).replace(it, lt);
601
+ }), i = o.length > 1 ? "(?:" + o.join("|") + ")" : o[0];
602
+ return new RegExp("^" + i + "$");
603
603
  }
604
- var lt = /* @__PURE__ */ function() {
605
- function e(s) {
606
- this.actions = s.actions || s.action, this.subject = s.subject, this.fields = !s.fields || s.fields.length === 0 ? void 0 : te(s.fields), Object.defineProperty(this, "_fieldsPattern", {
604
+ var dt = /* @__PURE__ */ function() {
605
+ function e(i) {
606
+ this.actions = i.actions || i.action, this.subject = i.subject, this.fields = !i.fields || i.fields.length === 0 ? void 0 : te(i.fields), Object.defineProperty(this, "_fieldsPattern", {
607
607
  writable: !0
608
- }), this.inverted = !!s.inverted, this.conditions = s.conditions, Object.defineProperty(this, "_matches", {
608
+ }), this.inverted = !!i.inverted, this.conditions = i.conditions, Object.defineProperty(this, "_matches", {
609
609
  writable: !0,
610
- value: this.conditions ? Ye(this.conditions) : void 0
611
- }), this.reason = s.reason;
610
+ value: this.conditions ? Ve(this.conditions) : void 0
611
+ }), this.reason = i.reason;
612
612
  }
613
613
  var o = e.prototype;
614
614
  return o.matches = function(t) {
@@ -616,34 +616,34 @@ var lt = /* @__PURE__ */ function() {
616
616
  }, o.isRelevantFor = function(t, n) {
617
617
  return this.fields ? n ? this.matchesField(n) : !this.inverted : !0;
618
618
  }, o.matchesField = function(t) {
619
- return typeof this._fieldsPattern > "u" && (this._fieldsPattern = this.fields.join("").indexOf("*") === -1 ? null : ut(this.fields)), this._fieldsPattern === null || t.indexOf("*") !== -1 ? this.fields.indexOf(t) !== -1 : this._fieldsPattern.test(t);
619
+ return typeof this._fieldsPattern > "u" && (this._fieldsPattern = this.fields.join("").indexOf("*") === -1 ? null : ft(this.fields)), this._fieldsPattern === null || t.indexOf("*") !== -1 ? this.fields.indexOf(t) !== -1 : this._fieldsPattern.test(t);
620
620
  }, e;
621
- }(), P = typeof Symbol < "u" ? Symbol("private") : "__" + Date.now(), ve = {
621
+ }(), I = typeof Symbol < "u" ? Symbol("private") : "__" + Date.now(), me = {
622
622
  crud: ["create", "read", "update", "delete"]
623
623
  };
624
- function me(e, o) {
624
+ function be(e, o) {
625
625
  return e === o || Array.isArray(o) && o.indexOf(e) !== -1;
626
626
  }
627
- var ct = /* @__PURE__ */ function() {
627
+ var ht = /* @__PURE__ */ function() {
628
628
  e.addAlias = function(t, n) {
629
- if (t === "manage" || me("manage", n))
629
+ if (t === "manage" || be("manage", n))
630
630
  throw new Error('Cannot add alias for "manage" action because it represents any action');
631
- if (me(t, n))
631
+ if (be(t, n))
632
632
  throw new Error("Attempt to alias action to itself: " + t + " -> " + n.toString());
633
- return ve[t] = n, this;
633
+ return me[t] = n, this;
634
634
  };
635
- function e(s, t) {
635
+ function e(i, t) {
636
636
  t === void 0 && (t = {}), Object.defineProperty(this, "subjectName", {
637
- value: t.subjectName || et
638
- }), this[P] = {
639
- RuleType: t.RuleType || lt,
640
- originalRules: s || [],
637
+ value: t.subjectName || nt
638
+ }), this[I] = {
639
+ RuleType: t.RuleType || dt,
640
+ originalRules: i || [],
641
641
  hasPerFieldRules: !1,
642
642
  indexedRules: /* @__PURE__ */ Object.create(null),
643
643
  mergedRules: /* @__PURE__ */ Object.create(null),
644
644
  events: {},
645
- aliases: tt(ve)
646
- }, this.update(s);
645
+ aliases: ot(me)
646
+ }, this.update(i);
647
647
  }
648
648
  var o = e.prototype;
649
649
  return o.update = function(t) {
@@ -653,19 +653,19 @@ var ct = /* @__PURE__ */ function() {
653
653
  rules: t,
654
654
  ability: this
655
655
  };
656
- this.emit("update", n), this[P].originalRules = t.slice(0), this[P].mergedRules = /* @__PURE__ */ Object.create(null);
656
+ this.emit("update", n), this[I].originalRules = t.slice(0), this[I].mergedRules = /* @__PURE__ */ Object.create(null);
657
657
  var a = this.buildIndexFor(t);
658
- return this[P].indexedRules = a.rules, this[P].hasPerFieldRules = a.hasPerFieldRules, this.emit("updated", n), this;
658
+ return this[I].indexedRules = a.rules, this[I].hasPerFieldRules = a.hasPerFieldRules, this.emit("updated", n), this;
659
659
  }, o.buildIndexFor = function(t) {
660
- for (var n = /* @__PURE__ */ Object.create(null), a = this[P].RuleType, l = !0, f = !1, y = 0; y < t.length; y++) {
661
- var w = new a(t[y]), m = this.expandActions(w.actions), O = te(w.subject), $ = t.length - y - 1;
660
+ for (var n = /* @__PURE__ */ Object.create(null), a = this[I].RuleType, l = !0, f = !1, y = 0; y < t.length; y++) {
661
+ var w = new a(t[y]), b = this.expandActions(w.actions), S = te(w.subject), $ = t.length - y - 1;
662
662
  l = !!(l && w.inverted), !f && w.fields && (f = !0);
663
- for (var b = 0; b < O.length; b++) {
664
- var I = O[b];
665
- n[I] = n[I] || /* @__PURE__ */ Object.create(null);
666
- for (var C = 0; C < m.length; C++) {
667
- var x = m[C];
668
- n[I][x] = n[I][x] || /* @__PURE__ */ Object.create(null), n[I][x][$] = w;
663
+ for (var m = 0; m < S.length; m++) {
664
+ var P = S[m];
665
+ n[P] = n[P] || /* @__PURE__ */ Object.create(null);
666
+ for (var A = 0; A < b.length; A++) {
667
+ var x = b[A];
668
+ n[P][x] = n[P][x] || /* @__PURE__ */ Object.create(null), n[P][x][$] = w;
669
669
  }
670
670
  }
671
671
  }
@@ -675,7 +675,7 @@ var ct = /* @__PURE__ */ function() {
675
675
  rules: n
676
676
  };
677
677
  }, o.expandActions = function(t) {
678
- for (var n = this[P].aliases, a = te(t), l = 0; l < a.length; ) {
678
+ for (var n = this[I].aliases, a = te(t), l = 0; l < a.length; ) {
679
679
  var f = a[l++];
680
680
  n.hasOwnProperty(f) && (a = a.concat(n[f]));
681
681
  }
@@ -691,17 +691,17 @@ var ct = /* @__PURE__ */ function() {
691
691
  return l[f];
692
692
  return null;
693
693
  }, o.possibleRulesFor = function(t, n) {
694
- var a = this.subjectName(n), l = this[P].mergedRules, f = a + "_" + t;
694
+ var a = this.subjectName(n), l = this[I].mergedRules, f = a + "_" + t;
695
695
  return l[f] || (l[f] = this.mergeRulesFor(t, a)), l[f];
696
696
  }, o.mergeRulesFor = function(t, n) {
697
- var a = this[P].indexedRules, l = [n, "all"].reduce(function(f, y) {
697
+ var a = this[I].indexedRules, l = [n, "all"].reduce(function(f, y) {
698
698
  var w = a[y];
699
699
  return w ? Object.assign(f, w[t], w.manage) : f;
700
700
  }, []);
701
701
  return l.filter(Boolean);
702
702
  }, o.rulesFor = function(t, n, a) {
703
703
  var l = this.possibleRulesFor(t, n);
704
- return this[P].hasPerFieldRules ? l.filter(function(f) {
704
+ return this[I].hasPerFieldRules ? l.filter(function(f) {
705
705
  return f.isRelevantFor(n, a);
706
706
  }) : l;
707
707
  }, o.cannot = function() {
@@ -711,9 +711,9 @@ var ct = /* @__PURE__ */ function() {
711
711
  console.warn(`
712
712
  Ability.throwUnlessCan is deprecated and will be removed in 4.x version.
713
713
  Please use "ForbiddenError.from(ability).throwUnlessCan(...)" instead.
714
- `.trim()), (t = Qe.from(this)).throwUnlessCan.apply(t, arguments);
714
+ `.trim()), (t = rt.from(this)).throwUnlessCan.apply(t, arguments);
715
715
  }, o.on = function(t, n) {
716
- var a = this[P].events, l = !0;
716
+ var a = this[I].events, l = !0;
717
717
  return a[t] || (a[t] = []), a[t].push(n), function() {
718
718
  if (l) {
719
719
  var f = a[t].indexOf(n);
@@ -721,34 +721,34 @@ var ct = /* @__PURE__ */ function() {
721
721
  }
722
722
  };
723
723
  }, o.emit = function(t, n) {
724
- var a = this[P].events[t];
724
+ var a = this[I].events[t];
725
725
  a && a.slice(0).forEach(function(l) {
726
726
  return l(n);
727
727
  });
728
- }, Ve(e, [{
728
+ }, Ze(e, [{
729
729
  key: "rules",
730
730
  get: function() {
731
- return this[P].originalRules;
731
+ return this[I].originalRules;
732
732
  }
733
733
  }]), e;
734
734
  }();
735
- function ft(e) {
736
- return new ct(e).can("manage", "business::miniProgram::brandkit");
735
+ function pt(e) {
736
+ return new ht(e).can("manage", "business::miniProgram::brandkit");
737
737
  }
738
- function z() {
738
+ function Y() {
739
739
  var o;
740
- const e = ((o = Be().sessionUser.value) == null ? void 0 : o.permissions) ?? [];
741
- return ft(
742
- e.map(({ fields: s, inverted: t, reason: n, ...a }) => ({
740
+ const e = ((o = He().sessionUser.value) == null ? void 0 : o.permissions) ?? [];
741
+ return pt(
742
+ e.map(({ fields: i, inverted: t, reason: n, ...a }) => ({
743
743
  ...a,
744
- fields: s ?? void 0,
744
+ fields: i ?? void 0,
745
745
  inverted: t ?? void 0,
746
746
  reason: n ?? void 0
747
747
  }))
748
748
  );
749
749
  }
750
- function Tt() {
751
- return B(z);
750
+ function Mt() {
751
+ return B(Y);
752
752
  }
753
753
  const U = [
754
754
  { path: "primary", label: "Primary", group: "Brand", hint: "Dominant brand color" },
@@ -781,29 +781,34 @@ const U = [
781
781
  { path: "brand", label: "Brand", group: "Fonts", hint: "Logo / wordmark contexts" },
782
782
  { path: "heading", label: "Heading", group: "Fonts" },
783
783
  { path: "body", label: "Body", group: "Fonts" }
784
- ], re = "HORIZONTAL", ne = "LIST", oe = !1, Se = {
784
+ ], re = "HORIZONTAL", ne = "LIST", oe = !1, ae = !1, Ee = ["showCategoryImage", "showScheduledItems"], _e = {
785
785
  category: ["HORIZONTAL", "VERTICAL"],
786
786
  items: ["LIST", "GRID"]
787
- }, dt = { category: "VERTICAL", singleCategory: !1 };
788
- function pt(e) {
789
- const o = R(e, "ordering.app.category");
787
+ }, gt = { category: "VERTICAL", singleCategory: !1 };
788
+ function yt(e) {
789
+ const o = E(e, "ordering.app.category");
790
790
  return o === "VERTICAL" || o === "HORIZONTAL" ? o : re;
791
791
  }
792
- function ht(e) {
793
- return R(e, "ordering.app.items") === "GRID" ? "GRID" : ne;
792
+ function vt(e) {
793
+ return E(e, "ordering.app.items") === "GRID" ? "GRID" : ne;
794
794
  }
795
- function gt(e) {
796
- const o = R(e, "ordering.app.showCategoryImage");
797
- return typeof o == "boolean" ? o : oe;
795
+ const mt = {
796
+ showCategoryImage: oe,
797
+ showScheduledItems: ae
798
+ };
799
+ function we(e, o) {
800
+ const i = E(e, `ordering.app.${o}`);
801
+ return typeof i == "boolean" ? i : mt[o];
798
802
  }
799
- function yt(e, o, s) {
800
- (!e.ordering || typeof e.ordering != "object") && (e.ordering = { kiosk: { ...dt } });
803
+ function bt(e, o, i) {
804
+ (!e.ordering || typeof e.ordering != "object") && (e.ordering = { kiosk: { ...gt } });
801
805
  const t = e.ordering;
802
806
  (!t.app || typeof t.app != "object") && (t.app = { singleCategory: !1 });
803
807
  const n = t.app;
804
808
  for (const a of ["category", "items"])
805
- (s.includes(a) || !Se[a].includes(n[a])) && (n[a] = o[a]);
806
- s.includes("showCategoryImage") && (n.showCategoryImage = o.showCategoryImage);
809
+ (i.includes(a) || !_e[a].includes(n[a])) && (n[a] = o[a]);
810
+ for (const a of Ee)
811
+ i.includes(a) && (n[a] = o[a]);
807
812
  }
808
813
  const Pe = {
809
814
  primary: "#ff7823",
@@ -826,36 +831,36 @@ const Pe = {
826
831
  brand: "'Inter', sans-serif",
827
832
  heading: "'Inter', sans-serif",
828
833
  body: "'Roboto', sans-serif"
829
- }, Ee = /^#([0-9a-f]{3}|[0-9a-f]{6})$/i;
830
- function vt(e) {
831
- return Ee.test(e.trim());
834
+ }, $e = /^#([0-9a-f]{3}|[0-9a-f]{6})$/i;
835
+ function wt(e) {
836
+ return $e.test(e.trim());
832
837
  }
833
- function be(e) {
838
+ function Se(e) {
834
839
  const o = e.trim().toLowerCase();
835
- if (!Ee.test(o)) return "#000000";
840
+ if (!$e.test(o)) return "#000000";
836
841
  if (o.length === 7) return o;
837
- const [s, t, n] = o.slice(1);
838
- return `#${s}${s}${t}${t}${n}${n}`;
842
+ const [i, t, n] = o.slice(1);
843
+ return `#${i}${i}${t}${t}${n}${n}`;
839
844
  }
840
- function mt() {
841
- return Ne(Me("fmmf:dev")).apiOrigin;
845
+ function St() {
846
+ return ke(Be("fmmf:dev")).apiOrigin;
842
847
  }
843
- function ce(e) {
844
- return `${mt()}/metadata/${e}/brandkit`;
848
+ function fe(e) {
849
+ return `${St()}/metadata/${e}/brandkit`;
845
850
  }
846
- async function Ie() {
847
- const e = await De();
851
+ async function Ae() {
852
+ const e = await Ke();
848
853
  return e ? { "Content-Type": "application/json", Authorization: e } : { "Content-Type": "application/json" };
849
854
  }
850
- function R(e, o) {
851
- let s = e;
855
+ function E(e, o) {
856
+ let i = e;
852
857
  for (const t of o.split(".")) {
853
- if (!s || typeof s != "object") return;
854
- s = s[t];
858
+ if (!i || typeof i != "object") return;
859
+ i = i[t];
855
860
  }
856
- return s;
861
+ return i;
857
862
  }
858
- function ae(e, o, s) {
863
+ function ie(e, o, i) {
859
864
  const t = o.split("."), n = t.pop();
860
865
  if (!n) return;
861
866
  let a = e;
@@ -863,20 +868,20 @@ function ae(e, o, s) {
863
868
  const f = a[l];
864
869
  (!f || typeof f != "object") && (a[l] = {}), a = a[l];
865
870
  }
866
- a[n] = s;
871
+ a[n] = i;
867
872
  }
868
- function ie(e, o, s) {
873
+ function se(e, o, i) {
869
874
  const t = {};
870
- for (const n of s) {
871
- const a = R(e == null ? void 0 : e[o], n.path);
875
+ for (const n of i) {
876
+ const a = E(e == null ? void 0 : e[o], n.path);
872
877
  t[n.path] = typeof a == "string" ? a : "";
873
878
  }
874
879
  return t;
875
880
  }
876
- function se(e) {
881
+ function ue(e) {
877
882
  return JSON.parse(JSON.stringify(e));
878
883
  }
879
- const u = ke({
884
+ const u = Ue({
880
885
  panelOpen: !1,
881
886
  loading: !1,
882
887
  saving: !1,
@@ -893,119 +898,128 @@ const u = ke({
893
898
  savedMenuItems: ne,
894
899
  showCategoryImage: oe,
895
900
  savedShowCategoryImage: oe,
901
+ showScheduledItems: ae,
902
+ savedShowScheduledItems: ae,
896
903
  // Full kit as it was before our last save — the only undo colors get.
897
904
  revertKit: null,
898
905
  appliedProposal: null
899
906
  });
900
- async function fe(e) {
901
- const o = await fetch(ce(e), { signal: AbortSignal.timeout(15e3) });
907
+ async function de(e) {
908
+ const o = await fetch(fe(e), { signal: AbortSignal.timeout(15e3) });
902
909
  if (o.status === 404) return null;
903
910
  if (!o.ok) throw new Error(`GET brandkit failed: HTTP ${o.status}`);
904
911
  return await o.json();
905
912
  }
906
- function Y(e) {
907
- u.colors = ie(e, "colors", U), u.fonts = ie(e, "fonts", N), u.savedColors = { ...u.colors }, u.savedFonts = { ...u.fonts }, u.categoryLayout = pt(e), u.savedCategoryLayout = u.categoryLayout, u.menuItems = ht(e), u.savedMenuItems = u.menuItems, u.showCategoryImage = gt(e), u.savedShowCategoryImage = u.showCategoryImage, u.loaded = !0;
913
+ function W(e) {
914
+ u.colors = se(e, "colors", U), u.fonts = se(e, "fonts", N), u.savedColors = { ...u.colors }, u.savedFonts = { ...u.fonts }, u.categoryLayout = yt(e), u.savedCategoryLayout = u.categoryLayout, u.menuItems = vt(e), u.savedMenuItems = u.menuItems, u.showCategoryImage = we(e, "showCategoryImage"), u.savedShowCategoryImage = u.showCategoryImage, u.showScheduledItems = we(e, "showScheduledItems"), u.savedShowScheduledItems = u.showScheduledItems, u.loaded = !0;
908
915
  }
909
- let L = null, E = 0, D = null;
910
- function _e(e = !1) {
911
- const o = _();
916
+ let L = null, _ = 0, k = null;
917
+ function Ce(e = !1) {
918
+ const o = R();
912
919
  if (u.loaded && !e && u.businessId === o) return Promise.resolve();
913
920
  if ((L == null ? void 0 : L.businessId) === o) return L.promise;
914
- const s = ++E;
915
- u.businessId !== o && (u.businessId = o, u.loaded = !1, u.revertKit = null, D = null, u.appliedProposal = null, Y(null), u.loaded = !1);
921
+ const i = ++_;
922
+ u.businessId !== o && (u.businessId = o, u.loaded = !1, u.revertKit = null, k = null, u.appliedProposal = null, W(null), u.loaded = !1);
916
923
  const t = (async () => {
917
924
  u.loading = !0, u.error = null;
918
925
  try {
919
- const n = await fe(o);
920
- s === E && Y(n);
926
+ const n = await de(o);
927
+ i === _ && W(n);
921
928
  } catch (n) {
922
- s === E && (u.error = ue(n));
929
+ i === _ && (u.error = le(n));
923
930
  } finally {
924
- s === E && (u.loading = !1, L = null);
931
+ i === _ && (u.loading = !1, L = null);
925
932
  }
926
933
  })();
927
934
  return L = { businessId: o, promise: t }, t;
928
935
  }
929
- function $e() {
936
+ function xe() {
930
937
  const e = U.filter((t) => u.colors[t.path] !== u.savedColors[t.path]).map(
931
938
  (t) => t.path
932
939
  ), o = N.filter((t) => u.fonts[t.path] !== u.savedFonts[t.path]).map(
933
940
  (t) => t.path
934
- ), s = [];
935
- return u.categoryLayout !== u.savedCategoryLayout && s.push("category"), u.menuItems !== u.savedMenuItems && s.push("items"), u.showCategoryImage !== u.savedShowCategoryImage && s.push("showCategoryImage"), { colorPaths: e, fontPaths: o, layoutFields: s };
941
+ ), i = [];
942
+ return u.categoryLayout !== u.savedCategoryLayout && i.push("category"), u.menuItems !== u.savedMenuItems && i.push("items"), u.showCategoryImage !== u.savedShowCategoryImage && i.push("showCategoryImage"), u.showScheduledItems !== u.savedShowScheduledItems && i.push("showScheduledItems"), { colorPaths: e, fontPaths: o, layoutFields: i };
936
943
  }
937
- const bt = B(() => {
938
- const { colorPaths: e, fontPaths: o, layoutFields: s } = $e();
939
- return e.length + o.length + s.length;
940
- }), Ce = B(
944
+ const Ft = B(() => {
945
+ const { colorPaths: e, fontPaths: o, layoutFields: i } = xe();
946
+ return e.length + o.length + i.length;
947
+ }), je = B(
941
948
  () => U.some((e) => {
942
949
  const o = u.colors[e.path] ?? "";
943
- return o !== "" && !vt(o);
950
+ return o !== "" && !wt(o);
944
951
  })
945
952
  );
946
- async function wt() {
947
- const e = _();
948
- if (!z())
953
+ async function Ot() {
954
+ const e = R();
955
+ if (!Y())
949
956
  throw u.error = "You do not have permission to manage this Brand Kit. Contact an administrator.", new Error(u.error);
950
957
  if (u.saving || u.loading || !u.loaded || u.businessId !== e)
951
958
  throw new Error("Wait for the current Brand Kit to finish loading or saving.");
952
- if (Ce.value) throw new Error("Enter valid hex colors before saving.");
953
- const { colorPaths: o, fontPaths: s, layoutFields: t } = $e();
954
- if (!o.length && !s.length && !t.length) return;
955
- const n = { ...u.colors }, a = { ...u.fonts }, l = { category: u.categoryLayout, items: u.menuItems, showCategoryImage: u.showCategoryImage }, f = E;
959
+ if (je.value) throw new Error("Enter valid hex colors before saving.");
960
+ const { colorPaths: o, fontPaths: i, layoutFields: t } = xe();
961
+ if (!o.length && !i.length && !t.length) return;
962
+ const n = { ...u.colors }, a = { ...u.fonts }, l = {
963
+ category: u.categoryLayout,
964
+ items: u.menuItems,
965
+ showCategoryImage: u.showCategoryImage,
966
+ showScheduledItems: u.showScheduledItems
967
+ }, f = _;
956
968
  u.saving = !0, u.error = null;
957
969
  try {
958
- const y = await fe(e) ?? {}, w = se(y), m = se(y);
959
- o.length && (!m.colors || typeof m.colors != "object") && (m.colors = {}), s.length && (!m.fonts || typeof m.fonts != "object") && (m.fonts = {});
960
- for (const b of o) ae(m.colors, b, (n[b] ?? "").trim());
961
- for (const b of s) ae(m.fonts, b, (a[b] ?? "").trim());
962
- s.length && (m.fontFamilies = Je(y.fontFamilies, ie(m, "fonts", N)));
963
- const O = t.length ? [
970
+ const y = await de(e) ?? {}, w = ue(y), b = ue(y);
971
+ o.length && (!b.colors || typeof b.colors != "object") && (b.colors = {}), i.length && (!b.fonts || typeof b.fonts != "object") && (b.fonts = {});
972
+ for (const m of o) ie(b.colors, m, (n[m] ?? "").trim());
973
+ for (const m of i) ie(b.fonts, m, (a[m] ?? "").trim());
974
+ i.length && (b.fontFamilies = Ye(y.fontFamilies, se(b, "fonts", N)));
975
+ const S = t.length ? [
964
976
  ...["category", "items"].filter(
965
- (b) => t.includes(b) || !Se[b].includes(R(y, `ordering.app.${b}`))
977
+ (m) => t.includes(m) || !_e[m].includes(E(y, `ordering.app.${m}`))
966
978
  ),
967
- ...t.includes("showCategoryImage") ? ["showCategoryImage"] : []
979
+ ...Ee.filter((m) => t.includes(m))
968
980
  ] : [];
969
- if (t.length && yt(m, l, t), f !== E || e !== _())
981
+ if (t.length && bt(b, l, t), f !== _ || e !== R())
970
982
  throw new Error("Business changed. No Brand Kit was saved.");
971
- const $ = await fetch(ce(e), {
983
+ const $ = await fetch(fe(e), {
972
984
  method: "POST",
973
- headers: await Ie(),
974
- body: JSON.stringify(m),
985
+ headers: await Ae(),
986
+ body: JSON.stringify(b),
975
987
  signal: AbortSignal.timeout(2e4)
976
988
  });
977
989
  if (!$.ok) throw new Error(`Save failed: HTTP ${$.status}`);
978
- f === E && e === _() && (u.revertKit = w, D = {
990
+ f === _ && e === R() && (u.revertKit = w, k = {
979
991
  colorPaths: o,
980
- fontPaths: s,
981
- savedFontFamilies: s.length ? JSON.stringify(m.fontFamilies) : void 0,
982
- ...O.length ? {
992
+ fontPaths: i,
993
+ savedFontFamilies: i.length ? JSON.stringify(b.fontFamilies) : void 0,
994
+ ...S.length ? {
983
995
  menuLayout: {
984
- fields: O,
985
- previous: Object.fromEntries(O.map((b) => [b, R(y, `ordering.app.${b}`)]))
996
+ fields: S,
997
+ previous: Object.fromEntries(
998
+ S.map((m) => [m, E(y, `ordering.app.${m}`)])
999
+ )
986
1000
  }
987
1001
  } : {}
988
- }, u.appliedProposal = null, Y(m));
1002
+ }, u.appliedProposal = null, W(b));
989
1003
  } catch (y) {
990
- throw f === E && (u.error = ue(y)), y;
1004
+ throw f === _ && (u.error = le(y)), y;
991
1005
  } finally {
992
1006
  u.saving = !1;
993
1007
  }
994
1008
  }
995
- async function Ot() {
996
- if (!u.revertKit || !D || u.saving || u.loading) return;
997
- const e = _();
998
- if (!z())
1009
+ async function It() {
1010
+ if (!u.revertKit || !k || u.saving || u.loading) return;
1011
+ const e = R();
1012
+ if (!Y())
999
1013
  throw u.error = "You do not have permission to manage this Brand Kit. Contact an administrator.", new Error(u.error);
1000
1014
  if (u.businessId !== e) throw new Error("Load the current business before reverting.");
1001
- const o = E, s = se(u.revertKit), t = D;
1015
+ const o = _, i = ue(u.revertKit), t = k;
1002
1016
  u.saving = !0, u.error = null;
1003
1017
  try {
1004
- const n = await fe(e) ?? {};
1018
+ const n = await de(e) ?? {};
1005
1019
  if (t.fontPaths.length) {
1006
- if (N.some((l) => (R(n.fonts, l.path) ?? "") !== u.savedFonts[l.path]) || JSON.stringify(n.fontFamilies) !== t.savedFontFamilies)
1020
+ if (N.some((l) => (E(n.fonts, l.path) ?? "") !== u.savedFonts[l.path]) || JSON.stringify(n.fontFamilies) !== t.savedFontFamilies)
1007
1021
  throw new Error("Brand Kit changed since your save. Reload it before editing again.");
1008
- Object.hasOwn(s, "fontFamilies") ? n.fontFamilies = s.fontFamilies : delete n.fontFamilies;
1022
+ Object.hasOwn(i, "fontFamilies") ? n.fontFamilies = i.fontFamilies : delete n.fontFamilies;
1009
1023
  }
1010
1024
  for (const [l, f] of [
1011
1025
  ["colors", t.colorPaths],
@@ -1013,14 +1027,14 @@ async function Ot() {
1013
1027
  ]) {
1014
1028
  const y = l === "colors" ? u.savedColors : u.savedFonts;
1015
1029
  for (const w of f) {
1016
- if ((R(n[l], w) ?? "") !== y[w])
1030
+ if ((E(n[l], w) ?? "") !== y[w])
1017
1031
  throw new Error("Brand Kit changed since your save. Reload it before editing again.");
1018
1032
  (!n[l] || typeof n[l] != "object") && (n[l] = {});
1019
- const m = R(s[l], w);
1020
- if (typeof m == "string") ae(n[l], w, m);
1033
+ const b = E(i[l], w);
1034
+ if (typeof b == "string") ie(n[l], w, b);
1021
1035
  else {
1022
- const O = w.split("."), $ = O.pop(), b = O.length ? R(n[l], O.join(".")) : n[l];
1023
- b && typeof b == "object" && delete b[$];
1036
+ const S = w.split("."), $ = S.pop(), m = S.length ? E(n[l], S.join(".")) : n[l];
1037
+ m && typeof m == "object" && delete m[$];
1024
1038
  }
1025
1039
  }
1026
1040
  }
@@ -1028,83 +1042,84 @@ async function Ot() {
1028
1042
  const l = {
1029
1043
  category: u.savedCategoryLayout,
1030
1044
  items: u.savedMenuItems,
1031
- showCategoryImage: u.savedShowCategoryImage
1045
+ showCategoryImage: u.savedShowCategoryImage,
1046
+ showScheduledItems: u.savedShowScheduledItems
1032
1047
  };
1033
- if (t.menuLayout.fields.some((y) => R(n, `ordering.app.${y}`) !== l[y]))
1048
+ if (t.menuLayout.fields.some((y) => E(n, `ordering.app.${y}`) !== l[y]))
1034
1049
  throw new Error("Brand Kit changed since your save. Reload it before editing again.");
1035
- const f = R(n, "ordering.app");
1050
+ const f = E(n, "ordering.app");
1036
1051
  for (const y of t.menuLayout.fields) {
1037
1052
  if (!f || typeof f != "object") break;
1038
1053
  const w = t.menuLayout.previous[y];
1039
1054
  w === void 0 ? delete f[y] : f[y] = w;
1040
1055
  }
1041
1056
  }
1042
- if (o !== E || e !== _())
1057
+ if (o !== _ || e !== R())
1043
1058
  throw new Error("Business changed. No Brand Kit was reverted.");
1044
- const a = await fetch(ce(e), {
1059
+ const a = await fetch(fe(e), {
1045
1060
  method: "POST",
1046
- headers: await Ie(),
1061
+ headers: await Ae(),
1047
1062
  body: JSON.stringify(n),
1048
1063
  signal: AbortSignal.timeout(2e4)
1049
1064
  });
1050
1065
  if (!a.ok) throw new Error(`Revert failed: HTTP ${a.status}`);
1051
- o === E && e === _() && (u.revertKit = null, D = null, Y(n));
1066
+ o === _ && e === R() && (u.revertKit = null, k = null, W(n));
1052
1067
  } catch (n) {
1053
- throw o === E && (u.error = ue(n)), n;
1068
+ throw o === _ && (u.error = le(n)), n;
1054
1069
  } finally {
1055
1070
  u.saving = !1;
1056
1071
  }
1057
1072
  }
1058
- async function Ft(e) {
1073
+ async function Et(e) {
1059
1074
  u.panelOpen = !0;
1060
- const o = _();
1061
- if (await _e(), !(!u.loaded || u.loading || u.saving || u.businessId !== o || _() !== o)) {
1062
- for (const s of U) {
1063
- const t = e.colors[s.path];
1064
- t && (u.colors[s.path] = t);
1075
+ const o = R();
1076
+ if (await Ce(), !(!u.loaded || u.loading || u.saving || u.businessId !== o || R() !== o)) {
1077
+ for (const i of U) {
1078
+ const t = e.colors[i.path];
1079
+ t && (u.colors[i.path] = t);
1065
1080
  }
1066
- for (const s of N) {
1067
- const t = e.fonts[s.path];
1068
- t && (u.fonts[s.path] = t);
1081
+ for (const i of N) {
1082
+ const t = e.fonts[i.path];
1083
+ t && (u.fonts[i.path] = t);
1069
1084
  }
1070
1085
  u.appliedProposal = e.name ?? "Untitled proposal";
1071
1086
  }
1072
1087
  }
1073
- function St() {
1074
- u.colors = { ...u.savedColors }, u.fonts = { ...u.savedFonts }, u.categoryLayout = u.savedCategoryLayout, u.menuItems = u.savedMenuItems, u.showCategoryImage = u.savedShowCategoryImage, u.appliedProposal = null;
1088
+ function _t() {
1089
+ u.colors = { ...u.savedColors }, u.fonts = { ...u.savedFonts }, u.categoryLayout = u.savedCategoryLayout, u.menuItems = u.savedMenuItems, u.showCategoryImage = u.savedShowCategoryImage, u.showScheduledItems = u.savedShowScheduledItems, u.appliedProposal = null;
1075
1090
  }
1076
1091
  const Pt = B(
1077
- () => U.every((e) => be(u.colors[e.path] ?? "") === be(Pe[e.path]))
1092
+ () => U.every((e) => Se(u.colors[e.path] ?? "") === Se(Pe[e.path]))
1078
1093
  ), Rt = B(
1079
1094
  () => N.every((e) => u.fonts[e.path] === Re[e.path])
1080
1095
  );
1081
- function Et(e) {
1082
- !z() || !u.loaded || u.loading || u.saving || u.businessId !== _() || (e === "colors" ? u.colors = { ...Pe } : u.fonts = { ...Re }, u.appliedProposal = null);
1096
+ function $t(e) {
1097
+ !Y() || !u.loaded || u.loading || u.saving || u.businessId !== R() || (e === "colors" ? u.colors = { ...Pe } : u.fonts = { ...Re }, u.appliedProposal = null);
1083
1098
  }
1084
- function Lt() {
1099
+ function Dt() {
1085
1100
  return {
1086
1101
  state: u,
1087
- dirtyCount: bt,
1088
- hasInvalidColor: Ce,
1102
+ dirtyCount: Ft,
1103
+ hasInvalidColor: je,
1089
1104
  colorsAreDefault: Pt,
1090
1105
  fontsAreDefault: Rt,
1091
- load: _e,
1092
- save: wt,
1093
- revertLastSave: Ot,
1094
- applyProposal: Ft,
1095
- resetToDefault: Et,
1096
- discardEdits: St
1106
+ load: Ce,
1107
+ save: Ot,
1108
+ revertLastSave: It,
1109
+ applyProposal: Et,
1110
+ resetToDefault: $t,
1111
+ discardEdits: _t
1097
1112
  };
1098
1113
  }
1099
1114
  export {
1100
1115
  U as C,
1101
1116
  N as F,
1102
- le as G,
1103
- Tt as a,
1104
- Ge as b,
1105
- xt as f,
1106
- vt as i,
1107
- jt as l,
1108
- be as t,
1109
- Lt as u
1117
+ ce as G,
1118
+ Mt as a,
1119
+ qe as b,
1120
+ Lt as f,
1121
+ wt as i,
1122
+ Nt as l,
1123
+ Se as t,
1124
+ Dt as u
1110
1125
  };