@subiz/widget-v4 4.0.98 → 4.1.1

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 (141) hide show
  1. package/assets/less/chatbox.less +1 -1
  2. package/assets/less/notif.less +1 -1
  3. package/compiled_src/call/call.js +3 -3
  4. package/compiled_src/chatbox/AgentsAvatar.js +0 -3
  5. package/compiled_src/chatbox/ButtonAttachments.js +0 -1
  6. package/compiled_src/chatbox/ChatButton.js +0 -5
  7. package/compiled_src/chatbox/DropdownSelect.js +4 -5
  8. package/compiled_src/chatbox/Event.js +0 -2
  9. package/compiled_src/chatbox/Events.js +1 -9
  10. package/compiled_src/chatbox/FormAttachment.js +0 -1
  11. package/compiled_src/chatbox/GenericTemplateAttachments.js +0 -3
  12. package/compiled_src/chatbox/Header.js +5 -2
  13. package/compiled_src/chatbox/InfoMessage.js +0 -1
  14. package/compiled_src/chatbox/MessageInput.js +3 -3
  15. package/compiled_src/chatbox/Order.js +3 -1
  16. package/compiled_src/chatbox/OrderAttachments.js +0 -1
  17. package/compiled_src/chatbox/QuickReplies.js +0 -1
  18. package/compiled_src/chatbox/Rating.js +3 -1
  19. package/compiled_src/chatbox/ShadowDomRoot.js +1 -1
  20. package/compiled_src/chatbox/TextMessage.js +0 -2
  21. package/compiled_src/chatbox/Typing.js +0 -1
  22. package/compiled_src/chatbox/Widget.js +13 -34
  23. package/compiled_src/chatbox/main.js +0 -1
  24. package/compiled_src/chatbox/releaseAnimation.js +0 -1
  25. package/compiled_src/contact/contact.js +3 -7
  26. package/compiled_src/lib.js +9 -20
  27. package/compiled_src/notif/notif.js +3 -3
  28. package/compiled_src/order/address_picker.js +4 -6
  29. package/compiled_src/order/index.js +0 -2
  30. package/compiled_src/order/order.js +4 -7
  31. package/compiled_src/plugin.js +0 -9
  32. package/compiled_src/popup/countdown.js +3 -5
  33. package/compiled_src/popup/popup.js +3 -8
  34. package/compiled_src/popup/tick.core.commonjs.js +16 -158
  35. package/compiled_src/popup/tick.view.flip.commonjs.js +0 -25
  36. package/compiled_src/store/api.js +3 -9
  37. package/compiled_src/store/api_fake.js +3 -3
  38. package/compiled_src/store/store.js +25 -56
  39. package/compiled_src/util/campaign.js +0 -5
  40. package/compiled_src/util/common.js +0 -27
  41. package/compiled_src/util/extractor.js +0 -1
  42. package/compiled_src/util/gate.test.js +0 -1
  43. package/compiled_src/util/index.js +0 -1
  44. package/compiled_src/util/op.js +0 -1
  45. package/compiled_src/util/order.js +0 -4
  46. package/dist/132.js +6582 -0
  47. package/dist/178.js +406 -0
  48. package/dist/184d8eee275.132.js +1 -0
  49. package/dist/184d8eee275.178.js +1 -0
  50. package/dist/184d8eee275.213.js +1 -0
  51. package/dist/184d8eee275.335.js +1 -0
  52. package/dist/184d8eee275.362.js +1 -0
  53. package/dist/184d8eee275.441.js +1 -0
  54. package/dist/184d8eee275.605.js +1 -0
  55. package/dist/184d8eee275.678.js +1 -0
  56. package/dist/184d8eee275.782.js +1 -0
  57. package/dist/184d8eee275.app.js +1 -0
  58. package/dist/184d8eee275.index.html +26 -0
  59. package/dist/184d8eee275.library.html +26 -0
  60. package/dist/184d8eee275.library.js +1 -0
  61. package/dist/184d8eee275.preview.html +759 -0
  62. package/dist/184d8eee275.preview.js +1 -0
  63. package/dist/184d8eee275.screenshoot.js +1 -0
  64. package/dist/213.js +2774 -0
  65. package/dist/335.js +372 -0
  66. package/dist/362.js +107 -0
  67. package/dist/441.js +2840 -0
  68. package/dist/605.js +297 -0
  69. package/dist/678.js +107 -0
  70. package/dist/782.js +107 -0
  71. package/dist/HASH +1 -0
  72. package/dist/assets/img/Facebook.64607ec.png +0 -0
  73. package/dist/assets/img/Zalo.6845707.png +0 -0
  74. package/dist/assets/img/award1a.1a58e10.png +0 -0
  75. package/dist/assets/img/award3a.3b74423.png +0 -0
  76. package/dist/assets/img/award4a.ed6ccd4.png +0 -0
  77. package/dist/assets/img/award5.39eb7ae.png +0 -0
  78. package/dist/assets/img/bubble_default.7d5e4ab.svg +20 -0
  79. package/dist/assets/img/caret.998eb8f.svg +1 -0
  80. package/dist/assets/img/convos_empty.2353007.svg +72 -0
  81. package/dist/assets/img/default.06e6ee0.jpg +0 -0
  82. package/dist/assets/img/default_avatar.5b74dc1.png +0 -0
  83. package/dist/assets/img/done_gray.d7e8203.svg +4 -0
  84. package/dist/assets/img/done_green.b817fd4.svg +4 -0
  85. package/dist/assets/img/emoji/messenger/sub_23.529_58.824.d5faf14.png +0 -0
  86. package/dist/assets/img/emoji/messenger/sub_23.529_60.784.1420241.png +0 -0
  87. package/dist/assets/img/emoji/messenger/sub_25.490_0.000.1e6b2c0.png +0 -0
  88. package/dist/assets/img/emoji/messenger/sub_25.490_45.098.3dfbc08.png +0 -0
  89. package/dist/assets/img/emoji/messenger/sub_25.490_5.882.4b49e94.png +0 -0
  90. package/dist/assets/img/emoji/messenger/sub_27.451_72.549.7114f58.png +0 -0
  91. package/dist/assets/img/emoji/messenger/sub_27.451_84.314.231e2b7.png +0 -0
  92. package/dist/assets/img/emoji/messenger/sub_27.451_96.078.ddbb008.png +0 -0
  93. package/dist/assets/img/emoji/messenger/sub_29.412_5.882.61f3359.png +0 -0
  94. package/dist/assets/img/emoji/messenger/sub_58.824_100.000.6df72bc.png +0 -0
  95. package/dist/assets/img/emoji/messenger/sub_58.824_45.098.3d7a7ad.png +0 -0
  96. package/dist/assets/img/emoji/messenger/sub_58.824_47.059.0f4d6e2.png +0 -0
  97. package/dist/assets/img/emoji/messenger/sub_58.824_54.902.65724c1.png +0 -0
  98. package/dist/assets/img/emoji/messenger/sub_58.824_64.706.9da3cba.png +0 -0
  99. package/dist/assets/img/emoji/messenger/sub_58.824_72.549.edca5cf.png +0 -0
  100. package/dist/assets/img/emoji/messenger/sub_58.824_78.431.f910f2a.png +0 -0
  101. package/dist/assets/img/emoji/messenger/sub_58.824_88.235.def4e71.png +0 -0
  102. package/dist/assets/img/emoji/messenger/sub_60.784_11.765.49c03d0.png +0 -0
  103. package/dist/assets/img/emoji/messenger/sub_60.784_27.451.46b54e5.png +0 -0
  104. package/dist/assets/img/emoji/messenger/sub_60.784_29.412.e36d284.png +0 -0
  105. package/dist/assets/img/emoji/messenger/sub_60.784_3.922.bb191b0.png +0 -0
  106. package/dist/assets/img/emoji/messenger/sub_60.784_35.294.af7b927.png +0 -0
  107. package/dist/assets/img/emoji/messenger/sub_60.784_7.843.98f2a99.png +0 -0
  108. package/dist/assets/img/empty.29bed2d.svg +23 -0
  109. package/dist/assets/img/empty_1.0b98af0.svg +11 -0
  110. package/dist/assets/img/examplte_logo.f86535f.svg +1 -0
  111. package/dist/assets/img/external-link.90577cc.svg +1 -0
  112. package/dist/assets/img/fb_inverse_circle.36c2cfc.png +0 -0
  113. package/dist/assets/img/ghn.070f8e3.svg +17 -0
  114. package/dist/assets/img/ghtk.326eac1.svg +18 -0
  115. package/dist/assets/img/image_default.be0698b.png +0 -0
  116. package/dist/assets/img/info.ebce7ea.svg +1 -0
  117. package/dist/assets/img/loader.37000a7.svg +1 -0
  118. package/dist/assets/img/loading_static.8f403ae.svg +10 -0
  119. package/dist/assets/img/main-service1.d536cc2.png +0 -0
  120. package/dist/assets/img/main-service2.9b99549.png +0 -0
  121. package/dist/assets/img/not_found_search.2ddb8d1.png +0 -0
  122. package/dist/assets/img/package.8d37d0f.svg +5 -0
  123. package/dist/assets/img/package_fade.763c001.svg +1 -0
  124. package/dist/assets/img/rating--average.1ea492c.svg +12 -0
  125. package/dist/assets/img/rating--great.e3d712e.svg +16 -0
  126. package/dist/assets/img/rating--poor.2938a25.svg +12 -0
  127. package/dist/assets/img/search.f9705ff.svg +1 -0
  128. package/dist/assets/img/send.6db52a9.svg +3 -0
  129. package/dist/assets/img/shop.f7dc7d8.svg +1 -0
  130. package/dist/assets/img/shop_faded.df7845a.svg +1 -0
  131. package/dist/assets/img/subiz-mono.877e9f5.svg +3 -0
  132. package/dist/assets/img/x.26fdfa3.svg +5 -0
  133. package/dist/malicious-app.js +13 -0
  134. package/dist/screenshoot.html +7 -0
  135. package/dist/screenshoot.js +5573 -0
  136. package/package.json +5 -5
  137. package/src/chatbox/Header.js +9 -3
  138. package/src/chatbox/ShadowDomRoot.js +1 -1
  139. package/src/chatbox/Widget.js +6 -10
  140. package/src/lib.js +7 -17
  141. package/src/store/store.js +20 -8
