vendor: 50,679 bytes, lines 1-2
1/* flatpickr v4.6.13,, @license MIT */ 2!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):(e="undefined"!=typeof globalThis?globalThis:e||self).flatpickr=n()}(this,(function(){"use strict";var e=function(){return(e=Object.assign||function(e){for(var n,t=1,a=arguments.length;t<a;t++)for(var i in n=arguments[t])Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i]);return e}).apply(this,arguments)};function n(){for(var e=0,n=0,t=arguments.length;n<t;n++)e+=arguments[n].length;var a=Array(e),i=0;for(n=0;n<t;n++)for(var o=arguments[n],r=0,l=o.length;r<l;r++,i++)a[i]=o[r];return a}var t=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],a={_disable:[],allowInput:!1,allowInvalidPreload:!1,altFormat:"F j, Y",altInput:!1,altInputClass:"form-control input",animate:"object"==typeof window&&-1===window.navigator.userAgent.indexOf("MSIE"),ariaDateFormat:"F j, Y",autoFillDefaultTime:!0,clickOpens:!0,closeOnSelect:!0,conjunction:", ",dateFormat:"Y-m-d",defaultHour:12,defaultMinute:0,defaultSeconds:0,disable:[],disableMobile:!1,enableSeconds:!1,enableTime:!1,errorHandler:function(e){return"undefined"!=typeof console&&console.warn(e)},getWeek:function(e){var n=new Date(e.getTime());n.setHours(0,0,0,0),n.setDate(n.getDate()+3-(n.getDay()+6)%7);var t=new Date(n.getFullYear(),0,4);return 1+Math.round(((n.getTime()-t.getTime())/864e5-3+(t.getDay()+6)%7)/7)},hourIncrement:1,ignoredFocusElements:[],inline:!1,locale:"default",minuteIncrement:5,mode:"single",monthSelectorType:"dropdown",nextArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M13.207 8.472l-7.854 7.854-0.707-0.707 7.146-7.146-7.146-7.148 0.707-0.707 7.854 7.854z' /></svg>",noCalendar:!1,now:new Date,onChange:[],onClose:[],onDayCreate:[],onDestroy:[],onKeyDown:[],onMonthChange:[],onOpen:[],onParseConfig:[],onReady:[],onValueUpdate:[],onYearChange:[],onPreCalendarPosition:[],plugins:[],position:"auto",positionElement:void 0,prevArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M5.207 8.471l7.146 7.147-0.707 0.707-7.853-7.854 7.854-7.853 0.707 0.707-7.147 7.146z' /></svg>",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 n=e%100;if(n>3&&n<21)return"th";switch(n%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",monthAriaLabel:"Month",hourAriaLabel:"Hour",minuteAriaLabel:"Minute",time_24hr:!1},o=function(e,n){return void 0===n&&(n=2),("000"+e).slice(-1*n)},r=function(e){return!0===e?1:0};function l(e,n){var t;return function(){var a=this,i=arguments;clearTimeout(t),t=setTimeout((function(){return e.apply(a,i)}),n)}}var c=function(e){return e instanceof Array?e:[e]};function s(e,n,t){if(!0===t)return e.classList.add(n);e.classList.remove(n)}function d(e,n,t){var a=window.document.createElement(e);return n=n||"",t=t||"",a.className=n,void 0!==t&&(a.textContent=t),a}function u(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function f(e,n){return n(e)?e:e.parentNode?f(e.parentNode,n):void 0}function m(e,n){var t=d("div","numInputWrapper"),a=d("input","numInput "+e),i=d("span","arrowUp"),o=d("span","arrowDown");if(-1===navigator.userAgent.indexOf("MSIE 9.0")?a.type="number":(a.type="text",a.pattern="\\d*"),void 0!==n)for(var r in n)a.setAttribute(r,n[r]);return t.appendChild(a),t.appendChild(i),t.appendChild(o),t}function g(e){try{return"function"==typeof e.composedPath?e.composedPath()[0]:e.target}catch(n){return e.target}}var p=function(){},h=function(e,n,t){return t.months[n?"shorthand":"longhand"][e]},v={D:p,F:function(e,n,t){e.setMonth(t.months.longhand.indexOf(n))},G:function(e,n){e.setHours((e.getHours()>=12?12:0)+parseFloat(n))},H:function(e,n){e.setHours(parseFloat(n))},J:function(e,n){e.setDate(parseFloat(n))},K:function(e,n,t){e.setHours(e.getHours()%12+12*r(new RegExp(t.amPM[1],"i").test(n)))},M:function(e,n,t){e.setMonth(t.months.shorthand.indexOf(n))},S:function(e,n){e.setSeconds(parseFloat(n))},U:function(e,n){return new Date(1e3*parseFloat(n))},W:function(e,n,t){var a=parseInt(n),i=new Date(e.getFullYear(),0,2+7*(a-1),0,0,0,0);return i.setDate(i.getDate()-i.getDay()+t.firstDayOfWeek),i},Y:function(e,n){e.setFullYear(parseFloat(n))},Z:function(e,n){return new Date(n)},d:function(e,n){e.setDate(parseFloat(n))},h:function(e,n){e.setHours((e.getHours()>=12?12:0)+parseFloat(n))},i:function(e,n){e.setMinutes(parseFloat(n))},j:function(e,n){e.setDate(parseFloat(n))},l:p,m:function(e,n){e.setMonth(parseFloat(n)-1)},n:function(e,n){e.setMonth(parseFloat(n)-1)},s:function(e,n){e.setSeconds(parseFloat(n))},u:function(e,n){return new Date(parseFloat(n))},w:p,y:function(e,n){e.setFullYear(2e3+parseFloat(n))}},D={D:"",F:"",G:"(\\d\\d|\\d)",H:"(\\d\\d|\\d)",J:"(\\d\\d|\\d)\\w+",K:"",M:"",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:"",m:"(\\d\\d|\\d)",n:"(\\d\\d|\\d)",s:"(\\d\\d|\\d)",u:"(.+)",w:"(\\d\\d|\\d)",y:"(\\d{2})"},w={Z:function(e){return e.toISOString()},D:function(e,n,t){return n.weekdays.shorthand[w.w(e,n,t)]},F:function(e,n,t){return h(w.n(e,n,t)-1,!1,n)},G:function(e,n,t){return o(w.h(e,n,t))},H:function(e){return o(e.getHours())},J:function(e,n){return void 0!==n.ordinal?e.getDate()+n.ordinal(e.getDate()):e.getDate()},K:function(e,n){return n.amPM[r(e.getHours()>11)]},M:function(e,n){return h(e.getMonth(),!0,n)},S:function(e){return o(e.getSeconds())},U:function(e){return e.getTime()/1e3},W:function(e,n,t){return t.getWeek(e)},Y:function(e){return o(e.getFullYear(),4)},d:function(e){return o(e.getDate())},h:function(e){return e.getHours()%12?e.getHours()%12:12},i:function(e){return o(e.getMinutes())},j:function(e){return e.getDate()},l:function(e,n){return n.weekdays.longhand[e.getDay()]},m:function(e){return o(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)}},b=function(e){var n=e.config,t=void 0===n?a:n,o=e.l10n,r=void 0===o?i:o,l=e.isMobile,c=void 0!==l&&l;return function(e,n,a){var i=a||r;return void 0===t.formatDate||c?n.split("").map((function(n,a,o){return w[n]&&"\\"!==o[a-1]?w[n](e,i,t):"\\"!==n?n:""})).join(""):t.formatDate(e,n,i)}},C=function(e){var n=e.config,t=void 0===n?a:n,o=e.l10n,r=void 0===o?i:o;return function(e,n,i,o){if(0===e||e){var l,c=o||r,s=e;if(e instanceof Date)l=new Date(e.getTime());else if("string"!=typeof e&&void 0!==e.toFixed)l=new Date(e);else if("string"==typeof e){var d=n||(t||a).dateFormat,u=String(e).trim();if("today"===u)l=new Date,i=!0;else if(t&&t.parseDate)l=t.parseDate(e,d);else if(/Z$/.test(u)||/GMT$/.test(u))l=new Date(e);else{for(var f=void 0,m=[],g=0,p=0,h="";g<d.length;g++){var w=d[g],b="\\"===w,C="\\"===d[g-1]||b;if(D[w]&&!C){h+=D[w];var M=new RegExp(h).exec(e);M&&(f=!0)&&m["Y"!==w?"push":"unshift"]({fn:v[w],val:M[++p]})}else b||(h+=".")}l=t&&t.noCalendar?new Date((new Date).setHours(0,0,0,0)):new Date((new Date).getFullYear(),0,1,0,0,0,0),m.forEach((function(e){var n=e.fn,t=e.val;return l=n(l,t,c)||l})),l=f?l:void 0}}if(l instanceof Date&&!isNaN(l.getTime()))return!0===i&&l.setHours(0,0,0,0),l;t.errorHandler(new Error("Invalid date provided: "+s))}}};function M(e,n,t){return void 0===t&&(t=!0),!1!==t?new Date(e.getTime()).setHours(0,0,0,0)-new Date(n.getTime()).setHours(0,0,0,0):e.getTime()-n.getTime()}var y=function(e,n,t){return 3600*e+60*n+t},x=864e5;function E(e){var n=e.defaultHour,t=e.defaultMinute,a=e.defaultSeconds;if(void 0!==e.minDate){var i=e.minDate.getHours(),o=e.minDate.getMinutes(),r=e.minDate.getSeconds();n<i&&(n=i),n===i&&t<o&&(t=o),n===i&&t===o&&a<r&&(a=e.minDate.getSeconds())}if(void 0!==e.maxDate){var l=e.maxDate.getHours(),c=e.maxDate.getMinutes();(n=Math.min(n,l))===l&&(t=Math.min(c,t)),n===l&&t===c&&(a=e.maxDate.getSeconds())}return{hours:n,minutes:t,seconds:a}}"function"!=typeof Object.assign&&(Object.assign=function(e){for(var n=[],t=1;t<arguments.length;t++)n[t-1]=arguments[t];if(!e)throw TypeError("Cannot convert undefined or null to object");for(var a=function(n){n&&Object.keys(n).forEach((function(t){return e[t]=n[t]}))},i=0,o=n;i<o.length;i++){var r=o[i];a(r)}return e});function k(p,v){var w={config:e(e({},a),I.defaultConfig),l10n:i};function k(){var e;return(null===(e=w.calendarContainer)||void 0===e?void 0:e.getRootNode()).activeElement||document.activeElement}function T(e){return e.bind(w)}function S(){var e=w.config;!1===e.weekNumbers&&1===e.showMonths||!0!==e.noCalendar&&window.requestAnimationFrame((function(){if(void 0!==w.calendarContainer&&(w.calendarContainer.style.visibility="hidden",w.calendarContainer.style.display="block"),void 0!==w.daysContainer){var n=(w.days.offsetWidth+1)*e.showMonths;w.daysContainer.style.width=n+"px",w.calendarContainer.style.width=n+(void 0!==w.weekWrapper?w.weekWrapper.offsetWidth:0)+"px",w.calendarContainer.style.removeProperty("visibility"),w.calendarContainer.style.removeProperty("display")}}))}function _(e){if(0===w.selectedDates.length){var n=void 0===w.config.minDate||M(new Date,w.config.minDate)>=0?new Date:new Date(w.config.minDate.getTime()),t=E(w.config);n.setHours(t.hours,t.minutes,t.seconds,n.getMilliseconds()),w.selectedDates=[n],w.latestSelectedDateObj=n}void 0!==e&&"blur"!==e.type&&function(e){e.preventDefault();var n="keydown"===e.type,t=g(e),a=t;void 0!==w.amPM&&t===w.amPM&&(w.amPM.textContent=w.l10n.amPM[r(w.amPM.textContent===w.l10n.amPM[0])]);var i=parseFloat(a.getAttribute("min")),l=parseFloat(a.getAttribute("max")),c=parseFloat(a.getAttribute("step")),s=parseInt(a.value,10),d=e.delta||(n?38===e.which?1:-1:0),u=s+c*d;if(void 0!==a.value&&2===a.value.length){var f=a===w.hourElement,m=a===w.minuteElement;u<i?(u=l+u+r(!f)+(r(f)&&r(!w.amPM)),m&&L(void 0,-1,w.hourElement)):u>l&&(u=a===w.hourElement?u-l-r(!w.amPM):i,m&&L(void 0,1,w.hourElement)),w.amPM&&f&&(1===c?u+s===23:Math.abs(u-s)>c)&&(w.amPM.textContent=w.l10n.amPM[r(w.amPM.textContent===w.l10n.amPM[0])]),a.value=o(u)}}(e);var a=w._input.value;O(),ye(),w._input.value!==a&&w._debouncedChange()}function O(){if(void 0!==w.hourElement&&void 0!==w.minuteElement){var e,n,t=(parseInt(w.hourElement.value.slice(-2),10)||0)%24,a=(parseInt(w.minuteElement.value,10)||0)%60,i=void 0!==w.secondElement?(parseInt(w.secondElement.value,10)||0)%60:0;void 0!==w.amPM&&(e=t,n=w.amPM.textContent,t=e%12+12*r(n===w.l10n.amPM[1]));var o=void 0!==w.config.minTime||w.config.minDate&&w.minDateHasTime&&w.latestSelectedDateObj&&0===M(w.latestSelectedDateObj,w.config.minDate,!0),l=void 0!==w.config.maxTime||w.config.maxDate&&w.maxDateHasTime&&w.latestSelectedDateObj&&0===M(w.latestSelectedDateObj,w.config.maxDate,!0);if(void 0!==w.config.maxTime&&void 0!==w.config.minTime&&w.config.minTime>w.config.maxTime){var c=y(w.config.minTime.getHours(),w.config.minTime.getMinutes(),w.config.minTime.getSeconds()),s=y(w.config.maxTime.getHours(),w.config.maxTime.getMinutes(),w.config.maxTime.getSeconds()),d=y(t,a,i);if(d>s&&d<c){var u=function(e){var n=Math.floor(e/3600),t=(e-3600*n)/60;return[n,t,e-3600*n-60*t]}(c);t=u[0],a=u[1],i=u[2]}}else{if(l){var f=void 0!==w.config.maxTime?w.config.maxTime:w.config.maxDate;(t=Math.min(t,f.getHours()))===f.getHours()&&(a=Math.min(a,f.getMinutes())),a===f.getMinutes()&&(i=Math.min(i,f.getSeconds()))}if(o){var m=void 0!==w.config.minTime?w.config.minTime:w.config.minDate;(t=Math.max(t,m.getHours()))===m.getHours()&&a<m.getMinutes()&&(a=m.getMinutes()),a===m.getMinutes()&&(i=Math.max(i,m.getSeconds()))}}A(t,a,i)}}function F(e){var n=e||w.latestSelectedDateObj;n&&n instanceof Date&&A(n.getHours(),n.getMinutes(),n.getSeconds())}function A(e,n,t){void 0!==w.latestSelectedDateObj&&w.latestSelectedDateObj.setHours(e%24,n,t||0,0),w.hourElement&&w.minuteElement&&!w.isMobile&&(w.hourElement.value=o(w.config.time_24hr?e:(12+e)%12+12*r(e%12==0)),w.minuteElement.value=o(n),void 0!==w.amPM&&(w.amPM.textContent=w.l10n.amPM[r(e>=12)]),void 0!==w.secondElement&&(w.secondElement.value=o(t)))}function N(e){var n=g(e),t=parseInt(n.value)+(e.delta||0);(t/1e3>1||"Enter"===e.key&&!/[^\d]/.test(t.toString()))&&ee(t)}function P(e,n,t,a){return n instanceof Array?n.forEach((function(n){return P(e,n,t,a)})):e instanceof Array?e.forEach((function(e){return P(e,n,t,a)})):(e.addEventListener(n,t,a),void w._handlers.push({remove:function(){return e.removeEventListener(n,t,a)}}))}function Y(){De("onChange")}function j(e,n){var t=void 0!==e?w.parseDate(e):w.latestSelectedDateObj||(w.config.minDate&&w.config.minDate>w.now?w.config.minDate:w.config.maxDate&&w.config.maxDate<w.now?w.config.maxDate:w.now),a=w.currentYear,i=w.currentMonth;try{void 0!==t&&(w.currentYear=t.getFullYear(),w.currentMonth=t.getMonth())}catch(e){e.message="Invalid date supplied: "+t,w.config.errorHandler(e)}n&&w.currentYear!==a&&(De("onYearChange"),q()),!n||w.currentYear===a&&w.currentMonth===i||De("onMonthChange"),w.redraw()}function H(e){var n=g(e);~n.className.indexOf("arrow")&&L(e,n.classList.contains("arrowUp")?1:-1)}function L(e,n,t){var a=e&&g(e),i=t||a&&a.parentNode&&a.parentNode.firstChild,o=we("increment");o.delta=n,i&&i.dispatchEvent(o)}function R(e,n,t,a){var i=ne(n,!0),o=d("span",e,n.getDate().toString());return o.dateObj=n,o.$i=a,o.setAttribute("aria-label",w.formatDate(n,w.config.ariaDateFormat)),-1===e.indexOf("hidden")&&0===M(n,w.now)&&(w.todayDateElem=o,o.classList.add("today"),o.setAttribute("aria-current","date")),i?(o.tabIndex=-1,be(n)&&(o.classList.add("selected"),w.selectedDateElem=o,"range"===w.config.mode&&(s(o,"startRange",w.selectedDates[0]&&0===M(n,w.selectedDates[0],!0)),s(o,"endRange",w.selectedDates[1]&&0===M(n,w.selectedDates[1],!0)),"nextMonthDay"===e&&o.classList.add("inRange")))):o.classList.add("flatpickr-disabled"),"range"===w.config.mode&&function(e){return!("range"!==w.config.mode||w.selectedDates.length<2)&&(M(e,w.selectedDates[0])>=0&&M(e,w.selectedDates[1])<=0)}(n)&&!be(n)&&o.classList.add("inRange"),w.weekNumbers&&1===w.config.showMonths&&"prevMonthDay"!==e&&a%7==6&&w.weekNumbers.insertAdjacentHTML("beforeend","<span class='flatpickr-day'>"+w.config.getWeek(n)+"</span>"),De("onDayCreate",o),o}function W(e){e.focus(),"range"===w.config.mode&&oe(e)}function B(e){for(var n=e>0?0:w.config.showMonths-1,t=e>0?w.config.showMonths:-1,a=n;a!=t;a+=e)for(var i=w.daysContainer.children[a],o=e>0?0:i.children.length-1,r=e>0?i.children.length:-1,l=o;l!=r;l+=e){var c=i.children[l];if(-1===c.className.indexOf("hidden")&&ne(c.dateObj))return c}}function J(e,n){var t=k(),a=te(t||document.body),i=void 0!==e?e:a?t:void 0!==w.selectedDateElem&&te(w.selectedDateElem)?w.selectedDateElem:void 0!==w.todayDateElem&&te(w.todayDateElem)?w.todayDateElem:B(n>0?1:-1);void 0===i?w._input.focus():a?function(e,n){for(var t=-1===e.className.indexOf("Month")?e.dateObj.getMonth():w.currentMonth,a=n>0?w.config.showMonths:-1,i=n>0?1:-1,o=t-w.currentMonth;o!=a;o+=i)for(var r=w.daysContainer.children[o],l=t-w.currentMonth===o?e.$i+n:n<0?r.children.length-1:0,c=r.children.length,s=l;s>=0&&s<c&&s!=(n>0?c:-1);s+=i){var d=r.children[s];if(-1===d.className.indexOf("hidden")&&ne(d.dateObj)&&Math.abs(e.$i-s)>=Math.abs(n))return W(d)}w.changeMonth(i),J(B(i),0)}(i,n):W(i)}function K(e,n){for(var t=(new Date(e,n,1).getDay()-w.l10n.firstDayOfWeek+7)%7,a=w.utils.getDaysInMonth((n-1+12)%12,e),i=w.utils.getDaysInMonth(n,e),o=window.document.createDocumentFragment(),r=w.config.showMonths>1,l=r?"prevMonthDay hidden":"prevMonthDay",c=r?"nextMonthDay hidden":"nextMonthDay",s=a+1-t,u=0;s<=a;s++,u++)o.appendChild(R("flatpickr-day "+l,new Date(e,n-1,s),0,u));for(s=1;s<=i;s++,u++)o.appendChild(R("flatpickr-day",new Date(e,n,s),0,u));for(var f=i+1;f<=42-t&&(1===w.config.showMonths||u%7!=0);f++,u++)o.appendChild(R("flatpickr-day "+c,new Date(e,n+1,f%i),0,u));var m=d("div","dayContainer");return m.appendChild(o),m}function U(){if(void 0!==w.daysContainer){u(w.daysContainer),w.weekNumbers&&u(w.weekNumbers);for(var e=document.createDocumentFragment(),n=0;n<w.config.showMonths;n++){var t=new Date(w.currentYear,w.currentMonth,1);t.setMonth(w.currentMonth+n),e.appendChild(K(t.getFullYear(),t.getMonth()))}w.daysContainer.appendChild(e),w.days=w.daysContainer.firstChild,"range"===w.config.mode&&1===w.selectedDates.length&&oe()}}function q(){if(!(w.config.showMonths>1||"dropdown"!==w.config.monthSelectorType)){var e=function(e){return!(void 0!==w.config.minDate&&w.currentYear===w.config.minDate.getFullYear()&&e<w.config.minDate.getMonth())&&!(void 0!==w.config.maxDate&&w.currentYear===w.config.maxDate.getFullYear()&&e>w.config.maxDate.getMonth())};w.monthsDropdownContainer.tabIndex=-1,w.monthsDropdownContainer.innerHTML="";for(var n=0;n<12;n++)if(e(n)){var t=d("option","flatpickr-monthDropdown-month");t.value=new Date(w.currentYear,n).getMonth().toString(),t.textContent=h(n,w.config.shorthandCurrentMonth,w.l10n),t.tabIndex=-1,w.currentMonth===n&&(t.selected=!0),w.monthsDropdownContainer.appendChild(t)}}}function $(){var e,n=d("div","flatpickr-month"),t=window.document.createDocumentFragment();w.config.showMonths>1||"static"===w.config.monthSelectorType?e=d("span","cur-month"):(w.monthsDropdownContainer=d("select","flatpickr-monthDropdown-months"),w.monthsDropdownContainer.setAttribute("aria-label",w.l10n.monthAriaLabel),P(w.monthsDropdownContainer,"change",(function(e){var n=g(e),t=parseInt(n.value,10);w.changeMonth(t-w.currentMonth),De("onMonthChange")})),q(),e=w.monthsDropdownContainer);var a=m("cur-year",{tabindex:"-1"}),i=a.getElementsByTagName("input")[0];i.setAttribute("aria-label",w.l10n.yearAriaLabel),w.config.minDate&&i.setAttribute("min",w.config.minDate.getFullYear().toString()),w.config.maxDate&&(i.setAttribute("max",w.config.maxDate.getFullYear().toString()),i.disabled=!!w.config.minDate&&w.config.minDate.getFullYear()===w.config.maxDate.getFullYear());var o=d("div","flatpickr-current-month");return o.appendChild(e),o.appendChild(a),t.appendChild(o),n.appendChild(t),{container:n,yearElement:i,monthElement:e}}function V(){u(w.monthNav),w.monthNav.appendChild(w.prevMonthNav),w.config.showMonths&&(w.yearElements=[],w.monthElements=[]);for(var e=w.config.showMonths;e--;){var n=$();w.yearElements.push(n.yearElement),w.monthElements.push(n.monthElement),w.monthNav.appendChild(n.container)}w.monthNav.appendChild(w.nextMonthNav)}function z(){w.weekdayContainer?u(w.weekdayContainer):w.weekdayContainer=d("div","flatpickr-weekdays");for(var e=w.config.showMonths;e--;){var n=d("div","flatpickr-weekdaycontainer");w.weekdayContainer.appendChild(n)}return G(),w.weekdayContainer}function G(){if(w.weekdayContainer){var e=w.l10n.firstDayOfWeek,t=n(w.l10n.weekdays.shorthand);e>0&&e<t.length&&(t=n(t.splice(e,t.length),t.splice(0,e)));for(var a=w.config.showMonths;a--;)w.weekdayContainer.children[a].innerHTML="\n <span class='flatpickr-weekday'>\n "+t.join("</span><span class='flatpickr-weekday'>")+"\n </span>\n "}}function Z(e,n){void 0===n&&(n=!0);var t=n?e:e-w.currentMonth;t<0&&!0===w._hidePrevMonthArrow||t>0&&!0===w._hideNextMonthArrow||(w.currentMonth+=t,(w.currentMonth<0||w.currentMonth>11)&&(w.currentYear+=w.currentMonth>11?1:-1,w.currentMonth=(w.currentMonth+12)%12,De("onYearChange"),q()),U(),De("onMonthChange"),Ce())}function Q(e){return w.calendarContainer.contains(e)}function X(e){if(w.isOpen&&!w.config.inline){var n=g(e),t=Q(n),a=!(n===w.input||n===w.altInput||w.element.contains(n)||e.path&&e.path.indexOf&&(~e.path.indexOf(w.input)||~e.path.indexOf(w.altInput)))&&!t&&!Q(e.relatedTarget),i=!w.config.ignoredFocusElements.some((function(e){return e.contains(n)}));a&&i&&(w.config.allowInput&&w.setDate(w._input.value,!1,w.config.altInput?w.config.altFormat:w.config.dateFormat),void 0!==w.timeContainer&&void 0!==w.minuteElement&&void 0!==w.hourElement&&""!==w.input.value&&void 0!==w.input.value&&_(),w.close(),w.config&&"range"===w.config.mode&&1===w.selectedDates.length&&w.clear(!1))}}function ee(e){if(!(!e||w.config.minDate&&e<w.config.minDate.getFullYear()||w.config.maxDate&&e>w.config.maxDate.getFullYear())){var n=e,t=w.currentYear!==n;w.currentYear=n||w.currentYear,w.config.maxDate&&w.currentYear===w.config.maxDate.getFullYear()?w.currentMonth=Math.min(w.config.maxDate.getMonth(),w.currentMonth):w.config.minDate&&w.currentYear===w.config.minDate.getFullYear()&&(w.currentMonth=Math.max(w.config.minDate.getMonth(),w.currentMonth)),t&&(w.redraw(),De("onYearChange"),q())}}function ne(e,n){var t;void 0===n&&(n=!0);var a=w.parseDate(e,void 0,n);if(w.config.minDate&&a&&M(a,w.config.minDate,void 0!==n?n:!w.minDateHasTime)<0||w.config.maxDate&&a&&M(a,w.config.maxDate,void 0!==n?n:!w.maxDateHasTime)>0)return!1;if(!w.config.enable&&0===w.config.disable.length)return!0;if(void 0===a)return!1;for(var i=!!w.config.enable,o=null!==(t=w.config.enable)&&void 0!==t?t:w.config.disable,r=0,l=void 0;r<o.length;r++){if("function"==typeof(l=o[r])&&l(a))return i;if(l instanceof Date&&void 0!==a&&l.getTime()===a.getTime())return i;if("string"==typeof l){var c=w.parseDate(l,void 0,!0);return c&&c.getTime()===a.getTime()?i:!i}if("object"==typeof l&&void 0!==a&&l.from&&l.to&&a.getTime()>=l.from.getTime()&&a.getTime()<=l.to.getTime())return i}return!i}function te(e){return void 0!==w.daysContainer&&(-1===e.className.indexOf("hidden")&&-1===e.className.indexOf("flatpickr-disabled")&&w.daysContainer.contains(e))}function ae(e){var n=e.target===w._input,t=w._input.value.trimEnd()!==Me();!n||!t||e.relatedTarget&&Q(e.relatedTarget)||w.setDate(w._input.value,!0,e.target===w.altInput?w.config.altFormat:w.config.dateFormat)}function ie(e){var n=g(e),t=w.config.wrap?p.contains(n):n===w._input,a=w.config.allowInput,i=w.isOpen&&(!a||!t),o=w.config.inline&&t&&!a;if(13===e.keyCode&&t){if(a)return w.setDate(w._input.value,!0,n===w.altInput?w.config.altFormat:w.config.dateFormat),w.close(),n.blur();w.open()}else if(Q(n)||i||o){var r=!!w.timeContainer&&w.timeContainer.contains(n);switch(e.keyCode){case 13:r?(e.preventDefault(),_(),fe()):me(e);break;case 27:e.preventDefault(),fe();break;case 8:case 46:t&&!w.config.allowInput&&(e.preventDefault(),w.clear());break;case 37:case 39:if(r||t)w.hourElement&&w.hourElement.focus();else{e.preventDefault();var l=k();if(void 0!==w.daysContainer&&(!1===a||l&&te(l))){var c=39===e.keyCode?1:-1;e.ctrlKey?(e.stopPropagation(),Z(c),J(B(1),0)):J(void 0,c)}}break;case 38:case 40:e.preventDefault();var s=40===e.keyCode?1:-1;w.daysContainer&&void 0!==n.$i||n===w.input||n===w.altInput?e.ctrlKey?(e.stopPropagation(),ee(w.currentYear-s),J(B(1),0)):r||J(void 0,7*s):n===w.currentYearElement?ee(w.currentYear-s):w.config.enableTime&&(!r&&w.hourElement&&w.hourElement.focus(),_(e),w._debouncedChange());break;case 9:if(r){var d=[w.hourElement,w.minuteElement,w.secondElement,w.amPM].concat(w.pluginElements).filter((function(e){return e})),u=d.indexOf(n);if(-1!==u){var f=d[u+(e.shiftKey?-1:1)];e.preventDefault(),(f||w._input).focus()}}else!w.config.noCalendar&&w.daysContainer&&w.daysContainer.contains(n)&&e.shiftKey&&(e.preventDefault(),w._input.focus())}}if(void 0!==w.amPM&&n===w.amPM)switch(e.key){case w.l10n.amPM[0].charAt(0):case w.l10n.amPM[0].charAt(0).toLowerCase():w.amPM.textContent=w.l10n.amPM[0],O(),ye();break;case w.l10n.amPM[1].charAt(0):case w.l10n.amPM[1].charAt(0).toLowerCase():w.amPM.textContent=w.l10n.amPM[1],O(),ye()}(t||Q(n))&&De("onKeyDown",e)}function oe(e,n){if(void 0===n&&(n="flatpickr-day"),1===w.selectedDates.length&&(!e||e.classList.contains(n)&&!e.classList.contains("flatpickr-disabled"))){for(var t=e?e.dateObj.getTime():w.days.firstElementChild.dateObj.getTime(),a=w.parseDate(w.selectedDates[0],void 0,!0).getTime(),i=Math.min(t,w.selectedDates[0].getTime()),o=Math.max(t,w.selectedDates[0].getTime()),r=!1,l=0,c=0,s=i;s<o;s+=x)ne(new Date(s),!0)||(r=r||s>i&&s<o,s<a&&(!l||s>l)?l=s:s>a&&(!c||s<c)&&(c=s));Array.from(w.rContainer.querySelectorAll("*:nth-child(-n+"+w.config.showMonths+") > ."+n)).forEach((function(n){var i,o,s,d=n.dateObj.getTime(),u=l>0&&d<l||c>0&&d>c;if(u)return n.classList.add("notAllowed"),void["inRange","startRange","endRange"].forEach((function(e){n.classList.remove(e)}));r&&!u||(["startRange","inRange","endRange","notAllowed"].forEach((function(e){n.classList.remove(e)})),void 0!==e&&(e.classList.add(t<=w.selectedDates[0].getTime()?"startRange":"endRange"),a<t&&d===a?n.classList.add("startRange"):a>t&&d===a&&n.classList.add("endRange"),d>=l&&(0===c||d<=c)&&(o=a,s=t,(i=d)>Math.min(o,s)&&i<Math.max(o,s))&&n.classList.add("inRange")))}))}}function re(){!w.isOpen||w.config.static||w.config.inline||de()}function le(e){return function(n){var t=w.config["_"+e+"Date"]=w.parseDate(n,w.config.dateFormat),a=w.config["_"+("min"===e?"max":"min")+"Date"];void 0!==t&&(w["min"===e?"minDateHasTime":"maxDateHasTime"]=t.getHours()>0||t.getMinutes()>0||t.getSeconds()>0),w.selectedDates&&(w.selectedDates=w.selectedDates.filter((function(e){return ne(e)})),w.selectedDates.length||"min"!==e||F(t),ye()),w.daysContainer&&(ue(),void 0!==t?w.currentYearElement[e]=t.getFullYear().toString():w.currentYearElement.removeAttribute(e),w.currentYearElement.disabled=!!a&&void 0!==t&&a.getFullYear()===t.getFullYear())}}function ce(){return w.config.wrap?p.querySelector("[data-input]"):p}function se(){"object"!=typeof w.config.locale&&void 0===I.l10ns[w.config.locale]&&w.config.errorHandler(new Error("flatpickr: invalid locale "+w.config.locale)),w.l10n=e(e({},I.l10ns.default),"object"==typeof w.config.locale?w.config.locale:"default"!==w.config.locale?I.l10ns[w.config.locale]:void 0),D.D="("+w.l10n.weekdays.shorthand.join("|")+")",D.l="("+w.l10n.weekdays.longhand.join("|")+")",D.M="("+w.l10n.months.shorthand.join("|")+")",D.F="("+w.l10n.months.longhand.join("|")+")",D.K="("+w.l10n.amPM[0]+"|"+w.l10n.amPM[1]+"|"+w.l10n.amPM[0].toLowerCase()+"|"+w.l10n.amPM[1].toLowerCase()+")",void 0===e(e({},v),JSON.parse(JSON.stringify(p.dataset||{}))).time_24hr&&void 0===I.defaultConfig.time_24hr&&(w.config.time_24hr=w.l10n.time_24hr),w.formatDate=b(w),w.parseDate=C({config:w.config,l10n:w.l10n})}function de(e){if("function"!=typeof w.config.position){if(void 0!==w.calendarContainer){De("onPreCalendarPosition");var n=e||w._positionElement,t=Array.prototype.reduce.call(w.calendarContainer.children,(function(e,n){return e+n.offsetHeight}),0),a=w.calendarContainer.offsetWidth,i=w.config.position.split(" "),o=i[0],r=i.length>1?i[1]:null,l=n.getBoundingClientRect(),c=window.innerHeight-l.bottom,d="above"===o||"below"!==o&&c<t&&l.top>t,u=window.pageYOffset+l.top+(d?-t-2:n.offsetHeight+2);if(s(w.calendarContainer,"arrowTop",!d),s(w.calendarContainer,"arrowBottom",d),!w.config.inline){var f=window.pageXOffset+l.left,m=!1,g=!1;"center"===r?(f-=(a-l.width)/2,m=!0):"right"===r&&(f-=a-l.width,g=!0),s(w.calendarContainer,"arrowLeft",!m&&!g),s(w.calendarContainer,"arrowCenter",m),s(w.calendarContainer,"arrowRight",g);var p=window.document.body.offsetWidth-(window.pageXOffset+l.right),h=f+a>window.document.body.offsetWidth,v=p+a>window.document.body.offsetWidth;if(s(w.calendarContainer,"rightMost",h),!w.config.static)if(w.calendarContainer.style.top=u+"px",h)if(v){var D=function(){for(var e=null,n=0;n<document.styleSheets.length;n++){var t=document.styleSheets[n];if(t.cssRules){try{t.cssRules}catch(e){continue}e=t;break}}return null!=e?e:(a=document.createElement("style"),document.head.appendChild(a),a.sheet);var a}();if(void 0===D)return;var b=window.document.body.offsetWidth,C=Math.max(0,b/2-a/2),M=D.cssRules.length,y="{left:"+l.left+"px;right:auto;}";s(w.calendarContainer,"rightMost",!1),s(w.calendarContainer,"centerMost",!0),D.insertRule(".flatpickr-calendar.centerMost:before,.flatpickr-calendar.centerMost:after"+y,M),w.calendarContainer.style.left=C+"px",w.calendarContainer.style.right="auto"}else w.calendarContainer.style.left="auto",w.calendarContainer.style.right=p+"px";else w.calendarContainer.style.left=f+"px",w.calendarContainer.style.right="auto"}}}else w.config.position(w,e)}function ue(){w.config.noCalendar||w.isMobile||(q(),Ce(),U())}function fe(){w._input.focus(),-1!==window.navigator.userAgent.indexOf("MSIE")||void 0!==navigator.msMaxTouchPoints?setTimeout(w.close,0):w.close()}function me(e){e.preventDefault(),e.stopPropagation();var n=f(g(e),(function(e){return e.classList&&e.classList.contains("flatpickr-day")&&!e.classList.contains("flatpickr-disabled")&&!e.classList.contains("notAllowed")}));if(void 0!==n){var t=n,a=w.latestSelectedDateObj=new Date(t.dateObj.getTime()),i=(a.getMonth()<w.currentMonth||a.getMonth()>w.currentMonth+w.config.showMonths-1)&&"range"!==w.config.mode;if(w.selectedDateElem=t,"single"===w.config.mode)w.selectedDates=[a];else if("multiple"===w.config.mode){var o=be(a);o?w.selectedDates.splice(parseInt(o),1):w.selectedDates.push(a)}else"range"===w.config.mode&&(2===w.selectedDates.length&&w.clear(!1,!1),w.latestSelectedDateObj=a,w.selectedDates.push(a),0!==M(a,w.selectedDates[0],!0)&&w.selectedDates.sort((function(e,n){return e.getTime()-n.getTime()})));if(O(),i){var r=w.currentYear!==a.getFullYear();w.currentYear=a.getFullYear(),w.currentMonth=a.getMonth(),r&&(De("onYearChange"),q()),De("onMonthChange")}if(Ce(),U(),ye(),i||"range"===w.config.mode||1!==w.config.showMonths?void 0!==w.selectedDateElem&&void 0===w.hourElement&&w.selectedDateElem&&w.selectedDateElem.focus():W(t),void 0!==w.hourElement&&void 0!==w.hourElement&&w.hourElement.focus(),w.config.closeOnSelect){var l="single"===w.config.mode&&!w.config.enableTime,c="range"===w.config.mode&&2===w.selectedDates.length&&!w.config.enableTime;(l||c)&&fe()}Y()}}w.parseDate=C({config:w.config,l10n:w.l10n}),w._handlers=[],w.pluginElements=[],w.loadedPlugins=[],w._bind=P,w._setHoursFromDate=F,w._positionCalendar=de,w.changeMonth=Z,w.changeYear=ee,w.clear=function(e,n){void 0===e&&(e=!0);void 0===n&&(n=!0);w.input.value="",void 0!==w.altInput&&(w.altInput.value="");void 0!==w.mobileInput&&(w.mobileInput.value="");w.selectedDates=[],w.latestSelectedDateObj=void 0,!0===n&&(w.currentYear=w._initialDate.getFullYear(),w.currentMonth=w._initialDate.getMonth());if(!0===w.config.enableTime){var t=E(w.config),a=t.hours,i=t.minutes,o=t.seconds;A(a,i,o)}w.redraw(),e&&De("onChange")},w.close=function(){w.isOpen=!1,w.isMobile||(void 0!==w.calendarContainer&&w.calendarContainer.classList.remove("open"),void 0!==w._input&&w._input.classList.remove("active"));De("onClose")},w.onMouseOver=oe,w._createElement=d,w.createDay=R,w.destroy=function(){void 0!==w.config&&De("onDestroy");for(var e=w._handlers.length;e--;)w._handlers[e].remove();if(w._handlers=[],w.mobileInput)w.mobileInput.parentNode&&w.mobileInput.parentNode.removeChild(w.mobileInput),w.mobileInput=void 0;else if(w.calendarContainer&&w.calendarContainer.parentNode)if(w.config.static&&w.calendarContainer.parentNode){var n=w.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 w.calendarContainer.parentNode.removeChild(w.calendarContainer);w.altInput&&(w.input.type="text",w.altInput.parentNode&&w.altInput.parentNode.removeChild(w.altInput),delete w.altInput);w.input&&(w.input.type=w.input._type,w.input.classList.remove("flatpickr-input"),w.input.removeAttribute("readonly"));["_showTimeInput","latestSelectedDateObj","_hideNextMonthArrow","_hidePrevMonthArrow","__hideNextMonthArrow","__hidePrevMonthArrow","isMobile","isOpen","selectedDateElem","minDateHasTime","maxDateHasTime","days","daysContainer","_input","_positionElement","innerContainer","rContainer","monthNav","todayDateElem","calendarContainer","weekdayContainer","prevMonthNav","nextMonthNav","monthsDropdownContainer","currentMonthElement","currentYearElement","navigationCurrentMonth","selectedDateElem","config"].forEach((function(e){try{delete w[e]}catch(e){}}))},w.isEnabled=ne,w.jumpToDate=j,w.updateValue=ye,w.open=function(e,n){void 0===n&&(n=w._positionElement);if(!0===w.isMobile){if(e){e.preventDefault();var t=g(e);t&&t.blur()}return void 0!==w.mobileInput&&(w.mobileInput.focus(),w.mobileInput.click()),void De("onOpen")}if(w._input.disabled||w.config.inline)return;var a=w.isOpen;w.isOpen=!0,a||(w.calendarContainer.classList.add("open"),w._input.classList.add("active"),De("onOpen"),de(n));!0===w.config.enableTime&&!0===w.config.noCalendar&&(!1!==w.config.allowInput||void 0!==e&&w.timeContainer.contains(e.relatedTarget)||setTimeout((function(){return w.hourElement.select()}),50))},w.redraw=ue,w.set=function(e,n){if(null!==e&&"object"==typeof e)for(var a in Object.assign(w.config,e),e)void 0!==ge[a]&&ge[a].forEach((function(e){return e()}));else w.config[e]=n,void 0!==ge[e]?ge[e].forEach((function(e){return e()})):t.indexOf(e)>-1&&(w.config[e]=c(n));w.redraw(),ye(!0)},w.setDate=function(e,n,t){void 0===n&&(n=!1);void 0===t&&(t=w.config.dateFormat);if(0!==e&&!e||e instanceof Array&&0===e.length)return w.clear(n);pe(e,t),w.latestSelectedDateObj=w.selectedDates[w.selectedDates.length-1],w.redraw(),j(void 0,n),F(),0===w.selectedDates.length&&w.clear(!1);ye(n),n&&De("onChange")},w.toggle=function(e){if(!0===w.isOpen)return w.close();w.open(e)};var ge={locale:[se,G],showMonths:[V,S,z],minDate:[j],maxDate:[j],positionElement:[ve],clickOpens:[function(){!0===w.config.clickOpens?(P(w._input,"focus",w.open),P(w._input,"click",w.open)):(w._input.removeEventListener("focus",w.open),w._input.removeEventListener("click",w.open))}]};function pe(e,n){var t=[];if(e instanceof Array)t=e.map((function(e){return w.parseDate(e,n)}));else if(e instanceof Date||"number"==typeof e)t=[w.parseDate(e,n)];else if("string"==typeof e)switch(w.config.mode){case"single":case"time":t=[w.parseDate(e,n)];break;case"multiple":t=e.split(w.config.conjunction).map((function(e){return w.parseDate(e,n)}));break;case"range":t=e.split(w.l10n.rangeSeparator).map((function(e){return w.parseDate(e,n)}))}else w.config.errorHandler(new Error("Invalid date supplied: "+JSON.stringify(e)));w.selectedDates=w.config.allowInvalidPreload?t:t.filter((function(e){return e instanceof Date&&ne(e,!1)})),"range"===w.config.mode&&w.selectedDates.sort((function(e,n){return e.getTime()-n.getTime()}))}function he(e){return e.slice().map((function(e){return"string"==typeof e||"number"==typeof e||e instanceof Date?w.parseDate(e,void 0,!0):e&&"object"==typeof e&&e.from&&e.to?{from:w.parseDate(e.from,void 0),to:w.parseDate(e.to,void 0)}:e})).filter((function(e){return e}))}function ve(){w._positionElement=w.config.positionElement||w._input}function De(e,n){if(void 0!==w.config){var t=w.config[e];if(void 0!==t&&t.length>0)for(var a=0;t[a]&&a<t.length;a++)t[a](w.selectedDates,w.input.value,w,n);"onChange"===e&&(w.input.dispatchEvent(we("change")),w.input.dispatchEvent(we("input")))}}function we(e){var n=document.createEvent("Event");return n.initEvent(e,!0,!0),n}function be(e){for(var n=0;n<w.selectedDates.length;n++){var t=w.selectedDates[n];if(t instanceof Date&&0===M(t,e))return""+n}return!1}function Ce(){w.config.noCalendar||w.isMobile||!w.monthNav||(w.yearElements.forEach((function(e,n){var t=new Date(w.currentYear,w.currentMonth,1);t.setMonth(w.currentMonth+n),w.config.showMonths>1||"static"===w.config.monthSelectorType?w.monthElements[n].textContent=h(t.getMonth(),w.config.shorthandCurrentMonth,w.l10n)+" ":w.monthsDropdownContainer.value=t.getMonth().toString(),e.value=t.getFullYear().toString()})),w._hidePrevMonthArrow=void 0!==w.config.minDate&&(w.currentYear===w.config.minDate.getFullYear()?w.currentMonth<=w.config.minDate.getMonth():w.currentYear<w.config.minDate.getFullYear()),w._hideNextMonthArrow=void 0!==w.config.maxDate&&(w.currentYear===w.config.maxDate.getFullYear()?w.currentMonth+1>w.config.maxDate.getMonth():w.currentYear>w.config.maxDate.getFullYear()))}function Me(e){var n=e||(w.config.altInput?w.config.altFormat:w.config.dateFormat);return w.selectedDates.map((function(e){return w.formatDate(e,n)})).filter((function(e,n,t){return"range"!==w.config.mode||w.config.enableTime||t.indexOf(e)===n})).join("range"!==w.config.mode?w.config.conjunction:w.l10n.rangeSeparator)}function ye(e){void 0===e&&(e=!0),void 0!==w.mobileInput&&w.mobileFormatStr&&(w.mobileInput.value=void 0!==w.latestSelectedDateObj?w.formatDate(w.latestSelectedDateObj,w.mobileFormatStr):""),w.input.value=Me(w.config.dateFormat),void 0!==w.altInput&&(w.altInput.value=Me(w.config.altFormat)),!1!==e&&De("onValueUpdate")}function xe(e){var n=g(e),t=w.prevMonthNav.contains(n),a=w.nextMonthNav.contains(n);t||a?Z(t?-1:1):w.yearElements.indexOf(n)>=0?n.select():n.classList.contains("arrowUp")?w.changeYear(w.currentYear+1):n.classList.contains("arrowDown")&&w.changeYear(w.currentYear-1)}return function(){w.element=w.input=p,w.isOpen=!1,function(){var n=["wrap","weekNumbers","allowInput","allowInvalidPreload","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],i=e(e({},JSON.parse(JSON.stringify(p.dataset||{}))),v),o={};w.config.parseDate=i.parseDate,w.config.formatDate=i.formatDate,Object.defineProperty(w.config,"enable",{get:function(){return w.config._enable},set:function(e){w.config._enable=he(e)}}),Object.defineProperty(w.config,"disable",{get:function(){return w.config._disable},set:function(e){w.config._disable=he(e)}});var r="time"===i.mode;if(!i.dateFormat&&(i.enableTime||r)){var l=I.defaultConfig.dateFormat||a.dateFormat;o.dateFormat=i.noCalendar||r?"H:i"+(i.enableSeconds?":S":""):l+" H:i"+(i.enableSeconds?":S":"")}if(i.altInput&&(i.enableTime||r)&&!i.altFormat){var s=I.defaultConfig.altFormat||a.altFormat;o.altFormat=i.noCalendar||r?"h:i"+(i.enableSeconds?":S K":" K"):s+" h:i"+(i.enableSeconds?":S":"")+" K"}Object.defineProperty(w.config,"minDate",{get:function(){return w.config._minDate},set:le("min")}),Object.defineProperty(w.config,"maxDate",{get:function(){return w.config._maxDate},set:le("max")});var d=function(e){return function(n){w.config["min"===e?"_minTime":"_maxTime"]=w.parseDate(n,"H:i:S")}};Object.defineProperty(w.config,"minTime",{get:function(){return w.config._minTime},set:d("min")}),Object.defineProperty(w.config,"maxTime",{get:function(){return w.config._maxTime},set:d("max")}),"time"===i.mode&&(w.config.noCalendar=!0,w.config.enableTime=!0);Object.assign(w.config,o,i);for(var u=0;u<n.length;u++)w.config[n[u]]=!0===w.config[n[u]]||"true"===w.config[n[u]];t.filter((function(e){return void 0!==w.config[e]})).forEach((function(e){w.config[e]=c(w.config[e]||[]).map(T)})),w.isMobile=!w.config.disableMobile&&!w.config.inline&&"single"===w.config.mode&&!w.config.disable.length&&!w.config.enable&&!w.config.weekNumbers&&/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);for(u=0;u<w.config.plugins.length;u++){var f=w.config.plugins[u](w)||{};for(var m in f)t.indexOf(m)>-1?w.config[m]=c(f[m]).map(T).concat(w.config[m]):void 0===i[m]&&(w.config[m]=f[m])}i.altInputClass||(w.config.altInputClass=ce().className+" "+w.config.altInputClass);De("onParseConfig")}(),se(),function(){if(w.input=ce(),!w.input)return void w.config.errorHandler(new Error("Invalid input element specified"));w.input._type=w.input.type,w.input.type="text",w.input.classList.add("flatpickr-input"),w._input=w.input,w.config.altInput&&(w.altInput=d(w.input.nodeName,w.config.altInputClass),w._input=w.altInput,w.altInput.placeholder=w.input.placeholder,w.altInput.disabled=w.input.disabled,w.altInput.required=w.input.required,w.altInput.tabIndex=w.input.tabIndex,w.altInput.type="text",w.input.setAttribute("type","hidden"),!w.config.static&&w.input.parentNode&&w.input.parentNode.insertBefore(w.altInput,w.input.nextSibling));w.config.allowInput||w._input.setAttribute("readonly","readonly");ve()}(),function(){w.selectedDates=[],w.now=w.parseDate(w.config.now)||new Date;var e=w.config.defaultDate||("INPUT"!==w.input.nodeName&&"TEXTAREA"!==w.input.nodeName||!w.input.placeholder||w.input.value!==w.input.placeholder?w.input.value:null);e&&pe(e,w.config.dateFormat);w._initialDate=w.selectedDates.length>0?w.selectedDates[0]:w.config.minDate&&w.config.minDate.getTime()>w.now.getTime()?w.config.minDate:w.config.maxDate&&w.config.maxDate.getTime()<w.now.getTime()?w.config.maxDate:w.now,w.currentYear=w._initialDate.getFullYear(),w.currentMonth=w._initialDate.getMonth(),w.selectedDates.length>0&&(w.latestSelectedDateObj=w.selectedDates[0]);void 0!==w.config.minTime&&(w.config.minTime=w.parseDate(w.config.minTime,"H:i"));void 0!==w.config.maxTime&&(w.config.maxTime=w.parseDate(w.config.maxTime,"H:i"));w.minDateHasTime=!!w.config.minDate&&(w.config.minDate.getHours()>0||w.config.minDate.getMinutes()>0||w.config.minDate.getSeconds()>0),w.maxDateHasTime=!!w.config.maxDate&&(w.config.maxDate.getHours()>0||w.config.maxDate.getMinutes()>0||w.config.maxDate.getSeconds()>0)}(),w.utils={getDaysInMonth:function(e,n){return void 0===e&&(e=w.currentMonth),void 0===n&&(n=w.currentYear),1===e&&(n%4==0&&n%100!=0||n%400==0)?29:w.l10n.daysInMonth[e]}},w.isMobile||function(){var e=window.document.createDocumentFragment();if(w.calendarContainer=d("div","flatpickr-calendar"),w.calendarContainer.tabIndex=-1,!w.config.noCalendar){if(e.appendChild((w.monthNav=d("div","flatpickr-months"),w.yearElements=[],w.monthElements=[],w.prevMonthNav=d("span","flatpickr-prev-month"),w.prevMonthNav.innerHTML=w.config.prevArrow,w.nextMonthNav=d("span","flatpickr-next-month"),w.nextMonthNav.innerHTML=w.config.nextArrow,V(),Object.defineProperty(w,"_hidePrevMonthArrow",{get:function(){return w.__hidePrevMonthArrow},set:function(e){w.__hidePrevMonthArrow!==e&&(s(w.prevMonthNav,"flatpickr-disabled",e),w.__hidePrevMonthArrow=e)}}),Object.defineProperty(w,"_hideNextMonthArrow",{get:function(){return w.__hideNextMonthArrow},set:function(e){w.__hideNextMonthArrow!==e&&(s(w.nextMonthNav,"flatpickr-disabled",e),w.__hideNextMonthArrow=e)}}),w.currentYearElement=w.yearElements[0],Ce(),w.monthNav)),w.innerContainer=d("div","flatpickr-innerContainer"),w.config.weekNumbers){var n=function(){w.calendarContainer.classList.add("hasWeeks");var e=d("div","flatpickr-weekwrapper");e.appendChild(d("span","flatpickr-weekday",w.l10n.weekAbbreviation));var n=d("div","flatpickr-weeks");return e.appendChild(n),{weekWrapper:e,weekNumbers:n}}(),t=n.weekWrapper,a=n.weekNumbers;w.innerContainer.appendChild(t),w.weekNumbers=a,w.weekWrapper=t}w.rContainer=d("div","flatpickr-rContainer"),w.rContainer.appendChild(z()),w.daysContainer||(w.daysContainer=d("div","flatpickr-days"),w.daysContainer.tabIndex=-1),U(),w.rContainer.appendChild(w.daysContainer),w.innerContainer.appendChild(w.rContainer),e.appendChild(w.innerContainer)}w.config.enableTime&&e.appendChild(function(){w.calendarContainer.classList.add("hasTime"),w.config.noCalendar&&w.calendarContainer.classList.add("noCalendar");var e=E(w.config);w.timeContainer=d("div","flatpickr-time"),w.timeContainer.tabIndex=-1;var n=d("span","flatpickr-time-separator",":"),t=m("flatpickr-hour",{"aria-label":w.l10n.hourAriaLabel});w.hourElement=t.getElementsByTagName("input")[0];var a=m("flatpickr-minute",{"aria-label":w.l10n.minuteAriaLabel});w.minuteElement=a.getElementsByTagName("input")[0],w.hourElement.tabIndex=w.minuteElement.tabIndex=-1,w.hourElement.value=o(w.latestSelectedDateObj?w.latestSelectedDateObj.getHours():w.config.time_24hr?e.hours:function(e){switch(e%24){case 0:case 12:return 12;default:return e%12}}(e.hours)),w.minuteElement.value=o(w.latestSelectedDateObj?w.latestSelectedDateObj.getMinutes():e.minutes),w.hourElement.setAttribute("step",w.config.hourIncrement.toString()),w.minuteElement.setAttribute("step",w.config.minuteIncrement.toString()),w.hourElement.setAttribute("min",w.config.time_24hr?"0":"1"),w.hourElement.setAttribute("max",w.config.time_24hr?"23":"12"),w.hourElement.setAttribute("maxlength","2"),w.minuteElement.setAttribute("min","0"),w.minuteElement.setAttribute("max","59"),w.minuteElement.setAttribute("maxlength","2"),w.timeContainer.appendChild(t),w.timeContainer.appendChild(n),w.timeContainer.appendChild(a),w.config.time_24hr&&w.timeContainer.classList.add("time24hr");if(w.config.enableSeconds){w.timeContainer.classList.add("hasSeconds");var i=m("flatpickr-second");w.secondElement=i.getElementsByTagName("input")[0],w.secondElement.value=o(w.latestSelectedDateObj?w.latestSelectedDateObj.getSeconds():e.seconds),w.secondElement.setAttribute("step",w.minuteElement.getAttribute("step")),w.secondElement.setAttribute("min","0"),w.secondElement.setAttribute("max","59"),w.secondElement.setAttribute("maxlength","2"),w.timeContainer.appendChild(d("span","flatpickr-time-separator",":")),w.timeContainer.appendChild(i)}w.config.time_24hr||(w.amPM=d("span","flatpickr-am-pm",w.l10n.amPM[r((w.latestSelectedDateObj?w.hourElement.value:w.config.defaultHour)>11)]),w.amPM.title=w.l10n.toggleTitle,w.amPM.tabIndex=-1,w.timeContainer.appendChild(w.amPM));return w.timeContainer}());s(w.calendarContainer,"rangeMode","range"===w.config.mode),s(w.calendarContainer,"animate",!0===w.config.animate),s(w.calendarContainer,"multiMonth",w.config.showMonths>1),w.calendarContainer.appendChild(e);var i=void 0!==w.config.appendTo&&void 0!==w.config.appendTo.nodeType;if((w.config.inline||w.config.static)&&(w.calendarContainer.classList.add(w.config.inline?"inline":"static"),w.config.inline&&(!i&&w.element.parentNode?w.element.parentNode.insertBefore(w.calendarContainer,w._input.nextSibling):void 0!==w.config.appendTo&&w.config.appendTo.appendChild(w.calendarContainer)),w.config.static)){var l=d("div","flatpickr-wrapper");w.element.parentNode&&w.element.parentNode.insertBefore(l,w.element),l.appendChild(w.element),w.altInput&&l.appendChild(w.altInput),l.appendChild(w.calendarContainer)}w.config.static||w.config.inline||(void 0!==w.config.appendTo?w.config.appendTo:window.document.body).appendChild(w.calendarContainer)}(),function(){w.config.wrap&&["open","close","toggle","clear"].forEach((function(e){Array.prototype.forEach.call(w.element.querySelectorAll("[data-"+e+"]"),(function(n){return P(n,"click",w[e])}))}));if(w.isMobile)return void function(){var e=w.config.enableTime?w.config.noCalendar?"time":"datetime-local":"date";w.mobileInput=d("input",w.input.className+" flatpickr-mobile"),w.mobileInput.tabIndex=1,w.mobileInput.type=e,w.mobileInput.disabled=w.input.disabled,w.mobileInput.required=w.input.required,w.mobileInput.placeholder=w.input.placeholder,w.mobileFormatStr="datetime-local"===e?"Y-m-d\\TH:i:S":"date"===e?"Y-m-d":"H:i:S",w.selectedDates.length>0&&(w.mobileInput.defaultValue=w.mobileInput.value=w.formatDate(w.selectedDates[0],w.mobileFormatStr));w.config.minDate&&(w.mobileInput.min=w.formatDate(w.config.minDate,"Y-m-d"));w.config.maxDate&&(w.mobileInput.max=w.formatDate(w.config.maxDate,"Y-m-d"));w.input.getAttribute("step")&&(w.mobileInput.step=String(w.input.getAttribute("step")));w.input.type="hidden",void 0!==w.altInput&&(w.altInput.type="hidden");try{w.input.parentNode&&w.input.parentNode.insertBefore(w.mobileInput,w.input.nextSibling)}catch(e){}P(w.mobileInput,"change",(function(e){w.setDate(g(e).value,!1,w.mobileFormatStr),De("onChange"),De("onClose")}))}();var e=l(re,50);w._debouncedChange=l(Y,300),w.daysContainer&&!/iPhone|iPad|iPod/i.test(navigator.userAgent)&&P(w.daysContainer,"mouseover",(function(e){"range"===w.config.mode&&oe(g(e))}));P(w._input,"keydown",ie),void 0!==w.calendarContainer&&P(w.calendarContainer,"keydown",ie);w.config.inline||w.config.static||P(window,"resize",e);void 0!==window.ontouchstart?P(window.document,"touchstart",X):P(window.document,"mousedown",X);P(window.document,"focus",X,{capture:!0}),!0===w.config.clickOpens&&(P(w._input,"focus",w.open),P(w._input,"click",w.open));void 0!==w.daysContainer&&(P(w.monthNav,"click",xe),P(w.monthNav,["keyup","increment"],N),P(w.daysContainer,"click",me));if(void 0!==w.timeContainer&&void 0!==w.minuteElement&&void 0!==w.hourElement){var n=function(e){return g(e).select()};P(w.timeContainer,["increment"],_),P(w.timeContainer,"blur",_,{capture:!0}),P(w.timeContainer,"click",H),P([w.hourElement,w.minuteElement],["focus","click"],n),void 0!==w.secondElement&&P(w.secondElement,"focus",(function(){return w.secondElement&&w.secondElement.select()})),void 0!==w.amPM&&P(w.amPM,"click",(function(e){_(e)}))}w.config.allowInput&&P(w._input,"blur",ae)}(),(w.selectedDates.length||w.config.noCalendar)&&(w.config.enableTime&&F(w.config.noCalendar?w.latestSelectedDateObj:void 0),ye(!1)),S();var n=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);!w.isMobile&&n&&de(),De("onReady")}(),w}function T(e,n){for(var t=Array.prototype.slice.call(e).filter((function(e){return e instanceof HTMLElement})),a=[],i=0;i<t.length;i++){var o=t[i];try{if(null!==o.getAttribute("data-fp-omit"))continue;void 0!==o._flatpickr&&(o._flatpickr.destroy(),o._flatpickr=void 0),o._flatpickr=k(o,n||{}),a.push(o._flatpickr)}catch(e){console.error(e)}}return 1===a.length?a[0]:a}"undefined"!=typeof HTMLElement&&"undefined"!=typeof HTMLCollection&&"undefined"!=typeof NodeList&&(HTMLCollection.prototype.flatpickr=NodeList.prototype.flatpickr=function(e){return T(this,e)},HTMLElement.prototype.flatpickr=function(e){return T([this],e)});var I=function(e,n){return"string"==typeof e?T(window.document.querySelectorAll(e),n):e instanceof Node?T([e],n):T(e,n)};return I.defaultConfig={},I.l10ns={en:e({},i),default:e({},i)},I.localize=function(n){I.l10ns.default=e(e({},I.l10ns.default),n)},I.setDefaults=function(n){I.defaultConfig=e(e({},I.defaultConfig),n)},I.parseDate=C({}),I.formatDate=b({}),I.compareDates=M,"undefined"!=typeof jQuery&&void 0!==jQuery.fn&&(jQuery.fn.flatpickr=function(e){return T(this,e)}),Date.prototype.fp_incr=function(e){return new Date(this.getFullYear(),this.getMonth(),this.getDate()+("string"==typeof e?parseInt(e,10):e))},"undefined"!=typeof window&&(window.flatpickr=I),I}));
2 3(function (global, factory) { 4 typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : 5 typeof define === 'function' && define.amd ? define(['exports'], factory) : 6 (global = global || self, factory(global.it = {})); 7 }(this, function (exports) { 'use strict'; 8 9 var fp = typeof window !== "undefined" && window.flatpickr !== undefined 10 ? window.flatpickr 11 : { 12 l10ns: {} 13 }; 14 var Italian = { 15 weekdays: { 16 shorthand: ["Dom", "Lun", "Mar", "Mer", "Gio", "Ven", "Sab"], 17 longhand: [ 18 "Domenica", 19 "Lunedì", 20 "Martedì", 21 "Mercoledì", 22 "Giovedì", 23 "Venerdì", 24 "Sabato", 25 ] 26 }, 27 months: { 28 shorthand: [ 29 "Gen", 30 "Feb", 31 "Mar", 32 "Apr", 33 "Mag", 34 "Giu", 35 "Lug", 36 "Ago", 37 "Set", 38 "Ott", 39 "Nov", 40 "Dic", 41 ], 42 longhand: [ 43 "Gennaio", 44 "Febbraio", 45 "Marzo", 46 "Aprile", 47 "Maggio", 48 "Giugno", 49 "Luglio", 50 "Agosto", 51 "Settembre", 52 "Ottobre", 53 "Novembre", 54 "Dicembre", 55 ] 56 }, 57 firstDayOfWeek: 1, 58 ordinal: function () { return "°"; }, 59 rangeSeparator: " al ", 60 weekAbbreviation: "Se", 61 scrollTitle: "Scrolla per aumentare", 62 toggleTitle: "Clicca per cambiare", 63 time_24hr: true 64 }; 65 fp.l10ns.it = Italian; 66 var it = fp.l10ns; 67 68 exports.Italian = Italian; 69 exports.default = it; 70 71 Object.defineProperty(exports, '__esModule', { value: true }); 72 73 })); 74(function (global, factory) { 75 typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : 76 typeof define === 'function' && define.amd ? define(['exports'], factory) : 77 (global = global || self, factory(global.de = {})); 78 }(this, function (exports) { 'use strict'; 79 80 var fp = typeof window !== "undefined" && window.flatpickr !== undefined 81 ? window.flatpickr 82 : { 83 l10ns: {} 84 }; 85 var German = { 86 weekdays: { 87 shorthand: ["So", "Mo", "Di", "Mi", "Do", "Fr", "Sa"], 88 longhand: [ 89 "Sonntag", 90 "Montag", 91 "Dienstag", 92 "Mittwoch", 93 "Donnerstag", 94 "Freitag", 95 "Samstag", 96 ] 97 }, 98 months: { 99 shorthand: [ 100 "Jan", 101 "Feb", 102 "Mär", 103 "Apr", 104 "Mai", 105 "Jun", 106 "Jul", 107 "Aug", 108 "Sep", 109 "Okt", 110 "Nov", 111 "Dez", 112 ], 113 longhand: [ 114 "Januar", 115 "Februar", 116 "März", 117 "April", 118 "Mai", 119 "Juni", 120 "Juli", 121 "August", 122 "September", 123 "Oktober", 124 "November", 125 "Dezember", 126 ] 127 }, 128 firstDayOfWeek: 1, 129 weekAbbreviation: "KW", 130 rangeSeparator: " bis ", 131 scrollTitle: "Zum Ãndern scrollen", 132 toggleTitle: "Zum Umschalten klicken", 133 time_24hr: true 134 }; 135 fp.l10ns.de = German; 136 var de = fp.l10ns; 137 138 exports.German = German; 139 exports.default = de; 140 141 Object.defineProperty(exports, '__esModule', { value: true }); 142 143 })); 144(function (global, factory) { 145 typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : 146 typeof define === 'function' && define.amd ? define(['exports'], factory) : 147 (global = global || self, factory(global.es = {})); 148 }(this, function (exports) { 'use strict'; 149 150 var fp = typeof window !== "undefined" && window.flatpickr !== undefined 151 ? window.flatpickr 152 : { 153 l10ns: {} 154 }; 155 var Spanish = { 156 weekdays: { 157 shorthand: ["Dom", "Lun", "Mar", "Mié", "Jue", "Vie", "Sáb"], 158 longhand: [ 159 "Domingo", 160 "Lunes", 161 "Martes", 162 "Miércoles", 163 "Jueves", 164 "Viernes", 165 "Sábado", 166 ] 167 }, 168 months: { 169 shorthand: [ 170 "Ene", 171 "Feb", 172 "Mar", 173 "Abr", 174 "May", 175 "Jun", 176 "Jul", 177 "Ago", 178 "Sep", 179 "Oct", 180 "Nov", 181 "Dic", 182 ], 183 longhand: [ 184 "Enero", 185 "Febrero", 186 "Marzo", 187 "Abril", 188 "Mayo", 189 "Junio", 190 "Julio", 191 "Agosto", 192 "Septiembre", 193 "Octubre", 194 "Noviembre", 195 "Diciembre", 196 ] 197 }, 198 ordinal: function () { 199 return "º"; 200 }, 201 firstDayOfWeek: 1, 202 rangeSeparator: " a ", 203 time_24hr: true 204 }; 205 fp.l10ns.es = Spanish; 206 var es = fp.l10ns; 207 208 exports.Spanish = Spanish; 209 exports.default = es; 210 211 Object.defineProperty(exports, '__esModule', { value: true }); 212 213 })); 214(function (global, factory) { 215 typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : 216 typeof define === 'function' && define.amd ? define(['exports'], factory) : 217 (global = global || self, factory(global.fr = {})); 218 }(this, function (exports) { 'use strict'; 219 220 var fp = typeof window !== "undefined" && window.flatpickr !== undefined 221 ? window.flatpickr 222 : { 223 l10ns: {} 224 }; 225 var French = { 226 firstDayOfWeek: 1, 227 weekdays: { 228 shorthand: ["dim", "lun", "mar", "mer", "jeu", "ven", "sam"], 229 longhand: [ 230 "dimanche", 231 "lundi", 232 "mardi", 233 "mercredi", 234 "jeudi", 235 "vendredi", 236 "samedi", 237 ] 238 }, 239 months: { 240 shorthand: [ 241 "janv", 242 "févr", 243 "mars", 244 "avr", 245 "mai", 246 "juin", 247 "juil", 248 "août", 249 "sept", 250 "oct", 251 "nov", 252 "déc", 253 ], 254 longhand: [ 255 "janvier", 256 "février", 257 "mars", 258 "avril", 259 "mai", 260 "juin", 261 "juillet", 262 "août", 263 "septembre", 264 "octobre", 265 "novembre", 266 "décembre", 267 ] 268 }, 269 ordinal: function (nth) { 270 if (nth > 1) 271 return ""; 272 return "er"; 273 }, 274 rangeSeparator: " au ", 275 weekAbbreviation: "Sem", 276 scrollTitle: "Défiler pour augmenter la valeur", 277 toggleTitle: "Cliquer pour basculer", 278 time_24hr: true 279 }; 280 fp.l10ns.fr = French; 281 var fr = fp.l10ns; 282 283 exports.French = French; 284 exports.default = fr; 285 286 Object.defineProperty(exports, '__esModule', { value: true }); 287 288 })); 289var form_csrf_token = null; 290 291fetch('/token', { 292 method: 'get', 293 headers: { 294 'Content-type': 'text/json; charset=UTF-8' 295 } 296}).then(function(response) { 297 if (response.ok) { 298 return response.text(); 299 } 300 return Promise.reject(response); 301}).then(function(data) { 302 303 formScripts(data); 304 form_csrf_token = data; 305}).catch(function(error) { 306 console.warn('errore token.', error); 307}); 308 309//si occupa di aggiungere calendario, camere, bambini età bambini dipendentemente dal tipo di form 310function formScripts(token) { 311 312 var forms = document.querySelectorAll('.editaForms'); 313
314 forms.forEach((form, index) => { 315 316 var formtype = form.querySelector('input[name=form_type]').value; 317 var formid = form.getAttribute('data-formid'); 318 var max_rooms = form.dataset.max_rooms; 319 var bloccocamere = form.querySelectorAll('.bloccocamere'); 320 var i = 1; // salto la prima camera che rimane visibile 321 var l = bloccocamere.length; 322 // console.log(formid); 323 324 var inputToken = document.createElement("input"); 325 inputToken.setAttribute('type', 'hidden'); 326 inputToken.setAttribute('value', token); 327 inputToken.setAttribute('name', '_token'); 328 document.querySelector('#contactForm-' + formid).appendChild(inputToken); 329 330 const today = new Date(); 331 var openDate = (form.getAttribute('data-opendate') === null || form.getAttribute('data-opendate') === "") ? '' : new Date(form.getAttribute('data-opendate')) ; 332 var closeDate = (form.getAttribute('data-closedate') === null || form.getAttribute('data-closedate') === "") ? '' : new Date(form.getAttribute('data-closedate')); 333 var defaultDate = today; 334 335 console.log('test test'); 336 console.log('closedate',closeDate); 337 338 // if(today > closeDate){ 339 // openDate = new Date(); 340 // closeDate = ''; 341 // } 342 // if(openDate !== '' && today < openDate){ 343 // defaultDate = openDate; 344 // } 345 346 // data odierna come data minima selezionabile (se la data di apertura è già passata) 347 // if( openDate !== '' && openDate.getTime() < today.getTime()) { 348 // openDate = new Date(); 349 // } 350 351 if (typeof hideDefaultDate !== 'undefined' && hideDefaultDate === false) { 352 console.log('asdfasfasasf'); 353 }else{ 354 console.log('undefined'); 355 } 356 357 // typeof hideDefaultDate !== 'undefined' 358 // se hidedefaultdate è definito && hidedefaultdate==true -> nascondi le date 359 // se hidedefaultdate è definito && hidedefaultdate==false -> visualizza le date 360 361 var optionsCalendar = { 362 "partenza": { 363 locale: lang, 364 altInput: true, 365 altFormat: "d-m-Y", 366 dateFormat: "d-m-Y", 367 defaultDate: ( typeof hideDefaultDate === 'undefined' || hideDefaultDate === false) ? defaultDate.fp_incr(global_diff_date_days) : '', 368 minDate: (( openDate instanceof Date ) && !isNaN( openDate ) && openDate.getTime() > today.getTime()) ? openDate : today,
369 }, 370 "arrivo": { 371 locale: lang, 372 altInput: true, 373 altFormat: "d-m-Y", 374 dateFormat: "d-m-Y", 375 defaultDate: ( typeof hideDefaultDate === 'undefined' || hideDefaultDate === false) ? defaultDate : '', 376 minDate: (( openDate instanceof Date ) && !isNaN( openDate ) && openDate.getTime() > today.getTime()) ? openDate : today, 377 378 /* setting initial date of return picker to the one selected in outbound*/ 379 onChange: function(dateStr, dateObj) { 380 var newdate; 381 var dateString = dateObj; 382 var dateParts = dateString.split("-"); 383 // month is 0-based, that's why we need dataParts[1] - 1 384 var dateObject = new Date(+dateParts[2], dateParts[1] - 1, +dateParts[0]); 385 386 newdate = new Date(dateParts[2], dateParts[1] - 1, dateParts[0]); 387 388 FLATPICKER_RITORNO.set("minDate", new Date(newdate.getTime() + (86400000))); 389 FLATPICKER_RITORNO.setDate(new Date(newdate.getTime() + (86400000 * global_diff_date_after_change) )); 390 } 391 } 392 }; 393 394 // INIZIO - gestione data di apertura e chiusura 395 if(( openDate instanceof Date ) && !isNaN( openDate ) && ( closeDate instanceof Date ) && !isNaN( closeDate )) { 396 397 // partenza 398 optionsCalendar.partenza.enable = [ 399 function(date) { 400 const m = date.getMonth() + 1; // 1-12 401 const d = date.getDate(); 402 403 const openMonth = openDate.getMonth() + 1; 404 const openDay = openDate.getDate(); 405 const closeMonth = closeDate.getMonth() + 1; 406 const closeDay = closeDate.getDate(); 407 408 // Se siamo nel mese di apertura, deve essere >= giorno di apertura 409 if (m === openMonth && d >= openDay) return true; 410 411 // Se siamo nel mese di chiusura, deve essere <= giorno di chiusura 412 if (m === closeMonth && d <= closeDay) return true; 413 414 // Se siamo in un mese intermedio (tra apertura e chiusura) 415 if (m > openMonth && m < closeMonth) return true; 416 417 return false; 418 } 419 ]; 420 421 optionsCalendar.partenza.mode = "single"; 422 423 // arrivo 424 optionsCalendar.arrivo.enable = [ 425 function(date) { 426 const m = date.getMonth() + 1; // 1-12 427 const d = date.getDate(); 428 429 const openMonth = openDate.getMonth() + 1; 430 const openDay = openDate.getDate(); 431 const closeMonth = closeDate.getMonth() + 1; 432 const closeDay = closeDate.getDate(); 433 434 // Se siamo nel mese di apertura, deve essere >= giorno di apertura 435 if (m === openMonth && d >= openDay) return true; 436 437 // Se siamo nel mese di chiusura, deve essere <= giorno di chiusura 438 if (m === closeMonth && d <= closeDay) return true; 439 440 // Se siamo in un mese intermedio (tra apertura e chiusura) 441 if (m > openMonth && m < closeMonth) return true; 442 443 return false; 444 } 445 ]; 446 447 optionsCalendar.arrivo.mode = "single"; 448 } 449 // FINE 450 451 if (formtype == 'quote' || formtype == 'booking') { 452 var FLATPICKER_RITORNO = flatpickr('#data_partenza-' + formid, optionsCalendar.partenza); 453 454 flatpickr("#data_arrivo-" + formid, optionsCalendar.arrivo); 455 } 456 457 if (formtype == 'meeting') { 458 flatpickr("#datainizioevento-" + formid, { 459 locale: lang, 460 altInput: true, 461 altFormat: "d-m-Y", 462 dateFormat: "d-m-Y", 463 defaultDate: new Date(), 464 minDate: new Date(), 465 }); 466 } 467 if (formtype == 'restaurant') { 468 flatpickr("#giornoprenotazione-" + formid, { 469 locale: lang, 470 altInput: true, 471 altFormat: "d-m-Y", 472 dateFormat: "d-m-Y", 473 defaultDate: new Date(), 474 minDate: new Date(), 475 }); 476 } 477 478 if (formtype == 'catering') { 479 flatpickr("#giornoprenotazione-" + formid, { 480 locale: lang, 481 altInput: true, 482 altFormat: "d-m-Y", 483 dateFormat: "d-m-Y", 484 defaultDate: new Date(), 485 minDate: new Date(), 486 }); 487 } 488 489 if (formtype == 'quote') {
490 //setta la visibilità delle camere a 0 491 for (i; i < l; i++) { 492 bloccocamere[i].style.display = 'none'; 493 } 494 495 //all'on change di numero camere visualizzo i blocchi corrispondenti 496 var selectNumCamere = form.querySelector("#rooms-" + formid); 497 if (selectNumCamere) { 498 selectNumCamere.addEventListener('change', function() { 499 if (this.value) { 500 for (var j = 1; j <= max_rooms; j++) { 501 var room = form.querySelector('#room' + j + '-' + formid); 502 if (room) { 503 if (j <= this.value) { 504 room.style.display = 'block'; 505 room.querySelector('#adultsRoom' + j + '-' + formid).disabled = false; 506 room.querySelector('#childrensRoom' + j + '-' + formid).disabled = false; 507 } else { 508 room.style.display = 'none'; 509 room.querySelector('#adultsRoom' + j + '-' + formid).disabled = true; 510 room.querySelector('#childrensRoom' + j + '-' + formid).disabled = true; 511 } 512 } 513 } 514 } else { 515 for (var j = 1; j <= max_rooms; j++) { 516 var room = form.querySelector('#room' + j + '-' + formid); 517 if (room) { 518 room.style.display = 'none'; 519 room.querySelector('#adultsRoom' + j + '-' + formid).disabled = true; 520 room.querySelector('#childrensRoom' + j + '-' + formid).disabled = true; 521 } 522 } 523 } 524 }); 525 } 526 527 //all'onchange di num bambini, per ogni camera visualizzo l'età 528 var selectBambini = form.querySelectorAll("select.numbambini").forEach(item => { 529 item.addEventListener('change', function() { 530 var container = item.closest('.bloccocamere'); 531 var room = this.dataset.room; 532 var numChildren = this.value; 533 534 container.querySelectorAll('.bloccoetabambini').forEach(function(element) { 535 element.style.display = 'none'; 536 var selectElement = element.querySelector('select'); 537 // selectElement.disabled = true; 538 // selectElement.value = ''; 539 // nascondi solo le età in eccesso rispetto al numero selezionato 540 if (index + 1 > numChildren) { 541 element.style.display = 'none'; 542 selectElement.disabled = true; 543 selectElement.value = ''; 544 } 545 }); 546 547 for (var i = 1; i <= numChildren; i++) { 548 var ageBlock = container.querySelector('#bloccoetabambini' + i + 'camera' + room + '-' + formid); 549 if (ageBlock) { 550 ageBlock.style.display = 'block'; 551 var selectElement = ageBlock.querySelector('select'); 552 selectElement.disabled = false; 553 } 554 } 555 }) 556 }); 557 } 558 559 form.onsubmit = function(e) { 560 561 e.preventDefault(); 562 var form_id = e.target.dataset.formid; 563 var button = e.target.querySelector('#sendMessageButton-' + form_id); 564 565 if (!validateForm(form_id)) { 566 return false; 567 } 568 569 if (!e.target.classList.contains('formBooking')) { 570 button.setAttribute('disabled', 'disabled'); 571 } 572 573 // INIZIO / mrpreno attribution 574 try { 575 if( window.MrPRENODataAcq != undefined && typeof( window.MrPRENODataAcq.getAttribution ) == "function" ) { 576 577 if( form.querySelector('[name="data[attribution]"]') == null ) { 578 579 var iAttribution = document.createElement("input"); 580 iAttribution.setAttribute("type", "hidden"); 581 iAttribution.setAttribute("name", "data[attribution]"); 582 iAttribution.setAttribute("value", window.MrPRENODataAcq.getAttribution()); 583 584 form.append( iAttribution ); 585 } 586 } 587 } catch(e) { 588 console.log('[mrpreno attribution]', e); 589 } 590 // FINE / mrpreno attribution 591 592 HTMLFormElement.prototype.submit.call(form); 593 594 }; 595 596 597 var onLoadFormEvent = new CustomEvent("onLoadForm"); 598 599 form.dispatchEvent(onLoadFormEvent); 600 }); 601 602} 603 604//funzione globale per la validazione dei campi 605function validateForm(formid) { 606 var errors = []; 607 var form = document.forms["contactForm-" + formid]; 608 var elements = form.elements; 609 const atLeastOne = form.querySelectorAll('[data-atleastone]'); 610 611 for (var i = 0, element; element = elements[i++];) { 612 613 element.classList.remove('error'); 614 if ((element.type === "text" || (element.type === "hidden" && (element.classList.contains('data-arrivo') || element.classList.contains('data-partenza')))) && element.value === "" && element.i
614d && element.attributes["required"]) { 615 errors.push({ 616 'id': element.id, 617 'status': 'error', 618 'label': 'label' 619 }); 620 } 621 if (element.type === "time" && element.value === "" && element.attributes["required"]) { 622 errors.push({ 623 'id': element.id, 624 'status': 'error', 625 'label': 'label' 626 }); 627 } 628 629 if (element.type === "email" && !element.validity.valid && element.attributes["required"]) { 630 errors.push({ 631 'id': element.id, 632 'status': 'error', 633 'label': 'label' 634 }); 635 } 636 if (element.type === "file" && element.value === "" && element.attributes["required"]) { 637 errors.push({ 638 'id': element.id, 639 'status': 'error', 640 'label': 'label' 641 }); 642 } 643 if (element.type === "date" && element.value === "" && element.attributes["required"]) { 644 errors.push({ 645 'id': element.id, 646 'element': element, 647 'status': 'error', 648 'label': 'label' 649 }); 650 } 651 if (element.type === "textarea" && element.value === "" && element.attributes["required"]) { 652 errors.push({ 653 'id': element.id, 654 'status': 'error', 655 'label': 'label' 656 }); 657 } 658 if (element.type === "select-one" && element.value === "" && element.attributes["required"] && !element.attributes["disabled"]) { 659 errors.push({ 660 'id': element.id, 661 'status': 'error', 662 'label': 'label' 663 }); 664 } 665 if (element.type === "checkbox" && !element.checked && element.attributes["required"]) { 666 // questi sono checkbox obbligatori con un singolo/unico valore 667 errors.push({ 668 'id': element.id, 669 'status': 'error', 670 'label': 'label' 671 }); 672 } 673 } 674 675 // per i checkbox obbligatori, con più di 1 valore, controllo 676 // che abbiano selezionato almeno 1 valore 677 for(const checkBlock of atLeastOne) { 678 if(checkBlock.querySelector('[type="checkbox"]:checked') == null) { 679 680 checkBlock.querySelectorAll('[type="checkbox"]').forEach(function(input) { 681 errors.push({ 682 'element': input, 683 'status': 'error', 684 'label': 'label' 685 }); 686 }); 687 } 688 } 689 690 if (errors.length !== 0) { 691 errors.forEach(function(error) { 692 var el; 693 if (error.id) { 694 el = document.getElementById(error.id); 695 if (el.classList.contains('data-arrivo') || el.classList.contains('data-partenza')) { 696 el = el.nextElementSibling; 697 } 698 } else if (error.element) { 699 el = error.element; 700 } 701 702 el.classList.add('error'); 703 }); 704 705 var langValue = document.getElementById('lang-' + formid).value; 706 707 switch (langValue) { 708 case 'it': 709 var warningText = "Attenzione! Uno o più campi obbligatori non sono stati compilati."; 710 break; 711 case 'en': 712 var warningText = "Warning! One or more mandatory fields have not been filled in."; 713 break; 714 case 'fr': 715 var warningText = "Attention! un ou plusieurs champs obligatoires n'ont pas été renseignés."; 716 break; 717 case 'de': 718 var warningText = "Aufmerksamkeit! ein oder mehrere Pflichtfelder wurden nicht ausgefüllt."; 719 break; 720 case 'ru': 721 var warningText = "Ðнимание! одно или неÑколÑко обÑзаÑелÑнÑÑ Ð¿Ð¾Ð»ÐµÐ¹ не заполненÑ."; 722 break; 723 default: 724 var warningText = "Warning! One or more mandatory fields have not been filled in."; 725 } 726 727 var warningDiv = document.createElement("div"); 728 warningDiv.setAttribute("class", "warningMsg"); 729 var message = document.createTextNode(warningText); 730 warningDiv.appendChild(message); 731 732 if (form.querySelectorAll('.warningMsg').length < 1) { 733 form.appendChild(warningDiv); 734 } 735 736 return false;
737 } else { 738 return true; 739 } 740} 741 742document.addEventListener("DOMContentLoaded", function() { 743 //formScripts(); 744}); 745 746/*! 747 * Glide.js v3.4.1 748 * (c) 2013-2019 JÄdrzej ChaÅubek <[email protected]> (http://jedrzejchalubek.com/) 749 * Released under the MIT License. 750 */ 751!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.Glide=e()}(this,function(){"use strict";var n={type:"slider",startAt:0,perView:1,focusAt:0,gap:10,autoplay:!1,hoverpause:!0,keyboard:!0,bound:!1,swipeThreshold:80,dragThreshold:120,perTouch:!1,touchRatio:.5,touchAngle:45,animationDuration:400,rewind:!0,rewindDuration:800,animationTimingFunc:"cubic-bezier(.165, .840, .440, 1)",throttle:10,direction:"ltr",peek:0,breakpoints:{},classes:{direction:{ltr:"glide--ltr",rtl:"glide--rtl"},slider:"glide--slider",carousel:"glide--carousel",swipeable:"glide--swipeable",dragging:"glide--dragging",cloneSlide:"glide__slide--clone",activeNav:"glide__bullet--active",activeSlide:"glide__slide--active",disabledArrow:"glide__arrow--disabled"}};function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t=function(t,e,n){return e&&o(t.prototype,e),n&&o(t,n),t};function o(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var a=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t};function y(t){return parseInt(t)}function s(t){return"string"==typeof t}function u(t){var e=void 0===t?"undefined":r(t);return"function"===e||"object"===e&&!!t}function c(t){return"function"==typeof t}function l(t){return void 0===t}function f(t){return t.constructor===Array}function d(t,e,n){Object.defineProperty(t,e,n)}function h(t,e){var n=a({},t,e);return e.hasOwnProperty("classes")&&(n.classes=a({},t.classes,e.classes),e.classes.hasOwnProperty("direction")&&(n.classes.direction=a({},t.classes.direction,e.classes.direction))),e.hasOwnProperty("breakpoints")&&(n.breakpoints=a({},t.breakpoints,e.breakpoints)),n}var v=(t(e,[{key:"on",value:function(t,e){if(f(t))for(var n=0;n<t.length;n++)this.on(t[n],e);this.hop.call(this.events,t)||(this.events[t]=[]);var i=this.events[t].push(e)-1;return{remove:function(){delete this.events[t][i]}}}},{key:"emit",value:function(t,e){if(f(t))for(var n=0;n<t.length;n++)this.emit(t[n],e);this.hop.call(this.events,t)&&this.events[t].forEach(function(t){t(e||{})})}}]),e);function e(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};i(this,e),this.events=t,this.hop=t.hasOwnProperty}var p=(t(m,[{key:"mount",value:function(t){var e=0<arguments.length&&void 0!==t?t:{};return this._e.emit("mount.before"),u(e)&&(this._c=function(t,e,n){var i={};for(var r in e)c(e[r])&&(i[r]=e[r](t,i,n));for(var o in i)c(i[o].mount)&&i[o].mount();return i}(this,e,this._e)),this._e.emit("mount.after"),this}},{key:"mutate",value:function(t){var e=0<arguments.length&&void 0!==t?t:[];return f(e)&&(this._t=e),this}},{key:"update",value:function(t){var e=0<arguments.length&&void 0!==t?t:{};return this.settings=h(this.settings,e),e.hasOwnProperty("startAt")&&(this.index=e.startAt),this._e.emit("update"),this}},{key:"go",value:function(t){return this._c.Run.make(t),this}},{key:"move",value:function(t){return this._c.Transition.disable(),this._c.Move.make(t),this}},{key:"destroy",value:function(){return this._e.emit("destroy"),this}},{key:"play",value:function(t){var e=0<arguments.length&&void 0!==t&&t;return e&&(this.settings.autoplay=e),this._e.emit("play"),this}},{key:"pause",value:function(){return this._e.emit("pause"),this}},{key:"disable",value:function(){return this.disabled=!0,this}},{key:"enable",value:function(){return this.disabled=!1,this}},{key:"on",value:function(t,e){return this._e.on(t,e),this}},{key:"isType",value:function(t){return this.settings.type===t}},{key:"settings",get:function(){return this._o},set:function(t){u(t)&&(this._o=t)}},{key:"index",get:function(){return this._i},set:function(t){this._i=y(t)}},{key:"type",get:function(){return this.settings.type}},{key:"disabled",get:function(){return this._d},set:function(t){this._d=!!t}}]),m);function m(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};i(this,m),this._c={},this._t=[],this._e=new v,this.disabled=!1,this.selector=t,this.settings=h(n,e),this.index=this.settings.startAt}function g(){return(new Date).getTime()}function b(n,i,r){var o=void 0,s=void 0,u=void 0,a=void 0,c=0;r=r||{};function l(){c=!1===r.leading?0:g(),o=null,a=n.apply(s,u),o||(s=u=null)}function t(){var t=g();c||!1!==r.leading||(c=t);var e=i-(t-c);return s=this,u=arguments,e<=0||i<e?(o&&(clearTimeout(o),o=null),c=t,a=n.apply(s,u),o||(s=u=null)):o||!1===r.trailing||(o=setTimeout(l,e)),a}return t.cancel=function(){clearTimeout(o),c=0,o=s=u=null},t}var w={ltr:["marginLeft","marginRight"],rtl:["marginRight","marginLeft"]};function _(t){if(t&&t.parentNode){for(var e=t.parentNode.firstChild,n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n}return[]}function k(t){return!!(t&&t instanceof window.HTMLElement)}var S='[data-glide-el="track"]';var H=(t(T,[{key:"on",value:function(t,e,n,i){var r=3<arguments.length&&void 0!==i&&i;s(t)&&(t=[t]);for(var o=0;o<t.length;o++)this.listeners[t[o]]=n,e.addEventListener(t[o],this.listeners[t[o]],r)}},{key:"off",value:function(t,e,n){var i=2<arguments.length&&void 0!==n&&n;s(t)&&(t=[t]);for(var r=0;r<t.length;r++)e.removeEventListener(t[r],this.listeners[t[r]],i)}},{key:"destroy",value:function(){delete this.listeners}}]),T);function T(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};i(this,T),this.listeners=t}var x=["ltr","rtl"],O={">":"<","<":">","=":"="};function A(t,e){return{modify:function(t){return e.Direction.is("rtl")?-t:t}}}function M(i,r,o){var s=[function(e,n){return{modify:function(t){return t+n.Gaps.value*e.index}}},function(t,e){return{modify:function(t){return t+e.Clones.grow/2}}},function(n,i){return{modify:function(t){if(0<=n.settings.focusAt){var e=i.Peek.value;return u(e)?t-e.before:t-e}return t}}}
751,function(o,s){return{modify:function(t){var e=s.Gaps.value,n=s.Sizes.width,i=o.settings.focusAt,r=s.Sizes.slideWidth;return"center"===i?t-(n/2-r/2):t-r*i-e*i}}}].concat(i._t,[A]);return{mutate:function(t){for(var e=0;e<s.length;e++){var n=s[e];c(n)&&c(n().modify)&&(t=n(i,r,o).modify(t))}return t}}}var C=!1;try{var P=Object.defineProperty({},"passive",{get:function(){C=!0}});window.addEventListener("testPassive",null,P),window.removeEventListener("testPassive",null,P)}catch(t){}var L=C,z=["touchstart","mousedown"],j=["touchmove","mousemove"],D=["touchend","touchcancel","mouseup","mouseleave"],E=["mousedown","mousemove","mouseup","mouseleave"];function R(t){return u(t)?function(n){return Object.keys(n).sort().reduce(function(t,e){return t[e]=n[e],t[e],t},{})}(t):{}}var W={Html:function(e,t){var n={mount:function(){this.root=e.selector,this.track=this.root.querySelector(S),this.slides=Array.prototype.slice.call(this.wrapper.children).filter(function(t){return!t.classList.contains(e.settings.classes.cloneSlide)})}};return d(n,"root",{get:function(){return n._r},set:function(t){s(t)&&(t=document.querySelector(t)),k(t)&&(n._r=t)}}),d(n,"track",{get:function(){return n._t},set:function(t){k(t)&&(n._t=t)}}),d(n,"wrapper",{get:function(){return n.track.children[0]}}),n},Translate:function(r,o,s){var u={set:function(t){var e=M(r,o).mutate(t);o.Html.wrapper.style.transform="translate3d("+-1*e+"px, 0px, 0px)"},remove:function(){o.Html.wrapper.style.transform=""}};return s.on("move",function(t){var e=o.Gaps.value,n=o.Sizes.length,i=o.Sizes.slideWidth;return r.isType("carousel")&&o.Run.isOffset("<")?(o.Transition.after(function(){s.emit("translate.jump"),u.set(i*(n-1))}),u.set(-i-e*n)):r.isType("carousel")&&o.Run.isOffset(">")?(o.Transition.after(function(){s.emit("translate.jump"),u.set(0)}),u.set(i*n+e*n)):u.set(t.movement)}),s.on("destroy",function(){u.remove()}),u},Transition:function(n,i,t){var r=!1,e={compose:function(t){var e=n.settings;return r?t+" 0ms "+e.animationTimingFunc:t+" "+this.duration+"ms "+e.animationTimingFunc},set:function(t){var e=0<arguments.length&&void 0!==t?t:"transform";i.Html.wrapper.style.transition=this.compose(e)},remove:function(){i.Html.wrapper.style.transition=""},after:function(t){setTimeout(function(){t()},this.duration)},enable:function(){r=!1,this.set()},disable:function(){r=!0,this.set()}};return d(e,"duration",{get:function(){var t=n.settings;return n.isType("slider")&&i.Run.offset?t.rewindDuration:t.animationDuration}}),t.on("move",function(){e.set()}),t.on(["build.before","resize","translate.jump"],function(){e.disable()}),t.on("run",function(){e.enable()}),t.on("destroy",function(){e.remove()}),e},Direction:function(t,e,n){var i={mount:function(){this.value=t.settings.direction},resolve:function(t){var e=t.slice(0,1);return this.is("rtl")?t.split(e).join(O[e]):t},is:function(t){return this.value===t},addClass:function(){e.Html.root.classList.add(t.settings.classes.direction[this.value])},removeClass:function(){e.Html.root.classList.remove(t.settings.classes.direction[this.value])}};return d(i,"value",{get:function(){return i._v},set:function(t){-1<x.indexOf(t)&&(i._v=t)}}),n.on(["destroy","update"],function(){i.removeClass()}),n.on("update",function(){i.mount()}),n.on(["build.before","update"],function(){i.addClass()}),i},Peek:function(n,t,e){var i={mount:function(){this.value=n.settings.peek}};return d(i,"value",{get:function(){return i._v},set:function(t){u(t)?(t.before=y(t.before),t.after=y(t.after)):t=y(t),i._v=t}}),d(i,"reductor",{get:function(){var t=i.value,e=n.settings.perView;return u(t)?t.before/e+t.after/e:2*t/e}}),e.on(["resize","update"],function(){i.mount()}),i},Sizes:function(t,i,e){var n={setupSlides:function(){for(var t=this.slideWidth+"px",e=i.Html.slides,n=0;n<e.length;n++)e[n].style.width=t},setupWrapper:function(t){i.Html.wrapper.style.width=this.wrapperSize+"px"},remove:function(){for(var t=i.Html.slides,e=0;e<t.length;e++)t[e].style.width="";i.Html.wrapper.style.width=""}};return d(n,"length",{get:function(){return i.Html.slides.length}}),d(n,"width",{get:function(){return i.Html.root.offsetWidth}}),d(n,"wrapperSize",{get:function(){return n.slideWidth*n.length+i.Gaps.grow+i.Clones.grow}}),d(n,"slideWidth",{get:function(){return n.width/t.settings.perView-i.Peek.reductor-i.Gaps.reductor}}),e.on(["build.before","resize","update"],function(){n.setupSlides(),n.setupWrapper()}),e.on("destroy",function(){n.remove()}),n},Gaps:function(e,o,t){var n={apply:function(t){for(var e=0,n=t.length;e<n;e++){var i=t[e].style,r=o.Direction.value;i[w[r][0]]=0!==e?this.value/2+"px":"",e!==t.length-1?i[w[r][1]]=this.value/2+"px":i[w[r][1]]=""}},remove:function(t){for(var e=0,n=t.length;e<n;e++){var i=t[e].style;i.marginLeft="",i.marginRight=""}}};return d(n,"value",{get:function(){return y(e.settings.gap)}}),d(n,"grow",{get:function(){return n.value*(o.Sizes.length-1)}}),d(n,"reductor",{get:function(){var t=e.settings.perView;return n.value*(t-1)/t}}),t.on(["build.after","update"],b(function(){n.apply(o.Html.wrapper.children)},30)),t.on("destroy",function(){n.remove(o.Html.wrapper.children)}),n},Move:function(t,i,r){var e={mount:function(){this._o=0},make:function(t){var e=this,n=0<arguments.length&&void 0!==t?t:0;this.offset=n,r.emit("move",{movement:this.value}),i.Transition.after(function(){r.emit("move.after",{movement:e.value})})}};return d(e,"offset",{get:function(){return e._o},set:function(t){e._o=l(t)?0:y(t)}}),d(e,"translate",{get:function(){return i.Sizes.slideWidth*t.index}}),d(e,"value",{get:function(){var t=this.offset,e=this.translate;return i.Direction.is("rtl")?e+t:e-t}}),r.on(["build.before","run"],function(){e.make()}),e},Clones:function(v,p,t){var e={mount:function(){this.items=[],v.isType("carousel")&&(this.items=this.collect())},collect:function(t){for(var e=0<arguments.length&&void 0!==t?t:[],n=p.Html.slides,i=v.settings,r=i.perView,o=i.classes,s=r+ +!!v.settings.peek,u=n.slice(0,s),a=n.slice(-s),c=0;c<Math.max(1,Math.floor(r/n.length));c++){for(var l=0;l<u.length;l++){var f=u[l].cloneNode(!0);f.classList.add(o.cloneSlide),e.push(f)}for(var d=0;d<a.length;d++){var h=a[d].cloneNode(!0);h.classList.add(o.cloneSlide),e.unshift(h)}}return e},append:function(){for(var t=this.items,e=p.Html,n=e.wrapper,i=e.slides,r=Math.floor(t.length/2),o=t.slice(0,r).reverse(),s=t.slice(r,t.length),u=p.Sizes.slideWidth+"px",a=0;a<s.length;a++)n.appendChild(s[a]);for(var c=0;c<o.length;c++)n.insertBefore(o[c],i[0]);for(var l=0;l<t.length;l++)t[l].style.width=u},remove:function(){for(var t=this.items,e=0;e<t.length;e++)p.Html.wrapper.removeChild(t[e])}};return d(e,"grow",{get:function(){return(p.Sizes.slideWidth+p.Gaps.value)*e.items.length}}),t.on("update",function(){e.remove(),e.mount(),e.append()}),t.on("build.before",function(){v.isType("carousel")&&e.append()}),t.on("destroy",function(){e.remove()}),e},Resize:function(t,e,n){var i=new H,r={mount:function(){this.bind()},bind:function(){i.on("resize",window,b(function(){n.emit("resize")},t.settings.throttle))},unbind:function(){i.off("resize",window)}};return n.on("destroy",function(){r.unbind(),i.destroy()}),r},Build:function(n,i,t){var e={mount:function(){t.emit("build.before"),this.typeClass(),this.activeClass(),t.emit("build.after")},typeClass:function(){i.Html.root.classList.add(n.settings.classes[n.settings.type])},activeClass:function(){var e=n.settings.classes,t=i.Html.slides[n.index];t&&(t.classList.add(e.activeSlide),_(t).forEach(function(t){t.classList.remove(e.activeSlide)}))},removeClasses:function(){var e=n.settings.classes;i.Html.root.classList.remove(e[n.settings.type]),i.Html.slides.forEac
751h(function(t){t.classList.remove(e.activeSlide)})}};return t.on(["destroy","update"],function(){e.removeClasses()}),t.on(["resize","update"],function(){e.mount()}),t.on("move.after",function(){e.activeClass()}),e},Run:function(o,n,i){var t={mount:function(){this._o=!1},make:function(t){var e=this;o.disabled||(o.disable(),this.move=t,i.emit("run.before",this.move),this.calculate(),i.emit("run",this.move),n.Transition.after(function(){e.isStart()&&i.emit("run.start",e.move),e.isEnd()&&i.emit("run.end",e.move),(e.isOffset("<")||e.isOffset(">"))&&(e._o=!1,i.emit("run.offset",e.move)),i.emit("run.after",e.move),o.enable()}))},calculate:function(){var t=this.move,e=this.length,n=t.steps,i=t.direction,r=function(t){return"number"==typeof t}(y(n))&&0!==y(n);switch(i){case">":">"===n?o.index=e:this.isEnd()?o.isType("slider")&&!o.settings.rewind||(this._o=!0,o.index=0):r?o.index+=Math.min(e-o.index,-y(n)):o.index++;break;case"<":"<"===n?o.index=0:this.isStart()?o.isType("slider")&&!o.settings.rewind||(this._o=!0,o.index=e):r?o.index-=Math.min(o.index,y(n)):o.index--;break;case"=":o.index=n}},isStart:function(){return 0===o.index},isEnd:function(){return o.index===this.length},isOffset:function(t){return this._o&&this.move.direction===t}};return d(t,"move",{get:function(){return this._m},set:function(t){var e=t.substr(1);this._m={direction:t.substr(0,1),steps:e?y(e)?y(e):e:0}}}),d(t,"length",{get:function(){var t=o.settings,e=n.Html.slides.length;return o.isType("slider")&&"center"!==t.focusAt&&t.bound?e-1-(y(t.perView)-1)+y(t.focusAt):e-1}}),d(t,"offset",{get:function(){return this._o}}),t},Swipe:function(d,h,v){var n=new H,p=0,m=0,g=0,i=!1,r=!!L&&{passive:!0},t={mount:function(){this.bindSwipeStart()},start:function(t){if(!i&&!d.disabled){this.disable();var e=this.touches(t);p=null,m=y(e.pageX),g=y(e.pageY),this.bindSwipeMove(),this.bindSwipeEnd(),v.emit("swipe.start")}},move:function(t){if(!d.disabled){var e=d.settings,n=e.touchAngle,i=e.touchRatio,r=e.classes,o=this.touches(t),s=y(o.pageX)-m,u=y(o.pageY)-g,a=Math.abs(s<<2),c=Math.abs(u<<2),l=Math.sqrt(a+c),f=Math.sqrt(c);if(!(180*(p=Math.asin(f/l))/Math.PI<n))return!1;t.stopPropagation(),h.Move.make(s*function(t){return parseFloat(t)}(i)),h.Html.root.classList.add(r.dragging),v.emit("swipe.move")}},end:function(t){if(!d.disabled){var e=d.settings,n=this.touches(t),i=this.threshold(t),r=n.pageX-m,o=180*p/Math.PI,s=Math.round(r/h.Sizes.slideWidth);this.enable(),i<r&&o<e.touchAngle?(e.perTouch&&(s=Math.min(s,y(e.perTouch))),h.Direction.is("rtl")&&(s=-s),h.Run.make(h.Direction.resolve("<"+s))):r<-i&&o<e.touchAngle?(e.perTouch&&(s=Math.max(s,-y(e.perTouch))),h.Direction.is("rtl")&&(s=-s),h.Run.make(h.Direction.resolve(">"+s))):h.Move.make(),h.Html.root.classList.remove(e.classes.dragging),this.unbindSwipeMove(),this.unbindSwipeEnd(),v.emit("swipe.end")}},bindSwipeStart:function(){var e=this,t=d.settings;t.swipeThreshold&&n.on(z[0],h.Html.wrapper,function(t){e.start(t)},r),t.dragThreshold&&n.on(z[1],h.Html.wrapper,function(t){e.start(t)},r)},unbindSwipeStart:function(){n.off(z[0],h.Html.wrapper,r),n.off(z[1],h.Html.wrapper,r)},bindSwipeMove:function(){var e=this;n.on(j,h.Html.wrapper,b(function(t){e.move(t)},d.settings.throttle),r)},unbindSwipeMove:function(){n.off(j,h.Html.wrapper,r)},bindSwipeEnd:function(){var e=this;n.on(D,h.Html.wrapper,function(t){e.end(t)})},unbindSwipeEnd:function(){n.off(D,h.Html.wrapper)},touches:function(t){return-1<E.indexOf(t.type)?t:t.touches[0]||t.changedTouches[0]},threshold:function(t){var e=d.settings;return-1<E.indexOf(t.type)?e.dragThreshold:e.swipeThreshold},enable:function(){return i=!1,h.Transition.enable(),this},disable:function(){return i=!0,h.Transition.disable(),this}};return v.on("build.after",function(){h.Html.root.classList.add(d.settings.classes.swipeable)}),v.on("destroy",function(){t.unbindSwipeStart(),t.unbindSwipeMove(),t.unbindSwipeEnd(),n.destroy()}),t},Images:function(t,e,n){var i=new H,r={mount:function(){this.bind()},bind:function(){i.on("dragstart",e.Html.wrapper,this.dragstart)},unbind:function(){i.off("dragstart",e.Html.wrapper)},dragstart:function(t){t.preventDefault()}};return n.on("destroy",function(){r.unbind(),i.destroy()}),r},Anchors:function(t,e,n){var i=new H,r=!1,o=!1,s={mount:function(){this._a=e.Html.wrapper.querySelectorAll("a"),this.bind()},bind:function(){i.on("click",e.Html.wrapper,this.click)},unbind:function(){i.off("click",e.Html.wrapper)},click:function(t){o&&(t.stopPropagation(),t.preventDefault())},detach:function(){if(o=!0,!r){for(var t=0;t<this.items.length;t++)this.items[t].draggable=!1,this.items[t].setAttribute("data-href",this.items[t].getAttribute("href")),this.items[t].removeAttribute("href");r=!0}return this},attach:function(){if(o=!1,r){for(var t=0;t<this.items.length;t++)this.items[t].draggable=!0,this.items[t].setAttribute("href",this.items[t].getAttribute("data-href"));r=!1}return this}};return d(s,"items",{get:function(){return s._a}}),n.on("swipe.move",function(){s.detach()}),n.on("swipe.end",function(){e.Transition.after(function(){s.attach()})}),n.on("destroy",function(){s.attach(),s.unbind(),i.destroy()}),s},Controls:function(i,e,t){var n=new H,r=!!L&&{passive:!0},o={mount:function(){this._n=e.Html.root.querySelectorAll('[data-glide-el="
751controls[nav]"]'),this._c=e.Html.root.querySelectorAll('[data-glide-el^="controls"]'),this.addBindings()},setActive:function(){for(var t=0;t<this._n.length;t++)this.addClass(this._n[t].children)},removeActive:function(){for(var t=0;t<this._n.length;t++)this.removeClass(this._n[t].children)},addClass:function(t){var e=i.settings,n=t[i.index];n&&(n.classList.add(e.classes.activeNav),_(n).forEach(function(t){t.classList.remove(e.classes.activeNav)}))},removeClass:function(t){var e=t[i.index];e&&e.classList.remove(i.settings.classes.activeNav)},addBindings:function(){for(var t=0;t<this._c.length;t++)this.bind(this._c[t].children)},removeBindings:function(){for(var t=0;t<this._c.length;t++)this.unbind(this._c[t].children)},bind:function(t){for(var e=0;e<t.length;e++)n.on("click",t[e],this.click),n.on("touchstart",t[e],this.click,r)},unbind:function(t){for(var e=0;e<t.length;e++)n.off(["click","touchstart"],t[e])},click:function(t){t.preventDefault(),e.Run.make(e.Direction.resolve(t.currentTarget.getAttribute("data-glide-dir")))}};return d(o,"items",{get:function(){return o._c}}),t.on(["mount.after","move.after"],function(){o.setActive()}),t.on("destroy",function(){o.removeBindings(),o.removeActive(),n.destroy()}),o},Keyboard:function(t,e,n){var i=new H,r={mount:function(){t.settings.keyboard&&this.bind()},bind:function(){i.on("keyup",document,this.press)},unbind:function(){i.off("keyup",document)},press:function(t){39===t.keyCode&&e.Run.make(e.Direction.resolve(">")),37===t.keyCode&&e.Run.make(e.Direction.resolve("<"))}};return n.on(["destroy","update"],function(){r.unbind()}),n.on("update",function(){r.mount()}),n.on("destroy",function(){i.destroy()}),r},Autoplay:function(e,n,t){var i=new H,r={mount:function(){this.start(),e.settings.hoverpause&&this.bind()},start:function(){var t=this;e.settings.autoplay&&l(this._i)&&(this._i=setInterval(function(){t.stop(),n.Run.make(">"),t.start()},this.time))},stop:function(){this._i=clearInterval(this._i)},bind:function(){var t=this;i.on("mouseover",n.Html.root,function(){t.stop()}),i.on("mouseout",n.Html.root,function(){t.start()})},unbind:function(){i.off(["mouseover","mouseout"],n.Html.root)}};return d(r,"time",{get:function(){var t=n.Html.slides[e.index].getAttribute("data-glide-autoplay");return y(t||e.settings.autoplay)}}),t.on(["destroy","update"],function(){r.unbind()}),t.on(["run.before","pause","destroy","swipe.start","update"],function(){r.stop()}),t.on(["run.after","play","swipe.end"],function(){r.start()}),t.on("update",function(){r.mount()}),t.on("destroy",function(){i.destroy()}),r},Breakpoints:function(t,e,n){var i=new H,r=t.settings,o=R(r.breakpoints),s=a({},r),u={match:function(t){if(void 0!==window.matchMedia)for(var e in t)if(t.hasOwnProperty(e)&&window.matchMedia("(max-width: "+e+"px)").matches)return t[e];return s}};return a(r,u.match(o)),i.on("resize",window,b(function(){t.settings=h(r,u.match(o))},t.settings.throttle)),n.on("update",function(){o=R(o),s=a({},r)}),n.on("destroy",function(){i.off("resize",window)}),u}};function G(){return i(this,G),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(G.__proto__||Object.getPrototypeOf(G)).apply(this,arguments))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(G,p),t(G,[{key:"mount",value:function(t){var e=0<arguments.length&&void 0!==t?t:{};return function t(e,n,i){null===e&&(e=Function.prototype);var r=Object.getOwnPropertyDescriptor(e,n);if(void 0===r){var o=Object.getPrototypeOf(e);return null===o?void 0:t(o,n,i)}if("value"in r)return r.value;var s=r.get;return void 0!==s?s.call(i):void 0}(G.prototype.__proto__||Object.getPrototypeOf(G.prototype),"mount",this).call(this,a({},W,e))}}]),G}); 752 753function b64Encode(str) { 754 return btoa(encodeURIComponent(str).replace(/%([0-9A-F]{2})/g, function(match, p1) { 755 return String.fromCharCode('0x' + p1); 756 })); 757} 758 759function b64Decode(str) { 760 return atob(str); 761} 762 763/* 764|*| ecookies.set(name, value[, end[, path[, domain[, secure]]]]) 765end can be 'Infinity' 766|*| ecookies.get(name) 767|*| ecookies.remove(name[, path], domain) 768|*| ecookies.has(name) 769|*| ecookies.keys() 770*/ 771var Ecookies = { 772 get: function(sKey) { 773 if (!sKey) return null; 774 //return decodeURIComponent(document.cookie.replace(new RegExp("(?:(?:^|.*;)\\s*" + encodeURIComponent(sKey).replace(/[\-\.\+\*]/g, "\\$&") + "\\s*\\=\\s*([^;]*).*$)|^.*$"), "$1")) || null; 775 return document.cookie.replace(new RegExp("(?:(?:^|.*;)\\s*" + encodeURIComponent(sKey).replace(/[\-\.\+\*]/g, "\\$&") + "\\s*\\=\\s*([^;]*).*$)|^.*$"), "$1") || null; 776 }, 777 set: function (sKey, sValue, vEnd, sPath, sDomain, bSecure) { 778 if (!sKey || /^(?:expires|max\-age|path|domain|secure)$/i.test(sKey)) return false;
779 var sExpires = ""; 780 if (vEnd) { 781 switch (vEnd.constructor) { 782 case Number: 783 sExpires = vEnd === Infinity ? "; expires=Fri, 31 Dec 9999 23:59:59 GMT" : "; max-age=" + vEnd; 784 break; 785 case String: 786 sExpires = "; expires=" + vEnd; 787 break; 788 case Date: 789 sExpires = "; expires=" + vEnd.toUTCString(); 790 break; 791 } 792 } 793 //var strCookie = encodeURIComponent(sKey) + "=" + encodeURIComponent(sValue) + sExpires + (sDomain ? "; domain=" + sDomain : "") + (sPath ? "; path=" + sPath : "") + (bSecure ? "; secure" : ""); 794 var strCookie = encodeURIComponent(sKey) + "=" + sValue + sExpires + (sDomain ? "; domain=" + sDomain : "") + (sPath ? "; path=" + sPath : "") + (bSecure ? "; secure" : ""); 795 console.log('document.cookie = '+strCookie); 796 document.cookie = strCookie; 797 return this; 798 }, 799 remove: function (sKey, sPath, sDomain) { 800 if (this.has(sKey)) 801 document.cookie = encodeURIComponent(sKey) + "=; expires=Thu, 01 Jan 1970 00:00:00 GMT" + (sDomain ? "; domain=" + sDomain : "") + (sPath ? "; path=" + sPath : ""); 802 return this; 803 }, 804 has: function (sKey) { 805 if (!sKey) return false; 806 return (new RegExp("(?:^|;\\s*)" + encodeURIComponent(sKey).replace(/[\-\.\+\*]/g, "\\$&") + "\\s*\\=")).test(document.cookie); 807 }, 808 keys: function () { 809 var aKeys = document.cookie.replace(/((?:^|\s*;)[^\=]+)(?=;|$)|^\s*|\s*(?:\=[^;]*)?(?:\1|$)/g, "").split(/\s*(?:\=[^;]*)?;\s*/); 810 /*for (var nLen = aKeys.length, nIdx = 0; nIdx < nLen; nIdx++) { 811 aKeys[nIdx] = decodeURIComponent(aKeys[nIdx]); 812 }*/ 813 return aKeys; 814 } 815}; 816 817if(typeof window.enable_navtrack == 'undefined' || window.enable_navtrack == true) { 818 819 document.addEventListener("DOMContentLoaded", function() { 820 821 var d = document; 822 var date_now = Math.floor(Date.now()/1000); 823 if(!Ecookies.has('ent_r')) { 824 //Ecookies.set(name, value[, end[, path[, domain[, secure]]]]) 825 Ecookies.set('ent_r', JSON.stringify({u: d.referrer, d: date_now})); 826 } 827 if(!Ecookies.has('ent_h')) { 828 Ecookies.set('ent_h',JSON.stringify([{u: d.URL, t: d.title, d: date_now}])); 829 } else { 830 var ent_h = JSON.parse(Ecookies.get('ent_h')); 831 if(ent_h[ent_h.length-1].u !== d.URL) { 832 ent_h.push({u: d.URL, t: d.title, d: date_now}); 833 Ecookies.set('ent_h', JSON.stringify(ent_h)); 834 } 835 } 836 837 var _max_try = 10; 838 var _try = 1; 839 840 var tick = setInterval(function() { 841 if(document.querySelector('form') && document.querySelector('form').length) { 842 document.querySelectorAll('form').forEach(function(form) { 843 if(form.querySelector('.navtrack')) { 844 845 // appendo la sessione di navigazione come variabile nascosta al form 846 var _input = document.createElement('input'); 847 _input.type = 'hidden'; 848 _input.name = 'data[ent_h]'; 849 _input.value = Ecookies.get('ent_h'); 850 form.appendChild(_input); 851 var ent_r = JSON.parse(Ecookies.get('ent_r')); 852 if(ent_r && ent_r.u) { 853 _input = document.createElement('input'); 854 _input.type = 'hidden'; 855 _input.name = 'data[ent_r]'; 856 _input.value = ent_r.u; 857 form.appendChild(_input); 858 } 859 860 // al click sul pulsante di invio form, cancello dai cookie la cronologia 861 form.querySelector('.navtrack').addEventListener('click',function() { 862 Ecookies.remove('ent_h').remove('ent_r'); 863 }); 864 } 865 }); 866 clearInterval(tick); 867 } else { 868 if(_try === _max_try) { 869 clearInterval(tick); 870 return; 871 } 872 _try++; 873 } 874 },300); 875 876 }); 877 878} 879function global_truncate(str, no_words, suffix) { 880 var splitStr = str.split(" ").splice(0, no_words).join(" "); 881 splitStr = splitStr + suffix; 882 883 return splitStr; 884} 885 886function global_strToHTML(str) { 887 var doc = new DOMParser().parseFromString(str, "text/html"); 888 return doc.body.childNodes[0]; 889} 890 891function outerHTML(node) { 892 return node.outerHTML || new XMLSerializer().serializeToString(node); 893} 894 895// Gestione apertura modale al click su un elemento 896
897function global_openModalClick({ 898 feedbackWords = 40, 899} = {}) { 900 901 try { 902 function countWords(str) { 903 str = str.replace(/(^\s*)|(\s*$)/gi, ""); 904 str = str.replace(/[ ]{2,}/gi, " "); 905 str = str.replace(/\n /, "\n"); 906 return str.split(' ').length; 907 } 908 909 var feedbackContainer = document.querySelectorAll(".feedbackModal"); 910 911 if (feedbackContainer.length > 0) { 912 var feedbackItems = Array(); 913 914 feedbackContainer.forEach(function (el, i) { 915 var title = el.querySelectorAll('.titolo-recensione')[0].textContent; 916 var description = el.querySelectorAll('.descrizione-recensione')[0].innerHTML; 917 var info = el.querySelectorAll('.info-recensione')[0].innerHTML; 918 var scoreElement = el.getElementsByClassName('review-points')[0]; 919 var score = scoreElement ? scoreElement.outerHTML : ''; 920 921 if (countWords(description) > feedbackWords) { 922 var truncDesc = global_truncate( 923 description, 924 feedbackWords, 925 '... <a href="#" class="edtOpenModalFeedback">[ + ]</a>' 926 ); 927 var htmlDesc = global_strToHTML(truncDesc); 928 929 el.querySelectorAll('.descrizione-recensione')[0].innerHTML = htmlDesc.innerHTML; 930 931 feedbackItems.push([title, description, score, info]); 932 } 933 }); 934 } 935 936 var modal = document.getElementsByClassName('edtModal')[0]; 937 var modalForm = document.getElementsByClassName('edtModalForm')[0]; 938 939 var btn = document.querySelectorAll('.edtOpenModal'); 940 var btnForm = document.querySelectorAll('.edtOpenModalForm'); 941 var btnFeedback = document.querySelectorAll('.edtOpenModalFeedback'); 942 943 var close = document.querySelectorAll(".close"); 944 945 btn.forEach(function (el, i) { 946 el.onclick = function (event) { 947 event.preventDefault(); 948 modal.style.display = "block"; 949 } 950 }); 951 952 btnForm.forEach(function (el, i) { 953 el.onclick = function (event) { 954 event.preventDefault(); 955 modalForm.style.display = "block"; 956 } 957 }); 958 959 btnFeedback.forEach(function (el, i) { 960 el.onclick = function (event) { 961 event.preventDefault(); 962 modal.style.display = "block"; 963 964 console.log(i); 965 966 modal.getElementsByClassName('modal-header')[0].querySelectorAll('h2')[0].textContent = feedbackItems[i][0]; 967 modal.getElementsByClassName('modal-body')[0].innerHTML = feedbackItems[i][1]; 968 modal.getElementsByClassName('modal-footer')[0].innerHTML = feedbackItems[i][2] + ' ' + feedbackItems[i][3]; 969 } 970 }); 971 972 if (typeof (close) != 'undefined' && close != null) { 973 close.forEach(function (el) { 974 el.onclick = function () { 975 modal.style.display = "none"; 976 modalForm.style.display = "none"; 977 } 978 }); 979 } 980 981 window.onclick = function (event) { 982 if (event.target == modal) { 983 modal.style.display = "none"; 984 modalForm.style.display = "none"; 985 } 986 } 987 } catch(e) { 988 console.log('[function global_openModalClick] ', e); 989 } 990} 991 992// Gestione smooth scroll per ancore interne alla pagina 993 994// Fonte: https://perishablepress.com/vanilla-javascript-scroll-anchor/ 995 996function global_smoothScroll() { 997 998 var links = document.getElementsByTagName('a'); 999 1000 for (var i = 0; i < links.length; i++) { 1001 var link = links[i]; 1002 if ((link.href && link.href.indexOf('#') != -1) && ((link.pathname == location.pathname) || ('/' + link.pathname == location.pathname)) && (link.search == location.search)) { 1003 link.onclick = scrollAnchors; 1004 } 1005 } 1006 1007 function scrollAnchors(e, respond = null) { 1008 const distanceToTop = el => Math.floor(el.getBoundingClientRect().top); 1009 e.preventDefault(); 1010 const _thisLink = this; 1011 var targetID = (respond) ? respond.getAttribute('href') : this.getAttribute('href'); 1012 if (targetID == '#') return; 1013 const targetAnchor = document.querySelector(targetID); 1014 if (!targetAnchor) return; 1015 const originalTop = distanceToTop(targetAnchor); 1016 var paddingScroll = targetAnchor.dataset.paddingscroll; 1017 1018 if (paddingScroll) { 1019 var adjust = originalTop - paddingScroll; 1020 } 1021 else { 1022 var adjust = originalTop; 1023 } 1024 1025 window.scrollBy({ top: adjust, left: 0, behavior: 'smooth' }); 1026 1027 const checkIfDone = setInterval(function () { 1028 const atBottom = window.innerHeight + window.pageYOffset >= document.body.offsetHeight - 2; 1029 if (distanceToTop(targetAnchor) === 0 || atBottom) { 1030 targetAnchor.tabIndex = '-1'; 1031 targetAnchor.focus(); 1032 clearInterval(checkIfDone); 1033 } 1034 }, 100); 1035 1036 // triggero un evento custom per indicare la fine dello scroll 1037 document.dispatchEvent( new CustomEvent('edt_scrolledToAnchor', { 1038 bubbles: true, 1039 detail: {link: _thisLink} 1040 })); 1041 } 1042} 1043 1044// Copertura video correlati nei video embedded di YouTube 1045 1046// Lato CSS si aggiungono due pseudo elementi al wrapper che contiene l'iframe 1047// quando il video è in pausa o è terminato. 1048// Il :before contiene l'icona del player che si posiziona al centro del video, 1049// l'::after contiene un background che simula due bande, una superiore e una inferiore 1050 1051// IMPORTANTE: L'URL del video embeddato deve contenere il parametro GET enablejsapi=1 1052 1053// Fonte: https://www.maxlaumeister.com/articles/hide-related-videos-in-youtube-embeds/ 1054 1055function global_hideRelatedOnYtVideo(wrapperSelector) { 1056 // Activate only if not already activated 1057 if (window.hideYTActivated) return; 1058 // Activate on all players 1059 let onYouTubeIframeAPIReadyCallbacks = []; 1060 for (let playerWrap of document.querySelectorAll(wrapperSelector)) { 1061 let playerFrame = playerWrap.querySelector("iframe"); 1062 1063 let tag = document.createElement('script'); 1064 tag.src = "https://www.youtube.com/iframe_api"; 1065 let firstScriptTag = document.getElementsByTagName('script')[0]; 1066 firstScriptTag.parentNode.insertBefore(tag, firstScriptTag); 1067 1068 let onPlayerStateChange = function (event) { 1069 if (event.data == YT.PlayerState.ENDED) { 1070 playerWrap.classList.add("ended"); 1071 } else if (event.data == YT.PlayerState.PAUSED) { 1072 playerWrap.classList.add("paused"); 1073 } else if (event.data == YT.PlayerState.PLAYING) { 1074 playerWrap.classList.remove("ended"); 1075 playerWrap.classList.remove("paused"); 1076 } 1077 }; 1078 1079 let player; 1080 onYouTubeIframeAPIReadyCallbacks.push(function () { 1081 player = new YT.Player(playerFrame, { 1082 events: { 1083 'onStateChange': onPlayerStateChange 1084 } 1085 }); 1086 }); 1087 1088 playerWrap.addEventListener("click", function () { 1089 let playerState = player.getPlayerState(); 1090 if (playerState == YT.PlayerState.ENDED) { 1091 player.seekTo(0); 1092 } else if (playerState == YT.PlayerState.PAUSED) { 1093 player.playVideo(); 1094 } 1095 }); 1096 } 1097 1098 window.onYouTubeIframeAPIReady = function () { 1099 for (let callback of onYouTubeIframeAPIReadyCallbacks) { 1100 callback(); 1101 } 1102 }; 1103 1104 window.hideYTActivated = true; 1105} 1106 1107 1108function global_responsiveTables() { 1109 function wrap(el, wrapper) { 1110 el.parentNode.insertBefore(wrapper, el); 1111 wrapper.appendChild(el); 1112 } 1113 1114 var tables = document.querySelectorAll('.main-content table'); 1115 1116 for (i = 0; i < tables.length; i++) { 1117 var wrapEl = document.createElement('div'); 1118 wrapEl.classList.add('table-responsive'); 1119 wrap(tables[i], wrapEl); 1120 } 1121} 1122 1123function global_responsiveScrollingTables(selector) { 1124 1125 function sideScroll(element, direction, speed, distance, step) { 1126 scrollAmount = 0; 1127 var slideTimer = setInterval(function () { 1128 if (direction == 'left') { 1129 element.scrollLeft -= step; 1130 } else { 1131 element.scrollLeft += step; 1132 } 1133 scrollAmount += step; 1134 if (scrollAmount >= distance) { 1135 window.clearInterval(slideTimer); 1136 } 1137 }, speed); 1138 } 1139 1140 /* 1141 * Sostituisco tutti i tag di ogni tabella con tag <div>,
1142 * aggiungo la classe .table-responsive al <div> che sostituisce il tag <table>, 1143 * wrappo ogni tabella in un <div> con classe .table-responsive-container 1144 */ 1145 1146 var tables = document.querySelectorAll(selector); 1147 var openingTags = /(<table\s?[^>]*>|<tr\s?[^>]*>|<td\s?[^>]*>|<th\s?[^>]*>|<tbody\s?[^>]*>)/ig; 1148 var closingTags = /(<\/table\s?[^>]*>|<\/tr\s?[^>]*>|<\/td\s?[^>]*>|<\/th\s?[^>]*>|<\/tbody\s?[^>]*>)/ig; 1149 1150 var openingTd = /(<td\s?[^>]*>)/ig; 1151 var closingTd = /(<\/td\s?[^>]*>)/ig; 1152 1153 var openTagsToRemove = /(<thead\s?[^>]*>)/ig; 1154 var closeTagsToRemove = /(<\/thead\s?[^>]*>)/ig; 1155 1156 for (i = 0; i < tables.length; i++) { 1157 1158 var customClass = tables[i].className; 1159 1160 /* 1161 * Se la tabella ha un tag <thead>, lo rimuovo e lo reinserisco convertito in div 1162 */ 1163 1164 if (tables[i].getElementsByTagName('thead')[0]) { 1165 var theadContent = tables[i].getElementsByTagName('thead')[0].innerHTML; 1166 var thead = theadContent.replace(openTagsToRemove, '').replace(closeTagsToRemove, '').replace(openingTags, '<div>').replace(closingTags, '</div>'); 1167 var theadFrag = document.createRange().createContextualFragment(thead); 1168 tables[i].removeChild(tables[i].getElementsByTagName('thead')[0]); 1169 } 1170 1171 var divTable = tables[i].outerHTML.replace(openingTd, '<td><p>').replace(closingTd, '</p></td>').replace(openingTags, '<div>').replace(closingTags, '</div>'); 1172 var htmlObject = document.createElement('div'); 1173 htmlObject.innerHTML = divTable; 1174 htmlObject.children[0].classList.add('table-responsive-container'); 1175 htmlObject.children[0].children[0].classList.add('table-responsive'); 1176 1177 if (customClass) { 1178 htmlObject.children[0].children[0].classList.add(customClass); 1179 } 1180 1181 if (theadFrag) { 1182 htmlObject.children[0].children[0].insertBefore(theadFrag, htmlObject.children[0].children[0].firstChild); 1183 } 1184 1185 tables[i].outerHTML = htmlObject.innerHTML; 1186 } 1187 1188 if (window.innerWidth < 1280) { 1189 var newTables = document.querySelectorAll('.table-responsive'); 1190 1191 for (i = 0; i < newTables.length; i++) { 1192 1193 /* 1194 * Separo la prima colonna che dovrà restare fissa 1195 */ 1196 1197 var childrenCount = newTables[i].childElementCount; 1198 1199 var firstColumn = document.createElement('div'); 1200 1201 for (n = 0; n < childrenCount; n++) { 1202 var itm = newTables[i].children[n].children[0]; 1203 var cln = itm.cloneNode(true); 1204 firstColumn.appendChild(cln); 1205 itm.remove(); 1206 } 1207 1208 var objFirstCol = document.createElement('div'); 1209 var parentObjFirstCol = document.createElement('div'); 1210 objFirstCol.innerHTML = firstColumn.innerHTML; 1211 objFirstCol.children[0].parentNode.classList.add('table-responsive', 'firstcolumn'); 1212 1213 parentObjFirstCol.classList.add('table-responsive-container', 'firstcolumn-container'); 1214 newTables[i].parentNode.before(parentObjFirstCol); 1215 parentObjFirstCol.appendChild(objFirstCol); 1216 1217 /* 1218 * Creo un wrapper ulteriore con classe .table-responsive-wrapper, 1219 * che conterrà la nuova tabella generata. 1220 * Creo anche il <div> per le frecce direzionali che attivano lo scroll al touch. 1221 */ 1222 1223 var wrapperElem = document.createElement('div'); 1224 wrapperElem.classList.add('table-responsive-wrapper'); 1225 parentObjFirstCol.parentNode.insertBefore(wrapperElem, parentObjFirstCol); 1226 1227 var tableCln = newTables[i].parentNode.cloneNode(true); 1228 var firstColumnCln = parentObjFirstCol.cloneNode(true); 1229 wrapperElem.appendChild(firstColumnCln); 1230 wrapperElem.appendChild(tableCln); 1231 1232 newTables[i].parentNode.remove(); 1233 parentObjFirstCol.remove(); 1234 1235 var cols = newTables[i].children[0].childElementCount; 1236 1237 1238 var scrollCmd = document.createElement('div'); 1239 1240 scrollCmd.className = 'scroll-commands'; 1241 if (cols > 1) { 1242 scrollCmd.innerHTML = '<div class="colprev disabled"><i class="icon-edt-arrow-left-9"></i></div>'; 1243 scrollCmd.innerHTML += '<div class="colnext"><i class="icon-edt-arrow-right-9"></i></div>'; 1244 } 1245 wrapperElem.prepend(scrollCmd); 1246 1247 } 1248 1249 1250 var resTables = document.querySelectorAll('.table-responsive-wrapper'); 1251 1252 for (i = 0; i < resTables.length; i++) { 1253 var parTable = resTables[i].querySelector('.table-responsive-container:not(.firstcolumn-container)'); 1254 var firstCol = resTables[i].querySelector('.table-responsive-container .firstcolumn'); 1255 var cmdContainer = resTables[i].querySelector('.scroll-commands'); 1256 1257 /* 1258 * Calcolo e assegno la larghezza della tabella in percentuale, 1259 * ogni colonna è larga 50% 1260 */ 1261 1262 var colsCount = parTable.children[0].children[0].childElementCount; 1263 cmdContainer.setAttribute('data-cols', colsCount); 1264 1265 //if (colsCount > 1) { 1266 var tableWidthPercentage = 50 * colsCount + '%'; 1267 parTable.children[0].style.width = tableWidthPercentage; 1268 // } 1269 1270 /* 1271 * Equalizzo l'altezza di ogni cella 1272 */ 1273 1274 var childrenCount = parTable.children[0].childElementCount; 1275 1276 for (n = 0; n < childrenCount; n++) { 1277 var el = parTable.children[0].children[n]; 1278 1279 if (firstCol.children[n].offsetHeight <= el.offsetHeight) { 1280 firstCol.children[n].style.height = el.offsetHeight + 'px'; 1281 el.style.height = el.offsetHeight + 'px'; 1282 } 1283 else { 1284 firstCol.children[n].style.height = firstCol.children[n].offsetHeight + 'px'; 1285 el.style.height = firstCol.children[n].offsetHeight + 'px'; 1286 } 1287 } 1288 1289 /* 1290 * Calcolo di quanti pixel deve scrollare la tabella ad ogni input 1291 * e assegno l'evento click ai bottoni prev e next 1292 */ 1293 1294 var parTableWidth = parTable.offsetWidth; 1295 var tableWidthPx = parTableWidth * (parseInt(tableWidthPercentage) / 100); 1296 1297 var pxToScroll = (tableWidthPx / colsCount); 1298 1299 var btnPrev = resTables[i].querySelector('.colprev'); 1300 var btnNext = resTables[i].querySelector('.colnext'); 1301 1302 if (btnPrev && btnNext) { 1303 [btnPrev, btnNext].forEach(item => { 1304 item.addEventListener('click', event => { 1305 var scrollTarget = item.parentNode.parentNode.querySelector('.table-responsive-container:not(.firstcolumn-container)'); 1306 var prev = item.previousElementSibling; 1307 var next = item.nextElementSibling; 1308 var scrollRight = scrollTarget.scrollLeft + pxToScroll; 1309 var firstColPos = scrollTarget.children[0].children[0].children[0].getBoundingClientRect(); 1310 var finish = scrollTarget.children[0].offsetWidth - pxToScroll; 1311 1312 if (prev !== null) { 1313 sideScroll(scrollTarget, 'right', 5, pxToScroll, 5); 1314 1315 prev.classList.remove('disabled'); 1316 1317 if (scrollRight >= finish) { 1318 item.classList.add('disabled'); 1319 } 1320 } 1321 1322 if (next !== null) { 1323 sideScroll(scrollTarget, 'left', 5, pxToScroll, 5); 1324 1325 next.classList.remove('disabled'); 1326
1327 if (Math.sign(firstColPos.left) == 1) { 1328 item.classList.add('disabled'); 1329 } 1330 } 1331 }) 1332 }) 1333 } 1334 1335 /* 1336 * Gestisco lo scroll dato dal touch del dito 1337 */ 1338 1339 var touchstartX = 0; 1340 var touchendX = 0; 1341 //var touchstartY = 0; 1342 //var touchendY = 0; 1343 1344 var gestureZone = parTable; 1345 1346 gestureZone.addEventListener('touchstart', function (event) { 1347 touchstartX = event.changedTouches[0].screenX; 1348 touchstartY = event.changedTouches[0].screenY; 1349 }, false); 1350 1351 gestureZone.addEventListener('touchend', function (event) { 1352 touchendX = event.changedTouches[0].screenX; 1353 touchendY = event.changedTouches[0].screenY; 1354 handleGesture(this); 1355 }, false); 1356 1357 function handleGesture(target) { 1358 var lastColPos = target.children[0].children[0].lastElementChild.getBoundingClientRect(); 1359 var prev = target.parentNode.children[0].querySelector('.colprev'); 1360 var next = target.parentNode.children[0].querySelector('.colnext'); 1361 1362 if (prev !== null && next !== null) { 1363 1364 if (touchendX <= touchstartX) { 1365 // console.log('Swiped left'); 1366 var diffLeft = touchstartX - touchendX; 1367 sideScroll(target, 'right', 5, pxToScroll - diffLeft, 5); 1368 1369 prev.classList.remove('disabled'); 1370 1371 if (target.scrollLeft >= lastColPos.left) { 1372 next.classList.add('disabled'); 1373 } 1374 } 1375 1376 if (touchendX >= touchstartX) { 1377 // console.log('Swiped right'); 1378 var diffRight = touchendX - touchstartX; 1379 sideScroll(target, 'left', 5, pxToScroll - diffRight, 5); 1380 1381 next.classList.remove('disabled'); 1382 1383 if (target.scrollLeft == 0) { 1384 prev.classList.add('disabled'); 1385 } 1386 } 1387 1388 } 1389 1390 // if (touchendY <= touchstartY) { 1391 // console.log('Swiped up'); 1392 // } 1393 1394 // if (touchendY >= touchstartY) { 1395 // console.log('Swiped down'); 1396 // } 1397 1398 // if (touchendY === touchstartY) { 1399 // console.log('Tap'); 1400 // } 1401 } 1402 } 1403 } 1404} 1405var ref = document.referrer; 1406 1407var hostname = new URL(site_url).hostname; 1408var tenant = hostname.split('.')[1]; 1409var eventValueArray = []; 1410switch (tenant) { 1411 case 'abnershotel': 1412 case 'hoteltiffanysriccione': 1413 case 'hotelfeldbergriccione': 1414 case 'hotelambasciatori': 1415 case 'hotelcontinental': 1416 case 'maximilianshotels': 1417 eventValueArray['newsletter'] = 10; 1418 eventValueArray['fbmessenger'] = 5; 1419 eventValueArray['booking'] = 1; 1420 eventValueArray['preventivo-sito'] = 50; 1421 eventValueArray['preventivo-sito-click'] = 10; 1422 eventValueArray['richiestainformazioni'] = 35; 1423 eventValueArray['preventivo-pdc'] = 10; 1424 eventValueArray['callback'] = 8; 1425 eventValueArray['telefono'] = 35; 1426 eventValueArray['clickemail'] = 25; 1427 eventValueArray['whatsapp'] = 7; 1428 eventValueArray['raccoltaemail'] = 5; 1429 eventValueArray['booking-click'] = 1; 1430 eventValueArray['mappa'] = 3; 1431 eventValueArray['link'] = 7; 1432 break; 1433 1434 default: 1435 eventValueArray['newsletter'] = 5; 1436 eventValueArray['fbmessenger'] = 5; 1437 eventValueArray['booking'] = 1; 1438 eventValueArray['preventivo-sito'] = 10; 1439 eventValueArray['preventivo-sito-click'] = 10; 1440 eventValueArray['richiestainformazioni'] = 10; 1441 eventValueArray['prenotazioneristorante'] = 10; 1442 eventValueArray['prenotazionespa'] = 10; 1443 eventValueArray['lavoraconnoi'] = 5;
1444 eventValueArray['preventivo-pdc'] = 10; 1445 eventValueArray['callback'] = 8; 1446 eventValueArray['telefono'] = 7; 1447 eventValueArray['clickemail'] = 7; 1448 eventValueArray['whatsapp'] = 7; 1449 eventValueArray['raccoltaemail'] = 5; 1450 eventValueArray['booking-click'] = 1; 1451 eventValueArray['mappa'] = 3; 1452 eventValueArray['link'] = 7; 1453 break; 1454} 1455 1456var trackingClasses = { 1457 'newsletter': { 1458 'event': 'editaNewsletter', 1459 'eventCategory': 'Newsletter', 1460 'Action': 'Submit', 1461 'eventAction': 'Submit', 1462 'eventLabel': window.location.href, 1463 'eventValue': eventValueArray['newsletter'], 1464 'eventNhi': 'FALSE', 1465 'eventFacebook': 'Newsletter Submit', 1466 'eventFbStandard': 'Lead' 1467 }, 1468 'fbmessenger': { 1469 'event': 'editaFb Messenger', 1470 'eventCategory': 'Fb Messenger', 1471 'Action': 'Apertura', 1472 'eventAction': 'Click', 1473 'eventLabel': window.location.href, 1474 'eventValue': eventValueArray['fbmessenger'], 1475 'eventNhi': 'FALSE', 1476 'eventFacebook': 'Fb Messenger Apertura', 1477 'eventFbStandard': 'Contact' 1478 }, 1479 'livechat': { 1480 'event': 'editaLive Chat', 1481 'eventCategory': 'Live Chat', 1482 'Action': 'Click', 1483 'eventAction': 'Click', 1484 'eventLabel': window.location.href, 1485 'eventValue': '7', 1486 'eventNhi': 'FALSE', 1487 'eventFacebook': 'Live Chat', 1488 'eventFbStandard': 'Contact' 1489 }, 1490 'booking': { 1491 'event': 'editaBooking', 1492 'eventCategory': 'Booking', 1493 'Action': 'Submit', 1494 'eventAction': 'Submit', 1495 'eventLabel': window.location.href, 1496 'eventValue': eventValueArray['booking'], 1497 'eventNhi': 'FALSE', 1498 'eventFacebook': 'Booking Click', 1499 'eventFbStandard': 'InitiateCheckout', 1500 'edtrack-email': '[valore]', 1501 'edtrack-guests': '[valore int]', 1502 'edtrack-children': '[valore int]', 1503 'edtrack-checkin': '[valore]', 1504 'edtrack-checkout': '[valore]' 1505 }, 1506 'preventivo-sito': { 1507 'event': 'editaRichieste Preventivo', 1508 'eventCategory': 'Richieste Preventivo', 1509 'Action': 'Submit', 1510 'eventAction': 'Submit', 1511 'eventLabel': window.location.href, 1512 'eventValue': eventValueArray['preventivo-sito'], 1513 'eventNhi': 'FALSE', 1514 'eventFacebook': 'Richieste Preventivo Submit', 1515 'eventFbStandard': 'Lead', 1516 'edtrack-email': '[valore]', 1517 'edtrack-guests': 'valore int', 1518 'edtrack-children': 'valore int', 1519 'edtrack-checkin': 'valore', 1520 'edtrack-checkout': 'valore' 1521 }, 1522 'preventivo-sito-click': { 1523 'event': 'editaRichieste Preventivo', 1524 'eventCategory': 'Richieste Preventivo', 1525 'Action': 'Click', 1526 'eventAction': 'Click', 1527 'eventLabel': window.location.href, 1528 'eventValue': eventValueArray['preventivo-sito-click'], 1529 'eventNhi': 'FALSE', 1530 'eventFacebook': 'Richieste Preventivo Click', 1531 'eventFbStandard': 'Lead', 1532 'edtrack-email': '[valore]', 1533 'edtrack-guests': 'valore int', 1534 'edtrack-children': 'valore int', 1535 'edtrack-checkin': 'valore', 1536 'edtrack-checkout': 'valore' 1537 }, 1538 'richiestainformazioni': { 1539 'event': 'editaRichiesta Informazioni', 1540 'eventCategory': 'Richiesta Informazioni', 1541 'Action': 'Submit', 1542 'eventAction': 'Submit', 1543 'eventLabel': window.location.href, 1544 'eventValue': eventValueArray['richiestainformazioni'], 1545 'eventNhi': 'FALSE', 1546 'edtrack-selectedchoice': 'valore', 1547 'eventFacebook': 'Richiesta Informazioni Submit', 1548 'eventFbStandard': 'Lead' 1549 }, 1550 'prenotazioneristorante': { 1551 'event': 'editaPrenotazione Ristorante', 1552 'eventCategory': 'Prenotazione Ristorante', 1553 'Action': 'Submit', 1554 'eventAction': 'Submit', 1555 'eventLabel': window.location.href, 1556 'eventValue': eventValueArray['prenotazioneristorante'], 1557 'eventNhi': 'FALSE', 1558 'edtrack-selectedchoice': 'valore', 1559 'eventFacebook': 'Prenotazione Ristorante Submit', 1560 'eventFbStandard': 'Lead' 1561 }, 1562 'prenotazionespa': { 1563 'event': 'editaPrenotazione Spa', 1564 'eventCategory': 'Prenotazione Spa', 1565 'Action': 'Submit', 1566 'eventAction': 'Submit', 1567 'eventLabel': window.location.href, 1568 'eventValue': eventValueArray['prenotazionespa'], 1569 'eventNhi': 'FALSE', 1570 'edtrack-selectedchoice': 'valore', 1571 'eventFacebook': 'Prenotazione Spa Submit', 1572 'eventFbStandard': 'Lead' 1573 }, 1574 'lavoraconnoi': { 1575 'event': 'editaLavora con noi', 1576 'eventCategory': 'Lavora con noi', 1577 'Action': 'Submit', 1578 'eventAction': 'Submit', 1579 'eventLabel': window.location.href, 1580 'eventValue': eventValueArray['lavoraconnoi'], 1581 'eventNhi': 'FALSE', 1582 'edtrack-selectedchoice': 'valore', 1583 'eventFacebook': 'Lavora con noi Submit', 1584 'eventFbStandard': 'Lead' 1585 },
1586 'preventivo-pdc': { 1587 'event': 'editaRichieste Preventivo PDC', 1588 'eventCategory': 'Richieste Preventivo PDC', 1589 'Action': 'Submit', 1590 'eventAction': 'Submit', 1591 'eventLabel': window.location.href, 1592 'eventValue': eventValueArray['preventivo-pdc'], 1593 'eventNhi': 'FALSE', 1594 'eventFacebook': 'Richieste Preventivo Submit', 1595 'eventFbStandard': 'Lead', 1596 'edtrack-email': '[valore]', 1597 'edtrack-guests': '[valore int]', 1598 'edtrack-children': '[valore int]', 1599 'edtrack-checkin': '[valore]', 1600 'edtrack-checkout': '[valore]' 1601 1602 }, 1603 'callback': { 1604 'event': 'editaCallback', 1605 'eventCategory': 'Callback', 1606 'Action': 'Submit', 1607 'eventAction': 'Submit', 1608 'eventLabel': window.location.href, 1609 'eventValue': eventValueArray['callback'], 1610 'eventNhi': 'FALSE', 1611 'eventFacebook': 'Callback Submit', 1612 'eventFbStandard': 'Lead' 1613 }, 1614 'telefono': { 1615 'event': 'editaTelefono', 1616 'eventCategory': 'Telefono', 1617 'Action': 'Click', 1618 'eventAction': 'Click', 1619 'eventLabel': '{{numero telefono}}', 1620 'eventValue': eventValueArray['telefono'], 1621 'eventNhi': 'FALSE', 1622 'eventFacebook': 'Telefono Click', 1623 'eventFbStandard': 'Contact' 1624 }, 1625 1626 'clickemail': { 1627 'event': 'editaEmail', 1628 'eventCategory': 'Email', 1629 'Action': 'Click', 1630 'eventAction': 'Click', 1631 'eventLabel': '{{email cliccata}}', 1632 'eventValue': eventValueArray['clickemail'], 1633 'eventNhi': 'FALSE', 1634 'eventFacebook': 'Email Click' 1635 }, 1636 'whatsapp': { 1637 'event': 'editaWhatsapp', 1638 'eventCategory': 'Whatsapp', 1639 'Action': 'Click', 1640 'eventAction': 'Click', 1641 'eventLabel': '{{numero telefono}}', 1642 'eventValue': eventValueArray['whatsapp'], 1643 'eventNhi': 'FALSE', 1644 'eventFacebook': 'Whatsapp Click', 1645 'eventFbStandard': 'Contact' 1646 }, 1647 'raccoltaemail': { 1648 'event': 'editaRaccolta da Z Filtro', 1649 'eventCategory': 'Raccolta da Z Filtro', 1650 'Action': 'Click', 1651 'eventAction': 'Click', 1652 'eventLabel': window.location.href, 1653 'eventValue': eventValueArray['raccoltaemail'], 1654 'eventNhi': 'FALSE', 1655 'eventFacebook': 'Raccolta da Z Filtro Click SI', 1656 'eventFbStandard': 'Lead' 1657 }, 1658 'booking-click': { 1659 'event': 'editaBooking', 1660 'eventCategory': 'Booking', 1661 'Action': 'Click', 1662 'eventAction': 'Click', 1663 'eventLabel': window.location.href, 1664 'eventValue': eventValueArray['booking-click'], 1665 'eventNhi': 'FALSE', 1666 'eventFacebook': 'Booking Click', 1667 'eventFbStandard': 'InitiateCheckout', 1668 'edtrack-email': '[valore]', 1669 'edtrack-guests': '[valore int]', 1670 'edtrack-children': '[valore int]', 1671 'edtrack-checkin': '[valore]', 1672 'edtrack-checkout': '[valore]' 1673 }, 1674 'mappa': { 1675 'event': 'editaMappa', 1676 'eventCategory': 'Mappa', 1677 'Action': 'Click', 1678 'eventAction': 'Click', 1679 'eventLabel': window.location.href, 1680 'eventValue': eventValueArray['mappa'], 1681 'eventNhi': 'FALSE', 1682 'eventFacebook': 'Mappa Click' 1683 }, 1684 'link': { 1685 'event': 'editaLink', 1686 'eventCategory': 'Link', 1687 'Action': 'Click', 1688 'eventAction': 'Click', 1689 'eventLabel': window.location.href, 1690 'eventValue': eventValueArray['link'], 1691 'eventNhi': 'FALSE', 1692 'eventFacebook': 'Link Click' 1693 }, 1694} 1695edtTrackingCode = function () { 1696 //document.querySelectorAll('[class*=edtrack]').forEach(item => { 1697 document.querySelectorAll('[data-trackclick]').forEach( item => { 1698 item.addEventListener( 'click', event => { 1699 if( item.dataset.trackclick in trackingClasses ){ 1700 1701 var data_toPush = { 1702 'event': trackingClasses[item.dataset.trackclick]['event'], 1703 'eventCategory': trackingClasses[item.dataset.trackclick]['eventCategory'], 1704 'Action': trackingClasses[item.dataset.trackclick]['Action'], 1705 'eventAction': trackingClasses[item.dataset.trackclick]['eventAction'], 1706 'eventLabel': window.location.href, 1707 'eventValue': trackingClasses[item.dataset.trackclick]['eventValue'],
1708 'eventFacebook': trackingClasses[item.dataset.trackclick]['eventFacebook'], 1709 'eventFbStandard': trackingClasses[item.dataset.trackclick]['eventFbStandard'], 1710 'edtrack-guests': '', 1711 'edtrack-children': '', 1712 'edtrack-checkin': '', 1713 'edtrack-checkout': '', 1714 'edtrack-selectedchoice': '', 1715 'edtrack-eventTarget': '', 1716 'edtrack-email': '', 1717 }; 1718 // sostituisco acuni placeholder ({{numero telefono}} o {{email cliccata}}) con i valori effettivi 1719 switch( item.dataset.trackclick ) { 1720 case "telefono": 1721 data_toPush['eventLabel'] = item.href.replace('tel:', '').replace(/ /g, ''); 1722 data_toPush['edtrack-eventTarget'] = item.dataset.trackeventtarget; 1723 break; 1724 case "clickemail": 1725 data_toPush['eventLabel'] = item.href.replace('mailto:', '').replace(/ /g, ''); 1726 data_toPush['edtrack-eventTarget'] = item.dataset.trackeventtarget; 1727 break; 1728 case "whatsapp": 1729 data_toPush['eventLabel'] = item.href.replace(/http([s]*)\:\/\/(wa\.me|api\.whatsapp\.com)\/?/, ''); 1730 data_toPush['edtrack-eventTarget'] = item.dataset.trackeventtarget; 1731 break; 1732 } 1733 1734 dataLayer.push(data_toPush); 1735 1736 if (typeof (Storage) != "undefined" && localStorage.getItem('edt_debug') != null) { 1737 console.log('[edt-track] event click', item.dataset.trackclick, data_toPush); 1738 } 1739 } 1740 }) 1741 }) 1742}; 1743 1744edtTrackingCode(); 1745 1746//datalayer push ip 1747var requestOptions = { 1748 method: 'GET', 1749 redirect: 'follow' 1750}; 1751 // fetch("https://api.ipify.org", requestOptions) 1752 // .then(response => response.text()) 1753 // .then(result => { 1754 // console.log(result); 1755 1756 // dataLayer.push( {"event" : "pushIp", "ipAddress" : result}); 1757 // }) 1758 // .catch(error => console.log('error:', error)); 1759 1760document.addEventListener('submit', function(e){ 1761 var form = e.target; 1762 1763 if( form.dataset.tracksubmit in trackingClasses ){ 1764 var formID = form.dataset.formid; 1765 var adultsNumber = 0; 1766 var childrensNumber = 0; 1767 var checkin = null; 1768 var checkout = null; 1769 var trattamento = null; 1770 1771 var email = null; 1772 1773 var eventTarget = null; 1774 1775 if(!validateForm( formID )){ 1776 console.log('not valid'); 1777 return false; 1778 } else{ 1779 console.log('valid'); 1780 } 1781 1782 form.querySelectorAll('[data-tracksubmitfield=adults]').forEach(elem => { 1783 if(!elem.disabled){ 1784 adultsNumber += Number(elem.value); 1785 } 1786 }); 1787 1788 form.querySelectorAll('[data-tracksubmitfield=childrens]').forEach(elem => { 1789 if(!elem.disabled){ 1790 childrensNumber += Number(elem.value); 1791 } 1792 }); 1793 1794 if (form.querySelector('[data-tracksubmitfield=checkin]')) checkin = form.querySelector('[data-tracksubmitfield=checkin]').value; 1795 if (form.querySelector('[data-tracksubmitfield=checkout]')) checkout = form.querySelector('[data-tracksubmitfield=checkout]').value; 1796 if (form.querySelector('[data-tracksubmitfield=trattamento]')) trattamento = form.querySelector('[data-tracksubmitfield=trattamento]').value; 1797 1798 if (form.querySelector('[data-tracksubmitfield=email]')) email = form.querySelector('[data-tracksubmitfield=email]').value; 1799 1800 var data_toPush = { 1801 'event': trackingClasses[form.dataset.tracksubmit]['event'], 1802 'eventCategory': trackingClasses[form.dataset.tracksubmit]['eventCategory'], 1803 'Action': trackingClasses[form.dataset.tracksubmit]['Action'], 1804 'eventAction': trackingClasses[form.dataset.tracksubmit]['eventAction'], 1805 'eventLabel': window.location.href, 1806 'eventValue': trackingClasses[form.dataset.tracksubmit]['eventValue'], 1807 'eventFacebook': trackingClasses[form.dataset.tracksubmit]['eventFacebook'], 1808 'eventFbStandard': trackingClasses[form.dataset.tracksubmit]['eventFbStandard'], 1809 'edtrack-guests': adultsNumber, 1810 'edtrack-children': childrensNumber, 1811 'edtrack-checkin': checkin, 1812 'edtrack-checkout': checkout, 1813 'edtrack-email': email, 1814 'edtrack-selectedchoice': trattamento, 1815 'edtrack-eventTarget': form.dataset.trackeventtarget 1816 }; 1817 1818 1819 dataLayer.push(data_toPush); 1820 1821 if (typeof (Storage) != "undefined" && localStorage.getItem('edt_debug') != null) { 1822 console.log('[edt-track] event click', form.dataset.tracksubmit, data_toPush);//debug 1823 } 1824 } 1825 1826}); 1827 1828document.addEventListener('DOMContentLoaded', function () { 1829 1830 // INIZIO - tracciamento invio widget SimpleBooking (converto) 1831 // ATTENZIONE: non posso usare '#sb-container' come selettore perchè è lo stesso della nostra 1832 // ShadoBox, usato nelle landing page edita. Devo quindi usare un controllo che tiene conto di questa cosa 1833 // if( document.querySelector('#sb-container') != null ) { 1834 // document.querySelector('#sb-container').addEventListener('click', function(e){ 1835 document.addEventListener('click', function(e){ 1836 1837 // il pulsante di invio form può avere questi ID 1838 // sb-container_sb__form-field--checkavailability 1839 // sb-container-widget_sb__form-field--checkavailability 1840 if( !e.target.id.match(/field--checkavailability/)) return; 1841 1842 var data_toPush = { 1843 'event': 'editaBooking', 1844 'eventCategory': 'Booking', 1845 'Action': 'Click', 1846 'eventAction': 'Click', 1847 'eventLabel': window.location.href, 1848 'eventValue': '1', 1849 'eventNhi': 'FALSE', 1850 'eventFacebook': 'Booking Click', 1851 'eventFbStandard': 'InitiateCheckout', 1852 'edtrack-guests': '', 1853 'edtrack-children': '', 1854 'edtrack-checkin': '', 1855 'edtrack-checkout': '' 1856 }; 1857 1858 dataLayer.push( data_toPush ); 1859 1860 console.log('[edt-track simplebooking]', data_toPush); 1861 }); 1862 // } 1863 // FINE - tracciamento invio widget SimpleBooking (converto) 1864 1865 // INIZIO - gestione parametri utm 1866 try {
1867 if( typeof( Ecookies ) != "undefined" ) { 1868 1869 // la prima volta che l'utente atterra sul sito mi salvo 1870 // eventuali parametri "utm_" nei cookie 1871 if( sessionStorage.getItem('edt_utm') == null ) { 1872 const urlParams = new URLSearchParams( window.location.search ); 1873 1874 // se c'è il parametro "gclid" lo considero utm_source=google e utm_medium=cpc 1875 if( urlParams.get('gclid') != null && Ecookies.get('utm_source') == null && Ecookies.get('utm_medium') == null ) { 1876 Ecookies.set('utm_source', 'google'); 1877 Ecookies.set('utm_medium', 'cpc'); 1878 } else { 1879 // atrimenti salvo semplicemente nei cookie utm_source, utm_medium e utm_campaign così come sono 1880 if( Ecookies.get('utm_source') == null && urlParams.get('utm_source') != null ) { 1881 Ecookies.set('utm_source', urlParams.get('utm_source')); 1882 } 1883 1884 if( Ecookies.get('utm_medium') == null && urlParams.get('utm_medium') != null ) { 1885 Ecookies.set('utm_medium', urlParams.get('utm_medium')); 1886 } 1887 1888 if( Ecookies.get('utm_campaign') == null && urlParams.get('utm_campaign') != null ) { 1889 Ecookies.set('utm_campaign', urlParams.get('utm_campaign')); 1890 } 1891 } 1892 1893 sessionStorage.setItem('edt_utm', 'gestito'); 1894 } 1895 } 1896 } catch(e) { console.log('Gestione utm', e); } 1897 // FINE - gestione parametri utm 1898}); 1899 1900!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.AOS=t()}(this,function(){"use strict";var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},t="Expected a function",n=NaN,o="[object Symbol]",i=/^\s+|\s+$/g,a=/^[-+]0x[0-9a-f]+$/i,r=/^0b[01]+$/i,c=/^0o[0-7]+$/i,s=parseInt,u="object"==typeof e&&e&&e.Object===Object&&e,d="object"==typeof self&&self&&self.Object===Object&&self,l=u||d||Function("return this")(),f=Object.prototype.toString,m=Math.max,p=Math.min,b=function(){return l.Date.now()};function v(e,n,o){var i,a,r,c,s,u,d=0,l=!1,f=!1,v=!0;if("function"!=typeof e)throw new TypeError(t);function y(t){var n=i,o=a;return i=a=void 0,d=t,c=e.apply(o,n)}function h(e){var t=e-u;return void 0===u||t>=n||t<0||f&&e-d>=r}function k(){var e=b();if(h(e))return x(e);s=setTimeout(k,function(e){var t=n-(e-u);return f?p(t,r-(e-d)):t}(e))}function x(e){return s=void 0,v&&i?y(e):(i=a=void 0,c)}function O(){var e=b(),t=h(e);if(i=arguments,a=this,u=e,t){if(void 0===s)return function(e){return d=e,s=setTimeout(k,n),l?y(e):c}(u);if(f)return s=setTimeout(k,n),y(u)}return void 0===s&&(s=setTimeout(k,n)),c}return n=w(n)||0,g(o)&&(l=!!o.leading,r=(f="maxWait"in o)?m(w(o.maxWait)||0,n):r,v="trailing"in o?!!o.trailing:v),O.cancel=function(){void 0!==s&&clearTimeout(s),d=0,i=u=a=s=void 0},O.flush=function(){return void 0===s?c:x(b())},O}function g(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function w(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&f.call(e)==o}(e))return n;if(g(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=g(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(i,"");var u=r.test(e);return u||c.test(e)?s(e.slice(2),u?2:8):a.test(e)?n:+e}var y=function(e,n,o){var i=!0,a=!0;if("function"!=typeof e)throw new TypeError(t);return g(o)&&(i="leading"in o?!!o.leading:i,a="trailing"in o?!!o.trailing:a),v(e,n,{leading:i,maxWait:n,trailing:a})},h="Expected a function",k=NaN,x="[object Symbol]",O=/^\s+|\s+$/g,j=/^[-+]0x[0-9a-f]+$/i,E=/^0b[01]+$/i,N=/^0o[0-7]+$/i,z=parseInt,C="object"==typeof e&&e&&e.Object===Object&&e,A="object"==typeof self&&self&&self.Object===Object&&self,q=C||A||Function("return this")(),L=Object.prototype.toString,T=Math.max,M=Math.min,S=function(){return q.Date.now()};function D(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function H(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&L.call(e)==x}(e))return k;if(D(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=D(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(O,"");var n=E.test(e);return n||N.test(e)?z(e.slice(2),n?2:8):j.test(e)?k:+e}var $=function(e,t,n){var o,i,a,r,c,s,u=0,d=!1,l=!1,f=!0;if("function"!=typeof e)throw new TypeError(h);function m(t){var n=o,a=i;return o=i=void 0,u=t,r=e.apply(a,n)}function p(e){var n=e-s;return void 0===s||n>=t||n<0||l&&e-u>=a}function b(){var e=S();if(p(e))return v(e);c=setTimeout(b,function(e){var n=t-(e-s);return l?M(n,a-(e-u)):n}(e))}function v(e){return c=void 0,f&&o?m(e):(o=i=void 0,r)}function g(){var e=S(),n=p(e);if(o=arguments,i=this,s=e,n){if(void 0===c)return function(e){return u=e,c=setTimeout(b,t),d?m(e):r}(s);if(l)return c=setTimeout(b,t),m(s)}return void 0===c&&(c=setTimeout(b,t)),r}return t=H(t)||0,D(n)&&(d=!!n.leading,a=(l="maxWait"in n)?T(H(n.maxWait)||0,t):a,f="trailing"in n?!!n.trailing:f),g.cancel=function(){void 0!==c&&clearTimeout(c),u=0,o=s=i=c=void 0},g.flush=function(){return void 0===c?r:v(S())},g},W=function(){};function P(e){e&&e.forEach(function(e){var t=Array.prototype.slice.call(e.addedNodes),n=Array.prototype.slice.call(e.removedNodes
1900);if(function e(t){var n=void 0,o=void 0;for(n=0;n<t.length;n+=1){if((o=t[n]).dataset&&o.dataset.aos)return!0;if(o.children&&e(o.children))return!0}return!1}(t.concat(n)))return W()})}function Y(){return window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver}var _={isSupported:function(){return!!Y()},ready:function(e,t){var n=window.document,o=new(Y())(P);W=t,o.observe(n.documentElement,{childList:!0,subtree:!0,removedNodes:!0})}},B=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},F=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),I=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},K=/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i,G=/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i,J=/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i,Q=/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|
1900sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i;function R(){return navigator.userAgent||navigator.vendor||window.opera||""}var U=new(function(){function e(){B(this,e)}return F(e,[{key:"phone",value:function(){var e=R();return!(!K.test(e)&&!G.test(e.substr(0,4)))}},{key:"mobile",value:function(){var e=R();return!(!J.test(e)&&!Q.test(e.substr(0,4)))}},{key:"tablet",value:function(){return this.mobile()&&!this.phone()}},{key:"ie11",value:function(){return"-ms-scroll-limit"in document.documentElement.style&&"-ms-ime-align"in document.documentElement.style}}]),e}()),V=function(e,t){var n=void 0;return U.ie11()?(n=document.createEvent("CustomEvent")).initCustomEvent(e,!0,!0,{detail:t}):n=new CustomEvent(e,{detail:t}),document.dispatchEvent(n)},X=function(e){return e.forEach(function(e,t){return function(e,t){var n=e.options,o=e.position,i=e.node,a=(e.data,function(){e.animated&&(function(e,t){t&&t.forEach(function(t){return e.classList.remove(t)})}(i,n.animatedClassNames),V("aos:out",i),e.options.id&&V("aos:in:"+e.options.id,i),e.animated=!1)});n.mirror&&t>=o.out&&!n.once?a():t>=o.in?e.animated||(function(e,t){t&&t.forEach(function(t){return e.classList.add(t)})}(i,n.animatedClassNames),V("aos:in",i),e.options.id&&V("aos:in:"+e.options.id,i),e.animated=!0):e.animated&&!n.once&&a()}(e,window.pageYOffset)})},Z=function(e){for(var t=0,n=0;e&&!isNaN(e.offsetLeft)&&!isNaN(e.offsetTop);)t+=e.offsetLeft-("BODY"!=e.tagName?e.scrollLeft:0),n+=e.offsetTop-("BODY"!=e.tagName?e.scrollTop:0),e=e.offsetParent;return{top:n,left:t}},ee=function(e,t,n){var o=e.getAttribute("data-aos-"+t);if(void 0!==o){if("true"===o)return!0;if("false"===o)return!1}return o||n},te=function(e,t){return e.forEach(function(e,n){var o=ee(e.node,"mirror",t.mirror),i=ee(e.node,"once",t.once),a=ee(e.node,"id"),r=t.useClassNames&&e.node.getAttribute("data-aos"),c=[t.animatedClassName].concat(r?r.split(" "):[]).filter(function(e){return"string"==typeof e});t.initClassName&&e.node.classList.add(t.initClassName),e.position={in:function(e,t,n){var o=window.innerHeight,i=ee(e,"anchor"),a=ee(e,"anchor-placement"),r=Number(ee(e,"offset",a?0:t)),c=a||n,s=e;i&&document.querySelectorAll(i)&&(s=document.querySelectorAll(i)[0]);var u=Z(s).top-o;switch(c){case"top-bottom":break;case"center-bottom":u+=s.offsetHeight/2;break;case"bottom-bottom":u+=s.offsetHeight;break;case"top-center":u+=o/2;break;case"center-center":u+=o/2+s.offsetHeight/2;break;case"bottom-center":u+=o/2+s.offsetHeight;break;case"top-top":u+=o;break;case"bottom-top":u+=o+s.offsetHeight;break;case"center-top":u+=o+s.offsetHeight/2}return u+r}(e.node,t.offset,t.anchorPlacement),out:o&&function(e,t){window.innerHeight;var n=ee(e,"anchor"),o=ee(e,"offset",t),i=e;return n&&document.querySelectorAll(n)&&(i=document.querySelectorAll(n)[0]),Z(i).top+i.offsetHeight-o}(e.node,t.offset)},e.options={once:i,mirror:o,animatedClassNames:c,id:a}}),e},ne=function(){var e=document.querySelectorAll("[data-aos]");return Array.prototype.map.call(e,function(e){return{node:e}})},oe=[],ie=!1,ae={offset:120,delay:0,easing:"ease",duration:400,disable:!1,once:!1,mirror:!1,anchorPlacement:"top-bottom",startEvent:"DOMContentLoaded",animatedClassName:"aos-animate",initClassName:"aos-init",useClassNames:!1,disableMutationObserver:!1,throttleDelay:99,debounceDelay:50},re=function(){return document.all&&!window.atob},ce=function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0]&&(ie=!0),ie&&(oe=te(oe,ae),X(oe),window.addEventListener("scroll",y(function(){X(oe,ae.once)},ae.throttleDelay)))},se=function(){if(oe=ne(),de(ae.disable)||re())return ue();ce()},ue=function(){oe.forEach(function(e,t){e.node.removeAttribute("data-aos"),e.node.removeAttribute("data-aos-easing"),e.node.removeAttribute("data-aos-duration"),e.node.removeAttribute("data-aos-delay"),ae.initClassName&&e.node.classList.remove(ae.initClassName),ae.animatedClassName&&e.node.classList.remove(ae.animatedClassName)})},de=function(e){return!0===e||"mobile"===e&&U.mobile()||"phone"===e&&U.phone()||"tablet"===e&&U.tablet()||"function"==typeof e&&!0===e()};return{init:function(e){return ae=I(ae,e),oe=ne(),ae.disableMutationObserver||_.isSupported()||(console.info('\n aos: MutationObserver is not supported on this browser,\n code mutations observing has been disabled.\n You may have to call "refreshHard()" by yourself.\n '),ae.disableMutationObserver=!0),ae.disableMutationObserver||_.ready("[data-aos]",se),de(ae.disable)||re()?ue():(document.querySelector("body").setAttribute("data-aos-easing",ae.easing),document.querySelector("body").setAttribute("data-aos-duration",ae.duration),document.querySelector("body").setAttribute("data-aos-delay",ae.delay),-1===["DOMContentLoaded","load"].indexOf(ae.startEvent)?document.addEventListener(ae.startEvent,function(){ce(!0)}):window.addEventListener("load",function(){ce(!0)}
1900),"DOMContentLoaded"===ae.startEvent&&["complete","interactive"].indexOf(document.readyState)>-1&&ce(!0),window.addEventListener("resize",$(ce,ae.debounceDelay,!0)),window.addEventListener("orientationchange",$(ce,ae.debounceDelay,!0)),oe)},refresh:ce,refreshHard:se}}); 1901 1902!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.Backpax=e():t.Backpax=e()}(window,function(){return function(t){var e={};function r(o){if(e[o])return e[o].exports;var n=e[o]={i:o,l:!1,exports:{}};return t[o].call(n.exports,n,n.exports,r),n.l=!0,n.exports}return r.m=t,r.c=e,r.d=function(t,e,o){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:o})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var o=Object.create(null);if(r.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)r.d(o,n,function(e){return t[e]}.bind(null,n));return o},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="bundle",r(r.s=39)}([function(t,e,r){"use strict";var o=TypeError,n=Object.getOwnPropertyDescriptor;if(n)try{n({},"")}catch(t){n=null}var i=function(){throw new o},a=n?function(){try{return arguments.callee,i}catch(t){try{return n(arguments,"callee").get}catch(t){return i}}}():i,f=r(14)(),p=Object.getPrototypeOf||function(t){return t.__proto__},u=void 0,y="undefined"==typeof Uint8Array?void 0:p(Uint8Array),c={"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?void 0:ArrayBuffer,"%ArrayBufferPrototype%":"undefined"==typeof ArrayBuffer?void 0:ArrayBuffer.prototype,"%ArrayIteratorPrototype%":f?p([][Symbol.iterator]()):void 0,"%ArrayPrototype%":Array.prototype,"%ArrayProto_entries%":Array.prototype.entries,"%ArrayProto_forEach%":Array.prototype.forEach,"%ArrayProto_keys%":Array.prototype.keys,"%ArrayProto_values%":Array.prototype.values,"%AsyncFromSyncIteratorPrototype%":void 0,"%AsyncFunction%":void 0,"%AsyncFunctionPrototype%":void 0,"%AsyncGenerator%":void 0,"%AsyncGeneratorFunction%":void 0,"%AsyncGeneratorPrototype%":void 0,"%AsyncIteratorPrototype%":u&&f&&Symbol.asyncIterator?u[Symbol.asyncIterator]():void 0,"%Atomics%":"undefined"==typeof Atomics?void 0:Atomics,"%Boolean%":Boolean,"%BooleanPrototype%":Boolean.prototype,"%DataView%":"undefined"==typeof DataView?void 0:DataView,"%DataViewPrototype%":"undefined"==typeof DataView?void 0:DataView.prototype,"%Date%":Date,"%DatePrototype%":Date.prototype,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%ErrorPrototype%":Error.prototype,"%eval%":eval,"%EvalError%":EvalError,"%EvalErrorPrototype%":EvalError.prototype,"%Float32Array%":"undefined"==typeof Float32Array?void 0:Float32Array,"%Float32ArrayPrototype%":"undefined"==typeof Float32Array?void 0:Float32Array.prototype,"%Float64Array%":"undefined"==typeof Float64Array?void 0:Float64Array,"%Float64ArrayPrototype%":"undefined"==typeof Float64Array?void 0:Float64Array.prototype,"%Function%":Function,"%FunctionPrototype%":Function.prototype,"%Generator%":void 0,"%GeneratorFunction%":void 0,"%GeneratorPrototype%":void 0,"%Int8Array%":"undefined"==typeof Int8Array?void 0:Int8Array,"%Int8ArrayPrototype%":"undefined"==typeof Int8Array?void 0:Int8Array.prototype,"%Int16Array%":"undefined"==typeof Int16Array?void 0:Int16Array,"%Int16ArrayPrototype%":"undefined"==typeof Int16Array?void 0:Int8Array.prototype,"%Int32Array%":"undefined"==typeof Int32Array?void 0:Int32Array,"%Int32ArrayPrototype%":"undefined"==typeof Int32Array?void 0:Int32Array.prototype,"%isFinite%":isFinite,"%isNaN%":isNaN,"%
1902IteratorPrototype%":f?p(p([][Symbol.iterator]())):void 0,"%JSON%":"object"==typeof JSON?JSON:void 0,"%JSONParse%":"object"==typeof JSON?JSON.parse:void 0,"%Map%":"undefined"==typeof Map?void 0:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&f?p((new Map)[Symbol.iterator]()):void 0,"%MapPrototype%":"undefined"==typeof Map?void 0:Map.prototype,"%Math%":Math,"%Number%":Number,"%NumberPrototype%":Number.prototype,"%Object%":Object,"%ObjectPrototype%":Object.prototype,"%ObjProto_toString%":Object.prototype.toString,"%ObjProto_valueOf%":Object.prototype.valueOf,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?void 0:Promise,"%PromisePrototype%":"undefined"==typeof Promise?void 0:Promise.prototype,"%PromiseProto_then%":"undefined"==typeof Promise?void 0:Promise.prototype.then,"%Promise_all%":"undefined"==typeof Promise?void 0:Promise.all,"%Promise_reject%":"undefined"==typeof Promise?void 0:Promise.reject,"%Promise_resolve%":"undefined"==typeof Promise?void 0:Promise.resolve,"%Proxy%":"undefined"==typeof Proxy?void 0:Proxy,"%RangeError%":RangeError,"%RangeErrorPrototype%":RangeError.prototype,"%ReferenceError%":ReferenceError,"%ReferenceErrorPrototype%":ReferenceError.prototype,"%Reflect%":"undefined"==typeof Reflect?void 0:Reflect,"%RegExp%":RegExp,"%RegExpPrototype%":RegExp.prototype,"%Set%":"undefined"==typeof Set?void 0:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&f?p((new Set)[Symbol.iterator]()):void 0,"%SetPrototype%":"undefined"==typeof Set?void 0:Set.prototype,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?void 0:SharedArrayBuffer,"%SharedArrayBufferPrototype%":"undefined"==typeof SharedArrayBuffer?void 0:SharedArrayBuffer.prototype,"%String%":String,"%StringIteratorPrototype%":f?p(""[Symbol.iterator]()):void 0,"%StringPrototype%":String.prototype,"%Symbol%":f?Symbol:void 0,"%SymbolPrototype%":f?Symbol.prototype:void 0,"%SyntaxError%":SyntaxError,"%SyntaxErrorPrototype%":SyntaxError.prototype,"%ThrowTypeError%":a,"%TypedArray%":y,"%TypedArrayPrototype%":y?y.prototype:void 0,"%TypeError%":o,"%TypeErrorPrototype%":o.prototype,"%Uint8Array%":"undefined"==typeof Uint8Array?void 0:Uint8Array,"%Uint8ArrayPrototype%":"undefined"==typeof Uint8Array?void 0:Uint8Array.prototype,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?void 0:Uint8ClampedArray,"%Uint8ClampedArrayPrototype%":"undefined"==typeof Uint8ClampedArray?void 0:Uint8ClampedArray.prototype,"%Uint16Array%":"undefined"==typeof Uint16Array?void 0:Uint16Array,"%Uint16ArrayPrototype%":"undefined"==typeof Uint16Array?void 0:Uint16Array.prototype,"%Uint32Array%":"undefined"==typeof Uint32Array?void 0:Uint32Array,"%Uint32ArrayPrototype%":"undefined"==typeof Uint32Array?void 0:Uint32Array.prototype,"%URIError%":URIError,"%URIErrorPrototype%":URIError.prototype,"%WeakMap%":"undefined"==typeof WeakMap?void 0:WeakMap,"%WeakMapPrototype%":"undefined"==typeof WeakMap?void 0:WeakMap.prototype,"%WeakSet%":"undefined"==typeof WeakSet?void 0:WeakSet,"%WeakSetPrototype%":"undefined"==typeof WeakSet?void 0:WeakSet.prototype},s=r(4).call(Function.call,String.prototype.replace),l=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,d=/\\(\\)?/g;t.exports=function(t,e){if("string"!=typeof t||0===t.length)throw new TypeError("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof e)throw new TypeError('"allowMissing" argument must be a boolean');for(var r,i=(r=[],s(t,l,function(t,e,o,n){r[r.length]=o?s(n,d,"$1"):e||t}),r),a=function(t,e){if(!(t in c))throw new SyntaxError("intrinsic "+t+" does not exist!");if(void 0===c[t]&&!e)throw new o("intrinsic "+t+" exists, but is not available. Please file an issue!");return c[t]}("%"+(i.length>0?i[0]:"")+"%",e),f=1;f<i.length;f+=1)if(null!=a)if(n&&f+1>=i.length){var p=n(a,i[f]);if(!(e||i[f]in a))throw new o("base intrinsic for "+t+" exists, but the property is not available.");a=p?p.get||p.value:a[i[f]]}else a=a[i[f]];return a}},function(t,e,r){"use strict";var o=r(11),n="function"==typeof Symbol&&"symbol"==typeof Symbol("foo"),i=Object.prototype.toString,a=Array.prototype.concat,f=Object.defineProperty,p=f&&function(){var t={};try{for(var e in f(t,"x",{enumerable:!1,value:t}),t)return!1;return t.x===t}catch(t){return!1}}(),u=function(t,e,r,o){var n;e in t&&("function"!=typeof(n=o)||"[object Function]"!==i.call(n)||!o())||(p?f(t,e,{configurable:!0,enumerable:!1,value:r,writable:!0}):t[e]=r)},y=function(t,e){var r=arguments.length>2?arguments[2]:{},i=o(e);n&&(i=a.call(i,Object.getOwnPropertySymbols(e)));for(var f=0;f<i.length;f+=1)u(t,i[f],e[i[f]],r[i[f]])};y.supportsDescriptors=!!p,t.exports=y},function(t,e,r){"use strict";
1902t.exports=r(13)},function(t,e){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,e,r){"use strict";var o=r(16);t.exports=Function.prototype.bind||o},function(t,e,r){"use strict";var o=r(17),n=r(18),i=r(37);t.exports=function(t){var e=o(this),r=n(e.length);if(!i(t))throw new TypeError("Array#find: predicate must be a function");if(0!==r){var a;arguments.length>0&&(a=arguments[1]);for(var f,p=0;p<r;p++)if(f=e[p],t.apply(a,[f,p,e]))return f}}},function(t,e,r){"use strict";var o=r(4),n=r(0),i=n("%Function.prototype.apply%"),a=n("%Function.prototype.call%"),f=n("%Reflect.apply%",!0)||o.call(a,i);t.exports=function(){return f(o,a,arguments)},t.exports.apply=function(){return f(o,i,arguments)}},function(t,e,r){"use strict";var o,n,i=Function.prototype.toString,a="object"==typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"==typeof a&&"function"==typeof Object.defineProperty)try{o=Object.defineProperty({},"length",{get:function(){throw n}}),n={}}catch(t){a=null}else a=null;var f=/^\s*class\b/,p=function(t){try{var e=i.call(t);return f.test(e)}catch(t){return!1}},u=Object.prototype.toString,y="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;t.exports=a?function(t){if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;if("function"==typeof t&&!t.prototype)return!0;try{a(t,null,o)}catch(t){if(t!==n)return!1}return!p(t)}:function(t){if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;if("function"==typeof t&&!t.prototype)return!0;if(y)return function(t){try{return!p(t)&&(i.call(t),!0)}catch(t){return!1}}(t);if(p(t))return!1;var e=u.call(t);return"[object Function]"===e||"[object GeneratorFunction]"===e}},function(t,e,r){"use strict";t.exports=function(){return Array.prototype.find&&1!==[,1].find(function(){return!0})?Array.prototype.find:r(5)}},function(t,e,r){"use strict";function o(t,e){if(null==t)throw new TypeError("Cannot convert first argument to object");for(var r=Object(t),o=1;o<arguments.length;o++){var n=arguments[o];if(null!=n)for(var i=Object.keys(Object(n)),a=0,f=i.length;a<f;a++){var p=i[a],u=Object.getOwnPropertyDescriptor(n,p);void 0!==u&&u.enumerable&&(r[p]=n[p])}}return r}
1902t.exports={assign:o,polyfill:function(){Object.assign||Object.defineProperty(Object,"assign",{enumerable:!1,configurable:!0,writable:!0,value:o})}}},function(t,e,r){"use strict";var o=r(1),n=r(2),i=r(5),a=r(8),f=r(38),p=Array.prototype.slice,u=a(),y=function(t,e){n(t);var r=p.call(arguments,1);return u.apply(t,r)};o(y,{getPolyfill:a,implementation:i,shim:f}),t.exports=y},function(t,e,r){"use strict";var o=Object.prototype.hasOwnProperty,n=Object.prototype.toString,i=Array.prototype.slice,a=r(12),f=Object.prototype.propertyIsEnumerable,p=!f.call({toString:null},"toString"),u=f.call(function(){},"prototype"),y=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],c=function(t){var e=t.constructor;return e&&e.prototype===t},s={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},l=function(){if("undefined"==typeof window)return!1;for(var t in window)try{if(!s["$"+t]&&o.call(window,t)&&null!==window[t]&&"object"==typeof window[t])try{c(window[t])}catch(t){return!0}}catch(t){return!0}return!1}(),d=function(t){var e=null!==t&&"object"==typeof t,r="[object Function]"===n.call(t),i=a(t),f=e&&"[object String]"===n.call(t),s=[];if(!e&&!r&&!i)throw new TypeError("Object.keys called on a non-object");var d=u&&r;if(f&&t.length>0&&!o.call(t,0))for(var b=0;b<t.length;++b)s.push(String(b));if(i&&t.length>0)for(var v=0;v<t.length;++v)s.push(String(v));else for(var m in t)d&&"prototype"===m||!o.call(t,m)||s.push(String(m));if(p)for(var g=function(t){if("undefined"==typeof window||!l)return c(t);try{return c(t)}catch(t){return!1}}(t),h=0;h<y.length;++h)g&&"constructor"===y[h]||!o.call(t,y[h])||s.push(y[h]);return s};d.shim=function(){if(Object.keys){if(!function(){return 2===(Object.keys(arguments)||"").length}(1,2)){var t=Object.keys;Object.keys=function(e){return a(e)?t(i.call(e)):t(e)}}}else Object.keys=d;return Object.keys||d},t.exports=d},function(t,e,r){"use strict";var o=Object.prototype.toString;t.exports=function(t){var e=o.call(t),r="[object Arguments]"===e;return r||(r="[object Array]"!==e&&null!==t&&"object"==typeof t&&"number"==typeof t.length&&t.length>=0&&"[object Function]"===o.call(t.callee)),r}},function(t,e,r){"use strict";var o=r(0)("%TypeError%");t.exports=function(t,e){if(null==t)throw new o(e||"Cannot call method on "+t);return t}},function(t,e,r){"use strict";(function(e){var o=e.Symbol,n=r(15);t.exports=function(){return"function"==typeof o&&("function"==typeof Symbol&&("symbol"==typeof o("foo")&&("symbol"==typeof Symbol("bar")&&n())))}}).call(this,r(3))},function(t,e,r){"use strict";t.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var t={},e=Symbol("test"),r=Object(e);if("string"==typeof e)return!1;if("[object Symbol]"!==Object.prototype.toString.call(e))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(e in t[e]=42,t)return!1;if("function"==typeof Object.keys&&0!==Object.keys(t).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var o=Object.getOwnPropertySymbols(t);if(1!==o.length||o[0]!==e)return!1;if(!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var n=Object.getOwnPropertyDescriptor(t,e);if(42!==n.value||!0!==n.enumerable)return!1}return!0}},function(t,e,r){"use strict";var o=Array.prototype.slice,n=Object.prototype.toString;t.exports=function(t){var e=this;if("function"!=typeof e||"[object Function]"!==n.call(e))throw new TypeError("Function.prototype.bind called on incompatible "+e);for(var r,i=o.call(arguments,1),a=Math.max(0,e.length-i.length),f=[],p=0;p<a;p++)f.push("$"+p);if(r=Function("binder","return function ("+f.join(",")+"){ return binder.apply(this,arguments); }")(function(){if(this instanceof r){var n=e.apply(this,i.concat(o.call(arguments)));return Object(n)===n?n:this}return e.apply(t,i.concat(o.call(arguments)))}),e.prototype){var u=function(){};u.prototype=e.prototype,r.prototype=new u,u.prototype=null}return r}},function(t,e,r){"use strict";var o=r(0)("%Object%"),n=r(2);t.exports=function(t){return n(t),o(t)}},function(t,e,r){"use strict";var o=r(19),n=r(20);t.exports=function(t){var e=n(t);return e<=0?0:e>o?o:e}},function(t,e,r){"use strict";var o=r(0),n=o("%Math%"),i=o("%Number%");
1902t.exports=i.MAX_SAFE_INTEGER||n.pow(2,53)-1},function(t,e,r){"use strict";var o=r(21),n=r(26);t.exports=function(t){var e=n(t);return o(e)}},function(t,e,r){"use strict";var o=r(0)("%Math%"),n=r(22),i=r(23),a=r(24),f=r(25),p=o.floor,u=o.abs;t.exports=function(t){var e=n(t);return i(e)?0:0!==e&&a(e)?f(e)*p(u(e)):e}},function(t,e,r){"use strict";t.exports=function(t){return+t}},function(t,e,r){"use strict";t.exports=Number.isNaN||function(t){return t!=t}},function(t,e,r){"use strict";var o=Number.isNaN||function(t){return t!=t};t.exports=Number.isFinite||function(t){return"number"==typeof t&&!o(t)&&t!==1/0&&t!==-1/0}},function(t,e,r){"use strict";t.exports=function(t){return t>=0?1:-1}},function(t,e,r){"use strict";var o=r(0),n=o("%TypeError%"),i=o("%Number%"),a=o("%RegExp%"),f=o("%parseInt%"),p=r(27),u=r(28),y=r(29),c=p("String.prototype.slice"),s=u(/^0b[01]+$/i),l=u(/^0o[0-7]+$/i),d=u(/^[-+]0x[0-9a-f]+$/i),b=u(new a("["+["Â
","â","￾"].join("")+"]","g")),v=["\t\n\v\f\r  áá ââââ","ââ
ââââââ¯âã\u2028","\u2029\ufeff"].join(""),m=new RegExp("(^["+v+"]+)|(["+v+"]+$)","g"),g=p("String.prototype.replace"),h=r(30);t.exports=function t(e){var r=y(e)?e:h(e,i);if("symbol"==typeof r)throw new n("Cannot convert a Symbol value to a number");if("string"==typeof r){if(s(r))return t(f(c(r,2),2));if(l(r))return t(f(c(r,2),8));if(b(r)||d(r))return NaN;var o=function(t){return g(t,m,"")}(r);if(o!==r)return t(o)}return i(r)}},function(t,e,r){"use strict";var o=r(0),n=r(6),i=n(o("String.prototype.indexOf"));t.exports=function(t,e){var r=o(t,!!e);return"function"==typeof r&&i(t,".prototype.")?n(r):r}},function(t,e,r){"use strict";var o=r(0)("RegExp.prototype.test"),n=r(6);t.exports=function(t){return n(o,t)}},function(t,e,r){"use strict";t.exports=function(t){return null===t||"function"!=typeof t&&"object"!=typeof t}},function(t,e,r){"use strict";var o=r(31);t.exports=function(t){return arguments.length>1?o(t,arguments[1]):o(t)}},function(t,e,r){"use strict";var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator,n=r(32),i=r(7),a=r(33),f=r(34);t.exports=function(t){if(n(t))return t;var e,r="default";if(arguments.length>1&&(arguments[1]===String?r="string":arguments[1]===Number&&(r="number")),o&&(Symbol.toPrimitive?e=function(t,e){var r=t[e];if(null!=r){if(!i(r))throw new TypeError(r+" returned for property "+e+" of object "+t+" is not a function");return r}}(t,Symbol.toPrimitive):f(t)&&(e=Symbol.prototype.valueOf)),void 0!==e){var p=e.call(t,r);
1902if(n(p))return p;throw new TypeError("unable to convert exotic object to primitive")}return"default"===r&&(a(t)||f(t))&&(r="string"),function(t,e){if(null==t)throw new TypeError("Cannot call method on "+t);if("string"!=typeof e||"number"!==e&&"string"!==e)throw new TypeError('hint must be "string" or "number"');var r,o,a,f="string"===e?["toString","valueOf"]:["valueOf","toString"];for(a=0;a<f.length;++a)if(r=t[f[a]],i(r)&&(o=r.call(t),n(o)))return o;throw new TypeError("No default value")}(t,"default"===r?"number":r)}},function(t,e,r){"use strict";t.exports=function(t){return null===t||"function"!=typeof t&&"object"!=typeof t}},function(t,e,r){"use strict";var o=Date.prototype.getDay,n=Object.prototype.toString,i="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;t.exports=function(t){return"object"==typeof t&&null!==t&&(i?function(t){try{return o.call(t),!0}catch(t){return!1}}(t):"[object Date]"===n.call(t))}},function(t,e,r){"use strict";var o=Object.prototype.toString;if(r(35)()){var n=Symbol.prototype.toString,i=/^Symbol\(.*\)$/;t.exports=function(t){if("symbol"==typeof t)return!0;if("[object Symbol]"!==o.call(t))return!1;try{return function(t){return"symbol"==typeof t.valueOf()&&i.test(n.call(t))}(t)}catch(t){return!1}}}else t.exports=function(t){return!1}},function(t,e,r){"use strict";(function(e){var o=e.Symbol,n=r(36);t.exports=function(){return"function"==typeof o&&("function"==typeof Symbol&&("symbol"==typeof o("foo")&&("symbol"==typeof Symbol("bar")&&n())))}}).call(this,r(3))},function(t,e,r){"use strict";t.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var t={},e=Symbol("test"),r=Object(e);if("string"==typeof e)return!1;if("[object Symbol]"!==Object.prototype.toString.call(e))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(e in t[e]=42,t)return!1;if("function"==typeof Object.keys&&0!==Object.keys(t).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var o=Object.getOwnPropertySymbols(t);if(1!==o.length||o[0]!==e)return!1;if(!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var n=Object.getOwnPropertyDescriptor(t,e);if(42!==n.value||!0!==n.enumerable)return!1}return!0}},function(t,e,r){"use strict";t.exports=r(7)},function(t,e,r){"use strict";var o=r(1),n=r(8);t.exports=function(){var t=n();return o(Array.prototype,{find:t},{find:function(){return Array.prototype.find!==t}}),t}},function(t,e,r){"use strict";r.r(e);var o=function(){return window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0},n=function(t,e,r){var o;return void 0===r&&(r=!1),function(){var n=r&&!o;clearTimeout(o),o=window.setTimeout(function(){o=void 0,r||t()},e),n&&t()}},i=r(9).assign,a=(r(10).shim(),{speed:"auto"}),f=function(){function t(t,e){var r=this;void 0===e&&(e={}),t instanceof NodeList?this.elements=t:this.elements=document.querySelectorAll(t),this.controls=[],this.items=[],this.options=i({},a,e),this.move=0,this.setup(),"requestAnimationFrame"in window&&document.addEventListener("scroll",function(){r.run()},{passive:!0}),window.addEventListener("resize",n(function(){[].forEach.call(r.elements,function(t,e){var o=t.dataset.id;if(o){var n=document.getElementById(o);n&&r.setBestImg(t,n,e)}})},100))}return t.prototype.setBestImg=function(t,e,r){var o=window.innerWidth,n=t.dataset.img,i=Object.keys(t.dataset).reduce(function(e,r){if(/img-\d*/.test(r)){var o=r.match(/img-(\d*)/);if(o&&o[1]){var n=parseInt(o[1],10);e.push({point:n,src:t.dataset[r]})}}return e},[]);i.sort(function(t,e){return t.point<e.point?-1:1});var a=i.find(function(t){return o<t.point});a&&(n=a.src);var f="url("+n+")";f!==e.style.backgroundImage&&(e.style.backgroundImage=f),this.setImgRatio(t,n,r)},t.prototype.setup=function(){var t=this;[].forEach.call(this.elements,function(e,r){e.style.position="relative",e.style.overflow="hidden";var o=(Date.now().toString(36)+Math.random().toString(36).substr(2,5)).toUpperCase();e.dataset.id=o;var n=document.createElement("div");e.insertBefore(n,null),t.setBestImg(e,n,r),n.id=o,n.style.position="absolute",n.style.top="0",n.style.left="0",n.style.right="0",n.style.bottom="0",n.style.backgroundRepeat="no-repeat",n.style.backgroundPosition="bottom center",n.style.backgroundSize="cover",n.style.transformStyle="flat",n.style.backfaceVisibility="hidden",n.style.willChange="transform",t.items.push({element:e,insert:n,elementOffsetHeight:e.offsetHeight,insertOffsetHeight:0})})},t.prototype.setImgRatio=function(t,e,r){var o=this,n=new Image;
1902n.onload=function(){var e=n.width/n.height,i=o.controls[r];i?i.ratio=e:o.controls[r]={ratio:e,speed:parseInt(t.dataset.speed,10)};var a=t.dataset.id,f=document.getElementById(a);f&&(t.offsetHeight>t.offsetWidth/e?(f.style.height=t.style.height,f.style.width=t.offsetHeight*e+"px"):(f.style.height=t.offsetWidth/e+"px",f.style.width="100%"),o.items[r].insertOffsetHeight=f.offsetHeight)},n.src=e},t.prototype.run=function(){var t=this,e=o(),r=window.innerHeight;[].forEach.call(this.items,function(o,n){var i=o.element,a=o.insert,f=i.getBoundingClientRect().top+e;if(t.controls[n]&&t.controls[n].ratio){var p=t.controls[n].ratio,u=o.elementOffsetHeight,y=o.insertOffsetHeight;if(!(e+r<f)){var c=e+r-f,s=u-y,l=t.options.speed;if("auto"===l){if(!p)return;l=(y-u)/(r+u/2)}t.controls[n]&&t.controls[n].speed&&(l=t.controls[n].speed);var d=s+c*l;c!==t.move&&requestAnimationFrame(function(){a.style.transform="translateY("+Math.round(d)+"px)"}),t.move=c}}})},t}();e.default=f}]).default});
vendor: 18,354 bytes, line 1903
1903var List;List=function(){var t={"./src/add-async.js":function(t){t.exports=function(t){return function e(r,n,s){var i=r.splice(0,50);s=(s=s||[]).concat(t.add(i)),r.length>0?setTimeout((function(){e(r,n,s)}),1):(t.update(),n(s))}}},"./src/filter.js":function(t){t.exports=function(t){return t.handlers.filterStart=t.handlers.filterStart||[],t.handlers.filterComplete=t.handlers.filterComplete||[],function(e){if(t.trigger("filterStart"),t.i=1,t.reset.filter(),void 0===e)t.filtered=!1;else{t.filtered=!0;for(var r=t.items,n=0,s=r.length;n<s;n++){var i=r[n];e(i)?i.filtered=!0:i.filtered=!1}}return t.update(),t.trigger("filterComplete"),t.visibleItems}}},"./src/fuzzy-search.js":function(t,e,r){r("./src/utils/classes.js");var n=r("./src/utils/events.js"),s=r("./src/utils/extend.js"),i=r("./src/utils/to-string.js"),a=r("./src/utils/get-by-class.js"),o=r("./src/utils/fuzzy.js");t.exports=function(t,e){e=s({location:0,distance:100,threshold:.4,multiSearch:!0,searchClass:"fuzzy-search"},e=e||{});var r={search:function(n,s){for(var i=e.multiSearch?n.replace(/ +$/,"").split(/ +/):[n],a=0,o=t.items.length;a<o;a++)r.item(t.items[a],s,i)},item:function(t,e,n){for(var s=!0,i=0;i<n.length;i++){for(var a=!1,o=0,l=e.length;o<l;o++)r.values(t.values(),e[o],n[i])&&(a=!0);a||(s=!1)}t.found=s},values:function(t,r,n){if(t.hasOwnProperty(r)){var s=i(t[r]).toLowerCase();if(o(s,n,e))return!0}return!1}};return n.bind(a(t.listContainer,e.searchClass),"keyup",t.utils.events.debounce((function(e){var n=e.target||e.srcElement;t.search(n.value,r.search)}),t.searchDelay)),function(e,n){t.search(e,n,r.search)}}},"./src/index.js":function(t,e,r){var n=r("./node_modules/string-natural-compare/natural-compare.js"),s=r("./src/utils/get-by-class.js"),i=r("./src/utils/extend.js"),a=r("./src/utils/index-of.js"),o=r("./src/utils/events.js"),l=r("./src/utils/to-string.js"),u=r("./src/utils/classes.js"),c=r("./src/utils/get-attribute.js"),f=r("./src/utils/to-array.js");t.exports=function(t,e,h){var d,v=this,g=r("./src/item.js")(v),m=r("./src/add-async.js")(v),p=r("./src/pagination.js")(v);d={start:function(){v.listClass="list",v.searchClass="search",v.sortClass="sort",v.page=1e4,v.i=1,v.items=[],v.visibleItems=[],v.matchingItems=[],v.searched=!1,v.filtered=!1,v.searchColumns=void 0,v.searchDelay=0,v.handlers={updated:[]},v.valueNames=[],v.utils={getByClass:s,extend:i,indexOf:a,events:o,toString:l,naturalSort:n,classes:u,getAttribute:c,toArray:f},v.utils.extend(v,e),v.listContainer="string"==typeof t?document.getElementById(t):t,v.listContainer&&(v.list=s(v.listContainer,v.listClass,!0),v.parse=r("./src/parse.js")(v),v.templater=r("./src/templater.js")(v),v.search=r("./src/search.js")(v),v.filter=r("./src/filter.js")(v),v.sort=r("./src/sort.js")(v),v.fuzzySearch=r("./src/fuzzy-search.js")(v,e.fuzzySearch),this.handlers(),this.items(),this.pagination(),v.update())},handlers:function(){for(var t in v.handlers)v[t]&&v.handlers.hasOwnProperty(t)&&v.on(t,v[t])},items:function(){v.parse(v.list),void 0!==h&&v.add(h)},pagination:function(){if(void 0!==e.pagination){!0===e.pagination&&(e.pagination=[{}]),void 0===e.pagination[0]&&(e.pagination=[e.pagination]);for(var t=0,r=e.pagination.length;t<r;t++)p(e.pagination[t])}}},this.reIndex=function(){v.items=[],v.visibleItems=[],v.matchingItems=[],v.searched=!1,v.filtered=!1,v.parse(v.list)},this.toJSON=function(){for(var t=[],e=0,r=v.items.length;e<r;e++)t.push(v.items[e].values());return t},this.add=function(t,e){if(0!==t.length){if(!e){var r=[],n=!1;void 0===t[0]&&(t=[t]);for(var s=0,i=t.length;s<i;s++){var a;n=v.items.length>v.page,a=new g(t[s],void 0,n),v.items.push(a),r.push(a)}return v.update(),r}m(t.slice(0),e)}},this.show=function(t,e){return this.i=t,this.page=e,v.update(),v},this.remove=function(t,e,r){for(var n=0,s=0,i=v.items.length;s<i;s++)v.items[s].values()[t]==e&&(v.templater.remove(v.items[s],r),v.items.splice(s,1),i--,s--,n++);return v.update(),n},this.get=function(t,e){for(var r=[],n=0,s=v.items.length;n<s;n++){var i=v.items[n];i.values()[t]==e&&r.push(i)}return r},this.size=function(){return v.items.length},this.clear=function(){return v.templater.clear(),v.items=[],v},this.on=function(t,e){return v.handlers[t].push(e),v},this.off=function(t,e){var r=v.handlers[t],n=a(r,e);return n>-1&&r.splice(n,1),v},this.trigger=function(t){for(var e=v.handlers[t].length;e--;)v.handlers[t][e](v);return v},this.reset={filter:function(){for(var t=v.items,e=t.length;e--;)t[e].filtered=!1;return v},search:function(){for(var t=v.items,e=t.length;e--;)t[e].found=!1;return v}},this.update=function(){var t=v.items,e=t.length;v.visibleItems=[],v.matchingItems=[],v.templater.clear();for(var r=0;r<e;r++)t[r].matching()&&v.matchingItems.length+1>=v.i&&v.visibleItems.length<v.page?(t[r].show(),v.visibleItems.push(t[r]),v.matchingItems.push(t[r])):t[r].matching()?(v.matchingItems.push(t[r]),t[r].hide()):t[r].hide();return v.trigger("updated"),v},d.start()}},"./src/item.js":function(t){t.exports=function(t){return function(e,r,n){var s=this;this._values={},this.found=!1,this.filtered=!1;this.values=function(e,r){if(void 0===e)return s._values;for(var n in e)s._values[n]=e[n];!0!==r&&t.templater.set(s,s.values())},this.show=function(){t.templater.show(s)},this.hide=function(){t.templater.hide(s)},this.matching=function(){return t.filtered&&t.searched&&s.found&&s.filtered||t.filtered&&!t.searched&&s.filtered||!t.filtered&&t.searched&&s.found||!t.filtered&&!t.searched},this.visible=function(){return!(!s.elm||s.elm.parentNode!=t.list)},function(e,r,n){if(void 0===r)n?s.values(e,n):s.values(e);else{s.elm=r;var i=t.templater.get(s,e);s.values(i)}}(e,r,n)}}},"./src/pagination.js":function(t,e,r){var n=r("./src/utils/classes.js"),s=r("./src/utils/events.js"),i=r("./src/index.js");t.exports=function(t){var e=!1,r=function(r,s){if(t.page<1)return t.listContainer.style.display="none",void(e=!0);e&&(t.listContainer.style.display="block");var i,o=t.matchingItems.length,l=t.i,u=t.page,c=Math.ceil(o/u),f=Math.ceil(l/u),h=s.innerWindow||2,d=s.left||s.outerWindow||0,v=s.right||s.outerWindow||0;v=c-v,r.clear();for(var g=1;g<=c;g++){var m=f===g?"active":"";a.number(g,d,v,f,h)?(i=r.add({page:g,dotted:!1})[0],m&&n(i.elm).add(m),i.elm.firstChild.setAttribute("data-i",g),i.elm.firstChild.setAttribute("data-page",u)):a.dotted(r,g,d,v,f,h,r.size())&&(i=r.add({page:"...",dotted:!0})[0],n(i.elm).add("disabled"))}},a={number:function(t,e,r,n,s){return this.left(t,e)||this.right(t,r)||this.innerWindow(t,n,s)},left:function(t,e){return t<=e},right:function(t,e){return t>e},innerWindow:function(t,e,r){return t>=e-r&&t<=e+r},dotted:function(t,e,r,n,s,i,a){return this.dottedLeft(t,e,r,n,s,i)||this.dottedRight(t,e,r,n,s,i,a)},dottedLeft:function(t,e,r,n,s,i){return e==r+1&&!this.innerWindow(e,s,i)&&!this.right(e,n)},dottedRight:function(t,e,r,n,s,i,a){return!t.items[a-1].values().dotted&&(e==n&&!this.innerWindow(e,s,i)&&!this.right(e,n))}};return function(e){var n=new i(t.listContainer.id,{listClass:e.paginationClass||"pagination",item:e.item||"<li><a class='page' href='#'></a></li>",valueNames:["page","dotted"],searchClass:"pagination-search-that-is-not-supposed-to-exist",sortClass:"pagination-sort-that-is-not-supposed-to-exist"});s.bind(n.listContainer,"click",(function(e){var r=e.target||e.srcElement,n=t.utils.getAttribute(r,"data-page"),s=t.utils.getAttribute(r,"data-i");s&&t.show((s-1)*n+1,n)})),t.on("updated",(function(){r(n,e)})),r(n,e)}}},"./src/parse.js":function(t,e,r){t.exports=function(t){var e=r("./src/item.js")(t),n=function(r,n){for(var s=0,i=r.length;s<i;s++)t.items.push(new e(n,r[s]))},s=function e(r,s){var i=r.splice(0,50);n(i,s),r.length>0?setTimeout((function(){e(r,s)}),1):(t.update(),t.trigger("parseComplete"))};return t.handlers.parseComplete=t.handlers.parseComplete||[],function(){var e=function(t){for(var e=t.childNodes,r=[],n=0,s=e.length;n<s;n++)void 0===e[n].data&&r.push(e[n]);return r}(t.list),r=t.valueNames;t.indexAsync?s(e,r):n(e,r)}}},"./src/search.js":function(t){t.exports=function(t){var e,r,n,s={resetList:function(){t.i=1,t.templater.clear(),n=void 0},setOptions:function(t){2==t.length&&t[1]instanceof Array?e=t[1]:2==t.length&&"function"==typeof t[1]?(e=void 0,n=t[1]):3==t.length?(e=t[1],n=t[2]):e=void 0},setColumns:function(){0!==t.items.length&&void 0===e&&(e=void 0===t.searchColumns?s.toArray(t.items[0].values()):t.searchColumns)},setSearchString:function(e){e=(e=t.utils.toString(e).toLowerCase()).replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"),r=e},toArray:function(t){var e=[];for(var r in t)e.push(r);return e}},i=function(){for(var n,s=[],i=r;null!==(n=i.match(/"([^"]+)"/));)s.push(n[1]),i=i.substring(0,n.index)+i.substring(n.index+n[0].length);(i=i.trim()).length&&(s=s.concat(i.split(/\s+/)));for(var a=0,o=t.items.length;a<o;a++){var l=t.items[a];if(l.found=!1,s.length){for(var u=0,c=s.length;u<c;u++){for(var f=!1,h=0,d=e.length;h<d;h++){var v=l.values(),g=e[h];if(v.hasOwnProperty(g)&&void 0!==v[g]&&null!==v[g])if(-1!==("string"!=typeof v[g]?v[g].toString():v[g]).toLowerCase().indexOf(s[u])){f=!0;break}}if(!f)break}l.found=f}}},a=function(){t.reset.search(),t.searched=!1},o=function(o){return t.trigger("searchStart"),s.resetList(),s.setSearchString(o),s.setOptions(arguments),s.setColumns(),""===r?a():(t.searched=!0,n?n(r,e):i()),t.update(),t.trigger("searchComplete"),t.visibleItems};return t.handlers.searchStart=t.handlers.searchStart||[],t.handlers.searchComplete=t.handlers.searchComplete||[],t.utils.events.bind(t.utils.getByClass(t.listContainer,t.searchClass),"keyup",t.utils.events.debounce((function(e){var r=e.target||e.srcElement;""===r.value&&!t.searched||o(r.value)}),t.searchDelay)),t.utils.events.bind(t.utils.getByClass(t.listContainer,t.searchClass),"input",(function(t){""===(t.target||t.srcElement).value&&o("")})),o}},"./src/sort.js":function(t){t.exports=function(t){var e={els:void 0,clear:function(){for(var r=0,n=e.els.length;r<n;r++)t.utils.classes(e.els[r]).remove("asc"),t.utils.classes(e.els[r]).remove("desc")},getOrder:function(e){var r=t.utils.getAttribute(e,"data-order");return"asc"==r||"desc"==r?r:t.utils.classes(e).has("desc")?"asc":t.utils.classes(e).has("asc")?"desc":"asc"},getInSensitive:function(e,r){var n=t.utils.getAttribute(e,"data-insensitive");r.insensitive="false"!==n},setOrder:function(r){for(var n=0,s=e.els.length;n<s;n++){var i=e.els[n];if(t.utils.getAttribute(i,"data-sort")===r.valueName){var a=t.utils.getAttribute(i,"data-order");"asc"==a||"desc"==a?a==r.order&&t.utils.classes(i).add(r.order):t.utils.classes(i).add(r.order)}}}},r=function(){t.trigger("sortStart");var r={},n=arguments[0].currentTarget||arguments[0].srcElement||void 0;n?(r.valueName=t.utils.getAttribute(n,"data-sort"),e.getInSensitive(n,r),r.order=e.getOrder(n)):((r=arguments[1]||r).valueName=arguments[0],r.order=r.order||"asc",r.insensitive=void 0===r.insensitive||r.insensitive),e.clear(),e.setOrder(r);var s,i=r.sortFunction||t.sortFunction||null,a="desc"===r.order?-1:1;s=i?function(t,e){return i(t,e,r)*a}:function(e,n){var s=t.utils.naturalSort;return s.alphabet=t.alphabet||r.alphabet||void 0,!s.alphabet&&r.insensitive&&(s=t.utils.naturalSort.caseInsensitive),s(e.values()[r.valueName],n.values()[r.valueName])*a},t.items.sort(s),t.update(),t.trigger("sortComplete")};return t.handlers.sortStart=t.handlers.sortStart||[],t.handlers.sortComplete=t.handlers.sortComplete||[],e.els=t.utils.getByClass(t.listContainer,t.sortClass),t.utils.events.bind(e.els,"click",r),t.on("searchStart",e.clear),t.on("filterStart",e.clear),r}},"./src/templater.js":function(t){var e=function(t){var e,r=this,n=function(e,r){var n=e.cloneNode(!0);n.removeAttribute("id");for(var s=0,i=r.length;s<i;s++){var a=void 0,o=r[s];if(o.data)for(var l=0,u=o.data.length;l<u;l++)n.setAttribute("data-"+o.data[l],"");else o.attr&&o.name?(a=t.utils.getByClass(n,o.name,!0))&&a.setAttribute(o.attr,""):(a=t.utils.getByClass(n,o,!0))&&(a.innerHTML="")}return n},s=function(){for(var e=t.list.childNodes,r=0,n=e.length;r<n;r++)if(void 0===e[r].data)return e[r].cloneNode(!0)},i=function(t){if("string"==typeof t){if(/<tr[\s>]/g.exec(t)){var e=document.createElement("tbody");return e.innerHTML=t,e.firstElementChild}if(-1!==t.indexOf("<")){var r=document.createElement("div");return r.innerHTML=t,r.firstElementChild}}},a=function(e,r,n){var s=void 0,i=function(e){for(var r=0,n=t.valueNames.length;r<n;r++){var s=t.valueNames[r];if(s.data){for(var i=s.data,a=0,o=i.length;a<o;a++)if(i[a]===e)return{data:e}}else{if(s.attr&&s.name&&s.name==e)return s;if(s===e)return e}}}(r);i&&(i.data?e.elm.setAttribute("data-"+i.data,n):i.attr&&i.name?(s=t.utils.getByClass(e.elm,i.name,!0))&&s.setAttribute(i.attr,n):(s=t.utils.getByClass(e.elm,i,!0))&&(s.innerHTML=n))};this.get=function(e,n){r.create(e);for(var s={},i=0,a=n.length;i<a;i++){var o=void 0,l=n[i];if(l.data)for(var u=0,c=l.data.length;u<c;u++)s[l.data[u]]=t.utils.getAttribute(e.elm,"data-"+l.data[u]);else l.attr&&l.name?(o=t.utils.getByClass(e.elm,l.name,!0),s[l.name]=o?t.utils.getAttribute(o,l.attr):""):(o=t.utils.getByClass(e.elm,l,!0),s[l]=o?o.innerHTML:"")}return s},this.set=function(t,e){if(!r.create(t))for(var n in e)e.hasOwnProperty(n)&&a(t,n,e[n])},this.create=function(t){return void 0===t.elm&&(t.elm=e(t.values()),r.set(t,t.values()),!0)},this.remove=function(e){e.elm.parentNode===t.list&&t.list.removeChild(e.elm)},this.show=function(e){r.create(e),t.list.appendChild(e.elm)},this.hide=function(e){void 0!==e.elm&&e.elm.parentNode===t.list&&t.list.removeChild(e.elm)},this.clear=function(){if(t.list.hasChildNodes())for(;t.list.childNodes.length>=1;)t.list.removeChild(t.list.firstChild)},function(){var r;if("function"!=typeof t.item){if(!(r="string"==typeof t.item?-1===t.item.indexOf("<")?document.getElementById(t.item):i(t.item):s()))throw new Error("The list needs to have at least one item on init otherwise you'll have to add a template.");r=n(r,t.valueNames),e=function(){return r.cloneNode(!0)}}else e=function(e){var r=t.item(e);return i(r)}}()};t.exports=function(t){return new e(t)}},"./src/utils/classes.js":function(t,e,r){var n=r("./src/utils/index-of.js"),s=/\s+/;Object.prototype.toString;function i(t){if(!t||!t.nodeType)throw new Error("A DOM element reference is required");this.el=t,this.list=t.classList}t.exports=function(t){return new i(t)},i.prototype.add=function(t){if(this.list)return this.list.add(t),this;var e=this.array();return~n(e,t)||e.push(t),this.el.className=e.join(" "),this},i.prototype.remove=function(t){if(this.list)return this.list.remove(t),this;var e=this.array(),r=n(e,t);return~r&&e.splice(r,1),this.el.className=e.join(" "),this},i.prototype.toggle=function(t,e){return this.list?(void 0!==e?e!==this.list.toggle(t,e)&&this.list.toggle(t):this.list.toggle(t),this):(void 0!==e?e?this.add(t):this.remove(t):this.has(t)?this.remove(t):this.add(t),this)},i.prototype.array=function(){var t=(this.el.getAttribute("class")||"").replace(/^\s+|\s+$/g,"").split(s);return""===t[0]&&t.shift(),t},i.prototype.has=i.prototype.contains=function(t){return this.list?this.list.contains(t):!!~n(this.array(),t)}},"./src/utils/events.js":function(t,e,r){var n=window.addEventListener?"addEventListener":"attachEvent",s=window.removeEventListener?"removeEventListener":"detachEvent",i="addEventListener"!==n?"on":"",a=r("./src/utils/to-array.js");e.bind=function(t,e,r,s){for(var o=0,l=(t=a(t)).length;o<l;o++)t[o][n](i+e,r,s||!1)},e.unbind=function(t,e,r,n){for(var o=0,l=(t=a(t)).length;o<l;o++)t[o][s](i+e,r,n||!1)},e.debounce=function(t,e,r){var n;return e?function(){var s=this,i=arguments,a=function(){n=null,r||t.apply(s,i)},o=r&&!n;clearTimeout(n),n=setTimeout(a,e),o&&t.apply(s,i)}:t}},"./src/utils/extend.js":function(t){t.exports=function(t){for(var e,r=Array.prototype.slice.call(arguments,1),n=0;e=r[n];n++)if(e)for(var s in e)t[s]=e[s];return t}},"./src/utils/fuzzy.js":function(t){t.exports=function(t,e,r){var n=r.location||0,s=r.distance||100,i=r.threshold||.4;if(e===t)return!0;if(e.length>32)return!1;var a=n,o=function(){var t,r={};for(t=0;t<e.length;t++)r[e.charAt(t)]=0;for(t=0;t<e.length;t++)r[e.charAt(t)]|=1<<e.length-t-1;return r}();function l(t,r){var n=t/e.length,i=Math.abs(a-r);return s?n+i/s:i?1:n}var u=i,c=t.indexOf(e,a);-1!=c&&(u=Math.min(l(0,c),u),-1!=(c=t.lastIndexOf(e,a+e.length))&&(u=Math.min(l(0,c),u)));var f,h,d=1<<e.length-1;c=-1;for(var v,g=e.length+t.length,m=0;m<e.length;m++){for(f=0,h=g;f<h;)l(m,a+h)<=u?f=h:g=h,h=Math.floor((g-f)/2+f);g=h;var p=Math.max(1,a-h+1),y=Math.min(a+h,t.length)+e.length,C=Array(y+2);C[y+1]=(1<<m)-1;for(var b=y;b>=p;b--){var j=o[t.charAt(b-1)];if(C[b]=0===m?(C[b+1]<<1|1)&j:(C[b+1]<<1|1)&j|(v[b+1]|v[b])<<1|1|v[b+1],C[b]&d){var x=l(m,b-1);if(x<=u){if(u=x,!((c=b-1)>a))break;p=Math.max(1,2*a-c)}}}if(l(m+1,a)>u)break;v=C}return!(c<0)}},"./src/utils/get-attribute.js":function(t){t.exports=function(t,e){var r=t.getAttribute&&t.getAttribute(e)||null;if(!r)for(var n=t.attributes,s=n.length,i=0;i<s;i++)void 0!==n[i]&&n[i].nodeName===e&&(r=n[i].nodeValue);return r}},"./src/utils/get-by-class.js":function(t){t.exports=function(t,e,r,n){return(n=n||{}).test&&n.getElementsByClassName||!n.test&&document.getElementsByClassName?function(t,e,r){return r?t.getElementsByClassName(e)[0]:t.getElementsByClassName(e)}(t,e,r):n.test&&n.querySelector||!n.test&&document.querySelector?function(t,e,r){return e="."+e,r?t.querySelector(e):t.querySelectorAll(e)}(t,e,r):function(t,e,r){for(var n=[],s=t.getElementsByTagName("*"),i=s.length,a=new RegExp("(^|\\s)"+e+"(\\s|$)"),o=0,l=0;o<i;o++)if(a.test(s[o].className)){if(r)return s[o];n[l]=s[o],l++}return n}(t,e,r)}},"./src/utils/index-of.js":function(t){var e=[].indexOf;t.exports=function(t,r){if(e)return t.indexOf(r);for(var n=0,s=t.length;n<s;++n)if(t[n]===r)return n;return-1}},"./src/utils/to-array.js":function(t){t.exports=function(t){if(void 0===t)return[];if(null===t)return[null];if(t===window)return[window];if("string"==typeof t)return[t];if(function(t){return"[object Array]"===Object.prototype.toString.call(t)}(t))return t;if("number"!=typeof t.length)return[t];if("function"==typeof t&&t instanceof Function)return[t];for(var e=[],r=0,n=t.length;r<n;r++)(Object.prototype.hasOwnProperty.call(t,r)||r in t)&&e.push(t[r]);return e.length?e:[]}},"./src/utils/to-string.js":function(t){t.exports=function(t){return t=(t=null===(t=void 0===t?"":t)?"":t).toString()}},
vendor: 957 bytes, line 1903
1903"./node_modules/string-natural-compare/natural-compare.js":function(t){"use strict";var e,r,n=0;function s(t){return t>=48&&t<=57}function i(t,e){for(var i=(t+="").length,a=(e+="").length,o=0,l=0;o<i&&l<a;){var u=t.charCodeAt(o),c=e.charCodeAt(l);if(s(u)){if(!s(c))return u-c;for(var f=o,h=l;48===u&&++f<i;)u=t.charCodeAt(f);for(;48===c&&++h<a;)c=e.charCodeAt(h);for(var d=f,v=h;d<i&&s(t.charCodeAt(d));)++d;for(;v<a&&s(e.charCodeAt(v));)++v;var g=d-f-v+h;if(g)return g;for(;f<d;)if(g=t.charCodeAt(f++)-e.charCodeAt(h++))return g;o=d,l=v}else{if(u!==c)return u<n&&c<n&&-1!==r[u]&&-1!==r[c]?r[u]-r[c]:u-c;++o,++l}}return o>=i&&l<a&&i>=a?-1:l>=a&&o<i&&a>=i?1:i-a}i.caseInsensitive=i.i=function(t,e){return i((""+t).toLowerCase(),(""+e).toLowerCase())},Object.defineProperties(i,{alphabet:{get:function(){return e},set:function(t){r=[];var s=0;if(e=t)for(;s<e.length;s++)r[e.charCodeAt(s)]=s;for(n=r.length,s=0;s<n;s++)void 0===r[s]&&(r[s]=-1)}}}),t.exports=i}
1903},e={};return function r(n){if(e[n])return e[n].exports;var s=e[n]={exports:{}};return t[n](s,s.exports,r),s.exports}("./src/index.js")}(); 1904//# sourceMappingURL=list.min.js.map 1905 1906/*! PhotoSwipe - v4.1.3 - 2019-01-08 1907* http://photoswipe.com 1908* Copyright (c) 2019 Dmitry Semenov; */ 1909!function(a,b){"function"==typeof define&&define.amd?define(b):"object"==typeof exports?module.exports=b():a.PhotoSwipe=b()}(this,function(){"use strict";var a=function(a,b,c,d){var e={features:null,bind:function(a,b,c,d){var e=(d?"remove":"add")+"EventListener";b=b.split(" ");for(var f=0;f<b.length;f++)b[f]&&a[e](b[f],c,!1)},isArray:function(a){return a instanceof Array},createEl:function(a,b){var c=document.createElement(b||"div");return a&&(c.className=a),c},getScrollY:function(){var a=window.pageYOffset;return void 0!==a?a:document.documentElement.scrollTop},unbind:function(a,b,c){e.bind(a,b,c,!0)},removeClass:function(a,b){var c=new RegExp("(\\s|^)"+b+"(\\s|$)");a.className=a.className.replace(c," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")},addClass:function(a,b){e.hasClass(a,b)||(a.className+=(a.className?" ":"")+b)},hasClass:function(a,b){return a.className&&new RegExp("(^|\\s)"+b+"(\\s|$)").test(a.className)},getChildByClass:function(a,b){for(var c=a.firstChild;c;){if(e.hasClass(c,b))return c;c=c.nextSibling}},arraySearch:function(a,b,c){for(var d=a.length;d--;)if(a[d][c]===b)return d;return-1},extend:function(a,b,c){for(var d in b)if(b.hasOwnProperty(d)){if(c&&a.hasOwnProperty(d))continue;a[d]=b[d]}},easing:{sine:{out:function(a){return Math.sin(a*(Math.PI/2))},inOut:function(a){return-(Math.cos(Math.PI*a)-1)/2}},cubic:{out:function(a){return--a*a*a+1}}},detectFeatures:function(){if(e.features)return e.features;var a=e.createEl(),b=a.style,c="",d={};if(d.oldIE=document.all&&!document.addEventListener,d.touch="ontouchstart"in window,window.requestAnimationFrame&&(d.raf=window.requestAnimationFrame,d.caf=window.cancelAnimationFrame),d.pointerEvent=!!window.PointerEvent||navigator.msPointerEnabled,!d.pointerEvent){var f=navigator.userAgent;if(/iP(hone|od)/.test(navigator.platform)){var g=navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/);g&&g.length>0&&(g=parseInt(g[1],10),g>=1&&g<8&&(d.isOldIOSPhone=!0))}var h=f.match(/Android\s([0-9\.]*)/),i=h?h[1]:0;i=parseFloat(i),i>=1&&(i<4.4&&(d.isOldAndroid=!0),d.androidVersion=i),d.isMobileOpera=/opera mini|o
1909pera mobi/i.test(f)}for(var j,k,l=["transform","perspective","animationName"],m=["","webkit","Moz","ms","O"],n=0;n<4;n++){c=m[n];for(var o=0;o<3;o++)j=l[o],k=c+(c?j.charAt(0).toUpperCase()+j.slice(1):j),!d[j]&&k in b&&(d[j]=k);c&&!d.raf&&(c=c.toLowerCase(),d.raf=window[c+"RequestAnimationFrame"],d.raf&&(d.caf=window[c+"CancelAnimationFrame"]||window[c+"CancelRequestAnimationFrame"]))}if(!d.raf){var p=0;d.raf=function(a){var b=(new Date).getTime(),c=Math.max(0,16-(b-p)),d=window.setTimeout(function(){a(b+c)},c);return p=b+c,d},d.caf=function(a){clearTimeout(a)}}return d.svg=!!document.createElementNS&&!!document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGRect,e.features=d,d}};e.detectFeatures(),e.features.oldIE&&(e.bind=function(a,b,c,d){b=b.split(" ");for(var e,f=(d?"detach":"attach")+"Event",g=function(){c.handleEvent.call(c)},h=0;h<b.length;h++)if(e=b[h])if("object"==typeof c&&c.handleEvent){if(d){if(!c["oldIE"+e])return!1}else c["oldIE"+e]=g;a[f]("on"+e,c["oldIE"+e])}else a[f]("on"+e,c)});var f=this,g=25,h=3,i={allowPanToNext:!0,spacing:.12,bgOpacity:1,mouseUsed:!1,loop:!0,pinchToClose:!0,closeOnScroll:!0,closeOnVerticalDrag:!0,verticalDragRange:.75,hideAnimationDuration:333,showAnimationDuration:333,showHideOpacity:!1,focus:!0,escKey:!0,arrowKeys:!0,mainScrollEndFriction:.35,panEndFriction:.35,isClickableElement:function(a){return"A"===a.tagName},getDoubleTapZoom:function(a,b){return a?1:b.initialZoomLevel<.7?1:1.33},maxSpreadZoom:1.33,modal:!0,scaleMode:"fit"};e.extend(i,d);var j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,$,_,aa,ba,ca,da,ea,fa,ga,ha,ia,ja,ka,la,ma=function(){return{x:0,y:0}},na=ma(),oa=ma(),pa=ma(),qa={},ra=0,sa={},ta=ma(),ua=0,va=!0,wa=[],xa={},ya=!1,za=function(a,b){e.extend(f,b.publicMethods),wa.push(a)},Aa=function(a){var b=ac();return a>b-1?a-b:a<0?b+a:a},Ba={},Ca=function(a,b){return Ba[a]||(Ba[a]=[]),Ba[a].push(b)},Da=function(a){var b=Ba[a];if(b){var c=Array.prototype.slice.call(arguments);c.shift();for(var d=0;d<b.length;d++)b[d].apply(f,c)}},Ea=function(){return(new Date).getTime()},Fa=function(a){ja=a,f.bg.style.opacity=a*i.bgOpacity},Ga=function(a,b,c,d,e){(!ya||e&&e!==f.currItem)&&(d/=e?e.fitRatio:f.currItem.fitRatio),a[E]=u+b+"px, "+c+"px"+v+" scale("+d+")"},Ha=function(a){ea&&(a&&(s>f.currItem.fitRatio?ya||(mc(f.currItem,!1,!0),ya=!0):ya&&(mc(f.currItem),ya=!1)),Ga(ea,pa.x,pa.y,s))},Ia=function(a){a.container&&Ga(a.container.style,a.initialPosition.x,a.initialPosition.y,a.initialZoomLevel,a)},Ja=function(a,b){b[E]=u+a+"px, 0px"+v},Ka=function(a,b){if(!i.loop&&b){var c=m+(ta.x*ra-a)/ta.x,d=Math.round(a-tb.x);(c<0&&d>0||c>=ac()-1&&d<0)&&(a=tb.x+d*i.mainScrollEndFriction)}tb.x=a,Ja(a,n)},La=function(a,b){var c=ub[a]-sa[a];return oa[a]+na[a]+c-c*(b/t)},Ma=function(a,b){a.x=b.x,a.y=b.y,b.id&&(a.id=b.id)},Na=function(a){a.x=Math.round(a.x),a.y=Math.round(a.y)},Oa=null,Pa=function(){Oa&&(e.unbind(document,"mousemove",Pa),e.addClass(a,"pswp--has_mouse"),i.mouseUsed=!0,Da("mouseUsed")),Oa=setTimeout(function(){Oa=null},100)},Qa=function(){e.bind(document,"keydown",f),N.transform&&e.bind(f.scrollWrap,"click",f),i.mouseUsed||e.bind(document,"mousemove",Pa),e.bind(window,"resize scroll orientationchange",f),Da("bindEvents")},Ra=function(){e.unbind(window,"resize scroll orientationchange",f),e.unbind(window,"scroll",r.scroll),e.unbind(document,"keydown",f),e.unbind(document,"mousemove",Pa),N.transform&&e.unbind(f.scrollWrap,"click",f),V&&e.unbind(window,p,f),clearTimeout(O),Da("unbindEvents")},Sa=function(a,b){var c=ic(f.currItem,qa,a);return b&&(da=c),c},Ta=function(a){return a||(a=f.currItem),a.initialZoomLevel},Ua=function(a){return a||(a=f.currItem),a.w>0?i.maxSpreadZoom:1},Va=function(a,b,c,d){return d===f.currItem.initialZoomLevel?(c[a]=f.currItem.initialPosition[a],!0):(c[a]=La(a,d),c[a]>b.min[a]?(c[a]=b.min[a],!0):c[a]<b.max[a]&&(c[a]=b.max[a],!0))},Wa=function(){if(E){var b=N.perspective&&!G;return u="translate"+(b?"3d(":"("),void(v=N.perspective?", 0px)":")")}E="left",e.addClass(a,"pswp--ie"),Ja=function(a,b){b.left=a+"px"},Ia=function(a){var b=a.fitRatio>1?1:a.fitRatio,c=a.container.style,d=b*a.w,e=b*a.h;c.width=d+"px",c.height=e+"px",c.left=a.initialPosition.x+"px",c.top=a.initialPosition.y+"px"},Ha=function(){if(ea){var a=ea,b=f.currItem,c=b.fitRatio>1?1:b.fitRatio,d=c*b.w,e=c*b.h;a.width=d+"px",a.height=e+"px",a.left=pa.x+"px",a.top=pa.y+"px"}}},Xa=function(a){var b="";i.escKey&&27===a.keyCode?b="close":i.arrowKeys&&(37===a.keyCode?b="prev":39===a.keyCode&&(b="next")),b&&(a.ctrlKey||a.altKey||a.shiftKey||a.metaKey||(a.preventDefault?a.preventDefault():a.returnValue=!1,f[b]()))},Ya=function(a){a&&(Y||X||fa||T)&&(a.preventDefault(),a.stopPropagation())},Za=function(){f.setScrollOffset(0,e.getScrollY())},$a={},_a=0,ab=function(a){$a[a]&&($a[a].raf&&I($a[a].raf),_a--,delete $a[a])},bb=function(a){$a[a]&&ab(a),$a[a]||(_a++,$a[a]={})},cb=function(){for(var a in $a)$a.hasOwnProperty(a)&&ab(a)},db=function(a,b,c,d,e,f,g){var h,i=Ea();
1909bb(a);var j=function(){if($a[a]){if(h=Ea()-i,h>=d)return ab(a),f(c),void(g&&g());f((c-b)*e(h/d)+b),$a[a].raf=H(j)}};j()},eb={shout:Da,listen:Ca,viewportSize:qa,options:i,isMainScrollAnimating:function(){return fa},getZoomLevel:function(){return s},getCurrentIndex:function(){return m},isDragging:function(){return V},isZooming:function(){return aa},setScrollOffset:function(a,b){sa.x=a,M=sa.y=b,Da("updateScrollOffset",sa)},applyZoomPan:function(a,b,c,d){pa.x=b,pa.y=c,s=a,Ha(d)},init:function(){if(!j&&!k){var c;f.framework=e,f.template=a,f.bg=e.getChildByClass(a,"pswp__bg"),J=a.className,j=!0,N=e.detectFeatures(),H=N.raf,I=N.caf,E=N.transform,L=N.oldIE,f.scrollWrap=e.getChildByClass(a,"pswp__scroll-wrap"),f.container=e.getChildByClass(f.scrollWrap,"pswp__container"),n=f.container.style,f.itemHolders=y=[{el:f.container.children[0],wrap:0,index:-1},{el:f.container.children[1],wrap:0,index:-1},{el:f.container.children[2],wrap:0,index:-1}],y[0].el.style.display=y[2].el.style.display="none",Wa(),r={resize:f.updateSize,orientationchange:function(){clearTimeout(O),O=setTimeout(function(){qa.x!==f.scrollWrap.clientWidth&&f.updateSize()},500)},scroll:Za,keydown:Xa,click:Ya};var d=N.isOldIOSPhone||N.isOldAndroid||N.isMobileOpera;for(N.animationName&&N.transform&&!d||(i.showAnimationDuration=i.hideAnimationDuration=0),c=0;c<wa.length;c++)f["init"+wa[c]]();if(b){var g=f.ui=new b(f,e);g.init()}Da("firstUpdate"),m=m||i.index||0,(isNaN(m)||m<0||m>=ac())&&(m=0),f.currItem=_b(m),(N.isOldIOSPhone||N.isOldAndroid)&&(va=!1),a.setAttribute("aria-hidden","false"),i.modal&&(va?a.style.position="fixed":(a.style.position="absolute",a.style.top=e.getScrollY()+"px")),void 0===M&&(Da("initialLayout"),M=K=e.getScrollY());var l="pswp--open ";for(i.mainClass&&(l+=i.mainClass+" "),i.showHideOpacity&&(l+="pswp--animate_opacity "),l+=G?"pswp--touch":"pswp--notouch",l+=N.animationName?" pswp--css_animation":"",l+=N.svg?" pswp--svg":"",e.addClass(a,l),f.updateSize(),o=-1,ua=null,c=0;c<h;c++)Ja((c+o)*ta.x,y[c].el.style);L||e.bind(f.scrollWrap,q,f),Ca("initialZoomInEnd",function(){f.setContent(y[0],m-1),f.setContent(y[2],m+1),y[0].el.style.display=y[2].el.style.display="block",i.focus&&a.focus(),Qa()}),f.setContent(y[1],m),f.updateCurrItem(),Da("afterInit"),va||(w=setInterval(function(){_a||V||aa||s!==f.currItem.initialZoomLevel||f.updateSize()},1e3)),e.addClass(a,"pswp--visible")}},close:function(){j&&(j=!1,k=!0,Da("close"),Ra(),cc(f.currItem,null,!0,f.destroy))},destroy:function(){Da("destroy"),Xb&&clearTimeout(Xb),a.setAttribute("aria-hidden","true"),a.className=J,w&&clearInterval(w),e.unbind(f.scrollWrap,q,f),e.unbind(window,"scroll",f),zb(),cb(),Ba=null},panTo:function(a,b,c){c||(a>da.min.x?a=da.min.x:a<da.max.x&&(a=da.max.x),b>da.min.y?b=da.min.y:b<da.max.y&&(b=da.max.y)),pa.x=a,pa.y=b,Ha()},handleEvent:function(a){a=a||window.event,r[a.type]&&r[a.type](a)},goTo:function(a){a=Aa(a);var b=a-m;ua=b,m=a,f.currItem=_b(m),ra-=b,Ka(ta.x*ra),cb(),fa=!1,f.updateCurrItem()},next:function(){f.goTo(m+1)},prev:function(){f.goTo(m-1)},updateCurrZoomItem:function(a){if(a&&Da("beforeChange",0),y[1].el.children.length){var b=y[1].el.children[0];ea=e.hasClass(b,"pswp__zoom-wrap")?b.style:null}else ea=null;da=f.currItem.bounds,t=s=f.currItem.initialZoomLevel,pa.x=da.center.x,pa.y=da.center.y,a&&Da("afterChange")},invalidateCurrItems:function(){x=!0;for(var a=0;a<h;a++)y[a].item&&(y[a].item.needsUpdate=!0)},updateCurrItem:function(a){if(0!==ua){var b,c=Math.abs(ua);if(!(a&&c<2)){f.currItem=_b(m),ya=!1,Da("beforeChange",ua),c>=h&&(o+=ua+(ua>0?-h:h),c=h);for(var d=0;d<c;d++)ua>0?(b=y.shift(),y[h-1]=b,o++,Ja((o+2)*ta.x,b.el.style),f.setContent(b,m-c+d+1+1)):(b=y.pop(),y.unshift(b),o--,Ja(o*ta.x,b.el.style),f.setContent(b,m+c-d-1-1));if(ea&&1===Math.abs(ua)){var e=_b(z);e.initialZoomLevel!==s&&(ic(e,qa),mc(e),Ia(e))}ua=0,f.updateCurrZoomItem(),z=m,Da("afterChange")}}},updateSize:function(b){if(!va&&i.modal){var c=e.getScrollY();if(M!==c&&(a.style.top=c+"px",M=c),!b&&xa.x===window.innerWidth&&xa.y===window.innerHeight)return;xa.x=window.innerWidth,xa.y=window.innerHeight,a.style.height=xa.y+"px"}if(qa.x=f.scrollWrap.clientWidth,qa.y=f.scrollWrap.clientHeight,Za(),ta.x=qa.x+Math.round(qa.x*i.spacing),ta.y=qa.y,Ka(ta.x*ra),Da("beforeResize"),void 0!==o){for(var d,g,j,k=0;k<h;k++)d=y[k],Ja((k+o)*ta.x,d.el.style),j=m+k-1,i.loop&&ac()>2&&(j=Aa(j)),g=_b(j),g&&(x||g.needsUpdate||!g.bounds)?(f.cleanSlide(g),f.setContent(d,j),1===k&&(f.currItem=g,f.updateCurrZoomItem(!0)),g.needsUpdate=!1):d.index===-1&&j>=0&&f.setContent(d,j),g&&g.container&&(ic(g,qa),mc(g),Ia(g));x=!1}
1909t=s=f.currItem.initialZoomLevel,da=f.currItem.bounds,da&&(pa.x=da.center.x,pa.y=da.center.y,Ha(!0)),Da("resize")},zoomTo:function(a,b,c,d,f){b&&(t=s,ub.x=Math.abs(b.x)-pa.x,ub.y=Math.abs(b.y)-pa.y,Ma(oa,pa));var g=Sa(a,!1),h={};Va("x",g,h,a),Va("y",g,h,a);var i=s,j={x:pa.x,y:pa.y};Na(h);var k=function(b){1===b?(s=a,pa.x=h.x,pa.y=h.y):(s=(a-i)*b+i,pa.x=(h.x-j.x)*b+j.x,pa.y=(h.y-j.y)*b+j.y),f&&f(b),Ha(1===b)};c?db("customZoomTo",0,1,c,d||e.easing.sine.inOut,k):k(1)}},fb=30,gb=10,hb={},ib={},jb={},kb={},lb={},mb=[],nb={},ob=[],pb={},qb=0,rb=ma(),sb=0,tb=ma(),ub=ma(),vb=ma(),wb=function(a,b){return a.x===b.x&&a.y===b.y},xb=function(a,b){return Math.abs(a.x-b.x)<g&&Math.abs(a.y-b.y)<g},yb=function(a,b){return pb.x=Math.abs(a.x-b.x),pb.y=Math.abs(a.y-b.y),Math.sqrt(pb.x*pb.x+pb.y*pb.y)},zb=function(){Z&&(I(Z),Z=null)},Ab=function(){V&&(Z=H(Ab),Qb())},Bb=function(){return!("fit"===i.scaleMode&&s===f.currItem.initialZoomLevel)},Cb=function(a,b){return!(!a||a===document)&&(!(a.getAttribute("class")&&a.getAttribute("class").indexOf("pswp__scroll-wrap")>-1)&&(b(a)?a:Cb(a.parentNode,b)))},Db={},Eb=function(a,b){return Db.prevent=!Cb(a.target,i.isClickableElement),Da("preventDragEvent",a,b,Db),Db.prevent},Fb=function(a,b){return b.x=a.pageX,b.y=a.pageY,b.id=a.identifier,b},Gb=function(a,b,c){c.x=.5*(a.x+b.x),c.y=.5*(a.y+b.y)},Hb=function(a,b,c){if(a-Q>50){var d=ob.length>2?ob.shift():{};d.x=b,d.y=c,ob.push(d),Q=a}},Ib=function(){var a=pa.y-f.currItem.initialPosition.y;return 1-Math.abs(a/(qa.y/2))},Jb={},Kb={},Lb=[],Mb=function(a){for(;Lb.length>0;)Lb.pop();return F?(la=0,mb.forEach(function(a){0===la?Lb[0]=a:1===la&&(Lb[1]=a),la++})):a.type.indexOf("touch")>-1?a.touches&&a.touches.length>0&&(Lb[0]=Fb(a.touches[0],Jb),a.touches.length>1&&(Lb[1]=Fb(a.touches[1],Kb))):(Jb.x=a.pageX,Jb.y=a.pageY,Jb.id="",Lb[0]=Jb),Lb},Nb=function(a,b){var c,d,e,g,h=0,j=pa[a]+b[a],k=b[a]>0,l=tb.x+b.x,m=tb.x-nb.x;return c=j>da.min[a]||j<da.max[a]?i.panEndFriction:1,j=pa[a]+b[a]*c,!i.allowPanToNext&&s!==f.currItem.initialZoomLevel||(ea?"h"!==ga||"x"!==a||X||(k?(j>da.min[a]&&(c=i.panEndFriction,h=da.min[a]-j,d=da.min[a]-oa[a]),(d<=0||m<0)&&ac()>1?(g=l,m<0&&l>nb.x&&(g=nb.x)):da.min.x!==da.max.x&&(e=j)):(j<da.max[a]&&(c=i.panEndFriction,h=j-da.max[a],d=oa[a]-da.max[a]),(d<=0||m>0)&&ac()>1?(g=l,m>0&&l<nb.x&&(g=nb.x)):da.min.x!==da.max.x&&(e=j))):g=l,"x"!==a)?void(fa||$||s>f.currItem.fitRatio&&(pa[a]+=b[a]*c)):(void 0!==g&&(Ka(g,!0),$=g!==nb.x),da.min.x!==da.max.x&&(void 0!==e?pa.x=e:$||(pa.x+=b.x*c)),void 0!==g)},Ob=function(a){if(!("mousedown"===a.type&&a.button>0)){if($b)return void a.preventDefault();if(!U||"mousedown"!==a.type){if(Eb(a,!0)&&a.preventDefault(),Da("pointerDown"),F){var b=e.arraySearch(mb,a.pointerId,"id");b<0&&(b=mb.length),mb[b]={x:a.pageX,y:a.pageY,id:a.pointerId}}var c=Mb(a),d=c.length;_=null,cb(),V&&1!==d||(V=ha=!0,e.bind(window,p,f),S=ka=ia=T=$=Y=W=X=!1,ga=null,Da("firstTouchStart",c),Ma(oa,pa),na.x=na.y=0,Ma(kb,c[0]),Ma(lb,kb),nb.x=ta.x*ra,ob=[{x:kb.x,y:kb.y}],Q=P=Ea(),Sa(s,!0),zb(),Ab()),!aa&&d>1&&!fa&&!$&&(t=s,X=!1,aa=W=!0,na.y=na.x=0,Ma(oa,pa),Ma(hb,c[0]),Ma(ib,c[1]),Gb(hb,ib,vb),ub.x=Math.abs(vb.x)-pa.x,ub.y=Math.abs(vb.y)-pa.y,ba=ca=yb(hb,ib))}}},Pb=function(a){if(a.preventDefault(),F){var b=e.arraySearch(mb,a.pointerId,"id");if(b>-1){var c=mb[b];c.x=a.pageX,c.y=a.pageY}}if(V){var d=Mb(a);if(ga||Y||aa)_=d;else if(tb.x!==ta.x*ra)ga="h";else{var f=Math.abs(d[0].x-kb.x)-Math.abs(d[0].y-kb.y);Math.abs(f)>=gb&&(ga=f>0?"h":"v",_=d)}}},Qb=function(){if(_){var a=_.length;if(0!==a)if(Ma(hb,_[0]),jb.x=hb.x-kb.x,jb.y=hb.y-kb.y,aa&&a>1){if(kb.x=hb.x,kb.y=hb.y,!jb.x&&!jb.y&&wb(_[1],ib))return;Ma(ib,_[1]),X||(X=!0,Da("zoomGestureStarted"));var b=yb(hb,ib),c=Vb(b);c>f.currItem.initialZoomLevel+f.currItem.initialZoomLevel/15&&(ka=!0);var d=1,e=Ta(),g=Ua();if(c<e)if(i.pinchToClose&&!ka&&t<=f.currItem.initialZoomLevel){var h=e-c,j=1-h/(e/1.2);Fa(j),Da("onPinchClose",j),ia=!0}else d=(e-c)/e,d>1&&(d=1),c=e-d*(e/3);else c>g&&(d=(c-g)/(6*e),d>1&&(d=1),c=g+d*e);d<0&&(d=0),ba=b,Gb(hb,ib,rb),na.x+=rb.x-vb.x,na.y+=rb.y-vb.y,Ma(vb,rb),pa.x=La("x",c),pa.y=La("y",c),S=c>s,s=c,Ha()}else{if(!ga)return;if(ha&&(ha=!1,Math.abs(jb.x)>=gb&&(jb.x-=_[0].x-lb.x),Math.abs(jb.y)>=gb&&(jb.y-=_[0].y-lb.y)),kb.x=hb.x,kb.y=hb.y,0===jb.x&&0===jb.y)return;if("v"===ga&&i.closeOnVerticalDrag&&!Bb()){na.y+=jb.y,pa.y+=jb.y;var k=Ib();return T=!0,Da("onVerticalDrag",k),Fa(k),void Ha()}Hb(Ea(),hb.x,hb.y),Y=!0,da=f.currItem.bounds;var l=Nb("x",jb);l||(Nb("y",jb),Na(pa),Ha())}}}
1909,Rb=function(a){if(N.isOldAndroid){if(U&&"mouseup"===a.type)return;a.type.indexOf("touch")>-1&&(clearTimeout(U),U=setTimeout(function(){U=0},600))}Da("pointerUp"),Eb(a,!1)&&a.preventDefault();var b;if(F){var c=e.arraySearch(mb,a.pointerId,"id");if(c>-1)if(b=mb.splice(c,1)[0],navigator.msPointerEnabled){var d={4:"mouse",2:"touch",3:"pen"};b.type=d[a.pointerType],b.type||(b.type=a.pointerType||"mouse")}else b.type=a.pointerType||"mouse"}var g,h=Mb(a),j=h.length;if("mouseup"===a.type&&(j=0),2===j)return _=null,!0;1===j&&Ma(lb,h[0]),0!==j||ga||fa||(b||("mouseup"===a.type?b={x:a.pageX,y:a.pageY,type:"mouse"}:a.changedTouches&&a.changedTouches[0]&&(b={x:a.changedTouches[0].pageX,y:a.changedTouches[0].pageY,type:"touch"})),Da("touchRelease",a,b));var k=-1;if(0===j&&(V=!1,e.unbind(window,p,f),zb(),aa?k=0:sb!==-1&&(k=Ea()-sb)),sb=1===j?Ea():-1,g=k!==-1&&k<150?"zoom":"swipe",aa&&j<2&&(aa=!1,1===j&&(g="zoomPointerUp"),Da("zoomGestureEnded")),_=null,Y||X||fa||T)if(cb(),R||(R=Sb()),R.calculateSwipeSpeed("x"),T){var l=Ib();if(l<i.verticalDragRange)f.close();else{var m=pa.y,n=ja;db("verticalDrag",0,1,300,e.easing.cubic.out,function(a){pa.y=(f.currItem.initialPosition.y-m)*a+m,Fa((1-n)*a+n),Ha()}),Da("onVerticalDrag",1)}}else{if(($||fa)&&0===j){var o=Ub(g,R);if(o)return;g="zoomPointerUp"}if(!fa)return"swipe"!==g?void Wb():void(!$&&s>f.currItem.fitRatio&&Tb(R))}},Sb=function(){var a,b,c={lastFlickOffset:{},lastFlickDist:{},lastFlickSpeed:{},slowDownRatio:{},slowDownRatioReverse:{},speedDecelerationRatio:{},speedDecelerationRatioAbs:{},distanceOffset:{},backAnimDestination:{},backAnimStarted:{},calculateSwipeSpeed:function(d){ob.length>1?(a=Ea()-Q+50,b=ob[ob.length-2][d]):(a=Ea()-P,b=lb[d]),c.lastFlickOffset[d]=kb[d]-b,c.lastFlickDist[d]=Math.abs(c.lastFlickOffset[d]),c.lastFlickDist[d]>20?c.lastFlickSpeed[d]=c.lastFlickOffset[d]/a:c.lastFlickSpeed[d]=0,Math.abs(c.lastFlickSpeed[d])<.1&&(c.lastFlickSpeed[d]=0),c.slowDownRatio[d]=.95,c.slowDownRatioReverse[d]=1-c.slowDownRatio[d],c.speedDecelerationRatio[d]=1},calculateOverBoundsAnimOffset:function(a,b){c.backAnimStarted[a]||(pa[a]>da.min[a]?c.backAnimDestination[a]=da.min[a]:pa[a]<da.max[a]&&(c.backA
1909nimDestination[a]=da.max[a]),void 0!==c.backAnimDestination[a]&&(c.slowDownRatio[a]=.7,c.slowDownRatioReverse[a]=1-c.slowDownRatio[a],c.speedDecelerationRatioAbs[a]<.05&&(c.lastFlickSpeed[a]=0,c.backAnimStarted[a]=!0,db("bounceZoomPan"+a,pa[a],c.backAnimDestination[a],b||300,e.easing.sine.out,function(b){pa[a]=b,Ha()}))))},calculateAnimOffset:function(a){c.backAnimStarted[a]||(c.speedDecelerationRatio[a]=c.speedDecelerationRatio[a]*(c.slowDownRatio[a]+c.slowDownRatioReverse[a]-c.slowDownRatioReverse[a]*c.timeDiff/10),c.speedDecelerationRatioAbs[a]=Math.abs(c.lastFlickSpeed[a]*c.speedDecelerationRatio[a]),c.distanceOffset[a]=c.lastFlickSpeed[a]*c.speedDecelerationRatio[a]*c.timeDiff,pa[a]+=c.distanceOffset[a])},panAnimLoop:function(){if($a.zoomPan&&($a.zoomPan.raf=H(c.panAnimLoop),c.now=Ea(),c.timeDiff=c.now-c.lastNow,c.lastNow=c.now,c.calculateAnimOffset("x"),c.calculateAnimOffset("y"),Ha(),c.calculateOverBoundsAnimOffset("x"),c.calculateOverBoundsAnimOffset("y"),c.speedDecelerationRatioAbs.x<.05&&c.speedDecelerationRatioAbs.y<.05))return pa.x=Math.round(pa.x),pa.y=Math.round(pa.y),Ha(),void ab("zoomPan")}};return c},Tb=function(a){return a.calculateSwipeSpeed("y"),da=f.currItem.bounds,a.backAnimDestination={},a.backAnimStarted={},Math.abs(a.lastFlickSpeed.x)<=.05&&Math.abs(a.lastFlickSpeed.y)<=.05?(a.speedDecelerationRatioAbs.x=a.speedDecelerationRatioAbs.y=0,a.calculateOverBoundsAnimOffset("x"),a.calculateOverBoundsAnimOffset("y"),!0):(bb("zoomPan"),a.lastNow=Ea(),void a.panAnimLoop())},Ub=function(a,b){var c;fa||(qb=m);var d;if("swipe"===a){var g=kb.x-lb.x,h=b.lastFlickDist.x<10;g>fb&&(h||b.lastFlickOffset.x>20)?d=-1:g<-fb&&(h||b.lastFlickOffset.x<-20)&&(d=1)}var j;d&&(m+=d,m<0?(m=i.loop?ac()-1:0,j=!0):m>=ac()&&(m=i.loop?0:ac()-1,j=!0),j&&!i.loop||(ua+=d,ra-=d,c=!0));var k,l=ta.x*ra,n=Math.abs(l-tb.x);return c||l>tb.x==b.lastFlickSpeed.x>0?(k=Math.abs(b.lastFlickSpeed.x)>0?n/Math.abs(b.lastFlickSpeed.x):333,k=Math.min(k,400),k=Math.max(k,250)):k=333,qb===m&&(c=!1),fa=!0,Da("mainScrollAnimStart"),db("mainScroll",tb.x,l,k,e.easing.cubic.out,Ka,function(){cb(),fa=!1,qb=-1,(c||qb!==m)&&f.updateCurrItem(),Da("mainScrollAnimComplete")}),c&&f.updateCurrItem(!0),c},Vb=function(a){return 1/ca*a*t},Wb=function(){var a=s,b=Ta(),c=Ua();s<b?a=b:s>c&&(a=c);var d,g=1,h=ja;return ia&&!S&&!ka&&s<b?(f.close(),!0):(ia&&(d=function(a){Fa((g-h)*a+h)}),f.zoomTo(a,0,200,e.easing.cubic.out,d),!0)};za("Gestures",{publicMethods:{initGestures:function(){var a=function(a,b,c,d,e){A=a+b,B=a+c,C=a+d,D=e?a+e:""};F=N.pointerEvent,F&&N.touch&&(N.touch=!1),F?navigator.msPointerEnabled?a("MSPointer","Down","Move","Up","Cancel"):a("pointer","down","move","up","cancel"):N.touch?(a("touch","start","move","end","cancel"),G=!0):a("mouse","down","move","up"),p=B+" "+C+" "+D,q=A,F&&!G&&(G=navigator.maxTouchPoints>1||navigator.msMaxTouchPoints>1),f.likelyTouchDevice=G,r[A]=Ob,r[B]=Pb,r[C]=Rb,D&&(r[D]=r[C]),N.touch&&(q+=" mousedown",p+=" mousemove mouseup",r.mousedown=r[A],r.mousemove=r[B],r.mouseup=r[C]),G||(i.allowPanToNext=!1)}}});var Xb,Yb,Zb,$b,_b,ac,bc,cc=function(b,c,d,g){Xb&&clearTimeout(Xb),$b=!0,Zb=!0;var h;b.initialLayout?(h=b.initialLayout,b.initialLayout=null):h=i.getThumbBoundsFn&&i.getThumbBoundsFn(m);var j=d?i.hideAnimationDuration:i.showAnimationDuration,k=function(){ab("initialZoom"),d?(f.template.removeAttribute("style"),f.bg.removeAttribute("style")):(Fa(1),c&&(c.style.display="block"),e.addClass(a,"pswp--animated-in"),Da("initialZoom"+(d?"OutEnd":"InEnd"))),g&&g(),$b=!1};if(!j||!h||void 0===h.x)return Da("initialZoom"+(d?"Out":"In")),s=b.initialZoomLevel,Ma(pa,b.initialPosition),Ha(),a.style.opacity=d?0:1,Fa(1),void(j?setTimeout(function(){k()},j):k());var n=function(){var c=l,g=!f.currItem.src||f.currItem.loadError||i.showHideOpacity;b.miniImg&&(b.miniImg.style.webkitBackfaceVisibility="hidden"),d||(s=h.w/b.w,pa.x=h.x,pa.y=h.y-K,f[g?"template":"bg"].style.opacity=.001,Ha()),bb("initialZoom"),d&&!c&&e.removeClass(a,"pswp--animated-in"),g&&(d?e[(c?"remove":"add")+"Class"](a,"pswp--animate_opacity"):setTimeout(function(){e.addClass(a,"pswp--animate_opacity")},30)),Xb=setTimeout(function(){if(Da("initialZoom"+(d?"Out":"In")),d){var f=h.w/b.w,i={x:pa.x,y:pa.y},l=s,m=ja,n=function(b){1===b?(s=f,pa.x=h.x,pa.y=h.y-M):(s=(f-l)*b+l,pa.x=(h.x-i.x)*b+i.x,pa.y=(h.y-M-i.y)*b+i.y),Ha(),g?a.style.opacity=1-b:Fa(m-b*m)};c?db("initialZoom",0,1,j,e.easing.cubic.out,n,k):(n(1),Xb=setTimeout(k,j+20))}else s=b.initialZoomLevel,Ma(pa,b.initialPosition),Ha(),Fa(1),g?a.style.opacity=1:Fa(1),Xb=setTimeout(k,j+20)},d?25:90)};n()},dc={},ec=[],fc={index:0,errorMsg:'<div class="pswp__error-msg"><a href="%url%" target="_blank">The image</a> could not be loaded.</div>',forceProgressiveLoading:!1,preload:[1,1],getNumItemsFn:function(){return Yb.length}},gc=function(){return{center:{x:0,y:0},max:{x:0,y:0},min:{x:0,y:0}}},hc=function(a,b,c){var d=a.bounds;d.center.x=Math.round((dc.x-b)/2),d.center.y=Math.round((dc.y-c)/2)+a.vGap.top,d.max.x=b>dc.x?Math.round(dc.x-b):d.center.x,d.max.y=c>dc.y?Math.round(dc.y-c)+a.vGap.top:d.center.y,d.min.x=b>dc.x?0:d.center.x,d.min.y=c>dc.y?a.vGap.top:d.center.y},ic=function(a,b,c){if(a.src&&!a.loadError){var d=!c;if(d&&(a.vGap||(a.vGap={top:0,bottom:0}),Da("parseVerticalMargin",a)),dc.x=b.x,dc.y=b.y-a.vGap.top-a.vGap.bottom,d){var e=dc.x/a.w,f=dc.y/a.h;a.fitRatio=e<f?e:f;var g=i.scaleMode;"orig"===g?c=1:"fit"===g&&(c=a.fitRatio),c>1&&(c=1),a.initialZoomLevel=c,a.bounds||(a.bounds=gc())}if(!c)return;return hc(a,a.w*c,a.h*c),d&&c===a.initialZoomLevel&&(a.initialPosition=a.bounds.center),a.bounds}return a.w=a.h=0,a.initialZoomLevel=a.fitRatio=1,a.bounds=gc(),a.initialPosition=a.bounds.center,a.bounds},jc=function(a,b,c,d,e,g){b.loadError||d&&(b.imageAppended=!0,mc(b,d,b===f.currItem&&ya),c.appendChild(d),g&&setTimeout(function(){b&&b.loaded&&b.placeholder&&(b.placeholder.style.display="none",b.placeholder=null)},500))},kc=function(a){a.loading=!0,a.loaded=!1;var b=a.img=e.createEl("pswp__img","img"),c=function(){a.loading=!1,a.loaded=!0,a.loadComplete?a.loadComplete(a):a.img=null,b.onload=b.onerror=null,b=null};
1909return b.onload=c,b.onerror=function(){a.loadError=!0,c()},b.src=a.src,b},lc=function(a,b){if(a.src&&a.loadError&&a.container)return b&&(a.container.innerHTML=""),a.container.innerHTML=i.errorMsg.replace("%url%",a.src),!0},mc=function(a,b,c){if(a.src){b||(b=a.container.lastChild);var d=c?a.w:Math.round(a.w*a.fitRatio),e=c?a.h:Math.round(a.h*a.fitRatio);a.placeholder&&!a.loaded&&(a.placeholder.style.width=d+"px",a.placeholder.style.height=e+"px"),b.style.width=d+"px",b.style.height=e+"px"}},nc=function(){if(ec.length){for(var a,b=0;b<ec.length;b++)a=ec[b],a.holder.index===a.index&&jc(a.index,a.item,a.baseDiv,a.img,!1,a.clearPlaceholder);ec=[]}};za("Controller",{publicMethods:{lazyLoadItem:function(a){a=Aa(a);var b=_b(a);b&&(!b.loaded&&!b.loading||x)&&(Da("gettingData",a,b),b.src&&kc(b))},initController:function(){e.extend(i,fc,!0),f.items=Yb=c,_b=f.getItemAt,ac=i.getNumItemsFn,bc=i.loop,ac()<3&&(i.loop=!1),Ca("beforeChange",function(a){var b,c=i.preload,d=null===a||a>=0,e=Math.min(c[0],ac()),g=Math.min(c[1],ac());for(b=1;b<=(d?g:e);b++)f.lazyLoadItem(m+b);for(b=1;b<=(d?e:g);b++)f.lazyLoadItem(m-b)}),Ca("initialLayout",function(){f.currItem.initialLayout=i.getThumbBoundsFn&&i.getThumbBoundsFn(m)}),Ca("mainScrollAnimComplete",nc),Ca("initialZoomInEnd",nc),Ca("destroy",function(){for(var a,b=0;b<Yb.length;b++)a=Yb[b],a.container&&(a.container=null),a.placeholder&&(a.placeholder=null),a.img&&(a.img=null),a.preloader&&(a.preloader=null),a.loadError&&(a.loaded=a.loadError=!1);ec=null})},getItemAt:function(a){return a>=0&&(void 0!==Yb[a]&&Yb[a])},allowProgressiveImg:function(){return i.forceProgressiveLoading||!G||i.mouseUsed||screen.width>1200},setContent:function(a,b){i.loop&&(b=Aa(b));var c=f.getItemAt(a.index);c&&(c.container=null);var d,g=f.getItemAt(b);if(!g)return void(a.el.innerHTML="");Da("gettingData",b,g),a.index=b,a.item=g;var h=g.container=e.createEl("pswp__zoom-wrap");if(!g.src&&g.html&&(g.html.tagName?h.appendChild(g.html):h.innerHTML=g.html),lc(g),ic(g,qa),!g.src||g.loadError||g.loaded)g.src&&!g.loadError&&(d=e.createEl("pswp__img","img"),d.style.opacity=1,d.src=g.src,mc(g,d),jc(b,g,h,d,!0));else{if(g.loadComplete=function(c){if(j){if(a&&a.index===b){if(lc(c,!0))return c.loadComplete=c.img=null,ic(c,qa),Ia(c),void(a.index===m&&f.updateCurrZoomItem());c.imageAppended?!$b&&c.placeholder&&(c.placeholder.style.display="none",c.placeholder=null):N.transform&&(fa||$b)?ec.push({item:c,baseDiv:h,img:c.img,index:b,holder:a,clearPlaceholder:!0}):jc(b,c,h,c.img,fa||$b,!0)}c.loadComplete=null,c.img=null,Da("imageLoadComplete",b,c)}},e.features.transform){var k="pswp__img pswp__img--placeholder";k+=g.msrc?"":" pswp__img--placeholder--blank";var l=e.createEl(k,g.msrc?"img":"");g.msrc&&(l.src=g.msrc),mc(g,l),h.appendChild(l),g.placeholder=l}g.loading||kc(g),f.allowProgressiveImg()&&(!Zb&&N.transform?ec.push({item:g,baseDiv:h,img:g.img,index:b,holder:a}):jc(b,g,h,g.img,!0,!0))}Zb||b!==m?Ia(g):(ea=h.style,cc(g,d||g.img)),a.el.innerHTML="",a.el.appendChild(h)},cleanSlide:function(a){a.img&&(a.img.onload=a.img.onerror=null),a.loaded=a.loading=a.img=a.imageAppended=!1}}});var oc,pc={},qc=function(a,b,c){var d=document.createEvent("CustomEvent"),e={origEvent:a,target:a.target,releasePoint:b,pointerType:c||"touch"};d.initCustomEvent("pswpTap",!0,!0,e),a.target.dispatchEvent(d)};za("Tap",{publicMethods:{initTap:function(){Ca("firstTouchStart",f.onTapStart),Ca("touchRelease",f.onTapRelease),Ca("destroy",function(){pc={},oc=null})},onTapStart:function(a){a.length>1&&(clearTimeout(oc),oc=null)},onTapRelease:function(a,b){if(b&&!Y&&!W&&!_a){var c=b;if(oc&&(clearTimeout(oc),oc=null,xb(c,pc)))return void Da("doubleTap",c);if("mouse"===b.type)return void qc(a,b,"mouse");var d=a.target.tagName.toUpperCase();if("BUTTON"===d||e.hasClass(a.target,"pswp__single-tap"))return void qc(a,b);Ma(pc,c),oc=setTimeout(function(){qc(a,b),oc=null},300)}}}});var rc;za("DesktopZoom",{publicMethods:{initDesktopZoom:function(){L||(G?Ca("mouseUsed",function(){f.setupDesktopZoom()}):f.setupDesktopZoom(!0))},setupDesktopZoom:function(b){rc={};var c="wheel mousewheel DOMMouseScroll";Ca("bindEvents",function(){e.bind(a,c,f.handleMouseWheel)}),Ca("unbindEvents",function(){rc&&e.unbind(a,c,f.handleMouseWheel)}),f.mouseZoomedIn=!1;var d,g=function(){f.mouseZoomedIn&&(e.removeClass(a,"pswp--zoomed-in"),f.mouseZoomedIn=!1),s<1?e.addClass(a,"pswp--zoom-allowed"):e.removeClass(a,"pswp--zoom-allowed"),h()},h=function(){d&&(e.removeClass(a,"pswp--dragging"),d=!1)};Ca("resize",g),Ca("afterChange",g),Ca("pointerDown",function(){f.mouseZoomedIn&&(d=!0,e.addClass(a,"pswp--dragging"))}),Ca("pointerUp",h),b||g()}
1909,handleMouseWheel:function(a){if(s<=f.currItem.fitRatio)return i.modal&&(!i.closeOnScroll||_a||V?a.preventDefault():E&&Math.abs(a.deltaY)>2&&(l=!0,f.close())),!0;if(a.stopPropagation(),rc.x=0,"deltaX"in a)1===a.deltaMode?(rc.x=18*a.deltaX,rc.y=18*a.deltaY):(rc.x=a.deltaX,rc.y=a.deltaY);else if("wheelDelta"in a)a.wheelDeltaX&&(rc.x=-.16*a.wheelDeltaX),a.wheelDeltaY?rc.y=-.16*a.wheelDeltaY:rc.y=-.16*a.wheelDelta;else{if(!("detail"in a))return;rc.y=a.detail}Sa(s,!0);var b=pa.x-rc.x,c=pa.y-rc.y;(i.modal||b<=da.min.x&&b>=da.max.x&&c<=da.min.y&&c>=da.max.y)&&a.preventDefault(),f.panTo(b,c)},toggleDesktopZoom:function(b){b=b||{x:qa.x/2+sa.x,y:qa.y/2+sa.y};var c=i.getDoubleTapZoom(!0,f.currItem),d=s===c;f.mouseZoomedIn=!d,f.zoomTo(d?f.currItem.initialZoomLevel:c,b,333),e[(d?"remove":"add")+"Class"](a,"pswp--zoomed-in")}}});var sc,tc,uc,vc,wc,xc,yc,zc,Ac,Bc,Cc,Dc,Ec={history:!0,galleryUID:1},Fc=function(){return Cc.hash.substring(1)},Gc=function(){sc&&clearTimeout(sc),uc&&clearTimeout(uc)},Hc=function(){var a=Fc(),b={};if(a.length<5)return b;var c,d=a.split("&");for(c=0;c<d.length;c++)if(d[c]){var e=d[c].split("=");e.length<2||(b[e[0]]=e[1])}if(i.galleryPIDs){var f=b.pid;for(b.pid=0,c=0;c<Yb.length;c++)if(Yb[c].pid===f){b.pid=c;break}}else b.pid=parseInt(b.pid,10)-1;return b.pid<0&&(b.pid=0),b},Ic=function(){if(uc&&clearTimeout(uc),_a||V)return void(uc=setTimeout(Ic,500));vc?clearTimeout(tc):vc=!0;var a=m+1,b=_b(m);b.hasOwnProperty("pid")&&(a=b.pid);var c=yc+"&gid="+i.galleryUID+"&pid="+a;zc||Cc.hash.indexOf(c)===-1&&(Bc=!0);var d=Cc.href.split("#")[0]+"#"+c;Dc?"#"+c!==window.location.hash&&history[zc?"replaceState":"pushState"]("",document.title,d):zc?Cc.replace(d):Cc.hash=c,zc=!0,tc=setTimeout(function(){vc=!1},60)};za("History",{publicMethods:{initHistory:function(){if(e.extend(i,Ec,!0),i.history){Cc=window.location,Bc=!1,Ac=!1,zc=!1,yc=Fc(),Dc="pushState"in history,yc.indexOf("gid=")>-1&&(yc=yc.split("&gid=")[0],yc=yc.split("?gid=")[0]),Ca("afterChange",f.updateURL),Ca("unbindEvents",function(){e.unbind(window,"hashchange",f.onHashChange)});var a=function(){xc=!0,Ac||(Bc?history.back():yc?Cc.hash=yc:Dc?history.pushState("",document.title,Cc.pathname+Cc.search):Cc.hash=""),Gc()};Ca("unbindEvents",function(){l&&a()}),Ca("destroy",function(){xc||a()}),Ca("firstUpdate",function(){m=Hc().pid});var b=yc.indexOf("pid=");b>-1&&(yc=yc.substring(0,b),"&"===yc.slice(-1)&&(yc=yc.slice(0,-1))),setTimeout(function(){j&&e.bind(window,"hashchange",f.onHashChange)},40)}},onHashChange:function(){return Fc()===yc?(Ac=!0,void f.close()):void(vc||(wc=!0,f.goTo(Hc().pid),wc=!1))},updateURL:function(){Gc(),wc||(zc?sc=setTimeout(Ic,800):Ic())}}}),e.extend(f,eb)};return a}); 1910/*! PhotoSwipe Default UI - 4.1.3 - 2019-01-08 1911* http://photoswipe.com 1912* Copyright (c) 2019 Dmitry Semenov; */ 1913!function(a,b){"function"==typeof define&&define.amd?define(b):"object"==typeof exports?module.exports=b():a.PhotoSwipeUI_Default=b()}(this,function(){"use strict";var a=function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v=this,w=!1,x=!0,y=!0,z={barsSize:{top:44,bottom:"auto"},closeElClasses:["item","caption","zoom-wrap","ui","top-bar"],timeToIdle:4e3,timeToIdleOutside:1e3,loadingIndicatorDelay:1e3,addCaptionHTMLFn:function(a,b){return a.title?(b.children[0].innerHTML=a.title,!0):(b.children[0].innerHTML="",!1)},closeEl:!0,captionEl:!0,fullscreenEl:!0,zoomEl:!0,shareEl:!0,counterEl:!0,arrowEl:!0,preloaderEl:!0,tapToClose:!1,tapToToggleControls:!0,clickToCloseNonZoomable:!0,shareButtons:[{id:"facebook",label:"Share on Facebook",url:"https://www.facebook.com/sharer/sharer.php?u={{url}}"},{id:"twitter",label:"Tweet",url:"https://twitter.com/intent/tweet?text={{text}}&url={{url}}"},{id:"pinterest",label:"Pin it",url:"http://www.pinterest.com/pin/create/button/?url={{url}}&media={{image_url}}&description={{text}}"},{id:"download",label:"Download image",url:"{{raw_image_url}}",download:!0}],getImageURLForShare:function(){return a.currItem.src||""},getPageURLForShare:function(){return window.location.href},getTextForShare:function(){return a.currItem.title||""},indexIndicatorSep:" / ",fitControlsWidth:1200}
1913,A=function(a){if(r)return!0;a=a||window.event,q.timeToIdle&&q.mouseUsed&&!k&&K();for(var c,d,e=a.target||a.srcElement,f=e.getAttribute("class")||"",g=0;g<S.length;g++)c=S[g],c.onTap&&f.indexOf("pswp__"+c.name)>-1&&(c.onTap(),d=!0);if(d){a.stopPropagation&&a.stopPropagation(),r=!0;var h=b.features.isOldAndroid?600:30;s=setTimeout(function(){r=!1},h)}},B=function(){return!a.likelyTouchDevice||q.mouseUsed||screen.width>q.fitControlsWidth},C=function(a,c,d){b[(d?"add":"remove")+"Class"](a,"pswp__"+c)},D=function(){var a=1===q.getNumItemsFn();a!==p&&(C(d,"ui--one-slide",a),p=a)},E=function(){C(i,"share-modal--hidden",y)},F=function(){return y=!y,y?(b.removeClass(i,"pswp__share-modal--fade-in"),setTimeout(function(){y&&E()},300)):(E(),setTimeout(function(){y||b.addClass(i,"pswp__share-modal--fade-in")},30)),y||H(),!1},G=function(b){b=b||window.event;var c=b.target||b.srcElement;return a.shout("shareLinkClick",b,c),!!c.href&&(!!c.hasAttribute("download")||(window.open(c.href,"pswp_share","scrollbars=yes,resizable=yes,toolbar=no,location=yes,width=550,height=420,top=100,left="+(window.screen?Math.round(screen.width/2-275):100)),y||F(),!1))},H=function(){for(var a,b,c,d,e,f="",g=0;g<q.shareButtons.length;g++)a=q.shareButtons[g],c=q.getImageURLForShare(a),d=q.getPageURLForShare(a),e=q.getTextForShare(a),b=a.url.replace("{{url}}",encodeURIComponent(d)).replace("{{image_url}}",encodeURIComponent(c)).replace("{{raw_image_url}}",c).replace("{{text}}",encodeURIComponent(e)),f+='<a href="'+b+'" target="_blank" class="pswp__share--'+a.id+'"'+(a.download?"download":"")+">"+a.label+"</a>",q.parseShareButtonOut&&(f=q.parseShareButtonOut(a,f));i.children[0].innerHTML=f,i.children[0].onclick=G},I=function(a){for(var c=0;c<q.closeElClasses.length;c++)if(b.hasClass(a,"pswp__"+q.closeElClasses[c]))return!0},J=0,K=function(){clearTimeout(u),J=0,k&&v.setIdle(!1)},L=function(a){a=a?a:window.event;var b=a.relatedTarget||a.toElement;b&&"HTML"!==b.nodeName||(clearTimeout(u),u=setTimeout(function(){v.setIdle(!0)},q.timeToIdleOutside))},M=function(){q.fullscreenEl&&!b.features.isOldAndroid&&(c||(c=v.getFullscreenAPI()),c?(b.bind(document,c.eventK,v.updateFullscreen),v.updateFullscreen(),b.addClass(a.template,"pswp--supports-fs")):b.removeClass(a.template,"pswp--supports-fs"))},N=function(){q.preloaderEl&&(O(!0),l("beforeChange",function(){clearTimeout(o),o=setTimeout(function(){a.currItem&&a.currItem.loading?(!a.allowProgressiveImg()||a.currItem.img&&!a.currItem.img.naturalWidth)&&O(!1):O(!0)},q.loadingIndicatorDelay)}),l("imageLoadComplete",function(b,c){a.currItem===c&&O(!0)}))},O=function(a){n!==a&&(C(m,"preloader--active",!a),n=a)},P=function(a){var c=a.vGap;if(B()){var g=q.barsSize;if(q.captionEl&&"auto"===g.bottom)if(f||(f=b.createEl("pswp__caption pswp__caption--fake"),f.appendChild(b.createEl("pswp__caption__center")),d.insertBefore(f,e),b.addClass(d,"pswp__ui--fit")),q.addCaptionHTMLFn(a,f,!0)){var h=f.clientHeight;c.bottom=parseInt(h,10)||44}else c.bottom=g.top;else c.bottom="auto"===g.bottom?0:g.bottom;c.top=g.top}else c.top=c.bottom=0},Q=function(){q.timeToIdle&&l("mouseUsed",function(){b.bind(document,"mousemove",K),b.bind(document,"mouseout",L),t=setInterval(function(){J++,2===J&&v.setIdle(!0)},q.timeToIdle/2)})},R=function(){l("onVerticalDrag",function(a){x&&a<.95?v.hideControls():!x&&a>=.95&&v.showControls()});var a;l("onPinchClose",function(b){x&&b<.9?(v.hideControls(),a=!0):a&&!x&&b>.9&&v.showControls()}),l("zoomGestureEnded",function(){a=!1,a&&!x&&v.showControls()})},S=[{name:"caption",option:"captionEl",onInit:function(a){e=a}},{name:"share-modal",option:"shareEl",onInit:function(a){i=a},onTap:function(){F()}},{name:"button--share",option:"shareEl",onInit:function(a){h=a},onTap:function(){F()}},{name:"button--zoom",option:"zoomEl",onTap:a.toggleDesktopZoom},{name:"counter",option:"counterEl",onInit:function(a){g=a}},{name:"button--close",option:"closeEl",onTap:a.close},{name:"button--arrow--left",option:"arrowEl",onTap:a.prev},{name:"button--arrow--right",option:"arrowEl",onTap:a.next},{name:"button--fs",option:"fullscreenEl",onTap:function(){c.isFullscreen()?c.exit():c.enter()}},{name:"preloader",option:"preloaderEl",onInit:function(a){m=a}}],T=function(){var a,c,e,f=function(d){if(d)for(var f=d.length,g=0;g<f;g++){a=d[g],c=a.className;for(var h=0;h<S.length;h++)e=S[h],c.indexOf("pswp__"+e.name)>-1&&(q[e.option]?(b.removeClass(a,"pswp__element--disabled"),e.onInit&&e.onInit(
1913a)):b.addClass(a,"pswp__element--disabled"))}};f(d.children);var g=b.getChildByClass(d,"pswp__top-bar");g&&f(g.children)};v.init=function(){b.extend(a.options,z,!0),q=a.options,d=b.getChildByClass(a.scrollWrap,"pswp__ui"),l=a.listen,R(),l("beforeChange",v.update),l("doubleTap",function(b){var c=a.currItem.initialZoomLevel;a.getZoomLevel()!==c?a.zoomTo(c,b,333):a.zoomTo(q.getDoubleTapZoom(!1,a.currItem),b,333)}),l("preventDragEvent",function(a,b,c){var d=a.target||a.srcElement;d&&d.getAttribute("class")&&a.type.indexOf("mouse")>-1&&(d.getAttribute("class").indexOf("__caption")>0||/(SMALL|STRONG|EM)/i.test(d.tagName))&&(c.prevent=!1)}),l("bindEvents",function(){b.bind(d,"pswpTap click",A),b.bind(a.scrollWrap,"pswpTap",v.onGlobalTap),a.likelyTouchDevice||b.bind(a.scrollWrap,"mouseover",v.onMouseOver)}),l("unbindEvents",function(){y||F(),t&&clearInterval(t),b.unbind(document,"mouseout",L),b.unbind(document,"mousemove",K),b.unbind(d,"pswpTap click",A),b.unbind(a.scrollWrap,"pswpTap",v.onGlobalTap),b.unbind(a.scrollWrap,"mouseover",v.onMouseOver),c&&(b.unbind(document,c.eventK,v.updateFullscreen),c.isFullscreen()&&(q.hideAnimationDuration=0,c.exit()),c=null)}),l("destroy",function(){q.captionEl&&(f&&d.removeChild(f),b.removeClass(e,"pswp__caption--empty")),i&&(i.children[0].onclick=null),b.removeClass(d,"pswp__ui--over-close"),b.addClass(d,"pswp__ui--hidden"),v.setIdle(!1)}),q.showAnimationDuration||b.removeClass(d,"pswp__ui--hidden"),l("initialZoomIn",function(){q.showAnimationDuration&&b.removeClass(d,"pswp__ui--hidden")}),l("initialZoomOut",function(){b.addClass(d,"pswp__ui--hidden")}),l("parseVerticalMargin",P),T(),q.shareEl&&h&&i&&(y=!0),D(),Q(),M(),N()},v.setIdle=function(a){k=a,C(d,"ui--idle",a)},v.update=function(){x&&a.currItem?(v.updateIndexIndicator(),q.captionEl&&(q.addCaptionHTMLFn(a.currItem,e),C(e,"caption--empty",!a.currItem.title)),w=!0):w=!1,y||F(),D()},v.updateFullscreen=function(d){d&&setTimeout(function(){a.setScrollOffset(0,b.getScrollY())},50),b[(c.isFullscreen()?"add":"remove")+"Class"](a.template,"pswp--fs")},v.updateIndexIndicator=function(){q.counterEl&&(g.innerHTML=a.getCurrentIndex()+1+q.indexIndicatorSep+q.getNumItemsFn())},v.onGlobalTap=function(c){c=c||window.event;var d=c.target||c.srcElement;if(!r)if(c.detail&&"mouse"===c.detail.pointerType){if(I(d))return void a.close();b.hasClass(d,"pswp__img")&&(1===a.getZoomLevel()&&a.getZoomLevel()<=a.currItem.fitRatio?q.clickToCloseNonZoomable&&a.close():a.toggleDesktopZoom(c.detail.releasePoint))}else if(q.tapToToggleControls&&(x?v.hideControls():v.showControls()),q.tapToClose&&(b.hasClass(d,"pswp__img")||I(d)))return void a.close()},v.onMouseOver=function(a){a=a||window.event;var b=a.target||a.srcElement;C(d,"ui--over-close",I(b))},v.hideControls=function(){b.addClass(d,"pswp__ui--hidden"),x=!1},v.showControls=function(){x=!0,w||v.update(),b.removeClass(d,"pswp__ui--hidden")},v.supportsFullscreen=function(){var a=document;return!!(a.exitFullscreen||a.mozCancelFullScreen||a.webkitExitFullscreen||a.msExitFullscreen)},v.getFullscreenAPI=function(){var b,c=document.documentElement,d="fullscreenchange";return c.requestFullscreen?b={enterK:"requestFullscreen",exitK:"exitFullscreen",elementK:"fullscreenElement",eventK:d}:c.mozRequestFullScreen?b={enterK:"mozRequestFullScreen",exitK:"mozCancelFullScreen",elementK:"mozFullScreenElement",eventK:"moz"+d}:c.webkitRequestFullscreen?b={enterK:"webkitRequestFullscreen",exitK:"webkitExitFullscreen",elementK:"webkitFullscreenElement",eventK:"webkit"+d}:c.msRequestFullscreen&&(b={enterK:"msRequestFullscreen",exitK:"msExitFullscreen",elementK:"msFullscreenElement",eventK:"MSFullscreenChange"}),b&&(b.enter=function(){return j=q.closeOnScroll,q.closeOnScroll=!1,"webkitRequestFullscreen"!==this.enterK?a.template[this.enterK]():void a.template[this.enterK](Element.ALLOW_KEYBOARD_INPUT)},b.exit=function(){return q.closeOnScroll=j,document[this.exitK]()},b.isFullscreen=function(){return document[this.elementK]}),b}};return a}); 1914 1915function sectionHeader() { 1916 1917 var header = document.querySelector('#site-header'); 1918 var headerH = header.clientHeight; 1919 1920 window.addEventListener("scroll", function (event) { 1921 1922 if (this.scrollY > (headerH - (headerH / (4 / 3)))) { 1923 1924 document.body.classList.add('scroll'); 1925 1926 } else { 1927 1928 document.body.classList.remove('scroll'); 1929 } 1930 1931 if ( ( window.innerHeight + window.pageYOffset ) >= document.body.offsetHeight - 2 ) { 1932 1933 document.body.classList.add('end'); 1934 1935 } else { 1936 1937 document.body.classList.remove('end'); 1938 } 1939 1940 }, false); 1941} 1942 1943 1944function mainMenu( button, menu ) { 1945 1946 var menuButton = document.getElementById( button ), 1947 mainMenu = document.getElementById( menu ); 1948 1949 menuButton.addEventListener('click', function() { 1950 1951 if( menuButton.classList.contains('open') ) { 1952 1953 menuButton.classList.remove('open'); 1954 1955 if( typeof headerslider !== 'undefined' ) { 1956 1957 headerslider.play(); 1958 } 1959 1960 FX.fadeOut(mainMenu, { 1961 duration: 250, 1962 complete: function() { 1963 document.body.classList.remove('menu-open'); 1964 1965 for (var item of document.querySelectorAll('.submenu-container')) { 1966 1967 item.classList.remove('click-show-menu'); 1968 } 1969 1970 for (var item of document.querySelectorAll('.submenu-list')) { 1971 1972 item.classList.add('hide-menu'); 1973 item.style.opacity = '0'; 1974 } 1975 } 1976 }); 1977 1978 } else { 1979 1980 menuButton.classList.add('open'); 1981 document.body.classList.add('menu-open'); 1982 1983 if( typeof headerslider !== 'undefined' ) { 1984 1985 headerslider.pause(); 1986 } 1987 1988 FX.fadeIn(mainMenu, { 1989 duration: 250, 1990 complete: function() { 1991 1992 } 1993 }); 1994 } 1995 }); 1996} 1997 1998 1999function subMenu() { 2000 2001 var submenu = document.querySelectorAll('.submenu-list'); 2002 if (submenu.length < 1) return; 2003 2004 for (var item of submenu) { 2005 2006 item.classList.add('hide-menu'); 2007 item.style.opacity = '0'; 2008 2009 item.previousElementSibling.addEventListener('click', function(event){ 2010 2011 event.preventDefault(); 2012 2013 if ( !this.parentElement.classList.contains('click-show-menu') && window.innerWidth > 767 ) { 2014 2015 for (var item of document.querySelectorAll('.submenu-container')) { 2016 2017 item.classList.remove('click-show-menu'); 2018 } 2019 2020 for (var item of document.querySelectorAll('.submenu-list')) { 2021 2022 item.classList.add('hide-menu'); 2023 item.style.opacity = '0'; 2024 } 2025 2026 if ( this.nextElementSibling.classList.contains('hide-menu') ) { 2027 2028 let elem = this.nextElementSibling; 2029 2030 elem.classList.remove('hide-menu'); 2031 2032 FX.fadeIn(elem, { 2033 duration: 350, 2034 complete: function() { 2035 2036 } 2037 }); 2038 2039 } else { 2040 2041 let elem = this.nextElementSibling; 2042 2043 FX.fadeOut(elem, { 2044 duration: 250, 2045 complete: function() { 2046 2047 elem.classList.add('hide-menu'); 2048 } 2049 }); 2050 } 2051 2052 if ( this.parentElement.classList.contains('click-show-menu') ) { 2053 2054 this.parentElement.classList.remove('click-show-menu'); 2055 2056 } else { 2057 2058 this.parentElement.classList.add('click-show-menu'); 2059 } 2060 2061 } else { 2062 2063 if ( this.nextElementSibling.classList.contains('hide-menu') ) { 2064 2065 let elem = this.nextElementSibling; 2066 2067 elem.classList.remove('hide-menu'); 2068 2069 FX.fadeIn(elem, { 2070 duration: 450, 2071 complete: function() { 2072 2073 } 2074 }); 2075 2076 } else { 2077 2078 let elem = this.nextElementSibling; 2079 2080 FX.fadeOut(elem, { 2081 duration: 250, 2082 complete: function() { 2083 2084 elem.classList.add('hide-menu'); 2085 elem.style.opacity = '0'; 2086 } 2087 }); 2088 } 2089 2090 if ( this.parentElement.classList.contains('click-show-menu') ) { 2091 2092 this.parentElement.classList.remove('click-show-menu'); 2093 2094 } else { 2095 2096 this.parentElement.classList.add('click-show-menu'); 2097 } 2098 } 2099 }); 2100 } 2101} 2102 2103 2104function sectionSlider() { 2105 2106 if (document.querySelectorAll('.header-slideshow').length < 1) return; 2107 2108 const slider = document.querySelector('.header-slideshow'); 2109 2110 headerslider = new Glide(slider, { 2111 2112 type: 'carousel', 2113 animationDuration: 1500, 2114 animationTimingFunc: 'ease', 2115 autoplay: 8000, 2116 hoverpause: false, 2117 gap: 0 2118 2119 }
2119).mount({ 2120 2121 'CustomActiveClass': CustomActiveClass 2122 }); 2123} 2124 2125 2126 2127 2128function sectionCamere() { 2129 2130 var buttons = document.querySelectorAll('.button-camere'); 2131 2132 if (buttons.length < 1) return; 2133 2134 var servizi = document.querySelectorAll('.camere-item'); 2135 2136 for (button of buttons) { 2137 2138 button.addEventListener('click', function(){ 2139 2140 if( !this.classList.contains('active') ) { 2141 2142 var catname = this.dataset.cat; 2143 2144 for (button of buttons) { 2145 2146 button.classList.remove('active'); 2147 } 2148 2149 this.classList.add('active'); 2150 2151 showHideTabs(servizi, catname); 2152 } 2153 }); 2154 } 2155 2156 var allTab = document.querySelectorAll('.button-camere'); 2157 2158 document.querySelector('#camere-after').addEventListener('click', function (event) { 2159 2160 var activeTab = document.querySelector('.button-camere.active'); 2161 2162 if (activeTab.nextElementSibling) { 2163 2164 activeTab.nextElementSibling.click(); 2165 2166 } else { 2167 2168 allTab[0].click(); 2169 } 2170 }); 2171 2172 document.querySelector('#camere-before').addEventListener('click', function (event) { 2173 2174 var activeTab = document.querySelector('.button-camere.active'); 2175 var lastTab = allTab.length - 1; 2176 2177 if (activeTab.previousElementSibling) { 2178 2179 activeTab.previousElementSibling.click(); 2180 2181 } else { 2182 2183 allTab[lastTab].click(); 2184 } 2185 }); 2186} 2187 2188 2189function showHideTabs(motivi, catname) { 2190 2191 // fade out all motivi 2192 for(motivo of motivi) { 2193 2194 if( !motivo.classList.contains('hide') || catname === 'all') { 2195 2196 FX.fadeOut(motivo, { 2197 duration: 250, 2198 complete: function() { 2199 2200 // hide all offers 2201 2202 for(motivo of motivi) { 2203 2204 if (!motivo.classList.contains('hide')) { 2205 2206 motivo.classList.add('hide'); 2207 } 2208 } 2209 2210 2211 // fade in 2212 2213 for(motivo of motivi) { 2214 2215 if ( motivo.classList.contains(catname) || catname === 'all' ) { 2216 2217 // show offers in the selected category 2218 2219 motivo.classList.remove('hide'); 2220 2221 FX.fadeIn(motivo, { 2222 duration: 350, 2223 complete: function() { 2224 2225 } 2226 }); 2227 } 2228 } 2229 } 2230 }); 2231 } 2232 } 2233} 2234 2235 2236 2237function sectionGallery() { 2238 2239 if (document.querySelectorAll('.gallery-slideshow').length < 1) return; 2240 2241 const gallery = document.querySelector('.gallery-slideshow'); 2242 const activeBullet = "glide__bullet--active"; 2243 const bulletsContainerElement = gallery.querySelector(".text-bullets"); 2244 2245 var slideshow = new Glide( gallery, { 2246 2247 type: 'carousel', 2248 animationDuration: 800, 2249 animationTimingFunc: 'ease', 2250 autoplay: false, 2251 hoverpause: false, 2252 dragThreshold: false, 2253 swipeThreshold: false, 2254 direction: 'rtl', 2255 perView: 2, 2256 gap: 64, 2257 peek: { 2258 2259 before: 0, 2260 after: 198, 2261 }, 2262 breakpoints: { 2263 2264 1800: { 2265 2266 gap: 57, 2267 peek: { 2268 2269 before: 0, 2270 after: 178, 2271 } 2272 }, 2273 1600: { 2274 2275 gap: 51, 2276 peek: { 2277 2278 before: 0, 2279 after: 158, 2280 } 2281 }, 2282 1400: { 2283 2284 gap: 45, 2285 peek: { 2286 2287 before: 0, 2288 after: 138, 2289 } 2290 }, 2291 1200: { 2292 2293 gap: 38, 2294 peek: { 2295 2296 before: 0, 2297 after: 119, 2298 } 2299 }, 2300 1024: { 2301 2302 gap: 33, 2303 peek: { 2304 2305 before: 0, 2306 after: 101, 2307 } 2308 }, 2309 1023: { 2310 2311 perView: 1, 2312 gap: 44, 2313 peek: { 2314 2315 before: 0, 2316 after: 104, 2317 } 2318 }, 2319 767: { 2320 2321 perView: 1, 2322 gap: 16, 2323 peek: { 2324 2325 before: 0, 2326 after: 40 2327 } 2328 } 2329 } 2330 2331 }).mount({ 2332 2333 'CustomActiveClass': CustomActiveClass 2334 }); 2335 2336 slideshow.on("run", () => { 2337 2338 requestAnimationFrame(() => changeActiveBullet(slideshow.index, bulletsContainerElement, activeBullet)); 2339 }); 2340 2341 AOS.refresh(); 2342} 2343 2344 2345 2346 2347function sectionHighlights() { 2348 2349 var buttons = document.querySelectorAll('.highlights-menu .highlight'); 2350 2351 if (buttons.length < 1) return; 2352 2353 var servizi = document.querySelectorAll('.highlight-slide'); 2354 2355 for (button of buttons) { 2356 2357 button.addEventListener('mouseover', function() { 2358 2359 if( !this.classList.contains('active') ) { 2360 2361 var catname = this.dataset.cat; 2362 2363 for (button of buttons) { 2364 2365 button.classList.remove('active'); 2366 } 2367 2368 this.classList.add('active'); 2369 2370 showHideTabs(servizi, catname); 2371 } 2372 }); 2373 } 2374 2375 var allTab = document.querySelectorAll('.highlight'); 2376 2377 document.querySelector('#highlight-after').addEventListener('click', function (event) { 2378 2379 event.preventDefault(); 2380 2381 let activeSlide = document.querySelector( '.highlight-slide.active' ), 2382 prevButton = document.querySelector( '#highlight-before .title' ), 2383 nextButton = document.querySelector( '#highlight-after .title' ), 2384 slideIndex = activeSlide.dataset.index, 2385 activeTitle = activeSlide.dataset.title, 2386 nextSlide = +slideIndex + 1, 2387 prevSlide = +slideIndex - 1; 2388 2389 if( nextSlide > servizi.length - 1 ) nextSlide = 0; 2390 if( prevSlide == -1 ) prevSlide = ( servizi.length - 1 ); 2391 2392 prevButton.innerHTML = activeTitle; 2393 2394 let nextTitleIndex = nextSlide + 1; 2395 if( nextTitleIndex > servizi.length - 1 ) nextTitleIndex = 0; 2396 2397 let nextButtonTitle = document.querySelector( '[data-index="' + nextTitleIndex + '"]' ).dataset.title; 2398 2399 nextButton.innerHTML = nextButtonTitle; 2400 2401 servizi[slideIndex].classList.add('hide'); 2402 servizi[slideIndex].classList.remove('active'); 2403 servizi[slideIndex].style.opacity = 0; 2404 servizi[nextSlide].classList.add('active'); 2405 servizi[nextSlide].classList.remove('hide'); 2406 servizi[nextSlide].style.opacity = 1; 2407 }); 2408 2409 document.querySelector('#highlight-before').addEventListener('click', function (event) { 2410 2411 event.preventDefault(); 2412 2413 let activeSlide = document.querySelector( '.highlight-slide.active' ), 2414 prevButton = document.querySelector( '#highlight-before .title' ), 2415 nextButton = document.querySelector( '#highlight-after .title' ), 2416 slideIndex = activeSlide.dataset.index, 2417 activeTitle = activeSlide.dataset.title, 2418 nextSlide = +slideIndex + 1, 2419 prevSlide = +slideIndex - 1; 2420 2421 if( nextSlide > servizi.length - 1 ) nextSlide = 0; 2422 if( prevSlide == -1 ) prevSlide = ( servizi.length - 1 ); 2423 2424 nextButton.innerHTML = activeTitle; 2425 2426 let prevTitleIndex = prevSlide - 1; 2427 if( prevTitleIndex == -1 ) prevTitleIndex = 0; 2428 2429 let prevButtonTitle = document.querySelector( '[data-index="' + prevTitleIndex + '"]' ).dataset.title; 2430 2431 prevButton.innerHTML = prevButtonTitle; 2432 2433 servizi[slideIndex].classList.add('hide'); 2434 servizi[slideIndex].classList.remove('active'); 2435 servizi[slideIndex].style.opacity = 0; 2436 servizi[prevSlide].classList.add('active'); 2437 servizi[prevSlide].classList.remove('hide'); 2438 servizi[prevSlide].style.opacity = 1; 2439 }); 2440} 2441 2442 2443function showHideTabs(motivi, catname) { 2444 2445 // fade out all motivi 2446 for(motivo of motivi) { 2447 2448 if( !motivo.classList.contains('hide') || catname === 'all') { 2449 2450 FX.fadeOut(motivo, { 2451 duration: 250, 2452 complete: function() { 2453 2454 // hide all offers 2455 2456 for(motivo of motivi) { 2457 2458 if (!motivo.classList.contains('hide')) { 2459
2460 motivo.classList.add('hide'); 2461 motivo.classList.remove('active'); 2462 } 2463 } 2464 2465 // fade in 2466 2467 for(motivo of motivi) { 2468 2469 if ( motivo.classList.contains(catname) || catname === 'all' ) { 2470 2471 // show offers in the selected category 2472 2473 motivo.classList.remove('hide'); 2474 motivo.classList.add('active'); 2475 2476 FX.fadeIn(motivo, { 2477 duration: 350, 2478 complete: function() { 2479 2480 } 2481 }); 2482 } 2483 } 2484 } 2485 }); 2486 } 2487 } 2488} 2489 2490 2491 2492function sectionBuonimotivi() { 2493 2494 if (document.querySelectorAll('.motivi-slideshow').length < 1) return; 2495 2496 const gallery = document.querySelector('.motivi-slideshow'); 2497 const activeBullet = "glide__bullet--active"; 2498 const bulletsContainerElement = gallery.querySelector(".text-bullets"); 2499 const motiviControls = document.getElementById( 'motivi-controls' ); 2500 const controlsContainer = document.getElementById( 'motivi-controls-container' ); 2501 2502 var slideshow = new Glide( gallery, { 2503 2504 type: 'carousel', 2505 animationDuration: 800, 2506 animationTimingFunc: 'ease', 2507 autoplay: false, 2508 hoverpause: false, 2509 perView: 2, 2510 gap: 42, 2511 direction: 'rtl', 2512 peek: { 2513 2514 before: 525, 2515 after: 0, 2516 }, 2517 breakpoints: { 2518 2519 1800: { 2520 2521 gap: 38, 2522 peek: { 2523 2524 before: 472, 2525 after: 0, 2526 }, 2527 }, 2528 1600: { 2529 2530 gap: 33, 2531 peek: { 2532 2533 before: 420, 2534 after: 0, 2535 }, 2536 }, 2537 1400: { 2538 2539 gap: 29, 2540 peek: { 2541 2542 before: 367, 2543 after: 0, 2544 }, 2545 }, 2546 1200: { 2547 2548 gap: 25, 2549 peek: { 2550 2551 before: 315, 2552 after: 0, 2553 }, 2554 }, 2555 1024: { 2556 2557 gap: 21, 2558 peek: { 2559 2560 before: 269, 2561 after: 0, 2562 }, 2563 }, 2564 1023: { 2565 2566 perView: 1, 2567 gap: 30, 2568 peek: { 2569 2570 before: 70, 2571 after: 0 2572 } 2573 }, 2574 767: { 2575 2576 perView: 1, 2577 gap: 20, 2578 peek: { 2579 2580 before: 50, 2581 after: 0 2582 } 2583 } 2584 } 2585 2586 }).mount({ 2587 2588 'CustomActiveClass': CustomActiveClass 2589 }); 2590 2591 slideshow.on("run", () => { 2592 2593 requestAnimationFrame(() => changeActiveBullet(slideshow.index, bulletsContainerElement, activeBullet)); 2594 }); 2595 2596 controlsContainer.append( motiviControls ); 2597 AOS.refresh(); 2598} 2599 2600 2601function sectionOfferte() { 2602 2603 if (document.querySelectorAll('.offerte-slideshow').length < 1) return; 2604 2605 const slider = document.querySelector('.offerte-slideshow'); 2606 const slides = document.querySelectorAll('.offerta-slide'); 2607 const activeBullet = "glide__bullet--active"; 2608 const bulletsContainerElement = slider.querySelector(".text-bullets"); 2609 const offerteControls = document.getElementById( 'offerte-controls' ); 2610 const offerteControlsContainer = document.getElementById( 'offerte-slideshow-controls' ); 2611 2612 if( slides.length > 1 ) { 2613 2614 var slideshow = new Glide(slider, { 2615 2616 type: 'carousel', 2617 animationDuration: 1000, 2618 animationTimingFunc: 'ease', 2619 autoplay: false, 2620 hoverpause: false, 2621 perView: 2, 2622 startAt: 0, 2623 gap: 82, 2624 direction: 'rtl', 2625 breakpoints: { 2626 2627 1800: { gap: 74 }, 2628 1600: { gap: 66 }, 2629 1400: { gap: 57 }, 2630 1200: { gap: 49 }, 2631 1024: { gap: 42 }, 2632 1023: { 2633 2634 perView: 1, 2635 gap: 30, 2636 peek: { 2637 2638 before: 75, 2639 after: 75 2640 } 2641 }, 2642 767: { 2643 2644 perView: 1, 2645 gap: 4, 2646 peek: { 2647 2648 before: 40, 2649 after: 40 2650 } 2651 } 2652 } 2653 2654 }).mount(); 2655 2656 slideshow.on("run", () => { 2657 2658 requestAnimationFrame(() => changeActiveBullet(slideshow.index, bulletsContainerElement, activeBullet)); 2659 }); 2660 2661 offerteControlsContainer.append( offerteControls ); 2662 } 2663} 2664 2665 2666 2667 2668function sectionRecensioni() { 2669 2670 if (document.querySelectorAll( '.feedback-slideshow' ).length < 1 ) return; 2671 2672 const slider = document.querySelector( '.feedback-slideshow' ); 2673 const activeBullet = 'glide__bullet--active'; 2674 const bulletsContainerElement = slider.querySelector( '.text-bullets' ); 2675 const sliderControls = document.getElementById( 'recensioni-controls' ); 2676 const sectionFooter = document.getElementById( 'recensioni-footer' ); 2677 2678 2679 var glide = new Glide( slider, { 2680 2681 type: 'carousel', 2682 animationDuration: 800, 2683 animationTimingFunc: 'ease', 2684 autoplay: false, 2685 hoverpause: false, 2686 gap: 30, 2687 direction: 'rtl' 2688 2689 }).mount(); 2690 2691 glide.on("run", () => { 2692 2693 requestAnimationFrame(() => changeActiveBullet(glide.index, bulletsContainerElement, activeBullet)); 2694 }); 2695 2696 sectionFooter.append( sliderControls ); 2697} 2698 2699const CSRF_TOKEN = document.querySelector('meta[name="csrf-token"]').getAttribute('content'); 2700 2701 2702 2703function comboDialog() { 2704 var dialog = document.querySelector('.combo-popup'); 2705 if (!dialog) return; 2706 2707 var dialogDelay = (dialog.dataset.delay) ? parseInt(dialog.dataset.delay) : 1000; 2708 2709 var cookieKey = dialog.dataset.popupKey || 'comboPopup'; 2710 var cookieDays = dialog.dataset.cookieDays !== undefined && dialog.dataset.cookieDays !== '' 2711 ? parseInt(dialog.dataset.cookieDays) 2712 : 7; 2713 2714 // Se cookieDays è 0, mostra sempre la popup (bypassa il cookie) 2715 if (cookieDays !== 0) { 2716 // Se il cookie esiste, non mostrare la popup 2717 if (document.cookie.split('; ').find(row => row.startsWith(cookieKey + '='))) return; 2718 } 2719 2720 // Mostra la popup 2721 comboDialogAria(dialog); 2722 setTimeout(() => { 2723 dialog.showModal(); 2724 if (cookieDays > 0) { 2725 // Imposta il cookie quando la popup viene visualizzata 2726 var expires = new Date(Date.now() + cookieDays * 864e5).toUTCString(); 2727 document.cookie = cookieKey + "=1; expires=" + expires + "; path=/"; 2728 } 2729 }, dialogDelay); 2730 2731 var close = dialog.querySelector('.combo-popup-close'); 2732 var ctaPopup = dialog.querySelector('.combo-popup-cta'); 2733 if (close) close.addEventListener('click', () => dialog.close()); 2734 if (ctaPopup) ctaPopup.addEventListener('click', () => { 2735 if ( ctaPopup.hasAttribute( 'target' ) ) { dialog.close(); } 2736 }); 2737} 2738 2739function comboDialogAria(dialog) { 2740 let desktop = dialog.querySelector('.combo-popup-text-desktop'), 2741 mobile = dialog.querySelector('.combo-popup-text-mobile'); 2742 desktop.ariaHidden = (window.innerWidth > 767) ? false : true; 2743 mobile.ariaHidden = (window.innerWidth > 767) ? true : false;
2744} 2745 2746 2747// Crea #renderpopup se non esiste 2748let popup = document.getElementById("edt_renderpopup"); 2749 2750if ( !popup ) { 2751 popup = document.createElement("div"); 2752 popup.id = "edt_renderpopup"; 2753 document.body.appendChild(popup); 2754} 2755 2756// Cookie helpers 2757function edtpopup_setCookie(cname, cvalue, exdays) { 2758 const d = new Date(); 2759 d.setTime(d.getTime() + exdays * 24 * 60 * 60 * 1000); 2760 const expires = "expires=" + d.toUTCString(); 2761 document.cookie = `${cname}=${cvalue};${expires};path=/`; 2762} 2763 2764function edtpopup_getCookie(cname) { 2765 const name = cname + "="; 2766 const ca = document.cookie.split(";"); 2767 for (let c of ca) { 2768 c = c.trim(); 2769 if (c.indexOf(name) === 0) return c.substring(name.length, c.length); 2770 } 2771 return ""; 2772} 2773 2774// Gestione popup/modal 2775function edtpopup_modalManager() { 2776 const modals = document.getElementsByClassName("edtpopupModal"); 2777 for (let item of modals) { 2778 if (item.dataset.type == 1) { 2779 if (item.dataset.cookie != 0) { 2780 if (edtpopup_getCookie("openmodal") !== "true") { 2781 edtpopup_setCookie("openmodal", "true", item.dataset.cookie); 2782 item.style.display = "block"; 2783 } 2784 } else { 2785 item.style.display = "block"; 2786 } 2787 } else if (item.dataset.type == 2) { 2788 if (edtpopup_getCookie("openexitmodal") !== "true") { 2789 document.addEventListener("mouseleave", function handler(event) { 2790 edtpopup_setCookie("openexitmodal", "true", item.dataset.cookie); 2791 if ( 2792 event.clientY <= 0 || 2793 event.clientX <= 0 || 2794 event.clientX >= window.innerWidth || 2795 event.clientY >= window.innerHeight 2796 ) { 2797 item.style.display = "block"; 2798 document.removeEventListener("mouseleave", handler); // mostra solo una volta 2799 } 2800 }); 2801 } 2802 } 2803 const span = item.getElementsByClassName("close")[0]; 2804 if (span) { 2805 span.addEventListener("click", function () { 2806 item.style.display = "none"; 2807 }); 2808 } 2809 } 2810} 2811 2812// Caricamento popup via AJAX 2813(async () => { 2814 try { 2815 const pageId = window.pageId || null; 2816 const response = await fetch("/activePopup", { 2817 method: "POST", 2818 body: JSON.stringify({ 2819 _token: CSRF_TOKEN, 2820 type: "post", 2821 lang: typeof lang !== "undefined" ? lang : "it", 2822 page_id: pageId, // <-- CORRETTO 2823 }), 2824 headers: { 2825 "Content-type": "application/json; charset=UTF-8", 2826 }, 2827 }); 2828 2829 if (!response.ok) throw new Error("Errore fetch /activePopup"); 2830 2831 let items = []; 2832 try { 2833 items = JSON.parse(await response.text()); 2834 } catch (e) { 2835 console.warn("Risposta non valida da /activePopup", e); 2836 return; 2837 } 2838 2839 for (const item of items) { 2840 try { 2841 const popupResponse = await fetch("/renderPopup", { 2842 method: "POST", 2843 body: JSON.stringify({ 2844 _token: CSRF_TOKEN, 2845 type: "post", 2846 item: item, 2847 lang: typeof lang !== "undefined" ? lang : "it", 2848 }), 2849 headers: { 2850 "Content-type": "application/json; charset=UTF-8", 2851 }, 2852 }); 2853 2854 if ( !popupResponse.ok ) throw new Error("Errore fetch /renderPopup"); 2855 2856 const html = await popupResponse.text(); 2857 popup.innerHTML += html; 2858 edtpopup_modalManager(); 2859 comboDialog(); 2860 } catch (error) { 2861 console.warn("Errore nel renderPopup:", error); 2862 } 2863 } 2864 } catch (error) { 2865 console.warn("Errore nel caricamento popup:", error); 2866 } 2867})(); 2868 2869// Chiamala alla fine del file 2870window.addEventListener('load', function() { 2871 comboDialog(); 2872}); 2873 2874 2875var headerslider; 2876 2877 2878const changeActiveBullet = (newIndex, containerElement, activeBullet) => { 2879 2880 const glideDir = containerElement.querySelector(`[data-glide-dir="=${newIndex}"]`); 2881 containerElement.querySelector(`.${activeBullet}`).classList.remove(activeBullet); 2882 2883 if (glideDir) glideDir.classList.add(activeBullet); 2884}; 2885 2886 2887const CustomActiveClass = function (Glide, Components, Events) { 2888 2889 var Component = { 2890 2891 mount() { 2892 2893 this.changeActiveSlide(); 2894 }, 2895 2896 changeActiveSlide() { 2897 2898 let slides = Components.Html.slides; 2899 2900 for( const slide of slides) { 2901 2902 slide.classList.remove('is-active'); 2903 } 2904 2905 slides[Glide.index].classList.add('is-active'); 2906 }, 2907 }; 2908 2909 Events.on('move', () => { 2910 2911 Component.changeActiveSlide(); 2912 }); 2913 2914 return Component; 2915}; 2916 2917 2918(function(){ 2919 2920 function setCookie( cname, cvalue, exdays ) { 2921 var d = new Date(); 2922 d.setTime( d.getTime() + ( exdays * 24 * 60 * 60 * 1000 ) ); 2923 var expires = "expires="+d.toUTCString(); 2924 document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/"; 2925 } 2926 2927 function getCookie( cname ) { 2928 var name = cname + "="; 2929 var ca = document.cookie.split(';'); 2930 for(var i = 0; i < ca.length; i++) { 2931 var c = ca[i]; 2932 while (c.charAt(0) == ' ') { 2933 c = c.substring(1); 2934 } 2935 if (c.indexOf(name) == 0) { 2936 return c.substring(name.length, c.length); 2937 } 2938 } 2939 return ""; 2940 } 2941 2942 function modalManager( data ) { 2943 var modals = document.getElementsByClassName( 'edtModal' ); 2944 2945 for( let item of modals ){ 2946 if( item.dataset.type == 1 ){ 2947 if( item.dataset.cookie != 0){ 2948 //entry popup 2949 var cookie = getCookie('openmodal'); 2950 if( cookie != "true" ){
2951 setCookie( 'openmodal', 'true', item.dataset.cookie ); 2952 item.style.display = "block"; 2953 } 2954 }else{ 2955 item.style.display = "block"; 2956 } 2957 }else if( item.dataset.type == 2 ){ 2958 //exit popup 2959 var exitcookie = getCookie('openexitmodal'); 2960 if( exitcookie != "true" ){ 2961 document.addEventListener("mouseleave", function(event){ 2962 setCookie( 'openexitmodal', 'true', item.dataset.cookie ); 2963 if(event.clientY <= 0 || event.clientX <= 0 || (event.clientX >= window.innerWidth || event.clientY >= window.innerHeight)){ 2964 item.style.display = "block"; 2965 } 2966 }); 2967 } 2968 } 2969 var span = item.getElementsByClassName("close")[0]; 2970 2971 if (typeof (span) != 'undefined' && span != null) { 2972 span.addEventListener("click", function () { 2973 item.style.display = "none"; 2974 }); 2975 } 2976 } 2977 } 2978})(); 2979 2980 2981function browserSupportsJsFeatures() { 2982 2983 if (window.Promise && window.fetch && window.Symbol) return; 2984 loadScript('https://polyfill.io/v3/polyfill.min.js'); 2985} 2986 2987 2988function loadScript(src, done) { 2989 2990 var js = document.createElement('script'); 2991 js.src = src; 2992 2993 if (typeof done !== 'undefined') { 2994 js.onload = function () { 2995 done(); 2996 }; 2997 } 2998 2999 js.onerror = function () { 3000 console.log(new Error('Failed to load script ' + src)); 3001 }; 3002 3003 document.body.appendChild(js); 3004} 3005 3006 3007function browserSupportsStickyFeatures() { 3008 3009 if (typeof CSS !== 'undefined' && CSS.supports("position", "sticky")) return; 3010 3011 var header = document.getElementById("header"); 3012 var sticky = header.offsetTop; 3013 3014 window.onscroll = function () { 3015 if (window.pageYOffset > sticky) { 3016 header.classList.add("sticky"); 3017 } else { 3018 header.classList.remove("sticky"); 3019 } 3020 }; 3021} 3022 3023 3024function checkBrowser() { 3025 3026 var userAgentString = navigator.userAgent; 3027 3028 var agent = { 3029 'chrome': userAgentString.indexOf("Chrome") > -1, 3030 'ie': userAgentString.indexOf("MSIE") > -1 || userAgentString.indexOf("rv:") > -1, 3031 'firefox': userAgentString.indexOf("Firefox") > -1, 3032 'safari': userAgentString.indexOf("Safari") > -1, 3033 'opera': userAgentString.indexOf("OP") > -1 3034 }; 3035 3036 if ((agent.chrome) && (agent.safari)) agent.safari = false; 3037 3038 if ((agent.chrome) && (agent.opera)) agent.chrome = false; 3039 3040 for (var index in agent) { 3041 if (agent.hasOwnProperty(index)) { 3042 if (agent[index]) { 3043 document.body.classList.add(index); 3044 } 3045 } 3046 } 3047} 3048 3049 3050function countdown(countdown) { 3051 3052 // https://www.w3schools.com/howto/howto_js_countdown.asp 3053 var countDownDate = new Date(countdown.dataset.startDate).getTime(); 3054 var giorni = countdown.dataset.giorni; 3055 var ore = countdown.dataset.ore; 3056 3057 var x = setInterval(function () { 3058 var now = new Date().getTime(); 3059 var distance = countDownDate - now; 3060 var days = Math.floor(distance / (1000 * 60 * 60 * 24)); 3061 var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); 3062 3063 countdown.innerHTML = days + ' ' + giorni + ' ' + hours + ' ' + ore; 3064 3065 if (distance < 0) { 3066 clearInterval(x); 3067 countdown.innerHTML = 'countdown scaduto'; 3068 } 3069 3070 }(), 60000); 3071} 3072 3073 3074function initCountdown() { 3075 3076 if (document.querySelectorAll('.countdown').length > 0) { 3077 3078 var count = document.querySelectorAll('.countdown'); 3079 3080 for (var i = 0; i < count.length; i++) { 3081 3082 countdown(count[i]); 3083 } 3084 } 3085} 3086 3087 3088var initPhotoSwipeFromDOM = function (gallerySelector) { 3089 3090 // parse slide data (url, title, size ...) from DOM elements 3091 // (children of gallerySelector) 3092 3093 var parseThumbnailElements = function (el) { 3094 var thumbElements = el.childNodes, 3095 numNodes = thumbElements.length, 3096 items = [], 3097 figureEl, 3098 linkEl, 3099 size, 3100 vimeoId, 3101 item; 3102 3103 for (var i = 0; i < numNodes; i++) { 3104 3105 figureEl = thumbElements[i]; // <gallery-item> element 3106 // include only element nodes 3107 3108 if (figureEl.nodeType !== 1) { 3109 continue; 3110 } 3111 3112 linkEl = figureEl.querySelectorAll('a'); // <a> element 3113 3114 if (linkEl.length == 0) { 3115 3116 continue; 3117 } 3118 3119 // if vimeo... 3120 3121 if( linkEl[0].dataset.pswpType === 'vimeo' ) { 3122 3123 vimeoId = linkEl[0].dataset.videoId; 3124 3125 item = { 3126 3127 html: `<div class="responsive-video"><iframe src="https://player.vimeo.com/video/${vimeoId}?title=0&byline=0&portrait=0" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen allow="autoplay"></iframe></div>` 3128 } 3129 3130 } else { 3131 3132 size = linkEl[0].dataset.size.split('x'); 3133 3134 // create slide object 3135 item = { 3136 3137 src: linkEl[0].attributes[0].value, 3138 w: parseInt(size[0], 10), 3139 h: parseInt(size[1], 10) 3140 }; 3141 } 3142 3143 if (figureEl.children.length > 1) { 3144 3145 // <figcaption> content 3146 item.title = figureEl.children[1].innerHTML; 3147 } 3148 3149 item.el = figureEl; // save link to element for getThumbBoundsFn 3150 items.push(item); 3151 } 3152 3153 return items; 3154 }; 3155 3156 // find nearest parent element 3157 var closest = function closest(el, fn) { 3158 3159 return el && (fn(el) ? el : closest(el.parentNode, fn)); 3160 }; 3161 3162 // triggers when user clicks on thumbnail 3163 var onThumbnailsClick = function (e) { 3164 3165 e = e || window.event; 3166 e.preventDefault ? e.preventDefault() : e.returnValue = false;
3167 3168 var eTarget = e.target || e.srcElement; 3169 3170 // find root element of slide 3171 var clickedListItem = closest(eTarget, function (el) { 3172 3173 return (el.tagName && el.classList.contains('gallery-item')); 3174 }); 3175 3176 if (!clickedListItem) { 3177 3178 return; 3179 } 3180 3181 // find index of clicked item by looping through all child nodes 3182 // alternatively, you may define index via data- attribute 3183 var clickedGallery = clickedListItem.parentNode, 3184 childNodes = clickedListItem.parentNode.childNodes, 3185 numChildNodes = childNodes.length, 3186 nodeIndex = 0, 3187 index; 3188 3189 for (var i = 0; i < numChildNodes; i++) { 3190 3191 if (childNodes[i].nodeType !== 1) { 3192 3193 continue; 3194 } 3195 3196 if (childNodes[i] === clickedListItem) { 3197 3198 index = nodeIndex; 3199 break; 3200 } 3201 3202 nodeIndex++; 3203 } 3204 3205 if (index >= 0) { 3206 3207 // open PhotoSwipe if valid index found 3208 3209 openPhotoSwipe(index, clickedGallery); 3210 } 3211 3212 return false; 3213 }; 3214 3215 // parse picture index and gallery index from URL (#&pid=1&gid=2) 3216 var photoswipeParseHash = function () { 3217 3218 var hash = window.location.hash.substring(1), 3219 3220 params = {}; 3221 3222 if (hash.length < 5) { 3223 3224 return params; 3225 } 3226 3227 var vars = hash.split('&'); 3228 3229 for (var i = 0; i < vars.length; i++) { 3230 3231 if (!vars[i]) { 3232 3233 continue; 3234 } 3235 3236 var pair = vars[i].split('='); 3237 3238 if (pair.length < 2) { 3239 3240 continue; 3241 } 3242 3243 params[pair[0]] = pair[1]; 3244 } 3245 3246 if (params.gid) { 3247 3248 params.gid = parseInt(params.gid, 10); 3249 } 3250 3251 return params; 3252 }; 3253 3254 var openPhotoSwipe = function (index, galleryElement, disableAnimation, fromURL) { 3255 3256 var pswpElement = document.querySelectorAll('.pswp')[0], 3257 gallery, 3258 options, 3259 items; 3260 3261 items = parseThumbnailElements(galleryElement); 3262 3263 // define options (if needed) 3264 options = { 3265 3266 shareEl: false, 3267 // define gallery index (for URL) 3268 galleryUID: galleryElement.getAttribute('data-pswp-uid'), 3269 }; 3270 3271 // PhotoSwipe opened from URL 3272 if (fromURL) { 3273 3274 if (options.galleryPIDs) { 3275 3276 // parse real index when custom PIDs are used 3277 // http://photoswipe.com/documentation/faq.html#custom-pid-in-url 3278 for (var j = 0; j < items.length; j++) { 3279 3280 if (items[j].pid == index) { 3281 3282 options.index = j; 3283 break; 3284 } 3285 } 3286 3287 } else { 3288 3289 // in URL indexes start from 1 3290 options.index = parseInt(index, 10) - 1; 3291 } 3292 3293 } else { 3294 3295 options.index = parseInt(index, 10); 3296 } 3297 3298 // exit if index not found 3299 if (isNaN(options.index)) { 3300 3301 return; 3302 } 3303 3304 if (disableAnimation) { 3305 3306 options.showAnimationDuration = 0; 3307 } 3308 3309 // Pass data to PhotoSwipe and initialize it 3310 gallery = new PhotoSwipe(pswpElement, PhotoSwipeUI_Default, items, options); 3311 3312 gallery.init(); 3313 3314 // if Vimeo Video... 3315 3316 videoIframe = null; 3317 vimeoVideo = null; 3318 videoIframe = gallery.currItem.container.querySelector( 'iframe' ); 3319 3320 if( videoIframe ) { 3321 3322 vimeoVideo = new Vimeo.Player( videoIframe ); 3323 vimeoVideo.play(); 3324 } 3325 3326 gallery.listen('afterChange', function() { 3327 3328 if( vimeoVideo ) { 3329 3330 vimeoVideo.pause(); 3331 } 3332 3333 videoIframe = null; 3334 vimeoVideo = null; 3335 videoIframe = gallery.currItem.container.querySelector( 'iframe' ); 3336 3337 if( videoIframe ) { 3338 3339 vimeoVideo = new Vimeo.Player( videoIframe ); 3340 vimeoVideo.play(); 3341 } 3342 }); 3343 3344 gallery.listen('close', function() { 3345 3346 if( vimeoVideo ) { 3347 3348 vimeoVideo.pause(); 3349 } 3350 3351 videoIframe = null; 3352 vimeoVideo = null; 3353 }) 3354 }; 3355 3356 // loop through all gallery elements and bind events 3357 var galleryElements = document.querySelectorAll(gallerySelector); 3358 3359 for (var i = 0, l = galleryElements.length; i < l; i++) { 3360 3361 galleryElements[i].setAttribute('data-pswp-uid', i + 1); 3362 galleryElements[i].onclick = onThumbnailsClick; 3363 } 3364 3365 // Parse URL and open gallery if it contains #&pid=3&gid=1 3366 var hashData = photoswipeParseHash(); 3367 3368 if (hashData.pid && hashData.gid) { 3369 3370 openPhotoSwipe(hashData.pid, galleryElements[hashData.gid - 1], true, true); 3371 } 3372}; 3373 3374 3375(function () { 3376 var FX = { 3377 easing: { 3378 linear: function (progress) { 3379 return progress; 3380 }, 3381 quadratic: function (progress) { 3382 return Math.pow(progress, 2); 3383 }, 3384 swing: function (progress) { 3385 return 0.5 - Math.cos(progress * Math.PI) / 2; 3386 }, 3387 circ: function (progress) { 3388 return 1 - Math.sin(Math.acos(progress)); 3389 }, 3390 back: function (progress, x) { 3391 return Math.pow(progress, 2) * ((x + 1) * progress - x); 3392 }, 3393 bounce: function (progress) { 3394 for (var a = 0, b = 1, result; 1; a += b, b /= 2) { 3395 if (progress >= (7 - 4 * a) / 11) { 3396 return -Math.pow((11 - 6 * a - 11 * progress) / 4, 2) + Math.pow(b, 2); 3397 } 3398 } 3399 }, 3400 elastic: function (progress, x) { 3401 return Math.pow(2, 10 * (progress - 1)) * Math.cos(20 * Math.PI * x / 3 * progress); 3402 } 3403 }, 3404 animate: function (options) { 3405 var start = new Date; 3406 var id = setInterval(function () { 3407 var timePassed = new Date - start; 3408 var progress = timePassed / options.duration; 3409 if (progress > 1) { 3410 progress = 1; 3411 } 3412 options.progress = progress; 3413 var delta = options.delta(progress); 3414 options.step(delta); 3415 if (progress == 1) { 3416 clearInterval(id); 3417 options.complete(); 3418 } 3419 }, options.delay || 10); 3420 }, 3421 fadeOut: function (element, options) { 3422 var to = 1; 3423 this.animate({ 3424 duration: options.duration, 3425 delta: function (progress) { 3426 progress = this.progress; 3427 return FX.easing.swing(progress); 3428 }, 3429 complete: options.complete, 3430 step: function (delta) { 3431 element.style.opacity = to - delta; 3432 } 3433 }); 3434 }, 3435 fadeIn: function (element, options) { 3436 var to = 0; 3437 this.animate({ 3438 duration: options.duration, 3439 delta: function (progress) { 3440 progress = this.progress; 3441 return FX.easing.swing(progress); 3442 }, 3443 complete: options.complete, 3444 step: function (delta) { 3445 element.style.opacity = to + delta; 3446 } 3447 }); 3448 }, 3449 fadeShrink: function (element, options) { 3450 var to = 1; 3451 this.animate({ 3452 duration: options.duration, 3453 delta: function (progress) { 3454 progress = this.progress; 3455 return FX.easing.swing(progress); 3456 }, 3457 complete: options.complete, 3458 step: function (delta) { 3459 element.style.opacity = to - delta; 3460 element.style.transform = "scale(" + (to - delta) + ")"; 3461 } 3462 }); 3463 }, 3464 fadeGrow: function (element, options) { 3465 var to = 0; 3466 this.animate({ 3467 duration: options.duration, 3468 delta: function (progress) { 3469 progress = this.progress; 3470 return FX.easing.circ(progress); 3471 }, 3472 complete: options.complete, 3473 step: function (delta) { 3474 element.style.opacity = to + delta; 3475 element.style.transform = "scale(" + (to + delta) + ")"; 3476 } 3477 }); 3478 } 3479 }; 3480 window.FX = FX; 3481})(); 3482 3483 3484function debounce( func, wait, immediate ) { 3485 3486 var timeout; 3487 3488 return function() { 3489 3490 var context = this, args = arguments; 3491 3492 var later = function() { 3493 3494 timeout = null; 3495
3496 if (!immediate) func.apply(context, args); 3497 }; 3498 3499 var callNow = immediate && !timeout; 3500 clearTimeout(timeout); 3501 timeout = setTimeout(later, wait); 3502 3503 if (callNow) func.apply(context, args); 3504 }; 3505}; 3506 3507 3508function allClick() { 3509 3510 var clickbox = document.querySelectorAll('.allclick'); 3511 3512 if (clickbox.length < 1) return; 3513 3514 Array.prototype.forEach.call(clickbox, function (item, index) { 3515 3516 var $this = item; 3517 var link = $this.querySelector('a'); 3518 3519 if( link ) { 3520 3521 $this.style.cursor = 'pointer'; 3522 3523 link.addEventListener('click', function (event) { 3524 3525 event.preventDefault(); 3526 }); 3527 3528 if (link.getAttribute('target') == '_blank') { 3529 3530 $this.addEventListener('click', function () { 3531 3532 window.open(link.getAttribute('href')); 3533 }); 3534 3535 } else { 3536 3537 $this.addEventListener('click', function () { 3538 3539 window.location.href = link.getAttribute('href'); 3540 }); 3541 } 3542 } 3543 }); 3544} 3545 3546 3547function filterOffer() { 3548 3549 var buttons = document.querySelectorAll('.button-offer'); 3550 var offers = document.querySelectorAll('.offer-item'); 3551 var catname = ''; 3552 var select = document.getElementById('select-offer'); 3553 3554 if ( buttons.length < 1 || offers.length < 1 ) return; 3555 3556 if ( isTouch() ) { 3557 3558 select.addEventListener("change", function(){ 3559 3560 var catname = this.value; 3561 3562 showHideOffers(offers, catname); 3563 }); 3564 3565 } else { 3566 3567 document.querySelector('.button-offer[data-cat="all"]').classList.add('active'); 3568 3569 for (button of buttons) { 3570 3571 button.addEventListener('click', function(){ 3572 3573 if( !this.classList.contains('active') ) { 3574 3575 catname = this.dataset.cat; 3576 3577 for (button of buttons) { 3578 3579 button.classList.remove('active'); 3580 } 3581 3582 this.classList.add('active'); 3583 3584 showHideOffers(offers, catname); 3585 } 3586 }); 3587 } 3588 } 3589} 3590 3591 3592function showHideOffers(offers, catname) { 3593 3594 // shrink all offers 3595 for(offer of offers) { 3596 3597 if( !offer.classList.contains('hide') || catname === 'all') { 3598 3599 FX.fadeShrink(offer, { 3600 duration: 250, 3601 complete: function() { 3602 3603 // hide all offers 3604 3605 for(offer of offers) { 3606 3607 if (!offer.classList.contains('hide')) { 3608 3609 offer.classList.add('hide'); 3610 } 3611 } 3612 3613 3614 // grow all offers in the selected category 3615 3616 for(offer of offers) { 3617 3618 if ( offer.classList.contains(catname) || catname === 'all' ) { 3619 3620 // show offers in the selected category 3621 3622 offer.classList.remove('hide'); 3623 3624 FX.fadeGrow(offer, { 3625 duration: 350, 3626 complete: function() { 3627 3628 } 3629 }); 3630 } 3631 } 3632 3633 AOS.refresh(); 3634 } 3635 }); 3636 } 3637 } 3638} 3639 3640 3641function svgIcons() { 3642 3643 //get all template elements 3644 3645 let templates = document.querySelectorAll('template'); 3646 let icons = new Array(); 3647 3648 for (template of templates) { 3649 3650 icons.push( template.id ); 3651 } 3652 3653 for (icon of icons) { 3654 3655 var theElements = document.querySelectorAll('.' + icon); 3656 if( theElements.length > 0 ) { 3657 3658 var theIcon = document.getElementById( icon ); 3659 3660 for (theElement of theElements) { 3661 3662 let clone = theIcon.content.cloneNode( true ); 3663 theElement.appendChild( clone ); 3664 } 3665 } 3666 } 3667} 3668 3669 3670function sameHeights(selectElem) { 3671 3672 if (window.innerWidth <= 767) return; 3673 3674 var nodeList = document.querySelectorAll(selectElem); 3675 var elems = [].slice.call(nodeList); 3676 3677 var tallest = Math.max.apply(Math, elems.map(function (elem, index) { 3678 3679 elem.style.minHeight = ''; 3680 return elem.offsetHeight; 3681 })); 3682 3683 elems.forEach(function (elem, index, arr) { 3684 3685 elem.style.minHeight = tallest + 'px'; 3686 }); 3687} 3688 3689 3690function defineVh() { 3691 3692 document.documentElement.style.setProperty( 3693 '--vh', 3694 `${window.innerHeight/100}px` 3695 ); 3696} 3697 3698 3699function setVh() { 3700 3701 defineVh(); 3702 const debounceVh = debounce( defineVh, 100 ); 3703 window.addEventListener( 'resize', debounceVh ); 3704} 3705 3706 3707function isTouch() { 3708 3709 return ( 'ontouchstart' in window ) || 3710 ( navigator.maxTouchPoints > 0 ) || 3711 ( navigator.msMaxTouchPoints > 0 ); 3712} 3713 3714 3715function showBookingCta() { 3716 3717 if ( document.querySelectorAll('#slider-section').length < 1 ) return; 3718 3719 let prenotaForm = document.querySelector( '.form-prenota' ); 3720 let prenotaH = prenotaForm.offsetHeight; 3721 window.addEventListener( 'scroll', function ( event ) { 3722 3723 let prenotaPosition = prenotaForm.getBoundingClientRect(); 3724 3725 3726 if ( this.scrollY > ( prenotaPosition.top + (prenotaH * 2 ) ) ) { 3727 3728 document.body.classList.add( 'show-cta' ); 3729 3730 } else { 3731 3732 document.body.classList.remove( 'show-cta' ); 3733 } 3734 3735 }, false); 3736} 3737 3738 3739function aiuto() { 3740 3741 const aiuto = document.getElementById( 'aiuto' ); 3742 const aiutoButton = document.getElementById( 'aiuto-button' ); 3743 const aiutoMenu = document.getElementById( 'aiuto-menu' ); 3744 const aiutoClose = document.getElementById( 'aiuto-close' ); 3745 3746 aiutoButton.addEventListener( 'click', function() { 3747 3748 aiuto.classList.add( 'open' ); 3749 }); 3750 3751 aiutoClose.addEventListener( 'click', function() { 3752 3753 aiuto.classList.remove( 'open' ); 3754 }); 3755 3756 document.addEventListener( 'scroll', function() { 3757 3758 aiuto.classList.remove( 'open' ); 3759 }); 3760} 3761 3762 3763function prenota() { 3764 3765 let dayNum1 = document.querySelector( '#arrivo-formatted .daynum' ), 3766 month1 = document.querySelector( '#arrivo-formatted .month' ), 3767 year1 = document.querySelector( '#arrivo-formatted .year' ), 3768 day1 = document.querySelector( '#arrivo-formatted .day' ); 3769 3770 let dayNum2 = document.querySelector( '#partenza-formatted .daynum' ), 3771 month2 = document.querySelector( '#partenza-formatted .month' ), 3772 year2 = document.querySelector( '#partenza-formatted .year' ), 3773 day2 = document.querySelector( '#partenza-formatted .day' ); 3774 3775 const checkinPicker = flatpickr('#prenota-arrivo', { 3776 dateFormat: 'Y-m-d', 3777 minDate: 'today', 3778 locale: script_vars.locale, 3779 onChange: function(selectedDates) { 3780 const checkinDate = selectedDates[0]; 3781 if (!checkinDate || isNaN(checkinDate)) return; 3782 3783 // Aggiorna i label della data di arrivo 3784 dayNum1.innerText = checkinDate.getDate(); 3785 month1.innerText = checkinDate.toLocaleDateString(script_vars.lang, { month: 'long' }); 3786 year1.innerText = checkinDate.getFullYear(); 3787 day1.innerText = checkinDate.toLocaleDateString(script_vars.lang, { weekday: 'long' }); 3788 3789 // Calcola la data di partenza automatica 3790 const minstay = parseInt(document.getElementById('prenota-arrivo').dataset.minstay || '1'); 3791 let checkoutDate = new Date(checkinDate.getTime()); 3792 checkoutDate.setDate(checkoutDate.getDate() + minstay); 3793 3794 // Imposta il minimo e la nuova data di partenza 3795 flatpickrInstancePartenza.set('minDate', checkinDate); 3796 flatpickrInstancePartenza.setDate(checkoutDate, true); // true = triggera onChange 3797 3798 // Imposta anche il valore del campo input HTML 3799 document.getElementById('prenota-partenza').value = flatpickr.formatDate(checkoutDate, 'Y-m-d'); 3800 } 3801 }); 3802 3803 const flatpickrInstancePartenza = flatpickr('#prenota-partenza', { 3804 dateFormat: 'Y-m-d', 3805 minDate: 'today', 3806 locale: script_vars.locale, 3807 onChange: function(selectedDates) { 3808 const checkoutDate = selectedDates[0]; 3809 if (!checkoutDate || isNaN(checkoutDate)) return; 3810 3811 // Aggiorna i label della data di partenza 3812 dayNum2.innerText = checkoutDate.getDate(); 3813 month2.innerText = checkoutDate.toLocaleDateString(script_vars.lang, { month: 'long' }); 3814 year2.innerText = checkoutDate.getFullYear(); 3815 day2.innerText = checkoutDate.toLocaleDateString(script_vars.lang, { weekday: 'long' }); 3816 } 3817 }); 3818 3819 3820} 3821 3822 3823function reviewsList() { 3824 3825 if ( document.getElementById( 'reviews-list' ) ) { 3826 3827 3828 let itemsPerPage = 10, 3829 items = itemsPerPage; 3830 3831 const listJS = new List( 'reviews-list', { 3832 3833 valueNames: [ 'order', 'voto' ], 3834 page: itemsPerPage, 3835 pagination: { 3836 item: '<li><a class="page" role="button" href="#/"></a></li>' 3837 } 3838 }); 3839 3840 document.getElementById( 'reviews-prev' ).addEventListener( 'click', function( event ) { 3841 3842 event.preventDefault(); 3843 3844 const activeItem = document.querySelector( 'ul.pagination li.active' ); 3845 3846 if ( activeItem.previousElementSibling !== null ) { 3847 3848 listJS.show( listJS.i - listJS.page, itemsPerPage ); 3849 } 3850 }); 3851 3852 document.getElementById( 'reviews-next' ).addEventListener( 'click', function( event ) { 3853 3854 event.preventDefault(); 3855 3856 const activeItem = document.querySelector('ul.pagination li.active'); 3857 3858 if ( activeItem.nextElementSibling !== null ) { 3859 3860 listJS.show( listJS.i + items, itemsPerPage ); 3861 } 3862 }); 3863 } 3864} 3865 3866 3867function modals() { 3868 3869 var items = document.querySelectorAll( '[data-modal-id]' ), 3870 modal = document.getElementById( 'modal' ),
3871 modalInner = document.getElementById( 'modal-content' ), 3872 modalClose = document.getElementById( 'modal-close' ); 3873 3874 if ( items.length < 1 ) return; 3875 3876 for( item of items ) { 3877 3878 item.addEventListener( 'click', function( e ) { 3879 3880 e.preventDefault(); 3881 3882 let itemId = this.dataset.modalId, 3883 size = this.dataset.modalSize; 3884 3885 3886 if( size ) { modal.classList.add( 'large' ); } 3887 document.body.classList.add( 'modal-open' ); 3888 3889 if( itemId === 'iframe' ) { 3890 3891 const src = this.dataset.src; 3892 const iframe = document.createElement( 'iframe' ); 3893 iframe.src = src; 3894 modalInner.append( iframe ); 3895 } 3896 3897 FX.fadeIn( modal, { 3898 3899 duration: 650, 3900 complete: function() { 3901 3902 3903 } 3904 }); 3905 }); 3906 } 3907 3908 function closeModal() { 3909 3910 FX.fadeOut( modal, { 3911 3912 duration: 250, 3913 complete: function() { 3914 3915 modalInner.innerHTML = ''; 3916 modal.removeAttribute( 'style' ); 3917 modal.classList.remove( 'large' ); 3918 document.body.classList.remove( 'modal-open' ); 3919 } 3920 }); 3921 } 3922 3923 modalClose.addEventListener( 'click', closeModal ) ; 3924 3925 modal.addEventListener( 'click', function( e ) { 3926 3927 if( e.target !== e.currentTarget ) return; 3928 3929 closeModal(); 3930 }); 3931} 3932 3933 3934function youTubeEmbed() { 3935 3936 const ytIframes = document.querySelectorAll( '.editor-content iframe[src*="youtube"]' ); 3937 3938 for( let ytIframe of ytIframes ) { 3939 3940 let wrapper = document.createElement( 'span' ); 3941 ytIframe.parentNode.insertBefore( wrapper, ytIframe ); 3942 wrapper.classList.add( 'responsive-embed' ); 3943 wrapper.appendChild( ytIframe ); 3944 } 3945} 3946 3947 3948document.addEventListener("DOMContentLoaded", function () { 3949 3950 browserSupportsJsFeatures(); 3951 checkBrowser(); 3952 if( isTouch() ) { document.body.classList.add('touch'); } 3953 setVh(); 3954 allClick(); 3955 filterOffer(); 3956 initCountdown(); 3957 3958 if (typeof sectionHeader === 'function') { sectionHeader(); } 3959 if (typeof mainMenu === 'function') { mainMenu( 'open-menu', 'main-menu' ); } 3960 if (typeof subMenu === 'function') { subMenu(); } 3961 if (typeof sectionSlider === 'function') { sectionSlider(); } 3962 if (typeof sectionContent === 'function') { sectionContent(); } 3963 if (typeof sectionFooter === 'function') { sectionFooter(); } 3964 3965 initPhotoSwipeFromDOM('.photogallery-slides'); 3966 initPhotoSwipeFromDOM('.gallery-editor'); 3967 3968 if (typeof global_responsiveScrollingTables === 'function') { 3969 3970 global_responsiveScrollingTables('.CookieDeclarationTable'); 3971 } 3972 3973 showBookingCta(); 3974 aiuto(); 3975 prenota(); 3976 reviewsList(); 3977 youTubeEmbed(); 3978}); 3979 3980 3981AOS.init({ 3982 3983 startEvent: 'load', 3984 once: true, 3985 // disable: 'mobile', 3986 useClassNames: true, 3987 initClassName: '', 3988 animatedClassName: 'animate__animated' 3989}); 3990 3991 3992window.addEventListener('load', function (event) { 3993 3994 svgIcons(); 3995 //new Backpax( document.querySelectorAll('.parallax') ); 3996 3997 if (typeof sectionCamere === 'function') { sectionCamere(); } 3998 if (typeof listCamere === 'function') { listCamere(); } 3999 4000 if (typeof sectionExtraContent === 'function') { sectionExtraContent(); } 4001 if (typeof sectionGallery === 'function') { sectionGallery(); } 4002 if (typeof sectionHighlights === 'function') { sectionHighlights(); } 4003 if (typeof sectionServizi === 'function') { sectionServizi(); } 4004 if (typeof sectionBuonimotivi === 'function') { sectionBuonimotivi(); } 4005 if (typeof sectionOfferte === 'function') { sectionOfferte(); } 4006 if (typeof sectionSingleOfferta === 'function') { sectionSingleOfferta(); } 4007 if (typeof sectionRecensioni === 'function') { sectionRecensioni(); } 4008 4009 modals(); 4010});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.