@subiz/widget-v4 4.1.16 → 4.1.18
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/assets/less/avatar.less +0 -1
- package/assets/less/widget_header.less +8 -9
- package/compiled_src/call/call.js +7 -7
- package/compiled_src/chatbox/DropdownSelect.js +1 -1
- package/compiled_src/chatbox/Event.js +1 -1
- package/compiled_src/chatbox/Events.js +3 -3
- package/compiled_src/chatbox/MessageInput.js +2 -2
- package/compiled_src/chatbox/Order.js +1 -1
- package/compiled_src/chatbox/Rating.js +1 -1
- package/compiled_src/chatbox/Typing.js +3 -3
- package/compiled_src/chatbox/Widget.js +6 -6
- package/compiled_src/chatbox/time.js +1 -1
- package/compiled_src/common.js +2 -2
- package/compiled_src/contact/contact.js +1 -1
- package/compiled_src/lib.js +6 -6
- package/compiled_src/notif/notif.js +7 -7
- package/compiled_src/order/address_picker.js +1 -1
- package/compiled_src/popup/countdown.js +2 -2
- package/compiled_src/popup/popup.js +8 -8
- package/compiled_src/store/api.js +1 -1
- package/compiled_src/store/store.js +3 -3
- package/compiled_src/util/campaign.js +6 -6
- package/compiled_src/util/common.js +5 -0
- package/dist/132.js +6612 -0
- package/dist/178.js +406 -0
- package/dist/1861083ae18.132.js +1 -0
- package/dist/1861083ae18.178.js +1 -0
- package/dist/1861083ae18.213.js +1 -0
- package/dist/1861083ae18.335.js +1 -0
- package/dist/1861083ae18.362.js +1 -0
- package/dist/1861083ae18.441.js +1 -0
- package/dist/1861083ae18.605.js +1 -0
- package/dist/1861083ae18.678.js +1 -0
- package/dist/1861083ae18.782.js +1 -0
- package/dist/1861083ae18.app.js +1 -0
- package/dist/1861083ae18.index.html +26 -0
- package/dist/1861083ae18.library.html +26 -0
- package/dist/1861083ae18.library.js +1 -0
- package/dist/1861083ae18.preview.html +759 -0
- package/dist/1861083ae18.preview.js +1 -0
- package/dist/1861083ae18.screenshoot.js +1 -0
- package/dist/1861083ae18.webview.js +1 -0
- package/dist/213.js +2779 -0
- package/dist/335.js +372 -0
- package/dist/362.js +107 -0
- package/dist/441.js +2855 -0
- package/dist/605.js +305 -0
- package/dist/678.js +107 -0
- package/dist/782.js +107 -0
- package/dist/HASH +1 -0
- package/dist/assets/img/Facebook.64607ec.png +0 -0
- package/dist/assets/img/Zalo.6845707.png +0 -0
- package/dist/assets/img/award1a.1a58e10.png +0 -0
- package/dist/assets/img/award3a.3b74423.png +0 -0
- package/dist/assets/img/award4a.ed6ccd4.png +0 -0
- package/dist/assets/img/award5.39eb7ae.png +0 -0
- package/dist/assets/img/bubble_default.7d5e4ab.svg +20 -0
- package/dist/assets/img/caret.998eb8f.svg +1 -0
- package/dist/assets/img/convos_empty.2353007.svg +72 -0
- package/dist/assets/img/default.06e6ee0.jpg +0 -0
- package/dist/assets/img/default_avatar.5b74dc1.png +0 -0
- package/dist/assets/img/done_gray.d7e8203.svg +4 -0
- package/dist/assets/img/done_green.b817fd4.svg +4 -0
- package/dist/assets/img/emoji/messenger/sub_23.529_58.824.d5faf14.png +0 -0
- package/dist/assets/img/emoji/messenger/sub_23.529_60.784.1420241.png +0 -0
- package/dist/assets/img/emoji/messenger/sub_25.490_0.000.1e6b2c0.png +0 -0
- package/dist/assets/img/emoji/messenger/sub_25.490_45.098.3dfbc08.png +0 -0
- package/dist/assets/img/emoji/messenger/sub_25.490_5.882.4b49e94.png +0 -0
- package/dist/assets/img/emoji/messenger/sub_27.451_72.549.7114f58.png +0 -0
- package/dist/assets/img/emoji/messenger/sub_27.451_84.314.231e2b7.png +0 -0
- package/dist/assets/img/emoji/messenger/sub_27.451_96.078.ddbb008.png +0 -0
- package/dist/assets/img/emoji/messenger/sub_29.412_5.882.61f3359.png +0 -0
- package/dist/assets/img/emoji/messenger/sub_58.824_100.000.6df72bc.png +0 -0
- package/dist/assets/img/emoji/messenger/sub_58.824_45.098.3d7a7ad.png +0 -0
- package/dist/assets/img/emoji/messenger/sub_58.824_47.059.0f4d6e2.png +0 -0
- package/dist/assets/img/emoji/messenger/sub_58.824_54.902.65724c1.png +0 -0
- package/dist/assets/img/emoji/messenger/sub_58.824_64.706.9da3cba.png +0 -0
- package/dist/assets/img/emoji/messenger/sub_58.824_72.549.edca5cf.png +0 -0
- package/dist/assets/img/emoji/messenger/sub_58.824_78.431.f910f2a.png +0 -0
- package/dist/assets/img/emoji/messenger/sub_58.824_88.235.def4e71.png +0 -0
- package/dist/assets/img/emoji/messenger/sub_60.784_11.765.49c03d0.png +0 -0
- package/dist/assets/img/emoji/messenger/sub_60.784_27.451.46b54e5.png +0 -0
- package/dist/assets/img/emoji/messenger/sub_60.784_29.412.e36d284.png +0 -0
- package/dist/assets/img/emoji/messenger/sub_60.784_3.922.bb191b0.png +0 -0
- package/dist/assets/img/emoji/messenger/sub_60.784_35.294.af7b927.png +0 -0
- package/dist/assets/img/emoji/messenger/sub_60.784_7.843.98f2a99.png +0 -0
- package/dist/assets/img/empty.29bed2d.svg +23 -0
- package/dist/assets/img/empty_1.0b98af0.svg +11 -0
- package/dist/assets/img/examplte_logo.f86535f.svg +1 -0
- package/dist/assets/img/external-link.90577cc.svg +1 -0
- package/dist/assets/img/fb_inverse_circle.36c2cfc.png +0 -0
- package/dist/assets/img/ghn.070f8e3.svg +17 -0
- package/dist/assets/img/ghtk.326eac1.svg +18 -0
- package/dist/assets/img/image_default.be0698b.png +0 -0
- package/dist/assets/img/info.ebce7ea.svg +1 -0
- package/dist/assets/img/loader.37000a7.svg +1 -0
- package/dist/assets/img/loading_static.8f403ae.svg +10 -0
- package/dist/assets/img/main-service1.d536cc2.png +0 -0
- package/dist/assets/img/main-service2.9b99549.png +0 -0
- package/dist/assets/img/not_found_search.2ddb8d1.png +0 -0
- package/dist/assets/img/package.8d37d0f.svg +5 -0
- package/dist/assets/img/package_fade.763c001.svg +1 -0
- package/dist/assets/img/rating--average.1ea492c.svg +12 -0
- package/dist/assets/img/rating--great.e3d712e.svg +16 -0
- package/dist/assets/img/rating--poor.2938a25.svg +12 -0
- package/dist/assets/img/search.f9705ff.svg +1 -0
- package/dist/assets/img/send.6db52a9.svg +3 -0
- package/dist/assets/img/shop.f7dc7d8.svg +1 -0
- package/dist/assets/img/shop_faded.df7845a.svg +1 -0
- package/dist/assets/img/subiz-mono.877e9f5.svg +3 -0
- package/dist/assets/img/x.26fdfa3.svg +5 -0
- package/dist/malicious-app.js +13 -0
- package/dist/screenshoot.html +7 -0
- package/dist/screenshoot.js +5633 -0
- package/package.json +7 -7
- package/src/call/call.js +7 -7
- package/src/chatbox/DropdownSelect.js +1 -1
- package/src/chatbox/Event.js +1 -1
- package/src/chatbox/Events.js +3 -3
- package/src/chatbox/MessageInput.js +2 -2
- package/src/chatbox/Order.js +1 -1
- package/src/chatbox/Rating.js +1 -1
- package/src/chatbox/Typing.js +3 -3
- package/src/chatbox/Widget.js +6 -6
- package/src/chatbox/time.js +1 -1
- package/src/common.js +2 -2
- package/src/contact/contact.js +1 -1
- package/src/lib.js +6 -6
- package/src/notif/notif.js +7 -7
- package/src/order/address_picker.js +1 -1
- package/src/popup/countdown.js +2 -2
- package/src/popup/popup.js +8 -8
- package/src/store/api.js +2 -3
- package/src/store/store.js +3 -3
- package/src/util/campaign.js +6 -6
- package/src/util/common.js +2 -0
package/assets/less/avatar.less
CHANGED
|
@@ -14,23 +14,24 @@
|
|
|
14
14
|
font-weight: 400;
|
|
15
15
|
display: flex;
|
|
16
16
|
border-radius: 5px;
|
|
17
|
-
align-items: center;
|
|
18
17
|
justify-content: center;
|
|
19
18
|
width: 20px;
|
|
20
19
|
height: 20px;
|
|
21
20
|
cursor: pointer;
|
|
21
|
+
position: relative;
|
|
22
|
+
top: 5px;
|
|
22
23
|
}
|
|
23
24
|
}
|
|
24
25
|
|
|
25
26
|
.widget-header--collapsed {
|
|
26
|
-
height:
|
|
27
|
+
height: auto;
|
|
27
28
|
|
|
28
29
|
}
|
|
29
30
|
|
|
30
31
|
.widget-header--inner.widget-header--inner--collapsed {
|
|
31
|
-
height:
|
|
32
|
-
align-items: center;
|
|
32
|
+
height: auto;
|
|
33
33
|
padding: 15px;
|
|
34
|
+
position: relative;
|
|
34
35
|
|
|
35
36
|
.widget-header--title {
|
|
36
37
|
white-space: nowrap;
|
|
@@ -41,14 +42,11 @@
|
|
|
41
42
|
}
|
|
42
43
|
|
|
43
44
|
.widget-header--description {
|
|
44
|
-
font-size:
|
|
45
|
+
font-size: 14px;
|
|
45
46
|
opacity: 0.8;
|
|
46
47
|
flex: 1;
|
|
47
|
-
white-space: nowrap;
|
|
48
|
-
overflow: hidden;
|
|
49
|
-
text-overflow: ellipsis;
|
|
50
48
|
.color(@white);
|
|
51
|
-
margin-top:
|
|
49
|
+
margin-top: 2.5px;
|
|
52
50
|
position: relative;
|
|
53
51
|
}
|
|
54
52
|
}
|
|
@@ -165,6 +163,7 @@
|
|
|
165
163
|
position: relative;
|
|
166
164
|
margin-left: -9px;
|
|
167
165
|
cursor: pointer;
|
|
166
|
+
top: 2px;
|
|
168
167
|
}
|
|
169
168
|
|
|
170
169
|
.widget-header--has-convo-unred .widget-header--button-back {
|
|
@@ -28,7 +28,7 @@ class Notif extends _common.Com {
|
|
|
28
28
|
title: '',
|
|
29
29
|
last_show: 0
|
|
30
30
|
});
|
|
31
|
-
setTimeout(async () => {
|
|
31
|
+
_index.default.setTimeout(async () => {
|
|
32
32
|
let {
|
|
33
33
|
body: impression
|
|
34
34
|
} = await this.props.store.sendImpression(this.props.plugin.id);
|
|
@@ -101,7 +101,7 @@ class Notif extends _common.Com {
|
|
|
101
101
|
await this.waitForT();
|
|
102
102
|
if (!this.props.t) return;
|
|
103
103
|
if (!close) {
|
|
104
|
-
clearTimeout(this.lastCloseTimeout);
|
|
104
|
+
_index.default.clearTimeout(this.lastCloseTimeout);
|
|
105
105
|
this.setState({
|
|
106
106
|
closeAnimation: false
|
|
107
107
|
});
|
|
@@ -138,11 +138,11 @@ class Notif extends _common.Com {
|
|
|
138
138
|
closeAnimation: true
|
|
139
139
|
});
|
|
140
140
|
this.mouse_leave = _index.default.Date.now();
|
|
141
|
-
this.lastCloseTimeout = setTimeout(() => this.setState({
|
|
141
|
+
this.lastCloseTimeout = _index.default.setTimeout(() => this.setState({
|
|
142
142
|
close: true,
|
|
143
143
|
closeAnimation: false
|
|
144
144
|
}), 150);
|
|
145
|
-
if (this.props.plugin._dont_close) setTimeout(() => this.setState({
|
|
145
|
+
if (this.props.plugin._dont_close) _index.default.setTimeout(() => this.setState({
|
|
146
146
|
closeAnimation: false,
|
|
147
147
|
close: false
|
|
148
148
|
}), 1000);
|
|
@@ -156,7 +156,7 @@ class Notif extends _common.Com {
|
|
|
156
156
|
this.setClose(this.state.close);
|
|
157
157
|
}
|
|
158
158
|
componentWillUnmount() {
|
|
159
|
-
clearInterval(this.interval);
|
|
159
|
+
_index.default.clearInterval(this.interval);
|
|
160
160
|
_index.default.setCss(this.props.plugin.id, this.$cssStyleDiv, '');
|
|
161
161
|
}
|
|
162
162
|
async componentDidMount() {
|
|
@@ -172,7 +172,7 @@ class Notif extends _common.Com {
|
|
|
172
172
|
}
|
|
173
173
|
this.props.store.onResetCSS(this, () => this.refreshCSS());
|
|
174
174
|
await this.refreshCSS();
|
|
175
|
-
this.interval = setInterval(() => {
|
|
175
|
+
this.interval = _index.default.setInterval(() => {
|
|
176
176
|
if (this.props._destroy) return this.componentWillUnmount();
|
|
177
177
|
let mouseleave = this.mouse_leave;
|
|
178
178
|
if (mouseleave === 0) mouseleave = _index.default.Date.now();
|
|
@@ -185,7 +185,7 @@ class Notif extends _common.Com {
|
|
|
185
185
|
return this.setClose(false);
|
|
186
186
|
}
|
|
187
187
|
}, 1000);
|
|
188
|
-
setTimeout(() => {
|
|
188
|
+
_index.default.setTimeout(() => {
|
|
189
189
|
this.setState({
|
|
190
190
|
cssready: true
|
|
191
191
|
});
|
|
@@ -112,7 +112,7 @@ class DropdownSelect extends _common.Com {
|
|
|
112
112
|
focusFilter() {
|
|
113
113
|
if (!this.filterRef.current) return;
|
|
114
114
|
this.filterRef.current.focus();
|
|
115
|
-
setTimeout(() => {
|
|
115
|
+
_index.default.setTimeout(() => {
|
|
116
116
|
if (!this.filterRef.current) return;
|
|
117
117
|
this.filterRef.current.focus();
|
|
118
118
|
}, 100);
|
|
@@ -183,7 +183,7 @@ class Event extends _common.Com {
|
|
|
183
183
|
}));
|
|
184
184
|
}
|
|
185
185
|
if (_index.default.getMsgField(ev, 'idempotency') === ev.id && this.props.store.now() - ev.created < 900) {
|
|
186
|
-
setTimeout(() => this.setState({
|
|
186
|
+
_index.default.setTimeout(() => this.setState({
|
|
187
187
|
refresh: this.state.refresh
|
|
188
188
|
}), 1000);
|
|
189
189
|
}
|
|
@@ -168,7 +168,7 @@ class Events extends _common.Com {
|
|
|
168
168
|
error: false
|
|
169
169
|
});
|
|
170
170
|
this.scrollToBottom();
|
|
171
|
-
setTimeout(() => this.setState({
|
|
171
|
+
_index.default.setTimeout(() => this.setState({
|
|
172
172
|
loading: false
|
|
173
173
|
}), 50);
|
|
174
174
|
}
|
|
@@ -178,11 +178,11 @@ class Events extends _common.Com {
|
|
|
178
178
|
return $container.scrollHeight < $container.scrollTop + $container.offsetHeight + 50;
|
|
179
179
|
}
|
|
180
180
|
scrollToBottom() {
|
|
181
|
-
setTimeout(() => {
|
|
181
|
+
_index.default.setTimeout(() => {
|
|
182
182
|
const $div = this.refBody;
|
|
183
183
|
if ($div) $div.scrollTop = $div.scrollHeight;
|
|
184
184
|
});
|
|
185
|
-
setTimeout(() => {
|
|
185
|
+
_index.default.setTimeout(() => {
|
|
186
186
|
const $div = this.refBody;
|
|
187
187
|
if ($div) $div.scrollTop = $div.scrollHeight;
|
|
188
188
|
}, 200);
|
|
@@ -216,10 +216,10 @@ class MessageInput extends _common.Com {
|
|
|
216
216
|
focus() {
|
|
217
217
|
if (this.props.disabled) return;
|
|
218
218
|
this.refMessageInput.current && this.refMessageInput.current.focus();
|
|
219
|
-
setTimeout(() => {
|
|
219
|
+
_index.default.setTimeout(() => {
|
|
220
220
|
this.refMessageInput.current && this.refMessageInput.current.focus();
|
|
221
221
|
});
|
|
222
|
-
setTimeout(() => {
|
|
222
|
+
_index.default.setTimeout(() => {
|
|
223
223
|
this.refMessageInput.current && this.refMessageInput.current.focus();
|
|
224
224
|
}, 100);
|
|
225
225
|
}
|
|
@@ -188,7 +188,7 @@ class Rating extends _common.Com {
|
|
|
188
188
|
hide: false
|
|
189
189
|
});
|
|
190
190
|
if (!this.refRating.current) return;
|
|
191
|
-
setTimeout(() => {
|
|
191
|
+
_index.default.setTimeout(() => {
|
|
192
192
|
if (this.refComment.current) this.refComment.current.focus();
|
|
193
193
|
}, 400);
|
|
194
194
|
this.refComment.current.value = '';
|
|
@@ -24,7 +24,7 @@ class Typing extends _common.Com {
|
|
|
24
24
|
let oldby = _index.default.get(this.state.ev, 'by.id');
|
|
25
25
|
if (oldby && _index.default.get(ev, 'by.id') !== oldby) return;
|
|
26
26
|
if (_index.default.get(ev, 'type') === 'message_sent') {
|
|
27
|
-
if (this.timer) clearTimeout(this.timer);
|
|
27
|
+
if (this.timer) _index.default.clearTimeout(this.timer);
|
|
28
28
|
this.timer = null;
|
|
29
29
|
this.setState({
|
|
30
30
|
isShow: false
|
|
@@ -38,8 +38,8 @@ class Typing extends _common.Com {
|
|
|
38
38
|
ev: ev,
|
|
39
39
|
isShow: true
|
|
40
40
|
});
|
|
41
|
-
if (this.timer) clearTimeout(this.timer);
|
|
42
|
-
this.timer = setTimeout(() => {
|
|
41
|
+
if (this.timer) _index.default.clearTimeout(this.timer);
|
|
42
|
+
this.timer = _index.default.setTimeout(() => {
|
|
43
43
|
if (_index.default.convoOfEv(ev) !== this.props.cid) return;
|
|
44
44
|
this.timer = null;
|
|
45
45
|
this.setState({
|
|
@@ -110,7 +110,7 @@ class Widget extends _common.Com {
|
|
|
110
110
|
clickedJoin: false,
|
|
111
111
|
quickReplyMessage: {}
|
|
112
112
|
});
|
|
113
|
-
setTimeout(() => {
|
|
113
|
+
_index.default.setTimeout(() => {
|
|
114
114
|
this.events && this.events.focus();
|
|
115
115
|
if (!this.props.store.isMobile()) this.focusInput();
|
|
116
116
|
}, 100);
|
|
@@ -644,8 +644,8 @@ class Widget extends _common.Com {
|
|
|
644
644
|
if (this.props.store.isPreview) return;
|
|
645
645
|
var $input = this.msgInput.current;
|
|
646
646
|
if (!$input) return;
|
|
647
|
-
setTimeout(() => $input && $input.blur());
|
|
648
|
-
setTimeout(() => $input && $input.blur(), 300);
|
|
647
|
+
_index.default.setTimeout(() => $input && $input.blur());
|
|
648
|
+
_index.default.setTimeout(() => $input && $input.blur(), 300);
|
|
649
649
|
}
|
|
650
650
|
focusInput() {
|
|
651
651
|
if (this.props.store.isPreview) return;
|
|
@@ -656,7 +656,7 @@ class Widget extends _common.Com {
|
|
|
656
656
|
if (firstemptykey) return;
|
|
657
657
|
if (!field.value) firstemptykey = key;
|
|
658
658
|
});
|
|
659
|
-
setTimeout(() => {
|
|
659
|
+
_index.default.setTimeout(() => {
|
|
660
660
|
var $input = this['form_' + encode(firstemptykey)];
|
|
661
661
|
if (!$input) return;
|
|
662
662
|
$input.focus();
|
|
@@ -665,8 +665,8 @@ class Widget extends _common.Com {
|
|
|
665
665
|
}
|
|
666
666
|
var $input = this.msgInput.current;
|
|
667
667
|
if (!$input) return;
|
|
668
|
-
setTimeout(() => $input.focus());
|
|
669
|
-
setTimeout(() => $input.focus(), 300);
|
|
668
|
+
_index.default.setTimeout(() => $input.focus());
|
|
669
|
+
_index.default.setTimeout(() => $input.focus(), 300);
|
|
670
670
|
}
|
|
671
671
|
onRate(rating) {
|
|
672
672
|
if (!this.props.cid) return;
|
|
@@ -9,7 +9,7 @@ var _common = require("../common.js");
|
|
|
9
9
|
var _preact = require("preact");
|
|
10
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
11
|
var g_pub = new _index.default.Pubsub();
|
|
12
|
-
setInterval(() => g_pub.publish('time'), 20 * 1000);
|
|
12
|
+
_index.default.setInterval(() => g_pub.publish('time'), 20 * 1000);
|
|
13
13
|
class Time extends _common.Com {
|
|
14
14
|
constructor(props) {
|
|
15
15
|
super(props);
|
package/compiled_src/common.js
CHANGED
|
@@ -13,7 +13,7 @@ class Com extends _preact.Component {
|
|
|
13
13
|
constructor(props) {
|
|
14
14
|
super(props);
|
|
15
15
|
this._isMounted = true;
|
|
16
|
-
setTimeout(() => {
|
|
16
|
+
_index.default.setTimeout(() => {
|
|
17
17
|
if (this.componentWillUnmount) {
|
|
18
18
|
let old = this.componentWillUnmount.bind(this);
|
|
19
19
|
this.componentWillUnmount = () => {
|
|
@@ -69,7 +69,7 @@ let langMessages = {};
|
|
|
69
69
|
exports.langMessages = langMessages;
|
|
70
70
|
let downloadLock = false;
|
|
71
71
|
function downloadLanguage(store, locale, force) {
|
|
72
|
-
if (downloadLock) return new Promise(resolve => setTimeout(() => downloadLanguage(store, locale, force).then(resolve), 100));
|
|
72
|
+
if (downloadLock) return new Promise(resolve => _index.default.setTimeout(() => downloadLanguage(store, locale, force).then(resolve), 100));
|
|
73
73
|
downloadLock = true;
|
|
74
74
|
let messages;
|
|
75
75
|
if (locale === 'debug' || langMessages[locale] && !force) {
|
|
@@ -252,7 +252,7 @@ class Contact extends _common.Com {
|
|
|
252
252
|
let pluginstringify = JSON.stringify(this.props.plugin);
|
|
253
253
|
if (this.state.pluginjson !== pluginstringify) {
|
|
254
254
|
this.refreshCSS();
|
|
255
|
-
setTimeout(() => this.setState({
|
|
255
|
+
_index.default.setTimeout(() => this.setState({
|
|
256
256
|
pluginjson: pluginstringify
|
|
257
257
|
}));
|
|
258
258
|
}
|
package/compiled_src/lib.js
CHANGED
|
@@ -43,10 +43,10 @@ class Widget {
|
|
|
43
43
|
let user = await this.store.login(accid, user_id, tokenGenerator);
|
|
44
44
|
if (!$container) $container = document.body;
|
|
45
45
|
this.pluginMgr = new _plugin.default(this, $container);
|
|
46
|
-
let clean = setInterval(() => {
|
|
46
|
+
let clean = _index.default.setInterval(() => {
|
|
47
47
|
if ($container && $container.isConnected) return;
|
|
48
48
|
this.pluginMgr.destroy();
|
|
49
|
-
clearInterval(clean);
|
|
49
|
+
_index.default.clearInterval(clean);
|
|
50
50
|
}, 1000);
|
|
51
51
|
this.domGate.open();
|
|
52
52
|
return user;
|
|
@@ -61,10 +61,10 @@ class Widget {
|
|
|
61
61
|
let user = await this.store.init(accid, undefined, ref);
|
|
62
62
|
if (!$container) $container = document.body || document;
|
|
63
63
|
this.pluginMgr = new _plugin.default(this, $container);
|
|
64
|
-
let clean = setInterval(() => {
|
|
64
|
+
let clean = _index.default.setInterval(() => {
|
|
65
65
|
if ($container && $container.isConnected) return;
|
|
66
66
|
this.pluginMgr.destroy();
|
|
67
|
-
clearInterval(clean);
|
|
67
|
+
_index.default.clearInterval(clean);
|
|
68
68
|
}, 1000);
|
|
69
69
|
this.domGate.open();
|
|
70
70
|
return user;
|
|
@@ -73,10 +73,10 @@ class Widget {
|
|
|
73
73
|
let outmask = await this.store.init(id, mask);
|
|
74
74
|
if (!$container) $container = document.body || document;
|
|
75
75
|
this.pluginMgr = new _plugin.default(this, $container);
|
|
76
|
-
let clean = setInterval(() => {
|
|
76
|
+
let clean = _index.default.setInterval(() => {
|
|
77
77
|
if ($container && $container.isConnected) return;
|
|
78
78
|
this.pluginMgr.destroy();
|
|
79
|
-
clearInterval(clean);
|
|
79
|
+
_index.default.clearInterval(clean);
|
|
80
80
|
}, 1000);
|
|
81
81
|
this.domGate.open();
|
|
82
82
|
cb && cb(outmask);
|
|
@@ -28,7 +28,7 @@ class Notif extends _common.Com {
|
|
|
28
28
|
title: '',
|
|
29
29
|
last_show: 0
|
|
30
30
|
});
|
|
31
|
-
setTimeout(async () => {
|
|
31
|
+
_index.default.setTimeout(async () => {
|
|
32
32
|
let {
|
|
33
33
|
body: impression
|
|
34
34
|
} = await this.props.store.sendImpression(this.props.plugin.id);
|
|
@@ -101,7 +101,7 @@ class Notif extends _common.Com {
|
|
|
101
101
|
await this.waitForT();
|
|
102
102
|
if (!this.props.t) return;
|
|
103
103
|
if (!close) {
|
|
104
|
-
clearTimeout(this.lastCloseTimeout);
|
|
104
|
+
_index.default.clearTimeout(this.lastCloseTimeout);
|
|
105
105
|
this.setState({
|
|
106
106
|
closeAnimation: false
|
|
107
107
|
});
|
|
@@ -140,11 +140,11 @@ class Notif extends _common.Com {
|
|
|
140
140
|
closeAnimation: true
|
|
141
141
|
});
|
|
142
142
|
this.mouse_leave = _index.default.Date.now();
|
|
143
|
-
this.lastCloseTimeout = setTimeout(() => this.setState({
|
|
143
|
+
this.lastCloseTimeout = _index.default.setTimeout(() => this.setState({
|
|
144
144
|
close: true,
|
|
145
145
|
closeAnimation: false
|
|
146
146
|
}), 150);
|
|
147
|
-
if (this.props.plugin._dont_close) setTimeout(() => this.setState({
|
|
147
|
+
if (this.props.plugin._dont_close) _index.default.setTimeout(() => this.setState({
|
|
148
148
|
closeAnimation: false,
|
|
149
149
|
close: false
|
|
150
150
|
}), 1000);
|
|
@@ -158,7 +158,7 @@ class Notif extends _common.Com {
|
|
|
158
158
|
this.setClose(this.state.close);
|
|
159
159
|
}
|
|
160
160
|
componentWillUnmount() {
|
|
161
|
-
clearInterval(this.interval);
|
|
161
|
+
_index.default.clearInterval(this.interval);
|
|
162
162
|
_index.default.setCss(this.props.plugin.id, this.$cssStyleDiv, '');
|
|
163
163
|
}
|
|
164
164
|
async componentDidMount() {
|
|
@@ -174,7 +174,7 @@ class Notif extends _common.Com {
|
|
|
174
174
|
}
|
|
175
175
|
this.props.store.onResetCSS(this, () => this.refreshCSS());
|
|
176
176
|
await this.refreshCSS();
|
|
177
|
-
this.interval = setInterval(() => {
|
|
177
|
+
this.interval = _index.default.setInterval(() => {
|
|
178
178
|
if (this.props._destroy) return this.componentWillUnmount();
|
|
179
179
|
let mouseleave = this.mouse_leave;
|
|
180
180
|
if (mouseleave === 0) mouseleave = _index.default.Date.now();
|
|
@@ -187,7 +187,7 @@ class Notif extends _common.Com {
|
|
|
187
187
|
return this.setClose(false);
|
|
188
188
|
}
|
|
189
189
|
}, 1000);
|
|
190
|
-
setTimeout(() => {
|
|
190
|
+
_index.default.setTimeout(() => {
|
|
191
191
|
this.setState({
|
|
192
192
|
cssready: true
|
|
193
193
|
});
|
|
@@ -108,7 +108,7 @@ class AddressPicker extends _common.Com {
|
|
|
108
108
|
focusFilter() {
|
|
109
109
|
if (!this.filterRef.current) return;
|
|
110
110
|
this.filterRef.current.focus();
|
|
111
|
-
setTimeout(() => {
|
|
111
|
+
_index.default.setTimeout(() => {
|
|
112
112
|
if (!this.filterRef.current) return;
|
|
113
113
|
this.filterRef.current.focus();
|
|
114
114
|
}, 100);
|
|
@@ -20,7 +20,7 @@ class Countdown extends _common.Com {
|
|
|
20
20
|
_defineProperty(this, "state", {
|
|
21
21
|
flipKey: '43'
|
|
22
22
|
});
|
|
23
|
-
this.timer = setInterval(() => {
|
|
23
|
+
this.timer = _index.default.setInterval(() => {
|
|
24
24
|
if (this.props._destroy) return this.componentWillUnmount();
|
|
25
25
|
let cd = this.props.com.countdown || {};
|
|
26
26
|
let newFlipKey = 'cd' + ':' + cd.skin + ':' + cd.size + ':' + this.props.plugin.popup.font_family + ':';
|
|
@@ -31,7 +31,7 @@ class Countdown extends _common.Com {
|
|
|
31
31
|
}, 500);
|
|
32
32
|
}
|
|
33
33
|
componentWillUnmount() {
|
|
34
|
-
clearInterval(this.timer);
|
|
34
|
+
_index.default.clearInterval(this.timer);
|
|
35
35
|
}
|
|
36
36
|
getCountDownDeltaSec(countdown) {
|
|
37
37
|
let dest;
|
|
@@ -27,14 +27,14 @@ class Popup extends _common.Com {
|
|
|
27
27
|
fontReady: false
|
|
28
28
|
});
|
|
29
29
|
this._formRef = (0, _preact.createRef)();
|
|
30
|
-
setTimeout(() => this.fillForm(), 1000);
|
|
31
|
-
setTimeout(async () => {
|
|
30
|
+
_index.default.setTimeout(() => this.fillForm(), 1000);
|
|
31
|
+
_index.default.setTimeout(async () => {
|
|
32
32
|
let {
|
|
33
33
|
body: impression
|
|
34
34
|
} = await this.props.store.sendImpression(this.props.plugin.id);
|
|
35
35
|
this.impressionToken = _index.default.get(impression, 'impression_token') || '';
|
|
36
36
|
}, 10);
|
|
37
|
-
setTimeout(() => {
|
|
37
|
+
_index.default.setTimeout(() => {
|
|
38
38
|
let fonts = {};
|
|
39
39
|
fonts[this.props.plugin.popup.font_family] = true;
|
|
40
40
|
let images = {};
|
|
@@ -58,7 +58,7 @@ class Popup extends _common.Com {
|
|
|
58
58
|
imageReady: true
|
|
59
59
|
})));
|
|
60
60
|
_index.default.preloadWebfonts(Object.keys(fonts));
|
|
61
|
-
setTimeout(async () => {
|
|
61
|
+
_index.default.setTimeout(async () => {
|
|
62
62
|
await this.waitForFont(Object.keys(fonts));
|
|
63
63
|
this.setState({
|
|
64
64
|
fontReady: true
|
|
@@ -177,11 +177,11 @@ class Popup extends _common.Com {
|
|
|
177
177
|
this.setState({
|
|
178
178
|
closeAnimation: true
|
|
179
179
|
});
|
|
180
|
-
setTimeout(() => this.setState({
|
|
180
|
+
_index.default.setTimeout(() => this.setState({
|
|
181
181
|
close: true,
|
|
182
182
|
closeAnimation: false
|
|
183
183
|
}), 150);
|
|
184
|
-
if (this.props.plugin._dont_close) setTimeout(() => {
|
|
184
|
+
if (this.props.plugin._dont_close) _index.default.setTimeout(() => {
|
|
185
185
|
this.lastoverflow = window.getComputedStyle(document.body).getPropertyValue('overflow');
|
|
186
186
|
document.body.style.setProperty('overflow', 'hidden', 'important');
|
|
187
187
|
this.setState({
|
|
@@ -266,7 +266,7 @@ class Popup extends _common.Com {
|
|
|
266
266
|
if (a.action === 'open_widget') this.props.showWidget('list');
|
|
267
267
|
}
|
|
268
268
|
for (let a of actions) {
|
|
269
|
-
if (a.action === 'close') setTimeout(() => this.setClose(true), 100);
|
|
269
|
+
if (a.action === 'close') _index.default.setTimeout(() => this.setClose(true), 100);
|
|
270
270
|
if (a.action === 'next_page') this.props.nextPage();
|
|
271
271
|
}
|
|
272
272
|
for (let a of actions) {
|
|
@@ -695,7 +695,7 @@ class Popup extends _common.Com {
|
|
|
695
695
|
}
|
|
696
696
|
this.props.store.onResetCSS(this, () => this.refreshCSS());
|
|
697
697
|
await this.refreshCSS();
|
|
698
|
-
setTimeout(() => {
|
|
698
|
+
_index.default.setTimeout(() => {
|
|
699
699
|
this.setState({
|
|
700
700
|
cssready: true
|
|
701
701
|
});
|
|
@@ -186,7 +186,7 @@ class _default {
|
|
|
186
186
|
return this.last_token;
|
|
187
187
|
}
|
|
188
188
|
if (!force && this.last_token && age < 3000) {
|
|
189
|
-
if (this.token_generator) setTimeout(async () => {
|
|
189
|
+
if (this.token_generator) _index.default.setTimeout(async () => {
|
|
190
190
|
let token, err;
|
|
191
191
|
try {
|
|
192
192
|
token = await tokenGenerator(profile_id);
|
|
@@ -14,7 +14,7 @@ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key i
|
|
|
14
14
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
15
15
|
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
16
16
|
var flow = require('@subiz/flow');
|
|
17
|
-
var Realtime = require('@subiz/wsclient
|
|
17
|
+
var Realtime = require('@subiz/wsclient');
|
|
18
18
|
var cookie = require('cookie_js');
|
|
19
19
|
cookie.defaults.path = '/';
|
|
20
20
|
cookie.expiresMultiplier = 60 * 60 * 24;
|
|
@@ -208,7 +208,7 @@ class Store {
|
|
|
208
208
|
if (!user.id) return;
|
|
209
209
|
var dev = this.getDeviceInfo();
|
|
210
210
|
if (!dev.ga_tracking_ids || !dev.ga_client_id) return;
|
|
211
|
-
clearInterval(_gaInterval);
|
|
211
|
+
_index.default.clearInterval(_gaInterval);
|
|
212
212
|
this.device = dev;
|
|
213
213
|
let ga_client_id = dev.ga_client_id;
|
|
214
214
|
if (ga_client_id !== _index.default.getUserAttr(user, 'ga_client_id', 'text')) {
|
|
@@ -405,7 +405,7 @@ class Store {
|
|
|
405
405
|
}
|
|
406
406
|
seenLoop() {
|
|
407
407
|
this.seenQueue = [];
|
|
408
|
-
clearInterval(this._seenInterval);
|
|
408
|
+
_index.default.clearInterval(this._seenInterval);
|
|
409
409
|
this._seenInterval = _index.default.setInterval(() => {
|
|
410
410
|
this.seenQueue = [...new Set(this.seenQueue)];
|
|
411
411
|
let user = this.cache.match('user') || {};
|
|
@@ -50,32 +50,32 @@ function trackInactivity(seconds, cb) {
|
|
|
50
50
|
let resetTime = () => {
|
|
51
51
|
inactiveSeconds = 0;
|
|
52
52
|
};
|
|
53
|
-
let timer = setInterval(() => {
|
|
53
|
+
let timer = common.setInterval(() => {
|
|
54
54
|
inactiveSeconds++;
|
|
55
55
|
if (inactiveSeconds < seconds) return;
|
|
56
56
|
if (cb) cb();
|
|
57
57
|
for (let ev of events) {
|
|
58
58
|
document.removeEventListener(ev, resetTime, false);
|
|
59
59
|
}
|
|
60
|
-
clearInterval(timer);
|
|
60
|
+
common.clearInterval(timer);
|
|
61
61
|
}, 1000);
|
|
62
62
|
for (let ev of events) {
|
|
63
63
|
document.addEventListener(ev, resetTime, false);
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
66
|
let timeOnPage = 0;
|
|
67
|
-
setInterval(() => {
|
|
67
|
+
common.setInterval(() => {
|
|
68
68
|
timeOnPage += 5;
|
|
69
69
|
}, 5000);
|
|
70
70
|
function trackTimeOnPage(seconds, cb) {
|
|
71
71
|
if (seconds < 1) {
|
|
72
|
-
return setTimeout(function () {
|
|
72
|
+
return common.setTimeout(function () {
|
|
73
73
|
cb(seconds);
|
|
74
74
|
}, 100);
|
|
75
75
|
}
|
|
76
|
-
let timer = setInterval(() => {
|
|
76
|
+
let timer = common.setInterval(() => {
|
|
77
77
|
if (timeOnPage < seconds) return;
|
|
78
78
|
if (cb) cb(timeOnPage);
|
|
79
|
-
clearInterval(timer);
|
|
79
|
+
common.clearInterval(timer);
|
|
80
80
|
}, 1000);
|
|
81
81
|
}
|
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.Date = exports.DEF_CHAT_BUTTON_BACKGROUND_IMAGE_URL = exports.DEFVAL = void 0;
|
|
7
7
|
exports.agentsOfConvo = agentsOfConvo;
|
|
8
8
|
exports.checkRunConditions = checkRunConditions;
|
|
9
|
+
exports.clearTimeout = exports.clearInterval = void 0;
|
|
9
10
|
exports.cloneDeep = cloneDeep;
|
|
10
11
|
exports.convoOfEv = convoOfEv;
|
|
11
12
|
exports.convoToEv = convoToEv;
|
|
@@ -84,6 +85,10 @@ var setTimeout = f.contentWindow.setTimeout.bind(f.contentWindow);
|
|
|
84
85
|
exports.setTimeout = setTimeout;
|
|
85
86
|
var setInterval = f.contentWindow.setInterval.bind(f.contentWindow);
|
|
86
87
|
exports.setInterval = setInterval;
|
|
88
|
+
var clearInterval = f.contentWindow.clearInterval.bind(f.contentWindow);
|
|
89
|
+
exports.clearInterval = clearInterval;
|
|
90
|
+
var clearTimeout = f.contentWindow.clearTimeout.bind(f.contentWindow);
|
|
91
|
+
exports.clearTimeout = clearTimeout;
|
|
87
92
|
function convoOfEv(ev) {
|
|
88
93
|
if (!ev) return '';
|
|
89
94
|
switch (ev.type) {
|