@@ -34,7 +34,7 @@
34
34
  @spacer3: @spacer; // 15px;
35
35
  @spacer4: @spacer * 1.5; // 22.5px
36
36
 
37
- @font-family-sans-serif: Roboto, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, 'Noto Sans',
37
+ @font-family-sans-serif: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial,
38
38
  sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
39
39
 
40
40
  @font-size-base: 15px; // Assumes the browser default, typically `16px`
@@ -43,7 +43,7 @@ body div#sbz92 {
43
43
 
44
44
  .notif {
45
45
  cursor: pointer;
46
- font-family: roboto;
46
+ font-family: Inter;
47
47
  font-size: 14px;
48
48
  position: absolute;
49
49
  user-select: none;
@@ -8,11 +8,12 @@ var _index = _interopRequireDefault(require("../util/index.js"));
8
8
  var _preact = require("preact");
9
9
  var _common = require("../common.js");
10
10
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
11
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
12
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
13
+ function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
12
14
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
13
15
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
14
16
  let notifCSS = (() => Promise.resolve().then(() => _interopRequireWildcard(require('./css.js'))))();
15
-
16
17
  class Notif extends _common.Com {
17
18
  constructor(props) {
18
19
  super(props);
@@ -38,7 +39,6 @@ class Notif extends _common.Com {
38
39
  }));
39
40
  });
