@subiz/widget-v4 4.1.104 → 4.1.106
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.
- package/compiled_src/chatbox/Event.js +6 -1
- package/compiled_src/lib.js +2 -1
- package/compiled_src/util/common.js +1 -1
- package/dist/132.js +3 -3
- package/dist/185.js +5 -5
- package/dist/{191ee43a45a.27.js → 19258dbe3c2.27.js} +1 -1
- package/dist/{191ee43a45a.459.js → 19258dbe3c2.459.js} +1 -1
- package/dist/19258dbe3c2.app.js +1 -0
- package/dist/{191ee43a45a.index.html → 19258dbe3c2.index.html} +1 -1
- package/dist/{191ee43a45a.library.html → 19258dbe3c2.library.html} +1 -1
- package/dist/19258dbe3c2.library.js +1 -0
- package/dist/{191ee43a45a.preview.html → 19258dbe3c2.preview.html} +1 -1
- package/dist/19258dbe3c2.preview.js +1 -0
- package/dist/19258dbe3c2.webview.js +1 -0
- package/dist/27.js +1 -1
- package/dist/459.js +1 -1
- package/dist/HASH +1 -1
- package/dist/screenshoot.js +51 -38
- package/package.json +7 -7
- package/src/chatbox/Event.js +6 -1
- package/src/chatbox/Events.js +1 -5
- package/src/lib.js +2 -1
- package/src/util/common.js +59 -61
- package/dist/191ee43a45a.app.js +0 -1
- package/dist/191ee43a45a.library.js +0 -1
- package/dist/191ee43a45a.preview.js +0 -1
- package/dist/191ee43a45a.webview.js +0 -1
- /package/dist/{191ee43a45a.127.js → 19258dbe3c2.127.js} +0 -0
- /package/dist/{191ee43a45a.132.js → 19258dbe3c2.132.js} +0 -0
- /package/dist/{191ee43a45a.185.js → 19258dbe3c2.185.js} +0 -0
- /package/dist/{191ee43a45a.278.js → 19258dbe3c2.278.js} +0 -0
- /package/dist/{191ee43a45a.490.js → 19258dbe3c2.490.js} +0 -0
- /package/dist/{191ee43a45a.74.js → 19258dbe3c2.74.js} +0 -0
- /package/dist/{191ee43a45a.997.js → 19258dbe3c2.997.js} +0 -0
package/dist/screenshoot.js
CHANGED
|
@@ -3085,7 +3085,7 @@ __webpack_require__.d(campaign_namespaceObject, {
|
|
|
3085
3085
|
|
|
3086
3086
|
// EXTERNAL MODULE: ./src/util/common.js
|
|
3087
3087
|
var common = __webpack_require__(9917);
|
|
3088
|
-
;//
|
|
3088
|
+
;// ./src/util/campaign.js
|
|
3089
3089
|
var campaign_common = __webpack_require__(9917);
|
|
3090
3090
|
function trackExitIntent(cb) {
|
|
3091
3091
|
let handler = e => {
|
|
@@ -3166,7 +3166,7 @@ function on(eventName, selector, fn) {
|
|
|
3166
3166
|
}
|
|
3167
3167
|
});
|
|
3168
3168
|
}
|
|
3169
|
-
;//
|
|
3169
|
+
;// ./src/util/index.js
|
|
3170
3170
|
var sb = {};
|
|
3171
3171
|
|
|
3172
3172
|
sb = Object.assign(sb, common);
|
|
@@ -3852,7 +3852,7 @@ var __webpack_exports__ = {};
|
|
|
3852
3852
|
|
|
3853
3853
|
// EXTERNAL MODULE: ./src/util/index.js + 1 modules
|
|
3854
3854
|
var util = __webpack_require__(8150);
|
|
3855
|
-
;//
|
|
3855
|
+
;// ./node_modules/@subiz/storage/index.js
|
|
3856
3856
|
var kv = (__webpack_require__(1314)/* ["default"] */ .A);
|
|
3857
3857
|
var chain = (__webpack_require__(3118)/* ["default"] */ .A);
|
|
3858
3858
|
var inmem_localstorage = (__webpack_require__(1554)/* ["default"] */ .A);
|
|
@@ -3863,7 +3863,7 @@ var lsdb = (__webpack_require__(1428)/* ["default"] */ .A);
|
|
|
3863
3863
|
chain,
|
|
3864
3864
|
inmem_localstorage
|
|
3865
3865
|
});
|
|
3866
|
-
;//
|
|
3866
|
+
;// ./src/store/api.js
|
|
3867
3867
|
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
3868
3868
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
3869
3869
|
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); }
|
|
@@ -3973,6 +3973,7 @@ function jsonifyTextPlain(param, done) {
|
|
|
3973
3973
|
_defineProperty(this, "suggest_address", keyword => this.apireq.setQuery({
|
|
3974
3974
|
keyword: keyword
|
|
3975
3975
|
}).get(`/accounts/${this.accid}/addresses`));
|
|
3976
|
+
_defineProperty(this, "create_ticket", ticket => this.apireq.post(`/accounts/${this.accid}/tickets`, ticket));
|
|
3976
3977
|
this.refreshLock = new util/* default */.A.Mutex();
|
|
3977
3978
|
this.FileURL = FileURL;
|
|
3978
3979
|
this.ApiURL = ApiURL;
|
|
@@ -4135,7 +4136,7 @@ function jsonifyTextPlain(param, done) {
|
|
|
4135
4136
|
});
|
|
4136
4137
|
}
|
|
4137
4138
|
});
|
|
4138
|
-
;//
|
|
4139
|
+
;// ./src/store/api_fake.js
|
|
4139
4140
|
function api_fake_defineProperty(e, r, t) { return (r = api_fake_toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
4140
4141
|
function api_fake_toPropertyKey(t) { var i = api_fake_toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
4141
4142
|
function api_fake_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); }
|
|
@@ -4514,14 +4515,14 @@ function makeFakeMessages(accid, convoid, userid, agentid) {
|
|
|
4514
4515
|
}
|
|
4515
4516
|
}];
|
|
4516
4517
|
}
|
|
4517
|
-
;//
|
|
4518
|
+
;// ./src/store/realtime_fake.js
|
|
4518
4519
|
/* harmony default export */ const realtime_fake = (class {
|
|
4519
4520
|
onEvent() {}
|
|
4520
4521
|
onInterrupted() {}
|
|
4521
4522
|
subscribe() {}
|
|
4522
4523
|
stop() {}
|
|
4523
4524
|
});
|
|
4524
|
-
;//
|
|
4525
|
+
;// ./src/store/store.js
|
|
4525
4526
|
function store_defineProperty(e, r, t) { return (r = store_toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
4526
4527
|
function store_toPropertyKey(t) { var i = store_toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
4527
4528
|
function store_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); }
|
|
@@ -4814,6 +4815,9 @@ class Store {
|
|
|
4814
4815
|
createShippingAddress(addr) {
|
|
4815
4816
|
return this.api.createShippingAddress(addr);
|
|
4816
4817
|
}
|
|
4818
|
+
createTicket(ticket) {
|
|
4819
|
+
return this.api.create_ticket(ticket);
|
|
4820
|
+
}
|
|
4817
4821
|
async overrideAcc(acc) {
|
|
4818
4822
|
this.forceAcc = util/* default */.A.cloneDeep(acc);
|
|
4819
4823
|
await this.readyGate.entry();
|
|
@@ -5713,7 +5717,7 @@ var preact_module = __webpack_require__(172);
|
|
|
5713
5717
|
var Emoji = __webpack_require__(2959);
|
|
5714
5718
|
// EXTERNAL MODULE: ./src/chatbox/block.js
|
|
5715
5719
|
var chatbox_block = __webpack_require__(7072);
|
|
5716
|
-
;//
|
|
5720
|
+
;// ./src/chatbox/ChatButton.js
|
|
5717
5721
|
|
|
5718
5722
|
|
|
5719
5723
|
var defaultBubble = __webpack_require__(1108);
|
|
@@ -6094,7 +6098,7 @@ function randomAgent(agentM) {
|
|
|
6094
6098
|
const Ms30Mins = 30 * 60 * 1000;
|
|
6095
6099
|
const DEF_BG_URL = 'https://vcdn.subiz-cdn.com/file/bubble_11.svg?v=5';
|
|
6096
6100
|
const DEF_BG = 'linear-gradient(280.16deg, #0053d3 22.03%, #0265ff 78.2%)';
|
|
6097
|
-
;//
|
|
6101
|
+
;// ./src/chatbox/PoweredBy.js
|
|
6098
6102
|
var logo = __webpack_require__(9529);
|
|
6099
6103
|
|
|
6100
6104
|
function PoweredBy(props) {
|
|
@@ -6116,7 +6120,7 @@ function PoweredBy(props) {
|
|
|
6116
6120
|
alt: "powerred by subiz"
|
|
6117
6121
|
}), " Subiz"));
|
|
6118
6122
|
}
|
|
6119
|
-
;//
|
|
6123
|
+
;// ./src/chatbox/AgentsAvatar.js
|
|
6120
6124
|
|
|
6121
6125
|
|
|
6122
6126
|
|
|
@@ -6248,7 +6252,7 @@ function AgentsAvatar(props) {
|
|
|
6248
6252
|
src: props.store.replaceFileUrl(rightAgent.avatar_url) || __webpack_require__(2538)
|
|
6249
6253
|
})));
|
|
6250
6254
|
}
|
|
6251
|
-
;//
|
|
6255
|
+
;// ./src/chatbox/Header.js
|
|
6252
6256
|
|
|
6253
6257
|
|
|
6254
6258
|
|
|
@@ -6461,7 +6465,7 @@ let getJoinedNameMember = agents => {
|
|
|
6461
6465
|
if (!agents.length) return null;
|
|
6462
6466
|
return util/* default */.A.map(agents, agent => agent.fullname).join(', ');
|
|
6463
6467
|
};
|
|
6464
|
-
;//
|
|
6468
|
+
;// ./src/chatbox/MessageInput.js
|
|
6465
6469
|
function MessageInput_defineProperty(e, r, t) { return (r = MessageInput_toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
6466
6470
|
function MessageInput_toPropertyKey(t) { var i = MessageInput_toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
6467
6471
|
function MessageInput_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); }
|
|
@@ -6786,7 +6790,7 @@ function isSummited(form) {
|
|
|
6786
6790
|
let fields = util/* default */.A.get(form, 'fields') || [];
|
|
6787
6791
|
return util/* default */.A.find(fields, field => !!field.answered);
|
|
6788
6792
|
}
|
|
6789
|
-
;//
|
|
6793
|
+
;// ./src/chatbox/ImageAttachments.js
|
|
6790
6794
|
function ImageAttachments_defineProperty(e, r, t) { return (r = ImageAttachments_toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
6791
6795
|
function ImageAttachments_toPropertyKey(t) { var i = ImageAttachments_toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
6792
6796
|
function ImageAttachments_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); }
|
|
@@ -6923,7 +6927,7 @@ class ImageAttachment extends common/* Com */.Mw {
|
|
|
6923
6927
|
}
|
|
6924
6928
|
}
|
|
6925
6929
|
}
|
|
6926
|
-
;//
|
|
6930
|
+
;// ./src/chatbox/AudioAttachments.js
|
|
6927
6931
|
|
|
6928
6932
|
|
|
6929
6933
|
function AudioAttachments(props) {
|
|
@@ -6951,7 +6955,7 @@ function AudioAttachments(props) {
|
|
|
6951
6955
|
class: `message-${byType} message-${byType}-audio`
|
|
6952
6956
|
}, $audios);
|
|
6953
6957
|
}
|
|
6954
|
-
;//
|
|
6958
|
+
;// ./src/chatbox/FileAttachments.js
|
|
6955
6959
|
|
|
6956
6960
|
|
|
6957
6961
|
|
|
@@ -6987,7 +6991,7 @@ class FileAttachments extends common/* Com */.Mw {
|
|
|
6987
6991
|
}, $files);
|
|
6988
6992
|
}
|
|
6989
6993
|
}
|
|
6990
|
-
;//
|
|
6994
|
+
;// ./src/chatbox/Buttons.js
|
|
6991
6995
|
|
|
6992
6996
|
|
|
6993
6997
|
function Buttons(props) {
|
|
@@ -7025,7 +7029,7 @@ function Buttons(props) {
|
|
|
7025
7029
|
class: "button-attachments"
|
|
7026
7030
|
}, $buttons);
|
|
7027
7031
|
}
|
|
7028
|
-
;//
|
|
7032
|
+
;// ./src/chatbox/ButtonAttachments.js
|
|
7029
7033
|
|
|
7030
7034
|
|
|
7031
7035
|
|
|
@@ -7044,7 +7048,7 @@ function ButtonAttachments(props) {
|
|
|
7044
7048
|
t: props.t
|
|
7045
7049
|
});
|
|
7046
7050
|
}
|
|
7047
|
-
;//
|
|
7051
|
+
;// ./src/chatbox/QuickReplies.js
|
|
7048
7052
|
|
|
7049
7053
|
|
|
7050
7054
|
|
|
@@ -7087,7 +7091,7 @@ class QuickReplies extends common/* Com */.Mw {
|
|
|
7087
7091
|
}, $replies);
|
|
7088
7092
|
}
|
|
7089
7093
|
}
|
|
7090
|
-
;//
|
|
7094
|
+
;// ./src/chatbox/ListField.js
|
|
7091
7095
|
|
|
7092
7096
|
|
|
7093
7097
|
|
|
@@ -7182,7 +7186,7 @@ class ListField extends common/* Com */.Mw {
|
|
|
7182
7186
|
this.props.onRemoveItem && this.props.onRemoveItem(index);
|
|
7183
7187
|
}
|
|
7184
7188
|
}
|
|
7185
|
-
;//
|
|
7189
|
+
;// ./src/chatbox/FormAttachment.js
|
|
7186
7190
|
|
|
7187
7191
|
|
|
7188
7192
|
|
|
@@ -7469,7 +7473,7 @@ class FormAttachment extends common/* Com */.Mw {
|
|
|
7469
7473
|
function encode(key) {
|
|
7470
7474
|
return btoa(key).split('=').join('');
|
|
7471
7475
|
}
|
|
7472
|
-
;//
|
|
7476
|
+
;// ./src/chatbox/FormAttachments.js
|
|
7473
7477
|
|
|
7474
7478
|
|
|
7475
7479
|
|
|
@@ -7512,7 +7516,7 @@ class FormAttachments extends common/* Com */.Mw {
|
|
|
7512
7516
|
if ($form) $form.focus();
|
|
7513
7517
|
}
|
|
7514
7518
|
}
|
|
7515
|
-
;//
|
|
7519
|
+
;// ./src/chatbox/FormSubmitAttachments.js
|
|
7516
7520
|
|
|
7517
7521
|
|
|
7518
7522
|
|
|
@@ -7536,7 +7540,7 @@ class FormSubmitAttachments extends common/* Com */.Mw {
|
|
|
7536
7540
|
return (0,preact_module.h)("div", null, $submits);
|
|
7537
7541
|
}
|
|
7538
7542
|
}
|
|
7539
|
-
;//
|
|
7543
|
+
;// ./src/chatbox/touchscroll.js
|
|
7540
7544
|
function bind(el) {
|
|
7541
7545
|
if (!el) return;
|
|
7542
7546
|
el.removeEventListener('touchstart', el.md, 0);
|
|
@@ -7575,7 +7579,7 @@ function getFirstTouch(ev) {
|
|
|
7575
7579
|
if (!ev.touches.length) return {};
|
|
7576
7580
|
return ev.touches[0];
|
|
7577
7581
|
}
|
|
7578
|
-
;//
|
|
7582
|
+
;// ./src/chatbox/GenericTemplateAttachments.js
|
|
7579
7583
|
|
|
7580
7584
|
|
|
7581
7585
|
|
|
@@ -7665,7 +7669,7 @@ class GenericTemplateAttachments extends common/* Com */.Mw {
|
|
|
7665
7669
|
util/* default */.A.map(eles, ele => bind(ele, () => {}));
|
|
7666
7670
|
}
|
|
7667
7671
|
}
|
|
7668
|
-
;//
|
|
7672
|
+
;// ./src/chatbox/ProductAttachments.js
|
|
7669
7673
|
|
|
7670
7674
|
|
|
7671
7675
|
|
|
@@ -7759,7 +7763,7 @@ class ProductAttachments extends common/* Com */.Mw {
|
|
|
7759
7763
|
return $products;
|
|
7760
7764
|
}
|
|
7761
7765
|
}
|
|
7762
|
-
;//
|
|
7766
|
+
;// ./src/chatbox/VideoAttachments.js
|
|
7763
7767
|
|
|
7764
7768
|
|
|
7765
7769
|
|
|
@@ -7795,7 +7799,7 @@ class VideoAttachments extends common/* Com */.Mw {
|
|
|
7795
7799
|
}, $videos);
|
|
7796
7800
|
}
|
|
7797
7801
|
}
|
|
7798
|
-
;//
|
|
7802
|
+
;// ./src/chatbox/TextMessage.js
|
|
7799
7803
|
|
|
7800
7804
|
|
|
7801
7805
|
|
|
@@ -7871,7 +7875,7 @@ function isEmptyBlock(block) {
|
|
|
7871
7875
|
}
|
|
7872
7876
|
// EXTERNAL MODULE: ./src/chatbox/time.js
|
|
7873
7877
|
var chatbox_time = __webpack_require__(1620);
|
|
7874
|
-
;//
|
|
7878
|
+
;// ./src/chatbox/InfoMessage.js
|
|
7875
7879
|
|
|
7876
7880
|
function getRateLang(rating) {
|
|
7877
7881
|
if (!rating) return 'poor';
|
|
@@ -7916,7 +7920,7 @@ class InfoMessage extends common/* Com */.Mw {
|
|
|
7916
7920
|
return null;
|
|
7917
7921
|
}
|
|
7918
7922
|
}
|
|
7919
|
-
;//
|
|
7923
|
+
;// ./src/chatbox/Event.js
|
|
7920
7924
|
|
|
7921
7925
|
|
|
7922
7926
|
|
|
@@ -8202,13 +8206,18 @@ class Event extends common/* Com */.Mw {
|
|
|
8202
8206
|
if (bytype === 'user') return util/* default */.A.getUserDisplayName(this.props.store.matchUser());
|
|
8203
8207
|
let acc = this.props.store.matchAccount();
|
|
8204
8208
|
if (bytype === 'agent') return util/* default */.A.getAgentDisplayName(acc, this.props.store.matchAgent(byid));
|
|
8209
|
+
if (bytype === 'bot') {
|
|
8210
|
+
let bot = this.props.store.matchBot(byid);
|
|
8211
|
+
if (!bot) return 'Bot';
|
|
8212
|
+
return bot.fullname || 'Bot';
|
|
8213
|
+
}
|
|
8205
8214
|
if (byid === 'system' || bytype === 'dummy' || bytype === 'workflow') return acc.name || 'system';
|
|
8206
|
-
return
|
|
8215
|
+
return acc.name;
|
|
8207
8216
|
}
|
|
8208
8217
|
}
|
|
8209
8218
|
// EXTERNAL MODULE: ./src/chatbox/spinner.js
|
|
8210
8219
|
var spinner = __webpack_require__(4188);
|
|
8211
|
-
;//
|
|
8220
|
+
;// ./src/chatbox/Events.js
|
|
8212
8221
|
|
|
8213
8222
|
|
|
8214
8223
|
const convoemptyimg = __webpack_require__(1370);
|
|
@@ -8435,7 +8444,7 @@ function Events_isSummited(form) {
|
|
|
8435
8444
|
let fields = util/* default */.A.get(form, 'fields') || [];
|
|
8436
8445
|
return util/* default */.A.find(fields, field => !!field.answered);
|
|
8437
8446
|
}
|
|
8438
|
-
;//
|
|
8447
|
+
;// ./src/chatbox/Typing.js
|
|
8439
8448
|
|
|
8440
8449
|
|
|
8441
8450
|
|
|
@@ -8506,7 +8515,7 @@ class Typing extends common/* Com */.Mw {
|
|
|
8506
8515
|
}
|
|
8507
8516
|
// EXTERNAL MODULE: ./src/chatbox/releaseAnimation.js
|
|
8508
8517
|
var releaseAnimation = __webpack_require__(2988);
|
|
8509
|
-
;//
|
|
8518
|
+
;// ./src/chatbox/Rating.js
|
|
8510
8519
|
function Rating_defineProperty(e, r, t) { return (r = Rating_toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
8511
8520
|
function Rating_toPropertyKey(t) { var i = Rating_toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
8512
8521
|
function Rating_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); }
|
|
@@ -8787,7 +8796,7 @@ class Rating extends common/* Com */.Mw {
|
|
|
8787
8796
|
});
|
|
8788
8797
|
}
|
|
8789
8798
|
}
|
|
8790
|
-
;//
|
|
8799
|
+
;// ./src/chatbox/Widget.js
|
|
8791
8800
|
function Widget_defineProperty(e, r, t) { return (r = Widget_toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
8792
8801
|
function Widget_toPropertyKey(t) { var i = Widget_toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
8793
8802
|
function Widget_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); }
|
|
@@ -9855,7 +9864,7 @@ class FormMounter extends common/* Com */.Mw {
|
|
|
9855
9864
|
function Widget_encode(key) {
|
|
9856
9865
|
return encodeURIComponent(key);
|
|
9857
9866
|
}
|
|
9858
|
-
;//
|
|
9867
|
+
;// ./src/chatbox/main.js
|
|
9859
9868
|
|
|
9860
9869
|
|
|
9861
9870
|
|
|
@@ -10044,7 +10053,7 @@ function modifyViewport() {
|
|
|
10044
10053
|
metatag.content = 'maximum-scale=1.0, user-scalable=no, width=device-width, initial-scale=1.0';
|
|
10045
10054
|
document.getElementsByTagName('head')[0].appendChild(metatag);
|
|
10046
10055
|
}
|
|
10047
|
-
;//
|
|
10056
|
+
;// ./src/plugin.js
|
|
10048
10057
|
|
|
10049
10058
|
|
|
10050
10059
|
|
|
@@ -10334,7 +10343,7 @@ class PluginMgr {
|
|
|
10334
10343
|
this._destroy = true;
|
|
10335
10344
|
}
|
|
10336
10345
|
}
|
|
10337
|
-
;//
|
|
10346
|
+
;// ./src/lib.js
|
|
10338
10347
|
function lib_defineProperty(e, r, t) { return (r = lib_toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
10339
10348
|
function lib_toPropertyKey(t) { var i = lib_toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
10340
10349
|
function lib_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); }
|
|
@@ -10472,6 +10481,10 @@ class lib_Widget {
|
|
|
10472
10481
|
await this.domGate.entry();
|
|
10473
10482
|
return this.pluginMgr.getCurrentView();
|
|
10474
10483
|
}
|
|
10484
|
+
async createTicket(ticket) {
|
|
10485
|
+
await this.domGate.entry();
|
|
10486
|
+
return this.createTicket(ticket);
|
|
10487
|
+
}
|
|
10475
10488
|
expandWidget(view, convo) {
|
|
10476
10489
|
return this.showWidget(view, convo);
|
|
10477
10490
|
}
|
|
@@ -10621,7 +10634,7 @@ class lib_Widget {
|
|
|
10621
10634
|
}
|
|
10622
10635
|
window.__sbz_WIDGET = lib_Widget;
|
|
10623
10636
|
/* harmony default export */ const lib = (lib_Widget);
|
|
10624
|
-
;//
|
|
10637
|
+
;// ./screenshoot.js
|
|
10625
10638
|
|
|
10626
10639
|
let accid = 'acqsulrowbxiugvginhw';
|
|
10627
10640
|
let widget = new lib('https://api.subiz.com.vn/4.0/', 'https://vcdn.subiz-cdn.com/file/', 'https://api.subiz.com.vn/rt/0/', true, true);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@subiz/widget-v4",
|
|
3
|
-
"version": "4.1.
|
|
3
|
+
"version": "4.1.106",
|
|
4
4
|
"main": "./compiled_src/lib.js",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"dev": "npx webpack serve --config webpack.dev.js",
|
|
@@ -22,16 +22,16 @@
|
|
|
22
22
|
"preact": "10.19.3"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
|
-
"@babel/cli": "^7.25.
|
|
26
|
-
"@babel/core": "^7.25.
|
|
25
|
+
"@babel/cli": "^7.25.7",
|
|
26
|
+
"@babel/core": "^7.25.7",
|
|
27
27
|
"@babel/plugin-proposal-class-properties": "^7.18.6",
|
|
28
|
-
"@babel/plugin-transform-react-jsx": "^7.25.
|
|
29
|
-
"@babel/preset-env": "^7.25.
|
|
28
|
+
"@babel/plugin-transform-react-jsx": "^7.25.7",
|
|
29
|
+
"@babel/preset-env": "^7.25.7",
|
|
30
30
|
"babel-loader": "^9.2.1",
|
|
31
31
|
"babel-plugin-syntax-jsx": "^6.18.0",
|
|
32
32
|
"html-webpack-plugin": "^5.6.0",
|
|
33
|
-
"puppeteer": "^23.
|
|
34
|
-
"webpack": "^5.
|
|
33
|
+
"puppeteer": "^23.5.0",
|
|
34
|
+
"webpack": "^5.95.0",
|
|
35
35
|
"webpack-bundle-analyzer": "^4.10.2",
|
|
36
36
|
"webpack-cli": "^5.1.4",
|
|
37
37
|
"webpack-dev-server": "^5.1.0"
|
package/src/chatbox/Event.js
CHANGED
|
@@ -251,7 +251,12 @@ export default class Event extends Com {
|
|
|
251
251
|
if (bytype === 'user') return sb.getUserDisplayName(this.props.store.matchUser())
|
|
252
252
|
let acc = this.props.store.matchAccount()
|
|
253
253
|
if (bytype === 'agent') return sb.getAgentDisplayName(acc, this.props.store.matchAgent(byid))
|
|
254
|
+
if (bytype === 'bot') {
|
|
255
|
+
let bot = this.props.store.matchBot()[byid]
|
|
256
|
+
if (!bot) return 'Bot'
|
|
257
|
+
return bot.fullname || 'Bot'
|
|
258
|
+
}
|
|
254
259
|
if (byid === 'system' || bytype === 'dummy' || bytype === 'workflow') return acc.name || 'system'
|
|
255
|
-
return
|
|
260
|
+
return acc.name
|
|
256
261
|
}
|
|
257
262
|
}
|
package/src/chatbox/Events.js
CHANGED
|
@@ -248,11 +248,7 @@ function processEvents(convo, events) {
|
|
|
248
248
|
|
|
249
249
|
function visibleEvent(ev) {
|
|
250
250
|
let type = sb.get(ev, 'type')
|
|
251
|
-
return
|
|
252
|
-
// type === 'conversation_joined' ||
|
|
253
|
-
// type === 'conversation_left' ||
|
|
254
|
-
type === 'message_sent' || type === 'conversation_state_updated'
|
|
255
|
-
)
|
|
251
|
+
return type === 'message_sent' || type === 'conversation_state_updated'
|
|
256
252
|
}
|
|
257
253
|
|
|
258
254
|
function isSummited(form) {
|
package/src/lib.js
CHANGED
package/src/util/common.js
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
var op = require('./op.js')
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
export function extractEmojis (text) {
|
|
3
|
+
export function extractEmojis(text) {
|
|
5
4
|
var out = []
|
|
6
5
|
for (var i = 0; i < text.length; i++) {
|
|
7
6
|
for (var e = 0; e < emojis.length; e++) {
|
|
8
7
|
if (text.indexOf(emojis[e], i) !== i) continue
|
|
9
|
-
out.push({
|
|
8
|
+
out.push({index: i, length: emojis[e].length})
|
|
10
9
|
i += emojis[e].length - 1
|
|
11
10
|
break
|
|
12
11
|
}
|
|
@@ -15,32 +14,33 @@ export function extractEmojis (text) {
|
|
|
15
14
|
return out
|
|
16
15
|
}
|
|
17
16
|
|
|
18
|
-
export function extractLinks
|
|
17
|
+
export function extractLinks(text) {
|
|
19
18
|
text = text || ''
|
|
20
|
-
var reg = /(https?:\/\/)?(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9
|
|
19
|
+
var reg = /(https?:\/\/)?(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9@:%_\+.,~#?&//=]*)/gim
|
|
21
20
|
var out = []
|
|
22
21
|
var match
|
|
23
22
|
while ((match = reg.exec(text))) {
|
|
24
|
-
out.push({
|
|
23
|
+
out.push({index: match.index, length: reg.lastIndex - match.index})
|
|
25
24
|
}
|
|
26
25
|
|
|
27
26
|
return out
|
|
28
27
|
}
|
|
29
28
|
|
|
30
|
-
export function extractEmails
|
|
29
|
+
export function extractEmails(text) {
|
|
31
30
|
text = text || ''
|
|
32
|
-
var reg =
|
|
31
|
+
var reg =
|
|
32
|
+
/(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))/gim
|
|
33
33
|
|
|
34
34
|
var out = []
|
|
35
35
|
var match
|
|
36
36
|
while ((match = reg.exec(text))) {
|
|
37
|
-
out.push({
|
|
37
|
+
out.push({index: match.index, length: reg.lastIndex - match.index})
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
return out
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
export function extractPhones
|
|
43
|
+
export function extractPhones(msg) {
|
|
44
44
|
msg = msg || ''
|
|
45
45
|
var fgmsg = ''
|
|
46
46
|
// fine-grained msg
|
|
@@ -71,21 +71,21 @@ export function extractPhones (msg) {
|
|
|
71
71
|
var out = []
|
|
72
72
|
var match
|
|
73
73
|
while ((match = reg.exec(fgmsg))) {
|
|
74
|
-
out.push({
|
|
74
|
+
out.push({index: realchmap[match.index], length: realchmap[reg.lastIndex - 1] - realchmap[match.index] + 1})
|
|
75
75
|
}
|
|
76
76
|
|
|
77
77
|
return out
|
|
78
78
|
}
|
|
79
79
|
|
|
80
|
-
export function extract
|
|
80
|
+
export function extract(text, extractor, type) {
|
|
81
81
|
if (!text) return []
|
|
82
82
|
var out = []
|
|
83
83
|
var lastindex = 0
|
|
84
84
|
var tags = extractor(text)
|
|
85
|
-
if (size(tags) === 0) return [{
|
|
86
|
-
each(tags, tag => {
|
|
87
|
-
out.push({
|
|
88
|
-
out.push({
|
|
85
|
+
if (size(tags) === 0) return [{type: 'text', text}]
|
|
86
|
+
each(tags, (tag) => {
|
|
87
|
+
out.push({type: 'text', text: text.substr(lastindex, tag.index - lastindex)})
|
|
88
|
+
out.push({type, text: text.substr(tag.index, tag.length)})
|
|
89
89
|
lastindex = tag.index + tag.length
|
|
90
90
|
})
|
|
91
91
|
var lastTag = last(tags)
|
|
@@ -94,16 +94,16 @@ export function extract (text, extractor, type) {
|
|
|
94
94
|
text: text.substr(lastTag.index + lastTag.length, text.length - lastTag.index + lastTag.length),
|
|
95
95
|
})
|
|
96
96
|
|
|
97
|
-
return filter(out, o => o.text !== '')
|
|
97
|
+
return filter(out, (o) => o.text !== '')
|
|
98
98
|
}
|
|
99
99
|
|
|
100
|
-
export function pipeExtracts
|
|
100
|
+
export function pipeExtracts(text, extractors) {
|
|
101
101
|
var out = []
|
|
102
|
-
if (size(extractors) === 0) return [{
|
|
102
|
+
if (size(extractors) === 0) return [{type: 'text', text}]
|
|
103
103
|
var ext = extractors.shift()
|
|
104
104
|
|
|
105
105
|
var tags = extract(text, ext, ext.type)
|
|
106
|
-
each(tags, t => {
|
|
106
|
+
each(tags, (t) => {
|
|
107
107
|
if (t.type !== 'text') return out.push(t)
|
|
108
108
|
out = out.concat(pipeExtracts(t.text, extractors.slice()))
|
|
109
109
|
})
|
|
@@ -111,7 +111,7 @@ export function pipeExtracts (text, extractors) {
|
|
|
111
111
|
return out
|
|
112
112
|
}
|
|
113
113
|
|
|
114
|
-
export function extractText
|
|
114
|
+
export function extractText(text) {
|
|
115
115
|
var link = extractLinks
|
|
116
116
|
link.type = 'link'
|
|
117
117
|
|
|
@@ -127,7 +127,6 @@ export function extractText (text) {
|
|
|
127
127
|
return pipeExtracts(text, [email, link, phone, emoji])
|
|
128
128
|
}
|
|
129
129
|
|
|
130
|
-
|
|
131
130
|
export function parseJSON(str) {
|
|
132
131
|
try {
|
|
133
132
|
return parse(str)
|
|
@@ -1324,47 +1323,46 @@ function _blockToText(block) {
|
|
|
1324
1323
|
return out
|
|
1325
1324
|
}
|
|
1326
1325
|
|
|
1327
|
-
|
|
1328
1326
|
let emojis = [
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1327
|
+
'like',
|
|
1328
|
+
'unlike',
|
|
1329
|
+
'wink',
|
|
1330
|
+
'tongue-out',
|
|
1331
|
+
'tired',
|
|
1332
|
+
'surprised',
|
|
1333
|
+
'smiling',
|
|
1334
|
+
'sleepy',
|
|
1335
|
+
'sad',
|
|
1336
|
+
'neutral',
|
|
1337
|
+
'heart-eyes',
|
|
1338
|
+
'grinning',
|
|
1339
|
+
'crying',
|
|
1340
|
+
'confused',
|
|
1341
|
+
'angry',
|
|
1342
|
+
|
|
1343
|
+
'cry',
|
|
1344
|
+
'heart_eyes',
|
|
1345
|
+
'neutral_face',
|
|
1346
|
+
'emoji--disappointed',
|
|
1347
|
+
'smile',
|
|
1348
|
+
'open_mouth',
|
|
1349
|
+
'tired_face',
|
|
1350
|
+
'stuck_out_tongue',
|
|
1351
|
+
'moyai',
|
|
1352
|
+
'thumbsdown',
|
|
1353
|
+
'dislike',
|
|
1354
|
+
'thumbsup',
|
|
1355
|
+
'ok_hand',
|
|
1356
|
+
'octopus',
|
|
1357
|
+
'pig2',
|
|
1358
|
+
'wave',
|
|
1359
|
+
'mouse',
|
|
1360
|
+
'mouse2',
|
|
1361
|
+
'rat',
|
|
1364
1362
|
]
|
|
1365
|
-
emojis = map(emojis, e => ':' + e + ':')
|
|
1363
|
+
emojis = map(emojis, (e) => ':' + e + ':')
|
|
1366
1364
|
|
|
1367
1365
|
function absLink(url) {
|
|
1368
|
-
|
|
1369
|
-
|
|
1366
|
+
if (!url.startsWith('http://') && !url.startsWith('https://') && !url.startsWith('//')) return 'http://' + url
|
|
1367
|
+
return url
|
|
1370
1368
|
}
|