Boxzilla - Version 3.2.21

Version Description

Download this release

Release Info

Developer DvanKooten
Plugin Icon 128x128 Boxzilla
Version 3.2.21
Comparing to
See all releases

Code changes from version 3.2.20 to 3.2.21

CHANGELOG.md CHANGED
@@ -1,6 +1,11 @@
1
  Changelog
2
  ==========
3
 
 
 
 
 
 
4
  #### 3.2.20 - Jan 20, 2020
5
 
6
  **Fixes**
1
  Changelog
2
  ==========
3
 
4
+ #### 3.2.21 - Feb 18, 2020
5
+
6
+ - "If post category" or "if post tag" conditionals now apply to any post-type using built-in WP categories or tags.
7
+
8
+
9
  #### 3.2.20 - Jan 20, 2020
10
 
11
  **Fixes**
assets/js/admin-script.js CHANGED
@@ -6,175 +6,168 @@ window.Boxzilla_Admin = require('./admin/_admin.js');
6
  },{"./admin/_admin.js":2}],2:[function(require,module,exports){
7
  "use strict";
8
 
9
- (function () {
10
- 'use strict';
11
-
12
- var $ = window.jQuery;
13
 
14
- var Option = require('./_option.js');
15
 
16
- var optionControls = document.getElementById('boxzilla-box-options-controls');
17
- var $optionControls = $(optionControls);
18
- var tnLoggedIn = document.createTextNode(' logged in'); // sanity check, are we on the correct page?
19
 
20
- if ($optionControls.length === 0) {
21
- return;
22
- }
23
 
24
- var EventEmitter = require('wolfy87-eventemitter');
25
 
26
- var events = new EventEmitter();
27
 
28
- var Designer = require('./_designer.js')($, Option, events);
 
 
 
 
29
 
30
- var rowTemplate = wp.template('rule-row-template');
31
- var i18n = boxzilla_i18n;
32
- var ruleComparisonEl = document.getElementById('boxzilla-rule-comparison');
33
- var rulesContainerEl = document.getElementById('boxzilla-box-rules'); // events
34
 
35
- $optionControls.on('click', ".boxzilla-add-rule", addRuleFields);
36
- $optionControls.on('click', ".boxzilla-remove-rule", removeRule);
37
- $optionControls.on('change', ".boxzilla-rule-condition", setContextualHelpers);
38
  $optionControls.find('.boxzilla-auto-show-trigger').on('change', toggleTriggerOptions);
39
  $(ruleComparisonEl).change(toggleAndOrTexts);
40
- $(window).load(function () {
41
- if (typeof window.tinyMCE === "undefined") {
42
- document.getElementById('notice-notinymce').style.display = '';
43
- }
44
- }); // call contextual helper method for each row
45
-
46
  $('.boxzilla-rule-row').each(setContextualHelpers);
 
47
 
48
- function toggleAndOrTexts() {
49
- var newText = ruleComparisonEl.value === 'any' ? i18n.or : i18n.and;
50
- $('.boxzilla-andor').text(newText);
51
- }
52
 
53
- function toggleTriggerOptions() {
54
- $optionControls.find('.boxzilla-trigger-options').toggle(this.value !== '');
55
- }
56
 
57
- function removeRule() {
58
- var row = $(this).parents('tr'); // delete andor row
59
 
60
- row.prev().remove(); // delete rule row
61
 
62
- row.remove();
63
- }
64
 
65
- function setContextualHelpers() {
66
- var context = this.tagName.toLowerCase() === "tr" ? this : $(this).parents('tr').get(0);
67
- var condition = context.querySelector('.boxzilla-rule-condition').value;
68
- var valueInput = context.querySelector('.boxzilla-rule-value');
69
- var qualifierInput = context.querySelector('.boxzilla-rule-qualifier');
70
- var betterInput = valueInput.cloneNode(true);
71
- var $betterInput = $(betterInput); // remove previously added helpers
72
-
73
- $(context.querySelectorAll('.boxzilla-helper')).remove(); // prepare better input
74
-
75
- betterInput.removeAttribute('name');
76
- betterInput.className = betterInput.className + ' boxzilla-helper';
77
- valueInput.parentNode.insertBefore(betterInput, valueInput.nextSibling);
78
- $betterInput.change(function () {
79
- valueInput.value = this.value;
80
- });
81
- betterInput.style.display = '';
82
- valueInput.style.display = 'none';
83
- qualifierInput.style.display = '';
84
- qualifierInput.querySelector('option[value="not_contains"]').style.display = 'none';
85
- qualifierInput.querySelector('option[value="contains"]').style.display = 'none';
86
-
87
- if (tnLoggedIn.parentNode) {
88
- tnLoggedIn.parentNode.removeChild(tnLoggedIn);
89
- } // change placeholder for textual help
90
-
91
-
92
- switch (condition) {
93
- default:
94
- betterInput.placeholder = i18n.enterCommaSeparatedValues;
95
- break;
96
-
97
- case '':
98
- case 'everywhere':
99
- qualifierInput.value = '1';
100
- valueInput.value = '';
101
- betterInput.style.display = 'none';
102
- qualifierInput.style.display = 'none';
103
- break;
104
-
105
- case 'is_single':
106
- case 'is_post':
107
- betterInput.placeholder = i18n.enterCommaSeparatedPosts;
108
- $betterInput.suggest(ajaxurl + "?action=boxzilla_autocomplete&type=post", {
109
- multiple: true,
110
- multipleSep: ","
111
- });
112
- break;
113
 
114
- case 'is_page':
115
- betterInput.placeholder = i18n.enterCommaSeparatedPages;
116
- $betterInput.suggest(ajaxurl + "?action=boxzilla_autocomplete&type=page", {
117
- multiple: true,
118
- multipleSep: ","
119
- });
120
- break;
121
 
122
- case 'is_post_type':
123
- betterInput.placeholder = i18n.enterCommaSeparatedPostTypes;
124
- $betterInput.suggest(ajaxurl + "?action=boxzilla_autocomplete&type=post_type", {
125
- multiple: true,
126
- multipleSep: ","
127
- });
128
- break;
129
-
130
- case 'is_url':
131
- qualifierInput.querySelector('option[value="contains"]').style.display = '';
132
- qualifierInput.querySelector('option[value="not_contains"]').style.display = '';
133
- betterInput.placeholder = i18n.enterCommaSeparatedRelativeUrls;
134
- break;
135
-
136
- case 'is_post_in_category':
137
- $betterInput.suggest(ajaxurl + "?action=boxzilla_autocomplete&type=category", {
138
- multiple: true,
139
- multipleSep: ","
140
- });
141
- break;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
142
 
143
- case 'is_post_with_tag':
144
- $betterInput.suggest(ajaxurl + "?action=boxzilla_autocomplete&type=post_tag", {
145
- multiple: true,
146
- multipleSep: ","
147
- });
148
- break;
 
149
 
150
- case 'is_user_logged_in':
151
- betterInput.style.display = 'none';
152
- valueInput.parentNode.insertBefore(tnLoggedIn, valueInput.nextSibling);
153
- break;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
154
 
155
- case 'is_referer':
156
- qualifierInput.querySelector('option[value="contains"]').style.display = '';
157
- qualifierInput.querySelector('option[value="not_contains"]').style.display = '';
158
- break;
159
- }
160
- }
161
 
162
- function addRuleFields() {
163
- var data = {
164
- 'key': optionControls.querySelectorAll('.boxzilla-rule-row').length,
165
- 'andor': ruleComparisonEl.value === 'any' ? i18n.or : i18n.and
166
- };
167
- var html = rowTemplate(data);
168
- $(rulesContainerEl).append(html);
169
- return false;
 
170
  }
 
171
 
172
- module.exports = {
173
- 'Designer': Designer,
174
- 'Option': Option,
175
- 'events': events
176
  };
177
- })();
 
 
 
 
 
 
 
 
 
178
 
179
  },{"./_designer.js":3,"./_option.js":4,"wolfy87-eventemitter":5}],3:[function(require,module,exports){
180
  "use strict";
@@ -183,43 +176,43 @@ function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterat
183
 
184
  var Designer = function Designer($, Option, events) {
185
  // vars
186
- var boxId = document.getElementById('post_ID').value || 0,
187
- $editor,
188
- $editorFrame,
189
- $innerEditor,
190
- options = {},
191
- visualEditorInitialised = false;
192
- var $appearanceControls = $("#boxzilla-box-appearance-controls"); // create Option objects
193
-
194
- options.borderColor = new Option('border-color');
195
- options.borderWidth = new Option('border-width');
196
- options.borderStyle = new Option('border-style');
197
- options.backgroundColor = new Option('background-color');
198
- options.width = new Option('width');
199
- options.color = new Option('color'); // functions
200
 
201
  function init() {
202
  // Only run if TinyMCE has actually inited
203
- if (_typeof(window.tinyMCE) !== "object" || tinyMCE.get('content') === null) {
204
  return;
205
- } // add classes to TinyMCE <html>
 
206
 
 
 
 
 
 
 
207
 
208
- $editorFrame = $("#content_ifr");
209
  $editor = $editorFrame.contents().find('html');
210
  $editor.css({
211
- 'background': 'white'
212
  }); // add content class and padding to TinyMCE <body>
213
 
214
  $innerEditor = $editor.find('#tinymce');
215
  $innerEditor.addClass('boxzilla boxzilla-' + boxId);
216
  $innerEditor.css({
217
- 'margin': 0,
218
- 'background': 'white',
219
- 'display': 'inline-block',
220
- 'width': 'auto',
221
  'min-width': '240px',
222
- 'position': 'relative'
223
  });
224
  $innerEditor.get(0).style.cssText += ';padding: 25px !important;';
225
  visualEditorInitialised = true;
@@ -237,23 +230,23 @@ var Designer = function Designer($, Option, events) {
237
  function applyStyles() {
238
  if (!visualEditorInitialised) {
239
  return false;
240
- } // Apply styles from CSS editor.
241
  // Use short timeout to make sure color values are updated.
242
 
243
 
244
  window.setTimeout(function () {
245
  $innerEditor.css({
246
  'border-color': options.borderColor.getColorValue(),
247
- //getColorValue( 'borderColor', '' ),
248
  'border-width': options.borderWidth.getPxValue(),
249
- //getPxValue( 'borderWidth', '' ),
250
  'border-style': options.borderStyle.getValue(),
251
- //getValue('borderStyle', '' ),
252
  'background-color': options.backgroundColor.getColorValue(),
253
- //getColorValue( 'backgroundColor', ''),
254
- 'width': options.width.getPxValue(),
255
- //getPxValue( 'width', 'auto' ),
256
- 'color': options.color.getColorValue() // getColorValue( 'color', '' )
257
 
258
  });
259
  /* @since 2.0.3 */
@@ -283,31 +276,31 @@ var Designer = function Designer($, Option, events) {
283
  change: applyStyles,
284
  clear: applyStyles
285
  });
286
- $appearanceControls.find(":input").not(".boxzilla-color-field").change(applyStyles);
287
  events.on('editor.init', applyStyles); // public methods
288
 
289
  return {
290
- 'init': init,
291
- 'resetStyles': resetStyles,
292
- 'options': options
293
  };
294
  };
295
 
296
  module.exports = Designer;
297
 
298
  },{}],4:[function(require,module,exports){
299
- 'use strict';
300
 
301
  var $ = window.jQuery;
302
 
303
  var Option = function Option(element) {
304
  // find corresponding element
305
- if (typeof element == "string") {
306
  element = document.getElementById('boxzilla-' + element);
307
  }
308
 
309
  if (!element) {
310
- console.error("Unable to find option element.");
311
  }
312
 
313
  this.element = element;
@@ -327,7 +320,7 @@ Option.prototype.getColorValue = function () {
327
 
328
  Option.prototype.getPxValue = function (fallbackValue) {
329
  if (this.element.value.length > 0) {
330
- return parseInt(this.element.value) + "px";
331
  }
332
 
333
  return fallbackValue || '';
@@ -353,7 +346,7 @@ module.exports = Option;
353
 
354
  },{}],5:[function(require,module,exports){
355
  /*!
356
- * EventEmitter v5.2.8 - git.io/ee
357
  * Unlicense - http://unlicense.org/
358
  * Oliver Caldwell - https://oli.me.uk/
359
  * @preserve
6
  },{"./admin/_admin.js":2}],2:[function(require,module,exports){
7
  "use strict";
8
 
9
+ var $ = window.jQuery;
 
 
 
10
 
11
+ var Option = require('./_option.js');
12
 
13
+ var optionControls = document.getElementById('boxzilla-box-options-controls');
14
+ var $optionControls = $(optionControls);
15
+ var tnLoggedIn = document.createTextNode(' logged in');
16
 
17
+ var EventEmitter = require('wolfy87-eventemitter');
 
 
18
 
19
+ var events = new EventEmitter();
20
 
21
+ var Designer = require('./_designer.js')($, Option, events);
22
 
23
+ var rowTemplate = window.wp.template('rule-row-template');
24
+ var i18n = window.boxzilla_i18n;
25
+ var ruleComparisonEl = document.getElementById('boxzilla-rule-comparison');
26
+ var rulesContainerEl = document.getElementById('boxzilla-box-rules');
27
+ var ajaxurl = window.ajaxurl; // events
28
 
29
+ $(window).load(function () {
30
+ if (typeof window.tinyMCE === 'undefined') {
31
+ document.getElementById('notice-notinymce').style.display = '';
32
+ }
33
 
34
+ $optionControls.on('click', '.boxzilla-add-rule', addRuleFields);
35
+ $optionControls.on('click', '.boxzilla-remove-rule', removeRule);
36
+ $optionControls.on('change', '.boxzilla-rule-condition', setContextualHelpers);
37
  $optionControls.find('.boxzilla-auto-show-trigger').on('change', toggleTriggerOptions);
38
  $(ruleComparisonEl).change(toggleAndOrTexts);
 
 
 
 
 
 
39
  $('.boxzilla-rule-row').each(setContextualHelpers);
40
+ });
41
 
42
+ function toggleAndOrTexts() {
43
+ var newText = ruleComparisonEl.value === 'any' ? i18n.or : i18n.and;
44
+ $('.boxzilla-andor').text(newText);
45
+ }
46
 
47
+ function toggleTriggerOptions() {
48
+ $optionControls.find('.boxzilla-trigger-options').toggle(this.value !== '');
49
+ }
50
 
51
+ function removeRule() {
52
+ var row = $(this).parents('tr'); // delete andor row
53
 
54
+ row.prev().remove(); // delete rule row
55
 
56
+ row.remove();
57
+ }
58
 
59
+ function setContextualHelpers() {
60
+ var context = this.tagName.toLowerCase() === 'tr' ? this : $(this).parents('tr').get(0);
61
+ var condition = context.querySelector('.boxzilla-rule-condition').value;
62
+ var valueInput = context.querySelector('.boxzilla-rule-value');
63
+ var qualifierInput = context.querySelector('.boxzilla-rule-qualifier');
64
+ var betterInput = valueInput.cloneNode(true);
65
+ var $betterInput = $(betterInput); // remove previously added helpers
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
66
 
67
+ $(context.querySelectorAll('.boxzilla-helper')).remove(); // prepare better input
 
 
 
 
 
 
68
 
69
+ betterInput.removeAttribute('name');
70
+ betterInput.className = betterInput.className + ' boxzilla-helper';
71
+ valueInput.parentNode.insertBefore(betterInput, valueInput.nextSibling);
72
+ $betterInput.change(function () {
73
+ valueInput.value = this.value;
74
+ });
75
+ betterInput.style.display = '';
76
+ valueInput.style.display = 'none';
77
+ qualifierInput.style.display = '';
78
+ qualifierInput.querySelector('option[value="not_contains"]').style.display = 'none';
79
+ qualifierInput.querySelector('option[value="contains"]').style.display = 'none';
80
+
81
+ if (tnLoggedIn.parentNode) {
82
+ tnLoggedIn.parentNode.removeChild(tnLoggedIn);
83
+ } // change placeholder for textual help
84
+
85
+
86
+ switch (condition) {
87
+ default:
88
+ betterInput.placeholder = i18n.enterCommaSeparatedValues;
89
+ break;
90
+
91
+ case '':
92
+ case 'everywhere':
93
+ qualifierInput.value = '1';
94
+ valueInput.value = '';
95
+ betterInput.style.display = 'none';
96
+ qualifierInput.style.display = 'none';
97
+ break;
98
+
99
+ case 'is_single':
100
+ case 'is_post':
101
+ betterInput.placeholder = i18n.enterCommaSeparatedPosts;
102
+ $betterInput.suggest(ajaxurl + '?action=boxzilla_autocomplete&type=post', {
103
+ multiple: true,
104
+ multipleSep: ','
105
+ });
106
+ break;
107
 
108
+ case 'is_page':
109
+ betterInput.placeholder = i18n.enterCommaSeparatedPages;
110
+ $betterInput.suggest(ajaxurl + '?action=boxzilla_autocomplete&type=page', {
111
+ multiple: true,
112
+ multipleSep: ','
113
+ });
114
+ break;
115
 
116
+ case 'is_post_type':
117
+ betterInput.placeholder = i18n.enterCommaSeparatedPostTypes;
118
+ $betterInput.suggest(ajaxurl + '?action=boxzilla_autocomplete&type=post_type', {
119
+ multiple: true,
120
+ multipleSep: ','
121
+ });
122
+ break;
123
+
124
+ case 'is_url':
125
+ qualifierInput.querySelector('option[value="contains"]').style.display = '';
126
+ qualifierInput.querySelector('option[value="not_contains"]').style.display = '';
127
+ betterInput.placeholder = i18n.enterCommaSeparatedRelativeUrls;
128
+ break;
129
+
130
+ case 'is_post_in_category':
131
+ $betterInput.suggest(ajaxurl + '?action=boxzilla_autocomplete&type=category', {
132
+ multiple: true,
133
+ multipleSep: ','
134
+ });
135
+ break;
136
 
137
+ case 'is_post_with_tag':
138
+ $betterInput.suggest(ajaxurl + '?action=boxzilla_autocomplete&type=post_tag', {
139
+ multiple: true,
140
+ multipleSep: ','
141
+ });
142
+ break;
143
 
144
+ case 'is_user_logged_in':
145
+ betterInput.style.display = 'none';
146
+ valueInput.parentNode.insertBefore(tnLoggedIn, valueInput.nextSibling);
147
+ break;
148
+
149
+ case 'is_referer':
150
+ qualifierInput.querySelector('option[value="contains"]').style.display = '';
151
+ qualifierInput.querySelector('option[value="not_contains"]').style.display = '';
152
+ break;
153
  }
154
+ }
155
 
156
+ function addRuleFields() {
157
+ var data = {
158
+ key: optionControls.querySelectorAll('.boxzilla-rule-row').length,
159
+ andor: ruleComparisonEl.value === 'any' ? i18n.or : i18n.and
160
  };
161
+ var html = rowTemplate(data);
162
+ $(rulesContainerEl).append(html);
163
+ return false;
164
+ }
165
+
166
+ module.exports = {
167
+ Designer: Designer,
168
+ Option: Option,
169
+ events: events
170
+ };
171
 
172
  },{"./_designer.js":3,"./_option.js":4,"wolfy87-eventemitter":5}],3:[function(require,module,exports){
173
  "use strict";
176
 
177
  var Designer = function Designer($, Option, events) {
178
  // vars
179
+ var boxId = document.getElementById('post_ID').value || 0;
180
+ var $editor;
181
+ var $editorFrame;
182
+ var $innerEditor;
183
+ var options = {};
184
+ var visualEditorInitialised = false;
185
+ var $appearanceControls = $('#boxzilla-box-appearance-controls'); // functions
 
 
 
 
 
 
 
186
 
187
  function init() {
188
  // Only run if TinyMCE has actually inited
189
+ if (_typeof(window.tinyMCE) !== 'object' || window.tinyMCE.get('content') === null) {
190
  return;
191
+ } // create Option objects
192
+
193
 
194
+ options.borderColor = new Option('border-color');
195
+ options.borderWidth = new Option('border-width');
196
+ options.borderStyle = new Option('border-style');
197
+ options.backgroundColor = new Option('background-color');
198
+ options.width = new Option('width');
199
+ options.color = new Option('color'); // add classes to TinyMCE <html>
200
 
201
+ $editorFrame = $('#content_ifr');
202
  $editor = $editorFrame.contents().find('html');
203
  $editor.css({
204
+ background: 'white'
205
  }); // add content class and padding to TinyMCE <body>
206
 
207
  $innerEditor = $editor.find('#tinymce');
208
  $innerEditor.addClass('boxzilla boxzilla-' + boxId);
209
  $innerEditor.css({
210
+ margin: 0,
211
+ background: 'white',
212
+ display: 'inline-block',
213
+ width: 'auto',
214
  'min-width': '240px',
215
+ position: 'relative'
216
  });
217
  $innerEditor.get(0).style.cssText += ';padding: 25px !important;';
218
  visualEditorInitialised = true;
230
  function applyStyles() {
231
  if (!visualEditorInitialised) {
232
  return false;
233
+ } // Apply styles from CSS editor.
234
  // Use short timeout to make sure color values are updated.
235
 
236
 
237
  window.setTimeout(function () {
238
  $innerEditor.css({
239
  'border-color': options.borderColor.getColorValue(),
240
+ // getColorValue( 'borderColor', '' ),
241
  'border-width': options.borderWidth.getPxValue(),
242
+ // getPxValue( 'borderWidth', '' ),
243
  'border-style': options.borderStyle.getValue(),
244
+ // getValue('borderStyle', '' ),
245
  'background-color': options.backgroundColor.getColorValue(),
246
+ // getColorValue( 'backgroundColor', ''),
247
+ width: options.width.getPxValue(),
248
+ // getPxValue( 'width', 'auto' ),
249
+ color: options.color.getColorValue() // getColorValue( 'color', '' )
250
 
251
  });
252
  /* @since 2.0.3 */
276
  change: applyStyles,
277
  clear: applyStyles
278
  });
279
+ $appearanceControls.find(':input').not('.boxzilla-color-field').change(applyStyles);
280
  events.on('editor.init', applyStyles); // public methods
281
 
282
  return {
283
+ init: init,
284
+ resetStyles: resetStyles,
285
+ options: options
286
  };
287
  };
288
 
289
  module.exports = Designer;
290
 
291
  },{}],4:[function(require,module,exports){
292
+ "use strict";
293
 
294
  var $ = window.jQuery;
295
 
296
  var Option = function Option(element) {
297
  // find corresponding element
298
+ if (typeof element === 'string') {
299
  element = document.getElementById('boxzilla-' + element);
300
  }
301
 
302
  if (!element) {
303
+ console.error('Unable to find option element.');
304
  }
305
 
306
  this.element = element;
320
 
321
  Option.prototype.getPxValue = function (fallbackValue) {
322
  if (this.element.value.length > 0) {
323
+ return parseInt(this.element.value) + 'px';
324
  }
325
 
326
  return fallbackValue || '';
346
 
347
  },{}],5:[function(require,module,exports){
348
  /*!
349
+ * EventEmitter v5.2.9 - git.io/ee
350
  * Unlicense - http://unlicense.org/
351
  * Oliver Caldwell - https://oli.me.uk/
352
  * @preserve
assets/js/admin-script.min.js CHANGED
@@ -1,2 +1,2 @@
1
- !function(){var s=void 0;!function i(l,s,a){function u(t,e){if(!s[t]){if(!l[t]){var n=!1;if(!e&&n)return n(t,!0);if(c)return c(t,!0);var o=new Error("Cannot find module '"+t+"'");throw o.code="MODULE_NOT_FOUND",o}var r=s[t]={exports:{}};l[t][0].call(r.exports,function(e){return u(l[t][1][e]||e)},r,r.exports,i,l,s,a)}return s[t].exports}for(var c=!1,e=0;e<a.length;e++)u(a[e]);return u}({1:[function(e,t,n){"use strict";window.Boxzilla_Admin=e("./admin/_admin.js")},{"./admin/_admin.js":2}],2:[function(d,f,e){"use strict";!function(){var l=window.jQuery,e=d("./_option.js"),n=document.getElementById("boxzilla-box-options-controls"),t=l(n),s=document.createTextNode(" logged in");if(0!==t.length){var o=new(d("wolfy87-eventemitter")),r=d("./_designer.js")(l,e,o),i=wp.template("rule-row-template"),a=boxzilla_i18n,u=document.getElementById("boxzilla-rule-comparison"),c=document.getElementById("boxzilla-box-rules");t.on("click",".boxzilla-add-rule",function(){var e={key:n.querySelectorAll(".boxzilla-rule-row").length,andor:"any"===u.value?a.or:a.and},t=i(e);return l(c).append(t),!1}),t.on("click",".boxzilla-remove-rule",function(){var e=l(this).parents("tr");e.prev().remove(),e.remove()}),t.on("change",".boxzilla-rule-condition",p),t.find(".boxzilla-auto-show-trigger").on("change",function(){t.find(".boxzilla-trigger-options").toggle(""!==this.value)}),l(u).change(function(){var e="any"===u.value?a.or:a.and;l(".boxzilla-andor").text(e)}),l(window).load(function(){void 0===window.tinyMCE&&(document.getElementById("notice-notinymce").style.display="")}),l(".boxzilla-rule-row").each(p),f.exports={Designer:r,Option:e,events:o}}function p(){var e="tr"===this.tagName.toLowerCase()?this:l(this).parents("tr").get(0),t=e.querySelector(".boxzilla-rule-condition").value,n=e.querySelector(".boxzilla-rule-value"),o=e.querySelector(".boxzilla-rule-qualifier"),r=n.cloneNode(!0),i=l(r);switch(l(e.querySelectorAll(".boxzilla-helper")).remove(),r.removeAttribute("name"),r.className=r.className+" boxzilla-helper",n.parentNode.insertBefore(r,n.nextSibling),i.change(function(){n.value=this.value}),r.style.display="",n.style.display="none",o.style.display="",o.querySelector('option[value="not_contains"]').style.display="none",o.querySelector('option[value="contains"]').style.display="none",s.parentNode&&s.parentNode.removeChild(s),t){default:r.placeholder=a.enterCommaSeparatedValues;break;case"":case"everywhere":o.value="1",n.value="",r.style.display="none",o.style.display="none";break;case"is_single":case"is_post":r.placeholder=a.enterCommaSeparatedPosts,i.suggest(ajaxurl+"?action=boxzilla_autocomplete&type=post",{multiple:!0,multipleSep:","});break;case"is_page":r.placeholder=a.enterCommaSeparatedPages,i.suggest(ajaxurl+"?action=boxzilla_autocomplete&type=page",{multiple:!0,multipleSep:","});break;case"is_post_type":r.placeholder=a.enterCommaSeparatedPostTypes,i.suggest(ajaxurl+"?action=boxzilla_autocomplete&type=post_type",{multiple:!0,multipleSep:","});break;case"is_url":o.querySelector('option[value="contains"]').style.display="",o.querySelector('option[value="not_contains"]').style.display="",r.placeholder=a.enterCommaSeparatedRelativeUrls;break;case"is_post_in_category":i.suggest(ajaxurl+"?action=boxzilla_autocomplete&type=category",{multiple:!0,multipleSep:","});break;case"is_post_with_tag":i.suggest(ajaxurl+"?action=boxzilla_autocomplete&type=post_tag",{multiple:!0,multipleSep:","});break;case"is_user_logged_in":r.style.display="none",n.parentNode.insertBefore(s,n.nextSibling);break;case"is_referer":o.querySelector('option[value="contains"]').style.display="",o.querySelector('option[value="not_contains"]').style.display=""}}}()},{"./_designer.js":3,"./_option.js":4,"wolfy87-eventemitter":5}],3:[function(e,t,n){"use strict";function p(e){return(p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}t.exports=function(e,t,n){var o,r,i,l=document.getElementById("post_ID").value||0,s={},a=!1,u=e("#boxzilla-box-appearance-controls");function c(){return!!a&&(window.setTimeout(function(){i.css({"border-color":s.borderColor.getColorValue(),"border-width":s.borderWidth.getPxValue(),"border-style":s.borderStyle.getValue(),"background-color":s.backgroundColor.getColorValue(),width:s.width.getPxValue(),color:s.color.getColorValue()}),n.trigger("editor.styles.apply")},10),!0)}return s.borderColor=new t("border-color"),s.borderWidth=new t("border-width"),s.borderStyle=new t("border-style"),s.backgroundColor=new t("background-color"),s.width=new t("width"),s.color=new t("color"),u.find("input.boxzilla-color-field").wpColorPicker({change:c,clear:c}),u.find(":input").not(".boxzilla-color-field").change(c),n.on("editor.init",c),{init:function(){"object"===p(window.tinyMCE)&&null!==tinyMCE.get("content")&&(r=e("#content_ifr"),(o=r.contents().find("html")).css({background:"white"}),(i=o.find("#tinymce")).addClass("boxzilla boxzilla-"+l),i.css({margin:0,background:"white",display:"inline-block",width:"auto","min-width":"240px",position:"relative"}),i.get(0).style.cssText+=";padding: 25px !important;",a=!0,n.trigger("editor.init"))},resetStyles:function(){for(var e in s)"theme"!==e.substring(0,5)&&s[e].clear();c(),n.trigger("editor.styles.reset")},options:s}}},{}],4:[function(e,t,n){"use strict";function o(e){"string"==typeof e&&(e=document.getElementById("boxzilla-"+e)),e||console.error("Unable to find option element."),this.element=e}var r=window.jQuery;o.prototype.getColorValue=function(){return 0<this.element.value.length?r(this.element).hasClass("wp-color-field")?r(this.element).wpColorPicker("color"):this.element.value:""},o.prototype.getPxValue=function(e){return 0<this.element.value.length?parseInt(this.element.value)+"px":e||""},o.prototype.getValue=function(e){return 0<this.element.value.length?this.element.value:e||""},o.prototype.clear=function(){this.element.value=""},o.prototype.setValue=function(e){this.element.value=e},t.exports=o},{}],5:[function(e,l,t){!function(e){"use strict";function t(){}var n=t.prototype,o=e.EventEmitter;function i(e,t){for(var n=e.length;n--;)if(e[n].listener===t)return n;return-1}function r(e){return function(){return this[e].apply(this,arguments)}}n.getListeners=function(e){var t,n,o=this._getEvents();if(e instanceof RegExp)for(n in t={},o)o.hasOwnProperty(n)&&e.test(n)&&(t[n]=o[n]);else t=o[e]||(o[e]=[]);return t},n.flattenListeners=function(e){var t,n=[];for(t=0;t<e.length;t+=1)n.push(e[t].listener);return n},n.getListenersAsObject=function(e){var t,n=this.getListeners(e);return n instanceof Array&&((t={})[e]=n),t||n},n.addListener=function(e,t){if(!function e(t){return"function"==typeof t||t instanceof RegExp||!(!t||"object"!=typeof t)&&e(t.listener)}(t))throw new TypeError("listener must be a function");var n,o=this.getListenersAsObject(e),r="object"==typeof t;for(n in o)o.hasOwnProperty(n)&&-1===i(o[n],t)&&o[n].push(r?t:{listener:t,once:!1});return this},n.on=r("addListener"),n.addOnceListener=function(e,t){return this.addListener(e,{listener:t,once:!0})},n.once=r("addOnceListener"),n.defineEvent=function(e){return this.getListeners(e),this},n.defineEvents=function(e){for(var t=0;t<e.length;t+=1)this.defineEvent(e[t]);return this},n.removeListener=function(e,t){var n,o,r=this.getListenersAsObject(e);for(o in r)r.hasOwnProperty(o)&&-1!==(n=i(r[o],t))&&r[o].splice(n,1);return this},n.off=r("removeListener"),n.addListeners=function(e,t){return this.manipulateListeners(!1,e,t)},n.removeListeners=function(e,t){return this.manipulateListeners(!0,e,t)},n.manipulateListeners=function(e,t,n){var o,r,i=e?this.removeListener:this.addListener,l=e?this.removeListeners:this.addListeners;if("object"!=typeof t||t instanceof RegExp)for(o=n.length;o--;)i.call(this,t,n[o]);else for(o in t)t.hasOwnProperty(o)&&(r=t[o])&&("function"==typeof r?i.call(this,o,r):l.call(this,o,r));return this},n.removeEvent=function(e){var t,n=typeof e,o=this._getEvents();if("string"==n)delete o[e];else if(e instanceof RegExp)for(t in o)o.hasOwnProperty(t)&&e.test(t)&&delete o[t];else delete this._events;return this},n.removeAllListeners=r("removeEvent"),n.emitEvent=function(e,t){var n,o,r,i,l=this.getListenersAsObject(e);for(i in l)if(l.hasOwnProperty(i))for(n=l[i].slice(0),r=0;r<n.length;r++)!0===(o=n[r]).once&&this.removeListener(e,o.listener),o.listener.apply(this,t||[])===this._getOnceReturnValue()&&this.removeListener(e,o.listener);return this},n.trigger=r("emitEvent"),n.emit=function(e){var t=Array.prototype.slice.call(arguments,1);return this.emitEvent(e,t)},n.setOnceReturnValue=function(e){return this._onceReturnValue=e,this},n._getOnceReturnValue=function(){return!this.hasOwnProperty("_onceReturnValue")||this._onceReturnValue},n._getEvents=function(){return this._events||(this._events={})},t.noConflict=function(){return e.EventEmitter=o,t},"function"==typeof s&&s.amd?s(function(){return t}):"object"==typeof l&&l.exports?l.exports=t:e.EventEmitter=t}("undefined"!=typeof window?window:this||{})},{}]},{},[1])}();
2
  //# sourceMappingURL=admin-script.min.js.map
1
+ !function(){var s=void 0;!function i(l,s,a){function u(t,e){if(!s[t]){if(!l[t]){var n=!1;if(!e&&n)return n(t,!0);if(c)return c(t,!0);var o=new Error("Cannot find module '"+t+"'");throw o.code="MODULE_NOT_FOUND",o}var r=s[t]={exports:{}};l[t][0].call(r.exports,function(e){return u(l[t][1][e]||e)},r,r.exports,i,l,s,a)}return s[t].exports}for(var c=!1,e=0;e<a.length;e++)u(a[e]);return u}({1:[function(e,t,n){"use strict";window.Boxzilla_Admin=e("./admin/_admin.js")},{"./admin/_admin.js":2}],2:[function(e,t,n){"use strict";var l=window.jQuery,o=e("./_option.js"),r=document.getElementById("boxzilla-box-options-controls"),i=l(r),s=document.createTextNode(" logged in"),a=new(e("wolfy87-eventemitter")),u=e("./_designer.js")(l,o,a),c=window.wp.template("rule-row-template"),p=window.boxzilla_i18n,d=document.getElementById("boxzilla-rule-comparison"),f=document.getElementById("boxzilla-box-rules"),y=window.ajaxurl;function h(){var e="any"===d.value?p.or:p.and;l(".boxzilla-andor").text(e)}function m(){i.find(".boxzilla-trigger-options").toggle(""!==this.value)}function g(){var e=l(this).parents("tr");e.prev().remove(),e.remove()}function v(){var e="tr"===this.tagName.toLowerCase()?this:l(this).parents("tr").get(0),t=e.querySelector(".boxzilla-rule-condition").value,n=e.querySelector(".boxzilla-rule-value"),o=e.querySelector(".boxzilla-rule-qualifier"),r=n.cloneNode(!0),i=l(r);switch(l(e.querySelectorAll(".boxzilla-helper")).remove(),r.removeAttribute("name"),r.className=r.className+" boxzilla-helper",n.parentNode.insertBefore(r,n.nextSibling),i.change(function(){n.value=this.value}),r.style.display="",n.style.display="none",o.style.display="",o.querySelector('option[value="not_contains"]').style.display="none",o.querySelector('option[value="contains"]').style.display="none",s.parentNode&&s.parentNode.removeChild(s),t){default:r.placeholder=p.enterCommaSeparatedValues;break;case"":case"everywhere":o.value="1",n.value="",r.style.display="none",o.style.display="none";break;case"is_single":case"is_post":r.placeholder=p.enterCommaSeparatedPosts,i.suggest(y+"?action=boxzilla_autocomplete&type=post",{multiple:!0,multipleSep:","});break;case"is_page":r.placeholder=p.enterCommaSeparatedPages,i.suggest(y+"?action=boxzilla_autocomplete&type=page",{multiple:!0,multipleSep:","});break;case"is_post_type":r.placeholder=p.enterCommaSeparatedPostTypes,i.suggest(y+"?action=boxzilla_autocomplete&type=post_type",{multiple:!0,multipleSep:","});break;case"is_url":o.querySelector('option[value="contains"]').style.display="",o.querySelector('option[value="not_contains"]').style.display="",r.placeholder=p.enterCommaSeparatedRelativeUrls;break;case"is_post_in_category":i.suggest(y+"?action=boxzilla_autocomplete&type=category",{multiple:!0,multipleSep:","});break;case"is_post_with_tag":i.suggest(y+"?action=boxzilla_autocomplete&type=post_tag",{multiple:!0,multipleSep:","});break;case"is_user_logged_in":r.style.display="none",n.parentNode.insertBefore(s,n.nextSibling);break;case"is_referer":o.querySelector('option[value="contains"]').style.display="",o.querySelector('option[value="not_contains"]').style.display=""}}function b(){var e={key:r.querySelectorAll(".boxzilla-rule-row").length,andor:"any"===d.value?p.or:p.and},t=c(e);return l(f).append(t),!1}l(window).load(function(){void 0===window.tinyMCE&&(document.getElementById("notice-notinymce").style.display=""),i.on("click",".boxzilla-add-rule",b),i.on("click",".boxzilla-remove-rule",g),i.on("change",".boxzilla-rule-condition",v),i.find(".boxzilla-auto-show-trigger").on("change",m),l(d).change(h),l(".boxzilla-rule-row").each(v)}),t.exports={Designer:u,Option:o,events:a}},{"./_designer.js":3,"./_option.js":4,"wolfy87-eventemitter":5}],3:[function(e,t,n){"use strict";function p(e){return(p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}t.exports=function(e,t,n){var o,r,i,l=document.getElementById("post_ID").value||0,s={},a=!1,u=e("#boxzilla-box-appearance-controls");function c(){return!!a&&(window.setTimeout(function(){i.css({"border-color":s.borderColor.getColorValue(),"border-width":s.borderWidth.getPxValue(),"border-style":s.borderStyle.getValue(),"background-color":s.backgroundColor.getColorValue(),width:s.width.getPxValue(),color:s.color.getColorValue()}),n.trigger("editor.styles.apply")},10),!0)}return u.find("input.boxzilla-color-field").wpColorPicker({change:c,clear:c}),u.find(":input").not(".boxzilla-color-field").change(c),n.on("editor.init",c),{init:function(){"object"===p(window.tinyMCE)&&null!==window.tinyMCE.get("content")&&(s.borderColor=new t("border-color"),s.borderWidth=new t("border-width"),s.borderStyle=new t("border-style"),s.backgroundColor=new t("background-color"),s.width=new t("width"),s.color=new t("color"),r=e("#content_ifr"),(o=r.contents().find("html")).css({background:"white"}),(i=o.find("#tinymce")).addClass("boxzilla boxzilla-"+l),i.css({margin:0,background:"white",display:"inline-block",width:"auto","min-width":"240px",position:"relative"}),i.get(0).style.cssText+=";padding: 25px !important;",a=!0,n.trigger("editor.init"))},resetStyles:function(){for(var e in s)"theme"!==e.substring(0,5)&&s[e].clear();c(),n.trigger("editor.styles.reset")},options:s}}},{}],4:[function(e,t,n){"use strict";function o(e){"string"==typeof e&&(e=document.getElementById("boxzilla-"+e)),e||console.error("Unable to find option element."),this.element=e}var r=window.jQuery;o.prototype.getColorValue=function(){return 0<this.element.value.length?r(this.element).hasClass("wp-color-field")?r(this.element).wpColorPicker("color"):this.element.value:""},o.prototype.getPxValue=function(e){return 0<this.element.value.length?parseInt(this.element.value)+"px":e||""},o.prototype.getValue=function(e){return 0<this.element.value.length?this.element.value:e||""},o.prototype.clear=function(){this.element.value=""},o.prototype.setValue=function(e){this.element.value=e},t.exports=o},{}],5:[function(e,l,t){!function(e){"use strict";function t(){}var n=t.prototype,o=e.EventEmitter;function i(e,t){for(var n=e.length;n--;)if(e[n].listener===t)return n;return-1}function r(e){return function(){return this[e].apply(this,arguments)}}n.getListeners=function(e){var t,n,o=this._getEvents();if(e instanceof RegExp)for(n in t={},o)o.hasOwnProperty(n)&&e.test(n)&&(t[n]=o[n]);else t=o[e]||(o[e]=[]);return t},n.flattenListeners=function(e){var t,n=[];for(t=0;t<e.length;t+=1)n.push(e[t].listener);return n},n.getListenersAsObject=function(e){var t,n=this.getListeners(e);return n instanceof Array&&((t={})[e]=n),t||n},n.addListener=function(e,t){if(!function e(t){return"function"==typeof t||t instanceof RegExp||!(!t||"object"!=typeof t)&&e(t.listener)}(t))throw new TypeError("listener must be a function");var n,o=this.getListenersAsObject(e),r="object"==typeof t;for(n in o)o.hasOwnProperty(n)&&-1===i(o[n],t)&&o[n].push(r?t:{listener:t,once:!1});return this},n.on=r("addListener"),n.addOnceListener=function(e,t){return this.addListener(e,{listener:t,once:!0})},n.once=r("addOnceListener"),n.defineEvent=function(e){return this.getListeners(e),this},n.defineEvents=function(e){for(var t=0;t<e.length;t+=1)this.defineEvent(e[t]);return this},n.removeListener=function(e,t){var n,o,r=this.getListenersAsObject(e);for(o in r)r.hasOwnProperty(o)&&-1!==(n=i(r[o],t))&&r[o].splice(n,1);return this},n.off=r("removeListener"),n.addListeners=function(e,t){return this.manipulateListeners(!1,e,t)},n.removeListeners=function(e,t){return this.manipulateListeners(!0,e,t)},n.manipulateListeners=function(e,t,n){var o,r,i=e?this.removeListener:this.addListener,l=e?this.removeListeners:this.addListeners;if("object"!=typeof t||t instanceof RegExp)for(o=n.length;o--;)i.call(this,t,n[o]);else for(o in t)t.hasOwnProperty(o)&&(r=t[o])&&("function"==typeof r?i.call(this,o,r):l.call(this,o,r));return this},n.removeEvent=function(e){var t,n=typeof e,o=this._getEvents();if("string"==n)delete o[e];else if(e instanceof RegExp)for(t in o)o.hasOwnProperty(t)&&e.test(t)&&delete o[t];else delete this._events;return this},n.removeAllListeners=r("removeEvent"),n.emitEvent=function(e,t){var n,o,r,i,l=this.getListenersAsObject(e);for(i in l)if(l.hasOwnProperty(i))for(n=l[i].slice(0),r=0;r<n.length;r++)!0===(o=n[r]).once&&this.removeListener(e,o.listener),o.listener.apply(this,t||[])===this._getOnceReturnValue()&&this.removeListener(e,o.listener);return this},n.trigger=r("emitEvent"),n.emit=function(e){var t=Array.prototype.slice.call(arguments,1);return this.emitEvent(e,t)},n.setOnceReturnValue=function(e){return this._onceReturnValue=e,this},n._getOnceReturnValue=function(){return!this.hasOwnProperty("_onceReturnValue")||this._onceReturnValue},n._getEvents=function(){return this._events||(this._events={})},t.noConflict=function(){return e.EventEmitter=o,t},"function"==typeof s&&s.amd?s(function(){return t}):"object"==typeof l&&l.exports?l.exports=t:e.EventEmitter=t}("undefined"!=typeof window?window:this||{})},{}]},{},[1])}();
2
  //# sourceMappingURL=admin-script.min.js.map
assets/js/admin-script.min.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["admin-script.js"],"names":["define","undefined","r","e","n","t","o","i","f","c","u","a","Error","code","p","exports","call","length","1","require","module","window","Boxzilla_Admin","./admin/_admin.js","2","$","jQuery","Option","optionControls","document","getElementById","$optionControls","tnLoggedIn","createTextNode","events","Designer","rowTemplate","wp","template","i18n","boxzilla_i18n","ruleComparisonEl","rulesContainerEl","on","data","key","querySelectorAll","andor","value","or","and","html","append","row","this","parents","prev","remove","setContextualHelpers","find","toggle","change","newText","text","load","tinyMCE","style","display","each","context","tagName","toLowerCase","get","condition","querySelector","valueInput","qualifierInput","betterInput","cloneNode","$betterInput","removeAttribute","className","parentNode","insertBefore","nextSibling","removeChild","placeholder","enterCommaSeparatedValues","enterCommaSeparatedPosts","suggest","ajaxurl","multiple","multipleSep","enterCommaSeparatedPages","enterCommaSeparatedPostTypes","enterCommaSeparatedRelativeUrls","./_designer.js","./_option.js","wolfy87-eventemitter","3","_typeof","obj","Symbol","iterator","constructor","prototype","$editor","$editorFrame","$innerEditor","boxId","options","visualEditorInitialised","$appearanceControls","applyStyles","setTimeout","css","border-color","borderColor","getColorValue","border-width","borderWidth","getPxValue","border-style","borderStyle","getValue","background-color","backgroundColor","width","color","trigger","wpColorPicker","clear","not","init","contents","background","addClass","margin","min-width","position","cssText","resetStyles","substring","4","element","console","error","hasClass","fallbackValue","parseInt","setValue","5","EventEmitter","proto","originalGlobalValue","indexOfListener","listeners","listener","alias","name","apply","arguments","getListeners","evt","response","_getEvents","RegExp","hasOwnProperty","test","flattenListeners","flatListeners","push","getListenersAsObject","Array","addListener","isValidListener","TypeError","listenerIsWrapped","once","addOnceListener","defineEvent","defineEvents","evts","removeListener","index","splice","off","addListeners","manipulateListeners","removeListeners","single","removeEvent","type","_events","removeAllListeners","emitEvent","args","listenersMap","slice","_getOnceReturnValue","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,OAAOvG,MAMXmG,EAAMxB,QAAU6B,EAAM,aAUtBL,EAAM+C,KAAO,SAAcrC,GACvB,IAAIiC,EAAOvB,MAAMpE,UAAU6F,MAAMtL,KAAKiJ,UAAW,GACjD,OAAO3G,KAAK6I,UAAUhC,EAAKiC,IAW/B3C,EAAMgD,mBAAqB,SAA4BzJ,GAEnD,OADAM,KAAKoJ,iBAAmB1J,EACjBM,MAWXmG,EAAM8C,oBAAsB,WACxB,OAAIjJ,KAAKiH,eAAe,qBACbjH,KAAKoJ,kBAapBjD,EAAMY,WAAa,WACf,OAAO/G,KAAK2I,UAAY3I,KAAK2I,QAAU,KAQ3CzC,EAAamD,WAAa,WAEtB,OADA5L,EAAQyI,aAAeE,EAChBF,GAIW,mBAAXxJ,GAAyBA,EAAO4M,IACvC5M,EAAO,WACH,OAAOwJ,IAGY,iBAAXpI,GAAuBA,EAAOL,QAC1CK,EAAOL,QAAUyI,EAGjBzI,EAAQyI,aAAeA,EA5d9B,CA8dmB,oBAAXnI,OAAyBA,OAASiC,MAAQ,KAEjD,KAAK,GAAG,CAAC,IAz0BX","file":"admin-script.min.js","sourcesContent":["(function () { var require = undefined; var module = undefined; var exports = undefined; var define = undefined; (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c=\"function\"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error(\"Cannot find module '\"+i+\"'\");throw a.code=\"MODULE_NOT_FOUND\",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u=\"function\"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){\n\"use strict\";\n\nwindow.Boxzilla_Admin = require('./admin/_admin.js');\n\n},{\"./admin/_admin.js\":2}],2:[function(require,module,exports){\n\"use strict\";\n\n(function () {\n 'use strict';\n\n var $ = window.jQuery;\n\n var Option = require('./_option.js');\n\n var optionControls = document.getElementById('boxzilla-box-options-controls');\n var $optionControls = $(optionControls);\n var tnLoggedIn = document.createTextNode(' logged in'); // sanity check, are we on the correct page?\n\n if ($optionControls.length === 0) {\n return;\n }\n\n var EventEmitter = require('wolfy87-eventemitter');\n\n var events = new EventEmitter();\n\n var Designer = require('./_designer.js')($, Option, events);\n\n var rowTemplate = wp.template('rule-row-template');\n var i18n = boxzilla_i18n;\n var ruleComparisonEl = document.getElementById('boxzilla-rule-comparison');\n var rulesContainerEl = document.getElementById('boxzilla-box-rules'); // events\n\n $optionControls.on('click', \".boxzilla-add-rule\", addRuleFields);\n $optionControls.on('click', \".boxzilla-remove-rule\", removeRule);\n $optionControls.on('change', \".boxzilla-rule-condition\", setContextualHelpers);\n $optionControls.find('.boxzilla-auto-show-trigger').on('change', toggleTriggerOptions);\n $(ruleComparisonEl).change(toggleAndOrTexts);\n $(window).load(function () {\n if (typeof window.tinyMCE === \"undefined\") {\n document.getElementById('notice-notinymce').style.display = '';\n }\n }); // call contextual helper method for each row\n\n $('.boxzilla-rule-row').each(setContextualHelpers);\n\n function toggleAndOrTexts() {\n var newText = ruleComparisonEl.value === 'any' ? i18n.or : i18n.and;\n $('.boxzilla-andor').text(newText);\n }\n\n function toggleTriggerOptions() {\n $optionControls.find('.boxzilla-trigger-options').toggle(this.value !== '');\n }\n\n function removeRule() {\n var row = $(this).parents('tr'); // delete andor row\n\n row.prev().remove(); // delete rule row\n\n row.remove();\n }\n\n function setContextualHelpers() {\n var context = this.tagName.toLowerCase() === \"tr\" ? this : $(this).parents('tr').get(0);\n var condition = context.querySelector('.boxzilla-rule-condition').value;\n var valueInput = context.querySelector('.boxzilla-rule-value');\n var qualifierInput = context.querySelector('.boxzilla-rule-qualifier');\n var betterInput = valueInput.cloneNode(true);\n var $betterInput = $(betterInput); // remove previously added helpers\n\n $(context.querySelectorAll('.boxzilla-helper')).remove(); // prepare better input\n\n betterInput.removeAttribute('name');\n betterInput.className = betterInput.className + ' boxzilla-helper';\n valueInput.parentNode.insertBefore(betterInput, valueInput.nextSibling);\n $betterInput.change(function () {\n valueInput.value = this.value;\n });\n betterInput.style.display = '';\n valueInput.style.display = 'none';\n qualifierInput.style.display = '';\n qualifierInput.querySelector('option[value=\"not_contains\"]').style.display = 'none';\n qualifierInput.querySelector('option[value=\"contains\"]').style.display = 'none';\n\n if (tnLoggedIn.parentNode) {\n tnLoggedIn.parentNode.removeChild(tnLoggedIn);\n } // change placeholder for textual help\n\n\n switch (condition) {\n default:\n betterInput.placeholder = i18n.enterCommaSeparatedValues;\n break;\n\n case '':\n case 'everywhere':\n qualifierInput.value = '1';\n valueInput.value = '';\n betterInput.style.display = 'none';\n qualifierInput.style.display = 'none';\n break;\n\n case 'is_single':\n case 'is_post':\n betterInput.placeholder = i18n.enterCommaSeparatedPosts;\n $betterInput.suggest(ajaxurl + \"?action=boxzilla_autocomplete&type=post\", {\n multiple: true,\n multipleSep: \",\"\n });\n break;\n\n case 'is_page':\n betterInput.placeholder = i18n.enterCommaSeparatedPages;\n $betterInput.suggest(ajaxurl + \"?action=boxzilla_autocomplete&type=page\", {\n multiple: true,\n multipleSep: \",\"\n });\n break;\n\n case 'is_post_type':\n betterInput.placeholder = i18n.enterCommaSeparatedPostTypes;\n $betterInput.suggest(ajaxurl + \"?action=boxzilla_autocomplete&type=post_type\", {\n multiple: true,\n multipleSep: \",\"\n });\n break;\n\n case 'is_url':\n qualifierInput.querySelector('option[value=\"contains\"]').style.display = '';\n qualifierInput.querySelector('option[value=\"not_contains\"]').style.display = '';\n betterInput.placeholder = i18n.enterCommaSeparatedRelativeUrls;\n break;\n\n case 'is_post_in_category':\n $betterInput.suggest(ajaxurl + \"?action=boxzilla_autocomplete&type=category\", {\n multiple: true,\n multipleSep: \",\"\n });\n break;\n\n case 'is_post_with_tag':\n $betterInput.suggest(ajaxurl + \"?action=boxzilla_autocomplete&type=post_tag\", {\n multiple: true,\n multipleSep: \",\"\n });\n break;\n\n case 'is_user_logged_in':\n betterInput.style.display = 'none';\n valueInput.parentNode.insertBefore(tnLoggedIn, valueInput.nextSibling);\n break;\n\n case 'is_referer':\n qualifierInput.querySelector('option[value=\"contains\"]').style.display = '';\n qualifierInput.querySelector('option[value=\"not_contains\"]').style.display = '';\n break;\n }\n }\n\n function addRuleFields() {\n var data = {\n 'key': optionControls.querySelectorAll('.boxzilla-rule-row').length,\n 'andor': ruleComparisonEl.value === 'any' ? i18n.or : i18n.and\n };\n var html = rowTemplate(data);\n $(rulesContainerEl).append(html);\n return false;\n }\n\n module.exports = {\n 'Designer': Designer,\n 'Option': Option,\n 'events': events\n };\n})();\n\n},{\"./_designer.js\":3,\"./_option.js\":4,\"wolfy87-eventemitter\":5}],3:[function(require,module,exports){\n\"use strict\";\n\nfunction _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nvar Designer = function Designer($, Option, events) {\n // vars\n var boxId = document.getElementById('post_ID').value || 0,\n $editor,\n $editorFrame,\n $innerEditor,\n options = {},\n visualEditorInitialised = false;\n var $appearanceControls = $(\"#boxzilla-box-appearance-controls\"); // create Option objects\n\n options.borderColor = new Option('border-color');\n options.borderWidth = new Option('border-width');\n options.borderStyle = new Option('border-style');\n options.backgroundColor = new Option('background-color');\n options.width = new Option('width');\n options.color = new Option('color'); // functions\n\n function init() {\n // Only run if TinyMCE has actually inited\n if (_typeof(window.tinyMCE) !== \"object\" || tinyMCE.get('content') === null) {\n return;\n } // add classes to TinyMCE <html>\n\n\n $editorFrame = $(\"#content_ifr\");\n $editor = $editorFrame.contents().find('html');\n $editor.css({\n 'background': 'white'\n }); // add content class and padding to TinyMCE <body>\n\n $innerEditor = $editor.find('#tinymce');\n $innerEditor.addClass('boxzilla boxzilla-' + boxId);\n $innerEditor.css({\n 'margin': 0,\n 'background': 'white',\n 'display': 'inline-block',\n 'width': 'auto',\n 'min-width': '240px',\n 'position': 'relative'\n });\n $innerEditor.get(0).style.cssText += ';padding: 25px !important;';\n visualEditorInitialised = true;\n /* @since 2.0.3 */\n\n events.trigger('editor.init');\n }\n /**\n * Applies the styles from the options to the TinyMCE Editor\n *\n * @return bool\n */\n\n\n function applyStyles() {\n if (!visualEditorInitialised) {\n return false;\n } // Apply styles from CSS editor. \n // Use short timeout to make sure color values are updated.\n\n\n window.setTimeout(function () {\n $innerEditor.css({\n 'border-color': options.borderColor.getColorValue(),\n //getColorValue( 'borderColor', '' ),\n 'border-width': options.borderWidth.getPxValue(),\n //getPxValue( 'borderWidth', '' ),\n 'border-style': options.borderStyle.getValue(),\n //getValue('borderStyle', '' ),\n 'background-color': options.backgroundColor.getColorValue(),\n //getColorValue( 'backgroundColor', ''),\n 'width': options.width.getPxValue(),\n //getPxValue( 'width', 'auto' ),\n 'color': options.color.getColorValue() // getColorValue( 'color', '' )\n\n });\n /* @since 2.0.3 */\n\n events.trigger('editor.styles.apply');\n }, 10);\n return true;\n }\n\n function resetStyles() {\n for (var key in options) {\n if (key.substring(0, 5) === 'theme') {\n continue;\n }\n\n options[key].clear();\n }\n\n applyStyles();\n /* @since 2.0.3 */\n\n events.trigger('editor.styles.reset');\n } // event binders\n\n\n $appearanceControls.find('input.boxzilla-color-field').wpColorPicker({\n change: applyStyles,\n clear: applyStyles\n });\n $appearanceControls.find(\":input\").not(\".boxzilla-color-field\").change(applyStyles);\n events.on('editor.init', applyStyles); // public methods\n\n return {\n 'init': init,\n 'resetStyles': resetStyles,\n 'options': options\n };\n};\n\nmodule.exports = Designer;\n\n},{}],4:[function(require,module,exports){\n'use strict';\n\nvar $ = window.jQuery;\n\nvar Option = function Option(element) {\n // find corresponding element\n if (typeof element == \"string\") {\n element = document.getElementById('boxzilla-' + element);\n }\n\n if (!element) {\n console.error(\"Unable to find option element.\");\n }\n\n this.element = element;\n};\n\nOption.prototype.getColorValue = function () {\n if (this.element.value.length > 0) {\n if ($(this.element).hasClass('wp-color-field')) {\n return $(this.element).wpColorPicker('color');\n } else {\n return this.element.value;\n }\n }\n\n return '';\n};\n\nOption.prototype.getPxValue = function (fallbackValue) {\n if (this.element.value.length > 0) {\n return parseInt(this.element.value) + \"px\";\n }\n\n return fallbackValue || '';\n};\n\nOption.prototype.getValue = function (fallbackValue) {\n if (this.element.value.length > 0) {\n return this.element.value;\n }\n\n return fallbackValue || '';\n};\n\nOption.prototype.clear = function () {\n this.element.value = '';\n};\n\nOption.prototype.setValue = function (value) {\n this.element.value = value;\n};\n\nmodule.exports = Option;\n\n},{}],5:[function(require,module,exports){\n/*!\n * EventEmitter v5.2.8 - git.io/ee\n * Unlicense - http://unlicense.org/\n * Oliver Caldwell - https://oli.me.uk/\n * @preserve\n */\n\n;(function (exports) {\n 'use strict';\n\n /**\n * Class for managing events.\n * Can be extended to provide event functionality in other classes.\n *\n * @class EventEmitter Manages event registering and emitting.\n */\n function EventEmitter() {}\n\n // Shortcuts to improve speed and size\n var proto = EventEmitter.prototype;\n var originalGlobalValue = exports.EventEmitter;\n\n /**\n * Finds the index of the listener for the event in its storage array.\n *\n * @param {Function[]} listeners Array of listeners to search through.\n * @param {Function} listener Method to look for.\n * @return {Number} Index of the specified listener, -1 if not found\n * @api private\n */\n function indexOfListener(listeners, listener) {\n var i = listeners.length;\n while (i--) {\n if (listeners[i].listener === listener) {\n return i;\n }\n }\n\n return -1;\n }\n\n /**\n * Alias a method while keeping the context correct, to allow for overwriting of target method.\n *\n * @param {String} name The name of the target method.\n * @return {Function} The aliased method\n * @api private\n */\n function alias(name) {\n return function aliasClosure() {\n return this[name].apply(this, arguments);\n };\n }\n\n /**\n * Returns the listener array for the specified event.\n * Will initialise the event object and listener arrays if required.\n * Will return an object if you use a regex search. The object contains keys for each matched event. So /ba[rz]/ might return an object containing bar and baz. But only if you have either defined them with defineEvent or added some listeners to them.\n * Each property in the object response is an array of listener functions.\n *\n * @param {String|RegExp} evt Name of the event to return the listeners from.\n * @return {Function[]|Object} All listener functions for the event.\n */\n proto.getListeners = function getListeners(evt) {\n var events = this._getEvents();\n var response;\n var key;\n\n // Return a concatenated array of all matching events if\n // the selector is a regular expression.\n if (evt instanceof RegExp) {\n response = {};\n for (key in events) {\n if (events.hasOwnProperty(key) && evt.test(key)) {\n response[key] = events[key];\n }\n }\n }\n else {\n response = events[evt] || (events[evt] = []);\n }\n\n return response;\n };\n\n /**\n * Takes a list of listener objects and flattens it into a list of listener functions.\n *\n * @param {Object[]} listeners Raw listener objects.\n * @return {Function[]} Just the listener functions.\n */\n proto.flattenListeners = function flattenListeners(listeners) {\n var flatListeners = [];\n var i;\n\n for (i = 0; i < listeners.length; i += 1) {\n flatListeners.push(listeners[i].listener);\n }\n\n return flatListeners;\n };\n\n /**\n * Fetches the requested listeners via getListeners but will always return the results inside an object. This is mainly for internal use but others may find it useful.\n *\n * @param {String|RegExp} evt Name of the event to return the listeners from.\n * @return {Object} All listener functions for an event in an object.\n */\n proto.getListenersAsObject = function getListenersAsObject(evt) {\n var listeners = this.getListeners(evt);\n var response;\n\n if (listeners instanceof Array) {\n response = {};\n response[evt] = listeners;\n }\n\n return response || listeners;\n };\n\n function isValidListener (listener) {\n if (typeof listener === 'function' || listener instanceof RegExp) {\n return true\n } else if (listener && typeof listener === 'object') {\n return isValidListener(listener.listener)\n } else {\n return false\n }\n }\n\n /**\n * Adds a listener function to the specified event.\n * The listener will not be added if it is a duplicate.\n * If the listener returns true then it will be removed after it is called.\n * If you pass a regular expression as the event name then the listener will be added to all events that match it.\n *\n * @param {String|RegExp} evt Name of the event to attach the listener to.\n * @param {Function} listener Method to be called when the event is emitted. If the function returns true then it will be removed after calling.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.addListener = function addListener(evt, listener) {\n if (!isValidListener(listener)) {\n throw new TypeError('listener must be a function');\n }\n\n var listeners = this.getListenersAsObject(evt);\n var listenerIsWrapped = typeof listener === 'object';\n var key;\n\n for (key in listeners) {\n if (listeners.hasOwnProperty(key) && indexOfListener(listeners[key], listener) === -1) {\n listeners[key].push(listenerIsWrapped ? listener : {\n listener: listener,\n once: false\n });\n }\n }\n\n return this;\n };\n\n /**\n * Alias of addListener\n */\n proto.on = alias('addListener');\n\n /**\n * Semi-alias of addListener. It will add a listener that will be\n * automatically removed after its first execution.\n *\n * @param {String|RegExp} evt Name of the event to attach the listener to.\n * @param {Function} listener Method to be called when the event is emitted. If the function returns true then it will be removed after calling.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.addOnceListener = function addOnceListener(evt, listener) {\n return this.addListener(evt, {\n listener: listener,\n once: true\n });\n };\n\n /**\n * Alias of addOnceListener.\n */\n proto.once = alias('addOnceListener');\n\n /**\n * Defines an event name. This is required if you want to use a regex to add a listener to multiple events at once. If you don't do this then how do you expect it to know what event to add to? Should it just add to every possible match for a regex? No. That is scary and bad.\n * You need to tell it what event names should be matched by a regex.\n *\n * @param {String} evt Name of the event to create.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.defineEvent = function defineEvent(evt) {\n this.getListeners(evt);\n return this;\n };\n\n /**\n * Uses defineEvent to define multiple events.\n *\n * @param {String[]} evts An array of event names to define.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.defineEvents = function defineEvents(evts) {\n for (var i = 0; i < evts.length; i += 1) {\n this.defineEvent(evts[i]);\n }\n return this;\n };\n\n /**\n * Removes a listener function from the specified event.\n * When passed a regular expression as the event name, it will remove the listener from all events that match it.\n *\n * @param {String|RegExp} evt Name of the event to remove the listener from.\n * @param {Function} listener Method to remove from the event.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.removeListener = function removeListener(evt, listener) {\n var listeners = this.getListenersAsObject(evt);\n var index;\n var key;\n\n for (key in listeners) {\n if (listeners.hasOwnProperty(key)) {\n index = indexOfListener(listeners[key], listener);\n\n if (index !== -1) {\n listeners[key].splice(index, 1);\n }\n }\n }\n\n return this;\n };\n\n /**\n * Alias of removeListener\n */\n proto.off = alias('removeListener');\n\n /**\n * Adds listeners in bulk using the manipulateListeners method.\n * If you pass an object as the first argument you can add to multiple events at once. The object should contain key value pairs of events and listeners or listener arrays. You can also pass it an event name and an array of listeners to be added.\n * You can also pass it a regular expression to add the array of listeners to all events that match it.\n * Yeah, this function does quite a bit. That's probably a bad thing.\n *\n * @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to add to multiple events at once.\n * @param {Function[]} [listeners] An optional array of listener functions to add.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.addListeners = function addListeners(evt, listeners) {\n // Pass through to manipulateListeners\n return this.manipulateListeners(false, evt, listeners);\n };\n\n /**\n * Removes listeners in bulk using the manipulateListeners method.\n * If you pass an object as the first argument you can remove from multiple events at once. The object should contain key value pairs of events and listeners or listener arrays.\n * You can also pass it an event name and an array of listeners to be removed.\n * You can also pass it a regular expression to remove the listeners from all events that match it.\n *\n * @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to remove from multiple events at once.\n * @param {Function[]} [listeners] An optional array of listener functions to remove.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.removeListeners = function removeListeners(evt, listeners) {\n // Pass through to manipulateListeners\n return this.manipulateListeners(true, evt, listeners);\n };\n\n /**\n * Edits listeners in bulk. The addListeners and removeListeners methods both use this to do their job. You should really use those instead, this is a little lower level.\n * The first argument will determine if the listeners are removed (true) or added (false).\n * If you pass an object as the second argument you can add/remove from multiple events at once. The object should contain key value pairs of events and listeners or listener arrays.\n * You can also pass it an event name and an array of listeners to be added/removed.\n * You can also pass it a regular expression to manipulate the listeners of all events that match it.\n *\n * @param {Boolean} remove True if you want to remove listeners, false if you want to add.\n * @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to add/remove from multiple events at once.\n * @param {Function[]} [listeners] An optional array of listener functions to add/remove.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.manipulateListeners = function manipulateListeners(remove, evt, listeners) {\n var i;\n var value;\n var single = remove ? this.removeListener : this.addListener;\n var multiple = remove ? this.removeListeners : this.addListeners;\n\n // If evt is an object then pass each of its properties to this method\n if (typeof evt === 'object' && !(evt instanceof RegExp)) {\n for (i in evt) {\n if (evt.hasOwnProperty(i) && (value = evt[i])) {\n // Pass the single listener straight through to the singular method\n if (typeof value === 'function') {\n single.call(this, i, value);\n }\n else {\n // Otherwise pass back to the multiple function\n multiple.call(this, i, value);\n }\n }\n }\n }\n else {\n // So evt must be a string\n // And listeners must be an array of listeners\n // Loop over it and pass each one to the multiple method\n i = listeners.length;\n while (i--) {\n single.call(this, evt, listeners[i]);\n }\n }\n\n return this;\n };\n\n /**\n * Removes all listeners from a specified event.\n * If you do not specify an event then all listeners will be removed.\n * That means every event will be emptied.\n * You can also pass a regex to remove all events that match it.\n *\n * @param {String|RegExp} [evt] Optional name of the event to remove all listeners for. Will remove from every event if not passed.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.removeEvent = function removeEvent(evt) {\n var type = typeof evt;\n var events = this._getEvents();\n var key;\n\n // Remove different things depending on the state of evt\n if (type === 'string') {\n // Remove all listeners for the specified event\n delete events[evt];\n }\n else if (evt instanceof RegExp) {\n // Remove all events matching the regex.\n for (key in events) {\n if (events.hasOwnProperty(key) && evt.test(key)) {\n delete events[key];\n }\n }\n }\n else {\n // Remove all listeners in all events\n delete this._events;\n }\n\n return this;\n };\n\n /**\n * Alias of removeEvent.\n *\n * Added to mirror the node API.\n */\n proto.removeAllListeners = alias('removeEvent');\n\n /**\n * Emits an event of your choice.\n * When emitted, every listener attached to that event will be executed.\n * If you pass the optional argument array then those arguments will be passed to every listener upon execution.\n * Because it uses `apply`, your array of arguments will be passed as if you wrote them out separately.\n * So they will not arrive within the array on the other side, they will be separate.\n * You can also pass a regular expression to emit to all events that match it.\n *\n * @param {String|RegExp} evt Name of the event to emit and execute listeners for.\n * @param {Array} [args] Optional array of arguments to be passed to each listener.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.emitEvent = function emitEvent(evt, args) {\n var listenersMap = this.getListenersAsObject(evt);\n var listeners;\n var listener;\n var i;\n var key;\n var response;\n\n for (key in listenersMap) {\n if (listenersMap.hasOwnProperty(key)) {\n listeners = listenersMap[key].slice(0);\n\n for (i = 0; i < listeners.length; i++) {\n // If the listener returns true then it shall be removed from the event\n // The function is executed either with a basic call or an apply if there is an args array\n listener = listeners[i];\n\n if (listener.once === true) {\n this.removeListener(evt, listener.listener);\n }\n\n response = listener.listener.apply(this, args || []);\n\n if (response === this._getOnceReturnValue()) {\n this.removeListener(evt, listener.listener);\n }\n }\n }\n }\n\n return this;\n };\n\n /**\n * Alias of emitEvent\n */\n proto.trigger = alias('emitEvent');\n\n /**\n * Subtly different from emitEvent in that it will pass its arguments on to the listeners, as opposed to taking a single array of arguments to pass on.\n * As with emitEvent, you can pass a regex in place of the event name to emit to all events that match it.\n *\n * @param {String|RegExp} evt Name of the event to emit and execute listeners for.\n * @param {...*} Optional additional arguments to be passed to each listener.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.emit = function emit(evt) {\n var args = Array.prototype.slice.call(arguments, 1);\n return this.emitEvent(evt, args);\n };\n\n /**\n * Sets the current value to check against when executing listeners. If a\n * listeners return value matches the one set here then it will be removed\n * after execution. This value defaults to true.\n *\n * @param {*} value The new value to check for when executing listeners.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.setOnceReturnValue = function setOnceReturnValue(value) {\n this._onceReturnValue = value;\n return this;\n };\n\n /**\n * Fetches the current value to check against when executing listeners. If\n * the listeners return value matches this one then it should be removed\n * automatically. It will return true by default.\n *\n * @return {*|Boolean} The current value to check for or the default, true.\n * @api private\n */\n proto._getOnceReturnValue = function _getOnceReturnValue() {\n if (this.hasOwnProperty('_onceReturnValue')) {\n return this._onceReturnValue;\n }\n else {\n return true;\n }\n };\n\n /**\n * Fetches the events object and creates one if required.\n *\n * @return {Object} The events storage object.\n * @api private\n */\n proto._getEvents = function _getEvents() {\n return this._events || (this._events = {});\n };\n\n /**\n * Reverts the global {@link EventEmitter} to its previous value and returns a reference to this version.\n *\n * @return {Function} Non conflicting EventEmitter class.\n */\n EventEmitter.noConflict = function noConflict() {\n exports.EventEmitter = originalGlobalValue;\n return EventEmitter;\n };\n\n // Expose the class either via AMD, CommonJS or the global object\n if (typeof define === 'function' && define.amd) {\n define(function () {\n return EventEmitter;\n });\n }\n else if (typeof module === 'object' && module.exports){\n module.exports = EventEmitter;\n }\n else {\n exports.EventEmitter = EventEmitter;\n }\n}(typeof window !== 'undefined' ? window : this || {}));\n\n},{}]},{},[1]);\n; })();"]}
1
+ {"version":3,"sources":["admin-script.js"],"names":["define","undefined","r","e","n","t","o","i","f","c","u","a","Error","code","p","exports","call","length","1","require","module","window","Boxzilla_Admin","./admin/_admin.js","2","$","jQuery","Option","optionControls","document","getElementById","$optionControls","tnLoggedIn","createTextNode","events","Designer","rowTemplate","wp","template","i18n","boxzilla_i18n","ruleComparisonEl","rulesContainerEl","ajaxurl","toggleAndOrTexts","newText","value","or","and","text","toggleTriggerOptions","find","toggle","this","removeRule","row","parents","prev","remove","setContextualHelpers","context","tagName","toLowerCase","get","condition","querySelector","valueInput","qualifierInput","betterInput","cloneNode","$betterInput","querySelectorAll","removeAttribute","className","parentNode","insertBefore","nextSibling","change","style","display","removeChild","placeholder","enterCommaSeparatedValues","enterCommaSeparatedPosts","suggest","multiple","multipleSep","enterCommaSeparatedPages","enterCommaSeparatedPostTypes","enterCommaSeparatedRelativeUrls","addRuleFields","data","key","andor","html","append","load","tinyMCE","on","each","./_designer.js","./_option.js","wolfy87-eventemitter","3","_typeof","obj","Symbol","iterator","constructor","prototype","$editor","$editorFrame","$innerEditor","boxId","options","visualEditorInitialised","$appearanceControls","applyStyles","setTimeout","css","border-color","borderColor","getColorValue","border-width","borderWidth","getPxValue","border-style","borderStyle","getValue","background-color","backgroundColor","width","color","trigger","wpColorPicker","clear","not","init","contents","background","addClass","margin","min-width","position","cssText","resetStyles","substring","4","element","console","error","hasClass","fallbackValue","parseInt","setValue","5","EventEmitter","proto","originalGlobalValue","indexOfListener","listeners","listener","alias","name","apply","arguments","getListeners","evt","response","_getEvents","RegExp","hasOwnProperty","test","flattenListeners","flatListeners","push","getListenersAsObject","Array","addListener","isValidListener","TypeError","listenerIsWrapped","once","addOnceListener","defineEvent","defineEvents","evts","removeListener","index","splice","off","addListeners","manipulateListeners","removeListeners","single","removeEvent","type","_events","removeAllListeners","emitEvent","args","listenersMap","slice","_getOnceReturnValue","emit","setOnceReturnValue","_onceReturnValue","noConflict","amd"],"mappings":"CAAA,WAAe,IAA8EA,OAASC,GAAuB,SAASC,EAAEC,EAAEC,EAAEC,GAAG,SAASC,EAAEC,EAAEC,GAAG,IAAIJ,EAAEG,GAAG,CAAC,IAAIJ,EAAEI,GAAG,CAAC,IAAIE,GAAE,EAAoC,IAAID,GAAGC,EAAE,OAAOA,EAAEF,GAAE,GAAI,GAAGG,EAAE,OAAOA,EAAEH,GAAE,GAAI,IAAII,EAAE,IAAIC,MAAM,uBAAuBL,EAAE,KAAK,MAAMI,EAAEE,KAAK,mBAAmBF,EAAE,IAAIG,EAAEV,EAAEG,GAAG,CAACQ,QAAQ,IAAIZ,EAAEI,GAAG,GAAGS,KAAKF,EAAEC,QAAQ,SAASb,GAAoB,OAAOI,EAAlBH,EAAEI,GAAG,GAAGL,IAAeA,IAAIY,EAAEA,EAAEC,QAAQb,EAAEC,EAAEC,EAAEC,GAAG,OAAOD,EAAEG,GAAGQ,QAAQ,IAAI,IAAIL,GAAE,EAAoCH,EAAE,EAAEA,EAAEF,EAAEY,OAAOV,IAAID,EAAED,EAAEE,IAAI,OAAOD,EAA7b,CAA4c,CAACY,EAAE,CAAC,SAASC,EAAQC,EAAOL,GACzlB,aAEAM,OAAOC,eAAiBH,EAAQ,sBAE9B,CAACI,oBAAoB,IAAIC,EAAE,CAAC,SAASL,EAAQC,EAAOL,GACtD,aAEA,IAAIU,EAAIJ,OAAOK,OAEXC,EAASR,EAAQ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,EAAKiC,GACtC,IACIxC,EACAC,EACA1J,EACAqF,EAJA6G,EAAepJ,KAAK2H,qBAAqBT,GAO7C,IAAK3E,KAAO6G,EACR,GAAIA,EAAa9B,eAAe/E,GAG5B,IAFAoE,EAAYyC,EAAa7G,GAAK8G,MAAM,GAE/BnM,EAAI,EAAGA,EAAIyJ,EAAU/I,OAAQV,KAKR,KAFtB0J,EAAWD,EAAUzJ,IAER+K,MACTjI,KAAKsI,eAAepB,EAAKN,EAASA,UAG3BA,EAASA,SAASG,MAAM/G,KAAMmJ,GAAQ,MAEhCnJ,KAAKsJ,uBAClBtJ,KAAKsI,eAAepB,EAAKN,EAASA,UAMlD,OAAO5G,MAMXwG,EAAMxB,QAAU6B,EAAM,aAUtBL,EAAM+C,KAAO,SAAcrC,GACvB,IAAIiC,EAAOvB,MAAMpE,UAAU6F,MAAM1L,KAAKqJ,UAAW,GACjD,OAAOhH,KAAKkJ,UAAUhC,EAAKiC,IAW/B3C,EAAMgD,mBAAqB,SAA4B/J,GAEnD,OADAO,KAAKyJ,iBAAmBhK,EACjBO,MAWXwG,EAAM8C,oBAAsB,WACxB,OAAItJ,KAAKsH,eAAe,qBACbtH,KAAKyJ,kBAapBjD,EAAMY,WAAa,WACf,OAAOpH,KAAKgJ,UAAYhJ,KAAKgJ,QAAU,KAQ3CzC,EAAamD,WAAa,WAEtB,OADAhM,EAAQ6I,aAAeE,EAChBF,GAIW,mBAAX5J,GAAyBA,EAAOgN,IACvChN,EAAO,WACH,OAAO4J,IAGY,iBAAXxI,GAAuBA,EAAOL,QAC1CK,EAAOL,QAAU6I,EAGjB7I,EAAQ6I,aAAeA,EA5d9B,CA8dmB,oBAAXvI,OAAyBA,OAASgC,MAAQ,KAEjD,KAAK,GAAG,CAAC,IAl0BX","file":"admin-script.min.js","sourcesContent":["(function () { var require = undefined; var module = undefined; var exports = undefined; var define = undefined; (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c=\"function\"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error(\"Cannot find module '\"+i+\"'\");throw a.code=\"MODULE_NOT_FOUND\",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u=\"function\"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){\n\"use strict\";\n\nwindow.Boxzilla_Admin = require('./admin/_admin.js');\n\n},{\"./admin/_admin.js\":2}],2:[function(require,module,exports){\n\"use strict\";\n\nvar $ = window.jQuery;\n\nvar Option = require('./_option.js');\n\nvar optionControls = document.getElementById('boxzilla-box-options-controls');\nvar $optionControls = $(optionControls);\nvar tnLoggedIn = document.createTextNode(' logged in');\n\nvar EventEmitter = require('wolfy87-eventemitter');\n\nvar events = new EventEmitter();\n\nvar Designer = require('./_designer.js')($, Option, events);\n\nvar rowTemplate = window.wp.template('rule-row-template');\nvar i18n = window.boxzilla_i18n;\nvar ruleComparisonEl = document.getElementById('boxzilla-rule-comparison');\nvar rulesContainerEl = document.getElementById('boxzilla-box-rules');\nvar ajaxurl = window.ajaxurl; // events\n\n$(window).load(function () {\n if (typeof window.tinyMCE === 'undefined') {\n document.getElementById('notice-notinymce').style.display = '';\n }\n\n $optionControls.on('click', '.boxzilla-add-rule', addRuleFields);\n $optionControls.on('click', '.boxzilla-remove-rule', removeRule);\n $optionControls.on('change', '.boxzilla-rule-condition', setContextualHelpers);\n $optionControls.find('.boxzilla-auto-show-trigger').on('change', toggleTriggerOptions);\n $(ruleComparisonEl).change(toggleAndOrTexts);\n $('.boxzilla-rule-row').each(setContextualHelpers);\n});\n\nfunction toggleAndOrTexts() {\n var newText = ruleComparisonEl.value === 'any' ? i18n.or : i18n.and;\n $('.boxzilla-andor').text(newText);\n}\n\nfunction toggleTriggerOptions() {\n $optionControls.find('.boxzilla-trigger-options').toggle(this.value !== '');\n}\n\nfunction removeRule() {\n var row = $(this).parents('tr'); // delete andor row\n\n row.prev().remove(); // delete rule row\n\n row.remove();\n}\n\nfunction setContextualHelpers() {\n var context = this.tagName.toLowerCase() === 'tr' ? this : $(this).parents('tr').get(0);\n var condition = context.querySelector('.boxzilla-rule-condition').value;\n var valueInput = context.querySelector('.boxzilla-rule-value');\n var qualifierInput = context.querySelector('.boxzilla-rule-qualifier');\n var betterInput = valueInput.cloneNode(true);\n var $betterInput = $(betterInput); // remove previously added helpers\n\n $(context.querySelectorAll('.boxzilla-helper')).remove(); // prepare better input\n\n betterInput.removeAttribute('name');\n betterInput.className = betterInput.className + ' boxzilla-helper';\n valueInput.parentNode.insertBefore(betterInput, valueInput.nextSibling);\n $betterInput.change(function () {\n valueInput.value = this.value;\n });\n betterInput.style.display = '';\n valueInput.style.display = 'none';\n qualifierInput.style.display = '';\n qualifierInput.querySelector('option[value=\"not_contains\"]').style.display = 'none';\n qualifierInput.querySelector('option[value=\"contains\"]').style.display = 'none';\n\n if (tnLoggedIn.parentNode) {\n tnLoggedIn.parentNode.removeChild(tnLoggedIn);\n } // change placeholder for textual help\n\n\n switch (condition) {\n default:\n betterInput.placeholder = i18n.enterCommaSeparatedValues;\n break;\n\n case '':\n case 'everywhere':\n qualifierInput.value = '1';\n valueInput.value = '';\n betterInput.style.display = 'none';\n qualifierInput.style.display = 'none';\n break;\n\n case 'is_single':\n case 'is_post':\n betterInput.placeholder = i18n.enterCommaSeparatedPosts;\n $betterInput.suggest(ajaxurl + '?action=boxzilla_autocomplete&type=post', {\n multiple: true,\n multipleSep: ','\n });\n break;\n\n case 'is_page':\n betterInput.placeholder = i18n.enterCommaSeparatedPages;\n $betterInput.suggest(ajaxurl + '?action=boxzilla_autocomplete&type=page', {\n multiple: true,\n multipleSep: ','\n });\n break;\n\n case 'is_post_type':\n betterInput.placeholder = i18n.enterCommaSeparatedPostTypes;\n $betterInput.suggest(ajaxurl + '?action=boxzilla_autocomplete&type=post_type', {\n multiple: true,\n multipleSep: ','\n });\n break;\n\n case 'is_url':\n qualifierInput.querySelector('option[value=\"contains\"]').style.display = '';\n qualifierInput.querySelector('option[value=\"not_contains\"]').style.display = '';\n betterInput.placeholder = i18n.enterCommaSeparatedRelativeUrls;\n break;\n\n case 'is_post_in_category':\n $betterInput.suggest(ajaxurl + '?action=boxzilla_autocomplete&type=category', {\n multiple: true,\n multipleSep: ','\n });\n break;\n\n case 'is_post_with_tag':\n $betterInput.suggest(ajaxurl + '?action=boxzilla_autocomplete&type=post_tag', {\n multiple: true,\n multipleSep: ','\n });\n break;\n\n case 'is_user_logged_in':\n betterInput.style.display = 'none';\n valueInput.parentNode.insertBefore(tnLoggedIn, valueInput.nextSibling);\n break;\n\n case 'is_referer':\n qualifierInput.querySelector('option[value=\"contains\"]').style.display = '';\n qualifierInput.querySelector('option[value=\"not_contains\"]').style.display = '';\n break;\n }\n}\n\nfunction addRuleFields() {\n var data = {\n key: optionControls.querySelectorAll('.boxzilla-rule-row').length,\n andor: ruleComparisonEl.value === 'any' ? i18n.or : i18n.and\n };\n var html = rowTemplate(data);\n $(rulesContainerEl).append(html);\n return false;\n}\n\nmodule.exports = {\n Designer: Designer,\n Option: Option,\n events: events\n};\n\n},{\"./_designer.js\":3,\"./_option.js\":4,\"wolfy87-eventemitter\":5}],3:[function(require,module,exports){\n\"use strict\";\n\nfunction _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nvar Designer = function Designer($, Option, events) {\n // vars\n var boxId = document.getElementById('post_ID').value || 0;\n var $editor;\n var $editorFrame;\n var $innerEditor;\n var options = {};\n var visualEditorInitialised = false;\n var $appearanceControls = $('#boxzilla-box-appearance-controls'); // functions\n\n function init() {\n // Only run if TinyMCE has actually inited\n if (_typeof(window.tinyMCE) !== 'object' || window.tinyMCE.get('content') === null) {\n return;\n } // create Option objects\n\n\n options.borderColor = new Option('border-color');\n options.borderWidth = new Option('border-width');\n options.borderStyle = new Option('border-style');\n options.backgroundColor = new Option('background-color');\n options.width = new Option('width');\n options.color = new Option('color'); // add classes to TinyMCE <html>\n\n $editorFrame = $('#content_ifr');\n $editor = $editorFrame.contents().find('html');\n $editor.css({\n background: 'white'\n }); // add content class and padding to TinyMCE <body>\n\n $innerEditor = $editor.find('#tinymce');\n $innerEditor.addClass('boxzilla boxzilla-' + boxId);\n $innerEditor.css({\n margin: 0,\n background: 'white',\n display: 'inline-block',\n width: 'auto',\n 'min-width': '240px',\n position: 'relative'\n });\n $innerEditor.get(0).style.cssText += ';padding: 25px !important;';\n visualEditorInitialised = true;\n /* @since 2.0.3 */\n\n events.trigger('editor.init');\n }\n /**\n * Applies the styles from the options to the TinyMCE Editor\n *\n * @return bool\n */\n\n\n function applyStyles() {\n if (!visualEditorInitialised) {\n return false;\n } // Apply styles from CSS editor.\n // Use short timeout to make sure color values are updated.\n\n\n window.setTimeout(function () {\n $innerEditor.css({\n 'border-color': options.borderColor.getColorValue(),\n // getColorValue( 'borderColor', '' ),\n 'border-width': options.borderWidth.getPxValue(),\n // getPxValue( 'borderWidth', '' ),\n 'border-style': options.borderStyle.getValue(),\n // getValue('borderStyle', '' ),\n 'background-color': options.backgroundColor.getColorValue(),\n // getColorValue( 'backgroundColor', ''),\n width: options.width.getPxValue(),\n // getPxValue( 'width', 'auto' ),\n color: options.color.getColorValue() // getColorValue( 'color', '' )\n\n });\n /* @since 2.0.3 */\n\n events.trigger('editor.styles.apply');\n }, 10);\n return true;\n }\n\n function resetStyles() {\n for (var key in options) {\n if (key.substring(0, 5) === 'theme') {\n continue;\n }\n\n options[key].clear();\n }\n\n applyStyles();\n /* @since 2.0.3 */\n\n events.trigger('editor.styles.reset');\n } // event binders\n\n\n $appearanceControls.find('input.boxzilla-color-field').wpColorPicker({\n change: applyStyles,\n clear: applyStyles\n });\n $appearanceControls.find(':input').not('.boxzilla-color-field').change(applyStyles);\n events.on('editor.init', applyStyles); // public methods\n\n return {\n init: init,\n resetStyles: resetStyles,\n options: options\n };\n};\n\nmodule.exports = Designer;\n\n},{}],4:[function(require,module,exports){\n\"use strict\";\n\nvar $ = window.jQuery;\n\nvar Option = function Option(element) {\n // find corresponding element\n if (typeof element === 'string') {\n element = document.getElementById('boxzilla-' + element);\n }\n\n if (!element) {\n console.error('Unable to find option element.');\n }\n\n this.element = element;\n};\n\nOption.prototype.getColorValue = function () {\n if (this.element.value.length > 0) {\n if ($(this.element).hasClass('wp-color-field')) {\n return $(this.element).wpColorPicker('color');\n } else {\n return this.element.value;\n }\n }\n\n return '';\n};\n\nOption.prototype.getPxValue = function (fallbackValue) {\n if (this.element.value.length > 0) {\n return parseInt(this.element.value) + 'px';\n }\n\n return fallbackValue || '';\n};\n\nOption.prototype.getValue = function (fallbackValue) {\n if (this.element.value.length > 0) {\n return this.element.value;\n }\n\n return fallbackValue || '';\n};\n\nOption.prototype.clear = function () {\n this.element.value = '';\n};\n\nOption.prototype.setValue = function (value) {\n this.element.value = value;\n};\n\nmodule.exports = Option;\n\n},{}],5:[function(require,module,exports){\n/*!\n * EventEmitter v5.2.9 - git.io/ee\n * Unlicense - http://unlicense.org/\n * Oliver Caldwell - https://oli.me.uk/\n * @preserve\n */\n\n;(function (exports) {\n 'use strict';\n\n /**\n * Class for managing events.\n * Can be extended to provide event functionality in other classes.\n *\n * @class EventEmitter Manages event registering and emitting.\n */\n function EventEmitter() {}\n\n // Shortcuts to improve speed and size\n var proto = EventEmitter.prototype;\n var originalGlobalValue = exports.EventEmitter;\n\n /**\n * Finds the index of the listener for the event in its storage array.\n *\n * @param {Function[]} listeners Array of listeners to search through.\n * @param {Function} listener Method to look for.\n * @return {Number} Index of the specified listener, -1 if not found\n * @api private\n */\n function indexOfListener(listeners, listener) {\n var i = listeners.length;\n while (i--) {\n if (listeners[i].listener === listener) {\n return i;\n }\n }\n\n return -1;\n }\n\n /**\n * Alias a method while keeping the context correct, to allow for overwriting of target method.\n *\n * @param {String} name The name of the target method.\n * @return {Function} The aliased method\n * @api private\n */\n function alias(name) {\n return function aliasClosure() {\n return this[name].apply(this, arguments);\n };\n }\n\n /**\n * Returns the listener array for the specified event.\n * Will initialise the event object and listener arrays if required.\n * Will return an object if you use a regex search. The object contains keys for each matched event. So /ba[rz]/ might return an object containing bar and baz. But only if you have either defined them with defineEvent or added some listeners to them.\n * Each property in the object response is an array of listener functions.\n *\n * @param {String|RegExp} evt Name of the event to return the listeners from.\n * @return {Function[]|Object} All listener functions for the event.\n */\n proto.getListeners = function getListeners(evt) {\n var events = this._getEvents();\n var response;\n var key;\n\n // Return a concatenated array of all matching events if\n // the selector is a regular expression.\n if (evt instanceof RegExp) {\n response = {};\n for (key in events) {\n if (events.hasOwnProperty(key) && evt.test(key)) {\n response[key] = events[key];\n }\n }\n }\n else {\n response = events[evt] || (events[evt] = []);\n }\n\n return response;\n };\n\n /**\n * Takes a list of listener objects and flattens it into a list of listener functions.\n *\n * @param {Object[]} listeners Raw listener objects.\n * @return {Function[]} Just the listener functions.\n */\n proto.flattenListeners = function flattenListeners(listeners) {\n var flatListeners = [];\n var i;\n\n for (i = 0; i < listeners.length; i += 1) {\n flatListeners.push(listeners[i].listener);\n }\n\n return flatListeners;\n };\n\n /**\n * Fetches the requested listeners via getListeners but will always return the results inside an object. This is mainly for internal use but others may find it useful.\n *\n * @param {String|RegExp} evt Name of the event to return the listeners from.\n * @return {Object} All listener functions for an event in an object.\n */\n proto.getListenersAsObject = function getListenersAsObject(evt) {\n var listeners = this.getListeners(evt);\n var response;\n\n if (listeners instanceof Array) {\n response = {};\n response[evt] = listeners;\n }\n\n return response || listeners;\n };\n\n function isValidListener (listener) {\n if (typeof listener === 'function' || listener instanceof RegExp) {\n return true\n } else if (listener && typeof listener === 'object') {\n return isValidListener(listener.listener)\n } else {\n return false\n }\n }\n\n /**\n * Adds a listener function to the specified event.\n * The listener will not be added if it is a duplicate.\n * If the listener returns true then it will be removed after it is called.\n * If you pass a regular expression as the event name then the listener will be added to all events that match it.\n *\n * @param {String|RegExp} evt Name of the event to attach the listener to.\n * @param {Function} listener Method to be called when the event is emitted. If the function returns true then it will be removed after calling.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.addListener = function addListener(evt, listener) {\n if (!isValidListener(listener)) {\n throw new TypeError('listener must be a function');\n }\n\n var listeners = this.getListenersAsObject(evt);\n var listenerIsWrapped = typeof listener === 'object';\n var key;\n\n for (key in listeners) {\n if (listeners.hasOwnProperty(key) && indexOfListener(listeners[key], listener) === -1) {\n listeners[key].push(listenerIsWrapped ? listener : {\n listener: listener,\n once: false\n });\n }\n }\n\n return this;\n };\n\n /**\n * Alias of addListener\n */\n proto.on = alias('addListener');\n\n /**\n * Semi-alias of addListener. It will add a listener that will be\n * automatically removed after its first execution.\n *\n * @param {String|RegExp} evt Name of the event to attach the listener to.\n * @param {Function} listener Method to be called when the event is emitted. If the function returns true then it will be removed after calling.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.addOnceListener = function addOnceListener(evt, listener) {\n return this.addListener(evt, {\n listener: listener,\n once: true\n });\n };\n\n /**\n * Alias of addOnceListener.\n */\n proto.once = alias('addOnceListener');\n\n /**\n * Defines an event name. This is required if you want to use a regex to add a listener to multiple events at once. If you don't do this then how do you expect it to know what event to add to? Should it just add to every possible match for a regex? No. That is scary and bad.\n * You need to tell it what event names should be matched by a regex.\n *\n * @param {String} evt Name of the event to create.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.defineEvent = function defineEvent(evt) {\n this.getListeners(evt);\n return this;\n };\n\n /**\n * Uses defineEvent to define multiple events.\n *\n * @param {String[]} evts An array of event names to define.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.defineEvents = function defineEvents(evts) {\n for (var i = 0; i < evts.length; i += 1) {\n this.defineEvent(evts[i]);\n }\n return this;\n };\n\n /**\n * Removes a listener function from the specified event.\n * When passed a regular expression as the event name, it will remove the listener from all events that match it.\n *\n * @param {String|RegExp} evt Name of the event to remove the listener from.\n * @param {Function} listener Method to remove from the event.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.removeListener = function removeListener(evt, listener) {\n var listeners = this.getListenersAsObject(evt);\n var index;\n var key;\n\n for (key in listeners) {\n if (listeners.hasOwnProperty(key)) {\n index = indexOfListener(listeners[key], listener);\n\n if (index !== -1) {\n listeners[key].splice(index, 1);\n }\n }\n }\n\n return this;\n };\n\n /**\n * Alias of removeListener\n */\n proto.off = alias('removeListener');\n\n /**\n * Adds listeners in bulk using the manipulateListeners method.\n * If you pass an object as the first argument you can add to multiple events at once. The object should contain key value pairs of events and listeners or listener arrays. You can also pass it an event name and an array of listeners to be added.\n * You can also pass it a regular expression to add the array of listeners to all events that match it.\n * Yeah, this function does quite a bit. That's probably a bad thing.\n *\n * @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to add to multiple events at once.\n * @param {Function[]} [listeners] An optional array of listener functions to add.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.addListeners = function addListeners(evt, listeners) {\n // Pass through to manipulateListeners\n return this.manipulateListeners(false, evt, listeners);\n };\n\n /**\n * Removes listeners in bulk using the manipulateListeners method.\n * If you pass an object as the first argument you can remove from multiple events at once. The object should contain key value pairs of events and listeners or listener arrays.\n * You can also pass it an event name and an array of listeners to be removed.\n * You can also pass it a regular expression to remove the listeners from all events that match it.\n *\n * @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to remove from multiple events at once.\n * @param {Function[]} [listeners] An optional array of listener functions to remove.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.removeListeners = function removeListeners(evt, listeners) {\n // Pass through to manipulateListeners\n return this.manipulateListeners(true, evt, listeners);\n };\n\n /**\n * Edits listeners in bulk. The addListeners and removeListeners methods both use this to do their job. You should really use those instead, this is a little lower level.\n * The first argument will determine if the listeners are removed (true) or added (false).\n * If you pass an object as the second argument you can add/remove from multiple events at once. The object should contain key value pairs of events and listeners or listener arrays.\n * You can also pass it an event name and an array of listeners to be added/removed.\n * You can also pass it a regular expression to manipulate the listeners of all events that match it.\n *\n * @param {Boolean} remove True if you want to remove listeners, false if you want to add.\n * @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to add/remove from multiple events at once.\n * @param {Function[]} [listeners] An optional array of listener functions to add/remove.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.manipulateListeners = function manipulateListeners(remove, evt, listeners) {\n var i;\n var value;\n var single = remove ? this.removeListener : this.addListener;\n var multiple = remove ? this.removeListeners : this.addListeners;\n\n // If evt is an object then pass each of its properties to this method\n if (typeof evt === 'object' && !(evt instanceof RegExp)) {\n for (i in evt) {\n if (evt.hasOwnProperty(i) && (value = evt[i])) {\n // Pass the single listener straight through to the singular method\n if (typeof value === 'function') {\n single.call(this, i, value);\n }\n else {\n // Otherwise pass back to the multiple function\n multiple.call(this, i, value);\n }\n }\n }\n }\n else {\n // So evt must be a string\n // And listeners must be an array of listeners\n // Loop over it and pass each one to the multiple method\n i = listeners.length;\n while (i--) {\n single.call(this, evt, listeners[i]);\n }\n }\n\n return this;\n };\n\n /**\n * Removes all listeners from a specified event.\n * If you do not specify an event then all listeners will be removed.\n * That means every event will be emptied.\n * You can also pass a regex to remove all events that match it.\n *\n * @param {String|RegExp} [evt] Optional name of the event to remove all listeners for. Will remove from every event if not passed.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.removeEvent = function removeEvent(evt) {\n var type = typeof evt;\n var events = this._getEvents();\n var key;\n\n // Remove different things depending on the state of evt\n if (type === 'string') {\n // Remove all listeners for the specified event\n delete events[evt];\n }\n else if (evt instanceof RegExp) {\n // Remove all events matching the regex.\n for (key in events) {\n if (events.hasOwnProperty(key) && evt.test(key)) {\n delete events[key];\n }\n }\n }\n else {\n // Remove all listeners in all events\n delete this._events;\n }\n\n return this;\n };\n\n /**\n * Alias of removeEvent.\n *\n * Added to mirror the node API.\n */\n proto.removeAllListeners = alias('removeEvent');\n\n /**\n * Emits an event of your choice.\n * When emitted, every listener attached to that event will be executed.\n * If you pass the optional argument array then those arguments will be passed to every listener upon execution.\n * Because it uses `apply`, your array of arguments will be passed as if you wrote them out separately.\n * So they will not arrive within the array on the other side, they will be separate.\n * You can also pass a regular expression to emit to all events that match it.\n *\n * @param {String|RegExp} evt Name of the event to emit and execute listeners for.\n * @param {Array} [args] Optional array of arguments to be passed to each listener.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.emitEvent = function emitEvent(evt, args) {\n var listenersMap = this.getListenersAsObject(evt);\n var listeners;\n var listener;\n var i;\n var key;\n var response;\n\n for (key in listenersMap) {\n if (listenersMap.hasOwnProperty(key)) {\n listeners = listenersMap[key].slice(0);\n\n for (i = 0; i < listeners.length; i++) {\n // If the listener returns true then it shall be removed from the event\n // The function is executed either with a basic call or an apply if there is an args array\n listener = listeners[i];\n\n if (listener.once === true) {\n this.removeListener(evt, listener.listener);\n }\n\n response = listener.listener.apply(this, args || []);\n\n if (response === this._getOnceReturnValue()) {\n this.removeListener(evt, listener.listener);\n }\n }\n }\n }\n\n return this;\n };\n\n /**\n * Alias of emitEvent\n */\n proto.trigger = alias('emitEvent');\n\n /**\n * Subtly different from emitEvent in that it will pass its arguments on to the listeners, as opposed to taking a single array of arguments to pass on.\n * As with emitEvent, you can pass a regex in place of the event name to emit to all events that match it.\n *\n * @param {String|RegExp} evt Name of the event to emit and execute listeners for.\n * @param {...*} Optional additional arguments to be passed to each listener.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.emit = function emit(evt) {\n var args = Array.prototype.slice.call(arguments, 1);\n return this.emitEvent(evt, args);\n };\n\n /**\n * Sets the current value to check against when executing listeners. If a\n * listeners return value matches the one set here then it will be removed\n * after execution. This value defaults to true.\n *\n * @param {*} value The new value to check for when executing listeners.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.setOnceReturnValue = function setOnceReturnValue(value) {\n this._onceReturnValue = value;\n return this;\n };\n\n /**\n * Fetches the current value to check against when executing listeners. If\n * the listeners return value matches this one then it should be removed\n * automatically. It will return true by default.\n *\n * @return {*|Boolean} The current value to check for or the default, true.\n * @api private\n */\n proto._getOnceReturnValue = function _getOnceReturnValue() {\n if (this.hasOwnProperty('_onceReturnValue')) {\n return this._onceReturnValue;\n }\n else {\n return true;\n }\n };\n\n /**\n * Fetches the events object and creates one if required.\n *\n * @return {Object} The events storage object.\n * @api private\n */\n proto._getEvents = function _getEvents() {\n return this._events || (this._events = {});\n };\n\n /**\n * Reverts the global {@link EventEmitter} to its previous value and returns a reference to this version.\n *\n * @return {Function} Non conflicting EventEmitter class.\n */\n EventEmitter.noConflict = function noConflict() {\n exports.EventEmitter = originalGlobalValue;\n return EventEmitter;\n };\n\n // Expose the class either via AMD, CommonJS or the global object\n if (typeof define === 'function' && define.amd) {\n define(function () {\n return EventEmitter;\n });\n }\n else if (typeof module === 'object' && module.exports){\n module.exports = EventEmitter;\n }\n else {\n exports.EventEmitter = EventEmitter;\n }\n}(typeof window !== 'undefined' ? window : this || {}));\n\n},{}]},{},[1]);\n; })();"]}
assets/js/script.js CHANGED
@@ -4,13 +4,9 @@
4
  function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
5
 
6
  (function () {
7
- 'use strict';
8
-
9
  var Boxzilla = require('boxzilla');
10
 
11
- var options = window.boxzilla_options; // expose Boxzilla object to window
12
-
13
- window.Boxzilla = Boxzilla; // helper function for setting CSS styles
14
 
15
  function css(element, styles) {
16
  if (styles.background_color) {
@@ -26,7 +22,7 @@ function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterat
26
  }
27
 
28
  if (styles.border_width) {
29
- element.style.borderWidth = parseInt(styles.border_width) + "px";
30
  }
31
 
32
  if (styles.border_style) {
@@ -34,7 +30,7 @@ function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterat
34
  }
35
 
36
  if (styles.width) {
37
- element.style.maxWidth = parseInt(styles.width) + "px";
38
  }
39
  }
40
 
@@ -66,8 +62,8 @@ function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterat
66
  css(box.element, boxOpts.css);
67
 
68
  try {
69
- box.element.firstChild.firstChild.className += " first-child";
70
- box.element.firstChild.lastChild.className += " last-child";
71
  } catch (e) {} // maybe show box right away
72
 
73
 
@@ -85,14 +81,14 @@ function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterat
85
  }
86
 
87
  function locationHashRefersBox(box) {
88
- if (!window.location.hash || 0 === window.location.hash.length) {
89
  return false;
90
  } // parse "boxzilla-{id}" from location hash
91
 
92
 
93
  var match = window.location.hash.match(/[#&](boxzilla-\d+)/);
94
 
95
- if (!match || _typeof(match) !== "object" || match.length < 2) {
96
  return false;
97
  }
98
 
@@ -108,12 +104,12 @@ function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterat
108
  }
109
 
110
  function maybeOpenMailChimpForWordPressBox() {
111
- if ((_typeof(window.mc4wp_forms_config) !== "object" || !window.mc4wp_forms_config.submitted_form) && _typeof(window.mc4wp_submitted_form) !== "object") {
112
  return;
113
  }
114
 
115
- var submitted_form = window.mc4wp_submitted_form || window.mc4wp_forms_config.submitted_form;
116
- var selector = '#' + submitted_form.element_id;
117
  Boxzilla.boxes.forEach(function (box) {
118
  if (box.element.querySelector(selector)) {
119
  box.show();
@@ -135,7 +131,7 @@ function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterat
135
  })();
136
 
137
  },{"boxzilla":4}],2:[function(require,module,exports){
138
- 'use strict';
139
 
140
  var duration = 320;
141
 
@@ -204,7 +200,7 @@ function toggle(element, animation, callbackFn) {
204
  }; // store attribute so everyone knows we're animating this element
205
 
206
 
207
- element.setAttribute('data-animated', "true"); // toggle element visiblity right away if we're making something visible
208
 
209
  if (!nowVisible) {
210
  element.style.display = '';
@@ -214,12 +210,12 @@ function toggle(element, animation, callbackFn) {
214
  var visibleStyles; // animate properties
215
 
216
  if (animation === 'slide') {
217
- hiddenStyles = initObjectProperties(["height", "borderTopWidth", "borderBottomWidth", "paddingTop", "paddingBottom"], 0);
218
  visibleStyles = {};
219
 
220
  if (!nowVisible) {
221
  var computedStyles = window.getComputedStyle(element);
222
- visibleStyles = copyObjectProperties(["height", "borderTopWidth", "borderBottomWidth", "paddingTop", "paddingBottom"], computedStyles); // in some browsers, getComputedStyle returns "auto" value. this falls back to getBoundingClientRect() in those browsers since we need an actual height.
223
 
224
  if (!isFinite(visibleStyles.height)) {
225
  var clientRect = element.getBoundingClientRect();
@@ -265,7 +261,7 @@ function animate(element, targetStyles, fn) {
265
  var to = targetStyles[property];
266
  var current = parseFloat(initialStyles[property]); // is there something to do?
267
 
268
- if (current == to) {
269
  delete targetStyles[property];
270
  continue;
271
  }
@@ -299,14 +295,14 @@ function animate(element, targetStyles, fn) {
299
 
300
 
301
  currentStyles[_property] = newValue;
302
- var suffix = _property !== "opacity" ? "px" : "";
303
- element.style[_property] = newValue + suffix;
304
  }
305
 
306
- last = +new Date(); // keep going until we're done for all props
307
 
308
  if (!done) {
309
- window.requestAnimationFrame && requestAnimationFrame(tick) || setTimeout(tick, 32);
 
310
  } else {
311
  // call callback
312
  fn && fn();
@@ -317,37 +313,35 @@ function animate(element, targetStyles, fn) {
317
  }
318
 
319
  module.exports = {
320
- 'toggle': toggle,
321
- 'animate': animate,
322
- 'animated': animated
323
  };
324
 
325
  },{}],3:[function(require,module,exports){
326
- 'use strict';
327
 
328
  var defaults = {
329
- 'animation': 'fade',
330
- 'rehide': false,
331
- 'content': '',
332
- 'cookie': null,
333
- 'icon': '&times',
334
- 'screenWidthCondition': null,
335
- 'position': 'center',
336
- 'testMode': false,
337
- 'trigger': false,
338
- 'closable': true
339
  };
340
 
341
- var events = require('./events.js');
342
-
343
  var Animator = require('./animator.js');
344
  /**
345
- * Merge 2 objects, values of the latter overwriting the former.
346
- *
347
- * @param obj1
348
- * @param obj2
349
- * @returns {*}
350
- */
351
 
352
 
353
  function merge(obj1, obj2) {
@@ -369,9 +363,9 @@ function merge(obj1, obj2) {
369
  return obj3;
370
  }
371
  /**
372
- * Get the real height of entire document.
373
- * @returns {number}
374
- */
375
 
376
 
377
  function getDocumentHeight() {
@@ -381,8 +375,9 @@ function getDocumentHeight() {
381
  } // Box Object
382
 
383
 
384
- function Box(id, config) {
385
- this.id = id; // store config values
 
386
 
387
  this.config = merge(defaults, config); // add overlay element to dom and store ref to overlay
388
 
@@ -404,9 +399,8 @@ function Box(id, config) {
404
  this.dom(); // further initialise the box
405
 
406
  this.events();
407
- }
408
 
409
- ; // initialise the box
410
 
411
  Box.prototype.events = function () {
412
  var box = this; // attach event to "close" icon inside box
@@ -420,12 +414,12 @@ Box.prototype.events = function () {
420
 
421
  this.element.addEventListener('click', function (evt) {
422
  if (evt.target.tagName === 'A') {
423
- events.trigger('box.interactions.link', [box, evt.target]);
424
  }
425
  }, false);
426
  this.element.addEventListener('submit', function (evt) {
427
  box.setCookie();
428
- events.trigger('box.interactions.form', [box, evt.target]);
429
  }, false);
430
  this.overlay.addEventListener('click', function (e) {
431
  var x = e.offsetX;
@@ -445,13 +439,13 @@ Box.prototype.dom = function () {
445
  var wrapper = document.createElement('div');
446
  wrapper.className = 'boxzilla-container boxzilla-' + this.config.position + '-container';
447
  var box = document.createElement('div');
448
- box.setAttribute('id', 'boxzilla-' + this.id);
449
  box.className = 'boxzilla boxzilla-' + this.id + ' boxzilla-' + this.config.position;
450
  box.style.display = 'none';
451
  wrapper.appendChild(box);
452
  var content;
453
 
454
- if (typeof this.config.content === "string") {
455
  content = document.createElement('div');
456
  content.innerHTML = this.config.content;
457
  } else {
@@ -465,7 +459,7 @@ Box.prototype.dom = function () {
465
 
466
  if (this.config.closable && this.config.icon) {
467
  var closeIcon = document.createElement('span');
468
- closeIcon.className = "boxzilla-close-icon";
469
  closeIcon.innerHTML = this.config.icon;
470
  box.appendChild(closeIcon);
471
  this.closeIcon = closeIcon;
@@ -488,7 +482,7 @@ Box.prototype.setCustomBoxStyling = function () {
488
  var boxHeight = this.element.clientHeight; // add scrollbar to box and limit height
489
 
490
  if (boxHeight > windowHeight) {
491
- this.element.style.maxHeight = windowHeight + "px";
492
  this.element.style.overflowY = 'scroll';
493
  } // set new top margin for boxes which are centered
494
 
@@ -496,7 +490,7 @@ Box.prototype.setCustomBoxStyling = function () {
496
  if (this.config.position === 'center') {
497
  var newTopMargin = (windowHeight - boxHeight) / 2;
498
  newTopMargin = newTopMargin >= 0 ? newTopMargin : 0;
499
- this.element.style.marginTop = newTopMargin + "px";
500
  }
501
 
502
  this.element.style.display = origDisplay;
@@ -504,8 +498,8 @@ Box.prototype.setCustomBoxStyling = function () {
504
 
505
 
506
  Box.prototype.toggle = function (show, animate) {
507
- show = typeof show === "undefined" ? !this.visible : show;
508
- animate = typeof animate === "undefined" ? true : animate; // is box already at desired visibility?
509
 
510
  if (show === this.visible) {
511
  return false;
@@ -526,13 +520,13 @@ Box.prototype.toggle = function (show, animate) {
526
 
527
  this.setCustomBoxStyling(); // trigger event
528
 
529
- events.trigger('box.' + (show ? 'show' : 'hide'), [this]); // show or hide box using selected animation
530
 
531
  if (this.config.position === 'center') {
532
  this.overlay.classList.toggle('boxzilla-' + this.id + '-overlay');
533
 
534
  if (animate) {
535
- Animator.toggle(this.overlay, "fade");
536
  } else {
537
  this.overlay.style.display = show ? '' : 'none';
538
  }
@@ -544,7 +538,7 @@ Box.prototype.toggle = function (show, animate) {
544
  return;
545
  }
546
 
547
- this.contentElement.innerHTML = this.contentElement.innerHTML;
548
  }.bind(this));
549
  } else {
550
  this.element.style.display = show ? '' : 'none';
@@ -589,10 +583,10 @@ Box.prototype.fits = function () {
589
  }
590
 
591
  switch (this.config.screenWidthCondition.condition) {
592
- case "larger":
593
  return window.innerWidth > this.config.screenWidthCondition.value;
594
 
595
- case "smaller":
596
  return window.innerWidth < this.config.screenWidthCondition.value;
597
  } // meh.. condition should be "smaller" or "larger", just return true.
598
 
@@ -640,8 +634,7 @@ Box.prototype.isCookieSet = function () {
640
  return false;
641
  }
642
 
643
- var cookieSet = document.cookie.replace(new RegExp("(?:(?:^|.*;)\\s*" + 'boxzilla_box_' + this.id + "\\s*\\=\\s*([^;]*).*$)|^.*$"), "$1") === "true";
644
- return cookieSet;
645
  }; // set cookie that disables automatically showing the box
646
 
647
 
@@ -665,10 +658,10 @@ Box.prototype.trigger = function () {
665
  }
666
  };
667
  /**
668
- * Dismisses the box and optionally sets a cookie.
669
- * @param animate
670
- * @returns {boolean}
671
- */
672
 
673
 
674
  Box.prototype.dismiss = function (animate) {
@@ -685,20 +678,18 @@ Box.prototype.dismiss = function (animate) {
685
  }
686
 
687
  this.dismissed = true;
688
- events.trigger('box.dismiss', [this]);
689
  return true;
690
  };
691
 
692
  module.exports = Box;
693
 
694
- },{"./animator.js":2,"./events.js":5}],4:[function(require,module,exports){
695
- 'use strict';
696
-
697
- var Boxzilla = require('./events.js');
698
 
699
  var Box = require('./box.js');
700
 
701
- var util = require('./util.js');
702
 
703
  var styles = require('./styles.js');
704
 
@@ -711,14 +702,14 @@ var Pageviews = require('./triggers/pageviews.js');
711
  var Time = require('./triggers/time.js');
712
 
713
  var initialised = false;
714
- var boxes = []; // "keyup" listener
 
715
 
716
- function onKeyUp(e) {
717
- if (e.keyCode === 27) {
718
- Boxzilla.dismiss();
719
  }
720
- } // recalculate heights and variables based on height
721
-
722
 
723
  function recalculateHeights() {
724
  boxes.forEach(function (box) {
@@ -727,11 +718,10 @@ function recalculateHeights() {
727
  }
728
 
729
  function onElementClick(evt) {
730
- // find <a> element in up to 3 parent elements
731
- var el = evt.target || evt.srcElement;
732
- var depth = 3;
733
 
734
- for (var i = 0; i <= depth; i++) {
735
  if (!el || el.tagName === 'A') {
736
  break;
737
  }
@@ -743,141 +733,152 @@ function onElementClick(evt) {
743
  return;
744
  }
745
 
746
- var href = el.href.toLowerCase();
747
- var match = href.match(/[#&]boxzilla-(\d+)/);
748
 
749
  if (match && match.length > 1) {
750
- var boxId = match[1];
751
- Boxzilla.toggle(boxId);
752
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
753
  } // initialise & add event listeners
754
 
755
 
756
- Boxzilla.init = function () {
757
  if (initialised) {
758
  return;
759
  } // insert styles into DOM
760
 
761
 
762
  var styleElement = document.createElement('style');
763
- styleElement.setAttribute("type", "text/css");
764
  styleElement.innerHTML = styles;
765
- document.head.appendChild(styleElement); // init exit intent triggershow
766
 
767
- new ExitIntent(boxes);
768
- new Pageviews(boxes);
769
- new Scroll(boxes);
770
- new Time(boxes);
771
  document.body.addEventListener('click', onElementClick, true);
772
- window.addEventListener('resize', util.throttle(recalculateHeights));
773
  window.addEventListener('load', recalculateHeights);
774
  document.addEventListener('keyup', onKeyUp);
775
- Boxzilla.trigger('ready');
776
  initialised = true; // ensure this function doesn't run again
777
- };
778
- /**
779
- * Create a new Box
780
- *
781
- * @param string id
782
- * @param object opts
783
- *
784
- * @returns Box
785
- */
786
-
787
 
788
- Boxzilla.create = function (id, opts) {
789
  // preserve backwards compat for minimumScreenWidth option
790
- if (typeof opts.minimumScreenWidth !== "undefined") {
791
  opts.screenWidthCondition = {
792
- condition: "larger",
793
  value: opts.minimumScreenWidth
794
  };
795
  }
796
 
797
- var box = new Box(id, opts);
 
798
  boxes.push(box);
799
  return box;
800
- };
 
 
 
801
 
802
- Boxzilla.get = function (id) {
803
  for (var i = 0; i < boxes.length; i++) {
804
- if (boxes[i].id == id) {
805
  return boxes[i];
806
  }
807
  }
808
 
809
- throw new Error("No box exists with ID " + id);
810
- }; // dismiss a single box (or all by omitting id param)
811
 
812
 
813
- Boxzilla.dismiss = function (id, animate) {
814
- // if no id given, dismiss all current open boxes
815
  if (id) {
816
- Boxzilla.get(id).dismiss(animate);
817
  } else {
818
  boxes.forEach(function (box) {
819
  return box.dismiss(animate);
820
  });
821
  }
822
- };
823
 
824
- Boxzilla.hide = function (id, animate) {
825
  if (id) {
826
- Boxzilla.get(id).hide(animate);
827
  } else {
828
  boxes.forEach(function (box) {
829
  return box.hide(animate);
830
  });
831
  }
832
- };
833
 
834
- Boxzilla.show = function (id, animate) {
835
  if (id) {
836
- Boxzilla.get(id).show(animate);
837
  } else {
838
  boxes.forEach(function (box) {
839
  return box.show(animate);
840
  });
841
  }
842
- };
843
 
844
- Boxzilla.toggle = function (id, animate) {
845
  if (id) {
846
- Boxzilla.get(id).toggle(animate);
847
  } else {
848
  boxes.forEach(function (box) {
849
  return box.toggle(animate);
850
  });
851
  }
852
- }; // expose each individual box.
853
-
854
-
855
- Boxzilla.boxes = boxes; // expose boxzilla object
856
-
 
 
 
 
 
 
 
 
 
 
 
857
  window.Boxzilla = Boxzilla;
858
 
859
  if (typeof module !== 'undefined' && module.exports) {
860
  module.exports = Boxzilla;
861
  }
862
 
863
- },{"./box.js":3,"./events.js":5,"./styles.js":6,"./triggers/exit-intent.js":8,"./triggers/pageviews.js":9,"./triggers/scroll.js":10,"./triggers/time.js":11,"./util.js":12}],5:[function(require,module,exports){
864
- 'use strict';
865
-
866
- var EventEmitter = require('wolfy87-eventemitter');
867
-
868
- module.exports = Object.create(EventEmitter.prototype);
869
-
870
- },{"wolfy87-eventemitter":13}],6:[function(require,module,exports){
871
  "use strict";
872
 
873
- var styles = "#boxzilla-overlay,.boxzilla-overlay{position:fixed;background:rgba(0,0,0,.65);width:100%;height:100%;left:0;top:0;z-index:10000}.boxzilla-center-container{position:fixed;top:0;left:0;right:0;height:0;text-align:center;z-index:11000;line-height:0}.boxzilla-center-container .boxzilla{display:inline-block;text-align:left;position:relative;line-height:normal}.boxzilla{position:fixed;z-index:12000;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;background:#fff;padding:25px}.boxzilla.boxzilla-top-left{top:0;left:0}.boxzilla.boxzilla-top-right{top:0;right:0}.boxzilla.boxzilla-bottom-left{bottom:0;left:0}.boxzilla.boxzilla-bottom-right{bottom:0;right:0}.boxzilla-content>:first-child{margin-top:0;padding-top:0}.boxzilla-content>:last-child{margin-bottom:0;padding-bottom:0}.boxzilla-close-icon{position:absolute;right:0;top:0;text-align:center;padding:6px;cursor:pointer;-webkit-appearance:none;font-size:28px;font-weight:700;line-height:20px;color:#000;opacity:.5}.boxzilla-close-icon:focus,.boxzilla-close-icon:hover{opacity:.8}";
874
  module.exports = styles;
875
 
876
- },{}],7:[function(require,module,exports){
877
  "use strict";
878
 
879
- var Timer = function Timer(start) {
880
- this.time = start;
881
  this.interval = 0;
882
  };
883
 
@@ -900,7 +901,7 @@ Timer.prototype.stop = function () {
900
 
901
  module.exports = Timer;
902
 
903
- },{}],8:[function(require,module,exports){
904
  "use strict";
905
 
906
  module.exports = function (boxes) {
@@ -930,7 +931,7 @@ module.exports = function (boxes) {
930
  timeout = null;
931
  }
932
 
933
- function onMouseEnter(evt) {
934
  clearTimeout();
935
  }
936
 
@@ -946,12 +947,12 @@ module.exports = function (boxes) {
946
  clearTimeout(); // did mouse leave at top of window?
947
  // add small exception space in the top-right corner
948
 
949
- if (evt.clientY <= getAddressBarY() && evt.clientX < 0.80 * window.innerWidth) {
950
- timeout = window.setTimeout(trigger, 400);
951
  }
952
  }
953
 
954
- function onTouchStart(evt) {
955
  clearTimeout();
956
  touchStart = {
957
  timestamp: performance.now(),
@@ -968,7 +969,7 @@ module.exports = function (boxes) {
968
  } // allow a tiny tiny margin for error, to not fire on clicks
969
 
970
 
971
- if (window.scrollY + 20 >= touchStart.scrollY) {
972
  return;
973
  }
974
 
@@ -990,7 +991,7 @@ module.exports = function (boxes) {
990
  document.documentElement.addEventListener('click', clearTimeout);
991
  };
992
 
993
- },{}],9:[function(require,module,exports){
994
  "use strict";
995
 
996
  module.exports = function (boxes) {
@@ -1005,14 +1006,14 @@ module.exports = function (boxes) {
1005
 
1006
  window.setTimeout(function () {
1007
  boxes.forEach(function (box) {
1008
- if (box.config.trigger.method === 'pageviews' && pageviews >= box.config.trigger.value && box.mayAutoShow()) {
1009
  box.trigger();
1010
  }
1011
  });
1012
  }, 1000);
1013
  };
1014
 
1015
- },{}],10:[function(require,module,exports){
1016
  "use strict";
1017
 
1018
  var throttle = require('../util.js').throttle;
@@ -1029,10 +1030,8 @@ module.exports = function (boxes) {
1029
 
1030
  if (scrollY > box.triggerHeight) {
1031
  box.trigger();
1032
- } // if box may auto-hide and scrollY is less than triggerHeight (with small margin of error), hide box
1033
-
1034
-
1035
- if (box.mayRehide() && scrollY < box.triggerHeight - 5) {
1036
  box.hide();
1037
  }
1038
  });
@@ -1042,14 +1041,14 @@ module.exports = function (boxes) {
1042
  window.addEventListener('scroll', throttle(checkHeightCriteria), true);
1043
  };
1044
 
1045
- },{"../util.js":12}],11:[function(require,module,exports){
1046
  "use strict";
1047
 
1048
  var Timer = require('../timer.js');
1049
 
1050
  module.exports = function (boxes) {
1051
- var siteTimer = new Timer(0);
1052
- var pageTimer = new Timer(0);
1053
  var timers = {
1054
  start: function start() {
1055
  try {
@@ -1072,7 +1071,7 @@ module.exports = function (boxes) {
1072
 
1073
  timers.start(); // stop timers when leaving page or switching to other tab
1074
 
1075
- document.addEventListener("visibilitychange", function () {
1076
  document.hidden ? timers.stop() : timers.start();
1077
  });
1078
  window.addEventListener('beforeunload', function () {
@@ -1080,28 +1079,26 @@ module.exports = function (boxes) {
1080
  });
1081
  window.setInterval(function () {
1082
  boxes.forEach(function (box) {
1083
- if (box.config.trigger.method === 'time_on_site' && siteTimer.time >= box.config.trigger.value && box.mayAutoShow()) {
1084
  box.trigger();
1085
- }
1086
-
1087
- if (box.config.trigger.method === 'time_on_page' && pageTimer.time >= box.config.trigger.value && box.mayAutoShow()) {
1088
  box.trigger();
1089
  }
1090
  });
1091
  }, 1000);
1092
  };
1093
 
1094
- },{"../timer.js":7}],12:[function(require,module,exports){
1095
  "use strict";
1096
 
1097
  function throttle(fn, threshold, scope) {
1098
- threshold || (threshold = 600);
1099
  var last;
1100
  var deferTimer;
1101
  return function () {
1102
  var context = scope || this;
1103
- var now = +new Date(),
1104
- args = arguments;
1105
 
1106
  if (last && now < last + threshold) {
1107
  // hold on to it
@@ -1121,493 +1118,5 @@ module.exports = {
1121
  throttle: throttle
1122
  };
1123
 
1124
- },{}],13:[function(require,module,exports){
1125
- /*!
1126
- * EventEmitter v5.2.8 - git.io/ee
1127
- * Unlicense - http://unlicense.org/
1128
- * Oliver Caldwell - https://oli.me.uk/
1129
- * @preserve
1130
- */
1131
-
1132
- ;(function (exports) {
1133
- 'use strict';
1134
-
1135
- /**
1136
- * Class for managing events.
1137
- * Can be extended to provide event functionality in other classes.
1138
- *
1139
- * @class EventEmitter Manages event registering and emitting.
1140
- */
1141
- function EventEmitter() {}
1142
-
1143
- // Shortcuts to improve speed and size
1144
- var proto = EventEmitter.prototype;
1145
- var originalGlobalValue = exports.EventEmitter;
1146
-
1147
- /**
1148
- * Finds the index of the listener for the event in its storage array.
1149
- *
1150
- * @param {Function[]} listeners Array of listeners to search through.
1151
- * @param {Function} listener Method to look for.
1152
- * @return {Number} Index of the specified listener, -1 if not found
1153
- * @api private
1154
- */
1155
- function indexOfListener(listeners, listener) {
1156
- var i = listeners.length;
1157
- while (i--) {
1158
- if (listeners[i].listener === listener) {
1159
- return i;
1160
- }
1161
- }
1162
-
1163
- return -1;
1164
- }
1165
-
1166
- /**
1167
- * Alias a method while keeping the context correct, to allow for overwriting of target method.
1168
- *
1169
- * @param {String} name The name of the target method.
1170
- * @return {Function} The aliased method
1171
- * @api private
1172
- */
1173
- function alias(name) {
1174
- return function aliasClosure() {
1175
- return this[name].apply(this, arguments);
1176
- };
1177
- }
1178
-
1179
- /**
1180
- * Returns the listener array for the specified event.
1181
- * Will initialise the event object and listener arrays if required.
1182
- * Will return an object if you use a regex search. The object contains keys for each matched event. So /ba[rz]/ might return an object containing bar and baz. But only if you have either defined them with defineEvent or added some listeners to them.
1183
- * Each property in the object response is an array of listener functions.
1184
- *
1185
- * @param {String|RegExp} evt Name of the event to return the listeners from.
1186
- * @return {Function[]|Object} All listener functions for the event.
1187
- */
1188
- proto.getListeners = function getListeners(evt) {
1189
- var events = this._getEvents();
1190
- var response;
1191
- var key;
1192
-
1193
- // Return a concatenated array of all matching events if
1194
- // the selector is a regular expression.
1195
- if (evt instanceof RegExp) {
1196
- response = {};
1197
- for (key in events) {
1198
- if (events.hasOwnProperty(key) && evt.test(key)) {
1199
- response[key] = events[key];
1200
- }
1201
- }
1202
- }
1203
- else {
1204
- response = events[evt] || (events[evt] = []);
1205
- }
1206
-
1207
- return response;
1208
- };
1209
-
1210
- /**
1211
- * Takes a list of listener objects and flattens it into a list of listener functions.
1212
- *
1213
- * @param {Object[]} listeners Raw listener objects.
1214
- * @return {Function[]} Just the listener functions.
1215
- */
1216
- proto.flattenListeners = function flattenListeners(listeners) {
1217
- var flatListeners = [];
1218
- var i;
1219
-
1220
- for (i = 0; i < listeners.length; i += 1) {
1221
- flatListeners.push(listeners[i].listener);
1222
- }
1223
-
1224
- return flatListeners;
1225
- };
1226
-
1227
- /**
1228
- * Fetches the requested listeners via getListeners but will always return the results inside an object. This is mainly for internal use but others may find it useful.
1229
- *
1230
- * @param {String|RegExp} evt Name of the event to return the listeners from.
1231
- * @return {Object} All listener functions for an event in an object.
1232
- */
1233
- proto.getListenersAsObject = function getListenersAsObject(evt) {
1234
- var listeners = this.getListeners(evt);
1235
- var response;
1236
-
1237
- if (listeners instanceof Array) {
1238
- response = {};
1239
- response[evt] = listeners;
1240
- }
1241
-
1242
- return response || listeners;
1243
- };
1244
-
1245
- function isValidListener (listener) {
1246
- if (typeof listener === 'function' || listener instanceof RegExp) {
1247
- return true
1248
- } else if (listener && typeof listener === 'object') {
1249
- return isValidListener(listener.listener)
1250
- } else {
1251
- return false
1252
- }
1253
- }
1254
-
1255
- /**
1256
- * Adds a listener function to the specified event.
1257
- * The listener will not be added if it is a duplicate.
1258
- * If the listener returns true then it will be removed after it is called.
1259
- * If you pass a regular expression as the event name then the listener will be added to all events that match it.
1260
- *
1261
- * @param {String|RegExp} evt Name of the event to attach the listener to.
1262
- * @param {Function} listener Method to be called when the event is emitted. If the function returns true then it will be removed after calling.
1263
- * @return {Object} Current instance of EventEmitter for chaining.
1264
- */
1265
- proto.addListener = function addListener(evt, listener) {
1266
- if (!isValidListener(listener)) {
1267
- throw new TypeError('listener must be a function');
1268
- }
1269
-
1270
- var listeners = this.getListenersAsObject(evt);
1271
- var listenerIsWrapped = typeof listener === 'object';
1272
- var key;
1273
-
1274
- for (key in listeners) {
1275
- if (listeners.hasOwnProperty(key) && indexOfListener(listeners[key], listener) === -1) {
1276
- listeners[key].push(listenerIsWrapped ? listener : {
1277
- listener: listener,
1278
- once: false
1279
- });
1280
- }
1281
- }
1282
-
1283
- return this;
1284
- };
1285
-
1286
- /**
1287
- * Alias of addListener
1288
- */
1289
- proto.on = alias('addListener');
1290
-
1291
- /**
1292
- * Semi-alias of addListener. It will add a listener that will be
1293
- * automatically removed after its first execution.
1294
- *
1295
- * @param {String|RegExp} evt Name of the event to attach the listener to.
1296
- * @param {Function} listener Method to be called when the event is emitted. If the function returns true then it will be removed after calling.
1297
- * @return {Object} Current instance of EventEmitter for chaining.
1298
- */
1299
- proto.addOnceListener = function addOnceListener(evt, listener) {
1300
- return this.addListener(evt, {
1301
- listener: listener,
1302
- once: true
1303
- });
1304
- };
1305
-
1306
- /**
1307
- * Alias of addOnceListener.
1308
- */
1309
- proto.once = alias('addOnceListener');
1310
-
1311
- /**
1312
- * Defines an event name. This is required if you want to use a regex to add a listener to multiple events at once. If you don't do this then how do you expect it to know what event to add to? Should it just add to every possible match for a regex? No. That is scary and bad.
1313
- * You need to tell it what event names should be matched by a regex.
1314
- *
1315
- * @param {String} evt Name of the event to create.
1316
- * @return {Object} Current instance of EventEmitter for chaining.
1317
- */
1318
- proto.defineEvent = function defineEvent(evt) {
1319
- this.getListeners(evt);
1320
- return this;
1321
- };
1322
-
1323
- /**
1324
- * Uses defineEvent to define multiple events.
1325
- *
1326
- * @param {String[]} evts An array of event names to define.
1327
- * @return {Object} Current instance of EventEmitter for chaining.
1328
- */
1329
- proto.defineEvents = function defineEvents(evts) {
1330
- for (var i = 0; i < evts.length; i += 1) {
1331
- this.defineEvent(evts[i]);
1332
- }
1333
- return this;
1334
- };
1335
-
1336
- /**
1337
- * Removes a listener function from the specified event.
1338
- * When passed a regular expression as the event name, it will remove the listener from all events that match it.
1339
- *
1340
- * @param {String|RegExp} evt Name of the event to remove the listener from.
1341
- * @param {Function} listener Method to remove from the event.
1342
- * @return {Object} Current instance of EventEmitter for chaining.
1343
- */
1344
- proto.removeListener = function removeListener(evt, listener) {
1345
- var listeners = this.getListenersAsObject(evt);
1346
- var index;
1347
- var key;
1348
-
1349
- for (key in listeners) {
1350
- if (listeners.hasOwnProperty(key)) {
1351
- index = indexOfListener(listeners[key], listener);
1352
-
1353
- if (index !== -1) {
1354
- listeners[key].splice(index, 1);
1355
- }
1356
- }
1357
- }
1358
-
1359
- return this;
1360
- };
1361
-
1362
- /**
1363
- * Alias of removeListener
1364
- */
1365
- proto.off = alias('removeListener');
1366
-
1367
- /**
1368
- * Adds listeners in bulk using the manipulateListeners method.
1369
- * If you pass an object as the first argument you can add to multiple events at once. The object should contain key value pairs of events and listeners or listener arrays. You can also pass it an event name and an array of listeners to be added.
1370
- * You can also pass it a regular expression to add the array of listeners to all events that match it.
1371
- * Yeah, this function does quite a bit. That's probably a bad thing.
1372
- *
1373
- * @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to add to multiple events at once.
1374
- * @param {Function[]} [listeners] An optional array of listener functions to add.
1375
- * @return {Object} Current instance of EventEmitter for chaining.
1376
- */
1377
- proto.addListeners = function addListeners(evt, listeners) {
1378
- // Pass through to manipulateListeners
1379
- return this.manipulateListeners(false, evt, listeners);
1380
- };
1381
-
1382
- /**
1383
- * Removes listeners in bulk using the manipulateListeners method.
1384
- * If you pass an object as the first argument you can remove from multiple events at once. The object should contain key value pairs of events and listeners or listener arrays.
1385
- * You can also pass it an event name and an array of listeners to be removed.
1386
- * You can also pass it a regular expression to remove the listeners from all events that match it.
1387
- *
1388
- * @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to remove from multiple events at once.
1389
- * @param {Function[]} [listeners] An optional array of listener functions to remove.
1390
- * @return {Object} Current instance of EventEmitter for chaining.
1391
- */
1392
- proto.removeListeners = function removeListeners(evt, listeners) {
1393
- // Pass through to manipulateListeners
1394
- return this.manipulateListeners(true, evt, listeners);
1395
- };
1396
-
1397
- /**
1398
- * Edits listeners in bulk. The addListeners and removeListeners methods both use this to do their job. You should really use those instead, this is a little lower level.
1399
- * The first argument will determine if the listeners are removed (true) or added (false).
1400
- * If you pass an object as the second argument you can add/remove from multiple events at once. The object should contain key value pairs of events and listeners or listener arrays.
1401
- * You can also pass it an event name and an array of listeners to be added/removed.
1402
- * You can also pass it a regular expression to manipulate the listeners of all events that match it.
1403
- *
1404
- * @param {Boolean} remove True if you want to remove listeners, false if you want to add.
1405
- * @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to add/remove from multiple events at once.
1406
- * @param {Function[]} [listeners] An optional array of listener functions to add/remove.
1407
- * @return {Object} Current instance of EventEmitter for chaining.
1408
- */
1409
- proto.manipulateListeners = function manipulateListeners(remove, evt, listeners) {
1410
- var i;
1411
- var value;
1412
- var single = remove ? this.removeListener : this.addListener;
1413
- var multiple = remove ? this.removeListeners : this.addListeners;
1414
-
1415
- // If evt is an object then pass each of its properties to this method
1416
- if (typeof evt === 'object' && !(evt instanceof RegExp)) {
1417
- for (i in evt) {
1418
- if (evt.hasOwnProperty(i) && (value = evt[i])) {
1419
- // Pass the single listener straight through to the singular method
1420
- if (typeof value === 'function') {
1421
- single.call(this, i, value);
1422
- }
1423
- else {
1424
- // Otherwise pass back to the multiple function
1425
- multiple.call(this, i, value);
1426
- }
1427
- }
1428
- }
1429
- }
1430
- else {
1431
- // So evt must be a string
1432
- // And listeners must be an array of listeners
1433
- // Loop over it and pass each one to the multiple method
1434
- i = listeners.length;
1435
- while (i--) {
1436
- single.call(this, evt, listeners[i]);
1437
- }
1438
- }
1439
-
1440
- return this;
1441
- };
1442
-
1443
- /**
1444
- * Removes all listeners from a specified event.
1445
- * If you do not specify an event then all listeners will be removed.
1446
- * That means every event will be emptied.
1447
- * You can also pass a regex to remove all events that match it.
1448
- *
1449
- * @param {String|RegExp} [evt] Optional name of the event to remove all listeners for. Will remove from every event if not passed.
1450
- * @return {Object} Current instance of EventEmitter for chaining.
1451
- */
1452
- proto.removeEvent = function removeEvent(evt) {
1453
- var type = typeof evt;
1454
- var events = this._getEvents();
1455
- var key;
1456
-
1457
- // Remove different things depending on the state of evt
1458
- if (type === 'string') {
1459
- // Remove all listeners for the specified event
1460
- delete events[evt];
1461
- }
1462
- else if (evt instanceof RegExp) {
1463
- // Remove all events matching the regex.
1464
- for (key in events) {
1465
- if (events.hasOwnProperty(key) && evt.test(key)) {
1466
- delete events[key];
1467
- }
1468
- }
1469
- }
1470
- else {
1471
- // Remove all listeners in all events
1472
- delete this._events;
1473
- }
1474
-
1475
- return this;
1476
- };
1477
-
1478
- /**
1479
- * Alias of removeEvent.
1480
- *
1481
- * Added to mirror the node API.
1482
- */
1483
- proto.removeAllListeners = alias('removeEvent');
1484
-
1485
- /**
1486
- * Emits an event of your choice.
1487
- * When emitted, every listener attached to that event will be executed.
1488
- * If you pass the optional argument array then those arguments will be passed to every listener upon execution.
1489
- * Because it uses `apply`, your array of arguments will be passed as if you wrote them out separately.
1490
- * So they will not arrive within the array on the other side, they will be separate.
1491
- * You can also pass a regular expression to emit to all events that match it.
1492
- *
1493
- * @param {String|RegExp} evt Name of the event to emit and execute listeners for.
1494
- * @param {Array} [args] Optional array of arguments to be passed to each listener.
1495
- * @return {Object} Current instance of EventEmitter for chaining.
1496
- */
1497
- proto.emitEvent = function emitEvent(evt, args) {
1498
- var listenersMap = this.getListenersAsObject(evt);
1499
- var listeners;
1500
- var listener;
1501
- var i;
1502
- var key;
1503
- var response;
1504
-
1505
- for (key in listenersMap) {
1506
- if (listenersMap.hasOwnProperty(key)) {
1507
- listeners = listenersMap[key].slice(0);
1508
-
1509
- for (i = 0; i < listeners.length; i++) {
1510
- // If the listener returns true then it shall be removed from the event
1511
- // The function is executed either with a basic call or an apply if there is an args array
1512
- listener = listeners[i];
1513
-
1514
- if (listener.once === true) {
1515
- this.removeListener(evt, listener.listener);
1516
- }
1517
-
1518
- response = listener.listener.apply(this, args || []);
1519
-
1520
- if (response === this._getOnceReturnValue()) {
1521
- this.removeListener(evt, listener.listener);
1522
- }
1523
- }
1524
- }
1525
- }
1526
-
1527
- return this;
1528
- };
1529
-
1530
- /**
1531
- * Alias of emitEvent
1532
- */
1533
- proto.trigger = alias('emitEvent');
1534
-
1535
- /**
1536
- * Subtly different from emitEvent in that it will pass its arguments on to the listeners, as opposed to taking a single array of arguments to pass on.
1537
- * As with emitEvent, you can pass a regex in place of the event name to emit to all events that match it.
1538
- *
1539
- * @param {String|RegExp} evt Name of the event to emit and execute listeners for.
1540
- * @param {...*} Optional additional arguments to be passed to each listener.
1541
- * @return {Object} Current instance of EventEmitter for chaining.
1542
- */
1543
- proto.emit = function emit(evt) {
1544
- var args = Array.prototype.slice.call(arguments, 1);
1545
- return this.emitEvent(evt, args);
1546
- };
1547
-
1548
- /**
1549
- * Sets the current value to check against when executing listeners. If a
1550
- * listeners return value matches the one set here then it will be removed
1551
- * after execution. This value defaults to true.
1552
- *
1553
- * @param {*} value The new value to check for when executing listeners.
1554
- * @return {Object} Current instance of EventEmitter for chaining.
1555
- */
1556
- proto.setOnceReturnValue = function setOnceReturnValue(value) {
1557
- this._onceReturnValue = value;
1558
- return this;
1559
- };
1560
-
1561
- /**
1562
- * Fetches the current value to check against when executing listeners. If
1563
- * the listeners return value matches this one then it should be removed
1564
- * automatically. It will return true by default.
1565
- *
1566
- * @return {*|Boolean} The current value to check for or the default, true.
1567
- * @api private
1568
- */
1569
- proto._getOnceReturnValue = function _getOnceReturnValue() {
1570
- if (this.hasOwnProperty('_onceReturnValue')) {
1571
- return this._onceReturnValue;
1572
- }
1573
- else {
1574
- return true;
1575
- }
1576
- };
1577
-
1578
- /**
1579
- * Fetches the events object and creates one if required.
1580
- *
1581
- * @return {Object} The events storage object.
1582
- * @api private
1583
- */
1584
- proto._getEvents = function _getEvents() {
1585
- return this._events || (this._events = {});
1586
- };
1587
-
1588
- /**
1589
- * Reverts the global {@link EventEmitter} to its previous value and returns a reference to this version.
1590
- *
1591
- * @return {Function} Non conflicting EventEmitter class.
1592
- */
1593
- EventEmitter.noConflict = function noConflict() {
1594
- exports.EventEmitter = originalGlobalValue;
1595
- return EventEmitter;
1596
- };
1597
-
1598
- // Expose the class either via AMD, CommonJS or the global object
1599
- if (typeof define === 'function' && define.amd) {
1600
- define(function () {
1601
- return EventEmitter;
1602
- });
1603
- }
1604
- else if (typeof module === 'object' && module.exports){
1605
- module.exports = EventEmitter;
1606
- }
1607
- else {
1608
- exports.EventEmitter = EventEmitter;
1609
- }
1610
- }(typeof window !== 'undefined' ? window : this || {}));
1611
-
1612
  },{}]},{},[1]);
1613
  ; })();
4
  function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
5
 
6
  (function () {
 
 
7
  var Boxzilla = require('boxzilla');
8
 
9
+ var options = window.boxzilla_options; // helper function for setting CSS styles
 
 
10
 
11
  function css(element, styles) {
12
  if (styles.background_color) {
22
  }
23
 
24
  if (styles.border_width) {
25
+ element.style.borderWidth = parseInt(styles.border_width) + 'px';
26
  }
27
 
28
  if (styles.border_style) {
30
  }
31
 
32
  if (styles.width) {
33
+ element.style.maxWidth = parseInt(styles.width) + 'px';
34
  }
35
  }
36
 
62
  css(box.element, boxOpts.css);
63
 
64
  try {
65
+ box.element.firstChild.firstChild.className += ' first-child';
66
+ box.element.firstChild.lastChild.className += ' last-child';
67
  } catch (e) {} // maybe show box right away
68
 
69
 
81
  }
82
 
83
  function locationHashRefersBox(box) {
84
+ if (!window.location.hash || window.location.hash.length === 0) {
85
  return false;
86
  } // parse "boxzilla-{id}" from location hash
87
 
88
 
89
  var match = window.location.hash.match(/[#&](boxzilla-\d+)/);
90
 
91
+ if (!match || _typeof(match) !== 'object' || match.length < 2) {
92
  return false;
93
  }
94
 
104
  }
105
 
106
  function maybeOpenMailChimpForWordPressBox() {
107
+ if ((_typeof(window.mc4wp_forms_config) !== 'object' || !window.mc4wp_forms_config.submitted_form) && _typeof(window.mc4wp_submitted_form) !== 'object') {
108
  return;
109
  }
110
 
111
+ var form = window.mc4wp_submitted_form || window.mc4wp_forms_config.submitted_form;
112
+ var selector = '#' + form.element_id;
113
  Boxzilla.boxes.forEach(function (box) {
114
  if (box.element.querySelector(selector)) {
115
  box.show();
131
  })();
132
 
133
  },{"boxzilla":4}],2:[function(require,module,exports){
134
+ "use strict";
135
 
136
  var duration = 320;
137
 
200
  }; // store attribute so everyone knows we're animating this element
201
 
202
 
203
+ element.setAttribute('data-animated', 'true'); // toggle element visiblity right away if we're making something visible
204
 
205
  if (!nowVisible) {
206
  element.style.display = '';
210
  var visibleStyles; // animate properties
211
 
212
  if (animation === 'slide') {
213
+ hiddenStyles = initObjectProperties(['height', 'borderTopWidth', 'borderBottomWidth', 'paddingTop', 'paddingBottom'], 0);
214
  visibleStyles = {};
215
 
216
  if (!nowVisible) {
217
  var computedStyles = window.getComputedStyle(element);
218
+ visibleStyles = copyObjectProperties(['height', 'borderTopWidth', 'borderBottomWidth', 'paddingTop', 'paddingBottom'], computedStyles); // in some browsers, getComputedStyle returns "auto" value. this falls back to getBoundingClientRect() in those browsers since we need an actual height.
219
 
220
  if (!isFinite(visibleStyles.height)) {
221
  var clientRect = element.getBoundingClientRect();
261
  var to = targetStyles[property];
262
  var current = parseFloat(initialStyles[property]); // is there something to do?
263
 
264
+ if (current === to) {
265
  delete targetStyles[property];
266
  continue;
267
  }
295
 
296
 
297
  currentStyles[_property] = newValue;
298
+ element.style[_property] = _property !== 'opacity' ? newValue + 'px' : newValue;
 
299
  }
300
 
301
+ last = +new Date();
302
 
303
  if (!done) {
304
+ // keep going until we're done for all props
305
+ window.requestAnimationFrame(tick);
306
  } else {
307
  // call callback
308
  fn && fn();
313
  }
314
 
315
  module.exports = {
316
+ toggle: toggle,
317
+ animate: animate,
318
+ animated: animated
319
  };
320
 
321
  },{}],3:[function(require,module,exports){
322
+ "use strict";
323
 
324
  var defaults = {
325
+ animation: 'fade',
326
+ rehide: false,
327
+ content: '',
328
+ cookie: null,
329
+ icon: '&times',
330
+ screenWidthCondition: null,
331
+ position: 'center',
332
+ testMode: false,
333
+ trigger: false,
334
+ closable: true
335
  };
336
 
 
 
337
  var Animator = require('./animator.js');
338
  /**
339
+ * Merge 2 objects, values of the latter overwriting the former.
340
+ *
341
+ * @param obj1
342
+ * @param obj2
343
+ * @returns {*}
344
+ */
345
 
346
 
347
  function merge(obj1, obj2) {
363
  return obj3;
364
  }
365
  /**
366
+ * Get the real height of entire document.
367
+ * @returns {number}
368
+ */
369
 
370
 
371
  function getDocumentHeight() {
375
  } // Box Object
376
 
377
 
378
+ function Box(id, config, fireEvent) {
379
+ this.id = id;
380
+ this.fireEvent = fireEvent; // store config values
381
 
382
  this.config = merge(defaults, config); // add overlay element to dom and store ref to overlay
383
 
399
  this.dom(); // further initialise the box
400
 
401
  this.events();
402
+ } // initialise the box
403
 
 
404
 
405
  Box.prototype.events = function () {
406
  var box = this; // attach event to "close" icon inside box
414
 
415
  this.element.addEventListener('click', function (evt) {
416
  if (evt.target.tagName === 'A') {
417
+ this.fireEvent('box.interactions.link', [box, evt.target]);
418
  }
419
  }, false);
420
  this.element.addEventListener('submit', function (evt) {
421
  box.setCookie();
422
+ this.fireEvent('box.interactions.form', [box, evt.target]);
423
  }, false);
424
  this.overlay.addEventListener('click', function (e) {
425
  var x = e.offsetX;
439
  var wrapper = document.createElement('div');
440
  wrapper.className = 'boxzilla-container boxzilla-' + this.config.position + '-container';
441
  var box = document.createElement('div');
442
+ box.id = 'boxzilla-' + this.id;
443
  box.className = 'boxzilla boxzilla-' + this.id + ' boxzilla-' + this.config.position;
444
  box.style.display = 'none';
445
  wrapper.appendChild(box);
446
  var content;
447
 
448
+ if (typeof this.config.content === 'string') {
449
  content = document.createElement('div');
450
  content.innerHTML = this.config.content;
451
  } else {
459
 
460
  if (this.config.closable && this.config.icon) {
461
  var closeIcon = document.createElement('span');
462
+ closeIcon.className = 'boxzilla-close-icon';
463
  closeIcon.innerHTML = this.config.icon;
464
  box.appendChild(closeIcon);
465
  this.closeIcon = closeIcon;
482
  var boxHeight = this.element.clientHeight; // add scrollbar to box and limit height
483
 
484
  if (boxHeight > windowHeight) {
485
+ this.element.style.maxHeight = windowHeight + 'px';
486
  this.element.style.overflowY = 'scroll';
487
  } // set new top margin for boxes which are centered
488
 
490
  if (this.config.position === 'center') {
491
  var newTopMargin = (windowHeight - boxHeight) / 2;
492
  newTopMargin = newTopMargin >= 0 ? newTopMargin : 0;
493
+ this.element.style.marginTop = newTopMargin + 'px';
494
  }
495
 
496
  this.element.style.display = origDisplay;
498
 
499
 
500
  Box.prototype.toggle = function (show, animate) {
501
+ show = typeof show === 'undefined' ? !this.visible : show;
502
+ animate = typeof animate === 'undefined' ? true : animate; // is box already at desired visibility?
503
 
504
  if (show === this.visible) {
505
  return false;
520
 
521
  this.setCustomBoxStyling(); // trigger event
522
 
523
+ this.fireEvent('box.' + (show ? 'show' : 'hide'), [this]); // show or hide box using selected animation
524
 
525
  if (this.config.position === 'center') {
526
  this.overlay.classList.toggle('boxzilla-' + this.id + '-overlay');
527
 
528
  if (animate) {
529
+ Animator.toggle(this.overlay, 'fade');
530
  } else {
531
  this.overlay.style.display = show ? '' : 'none';
532
  }
538
  return;
539
  }
540
 
541
+ this.contentElement.innerHTML = this.contentElement.innerHTML + '';
542
  }.bind(this));
543
  } else {
544
  this.element.style.display = show ? '' : 'none';
583
  }
584
 
585
  switch (this.config.screenWidthCondition.condition) {
586
+ case 'larger':
587
  return window.innerWidth > this.config.screenWidthCondition.value;
588
 
589
+ case 'smaller':
590
  return window.innerWidth < this.config.screenWidthCondition.value;
591
  } // meh.. condition should be "smaller" or "larger", just return true.
592
 
634
  return false;
635
  }
636
 
637
+ return document.cookie.replace(new RegExp('(?:(?:^|.*;)\\s*' + 'boxzilla_box_' + this.id + '\\s*\\=\\s*([^;]*).*$)|^.*$'), '$1') === 'true';
 
638
  }; // set cookie that disables automatically showing the box
639
 
640
 
658
  }
659
  };
660
  /**
661
+ * Dismisses the box and optionally sets a cookie.
662
+ * @param animate
663
+ * @returns {boolean}
664
+ */
665
 
666
 
667
  Box.prototype.dismiss = function (animate) {
678
  }
679
 
680
  this.dismissed = true;
681
+ this.fireEvent('box.dismiss', [this]);
682
  return true;
683
  };
684
 
685
  module.exports = Box;
686
 
687
+ },{"./animator.js":2}],4:[function(require,module,exports){
688
+ "use strict";
 
 
689
 
690
  var Box = require('./box.js');
691
 
692
+ var throttle = require('./util.js').throttle;
693
 
694
  var styles = require('./styles.js');
695
 
702
  var Time = require('./triggers/time.js');
703
 
704
  var initialised = false;
705
+ var boxes = [];
706
+ var listeners = {};
707
 
708
+ function onKeyUp(evt) {
709
+ if (evt.key === 'Escape' || evt.key === 'Esc') {
710
+ dismiss();
711
  }
712
+ }
 
713
 
714
  function recalculateHeights() {
715
  boxes.forEach(function (box) {
718
  }
719
 
720
  function onElementClick(evt) {
721
+ // bubble up to <a> element
722
+ var el = evt.target;
 
723
 
724
+ for (var i = 0; i <= 3; i++) {
725
  if (!el || el.tagName === 'A') {
726
  break;
727
  }
733
  return;
734
  }
735
 
736
+ var match = el.href.match(/[#&]boxzilla-(.+)/i);
 
737
 
738
  if (match && match.length > 1) {
739
+ toggle(match[1]);
 
740
  }
741
+ }
742
+
743
+ function trigger(event, args) {
744
+ listeners[event] && listeners[event].forEach(function (f) {
745
+ return f.apply(null, args);
746
+ });
747
+ }
748
+
749
+ function on(event, fn) {
750
+ listeners[event] = listeners[event] || [];
751
+ listeners[event].push(fn);
752
+ }
753
+
754
+ function off(event, fn) {
755
+ listeners[event] && listeners[event].filter(function (f) {
756
+ return f !== fn;
757
+ });
758
  } // initialise & add event listeners
759
 
760
 
761
+ function init() {
762
  if (initialised) {
763
  return;
764
  } // insert styles into DOM
765
 
766
 
767
  var styleElement = document.createElement('style');
 
768
  styleElement.innerHTML = styles;
769
+ document.head.appendChild(styleElement); // init triggers
770
 
771
+ ExitIntent(boxes);
772
+ Pageviews(boxes);
773
+ Scroll(boxes);
774
+ Time(boxes);
775
  document.body.addEventListener('click', onElementClick, true);
776
+ window.addEventListener('resize', throttle(recalculateHeights));
777
  window.addEventListener('load', recalculateHeights);
778
  document.addEventListener('keyup', onKeyUp);
779
+ trigger('ready');
780
  initialised = true; // ensure this function doesn't run again
781
+ }
 
 
 
 
 
 
 
 
 
782
 
783
+ function create(id, opts) {
784
  // preserve backwards compat for minimumScreenWidth option
785
+ if (typeof opts.minimumScreenWidth !== 'undefined') {
786
  opts.screenWidthCondition = {
787
+ condition: 'larger',
788
  value: opts.minimumScreenWidth
789
  };
790
  }
791
 
792
+ id = String(id);
793
+ var box = new Box(id, opts, trigger);
794
  boxes.push(box);
795
  return box;
796
+ }
797
+
798
+ function get(id) {
799
+ id = String(id);
800
 
 
801
  for (var i = 0; i < boxes.length; i++) {
802
+ if (boxes[i].id === id) {
803
  return boxes[i];
804
  }
805
  }
806
 
807
+ throw new Error('No box exists with ID ' + id);
808
+ } // dismiss a single box (or all by omitting id param)
809
 
810
 
811
+ function dismiss(id, animate) {
 
812
  if (id) {
813
+ get(id).dismiss(animate);
814
  } else {
815
  boxes.forEach(function (box) {
816
  return box.dismiss(animate);
817
  });
818
  }
819
+ }
820
 
821
+ function hide(id, animate) {
822
  if (id) {
823
+ get(id).hide(animate);
824
  } else {
825
  boxes.forEach(function (box) {
826
  return box.hide(animate);
827
  });
828
  }
829
+ }
830
 
831
+ function show(id, animate) {
832
  if (id) {
833
+ get(id).show(animate);
834
  } else {
835
  boxes.forEach(function (box) {
836
  return box.show(animate);
837
  });
838
  }
839
+ }
840
 
841
+ function toggle(id, animate) {
842
  if (id) {
843
+ get(id).toggle(animate);
844
  } else {
845
  boxes.forEach(function (box) {
846
  return box.toggle(animate);
847
  });
848
  }
849
+ } // expose boxzilla object
850
+
851
+
852
+ var Boxzilla = {
853
+ off: off,
854
+ on: on,
855
+ get: get,
856
+ init: init,
857
+ create: create,
858
+ trigger: trigger,
859
+ show: show,
860
+ hide: hide,
861
+ dismiss: dismiss,
862
+ toggle: toggle,
863
+ boxes: boxes
864
+ };
865
  window.Boxzilla = Boxzilla;
866
 
867
  if (typeof module !== 'undefined' && module.exports) {
868
  module.exports = Boxzilla;
869
  }
870
 
871
+ },{"./box.js":3,"./styles.js":5,"./triggers/exit-intent.js":7,"./triggers/pageviews.js":8,"./triggers/scroll.js":9,"./triggers/time.js":10,"./util.js":11}],5:[function(require,module,exports){
 
 
 
 
 
 
 
872
  "use strict";
873
 
874
+ var styles = '#boxzilla-overlay,.boxzilla-overlay{position:fixed;background:rgba(0,0,0,.65);width:100%;height:100%;left:0;top:0;z-index:10000}.boxzilla-center-container{position:fixed;top:0;left:0;right:0;height:0;text-align:center;z-index:11000;line-height:0}.boxzilla-center-container .boxzilla{display:inline-block;text-align:left;position:relative;line-height:normal}.boxzilla{position:fixed;z-index:12000;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;background:#fff;padding:25px}.boxzilla.boxzilla-top-left{top:0;left:0}.boxzilla.boxzilla-top-right{top:0;right:0}.boxzilla.boxzilla-bottom-left{bottom:0;left:0}.boxzilla.boxzilla-bottom-right{bottom:0;right:0}.boxzilla-content>:first-child{margin-top:0;padding-top:0}.boxzilla-content>:last-child{margin-bottom:0;padding-bottom:0}.boxzilla-close-icon{position:absolute;right:0;top:0;text-align:center;padding:6px;cursor:pointer;-webkit-appearance:none;font-size:28px;font-weight:700;line-height:20px;color:#000;opacity:.5}.boxzilla-close-icon:focus,.boxzilla-close-icon:hover{opacity:.8}';
875
  module.exports = styles;
876
 
877
+ },{}],6:[function(require,module,exports){
878
  "use strict";
879
 
880
+ var Timer = function Timer() {
881
+ this.time = 0;
882
  this.interval = 0;
883
  };
884
 
901
 
902
  module.exports = Timer;
903
 
904
+ },{}],7:[function(require,module,exports){
905
  "use strict";
906
 
907
  module.exports = function (boxes) {
931
  timeout = null;
932
  }
933
 
934
+ function onMouseEnter() {
935
  clearTimeout();
936
  }
937
 
947
  clearTimeout(); // did mouse leave at top of window?
948
  // add small exception space in the top-right corner
949
 
950
+ if (evt.clientY <= getAddressBarY() && evt.clientX < 0.8 * window.innerWidth) {
951
+ timeout = window.setTimeout(trigger, 600);
952
  }
953
  }
954
 
955
+ function onTouchStart() {
956
  clearTimeout();
957
  touchStart = {
958
  timestamp: performance.now(),
969
  } // allow a tiny tiny margin for error, to not fire on clicks
970
 
971
 
972
+ if (window.scrollY + 20 > touchStart.scrollY) {
973
  return;
974
  }
975
 
991
  document.documentElement.addEventListener('click', clearTimeout);
992
  };
993
 
994
+ },{}],8:[function(require,module,exports){
995
  "use strict";
996
 
997
  module.exports = function (boxes) {
1006
 
1007
  window.setTimeout(function () {
1008
  boxes.forEach(function (box) {
1009
+ if (box.config.trigger.method === 'pageviews' && pageviews > box.config.trigger.value && box.mayAutoShow()) {
1010
  box.trigger();
1011
  }
1012
  });
1013
  }, 1000);
1014
  };
1015
 
1016
+ },{}],9:[function(require,module,exports){
1017
  "use strict";
1018
 
1019
  var throttle = require('../util.js').throttle;
1030
 
1031
  if (scrollY > box.triggerHeight) {
1032
  box.trigger();
1033
+ } else if (box.mayRehide() && scrollY < box.triggerHeight - 5) {
1034
+ // if box may auto-hide and scrollY is less than triggerHeight (with small margin of error), hide box
 
 
1035
  box.hide();
1036
  }
1037
  });
1041
  window.addEventListener('scroll', throttle(checkHeightCriteria), true);
1042
  };
1043
 
1044
+ },{"../util.js":11}],10:[function(require,module,exports){
1045
  "use strict";
1046
 
1047
  var Timer = require('../timer.js');
1048
 
1049
  module.exports = function (boxes) {
1050
+ var siteTimer = new Timer();
1051
+ var pageTimer = new Timer();
1052
  var timers = {
1053
  start: function start() {
1054
  try {
1071
 
1072
  timers.start(); // stop timers when leaving page or switching to other tab
1073
 
1074
+ document.addEventListener('visibilitychange', function () {
1075
  document.hidden ? timers.stop() : timers.start();
1076
  });
1077
  window.addEventListener('beforeunload', function () {
1079
  });
1080
  window.setInterval(function () {
1081
  boxes.forEach(function (box) {
1082
+ if (box.config.trigger.method === 'time_on_site' && siteTimer.time > box.config.trigger.value && box.mayAutoShow()) {
1083
  box.trigger();
1084
+ } else if (box.config.trigger.method === 'time_on_page' && pageTimer.time > box.config.trigger.value && box.mayAutoShow()) {
 
 
1085
  box.trigger();
1086
  }
1087
  });
1088
  }, 1000);
1089
  };
1090
 
1091
+ },{"../timer.js":6}],11:[function(require,module,exports){
1092
  "use strict";
1093
 
1094
  function throttle(fn, threshold, scope) {
1095
+ threshold || (threshold = 800);
1096
  var last;
1097
  var deferTimer;
1098
  return function () {
1099
  var context = scope || this;
1100
+ var now = +new Date();
1101
+ var args = arguments;
1102
 
1103
  if (last && now < last + threshold) {
1104
  // hold on to it
1118
  throttle: throttle
1119
  };
1120
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1121
  },{}]},{},[1]);
1122
  ; })();
assets/js/script.min.js CHANGED
@@ -1,2 +1,2 @@
1
- !function(){var l=void 0;!function r(s,l,c){function a(e,t){if(!l[e]){if(!s[e]){var i=!1;if(!t&&i)return i(e,!0);if(d)return d(e,!0);var n=new Error("Cannot find module '"+e+"'");throw n.code="MODULE_NOT_FOUND",n}var o=l[e]={exports:{}};s[e][0].call(o.exports,function(t){return a(s[e][1][t]||t)},o,o.exports,r,s,l,c)}return l[e].exports}for(var d=!1,t=0;t<c.length;t++)a(c[t]);return a}({1:[function(t,e,i){"use strict";function d(t){return(d="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})(t)}!function(){var s=t("boxzilla"),l=window.boxzilla_options;function c(t){if(!window.location.hash||0===window.location.hash.length)return!1;var e=window.location.hash.match(/[#&](boxzilla-\d+)/);if(!e||"object"!==d(e)||e.length<2)return!1;var i=e[1];return i===t.element.id||!!t.element.querySelector("#"+i)}window.Boxzilla=s;var a=-1<document.body.className.indexOf("logged-in");a&&l.testMode&&console.log("Boxzilla: Test mode is enabled. Please disable test mode if you're done testing."),s.init(),window.addEventListener("load",function(){if(!l.inited){for(var t in l.boxes){var e=l.boxes[t];e.testMode=a&&l.testMode;var i=document.getElementById("boxzilla-box-"+e.id+"-content");if(i){e.content=i;var n=s.create(e.id,e);n.element.className=n.element.className+" boxzilla-"+e.post.slug,o=n.element,(r=e.css).background_color&&(o.style.background=r.background_color),r.color&&(o.style.color=r.color),r.border_color&&(o.style.borderColor=r.border_color),r.border_width&&(o.style.borderWidth=parseInt(r.border_width)+"px"),r.border_style&&(o.style.borderStyle=r.border_style),r.width&&(o.style.maxWidth=parseInt(r.width)+"px");try{n.element.firstChild.firstChild.className+=" first-child",n.element.firstChild.lastChild.className+=" last-child"}catch(t){}n.fits()&&c(n)&&n.show()}}var o,r;l.inited=!0,s.trigger("done"),function(){if(("object"!==d(window.mc4wp_forms_config)||!window.mc4wp_forms_config.submitted_form)&&"object"!==d(window.mc4wp_submitted_form))return;var e="#"+(window.mc4wp_submitted_form||window.mc4wp_forms_config.submitted_form).element_id;s.boxes.forEach(function(t){t.element.querySelector(e)&&t.show()})}()}})}()},{boxzilla:4}],2:[function(t,e,i){"use strict";var o=320;function a(t,e){for(var i in e)e.hasOwnProperty(i)&&(t.style[i]=e[i])}function d(a,d,u){var h=+new Date,t=window.getComputedStyle(a),f={},g={};for(var e in d)if(d.hasOwnProperty(e)){d[e]=parseFloat(d[e]);var i=d[e],n=parseFloat(t[e]);n!=i?(g[e]=(i-n)/o,f[e]=n):delete d[e]}!function t(){var e,i,n,o,r=+new Date-h,s=!0;for(var l in d)if(d.hasOwnProperty(l)){e=g[l],i=d[l],n=e*r,o=f[l]+n,0<e&&i<=o||e<0&&o<=i?o=i:s=!1,f[l]=o;var c="opacity"!==l?"px":"";a.style[l]=o+c}h=+new Date,s?u&&u():window.requestAnimationFrame&&requestAnimationFrame(t)||setTimeout(t,32)}()}e.exports={toggle:function(t,e,i){function n(){t.removeAttribute("data-animated"),t.setAttribute("style",l.getAttribute("style")),t.style.display=s?"none":"",i&&i()}var o,r,s="none"!==t.style.display||0<t.offsetLeft,l=t.cloneNode(!0);if(t.setAttribute("data-animated","true"),s||(t.style.display=""),"slide"===e){if(o=function(t,e){for(var i={},n=0;n<t.length;n++)i[t[n]]=e;return i}(["height","borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],0),r={},!s){if(r=function(t,e){for(var i={},n=0;n<t.length;n++)i[t[n]]=e[t[n]];return i}(["height","borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],window.getComputedStyle(t)),!isFinite(r.height)){var c=t.getBoundingClientRect();r.height=c.height}a(t,o)}t.style.overflowY="hidden",d(t,s?o:r,n)}else o={opacity:0},r={opacity:1},s||a(t,o),d(t,s?o:r,n)},animate:d,animated:function(t){return!!t.getAttribute("data-animated")}}},{}],3:[function(t,e,i){"use strict";var n={animation:"fade",rehide:!1,content:"",cookie:null,icon:"&times",screenWidthCondition:null,position:"center",testMode:!1,trigger:!1,closable:!0},r=t("./events.js"),o=t("./animator.js");function s(t,e){this.id=t,this.config=function(t,e){var i={};for(var n in t)t.hasOwnProperty(n)&&(i[n]=t[n]);for(var o in e)e.hasOwnProperty(o)&&(i[o]=e[o]);return i}(n,e),this.overlay=document.createElement("div"),this.overlay.style.display="none",this.overlay.id="boxzilla-overlay-"+this.id,this.overlay.classList.add("boxzilla-overlay"),document.body.appendChild(this.overlay),this.visible=!1,this.dismissed=!1,this.triggered=!1,this.triggerHeight=this.calculateTriggerHeight(),this.cookieSet=this.isCookieSet(),this.element=null,this.contentElement=null,this.closeIcon=null,this.dom(),this.events()}s.prototype.events=function(){var o=this;this.closeIcon&&this.closeIcon.addEventListener("click",function(t){t.preventDefault(),o.dismiss()}),this.element.addEventListener("click",function(t){"A"===t.target.tagName&&r.trigger("box.interactions.link",[o,t.target])},!1),this.element.addEventListener("submit",function(t){o.setCookie(),r.trigger("box.interactions.form",[o,t.target])},!1),this.overlay.addEventListener("click",function(t){var e=t.offsetX,i=t.offsetY,n=o.element.getBoundingClientRect();(e<n.left-40||e>n.right+40||i<n.top-40||i>n.bottom+40)&&o.dismiss()})},s.prototype.dom=function(){var t=document.createElement("div");t.className="boxzilla-container boxzilla-"+this.config.position+"-container";var e,i=document.createElement("div");if(i.setAttribute("id","boxzilla-"+this.id),i.className="boxzilla boxzilla-"+this.id+" boxzilla-"+this.config.position,i.style.display="none",t.appendChild(i),"string"==typeof this.config.content?(e=document.createElement("div")).innerHTML=this.config.content:(e=this.config.content).style.display="",e.className="boxzilla-content",i.appendChild(e),this.config.closable&&this.config.icon){var n=document.createElement("span");n.className="boxzilla-close-icon",n.innerHTML=this.config.icon,i.appendChild(n),this.closeIcon=n}document.body.appendChild(t),this.contentElement=e,this.element=i},s.prototype.setCustomBoxStyling=function(){var t=this.element.style.display;this.element.style.display="",this.element.style.overflowY="",this.element.style.maxHeight="";var e=window.innerHeight,i=this.element.clientHeight;if(e<i&&(this.element.style.maxHeight=e+"px",this.element.style.overflowY="scroll"),"center"===this.config.position){var n=(e-i)/2;n=0<=n?n:0,this.element.style.marginTop=n+"px"}this.element.style.display=t},s.prototype.toggle=function(t,e){return e=void 0===e||e,(t=void 0===t?!this.visible:t)!==this.visible&&(!o.animated(this.element)&&(!(!t&&!this.config.closable)&&(this.visible=t,this.setCustomBoxStyling(),r.trigger("box."+(t?"show":"hide"),[this]),"center"===this.config.position&&(this.overlay.classList.toggle("boxzilla-"+this.id+"-overlay"),e?o.toggle(this.overlay,"fade"):this.overlay.style.display=t?"":"none"),e?o.toggle(this.element,this.config.animation,function(){this.visible||(this.contentElement.innerHTML=this.contentElement.innerHTML)}.bind(this)):this.element.style.display=t?"":"none",!0)))},s.prototype.show=function(t){return this.toggle(!0,t)},s.prototype.hide=function(t){return this.toggle(!1,t)},s.prototype.calculateTriggerHeight=function(){var t=0;if(this.config.trigger)if("element"===this.config.trigger.method){var e=document.body.querySelector(this.config.trigger.value);if(e)t=e.getBoundingClientRect().top}else"percentage"===this.config.trigger.method&&(t=this.config.trigger.value/100*function(){var t=document.body,e=document.documentElement;return Math.max(t.scrollHeight,t.offsetHeight,e.clientHeight,e.scrollHeight,e.offsetHeight)}());return t},s.prototype.fits=function(){if(!this.config.screenWidthCondition||!this.config.screenWidthCondition.value)return!0;switch(this.config.screenWidthCondition.condition){case"larger":return window.innerWidth>this.config.screenWidthCondition.value;case"smaller":return window.innerWidth<this.config.screenWidthCondition.value}return!0},s.prototype.onResize=function(){this.triggerHeight=this.calculateTriggerHeight(),this.setCustomBoxStyling()},s.prototype.mayAutoShow=function(){return!this.dismissed&&(!!this.fits()&&(!!this.config.trigger&&!this.cookieSet))},s.prototype.mayRehide=function(){return this.config.rehide&&this.triggered},s.prototype.isCookieSet=function(){return!(this.config.testMode||!this.config.trigger)&&(!(!this.config.cookie||!this.config.cookie.triggered&&!this.config.cookie.dismissed)&&"true"===document.cookie.replace(new RegExp("(?:(?:^|.*;)\\s*boxzilla_box_"+this.id+"\\s*\\=\\s*([^;]*).*$)|^.*$"),"$1"))},s.prototype.setCookie=function(t){var e=new Date;e.setHours(e.getHours()+t),document.cookie="boxzilla_box_"+this.id+"=true; expires="+e.toUTCString()+"; path=/"},s.prototype.trigger=function(){this.show()&&(this.triggered=!0,this.config.cookie&&this.config.cookie.triggered&&this.setCookie(this.config.cookie.triggered))},s.prototype.dismiss=function(t){return!!this.visible&&(this.hide(t),this.config.cookie&&this.config.cookie.dismissed&&this.setCookie(this.config.cookie.dismissed),this.dismissed=!0,r.trigger("box.dismiss",[this]),!0)},e.exports=s},{"./animator.js":2,"./events.js":5}],4:[function(t,e,i){"use strict";var r=t("./events.js"),n=t("./box.js"),o=t("./util.js"),s=t("./styles.js"),l=t("./triggers/exit-intent.js"),c=t("./triggers/scroll.js"),a=t("./triggers/pageviews.js"),d=t("./triggers/time.js"),u=!1,h=[];function f(t){27===t.keyCode&&r.dismiss()}function g(){h.forEach(function(t){return t.onResize()})}function m(t){for(var e=t.target||t.srcElement,i=0;i<=3&&(e&&"A"!==e.tagName);i++)e=e.parentElement;if(e&&"A"===e.tagName&&e.href){var n=e.href.toLowerCase().match(/[#&]boxzilla-(\d+)/);if(n&&1<n.length){var o=n[1];r.toggle(o)}}}r.init=function(){if(!u){var t=document.createElement("style");t.setAttribute("type","text/css"),t.innerHTML=s,document.head.appendChild(t),new l(h),new a(h),new c(h),new d(h),document.body.addEventListener("click",m,!0),window.addEventListener("resize",o.throttle(g)),window.addEventListener("load",g),document.addEventListener("keyup",f),r.trigger("ready"),u=!0}},r.create=function(t,e){void 0!==e.minimumScreenWidth&&(e.screenWidthCondition={condition:"larger",value:e.minimumScreenWidth});var i=new n(t,e);return h.push(i),i},r.get=function(t){for(var e=0;e<h.length;e++)if(h[e].id==t)return h[e];throw new Error("No box exists with ID "+t)},r.dismiss=function(t,e){t?r.get(t).dismiss(e):h.forEach(function(t){return t.dismiss(e)})},r.hide=function(t,e){t?r.get(t).hide(e):h.forEach(function(t){return t.hide(e)})},r.show=function(t,e){t?r.get(t).show(e):h.forEach(function(t){return t.show(e)})},r.toggle=function(t,e){t?r.get(t).toggle(e):h.forEach(function(t){return t.toggle(e)})},r.boxes=h,window.Boxzilla=r,void 0!==e&&e.exports&&(e.exports=r)},{"./box.js":3,"./events.js":5,"./styles.js":6,"./triggers/exit-intent.js":8,"./triggers/pageviews.js":9,"./triggers/scroll.js":10,"./triggers/time.js":11,"./util.js":12}],5:[function(t,e,i){"use strict";var n=t("wolfy87-eventemitter");e.exports=Object.create(n.prototype)},{"wolfy87-eventemitter":13}],6:[function(t,e,i){"use strict";e.exports="#boxzilla-overlay,.boxzilla-overlay{position:fixed;background:rgba(0,0,0,.65);width:100%;height:100%;left:0;top:0;z-index:10000}.boxzilla-center-container{position:fixed;top:0;left:0;right:0;height:0;text-align:center;z-index:11000;line-height:0}.boxzilla-center-container .boxzilla{display:inline-block;text-align:left;position:relative;line-height:normal}.boxzilla{position:fixed;z-index:12000;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;background:#fff;padding:25px}.boxzilla.boxzilla-top-left{top:0;left:0}.boxzilla.boxzilla-top-right{top:0;right:0}.boxzilla.boxzilla-bottom-left{bottom:0;left:0}.boxzilla.boxzilla-bottom-right{bottom:0;right:0}.boxzilla-content>:first-child{margin-top:0;padding-top:0}.boxzilla-content>:last-child{margin-bottom:0;padding-bottom:0}.boxzilla-close-icon{position:absolute;right:0;top:0;text-align:center;padding:6px;cursor:pointer;-webkit-appearance:none;font-size:28px;font-weight:700;line-height:20px;color:#000;opacity:.5}.boxzilla-close-icon:focus,.boxzilla-close-icon:hover{opacity:.8}"},{}],7:[function(t,e,i){"use strict";function n(t){this.time=t,this.interval=0}n.prototype.tick=function(){this.time++},n.prototype.start=function(){this.interval||(this.interval=window.setInterval(this.tick.bind(this),1e3))},n.prototype.stop=function(){this.interval&&(window.clearInterval(this.interval),this.interval=0)},e.exports=n},{}],8:[function(t,e,i){"use strict";e.exports=function(t){var e=null,i={};function n(){document.documentElement.removeEventListener("mouseleave",s),document.documentElement.removeEventListener("mouseenter",r),document.documentElement.removeEventListener("click",o),window.removeEventListener("touchstart",l),window.removeEventListener("touchend",c),t.forEach(function(t){t.mayAutoShow()&&"exit_intent"===t.config.trigger.method&&t.trigger()})}function o(){null!==e&&(window.clearTimeout(e),e=null)}function r(t){o()}function s(t){o(),t.clientY<=(document.documentMode||/Edge\//.test(navigator.userAgent)?5:0)&&t.clientX<.8*window.innerWidth&&(e=window.setTimeout(n,400))}function l(t){o(),i={timestamp:performance.now(),scrollY:window.scrollY,windowHeight:window.innerHeight}}function c(t){o(),window.innerHeight>i.windowHeight||window.scrollY+20>=i.scrollY||300<performance.now()-i.timestamp||-1<["A","INPUT","BUTTON"].indexOf(t.target.tagName)||(e=window.setTimeout(n,800))}window.addEventListener("touchstart",l),window.addEventListener("touchend",c),document.documentElement.addEventListener("mouseenter",r),document.documentElement.addEventListener("mouseleave",s),document.documentElement.addEventListener("click",o)}},{}],9:[function(t,e,i){"use strict";e.exports=function(t){var e;try{e=sessionStorage.getItem("boxzilla_pageviews")||0,sessionStorage.setItem("boxzilla_pageviews",++e)}catch(t){e=0}window.setTimeout(function(){t.forEach(function(t){"pageviews"===t.config.trigger.method&&e>=t.config.trigger.value&&t.mayAutoShow()&&t.trigger()})},1e3)}},{}],10:[function(t,e,i){"use strict";var n=t("../util.js").throttle;e.exports=function(t){function e(){var e=window.hasOwnProperty("pageYOffset")?window.pageYOffset:window.scrollTop;e+=.9*window.innerHeight,t.forEach(function(t){!t.mayAutoShow()||t.triggerHeight<=0||(e>t.triggerHeight&&t.trigger(),t.mayRehide()&&e<t.triggerHeight-5&&t.hide())})}window.addEventListener("touchstart",n(e),!0),window.addEventListener("scroll",n(e),!0)}},{"../util.js":12}],11:[function(t,e,i){"use strict";var r=t("../timer.js");e.exports=function(t){var e=new r(0),i=new r(0),n=function(){try{var t=parseInt(sessionStorage.getItem("boxzilla_timer"));t&&(e.time=t)}catch(t){}e.start(),i.start()},o=function(){sessionStorage.setItem("boxzilla_timer",e.time),e.stop(),i.stop()};n(),document.addEventListener("visibilitychange",function(){document.hidden?o():n()}),window.addEventListener("beforeunload",function(){o()}),window.setInterval(function(){t.forEach(function(t){"time_on_site"===t.config.trigger.method&&e.time>=t.config.trigger.value&&t.mayAutoShow()&&t.trigger(),"time_on_page"===t.config.trigger.method&&i.time>=t.config.trigger.value&&t.mayAutoShow()&&t.trigger()})},1e3)}},{"../timer.js":7}],12:[function(t,e,i){"use strict";e.exports={throttle:function(n,o,r){var s,l;return o=o||600,function(){var t=r||this,e=+new Date,i=arguments;s&&e<s+o?(clearTimeout(l),l=setTimeout(function(){s=e,n.apply(t,i)},o)):(s=e,n.apply(t,i))}}}},{}],13:[function(t,s,e){!function(t){"use strict";function e(){}var i=e.prototype,n=t.EventEmitter;function r(t,e){for(var i=t.length;i--;)if(t[i].listener===e)return i;return-1}function o(t){return function(){return this[t].apply(this,arguments)}}i.getListeners=function(t){var e,i,n=this._getEvents();if(t instanceof RegExp)for(i in e={},n)n.hasOwnProperty(i)&&t.test(i)&&(e[i]=n[i]);else e=n[t]||(n[t]=[]);return e},i.flattenListeners=function(t){var e,i=[];for(e=0;e<t.length;e+=1)i.push(t[e].listener);return i},i.getListenersAsObject=function(t){var e,i=this.getListeners(t);return i instanceof Array&&((e={})[t]=i),e||i},i.addListener=function(t,e){if(!function t(e){return"function"==typeof e||e instanceof RegExp||!(!e||"object"!=typeof e)&&t(e.listener)}(e))throw new TypeError("listener must be a function");var i,n=this.getListenersAsObject(t),o="object"==typeof e;for(i in n)n.hasOwnProperty(i)&&-1===r(n[i],e)&&n[i].push(o?e:{listener:e,once:!1});return this},i.on=o("addListener"),i.addOnceListener=function(t,e){return this.addListener(t,{listener:e,once:!0})},i.once=o("addOnceListener"),i.defineEvent=function(t){return this.getListeners(t),this},i.defineEvents=function(t){for(var e=0;e<t.length;e+=1)this.defineEvent(t[e]);return this},i.removeListener=function(t,e){var i,n,o=this.getListenersAsObject(t);for(n in o)o.hasOwnProperty(n)&&-1!==(i=r(o[n],e))&&o[n].splice(i,1);return this},i.off=o("removeListener"),i.addListeners=function(t,e){return this.manipulateListeners(!1,t,e)},i.removeListeners=function(t,e){return this.manipulateListeners(!0,t,e)},i.manipulateListeners=function(t,e,i){var n,o,r=t?this.removeListener:this.addListener,s=t?this.removeListeners:this.addListeners;if("object"!=typeof e||e instanceof RegExp)for(n=i.length;n--;)r.call(this,e,i[n]);else for(n in e)e.hasOwnProperty(n)&&(o=e[n])&&("function"==typeof o?r.call(this,n,o):s.call(this,n,o));return this},i.removeEvent=function(t){var e,i=typeof t,n=this._getEvents();if("string"==i)delete n[t];else if(t instanceof RegExp)for(e in n)n.hasOwnProperty(e)&&t.test(e)&&delete n[e];else delete this._events;return this},i.removeAllListeners=o("removeEvent"),i.emitEvent=function(t,e){var i,n,o,r,s=this.getListenersAsObject(t);for(r in s)if(s.hasOwnProperty(r))for(i=s[r].slice(0),o=0;o<i.length;o++)!0===(n=i[o]).once&&this.removeListener(t,n.listener),n.listener.apply(this,e||[])===this._getOnceReturnValue()&&this.removeListener(t,n.listener);return this},i.trigger=o("emitEvent"),i.emit=function(t){var e=Array.prototype.slice.call(arguments,1);return this.emitEvent(t,e)},i.setOnceReturnValue=function(t){return this._onceReturnValue=t,this},i._getOnceReturnValue=function(){return!this.hasOwnProperty("_onceReturnValue")||this._onceReturnValue},i._getEvents=function(){return this._events||(this._events={})},e.noConflict=function(){return t.EventEmitter=n,e},"function"==typeof l&&l.amd?l(function(){return e}):"object"==typeof s&&s.exports?s.exports=e:t.EventEmitter=e}("undefined"!=typeof window?window:this||{})},{}]},{},[1])}();
2
  //# sourceMappingURL=script.min.js.map
1
+ !function r(s,l,c){function a(e,t){if(!l[e]){if(!s[e]){var i=!1;if(!t&&i)return i(e,!0);if(d)return d(e,!0);var o=new Error("Cannot find module '"+e+"'");throw o.code="MODULE_NOT_FOUND",o}var n=l[e]={exports:{}};s[e][0].call(n.exports,function(t){return a(s[e][1][t]||t)},n,n.exports,r,s,l,c)}return l[e].exports}for(var d=!1,t=0;t<c.length;t++)a(c[t]);return a}({1:[function(t,e,i){"use strict";function s(t){return(s="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})(t)}function l(t){if(!window.location.hash||0===window.location.hash.length)return!1;var e=window.location.hash.match(/[#&](boxzilla-\d+)/);if(!e||"object"!==s(e)||e.length<2)return!1;var i=e[1];return i===t.element.id||!!t.element.querySelector("#"+i)}var c,a,d;c=t("boxzilla"),a=window.boxzilla_options,(d=-1<document.body.className.indexOf("logged-in"))&&a.testMode&&console.log("Boxzilla: Test mode is enabled. Please disable test mode if you're done testing."),c.init(),window.addEventListener("load",function(){if(!a.inited){for(var t in a.boxes){var e=a.boxes[t];e.testMode=d&&a.testMode;var i=document.getElementById("boxzilla-box-"+e.id+"-content");if(i){e.content=i;var o=c.create(e.id,e);o.element.className=o.element.className+" boxzilla-"+e.post.slug,n=o.element,(r=e.css).background_color&&(n.style.background=r.background_color),r.color&&(n.style.color=r.color),r.border_color&&(n.style.borderColor=r.border_color),r.border_width&&(n.style.borderWidth=parseInt(r.border_width)+"px"),r.border_style&&(n.style.borderStyle=r.border_style),r.width&&(n.style.maxWidth=parseInt(r.width)+"px");try{o.element.firstChild.firstChild.className+=" first-child",o.element.firstChild.lastChild.className+=" last-child"}catch(t){}o.fits()&&l(o)&&o.show()}}var n,r;a.inited=!0,c.trigger("done"),function(){if("object"===s(window.mc4wp_forms_config)&&window.mc4wp_forms_config.submitted_form||"object"===s(window.mc4wp_submitted_form)){var e="#"+(window.mc4wp_submitted_form||window.mc4wp_forms_config.submitted_form).element_id;c.boxes.forEach(function(t){t.element.querySelector(e)&&t.show()})}}()}})},{boxzilla:4}],2:[function(t,e,i){"use strict";var n=320;function a(t,e){for(var i in e)e.hasOwnProperty(i)&&(t.style[i]=e[i])}function d(c,a,d){var h=+new Date,t=window.getComputedStyle(c),g={},u={};for(var e in a)if(a.hasOwnProperty(e)){a[e]=parseFloat(a[e]);var i=a[e],o=parseFloat(t[e]);o!==i?(u[e]=(i-o)/n,g[e]=o):delete a[e]}!function t(){var e,i,o,n,r=+new Date-h,s=!0;for(var l in a)a.hasOwnProperty(l)&&(e=u[l],i=a[l],o=e*r,n=g[l]+o,0<e&&i<=n||e<0&&n<=i?n=i:s=!1,g[l]=n,c.style[l]="opacity"!==l?n+"px":n);h=+new Date,s?d&&d():window.requestAnimationFrame(t)}()}e.exports={toggle:function(t,e,i){function o(){t.removeAttribute("data-animated"),t.setAttribute("style",l.getAttribute("style")),t.style.display=s?"none":"",i&&i()}var n,r,s="none"!==t.style.display||0<t.offsetLeft,l=t.cloneNode(!0);if(t.setAttribute("data-animated","true"),s||(t.style.display=""),"slide"===e){if(n=function(t,e){for(var i={},o=0;o<t.length;o++)i[t[o]]=e;return i}(["height","borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],0),r={},!s){if(r=function(t,e){for(var i={},o=0;o<t.length;o++)i[t[o]]=e[t[o]];return i}(["height","borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],window.getComputedStyle(t)),!isFinite(r.height)){var c=t.getBoundingClientRect();r.height=c.height}a(t,n)}t.style.overflowY="hidden",d(t,s?n:r,o)}else n={opacity:0},r={opacity:1},s||a(t,n),d(t,s?n:r,o)},animate:d,animated:function(t){return!!t.getAttribute("data-animated")}}},{}],3:[function(t,e,i){"use strict";var o={animation:"fade",rehide:!1,content:"",cookie:null,icon:"&times",screenWidthCondition:null,position:"center",testMode:!1,trigger:!1,closable:!0},n=t("./animator.js");function r(t,e,i){this.id=t,this.fireEvent=i,this.config=function(t,e){var i={};for(var o in t)t.hasOwnProperty(o)&&(i[o]=t[o]);for(var n in e)e.hasOwnProperty(n)&&(i[n]=e[n]);return i}(o,e),this.overlay=document.createElement("div"),this.overlay.style.display="none",this.overlay.id="boxzilla-overlay-"+this.id,this.overlay.classList.add("boxzilla-overlay"),document.body.appendChild(this.overlay),this.visible=!1,this.dismissed=!1,this.triggered=!1,this.triggerHeight=this.calculateTriggerHeight(),this.cookieSet=this.isCookieSet(),this.element=null,this.contentElement=null,this.closeIcon=null,this.dom(),this.events()}r.prototype.events=function(){var n=this;this.closeIcon&&this.closeIcon.addEventListener("click",function(t){t.preventDefault(),n.dismiss()}),this.element.addEventListener("click",function(t){"A"===t.target.tagName&&this.fireEvent("box.interactions.link",[n,t.target])},!1),this.element.addEventListener("submit",function(t){n.setCookie(),this.fireEvent("box.interactions.form",[n,t.target])},!1),this.overlay.addEventListener("click",function(t){var e=t.offsetX,i=t.offsetY,o=n.element.getBoundingClientRect();(e<o.left-40||e>o.right+40||i<o.top-40||i>o.bottom+40)&&n.dismiss()})},r.prototype.dom=function(){var t=document.createElement("div");t.className="boxzilla-container boxzilla-"+this.config.position+"-container";var e,i=document.createElement("div");if(i.id="boxzilla-"+this.id,i.className="boxzilla boxzilla-"+this.id+" boxzilla-"+this.config.position,i.style.display="none",t.appendChild(i),"string"==typeof this.config.content?(e=document.createElement("div")).innerHTML=this.config.content:(e=this.config.content).style.display="",e.className="boxzilla-content",i.appendChild(e),this.config.closable&&this.config.icon){var o=document.createElement("span");o.className="boxzilla-close-icon",o.innerHTML=this.config.icon,i.appendChild(o),this.closeIcon=o}document.body.appendChild(t),this.contentElement=e,this.element=i},r.prototype.setCustomBoxStyling=function(){var t=this.element.style.display;this.element.style.display="",this.element.style.overflowY="",this.element.style.maxHeight="";var e=window.innerHeight,i=this.element.clientHeight;if(e<i&&(this.element.style.maxHeight=e+"px",this.element.style.overflowY="scroll"),"center"===this.config.position){var o=(e-i)/2;o=0<=o?o:0,this.element.style.marginTop=o+"px"}this.element.style.display=t},r.prototype.toggle=function(t,e){return e=void 0===e||e,!((t=void 0===t?!this.visible:t)===this.visible||n.animated(this.element)||!t&&!this.config.closable||(this.visible=t,this.setCustomBoxStyling(),this.fireEvent("box."+(t?"show":"hide"),[this]),"center"===this.config.position&&(this.overlay.classList.toggle("boxzilla-"+this.id+"-overlay"),e?n.toggle(this.overlay,"fade"):this.overlay.style.display=t?"":"none"),e?n.toggle(this.element,this.config.animation,function(){this.visible||(this.contentElement.innerHTML=this.contentElement.innerHTML+"")}.bind(this)):this.element.style.display=t?"":"none",0))},r.prototype.show=function(t){return this.toggle(!0,t)},r.prototype.hide=function(t){return this.toggle(!1,t)},r.prototype.calculateTriggerHeight=function(){var t=0;if(this.config.trigger)if("element"===this.config.trigger.method){var e=document.body.querySelector(this.config.trigger.value);e&&(t=e.getBoundingClientRect().top)}else"percentage"===this.config.trigger.method&&(t=this.config.trigger.value/100*function(){var t=document.body,e=document.documentElement;return Math.max(t.scrollHeight,t.offsetHeight,e.clientHeight,e.scrollHeight,e.offsetHeight)}());return t},r.prototype.fits=function(){if(!this.config.screenWidthCondition||!this.config.screenWidthCondition.value)return!0;switch(this.config.screenWidthCondition.condition){case"larger":return window.innerWidth>this.config.screenWidthCondition.value;case"smaller":return window.innerWidth<this.config.screenWidthCondition.value}return!0},r.prototype.onResize=function(){this.triggerHeight=this.calculateTriggerHeight(),this.setCustomBoxStyling()},r.prototype.mayAutoShow=function(){return!(this.dismissed||!this.fits()||!this.config.trigger||this.cookieSet)},r.prototype.mayRehide=function(){return this.config.rehide&&this.triggered},r.prototype.isCookieSet=function(){return!(this.config.testMode||!this.config.trigger||!this.config.cookie||!this.config.cookie.triggered&&!this.config.cookie.dismissed||"true"!==document.cookie.replace(new RegExp("(?:(?:^|.*;)\\s*boxzilla_box_"+this.id+"\\s*\\=\\s*([^;]*).*$)|^.*$"),"$1"))},r.prototype.setCookie=function(t){var e=new Date;e.setHours(e.getHours()+t),document.cookie="boxzilla_box_"+this.id+"=true; expires="+e.toUTCString()+"; path=/"},r.prototype.trigger=function(){this.show()&&(this.triggered=!0,this.config.cookie&&this.config.cookie.triggered&&this.setCookie(this.config.cookie.triggered))},r.prototype.dismiss=function(t){return!!this.visible&&(this.hide(t),this.config.cookie&&this.config.cookie.dismissed&&this.setCookie(this.config.cookie.dismissed),this.dismissed=!0,this.fireEvent("box.dismiss",[this]),!0)},e.exports=r},{"./animator.js":2}],4:[function(t,e,i){"use strict";var o=t("./box.js"),n=t("./util.js").throttle,r=t("./styles.js"),s=t("./triggers/exit-intent.js"),l=t("./triggers/scroll.js"),c=t("./triggers/pageviews.js"),a=t("./triggers/time.js"),d=!1,h=[],g={};function u(t){"Escape"!==t.key&&"Esc"!==t.key||w()}function f(){h.forEach(function(t){return t.onResize()})}function m(t){for(var e=t.target,i=0;i<=3&&e&&"A"!==e.tagName;i++)e=e.parentElement;if(e&&"A"===e.tagName&&e.href){var o=e.href.match(/[#&]boxzilla-(.+)/i);o&&1<o.length&&b(o[1])}}function p(t,e){g[t]&&g[t].forEach(function(t){return t.apply(null,e)})}function v(t){t=String(t);for(var e=0;e<h.length;e++)if(h[e].id===t)return h[e];throw new Error("No box exists with ID "+t)}function w(t,e){t?v(t).dismiss(e):h.forEach(function(t){return t.dismiss(e)})}function b(t,e){t?v(t).toggle(e):h.forEach(function(t){return t.toggle(e)})}var y={off:function(t,e){g[t]&&g[t].filter(function(t){return t!==e})},on:function(t,e){g[t]=g[t]||[],g[t].push(e)},get:v,init:function(){if(!d){var t=document.createElement("style");t.innerHTML=r,document.head.appendChild(t),s(h),c(h),l(h),a(h),document.body.addEventListener("click",m,!0),window.addEventListener("resize",n(f)),window.addEventListener("load",f),document.addEventListener("keyup",u),p("ready"),d=!0}},create:function(t,e){void 0!==e.minimumScreenWidth&&(e.screenWidthCondition={condition:"larger",value:e.minimumScreenWidth}),t=String(t);var i=new o(t,e,p);return h.push(i),i},trigger:p,show:function(t,e){t?v(t).show(e):h.forEach(function(t){return t.show(e)})},hide:function(t,e){t?v(t).hide(e):h.forEach(function(t){return t.hide(e)})},dismiss:w,toggle:b,boxes:h};window.Boxzilla=y,void 0!==e&&e.exports&&(e.exports=y)},{"./box.js":3,"./styles.js":5,"./triggers/exit-intent.js":7,"./triggers/pageviews.js":8,"./triggers/scroll.js":9,"./triggers/time.js":10,"./util.js":11}],5:[function(t,e,i){"use strict";e.exports="#boxzilla-overlay,.boxzilla-overlay{position:fixed;background:rgba(0,0,0,.65);width:100%;height:100%;left:0;top:0;z-index:10000}.boxzilla-center-container{position:fixed;top:0;left:0;right:0;height:0;text-align:center;z-index:11000;line-height:0}.boxzilla-center-container .boxzilla{display:inline-block;text-align:left;position:relative;line-height:normal}.boxzilla{position:fixed;z-index:12000;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;background:#fff;padding:25px}.boxzilla.boxzilla-top-left{top:0;left:0}.boxzilla.boxzilla-top-right{top:0;right:0}.boxzilla.boxzilla-bottom-left{bottom:0;left:0}.boxzilla.boxzilla-bottom-right{bottom:0;right:0}.boxzilla-content>:first-child{margin-top:0;padding-top:0}.boxzilla-content>:last-child{margin-bottom:0;padding-bottom:0}.boxzilla-close-icon{position:absolute;right:0;top:0;text-align:center;padding:6px;cursor:pointer;-webkit-appearance:none;font-size:28px;font-weight:700;line-height:20px;color:#000;opacity:.5}.boxzilla-close-icon:focus,.boxzilla-close-icon:hover{opacity:.8}"},{}],6:[function(t,e,i){"use strict";function o(){this.time=0,this.interval=0}o.prototype.tick=function(){this.time++},o.prototype.start=function(){this.interval||(this.interval=window.setInterval(this.tick.bind(this),1e3))},o.prototype.stop=function(){this.interval&&(window.clearInterval(this.interval),this.interval=0)},e.exports=o},{}],7:[function(t,e,i){"use strict";e.exports=function(t){var e=null,i={};function o(){document.documentElement.removeEventListener("mouseleave",s),document.documentElement.removeEventListener("mouseenter",r),document.documentElement.removeEventListener("click",n),window.removeEventListener("touchstart",l),window.removeEventListener("touchend",c),t.forEach(function(t){t.mayAutoShow()&&"exit_intent"===t.config.trigger.method&&t.trigger()})}function n(){null!==e&&(window.clearTimeout(e),e=null)}function r(){n()}function s(t){n(),t.clientY<=(document.documentMode||/Edge\//.test(navigator.userAgent)?5:0)&&t.clientX<.8*window.innerWidth&&(e=window.setTimeout(o,600))}function l(){n(),i={timestamp:performance.now(),scrollY:window.scrollY,windowHeight:window.innerHeight}}function c(t){n(),window.innerHeight>i.windowHeight||window.scrollY+20>i.scrollY||300<performance.now()-i.timestamp||-1<["A","INPUT","BUTTON"].indexOf(t.target.tagName)||(e=window.setTimeout(o,800))}window.addEventListener("touchstart",l),window.addEventListener("touchend",c),document.documentElement.addEventListener("mouseenter",r),document.documentElement.addEventListener("mouseleave",s),document.documentElement.addEventListener("click",n)}},{}],8:[function(t,e,i){"use strict";e.exports=function(t){var e;try{e=sessionStorage.getItem("boxzilla_pageviews")||0,sessionStorage.setItem("boxzilla_pageviews",++e)}catch(t){e=0}window.setTimeout(function(){t.forEach(function(t){"pageviews"===t.config.trigger.method&&e>t.config.trigger.value&&t.mayAutoShow()&&t.trigger()})},1e3)}},{}],9:[function(t,e,i){"use strict";var o=t("../util.js").throttle;e.exports=function(t){function e(){var e=window.hasOwnProperty("pageYOffset")?window.pageYOffset:window.scrollTop;e+=.9*window.innerHeight,t.forEach(function(t){!t.mayAutoShow()||t.triggerHeight<=0||(e>t.triggerHeight?t.trigger():t.mayRehide()&&e<t.triggerHeight-5&&t.hide())})}window.addEventListener("touchstart",o(e),!0),window.addEventListener("scroll",o(e),!0)}},{"../util.js":11}],10:[function(t,e,i){"use strict";var r=t("../timer.js");e.exports=function(t){var e=new r,i=new r,o=function(){try{var t=parseInt(sessionStorage.getItem("boxzilla_timer"));t&&(e.time=t)}catch(t){}e.start(),i.start()},n=function(){sessionStorage.setItem("boxzilla_timer",e.time),e.stop(),i.stop()};o(),document.addEventListener("visibilitychange",function(){document.hidden?n():o()}),window.addEventListener("beforeunload",function(){n()}),window.setInterval(function(){t.forEach(function(t){"time_on_site"===t.config.trigger.method&&e.time>t.config.trigger.value&&t.mayAutoShow()?t.trigger():"time_on_page"===t.config.trigger.method&&i.time>t.config.trigger.value&&t.mayAutoShow()&&t.trigger()})},1e3)}},{"../timer.js":6}],11:[function(t,e,i){"use strict";e.exports={throttle:function(o,n,r){var s,l;return n=n||800,function(){var t=r||this,e=+new Date,i=arguments;s&&e<s+n?(clearTimeout(l),l=setTimeout(function(){s=e,o.apply(t,i)},n)):(s=e,o.apply(t,i))}}}},{}]},{},[1]);
2
  //# sourceMappingURL=script.min.js.map
assets/js/script.min.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["script.js"],"names":["define","undefined","r","e","n","t","o","i","f","c","u","a","Error","code","p","exports","call","length","1","require","module","_typeof","obj","Symbol","iterator","constructor","prototype","Boxzilla","options","window","boxzilla_options","locationHashRefersBox","box","location","hash","match","elementId","element","id","querySelector","isLoggedIn","document","body","className","indexOf","testMode","console","log","init","addEventListener","inited","key","boxes","boxOpts","boxContentElement","getElementById","content","create","post","slug","styles","css","background_color","style","background","color","border_color","borderColor","border_width","borderWidth","parseInt","border_style","borderStyle","width","maxWidth","firstChild","lastChild","fits","show","trigger","mc4wp_forms_config","submitted_form","mc4wp_submitted_form","selector","element_id","forEach","maybeOpenMailChimpForWordPressBox","boxzilla","2","duration","property","hasOwnProperty","animate","targetStyles","fn","last","Date","initialStyles","getComputedStyle","currentStyles","propSteps","parseFloat","to","current","tick","step","increment","newValue","timeSinceLastTick","done","_property","suffix","requestAnimationFrame","setTimeout","toggle","animation","callbackFn","cleanup","removeAttribute","setAttribute","clone","getAttribute","display","nowVisible","hiddenStyles","visibleStyles","offsetLeft","cloneNode","properties","value","newObject","initObjectProperties","object","copyObjectProperties","isFinite","height","clientRect","getBoundingClientRect","overflowY","opacity","animated","3","defaults","rehide","cookie","icon","screenWidthCondition","position","closable","events","Animator","Box","config","this","obj1","obj2","obj3","attrname","_attrname","merge","overlay","createElement","classList","add","appendChild","visible","dismissed","triggered","triggerHeight","calculateTriggerHeight","cookieSet","isCookieSet","contentElement","closeIcon","dom","evt","preventDefault","dismiss","target","tagName","setCookie","x","offsetX","y","offsetY","rect","left","right","top","bottom","wrapper","innerHTML","setCustomBoxStyling","origDisplay","maxHeight","windowHeight","innerHeight","boxHeight","clientHeight","newTopMargin","marginTop","bind","hide","method","triggerElement","html","documentElement","Math","max","scrollHeight","offsetHeight","getDocumentHeight","condition","innerWidth","onResize","mayAutoShow","mayRehide","replace","RegExp","hours","expiryDate","setHours","getHours","toUTCString","./animator.js","./events.js","4","util","ExitIntent","Scroll","Pageviews","Time","initialised","onKeyUp","keyCode","recalculateHeights","onElementClick","el","srcElement","parentElement","href","toLowerCase","boxId","styleElement","head","throttle","opts","minimumScreenWidth","push","get","./box.js","./styles.js","./triggers/exit-intent.js","./triggers/pageviews.js","./triggers/scroll.js","./triggers/time.js","./util.js","5","EventEmitter","Object","wolfy87-eventemitter","6","7","Timer","start","time","interval","setInterval","stop","clearInterval","8","timeout","touchStart","removeEventListener","onMouseLeave","onMouseEnter","clearTimeout","onTouchStart","onTouchEnd","clientY","documentMode","test","navigator","userAgent","clientX","timestamp","performance","now","scrollY","9","pageviews","sessionStorage","getItem","setItem","10","checkHeightCriteria","pageYOffset","scrollTop","../util.js","11","siteTimer","pageTimer","timers","sessionTime","hidden","../timer.js","12","threshold","scope","deferTimer","context","args","arguments","apply","13","proto","originalGlobalValue","indexOfListener","listeners","listener","alias","name","getListeners","response","_getEvents","flattenListeners","flatListeners","getListenersAsObject","Array","addListener","isValidListener","TypeError","listenerIsWrapped","once","on","addOnceListener","defineEvent","defineEvents","evts","removeListener","index","splice","off","addListeners","manipulateListeners","removeListeners","remove","single","multiple","removeEvent","type","_events","removeAllListeners","emitEvent","listenersMap","slice","_getOnceReturnValue","emit","setOnceReturnValue","_onceReturnValue","noConflict","amd"],"mappings":"CAAA,WAAe,IAA8EA,OAASC,GAAuB,SAASC,EAAEC,EAAEC,EAAEC,GAAG,SAASC,EAAEC,EAAEC,GAAG,IAAIJ,EAAEG,GAAG,CAAC,IAAIJ,EAAEI,GAAG,CAAC,IAAIE,GAAE,EAAoC,IAAID,GAAGC,EAAE,OAAOA,EAAEF,GAAE,GAAI,GAAGG,EAAE,OAAOA,EAAEH,GAAE,GAAI,IAAII,EAAE,IAAIC,MAAM,uBAAuBL,EAAE,KAAK,MAAMI,EAAEE,KAAK,mBAAmBF,EAAE,IAAIG,EAAEV,EAAEG,GAAG,CAACQ,QAAQ,IAAIZ,EAAEI,GAAG,GAAGS,KAAKF,EAAEC,QAAQ,SAASb,GAAoB,OAAOI,EAAlBH,EAAEI,GAAG,GAAGL,IAAeA,IAAIY,EAAEA,EAAEC,QAAQb,EAAEC,EAAEC,EAAEC,GAAG,OAAOD,EAAEG,GAAGQ,QAAQ,IAAI,IAAIL,GAAE,EAAoCH,EAAE,EAAEA,EAAEF,EAAE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,qBACb8D,KAAK8M,kBAapB5C,EAAMS,WAAa,WACf,OAAO3K,KAAKsM,UAAYtM,KAAKsM,QAAU,KAQ3C7F,EAAasG,WAAa,WAEtB,OADAzV,EAAQmP,aAAe0D,EAChB1D,GAIW,mBAAXlQ,GAAyBA,EAAOyW,IACvCzW,EAAO,WACH,OAAOkQ,IAGY,iBAAX9O,GAAuBA,EAAOL,QAC1CK,EAAOL,QAAUmP,EAGjBnP,EAAQmP,aAAeA,EA5d9B,CA8dmB,oBAAXrO,OAAyBA,OAAS4H,MAAQ,KAEjD,KAAK,GAAG,CAAC,IA3kDX","file":"script.min.js","sourcesContent":["(function () { var require = undefined; var module = undefined; var exports = undefined; var define = undefined; (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c=\"function\"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error(\"Cannot find module '\"+i+\"'\");throw a.code=\"MODULE_NOT_FOUND\",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u=\"function\"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){\n\"use strict\";\n\nfunction _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\n(function () {\n 'use strict';\n\n var Boxzilla = require('boxzilla');\n\n var options = window.boxzilla_options; // expose Boxzilla object to window\n\n window.Boxzilla = Boxzilla; // helper function for setting CSS styles\n\n function css(element, styles) {\n if (styles.background_color) {\n element.style.background = styles.background_color;\n }\n\n if (styles.color) {\n element.style.color = styles.color;\n }\n\n if (styles.border_color) {\n element.style.borderColor = styles.border_color;\n }\n\n if (styles.border_width) {\n element.style.borderWidth = parseInt(styles.border_width) + \"px\";\n }\n\n if (styles.border_style) {\n element.style.borderStyle = styles.border_style;\n }\n\n if (styles.width) {\n element.style.maxWidth = parseInt(styles.width) + \"px\";\n }\n }\n\n function createBoxesFromConfig() {\n // failsafe against including script twice.\n if (options.inited) {\n return;\n } // create boxes from options\n\n\n for (var key in options.boxes) {\n // get opts\n var boxOpts = options.boxes[key];\n boxOpts.testMode = isLoggedIn && options.testMode; // find box content element, bail if not found\n\n var boxContentElement = document.getElementById('boxzilla-box-' + boxOpts.id + '-content');\n\n if (!boxContentElement) {\n continue;\n } // use element as content option\n\n\n boxOpts.content = boxContentElement; // create box\n\n var box = Boxzilla.create(boxOpts.id, boxOpts); // add box slug to box element as classname\n\n box.element.className = box.element.className + ' boxzilla-' + boxOpts.post.slug; // add custom css to box\n\n css(box.element, boxOpts.css);\n\n try {\n box.element.firstChild.firstChild.className += \" first-child\";\n box.element.firstChild.lastChild.className += \" last-child\";\n } catch (e) {} // maybe show box right away\n\n\n if (box.fits() && locationHashRefersBox(box)) {\n box.show();\n }\n } // set flag to prevent initialising twice\n\n\n options.inited = true; // trigger \"done\" event.\n\n Boxzilla.trigger('done'); // maybe open box with MC4WP form in it\n\n maybeOpenMailChimpForWordPressBox();\n }\n\n function locationHashRefersBox(box) {\n if (!window.location.hash || 0 === window.location.hash.length) {\n return false;\n } // parse \"boxzilla-{id}\" from location hash\n\n\n var match = window.location.hash.match(/[#&](boxzilla-\\d+)/);\n\n if (!match || _typeof(match) !== \"object\" || match.length < 2) {\n return false;\n }\n\n var elementId = match[1];\n\n if (elementId === box.element.id) {\n return true;\n } else if (box.element.querySelector('#' + elementId)) {\n return true;\n }\n\n return false;\n }\n\n function maybeOpenMailChimpForWordPressBox() {\n if ((_typeof(window.mc4wp_forms_config) !== \"object\" || !window.mc4wp_forms_config.submitted_form) && _typeof(window.mc4wp_submitted_form) !== \"object\") {\n return;\n }\n\n var submitted_form = window.mc4wp_submitted_form || window.mc4wp_forms_config.submitted_form;\n var selector = '#' + submitted_form.element_id;\n Boxzilla.boxes.forEach(function (box) {\n if (box.element.querySelector(selector)) {\n box.show();\n }\n });\n } // print message when test mode is enabled\n\n\n var isLoggedIn = document.body.className.indexOf('logged-in') > -1;\n\n if (isLoggedIn && options.testMode) {\n console.log('Boxzilla: Test mode is enabled. Please disable test mode if you\\'re done testing.');\n } // init boxzilla\n\n\n Boxzilla.init(); // on window.load, create DOM elements for boxes\n\n window.addEventListener('load', createBoxesFromConfig);\n})();\n\n},{\"boxzilla\":4}],2:[function(require,module,exports){\n'use strict';\n\nvar duration = 320;\n\nfunction css(element, styles) {\n for (var property in styles) {\n if (!styles.hasOwnProperty(property)) {\n continue;\n }\n\n element.style[property] = styles[property];\n }\n}\n\nfunction initObjectProperties(properties, value) {\n var newObject = {};\n\n for (var i = 0; i < properties.length; i++) {\n newObject[properties[i]] = value;\n }\n\n return newObject;\n}\n\nfunction copyObjectProperties(properties, object) {\n var newObject = {};\n\n for (var i = 0; i < properties.length; i++) {\n newObject[properties[i]] = object[properties[i]];\n }\n\n return newObject;\n}\n/**\n * Checks if the given element is currently being animated.\n *\n * @param element\n * @returns {boolean}\n */\n\n\nfunction animated(element) {\n return !!element.getAttribute('data-animated');\n}\n/**\n * Toggles the element using the given animation.\n *\n * @param element\n * @param animation Either \"fade\" or \"slide\"\n * @param callbackFn\n */\n\n\nfunction toggle(element, animation, callbackFn) {\n var nowVisible = element.style.display !== 'none' || element.offsetLeft > 0; // create clone for reference\n\n var clone = element.cloneNode(true);\n\n var cleanup = function cleanup() {\n element.removeAttribute('data-animated');\n element.setAttribute('style', clone.getAttribute('style'));\n element.style.display = nowVisible ? 'none' : '';\n\n if (callbackFn) {\n callbackFn();\n }\n }; // store attribute so everyone knows we're animating this element\n\n\n element.setAttribute('data-animated', \"true\"); // toggle element visiblity right away if we're making something visible\n\n if (!nowVisible) {\n element.style.display = '';\n }\n\n var hiddenStyles;\n var visibleStyles; // animate properties\n\n if (animation === 'slide') {\n hiddenStyles = initObjectProperties([\"height\", \"borderTopWidth\", \"borderBottomWidth\", \"paddingTop\", \"paddingBottom\"], 0);\n visibleStyles = {};\n\n if (!nowVisible) {\n var computedStyles = window.getComputedStyle(element);\n visibleStyles = copyObjectProperties([\"height\", \"borderTopWidth\", \"borderBottomWidth\", \"paddingTop\", \"paddingBottom\"], computedStyles); // in some browsers, getComputedStyle returns \"auto\" value. this falls back to getBoundingClientRect() in those browsers since we need an actual height.\n\n if (!isFinite(visibleStyles.height)) {\n var clientRect = element.getBoundingClientRect();\n visibleStyles.height = clientRect.height;\n }\n\n css(element, hiddenStyles);\n } // don't show a scrollbar during animation\n\n\n element.style.overflowY = 'hidden';\n animate(element, nowVisible ? hiddenStyles : visibleStyles, cleanup);\n } else {\n hiddenStyles = {\n opacity: 0\n };\n visibleStyles = {\n opacity: 1\n };\n\n if (!nowVisible) {\n css(element, hiddenStyles);\n }\n\n animate(element, nowVisible ? hiddenStyles : visibleStyles, cleanup);\n }\n}\n\nfunction animate(element, targetStyles, fn) {\n var last = +new Date();\n var initialStyles = window.getComputedStyle(element);\n var currentStyles = {};\n var propSteps = {};\n\n for (var property in targetStyles) {\n if (!targetStyles.hasOwnProperty(property)) {\n continue;\n } // make sure we have an object filled with floats\n\n\n targetStyles[property] = parseFloat(targetStyles[property]); // calculate step size & current value\n\n var to = targetStyles[property];\n var current = parseFloat(initialStyles[property]); // is there something to do?\n\n if (current == to) {\n delete targetStyles[property];\n continue;\n }\n\n propSteps[property] = (to - current) / duration; // points per second\n\n currentStyles[property] = current;\n }\n\n var tick = function tick() {\n var now = +new Date();\n var timeSinceLastTick = now - last;\n var done = true;\n var step, to, increment, newValue;\n\n for (var _property in targetStyles) {\n if (!targetStyles.hasOwnProperty(_property)) {\n continue;\n }\n\n step = propSteps[_property];\n to = targetStyles[_property];\n increment = step * timeSinceLastTick;\n newValue = currentStyles[_property] + increment;\n\n if (step > 0 && newValue >= to || step < 0 && newValue <= to) {\n newValue = to;\n } else {\n done = false;\n } // store new value\n\n\n currentStyles[_property] = newValue;\n var suffix = _property !== \"opacity\" ? \"px\" : \"\";\n element.style[_property] = newValue + suffix;\n }\n\n last = +new Date(); // keep going until we're done for all props\n\n if (!done) {\n window.requestAnimationFrame && requestAnimationFrame(tick) || setTimeout(tick, 32);\n } else {\n // call callback\n fn && fn();\n }\n };\n\n tick();\n}\n\nmodule.exports = {\n 'toggle': toggle,\n 'animate': animate,\n 'animated': animated\n};\n\n},{}],3:[function(require,module,exports){\n'use strict';\n\nvar defaults = {\n 'animation': 'fade',\n 'rehide': false,\n 'content': '',\n 'cookie': null,\n 'icon': '&times',\n 'screenWidthCondition': null,\n 'position': 'center',\n 'testMode': false,\n 'trigger': false,\n 'closable': true\n};\n\nvar events = require('./events.js');\n\nvar Animator = require('./animator.js');\n/**\n* Merge 2 objects, values of the latter overwriting the former.\n*\n* @param obj1\n* @param obj2\n* @returns {*}\n*/\n\n\nfunction merge(obj1, obj2) {\n var obj3 = {}; // add obj1 to obj3\n\n for (var attrname in obj1) {\n if (obj1.hasOwnProperty(attrname)) {\n obj3[attrname] = obj1[attrname];\n }\n } // add obj2 to obj3\n\n\n for (var _attrname in obj2) {\n if (obj2.hasOwnProperty(_attrname)) {\n obj3[_attrname] = obj2[_attrname];\n }\n }\n\n return obj3;\n}\n/**\n* Get the real height of entire document.\n* @returns {number}\n*/\n\n\nfunction getDocumentHeight() {\n var body = document.body;\n var html = document.documentElement;\n return Math.max(body.scrollHeight, body.offsetHeight, html.clientHeight, html.scrollHeight, html.offsetHeight);\n} // Box Object\n\n\nfunction Box(id, config) {\n this.id = id; // store config values\n\n this.config = merge(defaults, config); // add overlay element to dom and store ref to overlay\n\n this.overlay = document.createElement('div');\n this.overlay.style.display = 'none';\n this.overlay.id = 'boxzilla-overlay-' + this.id;\n this.overlay.classList.add('boxzilla-overlay');\n document.body.appendChild(this.overlay); // state\n\n this.visible = false;\n this.dismissed = false;\n this.triggered = false;\n this.triggerHeight = this.calculateTriggerHeight();\n this.cookieSet = this.isCookieSet();\n this.element = null;\n this.contentElement = null;\n this.closeIcon = null; // create dom elements for this box\n\n this.dom(); // further initialise the box\n\n this.events();\n}\n\n; // initialise the box\n\nBox.prototype.events = function () {\n var box = this; // attach event to \"close\" icon inside box\n\n if (this.closeIcon) {\n this.closeIcon.addEventListener('click', function (evt) {\n evt.preventDefault();\n box.dismiss();\n });\n }\n\n this.element.addEventListener('click', function (evt) {\n if (evt.target.tagName === 'A') {\n events.trigger('box.interactions.link', [box, evt.target]);\n }\n }, false);\n this.element.addEventListener('submit', function (evt) {\n box.setCookie();\n events.trigger('box.interactions.form', [box, evt.target]);\n }, false);\n this.overlay.addEventListener('click', function (e) {\n var x = e.offsetX;\n var y = e.offsetY; // calculate if click was less than 40px outside box to avoid closing it by accident\n\n var rect = box.element.getBoundingClientRect();\n var margin = 40; // if click was not anywhere near box, dismiss it.\n\n if (x < rect.left - margin || x > rect.right + margin || y < rect.top - margin || y > rect.bottom + margin) {\n box.dismiss();\n }\n });\n}; // generate dom elements for this box\n\n\nBox.prototype.dom = function () {\n var wrapper = document.createElement('div');\n wrapper.className = 'boxzilla-container boxzilla-' + this.config.position + '-container';\n var box = document.createElement('div');\n box.setAttribute('id', 'boxzilla-' + this.id);\n box.className = 'boxzilla boxzilla-' + this.id + ' boxzilla-' + this.config.position;\n box.style.display = 'none';\n wrapper.appendChild(box);\n var content;\n\n if (typeof this.config.content === \"string\") {\n content = document.createElement('div');\n content.innerHTML = this.config.content;\n } else {\n content = this.config.content; // make sure element is visible\n\n content.style.display = '';\n }\n\n content.className = 'boxzilla-content';\n box.appendChild(content);\n\n if (this.config.closable && this.config.icon) {\n var closeIcon = document.createElement('span');\n closeIcon.className = \"boxzilla-close-icon\";\n closeIcon.innerHTML = this.config.icon;\n box.appendChild(closeIcon);\n this.closeIcon = closeIcon;\n }\n\n document.body.appendChild(wrapper);\n this.contentElement = content;\n this.element = box;\n}; // set (calculate) custom box styling depending on box options\n\n\nBox.prototype.setCustomBoxStyling = function () {\n // reset element to its initial state\n var origDisplay = this.element.style.display;\n this.element.style.display = '';\n this.element.style.overflowY = '';\n this.element.style.maxHeight = ''; // get new dimensions\n\n var windowHeight = window.innerHeight;\n var boxHeight = this.element.clientHeight; // add scrollbar to box and limit height\n\n if (boxHeight > windowHeight) {\n this.element.style.maxHeight = windowHeight + \"px\";\n this.element.style.overflowY = 'scroll';\n } // set new top margin for boxes which are centered\n\n\n if (this.config.position === 'center') {\n var newTopMargin = (windowHeight - boxHeight) / 2;\n newTopMargin = newTopMargin >= 0 ? newTopMargin : 0;\n this.element.style.marginTop = newTopMargin + \"px\";\n }\n\n this.element.style.display = origDisplay;\n}; // toggle visibility of the box\n\n\nBox.prototype.toggle = function (show, animate) {\n show = typeof show === \"undefined\" ? !this.visible : show;\n animate = typeof animate === \"undefined\" ? true : animate; // is box already at desired visibility?\n\n if (show === this.visible) {\n return false;\n } // is box being animated?\n\n\n if (Animator.animated(this.element)) {\n return false;\n } // if box should be hidden but is not closable, bail.\n\n\n if (!show && !this.config.closable) {\n return false;\n } // set new visibility status\n\n\n this.visible = show; // calculate new styling rules\n\n this.setCustomBoxStyling(); // trigger event\n\n events.trigger('box.' + (show ? 'show' : 'hide'), [this]); // show or hide box using selected animation\n\n if (this.config.position === 'center') {\n this.overlay.classList.toggle('boxzilla-' + this.id + '-overlay');\n\n if (animate) {\n Animator.toggle(this.overlay, \"fade\");\n } else {\n this.overlay.style.display = show ? '' : 'none';\n }\n }\n\n if (animate) {\n Animator.toggle(this.element, this.config.animation, function () {\n if (this.visible) {\n return;\n }\n\n this.contentElement.innerHTML = this.contentElement.innerHTML;\n }.bind(this));\n } else {\n this.element.style.display = show ? '' : 'none';\n }\n\n return true;\n}; // show the box\n\n\nBox.prototype.show = function (animate) {\n return this.toggle(true, animate);\n}; // hide the box\n\n\nBox.prototype.hide = function (animate) {\n return this.toggle(false, animate);\n}; // calculate trigger height\n\n\nBox.prototype.calculateTriggerHeight = function () {\n var triggerHeight = 0;\n\n if (this.config.trigger) {\n if (this.config.trigger.method === 'element') {\n var triggerElement = document.body.querySelector(this.config.trigger.value);\n\n if (triggerElement) {\n var offset = triggerElement.getBoundingClientRect();\n triggerHeight = offset.top;\n }\n } else if (this.config.trigger.method === 'percentage') {\n triggerHeight = this.config.trigger.value / 100 * getDocumentHeight();\n }\n }\n\n return triggerHeight;\n};\n\nBox.prototype.fits = function () {\n if (!this.config.screenWidthCondition || !this.config.screenWidthCondition.value) {\n return true;\n }\n\n switch (this.config.screenWidthCondition.condition) {\n case \"larger\":\n return window.innerWidth > this.config.screenWidthCondition.value;\n\n case \"smaller\":\n return window.innerWidth < this.config.screenWidthCondition.value;\n } // meh.. condition should be \"smaller\" or \"larger\", just return true.\n\n\n return true;\n};\n\nBox.prototype.onResize = function () {\n this.triggerHeight = this.calculateTriggerHeight();\n this.setCustomBoxStyling();\n}; // is this box enabled?\n\n\nBox.prototype.mayAutoShow = function () {\n if (this.dismissed) {\n return false;\n } // check if box fits on given minimum screen width\n\n\n if (!this.fits()) {\n return false;\n } // if trigger empty or error in calculating triggerHeight, return false\n\n\n if (!this.config.trigger) {\n return false;\n } // rely on cookie value (show if not set, don't show if set)\n\n\n return !this.cookieSet;\n};\n\nBox.prototype.mayRehide = function () {\n return this.config.rehide && this.triggered;\n};\n\nBox.prototype.isCookieSet = function () {\n // always show on test mode or when no auto-trigger is configured\n if (this.config.testMode || !this.config.trigger) {\n return false;\n } // if either cookie is null or trigger & dismiss are both falsey, don't bother checking.\n\n\n if (!this.config.cookie || !this.config.cookie.triggered && !this.config.cookie.dismissed) {\n return false;\n }\n\n var cookieSet = document.cookie.replace(new RegExp(\"(?:(?:^|.*;)\\\\s*\" + 'boxzilla_box_' + this.id + \"\\\\s*\\\\=\\\\s*([^;]*).*$)|^.*$\"), \"$1\") === \"true\";\n return cookieSet;\n}; // set cookie that disables automatically showing the box\n\n\nBox.prototype.setCookie = function (hours) {\n var expiryDate = new Date();\n expiryDate.setHours(expiryDate.getHours() + hours);\n document.cookie = 'boxzilla_box_' + this.id + '=true; expires=' + expiryDate.toUTCString() + '; path=/';\n};\n\nBox.prototype.trigger = function () {\n var shown = this.show();\n\n if (!shown) {\n return;\n }\n\n this.triggered = true;\n\n if (this.config.cookie && this.config.cookie.triggered) {\n this.setCookie(this.config.cookie.triggered);\n }\n};\n/**\n* Dismisses the box and optionally sets a cookie.\n* @param animate\n* @returns {boolean}\n*/\n\n\nBox.prototype.dismiss = function (animate) {\n // only dismiss box if it's currently open.\n if (!this.visible) {\n return false;\n } // hide box element\n\n\n this.hide(animate); // set cookie\n\n if (this.config.cookie && this.config.cookie.dismissed) {\n this.setCookie(this.config.cookie.dismissed);\n }\n\n this.dismissed = true;\n events.trigger('box.dismiss', [this]);\n return true;\n};\n\nmodule.exports = Box;\n\n},{\"./animator.js\":2,\"./events.js\":5}],4:[function(require,module,exports){\n'use strict';\n\nvar Boxzilla = require('./events.js');\n\nvar Box = require('./box.js');\n\nvar util = require('./util.js');\n\nvar styles = require('./styles.js');\n\nvar ExitIntent = require('./triggers/exit-intent.js');\n\nvar Scroll = require('./triggers/scroll.js');\n\nvar Pageviews = require('./triggers/pageviews.js');\n\nvar Time = require('./triggers/time.js');\n\nvar initialised = false;\nvar boxes = []; // \"keyup\" listener\n\nfunction onKeyUp(e) {\n if (e.keyCode === 27) {\n Boxzilla.dismiss();\n }\n} // recalculate heights and variables based on height\n\n\nfunction recalculateHeights() {\n boxes.forEach(function (box) {\n return box.onResize();\n });\n}\n\nfunction onElementClick(evt) {\n // find <a> element in up to 3 parent elements\n var el = evt.target || evt.srcElement;\n var depth = 3;\n\n for (var i = 0; i <= depth; i++) {\n if (!el || el.tagName === 'A') {\n break;\n }\n\n el = el.parentElement;\n }\n\n if (!el || el.tagName !== 'A' || !el.href) {\n return;\n }\n\n var href = el.href.toLowerCase();\n var match = href.match(/[#&]boxzilla-(\\d+)/);\n\n if (match && match.length > 1) {\n var boxId = match[1];\n Boxzilla.toggle(boxId);\n }\n} // initialise & add event listeners\n\n\nBoxzilla.init = function () {\n if (initialised) {\n return;\n } // insert styles into DOM\n\n\n var styleElement = document.createElement('style');\n styleElement.setAttribute(\"type\", \"text/css\");\n styleElement.innerHTML = styles;\n document.head.appendChild(styleElement); // init exit intent triggershow\n\n new ExitIntent(boxes);\n new Pageviews(boxes);\n new Scroll(boxes);\n new Time(boxes);\n document.body.addEventListener('click', onElementClick, true);\n window.addEventListener('resize', util.throttle(recalculateHeights));\n window.addEventListener('load', recalculateHeights);\n document.addEventListener('keyup', onKeyUp);\n Boxzilla.trigger('ready');\n initialised = true; // ensure this function doesn't run again\n};\n/**\n * Create a new Box\n *\n * @param string id\n * @param object opts\n *\n * @returns Box\n */\n\n\nBoxzilla.create = function (id, opts) {\n // preserve backwards compat for minimumScreenWidth option\n if (typeof opts.minimumScreenWidth !== \"undefined\") {\n opts.screenWidthCondition = {\n condition: \"larger\",\n value: opts.minimumScreenWidth\n };\n }\n\n var box = new Box(id, opts);\n boxes.push(box);\n return box;\n};\n\nBoxzilla.get = function (id) {\n for (var i = 0; i < boxes.length; i++) {\n if (boxes[i].id == id) {\n return boxes[i];\n }\n }\n\n throw new Error(\"No box exists with ID \" + id);\n}; // dismiss a single box (or all by omitting id param)\n\n\nBoxzilla.dismiss = function (id, animate) {\n // if no id given, dismiss all current open boxes\n if (id) {\n Boxzilla.get(id).dismiss(animate);\n } else {\n boxes.forEach(function (box) {\n return box.dismiss(animate);\n });\n }\n};\n\nBoxzilla.hide = function (id, animate) {\n if (id) {\n Boxzilla.get(id).hide(animate);\n } else {\n boxes.forEach(function (box) {\n return box.hide(animate);\n });\n }\n};\n\nBoxzilla.show = function (id, animate) {\n if (id) {\n Boxzilla.get(id).show(animate);\n } else {\n boxes.forEach(function (box) {\n return box.show(animate);\n });\n }\n};\n\nBoxzilla.toggle = function (id, animate) {\n if (id) {\n Boxzilla.get(id).toggle(animate);\n } else {\n boxes.forEach(function (box) {\n return box.toggle(animate);\n });\n }\n}; // expose each individual box.\n\n\nBoxzilla.boxes = boxes; // expose boxzilla object\n\nwindow.Boxzilla = Boxzilla;\n\nif (typeof module !== 'undefined' && module.exports) {\n module.exports = Boxzilla;\n}\n\n},{\"./box.js\":3,\"./events.js\":5,\"./styles.js\":6,\"./triggers/exit-intent.js\":8,\"./triggers/pageviews.js\":9,\"./triggers/scroll.js\":10,\"./triggers/time.js\":11,\"./util.js\":12}],5:[function(require,module,exports){\n'use strict';\n\nvar EventEmitter = require('wolfy87-eventemitter');\n\nmodule.exports = Object.create(EventEmitter.prototype);\n\n},{\"wolfy87-eventemitter\":13}],6:[function(require,module,exports){\n\"use strict\";\n\nvar styles = \"#boxzilla-overlay,.boxzilla-overlay{position:fixed;background:rgba(0,0,0,.65);width:100%;height:100%;left:0;top:0;z-index:10000}.boxzilla-center-container{position:fixed;top:0;left:0;right:0;height:0;text-align:center;z-index:11000;line-height:0}.boxzilla-center-container .boxzilla{display:inline-block;text-align:left;position:relative;line-height:normal}.boxzilla{position:fixed;z-index:12000;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;background:#fff;padding:25px}.boxzilla.boxzilla-top-left{top:0;left:0}.boxzilla.boxzilla-top-right{top:0;right:0}.boxzilla.boxzilla-bottom-left{bottom:0;left:0}.boxzilla.boxzilla-bottom-right{bottom:0;right:0}.boxzilla-content>:first-child{margin-top:0;padding-top:0}.boxzilla-content>:last-child{margin-bottom:0;padding-bottom:0}.boxzilla-close-icon{position:absolute;right:0;top:0;text-align:center;padding:6px;cursor:pointer;-webkit-appearance:none;font-size:28px;font-weight:700;line-height:20px;color:#000;opacity:.5}.boxzilla-close-icon:focus,.boxzilla-close-icon:hover{opacity:.8}\";\nmodule.exports = styles;\n\n},{}],7:[function(require,module,exports){\n\"use strict\";\n\nvar Timer = function Timer(start) {\n this.time = start;\n this.interval = 0;\n};\n\nTimer.prototype.tick = function () {\n this.time++;\n};\n\nTimer.prototype.start = function () {\n if (!this.interval) {\n this.interval = window.setInterval(this.tick.bind(this), 1000);\n }\n};\n\nTimer.prototype.stop = function () {\n if (this.interval) {\n window.clearInterval(this.interval);\n this.interval = 0;\n }\n};\n\nmodule.exports = Timer;\n\n},{}],8:[function(require,module,exports){\n\"use strict\";\n\nmodule.exports = function (boxes) {\n var timeout = null;\n var touchStart = {};\n\n function trigger() {\n document.documentElement.removeEventListener('mouseleave', onMouseLeave);\n document.documentElement.removeEventListener('mouseenter', onMouseEnter);\n document.documentElement.removeEventListener('click', clearTimeout);\n window.removeEventListener('touchstart', onTouchStart);\n window.removeEventListener('touchend', onTouchEnd); // show boxes with exit intent trigger\n\n boxes.forEach(function (box) {\n if (box.mayAutoShow() && box.config.trigger.method === 'exit_intent') {\n box.trigger();\n }\n });\n }\n\n function clearTimeout() {\n if (timeout === null) {\n return;\n }\n\n window.clearTimeout(timeout);\n timeout = null;\n }\n\n function onMouseEnter(evt) {\n clearTimeout();\n }\n\n function getAddressBarY() {\n if (document.documentMode || /Edge\\//.test(navigator.userAgent)) {\n return 5;\n }\n\n return 0;\n }\n\n function onMouseLeave(evt) {\n clearTimeout(); // did mouse leave at top of window?\n // add small exception space in the top-right corner\n\n if (evt.clientY <= getAddressBarY() && evt.clientX < 0.80 * window.innerWidth) {\n timeout = window.setTimeout(trigger, 400);\n }\n }\n\n function onTouchStart(evt) {\n clearTimeout();\n touchStart = {\n timestamp: performance.now(),\n scrollY: window.scrollY,\n windowHeight: window.innerHeight\n };\n }\n\n function onTouchEnd(evt) {\n clearTimeout(); // did address bar appear?\n\n if (window.innerHeight > touchStart.windowHeight) {\n return;\n } // allow a tiny tiny margin for error, to not fire on clicks\n\n\n if (window.scrollY + 20 >= touchStart.scrollY) {\n return;\n }\n\n if (performance.now() - touchStart.timestamp > 300) {\n return;\n }\n\n if (['A', 'INPUT', 'BUTTON'].indexOf(evt.target.tagName) > -1) {\n return;\n }\n\n timeout = window.setTimeout(trigger, 800);\n }\n\n window.addEventListener('touchstart', onTouchStart);\n window.addEventListener('touchend', onTouchEnd);\n document.documentElement.addEventListener('mouseenter', onMouseEnter);\n document.documentElement.addEventListener('mouseleave', onMouseLeave);\n document.documentElement.addEventListener('click', clearTimeout);\n};\n\n},{}],9:[function(require,module,exports){\n\"use strict\";\n\nmodule.exports = function (boxes) {\n var pageviews;\n\n try {\n pageviews = sessionStorage.getItem('boxzilla_pageviews') || 0;\n sessionStorage.setItem('boxzilla_pageviews', ++pageviews);\n } catch (e) {\n pageviews = 0;\n }\n\n window.setTimeout(function () {\n boxes.forEach(function (box) {\n if (box.config.trigger.method === 'pageviews' && pageviews >= box.config.trigger.value && box.mayAutoShow()) {\n box.trigger();\n }\n });\n }, 1000);\n};\n\n},{}],10:[function(require,module,exports){\n\"use strict\";\n\nvar throttle = require('../util.js').throttle;\n\nmodule.exports = function (boxes) {\n // check triggerHeight criteria for all boxes\n function checkHeightCriteria() {\n var scrollY = window.hasOwnProperty('pageYOffset') ? window.pageYOffset : window.scrollTop;\n scrollY = scrollY + window.innerHeight * 0.9;\n boxes.forEach(function (box) {\n if (!box.mayAutoShow() || box.triggerHeight <= 0) {\n return;\n }\n\n if (scrollY > box.triggerHeight) {\n box.trigger();\n } // if box may auto-hide and scrollY is less than triggerHeight (with small margin of error), hide box\n\n\n if (box.mayRehide() && scrollY < box.triggerHeight - 5) {\n box.hide();\n }\n });\n }\n\n window.addEventListener('touchstart', throttle(checkHeightCriteria), true);\n window.addEventListener('scroll', throttle(checkHeightCriteria), true);\n};\n\n},{\"../util.js\":12}],11:[function(require,module,exports){\n\"use strict\";\n\nvar Timer = require('../timer.js');\n\nmodule.exports = function (boxes) {\n var siteTimer = new Timer(0);\n var pageTimer = new Timer(0);\n var timers = {\n start: function start() {\n try {\n var sessionTime = parseInt(sessionStorage.getItem('boxzilla_timer'));\n\n if (sessionTime) {\n siteTimer.time = sessionTime;\n }\n } catch (e) {}\n\n siteTimer.start();\n pageTimer.start();\n },\n stop: function stop() {\n sessionStorage.setItem('boxzilla_timer', siteTimer.time);\n siteTimer.stop();\n pageTimer.stop();\n }\n }; // start timers\n\n timers.start(); // stop timers when leaving page or switching to other tab\n\n document.addEventListener(\"visibilitychange\", function () {\n document.hidden ? timers.stop() : timers.start();\n });\n window.addEventListener('beforeunload', function () {\n timers.stop();\n });\n window.setInterval(function () {\n boxes.forEach(function (box) {\n if (box.config.trigger.method === 'time_on_site' && siteTimer.time >= box.config.trigger.value && box.mayAutoShow()) {\n box.trigger();\n }\n\n if (box.config.trigger.method === 'time_on_page' && pageTimer.time >= box.config.trigger.value && box.mayAutoShow()) {\n box.trigger();\n }\n });\n }, 1000);\n};\n\n},{\"../timer.js\":7}],12:[function(require,module,exports){\n\"use strict\";\n\nfunction throttle(fn, threshold, scope) {\n threshold || (threshold = 600);\n var last;\n var deferTimer;\n return function () {\n var context = scope || this;\n var now = +new Date(),\n args = arguments;\n\n if (last && now < last + threshold) {\n // hold on to it\n clearTimeout(deferTimer);\n deferTimer = setTimeout(function () {\n last = now;\n fn.apply(context, args);\n }, threshold);\n } else {\n last = now;\n fn.apply(context, args);\n }\n };\n}\n\nmodule.exports = {\n throttle: throttle\n};\n\n},{}],13:[function(require,module,exports){\n/*!\n * EventEmitter v5.2.8 - git.io/ee\n * Unlicense - http://unlicense.org/\n * Oliver Caldwell - https://oli.me.uk/\n * @preserve\n */\n\n;(function (exports) {\n 'use strict';\n\n /**\n * Class for managing events.\n * Can be extended to provide event functionality in other classes.\n *\n * @class EventEmitter Manages event registering and emitting.\n */\n function EventEmitter() {}\n\n // Shortcuts to improve speed and size\n var proto = EventEmitter.prototype;\n var originalGlobalValue = exports.EventEmitter;\n\n /**\n * Finds the index of the listener for the event in its storage array.\n *\n * @param {Function[]} listeners Array of listeners to search through.\n * @param {Function} listener Method to look for.\n * @return {Number} Index of the specified listener, -1 if not found\n * @api private\n */\n function indexOfListener(listeners, listener) {\n var i = listeners.length;\n while (i--) {\n if (listeners[i].listener === listener) {\n return i;\n }\n }\n\n return -1;\n }\n\n /**\n * Alias a method while keeping the context correct, to allow for overwriting of target method.\n *\n * @param {String} name The name of the target method.\n * @return {Function} The aliased method\n * @api private\n */\n function alias(name) {\n return function aliasClosure() {\n return this[name].apply(this, arguments);\n };\n }\n\n /**\n * Returns the listener array for the specified event.\n * Will initialise the event object and listener arrays if required.\n * Will return an object if you use a regex search. The object contains keys for each matched event. So /ba[rz]/ might return an object containing bar and baz. But only if you have either defined them with defineEvent or added some listeners to them.\n * Each property in the object response is an array of listener functions.\n *\n * @param {String|RegExp} evt Name of the event to return the listeners from.\n * @return {Function[]|Object} All listener functions for the event.\n */\n proto.getListeners = function getListeners(evt) {\n var events = this._getEvents();\n var response;\n var key;\n\n // Return a concatenated array of all matching events if\n // the selector is a regular expression.\n if (evt instanceof RegExp) {\n response = {};\n for (key in events) {\n if (events.hasOwnProperty(key) && evt.test(key)) {\n response[key] = events[key];\n }\n }\n }\n else {\n response = events[evt] || (events[evt] = []);\n }\n\n return response;\n };\n\n /**\n * Takes a list of listener objects and flattens it into a list of listener functions.\n *\n * @param {Object[]} listeners Raw listener objects.\n * @return {Function[]} Just the listener functions.\n */\n proto.flattenListeners = function flattenListeners(listeners) {\n var flatListeners = [];\n var i;\n\n for (i = 0; i < listeners.length; i += 1) {\n flatListeners.push(listeners[i].listener);\n }\n\n return flatListeners;\n };\n\n /**\n * Fetches the requested listeners via getListeners but will always return the results inside an object. This is mainly for internal use but others may find it useful.\n *\n * @param {String|RegExp} evt Name of the event to return the listeners from.\n * @return {Object} All listener functions for an event in an object.\n */\n proto.getListenersAsObject = function getListenersAsObject(evt) {\n var listeners = this.getListeners(evt);\n var response;\n\n if (listeners instanceof Array) {\n response = {};\n response[evt] = listeners;\n }\n\n return response || listeners;\n };\n\n function isValidListener (listener) {\n if (typeof listener === 'function' || listener instanceof RegExp) {\n return true\n } else if (listener && typeof listener === 'object') {\n return isValidListener(listener.listener)\n } else {\n return false\n }\n }\n\n /**\n * Adds a listener function to the specified event.\n * The listener will not be added if it is a duplicate.\n * If the listener returns true then it will be removed after it is called.\n * If you pass a regular expression as the event name then the listener will be added to all events that match it.\n *\n * @param {String|RegExp} evt Name of the event to attach the listener to.\n * @param {Function} listener Method to be called when the event is emitted. If the function returns true then it will be removed after calling.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.addListener = function addListener(evt, listener) {\n if (!isValidListener(listener)) {\n throw new TypeError('listener must be a function');\n }\n\n var listeners = this.getListenersAsObject(evt);\n var listenerIsWrapped = typeof listener === 'object';\n var key;\n\n for (key in listeners) {\n if (listeners.hasOwnProperty(key) && indexOfListener(listeners[key], listener) === -1) {\n listeners[key].push(listenerIsWrapped ? listener : {\n listener: listener,\n once: false\n });\n }\n }\n\n return this;\n };\n\n /**\n * Alias of addListener\n */\n proto.on = alias('addListener');\n\n /**\n * Semi-alias of addListener. It will add a listener that will be\n * automatically removed after its first execution.\n *\n * @param {String|RegExp} evt Name of the event to attach the listener to.\n * @param {Function} listener Method to be called when the event is emitted. If the function returns true then it will be removed after calling.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.addOnceListener = function addOnceListener(evt, listener) {\n return this.addListener(evt, {\n listener: listener,\n once: true\n });\n };\n\n /**\n * Alias of addOnceListener.\n */\n proto.once = alias('addOnceListener');\n\n /**\n * Defines an event name. This is required if you want to use a regex to add a listener to multiple events at once. If you don't do this then how do you expect it to know what event to add to? Should it just add to every possible match for a regex? No. That is scary and bad.\n * You need to tell it what event names should be matched by a regex.\n *\n * @param {String} evt Name of the event to create.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.defineEvent = function defineEvent(evt) {\n this.getListeners(evt);\n return this;\n };\n\n /**\n * Uses defineEvent to define multiple events.\n *\n * @param {String[]} evts An array of event names to define.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.defineEvents = function defineEvents(evts) {\n for (var i = 0; i < evts.length; i += 1) {\n this.defineEvent(evts[i]);\n }\n return this;\n };\n\n /**\n * Removes a listener function from the specified event.\n * When passed a regular expression as the event name, it will remove the listener from all events that match it.\n *\n * @param {String|RegExp} evt Name of the event to remove the listener from.\n * @param {Function} listener Method to remove from the event.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.removeListener = function removeListener(evt, listener) {\n var listeners = this.getListenersAsObject(evt);\n var index;\n var key;\n\n for (key in listeners) {\n if (listeners.hasOwnProperty(key)) {\n index = indexOfListener(listeners[key], listener);\n\n if (index !== -1) {\n listeners[key].splice(index, 1);\n }\n }\n }\n\n return this;\n };\n\n /**\n * Alias of removeListener\n */\n proto.off = alias('removeListener');\n\n /**\n * Adds listeners in bulk using the manipulateListeners method.\n * If you pass an object as the first argument you can add to multiple events at once. The object should contain key value pairs of events and listeners or listener arrays. You can also pass it an event name and an array of listeners to be added.\n * You can also pass it a regular expression to add the array of listeners to all events that match it.\n * Yeah, this function does quite a bit. That's probably a bad thing.\n *\n * @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to add to multiple events at once.\n * @param {Function[]} [listeners] An optional array of listener functions to add.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.addListeners = function addListeners(evt, listeners) {\n // Pass through to manipulateListeners\n return this.manipulateListeners(false, evt, listeners);\n };\n\n /**\n * Removes listeners in bulk using the manipulateListeners method.\n * If you pass an object as the first argument you can remove from multiple events at once. The object should contain key value pairs of events and listeners or listener arrays.\n * You can also pass it an event name and an array of listeners to be removed.\n * You can also pass it a regular expression to remove the listeners from all events that match it.\n *\n * @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to remove from multiple events at once.\n * @param {Function[]} [listeners] An optional array of listener functions to remove.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.removeListeners = function removeListeners(evt, listeners) {\n // Pass through to manipulateListeners\n return this.manipulateListeners(true, evt, listeners);\n };\n\n /**\n * Edits listeners in bulk. The addListeners and removeListeners methods both use this to do their job. You should really use those instead, this is a little lower level.\n * The first argument will determine if the listeners are removed (true) or added (false).\n * If you pass an object as the second argument you can add/remove from multiple events at once. The object should contain key value pairs of events and listeners or listener arrays.\n * You can also pass it an event name and an array of listeners to be added/removed.\n * You can also pass it a regular expression to manipulate the listeners of all events that match it.\n *\n * @param {Boolean} remove True if you want to remove listeners, false if you want to add.\n * @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to add/remove from multiple events at once.\n * @param {Function[]} [listeners] An optional array of listener functions to add/remove.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.manipulateListeners = function manipulateListeners(remove, evt, listeners) {\n var i;\n var value;\n var single = remove ? this.removeListener : this.addListener;\n var multiple = remove ? this.removeListeners : this.addListeners;\n\n // If evt is an object then pass each of its properties to this method\n if (typeof evt === 'object' && !(evt instanceof RegExp)) {\n for (i in evt) {\n if (evt.hasOwnProperty(i) && (value = evt[i])) {\n // Pass the single listener straight through to the singular method\n if (typeof value === 'function') {\n single.call(this, i, value);\n }\n else {\n // Otherwise pass back to the multiple function\n multiple.call(this, i, value);\n }\n }\n }\n }\n else {\n // So evt must be a string\n // And listeners must be an array of listeners\n // Loop over it and pass each one to the multiple method\n i = listeners.length;\n while (i--) {\n single.call(this, evt, listeners[i]);\n }\n }\n\n return this;\n };\n\n /**\n * Removes all listeners from a specified event.\n * If you do not specify an event then all listeners will be removed.\n * That means every event will be emptied.\n * You can also pass a regex to remove all events that match it.\n *\n * @param {String|RegExp} [evt] Optional name of the event to remove all listeners for. Will remove from every event if not passed.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.removeEvent = function removeEvent(evt) {\n var type = typeof evt;\n var events = this._getEvents();\n var key;\n\n // Remove different things depending on the state of evt\n if (type === 'string') {\n // Remove all listeners for the specified event\n delete events[evt];\n }\n else if (evt instanceof RegExp) {\n // Remove all events matching the regex.\n for (key in events) {\n if (events.hasOwnProperty(key) && evt.test(key)) {\n delete events[key];\n }\n }\n }\n else {\n // Remove all listeners in all events\n delete this._events;\n }\n\n return this;\n };\n\n /**\n * Alias of removeEvent.\n *\n * Added to mirror the node API.\n */\n proto.removeAllListeners = alias('removeEvent');\n\n /**\n * Emits an event of your choice.\n * When emitted, every listener attached to that event will be executed.\n * If you pass the optional argument array then those arguments will be passed to every listener upon execution.\n * Because it uses `apply`, your array of arguments will be passed as if you wrote them out separately.\n * So they will not arrive within the array on the other side, they will be separate.\n * You can also pass a regular expression to emit to all events that match it.\n *\n * @param {String|RegExp} evt Name of the event to emit and execute listeners for.\n * @param {Array} [args] Optional array of arguments to be passed to each listener.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.emitEvent = function emitEvent(evt, args) {\n var listenersMap = this.getListenersAsObject(evt);\n var listeners;\n var listener;\n var i;\n var key;\n var response;\n\n for (key in listenersMap) {\n if (listenersMap.hasOwnProperty(key)) {\n listeners = listenersMap[key].slice(0);\n\n for (i = 0; i < listeners.length; i++) {\n // If the listener returns true then it shall be removed from the event\n // The function is executed either with a basic call or an apply if there is an args array\n listener = listeners[i];\n\n if (listener.once === true) {\n this.removeListener(evt, listener.listener);\n }\n\n response = listener.listener.apply(this, args || []);\n\n if (response === this._getOnceReturnValue()) {\n this.removeListener(evt, listener.listener);\n }\n }\n }\n }\n\n return this;\n };\n\n /**\n * Alias of emitEvent\n */\n proto.trigger = alias('emitEvent');\n\n /**\n * Subtly different from emitEvent in that it will pass its arguments on to the listeners, as opposed to taking a single array of arguments to pass on.\n * As with emitEvent, you can pass a regex in place of the event name to emit to all events that match it.\n *\n * @param {String|RegExp} evt Name of the event to emit and execute listeners for.\n * @param {...*} Optional additional arguments to be passed to each listener.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.emit = function emit(evt) {\n var args = Array.prototype.slice.call(arguments, 1);\n return this.emitEvent(evt, args);\n };\n\n /**\n * Sets the current value to check against when executing listeners. If a\n * listeners return value matches the one set here then it will be removed\n * after execution. This value defaults to true.\n *\n * @param {*} value The new value to check for when executing listeners.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.setOnceReturnValue = function setOnceReturnValue(value) {\n this._onceReturnValue = value;\n return this;\n };\n\n /**\n * Fetches the current value to check against when executing listeners. If\n * the listeners return value matches this one then it should be removed\n * automatically. It will return true by default.\n *\n * @return {*|Boolean} The current value to check for or the default, true.\n * @api private\n */\n proto._getOnceReturnValue = function _getOnceReturnValue() {\n if (this.hasOwnProperty('_onceReturnValue')) {\n return this._onceReturnValue;\n }\n else {\n return true;\n }\n };\n\n /**\n * Fetches the events object and creates one if required.\n *\n * @return {Object} The events storage object.\n * @api private\n */\n proto._getEvents = function _getEvents() {\n return this._events || (this._events = {});\n };\n\n /**\n * Reverts the global {@link EventEmitter} to its previous value and returns a reference to this version.\n *\n * @return {Function} Non conflicting EventEmitter class.\n */\n EventEmitter.noConflict = function noConflict() {\n exports.EventEmitter = originalGlobalValue;\n return EventEmitter;\n };\n\n // Expose the class either via AMD, CommonJS or the global object\n if (typeof define === 'function' && define.amd) {\n define(function () {\n return EventEmitter;\n });\n }\n else if (typeof module === 'object' && module.exports){\n module.exports = EventEmitter;\n }\n else {\n exports.EventEmitter = EventEmitter;\n }\n}(typeof window !== 'undefined' ? window : this || {}));\n\n},{}]},{},[1]);\n; })();"]}
1
+ {"version":3,"sources":["script.js"],"names":["r","e","n","t","o","i","f","c","u","a","Error","code","p","exports","call","length","1","require","module","_typeof","obj","Symbol","iterator","constructor","prototype","locationHashRefersBox","box","window","location","hash","match","elementId","element","id","querySelector","Boxzilla","options","isLoggedIn","boxzilla_options","document","body","className","indexOf","testMode","console","log","init","addEventListener","inited","key","boxes","boxOpts","boxContentElement","getElementById","content","create","post","slug","styles","css","background_color","style","background","color","border_color","borderColor","border_width","borderWidth","parseInt","border_style","borderStyle","width","maxWidth","firstChild","lastChild","fits","show","trigger","mc4wp_forms_config","submitted_form","mc4wp_submitted_form","selector","element_id","forEach","maybeOpenMailChimpForWordPressBox","boxzilla","2","duration","property","hasOwnProperty","animate","targetStyles","fn","last","Date","initialStyles","getComputedStyle","currentStyles","propSteps","parseFloat","to","current","tick","step","increment","newValue","timeSinceLastTick","done","_property","requestAnimationFrame","toggle","animation","callbackFn","cleanup","removeAttribute","setAttribute","clone","getAttribute","display","nowVisible","hiddenStyles","visibleStyles","offsetLeft","cloneNode","properties","value","newObject","initObjectProperties","object","copyObjectProperties","isFinite","height","clientRect","getBoundingClientRect","overflowY","opacity","animated","3","defaults","rehide","cookie","icon","screenWidthCondition","position","closable","Animator","Box","config","fireEvent","this","obj1","obj2","obj3","attrname","_attrname","merge","overlay","createElement","classList","add","appendChild","visible","dismissed","triggered","triggerHeight","calculateTriggerHeight","cookieSet","isCookieSet","contentElement","closeIcon","dom","events","evt","preventDefault","dismiss","target","tagName","setCookie","x","offsetX","y","offsetY","rect","left","right","top","bottom","wrapper","innerHTML","setCustomBoxStyling","origDisplay","maxHeight","windowHeight","innerHeight","boxHeight","clientHeight","newTopMargin","marginTop","bind","hide","method","triggerElement","html","documentElement","Math","max","scrollHeight","offsetHeight","getDocumentHeight","condition","innerWidth","onResize","mayAutoShow","mayRehide","replace","RegExp","hours","expiryDate","setHours","getHours","toUTCString","./animator.js","4","throttle","ExitIntent","Scroll","Pageviews","Time","initialised","listeners","onKeyUp","recalculateHeights","onElementClick","el","parentElement","href","event","args","apply","get","String","off","filter","on","push","styleElement","head","opts","minimumScreenWidth","./box.js","./styles.js","./triggers/exit-intent.js","./triggers/pageviews.js","./triggers/scroll.js","./triggers/time.js","./util.js","5","6","Timer","time","interval","start","setInterval","stop","clearInterval","7","timeout","touchStart","removeEventListener","onMouseLeave","onMouseEnter","clearTimeout","onTouchStart","onTouchEnd","clientY","documentMode","test","navigator","userAgent","clientX","setTimeout","timestamp","performance","now","scrollY","8","pageviews","sessionStorage","getItem","setItem","9","checkHeightCriteria","pageYOffset","scrollTop","../util.js","10","siteTimer","pageTimer","timers","sessionTime","hidden","../timer.js","11","threshold","scope","deferTimer","context","arguments"],"mappings":"CAA6H,SAASA,EAAEC,EAAEC,EAAEC,GAAG,SAASC,EAAEC,EAAEC,GAAG,IAAIJ,EAAEG,GAAG,CAAC,IAAIJ,EAAEI,GAAG,CAAC,IAAIE,GAAE,EAAo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,EAAImN,EAAWC,GAE/B,IAAInN,EACAoN,EACJ,OAHcF,EAAdA,GAA0B,IAGnB,WACL,IAAIG,EAAUF,GAAS3J,KACnBsI,GAAO,IAAI7L,KACX+I,EAAOsE,UAEPtN,GAAQ8L,EAAM9L,EAAOkN,GAEvBhC,aAAakC,GACbA,EAAazB,WAAW,WACtB3L,EAAO8L,EACP/L,EAAGkJ,MAAMoE,EAASrE,IACjBkE,KAEHlN,EAAO8L,EACP/L,EAAGkJ,MAAMoE,EAASrE,QAStB,KAAK,GAAG,CAAC","file":"script.min.js","sourcesContent":["(function () { var require = undefined; var module = undefined; var exports = undefined; var define = undefined; (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c=\"function\"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error(\"Cannot find module '\"+i+\"'\");throw a.code=\"MODULE_NOT_FOUND\",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u=\"function\"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){\n\"use strict\";\n\nfunction _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\n(function () {\n var Boxzilla = require('boxzilla');\n\n var options = window.boxzilla_options; // helper function for setting CSS styles\n\n function css(element, styles) {\n if (styles.background_color) {\n element.style.background = styles.background_color;\n }\n\n if (styles.color) {\n element.style.color = styles.color;\n }\n\n if (styles.border_color) {\n element.style.borderColor = styles.border_color;\n }\n\n if (styles.border_width) {\n element.style.borderWidth = parseInt(styles.border_width) + 'px';\n }\n\n if (styles.border_style) {\n element.style.borderStyle = styles.border_style;\n }\n\n if (styles.width) {\n element.style.maxWidth = parseInt(styles.width) + 'px';\n }\n }\n\n function createBoxesFromConfig() {\n // failsafe against including script twice.\n if (options.inited) {\n return;\n } // create boxes from options\n\n\n for (var key in options.boxes) {\n // get opts\n var boxOpts = options.boxes[key];\n boxOpts.testMode = isLoggedIn && options.testMode; // find box content element, bail if not found\n\n var boxContentElement = document.getElementById('boxzilla-box-' + boxOpts.id + '-content');\n\n if (!boxContentElement) {\n continue;\n } // use element as content option\n\n\n boxOpts.content = boxContentElement; // create box\n\n var box = Boxzilla.create(boxOpts.id, boxOpts); // add box slug to box element as classname\n\n box.element.className = box.element.className + ' boxzilla-' + boxOpts.post.slug; // add custom css to box\n\n css(box.element, boxOpts.css);\n\n try {\n box.element.firstChild.firstChild.className += ' first-child';\n box.element.firstChild.lastChild.className += ' last-child';\n } catch (e) {} // maybe show box right away\n\n\n if (box.fits() && locationHashRefersBox(box)) {\n box.show();\n }\n } // set flag to prevent initialising twice\n\n\n options.inited = true; // trigger \"done\" event.\n\n Boxzilla.trigger('done'); // maybe open box with MC4WP form in it\n\n maybeOpenMailChimpForWordPressBox();\n }\n\n function locationHashRefersBox(box) {\n if (!window.location.hash || window.location.hash.length === 0) {\n return false;\n } // parse \"boxzilla-{id}\" from location hash\n\n\n var match = window.location.hash.match(/[#&](boxzilla-\\d+)/);\n\n if (!match || _typeof(match) !== 'object' || match.length < 2) {\n return false;\n }\n\n var elementId = match[1];\n\n if (elementId === box.element.id) {\n return true;\n } else if (box.element.querySelector('#' + elementId)) {\n return true;\n }\n\n return false;\n }\n\n function maybeOpenMailChimpForWordPressBox() {\n if ((_typeof(window.mc4wp_forms_config) !== 'object' || !window.mc4wp_forms_config.submitted_form) && _typeof(window.mc4wp_submitted_form) !== 'object') {\n return;\n }\n\n var form = window.mc4wp_submitted_form || window.mc4wp_forms_config.submitted_form;\n var selector = '#' + form.element_id;\n Boxzilla.boxes.forEach(function (box) {\n if (box.element.querySelector(selector)) {\n box.show();\n }\n });\n } // print message when test mode is enabled\n\n\n var isLoggedIn = document.body.className.indexOf('logged-in') > -1;\n\n if (isLoggedIn && options.testMode) {\n console.log('Boxzilla: Test mode is enabled. Please disable test mode if you\\'re done testing.');\n } // init boxzilla\n\n\n Boxzilla.init(); // on window.load, create DOM elements for boxes\n\n window.addEventListener('load', createBoxesFromConfig);\n})();\n\n},{\"boxzilla\":4}],2:[function(require,module,exports){\n\"use strict\";\n\nvar duration = 320;\n\nfunction css(element, styles) {\n for (var property in styles) {\n if (!styles.hasOwnProperty(property)) {\n continue;\n }\n\n element.style[property] = styles[property];\n }\n}\n\nfunction initObjectProperties(properties, value) {\n var newObject = {};\n\n for (var i = 0; i < properties.length; i++) {\n newObject[properties[i]] = value;\n }\n\n return newObject;\n}\n\nfunction copyObjectProperties(properties, object) {\n var newObject = {};\n\n for (var i = 0; i < properties.length; i++) {\n newObject[properties[i]] = object[properties[i]];\n }\n\n return newObject;\n}\n/**\n * Checks if the given element is currently being animated.\n *\n * @param element\n * @returns {boolean}\n */\n\n\nfunction animated(element) {\n return !!element.getAttribute('data-animated');\n}\n/**\n * Toggles the element using the given animation.\n *\n * @param element\n * @param animation Either \"fade\" or \"slide\"\n * @param callbackFn\n */\n\n\nfunction toggle(element, animation, callbackFn) {\n var nowVisible = element.style.display !== 'none' || element.offsetLeft > 0; // create clone for reference\n\n var clone = element.cloneNode(true);\n\n var cleanup = function cleanup() {\n element.removeAttribute('data-animated');\n element.setAttribute('style', clone.getAttribute('style'));\n element.style.display = nowVisible ? 'none' : '';\n\n if (callbackFn) {\n callbackFn();\n }\n }; // store attribute so everyone knows we're animating this element\n\n\n element.setAttribute('data-animated', 'true'); // toggle element visiblity right away if we're making something visible\n\n if (!nowVisible) {\n element.style.display = '';\n }\n\n var hiddenStyles;\n var visibleStyles; // animate properties\n\n if (animation === 'slide') {\n hiddenStyles = initObjectProperties(['height', 'borderTopWidth', 'borderBottomWidth', 'paddingTop', 'paddingBottom'], 0);\n visibleStyles = {};\n\n if (!nowVisible) {\n var computedStyles = window.getComputedStyle(element);\n visibleStyles = copyObjectProperties(['height', 'borderTopWidth', 'borderBottomWidth', 'paddingTop', 'paddingBottom'], computedStyles); // in some browsers, getComputedStyle returns \"auto\" value. this falls back to getBoundingClientRect() in those browsers since we need an actual height.\n\n if (!isFinite(visibleStyles.height)) {\n var clientRect = element.getBoundingClientRect();\n visibleStyles.height = clientRect.height;\n }\n\n css(element, hiddenStyles);\n } // don't show a scrollbar during animation\n\n\n element.style.overflowY = 'hidden';\n animate(element, nowVisible ? hiddenStyles : visibleStyles, cleanup);\n } else {\n hiddenStyles = {\n opacity: 0\n };\n visibleStyles = {\n opacity: 1\n };\n\n if (!nowVisible) {\n css(element, hiddenStyles);\n }\n\n animate(element, nowVisible ? hiddenStyles : visibleStyles, cleanup);\n }\n}\n\nfunction animate(element, targetStyles, fn) {\n var last = +new Date();\n var initialStyles = window.getComputedStyle(element);\n var currentStyles = {};\n var propSteps = {};\n\n for (var property in targetStyles) {\n if (!targetStyles.hasOwnProperty(property)) {\n continue;\n } // make sure we have an object filled with floats\n\n\n targetStyles[property] = parseFloat(targetStyles[property]); // calculate step size & current value\n\n var to = targetStyles[property];\n var current = parseFloat(initialStyles[property]); // is there something to do?\n\n if (current === to) {\n delete targetStyles[property];\n continue;\n }\n\n propSteps[property] = (to - current) / duration; // points per second\n\n currentStyles[property] = current;\n }\n\n var tick = function tick() {\n var now = +new Date();\n var timeSinceLastTick = now - last;\n var done = true;\n var step, to, increment, newValue;\n\n for (var _property in targetStyles) {\n if (!targetStyles.hasOwnProperty(_property)) {\n continue;\n }\n\n step = propSteps[_property];\n to = targetStyles[_property];\n increment = step * timeSinceLastTick;\n newValue = currentStyles[_property] + increment;\n\n if (step > 0 && newValue >= to || step < 0 && newValue <= to) {\n newValue = to;\n } else {\n done = false;\n } // store new value\n\n\n currentStyles[_property] = newValue;\n element.style[_property] = _property !== 'opacity' ? newValue + 'px' : newValue;\n }\n\n last = +new Date();\n\n if (!done) {\n // keep going until we're done for all props\n window.requestAnimationFrame(tick);\n } else {\n // call callback\n fn && fn();\n }\n };\n\n tick();\n}\n\nmodule.exports = {\n toggle: toggle,\n animate: animate,\n animated: animated\n};\n\n},{}],3:[function(require,module,exports){\n\"use strict\";\n\nvar defaults = {\n animation: 'fade',\n rehide: false,\n content: '',\n cookie: null,\n icon: '&times',\n screenWidthCondition: null,\n position: 'center',\n testMode: false,\n trigger: false,\n closable: true\n};\n\nvar Animator = require('./animator.js');\n/**\n * Merge 2 objects, values of the latter overwriting the former.\n *\n * @param obj1\n * @param obj2\n * @returns {*}\n */\n\n\nfunction merge(obj1, obj2) {\n var obj3 = {}; // add obj1 to obj3\n\n for (var attrname in obj1) {\n if (obj1.hasOwnProperty(attrname)) {\n obj3[attrname] = obj1[attrname];\n }\n } // add obj2 to obj3\n\n\n for (var _attrname in obj2) {\n if (obj2.hasOwnProperty(_attrname)) {\n obj3[_attrname] = obj2[_attrname];\n }\n }\n\n return obj3;\n}\n/**\n * Get the real height of entire document.\n * @returns {number}\n */\n\n\nfunction getDocumentHeight() {\n var body = document.body;\n var html = document.documentElement;\n return Math.max(body.scrollHeight, body.offsetHeight, html.clientHeight, html.scrollHeight, html.offsetHeight);\n} // Box Object\n\n\nfunction Box(id, config, fireEvent) {\n this.id = id;\n this.fireEvent = fireEvent; // store config values\n\n this.config = merge(defaults, config); // add overlay element to dom and store ref to overlay\n\n this.overlay = document.createElement('div');\n this.overlay.style.display = 'none';\n this.overlay.id = 'boxzilla-overlay-' + this.id;\n this.overlay.classList.add('boxzilla-overlay');\n document.body.appendChild(this.overlay); // state\n\n this.visible = false;\n this.dismissed = false;\n this.triggered = false;\n this.triggerHeight = this.calculateTriggerHeight();\n this.cookieSet = this.isCookieSet();\n this.element = null;\n this.contentElement = null;\n this.closeIcon = null; // create dom elements for this box\n\n this.dom(); // further initialise the box\n\n this.events();\n} // initialise the box\n\n\nBox.prototype.events = function () {\n var box = this; // attach event to \"close\" icon inside box\n\n if (this.closeIcon) {\n this.closeIcon.addEventListener('click', function (evt) {\n evt.preventDefault();\n box.dismiss();\n });\n }\n\n this.element.addEventListener('click', function (evt) {\n if (evt.target.tagName === 'A') {\n this.fireEvent('box.interactions.link', [box, evt.target]);\n }\n }, false);\n this.element.addEventListener('submit', function (evt) {\n box.setCookie();\n this.fireEvent('box.interactions.form', [box, evt.target]);\n }, false);\n this.overlay.addEventListener('click', function (e) {\n var x = e.offsetX;\n var y = e.offsetY; // calculate if click was less than 40px outside box to avoid closing it by accident\n\n var rect = box.element.getBoundingClientRect();\n var margin = 40; // if click was not anywhere near box, dismiss it.\n\n if (x < rect.left - margin || x > rect.right + margin || y < rect.top - margin || y > rect.bottom + margin) {\n box.dismiss();\n }\n });\n}; // generate dom elements for this box\n\n\nBox.prototype.dom = function () {\n var wrapper = document.createElement('div');\n wrapper.className = 'boxzilla-container boxzilla-' + this.config.position + '-container';\n var box = document.createElement('div');\n box.id = 'boxzilla-' + this.id;\n box.className = 'boxzilla boxzilla-' + this.id + ' boxzilla-' + this.config.position;\n box.style.display = 'none';\n wrapper.appendChild(box);\n var content;\n\n if (typeof this.config.content === 'string') {\n content = document.createElement('div');\n content.innerHTML = this.config.content;\n } else {\n content = this.config.content; // make sure element is visible\n\n content.style.display = '';\n }\n\n content.className = 'boxzilla-content';\n box.appendChild(content);\n\n if (this.config.closable && this.config.icon) {\n var closeIcon = document.createElement('span');\n closeIcon.className = 'boxzilla-close-icon';\n closeIcon.innerHTML = this.config.icon;\n box.appendChild(closeIcon);\n this.closeIcon = closeIcon;\n }\n\n document.body.appendChild(wrapper);\n this.contentElement = content;\n this.element = box;\n}; // set (calculate) custom box styling depending on box options\n\n\nBox.prototype.setCustomBoxStyling = function () {\n // reset element to its initial state\n var origDisplay = this.element.style.display;\n this.element.style.display = '';\n this.element.style.overflowY = '';\n this.element.style.maxHeight = ''; // get new dimensions\n\n var windowHeight = window.innerHeight;\n var boxHeight = this.element.clientHeight; // add scrollbar to box and limit height\n\n if (boxHeight > windowHeight) {\n this.element.style.maxHeight = windowHeight + 'px';\n this.element.style.overflowY = 'scroll';\n } // set new top margin for boxes which are centered\n\n\n if (this.config.position === 'center') {\n var newTopMargin = (windowHeight - boxHeight) / 2;\n newTopMargin = newTopMargin >= 0 ? newTopMargin : 0;\n this.element.style.marginTop = newTopMargin + 'px';\n }\n\n this.element.style.display = origDisplay;\n}; // toggle visibility of the box\n\n\nBox.prototype.toggle = function (show, animate) {\n show = typeof show === 'undefined' ? !this.visible : show;\n animate = typeof animate === 'undefined' ? true : animate; // is box already at desired visibility?\n\n if (show === this.visible) {\n return false;\n } // is box being animated?\n\n\n if (Animator.animated(this.element)) {\n return false;\n } // if box should be hidden but is not closable, bail.\n\n\n if (!show && !this.config.closable) {\n return false;\n } // set new visibility status\n\n\n this.visible = show; // calculate new styling rules\n\n this.setCustomBoxStyling(); // trigger event\n\n this.fireEvent('box.' + (show ? 'show' : 'hide'), [this]); // show or hide box using selected animation\n\n if (this.config.position === 'center') {\n this.overlay.classList.toggle('boxzilla-' + this.id + '-overlay');\n\n if (animate) {\n Animator.toggle(this.overlay, 'fade');\n } else {\n this.overlay.style.display = show ? '' : 'none';\n }\n }\n\n if (animate) {\n Animator.toggle(this.element, this.config.animation, function () {\n if (this.visible) {\n return;\n }\n\n this.contentElement.innerHTML = this.contentElement.innerHTML + '';\n }.bind(this));\n } else {\n this.element.style.display = show ? '' : 'none';\n }\n\n return true;\n}; // show the box\n\n\nBox.prototype.show = function (animate) {\n return this.toggle(true, animate);\n}; // hide the box\n\n\nBox.prototype.hide = function (animate) {\n return this.toggle(false, animate);\n}; // calculate trigger height\n\n\nBox.prototype.calculateTriggerHeight = function () {\n var triggerHeight = 0;\n\n if (this.config.trigger) {\n if (this.config.trigger.method === 'element') {\n var triggerElement = document.body.querySelector(this.config.trigger.value);\n\n if (triggerElement) {\n var offset = triggerElement.getBoundingClientRect();\n triggerHeight = offset.top;\n }\n } else if (this.config.trigger.method === 'percentage') {\n triggerHeight = this.config.trigger.value / 100 * getDocumentHeight();\n }\n }\n\n return triggerHeight;\n};\n\nBox.prototype.fits = function () {\n if (!this.config.screenWidthCondition || !this.config.screenWidthCondition.value) {\n return true;\n }\n\n switch (this.config.screenWidthCondition.condition) {\n case 'larger':\n return window.innerWidth > this.config.screenWidthCondition.value;\n\n case 'smaller':\n return window.innerWidth < this.config.screenWidthCondition.value;\n } // meh.. condition should be \"smaller\" or \"larger\", just return true.\n\n\n return true;\n};\n\nBox.prototype.onResize = function () {\n this.triggerHeight = this.calculateTriggerHeight();\n this.setCustomBoxStyling();\n}; // is this box enabled?\n\n\nBox.prototype.mayAutoShow = function () {\n if (this.dismissed) {\n return false;\n } // check if box fits on given minimum screen width\n\n\n if (!this.fits()) {\n return false;\n } // if trigger empty or error in calculating triggerHeight, return false\n\n\n if (!this.config.trigger) {\n return false;\n } // rely on cookie value (show if not set, don't show if set)\n\n\n return !this.cookieSet;\n};\n\nBox.prototype.mayRehide = function () {\n return this.config.rehide && this.triggered;\n};\n\nBox.prototype.isCookieSet = function () {\n // always show on test mode or when no auto-trigger is configured\n if (this.config.testMode || !this.config.trigger) {\n return false;\n } // if either cookie is null or trigger & dismiss are both falsey, don't bother checking.\n\n\n if (!this.config.cookie || !this.config.cookie.triggered && !this.config.cookie.dismissed) {\n return false;\n }\n\n return document.cookie.replace(new RegExp('(?:(?:^|.*;)\\\\s*' + 'boxzilla_box_' + this.id + '\\\\s*\\\\=\\\\s*([^;]*).*$)|^.*$'), '$1') === 'true';\n}; // set cookie that disables automatically showing the box\n\n\nBox.prototype.setCookie = function (hours) {\n var expiryDate = new Date();\n expiryDate.setHours(expiryDate.getHours() + hours);\n document.cookie = 'boxzilla_box_' + this.id + '=true; expires=' + expiryDate.toUTCString() + '; path=/';\n};\n\nBox.prototype.trigger = function () {\n var shown = this.show();\n\n if (!shown) {\n return;\n }\n\n this.triggered = true;\n\n if (this.config.cookie && this.config.cookie.triggered) {\n this.setCookie(this.config.cookie.triggered);\n }\n};\n/**\n * Dismisses the box and optionally sets a cookie.\n * @param animate\n * @returns {boolean}\n */\n\n\nBox.prototype.dismiss = function (animate) {\n // only dismiss box if it's currently open.\n if (!this.visible) {\n return false;\n } // hide box element\n\n\n this.hide(animate); // set cookie\n\n if (this.config.cookie && this.config.cookie.dismissed) {\n this.setCookie(this.config.cookie.dismissed);\n }\n\n this.dismissed = true;\n this.fireEvent('box.dismiss', [this]);\n return true;\n};\n\nmodule.exports = Box;\n\n},{\"./animator.js\":2}],4:[function(require,module,exports){\n\"use strict\";\n\nvar Box = require('./box.js');\n\nvar throttle = require('./util.js').throttle;\n\nvar styles = require('./styles.js');\n\nvar ExitIntent = require('./triggers/exit-intent.js');\n\nvar Scroll = require('./triggers/scroll.js');\n\nvar Pageviews = require('./triggers/pageviews.js');\n\nvar Time = require('./triggers/time.js');\n\nvar initialised = false;\nvar boxes = [];\nvar listeners = {};\n\nfunction onKeyUp(evt) {\n if (evt.key === 'Escape' || evt.key === 'Esc') {\n dismiss();\n }\n}\n\nfunction recalculateHeights() {\n boxes.forEach(function (box) {\n return box.onResize();\n });\n}\n\nfunction onElementClick(evt) {\n // bubble up to <a> element\n var el = evt.target;\n\n for (var i = 0; i <= 3; i++) {\n if (!el || el.tagName === 'A') {\n break;\n }\n\n el = el.parentElement;\n }\n\n if (!el || el.tagName !== 'A' || !el.href) {\n return;\n }\n\n var match = el.href.match(/[#&]boxzilla-(.+)/i);\n\n if (match && match.length > 1) {\n toggle(match[1]);\n }\n}\n\nfunction trigger(event, args) {\n listeners[event] && listeners[event].forEach(function (f) {\n return f.apply(null, args);\n });\n}\n\nfunction on(event, fn) {\n listeners[event] = listeners[event] || [];\n listeners[event].push(fn);\n}\n\nfunction off(event, fn) {\n listeners[event] && listeners[event].filter(function (f) {\n return f !== fn;\n });\n} // initialise & add event listeners\n\n\nfunction init() {\n if (initialised) {\n return;\n } // insert styles into DOM\n\n\n var styleElement = document.createElement('style');\n styleElement.innerHTML = styles;\n document.head.appendChild(styleElement); // init triggers\n\n ExitIntent(boxes);\n Pageviews(boxes);\n Scroll(boxes);\n Time(boxes);\n document.body.addEventListener('click', onElementClick, true);\n window.addEventListener('resize', throttle(recalculateHeights));\n window.addEventListener('load', recalculateHeights);\n document.addEventListener('keyup', onKeyUp);\n trigger('ready');\n initialised = true; // ensure this function doesn't run again\n}\n\nfunction create(id, opts) {\n // preserve backwards compat for minimumScreenWidth option\n if (typeof opts.minimumScreenWidth !== 'undefined') {\n opts.screenWidthCondition = {\n condition: 'larger',\n value: opts.minimumScreenWidth\n };\n }\n\n id = String(id);\n var box = new Box(id, opts, trigger);\n boxes.push(box);\n return box;\n}\n\nfunction get(id) {\n id = String(id);\n\n for (var i = 0; i < boxes.length; i++) {\n if (boxes[i].id === id) {\n return boxes[i];\n }\n }\n\n throw new Error('No box exists with ID ' + id);\n} // dismiss a single box (or all by omitting id param)\n\n\nfunction dismiss(id, animate) {\n if (id) {\n get(id).dismiss(animate);\n } else {\n boxes.forEach(function (box) {\n return box.dismiss(animate);\n });\n }\n}\n\nfunction hide(id, animate) {\n if (id) {\n get(id).hide(animate);\n } else {\n boxes.forEach(function (box) {\n return box.hide(animate);\n });\n }\n}\n\nfunction show(id, animate) {\n if (id) {\n get(id).show(animate);\n } else {\n boxes.forEach(function (box) {\n return box.show(animate);\n });\n }\n}\n\nfunction toggle(id, animate) {\n if (id) {\n get(id).toggle(animate);\n } else {\n boxes.forEach(function (box) {\n return box.toggle(animate);\n });\n }\n} // expose boxzilla object\n\n\nvar Boxzilla = {\n off: off,\n on: on,\n get: get,\n init: init,\n create: create,\n trigger: trigger,\n show: show,\n hide: hide,\n dismiss: dismiss,\n toggle: toggle,\n boxes: boxes\n};\nwindow.Boxzilla = Boxzilla;\n\nif (typeof module !== 'undefined' && module.exports) {\n module.exports = Boxzilla;\n}\n\n},{\"./box.js\":3,\"./styles.js\":5,\"./triggers/exit-intent.js\":7,\"./triggers/pageviews.js\":8,\"./triggers/scroll.js\":9,\"./triggers/time.js\":10,\"./util.js\":11}],5:[function(require,module,exports){\n\"use strict\";\n\nvar styles = '#boxzilla-overlay,.boxzilla-overlay{position:fixed;background:rgba(0,0,0,.65);width:100%;height:100%;left:0;top:0;z-index:10000}.boxzilla-center-container{position:fixed;top:0;left:0;right:0;height:0;text-align:center;z-index:11000;line-height:0}.boxzilla-center-container .boxzilla{display:inline-block;text-align:left;position:relative;line-height:normal}.boxzilla{position:fixed;z-index:12000;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;background:#fff;padding:25px}.boxzilla.boxzilla-top-left{top:0;left:0}.boxzilla.boxzilla-top-right{top:0;right:0}.boxzilla.boxzilla-bottom-left{bottom:0;left:0}.boxzilla.boxzilla-bottom-right{bottom:0;right:0}.boxzilla-content>:first-child{margin-top:0;padding-top:0}.boxzilla-content>:last-child{margin-bottom:0;padding-bottom:0}.boxzilla-close-icon{position:absolute;right:0;top:0;text-align:center;padding:6px;cursor:pointer;-webkit-appearance:none;font-size:28px;font-weight:700;line-height:20px;color:#000;opacity:.5}.boxzilla-close-icon:focus,.boxzilla-close-icon:hover{opacity:.8}';\nmodule.exports = styles;\n\n},{}],6:[function(require,module,exports){\n\"use strict\";\n\nvar Timer = function Timer() {\n this.time = 0;\n this.interval = 0;\n};\n\nTimer.prototype.tick = function () {\n this.time++;\n};\n\nTimer.prototype.start = function () {\n if (!this.interval) {\n this.interval = window.setInterval(this.tick.bind(this), 1000);\n }\n};\n\nTimer.prototype.stop = function () {\n if (this.interval) {\n window.clearInterval(this.interval);\n this.interval = 0;\n }\n};\n\nmodule.exports = Timer;\n\n},{}],7:[function(require,module,exports){\n\"use strict\";\n\nmodule.exports = function (boxes) {\n var timeout = null;\n var touchStart = {};\n\n function trigger() {\n document.documentElement.removeEventListener('mouseleave', onMouseLeave);\n document.documentElement.removeEventListener('mouseenter', onMouseEnter);\n document.documentElement.removeEventListener('click', clearTimeout);\n window.removeEventListener('touchstart', onTouchStart);\n window.removeEventListener('touchend', onTouchEnd); // show boxes with exit intent trigger\n\n boxes.forEach(function (box) {\n if (box.mayAutoShow() && box.config.trigger.method === 'exit_intent') {\n box.trigger();\n }\n });\n }\n\n function clearTimeout() {\n if (timeout === null) {\n return;\n }\n\n window.clearTimeout(timeout);\n timeout = null;\n }\n\n function onMouseEnter() {\n clearTimeout();\n }\n\n function getAddressBarY() {\n if (document.documentMode || /Edge\\//.test(navigator.userAgent)) {\n return 5;\n }\n\n return 0;\n }\n\n function onMouseLeave(evt) {\n clearTimeout(); // did mouse leave at top of window?\n // add small exception space in the top-right corner\n\n if (evt.clientY <= getAddressBarY() && evt.clientX < 0.8 * window.innerWidth) {\n timeout = window.setTimeout(trigger, 600);\n }\n }\n\n function onTouchStart() {\n clearTimeout();\n touchStart = {\n timestamp: performance.now(),\n scrollY: window.scrollY,\n windowHeight: window.innerHeight\n };\n }\n\n function onTouchEnd(evt) {\n clearTimeout(); // did address bar appear?\n\n if (window.innerHeight > touchStart.windowHeight) {\n return;\n } // allow a tiny tiny margin for error, to not fire on clicks\n\n\n if (window.scrollY + 20 > touchStart.scrollY) {\n return;\n }\n\n if (performance.now() - touchStart.timestamp > 300) {\n return;\n }\n\n if (['A', 'INPUT', 'BUTTON'].indexOf(evt.target.tagName) > -1) {\n return;\n }\n\n timeout = window.setTimeout(trigger, 800);\n }\n\n window.addEventListener('touchstart', onTouchStart);\n window.addEventListener('touchend', onTouchEnd);\n document.documentElement.addEventListener('mouseenter', onMouseEnter);\n document.documentElement.addEventListener('mouseleave', onMouseLeave);\n document.documentElement.addEventListener('click', clearTimeout);\n};\n\n},{}],8:[function(require,module,exports){\n\"use strict\";\n\nmodule.exports = function (boxes) {\n var pageviews;\n\n try {\n pageviews = sessionStorage.getItem('boxzilla_pageviews') || 0;\n sessionStorage.setItem('boxzilla_pageviews', ++pageviews);\n } catch (e) {\n pageviews = 0;\n }\n\n window.setTimeout(function () {\n boxes.forEach(function (box) {\n if (box.config.trigger.method === 'pageviews' && pageviews > box.config.trigger.value && box.mayAutoShow()) {\n box.trigger();\n }\n });\n }, 1000);\n};\n\n},{}],9:[function(require,module,exports){\n\"use strict\";\n\nvar throttle = require('../util.js').throttle;\n\nmodule.exports = function (boxes) {\n // check triggerHeight criteria for all boxes\n function checkHeightCriteria() {\n var scrollY = window.hasOwnProperty('pageYOffset') ? window.pageYOffset : window.scrollTop;\n scrollY = scrollY + window.innerHeight * 0.9;\n boxes.forEach(function (box) {\n if (!box.mayAutoShow() || box.triggerHeight <= 0) {\n return;\n }\n\n if (scrollY > box.triggerHeight) {\n box.trigger();\n } else if (box.mayRehide() && scrollY < box.triggerHeight - 5) {\n // if box may auto-hide and scrollY is less than triggerHeight (with small margin of error), hide box\n box.hide();\n }\n });\n }\n\n window.addEventListener('touchstart', throttle(checkHeightCriteria), true);\n window.addEventListener('scroll', throttle(checkHeightCriteria), true);\n};\n\n},{\"../util.js\":11}],10:[function(require,module,exports){\n\"use strict\";\n\nvar Timer = require('../timer.js');\n\nmodule.exports = function (boxes) {\n var siteTimer = new Timer();\n var pageTimer = new Timer();\n var timers = {\n start: function start() {\n try {\n var sessionTime = parseInt(sessionStorage.getItem('boxzilla_timer'));\n\n if (sessionTime) {\n siteTimer.time = sessionTime;\n }\n } catch (e) {}\n\n siteTimer.start();\n pageTimer.start();\n },\n stop: function stop() {\n sessionStorage.setItem('boxzilla_timer', siteTimer.time);\n siteTimer.stop();\n pageTimer.stop();\n }\n }; // start timers\n\n timers.start(); // stop timers when leaving page or switching to other tab\n\n document.addEventListener('visibilitychange', function () {\n document.hidden ? timers.stop() : timers.start();\n });\n window.addEventListener('beforeunload', function () {\n timers.stop();\n });\n window.setInterval(function () {\n boxes.forEach(function (box) {\n if (box.config.trigger.method === 'time_on_site' && siteTimer.time > box.config.trigger.value && box.mayAutoShow()) {\n box.trigger();\n } else if (box.config.trigger.method === 'time_on_page' && pageTimer.time > box.config.trigger.value && box.mayAutoShow()) {\n box.trigger();\n }\n });\n }, 1000);\n};\n\n},{\"../timer.js\":6}],11:[function(require,module,exports){\n\"use strict\";\n\nfunction throttle(fn, threshold, scope) {\n threshold || (threshold = 800);\n var last;\n var deferTimer;\n return function () {\n var context = scope || this;\n var now = +new Date();\n var args = arguments;\n\n if (last && now < last + threshold) {\n // hold on to it\n clearTimeout(deferTimer);\n deferTimer = setTimeout(function () {\n last = now;\n fn.apply(context, args);\n }, threshold);\n } else {\n last = now;\n fn.apply(context, args);\n }\n };\n}\n\nmodule.exports = {\n throttle: throttle\n};\n\n},{}]},{},[1]);\n; })();"]}
boxzilla.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  /*
3
  Plugin Name: Boxzilla
4
- Version: 3.2.20
5
  Plugin URI: https://boxzillaplugin.com/#utm_source=wp-plugin&utm_medium=boxzilla&utm_campaign=plugins-page
6
  Description: Call-To-Action Boxes that display after visitors scroll down far enough. Unobtrusive, but highly conversing!
7
  Author: ibericode
@@ -11,7 +11,7 @@ Domain Path: /languages/
11
  License: GPL v3
12
 
13
  Boxzilla Plugin
14
- Copyright (C) 2013-2019, Danny van Kooten, hi@dannyvankooten.com
15
 
16
  This program is free software: you can redistribute it and/or modify
17
  it under the terms of the GNU General Public License as published by
@@ -41,7 +41,7 @@ if ( ! defined( 'ABSPATH' ) ) {
41
  function _load_boxzilla() {
42
 
43
  define( 'BOXZILLA_FILE', __FILE__ );
44
- define( 'BOXZILLA_VERSION', '3.2.20' );
45
 
46
  require __DIR__ . '/bootstrap.php';
47
  }
1
  <?php
2
  /*
3
  Plugin Name: Boxzilla
4
+ Version: 3.2.21
5
  Plugin URI: https://boxzillaplugin.com/#utm_source=wp-plugin&utm_medium=boxzilla&utm_campaign=plugins-page
6
  Description: Call-To-Action Boxes that display after visitors scroll down far enough. Unobtrusive, but highly conversing!
7
  Author: ibericode
11
  License: GPL v3
12
 
13
  Boxzilla Plugin
14
+ Copyright (C) 2013 - 2020, Danny van Kooten, hi@dannyvankooten.com
15
 
16
  This program is free software: you can redistribute it and/or modify
17
  it under the terms of the GNU General Public License as published by
41
  function _load_boxzilla() {
42
 
43
  define( 'BOXZILLA_FILE', __FILE__ );
44
+ define( 'BOXZILLA_VERSION', '3.2.21' );
45
 
46
  require __DIR__ . '/bootstrap.php';
47
  }
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://boxzillaplugin.com/#utm_source=wp-plugin-repo&utm_medium=bo
4
  Tags: scroll triggered box, cta, social, pop-up, newsletter, call to action, mailchimp, contact form 7, social media, mc4wp, ibericode
5
  Requires at least: 4.6
6
  Tested up to: 5.3
7
- Stable tag: 3.2.20
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
  Requires PHP: 5.3
@@ -131,6 +131,11 @@ Have a look at the [frequently asked questions](https://wordpress.org/plugins/bo
131
  == Changelog ==
132
 
133
 
 
 
 
 
 
134
  #### 3.2.20 - Jan 20, 2020
135
 
136
  **Fixes**
4
  Tags: scroll triggered box, cta, social, pop-up, newsletter, call to action, mailchimp, contact form 7, social media, mc4wp, ibericode
5
  Requires at least: 4.6
6
  Tested up to: 5.3
7
+ Stable tag: 3.2.21
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
  Requires PHP: 5.3
131
  == Changelog ==
132
 
133
 
134
+ #### 3.2.21 - Feb 18, 2020
135
+
136
+ - "If post category" or "if post tag" conditionals now apply to any post-type using built-in WP categories or tags.
137
+
138
+
139
  #### 3.2.20 - Jan 20, 2020
140
 
141
  **Fixes**
src/class-loader.php CHANGED
@@ -145,7 +145,7 @@ class BoxLoader {
145
  break;
146
 
147
  case 'is_post_in_category':
148
- $matched = is_singular( 'post' ) && has_category( $values );
149
  break;
150
 
151
  case 'is_page':
@@ -153,7 +153,7 @@ class BoxLoader {
153
  break;
154
 
155
  case 'is_post_with_tag':
156
- $matched = is_singular( 'post' ) && has_tag( $values );
157
  break;
158
 
159
  case 'is_user_logged_in':
145
  break;
146
 
147
  case 'is_post_in_category':
148
+ $matched = is_singular() && has_category( $values );
149
  break;
150
 
151
  case 'is_page':
153
  break;
154
 
155
  case 'is_post_with_tag':
156
+ $matched = is_singular() && has_tag( $values );
157
  break;
158
 
159
  case 'is_user_logged_in':