40
41
  }
41
-
42
42
  setOver(over) {
43
43
  if (!over) this.mouse_leave = _index.default.Date.now();else this.mouse_leave = 0;
44
44
  }
@@ -59,7 +59,6 @@ class AgentsAvatar extends _common.Com {
59
59
  src: this.props.store.replaceFileUrl(acc.logo_url) || require('../../assets/img/image_default.png')
60
60
  })));
61
61
  }
62
-
63
62
  if (agents.length === 1) {
64
63
  var agent = agents[0];
65
64
  var groupClass = mode === 'primary' ? 'group-avatar--agent-middle' : 'group-avatar--agent-left';
@@ -77,7 +76,6 @@ class AgentsAvatar extends _common.Com {
77
76
  src: this.props.store.replaceFileUrl(agent.avatar_url) || require('../../assets/img/default_avatar.png')
78
77
  })));
79
78
  }
80
-
81
79
  if (agents.length === 2) {
82
80
  let leftAgent = agents[0];
83
81
  let rightAgent = agents[1];
@@ -105,7 +103,6 @@ class AgentsAvatar extends _common.Com {
105
103
  src: this.props.store.replaceFileUrl(rightAgent.avatar_url) || require('../../assets/img/default_avatar.png')
106
104
  })));
107
105
  }
108
-
109
106
  let leftAgent = agents[0];
110
107
  let middleAgent = agents[1];
111
108
  let rightAgent = agents[2];
