@subiz/widget-v4 4.1.61 → 4.1.63

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 (49) hide show
  1. package/README.md +10 -0
  2. package/app.js +2 -6
  3. package/assets/less/widget.less +16 -7
  4. package/dist/{213.js → 132.js} +121 -121
  5. package/dist/18dd22fb422.132.js +1 -0
  6. package/dist/18dd22fb422.27.js +1 -0
  7. package/dist/18dd22fb422.278.js +1 -0
  8. package/dist/18dd22fb422.459.js +1 -0
  9. package/dist/{18d5e97bf55.605.js → 18dd22fb422.490.js} +1 -1
  10. package/dist/18dd22fb422.497.js +1 -0
  11. package/dist/18dd22fb422.74.js +1 -0
  12. package/dist/18dd22fb422.997.js +1 -0
  13. package/dist/18dd22fb422.app.js +1 -0
  14. package/dist/{18d5e97bf55.index.html → 18dd22fb422.index.html} +1 -1
  15. package/dist/{18d5e97bf55.library.html → 18dd22fb422.library.html} +1 -1
  16. package/dist/18dd22fb422.library.js +1 -0
  17. package/dist/{18d5e97bf55.preview.html → 18dd22fb422.preview.html} +1 -1
  18. package/dist/18dd22fb422.preview.js +1 -0
  19. package/dist/18dd22fb422.screenshoot.js +1 -0
  20. package/dist/18dd22fb422.webview.js +1 -0
  21. package/dist/{782.js → 27.js} +6 -6
  22. package/dist/{178.js → 278.js} +54 -54
  23. package/dist/{362.js → 459.js} +6 -6
  24. package/dist/{605.js → 490.js} +57 -57
  25. package/dist/{841.js → 497.js} +688 -677
  26. package/dist/{335.js → 74.js} +30 -30
  27. package/dist/{678.js → 997.js} +6 -6
  28. package/dist/HASH +1 -1
  29. package/dist/malicious-app.js +4 -8
  30. package/dist/screenshoot.html +1 -1
  31. package/dist/screenshoot.js +291 -291
  32. package/malicious-app.js +4 -8
  33. package/package.json +6 -6
  34. package/src/chatbox/Widget.js +56 -32
  35. package/src/store/api.js +17 -0
  36. package/src/store/api_fake.js +3 -0
  37. package/src/store/store.js +16 -50
  38. package/dist/18d5e97bf55.178.js +0 -1
  39. package/dist/18d5e97bf55.213.js +0 -1
  40. package/dist/18d5e97bf55.335.js +0 -1
  41. package/dist/18d5e97bf55.362.js +0 -1
  42. package/dist/18d5e97bf55.678.js +0 -1
  43. package/dist/18d5e97bf55.782.js +0 -1
  44. package/dist/18d5e97bf55.841.js +0 -1
  45. package/dist/18d5e97bf55.app.js +0 -1
  46. package/dist/18d5e97bf55.library.js +0 -1
  47. package/dist/18d5e97bf55.preview.js +0 -1
  48. package/dist/18d5e97bf55.screenshoot.js +0 -1
  49. package/dist/18d5e97bf55.webview.js +0 -1
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
- (self["webpackChunk_subiz_widget_v4"] = self["webpackChunk_subiz_widget_v4"] || []).push([[335],{
2
+ (self["webpackChunk_subiz_widget_v4"] = self["webpackChunk_subiz_widget_v4"] || []).push([[74],{
3
3
 
4
- /***/ 2335:
4
+ /***/ 9074:
5
5
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
6
6
 
7
7
  __webpack_require__.r(__webpack_exports__);
@@ -10,17 +10,17 @@ __webpack_require__.r(__webpack_exports__);
10
10
  /* harmony export */ "default": () => (/* binding */ Contact),
11
11
  /* harmony export */ replaceCssVariable: () => (/* binding */ replaceCssVariable)
12
12
  /* harmony export */ });
13
- /* harmony import */ var _util_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4494);
14
- /* harmony import */ var preact__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(6400);
15
- /* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(2493);
13
+ /* harmony import */ var _util_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1405);
14
+ /* harmony import */ var preact__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(172);
15
+ /* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(2840);
16
16
  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; }
17
17
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
18
18
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
19
19
 
20
20
 
21
21
 
22
- let CSS = (() => __webpack_require__.e(/* import() */ 678).then(__webpack_require__.bind(__webpack_require__, 2678)))();
23
- class Contact extends _common_js__WEBPACK_IMPORTED_MODULE_2__/* .Com */ .up {
22
+ let CSS = (() => __webpack_require__.e(/* import() */ 997).then(__webpack_require__.bind(__webpack_require__, 997)))();
23
+ class Contact extends _common_js__WEBPACK_IMPORTED_MODULE_2__/* .Com */ .Mw {
24
24
  constructor(props) {
25
25
  super(props);
26
26
  _defineProperty(this, "state", {
@@ -47,7 +47,7 @@ class Contact extends _common_js__WEBPACK_IMPORTED_MODULE_2__/* .Com */ .up {
47
47
  });
48
48
  }
49
49
  js2css(js, onlyProps) {
50
- return _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z.js2css(js, onlyProps, {
50
+ return _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.js2css(js, onlyProps, {
51
51
  '@font_size': this.props.plugin.popup.font_size,
52
52
  '@font_family': this.props.plugin.popup.font_family,
53
53
  '@text_color': this.props.plugin.popup.text_color,
@@ -92,7 +92,7 @@ class Contact extends _common_js__WEBPACK_IMPORTED_MODULE_2__/* .Com */ .up {
92
92
  if (this.state.map) cls += ' map_modal__show';else cls += ' map_modal__hide';
93
93
  let overlaycls = 'overlay';
94
94
  if (!this.state.map) overlaycls += ' overlay__hidden';
95
- let $locations = _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z.map(button.map.locations, loc => {
95
+ let $locations = _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.map(button.map.locations, loc => {
96
96
  return (0,preact__WEBPACK_IMPORTED_MODULE_1__.h)("div", {
97
97
  class: "map_location",
98
98
  onClick: e => this.setMap(loc.latitude, loc.longitude)
@@ -203,8 +203,8 @@ class Contact extends _common_js__WEBPACK_IMPORTED_MODULE_2__/* .Com */ .up {
203
203
  return (0,preact__WEBPACK_IMPORTED_MODULE_1__.h)("div", null, icon);
204
204
  }
205
205
  renderButtons(buttons) {
206
- if (_util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z.size(buttons) === 0) return null;
207
- return _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z.map(buttons, button => {
206
+ if (_util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.size(buttons) === 0) return null;
207
+ return _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.map(buttons, button => {
208
208
  if (button.type === 'map') return this.renderMapButton(button);
209
209
  if (button.type === 'zalo') return this.renderZaloButton(button);
210
210
  if (button.type === 'facebook') return this.renderFacebookButton(button);
@@ -229,14 +229,14 @@ class Contact extends _common_js__WEBPACK_IMPORTED_MODULE_2__/* .Com */ .up {
229
229
  class: "text",
230
230
  style: this.js2css(style),
231
231
  dangerouslySetInnerHTML: {
232
- __html: _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z.get(com, 'text.html')
232
+ __html: _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.get(com, 'text.html')
233
233
  }
234
234
  });
235
235
  }
236
236
  async refreshCSS() {
237
237
  let css = (await CSS).default.default.toString();
238
238
  var outcss = replaceCssVariable(css, this.props.plugin.popup);
239
- _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z.setCss(this.props.plugin.id, this.$cssStyleDiv, outcss);
239
+ _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.setCss(this.props.plugin.id, this.$cssStyleDiv, outcss);
240
240
  this.setState({
241
241
  cssready: true
242
242
  });
@@ -257,29 +257,29 @@ class Contact extends _common_js__WEBPACK_IMPORTED_MODULE_2__/* .Com */ .up {
257
257
  let pluginstringify = JSON.stringify(this.props.plugin);
258
258
  if (this.state.pluginjson !== pluginstringify) {
259
259
  this.refreshCSS();
260
- _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z.setTimeout(() => this.setState({
260
+ _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.setTimeout(() => this.setState({
261
261
  pluginjson: pluginstringify
262
262
  }));
263
263
  }
264
264
  if (this.state.close) return null;
265
265
  let containercss = '';
266
266
  let bodycss = '';
267
- let layout = _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z.get(this.props.plugin, 'contact.layout', 'standard');
267
+ let layout = _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.get(this.props.plugin, 'contact.layout', 'standard');
268
268
  let $body = null;
269
269
  if (layout === 'standard' || !layout) {
270
270
  $body = this.renderByLayoutSideByStandard();
271
271
  }
272
272
  if (layout === 'footer') {
273
- $body = this.renderByLayoutFooter(_util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z.get(this.props.plugin, `popup.pages.${this.state.pageIndex}`));
273
+ $body = this.renderByLayoutFooter(_util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.get(this.props.plugin, `popup.pages.${this.state.pageIndex}`));
274
274
  }
275
275
  if (layout === 'mini') {
276
- $body = this.renderByLayoutMini(_util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z.get(this.props.plugin, `popup.pages.${this.state.pageIndex}`));
276
+ $body = this.renderByLayoutMini(_util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.get(this.props.plugin, `popup.pages.${this.state.pageIndex}`));
277
277
  }
278
278
  if (layout === 'docked') {
279
- $body = this.renderByLayoutDocked(_util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z.get(this.props.plugin, `popup.pages.${this.state.pageIndex}`));
279
+ $body = this.renderByLayoutDocked(_util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.get(this.props.plugin, `popup.pages.${this.state.pageIndex}`));
280
280
  }
281
281
  let left, right, bottom, top, transform;
282
- let position = _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z.get(this.props.plugin, 'contact.position', 'bottom-left');
282
+ let position = _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.get(this.props.plugin, 'contact.position', 'bottom-left');
283
283
  if (position === 'center-left') {
284
284
  left = '0';
285
285
  top = '50%';
@@ -302,7 +302,7 @@ class Contact extends _common_js__WEBPACK_IMPORTED_MODULE_2__/* .Com */ .up {
302
302
  bottom = '20px';
303
303
  }
304
304
  return (0,preact__WEBPACK_IMPORTED_MODULE_1__.h)("div", {
305
- style: _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z.js2css({
305
+ style: _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.js2css({
306
306
  position: 'absolute',
307
307
  left,
308
308
  right,
@@ -338,15 +338,15 @@ function eq(a, b) {
338
338
  }
339
339
  function replaceCssVariable(css, setting) {
340
340
  var tokens = [css];
341
- tokens = _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z.tokenize(tokens, "'@font_family'");
342
- tokens = _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z.tokenize(tokens, "'@font_size'");
343
- tokens = _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z.tokenize(tokens, "'@text_color'");
344
- tokens = _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z.tokenize(tokens, "'@primary_color'");
345
- tokens = _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z.tokenize(tokens, "'@background'");
346
- tokens = _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z.tokenize(tokens, "'@spacer'");
347
- tokens = _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z.tokenize(tokens, "'@spacer0'");
348
- tokens = _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z.tokenize(tokens, "'@spacer2'");
349
- tokens = _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z.tokenize(tokens, "'@spacer3'");
341
+ tokens = _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.tokenize(tokens, "'@font_family'");
342
+ tokens = _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.tokenize(tokens, "'@font_size'");
343
+ tokens = _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.tokenize(tokens, "'@text_color'");
344
+ tokens = _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.tokenize(tokens, "'@primary_color'");
345
+ tokens = _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.tokenize(tokens, "'@background'");
346
+ tokens = _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.tokenize(tokens, "'@spacer'");
347
+ tokens = _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.tokenize(tokens, "'@spacer0'");
348
+ tokens = _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.tokenize(tokens, "'@spacer2'");
349
+ tokens = _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.tokenize(tokens, "'@spacer3'");
350
350
  var ret = [];
351
351
  for (var i = 0; i < tokens.length; i++) {
352
352
  var item = tokens[i];
@@ -355,7 +355,7 @@ function replaceCssVariable(css, setting) {
355
355
  continue;
356
356
  }
357
357
  var path = item.type.substr(2, item.type.length - 3);
358
- var val = _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z.get(setting, path) || _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z.get(DEFVAL, path) || '';
358
+ var val = _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.get(setting, path) || _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.get(DEFVAL, path) || '';
359
359
  ret.push(val);
360
360
  }
361
361
  return ret.join('');
@@ -1,25 +1,25 @@
1
1
  "use strict";
2
- (self["webpackChunk_subiz_widget_v4"] = self["webpackChunk_subiz_widget_v4"] || []).push([[678],{
2
+ (self["webpackChunk_subiz_widget_v4"] = self["webpackChunk_subiz_widget_v4"] || []).push([[997],{
3
3
 
4
- /***/ 2678:
4
+ /***/ 997:
5
5
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
6
6
 
7
7
  __webpack_require__.r(__webpack_exports__);
8
8
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
9
9
  /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
10
10
  /* harmony export */ });
11
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__webpack_require__(3048));
11
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__webpack_require__(1938));
12
12
 
13
13
  /***/ }),
14
14
 
15
- /***/ 3048:
15
+ /***/ 1938:
16
16
  /***/ ((module, __webpack_exports__, __webpack_require__) => {
17
17
 
18
18
  __webpack_require__.r(__webpack_exports__);
19
19
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
20
20
  /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
21
21
  /* harmony export */ });
22
- /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3645);
22
+ /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6314);
23
23
  /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0__);
24
24
  // Imports
25
25
 
@@ -32,7 +32,7 @@ ___CSS_LOADER_EXPORT___.push([module.id, "/*\n#sbz92 * {\n\tall: unset !importan
32
32
 
33
33
  /***/ }),
34
34
 
35
- /***/ 3645:
35
+ /***/ 6314:
36
36
  /***/ ((module) => {
37
37
 
38
38
 
package/dist/HASH CHANGED
@@ -1 +1 @@
1
- 18d5e97bf55
1
+ 18dd22fb422
@@ -8,12 +8,8 @@ tag.defer = true
8
8
  tag.src = 'https://public-gcs.subiz-cdn.com/widget-v4/public/' + hash + '.app.js'
9
9
  document.body.appendChild(tag)
10
10
 
11
- if (document.readyState === "interactive" || document.readyState === "complete") document.body.appendChild(tag)
12
- else document.addEventListener("DOMContentLoaded", function(event) {
11
+ if (document.readyState === 'interactive' || document.readyState === 'complete') document.body.appendChild(tag)
12
+ else
13
+ document.addEventListener('DOMContentLoaded', function (event) {
13
14
  document.body.appendChild(tag)
14
- }) //
15
-
16
- // record which domain still use old code
17
- var xhttp = new XMLHttpRequest()
18
- xhttp.open('GET', 'https://api.sbz.vn/4.0/old', true)
19
- xhttp.send()
15
+ }) //
@@ -4,4 +4,4 @@
4
4
  }
5
5
  body {
6
6
  background: #ddd;
7
- }</style></head><body><script defer="defer" src="https://vcdn.subiz-cdn.com/widget-v4/public/18d5e97bf55.screenshoot.js"></script></body></html>
7
+ }</style></head><body><script defer="defer" src="https://vcdn.subiz-cdn.com/widget-v4/public/18dd22fb422.screenshoot.js"></script></body></html>