Popup Maker – Popup Forms, Optins & More - Version 1.6.0

Version Description

Download this release

Release Info

Developer danieliser
Plugin Icon 128x128 Popup Maker – Popup Forms, Optins & More
Version 1.6.0
Comparing to
See all releases

Code changes from version 1.5.8 to 1.6.0

assets/images/icon-256x256.jpg ADDED
Binary file
assets/js/admin.js CHANGED
@@ -6709,7 +6709,7 @@ var PUMCookies;
6709
 
6710
  $('#pum_popup_cookie_fields').addClass('has-cookies');
6711
 
6712
- if (PUMTriggers.new_cookie >= 0) {
6713
  $trigger = $('#pum_popup_triggers_list tbody tr').eq(PUMTriggers.new_cookie).find('.popup_triggers_field_settings:first');
6714
  trigger_settings = JSON.parse($trigger.val());
6715
 
@@ -7285,10 +7285,16 @@ var PUMRangeSLiders;
7285
 
7286
  $(document)
7287
  .on('pum_init', PUMRangeSLiders.init)
 
 
 
7288
  .on('input', 'input[type="range"]', function () {
7289
  var $this = $(this);
7290
  $this.siblings('.popmake-range-manual').val($this.val());
7291
  })
 
 
 
7292
  .on('change', '.popmake-range-manual', function () {
7293
  var $this = $(this),
7294
  max = parseInt($this.prop('max'), 0),
6709
 
6710
  $('#pum_popup_cookie_fields').addClass('has-cookies');
6711
 
6712
+ if (PUMTriggers.new_cookie !== false && PUMTriggers.new_cookie >= 0) {
6713
  $trigger = $('#pum_popup_triggers_list tbody tr').eq(PUMTriggers.new_cookie).find('.popup_triggers_field_settings:first');
6714
  trigger_settings = JSON.parse($trigger.val());
6715
 
7285
 
7286
  $(document)
7287
  .on('pum_init', PUMRangeSLiders.init)
7288
+ /**
7289
+ * Updates the input field when the slider is used.
7290
+ */
7291
  .on('input', 'input[type="range"]', function () {
7292
  var $this = $(this);
7293
  $this.siblings('.popmake-range-manual').val($this.val());
7294
  })
7295
+ /**
7296
+ * Update sliders value, min, & max when manual entry is detected.
7297
+ */
7298
  .on('change', '.popmake-range-manual', function () {
7299
  var $this = $(this),
7300
  max = parseInt($this.prop('max'), 0),
assets/js/admin.min.js CHANGED
@@ -1,4 +1,4 @@
1
  function pumSelected(e,t,n){"use strict";var i=!1;return"object"==typeof e&&"string"==typeof t&&jQuery.inArray(t,e)!==-1?i=!0:"object"==typeof t&&"string"==typeof e&&jQuery.inArray(e,t)!==-1?i=!0:e===t&&(i=!0),void 0!==n&&n?i?' selected="selected"':"":i}function pumChecked(e,t,n){"use strict";var i=!1;return"object"==typeof e&&"string"==typeof t&&jQuery.inArray(t,e)!==-1?i=!0:"object"==typeof t&&"string"==typeof e&&jQuery.inArray(e,t)!==-1?i=!0:e===t&&(i=!0),void 0!==n&&n?i?' checked="checked"':"":i}!function(e){"function"==typeof define&&void 0!==define.amd&&define.amd?define(["jquery"],e):e("object"==typeof exports?require("jquery"):jQuery)}(function(e){var t=function(){if(e&&e.fn&&e.fn.pumselect2&&e.fn.pumselect2.amd)var t=e.fn.pumselect2.amd;var t;return function(){if(!t||!t.requirejs){t?n=t:t={};var e,n,i;!function(t){function o(e,t){return b.call(e,t)}function s(e,t){var n,i,o,s,r,a,l,c,p,u,d,h=t&&t.split("/"),f=v.map,m=f&&f["*"]||{};if(e&&"."===e.charAt(0))if(t){for(e=e.split("/"),r=e.length-1,v.nodeIdCompat&&k.test(e[r])&&(e[r]=e[r].replace(k,"")),e=h.slice(0,h.length-1).concat(e),p=0;p<e.length;p+=1)if(d=e[p],"."===d)e.splice(p,1),p-=1;else if(".."===d){if(1===p&&(".."===e[2]||".."===e[0]))break;p>0&&(e.splice(p-1,2),p-=2)}e=e.join("/")}else 0===e.indexOf("./")&&(e=e.substring(2));if((h||m)&&f){for(n=e.split("/"),p=n.length;p>0;p-=1){if(i=n.slice(0,p).join("/"),h)for(u=h.length;u>0;u-=1)if(o=f[h.slice(0,u).join("/")],o&&(o=o[i])){s=o,a=p;break}if(s)break;!l&&m&&m[i]&&(l=m[i],c=p)}!s&&l&&(s=l,a=c),s&&(n.splice(0,a,s),e=n.join("/"))}return e}function r(e,n){return function(){var i=w.call(arguments,0);return"string"!=typeof i[0]&&1===i.length&&i.push(null),h.apply(t,i.concat([e,n]))}}function a(e){return function(t){return s(t,e)}}function l(e){return function(t){g[e]=t}}function c(e){if(o(_,e)){var n=_[e];delete _[e],y[e]=!0,d.apply(t,n)}if(!o(g,e)&&!o(y,e))throw new Error("No "+e);return g[e]}function p(e){var t,n=e?e.indexOf("!"):-1;return n>-1&&(t=e.substring(0,n),e=e.substring(n+1,e.length)),[t,e]}function u(e){return function(){return v&&v.config&&v.config[e]||{}}}var d,h,f,m,g={},_={},v={},y={},b=Object.prototype.hasOwnProperty,w=[].slice,k=/\.js$/;f=function(e,t){var n,i=p(e),o=i[0];return e=i[1],o&&(o=s(o,t),n=c(o)),o?e=n&&n.normalize?n.normalize(e,a(t)):s(e,t):(e=s(e,t),i=p(e),o=i[0],e=i[1],o&&(n=c(o))),{f:o?o+"!"+e:e,n:e,pr:o,p:n}},m={require:function(e){return r(e)},exports:function(e){var t=g[e];return"undefined"!=typeof t?t:g[e]={}},module:function(e){return{id:e,uri:"",exports:g[e],config:u(e)}}},d=function(e,n,i,s){var a,p,u,d,h,v,b=[],w=typeof i;if(s=s||e,"undefined"===w||"function"===w){for(n=!n.length&&i.length?["require","exports","module"]:n,h=0;h<n.length;h+=1)if(d=f(n[h],s),p=d.f,"require"===p)b[h]=m.require(e);else if("exports"===p)b[h]=m.exports(e),v=!0;else if("module"===p)a=b[h]=m.module(e);else if(o(g,p)||o(_,p)||o(y,p))b[h]=c(p);else{if(!d.p)throw new Error(e+" missing "+p);d.p.load(d.n,r(s,!0),l(p),{}),b[h]=g[p]}u=i?i.apply(g[e],b):void 0,e&&(a&&a.exports!==t&&a.exports!==g[e]?g[e]=a.exports:u===t&&v||(g[e]=u))}else e&&(g[e]=i)},e=n=h=function(e,n,i,o,s){if("string"==typeof e)return m[e]?m[e](n):c(f(e,n).f);if(!e.splice){if(v=e,v.deps&&h(v.deps,v.callback),!n)return;n.splice?(e=n,n=i,i=null):e=t}return n=n||function(){},"function"==typeof i&&(i=o,o=s),o?d(t,e,n,i):setTimeout(function(){d(t,e,n,i)},4),h},h.config=function(e){return h(e)},e._defined=g,i=function(e,t,n){if("string"!=typeof e)throw new Error("See almond README: incorrect module build, no module name");t.splice||(n=t,t=[]),o(g,e)||o(_,e)||(_[e]=[e,t,n])},i.amd={jQuery:!0}}(),t.requirejs=e,t.require=n,t.define=i}}(),t.define("almond",function(){}),t.define("jquery",[],function(){var t=e||$;return null==t&&console&&console.error&&console.error("Select2: An instance of jQuery or a jQuery-compatible library was not found. Make sure that you are including jQuery before Select2 on your web page."),t}),t.define("pumselect2/utils",["jquery"],function(e){function t(e){var t=e.prototype,n=[];for(var i in t){var o=t[i];"function"==typeof o&&"constructor"!==i&&n.push(i)}return n}var n={};n.Extend=function(e,t){function n(){this.constructor=e}var i={}.hasOwnProperty;for(var o in t)i.call(t,o)&&(e[o]=t[o]);return n.prototype=t.prototype,e.prototype=new n,e.__super__=t.prototype,e},n.Decorate=function(e,n){function i(){var t=Array.prototype.unshift,i=n.prototype.constructor.length,o=e.prototype.constructor;i>0&&(t.call(arguments,e.prototype.constructor),o=n.prototype.constructor),o.apply(this,arguments)}function o(){this.constructor=i}var s=t(n),r=t(e);n.displayName=e.displayName,i.prototype=new o;for(var a=0;a<r.length;a++){var l=r[a];i.prototype[l]=e.prototype[l]}for(var c=(function(e){var t=function(){};e in i.prototype&&(t=i.prototype[e]);var o=n.prototype[e];return function(){var e=Array.prototype.unshift;return e.call(arguments,t),o.apply(this,arguments)}}),p=0;p<s.length;p++){var u=s[p];i.prototype[u]=c(u)}return i};var i=function(){this.listeners={}};return i.prototype.on=function(e,t){this.listeners=this.listeners||{},e in this.listeners?this.listeners[e].push(t):this.listeners[e]=[t]},i.prototype.trigger=function(e){var t=Array.prototype.slice;this.listeners=this.listeners||{},e in this.listeners&&this.invoke(this.listeners[e],t.call(arguments,1)),"*"in this.listeners&&this.invoke(this.listeners["*"],arguments)},i.prototype.invoke=function(e,t){for(var n=0,i=e.length;n<i;n++)e[n].apply(this,t)},n.Observable=i,n.generateChars=function(e){for(var t="",n=0;n<e;n++){var i=Math.floor(36*Math.random());t+=i.toString(36)}return t},n.bind=function(e,t){return function(){e.apply(t,arguments)}},n._convertData=function(e){for(var t in e){var n=t.split("-"),i=e;if(1!==n.length){for(var o=0;o<n.length;o++){var s=n[o];s=s.substring(0,1).toLowerCase()+s.substring(1),s in i||(i[s]={}),o==n.length-1&&(i[s]=e[t]),i=i[s]}delete e[t]}}return e},n.hasScroll=function(t,n){var i=e(n),o=n.style.overflowX,s=n.style.overflowY;return(o!==s||"hidden"!==s&&"visible"!==s)&&("scroll"===o||"scroll"===s||(i.innerHeight()<n.scrollHeight||i.innerWidth()<n.scrollWidth))},n.escapeMarkup=function(e){var t={"\\":"&#92;","&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#47;"};return"string"!=typeof e?e:String(e).replace(/[&<>"'\/\\]/g,function(e){return t[e]})},n.appendMany=function(t,n){if("1.7"===e.fn.jquery.substr(0,3)){var i=e();e.map(n,function(e){i=i.add(e)}),n=i}t.append(n)},n}),t.define("pumselect2/results",["jquery","./utils"],function(e,t){function n(e,t,i){this.$element=e,this.data=i,this.options=t,n.__super__.constructor.call(this)}return t.Extend(n,t.Observable),n.prototype.render=function(){var t=e('<ul class="pumselect2-results__options" role="tree"></ul>');return this.options.get("multiple")&&t.attr("aria-multiselectable","true"),this.$results=t,t},n.prototype.clear=function(){this.$results.empty()},n.prototype.displayMessage=function(t){var n=this.options.get("escapeMarkup");this.clear(),this.hideLoading();var i=e('<li role="treeitem" aria-live="assertive" class="pumselect2-results__option"></li>'),o=this.options.get("translations").get(t.message);i.append(n(o(t.args))),i[0].className+=" pumselect2-results__message",this.$results.append(i)},n.prototype.hideMessages=function(){this.$results.find(".pumselect2-results__message").remove()},n.prototype.append=function(e){this.hideLoading();var t=[];if(null==e.results||0===e.results.length)return void(0===this.$results.children().length&&this.trigger("results:message",{message:"noResults"}));e.results=this.sort(e.results);for(var n=0;n<e.results.length;n++){var i=e.results[n],o=this.option(i);t.push(o)}this.$results.append(t)},n.prototype.position=function(e,t){var n=t.find(".pumselect2-results");n.append(e)},n.prototype.sort=function(e){var t=this.options.get("sorter");return t(e)},n.prototype.setClasses=function(){var t=this;this.data.current(function(n){var i=e.map(n,function(e){return e.id.toString()}),o=t.$results.find(".pumselect2-results__option[aria-selected]");o.each(function(){var t=e(this),n=e.data(this,"data"),o=""+n.id;null!=n.element&&n.element.selected||null==n.element&&e.inArray(o,i)>-1?t.attr("aria-selected","true"):t.attr("aria-selected","false")});var s=o.filter("[aria-selected=true]");s.length>0?s.first().trigger("mouseenter"):o.first().trigger("mouseenter")})},n.prototype.showLoading=function(e){this.hideLoading();var t=this.options.get("translations").get("searching"),n={disabled:!0,loading:!0,text:t(e)},i=this.option(n);i.className+=" loading-results",this.$results.prepend(i)},n.prototype.hideLoading=function(){this.$results.find(".loading-results").remove()},n.prototype.option=function(t){var n=document.createElement("li");n.className="pumselect2-results__option";var i={role:"treeitem","aria-selected":"false"};t.disabled&&(delete i["aria-selected"],i["aria-disabled"]="true"),null==t.id&&delete i["aria-selected"],null!=t._resultId&&(n.id=t._resultId),t.title&&(n.title=t.title),t.children&&(i.role="group",i["aria-label"]=t.text,delete i["aria-selected"]);for(var o in i){var s=i[o];n.setAttribute(o,s)}if(t.children){var r=e(n),a=document.createElement("strong");a.className="pumselect2-results__group";e(a);this.template(t,a);for(var l=[],c=0;c<t.children.length;c++){var p=t.children[c],u=this.option(p);l.push(u)}var d=e("<ul></ul>",{"class":"pumselect2-results__options pumselect2-results__options--nested"});d.append(l),r.append(a),r.append(d)}else this.template(t,n);return e.data(n,"data",t),n},n.prototype.bind=function(t,n){var i=this,o=t.id+"-results";this.$results.attr("id",o),t.on("results:all",function(e){i.clear(),i.append(e.data),t.isOpen()&&i.setClasses()}),t.on("results:append",function(e){i.append(e.data),t.isOpen()&&i.setClasses()}),t.on("query",function(e){i.hideMessages(),i.showLoading(e)}),t.on("select",function(){t.isOpen()&&i.setClasses()}),t.on("unselect",function(){t.isOpen()&&i.setClasses()}),t.on("open",function(){i.$results.attr("aria-expanded","true"),i.$results.attr("aria-hidden","false"),i.setClasses(),i.ensureHighlightVisible()}),t.on("close",function(){i.$results.attr("aria-expanded","false"),i.$results.attr("aria-hidden","true"),i.$results.removeAttr("aria-activedescendant")}),t.on("results:toggle",function(){var e=i.getHighlightedResults();0!==e.length&&e.trigger("mouseup")}),t.on("results:select",function(){var e=i.getHighlightedResults();if(0!==e.length){var t=e.data("data");"true"==e.attr("aria-selected")?i.trigger("close",{}):i.trigger("select",{data:t})}}),t.on("results:previous",function(){var e=i.getHighlightedResults(),t=i.$results.find("[aria-selected]"),n=t.index(e);if(0!==n){var o=n-1;0===e.length&&(o=0);var s=t.eq(o);s.trigger("mouseenter");var r=i.$results.offset().top,a=s.offset().top,l=i.$results.scrollTop()+(a-r);0===o?i.$results.scrollTop(0):a-r<0&&i.$results.scrollTop(l)}}),t.on("results:next",function(){var e=i.getHighlightedResults(),t=i.$results.find("[aria-selected]"),n=t.index(e),o=n+1;if(!(o>=t.length)){var s=t.eq(o);s.trigger("mouseenter");var r=i.$results.offset().top+i.$results.outerHeight(!1),a=s.offset().top+s.outerHeight(!1),l=i.$results.scrollTop()+a-r;0===o?i.$results.scrollTop(0):a>r&&i.$results.scrollTop(l)}}),t.on("results:focus",function(e){e.element.addClass("pumselect2-results__option--highlighted")}),t.on("results:message",function(e){i.displayMessage(e)}),e.fn.mousewheel&&this.$results.on("mousewheel",function(e){var t=i.$results.scrollTop(),n=i.$results.get(0).scrollHeight-t+e.deltaY,o=e.deltaY>0&&t-e.deltaY<=0,s=e.deltaY<0&&n<=i.$results.height();o?(i.$results.scrollTop(0),e.preventDefault(),e.stopPropagation()):s&&(i.$results.scrollTop(i.$results.get(0).scrollHeight-i.$results.height()),e.preventDefault(),e.stopPropagation())}),this.$results.on("mouseup",".pumselect2-results__option[aria-selected]",function(t){var n=e(this),o=n.data("data");return"true"===n.attr("aria-selected")?void(i.options.get("multiple")?i.trigger("unselect",{originalEvent:t,data:o}):i.trigger("close",{})):void i.trigger("select",{originalEvent:t,data:o})}),this.$results.on("mouseenter",".pumselect2-results__option[aria-selected]",function(t){var n=e(this).data("data");i.getHighlightedResults().removeClass("pumselect2-results__option--highlighted"),i.trigger("results:focus",{data:n,element:e(this)})})},n.prototype.getHighlightedResults=function(){var e=this.$results.find(".pumselect2-results__option--highlighted");return e},n.prototype.destroy=function(){this.$results.remove()},n.prototype.ensureHighlightVisible=function(){var e=this.getHighlightedResults();if(0!==e.length){var t=this.$results.find("[aria-selected]"),n=t.index(e),i=this.$results.offset().top,o=e.offset().top,s=this.$results.scrollTop()+(o-i),r=o-i;s-=2*e.outerHeight(!1),n<=2?this.$results.scrollTop(0):(r>this.$results.outerHeight()||r<0)&&this.$results.scrollTop(s)}},n.prototype.template=function(t,n){var i=this.options.get("templateResult"),o=this.options.get("escapeMarkup"),s=i(t,n);null==s?n.style.display="none":"string"==typeof s?n.innerHTML=o(s):e(n).append(s)},n}),t.define("pumselect2/keys",[],function(){var e={BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46};return e}),t.define("pumselect2/selection/base",["jquery","../utils","../keys"],function(e,t,n){function i(e,t){this.$element=e,this.options=t,i.__super__.constructor.call(this)}return t.Extend(i,t.Observable),i.prototype.render=function(){var t=e('<span class="pumselect2-selection" role="combobox" aria-haspopup="true" aria-expanded="false"></span>');return this._tabindex=0,null!=this.$element.data("old-tabindex")?this._tabindex=this.$element.data("old-tabindex"):null!=this.$element.attr("tabindex")&&(this._tabindex=this.$element.attr("tabindex")),t.attr("title",this.$element.attr("title")),t.attr("tabindex",this._tabindex),this.$selection=t,t},i.prototype.bind=function(e,t){var i=this,o=(e.id+"-container",e.id+"-results");this.container=e,this.$selection.on("focus",function(e){i.trigger("focus",e)}),this.$selection.on("blur",function(e){i._handleBlur(e)}),this.$selection.on("keydown",function(e){i.trigger("keypress",e),e.which===n.SPACE&&e.preventDefault()}),e.on("results:focus",function(e){i.$selection.attr("aria-activedescendant",e.data._resultId)}),e.on("selection:update",function(e){i.update(e.data)}),e.on("open",function(){i.$selection.attr("aria-expanded","true"),i.$selection.attr("aria-owns",o),i._attachCloseHandler(e)}),e.on("close",function(){i.$selection.attr("aria-expanded","false"),i.$selection.removeAttr("aria-activedescendant"),i.$selection.removeAttr("aria-owns"),i.$selection.focus(),i._detachCloseHandler(e)}),e.on("enable",function(){i.$selection.attr("tabindex",i._tabindex)}),e.on("disable",function(){i.$selection.attr("tabindex","-1")})},i.prototype._handleBlur=function(t){var n=this;window.setTimeout(function(){document.activeElement==n.$selection[0]||e.contains(n.$selection[0],document.activeElement)||n.trigger("blur",t)},1)},i.prototype._attachCloseHandler=function(t){e(document.body).on("mousedown.pumselect2."+t.id,function(t){var n=e(t.target),i=n.closest(".pumselect2"),o=e(".pumselect2.pumselect2-container--open");o.each(function(){var t=e(this);if(this!=i[0]){var n=t.data("element");n.pumselect2("close")}})})},i.prototype._detachCloseHandler=function(t){e(document.body).off("mousedown.pumselect2."+t.id)},i.prototype.position=function(e,t){var n=t.find(".selection");n.append(e)},i.prototype.destroy=function(){this._detachCloseHandler(this.container)},i.prototype.update=function(e){throw new Error("The `update` method must be defined in child classes.")},i}),t.define("pumselect2/selection/single",["jquery","./base","../utils","../keys"],function(e,t,n,i){function o(){o.__super__.constructor.apply(this,arguments)}return n.Extend(o,t),o.prototype.render=function(){var e=o.__super__.render.call(this);return e.addClass("pumselect2-selection--single"),e.html('<span class="pumselect2-selection__rendered"></span><span class="pumselect2-selection__arrow" role="presentation"><b role="presentation"></b></span>'),e},o.prototype.bind=function(e,t){var n=this;o.__super__.bind.apply(this,arguments);var i=e.id+"-container";this.$selection.find(".pumselect2-selection__rendered").attr("id",i),this.$selection.attr("aria-labelledby",i),this.$selection.on("mousedown",function(e){1===e.which&&n.trigger("toggle",{originalEvent:e})}),this.$selection.on("focus",function(e){}),this.$selection.on("blur",function(e){}),e.on("selection:update",function(e){n.update(e.data)})},o.prototype.clear=function(){this.$selection.find(".pumselect2-selection__rendered").empty()},o.prototype.display=function(e,t){var n=this.options.get("templateSelection"),i=this.options.get("escapeMarkup");return i(n(e,t))},o.prototype.selectionContainer=function(){return e("<span></span>")},o.prototype.update=function(e){if(0===e.length)return void this.clear();var t=e[0],n=this.$selection.find(".pumselect2-selection__rendered"),i=this.display(t,n);n.empty().append(i),n.prop("title",t.title||t.text)},o}),t.define("pumselect2/selection/multiple",["jquery","./base","../utils"],function(e,t,n){function i(e,t){i.__super__.constructor.apply(this,arguments)}return n.Extend(i,t),i.prototype.render=function(){var e=i.__super__.render.call(this);return e.addClass("pumselect2-selection--multiple"),e.html('<ul class="pumselect2-selection__rendered"></ul>'),e},i.prototype.bind=function(t,n){var o=this;i.__super__.bind.apply(this,arguments),this.$selection.on("click",function(e){o.trigger("toggle",{originalEvent:e})}),this.$selection.on("click",".pumselect2-selection__choice__remove",function(t){if(!o.options.get("disabled")){var n=e(this),i=n.parent(),s=i.data("data");o.trigger("unselect",{originalEvent:t,data:s})}})},i.prototype.clear=function(){this.$selection.find(".pumselect2-selection__rendered").empty()},i.prototype.display=function(e,t){var n=this.options.get("templateSelection"),i=this.options.get("escapeMarkup");return i(n(e,t))},i.prototype.selectionContainer=function(){var t=e('<li class="pumselect2-selection__choice"><span class="pumselect2-selection__choice__remove" role="presentation">&times;</span></li>');return t},i.prototype.update=function(e){if(this.clear(),0!==e.length){for(var t=[],i=0;i<e.length;i++){var o=e[i],s=this.selectionContainer(),r=this.display(o,s);s.append(r),s.prop("title",o.title||o.text),s.data("data",o),t.push(s)}var a=this.$selection.find(".pumselect2-selection__rendered");n.appendMany(a,t)}},i}),t.define("pumselect2/selection/placeholder",["../utils"],function(e){function t(e,t,n){this.placeholder=this.normalizePlaceholder(n.get("placeholder")),e.call(this,t,n)}return t.prototype.normalizePlaceholder=function(e,t){return"string"==typeof t&&(t={id:"",text:t}),t},t.prototype.createPlaceholder=function(e,t){var n=this.selectionContainer();return n.html(this.display(t)),n.addClass("pumselect2-selection__placeholder").removeClass("pumselect2-selection__choice"),n},t.prototype.update=function(e,t){var n=1==t.length&&t[0].id!=this.placeholder.id,i=t.length>1;if(i||n)return e.call(this,t);this.clear();var o=this.createPlaceholder(this.placeholder);this.$selection.find(".pumselect2-selection__rendered").append(o)},t}),t.define("pumselect2/selection/allowClear",["jquery","../keys"],function(e,t){function n(){}return n.prototype.bind=function(e,t,n){var i=this;e.call(this,t,n),null==this.placeholder&&this.options.get("debug")&&window.console&&console.error&&console.error("Select2: The `allowClear` option should be used in combination with the `placeholder` option."),this.$selection.on("mousedown",".pumselect2-selection__clear",function(e){i._handleClear(e)}),t.on("keypress",function(e){i._handleKeyboardClear(e,t)})},n.prototype._handleClear=function(e,t){if(!this.options.get("disabled")){var n=this.$selection.find(".pumselect2-selection__clear");if(0!==n.length){t.stopPropagation();for(var i=n.data("data"),o=0;o<i.length;o++){var s={data:i[o]};if(this.trigger("unselect",s),s.prevented)return}this.$element.val(this.placeholder.id).trigger("change"),this.trigger("toggle",{})}}},n.prototype._handleKeyboardClear=function(e,n,i){i.isOpen()||n.which!=t.DELETE&&n.which!=t.BACKSPACE||this._handleClear(n)},n.prototype.update=function(t,n){if(t.call(this,n),!(this.$selection.find(".pumselect2-selection__placeholder").length>0||0===n.length)){var i=e('<span class="pumselect2-selection__clear">&times;</span>');i.data("data",n),this.$selection.find(".pumselect2-selection__rendered").prepend(i)}},n}),t.define("pumselect2/selection/search",["jquery","../utils","../keys"],function(e,t,n){function i(e,t,n){e.call(this,t,n)}return i.prototype.render=function(t){var n=e('<li class="pumselect2-search pumselect2-search--inline"><input class="pumselect2-search__field" type="search" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" role="textbox" aria-autocomplete="list" /></li>');this.$searchContainer=n,this.$search=n.find("input");var i=t.call(this);return this._transferTabIndex(),i},i.prototype.bind=function(e,t,i){var o=this;e.call(this,t,i),t.on("open",function(){o.$search.trigger("focus")}),t.on("close",function(){o.$search.val(""),o.$search.removeAttr("aria-activedescendant"),o.$search.trigger("focus")}),t.on("enable",function(){o.$search.prop("disabled",!1),o._transferTabIndex()}),t.on("disable",function(){o.$search.prop("disabled",!0)}),t.on("focus",function(e){o.$search.trigger("focus")}),t.on("results:focus",function(e){o.$search.attr("aria-activedescendant",e.id)}),this.$selection.on("focusin",".pumselect2-search--inline",function(e){o.trigger("focus",e)}),this.$selection.on("focusout",".pumselect2-search--inline",function(e){o._handleBlur(e)}),this.$selection.on("keydown",".pumselect2-search--inline",function(e){e.stopPropagation(),o.trigger("keypress",e),o._keyUpPrevented=e.isDefaultPrevented();var t=e.which;if(t===n.BACKSPACE&&""===o.$search.val()){var i=o.$searchContainer.prev(".pumselect2-selection__choice");if(i.length>0){var s=i.data("data");o.searchRemoveChoice(s),e.preventDefault()}}});var s=document.documentMode,r=s&&s<=11;this.$selection.on("input.searchcheck",".pumselect2-search--inline",function(e){return r?void o.$selection.off("input.search input.searchcheck"):void o.$selection.off("keyup.search")}),this.$selection.on("keyup.search input.search",".pumselect2-search--inline",function(e){if(r&&"input"===e.type)return void o.$selection.off("input.search input.searchcheck");var t=e.which;t!=n.SHIFT&&t!=n.CTRL&&t!=n.ALT&&t!=n.TAB&&o.handleSearch(e)})},i.prototype._transferTabIndex=function(e){this.$search.attr("tabindex",this.$selection.attr("tabindex")),this.$selection.attr("tabindex","-1")},i.prototype.createPlaceholder=function(e,t){this.$search.attr("placeholder",t.text)},i.prototype.update=function(e,t){var n=this.$search[0]==document.activeElement;this.$search.attr("placeholder",""),e.call(this,t),this.$selection.find(".pumselect2-selection__rendered").append(this.$searchContainer),this.resizeSearch(),n&&this.$search.focus()},i.prototype.handleSearch=function(){if(this.resizeSearch(),!this._keyUpPrevented){var e=this.$search.val();this.trigger("query",{term:e})}this._keyUpPrevented=!1},i.prototype.searchRemoveChoice=function(e,t){this.trigger("unselect",{data:t}),this.$search.val(t.text),this.handleSearch()},i.prototype.resizeSearch=function(){this.$search.css("width","25px");var e="";if(""!==this.$search.attr("placeholder"))e=this.$selection.find(".pumselect2-selection__rendered").innerWidth();else{var t=this.$search.val().length+1;e=.75*t+"em"}this.$search.css("width",e)},i}),t.define("pumselect2/selection/eventRelay",["jquery"],function(e){function t(){}return t.prototype.bind=function(t,n,i){var o=this,s=["open","opening","close","closing","select","selecting","unselect","unselecting"],r=["opening","closing","selecting","unselecting"];t.call(this,n,i),n.on("*",function(t,n){if(e.inArray(t,s)!==-1){n=n||{};var i=e.Event("pumselect2:"+t,{params:n});o.$element.trigger(i),e.inArray(t,r)!==-1&&(n.prevented=i.isDefaultPrevented())}})},t}),t.define("pumselect2/translation",["jquery","require"],function(e,t){function n(e){this.dict=e||{}}return n.prototype.all=function(){return this.dict},n.prototype.get=function(e){return this.dict[e]},n.prototype.extend=function(t){this.dict=e.extend({},t.all(),this.dict)},n._cache={},n.loadPath=function(e){if(!(e in n._cache)){var i=t(e);n._cache[e]=i}return new n(n._cache[e])},n}),t.define("pumselect2/diacritics",[],function(){var e={"Ⓐ":"A","A":"A","À":"A","Á":"A","Â":"A","Ầ":"A","Ấ":"A","Ẫ":"A","Ẩ":"A","Ã":"A","Ā":"A","Ă":"A","Ằ":"A","Ắ":"A","Ẵ":"A","Ẳ":"A","Ȧ":"A","Ǡ":"A","Ä":"A","Ǟ":"A","Ả":"A","Å":"A","Ǻ":"A","Ǎ":"A","Ȁ":"A","Ȃ":"A","Ạ":"A","Ậ":"A","Ặ":"A","Ḁ":"A","Ą":"A","Ⱥ":"A","Ɐ":"A","Ꜳ":"AA","Æ":"AE","Ǽ":"AE","Ǣ":"AE","Ꜵ":"AO","Ꜷ":"AU","Ꜹ":"AV","Ꜻ":"AV","Ꜽ":"AY","Ⓑ":"B","B":"B","Ḃ":"B","Ḅ":"B","Ḇ":"B","Ƀ":"B","Ƃ":"B","Ɓ":"B","Ⓒ":"C","C":"C","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","Ç":"C","Ḉ":"C","Ƈ":"C","Ȼ":"C","Ꜿ":"C","Ⓓ":"D","D":"D","Ḋ":"D","Ď":"D","Ḍ":"D","Ḑ":"D","Ḓ":"D","Ḏ":"D","Đ":"D","Ƌ":"D","Ɗ":"D","Ɖ":"D","Ꝺ":"D","DZ":"DZ","DŽ":"DZ","Dz":"Dz","Dž":"Dz","Ⓔ":"E","E":"E","È":"E","É":"E","Ê":"E","Ề":"E","Ế":"E","Ễ":"E","Ể":"E","Ẽ":"E","Ē":"E","Ḕ":"E","Ḗ":"E","Ĕ":"E","Ė":"E","Ë":"E","Ẻ":"E","Ě":"E","Ȅ":"E","Ȇ":"E","Ẹ":"E","Ệ":"E","Ȩ":"E","Ḝ":"E","Ę":"E","Ḙ":"E","Ḛ":"E","Ɛ":"E","Ǝ":"E","Ⓕ":"F","F":"F","Ḟ":"F","Ƒ":"F","Ꝼ":"F","Ⓖ":"G","G":"G","Ǵ":"G","Ĝ":"G","Ḡ":"G","Ğ":"G","Ġ":"G","Ǧ":"G","Ģ":"G","Ǥ":"G","Ɠ":"G","Ꞡ":"G","Ᵹ":"G","Ꝿ":"G","Ⓗ":"H","H":"H","Ĥ":"H","Ḣ":"H","Ḧ":"H","Ȟ":"H","Ḥ":"H","Ḩ":"H","Ḫ":"H","Ħ":"H","Ⱨ":"H","Ⱶ":"H","Ɥ":"H","Ⓘ":"I","I":"I","Ì":"I","Í":"I","Î":"I","Ĩ":"I","Ī":"I","Ĭ":"I","İ":"I","Ï":"I","Ḯ":"I","Ỉ":"I","Ǐ":"I","Ȉ":"I","Ȋ":"I","Ị":"I","Į":"I","Ḭ":"I","Ɨ":"I","Ⓙ":"J","J":"J","Ĵ":"J","Ɉ":"J","Ⓚ":"K","K":"K","Ḱ":"K","Ǩ":"K","Ḳ":"K","Ķ":"K","Ḵ":"K","Ƙ":"K","Ⱪ":"K","Ꝁ":"K","Ꝃ":"K","Ꝅ":"K","Ꞣ":"K","Ⓛ":"L","L":"L","Ŀ":"L","Ĺ":"L","Ľ":"L","Ḷ":"L","Ḹ":"L","Ļ":"L","Ḽ":"L","Ḻ":"L","Ł":"L","Ƚ":"L","Ɫ":"L","Ⱡ":"L","Ꝉ":"L","Ꝇ":"L","Ꞁ":"L","LJ":"LJ","Lj":"Lj","Ⓜ":"M","M":"M","Ḿ":"M","Ṁ":"M","Ṃ":"M","Ɱ":"M","Ɯ":"M","Ⓝ":"N","N":"N","Ǹ":"N","Ń":"N","Ñ":"N","Ṅ":"N","Ň":"N","Ṇ":"N","Ņ":"N","Ṋ":"N","Ṉ":"N","Ƞ":"N","Ɲ":"N","Ꞑ":"N","Ꞥ":"N","NJ":"NJ","Nj":"Nj","Ⓞ":"O","O":"O","Ò":"O","Ó":"O","Ô":"O","Ồ":"O","Ố":"O","Ỗ":"O","Ổ":"O","Õ":"O","Ṍ":"O","Ȭ":"O","Ṏ":"O","Ō":"O","Ṑ":"O","Ṓ":"O","Ŏ":"O","Ȯ":"O","Ȱ":"O","Ö":"O","Ȫ":"O","Ỏ":"O","Ő":"O","Ǒ":"O","Ȍ":"O","Ȏ":"O","Ơ":"O","Ờ":"O","Ớ":"O","Ỡ":"O","Ở":"O","Ợ":"O","Ọ":"O","Ộ":"O","Ǫ":"O","Ǭ":"O","Ø":"O","Ǿ":"O","Ɔ":"O","Ɵ":"O","Ꝋ":"O","Ꝍ":"O","Ƣ":"OI","Ꝏ":"OO","Ȣ":"OU","Ⓟ":"P","P":"P","Ṕ":"P","Ṗ":"P","Ƥ":"P","Ᵽ":"P","Ꝑ":"P","Ꝓ":"P","Ꝕ":"P","Ⓠ":"Q","Q":"Q","Ꝗ":"Q","Ꝙ":"Q","Ɋ":"Q","Ⓡ":"R","R":"R","Ŕ":"R","Ṙ":"R","Ř":"R","Ȑ":"R","Ȓ":"R","Ṛ":"R","Ṝ":"R","Ŗ":"R","Ṟ":"R","Ɍ":"R","Ɽ":"R","Ꝛ":"R","Ꞧ":"R","Ꞃ":"R","Ⓢ":"S","S":"S","ẞ":"S","Ś":"S","Ṥ":"S","Ŝ":"S","Ṡ":"S","Š":"S","Ṧ":"S","Ṣ":"S","Ṩ":"S","Ș":"S","Ş":"S","Ȿ":"S","Ꞩ":"S","Ꞅ":"S","Ⓣ":"T","T":"T","Ṫ":"T","Ť":"T","Ṭ":"T","Ț":"T","Ţ":"T","Ṱ":"T","Ṯ":"T","Ŧ":"T","Ƭ":"T","Ʈ":"T","Ⱦ":"T","Ꞇ":"T","Ꜩ":"TZ","Ⓤ":"U","U":"U","Ù":"U","Ú":"U","Û":"U","Ũ":"U","Ṹ":"U","Ū":"U","Ṻ":"U","Ŭ":"U","Ü":"U","Ǜ":"U","Ǘ":"U","Ǖ":"U","Ǚ":"U","Ủ":"U","Ů":"U","Ű":"U","Ǔ":"U","Ȕ":"U","Ȗ":"U","Ư":"U","Ừ":"U","Ứ":"U","Ữ":"U","Ử":"U","Ự":"U","Ụ":"U","Ṳ":"U","Ų":"U","Ṷ":"U","Ṵ":"U","Ʉ":"U","Ⓥ":"V","V":"V","Ṽ":"V","Ṿ":"V","Ʋ":"V","Ꝟ":"V","Ʌ":"V","Ꝡ":"VY","Ⓦ":"W","W":"W","Ẁ":"W","Ẃ":"W","Ŵ":"W","Ẇ":"W","Ẅ":"W","Ẉ":"W","Ⱳ":"W","Ⓧ":"X","X":"X","Ẋ":"X","Ẍ":"X","Ⓨ":"Y","Y":"Y","Ỳ":"Y","Ý":"Y","Ŷ":"Y","Ỹ":"Y","Ȳ":"Y","Ẏ":"Y","Ÿ":"Y","Ỷ":"Y","Ỵ":"Y","Ƴ":"Y","Ɏ":"Y","Ỿ":"Y","Ⓩ":"Z","Z":"Z","Ź":"Z","Ẑ":"Z","Ż":"Z","Ž":"Z","Ẓ":"Z","Ẕ":"Z","Ƶ":"Z","Ȥ":"Z","Ɀ":"Z","Ⱬ":"Z","Ꝣ":"Z","ⓐ":"a","a":"a","ẚ":"a","à":"a","á":"a","â":"a","ầ":"a","ấ":"a","ẫ":"a","ẩ":"a","ã":"a","ā":"a","ă":"a","ằ":"a","ắ":"a","ẵ":"a","ẳ":"a","ȧ":"a","ǡ":"a","ä":"a","ǟ":"a","ả":"a","å":"a","ǻ":"a","ǎ":"a","ȁ":"a","ȃ":"a","ạ":"a","ậ":"a","ặ":"a","ḁ":"a","ą":"a","ⱥ":"a","ɐ":"a","ꜳ":"aa","æ":"ae","ǽ":"ae","ǣ":"ae","ꜵ":"ao","ꜷ":"au","ꜹ":"av","ꜻ":"av","ꜽ":"ay","ⓑ":"b","b":"b","ḃ":"b","ḅ":"b","ḇ":"b","ƀ":"b","ƃ":"b","ɓ":"b","ⓒ":"c","c":"c","ć":"c","ĉ":"c","ċ":"c","č":"c","ç":"c","ḉ":"c","ƈ":"c","ȼ":"c","ꜿ":"c","ↄ":"c","ⓓ":"d","d":"d","ḋ":"d","ď":"d","ḍ":"d","ḑ":"d","ḓ":"d","ḏ":"d","đ":"d","ƌ":"d","ɖ":"d","ɗ":"d","ꝺ":"d","dz":"dz","dž":"dz","ⓔ":"e","e":"e","è":"e","é":"e","ê":"e","ề":"e","ế":"e","ễ":"e","ể":"e","ẽ":"e","ē":"e","ḕ":"e","ḗ":"e","ĕ":"e","ė":"e","ë":"e","ẻ":"e","ě":"e","ȅ":"e","ȇ":"e","ẹ":"e","ệ":"e","ȩ":"e","ḝ":"e","ę":"e","ḙ":"e","ḛ":"e","ɇ":"e","ɛ":"e","ǝ":"e","ⓕ":"f","f":"f","ḟ":"f","ƒ":"f","ꝼ":"f","ⓖ":"g","g":"g","ǵ":"g","ĝ":"g","ḡ":"g","ğ":"g","ġ":"g","ǧ":"g","ģ":"g","ǥ":"g","ɠ":"g","ꞡ":"g","ᵹ":"g","ꝿ":"g","ⓗ":"h","h":"h","ĥ":"h","ḣ":"h","ḧ":"h","ȟ":"h","ḥ":"h","ḩ":"h","ḫ":"h","ẖ":"h","ħ":"h","ⱨ":"h","ⱶ":"h","ɥ":"h","ƕ":"hv","ⓘ":"i","i":"i","ì":"i","í":"i","î":"i","ĩ":"i","ī":"i","ĭ":"i","ï":"i","ḯ":"i","ỉ":"i","ǐ":"i","ȉ":"i","ȋ":"i","ị":"i","į":"i","ḭ":"i","ɨ":"i","ı":"i","ⓙ":"j","j":"j","ĵ":"j","ǰ":"j","ɉ":"j","ⓚ":"k","k":"k","ḱ":"k","ǩ":"k","ḳ":"k","ķ":"k","ḵ":"k","ƙ":"k","ⱪ":"k","ꝁ":"k","ꝃ":"k","ꝅ":"k","ꞣ":"k","ⓛ":"l","l":"l","ŀ":"l","ĺ":"l","ľ":"l","ḷ":"l","ḹ":"l","ļ":"l","ḽ":"l","ḻ":"l","ſ":"l","ł":"l","ƚ":"l","ɫ":"l","ⱡ":"l","ꝉ":"l","ꞁ":"l","ꝇ":"l","lj":"lj","ⓜ":"m","m":"m","ḿ":"m","ṁ":"m","ṃ":"m","ɱ":"m","ɯ":"m","ⓝ":"n","n":"n","ǹ":"n","ń":"n","ñ":"n","ṅ":"n","ň":"n","ṇ":"n","ņ":"n","ṋ":"n","ṉ":"n","ƞ":"n","ɲ":"n","ʼn":"n","ꞑ":"n","ꞥ":"n","nj":"nj","ⓞ":"o","o":"o","ò":"o","ó":"o","ô":"o","ồ":"o","ố":"o","ỗ":"o","ổ":"o","õ":"o","ṍ":"o","ȭ":"o","ṏ":"o","ō":"o","ṑ":"o","ṓ":"o","ŏ":"o","ȯ":"o","ȱ":"o","ö":"o","ȫ":"o","ỏ":"o","ő":"o","ǒ":"o","ȍ":"o","ȏ":"o","ơ":"o","ờ":"o","ớ":"o","ỡ":"o","ở":"o","ợ":"o","ọ":"o","ộ":"o","ǫ":"o","ǭ":"o","ø":"o","ǿ":"o","ɔ":"o","ꝋ":"o","ꝍ":"o","ɵ":"o","ƣ":"oi","ȣ":"ou","ꝏ":"oo","ⓟ":"p","p":"p","ṕ":"p","ṗ":"p","ƥ":"p","ᵽ":"p","ꝑ":"p","ꝓ":"p","ꝕ":"p","ⓠ":"q","q":"q","ɋ":"q","ꝗ":"q","ꝙ":"q","ⓡ":"r","r":"r","ŕ":"r","ṙ":"r","ř":"r","ȑ":"r","ȓ":"r","ṛ":"r","ṝ":"r","ŗ":"r","ṟ":"r","ɍ":"r","ɽ":"r","ꝛ":"r","ꞧ":"r","ꞃ":"r","ⓢ":"s","s":"s","ß":"s","ś":"s","ṥ":"s","ŝ":"s","ṡ":"s","š":"s","ṧ":"s","ṣ":"s","ṩ":"s","ș":"s","ş":"s","ȿ":"s","ꞩ":"s","ꞅ":"s","ẛ":"s","ⓣ":"t","t":"t","ṫ":"t","ẗ":"t","ť":"t","ṭ":"t","ț":"t","ţ":"t","ṱ":"t","ṯ":"t","ŧ":"t","ƭ":"t","ʈ":"t","ⱦ":"t","ꞇ":"t","ꜩ":"tz","ⓤ":"u","u":"u","ù":"u","ú":"u","û":"u","ũ":"u","ṹ":"u","ū":"u","ṻ":"u","ŭ":"u","ü":"u","ǜ":"u","ǘ":"u","ǖ":"u","ǚ":"u","ủ":"u","ů":"u","ű":"u","ǔ":"u","ȕ":"u","ȗ":"u","ư":"u","ừ":"u","ứ":"u","ữ":"u","ử":"u","ự":"u","ụ":"u","ṳ":"u","ų":"u","ṷ":"u","ṵ":"u","ʉ":"u","ⓥ":"v","v":"v","ṽ":"v","ṿ":"v","ʋ":"v","ꝟ":"v","ʌ":"v","ꝡ":"vy","ⓦ":"w","w":"w","ẁ":"w","ẃ":"w","ŵ":"w","ẇ":"w","ẅ":"w","ẘ":"w","ẉ":"w","ⱳ":"w","ⓧ":"x","x":"x","ẋ":"x","ẍ":"x","ⓨ":"y","y":"y","ỳ":"y","ý":"y","ŷ":"y","ỹ":"y","ȳ":"y","ẏ":"y","ÿ":"y","ỷ":"y","ẙ":"y","ỵ":"y","ƴ":"y","ɏ":"y","ỿ":"y","ⓩ":"z","z":"z","ź":"z","ẑ":"z","ż":"z","ž":"z","ẓ":"z","ẕ":"z","ƶ":"z","ȥ":"z","ɀ":"z","ⱬ":"z","ꝣ":"z","Ά":"Α","Έ":"Ε","Ή":"Η","Ί":"Ι","Ϊ":"Ι","Ό":"Ο","Ύ":"Υ","Ϋ":"Υ","Ώ":"Ω","ά":"α","έ":"ε","ή":"η","ί":"ι","ϊ":"ι","ΐ":"ι","ό":"ο","ύ":"υ","ϋ":"υ","ΰ":"υ","ω":"ω","ς":"σ"};return e}),t.define("pumselect2/data/base",["../utils"],function(e){function t(e,n){t.__super__.constructor.call(this)}return e.Extend(t,e.Observable),t.prototype.current=function(e){throw new Error("The `current` method must be defined in child classes.")},t.prototype.query=function(e,t){throw new Error("The `query` method must be defined in child classes.")},t.prototype.bind=function(e,t){},t.prototype.destroy=function(){},t.prototype.generateResultId=function(t,n){var i=t.id+"-result-";return i+=e.generateChars(4),i+=null!=n.id?"-"+n.id.toString():"-"+e.generateChars(4)},t}),t.define("pumselect2/data/select",["./base","../utils","jquery"],function(e,t,n){
2
  function i(e,t){this.$element=e,this.options=t,i.__super__.constructor.call(this)}return t.Extend(i,e),i.prototype.current=function(e){var t=[],i=this;this.$element.find(":selected").each(function(){var e=n(this),o=i.item(e);t.push(o)}),e(t)},i.prototype.select=function(e){var t=this;if(e.selected=!0,n(e.element).is("option"))return e.element.selected=!0,void this.$element.trigger("change");if(this.$element.prop("multiple"))this.current(function(i){var o=[];e=[e],e.push.apply(e,i);for(var s=0;s<e.length;s++){var r=e[s].id;n.inArray(r,o)===-1&&o.push(r)}t.$element.val(o),t.$element.trigger("change")});else{var i=e.id;this.$element.val(i),this.$element.trigger("change")}},i.prototype.unselect=function(e){var t=this;if(this.$element.prop("multiple"))return e.selected=!1,n(e.element).is("option")?(e.element.selected=!1,void this.$element.trigger("change")):void this.current(function(i){for(var o=[],s=0;s<i.length;s++){var r=i[s].id;r!==e.id&&n.inArray(r,o)===-1&&o.push(r)}t.$element.val(o),t.$element.trigger("change")})},i.prototype.bind=function(e,t){var n=this;this.container=e,e.on("select",function(e){n.select(e.data)}),e.on("unselect",function(e){n.unselect(e.data)})},i.prototype.destroy=function(){this.$element.find("*").each(function(){n.removeData(this,"data")})},i.prototype.query=function(e,t){var i=[],o=this,s=this.$element.children();s.each(function(){var t=n(this);if(t.is("option")||t.is("optgroup")){var s=o.item(t),r=o.matches(e,s);null!==r&&i.push(r)}}),t({results:i})},i.prototype.addOptions=function(e){t.appendMany(this.$element,e)},i.prototype.option=function(e){var t;e.children?(t=document.createElement("optgroup"),t.label=e.text):(t=document.createElement("option"),void 0!==t.textContent?t.textContent=e.text:t.innerText=e.text),e.id&&(t.value=e.id),e.disabled&&(t.disabled=!0),e.selected&&(t.selected=!0),e.title&&(t.title=e.title);var i=n(t),o=this._normalizeItem(e);return o.element=t,n.data(t,"data",o),i},i.prototype.item=function(e){var t={};if(t=n.data(e[0],"data"),null!=t)return t;if(e.is("option"))t={id:e.val(),text:e.text(),disabled:e.prop("disabled"),selected:e.prop("selected"),title:e.prop("title")};else if(e.is("optgroup")){t={text:e.prop("label"),children:[],title:e.prop("title")};for(var i=e.children("option"),o=[],s=0;s<i.length;s++){var r=n(i[s]),a=this.item(r);o.push(a)}t.children=o}return t=this._normalizeItem(t),t.element=e[0],n.data(e[0],"data",t),t},i.prototype._normalizeItem=function(e){n.isPlainObject(e)||(e={id:e,text:e}),e=n.extend({},{text:""},e);var t={selected:!1,disabled:!1};return null!=e.id&&(e.id=e.id.toString()),null!=e.text&&(e.text=e.text.toString()),null==e._resultId&&e.id&&null!=this.container&&(e._resultId=this.generateResultId(this.container,e)),n.extend({},t,e)},i.prototype.matches=function(e,t){var n=this.options.get("matcher");return n(e,t)},i}),t.define("pumselect2/data/array",["./select","../utils","jquery"],function(e,t,n){function i(e,t){var n=t.get("data")||[];i.__super__.constructor.call(this,e,t),this.addOptions(this.convertToOptions(n))}return t.Extend(i,e),i.prototype.select=function(e){var t=this.$element.find("option").filter(function(t,n){return n.value==e.id.toString()});0===t.length&&(t=this.option(e),this.addOptions(t)),i.__super__.select.call(this,e)},i.prototype.convertToOptions=function(e){function i(e){return function(){return n(this).val()==e.id}}for(var o=this,s=this.$element.find("option"),r=s.map(function(){return o.item(n(this)).id}).get(),a=[],l=0;l<e.length;l++){var c=this._normalizeItem(e[l]);if(n.inArray(c.id,r)>=0){var p=s.filter(i(c)),u=this.item(p),d=n.extend(!0,{},c,u),h=this.option(d);p.replaceWith(h)}else{var f=this.option(c);if(c.children){var m=this.convertToOptions(c.children);t.appendMany(f,m)}a.push(f)}}return a},i}),t.define("pumselect2/data/ajax",["./array","../utils","jquery"],function(e,t,n){function i(e,t){this.ajaxOptions=this._applyDefaults(t.get("ajax")),null!=this.ajaxOptions.processResults&&(this.processResults=this.ajaxOptions.processResults),i.__super__.constructor.call(this,e,t)}return t.Extend(i,e),i.prototype._applyDefaults=function(e){var t={data:function(e){return n.extend({},e,{q:e.term})},transport:function(e,t,i){var o=n.ajax(e);return o.then(t),o.fail(i),o}};return n.extend({},t,e,!0)},i.prototype.processResults=function(e){return e},i.prototype.query=function(e,t){function i(){var i=s.transport(s,function(i){var s=o.processResults(i,e);o.options.get("debug")&&window.console&&console.error&&(s&&s.results&&n.isArray(s.results)||console.error("Select2: The AJAX results did not return an array in the `results` key of the response.")),t(s)},function(){o.trigger("results:message",{message:"errorLoading"})});o._request=i}var o=this;null!=this._request&&(n.isFunction(this._request.abort)&&this._request.abort(),this._request=null);var s=n.extend({type:"GET"},this.ajaxOptions);"function"==typeof s.url&&(s.url=s.url.call(this.$element,e)),"function"==typeof s.data&&(s.data=s.data.call(this.$element,e)),this.ajaxOptions.delay&&""!==e.term?(this._queryTimeout&&window.clearTimeout(this._queryTimeout),this._queryTimeout=window.setTimeout(i,this.ajaxOptions.delay)):i()},i}),t.define("pumselect2/data/tags",["jquery"],function(e){function t(t,n,i){var o=i.get("tags"),s=i.get("createTag");void 0!==s&&(this.createTag=s);var r=i.get("insertTag");if(void 0!==r&&(this.insertTag=r),t.call(this,n,i),e.isArray(o))for(var a=0;a<o.length;a++){var l=o[a],c=this._normalizeItem(l),p=this.option(c);this.$element.append(p)}}return t.prototype.query=function(e,t,n){function i(e,s){for(var r=e.results,a=0;a<r.length;a++){var l=r[a],c=null!=l.children&&!i({results:l.children},!0),p=l.text===t.term;if(p||c)return!s&&(e.data=r,void n(e))}if(s)return!0;var u=o.createTag(t);if(null!=u){var d=o.option(u);d.attr("data-pumselect2-tag",!0),o.addOptions([d]),o.insertTag(r,u)}e.results=r,n(e)}var o=this;return this._removeOldTags(),null==t.term||null!=t.page?void e.call(this,t,n):void e.call(this,t,i)},t.prototype.createTag=function(t,n){var i=e.trim(n.term);return""===i?null:{id:i,text:i}},t.prototype.insertTag=function(e,t,n){t.unshift(n)},t.prototype._removeOldTags=function(t){var n=(this._lastTag,this.$element.find("option[data-pumselect2-tag]"));n.each(function(){this.selected||e(this).remove()})},t}),t.define("pumselect2/data/tokenizer",["jquery"],function(e){function t(e,t,n){var i=n.get("tokenizer");void 0!==i&&(this.tokenizer=i),e.call(this,t,n)}return t.prototype.bind=function(e,t,n){e.call(this,t,n),this.$search=t.dropdown.$search||t.selection.$search||n.find(".pumselect2-search__field")},t.prototype.query=function(e,t,n){function i(e){o.trigger("select",{data:e})}var o=this;t.term=t.term||"";var s=this.tokenizer(t,this.options,i);s.term!==t.term&&(this.$search.length&&(this.$search.val(s.term),this.$search.focus()),t.term=s.term),e.call(this,t,n)},t.prototype.tokenizer=function(t,n,i,o){for(var s=i.get("tokenSeparators")||[],r=n.term,a=0,l=this.createTag||function(e){return{id:e.term,text:e.term}};a<r.length;){var c=r[a];if(e.inArray(c,s)!==-1){var p=r.substr(0,a),u=e.extend({},n,{term:p}),d=l(u);null!=d?(o(d),r=r.substr(a+1)||"",a=0):a++}else a++}return{term:r}},t}),t.define("pumselect2/data/minimumInputLength",[],function(){function e(e,t,n){this.minimumInputLength=n.get("minimumInputLength"),e.call(this,t,n)}return e.prototype.query=function(e,t,n){return t.term=t.term||"",t.term.length<this.minimumInputLength?void this.trigger("results:message",{message:"inputTooShort",args:{minimum:this.minimumInputLength,input:t.term,params:t}}):void e.call(this,t,n)},e}),t.define("pumselect2/data/maximumInputLength",[],function(){function e(e,t,n){this.maximumInputLength=n.get("maximumInputLength"),e.call(this,t,n)}return e.prototype.query=function(e,t,n){return t.term=t.term||"",this.maximumInputLength>0&&t.term.length>this.maximumInputLength?void this.trigger("results:message",{message:"inputTooLong",args:{maximum:this.maximumInputLength,input:t.term,params:t}}):void e.call(this,t,n)},e}),t.define("pumselect2/data/maximumSelectionLength",[],function(){function e(e,t,n){this.maximumSelectionLength=n.get("maximumSelectionLength"),e.call(this,t,n)}return e.prototype.query=function(e,t,n){var i=this;this.current(function(o){var s=null!=o?o.length:0;return i.maximumSelectionLength>0&&s>=i.maximumSelectionLength?void i.trigger("results:message",{message:"maximumSelected",args:{maximum:i.maximumSelectionLength}}):void e.call(i,t,n)})},e}),t.define("pumselect2/dropdown",["jquery","./utils"],function(e,t){function n(e,t){this.$element=e,this.options=t,n.__super__.constructor.call(this)}return t.Extend(n,t.Observable),n.prototype.render=function(){var t=e('<span class="pumselect2-dropdown"><span class="pumselect2-results"></span></span>');return t.attr("dir",this.options.get("dir")),this.$dropdown=t,t},n.prototype.bind=function(){},n.prototype.position=function(e,t){},n.prototype.destroy=function(){this.$dropdown.remove()},n}),t.define("pumselect2/dropdown/search",["jquery","../utils"],function(e,t){function n(){}return n.prototype.render=function(t){var n=t.call(this),i=e('<span class="pumselect2-search pumselect2-search--dropdown"><input class="pumselect2-search__field" type="search" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" role="textbox" /></span>');return this.$searchContainer=i,this.$search=i.find("input"),n.prepend(i),n},n.prototype.bind=function(t,n,i){var o=this;t.call(this,n,i),this.$search.on("keydown",function(e){o.trigger("keypress",e),o._keyUpPrevented=e.isDefaultPrevented()}),this.$search.on("input",function(t){e(this).off("keyup")}),this.$search.on("keyup input",function(e){o.handleSearch(e)}),n.on("open",function(){o.$search.attr("tabindex",0),o.$search.focus(),window.setTimeout(function(){o.$search.focus()},0)}),n.on("close",function(){o.$search.attr("tabindex",-1),o.$search.val("")}),n.on("results:all",function(e){if(null==e.query.term||""===e.query.term){var t=o.showSearch(e);t?o.$searchContainer.removeClass("pumselect2-search--hide"):o.$searchContainer.addClass("pumselect2-search--hide")}})},n.prototype.handleSearch=function(e){if(!this._keyUpPrevented){var t=this.$search.val();this.trigger("query",{term:t})}this._keyUpPrevented=!1},n.prototype.showSearch=function(e,t){return!0},n}),t.define("pumselect2/dropdown/hidePlaceholder",[],function(){function e(e,t,n,i){this.placeholder=this.normalizePlaceholder(n.get("placeholder")),e.call(this,t,n,i)}return e.prototype.append=function(e,t){t.results=this.removePlaceholder(t.results),e.call(this,t)},e.prototype.normalizePlaceholder=function(e,t){return"string"==typeof t&&(t={id:"",text:t}),t},e.prototype.removePlaceholder=function(e,t){for(var n=t.slice(0),i=t.length-1;i>=0;i--){var o=t[i];this.placeholder.id===o.id&&n.splice(i,1)}return n},e}),t.define("pumselect2/dropdown/infiniteScroll",["jquery"],function(e){function t(e,t,n,i){this.lastParams={},e.call(this,t,n,i),this.$loadingMore=this.createLoadingMore(),this.loading=!1}return t.prototype.append=function(e,t){this.$loadingMore.remove(),this.loading=!1,e.call(this,t),this.showLoadingMore(t)&&this.$results.append(this.$loadingMore)},t.prototype.bind=function(t,n,i){var o=this;t.call(this,n,i),n.on("query",function(e){o.lastParams=e,o.loading=!0}),n.on("query:append",function(e){o.lastParams=e,o.loading=!0}),this.$results.on("scroll",function(){var t=e.contains(document.documentElement,o.$loadingMore[0]);if(!o.loading&&t){var n=o.$results.offset().top+o.$results.outerHeight(!1),i=o.$loadingMore.offset().top+o.$loadingMore.outerHeight(!1);n+50>=i&&o.loadMore()}})},t.prototype.loadMore=function(){this.loading=!0;var t=e.extend({},{page:1},this.lastParams);t.page++,this.trigger("query:append",t)},t.prototype.showLoadingMore=function(e,t){return t.pagination&&t.pagination.more},t.prototype.createLoadingMore=function(){var t=e('<li class="pumselect2-results__option pumselect2-results__option--load-more"role="treeitem" aria-disabled="true"></li>'),n=this.options.get("translations").get("loadingMore");return t.html(n(this.lastParams)),t},t}),t.define("pumselect2/dropdown/attachBody",["jquery","../utils"],function(e,t){function n(t,n,i){this.$dropdownParent=i.get("dropdownParent")||e(document.body),t.call(this,n,i)}return n.prototype.bind=function(e,t,n){var i=this,o=!1;e.call(this,t,n),t.on("open",function(){i._showDropdown(),i._attachPositioningHandler(t),o||(o=!0,t.on("results:all",function(){i._positionDropdown(),i._resizeDropdown()}),t.on("results:append",function(){i._positionDropdown(),i._resizeDropdown()}))}),t.on("close",function(){i._hideDropdown(),i._detachPositioningHandler(t)}),this.$dropdownContainer.on("mousedown",function(e){e.stopPropagation()})},n.prototype.destroy=function(e){e.call(this),this.$dropdownContainer.remove()},n.prototype.position=function(e,t,n){t.attr("class",n.attr("class")),t.removeClass("pumselect2"),t.addClass("pumselect2-container--open"),t.css({position:"absolute",top:-999999}),this.$container=n},n.prototype.render=function(t){var n=e("<span></span>"),i=t.call(this);return n.append(i),this.$dropdownContainer=n,n},n.prototype._hideDropdown=function(e){this.$dropdownContainer.detach()},n.prototype._attachPositioningHandler=function(n,i){var o=this,s="scroll.pumselect2."+i.id,r="resize.pumselect2."+i.id,a="orientationchange.pumselect2."+i.id,l=this.$container.parents().filter(t.hasScroll);l.each(function(){e(this).data("pumselect2-scroll-position",{x:e(this).scrollLeft(),y:e(this).scrollTop()})}),l.on(s,function(t){var n=e(this).data("pumselect2-scroll-position");e(this).scrollTop(n.y)}),e(window).on(s+" "+r+" "+a,function(e){o._positionDropdown(),o._resizeDropdown()})},n.prototype._detachPositioningHandler=function(n,i){var o="scroll.pumselect2."+i.id,s="resize.pumselect2."+i.id,r="orientationchange.pumselect2."+i.id,a=this.$container.parents().filter(t.hasScroll);a.off(o),e(window).off(o+" "+s+" "+r)},n.prototype._positionDropdown=function(){var t=e(window),n=this.$dropdown.hasClass("pumselect2-dropdown--above"),i=this.$dropdown.hasClass("pumselect2-dropdown--below"),o=null,s=this.$container.offset();s.bottom=s.top+this.$container.outerHeight(!1);var r={height:this.$container.outerHeight(!1)};r.top=s.top,r.bottom=s.top+r.height;var a={height:this.$dropdown.outerHeight(!1)},l={top:t.scrollTop(),bottom:t.scrollTop()+t.height()},c=l.top<s.top-a.height,p=l.bottom>s.bottom+a.height,u={left:s.left,top:r.bottom},d=this.$dropdownParent;"static"===d.css("position")&&(d=d.offsetParent());var h=d.offset();u.top-=h.top,u.left-=h.left,n||i||(o="below"),p||!c||n?!c&&p&&n&&(o="below"):o="above",("above"==o||n&&"below"!==o)&&(u.top=r.top-a.height),null!=o&&(this.$dropdown.removeClass("pumselect2-dropdown--below pumselect2-dropdown--above").addClass("pumselect2-dropdown--"+o),this.$container.removeClass("pumselect2-container--below pumselect2-container--above").addClass("pumselect2-container--"+o)),this.$dropdownContainer.css(u)},n.prototype._resizeDropdown=function(){var e={width:this.$container.outerWidth(!1)+"px"};this.options.get("dropdownAutoWidth")&&(e.minWidth=e.width,e.width="auto"),this.$dropdown.css(e)},n.prototype._showDropdown=function(e){this.$dropdownContainer.appendTo(this.$dropdownParent),this._positionDropdown(),this._resizeDropdown()},n}),t.define("pumselect2/dropdown/minimumResultsForSearch",[],function(){function e(t){for(var n=0,i=0;i<t.length;i++){var o=t[i];o.children?n+=e(o.children):n++}return n}function t(e,t,n,i){this.minimumResultsForSearch=n.get("minimumResultsForSearch"),this.minimumResultsForSearch<0&&(this.minimumResultsForSearch=1/0),e.call(this,t,n,i)}return t.prototype.showSearch=function(t,n){return!(e(n.data.results)<this.minimumResultsForSearch)&&t.call(this,n)},t}),t.define("pumselect2/dropdown/selectOnClose",[],function(){function e(){}return e.prototype.bind=function(e,t,n){var i=this;e.call(this,t,n),t.on("close",function(){i._handleSelectOnClose()})},e.prototype._handleSelectOnClose=function(){var e=this.getHighlightedResults();if(!(e.length<1)){var t=e.data("data");null!=t.element&&t.element.selected||null==t.element&&t.selected||this.trigger("select",{data:t})}},e}),t.define("pumselect2/dropdown/closeOnSelect",[],function(){function e(){}return e.prototype.bind=function(e,t,n){var i=this;e.call(this,t,n),t.on("select",function(e){i._selectTriggered(e)}),t.on("unselect",function(e){i._selectTriggered(e)})},e.prototype._selectTriggered=function(e,t){var n=t.originalEvent;n&&n.ctrlKey||this.trigger("close",{})},e}),t.define("pumselect2/i18n/en",[],function(){return{errorLoading:function(){return"The results could not be loaded."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Please delete "+t+" character";return 1!=t&&(n+="s"),n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Please enter "+t+" or more characters";return n},loadingMore:function(){return"Loading more results…"},maximumSelected:function(e){var t="You can only select "+e.maximum+" item";return 1!=e.maximum&&(t+="s"),t},noResults:function(){return"No results found"},searching:function(){return"Searching…"}}}),t.define("pumselect2/defaults",["jquery","require","./results","./selection/single","./selection/multiple","./selection/placeholder","./selection/allowClear","./selection/search","./selection/eventRelay","./utils","./translation","./diacritics","./data/select","./data/array","./data/ajax","./data/tags","./data/tokenizer","./data/minimumInputLength","./data/maximumInputLength","./data/maximumSelectionLength","./dropdown","./dropdown/search","./dropdown/hidePlaceholder","./dropdown/infiniteScroll","./dropdown/attachBody","./dropdown/minimumResultsForSearch","./dropdown/selectOnClose","./dropdown/closeOnSelect","./i18n/en"],function(e,t,n,i,o,s,r,a,l,c,p,u,d,h,f,m,g,_,v,y,b,w,k,x,$,C,P,M,A){function S(){this.reset()}S.prototype.apply=function(u){if(u=e.extend(!0,{},this.defaults,u),null==u.dataAdapter){if(null!=u.ajax?u.dataAdapter=f:null!=u.data?u.dataAdapter=h:u.dataAdapter=d,u.minimumInputLength>0&&(u.dataAdapter=c.Decorate(u.dataAdapter,_)),u.maximumInputLength>0&&(u.dataAdapter=c.Decorate(u.dataAdapter,v)),u.maximumSelectionLength>0&&(u.dataAdapter=c.Decorate(u.dataAdapter,y)),u.tags&&(u.dataAdapter=c.Decorate(u.dataAdapter,m)),null==u.tokenSeparators&&null==u.tokenizer||(u.dataAdapter=c.Decorate(u.dataAdapter,g)),null!=u.query){var A=t(u.amdBase+"compat/query");u.dataAdapter=c.Decorate(u.dataAdapter,A)}if(null!=u.initSelection){var S=t(u.amdBase+"compat/initSelection");u.dataAdapter=c.Decorate(u.dataAdapter,S)}}if(null==u.resultsAdapter&&(u.resultsAdapter=n,null!=u.ajax&&(u.resultsAdapter=c.Decorate(u.resultsAdapter,x)),null!=u.placeholder&&(u.resultsAdapter=c.Decorate(u.resultsAdapter,k)),u.selectOnClose&&(u.resultsAdapter=c.Decorate(u.resultsAdapter,P))),null==u.dropdownAdapter){if(u.multiple)u.dropdownAdapter=b;else{var U=c.Decorate(b,w);u.dropdownAdapter=U}if(0!==u.minimumResultsForSearch&&(u.dropdownAdapter=c.Decorate(u.dropdownAdapter,C)),u.closeOnSelect&&(u.dropdownAdapter=c.Decorate(u.dropdownAdapter,M)),null!=u.dropdownCssClass||null!=u.dropdownCss||null!=u.adaptDropdownCssClass){var T=t(u.amdBase+"compat/dropdownCss");u.dropdownAdapter=c.Decorate(u.dropdownAdapter,T)}u.dropdownAdapter=c.Decorate(u.dropdownAdapter,$)}if(null==u.selectionAdapter){if(u.multiple?u.selectionAdapter=o:u.selectionAdapter=i,null!=u.placeholder&&(u.selectionAdapter=c.Decorate(u.selectionAdapter,s)),u.allowClear&&(u.selectionAdapter=c.Decorate(u.selectionAdapter,r)),u.multiple&&(u.selectionAdapter=c.Decorate(u.selectionAdapter,a)),null!=u.containerCssClass||null!=u.containerCss||null!=u.adaptContainerCssClass){var D=t(u.amdBase+"compat/containerCss");u.selectionAdapter=c.Decorate(u.selectionAdapter,D)}u.selectionAdapter=c.Decorate(u.selectionAdapter,l)}if("string"==typeof u.language)if(u.language.indexOf("-")>0){var j=u.language.split("-"),O=j[0];u.language=[u.language,O]}else u.language=[u.language];if(e.isArray(u.language)){var E=new p;u.language.push("en");for(var q=u.language,I=0;I<q.length;I++){var z=q[I],L={};try{L=p.loadPath(z)}catch(R){try{z=this.defaults.amdLanguageBase+z,L=p.loadPath(z)}catch(H){u.debug&&window.console&&console.warn&&console.warn('Select2: The language file for "'+z+'" could not be automatically loaded. A fallback will be used instead.');continue}}E.extend(L)}u.translations=E}else{var F=p.loadPath(this.defaults.amdLanguageBase+"en"),N=new p(u.language);N.extend(F),u.translations=N}return u},S.prototype.reset=function(){function t(e){function t(e){return u[e]||e}return e.replace(/[^\u0000-\u007E]/g,t)}function n(i,o){if(""===e.trim(i.term))return o;if(o.children&&o.children.length>0){for(var s=e.extend(!0,{},o),r=o.children.length-1;r>=0;r--){var a=o.children[r],l=n(i,a);null==l&&s.children.splice(r,1)}return s.children.length>0?s:n(i,s)}var c=t(o.text).toUpperCase(),p=t(i.term).toUpperCase();return c.indexOf(p)>-1?o:null}this.defaults={amdBase:"./",amdLanguageBase:"./i18n/",closeOnSelect:!0,debug:!1,dropdownAutoWidth:!1,escapeMarkup:c.escapeMarkup,language:A,matcher:n,minimumInputLength:0,maximumInputLength:0,maximumSelectionLength:0,minimumResultsForSearch:0,selectOnClose:!1,sorter:function(e){return e},templateResult:function(e){return e.text},templateSelection:function(e){return e.text},theme:"default",width:"resolve"}},S.prototype.set=function(t,n){var i=e.camelCase(t),o={};o[i]=n;var s=c._convertData(o);e.extend(this.defaults,s)};var U=new S;return U}),t.define("pumselect2/options",["require","jquery","./defaults","./utils"],function(e,t,n,i){function o(t,o){if(this.options=t,null!=o&&this.fromElement(o),this.options=n.apply(this.options),o&&o.is("input")){var s=e(this.get("amdBase")+"compat/inputData");this.options.dataAdapter=i.Decorate(this.options.dataAdapter,s)}}return o.prototype.fromElement=function(e){var n=["pumselect2"];null==this.options.multiple&&(this.options.multiple=e.prop("multiple")),null==this.options.disabled&&(this.options.disabled=e.prop("disabled")),null==this.options.language&&(e.prop("lang")?this.options.language=e.prop("lang").toLowerCase():e.closest("[lang]").prop("lang")&&(this.options.language=e.closest("[lang]").prop("lang"))),null==this.options.dir&&(e.prop("dir")?this.options.dir=e.prop("dir"):e.closest("[dir]").prop("dir")?this.options.dir=e.closest("[dir]").prop("dir"):this.options.dir="ltr"),e.prop("disabled",this.options.disabled),e.prop("multiple",this.options.multiple),e.data("pumselect2Tags")&&(this.options.debug&&window.console&&console.warn&&console.warn('Select2: The `data-pumselect2-tags` attribute has been changed to use the `data-data` and `data-tags="true"` attributes and will be removed in future versions of Select2.'),e.data("data",e.data("pumselect2Tags")),e.data("tags",!0)),e.data("ajaxUrl")&&(this.options.debug&&window.console&&console.warn&&console.warn("Select2: The `data-ajax-url` attribute has been changed to `data-ajax--url` and support for the old attribute will be removed in future versions of Select2."),e.attr("ajax--url",e.data("ajaxUrl")),e.data("ajax--url",e.data("ajaxUrl")));var o={};o=t.fn.jquery&&"1."==t.fn.jquery.substr(0,2)&&e[0].dataset?t.extend(!0,{},e[0].dataset,e.data()):e.data();var s=t.extend(!0,{},o);s=i._convertData(s);for(var r in s)t.inArray(r,n)>-1||(t.isPlainObject(this.options[r])?t.extend(this.options[r],s[r]):this.options[r]=s[r]);return this},o.prototype.get=function(e){return this.options[e]},o.prototype.set=function(e,t){this.options[e]=t},o}),t.define("pumselect2/core",["jquery","./options","./utils","./keys"],function(e,t,n,i){var o=function(e,n){null!=e.data("pumselect2")&&e.data("pumselect2").destroy(),this.$element=e,this.id=this._generateId(e),n=n||{},this.options=new t(n,e),o.__super__.constructor.call(this);var i=e.attr("tabindex")||0;e.data("old-tabindex",i),e.attr("tabindex","-1");var s=this.options.get("dataAdapter");this.dataAdapter=new s(e,this.options);var r=this.render();this._placeContainer(r);var a=this.options.get("selectionAdapter");this.selection=new a(e,this.options),this.$selection=this.selection.render(),this.selection.position(this.$selection,r);var l=this.options.get("dropdownAdapter");this.dropdown=new l(e,this.options),this.$dropdown=this.dropdown.render(),this.dropdown.position(this.$dropdown,r);var c=this.options.get("resultsAdapter");this.results=new c(e,this.options,this.dataAdapter),this.$results=this.results.render(),this.results.position(this.$results,this.$dropdown);var p=this;this._bindAdapters(),this._registerDomEvents(),this._registerDataEvents(),this._registerSelectionEvents(),this._registerDropdownEvents(),this._registerResultsEvents(),this._registerEvents(),this.dataAdapter.current(function(e){p.trigger("selection:update",{data:e})}),e.addClass("pumselect2-hidden-accessible"),e.attr("aria-hidden","true"),this._syncAttributes(),e.data("pumselect2",this)};return n.Extend(o,n.Observable),o.prototype._generateId=function(e){var t="";return t=null!=e.attr("id")?e.attr("id"):null!=e.attr("name")?e.attr("name")+"-"+n.generateChars(2):n.generateChars(4),t=t.replace(/(:|\.|\[|\]|,)/g,""),t="pumselect2-"+t},o.prototype._placeContainer=function(e){e.insertAfter(this.$element);var t=this._resolveWidth(this.$element,this.options.get("width"));null!=t&&e.css("width",t)},o.prototype._resolveWidth=function(e,t){var n=/^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i;if("resolve"==t){var i=this._resolveWidth(e,"style");return null!=i?i:this._resolveWidth(e,"element")}if("element"==t){var o=e.outerWidth(!1);return o<=0?"auto":o+"px"}if("style"==t){var s=e.attr("style");if("string"!=typeof s)return null;for(var r=s.split(";"),a=0,l=r.length;a<l;a+=1){var c=r[a].replace(/\s/g,""),p=c.match(n);if(null!==p&&p.length>=1)return p[1]}return null}return t},o.prototype._bindAdapters=function(){this.dataAdapter.bind(this,this.$container),this.selection.bind(this,this.$container),this.dropdown.bind(this,this.$container),this.results.bind(this,this.$container)},o.prototype._registerDomEvents=function(){var t=this;this.$element.on("change.pumselect2",function(){t.dataAdapter.current(function(e){t.trigger("selection:update",{data:e})})}),this._sync=n.bind(this._syncAttributes,this),this.$element[0].attachEvent&&this.$element[0].attachEvent("onpropertychange",this._sync);var i=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;null!=i?(this._observer=new i(function(n){e.each(n,t._sync)}),this._observer.observe(this.$element[0],{attributes:!0,subtree:!1})):this.$element[0].addEventListener&&this.$element[0].addEventListener("DOMAttrModified",t._sync,!1)},o.prototype._registerDataEvents=function(){var e=this;this.dataAdapter.on("*",function(t,n){e.trigger(t,n)})},o.prototype._registerSelectionEvents=function(){var t=this,n=["toggle","focus"];this.selection.on("toggle",function(){t.toggleDropdown()}),this.selection.on("focus",function(e){t.focus(e)}),this.selection.on("*",function(i,o){e.inArray(i,n)===-1&&t.trigger(i,o)})},o.prototype._registerDropdownEvents=function(){var e=this;this.dropdown.on("*",function(t,n){e.trigger(t,n)})},o.prototype._registerResultsEvents=function(){var e=this;this.results.on("*",function(t,n){e.trigger(t,n)})},o.prototype._registerEvents=function(){var e=this;this.on("open",function(){e.$container.addClass("pumselect2-container--open")}),this.on("close",function(){e.$container.removeClass("pumselect2-container--open")}),this.on("enable",function(){e.$container.removeClass("pumselect2-container--disabled")}),this.on("disable",function(){e.$container.addClass("pumselect2-container--disabled")}),this.on("blur",function(){e.$container.removeClass("pumselect2-container--focus")}),this.on("query",function(t){e.isOpen()||e.trigger("open",{}),this.dataAdapter.query(t,function(n){e.trigger("results:all",{data:n,query:t})})}),this.on("query:append",function(t){this.dataAdapter.query(t,function(n){e.trigger("results:append",{data:n,query:t})})}),this.on("keypress",function(t){var n=t.which;e.isOpen()?n===i.ESC||n===i.TAB||n===i.UP&&t.altKey?(e.close(),t.preventDefault()):n===i.ENTER?(e.trigger("results:select",{}),t.preventDefault()):n===i.SPACE&&t.ctrlKey?(e.trigger("results:toggle",{}),t.preventDefault()):n===i.UP?(e.trigger("results:previous",{}),t.preventDefault()):n===i.DOWN&&(e.trigger("results:next",{}),t.preventDefault()):(n===i.ENTER||n===i.SPACE||n===i.DOWN&&t.altKey)&&(e.open(),t.preventDefault())})},o.prototype._syncAttributes=function(){this.options.set("disabled",this.$element.prop("disabled")),this.options.get("disabled")?(this.isOpen()&&this.close(),this.trigger("disable",{})):this.trigger("enable",{})},o.prototype.trigger=function(e,t){var n=o.__super__.trigger,i={open:"opening",close:"closing",select:"selecting",unselect:"unselecting"};if(void 0===t&&(t={}),e in i){var s=i[e],r={prevented:!1,name:e,args:t};if(n.call(this,s,r),r.prevented)return void(t.prevented=!0)}n.call(this,e,t)},o.prototype.toggleDropdown=function(){this.options.get("disabled")||(this.isOpen()?this.close():this.open())},o.prototype.open=function(){this.isOpen()||this.trigger("query",{})},o.prototype.close=function(){this.isOpen()&&this.trigger("close",{})},o.prototype.isOpen=function(){return this.$container.hasClass("pumselect2-container--open")},o.prototype.hasFocus=function(){return this.$container.hasClass("pumselect2-container--focus")},o.prototype.focus=function(e){this.hasFocus()||(this.$container.addClass("pumselect2-container--focus"),this.trigger("focus",{}))},o.prototype.enable=function(e){this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `pumselect2("enable")` method has been deprecated and will be removed in later Select2 versions. Use $element.prop("disabled") instead.'),null!=e&&0!==e.length||(e=[!0]);var t=!e[0];this.$element.prop("disabled",t)},o.prototype.data=function(){this.options.get("debug")&&arguments.length>0&&window.console&&console.warn&&console.warn('Select2: Data can no longer be set using `pumselect2("data")`. You should consider setting the value instead using `$element.val()`.');var e=[];return this.dataAdapter.current(function(t){e=t}),e},o.prototype.val=function(t){if(this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `pumselect2("val")` method has been deprecated and will be removed in later Select2 versions. Use $element.val() instead.'),null==t||0===t.length)return this.$element.val();var n=t[0];e.isArray(n)&&(n=e.map(n,function(e){return e.toString()})),this.$element.val(n).trigger("change")},o.prototype.destroy=function(){this.$container.remove(),this.$element[0].detachEvent&&this.$element[0].detachEvent("onpropertychange",this._sync),null!=this._observer?(this._observer.disconnect(),this._observer=null):this.$element[0].removeEventListener&&this.$element[0].removeEventListener("DOMAttrModified",this._sync,!1),this._sync=null,this.$element.off(".pumselect2"),this.$element.attr("tabindex",this.$element.data("old-tabindex")),this.$element.removeClass("pumselect2-hidden-accessible"),this.$element.attr("aria-hidden","false"),this.$element.removeData("pumselect2"),this.dataAdapter.destroy(),this.selection.destroy(),this.dropdown.destroy(),this.results.destroy(),this.dataAdapter=null,this.selection=null,this.dropdown=null,this.results=null},o.prototype.render=function(){var t=e('<span class="pumselect2 pumselect2-container"><span class="selection"></span><span class="dropdown-wrapper" aria-hidden="true"></span></span>');return t.attr("dir",this.options.get("dir")),this.$container=t,this.$container.addClass("pumselect2-container--"+this.options.get("theme")),t.data("element",this.$element),t},o}),t.define("pumselect2/compat/utils",["jquery"],function(e){function t(t,n,i){var o,s,r=[];o=e.trim(t.attr("class")),o&&(o=""+o,e(o.split(/\s+/)).each(function(){0===this.indexOf("pumselect2-")&&r.push(this)})),o=e.trim(n.attr("class")),o&&(o=""+o,e(o.split(/\s+/)).each(function(){0!==this.indexOf("pumselect2-")&&(s=i(this),null!=s&&r.push(s))})),t.attr("class",r.join(" "));
3
- }return{syncCssClasses:t}}),t.define("pumselect2/compat/containerCss",["jquery","./utils"],function(e,t){function n(e){return null}function i(){}return i.prototype.render=function(i){var o=i.call(this),s=this.options.get("containerCssClass")||"";e.isFunction(s)&&(s=s(this.$element));var r=this.options.get("adaptContainerCssClass");if(r=r||n,s.indexOf(":all:")!==-1){s=s.replace(":all:","");var a=r;r=function(e){var t=a(e);return null!=t?t+" "+e:e}}var l=this.options.get("containerCss")||{};return e.isFunction(l)&&(l=l(this.$element)),t.syncCssClasses(o,this.$element,r),o.css(l),o.addClass(s),o},i}),t.define("pumselect2/compat/dropdownCss",["jquery","./utils"],function(e,t){function n(e){return null}function i(){}return i.prototype.render=function(i){var o=i.call(this),s=this.options.get("dropdownCssClass")||"";e.isFunction(s)&&(s=s(this.$element));var r=this.options.get("adaptDropdownCssClass");if(r=r||n,s.indexOf(":all:")!==-1){s=s.replace(":all:","");var a=r;r=function(e){var t=a(e);return null!=t?t+" "+e:e}}var l=this.options.get("dropdownCss")||{};return e.isFunction(l)&&(l=l(this.$element)),t.syncCssClasses(o,this.$element,r),o.css(l),o.addClass(s),o},i}),t.define("pumselect2/compat/initSelection",["jquery"],function(e){function t(e,t,n){n.get("debug")&&window.console&&console.warn&&console.warn("Select2: The `initSelection` option has been deprecated in favor of a custom data adapter that overrides the `current` method. This method is now called multiple times instead of a single time when the instance is initialized. Support will be removed for the `initSelection` option in future versions of Select2"),this.initSelection=n.get("initSelection"),this._isInitialized=!1,e.call(this,t,n)}return t.prototype.current=function(t,n){var i=this;return this._isInitialized?void t.call(this,n):void this.initSelection.call(null,this.$element,function(t){i._isInitialized=!0,e.isArray(t)||(t=[t]),n(t)})},t}),t.define("pumselect2/compat/inputData",["jquery"],function(e){function t(e,t,n){this._currentData=[],this._valueSeparator=n.get("valueSeparator")||",","hidden"===t.prop("type")&&n.get("debug")&&console&&console.warn&&console.warn("Select2: Using a hidden input with Select2 is no longer supported and may stop working in the future. It is recommended to use a `<select>` element instead."),e.call(this,t,n)}return t.prototype.current=function(t,n){function i(t,n){var o=[];return t.selected||e.inArray(t.id,n)!==-1?(t.selected=!0,o.push(t)):t.selected=!1,t.children&&o.push.apply(o,i(t.children,n)),o}for(var o=[],s=0;s<this._currentData.length;s++){var r=this._currentData[s];o.push.apply(o,i(r,this.$element.val().split(this._valueSeparator)))}n(o)},t.prototype.select=function(t,n){if(this.options.get("multiple")){var i=this.$element.val();i+=this._valueSeparator+n.id,this.$element.val(i),this.$element.trigger("change")}else this.current(function(t){e.map(t,function(e){e.selected=!1})}),this.$element.val(n.id),this.$element.trigger("change")},t.prototype.unselect=function(e,t){var n=this;t.selected=!1,this.current(function(e){for(var i=[],o=0;o<e.length;o++){var s=e[o];t.id!=s.id&&i.push(s.id)}n.$element.val(i.join(n._valueSeparator)),n.$element.trigger("change")})},t.prototype.query=function(e,t,n){for(var i=[],o=0;o<this._currentData.length;o++){var s=this._currentData[o],r=this.matches(t,s);null!==r&&i.push(r)}n({results:i})},t.prototype.addOptions=function(t,n){var i=e.map(n,function(t){return e.data(t[0],"data")});this._currentData.push.apply(this._currentData,i)},t}),t.define("pumselect2/compat/matcher",["jquery"],function(e){function t(t){function n(n,i){var o=e.extend(!0,{},i);if(null==n.term||""===e.trim(n.term))return o;if(i.children){for(var s=i.children.length-1;s>=0;s--){var r=i.children[s],a=t(n.term,r.text,r);a||o.children.splice(s,1)}if(o.children.length>0)return o}return t(n.term,i.text,i)?o:null}return n}return t}),t.define("pumselect2/compat/query",[],function(){function e(e,t,n){n.get("debug")&&window.console&&console.warn&&console.warn("Select2: The `query` option has been deprecated in favor of a custom data adapter that overrides the `query` method. Support will be removed for the `query` option in future versions of Select2."),e.call(this,t,n)}return e.prototype.query=function(e,t,n){t.callback=n;var i=this.options.get("query");i.call(null,t)},e}),t.define("pumselect2/dropdown/attachContainer",[],function(){function e(e,t,n){e.call(this,t,n)}return e.prototype.position=function(e,t,n){var i=n.find(".dropdown-wrapper");i.append(t),t.addClass("pumselect2-dropdown--below"),n.addClass("pumselect2-container--below")},e}),t.define("pumselect2/dropdown/stopPropagation",[],function(){function e(){}return e.prototype.bind=function(e,t,n){e.call(this,t,n);var i=["blur","change","click","dblclick","focus","focusin","focusout","input","keydown","keyup","keypress","mousedown","mouseenter","mouseleave","mousemove","mouseover","mouseup","search","touchend","touchstart"];this.$dropdown.on(i.join(" "),function(e){e.stopPropagation()})},e}),t.define("pumselect2/selection/stopPropagation",[],function(){function e(){}return e.prototype.bind=function(e,t,n){e.call(this,t,n);var i=["blur","change","click","dblclick","focus","focusin","focusout","input","keydown","keyup","keypress","mousedown","mouseenter","mouseleave","mousemove","mouseover","mouseup","search","touchend","touchstart"];this.$selection.on(i.join(" "),function(e){e.stopPropagation()})},e}),function(n){"function"==typeof t.define&&t.define.amd?t.define("jquery-mousewheel",["jquery"],n):"object"==typeof exports?module.exports=n:n(e)}(function(e){function t(t){var r=t||window.event,a=l.call(arguments,1),c=0,u=0,d=0,h=0,f=0,m=0;if(t=e.event.fix(r),t.type="mousewheel","detail"in r&&(d=r.detail*-1),"wheelDelta"in r&&(d=r.wheelDelta),"wheelDeltaY"in r&&(d=r.wheelDeltaY),"wheelDeltaX"in r&&(u=r.wheelDeltaX*-1),"axis"in r&&r.axis===r.HORIZONTAL_AXIS&&(u=d*-1,d=0),c=0===d?u:d,"deltaY"in r&&(d=r.deltaY*-1,c=d),"deltaX"in r&&(u=r.deltaX,0===d&&(c=u*-1)),0!==d||0!==u){if(1===r.deltaMode){var g=e.data(this,"mousewheel-line-height");c*=g,d*=g,u*=g}else if(2===r.deltaMode){var _=e.data(this,"mousewheel-page-height");c*=_,d*=_,u*=_}if(h=Math.max(Math.abs(d),Math.abs(u)),(!s||h<s)&&(s=h,i(r,h)&&(s/=40)),i(r,h)&&(c/=40,u/=40,d/=40),c=Math[c>=1?"floor":"ceil"](c/s),u=Math[u>=1?"floor":"ceil"](u/s),d=Math[d>=1?"floor":"ceil"](d/s),p.settings.normalizeOffset&&this.getBoundingClientRect){var v=this.getBoundingClientRect();f=t.clientX-v.left,m=t.clientY-v.top}return t.deltaX=u,t.deltaY=d,t.deltaFactor=s,t.offsetX=f,t.offsetY=m,t.deltaMode=0,a.unshift(t,c,u,d),o&&clearTimeout(o),o=setTimeout(n,200),(e.event.dispatch||e.event.handle).apply(this,a)}}function n(){s=null}function i(e,t){return p.settings.adjustOldDeltas&&"mousewheel"===e.type&&t%120===0}var o,s,r=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],a="onwheel"in document||document.documentMode>=9?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],l=Array.prototype.slice;if(e.event.fixHooks)for(var c=r.length;c;)e.event.fixHooks[r[--c]]=e.event.mouseHooks;var p=e.event.special.mousewheel={version:"3.1.12",setup:function(){if(this.addEventListener)for(var n=a.length;n;)this.addEventListener(a[--n],t,!1);else this.onmousewheel=t;e.data(this,"mousewheel-line-height",p.getLineHeight(this)),e.data(this,"mousewheel-page-height",p.getPageHeight(this))},teardown:function(){if(this.removeEventListener)for(var n=a.length;n;)this.removeEventListener(a[--n],t,!1);else this.onmousewheel=null;e.removeData(this,"mousewheel-line-height"),e.removeData(this,"mousewheel-page-height")},getLineHeight:function(t){var n=e(t),i=n["offsetParent"in e.fn?"offsetParent":"parent"]();return i.length||(i=e("body")),parseInt(i.css("fontSize"),10)||parseInt(n.css("fontSize"),10)||16},getPageHeight:function(t){return e(t).height()},settings:{adjustOldDeltas:!0,normalizeOffset:!0}};e.fn.extend({mousewheel:function(e){return e?this.bind("mousewheel",e):this.trigger("mousewheel")},unmousewheel:function(e){return this.unbind("mousewheel",e)}})}),t.define("jquery.pumselect2",["jquery","jquery-mousewheel","./pumselect2/core","./pumselect2/defaults"],function(e,t,n,i){if(null==e.fn.pumselect2){var o=["open","close","destroy"];e.fn.pumselect2=function(t){if(t=t||{},"object"==typeof t)return this.each(function(){var i=e.extend(!0,{},t);new n(e(this),i)}),this;if("string"==typeof t){var i;return this.each(function(){var n=e(this).data("pumselect2");null==n&&window.console&&console.error&&console.error("The pumselect2('"+t+"') method was called on an element that is not using Select2.");var o=Array.prototype.slice.call(arguments,1);i=n[t].apply(n,o)}),e.inArray(t,o)>-1?this:i}throw new Error("Invalid arguments for Select2: "+t)}}return null==e.fn.pumselect2.defaults&&(e.fn.pumselect2.defaults=i),n}),{define:t.define,require:t.require}}(),n=t.require("jquery.pumselect2");return e.fn.pumselect2.amd=t,n}),function(e,t,n){"use strict";e(t).on("click","#popup_reset_open_count",function(){var t=e(this);t.is(":checked")&&!confirm(pum_admin.I10n.confirm_count_reset)&&t.prop("checked",!1)})}(jQuery,document);var PUMColorPickers;!function(e,t,n){"use strict";PUMColorPickers={init:function(){e(".color-picker").filter(":not(.initialized)").addClass("initialized").wpColorPicker({change:function(t,n){e(t.target).trigger("colorchange",n)},clear:function(t){e(t.target).prev().trigger("colorchange").wpColorPicker("close")}})}},e(t).on("click",".iris-palette",function(){e(this).parents(".wp-picker-active").find("input.color-picker").trigger("change"),setTimeout(PopMakeAdmin.update_theme,500)}).on("colorchange",function(t,i){var o=e(t.target),s=o.parents("tr").next("tr.background-opacity"),r="";i!==n&&i.color!==n&&(r=i.color.toString()),o.hasClass("background-color")&&("string"==typeof r&&r.length?s.show():s.hide()),o.val(r),"popup_theme"===e("form#post input#post_type").val()&&PopMakeAdmin.update_theme()}).on("pum_init",PUMColorPickers.init)}(jQuery,document);var PUMConditions;!function(e,t,n){"use strict";PUMConditions={templates:{},addGroup:function(n,i){var o=e("#pum-popup-conditions"),s={index:o.find(".facet-group-wrap").length,conditions:[{target:n||null,not_operand:i||!1,settings:{}}]};o.find(".facet-groups").append(PUMConditions.templates.group(s)),o.find(".facet-builder").addClass("has-conditions"),e(t).trigger("pum_init")},renumber:function(){e("#pum-popup-conditions .facet-group-wrap").each(function(){var t=e(this),n=t.parent().children().index(t);t.data("index",n).find(".facet").each(function(){var t=e(this),i=t.parent().children().index(t);t.data("index",i).find("[name]").each(function(){var e="popup_conditions["+n+"]["+i+"]";this.name=this.name.replace(/popup_conditions\[\d*?\]\[\d*?\]/,e),this.id=this.name})})})}},e(t).on("pum_init",PUMConditions.renumber).ready(function(){e("body.post-type-popup form#post").length&&(PUMConditions.templates.group=wp.template("pum-condition-group"),PUMConditions.templates.facet=wp.template("pum-condition-facet"),PUMConditions.templates.settings={},e("script.tmpl.pum-condition-settings").each(function(){var t=e(this),n=t.attr("id").replace("tmpl-","");PUMConditions.templates.settings[t.data("condition")]=wp.template(n)}),PUMConditions.renumber())}).on("select2:select pumselect2:select","#pum-first-condition",function(){var t=e(this),n=t.val(),i=e("#pum-first-condition-operand"),o=i.is(":checked")?i.val():null;PUMConditions.addGroup(n,o),t.val(null).trigger("change"),i.prop("checked",!1).parents(".pum-condition-target").removeClass("not-operand-checked")}).on("click","#pum-popup-conditions .pum-not-operand",function(){var t=e(this),n=t.find("input"),i=t.parents(".pum-condition-target");n.is(":checked")?(i.removeClass("not-operand-checked"),n.prop("checked",!1)):(i.addClass("not-operand-checked"),n.prop("checked",!0))}).on("change","#pum-popup-conditions select.target",function(){var i=e(this),o=i.val(),s={index:i.parents(".facet-group").find(".facet").length,target:o,settings:{}};""!==o&&o!==i.parents(".facet").data("target")&&PUMConditions.templates.settings[o]!==n&&(i.parents(".facet").data("target",o).find(".facet-settings").html(PUMConditions.templates.settings[o](s)),e(t).trigger("pum_init"))}).on("click","#pum-popup-conditions .facet-group-wrap:last-child .and .add-facet",PUMConditions.addGroup).on("click","#pum-popup-conditions .add-or .add-facet:not(.disabled)",function(){var n=e(this),i=n.parents(".facet-group-wrap"),o={group:i.data("index"),index:i.find(".facet").length,target:null,settings:{}};i.find(".facet-list").append(PUMConditions.templates.facet(o)),e(t).trigger("pum_init")}).on("click","#pum-popup-conditions .remove-facet",function(){var t=e(this),n=e("#pum-popup-conditions"),i=t.parents(".facet"),o=t.parents(".facet-group-wrap");i.remove(),0===o.find(".facet").length&&(o.prev(".facet-group-wrap").find(".and .add-facet").removeClass("disabled"),o.remove(),0===n.find(".facet-group-wrap").length&&n.find(".facet-builder").removeClass("has-conditions")),PUMConditions.renumber()})}(jQuery,document);var PUMCookies;!function(e,t,n){"use strict";var i=pum_admin.I10n,o=pum_admin.defaults;PUMCookies={getLabel:function(e){return i.labels.cookies[e].name},getSettingsDesc:function(e,t){var n={evaluate:/<#([\s\S]+?)#>/g,interpolate:/\{\{\{([\s\S]+?)\}\}\}/g,escape:/\{\{([^\}]+?)\}\}(?!\})/g,variable:"data"},o=_.template(i.labels.cookies[e].settings_column,null,n);return t.I10n=i,o(t)},renumber:function(){e("#pum_popup_cookies_list tbody tr").each(function(){var t=e(this),n=t.parent().children().index(t),i=t.data("index");t.data("index",n),t.find("[name]").each(function(){var e="["+n+"]";this.name=this.name.replace("["+i+"]",e).replace("[]",e)})})},refreshDescriptions:function(){e("#pum_popup_cookies_list tbody tr").each(function(){var t=e(this),n=t.find(".popup_cookies_field_event").val(),i=JSON.parse(t.find(".popup_cookies_field_settings:first").val());t.find("td.settings-column").html(PUMCookies.getSettingsDesc(n,i))})},initEditForm:function(){PUMCookies.updateSessionsCheckbox()},updateSessionsCheckbox:function(){var t=e(".cookie-editor .pum-form"),n=t.find('.field.checkbox.session input[type="checkbox"]').is(":checked"),i=t.find(".field").filter(".time");n?i.hide():i.show()},resetCookieKey:function(){var t=e(this),n=(new Date).getTime().toString(16);t.parents(".pum-form").find(".field.text.name").data("cookiekey",n),t.siblings('input[type="text"]:first').val(n)},insertDefault:function(t){var s,r="on_popup_close",a=wp.template("pum-cookie-row"),l={event:r,cookie_settings:o.cookies[r]!==n?o.cookies[r]:{},save_button_text:i.add,index:e("#pum_popup_cookies_list tbody tr").length,I10n:i};l.cookie_settings.name=t||"pum-"+e("#post_ID").val(),s=a(l),e("#pum_popup_cookies_list tbody").append(s),PUMCookies.renumber(),e("#pum_popup_cookie_fields").addClass("has-cookies")}},e(t).on("select2:select pumselect2:select","#pum-first-cookie",function(){var t=e(this),s=t.val(),r="pum-cookie-settings-"+s,a="#"+r.replace(/-/g,"_"),l=wp.template(r),c={};c.cookie_settings=o.cookies[s]!==n?o.cookies[s]:{},c.cookie_settings.name="pum-"+e("#post_ID").val(),c.save_button_text=i.add,c.index=null,l.length||alert("Something went wrong. Please refresh and try again."),PUMModals.reload(a,l(c)),PUMCookies.initEditForm(),t.val(null).trigger("change")}).on("click",".field.cookiekey button.reset",PUMCookies.resetCookieKey).on("click",".cookie-editor .pum-form .field.checkbox.session",PUMCookies.updateSessionsCheckbox).on("click","#pum_popup_cookies .add-new",function(){var e=wp.template("pum-cookie-add-event");PUMModals.reload("#pum_cookie_add_event_modal",e())}).on("click","#pum_popup_cookies_list .edit",function(t){var n=e(this),o=n.parents("tr:first"),s=o.find(".popup_cookies_field_event").val(),r="pum-cookie-settings-"+s,a="#"+r.replace(/-/g,"_"),l=wp.template(r),c={index:o.parent().children().index(o),event:s,cookie_settings:JSON.parse(o.find(".popup_cookies_field_settings:first").val())};t.preventDefault(),c.save_button_text=i.save,l.length||alert("Something went wrong. Please refresh and try again."),PUMModals.reload(a,l(c)),PUMCookies.initEditForm()}).on("click","#pum_popup_cookies_list .remove",function(t){var n=e(this),o=n.parents("tr:first");t.preventDefault(),window.confirm(i.confirm_delete_cookie)&&(o.remove(),e("#pum_popup_cookies_list tbody tr").length||(e("#pum-first-cookie").val(null).trigger("change"),e("#pum_popup_cookie_fields").removeClass("has-cookies")),PUMCookies.renumber())}).on("submit","#pum_cookie_add_event_modal .pum-form",function(t){var s=e("#popup_cookie_add_event").val(),r="pum-cookie-settings-"+s,a="#"+r.replace(/-/g,"_"),l=wp.template(r),c={};t.preventDefault(),c.cookie_settings=o.cookies[s]!==n?o.cookies[s]:{},c.cookie_settings.name="pum-"+e("#post_ID").val(),c.save_button_text=i.add,c.index=null,l.length||alert("Something went wrong. Please refresh and try again."),PUMModals.reload(a,l(c)),PUMCookies.initEditForm()}).on("submit",".cookie-editor .pum-form",function(t){var n,o,s,r=e(this),a=(r.find("input.event").val(),r.pumSerializeObject()),l=parseInt(a.index),c=l>=0?e("#pum_popup_cookies_list tbody tr").eq(l):null,p=wp.template("pum-cookie-row");t.preventDefault(),(!l||l<0)&&(a.index=e("#pum_popup_cookies_list tbody tr").length),a.I10n=i,n=p(a),c?c.replaceWith(n):e("#pum_popup_cookies_list tbody").append(n),PUMModals.closeAll(),PUMCookies.renumber(),e("#pum_popup_cookie_fields").addClass("has-cookies"),PUMTriggers.new_cookie>=0&&(o=e("#pum_popup_triggers_list tbody tr").eq(PUMTriggers.new_cookie).find(".popup_triggers_field_settings:first"),s=JSON.parse(o.val()),s.cookie.name[s.cookie.name.indexOf("add_new")]=a.cookie_settings.name,o.val(JSON.stringify(s)),PUMTriggers.new_cookie=!1,PUMTriggers.refreshDescriptions())}).ready(function(){PUMCookies.refreshDescriptions(),e("#pum-first-cookie").val(null).trigger("change")})}(jQuery,document),function(e,t,n){"use strict";var i={init:function(){e("#popmake_popup_auto_open_fields, #popmake_popup_targeting_condition_fields").length&&(i.initialize_popup_page(),i.attachQuickSearchListeners(),i.attachTabsPanelListeners())},attachTabsPanelListeners:function(){e("#poststuff").bind("click",function(t){var n,i,o,s,r,a,l,c,p,u,d,h,f,m,g=e(t.target);if(g.hasClass("nav-tab-link"))i=g.data("type"),o=g.parents(".posttypediv, .taxonomydiv").first(),e("input",o).removeAttr("checked"),e(".tabs-panel-active",o).removeClass("tabs-panel-active").addClass("tabs-panel-inactive"),e("#"+i,o).removeClass("tabs-panel-inactive").addClass("tabs-panel-active"),e(".tabs",o).removeClass("tabs"),g.parent().addClass("tabs"),e(".quick-search",o).focus(),t.preventDefault();else if(g.hasClass("select-all"))n=/#(.*)$/.exec(t.target.href),n&&n[1]&&(s=e("#"+n[1]+" .tabs-panel-active .menu-item-title input"),s.length===s.filter(":checked").length?s.removeAttr("checked"):s.prop("checked",!0));else if(g.hasClass("submit-add-to-menu")){for(r=g.parents(".options"),a=e('.tabs-panel-active input[type="checkbox"]:checked',r),l=e("textarea",r),c=e(".tagchecklist",r),p=l.val().split(","),u=0;u<p.length;u+=1)p[u]=parseInt(p[u],10);a.each(function(){d=e(this),h=parseInt(d.val(),10),f=d.parent("label").siblings(".menu-item-title").val(),e.inArray(h,p)===-1&&p.push(h),c.append('<span><a class="ntdelbutton" data-id="'+h+'">X</a> '+f+"</span>")}),l.text(p.join(",")),t.preventDefault()}else g.hasClass("ntdelbutton")&&(d=g,m=parseInt(d.data("id"),10),r=g.parents(".options"),l=e("textarea",r),c=e(".tagchecklist",r),p=l.val().split(","),p=e.grep(p,function(e){return parseInt(e,10)!==parseInt(m,10)}),d.parent("span").remove(),l.text(p.join(",")))})},attachQuickSearchListeners:function(){var t;e(".quick-search").keypress(function(n){var o=e(this);return 13===n.which?(i.updateQuickSearchResults(o),!1):(t&&clearTimeout(t),void(t=setTimeout(function(){i.updateQuickSearchResults(o)},400)))}).attr("autocomplete","off")},updateQuickSearchResults:function(t){var n,o,s=2,r=t.val();r.length<s||(n=t.parents(".tabs-panel"),o={action:"menu-quick-search","response-format":"markup",menu:null,"menu-settings-column-nonce":e("#menu-settings-column-nonce").val(),q:r,type:t.attr("name")},e(".spinner",n).show(),e.post(ajaxurl,o,function(e){i.processQuickSearchQueryResponse(e,o,n)}))},processQuickSearchQueryResponse:function(t,n,i){var o,s,r,a=e("form#post"),l={},c=/menu-item[(\[\^]\]*/,p=e("<div>").html(t).find("li");return p.length?(p.each(function(){if(r=e(this),o=c.exec(r.html()),o&&o[1]){for(s=o[1];a.elements["menu-item["+s+"][menu-item-type]"]||l[s];)s-=1;l[s]=!0,s!==o[1]&&r.html(r.html().replace(new RegExp("menu-item\\["+o[1]+"\\]","g"),"menu-item["+s+"]"))}}),e(".categorychecklist",i).html(p),e(".spinner",i).hide(),void e('[name^="menu-item"]').removeAttr("name")):(e(".categorychecklist",i).html("<li><p>noResultsFound</p></li>"),void e(".spinner",i).hide())},initialize_popup_page:function(){var n=function(t){var n,i,o=t.siblings(".options");t.is(":checked")?(o.show(),"popup_targeting_condition_on_entire_site"===t.attr("id")?(n=t.parents("#popmake_popup_targeting_condition_fields").find('[id^="targeting_condition-exclude_on_"]'),i=t.parents(".targeting_condition").siblings(".targeting_condition"),i.hide(),e("> *",i).prop("disabled",!0),n.show(),e("> *",n).prop("disabled",!1)):e("*",o).prop("disabled",!1)):(o.hide(),"popup_targeting_condition_on_entire_site"===t.attr("id")?(n=t.parents("#popmake_popup_targeting_condition_fields").find('[id^="targeting_condition-exclude_on_"]'),i=t.parents(".targeting_condition").siblings(".targeting_condition"),i.show(),e("> *",i).prop("disabled",!1),n.hide(),e("> *",n).prop("disabled",!0)):e("*",o).prop("disabled",!0))},i=function(t){var n=t.parents(".options").find('input[type="checkbox"]:eq(0)'),i=n.attr("name").indexOf("exclude")>=0,o=i?n.attr("name").replace("popup_targeting_condition_exclude_on_specific_",""):n.attr("name").replace("popup_targeting_condition_on_specific_",""),s=e(i?"#exclude_on_specific_"+o:"#on_specific_"+o);t.is(":checked")&&("true"===t.val()?(n.prop("checked",!0),s.show(),e("*",s).prop("disabled",!1)):""===t.val()&&(n.prop("checked",!1),s.hide(),e("*",s).prop("disabled",!0)))},o=function(){e("#popup_auto_open_session_cookie").is(":checked")?e(".not-session-cookie").hide():e(".not-session-cookie").show()},s=function(){e("#popup_auto_open_enabled").is(":checked")?(e(".auto-open-enabled").show(),o()):e(".auto-open-enabled").hide()},r=function(){e("#popup_auto_open_cookie_key").val((new Date).getTime().toString(16))};e('[name^="menu-item"]').removeAttr("name"),e("#title").prop("required",!0),e(t).on("click","#popup_auto_open_session_cookie",function(){o()}).on("click","#popup_auto_open_enabled",function(){s()}).on("click",".popmake-reset-auto-open-cookie-key",function(){r()}),e('#popmake_popup_targeting_condition_fields .targeting_condition > input[type="checkbox"]').on("click",function(){n(e(this))}).each(function(){n(e(this))}),e('input[type="radio"][id*="popup_targeting_condition_"]').on("click",function(){i(e(this))}).each(function(){i(e(this))}),e(".posttypediv, .taxonomydiv").each(function(){var t=e(this),n=e("> ul li"),i=e(".tabs-panel",t);n.removeClass("tabs"),n.eq(0).addClass("tabs"),i.removeClass("tabs-panel-active").addClass("tabs-panel-inactive").removeAttr("style"),i.eq(0).removeClass("tabs-panel-inactive").addClass("tabs-panel-active")}),s(),""===e("#popup_auto_open_cookie_key").val()&&r()}};e(t).ready(function(){i.init(),e(t).trigger("pum_init")})}(jQuery,document);var PUMMarketing;!function(e,t,n){"use strict";PUMMarketing={init:function(){e('#menu-posts-popup ul li a[href="edit.php?post_type=popup&page=extensions"]').css({color:"#9aba27"})}},e(t).ready(PUMMarketing.init)}(jQuery,document);var PUMModals;!function(e,t,n){"use strict";var i,o,s,r=e("html"),a=e(t),l="a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), iframe, object, embed, *[tabindex], *[contenteditable]";PUMModals={forceFocus:function(e){s&&!s.contains(e.target)&&(e.stopPropagation(),s.focus())},trapEscapeKey:function(e){27===e.keyCode&&(PUMModals.closeAll(),e.preventDefault())},trapTabKey:function(t){if(9===t.keyCode){var n=s.find("*").filter(l).filter(":visible"),i=e(":focus"),o=n.length,r=n.index(i);t.shiftKey?0===r&&(n.get(o-1).focus(),t.preventDefault()):r===o-1&&(n.get(0).focus(),t.preventDefault())}},setFocusToFirstItem:function(){s.find(".pum-modal-content *").filter(l).filter(":visible").first().focus()},closeAll:function(t){e(".pum-modal-background").off("keydown.pum_modal").hide(0,function(){e("html").css({overflow:"visible",width:"auto"}),i&&(i.attr("aria-hidden","false"),i=null),o.length&&o.focus(),s=null,a.off("focus.pum_modal"),n!==t&&t()}).attr("aria-hidden","true")},show:function(t,a){e(".pum-modal-background").off("keydown.pum_modal").hide(0).attr("aria-hidden","true"),r.data("origwidth",r.innerWidth()).css({overflow:"hidden",width:r.innerWidth()});var l=e(":focus");l.parents(".pum-modal-wrap").length||(o=l),s=e(t),s.on("keydown.pum_modal",function(e){PUMModals.trapEscapeKey(e),PUMModals.trapTabKey(e)}).show(0,function(){i=e("body > *").filter(":visible").not(s),i.attr("aria-hidden","true"),s.trigger("pum_init").on("focus.pum_modal",PUMModals.forceFocus),PUMModals.setFocusToFirstItem(),n!==a&&a()}).attr("aria-hidden","false")},remove:function(t){e(t).remove()},replace:function(t,n){PUMModals.remove(e.trim(t)),e("body").append(e.trim(n))},reload:function(e,t,n){PUMModals.replace(e,t),PUMModals.show(e,n)}},e(t).on("click",".pum-modal-background, .pum-modal-wrap .cancel, .pum-modal-wrap .pum-modal-close",function(t){var n=e(t.target);(n.hasClass("pum-modal-background")||n.hasClass("cancel")||n.hasClass("pum-modal-close")||n.hasClass("submitdelete"))&&(PUMModals.closeAll(),t.preventDefault(),t.stopPropagation())})}(jQuery,document);var PUMRangeSLiders;!function(e,t,n){"use strict";PUMRangeSLiders={init:function(){var n,i,o,s,r,a=e('<input type="range"/>'),l=e('<button type="button" class="popmake-range-plus">+</button>'),c=e('<button type="button" class="popmake-range-minus">-</button>');e(".popmake-range-manual").filter(":not(.initialized)").each(function(){var p=e(this).addClass("initialized"),u=p.data("force-minmax"),d=parseInt(p.prop("min"),0),h=parseInt(p.prop("max"),0),f=parseInt(p.prop("step"),0),m=parseInt(p.val(),0);o=a.clone(),s=l.clone(),r=c.clone(),u&&m>h&&(m=h,p.val(m)),o.prop({min:d||0,max:u||h&&h>m?h:1.5*m,step:f||1.5*m/100,value:m}).on("change input",function(){p.trigger("input")}),p.next().after(r,s),p.before(o),n=t.createElement("input"),n.setAttribute("type","range"),"text"===n.type&&e("input[type=range]").each(function(t,n){i=e(n),o=e("<div />").slider({min:parseInt(i.attr("min"),10)||0,max:parseInt(i.attr("max"),10)||100,value:parseInt(i.attr("value"),10)||0,step:parseInt(i.attr("step"),10)||1,slide:function(t,n){e(this).prev("input").val(n.value)}}),i.after(o).hide()})})}},e(t).on("pum_init",PUMRangeSLiders.init).on("input",'input[type="range"]',function(){var t=e(this);t.siblings(".popmake-range-manual").val(t.val())}).on("change",".popmake-range-manual",function(){var t=e(this),n=parseInt(t.prop("max"),0),i=parseInt(t.prop("step"),0),o=t.data("force-minmax"),s=parseInt(t.val(),0),r=t.prev();isNaN(s)&&(s=r.val(),t.val(s)),o&&s>n&&(s=n,t.val(s)),r.prop({max:o||n&&n>s?n:1.5*s,step:i||1.5*s/100,value:s})}).on("click",".popmake-range-plus",function(t){var n=e(this).siblings(".popmake-range-manual"),i=parseInt(n.prop("step"),0),o=parseInt(n.val(),0),s=o+i,r=n.prev();t.preventDefault(),n.val(s).trigger("input"),r.val(s)}).on("click",".popmake-range-minus",function(t){var n=e(this).siblings(".popmake-range-manual"),i=parseInt(n.prop("step"),0),o=parseInt(n.val(),0),s=o-i,r=n.prev();t.preventDefault(),n.val(s).trigger("input"),r.val(s)})}(jQuery,document);var PUMSelect2Fields;!function(e,t,n){"use strict";e.fn.pumselect2=e.fn.pumselect2||e.fn.select2,PUMSelect2Fields={init:function(){e(".pum-select2 select").filter(":not(.initialized)").each(function(){var t=e(this),i=t.data("current"),o=t.data("objecttype"),s=t.data("objectkey"),r={multiple:!1,dropdownParent:t.parent()};t.attr("multiple")&&(r.multiple=!0),o&&s&&(r=e.extend(r,{ajax:{url:ajaxurl,dataType:"json",delay:250,data:function(e){return{s:e.term,page:e.page,action:"pum_object_search",object_type:o,object_key:s}},processResults:function(e,t){return t.page=t.page||1,{results:e.items,pagination:{more:10*t.page<e.total_count}}},cache:!0},cache:!0,escapeMarkup:function(e){return e},minimumInputLength:1,templateResult:PUMSelect2Fields.formatObject,templateSelection:PUMSelect2Fields.formatObjectSelection})),t.addClass("initialized").pumselect2(r),i!==n&&("object"!=typeof i&&(i=[i]),o&&s?e.ajax({url:ajaxurl,data:{action:"pum_object_search",object_type:o,object_key:s,include:i},dataType:"json",success:function(n){e.each(n.items,function(e,n){t.find('option[value="'+n.id+'"]').length||t.prepend('<option value="'+n.id+'">'+n.text+"</option>")}),t.val(i).trigger("change")}}):t.val(i).trigger("change"))})},formatObject:function(e){return e.text},formatObjectSelection:function(e){return e.text||e.text}},e(t).on("pum_init",PUMSelect2Fields.init)}(jQuery,document),function(e,t,n){function i(t,n){return e.inArray(n,t)!==-1}function o(e,t,n){var i=t[0];t.length>1?(e[i]||(e[i]=t[1]?{}:[]),o(e[i],t.slice(1),n)):(i||(i=e.length),e[i]=n)}var s="color,date,datetime,datetime-local,email,hidden,month,number,password,range,search,tel,text,time,url,week".split(","),r="select,textarea".split(","),a=/\[([^\]]*)\]/g;e.fn.pumSerializeObject=function(t){e.extend({},t);var n={},l=e.extend(!0,{include:[],exclude:[],includeByClass:""},t);return this.find(":input").each(function(){var t;!this.name||this.disabled||i(l.exclude,this.name)||l.include.length&&!i(l.include,this.name)||this.className.indexOf(l.includeByClass)===-1||(t=this.name.replace(a,"[$1").split("["),t[0]&&(this.checked||i(s,this.type)||i(r,this.nodeName.toLowerCase()))&&("checkbox"===this.type&&t.push(""),o(n,t,e(this).val())))}),n}}(jQuery,document);var PUMTabs;!function(e,t,n){"use strict";PUMTabs={init:function(){e(".pum-tabs-container").filter(":not(.initialized)").each(function(){var t=e(this),n=t.find(".tab:first");t.hasClass("vertical-tabs")&&t.css({minHeight:t.find(".tabs").eq(0).outerHeight(!0)}),t.find(".active").removeClass("active"),n.addClass("active"),e(n.find("a").attr("href")).addClass("active"),t.addClass("initialized")})}},e(t).on("pum_init",PUMTabs.init).on("click",".pum-tabs-container .tab",function(t){var n=e(this),i=n.parents(".pum-tabs-container:first"),o=n.find("a").attr("href");i.find(".active").removeClass("active"),n.addClass("active"),e(o).addClass("active"),t.preventDefault()})}(jQuery,document);var PUM_Templates;!function(e,t,n){"use strict";var i=pum_admin.I10n;PUM_Templates={render:function(e,t){var n=wp.template(e);return"object"==typeof t.classes&&(t.classes=t.classes.join(" ")),t=PUM_Templates.prepareMeta(t),n(t)},shortcode:function(t){var n=e.extend({},{tag:"",meta:{},has_content:!1,content:""},t),i=n.has_content?"pum-shortcode-w-content":"pum-shortcode";return PUM_Templates.render(i,n)},modal:function(t){var n=e.extend({},{id:"",title:"",description:"",classes:"",save_button:i.save,cancel_button:i.cancel,content:""},t);return PUM_Templates.render("pum-modal",n)},tabs:function(t){var n=t.classes||[],i=e.extend({},{id:"",vertical:!0,form:!0,classes:"",tabs:{general:{label:"General",content:""}}},t);return i.form&&n.push("tabbed-form"),i.vertical&&n.push("vertical-tabs"),i.classes=i.classes+" "+n.join(" "),PUM_Templates.render("pum-tabs",i)},section:function(t){var n=e.extend({},{classes:[],fields:[]},t);return PUM_Templates.render("pum-field-section",n)},field:function(t){var i="pum-field-"+t.type,o=[],s=e.extend({},{type:"text",id:"",id_prefix:"",name:"",label:null,placeholder:"",desc:null,size:"regular",classes:[],value:null,select2:!1,multiple:!1,as_array:!1,options:[],object_type:null,object_key:null,std:null,min:0,max:50,step:1,unit:"px",required:!1,meta:{}
4
- },t);if(!e("#tmpl-"+i).length&&("objectselect"!==t.type&&"postselect"!==t.type&&"taxonomyselect"!==t.type||(i="pum-field-select"),!e("#tmpl-"+i).length))return"";switch(s.value||t.std===n||(s.value=t.std),"string"==typeof s.classes&&(s.classes=s.classes.split(" ")),t["class"]!==n&&s.classes.push(t["class"]),s.required&&(s.meta.required=!0,s.classes.push("pum-required")),t.type){case"select":case"objectselect":case"postselect":case"taxonomyselect":s.options!==n&&(_.each(s.options,function(e,t){var n=!1;s.multiple&&s.value.indexOf(e)!==!1?n="selected":s.multiple||s.value!=e||(n="selected"),o.push(PUM_Templates.prepareMeta({label:t,value:e,meta:{selected:n}}))}),s.options=o),s.multiple&&(s.meta.multiple=!0,s.as_array&&(s.name+="[]"),s.value&&s.value.length||(s.value=[]),"string"==typeof s.value&&(s.value=[s.value])),"select"!==t.type&&(s.select2=!0,s.classes.push("pum-field-objectselect"),s.classes.push("postselect"===t.type?"pum-field-postselect":"pum-field-taxonomyselect"),s.meta["data-objecttype"]="postselect"===t.type?"post_type":"taxonomy",s.meta["data-objectkey"]="postselect"===t.type?t.post_type:t.taxonomy,s.meta["data-current"]=s.value),s.select2&&(s.classes.push("pum-select2"),s.placeholder&&(s.meta["data-placeholder"]=s.placeholder));break;case"multicheck":s.options!==n&&(_.each(s.options,function(e,t){o.push({label:t,value:e,meta:{checked:s.value.indexOf(e)>=0}})}),s.options=o);break;case"checkbox":1===parseInt(s.value,10)&&(s.meta.checked=!0);break;case"rangeslider":s.meta.step=s.step,s.meta.min=s.min,s.meta.max=s.max;break;case"textarea":s.meta.cols=s.cols,s.meta.rows=s.rows}return s.field=PUM_Templates.render(i,s),PUM_Templates.render("pum-field-wrapper",s)},prepareMeta:function(e){var t,n=[];for(t in e.meta)e.meta.hasOwnProperty(t)&&("boolean"==typeof e.meta[t]?e.meta[t]&&n.push(_.escape(t)):n.push(_.escape(t)+'="'+_.escape(e.meta[t])+'"'));return e.meta=n.join(" "),e}}}(jQuery,document);var PUMTriggers;!function(e,t,n){"use strict";var i=pum_admin.I10n,o=pum_admin.defaults;PUMTriggers={new_cookie:!1,getLabel:function(e){return i.labels.triggers[e].name},getSettingsDesc:function(e,t){var n={evaluate:/<#([\s\S]+?)#>/g,interpolate:/\{\{\{([\s\S]+?)\}\}\}/g,escape:/\{\{([^\}]+?)\}\}(?!\})/g,variable:"data"},o=_.template(i.labels.triggers[e].settings_column,null,n);return t.I10n=i,o(t)},renumber:function(){e("#pum_popup_triggers_list tbody tr").each(function(){var t=e(this),n=t.parent().children().index(t),i=t.data("index");t.data("index",n),t.find("input").each(function(){var e="["+n+"]";this.name=this.name.replace("["+i+"]",e).replace("[]",e)})})},refreshDescriptions:function(){e("#pum_popup_triggers_list tbody tr").each(function(){var t=e(this),n=t.find(".popup_triggers_field_type").val(),i=JSON.parse(t.find(".popup_triggers_field_settings:first").val()),o=PUMTriggers.cookie_column_value(i.cookie.name);t.find("td.settings-column").html(PUMTriggers.getSettingsDesc(n,i)),t.find("td.cookie-column code").text(o)})},initEditForm:function(t){var n=e(".trigger-editor .pum-form"),i=n.find('input[name="type"]').val(),o=e("#name",n),s=t.trigger_settings,r=e("#pum_popup_cookies_list tbody tr");r.length||"click_open"===i||(PUMCookies.insertDefault(),r=e("#pum_popup_cookies_list tbody tr")),r.each(function(){var t=JSON.parse(e(this).find(".popup_cookies_field_settings:first").val());o.find('option[value="'+t.name+'"]').length||e('<option value="'+t.name+'">'+t.name+"</option>").appendTo(o)}),o.val(s.cookie.name).trigger("change.pumselect2")},cookie_column_value:function(e){var t=i.no_cookie;return e instanceof Array?t=e.join(", "):null!==e&&(t=e),t},append_click_selector_presets:function(){return e("#extra_selectors").each(function(){var t=e(this),n=_.template(e("#tmpl-pum-click-selector-presets").html()),i=t.parents(".pum-field").find(".pum-click-selector-presets");i.length||(t.before(n()),i=t.parents(".pum-field").find(".pum-click-selector-presets")),i.position({my:"right center",at:"right center",of:t})})},toggle_click_selector_presets:function(){e(this).parent().toggleClass("open")},reset_click_selector_presets:function(t){t!==n&&e(t.target).parents(".pum-click-selector-presets").length||e(".pum-click-selector-presets").removeClass("open")},insert_click_selector_preset:function(){var t=e(this),n=e("#extra_selectors"),i=n.val();""!==i&&(i+=", "),n.val(i+t.data("preset")),PUMTriggers.reset_click_selector_presets()}},PUMTriggers.refreshDescriptions(),e(t).on("pum_init",function(){PUMTriggers.append_click_selector_presets()}).on("click",".pum-click-selector-presets > span",PUMTriggers.toggle_click_selector_presets).on("click",".pum-click-selector-presets li",PUMTriggers.insert_click_selector_preset).on("click",PUMTriggers.reset_click_selector_presets).on("select2:select pumselect2:select","#pum-first-trigger",function(){var t=e(this),s=t.val(),r="pum-trigger-settings-"+s,a="#"+r.replace(/-/g,"_"),l=wp.template(r),c={};c.trigger_settings=o.triggers[s]!==n?o.triggers[s]:{},c.save_button_text=i.add,c.index=null,"click_open"!==s&&(c.trigger_settings.cookie.name="pum-"+e("#post_ID").val()),l.length||alert("Something went wrong. Please refresh and try again."),PUMModals.reload(a,l(c)),PUMTriggers.initEditForm(c),t.val(null).trigger("change")}).on("click","#pum_popup_triggers .add-new",function(){var e=wp.template("pum-trigger-add-type");PUMModals.reload("#pum_trigger_add_type_modal",e())}).on("click","#pum_popup_triggers_list .edit",function(t){var n=e(this),o=n.parents("tr:first"),s=o.find(".popup_triggers_field_type").val(),r="pum-trigger-settings-"+s,a="#"+r.replace(/-/g,"_"),l=wp.template(r),c={index:o.parent().children().index(o),type:s,trigger_settings:JSON.parse(o.find(".popup_triggers_field_settings:first").val())};t.preventDefault(),c.save_button_text=i.save,l.length||alert("Something went wrong. Please refresh and try again."),PUMModals.reload(a,l(c)),PUMTriggers.initEditForm(c)}).on("click","#pum_popup_triggers_list .remove",function(t){var n=e(this),o=n.parents("tr:first");t.preventDefault(),window.confirm(i.confirm_delete_trigger)&&(o.remove(),e("#pum_popup_triggers_list tbody tr").length||(e("#pum-first-trigger").val(null).trigger("change"),e("#pum_popup_trigger_fields").removeClass("has-triggers")),PUMTriggers.renumber())}).on("submit","#pum_trigger_add_type_modal .pum-form",function(t){var s=e("#popup_trigger_add_type").val(),r="pum-trigger-settings-"+s,a="#"+r.replace(/-/g,"_"),l=wp.template(r),c={};t.preventDefault(),c.trigger_settings=o.triggers[s]!==n?o.triggers[s]:{},c.save_button_text=i.add,c.index=null,"click_open"!==s&&(c.trigger_settings.cookie.name="pum-"+e("#post_ID").val()),l.length||alert("Something went wrong. Please refresh and try again."),PUMModals.reload(a,l(c)),PUMTriggers.initEditForm(c)}).on("submit",".trigger-editor .pum-form",function(t){var n,o=e(this),s=(o.find("input.type").val(),o.pumSerializeObject()),r=parseInt(s.index),a=r>=0?e("#pum_popup_triggers_list tbody tr").eq(r):null,l=wp.template("pum-trigger-row");t.preventDefault(),(!r||r<0)&&(s.index=e("#pum_popup_triggers_list tbody tr").length),s.I10n=i,n=l(s),a?a.replaceWith(n):e("#pum_popup_triggers_list tbody").append(n),PUMModals.closeAll(),PUMTriggers.renumber(),PUMTriggers.refreshDescriptions(),e("#pum_popup_trigger_fields").addClass("has-triggers"),null!==s.trigger_settings.cookie.name&&s.trigger_settings.cookie.name.indexOf("add_new")>=0&&(PUMTriggers.new_cookie=s.index,e("#pum_popup_cookie_fields button.add-new").trigger("click"))}).ready(function(){PUMTriggers.refreshDescriptions(),e("#pum-first-trigger").val(null).trigger("change")})}(jQuery,document);var PUMUtils;!function(e,t,n){"use strict";PUMUtils={convert_meta_to_object:function(e){var t,i,o,s={};for(o in e)e.hasOwnProperty(o)&&(t=o.split(/_(.+)?/)[0],i=o.split(/_(.+)?/)[1],s[t]===n&&(s[t]={}),s[t][i]=e[o]);return s},serialize_form:function(t){var n={};return e("[name]",t).each(function(){var t,i,o=e(this).attr("name"),s=e(this).val(),r=o.split("["),a=n,l=r.length;for(t=0;t<l;t+=1)i=r[t].replace("]",""),a[i]||(a[i]={}),t!==r.length-1?a=a[i]:t===r.length-1&&(a[i]=s)}),n},convert_hex:function(e,t){if(n===e)return"";n===t&&(t=100),e=e.replace("#","");var i=parseInt(e.substring(0,2),16),o=parseInt(e.substring(2,4),16),s=parseInt(e.substring(4,6),16),r="rgba("+i+","+o+","+s+","+t/100+")";return r},debounce:function(e,t){var n;return function(){var i=this,o=arguments;window.clearTimeout(n),n=window.setTimeout(function(){e.apply(i,o)},t)}},throttle:function(e,t){var n=!1,i=function(){n=!1};return function(){n||(e(),window.setTimeout(i,t),n=!0)}}},String.prototype.capitalize=function(){return this.charAt(0).toUpperCase()+this.slice(1)}}(jQuery,document);var PopMakeAdmin,PUM_Admin;!function(e,t,n){"use strict";var i=e(t);pum_admin.I10n,pum_admin.defaults;PUM_Admin={},PopMakeAdmin={init:function(){e("body.post-type-popup form#post").length&&PopMakeAdmin.initialize_popup_page(),e("body.post-type-popup_theme form#post").length&&PopMakeAdmin.initialize_theme_page()},initialize_popup_page:function(){var n=function(){"custom"===e("#popup_display_size").val()?(e(".custom-size-only").show(),e(".responsive-size-only").hide(),e("#popup_display_custom_height_auto").is(":checked")?e(".custom-size-height-only").hide():e(".custom-size-height-only").show()):(e(".custom-size-only").hide(),"auto"!==e("#popup_display_size").val()?(e(".responsive-size-only").show(),e("#popup_display_custom_height_auto").prop("checked",!1)):e(".responsive-size-only").hide())},i=function(){e(".animation-speed, .animation-origin").hide(),"fade"===e("#popup_display_animation_type").val()?e(".animation-speed").show():"none"!==e("#popup_display_animation_type").val()&&e(".animation-speed, .animation-origin").show()},o=function(){var t=e("#popup_display_location"),n=t.parents("table"),i=t.val();e("tr.top, tr.right, tr.left, tr.bottom",n).hide(),i.indexOf("top")>=0&&e("tr.top").show(),i.indexOf("left")>=0&&e("tr.left").show(),i.indexOf("bottom")>=0&&e("tr.bottom").show(),i.indexOf("right")>=0&&e("tr.right").show()};e("#popuptitlediv").insertAfter("#titlediv"),e("#title").prop("required",!0),e(t).on("change","#popup_theme",function(){var t=e(this),n=e("#edit_theme_link"),i=t.val();n.attr("href",n.data("baseurl")+i)}).on("keydown","#popuptitle",function(t){var n=t.keyCode||t.which;9===n&&(t.preventDefault(),e("#title").focus())}).on("keydown","#title, #popuptitle",function(t){var n,i=t.keyCode||t.which;t.shiftKey||9!==i||(t.preventDefault(),n="title"===e(this).attr("id")?"#popuptitle":"#insert-media-button",e(n).focus())}).on("keydown","#popuptitle, #insert-media-button",function(t){var n,i=t.keyCode||t.which;t.shiftKey&&9===i&&(t.preventDefault(),n="popuptitle"===e(this).attr("id")?"#title":"#popuptitle",e(n).focus())}).on("click","#popup_display_custom_height_auto",function(){n()}).on("change","#popup_display_size",function(){"custom"!==e("#popup_display_size").val()&&"auto"!==e("#popup_display_size").val()&&e("#popup_display_position_fixed, #popup_display_scrollable_content").prop("checked",!1),n()}).on("change","#popup_display_animation_type",function(){i()}).on("change","#popup_display_location",function(){o()}),n(),i(),o()},theme_page_listeners:function(){var n=this;e(".empreview .example-popup-overlay, .empreview .example-popup, .empreview .title, .empreview .content, .empreview .close-popup").css("cursor","pointer"),e(t).on("click",".empreview .example-popup-overlay, .empreview .example-popup, .empreview .title, .empreview .content, .empreview .close-popup",function(t){var n=e(this),i=n.attr("class"),o=0;switch(t.preventDefault(),t.stopPropagation(),i){case"example-popup-overlay":o=e("#popmake_popup_theme_overlay").offset().top;break;case"example-popup":o=e("#popmake_popup_theme_container").offset().top;break;case"title":o=e("#popmake_popup_theme_title").offset().top;break;case"content":o=e("#popmake_popup_theme_content").offset().top;break;case"close-popup":o=e("#popmake_popup_theme_close").offset().top}e("html, body").animate({scrollTop:o+"px"})}).on("change","select.font-family",function(){e("select.font-weight option, select.font-style option",e(this).parents("table")).prop("selected",!1),n.update_font_selectboxes()}).on("change","select.font-weight, select.font-style",function(){n.update_font_selectboxes()}).on("change input focusout","select, input",function(){n.update_theme()}).on("change","select.border-style",function(){var t=e(this);"none"===t.val()?t.parents("table").find(".border-options").hide():t.parents("table").find(".border-options").show()}).on("change","#popup_theme_close_location",function(){var t=e(this),n=t.parents("table");e("tr.topleft, tr.topright, tr.bottomleft, tr.bottomright",n).hide(),e("tr."+t.val(),n).show()})},update_theme:function(){var t,n=e("[name^='popup_theme_']").serializeArray(),i={};for(t=0;n.length>t;t+=1)0===n[t].name.indexOf("popup_theme_")&&(i[n[t].name.replace("popup_theme_","")]=n[t].value);this.retheme_popup(i)},theme_preview_scroll:function(){var t=e("#popmake-theme-editor .empreview, body.post-type-popup_theme form#post #popmake_popup_theme_preview"),n=t.parent(),i=t.offset().top-50;e(window).on("scroll",function(){e("> .postbox:visible",n).index(t)===e("> .postbox:visible",n).length-1&&e(window).scrollTop()>=i?t.css({left:t.offset().left,width:t.width(),height:t.height(),position:"fixed",top:50}):t.removeAttr("style")})},update_font_selectboxes:function(){return e("select.font-family").each(function(){var t,i,o=e(this),s=o.parents("table").find("select.font-weight"),r=o.parents("table").find("select.font-style"),a=s.find("option"),l=r.find("option");if(popmake_google_fonts[o.val()]!==n){if(t=popmake_google_fonts[o.val()],a.hide(),l.hide(),t.variants.length)for(i=0;t.variants.length>i;i+=1)"regular"===t.variants[i]?(e('option[value=""]',s).show(),e('option[value=""]',r).show()):(t.variants[i].indexOf("italic")>=0&&e('option[value="italic"]',r).show(),e('option[value="'+parseInt(t.variants[i],10)+'"]',s).show())}else a.show(),l.show();s.parents("tr:first").show(),s.find("option:visible").length<=1?s.parents("tr:first").hide():s.parents("tr:first").show(),r.parents("tr:first").show(),r.find("option:visible").length<=1?r.parents("tr:first").hide():r.parents("tr:first").show()})},convert_theme_for_preview:function(e){},initialize_theme_page:function(){e("#popuptitlediv").insertAfter("#titlediv");var n=this,i=e("#popup_theme_close_location").parents("table");switch(n.update_theme(),n.theme_page_listeners(),n.theme_preview_scroll(),n.update_font_selectboxes(),e(t).on("click",".popmake-preview",function(t){t.preventDefault(),e("#popmake-preview, #popmake-overlay").css({visibility:"visible"}).show()}).on("click",".popmake-close",function(){e("#popmake-preview, #popmake-overlay").hide()}),e("select.border-style").each(function(){var t=e(this);"none"===t.val()?t.parents("table").find(".border-options").hide():t.parents("table").find(".border-options").show()}),e(".color-picker.background-color").each(function(){var t=e(this);""===t.val()?t.parents("table").find(".background-opacity").hide():t.parents("table").find(".background-opacity").show()}),e("tr.topleft, tr.topright, tr.bottomleft, tr.bottomright",i).hide(),e("#popup_theme_close_location").val()){case"topleft":e("tr.topleft",i).show();break;case"topright":e("tr.topright",i).show();break;case"bottomleft":e("tr.bottomleft",i).show();break;case"bottomright":e("tr.bottomright",i).show()}},retheme_popup:function(i){var o,s=e(".empreview .example-popup-overlay, #popmake-overlay"),r=e(".empreview .example-popup, #popmake-preview"),a=e(".title, .popmake-title",r),l=e(".content, .popmake-content",r),c=e(".close-popup, .popmake-close",r),p="yes"===i.container_boxshadow_inset?"inset ":"",u="yes"===i.close_boxshadow_inset?"inset ":"";switch(this.convert_theme_for_preview(i),popmake_google_fonts[i.title_font_family]!==n&&(o="//fonts.googleapis.com/css?family="+i.title_font_family,"normal"!==i.title_font_weight&&(o+=":"+i.title_font_weight),"italic"===i.title_font_style&&(o.indexOf(":")===-1&&(o+=":"),o+="italic"),e("body").append('<link href="'+o+'" rel="stylesheet" type="text/css">')),popmake_google_fonts[i.content_font_family]!==n&&(o="//fonts.googleapis.com/css?family="+i.content_font_family,"normal"!==i.content_font_weight&&(o+=":"+i.content_font_weight),"italic"===i.content_font_style&&(o.indexOf(":")===-1&&(o+=":"),o+="italic"),e("body").append('<link href="'+o+'" rel="stylesheet" type="text/css">')),popmake_google_fonts[i.close_font_family]!==n&&(o="//fonts.googleapis.com/css?family="+i.close_font_family,"normal"!==i.close_font_weight&&(o+=":"+i.close_font_weight),"italic"===i.close_font_style&&(o.indexOf(":")===-1&&(o+=":"),o+="italic"),e("body").append('<link href="'+o+'" rel="stylesheet" type="text/css">')),s.removeAttr("style").css({backgroundColor:PUMUtils.convert_hex(i.overlay_background_color,i.overlay_background_opacity)}),r.removeAttr("style").css({padding:i.container_padding+"px",backgroundColor:PUMUtils.convert_hex(i.container_background_color,i.container_background_opacity),borderStyle:i.container_border_style,borderColor:i.container_border_color,borderWidth:i.container_border_width+"px",borderRadius:i.container_border_radius+"px",boxShadow:p+i.container_boxshadow_horizontal+"px "+i.container_boxshadow_vertical+"px "+i.container_boxshadow_blur+"px "+i.container_boxshadow_spread+"px "+PUMUtils.convert_hex(i.container_boxshadow_color,i.container_boxshadow_opacity)}),a.removeAttr("style").css({color:i.title_font_color,lineHeight:i.title_line_height+"px",fontSize:i.title_font_size+"px",fontFamily:i.title_font_family,fontStyle:i.title_font_style,fontWeight:i.title_font_weight,textAlign:i.title_text_align,textShadow:i.title_textshadow_horizontal+"px "+i.title_textshadow_vertical+"px "+i.title_textshadow_blur+"px "+PUMUtils.convert_hex(i.title_textshadow_color,i.title_textshadow_opacity)}),l.removeAttr("style").css({color:i.content_font_color,fontFamily:i.content_font_family,fontStyle:i.content_font_style,fontWeight:i.content_font_weight}),c.html(i.close_text).removeAttr("style").css({padding:i.close_padding+"px",height:i.close_height>0?i.close_height+"px":"auto",width:i.close_width>0?i.close_width+"px":"auto",backgroundColor:PUMUtils.convert_hex(i.close_background_color,i.close_background_opacity),color:i.close_font_color,lineHeight:i.close_line_height+"px",fontSize:i.close_font_size+"px",fontFamily:i.close_font_family,fontWeight:i.close_font_weight,fontStyle:i.close_font_style,borderStyle:i.close_border_style,borderColor:i.close_border_color,borderWidth:i.close_border_width+"px",borderRadius:i.close_border_radius+"px",boxShadow:u+i.close_boxshadow_horizontal+"px "+i.close_boxshadow_vertical+"px "+i.close_boxshadow_blur+"px "+i.close_boxshadow_spread+"px "+PUMUtils.convert_hex(i.close_boxshadow_color,i.close_boxshadow_opacity),textShadow:i.close_textshadow_horizontal+"px "+i.close_textshadow_vertical+"px "+i.close_textshadow_blur+"px "+PUMUtils.convert_hex(i.close_textshadow_color,i.close_textshadow_opacity)}),i.close_location){case"topleft":c.css({top:i.close_position_top+"px",left:i.close_position_left+"px"});break;case"topright":c.css({top:i.close_position_top+"px",right:i.close_position_right+"px"});break;case"bottomleft":c.css({bottom:i.close_position_bottom+"px",left:i.close_position_left+"px"});break;case"bottomright":c.css({bottom:i.close_position_bottom+"px",right:i.close_position_right+"px"})}e(t).trigger("popmake-admin-retheme",[i])}},i.ready(function(){PopMakeAdmin.init(),i.trigger("pum_init")})}(jQuery,document);
1
  function pumSelected(e,t,n){"use strict";var i=!1;return"object"==typeof e&&"string"==typeof t&&jQuery.inArray(t,e)!==-1?i=!0:"object"==typeof t&&"string"==typeof e&&jQuery.inArray(e,t)!==-1?i=!0:e===t&&(i=!0),void 0!==n&&n?i?' selected="selected"':"":i}function pumChecked(e,t,n){"use strict";var i=!1;return"object"==typeof e&&"string"==typeof t&&jQuery.inArray(t,e)!==-1?i=!0:"object"==typeof t&&"string"==typeof e&&jQuery.inArray(e,t)!==-1?i=!0:e===t&&(i=!0),void 0!==n&&n?i?' checked="checked"':"":i}!function(e){"function"==typeof define&&void 0!==define.amd&&define.amd?define(["jquery"],e):e("object"==typeof exports?require("jquery"):jQuery)}(function(e){var t=function(){if(e&&e.fn&&e.fn.pumselect2&&e.fn.pumselect2.amd)var t=e.fn.pumselect2.amd;var t;return function(){if(!t||!t.requirejs){t?n=t:t={};var e,n,i;!function(t){function o(e,t){return b.call(e,t)}function s(e,t){var n,i,o,s,r,a,l,c,p,u,d,h=t&&t.split("/"),f=v.map,m=f&&f["*"]||{};if(e&&"."===e.charAt(0))if(t){for(e=e.split("/"),r=e.length-1,v.nodeIdCompat&&k.test(e[r])&&(e[r]=e[r].replace(k,"")),e=h.slice(0,h.length-1).concat(e),p=0;p<e.length;p+=1)if(d=e[p],"."===d)e.splice(p,1),p-=1;else if(".."===d){if(1===p&&(".."===e[2]||".."===e[0]))break;p>0&&(e.splice(p-1,2),p-=2)}e=e.join("/")}else 0===e.indexOf("./")&&(e=e.substring(2));if((h||m)&&f){for(n=e.split("/"),p=n.length;p>0;p-=1){if(i=n.slice(0,p).join("/"),h)for(u=h.length;u>0;u-=1)if(o=f[h.slice(0,u).join("/")],o&&(o=o[i])){s=o,a=p;break}if(s)break;!l&&m&&m[i]&&(l=m[i],c=p)}!s&&l&&(s=l,a=c),s&&(n.splice(0,a,s),e=n.join("/"))}return e}function r(e,n){return function(){var i=w.call(arguments,0);return"string"!=typeof i[0]&&1===i.length&&i.push(null),h.apply(t,i.concat([e,n]))}}function a(e){return function(t){return s(t,e)}}function l(e){return function(t){g[e]=t}}function c(e){if(o(_,e)){var n=_[e];delete _[e],y[e]=!0,d.apply(t,n)}if(!o(g,e)&&!o(y,e))throw new Error("No "+e);return g[e]}function p(e){var t,n=e?e.indexOf("!"):-1;return n>-1&&(t=e.substring(0,n),e=e.substring(n+1,e.length)),[t,e]}function u(e){return function(){return v&&v.config&&v.config[e]||{}}}var d,h,f,m,g={},_={},v={},y={},b=Object.prototype.hasOwnProperty,w=[].slice,k=/\.js$/;f=function(e,t){var n,i=p(e),o=i[0];return e=i[1],o&&(o=s(o,t),n=c(o)),o?e=n&&n.normalize?n.normalize(e,a(t)):s(e,t):(e=s(e,t),i=p(e),o=i[0],e=i[1],o&&(n=c(o))),{f:o?o+"!"+e:e,n:e,pr:o,p:n}},m={require:function(e){return r(e)},exports:function(e){var t=g[e];return"undefined"!=typeof t?t:g[e]={}},module:function(e){return{id:e,uri:"",exports:g[e],config:u(e)}}},d=function(e,n,i,s){var a,p,u,d,h,v,b=[],w=typeof i;if(s=s||e,"undefined"===w||"function"===w){for(n=!n.length&&i.length?["require","exports","module"]:n,h=0;h<n.length;h+=1)if(d=f(n[h],s),p=d.f,"require"===p)b[h]=m.require(e);else if("exports"===p)b[h]=m.exports(e),v=!0;else if("module"===p)a=b[h]=m.module(e);else if(o(g,p)||o(_,p)||o(y,p))b[h]=c(p);else{if(!d.p)throw new Error(e+" missing "+p);d.p.load(d.n,r(s,!0),l(p),{}),b[h]=g[p]}u=i?i.apply(g[e],b):void 0,e&&(a&&a.exports!==t&&a.exports!==g[e]?g[e]=a.exports:u===t&&v||(g[e]=u))}else e&&(g[e]=i)},e=n=h=function(e,n,i,o,s){if("string"==typeof e)return m[e]?m[e](n):c(f(e,n).f);if(!e.splice){if(v=e,v.deps&&h(v.deps,v.callback),!n)return;n.splice?(e=n,n=i,i=null):e=t}return n=n||function(){},"function"==typeof i&&(i=o,o=s),o?d(t,e,n,i):setTimeout(function(){d(t,e,n,i)},4),h},h.config=function(e){return h(e)},e._defined=g,i=function(e,t,n){if("string"!=typeof e)throw new Error("See almond README: incorrect module build, no module name");t.splice||(n=t,t=[]),o(g,e)||o(_,e)||(_[e]=[e,t,n])},i.amd={jQuery:!0}}(),t.requirejs=e,t.require=n,t.define=i}}(),t.define("almond",function(){}),t.define("jquery",[],function(){var t=e||$;return null==t&&console&&console.error&&console.error("Select2: An instance of jQuery or a jQuery-compatible library was not found. Make sure that you are including jQuery before Select2 on your web page."),t}),t.define("pumselect2/utils",["jquery"],function(e){function t(e){var t=e.prototype,n=[];for(var i in t){var o=t[i];"function"==typeof o&&"constructor"!==i&&n.push(i)}return n}var n={};n.Extend=function(e,t){function n(){this.constructor=e}var i={}.hasOwnProperty;for(var o in t)i.call(t,o)&&(e[o]=t[o]);return n.prototype=t.prototype,e.prototype=new n,e.__super__=t.prototype,e},n.Decorate=function(e,n){function i(){var t=Array.prototype.unshift,i=n.prototype.constructor.length,o=e.prototype.constructor;i>0&&(t.call(arguments,e.prototype.constructor),o=n.prototype.constructor),o.apply(this,arguments)}function o(){this.constructor=i}var s=t(n),r=t(e);n.displayName=e.displayName,i.prototype=new o;for(var a=0;a<r.length;a++){var l=r[a];i.prototype[l]=e.prototype[l]}for(var c=(function(e){var t=function(){};e in i.prototype&&(t=i.prototype[e]);var o=n.prototype[e];return function(){var e=Array.prototype.unshift;return e.call(arguments,t),o.apply(this,arguments)}}),p=0;p<s.length;p++){var u=s[p];i.prototype[u]=c(u)}return i};var i=function(){this.listeners={}};return i.prototype.on=function(e,t){this.listeners=this.listeners||{},e in this.listeners?this.listeners[e].push(t):this.listeners[e]=[t]},i.prototype.trigger=function(e){var t=Array.prototype.slice;this.listeners=this.listeners||{},e in this.listeners&&this.invoke(this.listeners[e],t.call(arguments,1)),"*"in this.listeners&&this.invoke(this.listeners["*"],arguments)},i.prototype.invoke=function(e,t){for(var n=0,i=e.length;n<i;n++)e[n].apply(this,t)},n.Observable=i,n.generateChars=function(e){for(var t="",n=0;n<e;n++){var i=Math.floor(36*Math.random());t+=i.toString(36)}return t},n.bind=function(e,t){return function(){e.apply(t,arguments)}},n._convertData=function(e){for(var t in e){var n=t.split("-"),i=e;if(1!==n.length){for(var o=0;o<n.length;o++){var s=n[o];s=s.substring(0,1).toLowerCase()+s.substring(1),s in i||(i[s]={}),o==n.length-1&&(i[s]=e[t]),i=i[s]}delete e[t]}}return e},n.hasScroll=function(t,n){var i=e(n),o=n.style.overflowX,s=n.style.overflowY;return(o!==s||"hidden"!==s&&"visible"!==s)&&("scroll"===o||"scroll"===s||(i.innerHeight()<n.scrollHeight||i.innerWidth()<n.scrollWidth))},n.escapeMarkup=function(e){var t={"\\":"&#92;","&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#47;"};return"string"!=typeof e?e:String(e).replace(/[&<>"'\/\\]/g,function(e){return t[e]})},n.appendMany=function(t,n){if("1.7"===e.fn.jquery.substr(0,3)){var i=e();e.map(n,function(e){i=i.add(e)}),n=i}t.append(n)},n}),t.define("pumselect2/results",["jquery","./utils"],function(e,t){function n(e,t,i){this.$element=e,this.data=i,this.options=t,n.__super__.constructor.call(this)}return t.Extend(n,t.Observable),n.prototype.render=function(){var t=e('<ul class="pumselect2-results__options" role="tree"></ul>');return this.options.get("multiple")&&t.attr("aria-multiselectable","true"),this.$results=t,t},n.prototype.clear=function(){this.$results.empty()},n.prototype.displayMessage=function(t){var n=this.options.get("escapeMarkup");this.clear(),this.hideLoading();var i=e('<li role="treeitem" aria-live="assertive" class="pumselect2-results__option"></li>'),o=this.options.get("translations").get(t.message);i.append(n(o(t.args))),i[0].className+=" pumselect2-results__message",this.$results.append(i)},n.prototype.hideMessages=function(){this.$results.find(".pumselect2-results__message").remove()},n.prototype.append=function(e){this.hideLoading();var t=[];if(null==e.results||0===e.results.length)return void(0===this.$results.children().length&&this.trigger("results:message",{message:"noResults"}));e.results=this.sort(e.results);for(var n=0;n<e.results.length;n++){var i=e.results[n],o=this.option(i);t.push(o)}this.$results.append(t)},n.prototype.position=function(e,t){var n=t.find(".pumselect2-results");n.append(e)},n.prototype.sort=function(e){var t=this.options.get("sorter");return t(e)},n.prototype.setClasses=function(){var t=this;this.data.current(function(n){var i=e.map(n,function(e){return e.id.toString()}),o=t.$results.find(".pumselect2-results__option[aria-selected]");o.each(function(){var t=e(this),n=e.data(this,"data"),o=""+n.id;null!=n.element&&n.element.selected||null==n.element&&e.inArray(o,i)>-1?t.attr("aria-selected","true"):t.attr("aria-selected","false")});var s=o.filter("[aria-selected=true]");s.length>0?s.first().trigger("mouseenter"):o.first().trigger("mouseenter")})},n.prototype.showLoading=function(e){this.hideLoading();var t=this.options.get("translations").get("searching"),n={disabled:!0,loading:!0,text:t(e)},i=this.option(n);i.className+=" loading-results",this.$results.prepend(i)},n.prototype.hideLoading=function(){this.$results.find(".loading-results").remove()},n.prototype.option=function(t){var n=document.createElement("li");n.className="pumselect2-results__option";var i={role:"treeitem","aria-selected":"false"};t.disabled&&(delete i["aria-selected"],i["aria-disabled"]="true"),null==t.id&&delete i["aria-selected"],null!=t._resultId&&(n.id=t._resultId),t.title&&(n.title=t.title),t.children&&(i.role="group",i["aria-label"]=t.text,delete i["aria-selected"]);for(var o in i){var s=i[o];n.setAttribute(o,s)}if(t.children){var r=e(n),a=document.createElement("strong");a.className="pumselect2-results__group";e(a);this.template(t,a);for(var l=[],c=0;c<t.children.length;c++){var p=t.children[c],u=this.option(p);l.push(u)}var d=e("<ul></ul>",{"class":"pumselect2-results__options pumselect2-results__options--nested"});d.append(l),r.append(a),r.append(d)}else this.template(t,n);return e.data(n,"data",t),n},n.prototype.bind=function(t,n){var i=this,o=t.id+"-results";this.$results.attr("id",o),t.on("results:all",function(e){i.clear(),i.append(e.data),t.isOpen()&&i.setClasses()}),t.on("results:append",function(e){i.append(e.data),t.isOpen()&&i.setClasses()}),t.on("query",function(e){i.hideMessages(),i.showLoading(e)}),t.on("select",function(){t.isOpen()&&i.setClasses()}),t.on("unselect",function(){t.isOpen()&&i.setClasses()}),t.on("open",function(){i.$results.attr("aria-expanded","true"),i.$results.attr("aria-hidden","false"),i.setClasses(),i.ensureHighlightVisible()}),t.on("close",function(){i.$results.attr("aria-expanded","false"),i.$results.attr("aria-hidden","true"),i.$results.removeAttr("aria-activedescendant")}),t.on("results:toggle",function(){var e=i.getHighlightedResults();0!==e.length&&e.trigger("mouseup")}),t.on("results:select",function(){var e=i.getHighlightedResults();if(0!==e.length){var t=e.data("data");"true"==e.attr("aria-selected")?i.trigger("close",{}):i.trigger("select",{data:t})}}),t.on("results:previous",function(){var e=i.getHighlightedResults(),t=i.$results.find("[aria-selected]"),n=t.index(e);if(0!==n){var o=n-1;0===e.length&&(o=0);var s=t.eq(o);s.trigger("mouseenter");var r=i.$results.offset().top,a=s.offset().top,l=i.$results.scrollTop()+(a-r);0===o?i.$results.scrollTop(0):a-r<0&&i.$results.scrollTop(l)}}),t.on("results:next",function(){var e=i.getHighlightedResults(),t=i.$results.find("[aria-selected]"),n=t.index(e),o=n+1;if(!(o>=t.length)){var s=t.eq(o);s.trigger("mouseenter");var r=i.$results.offset().top+i.$results.outerHeight(!1),a=s.offset().top+s.outerHeight(!1),l=i.$results.scrollTop()+a-r;0===o?i.$results.scrollTop(0):a>r&&i.$results.scrollTop(l)}}),t.on("results:focus",function(e){e.element.addClass("pumselect2-results__option--highlighted")}),t.on("results:message",function(e){i.displayMessage(e)}),e.fn.mousewheel&&this.$results.on("mousewheel",function(e){var t=i.$results.scrollTop(),n=i.$results.get(0).scrollHeight-t+e.deltaY,o=e.deltaY>0&&t-e.deltaY<=0,s=e.deltaY<0&&n<=i.$results.height();o?(i.$results.scrollTop(0),e.preventDefault(),e.stopPropagation()):s&&(i.$results.scrollTop(i.$results.get(0).scrollHeight-i.$results.height()),e.preventDefault(),e.stopPropagation())}),this.$results.on("mouseup",".pumselect2-results__option[aria-selected]",function(t){var n=e(this),o=n.data("data");return"true"===n.attr("aria-selected")?void(i.options.get("multiple")?i.trigger("unselect",{originalEvent:t,data:o}):i.trigger("close",{})):void i.trigger("select",{originalEvent:t,data:o})}),this.$results.on("mouseenter",".pumselect2-results__option[aria-selected]",function(t){var n=e(this).data("data");i.getHighlightedResults().removeClass("pumselect2-results__option--highlighted"),i.trigger("results:focus",{data:n,element:e(this)})})},n.prototype.getHighlightedResults=function(){var e=this.$results.find(".pumselect2-results__option--highlighted");return e},n.prototype.destroy=function(){this.$results.remove()},n.prototype.ensureHighlightVisible=function(){var e=this.getHighlightedResults();if(0!==e.length){var t=this.$results.find("[aria-selected]"),n=t.index(e),i=this.$results.offset().top,o=e.offset().top,s=this.$results.scrollTop()+(o-i),r=o-i;s-=2*e.outerHeight(!1),n<=2?this.$results.scrollTop(0):(r>this.$results.outerHeight()||r<0)&&this.$results.scrollTop(s)}},n.prototype.template=function(t,n){var i=this.options.get("templateResult"),o=this.options.get("escapeMarkup"),s=i(t,n);null==s?n.style.display="none":"string"==typeof s?n.innerHTML=o(s):e(n).append(s)},n}),t.define("pumselect2/keys",[],function(){var e={BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46};return e}),t.define("pumselect2/selection/base",["jquery","../utils","../keys"],function(e,t,n){function i(e,t){this.$element=e,this.options=t,i.__super__.constructor.call(this)}return t.Extend(i,t.Observable),i.prototype.render=function(){var t=e('<span class="pumselect2-selection" role="combobox" aria-haspopup="true" aria-expanded="false"></span>');return this._tabindex=0,null!=this.$element.data("old-tabindex")?this._tabindex=this.$element.data("old-tabindex"):null!=this.$element.attr("tabindex")&&(this._tabindex=this.$element.attr("tabindex")),t.attr("title",this.$element.attr("title")),t.attr("tabindex",this._tabindex),this.$selection=t,t},i.prototype.bind=function(e,t){var i=this,o=(e.id+"-container",e.id+"-results");this.container=e,this.$selection.on("focus",function(e){i.trigger("focus",e)}),this.$selection.on("blur",function(e){i._handleBlur(e)}),this.$selection.on("keydown",function(e){i.trigger("keypress",e),e.which===n.SPACE&&e.preventDefault()}),e.on("results:focus",function(e){i.$selection.attr("aria-activedescendant",e.data._resultId)}),e.on("selection:update",function(e){i.update(e.data)}),e.on("open",function(){i.$selection.attr("aria-expanded","true"),i.$selection.attr("aria-owns",o),i._attachCloseHandler(e)}),e.on("close",function(){i.$selection.attr("aria-expanded","false"),i.$selection.removeAttr("aria-activedescendant"),i.$selection.removeAttr("aria-owns"),i.$selection.focus(),i._detachCloseHandler(e)}),e.on("enable",function(){i.$selection.attr("tabindex",i._tabindex)}),e.on("disable",function(){i.$selection.attr("tabindex","-1")})},i.prototype._handleBlur=function(t){var n=this;window.setTimeout(function(){document.activeElement==n.$selection[0]||e.contains(n.$selection[0],document.activeElement)||n.trigger("blur",t)},1)},i.prototype._attachCloseHandler=function(t){e(document.body).on("mousedown.pumselect2."+t.id,function(t){var n=e(t.target),i=n.closest(".pumselect2"),o=e(".pumselect2.pumselect2-container--open");o.each(function(){var t=e(this);if(this!=i[0]){var n=t.data("element");n.pumselect2("close")}})})},i.prototype._detachCloseHandler=function(t){e(document.body).off("mousedown.pumselect2."+t.id)},i.prototype.position=function(e,t){var n=t.find(".selection");n.append(e)},i.prototype.destroy=function(){this._detachCloseHandler(this.container)},i.prototype.update=function(e){throw new Error("The `update` method must be defined in child classes.")},i}),t.define("pumselect2/selection/single",["jquery","./base","../utils","../keys"],function(e,t,n,i){function o(){o.__super__.constructor.apply(this,arguments)}return n.Extend(o,t),o.prototype.render=function(){var e=o.__super__.render.call(this);return e.addClass("pumselect2-selection--single"),e.html('<span class="pumselect2-selection__rendered"></span><span class="pumselect2-selection__arrow" role="presentation"><b role="presentation"></b></span>'),e},o.prototype.bind=function(e,t){var n=this;o.__super__.bind.apply(this,arguments);var i=e.id+"-container";this.$selection.find(".pumselect2-selection__rendered").attr("id",i),this.$selection.attr("aria-labelledby",i),this.$selection.on("mousedown",function(e){1===e.which&&n.trigger("toggle",{originalEvent:e})}),this.$selection.on("focus",function(e){}),this.$selection.on("blur",function(e){}),e.on("selection:update",function(e){n.update(e.data)})},o.prototype.clear=function(){this.$selection.find(".pumselect2-selection__rendered").empty()},o.prototype.display=function(e,t){var n=this.options.get("templateSelection"),i=this.options.get("escapeMarkup");return i(n(e,t))},o.prototype.selectionContainer=function(){return e("<span></span>")},o.prototype.update=function(e){if(0===e.length)return void this.clear();var t=e[0],n=this.$selection.find(".pumselect2-selection__rendered"),i=this.display(t,n);n.empty().append(i),n.prop("title",t.title||t.text)},o}),t.define("pumselect2/selection/multiple",["jquery","./base","../utils"],function(e,t,n){function i(e,t){i.__super__.constructor.apply(this,arguments)}return n.Extend(i,t),i.prototype.render=function(){var e=i.__super__.render.call(this);return e.addClass("pumselect2-selection--multiple"),e.html('<ul class="pumselect2-selection__rendered"></ul>'),e},i.prototype.bind=function(t,n){var o=this;i.__super__.bind.apply(this,arguments),this.$selection.on("click",function(e){o.trigger("toggle",{originalEvent:e})}),this.$selection.on("click",".pumselect2-selection__choice__remove",function(t){if(!o.options.get("disabled")){var n=e(this),i=n.parent(),s=i.data("data");o.trigger("unselect",{originalEvent:t,data:s})}})},i.prototype.clear=function(){this.$selection.find(".pumselect2-selection__rendered").empty()},i.prototype.display=function(e,t){var n=this.options.get("templateSelection"),i=this.options.get("escapeMarkup");return i(n(e,t))},i.prototype.selectionContainer=function(){var t=e('<li class="pumselect2-selection__choice"><span class="pumselect2-selection__choice__remove" role="presentation">&times;</span></li>');return t},i.prototype.update=function(e){if(this.clear(),0!==e.length){for(var t=[],i=0;i<e.length;i++){var o=e[i],s=this.selectionContainer(),r=this.display(o,s);s.append(r),s.prop("title",o.title||o.text),s.data("data",o),t.push(s)}var a=this.$selection.find(".pumselect2-selection__rendered");n.appendMany(a,t)}},i}),t.define("pumselect2/selection/placeholder",["../utils"],function(e){function t(e,t,n){this.placeholder=this.normalizePlaceholder(n.get("placeholder")),e.call(this,t,n)}return t.prototype.normalizePlaceholder=function(e,t){return"string"==typeof t&&(t={id:"",text:t}),t},t.prototype.createPlaceholder=function(e,t){var n=this.selectionContainer();return n.html(this.display(t)),n.addClass("pumselect2-selection__placeholder").removeClass("pumselect2-selection__choice"),n},t.prototype.update=function(e,t){var n=1==t.length&&t[0].id!=this.placeholder.id,i=t.length>1;if(i||n)return e.call(this,t);this.clear();var o=this.createPlaceholder(this.placeholder);this.$selection.find(".pumselect2-selection__rendered").append(o)},t}),t.define("pumselect2/selection/allowClear",["jquery","../keys"],function(e,t){function n(){}return n.prototype.bind=function(e,t,n){var i=this;e.call(this,t,n),null==this.placeholder&&this.options.get("debug")&&window.console&&console.error&&console.error("Select2: The `allowClear` option should be used in combination with the `placeholder` option."),this.$selection.on("mousedown",".pumselect2-selection__clear",function(e){i._handleClear(e)}),t.on("keypress",function(e){i._handleKeyboardClear(e,t)})},n.prototype._handleClear=function(e,t){if(!this.options.get("disabled")){var n=this.$selection.find(".pumselect2-selection__clear");if(0!==n.length){t.stopPropagation();for(var i=n.data("data"),o=0;o<i.length;o++){var s={data:i[o]};if(this.trigger("unselect",s),s.prevented)return}this.$element.val(this.placeholder.id).trigger("change"),this.trigger("toggle",{})}}},n.prototype._handleKeyboardClear=function(e,n,i){i.isOpen()||n.which!=t.DELETE&&n.which!=t.BACKSPACE||this._handleClear(n)},n.prototype.update=function(t,n){if(t.call(this,n),!(this.$selection.find(".pumselect2-selection__placeholder").length>0||0===n.length)){var i=e('<span class="pumselect2-selection__clear">&times;</span>');i.data("data",n),this.$selection.find(".pumselect2-selection__rendered").prepend(i)}},n}),t.define("pumselect2/selection/search",["jquery","../utils","../keys"],function(e,t,n){function i(e,t,n){e.call(this,t,n)}return i.prototype.render=function(t){var n=e('<li class="pumselect2-search pumselect2-search--inline"><input class="pumselect2-search__field" type="search" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" role="textbox" aria-autocomplete="list" /></li>');this.$searchContainer=n,this.$search=n.find("input");var i=t.call(this);return this._transferTabIndex(),i},i.prototype.bind=function(e,t,i){var o=this;e.call(this,t,i),t.on("open",function(){o.$search.trigger("focus")}),t.on("close",function(){o.$search.val(""),o.$search.removeAttr("aria-activedescendant"),o.$search.trigger("focus")}),t.on("enable",function(){o.$search.prop("disabled",!1),o._transferTabIndex()}),t.on("disable",function(){o.$search.prop("disabled",!0)}),t.on("focus",function(e){o.$search.trigger("focus")}),t.on("results:focus",function(e){o.$search.attr("aria-activedescendant",e.id)}),this.$selection.on("focusin",".pumselect2-search--inline",function(e){o.trigger("focus",e)}),this.$selection.on("focusout",".pumselect2-search--inline",function(e){o._handleBlur(e)}),this.$selection.on("keydown",".pumselect2-search--inline",function(e){e.stopPropagation(),o.trigger("keypress",e),o._keyUpPrevented=e.isDefaultPrevented();var t=e.which;if(t===n.BACKSPACE&&""===o.$search.val()){var i=o.$searchContainer.prev(".pumselect2-selection__choice");if(i.length>0){var s=i.data("data");o.searchRemoveChoice(s),e.preventDefault()}}});var s=document.documentMode,r=s&&s<=11;this.$selection.on("input.searchcheck",".pumselect2-search--inline",function(e){return r?void o.$selection.off("input.search input.searchcheck"):void o.$selection.off("keyup.search")}),this.$selection.on("keyup.search input.search",".pumselect2-search--inline",function(e){if(r&&"input"===e.type)return void o.$selection.off("input.search input.searchcheck");var t=e.which;t!=n.SHIFT&&t!=n.CTRL&&t!=n.ALT&&t!=n.TAB&&o.handleSearch(e)})},i.prototype._transferTabIndex=function(e){this.$search.attr("tabindex",this.$selection.attr("tabindex")),this.$selection.attr("tabindex","-1")},i.prototype.createPlaceholder=function(e,t){this.$search.attr("placeholder",t.text)},i.prototype.update=function(e,t){var n=this.$search[0]==document.activeElement;this.$search.attr("placeholder",""),e.call(this,t),this.$selection.find(".pumselect2-selection__rendered").append(this.$searchContainer),this.resizeSearch(),n&&this.$search.focus()},i.prototype.handleSearch=function(){if(this.resizeSearch(),!this._keyUpPrevented){var e=this.$search.val();this.trigger("query",{term:e})}this._keyUpPrevented=!1},i.prototype.searchRemoveChoice=function(e,t){this.trigger("unselect",{data:t}),this.$search.val(t.text),this.handleSearch()},i.prototype.resizeSearch=function(){this.$search.css("width","25px");var e="";if(""!==this.$search.attr("placeholder"))e=this.$selection.find(".pumselect2-selection__rendered").innerWidth();else{var t=this.$search.val().length+1;e=.75*t+"em"}this.$search.css("width",e)},i}),t.define("pumselect2/selection/eventRelay",["jquery"],function(e){function t(){}return t.prototype.bind=function(t,n,i){var o=this,s=["open","opening","close","closing","select","selecting","unselect","unselecting"],r=["opening","closing","selecting","unselecting"];t.call(this,n,i),n.on("*",function(t,n){if(e.inArray(t,s)!==-1){n=n||{};var i=e.Event("pumselect2:"+t,{params:n});o.$element.trigger(i),e.inArray(t,r)!==-1&&(n.prevented=i.isDefaultPrevented())}})},t}),t.define("pumselect2/translation",["jquery","require"],function(e,t){function n(e){this.dict=e||{}}return n.prototype.all=function(){return this.dict},n.prototype.get=function(e){return this.dict[e]},n.prototype.extend=function(t){this.dict=e.extend({},t.all(),this.dict)},n._cache={},n.loadPath=function(e){if(!(e in n._cache)){var i=t(e);n._cache[e]=i}return new n(n._cache[e])},n}),t.define("pumselect2/diacritics",[],function(){var e={"Ⓐ":"A","A":"A","À":"A","Á":"A","Â":"A","Ầ":"A","Ấ":"A","Ẫ":"A","Ẩ":"A","Ã":"A","Ā":"A","Ă":"A","Ằ":"A","Ắ":"A","Ẵ":"A","Ẳ":"A","Ȧ":"A","Ǡ":"A","Ä":"A","Ǟ":"A","Ả":"A","Å":"A","Ǻ":"A","Ǎ":"A","Ȁ":"A","Ȃ":"A","Ạ":"A","Ậ":"A","Ặ":"A","Ḁ":"A","Ą":"A","Ⱥ":"A","Ɐ":"A","Ꜳ":"AA","Æ":"AE","Ǽ":"AE","Ǣ":"AE","Ꜵ":"AO","Ꜷ":"AU","Ꜹ":"AV","Ꜻ":"AV","Ꜽ":"AY","Ⓑ":"B","B":"B","Ḃ":"B","Ḅ":"B","Ḇ":"B","Ƀ":"B","Ƃ":"B","Ɓ":"B","Ⓒ":"C","C":"C","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","Ç":"C","Ḉ":"C","Ƈ":"C","Ȼ":"C","Ꜿ":"C","Ⓓ":"D","D":"D","Ḋ":"D","Ď":"D","Ḍ":"D","Ḑ":"D","Ḓ":"D","Ḏ":"D","Đ":"D","Ƌ":"D","Ɗ":"D","Ɖ":"D","Ꝺ":"D","DZ":"DZ","DŽ":"DZ","Dz":"Dz","Dž":"Dz","Ⓔ":"E","E":"E","È":"E","É":"E","Ê":"E","Ề":"E","Ế":"E","Ễ":"E","Ể":"E","Ẽ":"E","Ē":"E","Ḕ":"E","Ḗ":"E","Ĕ":"E","Ė":"E","Ë":"E","Ẻ":"E","Ě":"E","Ȅ":"E","Ȇ":"E","Ẹ":"E","Ệ":"E","Ȩ":"E","Ḝ":"E","Ę":"E","Ḙ":"E","Ḛ":"E","Ɛ":"E","Ǝ":"E","Ⓕ":"F","F":"F","Ḟ":"F","Ƒ":"F","Ꝼ":"F","Ⓖ":"G","G":"G","Ǵ":"G","Ĝ":"G","Ḡ":"G","Ğ":"G","Ġ":"G","Ǧ":"G","Ģ":"G","Ǥ":"G","Ɠ":"G","Ꞡ":"G","Ᵹ":"G","Ꝿ":"G","Ⓗ":"H","H":"H","Ĥ":"H","Ḣ":"H","Ḧ":"H","Ȟ":"H","Ḥ":"H","Ḩ":"H","Ḫ":"H","Ħ":"H","Ⱨ":"H","Ⱶ":"H","Ɥ":"H","Ⓘ":"I","I":"I","Ì":"I","Í":"I","Î":"I","Ĩ":"I","Ī":"I","Ĭ":"I","İ":"I","Ï":"I","Ḯ":"I","Ỉ":"I","Ǐ":"I","Ȉ":"I","Ȋ":"I","Ị":"I","Į":"I","Ḭ":"I","Ɨ":"I","Ⓙ":"J","J":"J","Ĵ":"J","Ɉ":"J","Ⓚ":"K","K":"K","Ḱ":"K","Ǩ":"K","Ḳ":"K","Ķ":"K","Ḵ":"K","Ƙ":"K","Ⱪ":"K","Ꝁ":"K","Ꝃ":"K","Ꝅ":"K","Ꞣ":"K","Ⓛ":"L","L":"L","Ŀ":"L","Ĺ":"L","Ľ":"L","Ḷ":"L","Ḹ":"L","Ļ":"L","Ḽ":"L","Ḻ":"L","Ł":"L","Ƚ":"L","Ɫ":"L","Ⱡ":"L","Ꝉ":"L","Ꝇ":"L","Ꞁ":"L","LJ":"LJ","Lj":"Lj","Ⓜ":"M","M":"M","Ḿ":"M","Ṁ":"M","Ṃ":"M","Ɱ":"M","Ɯ":"M","Ⓝ":"N","N":"N","Ǹ":"N","Ń":"N","Ñ":"N","Ṅ":"N","Ň":"N","Ṇ":"N","Ņ":"N","Ṋ":"N","Ṉ":"N","Ƞ":"N","Ɲ":"N","Ꞑ":"N","Ꞥ":"N","NJ":"NJ","Nj":"Nj","Ⓞ":"O","O":"O","Ò":"O","Ó":"O","Ô":"O","Ồ":"O","Ố":"O","Ỗ":"O","Ổ":"O","Õ":"O","Ṍ":"O","Ȭ":"O","Ṏ":"O","Ō":"O","Ṑ":"O","Ṓ":"O","Ŏ":"O","Ȯ":"O","Ȱ":"O","Ö":"O","Ȫ":"O","Ỏ":"O","Ő":"O","Ǒ":"O","Ȍ":"O","Ȏ":"O","Ơ":"O","Ờ":"O","Ớ":"O","Ỡ":"O","Ở":"O","Ợ":"O","Ọ":"O","Ộ":"O","Ǫ":"O","Ǭ":"O","Ø":"O","Ǿ":"O","Ɔ":"O","Ɵ":"O","Ꝋ":"O","Ꝍ":"O","Ƣ":"OI","Ꝏ":"OO","Ȣ":"OU","Ⓟ":"P","P":"P","Ṕ":"P","Ṗ":"P","Ƥ":"P","Ᵽ":"P","Ꝑ":"P","Ꝓ":"P","Ꝕ":"P","Ⓠ":"Q","Q":"Q","Ꝗ":"Q","Ꝙ":"Q","Ɋ":"Q","Ⓡ":"R","R":"R","Ŕ":"R","Ṙ":"R","Ř":"R","Ȑ":"R","Ȓ":"R","Ṛ":"R","Ṝ":"R","Ŗ":"R","Ṟ":"R","Ɍ":"R","Ɽ":"R","Ꝛ":"R","Ꞧ":"R","Ꞃ":"R","Ⓢ":"S","S":"S","ẞ":"S","Ś":"S","Ṥ":"S","Ŝ":"S","Ṡ":"S","Š":"S","Ṧ":"S","Ṣ":"S","Ṩ":"S","Ș":"S","Ş":"S","Ȿ":"S","Ꞩ":"S","Ꞅ":"S","Ⓣ":"T","T":"T","Ṫ":"T","Ť":"T","Ṭ":"T","Ț":"T","Ţ":"T","Ṱ":"T","Ṯ":"T","Ŧ":"T","Ƭ":"T","Ʈ":"T","Ⱦ":"T","Ꞇ":"T","Ꜩ":"TZ","Ⓤ":"U","U":"U","Ù":"U","Ú":"U","Û":"U","Ũ":"U","Ṹ":"U","Ū":"U","Ṻ":"U","Ŭ":"U","Ü":"U","Ǜ":"U","Ǘ":"U","Ǖ":"U","Ǚ":"U","Ủ":"U","Ů":"U","Ű":"U","Ǔ":"U","Ȕ":"U","Ȗ":"U","Ư":"U","Ừ":"U","Ứ":"U","Ữ":"U","Ử":"U","Ự":"U","Ụ":"U","Ṳ":"U","Ų":"U","Ṷ":"U","Ṵ":"U","Ʉ":"U","Ⓥ":"V","V":"V","Ṽ":"V","Ṿ":"V","Ʋ":"V","Ꝟ":"V","Ʌ":"V","Ꝡ":"VY","Ⓦ":"W","W":"W","Ẁ":"W","Ẃ":"W","Ŵ":"W","Ẇ":"W","Ẅ":"W","Ẉ":"W","Ⱳ":"W","Ⓧ":"X","X":"X","Ẋ":"X","Ẍ":"X","Ⓨ":"Y","Y":"Y","Ỳ":"Y","Ý":"Y","Ŷ":"Y","Ỹ":"Y","Ȳ":"Y","Ẏ":"Y","Ÿ":"Y","Ỷ":"Y","Ỵ":"Y","Ƴ":"Y","Ɏ":"Y","Ỿ":"Y","Ⓩ":"Z","Z":"Z","Ź":"Z","Ẑ":"Z","Ż":"Z","Ž":"Z","Ẓ":"Z","Ẕ":"Z","Ƶ":"Z","Ȥ":"Z","Ɀ":"Z","Ⱬ":"Z","Ꝣ":"Z","ⓐ":"a","a":"a","ẚ":"a","à":"a","á":"a","â":"a","ầ":"a","ấ":"a","ẫ":"a","ẩ":"a","ã":"a","ā":"a","ă":"a","ằ":"a","ắ":"a","ẵ":"a","ẳ":"a","ȧ":"a","ǡ":"a","ä":"a","ǟ":"a","ả":"a","å":"a","ǻ":"a","ǎ":"a","ȁ":"a","ȃ":"a","ạ":"a","ậ":"a","ặ":"a","ḁ":"a","ą":"a","ⱥ":"a","ɐ":"a","ꜳ":"aa","æ":"ae","ǽ":"ae","ǣ":"ae","ꜵ":"ao","ꜷ":"au","ꜹ":"av","ꜻ":"av","ꜽ":"ay","ⓑ":"b","b":"b","ḃ":"b","ḅ":"b","ḇ":"b","ƀ":"b","ƃ":"b","ɓ":"b","ⓒ":"c","c":"c","ć":"c","ĉ":"c","ċ":"c","č":"c","ç":"c","ḉ":"c","ƈ":"c","ȼ":"c","ꜿ":"c","ↄ":"c","ⓓ":"d","d":"d","ḋ":"d","ď":"d","ḍ":"d","ḑ":"d","ḓ":"d","ḏ":"d","đ":"d","ƌ":"d","ɖ":"d","ɗ":"d","ꝺ":"d","dz":"dz","dž":"dz","ⓔ":"e","e":"e","è":"e","é":"e","ê":"e","ề":"e","ế":"e","ễ":"e","ể":"e","ẽ":"e","ē":"e","ḕ":"e","ḗ":"e","ĕ":"e","ė":"e","ë":"e","ẻ":"e","ě":"e","ȅ":"e","ȇ":"e","ẹ":"e","ệ":"e","ȩ":"e","ḝ":"e","ę":"e","ḙ":"e","ḛ":"e","ɇ":"e","ɛ":"e","ǝ":"e","ⓕ":"f","f":"f","ḟ":"f","ƒ":"f","ꝼ":"f","ⓖ":"g","g":"g","ǵ":"g","ĝ":"g","ḡ":"g","ğ":"g","ġ":"g","ǧ":"g","ģ":"g","ǥ":"g","ɠ":"g","ꞡ":"g","ᵹ":"g","ꝿ":"g","ⓗ":"h","h":"h","ĥ":"h","ḣ":"h","ḧ":"h","ȟ":"h","ḥ":"h","ḩ":"h","ḫ":"h","ẖ":"h","ħ":"h","ⱨ":"h","ⱶ":"h","ɥ":"h","ƕ":"hv","ⓘ":"i","i":"i","ì":"i","í":"i","î":"i","ĩ":"i","ī":"i","ĭ":"i","ï":"i","ḯ":"i","ỉ":"i","ǐ":"i","ȉ":"i","ȋ":"i","ị":"i","į":"i","ḭ":"i","ɨ":"i","ı":"i","ⓙ":"j","j":"j","ĵ":"j","ǰ":"j","ɉ":"j","ⓚ":"k","k":"k","ḱ":"k","ǩ":"k","ḳ":"k","ķ":"k","ḵ":"k","ƙ":"k","ⱪ":"k","ꝁ":"k","ꝃ":"k","ꝅ":"k","ꞣ":"k","ⓛ":"l","l":"l","ŀ":"l","ĺ":"l","ľ":"l","ḷ":"l","ḹ":"l","ļ":"l","ḽ":"l","ḻ":"l","ſ":"l","ł":"l","ƚ":"l","ɫ":"l","ⱡ":"l","ꝉ":"l","ꞁ":"l","ꝇ":"l","lj":"lj","ⓜ":"m","m":"m","ḿ":"m","ṁ":"m","ṃ":"m","ɱ":"m","ɯ":"m","ⓝ":"n","n":"n","ǹ":"n","ń":"n","ñ":"n","ṅ":"n","ň":"n","ṇ":"n","ņ":"n","ṋ":"n","ṉ":"n","ƞ":"n","ɲ":"n","ʼn":"n","ꞑ":"n","ꞥ":"n","nj":"nj","ⓞ":"o","o":"o","ò":"o","ó":"o","ô":"o","ồ":"o","ố":"o","ỗ":"o","ổ":"o","õ":"o","ṍ":"o","ȭ":"o","ṏ":"o","ō":"o","ṑ":"o","ṓ":"o","ŏ":"o","ȯ":"o","ȱ":"o","ö":"o","ȫ":"o","ỏ":"o","ő":"o","ǒ":"o","ȍ":"o","ȏ":"o","ơ":"o","ờ":"o","ớ":"o","ỡ":"o","ở":"o","ợ":"o","ọ":"o","ộ":"o","ǫ":"o","ǭ":"o","ø":"o","ǿ":"o","ɔ":"o","ꝋ":"o","ꝍ":"o","ɵ":"o","ƣ":"oi","ȣ":"ou","ꝏ":"oo","ⓟ":"p","p":"p","ṕ":"p","ṗ":"p","ƥ":"p","ᵽ":"p","ꝑ":"p","ꝓ":"p","ꝕ":"p","ⓠ":"q","q":"q","ɋ":"q","ꝗ":"q","ꝙ":"q","ⓡ":"r","r":"r","ŕ":"r","ṙ":"r","ř":"r","ȑ":"r","ȓ":"r","ṛ":"r","ṝ":"r","ŗ":"r","ṟ":"r","ɍ":"r","ɽ":"r","ꝛ":"r","ꞧ":"r","ꞃ":"r","ⓢ":"s","s":"s","ß":"s","ś":"s","ṥ":"s","ŝ":"s","ṡ":"s","š":"s","ṧ":"s","ṣ":"s","ṩ":"s","ș":"s","ş":"s","ȿ":"s","ꞩ":"s","ꞅ":"s","ẛ":"s","ⓣ":"t","t":"t","ṫ":"t","ẗ":"t","ť":"t","ṭ":"t","ț":"t","ţ":"t","ṱ":"t","ṯ":"t","ŧ":"t","ƭ":"t","ʈ":"t","ⱦ":"t","ꞇ":"t","ꜩ":"tz","ⓤ":"u","u":"u","ù":"u","ú":"u","û":"u","ũ":"u","ṹ":"u","ū":"u","ṻ":"u","ŭ":"u","ü":"u","ǜ":"u","ǘ":"u","ǖ":"u","ǚ":"u","ủ":"u","ů":"u","ű":"u","ǔ":"u","ȕ":"u","ȗ":"u","ư":"u","ừ":"u","ứ":"u","ữ":"u","ử":"u","ự":"u","ụ":"u","ṳ":"u","ų":"u","ṷ":"u","ṵ":"u","ʉ":"u","ⓥ":"v","v":"v","ṽ":"v","ṿ":"v","ʋ":"v","ꝟ":"v","ʌ":"v","ꝡ":"vy","ⓦ":"w","w":"w","ẁ":"w","ẃ":"w","ŵ":"w","ẇ":"w","ẅ":"w","ẘ":"w","ẉ":"w","ⱳ":"w","ⓧ":"x","x":"x","ẋ":"x","ẍ":"x","ⓨ":"y","y":"y","ỳ":"y","ý":"y","ŷ":"y","ỹ":"y","ȳ":"y","ẏ":"y","ÿ":"y","ỷ":"y","ẙ":"y","ỵ":"y","ƴ":"y","ɏ":"y","ỿ":"y","ⓩ":"z","z":"z","ź":"z","ẑ":"z","ż":"z","ž":"z","ẓ":"z","ẕ":"z","ƶ":"z","ȥ":"z","ɀ":"z","ⱬ":"z","ꝣ":"z","Ά":"Α","Έ":"Ε","Ή":"Η","Ί":"Ι","Ϊ":"Ι","Ό":"Ο","Ύ":"Υ","Ϋ":"Υ","Ώ":"Ω","ά":"α","έ":"ε","ή":"η","ί":"ι","ϊ":"ι","ΐ":"ι","ό":"ο","ύ":"υ","ϋ":"υ","ΰ":"υ","ω":"ω","ς":"σ"};return e}),t.define("pumselect2/data/base",["../utils"],function(e){function t(e,n){t.__super__.constructor.call(this)}return e.Extend(t,e.Observable),t.prototype.current=function(e){throw new Error("The `current` method must be defined in child classes.")},t.prototype.query=function(e,t){throw new Error("The `query` method must be defined in child classes.")},t.prototype.bind=function(e,t){},t.prototype.destroy=function(){},t.prototype.generateResultId=function(t,n){var i=t.id+"-result-";return i+=e.generateChars(4),i+=null!=n.id?"-"+n.id.toString():"-"+e.generateChars(4)},t}),t.define("pumselect2/data/select",["./base","../utils","jquery"],function(e,t,n){
2
  function i(e,t){this.$element=e,this.options=t,i.__super__.constructor.call(this)}return t.Extend(i,e),i.prototype.current=function(e){var t=[],i=this;this.$element.find(":selected").each(function(){var e=n(this),o=i.item(e);t.push(o)}),e(t)},i.prototype.select=function(e){var t=this;if(e.selected=!0,n(e.element).is("option"))return e.element.selected=!0,void this.$element.trigger("change");if(this.$element.prop("multiple"))this.current(function(i){var o=[];e=[e],e.push.apply(e,i);for(var s=0;s<e.length;s++){var r=e[s].id;n.inArray(r,o)===-1&&o.push(r)}t.$element.val(o),t.$element.trigger("change")});else{var i=e.id;this.$element.val(i),this.$element.trigger("change")}},i.prototype.unselect=function(e){var t=this;if(this.$element.prop("multiple"))return e.selected=!1,n(e.element).is("option")?(e.element.selected=!1,void this.$element.trigger("change")):void this.current(function(i){for(var o=[],s=0;s<i.length;s++){var r=i[s].id;r!==e.id&&n.inArray(r,o)===-1&&o.push(r)}t.$element.val(o),t.$element.trigger("change")})},i.prototype.bind=function(e,t){var n=this;this.container=e,e.on("select",function(e){n.select(e.data)}),e.on("unselect",function(e){n.unselect(e.data)})},i.prototype.destroy=function(){this.$element.find("*").each(function(){n.removeData(this,"data")})},i.prototype.query=function(e,t){var i=[],o=this,s=this.$element.children();s.each(function(){var t=n(this);if(t.is("option")||t.is("optgroup")){var s=o.item(t),r=o.matches(e,s);null!==r&&i.push(r)}}),t({results:i})},i.prototype.addOptions=function(e){t.appendMany(this.$element,e)},i.prototype.option=function(e){var t;e.children?(t=document.createElement("optgroup"),t.label=e.text):(t=document.createElement("option"),void 0!==t.textContent?t.textContent=e.text:t.innerText=e.text),e.id&&(t.value=e.id),e.disabled&&(t.disabled=!0),e.selected&&(t.selected=!0),e.title&&(t.title=e.title);var i=n(t),o=this._normalizeItem(e);return o.element=t,n.data(t,"data",o),i},i.prototype.item=function(e){var t={};if(t=n.data(e[0],"data"),null!=t)return t;if(e.is("option"))t={id:e.val(),text:e.text(),disabled:e.prop("disabled"),selected:e.prop("selected"),title:e.prop("title")};else if(e.is("optgroup")){t={text:e.prop("label"),children:[],title:e.prop("title")};for(var i=e.children("option"),o=[],s=0;s<i.length;s++){var r=n(i[s]),a=this.item(r);o.push(a)}t.children=o}return t=this._normalizeItem(t),t.element=e[0],n.data(e[0],"data",t),t},i.prototype._normalizeItem=function(e){n.isPlainObject(e)||(e={id:e,text:e}),e=n.extend({},{text:""},e);var t={selected:!1,disabled:!1};return null!=e.id&&(e.id=e.id.toString()),null!=e.text&&(e.text=e.text.toString()),null==e._resultId&&e.id&&null!=this.container&&(e._resultId=this.generateResultId(this.container,e)),n.extend({},t,e)},i.prototype.matches=function(e,t){var n=this.options.get("matcher");return n(e,t)},i}),t.define("pumselect2/data/array",["./select","../utils","jquery"],function(e,t,n){function i(e,t){var n=t.get("data")||[];i.__super__.constructor.call(this,e,t),this.addOptions(this.convertToOptions(n))}return t.Extend(i,e),i.prototype.select=function(e){var t=this.$element.find("option").filter(function(t,n){return n.value==e.id.toString()});0===t.length&&(t=this.option(e),this.addOptions(t)),i.__super__.select.call(this,e)},i.prototype.convertToOptions=function(e){function i(e){return function(){return n(this).val()==e.id}}for(var o=this,s=this.$element.find("option"),r=s.map(function(){return o.item(n(this)).id}).get(),a=[],l=0;l<e.length;l++){var c=this._normalizeItem(e[l]);if(n.inArray(c.id,r)>=0){var p=s.filter(i(c)),u=this.item(p),d=n.extend(!0,{},c,u),h=this.option(d);p.replaceWith(h)}else{var f=this.option(c);if(c.children){var m=this.convertToOptions(c.children);t.appendMany(f,m)}a.push(f)}}return a},i}),t.define("pumselect2/data/ajax",["./array","../utils","jquery"],function(e,t,n){function i(e,t){this.ajaxOptions=this._applyDefaults(t.get("ajax")),null!=this.ajaxOptions.processResults&&(this.processResults=this.ajaxOptions.processResults),i.__super__.constructor.call(this,e,t)}return t.Extend(i,e),i.prototype._applyDefaults=function(e){var t={data:function(e){return n.extend({},e,{q:e.term})},transport:function(e,t,i){var o=n.ajax(e);return o.then(t),o.fail(i),o}};return n.extend({},t,e,!0)},i.prototype.processResults=function(e){return e},i.prototype.query=function(e,t){function i(){var i=s.transport(s,function(i){var s=o.processResults(i,e);o.options.get("debug")&&window.console&&console.error&&(s&&s.results&&n.isArray(s.results)||console.error("Select2: The AJAX results did not return an array in the `results` key of the response.")),t(s)},function(){o.trigger("results:message",{message:"errorLoading"})});o._request=i}var o=this;null!=this._request&&(n.isFunction(this._request.abort)&&this._request.abort(),this._request=null);var s=n.extend({type:"GET"},this.ajaxOptions);"function"==typeof s.url&&(s.url=s.url.call(this.$element,e)),"function"==typeof s.data&&(s.data=s.data.call(this.$element,e)),this.ajaxOptions.delay&&""!==e.term?(this._queryTimeout&&window.clearTimeout(this._queryTimeout),this._queryTimeout=window.setTimeout(i,this.ajaxOptions.delay)):i()},i}),t.define("pumselect2/data/tags",["jquery"],function(e){function t(t,n,i){var o=i.get("tags"),s=i.get("createTag");void 0!==s&&(this.createTag=s);var r=i.get("insertTag");if(void 0!==r&&(this.insertTag=r),t.call(this,n,i),e.isArray(o))for(var a=0;a<o.length;a++){var l=o[a],c=this._normalizeItem(l),p=this.option(c);this.$element.append(p)}}return t.prototype.query=function(e,t,n){function i(e,s){for(var r=e.results,a=0;a<r.length;a++){var l=r[a],c=null!=l.children&&!i({results:l.children},!0),p=l.text===t.term;if(p||c)return!s&&(e.data=r,void n(e))}if(s)return!0;var u=o.createTag(t);if(null!=u){var d=o.option(u);d.attr("data-pumselect2-tag",!0),o.addOptions([d]),o.insertTag(r,u)}e.results=r,n(e)}var o=this;return this._removeOldTags(),null==t.term||null!=t.page?void e.call(this,t,n):void e.call(this,t,i)},t.prototype.createTag=function(t,n){var i=e.trim(n.term);return""===i?null:{id:i,text:i}},t.prototype.insertTag=function(e,t,n){t.unshift(n)},t.prototype._removeOldTags=function(t){var n=(this._lastTag,this.$element.find("option[data-pumselect2-tag]"));n.each(function(){this.selected||e(this).remove()})},t}),t.define("pumselect2/data/tokenizer",["jquery"],function(e){function t(e,t,n){var i=n.get("tokenizer");void 0!==i&&(this.tokenizer=i),e.call(this,t,n)}return t.prototype.bind=function(e,t,n){e.call(this,t,n),this.$search=t.dropdown.$search||t.selection.$search||n.find(".pumselect2-search__field")},t.prototype.query=function(e,t,n){function i(e){o.trigger("select",{data:e})}var o=this;t.term=t.term||"";var s=this.tokenizer(t,this.options,i);s.term!==t.term&&(this.$search.length&&(this.$search.val(s.term),this.$search.focus()),t.term=s.term),e.call(this,t,n)},t.prototype.tokenizer=function(t,n,i,o){for(var s=i.get("tokenSeparators")||[],r=n.term,a=0,l=this.createTag||function(e){return{id:e.term,text:e.term}};a<r.length;){var c=r[a];if(e.inArray(c,s)!==-1){var p=r.substr(0,a),u=e.extend({},n,{term:p}),d=l(u);null!=d?(o(d),r=r.substr(a+1)||"",a=0):a++}else a++}return{term:r}},t}),t.define("pumselect2/data/minimumInputLength",[],function(){function e(e,t,n){this.minimumInputLength=n.get("minimumInputLength"),e.call(this,t,n)}return e.prototype.query=function(e,t,n){return t.term=t.term||"",t.term.length<this.minimumInputLength?void this.trigger("results:message",{message:"inputTooShort",args:{minimum:this.minimumInputLength,input:t.term,params:t}}):void e.call(this,t,n)},e}),t.define("pumselect2/data/maximumInputLength",[],function(){function e(e,t,n){this.maximumInputLength=n.get("maximumInputLength"),e.call(this,t,n)}return e.prototype.query=function(e,t,n){return t.term=t.term||"",this.maximumInputLength>0&&t.term.length>this.maximumInputLength?void this.trigger("results:message",{message:"inputTooLong",args:{maximum:this.maximumInputLength,input:t.term,params:t}}):void e.call(this,t,n)},e}),t.define("pumselect2/data/maximumSelectionLength",[],function(){function e(e,t,n){this.maximumSelectionLength=n.get("maximumSelectionLength"),e.call(this,t,n)}return e.prototype.query=function(e,t,n){var i=this;this.current(function(o){var s=null!=o?o.length:0;return i.maximumSelectionLength>0&&s>=i.maximumSelectionLength?void i.trigger("results:message",{message:"maximumSelected",args:{maximum:i.maximumSelectionLength}}):void e.call(i,t,n)})},e}),t.define("pumselect2/dropdown",["jquery","./utils"],function(e,t){function n(e,t){this.$element=e,this.options=t,n.__super__.constructor.call(this)}return t.Extend(n,t.Observable),n.prototype.render=function(){var t=e('<span class="pumselect2-dropdown"><span class="pumselect2-results"></span></span>');return t.attr("dir",this.options.get("dir")),this.$dropdown=t,t},n.prototype.bind=function(){},n.prototype.position=function(e,t){},n.prototype.destroy=function(){this.$dropdown.remove()},n}),t.define("pumselect2/dropdown/search",["jquery","../utils"],function(e,t){function n(){}return n.prototype.render=function(t){var n=t.call(this),i=e('<span class="pumselect2-search pumselect2-search--dropdown"><input class="pumselect2-search__field" type="search" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" role="textbox" /></span>');return this.$searchContainer=i,this.$search=i.find("input"),n.prepend(i),n},n.prototype.bind=function(t,n,i){var o=this;t.call(this,n,i),this.$search.on("keydown",function(e){o.trigger("keypress",e),o._keyUpPrevented=e.isDefaultPrevented()}),this.$search.on("input",function(t){e(this).off("keyup")}),this.$search.on("keyup input",function(e){o.handleSearch(e)}),n.on("open",function(){o.$search.attr("tabindex",0),o.$search.focus(),window.setTimeout(function(){o.$search.focus()},0)}),n.on("close",function(){o.$search.attr("tabindex",-1),o.$search.val("")}),n.on("results:all",function(e){if(null==e.query.term||""===e.query.term){var t=o.showSearch(e);t?o.$searchContainer.removeClass("pumselect2-search--hide"):o.$searchContainer.addClass("pumselect2-search--hide")}})},n.prototype.handleSearch=function(e){if(!this._keyUpPrevented){var t=this.$search.val();this.trigger("query",{term:t})}this._keyUpPrevented=!1},n.prototype.showSearch=function(e,t){return!0},n}),t.define("pumselect2/dropdown/hidePlaceholder",[],function(){function e(e,t,n,i){this.placeholder=this.normalizePlaceholder(n.get("placeholder")),e.call(this,t,n,i)}return e.prototype.append=function(e,t){t.results=this.removePlaceholder(t.results),e.call(this,t)},e.prototype.normalizePlaceholder=function(e,t){return"string"==typeof t&&(t={id:"",text:t}),t},e.prototype.removePlaceholder=function(e,t){for(var n=t.slice(0),i=t.length-1;i>=0;i--){var o=t[i];this.placeholder.id===o.id&&n.splice(i,1)}return n},e}),t.define("pumselect2/dropdown/infiniteScroll",["jquery"],function(e){function t(e,t,n,i){this.lastParams={},e.call(this,t,n,i),this.$loadingMore=this.createLoadingMore(),this.loading=!1}return t.prototype.append=function(e,t){this.$loadingMore.remove(),this.loading=!1,e.call(this,t),this.showLoadingMore(t)&&this.$results.append(this.$loadingMore)},t.prototype.bind=function(t,n,i){var o=this;t.call(this,n,i),n.on("query",function(e){o.lastParams=e,o.loading=!0}),n.on("query:append",function(e){o.lastParams=e,o.loading=!0}),this.$results.on("scroll",function(){var t=e.contains(document.documentElement,o.$loadingMore[0]);if(!o.loading&&t){var n=o.$results.offset().top+o.$results.outerHeight(!1),i=o.$loadingMore.offset().top+o.$loadingMore.outerHeight(!1);n+50>=i&&o.loadMore()}})},t.prototype.loadMore=function(){this.loading=!0;var t=e.extend({},{page:1},this.lastParams);t.page++,this.trigger("query:append",t)},t.prototype.showLoadingMore=function(e,t){return t.pagination&&t.pagination.more},t.prototype.createLoadingMore=function(){var t=e('<li class="pumselect2-results__option pumselect2-results__option--load-more"role="treeitem" aria-disabled="true"></li>'),n=this.options.get("translations").get("loadingMore");return t.html(n(this.lastParams)),t},t}),t.define("pumselect2/dropdown/attachBody",["jquery","../utils"],function(e,t){function n(t,n,i){this.$dropdownParent=i.get("dropdownParent")||e(document.body),t.call(this,n,i)}return n.prototype.bind=function(e,t,n){var i=this,o=!1;e.call(this,t,n),t.on("open",function(){i._showDropdown(),i._attachPositioningHandler(t),o||(o=!0,t.on("results:all",function(){i._positionDropdown(),i._resizeDropdown()}),t.on("results:append",function(){i._positionDropdown(),i._resizeDropdown()}))}),t.on("close",function(){i._hideDropdown(),i._detachPositioningHandler(t)}),this.$dropdownContainer.on("mousedown",function(e){e.stopPropagation()})},n.prototype.destroy=function(e){e.call(this),this.$dropdownContainer.remove()},n.prototype.position=function(e,t,n){t.attr("class",n.attr("class")),t.removeClass("pumselect2"),t.addClass("pumselect2-container--open"),t.css({position:"absolute",top:-999999}),this.$container=n},n.prototype.render=function(t){var n=e("<span></span>"),i=t.call(this);return n.append(i),this.$dropdownContainer=n,n},n.prototype._hideDropdown=function(e){this.$dropdownContainer.detach()},n.prototype._attachPositioningHandler=function(n,i){var o=this,s="scroll.pumselect2."+i.id,r="resize.pumselect2."+i.id,a="orientationchange.pumselect2."+i.id,l=this.$container.parents().filter(t.hasScroll);l.each(function(){e(this).data("pumselect2-scroll-position",{x:e(this).scrollLeft(),y:e(this).scrollTop()})}),l.on(s,function(t){var n=e(this).data("pumselect2-scroll-position");e(this).scrollTop(n.y)}),e(window).on(s+" "+r+" "+a,function(e){o._positionDropdown(),o._resizeDropdown()})},n.prototype._detachPositioningHandler=function(n,i){var o="scroll.pumselect2."+i.id,s="resize.pumselect2."+i.id,r="orientationchange.pumselect2."+i.id,a=this.$container.parents().filter(t.hasScroll);a.off(o),e(window).off(o+" "+s+" "+r)},n.prototype._positionDropdown=function(){var t=e(window),n=this.$dropdown.hasClass("pumselect2-dropdown--above"),i=this.$dropdown.hasClass("pumselect2-dropdown--below"),o=null,s=this.$container.offset();s.bottom=s.top+this.$container.outerHeight(!1);var r={height:this.$container.outerHeight(!1)};r.top=s.top,r.bottom=s.top+r.height;var a={height:this.$dropdown.outerHeight(!1)},l={top:t.scrollTop(),bottom:t.scrollTop()+t.height()},c=l.top<s.top-a.height,p=l.bottom>s.bottom+a.height,u={left:s.left,top:r.bottom},d=this.$dropdownParent;"static"===d.css("position")&&(d=d.offsetParent());var h=d.offset();u.top-=h.top,u.left-=h.left,n||i||(o="below"),p||!c||n?!c&&p&&n&&(o="below"):o="above",("above"==o||n&&"below"!==o)&&(u.top=r.top-a.height),null!=o&&(this.$dropdown.removeClass("pumselect2-dropdown--below pumselect2-dropdown--above").addClass("pumselect2-dropdown--"+o),this.$container.removeClass("pumselect2-container--below pumselect2-container--above").addClass("pumselect2-container--"+o)),this.$dropdownContainer.css(u)},n.prototype._resizeDropdown=function(){var e={width:this.$container.outerWidth(!1)+"px"};this.options.get("dropdownAutoWidth")&&(e.minWidth=e.width,e.width="auto"),this.$dropdown.css(e)},n.prototype._showDropdown=function(e){this.$dropdownContainer.appendTo(this.$dropdownParent),this._positionDropdown(),this._resizeDropdown()},n}),t.define("pumselect2/dropdown/minimumResultsForSearch",[],function(){function e(t){for(var n=0,i=0;i<t.length;i++){var o=t[i];o.children?n+=e(o.children):n++}return n}function t(e,t,n,i){this.minimumResultsForSearch=n.get("minimumResultsForSearch"),this.minimumResultsForSearch<0&&(this.minimumResultsForSearch=1/0),e.call(this,t,n,i)}return t.prototype.showSearch=function(t,n){return!(e(n.data.results)<this.minimumResultsForSearch)&&t.call(this,n)},t}),t.define("pumselect2/dropdown/selectOnClose",[],function(){function e(){}return e.prototype.bind=function(e,t,n){var i=this;e.call(this,t,n),t.on("close",function(){i._handleSelectOnClose()})},e.prototype._handleSelectOnClose=function(){var e=this.getHighlightedResults();if(!(e.length<1)){var t=e.data("data");null!=t.element&&t.element.selected||null==t.element&&t.selected||this.trigger("select",{data:t})}},e}),t.define("pumselect2/dropdown/closeOnSelect",[],function(){function e(){}return e.prototype.bind=function(e,t,n){var i=this;e.call(this,t,n),t.on("select",function(e){i._selectTriggered(e)}),t.on("unselect",function(e){i._selectTriggered(e)})},e.prototype._selectTriggered=function(e,t){var n=t.originalEvent;n&&n.ctrlKey||this.trigger("close",{})},e}),t.define("pumselect2/i18n/en",[],function(){return{errorLoading:function(){return"The results could not be loaded."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Please delete "+t+" character";return 1!=t&&(n+="s"),n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Please enter "+t+" or more characters";return n},loadingMore:function(){return"Loading more results…"},maximumSelected:function(e){var t="You can only select "+e.maximum+" item";return 1!=e.maximum&&(t+="s"),t},noResults:function(){return"No results found"},searching:function(){return"Searching…"}}}),t.define("pumselect2/defaults",["jquery","require","./results","./selection/single","./selection/multiple","./selection/placeholder","./selection/allowClear","./selection/search","./selection/eventRelay","./utils","./translation","./diacritics","./data/select","./data/array","./data/ajax","./data/tags","./data/tokenizer","./data/minimumInputLength","./data/maximumInputLength","./data/maximumSelectionLength","./dropdown","./dropdown/search","./dropdown/hidePlaceholder","./dropdown/infiniteScroll","./dropdown/attachBody","./dropdown/minimumResultsForSearch","./dropdown/selectOnClose","./dropdown/closeOnSelect","./i18n/en"],function(e,t,n,i,o,s,r,a,l,c,p,u,d,h,f,m,g,_,v,y,b,w,k,x,$,C,P,M,A){function S(){this.reset()}S.prototype.apply=function(u){if(u=e.extend(!0,{},this.defaults,u),null==u.dataAdapter){if(null!=u.ajax?u.dataAdapter=f:null!=u.data?u.dataAdapter=h:u.dataAdapter=d,u.minimumInputLength>0&&(u.dataAdapter=c.Decorate(u.dataAdapter,_)),u.maximumInputLength>0&&(u.dataAdapter=c.Decorate(u.dataAdapter,v)),u.maximumSelectionLength>0&&(u.dataAdapter=c.Decorate(u.dataAdapter,y)),u.tags&&(u.dataAdapter=c.Decorate(u.dataAdapter,m)),null==u.tokenSeparators&&null==u.tokenizer||(u.dataAdapter=c.Decorate(u.dataAdapter,g)),null!=u.query){var A=t(u.amdBase+"compat/query");u.dataAdapter=c.Decorate(u.dataAdapter,A)}if(null!=u.initSelection){var S=t(u.amdBase+"compat/initSelection");u.dataAdapter=c.Decorate(u.dataAdapter,S)}}if(null==u.resultsAdapter&&(u.resultsAdapter=n,null!=u.ajax&&(u.resultsAdapter=c.Decorate(u.resultsAdapter,x)),null!=u.placeholder&&(u.resultsAdapter=c.Decorate(u.resultsAdapter,k)),u.selectOnClose&&(u.resultsAdapter=c.Decorate(u.resultsAdapter,P))),null==u.dropdownAdapter){if(u.multiple)u.dropdownAdapter=b;else{var U=c.Decorate(b,w);u.dropdownAdapter=U}if(0!==u.minimumResultsForSearch&&(u.dropdownAdapter=c.Decorate(u.dropdownAdapter,C)),u.closeOnSelect&&(u.dropdownAdapter=c.Decorate(u.dropdownAdapter,M)),null!=u.dropdownCssClass||null!=u.dropdownCss||null!=u.adaptDropdownCssClass){var T=t(u.amdBase+"compat/dropdownCss");u.dropdownAdapter=c.Decorate(u.dropdownAdapter,T)}u.dropdownAdapter=c.Decorate(u.dropdownAdapter,$)}if(null==u.selectionAdapter){if(u.multiple?u.selectionAdapter=o:u.selectionAdapter=i,null!=u.placeholder&&(u.selectionAdapter=c.Decorate(u.selectionAdapter,s)),u.allowClear&&(u.selectionAdapter=c.Decorate(u.selectionAdapter,r)),u.multiple&&(u.selectionAdapter=c.Decorate(u.selectionAdapter,a)),null!=u.containerCssClass||null!=u.containerCss||null!=u.adaptContainerCssClass){var D=t(u.amdBase+"compat/containerCss");u.selectionAdapter=c.Decorate(u.selectionAdapter,D)}u.selectionAdapter=c.Decorate(u.selectionAdapter,l)}if("string"==typeof u.language)if(u.language.indexOf("-")>0){var j=u.language.split("-"),O=j[0];u.language=[u.language,O]}else u.language=[u.language];if(e.isArray(u.language)){var E=new p;u.language.push("en");for(var q=u.language,I=0;I<q.length;I++){var z=q[I],L={};try{L=p.loadPath(z)}catch(R){try{z=this.defaults.amdLanguageBase+z,L=p.loadPath(z)}catch(H){u.debug&&window.console&&console.warn&&console.warn('Select2: The language file for "'+z+'" could not be automatically loaded. A fallback will be used instead.');continue}}E.extend(L)}u.translations=E}else{var F=p.loadPath(this.defaults.amdLanguageBase+"en"),N=new p(u.language);N.extend(F),u.translations=N}return u},S.prototype.reset=function(){function t(e){function t(e){return u[e]||e}return e.replace(/[^\u0000-\u007E]/g,t)}function n(i,o){if(""===e.trim(i.term))return o;if(o.children&&o.children.length>0){for(var s=e.extend(!0,{},o),r=o.children.length-1;r>=0;r--){var a=o.children[r],l=n(i,a);null==l&&s.children.splice(r,1)}return s.children.length>0?s:n(i,s)}var c=t(o.text).toUpperCase(),p=t(i.term).toUpperCase();return c.indexOf(p)>-1?o:null}this.defaults={amdBase:"./",amdLanguageBase:"./i18n/",closeOnSelect:!0,debug:!1,dropdownAutoWidth:!1,escapeMarkup:c.escapeMarkup,language:A,matcher:n,minimumInputLength:0,maximumInputLength:0,maximumSelectionLength:0,minimumResultsForSearch:0,selectOnClose:!1,sorter:function(e){return e},templateResult:function(e){return e.text},templateSelection:function(e){return e.text},theme:"default",width:"resolve"}},S.prototype.set=function(t,n){var i=e.camelCase(t),o={};o[i]=n;var s=c._convertData(o);e.extend(this.defaults,s)};var U=new S;return U}),t.define("pumselect2/options",["require","jquery","./defaults","./utils"],function(e,t,n,i){function o(t,o){if(this.options=t,null!=o&&this.fromElement(o),this.options=n.apply(this.options),o&&o.is("input")){var s=e(this.get("amdBase")+"compat/inputData");this.options.dataAdapter=i.Decorate(this.options.dataAdapter,s)}}return o.prototype.fromElement=function(e){var n=["pumselect2"];null==this.options.multiple&&(this.options.multiple=e.prop("multiple")),null==this.options.disabled&&(this.options.disabled=e.prop("disabled")),null==this.options.language&&(e.prop("lang")?this.options.language=e.prop("lang").toLowerCase():e.closest("[lang]").prop("lang")&&(this.options.language=e.closest("[lang]").prop("lang"))),null==this.options.dir&&(e.prop("dir")?this.options.dir=e.prop("dir"):e.closest("[dir]").prop("dir")?this.options.dir=e.closest("[dir]").prop("dir"):this.options.dir="ltr"),e.prop("disabled",this.options.disabled),e.prop("multiple",this.options.multiple),e.data("pumselect2Tags")&&(this.options.debug&&window.console&&console.warn&&console.warn('Select2: The `data-pumselect2-tags` attribute has been changed to use the `data-data` and `data-tags="true"` attributes and will be removed in future versions of Select2.'),e.data("data",e.data("pumselect2Tags")),e.data("tags",!0)),e.data("ajaxUrl")&&(this.options.debug&&window.console&&console.warn&&console.warn("Select2: The `data-ajax-url` attribute has been changed to `data-ajax--url` and support for the old attribute will be removed in future versions of Select2."),e.attr("ajax--url",e.data("ajaxUrl")),e.data("ajax--url",e.data("ajaxUrl")));var o={};o=t.fn.jquery&&"1."==t.fn.jquery.substr(0,2)&&e[0].dataset?t.extend(!0,{},e[0].dataset,e.data()):e.data();var s=t.extend(!0,{},o);s=i._convertData(s);for(var r in s)t.inArray(r,n)>-1||(t.isPlainObject(this.options[r])?t.extend(this.options[r],s[r]):this.options[r]=s[r]);return this},o.prototype.get=function(e){return this.options[e]},o.prototype.set=function(e,t){this.options[e]=t},o}),t.define("pumselect2/core",["jquery","./options","./utils","./keys"],function(e,t,n,i){var o=function(e,n){null!=e.data("pumselect2")&&e.data("pumselect2").destroy(),this.$element=e,this.id=this._generateId(e),n=n||{},this.options=new t(n,e),o.__super__.constructor.call(this);var i=e.attr("tabindex")||0;e.data("old-tabindex",i),e.attr("tabindex","-1");var s=this.options.get("dataAdapter");this.dataAdapter=new s(e,this.options);var r=this.render();this._placeContainer(r);var a=this.options.get("selectionAdapter");this.selection=new a(e,this.options),this.$selection=this.selection.render(),this.selection.position(this.$selection,r);var l=this.options.get("dropdownAdapter");this.dropdown=new l(e,this.options),this.$dropdown=this.dropdown.render(),this.dropdown.position(this.$dropdown,r);var c=this.options.get("resultsAdapter");this.results=new c(e,this.options,this.dataAdapter),this.$results=this.results.render(),this.results.position(this.$results,this.$dropdown);var p=this;this._bindAdapters(),this._registerDomEvents(),this._registerDataEvents(),this._registerSelectionEvents(),this._registerDropdownEvents(),this._registerResultsEvents(),this._registerEvents(),this.dataAdapter.current(function(e){p.trigger("selection:update",{data:e})}),e.addClass("pumselect2-hidden-accessible"),e.attr("aria-hidden","true"),this._syncAttributes(),e.data("pumselect2",this)};return n.Extend(o,n.Observable),o.prototype._generateId=function(e){var t="";return t=null!=e.attr("id")?e.attr("id"):null!=e.attr("name")?e.attr("name")+"-"+n.generateChars(2):n.generateChars(4),t=t.replace(/(:|\.|\[|\]|,)/g,""),t="pumselect2-"+t},o.prototype._placeContainer=function(e){e.insertAfter(this.$element);var t=this._resolveWidth(this.$element,this.options.get("width"));null!=t&&e.css("width",t)},o.prototype._resolveWidth=function(e,t){var n=/^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i;if("resolve"==t){var i=this._resolveWidth(e,"style");return null!=i?i:this._resolveWidth(e,"element")}if("element"==t){var o=e.outerWidth(!1);return o<=0?"auto":o+"px"}if("style"==t){var s=e.attr("style");if("string"!=typeof s)return null;for(var r=s.split(";"),a=0,l=r.length;a<l;a+=1){var c=r[a].replace(/\s/g,""),p=c.match(n);if(null!==p&&p.length>=1)return p[1]}return null}return t},o.prototype._bindAdapters=function(){this.dataAdapter.bind(this,this.$container),this.selection.bind(this,this.$container),this.dropdown.bind(this,this.$container),this.results.bind(this,this.$container)},o.prototype._registerDomEvents=function(){var t=this;this.$element.on("change.pumselect2",function(){t.dataAdapter.current(function(e){t.trigger("selection:update",{data:e})})}),this._sync=n.bind(this._syncAttributes,this),this.$element[0].attachEvent&&this.$element[0].attachEvent("onpropertychange",this._sync);var i=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;null!=i?(this._observer=new i(function(n){e.each(n,t._sync)}),this._observer.observe(this.$element[0],{attributes:!0,subtree:!1})):this.$element[0].addEventListener&&this.$element[0].addEventListener("DOMAttrModified",t._sync,!1)},o.prototype._registerDataEvents=function(){var e=this;this.dataAdapter.on("*",function(t,n){e.trigger(t,n)})},o.prototype._registerSelectionEvents=function(){var t=this,n=["toggle","focus"];this.selection.on("toggle",function(){t.toggleDropdown()}),this.selection.on("focus",function(e){t.focus(e)}),this.selection.on("*",function(i,o){e.inArray(i,n)===-1&&t.trigger(i,o)})},o.prototype._registerDropdownEvents=function(){var e=this;this.dropdown.on("*",function(t,n){e.trigger(t,n)})},o.prototype._registerResultsEvents=function(){var e=this;this.results.on("*",function(t,n){e.trigger(t,n)})},o.prototype._registerEvents=function(){var e=this;this.on("open",function(){e.$container.addClass("pumselect2-container--open")}),this.on("close",function(){e.$container.removeClass("pumselect2-container--open")}),this.on("enable",function(){e.$container.removeClass("pumselect2-container--disabled")}),this.on("disable",function(){e.$container.addClass("pumselect2-container--disabled")}),this.on("blur",function(){e.$container.removeClass("pumselect2-container--focus")}),this.on("query",function(t){e.isOpen()||e.trigger("open",{}),this.dataAdapter.query(t,function(n){e.trigger("results:all",{data:n,query:t})})}),this.on("query:append",function(t){this.dataAdapter.query(t,function(n){e.trigger("results:append",{data:n,query:t})})}),this.on("keypress",function(t){var n=t.which;e.isOpen()?n===i.ESC||n===i.TAB||n===i.UP&&t.altKey?(e.close(),t.preventDefault()):n===i.ENTER?(e.trigger("results:select",{}),t.preventDefault()):n===i.SPACE&&t.ctrlKey?(e.trigger("results:toggle",{}),t.preventDefault()):n===i.UP?(e.trigger("results:previous",{}),t.preventDefault()):n===i.DOWN&&(e.trigger("results:next",{}),t.preventDefault()):(n===i.ENTER||n===i.SPACE||n===i.DOWN&&t.altKey)&&(e.open(),t.preventDefault())})},o.prototype._syncAttributes=function(){this.options.set("disabled",this.$element.prop("disabled")),this.options.get("disabled")?(this.isOpen()&&this.close(),this.trigger("disable",{})):this.trigger("enable",{})},o.prototype.trigger=function(e,t){var n=o.__super__.trigger,i={open:"opening",close:"closing",select:"selecting",unselect:"unselecting"};if(void 0===t&&(t={}),e in i){var s=i[e],r={prevented:!1,name:e,args:t};if(n.call(this,s,r),r.prevented)return void(t.prevented=!0)}n.call(this,e,t)},o.prototype.toggleDropdown=function(){this.options.get("disabled")||(this.isOpen()?this.close():this.open())},o.prototype.open=function(){this.isOpen()||this.trigger("query",{})},o.prototype.close=function(){this.isOpen()&&this.trigger("close",{})},o.prototype.isOpen=function(){return this.$container.hasClass("pumselect2-container--open")},o.prototype.hasFocus=function(){return this.$container.hasClass("pumselect2-container--focus")},o.prototype.focus=function(e){this.hasFocus()||(this.$container.addClass("pumselect2-container--focus"),this.trigger("focus",{}))},o.prototype.enable=function(e){this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `pumselect2("enable")` method has been deprecated and will be removed in later Select2 versions. Use $element.prop("disabled") instead.'),null!=e&&0!==e.length||(e=[!0]);var t=!e[0];this.$element.prop("disabled",t)},o.prototype.data=function(){this.options.get("debug")&&arguments.length>0&&window.console&&console.warn&&console.warn('Select2: Data can no longer be set using `pumselect2("data")`. You should consider setting the value instead using `$element.val()`.');var e=[];return this.dataAdapter.current(function(t){e=t}),e},o.prototype.val=function(t){if(this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `pumselect2("val")` method has been deprecated and will be removed in later Select2 versions. Use $element.val() instead.'),null==t||0===t.length)return this.$element.val();var n=t[0];e.isArray(n)&&(n=e.map(n,function(e){return e.toString()})),this.$element.val(n).trigger("change")},o.prototype.destroy=function(){this.$container.remove(),this.$element[0].detachEvent&&this.$element[0].detachEvent("onpropertychange",this._sync),null!=this._observer?(this._observer.disconnect(),this._observer=null):this.$element[0].removeEventListener&&this.$element[0].removeEventListener("DOMAttrModified",this._sync,!1),this._sync=null,this.$element.off(".pumselect2"),this.$element.attr("tabindex",this.$element.data("old-tabindex")),this.$element.removeClass("pumselect2-hidden-accessible"),this.$element.attr("aria-hidden","false"),this.$element.removeData("pumselect2"),this.dataAdapter.destroy(),this.selection.destroy(),this.dropdown.destroy(),this.results.destroy(),this.dataAdapter=null,this.selection=null,this.dropdown=null,this.results=null},o.prototype.render=function(){var t=e('<span class="pumselect2 pumselect2-container"><span class="selection"></span><span class="dropdown-wrapper" aria-hidden="true"></span></span>');return t.attr("dir",this.options.get("dir")),this.$container=t,this.$container.addClass("pumselect2-container--"+this.options.get("theme")),t.data("element",this.$element),t},o}),t.define("pumselect2/compat/utils",["jquery"],function(e){function t(t,n,i){var o,s,r=[];o=e.trim(t.attr("class")),o&&(o=""+o,e(o.split(/\s+/)).each(function(){0===this.indexOf("pumselect2-")&&r.push(this)})),o=e.trim(n.attr("class")),o&&(o=""+o,e(o.split(/\s+/)).each(function(){0!==this.indexOf("pumselect2-")&&(s=i(this),null!=s&&r.push(s))})),t.attr("class",r.join(" "));
3
+ }return{syncCssClasses:t}}),t.define("pumselect2/compat/containerCss",["jquery","./utils"],function(e,t){function n(e){return null}function i(){}return i.prototype.render=function(i){var o=i.call(this),s=this.options.get("containerCssClass")||"";e.isFunction(s)&&(s=s(this.$element));var r=this.options.get("adaptContainerCssClass");if(r=r||n,s.indexOf(":all:")!==-1){s=s.replace(":all:","");var a=r;r=function(e){var t=a(e);return null!=t?t+" "+e:e}}var l=this.options.get("containerCss")||{};return e.isFunction(l)&&(l=l(this.$element)),t.syncCssClasses(o,this.$element,r),o.css(l),o.addClass(s),o},i}),t.define("pumselect2/compat/dropdownCss",["jquery","./utils"],function(e,t){function n(e){return null}function i(){}return i.prototype.render=function(i){var o=i.call(this),s=this.options.get("dropdownCssClass")||"";e.isFunction(s)&&(s=s(this.$element));var r=this.options.get("adaptDropdownCssClass");if(r=r||n,s.indexOf(":all:")!==-1){s=s.replace(":all:","");var a=r;r=function(e){var t=a(e);return null!=t?t+" "+e:e}}var l=this.options.get("dropdownCss")||{};return e.isFunction(l)&&(l=l(this.$element)),t.syncCssClasses(o,this.$element,r),o.css(l),o.addClass(s),o},i}),t.define("pumselect2/compat/initSelection",["jquery"],function(e){function t(e,t,n){n.get("debug")&&window.console&&console.warn&&console.warn("Select2: The `initSelection` option has been deprecated in favor of a custom data adapter that overrides the `current` method. This method is now called multiple times instead of a single time when the instance is initialized. Support will be removed for the `initSelection` option in future versions of Select2"),this.initSelection=n.get("initSelection"),this._isInitialized=!1,e.call(this,t,n)}return t.prototype.current=function(t,n){var i=this;return this._isInitialized?void t.call(this,n):void this.initSelection.call(null,this.$element,function(t){i._isInitialized=!0,e.isArray(t)||(t=[t]),n(t)})},t}),t.define("pumselect2/compat/inputData",["jquery"],function(e){function t(e,t,n){this._currentData=[],this._valueSeparator=n.get("valueSeparator")||",","hidden"===t.prop("type")&&n.get("debug")&&console&&console.warn&&console.warn("Select2: Using a hidden input with Select2 is no longer supported and may stop working in the future. It is recommended to use a `<select>` element instead."),e.call(this,t,n)}return t.prototype.current=function(t,n){function i(t,n){var o=[];return t.selected||e.inArray(t.id,n)!==-1?(t.selected=!0,o.push(t)):t.selected=!1,t.children&&o.push.apply(o,i(t.children,n)),o}for(var o=[],s=0;s<this._currentData.length;s++){var r=this._currentData[s];o.push.apply(o,i(r,this.$element.val().split(this._valueSeparator)))}n(o)},t.prototype.select=function(t,n){if(this.options.get("multiple")){var i=this.$element.val();i+=this._valueSeparator+n.id,this.$element.val(i),this.$element.trigger("change")}else this.current(function(t){e.map(t,function(e){e.selected=!1})}),this.$element.val(n.id),this.$element.trigger("change")},t.prototype.unselect=function(e,t){var n=this;t.selected=!1,this.current(function(e){for(var i=[],o=0;o<e.length;o++){var s=e[o];t.id!=s.id&&i.push(s.id)}n.$element.val(i.join(n._valueSeparator)),n.$element.trigger("change")})},t.prototype.query=function(e,t,n){for(var i=[],o=0;o<this._currentData.length;o++){var s=this._currentData[o],r=this.matches(t,s);null!==r&&i.push(r)}n({results:i})},t.prototype.addOptions=function(t,n){var i=e.map(n,function(t){return e.data(t[0],"data")});this._currentData.push.apply(this._currentData,i)},t}),t.define("pumselect2/compat/matcher",["jquery"],function(e){function t(t){function n(n,i){var o=e.extend(!0,{},i);if(null==n.term||""===e.trim(n.term))return o;if(i.children){for(var s=i.children.length-1;s>=0;s--){var r=i.children[s],a=t(n.term,r.text,r);a||o.children.splice(s,1)}if(o.children.length>0)return o}return t(n.term,i.text,i)?o:null}return n}return t}),t.define("pumselect2/compat/query",[],function(){function e(e,t,n){n.get("debug")&&window.console&&console.warn&&console.warn("Select2: The `query` option has been deprecated in favor of a custom data adapter that overrides the `query` method. Support will be removed for the `query` option in future versions of Select2."),e.call(this,t,n)}return e.prototype.query=function(e,t,n){t.callback=n;var i=this.options.get("query");i.call(null,t)},e}),t.define("pumselect2/dropdown/attachContainer",[],function(){function e(e,t,n){e.call(this,t,n)}return e.prototype.position=function(e,t,n){var i=n.find(".dropdown-wrapper");i.append(t),t.addClass("pumselect2-dropdown--below"),n.addClass("pumselect2-container--below")},e}),t.define("pumselect2/dropdown/stopPropagation",[],function(){function e(){}return e.prototype.bind=function(e,t,n){e.call(this,t,n);var i=["blur","change","click","dblclick","focus","focusin","focusout","input","keydown","keyup","keypress","mousedown","mouseenter","mouseleave","mousemove","mouseover","mouseup","search","touchend","touchstart"];this.$dropdown.on(i.join(" "),function(e){e.stopPropagation()})},e}),t.define("pumselect2/selection/stopPropagation",[],function(){function e(){}return e.prototype.bind=function(e,t,n){e.call(this,t,n);var i=["blur","change","click","dblclick","focus","focusin","focusout","input","keydown","keyup","keypress","mousedown","mouseenter","mouseleave","mousemove","mouseover","mouseup","search","touchend","touchstart"];this.$selection.on(i.join(" "),function(e){e.stopPropagation()})},e}),function(n){"function"==typeof t.define&&t.define.amd?t.define("jquery-mousewheel",["jquery"],n):"object"==typeof exports?module.exports=n:n(e)}(function(e){function t(t){var r=t||window.event,a=l.call(arguments,1),c=0,u=0,d=0,h=0,f=0,m=0;if(t=e.event.fix(r),t.type="mousewheel","detail"in r&&(d=r.detail*-1),"wheelDelta"in r&&(d=r.wheelDelta),"wheelDeltaY"in r&&(d=r.wheelDeltaY),"wheelDeltaX"in r&&(u=r.wheelDeltaX*-1),"axis"in r&&r.axis===r.HORIZONTAL_AXIS&&(u=d*-1,d=0),c=0===d?u:d,"deltaY"in r&&(d=r.deltaY*-1,c=d),"deltaX"in r&&(u=r.deltaX,0===d&&(c=u*-1)),0!==d||0!==u){if(1===r.deltaMode){var g=e.data(this,"mousewheel-line-height");c*=g,d*=g,u*=g}else if(2===r.deltaMode){var _=e.data(this,"mousewheel-page-height");c*=_,d*=_,u*=_}if(h=Math.max(Math.abs(d),Math.abs(u)),(!s||h<s)&&(s=h,i(r,h)&&(s/=40)),i(r,h)&&(c/=40,u/=40,d/=40),c=Math[c>=1?"floor":"ceil"](c/s),u=Math[u>=1?"floor":"ceil"](u/s),d=Math[d>=1?"floor":"ceil"](d/s),p.settings.normalizeOffset&&this.getBoundingClientRect){var v=this.getBoundingClientRect();f=t.clientX-v.left,m=t.clientY-v.top}return t.deltaX=u,t.deltaY=d,t.deltaFactor=s,t.offsetX=f,t.offsetY=m,t.deltaMode=0,a.unshift(t,c,u,d),o&&clearTimeout(o),o=setTimeout(n,200),(e.event.dispatch||e.event.handle).apply(this,a)}}function n(){s=null}function i(e,t){return p.settings.adjustOldDeltas&&"mousewheel"===e.type&&t%120===0}var o,s,r=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],a="onwheel"in document||document.documentMode>=9?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],l=Array.prototype.slice;if(e.event.fixHooks)for(var c=r.length;c;)e.event.fixHooks[r[--c]]=e.event.mouseHooks;var p=e.event.special.mousewheel={version:"3.1.12",setup:function(){if(this.addEventListener)for(var n=a.length;n;)this.addEventListener(a[--n],t,!1);else this.onmousewheel=t;e.data(this,"mousewheel-line-height",p.getLineHeight(this)),e.data(this,"mousewheel-page-height",p.getPageHeight(this))},teardown:function(){if(this.removeEventListener)for(var n=a.length;n;)this.removeEventListener(a[--n],t,!1);else this.onmousewheel=null;e.removeData(this,"mousewheel-line-height"),e.removeData(this,"mousewheel-page-height")},getLineHeight:function(t){var n=e(t),i=n["offsetParent"in e.fn?"offsetParent":"parent"]();return i.length||(i=e("body")),parseInt(i.css("fontSize"),10)||parseInt(n.css("fontSize"),10)||16},getPageHeight:function(t){return e(t).height()},settings:{adjustOldDeltas:!0,normalizeOffset:!0}};e.fn.extend({mousewheel:function(e){return e?this.bind("mousewheel",e):this.trigger("mousewheel")},unmousewheel:function(e){return this.unbind("mousewheel",e)}})}),t.define("jquery.pumselect2",["jquery","jquery-mousewheel","./pumselect2/core","./pumselect2/defaults"],function(e,t,n,i){if(null==e.fn.pumselect2){var o=["open","close","destroy"];e.fn.pumselect2=function(t){if(t=t||{},"object"==typeof t)return this.each(function(){var i=e.extend(!0,{},t);new n(e(this),i)}),this;if("string"==typeof t){var i;return this.each(function(){var n=e(this).data("pumselect2");null==n&&window.console&&console.error&&console.error("The pumselect2('"+t+"') method was called on an element that is not using Select2.");var o=Array.prototype.slice.call(arguments,1);i=n[t].apply(n,o)}),e.inArray(t,o)>-1?this:i}throw new Error("Invalid arguments for Select2: "+t)}}return null==e.fn.pumselect2.defaults&&(e.fn.pumselect2.defaults=i),n}),{define:t.define,require:t.require}}(),n=t.require("jquery.pumselect2");return e.fn.pumselect2.amd=t,n}),function(e,t,n){"use strict";e(t).on("click","#popup_reset_open_count",function(){var t=e(this);t.is(":checked")&&!confirm(pum_admin.I10n.confirm_count_reset)&&t.prop("checked",!1)})}(jQuery,document);var PUMColorPickers;!function(e,t,n){"use strict";PUMColorPickers={init:function(){e(".color-picker").filter(":not(.initialized)").addClass("initialized").wpColorPicker({change:function(t,n){e(t.target).trigger("colorchange",n)},clear:function(t){e(t.target).prev().trigger("colorchange").wpColorPicker("close")}})}},e(t).on("click",".iris-palette",function(){e(this).parents(".wp-picker-active").find("input.color-picker").trigger("change"),setTimeout(PopMakeAdmin.update_theme,500)}).on("colorchange",function(t,i){var o=e(t.target),s=o.parents("tr").next("tr.background-opacity"),r="";i!==n&&i.color!==n&&(r=i.color.toString()),o.hasClass("background-color")&&("string"==typeof r&&r.length?s.show():s.hide()),o.val(r),"popup_theme"===e("form#post input#post_type").val()&&PopMakeAdmin.update_theme()}).on("pum_init",PUMColorPickers.init)}(jQuery,document);var PUMConditions;!function(e,t,n){"use strict";PUMConditions={templates:{},addGroup:function(n,i){var o=e("#pum-popup-conditions"),s={index:o.find(".facet-group-wrap").length,conditions:[{target:n||null,not_operand:i||!1,settings:{}}]};o.find(".facet-groups").append(PUMConditions.templates.group(s)),o.find(".facet-builder").addClass("has-conditions"),e(t).trigger("pum_init")},renumber:function(){e("#pum-popup-conditions .facet-group-wrap").each(function(){var t=e(this),n=t.parent().children().index(t);t.data("index",n).find(".facet").each(function(){var t=e(this),i=t.parent().children().index(t);t.data("index",i).find("[name]").each(function(){var e="popup_conditions["+n+"]["+i+"]";this.name=this.name.replace(/popup_conditions\[\d*?\]\[\d*?\]/,e),this.id=this.name})})})}},e(t).on("pum_init",PUMConditions.renumber).ready(function(){e("body.post-type-popup form#post").length&&(PUMConditions.templates.group=wp.template("pum-condition-group"),PUMConditions.templates.facet=wp.template("pum-condition-facet"),PUMConditions.templates.settings={},e("script.tmpl.pum-condition-settings").each(function(){var t=e(this),n=t.attr("id").replace("tmpl-","");PUMConditions.templates.settings[t.data("condition")]=wp.template(n)}),PUMConditions.renumber())}).on("select2:select pumselect2:select","#pum-first-condition",function(){var t=e(this),n=t.val(),i=e("#pum-first-condition-operand"),o=i.is(":checked")?i.val():null;PUMConditions.addGroup(n,o),t.val(null).trigger("change"),i.prop("checked",!1).parents(".pum-condition-target").removeClass("not-operand-checked")}).on("click","#pum-popup-conditions .pum-not-operand",function(){var t=e(this),n=t.find("input"),i=t.parents(".pum-condition-target");n.is(":checked")?(i.removeClass("not-operand-checked"),n.prop("checked",!1)):(i.addClass("not-operand-checked"),n.prop("checked",!0))}).on("change","#pum-popup-conditions select.target",function(){var i=e(this),o=i.val(),s={index:i.parents(".facet-group").find(".facet").length,target:o,settings:{}};""!==o&&o!==i.parents(".facet").data("target")&&PUMConditions.templates.settings[o]!==n&&(i.parents(".facet").data("target",o).find(".facet-settings").html(PUMConditions.templates.settings[o](s)),e(t).trigger("pum_init"))}).on("click","#pum-popup-conditions .facet-group-wrap:last-child .and .add-facet",PUMConditions.addGroup).on("click","#pum-popup-conditions .add-or .add-facet:not(.disabled)",function(){var n=e(this),i=n.parents(".facet-group-wrap"),o={group:i.data("index"),index:i.find(".facet").length,target:null,settings:{}};i.find(".facet-list").append(PUMConditions.templates.facet(o)),e(t).trigger("pum_init")}).on("click","#pum-popup-conditions .remove-facet",function(){var t=e(this),n=e("#pum-popup-conditions"),i=t.parents(".facet"),o=t.parents(".facet-group-wrap");i.remove(),0===o.find(".facet").length&&(o.prev(".facet-group-wrap").find(".and .add-facet").removeClass("disabled"),o.remove(),0===n.find(".facet-group-wrap").length&&n.find(".facet-builder").removeClass("has-conditions")),PUMConditions.renumber()})}(jQuery,document);var PUMCookies;!function(e,t,n){"use strict";var i=pum_admin.I10n,o=pum_admin.defaults;PUMCookies={getLabel:function(e){return i.labels.cookies[e].name},getSettingsDesc:function(e,t){var n={evaluate:/<#([\s\S]+?)#>/g,interpolate:/\{\{\{([\s\S]+?)\}\}\}/g,escape:/\{\{([^\}]+?)\}\}(?!\})/g,variable:"data"},o=_.template(i.labels.cookies[e].settings_column,null,n);return t.I10n=i,o(t)},renumber:function(){e("#pum_popup_cookies_list tbody tr").each(function(){var t=e(this),n=t.parent().children().index(t),i=t.data("index");t.data("index",n),t.find("[name]").each(function(){var e="["+n+"]";this.name=this.name.replace("["+i+"]",e).replace("[]",e)})})},refreshDescriptions:function(){e("#pum_popup_cookies_list tbody tr").each(function(){var t=e(this),n=t.find(".popup_cookies_field_event").val(),i=JSON.parse(t.find(".popup_cookies_field_settings:first").val());t.find("td.settings-column").html(PUMCookies.getSettingsDesc(n,i))})},initEditForm:function(){PUMCookies.updateSessionsCheckbox()},updateSessionsCheckbox:function(){var t=e(".cookie-editor .pum-form"),n=t.find('.field.checkbox.session input[type="checkbox"]').is(":checked"),i=t.find(".field").filter(".time");n?i.hide():i.show()},resetCookieKey:function(){var t=e(this),n=(new Date).getTime().toString(16);t.parents(".pum-form").find(".field.text.name").data("cookiekey",n),t.siblings('input[type="text"]:first').val(n)},insertDefault:function(t){var s,r="on_popup_close",a=wp.template("pum-cookie-row"),l={event:r,cookie_settings:o.cookies[r]!==n?o.cookies[r]:{},save_button_text:i.add,index:e("#pum_popup_cookies_list tbody tr").length,I10n:i};l.cookie_settings.name=t||"pum-"+e("#post_ID").val(),s=a(l),e("#pum_popup_cookies_list tbody").append(s),PUMCookies.renumber(),e("#pum_popup_cookie_fields").addClass("has-cookies")}},e(t).on("select2:select pumselect2:select","#pum-first-cookie",function(){var t=e(this),s=t.val(),r="pum-cookie-settings-"+s,a="#"+r.replace(/-/g,"_"),l=wp.template(r),c={};c.cookie_settings=o.cookies[s]!==n?o.cookies[s]:{},c.cookie_settings.name="pum-"+e("#post_ID").val(),c.save_button_text=i.add,c.index=null,l.length||alert("Something went wrong. Please refresh and try again."),PUMModals.reload(a,l(c)),PUMCookies.initEditForm(),t.val(null).trigger("change")}).on("click",".field.cookiekey button.reset",PUMCookies.resetCookieKey).on("click",".cookie-editor .pum-form .field.checkbox.session",PUMCookies.updateSessionsCheckbox).on("click","#pum_popup_cookies .add-new",function(){var e=wp.template("pum-cookie-add-event");PUMModals.reload("#pum_cookie_add_event_modal",e())}).on("click","#pum_popup_cookies_list .edit",function(t){var n=e(this),o=n.parents("tr:first"),s=o.find(".popup_cookies_field_event").val(),r="pum-cookie-settings-"+s,a="#"+r.replace(/-/g,"_"),l=wp.template(r),c={index:o.parent().children().index(o),event:s,cookie_settings:JSON.parse(o.find(".popup_cookies_field_settings:first").val())};t.preventDefault(),c.save_button_text=i.save,l.length||alert("Something went wrong. Please refresh and try again."),PUMModals.reload(a,l(c)),PUMCookies.initEditForm()}).on("click","#pum_popup_cookies_list .remove",function(t){var n=e(this),o=n.parents("tr:first");t.preventDefault(),window.confirm(i.confirm_delete_cookie)&&(o.remove(),e("#pum_popup_cookies_list tbody tr").length||(e("#pum-first-cookie").val(null).trigger("change"),e("#pum_popup_cookie_fields").removeClass("has-cookies")),PUMCookies.renumber())}).on("submit","#pum_cookie_add_event_modal .pum-form",function(t){var s=e("#popup_cookie_add_event").val(),r="pum-cookie-settings-"+s,a="#"+r.replace(/-/g,"_"),l=wp.template(r),c={};t.preventDefault(),c.cookie_settings=o.cookies[s]!==n?o.cookies[s]:{},c.cookie_settings.name="pum-"+e("#post_ID").val(),c.save_button_text=i.add,c.index=null,l.length||alert("Something went wrong. Please refresh and try again."),PUMModals.reload(a,l(c)),PUMCookies.initEditForm()}).on("submit",".cookie-editor .pum-form",function(t){var n,o,s,r=e(this),a=(r.find("input.event").val(),r.pumSerializeObject()),l=parseInt(a.index),c=l>=0?e("#pum_popup_cookies_list tbody tr").eq(l):null,p=wp.template("pum-cookie-row");t.preventDefault(),(!l||l<0)&&(a.index=e("#pum_popup_cookies_list tbody tr").length),a.I10n=i,n=p(a),c?c.replaceWith(n):e("#pum_popup_cookies_list tbody").append(n),PUMModals.closeAll(),PUMCookies.renumber(),e("#pum_popup_cookie_fields").addClass("has-cookies"),PUMTriggers.new_cookie!==!1&&PUMTriggers.new_cookie>=0&&(o=e("#pum_popup_triggers_list tbody tr").eq(PUMTriggers.new_cookie).find(".popup_triggers_field_settings:first"),s=JSON.parse(o.val()),s.cookie.name[s.cookie.name.indexOf("add_new")]=a.cookie_settings.name,o.val(JSON.stringify(s)),PUMTriggers.new_cookie=!1,PUMTriggers.refreshDescriptions())}).ready(function(){PUMCookies.refreshDescriptions(),e("#pum-first-cookie").val(null).trigger("change")})}(jQuery,document),function(e,t,n){"use strict";var i={init:function(){e("#popmake_popup_auto_open_fields, #popmake_popup_targeting_condition_fields").length&&(i.initialize_popup_page(),i.attachQuickSearchListeners(),i.attachTabsPanelListeners())},attachTabsPanelListeners:function(){e("#poststuff").bind("click",function(t){var n,i,o,s,r,a,l,c,p,u,d,h,f,m,g=e(t.target);if(g.hasClass("nav-tab-link"))i=g.data("type"),o=g.parents(".posttypediv, .taxonomydiv").first(),e("input",o).removeAttr("checked"),e(".tabs-panel-active",o).removeClass("tabs-panel-active").addClass("tabs-panel-inactive"),e("#"+i,o).removeClass("tabs-panel-inactive").addClass("tabs-panel-active"),e(".tabs",o).removeClass("tabs"),g.parent().addClass("tabs"),e(".quick-search",o).focus(),t.preventDefault();else if(g.hasClass("select-all"))n=/#(.*)$/.exec(t.target.href),n&&n[1]&&(s=e("#"+n[1]+" .tabs-panel-active .menu-item-title input"),s.length===s.filter(":checked").length?s.removeAttr("checked"):s.prop("checked",!0));else if(g.hasClass("submit-add-to-menu")){for(r=g.parents(".options"),a=e('.tabs-panel-active input[type="checkbox"]:checked',r),l=e("textarea",r),c=e(".tagchecklist",r),p=l.val().split(","),u=0;u<p.length;u+=1)p[u]=parseInt(p[u],10);a.each(function(){d=e(this),h=parseInt(d.val(),10),f=d.parent("label").siblings(".menu-item-title").val(),e.inArray(h,p)===-1&&p.push(h),c.append('<span><a class="ntdelbutton" data-id="'+h+'">X</a> '+f+"</span>")}),l.text(p.join(",")),t.preventDefault()}else g.hasClass("ntdelbutton")&&(d=g,m=parseInt(d.data("id"),10),r=g.parents(".options"),l=e("textarea",r),c=e(".tagchecklist",r),p=l.val().split(","),p=e.grep(p,function(e){return parseInt(e,10)!==parseInt(m,10)}),d.parent("span").remove(),l.text(p.join(",")))})},attachQuickSearchListeners:function(){var t;e(".quick-search").keypress(function(n){var o=e(this);return 13===n.which?(i.updateQuickSearchResults(o),!1):(t&&clearTimeout(t),void(t=setTimeout(function(){i.updateQuickSearchResults(o)},400)))}).attr("autocomplete","off")},updateQuickSearchResults:function(t){var n,o,s=2,r=t.val();r.length<s||(n=t.parents(".tabs-panel"),o={action:"menu-quick-search","response-format":"markup",menu:null,"menu-settings-column-nonce":e("#menu-settings-column-nonce").val(),q:r,type:t.attr("name")},e(".spinner",n).show(),e.post(ajaxurl,o,function(e){i.processQuickSearchQueryResponse(e,o,n)}))},processQuickSearchQueryResponse:function(t,n,i){var o,s,r,a=e("form#post"),l={},c=/menu-item[(\[\^]\]*/,p=e("<div>").html(t).find("li");return p.length?(p.each(function(){if(r=e(this),o=c.exec(r.html()),o&&o[1]){for(s=o[1];a.elements["menu-item["+s+"][menu-item-type]"]||l[s];)s-=1;l[s]=!0,s!==o[1]&&r.html(r.html().replace(new RegExp("menu-item\\["+o[1]+"\\]","g"),"menu-item["+s+"]"))}}),e(".categorychecklist",i).html(p),e(".spinner",i).hide(),void e('[name^="menu-item"]').removeAttr("name")):(e(".categorychecklist",i).html("<li><p>noResultsFound</p></li>"),void e(".spinner",i).hide())},initialize_popup_page:function(){var n=function(t){var n,i,o=t.siblings(".options");t.is(":checked")?(o.show(),"popup_targeting_condition_on_entire_site"===t.attr("id")?(n=t.parents("#popmake_popup_targeting_condition_fields").find('[id^="targeting_condition-exclude_on_"]'),i=t.parents(".targeting_condition").siblings(".targeting_condition"),i.hide(),e("> *",i).prop("disabled",!0),n.show(),e("> *",n).prop("disabled",!1)):e("*",o).prop("disabled",!1)):(o.hide(),"popup_targeting_condition_on_entire_site"===t.attr("id")?(n=t.parents("#popmake_popup_targeting_condition_fields").find('[id^="targeting_condition-exclude_on_"]'),i=t.parents(".targeting_condition").siblings(".targeting_condition"),i.show(),e("> *",i).prop("disabled",!1),n.hide(),e("> *",n).prop("disabled",!0)):e("*",o).prop("disabled",!0))},i=function(t){var n=t.parents(".options").find('input[type="checkbox"]:eq(0)'),i=n.attr("name").indexOf("exclude")>=0,o=i?n.attr("name").replace("popup_targeting_condition_exclude_on_specific_",""):n.attr("name").replace("popup_targeting_condition_on_specific_",""),s=e(i?"#exclude_on_specific_"+o:"#on_specific_"+o);t.is(":checked")&&("true"===t.val()?(n.prop("checked",!0),s.show(),e("*",s).prop("disabled",!1)):""===t.val()&&(n.prop("checked",!1),s.hide(),e("*",s).prop("disabled",!0)))},o=function(){e("#popup_auto_open_session_cookie").is(":checked")?e(".not-session-cookie").hide():e(".not-session-cookie").show()},s=function(){e("#popup_auto_open_enabled").is(":checked")?(e(".auto-open-enabled").show(),o()):e(".auto-open-enabled").hide()},r=function(){e("#popup_auto_open_cookie_key").val((new Date).getTime().toString(16))};e('[name^="menu-item"]').removeAttr("name"),e("#title").prop("required",!0),e(t).on("click","#popup_auto_open_session_cookie",function(){o()}).on("click","#popup_auto_open_enabled",function(){s()}).on("click",".popmake-reset-auto-open-cookie-key",function(){r()}),e('#popmake_popup_targeting_condition_fields .targeting_condition > input[type="checkbox"]').on("click",function(){n(e(this))}).each(function(){n(e(this))}),e('input[type="radio"][id*="popup_targeting_condition_"]').on("click",function(){i(e(this))}).each(function(){i(e(this))}),e(".posttypediv, .taxonomydiv").each(function(){var t=e(this),n=e("> ul li"),i=e(".tabs-panel",t);n.removeClass("tabs"),n.eq(0).addClass("tabs"),i.removeClass("tabs-panel-active").addClass("tabs-panel-inactive").removeAttr("style"),i.eq(0).removeClass("tabs-panel-inactive").addClass("tabs-panel-active")}),s(),""===e("#popup_auto_open_cookie_key").val()&&r()}};e(t).ready(function(){i.init(),e(t).trigger("pum_init")})}(jQuery,document);var PUMMarketing;!function(e,t,n){"use strict";PUMMarketing={init:function(){e('#menu-posts-popup ul li a[href="edit.php?post_type=popup&page=extensions"]').css({color:"#9aba27"})}},e(t).ready(PUMMarketing.init)}(jQuery,document);var PUMModals;!function(e,t,n){"use strict";var i,o,s,r=e("html"),a=e(t),l="a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), iframe, object, embed, *[tabindex], *[contenteditable]";PUMModals={forceFocus:function(e){s&&!s.contains(e.target)&&(e.stopPropagation(),s.focus())},trapEscapeKey:function(e){27===e.keyCode&&(PUMModals.closeAll(),e.preventDefault())},trapTabKey:function(t){if(9===t.keyCode){var n=s.find("*").filter(l).filter(":visible"),i=e(":focus"),o=n.length,r=n.index(i);t.shiftKey?0===r&&(n.get(o-1).focus(),t.preventDefault()):r===o-1&&(n.get(0).focus(),t.preventDefault())}},setFocusToFirstItem:function(){s.find(".pum-modal-content *").filter(l).filter(":visible").first().focus()},closeAll:function(t){e(".pum-modal-background").off("keydown.pum_modal").hide(0,function(){e("html").css({overflow:"visible",width:"auto"}),i&&(i.attr("aria-hidden","false"),i=null),o.length&&o.focus(),s=null,a.off("focus.pum_modal"),n!==t&&t()}).attr("aria-hidden","true")},show:function(t,a){e(".pum-modal-background").off("keydown.pum_modal").hide(0).attr("aria-hidden","true"),r.data("origwidth",r.innerWidth()).css({overflow:"hidden",width:r.innerWidth()});var l=e(":focus");l.parents(".pum-modal-wrap").length||(o=l),s=e(t),s.on("keydown.pum_modal",function(e){PUMModals.trapEscapeKey(e),PUMModals.trapTabKey(e)}).show(0,function(){i=e("body > *").filter(":visible").not(s),i.attr("aria-hidden","true"),s.trigger("pum_init").on("focus.pum_modal",PUMModals.forceFocus),PUMModals.setFocusToFirstItem(),n!==a&&a()}).attr("aria-hidden","false")},remove:function(t){e(t).remove()},replace:function(t,n){PUMModals.remove(e.trim(t)),e("body").append(e.trim(n))},reload:function(e,t,n){PUMModals.replace(e,t),PUMModals.show(e,n)}},e(t).on("click",".pum-modal-background, .pum-modal-wrap .cancel, .pum-modal-wrap .pum-modal-close",function(t){var n=e(t.target);(n.hasClass("pum-modal-background")||n.hasClass("cancel")||n.hasClass("pum-modal-close")||n.hasClass("submitdelete"))&&(PUMModals.closeAll(),t.preventDefault(),t.stopPropagation())})}(jQuery,document);var PUMRangeSLiders;!function(e,t,n){"use strict";PUMRangeSLiders={init:function(){var n,i,o,s,r,a=e('<input type="range"/>'),l=e('<button type="button" class="popmake-range-plus">+</button>'),c=e('<button type="button" class="popmake-range-minus">-</button>');e(".popmake-range-manual").filter(":not(.initialized)").each(function(){var p=e(this).addClass("initialized"),u=p.data("force-minmax"),d=parseInt(p.prop("min"),0),h=parseInt(p.prop("max"),0),f=parseInt(p.prop("step"),0),m=parseInt(p.val(),0);o=a.clone(),s=l.clone(),r=c.clone(),u&&m>h&&(m=h,p.val(m)),o.prop({min:d||0,max:u||h&&h>m?h:1.5*m,step:f||1.5*m/100,value:m}).on("change input",function(){p.trigger("input")}),p.next().after(r,s),p.before(o),n=t.createElement("input"),n.setAttribute("type","range"),"text"===n.type&&e("input[type=range]").each(function(t,n){i=e(n),o=e("<div />").slider({min:parseInt(i.attr("min"),10)||0,max:parseInt(i.attr("max"),10)||100,value:parseInt(i.attr("value"),10)||0,step:parseInt(i.attr("step"),10)||1,slide:function(t,n){e(this).prev("input").val(n.value)}}),i.after(o).hide()})})}},e(t).on("pum_init",PUMRangeSLiders.init).on("input",'input[type="range"]',function(){var t=e(this);t.siblings(".popmake-range-manual").val(t.val())}).on("change",".popmake-range-manual",function(){var t=e(this),n=parseInt(t.prop("max"),0),i=parseInt(t.prop("step"),0),o=t.data("force-minmax"),s=parseInt(t.val(),0),r=t.prev();isNaN(s)&&(s=r.val(),t.val(s)),o&&s>n&&(s=n,t.val(s)),r.prop({max:o||n&&n>s?n:1.5*s,step:i||1.5*s/100,value:s})}).on("click",".popmake-range-plus",function(t){var n=e(this).siblings(".popmake-range-manual"),i=parseInt(n.prop("step"),0),o=parseInt(n.val(),0),s=o+i,r=n.prev();t.preventDefault(),n.val(s).trigger("input"),r.val(s)}).on("click",".popmake-range-minus",function(t){var n=e(this).siblings(".popmake-range-manual"),i=parseInt(n.prop("step"),0),o=parseInt(n.val(),0),s=o-i,r=n.prev();t.preventDefault(),n.val(s).trigger("input"),r.val(s)})}(jQuery,document);var PUMSelect2Fields;!function(e,t,n){"use strict";e.fn.pumselect2=e.fn.pumselect2||e.fn.select2,PUMSelect2Fields={init:function(){e(".pum-select2 select").filter(":not(.initialized)").each(function(){var t=e(this),i=t.data("current"),o=t.data("objecttype"),s=t.data("objectkey"),r={multiple:!1,dropdownParent:t.parent()};t.attr("multiple")&&(r.multiple=!0),o&&s&&(r=e.extend(r,{ajax:{url:ajaxurl,dataType:"json",delay:250,data:function(e){return{s:e.term,page:e.page,action:"pum_object_search",object_type:o,object_key:s}},processResults:function(e,t){return t.page=t.page||1,{results:e.items,pagination:{more:10*t.page<e.total_count}}},cache:!0},cache:!0,escapeMarkup:function(e){return e},minimumInputLength:1,templateResult:PUMSelect2Fields.formatObject,templateSelection:PUMSelect2Fields.formatObjectSelection})),t.addClass("initialized").pumselect2(r),i!==n&&("object"!=typeof i&&(i=[i]),o&&s?e.ajax({url:ajaxurl,data:{action:"pum_object_search",object_type:o,object_key:s,include:i},dataType:"json",success:function(n){e.each(n.items,function(e,n){t.find('option[value="'+n.id+'"]').length||t.prepend('<option value="'+n.id+'">'+n.text+"</option>")}),t.val(i).trigger("change")}}):t.val(i).trigger("change"))})},formatObject:function(e){return e.text},formatObjectSelection:function(e){return e.text||e.text}},e(t).on("pum_init",PUMSelect2Fields.init)}(jQuery,document),function(e,t,n){function i(t,n){return e.inArray(n,t)!==-1}function o(e,t,n){var i=t[0];t.length>1?(e[i]||(e[i]=t[1]?{}:[]),o(e[i],t.slice(1),n)):(i||(i=e.length),e[i]=n)}var s="color,date,datetime,datetime-local,email,hidden,month,number,password,range,search,tel,text,time,url,week".split(","),r="select,textarea".split(","),a=/\[([^\]]*)\]/g;e.fn.pumSerializeObject=function(t){e.extend({},t);var n={},l=e.extend(!0,{include:[],exclude:[],includeByClass:""},t);return this.find(":input").each(function(){var t;!this.name||this.disabled||i(l.exclude,this.name)||l.include.length&&!i(l.include,this.name)||this.className.indexOf(l.includeByClass)===-1||(t=this.name.replace(a,"[$1").split("["),t[0]&&(this.checked||i(s,this.type)||i(r,this.nodeName.toLowerCase()))&&("checkbox"===this.type&&t.push(""),o(n,t,e(this).val())))}),n}}(jQuery,document);var PUMTabs;!function(e,t,n){"use strict";PUMTabs={init:function(){e(".pum-tabs-container").filter(":not(.initialized)").each(function(){var t=e(this),n=t.find(".tab:first");t.hasClass("vertical-tabs")&&t.css({minHeight:t.find(".tabs").eq(0).outerHeight(!0)}),t.find(".active").removeClass("active"),n.addClass("active"),e(n.find("a").attr("href")).addClass("active"),t.addClass("initialized")})}},e(t).on("pum_init",PUMTabs.init).on("click",".pum-tabs-container .tab",function(t){var n=e(this),i=n.parents(".pum-tabs-container:first"),o=n.find("a").attr("href");i.find(".active").removeClass("active"),n.addClass("active"),e(o).addClass("active"),t.preventDefault()})}(jQuery,document);var PUM_Templates;!function(e,t,n){"use strict";var i=pum_admin.I10n;PUM_Templates={render:function(e,t){var n=wp.template(e);return"object"==typeof t.classes&&(t.classes=t.classes.join(" ")),t=PUM_Templates.prepareMeta(t),n(t)},shortcode:function(t){var n=e.extend({},{tag:"",meta:{},has_content:!1,content:""},t),i=n.has_content?"pum-shortcode-w-content":"pum-shortcode";return PUM_Templates.render(i,n)},modal:function(t){var n=e.extend({},{id:"",title:"",description:"",classes:"",save_button:i.save,cancel_button:i.cancel,content:""},t);return PUM_Templates.render("pum-modal",n)},tabs:function(t){var n=t.classes||[],i=e.extend({},{id:"",vertical:!0,form:!0,classes:"",tabs:{general:{label:"General",content:""}}},t);return i.form&&n.push("tabbed-form"),i.vertical&&n.push("vertical-tabs"),i.classes=i.classes+" "+n.join(" "),PUM_Templates.render("pum-tabs",i)},section:function(t){var n=e.extend({},{classes:[],fields:[]},t);return PUM_Templates.render("pum-field-section",n)},field:function(t){var i="pum-field-"+t.type,o=[],s=e.extend({},{type:"text",id:"",id_prefix:"",name:"",label:null,placeholder:"",desc:null,size:"regular",classes:[],value:null,select2:!1,multiple:!1,as_array:!1,options:[],object_type:null,object_key:null,std:null,min:0,max:50,step:1,
4
+ unit:"px",required:!1,meta:{}},t);if(!e("#tmpl-"+i).length&&("objectselect"!==t.type&&"postselect"!==t.type&&"taxonomyselect"!==t.type||(i="pum-field-select"),!e("#tmpl-"+i).length))return"";switch(s.value||t.std===n||(s.value=t.std),"string"==typeof s.classes&&(s.classes=s.classes.split(" ")),t["class"]!==n&&s.classes.push(t["class"]),s.required&&(s.meta.required=!0,s.classes.push("pum-required")),t.type){case"select":case"objectselect":case"postselect":case"taxonomyselect":s.options!==n&&(_.each(s.options,function(e,t){var n=!1;s.multiple&&s.value.indexOf(e)!==!1?n="selected":s.multiple||s.value!=e||(n="selected"),o.push(PUM_Templates.prepareMeta({label:t,value:e,meta:{selected:n}}))}),s.options=o),s.multiple&&(s.meta.multiple=!0,s.as_array&&(s.name+="[]"),s.value&&s.value.length||(s.value=[]),"string"==typeof s.value&&(s.value=[s.value])),"select"!==t.type&&(s.select2=!0,s.classes.push("pum-field-objectselect"),s.classes.push("postselect"===t.type?"pum-field-postselect":"pum-field-taxonomyselect"),s.meta["data-objecttype"]="postselect"===t.type?"post_type":"taxonomy",s.meta["data-objectkey"]="postselect"===t.type?t.post_type:t.taxonomy,s.meta["data-current"]=s.value),s.select2&&(s.classes.push("pum-select2"),s.placeholder&&(s.meta["data-placeholder"]=s.placeholder));break;case"multicheck":s.options!==n&&(_.each(s.options,function(e,t){o.push({label:t,value:e,meta:{checked:s.value.indexOf(e)>=0}})}),s.options=o);break;case"checkbox":1===parseInt(s.value,10)&&(s.meta.checked=!0);break;case"rangeslider":s.meta.step=s.step,s.meta.min=s.min,s.meta.max=s.max;break;case"textarea":s.meta.cols=s.cols,s.meta.rows=s.rows}return s.field=PUM_Templates.render(i,s),PUM_Templates.render("pum-field-wrapper",s)},prepareMeta:function(e){var t,n=[];for(t in e.meta)e.meta.hasOwnProperty(t)&&("boolean"==typeof e.meta[t]?e.meta[t]&&n.push(_.escape(t)):n.push(_.escape(t)+'="'+_.escape(e.meta[t])+'"'));return e.meta=n.join(" "),e}}}(jQuery,document);var PUMTriggers;!function(e,t,n){"use strict";var i=pum_admin.I10n,o=pum_admin.defaults;PUMTriggers={new_cookie:!1,getLabel:function(e){return i.labels.triggers[e].name},getSettingsDesc:function(e,t){var n={evaluate:/<#([\s\S]+?)#>/g,interpolate:/\{\{\{([\s\S]+?)\}\}\}/g,escape:/\{\{([^\}]+?)\}\}(?!\})/g,variable:"data"},o=_.template(i.labels.triggers[e].settings_column,null,n);return t.I10n=i,o(t)},renumber:function(){e("#pum_popup_triggers_list tbody tr").each(function(){var t=e(this),n=t.parent().children().index(t),i=t.data("index");t.data("index",n),t.find("input").each(function(){var e="["+n+"]";this.name=this.name.replace("["+i+"]",e).replace("[]",e)})})},refreshDescriptions:function(){e("#pum_popup_triggers_list tbody tr").each(function(){var t=e(this),n=t.find(".popup_triggers_field_type").val(),i=JSON.parse(t.find(".popup_triggers_field_settings:first").val()),o=PUMTriggers.cookie_column_value(i.cookie.name);t.find("td.settings-column").html(PUMTriggers.getSettingsDesc(n,i)),t.find("td.cookie-column code").text(o)})},initEditForm:function(t){var n=e(".trigger-editor .pum-form"),i=n.find('input[name="type"]').val(),o=e("#name",n),s=t.trigger_settings,r=e("#pum_popup_cookies_list tbody tr");r.length||"click_open"===i||(PUMCookies.insertDefault(),r=e("#pum_popup_cookies_list tbody tr")),r.each(function(){var t=JSON.parse(e(this).find(".popup_cookies_field_settings:first").val());o.find('option[value="'+t.name+'"]').length||e('<option value="'+t.name+'">'+t.name+"</option>").appendTo(o)}),o.val(s.cookie.name).trigger("change.pumselect2")},cookie_column_value:function(e){var t=i.no_cookie;return e instanceof Array?t=e.join(", "):null!==e&&(t=e),t},append_click_selector_presets:function(){return e("#extra_selectors").each(function(){var t=e(this),n=_.template(e("#tmpl-pum-click-selector-presets").html()),i=t.parents(".pum-field").find(".pum-click-selector-presets");i.length||(t.before(n()),i=t.parents(".pum-field").find(".pum-click-selector-presets")),i.position({my:"right center",at:"right center",of:t})})},toggle_click_selector_presets:function(){e(this).parent().toggleClass("open")},reset_click_selector_presets:function(t){t!==n&&e(t.target).parents(".pum-click-selector-presets").length||e(".pum-click-selector-presets").removeClass("open")},insert_click_selector_preset:function(){var t=e(this),n=e("#extra_selectors"),i=n.val();""!==i&&(i+=", "),n.val(i+t.data("preset")),PUMTriggers.reset_click_selector_presets()}},PUMTriggers.refreshDescriptions(),e(t).on("pum_init",function(){PUMTriggers.append_click_selector_presets()}).on("click",".pum-click-selector-presets > span",PUMTriggers.toggle_click_selector_presets).on("click",".pum-click-selector-presets li",PUMTriggers.insert_click_selector_preset).on("click",PUMTriggers.reset_click_selector_presets).on("select2:select pumselect2:select","#pum-first-trigger",function(){var t=e(this),s=t.val(),r="pum-trigger-settings-"+s,a="#"+r.replace(/-/g,"_"),l=wp.template(r),c={};c.trigger_settings=o.triggers[s]!==n?o.triggers[s]:{},c.save_button_text=i.add,c.index=null,"click_open"!==s&&(c.trigger_settings.cookie.name="pum-"+e("#post_ID").val()),l.length||alert("Something went wrong. Please refresh and try again."),PUMModals.reload(a,l(c)),PUMTriggers.initEditForm(c),t.val(null).trigger("change")}).on("click","#pum_popup_triggers .add-new",function(){var e=wp.template("pum-trigger-add-type");PUMModals.reload("#pum_trigger_add_type_modal",e())}).on("click","#pum_popup_triggers_list .edit",function(t){var n=e(this),o=n.parents("tr:first"),s=o.find(".popup_triggers_field_type").val(),r="pum-trigger-settings-"+s,a="#"+r.replace(/-/g,"_"),l=wp.template(r),c={index:o.parent().children().index(o),type:s,trigger_settings:JSON.parse(o.find(".popup_triggers_field_settings:first").val())};t.preventDefault(),c.save_button_text=i.save,l.length||alert("Something went wrong. Please refresh and try again."),PUMModals.reload(a,l(c)),PUMTriggers.initEditForm(c)}).on("click","#pum_popup_triggers_list .remove",function(t){var n=e(this),o=n.parents("tr:first");t.preventDefault(),window.confirm(i.confirm_delete_trigger)&&(o.remove(),e("#pum_popup_triggers_list tbody tr").length||(e("#pum-first-trigger").val(null).trigger("change"),e("#pum_popup_trigger_fields").removeClass("has-triggers")),PUMTriggers.renumber())}).on("submit","#pum_trigger_add_type_modal .pum-form",function(t){var s=e("#popup_trigger_add_type").val(),r="pum-trigger-settings-"+s,a="#"+r.replace(/-/g,"_"),l=wp.template(r),c={};t.preventDefault(),c.trigger_settings=o.triggers[s]!==n?o.triggers[s]:{},c.save_button_text=i.add,c.index=null,"click_open"!==s&&(c.trigger_settings.cookie.name="pum-"+e("#post_ID").val()),l.length||alert("Something went wrong. Please refresh and try again."),PUMModals.reload(a,l(c)),PUMTriggers.initEditForm(c)}).on("submit",".trigger-editor .pum-form",function(t){var n,o=e(this),s=(o.find("input.type").val(),o.pumSerializeObject()),r=parseInt(s.index),a=r>=0?e("#pum_popup_triggers_list tbody tr").eq(r):null,l=wp.template("pum-trigger-row");t.preventDefault(),(!r||r<0)&&(s.index=e("#pum_popup_triggers_list tbody tr").length),s.I10n=i,n=l(s),a?a.replaceWith(n):e("#pum_popup_triggers_list tbody").append(n),PUMModals.closeAll(),PUMTriggers.renumber(),PUMTriggers.refreshDescriptions(),e("#pum_popup_trigger_fields").addClass("has-triggers"),null!==s.trigger_settings.cookie.name&&s.trigger_settings.cookie.name.indexOf("add_new")>=0&&(PUMTriggers.new_cookie=s.index,e("#pum_popup_cookie_fields button.add-new").trigger("click"))}).ready(function(){PUMTriggers.refreshDescriptions(),e("#pum-first-trigger").val(null).trigger("change")})}(jQuery,document);var PUMUtils;!function(e,t,n){"use strict";PUMUtils={convert_meta_to_object:function(e){var t,i,o,s={};for(o in e)e.hasOwnProperty(o)&&(t=o.split(/_(.+)?/)[0],i=o.split(/_(.+)?/)[1],s[t]===n&&(s[t]={}),s[t][i]=e[o]);return s},serialize_form:function(t){var n={};return e("[name]",t).each(function(){var t,i,o=e(this).attr("name"),s=e(this).val(),r=o.split("["),a=n,l=r.length;for(t=0;t<l;t+=1)i=r[t].replace("]",""),a[i]||(a[i]={}),t!==r.length-1?a=a[i]:t===r.length-1&&(a[i]=s)}),n},convert_hex:function(e,t){if(n===e)return"";n===t&&(t=100),e=e.replace("#","");var i=parseInt(e.substring(0,2),16),o=parseInt(e.substring(2,4),16),s=parseInt(e.substring(4,6),16),r="rgba("+i+","+o+","+s+","+t/100+")";return r},debounce:function(e,t){var n;return function(){var i=this,o=arguments;window.clearTimeout(n),n=window.setTimeout(function(){e.apply(i,o)},t)}},throttle:function(e,t){var n=!1,i=function(){n=!1};return function(){n||(e(),window.setTimeout(i,t),n=!0)}}},String.prototype.capitalize=function(){return this.charAt(0).toUpperCase()+this.slice(1)}}(jQuery,document);var PopMakeAdmin,PUM_Admin;!function(e,t,n){"use strict";var i=e(t);pum_admin.I10n,pum_admin.defaults;PUM_Admin={},PopMakeAdmin={init:function(){e("body.post-type-popup form#post").length&&PopMakeAdmin.initialize_popup_page(),e("body.post-type-popup_theme form#post").length&&PopMakeAdmin.initialize_theme_page()},initialize_popup_page:function(){var n=function(){"custom"===e("#popup_display_size").val()?(e(".custom-size-only").show(),e(".responsive-size-only").hide(),e("#popup_display_custom_height_auto").is(":checked")?e(".custom-size-height-only").hide():e(".custom-size-height-only").show()):(e(".custom-size-only").hide(),"auto"!==e("#popup_display_size").val()?(e(".responsive-size-only").show(),e("#popup_display_custom_height_auto").prop("checked",!1)):e(".responsive-size-only").hide())},i=function(){e(".animation-speed, .animation-origin").hide(),"fade"===e("#popup_display_animation_type").val()?e(".animation-speed").show():"none"!==e("#popup_display_animation_type").val()&&e(".animation-speed, .animation-origin").show()},o=function(){var t=e("#popup_display_location"),n=t.parents("table"),i=t.val();e("tr.top, tr.right, tr.left, tr.bottom",n).hide(),i.indexOf("top")>=0&&e("tr.top").show(),i.indexOf("left")>=0&&e("tr.left").show(),i.indexOf("bottom")>=0&&e("tr.bottom").show(),i.indexOf("right")>=0&&e("tr.right").show()};e("#popuptitlediv").insertAfter("#titlediv"),e("#title").prop("required",!0),e(t).on("change","#popup_theme",function(){var t=e(this),n=e("#edit_theme_link"),i=t.val();n.attr("href",n.data("baseurl")+i)}).on("keydown","#popuptitle",function(t){var n=t.keyCode||t.which;9===n&&(t.preventDefault(),e("#title").focus())}).on("keydown","#title, #popuptitle",function(t){var n,i=t.keyCode||t.which;t.shiftKey||9!==i||(t.preventDefault(),n="title"===e(this).attr("id")?"#popuptitle":"#insert-media-button",e(n).focus())}).on("keydown","#popuptitle, #insert-media-button",function(t){var n,i=t.keyCode||t.which;t.shiftKey&&9===i&&(t.preventDefault(),n="popuptitle"===e(this).attr("id")?"#title":"#popuptitle",e(n).focus())}).on("click","#popup_display_custom_height_auto",function(){n()}).on("change","#popup_display_size",function(){"custom"!==e("#popup_display_size").val()&&"auto"!==e("#popup_display_size").val()&&e("#popup_display_position_fixed, #popup_display_scrollable_content").prop("checked",!1),n()}).on("change","#popup_display_animation_type",function(){i()}).on("change","#popup_display_location",function(){o()}),n(),i(),o()},theme_page_listeners:function(){var n=this;e(".empreview .example-popup-overlay, .empreview .example-popup, .empreview .title, .empreview .content, .empreview .close-popup").css("cursor","pointer"),e(t).on("click",".empreview .example-popup-overlay, .empreview .example-popup, .empreview .title, .empreview .content, .empreview .close-popup",function(t){var n=e(this),i=n.attr("class"),o=0;switch(t.preventDefault(),t.stopPropagation(),i){case"example-popup-overlay":o=e("#popmake_popup_theme_overlay").offset().top;break;case"example-popup":o=e("#popmake_popup_theme_container").offset().top;break;case"title":o=e("#popmake_popup_theme_title").offset().top;break;case"content":o=e("#popmake_popup_theme_content").offset().top;break;case"close-popup":o=e("#popmake_popup_theme_close").offset().top}e("html, body").animate({scrollTop:o+"px"})}).on("change","select.font-family",function(){e("select.font-weight option, select.font-style option",e(this).parents("table")).prop("selected",!1),n.update_font_selectboxes()}).on("change","select.font-weight, select.font-style",function(){n.update_font_selectboxes()}).on("change input focusout","select, input",function(){n.update_theme()}).on("change","select.border-style",function(){var t=e(this);"none"===t.val()?t.parents("table").find(".border-options").hide():t.parents("table").find(".border-options").show()}).on("change","#popup_theme_close_location",function(){var t=e(this),n=t.parents("table");e("tr.topleft, tr.topright, tr.bottomleft, tr.bottomright",n).hide(),e("tr."+t.val(),n).show()})},update_theme:function(){var t,n=e("[name^='popup_theme_']").serializeArray(),i={};for(t=0;n.length>t;t+=1)0===n[t].name.indexOf("popup_theme_")&&(i[n[t].name.replace("popup_theme_","")]=n[t].value);this.retheme_popup(i)},theme_preview_scroll:function(){var t=e("#popmake-theme-editor .empreview, body.post-type-popup_theme form#post #popmake_popup_theme_preview"),n=t.parent(),i=t.offset().top-50;e(window).on("scroll",function(){e("> .postbox:visible",n).index(t)===e("> .postbox:visible",n).length-1&&e(window).scrollTop()>=i?t.css({left:t.offset().left,width:t.width(),height:t.height(),position:"fixed",top:50}):t.removeAttr("style")})},update_font_selectboxes:function(){return e("select.font-family").each(function(){var t,i,o=e(this),s=o.parents("table").find("select.font-weight"),r=o.parents("table").find("select.font-style"),a=s.find("option"),l=r.find("option");if(popmake_google_fonts[o.val()]!==n){if(t=popmake_google_fonts[o.val()],a.hide(),l.hide(),t.variants.length)for(i=0;t.variants.length>i;i+=1)"regular"===t.variants[i]?(e('option[value=""]',s).show(),e('option[value=""]',r).show()):(t.variants[i].indexOf("italic")>=0&&e('option[value="italic"]',r).show(),e('option[value="'+parseInt(t.variants[i],10)+'"]',s).show())}else a.show(),l.show();s.parents("tr:first").show(),s.find("option:visible").length<=1?s.parents("tr:first").hide():s.parents("tr:first").show(),r.parents("tr:first").show(),r.find("option:visible").length<=1?r.parents("tr:first").hide():r.parents("tr:first").show()})},convert_theme_for_preview:function(e){},initialize_theme_page:function(){e("#popuptitlediv").insertAfter("#titlediv");var n=this,i=e("#popup_theme_close_location").parents("table");switch(n.update_theme(),n.theme_page_listeners(),n.theme_preview_scroll(),n.update_font_selectboxes(),e(t).on("click",".popmake-preview",function(t){t.preventDefault(),e("#popmake-preview, #popmake-overlay").css({visibility:"visible"}).show()}).on("click",".popmake-close",function(){e("#popmake-preview, #popmake-overlay").hide()}),e("select.border-style").each(function(){var t=e(this);"none"===t.val()?t.parents("table").find(".border-options").hide():t.parents("table").find(".border-options").show()}),e(".color-picker.background-color").each(function(){var t=e(this);""===t.val()?t.parents("table").find(".background-opacity").hide():t.parents("table").find(".background-opacity").show()}),e("tr.topleft, tr.topright, tr.bottomleft, tr.bottomright",i).hide(),e("#popup_theme_close_location").val()){case"topleft":e("tr.topleft",i).show();break;case"topright":e("tr.topright",i).show();break;case"bottomleft":e("tr.bottomleft",i).show();break;case"bottomright":e("tr.bottomright",i).show()}},retheme_popup:function(i){var o,s=e(".empreview .example-popup-overlay, #popmake-overlay"),r=e(".empreview .example-popup, #popmake-preview"),a=e(".title, .popmake-title",r),l=e(".content, .popmake-content",r),c=e(".close-popup, .popmake-close",r),p="yes"===i.container_boxshadow_inset?"inset ":"",u="yes"===i.close_boxshadow_inset?"inset ":"";switch(this.convert_theme_for_preview(i),popmake_google_fonts[i.title_font_family]!==n&&(o="//fonts.googleapis.com/css?family="+i.title_font_family,"normal"!==i.title_font_weight&&(o+=":"+i.title_font_weight),"italic"===i.title_font_style&&(o.indexOf(":")===-1&&(o+=":"),o+="italic"),e("body").append('<link href="'+o+'" rel="stylesheet" type="text/css">')),popmake_google_fonts[i.content_font_family]!==n&&(o="//fonts.googleapis.com/css?family="+i.content_font_family,"normal"!==i.content_font_weight&&(o+=":"+i.content_font_weight),"italic"===i.content_font_style&&(o.indexOf(":")===-1&&(o+=":"),o+="italic"),e("body").append('<link href="'+o+'" rel="stylesheet" type="text/css">')),popmake_google_fonts[i.close_font_family]!==n&&(o="//fonts.googleapis.com/css?family="+i.close_font_family,"normal"!==i.close_font_weight&&(o+=":"+i.close_font_weight),"italic"===i.close_font_style&&(o.indexOf(":")===-1&&(o+=":"),o+="italic"),e("body").append('<link href="'+o+'" rel="stylesheet" type="text/css">')),s.removeAttr("style").css({backgroundColor:PUMUtils.convert_hex(i.overlay_background_color,i.overlay_background_opacity)}),r.removeAttr("style").css({padding:i.container_padding+"px",backgroundColor:PUMUtils.convert_hex(i.container_background_color,i.container_background_opacity),borderStyle:i.container_border_style,borderColor:i.container_border_color,borderWidth:i.container_border_width+"px",borderRadius:i.container_border_radius+"px",boxShadow:p+i.container_boxshadow_horizontal+"px "+i.container_boxshadow_vertical+"px "+i.container_boxshadow_blur+"px "+i.container_boxshadow_spread+"px "+PUMUtils.convert_hex(i.container_boxshadow_color,i.container_boxshadow_opacity)}),a.removeAttr("style").css({color:i.title_font_color,lineHeight:i.title_line_height+"px",fontSize:i.title_font_size+"px",fontFamily:i.title_font_family,fontStyle:i.title_font_style,fontWeight:i.title_font_weight,textAlign:i.title_text_align,textShadow:i.title_textshadow_horizontal+"px "+i.title_textshadow_vertical+"px "+i.title_textshadow_blur+"px "+PUMUtils.convert_hex(i.title_textshadow_color,i.title_textshadow_opacity)}),l.removeAttr("style").css({color:i.content_font_color,fontFamily:i.content_font_family,fontStyle:i.content_font_style,fontWeight:i.content_font_weight}),c.html(i.close_text).removeAttr("style").css({padding:i.close_padding+"px",height:i.close_height>0?i.close_height+"px":"auto",width:i.close_width>0?i.close_width+"px":"auto",backgroundColor:PUMUtils.convert_hex(i.close_background_color,i.close_background_opacity),color:i.close_font_color,lineHeight:i.close_line_height+"px",fontSize:i.close_font_size+"px",fontFamily:i.close_font_family,fontWeight:i.close_font_weight,fontStyle:i.close_font_style,borderStyle:i.close_border_style,borderColor:i.close_border_color,borderWidth:i.close_border_width+"px",borderRadius:i.close_border_radius+"px",boxShadow:u+i.close_boxshadow_horizontal+"px "+i.close_boxshadow_vertical+"px "+i.close_boxshadow_blur+"px "+i.close_boxshadow_spread+"px "+PUMUtils.convert_hex(i.close_boxshadow_color,i.close_boxshadow_opacity),textShadow:i.close_textshadow_horizontal+"px "+i.close_textshadow_vertical+"px "+i.close_textshadow_blur+"px "+PUMUtils.convert_hex(i.close_textshadow_color,i.close_textshadow_opacity)}),i.close_location){case"topleft":c.css({top:i.close_position_top+"px",left:i.close_position_left+"px"});break;case"topright":c.css({top:i.close_position_top+"px",right:i.close_position_right+"px"});break;case"bottomleft":c.css({bottom:i.close_position_bottom+"px",left:i.close_position_left+"px"});break;case"bottomright":c.css({bottom:i.close_position_bottom+"px",right:i.close_position_right+"px"})}e(t).trigger("popmake-admin-retheme",[i])}},i.ready(function(){PopMakeAdmin.init(),i.trigger("pum_init")})}(jQuery,document);
assets/js/site.js CHANGED
@@ -1571,7 +1571,9 @@ var pm_cookie, pm_cookie_json, pm_remove_cookie;
1571
  }
1572
  });
1573
 
1574
- $.fn.popmake.cookies = {
 
 
1575
  on_popup_open: function (settings) {
1576
  var $popup = PUM.getPopup(this);
1577
  $popup.on('pumAfterOpen', function () {
@@ -1595,8 +1597,8 @@ var pm_cookie, pm_cookie_json, pm_remove_cookie;
1595
  $popup.on('pum_nf.success', function () {
1596
  $popup.popmake('setCookie', settings);
1597
  });
1598
- }
1599
- };
1600
 
1601
  // Register All Cookies for a Popup
1602
  $(document)
@@ -2282,6 +2284,135 @@ var pum_debug_mode = false,
2282
  window.pum.hooks = window.pum.hooks || new EventManager();
2283
 
2284
  })(window);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2285
  (function ($) {
2286
  "use strict";
2287
 
1571
  }
1572
  });
1573
 
1574
+ $.fn.popmake.cookies = $.fn.popmake.cookies || {};
1575
+
1576
+ $.extend($.fn.popmake.cookies, {
1577
  on_popup_open: function (settings) {
1578
  var $popup = PUM.getPopup(this);
1579
  $popup.on('pumAfterOpen', function () {
1597
  $popup.on('pum_nf.success', function () {
1598
  $popup.popmake('setCookie', settings);
1599
  });
1600
+ },
1601
+ });
1602
 
1603
  // Register All Cookies for a Popup
1604
  $(document)
2284
  window.pum.hooks = window.pum.hooks || new EventManager();
2285
 
2286
  })(window);
2287
+ /*******************************************************************************
2288
+ * Copyright (c) 2017, WP Popup Maker
2289
+ ******************************************************************************/
2290
+ (function ($) {
2291
+ "use strict";
2292
+
2293
+ $.fn.popmake.cookies = $.fn.popmake.cookies || {};
2294
+
2295
+ $.extend($.fn.popmake.cookies, {
2296
+ cf7_form_success: function (settings) {
2297
+ var $popup = PUM.getPopup(this);
2298
+ $popup.on('pum_cf7.success', function () {
2299
+ $popup.popmake('setCookie', settings);
2300
+ });
2301
+ }
2302
+ });
2303
+
2304
+ $(document).on('wpcf7:submit', '.wpcf7', function (event) {
2305
+ var $form = $(event.target),
2306
+ $settings = $form.find('meta[name="wpcf7-pum"]'),
2307
+ settings = $settings.length ? JSON.parse($settings.attr('content')) : false,
2308
+ $popup = $form.parents('.pum');
2309
+
2310
+ if (!settings) {
2311
+ return;
2312
+ }
2313
+
2314
+ settings = $.extend({
2315
+ openpopup: false,
2316
+ openpopup_id: 0,
2317
+ closepopup: false,
2318
+ closedelay: 0
2319
+ }, settings);
2320
+
2321
+ if ($popup.length) {
2322
+ $popup.trigger('pum_cf7.success');
2323
+
2324
+ }
2325
+
2326
+ if ($popup.length && settings.closepopup) {
2327
+ setTimeout(function () {
2328
+ $popup.popmake('close');
2329
+
2330
+ // Trigger another if set up.
2331
+ if (settings.openpopup && PUM.getPopup(settings.openpopup_id).length) {
2332
+ PUM.open(settings.openpopup_id);
2333
+ }
2334
+ }, parseInt(settings.closedelay));
2335
+ } else if (settings.openpopup) {
2336
+ $popup = PUM.getPopup(settings.openpopup_id);
2337
+
2338
+ if ($popup.length) {
2339
+ $popup.popmake('open');
2340
+ }
2341
+ }
2342
+
2343
+ });
2344
+ }(jQuery));
2345
+ /*******************************************************************************
2346
+ * Copyright (c) 2017, WP Popup Maker
2347
+ ******************************************************************************/
2348
+ (function ($) {
2349
+ "use strict";
2350
+
2351
+ $.fn.popmake.cookies = $.fn.popmake.cookies || {};
2352
+
2353
+ $.extend($.fn.popmake.cookies, {
2354
+ gforms_form_success: function (settings) {
2355
+ var $popup = PUM.getPopup(this);
2356
+ $popup.on('pum_gforms.success', function () {
2357
+ $popup.popmake('setCookie', settings);
2358
+ });
2359
+ }
2360
+ });
2361
+
2362
+ $(document).ready(function () {
2363
+ $('.pum .gform_wrapper > form').each(function () {
2364
+ var $form = $(this),
2365
+ form_id = $form.attr('id').replace('gform_', ''),
2366
+ $settings = $form.find('meta[name="gforms-pum"]'),
2367
+ settings = $settings.length ? JSON.parse($settings.attr('content')) : false,
2368
+ $popup = $form.parents('.pum');
2369
+
2370
+ if (!settings) {
2371
+ return;
2372
+ }
2373
+
2374
+ settings = $.extend({
2375
+ openpopup: false,
2376
+ openpopup_id: 0,
2377
+ closepopup: false,
2378
+ closedelay: 0
2379
+ }, settings);
2380
+
2381
+ $popup.attr('data-gform-id', form_id).data('gform-id', form_id);
2382
+ $popup.attr('data-gform-settings', JSON.stringify(settings)).data('gform-settings', settings);
2383
+ });
2384
+ });
2385
+
2386
+ $(document).on('gform_confirmation_loaded', function (event, form_id) {
2387
+ var $popup = $('.pum[data-gform-id="' + form_id + '"]'),
2388
+ settings = $popup.data('gform-settings');
2389
+
2390
+ console.log($popup, settings);
2391
+
2392
+ if ( $popup.length ) {
2393
+ $popup.trigger('pum_gforms.success');
2394
+ }
2395
+
2396
+ if ($popup.length && settings.closepopup) {
2397
+
2398
+ setTimeout(function () {
2399
+ $popup.popmake('close');
2400
+
2401
+ // Trigger another if set up.
2402
+ if (settings.openpopup && PUM.getPopup(settings.openpopup_id).length) {
2403
+ PUM.open(settings.openpopup_id);
2404
+ }
2405
+ }, parseInt(settings.closedelay));
2406
+ } else if (settings.openpopup) {
2407
+ $popup = PUM.getPopup(settings.openpopup_id);
2408
+
2409
+ if ($popup.length) {
2410
+ $popup.popmake('open');
2411
+ }
2412
+ }
2413
+
2414
+ });
2415
+ }(jQuery));
2416
  (function ($) {
2417
  "use strict";
2418
 
assets/js/site.min.js CHANGED
@@ -1,2 +1,2 @@
1
- !function(e){"use strict";void 0===e.fn.on&&(e.fn.on=function(e,t,o){return this.delegate(t,e,o)}),void 0===e.fn.off&&(e.fn.off=function(e,t,o){return this.undelegate(t,e,o)}),void 0===e.fn.bindFirst&&(e.fn.bindFirst=function(t,o){var n,i,a=e(this);a.unbind(t,o),a.bind(t,o),n=e._data(a[0]).events,i=n[t],i.unshift(i.pop()),n[t]=i}),void 0===e.fn.outerHtml&&(e.fn.outerHtml=function(){var t=e(this).clone(),o=e("<div/>").append(t);return o.html()}),void 0===Date.now&&(Date.now=function(){return(new Date).getTime()})}(jQuery);var PUM;!function(e,t,o){"use strict";function n(e){return!isNaN(e)&&parseInt(Number(e))==e&&!isNaN(parseInt(e,10))}function i(){var e={},t=function(t,n,i){"boolean"==typeof n&&(i=n,n=!1);var a=n?n.selector+" "+t:t;return(o===e[a]||i)&&(e[a]=n?n.find(t):jQuery(t)),e[a]};return t.elementCache=e,t}function a(e,t){function o(e,t,o){return t?e[t.slice(0,o?-1:t.length)]:e}function n(e,t){return t?t.split("[").reduce(o,e):e}return t.split(".").reduce(n,e)}PUM={get:new i,getPopup:function(t){var o;return o=n(t)?PUM.get("#pum-"+t):"current"===t?PUM.get(".pum-overlay.pum-active:eq(0)",!0):"open"===t?PUM.get(".pum-overlay.pum-active",!0):"closed"===t?PUM.get(".pum-overlay:not(.pum-active)",!0):t instanceof jQuery?t:e(t),o.hasClass("pum-overlay")?o:o.hasClass("popmake")?o.parents(".pum-overlay"):o.parents(".pum-overlay").length?o.parents(".pum-overlay"):e()},open:function(e,t){PUM.getPopup(e).popmake("open",t)},close:function(e,t){PUM.getPopup(e).popmake("close",t)},preventOpen:function(e){PUM.getPopup(e).addClass("preventOpen")},getSettings:function(e){var t=PUM.getPopup(e);return t.popmake("getSettings")},getSetting:function(e,t,n){var i=PUM.getSettings(e),p=a(i,t);return"undefined"!=typeof p?p:n!==o?n:null},checkConditions:function(e){return PUM.getPopup(e).popmake("checkConditions")},getCookie:function(t){return e.pm_cookie(t)},clearCookie:function(t,o){e.pm_remove_cookie(t),"function"==typeof o&&o()},clearCookies:function(t,n){var i,a=PUM.getPopup(t),p=a.popmake("getSettings"),s=p.cookies;if(s!==o&&s.length)for(i=0;s.length>i;i+=1)e.pm_remove_cookie(s[i].settings.name);"function"==typeof n&&n()}},e.fn.popmake=function(o){return e.fn.popmake.methods[o]?(e(t).trigger("pumMethodCall",arguments),e.fn.popmake.methods[o].apply(this,Array.prototype.slice.call(arguments,1))):"object"!=typeof o&&o?void(window.console&&console.warn("Method "+o+" does not exist on $.fn.popmake")):e.fn.popmake.methods.init.apply(this,arguments)},e.fn.popmake.methods={init:function(t){return this.each(function(){var n=PUM.getPopup(this),i=e.extend(!0,{},e.fn.popmake.defaults,n.data("popmake"),t);return i.theme_id<=0&&(i.theme_id=popmake_default_theme),i.meta.display.disable_reposition===o&&e(window).on("resize",function(){(n.hasClass("pum-active")||n.find(".popmake.active").length)&&e.fn.popmake.utilities.throttle(setTimeout(function(){n.popmake("reposition")},25),500,!1)}),n.find(".pum-container").data("popmake",i),n.data("popmake",i).trigger("pumInit"),this})},getOverlay:function(){return e(this)},getContainer:function(){return e(this).find(".pum-container")},getTitle:function(){return e(this).find(".pum-title")||null},getContent:function(){return e(this).find(".pum-content")||null},getClose:function(){return e(this).find(".pum-content + .pum-close")||null},getSettings:function(){return e(this).data("popmake")},state:function(e){var t=PUM.getPopup(this);if(o!==e)switch(e){case"isOpen":return t.hasClass("pum-open")||t.popmake("getContainer").hasClass("active");case"isClosed":return!t.hasClass("pum-open")&&!t.popmake("getContainer").hasClass("active")}},open:function(t){var n=PUM.getPopup(this),i=n.popmake("getContainer"),a=n.popmake("getClose"),p=n.popmake("getSettings"),s=e("html");return n.trigger("pumBeforeOpen"),n.hasClass("preventOpen")||i.hasClass("preventOpen")?(console.log("prevented"),n.removeClass("preventOpen").removeClass("pum-active").trigger("pumOpenPrevented"),this):(p.meta.display.stackable||n.popmake("close_all"),n.addClass("pum-active"),p.meta.close.button_delay>0&&a.fadeOut(0),s.addClass("pum-open"),p.meta.display.overlay_disabled?s.addClass("pum-open-overlay-disabled"):s.addClass("pum-open-overlay"),p.meta.display.position_fixed!==o&&p.meta.display.position_fixed?s.addClass("pum-open-fixed"):s.addClass("pum-open-scrollable"),n.popmake("setup_close").popmake("reposition").css({"z-index":p.meta.display.overlay_zindex||1999999998}).popmake("animate",p.meta.display.animation_type,function(){p.meta.close.button_delay>0&&setTimeout(function(){a.fadeIn()},p.meta.close.button_delay),n.trigger("pumAfterOpen"),e.fn.popmake.last_open_popup=n,t!==o&&t()}),this)},setup_close:function(){var t=PUM.getPopup(this),n=t.popmake("getClose").add(e(".popmake-close",t).not(t.popmake("getClose"))),i=t.popmake("getSettings");return n.off("click.pum").on("click.pum",function(n){var i=e(this),a=i.hasClass("pum-do-default")||i.data("do-default")!==o&&i.data("do-default");a||n.preventDefault(),e.fn.popmake.last_close_trigger="Close Button",t.popmake("close")}),(i.meta.close.esc_press||i.meta.close.f4_press)&&e(window).off("keyup.popmake").on("keyup.popmake",function(o){27===o.keyCode&&i.meta.close.esc_press&&(e.fn.popmake.last_close_trigger="ESC Key",t.popmake("close")),115===o.keyCode&&i.meta.close.f4_press&&(e.fn.popmake.last_close_trigger="F4 Key",t.popmake("close"))}),i.meta.close.overlay_click&&t.off("click.popmake").on("click.popmake",function(o){o.target===t[0]&&(e.fn.popmake.last_close_trigger="Overlay Click",t.popmake("close"))}),t.trigger("pumSetupClose"),this},close:function(t){return this.each(function(){var n=PUM.getPopup(this),i=n.popmake("getContainer"),a=n.popmake("getClose").add(e(".popmake-close",n).not(n.popmake("getClose")));return n.trigger("pumBeforeClose"),n.hasClass("preventClose")||i.hasClass("preventClose")?(n.removeClass("preventClose").trigger("pumClosePrevented"),this):(i.fadeOut("fast",function(){n.is(":visible")&&n.fadeOut("fast"),e(window).off("keyup.popmake"),n.off("click.popmake"),a.off("click.popmake"),1===e(".pum-active").length&&e("html").removeClass("pum-open").removeClass("pum-open-scrollable").removeClass("pum-open-overlay").removeClass("pum-open-overlay-disabled").removeClass("pum-open-fixed"),n.removeClass("pum-active").trigger("pumAfterClose"),i.find("iframe").filter('[src*="youtube"],[src*="vimeo"]').each(function(){var t=e(this),o=t.attr("src"),n=o.replace("autoplay=1","1=1");n!==o&&(o=n),t.prop("src",o)}),i.find("video").each(function(){this.pause()}),t!==o&&t()}),this)})},close_all:function(){return e(".pum-active").popmake("close"),this},reposition:function(t){var o=PUM.getPopup(this).trigger("pumBeforeReposition"),n=o.popmake("getContainer"),i=o.popmake("getSettings"),a=i.meta.display,p=a.location,s={my:"",at:"",of:window,collision:"none",using:"function"==typeof t?t:e.fn.popmake.callbacks.reposition_using},r={overlay:null,container:null},l=null;try{l=e(e.fn.popmake.last_open_trigger)}catch(c){l=e()}return a.position_from_trigger&&l.length?(s.of=l,p.indexOf("left")>=0&&(s.my+=" right",s.at+=" left"+(0!==a.position_left?"-"+a.position_left:"")),p.indexOf("right")>=0&&(s.my+=" left",s.at+=" right"+(0!==a.position_right?"+"+a.position_right:"")),p.indexOf("center")>=0&&(s.my="center"===p?"center":s.my+" center",s.at="center"===p?"center":s.at+" center"),p.indexOf("top")>=0&&(s.my+=" bottom",s.at+=" top"+(0!==a.position_top?"-"+a.position_top:"")),p.indexOf("bottom")>=0&&(s.my+=" top",s.at+=" bottom"+(0!==a.position_bottom?"+"+a.position_bottom:""))):(p.indexOf("left")>=0&&(s.my+=" left"+(0!==a.position_left?"+"+a.position_left:""),s.at+=" left"),p.indexOf("right")>=0&&(s.my+=" right"+(0!==a.position_right?"-"+a.position_right:""),s.at+=" right"),p.indexOf("center")>=0&&(s.my="center"===p?"center":s.my+" center",s.at="center"===p?"center":s.at+" center"),p.indexOf("top")>=0&&(s.my+=" top"+(0!==a.position_top?"+"+(e("body").hasClass("admin-bar")?parseInt(a.position_top,10)+32:a.position_top):""),s.at+=" top"),p.indexOf("bottom")>=0&&(s.my+=" bottom"+(0!==a.position_bottom?"-"+a.position_bottom:""),s.at+=" bottom")),s.my=e.trim(s.my),s.at=e.trim(s.at),o.is(":hidden")&&(r.overlay=o.css("opacity"),o.css({opacity:0}).show(0)),n.is(":hidden")&&(r.container=n.css("opacity"),n.css({opacity:0}).show(0)),a.position_fixed&&n.addClass("fixed"),"custom"===i.meta.display.size?n.css({width:i.meta.display.custom_width+i.meta.display.custom_width_unit,height:i.meta.display.custom_height_auto?"auto":i.meta.display.custom_height+i.meta.display.custom_height_unit}):"auto"!==i.meta.display.size&&n.addClass("responsive").css({minWidth:""!==i.meta.display.responsive_min_width?i.meta.display.responsive_min_width+i.meta.display.responsive_min_width_unit:"auto",maxWidth:""!==i.meta.display.responsive_max_width?i.meta.display.responsive_max_width+i.meta.display.responsive_max_width_unit:"auto"}),o.trigger("pumAfterReposition"),n.addClass("custom-position").position(s).trigger("popmakeAfterReposition"),r.overlay&&o.css({opacity:r.overlay}).hide(0),r.container&&n.css({opacity:r.container}).hide(0),this},retheme:function(t){e(this).trigger("popmakeBeforeRetheme");var n,i,a=PUM.getPopup(this),p=a.popmake("getContainer"),s=a.popmake("getTitle"),r=a.popmake("getContent"),l=a.popmake("getClose"),c=a.popmake("getSettings");switch(t===o&&(t=e.fn.popmake.themes[c.theme_id],t===o&&(t=e.fn.popmake.themes[1])),n="yes"===t.container.boxshadow_inset?"inset ":"",i="yes"===t.close.boxshadow_inset?"inset ":"",a.removeAttr("style").css({backgroundColor:e.fn.popmake.utilities.convert_hex(t.overlay.background_color,t.overlay.background_opacity),zIndex:c.meta.display.overlay_zindex||998}),p.css({padding:t.container.padding+"px",backgroundColor:e.fn.popmake.utilities.convert_hex(t.container.background_color,t.container.background_opacity),borderStyle:t.container.border_style,borderColor:t.container.border_color,borderWidth:t.container.border_width+"px",borderRadius:t.container.border_radius+"px",boxShadow:n+t.container.boxshadow_horizontal+"px "+t.container.boxshadow_vertical+"px "+t.container.boxshadow_blur+"px "+t.container.boxshadow_spread+"px "+e.fn.popmake.utilities.convert_hex(t.container.boxshadow_color,t.container.boxshadow_opacity),zIndex:c.meta.display.zindex||999}),s.css({color:t.title.font_color,lineHeight:t.title.line_height+"px",fontSize:t.title.font_size+"px",fontFamily:t.title.font_family,fontWeight:t.title.font_weight,fontStyle:t.title.font_style,textAlign:t.title.text_align,textShadow:t.title.textshadow_horizontal+"px "+t.title.textshadow_vertical+"px "+t.title.textshadow_blur+"px "+e.fn.popmake.utilities.convert_hex(t.title.textshadow_color,t.title.textshadow_opacity)}),r.css({color:t.content.font_color,fontFamily:t.content.font_family,fontWeight:t.content.font_weight,fontStyle:t.content.font_style}),e("p, label",r).css({color:t.content.font_color,fontFamily:t.content.font_family}),l.html(t.close.text).css({padding:t.close.padding+"px",height:t.close.height+"px",width:t.close.width+"px",backgroundColor:e.fn.popmake.utilities.convert_hex(t.close.background_color,t.close.background_opacity),color:t.close.font_color,lineHeight:t.close.line_height+"px",fontSize:t.close.font_size+"px",fontWeight:t.close.font_weight,fontStyle:t.close.font_style,fontFamily:t.close.font_family,borderStyle:t.close.border_style,borderColor:t.close.border_color,borderWidth:t.close.border_width+"px",borderRadius:t.close.border_radius+"px",boxShadow:i+t.close.boxshadow_horizontal+"px "+t.close.boxshadow_vertical+"px "+t.close.boxshadow_blur+"px "+t.close.boxshadow_spread+"px "+e.fn.popmake.utilities.convert_hex(t.close.boxshadow_color,t.close.boxshadow_opacity),textShadow:t.close.textshadow_horizontal+"px "+t.close.textshadow_vertical+"px "+t.close.textshadow_blur+"px "+e.fn.popmake.utilities.convert_hex(t.close.textshadow_color,t.close.textshadow_opacity),left:"auto",right:"auto",bottom:"auto",top:"auto"}),t.close.location){case"topleft":l.css({top:t.close.position_top+"px",left:t.close.position_left+"px"});break;case"topright":l.css({top:t.close.position_top+"px",right:t.close.position_right+"px"});break;case"bottomleft":l.css({bottom:t.close.position_bottom+"px",left:t.close.position_left+"px"});break;case"bottomright":l.css({bottom:t.close.position_bottom+"px",right:t.close.position_right+"px"})}return a.trigger("popmakeAfterRetheme",[t]),this},animation_origin:function(t){var o=PUM.getPopup(this),n=o.popmake("getContainer"),i={my:"",at:""};switch(t){case"top":i={my:"left+"+n.offset().left+" bottom-100",at:"left top"};break;case"bottom":i={my:"left+"+n.offset().left+" top+100",at:"left bottom"};break;case"left":i={my:"right top+"+n.offset().top,at:"left top"};break;case"right":i={my:"left top+"+n.offset().top,at:"right top"};break;default:t.indexOf("left")>=0&&(i={my:i.my+" right",at:i.at+" left"}),t.indexOf("right")>=0&&(i={my:i.my+" left",at:i.at+" right"}),t.indexOf("center")>=0&&(i={my:i.my+" center",at:i.at+" center"}),t.indexOf("top")>=0&&(i={my:i.my+" bottom-100",at:i.at+" top"}),t.indexOf("bottom")>=0&&(i={my:i.my+" top+100",at:i.at+" bottom"}),i.my=e.trim(i.my),i.at=e.trim(i.at)}return i.of=window,i.collision="none",i}}}(jQuery,document);var PUM_Accessibility;!function(e,t,o){"use strict";var n,i,a,p="a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), iframe, object, embed, *[tabindex], *[contenteditable]";PUM_Accessibility={forceFocus:function(t){a&&!e.contains(a,t.target)&&(t.stopPropagation(),PUM_Accessibility.setFocusToFirstItem())},trapTabKey:function(t){if(9===t.keyCode){var o=a.find(".pum-container *").filter(p).filter(":visible"),n=e(":focus"),i=o.length,s=o.index(n);t.shiftKey?0===s&&(o.get(i-1).focus(),t.preventDefault()):s===i-1&&(o.get(0).focus(),t.preventDefault())}},setFocusToFirstItem:function(){a.find(".pum-container *").filter(p).filter(":visible").filter(":not(.pum-close)").first().focus()}},e(t).on("pumInit",".pum",function(){PUM.getPopup(this).find("[tabindex]").each(function(){var t=e(this);t.data("tabindex",t.attr("tabindex")).prop("tabindex","0")})}).on("pumBeforeOpen",".pum",function(){var o=PUM.getPopup(this),p=e(":focus");o.has(p).length||(i=p),a=o.on("keydown.pum_accessibility",PUM_Accessibility.trapTabKey).attr("aria-hidden","false"),n=e("body > *").filter(":visible").not(a),n.attr("aria-hidden","true"),e(t).on("focus.pum_accessibility",PUM_Accessibility.forceFocus),PUM_Accessibility.setFocusToFirstItem()}).on("pumAfterOpen",".pum",function(){}).on("pumBeforeClose",".pum",function(){}).on("pumAfterClose",".pum",function(){var p=PUM.getPopup(this);p.off("keydown.pum_accessibility").attr("aria-hidden","true"),n&&(n.attr("aria-hidden","false"),n=null),i!==o&&i.length&&i.focus(),a=null,e(t).off("focus.pum_accessibility")}).on("pumSetupClose",".pum",function(){}).on("pumOpenPrevented",".pum",function(){}).on("pumClosePrevented",".pum",function(){}).on("pumBeforeReposition",".pum",function(){})}(jQuery,document);var PUM_Analytics;!function(e,t,o){"use strict";e.fn.popmake.last_open_trigger=null,e.fn.popmake.last_close_trigger=null,e.fn.popmake.conversion_trigger=null;var n=!("undefined"==typeof pum_vars.restapi||!pum_vars.restapi);PUM_Analytics={beacon:function(t){var o=new Image,i=n?pum_vars.restapi:pum_vars.ajaxurl;t=e.extend(!0,{route:"/analytics/open",type:"open",data:{pid:null,_cache:+new Date},callback:function(){}},t),n?i+=t.route:(t.data.action="pum_analytics",t.data.type=t.type),i&&(e(o).on("error success load done",t.callback),o.src=i+"?"+e.param(t.data))}},pum_vars.disable_open_tracking!==o&&pum_vars.disable_open_tracking||e(t).on("pumAfterOpen.core_analytics","body > .pum",function(){var t=PUM.getPopup(this),o={pid:parseInt(t.popmake("getSettings").id,10)||null};o.pid>0&&!e("body").hasClass("single-popup")&&PUM_Analytics.beacon({data:o})})}(jQuery,document),function(e,t,o){"use strict";e.fn.popmake.methods.animate_overlay=function(t,o,n){var i=PUM.getPopup(this).popmake("getSettings");return i.meta.display.overlay_disabled?e.fn.popmake.overlay_animations.none.apply(this,[o,n]):e.fn.popmake.overlay_animations[t]?e.fn.popmake.overlay_animations[t].apply(this,[o,n]):(window.console&&console.warn("Animation style "+t+" does not exist."),this)},e.fn.popmake.methods.animate=function(t){return e.fn.popmake.animations[t]?e.fn.popmake.animations[t].apply(this,Array.prototype.slice.call(arguments,1)):(window.console&&console.warn("Animation style "+t+" does not exist."),this)},e.fn.popmake.animations={none:function(e){var t=PUM.getPopup(this);return t.popmake("getContainer").show(0),t.popmake("animate_overlay","none",0,function(){e!==o&&e()}),this},slide:function(e){var t=PUM.getPopup(this).show(0).css({opacity:0}),n=t.popmake("getContainer").show(0).css({opacity:0}),i=t.popmake("getSettings"),a=i.meta.display.animation_speed/2,p=t.popmake("animation_origin",i.meta.display.animation_origin);return n.position(p).css({opacity:1}),t.css({opacity:1}).popmake("animate_overlay","fade",a,function(){n.popmake("reposition",function(t){n.animate(t,a,"swing",function(){e!==o&&e()})})}),this},fade:function(e){var t=PUM.getPopup(this),n=t.popmake("getContainer"),i=t.popmake("getSettings"),a=i.meta.display.animation_speed/2;return n.show(0).css({opacity:0}),t.popmake("animate_overlay","fade",a,function(){n.animate({opacity:1},a,"swing",function(){e!==o&&e()})}),this},fadeAndSlide:function(e){var t=PUM.getPopup(this).show(0).css({opacity:0}),n=t.popmake("getContainer").show(0).css({opacity:0}),i=t.popmake("getSettings"),a=i.meta.display.animation_speed/2,p=t.popmake("animation_origin",i.meta.display.animation_origin);return n.position(p),t.hide().css({opacity:1}).popmake("animate_overlay","fade",a,function(){n.popmake("reposition",function(t){t.opacity=1,n.animate(t,a,"swing",function(){e!==o&&e()})})}),this},grow:function(t){return e.fn.popmake.animations.fade.apply(this,arguments)},growAndSlide:function(t){return e.fn.popmake.animations.fadeAndSlide.apply(this,arguments)}},e.fn.popmake.overlay_animations={none:function(e,t){PUM.getPopup(this).show(e,t)},fade:function(e,t){PUM.getPopup(this).fadeIn(e,t)},slide:function(e,t){PUM.getPopup(this).slideDown(e,t)}}}(jQuery,document),function(e,t,o){"use strict";e(t).on("pumInit",".pum",function(){e(this).popmake("getContainer").trigger("popmakeInit")}).on("pumBeforeOpen",".pum",function(){e(this).popmake("getContainer").addClass("active").trigger("popmakeBeforeOpen")}).on("pumAfterOpen",".pum",function(){e(this).popmake("getContainer").trigger("popmakeAfterOpen")}).on("pumBeforeClose",".pum",function(){e(this).popmake("getContainer").trigger("popmakeBeforeClose")}).on("pumAfterClose",".pum",function(){e(this).popmake("getContainer").removeClass("active").trigger("popmakeAfterClose")}).on("pumSetupClose",".pum",function(){e(this).popmake("getContainer").trigger("popmakeSetupClose")}).on("pumOpenPrevented",".pum",function(){e(this).popmake("getContainer").removeClass("preventOpen").removeClass("active")}).on("pumClosePrevented",".pum",function(){e(this).popmake("getContainer").removeClass("preventClose")}).on("pumBeforeReposition",".pum",function(){e(this).popmake("getContainer").trigger("popmakeBeforeReposition")})}(jQuery,document),function(e,t,o){"use strict";e.fn.popmake.callbacks={reposition_using:function(t){e(this).css(t)}}}(jQuery,document),function(e,t,o){"use strict";var n;e.extend(e.fn.popmake.methods,{checkConditions:function(){var t,i,a,p,s,r=PUM.getPopup(this),l=r.popmake("getSettings"),c=!0;if(l.mobile_disabled!==o&&l.mobile_disabled&&("object"!=typeof n&&(n=new MobileDetect(window.navigator.userAgent)),n.phone()))return!1;if(l.tablet_disabled!==o&&l.tablet_disabled&&("object"!=typeof n&&(n=new MobileDetect(window.navigator.userAgent)),n.tablet()))return!1;if(l.conditions!==o&&l.conditions.length)for(i=0;l.conditions.length>i;i++){for(p=l.conditions[i],t=!1,a=0;p.length>a&&(s=e.extend({},{not_operand:!1},p[a]),!s.not_operand&&r.popmake("checkCondition",s)?t=!0:s.not_operand&&!r.popmake("checkCondition",s)&&(t=!0),e(this).trigger("pumCheckingCondition",[t,s]),!t);a++);t||(c=!1)}return c},checkCondition:function(t){var o=t.target||null;return o?e.fn.popmake.conditions[o]?e.fn.popmake.conditions[o].apply(this,[t]):window.console?(console.warn("Condition "+o+" does not exist."),!0):void 0:(console.warn("Condition type not set."),!1)}}),e.fn.popmake.conditions={device_is_mobile:function(e){return n.mobile()}}}(jQuery,document);var pm_cookie,pm_cookie_json,pm_remove_cookie;!function(e){"use strict";function t(t){function o(n,i,a){var p,s=new Date;if("undefined"!=typeof document){if(arguments.length>1){switch(a=e.extend({path:"/"},o.defaults,a),typeof a.expires){case"number":s.setMilliseconds(s.getMilliseconds()+864e5*a.expires),a.expires=s;break;case"string":s.setTime(1e3*e.fn.popmake.utilities.strtotime("+"+a.expires)),a.expires=s}try{p=JSON.stringify(i),/^[\{\[]/.test(p)&&(i=p)}catch(r){}return i=t.write?t.write(i,n):encodeURIComponent(String(i)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),n=encodeURIComponent(String(n)),n=n.replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent),n=n.replace(/[\(\)]/g,escape),document.cookie=[n,"=",i,a.expires?"; expires="+a.expires.toUTCString():"",a.path?"; path="+a.path:"",a.domain?"; domain="+a.domain:"",a.secure?"; secure":""].join("")}n||(p={});for(var l=document.cookie?document.cookie.split("; "):[],c=/(%[0-9A-Z]{2})+/g,u=0;u<l.length;u++){var d=l[u].split("="),m=d.slice(1).join("=");'"'===m.charAt(0)&&(m=m.slice(1,-1));try{var f=d[0].replace(c,decodeURIComponent);if(m=t.read?t.read(m,f):t(m,f)||m.replace(c,decodeURIComponent),this.json)try{m=JSON.parse(m)}catch(r){}if(n===f){p=m;break}n||(p[f]=m)}catch(r){}}return p}}return void 0===t&&(t=function(){}),o.set=o,o.get=function(e){return o.call(o,e)},o.getJSON=function(){return o.apply({json:!0},[].slice.call(arguments))},o.defaults={},o.remove=function(t,n){o(t,"",e.extend({},n,{expires:-1,path:""})),o(t,"",e.extend({},n,{expires:-1}))},o.process=function(e,t,n,i){return arguments.length>3&&"object"!=typeof arguments[2]&&void 0!==t?o.apply(o,[e,t,{expires:n,path:i}]):o.apply(o,[].slice.call(arguments,[0,2]))},o.withConverter=e.fn.popmake.cookie,o}e.extend(e.fn.popmake,{cookie:t()}),pm_cookie=e.pm_cookie=e.fn.popmake.cookie.process,pm_cookie_json=e.pm_cookie_json=e.fn.popmake.cookie.getJSON,pm_remove_cookie=e.pm_remove_cookie=e.fn.popmake.cookie.remove}(jQuery),function(e,t,o){"use strict";e.extend(e.fn.popmake.methods,{addCookie:function(t){return pum.hooks.doAction("popmake.addCookie",arguments),e.fn.popmake.cookies[t]?e.fn.popmake.cookies[t].apply(this,Array.prototype.slice.call(arguments,1)):(window.console&&console.warn("Cookie type "+t+" does not exist."),this)},setCookie:function(t){e.pm_cookie(t.name,!0,t.session?null:t.time,t.path?"/":null),pum.hooks.doAction("popmake.setCookie",t)},checkCookies:function(t){var n,i=!1;if(t.cookie===o||t.cookie.name===o||null===t.cookie.name)return!1;switch(typeof t.cookie.name){case"object":case"array":for(n=0;t.cookie.name.length>n;n+=1)e.pm_cookie(t.cookie.name[n])!==o&&(i=!0);break;case"string":e.pm_cookie(t.cookie.name)!==o&&(i=!0)}return pum.hooks.doAction("popmake.checkCookies",t,i),i}}),e.fn.popmake.cookies={on_popup_open:function(e){var t=PUM.getPopup(this);t.on("pumAfterOpen",function(){t.popmake("setCookie",e)})},on_popup_close:function(e){var t=PUM.getPopup(this);t.on("pumBeforeClose",function(){t.popmake("setCookie",e)})},manual:function(e){var t=PUM.getPopup(this);t.on("pumSetCookie",function(){t.popmake("setCookie",e)})},ninja_form_success:function(e){var t=PUM.getPopup(this);t.on("pum_nf.success",function(){t.popmake("setCookie",e)})}},e(t).on("pumInit",".pum",function(){var e,t=PUM.getPopup(this),n=t.popmake("getSettings"),i=n.cookies,a=null;if(i!==o&&i.length)for(e=0;i.length>e;e+=1)a=i[e],t.popmake("addCookie",a.event,a.settings)})}(jQuery,document);var pum_debug_mode=!1,pum_debug;!function(e,t){if(t=window.pum_vars||{debug_mode:!1},pum_debug_mode=void 0!==t.debug_mode&&t.debug_mode,pum_debug_mode||window.location.href.indexOf("pum_debug")===-1||(pum_debug_mode=!0),pum_debug_mode){var o=!1,n=!1,i=window.pum_debug_vars||{};pum_debug={odump:function(t){return e.extend({},t)},logo:function(){console.log(" -------------------------------------------------------------\n| ____ __ __ _ |\n| | _ \\ ___ _ __ _ _ _ __ | \\/ | __ _| | _____ _ __ |\n| | |_) / _ \\| '_ \\| | | | '_ \\ | |\\/| |/ _` | |/ / _ \\ '__| |\n| | __/ (_) | |_) | |_| | |_) | | | | | (_| | < __/ | |\n| |_| \\___/| .__/ \\__,_| .__/ |_| |_|\\__,_|_|\\_\\___|_| |\n| |_| |_| |\n -------------------------------------------------------------")},initialize:function(){o=!0,pum_debug.logo(),console.debug(i.debug_mode_enabled),console.log(i.debug_started_at,new Date),console.info(i.debug_more_info),pum_debug.divider(i.global_info),console.groupCollapsed(i.localized_vars),console.log("pum_vars:",pum_debug.odump(t)),e(document).trigger("pum_debug_initialize_localized_vars"),console.groupEnd(),e(document).trigger("pum_debug_initialize")},popup_event_header:function(e){var t=e.popmake("getSettings");n!==t.id&&(n=t.id,pum_debug.divider(i.single_popup_label+t.id+" - "+t.slug))},divider:function(e){var t=62,o=62,n=0,i=" "+new Array(t+1).join("-")+" ";"string"==typeof e?(o=t-e.length,n={left:Math.floor(o/2),right:Math.floor(o/2)},n.left+n.right===o-1&&n.right++,n.left=new Array(n.left+1).join(" "),n.right=new Array(n.right+1).join(" "),console.log(""+i+"\n|"+n.left+e+n.right+"|\n"+i)):console.log(i)},click_trigger:function(e,t){var o,n=e.popmake("getSettings"),a=[".popmake-"+n.id,".popmake-"+decodeURIComponent(n.slug),'a[href$="#popmake-'+n.id+'"]'];t.extra_selectors&&""!==t.extra_selectors&&a.push(t.extra_selectors),a=pum.hooks.applyFilters("pum.trigger.click_open.selectors",a,t,e),o=a.join(", "),console.log(i.label_selector,o)},trigger:function(t,o){switch(console.groupCollapsed(i.triggers[o.type].name),o.type){case"auto_open":console.log(i.label_delay,o.settings.delay),console.log(i.label_cookie,o.settings.cookie.name);break;case"click_open":pum_debug.click_trigger(t,o.settings),console.log(i.label_cookie,o.settings.cookie.name)}e(document).trigger("pum_debug_render_trigger",t,o),console.groupEnd()},cookie:function(t,o){switch(console.groupCollapsed(i.cookies[o.event].name),o.event){case"on_popup_open":case"on_popup_close":case"manual":case"ninja_form_success":console.log(i.label_settings,pum_debug.odump(o.settings))}e(document).trigger("pum_debug_render_trigger",t,o),console.groupEnd()}},e(document).on("pumInit",".pum",function(){var t=PUM.getPopup(e(this)),n=t.popmake("getSettings"),a=0;if(o||(pum_debug.initialize(),pum_debug.divider(i.popups_initializing)),console.groupCollapsed(i.single_popup_label+n.id+" - "+n.slug),console.log(i.theme_id,n.theme_id),void 0!==n.triggers&&n.triggers.length){for(console.groupCollapsed(i.label_triggers),a=0;n.triggers.length>a;a++)pum_debug.trigger(t,n.triggers[a]);console.groupEnd()}if(void 0!==n.cookies&&n.cookies.length){for(console.groupCollapsed(i.label_cookies),a=0;n.cookies.length>a;a+=1)pum_debug.cookie(t,n.cookies[a]);console.groupEnd()}void 0!==n.conditions&&n.conditions.length&&(console.groupCollapsed(i.label_conditions),console.log(n.conditions),console.groupEnd()),console.groupCollapsed(i.label_popup_settings),console.log(i.label_mobile_disabled,null!==n.mobile_disabled),console.log(i.label_tablet_disabled,null!==n.tablet_disabled),console.log(i.label_display_settings,pum_debug.odump(n.meta.display)),console.log(i.label_close_settings,pum_debug.odump(n.meta.close)),t.trigger("pum_debug_popup_settings");var p=pum.hooks.applyFilters("pum_debug.popup_settings.cleaned_meta",pum_debug.odump(n.meta),t);delete p.display,delete p.close,delete p.click_open,p.length&&console.log("Meta: ",p),console.groupEnd(),console.groupEnd()}).on("pumBeforeOpen",".pum",function(){var t=PUM.getPopup(e(this)),o=(t.popmake("getSettings"),e.fn.popmake.last_open_trigger);pum_debug.popup_event_header(t),console.groupCollapsed(i.label_event_before_open);try{o=e(e.fn.popmake.last_open_trigger)}catch(n){o=e()}finally{o=o.length?o:e.fn.popmake.last_open_trigger.toString(),console.log(i.label_triggers,[o])}console.groupEnd()}).on("pumOpenPrevented",".pum",function(){var t=PUM.getPopup(e(this));pum_debug.popup_event_header(t),console.groupCollapsed(i.label_event_open_prevented),console.groupEnd()}).on("pumAfterOpen",".pum",function(){var t=PUM.getPopup(e(this));t.popmake("getSettings");pum_debug.popup_event_header(t),console.groupCollapsed(i.label_event_after_open),console.groupEnd()}).on("pumSetupClose",".pum",function(){var t=PUM.getPopup(e(this));t.popmake("getSettings");pum_debug.popup_event_header(t),console.groupCollapsed(i.label_event_setup_close),console.groupEnd()}).on("pumClosePrevented",".pum",function(){var t=PUM.getPopup(e(this));t.popmake("getSettings");pum_debug.popup_event_header(t),console.groupCollapsed(i.label_event_close_prevented),console.groupEnd()}).on("pumBeforeClose",".pum",function(){var t=PUM.getPopup(e(this));t.popmake("getSettings");pum_debug.popup_event_header(t),console.groupCollapsed(i.label_event_before_close),console.groupEnd()}).on("pumAfterClose",".pum",function(){var t=PUM.getPopup(e(this));t.popmake("getSettings");pum_debug.popup_event_header(t),console.groupCollapsed(i.label_event_after_close),console.groupEnd()}).on("pumBeforeReposition",".pum",function(){var t=PUM.getPopup(e(this));t.popmake("getSettings");pum_debug.popup_event_header(t),console.groupCollapsed(i.label_event_before_reposition),console.groupEnd()}).on("pumAfterReposition",".pum",function(){var t=PUM.getPopup(e(this));t.popmake("getSettings");pum_debug.popup_event_header(t),console.groupCollapsed(i.label_event_after_reposition),console.groupEnd()}).on("pumCheckingCondition",".pum",function(t,o,n){var a=PUM.getPopup(e(this));a.popmake("getSettings");pum_debug.popup_event_header(a),console.groupCollapsed(i.label_event_checking_condition),console.log((n.not_operand?"(!) ":"")+n.target+": "+o,n),console.groupEnd()})}}(jQuery),function(e,t,o){"use strict";e.fn.popmake.defaults={meta:{display:{stackable:0,overlay_disabled:0,size:"medium",responsive_max_width:"",responsive_max_width_unit:"%",responsive_min_width:"",responsive_min_width_unit:"%",custom_width:"",custom_width_unit:"%",custom_height:"",custom_height_unit:"em",custom_height_auto:0,location:"center top",position_top:100,position_left:0,position_bottom:0,position_right:0,position_fixed:0,animation_type:"fade",animation_speed:350,animation_origin:"center top"},close:{overlay_click:0,esc_press:0,f4_press:0}},container:{active_class:"active",attr:{"class":"popmake"}},title:{attr:{"class":"popmake-title"}},content:{attr:{"class":"popmake-content"}},close:{close_speed:0,attr:{"class":"popmake-close"}},overlay:{attr:{id:"popmake-overlay","class":"popmake-overlay"}}}}(jQuery,document),function(e,t){"use strict";var o=function(){function e(e,t,o,n){return"string"==typeof e&&"function"==typeof t&&(o=parseInt(o||10,10),s("actions",e,t,o,n)),u}function t(){var e=c.call(arguments),t=e.shift();return"string"==typeof t&&l("actions",t,e),u}function o(e,t){return"string"==typeof e&&p("actions",e,t),u}function n(e,t,o,n){return"string"==typeof e&&"function"==typeof t&&(o=parseInt(o||10,10),s("filters",e,t,o,n)),u}function i(){var e=c.call(arguments),t=e.shift();return"string"==typeof t?l("filters",t,e):u}function a(e,t){return"string"==typeof e&&p("filters",e,t),u}function p(e,t,o,n){var i,a,p;if(d[e][t])if(o)if(i=d[e][t],n)for(p=i.length;p--;)a=i[p],a.callback===o&&a.context===n&&i.splice(p,1);else for(p=i.length;p--;)i[p].callback===o&&i.splice(p,1);else d[e][t]=[]}function s(e,t,o,n,i){var a={callback:o,priority:n,context:i},p=d[e][t];p?(p.push(a),p=r(p)):p=[a],d[e][t]=p}function r(e){for(var t,o,n,i=1,a=e.length;i<a;i++){for(t=e[i],o=i;(n=e[o-1])&&n.priority>t.priority;)e[o]=e[o-1],
2
- --o;e[o]=t}return e}function l(e,t,o){var n,i,a=d[e][t];if(!a)return"filters"===e&&o[0];if(i=a.length,"filters"===e)for(n=0;n<i;n++)o[0]=a[n].callback.apply(a[n].context,o);else for(n=0;n<i;n++)a[n].callback.apply(a[n].context,o);return"filters"!==e||o[0]}var c=Array.prototype.slice,u={removeFilter:a,applyFilters:i,addFilter:n,removeAction:o,doAction:t,addAction:e},d={actions:{},filters:{}};return u};e.pum=e.pum||{},e.pum.hooks=e.pum.hooks||new o}(window),function(e){"use strict";if("undefined"!=typeof Marionette&&"undefined"!=typeof nfRadio){var t=Marionette.Object.extend({initialize:function(){this.listenTo(nfRadio.channel("forms"),"submit:response",this.closePopup),this.listenTo(nfRadio.channel("forms"),"submit:response",this.openPopup),this.listenTo(nfRadio.channel("forms"),"submit:response",this.popupTriggers)},popupTriggers:function(t,o,n,i){var a;a=e("#nf-form-"+i+"-cont").parents(".pum"),a.length&&(a.trigger("pum_nf.success"),t.errors.length?a.trigger("pum_nf.error"):a.trigger("pum_nf.success"))},closePopup:function(t,o,n,i){var a;"undefined"==typeof t.data.actions||t.errors.length||"undefined"!=typeof t.data.actions.closepopup&&(a=e("#nf-form-"+i+"-cont").parents(".pum"),a.length&&setTimeout(function(){a.popmake("close")},parseInt(t.data.actions.closepopup)))},openPopup:function(t){var o;"undefined"==typeof t.data.actions||t.errors.length||"undefined"!=typeof t.data.actions.openpopup&&(o=e("#pum-"+parseInt(t.data.actions.openpopup)),o.length&&o.popmake("open"))}});jQuery(document).ready(function(){new t})}}(jQuery),function(e,t,o){"use strict";e.extend(e.fn.popmake.methods,{addTrigger:function(t){return e.fn.popmake.triggers[t]?e.fn.popmake.triggers[t].apply(this,Array.prototype.slice.call(arguments,1)):(window.console&&console.warn("Trigger type "+t+" does not exist."),this)}}),e.fn.popmake.triggers={auto_open:function(t){var o=PUM.getPopup(this);setTimeout(function(){o.popmake("state","isOpen")||!o.popmake("checkCookies",t)&&o.popmake("checkConditions")&&(e.fn.popmake.last_open_trigger="Auto Open - Delay: "+t.delay,o.popmake("open"))},t.delay)},click_open:function(o){var n,i=PUM.getPopup(this),a=i.popmake("getSettings"),p=[".popmake-"+a.id,".popmake-"+decodeURIComponent(a.slug),'a[href$="#popmake-'+a.id+'"]'];o.extra_selectors&&""!==o.extra_selectors&&p.push(o.extra_selectors),p=pum.hooks.applyFilters("pum.trigger.click_open.selectors",p,o,i),n=p.join(", "),e(n).addClass("pum-trigger").data("popup",a.id).attr("data-popup",a.id).data("settings",o).attr("data-settings",o).data("do-default",o.do_default).attr("data-do-default",o.do_default).css({cursor:"pointer"}),e(t).on("click",n,function(t){var n=e(this);n.hasClass("pum-trigger")&&n.data("popup")||(n.addClass("pum-trigger").data("popup",a.id).attr("data-popup",a.id).data("settings",o).attr("data-settings",o).data("do-default",o.do_default).attr("data-do-default",o.do_default).css({cursor:"pointer"}),t.preventDefault(),t.stopPropagation(),n.trigger("click"))})},admin_debug:function(){PUM.getPopup(this).popmake("open")}},e(t).on("pumInit",".pum",function(){var e,t=PUM.getPopup(this),n=t.popmake("getSettings"),i=n.triggers,a=null;if(i!==o&&i.length)for(e=0;i.length>e;e+=1)a=i[e],t.popmake("addTrigger",a.type,a.settings)}).on("click.pumTrigger",".pum-trigger[data-popup]",function(t){var o=e(this),n=PUM.getPopup(o.data("popup")),i=o.data("settings")||{},a=i.do_default||!1;n.has(o).length>0||n.popmake("state","isOpen")||!n.popmake("checkCookies",i)&&n.popmake("checkConditions")&&(o.data("do-default")?a=o.data("do-default"):o.hasClass("do-default")&&(a=!0),pum.hooks.applyFilters("pum.trigger.click_open.do_default",a,n,o)||(t.preventDefault(),t.stopPropagation()),e.fn.popmake.last_open_trigger=o,n.popmake("open"))})}(jQuery,document),function(e,t,o){"use strict";function n(t,o){return e.inArray(o,t)!==-1}function i(e,t,o){var n=t[0];t.length>1?(e[n]||(e[n]=t[1]?{}:[]),i(e[n],t.slice(1),o)):(n||(n=e.length),e[n]=o)}var a="color,date,datetime,datetime-local,email,hidden,month,number,password,range,search,tel,text,time,url,week".split(","),p="select,textarea".split(","),s=/\[([^\]]*)\]/g;e.fn.popmake.utilities={convert_hex:function(e,t){e=e.replace("#","");var o=parseInt(e.substring(0,2),16),n=parseInt(e.substring(2,4),16),i=parseInt(e.substring(4,6),16);return"rgba("+o+","+n+","+i+","+t/100+")"},debounce:function(e,t){var o;return function(){var n=this,i=arguments;window.clearTimeout(o),o=window.setTimeout(function(){e.apply(n,i)},t)}},throttle:function(e,t){var o=!1,n=function(){o=!1};return function(){o||(e.apply(this,arguments),window.setTimeout(n,t),o=!0)}},getXPath:function(t){var o,n,i,a,p,s=[];return e.each(e(t).parents(),function(t,r){return o=e(r),n=o.attr("id")||"",i=o.attr("class")||"",a=o.get(0).tagName.toLowerCase(),p=o.parent().children(a).index(o),"body"!==a&&(i.length>0&&(i=i.split(" "),i=i[0]),void s.push(a+(n.length>0?"#"+n:i.length>0?"."+i.split(" ").join("."):":eq("+p+")")))}),s.reverse().join(" > ")},strtotime:function(e,t){function n(e,t,n){var i,a=c[t];a!==o&&(i=a-l.getDay(),0===i?i=7*n:i>0&&"last"===e?i-=7:i<0&&"next"===e&&(i+=7),l.setDate(l.getDate()+i))}function i(e){var t=e.split(" "),o=t[0],i=t[1].substring(0,3),a=/\d+/.test(o),p="ago"===t[2],s=("last"===o?-1:1)*(p?-1:1);if(a&&(s*=parseInt(o,10)),u.hasOwnProperty(i)&&!t[1].match(/^mon(day|\.)?$/i))return l["set"+u[i]](l["get"+u[i]]()+s);if("wee"===i)return l.setDate(l.getDate()+7*s);if("next"===o||"last"===o)n(o,i,s);else if(!a)return!1;return!0}var a,p,s,r,l,c,u,d,m,f,g,_=!1;if(!e)return _;if(e=e.replace(/^\s+|\s+$/g,"").replace(/\s{2,}/g," ").replace(/[\t\r\n]/g,"").toLowerCase(),p=e.match(/^(\d{1,4})([\-\.\/\:])(\d{1,2})([\-\.\/\:])(\d{1,4})(?:\s(\d{1,2}):(\d{2})?:?(\d{2})?)?(?:\s([A-Z]+)?)?$/),p&&p[2]===p[4])if(p[1]>1901)switch(p[2]){case"-":return p[3]>12||p[5]>31?_:new Date(p[1],parseInt(p[3],10)-1,p[5],p[6]||0,p[7]||0,p[8]||0,p[9]||0)/1e3;case".":return _;case"/":return p[3]>12||p[5]>31?_:new Date(p[1],parseInt(p[3],10)-1,p[5],p[6]||0,p[7]||0,p[8]||0,p[9]||0)/1e3}else if(p[5]>1901)switch(p[2]){case"-":return p[3]>12||p[1]>31?_:new Date(p[5],parseInt(p[3],10)-1,p[1],p[6]||0,p[7]||0,p[8]||0,p[9]||0)/1e3;case".":return p[3]>12||p[1]>31?_:new Date(p[5],parseInt(p[3],10)-1,p[1],p[6]||0,p[7]||0,p[8]||0,p[9]||0)/1e3;case"/":return p[1]>12||p[3]>31?_:new Date(p[5],parseInt(p[1],10)-1,p[3],p[6]||0,p[7]||0,p[8]||0,p[9]||0)/1e3}else switch(p[2]){case"-":return p[3]>12||p[5]>31||p[1]<70&&p[1]>38?_:(r=p[1]>=0&&p[1]<=38?+p[1]+2e3:p[1],new Date(r,parseInt(p[3],10)-1,p[5],p[6]||0,p[7]||0,p[8]||0,p[9]||0)/1e3);case".":return p[5]>=70?p[3]>12||p[1]>31?_:new Date(p[5],parseInt(p[3],10)-1,p[1],p[6]||0,p[7]||0,p[8]||0,p[9]||0)/1e3:p[5]<60&&!p[6]?p[1]>23||p[3]>59?_:(s=new Date,new Date(s.getFullYear(),s.getMonth(),s.getDate(),p[1]||0,p[3]||0,p[5]||0,p[9]||0)/1e3):_;case"/":return p[1]>12||p[3]>31||p[5]<70&&p[5]>38?_:(r=p[5]>=0&&p[5]<=38?+p[5]+2e3:p[5],new Date(r,parseInt(p[1],10)-1,p[3],p[6]||0,p[7]||0,p[8]||0,p[9]||0)/1e3);case":":return p[1]>23||p[3]>59||p[5]>59?_:(s=new Date,new Date(s.getFullYear(),s.getMonth(),s.getDate(),p[1]||0,p[3]||0,p[5]||0)/1e3)}if("now"===e)return null===t||isNaN(t)?(new Date).getTime()/1e3||0:t||0;if(a=Date.parse(e),!isNaN(a))return a/1e3||0;if(l=t?new Date(1e3*t):new Date,c={sun:0,mon:1,tue:2,wed:3,thu:4,fri:5,sat:6},u={yea:"FullYear",mon:"Month",day:"Date",hou:"Hours",min:"Minutes",sec:"Seconds"},m="(years?|months?|weeks?|days?|hours?|minutes?|min|seconds?|sec|sunday|sun\\.?|monday|mon\\.?|tuesday|tue\\.?|wednesday|wed\\.?|thursday|thu\\.?|friday|fri\\.?|saturday|sat\\.?)",f="([+-]?\\d+\\s"+m+"|(last|next)\\s"+m+")(\\sago)?",p=e.match(new RegExp(f,"gi")),!p)return _;for(g=0,d=p.length;g<d;g+=1)if(!i(p[g]))return _;return l.getTime()/1e3},serializeObject:function(t){e.extend({},t);var o={},r=e.extend(!0,{include:[],exclude:[],includeByClass:""},t);return this.find(":input").each(function(){var t;!this.name||this.disabled||n(r.exclude,this.name)||r.include.length&&!n(r.include,this.name)||this.className.indexOf(r.includeByClass)===-1||(t=this.name.replace(s,"[$1").split("["),t[0]&&(this.checked||n(a,this.type)||n(p,this.nodeName.toLowerCase()))&&("checkbox"===this.type&&t.push(""),i(o,t,e(this).val())))}),o}},e.fn.pumSerializeObject=e.fn.popmake.utilities.serializeObject,e.fn.popmake.utilies=e.fn.popmake.utilities}(jQuery,document),function(e,t,o){"use strict";e.fn.popmake.version=1.4,e.fn.popmake.last_open_popup=null,e(t).ready(function(){e(".popmake").popmake()})}(jQuery);
1
+ !function(e){"use strict";void 0===e.fn.on&&(e.fn.on=function(e,t,o){return this.delegate(t,e,o)}),void 0===e.fn.off&&(e.fn.off=function(e,t,o){return this.undelegate(t,e,o)}),void 0===e.fn.bindFirst&&(e.fn.bindFirst=function(t,o){var n,i,p=e(this);p.unbind(t,o),p.bind(t,o),n=e._data(p[0]).events,i=n[t],i.unshift(i.pop()),n[t]=i}),void 0===e.fn.outerHtml&&(e.fn.outerHtml=function(){var t=e(this).clone(),o=e("<div/>").append(t);return o.html()}),void 0===Date.now&&(Date.now=function(){return(new Date).getTime()})}(jQuery);var PUM;!function(e,t,o){"use strict";function n(e){return!isNaN(e)&&parseInt(Number(e))==e&&!isNaN(parseInt(e,10))}function i(){var e={},t=function(t,n,i){"boolean"==typeof n&&(i=n,n=!1);var p=n?n.selector+" "+t:t;return(o===e[p]||i)&&(e[p]=n?n.find(t):jQuery(t)),e[p]};return t.elementCache=e,t}function p(e,t){function o(e,t,o){return t?e[t.slice(0,o?-1:t.length)]:e}function n(e,t){return t?t.split("[").reduce(o,e):e}return t.split(".").reduce(n,e)}PUM={get:new i,getPopup:function(t){var o;return o=n(t)?PUM.get("#pum-"+t):"current"===t?PUM.get(".pum-overlay.pum-active:eq(0)",!0):"open"===t?PUM.get(".pum-overlay.pum-active",!0):"closed"===t?PUM.get(".pum-overlay:not(.pum-active)",!0):t instanceof jQuery?t:e(t),o.hasClass("pum-overlay")?o:o.hasClass("popmake")?o.parents(".pum-overlay"):o.parents(".pum-overlay").length?o.parents(".pum-overlay"):e()},open:function(e,t){PUM.getPopup(e).popmake("open",t)},close:function(e,t){PUM.getPopup(e).popmake("close",t)},preventOpen:function(e){PUM.getPopup(e).addClass("preventOpen")},getSettings:function(e){var t=PUM.getPopup(e);return t.popmake("getSettings")},getSetting:function(e,t,n){var i=PUM.getSettings(e),a=p(i,t);return"undefined"!=typeof a?a:n!==o?n:null},checkConditions:function(e){return PUM.getPopup(e).popmake("checkConditions")},getCookie:function(t){return e.pm_cookie(t)},clearCookie:function(t,o){e.pm_remove_cookie(t),"function"==typeof o&&o()},clearCookies:function(t,n){var i,p=PUM.getPopup(t),a=p.popmake("getSettings"),s=a.cookies;if(s!==o&&s.length)for(i=0;s.length>i;i+=1)e.pm_remove_cookie(s[i].settings.name);"function"==typeof n&&n()}},e.fn.popmake=function(o){return e.fn.popmake.methods[o]?(e(t).trigger("pumMethodCall",arguments),e.fn.popmake.methods[o].apply(this,Array.prototype.slice.call(arguments,1))):"object"!=typeof o&&o?void(window.console&&console.warn("Method "+o+" does not exist on $.fn.popmake")):e.fn.popmake.methods.init.apply(this,arguments)},e.fn.popmake.methods={init:function(t){return this.each(function(){var n=PUM.getPopup(this),i=e.extend(!0,{},e.fn.popmake.defaults,n.data("popmake"),t);return i.theme_id<=0&&(i.theme_id=popmake_default_theme),i.meta.display.disable_reposition===o&&e(window).on("resize",function(){(n.hasClass("pum-active")||n.find(".popmake.active").length)&&e.fn.popmake.utilities.throttle(setTimeout(function(){n.popmake("reposition")},25),500,!1)}),n.find(".pum-container").data("popmake",i),n.data("popmake",i).trigger("pumInit"),this})},getOverlay:function(){return e(this)},getContainer:function(){return e(this).find(".pum-container")},getTitle:function(){return e(this).find(".pum-title")||null},getContent:function(){return e(this).find(".pum-content")||null},getClose:function(){return e(this).find(".pum-content + .pum-close")||null},getSettings:function(){return e(this).data("popmake")},state:function(e){var t=PUM.getPopup(this);if(o!==e)switch(e){case"isOpen":return t.hasClass("pum-open")||t.popmake("getContainer").hasClass("active");case"isClosed":return!t.hasClass("pum-open")&&!t.popmake("getContainer").hasClass("active")}},open:function(t){var n=PUM.getPopup(this),i=n.popmake("getContainer"),p=n.popmake("getClose"),a=n.popmake("getSettings"),s=e("html");return n.trigger("pumBeforeOpen"),n.hasClass("preventOpen")||i.hasClass("preventOpen")?(console.log("prevented"),n.removeClass("preventOpen").removeClass("pum-active").trigger("pumOpenPrevented"),this):(a.meta.display.stackable||n.popmake("close_all"),n.addClass("pum-active"),a.meta.close.button_delay>0&&p.fadeOut(0),s.addClass("pum-open"),a.meta.display.overlay_disabled?s.addClass("pum-open-overlay-disabled"):s.addClass("pum-open-overlay"),a.meta.display.position_fixed!==o&&a.meta.display.position_fixed?s.addClass("pum-open-fixed"):s.addClass("pum-open-scrollable"),n.popmake("setup_close").popmake("reposition").css({"z-index":a.meta.display.overlay_zindex||1999999998}).popmake("animate",a.meta.display.animation_type,function(){a.meta.close.button_delay>0&&setTimeout(function(){p.fadeIn()},a.meta.close.button_delay),n.trigger("pumAfterOpen"),e.fn.popmake.last_open_popup=n,t!==o&&t()}),this)},setup_close:function(){var t=PUM.getPopup(this),n=t.popmake("getClose").add(e(".popmake-close",t).not(t.popmake("getClose"))),i=t.popmake("getSettings");return n.off("click.pum").on("click.pum",function(n){var i=e(this),p=i.hasClass("pum-do-default")||i.data("do-default")!==o&&i.data("do-default");p||n.preventDefault(),e.fn.popmake.last_close_trigger="Close Button",t.popmake("close")}),(i.meta.close.esc_press||i.meta.close.f4_press)&&e(window).off("keyup.popmake").on("keyup.popmake",function(o){27===o.keyCode&&i.meta.close.esc_press&&(e.fn.popmake.last_close_trigger="ESC Key",t.popmake("close")),115===o.keyCode&&i.meta.close.f4_press&&(e.fn.popmake.last_close_trigger="F4 Key",t.popmake("close"))}),i.meta.close.overlay_click&&t.off("click.popmake").on("click.popmake",function(o){o.target===t[0]&&(e.fn.popmake.last_close_trigger="Overlay Click",t.popmake("close"))}),t.trigger("pumSetupClose"),this},close:function(t){return this.each(function(){var n=PUM.getPopup(this),i=n.popmake("getContainer"),p=n.popmake("getClose").add(e(".popmake-close",n).not(n.popmake("getClose")));return n.trigger("pumBeforeClose"),n.hasClass("preventClose")||i.hasClass("preventClose")?(n.removeClass("preventClose").trigger("pumClosePrevented"),this):(i.fadeOut("fast",function(){n.is(":visible")&&n.fadeOut("fast"),e(window).off("keyup.popmake"),n.off("click.popmake"),p.off("click.popmake"),1===e(".pum-active").length&&e("html").removeClass("pum-open").removeClass("pum-open-scrollable").removeClass("pum-open-overlay").removeClass("pum-open-overlay-disabled").removeClass("pum-open-fixed"),n.removeClass("pum-active").trigger("pumAfterClose"),i.find("iframe").filter('[src*="youtube"],[src*="vimeo"]').each(function(){var t=e(this),o=t.attr("src"),n=o.replace("autoplay=1","1=1");n!==o&&(o=n),t.prop("src",o)}),i.find("video").each(function(){this.pause()}),t!==o&&t()}),this)})},close_all:function(){return e(".pum-active").popmake("close"),this},reposition:function(t){var o=PUM.getPopup(this).trigger("pumBeforeReposition"),n=o.popmake("getContainer"),i=o.popmake("getSettings"),p=i.meta.display,a=p.location,s={my:"",at:"",of:window,collision:"none",using:"function"==typeof t?t:e.fn.popmake.callbacks.reposition_using},r={overlay:null,container:null},c=null;try{c=e(e.fn.popmake.last_open_trigger)}catch(l){c=e()}return p.position_from_trigger&&c.length?(s.of=c,a.indexOf("left")>=0&&(s.my+=" right",s.at+=" left"+(0!==p.position_left?"-"+p.position_left:"")),a.indexOf("right")>=0&&(s.my+=" left",s.at+=" right"+(0!==p.position_right?"+"+p.position_right:"")),a.indexOf("center")>=0&&(s.my="center"===a?"center":s.my+" center",s.at="center"===a?"center":s.at+" center"),a.indexOf("top")>=0&&(s.my+=" bottom",s.at+=" top"+(0!==p.position_top?"-"+p.position_top:"")),a.indexOf("bottom")>=0&&(s.my+=" top",s.at+=" bottom"+(0!==p.position_bottom?"+"+p.position_bottom:""))):(a.indexOf("left")>=0&&(s.my+=" left"+(0!==p.position_left?"+"+p.position_left:""),s.at+=" left"),a.indexOf("right")>=0&&(s.my+=" right"+(0!==p.position_right?"-"+p.position_right:""),s.at+=" right"),a.indexOf("center")>=0&&(s.my="center"===a?"center":s.my+" center",s.at="center"===a?"center":s.at+" center"),a.indexOf("top")>=0&&(s.my+=" top"+(0!==p.position_top?"+"+(e("body").hasClass("admin-bar")?parseInt(p.position_top,10)+32:p.position_top):""),s.at+=" top"),a.indexOf("bottom")>=0&&(s.my+=" bottom"+(0!==p.position_bottom?"-"+p.position_bottom:""),s.at+=" bottom")),s.my=e.trim(s.my),s.at=e.trim(s.at),o.is(":hidden")&&(r.overlay=o.css("opacity"),o.css({opacity:0}).show(0)),n.is(":hidden")&&(r.container=n.css("opacity"),n.css({opacity:0}).show(0)),p.position_fixed&&n.addClass("fixed"),"custom"===i.meta.display.size?n.css({width:i.meta.display.custom_width+i.meta.display.custom_width_unit,height:i.meta.display.custom_height_auto?"auto":i.meta.display.custom_height+i.meta.display.custom_height_unit}):"auto"!==i.meta.display.size&&n.addClass("responsive").css({minWidth:""!==i.meta.display.responsive_min_width?i.meta.display.responsive_min_width+i.meta.display.responsive_min_width_unit:"auto",maxWidth:""!==i.meta.display.responsive_max_width?i.meta.display.responsive_max_width+i.meta.display.responsive_max_width_unit:"auto"}),o.trigger("pumAfterReposition"),n.addClass("custom-position").position(s).trigger("popmakeAfterReposition"),r.overlay&&o.css({opacity:r.overlay}).hide(0),r.container&&n.css({opacity:r.container}).hide(0),this},retheme:function(t){e(this).trigger("popmakeBeforeRetheme");var n,i,p=PUM.getPopup(this),a=p.popmake("getContainer"),s=p.popmake("getTitle"),r=p.popmake("getContent"),c=p.popmake("getClose"),l=p.popmake("getSettings");switch(t===o&&(t=e.fn.popmake.themes[l.theme_id],t===o&&(t=e.fn.popmake.themes[1])),n="yes"===t.container.boxshadow_inset?"inset ":"",i="yes"===t.close.boxshadow_inset?"inset ":"",p.removeAttr("style").css({backgroundColor:e.fn.popmake.utilities.convert_hex(t.overlay.background_color,t.overlay.background_opacity),zIndex:l.meta.display.overlay_zindex||998}),a.css({padding:t.container.padding+"px",backgroundColor:e.fn.popmake.utilities.convert_hex(t.container.background_color,t.container.background_opacity),borderStyle:t.container.border_style,borderColor:t.container.border_color,borderWidth:t.container.border_width+"px",borderRadius:t.container.border_radius+"px",boxShadow:n+t.container.boxshadow_horizontal+"px "+t.container.boxshadow_vertical+"px "+t.container.boxshadow_blur+"px "+t.container.boxshadow_spread+"px "+e.fn.popmake.utilities.convert_hex(t.container.boxshadow_color,t.container.boxshadow_opacity),zIndex:l.meta.display.zindex||999}),s.css({color:t.title.font_color,lineHeight:t.title.line_height+"px",fontSize:t.title.font_size+"px",fontFamily:t.title.font_family,fontWeight:t.title.font_weight,fontStyle:t.title.font_style,textAlign:t.title.text_align,textShadow:t.title.textshadow_horizontal+"px "+t.title.textshadow_vertical+"px "+t.title.textshadow_blur+"px "+e.fn.popmake.utilities.convert_hex(t.title.textshadow_color,t.title.textshadow_opacity)}),r.css({color:t.content.font_color,fontFamily:t.content.font_family,fontWeight:t.content.font_weight,fontStyle:t.content.font_style}),e("p, label",r).css({color:t.content.font_color,fontFamily:t.content.font_family}),c.html(t.close.text).css({padding:t.close.padding+"px",height:t.close.height+"px",width:t.close.width+"px",backgroundColor:e.fn.popmake.utilities.convert_hex(t.close.background_color,t.close.background_opacity),color:t.close.font_color,lineHeight:t.close.line_height+"px",fontSize:t.close.font_size+"px",fontWeight:t.close.font_weight,fontStyle:t.close.font_style,fontFamily:t.close.font_family,borderStyle:t.close.border_style,borderColor:t.close.border_color,borderWidth:t.close.border_width+"px",borderRadius:t.close.border_radius+"px",boxShadow:i+t.close.boxshadow_horizontal+"px "+t.close.boxshadow_vertical+"px "+t.close.boxshadow_blur+"px "+t.close.boxshadow_spread+"px "+e.fn.popmake.utilities.convert_hex(t.close.boxshadow_color,t.close.boxshadow_opacity),textShadow:t.close.textshadow_horizontal+"px "+t.close.textshadow_vertical+"px "+t.close.textshadow_blur+"px "+e.fn.popmake.utilities.convert_hex(t.close.textshadow_color,t.close.textshadow_opacity),left:"auto",right:"auto",bottom:"auto",top:"auto"}),t.close.location){case"topleft":c.css({top:t.close.position_top+"px",left:t.close.position_left+"px"});break;case"topright":c.css({top:t.close.position_top+"px",right:t.close.position_right+"px"});break;case"bottomleft":c.css({bottom:t.close.position_bottom+"px",left:t.close.position_left+"px"});break;case"bottomright":c.css({bottom:t.close.position_bottom+"px",right:t.close.position_right+"px"})}return p.trigger("popmakeAfterRetheme",[t]),this},animation_origin:function(t){var o=PUM.getPopup(this),n=o.popmake("getContainer"),i={my:"",at:""};switch(t){case"top":i={my:"left+"+n.offset().left+" bottom-100",at:"left top"};break;case"bottom":i={my:"left+"+n.offset().left+" top+100",at:"left bottom"};break;case"left":i={my:"right top+"+n.offset().top,at:"left top"};break;case"right":i={my:"left top+"+n.offset().top,at:"right top"};break;default:t.indexOf("left")>=0&&(i={my:i.my+" right",at:i.at+" left"}),t.indexOf("right")>=0&&(i={my:i.my+" left",at:i.at+" right"}),t.indexOf("center")>=0&&(i={my:i.my+" center",at:i.at+" center"}),t.indexOf("top")>=0&&(i={my:i.my+" bottom-100",at:i.at+" top"}),t.indexOf("bottom")>=0&&(i={my:i.my+" top+100",at:i.at+" bottom"}),i.my=e.trim(i.my),i.at=e.trim(i.at)}return i.of=window,i.collision="none",i}}}(jQuery,document);var PUM_Accessibility;!function(e,t,o){"use strict";var n,i,p,a="a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), iframe, object, embed, *[tabindex], *[contenteditable]";PUM_Accessibility={forceFocus:function(t){p&&!e.contains(p,t.target)&&(t.stopPropagation(),PUM_Accessibility.setFocusToFirstItem())},trapTabKey:function(t){if(9===t.keyCode){var o=p.find(".pum-container *").filter(a).filter(":visible"),n=e(":focus"),i=o.length,s=o.index(n);t.shiftKey?0===s&&(o.get(i-1).focus(),t.preventDefault()):s===i-1&&(o.get(0).focus(),t.preventDefault())}},setFocusToFirstItem:function(){p.find(".pum-container *").filter(a).filter(":visible").filter(":not(.pum-close)").first().focus()}},e(t).on("pumInit",".pum",function(){PUM.getPopup(this).find("[tabindex]").each(function(){var t=e(this);t.data("tabindex",t.attr("tabindex")).prop("tabindex","0")})}).on("pumBeforeOpen",".pum",function(){var o=PUM.getPopup(this),a=e(":focus");o.has(a).length||(i=a),p=o.on("keydown.pum_accessibility",PUM_Accessibility.trapTabKey).attr("aria-hidden","false"),n=e("body > *").filter(":visible").not(p),n.attr("aria-hidden","true"),e(t).on("focus.pum_accessibility",PUM_Accessibility.forceFocus),PUM_Accessibility.setFocusToFirstItem()}).on("pumAfterOpen",".pum",function(){}).on("pumBeforeClose",".pum",function(){}).on("pumAfterClose",".pum",function(){var a=PUM.getPopup(this);a.off("keydown.pum_accessibility").attr("aria-hidden","true"),n&&(n.attr("aria-hidden","false"),n=null),i!==o&&i.length&&i.focus(),p=null,e(t).off("focus.pum_accessibility")}).on("pumSetupClose",".pum",function(){}).on("pumOpenPrevented",".pum",function(){}).on("pumClosePrevented",".pum",function(){}).on("pumBeforeReposition",".pum",function(){})}(jQuery,document);var PUM_Analytics;!function(e,t,o){"use strict";e.fn.popmake.last_open_trigger=null,e.fn.popmake.last_close_trigger=null,e.fn.popmake.conversion_trigger=null;var n=!("undefined"==typeof pum_vars.restapi||!pum_vars.restapi);PUM_Analytics={beacon:function(t){var o=new Image,i=n?pum_vars.restapi:pum_vars.ajaxurl;t=e.extend(!0,{route:"/analytics/open",type:"open",data:{pid:null,_cache:+new Date},callback:function(){}},t),n?i+=t.route:(t.data.action="pum_analytics",t.data.type=t.type),i&&(e(o).on("error success load done",t.callback),o.src=i+"?"+e.param(t.data))}},pum_vars.disable_open_tracking!==o&&pum_vars.disable_open_tracking||e(t).on("pumAfterOpen.core_analytics","body > .pum",function(){var t=PUM.getPopup(this),o={pid:parseInt(t.popmake("getSettings").id,10)||null};o.pid>0&&!e("body").hasClass("single-popup")&&PUM_Analytics.beacon({data:o})})}(jQuery,document),function(e,t,o){"use strict";e.fn.popmake.methods.animate_overlay=function(t,o,n){var i=PUM.getPopup(this).popmake("getSettings");return i.meta.display.overlay_disabled?e.fn.popmake.overlay_animations.none.apply(this,[o,n]):e.fn.popmake.overlay_animations[t]?e.fn.popmake.overlay_animations[t].apply(this,[o,n]):(window.console&&console.warn("Animation style "+t+" does not exist."),this)},e.fn.popmake.methods.animate=function(t){return e.fn.popmake.animations[t]?e.fn.popmake.animations[t].apply(this,Array.prototype.slice.call(arguments,1)):(window.console&&console.warn("Animation style "+t+" does not exist."),this)},e.fn.popmake.animations={none:function(e){var t=PUM.getPopup(this);return t.popmake("getContainer").show(0),t.popmake("animate_overlay","none",0,function(){e!==o&&e()}),this},slide:function(e){var t=PUM.getPopup(this).show(0).css({opacity:0}),n=t.popmake("getContainer").show(0).css({opacity:0}),i=t.popmake("getSettings"),p=i.meta.display.animation_speed/2,a=t.popmake("animation_origin",i.meta.display.animation_origin);return n.position(a).css({opacity:1}),t.css({opacity:1}).popmake("animate_overlay","fade",p,function(){n.popmake("reposition",function(t){n.animate(t,p,"swing",function(){e!==o&&e()})})}),this},fade:function(e){var t=PUM.getPopup(this),n=t.popmake("getContainer"),i=t.popmake("getSettings"),p=i.meta.display.animation_speed/2;return n.show(0).css({opacity:0}),t.popmake("animate_overlay","fade",p,function(){n.animate({opacity:1},p,"swing",function(){e!==o&&e()})}),this},fadeAndSlide:function(e){var t=PUM.getPopup(this).show(0).css({opacity:0}),n=t.popmake("getContainer").show(0).css({opacity:0}),i=t.popmake("getSettings"),p=i.meta.display.animation_speed/2,a=t.popmake("animation_origin",i.meta.display.animation_origin);return n.position(a),t.hide().css({opacity:1}).popmake("animate_overlay","fade",p,function(){n.popmake("reposition",function(t){t.opacity=1,n.animate(t,p,"swing",function(){e!==o&&e()})})}),this},grow:function(t){return e.fn.popmake.animations.fade.apply(this,arguments)},growAndSlide:function(t){return e.fn.popmake.animations.fadeAndSlide.apply(this,arguments)}},e.fn.popmake.overlay_animations={none:function(e,t){PUM.getPopup(this).show(e,t)},fade:function(e,t){PUM.getPopup(this).fadeIn(e,t)},slide:function(e,t){PUM.getPopup(this).slideDown(e,t)}}}(jQuery,document),function(e,t,o){"use strict";e(t).on("pumInit",".pum",function(){e(this).popmake("getContainer").trigger("popmakeInit")}).on("pumBeforeOpen",".pum",function(){e(this).popmake("getContainer").addClass("active").trigger("popmakeBeforeOpen")}).on("pumAfterOpen",".pum",function(){e(this).popmake("getContainer").trigger("popmakeAfterOpen")}).on("pumBeforeClose",".pum",function(){e(this).popmake("getContainer").trigger("popmakeBeforeClose")}).on("pumAfterClose",".pum",function(){e(this).popmake("getContainer").removeClass("active").trigger("popmakeAfterClose")}).on("pumSetupClose",".pum",function(){e(this).popmake("getContainer").trigger("popmakeSetupClose")}).on("pumOpenPrevented",".pum",function(){e(this).popmake("getContainer").removeClass("preventOpen").removeClass("active")}).on("pumClosePrevented",".pum",function(){e(this).popmake("getContainer").removeClass("preventClose")}).on("pumBeforeReposition",".pum",function(){e(this).popmake("getContainer").trigger("popmakeBeforeReposition")})}(jQuery,document),function(e,t,o){"use strict";e.fn.popmake.callbacks={reposition_using:function(t){e(this).css(t)}}}(jQuery,document),function(e,t,o){"use strict";var n;e.extend(e.fn.popmake.methods,{checkConditions:function(){var t,i,p,a,s,r=PUM.getPopup(this),c=r.popmake("getSettings"),l=!0;if(c.mobile_disabled!==o&&c.mobile_disabled&&("object"!=typeof n&&(n=new MobileDetect(window.navigator.userAgent)),n.phone()))return!1;if(c.tablet_disabled!==o&&c.tablet_disabled&&("object"!=typeof n&&(n=new MobileDetect(window.navigator.userAgent)),n.tablet()))return!1;if(c.conditions!==o&&c.conditions.length)for(i=0;c.conditions.length>i;i++){for(a=c.conditions[i],t=!1,p=0;a.length>p&&(s=e.extend({},{not_operand:!1},a[p]),!s.not_operand&&r.popmake("checkCondition",s)?t=!0:s.not_operand&&!r.popmake("checkCondition",s)&&(t=!0),e(this).trigger("pumCheckingCondition",[t,s]),!t);p++);t||(l=!1)}return l},checkCondition:function(t){var o=t.target||null;return o?e.fn.popmake.conditions[o]?e.fn.popmake.conditions[o].apply(this,[t]):window.console?(console.warn("Condition "+o+" does not exist."),!0):void 0:(console.warn("Condition type not set."),!1)}}),e.fn.popmake.conditions={device_is_mobile:function(e){return n.mobile()}}}(jQuery,document);var pm_cookie,pm_cookie_json,pm_remove_cookie;!function(e){"use strict";function t(t){function o(n,i,p){var a,s=new Date;if("undefined"!=typeof document){if(arguments.length>1){switch(p=e.extend({path:"/"},o.defaults,p),typeof p.expires){case"number":s.setMilliseconds(s.getMilliseconds()+864e5*p.expires),p.expires=s;break;case"string":s.setTime(1e3*e.fn.popmake.utilities.strtotime("+"+p.expires)),p.expires=s}try{a=JSON.stringify(i),/^[\{\[]/.test(a)&&(i=a)}catch(r){}return i=t.write?t.write(i,n):encodeURIComponent(String(i)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),n=encodeURIComponent(String(n)),n=n.replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent),n=n.replace(/[\(\)]/g,escape),document.cookie=[n,"=",i,p.expires?"; expires="+p.expires.toUTCString():"",p.path?"; path="+p.path:"",p.domain?"; domain="+p.domain:"",p.secure?"; secure":""].join("")}n||(a={});for(var c=document.cookie?document.cookie.split("; "):[],l=/(%[0-9A-Z]{2})+/g,u=0;u<c.length;u++){var m=c[u].split("="),d=m.slice(1).join("=");'"'===d.charAt(0)&&(d=d.slice(1,-1));try{var f=m[0].replace(l,decodeURIComponent);if(d=t.read?t.read(d,f):t(d,f)||d.replace(l,decodeURIComponent),this.json)try{d=JSON.parse(d)}catch(r){}if(n===f){a=d;break}n||(a[f]=d)}catch(r){}}return a}}return void 0===t&&(t=function(){}),o.set=o,o.get=function(e){return o.call(o,e)},o.getJSON=function(){return o.apply({json:!0},[].slice.call(arguments))},o.defaults={},o.remove=function(t,n){o(t,"",e.extend({},n,{expires:-1,path:""})),o(t,"",e.extend({},n,{expires:-1}))},o.process=function(e,t,n,i){return arguments.length>3&&"object"!=typeof arguments[2]&&void 0!==t?o.apply(o,[e,t,{expires:n,path:i}]):o.apply(o,[].slice.call(arguments,[0,2]))},o.withConverter=e.fn.popmake.cookie,o}e.extend(e.fn.popmake,{cookie:t()}),pm_cookie=e.pm_cookie=e.fn.popmake.cookie.process,pm_cookie_json=e.pm_cookie_json=e.fn.popmake.cookie.getJSON,pm_remove_cookie=e.pm_remove_cookie=e.fn.popmake.cookie.remove}(jQuery),function(e,t,o){"use strict";e.extend(e.fn.popmake.methods,{addCookie:function(t){return pum.hooks.doAction("popmake.addCookie",arguments),e.fn.popmake.cookies[t]?e.fn.popmake.cookies[t].apply(this,Array.prototype.slice.call(arguments,1)):(window.console&&console.warn("Cookie type "+t+" does not exist."),this)},setCookie:function(t){e.pm_cookie(t.name,!0,t.session?null:t.time,t.path?"/":null),pum.hooks.doAction("popmake.setCookie",t)},checkCookies:function(t){var n,i=!1;if(t.cookie===o||t.cookie.name===o||null===t.cookie.name)return!1;switch(typeof t.cookie.name){case"object":case"array":for(n=0;t.cookie.name.length>n;n+=1)e.pm_cookie(t.cookie.name[n])!==o&&(i=!0);break;case"string":e.pm_cookie(t.cookie.name)!==o&&(i=!0)}return pum.hooks.doAction("popmake.checkCookies",t,i),i}}),e.fn.popmake.cookies=e.fn.popmake.cookies||{},e.extend(e.fn.popmake.cookies,{on_popup_open:function(e){var t=PUM.getPopup(this);t.on("pumAfterOpen",function(){t.popmake("setCookie",e)})},on_popup_close:function(e){var t=PUM.getPopup(this);t.on("pumBeforeClose",function(){t.popmake("setCookie",e)})},manual:function(e){var t=PUM.getPopup(this);t.on("pumSetCookie",function(){t.popmake("setCookie",e)})},ninja_form_success:function(e){var t=PUM.getPopup(this);t.on("pum_nf.success",function(){t.popmake("setCookie",e)})}}),e(t).on("pumInit",".pum",function(){var e,t=PUM.getPopup(this),n=t.popmake("getSettings"),i=n.cookies,p=null;if(i!==o&&i.length)for(e=0;i.length>e;e+=1)p=i[e],t.popmake("addCookie",p.event,p.settings)})}(jQuery,document);var pum_debug_mode=!1,pum_debug;!function(e,t){if(t=window.pum_vars||{debug_mode:!1},pum_debug_mode=void 0!==t.debug_mode&&t.debug_mode,pum_debug_mode||window.location.href.indexOf("pum_debug")===-1||(pum_debug_mode=!0),pum_debug_mode){var o=!1,n=!1,i=window.pum_debug_vars||{};pum_debug={odump:function(t){return e.extend({},t)},logo:function(){console.log(" -------------------------------------------------------------\n| ____ __ __ _ |\n| | _ \\ ___ _ __ _ _ _ __ | \\/ | __ _| | _____ _ __ |\n| | |_) / _ \\| '_ \\| | | | '_ \\ | |\\/| |/ _` | |/ / _ \\ '__| |\n| | __/ (_) | |_) | |_| | |_) | | | | | (_| | < __/ | |\n| |_| \\___/| .__/ \\__,_| .__/ |_| |_|\\__,_|_|\\_\\___|_| |\n| |_| |_| |\n -------------------------------------------------------------")},initialize:function(){o=!0,pum_debug.logo(),console.debug(i.debug_mode_enabled),console.log(i.debug_started_at,new Date),console.info(i.debug_more_info),pum_debug.divider(i.global_info),console.groupCollapsed(i.localized_vars),console.log("pum_vars:",pum_debug.odump(t)),e(document).trigger("pum_debug_initialize_localized_vars"),console.groupEnd(),e(document).trigger("pum_debug_initialize")},popup_event_header:function(e){var t=e.popmake("getSettings");n!==t.id&&(n=t.id,pum_debug.divider(i.single_popup_label+t.id+" - "+t.slug))},divider:function(e){var t=62,o=62,n=0,i=" "+new Array(t+1).join("-")+" ";"string"==typeof e?(o=t-e.length,n={left:Math.floor(o/2),right:Math.floor(o/2)},n.left+n.right===o-1&&n.right++,n.left=new Array(n.left+1).join(" "),n.right=new Array(n.right+1).join(" "),console.log(""+i+"\n|"+n.left+e+n.right+"|\n"+i)):console.log(i)},click_trigger:function(e,t){var o,n=e.popmake("getSettings"),p=[".popmake-"+n.id,".popmake-"+decodeURIComponent(n.slug),'a[href$="#popmake-'+n.id+'"]'];t.extra_selectors&&""!==t.extra_selectors&&p.push(t.extra_selectors),p=pum.hooks.applyFilters("pum.trigger.click_open.selectors",p,t,e),o=p.join(", "),console.log(i.label_selector,o)},trigger:function(t,o){switch(console.groupCollapsed(i.triggers[o.type].name),o.type){case"auto_open":console.log(i.label_delay,o.settings.delay),console.log(i.label_cookie,o.settings.cookie.name);break;case"click_open":pum_debug.click_trigger(t,o.settings),console.log(i.label_cookie,o.settings.cookie.name)}e(document).trigger("pum_debug_render_trigger",t,o),console.groupEnd()},cookie:function(t,o){switch(console.groupCollapsed(i.cookies[o.event].name),o.event){case"on_popup_open":case"on_popup_close":case"manual":case"ninja_form_success":console.log(i.label_settings,pum_debug.odump(o.settings))}e(document).trigger("pum_debug_render_trigger",t,o),console.groupEnd()}},e(document).on("pumInit",".pum",function(){var t=PUM.getPopup(e(this)),n=t.popmake("getSettings"),p=0;if(o||(pum_debug.initialize(),pum_debug.divider(i.popups_initializing)),console.groupCollapsed(i.single_popup_label+n.id+" - "+n.slug),console.log(i.theme_id,n.theme_id),void 0!==n.triggers&&n.triggers.length){for(console.groupCollapsed(i.label_triggers),p=0;n.triggers.length>p;p++)pum_debug.trigger(t,n.triggers[p]);console.groupEnd()}if(void 0!==n.cookies&&n.cookies.length){for(console.groupCollapsed(i.label_cookies),p=0;n.cookies.length>p;p+=1)pum_debug.cookie(t,n.cookies[p]);console.groupEnd()}void 0!==n.conditions&&n.conditions.length&&(console.groupCollapsed(i.label_conditions),console.log(n.conditions),console.groupEnd()),console.groupCollapsed(i.label_popup_settings),console.log(i.label_mobile_disabled,null!==n.mobile_disabled),console.log(i.label_tablet_disabled,null!==n.tablet_disabled),console.log(i.label_display_settings,pum_debug.odump(n.meta.display)),console.log(i.label_close_settings,pum_debug.odump(n.meta.close)),t.trigger("pum_debug_popup_settings");var a=pum.hooks.applyFilters("pum_debug.popup_settings.cleaned_meta",pum_debug.odump(n.meta),t);delete a.display,delete a.close,delete a.click_open,a.length&&console.log("Meta: ",a),console.groupEnd(),console.groupEnd()}).on("pumBeforeOpen",".pum",function(){var t=PUM.getPopup(e(this)),o=(t.popmake("getSettings"),e.fn.popmake.last_open_trigger);pum_debug.popup_event_header(t),console.groupCollapsed(i.label_event_before_open);try{o=e(e.fn.popmake.last_open_trigger)}catch(n){o=e()}finally{o=o.length?o:e.fn.popmake.last_open_trigger.toString(),console.log(i.label_triggers,[o])}console.groupEnd()}).on("pumOpenPrevented",".pum",function(){var t=PUM.getPopup(e(this));pum_debug.popup_event_header(t),console.groupCollapsed(i.label_event_open_prevented),console.groupEnd()}).on("pumAfterOpen",".pum",function(){var t=PUM.getPopup(e(this));t.popmake("getSettings");pum_debug.popup_event_header(t),console.groupCollapsed(i.label_event_after_open),console.groupEnd()}).on("pumSetupClose",".pum",function(){var t=PUM.getPopup(e(this));t.popmake("getSettings");pum_debug.popup_event_header(t),console.groupCollapsed(i.label_event_setup_close),console.groupEnd()}).on("pumClosePrevented",".pum",function(){var t=PUM.getPopup(e(this));t.popmake("getSettings");pum_debug.popup_event_header(t),console.groupCollapsed(i.label_event_close_prevented),console.groupEnd()}).on("pumBeforeClose",".pum",function(){var t=PUM.getPopup(e(this));t.popmake("getSettings");pum_debug.popup_event_header(t),console.groupCollapsed(i.label_event_before_close),console.groupEnd()}).on("pumAfterClose",".pum",function(){var t=PUM.getPopup(e(this));t.popmake("getSettings");pum_debug.popup_event_header(t),console.groupCollapsed(i.label_event_after_close),console.groupEnd()}).on("pumBeforeReposition",".pum",function(){var t=PUM.getPopup(e(this));t.popmake("getSettings");pum_debug.popup_event_header(t),console.groupCollapsed(i.label_event_before_reposition),console.groupEnd()}).on("pumAfterReposition",".pum",function(){var t=PUM.getPopup(e(this));t.popmake("getSettings");pum_debug.popup_event_header(t),console.groupCollapsed(i.label_event_after_reposition),console.groupEnd()}).on("pumCheckingCondition",".pum",function(t,o,n){var p=PUM.getPopup(e(this));p.popmake("getSettings");pum_debug.popup_event_header(p),console.groupCollapsed(i.label_event_checking_condition),console.log((n.not_operand?"(!) ":"")+n.target+": "+o,n),console.groupEnd()})}}(jQuery),function(e,t,o){"use strict";e.fn.popmake.defaults={meta:{display:{stackable:0,overlay_disabled:0,size:"medium",responsive_max_width:"",responsive_max_width_unit:"%",responsive_min_width:"",responsive_min_width_unit:"%",custom_width:"",custom_width_unit:"%",custom_height:"",custom_height_unit:"em",custom_height_auto:0,location:"center top",position_top:100,position_left:0,position_bottom:0,position_right:0,position_fixed:0,animation_type:"fade",animation_speed:350,animation_origin:"center top"},close:{overlay_click:0,esc_press:0,f4_press:0}},container:{active_class:"active",attr:{"class":"popmake"}},title:{attr:{"class":"popmake-title"}},content:{attr:{"class":"popmake-content"}},close:{close_speed:0,attr:{"class":"popmake-close"}},overlay:{attr:{id:"popmake-overlay","class":"popmake-overlay"}}}}(jQuery,document),function(e,t){"use strict";var o=function(){function e(e,t,o,n){return"string"==typeof e&&"function"==typeof t&&(o=parseInt(o||10,10),s("actions",e,t,o,n)),u}function t(){var e=l.call(arguments),t=e.shift();return"string"==typeof t&&c("actions",t,e),u}function o(e,t){return"string"==typeof e&&a("actions",e,t),u}function n(e,t,o,n){return"string"==typeof e&&"function"==typeof t&&(o=parseInt(o||10,10),s("filters",e,t,o,n)),u}function i(){var e=l.call(arguments),t=e.shift();return"string"==typeof t?c("filters",t,e):u}function p(e,t){return"string"==typeof e&&a("filters",e,t),u}function a(e,t,o,n){var i,p,a;if(m[e][t])if(o)if(i=m[e][t],n)for(a=i.length;a--;)p=i[a],p.callback===o&&p.context===n&&i.splice(a,1);else for(a=i.length;a--;)i[a].callback===o&&i.splice(a,1);else m[e][t]=[]}function s(e,t,o,n,i){var p={callback:o,priority:n,context:i},a=m[e][t];a?(a.push(p),a=r(a)):a=[p],m[e][t]=a}function r(e){for(var t,o,n,i=1,p=e.length;i<p;i++){
2
+ for(t=e[i],o=i;(n=e[o-1])&&n.priority>t.priority;)e[o]=e[o-1],--o;e[o]=t}return e}function c(e,t,o){var n,i,p=m[e][t];if(!p)return"filters"===e&&o[0];if(i=p.length,"filters"===e)for(n=0;n<i;n++)o[0]=p[n].callback.apply(p[n].context,o);else for(n=0;n<i;n++)p[n].callback.apply(p[n].context,o);return"filters"!==e||o[0]}var l=Array.prototype.slice,u={removeFilter:p,applyFilters:i,addFilter:n,removeAction:o,doAction:t,addAction:e},m={actions:{},filters:{}};return u};e.pum=e.pum||{},e.pum.hooks=e.pum.hooks||new o}(window),function(e){"use strict";e.fn.popmake.cookies=e.fn.popmake.cookies||{},e.extend(e.fn.popmake.cookies,{cf7_form_success:function(e){var t=PUM.getPopup(this);t.on("pum_cf7.success",function(){t.popmake("setCookie",e)})}}),e(document).on("wpcf7:submit",".wpcf7",function(t){var o=e(t.target),n=o.find('meta[name="wpcf7-pum"]'),i=!!n.length&&JSON.parse(n.attr("content")),p=o.parents(".pum");i&&(i=e.extend({openpopup:!1,openpopup_id:0,closepopup:!1,closedelay:0},i),p.length&&p.trigger("pum_cf7.success"),p.length&&i.closepopup?setTimeout(function(){p.popmake("close"),i.openpopup&&PUM.getPopup(i.openpopup_id).length&&PUM.open(i.openpopup_id)},parseInt(i.closedelay)):i.openpopup&&(p=PUM.getPopup(i.openpopup_id),p.length&&p.popmake("open")))})}(jQuery),function(e){"use strict";e.fn.popmake.cookies=e.fn.popmake.cookies||{},e.extend(e.fn.popmake.cookies,{gforms_form_success:function(e){var t=PUM.getPopup(this);t.on("pum_gforms.success",function(){t.popmake("setCookie",e)})}}),e(document).ready(function(){e(".pum .gform_wrapper > form").each(function(){var t=e(this),o=t.attr("id").replace("gform_",""),n=t.find('meta[name="gforms-pum"]'),i=!!n.length&&JSON.parse(n.attr("content")),p=t.parents(".pum");i&&(i=e.extend({openpopup:!1,openpopup_id:0,closepopup:!1,closedelay:0},i),p.attr("data-gform-id",o).data("gform-id",o),p.attr("data-gform-settings",JSON.stringify(i)).data("gform-settings",i))})}),e(document).on("gform_confirmation_loaded",function(t,o){var n=e('.pum[data-gform-id="'+o+'"]'),i=n.data("gform-settings");console.log(n,i),n.length&&n.trigger("pum_gforms.success"),n.length&&i.closepopup?setTimeout(function(){n.popmake("close"),i.openpopup&&PUM.getPopup(i.openpopup_id).length&&PUM.open(i.openpopup_id)},parseInt(i.closedelay)):i.openpopup&&(n=PUM.getPopup(i.openpopup_id),n.length&&n.popmake("open"))})}(jQuery),function(e){"use strict";if("undefined"!=typeof Marionette&&"undefined"!=typeof nfRadio){var t=Marionette.Object.extend({initialize:function(){this.listenTo(nfRadio.channel("forms"),"submit:response",this.closePopup),this.listenTo(nfRadio.channel("forms"),"submit:response",this.openPopup),this.listenTo(nfRadio.channel("forms"),"submit:response",this.popupTriggers)},popupTriggers:function(t,o,n,i){var p;p=e("#nf-form-"+i+"-cont").parents(".pum"),p.length&&(p.trigger("pum_nf.success"),t.errors.length?p.trigger("pum_nf.error"):p.trigger("pum_nf.success"))},closePopup:function(t,o,n,i){var p;"undefined"==typeof t.data.actions||t.errors.length||"undefined"!=typeof t.data.actions.closepopup&&(p=e("#nf-form-"+i+"-cont").parents(".pum"),p.length&&setTimeout(function(){p.popmake("close")},parseInt(t.data.actions.closepopup)))},openPopup:function(t){var o;"undefined"==typeof t.data.actions||t.errors.length||"undefined"!=typeof t.data.actions.openpopup&&(o=e("#pum-"+parseInt(t.data.actions.openpopup)),o.length&&o.popmake("open"))}});jQuery(document).ready(function(){new t})}}(jQuery),function(e,t,o){"use strict";e.extend(e.fn.popmake.methods,{addTrigger:function(t){return e.fn.popmake.triggers[t]?e.fn.popmake.triggers[t].apply(this,Array.prototype.slice.call(arguments,1)):(window.console&&console.warn("Trigger type "+t+" does not exist."),this)}}),e.fn.popmake.triggers={auto_open:function(t){var o=PUM.getPopup(this);setTimeout(function(){o.popmake("state","isOpen")||!o.popmake("checkCookies",t)&&o.popmake("checkConditions")&&(e.fn.popmake.last_open_trigger="Auto Open - Delay: "+t.delay,o.popmake("open"))},t.delay)},click_open:function(o){var n,i=PUM.getPopup(this),p=i.popmake("getSettings"),a=[".popmake-"+p.id,".popmake-"+decodeURIComponent(p.slug),'a[href$="#popmake-'+p.id+'"]'];o.extra_selectors&&""!==o.extra_selectors&&a.push(o.extra_selectors),a=pum.hooks.applyFilters("pum.trigger.click_open.selectors",a,o,i),n=a.join(", "),e(n).addClass("pum-trigger").data("popup",p.id).attr("data-popup",p.id).data("settings",o).attr("data-settings",o).data("do-default",o.do_default).attr("data-do-default",o.do_default).css({cursor:"pointer"}),e(t).on("click",n,function(t){var n=e(this);n.hasClass("pum-trigger")&&n.data("popup")||(n.addClass("pum-trigger").data("popup",p.id).attr("data-popup",p.id).data("settings",o).attr("data-settings",o).data("do-default",o.do_default).attr("data-do-default",o.do_default).css({cursor:"pointer"}),t.preventDefault(),t.stopPropagation(),n.trigger("click"))})},admin_debug:function(){PUM.getPopup(this).popmake("open")}},e(t).on("pumInit",".pum",function(){var e,t=PUM.getPopup(this),n=t.popmake("getSettings"),i=n.triggers,p=null;if(i!==o&&i.length)for(e=0;i.length>e;e+=1)p=i[e],t.popmake("addTrigger",p.type,p.settings)}).on("click.pumTrigger",".pum-trigger[data-popup]",function(t){var o=e(this),n=PUM.getPopup(o.data("popup")),i=o.data("settings")||{},p=i.do_default||!1;n.has(o).length>0||n.popmake("state","isOpen")||!n.popmake("checkCookies",i)&&n.popmake("checkConditions")&&(o.data("do-default")?p=o.data("do-default"):o.hasClass("do-default")&&(p=!0),pum.hooks.applyFilters("pum.trigger.click_open.do_default",p,n,o)||(t.preventDefault(),t.stopPropagation()),e.fn.popmake.last_open_trigger=o,n.popmake("open"))})}(jQuery,document),function(e,t,o){"use strict";function n(t,o){return e.inArray(o,t)!==-1}function i(e,t,o){var n=t[0];t.length>1?(e[n]||(e[n]=t[1]?{}:[]),i(e[n],t.slice(1),o)):(n||(n=e.length),e[n]=o)}var p="color,date,datetime,datetime-local,email,hidden,month,number,password,range,search,tel,text,time,url,week".split(","),a="select,textarea".split(","),s=/\[([^\]]*)\]/g;e.fn.popmake.utilities={convert_hex:function(e,t){e=e.replace("#","");var o=parseInt(e.substring(0,2),16),n=parseInt(e.substring(2,4),16),i=parseInt(e.substring(4,6),16);return"rgba("+o+","+n+","+i+","+t/100+")"},debounce:function(e,t){var o;return function(){var n=this,i=arguments;window.clearTimeout(o),o=window.setTimeout(function(){e.apply(n,i)},t)}},throttle:function(e,t){var o=!1,n=function(){o=!1};return function(){o||(e.apply(this,arguments),window.setTimeout(n,t),o=!0)}},getXPath:function(t){var o,n,i,p,a,s=[];return e.each(e(t).parents(),function(t,r){return o=e(r),n=o.attr("id")||"",i=o.attr("class")||"",p=o.get(0).tagName.toLowerCase(),a=o.parent().children(p).index(o),"body"!==p&&(i.length>0&&(i=i.split(" "),i=i[0]),void s.push(p+(n.length>0?"#"+n:i.length>0?"."+i.split(" ").join("."):":eq("+a+")")))}),s.reverse().join(" > ")},strtotime:function(e,t){function n(e,t,n){var i,p=l[t];p!==o&&(i=p-c.getDay(),0===i?i=7*n:i>0&&"last"===e?i-=7:i<0&&"next"===e&&(i+=7),c.setDate(c.getDate()+i))}function i(e){var t=e.split(" "),o=t[0],i=t[1].substring(0,3),p=/\d+/.test(o),a="ago"===t[2],s=("last"===o?-1:1)*(a?-1:1);if(p&&(s*=parseInt(o,10)),u.hasOwnProperty(i)&&!t[1].match(/^mon(day|\.)?$/i))return c["set"+u[i]](c["get"+u[i]]()+s);if("wee"===i)return c.setDate(c.getDate()+7*s);if("next"===o||"last"===o)n(o,i,s);else if(!p)return!1;return!0}var p,a,s,r,c,l,u,m,d,f,g,_=!1;if(!e)return _;if(e=e.replace(/^\s+|\s+$/g,"").replace(/\s{2,}/g," ").replace(/[\t\r\n]/g,"").toLowerCase(),a=e.match(/^(\d{1,4})([\-\.\/\:])(\d{1,2})([\-\.\/\:])(\d{1,4})(?:\s(\d{1,2}):(\d{2})?:?(\d{2})?)?(?:\s([A-Z]+)?)?$/),a&&a[2]===a[4])if(a[1]>1901)switch(a[2]){case"-":return a[3]>12||a[5]>31?_:new Date(a[1],parseInt(a[3],10)-1,a[5],a[6]||0,a[7]||0,a[8]||0,a[9]||0)/1e3;case".":return _;case"/":return a[3]>12||a[5]>31?_:new Date(a[1],parseInt(a[3],10)-1,a[5],a[6]||0,a[7]||0,a[8]||0,a[9]||0)/1e3}else if(a[5]>1901)switch(a[2]){case"-":return a[3]>12||a[1]>31?_:new Date(a[5],parseInt(a[3],10)-1,a[1],a[6]||0,a[7]||0,a[8]||0,a[9]||0)/1e3;case".":return a[3]>12||a[1]>31?_:new Date(a[5],parseInt(a[3],10)-1,a[1],a[6]||0,a[7]||0,a[8]||0,a[9]||0)/1e3;case"/":return a[1]>12||a[3]>31?_:new Date(a[5],parseInt(a[1],10)-1,a[3],a[6]||0,a[7]||0,a[8]||0,a[9]||0)/1e3}else switch(a[2]){case"-":return a[3]>12||a[5]>31||a[1]<70&&a[1]>38?_:(r=a[1]>=0&&a[1]<=38?+a[1]+2e3:a[1],new Date(r,parseInt(a[3],10)-1,a[5],a[6]||0,a[7]||0,a[8]||0,a[9]||0)/1e3);case".":return a[5]>=70?a[3]>12||a[1]>31?_:new Date(a[5],parseInt(a[3],10)-1,a[1],a[6]||0,a[7]||0,a[8]||0,a[9]||0)/1e3:a[5]<60&&!a[6]?a[1]>23||a[3]>59?_:(s=new Date,new Date(s.getFullYear(),s.getMonth(),s.getDate(),a[1]||0,a[3]||0,a[5]||0,a[9]||0)/1e3):_;case"/":return a[1]>12||a[3]>31||a[5]<70&&a[5]>38?_:(r=a[5]>=0&&a[5]<=38?+a[5]+2e3:a[5],new Date(r,parseInt(a[1],10)-1,a[3],a[6]||0,a[7]||0,a[8]||0,a[9]||0)/1e3);case":":return a[1]>23||a[3]>59||a[5]>59?_:(s=new Date,new Date(s.getFullYear(),s.getMonth(),s.getDate(),a[1]||0,a[3]||0,a[5]||0)/1e3)}if("now"===e)return null===t||isNaN(t)?(new Date).getTime()/1e3||0:t||0;if(p=Date.parse(e),!isNaN(p))return p/1e3||0;if(c=t?new Date(1e3*t):new Date,l={sun:0,mon:1,tue:2,wed:3,thu:4,fri:5,sat:6},u={yea:"FullYear",mon:"Month",day:"Date",hou:"Hours",min:"Minutes",sec:"Seconds"},d="(years?|months?|weeks?|days?|hours?|minutes?|min|seconds?|sec|sunday|sun\\.?|monday|mon\\.?|tuesday|tue\\.?|wednesday|wed\\.?|thursday|thu\\.?|friday|fri\\.?|saturday|sat\\.?)",f="([+-]?\\d+\\s"+d+"|(last|next)\\s"+d+")(\\sago)?",a=e.match(new RegExp(f,"gi")),!a)return _;for(g=0,m=a.length;g<m;g+=1)if(!i(a[g]))return _;return c.getTime()/1e3},serializeObject:function(t){e.extend({},t);var o={},r=e.extend(!0,{include:[],exclude:[],includeByClass:""},t);return this.find(":input").each(function(){var t;!this.name||this.disabled||n(r.exclude,this.name)||r.include.length&&!n(r.include,this.name)||this.className.indexOf(r.includeByClass)===-1||(t=this.name.replace(s,"[$1").split("["),t[0]&&(this.checked||n(p,this.type)||n(a,this.nodeName.toLowerCase()))&&("checkbox"===this.type&&t.push(""),i(o,t,e(this).val())))}),o}},e.fn.pumSerializeObject=e.fn.popmake.utilities.serializeObject,e.fn.popmake.utilies=e.fn.popmake.utilities}(jQuery,document),function(e,t,o){"use strict";e.fn.popmake.version=1.4,e.fn.popmake.last_open_popup=null,e(t).ready(function(){e(".popmake").popmake()})}(jQuery);
includes/admin/shortcode-ui/class-pum-admin-shortcode-ui.php CHANGED
@@ -130,6 +130,9 @@ class PUM_Admin_Shortcode_UI {
130
  $shortcodes = array();
131
 
132
  foreach ( PUM_Shortcodes::instance()->get_shortcodes() as $tag => $shortcode ) {
 
 
 
133
  $shortcodes[ $tag ] = array(
134
  'label' => $shortcode->label(),
135
  'description' => $shortcode->description(),
@@ -215,6 +218,11 @@ class PUM_Admin_Shortcode_UI {
215
 
216
  /**
217
  * Render a shortcode body for preview.
 
 
 
 
 
218
  */
219
  private function render_shortcode_for_preview( $shortcode, $post_id = null ) {
220
 
130
  $shortcodes = array();
131
 
132
  foreach ( PUM_Shortcodes::instance()->get_shortcodes() as $tag => $shortcode ) {
133
+ /**
134
+ * @var $shortcode PUM_Shortcode
135
+ */
136
  $shortcodes[ $tag ] = array(
137
  'label' => $shortcode->label(),
138
  'description' => $shortcode->description(),
218
 
219
  /**
220
  * Render a shortcode body for preview.
221
+ *
222
+ * @param $shortcode
223
+ * @param null $post_id
224
+ *
225
+ * @return string
226
  */
227
  private function render_shortcode_for_preview( $shortcode, $post_id = null ) {
228
 
includes/admin/shortcode-ui/footer-scripts.php CHANGED
@@ -22,6 +22,11 @@
22
  if (null === v || '' === v) {
23
  delete attrs[k];
24
  }
 
 
 
 
 
25
  });
26
 
27
  return attrs;
22
  if (null === v || '' === v) {
23
  delete attrs[k];
24
  }
25
+
26
+ // Multicheck converts keys to array.
27
+ if (typeof v === 'object') {
28
+ attrs[k] = Object.keys(v);
29
+ }
30
  });
31
 
32
  return attrs;
includes/admin/shortcode-ui/templates/fields.php CHANGED
@@ -79,14 +79,10 @@
79
  </script>
80
 
81
  <script type="text/html" id="tmpl-pum-field-multicheck">
82
- <ul class="pum-field-mulitcheck-list">
83
- <# _.each(data.options, function(option, key) { #>
84
- <li>
85
- <input type="checkbox" id="{{data.id}}_{{key}}" name="{{data.name}}[{{option.value}}]" value="1" {{{option.meta}}}/>
86
- <label for="{{data.id}}_{{key}}">{{option.label}}</label>
87
- </li>
88
- <# }); #>
89
- </ul>
90
  </script>
91
 
92
  <script type="text/html" id="tmpl-pum-field-rangeslider">
79
  </script>
80
 
81
  <script type="text/html" id="tmpl-pum-field-multicheck">
82
+ <# _.each(data.options, function(option, key) { #>
83
+ <input name="{{data.name}}[{{option.value}}]" id="{{data.id}}_{{key}}" type="checkbox" value="1" {{{option.meta}}} />&nbsp;
84
+ <label for="{{data.id}}_{{key}}">{{option.label}}</label><br/>
85
+ <# }); #>
 
 
 
 
86
  </script>
87
 
88
  <script type="text/html" id="tmpl-pum-field-rangeslider">
includes/class-popmake-fields.php CHANGED
@@ -156,7 +156,7 @@ class Popmake_Fields {
156
  'cols' => 50,
157
  'min' => 0,
158
  'max' => 50,
159
- 'force_minmax' => true,
160
  'step' => 1,
161
  'select2' => null,
162
  'object_type' => 'post_type',
156
  'cols' => 50,
157
  'min' => 0,
158
  'max' => 50,
159
+ 'force_minmax' => false,
160
  'step' => 1,
161
  'select2' => null,
162
  'object_type' => 'post_type',
includes/class-pum-fields.php CHANGED
@@ -18,6 +18,19 @@ class PUM_Fields extends Popmake_Fields {
18
 
19
  #region Non Fields
20
 
 
 
 
 
 
 
 
 
 
 
 
 
 
21
  /**
22
  * Heading Callback
23
  *
@@ -28,10 +41,10 @@ class PUM_Fields extends Popmake_Fields {
28
  * @return void
29
  */
30
  public function heading_callback( $args ) { ?>
31
- </td></tr></tbody></table>
32
- <h2 class="pum-setting-heading"><?php esc_html_e( $args['desc'] ); ?></h2>
33
- <hr/>
34
- <table class="form-table"><tbody><tr style="display:none;"><td colspan="2"><?php
35
  }
36
 
37
 
18
 
19
  #region Non Fields
20
 
21
+ /**
22
+ * Hook Callback
23
+ *
24
+ * Renders the heading.
25
+ *
26
+ * @param array $args Arguments passed by the setting
27
+ *
28
+ * @return void
29
+ */
30
+ public function hook_callback( $args ) {
31
+ do_action( $args['hook'], $args );
32
+ }
33
+
34
  /**
35
  * Heading Callback
36
  *
41
  * @return void
42
  */
43
  public function heading_callback( $args ) { ?>
44
+ </td></tr></tbody></table>
45
+ <h2 class="pum-setting-heading"><?php esc_html_e( $args['desc'] ); ?></h2>
46
+ <hr/>
47
+ <table class="form-table"><tbody><tr style="display:none;"><td colspan="2"><?php
48
  }
49
 
50
 
includes/class-pum-popup.php CHANGED
@@ -213,9 +213,9 @@ if ( ! class_exists( 'PUM_Popup' ) ) {
213
  }
214
 
215
  // Add a class for each trigger type.
216
- foreach ( $this->get_triggers() as $trigger => $trigger_settings ) {
217
- if ( ! in_array( $trigger, $classes['overlay'] ) ) {
218
- $classes['overlay'][] = $trigger;
219
  }
220
  }
221
 
213
  }
214
 
215
  // Add a class for each trigger type.
216
+ foreach ( $this->get_triggers() as $trigger ) {
217
+ if ( ! in_array( $trigger['type'], $classes['overlay'] ) ) {
218
+ $classes['overlay'][] = $trigger['type'];
219
  }
220
  }
221
 
includes/class-pum-shortcode.php CHANGED
@@ -47,6 +47,8 @@ class PUM_Shortcode extends PUM_Fields {
47
 
48
  /**
49
  * Class constructor will set the needed filter and action hooks
 
 
50
  */
51
  public function __construct( $args = array() ) {
52
 
@@ -79,7 +81,7 @@ class PUM_Shortcode extends PUM_Fields {
79
  $fields = array();
80
 
81
  if ( $this->has_content ) {
82
- $inner_content_labels = $this->inner_content_labels();
83
  $fields[ $this->inner_content_section ]['_inner_content'] = array(
84
  'label' => $inner_content_labels['label'],
85
  'desc' => $inner_content_labels['description'],
@@ -131,8 +133,8 @@ class PUM_Shortcode extends PUM_Fields {
131
  */
132
  public function inner_content_labels() {
133
  return array(
134
- 'label' => $this->label(),
135
- 'description' => $this->description()
136
  );
137
  }
138
 
@@ -174,7 +176,7 @@ class PUM_Shortcode extends PUM_Fields {
174
  /**
175
  * Shortcode handler
176
  *
177
- * @param array $atts shortcode attributes
178
  * @param string $content shortcode content
179
  *
180
  * @return string
@@ -203,15 +205,15 @@ class PUM_Shortcode extends PUM_Fields {
203
  public function register_shortcode_ui() {
204
 
205
  $shortcode_ui_args = array(
206
- 'label' => $this->label(),
207
  'listItemImage' => $this->icon(),
208
- 'post_type' => $this->post_types(),
209
  /*
210
  * Register UI for the "inner content" of the shortcode. Optional.
211
  * If no UI is registered for the inner content, then any inner content
212
  * data present will be backed up during editing.
213
  */
214
- 'attrs' => array()
215
  );
216
 
217
 
@@ -229,12 +231,12 @@ class PUM_Shortcode extends PUM_Fields {
229
 
230
 
231
  //text, checkbox, textarea, radio, select, email, url, number, date, attachment, color, post_select
232
- switch( $field['type'] ) {
233
  case 'selectox':
234
- $shortcode_ui_args['attrs'][ ] = array(
235
- 'label' => esc_html( $field['label'] ),
236
- 'attr' => $id,
237
- 'type' => 'select',
238
  'options' => $field['options'],
239
  );
240
  break;
@@ -244,13 +246,12 @@ class PUM_Shortcode extends PUM_Fields {
244
  if ( empty( $field['post_type'] ) ) {
245
  break;
246
  }
247
- $shortcode_ui_args['attrs'][ ] = array(
248
- 'label' => esc_html( $field['label'] ),
249
- 'attr' => $id,
250
- 'type' => 'post_select',
251
  'options' => isset( $field['options'] ) ? $field['options'] : array(),
252
- 'query' => array( 'post_type' => $field['post_type'] ),
253
- 'options' => $field['options'],
254
  );
255
  break;
256
 
@@ -259,13 +260,13 @@ class PUM_Shortcode extends PUM_Fields {
259
 
260
  case 'text';
261
  default:
262
- $shortcode_ui_args['attrs'][ ] = array(
263
- 'label' => $field['label'],
264
- 'attr' => $id,
265
- 'type' => 'text',
266
- 'value' => ! empty( $field['std'] ) ? $field['std'] : '',
267
  //'encode' => true,
268
- 'meta' => array(
269
  'placeholder' => $field['placeholder'],
270
  ),
271
  );
47
 
48
  /**
49
  * Class constructor will set the needed filter and action hooks
50
+ *
51
+ * @param array $args
52
  */
53
  public function __construct( $args = array() ) {
54
 
81
  $fields = array();
82
 
83
  if ( $this->has_content ) {
84
+ $inner_content_labels = $this->inner_content_labels();
85
  $fields[ $this->inner_content_section ]['_inner_content'] = array(
86
  'label' => $inner_content_labels['label'],
87
  'desc' => $inner_content_labels['description'],
133
  */
134
  public function inner_content_labels() {
135
  return array(
136
+ 'label' => $this->label(),
137
+ 'description' => $this->description(),
138
  );
139
  }
140
 
176
  /**
177
  * Shortcode handler
178
  *
179
+ * @param array $atts shortcode attributes
180
  * @param string $content shortcode content
181
  *
182
  * @return string
205
  public function register_shortcode_ui() {
206
 
207
  $shortcode_ui_args = array(
208
+ 'label' => $this->label(),
209
  'listItemImage' => $this->icon(),
210
+ 'post_type' => $this->post_types(),
211
  /*
212
  * Register UI for the "inner content" of the shortcode. Optional.
213
  * If no UI is registered for the inner content, then any inner content
214
  * data present will be backed up during editing.
215
  */
216
+ 'attrs' => array(),
217
  );
218
 
219
 
231
 
232
 
233
  //text, checkbox, textarea, radio, select, email, url, number, date, attachment, color, post_select
234
+ switch ( $field['type'] ) {
235
  case 'selectox':
236
+ $shortcode_ui_args['attrs'][] = array(
237
+ 'label' => esc_html( $field['label'] ),
238
+ 'attr' => $id,
239
+ 'type' => 'select',
240
  'options' => $field['options'],
241
  );
242
  break;
246
  if ( empty( $field['post_type'] ) ) {
247
  break;
248
  }
249
+ $shortcode_ui_args['attrs'][] = array(
250
+ 'label' => esc_html( $field['label'] ),
251
+ 'attr' => $id,
252
+ 'type' => 'post_select',
253
  'options' => isset( $field['options'] ) ? $field['options'] : array(),
254
+ 'query' => array( 'post_type' => $field['post_type'] ),
 
255
  );
256
  break;
257
 
260
 
261
  case 'text';
262
  default:
263
+ $shortcode_ui_args['attrs'][] = array(
264
+ 'label' => $field['label'],
265
+ 'attr' => $id,
266
+ 'type' => 'text',
267
+ 'value' => ! empty( $field['std'] ) ? $field['std'] : '',
268
  //'encode' => true,
269
+ 'meta' => array(
270
  'placeholder' => $field['placeholder'],
271
  ),
272
  );
includes/class-pum.php CHANGED
@@ -7,7 +7,7 @@ if ( ! defined( 'ABSPATH' ) ) {
7
 
8
  class PUM {
9
 
10
- const VER = '1.5.8';
11
 
12
  const DB_VER = 6;
13
 
7
 
8
  class PUM {
9
 
10
+ const VER = '1.6.0';
11
 
12
  const DB_VER = 6;
13
 
includes/integrations/class-pum-cf7.php ADDED
@@ -0,0 +1,258 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*******************************************************************************
3
+ * Copyright (c) 2017, WP Popup Maker
4
+ ******************************************************************************/
5
+
6
+ if ( ! defined( 'ABSPATH' ) ) {
7
+ exit;
8
+ }
9
+
10
+ /**
11
+ * Class PUM_CF7_Integration
12
+ */
13
+ class PUM_CF7_Integration {
14
+
15
+ /**
16
+ * Initialize if CF7 is active.
17
+ */
18
+ public static function init() {
19
+ if ( class_exists( 'WPCF7' ) || ( defined( 'WPCF7_VERSION' ) && WPCF7_VERSION ) ) {
20
+ add_filter( 'pum_get_cookies', array( __CLASS__, 'register_cookies' ) );
21
+ add_filter( 'wpcf7_editor_panels', array( __CLASS__, 'editor_panels' ) );
22
+ add_action( 'wpcf7_after_save', array( __CLASS__, 'save' ) );
23
+ add_filter( 'wpcf7_form_elements', array( __CLASS__, 'form_elements' ) );
24
+ add_action( 'popmake_preload_popup', array( __CLASS__, 'preload' ) );
25
+ }
26
+ }
27
+
28
+ /**
29
+ * Check if the popups use CF7 Forms and force enqueue their assets.
30
+ *
31
+ * @param $popup_id
32
+ */
33
+ public static function preload( $popup_id ) {
34
+ $popup = pum_popup( $popup_id );
35
+
36
+ if ( has_shortcode( $popup->post_content, 'contact-form-7' ) ) {
37
+ if ( function_exists( 'wpcf7_enqueue_scripts' ) ) {
38
+ wpcf7_enqueue_scripts();
39
+ }
40
+
41
+ if ( function_exists( 'wpcf7_enqueue_styles' ) ) {
42
+ wpcf7_enqueue_styles();
43
+ }
44
+ }
45
+ }
46
+
47
+ /**
48
+ * Append a hidden meta html element with the forms popup settings.
49
+ *
50
+ * @param $elements
51
+ *
52
+ * @return string
53
+ */
54
+ public static function form_elements( $elements ) {
55
+ $form = wpcf7_get_current_contact_form();
56
+
57
+ $settings = wp_json_encode( self::form_options( $form->id() ) );
58
+
59
+ return $elements . "<meta name='wpcf7-pum' content='$settings' />";
60
+ }
61
+
62
+ /**
63
+ * Get a specific forms options.
64
+ *
65
+ * @param $id
66
+ *
67
+ * @return array
68
+ */
69
+ public static function form_options( $id ) {
70
+ $settings = get_option( 'cf7_pum_' . $id, self::defaults() );
71
+
72
+ return wp_parse_args( $settings, self::defaults() );
73
+ }
74
+
75
+ /**
76
+ * Get default values.
77
+ *
78
+ * @return array
79
+ */
80
+ public static function defaults() {
81
+ return array(
82
+ 'closepopup' => false,
83
+ 'closedelay' => 0,
84
+ 'openpopup' => false,
85
+ 'openpopup_id' => 0,
86
+ );
87
+ }
88
+
89
+ /**
90
+ * Registers new cookie events.
91
+ *
92
+ * @param array $cookies
93
+ *
94
+ * @return array
95
+ */
96
+ public static function register_cookies( $cookies = array() ) {
97
+ $cookies['cf7_form_success'] = array(
98
+ 'labels' => array(
99
+ 'name' => __( 'Contact Form 7 Success', 'popup-maker' ),
100
+ ),
101
+ 'fields' => pum_get_cookie_fields(),
102
+ );
103
+
104
+ return $cookies;
105
+ }
106
+
107
+ /**
108
+ * Register new CF7 form editor tab.
109
+ *
110
+ * @param array $panels
111
+ *
112
+ * @return array
113
+ */
114
+ public static function editor_panels( $panels = array() ) {
115
+ return array_merge( $panels, array(
116
+ 'popups' => array(
117
+ 'title' => __( 'Popup Settings', 'popup-maker' ),
118
+ 'callback' => array( __CLASS__, 'editor_panel' ),
119
+ ),
120
+ ) );
121
+ }
122
+
123
+ /**
124
+ * Render the popup tab.
125
+ *
126
+ * @param object $args
127
+ */
128
+ public static function editor_panel( $args ) {
129
+
130
+ $settings = self::form_options( $args->id() ); ?>
131
+ <h2><?php _e( 'Popup Settings', 'popup-maker' ); ?></h2>
132
+ <p class="description"><?php _e( 'These settings control popups after successful form submissions.', 'popup-maker' ); ?></p>
133
+ <table class="form-table">
134
+ <tbody>
135
+ <tr>
136
+ <th scope="row">
137
+ <label for="wpcf7-pum-openpopup"><?php _e( 'Open Popup', 'popup-maker' ); ?></label>
138
+ </th>
139
+ <td>
140
+ <input type="checkbox" id="wpcf7-pum-openpopup" name="wpcf7-pum[openpopup]" value="true" <?php checked( $settings['openpopup'], true ); ?> />
141
+ </td>
142
+ </tr>
143
+ <tr id="wpcf7-pum-openpopup_id-wrapper">
144
+ <th scope="row">
145
+ <label for="wpcf7-pum-openpopup_id"><?php _e( 'Popup', 'popup-maker' ); ?></label>
146
+ </th>
147
+ <td>
148
+ <select id="wpcf7-pum-openpopup_id" name="wpcf7-pum[openpopup_id]">
149
+ <?php foreach ( self::get_popup_list() as $option ) { ?>
150
+ <option value="<?php esc_attr_e( $option['value'] ); ?>" <?php selected( $settings['openpopup_id'], $option['value'] ); ?>><?php echo $option['label']; ?></option>
151
+ <?php } ?>
152
+ </select>
153
+ </td>
154
+ </tr>
155
+ <tr>
156
+ <th scope="row">
157
+ <label for="wpcf7-pum-closepopup"><?php _e( 'Close Popup', 'popup-maker' ); ?></label>
158
+ </th>
159
+ <td>
160
+ <input type="checkbox" id="wpcf7-pum-closepopup" name="wpcf7-pum[closepopup]" value="true" <?php checked( $settings['closepopup'], true ); ?> />
161
+ </td>
162
+ </tr>
163
+ <tr id="wpcf7-pum-closedelay-wrapper">
164
+ <th scope="row">
165
+ <label for="wpcf7-pum-closedelay"><?php _e( 'Delay', 'popup-maker' ); ?></label>
166
+ </th>
167
+ <td>
168
+ <input type="number" id="wpcf7-pum-closedelay" min="0" step="500" name="wpcf7-pum[closedelay]" style="width: 100px;" value="<?php esc_attr_e( $settings['closedelay'] ); ?>" /><?php _e( 'ms', 'popup-maker' ); ?>
169
+ </td>
170
+ </tr>
171
+ </tbody>
172
+ </table>
173
+ <script>
174
+ (function ($) {
175
+ var $open = $('#wpcf7-pum-openpopup'),
176
+ $close = $('#wpcf7-pum-closepopup'),
177
+ $popup_id_wrapper = $('#wpcf7-pum-openpopup_id-wrapper'),
178
+ $delay_wrapper = $('#wpcf7-pum-closedelay-wrapper');
179
+
180
+ function check_open() {
181
+ if ($open.is(':checked')) {
182
+ $popup_id_wrapper.show();
183
+ } else {
184
+ $popup_id_wrapper.hide();
185
+ }
186
+ }
187
+
188
+ function check_close() {
189
+ if ($close.is(':checked')) {
190
+ $delay_wrapper.show();
191
+ } else {
192
+ $delay_wrapper.hide();
193
+ }
194
+ }
195
+
196
+ check_open();
197
+ check_close();
198
+
199
+ $open.on('click', check_open);
200
+ $close.on('click', check_close);
201
+ }(jQuery));
202
+ </script>
203
+ <?php
204
+ }
205
+
206
+ /**
207
+ * Get a list of popups for a select box.
208
+ *
209
+ * @return array
210
+ */
211
+ public static function get_popup_list() {
212
+ $popup_list = array(
213
+ array(
214
+ 'value' => '',
215
+ 'label' => __( 'Select a popup', 'popup-maker' ),
216
+ ),
217
+ );
218
+
219
+ $popups = get_posts( array(
220
+ 'post_type' => 'popup',
221
+ 'post_status' => array( 'publish' ),
222
+ 'posts_per_page' => - 1,
223
+ ) );
224
+
225
+ foreach ( $popups as $popup ) {
226
+ $popup_list[] = array(
227
+ 'value' => $popup->ID,
228
+ 'label' => $popup->post_title,
229
+ );
230
+
231
+ }
232
+
233
+ return $popup_list;
234
+ }
235
+
236
+ /**
237
+ * Save form popup options.
238
+ *
239
+ * @param $args
240
+ */
241
+ public static function save( $args ) {
242
+ if ( ! empty( $_POST['wpcf7-pum'] ) ) {
243
+ $settings = $_POST['wpcf7-pum'];
244
+
245
+ // Sanitize values.
246
+ $settings['openpopup'] = ! empty( $settings['openpopup'] );
247
+ $settings['openpopup_id'] = ! empty( $settings['openpopup_id'] ) ? absint( $settings['openpopup_id'] ) : 0;
248
+ $settings['closepopup'] = ! empty( $settings['closepopup'] );
249
+ $settings['closedelay'] = ! empty( $settings['closedelay'] ) ? absint( $settings['closedelay'] ) : 0;
250
+
251
+ update_option( 'cf7_pum_' . $args->id(), $settings );
252
+ } else {
253
+ delete_option( 'cf7_pum_' . $args->id() );
254
+ }
255
+ }
256
+ }
257
+
258
+ add_action( 'init', 'PUM_CF7_Integration::init' );
includes/integrations/class-pum-gravity-forms.php ADDED
@@ -0,0 +1,296 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class PUM_Gravity_Forms_Integation {
4
+
5
+ public static function init() {
6
+ if ( class_exists( 'RGForms' ) ) {
7
+ add_filter( 'gform_form_settings_menu', array( __CLASS__, 'settings_menu' ) );
8
+ add_action( 'gform_form_settings_page_popup-maker', array( __CLASS__, 'render_settings_page' ) );
9
+ add_filter( 'pum_get_cookies', array( __CLASS__, 'register_cookies' ) );
10
+ add_filter( 'gform_get_form_filter', array( __CLASS__, 'get_form' ), 10, 2 );
11
+ add_action( 'popmake_preload_popup', array( __CLASS__, 'preload' ) );
12
+ add_action( 'popmake_popup_before_inner', array( __CLASS__, 'force_ajax' ) );
13
+ add_action( 'popmake_popup_after_inner', array( __CLASS__, 'force_ajax' ) );
14
+ }
15
+ }
16
+
17
+ public static function force_ajax() {
18
+ if ( current_action() == 'popmake_popup_before_inner' ) {
19
+ add_filter( 'shortcode_atts_gravityforms', array( __CLASS__, 'gfrorms_shortcode_atts' ) );
20
+ }
21
+ if ( current_action() == 'popmake_popup_after_inner' ) {
22
+ remove_filter( 'shortcode_atts_gravityforms', array( __CLASS__, 'gfrorms_shortcode_atts' ) );
23
+ }
24
+ }
25
+
26
+ public static function gfrorms_shortcode_atts( $out ) {
27
+ $out['ajax'] = 'true';
28
+
29
+ return $out;
30
+ }
31
+
32
+
33
+ public static function preload( $popup_id ) {
34
+ if ( function_exists( 'gravity_form_enqueue_scripts' ) ) {
35
+ $popup = pum_popup( $popup_id );
36
+
37
+ if ( has_shortcode( $popup->post_content, 'gravityform' ) ) {
38
+ $regex = "/\[gravityform.*id=[\'\"]?([0-9]*)[\'\"]?.*/";
39
+ $popup = get_post( $popup_id );
40
+ preg_match_all( $regex, $popup->post_content, $matches );
41
+ foreach ( $matches[1] as $form_id ) {
42
+ add_filter( "gform_confirmation_anchor_{$form_id}", create_function( "", "return false;" ) );
43
+ gravity_form_enqueue_scripts( $form_id, true );
44
+ }
45
+ }
46
+ }
47
+ }
48
+
49
+
50
+ public static function settings_menu( $setting_tabs ) {
51
+ $setting_tabs['40'] = array(
52
+ 'name' => 'popup-maker',
53
+ 'label' => __( 'Popup Maker', 'popup-maker' ),
54
+ );
55
+
56
+ return $setting_tabs;
57
+ }
58
+
59
+
60
+ public static function get_form( $form_string, $form ) {
61
+ $settings = wp_json_encode( self::form_options( $form['id'] ) );
62
+ $field = "<meta name='gforms-pum' content='$settings' />";
63
+ $form_string = preg_replace( '/(<form.*>)/', "$1 \r\n " . $field, $form_string );
64
+
65
+ return $form_string;
66
+ }
67
+
68
+ /**
69
+ * Get default values.
70
+ *
71
+ * @return array
72
+ */
73
+ public static function defaults() {
74
+ return array(
75
+ 'closepopup' => false,
76
+ 'closedelay' => 0,
77
+ 'openpopup' => false,
78
+ 'openpopup_id' => 0,
79
+ );
80
+ }
81
+
82
+ /**
83
+ * Get a specific forms options.
84
+ *
85
+ * @param $id
86
+ *
87
+ * @return array
88
+ */
89
+ public static function form_options( $id ) {
90
+ $settings = get_option( 'gforms_pum_' . $id, self::defaults() );
91
+
92
+ return wp_parse_args( $settings, self::defaults() );
93
+ }
94
+
95
+ /**
96
+ * Registers new cookie events.
97
+ *
98
+ * @param array $cookies
99
+ *
100
+ * @return array
101
+ */
102
+ public static function register_cookies( $cookies = array() ) {
103
+ $cookies['gforms_form_success'] = array(
104
+ 'labels' => array(
105
+ 'name' => __( 'Gravity Form Success', 'popup-maker' ),
106
+ ),
107
+ 'fields' => pum_get_cookie_fields(),
108
+ );
109
+
110
+ return $cookies;
111
+ }
112
+
113
+
114
+ public static function render_settings_page() {
115
+ $form_id = rgget( 'id' );
116
+
117
+ self::save();
118
+
119
+ $settings = self::form_options( $form_id );
120
+
121
+ GFFormSettings::page_header( __( 'Popup Settings', 'popup-maker' ) );
122
+
123
+ ?>
124
+
125
+ <div id="popup_settings-editor">
126
+
127
+ <form id="popup_settings_edit_form" method="post">
128
+
129
+ <table class="form-table gforms_form_settings">
130
+ <tr>
131
+ <th scope="row">
132
+ <label for="gforms-pum-openpopup"><?php _e( 'Open Popup', 'popup-maker' ); ?></label>
133
+ </th>
134
+ <td>
135
+ <input type="checkbox" id="gforms-pum-openpopup" name="gforms-pum[openpopup]" value="true" <?php checked( $settings['openpopup'], true ); ?> />
136
+ </td>
137
+ </tr>
138
+ <tr id="gforms-pum-openpopup_id-wrapper">
139
+ <th scope="row">
140
+ <label for="gforms-pum-openpopup_id"><?php _e( 'Popup', 'popup-maker' ); ?></label>
141
+ </th>
142
+ <td>
143
+ <select id="gforms-pum-openpopup_id" name="gforms-pum[openpopup_id]">
144
+ <?php foreach ( self::get_popup_list() as $option ) { ?>
145
+ <option value="<?php esc_attr_e( $option['value'] ); ?>" <?php selected( $settings['openpopup_id'], $option['value'] ); ?>><?php echo $option['label']; ?></option>
146
+ <?php } ?>
147
+ </select>
148
+ </td>
149
+ </tr>
150
+ <tr>
151
+ <th scope="row">
152
+ <label for="gforms-pum-closepopup"><?php _e( 'Close Popup', 'popup-maker' ); ?></label>
153
+ </th>
154
+ <td>
155
+ <input type="checkbox" id="gforms-pum-closepopup" name="gforms-pum[closepopup]" value="true" <?php checked( $settings['closepopup'], true ); ?> />
156
+ </td>
157
+ </tr>
158
+ <tr id="gforms-pum-closedelay-wrapper">
159
+ <th scope="row">
160
+ <label for="gforms-pum-closedelay"><?php _e( 'Delay', 'popup-maker' ); ?></label>
161
+ </th>
162
+ <td>
163
+ <input type="number" id="gforms-pum-closedelay" min="0" step="500" name="gforms-pum[closedelay]" style="width: 100px;" value="<?php esc_attr_e( $settings['closedelay'] ); ?>" /><?php _e( 'ms', 'popup-maker' ); ?>
164
+ </td>
165
+ </tr>
166
+ </table>
167
+
168
+ <input type="hidden" id="form_id" name="form_id" value="<?php echo esc_attr( $form_id ); ?>" />
169
+
170
+ <p class="submit">
171
+ <input type="submit" name="save" value="<?php _e( 'Save', 'popup-maker' ); ?>" class="button-primary">
172
+ </p>
173
+
174
+ <?php wp_nonce_field( 'gform_popup_settings_edit', 'gform_popup_settings_edit' ); ?>
175
+
176
+ </form>
177
+ <script type="text/javascript">
178
+ (function ($) {
179
+ var $open = $('#gforms-pum-openpopup'),
180
+ $close = $('#gforms-pum-closepopup'),
181
+ $popup_id_wrapper = $('#gforms-pum-openpopup_id-wrapper'),
182
+ $delay_wrapper = $('#gforms-pum-closedelay-wrapper');
183
+
184
+ function check_open() {
185
+ if ($open.is(':checked')) {
186
+ $popup_id_wrapper.show();
187
+ } else {
188
+ $popup_id_wrapper.hide();
189
+ }
190
+ }
191
+
192
+ function check_close() {
193
+ if ($close.is(':checked')) {
194
+ $delay_wrapper.show();
195
+ } else {
196
+ $delay_wrapper.hide();
197
+ }
198
+ }
199
+
200
+ check_open();
201
+ check_close();
202
+
203
+ $open.on('click', check_open);
204
+ $close.on('click', check_close);
205
+ }(jQuery));
206
+ </script>
207
+
208
+ </div> <!-- / popup-editor -->
209
+
210
+ <?php
211
+
212
+ GFFormSettings::page_footer();
213
+
214
+ }
215
+
216
+
217
+ /**
218
+ * Get a list of popups for a select box.
219
+ *
220
+ * @return array
221
+ */
222
+ public static function get_popup_list() {
223
+ $popup_list = array(
224
+ array(
225
+ 'value' => '',
226
+ 'label' => __( 'Select a popup', 'popup-maker' ),
227
+ ),
228
+ );
229
+
230
+ $popups = get_posts( array(
231
+ 'post_type' => 'popup',
232
+ 'post_status' => array( 'publish' ),
233
+ 'posts_per_page' => - 1,
234
+ ) );
235
+
236
+ foreach ( $popups as $popup ) {
237
+ $popup_list[] = array(
238
+ 'value' => $popup->ID,
239
+ 'label' => $popup->post_title,
240
+ );
241
+
242
+ }
243
+
244
+ return $popup_list;
245
+ }
246
+
247
+ /**
248
+ * Save form popup options.
249
+ */
250
+ public static function save() {
251
+
252
+ if ( empty( $_POST ) || ! check_admin_referer( 'gform_popup_settings_edit', 'gform_popup_settings_edit' ) ) {
253
+ return;
254
+ }
255
+
256
+ $form_id = rgget( 'id' );
257
+
258
+ if ( ! empty( $_POST['gforms-pum'] ) ) {
259
+ $settings = $_POST['gforms-pum'];
260
+
261
+ // Sanitize values.
262
+ $settings['openpopup'] = ! empty( $settings['openpopup'] );
263
+ $settings['openpopup_id'] = ! empty( $settings['openpopup_id'] ) ? absint( $settings['openpopup_id'] ) : 0;
264
+ $settings['closepopup'] = ! empty( $settings['closepopup'] );
265
+ $settings['closedelay'] = ! empty( $settings['closedelay'] ) ? absint( $settings['closedelay'] ) : 0;
266
+
267
+ update_option( 'gforms_pum_' . $form_id, $settings );
268
+ } else {
269
+ delete_option( 'gforms_pum_' . $form_id );
270
+ }
271
+ }
272
+
273
+ }
274
+
275
+ add_action( 'init', 'PUM_Gravity_Forms_Integation::init' );
276
+
277
+ /**
278
+ *
279
+ * add_action( 'gform_loaded', array( 'PUM_Gravity_Forms_Integration', 'load' ), 5 );
280
+ *
281
+ * class PUM_Gravity_Forms_Integration {
282
+ *
283
+ * public static function load() {
284
+ * if ( ! method_exists( 'GFForms', 'include_feed_addon_framework' ) ) {
285
+ * return;
286
+ * }
287
+ * require_once 'gravity-forms/class-pum-gf-popup-addon.php';
288
+ * GFAddOn::register( 'PUM_GF_Popup_Addon' );
289
+ * }
290
+ * }
291
+ *
292
+ * function pum_gf_addon() {
293
+ * return PUM_GF_Popup_Addon::get_instance();
294
+ * }
295
+ *
296
+ */
includes/integrations/gravityforms.php DELETED
@@ -1,38 +0,0 @@
1
- <?php
2
-
3
- // Exit if accessed directly
4
- if ( ! defined( 'ABSPATH' ) ) {
5
- exit;
6
- }
7
-
8
- function popmake_enqueue_gravityforms_during_preload( $popup_id ) {
9
- if ( function_exists( 'gravity_form_enqueue_scripts' ) ) {
10
- $regex = "/\[gravityform.*id=[\'\"]?([0-9]*)[\'\"]?.*/";
11
- $popup = get_post( $popup_id );
12
- preg_match_all( $regex, $popup->post_content, $matches );
13
- foreach ( $matches[1] as $form_id ) {
14
- add_filter( "gform_confirmation_anchor_{$form_id}", create_function( "", "return false;" ) );
15
- gravity_form_enqueue_scripts( $form_id, true );
16
- }
17
- }
18
- }
19
-
20
- add_action( 'popmake_preload_popup', 'popmake_enqueue_gravityforms_during_preload' );
21
-
22
- function popmake_force_gforms_ajax( $out ) {
23
- $out['ajax'] = 'true';
24
-
25
- return $out;
26
- }
27
-
28
- function popmake_gforms_force_ajax() {
29
- if ( current_action() == 'popmake_popup_before_inner' ) {
30
- add_filter( 'shortcode_atts_gravityforms', 'popmake_force_gforms_ajax' );
31
- }
32
- if ( current_action() == 'popmake_popup_after_inner' ) {
33
- remove_filter( 'shortcode_atts_gravityforms', 'popmake_force_gforms_ajax' );
34
- }
35
- }
36
-
37
- add_action( 'popmake_popup_before_inner', 'popmake_gforms_force_ajax' );
38
- add_action( 'popmake_popup_after_inner', 'popmake_gforms_force_ajax' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/integrations/ninja-forms/Actions/ClosePopup.php CHANGED
@@ -40,10 +40,10 @@ final class NF_PUM_Actions_ClosePopup extends NF_Abstracts_Action {
40
  'name' => 'close_delay',
41
  'type' => 'number',
42
  'group' => 'primary',
43
- 'label' => __( 'Delay', 'ninja-forms' ),
44
  'placeholder' => '',
45
  'width' => 'full',
46
- 'value' => __( '0', 'ninja-forms' ),
47
  ),
48
  );
49
 
40
  'name' => 'close_delay',
41
  'type' => 'number',
42
  'group' => 'primary',
43
+ 'label' => __( 'Delay', 'popup-maker' ),
44
  'placeholder' => '',
45
  'width' => 'full',
46
+ 'value' => __( '0', 'popup-maker' ),
47
  ),
48
  );
49
 
includes/integrations/ninja-forms/Actions/OpenPopup.php CHANGED
@@ -39,7 +39,7 @@ final class NF_PUM_Actions_OpenPopup extends NF_Abstracts_Action
39
  'name' => 'popup',
40
  'type' => 'select',
41
  'group' => 'primary',
42
- 'label' => __( 'Popup ID', 'ninja-forms' ),
43
  'placeholder' => '',
44
  'width' => 'full',
45
  'options' => $this->get_popup_list(),
39
  'name' => 'popup',
40
  'type' => 'select',
41
  'group' => 'primary',
42
+ 'label' => __( 'Popup ID', 'popup-maker' ),
43
  'placeholder' => '',
44
  'width' => 'full',
45
  'options' => $this->get_popup_list(),
includes/modules/reviews.php CHANGED
@@ -386,7 +386,7 @@ class PUM_Modules_Reviews {
386
  .pum-notice img.logo {
387
  float: right;
388
  margin-left: 10px;
389
- width: 75px;
390
  padding: 0.25em;
391
  border: 1px solid #ccc;
392
  }
@@ -395,7 +395,7 @@ class PUM_Modules_Reviews {
395
  <div class="notice notice-success is-dismissible pum-notice">
396
 
397
  <p>
398
- <img class="logo" src="<?php echo POPMAKE_URL; ?>/includes/libs/freemius/assets/img/plugin-icon.png" />
399
  <strong>
400
  <?php echo $trigger['message']; ?>
401
  <br />
386
  .pum-notice img.logo {
387
  float: right;
388
  margin-left: 10px;
389
+ width: 128px;
390
  padding: 0.25em;
391
  border: 1px solid #ccc;
392
  }
395
  <div class="notice notice-success is-dismissible pum-notice">
396
 
397
  <p>
398
+ <img class="logo" src="<?php echo POPMAKE_URL; ?>/assets/images/icon-256x256.jpg" />
399
  <strong>
400
  <?php echo $trigger['message']; ?>
401
  <br />
includes/pum-condition-functions.php CHANGED
@@ -264,4 +264,4 @@ function pum_register_conditions() {
264
  PUM_Conditions::instance()->add_conditions( $conditions );
265
  }
266
 
267
- add_action( 'init', 'pum_register_conditions', 11 );
264
  PUM_Conditions::instance()->add_conditions( $conditions );
265
  }
266
 
267
+ add_action( 'init', 'pum_register_conditions', 99999 );
includes/scripts.php CHANGED
@@ -187,8 +187,8 @@ function popmake_render_popup_theme_styles() {
187
  </style><?php
188
  }
189
 
190
- add_action( 'wp_head', 'popmake_render_popup_theme_styles' );
191
- add_action( 'admin_head', 'popmake_render_popup_theme_styles' );
192
 
193
  function pum_should_load_admin_scripts() {
194
  global $pagenow;
@@ -364,6 +364,7 @@ function popmake_enqueue_scripts( $popup_id = null ) {
364
  'popup-maker' => 'popup-maker-site',
365
  'easy-modal-importer' => 'popup-maker-easy-modal-importer-site',
366
  ), $popup_id );
 
367
  foreach ( $scripts_needed as $script ) {
368
  if ( wp_script_is( $script, 'registered' ) ) {
369
  wp_enqueue_script( $script );
@@ -372,8 +373,8 @@ function popmake_enqueue_scripts( $popup_id = null ) {
372
 
373
  $styles_needed = apply_filters( 'popmake_enqueue_styles', array(
374
  'popup-maker' => 'popup-maker-site',
375
- 'google-fonts' => 'popup-maker-google-fonts',
376
  ), $popup_id );
 
377
  foreach ( $styles_needed as $style ) {
378
  if ( wp_style_is( $style, 'registered' ) ) {
379
  wp_enqueue_style( $style );
187
  </style><?php
188
  }
189
 
190
+ add_action( 'wp_head', 'popmake_render_popup_theme_styles', 99999 );
191
+ add_action( 'admin_head', 'popmake_render_popup_theme_styles', 99999 );
192
 
193
  function pum_should_load_admin_scripts() {
194
  global $pagenow;
364
  'popup-maker' => 'popup-maker-site',
365
  'easy-modal-importer' => 'popup-maker-easy-modal-importer-site',
366
  ), $popup_id );
367
+
368
  foreach ( $scripts_needed as $script ) {
369
  if ( wp_script_is( $script, 'registered' ) ) {
370
  wp_enqueue_script( $script );
373
 
374
  $styles_needed = apply_filters( 'popmake_enqueue_styles', array(
375
  'popup-maker' => 'popup-maker-site',
 
376
  ), $popup_id );
377
+
378
  foreach ( $styles_needed as $style ) {
379
  if ( wp_style_is( $style, 'registered' ) ) {
380
  wp_enqueue_style( $style );
languages/popup-maker.pot CHANGED
@@ -76,7 +76,7 @@ msgstr ""
76
  msgid "Close"
77
  msgstr ""
78
 
79
- #: includes/admin/class-pum-admin-upgrades.php:110, includes/admin/class-pum-admin-upgrades.php:111, includes/admin/class-pum-admin-upgrades.php:256, includes/modules/admin-bar.php:413
80
  msgid "Popup Maker"
81
  msgstr ""
82
 
@@ -736,7 +736,7 @@ msgstr ""
736
  msgid "Settings updated."
737
  msgstr ""
738
 
739
- #: includes/admin/settings/register-settings.php:319, includes/class-popmake-fields.php:57, includes/class-pum-conditions.php:71, includes/class-pum-shortcode.php:144, includes/pum-condition-functions.php:33, includes/pum-trigger-functions.php:71, includes/shortcodes/class-pum-shortcode-popup.php:46
740
  msgid "General"
741
  msgstr ""
742
 
@@ -836,7 +836,7 @@ msgstr ""
836
  msgid "Popup Maker Settings"
837
  msgstr ""
838
 
839
- #: includes/admin/settings/settings-page.php:55, includes/admin/settings/settings-page.php:61, includes/admin/tools/tools-page.php:54, includes/admin/tools/tools-page.php:61, includes/admin/tools/tools-page.php:420, includes/scripts.php:248
840
  msgid "Save"
841
  msgstr ""
842
 
@@ -844,7 +844,7 @@ msgstr ""
844
  msgid "Support"
845
  msgstr ""
846
 
847
- #: includes/admin/shortcode-ui/class-pum-admin-shortcode-ui.php:226
848
  msgid "You do not have access to preview this post."
849
  msgstr ""
850
 
@@ -1088,7 +1088,7 @@ msgstr ""
1088
  msgid "Once Weekly"
1089
  msgstr ""
1090
 
1091
- #: includes/class-popmake-fields.php:175, includes/class-popmake-popup-fields.php:105, includes/class-popmake-popup-fields.php:231, includes/shortcodes/class-pum-shortcode-popup.php:205
1092
  msgid "ms"
1093
  msgstr ""
1094
 
@@ -1168,7 +1168,7 @@ msgstr ""
1168
  msgid "Can't get property %s"
1169
  msgstr ""
1170
 
1171
- #: includes/class-pum-shortcode.php:145
1172
  msgid "Options"
1173
  msgstr ""
1174
 
@@ -1216,7 +1216,7 @@ msgstr ""
1216
  msgid "Checking this will cause popup to open automatically."
1217
  msgstr ""
1218
 
1219
- #: includes/deprecated/v4.php:391, includes/pum-trigger-functions.php:102, includes/pum-trigger-functions.php:148
1220
  msgid "Delay"
1221
  msgstr ""
1222
 
@@ -1560,6 +1560,38 @@ msgstr ""
1560
  msgid "BP: Is Action Variable"
1561
  msgstr ""
1562
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1563
  #: includes/integrations/class-pum-ninja-forms.php:109
1564
  msgid "Ninja Form Success"
1565
  msgstr ""
@@ -1592,16 +1624,12 @@ msgstr ""
1592
  msgid "Selected Endpoints"
1593
  msgstr ""
1594
 
1595
- #: includes/integrations/ninja-forms/Actions/ClosePopup.php:36, includes/modules/admin-bar.php:462
1596
- msgid "Close Popup"
1597
- msgstr ""
1598
-
1599
- #: includes/integrations/ninja-forms/Actions/OpenPopup.php:35, includes/modules/admin-bar.php:452
1600
- msgid "Open Popup"
1601
  msgstr ""
1602
 
1603
- #: includes/integrations/ninja-forms/Actions/OpenPopup.php:78
1604
- msgid "Select a popup"
1605
  msgstr ""
1606
 
1607
  #: includes/modules/admin-bar.php:379
@@ -1637,10 +1665,6 @@ msgstr ""
1637
  msgid "Get Selector"
1638
  msgstr ""
1639
 
1640
- #: includes/modules/analytics.php:90
1641
- msgid "Popup ID"
1642
- msgstr ""
1643
-
1644
  #: includes/modules/menus.php:39
1645
  msgid "Disable Popups Menu Editor"
1646
  msgstr ""
@@ -1650,10 +1674,6 @@ msgctxt "%s represent opening and closing link html"
1650
  msgid "Use this if there is a conflict with your theme or another plugin in the nav menu editor. %sSee Details%s"
1651
  msgstr ""
1652
 
1653
- #: includes/modules/menus.php:52, includes/shortcodes/class-pum-shortcode-popup.php:26, includes/shortcodes/class-pum-shortcode-popup.php:324
1654
- msgid "Popup"
1655
- msgstr ""
1656
-
1657
  #: includes/modules/menus.php:155
1658
  msgid "Trigger a Popup"
1659
  msgstr ""
@@ -2173,23 +2193,23 @@ msgstr ""
2173
  msgid "Are you sure you want to reset the open count?"
2174
  msgstr ""
2175
 
2176
- #: includes/scripts.php:391
2177
  msgid "Link: Exact Match"
2178
  msgstr ""
2179
 
2180
- #: includes/scripts.php:392
2181
  msgid "Link: Containing"
2182
  msgstr ""
2183
 
2184
- #: includes/scripts.php:393
2185
  msgid "Link: Begins With"
2186
  msgstr ""
2187
 
2188
- #: includes/scripts.php:394
2189
  msgid "Link: Ends With"
2190
  msgstr ""
2191
 
2192
- #: includes/scripts.php:399
2193
  msgid "Insert Preset"
2194
  msgstr ""
2195
 
76
  msgid "Close"
77
  msgstr ""
78
 
79
+ #: includes/admin/class-pum-admin-upgrades.php:110, includes/admin/class-pum-admin-upgrades.php:111, includes/admin/class-pum-admin-upgrades.php:256, includes/integrations/class-pum-gravity-forms.php:53, includes/modules/admin-bar.php:413
80
  msgid "Popup Maker"
81
  msgstr ""
82
 
736
  msgid "Settings updated."
737
  msgstr ""
738
 
739
+ #: includes/admin/settings/register-settings.php:319, includes/class-popmake-fields.php:57, includes/class-pum-conditions.php:71, includes/class-pum-shortcode.php:146, includes/pum-condition-functions.php:33, includes/pum-trigger-functions.php:71, includes/shortcodes/class-pum-shortcode-popup.php:46
740
  msgid "General"
741
  msgstr ""
742
 
836
  msgid "Popup Maker Settings"
837
  msgstr ""
838
 
839
+ #: includes/admin/settings/settings-page.php:55, includes/admin/settings/settings-page.php:61, includes/admin/tools/tools-page.php:54, includes/admin/tools/tools-page.php:61, includes/admin/tools/tools-page.php:420, includes/integrations/class-pum-gravity-forms.php:171, includes/scripts.php:248
840
  msgid "Save"
841
  msgstr ""
842
 
844
  msgid "Support"
845
  msgstr ""
846
 
847
+ #: includes/admin/shortcode-ui/class-pum-admin-shortcode-ui.php:234
848
  msgid "You do not have access to preview this post."
849
  msgstr ""
850
 
1088
  msgid "Once Weekly"
1089
  msgstr ""
1090
 
1091
+ #: includes/class-popmake-fields.php:175, includes/class-popmake-popup-fields.php:105, includes/class-popmake-popup-fields.php:231, includes/integrations/class-pum-cf7.php:168, includes/integrations/class-pum-gravity-forms.php:163, includes/shortcodes/class-pum-shortcode-popup.php:205
1092
  msgid "ms"
1093
  msgstr ""
1094
 
1168
  msgid "Can't get property %s"
1169
  msgstr ""
1170
 
1171
+ #: includes/class-pum-shortcode.php:147
1172
  msgid "Options"
1173
  msgstr ""
1174
 
1216
  msgid "Checking this will cause popup to open automatically."
1217
  msgstr ""
1218
 
1219
+ #: includes/deprecated/v4.php:391, includes/integrations/class-pum-cf7.php:165, includes/integrations/class-pum-gravity-forms.php:160, includes/integrations/ninja-forms/Actions/ClosePopup.php:43, includes/pum-trigger-functions.php:102, includes/pum-trigger-functions.php:148
1220
  msgid "Delay"
1221
  msgstr ""
1222
 
1560
  msgid "BP: Is Action Variable"
1561
  msgstr ""
1562
 
1563
+ #: includes/integrations/class-pum-cf7.php:99
1564
+ msgid "Contact Form 7 Success"
1565
+ msgstr ""
1566
+
1567
+ #: includes/integrations/class-pum-cf7.php:117, includes/integrations/class-pum-cf7.php:131, includes/integrations/class-pum-gravity-forms.php:121
1568
+ msgid "Popup Settings"
1569
+ msgstr ""
1570
+
1571
+ #: includes/integrations/class-pum-cf7.php:132
1572
+ msgid "These settings control popups after successful form submissions."
1573
+ msgstr ""
1574
+
1575
+ #: includes/integrations/class-pum-cf7.php:137, includes/integrations/class-pum-gravity-forms.php:132, includes/integrations/ninja-forms/Actions/OpenPopup.php:35, includes/modules/admin-bar.php:452
1576
+ msgid "Open Popup"
1577
+ msgstr ""
1578
+
1579
+ #: includes/integrations/class-pum-cf7.php:145, includes/integrations/class-pum-gravity-forms.php:140, includes/modules/menus.php:52, includes/shortcodes/class-pum-shortcode-popup.php:26, includes/shortcodes/class-pum-shortcode-popup.php:324
1580
+ msgid "Popup"
1581
+ msgstr ""
1582
+
1583
+ #: includes/integrations/class-pum-cf7.php:157, includes/integrations/class-pum-gravity-forms.php:152, includes/integrations/ninja-forms/Actions/ClosePopup.php:36, includes/modules/admin-bar.php:462
1584
+ msgid "Close Popup"
1585
+ msgstr ""
1586
+
1587
+ #: includes/integrations/class-pum-cf7.php:215, includes/integrations/class-pum-gravity-forms.php:226, includes/integrations/ninja-forms/Actions/OpenPopup.php:78
1588
+ msgid "Select a popup"
1589
+ msgstr ""
1590
+
1591
+ #: includes/integrations/class-pum-gravity-forms.php:105
1592
+ msgid "Gravity Form Success"
1593
+ msgstr ""
1594
+
1595
  #: includes/integrations/class-pum-ninja-forms.php:109
1596
  msgid "Ninja Form Success"
1597
  msgstr ""
1624
  msgid "Selected Endpoints"
1625
  msgstr ""
1626
 
1627
+ #: includes/integrations/ninja-forms/Actions/ClosePopup.php:46
1628
+ msgid "0"
 
 
 
 
1629
  msgstr ""
1630
 
1631
+ #: includes/integrations/ninja-forms/Actions/OpenPopup.php:42, includes/modules/analytics.php:90
1632
+ msgid "Popup ID"
1633
  msgstr ""
1634
 
1635
  #: includes/modules/admin-bar.php:379
1665
  msgid "Get Selector"
1666
  msgstr ""
1667
 
 
 
 
 
1668
  #: includes/modules/menus.php:39
1669
  msgid "Disable Popups Menu Editor"
1670
  msgstr ""
1674
  msgid "Use this if there is a conflict with your theme or another plugin in the nav menu editor. %sSee Details%s"
1675
  msgstr ""
1676
 
 
 
 
 
1677
  #: includes/modules/menus.php:155
1678
  msgid "Trigger a Popup"
1679
  msgstr ""
2193
  msgid "Are you sure you want to reset the open count?"
2194
  msgstr ""
2195
 
2196
+ #: includes/scripts.php:392
2197
  msgid "Link: Exact Match"
2198
  msgstr ""
2199
 
2200
+ #: includes/scripts.php:393
2201
  msgid "Link: Containing"
2202
  msgstr ""
2203
 
2204
+ #: includes/scripts.php:394
2205
  msgid "Link: Begins With"
2206
  msgstr ""
2207
 
2208
+ #: includes/scripts.php:395
2209
  msgid "Link: Ends With"
2210
  msgstr ""
2211
 
2212
+ #: includes/scripts.php:400
2213
  msgid "Insert Preset"
2214
  msgstr ""
2215
 
popup-maker.php CHANGED
@@ -4,7 +4,7 @@
4
  * Plugin URI: https://wppopupmaker.com/?utm_capmaign=PluginInfo&utm_source=plugin-header&utm_medium=plugin-uri
5
  * Description: Easily create & style popups with any content. Theme editor to quickly style your popups. Add forms, social media boxes, videos & more.
6
  * Author: WP Popup Maker
7
- * Version: 1.5.8
8
  * Author URI: https://wppopupmaker.com/?utm_capmaign=PluginInfo&utm_source=plugin-header&utm_medium=author-uri
9
  * Text Domain: popup-maker
10
  *
@@ -147,7 +147,7 @@ if ( ! class_exists( 'Popup_Maker' ) ) :
147
  }
148
 
149
  if ( ! defined( 'POPMAKE_VERSION' ) ) {
150
- define( 'POPMAKE_VERSION', '1.5.8' );
151
  }
152
 
153
  if ( ! defined( 'POPMAKE_DB_VERSION' ) ) {
@@ -194,7 +194,6 @@ if ( ! class_exists( 'Popup_Maker' ) ) :
194
  require_once POPMAKE_DIR . 'includes/ajax-calls.php';
195
 
196
  require_once POPMAKE_DIR . 'includes/importer/easy-modal-v2.php';
197
- require_once POPMAKE_DIR . 'includes/integrations/gravityforms.php';
198
  require_once POPMAKE_DIR . 'includes/integrations/google-fonts.php';
199
 
200
  require_once POPMAKE_DIR . 'includes/templates.php';
@@ -336,6 +335,10 @@ if ( ! class_exists( 'Popup_Maker' ) ) :
336
 
337
  // Ninja Forms Integration
338
  require_once POPMAKE_DIR . 'includes/integrations/class-pum-ninja-forms.php';
 
 
 
 
339
  // WPML Integration
340
  require_once POPMAKE_DIR . 'includes/integrations/class-pum-wpml.php';
341
 
4
  * Plugin URI: https://wppopupmaker.com/?utm_capmaign=PluginInfo&utm_source=plugin-header&utm_medium=plugin-uri
5
  * Description: Easily create & style popups with any content. Theme editor to quickly style your popups. Add forms, social media boxes, videos & more.
6
  * Author: WP Popup Maker
7
+ * Version: 1.6.0
8
  * Author URI: https://wppopupmaker.com/?utm_capmaign=PluginInfo&utm_source=plugin-header&utm_medium=author-uri
9
  * Text Domain: popup-maker
10
  *
147
  }
148
 
149
  if ( ! defined( 'POPMAKE_VERSION' ) ) {
150
+ define( 'POPMAKE_VERSION', '1.6.0' );
151
  }
152
 
153
  if ( ! defined( 'POPMAKE_DB_VERSION' ) ) {
194
  require_once POPMAKE_DIR . 'includes/ajax-calls.php';
195
 
196
  require_once POPMAKE_DIR . 'includes/importer/easy-modal-v2.php';
 
197
  require_once POPMAKE_DIR . 'includes/integrations/google-fonts.php';
198
 
199
  require_once POPMAKE_DIR . 'includes/templates.php';
335
 
336
  // Ninja Forms Integration
337
  require_once POPMAKE_DIR . 'includes/integrations/class-pum-ninja-forms.php';
338
+ // CF7 Forms Integration
339
+ require_once POPMAKE_DIR . 'includes/integrations/class-pum-cf7.php';
340
+ // Gravity Forms Integration
341
+ require_once POPMAKE_DIR . 'includes/integrations/class-pum-gravity-forms.php';
342
  // WPML Integration
343
  require_once POPMAKE_DIR . 'includes/integrations/class-pum-wpml.php';
344
 
readme.txt CHANGED
@@ -6,7 +6,7 @@ Donate link:
6
  Tags: marketing, optin, advertising, responsive popups, promotion, popover, pop-up, pop over, lightbox, conversion, modal, popup, popups
7
  Requires at least: 3.6
8
  Tested up to: 4.7.4
9
- Stable tag: 1.5.8
10
  License: GNU Version 3 or Any Later Version
11
 
12
  Create any popup imaginable! Customize your popups from head-to-toe and give your site more utility, usability, and conversions.
@@ -91,7 +91,7 @@ There are several common causes for this which include:
91
 
92
  == Changelog ==
93
 
94
- = v1.6.0 - 04/26/2017 =
95
  * Feature: Added Gravity Forms direct integrations.
96
  * Close popup with delay when Gravity Form is submitted.
97
  * Trigger a thank you popup when Gravity Form is submitted.
6
  Tags: marketing, optin, advertising, responsive popups, promotion, popover, pop-up, pop over, lightbox, conversion, modal, popup, popups
7
  Requires at least: 3.6
8
  Tested up to: 4.7.4
9
+ Stable tag: 1.6.0
10
  License: GNU Version 3 or Any Later Version
11
 
12
  Create any popup imaginable! Customize your popups from head-to-toe and give your site more utility, usability, and conversions.
91
 
92
  == Changelog ==
93
 
94
+ = v1.6.0 - 04/28/2017 =
95
  * Feature: Added Gravity Forms direct integrations.
96
  * Close popup with delay when Gravity Form is submitted.
97
  * Trigger a thank you popup when Gravity Form is submitted.