@@ -16,7 +16,6 @@ class ButtonAttachments extends _common.Com {
16
16
  render() {
17
17
  let byType = _index.default.get(this.props.ev, 'by.type');
18
18
  if (byType === 'user') return null;
19
-
20
19
  let buttons = [];
21
20
  let attachments = _index.default.get(this.props.ev, 'data.message.attachments', []);
22
21
  _index.default.each(attachments, (att, i) => {
@@ -76,13 +76,11 @@ class ChatButton extends _common.Com {
76
76
  style: 'opacity: ' + opacity + ' !important'
77
77
  }, this.renderPreview(), this.renderButton());
78
78
  }
79
-
80
79
  ClearPreview() {
81
80
  this.setState({
82
81
  previewEvent: {}
83
82
  });
84
83
  }
85
-
86
84
  ShowGreeting() {
87
85
  let greeting = _index.default.get(this.props.plugin, 'chatbox.greeting', {});
88
86
  let agentM = this.props.store.matchAgent('*');
@@ -132,7 +130,6 @@ class ChatButton extends _common.Com {
132
130
  }));
133
131
  }
134
132
  }
135
-
136
133
  return this.onPreviewClick();
137
134
  }
138
135
  onPreviewClick(e) {
@@ -280,7 +277,6 @@ class ChatButton extends _common.Com {
280
277
  `;
281
278
  }
282
279
  let cls = 'chat-button chat-button--' + position;
283
-
284
280
  return (0, _preact.h)("div", {
285
281
  class: cls,
286
282
  onClick: e => this.onClick(e)
@@ -314,7 +310,6 @@ class ChatButton extends _common.Com {
314
310
  defmsg = defmsg || 'Sent you a message';
315
311
  let message = _index.default.get(ev, 'data.message.text');
316
312
  var format = _index.default.get(ev, 'data.message.format');
317
-
318
313
  if (format && format !== 'plaintext') message = defmsg;
319
314
  if (!message && _index.default.size(_index.default.get(ev, 'data.message.attachments')) > 0) message = defmsg;
320
315
  if (!message) return null;
@@ -9,7 +9,9 @@ var _common = require("../common.js");
9
9
  var _preact = require("preact");
10
10
  var _spinner = _interopRequireDefault(require("./spinner.js"));
11
11
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
12
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
13
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
14
+ function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
13
15
  class DropdownSelect extends _common.Com {
14
16
  constructor(props) {
15
17
  super(props);
@@ -77,11 +79,8 @@ class DropdownSelect extends _common.Com {
77
79
  console.log('EEEEEEE', e);
78
80
  alert('y');
79
81
  });
80
- document.addEventListener('touchmove', function (e) {
81
- }
82
- );
82
+ document.addEventListener('touchmove', function (e) {});
83
83
  }
84
-
85
84
  componentDidMount() {
86
85
  window.addEventListener('keydown', this.onKeydown);
87
86
  }
@@ -22,7 +22,6 @@ var _time = _interopRequireDefault(require("./time.js"));
22
22
  var _common = require("../common.js");
23
23
  var _preact = require("preact");
24
24
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
25
-
26
25
  class Event extends _common.Com {
27
26
  constructor(props) {
28
27
  super(props);
@@ -188,7 +187,6 @@ class Event extends _common.Com {
188
187
  refresh: this.state.refresh
189
188
  }), 1000);
190
189
  }
191
-
192
190
  let $dot = (0, _preact.h)("div", {
193
191
  class: "sending_dot"
194
192
  });
@@ -129,9 +129,7 @@ class Events extends _common.Com {
129
129
  if (convo.state === 'ended') return false;
130
130
  return true;
131
131
  });
132
-
133
132
  }
134
-
135
133
  onEvent(newev) {
136
134
  if (_index.default.convoOfEv(newev) !== this.props.cid) return;
137
135
  let isBottom = this.isBottom();
@@ -195,12 +193,10 @@ class Events extends _common.Com {
195
193
  }
196
194
  }
197
195
  }
198
-
199
196
  exports.default = Events;
200
197
  function processEvents(convo, events) {
201
198
  events = events.filter(event => visibleEvent(event.ev));
202
199
  if (events.length < 1) return;
203
-
204
200
  for (var i = 1; i < events.length; i++) {
205
201
  let curEvent = events[i];
206
202
  let lastEvent = events[i - 1];
@@ -209,7 +205,6 @@ function processEvents(convo, events) {
209
205
  if (elapsedSec > 120) curEvent.show_time = true;
210
206
  }
211
207
  }
212
-
213
208
  for (var i = 0; i < events.length; i++) {
214
209
  let curEvent = events[i];
215
210
  if (_index.default.get(curEvent, 'ev.type') === 'message_sent') {
@@ -217,7 +212,6 @@ function processEvents(convo, events) {
217
212
  break;
218
213
  }
219
214
  }
220
-
221
215
  for (var i = 0; i < events.length; i++) {
222
216
  let curEvent = events[i];
223
217
  let prevEvent = events[i - 1];
@@ -232,9 +226,7 @@ function processEvents(convo, events) {
232
226
  }
233
227
  function visibleEvent(ev) {
234
228
  let type = _index.default.get(ev, 'type');
235
- return (
236
- type === 'message_sent' || type === 'conversation_state_updated'
237
- );
229
+ return type === 'message_sent' || type === 'conversation_state_updated';
238
230
  }
239
231
  function isSummited(form) {
240
232
  let fields = _index.default.get(form, 'fields') || [];
@@ -60,7 +60,6 @@ class FormAttachment extends _common.Com {
60
60
  focus() {
61
61
  if (this.props.store.isPreview) return;
62
62
  if (_index.default.size(this.state.formData) === 0) return;
63
-
64
63
  let $field;
65
64
  if (this.isFormFilled()) {
66
65
  var keys = Object.keys(this.state.formData);
@@ -16,7 +16,6 @@ class GenericTemplateAttachments extends _common.Com {
16
16
  this.state = {
17
17
  focusing: 0
18
18
  };
19
-
20
19
  this.galleryRef = (0, _preact.createRef)();
21
20
  }
22
21
  componentDidMount() {
@@ -31,11 +30,9 @@ class GenericTemplateAttachments extends _common.Com {
31
30
  behavior: 'smooth'
32
31
  });
33
32
  }
34
-
35
33
  render() {
36
34
  let byType = _index.default.get(this.props.ev, 'by.type');
37
35
  if (byType === 'user') return null;
38
-
39
36
  let attachments = _index.default.get(this.props.ev, 'data.message.attachments', []);
40
37
  let generics = _index.default.filter(attachments, att => _index.default.get(att, 'type') === 'generic');
41
38
  if (generics.length === 0) return null;
@@ -20,7 +20,6 @@ class Header extends _common.Com {
20
20
  let renderSocial = false;
21
21
  let renderTeam = false;
22
22
  let renderCollapsed = this.props.view !== 'list' && headerMode === 'collapsed';
23
-
24
23
  let accSetting = this.props.plugin.chatbox || {};
25
24
  let layout = _index.default.get(accSetting, 'header.layout');
26
25
  if (renderCollapsed) {
@@ -210,4 +209,8 @@ Vui lòng hỏi chúng tôi bất cứ điều gì hoặc chia sẻ phản hồi
210
209
  }
211
210
  }
212
211
  exports.default = Header;
213
- let getJoinedNameMember = agents => _index.default.map(agents, agent => agent.name).join(', ');
212
+ let getJoinedNameMember = agents => {
213
+ agents = _index.default.filter(agents, agent => _index.default.trim(agent.fullname));
214
+ if (!agents.length) return null;
215
+ return _index.default.map(agents, agent => agent.fullname).join(', ');
216
+ };
@@ -26,7 +26,6 @@ class InfoMessage extends _common.Com {
26
26
  time: ev.created
27
27
  }));
28
28
  }
29
-
30
29
  if (ev.type === 'conversation_rated') {
31
30
  var rating = _index.default.get(ev, 'data.conversation.ratings.0', {
32
31
  no_rating: true,
@@ -9,7 +9,9 @@ var _common = require("../common.js");
9
9
  var _preact = require("preact");
10
10
  var _Emoji = _interopRequireDefault(require("./Emoji.js"));
11
11
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
12
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
13
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
14
+ function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
13
15
  class MessageInput extends _common.Com {
14
16
  constructor(props) {
15
17
  super(props);
@@ -93,7 +95,6 @@ class MessageInput extends _common.Com {
93
95
  let attachments = _index.default.get(events[0], 'data.message.attachments', []);
94
96
  let lock = _index.default.find(attachments, att => _index.default.get(att, 'lock_input'));
95
97
  if (lock) return true;
96
-
97
98
  var last_agent_sent;
98
99
  for (let ev of events) {
99
100
  if (_index.default.get(ev, 'by.type') === 'user') continue;
@@ -283,7 +284,6 @@ class MessageInput extends _common.Com {
283
284
  attachments
284
285
  });
285
286
  }
286
-
287
287
  async submitMessage(msg) {
288
288
  msg = msg || _index.default.trim(this.refMessageInput.current.value) || '';
289
289
  if (!msg) return;
@@ -11,7 +11,9 @@ var _common = require("../common.js");
11
11
  var _preact = require("preact");
12
12
  var _order = _interopRequireDefault(require("../order/order.js"));
13
13
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
14
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
14
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
15
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
16
+ function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
15
17
  const POPUP_MAX_HEIGHT = 400;
16
18
  const POPUP_HARD_MAX_HEIGHT = 500;
17
19
  const POPUP_MIN_HEIGHT = 0;
@@ -12,7 +12,6 @@ class ProductAttachments extends _common.Com {
12
12
  render() {
13
13
  let byType = _index.default.get(this.props.ev, 'by.type');
14
14
  if (byType === 'user') return null;
15
-
16
15
  let acc = this.props.store.matchAccount();
17
16
  var attachments = _index.default.get(this.props.ev, 'data.message.attachments', []);
18
17
  let orders = _index.default.filter(attachments, att => att.type === 'order' && att.order).map(att => att.order);
@@ -26,7 +26,6 @@ class QuickReplies extends _common.Com {
26
26
  let cid = _index.default.convoOfEv(this.props.ev);
27
27
  let convo = this.props.store.matchConvo(cid);
28
28
  if (_index.default.get(convo, 'state') === 'ended') return null;
29
-
30
29
  let events = _index.default.map(this.props.store.listEvents(cid));
31
30
  events = _index.default.orderBy(events, 'created', 'asc').filter(ev => ev.type === 'message_sent');
32
31
  let evindex = 0;
@@ -9,7 +9,9 @@ var _releaseAnimation = _interopRequireDefault(require("./releaseAnimation.js"))
9
9
  var _common = require("../common.js");
10
10
  var _preact = require("preact");
11
11
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
12
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
13
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
14
+ function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
13
15
  const POPUP_MAX_HEIGHT = 400;
14
16
  const POPUP_HARD_MAX_HEIGHT = 500;
15
17
  const POPUP_MIN_HEIGHT = 0;
@@ -19,7 +19,7 @@ class ShadowDomRoot extends _common.Com {
19
19
  }
20
20
  update(html) {
21
21
  this.shadowRoot.innerHTML = `<style type="text/css">
22
- body { font-family: 'Roboto', sans-serif!important; font-size: 14px!important; line-height: 20px; overflow-y: hidden; margin:0 }
22
+ body { font-family: 'Inter', sans-serif!important; font-size: 14px!important; line-height: 20px; overflow-y: hidden; margin:0 }
23
23
  h{ font-size: 14/18px!important; }
24
24
  a { text-decoration: none;}
25
25
  img { max-width: 100%; display: block; margin: 10px auto; }
@@ -211,10 +211,8 @@ function trimQuillDelta(delta) {
211
211
  ops: newops
212
212
  };
213
213
  }
214
-
215
214
  return delta;
216
215
  }
