(function(){"use strict";var __webpack_modules__={941:function(__unused_webpack___webpack_module__,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{a:function(){return SqzlPersonalization}});class SqzlPersonalization{g=null;_window=null;_document=null;_localStorage=null;_queueItems=null;_njkEnv=null;_baseUrl=null;_dynamicBaseUrl=null;_assetBaseUrl=null;_preCompiled={};_flatpickr=null;state={overlayShown:!1,overlayOpen:!1};sqzlTestMode="undefined"!=typeof sqzlUnitTest;_settings={merchantIdentifier:"",merchantId:0,urlPreviewParam:"_sqzlPreview",urlSelectorParam:"_sqzlSelector",eventSelectorParam:"_sqzlEventSelector",pathPersonalizationSettings:"/p?m=",pathPersonalization:"/personalization/",pathPreview:"/_pv/v3/",sqzlContainerId:"sqzl_container",mainCookieName:"sqzllocal",viewCountCookieName:"sqzl_vw",viewCountCookieOldName:"sqzl_variant_view_",disablePersonalizationCookieName:"sqzl_disable_personalization_",initTime:0,triggeredPersonalizations:{},viewCookieExpirationDays:365,defaultFrequencyCapDays:30,closingModalExpirationDays:7,isTravel:!1,initialized:!1,personalizationTriggerOnProductEventsFound:[],noProductFoundAfterWaiting:!1,merchantLocale:null,lastEventLanguage:null,htmlLanguage:null};_sqzlContainer=null;_loadedPersonalizationIds=[];_personalizationQueuedForEvents=[];_handledPixelEvents=[];_personalizationQueuedIfNoProductFound=[];_personalizationQueuedIfNoProductFoundTimer=null;_personalizationSettingCloseModalExpirationDays={};_lastProductEventLanguage=null;_translationTimeUnits=null;_isPushNotificationSupportedBrowser=!1;_notificationPermission="default";_triggerEvents={};_documentListenersDone=!1;constructor(){sqzlCommon.g.sqzlPersonalization=this,this.g=sqzlCommon.g,this.g._sqzl=this.g._sqzl||[],this.g.sqzl=this.g.sqzl||[],this.g.sqzl.p=this.g.sqzl.p||[],this.g.dataLayer=this.g.dataLayer||[]}init(){if(!0===this._settings.initialized)return!1;this._localStorage="undefined"!=typeof Storage?this.g.localStorage:null,this._window=this.g,this._document=this.g.document;var e=sqzlCommon.getConfigItem("personalizationSettings",{});e.hasOwnProperty("translationTimeUnits")&&(this._translationTimeUnits=e.translationTimeUnits,delete e.translationTimeUnits),this._settings.initTime=Math.floor(new Date/1e3),this._preCompiled=this._window.nunjucksPrecompiled||{},this._baseUrl=e.baseUrl,this._dynamicBaseUrl=e.dynamicBaseUrl,this._assetBaseUrl=e.assetBaseUrl,this._queueItems=this.g.sqzl.p,this._settings=Object.assign({},this._settings,e),this._settings.hasOwnProperty("merchantLocale")&&null!==this._settings.merchantLocale||(this._settings.merchantLocale=sqzlCommon.getConfigItem("merchantLocale")),this._settings.pathPersonalizationSettings+=this._settings.merchantIdentifier;var t=this._settings.merchantIdentifier.match(/SQ-2565([0-9]+)/);t&&(this._settings.merchantId=t[1]),this._settings.pathPreview+=this._settings.merchantId+"/",this._window.nunjucksPrecompiled=this._window.nunjucksPrecompiled||{},this._isPushNotificationSupportedBrowser=sqzlCommon.isPushNotificationSupportedBrowser(),this.sqzlTestMode||this.setNunjucksEnvironment(this.getNunjucksEnvironment()),this._settings.isTravel=e.isTravel,this._sqzlContainer=this._document.createElement("div"),this._sqzlContainer.id=this._settings.sqzlContainerId,this._sqzlContainer.className="sqzly-personalization",this._document.body.appendChild(this._sqzlContainer),this.shouldShowCookie()&&(this.initializeCookieModal(),this.showCookieModal()),void 0!==this._document.documentElement.lang&&(this._settings.htmlLanguage=this._document.documentElement.lang.toLowerCase()),this.dataLayerWatcher.init();var n="initial",i=sqzlCommon.getURLParameter(this._settings.urlPreviewParam);i?(i.match(/^[0-9A-F]{8}-[0-9A-F]{4}-[4][0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i)&&(n=i),this.fetchPreview(n)):sqzlCommon.getURLParameter(this._settings.urlSelectorParam)||"sqzly-selector-window"===this._window.name?this.enableSelector(n):(this._isPushNotificationSupportedBrowser&&(this._notificationPermission=Notification.permission),this._queueItems.push({event:"InitPersonalization"})),this._settings.initialized=!0,!0===sqzlCommon.getConfigItem("instantPushRequest")&&sqzlCommon.requestPushNotification()}setNunjucksEnvironment(e){this._njkEnv=e}handleDataLayerItem(e){if(void 0!==e.event)switch(e.event){case"QuickPreview":this.enablePreviewCode((function(){this._window.sqzlPersonalizationPreview.init(this._window,this._document);var t=this._window.sqzlPersonalizationPreview.renderPreviewFromCache(e.event,{html:e.data.html,modalSettings:e.data.modalSettings,personalizationSettings:e.data.personalizationSettings,notificationMessages:e.notificationMessages});null!==t&&(this.insertOrReplaceContainerContent(t.sqzlPersonalization,t.modalSettings),this.addDocumentListeners.call(this),sqzlCommon.initSlider(e.data.modalSettings))}));break;case"InitPersonalization":case"ReloadPersonalization":case"PageReload":"ReloadPersonalization"!==e.event&&"PageReload"!==e.event||this.removePreviousPersonalizations(e),this.handleInitPersonalization(e.event,e.data);break;case"SetPersonalizations":this.handleSetPersonalizations(e.event,e.data);break;case"PixelEvent":if("ReloadPersonalization"===e.eventData.event||"PageReload"===e.eventData.event){this.g.sqzl.p.push(e.eventData);break}this.handlePixelEvent(e.event,e.eventData)}}dataLayerWatcher=function(e){let t=!1,n=function(t){return e.handleDataLayerItem(t),e._queueItems.length};return{init:function(){this.overwritePush.call(this)},overwritePush:function(){if(!1===t&&void 0!==e._queueItems){if(e._queueItems.length>0)for(let t=0;t0){for(var i=0;i-1&&(void 0===e.settings.trigger_delay||void 0!==e.settings.trigger_delay&&0===e.settings.trigger_delay.length)&&this.insertOrReplaceContainerContent(i,n,e,t),void 0!==e.settings.trigger_delay&&e.settings.trigger_delay.length>0&&!this.isMultiTriggerPersonalization(e)?this.handleDelayTriggers(e,i,n,t):["event","product"].indexOf(e.settings.trigger_type)>-1&&this.insertOrReplaceContainerContentByEvent(i,n,e,t))}handleDelayTriggers(e,t,n,i,r){if(0===e.settings.trigger_delay.length)return!1;if(e.settings.trigger_delay.indexOf("seconds")>-1&&e.settings.trigger_seconds>0){var o=Math.floor(new Date/1e3);void 0===r&&(r=this._settings.initTime);var s=r+e.settings.trigger_seconds;if(s-1&&e.settings.trigger_scroll>0){var l=this.getBodyHeight()*(e.settings.trigger_scroll/100);this.getScroll().windowBottom>=l?this.insertOrReplaceContainerContent(t,n,e,i):this._window.addEventListener("scroll",function(){var r=this.getBodyHeight()*(e.settings.trigger_scroll/100);this.getScroll().windowBottom>=r&&!this._settings.triggeredPersonalizations.hasOwnProperty(e.id)&&this.insertOrReplaceContainerContent(t,n,e,i)}.bind(this))}e.settings.hasOwnProperty("trigger_delay")&&e.settings.trigger_delay.indexOf("exit")>-1&&this._document.body.addEventListener("mouseleave",function(r){r.clientY<=2&&this.insertOrReplaceContainerContent(t,n,e,i)}.bind(this),!1)}getVariantElementId(e,t,n,i){return i=i||"",!t||!n&&0!==n?e:"sqzl_div-"+t+"-"+n+i}requireScript(e,t,n,i){if(void 0===i||!this._window.hasOwnProperty(i)){var r=e.createElement("script");return r.type="text/javascript",r.src=t,r.async=1,void 0!==n&&(r.readyState?r.onreadystatechange=function(){"loaded"!==r.readyState&&"complete"!==r.readyState||(r.onreadystatechange=null,n.bind(this)())}.bind(this):r.onload=function(){n.bind(this)()}.bind(this)),e.head.appendChild(r),r}n.bind(this)()}replaceInViewProduct(e){return e.items.length>0&&void 0!==e.extra_product&&e.extra_product&&this._handledPixelEvents.forEach((function(t){if(void 0!==t.event&&"ViewContent"===t.event&&void 0!==t.products)for(var n=0;n0?e=this._settings.lastEventLanguage:this._lastProductEventLanguage&&this._lastProductEventLanguage.length>0?e=this._lastProductEventLanguage:!0===this._settings?.useHtmlLanguage?null!==this._settings?.htmlLanguage&&this._settings?.htmlLanguage.length>0&&(e=this._settings.htmlLanguage):this._settings.hasOwnProperty("merchantLocale")&&null!==this._settings.merchantLocale&&this._settings.merchantLocale.length>0&&(e=this._settings.merchantLocale),e}prepareCustomFilters(e,t,n,i){!i||this._lastProductEventLanguage&&0!==this._lastProductEventLanguage.length||(this._lastProductEventLanguage=i),!n||this._translationTimeUnits&&0!==this._translationTimeUnits.length||(this._translationTimeUnits=n),e.addFilter("image_resize",(function(e,t){var n=t.split("x"),i=600,r=600,o=1;switch(void 0!==n[0]&&(i=n[0]),void 0!==n[1]&&(r=n[1]),void 0!==n[2]&&(o=n[2]),o){default:case"1":o="pad";break;case"2":o="cover";break;case"3":o="contain";break;case"4":o="scale-down"}return e=e.replace(/fit=[^,]+,width=[0-9]+,height=[0-9]+/,"fit="+o+",width="+parseInt(i)+",height="+parseInt(r))})),e.addFilter("base64",(function(e){return btoa(e)})),e.addGlobal("exposedCollections",(function(){return""})),e.addFilter("escapejs",(function(e){if("string"==typeof e){var t={"\\":"\\u005C","'":"\\u0027",'"':"\\u0022",">":"\\u003E","<":"\\u003C","&":"\\u0026","=":"\\u003D","-":"\\u002D",";":"\\u003B"};return e.replace(/["'><&=\-;\\]/g,(function(e){return t[e]}))}return e})),e.addFilter("countdown",function(e,n){if(!1===t.hasOwnProperty("_sqzlyCountDownTimer")&&(t._sqzlyCountDownTimer=[]),n=n||"",e.match(/today|tomorrow|upcoming/)){var i=new Date;if(e.match(/upcoming/)){var r=e.replace(/upcoming/,i.getFullYear()+"-"+(parseInt(i.getMonth())+1)+"-"+i.getDate());e=new Date(r).getTime()'}.bind(this));var r=e.getFilter("default"),o=function(e,t,n){return r(e,t,null===e||n)};e.addFilter("default",o),e.addFilter("d",o);return["minimum","maximum","time_window","date_format","target_url"].forEach((function(t){e.addFilter(t,(function(e){return e}))})),e}calculateCountDown(e,t,n,i,r){let o=e.getElementById(t);if(void 0===o||!o)return!1;let s=n-this.getCurrentTime(),a=Math.floor(s/864e5),l=Math.floor(s%864e5/36e5),c=Math.floor(s%36e5/6e4),u=Math.floor(s%6e4/1e3);l<10&&(l="0"+l),c<10&&(c="0"+c),u<10&&(u="0"+u);let d="",h=this.getLanguage(),p="day",f="days";return h=h.split("-")[0].toLowerCase(),d+=""+a,this._translationTimeUnits&&this._translationTimeUnits.hasOwnProperty(h)&&(this._translationTimeUnits[h].hasOwnProperty("day")&&(p=this._translationTimeUnits[h].day),this._translationTimeUnits[h].hasOwnProperty("days")&&(f=this._translationTimeUnits[h].days)),d+=1===a?' '+p+"":' '+f+"",d+=" ",d+=""+l+":",d+=""+c+":",d+=""+u+"",o.innerHTML=d,s<0&&r in e._sqzlyCountDownTimer&&(clearInterval(e._sqzlyCountDownTimer[r]),o.innerHTML=''+i+"",delete e._sqzlyCountDownTimer[r]),!0}renderAndReplaceInlineVariables(e,t){if(void 0===t)return e;let n=[],i=[],r=["body","button","header","image","image_2","image_original","image_original_2","image_square","image_square_2","image_url","image_url_2","position","price","product_id","raw_price","title","url","js"],o=e.elements||{};for(let t in e)!e.hasOwnProperty(t)||"object"==typeof e[t]&&"_variantSettings"!==t||(n[t]=e[t]);if(e.hasOwnProperty("content_type")&&"products"===e.content_type.value){for(let n=0;n0&&(r.url=this._njkEnv.renderString(r.url,c))}a[t]=this._njkEnv.renderString(i,r)}.bind(this)),i.push(a)}if(i.length>0&&(e.items=i,1===i.length&&(e=Object.assign({},e,i[0]))),e.cssPrefix="#"+e.divElementId,e.cssPrefixEnabled=!0,e.hasOwnProperty("css")&&e.css.length>0&&e.hasOwnProperty("divElementId")){var l=e.css;e.hasOwnProperty("originalCss")?l=e.originalCss:e.originalCss=e.css,e.css=this._njkEnv.renderString(l,e)}return e}addFilterToNunjucksVariables(e,t,n){if("string"!=typeof t||""===t)return e;void 0===n&&(n=!0);let i=e.match(/\{{2}(?:(?!\{{2}|\}{2})[\s\S])*\}{2}/gim);if(null!==i){let r=new RegExp("\\|\\s*"+t,"gmi");for(let o=0;o0&&this._settings.personalizationTriggerOnProductEventsFound.forEach(function(e){this._personalizationQueuedForEvents.push({settings:{trigger_event_event:e,trigger_event_fields:[]},divElement:null,productTriggeredPersonalization:!0})}.bind(this)),this._personalizationQueuedIfNoProductFoundTimer=setTimeout(function(){this._settings.noProductFoundAfterWaiting=!0,this._personalizationQueuedIfNoProductFound.forEach(function(e){var t=Object.assign({},e.settings,{noProductFoundAfterWaiting:!0});this.insertOrReplaceContainerContent(e.sqzlPersonalization,t,e.personalization)}.bind(this))}.bind(this),1500)}insertOrReplaceContainerContent(sqzlPersonalization,settings,personalization,variant){let personalizationId=void 0!==settings.personalizationId&&settings.personalizationId,variantId=void 0!==settings.variantId&&settings.variantId,variantRevision=void 0!==settings.revision&&settings.revision,originalVariant=void 0!==settings.original_variant&&settings.original_variant,previewMode=void 0!==settings.previewMode&&settings.previewMode,noProductFoundAfterWaiting=void 0!==settings.noProductFoundAfterWaiting&&settings.noProductFoundAfterWaiting,triggeredByEventCheck=void 0!==settings.triggeredByEventCheck&&settings.triggeredByEventCheck;if(personalizationId&&this._settings.triggeredPersonalizations.hasOwnProperty(personalizationId))return!1;if(this._loadedPersonalizationIds.indexOf(personalizationId)<0&&!previewMode)return!1;if(variantId){var styleHideElement=this._document.getElementById("_sqzlHE_"+variantId);styleHideElement&&styleHideElement.parentNode.removeChild(styleHideElement)}var elementFound=!1;if("overlay"===settings.display_type&&"product"===settings.trigger_type&&this._settings.noProductFoundAfterWaiting&&this._personalizationQueuedIfNoProductFound.length>0)return!1;if("overlay"===settings.display_type){if(this._sqzlContainer.appendChild(sqzlPersonalization),this._settings.personalizationTriggerOnProductEventsFound.length>0&&!noProductFoundAfterWaiting&&!triggeredByEventCheck&&"pageload"!==settings.trigger_type)return this.queuePersonalizationIfNoProductFound(sqzlPersonalization,personalizationId,settings,personalization),"product"===settings.trigger_type&&this.triggerPersonalizationsOnPixelEvents(),!1;this.enableStyles(this._sqzlContainer),sqzlPersonalization.style.display="block",personalizationId&&(this._settings.triggeredPersonalizations[personalizationId]=!0)}else if("notification"===settings.display_type)this._sqzlContainer.appendChild(sqzlPersonalization),this.enableStyles(this._sqzlContainer),sqzlPersonalization.style.display="block",personalizationId&&(this._settings.triggeredPersonalizations[personalizationId]=!0);else{var querySelector=settings.query_selector||settings.xpath,elementFoundCheckRequired=!1;if(originalVariant&&sqzlCommon.isDefined(settings,"query_selectors")&&settings.query_selectors.length>0&&(elementFound=this._document.querySelectorAll(settings.query_selectors.join(",")).length>0,elementFoundCheckRequired=!0),querySelector&&querySelector.length>0)if(elementFoundCheckRequired=!0,querySelector.match(/>img/)&&"replace_content"===settings.insert_location&&(settings.insert_location="replace"),variant&&variant.hasOwnProperty("multiProducts")&&!0===variant.multiProducts&&variant.items.length>0){var productListerPageProductElementFound=!1;variant.items.forEach(function(e){var t='[data-product-sku="'+e.product_id+'"] '+querySelector+', [data-product-id="'+e.product_id+'"] '+querySelector,n=null;this._document.querySelectorAll(t).length>0&&(productListerPageProductElementFound=!0,n=this.renderAndInjectElement(personalization,settings,variant,[e],e.product_id),(elementFound=this.searchQuerySelectorAndReplaceElements(n,t,settings,originalVariant,personalizationId,variantId,variantRevision)||!1)&&this._document.querySelectorAll('[data-product-sku="'+e.product_id+'"], [data-product-id="'+e.product_id+'"]').forEach(function(e){this.bindElements(e,personalizationId,variantId,variantRevision,void 0!==settings.elements.button.new_window&&settings.elements.button.new_window,settings)}.bind(this)))}.bind(this)),!1!==productListerPageProductElementFound||sqzlCommon.isDefined(settings,"content_type.value")&&"triggered_products"===settings.content_type.value||(elementFound=this.searchQuerySelectorAndReplaceElements(sqzlPersonalization,querySelector,settings,originalVariant,personalizationId,variantId,variantRevision)||elementFound)}else elementFound=this.searchQuerySelectorAndReplaceElements(sqzlPersonalization,querySelector,settings,originalVariant,personalizationId,variantId,variantRevision)||elementFound;if(!elementFound&&elementFoundCheckRequired)return this._settings.personalizationTriggerOnProductEventsFound.length>0&&!noProductFoundAfterWaiting&&!triggeredByEventCheck?(this.setTimerQueuedPersonalization(),this.triggerPersonalizationsOnPixelEvents()):this._personalizationQueuedForEvents.length>0&&triggeredByEventCheck&&this.triggerPersonalizationsOnPixelEvents(),!1}originalVariant||(settings.hasOwnProperty("closing_modal")&&settings.closing_modal.hasOwnProperty("value")&&(this._personalizationSettingCloseModalExpirationDays[personalizationId]=settings.closing_modal.value),this.bindElements(sqzlPersonalization,personalizationId,variantId,variantRevision,!!sqzlCommon.isDefined(settings,"elements.button.new_window")&&settings.elements.button.new_window,settings)),variantId&&this.increaseViewCounter(variantId,settings,personalization),this._settings.personalizationTriggerOnProductEventsFound.length>0&&!noProductFoundAfterWaiting&&!triggeredByEventCheck&&(this.setTimerQueuedPersonalization(),this.triggerPersonalizationsOnPixelEvents());var additionalViewEventData={control_variant:originalVariant,products:[]};if(noProductFoundAfterWaiting||variant&&variant.hasOwnProperty("items")&&variant.items.length>0&&variant.items.forEach((function(e){var t=e.product_id;void 0!==t&&""!==(t=t.replace(/\{\{\s*product_id\s*\}\}/,""))&&additionalViewEventData.products.push({id:e.product_id||0,title:e.title||"",price:e.raw_price||0,position:e.position||0})})),this.fireViewEvent(personalizationId,variantId,additionalViewEventData),originalVariant&&(this._settings.triggeredPersonalizations[personalizationId]=!0),this.state.overlayOpen=!0,"overlay"===settings.display_type&&(this.state.overlayShown=!0),!settings.update&&settings.js){try{eval(settings.js)}catch(e){console.error(`Spotler Activate: error in JS code (personalizationId: ${personalizationId}, variantId: ${variantId}): ${e}`)}elementFound||this.bindAllClickElements(this._document,personalizationId,variantId,variantRevision)}settings.lazy_load_images&&sqzlCommon.imgObserver.observe()}insertOrReplaceContainerContentByEvent(e,t,n,i){["event","product"].indexOf(t.trigger_type)>-1&&t.hasOwnProperty("trigger_event_fields")&&(this._personalizationQueuedForEvents.push({divElement:e,settings:t,personalization:n}),this.triggerPersonalizationsOnPixelEvents())}bindElements(e,t,n,i,r,o){if(r=void 0!==r&&r,o=o||{},Array.prototype.forEach.call(e.querySelectorAll("a"),(function(e){e.classList.add("sqzl-click"),e.setAttribute("data-sqzl-personalization-id",t),e.setAttribute("data-sqzl-variant-id",n),e.setAttribute("data-sqzl-variant-revision",i),e.hasAttribute("data-sqzl-new-window")||e.setAttribute("data-sqzl-new-window",r||void 0!==e.target&&"_blank"===e.target)})),o.fields){var s={altInput:!0,altFormat:"j F, Y"};Array.prototype.forEach.call(this._document.querySelectorAll(".flatpickr-calendar"),(function(e){e.remove()}));for(let e=0;e",noCalendar:!1,now:new Date,onChange:[],onClose:[],onDayCreate:[],onDestroy:[],onKeyDown:[],onMonthChange:[],onOpen:[],onParseConfig:[],onReady:[],onValueUpdate:[],onYearChange:[],onPreCalendarPosition:[],plugins:[],position:"auto",positionElement:void 0,prevArrow:"",shorthandCurrentMonth:!1,showMonths:1,static:!1,time_24hr:!1,weekNumbers:!1,wrap:!1},i={weekdays:{shorthand:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],longhand:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},months:{shorthand:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],longhand:["January","February","March","April","May","June","July","August","September","October","November","December"]},daysInMonth:[31,28,31,30,31,30,31,31,30,31,30,31],firstDayOfWeek:0,ordinal:function(e){var t=e%100;if(t>3&&t<21)return"th";switch(t%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}},rangeSeparator:" to ",weekAbbreviation:"Wk",scrollTitle:"Scroll to increment",toggleTitle:"Click to toggle",amPM:["AM","PM"],yearAriaLabel:"Year"},r=function(e){return("0"+e).slice(-2)},o=function(e){return!0===e?1:0};function s(e,t,n){var i;return void 0===n&&(n=!1),function(){var r=this,o=arguments;null!==i&&clearTimeout(i),i=window.setTimeout((function(){i=null,n||e.apply(r,o)}),t),n&&!i&&e.apply(r,o)}}var a=function(e){return e instanceof Array?e:[e]};function l(e,t,n){if(!0===n)return e.classList.add(t);e.classList.remove(t)}function c(e,t,n){var i=window.document.createElement(e);return t=t||"",n=n||"",i.className=t,void 0!==n&&(i.textContent=n),i}function u(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function d(e,t){var n=c("div","numInputWrapper"),i=c("input","numInput "+e),r=c("span","arrowUp"),o=c("span","arrowDown");if(i.type="text",i.pattern="\\d*",void 0!==t)for(var s in t)i.setAttribute(s,t[s]);return n.appendChild(i),n.appendChild(r),n.appendChild(o),n}var h=function(){},p=function(e,t,n){return n.months[t?"shorthand":"longhand"][e]},f={D:h,F:function(e,t,n){e.setMonth(n.months.longhand.indexOf(t))},G:function(e,t){e.setHours(parseFloat(t))},H:function(e,t){e.setHours(parseFloat(t))},J:function(e,t){e.setDate(parseFloat(t))},K:function(e,t,n){e.setHours(e.getHours()%12+12*o(new RegExp(n.amPM[1],"i").test(t)))},M:function(e,t,n){e.setMonth(n.months.shorthand.indexOf(t))},S:function(e,t){e.setSeconds(parseFloat(t))},U:function(e,t){return new Date(1e3*parseFloat(t))},W:function(e,t){var n=parseInt(t);return new Date(e.getFullYear(),0,2+7*(n-1),0,0,0,0)},Y:function(e,t){e.setFullYear(parseFloat(t))},Z:function(e,t){return new Date(t)},d:function(e,t){e.setDate(parseFloat(t))},h:function(e,t){e.setHours(parseFloat(t))},i:function(e,t){e.setMinutes(parseFloat(t))},j:function(e,t){e.setDate(parseFloat(t))},l:h,m:function(e,t){e.setMonth(parseFloat(t)-1)},n:function(e,t){e.setMonth(parseFloat(t)-1)},s:function(e,t){e.setSeconds(parseFloat(t))},u:function(e,t){return new Date(parseFloat(t))},w:h,y:function(e,t){e.setFullYear(2e3+parseFloat(t))}},g={D:"(\\w+)",F:"(\\w+)",G:"(\\d\\d|\\d)",H:"(\\d\\d|\\d)",J:"(\\d\\d|\\d)\\w+",K:"",M:"(\\w+)",S:"(\\d\\d|\\d)",U:"(.+)",W:"(\\d\\d|\\d)",Y:"(\\d{4})",Z:"(.+)",d:"(\\d\\d|\\d)",h:"(\\d\\d|\\d)",i:"(\\d\\d|\\d)",j:"(\\d\\d|\\d)",l:"(\\w+)",m:"(\\d\\d|\\d)",n:"(\\d\\d|\\d)",s:"(\\d\\d|\\d)",u:"(.+)",w:"(\\d\\d|\\d)",y:"(\\d{2})"},m={Z:function(e){return e.toISOString()},D:function(e,t,n){return t.weekdays.shorthand[m.w(e,t,n)]},F:function(e,t,n){return p(m.n(e,t,n)-1,!1,t)},G:function(e,t,n){return r(m.h(e,t,n))},H:function(e){return r(e.getHours())},J:function(e,t){return void 0!==t.ordinal?e.getDate()+t.ordinal(e.getDate()):e.getDate()},K:function(e,t){return t.amPM[o(e.getHours()>11)]},M:function(e,t){return p(e.getMonth(),!0,t)},S:function(e){return r(e.getSeconds())},U:function(e){return e.getTime()/1e3},W:function(e,t,n){return n.getWeek(e)},Y:function(e){return e.getFullYear()},d:function(e){return r(e.getDate())},h:function(e){return e.getHours()%12?e.getHours()%12:12},i:function(e){return r(e.getMinutes())},j:function(e){return e.getDate()},l:function(e,t){return t.weekdays.longhand[e.getDay()]},m:function(e){return r(e.getMonth()+1)},n:function(e){return e.getMonth()+1},s:function(e){return e.getSeconds()},u:function(e){return e.getTime()},w:function(e){return e.getDay()},y:function(e){return String(e.getFullYear()).substring(2)}},v=function(e){var t=e.config,r=void 0===t?n:t,o=e.l10n,s=void 0===o?i:o;return function(e,t,n){var i=n||s;return void 0!==r.formatDate?r.formatDate(e,t,i):t.split("").map((function(t,n,o){return m[t]&&"\\"!==o[n-1]?m[t](e,i,r):"\\"!==t?t:""})).join("")}},y=function(e){var t=e.config,r=void 0===t?n:t,o=e.l10n,s=void 0===o?i:o;return function(e,t,i,o){if(0===e||e){var a,l=o||s,c=e;if(e instanceof Date)a=new Date(e.getTime());else if("string"!=typeof e&&void 0!==e.toFixed)a=new Date(e);else if("string"==typeof e){var u=t||(r||n).dateFormat,d=String(e).trim();if("today"===d)a=new Date,i=!0;else if(/Z$/.test(d)||/GMT$/.test(d))a=new Date(e);else if(r&&r.parseDate)a=r.parseDate(e,u);else{a=r&&r.noCalendar?new Date((new Date).setHours(0,0,0,0)):new Date((new Date).getFullYear(),0,1,0,0,0,0);for(var h=void 0,p=[],m=0,v=0,y="";mMath.min(t,n)&&es&&(c=n===f.hourElement?c-s-o(!f.amPM):i,d&&N(void 0,1,f.hourElement)),f.amPM&&u&&(1===a?c+l===23:Math.abs(c-l)>a)&&(f.amPM.textContent=f.l10n.amPM[o(f.amPM.textContent===f.l10n.amPM[0])]),n.value=r(c)}}(e);var t=f._input.value;O(),me(),f._input.value!==t&&f._debouncedChange()}}function O(){if(void 0!==f.hourElement&&void 0!==f.minuteElement){var e,t,n=(parseInt(f.hourElement.value.slice(-2),10)||0)%24,i=(parseInt(f.minuteElement.value,10)||0)%60,r=void 0!==f.secondElement?(parseInt(f.secondElement.value,10)||0)%60:0;void 0!==f.amPM&&(e=n,t=f.amPM.textContent,n=e%12+12*o(t===f.l10n.amPM[1]));var s=void 0!==f.config.minTime||f.config.minDate&&f.minDateHasTime&&f.latestSelectedDateObj&&0===b(f.latestSelectedDateObj,f.config.minDate,!0);if(void 0!==f.config.maxTime||f.config.maxDate&&f.maxDateHasTime&&f.latestSelectedDateObj&&0===b(f.latestSelectedDateObj,f.config.maxDate,!0)){var a=void 0!==f.config.maxTime?f.config.maxTime:f.config.maxDate;(n=Math.min(n,a.getHours()))===a.getHours()&&(i=Math.min(i,a.getMinutes())),i===a.getMinutes()&&(r=Math.min(r,a.getSeconds()))}if(s){var l=void 0!==f.config.minTime?f.config.minTime:f.config.minDate;(n=Math.max(n,l.getHours()))===l.getHours()&&(i=Math.max(i,l.getMinutes())),i===l.getMinutes()&&(r=Math.max(r,l.getSeconds()))}T(n,i,r)}}function q(e){var t=e||f.latestSelectedDateObj;t&&T(t.getHours(),t.getMinutes(),t.getSeconds())}function x(){var e=f.config.defaultHour,t=f.config.defaultMinute,n=f.config.defaultSeconds;if(void 0!==f.config.minDate){var i=f.config.minDate.getHours(),r=f.config.minDate.getMinutes();(e=Math.max(e,i))===i&&(t=Math.max(r,t)),e===i&&t===r&&(n=f.config.minDate.getSeconds())}if(void 0!==f.config.maxDate){var o=f.config.maxDate.getHours(),s=f.config.maxDate.getMinutes();(e=Math.min(e,o))===o&&(t=Math.min(s,t)),e===o&&t===s&&(n=f.config.maxDate.getSeconds())}T(e,t,n)}function T(e,t,n){void 0!==f.latestSelectedDateObj&&f.latestSelectedDateObj.setHours(e%24,t,n||0,0),f.hourElement&&f.minuteElement&&!f.isMobile&&(f.hourElement.value=r(f.config.time_24hr?e:(12+e)%12+12*o(e%12==0)),f.minuteElement.value=r(t),void 0!==f.amPM&&(f.amPM.textContent=f.l10n.amPM[o(e>=12)]),void 0!==f.secondElement&&(f.secondElement.value=r(n)))}function P(e){var t=parseInt(e.target.value)+(e.delta||0);(t/1e3>1||"Enter"===e.key&&!/[^\d]/.test(t.toString()))&&J(t)}function S(e,t,n,i){return t instanceof Array?t.forEach((function(t){return S(e,t,n,i)})):e instanceof Array?e.forEach((function(e){return S(e,t,n,i)})):(e.addEventListener(t,n,i),void f._handlers.push({element:e,event:t,handler:n,options:i}))}function A(e){return function(t){1===t.which&&e(t)}}function D(){de("onChange")}function L(e){var t=void 0!==e?f.parseDate(e):f.latestSelectedDateObj||(f.config.minDate&&f.config.minDate>f.now?f.config.minDate:f.config.maxDate&&f.config.maxDate=0&&b(e,f.selectedDates[1])<=0}(t)&&!pe(t)&&o.classList.add("inRange"),f.weekNumbers&&1===f.config.showMonths&&"prevMonthDay"!==e&&n%7==1&&f.weekNumbers.insertAdjacentHTML("beforeend",""+f.config.getWeek(t)+""),de("onDayCreate",o),o}function F(e){e.focus(),"range"===f.config.mode&&ee(e)}function j(e){for(var t=e>0?0:f.config.showMonths-1,n=e>0?f.config.showMonths:-1,i=t;i!=n;i+=e)for(var r=f.daysContainer.children[i],o=e>0?0:r.children.length-1,s=e>0?r.children.length:-1,a=o;a!=s;a+=e){var l=r.children[a];if(-1===l.className.indexOf("hidden")&&$(l.dateObj))return l}}function R(e,t){var n=Z(document.activeElement||document.body),i=void 0!==e?e:n?document.activeElement:void 0!==f.selectedDateElem&&Z(f.selectedDateElem)?f.selectedDateElem:void 0!==f.todayDateElem&&Z(f.todayDateElem)?f.todayDateElem:j(t>0?1:-1);return void 0===i?f._input.focus():n?void function(e,t){for(var n=-1===e.className.indexOf("Month")?e.dateObj.getMonth():f.currentMonth,i=t>0?f.config.showMonths:-1,r=t>0?1:-1,o=n-f.currentMonth;o!=i;o+=r)for(var s=f.daysContainer.children[o],a=n-f.currentMonth===o?e.$i+t:t<0?s.children.length-1:0,l=s.children.length,c=a;c>=0&&c0?l:-1);c+=r){var u=s.children[c];if(-1===u.className.indexOf("hidden")&&$(u.dateObj)&&Math.abs(e.$i-c)>=Math.abs(t))return F(u)}f.changeMonth(r),R(j(r),0)}(i,t):F(i)}function B(e,t){for(var n=(new Date(e,t,1).getDay()-f.l10n.firstDayOfWeek+7)%7,i=f.utils.getDaysInMonth((t-1+12)%12),r=f.utils.getDaysInMonth(t),o=window.document.createDocumentFragment(),s=f.config.showMonths>1,a=s?"prevMonthDay hidden":"prevMonthDay",l=s?"nextMonthDay hidden":"nextMonthDay",u=i+1-n,d=0;u<=i;u++,d++)o.appendChild(I(a,new Date(e,t-1,u),u,d));for(u=1;u<=r;u++,d++)o.appendChild(I("",new Date(e,t,u),u,d));for(var h=r+1;h<=42-n&&(1===f.config.showMonths||d%7!=0);h++,d++)o.appendChild(I(l,new Date(e,t+1,h%r),h,d));var p=c("div","dayContainer");return p.appendChild(o),p}function U(){if(void 0!==f.daysContainer){u(f.daysContainer),f.weekNumbers&&u(f.weekNumbers);for(var e=document.createDocumentFragment(),t=0;t0&&e\n "+t.join("")+"\n \n "}function Y(e,t){void 0===t&&(t=!0);var n=t?e:e-f.currentMonth;n<0&&!0===f._hidePrevMonthArrow||n>0&&!0===f._hideNextMonthArrow||(f.currentMonth+=n,(f.currentMonth<0||f.currentMonth>11)&&(f.currentYear+=f.currentMonth>11?1:-1,f.currentMonth=(f.currentMonth+12)%12,de("onYearChange")),U(),de("onMonthChange"),fe())}function G(e){return!(!f.config.appendTo||!f.config.appendTo.contains(e))||f.calendarContainer.contains(e)}function Q(e){if(f.isOpen&&!f.config.inline){var t="function"==typeof(s=e).composedPath?s.composedPath()[0]:s.target,n=G(t),i=t===f.input||t===f.altInput||f.element.contains(t)||e.path&&e.path.indexOf&&(~e.path.indexOf(f.input)||~e.path.indexOf(f.altInput)),r="blur"===e.type?i&&e.relatedTarget&&!G(e.relatedTarget):!i&&!n&&!G(e.relatedTarget),o=!f.config.ignoredFocusElements.some((function(e){return e.contains(t)}));r&&o&&(E(),f.close(),"range"===f.config.mode&&1===f.selectedDates.length&&(f.clear(!1),f.redraw()))}var s}function J(e){if(!(!e||f.config.minDate&&ef.config.maxDate.getFullYear())){var t=e,n=f.currentYear!==t;f.currentYear=t||f.currentYear,f.config.maxDate&&f.currentYear===f.config.maxDate.getFullYear()?f.currentMonth=Math.min(f.config.maxDate.getMonth(),f.currentMonth):f.config.minDate&&f.currentYear===f.config.minDate.getFullYear()&&(f.currentMonth=Math.max(f.config.minDate.getMonth(),f.currentMonth)),n&&(f.redraw(),de("onYearChange"))}}function $(e,t){void 0===t&&(t=!0);var n=f.parseDate(e,void 0,t);if(f.config.minDate&&n&&b(n,f.config.minDate,void 0!==t?t:!f.minDateHasTime)<0||f.config.maxDate&&n&&b(n,f.config.maxDate,void 0!==t?t:!f.maxDateHasTime)>0)return!1;if(0===f.config.enable.length&&0===f.config.disable.length)return!0;if(void 0===n)return!1;for(var i=f.config.enable.length>0,r=i?f.config.enable:f.config.disable,o=0,s=void 0;o=s.from.getTime()&&n.getTime()<=s.to.getTime())return i}return!i}function Z(e){return void 0!==f.daysContainer&&-1===e.className.indexOf("hidden")&&f.daysContainer.contains(e)}function X(e){var t=e.target===f._input,n=f.config.allowInput,i=f.isOpen&&(!n||!t),r=f.config.inline&&t&&!n;if(13===e.keyCode&&t){if(n)return f.setDate(f._input.value,!0,e.target===f.altInput?f.config.altFormat:f.config.dateFormat),e.target.blur();f.open()}else if(G(e.target)||i||r){var o=!!f.timeContainer&&f.timeContainer.contains(e.target);switch(e.keyCode){case 13:o?E():ae(e);break;case 27:e.preventDefault(),se();break;case 8:case 46:t&&!f.config.allowInput&&(e.preventDefault(),f.clear());break;case 37:case 39:if(o)f.hourElement&&f.hourElement.focus();else if(e.preventDefault(),void 0!==f.daysContainer&&(!1===n||document.activeElement&&Z(document.activeElement))){var s=39===e.keyCode?1:-1;e.ctrlKey?(e.stopPropagation(),Y(s),R(j(1),0)):R(void 0,s)}break;case 38:case 40:e.preventDefault();var a=40===e.keyCode?1:-1;f.daysContainer&&void 0!==e.target.$i||e.target===f.input?e.ctrlKey?(e.stopPropagation(),J(f.currentYear-a),R(j(1),0)):o||R(void 0,7*a):f.config.enableTime&&(!o&&f.hourElement&&f.hourElement.focus(),E(e),f._debouncedChange());break;case 9:var l=f.calendarContainer.childElementCount,c=0;if(f.config.enableTime&&(c+=1),f.config.noCalendar||(c+=2),o){var u=[f.hourElement,f.minuteElement,f.secondElement,f.amPM].filter((function(e){return e})),d=u.indexOf(e.target);if(-1!==d){var h=u[d+(e.shiftKey?-1:1)];void 0!==h?(e.preventDefault(),h.focus()):l<=c&&f.element.focus()}break}l<=c&&f.element.focus()}}if(void 0!==f.amPM&&e.target===f.amPM)switch(e.key){case f.l10n.amPM[0].charAt(0):case f.l10n.amPM[0].charAt(0).toLowerCase():f.amPM.textContent=f.l10n.amPM[0],O(),me();break;case f.l10n.amPM[1].charAt(0):case f.l10n.amPM[1].charAt(0).toLowerCase():f.amPM.textContent=f.l10n.amPM[1],O(),me()}de("onKeyDown",e)}function ee(e){if(1===f.selectedDates.length&&(!e||e.classList.contains("flatpickr-day")&&!e.classList.contains("disabled"))){for(var t=e?e.dateObj.getTime():f.days.firstElementChild.dateObj.getTime(),n=f.parseDate(f.selectedDates[0],void 0,!0).getTime(),i=Math.min(t,f.selectedDates[0].getTime()),r=Math.max(t,f.selectedDates[0].getTime()),o=f.daysContainer.lastChild.lastChild.dateObj.getTime(),s=!1,a=0,l=0,c=i;ci&&ca)?a=c:c>n&&(!l||c0&&c0&&c>l;return p?(o.classList.add("notAllowed"),["inRange","startRange","endRange"].forEach((function(e){o.classList.remove(e)})),"continue"):s&&!p?"continue":(["startRange","inRange","endRange","notAllowed"].forEach((function(e){o.classList.remove(e)})),void(void 0!==e&&(e.classList.add(t0&&h&&h.lastChild.dateObj.getTime()>=c||(nt&&c===n&&o.classList.add("endRange"),c>=a&&(0===l||c<=l)&&w(c,n,t)&&o.classList.add("inRange")))))},g=0,m=d.children.length;g0||n.getMinutes()>0||n.getSeconds()>0),f.selectedDates&&(f.selectedDates=f.selectedDates.filter((function(e){return $(e)})),f.selectedDates.length||"min"!==e||q(n),me()),f.daysContainer&&(oe(),void 0!==n?f.currentYearElement[e]=n.getFullYear().toString():f.currentYearElement.removeAttribute(e),f.currentYearElement.disabled=!!i&&void 0!==n&&i.getFullYear()===n.getFullYear())}}function ie(){"object"!=typeof f.config.locale&&void 0===z.l10ns[f.config.locale]&&f.config.errorHandler(new Error("flatpickr: invalid locale "+f.config.locale)),f.l10n=e({},z.l10ns.default,"object"==typeof f.config.locale?f.config.locale:"default"!==f.config.locale?z.l10ns[f.config.locale]:void 0),g.K="("+f.l10n.amPM[0]+"|"+f.l10n.amPM[1]+"|"+f.l10n.amPM[0].toLowerCase()+"|"+f.l10n.amPM[1].toLowerCase()+")",f.formatDate=v(f),f.parseDate=y({config:f.config,l10n:f.l10n})}function re(e){if(void 0!==f.calendarContainer){de("onPreCalendarPosition");var t=e||f._positionElement,n=Array.prototype.reduce.call(f.calendarContainer.children,(function(e,t){return e+t.offsetHeight}),0),i=f.calendarContainer.offsetWidth,r=f.config.position.split(" "),o=r[0],s=r.length>1?r[1]:null,a=t.getBoundingClientRect(),c=window.innerHeight-a.bottom,u="above"===o||"below"!==o&&cn,d=window.pageYOffset+a.top+(u?-n-2:t.offsetHeight+2);if(l(f.calendarContainer,"arrowTop",!u),l(f.calendarContainer,"arrowBottom",u),!f.config.inline){var h=window.pageXOffset+a.left-(null!=s&&"center"===s?(i-a.width)/2:0),p=window.document.body.offsetWidth-a.right,g=h+i>window.document.body.offsetWidth,m=p+i>window.document.body.offsetWidth;if(l(f.calendarContainer,"rightMost",g),!f.config.static)if(f.calendarContainer.style.top=d+"px",g)if(m){var v=document.styleSheets[0],y=window.document.body.offsetWidth,b=Math.max(0,y/2-i/2),w=v.cssRules.length,_="{left:"+a.left+"px;right:auto;}";l(f.calendarContainer,"rightMost",!1),l(f.calendarContainer,"centerMost",!0),v.insertRule(".flatpickr-calendar.centerMost:before,.flatpickr-calendar.centerMost:after"+_,w),f.calendarContainer.style.left=b+"px",f.calendarContainer.style.right="auto"}else f.calendarContainer.style.left="auto",f.calendarContainer.style.right=p+"px";else f.calendarContainer.style.left=h+"px",f.calendarContainer.style.right="auto"}}}function oe(){f.config.noCalendar||f.isMobile||(fe(),U())}function se(){f._input.focus(),-1!==window.navigator.userAgent.indexOf("MSIE")||void 0!==navigator.msMaxTouchPoints?setTimeout(f.close,0):f.close()}function ae(e){e.preventDefault(),e.stopPropagation();var t=function e(t,n){return n(t)?t:t.parentNode?e(t.parentNode,n):void 0}(e.target,(function(e){return e.classList&&e.classList.contains("flatpickr-day")&&!e.classList.contains("disabled")&&!e.classList.contains("notAllowed")}));if(void 0!==t){var n=t,i=f.latestSelectedDateObj=new Date(n.dateObj.getTime()),r=(i.getMonth()f.currentMonth+f.config.showMonths-1)&&"range"!==f.config.mode;if(f.selectedDateElem=n,"single"===f.config.mode)f.selectedDates=[i];else if("multiple"===f.config.mode){var o=pe(i);o?f.selectedDates.splice(parseInt(o),1):f.selectedDates.push(i)}else"range"===f.config.mode&&(2===f.selectedDates.length&&f.clear(!1),f.latestSelectedDateObj=i,f.selectedDates.push(i),0!==b(i,f.selectedDates[0],!0)&&f.selectedDates.sort((function(e,t){return e.getTime()-t.getTime()})));if(O(),r){var s=f.currentYear!==i.getFullYear();f.currentYear=i.getFullYear(),f.currentMonth=i.getMonth(),s&&de("onYearChange"),de("onMonthChange")}if(fe(),U(),me(),f.config.enableTime&&setTimeout((function(){return f.showTimeInput=!0}),50),r||"range"===f.config.mode||1!==f.config.showMonths?void 0!==f.selectedDateElem&&void 0===f.hourElement&&f.selectedDateElem&&f.selectedDateElem.focus():F(n),void 0!==f.hourElement&&void 0!==f.hourElement&&f.hourElement.focus(),f.config.closeOnSelect){var a="single"===f.config.mode&&!f.config.enableTime,l="range"===f.config.mode&&2===f.selectedDates.length&&!f.config.enableTime;(a||l)&&se()}D()}}f.parseDate=y({config:f.config,l10n:f.l10n}),f._handlers=[],f._bind=S,f._setHoursFromDate=q,f._positionCalendar=re,f.changeMonth=Y,f.changeYear=J,f.clear=function(e){void 0===e&&(e=!0),f.input.value="",void 0!==f.altInput&&(f.altInput.value=""),void 0!==f.mobileInput&&(f.mobileInput.value=""),f.selectedDates=[],f.latestSelectedDateObj=void 0,f.currentYear=f._initialDate.getFullYear(),f.currentMonth=f._initialDate.getMonth(),f.showTimeInput=!1,!0===f.config.enableTime&&x(),f.redraw(),e&&de("onChange")},f.close=function(){f.isOpen=!1,f.isMobile||(void 0!==f.calendarContainer&&f.calendarContainer.classList.remove("open"),void 0!==f._input&&f._input.classList.remove("active")),de("onClose")},f._createElement=c,f.destroy=function(){void 0!==f.config&&de("onDestroy");for(var e=f._handlers.length;e--;){var t=f._handlers[e];t.element.removeEventListener(t.event,t.handler,t.options)}if(f._handlers=[],f.mobileInput)f.mobileInput.parentNode&&f.mobileInput.parentNode.removeChild(f.mobileInput),f.mobileInput=void 0;else if(f.calendarContainer&&f.calendarContainer.parentNode)if(f.config.static&&f.calendarContainer.parentNode){var n=f.calendarContainer.parentNode;if(n.lastChild&&n.removeChild(n.lastChild),n.parentNode){for(;n.firstChild;)n.parentNode.insertBefore(n.firstChild,n);n.parentNode.removeChild(n)}}else f.calendarContainer.parentNode.removeChild(f.calendarContainer);f.altInput&&(f.input.type="text",f.altInput.parentNode&&f.altInput.parentNode.removeChild(f.altInput),delete f.altInput),f.input&&(f.input.type=f.input._type,f.input.classList.remove("flatpickr-input"),f.input.removeAttribute("readonly"),f.input.value=""),["_showTimeInput","latestSelectedDateObj","_hideNextMonthArrow","_hidePrevMonthArrow","__hideNextMonthArrow","__hidePrevMonthArrow","isMobile","isOpen","selectedDateElem","minDateHasTime","maxDateHasTime","days","daysContainer","_input","_positionElement","innerContainer","rContainer","monthNav","todayDateElem","calendarContainer","weekdayContainer","prevMonthNav","nextMonthNav","currentMonthElement","currentYearElement","navigationCurrentMonth","selectedDateElem","config"].forEach((function(e){try{delete f[e]}catch(e){}}))},f.isEnabled=$,f.jumpToDate=L,f.open=function(e,t){if(void 0===t&&(t=f._positionElement),!0===f.isMobile)return e&&(e.preventDefault(),e.target&&e.target.blur()),void 0!==f.mobileInput&&(f.mobileInput.focus(),f.mobileInput.click()),void de("onOpen");if(!f._input.disabled&&!f.config.inline){var n=f.isOpen;f.isOpen=!0,n||(f.calendarContainer.classList.add("open"),f._input.classList.add("active"),de("onOpen"),re(t),f.calendarContainer.focus(),!1===f.config.noCalendar&&R(void 0,0)),!0===f.config.enableTime&&!0===f.config.noCalendar&&(0===f.selectedDates.length&&(f.setDate(void 0!==f.config.minDate?new Date(f.config.minDate.getTime()):new Date,!1),x(),me()),!1!==f.config.allowInput||void 0!==e&&f.timeContainer.contains(e.relatedTarget)||setTimeout((function(){return f.hourElement.select()}),50))}},f.redraw=oe,f.set=function(e,n){null!==e&&"object"==typeof e?Object.assign(f.config,e):(f.config[e]=n,void 0!==le[e]?le[e].forEach((function(e){return e()})):t.indexOf(e)>-1&&(f.config[e]=a(n))),f.redraw(),L(),me(!1)},f.setDate=function(e,t,n){if(void 0===t&&(t=!1),void 0===n&&(n=f.config.dateFormat),0!==e&&!e||e instanceof Array&&0===e.length)return f.clear(t);ce(e,n),f.showTimeInput=f.selectedDates.length>0,f.latestSelectedDateObj=f.selectedDates[0],f.redraw(),L(),q(),me(t),t&&de("onChange")},f.toggle=function(e){if(!0===f.isOpen)return f.close();f.open(e)};var le={locale:[ie,W],showMonths:[H,C,V]};function ce(e,t){var n=[];if(e instanceof Array)n=e.map((function(e){return f.parseDate(e,t)}));else if(e instanceof Date||"number"==typeof e)n=[f.parseDate(e,t)];else if("string"==typeof e)switch(f.config.mode){case"single":case"time":n=[f.parseDate(e,t)];break;case"multiple":n=e.split(f.config.conjunction).map((function(e){return f.parseDate(e,t)}));break;case"range":n=e.split(f.l10n.rangeSeparator).map((function(e){return f.parseDate(e,t)}))}else f.config.errorHandler(new Error("Invalid date supplied: "+JSON.stringify(e)));f.selectedDates=n.filter((function(e){return e instanceof Date&&$(e,!1)})),"range"===f.config.mode&&f.selectedDates.sort((function(e,t){return e.getTime()-t.getTime()}))}function ue(e){return e.slice().map((function(e){return"string"==typeof e||"number"==typeof e||e instanceof Date?f.parseDate(e,void 0,!0):e&&"object"==typeof e&&e.from&&e.to?{from:f.parseDate(e.from,void 0),to:f.parseDate(e.to,void 0)}:e})).filter((function(e){return e}))}function de(e,t){if(void 0!==f.config){var n=f.config[e];if(void 0!==n&&n.length>0)for(var i=0;n[i]&&if.config.maxDate.getMonth():f.currentYear>f.config.maxDate.getFullYear()))}function ge(e){return f.selectedDates.map((function(t){return f.formatDate(t,e)})).filter((function(e,t,n){return"range"!==f.config.mode||f.config.enableTime||n.indexOf(e)===t})).join("range"!==f.config.mode?f.config.conjunction:f.l10n.rangeSeparator)}function me(e){if(void 0===e&&(e=!0),0===f.selectedDates.length)return f.clear(e);void 0!==f.mobileInput&&f.mobileFormatStr&&(f.mobileInput.value=void 0!==f.latestSelectedDateObj?f.formatDate(f.latestSelectedDateObj,f.mobileFormatStr):""),f.input.value=ge(f.config.dateFormat),void 0!==f.altInput&&(f.altInput.value=ge(f.config.altFormat)),!1!==e&&de("onValueUpdate")}function ve(e){e.preventDefault();var t=f.prevMonthNav.contains(e.target),n=f.nextMonthNav.contains(e.target);t||n?Y(t?-1:1):f.yearElements.indexOf(e.target)>=0?e.target.select():e.target.classList.contains("arrowUp")?f.changeYear(f.currentYear+1):e.target.classList.contains("arrowDown")&&f.changeYear(f.currentYear-1)}return function(){f.element=f.input=n,f.isOpen=!1,function(){var i=["wrap","weekNumbers","allowInput","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],r=e({},h,JSON.parse(JSON.stringify(n.dataset||{}))),o={};f.config.parseDate=r.parseDate,f.config.formatDate=r.formatDate,Object.defineProperty(f.config,"enable",{get:function(){return f.config._enable},set:function(e){f.config._enable=ue(e)}}),Object.defineProperty(f.config,"disable",{get:function(){return f.config._disable},set:function(e){f.config._disable=ue(e)}});var s="time"===r.mode;r.dateFormat||!r.enableTime&&!s||(o.dateFormat=r.noCalendar||s?"H:i"+(r.enableSeconds?":S":""):z.defaultConfig.dateFormat+" H:i"+(r.enableSeconds?":S":"")),r.altInput&&(r.enableTime||s)&&!r.altFormat&&(o.altFormat=r.noCalendar||s?"h:i"+(r.enableSeconds?":S K":" K"):z.defaultConfig.altFormat+" h:i"+(r.enableSeconds?":S":"")+" K"),Object.defineProperty(f.config,"minDate",{get:function(){return f.config._minDate},set:ne("min")}),Object.defineProperty(f.config,"maxDate",{get:function(){return f.config._maxDate},set:ne("max")});var l=function(e){return function(t){f.config["min"===e?"_minTime":"_maxTime"]=f.parseDate(t,"H:i")}};Object.defineProperty(f.config,"minTime",{get:function(){return f.config._minTime},set:l("min")}),Object.defineProperty(f.config,"maxTime",{get:function(){return f.config._maxTime},set:l("max")}),"time"===r.mode&&(f.config.noCalendar=!0,f.config.enableTime=!0),Object.assign(f.config,o,r);for(var c=0;c-1?f.config[d]=a(u[d]).map(m).concat(f.config[d]):void 0===r[d]&&(f.config[d]=u[d])}de("onParseConfig")}(),ie(),f.input=f.config.wrap?n.querySelector("[data-input]"):n,f.input?(f.input._type=f.input.type,f.input.type="text",f.input.classList.add("flatpickr-input"),f._input=f.input,f.config.altInput&&(f.altInput=c(f.input.nodeName,f.input.className+" "+f.config.altInputClass),f._input=f.altInput,f.altInput.placeholder=f.input.placeholder,f.altInput.disabled=f.input.disabled,f.altInput.required=f.input.required,f.altInput.tabIndex=f.input.tabIndex,f.altInput.type="text",f.input.setAttribute("type","hidden"),!f.config.static&&f.input.parentNode&&f.input.parentNode.insertBefore(f.altInput,f.input.nextSibling)),f.config.allowInput||f._input.setAttribute("readonly","readonly"),f._positionElement=f.config.positionElement||f._input):f.config.errorHandler(new Error("Invalid input element specified")),function(){f.selectedDates=[],f.now=f.parseDate(f.config.now)||new Date;var e=f.config.defaultDate||("INPUT"!==f.input.nodeName&&"TEXTAREA"!==f.input.nodeName||!f.input.placeholder||f.input.value!==f.input.placeholder?f.input.value:null);e&&ce(e,f.config.dateFormat),f._initialDate=f.selectedDates.length>0?f.selectedDates[0]:f.config.minDate&&f.config.minDate.getTime()>f.now.getTime()?f.config.minDate:f.config.maxDate&&f.config.maxDate.getTime()0&&(f.latestSelectedDateObj=f.selectedDates[0]),void 0!==f.config.minTime&&(f.config.minTime=f.parseDate(f.config.minTime,"H:i")),void 0!==f.config.maxTime&&(f.config.maxTime=f.parseDate(f.config.maxTime,"H:i")),f.minDateHasTime=!!f.config.minDate&&(f.config.minDate.getHours()>0||f.config.minDate.getMinutes()>0||f.config.minDate.getSeconds()>0),f.maxDateHasTime=!!f.config.maxDate&&(f.config.maxDate.getHours()>0||f.config.maxDate.getMinutes()>0||f.config.maxDate.getSeconds()>0),Object.defineProperty(f,"showTimeInput",{get:function(){return f._showTimeInput},set:function(e){f._showTimeInput=e,f.calendarContainer&&l(f.calendarContainer,"showTimeInput",e),f.isOpen&&re()}})}(),f.utils={getDaysInMonth:function(e,t){return void 0===e&&(e=f.currentMonth),void 0===t&&(t=f.currentYear),1===e&&(t%4==0&&t%100!=0||t%400==0)?29:f.l10n.daysInMonth[e]}},f.isMobile||function(){var e=window.document.createDocumentFragment();if(f.calendarContainer=c("div","flatpickr-calendar"),f.calendarContainer.tabIndex=-1,!f.config.noCalendar){if(e.appendChild((f.monthNav=c("div","flatpickr-months"),f.yearElements=[],f.monthElements=[],f.prevMonthNav=c("span","flatpickr-prev-month"),f.prevMonthNav.innerHTML=f.config.prevArrow,f.nextMonthNav=c("span","flatpickr-next-month"),f.nextMonthNav.innerHTML=f.config.nextArrow,H(),Object.defineProperty(f,"_hidePrevMonthArrow",{get:function(){return f.__hidePrevMonthArrow},set:function(e){f.__hidePrevMonthArrow!==e&&(l(f.prevMonthNav,"disabled",e),f.__hidePrevMonthArrow=e)}}),Object.defineProperty(f,"_hideNextMonthArrow",{get:function(){return f.__hideNextMonthArrow},set:function(e){f.__hideNextMonthArrow!==e&&(l(f.nextMonthNav,"disabled",e),f.__hideNextMonthArrow=e)}}),f.currentYearElement=f.yearElements[0],fe(),f.monthNav)),f.innerContainer=c("div","flatpickr-innerContainer"),f.config.weekNumbers){var t=function(){f.calendarContainer.classList.add("hasWeeks");var e=c("div","flatpickr-weekwrapper");e.appendChild(c("span","flatpickr-weekday",f.l10n.weekAbbreviation));var t=c("div","flatpickr-weeks");return e.appendChild(t),{weekWrapper:e,weekNumbers:t}}(),n=t.weekWrapper,i=t.weekNumbers;f.innerContainer.appendChild(n),f.weekNumbers=i,f.weekWrapper=n}f.rContainer=c("div","flatpickr-rContainer"),f.rContainer.appendChild(V()),f.daysContainer||(f.daysContainer=c("div","flatpickr-days"),f.daysContainer.tabIndex=-1),U(),f.rContainer.appendChild(f.daysContainer),f.innerContainer.appendChild(f.rContainer),e.appendChild(f.innerContainer)}f.config.enableTime&&e.appendChild(function(){f.calendarContainer.classList.add("hasTime"),f.config.noCalendar&&f.calendarContainer.classList.add("noCalendar"),f.timeContainer=c("div","flatpickr-time"),f.timeContainer.tabIndex=-1;var e=c("span","flatpickr-time-separator",":"),t=d("flatpickr-hour");f.hourElement=t.getElementsByTagName("input")[0];var n=d("flatpickr-minute");if(f.minuteElement=n.getElementsByTagName("input")[0],f.hourElement.tabIndex=f.minuteElement.tabIndex=-1,f.hourElement.value=r(f.latestSelectedDateObj?f.latestSelectedDateObj.getHours():f.config.time_24hr?f.config.defaultHour:function(e){switch(e%24){case 0:case 12:return 12;default:return e%12}}(f.config.defaultHour)),f.minuteElement.value=r(f.latestSelectedDateObj?f.latestSelectedDateObj.getMinutes():f.config.defaultMinute),f.hourElement.setAttribute("data-step",f.config.hourIncrement.toString()),f.minuteElement.setAttribute("data-step",f.config.minuteIncrement.toString()),f.hourElement.setAttribute("data-min",f.config.time_24hr?"0":"1"),f.hourElement.setAttribute("data-max",f.config.time_24hr?"23":"12"),f.minuteElement.setAttribute("data-min","0"),f.minuteElement.setAttribute("data-max","59"),f.timeContainer.appendChild(t),f.timeContainer.appendChild(e),f.timeContainer.appendChild(n),f.config.time_24hr&&f.timeContainer.classList.add("time24hr"),f.config.enableSeconds){f.timeContainer.classList.add("hasSeconds");var i=d("flatpickr-second");f.secondElement=i.getElementsByTagName("input")[0],f.secondElement.value=r(f.latestSelectedDateObj?f.latestSelectedDateObj.getSeconds():f.config.defaultSeconds),f.secondElement.setAttribute("data-step",f.minuteElement.getAttribute("data-step")),f.secondElement.setAttribute("data-min",f.minuteElement.getAttribute("data-min")),f.secondElement.setAttribute("data-max",f.minuteElement.getAttribute("data-max")),f.timeContainer.appendChild(c("span","flatpickr-time-separator",":")),f.timeContainer.appendChild(i)}return f.config.time_24hr||(f.amPM=c("span","flatpickr-am-pm",f.l10n.amPM[o((f.latestSelectedDateObj?f.hourElement.value:f.config.defaultHour)>11)]),f.amPM.title=f.l10n.toggleTitle,f.amPM.tabIndex=-1,f.timeContainer.appendChild(f.amPM)),f.timeContainer}()),l(f.calendarContainer,"rangeMode","range"===f.config.mode),l(f.calendarContainer,"animate",!0===f.config.animate),l(f.calendarContainer,"multiMonth",f.config.showMonths>1),f.calendarContainer.appendChild(e);var s=void 0!==f.config.appendTo&&void 0!==f.config.appendTo.nodeType;if((f.config.inline||f.config.static)&&(f.calendarContainer.classList.add(f.config.inline?"inline":"static"),f.config.inline&&(!s&&f.element.parentNode?f.element.parentNode.insertBefore(f.calendarContainer,f._input.nextSibling):void 0!==f.config.appendTo&&f.config.appendTo.appendChild(f.calendarContainer)),f.config.static)){var a=c("div","flatpickr-wrapper");f.element.parentNode&&f.element.parentNode.insertBefore(a,f.element),a.appendChild(f.element),f.altInput&&a.appendChild(f.altInput),a.appendChild(f.calendarContainer)}f.config.static||f.config.inline||(void 0!==f.config.appendTo?f.config.appendTo:window.document.body).appendChild(f.calendarContainer)}(),function(){if(f.config.wrap&&["open","close","toggle","clear"].forEach((function(e){Array.prototype.forEach.call(f.element.querySelectorAll("[data-"+e+"]"),(function(t){return S(t,"click",f[e])}))})),f.isMobile)!function(){var e=f.config.enableTime?f.config.noCalendar?"time":"datetime-local":"date";f.mobileInput=c("input",f.input.className+" flatpickr-mobile"),f.mobileInput.step=f.input.getAttribute("step")||"any",f.mobileInput.tabIndex=1,f.mobileInput.type=e,f.mobileInput.disabled=f.input.disabled,f.mobileInput.required=f.input.required,f.mobileInput.placeholder=f.input.placeholder,f.mobileFormatStr="datetime-local"===e?"Y-m-d\\TH:i:S":"date"===e?"Y-m-d":"H:i:S",f.selectedDates.length>0&&(f.mobileInput.defaultValue=f.mobileInput.value=f.formatDate(f.selectedDates[0],f.mobileFormatStr)),f.config.minDate&&(f.mobileInput.min=f.formatDate(f.config.minDate,"Y-m-d")),f.config.maxDate&&(f.mobileInput.max=f.formatDate(f.config.maxDate,"Y-m-d")),f.input.type="hidden",void 0!==f.altInput&&(f.altInput.type="hidden");try{f.input.parentNode&&f.input.parentNode.insertBefore(f.mobileInput,f.input.nextSibling)}catch(e){}S(f.mobileInput,"change",(function(e){f.setDate(e.target.value,!1,f.mobileFormatStr),de("onChange"),de("onClose")}))}();else{var e=s(te,50);f._debouncedChange=s(D,k),f.daysContainer&&!/iPhone|iPad|iPod/i.test(navigator.userAgent)&&S(f.daysContainer,"mouseover",(function(e){"range"===f.config.mode&&ee(e.target)})),S(window.document.body,"keydown",X),f.config.static||S(f._input,"keydown",X),f.config.inline||f.config.static||S(window,"resize",e),void 0!==window.ontouchstart?S(window.document,"click",Q):S(window.document,"mousedown",A(Q)),S(window.document,"focus",Q,{capture:!0}),!0===f.config.clickOpens&&(S(f._input,"focus",f.open),S(f._input,"mousedown",A(f.open))),void 0!==f.daysContainer&&(S(f.monthNav,"mousedown",A(ve)),S(f.monthNav,["keyup","increment"],P),S(f.daysContainer,"mousedown",A(ae))),void 0!==f.timeContainer&&void 0!==f.minuteElement&&void 0!==f.hourElement&&(S(f.timeContainer,["increment"],E),S(f.timeContainer,"blur",E,{capture:!0}),S(f.timeContainer,"mousedown",A(M)),S([f.hourElement,f.minuteElement],["focus","click"],(function(e){return e.target.select()})),void 0!==f.secondElement&&S(f.secondElement,"focus",(function(){return f.secondElement&&f.secondElement.select()})),void 0!==f.amPM&&S(f.amPM,"mousedown",A((function(e){E(e),D()}))))}}(),(f.selectedDates.length||f.config.noCalendar)&&(f.config.enableTime&&q(f.config.noCalendar?f.latestSelectedDateObj||f.config.minDate:void 0),me(!1)),C(),f.showTimeInput=f.selectedDates.length>0||f.config.noCalendar;var i=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);!f.isMobile&&i&&re(),de("onReady")}(),f}function E(e,t){if(0===e.length)return[];for(var n=Array.from(e).filter((function(e){return e instanceof HTMLElement})),i=[],r=0;r0&&!d[e].checkValidity()?(d[e].classList.add("sqzly-error"),r=!0):(i[d[e].getAttribute("data-field-id")]=d[e].value,d[e].classList.remove("sqzly-error"));var h=this._document.querySelectorAll(s+" .sqzly-hiddenfield");for(let e=0;e0&&this.sendToPixel("emailoptin",e,t,i),this._document.querySelector(s+" .sqzly-modal-content").classList.add("sqzly-collapse"),this._document.querySelector(s+" .sqzly-thankyou").classList.add("sqzly-in")),!r}handleInitPersonalization(e,t){var n=sqzlCommon.readConsentCookie();if(!sqzlCommon.hasConsentManagementEnabled()||sqzlCommon.hasConsentManagementEnabled()&&null!==n&&sqzlCommon.hasAnalyticsConsent(n)){var i=sqzlCommon.readCookie(this._settings.mainCookieName,!0,this._document,this._localStorage);"null"!==i&&i&&""!==i||(i=sqzlCommon.uniqid("sqzl"),sqzlCommon.createCookie(this._settings.mainCookieName,i,10957,!0,this._document,this._localStorage))}else i=sqzlCommon.hasConsentManagementEnabled()&&null!==n&&!sqzlCommon.hasAnalyticsConsent(n)?"noconsent":"";if(""!==i){var r=[];if(r.push("c="+i),r.push("u="+encodeURIComponent(this._window.location.href)),r.push("nP="+this._notificationPermission),!0===this._settings.isTravel){var o=this._localStorage.getItem("amount_nights"),s=this._localStorage.getItem("checkin_date");void 0!==o&&o&&r.push("an="+o),void 0!==s&&s&&r.push("cd="+s)}if(void 0!==t){if(t.hasOwnProperty("products")&&t.products.length>0){var a=[];t.products.forEach((function(e){if(!e.hasOwnProperty("id"))return!1;a.push(e.id)})),r.push("p="+encodeURIComponent(a.join(",")))}t.hasOwnProperty("event")&&r.push("e="+encodeURIComponent(t.event)),t.hasOwnProperty("category_id")&&r.push("ci="+encodeURIComponent(t.category_id))}var l=sqzlCommon.getDebugLevel();l&&r.push("d="+l);var c=sqzlCommon.isMobileBrowser()?"1":"0";r.push("md="+c),r.push("l="+this.getLanguage().toUpperCase());var u=this.getAndExtractCounterCookie();u&&r.push("vc="+JSON.stringify(u));var d=this.getAndExtractDisableCookie();d&&r.push("dis="+JSON.stringify(d)),this._window.hasOwnProperty("nunjucksPrecompiled")&&r.push("tpl="+Object.keys(this._window.nunjucksPrecompiled).join(","));var h=new Date;if(r.push("tOffset="+h.getTimezoneOffset()),r.push("cB="+h.getTime()+"."+h.getMilliseconds()),sqzlCommon.getConfigItem("noJSONP",!1)&&!sqzlCommon.getDebugLevel())try{r.push("no_jsonp=true"),sqzlCommon.fetchJson(this._dynamicBaseUrl+this._settings.pathPersonalizationSettings+"&"+r.join("&"),null,null,function(e){if(void 0===e.length&&e.hasOwnProperty("event"))this.g.sqzl.p.push(e);else for(let t=0;t0&&(this.setTimerQueuedPersonalization(),this.triggerPersonalizationsOnPixelEvents()),this.removeRemainingHiddenElements(),!1;var n=!1;for(var i in t)if(t.hasOwnProperty(i)){var r=t[i],o=r.variant;if("personalizationTriggerOnProductEventsFound"!==i){if(o=this.replaceInViewProduct(o),r?.name&&o?.name&&(sqzlCommon.addPersonalizationName(r.id,r.name),sqzlCommon.addVariantName(o.id,o.name)),"insert"===o.templateSettings.display_type)switch(o.templateSettings.product_amount){case"1":o.templateSettings.grid_class="sq-col-xs-12";break;case"2":o.templateSettings.grid_class="sq-col-xs-12 sq-col-sm-6";break;case"3":case"6":o.templateSettings.grid_class="sq-col-xs-12 sq-col-sm-4";break;default:o.templateSettings.grid_class="sq-col-xs-12 sq-col-sm-3"}this.removeHiddenElementByVariantId(o);var s=r.settings.trigger_event_event||null;"product"===r.settings.trigger_type&&(s=r.settings.trigger_product_event);var a=Object.assign({},o.settings,o.templateSettings,{personalizationId:r.id,variantId:o.id,trigger_type:r.settings.trigger_type,trigger_delay:r.settings.trigger_delay,trigger_event_fields:r.settings.trigger_event_fields||[],trigger_event_event:s});a._variantSettings=Object.assign({},a),this._loadedPersonalizationIds.push(r.id),this.loadTemplateAndTrigger(r,o,a),sqzlCommon.initSlider(o.templateSettings,r.id),n=!0}else this.removeHiddenElementByVariantId(o)}n&&this.addDocumentListeners.call(this),this._settings.personalizationTriggerOnProductEventsFound.length>0&&(this.setTimerQueuedPersonalization(),this.triggerPersonalizationsOnPixelEvents()),this.removeRemainingHiddenElements()}removeRemainingHiddenElements(){if(this._window.hasOwnProperty("_sqzlHE")&&null!==this._window._sqzlHE)for(var e in this._window._sqzlHE)this._window._sqzlHE.hasOwnProperty(e)&&(this._window._sqzlHE[e].elm.parentNode.removeChild(this._window._sqzlHE[e].elm),delete this._window._sqzlHE[e])}removeHiddenElementByVariantId(e){this._window.hasOwnProperty("_sqzlHE")&&void 0!==this._window._sqzlHE&&null!==this._window._sqzlHE&&e&&e.hasOwnProperty("id")&&this._window._sqzlHE.hasOwnProperty(e.id)&&delete this._window._sqzlHE[e.id]}addDocumentListeners(){if(this._documentListenersDone)return!1;this._document.addEventListener("click",this.handleEventClick.bind(this),!1),this._documentListenersDone=!0}handleEventClick(e){var t=void 0!==(e=e||this._window.e).target.parentNode&&null!==e.target.parentNode&&"a"===e.target.parentNode?.tagName.toLowerCase()?e.target.parentNode:e.target;if(!t.classList.contains("sqzl-click")&&void 0!==t.closest){var n=t.closest("a");n&&(t=n)}if(t&&t.classList.contains("sqzl-click")){var i=t.getAttribute("data-sqzl-personalization-id"),r="false"!==t.getAttribute("data-sqzl-variant-id")?t.getAttribute("data-sqzl-variant-id"):0,o=t.getAttribute("data-sqzl-variant-revision")||0,s="true"===t.getAttribute("data-sqzl-new-window"),a={};if(t.getAttribute("data-sqzl-product-id")&&(a.product_id=t.getAttribute("data-sqzl-product-id")||0,t.getAttribute("data-sqzl-product-name")&&(a.product_title=t.getAttribute("data-sqzl-product-name")),t.getAttribute("data-sqzl-product-price")&&(a.product_price=t.getAttribute("data-sqzl-product-price")),t.getAttribute("data-sqzl-product-position")&&(a.product_position=t.getAttribute("data-sqzl-product-position"))),!i)return;var l=this._settings.closingModalExpirationDays;if(this._personalizationSettingCloseModalExpirationDays.hasOwnProperty(i)&&(l=this._personalizationSettingCloseModalExpirationDays[i]/1440),t.className.match(/sqzly-(bar|modal|toaster)-close/)){let e=this._document.getElementById(this.getVariantElementId(i,r,o));e.parentNode.removeChild(e),this.state.overlayOpen=!1,l>=0&&sqzlCommon.createCookie(this._settings.disablePersonalizationCookieName+i,1,l,!1,this._document),this.fireCloseEvent(i,r,a)}else if(t.className.match(/sqzly-form-submit/)){this.feedbackFormSubmit(i,r,o)&&null==t.className.match(/ignore-disable/)&&sqzlCommon.createCookie(this._settings.disablePersonalizationCookieName+i,1,l,!1,this._document)}else{if(void 0!==t.dataset&&void 0!==t.dataset.sqzlyAttributes)try{Object.assign(a,JSON.parse(t.dataset.sqzlyAttributes))}catch(e){}if(t.className.match(/sqzly-overlay-cta/)){let e=this._document.getElementById(this.getVariantElementId(i,r,o));e.parentNode.removeChild(e)}this.handleClick(t.href,e,s),this.fireClickEvent(i,r,a)}}}disabledPersonalization(e,t){var n=sqzlCommon.readCookie(this._settings.disablePersonalizationCookieName+e.id,!1,_document);return""!==n&&1===parseInt(n)}getScroll(){if("undefined"!==this._window.pageYOffset)return{scrollLeft:this._window.pageXOffset,scrollTop:this._window.pageYOffset,windowBottom:this._window.pageYOffset+this._window.innerHeight};var e,t=this._document,n=t.documentElement,i=t.body;return{scrollLeft:n.scrollLeft||i.scrollLeft||0,scrollTop:e=n.scrollTop||i.scrollTop||0,windowBottom:e+this._window.innerHeight}}getBodyHeight(){var e=this._document.body,t=this._document.documentElement;return Math.max(e.scrollHeight,e.offsetHeight,t.clientHeight,t.scrollHeight,t.offsetHeight)}enableSelector(e){this.requireScript(this._document,this._assetBaseUrl+"/assets/personalization-dom-inspector.js?version="+e)}enablePreviewCode(e){this.requireScript(this._document,this._assetBaseUrl+"/assets/personalization-preview.js",e)}fireViewEvent(e,t,n){n=n||{},this.sendToPixel("view",e,t,n)}fireClickEvent(e,t,n){n=n||{},this.sendToPixel("click",e,t,n)}fireCloseEvent(e,t,n){n=n||{},this.sendToPixel("close",e,t,n)}handleClick(e,t,n){return(n=void 0!==n&&n)||this._window.event&&this._window.event.ctrlKey||t&&t.ctrlKey?void 0!==e&&e.length>0&&this._window.open(e,"_blank"):void 0!==e&&e.length>0&&this._window.setTimeout(function(){this.navigateToUrl(e,t)}.bind(this),250),this._window.event&&this._window.event.preventDefault&&this._window.event.preventDefault(),t&&t.preventDefault&&t.preventDefault(),!1}navigateToUrl(e){this._document.location.href=e}sendToPixel(e,t,n,i){if(t){i&&i.hasOwnProperty("product_id")&&null!==i.product_id.match(/^{{product_id/)&&delete i.product_id,i&&i.hasOwnProperty("price")&&null!==i.price.match(/^{{ currency_sign/)&&delete i.price;var r=null;switch(e){case"click":r="PersonalizationClick";break;case"view":r="PersonalizationView";break;case"close":r="PersonalizationClosed";break;case"emailoptin":r="EmailOptIn"}if(r){var o={event:r,personalization_id:t,personalization_variant_id:n};if("PersonalizationClick"===r)o.personalization_id_click=t,o.personalization_variant_id_click=n,o.control_variant=i&&i.hasOwnProperty("control_variant")&&!0===i.control_variant;else if("PersonalizationView"===r){o.personalization_id_view=t,o.personalization_variant_id_view=n,o.control_variant=i&&i.hasOwnProperty("control_variant")&&!0===i.control_variant;var s=this.getAndExtractCounterCookie();s&&(o.personalization_viewcounts=JSON.stringify(s))}else"PersonalizationClosed"===r?(o.personalization_id_closed=t,o.personalization_variant_id_closed=n):"EmailOptIn"===r&&(o={event:r});if(void 0!==i){var a=Object.assign({},i),l={};for(var c in a)a.hasOwnProperty(c)&&c.match(/^product_/)&&(l[c]=a[c],delete a[c]);Object.keys(l).length>0&&l.hasOwnProperty("product_title")&&l.hasOwnProperty("product_id")&&(o.products=[],o.products.push({id:l.product_id||0,name:l.product_title||"",price:l.product_price||0})),o=Object.assign({},o,a)}this.g._sqzl.push(o);var u={event:"sqzl_"+r,personalization_id:t,personalization_variant_id:n};void 0!==i&&(!0===i?.control_variant&&(u.personalization_variant_id="control - "+n),u=Object.assign({},u,i)),this.g.dataLayer.push(u)}}else-1!==["debug","info","warning"].indexOf(sqzlCommon.getDebugLevel())&&console.warn("sqzly: No personalization id for pixel",t)}handlePixelEvent(e,t){void 0===t?.products?.id||Array.isArray(t?.products)||(t.products=[t.products]),Array.isArray(t?.products)&&t.products.forEach(function(e){void 0!==e?.language&&e?.language?.length>0&&(this._lastProductEventLanguage=e.language)}.bind(this)),t?.language?.length>0&&(this._settings.lastEventLanguage=t.language),this._handledPixelEvents.push(t),this.triggerPersonalizationsOnPixelEvents()}triggerPersonalizationsOnPixelEvents(){if(0===this._personalizationQueuedForEvents.length)return!1;this._handledPixelEvents.forEach(function(e){for(let t in this._personalizationQueuedForEvents){if(!this._personalizationQueuedForEvents.hasOwnProperty(t))continue;let n=this._personalizationQueuedForEvents[t];if(this.isEligibleEvent(n,e))if(this._personalizationQueuedForEvents.splice(t,1),!0===n?.productTriggeredPersonalization){let t={event:"InitPersonalization",data:{products:[],category_id:null,event:e.event}},n=!1;e.hasOwnProperty("products")&&e.products.length>0&&(t.data.products=e.products,n=!0),e.hasOwnProperty("category_id")&&e.category_id&&(t.data.category_id=e.category_id,n=!0),n&&this._queueItems.push(t),this.setTimerQueuedPersonalization()}else n.settings=Object.assign({},n.settings,{triggeredByEventCheck:!0}),this._triggerEvents[n.personalization.id]=e,this.isMultiTriggerPersonalization(n.personalization)?this.handleDelayTriggers(n.personalization,n.divElement,n.settings,n.personalization.variant,Math.floor(new Date/1e3)):this.insertOrReplaceContainerContent(n.divElement,n.settings,n.personalization,n.personalization.variant)}}.bind(this))}isEligibleEvent(e,t){let n=e?.settings?.trigger_event_event;if(this.state.overlayShown&&"overlay"===e?.settings?.display_type||void 0!==n&&n.toLowerCase()!==t.event.toLowerCase())return!1;let i=e.settings.trigger_event_fields;if(i.length<1)return!0;if(this.getProductFetchFields(i).length>0){if(!t.hasOwnProperty("products"))return!1;let e=[];for(let n in t.products)t.products.hasOwnProperty(n)&&e.push(t.products[n].id);if(0===e.length)return!1}let r=!0;return i.forEach(function(e){if(t.hasOwnProperty(e.id)){for(let n in t)if(t.hasOwnProperty(n)&&n.toLowerCase()===e.id.toLowerCase()&&!this.doesSatisfyRule(t[n],e))return r=!1,!1}else r=!1}.bind(this)),r}isMultiTriggerPersonalization(e){return e?.settings?.hasOwnProperty("trigger_type")&&e?.settings?.trigger_delay?.length>0&&"pageload"!==e.settings.trigger_type}getProductFetchFields(e){var t=[];return e.forEach((function(e){-1!==["inventory","condition","availability","brand"].indexOf(e.id.toLowerCase())&&t.push(e.id.toLowerCase())})),t}doesSatisfyRule(e,t){switch(t.operator){case"equals":case"equal":return"date"===t.type?+new Date(e)==+new Date(t.value):e.toString().toLowerCase()===t.value.toString().toLowerCase();case"not_equals":case"not_equal":return e.toString().toLowerCase()!==t.value.toString().toLowerCase();case"contains":return e.toString().toLowerCase().indexOf(t.value.toString().toLowerCase())>-1;case"not_contains":return-1===e.toString().toLowerCase().indexOf(t.value.toString().toLowerCase());case"greater":return"date"===t.type?+new Date(e)>+new Date(t.value):parseFloat(e.toString())>parseFloat(t.value.toString());case"less":return"date"===t.type?+new Date(e)<+new Date(t.value):parseFloat(e.toString())1&&"sqzl_container"===e.id)return!1;null!==e.parentNode.parentNode&&e.parentNode.parentNode.removeChild(e.parentNode)})),this._settings.triggeredPersonalizations={};this._personalizationQueuedIfNoProductFound=[],this._handledPixelEvents=[]}enableStyles(e){var t=e.getElementsByTagName("style");if(t)for(var n=0;n0&&(o=s/1440)}i[e].c=r+1,i[e].ex=Math.round(this.getCurrentTime()/1e3)+86400*o,this.setCounterCookie(i)}getCurrentTime(){return(new Date).getTime()}getAndExtractCounterCookie(){const e=sqzlCommon.readCookie(this._settings.viewCountCookieName,!0,this._document,this._localStorage);if(!e||0===e.length)return{};try{let t=JSON.parse(e);const n=Math.round(this.getCurrentTime()/1e3);for(let e in t){const i=t[e];i.hasOwnProperty("ex")&&i.ex0)this._document.cookie.split(";").forEach(function(t){if((t=t.trim()).match(this._settings.disablePersonalizationCookieName)){let n=t.split("=")[0].split("_")[3];e.push(n)}}.bind(this))}catch(e){}return e}setCounterCookie(e){var t=this.getAndExtractCounterCookie(),n=Object.assign(t,e);sqzlCommon.createCookie(this._settings.viewCountCookieName,JSON.stringify(n),this._settings.viewCookieExpirationDays,!0,this._document,this._localStorage)}shouldShowCookie(){return"true"===sqzlCommon.getURLParameter("_sqzl_cookie")}initializeCookieModal(){this._sqzlModal=this._document.createElement("div"),this._sqzlModal.id="sqzlModal",Object.assign(this._sqzlModal.style,{display:"none",position:"fixed",left:"50%",top:"50%",transform:"translate(-50%, -50%)",zIndex:"1000",padding:"20px",backgroundColor:"white",border:"1px solid #ccc",boxShadow:"0 4px 6px rgba(0,0,0,0.1)",borderRadius:"8px",width:"300px"});const e=this._document.createElement("div"),t=this._document.createElement("span");t.id="sqzlCookieValue",e.textContent="Your Spotler Activate cookie: ",e.appendChild(t),Object.assign(e.style,{fontSize:"14px",marginBottom:"15px",color:"#333"});const n=this._document.createElement("button");n.textContent="Copy Cookie",Object.assign(n.style,{padding:"8px 16px",backgroundColor:"#007BFF",color:"white",border:"none",borderRadius:"5px",cursor:"pointer",fontSize:"14px",marginRight:"20px",marginBottom:"10px"}),n.addEventListener("click",(()=>{navigator.clipboard.writeText(t.textContent),n.style.backgroundColor="#6c757d",setTimeout((()=>{n.style.backgroundColor="#007BFF"}),100)}));const i=this._document.createElement("button");i.textContent="Close",Object.assign(i.style,{padding:"8px 16px",backgroundColor:"#ccc",color:"black",border:"none",borderRadius:"5px",cursor:"pointer",fontSize:"14px",marginBottom:"10px"}),i.addEventListener("click",(()=>{this._sqzlModal.style.display="none"}));const r=this._document.createElement("div");Object.assign(r.style,{display:"flex",justifyContent:"space-between"}),r.appendChild(n),r.appendChild(i),this._sqzlModal.appendChild(e),this._sqzlModal.appendChild(r),this._document.body.appendChild(this._sqzlModal)}showCookieModal(){const e=sqzlCommon.getConstants().sqzlMainCookieName,t=sqzlCommon.readCookie(e);this._document.getElementById("sqzlCookieValue").textContent=t||"No Spotler Activate cookie found.",this._sqzlModal.style.display="block"}}}},__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var n=__webpack_module_cache__[e]={exports:{}};return __webpack_modules__[e](n,n.exports,__webpack_require__),n.exports}__webpack_require__.d=function(e,t){for(var n in t)__webpack_require__.o(t,n)&&!__webpack_require__.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},__webpack_require__.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};var __webpack_exports__={};class SqzlCommon{g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}();#e="BHwc_L3DVi9GOKcmHiDsWNNHTLLDSNJ8DOqd2BONQESC9-9vB-IxSkRcixyD6TRb1aFRuHjKXbaP9Y0Ib84Th60";#t={sqzlMainCookieName:"sqzllocal",consentCookieName:"sqzl_consent",debugCookieName:"sqzl_debug",consentTypes:["analytics","marketing"],anonymousConsent:["analytics"]};#n="undefined"!=typeof sqzlConsentManagementEnabled&&!0===sqzlConsentManagementEnabled;#i={};lozad=null;imgObserver=null;#r=null;#o={debugLevel:null,anonymous:!1,consent:this.#n?[]:this.#t.consentTypes};#s="undefined"!=typeof sqzlUnitTest&&!0===sqzlUnitTest;#a={personalizationNames:[],variantNames:[]};#l=this.g;#c=this.g.document;#u="undefined"!=typeof Storage?this.#l.localStorage:null;#d={};nunjucks=null;constructor(){this.#l.sqzlCommon=this,this.g.sqzlException=this.sqzlException.bind(this);let e=this.#c.sqzlLoaderQ||[];for(let t=0;t0){var o=n.cookie.indexOf(e+"=");if(-1!==o){o=o+e.length+1;var s=n.cookie.indexOf(";",o);if(-1===s&&(s=n.cookie.length),r=decodeURIComponent(n.cookie.substring(o,s))){var a=this.getConfigItem("ignoreCookieValues");if(a)for(var l=0;l "+n+" => "+1e3*Math.round(24*n*60*60)),a.setTime(a.getTime()+1e3*Math.round(24*n*60*60)),s="; expires="+a.toGMTString()}else s="";var l=function(){for(var e=0,t=r.domain,n=t.split("."),i="_gd"+(new Date).getTime();e-1&&this.#o.consent.splice(i,1)}return this.setConsentCookie(),t}filterValidPermissions(e){var t=[];if("object"!=typeof e)return console.error("No valid permissions"),t;for(var n=0;n-1?t.push(e[n]):console.warn("Consent permission unknown ("+e[n]+")");return t}setConsent(e){return this.#o.consent=e}getConsent(){return this.#o.consent}hasAnalyticsConsent(e){return void 0===e&&(e=this.#o.consent),-1!==e.indexOf("analytics")&&(!this.#o.anonymous||-1!==this.getConstants().anonymousConsent.indexOf("analytics"))}hasMarketingConsent(e){return void 0===e&&(e=this.#o.consent),-1!==e.indexOf("marketing")&&(!this.#o.anonymous||-1!==this.getConstants().anonymousConsent.indexOf("marketing"))}intersect(e,t){return e.filter(Set.prototype.has,new Set(t))}uniqid(e){var t;return void 0===e&&(e=""),this.#i.uniqidSeed||(this.#i.uniqidSeed=Math.floor(123456789*Math.random())),this.#i.uniqidSeed++,t=e,t+=this.formatSeed(parseInt((new Date).getTime()/1e3,10),8),t+=this.formatSeed(this.#i.uniqidSeed,12)}uuidv4(){var e=(new Date).getTime(),t="undefined"!=typeof performance&&performance.now&&1e3*performance.now()||0;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(n){var i=16*Math.random();return e>0?(i=(e+i)%16|0,e=Math.floor(e/16)):(i=(t+i)%16|0,t=Math.floor(t/16)),("x"===n?i:3&i|8).toString(16)}))}formatSeed(e,t){return t<(e=parseInt(e,10).toString(16)).length?e.slice(e.length-t):t>e.length?Array(t-e.length+1).join("0")+e:e}serialize(e,t){let n,i=[];for(n in e)if(e.hasOwnProperty(n)){let r=t?t+"["+n+"]":n,o=e[n];i.push(null!==o&&"object"==typeof o?this.serialize(o,r):encodeURIComponent(r)+"="+encodeURIComponent(o))}return i.join("&")}initCommonFunctions(){try{(function(e,t){this.nunjucks=t()}).bind(this)("undefined"!=typeof self?self:this,(function(){return function(e){var t={};function n(i){if(t[i])return t[i].exports;var r=t[i]={i:i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:i})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=11)}([function(e,t,n){var i=Array.prototype,r=Object.prototype,o={"&":"&",'"':""","'":"'","<":"<",">":">"},s=/[&"'<>]/g;function a(e,t){return r.hasOwnProperty.call(e,t)}function l(e){return o[e]}function c(e,t,n){var i,r,o;if(e instanceof Error&&(e=(r=e).name+": "+r.message),Object.setPrototypeOf?Object.setPrototypeOf(i=Error(e),c.prototype):Object.defineProperty(i=this,"message",{enumerable:!1,writable:!0,value:e}),Object.defineProperty(i,"name",{value:"Template render error"}),Error.captureStackTrace&&Error.captureStackTrace(i,this.constructor),r){var s=Object.getOwnPropertyDescriptor(r,"stack");(o=s&&(s.get||function(){return s.value}))||(o=function(){return r.stack})}else{var a=Error(e).stack;o=function(){return a}}return Object.defineProperty(i,"stack",{get:function(){return o.call(i)}}),Object.defineProperty(i,"cause",{value:r}),i.lineno=t,i.colno=n,i.firstUpdate=!0,i.Update=function(e){var t="("+(e||"unknown path")+")";return this.firstUpdate&&(this.lineno&&this.colno?t+=" [Line "+this.lineno+", Column "+this.colno+"]":this.lineno&&(t+=" [Line "+this.lineno+"]")),t+="\n ",this.firstUpdate&&(t+=" "),this.message=t+(this.message||""),this.firstUpdate=!1,this},i}function u(e){return"[object Function]"===r.toString.call(e)}function d(e){return"[object Array]"===r.toString.call(e)}function h(e){return"[object String]"===r.toString.call(e)}function p(e){return"[object Object]"===r.toString.call(e)}function f(e){var t,n=(t=e)?"string"==typeof t?t.split("."):[t]:[];return function(e){for(var t=e,i=0;ie.length)s=r.slice(0,e.length),r.slice(s.length,c).forEach((function(e,n){n2?r-2:0),s=2;s0||!n)&&process.stdout.write(" ".repeat(t));var o=r===i.length-1?"":"\n";process.stdout.write(""+e+o)}))}e.exports={Node:l,Root:d,NodeList:u,Value:c,Literal:h,Symbol:p,Group:f,Array:g,Pair:m,Dict:v,Output:R,Capture:B,TemplateData:U,If:b,IfAsync:w,InlineIf:_,For:k,AsyncEach:C,AsyncAll:E,Macro:z,Caller:O,Import:q,FromImport:x,FunCall:T,Filter:P,FilterAsync:S,KeywordArgs:A,Block:D,Super:L,Extends:M,Include:N,Set:I,Switch:F,Case:j,LookupVal:y,BinOp:H,In:V,Is:W,Or:Y,And:G,Not:Q,Add:J,Concat:$,Sub:Z,Mul:X,Div:ee,FloorDiv:te,Mod:ne,Pow:ie,Neg:re,Pos:oe,Compare:se,CompareOperand:ae,CallExtension:le,CallExtensionAsync:ce,printNodes:function e(t,n){if(n=n||0,ue(t.typename+": ",n),t instanceof u)ue("\n"),t.children.forEach((function(t){e(t,n+2)}));else if(t instanceof le)ue(t.extName+"."+t.prop+"\n"),t.args&&e(t.args,n+2),t.contentArgs&&t.contentArgs.forEach((function(t){e(t,n+2)}));else{var i=[],r=null;t.iterFields((function(e,t){e instanceof l?i.push([t,e]):(r=r||{})[t]=e})),r?ue(JSON.stringify(r,null,2)+"\n",null,!0):ue("\n"),i.forEach((function(t){var i=t[0],r=t[1];ue("["+i+"] =>",n+2),e(r,n+4)}))}}}},function(e,t){},function(e,t,n){function i(e,t){return(i=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var r=n(8),o=n(17),s=n(3),a=n(0).TemplateError,l=n(2).Frame,c={"==":"==","===":"===","!=":"!=","!==":"!==","<":"<",">":">","<=":"<=",">=":">="},u=function(e){var t,n;function r(){return e.apply(this,arguments)||this}n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,i(t,n);var o=r.prototype;return o.init=function(e,t){this.templateName=e,this.codebuf=[],this.lastId=0,this.buffer=null,this.bufferStack=[],this.f="",this.inBlock=!1,this.throwOnUndefined=t},o.fail=function(e,t,n){throw void 0!==t&&(t+=1),void 0!==n&&(n+=1),new a(e,t,n)},o.a=function(){var e=this.v();return this.bufferStack.push(this.buffer),this.buffer=e,this.w("var "+this.buffer+' = "";'),e},o.b=function(){this.buffer=this.bufferStack.pop()},o.w=function(e){this.codebuf.push(e)},o.y=function(e){this.w(e+"\n")},o.g=function(){for(var e=this,t=arguments.length,n=Array(t),i=0;i0&&r.w(","),r.compile(e,t)})),i&&this.w(i)},o.L=function(e,t){this.assertType(e,s.Literal,s.Symbol,s.Group,s.Array,s.Dict,s.FunCall,s.Caller,s.Filter,s.LookupVal,s.Compare,s.InlineIf,s.In,s.Is,s.And,s.Or,s.Not,s.Add,s.Concat,s.Sub,s.Mul,s.Div,s.FloorDiv,s.Mod,s.Pow,s.Neg,s.Pos,s.Compare,s.NodeList),this.compile(e,t)},o.assertType=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),i=1;i0&&i.w(","),e){i.y("function(cb) {"),i.y("if(!cb) { cb = function(err) { if(err) { throw err; }}}");var r=i.a();i.T((function(){i.compile(e,t),i.y("cb(null, "+r+");")})),i.b(),i.y("return "+r+";"),i.y("}")}else i.w("null")})),n){var l=this.v();this.y(", "+this.j(l)),this.y(this.buffer+" += runtime.suppressValue("+l+", "+a+" && env.opts.autoescape);"),this.A()}else this.w(")"),this.w(", "+a+" && env.opts.autoescape);\n")},o.compileCallExtensionAsync=function(e,t){this.compileCallExtension(e,t,!0)},o.compileNodeList=function(e,t){this.N(e,t)},o.compileLiteral=function(e){if("string"==typeof e.value){var t=e.value.replace(/\\/g,"\\\\");t=(t=(t=(t=(t=t.replace(/"/g,'\\"')).replace(/\n/g,"\\n")).replace(/\r/g,"\\r")).replace(/\t/g,"\\t")).replace(/\u2028/g,"\\u2028"),this.w('"'+t+'"')}else null===e.value?this.w("null"):this.w(e.value.toString())},o.compileSymbol=function(e,t){var n=e.value,i=t.lookup(n);i?this.w(i):this.w('runtime.contextOrFrameLookup(context, frame, "'+n+'")')},o.compileGroup=function(e,t){this.S(e,t,"(",")")},o.compileArray=function(e,t){this.S(e,t,"[","]")},o.compileDict=function(e,t){this.S(e,t,"{","}")},o.compilePair=function(e,t){var n=e.key,i=e.value;n instanceof s.Symbol?n=new s.Literal(n.lineno,n.colno,n.value):n instanceof s.Literal&&"string"==typeof n.value||this.fail("compilePair: Dict keys must be strings or names",n.lineno,n.colno),this.compile(n,t),this.w(": "),this.L(i,t)},o.compileInlineIf=function(e,t){this.w("("),this.compile(e.cond,t),this.w("?"),this.compile(e.body,t),this.w(":"),null!==e.else_?this.compile(e.else_,t):this.w('""'),this.w(")")},o.compileIn=function(e,t){this.w("runtime.inOperator("),this.compile(e.left,t),this.w(","),this.compile(e.right,t),this.w(")")},o.compileIs=function(e,t){var n=e.right.name?e.right.name.value:e.right.value;this.w('env.getTest("'+n+'").call(context, '),this.compile(e.left,t),e.right.args&&(this.w(","),this.compile(e.right.args,t)),this.w(") === true")},o.F=function(e,t,n){this.compile(e.left,t),this.w(n),this.compile(e.right,t)},o.compileOr=function(e,t){return this.F(e,t," || ")},o.compileAnd=function(e,t){return this.F(e,t," && ")},o.compileAdd=function(e,t){return this.F(e,t," + ")},o.compileConcat=function(e,t){return this.F(e,t,' + "" + ')},o.compileSub=function(e,t){return this.F(e,t," - ")},o.compileMul=function(e,t){return this.F(e,t," * ")},o.compileDiv=function(e,t){return this.F(e,t," / ")},o.compileMod=function(e,t){return this.F(e,t," % ")},o.compileNot=function(e,t){this.w("!"),this.compile(e.target,t)},o.compileFloorDiv=function(e,t){this.w("Math.floor("),this.compile(e.left,t),this.w(" / "),this.compile(e.right,t),this.w(")")},o.compilePow=function(e,t){this.w("Math.pow("),this.compile(e.left,t),this.w(", "),this.compile(e.right,t),this.w(")")},o.compileNeg=function(e,t){this.w("-"),this.compile(e.target,t)},o.compilePos=function(e,t){this.w("+"),this.compile(e.target,t)},o.compileCompare=function(e,t){var n=this;this.compile(e.expr,t),e.ops.forEach((function(e){n.w(" "+c[e.type]+" "),n.compile(e.expr,t)}))},o.compileLookupVal=function(e,t){this.w("runtime.memberLookup(("),this.L(e.target,t),this.w("),"),this.L(e.val,t),this.w(")")},o.I=function(e){switch(e.typename){case"Symbol":return e.value;case"FunCall":return"the return value of ("+this.I(e.name)+")";case"LookupVal":return this.I(e.target)+'["'+this.I(e.val)+'"]';case"Literal":return e.value.toString();default:return"--expression--"}},o.compileFunCall=function(e,t){this.w("(lineno = "+e.lineno+", colno = "+e.colno+", "),this.w("runtime.callWrap("),this.L(e.name,t),this.w(', "'+this.I(e.name).replace(/"/g,'\\"')+'", context, '),this.S(e.args,t,"[","])"),this.w(")")},o.compileFilter=function(e,t){var n=e.name;this.assertType(n,s.Symbol),this.w('env.getFilter("'+n.value+'").call(context, '),this.S(e.args,t),this.w(")")},o.compileFilterAsync=function(e,t){var n=e.name,i=e.symbol.value;this.assertType(n,s.Symbol),t.set(i,i),this.w('env.getFilter("'+n.value+'").call(context, '),this.S(e.args,t),this.y(", "+this.j(i)),this.A()},o.compileKeywordArgs=function(e,t){this.w("runtime.makeKeywordArgs("),this.compileDict(e,t),this.w(")")},o.compileSet=function(e,t){var n=this,i=[];e.targets.forEach((function(e){var r=e.value,o=t.lookup(r);null!=o||(o=n.v(),n.y("var "+o+";")),i.push(o)})),e.value?(this.w(i.join(" = ")+" = "),this.L(e.value,t),this.y(";")):(this.w(i.join(" = ")+" = "),this.compile(e.body,t),this.y(";")),e.targets.forEach((function(e,t){var r=i[t],o=e.value;n.y('frame.set("'+o+'", '+r+", true);"),n.y("if(frame.topLevel) {"),n.y('context.setVariable("'+o+'", '+r+");"),n.y("}"),"_"!==o.charAt(0)&&(n.y("if(frame.topLevel) {"),n.y('context.addExport("'+o+'", '+r+");"),n.y("}"))}))},o.compileSwitch=function(e,t){var n=this;this.w("switch ("),this.compile(e.expr,t),this.w(") {"),e.cases.forEach((function(e,i){n.w("case "),n.compile(e.cond,t),n.w(": "),n.compile(e.body,t),e.body.children.length&&n.y("break;")})),e.default&&(this.w("default:"),this.compile(e.default,t)),this.w("}")},o.compileIf=function(e,t,n){var i=this;this.w("if("),this.L(e.cond,t),this.y(") {"),this.T((function(){i.compile(e.body,t),n&&i.w("cb()")})),e.else_?(this.y("}\nelse {"),this.T((function(){i.compile(e.else_,t),n&&i.w("cb()")}))):n&&(this.y("}\nelse {"),this.w("cb()")),this.y("}")},o.compileIfAsync=function(e,t){this.w("(function(cb) {"),this.compileIf(e,t,!0),this.w("})("+this.j()),this.A()},o.C=function(e,t,n,i){var r=this;[{name:"index",val:n+" + 1"},{name:"index0",val:n},{name:"revindex",val:i+" - "+n},{name:"revindex0",val:i+" - "+n+" - 1"},{name:"first",val:n+" === 0"},{name:"last",val:n+" === "+i+" - 1"},{name:"length",val:i}].forEach((function(e){r.y('frame.set("loop.'+e.name+'", '+e.val+");")}))},o.compileFor=function(e,t){var n=this,i=this.v(),r=this.v(),o=this.v();if(t=t.push(),this.y("frame = frame.push();"),this.w("var "+o+" = "),this.L(e.arr,t),this.y(";"),this.w("if("+o+") {"),this.y(o+" = runtime.fromIterator("+o+");"),e.name instanceof s.Array){this.y("var "+i+";"),this.y("if(runtime.isArray("+o+")) {"),this.y("var "+r+" = "+o+".length;"),this.y("for("+i+"=0; "+i+" < "+o+".length; "+i+"++) {"),e.name.children.forEach((function(r,s){var a=n.v();n.y("var "+a+" = "+o+"["+i+"]["+s+"];"),n.y('frame.set("'+r+'", '+o+"["+i+"]["+s+"]);"),t.set(e.name.children[s].value,a)})),this.C(e,o,i,r),this.T((function(){n.compile(e.body,t)})),this.y("}"),this.y("} else {");var a=e.name.children,l=a[0],c=a[1],u=this.v(),d=this.v();t.set(l.value,u),t.set(c.value,d),this.y(i+" = -1;"),this.y("var "+r+" = runtime.keys("+o+").length;"),this.y("for(var "+u+" in "+o+") {"),this.y(i+"++;"),this.y("var "+d+" = "+o+"["+u+"];"),this.y('frame.set("'+l.value+'", '+u+");"),this.y('frame.set("'+c.value+'", '+d+");"),this.C(e,o,i,r),this.T((function(){n.compile(e.body,t)})),this.y("}"),this.y("}")}else{var h=this.v();t.set(e.name.value,h),this.y("var "+r+" = "+o+".length;"),this.y("for(var "+i+"=0; "+i+" < "+o+".length; "+i+"++) {"),this.y("var "+h+" = "+o+"["+i+"];"),this.y('frame.set("'+e.name.value+'", '+h+");"),this.C(e,o,i,r),this.T((function(){n.compile(e.body,t)})),this.y("}")}this.y("}"),e.else_&&(this.y("if (!"+r+") {"),this.compile(e.else_,t),this.y("}")),this.y("frame = frame.pop();")},o.R=function(e,t,n){var i=this,r=this.v(),o=this.v(),a=this.v(),l=n?"asyncAll":"asyncEach";if(t=t.push(),this.y("frame = frame.push();"),this.w("var "+a+" = runtime.fromIterator("),this.L(e.arr,t),this.y(");"),e.name instanceof s.Array){var c=e.name.children.length;this.w("runtime."+l+"("+a+", "+c+", function("),e.name.children.forEach((function(e){i.w(e.value+",")})),this.w(r+","+o+",next) {"),e.name.children.forEach((function(e){var n=e.value;t.set(n,n),i.y('frame.set("'+n+'", '+n+");")}))}else{var u=e.name.value;this.y("runtime."+l+"("+a+", 1, function("+u+", "+r+", "+o+",next) {"),this.y('frame.set("'+u+'", '+u+");"),t.set(u,u)}this.C(e,a,r,o),this.T((function(){var o;n&&(o=i.a()),i.compile(e.body,t),i.y("next("+r+(o?","+o:"")+");"),n&&i.b()}));var d=this.v();this.y("}, "+this.j(d)),this.A(),n&&this.y(this.buffer+" += "+d+";"),e.else_&&(this.y("if (!"+a+".length) {"),this.compile(e.else_,t),this.y("}")),this.y("frame = frame.pop();")},o.compileAsyncEach=function(e,t){this.R(e,t)},o.compileAsyncAll=function(e,t){this.R(e,t,!0)},o.K=function(e,t){var n=this,i=[],r=null,o="macro_"+this.v(),a=void 0!==t;e.args.children.forEach((function(t,o){o===e.args.children.length-1&&t instanceof s.Dict?r=t:(n.assertType(t,s.Symbol),i.push(t))}));var c,u=[].concat(i.map((function(e){return"l_"+e.value})),["kwargs"]),d=i.map((function(e){return'"'+e.value+'"'})),h=(r&&r.children||[]).map((function(e){return'"'+e.key.value+'"'}));c=a?t.push(!0):new l,this.g("var "+o+" = runtime.makeMacro(","["+d.join(", ")+"], ","["+h.join(", ")+"], ","function ("+u.join(", ")+") {","var callerFrame = frame;","frame = "+(a?"frame.push(true);":"new runtime.Frame();"),"kwargs = kwargs || {};",'if (Object.prototype.hasOwnProperty.call(kwargs, "caller")) {','frame.set("caller", kwargs.caller); }'),i.forEach((function(e){n.y('frame.set("'+e.value+'", l_'+e.value+");"),c.set(e.value,"l_"+e.value)})),r&&r.children.forEach((function(e){var t=e.key.value;n.w('frame.set("'+t+'", '),n.w('Object.prototype.hasOwnProperty.call(kwargs, "'+t+'")'),n.w(' ? kwargs["'+t+'"] : '),n.L(e.value,c),n.w(");")}));var p=this.a();return this.T((function(){n.compile(e.body,c)})),this.y("frame = "+(a?"frame.pop();":"callerFrame;")),this.y("return new runtime.SafeString("+p+");"),this.y("});"),this.b(),o},o.compileMacro=function(e,t){var n=this.K(e),i=e.name.value;t.set(i,n),t.parent?this.y('frame.set("'+i+'", '+n+");"):("_"!==e.name.value.charAt(0)&&this.y('context.addExport("'+i+'");'),this.y('context.setVariable("'+i+'", '+n+");"))},o.compileCaller=function(e,t){this.w("(function (){");var n=this.K(e,t);this.w("return "+n+";})()")},o.M=function(e,t,n,i){var r=this.v(),o=this._(),s=this.j(r),a=n?"true":"false",l=i?"true":"false";return this.w("env.getTemplate("),this.L(e.template,t),this.y(", "+a+", "+o+", "+l+", "+s),r},o.compileImport=function(e,t){var n=e.target.value,i=this.M(e,t,!1,!1);this.A(),this.y(i+".getExported("+(e.withContext?"context.getVariables(), frame, ":"")+this.j(i)),this.A(),t.set(n,i),t.parent?this.y('frame.set("'+n+'", '+i+");"):this.y('context.setVariable("'+n+'", '+i+");")},o.compileFromImport=function(e,t){var n=this,i=this.M(e,t,!1,!1);this.A(),this.y(i+".getExported("+(e.withContext?"context.getVariables(), frame, ":"")+this.j(i)),this.A(),e.names.children.forEach((function(e){var r,o,a=n.v();e instanceof s.Pair?(r=e.key.value,o=e.value.value):o=r=e.value,n.y("if(Object.prototype.hasOwnProperty.call("+i+', "'+r+'")) {'),n.y("var "+a+" = "+i+"."+r+";"),n.y("} else {"),n.y("cb(new Error(\"cannot import '"+r+"'\")); return;"),n.y("}"),t.set(o,a),t.parent?n.y('frame.set("'+o+'", '+a+");"):n.y('context.setVariable("'+o+'", '+a+");")}))},o.compileBlock=function(e){var t=this.v();this.inBlock||this.w('(parentTemplate ? function(e, c, f, r, cb) { cb(""); } : '),this.w('context.getBlock("'+e.name.value+'")'),this.inBlock||this.w(")"),this.y("(env, context, frame, runtime, "+this.j(t)),this.y(this.buffer+" += "+t+";"),this.A()},o.compileSuper=function(e,t){var n=e.blockName.value,i=e.symbol.value,r=this.j(i);this.y('context.getSuper(env, "'+n+'", b_'+n+", frame, runtime, "+r),this.y(i+" = runtime.markSafe("+i+");"),this.A(),t.set(i,i)},o.compileExtends=function(e,t){var n=this.v(),i=this.M(e,t,!0,!1);this.y("parentTemplate = "+i),this.y("for(var "+n+" in parentTemplate.blocks) {"),this.y("context.addBlock("+n+", parentTemplate.blocks["+n+"]);"),this.y("}"),this.A()},o.compileInclude=function(e,t){this.y("var tasks = [];"),this.y("tasks.push("),this.y("function(callback) {");var n=this.M(e,t,!1,e.ignoreMissing);this.y("callback(null,"+n+");});"),this.y("});");var i=this.v();this.y("tasks.push("),this.y("function(template, callback){"),this.y("template.render(context.getVariables(), frame, "+this.j(i)),this.y("callback(null,"+i+");});"),this.y("});"),this.y("tasks.push("),this.y("function(result, callback){"),this.y(this.buffer+" += result;"),this.y("callback(null);"),this.y("});"),this.y("env.waterfall(tasks, function(){"),this.A()},o.compileTemplateData=function(e,t){this.compileLiteral(e,t)},o.compileCapture=function(e,t){var n=this,i=this.buffer;this.buffer="output",this.y("(function() {"),this.y('var output = "";'),this.T((function(){n.compile(e.body,t)})),this.y("return output;"),this.y("})()"),this.buffer=i},o.compileOutput=function(e,t){var n=this;e.children.forEach((function(i){i instanceof s.TemplateData?i.value&&(n.w(n.buffer+" += "),n.compileLiteral(i,t),n.y(";")):(n.w(n.buffer+" += runtime.suppressValue("),n.throwOnUndefined&&n.w("runtime.ensureDefined("),n.compile(i,t),n.throwOnUndefined&&n.w(","+e.lineno+","+e.colno+")"),n.w(", env.opts.autoescape);\n"))}))},o.compileRoot=function(e,t){var n=this;t&&this.fail("compileRoot: root node can't have frame"),t=new l,this.k(e,"root"),this.y("var parentTemplate = null;"),this.N(e,t),this.y("if(parentTemplate) {"),this.y("parentTemplate.rootRenderFunc(env, context, frame, runtime, cb);"),this.y("} else {"),this.y("cb(null, "+this.buffer+");"),this.y("}"),this.x(!0),this.inBlock=!0;var i=[],r=e.findAll(s.Block);r.forEach((function(e,t){var r=e.name.value;if(-1!==i.indexOf(r))throw Error('Block "'+r+'" defined more than once.');i.push(r),n.k(e,"b_"+r);var o=new l;n.y("var frame = frame.push(true);"),n.compile(e.body,o),n.x()})),this.y("return {"),r.forEach((function(e,t){var i="b_"+e.name.value;n.y(i+": "+i+",")})),this.y("root: root\n};")},o.compile=function(e,t){var n=this["compile"+e.typename];n?n.call(this,e,t):this.fail("compile: Cannot compile node: "+e.typename,e.lineno,e.colno)},o.getCode=function(){return this.codebuf.join("")},r}(n(1).Obj);e.exports={compile:function(e,t,n,i,s){void 0===s&&(s={});var a=new u(i,s.throwOnUndefined),l=(n||[]).map((function(e){return e.preprocess})).filter((function(e){return!!e})).reduce((function(e,t){return t(e)}),e);return a.compile(o.transform(r.parse(l,n,s),t,i)),a.getCode()},Compiler:u}},function(e,t,n){function i(e,t){return(i=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var r=n(4),o=n(1).EmitterObj;e.exports=function(e){var t,n;function o(){return e.apply(this,arguments)||this}n=e,(t=o).prototype=Object.create(n.prototype),t.prototype.constructor=t,i(t,n);var s=o.prototype;return s.resolve=function(e,t){return r.resolve(r.dirname(e),t)},s.isRelative=function(e){return 0===e.indexOf("./")||0===e.indexOf("../")},o}(o)},function(e,t,n){function i(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,r(e,t)}function r(e,t){return(r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var o=n(12),s=n(15),a=n(0),l=n(5),c=n(18),u=n(10),d=u.FileSystemLoader,h=u.WebLoader,p=u.PrecompiledLoader,f=n(20),g=n(21),m=n(1),v=m.Obj,y=m.EmitterObj,b=n(2),w=b.handleError,_=b.Frame,k=n(22);function C(e,t,n){o((function(){e(t,n)}))}var E={type:"code",obj:{root:function(e,t,n,i,r){try{r(null,"")}catch(e){r(w(e,null,null))}}}},z=function(e){function t(){return e.apply(this,arguments)||this}i(t,e);var n=t.prototype;return n.init=function(e,t){var n=this;t=this.opts=t||{},this.opts.dev=!!t.dev,this.opts.autoescape=null==t.autoescape||t.autoescape,this.opts.throwOnUndefined=!!t.throwOnUndefined,this.opts.trimBlocks=!!t.trimBlocks,this.opts.lstripBlocks=!!t.lstripBlocks,this.loaders=[],e?this.loaders=a.isArray(e)?e:[e]:d?this.loaders=[new d("views")]:h&&(this.loaders=[new h("/views")]),"undefined"!=typeof window&&window.nunjucksPrecompiled&&this.loaders.unshift(new p(window.nunjucksPrecompiled)),this.P(),this.globals=g(),this.filters={},this.tests={},this.asyncFilters=[],this.extensions={},this.extensionsList=[],a.r(c).forEach((function(e){var t=e[0],i=e[1];return n.addFilter(t,i)})),a.r(f).forEach((function(e){var t=e[0],i=e[1];return n.addTest(t,i)}))},n.P=function(){var e=this;this.loaders.forEach((function(t){t.cache={},"function"==typeof t.on&&(t.on("update",(function(n,i){t.cache[n]=null,e.emit("update",n,i,t)})),t.on("load",(function(n,i){e.emit("load",n,i,t)})))}))},n.invalidateCache=function(){this.loaders.forEach((function(e){e.cache={}}))},n.addExtension=function(e,t){return t.__name=e,this.extensions[e]=t,this.extensionsList.push(t),this},n.removeExtension=function(e){var t=this.getExtension(e);t&&(this.extensionsList=a.without(this.extensionsList,t),delete this.extensions[e])},n.getExtension=function(e){return this.extensions[e]},n.hasExtension=function(e){return!!this.extensions[e]},n.addGlobal=function(e,t){return this.globals[e]=t,this},n.getGlobal=function(e){if(void 0===this.globals[e])throw Error("global not found: "+e);return this.globals[e]},n.addFilter=function(e,t,n){var i=t;return n&&this.asyncFilters.push(e),this.filters[e]=i,this},n.getFilter=function(e){if(!this.filters[e])throw Error("filter not found: "+e);return this.filters[e]},n.addTest=function(e,t){return this.tests[e]=t,this},n.getTest=function(e){if(!this.tests[e])throw Error("test not found: "+e);return this.tests[e]},n.resolveTemplate=function(e,t,n){return e.isRelative&&t&&e.isRelative(n)&&e.resolve?e.resolve(t,n):n},n.getTemplate=function(e,t,n,i,r){var o,s=this,l=this,c=null;if(e&&e.raw&&(e=e.raw),a.isFunction(n)&&(r=n,n=null,t=t||!1),a.isFunction(t)&&(r=t,t=!1),e instanceof q)c=e;else{if("string"!=typeof e)throw Error("template names must be a string: "+e);for(var u=0;u0&&!this.skip(r.TOKEN_COMMA)&&this.fail("parseFrom: expected comma",e.lineno,e.colno);var a=this.parsePrimary();if("_"===a.value.charAt(0)&&this.fail("parseFrom: names starting with an underscore cannot be imported",a.lineno,a.colno),this.skipSymbol("as")){var l=this.parsePrimary();i.addChild(new o.Pair(a.lineno,a.colno,a,l))}else i.addChild(a);n=this.parseWithContext()}return new o.FromImport(e.lineno,e.colno,t,i,n)},l.parseBlock=function(){var e=this.peekToken();this.skipSymbol("block")||this.fail("parseBlock: expected block",e.lineno,e.colno);var t=new o.Block(e.lineno,e.colno);t.name=this.parsePrimary(),t.name instanceof o.Symbol||this.fail("parseBlock: variable name expected",e.lineno,e.colno),this.advanceAfterBlockEnd(e.value),t.body=this.parseUntilBlocks("endblock"),this.skipSymbol("endblock"),this.skipSymbol(t.name.value);var n=this.peekToken();return n||this.fail("parseBlock: expected endblock, got end of file"),this.advanceAfterBlockEnd(n.value),t},l.parseExtends=function(){var e=this.peekToken();this.skipSymbol("extends")||this.fail("parseTemplateRef: expected extends");var t=new o.Extends(e.lineno,e.colno);return t.template=this.parseExpression(),this.advanceAfterBlockEnd(e.value),t},l.parseInclude=function(){var e=this.peekToken();this.skipSymbol("include")||this.fail("parseInclude: expected include");var t=new o.Include(e.lineno,e.colno);return t.template=this.parseExpression(),this.skipSymbol("ignore")&&this.skipSymbol("missing")&&(t.ignoreMissing=!0),this.advanceAfterBlockEnd(e.value),t},l.parseIf=function(){var e,t=this.peekToken();this.skipSymbol("if")||this.skipSymbol("elif")||this.skipSymbol("elseif")?e=new o.If(t.lineno,t.colno):this.skipSymbol("ifAsync")?e=new o.IfAsync(t.lineno,t.colno):this.fail("parseIf: expected if, elif, or elseif",t.lineno,t.colno),e.cond=this.parseExpression(),this.advanceAfterBlockEnd(t.value),e.body=this.parseUntilBlocks("elif","elseif","else","endif");var n=this.peekToken();switch(n&&n.value){case"elseif":case"elif":e.else_=this.parseIf();break;case"else":this.advanceAfterBlockEnd(),e.else_=this.parseUntilBlocks("endif"),this.advanceAfterBlockEnd();break;case"endif":e.else_=null,this.advanceAfterBlockEnd();break;default:this.fail("parseIf: expected elif, else, or endif, got end of file")}return e},l.parseSet=function(){var e=this.peekToken();this.skipSymbol("set")||this.fail("parseSet: expected set",e.lineno,e.colno);for(var t,n=new o.Set(e.lineno,e.colno,[]);(t=this.parsePrimary())&&(n.targets.push(t),this.skip(r.TOKEN_COMMA)););return this.skipValue(r.TOKEN_OPERATOR,"=")?(n.value=this.parseExpression(),this.advanceAfterBlockEnd(e.value)):this.skip(r.TOKEN_BLOCK_END)?(n.body=new o.Capture(e.lineno,e.colno,this.parseUntilBlocks("endset")),n.value=null,this.advanceAfterBlockEnd()):this.fail("parseSet: expected = or block end in set tag",e.lineno,e.colno),n},l.parseSwitch=function(){var e=this.peekToken();this.skipSymbol("switch")||this.skipSymbol("case")||this.skipSymbol("default")||this.fail('parseSwitch: expected "switch," "case" or "default"',e.lineno,e.colno);var t=this.parseExpression();this.advanceAfterBlockEnd("switch"),this.parseUntilBlocks("case","default","endswitch");var n,i=this.peekToken(),r=[];do{this.skipSymbol("case");var s=this.parseExpression();this.advanceAfterBlockEnd("switch");var a=this.parseUntilBlocks("case","default","endswitch");r.push(new o.Case(i.line,i.col,s,a)),i=this.peekToken()}while(i&&"case"===i.value);switch(i.value){case"default":this.advanceAfterBlockEnd(),n=this.parseUntilBlocks("endswitch"),this.advanceAfterBlockEnd();break;case"endswitch":this.advanceAfterBlockEnd();break;default:this.fail('parseSwitch: expected "case," "default" or "endswitch," got EOF.')}return new o.Switch(e.lineno,e.colno,t,r,n)},l.parseStatement=function(){var e=this.peekToken();if(e.type!==r.TOKEN_SYMBOL&&this.fail("tag name expected",e.lineno,e.colno),this.breakOnBlocks&&-1!==a.indexOf(this.breakOnBlocks,e.value))return null;switch(e.value){case"raw":return this.parseRaw();case"verbatim":return this.parseRaw("verbatim");case"if":case"ifAsync":return this.parseIf();case"for":case"asyncEach":case"asyncAll":return this.parseFor();case"block":return this.parseBlock();case"extends":return this.parseExtends();case"include":return this.parseInclude();case"set":return this.parseSet();case"macro":return this.parseMacro();case"call":return this.parseCall();case"import":return this.parseImport();case"from":return this.parseFrom();case"filter":return this.parseFilterStatement();case"switch":return this.parseSwitch();default:if(this.extensions.length)for(var t=0;t0;){var l=s[0],c=s[1],u=s[2];u===e?i+=1:u===t&&(i-=1),0===i?(r+=c,this.tokens.backN(l.length-c.length)):r+=l}return new o.Output(a.lineno,a.colno,[new o.TemplateData(a.lineno,a.colno,r)])},l.parsePostfix=function(e){for(var t,n=this.peekToken();n;){if(n.type===r.TOKEN_LEFT_PAREN)e=new o.FunCall(n.lineno,n.colno,e,this.parseSignature());else if(n.type===r.TOKEN_LEFT_BRACKET)(t=this.parseAggregate()).children.length>1&&this.fail("invalid index"),e=new o.LookupVal(n.lineno,n.colno,e,t.children[0]);else{if(n.type!==r.TOKEN_OPERATOR||"."!==n.value)break;this.nextToken();var i=this.nextToken();i.type!==r.TOKEN_SYMBOL&&this.fail("expected name as lookup value, got "+i.value,i.lineno,i.colno),t=new o.Literal(i.lineno,i.colno,i.value),e=new o.LookupVal(n.lineno,n.colno,e,t)}n=this.peekToken()}return e},l.parseExpression=function(){return this.parseInlineIf()},l.parseInlineIf=function(){var e=this.parseOr();if(this.skipSymbol("if")){var t=this.parseOr(),n=e;(e=new o.InlineIf(e.lineno,e.colno)).body=n,e.cond=t,this.skipSymbol("else")?e.else_=this.parseOr():e.else_=null}return e},l.parseOr=function(){for(var e=this.parseAnd();this.skipSymbol("or");){var t=this.parseAnd();e=new o.Or(e.lineno,e.colno,e,t)}return e},l.parseAnd=function(){for(var e=this.parseNot();this.skipSymbol("and");){var t=this.parseNot();e=new o.And(e.lineno,e.colno,e,t)}return e},l.parseNot=function(){var e=this.peekToken();return this.skipSymbol("not")?new o.Not(e.lineno,e.colno,this.parseNot()):this.parseIn()},l.parseIn=function(){for(var e=this.parseIs();;){var t=this.nextToken();if(!t)break;var n=t.type===r.TOKEN_SYMBOL&&"not"===t.value;if(n||this.pushToken(t),!this.skipSymbol("in")){n&&this.pushToken(t);break}var i=this.parseIs();e=new o.In(e.lineno,e.colno,e,i),n&&(e=new o.Not(e.lineno,e.colno,e))}return e},l.parseIs=function(){var e=this.parseCompare();if(this.skipSymbol("is")){var t=this.skipSymbol("not"),n=this.parseCompare();e=new o.Is(e.lineno,e.colno,e,n),t&&(e=new o.Not(e.lineno,e.colno,e))}return e},l.parseCompare=function(){for(var e=["==","===","!=","!==","<",">","<=",">="],t=this.parseConcat(),n=[];;){var i=this.nextToken();if(!i)break;if(-1===e.indexOf(i.value)){this.pushToken(i);break}n.push(new o.CompareOperand(i.lineno,i.colno,this.parseConcat(),i.value))}return n.length?new o.Compare(n[0].lineno,n[0].colno,t,n):t},l.parseConcat=function(){for(var e=this.parseAdd();this.skipValue(r.TOKEN_TILDE,"~");){var t=this.parseAdd();e=new o.Concat(e.lineno,e.colno,e,t)}return e},l.parseAdd=function(){for(var e=this.parseSub();this.skipValue(r.TOKEN_OPERATOR,"+");){var t=this.parseSub();e=new o.Add(e.lineno,e.colno,e,t)}return e},l.parseSub=function(){for(var e=this.parseMul();this.skipValue(r.TOKEN_OPERATOR,"-");){var t=this.parseMul();e=new o.Sub(e.lineno,e.colno,e,t)}return e},l.parseMul=function(){for(var e=this.parseDiv();this.skipValue(r.TOKEN_OPERATOR,"*");){var t=this.parseDiv();e=new o.Mul(e.lineno,e.colno,e,t)}return e},l.parseDiv=function(){for(var e=this.parseFloorDiv();this.skipValue(r.TOKEN_OPERATOR,"/");){var t=this.parseFloorDiv();e=new o.Div(e.lineno,e.colno,e,t)}return e},l.parseFloorDiv=function(){for(var e=this.parseMod();this.skipValue(r.TOKEN_OPERATOR,"//");){var t=this.parseMod();e=new o.FloorDiv(e.lineno,e.colno,e,t)}return e},l.parseMod=function(){for(var e=this.parsePow();this.skipValue(r.TOKEN_OPERATOR,"%");){var t=this.parsePow();e=new o.Mod(e.lineno,e.colno,e,t)}return e},l.parsePow=function(){for(var e=this.parseUnary();this.skipValue(r.TOKEN_OPERATOR,"**");){var t=this.parseUnary();e=new o.Pow(e.lineno,e.colno,e,t)}return e},l.parseUnary=function(e){var t,n=this.peekToken();return t=this.skipValue(r.TOKEN_OPERATOR,"-")?new o.Neg(n.lineno,n.colno,this.parseUnary(!0)):this.skipValue(r.TOKEN_OPERATOR,"+")?new o.Pos(n.lineno,n.colno,this.parseUnary(!0)):this.parsePrimary(),e||(t=this.parseFilter(t)),t},l.parsePrimary=function(e){var t,n=this.nextToken(),i=null;if(n?n.type===r.TOKEN_STRING?t=n.value:n.type===r.TOKEN_INT?t=parseInt(n.value,10):n.type===r.TOKEN_FLOAT?t=parseFloat(n.value):n.type===r.TOKEN_BOOLEAN?"true"===n.value?t=!0:"false"===n.value?t=!1:this.fail("invalid boolean: "+n.value,n.lineno,n.colno):n.type===r.TOKEN_NONE?t=null:n.type===r.TOKEN_REGEX&&(t=RegExp(n.value.body,n.value.flags)):this.fail("expected expression, got end of file"),void 0!==t?i=new o.Literal(n.lineno,n.colno,t):n.type===r.TOKEN_SYMBOL?i=new o.Symbol(n.lineno,n.colno,n.value):(this.pushToken(n),i=this.parseAggregate()),e||(i=this.parsePostfix(i)),i)return i;throw this.error("unexpected token: "+n.value,n.lineno,n.colno)},l.parseFilterName=function(){for(var e=this.expect(r.TOKEN_SYMBOL),t=e.value;this.skipValue(r.TOKEN_OPERATOR,".");)t+="."+this.expect(r.TOKEN_SYMBOL).value;return new o.Symbol(e.lineno,e.colno,t)},l.parseFilterArgs=function(e){return this.peekToken().type===r.TOKEN_LEFT_PAREN?this.parsePostfix(e).args.children:[]},l.parseFilter=function(e){for(;this.skip(r.TOKEN_PIPE);){var t=this.parseFilterName();e=new o.Filter(t.lineno,t.colno,t,new o.NodeList(t.lineno,t.colno,[e].concat(this.parseFilterArgs(e))))}return e},l.parseFilterStatement=function(){var e=this.peekToken();this.skipSymbol("filter")||this.fail("parseFilterStatement: expected filter");var t=this.parseFilterName(),n=this.parseFilterArgs(t);this.advanceAfterBlockEnd(e.value);var i=new o.Capture(t.lineno,t.colno,this.parseUntilBlocks("endfilter"));this.advanceAfterBlockEnd();var r=new o.Filter(t.lineno,t.colno,t,new o.NodeList(t.lineno,t.colno,[i].concat(n)));return new o.Output(t.lineno,t.colno,[r])},l.parseAggregate=function(){var e,t=this.nextToken();switch(t.type){case r.TOKEN_LEFT_PAREN:e=new o.Group(t.lineno,t.colno);break;case r.TOKEN_LEFT_BRACKET:e=new o.Array(t.lineno,t.colno);break;case r.TOKEN_LEFT_CURLY:e=new o.Dict(t.lineno,t.colno);break;default:return null}for(;;){var n=this.peekToken().type;if(n===r.TOKEN_RIGHT_PAREN||n===r.TOKEN_RIGHT_BRACKET||n===r.TOKEN_RIGHT_CURLY){this.nextToken();break}if(e.children.length>0&&(this.skip(r.TOKEN_COMMA)||this.fail("parseAggregate: expected comma after expression",t.lineno,t.colno)),e instanceof o.Dict){var i=this.parsePrimary();this.skip(r.TOKEN_COLON)||this.fail("parseAggregate: expected colon after dict key",t.lineno,t.colno);var s=this.parseExpression();e.addChild(new o.Pair(i.lineno,i.colno,i,s))}else{var a=this.parseExpression();e.addChild(a)}}return e},l.parseSignature=function(e,t){var n=this.peekToken();if(!t&&n.type!==r.TOKEN_LEFT_PAREN){if(e)return null;this.fail("expected arguments",n.lineno,n.colno)}n.type===r.TOKEN_LEFT_PAREN&&(n=this.nextToken());for(var i=new o.NodeList(n.lineno,n.colno),s=new o.KeywordArgs(n.lineno,n.colno),a=!1;;){if(n=this.peekToken(),!t&&n.type===r.TOKEN_RIGHT_PAREN){this.nextToken();break}if(t&&n.type===r.TOKEN_BLOCK_END)break;if(a&&!this.skip(r.TOKEN_COMMA))this.fail("parseSignature: expected comma after expression",n.lineno,n.colno);else{var l=this.parseExpression();this.skipValue(r.TOKEN_OPERATOR,"=")?s.addChild(new o.Pair(l.lineno,l.colno,l,this.parseExpression())):i.addChild(l)}a=!0}return s.children.length&&i.addChild(s),i},l.parseUntilBlocks=function(){for(var e=this.breakOnBlocks,t=arguments.length,n=Array(t),i=0;i=!".indexOf(o)){this.forward();var c,u=["==","===","!=","!==","<=",">=","//","**"],d=o+this.current();switch(-1!==i.indexOf(u,d)&&(this.forward(),o=d,-1!==i.indexOf(u,d+this.current())&&(o=d+this.current(),this.forward())),o){case"(":c="left-paren";break;case")":c="right-paren";break;case"[":c="left-bracket";break;case"]":c="right-bracket";break;case"{":c="left-curly";break;case"}":c="right-curly";break;case",":c="comma";break;case":":c="colon";break;case"~":c="tilde";break;case"|":c="pipe";break;default:c="operator"}return r(c,o,t,n)}if((e=this.W(" \n\t\r ()[]{}%*-+~/#,:|.<>=!")).match(/^[-+]?[0-9]+$/))return"."===this.current()?(this.forward(),r("float",e+"."+this.$("0123456789"),t,n)):r("int",e,t,n);if(e.match(/^(true|false)$/))return r("boolean",e,t,n);if("none"===e)return r("none",e,t,n);if("null"===e)return r("none",e,t,n);if(e)return r("symbol",e,t,n);throw Error("Unexpected value while parsing: "+e)}var h,p=this.tags.BLOCK_START.charAt(0)+this.tags.VARIABLE_START.charAt(0)+this.tags.COMMENT_START.charAt(0)+this.tags.COMMENT_END.charAt(0);if(this.isFinished())return null;if((e=this.G(this.tags.BLOCK_START+"-"))||(e=this.G(this.tags.BLOCK_START)))return this.in_code=!0,r("block-start",e,t,n);if((e=this.G(this.tags.VARIABLE_START+"-"))||(e=this.G(this.tags.VARIABLE_START)))return this.in_code=!0,r("variable-start",e,t,n);e="";var f=!1;for(this.H(this.tags.COMMENT_START)&&(f=!0,e=this.G(this.tags.COMMENT_START));null!==(h=this.W(p));){if(e+=h,(this.H(this.tags.BLOCK_START)||this.H(this.tags.VARIABLE_START)||this.H(this.tags.COMMENT_START))&&!f){if(this.lstripBlocks&&this.H(this.tags.BLOCK_START)&&this.colno>0&&this.colno<=e.length){var g=e.slice(-this.colno);if(/^\s+$/.test(g)&&!(e=e.slice(0,-this.colno)).length)return this.nextToken()}break}if(this.H(this.tags.COMMENT_END)){if(!f)throw Error("unexpected end of comment");e+=this.G(this.tags.COMMENT_END);break}e+=this.current(),this.forward()}if(null===h&&f)throw Error("expected end of comment, got end of file");return r(f?"comment":"data",e,t,n)},t.U=function(e){this.forward();for(var t="";!this.isFinished()&&this.current()!==e;){var n=this.current();if("\\"===n){switch(this.forward(),this.current()){case"n":t+="\n";break;case"t":t+="\t";break;case"r":t+="\r";break;default:t+=this.current()}this.forward()}else t+=n,this.forward()}return this.forward(),t},t.H=function(e){return this.index+e.length>this.len?null:this.str.slice(this.index,this.index+e.length)===e},t.G=function(e){return this.H(e)?(this.forwardN(e.length),e):null},t.W=function(e){return this.J(!0,e||"")},t.$=function(e){return this.J(!1,e)},t.J=function(e,t){if(this.isFinished())return null;var n=t.indexOf(this.current());if(e&&-1===n||!e&&-1!==n){var i=this.current();this.forward();for(var r=t.indexOf(this.current());(e&&-1===r||!e&&-1!==r)&&!this.isFinished();)i+=this.current(),this.forward(),r=t.indexOf(this.current());return i}return""},t.D=function(e){var t=this.currentStr().match(e);return t?(this.forwardN(t[0].length),t):null},t.isFinished=function(){return this.index>=this.len},t.forwardN=function(e){for(var t=0;t1024){for(var t=0,n=r.length-o;t0&&s.length>r&&!s.warned){s.warned=!0;var a=Error("Possible EventEmitter memory leak detected. "+s.length+" "+t+" listeners added. Use emitter.setMaxListeners() to increase limit");a.name="MaxListenersExceededWarning",a.emitter=e,a.type=t,a.count=s.length,console&&console.warn&&console.warn(a)}return e}function h(e,t,n){var i={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},r=function(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}.bind(i);return r.listener=n,i.wrapFn=r,r}function p(e,t,n){var i=e.z;if(void 0===i)return[];var r=i[t];return void 0===r?[]:"function"==typeof r?n?[r.listener||r]:[r]:n?function(e){for(var t=Array(e.length),n=0;n0&&(s=t[0]),s instanceof Error)throw s;var a=Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var l=r[e];if(void 0===l)return!1;if("function"==typeof l)o(l,this,t);else{var c=l.length,u=g(l,c);for(n=0;n=0;o--)if(n[o]===t||n[o].listener===t){s=n[o].listener,r=o;break}if(r<0)return this;0===r?n.shift():function(e,t){for(;t+1=0;i--)this.removeListener(e,t[i]);return this},a.prototype.listeners=function(e){return p(this,e,!0)},a.prototype.rawListeners=function(e){return p(this,e,!1)},a.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):f.call(e,t)},a.prototype.listenerCount=f,a.prototype.eventNames=function(){return this.Y>0?i(this.z):[]}},function(e,t,n){var i=n(3),r=n(0),o=0;function s(){return"hole_"+o++}function a(e,t){for(var n=null,i=0;i=t)return e;var n=t-e.length,s=i.repeat(" ",n/2-n%2),a=i.repeat(" ",n/2);return r.copySafeness(e,s+e+a)},t.default=function(e,t,n){return n?e||t:void 0!==e?e:t},t.dictsort=function(e,t,n){if(!i.isObject(e))throw new i.TemplateError("dictsort filter: val must be an object");var r,o=[];for(var s in e)o.push([s,e[s]]);if(void 0===n||"key"===n)r=0;else{if("value"!==n)throw new i.TemplateError("dictsort filter: You can only sort by either key or value");r=1}return o.sort((function(e,n){var o=e[r],s=n[r];return t||(i.isString(o)&&(o=o.toUpperCase()),i.isString(s)&&(s=s.toUpperCase())),o>s?1:o===s?0:-1})),o},t.dump=function(e,t){return JSON.stringify(e,null,t)},t.escape=function(e){return e instanceof r.SafeString?e:(e=null==e?"":e,r.markSafe(i.escape(e.toString())))},t.safe=function(e){return e instanceof r.SafeString?e:(e=null==e?"":e,r.markSafe(e.toString()))},t.first=function(e){return e[0]},t.forceescape=function(e){return e=null==e?"":e,r.markSafe(i.escape(e.toString()))},t.groupby=function(e,t){return i.groupBy(e,t,this.env.opts.throwOnUndefined)},t.indent=function(e,t,n){if(""===(e=o(e,"")))return"";t=t||4;var s=e.split("\n"),a=i.repeat(" ",t),l=s.map((function(e,t){return 0!==t||n?""+a+e:e})).join("\n");return r.copySafeness(e,l)},t.join=function(e,t,n){return t=t||"",n&&(e=i.map(e,(function(e){return e[n]}))),e.join(t)},t.last=function(e){return e[e.length-1]},t.length=function(e){var t=o(e,"");return void 0!==t?"function"==typeof Map&&t instanceof Map||"function"==typeof Set&&t instanceof Set?t.size:!i.isObject(t)||t instanceof r.SafeString?t.length:i.keys(t).length:0},t.list=l,t.lower=function(e){return(e=o(e,"")).toLowerCase()},t.nl2br=function(e){return null==e?"":r.copySafeness(e,e.replace(/\r\n|\n/g,"
\n"))},t.random=function(e){return e[Math.floor(Math.random()*e.length)]},t.reject=c(!1),t.rejectattr=function(e,t){return e.filter((function(e){return!e[t]}))},t.select=c(!0),t.selectattr=function(e,t){return e.filter((function(e){return!!e[t]}))},t.replace=function(e,t,n,i){var o=e;if(t instanceof RegExp)return e.replace(t,n);void 0===i&&(i=-1);var s="";if("number"==typeof t)t=""+t;else if("string"!=typeof t)return e;if("number"==typeof e&&(e=""+e),"string"!=typeof e&&!(e instanceof r.SafeString))return e;if(""===t)return s=n+e.split("").join(n)+n,r.copySafeness(e,s);var a=e.indexOf(t);if(0===i||-1===a)return e;for(var l=0,c=0;a>-1&&(-1===i||c=r&&u.push(n),o.push(u)}return o},t.sum=function(e,t,n){return void 0===n&&(n=0),t&&(e=i.map(e,(function(e){return e[t]}))),n+e.reduce((function(e,t){return e+t}),0)},t.sort=r.makeMacro(["value","reverse","case_sensitive","attribute"],[],(function(e,t,n,r){var o=this,s=i.map(e,(function(e){return e})),a=i.getAttrGetter(r);return s.sort((function(e,s){var l=r?a(e):e,c=r?a(s):s;if(o.env.opts.throwOnUndefined&&r&&(void 0===l||void 0===c))throw new TypeError('sort: attribute "'+r+'" resolved to undefined');return!n&&i.isString(l)&&i.isString(c)&&(l=l.toLowerCase(),c=c.toLowerCase()),lc?t?-1:1:0})),s})),t.string=function(e){return r.copySafeness(e,e)},t.striptags=function(e,t){var n,i=u((e=o(e,"")).replace(/<\/?([a-z][a-z0-9]*)\b[^>]*>|/gi,""));return n=t?i.replace(/^ +| +$/gm,"").replace(/ +/g," ").replace(/(\r\n)/g,"\n").replace(/\n\n\n+/g,"\n\n"):i.replace(/\s+/gi," "),r.copySafeness(e,n)},t.title=function(e){var t=(e=o(e,"")).split(" ").map((function(e){return a(e)}));return r.copySafeness(e,t.join(" "))},t.trim=u,t.truncate=function(e,t,n,i){var s=e;if(t=t||255,(e=o(e,"")).length<=t)return e;if(n)e=e.substring(0,t);else{var a=e.lastIndexOf(" ",t);-1===a&&(a=t),e=e.substring(0,a)}return e+=null!=i?i:"...",r.copySafeness(s,e)},t.upper=function(e){return(e=o(e,"")).toUpperCase()},t.urlencode=function(e){var t=encodeURIComponent;return i.isString(e)?t(e):(i.isArray(e)?e:i.r(e)).map((function(e){var n=e[0],i=e[1];return t(n)+"="+t(i)})).join("&")};var d=/^(?:\(|<|<)?(.*?)(?:\.|,|\)|\n|>)?$/,h=/^[\w.!#$%&'*+\-\/=?\^`{|}~]+@[a-z\d\-]+(\.[a-z\d\-]+)+$/i,p=/^https?:\/\/.*$/,f=/^www\./,g=/\.(?:org|net|com)(?:\:|\/|$)/;t.urlize=function(e,t,n){s(t)&&(t=1/0);var i=!0===n?' rel="nofollow"':"";return e.split(/(\s+)/).filter((function(e){return e&&e.length})).map((function(e){var n=e.match(d),r=n?n[1]:e,o=r.substr(0,t);return p.test(r)?'"+o+"":f.test(r)?'"+o+"":h.test(r)?''+r+"":g.test(r)?'"+o+"":e})).join("")},t.wordcount=function(e){var t=(e=o(e,""))?e.match(/\w+/g):null;return t?t.length:null},t.float=function(e,t){var n=parseFloat(e);return s(n)?t:n};var m=r.makeMacro(["value","default","base"],[],(function(e,t,n){void 0===n&&(n=10);var i=parseInt(e,n);return s(i)?t:i}));t.int=m,t.d=t.default,t.e=t.escape},function(e,t,n){function i(e,t){return(i=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var r=function(e){var t,n;function r(t){var n;return(n=e.call(this)||this).precompiled=t||{},n}return n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,i(t,n),r.prototype.getSource=function(e){return this.precompiled[e]?{src:{type:"code",obj:this.precompiled[e]},path:e}:null},r}(n(6));e.exports={PrecompiledLoader:r}},function(e,t,n){var i=n(2).SafeString;t.callable=function(e){return"function"==typeof e},t.defined=function(e){return void 0!==e},t.divisibleby=function(e,t){return e%t==0},t.escaped=function(e){return e instanceof i},t.equalto=function(e,t){return e===t},t.eq=t.equalto,t.sameas=t.equalto,t.even=function(e){return e%2==0},t.falsy=function(e){return!e},t.ge=function(e,t){return e>=t},t.greaterthan=function(e,t){return e>t},t.gt=t.greaterthan,t.le=function(e,t){return e<=t},t.lessthan=function(e,t){return e0)for(var r=e;rt;o+=n)i.push(o);return i},cycler:function(){return e=Array.prototype.slice.call(arguments),t=-1,{current:null,reset:function(){t=-1,this.current=null},next:function(){return++t>=e.length&&(t=0),this.current=e[t],this.current}};var e,t},joiner:function(e){return function(e){e=e||",";var t=!0;return function(){var n=t?"":e;return t=!1,n}}(e)}}}},function(e,t,n){var i=n(4);e.exports=function(e,t){function n(e,t){if(this.name=e,this.path=e,this.defaultEngine=t.defaultEngine,this.ext=i.extname(e),!this.ext&&!this.defaultEngine)throw Error("No default engine was specified and no extension was provided.");this.ext||(this.name+=this.ext=("."!==this.defaultEngine[0]?".":"")+this.defaultEngine)}return n.prototype.render=function(t,n){e.render(this.name,t,n)},t.set("view",n),t.set("nunjucksEnv",e),e}},function(e,t,n){var i=n(4),r=n(4),o=n(0).t,s=n(5),a=n(7).Environment,l=n(24);function c(e,t){return!!Array.isArray(t)&&t.some((function(t){return e.match(t)}))}function u(e,t){(t=t||{}).isString=!0;var n=t.env||new a([]),i=t.wrapper||l;if(!t.name)throw Error('the "name" option is required when compiling a string');return i([d(e,t.name,n)],t)}function d(e,t,n){var i,r=(n=n||new a([])).asyncFilters,l=n.extensionsList;t=t.replace(/\\/g,"/");try{i=s.compile(e,r,l,t,n.opts)}catch(e){throw o(t,!1,e)}return{name:t,template:i}}e.exports={precompile:function(e,t){var n=(t=t||{}).env||new a([]),o=t.wrapper||l;if(t.isString)return u(e,t);var s=i.existsSync(e)&&i.statSync(e),h=[],p=[];if(s.isFile())h.push(d(i.readFileSync(e,"utf-8"),t.name||e,n));else if(s.isDirectory()){!function n(o){i.readdirSync(o).forEach((function(s){var a=r.join(o,s),l=a.substr(r.join(e,"/").length),u=i.statSync(a);u&&u.isDirectory()?c(l+="/",t.exclude)||n(a):c(l,t.include)&&p.push(a)}))}(e);for(var f=0;f=this.length||e<0)throw Error("KeyError");return this.splice(e,1)},append:function(e){return this.push(e)},remove:function(e){for(var t=0;te.length||r>0&&s>=i||r<0&&s<=i);s+=r)o.push(n.memberLookup(e,s));return o}.apply(this,arguments):(e=e||{},i.isArray(e)&&h(p,t)?p[t].bind(e):i.isObject(e)&&h(f,t)?f[t].bind(e):c.apply(this,arguments))},function(){n.contextOrFrameLookup=l,n.memberLookup=c,r&&(r.prototype.assertType=e),o&&(o.prototype.parseAggregate=t)}}}])}))}catch(e){}try{this.lozad=function(){var e="undefined"!=typeof document&&document.documentMode,t={rootMargin:"0px",threshold:0,load:function(t){if("picture"===t.nodeName.toLowerCase()){var n=t.querySelector("img"),i=!1;null===n&&(n=document.createElement("img"),i=!0),e&&t.getAttribute("data-iesrc")&&(n.src=t.getAttribute("data-iesrc")),t.getAttribute("data-alt")&&(n.alt=t.getAttribute("data-alt")),i&&t.append(n)}if("video"===t.nodeName.toLowerCase()&&!t.getAttribute("data-src")&&t.children){for(var r=t.children,o=void 0,s=0;s<=r.length-1;s++)(o=r[s].getAttribute("data-src"))&&(r[s].src=o);t.load()}t.getAttribute("data-poster")&&(t.poster=t.getAttribute("data-poster")),t.getAttribute("data-src")&&(t.src=t.getAttribute("data-src")),t.getAttribute("data-srcset")&&t.setAttribute("srcset",t.getAttribute("data-srcset"));var a=",";if(t.getAttribute("data-background-delimiter")&&(a=t.getAttribute("data-background-delimiter")),t.getAttribute("data-background-image"))t.style.backgroundImage="url('"+t.getAttribute("data-background-image").split(a).join("'),url('")+"')";else if(t.getAttribute("data-background-image-set")){var l=t.getAttribute("data-background-image-set").split(a),c=l[0].substr(0,l[0].indexOf(" "))||l[0];c=-1===c.indexOf("url(")?"url("+c+")":c,1===l.length?t.style.backgroundImage=c:t.setAttribute("style",(t.getAttribute("style")||"")+"background-image: "+c+"; background-image: -webkit-image-set("+l+"); background-image: image-set("+l+")")}t.getAttribute("data-toggle-class")&&t.classList.toggle(t.getAttribute("data-toggle-class"))},loaded:function(){}};function n(e){e.setAttribute("data-loaded",!0)}var i=function(e){return"true"===e.getAttribute("data-loaded")},r=function(e){var t=1-1&&navigator.userAgent&&-1===navigator.userAgent.indexOf("CriOS")&&-1===navigator.userAgent.indexOf("FxiOS");return"serviceWorker"in navigator&&"PushManager"in window&&"Notification"in window&&!e}registerServiceWorker(e){var t=!1,n=!1;e=void 0===e||e,navigator.serviceWorker.getRegistrations().then((function(e){e.forEach((function(e){e.active&&null!==e.active.scriptURL.match(/pwa_services_worker\.js/)&&(t=!0),e.active&&null!==e.active.scriptURL.match(/squeezely-worker\.js/)&&(n=!0)}))})),t||n&&!e||navigator.serviceWorker.register("/squeezely-worker.js",{updateViaCache:"all"}).then((function(e){e.update()}),(function(e){console.log("Service worker registration failed:",e)}))}createNotificationSubscription(){return navigator.serviceWorker.ready.then(function(e){return e.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:this.#p(this.#e)}).then(function(e){var t=e.getKey("p256dh"),n=e.getKey("auth"),i=(PushManager.supportedContentEncodings||["aesgcm"])[0];return this.g._sqzl.push({event:"SubscriptionUpdate",web_push_token:{action:"subscribe",endpoint:e.endpoint,public_key:t?btoa(String.fromCharCode.apply(null,new Uint8Array(t))):null,auth_token:n?btoa(String.fromCharCode.apply(null,new Uint8Array(n))):null,content_encoding:i}}),e}.bind(this)).catch(function(e){"denied"===Notification.permission&&this.g._sqzl.push({event:"SubscriptionUpdate",web_push_token:{action:"unsubscribe"}})}.bind(this))}.bind(this))}#p(e){for(var t=(e+"=".repeat((4-e.length%4)%4)).replace(/\-/g,"+").replace(/_/g,"/"),n=window.atob(t),i=new Uint8Array(n.length),r=0;r=t.trackWidth),i=(t.opt.rewind||(t.arrows.prev&&(t.arrows.prev.classList.toggle("disabled",t.ele.scrollLeft<=0||n),t.arrows.prev.setAttribute("aria-disabled",t.arrows.prev.classList.contains("disabled"))),t.arrows.next&&(t.arrows.next.classList.toggle("disabled",Math.ceil(t.ele.scrollLeft+t.containerWidth)>=Math.floor(t.trackWidth)||n),t.arrows.next.setAttribute("aria-disabled",t.arrows.next.classList.contains("disabled")))),t.slide=Math.round(t.ele.scrollLeft/t.itemWidth),t.page=Math.round(t.ele.scrollLeft/t.containerWidth),t.slide+Math.floor(Math.floor(t.opt.slidesToShow)/2)),r=Math.floor(t.opt.slidesToShow)%2?0:i+1;1===Math.floor(t.opt.slidesToShow)&&(r=0),t.ele.scrollLeft+t.containerWidth>=Math.floor(t.trackWidth)&&(t.page=t.dots?t.dots.children.length-1:0),[].forEach.call(t.slides,(function(e,n){var o=e.classList,s=(e=o.contains("visible"),t.ele.scrollLeft),a=t.ele.scrollLeft+t.containerWidth,l=(c=t.itemWidth*n)+t.itemWidth,c=([].forEach.call(o,(function(e){/^left|right/.test(e)&&o.remove(e)})),o.toggle("active",t.slide===n),i===n||r&&r===n?o.add("center"):(o.remove("center"),o.add([n=Math.floor(s)&&Math.floor(l)<=Math.ceil(a));o.toggle("visible",c),c!==e&&t.emit("slide-"+(c?"visible":"hidden"),{slide:n})})),t.dots&&[].forEach.call(t.dots.children,(function(e,n){e.classList.toggle("active",t.page===n)})),e&&t.opt.scrollLock&&(clearTimeout(t.scrollLock),t.scrollLock=setTimeout((function(){clearTimeout(t.scrollLock),.02t.containerWidth+t.ele.scrollLeft&&t.scrollItem(t.getCurrentSlide()))}),t.opt.scrollLockDelay||250))},n.getCurrentSlide=function(){return this.round(this.ele.scrollLeft/this.itemWidth)},n.scrollItem=function(e,t,n){n&&n.preventDefault();var i,r=this,o=e,s=(++r.animate_id,n=r.slide,!0===t?(e=Math.round(e*r.containerWidth/r.itemWidth))*r.itemWidth:("string"==typeof e&&(s="prev"===e,e=r.opt.slidesToScroll%1||r.opt.slidesToShow%1?r.getCurrentSlide():r.slide,s?e-=r.opt.slidesToScroll:e+=r.opt.slidesToScroll,r.opt.rewind&&(i=r.ele.scrollLeft,e=s&&!i?r.slides.length:!s&&i+r.containerWidth>=Math.floor(r.trackWidth)?0:e)),e=Math.max(Math.min(e,r.slides.length),0),r.slide=e,r.itemWidth*e));return r.emit("scroll-item",{prevSlide:n,slide:e}),r.scrollTo(s,r.opt.duration*Math.abs(r.ele.scrollLeft-s),(function(){r.updateControls(),r.emit("animated",{value:o,type:"string"==typeof o?"arrow":t?"dot":"slide"})})),!1},n.settingsBreakpoint=function(){var t=this,n=t._opt.responsive;if(n){n.sort((function(e,t){return t.breakpoint-e.breakpoint}));for(var i=0;i=r.breakpoint)return t.breakpoint!==r.breakpoint&&(t.opt=Object.assign({},t._opt,r.settings),t.breakpoint=r.breakpoint,!0)}}var o=0!==t.breakpoint;return t.opt=Object.assign({},t._opt),t.breakpoint=0,o},n.scrollTo=function(t,n,i){var r=this,o=(new Date).getTime(),s=r.animate_id,a=function(){var l=(new Date).getTime()-o;r.ele.scrollLeft=r.ele.scrollLeft+(t-r.ele.scrollLeft)*r.opt.easing(0,l,0,1,n),l0)||this.isDefined(e[n[0]],n.slice(1).join(".")))}getURLParameter(e){return"string"==typeof e&&decodeURIComponent((new RegExp("[?|&]"+e+"=([^&;]+?)(&|#|;|$)","i").exec(location.search)||[null,""])[1].replace(/\+/g,"%20"))||null}addPersonalizationName(e,t){this.#a.personalizationNames[e]=t}addVariantName(e,t){this.#a.variantNames[e]=t}getPersonalizationName(e){return this.#a.personalizationNames[e]}getVariantName(e){return this.#a.variantNames[e]}mobileDetect=class{_userAgent="";_userAgentData=null;constructor(e,t){this._userAgent=e||null,this._userAgentData=t||null}mobile(){let e=!1;return null!==this._userAgentData&&void 0!==this._userAgentData.mobile&&(e=this._userAgentData?.mobile),e||[/Android/i,/webOS/i,/iPhone/i,/iPad/i,/iPod/i,/BlackBerry/i,/Windows Phone/i].some(function(e){return this._userAgent.match(e)}.bind(this))}isBot(){return null!==this._userAgent&&null!==this._userAgent.match(/Googlebot|facebookexternalhit|Google-AMPHTML|s~amp-validator|AdsBot-Google|Google Keyword Suggestion|Facebot|YandexBot|YandexMobileBot|bingbot|ia_archiver|AhrefsBot|Ezooms|GSLFbot|WBSearchBot|Twitterbot|TweetmemeBot|Twikle|PaperLiBot|Wotbox|UnwindFetchor|Exabot|MJ12bot|YandexImages|TurnitinBot|Pingdom|contentkingapp|AspiegelBot/)}};getUserAgent(){return navigator.userAgent||navigator.vendor||window.opera}isMobileBrowser(e){if(void 0!==e&&e||(e=this.getUserAgent()),e){return new this.mobileDetect(e).mobile()}return!1}appendElementToPage(e){this.g.document.body&&"function"==typeof this.g.document.body.appendChild?this.g.document.body.appendChild(e):e instanceof HTMLScriptElement&&this.g.document.head&&"function"==typeof this.g.document.head.appendChild?this.g.document.head.appendChild(e):this.g.document.lastChild.appendChild(e)}}class SqzlTransmit{#f="undefined"!=typeof sqzlUnitTest;g=null;url="https://t.squeezely.tech/t";dynamicBaseUrl="https://squeezely.tech";rawEventTracking=!1;googleConversionId=!1;googleConversionLabel=!1;urlCustomFields=!1;createdCookie=!1;fbPixelInited=!1;constants={mainCookieName:"sqzllocal",sessionCookieName:"sqzl_session_id",piiFields:{},gaSupportedCurrencies:{USD:!0,AED:!0,ARS:!0,AUD:!0,BGN:!0,BOB:!0,BRL:!0,CAD:!0,CHF:!0,CLP:!0,CNY:!0,COP:!0,CZK:!0,DKK:!0,EGP:!0,EUR:!0,FRF:!0,GBP:!0,HKD:!0,HRK:!0,HUF:!0,IDR:!0,ILS:!0,INR:!0,JPY:!0,KRW:!0,LTL:!0,MAD:!0,MXN:!0,MYR:!0,NOK:!0,NZD:!0,PEN:!0,PHP:!0,PKR:!0,PLN:!0,RON:!0,RSD:!0,RUB:!0,SAR:!0,SEK:!0,SGD:!0,THB:!0,TRY:!0,TWD:!0,UAH:!0,VEF:!0,VND:!0,ZAR:!0}};settings={useSSL:"https:"===document.location.protocol,anonymous:!1,sessionId:"",ga:{gaObject:null,categoryName:"SqueezelyEvent",trackerName:"sqzlGaTracker",ua:"",events:{}},ga4:{events:{},passPersonalizationNames:!1}};state={sessionEventHandled:!1,dataLayerEventsLoaded:!1,gtagLoaded:{},gaLoaded:{initialized:!1,enabled:!1},gptLoaded:{initialized:!1}};trackerEnabled=!0;capiMerchant=!1;smartTrackingEnabled=!1;merchantCurrency=!1;duplicateEventTracker=[];eventCallbacks=[];eventCallbacksFired=[];metaEventForwardingFilterEnabled=!1;metaEventForwardingEventFilter=[];constructor(){sqzlCommon.g.sqzlTransmit=this,this.g=sqzlCommon.g,this.g.sqzl=this.g.sqzl||[],this.g.sqzl.q=this.g.sqzl.q||[],this.g.sqzl.p=this.g.sqzl.p||[],this.g.dataLayer=this.g.dataLayer||[],this.settings.ga.gaObject=this.g.GoogleAnalyticsObject||"ga"}getConstants(){return this.constants}init(){this.bindErrorHandler();var e=sqzlCommon.getConfigItem.bind(sqzlCommon),t=e("sqzlDynamicBaseUrl"),n=e("sqzlTrackingUrl");t&&(this.dynamicBaseUrl=t),n&&(this.url=n),this.rawEventTracking=e("sqzlRawEventTracking",!1),this.trackerEnabled=e("sqzlTrackerEnabled",!0),this.capiMerchant=e("sqzlCapiMerchant",!1),this.smartTrackingEnabled=e("sqzlSmartTracking",!1),this.merchantCurrency=e("merchant_currency","EUR"),this.constants.piiFields=e("sqzlPiiFields",{}),this.urlCustomFields=e("sqzlUrlCustomFields",!1),this.googleConversionId=e("sqzlGoogleConversionId",!1),this.googleConversionLabel=e("sqzlGoogleConversionLabel",!1),this.metaEventFilterEnabled=e("sqzlMetaEventFilterEnabled",!1),this.metaEventFilter=e("sqzlMetaEventFilter",[]),sqzlCommon.hasConsentManagementEnabled()&&sqzlCommon.getDebugLevel()&&console.log("sqzly: Consent management enabled, setting default consent to none"),this.trackerEnabled&&(sqzlCommon.readConsentCookie(),this.addPersonalizationCallback(),this.addSqzlListeners(),this.checkSqzl()),this.g.sqzl.q.push([{ExecuteConsentCallback:this.loadDsps,has:["marketing"]}]),this.loadSooqr(),this.loadDataLayer(!0)}bindErrorHandler(){try{if(Element.prototype.addEventListener){let e=function(e){"string"==typeof e.filename&&""!==e.filename&&e.filename.match(/SQ-2565/)&&sqzlCommon.sqzlException(e)}.bind(this);this.g.addEventListener("error",e)}}catch(e){}}checkSqzl(){if(this.trackerEnabled&&void 0!==this.g.sqzl&&void 0!==this.g.sqzl.q&&this.g.sqzl.q&&this.g.sqzl.q.length>0&&sqzlCommon.getConfigItem("sqzlAccount")){this.checkSession();var e=this.g.sqzl.q;this.SQZLOldQueueWatcher.resetItems();for(var t=!1,n=0;n0)&&(i.ExecuteConsentCallback.call(this),delete e[n]);else{var o=Object.assign({},i);try{if("object"==typeof i&&void 0!==i.anonymize){"number"!=typeof i.anonymize&&(i.anonymize=i.anonymize.toLowerCase()),sqzlCommon.setAnonymous("on"===i.anonymize||"yes"===i.anonymize||"enabled"===i.anonymize||"1"===i.anonymize||1===i.anonymize),delete e[n];continue}if("object"==typeof i&&void 0!==i.consent){var s={event:"Consent",user_interaction:!1,status:i.consent};i.hasOwnProperty("user_interaction")&&"boolean"==typeof i.user_interaction&&!0===i.user_interaction&&(s.user_interaction=!0),"object"!=typeof i.permissions&&"string"!=typeof i.permissions||void 0===i.permissions||("string"==typeof i.permissions&&(i.permissions=[i.permissions]),s.permissions=i.permissions),this.handleEvent.handleEvent(s),t=!0,delete e[n];continue}if(0===sqzlCommon.getConsent().length&&(!i.hasOwnProperty("event")||"RevokeConsentAnalytics"!==i.event&&"RevokeConsentMarketing"!==i.event))continue;if(this.isBlackListed(i))continue;var a=!0;"object"==typeof i&&i.hasOwnProperty("b253d5e8")&&(a=!1),i.cookie=this.getMainCookie(),i.merchantid=sqzlCommon.getConfigItem("sqzlAccount"),i.event=i.event?i.event.trim():"PageView",i.platform=this.getPlatform(i.platform),i.device=sqzlCommon.isMobileBrowser()?"mobile":"desktop",void 0===i.product_ids&&void 0!==i.products&&(i.product_ids=[],Array.isArray(i.products)||void 0===i.products.id?Array.isArray(i.products)&&i.products.forEach((function(e){void 0!==e.id&&i.product_ids.push("string"==typeof e.id?e.id.trim():e.id)})):i.product_ids.push("string"==typeof i.products.id?i.products.id.trim():i.products.id)),void 0===i.timestamp&&(i.timestamp=Math.round(+new Date/1e3));var l={};if(this.getURLParameter("utm_source")&&(l.utm_source=this.getURLParameter("utm_source")),this.getURLParameter("utm_campaign")&&(l.utm_campaign=this.getURLParameter("utm_campaign")),this.getURLParameter("sqzl_source")&&(l.sqzl_source=this.getURLParameter("sqzl_source")),this.getURLParameter("sqzl_campaign")&&(l.sqzl_campaign=this.getURLParameter("sqzl_campaign")),!this.getURLParameter("email")||void 0!==i.email_hash&&""!==i.email_hash||(l.email_hash=this.getURLParameter("email")),!this.getURLParameter("email_hash")||void 0!==i.email&&""!==i.email||void 0!==i.email_hash&&""!==i.email_hash||(l.email_hash=this.getURLParameter("email_hash")),this.getURLParameter("userid")&&(void 0===i.userid||""===i.userid?l.userid=this.getURLParameter("userid"):l.userid=i.userid),void 0!==i.user_id&&(l.userid=i.user_id),Object.assign(i,l),Object.assign(o,l),"Purchase"!==i.event&&"ViewContent"!==i.event&&"AddToCart"!==i.event||void 0!==i.currency||(i.currency=this.merchantCurrency),i.frontend_event_id=i.frontend_event_id||sqzlCommon.uniqid("sqfei"),"purchase"===i.event.toLowerCase()&&void 0!==i.orderid&&i.orderid&&(i.frontend_event_id=i.orderid),i.user_agent=this.getUserAgent(),i.fbp=sqzlCommon.readCookie("_fbp"),i.fbc=sqzlCommon.readCookie("_fbc"),sqzlCommon.isAnonymous()&&(i.aip=1),i.url||(i.url=this.g.location.href),i.session_id=this.settings.sessionId,this.urlCustomFields)for(var c in this.urlCustomFields)if(this.urlCustomFields.hasOwnProperty(c)){var u=this.urlCustomFields[c];!this.getURLParameter(u)||void 0!==i[u]&&""!==i[u]||(i[u]=this.getURLParameter(u))}if(i.merchantid){if(void 0===i.totalvalue&&void 0!==i.products){var d=0;Array.isArray(i.products)||void 0===i.products.price?Array.isArray(i.products)&&i.products.forEach((function(e){var t=1;void 0!==e.quantity&&e.quantity>0&&(t=e.quantity),void 0!==e.price&&(d+=e.price*t)})):d=i.products.price,d>0&&(i.totalvalue=d)}if(sqzlCommon.hasConsentManagementEnabled()?i.consent=sqzlCommon.getConsent().toString():i.consent="disabled","object"==typeof i&&(i=this.filterData(i),i=this.formatTravelData(i)),void 0!==i.checkin_date)try{localStorage.setItem("checkin_date",i.checkin_date)}catch(e){}if(void 0!==i.amount_nights)try{localStorage.setItem("amount_nights",i.amount_nights)}catch(e){}var h=this.isDuplicateEvent(i),p=!1,f=!1;h&&(p=!0),!this.capiMerchant&&this.rawEventTracking&&a&&(sqzlCommon.hasAnalyticsConsent()||sqzlCommon.hasMarketingConsent()||"RevokeConsentAnalytics"===i.event||"RevokeConsentMarketing"===i.event)&&(o=this.formatLogData(o))&&(f=o),!sqzlCommon.hasAnalyticsConsent()&&"RevokeConsentAnalytics"!==i.event&&"RevokeConsentMarketing"!==i.event||h||(sqzlCommon.isDebugEnabled()&&console.debug("sqzly: Loading analytics event",i),a&&(this.loadAws(i,f),"SessionStart"===i.event&&(sqzlCommon.createCookie(this.constants.sessionCookieName,i.session_id+"|"+Date.now()/1e3,1/48),this.cookieSync())),p=!0),h||i.hasOwnProperty("event")&&("RevokeConsentAnalytics"===i.event||"RevokeConsentMarketing"===i.event)||this.loadEventForward(i),i=this.parseCustomFields(i),!sqzlCommon.hasMarketingConsent()||i.hasOwnProperty("event")&&("RevokeConsentAnalytics"===i.event||"RevokeConsentMarketing"===i.event)||h||(sqzlCommon.isDebugEnabled()&&console.debug("sqzly: Loading marketing event",i),this.metaEventFilterEnabled&&!this.metaEventFilter.includes(i?.event)||this.loadFacebookPixel(i),this.loadGoogleGtag(i),this.loadFloodlight(i),p=!0),p&&delete e[n]}else console.warn("sqzly: Account id not set..")}catch(t){if(sqzlCommon.getDebugLevel()&&console.error("sqzly: EVENT ERROR",e[n]),this.g.hasOwnProperty("sqzlUnitTest"))throw t;sqzlCommon.sqzlException(t,i);var g="";i.hasOwnProperty("event")?g+=" "+i.event:i.hasOwnProperty("consent")&&(g+=" consent-"+i.consent),delete e[n],console.error("sqzly: failed to send event"+g,t)}}}e.length>0&&(e=e.filter((function(e){return void 0!==e})),this.g.sqzl.q=e.concat(this.g.sqzl.q),this.SQZLOldQueueWatcher.forceOverwritePush(),t&&this.checkSqzl())}"undefined"==typeof console||this.trackerEnabled||this.#f||console.warn("Squeezely tracker disabled. Please contact support@squeezely.tech")}checkSession(){if(this.capiMerchant)return!1;if(!this.state.sessionEventHandled){let e=null;const t=sqzlCommon.readCookie(this.constants.sessionCookieName);if(t){const n=t.split("|");e=n.length>1&&parseInt(n[1])>Date.now()/1e3-1800&&n[0]}return e||(e=sqzlCommon.uniqid(),this.settings.sessionId=e,this.state.sessionEventHandled=!0,this.g.sqzl.q.unshift([{event:"SessionStart"}])),this.settings.sessionId=e,this.state.sessionEventHandled=!0,this.checkedSession(!0)}return!1}checkedSession(e){return!0}filterData(e){return sqzlCommon.isAnonymous()&&(e=this.filterPiiData(e)),(e=this.filterPersonalizationStatisticsEventData(e)).hasOwnProperty("b253d5e8")&&delete e.b253d5e8,e}formatTravelData(e){if(void 0!==e.checkindate&&void 0===e.checkin_date&&(e.checkin_date=e.checkindate,delete e.checkindate),void 0!==e.checkoutdate&&void 0===e.checkout_date&&(e.checkout_date=e.checkoutdate,delete e.checkoutdate),void 0!==e.checkin_date&&isNaN(new Date(e.checkin_date.replace(/(\d{4}(-\d{2}){2})\s*(\d{2}(:\d{2}){1,2})/g,"$1T$3")).getDay())&&delete e.checkin_date,void 0!==e.checkout_date&&isNaN(new Date(e.checkout_date.replace(/(\d{4}(-\d{2}){2})\s*(\d{2}(:\d{2}){1,2})/g,"$1T$3")).getDay())&&delete e.checkout_date,void 0!==e.amount_nights&&isNaN(parseInt(e.amount_nights))&&delete e.amount_nights,void 0!==e.checkin_date&&void 0!==e.checkout_date&&void 0===e.amount_nights)e.amount_nights=Math.ceil(Math.abs(new Date(e.checkin_date)-new Date(e.checkout_date))/864e5);else if(void 0===e.checkin_date&&void 0!==e.checkout_date&&void 0!==e.amount_nights){var t=new Date(e.checkout_date);t.setDate(t.getDate()-e.amount_nights),e.checkin_date=this.dateToIso8601String(t)}return e}filterPiiData(e){for(var t in e)e.hasOwnProperty(t)&&(this.getConstants().piiFields.hasOwnProperty(t)&&delete e[t],this.getConstants().piiFields.hasOwnProperty(t.toLowerCase())&&delete e[t.toLowerCase()]);return e}emptyPiiData(e){for(var t in e)e.hasOwnProperty(t)&&(this.getConstants().piiFields.hasOwnProperty(t)&&(e[t]=""),this.getConstants().piiFields.hasOwnProperty(t.toLowerCase())&&(e[t.toLowerCase()]=""));return e}filterPersonalizationStatisticsEventData(e){return e.hasOwnProperty("event")&&"PersonalizationView"===e.event&&e.hasOwnProperty("products")&&delete e.products,e}grantConsent(e){sqzlCommon.hasConsentManagementEnabled()?(sqzlCommon.grantConsent(e),this.checkSqzl()):console.warn("Customer consent management is not yet enabled. Please enable it in Squeezely Settings")}revokeConsent(e,t){if(sqzlCommon.hasConsentManagementEnabled()){var n=sqzlCommon.revokeConsent(e);if("boolean"==typeof t&&!0===t)for(var i in n)if(n.hasOwnProperty(i))switch(n[i]){case"analytics":this.g.sqzl.q.push([{event:"RevokeConsentAnalytics"}]);break;case"marketing":this.g.sqzl.q.push([{event:"RevokeConsentMarketing"}]);break;default:console.error("sqzly: Unknown consentType ("+n[i]+")")}}else console.warn("Customer consent management is not yet enabled. Please enable it in Squeezely Settings")}isBlackListed(e,t){var n=[/appspot\.com/];void 0!==t&&t||(t=this.g.location.href||"");for(var i=0;i0&&(e+=365*parseInt(sqzlCommon.getConfigItem("sqzlCookieLifetimeYears"))),parseInt(sqzlCommon.getConfigItem("sqzlCookieLifetimeDays",0))>0&&(e+=parseInt(sqzlCommon.getConfigItem("sqzlCookieLifetimeDays"))),e=e>0?e:10957,sqzlCommon.createCookie(this.constants.mainCookieName,this.createdCookie,e)}return this.createdCookie}truncateProductToMaximumAmount(e){var t=50;return"Purchase"===e.event&&(t=100),e.hasOwnProperty("products")&&"object"==typeof e.products&&e.products.length>t&&(console.warn("Squeezely event contains too many products, only the first "+t+" products will be sent"),console.info("The Squeezely Purchase event supports a maximum of 100 products, any other event a maximum of 50"),e.products=e.products.slice(0,t),e.hasOwnProperty("product_ids")&&"object"==typeof e.product_ids&&e.product_ids.length>t&&(e.product_ids=e.product_ids.slice(0,t))),e}rewriteParametersLongToShort(e){var t={event:"e"};for(var n in t)if(e.hasOwnProperty(n)){var i=t[n],r=e[n];delete e[n],e="e"===i?Object.assign({[i]:r},e):Object.assign(e,{[i]:r})}return e}loadAws(e,t){e=this.truncateProductToMaximumAmount(e);var n=Object.assign({},e);if(t&&(n.hce_data=t),n=this.rewriteParametersLongToShort(n),!e.hasOwnProperty("event")||"ReloadPersonalization"!==e.event&&"PageReload"!==e.event){var i=this.g.document.createElement("img");i.src=this.url+"?"+sqzlCommon.serialize(n),i.height="1",i.width="1",i.style.position="fixed",i.style.bottom="0px",i.style.width="1px",i.style.height="1px",i.alt="",i.onload=function(){this.triggerCallback(e)}.bind(this),sqzlCommon.appendElementToPage(i)}else this.triggerCallback(e),this.loadDataLayer(!1)}triggerCallback(e){if(e.hasOwnProperty("log_id")&&this.eventCallbacksFired.hasOwnProperty(e.log_id))return!1;this.eventCallbacks.length>0&&this.eventCallbacks.forEach(function(t){t.hasOwnProperty("callbackFunction")&&(t.callbackFunction(e),e.hasOwnProperty("log_id")&&(this.eventCallbacksFired[e.log_id]=!0))}.bind(this)),void 0!==e.callback&&e.callback&&(e.callback(e),e.hasOwnProperty("log_id")&&(this.eventCallbacksFired[e.log_id]=!0))}formatLogData(e){return sqzlCommon.isAnonymous()&&(e=this.emptyPiiData(e)),{originalData:sqzlCommon.serialize(e,!1),isBot:this.isBot(),buildTime:sqzlCommon.getBuildTime()}}parseFacebookEvent(e){switch(e[0]){case"init":return sqzlCommon.setConfigItem("sqzlFbPixelId",e[1]),!1;case"track":e=Object.assign({event:e[1],raw_data:e[2],frontend_event_id:e[3].eventID},e[3]);break;case"trackSingle":case"trackSingleCustom":sqzlCommon.setConfigItem("sqzlFbPixelId",e[1]),e=Object.assign({event:e[2],raw_data:e[3],frontend_event_id:e[4].eventID},e[4])}return e}loadFacebookPixel(e){var t,n,i,r,o,s,a=e.event,l=sqzlCommon.getConfigItem("sqzlFbPixelId");if(l&&!this.capiMerchant){this.g.fbq||(t=this.g,n=document,i="script",t.fbq||(r=t.fbq=function(){r.callMethod?r.callMethod.apply(r,arguments):r.queue.push(arguments)},t._fbq||(t._fbq=r),r.push=r,r.loaded=!0,r.version="2.0",r.queue=[],(o=n.createElement(i)).async=!0,o.src="//connect.facebook.net/en_US/fbevents.js",(s=n.getElementsByTagName(i)[0]).parentNode.insertBefore(o,s))),this.fbPixelInited||(this.g.fbq("init",l,{external_id:this.getMainCookie()}),this.fbPixelInited=!0);var c={timestamp:e.timestamp,user_agent:e.user_agent};for(var u in e=this.parseCustomFields(e))e.hasOwnProperty(u)&&!c.hasOwnProperty(u)&&"email"!==u&&"email_hash"!==u&&"newsletter"!==u&&"userid"!==u&&"firstname"!==u&&"lastname"!==u&&"street"!==u&&"phone"!==u&&"postcode"!==u&&"consent"!==u&&"country"!==u&&"city"!==u&&"orderid"!==u&&"gender"!==u&&"birthdate"!==u&&"url"!==u&&(c[u]=e[u]);-1===["PersonalizationView","PersonalizationClick","PersonalizationClosed","Search"].indexOf(a)&&void 0!==e.totalvalue&&(c.value=e.totalvalue),c.content_type=void 0===e.content_type?"product":e.content_type,c.content_ids=[],void 0===e.category_id||"ViewCategory"!==a&&"ViewContent"!==a||("ViewCategory"===a?c.category_id=e.category_id:"ViewContent"===a&&(c.content_category=e.category_id)),void 0!==e.product_ids&&(c.content_ids=[].concat(e.product_ids)),void 0!==e.products&&Array.isArray(e.products)&&e.products.forEach((function(e){void 0!==e.parent_id&&(c.content_ids.push("string"==typeof e.parent_id?e.parent_id.trim():e.parent_id),c.content_type=["product","product_group"])})),void 0!==e.audience_ids&&e.audience_ids.length>0&&(c.audience_ids="-"+e.audience_ids.join("-")+"-");let d="trackSingleCustom";-1!==["AddPaymentInfo","AddToCart","AddToWishlist","CompleteRegistration","Contact","CustomizeProduct","Donate","InitiateCheckout","Lead","PageView","Purchase","Schedule","Search","StartTrial","SubmitApplication","Subscribe","ViewContent"].indexOf(a)&&(d="trackSingle"),this.g.fbq(d,l,a,c,{eventID:e.frontend_event_id})}}loadFloodlight(e){var t=sqzlCommon.getConfigItem("sqzlDCMAdvertiser"),n=sqzlCommon.getConfigItem("sqzlFloodlightVariableMap",{});if(t&&n){var i=";src="+t+";type="+sqzlCommon.getConfigItem("sqzlFloodlightActivityType")+";cat="+sqzlCommon.getConfigItem("sqzlFloodlightActivityCat");for(var r in void 0!==e.product_ids&&(e.content_ids=e.product_ids.join(",")),e)void 0!==n[r]&&(i+=";"+n[r].toLowerCase()+"="+encodeURIComponent(e[r]));var o=1e16*(Math.random()+""),s=this.g.document.createElement("div");sqzlCommon.appendElementToPage(s),s.setAttribute("id","DCLK_FLDiv"+o),s.style.position="absolute",s.style.top="0",s.style.left="0",s.style.width="1px",s.style.height="1px",s.style.display="none",s.innerHTML='';var a=sqzlCommon.getConfigItem("sqzlFloodlightSalesActivityType"),l=sqzlCommon.getConfigItem("sqzlFloodlightSalesActivityCat");if(void 0!==e.event&&"Purchase"===e.event&&void 0!==e.orderid&&e.orderid&&a&&l){var c=void 0!==e.products&&e.products.length?e.products.length:1,u="undefined"!==e.totalvalue?e.totalvalue:"";for(var d in i=";src="+t+";type="+a+";cat="+l+";qty="+c+";cost="+u,e)void 0!==n[d]&&(i+=";"+n[d].toLowerCase()+"="+encodeURIComponent(e[d]));var h=this.g.document.createElement("div");sqzlCommon.appendElementToPage(h),h.setAttribute("id","DCLK_FLDiv2"+o),h.style.position="absolute",h.style.top="0",h.style.left="0",h.style.width="1px",h.style.height="1px",h.style.display="none",h.innerHTML=''}}}loadGoogleGtag(e){let t=!1,n=e.event,i={ecomm_event:n},r=["utm_campaign","utm_source","sqzl_campaign","sqzl_source","keyword","currency","totalvalue","audience_ids"],o="",s="";this.#f||(i.ecomm_timestamp=e.timestamp);for(var a=0;a0&&-1!==p.indexOf(n)){let i=[];if(void 0!==e.product_ids)for(a=0;a-1&&(r.value=e.totalvalue,r.currency=e.currency),"ViewCategory"===n&&void 0!==e.category_id&&(r.item_list_id=e.category_id),"SqueezelyAudience"===n){var f="-";e.audience_ids.forEach((function(e){(f+e.toString()+"-").length>500?(r.audience_ids=f,f="-"):f+=e.toString()+"-"})),f.length>1&&(r.audience_ids=f)}"Purchase"===n&&(r.transaction_id=e.orderid),"PersonalizationView"!==n&&"PersonalizationClick"!==n||(r.personalization_id=e.personalization_id,r.personalization_variant_id=e.personalization_variant_id,r.control_variant=e.orderid,this.ga4PassPersonalizationNames()&&(r.personalization_name=sqzlCommon.getPersonalizationName(r.personalization_id),r.variant_name=sqzlCommon.getVariantName(r.personalization_variant_id)));let o={ViewContent:"view_item",ViewCategory:"view_item_list",AddToCart:"add_to_cart",RemoveFromCart:"remove_from_cart",InitiateCheckout:"begin_checkout",Purchase:"purchase",PersonalizationView:"PersonalizationView",PersonalizationClick:"PersonalizationClick",SqueezelyAudience:"SqueezelyAudience"};t=!0,this.handleGoogleGtag("event",o[n],r,this.gtag,!1)}return t}handleGoogleGtag(e,t,n,i,r){if(r&&!this.googleConversionId)return void(sqzlCommon.isWarningEnabled()&&console.warn("sqzly: No googleConversionId set"));if("object"!=typeof n||"function"!=typeof i)return void(sqzlCommon.getDebugLevel()&&console.error("sqzly: Invalid event or callback"));let o=r?"AW-"+this.googleConversionId:this.settings.ga.ua;if(this.state.gtagLoaded.hasOwnProperty(o)&&!1===this.state.gtagLoaded[o])return void setTimeout(function(){this.handleGoogleGtag(e,t,n,i,r)}.bind(this),50);if(this.state.gtagLoaded.hasOwnProperty(o)&&this.state.gtagLoaded[o])return void i.apply(this,[e,t,n]);this.state.gtagLoaded[o]=!1;let s=this.g.document.createElement("script");s.src="https://www.googletagmanager.com/gtag/js?id="+o,s.async=!0,s.onreadystatechange=s.onload=function(){s.readyState&&!/loaded|complete/.test(s.readyState)||(this.gtag("js",new Date),this.gtag("config",o,{conversion_linker:sqzlCommon.hasMarketingConsent(),send_page_view:!1}),this.state.gtagLoaded[o]=!0,i.apply(this,[e,t,n]))}.bind(this),sqzlCommon.appendElementToPage(s)}gptLoaded(){return this.state.gptLoaded.initialized}forwardToGooglePublisherTag(e){var t=!1;return"SqueezelyAudience"===e.event&&(!(!e.hasOwnProperty("audience_ids")||"object"!=typeof e.audience_ids||0===e.audience_ids.length)&&(t=function(){let t=[];for(let n=0;n0&&t.hasOwnProperty("GA")&&"object"==typeof t.GA.events&&Object.keys(t.GA.events).length>0){sqzlCommon.isDebugEnabled()&&console.debug("sqzly: Valid GA event forwarding configuration found, initializing"),this.state.gaLoaded.initialized=!0;var n=t.GA.settings;return this.settings.ga.ua=n.ua,this.settings.ga.events=t.GA.events,this.settings.ga4.events=sqzlCommon.getConfigItem("ga4Events"),this.settings.ga4.passPersonalizationNames=sqzlCommon.getConfigItem("ga4PassPersonalizationNames"),this.g.hasOwnProperty("GoogleAnalyticsObject")&&"string"==typeof this.g.GoogleAnalyticsObject&&""!==this.g.GoogleAnalyticsObject&&(this.settings.ga.gaObject=this.g.GoogleAnalyticsObject),this.g.hasOwnProperty(this.settings.ga.gaObject)&&"function"==typeof this.g[this.settings.ga.gaObject]||this.requireGaObject(),!1}sqzlCommon.getDebugLevel()&&console.warn("sqzly: No valid GA event forwarding configuration found")}requireGaObject(){return!1}gaLoaded(){return this.state.gaLoaded.initialized}gaEnabled(){return!1}gaEnabledEvents(){return{}}ga4EnabledEvents(){return this.settings.ga4.hasOwnProperty("events")&&null!==this.settings.ga4.events?Object.values(this.settings.ga4.events):[]}ga4PassPersonalizationNames(){return!!this.settings.ga4.hasOwnProperty("passPersonalizationNames")&&this.settings.ga4.passPersonalizationNames}forwardToGa(e){var t={};return!1===this.gaLoaded()?(this.initializeGa(e),!1):(t=this.gaEnabledEvents(),!(!this.gaEnabled()||!t.hasOwnProperty(e.event)||!0!==t[e.event])&&(sqzlCommon.isDebugEnabled()&&console.debug("sqzly: Forwarding event to GA",{event:e}),this.g[this.settings.ga.gaObject](function(){switch(e.hasOwnProperty("currency")&&this.getConstants().gaSupportedCurrencies.hasOwnProperty(e.currency)&&this.g[this.settings.ga.gaObject](this.settings.ga.trackerName+".set","currencyCode",e.currency),e.event){case"PageView":this.g[this.settings.ga.gaObject](this.settings.ga.trackerName+".send",{hitType:"pageview",page:this.g.location.pathname,nonInteraction:!0}),this.g[this.settings.ga.gaObject](this.settings.ga.trackerName+".send",{hitType:"event",eventCategory:this.settings.ga.categoryName,eventAction:e.event,eventLabel:"PageView",nonInteraction:!0});break;case"ViewCategory":this.g[this.settings.ga.gaObject](this.settings.ga.trackerName+".send",{hitType:"event",eventCategory:this.settings.ga.categoryName,eventAction:e.event,eventLabel:e.hasOwnProperty("category_id")?e.category_id:"",nonInteraction:!0});break;case"PersonalizationView":case"PersonalizationClick":if(!(e.hasOwnProperty("personalization_id")&&e.hasOwnProperty("personalization_variant_id")&&e.personalization_id&&e.personalization_variant_id))return!1;if(e.hasOwnProperty("products")&&Array.isArray(e.products)&&e.products.length>0){var t=1;e.products.forEach(function(e){if(e.hasOwnProperty("id")){var n={id:e.id};e.hasOwnProperty("name")&&(n.name=e.name),e.hasOwnProperty("price")&&(n.price=e.price),n.position=t,this.g[this.settings.ga.gaObject](this.settings.ga.trackerName+".ec:addProduct",n),t++}}.bind(this))}this.g[this.settings.ga.gaObject](this.settings.ga.trackerName+".send",{hitType:"event",eventCategory:this.settings.ga.categoryName,eventAction:e.event,eventLabel:"Personalization "+e.personalization_id+", variant "+e.personalization_variant_id,nonInteraction:!0});break;case"ViewContent":if(e.hasOwnProperty("products")){if(Array.isArray(e.products)&&e.products.length>0){t=1;e.products.forEach(function(e){if(e.hasOwnProperty("id")){var n={id:e.id};e.hasOwnProperty("name")&&(n.name=e.name),e.hasOwnProperty("price")&&(n.price=e.price),n.position=t,this.g[this.settings.ga.gaObject](this.settings.ga.trackerName+".ec:addProduct",n),t++}}.bind(this))}this.g[this.settings.ga.gaObject](this.settings.ga.trackerName+".ec:setAction","detail")}this.g[this.settings.ga.gaObject](this.settings.ga.trackerName+".send",{hitType:"event",eventCategory:this.settings.ga.categoryName,eventAction:e.event,nonInteraction:!0});break;case"Purchase":if(e.hasOwnProperty("products")){var n=0;Array.isArray(e.products)&&e.products.length>0&&e.products.forEach(function(e){if(e.hasOwnProperty("id")){var t=1,i={id:e.id};e.hasOwnProperty("name")&&(i.name=e.name),e.hasOwnProperty("quantity")&&e.quantity>0&&(t=e.quantity),i.quantity=t,e.hasOwnProperty("price")&&(n+=e.price*t,i.price=e.price),this.g[this.settings.ga.gaObject](this.settings.ga.trackerName+".ec:addProduct",i)}}.bind(this));var i={id:e.orderid};n>0&&(i.revenue=n),this.g[this.settings.ga.gaObject](this.settings.ga.trackerName+".ec:setAction","purchase",i)}this.g[this.settings.ga.gaObject](this.settings.ga.trackerName+".send",{hitType:"event",eventCategory:this.settings.ga.categoryName,eventAction:e.event,nonInteraction:!0});break;case"Search":this.g[this.settings.ga.gaObject](this.settings.ga.trackerName+".send",{hitType:"event",eventCategory:this.settings.ga.categoryName,eventAction:e.event,eventLabel:e.hasOwnProperty("keyword")?e.keyword:"",nonInteraction:!0});break;case"EmailOptIn":e.hasOwnProperty("newsletter")&&this.g[this.settings.ga.gaObject](this.settings.ga.trackerName+".send",{hitType:"event",eventCategory:this.settings.ga.categoryName,eventAction:"yes"===e.newsletter?"Subscribe":"Unsubscribe",eventLabel:"Newsletter",nonInteraction:!0}),e.hasOwnProperty("marketing")&&this.g[this.settings.ga.gaObject](this.settings.ga.trackerName+".send",{hitType:"event",eventCategory:this.settings.ga.categoryName,eventAction:"yes"===e.marketing?"Subscribe":"Unsubscribe",eventLabel:"Marketingletter",nonInteraction:!0}),e.hasOwnProperty("service")&&this.g[this.settings.ga.gaObject](this.settings.ga.trackerName+".send",{hitType:"event",eventCategory:this.settings.ga.categoryName,eventAction:"yes"===e.service?"Subscribe":"Unsubscribe",eventLabel:"Serviceletter",nonInteraction:!0});break;case"SqueezelyAudience":var r=[],o="-";e.audience_ids.forEach((function(e){(o+e.toString()+"-").length>500?(r.push(o),o="-"):o+=e.toString()+"-"})),o.length>1&&r.push(o),r.forEach(function(t){this.g[this.settings.ga.gaObject](this.settings.ga.trackerName+".send",{hitType:"event",eventCategory:this.settings.ga.categoryName,eventAction:e.event,eventLabel:t,nonInteraction:!0})}.bind(this));break;default:var s={hitType:"event",eventCategory:this.settings.ga.categoryName,eventAction:e.event,nonInteraction:!0};e.hasOwnProperty("value")&&(s.eventLabel=e.value),this.g[this.settings.ga.gaObject](this.settings.ga.trackerName+".send",s)}}.bind(this)),!0))}getURLParameter(e){return"string"==typeof e&&(new RegExp("[?|&]"+e+"=([^&;]+?)(&|#|;|$)").exec(location.search)||[null,""])[1].replace(/\+/g,"%20")||null}getUserAgent(){return navigator.userAgent||navigator.vendor||this.g.opera}getPlatform(e){if(void 0!==e)return e;if(this.getUserAgent()){if(this.getUserAgent().toLowerCase().indexOf("windows")>=0)return"windows";if(this.getUserAgent().toLowerCase().indexOf("android")>=0)return"android";if(this.getUserAgent().toLowerCase().indexOf("iphone")>=0)return"ios";if(this.getUserAgent().toLowerCase().indexOf("mac")>=0)return"mac";if(this.getUserAgent().toLowerCase().indexOf("x11")>=0)return"unix"}return""}isBot(e){if(void 0!==e&&e||(e=this.getUserAgent()),e&&void 0!==sqzlCommon.mobileDetect){var t=new sqzlCommon.mobileDetect(e);if("function"==typeof t.isBot)return t.isBot()}return null}handleEvent=function(e){return{handleEvent:function(e){if("object"==typeof e&&void 0!==!e.hasOwnProperty("event")){var t=e.event.toLowerCase();if(this.hasOwnProperty(t)&&"function"==typeof this[t])try{sqzlCommon.isDebugEnabled()&&console.debug("sqzly: Handling event ("+t+")",e),this[t].apply(this,[e])}catch(e){console.error("sqzly error",e)}else console.error("sqzly: Invalid event handler: "+e.event)}else console.error("sqzly: Invalid sqzly event")},consent:function(t){void 0===t.status||"grant"!==t.status&&"revoke"!==t.status?console.error("sqzly: Unknown value for consent (possible values: grant, revoke)"):void 0===t.permissions||"object"!=typeof t.permissions?"revoke"===t.status?(sqzlCommon.isDebugEnabled()&&console.info("sqzly: Revoking all permissions"),e.revokeConsent([],t.hasOwnProperty("user_interaction")&&"boolean"==typeof t.user_interaction&&!0===t.user_interaction)):(sqzlCommon.isDebugEnabled()&&console.log("sqzly: Granting all permissions"),e.grantConsent(),e.loadDataLayerEvents()):"revoke"===t.status?(sqzlCommon.isDebugEnabled()&&console.info("sqzly: Revoking permissions",t.permissions),e.revokeConsent(t.permissions,t.hasOwnProperty("user_interaction")&&"boolean"==typeof t.user_interaction&&!0===t.user_interaction)):(sqzlCommon.isDebugEnabled()&&console.info("sqzly: Granting permissions",t.permissions),e.grantConsent(t.permissions),t.permissions.indexOf("analytics")>-1&&e.loadDataLayerEvents())}}}(this);smartTracking(e){var t=null;if(null==e)return!1;if(void 0!==e.event&&(t=e.event),void 0!==e.ecommerce&&(e=e.ecommerce),null===e)return!1;void 0!==e.event&&(t=e.event);var n=[],i={},r=null;if(void 0!==e.items&&(r=e.items),void 0!==e.add||"add_to_cart"===t||"addToCart"===t){if(n=[],void 0!==e.add&&(void 0!==e.add.products&&(r=e.add.products),void 0!==e.add.product&&n.push(this.sanitizeEcommerceProduct(e.add.product))),null!==r)for(var o=0;o0&&this.g.sqzl.q.push([{event:"PrePurchase",products:n}])}if(void 0!==e.purchase||"purchase"===t){var s=null;if(sqzlCommon.isDefined(e,"purchase.products")){r=e.purchase.products;var a=e.purchase.actionField.id}if(void 0!==e.items&&void 0!==e.transaction_id){r=e.items;a=e.transaction_id}if(null!==r){n=[];for(o=0;o-1&&e.price.indexOf(".")>-1&&(e.price=e.price.replace(",","")),{id:e.item_id||e.id||e.sku,name:e.item_name||e.name,price:e.price,quantity:e.quantity}}addSqzlListeners(){this.SQZLDataLayerWatcher.init(),this.SQZLOldQueueWatcher.init(),this.smartTrackingEnabled&&this.SQZLGoogleDataLayerWatcher.init()}SQZLDataLayerWatcher=function(e){var t=!1,n=!1;return{init:function(){this.overwritePush.call(this)},customPush:function(){var t=[].slice.call(arguments,0);for(var i in n.apply(this,t),t)if(t.hasOwnProperty(i)){var r=t[i];r.newtracker=!0,e.g.sqzl.q.push(r)}return e.g._sqzl.length},overwritePush:function(){if(!1===t){if(e.g._sqzl=e.g._sqzl||[],e.g._sqzl.length>0)for(var i=0;i0)){for(var i=0;i0&&"object"==typeof e.g.sqzl.q[i]?"object"!=typeof e.g.sqzl.q[i][0]||e.g.sqzl.q[i][0].hasOwnProperty("newtracker")||(e.g.sqzl.q[i][0].oldtracker=!0):e.g.sqzl.q[i]&&"object"==typeof e.g.sqzl.q[i]&&e.g.sqzl.q[i].hasOwnProperty("event")&&!e.g.sqzl.q[i].hasOwnProperty("newtracker")&&(e.g.sqzl.q[i].oldtracker=!0);e.checkSqzl()}t||(n=e.g.sqzl.q.push,e.g.sqzl.q.push=this.customPush.bind(this),t=!0)},r=function(){for(var t=[].slice.call(arguments,0),i=0;i0&&"object"==typeof t[i]?"object"==typeof t[i][0]&&(t[i][0].oldtracker=!0):t[i]&&"object"==typeof t[i]&&t[i].hasOwnProperty("event")&&!t[i].hasOwnProperty("newtracker")&&(t[i].oldtracker=!0);return n.apply(e.g.sqzl.q,t),e.checkSqzl(),e.g.sqzl.q.length};return{init:function(){i.apply(this)},customPush:r,resetItems:function(){e.g.sqzl.q=[],this.forceOverwritePush()},forceOverwritePush:function(){n=n||e.g.sqzl.q.push,e.g.sqzl.q.push=this.customPush.bind(this)}}}(this);SQZLGoogleDataLayerWatcher=function(e){var t=!1,n=!1,i=function(){if(!1===t&&void 0!==e.g.dataLayer){if(e.g.dataLayer.length>0)for(var i=0;i-1)){var r=e[i];"originalData"===i&&e.hasOwnProperty("type")&&"log"===e.type&&(r=r.replace(/(&)?log_id=[a-z0-9\-]+/i,"")),n[i]=r}var o=btoa(encodeURIComponent(JSON.stringify(n))),s=Math.round(1*new Date/1e3);return this.duplicateEventTracker.hasOwnProperty(o)&&!isNaN(parseInt(this.duplicateEventTracker[o]))&&s-parseInt(this.duplicateEventTracker[o])<5?(sqzlCommon.isWarningEnabled()&&console.warn("sqzly: Duplicate event detected in less then 5 secs. Ignoring this event",n),this.duplicateEventTracker[o]=Math.round(1*new Date/1e3),!0):(this.duplicateEventTracker[o]=Math.round(1*new Date/1e3),!1)}addPersonalizationCallback(){this.g.sqzl.q.unshift({SetCallback:function(e){this.g.sqzl.p.push({event:"PixelEvent",eventData:e})}.bind(this)})}dateToIso8601String(e){var t=e.getFullYear(),n=""+(e.getMonth()+1),i=""+e.getDate();return n.length<2&&(n="0"+n),i.length<2&&(i="0"+i),[t,n,i].join("-")}}var basePersonalization=__webpack_require__(941);new SqzlCommon,new SqzlTransmit,sqzlCommon.g.sqzlInitQueue.push(sqzlCommon.g.sqzlTransmit.init.bind(sqzlCommon.g.sqzlTransmit)),new basePersonalization.a,sqzlCommon.g.sqzlInitQueue.push(sqzlCommon.g.sqzlPersonalization.init.bind(sqzlCommon.g.sqzlPersonalization))})();