@subiz/widget-v4 4.0.64 → 4.0.68

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 (77) hide show
  1. package/assets/less/chatbox.less +6 -1
  2. package/compiled_src/chatbox/ChatButton.js +3 -1
  3. package/compiled_src/chatbox/Event.js +1 -0
  4. package/compiled_src/chatbox/ProductAttachments.js +40 -4
  5. package/compiled_src/chatbox/Typing.js +3 -1
  6. package/compiled_src/chatbox/main.js +2 -0
  7. package/compiled_src/lib.js +18 -4
  8. package/compiled_src/store/store.js +26 -3
  9. package/compiled_src/util/common.js +1 -1
  10. package/dist/132.js +48 -6
  11. package/dist/178.js +174 -341
  12. package/dist/1801c652a77.132.js +1 -0
  13. package/dist/1801c652a77.178.js +1 -0
  14. package/dist/{17ee31b89ac.213.js → 1801c652a77.213.js} +0 -0
  15. package/dist/{17ee31b89ac.335.js → 1801c652a77.335.js} +1 -1
  16. package/dist/1801c652a77.362.js +1 -0
  17. package/dist/{17ee31b89ac.441.js → 1801c652a77.441.js} +0 -0
  18. package/dist/{17ee31b89ac.605.js → 1801c652a77.605.js} +0 -0
  19. package/dist/1801c652a77.678.js +1 -0
  20. package/dist/1801c652a77.782.js +1 -0
  21. package/dist/1801c652a77.app.js +1 -0
  22. package/dist/{17ee31b89ac.index.html → 1801c652a77.index.html} +1 -1
  23. package/dist/{17ee31b89ac.library.html → 1801c652a77.library.html} +1 -1
  24. package/dist/1801c652a77.library.js +1 -0
  25. package/dist/{17ee31b89ac.preview.html → 1801c652a77.preview.html} +1 -1
  26. package/dist/1801c652a77.preview.js +1 -0
  27. package/dist/1801c652a77.screenshoot.js +1 -0
  28. package/dist/335.js +2 -2
  29. package/dist/362.js +20 -70
  30. package/dist/678.js +20 -70
  31. package/dist/782.js +21 -118
  32. package/dist/HASH +1 -1
  33. package/dist/screenshoot.html +1 -1
  34. package/dist/screenshoot.js +101 -64
  35. package/package.json +10 -10
  36. package/src/chatbox/Buttons.js +8 -8
  37. package/src/chatbox/ChatButton.js +2 -2
  38. package/src/chatbox/Event.js +1 -1
  39. package/src/chatbox/ProductAttachments.js +41 -5
  40. package/src/chatbox/Typing.js +5 -1
  41. package/src/chatbox/main.js +4 -1
  42. package/src/lib.js +13 -4
  43. package/src/store/store.js +25 -11
  44. package/src/util/common.js +1 -1
  45. package/up +1 -1
  46. package/dist/0b82fa7e5c3b07b40a44.png +0 -1
  47. package/dist/0f4af006e38ee8b93633.png +0 -1
  48. package/dist/17ee31b89ac.132.js +0 -1
  49. package/dist/17ee31b89ac.178.js +0 -1
  50. package/dist/17ee31b89ac.362.js +0 -1
  51. package/dist/17ee31b89ac.678.js +0 -1
  52. package/dist/17ee31b89ac.782.js +0 -1
  53. package/dist/17ee31b89ac.app.js +0 -1
  54. package/dist/17ee31b89ac.library.js +0 -1
  55. package/dist/17ee31b89ac.preview.js +0 -1
  56. package/dist/17ee31b89ac.screenshoot.js +0 -1
  57. package/dist/1ea1c6cd21d25176810c.png +0 -1
  58. package/dist/292d42404e1b03398f61.png +0 -1
  59. package/dist/312d376370831b7bea83.png +0 -1
  60. package/dist/313d1bfc1cf776d1aefe.png +0 -1
  61. package/dist/4aa58bb7a66bb44975aa.png +0 -1
  62. package/dist/56ce063bc6c81adb7322.png +0 -1
  63. package/dist/6a411166ef5cc79e0714.png +0 -1
  64. package/dist/6faf403782fefacc1649.png +0 -1
  65. package/dist/79dca33c68fab79c067f.png +0 -1
  66. package/dist/82da1578fa84f9debaeb.png +0 -1
  67. package/dist/8b8e0f0824743974b282.png +0 -1
  68. package/dist/8d551390d81e39130a3c.png +0 -1
  69. package/dist/9fc61b9479877ebdb6c7.png +0 -1
  70. package/dist/a165d31dcb3dc90f1057.png +0 -1
  71. package/dist/a98d4a5698812c4426b3.png +0 -1
  72. package/dist/c41606bf9d1b604e46d5.png +0 -1
  73. package/dist/ce1f7450ce6c1aacd330.png +0 -1
  74. package/dist/cf8c01e88f4770a6e3e5.png +0 -1
  75. package/dist/dfbcfeab1d5622a737e2.png +0 -1
  76. package/dist/e4893ed8c2f7b8329919.png +0 -1
  77. package/dist/ec2ab4eb4ef73d186186.png +0 -1
@@ -1348,11 +1348,11 @@ function toString(obj) {
1348
1348
 
1349
1349
  "use strict";
1350
1350
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1351
- /* harmony export */ "up": () => (/* binding */ Com),
1352
- /* harmony export */ "u$": () => (/* binding */ Clickaway),
1353
1351
  /* harmony export */ "Kd": () => (/* binding */ getLocale),
1354
1352
  /* harmony export */ "Rs": () => (/* binding */ langMessages),
1355
- /* harmony export */ "WW": () => (/* binding */ downloadLanguage)
1353
+ /* harmony export */ "WW": () => (/* binding */ downloadLanguage),
1354
+ /* harmony export */ "u$": () => (/* binding */ Clickaway),
1355
+ /* harmony export */ "up": () => (/* binding */ Com)
1356
1356
  /* harmony export */ });
1357
1357
  /* harmony import */ var preact__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6400);
1358
1358
  /* harmony import */ var _util_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(819);