217
-
218
216
  let newops = delta.ops.slice();
219
217
  newops.pop();
220
218
  return trimQuillDelta({
@@ -31,7 +31,6 @@ class Typing extends _common.Com {
31
31
  });
32
32
  return;
33
33
  }
34
-
35
34
  let ag = this.props.store.matchAgent(ev.by.id) || {};
36
35
  if (ag.type == 'agent') return;
37
36
  if (_index.default.get(ev, 'type') !== 'conversation_typing') return;
@@ -20,7 +20,9 @@ var _time = _interopRequireDefault(require("./time.js"));
20
20
  var _common = require("../common.js");
21
21
  var _preact = require("preact");
22
22
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
23
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
23
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
24
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
25
+ function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
24
26
  var send = require('../../assets/img/send.svg');
25
27
  var checkedimg = require('../../assets/img/done_gray.svg');
26
28
  var empty = require('../../assets/img/empty.svg');
@@ -47,9 +49,7 @@ class Widget extends _common.Com {
47
49
  message: text,
48
50
  initial_by: this.props.store.matchUser().id
49
51
  });
50
- if (error) {
51
- }
52
-
52
+ if (error) {}
53
53
  this.creating = false;
54
54
  this.props.store.sendConvoEvent(convo.id, 'message_sent', {
55
55
  message
@@ -187,7 +187,6 @@ class Widget extends _common.Com {
187
187
  }
188
188
  });
