favesalon-embed 1.0.3 → 1.0.5

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.
Files changed (52) hide show
  1. package/dist/custom-elements/index.d.ts +6 -0
  2. package/dist/favesalon-embed/app-globals-74127f4b.js +7 -0
  3. package/dist/favesalon-embed/chat-box.entry.js +4 -3
  4. package/dist/favesalon-embed/chat-button.entry.js +2 -2
  5. package/dist/favesalon-embed/chat-form.entry.js +2 -2
  6. package/dist/favesalon-embed/chat-messages.entry.js +23 -5
  7. package/dist/favesalon-embed/chat-rooms.entry.js +50 -17218
  8. package/dist/favesalon-embed/favesalon-embed.css +1 -2326
  9. package/dist/favesalon-embed/favesalon-embed.esm.js +2 -2
  10. package/dist/favesalon-embed/lodash-d5526b38.js +17215 -0
  11. package/dist/favesalon-embed/notify-sounds.entry.js +31 -0
  12. package/dist/favesalon-embed/salon-info.entry.js +1 -1
  13. package/dist/favesalon-embed/salon-latest-reviews.entry.js +2 -2
  14. package/dist/favesalon-embed/salon-latest-styles.entry.js +1 -1
  15. package/dist/favesalon-embed/salon-locations.entry.js +2 -2
  16. package/dist/favesalon-embed/salon-lookbook.entry.js +1 -1
  17. package/dist/favesalon-embed/salon-reviews.entry.js +1 -1
  18. package/dist/favesalon-embed/salon-schedules.entry.js +1 -1
  19. package/dist/favesalon-embed/salon-services.entry.js +1 -1
  20. package/dist/favesalon-embed/salon-stylists.entry.js +1 -1
  21. package/dist/favesalon-embed/services-122dcf73.js +23886 -0
  22. package/dist/favesalon-embed/{services-7c46a2fd.js → services-23eda072.js} +25 -2
  23. package/dist/favesalon-embed/{services-55a87166.js → services-243eef47.js} +229 -4
  24. package/dist/favesalon-embed/services-260ea6eb.js +23883 -0
  25. package/dist/favesalon-embed/services-27607998.js +23886 -0
  26. package/dist/favesalon-embed/{services-7cb8f2a6.js → services-46b2f0aa.js} +15 -2
  27. package/dist/favesalon-embed/services-65a8cf4a.js +23887 -0
  28. package/dist/favesalon-embed/services-8f52210f.js +23880 -0
  29. package/dist/favesalon-embed/services-de32365e.js +23880 -0
  30. package/dist/favesalon-embed/services-e9cfcd2b.js +23885 -0
  31. package/dist/favesalon-embed/services-f7278483.js +23880 -0
  32. package/dist/favesalon-embed/services-f9872bea.js +23880 -0
  33. package/dist/favesalon-embed/style-detail.entry.js +1 -1
  34. package/dist/favesalon-embed/utils-89c2cff2.js +32 -0
  35. package/dist/favesalon-embed/utils-e226fa04.js +32 -0
  36. package/dist/favesalon-embed/utils-fd30fb29.js +32 -0
  37. package/dist/types/components/chat-box/index.d.ts +1 -0
  38. package/dist/types/components/chat-button/notify-sounds.d.ts +5 -0
  39. package/dist/types/components/chat-rooms/index.d.ts +6 -0
  40. package/dist/types/components.d.ts +21 -0
  41. package/dist/types/services/services.d.ts +1 -0
  42. package/dist/types/types/chat.d.ts +1 -0
  43. package/dist/types/types/user.d.ts +10 -0
  44. package/dist/types/utils/utils.d.ts +1 -0
  45. package/package.json +1 -1
  46. package/dist/favesalon-embed/_commonjsHelpers-9bc404fc.js +0 -44
  47. package/dist/favesalon-embed/app-globals-437cc3f3.js +0 -712
  48. package/dist/favesalon-embed/app-globals-60769a2c.js +0 -712
  49. package/dist/favesalon-embed/index-04c09911.js +0 -3371
  50. package/dist/favesalon-embed/index-ac52896a.js +0 -4803
  51. package/dist/favesalon-embed/isObject-13b86c17.js +0 -203
  52. package/dist/favesalon-embed/relativeTime-15477f02.js +0 -7
@@ -23388,6 +23388,18 @@ function createUser(blob) {
23388
23388
  avatar: blob.avatar || blob.full_profile_image_thumb,
23389
23389
  };
23390
23390
  }