@@ -1446,70 +1446,70 @@ function downloadLanguage(store, locale, force) {
1446
1446
  "use strict";
1447
1447
  __webpack_require__.r(__webpack_exports__);
1448
1448
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1449
- /* harmony export */ "parseJSON": () => (/* binding */ parseJSON),
1450
- /* harmony export */ "stringify": () => (/* binding */ stringify),
1449
+ /* harmony export */ "DEFVAL": () => (/* binding */ DEFVAL),
1450
+ /* harmony export */ "DEF_CHAT_BUTTON_BACKGROUND_IMAGE_URL": () => (/* binding */ DEF_CHAT_BUTTON_BACKGROUND_IMAGE_URL),
1451
1451
  /* harmony export */ "Date": () => (/* binding */ Date),
1452
- /* harmony export */ "requestAnimationFrame": () => (/* binding */ requestAnimationFrame),
1453
- /* harmony export */ "setTimeout": () => (/* binding */ setTimeout),
1454
- /* harmony export */ "setInterval": () => (/* binding */ setInterval),
1452
+ /* harmony export */ "agentsOfConvo": () => (/* binding */ agentsOfConvo),
1453
+ /* harmony export */ "checkRunConditions": () => (/* binding */ checkRunConditions),
1454
+ /* harmony export */ "cloneDeep": () => (/* binding */ cloneDeep),
1455
1455
  /* harmony export */ "convoOfEv": () => (/* binding */ convoOfEv),
1456
1456
  /* harmony export */ "convoToEv": () => (/* binding */ convoToEv),
1457
- /* harmony export */ "setMsgField": () => (/* binding */ setMsgField),
1458
- /* harmony export */ "getMsgField": () => (/* binding */ getMsgField),
1459
- /* harmony export */ "merge": () => (/* binding */ merge),
1460
- /* harmony export */ "cloneDeep": () => (/* binding */ cloneDeep),
1461
- /* harmony export */ "randomString": () => (/* binding */ randomString),
1462
- /* harmony export */ "filter": () => (/* binding */ filter),
1463
- /* harmony export */ "includes": () => (/* binding */ includes),
1464
- /* harmony export */ "map": () => (/* binding */ map),
1457
+ /* harmony export */ "detectLang": () => (/* binding */ detectLang),
1458
+ /* harmony export */ "diffDay": () => (/* binding */ diffDay),
1459
+ /* harmony export */ "diffYear": () => (/* binding */ diffYear),
1465
1460
  /* harmony export */ "each": () => (/* binding */ each),
1466
- /* harmony export */ "usersOfConvo": () => (/* binding */ usersOfConvo),
1467
- /* harmony export */ "isConvoSeen": () => (/* binding */ isConvoSeen),
1468
- /* harmony export */ "agentsOfConvo": () => (/* binding */ agentsOfConvo),
1469
- /* harmony export */ "startsWith": () => (/* binding */ startsWith),
1470
- /* harmony export */ "size": () => (/* binding */ size),
1471
- /* harmony export */ "replaceAll": () => (/* binding */ replaceAll),
1472
- /* harmony export */ "trim": () => (/* binding */ trim),
1473
- /* harmony export */ "trimStart": () => (/* binding */ trimStart),
1474
- /* harmony export */ "throttle": () => (/* binding */ throttle),
1461
+ /* harmony export */ "filter": () => (/* binding */ filter),
1475
1462
  /* harmony export */ "find": () => (/* binding */ find),
1476
- /* harmony export */ "orderBy": () => (/* binding */ orderBy),
1463
+ /* harmony export */ "formatCurrency": () => (/* binding */ formatCurrency),
1464
+ /* harmony export */ "getAgentDisplayName": () => (/* binding */ getAgentDisplayName),
1465
+ /* harmony export */ "getDayName": () => (/* binding */ getDayName),
1477
1466
  /* harmony export */ "getIntegrationId": () => (/* binding */ getIntegrationId),
1467
+ /* harmony export */ "getMs": () => (/* binding */ getMs),
1468
+ /* harmony export */ "getMsgField": () => (/* binding */ getMsgField),
1469
+ /* harmony export */ "getUrlParameter": () => (/* binding */ getUrlParameter),
1470
+ /* harmony export */ "getUserAttr": () => (/* binding */ getUserAttr),
1471
+ /* harmony export */ "includes": () => (/* binding */ includes),
1472
+ /* harmony export */ "isConvoSeen": () => (/* binding */ isConvoSeen),
1473
+ /* harmony export */ "isEmail": () => (/* binding */ isEmail),
1474
+ /* harmony export */ "isNumber": () => (/* binding */ isNumber),
1478
1475
  /* harmony export */ "isPhone": () => (/* binding */ isPhone),
1479
1476
  /* harmony export */ "isURL": () => (/* binding */ isURL),
1480
- /* harmony export */ "isNumber": () => (/* binding */ isNumber),
1481
- /* harmony export */ "isEmail": () => (/* binding */ isEmail),
1482
- /* harmony export */ "last": () => (/* binding */ last),
1483
- /* harmony export */ "getAgentDisplayName": () => (/* binding */ getAgentDisplayName),
1484
1477
  /* harmony export */ "isUserBanned": () => (/* binding */ isUserBanned),
1485
- /* harmony export */ "setUserAttr": () => (/* binding */ setUserAttr),
1486
- /* harmony export */ "getUserAttr": () => (/* binding */ getUserAttr),
1487
- /* harmony export */ "norm": () => (/* binding */ norm),
1488
- /* harmony export */ "noop": () => (/* binding */ noop),
1489
- /* harmony export */ "replaceCssVariablePlugin": () => (/* binding */ replaceCssVariablePlugin),
1490
- /* harmony export */ "replaceCssVariable": () => (/* binding */ replaceCssVariable),
1491
- /* harmony export */ "tokenize": () => (/* binding */ tokenize),
1492
- /* harmony export */ "setCss": () => (/* binding */ setCss),
1493
- /* harmony export */ "DEF_CHAT_BUTTON_BACKGROUND_IMAGE_URL": () => (/* binding */ DEF_CHAT_BUTTON_BACKGROUND_IMAGE_URL),
1494
- /* harmony export */ "DEFVAL": () => (/* binding */ DEFVAL),
1495
1478
  /* harmony export */ "js2css": () => (/* binding */ js2css),
1496
- /* harmony export */ "checkRunConditions": () => (/* binding */ checkRunConditions),
1497
- /* harmony export */ "getDayName": () => (/* binding */ getDayName),
1498
- /* harmony export */ "preloadWebfonts": () => (/* binding */ preloadWebfonts),
1499
- /* harmony export */ "preloadImg": () => (/* binding */ preloadImg),
1479
+ /* harmony export */ "last": () => (/* binding */ last),
1480
+ /* harmony export */ "map": () => (/* binding */ map),
1481
+ /* harmony export */ "merge": () => (/* binding */ merge),
1482
+ /* harmony export */ "noop": () => (/* binding */ noop),
1483
+ /* harmony export */ "norm": () => (/* binding */ norm),
1500
1484
  /* harmony export */ "offsetToMin": () => (/* binding */ offsetToMin),
1501
- /* harmony export */ "diffDay": () => (/* binding */ diffDay),
1502
- /* harmony export */ "diffYear": () => (/* binding */ diffYear),
1485
+ /* harmony export */ "orderBy": () => (/* binding */ orderBy),
1486
+ /* harmony export */ "parseJSON": () => (/* binding */ parseJSON),
1487
+ /* harmony export */ "preloadImg": () => (/* binding */ preloadImg),
1488
+ /* harmony export */ "preloadWebfonts": () => (/* binding */ preloadWebfonts),
1489
+ /* harmony export */ "randomString": () => (/* binding */ randomString),
1490
+ /* harmony export */ "replaceAll": () => (/* binding */ replaceAll),
1491
+ /* harmony export */ "replaceCssVariable": () => (/* binding */ replaceCssVariable),
1492
+ /* harmony export */ "replaceCssVariablePlugin": () => (/* binding */ replaceCssVariablePlugin),
1493
+ /* harmony export */ "requestAnimationFrame": () => (/* binding */ requestAnimationFrame),
1503
1494
  /* harmony export */ "sameDay": () => (/* binding */ sameDay),
1495
+ /* harmony export */ "scrollIntoViewIfNeeded": () => (/* binding */ scrollIntoViewIfNeeded),
1496
+ /* harmony export */ "setCss": () => (/* binding */ setCss),
1497
+ /* harmony export */ "setInterval": () => (/* binding */ setInterval),
1498
+ /* harmony export */ "setMsgField": () => (/* binding */ setMsgField),
1499
+ /* harmony export */ "setTimeout": () => (/* binding */ setTimeout),
1500
+ /* harmony export */ "setUserAttr": () => (/* binding */ setUserAttr),
1504
1501
  /* harmony export */ "shortTime": () => (/* binding */ shortTime),
1505
- /* harmony export */ "unixSec": () => (/* binding */ unixSec),
1506
- /* harmony export */ "getMs": () => (/* binding */ getMs),
1507
- /* harmony export */ "detectLang": () => (/* binding */ detectLang),
1508
- /* harmony export */ "getUrlParameter": () => (/* binding */ getUrlParameter),
1502
+ /* harmony export */ "size": () => (/* binding */ size),
1509
1503
  /* harmony export */ "sleep": () => (/* binding */ sleep),
1510
- /* harmony export */ "formatCurrency": () => (/* binding */ formatCurrency),
1504
+ /* harmony export */ "startsWith": () => (/* binding */ startsWith),
1505
+ /* harmony export */ "stringify": () => (/* binding */ stringify),
1506
+ /* harmony export */ "throttle": () => (/* binding */ throttle),
1507
+ /* harmony export */ "tokenize": () => (/* binding */ tokenize),
1508
+ /* harmony export */ "trim": () => (/* binding */ trim),
1509
+ /* harmony export */ "trimStart": () => (/* binding */ trimStart),
1511
1510
  /* harmony export */ "unicodeToAscii": () => (/* binding */ unicodeToAscii),
1512
- /* harmony export */ "scrollIntoViewIfNeeded": () => (/* binding */ scrollIntoViewIfNeeded)
1511
+ /* harmony export */ "unixSec": () => (/* binding */ unixSec),
1512
+ /* harmony export */ "usersOfConvo": () => (/* binding */ usersOfConvo)
1513
1513
  /* harmony export */ });