189
189
  if (hasError) return this.forceUpdate();
190
-
191
190
  let data = _index.default.cloneDeep(this.state.formData);
192
191
  let user = _index.default.cloneDeep(this.props.store.matchUser());
193
192
  let is_lead = false;
@@ -225,15 +224,12 @@ class Widget extends _common.Com {
225
224
  attachments: this.state.quickReplyMessage.attachments
226
225
  }
227
226
  });
228
-
229
227
  this.setState({
230
228
  quickReplyMessage: {}
231
229
  });
232
-
233
230
  if (form.end_conversation_after_submit) await this.props.store.endConvo(this.props.cid);
234
231
  return;
235
232
  }
236
-
237
233
  this.setState({
238
234
  creating: true
239
235
  });
@@ -650,7 +646,6 @@ class Widget extends _common.Com {
650
646
  setTimeout(() => $input && $input.blur());
651
647
  setTimeout(() => $input && $input.blur(), 300);
652
648
  }
653
-
654
649
  focusInput() {
655
650
  if (this.props.store.isPreview) return;
656
651
  if (this.shouldShowForm()) {
@@ -672,7 +667,6 @@ class Widget extends _common.Com {
672
667
  setTimeout(() => $input.focus());
673
668
  setTimeout(() => $input.focus(), 300);
674
669
  }
675
-
676
670
  onRate(rating) {
677
671
  if (!this.props.cid) return;
678
672
  this.props.store.sendConvoEvent(this.props.cid, 'conversation_rated', {
@@ -771,21 +765,17 @@ class Widget extends _common.Com {
771
765
  if (!this.props.store.isMobile()) this.focusInput();
772
766
  }
773
767
  isFormRequired() {
774
-
775
768
  let form;
776
769
  let accountSetting = this.props.plugin.chatbox || {};
777
770
  let acc = this.props.store.matchAccount() || {};
778
771
  if (_index.default.get(accountSetting, 'prechat_form.enabled')) form = accountSetting.prechat_form;
779
-
780
772
  let offlineEnabled = _index.default.get(accountSetting, 'offline_form.enabled');
781
773
  if (this.isOffline(acc, accountSetting) && offlineEnabled) form = accountSetting.offline_form;
782
774
  if (!form) return false;
783
775
  let formData = this.fillForm(form);
784
-
785
776
  let convo = this.props.store.matchConvo(this.props.cid) || {};
786
777
  if (convo.state === 'ended') return true;
787
778
  if (convo.state && convo.state !== 'pending') delete formData.group;
788
-
789
779
  let isAllFiledEmpty = true;
790
780
  _index.default.each(formData, field => {
791
781
  if (field.value) isAllFiledEmpty = false;
@@ -810,23 +800,11 @@ class Widget extends _common.Com {
810
800
  if (!name) name = this.props.t('agent');
811
801
  var $you = null;
812
802
  if (convo.lastSenderType === 'user') {
813
- $you = (0, _preact.h)("span", {
814
- class: "yourmessage"
815
- }, this.props.t('you'), ":");
803
+ $you = (0, _preact.h)("span", null, this.props.t('you'), ":");
816
804
  }
817
805
  let seen = _index.default.isConvoSeen(convo, this.props.store.matchUser().id);
818
- var lastmsg = this.renderMessagePreview(convo.last_message_sent || {
819
- data: {
820
- message: _index.default.get(convo, 'last_message')
821
- }
822
- });
823
- var time = _index.default.getMs(_index.default.get(convo, 'last_message_sent.created')) || _index.default.getMs(_index.default.get(convo, 'last_sent.created')) || _index.default.getMs(convo.created);
824
- var $tim = (0, _preact.h)(_time.default, {
825
- ago: true,
826
- time: time,
827
- key: time,
828
- short: true
829
- });
806
+ var lastmsg = this.renderMessagePreview(convo.last_message_sent);
807
+ var time = _index.default.getMs(_index.default.get(convo, 'last_message_sent.created')) || _index.default.getMs(convo.created);
830
808
  let $unread = seen ? null : (0, _preact.h)("div", {
831
809
  class: "convo-list--item-unread"
832
810
  });
@@ -846,7 +824,12 @@ class Widget extends _common.Com {
846
824
  class: "convo-list--convo-name"
847
825
  }, name), (0, _preact.h)("div", {
848
826
  class: "convo-list--convo-time"
849
- }, $tim)), (0, _preact.h)("div", {
827
+ }, (0, _preact.h)(_time.default, {
828
+ ago: true,
829
+ time: time,
830
+ key: time,
831
+ short: true
832
+ }))), (0, _preact.h)("div", {
850
833
  class: "d-flex flex-row"
851
834
  }, (0, _preact.h)("div", {
852
835
  class: "convo-list--convo-last-message"
@@ -864,7 +847,6 @@ class Widget extends _common.Com {
864
847
  let defmsg = this.props.t('sent_you_a_message');
865
848
  let message = _index.default.get(ev, 'data.message.text');
866
849
  var format = _index.default.get(ev, 'data.message.format');
867
-
868
850
  if (format !== 'plaintext') message = defmsg;
869
851
  if (!message && _index.default.size(_index.default.get(ev, 'data.message.attachments')) > 0) message = defmsg;
870
852
  if (!message) return null;
@@ -901,7 +883,6 @@ class Widget extends _common.Com {
901
883
  if (enableWhen === 'out_of_bussiness_hour') isonline = acc.is_in_business_hour;
902
884
  return !isonline;
903
885
  }
904
-
905
886
  updateFormDataFields() {
906
887
  let form;
907
888
  let accountSetting = this.props.plugin.chatbox || {};
@@ -921,7 +902,6 @@ class Widget extends _common.Com {
921
902
  var data = {};
922
903
  _index.default.each(form.fields, f => {
923
904
  var newf = Object.assign({}, f);
924
-
925
905
  if (f.type === 'list') {
926
906
  newf.list = f.list;
927
907
  }
@@ -940,7 +920,6 @@ class Widget extends _common.Com {
940
920
  }))
941
921
  };
942
922
  }
943
-
944
923
  data['question'] = {
945
924
  key: 'question',
946
925
  is_required: true,
@@ -125,7 +125,6 @@ class Main extends _common.Com {
125
125
  widgetView: p.view
126
126
  });
127
127
  this.props.store.setIsOpen(true);
128
-
129
128
  this.forceUpdate();
130
129
  this.setState({
131
130
  isShowWidget: true
@@ -29,7 +29,6 @@ class _default {
29
29
  run(t0);
30
30
  });
31
31
  }
32
-
33
32
  calcY(v, y0, t) {
34
33
  var towardY;
35
34
  if (y0 > this.maxY) towardY = this.maxY;else if (y0 < this.minY) towardY = this.minY;else if (Math.abs(v) < this.breakingV) {
@@ -9,12 +9,12 @@ var _index = _interopRequireDefault(require("../util/index.js"));
9
9
  var _preact = require("preact");
10
10
  var _common = require("../common.js");
11
11
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
12
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
13
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
14
+ function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
13
15
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
14
16
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
15
-
16
17
  let CSS = (() => Promise.resolve().then(() => _interopRequireWildcard(require('./css.js'))))();
17
-
18
18
  class Contact extends _common.Com {
19
19
  constructor(props) {
20
20
  super(props);
@@ -197,7 +197,6 @@ class Contact extends _common.Com {
197
197
  }));
198
198
  return (0, _preact.h)("div", null, icon);
199
199
  }
200
-
201
200
  renderButtons(buttons) {
202
201
  if (_index.default.size(buttons) === 0) return null;
203
202
  return _index.default.map(buttons, button => {
@@ -323,7 +322,6 @@ async function runCampaign(byTrigger) {
323
322
  ran = true;
324
323
  pageIndex = 0;
325
324
  let page = _index.default.get(camp, `pages.${pageIndex}`) || {};
326
-
327
325
  showPage(page);
328
326
  triggerType = byTrigger;
329
327
  let {
@@ -336,7 +334,6 @@ function eq(a, b) {
336
334
  }
337
335
  function replaceCssVariable(css, setting) {
338
336
  var tokens = [css];
339
-
340
337
  tokens = _index.default.tokenize(tokens, "'@font_family'");
341
338
  tokens = _index.default.tokenize(tokens, "'@font_size'");
342
339
  tokens = _index.default.tokenize(tokens, "'@text_color'");
@@ -353,7 +350,6 @@ function replaceCssVariable(css, setting) {
353
350
  ret.push(item);
354
351
  continue;
355
352
  }
356
-
357
353
  var path = item.type.substr(2, item.type.length - 3);
358
354
  var val = _index.default.get(setting, path) || _index.default.get(DEFVAL, path) || '';
359
355
  ret.push(val);