23391
+ function createUserFromChatRoom(blob) {
23392
+ const fullName = blob.salon_detail
23393
+ ? blob.salon_detail.business_name
23394
+ : [blob.first_name, blob.last_name].filter(name => !!name).join(' ');
23395
+ return {
23396
+ id: blob.id || blob.user_id,
23397
+ firstName: blob.first_name,
23398
+ lastName: blob.last_name,
23399
+ fullName: fullName || blob.email || blob.mobile_phone,
23400
+ avatar: blob.avatar || blob.full_profile_image_thumb,
23401
+ };
23402
+ }
23391
23403
 
23392
23404
  var MediaType;
23393
23405
  (function (MediaType) {
@@ -23554,6 +23566,7 @@ function createChatMessage(blob) {
23554
23566
  timestamp: blob.timestamp,
23555
23567
  unRead: blob.unRead,
23556
23568
  senderId: Number(blob.senderId),
23569
+ dateName: dayjs_min(blob.timestamp).format(shortDateYearFormat),
23557
23570
  };
23558
23571
  }
23559
23572
  class ChatRoom {
@@ -23565,7 +23578,7 @@ function createChatRoom(blob) {
23565
23578
  return new ChatRoom({
23566
23579
  id: blob.id,
23567
23580
  uid: blob.firebase_room_id,
23568
- members: blob.from_user && blob.to_user ? [createUser(blob.from_user), createUser(blob.to_user)] : [],
23581
+ members: blob.from_user && blob.to_user ? [createUserFromChatRoom(blob.from_user), createUserFromChatRoom(blob.to_user)] : [],
23569
23582
  messages: [],
23570
23583
  });
23571
23584
  }
@@ -23607,6 +23620,16 @@ class HttpService {
23607
23620
  }
23608
23621
  catch (error) { }
23609
23622
  }
23623
+ fetchClients(salonId, keyword) {
23624
+ const url = `${apiV1Prefix}/salon/clients/list/${salonId}?keyword=${keyword}`;
23625
+ return this.http.get(url)
23626
+ .then((response) => {
23627
+ debugger;
23628
+ const { status, data } = response.data;
23629
+ return status && data ? createSalon(data) : null;
23630
+ })
23631
+ .catch(() => ([]));
23632
+ }
23610
23633
  fetchStyleDetail(styleId) {
23611
23634
  return this.http.get(`${apiV2Prefix}/style/${styleId}/detail`)
23612
23635
  .then((response) => {
@@ -23851,4 +23874,4 @@ class HttpService {
23851
23874
  }
23852
23875
  const HttpService$1 = () => new HttpService();
23853
23876
 
23854
- export { BusinessHourStatus as B, HttpService$1 as H, sortBy_1 as a, dateFormat as b, dayjs_min as d, getSalonImage as g, isVideoMedia as i, shortDateYearFormat as s };
23877
+ export { BusinessHourStatus as B, HttpService$1 as H, sortBy_1 as a, dayjs_min as d, getSalonImage as g, isVideoMedia as i, shortDateYearFormat as s, timeFormatAmPm as t };
@@ -1,5 +1,4 @@
1
- import { i as isSymbol_1, a as isObject_1, _ as _baseGetTag, b as _root, c as _Symbol, d as isObjectLike_1, e as _freeGlobal } from './isObject-13b86c17.js';
2
- import { c as createCommonjsModule, a as commonjsGlobal } from './_commonjsHelpers-9bc404fc.js';
1
+ import { c as commonjsGlobal, a as createCommonjsModule } from './_commonjsHelpers-a4f66ccd.js';
3
2
  import { C as Colors } from './colors-ea36347a.js';
4
3
 
5
4
  /**
@@ -29,6 +28,174 @@ var isArray$1 = Array.isArray;
29
28
 
30
29
  var isArray_1 = isArray$1;
31
30
 
31
+ /** Detect free variable `global` from Node.js. */
32
+ var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
33
+
34
+ var _freeGlobal = freeGlobal;
35
+
36
+ /** Detect free variable `self`. */
37
+ var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
38
+
39
+ /** Used as a reference to the global object. */
40
+ var root = _freeGlobal || freeSelf || Function('return this')();
41
+
42
+ var _root = root;
43
+
44
+ /** Built-in value references. */
45
+ var Symbol = _root.Symbol;
46
+
47
+ var _Symbol = Symbol;
48
+
49
+ /** Used for built-in method references. */
50
+ var objectProto$b = Object.prototype;
51
+
52
+ /** Used to check objects for own properties. */
53
+ var hasOwnProperty$8 = objectProto$b.hasOwnProperty;
54
+
55
+ /**
56
+ * Used to resolve the
57
+ * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
58
+ * of values.
59
+ */
60
+ var nativeObjectToString$1 = objectProto$b.toString;
61
+
62
+ /** Built-in value references. */
63
+ var symToStringTag$1 = _Symbol ? _Symbol.toStringTag : undefined;
64
+
65
+ /**
66
+ * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
67
+ *
68
+ * @private
69
+ * @param {*} value The value to query.
70
+ * @returns {string} Returns the raw `toStringTag`.
71
+ */
72
+ function getRawTag(value) {
73
+ var isOwn = hasOwnProperty$8.call(value, symToStringTag$1),
74
+ tag = value[symToStringTag$1];
75
+
76
+ try {
77
+ value[symToStringTag$1] = undefined;
78
+ var unmasked = true;
79
+ } catch (e) {}
80
+
81
+ var result = nativeObjectToString$1.call(value);
82
+ if (unmasked) {
83
+ if (isOwn) {
84
+ value[symToStringTag$1] = tag;
85
+ } else {
86
+ delete value[symToStringTag$1];
87
+ }
88
+ }
89
+ return result;
90
+ }
91
+
92
+ var _getRawTag = getRawTag;
93
+
94
+ /** Used for built-in method references. */
95
+ var objectProto$a = Object.prototype;
96
+
97
+ /**
98
+ * Used to resolve the
99
+ * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
100
+ * of values.
101
+ */
102
+ var nativeObjectToString = objectProto$a.toString;
103
+
104
+ /**
105
+ * Converts `value` to a string using `Object.prototype.toString`.
106
+ *
107
+ * @private
108
+ * @param {*} value The value to convert.
109
+ * @returns {string} Returns the converted string.
110
+ */
111
+ function objectToString(value) {
112
+ return nativeObjectToString.call(value);
113
+ }
114
+
115
+ var _objectToString = objectToString;
116
+
117
+ /** `Object#toString` result references. */
118
+ var nullTag = '[object Null]',
119
+ undefinedTag = '[object Undefined]';
120
+
121
+ /** Built-in value references. */
122
+ var symToStringTag = _Symbol ? _Symbol.toStringTag : undefined;
123
+
124
+ /**
125
+ * The base implementation of `getTag` without fallbacks for buggy environments.
126
+ *
127
+ * @private
128
+ * @param {*} value The value to query.
129
+ * @returns {string} Returns the `toStringTag`.
130
+ */
131
+ function baseGetTag(value) {
132
+ if (value == null) {
133
+ return value === undefined ? undefinedTag : nullTag;
134
+ }
135
+ return (symToStringTag && symToStringTag in Object(value))
136
+ ? _getRawTag(value)
137
+ : _objectToString(value);
138
+ }
139
+
140
+ var _baseGetTag = baseGetTag;
141
+
142
+ /**
143
+ * Checks if `value` is object-like. A value is object-like if it's not `null`
144
+ * and has a `typeof` result of "object".
145
+ *
146
+ * @static
147
+ * @memberOf _
148
+ * @since 4.0.0
149
+ * @category Lang
150
+ * @param {*} value The value to check.
151
+ * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
152
+ * @example
153
+ *
154
+ * _.isObjectLike({});
155
+ * // => true
156
+ *
157
+ * _.isObjectLike([1, 2, 3]);
158
+ * // => true
159
+ *
160
+ * _.isObjectLike(_.noop);
161
+ * // => false
162
+ *
163
+ * _.isObjectLike(null);
164
+ * // => false
165
+ */
166
+ function isObjectLike(value) {
167
+ return value != null && typeof value == 'object';
168
+ }
169
+
170
+ var isObjectLike_1 = isObjectLike;
171
+
172
+ /** `Object#toString` result references. */
173
+ var symbolTag$1 = '[object Symbol]';
174
+
175
+ /**
176
+ * Checks if `value` is classified as a `Symbol` primitive or object.
177
+ *
178
+ * @static
179
+ * @memberOf _
180
+ * @since 4.0.0
181
+ * @category Lang
182
+ * @param {*} value The value to check.
183
+ * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
184
+ * @example
185
+ *
186
+ * _.isSymbol(Symbol.iterator);
187
+ * // => true
188
+ *
189
+ * _.isSymbol('abc');
190
+ * // => false
191
+ */
192
+ function isSymbol(value) {
193
+ return typeof value == 'symbol' ||
194
+ (isObjectLike_1(value) && _baseGetTag(value) == symbolTag$1);
195
+ }
196
+
197
+ var isSymbol_1 = isSymbol;
198
+
32
199
  /** Used to match property names within property paths. */
33
200
  var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
34
201
  reIsPlainProp = /^\w*$/;
@@ -56,6 +223,38 @@ function isKey(value, object) {
56
223
 
57
224
  var _isKey = isKey;
58
225
 
226
+ /**
227
+ * Checks if `value` is the
228
+ * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
229
+ * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
230
+ *
231
+ * @static
232
+ * @memberOf _
233
+ * @since 0.1.0
234
+ * @category Lang
235
+ * @param {*} value The value to check.
236
+ * @returns {boolean} Returns `true` if `value` is an object, else `false`.
237
+ * @example
238
+ *
239
+ * _.isObject({});
240
+ * // => true
241
+ *
242
+ * _.isObject([1, 2, 3]);
243
+ * // => true
244
+ *
245
+ * _.isObject(_.noop);
246
+ * // => true
247
+ *
248
+ * _.isObject(null);
249
+ * // => false
250
+ */
251
+ function isObject$2(value) {
252
+ var type = typeof value;
253
+ return value != null && (type == 'object' || type == 'function');
254
+ }
255
+
256
+ var isObject_1 = isObject$2;
257
+
59
258
  /** `Object#toString` result references. */
60
259
  var asyncTag = '[object AsyncFunction]',
61
260
  funcTag$1 = '[object Function]',
@@ -23189,6 +23388,18 @@ function createUser(blob) {
23189
23388
  avatar: blob.avatar || blob.full_profile_image_thumb,
23190
23389
  };
23191
23390
  }
23391
+ function createUserFromChatRoom(blob) {
23392
+ const fullName = blob.salon_detail
23393
+ ? blob.salon_detail.business_name
23394
+ : [blob.first_name, blob.last_name].filter(name => !!name).join(' ');
23395
+ return {
23396
+ id: blob.id || blob.user_id,
23397
+ firstName: blob.first_name,
23398
+ lastName: blob.last_name,
23399
+ fullName: fullName || blob.email || blob.mobile_phone,
23400
+ avatar: blob.avatar || blob.full_profile_image_thumb,
23401
+ };
23402
+ }
23192
23403
 
23193
23404
  var MediaType;
23194
23405
  (function (MediaType) {
@@ -23355,6 +23566,7 @@ function createChatMessage(blob) {
23355
23566
  timestamp: blob.timestamp,
23356
23567
  unRead: blob.unRead,
23357
23568
  senderId: Number(blob.senderId),
23569
+ dateName: dayjs_min(blob.timestamp).format(shortDateYearFormat),
23358
23570
  };
23359
23571
  }
23360
23572
  class ChatRoom {
@@ -23366,7 +23578,7 @@ function createChatRoom(blob) {
23366
23578
  return new ChatRoom({
23367
23579
  id: blob.id,
23368
23580
  uid: blob.firebase_room_id,
23369
- members: blob.from_user && blob.to_user ? [createUser(blob.from_user), createUser(blob.to_user)] : [],
23581
+ members: blob.from_user && blob.to_user ? [createUserFromChatRoom(blob.from_user), createUserFromChatRoom(blob.to_user)] : [],
23370
23582
  messages: [],
23371
23583
  });
23372
23584
  }
@@ -23408,6 +23620,19 @@ class HttpService {
23408
23620
  }
23409
23621
  catch (error) { }
23410
23622
  }
23623
+ fetchClients(salonId, keyword) {
23624
+ const url = `${apiV1Prefix}/salon/clients/list/${salonId}?keyword=${keyword}`;
23625
+ return this.http.get(url)
23626
+ .then((response) => {
23627
+ debugger;
23628
+ const { status, data } = response.data;
23629
+ if (status) {
23630
+ return (data || []).map(createUser);
23631
+ }
23632
+ return [];
23633
+ })
23634
+ .catch(() => ([]));
23635
+ }
23411
23636
  fetchStyleDetail(styleId) {
23412
23637
  return this.http.get(`${apiV2Prefix}/style/${styleId}/detail`)
23413
23638
  .then((response) => {
@@ -23652,4 +23877,4 @@ class HttpService {
23652
23877
  }
23653
23878
  const HttpService$1 = () => new HttpService();
23654
23879
 
23655
- export { BusinessHourStatus as B, HttpService$1 as H, sortBy_1 as a, dayjs_min as d, getSalonImage as g, isVideoMedia as i, shortDateYearFormat as s };
23880
+ export { BusinessHourStatus as B, HttpService$1 as H, sortBy_1 as a, dayjs_min as d, getSalonImage as g, isVideoMedia as i, shortDateYearFormat as s, timeFormatAmPm as t };