1514
1514
  var op = __webpack_require__(6877);
1515
1515
 
@@ -1837,7 +1837,7 @@ function isURL(url) {
1837
1837
  return re.test(String(url).toLowerCase());
1838
1838
  }
1839
1839
  function isNumber(num) {
1840
- var reg = /^\d+$/;
1840
+ var re = /^\d+$/;
1841
1841
  return re.test(String(num));
1842
1842
  }
1843
1843
  function isEmail(email) {
@@ -3206,14 +3206,14 @@ class Pubsub {
3206
3206
 
3207
3207
  "use strict";
3208
3208
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3209
- /* harmony export */ "sY": () => (/* binding */ S),
3210
- /* harmony export */ "h": () => (/* binding */ v),
3211
3209
  /* harmony export */ "HY": () => (/* binding */ d),
3212
3210
  /* harmony export */ "Vf": () => (/* binding */ p),
3211
+ /* harmony export */ "h": () => (/* binding */ v),
3212
+ /* harmony export */ "sY": () => (/* binding */ S),
3213
3213
  /* harmony export */ "wA": () => (/* binding */ _)
3214
3214
  /* harmony export */ });
3215
3215
  /* unused harmony exports hydrate, createElement, isValidElement, cloneElement, createContext, toChildArray, options */
3216
- var n,l,u,i,t,r,o,f,e={},c=[],s=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function a(n,l){for(var u in l)n[u]=l[u];return n}function h(n){var l=n.parentNode;l&&l.removeChild(n)}function v(l,u,i){var t,r,o,f={};for(o in u)"key"==o?t=u[o]:"ref"==o?r=u[o]:f[o]=u[o];if(arguments.length>2&&(f.children=arguments.length>3?n.call(arguments,2):i),"function"==typeof l&&null!=l.defaultProps)for(o in l.defaultProps)void 0===f[o]&&(f[o]=l.defaultProps[o]);return y(l,f,t,r,null)}function y(n,i,t,r,o){var f={type:n,props:i,key:t,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==o?++u:o};return null==o&&null!=l.vnode&&l.vnode(f),f}function p(){return{current:null}}function d(n){return n.children}function _(n,l){this.props=n,this.context=l}function k(n,l){if(null==l)return n.__?k(n.__,n.__.__k.indexOf(n)+1):null;for(var u;l<n.__k.length;l++)if(null!=(u=n.__k[l])&&null!=u.__e)return u.__e;return"function"==typeof n.type?k(n):null}function b(n){var l,u;if(null!=(n=n.__)&&null!=n.__c){for(n.__e=n.__c.base=null,l=0;l<n.__k.length;l++)if(null!=(u=n.__k[l])&&null!=u.__e){n.__e=n.__c.base=u.__e;break}return b(n)}}function m(n){(!n.__d&&(n.__d=!0)&&t.push(n)&&!g.__r++||o!==l.debounceRendering)&&((o=l.debounceRendering)||r)(g)}function g(){for(var n;g.__r=t.length;)n=t.sort(function(n,l){return n.__v.__b-l.__v.__b}),t=[],n.some(function(n){var l,u,i,t,r,o;n.__d&&(r=(t=(l=n).__v).__e,(o=l.__P)&&(u=[],(i=a({},t)).__v=t.__v+1,j(o,t,i,l.__n,void 0!==o.ownerSVGElement,null!=t.__h?[r]:null,u,null==r?k(t):r,t.__h),z(u,t),t.__e!=r&&b(t)))})}function w(n,l,u,i,t,r,o,f,s,a){var h,v,p,_,b,m,g,w=i&&i.__k||c,A=w.length;for(u.__k=[],h=0;h<l.length;h++)if(null!=(_=u.__k[h]=null==(_=l[h])||"boolean"==typeof _?null:"string"==typeof _||"number"==typeof _||"bigint"==typeof _?y(null,_,null,null,_):Array.isArray(_)?y(d,{children:_},null,null,null):_.__b>0?y(_.type,_.props,_.key,null,_.__v):_)){if(_.__=u,_.__b=u.__b+1,null===(p=w[h])||p&&_.key==p.key&&_.type===p.type)w[h]=void 0;else for(v=0;v<A;v++){if((p=w[v])&&_.key==p.key&&_.type===p.type){w[v]=void 0;break}p=null}j(n,_,p=p||e,t,r,o,f,s,a),b=_.__e,(v=_.ref)&&p.ref!=v&&(g||(g=[]),p.ref&&g.push(p.ref,null,_),g.push(v,_.__c||b,_)),null!=b?(null==m&&(m=b),"function"==typeof _.type&&_.__k===p.__k?_.__d=s=x(_,s,n):s=P(n,_,p,w,b,s),"function"==typeof u.type&&(u.__d=s)):s&&p.__e==s&&s.parentNode!=n&&(s=k(p))}for(u.__e=m,h=A;h--;)null!=w[h]&&("function"==typeof u.type&&null!=w[h].__e&&w[h].__e==u.__d&&(u.__d=k(i,h+1)),N(w[h],w[h]));if(g)for(h=0;h<g.length;h++)M(g[h],g[++h],g[++h])}function x(n,l,u){for(var i,t=n.__k,r=0;t&&r<t.length;r++)(i=t[r])&&(i.__=n,l="function"==typeof i.type?x(i,l,u):P(u,i,i,t,i.__e,l));return l}function A(n,l){return l=l||[],null==n||"boolean"==typeof n||(Array.isArray(n)?n.some(function(n){A(n,l)}):l.push(n)),l}function P(n,l,u,i,t,r){var o,f,e;if(void 0!==l.__d)o=l.__d,l.__d=void 0;else if(null==u||t!=r||null==t.parentNode)n:if(null==r||r.parentNode!==n)n.appendChild(t),o=null;else{for(f=r,e=0;(f=f.nextSibling)&&e<i.length;e+=2)if(f==t)break n;n.insertBefore(t,r),o=r}return void 0!==o?o:t.nextSibling}function C(n,l,u,i,t){var r;for(r in u)"children"===r||"key"===r||r in l||H(n,r,null,u[r],i);for(r in l)t&&"function"!=typeof l[r]||"children"===r||"key"===r||"value"===r||"checked"===r||u[r]===l[r]||H(n,r,l[r],u[r],i)}function $(n,l,u){"-"===l[0]?n.setProperty(l,u):n[l]=null==u?"":"number"!=typeof u||s.test(l)?u:u+"px"}function H(n,l,u,i,t){var r;n:if("style"===l)if("string"==typeof u)n.style.cssText=u;else{if("string"==typeof i&&(n.style.cssText=i=""),i)for(l in i)u&&l in u||$(n.style,l,"");if(u)for(l in u)i&&u[l]===i[l]||$(n.style,l,u[l])}else if("o"===l[0]&&"n"===l[1])r=l!==(l=l.replace(/Capture$/,"")),l=l.toLowerCase()in n?l.toLowerCase().slice(2):l.slice(2),n.l||(n.l={}),n.l[l+r]=u,u?i||n.addEventListener(l,r?T:I,r):n.removeEventListener(l,r?T:I,r);else if("dangerouslySetInnerHTML"!==l){if(t)l=l.replace(/xlink[H:h]/,"h").replace(/sName$/,"s");else if("href"!==l&&"list"!==l&&"form"!==l&&"tabIndex"!==l&&"download"!==l&&l in n)try{n[l]=null==u?"":u;break n}catch(n){}"function"==typeof u||(null!=u&&(!1!==u||"a"===l[0]&&"r"===l[1])?n.setAttribute(l,u):n.removeAttribute(l))}}function I(n){this.l[n.type+!1](l.event?l.event(n):n)}function T(n){this.l[n.type+!0](l.event?l.event(n):n)}function j(n,u,i,t,r,o,f,e,c){var s,h,v,y,p,k,b,m,g,x,A,P=u.type;if(void 0!==u.constructor)return null;null!=i.__h&&(c=i.__h,e=u.__e=i.__e,u.__h=null,o=[e]),(s=l.__b)&&s(u);try{n:if("function"==typeof P){if(m=u.props,g=(s=P.contextType)&&t[s.__c],x=s?g?g.props.value:s.__:t,i.__c?b=(h=u.__c=i.__c).__=h.__E:("prototype"in P&&P.prototype.render?u.__c=h=new P(m,x):(u.__c=h=new _(m,x),h.constructor=P,h.render=O),g&&g.sub(h),h.props=m,h.state||(h.state={}),h.context=x,h.__n=t,v=h.__d=!0,h.__h=[]),null==h.__s&&(h.__s=h.state),null!=P.getDerivedStateFromProps&&(h.__s==h.state&&(h.__s=a({},h.__s)),a(h.__s,P.getDerivedStateFromProps(m,h.__s))),y=h.props,p=h.state,v)null==P.getDerivedStateFromProps&&null!=h.componentWillMount&&h.componentWillMount(),null!=h.componentDidMount&&h.__h.push(h.componentDidMount);else{if(null==P.getDerivedStateFromProps&&m!==y&&null!=h.componentWillReceiveProps&&h.componentWillReceiveProps(m,x),!h.__e&&null!=h.shouldComponentUpdate&&!1===h.shouldComponentUpdate(m,h.__s,x)||u.__v===i.__v){h.props=m,h.state=h.__s,u.__v!==i.__v&&(h.__d=!1),h.__v=u,u.__e=i.__e,u.__k=i.__k,u.__k.forEach(function(n){n&&(n.__=u)}),h.__h.length&&f.push(h);break n}null!=h.componentWillUpdate&&h.componentWillUpdate(m,h.__s,x),null!=h.componentDidUpdate&&h.__h.push(function(){h.componentDidUpdate(y,p,k)})}h.context=x,h.props=m,h.state=h.__s,(s=l.__r)&&s(u),h.__d=!1,h.__v=u,h.__P=n,s=h.render(h.props,h.state,h.context),h.state=h.__s,null!=h.getChildContext&&(t=a(a({},t),h.getChildContext())),v||null==h.getSnapshotBeforeUpdate||(k=h.getSnapshotBeforeUpdate(y,p)),A=null!=s&&s.type===d&&null==s.key?s.props.children:s,w(n,Array.isArray(A)?A:[A],u,i,t,r,o,f,e,c),h.base=u.__e,u.__h=null,h.__h.length&&f.push(h),b&&(h.__E=h.__=null),h.__e=!1}else null==o&&u.__v===i.__v?(u.__k=i.__k,u.__e=i.__e):u.__e=L(i.__e,u,i,t,r,o,f,c);(s=l.diffed)&&s(u)}catch(n){u.__v=null,(c||null!=o)&&(u.__e=e,u.__h=!!c,o[o.indexOf(e)]=null),l.__e(n,u,i)}}function z(n,u){l.__c&&l.__c(u,n),n.some(function(u){try{n=u.__h,u.__h=[],n.some(function(n){n.call(u)})}catch(n){l.__e(n,u.__v)}})}function L(l,u,i,t,r,o,f,c){var s,a,v,y=i.props,p=u.props,d=u.type,_=0;if("svg"===d&&(r=!0),null!=o)for(;_<o.length;_++)if((s=o[_])&&"setAttribute"in s==!!d&&(d?s.localName===d:3===s.nodeType)){l=s,o[_]=null;break}if(null==l){if(null===d)return document.createTextNode(p);l=r?document.createElementNS("http://www.w3.org/2000/svg",d):document.createElement(d,p.is&&p),o=null,c=!1}if(null===d)y===p||c&&l.data===p||(l.data=p);else{if(o=o&&n.call(l.childNodes),a=(y=i.props||e).dangerouslySetInnerHTML,v=p.dangerouslySetInnerHTML,!c){if(null!=o)for(y={},_=0;_<l.attributes.length;_++)y[l.attributes[_].name]=l.attributes[_].value;(v||a)&&(v&&(a&&v.__html==a.__html||v.__html===l.innerHTML)||(l.innerHTML=v&&v.__html||""))}if(C(l,p,y,r,c),v)u.__k=[];else if(_=u.props.children,w(l,Array.isArray(_)?_:[_],u,i,t,r&&"foreignObject"!==d,o,f,o?o[0]:i.__k&&k(i,0),c),null!=o)for(_=o.length;_--;)null!=o[_]&&h(o[_]);c||("value"in p&&void 0!==(_=p.value)&&(_!==y.value||_!==l.value||"progress"===d&&!_)&&H(l,"value",_,y.value,!1),"checked"in p&&void 0!==(_=p.checked)&&_!==l.checked&&H(l,"checked",_,y.checked,!1))}return l}function M(n,u,i){try{"function"==typeof n?n(u):n.current=u}catch(n){l.__e(n,i)}}function N(n,u,i){var t,r;if(l.unmount&&l.unmount(n),(t=n.ref)&&(t.current&&t.current!==n.__e||M(t,null,u)),null!=(t=n.__c)){if(t.componentWillUnmount)try{t.componentWillUnmount()}catch(n){l.__e(n,u)}t.base=t.__P=null}if(t=n.__k)for(r=0;r<t.length;r++)t[r]&&N(t[r],u,"function"!=typeof n.type);i||null==n.__e||h(n.__e),n.__e=n.__d=void 0}function O(n,l,u){return this.constructor(n,u)}function S(u,i,t){var r,o,f;l.__&&l.__(u,i),o=(r="function"==typeof t)?null:t&&t.__k||i.__k,f=[],j(i,u=(!r&&t||i).__k=v(d,null,[u]),o||e,e,void 0!==i.ownerSVGElement,!r&&t?[t]:o?null:i.firstChild?n.call(i.childNodes):null,f,!r&&t?t:o?o.__e:i.firstChild,r),z(f,u)}function q(n,l){S(n,l,q)}function B(l,u,i){var t,r,o,f=a({},l.props);for(o in u)"key"==o?t=u[o]:"ref"==o?r=u[o]:f[o]=u[o];return arguments.length>2&&(f.children=arguments.length>3?n.call(arguments,2):i),y(l.type,f,t||l.key,r||l.ref,null)}function D(n,l){var u={__c:l="__cC"+f++,__:n,Consumer:function(n,l){return n.children(l)},Provider:function(n){var u,i;return this.getChildContext||(u=[],(i={})[l]=this,this.getChildContext=function(){return i},this.shouldComponentUpdate=function(n){this.props.value!==n.value&&u.some(m)},this.sub=function(n){u.push(n);var l=n.componentWillUnmount;n.componentWillUnmount=function(){u.splice(u.indexOf(n),1),l&&l.call(n)}}),n.children}};return u.Provider.__=u.Consumer.contextType=u}n=c.slice,l={__e:function(n,l){for(var u,i,t;l=l.__;)if((u=l.__c)&&!u.__)try{if((i=u.constructor)&&null!=i.getDerivedStateFromError&&(u.setState(i.getDerivedStateFromError(n)),t=u.__d),null!=u.componentDidCatch&&(u.componentDidCatch(n),t=u.__d),t)return u.__E=u}catch(l){n=l}throw n}},u=0,i=function(n){return null!=n&&void 0===n.constructor},_.prototype.setState=function(n,l){var u;u=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=a({},this.state),"function"==typeof n&&(n=n(a({},u),this.props)),n&&a(u,n),null!=n&&this.__v&&(l&&this.__h.push(l),m(this))},_.prototype.forceUpdate=function(n){this.__v&&(this.__e=!0,n&&this.__h.push(n),m(this))},_.prototype.render=d,t=[],r="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,g.__r=0,f=0;
3216
+ var n,l,u,i,t,o,r,f,e={},c=[],s=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function a(n,l){for(var u in l)n[u]=l[u];return n}function h(n){var l=n.parentNode;l&&l.removeChild(n)}function v(l,u,i){var t,o,r,f={};for(r in u)"key"==r?t=u[r]:"ref"==r?o=u[r]:f[r]=u[r];if(arguments.length>2&&(f.children=arguments.length>3?n.call(arguments,2):i),"function"==typeof l&&null!=l.defaultProps)for(r in l.defaultProps)void 0===f[r]&&(f[r]=l.defaultProps[r]);return y(l,f,t,o,null)}function y(n,i,t,o,r){var f={type:n,props:i,key:t,ref:o,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==r?++u:r};return null==r&&null!=l.vnode&&l.vnode(f),f}function p(){return{current:null}}function d(n){return n.children}function _(n,l){this.props=n,this.context=l}function k(n,l){if(null==l)return n.__?k(n.__,n.__.__k.indexOf(n)+1):null;for(var u;l<n.__k.length;l++)if(null!=(u=n.__k[l])&&null!=u.__e)return u.__e;return"function"==typeof n.type?k(n):null}function b(n){var l,u;if(null!=(n=n.__)&&null!=n.__c){for(n.__e=n.__c.base=null,l=0;l<n.__k.length;l++)if(null!=(u=n.__k[l])&&null!=u.__e){n.__e=n.__c.base=u.__e;break}return b(n)}}function m(n){(!n.__d&&(n.__d=!0)&&t.push(n)&&!g.__r++||r!==l.debounceRendering)&&((r=l.debounceRendering)||o)(g)}function g(){for(var n;g.__r=t.length;)n=t.sort(function(n,l){return n.__v.__b-l.__v.__b}),t=[],n.some(function(n){var l,u,i,t,o,r;n.__d&&(o=(t=(l=n).__v).__e,(r=l.__P)&&(u=[],(i=a({},t)).__v=t.__v+1,j(r,t,i,l.__n,void 0!==r.ownerSVGElement,null!=t.__h?[o]:null,u,null==o?k(t):o,t.__h),z(u,t),t.__e!=o&&b(t)))})}function w(n,l,u,i,t,o,r,f,s,a){var h,v,p,_,b,m,g,w=i&&i.__k||c,A=w.length;for(u.__k=[],h=0;h<l.length;h++)if(null!=(_=u.__k[h]=null==(_=l[h])||"boolean"==typeof _?null:"string"==typeof _||"number"==typeof _||"bigint"==typeof _?y(null,_,null,null,_):Array.isArray(_)?y(d,{children:_},null,null,null):_.__b>0?y(_.type,_.props,_.key,null,_.__v):_)){if(_.__=u,_.__b=u.__b+1,null===(p=w[h])||p&&_.key==p.key&&_.type===p.type)w[h]=void 0;else for(v=0;v<A;v++){if((p=w[v])&&_.key==p.key&&_.type===p.type){w[v]=void 0;break}p=null}j(n,_,p=p||e,t,o,r,f,s,a),b=_.__e,(v=_.ref)&&p.ref!=v&&(g||(g=[]),p.ref&&g.push(p.ref,null,_),g.push(v,_.__c||b,_)),null!=b?(null==m&&(m=b),"function"==typeof _.type&&_.__k===p.__k?_.__d=s=x(_,s,n):s=P(n,_,p,w,b,s),"function"==typeof u.type&&(u.__d=s)):s&&p.__e==s&&s.parentNode!=n&&(s=k(p))}for(u.__e=m,h=A;h--;)null!=w[h]&&("function"==typeof u.type&&null!=w[h].__e&&w[h].__e==u.__d&&(u.__d=k(i,h+1)),N(w[h],w[h]));if(g)for(h=0;h<g.length;h++)M(g[h],g[++h],g[++h])}function x(n,l,u){for(var i,t=n.__k,o=0;t&&o<t.length;o++)(i=t[o])&&(i.__=n,l="function"==typeof i.type?x(i,l,u):P(u,i,i,t,i.__e,l));return l}function A(n,l){return l=l||[],null==n||"boolean"==typeof n||(Array.isArray(n)?n.some(function(n){A(n,l)}):l.push(n)),l}function P(n,l,u,i,t,o){var r,f,e;if(void 0!==l.__d)r=l.__d,l.__d=void 0;else if(null==u||t!=o||null==t.parentNode)n:if(null==o||o.parentNode!==n)n.appendChild(t),r=null;else{for(f=o,e=0;(f=f.nextSibling)&&e<i.length;e+=2)if(f==t)break n;n.insertBefore(t,o),r=o}return void 0!==r?r:t.nextSibling}function C(n,l,u,i,t){var o;for(o in u)"children"===o||"key"===o||o in l||H(n,o,null,u[o],i);for(o in l)t&&"function"!=typeof l[o]||"children"===o||"key"===o||"value"===o||"checked"===o||u[o]===l[o]||H(n,o,l[o],u[o],i)}function $(n,l,u){"-"===l[0]?n.setProperty(l,u):n[l]=null==u?"":"number"!=typeof u||s.test(l)?u:u+"px"}function H(n,l,u,i,t){var o;n:if("style"===l)if("string"==typeof u)n.style.cssText=u;else{if("string"==typeof i&&(n.style.cssText=i=""),i)for(l in i)u&&l in u||$(n.style,l,"");if(u)for(l in u)i&&u[l]===i[l]||$(n.style,l,u[l])}else if("o"===l[0]&&"n"===l[1])o=l!==(l=l.replace(/Capture$/,"")),l=l.toLowerCase()in n?l.toLowerCase().slice(2):l.slice(2),n.l||(n.l={}),n.l[l+o]=u,u?i||n.addEventListener(l,o?T:I,o):n.removeEventListener(l,o?T:I,o);else if("dangerouslySetInnerHTML"!==l){if(t)l=l.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("href"!==l&&"list"!==l&&"form"!==l&&"tabIndex"!==l&&"download"!==l&&l in n)try{n[l]=null==u?"":u;break n}catch(n){}"function"==typeof u||(null!=u&&(!1!==u||"a"===l[0]&&"r"===l[1])?n.setAttribute(l,u):n.removeAttribute(l))}}function I(n){this.l[n.type+!1](l.event?l.event(n):n)}function T(n){this.l[n.type+!0](l.event?l.event(n):n)}function j(n,u,i,t,o,r,f,e,c){var s,h,v,y,p,k,b,m,g,x,A,P=u.type;if(void 0!==u.constructor)return null;null!=i.__h&&(c=i.__h,e=u.__e=i.__e,u.__h=null,r=[e]),(s=l.__b)&&s(u);try{n:if("function"==typeof P){if(m=u.props,g=(s=P.contextType)&&t[s.__c],x=s?g?g.props.value:s.__:t,i.__c?b=(h=u.__c=i.__c).__=h.__E:("prototype"in P&&P.prototype.render?u.__c=h=new P(m,x):(u.__c=h=new _(m,x),h.constructor=P,h.render=O),g&&g.sub(h),h.props=m,h.state||(h.state={}),h.context=x,h.__n=t,v=h.__d=!0,h.__h=[]),null==h.__s&&(h.__s=h.state),null!=P.getDerivedStateFromProps&&(h.__s==h.state&&(h.__s=a({},h.__s)),a(h.__s,P.getDerivedStateFromProps(m,h.__s))),y=h.props,p=h.state,v)null==P.getDerivedStateFromProps&&null!=h.componentWillMount&&h.componentWillMount(),null!=h.componentDidMount&&h.__h.push(h.componentDidMount);else{if(null==P.getDerivedStateFromProps&&m!==y&&null!=h.componentWillReceiveProps&&h.componentWillReceiveProps(m,x),!h.__e&&null!=h.shouldComponentUpdate&&!1===h.shouldComponentUpdate(m,h.__s,x)||u.__v===i.__v){h.props=m,h.state=h.__s,u.__v!==i.__v&&(h.__d=!1),h.__v=u,u.__e=i.__e,u.__k=i.__k,u.__k.forEach(function(n){n&&(n.__=u)}),h.__h.length&&f.push(h);break n}null!=h.componentWillUpdate&&h.componentWillUpdate(m,h.__s,x),null!=h.componentDidUpdate&&h.__h.push(function(){h.componentDidUpdate(y,p,k)})}h.context=x,h.props=m,h.state=h.__s,(s=l.__r)&&s(u),h.__d=!1,h.__v=u,h.__P=n,s=h.render(h.props,h.state,h.context),h.state=h.__s,null!=h.getChildContext&&(t=a(a({},t),h.getChildContext())),v||null==h.getSnapshotBeforeUpdate||(k=h.getSnapshotBeforeUpdate(y,p)),A=null!=s&&s.type===d&&null==s.key?s.props.children:s,w(n,Array.isArray(A)?A:[A],u,i,t,o,r,f,e,c),h.base=u.__e,u.__h=null,h.__h.length&&f.push(h),b&&(h.__E=h.__=null),h.__e=!1}else null==r&&u.__v===i.__v?(u.__k=i.__k,u.__e=i.__e):u.__e=L(i.__e,u,i,t,o,r,f,c);(s=l.diffed)&&s(u)}catch(n){u.__v=null,(c||null!=r)&&(u.__e=e,u.__h=!!c,r[r.indexOf(e)]=null),l.__e(n,u,i)}}function z(n,u){l.__c&&l.__c(u,n),n.some(function(u){try{n=u.__h,u.__h=[],n.some(function(n){n.call(u)})}catch(n){l.__e(n,u.__v)}})}function L(l,u,i,t,o,r,f,c){var s,a,v,y=i.props,p=u.props,d=u.type,_=0;if("svg"===d&&(o=!0),null!=r)for(;_<r.length;_++)if((s=r[_])&&"setAttribute"in s==!!d&&(d?s.localName===d:3===s.nodeType)){l=s,r[_]=null;break}if(null==l){if(null===d)return document.createTextNode(p);l=o?document.createElementNS("http://www.w3.org/2000/svg",d):document.createElement(d,p.is&&p),r=null,c=!1}if(null===d)y===p||c&&l.data===p||(l.data=p);else{if(r=r&&n.call(l.childNodes),a=(y=i.props||e).dangerouslySetInnerHTML,v=p.dangerouslySetInnerHTML,!c){if(null!=r)for(y={},_=0;_<l.attributes.length;_++)y[l.attributes[_].name]=l.attributes[_].value;(v||a)&&(v&&(a&&v.__html==a.__html||v.__html===l.innerHTML)||(l.innerHTML=v&&v.__html||""))}if(C(l,p,y,o,c),v)u.__k=[];else if(_=u.props.children,w(l,Array.isArray(_)?_:[_],u,i,t,o&&"foreignObject"!==d,r,f,r?r[0]:i.__k&&k(i,0),c),null!=r)for(_=r.length;_--;)null!=r[_]&&h(r[_]);c||("value"in p&&void 0!==(_=p.value)&&(_!==l.value||"progress"===d&&!_||"option"===d&&_!==y.value)&&H(l,"value",_,y.value,!1),"checked"in p&&void 0!==(_=p.checked)&&_!==l.checked&&H(l,"checked",_,y.checked,!1))}return l}function M(n,u,i){try{"function"==typeof n?n(u):n.current=u}catch(n){l.__e(n,i)}}function N(n,u,i){var t,o;if(l.unmount&&l.unmount(n),(t=n.ref)&&(t.current&&t.current!==n.__e||M(t,null,u)),null!=(t=n.__c)){if(t.componentWillUnmount)try{t.componentWillUnmount()}catch(n){l.__e(n,u)}t.base=t.__P=null}if(t=n.__k)for(o=0;o<t.length;o++)t[o]&&N(t[o],u,"function"!=typeof n.type);i||null==n.__e||h(n.__e),n.__e=n.__d=void 0}function O(n,l,u){return this.constructor(n,u)}function S(u,i,t){var o,r,f;l.__&&l.__(u,i),r=(o="function"==typeof t)?null:t&&t.__k||i.__k,f=[],j(i,u=(!o&&t||i).__k=v(d,null,[u]),r||e,e,void 0!==i.ownerSVGElement,!o&&t?[t]:r?null:i.firstChild?n.call(i.childNodes):null,f,!o&&t?t:r?r.__e:i.firstChild,o),z(f,u)}function q(n,l){S(n,l,q)}function B(l,u,i){var t,o,r,f=a({},l.props);for(r in u)"key"==r?t=u[r]:"ref"==r?o=u[r]:f[r]=u[r];return arguments.length>2&&(f.children=arguments.length>3?n.call(arguments,2):i),y(l.type,f,t||l.key,o||l.ref,null)}function D(n,l){var u={__c:l="__cC"+f++,__:n,Consumer:function(n,l){return n.children(l)},Provider:function(n){var u,i;return this.getChildContext||(u=[],(i={})[l]=this,this.getChildContext=function(){return i},this.shouldComponentUpdate=function(n){this.props.value!==n.value&&u.some(m)},this.sub=function(n){u.push(n);var l=n.componentWillUnmount;n.componentWillUnmount=function(){u.splice(u.indexOf(n),1),l&&l.call(n)}}),n.children}};return u.Provider.__=u.Consumer.contextType=u}n=c.slice,l={__e:function(n,l,u,i){for(var t,o,r;l=l.__;)if((t=l.__c)&&!t.__)try{if((o=t.constructor)&&null!=o.getDerivedStateFromError&&(t.setState(o.getDerivedStateFromError(n)),r=t.__d),null!=t.componentDidCatch&&(t.componentDidCatch(n,i||{}),r=t.__d),r)return t.__E=t}catch(l){n=l}throw n}},u=0,i=function(n){return null!=n&&void 0===n.constructor},_.prototype.setState=function(n,l){var u;u=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=a({},this.state),"function"==typeof n&&(n=n(a({},u),this.props)),n&&a(u,n),null!=n&&this.__v&&(l&&this.__h.push(l),m(this))},_.prototype.forceUpdate=function(n){this.__v&&(this.__e=!0,n&&this.__h.push(n),m(this))},_.prototype.render=d,t=[],o="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,g.__r=0,f=0;
3217
3217
  //# sourceMappingURL=preact.module.js.map
