@subiz/widget-v4 4.1.44 → 4.1.46
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/message.less +6 -0
- package/compiled_src/call/css.js +2 -1
- package/compiled_src/chatbox/ImageAttachments.js +89 -13
- package/compiled_src/chatbox/css.js +2 -1
- package/compiled_src/common.js +2 -1
- package/compiled_src/contact/contact.js +3 -2
- package/compiled_src/contact/css.js +2 -1
- package/compiled_src/lib.js +2 -1
- package/compiled_src/notif/css.js +2 -1
- package/compiled_src/popup/css.js +2 -1
- package/compiled_src/popup/popup.js +5 -7
- package/compiled_src/popup/tick.core.commonjs.js +2 -1
- package/compiled_src/store/api.js +1 -1
- package/compiled_src/store/store.js +18 -2
- package/compiled_src/util/campaign.js +6 -2
- package/compiled_src/util/common.js +26 -12
- package/compiled_src/util/index.js +2 -1
- package/compiled_src/util/order.js +4 -2
- package/compiled_src/util/pubsub.js +6 -3
- package/dist/{841.js → 132.js} +612 -528
- package/dist/18a02a9c54e.132.js +1 -0
- package/dist/18a02a9c54e.213.js +1 -0
- package/dist/18a02a9c54e.335.js +1 -0
- package/dist/{18b1ceaf2e0.362.js → 18a02a9c54e.362.js} +1 -1
- package/dist/18a02a9c54e.441.js +1 -0
- package/dist/18a02a9c54e.605.js +1 -0
- package/dist/{18b1ceaf2e0.782.js → 18a02a9c54e.782.js} +1 -1
- package/dist/18a02a9c54e.app.js +1 -0
- package/dist/{18b1ceaf2e0.index.html → 18a02a9c54e.index.html} +4 -4
- package/dist/{18b1ceaf2e0.library.html → 18a02a9c54e.library.html} +4 -4
- package/dist/18a02a9c54e.library.js +1 -0
- package/dist/{18b1ceaf2e0.preview.html → 18a02a9c54e.preview.html} +1 -1
- package/dist/18a02a9c54e.preview.js +1 -0
- package/dist/18a02a9c54e.screenshoot.js +1 -0
- package/dist/18a02a9c54e.webview.js +1 -0
- package/dist/213.js +100 -118
- package/dist/335.js +25 -25
- package/dist/362.js +1 -1
- package/dist/441.js +2855 -0
- package/dist/605.js +50 -50
- package/dist/782.js +1 -1
- package/dist/HASH +1 -1
- package/dist/screenshoot.html +1 -1
- package/dist/screenshoot.js +426 -430
- package/package.json +1 -1
- package/src/chatbox/ImageAttachments.js +93 -15
- package/src/popup/popup.js +8 -7
- package/src/store/api.js +1 -1
- package/src/store/store.js +15 -2
- package/dist/18b1ceaf2e0.213.js +0 -1
- package/dist/18b1ceaf2e0.335.js +0 -1
- package/dist/18b1ceaf2e0.605.js +0 -1
- package/dist/18b1ceaf2e0.841.js +0 -1
- package/dist/18b1ceaf2e0.app.js +0 -1
- package/dist/18b1ceaf2e0.library.js +0 -1
- package/dist/18b1ceaf2e0.preview.js +0 -1
- package/dist/18b1ceaf2e0.screenshoot.js +0 -1
- package/dist/18b1ceaf2e0.webview.js +0 -1
- /package/dist/{18b1ceaf2e0.178.js → 18a02a9c54e.178.js} +0 -0
- /package/dist/{18b1ceaf2e0.678.js → 18a02a9c54e.678.js} +0 -0
package/package.json
CHANGED
|
@@ -1,10 +1,91 @@
|
|
|
1
1
|
import sb from '../util/index.js'
|
|
2
2
|
import {Com} from '../common.js'
|
|
3
|
-
import {h} from 'preact'
|
|
3
|
+
import {h, createRef} from 'preact'
|
|
4
4
|
|
|
5
5
|
export default class ImageAttachment extends Com {
|
|
6
6
|
constructor(props) {
|
|
7
7
|
super(props)
|
|
8
|
+
this.setState({
|
|
9
|
+
ready: false,
|
|
10
|
+
})
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
containerRef = createRef()
|
|
14
|
+
componentDidMount() {
|
|
15
|
+
this.setImageFrameDimension()
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
setImageFrameDimension() {
|
|
19
|
+
const MAX_HEIGHT = 240
|
|
20
|
+
const DEFAULT_MAX_WIDTH = 267
|
|
21
|
+
|
|
22
|
+
let $container = this.containerRef.current
|
|
23
|
+
this.frameWidth = $container ? $container.offsetWidth : DEFAULT_MAX_WIDTH
|
|
24
|
+
this.frameHeight = MAX_HEIGHT
|
|
25
|
+
this.setState({
|
|
26
|
+
ready: true,
|
|
27
|
+
})
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
calculateImageDimension(image) {
|
|
31
|
+
if (!image.width || !image.height) return {width: this.frameWidth, height: this.frameHeight}
|
|
32
|
+
|
|
33
|
+
let ratio = image.width / image.height - this.frameWidth / this.frameHeight
|
|
34
|
+
if (ratio >= 0) {
|
|
35
|
+
let width = this.frameWidth
|
|
36
|
+
let height = (image.height * this.frameWidth) / image.width
|
|
37
|
+
height = Math.round(height)
|
|
38
|
+
return {width, height}
|
|
39
|
+
} else {
|
|
40
|
+
let height = this.frameHeight
|
|
41
|
+
let width = (image.width * this.frameHeight) / image.height
|
|
42
|
+
width = Math.round(width)
|
|
43
|
+
return {width, height}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
renderImage(image, index) {
|
|
48
|
+
if (!this.state.ready) {
|
|
49
|
+
return
|
|
50
|
+
}
|
|
51
|
+
let byType = sb.get(this.props.ev, 'by.type')
|
|
52
|
+
|
|
53
|
+
if (!image.width || !image.height) {
|
|
54
|
+
return (
|
|
55
|
+
<div class={`image-attachment image-attachment--${byType}`}>
|
|
56
|
+
<a href={this.props.store.replaceFileUrl(image.thumbnail_url || image.url)} target='_blank'>
|
|
57
|
+
<img
|
|
58
|
+
alt
|
|
59
|
+
class='image-attachment__img'
|
|
60
|
+
src={this.props.store.replaceFileUrl(image.thumbnail_url || image.url)}
|
|
61
|
+
onload={(e) => this.props.onLoad && this.props.onLoad()}
|
|
62
|
+
/>
|
|
63
|
+
</a>
|
|
64
|
+
</div>
|
|
65
|
+
)
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
let {width, height} = this.calculateImageDimension(image)
|
|
69
|
+
|
|
70
|
+
return (
|
|
71
|
+
<div class={`image-attachment image-attachment--${byType}`}>
|
|
72
|
+
<a href={this.props.store.replaceFileUrl(image.thumbnail_url || image.url)} target='_blank'>
|
|
73
|
+
<img
|
|
74
|
+
alt
|
|
75
|
+
ref={(el) => {
|
|
76
|
+
if (el) {
|
|
77
|
+
// must use this trick because React doesn't support set style important directly
|
|
78
|
+
el.style.setProperty('width', `${width}px`, 'important')
|
|
79
|
+
el.style.setProperty('height', `${height}px`, 'important')
|
|
80
|
+
}
|
|
81
|
+
}}
|
|
82
|
+
class='image-attachment__img'
|
|
83
|
+
src={this.props.store.replaceFileUrl(image.thumbnail_url || image.url)}
|
|
84
|
+
onload={(e) => this.props.onLoad && this.props.onLoad()}
|
|
85
|
+
/>
|
|
86
|
+
</a>
|
|
87
|
+
</div>
|
|
88
|
+
)
|
|
8
89
|
}
|
|
9
90
|
|
|
10
91
|
render() {
|
|
@@ -31,23 +112,20 @@ export default class ImageAttachment extends Com {
|
|
|
31
112
|
|
|
32
113
|
if (images.length === 0) return null
|
|
33
114
|
|
|
34
|
-
|
|
35
|
-
<div class={`image-attachment image-attachment--${byType}`}>
|
|
36
|
-
<a href={this.props.store.replaceFileUrl(image.thumbnail_url || image.url)} target='_blank'>
|
|
37
|
-
<img
|
|
38
|
-
alt
|
|
39
|
-
class='image-attachment__img'
|
|
40
|
-
src={this.props.store.replaceFileUrl(image.thumbnail_url || image.url)}
|
|
41
|
-
onload={(e) => this.props.onLoad && this.props.onLoad()}
|
|
42
|
-
/>
|
|
43
|
-
</a>
|
|
44
|
-
</div>
|
|
45
|
-
))
|
|
115
|
+
let $images = sb.map(images, (image, index) => this.renderImage(image, index))
|
|
46
116
|
|
|
47
117
|
if (byType === 'agent') {
|
|
48
|
-
return
|
|
118
|
+
return (
|
|
119
|
+
<div class='message-agent' ref={this.containerRef}>
|
|
120
|
+
{$images}
|
|
121
|
+
</div>
|
|
122
|
+
)
|
|
49
123
|
} else {
|
|
50
|
-
return
|
|
124
|
+
return (
|
|
125
|
+
<div class='message-user message-user-images-container' ref={this.containerRef}>
|
|
126
|
+
{$images}
|
|
127
|
+
</div>
|
|
128
|
+
)
|
|
51
129
|
}
|
|
52
130
|
}
|
|
53
131
|
}
|
package/src/popup/popup.js
CHANGED
|
@@ -200,7 +200,7 @@ export default class Popup extends Com {
|
|
|
200
200
|
}
|
|
201
201
|
}
|
|
202
202
|
|
|
203
|
-
onButtonClick(e, buttontype) {
|
|
203
|
+
async onButtonClick(e, buttontype) {
|
|
204
204
|
e.stopPropagation()
|
|
205
205
|
let popup = sb.get(this.props.plugin, 'popup', {})
|
|
206
206
|
let page = sb.get(this.props.plugin.popup, `pages.${this.getPageIndex()}`)
|
|
@@ -227,6 +227,7 @@ export default class Popup extends Com {
|
|
|
227
227
|
}
|
|
228
228
|
|
|
229
229
|
if (hasConversion) {
|
|
230
|
+
if (this.isSubmitting) return // avoid double click
|
|
230
231
|
var formData = this._formRef.current ? new FormData(this._formRef.current) : new FormData()
|
|
231
232
|
var summitFields = []
|
|
232
233
|
|
|
@@ -235,9 +236,7 @@ export default class Popup extends Com {
|
|
|
235
236
|
|
|
236
237
|
// modified pairs to convert data of multiple-choice value ['khu_vuc', '1'], ['khu_vuc', '2'] => ['khu_vuc', '1,2']
|
|
237
238
|
let modifiedPairs = {}
|
|
238
|
-
console.log('333333333333')
|
|
239
239
|
for (var pair of formData.entries()) {
|
|
240
|
-
console.log('44444444444444444')
|
|
241
240
|
if (modifiedPairs[pair[0]]) {
|
|
242
241
|
let currentValue = sb.get(modifiedPairs, `${pair[0]}.1`, '')
|
|
243
242
|
currentValue += `,${pair[1]}`
|
|
@@ -247,9 +246,7 @@ export default class Popup extends Com {
|
|
|
247
246
|
}
|
|
248
247
|
}
|
|
249
248
|
|
|
250
|
-
console.log('1111111111111', Object.entries(modifiedPairs))
|
|
251
249
|
for (const [_, pair] of Object.entries(modifiedPairs)) {
|
|
252
|
-
console.log('2222222222222', pair)
|
|
253
250
|
let page = sb.get(this.props.plugin.popup, `pages.${this.getPageIndex()}`)
|
|
254
251
|
let form = sb.find(page.components, (com) => com.type === 'form')
|
|
255
252
|
let fields = sb.get(form, 'form.fields', [])
|
|
@@ -266,8 +263,12 @@ export default class Popup extends Com {
|
|
|
266
263
|
sb.setUserAttr(user, {key: key, text: pair[1]})
|
|
267
264
|
}
|
|
268
265
|
if (is_lead) sb.setUserAttr(user, {key: 'lead_source', text: 'plugin.' + this.props.plugin.id})
|
|
269
|
-
this.
|
|
270
|
-
|
|
266
|
+
this.isSubmitting = true
|
|
267
|
+
await Promise.all([
|
|
268
|
+
this.props.store.setUser(user),
|
|
269
|
+
this.props.store.sendConversion(this.props.plugin.id, summitFields, this.impressionToken),
|
|
270
|
+
])
|
|
271
|
+
this.isSubmitting = false
|
|
271
272
|
}
|
|
272
273
|
|
|
273
274
|
for (let a of actions) {
|
package/src/store/api.js
CHANGED
|
@@ -266,7 +266,7 @@ export default class {
|
|
|
266
266
|
;({body, error} = await this.apireq.post(`/accounts/${this.accid}/files/${signed.id}`, {account_id: this.accid}))
|
|
267
267
|
if (error) return {body, error}
|
|
268
268
|
|
|
269
|
-
return {url:
|
|
269
|
+
return {url: body.url}
|
|
270
270
|
}
|
|
271
271
|
|
|
272
272
|
time = (_) => ajax.setBaseUrl(this.ApiURL).withCredentials(true).setParser('json').get('/time')
|
package/src/store/store.js
CHANGED
|
@@ -913,7 +913,10 @@ export default class Store {
|
|
|
913
913
|
if (!att._file) return
|
|
914
914
|
files.push(att)
|
|
915
915
|
if (ImageTypes.includes(att._file.type)) {
|
|
916
|
-
|
|
916
|
+
let {width, height, url} = await loadImage(att._file)
|
|
917
|
+
att.url = url
|
|
918
|
+
att.width = width
|
|
919
|
+
att.height = height
|
|
917
920
|
}
|
|
918
921
|
})
|
|
919
922
|
}
|
|
@@ -1163,7 +1166,17 @@ function loadImage(file) {
|
|
|
1163
1166
|
reader.onload = (e) => {
|
|
1164
1167
|
// after load all img data into the RAM, find update the corresponse attachment
|
|
1165
1168
|
// since the attachment is very deep, we must force rerender
|
|
1166
|
-
rs(e.target.result) // url
|
|
1169
|
+
//rs(e.target.result) // url
|
|
1170
|
+
let src = e.target.result
|
|
1171
|
+
let img = new Image()
|
|
1172
|
+
img.onload = () => {
|
|
1173
|
+
rs({
|
|
1174
|
+
url: src,
|
|
1175
|
+
width: img.width,
|
|
1176
|
+
height: img.height,
|
|
1177
|
+
})
|
|
1178
|
+
}
|
|
1179
|
+
img.src = src
|
|
1167
1180
|
}
|
|
1168
1181
|
reader.readAsDataURL(file)
|
|
1169
1182
|
})
|
package/dist/18b1ceaf2e0.213.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_subiz_widget_v4=self.webpackChunk_subiz_widget_v4||[]).push([[213],{8213:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>f});var i=n(4494),o=n(2493);const r=function(){var t={},e={VIEW:"view",EASING_FUNCTION:"easing-function"},n={};n[e.VIEW]={},n[e.EASING_FUNCTION]={};var o=function(t,e){if(!n[t])return null;for(var i in e)if(e.hasOwnProperty(i)){if(n[t][i])return null;n[t][i]=e[i]}},r=function(t){var e=t.getBoundingClientRect();return!(e.bottom<0||e.top>window.scrollY+window.innerHeight)},s=function(t,e,i){if(!n[t])throw"Can't add extension with type of \""+t+'", "'+t+'" is not a valid extension type. The following types are valid: '+Mt(n);if(!/^[-a-z]+$/.test(e))throw"Can't add extension with name \""+e+'", "'+e+'" is contains invalid characters. Only lowercase alphabetical characters and dashes are allowed.';if(n[t][e])throw"Can't add extension with name \""+e+'", "'+e+'" is already added.';n[t][e]=i},a=function(t,e){if(!n[t])throw"Can't get extension with type of \""+t+'", "'+t+'" is not a valid extension type. The following types are available: '+Mt(n);if(!n[t][e])throw"Can't get extension with name \""+e+'", "'+e+'" is not available. The following extensions are available: '+Mt(n[t]);return n[t][e]},l=function(t){return{destroy:function(){t.destroyed=!0,t.frame&&cancelAnimationFrame(t.frame),t.styleObserver&&t.styleObserver.disconnect(),t.didResizeWindow&&window.removeEventListener("resize",t.didResizeWindow),t.root&&t.root.parentNode&&t.root.parentNode.removeChild(t.root)}}},p=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document.createElement("span"),n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return t.root=e,t.aligned=null,t.destroyed=!1,e&&n&&(t.root.classList.add("tick-"+n),t.root.setAttribute("data-view",n)),e&&e.dataset.layout&&(t.align=(e.dataset.layout.match(/left|right|center/)||[])[0]||"left"),{appendTo:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"last";!t.root||t.root&&t.root.parentNode||("last"!==n?("first"===n&&(0===e.childNodes.length?e.appendChild(t.root):0===e.children.length&&e.childNodes.length?e.insertBefore(t.root,e.childNodes[e.childNodes.length-1]):e.insertBefore(t.root,e.children[0])),"string"!=typeof n&&e.insertBefore(t.root,n)):e.childNodes.length&&e.childNodes[e.childNodes.length-1].nodeType===Node.TEXT_NODE?e.insertBefore(t.root,e.childNodes[e.childNodes.length-1]):e.appendChild(t.root))}}},u=function(t,e){return t.definition=e,{setDefinition:function(e){t.definition=e}}},c=function(t,e,n,i){return{draw:function(){return t.dirty?(e(t,i),d(t),t.dirty=!1,!0):(n&&n(t)&&d(t),!1)}}},d=function(t){if(!t.fit){if(!t.root||!(t.root.getAttribute("data-layout")||"").match(/fit/))return void(t.fit=!1);var e=window.getComputedStyle(t.root,null);t.fit=!0,t.fitInfo={currentFontSize:parseInt(e.getPropertyValue("font-size"),10)}}t.fitInfo.availableWidth=t.root.parentNode.clientWidth,t.fitInfo.currentWidth=t.root.scrollWidth;var n=Math.min(Math.max(4,t.fitInfo.availableWidth/t.fitInfo.currentWidth*t.fitInfo.currentFontSize),1024);Math.abs(n-t.fitInfo.currentFontSize)<=1||(t.fitInfo.currentFontSize=n,t.root.style.setProperties("fontSize",t.fitInfo.currentFontSize+"px","important"))},f=function(t){return t.dirty=!0,t.value=null,t.valueUpdateCount=0,t.isInitialValue=function(){return t.valueUpdateCount<=1},{reset:function(){t.dirty=!0,t.value=null,t.valueUpdateCount=0},update:function(e){Pt(t.value,e)||(t.value=e,t.valueUpdateCount++,t.dirty=!0)}}},h=function(t){t.didResizeWindow=function(){t.dirty=!0},window.addEventListener("resize",t.didResizeWindow)},m="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},g=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),y=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},_=function(t){if(Array.isArray(t)){for(var e=0,n=Array(t.length);e<t.length;e++)n[e]=t[e];return n}return Array.from(t)},v=function(t,e){var n=(t.definition||[]).concat();"right"===t.align&&n.reverse();var i=Array.isArray(t.value)?t.value.concat():"object"===m(t.value)?It(t.value):t.value;n.forEach((function(n){if(!n.presenter){if(t.update=e(n),!n.presenter)return;n.presenter.appendTo(t.root)}})),n.filter((function(t){return void 0!==t.presenter})).forEach((function(e){Array.isArray(i)&&t.valueMapping?t.update(e,"indexes"===t.valueMapping?"right"===t.align?i.pop():i.shift():i):e.key&&void 0!==i[e.key]?t.update(e,i[e.key]):t.update(e,i)})),t.views=n,b(t)},b=function(t){var e=!1;return t.views.filter((function(t){return void 0!==t.presenter})).forEach((function(t){t.presenter.draw()&&(e=!0)})),e},w=function(t,e,n){var i=At(Array.isArray(t.value)?t.value:(t.value+"").split(""));if("right"===t.align&&i.reverse(),t.definitions.length>i.length)for(;t.definitions.length>i.length;)t.definitions.pop().presenter.destroy();i.forEach((function(n,i){var o=t.definitions[i];o||(o=t.definitions[i]=lt(t.definition),t.update=e(o),o.presenter.appendTo(t.root,"right"===t.align?"first":"last"))})),i.forEach((function(e,n){return t.update(t.definitions[n],e)})),t.views=i,k(t)},k=function(t){var e=!1;return t.views.forEach((function(n,i){t.definitions[i].presenter.draw()&&(e=!0)})),e},x=function(t,e){var n=document.createElement(t);return e&&(n.className=e),n},C=function(t,e,n){var i=new MutationObserver((function(i){e.forEach((function(o){i.filter((function(t){return e.includes(t.attributeName)})).length&&n(t.getAttribute(o))}))}));return i.observe(t,{attributes:!0}),i},Z=function(t,e,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";t.transforms||(t.transforms=[]);var o=t.transforms.find((function(t){return t.name===e}));o?o.value=n:t.transforms.push({name:e,value:n,unit:i}),z(t,t.transforms)},z=function(t,e){t.style.setProperty("transform",e.map((function(t){return t.name+"("+t.value+t.unit+")"})).join(" "),"important")},S={},D=function(t,e){var n=e.toString();return S[n]||(S[n]={}),S[n][t]||(S[n][t]=e(t)),S[n][t]},j=new RegExp("^[0-9]+$"),E=new RegExp("^(true|false)$"),F=new RegExp("^[0-9.]+$"),I=new RegExp("color"),A=new RegExp("shadow"),O=new RegExp("^(follow-gradient|horizontal-gradient|vertical-gradient)"),P=new RegExp("^[.0-9]+(?:ms|s){1}$"),N=new RegExp("^transition-?(?:in|out)?$"),R=new RegExp("^url\\("),T=function(t){return t?parseFloat(t)*(/ms$/.test(t)?1:1e3):0},M=function(t){return t.match(/[a-z]+(?:\(.*?\))?\s?(?:origin\(.*?\))?\s?(?:[a-z]+\(.*?\))?[ .a-z-0-9]*/g).map(U)},U=function(t){var e=t.match(/([a-z]+(?:\(.*?\))?)\s?(?:origin\((.*?)\))?\s?([a-z]+(?:\(.*?\))?)?\s?(?:([.0-9ms]+)?\s?(?:(ease-[a-z-]+))?\s?([.0-9ms]+)?)?/),n=yt(e[1]),i=void 0,o=void 0,r=void 0,s=void 0,a=void 0;return e.slice(2).filter((function(t){return void 0!==t})).forEach((function(t){P.test(t)?void 0===o?o=T(t):s=T(t):/ /.test(t)?i=t:/^ease-[a-z-]+$/.test(t)?r=t:/^[a-z]+/.test(t)&&(a=yt(t))})),a&&(o=void 0,r=void 0),{name:n.name,parameters:n.parameters,duration:o,ease:r,delay:s,origin:i,resolver:a}},B=function(t){var e=t.match(/follow-gradient|horizontal-gradient|vertical-gradient/)[0];return{type:e,colors:t.substr(e.length).match(/(?:transparent|rgb\(.*?\)|hsl\(.*?\)|hsla\(.*?\)|rgba\(.*?\)|[a-z]+|#[abcdefABCDEF\d]+)\s?(?:[\d]{1,3}%?)?/g).map(V)}},$=/\s([\d]{1,3})%?$/,V=function(t){var e=t.match($);return{offset:e?parseFloat(e[1])/100:null,value:W(t.replace($,""))}},W="undefined"==typeof document?function(t){return t}:function(t){if("transparent"===t)return"rgba(0,0,0,0)";var e=document.createElement("span");return e.style.cssText="position:absolute !important;visibility:hidden !important;color:"+t+" !important",document.body.appendChild(e),requestAnimationFrame((function(){e.parentNode.removeChild(e)})),window.getComputedStyle(e).getPropertyValue("color")},q=function(t){return"string"!=typeof t?t:t.match(/([-.\d]+(?:%|ms|s|deg|cm|em|ch|ex|q|in|mm|pc|pt|px|vh|vw|vmin|vmax)?)|[%#A-Za-z0-9,.()]+/g)},L=function(t){var e=t.split(":").map(Ft),n=e[0].trim().split("-").map((function(t,e){return e>0?function(t){return t.charAt(0).toUpperCase()+t.slice(1)}(t):t})).join(""),i=function(t,e){return E.test(t)?"string"==typeof t?"true"===t:t:j.test(t)?parseInt(t,10):F.test(t)?parseFloat(t):R.test(t)?1===(n=t.match(/url\((.*?)\)/g).map((function(t){return t.substring(4,t.length-1)}))).length?n[0]:n:I.test(e)?O.test(t)?D(t,B):D(t,W):A.test(e)?D(t,q):N.test(e)?"none"===t?t:D(t,M):t;var n}(e[1],e[0]);return n&&null!=i?{property:n,value:i}:null},H={"ease-out-sine":function(t){return Math.sin(t*(Math.PI/2))},"ease-out-cubic":function(t){var e=t-1;return e*e*e+1},"ease-out-bounce":function(t){var e=t/1;if(e<1/2.75)return 7.5625*e*e;if(e<2/2.75){var n=e-1.5/2.75;return 7.5625*n*n+.75}if(e<2.5/2.75){var i=e-2.25/2.75;return 7.5625*i*i+.9375}var o=e-2.625/2.75;return 7.5625*o*o+.984375}};o(e.EASING_FUNCTION,H);var K=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return t.lastAppliedStyles=null,X(t,e,t.root.dataset.style),t.styleObserver=C(t.root,["data-style"],(function(n){X(t,e,n)})),{setStyle:function(n){X(t,e,n)}}},X=function(t,e,n){t.lastAppliedStyles!==n&&(t.lastAppliedStyles=n,t.style=n?Dt(e,function(t){return t.split(";").filter((function(t){return t.trim().length})).map(L).filter((function(t){return null!==t})).reduce((function(t,e){return t[e.property]=e.value,t}),{})}(n)):e,t.dirty=!0)},Y={text:function(){return function(t){var e={};return Object.assign({},p(e,t,"text"),f(e),c(e,(function(t){t.root.setAttribute("data-value",t.value),function(t,e){var n=t.childNodes[0];n?e!==n.nodeValue&&(n.nodeValue=e):(n=document.createTextNode(e),t.appendChild(n))}(t.root,t.value)})),l(e))}}};o(e.VIEW,Y);var G=function(t,e,n){return function(t,e,n){var i={valueMapping:null};if(t&&t.dataset.valueMapping){var o=t.dataset.valueMapping;i.valueMapping=-1!==["none","indexes"].indexOf(o)?o:null}return Object.assign({},p(i,t),h(i),f(i),u(i,e),c(i,v,b,n),l(i))}(t,e,n)},J=function(t,e){return"-"===t[e]&&">"===t[e+1]},Q=function(t){return"'"===t||'"'===t},tt=function(t){return","===t},et=function(t){return"("===t},nt=function(t){return")"===t},it=function(t){return 0!==t.trim().length},ot=function(t,e){return t.push(e.trim())},rt=function(t,e){return it(e)?(ot(t,e),""):e},st=function(t,e){return t.length&&e.push(t.length>1?t.concat():t[0]),[]},at=function t(e,n,i){for(var o="",r=[],s=null,a=!1;e<n.length;){var l=n[e];if(et(l)){a=!1;var p=[o.trim()];l=n[e=t(e+1,n,p)],r.push(p),o=""}else{if(nt(l))return a&&o.trim().length&&(r.push([o.trim()]),o="",a=!1),it(o)&&ot(r,o),r=st(r,i),e+1;null!==s&&l!==s?o+=l:l===s?(r.push(o),o="",s=null):Q(l)?(o="",s=l):J(n,e)?(a=!0,o.trim().length&&(r.push([o.trim()]),o=""),e+=2):tt(l)?(a&&o.trim().length&&(r.push([o.trim()]),o="",a=!1),r=st(r,i),o=rt(i,o)):o+=l,e++}}return(a&&o.trim().length||!a&&o.trim().length&&!r.length)&&(r.push([o.trim()]),o=""),st(r,i),rt(i,o),e},lt=function t(e){var n={};for(var i in e)e.hasOwnProperty(i)&&(n[i]="root"!==i?"children"!==i?"repeat"!==i?e[i]:null===e[i]?null:t(e[i]):null===e[i]?null:e[i].map(t):e[i].cloneNode());return n.presenter=null,n},pt={root:null,key:null,view:null,overlay:null,presenter:null,transform:null,layout:null,style:null,repeat:null,children:null,className:null},ut=function t(e){return Array.from(e).map((function(e){var n=Dt(pt,{root:e});for(var i in e.dataset)e.dataset.hasOwnProperty(i)&&void 0!==n[i]&&(n[i]=e.dataset[i]);return n.repeat?(n.repeat=t(e.children).pop(),Array.from(e.children).forEach((function(t){t.parentNode.removeChild(t)}))):e.children.length&&(n.children=t(e.children)),n}))},ct=function t(e){return e.map((function(e){return"string"==typeof(e=Dt(pt,e)).root?e.root=document.createElement(e.root):e.root=document.createElement("span"),e.transform&&(e.root.dataset.transform=e.transform),e.className&&(e.root.className=e.className),e.overlay&&(e.root.dataset.overlay=e.overlay),e.view?(e.root.dataset.view=e.view,e.style&&(e.root.dataset.style=e.style),e.repeat=null):(e.layout&&(e.root.dataset.layout=e.layout),e.repeat?(e.root.dataset.repeat=!0,e.repeat=t(e.children).pop()):e.children&&(e.children=t(e.children),e.children.forEach((function(t){e.root.appendChild(t.root)})))),e}))},dt=function(t){var n=!1,i=function(e,i){e.transform(i,(function(t){e.presenter.update(t)}),t),n||(n=!0,o())},o=function e(){t.baseDefinition.presenter.draw(),requestAnimationFrame(e)};return function n(o){return o.presenter=function(t,n){var i,o,s,d,m=void 0;return t.repeat?m=function(t,e,n){return function(t,e,n){var i={definitions:[]};return Object.assign({},p(i,t),f(i),u(i,e),c(i,w,k,n),l(i))}(t,e,n)}(t.root,t.repeat,n):"string"==typeof t.view?(i=t.view,o=t.root,s=t.style,m=(d=a(e.VIEW,i))?d({Extension:{Type:e,getExtension:a},Utils:{},Canvas:{},DOM:{visible:r,create:x,transform:Z},Animation:{},Date:{performance:Ot},View:{rooter:p,drawer:c,updater:f,styler:K,grouper:u,resizer:h,destroyer:l}})(o,s):null):function(t){return t.children&&t.children.length}(t)&&(m=G(t.root,t.children,n)),m}(o,n),o.transform=mt(o.transform,t),i}(t.baseDefinition)},ft=function(t){for(var e=arguments.length,n=Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];return function(e,i){!function e(o,r){n.length<=o?i(r):n[o](r,ht(e,[o+1]),t)}(0,e)}},ht=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments[2];return function(){var i=Array.from(e);return Array.prototype.push.apply(i,arguments),t.apply(n,i)}},mt=function(t,e){if(!t)return function(t,e){return e(t)};if("function"==typeof t)return t;var n=function(t){var e=[];return at(0,t,e),e}("transform("+(/^[a-z]+$/.test(t)?t+"()":t)+")");return gt(n,e)},gt=function t(n,i){var o=n.map((function(n){var o=n.shift(),r=a(e.TRANSFORM,o)||function(t,e,n){e(t)},s=n.map((function(e){return Array.isArray(e)?"string"==typeof e[0]?t([e],i):t(e,i):St(e)}));return r.apply(void 0,_(s))}));return ft.apply(void 0,[i].concat(_(o)))},yt=function(t){var e=t.match(/[a-z]+/)[0];return{name:e,parameters:_t(t.substring(e.length))}},_t=function(t){(t.match(/('.+?')|(".+?")|(\[.+?])|([.:\-\d\sa-zA-Z]+%?)/g)||[]).map(Ft).filter((function(t){return t.length})).map(St)},vt=function(t){return t.substring(1,t.length-1)},bt=/^([\d]{4}-[\d]{1,2}-[\d]{1,2})/,wt=/^(true|false)$/,kt=/^[\a-zA-Z]+$/,xt=/^0[\d]+/,Ct=/^('|")/,Zt=/^-?(?:\d+)?(?:\.|0\.)?[\d]+$/,zt=/^(\[)/,St=function(t){return wt.test(t)?"true"===t:zt.test(t)?_t(vt(t)):bt.test(t)?dateFromISO(t):Ct.test(t)?vt(t):kt.test(t)||xt.test(t)?t:Zt.test(t)?parseFloat(t):t},Dt=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=void 0,i={};for(n in t)t.hasOwnProperty(n)&&(i[n]=void 0===e[n]?t[n]:e[n]);return i},jt=function(t){var e=window,n=t.split(".");return n.forEach((function(t,i){e[n[i]]&&(e=e[n[i]])})),e!==window?e:null},Et=function(t){return/^(?:[\w]+\s?:\s?[\w.]+,\s?)+(?:[\w]+\s?:\s?[\w.]+)$/g.test(t)?t.match(/(?:(\w+)\s?:\s?([\w.]+))/g).reduce((function(t,e){var n=e.split(":");return t[n[0]]=St(n[1]),t}),{}):St(t)},Ft=function(t){return t.trim()},It=function(t){return"object"===(void 0===t?"undefined":m(t))&&null!==t?i.Z.parseJSON(i.Z.stringify(t)):t},At=function(t){return t.slice()},Ot=function(){return window.performance.now()},Pt=function(t,e){return Nt(t)?Rt(t,e):Array.isArray(t)?Tt(t,e):t===e},Nt=function(t){return t===Object(t)},Rt=function(t,e){for(var n in t)if(!e.hasOwnProperty(n)||t[n]!==e[n])return!1;return!0},Tt=function(t,e){return t.length==e.length&&t.every((function(t,n){return t===e[n]}))},Mt=function(t){return Object.keys(t).map((function(t){return'"'+t+'"'})).join(", ")},Ut=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document.createElement("div");!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this._options=Dt(t.options(),e),this._element=n,this._value=null,this._observer=null,this._viewDefinition=null,this._updater=null,this._didInit=null,this._didDestroy=null,this._willDestroy=null,this._didUpdate=null,this._init()}return g(t,[{key:"isRootElement",value:function(t){return this._element===t}},{key:"destroy",value:function(){this._willDestroy(this),this._observer.disconnect(),this.baseDefinition.presenter.destroy(),this._didDestroy(this)}},{key:"redraw",value:function(){this.baseDefinition&&this.baseDefinition.presenter&&(this.baseDefinition.presenter.reset(),this.baseDefinition.presenter.draw(),this._updater(this.baseDefinition,this._value))}},{key:"_init",value:function(){var t=this;this._viewDefinition=this._options.view,this._willDestroy=this._options.willDestroy,this._didDestroy=this._options.didDestroy,this._didInit=this._options.didInit,this._didUpdate=this._options.didUpdate,this._value=this._options.value,this._element.classList.contains("tick")||this._element.classList.add("tick"),this._observer=C(this._element,["data-value"],(function(e){t.value=e})),this._viewDefinition.root!==this._element&&(Array.from(this._viewDefinition.root.children).forEach((function(e){t._element.appendChild(e)})),this._viewDefinition.root=this._element),this._viewDefinition.view||this._viewDefinition.children||(this._viewDefinition.view="text"),this._updater=dt(this),null!==this.value&&this._update(this.value),this._element.dataset.state="initialised",this._didInit(this,this.value)}},{key:"_update",value:function(t){this._updater(this.baseDefinition,t),this._didUpdate(this,t)}},{key:"baseDefinition",get:function(){return this._viewDefinition}},{key:"root",get:function(){return this._element}},{key:"value",get:function(){return this._value},set:function(t){this._value="string"==typeof t?Et(t):t,this._update(t)}}],[{key:"options",value:function(){return{value:null,view:null,didInit:function(t){},didUpdate:function(t,e){},willDestroy:function(t){},didDestroy:function(t){}}}}]),t}(),Bt=[],$t={value:Et,didInit:jt,didUpdate:jt,didDestroy:jt,willDestroy:jt},Vt=function(t){var e=Bt.filter((function(e){return e.isRootElement(t)}));return e?e[0]:null},Wt=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;if(t&&!function(t){return t instanceof HTMLElement}(t)&&(e=t,t=void 0),!t||!Vt(t)){e&&e.view&&(e.view=ct([e.view])[0]),!e&&t&&(e=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=t.dataset,o={meta:{}};for(var r in i)if(i.hasOwnProperty(r)){var s=e[r],a=i[r];s&&(a=null===(a=s(a))?It(n[r]):a,o[r]=a)}return o}(t,$t,y({},Ut.options()))),t&&(e||(e={}),e.view||(e.view=ut([t])[0]));var n=new Ut(e,t);return Bt.push(n),n}},qt={supported:function(){var t=window;if(void 0===t)return!1;var e=t.CSS&&t.CSS.supports,n=!!t.MSInputMethodContext&&!!document.documentMode,i=e&&CSS.supports("transform","translateX(0)");return n||e&&i&&!!["MutationObserver","requestAnimationFrame"].filter((function(e){return e in t})).length}(),options:{},DOM:{create:Wt,destroy:function(t){var e=function(t,e){for(var n=0,i=t.length;n<i;n++)if(t[n].isRootElement(e))return n;return-1}(Bt,t);return!(e<0||(Bt[e].destroy(),Bt.splice(e,1),0))},parse:function(t){var e,n=void 0,i=void 0,o=[];for(i=(e=t.querySelectorAll(".tick:not([data-state])")).length;i--;)n=e[i],o.push(Wt(n));return o},find:Vt},plugin:{add:function(t,e,n){if("function"==typeof t){var i=t;return s(i.identifier.type,i.identifier.name,i)}return s(t,e,n)}}},Lt=function(t){if(!e.hasOwnProperty(t))return"continue";qt.plugin[function(t){return t.replace(/-./g,(function(t){return t.charAt(1).toUpperCase()}))}("add-"+e[t])]=function(n,i){s(e[t],n,i)}};for(var Ht in e)Lt(Ht);return t.exports=qt,t.exports}();var s=n(9980),a=n.n(s),l=n(6400);r.plugin.add(a());class p extends o.up{constructor(t){var e,n,o;super(t),e=this,o={flipKey:"43"},(n=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}(n="state"))in e?Object.defineProperty(e,n,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[n]=o,this.timer=i.Z.setInterval((()=>{if(this.props._destroy)return this.componentWillUnmount();let t=this.props.com.countdown||{},e="cd:"+t.skin+":"+t.size+":"+this.props.plugin.popup.font_family+":";this.state.flipKey!==e&&this.setState({flipKey:e}),this.forceUpdate()}),500)}componentWillUnmount(){i.Z.clearInterval(this.timer)}getCountDownDeltaSec(t){let e;if("fixed_time"===t.expire_time_type&&(e=t.fixed_time),"visit_time"===t.expire_time_type&&(e=this.props.store.pageLoaded()+6e4*t.visit_time),"repeat_daily"===t.expire_time_type&&((n=new i.Z.Date).setHours(0,0,0,0),e=n.getTime()+6e4*t.repeat_daily),"repeat_weekly"===t.expire_time_type){let r=0,s=(new i.Z.Date).getDay();if(r=0===s?"sunday"===t.repeat_weekly_weekday?0:7-(new i.Z.Date).getDay():"sunday"===t.repeat_weekly_weekday?7-s:u[t.repeat_weekly_weekday]-s,r<0)o=0;else if(0==r)(n=new i.Z.Date).setHours(0,0,0,0),e=n.getTime()+6e4*t.repeat_weekly_min;else{var n;(n=new i.Z.Date).setHours(0,0,0,0),e=n.getTime()+6e4*t.repeat_weekly_min+864e5*r}}let o=e-i.Z.Date.now();return o<0&&(o=0),Math.floor(o/1e3)||0}renderElectricCountdown(t,e,n,o,r,s,a){let p="28px";return"sm"===this.props.com.countdown.size&&(p="20px"),"lg"===this.props.com.countdown.size&&(p="40px"),(0,l.h)("div",{class:"countdown_electric"},(0,l.h)("div",{class:"countdown_electric_group"},(0,l.h)("div",{class:"countdown_electric_label"},this.props.t("hour")),(0,l.h)("div",{class:"countdown_electric_numbers"},(0,l.h)("div",{class:"countdown_electric_number",style:i.Z.js2css({font_size:p,font_family:this.props.plugin.popup.font_family})},e),(0,l.h)("div",{class:"countdown_electric_number",style:i.Z.js2css({font_size:p,font_family:this.props.plugin.popup.font_family})},n))),(0,l.h)("div",{class:"countdown_electric_group"},(0,l.h)("div",{class:"countdown_electric_label"},this.props.t("min")),(0,l.h)("div",{class:"countdown_electric_numbers"},(0,l.h)("div",{class:"countdown_electric_number",style:i.Z.js2css({font_size:p,font_family:this.props.plugin.popup.font_family})},o),(0,l.h)("div",{class:"countdown_electric_number",style:i.Z.js2css({font_size:p,font_family:this.props.plugin.popup.font_family})},r))),(0,l.h)("div",{class:"countdown_electric_group"},(0,l.h)("div",{class:"countdown_electric_label"},this.props.t("sec")),(0,l.h)("div",{class:"countdown_electric_numbers"},(0,l.h)("div",{class:"countdown_electric_number",style:i.Z.js2css({font_size:p,font_family:this.props.plugin.popup.font_family})},s),(0,l.h)("div",{class:"countdown_electric_number",style:i.Z.js2css({font_size:p,font_family:this.props.plugin.popup.font_family})},a))))}renderFlipCountdown(t,e,n,i,o,r,s){let a=null;if(t>99&&(t=99),t>0){let e=Math.floor(t/10)+"",n=t%10+"";a=(0,l.h)("div",{class:"countdown_group"},(0,l.h)(c,{key:this.state.flipKey+4,value:e+""+n,plugin:this.props.plugin,com:this.props.com}),(0,l.h)("div",{class:"countdown_label"},this.props.t("day")))}return(0,l.h)("div",{class:"countdown"},a,(0,l.h)("div",{class:"countdown_group"},(0,l.h)(c,{key:this.state.flipKey+1,value:e+""+n,plugin:this.props.plugin,com:this.props.com}),(0,l.h)("div",{class:"countdown_label"},this.props.t("hour"))),(0,l.h)("div",{class:"countdown_group"},(0,l.h)(c,{key:this.state.flipKey+2,value:i+""+o,plugin:this.props.plugin,com:this.props.com}),(0,l.h)("div",{class:"countdown_label"},this.props.t("min"))),(0,l.h)("div",{class:"countdown_group"},(0,l.h)(c,{key:this.state.flipKey+3,value:r+""+s,plugin:this.props.plugin,com:this.props.com}),(0,l.h)("div",{class:"countdown_label"},this.props.t("sec"))))}render(){let t=this.getCountDownDeltaSec(this.props.com.countdown),e=Math.floor(t/86400),n=Math.floor((t-86400*e)/3600),i=Math.floor((t-86400*e-3600*n)/60),o=t-86400*e-3600*n-60*i,r=Math.floor(o/10)+"",s=o%10+"",a=Math.floor(i/10)+"",l=i%10+"",p=Math.floor(n/10)+"",u=n%10+"";return"electric"===this.props.com.countdown.skin?this.renderElectricCountdown(e,p,u,a,l,r,s):this.renderFlipCountdown(e,p,u,a,l,r,s)}}const u={sunday:0,monday:1,tuesday:2,wednesday:3,thursday:4,friday:5,saturday:6};class c extends o.up{constructor(t){super(t),this._tickRef=(0,l.Vf)()}componentDidMount(){this._tickInstance=r.DOM.create(this._tickRef.current,{value:this.props.value})}componentDidUpdate(){this._tickInstance&&(this._tickInstance.value=this.props.value)}componentWillUnmount(){this._tickInstance&&r.DOM.destroy(this._tickRef.current)}render(){let t="28px";return"sm"===this.props.com.countdown.size&&(t="20px"),"lg"===this.props.com.countdown.size&&(t="40px"),(0,l.h)("div",{ref:this._tickRef,class:"tick"},(0,l.h)("div",{"data-repeat":"true","aria-hidden":"true"},(0,l.h)("span",{"data-view":"flip",style:i.Z.js2css({font_size:t,font_family:this.props.plugin.popup.font_family})})))}}let d=n.e(782).then(n.bind(n,9782));class f extends o.up{constructor(t){var e,n,o;super(t),e=this,o={close:!1,cssready:!1,closeAnimation:!0,pressedSubmit:!1,imageReady:!1,fontReady:!1},(n=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}(n="state"))in e?Object.defineProperty(e,n,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[n]=o,this._formRef=(0,l.Vf)(),i.Z.setTimeout((()=>this.fillForm()),1e3),i.Z.setTimeout((async()=>{let{body:t}=await this.props.store.sendImpression(this.props.plugin.id);this.impressionToken=i.Z.get(t,"impression_token")||""}),10),i.Z.setTimeout((()=>{let t={};t[this.props.plugin.popup.font_family]=!0;let e={};i.Z.map(this.props.plugin.popup.pages,(n=>{n&&i.Z.map(n.components,(n=>{t[i.Z.get(n,"style.font_family")]=!0,t[i.Z.get(n,"mobile_style.font_family")]=!0,"image"===n.type&&n.image&&n.image.url&&n.image.url.startsWith("http")&&(e[n.image.url]=!0)}))})),delete t.undefined,delete t.null,delete t[""],0==i.Z.size(e)&&this.setState({imageReady:!0}),i.Z.map(e,((t,e)=>i.Z.preloadImg(e,(()=>this.setState({imageReady:!0}))))),i.Z.preloadWebfonts(Object.keys(t)),i.Z.setTimeout((async()=>{await this.waitForFont(Object.keys(t)),this.setState({fontReady:!0})}))}))}async waitForFont(t){if(0==i.Z.size(t))return;let e={};for(var n=0;n<10;n++){for(var o=0;o<t.length;o++)try{if(document.fonts.check("normal 16px "+t[o])&&(e[t[o]]=!0),Object.keys(readycount)==t.length)return}catch(t){}await i.Z.sleep(200)}}openPopup(){this.setState({close:!1})}getPageIndex(){return void 0!==this.props.plugin._page_index?this.props.plugin._page_index:this.props.pageIndex}isFormFilled(){let t=i.Z.get(this.props.plugin.popup,`pages.${this.getPageIndex()}`),e=i.Z.find(t.components,(t=>"form"===t.type));if(!e||!e.form)return!0;let n=i.Z.get(e,"form.fields",[]);return!i.Z.find(n,(t=>!!t.is_required&&(!this.isFieldValid(t.key,t.validate)||this.isFieldEmpty(t.key))))}fillForm(){let t=i.Z.get(this.props.plugin.popup,`pages.${this.getPageIndex()}`),e=i.Z.find(t.components,(t=>"form"===t.type));if(!e)return;let n=this.props.store.matchUser(),o=i.Z.get(n,"attributes"),r=i.Z.get(e,"form.fields",[]);i.Z.each(r,(t=>{let e=t.key;if("email"===e&&(e="emails"),"phone"===e&&(e="phones"),"emails"===e&&"phones"==e&&"fullname"===e){if("emails"==e){let e=i.Z.getUserAttr(n,"related_email","text");if(!e)return;if(!(r=this._formRef.current.elements[t.key]))return;r.value=e}if("phones"==e){let e=i.Z.getUserAttr(n,"related_phone","text");if(!e)return;var r;if(!(r=this._formRef.current.elements[t.key]))return;r.value=e}i.Z.map(o,(n=>{if(e===n.key&&n.text){var i=this._formRef.current.elements[t.key];i&&(i.value=n.text)}}))}}))}isFieldValid(t,e){if(!e)return!0;if(!this._formRef||!this._formRef.current)return!1;var n=new FormData(this._formRef.current);for(var o of n.entries())if(o[0]===t)return"email"===e?i.Z.isEmail(o[1]):"phone"===e?i.Z.isPhone(o[1]):"url"===e?i.Z.isURL(o[1]):"number"!==e||i.Z.isNumber(o[1]);return!0}isFieldEmpty(t){if(!this._formRef||!this._formRef.current)return!1;var e=new FormData(this._formRef.current);for(var n of e.entries())if(n[0]===t)return""===n[1]||void 0===n[1];return!0}renderCloseButton(){return this.props.plugin.popup.show_close_button?(0,l.h)("div",{class:"btn_close default",onClick:t=>this.setClose(!0)},(0,l.h)("svg",{class:"btn_close__icon",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24","stroke-linecap":"round","stroke-linejoin":"round"},(0,l.h)("line",{x1:"17",y1:"7",x2:"7",y2:"17",style:"stroke-width: 3 !important;"}),(0,l.h)("line",{x1:"7",y1:"7",x2:"17",y2:"17",style:"stroke-width: 3 !important;"}))):null}setClose(t){t?(document.body.style.setProperty("overflow",this.lastoverflow),this.setState({closeAnimation:!0}),i.Z.setTimeout((()=>this.setState({close:!0,closeAnimation:!1})),150),this.props.plugin._dont_close&&i.Z.setTimeout((()=>{this.lastoverflow=window.getComputedStyle(document.body).getPropertyValue("overflow"),document.body.style.setProperty("overflow","hidden","important"),this.setState({closeAnimation:!1,close:!1})}),1500)):(this.lastoverflow=window.getComputedStyle(document.body).getPropertyValue("overflow"),document.body.style.setProperty("overflow","hidden","important"),this.setState({closeAnimation:!1}))}onButtonClick(t,e){t.stopPropagation(),i.Z.get(this.props.plugin,"popup",{});let n=i.Z.get(this.props.plugin.popup,`pages.${this.getPageIndex()}`),o=[],r=i.Z.find(n.components,(t=>"buttons"===t.type));"background"===e&&(o=i.Z.get(n,"background_click.actions")||[]),"primary"===e&&r.buttons.primary_enabled&&(o=r.buttons.primary_actions||[]),"secondary"===e&&r.buttons.secondary_enabled&&(o=r.buttons.secondary_actions||[]);let s=!1;for(let t of o)"conversion"!==t.action&&"submit"!==t.action||(s=!0,this.setState({pressedSubmit:!0}));if(!s||this.isFormFilled()){var a=!1;for(let t of o)"submit"!==t.action&&"conversion"!==t.action||(a=!0);if(a){var l=this._formRef.current?new FormData(this._formRef.current):new FormData,p=[];let t=i.Z.cloneDeep(this.props.store.matchUser()),e=!1,n={};for(var u of(console.log("333333333333"),l.entries()))if(console.log("44444444444444444"),n[u[0]]){let t=i.Z.get(n,`${u[0]}.1`,"");t+=`,${u[1]}`,i.Z.set(n,`${u[0]}.1`,t)}else n[u[0]]=[u[0],u[1]];console.log("1111111111111",Object.entries(n));for(const[o,r]of Object.entries(n)){console.log("2222222222222",r);let n=i.Z.get(this.props.plugin.popup,`pages.${this.getPageIndex()}`),o=i.Z.find(n.components,(t=>"form"===t.type)),s=i.Z.get(o,"form.fields",[]),a=i.Z.find(s,(t=>t.key===r[0]))||{};if(!a.type)return;p.push({key:r[0],type:a.type,value:i.Z.stringify(r[1])});let l=r[0];"email"===l&&(l="emails"),"phone"===l&&(l="phones"),e=e||"emails"==l||"phones"==l,i.Z.setUserAttr(t,{key:l,text:r[1]})}e&&i.Z.setUserAttr(t,{key:"lead_source",text:"plugin."+this.props.plugin.id}),this.props.store.setUser(t),this.props.store.sendConversion(this.props.plugin.id,p,this.impressionToken)}for(let t of o)"open_widget"===t.action&&this.props.showWidget("list");for(let t of o)"close"===t.action&&i.Z.setTimeout((()=>this.setClose(!0)),100),"next_page"===t.action&&this.props.nextPage();for(let t of o){if(!t.url)continue;let e=t.url;if(e.startsWith("http://")||e.startsWith("https://")||(e="//"+e),"open_url"===t.action&&t.new_tab)return window.open(e,"_blank");if("open_url"===t.action&&!t.new_tab)return void(window.location.href=e)}}}renderButtons(t,e){let n=i.Z.get(this.props.plugin,"popup",{}),o=t.style||{},r=Object.assign({},o);delete r.justify_content,delete r.align_items,delete r.flex_direction,delete r.display,r.color=r.color||"#fff",r.font_weight=r.font_weight||"500",r.font_size=r.font_size||n.font_size||"14px",r.background=r.background||n.text_color,this.props.mobile&&t.mobile_style&&(r=Object.assign(r,t.mobile_style));let s=null;if(t.buttons.primary_enabled&&t.buttons.primary_text){let o=Object.assign({font_size:n.font_size||"14px"},e.primary_button);i.Z.get(t,"style.background")&&(o.background=t.style.background),i.Z.get(t,"style.color")&&(o.color=t.style.color),s=(0,l.h)("div",{class:"btn btn__primary ",style:this.js2css(r),onClick:t=>this.onButtonClick(t,"primary")},this.props.t.i18n(t.buttons.i18n_primary_text)||t.buttons.primary_text)}let a=null;if(t.buttons.secondary_enabled&&t.buttons.secondary_text){let i=Object.assign({font_size:n.font_size||"14px"},e.secondary_button);this.props.mobile&&t.mobile_style&&(i=Object.assign(i,t.mobile_style)),a=(0,l.h)("div",{class:"btn btn__secondary",style:this.js2css(i),onClick:t=>this.onButtonClick(t,"secondary")},this.props.t.i18n(t.buttons.i18n_secondary_text)||t.buttons.secondary_text)}return(0,l.h)("div",{class:"popup_component",style:this.js2css({display:"flex",flex_direction:o.flex_direction,align_items:o.align_items})},s,(0,l.h)("div",{style:this.js2css({width:"10px",height:"1px"})}),a)}js2css(t,e){let n=this.props.plugin.popup.spacer||10;return i.Z.js2css(t,e,{"@font_size":this.props.plugin.popup.font_size,"@font_family":this.props.plugin.popup.font_family,"@text_color":this.props.plugin.popup.text_color,"@faded_text_color":this.props.plugin.popup.faded_text_color,"@primary_color":this.props.plugin.popup.primary_color,"@spacer0":n/2+"px","@spacer":n+"px","@spacer2":2*n+"px","@spacer3":3*n+"px"})}renderSingleChoiceField(t){var e="form-control form-control__select "+this.props.plugin.popup.theme;let n=i.Z.map(t.options,(n=>(0,l.h)("label",{class:e},(0,l.h)("input",{type:"radio",name:t.key,value:n.value}),(0,l.h)("span",null,this.props.t.i18n(n.i18n_label)||n.label))));return(0,l.h)(l.HY,null,n)}renderDropdownField(t){let e=i.Z.map(t.options,(t=>(0,l.h)("option",{value:t.value},t.value))),n=i.Z.get(this.props.plugin,"popup.theme");var o="form-control form-control__select "+n;return"vintage"===n?(0,l.h)("div",{class:"form-control__text_container"},(0,l.h)("div",{class:"form-control_inside_label form-label vintage"},this.props.t.i18n(t.i18n_label)||t.label),(0,l.h)("select",{class:o,name:t.key},e)):(0,l.h)("select",{class:o,name:t.key},e)}renderMutiChoiceField(t){var e="form-control form-control__check "+this.props.plugin.popup.theme;let n=i.Z.map(t.options,(n=>(0,l.h)("label",{class:e},(0,l.h)("input",{required:t.is_required,type:"checkbox",name:t.key,value:n.value}),(0,l.h)("span",null,this.props.t.i18n(n.i18n_label)||n.label))));return(0,l.h)(l.HY,null,n)}renderTextField(t){let e=i.Z.get(this.props.plugin,"popup.theme");var n="form-control form-control__text "+e;return"simple"===e?(0,l.h)("input",{type:t.type,class:"form-control form-control__text simple",key:"form_field_"+t.key,name:t.key,placeholder:this.props.t.i18n(t.i18n_label)||t.label||this.props.t.i18n(t.i18n_placeholder)||t.placeholder}):"vintage"===e?(0,l.h)("div",{class:"form-control__text_container"},(0,l.h)("div",{class:"form-control_inside_label form-label vintage"},this.props.t.i18n(t.i18n_label)||t.label),(0,l.h)("input",{type:t.type,class:n,key:"form_field_"+t.key,name:t.key,placeholder:this.props.t.i18n(t.i18n_placeholder)||t.placeholder})):(0,l.h)("input",{type:t.type,class:n,key:"form_field_"+t.key,name:t.key,placeholder:this.props.t.i18n(t.i18n_placeholder)||t.placeholder})}renderMultilineTextField(t){let e=i.Z.get(this.props.plugin,"popup.theme");var n="form-control form-control__text "+e;return"simple"===e?(0,l.h)("textarea",{rows:"3",name:t.key,type:t.type,key:"form_field_"+t.key,class:"form-control form-control__text simple",style:this.js2css({overflow:"auto",resize:"none"}),placeholder:this.props.t.i18n(t.i18n_label)||t.label||this.props.t.i18n(t.i18n_placeholder)||t.placeholder}):"vintage"===e?(0,l.h)("div",{class:"form-control__text_container"},(0,l.h)("div",{class:"form-control_inside_label form-label vintage"},t.label),(0,l.h)("textarea",{rows:"3",name:t.key,type:t.type,key:"form_field_"+t.key,class:n,style:this.js2css({overflow:"auto",resize:"none"}),placeholder:this.props.t.i18n(t.i18n_label)||t.label||this.props.t.i18n(t.i18n_placeholder)||t.placeholder})):(0,l.h)("textarea",{rows:"3",name:t.key,type:t.type,key:"form_field_"+t.key,class:n,style:this.js2css({overflow:"auto",resize:"none"}),placeholder:this.props.t.i18n(t.i18n_placeholder)||t.placeholder})}renderFormComponent(t){let e=i.Z.get(this.props.plugin,"popup",{}),n=i.Z.map(t.form.fields,(t=>"email"===t.type?this.renderTextField(t):"single-choice"===t.type?this.renderSingleChoiceField(t):"multiple-choice"===t.type?this.renderMutiChoiceField(t):"multiline-text"===t.type?this.renderMultilineTextField(t):"text"===t.type?this.renderTextField(t):"dropdown"===t.type?this.renderDropdownField(t):void 0)),o=i.Z.get(e,"theme");return n=i.Z.map(n,((n,i)=>{let r=null,s=t.form.fields[i];r=(0,l.h)("div",{class:"form-label",style:this.js2css({color:e.text_color,font_family:e.font_family,font_size:e.font_size||"14px"})},this.props.t.i18n(s.i18n_label)||s.label),"vintage"===o&&"dropdown"===s.type&&(r=null),"vintage"!==o&&"simple"!==o||"email"!==s.type&&"text"!==s.type&&"multiline-text"!==s.type||(r=null);let a=null;return this.state.pressedSubmit&&!this.isFieldValid(s.key,s.validate)&&(a=(0,l.h)("div",{class:"text__danger ",style:this.js2css({margin_top:"5px",font_family:e.font_family,font_size:e.font_size})},this.props.t("invalid_field"))),this.state.pressedSubmit&&s.is_required&&this.isFieldEmpty(s.key)&&(a=(0,l.h)("div",{class:"text__danger ",style:this.js2css({margin_top:"5px",font_family:e.font_family,font_size:e.font_size})},this.props.t("required"))),(0,l.h)("div",{class:"field"},r,n,a)})),(0,l.h)("form",{style:this.js2css(t.style),class:"form popup_component",ref:this._formRef,onClick:t=>t.stopPropagation()},n)}renderComponents(t){let e=i.Z.find(t.components,(t=>"buttons"===t.type)),n=null;e&&(n=this.renderButtons(e,t));let o=0;return i.Z.map(t.components,((t,e)=>"image"===t.type?null:(o++,"buttons"===t.type?n:"follow_facebook"===t.type?this.renderFollowFacebook(t):"social_buttons"===t.type?this.renderSocialButtons(t):"line"===t.type?this.renderLineComponent(t):"text"===t.type?this.renderTextComponent(t,1===o):"form"===t.type?this.renderFormComponent(t):"countdown"===t.type?(0,l.h)("div",{class:"popup_component",onClick:t=>t.stopPropagation()},(0,l.h)(p,{destroy:this.props.destroy,t:this.props.t,com:t,store:this.props.store,plugin:this.props.plugin})):void 0)))}renderFollowFacebook(t){if(!i.Z.get(t,"follow_facebook.url"))return null;let e=this.props.mobile&&t.mobile_style||t.style,o={display:"flex",justify_content:e.justify_content},r={};return r.font_family=e.font_family||this.props.plugin.popup.font_family,r.font_size=e.font_size||this.props.plugin.popup.font_size||"14px",(0,l.h)("div",{class:"popup_component",style:this.js2css(o),onClick:t=>t.stopPropagation()},(0,l.h)("div",{class:"follow_fb_btn"},(0,l.h)("img",{alt:"follow",class:"follow_fb_btn__img",src:n(9639)}),(0,l.h)("span",{style:this.js2css(Object.assign({white_space:"nowrap",overflow:"hidden",text_overflow:"ellipsis"},r))},this.props.t("follow_us_on_facebook"))))}renderSocialButtons(t){let e=i.Z.get(t,"social_buttons.facebook"),o=null;e&&(o=(0,l.h)("a",{href:e,class:"social_button",target:"_blank"},(0,l.h)("img",{alt:"facebook",class:"social_button__img",src:n(7435)})));let r=i.Z.get(t,"social_buttons.zalo"),s=null;r&&(s=(0,l.h)("a",{href:r,class:"social_button",target:"_blank"},(0,l.h)("img",{alt:"zalo",class:"social_button__img",src:n(7298)})));let a=this.props.mobile&&t.mobile_style||t.style;return(0,l.h)("div",{class:"social_buttons popup_component",style:this.js2css(a),onClick:t=>t.stopPropagation()},o," ",s)}renderImageComponent(t,e){let n=Object.assign({pointer_events:"none"},this.props.mobile&&t.mobile_style||t.style,{position:"absolute"});return n.z_index||(n.z_index="-1"),(0,l.h)("div",{style:this.js2css(n)},(0,l.h)("div",{id:"image_component_"+this.props.plugin.id+"_"+this.getPageIndex()+"_"+e,style:this.js2css({width:"100%",height:"100%",background_image:`url("${encodeURI(i.Z.get(t,"image.url"))}")`,background_size:n.background_size||"cover",background_position:n.background_position||"auto"})}))}renderLineComponent(t){let e=this.props.mobile&&t.mobile_style||t.style;return(0,l.h)("div",{class:"popup_component",style:this.js2css(e)})}renderTextComponent(t,e){let n=i.Z.get(this.props.plugin,"popup",{}),o=Object.assign({color:n.text_color,font_family:n.font_family,font_size:n.font_size||"14px",white_space:"pre-wrap"},this.props.mobile&&t.mobile_style||t.style);return delete o.margin_top,(0,l.h)("div",{class:"text popup_component",style:this.js2css(o),onClick:t=>t.stopPropagation()},this.props.t.i18n(i.Z.get(t,"text.i18n_html"))||i.Z.get(t,"text.html"))}async refreshCSS(){let t=this.props.store.matchPlugin();if(!i.Z.find(t,(t=>t.id===this.props.plugin.id)))return;let e=(await d).default.default.toString();var n=i.Z.replaceCssVariablePlugin(e,this.props.plugin.popup);let o=i.Z.get(this.props.plugin,"popup.pages.0.extra_css",[]),r=i.Z.map(o,(t=>`#sbz92 ${t.selector} { ${this.js2css(t.style)}}`)).join("\n");n+=r,i.Z.setCss(this.props.plugin.id,this.$cssStyleDiv,n)}componentWillUnmount(){i.Z.setCss(this.props.plugin.id,this.$cssStyleDiv,"")}async componentDidMount(){this.$cssStyleDiv=document.getElementById("subiz-style-for-"+this.props.plugin.id),this.$cssStyleDiv||(this.$cssStyleDiv=document.createElement("style"),document.head.appendChild(this.$cssStyleDiv),this.$cssStyleDiv.type="text/css",this.$cssStyleDiv.id="subiz-style-for-"+this.props.plugin.id),this.props.store.onResetCSS(this,(()=>this.refreshCSS())),await this.refreshCSS(),i.Z.setTimeout((()=>{this.setState({cssready:!0}),this.setClose(!1)}),50)}calculateContainerCss(t,e){let n=t.position||"center",o=Object.assign({display:"flex"},this.props.mobile&&e.mobile_style||e.style,{max_width:"85%",max_height:"85%"}),r={};return i.Z.map(["left","top","right","bottom","box_shadow","transform"],(t=>{r[t]=o[t]})),r.position="absolute","center"!==n&&n||(r.top="50%",r.transform="translateY(-50%) translateX(-50%)",r.left="50%",delete r.right,delete r.bottom),"fullscreen"===n&&(r.top=0,r.left=0,r.right=0,r.bottom=0,r.display="flex",r.align_items="center",r.background=t.background,delete r.width,delete r.height,delete r.transform),"top-left"===n&&(r.top=r.top||"0px",r.left=r.left||"0px",delete r.transform,delete r.right,delete r.bottom),"top-right"===n&&(r.top=r.top||"0px",r.right=r.right||"0px",delete r.transform,delete r.left,delete r.bottom),"top-center"===n&&(r.transform="translateX(-50%)",r.left="50%",r.top=r.top||"0px",delete r.right,delete r.bottom),"middle-left"===n&&(r.top="50%",r.transform="translateY(-50%)",r.left=r.left||"0px",delete r.right,delete r.bottom),"middle-right"===n&&(r.top="50%",r.transform="translateY(-50%)",r.right=r.right||"0px",delete r.left,delete r.bottom),"bottom-left"===n&&(r.bottom=r.bottom||"0px",r.left=r.left||"0px",delete r.transform,delete r.top,delete r.right),"bottom-right"===n&&(r.bottom=r.bottom||"0px",r.right=r.right||"0px",delete r.transform,delete r.top,delete r.left),"bottom-center"===n&&(r.bottom=r.bottom||"0px",r.transform="translateX(-50%)",r.left="50%",delete r.top,delete r.right),r.width=o.width,r.height=o.height,r.max_width=o.max_width,r.max_height=o.max_height,r.display=o.display,r.border_radius=o.border_radius,r.overflow=o.overflow,r.box_shadow=o.box_shadow,t.type&&"modal"!==t.type||(r.max_width="80%",r.max_height="95%"),"fullscreen"===n&&(r.width="100%",r.height="100%",r.max_width="100%",r.max_height="100%"),"bar"===t.type&&(r.width=o.width||"100%",r.max_width="100%"),r}render(){if(!this.props.t)return null;if(!this.state.cssready)return null;if(!this.state.imageReady)return null;if(!this.state.fontReady)return null;if(this.state.close)return null;let t=i.Z.get(this.props.plugin,"popup",{}),e=i.Z.get(t,`pages.${this.getPageIndex()}`);if(!e)return null;let n=Object.assign({},this.props.mobile&&e.mobile_style||e.style),o=this.calculateContainerCss(t,e),r="",s=i.Z.get(this.props.plugin,"popup.position","center");"center"!==s&&s||(r="zoomInCenter",this.state.closeAnimation&&(r="zoomOutCenter")),"bottom-left"!==s&&"bottom-right"!==s||(r="fadeInUpBig"),"top-left"!==s&&"top-right"!==s||(r="fadeInDown"),"top-center"===s&&(r="fadeInDownCenter"),"middle-left"===s&&(r="fadeInLeftBig"),"middle-right"===s&&(r="fadeInRightBig"),"bottom-center"===s&&(r="fadeInUpCenter");let a=i.Z.get(e,"layout");this.props.mobile&&(a=i.Z.get(e,"mobile_layout"));let p={display:n.display,align_items:n.align_items,justify_content:n.justify_content,padding_top:n.padding_top,padding_left:n.padding_left,padding_right:n.padding_right,padding_bottom:n.padding_bottom,background:n.background||t.background||"#fff",border:n.border,overflow:"row"===a?"auto":"",max_height:"row"===a?"100%":"",min_height:"row"===a?"100%":""},u={overflow:"column"===a?"auto":"",max_height:"column"===a?"100%":"",width:"100%",position:"relative",padding_top:n.margin_top,padding_left:n.margin_left,padding_right:n.margin_right,padding_bottom:n.margin_bottom};"padding"===this.props.highlight&&(u.background="#bad14a87",p.background="#ff3d006e");let c="position: fixed !important;";this.props.plugin._preview&&(c="position: absolute !important;"),t.overlay&&(c+=" background: #000c !important;");let d=i.Z.map(e.components,((t,e)=>{if("image"===t.type)return this.renderImageComponent(t,e)}));return i.Z.filter(e.components,(t=>"image"!==t.type)).length||(p.background="transparent",p.padding_top="0",p.padding_bottom="0",p.padding_left="0",p.padding_right="0"),(0,l.h)("div",{class:"overlay",style:c},(0,l.h)("div",{class:r,style:this.js2css(o),onClick:t=>t.stopPropagation()},this.renderCloseButton(),(0,l.h)("div",{style:this.js2css(u),onClick:t=>this.onButtonClick(t,"background")},d,(0,l.h)("div",{style:this.js2css(p),form:!0},this.renderComponents(e)))))}}},9980:t=>{t.exports=function(){if(!t)var t={};var e=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}();return t.exports=function(t){var n=t.DOM,i=(t.Animation.animate,t.Extension),o=t.Date.performance,r=t.View,s=r.rooter,a=r.destroyer,l=r.drawer,p=r.updater,u=r.styler,c=i.getExtension(i.Type.EASING_FUNCTION,"ease-out-cubic"),d=i.getExtension(i.Type.EASING_FUNCTION,"ease-out-sine"),f=function(t){if(t.isInitialValue()){t.root.textContent="",t.spacer=n.create("span","tick-flip-spacer"),t.root.appendChild(t.spacer);var e=n.create("span","tick-flip-shadow-top tick-flip-shadow tick-flip-front"),r=n.create("span","tick-flip-shadow-bottom tick-flip-shadow tick-flip-back");t.root.appendChild(e),t.root.appendChild(r),t.shadowCard=n.create("span","tick-flip-card-shadow"),t.root.appendChild(t.shadowCard)}if(t.spacer.textContent=t.value,t.isInitialValue()||n.visible(t.root)){var s=t.cards[t.cards.length-1];if(s&&(s.waiting=!1,s.offset=o(),s.back=t.value),t.isInitialValue()){var a=new h;a.back=t.value,a.offset=null,a.progress=1,t.root.insertBefore(a.root,t.root.firstChild),t.cards.push(a)}var l=new h;if(l.offset=null,l.progress=0,l.visual_progress=0,l.waiting=!0,l.front=t.value,l.rotate(0),t.root.insertBefore(l.root,t.root.firstChild),t.cards.push(l),!t.animating){t.animating=!0;var p=i.getExtension(i.Type.EASING_FUNCTION,t.style.flipEasing);!function e(){var i=t.cards.filter((function(t){return!t.done&&!t.waiting}));if(0!==i.length){i.forEach((function(e){null!==e.offset&&(e.progress=(o()-e.offset)/t.style.flipDuration),e.progress>=1&&(e.progress=1,e.done=!0),e.visual_progress=p(e.progress)})),i.reverse().forEach((function(t,e){var n=i[e-1];n&&t.visual_progress<=n.visual_progress&&(t.visual_progress=n.visual_progress+.01)})),i.reverse(),t.cards.forEach((function(e,n){var i=1-2*Math.abs(e.visual_progress-.5),o=1-(e.visual_progress-.5)/.5;e.shadowFront=i,e.highlightBack=o;var r=t.cards[n+1];r&&e.visual_progress>.5&&e.visual_progress>0&&(e.shadowBack=c(r.visual_progress))})),i.forEach((function(t,e){var n=t.visual_progress;n>.5&&!t.done?t.root.style.setProperty("z-index",10+e,"important"):t.root.style.removeProperty("z-index"),t.rotate(-180*n)}));var r=0,s=1;i.forEach((function(t){var e=Math.abs(t.visual_progress-.5);e<s&&(s=e,r=t.visual_progress)}));var a=d(r<.5?r/.5:(1-r)/.5);t.shadowCard.style.setProperty("opacity",a,"important"),n.transform(t.shadowCard,"scaleY",a),t.cards.filter((function(t){return t.done})).slice(0,-1).forEach((function(e){t.cards=t.cards.filter((function(t){return t!==e})),e.root.parentNode&&t.root.removeChild(e.root)})),requestAnimationFrame(e)}else t.animating=!1}()}}else t.cards.forEach((function(e){e.back=t.value,e.front=t.value}))},h=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this._root=n.create("span","tick-flip-card");var e=n.create("span","tick-flip-panel-front tick-flip-front tick-flip-panel"),i=n.create("span","tick-flip-panel-front-text"),o=n.create("span","tick-flip-panel-text-wrapper");i.appendChild(o);var r=n.create("span","tick-flip-panel-front-shadow");e.appendChild(i),e.appendChild(r);var s=n.create("span","tick-flip-panel-back tick-flip-back tick-flip-panel"),a=n.create("span","tick-flip-panel-back-text"),l=n.create("span","tick-flip-panel-text-wrapper");a.appendChild(l);var p=n.create("span","tick-flip-panel-back-highlight"),u=n.create("span","tick-flip-panel-back-shadow");s.appendChild(a),s.appendChild(p),s.appendChild(u),this._root.appendChild(e),this._root.appendChild(s),this._front=e,this._back=s,this._shadowFront=r,this._shadowBack=u,this._highlightBack=p,this._textBack=l,this._textFront=o,this._frontValue=null,this._backValue=null}return e(t,[{key:"rotate",value:function(t){this._front.style.setProperty("transform","rotateX("+t+"deg)","important"),this._back.style.setProperty("transform","rotateX("+(-180+t)+"deg)","important")}},{key:"root",get:function(){return this._root}},{key:"front",set:function(t){this._frontValue=t,this._textFront.textContent=t},get:function(){return this._frontValue}},{key:"back",set:function(t){this._backValue=t,this._textBack.textContent=t},get:function(){return this._backValue}},{key:"highlightBack",set:function(t){this._highlightBack.style.setProperty("opacity",t,"important")}},{key:"shadowBack",set:function(t){this._shadowBack.style.setProperty("opacity",t,"important")}},{key:"shadowFront",set:function(t){this._shadowFront.style.setProperty("opacity",t,"important")}}]),t}();return function(t){var e={cards:[],lastCard:null,initialCard:null,shadowAbove:null,shadowBelow:null,shadowCard:null,currentValue:null,lastValue:null,front:null,back:null};return Object.assign({},s(e,t,"flip"),p(e),u(e,{flipDuration:800,flipEasing:"ease-out-bounce"}),l(e,f),a(e))}},t.exports.identifier={name:"flip",type:"view"},t.exports}()},7435:(t,e,n)=>{t.exports=n.p+"assets/img/Facebook.64607ec.png"},7298:(t,e,n)=>{t.exports=n.p+"assets/img/Zalo.6845707.png"},9639:(t,e,n)=>{t.exports=n.p+"assets/img/fb_inverse_circle.36c2cfc.png"}}]);
|
package/dist/18b1ceaf2e0.335.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_subiz_widget_v4=self.webpackChunk_subiz_widget_v4||[]).push([[335],{2335:(t,e,s)=>{s.r(e),s.d(e,{DEFVAL:()=>p,default:()=>r,replaceCssVariable:()=>l});var i=s(4494),a=s(6400),o=s(2493);let n=s.e(678).then(s.bind(s,2678));class r extends o.up{constructor(t){var e,s,i;super(t),e=this,i={map:!1,map_loading:!1,map_initialized:!1},(s=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var s=t[Symbol.toPrimitive];if(void 0!==s){var i=s.call(t,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}(s="state"))in e?Object.defineProperty(e,s,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[s]=i,this.showMap=this.showMap.bind(this),this.hideMap=this.hideMap.bind(this)}async initMap(){this.map_initialized||(this.setState({map_initialized:!0,map_loading:!0}),await new Loader({apiKey:"YOUR_API_KEY",version:"weekly"}).load(),this.gmap=new google.maps.Map(document.getElementById("map")),this.setState({map_loading:!1}))}js2css(t,e){return i.Z.js2css(t,e,{"@font_size":this.props.plugin.popup.font_size,"@font_family":this.props.plugin.popup.font_family,"@text_color":this.props.plugin.popup.text_color,"@primary_color":this.props.plugin.popup.primary_color,"@background":this.props.plugin.popup.background,"@spacer0":spacer/2+"px","@spacer":spacer+"px","@spacer2":2*spacer+"px","@spacer3":3*spacer+"px"})}renderMapButton(t){let e=(0,a.h)("svg",{width:"20px","aria-hidden":"true",focusable:"false","data-prefix":"fas","data-icon":"map-marker-alt",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 384 512",class:"svg-inline--fa fa-map-marker-alt fa-w-12 fa-3x"},(0,a.h)("path",{fill:"red",d:"M172.268 501.67C26.97 291.031 0 269.413 0 192 0 85.961 85.961 0 192 0s192 85.961 192 192c0 77.413-26.97 99.031-172.268 309.67-9.535 13.774-29.93 13.773-39.464 0zM192 272c44.183 0 80-35.817 80-80s-35.817-80-80-80-80 35.817-80 80 35.817 80 80 80z",class:""}));return(0,a.h)("div",{class:"contact_button",onClick:this.showMap},this.renderMapModal(t),e)}async setMap(t,e){console.log("HEE"),await this.initMap(),console.log("HEE22"),window.gmap=this.gmap,this.gmap.map.setCenter(new google.maps.LatLng(t,e))}renderMapModal(t){let e="map_modal";this.state.map?e+=" map_modal__show":e+=" map_modal__hide";let s="overlay";this.state.map||(s+=" overlay__hidden");let o=i.Z.map(t.map.locations,(t=>(0,a.h)("div",{class:"map_location",onClick:e=>this.setMap(t.latitude,t.longitude)},(0,a.h)("div",null,t.name),(0,a.h)("div",null,t.latitude),(0,a.h)("div",null,t.longitude))));o.unshift((0,a.h)("div",{class:"map_title"},t.map.title));let n=(0,a.h)("div",{id:"map",style:"height: 100%; width: 100%"}," ");return(0,a.h)("div",{class:s,onClick:this.hideMap},(0,a.h)("div",{class:e,onClick:t=>t.stopPropagation()},(0,a.h)("div",{class:"map_body"},(0,a.h)("div",{class:"map_locations"},o),n,(0,a.h)("div",{class:"mapouter"},(0,a.h)("div",{class:"gmap_canvas"},(0,a.h)("iframe",{width:"300",height:"400",id:"gmap_canvas",src:"https://maps.google.com/maps?q=2880%20Broadway,%20New%20York&t=&z=13&ie=UTF8&iwloc=&output=embed",frameborder:"0",scrolling:"no",marginheight:"0",marginwidth:"0"}))))))}hideMap(t){t.stopPropagation(),this.setState({map:!1})}showMap(){this.setState({map:!0})}renderZaloButton(t){let e=(0,a.h)("svg",{width:"20px ","aria-hidden":"true",focusable:"false","data-prefix":"fab","data-icon":"facebook-f",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 320 512",class:"svg-inline--fa fa-facebook-f fa-w-10 fa-5x"},(0,a.h)("path",{fill:"currentColor",d:"M279.14 288l14.22-92.66h-88.91v-60.13c0-25.35 12.42-50.06 52.24-50.06h40.42V6.26S260.43 0 225.36 0c-73.22 0-121.08 44.38-121.08 124.72v70.62H22.89V288h81.39v224h100.17V288z",class:""}));return(0,a.h)("div",{class:"contact_button"},e)}renderFacebookButton(t){let e=(0,a.h)("svg",{width:"20px ","aria-hidden":"true",focusable:"false","data-prefix":"fab","data-icon":"facebook-f",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 320 512",class:"svg-inline--fa fa-facebook-f fa-w-10 fa-5x"},(0,a.h)("path",{fill:"currentColor",d:"M279.14 288l14.22-92.66h-88.91v-60.13c0-25.35 12.42-50.06 52.24-50.06h40.42V6.26S260.43 0 225.36 0c-73.22 0-121.08 44.38-121.08 124.72v70.62H22.89V288h81.39v224h100.17V288z",class:""}));return(0,a.h)("div",{class:"contact_button"},e)}renderChatButton(){return(0,a.h)("div",null,"Chat")}renderCallButton(){let t=(0,a.h)("svg",{width:"20px","aria-hidden":"true",focusable:"false","data-prefix":"fas","data-icon":"phone",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",class:"svg-inline--fa fa-phone fa-w-16 fa-7x"},(0,a.h)("path",{fill:"currentColor",d:"M493.4 24.6l-104-24c-11.3-2.6-22.9 3.3-27.5 13.9l-48 112c-4.2 9.8-1.4 21.3 6.9 28l60.6 49.6c-36 76.7-98.9 140.5-177.2 177.2l-49.6-60.6c-6.8-8.3-18.2-11.1-28-6.9l-112 48C3.9 366.5-2 378.1.6 389.4l24 104C27.1 504.2 36.7 512 48 512c256.1 0 464-207.5 464-464 0-11.2-7.7-20.9-18.6-23.4z",class:""}));return(0,a.h)("div",null,t)}renderButtons(t){return 0===i.Z.size(t)?null:i.Z.map(t,(t=>"map"===t.type?this.renderMapButton(t):"zalo"===t.type?this.renderZaloButton(t):"facebook"===t.type?this.renderFacebookButton(t):"call"===t.type?this.renderCallButton(t):"chat"===t.type?this.renderChatButton(t):null))}renderByLayoutSideByStandard(){let t=this.renderButtons(this.props.plugin.contact.buttons);return(0,a.h)("div",null,t)}renderLineComponent(t){let e=Object.assign({},t.style,this.props.mobile?t.mobile_style:{});return(0,a.h)("div",{style:this.js2css(e)})}renderTextComponent(t){let e=Object.assign({},t.style,this.props.mobile?t.mobile_style:{});return(0,a.h)("div",{class:"text",style:this.js2css(e),dangerouslySetInnerHTML:{__html:i.Z.get(t,"text.html")}})}async refreshCSS(){var t=l((await n).default.default.toString(),this.props.plugin.popup);i.Z.setCss(this.props.plugin.id,this.$cssStyleDiv,t),this.setState({cssready:!0})}componentDidMount(){this.$cssStyleDiv=document.createElement("style"),document.head.appendChild(this.$cssStyleDiv),this.$cssStyleDiv.type="text/css",this.$cssStyleDiv.id="subiz-style-for-"+this.props.plugin.id,this.refreshCSS();let t=JSON.stringify(this.props.plugin);this.setState({pluginjson:t})}render(){if(!this.state.cssready)return null;let t=JSON.stringify(this.props.plugin);if(this.state.pluginjson!==t&&(this.refreshCSS(),i.Z.setTimeout((()=>this.setState({pluginjson:t})))),this.state.close)return null;let e,s,o,n,r,l=i.Z.get(this.props.plugin,"contact.layout","standard"),p=null;"standard"!==l&&l||(p=this.renderByLayoutSideByStandard()),"footer"===l&&(p=this.renderByLayoutFooter(i.Z.get(this.props.plugin,`popup.pages.${this.state.pageIndex}`))),"mini"===l&&(p=this.renderByLayoutMini(i.Z.get(this.props.plugin,`popup.pages.${this.state.pageIndex}`))),"docked"===l&&(p=this.renderByLayoutDocked(i.Z.get(this.props.plugin,`popup.pages.${this.state.pageIndex}`)));let h=i.Z.get(this.props.plugin,"contact.position","bottom-left");return"center-left"===h?(e="0",n="50%",r="translateY(-50%)"):"top-left"===h?(e="0",n="20px"):"bottom-right"===h?(s="0",o="20px"):"center-right"===h?(s="0",n="50%",r="translateY(-50%)"):"top-right"===h?(s="0",n="20px"):(e="0",o="20px"),(0,a.h)("div",{style:i.Z.js2css({position:"absolute",left:e,right:s,bottom:o,top:n,transform:r,display:"flex",align_items:"center",justify_content:"center",overflow:"hidden"}),onClick:t=>t.stopPropagation()},p)}}function l(t,e){var s=[t];s=i.Z.tokenize(s,"'@font_family'"),s=i.Z.tokenize(s,"'@font_size'"),s=i.Z.tokenize(s,"'@text_color'"),s=i.Z.tokenize(s,"'@primary_color'"),s=i.Z.tokenize(s,"'@background'"),s=i.Z.tokenize(s,"'@spacer'"),s=i.Z.tokenize(s,"'@spacer0'"),s=i.Z.tokenize(s,"'@spacer2'"),s=i.Z.tokenize(s,"'@spacer3'");for(var a=[],o=0;o<s.length;o++){var n=s[o];if("string"!=typeof n){var r=n.type.substr(2,n.type.length-3),l=i.Z.get(e,r)||i.Z.get(p,r)||"";a.push(l)}else a.push(n)}return a.join("")}const p={font_size:"16px",font_family:"roboto",text_color:"#333",primary_color:"#333"}}}]);
|
package/dist/18b1ceaf2e0.605.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_subiz_widget_v4=self.webpackChunk_subiz_widget_v4||[]).push([[605],{9605:(t,e,s)=>{s.r(e),s.d(e,{default:()=>l});var i=s(4494),o=s(6400),n=s(2493);let a=s.e(362).then(s.bind(s,362));class l extends n.up{constructor(t){var e,s,o;super(t),e=this,o={close:!0,cssready:!1,closeAnimation:!0,imageReady:!1,user:{},timestamp:"",message:"",title:"",last_show:0},(s=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var s=t[Symbol.toPrimitive];if(void 0!==s){var i=s.call(t,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}(s="state"))in e?Object.defineProperty(e,s,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[s]=o,i.Z.setTimeout((async()=>{let{body:t}=await this.props.store.sendImpression(this.props.plugin.id);this.impressionToken=i.Z.get(t,"impression_token")||"";let e=i.Z.get(this.props,"plugin.notification.background_url");i.Z.preloadImg(e,(()=>this.setState({imageReady:!0})))}))}setOver(t){this.mouse_leave=t?0:i.Z.Date.now()}randomTimestampt(){let t=Math.floor(5*Math.random());return 0==t?this.props.t("just_now"):1==t?"1 "+this.props.t("minute_ago"):2==t?"2 "+this.props.t("minutes_ago"):3==t?"3 "+this.props.t("minutes_ago"):"4 "+this.props.t("minutes_ago")}onClick(t){if(t.stopPropagation(),this.props.plugin._dont_follow)return;this.props.store.sendConversion(this.props.plugin.id,null,this.impressionToken);let e=i.Z.get(this.props,"plugin.notification.url");return e?(e.startsWith("http://")||e.startsWith("https://")||(e="//"+e),i.Z.get(this.props,"plugin.notification.new_tab",!1)?window.open(e):void(window.location.href=e)):void 0}onCloseButtonClick(t){t.preventDefault(),t.stopPropagation(),this.setClose(!0)}renderCloseButton(){return(0,o.h)("div",{class:"btn_close",onClick:t=>this.onCloseButtonClick(t)},(0,o.h)("svg",{class:"btn_close__icon",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24","stroke-linecap":"round","stroke-linejoin":"round"},(0,o.h)("line",{x1:"18",y1:"6",x2:"6",y2:"18",style:"stroke-width: 3 !important;"}),(0,o.h)("line",{x1:"6",y1:"6",x2:"18",y2:"18",style:"stroke-width: 3 !important;"})))}async waitForT(){if(!this.props.t)return await i.Z.sleep(100),this.waitForT()}async setClose(t){if(await this.waitForT(),this.props.t){if(!t){i.Z.clearTimeout(this.lastCloseTimeout),this.setState({closeAnimation:!1});let t=this.randomTimestampt(),e=i.Z.get(this.props,"plugin.notification.profiles",[]),s=e[Math.floor(Math.random()*i.Z.size(e))]||{};s.avatar_url&&s.avatar_url.startsWith("http")&&await i.Z.preloadImg(s.avatar_url),i.Z.map(i.Z.get(this.props.plugin,"notification.custom_avatar_urls"),(t=>{e.push({type:"person",fullname:r(),avatar_url:t,email:r().split(" ").join(".").toLowerCase()+"@gmail.com",address:h(),phone:"+84"+Math.floor(10*Math.random())+Math.floor(10*Math.random())+Math.floor(10*Math.random())+Math.floor(10*Math.random())+Math.floor(10*Math.random())+Math.floor(10*Math.random())+"xxxx",age:15+Math.floor(20*Math.random())})}));let o=i.Z.get(this.props,"plugin.notification.i18n_message_quill_deltas",[]),n=o[Math.floor(Math.random()*i.Z.size(o))],a=i.Z.get(this.props,"plugin.notification.message_quill_deltas",[]),l=a[Math.floor(Math.random()*i.Z.size(a))],p=i.Z.get(this.props,"plugin.notification.i18n_title_quill_delta");return this.setState({close:!1,last_show:i.Z.Date.now(),timestamp:t,user:s,title:this.props.t.i18n(p)||i.Z.get(this.props,"plugin.notification.title_quill_delta"),message:this.props.t.i18n(n)||l})}this.setState({closeAnimation:!0}),this.mouse_leave=i.Z.Date.now(),this.lastCloseTimeout=i.Z.setTimeout((()=>this.setState({close:!0,closeAnimation:!1})),150),this.props.plugin._dont_close&&i.Z.setTimeout((()=>this.setState({closeAnimation:!1,close:!1})),1e3)}}async refreshCSS(){let t=this.props.store.matchPlugin();if(!i.Z.find(t,(t=>t.id===this.props.plugin.id)))return;let e=(await a).default.default.toString();i.Z.setCss(this.props.plugin.id,this.$cssStyleDiv,e),this.setClose(this.state.close)}componentWillUnmount(){i.Z.clearInterval(this.interval),i.Z.setCss(this.props.plugin.id,this.$cssStyleDiv,"")}async componentDidMount(){this.setState({last_show:i.Z.Date.now()}),this.$cssStyleDiv=document.getElementById("subiz-style-for-"+this.props.plugin.id),this.$cssStyleDiv||(this.$cssStyleDiv=document.createElement("style"),document.head.appendChild(this.$cssStyleDiv),this.$cssStyleDiv.type="text/css",this.$cssStyleDiv.id="subiz-style-for-"+this.props.plugin.id),this.props.store.onResetCSS(this,(()=>this.refreshCSS())),await this.refreshCSS(),this.interval=i.Z.setInterval((()=>{if(this.props._destroy)return this.componentWillUnmount();let t=this.mouse_leave;return 0===t&&(t=i.Z.Date.now()),i.Z.Date.now()-t<1e3?void 0:this.state.close||this.props.plugin._dont_close?i.Z.Date.now()-this.state.last_show>this.props.plugin.notification.interval_sec?this.setClose(!1):void 0:i.Z.Date.now()-this.state.last_show>8e3?this.setClose(!0):void 0}),1e3),i.Z.setTimeout((()=>{this.setState({cssready:!0}),this.setClose(!1)}),50)}renderTextFromQuillDelta(t,e){let s=i.Z.parseJSON(t);if(!s||!s.ops)return null;let n=i.Z.map(s.ops,(t=>{let s=null;if(!t.insert)return null;if("string"==typeof t.insert&&(s=t.insert),i.Z.get(t,"insert.dynamicField")){let o=i.Z.get(t,"insert.dynamicField.key");"user.fullname"===o&&(s=e.fullname),"user.email"===o&&(s=e.email),"user.address"===o&&(s=e.address),"user.phone"===o&&(s=e.phone)}return i.Z.get(t,"attributes.bold")&&(s=(0,o.h)("b",null,s)),i.Z.get(t,"attributes.italic")&&(s=(0,o.h)("b",null,s)),s})).filter((t=>t));return 1!=n.length||"\n"!=n[0]&&""!=n[0]?n:[]}render(){if(!this.props.t)return null;if(!this.state.cssready)return null;if(!this.state.imageReady)return null;if(this.state.close)return null;if(!this.state.message)return null;let t=i.Z.get(this.props.plugin,"notification",{});if(!t)return null;let e="",s=i.Z.get(t,"position","bottom-left");this.props.mobile&&(s=i.Z.get(t,"mobile_position",s)),"top-left"===s||"top-right"===s?e="fadeInDown":"top-center"===s?e="fadeInDownCenter":"bottom-center"===s?e="fadeInUpCenter":("bottom-right"===s||(s="bottom-left"),e="fadeInUpBig");let n=this.state.user||{},a=t.subtext_style||{};void 0===a.color&&(a.color=i.Z.get(t,"message_style.color","black"));let l="position: fixed !important; z-index: 1000000000 !important";this.props.plugin._preview&&(l="position: absolute !important;"),this.state.closeAnimation&&(e="fadeOut");let r=null;n.avatar_url&&(r=(0,o.h)("img",{alt:"notification avatar",class:"notif_avatar__img",src:n.avatar_url}));let h=(0,o.h)("div",{class:"notif_time",style:i.Z.js2css(t.subtext_style)},this.state.timestamp),p=this.renderTextFromQuillDelta(this.state.title,n),u=this.renderTextFromQuillDelta(this.state.message,n);return i.Z.size(p)||i.Z.size(u)||(h=null),(0,o.h)("div",{class:e+" notif notif__"+s,onClick:t=>this.onClick(t),onmouseover:t=>this.setOver(!0),style:l,onmouseleave:t=>this.setOver(!1)},(0,o.h)("div",{style:"position: relative !important; display: flex !important; align-items: center !important;"},(0,o.h)("img",{alt:"notification background",class:"notif_bg",src:t.background_url,style:i.Z.js2css(t.background_style)}),this.renderCloseButton(),(0,o.h)("div",{class:"notif_avatar",style:i.Z.js2css(t.avatar_style)},r),(0,o.h)("div",{class:"notif_body"},(0,o.h)("div",{class:"notif_title",style:i.Z.js2css(t.title_style)},p),(0,o.h)("div",{class:"notif_message",style:i.Z.js2css(t.message_style)},u),h)))}}function r(){let t=["Kiều Thanh","Phương Anh","Lê Thùy Linh","Trang Nguyễn","Thanh Hoa","Hoài Đức","Huơng Giang"];return t[Math.floor(Math.random()*t.length)]}function h(){let t=["Dịch Vọng Hậu, Cầu Giấy","Quận 1, TP Hồ Chí Minh","Ngõ 34 Tôn Thất Thuyết","87 Phạm Hùng","Đống Đa, Hà Nội"];return t[Math.floor(Math.random()*t.length)]}}}]);
|