3218
3218
 
3219
3219
 
@@ -3364,7 +3364,7 @@ var n,l,u,i,t,r,o,f,e={},c=[],s=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[c
3364
3364
  /******/
3365
3365
  /******/ /* webpack/runtime/jsonp chunk loading */
3366
3366
  /******/ (() => {
3367
- /******/ __webpack_require__.b = document.baseURI || self.location.href;
3367
+ /******/ // no baseURI
3368
3368
  /******/
3369
3369
  /******/ // object to store loaded and loading chunks
3370
3370
  /******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched
@@ -4338,7 +4338,10 @@ class Store {
4338
4338
  store_defineProperty(this, "setIsOpen", isopen => {
4339
4339
  let lastisopen = this.kv.match('isopen');
4340
4340
  this.kv.put('isopen', isopen);
4341
- if (!lastisopen && isopen) sendEventToThirdParty('SUBIZ Chat', 'Opened', 'Subiz Windows');
4341
+
4342
+ if (!lastisopen && isopen) {
4343
+ sendEventToThirdParty('SUBIZ Chat', 'Opened', 'Subiz Windows');
4344
+ }
4342
4345
  });
4343
4346
 
4344
4347
  store_defineProperty(this, "closePreview", () => this.kv.put('close_preview_at', new util/* default.Date */.Z.Date().getTime()));
@@ -5000,6 +5003,20 @@ class Store {
5000
5003
 
5001
5004
  this.onWs(ret);
5002
5005
  sendEventToThirdParty('SUBIZ Chat', 'Sent', 'User');
5006
+ let lastMsgSent = this.kv.match('last_msg_sent');
5007
+
5008
+ if (!lastMsgSent) {
5009
+ let dataLayer = window.dataLayer || [];
5010
+ dataLayer.push({
5011
+ event: 'SUBIZ Chat',
5012
+ event_action: 'Sent',
5013
+ event_label: 'User',
5014
+ first_interaction: 1
5015
+ });
5016
+ }
5017
+
5018
+ this.kv.put('last_msg_sent', util/* default.Date.now */.Z.Date.now());
5019
+ return ret;
5003
5020
  }
5004
5021
 
5005
5022
  _setConvo(convo) {
@@ -5133,7 +5150,7 @@ class Store {
5133
5150
 
5134
5151
  async loopTime() {
5135
5152
  let startms = util/* default.Date.now */.Z.Date.now();
5136
- if (!util/* default.get */.Z.get(this.kv.match('user'), 'id')) return setTimeout(() => this.loopTime(), 30000);
5153
+ if (!util/* default.get */.Z.get(this.kv.match('user'), 'id')) return setTimeout(() => this.loopTime(), 120000);
5137
5154
  let {
5138
5155
  body: t,
5139
5156
  error
@@ -5143,7 +5160,7 @@ class Store {
5143
5160
  var serverMs = new util/* default.Date */.Z.Date(t).getTime() + latences;
5144
5161
  var localMs = util/* default.Date.now */.Z.Date.now();
5145
5162
  this.timeDiff = Math.floor(serverMs - localMs);
5146
- setTimeout(() => this.loopTime(), 60000);
5163
+ setTimeout(() => this.loopTime(), 120000);
5147
5164
  }
5148
5165
 
5149
5166
  replaceFileUrl(src) {
@@ -5298,6 +5315,12 @@ function sendEventToThirdParty(category, action, label) {
5298
5315
  }));
5299
5316
  sendToGA(category, action, label);
5300
5317
  sendToFBPixel(category, action, label);
5318
+ let dataLayer = window.dataLayer || [];
5319
+ dataLayer.push({
5320
+ event: category,
5321
+ event_action: action,
5322
+ event_label: label
5323
+ });
5301
5324
  }
5302
5325
 
5303
5326
  let mobileCheck = function (a) {
@@ -5683,7 +5706,7 @@ util/* default.preloadWebfonts */.Z.preloadWebfonts(['Roboto'], [400, 500]);
5683
5706
 
5684
5707
  class Widget {
5685
5708
  constructor(ApiURL, FileURL, RealtimeURL, inmem, fake, agenttoken) {
5686
- lib_defineProperty(this, "version", () => '4.4');
5709
+ lib_defineProperty(this, "version", () => '4.5');
5687
5710
 
5688
5711
  lib_defineProperty(this, "setSetting", setting => this.store.setSetting({
5689
5712
  account_setting: setting
@@ -5767,7 +5790,21 @@ class Widget {
5767
5790
  }
5768
5791
 
5769
5792
  async sendMessage(convoid, message) {
5770
- this.store.sendConvoEvent(convoid, 'message_sent', {
5793
+ if (!convoid) {
5794
+ const {
5795
+ convo,
5796
+ error
5797
+ } = await this.store.startConvo({
5798
+ message: message.text,
5799
+ initial_by: this.store.matchUser().id
5800
+ });
5801
+ if (error) return {
5802
+ error
5803
+ };
5804
+ convoid = convo.id;
5805
+ }
5806
+
5807
+ return this.store.sendConvoEvent(convoid, 'message_sent', {
5771
5808
  message
5772
5809
  });
5773
5810
  }
@@ -5786,11 +5823,11 @@ class Widget {
5786
5823
  this.pluginMgr.hideCurrentGreeting();
5787
5824
  }
5788
5825
 
5789
- async showWidget(view, convo) {
5826
+ async showWidget(view, cid) {
5790
5827
  await this.domGate.entry();
5791
5828
  this.pluginMgr.showCurrentChatbox({
5792
5829
  view,
5793
- cid: convo
5830
+ cid: cid
5794
5831
  });
5795
5832
  }
5796
5833
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@subiz/widget-v4",
3
- "version": "4.0.64",
3
+ "version": "4.0.68",
4
4
  "main": "./compiled_src/lib.js",
5
5
  "scripts": {
6
6
  "dev": "npx webpack serve --config webpack.dev.js",
@@ -14,25 +14,25 @@
14
14
  "@subiz/storage": "0.0.8",
15
15
  "@subiz/wsclient": "^3.1.7",
16
16
  "cookie_js": "1.4.2",
17
- "core-js": "^3.21.0",
18
- "css-loader": "^6.6.0",
17
+ "core-js": "^3.21.1",
18
+ "css-loader": "5.2.7",
19
19
  "file-loader": "^6.2.0",
20
20
  "less": "^4.1.2",
21
21
  "less-loader": "^10.2.0",
22
22
  "marked": "^4.0.12",
23
- "preact": "^10.6.5"
23
+ "preact": "^10.7.0"
24
24
  },
25
25
  "devDependencies": {
26
- "@babel/cli": "^7.17.0",
27
- "@babel/core": "^7.17.0",
26
+ "@babel/core": "^7.17.8",
28
27
  "@babel/plugin-proposal-class-properties": "^7.16.7",
29
- "@babel/plugin-transform-react-jsx": "^7.16.7",
28
+ "@babel/plugin-transform-react-jsx": "^7.17.3",
30
29
  "@babel/preset-env": "^7.16.11",
31
- "babel-loader": "^8.2.3",
30
+ "@babel/cli": "^7.17.5",
31
+ "babel-loader": "^8.2.4",
32
32
  "babel-plugin-syntax-jsx": "^6.18.0",
33
33
  "html-webpack-plugin": "^5.5.0",
34
- "puppeteer": "^13.3.0",
35
- "webpack": "^5.68.0",
34
+ "puppeteer": "^13.5.2",
35
+ "webpack": "^5.70.0",
36
36
  "webpack-bundle-analyzer": "^4.5.0",
37
37
  "webpack-cli": "^4.9.2",
38
38
  "webpack-dev-server": "^4.7.4"
@@ -1,18 +1,18 @@
1
1
  import sb from '../util/index.js'
2
- import { Com } from '../common.js'
3
- import { h } from 'preact'
2
+ import {Com} from '../common.js'
3
+ import {h} from 'preact'
4
4
 
5
5
  export default class Buttons extends Com {
6
- constructor (props) {
6
+ constructor(props) {
7
7
  super(props)
8
8
  }
9
9
 
10
- render () {
10
+ render() {
11
11
  if (sb.size(this.props.buttons) === 0) return null
12
12
  var $buttons = sb.map(this.props.buttons, (button, index) => {
13
13
  if (button.type === 'call_button') {
14
14
  return (
15
- <a class="url-button-attachment" href={'tel:' + button.phone_number} key={index} title={button.title}>
15
+ <a class='url-button-attachment' href={'tel:' + button.phone_number} key={index} title={button.title}>
16
16
  {button.title}
17
17
  </a>
18
18
  )
@@ -20,7 +20,7 @@ export default class Buttons extends Com {
20
20
 
21
21
  if (button.type === 'url_button') {
22
22
  return (
23
- <a class="url-button-attachment" href={button.url} target="_blank" key={index} title={button.title}>
23
+ <a class='url-button-attachment' href={button.url} target='_blank' key={index} title={button.title}>
24
24
  {button.title || button.url}
25
25
  </a>
26
26
  )
@@ -28,7 +28,7 @@ export default class Buttons extends Com {
28
28
 
29
29
  if (button.type === 'postback_button') {
30
30
  return (
31
- <a class="url-button-attachment" href="javascript:;" onClick={_ => this.props.onSelect(button)}>
31
+ <a class='url-button-attachment' href='javascript:;' onClick={(_) => this.props.onSelect(button)}>
32
32
  {button.title}
33
33
  </a>
34
34
  )
@@ -39,6 +39,6 @@ export default class Buttons extends Com {
39
39
  return null
40
40
  })
41
41
 
42
- return <div class="button-attachments">{$buttons}</div>
42
+ return <div class='button-attachments'>{$buttons}</div>
43
43
  }
44
44
  }
@@ -122,11 +122,11 @@ export default class ChatButton extends Com {
122
122
  if (new sb.Date().getTime() - this.props.store.matchClosePreviewAt() < Ms30Mins) return
123
123
 
124
124
  let greeting = sb.get(accountSetting, 'greeting', {})
125
- if (!greeting.message || !greeting.enabled) {
125
+ let text = this.props.t.i18n(sb.get(greeting, 'greeting', {})) || greeting.message
126
+ if (!text || !greeting.enabled) {
126
127
  this.setState({previewEvent: {}})
127
128
  return
128
129
  }
129
-
130
130
  this.ShowGreeting()
131
131
  }
132
132
 
@@ -140,7 +140,7 @@ export default class Event extends Com {
140
140
  />
141
141
  <FormSubmitAttachments store={this.props.store} ev={ev} t={this.props.t} />
142
142
  <GenericTemplateAttachments store={this.props.store} ev={ev} onSelect={(e) => this.choosePostbackBtn(e)} />
143
- <ProductAttachments t={this.props.t} store={this.props.store} ev={ev} />
143
+ <ProductAttachments t={this.props.t} onPostback={(e) => this.choosePostbackBtn(e)} store={this.props.store} ev={ev} />
144
144
  <OrderAttachments t={this.props.t} store={this.props.store} ev={ev} />
145
145
  <QuickReplies store={this.props.store} ev={ev} onSelect={(e) => this.chooseQuickReply(e)} />
146
146
  </div>
@@ -22,17 +22,53 @@ export default class ProductAttachments extends Com {
22
22
  let $products = sb.map(products, (att, index) => {
23
23
  let product = att.product
24
24
 
25
- let $detailbtn = null
25
+ let $detailbtns = []
26
26
  let url = product.url || product.mobile_url
27
27
  if (this.props.store.isMobile()) url = product.mobile_url || product.url
28
- if (url)
29
- $detailbtn = (
28
+ if (url && sb.size(product.buttons) == 0)
29
+ $detailbtns.push(
30
30
  <a class='product_attachment__btn' href={url} target='_blank'>
31
31
  {this.props.t('detail')}
32
32
  <img src={require('../../assets/img/external-link.svg')} class='product_attachment__btn_external_link' />
33
- </a>
33
+ </a>,
34
34
  )
35
35
 
36
+ console.log("P", product)
37
+
38
+ if (sb.size(product.buttons) > 0) {
39
+ $detailbtns = $detailbtns.concat(
40
+ sb.map(product.buttons, (button, index) => {
41
+ if (button.type === 'call_button') {
42
+ return (
43
+ <a class='product_attachment__btn' href={'tel:' + button.phone_number} key={index} title={button.title}>
44
+ {button.title}
45
+ </a>
46
+ )
47
+ }
48
+
49
+ if (button.type === 'url_button') {
50
+ return (
51
+ <a class='product_attachment__btn' href={button.url} target='_blank' key={index} title={button.title}>
52
+ {button.title || this.props.t('detail')}{' '}
53
+ <img
54
+ src={require('../../assets/img/external-link.svg')}
55
+ class='product_attachment__btn_external_link'
56
+ />
57
+ </a>
58
+ )
59
+ }
60
+
61
+ if (button.type === 'postback_button') {
62
+ return (
63
+ <a class='product_attachment__btn' href='javascript:;' onClick={(_) => this.props.onPostback(button)}>
64
+ {button.title}
65
+ </a>
66
+ )
67
+ }
68
+ }),
69
+ )
70
+ }
71
+
36
72
  let $title = (
37
73
  <a href={url} class='product_attachment__title' target='_blank'>
38
74
  {product.name}
@@ -60,7 +96,7 @@ export default class ProductAttachments extends Com {
60
96
  {$title}
61
97
  {$subtitle}
62
98
  {$price}
63
- <div class='product_attachment__btns'>{$detailbtn}</div>
99
+ <div class='product_attachment__btns'>{$detailbtns}</div>
64
100
  </div>
65
101
  )
66
102
  })
@@ -30,6 +30,10 @@ export default class Typing extends Com {
30
30
  return
31
31
  }
32
32
 
33
+ // dont show typing of agent, some agent dont like this
34
+ let ag = this.props.store.matchAgent(ev.by.id)
35
+ if (ag.type == 'agent') return
36
+
33
37
  if (sb.get(ev, 'type') !== 'conversation_typing') return
34
38
  this.setState({ ev: ev, isShow: true })
35
39
  if (this.timer) clearTimeout(this.timer)
@@ -38,7 +42,7 @@ export default class Typing extends Com {
38
42
 
39
43
  this.timer = null
40
44
  this.setState({ isShow: false })
41
- }, 10000)
45
+ }, 5000)
42
46
  })
43
47
  }
44
48
 
@@ -160,12 +160,15 @@ export default class Main extends Com {
160
160
  }
161
161
 
162
162
  function restoreViewport() {
163
- // remove our viewport
163
+ // restore scroll attribute for background document
164
+ if (document.body && document.body.classList) document.body.classList.remove('sbz_no_scroll')
164
165
  let metatag = document.getElementById('subiz-meta-viewport')
165
166
  if (metatag) metatag.remove()
166
167
  }
167
168
 
168
169
  function modifyViewport() {
170
+ // dont allow to scroll background document
171
+ if (document.body && document.body.classList) document.body.classList.add('sbz_no_scroll')
169
172
  let metatag = document.createElement('meta')
170
173
  metatag.httpEquiv = 'X-UA-Compatible'
171
174
  metatag.name = 'viewport'
package/src/lib.js CHANGED
@@ -85,7 +85,15 @@ class Widget {
85
85
  }
86
86
 
87
87
  async sendMessage(convoid, message) {
88
- this.store.sendConvoEvent(convoid, 'message_sent', {message})
88
+ if (!convoid) {
89
+ const {convo, error} = await this.store.startConvo({
90
+ message: message.text,
91
+ initial_by: this.store.matchUser().id,
92
+ })
93
+ if (error) return {error}
94
+ convoid = convo.id
95
+ }
96
+ return this.store.sendConvoEvent(convoid, 'message_sent', {message})
89
97
  }
90
98
 
91
99
  startConvo(req) {
@@ -102,9 +110,10 @@ class Widget {
102
110
  this.pluginMgr.hideCurrentGreeting()
103
111
  }
104
112
 
105
- async showWidget(view, convo) {
113
+ // view could be: chat, list, offline_form
114
+ async showWidget(view, cid) {
106
115
  await this.domGate.entry()
107
- this.pluginMgr.showCurrentChatbox({view, cid: convo})
116
+ this.pluginMgr.showCurrentChatbox({view, cid: cid})
108
117
  }
109
118
 
110
119
  async hideWidget() {
@@ -112,7 +121,7 @@ class Widget {
112
121
  this.pluginMgr.hideCurrentChatbox()
113
122
  }
114
123
 
115
- version = () => '4.4'
124
+ version = () => '4.5'
116
125
 
117
126
  setSetting = (setting) => this.store.setSetting({account_setting: setting})
118
127
  getSetting = (_) => ({account_setting: sb.cloneDeep(this.store.matchAccountSetting())})