holidoit 1.0.159 → 1.0.161

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
1
  /*! For license information please see holidoit.umd.js.LICENSE.txt */
2
- !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("Holidoit",[],e):"object"==typeof exports?exports.Holidoit=e():t.Holidoit=e()}(this,()=>(()=>{var t={172:t=>{t.exports=function(t,e){this.v=t,this.k=e},t.exports.__esModule=!0,t.exports.default=t.exports},317:function(t,e,n){t.exports=function(t){"use strict";function e(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var n=e(t),o={name:"es",monthsShort:"ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),weekdays:"domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"),weekdaysShort:"dom._lun._mar._mié._jue._vie._sáb.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_sá".split("_"),months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),weekStart:1,formats:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY H:mm",LLLL:"dddd, D [de] MMMM [de] YYYY H:mm"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},ordinal:function(t){return t+"º"}};return n.default.locale(o,null,!0),o}(n(353))},353:function(t){t.exports=function(){"use strict";var t=1e3,e=6e4,n=36e5,o="millisecond",i="second",r="minute",a="hour",s="day",l="week",u="month",c="quarter",d="year",f="date",h="Invalid Date",m=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,g=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,p={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(t){var e=["th","st","nd","rd"],n=t%100;return"["+t+(e[(n-20)%10]||e[n]||e[0])+"]"}},v=function(t,e,n){var o=String(t);return!o||o.length>=e?t:""+Array(e+1-o.length).join(n)+t},y={s:v,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),o=Math.floor(n/60),i=n%60;return(e<=0?"+":"-")+v(o,2,"0")+":"+v(i,2,"0")},m:function t(e,n){if(e.date()<n.date())return-t(n,e);var o=12*(n.year()-e.year())+(n.month()-e.month()),i=e.clone().add(o,u),r=n-i<0,a=e.clone().add(o+(r?-1:1),u);return+(-(o+(n-i)/(r?i-a:a-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(t){return{M:u,y:d,w:l,d:s,D:f,h:a,m:r,s:i,ms:o,Q:c}[t]||String(t||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}},b="en",_={};_[b]=p;var w="$isDayjsObject",M=function(t){return t instanceof O||!(!t||!t[w])},S=function t(e,n,o){var i;if(!e)return b;if("string"==typeof e){var r=e.toLowerCase();_[r]&&(i=r),n&&(_[r]=n,i=r);var a=e.split("-");if(!i&&a.length>1)return t(a[0])}else{var s=e.name;_[s]=e,i=s}return!o&&i&&(b=i),i||!o&&b},x=function(t,e){if(M(t))return t.clone();var n="object"==typeof e?e:{};return n.date=t,n.args=arguments,new O(n)},k=y;k.l=S,k.i=M,k.w=function(t,e){return x(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var O=function(){function p(t){this.$L=S(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[w]=!0}var v=p.prototype;return v.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(k.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var o=e.match(m);if(o){var i=o[2]-1||0,r=(o[7]||"0").substring(0,3);return n?new Date(Date.UTC(o[1],i,o[3]||1,o[4]||0,o[5]||0,o[6]||0,r)):new Date(o[1],i,o[3]||1,o[4]||0,o[5]||0,o[6]||0,r)}}return new Date(e)}(t),this.init()},v.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},v.$utils=function(){return k},v.isValid=function(){return!(this.$d.toString()===h)},v.isSame=function(t,e){var n=x(t);return this.startOf(e)<=n&&n<=this.endOf(e)},v.isAfter=function(t,e){return x(t)<this.startOf(e)},v.isBefore=function(t,e){return this.endOf(e)<x(t)},v.$g=function(t,e,n){return k.u(t)?this[e]:this.set(n,t)},v.unix=function(){return Math.floor(this.valueOf()/1e3)},v.valueOf=function(){return this.$d.getTime()},v.startOf=function(t,e){var n=this,o=!!k.u(e)||e,c=k.p(t),h=function(t,e){var i=k.w(n.$u?Date.UTC(n.$y,e,t):new Date(n.$y,e,t),n);return o?i:i.endOf(s)},m=function(t,e){return k.w(n.toDate()[t].apply(n.toDate("s"),(o?[0,0,0,0]:[23,59,59,999]).slice(e)),n)},g=this.$W,p=this.$M,v=this.$D,y="set"+(this.$u?"UTC":"");switch(c){case d:return o?h(1,0):h(31,11);case u:return o?h(1,p):h(0,p+1);case l:var b=this.$locale().weekStart||0,_=(g<b?g+7:g)-b;return h(o?v-_:v+(6-_),p);case s:case f:return m(y+"Hours",0);case a:return m(y+"Minutes",1);case r:return m(y+"Seconds",2);case i:return m(y+"Milliseconds",3);default:return this.clone()}},v.endOf=function(t){return this.startOf(t,!1)},v.$set=function(t,e){var n,l=k.p(t),c="set"+(this.$u?"UTC":""),h=(n={},n[s]=c+"Date",n[f]=c+"Date",n[u]=c+"Month",n[d]=c+"FullYear",n[a]=c+"Hours",n[r]=c+"Minutes",n[i]=c+"Seconds",n[o]=c+"Milliseconds",n)[l],m=l===s?this.$D+(e-this.$W):e;if(l===u||l===d){var g=this.clone().set(f,1);g.$d[h](m),g.init(),this.$d=g.set(f,Math.min(this.$D,g.daysInMonth())).$d}else h&&this.$d[h](m);return this.init(),this},v.set=function(t,e){return this.clone().$set(t,e)},v.get=function(t){return this[k.p(t)]()},v.add=function(o,c){var f,h=this;o=Number(o);var m=k.p(c),g=function(t){var e=x(h);return k.w(e.date(e.date()+Math.round(t*o)),h)};if(m===u)return this.set(u,this.$M+o);if(m===d)return this.set(d,this.$y+o);if(m===s)return g(1);if(m===l)return g(7);var p=(f={},f[r]=e,f[a]=n,f[i]=t,f)[m]||1,v=this.$d.getTime()+o*p;return k.w(v,this)},v.subtract=function(t,e){return this.add(-1*t,e)},v.format=function(t){var e=this,n=this.$locale();if(!this.isValid())return n.invalidDate||h;var o=t||"YYYY-MM-DDTHH:mm:ssZ",i=k.z(this),r=this.$H,a=this.$m,s=this.$M,l=n.weekdays,u=n.months,c=n.meridiem,d=function(t,n,i,r){return t&&(t[n]||t(e,o))||i[n].slice(0,r)},f=function(t){return k.s(r%12||12,t,"0")},m=c||function(t,e,n){var o=t<12?"AM":"PM";return n?o.toLowerCase():o};return o.replace(g,function(t,o){return o||function(t){switch(t){case"YY":return String(e.$y).slice(-2);case"YYYY":return k.s(e.$y,4,"0");case"M":return s+1;case"MM":return k.s(s+1,2,"0");case"MMM":return d(n.monthsShort,s,u,3);case"MMMM":return d(u,s);case"D":return e.$D;case"DD":return k.s(e.$D,2,"0");case"d":return String(e.$W);case"dd":return d(n.weekdaysMin,e.$W,l,2);case"ddd":return d(n.weekdaysShort,e.$W,l,3);case"dddd":return l[e.$W];case"H":return String(r);case"HH":return k.s(r,2,"0");case"h":return f(1);case"hh":return f(2);case"a":return m(r,a,!0);case"A":return m(r,a,!1);case"m":return String(a);case"mm":return k.s(a,2,"0");case"s":return String(e.$s);case"ss":return k.s(e.$s,2,"0");case"SSS":return k.s(e.$ms,3,"0");case"Z":return i}return null}(t)||i.replace(":","")})},v.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},v.diff=function(o,f,h){var m,g=this,p=k.p(f),v=x(o),y=(v.utcOffset()-this.utcOffset())*e,b=this-v,_=function(){return k.m(g,v)};switch(p){case d:m=_()/12;break;case u:m=_();break;case c:m=_()/3;break;case l:m=(b-y)/6048e5;break;case s:m=(b-y)/864e5;break;case a:m=b/n;break;case r:m=b/e;break;case i:m=b/t;break;default:m=b}return h?m:k.a(m)},v.daysInMonth=function(){return this.endOf(u).$D},v.$locale=function(){return _[this.$L]},v.locale=function(t,e){if(!t)return this.$L;var n=this.clone(),o=S(t,e,!0);return o&&(n.$L=o),n},v.clone=function(){return k.w(this.$d,this)},v.toDate=function(){return new Date(this.valueOf())},v.toJSON=function(){return this.isValid()?this.toISOString():null},v.toISOString=function(){return this.$d.toISOString()},v.toString=function(){return this.$d.toUTCString()},p}(),L=O.prototype;return x.prototype=L,[["$ms",o],["$s",i],["$m",r],["$H",a],["$W",s],["$M",u],["$y",d],["$D",f]].forEach(function(t){L[t[1]]=function(e){return this.$g(e,t[0],t[1])}}),x.extend=function(t,e){return t.$i||(t(e,O,x),t.$i=!0),x},x.locale=S,x.isDayjs=M,x.unix=function(t){return x(1e3*t)},x.en=_[b],x.Ls=_,x.p={},x}()},373:t=>{t.exports=function(t){var e=Object(t),n=[];for(var o in e)n.unshift(o);return function t(){for(;n.length;)if((o=n.pop())in e)return t.value=o,t.done=!1,t;return t.done=!0,t}},t.exports.__esModule=!0,t.exports.default=t.exports},445:function(t){t.exports=function(){"use strict";var t="minute",e=/[+-]\d\d(?::?\d\d)?/g,n=/([+-]|\d\d)/g;return function(o,i,r){var a=i.prototype;r.utc=function(t){return new i({date:t,utc:!0,args:arguments})},a.utc=function(e){var n=r(this.toDate(),{locale:this.$L,utc:!0});return e?n.add(this.utcOffset(),t):n},a.local=function(){return r(this.toDate(),{locale:this.$L,utc:!1})};var s=a.parse;a.parse=function(t){t.utc&&(this.$u=!0),this.$utils().u(t.$offset)||(this.$offset=t.$offset),s.call(this,t)};var l=a.init;a.init=function(){if(this.$u){var t=this.$d;this.$y=t.getUTCFullYear(),this.$M=t.getUTCMonth(),this.$D=t.getUTCDate(),this.$W=t.getUTCDay(),this.$H=t.getUTCHours(),this.$m=t.getUTCMinutes(),this.$s=t.getUTCSeconds(),this.$ms=t.getUTCMilliseconds()}else l.call(this)};var u=a.utcOffset;a.utcOffset=function(o,i){var r=this.$utils().u;if(r(o))return this.$u?0:r(this.$offset)?u.call(this):this.$offset;if("string"==typeof o&&(o=function(t){void 0===t&&(t="");var o=t.match(e);if(!o)return null;var i=(""+o[0]).match(n)||["-",0,0],r=i[0],a=60*+i[1]+ +i[2];return 0===a?0:"+"===r?a:-a}(o),null===o))return this;var a=Math.abs(o)<=16?60*o:o;if(0===a)return this.utc(i);var s=this.clone();if(i)return s.$offset=a,s.$u=!1,s;var l=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();return(s=this.local().add(a+l,t)).$offset=a,s.$x.$localOffset=l,s};var c=a.format;a.format=function(t){var e=t||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return c.call(this,e)},a.valueOf=function(){var t=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*t},a.isUTC=function(){return!!this.$u},a.toISOString=function(){return this.toDate().toISOString()},a.toString=function(){return this.toDate().toUTCString()};var d=a.toDate;a.toDate=function(t){return"s"===t&&this.$offset?r(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():d.call(this)};var f=a.diff;a.diff=function(t,e,n){if(t&&this.$u===t.$u)return f.call(this,t,e,n);var o=this.local(),i=r(t).local();return f.call(o,i,e,n)}}}()},494:function(t,e,n){t.exports=function(t){"use strict";function e(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var n=e(t),o={s:"ein paar Sekunden",m:["eine Minute","einer Minute"],mm:"%d Minuten",h:["eine Stunde","einer Stunde"],hh:"%d Stunden",d:["ein Tag","einem Tag"],dd:["%d Tage","%d Tagen"],M:["ein Monat","einem Monat"],MM:["%d Monate","%d Monaten"],y:["ein Jahr","einem Jahr"],yy:["%d Jahre","%d Jahren"]};function i(t,e,n){var i=o[n];return Array.isArray(i)&&(i=i[e?0:1]),i.replace("%d",t)}var r={name:"de",weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So._Mo._Di._Mi._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),months:"Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Feb._März_Apr._Mai_Juni_Juli_Aug._Sept._Okt._Nov._Dez.".split("_"),ordinal:function(t){return t+"."},weekStart:1,yearStart:4,formats:{LTS:"HH:mm:ss",LT:"HH:mm",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"},relativeTime:{future:"in %s",past:"vor %s",s:i,m:i,mm:i,h:i,hh:i,d:i,dd:i,M:i,MM:i,y:i,yy:i}};return n.default.locale(r,null,!0),r}(n(353))},519:function(t,e,n){t.exports=function(t){"use strict";function e(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var n=e(t),o={name:"it",weekdays:"domenica_lunedì_martedì_mercoledì_giovedì_venerdì_sabato".split("_"),weekdaysShort:"dom_lun_mar_mer_gio_ven_sab".split("_"),weekdaysMin:"do_lu_ma_me_gi_ve_sa".split("_"),months:"gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre".split("_"),weekStart:1,monthsShort:"gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic".split("_"),formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},relativeTime:{future:"tra %s",past:"%s fa",s:"qualche secondo",m:"un minuto",mm:"%d minuti",h:"un'ora",hh:"%d ore",d:"un giorno",dd:"%d giorni",M:"un mese",MM:"%d mesi",y:"un anno",yy:"%d anni"},ordinal:function(t){return t+"º"}};return n.default.locale(o,null,!0),o}(n(353))},546:t=>{function e(n,o,i,r){var a=Object.defineProperty;try{a({},"",{})}catch(n){a=0}t.exports=e=function(t,n,o,i){function r(n,o){e(t,n,function(t){return this._invoke(n,o,t)})}n?a?a(t,n,{value:o,enumerable:!i,configurable:!i,writable:!i}):t[n]=o:(r("next",0),r("throw",1),r("return",2))},t.exports.__esModule=!0,t.exports.default=t.exports,e(n,o,i,r)}t.exports=e,t.exports.__esModule=!0,t.exports.default=t.exports},569:function(t){t.exports=function(){"use strict";var t={year:0,month:1,day:2,hour:3,minute:4,second:5},e={};return function(n,o,i){var r,a=function(t,n,o){void 0===o&&(o={});var i=new Date(t),r=function(t,n){void 0===n&&(n={});var o=n.timeZoneName||"short",i=t+"|"+o,r=e[i];return r||(r=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:t,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:o}),e[i]=r),r}(n,o);return r.formatToParts(i)},s=function(e,n){for(var o=a(e,n),r=[],s=0;s<o.length;s+=1){var l=o[s],u=l.type,c=l.value,d=t[u];d>=0&&(r[d]=parseInt(c,10))}var f=r[3],h=24===f?0:f,m=r[0]+"-"+r[1]+"-"+r[2]+" "+h+":"+r[4]+":"+r[5]+":000",g=+e;return(i.utc(m).valueOf()-(g-=g%1e3))/6e4},l=o.prototype;l.tz=function(t,e){void 0===t&&(t=r);var n,o=this.utcOffset(),a=this.toDate(),s=a.toLocaleString("en-US",{timeZone:t}),l=Math.round((a-new Date(s))/1e3/60),u=15*-Math.round(a.getTimezoneOffset()/15)-l;if(Number(u)){if(n=i(s,{locale:this.$L}).$set("millisecond",this.$ms).utcOffset(u,!0),e){var c=n.utcOffset();n=n.add(o-c,"minute")}}else n=this.utcOffset(0,e);return n.$x.$timezone=t,n},l.offsetName=function(t){var e=this.$x.$timezone||i.tz.guess(),n=a(this.valueOf(),e,{timeZoneName:t}).find(function(t){return"timezonename"===t.type.toLowerCase()});return n&&n.value};var u=l.startOf;l.startOf=function(t,e){if(!this.$x||!this.$x.$timezone)return u.call(this,t,e);var n=i(this.format("YYYY-MM-DD HH:mm:ss:SSS"),{locale:this.$L});return u.call(n,t,e).tz(this.$x.$timezone,!0)},i.tz=function(t,e,n){var o=n&&e,a=n||e||r,l=s(+i(),a);if("string"!=typeof t)return i(t).tz(a);var u=function(t,e,n){var o=t-60*e*1e3,i=s(o,n);if(e===i)return[o,e];var r=s(o-=60*(i-e)*1e3,n);return i===r?[o,i]:[t-60*Math.min(i,r)*1e3,Math.max(i,r)]}(i.utc(t,o).valueOf(),l,a),c=u[0],d=u[1],f=i(c).utcOffset(d);return f.$x.$timezone=a,f},i.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},i.tz.setDefault=function(t){r=t}}}()},579:(t,e,n)=>{var o=n(738).default;t.exports=function(t){if(null!=t){var e=t["function"==typeof Symbol&&Symbol.iterator||"@@iterator"],n=0;if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length))return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}}}throw new TypeError(o(t)+" is not iterable")},t.exports.__esModule=!0,t.exports.default=t.exports},633:(t,e,n)=>{var o=n(172),i=n(993),r=n(869),a=n(887),s=n(791),l=n(373),u=n(579);function c(){"use strict";var e=i(),n=e.m(c),d=(Object.getPrototypeOf?Object.getPrototypeOf(n):n.__proto__).constructor;function f(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===d||"GeneratorFunction"===(e.displayName||e.name))}var h={throw:1,return:2,break:3,continue:3};function m(t){var e,n;return function(o){e||(e={stop:function(){return n(o.a,2)},catch:function(){return o.v},abrupt:function(t,e){return n(o.a,h[t],e)},delegateYield:function(t,i,r){return e.resultName=i,n(o.d,u(t),r)},finish:function(t){return n(o.f,t)}},n=function(t,n,i){o.p=e.prev,o.n=e.next;try{return t(n,i)}finally{e.next=o.n}}),e.resultName&&(e[e.resultName]=o.v,e.resultName=void 0),e.sent=o.v,e.next=o.n;try{return t.call(this,e)}finally{o.p=e.prev,o.n=e.next}}}return(t.exports=c=function(){return{wrap:function(t,n,o,i){return e.w(m(t),n,o,i&&i.reverse())},isGeneratorFunction:f,mark:e.m,awrap:function(t,e){return new o(t,e)},AsyncIterator:s,async:function(t,e,n,o,i){return(f(e)?a:r)(m(t),e,n,o,i)},keys:l,values:u}},t.exports.__esModule=!0,t.exports.default=t.exports)()}t.exports=c,t.exports.__esModule=!0,t.exports.default=t.exports},738:t=>{function e(n){return t.exports=e="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.exports.__esModule=!0,t.exports.default=t.exports,e(n)}t.exports=e,t.exports.__esModule=!0,t.exports.default=t.exports},756:(t,e,n)=>{var o=n(633)();t.exports=o;try{regeneratorRuntime=o}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=o:Function("r","regeneratorRuntime = r")(o)}},791:(t,e,n)=>{var o=n(172),i=n(546);t.exports=function t(e,n){function r(t,i,a,s){try{var l=e[t](i),u=l.value;return u instanceof o?n.resolve(u.v).then(function(t){r("next",t,a,s)},function(t){r("throw",t,a,s)}):n.resolve(u).then(function(t){l.value=t,a(l)},function(t){return r("throw",t,a,s)})}catch(t){s(t)}}var a;this.next||(i(t.prototype),i(t.prototype,"function"==typeof Symbol&&Symbol.asyncIterator||"@asyncIterator",function(){return this})),i(this,"_invoke",function(t,e,o){function i(){return new n(function(e,n){r(t,o,e,n)})}return a=a?a.then(i,i):i()},!0)},t.exports.__esModule=!0,t.exports.default=t.exports},813:function(t,e,n){t.exports=function(t){"use strict";function e(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var n=e(t),o={name:"fr",weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),weekdaysMin:"di_lu_ma_me_je_ve_sa".split("_"),months:"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),monthsShort:"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),weekStart:1,yearStart:4,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"},ordinal:function(t){return t+(1===t?"er":"")}};return n.default.locale(o,null,!0),o}(n(353))},826:function(t){t.exports=function(){"use strict";return{name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(t){var e=["th","st","nd","rd"],n=t%100;return"["+t+(e[(n-20)%10]||e[n]||e[0])+"]"}}}()},840:function(t){t.exports=function(){"use strict";return function(t,e,n){var o=e.prototype,i=function(t){return t&&(t.indexOf?t:t.s)},r=function(t,e,n,o,r){var a=t.name?t:t.$locale(),s=i(a[e]),l=i(a[n]),u=s||l.map(function(t){return t.slice(0,o)});if(!r)return u;var c=a.weekStart;return u.map(function(t,e){return u[(e+(c||0))%7]})},a=function(){return n.Ls[n.locale()]},s=function(t,e){return t.formats[e]||function(t){return t.replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(t,e,n){return e||n.slice(1)})}(t.formats[e.toUpperCase()])},l=function(){var t=this;return{months:function(e){return e?e.format("MMMM"):r(t,"months")},monthsShort:function(e){return e?e.format("MMM"):r(t,"monthsShort","months",3)},firstDayOfWeek:function(){return t.$locale().weekStart||0},weekdays:function(e){return e?e.format("dddd"):r(t,"weekdays")},weekdaysMin:function(e){return e?e.format("dd"):r(t,"weekdaysMin","weekdays",2)},weekdaysShort:function(e){return e?e.format("ddd"):r(t,"weekdaysShort","weekdays",3)},longDateFormat:function(e){return s(t.$locale(),e)},meridiem:this.$locale().meridiem,ordinal:this.$locale().ordinal}};o.localeData=function(){return l.bind(this)()},n.localeData=function(){var t=a();return{firstDayOfWeek:function(){return t.weekStart||0},weekdays:function(){return n.weekdays()},weekdaysShort:function(){return n.weekdaysShort()},weekdaysMin:function(){return n.weekdaysMin()},months:function(){return n.months()},monthsShort:function(){return n.monthsShort()},longDateFormat:function(e){return s(t,e)},meridiem:t.meridiem,ordinal:t.ordinal}},n.months=function(){return r(a(),"months")},n.monthsShort=function(){return r(a(),"monthsShort","months",3)},n.weekdays=function(t){return r(a(),"weekdays",null,null,t)},n.weekdaysShort=function(t){return r(a(),"weekdaysShort","weekdays",3,t)},n.weekdaysMin=function(t){return r(a(),"weekdaysMin","weekdays",2,t)}}}()},869:(t,e,n)=>{var o=n(887);t.exports=function(t,e,n,i,r){var a=o(t,e,n,i,r);return a.next().then(function(t){return t.done?t.value:a.next()})},t.exports.__esModule=!0,t.exports.default=t.exports},887:(t,e,n)=>{var o=n(993),i=n(791);t.exports=function(t,e,n,r,a){return new i(o().w(t,e,n,r),a||Promise)},t.exports.__esModule=!0,t.exports.default=t.exports},993:(t,e,n)=>{var o=n(546);function i(){var e,n,r="function"==typeof Symbol?Symbol:{},a=r.iterator||"@@iterator",s=r.toStringTag||"@@toStringTag";function l(t,i,r,a){var s=i&&i.prototype instanceof c?i:c,l=Object.create(s.prototype);return o(l,"_invoke",function(t,o,i){var r,a,s,l=0,c=i||[],d=!1,f={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function(t,n){return r=t,a=0,s=e,f.n=n,u}};function h(t,o){for(a=t,s=o,n=0;!d&&l&&!i&&n<c.length;n++){var i,r=c[n],h=f.p,m=r[2];t>3?(i=m===o)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=e):r[0]<=h&&((i=t<2&&h<r[1])?(a=0,f.v=o,f.n=r[1]):h<m&&(i=t<3||r[0]>o||o>m)&&(r[4]=t,r[5]=o,f.n=m,a=0))}if(i||t>1)return u;throw d=!0,o}return function(i,c,m){if(l>1)throw TypeError("Generator is already running");for(d&&1===c&&h(c,m),a=c,s=m;(n=a<2?e:s)||!d;){r||(a?a<3?(a>1&&(f.n=-1),h(a,s)):f.n=s:f.v=s);try{if(l=2,r){if(a||(i="next"),n=r[i]){if(!(n=n.call(r,s)))throw TypeError("iterator result is not an object");if(!n.done)return n;s=n.value,a<2&&(a=0)}else 1===a&&(n=r.return)&&n.call(r),a<2&&(s=TypeError("The iterator does not provide a '"+i+"' method"),a=1);r=e}else if((n=(d=f.n<0)?s:t.call(o,f))!==u)break}catch(t){r=e,a=1,s=t}finally{l=1}}return{value:n,done:d}}}(t,r,a),!0),l}var u={};function c(){}function d(){}function f(){}n=Object.getPrototypeOf;var h=[][a]?n(n([][a]())):(o(n={},a,function(){return this}),n),m=f.prototype=c.prototype=Object.create(h);function g(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,f):(t.__proto__=f,o(t,s,"GeneratorFunction")),t.prototype=Object.create(m),t}return d.prototype=f,o(m,"constructor",f),o(f,"constructor",d),d.displayName="GeneratorFunction",o(f,s,"GeneratorFunction"),o(m),o(m,s,"Generator"),o(m,a,function(){return this}),o(m,"toString",function(){return"[object Generator]"}),(t.exports=i=function(){return{w:l,m:g}},t.exports.__esModule=!0,t.exports.default=t.exports)()}t.exports=i,t.exports.__esModule=!0,t.exports.default=t.exports}},e={};function n(o){var i=e[o];if(void 0!==i)return i.exports;var r=e[o]={exports:{}};return t[o].call(r.exports,r,r.exports,n),r.exports}n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var o in e)n.o(e,o)&&!n.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:e[o]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var o={};return(()=>{"use strict";function t(t,e,n,o,i,r,a){try{var s=t[r](a),l=s.value}catch(t){return void n(t)}s.done?e(l):Promise.resolve(l).then(o,i)}function e(t){return e="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},e(t)}function i(t){var n=function(t,n){if("object"!=e(t)||!t)return t;var o=t[Symbol.toPrimitive];if(void 0!==o){var i=o.call(t,n||"default");if("object"!=e(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(t)}(t,"string");return"symbol"==e(n)?n:n+""}function r(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,i(o.key),o)}}function a(t,e,n){return(e=i(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}n.r(o),n.d(o,{Languages:()=>v,changeLanguage:()=>Y,close:()=>H,closeEmbed:()=>P,destroy:()=>A,init:()=>T,open:()=>E,openEmbed:()=>N,renderHolidoitEmbed:()=>R,toggle:()=>B,toggleEmbed:()=>j,version:()=>C});var s=n(756),l=n.n(s),u=n(353),c=n.n(u),d=(n(494),n(826),n(317),n(813),n(519),n(840)),f=n.n(d),h=n(569),m=n.n(h),g=n(445),p=n.n(g);c().extend(p()),c().extend(m()),c().extend(f());var v=function(t){return t.ITALIAN="it",t.ENGLISH="en",t.SPANISH="es",t.FRENCH="fr",t.GERMAN="de",t}({}),y=(c()().locale("it").localeData().months(),c()().locale("it").localeData().weekdays(),c()().locale("en").localeData().months(),c()().locale("en").localeData().weekdays(),c()().locale("de").localeData().months(),c()().locale("de").localeData().weekdays(),c()().locale("es").localeData().months(),c()().locale("es").localeData().weekdays(),c()().locale("fr").localeData().months(),c()().locale("fr").localeData().weekdays(),"holidoit-loader-iframe"),b="2.0.0",_="_holidoit_payment_session";function w(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return M(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?M(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var o=0,i=function(){};return{s:i,n:function(){return o>=t.length?{done:!0}:{done:!1,value:t[o++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,r=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw r}}}}function M(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,o=Array(e);n<e;n++)o[n]=t[n];return o}function S(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,o)}return n}function x(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?S(Object(n),!0).forEach(function(e){a(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):S(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}var k=function(){if("undefined"==typeof window)return null;try{var t=new URLSearchParams(window.location.search),e=t.get("payment_intent");if(!e)return null;var n={paymentIntent:e,paymentIntentClientSecret:t.get("payment_intent_client_secret"),redirectStatus:t.get("redirect_status")};"localhost"===window.location.hostname||window.location.hostname;return n}catch(t){return null}}(),O=!1,L=new Set(["holidoitExperienceSelected","holidoitIFrameChangeLanguage","holidoitExperienceCount"]),I=Object.values(v),D=a(a(a(a(a({},v.ITALIAN,"Prenota ora"),v.ENGLISH,"Book now"),v.SPANISH,"Reservar ahora"),v.FRENCH,"Réserver maintenant"),v.GERMAN,"Jetzt buchen"),$=new(function(){return e=function t(){var e=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),a(this,"config",null),a(this,"embedConfig",null),a(this,"iframe",null),a(this,"container",null),a(this,"floatingButton",null),a(this,"isOpen",!1),a(this,"isReady",!1),a(this,"pendingMessages",[]),a(this,"savedViewportContent",null),a(this,"embedOrigin",""),a(this,"resolvedEmbedUrl",""),a(this,"resolvedApiUrl",""),a(this,"htmlLangObserver",null),a(this,"hasExplicitLanguageSelection",!1),a(this,"hasReceivedEmbedReady",!1),a(this,"embedConfigLoaded",!1),a(this,"scrollLockState",null),a(this,"touchMoveHandler",null),a(this,"handleExternalMessage",function(t){var n=t.data;if(n&&"string"==typeof n.action&&L.has(n.action)){var o=null;if(t.source!==window){if(!(o=e.getSenderIframe(t.source)))return void e.log("Ignoring external message from unknown iframe source",n.action);if(o.id===y)return;if(!e.isTrustedHolidoitOrigin(t.origin))return void e.log("Ignoring external message from untrusted origin",t.origin,n.action)}switch(e.log("Received external message",n),n.action){case"holidoitExperienceSelected":n.experienceId&&(e.log("Experience selected from external iframe",n.experienceId),e.open({experienceId:n.experienceId,gift:!!n.gift}));break;case"holidoitIFrameChangeLanguage":n.language&&(e.log("Language change from external iframe",n.language),e.changeLanguage(n.language));break;case"holidoitExperienceCount":if(!o)return;if(e.log("Experience count from external iframe",n.count),"number"==typeof n.height){var i=n.height+16,r=parseInt(o.style.height||"0",10);Math.abs(i-r)>15&&(o.style.height="".concat(i,"px"),e.log("Adjusted iframe height to",i,"for",o.id||o.src))}}}}),a(this,"handleMessage",function(t){var n,o,i,r,a;if(null!==(n=e.iframe)&&void 0!==n&&n.contentWindow&&t.source===e.iframe.contentWindow&&t.origin===e.embedOrigin){var s=t.data;if(s&&s.type&&s.type.startsWith("HOLIDOIT_"))switch(e.log("Received message from embed iframe",s),s.type){case"HOLIDOIT_READY":e.hasReceivedEmbedReady=!0,e.maybeSendInitMessage();break;case"HOLIDOIT_OPENED":break;case"HOLIDOIT_CLOSED":setTimeout(function(){e.close()},300);break;case"HOLIDOIT_BOOKING_COMPLETE":var l=s.payload;e.log("Booking complete",l),null===(o=e.config)||void 0===o||null===(i=o.onBookingComplete)||void 0===i||i.call(o,l);break;case"HOLIDOIT_PAYMENT_REDIRECT_START":var u=s.payload;if(null!=u&&u.session){e.log("Saving payment session for redirect",u.session);try{localStorage.setItem(_,JSON.stringify(u.session))}catch(t){e.log("Failed to save payment session (incognito mode?)",t)}}break;case"HOLIDOIT_LANGUAGE_CHANGED":var c=s.payload,d=e.normalizeLanguage(null==c?void 0:c.language);d&&(e.log("Language changed from embed:",d),e.applyLanguage(d,{markAsExplicit:!0,syncEmbed:!1}),window.postMessage({action:"holidoitEmbedChangeLanguage",language:d},"*"));break;case"HOLIDOIT_ERROR":var f=s.payload;null===(r=e.config)||void 0===r||null===(a=r.onError)||void 0===a||a.call(r,(null==f?void 0:f.message)||"Unknown error");break;case"HOLIDOIT_NAVIGATE_TO":var h=s.payload;null!=h&&h.url&&(e.log("Navigating parent page to:",h.url),window.location.href=h.url)}}})},n=[{key:"isIOSDevice",value:function(){if("undefined"==typeof window||"undefined"==typeof navigator)return!1;var t=navigator.userAgent||"",e=/iPad|iPhone|iPod/.test(t),n="MacIntel"===navigator.platform&&navigator.maxTouchPoints>1;return e||n}},{key:"safeScrollToTop",value:function(t){try{window.scrollTo({left:0,top:t,behavior:"auto"})}catch(e){window.scrollTo(0,t)}}},{key:"init",value:function(t){var e=this;if(t.embedId&&(t.embedId=t.embedId.trim()),t.embedId){if(this.container)return this.log("Holidoit already initialized, skipping duplicate init"),this.config=x(x({},this.config),t),void this.syncLanguageWithDocument();var n=window.scrollY,o=history.scrollRestoration||"auto";try{history.scrollRestoration="manual"}catch(t){this.log("scrollRestoration not supported, continuing without it")}this.hasExplicitLanguageSelection=!1,this.hasReceivedEmbedReady=!1,this.embedConfigLoaded=!1,this.config=x(x({},t),{},{language:this.normalizeLanguage(t.language)||void 0}),this.resolvedEmbedUrl=t.embedUrl||"https://cdn.holidoit.com/embed.html",this.resolvedApiUrl="https://engine.holydoit.com",this.embedOrigin=this.getEmbedOrigin(this.resolvedEmbedUrl),this.log("Initializing Holidoit embed",{embedId:t.embedId,version:b}),this.createContainer(),this.createIframe(),this.safeScrollToTop(n),requestAnimationFrame(function(){try{history.scrollRestoration=o}catch(t){}}),this.setupMessageListener(),this.observeDocumentLanguage();var i=function(){e.bindBookNowButtons(),e.observeForBookNowButtons(),e.interceptHolidoitLinks()};"loading"===document.readyState?document.addEventListener("DOMContentLoaded",i):i(),this.fetchEmbedConfig().then(function(){var n;((null===(n=e.embedConfig)||void 0===n?void 0:n.has_floating_button)||t.floatingButton)&&e.createFloatingButton(),e.maybeSendInitMessage()}),this.checkPaymentRedirect()}}},{key:"fetchEmbedConfig",value:(i=l().mark(function t(){var e,n,o,i,r,a,s;return l().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(null!==(e=this.config)&&void 0!==e&&e.embedId){t.next=1;break}return t.abrupt("return");case 1:return n="".concat(this.resolvedApiUrl,"/partner/v0/embed-config/").concat(this.config.embedId,"/get"),this.log("Fetching embed config from:",n),t.prev=2,t.next=3,fetch(n,{method:"GET",headers:{"Content-Type":"application/json"}});case 3:if((o=t.sent).ok){t.next=4;break}throw new Error("Failed to fetch embed config: ".concat(o.status));case 4:return t.next=5,o.json();case 5:i=t.sent,this.embedConfig=i,this.log("Embed config loaded:",i),r=this.getDocumentLanguage(),a=this.isLanguageSupportedByEmbed(r),!this.hasExplicitLanguageSelection&&r&&a?(this.applyLanguage(r,{markAsExplicit:!1,syncEmbed:this.isReady}),this.log("Language set from <html lang>:",r)):!this.config.language&&i.language&&(this.config.language=i.language,this.log("Language set from API config:",i.language)),i.floating_button_config&&(this.config.floatingButtonOptions=this.mergeFloatingButtonOptions(this.config.floatingButtonOptions,i.floating_button_config),this.log("Merged floating button options:",this.config.floatingButtonOptions)),t.next=7;break;case 6:t.prev=6,s=t.catch(2),this.log("Failed to fetch embed config, using local options:",s);case 7:return t.prev=7,this.embedConfigLoaded=!0,t.finish(7);case 8:case"end":return t.stop()}},t,this,[[2,6,7,8]])}),s=function(){var e=this,n=arguments;return new Promise(function(o,r){var a=i.apply(e,n);function s(e){t(a,o,r,s,l,"next",e)}function l(e){t(a,o,r,s,l,"throw",e)}s(void 0)})},function(){return s.apply(this,arguments)})},{key:"mergeFloatingButtonOptions",value:function(t,e){var n,o,i,r;return t?{desktop:x(x({},t.desktop),e.desktop),mobile:x(x({},t.mobile),e.mobile),zIndex:null!==(n=e.zIndex)&&void 0!==n?n:t.zIndex,callToAction:null!==(o=e.callToAction)&&void 0!==o?o:t.callToAction,italianCallToAction:null!==(i=e.italianCallToAction)&&void 0!==i?i:t.italianCallToAction,englishCallToAction:null!==(r=e.englishCallToAction)&&void 0!==r?r:t.englishCallToAction}:e}},{key:"open",value:function(t){var e,n,o;null!=t&&t.embedId&&(t.embedId=t.embedId.trim()),this.log("Opening embed",t),this.iframe&&this.container&&(this.isOpen=!0,this.container.style.display="block",this.container.style.pointerEvents="auto",this.lockBodyScroll(),this.disableHostZoom(),this.floatingButton&&(this.floatingButton.style.display="none"),this.postMessage({type:"HOLIDOIT_OPEN",payload:{embedId:(null==t?void 0:t.embedId)||(null===(e=this.config)||void 0===e?void 0:e.embedId),experienceId:null==t?void 0:t.experienceId,test:null==t?void 0:t.test,gift:null==t?void 0:t.gift}}),null===(n=this.config)||void 0===n||null===(o=n.onOpen)||void 0===o||o.call(n))}},{key:"close",value:function(){var t,e,n;this.log("Closing embed"),this.isOpen=!1,this.container&&(this.container.style.display="none",this.container.style.pointerEvents="none"),this.unlockBodyScroll(),this.restoreHostZoom(),this.floatingButton&&(this.floatingButton.style.display="flex",this.floatingButton.style.visibility="visible",this.floatingButton.style.opacity="1"),null!==(t=this.iframe)&&void 0!==t&&t.contentWindow&&this.postMessage({type:"HOLIDOIT_CLOSE"}),null===(e=this.config)||void 0===e||null===(n=e.onClose)||void 0===n||n.call(e)}},{key:"toggle",value:function(t){this.isOpen?this.close():this.open(t)}},{key:"changeLanguage",value:function(t){var e=this.normalizeLanguage(t);e?(this.log("Changing language",e),this.applyLanguage(e,{markAsExplicit:!0,syncEmbed:!0})):this.log("Ignoring unsupported language change",t)}},{key:"updateFloatingButtonText",value:function(t){var e,n;if(this.floatingButton&&this.config){var o=this.config.floatingButtonOptions,i=this.resolveFloatingButtonResponsiveOption(null==o||null===(e=o.desktop)||void 0===e?void 0:e.textColor,null==o||null===(n=o.mobile)||void 0===n?void 0:n.textColor,"white"),r=this.getFloatingButtonCallToAction(t),a='<svg style="fill: '.concat(i,' !important;" xmlns="http://www.w3.org/2000/svg" height="19" width="19" viewBox="0 0 448 512"><path style="fill: ').concat(i,' !important;" d="M152 24c0-13.3-10.7-24-24-24s-24 10.7-24 24V64H64C28.7 64 0 92.7 0 128v16 48V448c0 35.3 28.7 64 64 64H384c35.3 0 64-28.7 64-64V192 144 128c0-35.3-28.7-64-64-64H344V24c0-13.3-10.7-24-24-24s-24 10.7-24 24V64H152V24zM48 192H400V448c0 8.8-7.2 16-16 16H64c-8.8 0-16-7.2-16-16V192z"/></svg>');this.floatingButton.innerHTML='<span style="display: flex; align-items: center; gap: 10px; color: '.concat(i," !important; font-family: 'Google Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important; font-size: inherit !important; font-weight: inherit !important;\">").concat(a," ").concat(r,"</span>"),this.log("Updated floating button text to:",r)}}},{key:"destroy",value:function(){this.log("Destroying embed"),this.scrollLockState&&this.unlockBodyScroll(),null!==this.savedViewportContent&&this.restoreHostZoom(),this.container&&(this.container.remove(),this.container=null),this.floatingButton&&(this.floatingButton.remove(),this.floatingButton=null),this.htmlLangObserver&&(this.htmlLangObserver.disconnect(),this.htmlLangObserver=null),this.iframe=null,this.config=null,this.isOpen=!1,this.isReady=!1,this.hasExplicitLanguageSelection=!1,this.hasReceivedEmbedReady=!1,this.embedConfigLoaded=!1,window.removeEventListener("message",this.handleMessage),window.removeEventListener("message",this.handleExternalMessage),this.touchMoveHandler&&(document.removeEventListener("touchmove",this.touchMoveHandler),this.touchMoveHandler=null)}},{key:"createContainer",value:function(){this.container=document.createElement("div"),this.container.id="holidoit-loader-container",this.container.style.cssText="\n position: fixed !important;\n top: 0 !important;\n left: 0 !important;\n width: 100% !important;\n height: 100% !important;\n z-index: 2147483647 !important;\n display: none;\n pointer-events: none;\n ",document.body.appendChild(this.container)}},{key:"createIframe",value:function(){var t=this;this.container&&this.config&&(this.iframe=document.createElement("iframe"),this.iframe.id=y,this.iframe.src=this.resolvedEmbedUrl,this.iframe.allow="payment",this.iframe.setAttribute("tabindex","-1"),this.iframe.style.cssText="\n position: absolute !important;\n top: 0 !important;\n left: 0 !important;\n width: 100% !important;\n height: 100% !important;\n border: none !important;\n background: transparent !important;\n ",this.iframe.setAttribute("sandbox","allow-scripts allow-same-origin allow-forms allow-popups allow-popups-to-escape-sandbox allow-top-navigation-by-user-activation allow-top-navigation"),this.container.appendChild(this.iframe),document.activeElement===this.iframe&&this.iframe.blur(),this.iframe.onload=function(){t.log("Iframe loaded, waiting for HOLIDOIT_READY from embed")})}},{key:"createFloatingButton",value:function(){var t,e,n,o,i,r,a,s,l,u,c,d,f,h,m,g,p,y,b,_,w,M,S,x,k=this;if(this.config){var O=this.config.floatingButtonOptions;this.floatingButton=document.createElement("button"),this.floatingButton.id="holidoit-floating-button";var L=window.innerWidth,I=L<775,D=this.resolveFloatingButtonResponsiveOption(null==O||null===(t=O.desktop)||void 0===t?void 0:t.width,null==O||null===(e=O.mobile)||void 0===e?void 0:e.width,I?L-34:190),$=this.resolveFloatingButtonResponsiveOption(null==O||null===(n=O.desktop)||void 0===n?void 0:n.height,null==O||null===(o=O.mobile)||void 0===o?void 0:o.height,54),T=this.resolveFloatingButtonResponsiveOption(null==O||null===(i=O.desktop)||void 0===i?void 0:i.backgroundColor,null==O||null===(r=O.mobile)||void 0===r?void 0:r.backgroundColor,"#0f172a"),E=this.resolveFloatingButtonResponsiveOption(null==O||null===(a=O.desktop)||void 0===a?void 0:a.textColor,null==O||null===(s=O.mobile)||void 0===s?void 0:s.textColor,"white"),H=this.resolveFloatingButtonResponsiveOption(null==O||null===(l=O.desktop)||void 0===l?void 0:l.borderRounding,null==O||null===(u=O.mobile)||void 0===u?void 0:u.borderRounding,30),B=this.resolveFloatingButtonResponsiveOption(null==O||null===(c=O.desktop)||void 0===c?void 0:c.fontSize,null==O||null===(d=O.mobile)||void 0===d?void 0:d.fontSize,16),Y=this.resolveFloatingButtonResponsiveOption(null==O||null===(f=O.desktop)||void 0===f?void 0:f.fontWeight,null==O||null===(h=O.mobile)||void 0===h?void 0:h.fontWeight,500),A=this.resolveFloatingButtonResponsiveOption(null==O||null===(m=O.desktop)||void 0===m?void 0:m.textCase,null==O||null===(g=O.mobile)||void 0===g?void 0:g.textCase,"none"),C=this.resolveFloatingButtonResponsiveOption(null==O||null===(p=O.desktop)||void 0===p?void 0:p.bottomPosition,null==O||null===(y=O.mobile)||void 0===y?void 0:y.bottomPosition,I?22:30),R=this.resolveFloatingButtonResponsiveOption(null==O||null===(b=O.desktop)||void 0===b?void 0:b.rightPosition,null==O||null===(_=O.mobile)||void 0===_?void 0:_.rightPosition,I?17:30),j=this.resolveFloatingButtonResponsiveOption(null==O||null===(w=O.desktop)||void 0===w?void 0:w.leftPosition,null==O||null===(M=O.mobile)||void 0===M?void 0:M.leftPosition,void 0),N=this.resolveFloatingButtonResponsiveOption(null==O||null===(S=O.desktop)||void 0===S?void 0:S.topPosition,null==O||null===(x=O.mobile)||void 0===x?void 0:x.topPosition,void 0),P=(null==O?void 0:O.zIndex)||2147483646,F=this.config.language||v.ITALIAN,z=this.getFloatingButtonCallToAction(F),U="0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1)",W="#0f172a"===T?"#1e293b":T;this.floatingButton.style.cssText="\n display: flex !important;\n align-items: center !important;\n justify-content: center !important;\n gap: 10px !important;\n position: fixed !important;\n z-index: ".concat(P," !important;\n width: ").concat(D,"px !important;\n height: ").concat($,"px !important;\n background: ").concat(T," !important;\n color: ").concat(E," !important;\n border: none !important;\n border-radius: ").concat(H,"px !important;\n font-size: ").concat(B,"px !important;\n font-weight: ").concat(Y," !important;\n text-transform: ").concat("uppercase"===A?"uppercase":"capitalize"===A?"capitalize":"none"," !important;\n cursor: pointer !important;\n box-shadow: ").concat(U,' !important;\n padding: 12px 24px !important;\n font-family: "Google Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;\n transition: all 200ms cubic-bezier(0.4, 0, 0.2, 1) !important;\n transform: scale(1) !important;\n ').concat(void 0!==C?"bottom: ".concat(C,"px !important;"):"","\n ").concat(void 0!==R?"right: ".concat(R,"px !important;"):"","\n ").concat(void 0!==j?"left: ".concat(j,"px !important;"):"left: auto !important;","\n ").concat(void 0!==N?"top: ".concat(N,"px !important;"):"top: auto !important;","\n "),this.floatingButton.addEventListener("mouseenter",function(){k.floatingButton&&(k.floatingButton.style.background="".concat(W," !important"),k.floatingButton.style.boxShadow="".concat("0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1)"," !important"))}),this.floatingButton.addEventListener("mouseleave",function(){k.floatingButton&&(k.floatingButton.style.background="".concat(T," !important"),k.floatingButton.style.boxShadow="".concat(U," !important"),k.floatingButton.style.transform="scale(1) !important")}),this.floatingButton.addEventListener("mousedown",function(){k.floatingButton&&(k.floatingButton.style.transform="scale(0.98) !important")}),this.floatingButton.addEventListener("mouseup",function(){k.floatingButton&&(k.floatingButton.style.transform="scale(1) !important")});var V='<svg style="fill: '.concat(E,' !important;" xmlns="http://www.w3.org/2000/svg" height="20" width="20" viewBox="0 0 448 512"><path style="fill: ').concat(E,' !important;" d="M152 24c0-13.3-10.7-24-24-24s-24 10.7-24 24V64H64C28.7 64 0 92.7 0 128v16 48V448c0 35.3 28.7 64 64 64H384c35.3 0 64-28.7 64-64V192 144 128c0-35.3-28.7-64-64-64H344V24c0-13.3-10.7-24-24-24s-24 10.7-24 24V64H152V24zM48 192H400V448c0 8.8-7.2 16-16 16H64c-8.8 0-16-7.2-16-16V192z"/></svg>');this.floatingButton.innerHTML='<span style="display: flex; align-items: center; gap: 10px; color: '.concat(E," !important; font-family: 'Google Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important; font-size: inherit !important; font-weight: inherit !important;\">").concat(V," ").concat(z,"</span>"),this.floatingButton.addEventListener("click",function(){return k.open()}),document.body.appendChild(this.floatingButton)}}},{key:"normalizeLanguage",value:function(t){if(!t)return null;var e=t.trim().toLowerCase();if(!e)return null;if(I.includes(e))return e;var n=e.split(/[-_]/)[0];return I.includes(n)?n:null}},{key:"getDocumentLanguage",value:function(){var t;return"undefined"==typeof document?null:this.normalizeLanguage(null===(t=document.documentElement)||void 0===t?void 0:t.lang)}},{key:"syncLanguageWithDocument",value:function(){var t;if(!this.hasExplicitLanguageSelection){var e=this.getDocumentLanguage();e&&this.isLanguageSupportedByEmbed(e)&&(null===(t=this.config)||void 0===t?void 0:t.language)!==e&&(this.applyLanguage(e,{markAsExplicit:!1,syncEmbed:this.isReady}),this.log("Language set from <html lang>:",e))}}},{key:"isLanguageSupportedByEmbed",value:function(t){var e;if(!t)return!1;var n=null===(e=this.embedConfig)||void 0===e?void 0:e.languages;return Array.isArray(n)&&n.includes(t)}},{key:"observeDocumentLanguage",value:function(){var t=this;"undefined"!=typeof MutationObserver&&"undefined"!=typeof document&&(this.htmlLangObserver&&this.htmlLangObserver.disconnect(),this.htmlLangObserver=new MutationObserver(function(e){var n,o=w(e);try{for(o.s();!(n=o.n()).done;){var i=n.value;if("attributes"===i.type&&"lang"===i.attributeName)return void t.syncLanguageWithDocument()}}catch(t){o.e(t)}finally{o.f()}}),this.htmlLangObserver.observe(document.documentElement,{attributes:!0,attributeFilter:["lang"]}))}},{key:"applyLanguage",value:function(t,e){e.markAsExplicit&&(this.hasExplicitLanguageSelection=!0),this.config&&(this.config.language=t),this.updateFloatingButtonText(t),e.syncEmbed&&this.postMessage({type:"HOLIDOIT_CHANGE_LANGUAGE",payload:{language:t}})}},{key:"getFloatingButtonCallToAction",value:function(t){var e,n=null===(e=this.config)||void 0===e?void 0:e.floatingButtonOptions;return t===v.ITALIAN&&null!=n&&n.italianCallToAction?n.italianCallToAction:t===v.ENGLISH&&null!=n&&n.englishCallToAction?n.englishCallToAction:null!=n&&n.callToAction?n.callToAction:D[t]||D[v.ENGLISH]}},{key:"resolveFloatingButtonResponsiveOption",value:function(t,e,n){return window.innerWidth<775?void 0!==e?e:n:void 0!==t?t:n}},{key:"bindBookNowButtons",value:function(){var t=this,e=document.querySelectorAll(".book-now-button");if(0!==e.length){var n=0;e.forEach(function(e){var o=e,i="_holidoitClickBound";o[i]||(o[i]=!0,n++,o.addEventListener("click",function(e){var n;e.preventDefault(),e.stopPropagation();var i=o.getAttribute("data-product-number")||(null===(n=o.closest("[data-product-number]"))||void 0===n?void 0:n.getAttribute("data-product-number"))||"";t.log("Book now button clicked",{element:o.tagName,productNumber:i});var r=parseInt(i,10);setTimeout(function(){isNaN(r)?t.open():t.open({experienceId:r})},0)}))}),n>0&&this.log("Bound click handlers to ".concat(n," .book-now-button element(s)"))}}},{key:"observeForBookNowButtons",value:function(){var t=this;window._holidoitObserverActive||(window._holidoitObserverActive=!0,new MutationObserver(function(e){for(var n=!1,o=0;o<e.length;o++){var i=e[o];if("childList"===i.type)for(var r=0;r<i.addedNodes.length;r++){var a,s,l=i.addedNodes[r];if(l instanceof HTMLElement&&(null!==(a=l.classList)&&void 0!==a&&a.contains("book-now-button")||null!==(s=l.querySelector)&&void 0!==s&&s.call(l,".book-now-button"))){n=!0;break}}if(n)break}n&&(t.log("Detected dynamically added .book-now-button elements, binding..."),t.bindBookNowButtons())}).observe(document.body,{childList:!0,subtree:!0}),this.log("MutationObserver active for .book-now-button elements"))}},{key:"parseHolidoitEmbedUrl",value:function(t){try{var e=new URL(t),n=e.hostname.replace(/^www\./,"");if("holidoit.com"!==n&&"holido.it"!==n)return null;var o=e.pathname.match(/^\/embed\/web\/([^/]+)\/?$/);if(!o)return null;var i=o[1],r=e.searchParams.get("experienceId"),a=r?parseInt(r,10):void 0;return{embedId:i,experienceId:a&&!isNaN(a)?a:void 0}}catch(t){return null}}},{key:"interceptHolidoitLinks",value:function(){var t=this;document.addEventListener("click",function(e){var n,o,i,r=null===(n=e.target)||void 0===n||null===(o=n.closest)||void 0===o?void 0:o.call(n,"a[href]");if(null!=r&&r.href){var a=t.parseHolidoitEmbedUrl(r.href);a&&a.embedId===(null===(i=t.config)||void 0===i?void 0:i.embedId)&&(e.preventDefault(),e.stopPropagation(),t.log("Intercepted holidoit embed link",a),a.experienceId?t.open({experienceId:a.experienceId}):t.open())}},!0)}},{key:"setupMessageListener",value:function(){window.addEventListener("message",this.handleMessage),window.addEventListener("message",this.handleExternalMessage)}},{key:"getSenderIframe",value:function(t){if(!t)return null;for(var e=0,n=Array.from(document.querySelectorAll("iframe"));e<n.length;e++){var o=n[e];if(o.contentWindow===t)return o}return null}},{key:"isTrustedHolidoitOrigin",value:function(t){if(!t||"null"===t)return!1;if(t===this.embedOrigin)return!0;try{var e=new URL(t).hostname;return"localhost"===e||"127.0.0.1"===e||"holidoit.com"===e||e.endsWith(".holidoit.com")||"holido.it"===e||e.endsWith(".holido.it")||"holydoit.com"===e||e.endsWith(".holydoit.com")}catch(t){return!1}}},{key:"postMessage",value:function(t){var e;return null!==(e=this.iframe)&&void 0!==e&&e.contentWindow?this.isReady||"HOLIDOIT_INIT"===t.type?(this.log("Posting message to iframe",t),void this.iframe.contentWindow.postMessage(t,this.embedOrigin)):(this.log("Embed not ready, queueing message",t),void this.pendingMessages.push(t)):(this.log("Iframe not ready, queueing message",t),void this.pendingMessages.push(t))}},{key:"maybeSendInitMessage",value:function(){var t=this;if(this.hasReceivedEmbedReady&&this.embedConfigLoaded&&!this.isReady&&this.config){this.log("Embed and config are ready, sending HOLIDOIT_INIT");var e="localhost"===window.location.hostname||"127.0.0.1"===window.location.hostname;this.postMessage({type:"HOLIDOIT_INIT",payload:{embedId:this.config.embedId,language:this.config.language,floatingButton:this.config.floatingButton,floatingButtonOptions:this.config.floatingButtonOptions,parentOrigin:window.location.origin,parentUrl:window.location.href,isMobile:window.innerWidth<775,debug:this.config.debug||e}}),this.isReady=!0,this.pendingMessages.forEach(function(e){return t.postMessage(e)}),this.pendingMessages=[]}}},{key:"checkPaymentRedirect",value:function(){var t=this;if(O)this.log("Payment redirect already processed, skipping");else{var e=null,n=null,o=null;if(k)e=k.paymentIntent,n=k.redirectStatus,o=k.paymentIntentClientSecret,this.log("Using captured Stripe params",k);else{var i=new URLSearchParams(window.location.search);e=i.get("payment_intent"),n=i.get("redirect_status"),o=i.get("payment_intent_client_secret")}if(e&&n){this.log("Payment redirect detected",{paymentIntent:e,redirectStatus:n}),O=!0;var r=null;try{r=localStorage.getItem(_)}catch(t){this.log("localStorage not available (incognito mode?)",t)}if(r)try{var a=JSON.parse(r);this.log("Found payment session",a),this.open(),this.isReady?t.postMessage({type:"HOLIDOIT_PAYMENT_REDIRECT",payload:{paymentIntent:e,paymentIntentClientSecret:o||void 0,redirectStatus:n,session:a}}):this.pendingMessages.push({type:"HOLIDOIT_PAYMENT_REDIRECT",payload:{paymentIntent:e,paymentIntentClientSecret:o||void 0,redirectStatus:n,session:a}}),this.cleanUrlParams();try{localStorage.removeItem(_)}catch(t){this.log("Failed to remove payment session from localStorage",t)}}catch(t){this.log("Failed to parse payment session",t)}else this.log("Payment redirect params found but no session - cleaning URL"),this.cleanUrlParams()}}}},{key:"cleanUrlParams",value:function(){var t=new URL(window.location.href);t.searchParams.delete("payment_intent"),t.searchParams.delete("payment_intent_client_secret"),t.searchParams.delete("redirect_status"),window.history.replaceState({},"",t.toString())}},{key:"getEmbedOrigin",value:function(t){try{return new URL(t).origin}catch(t){return window.location.origin}}},{key:"lockBodyScroll",value:function(){var t=this;if(this.scrollLockState)this.log("Scroll already locked, skipping");else{var e=window.innerWidth-document.documentElement.clientWidth,n=window.scrollY;this.scrollLockState={scrollY:n,bodyStyles:{overflow:document.body.style.overflow,overscrollBehavior:document.body.style.overscrollBehavior,paddingRight:document.body.style.paddingRight,position:document.body.style.position,top:document.body.style.top,left:document.body.style.left,right:document.body.style.right},htmlStyles:{overflow:document.documentElement.style.overflow,overscrollBehavior:document.documentElement.style.overscrollBehavior},scrollbarWidth:e},document.documentElement.style.overflow="hidden",document.body.style.overflow="hidden",document.body.style.position="fixed",document.body.style.top="-".concat(n,"px"),document.body.style.left="0",document.body.style.right="0",document.documentElement.style.overscrollBehavior="none",document.body.style.overscrollBehavior="none",e>0&&(document.body.style.paddingRight="".concat(e,"px")),this.touchMoveHandler=function(e){var n,o=e.target;null!==(n=t.container)&&void 0!==n&&n.contains(o)||e.preventDefault()},document.addEventListener("touchmove",this.touchMoveHandler,{passive:!1}),this.log("Scroll locked",{scrollbarWidth:e})}}},{key:"unlockBodyScroll",value:function(){if(this.scrollLockState){var t=this.scrollLockState,e=t.scrollY,n=t.bodyStyles,o=t.htmlStyles;document.body.style.overflow=n.overflow,document.body.style.overscrollBehavior=n.overscrollBehavior,document.body.style.paddingRight=n.paddingRight,document.body.style.position=n.position,document.body.style.top=n.top,document.body.style.left=n.left,document.body.style.right=n.right,document.documentElement.style.overflow=o.overflow,document.documentElement.style.overscrollBehavior=o.overscrollBehavior,this.touchMoveHandler&&(document.removeEventListener("touchmove",this.touchMoveHandler),this.touchMoveHandler=null),this.safeScrollToTop(e),this.scrollLockState=null,this.log("Scroll unlocked")}else this.log("Scroll not locked, skipping unlock")}},{key:"disableHostZoom",value:function(){if(this.isIOSDevice())this.savedViewportContent=null;else{var t=document.querySelector('meta[name="viewport"]');t?(this.savedViewportContent=t.getAttribute("content"),t.setAttribute("content","width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no")):(this.savedViewportContent=null,(t=document.createElement("meta")).name="viewport",t.content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no",document.head.appendChild(t)),this.log("Disabled host page zoom")}}},{key:"restoreHostZoom",value:function(){if(!this.isIOSDevice()){var t=document.querySelector('meta[name="viewport"]');t&&(null!==this.savedViewportContent?t.setAttribute("content",this.savedViewportContent):t.remove()),this.log("Restored host page zoom")}}},{key:"log",value:function(){var t,e="undefined"!=typeof window&&("localhost"===window.location.hostname||"127.0.0.1"===window.location.hostname);if(null!==(t=this.config)&&void 0!==t&&t.debug||e){for(var n,o=arguments.length,i=new Array(o),r=0;r<o;r++)i[r]=arguments[r];(n=console).log.apply(n,["[Holidoit]"].concat(i))}}}],n&&r(e.prototype,n),o&&r(e,o),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,n,o,i,s}()),T=function(t){return $.init(t)},E=function(t){return $.open(t)},H=function(){return $.close()},B=function(t){return $.toggle(t)},Y=function(t){return $.changeLanguage(t)},A=function(){return $.destroy()},C=b,R=function(t,e,n){t&&$.init({embedId:t,floatingButton:null==e||e,floatingButtonOptions:n})},j=function(t,e,n){$.toggle({embedId:t,experienceId:e?parseInt(e,10):void 0,test:n})},N=function(){return $.open()},P=function(){return $.close()},F={init:T,open:E,close:H,toggle:B,changeLanguage:Y,destroy:A,version:C,renderHolidoitEmbed:R,toggleEmbed:j,openEmbed:N,closeEmbed:P};if("undefined"!=typeof window){window.Holidoit=F;var z=document.currentScript,U=function(){var t=window.HolidoitConfig;if(null!=t&&t.embedId)$.init(t);else if(null!=z&&z.getAttribute("data-embed-id")){var e=z.getAttribute("data-embed-id"),n=z.getAttribute("data-floating-button"),o=z.getAttribute("data-language"),i=z.getAttribute("data-embed-url"),r=z.getAttribute("data-debug");$.init({embedId:e,floatingButton:"true"===n,language:o||void 0,embedUrl:i||void 0,debug:"true"===r})}};"loading"===document.readyState?document.addEventListener("DOMContentLoaded",U):U()}})(),o})());
2
+ !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("Holidoit",[],e):"object"==typeof exports?exports.Holidoit=e():t.Holidoit=e()}(this,()=>(()=>{var t={172:t=>{t.exports=function(t,e){this.v=t,this.k=e},t.exports.__esModule=!0,t.exports.default=t.exports},317:function(t,e,n){t.exports=function(t){"use strict";function e(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var n=e(t),o={name:"es",monthsShort:"ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),weekdays:"domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"),weekdaysShort:"dom._lun._mar._mié._jue._vie._sáb.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_sá".split("_"),months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),weekStart:1,formats:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY H:mm",LLLL:"dddd, D [de] MMMM [de] YYYY H:mm"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},ordinal:function(t){return t+"º"}};return n.default.locale(o,null,!0),o}(n(353))},353:function(t){t.exports=function(){"use strict";var t=1e3,e=6e4,n=36e5,o="millisecond",i="second",r="minute",a="hour",s="day",l="week",u="month",c="quarter",d="year",f="date",h="Invalid Date",m=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,g=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,p={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(t){var e=["th","st","nd","rd"],n=t%100;return"["+t+(e[(n-20)%10]||e[n]||e[0])+"]"}},v=function(t,e,n){var o=String(t);return!o||o.length>=e?t:""+Array(e+1-o.length).join(n)+t},y={s:v,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),o=Math.floor(n/60),i=n%60;return(e<=0?"+":"-")+v(o,2,"0")+":"+v(i,2,"0")},m:function t(e,n){if(e.date()<n.date())return-t(n,e);var o=12*(n.year()-e.year())+(n.month()-e.month()),i=e.clone().add(o,u),r=n-i<0,a=e.clone().add(o+(r?-1:1),u);return+(-(o+(n-i)/(r?i-a:a-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(t){return{M:u,y:d,w:l,d:s,D:f,h:a,m:r,s:i,ms:o,Q:c}[t]||String(t||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}},b="en",_={};_[b]=p;var w="$isDayjsObject",M=function(t){return t instanceof O||!(!t||!t[w])},S=function t(e,n,o){var i;if(!e)return b;if("string"==typeof e){var r=e.toLowerCase();_[r]&&(i=r),n&&(_[r]=n,i=r);var a=e.split("-");if(!i&&a.length>1)return t(a[0])}else{var s=e.name;_[s]=e,i=s}return!o&&i&&(b=i),i||!o&&b},x=function(t,e){if(M(t))return t.clone();var n="object"==typeof e?e:{};return n.date=t,n.args=arguments,new O(n)},k=y;k.l=S,k.i=M,k.w=function(t,e){return x(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var O=function(){function p(t){this.$L=S(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[w]=!0}var v=p.prototype;return v.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(k.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var o=e.match(m);if(o){var i=o[2]-1||0,r=(o[7]||"0").substring(0,3);return n?new Date(Date.UTC(o[1],i,o[3]||1,o[4]||0,o[5]||0,o[6]||0,r)):new Date(o[1],i,o[3]||1,o[4]||0,o[5]||0,o[6]||0,r)}}return new Date(e)}(t),this.init()},v.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},v.$utils=function(){return k},v.isValid=function(){return!(this.$d.toString()===h)},v.isSame=function(t,e){var n=x(t);return this.startOf(e)<=n&&n<=this.endOf(e)},v.isAfter=function(t,e){return x(t)<this.startOf(e)},v.isBefore=function(t,e){return this.endOf(e)<x(t)},v.$g=function(t,e,n){return k.u(t)?this[e]:this.set(n,t)},v.unix=function(){return Math.floor(this.valueOf()/1e3)},v.valueOf=function(){return this.$d.getTime()},v.startOf=function(t,e){var n=this,o=!!k.u(e)||e,c=k.p(t),h=function(t,e){var i=k.w(n.$u?Date.UTC(n.$y,e,t):new Date(n.$y,e,t),n);return o?i:i.endOf(s)},m=function(t,e){return k.w(n.toDate()[t].apply(n.toDate("s"),(o?[0,0,0,0]:[23,59,59,999]).slice(e)),n)},g=this.$W,p=this.$M,v=this.$D,y="set"+(this.$u?"UTC":"");switch(c){case d:return o?h(1,0):h(31,11);case u:return o?h(1,p):h(0,p+1);case l:var b=this.$locale().weekStart||0,_=(g<b?g+7:g)-b;return h(o?v-_:v+(6-_),p);case s:case f:return m(y+"Hours",0);case a:return m(y+"Minutes",1);case r:return m(y+"Seconds",2);case i:return m(y+"Milliseconds",3);default:return this.clone()}},v.endOf=function(t){return this.startOf(t,!1)},v.$set=function(t,e){var n,l=k.p(t),c="set"+(this.$u?"UTC":""),h=(n={},n[s]=c+"Date",n[f]=c+"Date",n[u]=c+"Month",n[d]=c+"FullYear",n[a]=c+"Hours",n[r]=c+"Minutes",n[i]=c+"Seconds",n[o]=c+"Milliseconds",n)[l],m=l===s?this.$D+(e-this.$W):e;if(l===u||l===d){var g=this.clone().set(f,1);g.$d[h](m),g.init(),this.$d=g.set(f,Math.min(this.$D,g.daysInMonth())).$d}else h&&this.$d[h](m);return this.init(),this},v.set=function(t,e){return this.clone().$set(t,e)},v.get=function(t){return this[k.p(t)]()},v.add=function(o,c){var f,h=this;o=Number(o);var m=k.p(c),g=function(t){var e=x(h);return k.w(e.date(e.date()+Math.round(t*o)),h)};if(m===u)return this.set(u,this.$M+o);if(m===d)return this.set(d,this.$y+o);if(m===s)return g(1);if(m===l)return g(7);var p=(f={},f[r]=e,f[a]=n,f[i]=t,f)[m]||1,v=this.$d.getTime()+o*p;return k.w(v,this)},v.subtract=function(t,e){return this.add(-1*t,e)},v.format=function(t){var e=this,n=this.$locale();if(!this.isValid())return n.invalidDate||h;var o=t||"YYYY-MM-DDTHH:mm:ssZ",i=k.z(this),r=this.$H,a=this.$m,s=this.$M,l=n.weekdays,u=n.months,c=n.meridiem,d=function(t,n,i,r){return t&&(t[n]||t(e,o))||i[n].slice(0,r)},f=function(t){return k.s(r%12||12,t,"0")},m=c||function(t,e,n){var o=t<12?"AM":"PM";return n?o.toLowerCase():o};return o.replace(g,function(t,o){return o||function(t){switch(t){case"YY":return String(e.$y).slice(-2);case"YYYY":return k.s(e.$y,4,"0");case"M":return s+1;case"MM":return k.s(s+1,2,"0");case"MMM":return d(n.monthsShort,s,u,3);case"MMMM":return d(u,s);case"D":return e.$D;case"DD":return k.s(e.$D,2,"0");case"d":return String(e.$W);case"dd":return d(n.weekdaysMin,e.$W,l,2);case"ddd":return d(n.weekdaysShort,e.$W,l,3);case"dddd":return l[e.$W];case"H":return String(r);case"HH":return k.s(r,2,"0");case"h":return f(1);case"hh":return f(2);case"a":return m(r,a,!0);case"A":return m(r,a,!1);case"m":return String(a);case"mm":return k.s(a,2,"0");case"s":return String(e.$s);case"ss":return k.s(e.$s,2,"0");case"SSS":return k.s(e.$ms,3,"0");case"Z":return i}return null}(t)||i.replace(":","")})},v.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},v.diff=function(o,f,h){var m,g=this,p=k.p(f),v=x(o),y=(v.utcOffset()-this.utcOffset())*e,b=this-v,_=function(){return k.m(g,v)};switch(p){case d:m=_()/12;break;case u:m=_();break;case c:m=_()/3;break;case l:m=(b-y)/6048e5;break;case s:m=(b-y)/864e5;break;case a:m=b/n;break;case r:m=b/e;break;case i:m=b/t;break;default:m=b}return h?m:k.a(m)},v.daysInMonth=function(){return this.endOf(u).$D},v.$locale=function(){return _[this.$L]},v.locale=function(t,e){if(!t)return this.$L;var n=this.clone(),o=S(t,e,!0);return o&&(n.$L=o),n},v.clone=function(){return k.w(this.$d,this)},v.toDate=function(){return new Date(this.valueOf())},v.toJSON=function(){return this.isValid()?this.toISOString():null},v.toISOString=function(){return this.$d.toISOString()},v.toString=function(){return this.$d.toUTCString()},p}(),L=O.prototype;return x.prototype=L,[["$ms",o],["$s",i],["$m",r],["$H",a],["$W",s],["$M",u],["$y",d],["$D",f]].forEach(function(t){L[t[1]]=function(e){return this.$g(e,t[0],t[1])}}),x.extend=function(t,e){return t.$i||(t(e,O,x),t.$i=!0),x},x.locale=S,x.isDayjs=M,x.unix=function(t){return x(1e3*t)},x.en=_[b],x.Ls=_,x.p={},x}()},373:t=>{t.exports=function(t){var e=Object(t),n=[];for(var o in e)n.unshift(o);return function t(){for(;n.length;)if((o=n.pop())in e)return t.value=o,t.done=!1,t;return t.done=!0,t}},t.exports.__esModule=!0,t.exports.default=t.exports},445:function(t){t.exports=function(){"use strict";var t="minute",e=/[+-]\d\d(?::?\d\d)?/g,n=/([+-]|\d\d)/g;return function(o,i,r){var a=i.prototype;r.utc=function(t){return new i({date:t,utc:!0,args:arguments})},a.utc=function(e){var n=r(this.toDate(),{locale:this.$L,utc:!0});return e?n.add(this.utcOffset(),t):n},a.local=function(){return r(this.toDate(),{locale:this.$L,utc:!1})};var s=a.parse;a.parse=function(t){t.utc&&(this.$u=!0),this.$utils().u(t.$offset)||(this.$offset=t.$offset),s.call(this,t)};var l=a.init;a.init=function(){if(this.$u){var t=this.$d;this.$y=t.getUTCFullYear(),this.$M=t.getUTCMonth(),this.$D=t.getUTCDate(),this.$W=t.getUTCDay(),this.$H=t.getUTCHours(),this.$m=t.getUTCMinutes(),this.$s=t.getUTCSeconds(),this.$ms=t.getUTCMilliseconds()}else l.call(this)};var u=a.utcOffset;a.utcOffset=function(o,i){var r=this.$utils().u;if(r(o))return this.$u?0:r(this.$offset)?u.call(this):this.$offset;if("string"==typeof o&&(o=function(t){void 0===t&&(t="");var o=t.match(e);if(!o)return null;var i=(""+o[0]).match(n)||["-",0,0],r=i[0],a=60*+i[1]+ +i[2];return 0===a?0:"+"===r?a:-a}(o),null===o))return this;var a=Math.abs(o)<=16?60*o:o;if(0===a)return this.utc(i);var s=this.clone();if(i)return s.$offset=a,s.$u=!1,s;var l=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();return(s=this.local().add(a+l,t)).$offset=a,s.$x.$localOffset=l,s};var c=a.format;a.format=function(t){var e=t||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return c.call(this,e)},a.valueOf=function(){var t=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*t},a.isUTC=function(){return!!this.$u},a.toISOString=function(){return this.toDate().toISOString()},a.toString=function(){return this.toDate().toUTCString()};var d=a.toDate;a.toDate=function(t){return"s"===t&&this.$offset?r(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():d.call(this)};var f=a.diff;a.diff=function(t,e,n){if(t&&this.$u===t.$u)return f.call(this,t,e,n);var o=this.local(),i=r(t).local();return f.call(o,i,e,n)}}}()},494:function(t,e,n){t.exports=function(t){"use strict";function e(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var n=e(t),o={s:"ein paar Sekunden",m:["eine Minute","einer Minute"],mm:"%d Minuten",h:["eine Stunde","einer Stunde"],hh:"%d Stunden",d:["ein Tag","einem Tag"],dd:["%d Tage","%d Tagen"],M:["ein Monat","einem Monat"],MM:["%d Monate","%d Monaten"],y:["ein Jahr","einem Jahr"],yy:["%d Jahre","%d Jahren"]};function i(t,e,n){var i=o[n];return Array.isArray(i)&&(i=i[e?0:1]),i.replace("%d",t)}var r={name:"de",weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So._Mo._Di._Mi._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),months:"Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Feb._März_Apr._Mai_Juni_Juli_Aug._Sept._Okt._Nov._Dez.".split("_"),ordinal:function(t){return t+"."},weekStart:1,yearStart:4,formats:{LTS:"HH:mm:ss",LT:"HH:mm",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"},relativeTime:{future:"in %s",past:"vor %s",s:i,m:i,mm:i,h:i,hh:i,d:i,dd:i,M:i,MM:i,y:i,yy:i}};return n.default.locale(r,null,!0),r}(n(353))},546:t=>{function e(n,o,i,r){var a=Object.defineProperty;try{a({},"",{})}catch(n){a=0}t.exports=e=function(t,n,o,i){function r(n,o){e(t,n,function(t){return this._invoke(n,o,t)})}n?a?a(t,n,{value:o,enumerable:!i,configurable:!i,writable:!i}):t[n]=o:(r("next",0),r("throw",1),r("return",2))},t.exports.__esModule=!0,t.exports.default=t.exports,e(n,o,i,r)}t.exports=e,t.exports.__esModule=!0,t.exports.default=t.exports},569:function(t){t.exports=function(){"use strict";var t={year:0,month:1,day:2,hour:3,minute:4,second:5},e={};return function(n,o,i){var r,a=function(t,n,o){void 0===o&&(o={});var i=new Date(t),r=function(t,n){void 0===n&&(n={});var o=n.timeZoneName||"short",i=t+"|"+o,r=e[i];return r||(r=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:t,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:o}),e[i]=r),r}(n,o);return r.formatToParts(i)},s=function(e,n){for(var o=a(e,n),r=[],s=0;s<o.length;s+=1){var l=o[s],u=l.type,c=l.value,d=t[u];d>=0&&(r[d]=parseInt(c,10))}var f=r[3],h=24===f?0:f,m=r[0]+"-"+r[1]+"-"+r[2]+" "+h+":"+r[4]+":"+r[5]+":000",g=+e;return(i.utc(m).valueOf()-(g-=g%1e3))/6e4},l=o.prototype;l.tz=function(t,e){void 0===t&&(t=r);var n,o=this.utcOffset(),a=this.toDate(),s=a.toLocaleString("en-US",{timeZone:t}),l=Math.round((a-new Date(s))/1e3/60),u=15*-Math.round(a.getTimezoneOffset()/15)-l;if(Number(u)){if(n=i(s,{locale:this.$L}).$set("millisecond",this.$ms).utcOffset(u,!0),e){var c=n.utcOffset();n=n.add(o-c,"minute")}}else n=this.utcOffset(0,e);return n.$x.$timezone=t,n},l.offsetName=function(t){var e=this.$x.$timezone||i.tz.guess(),n=a(this.valueOf(),e,{timeZoneName:t}).find(function(t){return"timezonename"===t.type.toLowerCase()});return n&&n.value};var u=l.startOf;l.startOf=function(t,e){if(!this.$x||!this.$x.$timezone)return u.call(this,t,e);var n=i(this.format("YYYY-MM-DD HH:mm:ss:SSS"),{locale:this.$L});return u.call(n,t,e).tz(this.$x.$timezone,!0)},i.tz=function(t,e,n){var o=n&&e,a=n||e||r,l=s(+i(),a);if("string"!=typeof t)return i(t).tz(a);var u=function(t,e,n){var o=t-60*e*1e3,i=s(o,n);if(e===i)return[o,e];var r=s(o-=60*(i-e)*1e3,n);return i===r?[o,i]:[t-60*Math.min(i,r)*1e3,Math.max(i,r)]}(i.utc(t,o).valueOf(),l,a),c=u[0],d=u[1],f=i(c).utcOffset(d);return f.$x.$timezone=a,f},i.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},i.tz.setDefault=function(t){r=t}}}()},579:(t,e,n)=>{var o=n(738).default;t.exports=function(t){if(null!=t){var e=t["function"==typeof Symbol&&Symbol.iterator||"@@iterator"],n=0;if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length))return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}}}throw new TypeError(o(t)+" is not iterable")},t.exports.__esModule=!0,t.exports.default=t.exports},633:(t,e,n)=>{var o=n(172),i=n(993),r=n(869),a=n(887),s=n(791),l=n(373),u=n(579);function c(){"use strict";var e=i(),n=e.m(c),d=(Object.getPrototypeOf?Object.getPrototypeOf(n):n.__proto__).constructor;function f(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===d||"GeneratorFunction"===(e.displayName||e.name))}var h={throw:1,return:2,break:3,continue:3};function m(t){var e,n;return function(o){e||(e={stop:function(){return n(o.a,2)},catch:function(){return o.v},abrupt:function(t,e){return n(o.a,h[t],e)},delegateYield:function(t,i,r){return e.resultName=i,n(o.d,u(t),r)},finish:function(t){return n(o.f,t)}},n=function(t,n,i){o.p=e.prev,o.n=e.next;try{return t(n,i)}finally{e.next=o.n}}),e.resultName&&(e[e.resultName]=o.v,e.resultName=void 0),e.sent=o.v,e.next=o.n;try{return t.call(this,e)}finally{o.p=e.prev,o.n=e.next}}}return(t.exports=c=function(){return{wrap:function(t,n,o,i){return e.w(m(t),n,o,i&&i.reverse())},isGeneratorFunction:f,mark:e.m,awrap:function(t,e){return new o(t,e)},AsyncIterator:s,async:function(t,e,n,o,i){return(f(e)?a:r)(m(t),e,n,o,i)},keys:l,values:u}},t.exports.__esModule=!0,t.exports.default=t.exports)()}t.exports=c,t.exports.__esModule=!0,t.exports.default=t.exports},738:t=>{function e(n){return t.exports=e="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.exports.__esModule=!0,t.exports.default=t.exports,e(n)}t.exports=e,t.exports.__esModule=!0,t.exports.default=t.exports},756:(t,e,n)=>{var o=n(633)();t.exports=o;try{regeneratorRuntime=o}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=o:Function("r","regeneratorRuntime = r")(o)}},791:(t,e,n)=>{var o=n(172),i=n(546);t.exports=function t(e,n){function r(t,i,a,s){try{var l=e[t](i),u=l.value;return u instanceof o?n.resolve(u.v).then(function(t){r("next",t,a,s)},function(t){r("throw",t,a,s)}):n.resolve(u).then(function(t){l.value=t,a(l)},function(t){return r("throw",t,a,s)})}catch(t){s(t)}}var a;this.next||(i(t.prototype),i(t.prototype,"function"==typeof Symbol&&Symbol.asyncIterator||"@asyncIterator",function(){return this})),i(this,"_invoke",function(t,e,o){function i(){return new n(function(e,n){r(t,o,e,n)})}return a=a?a.then(i,i):i()},!0)},t.exports.__esModule=!0,t.exports.default=t.exports},813:function(t,e,n){t.exports=function(t){"use strict";function e(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var n=e(t),o={name:"fr",weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),weekdaysMin:"di_lu_ma_me_je_ve_sa".split("_"),months:"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),monthsShort:"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),weekStart:1,yearStart:4,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"},ordinal:function(t){return t+(1===t?"er":"")}};return n.default.locale(o,null,!0),o}(n(353))},826:function(t){t.exports=function(){"use strict";return{name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(t){var e=["th","st","nd","rd"],n=t%100;return"["+t+(e[(n-20)%10]||e[n]||e[0])+"]"}}}()},840:function(t){t.exports=function(){"use strict";return function(t,e,n){var o=e.prototype,i=function(t){return t&&(t.indexOf?t:t.s)},r=function(t,e,n,o,r){var a=t.name?t:t.$locale(),s=i(a[e]),l=i(a[n]),u=s||l.map(function(t){return t.slice(0,o)});if(!r)return u;var c=a.weekStart;return u.map(function(t,e){return u[(e+(c||0))%7]})},a=function(){return n.Ls[n.locale()]},s=function(t,e){return t.formats[e]||function(t){return t.replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(t,e,n){return e||n.slice(1)})}(t.formats[e.toUpperCase()])},l=function(){var t=this;return{months:function(e){return e?e.format("MMMM"):r(t,"months")},monthsShort:function(e){return e?e.format("MMM"):r(t,"monthsShort","months",3)},firstDayOfWeek:function(){return t.$locale().weekStart||0},weekdays:function(e){return e?e.format("dddd"):r(t,"weekdays")},weekdaysMin:function(e){return e?e.format("dd"):r(t,"weekdaysMin","weekdays",2)},weekdaysShort:function(e){return e?e.format("ddd"):r(t,"weekdaysShort","weekdays",3)},longDateFormat:function(e){return s(t.$locale(),e)},meridiem:this.$locale().meridiem,ordinal:this.$locale().ordinal}};o.localeData=function(){return l.bind(this)()},n.localeData=function(){var t=a();return{firstDayOfWeek:function(){return t.weekStart||0},weekdays:function(){return n.weekdays()},weekdaysShort:function(){return n.weekdaysShort()},weekdaysMin:function(){return n.weekdaysMin()},months:function(){return n.months()},monthsShort:function(){return n.monthsShort()},longDateFormat:function(e){return s(t,e)},meridiem:t.meridiem,ordinal:t.ordinal}},n.months=function(){return r(a(),"months")},n.monthsShort=function(){return r(a(),"monthsShort","months",3)},n.weekdays=function(t){return r(a(),"weekdays",null,null,t)},n.weekdaysShort=function(t){return r(a(),"weekdaysShort","weekdays",3,t)},n.weekdaysMin=function(t){return r(a(),"weekdaysMin","weekdays",2,t)}}}()},869:(t,e,n)=>{var o=n(887);t.exports=function(t,e,n,i,r){var a=o(t,e,n,i,r);return a.next().then(function(t){return t.done?t.value:a.next()})},t.exports.__esModule=!0,t.exports.default=t.exports},887:(t,e,n)=>{var o=n(993),i=n(791);t.exports=function(t,e,n,r,a){return new i(o().w(t,e,n,r),a||Promise)},t.exports.__esModule=!0,t.exports.default=t.exports},900:function(t,e,n){t.exports=function(t){"use strict";function e(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var n=e(t),o={name:"it",weekdays:"domenica_lunedì_martedì_mercoledì_giovedì_venerdì_sabato".split("_"),weekdaysShort:"dom_lun_mar_mer_gio_ven_sab".split("_"),weekdaysMin:"do_lu_ma_me_gi_ve_sa".split("_"),months:"gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre".split("_"),weekStart:1,monthsShort:"gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic".split("_"),formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},relativeTime:{future:"tra %s",past:"%s fa",s:"qualche secondo",m:"un minuto",mm:"%d minuti",h:"un'ora",hh:"%d ore",d:"un giorno",dd:"%d giorni",M:"un mese",MM:"%d mesi",y:"un anno",yy:"%d anni"},ordinal:function(t){return t+"º"}};return n.default.locale(o,null,!0),o}(n(353))},993:(t,e,n)=>{var o=n(546);function i(){var e,n,r="function"==typeof Symbol?Symbol:{},a=r.iterator||"@@iterator",s=r.toStringTag||"@@toStringTag";function l(t,i,r,a){var s=i&&i.prototype instanceof c?i:c,l=Object.create(s.prototype);return o(l,"_invoke",function(t,o,i){var r,a,s,l=0,c=i||[],d=!1,f={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function(t,n){return r=t,a=0,s=e,f.n=n,u}};function h(t,o){for(a=t,s=o,n=0;!d&&l&&!i&&n<c.length;n++){var i,r=c[n],h=f.p,m=r[2];t>3?(i=m===o)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=e):r[0]<=h&&((i=t<2&&h<r[1])?(a=0,f.v=o,f.n=r[1]):h<m&&(i=t<3||r[0]>o||o>m)&&(r[4]=t,r[5]=o,f.n=m,a=0))}if(i||t>1)return u;throw d=!0,o}return function(i,c,m){if(l>1)throw TypeError("Generator is already running");for(d&&1===c&&h(c,m),a=c,s=m;(n=a<2?e:s)||!d;){r||(a?a<3?(a>1&&(f.n=-1),h(a,s)):f.n=s:f.v=s);try{if(l=2,r){if(a||(i="next"),n=r[i]){if(!(n=n.call(r,s)))throw TypeError("iterator result is not an object");if(!n.done)return n;s=n.value,a<2&&(a=0)}else 1===a&&(n=r.return)&&n.call(r),a<2&&(s=TypeError("The iterator does not provide a '"+i+"' method"),a=1);r=e}else if((n=(d=f.n<0)?s:t.call(o,f))!==u)break}catch(t){r=e,a=1,s=t}finally{l=1}}return{value:n,done:d}}}(t,r,a),!0),l}var u={};function c(){}function d(){}function f(){}n=Object.getPrototypeOf;var h=[][a]?n(n([][a]())):(o(n={},a,function(){return this}),n),m=f.prototype=c.prototype=Object.create(h);function g(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,f):(t.__proto__=f,o(t,s,"GeneratorFunction")),t.prototype=Object.create(m),t}return d.prototype=f,o(m,"constructor",f),o(f,"constructor",d),d.displayName="GeneratorFunction",o(f,s,"GeneratorFunction"),o(m),o(m,s,"Generator"),o(m,a,function(){return this}),o(m,"toString",function(){return"[object Generator]"}),(t.exports=i=function(){return{w:l,m:g}},t.exports.__esModule=!0,t.exports.default=t.exports)()}t.exports=i,t.exports.__esModule=!0,t.exports.default=t.exports}},e={};function n(o){var i=e[o];if(void 0!==i)return i.exports;var r=e[o]={exports:{}};return t[o].call(r.exports,r,r.exports,n),r.exports}n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var o in e)n.o(e,o)&&!n.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:e[o]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var o={};return(()=>{"use strict";function t(t,e,n,o,i,r,a){try{var s=t[r](a),l=s.value}catch(t){return void n(t)}s.done?e(l):Promise.resolve(l).then(o,i)}function e(t){return e="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},e(t)}function i(t){var n=function(t,n){if("object"!=e(t)||!t)return t;var o=t[Symbol.toPrimitive];if(void 0!==o){var i=o.call(t,n||"default");if("object"!=e(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(t)}(t,"string");return"symbol"==e(n)?n:n+""}function r(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,i(o.key),o)}}function a(t,e,n){return(e=i(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}n.r(o),n.d(o,{Languages:()=>I,changeLanguage:()=>z,close:()=>N,closeEmbed:()=>q,destroy:()=>U,init:()=>P,open:()=>j,openEmbed:()=>V,renderHolidoitEmbed:()=>G,toggle:()=>F,toggleEmbed:()=>J,version:()=>W});var s=n(756),l=n.n(s),u="holidoit-loader-iframe",c="2.0.0",d="_holidoit_payment_session";var f="holidoit_analytics_dedupe_keys",h=new Set;function m(t){return"object"===e(t)&&null!==t&&!Array.isArray(t)}function g(){if("undefined"==typeof window)return null;try{return window.sessionStorage}catch(t){return null}}function p(){var t=g();if(!t)return[];try{var e=t.getItem(f);if(!e)return[];var n=JSON.parse(e);return Array.isArray(n)?n.filter(function(t){return"string"==typeof t&&t.length>0}):[]}catch(t){return[]}}function v(t){if(t){h.add(t);var e=p().filter(function(e){return e!==t});e.push(t),function(t){var e=g();if(e)try{e.setItem(f,JSON.stringify(t.slice(-200)))}catch(t){}}(e)}}function y(t,e){return"undefined"!=typeof window&&(!function(t){return!(!t||!h.has(t)&&(!p().includes(t)||(h.add(t),0)))}(e)&&(Array.isArray(window.dataLayer)||(window.dataLayer=[]),v(e),window.dataLayer.push(t),!0))}function b(t){if(!m(t)||"HOLIDOIT_ANALYTICS_EVENT"!==t.type)return null;var e,n=m(t.payload)?t.payload:t,o=n.channel,i=n.dedupeKey,r=n.eventData,a=n.source,s=n.widgetType;return"dataLayer"!==o||"embed"!==a&&"widget"!==a||"string"!=typeof i||""===i.trim()||(!m(e=r)||"string"!=typeof e.event||""===e.event.trim())?null:{channel:o,dedupeKey:i.trim(),eventData:r,source:a,widgetType:"string"==typeof s&&s.trim()?s:void 0}}var _=n(353),w=n.n(_),M=(n(494),n(826),n(317),n(813),n(900),n(840)),S=n.n(M),x=n(569),k=n.n(x),O=n(445),L=n.n(O);w().extend(L()),w().extend(k()),w().extend(S());var I=function(t){return t.ITALIAN="it",t.ENGLISH="en",t.SPANISH="es",t.FRENCH="fr",t.GERMAN="de",t}({});w()().locale("it").localeData().months(),w()().locale("it").localeData().weekdays(),w()().locale("en").localeData().months(),w()().locale("en").localeData().weekdays(),w()().locale("de").localeData().months(),w()().locale("de").localeData().weekdays(),w()().locale("es").localeData().months(),w()().locale("es").localeData().weekdays(),w()().locale("fr").localeData().months(),w()().locale("fr").localeData().weekdays();function D(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return E(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?E(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var o=0,i=function(){};return{s:i,n:function(){return o>=t.length?{done:!0}:{done:!1,value:t[o++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,r=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw r}}}}function E(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,o=Array(e);n<e;n++)o[n]=t[n];return o}function T(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,o)}return n}function $(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?T(Object(n),!0).forEach(function(e){a(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):T(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}var H=function(){if("undefined"==typeof window)return null;try{var t=new URLSearchParams(window.location.search),e=t.get("payment_intent");if(!e)return null;var n={paymentIntent:e,paymentIntentClientSecret:t.get("payment_intent_client_secret"),redirectStatus:t.get("redirect_status")};"localhost"===window.location.hostname||window.location.hostname;return n}catch(t){return null}}(),A=!1,B=new Set(["holidoitExperienceSelected","holidoitIFrameChangeLanguage","holidoitExperienceCount"]),Y=Object.values(I),C=a(a(a(a(a({},I.ITALIAN,"Prenota ora"),I.ENGLISH,"Book now"),I.SPANISH,"Reservar ahora"),I.FRENCH,"Réserver maintenant"),I.GERMAN,"Jetzt buchen");var R=new(function(){return n=function t(){var n=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),a(this,"config",null),a(this,"embedConfig",null),a(this,"iframe",null),a(this,"container",null),a(this,"floatingButton",null),a(this,"isOpen",!1),a(this,"isReady",!1),a(this,"pendingMessages",[]),a(this,"embedOrigin",""),a(this,"resolvedEmbedUrl",""),a(this,"resolvedApiUrl",""),a(this,"htmlLangObserver",null),a(this,"hasExplicitLanguageSelection",!1),a(this,"hasReceivedEmbedReady",!1),a(this,"embedConfigLoaded",!1),a(this,"previouslyFocusedElement",null),a(this,"scrollLockState",null),a(this,"touchMoveHandler",null),a(this,"handleExternalMessage",function(t){var e=t.data;if(e&&"string"==typeof e.action&&B.has(e.action)){var o=null;if(t.source!==window){if(!(o=n.getSenderIframe(t.source)))return void n.log("Ignoring external message from unknown iframe source",e.action);if(o.id===u)return;if(!n.isTrustedHolidoitOrigin(t.origin))return void n.log("Ignoring external message from untrusted origin",t.origin,e.action)}switch(n.log("Received external message",e),e.action){case"holidoitExperienceSelected":e.experienceId&&(n.log("Experience selected from external iframe",e.experienceId),n.open({experienceId:e.experienceId,gift:!!e.gift}));break;case"holidoitIFrameChangeLanguage":e.language&&(n.log("Language change from external iframe",e.language),n.changeLanguage(e.language));break;case"holidoitExperienceCount":if(!o)return;if(n.log("Experience count from external iframe",e.count),"number"==typeof e.height){var i=e.height+16,r=parseInt(o.style.height||"0",10);Math.abs(i-r)>15&&(o.style.height="".concat(i,"px"),n.log("Adjusted iframe height to",i,"for",o.id||o.src))}}}}),a(this,"handleMessage",function(t){var o,i,r,a;if(n.isMessageFromOwnEmbedIframe(t)){var s,l=t.data;if("object"===e(s=l)&&null!==s&&!Array.isArray(s)&&"string"==typeof l.type&&l.type.startsWith("HOLIDOIT_")&&(n.log("Received message from embed iframe",l),!n.handleAnalyticsMessage(l)))switch(l.type){case"HOLIDOIT_READY":n.hasReceivedEmbedReady=!0,n.maybeSendInitMessage();break;case"HOLIDOIT_OPENED":break;case"HOLIDOIT_CLOSED":setTimeout(function(){n.close()},300);break;case"HOLIDOIT_BOOKING_COMPLETE":var u=l.payload;n.log("Booking complete",u),null===(o=n.config)||void 0===o||null===(i=o.onBookingComplete)||void 0===i||i.call(o,u);break;case"HOLIDOIT_PAYMENT_REDIRECT_START":var c=l.payload;if(null!=c&&c.session){n.log("Saving payment session for redirect",c.session);try{localStorage.setItem(d,JSON.stringify(c.session))}catch(t){n.log("Failed to save payment session (incognito mode?)",t)}}break;case"HOLIDOIT_LANGUAGE_CHANGED":var f=l.payload,h=n.normalizeLanguage(null==f?void 0:f.language);h&&(n.log("Language changed from embed:",h),n.applyLanguage(h,{markAsExplicit:!0,syncEmbed:!1}),window.postMessage({action:"holidoitEmbedChangeLanguage",language:h},"*"));break;case"HOLIDOIT_ERROR":var m=l.payload;null===(r=n.config)||void 0===r||null===(a=r.onError)||void 0===a||a.call(r,(null==m?void 0:m.message)||"Unknown error");break;case"HOLIDOIT_NAVIGATE_TO":var g=l.payload;null!=g&&g.url&&(n.log("Navigating parent page to:",g.url),window.location.href=g.url)}}})},o=[{key:"isIOSDevice",value:function(){if("undefined"==typeof window||"undefined"==typeof navigator)return!1;var t=navigator.userAgent||"",e=/iPad|iPhone|iPod/.test(t),n="MacIntel"===navigator.platform&&navigator.maxTouchPoints>1;return e||n}},{key:"safeScrollToPosition",value:function(t,e){var n=null;try{(n=document.createElement("style")).textContent="html, body { scroll-behavior: auto !important; }",(document.head||document.documentElement).appendChild(n),window.scrollTo({left:t,top:e,behavior:"auto"})}catch(n){window.scrollTo(t,e)}finally{n&&requestAnimationFrame(function(){var t;null===(t=n)||void 0===t||t.remove()})}}},{key:"getDocumentScrollRoot",value:function(){var t=document.scrollingElement;return t instanceof HTMLElement?t:document.documentElement}},{key:"isDocumentScrollRoot",value:function(t){return t===this.getDocumentScrollRoot()||t===document.documentElement||t===document.body}},{key:"getScrollPosition",value:function(){return{top:window.scrollY,left:window.scrollX}}},{key:"getScrollbarWidth",value:function(){return window.innerWidth-document.documentElement.clientWidth}},{key:"restoreScrollPosition",value:function(t,e){var n=this.getScrollPosition();(Math.abs(n.top-t)>1||Math.abs(n.left-e)>1)&&this.safeScrollToPosition(e,t)}},{key:"focusWithoutScroll",value:function(t){if(t&&t.isConnected)try{t.focus({preventScroll:!0})}catch(e){t.focus()}}},{key:"init",value:function(t){var e=this;if(t.embedId&&(t.embedId=t.embedId.trim()),t.embedId){if(this.container)return this.log("Holidoit already initialized, skipping duplicate init"),this.config=$($({},this.config),t),void this.syncLanguageWithDocument();var n=window.scrollY,o=history.scrollRestoration||"auto";try{history.scrollRestoration="manual"}catch(t){this.log("scrollRestoration not supported, continuing without it")}this.hasExplicitLanguageSelection=!1,this.hasReceivedEmbedReady=!1,this.embedConfigLoaded=!1,this.config=$($({},t),{},{language:this.normalizeLanguage(t.language)||void 0}),this.resolvedEmbedUrl=t.embedUrl||"https://cdn.holidoit.com/embed.html",this.resolvedApiUrl="https://engine.holydoit.com",this.embedOrigin=this.getEmbedOrigin(this.resolvedEmbedUrl),this.log("Initializing Holidoit embed",{embedId:t.embedId,version:c}),this.createContainer(),this.createIframe(),this.safeScrollToPosition(0,n),requestAnimationFrame(function(){try{history.scrollRestoration=o}catch(t){}}),this.setupMessageListener(),this.observeDocumentLanguage();var i=function(){e.bindBookNowButtons(),e.observeForBookNowButtons(),e.interceptHolidoitLinks()};"loading"===document.readyState?document.addEventListener("DOMContentLoaded",i):i(),this.fetchEmbedConfig().then(function(){var n;((null===(n=e.embedConfig)||void 0===n?void 0:n.has_floating_button)||t.floatingButton)&&e.createFloatingButton(),e.maybeSendInitMessage()}),this.checkPaymentRedirect()}}},{key:"fetchEmbedConfig",value:(s=l().mark(function t(){var e,n,o,i,r,a,s;return l().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(null!==(e=this.config)&&void 0!==e&&e.embedId){t.next=1;break}return t.abrupt("return");case 1:return n="".concat(this.resolvedApiUrl,"/partner/v0/embed-config/").concat(this.config.embedId,"/get"),this.log("Fetching embed config from:",n),t.prev=2,t.next=3,fetch(n,{method:"GET",headers:{"Content-Type":"application/json"}});case 3:if((o=t.sent).ok){t.next=4;break}throw new Error("Failed to fetch embed config: ".concat(o.status));case 4:return t.next=5,o.json();case 5:i=t.sent,this.embedConfig=i,this.log("Embed config loaded:",i),r=this.getDocumentLanguage(),a=this.isLanguageSupportedByEmbed(r),!this.hasExplicitLanguageSelection&&r&&a?(this.applyLanguage(r,{markAsExplicit:!1,syncEmbed:this.isReady}),this.log("Language set from <html lang>:",r)):!this.config.language&&i.language&&(this.config.language=i.language,this.log("Language set from API config:",i.language)),i.floating_button_config&&(this.config.floatingButtonOptions=this.mergeFloatingButtonOptions(this.config.floatingButtonOptions,i.floating_button_config),this.log("Merged floating button options:",this.config.floatingButtonOptions)),t.next=7;break;case 6:t.prev=6,s=t.catch(2),this.log("Failed to fetch embed config, using local options:",s);case 7:return t.prev=7,this.embedConfigLoaded=!0,t.finish(7);case 8:case"end":return t.stop()}},t,this,[[2,6,7,8]])}),f=function(){var e=this,n=arguments;return new Promise(function(o,i){var r=s.apply(e,n);function a(e){t(r,o,i,a,l,"next",e)}function l(e){t(r,o,i,a,l,"throw",e)}a(void 0)})},function(){return f.apply(this,arguments)})},{key:"mergeFloatingButtonOptions",value:function(t,e){var n,o,i,r;return t?{desktop:$($({},t.desktop),e.desktop),mobile:$($({},t.mobile),e.mobile),zIndex:null!==(n=e.zIndex)&&void 0!==n?n:t.zIndex,callToAction:null!==(o=e.callToAction)&&void 0!==o?o:t.callToAction,italianCallToAction:null!==(i=e.italianCallToAction)&&void 0!==i?i:t.italianCallToAction,englishCallToAction:null!==(r=e.englishCallToAction)&&void 0!==r?r:t.englishCallToAction}:e}},{key:"open",value:function(t){var e,n,o;null!=t&&t.embedId&&(t.embedId=t.embedId.trim()),this.log("Opening embed",t),this.iframe&&this.container&&(this.isOpen=!0,this.previouslyFocusedElement=document.activeElement instanceof HTMLElement&&document.activeElement!==document.body&&document.activeElement!==document.documentElement?document.activeElement:null,this.container.style.display="block",this.container.style.pointerEvents="auto",this.lockBodyScroll(),this.floatingButton&&(this.floatingButton.style.display="none"),this.postMessage({type:"HOLIDOIT_OPEN",payload:{embedId:(null==t?void 0:t.embedId)||(null===(e=this.config)||void 0===e?void 0:e.embedId),experienceId:null==t?void 0:t.experienceId,test:null==t?void 0:t.test,gift:null==t?void 0:t.gift}}),null===(n=this.config)||void 0===n||null===(o=n.onOpen)||void 0===o||o.call(n))}},{key:"close",value:function(){var t,e,n;this.log("Closing embed"),this.isOpen=!1,document.activeElement===this.iframe&&this.iframe.blur(),this.focusWithoutScroll(this.previouslyFocusedElement),this.previouslyFocusedElement=null,this.unlockBodyScroll(),this.container&&(this.container.style.display="none",this.container.style.pointerEvents="none"),this.floatingButton&&(this.floatingButton.style.display="flex",this.floatingButton.style.visibility="visible",this.floatingButton.style.opacity="1"),null!==(t=this.iframe)&&void 0!==t&&t.contentWindow&&this.postMessage({type:"HOLIDOIT_CLOSE"}),null===(e=this.config)||void 0===e||null===(n=e.onClose)||void 0===n||n.call(e)}},{key:"toggle",value:function(t){this.isOpen?this.close():this.open(t)}},{key:"changeLanguage",value:function(t){var e=this.normalizeLanguage(t);e?(this.log("Changing language",e),this.applyLanguage(e,{markAsExplicit:!0,syncEmbed:!0})):this.log("Ignoring unsupported language change",t)}},{key:"updateFloatingButtonText",value:function(t){var e,n;if(this.floatingButton&&this.config){var o=this.config.floatingButtonOptions,i=this.resolveFloatingButtonResponsiveOption(null==o||null===(e=o.desktop)||void 0===e?void 0:e.textColor,null==o||null===(n=o.mobile)||void 0===n?void 0:n.textColor,"white"),r=this.getFloatingButtonCallToAction(t),a='<svg style="fill: '.concat(i,' !important;" xmlns="http://www.w3.org/2000/svg" height="19" width="19" viewBox="0 0 448 512"><path style="fill: ').concat(i,' !important;" d="M152 24c0-13.3-10.7-24-24-24s-24 10.7-24 24V64H64C28.7 64 0 92.7 0 128v16 48V448c0 35.3 28.7 64 64 64H384c35.3 0 64-28.7 64-64V192 144 128c0-35.3-28.7-64-64-64H344V24c0-13.3-10.7-24-24-24s-24 10.7-24 24V64H152V24zM48 192H400V448c0 8.8-7.2 16-16 16H64c-8.8 0-16-7.2-16-16V192z"/></svg>');this.floatingButton.innerHTML='<span style="display: flex; align-items: center; gap: 10px; color: '.concat(i," !important; font-family: 'Google Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important; font-size: inherit !important; font-weight: inherit !important;\">").concat(a," ").concat(r,"</span>"),this.log("Updated floating button text to:",r)}}},{key:"destroy",value:function(){this.log("Destroying embed"),this.scrollLockState&&this.unlockBodyScroll(),this.container&&(this.container.remove(),this.container=null),this.floatingButton&&(this.floatingButton.remove(),this.floatingButton=null),this.htmlLangObserver&&(this.htmlLangObserver.disconnect(),this.htmlLangObserver=null),this.iframe=null,this.config=null,this.isOpen=!1,this.isReady=!1,this.hasExplicitLanguageSelection=!1,this.hasReceivedEmbedReady=!1,this.embedConfigLoaded=!1,window.removeEventListener("message",this.handleMessage),window.removeEventListener("message",this.handleExternalMessage),this.touchMoveHandler&&(document.removeEventListener("touchmove",this.touchMoveHandler),this.touchMoveHandler=null)}},{key:"createContainer",value:function(){this.container=document.createElement("div"),this.container.id="holidoit-loader-container",this.container.style.cssText="\n position: fixed !important;\n top: 0 !important;\n left: 0 !important;\n width: 100% !important;\n height: 100% !important;\n z-index: 2147483647 !important;\n display: none;\n pointer-events: none;\n ",document.body.appendChild(this.container)}},{key:"createIframe",value:function(){var t=this;this.container&&this.config&&(this.iframe=document.createElement("iframe"),this.iframe.id=u,this.iframe.src=this.resolvedEmbedUrl,this.iframe.allow="payment",this.iframe.setAttribute("tabindex","-1"),this.iframe.style.cssText="\n position: absolute !important;\n top: 0 !important;\n left: 0 !important;\n width: 100% !important;\n height: 100% !important;\n border: none !important;\n background: transparent !important;\n ",this.iframe.setAttribute("sandbox","allow-scripts allow-same-origin allow-forms allow-popups allow-popups-to-escape-sandbox allow-top-navigation-by-user-activation allow-top-navigation"),this.container.appendChild(this.iframe),document.activeElement===this.iframe&&this.iframe.blur(),this.iframe.onload=function(){t.log("Iframe loaded, waiting for HOLIDOIT_READY from embed")})}},{key:"createFloatingButton",value:function(){var t,e,n,o,i,r,a,s,l,u,c,d,f,h,m,g,p,v,y,b,_,w,M,S,x=this;if(this.config){var k=this.config.floatingButtonOptions;this.floatingButton=document.createElement("button"),this.floatingButton.id="holidoit-floating-button";var O=window.innerWidth,L=O<775,D=this.resolveFloatingButtonResponsiveOption(null==k||null===(t=k.desktop)||void 0===t?void 0:t.width,null==k||null===(e=k.mobile)||void 0===e?void 0:e.width,L?O-34:190),E=this.resolveFloatingButtonResponsiveOption(null==k||null===(n=k.desktop)||void 0===n?void 0:n.height,null==k||null===(o=k.mobile)||void 0===o?void 0:o.height,54),T=this.resolveFloatingButtonResponsiveOption(null==k||null===(i=k.desktop)||void 0===i?void 0:i.backgroundColor,null==k||null===(r=k.mobile)||void 0===r?void 0:r.backgroundColor,"#0f172a"),$=this.resolveFloatingButtonResponsiveOption(null==k||null===(a=k.desktop)||void 0===a?void 0:a.textColor,null==k||null===(s=k.mobile)||void 0===s?void 0:s.textColor,"white"),H=this.resolveFloatingButtonResponsiveOption(null==k||null===(l=k.desktop)||void 0===l?void 0:l.borderRounding,null==k||null===(u=k.mobile)||void 0===u?void 0:u.borderRounding,30),A=this.resolveFloatingButtonResponsiveOption(null==k||null===(c=k.desktop)||void 0===c?void 0:c.fontSize,null==k||null===(d=k.mobile)||void 0===d?void 0:d.fontSize,16),B=this.resolveFloatingButtonResponsiveOption(null==k||null===(f=k.desktop)||void 0===f?void 0:f.fontWeight,null==k||null===(h=k.mobile)||void 0===h?void 0:h.fontWeight,500),Y=this.resolveFloatingButtonResponsiveOption(null==k||null===(m=k.desktop)||void 0===m?void 0:m.textCase,null==k||null===(g=k.mobile)||void 0===g?void 0:g.textCase,"none"),C=this.resolveFloatingButtonResponsiveOption(null==k||null===(p=k.desktop)||void 0===p?void 0:p.bottomPosition,null==k||null===(v=k.mobile)||void 0===v?void 0:v.bottomPosition,L?22:30),R=this.resolveFloatingButtonResponsiveOption(null==k||null===(y=k.desktop)||void 0===y?void 0:y.rightPosition,null==k||null===(b=k.mobile)||void 0===b?void 0:b.rightPosition,L?17:30),P=this.resolveFloatingButtonResponsiveOption(null==k||null===(_=k.desktop)||void 0===_?void 0:_.leftPosition,null==k||null===(w=k.mobile)||void 0===w?void 0:w.leftPosition,void 0),j=this.resolveFloatingButtonResponsiveOption(null==k||null===(M=k.desktop)||void 0===M?void 0:M.topPosition,null==k||null===(S=k.mobile)||void 0===S?void 0:S.topPosition,void 0),N=(null==k?void 0:k.zIndex)||2147483646,F=this.config.language||I.ITALIAN,z=this.getFloatingButtonCallToAction(F),U="0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1)",W="#0f172a"===T?"#1e293b":T;this.floatingButton.style.cssText="\n display: flex !important;\n align-items: center !important;\n justify-content: center !important;\n gap: 10px !important;\n position: fixed !important;\n z-index: ".concat(N," !important;\n width: ").concat(D,"px !important;\n height: ").concat(E,"px !important;\n background: ").concat(T," !important;\n color: ").concat($," !important;\n border: none !important;\n border-radius: ").concat(H,"px !important;\n font-size: ").concat(A,"px !important;\n font-weight: ").concat(B," !important;\n text-transform: ").concat("uppercase"===Y?"uppercase":"capitalize"===Y?"capitalize":"none"," !important;\n cursor: pointer !important;\n box-shadow: ").concat(U,' !important;\n padding: 12px 24px !important;\n font-family: "Google Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;\n transition: all 200ms cubic-bezier(0.4, 0, 0.2, 1) !important;\n transform: scale(1) !important;\n ').concat(void 0!==C?"bottom: ".concat(C,"px !important;"):"","\n ").concat(void 0!==R?"right: ".concat(R,"px !important;"):"","\n ").concat(void 0!==P?"left: ".concat(P,"px !important;"):"left: auto !important;","\n ").concat(void 0!==j?"top: ".concat(j,"px !important;"):"top: auto !important;","\n "),this.floatingButton.addEventListener("mouseenter",function(){x.floatingButton&&(x.floatingButton.style.background="".concat(W," !important"),x.floatingButton.style.boxShadow="".concat("0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1)"," !important"))}),this.floatingButton.addEventListener("mouseleave",function(){x.floatingButton&&(x.floatingButton.style.background="".concat(T," !important"),x.floatingButton.style.boxShadow="".concat(U," !important"),x.floatingButton.style.transform="scale(1) !important")}),this.floatingButton.addEventListener("mousedown",function(){x.floatingButton&&(x.floatingButton.style.transform="scale(0.98) !important")}),this.floatingButton.addEventListener("mouseup",function(){x.floatingButton&&(x.floatingButton.style.transform="scale(1) !important")});var G='<svg style="fill: '.concat($,' !important;" xmlns="http://www.w3.org/2000/svg" height="20" width="20" viewBox="0 0 448 512"><path style="fill: ').concat($,' !important;" d="M152 24c0-13.3-10.7-24-24-24s-24 10.7-24 24V64H64C28.7 64 0 92.7 0 128v16 48V448c0 35.3 28.7 64 64 64H384c35.3 0 64-28.7 64-64V192 144 128c0-35.3-28.7-64-64-64H344V24c0-13.3-10.7-24-24-24s-24 10.7-24 24V64H152V24zM48 192H400V448c0 8.8-7.2 16-16 16H64c-8.8 0-16-7.2-16-16V192z"/></svg>');this.floatingButton.innerHTML='<span style="display: flex; align-items: center; gap: 10px; color: '.concat($," !important; font-family: 'Google Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important; font-size: inherit !important; font-weight: inherit !important;\">").concat(G," ").concat(z,"</span>"),this.floatingButton.addEventListener("click",function(){return x.open()}),document.body.appendChild(this.floatingButton)}}},{key:"normalizeLanguage",value:function(t){if(!t)return null;var e=t.trim().toLowerCase();if(!e)return null;if(Y.includes(e))return e;var n=e.split(/[-_]/)[0];return Y.includes(n)?n:null}},{key:"getDocumentLanguage",value:function(){var t;return"undefined"==typeof document?null:this.normalizeLanguage(null===(t=document.documentElement)||void 0===t?void 0:t.lang)}},{key:"syncLanguageWithDocument",value:function(){var t;if(!this.hasExplicitLanguageSelection){var e=this.getDocumentLanguage();e&&this.isLanguageSupportedByEmbed(e)&&(null===(t=this.config)||void 0===t?void 0:t.language)!==e&&(this.applyLanguage(e,{markAsExplicit:!1,syncEmbed:this.isReady}),this.log("Language set from <html lang>:",e))}}},{key:"isLanguageSupportedByEmbed",value:function(t){var e;if(!t)return!1;var n=null===(e=this.embedConfig)||void 0===e?void 0:e.languages;return Array.isArray(n)&&n.includes(t)}},{key:"observeDocumentLanguage",value:function(){var t=this;"undefined"!=typeof MutationObserver&&"undefined"!=typeof document&&(this.htmlLangObserver&&this.htmlLangObserver.disconnect(),this.htmlLangObserver=new MutationObserver(function(e){var n,o=D(e);try{for(o.s();!(n=o.n()).done;){var i=n.value;if("attributes"===i.type&&"lang"===i.attributeName)return void t.syncLanguageWithDocument()}}catch(t){o.e(t)}finally{o.f()}}),this.htmlLangObserver.observe(document.documentElement,{attributes:!0,attributeFilter:["lang"]}))}},{key:"applyLanguage",value:function(t,e){e.markAsExplicit&&(this.hasExplicitLanguageSelection=!0),this.config&&(this.config.language=t),this.updateFloatingButtonText(t),e.syncEmbed&&this.postMessage({type:"HOLIDOIT_CHANGE_LANGUAGE",payload:{language:t}})}},{key:"getFloatingButtonCallToAction",value:function(t){var e,n=null===(e=this.config)||void 0===e?void 0:e.floatingButtonOptions;return t===I.ITALIAN&&null!=n&&n.italianCallToAction?n.italianCallToAction:t===I.ENGLISH&&null!=n&&n.englishCallToAction?n.englishCallToAction:null!=n&&n.callToAction?n.callToAction:C[t]||C[I.ENGLISH]}},{key:"resolveFloatingButtonResponsiveOption",value:function(t,e,n){return window.innerWidth<775?void 0!==e?e:n:void 0!==t?t:n}},{key:"bindBookNowButtons",value:function(){var t=this,e=document.querySelectorAll(".book-now-button");if(0!==e.length){var n=0;e.forEach(function(e){var o=e,i="_holidoitClickBound";o[i]||(o[i]=!0,n++,o.addEventListener("click",function(e){var n;e.preventDefault(),e.stopPropagation();var i=o.getAttribute("data-product-number")||(null===(n=o.closest("[data-product-number]"))||void 0===n?void 0:n.getAttribute("data-product-number"))||"";t.log("Book now button clicked",{element:o.tagName,productNumber:i});var r=parseInt(i,10);setTimeout(function(){isNaN(r)?t.open():t.open({experienceId:r})},0)}))}),n>0&&this.log("Bound click handlers to ".concat(n," .book-now-button element(s)"))}}},{key:"observeForBookNowButtons",value:function(){var t=this;window._holidoitObserverActive||(window._holidoitObserverActive=!0,new MutationObserver(function(e){for(var n=!1,o=0;o<e.length;o++){var i=e[o];if("childList"===i.type)for(var r=0;r<i.addedNodes.length;r++){var a,s,l=i.addedNodes[r];if(l instanceof HTMLElement&&(null!==(a=l.classList)&&void 0!==a&&a.contains("book-now-button")||null!==(s=l.querySelector)&&void 0!==s&&s.call(l,".book-now-button"))){n=!0;break}}if(n)break}n&&(t.log("Detected dynamically added .book-now-button elements, binding..."),t.bindBookNowButtons())}).observe(document.body,{childList:!0,subtree:!0}),this.log("MutationObserver active for .book-now-button elements"))}},{key:"parseHolidoitEmbedUrl",value:function(t){try{var e=new URL(t),n=e.hostname.replace(/^www\./,"");if("holidoit.com"!==n&&"holido.it"!==n)return null;var o=e.pathname.match(/^\/embed\/web\/([^/]+)\/?$/);if(!o)return null;var i=o[1],r=e.searchParams.get("experienceId"),a=r?parseInt(r,10):void 0;return{embedId:i,experienceId:a&&!isNaN(a)?a:void 0}}catch(t){return null}}},{key:"interceptHolidoitLinks",value:function(){var t=this;document.addEventListener("click",function(e){var n,o,i,r=null===(n=e.target)||void 0===n||null===(o=n.closest)||void 0===o?void 0:o.call(n,"a[href]");if(null!=r&&r.href){var a=t.parseHolidoitEmbedUrl(r.href);a&&a.embedId===(null===(i=t.config)||void 0===i?void 0:i.embedId)&&(e.preventDefault(),e.stopPropagation(),t.log("Intercepted holidoit embed link",a),a.experienceId?t.open({experienceId:a.experienceId}):t.open())}},!0)}},{key:"setupMessageListener",value:function(){window.addEventListener("message",this.handleMessage),window.addEventListener("message",this.handleExternalMessage)}},{key:"getSenderIframe",value:function(t){if(!t)return null;for(var e=0,n=Array.from(document.querySelectorAll("iframe"));e<n.length;e++){var o=n[e];if(o.contentWindow===t)return o}return null}},{key:"isMessageFromOwnEmbedIframe",value:function(t){var e;return!(null===(e=this.iframe)||void 0===e||!e.contentWindow)&&t.source===this.iframe.contentWindow&&t.origin===this.embedOrigin}},{key:"isTrustedHolidoitOrigin",value:function(t){if(!t||"null"===t)return!1;if(t===this.embedOrigin)return!0;try{var e=new URL(t).hostname;return"localhost"===e||"127.0.0.1"===e||"holidoit.com"===e||e.endsWith(".holidoit.com")||"holido.it"===e||e.endsWith(".holido.it")||"holydoit.com"===e||e.endsWith(".holydoit.com")}catch(t){return!1}}},{key:"extractAnalyticsPayload",value:function(t){var e=b(t);return e&&"embed"===e.source?e:(this.log("Ignoring invalid analytics message payload",t),null)}},{key:"handleAnalyticsMessage",value:function(t){var e=this.extractAnalyticsPayload(t);return!!e&&(y(e.eventData,e.dedupeKey)?(this.log("Pushed analytics event to dataLayer",e.dedupeKey,e.eventData),!0):(this.log("Ignoring duplicate analytics event",e.dedupeKey),!0))}},{key:"postMessage",value:function(t){var e;return null!==(e=this.iframe)&&void 0!==e&&e.contentWindow?this.isReady||"HOLIDOIT_INIT"===t.type?(this.log("Posting message to iframe",t),void this.iframe.contentWindow.postMessage(t,this.embedOrigin)):(this.log("Embed not ready, queueing message",t),void this.pendingMessages.push(t)):(this.log("Iframe not ready, queueing message",t),void this.pendingMessages.push(t))}},{key:"maybeSendInitMessage",value:function(){var t=this;if(this.hasReceivedEmbedReady&&this.embedConfigLoaded&&!this.isReady&&this.config){this.log("Embed and config are ready, sending HOLIDOIT_INIT");var e="localhost"===window.location.hostname||"127.0.0.1"===window.location.hostname;this.postMessage({type:"HOLIDOIT_INIT",payload:{embedId:this.config.embedId,language:this.config.language,floatingButton:this.config.floatingButton,floatingButtonOptions:this.config.floatingButtonOptions,parentOrigin:window.location.origin,parentUrl:window.location.href,isMobile:window.innerWidth<775,debug:this.config.debug||e}}),this.isReady=!0,this.pendingMessages.forEach(function(e){return t.postMessage(e)}),this.pendingMessages=[]}}},{key:"checkPaymentRedirect",value:function(){var t=this;if(A)this.log("Payment redirect already processed, skipping");else{var e=null,n=null,o=null;if(H)e=H.paymentIntent,n=H.redirectStatus,o=H.paymentIntentClientSecret,this.log("Using captured Stripe params",H);else{var i=new URLSearchParams(window.location.search);e=i.get("payment_intent"),n=i.get("redirect_status"),o=i.get("payment_intent_client_secret")}if(e&&n){this.log("Payment redirect detected",{paymentIntent:e,redirectStatus:n}),A=!0;var r=null;try{r=localStorage.getItem(d)}catch(t){this.log("localStorage not available (incognito mode?)",t)}if(r)try{var a=JSON.parse(r);this.log("Found payment session",a),this.open(),this.isReady?t.postMessage({type:"HOLIDOIT_PAYMENT_REDIRECT",payload:{paymentIntent:e,paymentIntentClientSecret:o||void 0,redirectStatus:n,session:a}}):this.pendingMessages.push({type:"HOLIDOIT_PAYMENT_REDIRECT",payload:{paymentIntent:e,paymentIntentClientSecret:o||void 0,redirectStatus:n,session:a}}),this.cleanUrlParams();try{localStorage.removeItem(d)}catch(t){this.log("Failed to remove payment session from localStorage",t)}}catch(t){this.log("Failed to parse payment session",t)}else this.log("Payment redirect params found but no session - cleaning URL"),this.cleanUrlParams()}}}},{key:"cleanUrlParams",value:function(){var t=new URL(window.location.href);t.searchParams.delete("payment_intent"),t.searchParams.delete("payment_intent_client_secret"),t.searchParams.delete("redirect_status"),window.history.replaceState({},"",t.toString())}},{key:"getEmbedOrigin",value:function(t){try{return new URL(t).origin}catch(t){return window.location.origin}}},{key:"lockBodyScroll",value:function(){var t=this;if(this.scrollLockState)this.log("Scroll already locked, skipping");else{var e=this.getDocumentScrollRoot(),n=this.getScrollPosition(),o=n.top,i=n.left,r=this.getScrollbarWidth(),a={overflow:document.body.style.overflow,overscrollBehavior:document.body.style.overscrollBehavior,paddingRight:document.body.style.paddingRight,position:document.body.style.position,top:document.body.style.top,left:document.body.style.left,right:document.body.style.right,width:document.body.style.width},s={overflow:document.documentElement.style.overflow,overscrollBehavior:document.documentElement.style.overscrollBehavior};this.scrollLockState={mode:this.isIOSDevice()&&this.isDocumentScrollRoot(e)?"fixed-body":"document-overflow",scrollTop:o,scrollLeft:i,scrollbarWidth:r,bodyStyles:a,htmlStyles:s},document.documentElement.style.overflow="hidden",document.documentElement.style.overscrollBehavior="none",document.body.style.overflow="hidden",document.body.style.overscrollBehavior="none",r>0&&(document.body.style.paddingRight="".concat(r,"px")),"fixed-body"===this.scrollLockState.mode&&(document.body.style.position="fixed",document.body.style.top="-".concat(o,"px"),document.body.style.left="0",document.body.style.right="0",document.body.style.width="100%",this.touchMoveHandler=function(e){var n,o=e.target;null!==(n=t.container)&&void 0!==n&&n.contains(o)||e.preventDefault()},document.addEventListener("touchmove",this.touchMoveHandler,{passive:!1})),this.log("Scroll locked",{mode:this.scrollLockState.mode,scrollbarWidth:r})}}},{key:"unlockBodyScroll",value:function(){if(this.scrollLockState){var t=this.scrollLockState,e=t.mode,n=t.scrollTop,o=t.scrollLeft,i=t.bodyStyles,r=t.htmlStyles;document.body.style.overflow=i.overflow,document.body.style.overscrollBehavior=i.overscrollBehavior,document.body.style.paddingRight=i.paddingRight,document.documentElement.style.overflow=r.overflow,document.documentElement.style.overscrollBehavior=r.overscrollBehavior,"fixed-body"===e&&(document.body.style.position=i.position,document.body.style.top=i.top,document.body.style.left=i.left,document.body.style.right=i.right,document.body.style.width=i.width,this.touchMoveHandler&&(document.removeEventListener("touchmove",this.touchMoveHandler),this.touchMoveHandler=null)),this.restoreScrollPosition(n,o),this.scrollLockState=null,this.log("Scroll unlocked",{mode:e})}else this.log("Scroll not locked, skipping unlock")}},{key:"log",value:function(){var t,e="undefined"!=typeof window&&("localhost"===window.location.hostname||"127.0.0.1"===window.location.hostname);if(null!==(t=this.config)&&void 0!==t&&t.debug||e){for(var n,o=arguments.length,i=new Array(o),r=0;r<o;r++)i[r]=arguments[r];(n=console).log.apply(n,["[Holidoit]"].concat(i))}}}],o&&r(n.prototype,o),i&&r(n,i),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,o,i,s,f}()),P=function(t){return R.init(t)},j=function(t){return R.open(t)},N=function(){return R.close()},F=function(t){return R.toggle(t)},z=function(t){return R.changeLanguage(t)},U=function(){return R.destroy()},W=c,G=function(t,e,n){t&&R.init({embedId:t,floatingButton:null==e||e,floatingButtonOptions:n})},J=function(t,e,n){R.toggle({embedId:t,experienceId:e?parseInt(e,10):void 0,test:n})},V=function(){return R.open()},q=function(){return R.close()},Z={init:P,open:j,close:N,toggle:F,changeLanguage:z,destroy:U,version:W,renderHolidoitEmbed:G,toggleEmbed:J,openEmbed:V,closeEmbed:q};if("undefined"!=typeof window){window.Holidoit=Z;var K=document.currentScript,Q=function(){var t=window.HolidoitConfig;if(null!=t&&t.embedId)R.init(t);else if(null!=K&&K.getAttribute("data-embed-id")){var e=K.getAttribute("data-embed-id"),n=K.getAttribute("data-floating-button"),o=K.getAttribute("data-language"),i=K.getAttribute("data-embed-url"),r=K.getAttribute("data-debug");R.init({embedId:e,floatingButton:"true"===n,language:o||void 0,embedUrl:i||void 0,debug:"true"===r})}};"loading"===document.readyState?document.addEventListener("DOMContentLoaded",Q):Q()}})(),o})());
@@ -1,2 +1,2 @@
1
1
  /*! For license information please see experience-grid-drawer-loader.js.LICENSE.txt */
2
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("HolidoitExperienceGridDrawer",[],t):"object"==typeof exports?exports.HolidoitExperienceGridDrawer=t():e.HolidoitExperienceGridDrawer=t()}(this,()=>(()=>{var e={172:e=>{e.exports=function(e,t){this.v=e,this.k=t},e.exports.__esModule=!0,e.exports.default=e.exports},373:e=>{e.exports=function(e){var t=Object(e),r=[];for(var n in t)r.unshift(n);return function e(){for(;r.length;)if((n=r.pop())in t)return e.value=n,e.done=!1,e;return e.done=!0,e}},e.exports.__esModule=!0,e.exports.default=e.exports},546:e=>{function t(r,n,o,i){var a=Object.defineProperty;try{a({},"",{})}catch(r){a=0}e.exports=t=function(e,r,n,o){function i(r,n){t(e,r,function(e){return this._invoke(r,n,e)})}r?a?a(e,r,{value:n,enumerable:!o,configurable:!o,writable:!o}):e[r]=n:(i("next",0),i("throw",1),i("return",2))},e.exports.__esModule=!0,e.exports.default=e.exports,t(r,n,o,i)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},579:(e,t,r)=>{var n=r(738).default;e.exports=function(e){if(null!=e){var t=e["function"==typeof Symbol&&Symbol.iterator||"@@iterator"],r=0;if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}}}throw new TypeError(n(e)+" is not iterable")},e.exports.__esModule=!0,e.exports.default=e.exports},633:(e,t,r)=>{var n=r(172),o=r(993),i=r(869),a=r(887),s=r(791),u=r(373),l=r(579);function c(){"use strict";var t=o(),r=t.m(c),d=(Object.getPrototypeOf?Object.getPrototypeOf(r):r.__proto__).constructor;function f(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===d||"GeneratorFunction"===(t.displayName||t.name))}var p={throw:1,return:2,break:3,continue:3};function g(e){var t,r;return function(n){t||(t={stop:function(){return r(n.a,2)},catch:function(){return n.v},abrupt:function(e,t){return r(n.a,p[e],t)},delegateYield:function(e,o,i){return t.resultName=o,r(n.d,l(e),i)},finish:function(e){return r(n.f,e)}},r=function(e,r,o){n.p=t.prev,n.n=t.next;try{return e(r,o)}finally{t.next=n.n}}),t.resultName&&(t[t.resultName]=n.v,t.resultName=void 0),t.sent=n.v,t.next=n.n;try{return e.call(this,t)}finally{n.p=t.prev,n.n=t.next}}}return(e.exports=c=function(){return{wrap:function(e,r,n,o){return t.w(g(e),r,n,o&&o.reverse())},isGeneratorFunction:f,mark:t.m,awrap:function(e,t){return new n(e,t)},AsyncIterator:s,async:function(e,t,r,n,o){return(f(t)?a:i)(g(e),t,r,n,o)},keys:u,values:l}},e.exports.__esModule=!0,e.exports.default=e.exports)()}e.exports=c,e.exports.__esModule=!0,e.exports.default=e.exports},738:e=>{function t(r){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(r)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},756:(e,t,r)=>{var n=r(633)();e.exports=n;try{regeneratorRuntime=n}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=n:Function("r","regeneratorRuntime = r")(n)}},791:(e,t,r)=>{var n=r(172),o=r(546);e.exports=function e(t,r){function i(e,o,a,s){try{var u=t[e](o),l=u.value;return l instanceof n?r.resolve(l.v).then(function(e){i("next",e,a,s)},function(e){i("throw",e,a,s)}):r.resolve(l).then(function(e){u.value=e,a(u)},function(e){return i("throw",e,a,s)})}catch(e){s(e)}}var a;this.next||(o(e.prototype),o(e.prototype,"function"==typeof Symbol&&Symbol.asyncIterator||"@asyncIterator",function(){return this})),o(this,"_invoke",function(e,t,n){function o(){return new r(function(t,r){i(e,n,t,r)})}return a=a?a.then(o,o):o()},!0)},e.exports.__esModule=!0,e.exports.default=e.exports},869:(e,t,r)=>{var n=r(887);e.exports=function(e,t,r,o,i){var a=n(e,t,r,o,i);return a.next().then(function(e){return e.done?e.value:a.next()})},e.exports.__esModule=!0,e.exports.default=e.exports},887:(e,t,r)=>{var n=r(993),o=r(791);e.exports=function(e,t,r,i,a){return new o(n().w(e,t,r,i),a||Promise)},e.exports.__esModule=!0,e.exports.default=e.exports},993:(e,t,r)=>{var n=r(546);function o(){var t,r,i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.toStringTag||"@@toStringTag";function u(e,o,i,a){var s=o&&o.prototype instanceof c?o:c,u=Object.create(s.prototype);return n(u,"_invoke",function(e,n,o){var i,a,s,u=0,c=o||[],d=!1,f={p:0,n:0,v:t,a:p,f:p.bind(t,4),d:function(e,r){return i=e,a=0,s=t,f.n=r,l}};function p(e,n){for(a=e,s=n,r=0;!d&&u&&!o&&r<c.length;r++){var o,i=c[r],p=f.p,g=i[2];e>3?(o=g===n)&&(s=i[(a=i[4])?5:(a=3,3)],i[4]=i[5]=t):i[0]<=p&&((o=e<2&&p<i[1])?(a=0,f.v=n,f.n=i[1]):p<g&&(o=e<3||i[0]>n||n>g)&&(i[4]=e,i[5]=n,f.n=g,a=0))}if(o||e>1)return l;throw d=!0,n}return function(o,c,g){if(u>1)throw TypeError("Generator is already running");for(d&&1===c&&p(c,g),a=c,s=g;(r=a<2?t:s)||!d;){i||(a?a<3?(a>1&&(f.n=-1),p(a,s)):f.n=s:f.v=s);try{if(u=2,i){if(a||(o="next"),r=i[o]){if(!(r=r.call(i,s)))throw TypeError("iterator result is not an object");if(!r.done)return r;s=r.value,a<2&&(a=0)}else 1===a&&(r=i.return)&&r.call(i),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);i=t}else if((r=(d=f.n<0)?s:e.call(n,f))!==l)break}catch(e){i=t,a=1,s=e}finally{u=1}}return{value:r,done:d}}}(e,i,a),!0),u}var l={};function c(){}function d(){}function f(){}r=Object.getPrototypeOf;var p=[][a]?r(r([][a]())):(n(r={},a,function(){return this}),r),g=f.prototype=c.prototype=Object.create(p);function h(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,f):(e.__proto__=f,n(e,s,"GeneratorFunction")),e.prototype=Object.create(g),e}return d.prototype=f,n(g,"constructor",f),n(f,"constructor",d),d.displayName="GeneratorFunction",n(f,s,"GeneratorFunction"),n(g),n(g,s,"Generator"),n(g,a,function(){return this}),n(g,"toString",function(){return"[object Generator]"}),(e.exports=o=function(){return{w:u,m:h}},e.exports.__esModule=!0,e.exports.default=e.exports)()}e.exports=o,e.exports.__esModule=!0,e.exports.default=e.exports}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={exports:{}};return e[n](i,i.exports,r),i.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};return(()=>{"use strict";function e(e,t,r,n,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,o)}function t(t){return function(){var r=this,n=arguments;return new Promise(function(o,i){var a=t.apply(r,n);function s(t){e(a,o,i,s,u,"next",t)}function u(t){e(a,o,i,s,u,"throw",t)}s(void 0)})}}function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function i(e){var t=function(e,t){if("object"!=o(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=o(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==o(t)?t:t+""}function a(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,i(n.key),n)}}function s(e,t,r){return(t=i(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}r.r(n),r.d(n,{holidoitExperienceGridDrawerLoader:()=>y});var u=r(756),l=r.n(u);function c(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return d(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?d(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw i}}}}function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function f(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function p(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?f(Object(r),!0).forEach(function(t){s(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):f(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var g="holidoitExperienceGridDrawerWidget",h="holidoitWidget",v=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),s(this,"config",null),s(this,"widgets",[]),s(this,"isInitialized",!1),s(this,"mutationObserver",null),s(this,"resizeObserver",null),s(this,"autoInsertedElement",null)},r=[{key:"init",value:function(e){if(e.embedId){if(this.isInitialized)return this.log("Already initialized, updating config"),this.config=p(p({},this.config),e),void this.scanAndCreateWidgets();this.config=e,this.isInitialized=!0,this.log("Initializing experience grid drawer loader",e),this.setupMessageListener(),this.setupResizeObserver(),this.bootstrap()}}},{key:"bootstrap",value:(i=t(l().mark(function e(){return l().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=1,this.ensureHolidoitApi();case 1:e.sent&&this.initializeHolidoit(),this.scanAndCreateWidgets(),this.observeForWidgets();case 2:case"end":return e.stop()}},e,this)})),function(){return i.apply(this,arguments)})},{key:"getHolidoitApi",value:function(){return"undefined"==typeof window?null:window.Holidoit||null}},{key:"ensureHolidoitApi",value:(o=t(l().mark(function e(){var t,r,n,o,i,a,s;return l().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.getHolidoitApi()){e.next=1;break}return e.abrupt("return",!0);case 1:if(!1!==(null===(t=this.config)||void 0===t?void 0:t.includeLoader)){e.next=2;break}return this.log("includeLoader=false and Holidoit API not found"),e.abrupt("return",!1);case 2:r=this.getLoaderSourceCandidates(),n=c(r),e.prev=3,n.s();case 4:if((o=n.n()).done){e.next=10;break}return i=o.value,e.prev=5,this.log("Attempting to load Holidoit loader from",i),e.next=6,this.loadExternalScript(i);case 6:if(!this.getHolidoitApi()){e.next=7;break}return this.log("Holidoit API loaded successfully"),e.abrupt("return",!0);case 7:e.next=9;break;case 8:e.prev=8,a=e.catch(5),this.log("Failed loading Holidoit loader from",i,a);case 9:e.next=4;break;case 10:e.next=12;break;case 11:e.prev=11,s=e.catch(3),n.e(s);case 12:return e.prev=12,n.f(),e.finish(12);case 13:return e.abrupt("return",!1);case 14:case"end":return e.stop()}},e,this,[[3,11,12,13],[5,8]])})),function(){return o.apply(this,arguments)})},{key:"getLoaderSourceCandidates",value:function(){var e,t,r=[],n=null===(e=this.config)||void 0===e?void 0:e.loaderSrc,o=null===(t=this.config)||void 0===t?void 0:t.scriptSrc;if(n&&r.push(n),o)try{r.push(new URL("../holidoit.js",o).toString())}catch(e){}return r.push("https://cdn.holidoit.com/holidoit.js"),Array.from(new Set(r))}},{key:"loadExternalScript",value:function(e){var t=this;return new Promise(function(r,n){if(e){var o=Array.from(document.querySelectorAll("script")).find(function(t){return t.src===e});if(o)return t.getHolidoitApi()?void r():(o.addEventListener("load",function(){return r()},{once:!0}),void o.addEventListener("error",function(){return n(new Error("Failed to load script: ".concat(e)))},{once:!0}));var i=document.createElement("script");i.src=e,i.async=!0,i.onload=function(){return r()},i.onerror=function(){return n(new Error("Failed to load script: ".concat(e)))},document.head.appendChild(i)}else n(new Error("Missing script src"))})}},{key:"initializeHolidoit",value:function(){var e=this.getHolidoitApi();if(null!=e&&e.init&&this.config){var t,r=this.config.drawerLanguage||this.config.language;document.getElementById("holidoit-loader-container")?(this.log("Holidoit drawer already initialized on page, reusing existing instance"),r&&(null===(t=e.changeLanguage)||void 0===t||t.call(e,r))):e.init({embedId:this.config.embedId,language:r,embedUrl:this.config.embedUrl,floatingButton:!1,debug:this.config.debug})}}},{key:"setupMessageListener",value:function(){var e=this;window.addEventListener("message",function(t){var r=t.data||{},n=r.type,o=r.height;if("HOLIDOIT_WIDGET_RESIZE"===n&&"number"==typeof o){var i,a=c(e.widgets);try{var s,u=function(){var r=i.value;if(r.iframe.contentWindow===t.source)return Math.abs(o-r.lastAppliedHeight)<15?{v:void 0}:(requestAnimationFrame(function(){r.iframe.style.height="".concat(o,"px"),r.lastAppliedHeight=o,e.log("Resized widget to",o,"px")}),0)};for(a.s();!(i=a.n()).done&&0!==(s=u());)if(s)return s.v}catch(e){a.e(e)}finally{a.f()}}"HOLIDOIT_WIDGET_READY"===n&&e.log("Widget ready:",t.data)})}},{key:"setupResizeObserver",value:function(){var e=this;this.resizeObserver=new ResizeObserver(function(t){var r,n=c(t);try{for(n.s();!(r=n.n()).done;){var o,i=r.value.target,a=c(e.widgets);try{for(a.s();!(o=a.n()).done;){var s=o.value;if(s.element===i){var u;null===(u=s.iframe.contentWindow)||void 0===u||u.postMessage({type:"HOLIDOIT_REQUEST_HEIGHT"},"*");break}}}catch(e){a.e(e)}finally{a.f()}}}catch(e){n.e(e)}finally{n.f()}})}},{key:"getWidgetElements",value:function(){var e=[],t=new Set;return document.querySelectorAll(".".concat(g)).forEach(function(r){var n=r;t.has(n)||(t.add(n),e.push(n))}),document.querySelectorAll(".".concat(h)).forEach(function(r){var n=r;(n.dataset.src||"").includes("widget-experience-grid-drawer.html")&&!t.has(n)&&(t.add(n),e.push(n))}),e}},{key:"ensureAutoInsertedPlaceholder",value:function(){var e,t;if(!1!==(null===(e=this.config)||void 0===e?void 0:e.autoInsertIfMissing)&&!(this.getWidgetElements().length>0||this.autoInsertedElement&&document.body.contains(this.autoInsertedElement))){var r=document.createElement("div");r.className=g;var n=null===(t=this.config)||void 0===t?void 0:t.scriptElement;null!=n&&n.parentNode?n.parentNode.insertBefore(r,n.nextSibling):document.body.appendChild(r),this.autoInsertedElement=r,this.log("Auto-inserted .holidoitExperienceGridDrawerWidget placeholder")}}},{key:"resolveWidgetUrl",value:function(){var e,t;if(null!==(e=this.config)&&void 0!==e&&e.widgetUrl)return this.config.widgetUrl;if(null!==(t=this.config)&&void 0!==t&&t.scriptSrc)try{return new URL("./widget-experience-grid-drawer.html",this.config.scriptSrc).toString()}catch(e){}return"https://cdn.holidoit.com/widgets/widget-experience-grid-drawer.html"}},{key:"scanAndCreateWidgets",value:function(){this.ensureAutoInsertedPlaceholder();var e,t=c(this.getWidgetElements());try{for(t.s();!(e=t.n()).done;){var r=e.value;"true"!==r.dataset.holidoitProcessed&&this.createWidget(r)}}catch(e){t.e(e)}finally{t.f()}}},{key:"applyWidgetParams",value:function(e,t){var r,n,o,i,a,s;null!==(r=this.config)&&void 0!==r&&r.embedId&&!e.searchParams.has("embedId")&&e.searchParams.set("embedId",this.config.embedId);var u=t.dataset.language||(null===(n=this.config)||void 0===n?void 0:n.language);u&&!e.searchParams.has("lang")&&e.searchParams.set("lang",u);var l=t.dataset.experiences||(null===(o=this.config)||void 0===o?void 0:o.experiences);l&&!e.searchParams.has("experiences")&&e.searchParams.set("experiences",l);var c=t.dataset.showLanguagePicker,d=void 0===(null===(i=this.config)||void 0===i?void 0:i.showLanguagePicker)?void 0:String(this.config.showLanguagePicker),f=null!=c?c:d;void 0===f||e.searchParams.has("show_language_picker")||e.searchParams.set("show_language_picker",f);var p=t.dataset.withLogo,g=void 0===(null===(a=this.config)||void 0===a?void 0:a.withLogo)?void 0:String(this.config.withLogo),h=null!=p?p:g;void 0===h||e.searchParams.has("with_logo")||e.searchParams.set("with_logo",h);var v=t.dataset.gift,y=void 0===(null===(s=this.config)||void 0===s?void 0:s.gift)?void 0:String(this.config.gift),m=null!=v?v:y;void 0===m||e.searchParams.has("gift")||e.searchParams.set("gift",m)}},{key:"createWidget",value:function(e){var t,r,n=e.dataset.src;n||(n=this.resolveWidgetUrl());try{r=new URL(n,window.location.href)}catch(e){return}this.applyWidgetParams(r,e);var o=document.createElement("iframe");o.className="holidoit-experience-grid-drawer-iframe",o.src=r.toString(),o.allow="payment",o.setAttribute("scrolling","auto"),o.setAttribute("frameborder","0"),o.style.cssText="\n width: 100% !important;\n min-height: ".concat(400,"px !important;\n border: none !important;\n display: block !important;\n "),o.setAttribute("sandbox","allow-scripts allow-same-origin allow-forms allow-popups allow-popups-to-escape-sandbox"),e.innerHTML="",e.appendChild(o),e.dataset.holidoitProcessed="true";var i={element:e,iframe:o,src:r.toString(),lastAppliedHeight:400};this.widgets.push(i),null===(t=this.resizeObserver)||void 0===t||t.observe(e),this.log("Created experience grid drawer widget",i)}},{key:"observeForWidgets",value:function(){var e=this;this.mutationObserver||(this.mutationObserver=new MutationObserver(function(t){var r,n=!1,o=c(t);try{for(o.s();!(r=o.n()).done;){var i=r.value;if("childList"===i.type){for(var a=0,s=Array.from(i.addedNodes);a<s.length;a++){var u,l,d,f,p=s[a];if(p instanceof HTMLElement&&(null!==(u=p.classList)&&void 0!==u&&u.contains(g)||null!==(l=p.querySelector)&&void 0!==l&&l.call(p,".".concat(g))||null!==(d=p.matches)&&void 0!==d&&d.call(p,".".concat(h,'[data-src*="widget-experience-grid-drawer.html"]'))||null!==(f=p.querySelector)&&void 0!==f&&f.call(p,".".concat(h,'[data-src*="widget-experience-grid-drawer.html"]')))){n=!0;break}}if(n)break}}}catch(e){o.e(e)}finally{o.f()}n&&(e.log("Detected new grid drawer widget elements, scanning..."),e.scanAndCreateWidgets())}),this.mutationObserver.observe(document.body,{childList:!0,subtree:!0}))}},{key:"changeLanguage",value:function(e){var t,r;this.config&&(this.config.language=e);var n=this.getHolidoitApi();null==n||null===(t=n.changeLanguage)||void 0===t||t.call(n,(null===(r=this.config)||void 0===r?void 0:r.drawerLanguage)||e);var o,i=c(this.widgets);try{for(i.s();!(o=i.n()).done;){var a;null===(a=o.value.iframe.contentWindow)||void 0===a||a.postMessage({type:"HOLIDOIT_CHANGE_LANGUAGE",payload:{language:e}},"*")}}catch(e){i.e(e)}finally{i.f()}}},{key:"destroy",value:function(){var e,t,r;this.log("Destroying experience grid drawer widgets");var n,o=c(this.widgets);try{for(o.s();!(n=o.n()).done;){var i=n.value;i.iframe.remove(),i.element.dataset.holidoitProcessed="false"}}catch(e){o.e(e)}finally{o.f()}this.widgets=[],null===(e=this.mutationObserver)||void 0===e||e.disconnect(),this.mutationObserver=null,null===(t=this.resizeObserver)||void 0===t||t.disconnect(),this.resizeObserver=null,this.isInitialized=!1,this.config=null,null!==(r=this.autoInsertedElement)&&void 0!==r&&r.parentNode&&this.autoInsertedElement.parentNode.removeChild(this.autoInsertedElement),this.autoInsertedElement=null}},{key:"log",value:function(){var e;if(null!==(e=this.config)&&void 0!==e&&e.debug){for(var t,r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];(t=console).log.apply(t,["[HolidoitExperienceGridDrawer]"].concat(n))}}}],r&&a(e.prototype,r),n&&a(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r,n,o,i}(),y=new v;if("undefined"!=typeof window){var m=document.currentScript;if(m){var b=new URL(m.src,window.location.href),w=b.searchParams.get("embedId")||m.dataset.embedId;if(w){var x=b.searchParams.get("lang")||m.dataset.language,P=b.searchParams.get("drawerLang")||m.dataset.drawerLang||m.dataset.drawerLanguage||x,O=b.searchParams.get("includeLoader")||m.dataset.includeLoader,S=null==O?void 0:"false"!==O,_=b.searchParams.get("show_language_picker")||b.searchParams.get("showLanguagePicker")||m.dataset.showLanguagePicker,E=null==_?void 0:"false"!==_,I=b.searchParams.get("with_logo")||b.searchParams.get("withLogo")||m.dataset.withLogo,k=null==I?void 0:"true"===I,L=b.searchParams.get("gift")||m.dataset.gift,A=null==L?void 0:"true"===L;y.init({embedId:w,language:x,drawerLanguage:P,includeLoader:S,withLogo:k,gift:A,loaderSrc:b.searchParams.get("loaderSrc")||m.dataset.loaderSrc||void 0,embedUrl:b.searchParams.get("embedUrl")||m.dataset.embedUrl||void 0,widgetUrl:b.searchParams.get("widgetUrl")||m.dataset.widgetUrl||void 0,experiences:b.searchParams.get("experiences")||m.dataset.experiences||void 0,showLanguagePicker:E,debug:"true"===b.searchParams.get("debug")||"true"===m.dataset.debug,autoInsertIfMissing:"false"!==(b.searchParams.get("autoInsertIfMissing")||m.dataset.autoInsertIfMissing),scriptSrc:m.src,scriptElement:m})}}window.HolidoitExperienceGridDrawer=y}})(),n})());
2
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("HolidoitExperienceGridDrawer",[],t):"object"==typeof exports?exports.HolidoitExperienceGridDrawer=t():e.HolidoitExperienceGridDrawer=t()}(this,()=>(()=>{var e={172:e=>{e.exports=function(e,t){this.v=e,this.k=t},e.exports.__esModule=!0,e.exports.default=e.exports},373:e=>{e.exports=function(e){var t=Object(e),r=[];for(var n in t)r.unshift(n);return function e(){for(;r.length;)if((n=r.pop())in t)return e.value=n,e.done=!1,e;return e.done=!0,e}},e.exports.__esModule=!0,e.exports.default=e.exports},546:e=>{function t(r,n,i,o){var a=Object.defineProperty;try{a({},"",{})}catch(r){a=0}e.exports=t=function(e,r,n,i){function o(r,n){t(e,r,function(e){return this._invoke(r,n,e)})}r?a?a(e,r,{value:n,enumerable:!i,configurable:!i,writable:!i}):e[r]=n:(o("next",0),o("throw",1),o("return",2))},e.exports.__esModule=!0,e.exports.default=e.exports,t(r,n,i,o)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},579:(e,t,r)=>{var n=r(738).default;e.exports=function(e){if(null!=e){var t=e["function"==typeof Symbol&&Symbol.iterator||"@@iterator"],r=0;if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}}}throw new TypeError(n(e)+" is not iterable")},e.exports.__esModule=!0,e.exports.default=e.exports},633:(e,t,r)=>{var n=r(172),i=r(993),o=r(869),a=r(887),s=r(791),u=r(373),l=r(579);function c(){"use strict";var t=i(),r=t.m(c),d=(Object.getPrototypeOf?Object.getPrototypeOf(r):r.__proto__).constructor;function f(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===d||"GeneratorFunction"===(t.displayName||t.name))}var p={throw:1,return:2,break:3,continue:3};function g(e){var t,r;return function(n){t||(t={stop:function(){return r(n.a,2)},catch:function(){return n.v},abrupt:function(e,t){return r(n.a,p[e],t)},delegateYield:function(e,i,o){return t.resultName=i,r(n.d,l(e),o)},finish:function(e){return r(n.f,e)}},r=function(e,r,i){n.p=t.prev,n.n=t.next;try{return e(r,i)}finally{t.next=n.n}}),t.resultName&&(t[t.resultName]=n.v,t.resultName=void 0),t.sent=n.v,t.next=n.n;try{return e.call(this,t)}finally{n.p=t.prev,n.n=t.next}}}return(e.exports=c=function(){return{wrap:function(e,r,n,i){return t.w(g(e),r,n,i&&i.reverse())},isGeneratorFunction:f,mark:t.m,awrap:function(e,t){return new n(e,t)},AsyncIterator:s,async:function(e,t,r,n,i){return(f(t)?a:o)(g(e),t,r,n,i)},keys:u,values:l}},e.exports.__esModule=!0,e.exports.default=e.exports)()}e.exports=c,e.exports.__esModule=!0,e.exports.default=e.exports},738:e=>{function t(r){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(r)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},756:(e,t,r)=>{var n=r(633)();e.exports=n;try{regeneratorRuntime=n}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=n:Function("r","regeneratorRuntime = r")(n)}},791:(e,t,r)=>{var n=r(172),i=r(546);e.exports=function e(t,r){function o(e,i,a,s){try{var u=t[e](i),l=u.value;return l instanceof n?r.resolve(l.v).then(function(e){o("next",e,a,s)},function(e){o("throw",e,a,s)}):r.resolve(l).then(function(e){u.value=e,a(u)},function(e){return o("throw",e,a,s)})}catch(e){s(e)}}var a;this.next||(i(e.prototype),i(e.prototype,"function"==typeof Symbol&&Symbol.asyncIterator||"@asyncIterator",function(){return this})),i(this,"_invoke",function(e,t,n){function i(){return new r(function(t,r){o(e,n,t,r)})}return a=a?a.then(i,i):i()},!0)},e.exports.__esModule=!0,e.exports.default=e.exports},869:(e,t,r)=>{var n=r(887);e.exports=function(e,t,r,i,o){var a=n(e,t,r,i,o);return a.next().then(function(e){return e.done?e.value:a.next()})},e.exports.__esModule=!0,e.exports.default=e.exports},887:(e,t,r)=>{var n=r(993),i=r(791);e.exports=function(e,t,r,o,a){return new i(n().w(e,t,r,o),a||Promise)},e.exports.__esModule=!0,e.exports.default=e.exports},993:(e,t,r)=>{var n=r(546);function i(){var t,r,o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.toStringTag||"@@toStringTag";function u(e,i,o,a){var s=i&&i.prototype instanceof c?i:c,u=Object.create(s.prototype);return n(u,"_invoke",function(e,n,i){var o,a,s,u=0,c=i||[],d=!1,f={p:0,n:0,v:t,a:p,f:p.bind(t,4),d:function(e,r){return o=e,a=0,s=t,f.n=r,l}};function p(e,n){for(a=e,s=n,r=0;!d&&u&&!i&&r<c.length;r++){var i,o=c[r],p=f.p,g=o[2];e>3?(i=g===n)&&(s=o[(a=o[4])?5:(a=3,3)],o[4]=o[5]=t):o[0]<=p&&((i=e<2&&p<o[1])?(a=0,f.v=n,f.n=o[1]):p<g&&(i=e<3||o[0]>n||n>g)&&(o[4]=e,o[5]=n,f.n=g,a=0))}if(i||e>1)return l;throw d=!0,n}return function(i,c,g){if(u>1)throw TypeError("Generator is already running");for(d&&1===c&&p(c,g),a=c,s=g;(r=a<2?t:s)||!d;){o||(a?a<3?(a>1&&(f.n=-1),p(a,s)):f.n=s:f.v=s);try{if(u=2,o){if(a||(i="next"),r=o[i]){if(!(r=r.call(o,s)))throw TypeError("iterator result is not an object");if(!r.done)return r;s=r.value,a<2&&(a=0)}else 1===a&&(r=o.return)&&r.call(o),a<2&&(s=TypeError("The iterator does not provide a '"+i+"' method"),a=1);o=t}else if((r=(d=f.n<0)?s:e.call(n,f))!==l)break}catch(e){o=t,a=1,s=e}finally{u=1}}return{value:r,done:d}}}(e,o,a),!0),u}var l={};function c(){}function d(){}function f(){}r=Object.getPrototypeOf;var p=[][a]?r(r([][a]())):(n(r={},a,function(){return this}),r),g=f.prototype=c.prototype=Object.create(p);function h(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,f):(e.__proto__=f,n(e,s,"GeneratorFunction")),e.prototype=Object.create(g),e}return d.prototype=f,n(g,"constructor",f),n(f,"constructor",d),d.displayName="GeneratorFunction",n(f,s,"GeneratorFunction"),n(g),n(g,s,"Generator"),n(g,a,function(){return this}),n(g,"toString",function(){return"[object Generator]"}),(e.exports=i=function(){return{w:u,m:h}},e.exports.__esModule=!0,e.exports.default=e.exports)()}e.exports=i,e.exports.__esModule=!0,e.exports.default=e.exports}},t={};function r(n){var i=t[n];if(void 0!==i)return i.exports;var o=t[n]={exports:{}};return e[n](o,o.exports,r),o.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};return(()=>{"use strict";function e(e,t,r,n,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,i)}function t(t){return function(){var r=this,n=arguments;return new Promise(function(i,o){var a=t.apply(r,n);function s(t){e(a,i,o,s,u,"next",t)}function u(t){e(a,i,o,s,u,"throw",t)}s(void 0)})}}function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}function o(e){var t=function(e,t){if("object"!=i(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=i(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==i(t)?t:t+""}function a(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,o(n.key),n)}}function s(e,t,r){return(t=o(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}r.r(n),r.d(n,{holidoitExperienceGridDrawerLoader:()=>L});var u=r(756),l=r.n(u),c="HOLIDOIT_ANALYTICS_EVENT";function d(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return f(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?f(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function f(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}var p="holidoit_analytics_dedupe_keys",g=new Set;function h(e){return"object"===i(e)&&null!==e&&!Array.isArray(e)}function v(){if("undefined"==typeof window)return null;try{return window.sessionStorage}catch(e){return null}}function y(){var e=v();if(!e)return[];try{var t=e.getItem(p);if(!t)return[];var r=JSON.parse(t);return Array.isArray(r)?r.filter(function(e){return"string"==typeof e&&e.length>0}):[]}catch(e){return[]}}function m(e){if(e){g.add(e);var t=y().filter(function(t){return t!==e});t.push(e),function(e){var t=v();if(t)try{t.setItem(p,JSON.stringify(e.slice(-200)))}catch(e){}}(t)}}function w(e,t){return"undefined"!=typeof window&&(!function(e){return!(!e||!g.has(e)&&(!y().includes(e)||(g.add(e),0)))}(t)&&(Array.isArray(window.dataLayer)||(window.dataLayer=[]),m(t),window.dataLayer.push(e),!0))}function b(e){if(!h(e)||e.type!==c)return null;var t,r=h(e.payload)?e.payload:e,n=r.channel,i=r.dedupeKey,o=r.eventData,a=r.source,s=r.widgetType;return"dataLayer"!==n||"embed"!==a&&"widget"!==a||"string"!=typeof i||""===i.trim()||(!h(t=o)||"string"!=typeof t.event||""===t.event.trim())?null:{channel:n,dedupeKey:i.trim(),eventData:o,source:a,widgetType:"string"==typeof s&&s.trim()?s:void 0}}function x(e){try{return new URL(e,window.location.href).origin}catch(e){return null}}function S(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return P(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?P(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function P(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function O(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function _(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?O(Object(r),!0).forEach(function(t){s(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):O(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var E="holidoitExperienceGridDrawerWidget",I="holidoitWidget",A=function(){return e=function e(){var t=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),s(this,"config",null),s(this,"widgets",[]),s(this,"isInitialized",!1),s(this,"mutationObserver",null),s(this,"resizeObserver",null),s(this,"autoInsertedElement",null),s(this,"handleMessage",function(e){var r=e.data||{},n=r.type,i=r.height;if(n!==c)if("HOLIDOIT_WIDGET_RESIZE"!==n||"number"!=typeof i){if("HOLIDOIT_WIDGET_READY"===n){if(!t.findTrustedWidgetForEvent(e))return;t.log("Widget ready:",e.data)}}else{var o=t.findTrustedWidgetForEvent(e);if(!o)return;if(Math.abs(i-o.lastAppliedHeight)<15)return;requestAnimationFrame(function(){o.iframe.style.height="".concat(i,"px"),o.lastAppliedHeight=i,t.log("Resized widget to",i,"px")})}else t.handleAnalyticsMessage(e)})},r=[{key:"init",value:function(e){if(e.embedId){if(this.isInitialized)return this.log("Already initialized, updating config"),this.config=_(_({},this.config),e),void this.scanAndCreateWidgets();this.config=e,this.isInitialized=!0,this.log("Initializing experience grid drawer loader",e),this.setupMessageListener(),this.setupResizeObserver(),this.bootstrap()}}},{key:"bootstrap",value:(o=t(l().mark(function e(){return l().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=1,this.ensureHolidoitApi();case 1:e.sent&&this.initializeHolidoit(),this.scanAndCreateWidgets(),this.observeForWidgets();case 2:case"end":return e.stop()}},e,this)})),function(){return o.apply(this,arguments)})},{key:"getHolidoitApi",value:function(){return"undefined"==typeof window?null:window.Holidoit||null}},{key:"ensureHolidoitApi",value:(i=t(l().mark(function e(){var t,r,n,i,o,a,s;return l().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.getHolidoitApi()){e.next=1;break}return e.abrupt("return",!0);case 1:if(!1!==(null===(t=this.config)||void 0===t?void 0:t.includeLoader)){e.next=2;break}return this.log("includeLoader=false and Holidoit API not found"),e.abrupt("return",!1);case 2:r=this.getLoaderSourceCandidates(),n=S(r),e.prev=3,n.s();case 4:if((i=n.n()).done){e.next=10;break}return o=i.value,e.prev=5,this.log("Attempting to load Holidoit loader from",o),e.next=6,this.loadExternalScript(o);case 6:if(!this.getHolidoitApi()){e.next=7;break}return this.log("Holidoit API loaded successfully"),e.abrupt("return",!0);case 7:e.next=9;break;case 8:e.prev=8,a=e.catch(5),this.log("Failed loading Holidoit loader from",o,a);case 9:e.next=4;break;case 10:e.next=12;break;case 11:e.prev=11,s=e.catch(3),n.e(s);case 12:return e.prev=12,n.f(),e.finish(12);case 13:return e.abrupt("return",!1);case 14:case"end":return e.stop()}},e,this,[[3,11,12,13],[5,8]])})),function(){return i.apply(this,arguments)})},{key:"getLoaderSourceCandidates",value:function(){var e,t,r=[],n=null===(e=this.config)||void 0===e?void 0:e.loaderSrc,i=null===(t=this.config)||void 0===t?void 0:t.scriptSrc;if(n&&r.push(n),i)try{r.push(new URL("../holidoit.js",i).toString())}catch(e){}return r.push("https://cdn.holidoit.com/holidoit.js"),Array.from(new Set(r))}},{key:"loadExternalScript",value:function(e){var t=this;return new Promise(function(r,n){if(e){var i=Array.from(document.querySelectorAll("script")).find(function(t){return t.src===e});if(i)return t.getHolidoitApi()?void r():(i.addEventListener("load",function(){return r()},{once:!0}),void i.addEventListener("error",function(){return n(new Error("Failed to load script: ".concat(e)))},{once:!0}));var o=document.createElement("script");o.src=e,o.async=!0,o.onload=function(){return r()},o.onerror=function(){return n(new Error("Failed to load script: ".concat(e)))},document.head.appendChild(o)}else n(new Error("Missing script src"))})}},{key:"initializeHolidoit",value:function(){var e=this.getHolidoitApi();if(null!=e&&e.init&&this.config){var t,r=this.config.drawerLanguage||this.config.language;document.getElementById("holidoit-loader-container")?(this.log("Holidoit drawer already initialized on page, reusing existing instance"),r&&(null===(t=e.changeLanguage)||void 0===t||t.call(e,r))):e.init({embedId:this.config.embedId,language:r,embedUrl:this.config.embedUrl,floatingButton:!1,debug:this.config.debug})}}},{key:"setupMessageListener",value:function(){window.addEventListener("message",this.handleMessage)}},{key:"handleAnalyticsMessage",value:function(e){var t=this,r=this.findTrustedWidgetForEvent(e);!function(e){var t=e.event,r=e.isTrustedSource,n=e.widgetSrc,i=e.log;if(r){var o=b(t.data);o&&"widget"===o.source&&(w(o.eventData,o.dedupeKey)?null==i||i("Pushed analytics event to dataLayer",{dedupeKey:o.dedupeKey,widgetType:o.widgetType,src:n}):null==i||i("Skipped duplicate analytics event",o.dedupeKey))}else null==i||i("Ignored analytics message from untrusted iframe",t.origin)}({event:e,isTrustedSource:Boolean(r),widgetSrc:null==r?void 0:r.src,log:function(){return t.log.apply(t,arguments)}})}},{key:"findTrustedWidgetForEvent",value:function(e){return function(e){var t,r=e.widgets,n=e.event,i=e.getWidgetSrc,o=d(r);try{for(o.s();!(t=o.n()).done;){var a=t.value;if(a.iframe.contentWindow===n.source){var s=x(i(a));return s&&n.origin===s?a:null}}}catch(e){o.e(e)}finally{o.f()}return null}({widgets:this.widgets,event:e,getWidgetSrc:function(e){return e.src}})}},{key:"setupResizeObserver",value:function(){var e=this;this.resizeObserver=new ResizeObserver(function(t){var r,n=S(t);try{for(n.s();!(r=n.n()).done;){var i,o=r.value.target,a=S(e.widgets);try{for(a.s();!(i=a.n()).done;){var s=i.value;if(s.element===o){var u;null===(u=s.iframe.contentWindow)||void 0===u||u.postMessage({type:"HOLIDOIT_REQUEST_HEIGHT"},"*");break}}}catch(e){a.e(e)}finally{a.f()}}}catch(e){n.e(e)}finally{n.f()}})}},{key:"getWidgetElements",value:function(){var e=[],t=new Set;return document.querySelectorAll(".".concat(E)).forEach(function(r){var n=r;t.has(n)||(t.add(n),e.push(n))}),document.querySelectorAll(".".concat(I)).forEach(function(r){var n=r;(n.dataset.src||"").includes("widget-experience-grid-drawer.html")&&!t.has(n)&&(t.add(n),e.push(n))}),e}},{key:"ensureAutoInsertedPlaceholder",value:function(){var e,t;if(!1!==(null===(e=this.config)||void 0===e?void 0:e.autoInsertIfMissing)&&!(this.getWidgetElements().length>0||this.autoInsertedElement&&document.body.contains(this.autoInsertedElement))){var r=document.createElement("div");r.className=E;var n=null===(t=this.config)||void 0===t?void 0:t.scriptElement;null!=n&&n.parentNode?n.parentNode.insertBefore(r,n.nextSibling):document.body.appendChild(r),this.autoInsertedElement=r,this.log("Auto-inserted .holidoitExperienceGridDrawerWidget placeholder")}}},{key:"resolveWidgetUrl",value:function(){var e,t;if(null!==(e=this.config)&&void 0!==e&&e.widgetUrl)return this.config.widgetUrl;if(null!==(t=this.config)&&void 0!==t&&t.scriptSrc)try{return new URL("./widget-experience-grid-drawer.html",this.config.scriptSrc).toString()}catch(e){}return"https://cdn.holidoit.com/widgets/widget-experience-grid-drawer.html"}},{key:"scanAndCreateWidgets",value:function(){this.ensureAutoInsertedPlaceholder();var e,t=S(this.getWidgetElements());try{for(t.s();!(e=t.n()).done;){var r=e.value;"true"!==r.dataset.holidoitProcessed&&this.createWidget(r)}}catch(e){t.e(e)}finally{t.f()}}},{key:"applyWidgetParams",value:function(e,t){var r,n,i,o,a,s;null!==(r=this.config)&&void 0!==r&&r.embedId&&!e.searchParams.has("embedId")&&e.searchParams.set("embedId",this.config.embedId);var u=t.dataset.language||(null===(n=this.config)||void 0===n?void 0:n.language);u&&!e.searchParams.has("lang")&&e.searchParams.set("lang",u);var l=t.dataset.experiences||(null===(i=this.config)||void 0===i?void 0:i.experiences);l&&!e.searchParams.has("experiences")&&e.searchParams.set("experiences",l);var c=t.dataset.showLanguagePicker,d=void 0===(null===(o=this.config)||void 0===o?void 0:o.showLanguagePicker)?void 0:String(this.config.showLanguagePicker),f=null!=c?c:d;void 0===f||e.searchParams.has("show_language_picker")||e.searchParams.set("show_language_picker",f);var p=t.dataset.withLogo,g=void 0===(null===(a=this.config)||void 0===a?void 0:a.withLogo)?void 0:String(this.config.withLogo),h=null!=p?p:g;void 0===h||e.searchParams.has("with_logo")||e.searchParams.set("with_logo",h);var v=t.dataset.gift,y=void 0===(null===(s=this.config)||void 0===s?void 0:s.gift)?void 0:String(this.config.gift),m=null!=v?v:y;void 0===m||e.searchParams.has("gift")||e.searchParams.set("gift",m)}},{key:"createWidget",value:function(e){var t,r,n=e.dataset.src;n||(n=this.resolveWidgetUrl());try{r=new URL(n,window.location.href)}catch(e){return}this.applyWidgetParams(r,e);var i=document.createElement("iframe");i.className="holidoit-experience-grid-drawer-iframe",i.src=r.toString(),i.allow="payment",i.setAttribute("scrolling","auto"),i.setAttribute("frameborder","0"),i.style.cssText="\n width: 100% !important;\n min-height: ".concat(400,"px !important;\n border: none !important;\n display: block !important;\n "),i.setAttribute("sandbox","allow-scripts allow-same-origin allow-forms allow-popups allow-popups-to-escape-sandbox"),e.innerHTML="",e.appendChild(i),e.dataset.holidoitProcessed="true";var o={element:e,iframe:i,src:r.toString(),lastAppliedHeight:400};this.widgets.push(o),null===(t=this.resizeObserver)||void 0===t||t.observe(e),this.log("Created experience grid drawer widget",o)}},{key:"observeForWidgets",value:function(){var e=this;this.mutationObserver||(this.mutationObserver=new MutationObserver(function(t){var r,n=!1,i=S(t);try{for(i.s();!(r=i.n()).done;){var o=r.value;if("childList"===o.type){for(var a=0,s=Array.from(o.addedNodes);a<s.length;a++){var u,l,c,d,f=s[a];if(f instanceof HTMLElement&&(null!==(u=f.classList)&&void 0!==u&&u.contains(E)||null!==(l=f.querySelector)&&void 0!==l&&l.call(f,".".concat(E))||null!==(c=f.matches)&&void 0!==c&&c.call(f,".".concat(I,'[data-src*="widget-experience-grid-drawer.html"]'))||null!==(d=f.querySelector)&&void 0!==d&&d.call(f,".".concat(I,'[data-src*="widget-experience-grid-drawer.html"]')))){n=!0;break}}if(n)break}}}catch(e){i.e(e)}finally{i.f()}n&&(e.log("Detected new grid drawer widget elements, scanning..."),e.scanAndCreateWidgets())}),this.mutationObserver.observe(document.body,{childList:!0,subtree:!0}))}},{key:"changeLanguage",value:function(e){var t,r;this.config&&(this.config.language=e);var n=this.getHolidoitApi();null==n||null===(t=n.changeLanguage)||void 0===t||t.call(n,(null===(r=this.config)||void 0===r?void 0:r.drawerLanguage)||e);var i,o=S(this.widgets);try{for(o.s();!(i=o.n()).done;){var a;null===(a=i.value.iframe.contentWindow)||void 0===a||a.postMessage({type:"HOLIDOIT_CHANGE_LANGUAGE",payload:{language:e}},"*")}}catch(e){o.e(e)}finally{o.f()}}},{key:"destroy",value:function(){var e,t,r;this.log("Destroying experience grid drawer widgets"),window.removeEventListener("message",this.handleMessage);var n,i=S(this.widgets);try{for(i.s();!(n=i.n()).done;){var o=n.value;o.iframe.remove(),o.element.dataset.holidoitProcessed="false"}}catch(e){i.e(e)}finally{i.f()}this.widgets=[],null===(e=this.mutationObserver)||void 0===e||e.disconnect(),this.mutationObserver=null,null===(t=this.resizeObserver)||void 0===t||t.disconnect(),this.resizeObserver=null,this.isInitialized=!1,this.config=null,null!==(r=this.autoInsertedElement)&&void 0!==r&&r.parentNode&&this.autoInsertedElement.parentNode.removeChild(this.autoInsertedElement),this.autoInsertedElement=null}},{key:"log",value:function(){var e;if(null!==(e=this.config)&&void 0!==e&&e.debug){for(var t,r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];(t=console).log.apply(t,["[HolidoitExperienceGridDrawer]"].concat(n))}}}],r&&a(e.prototype,r),n&&a(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r,n,i,o}(),L=new A;if("undefined"!=typeof window){var k=document.currentScript;if(k){var j=new URL(k.src,window.location.href),T=j.searchParams.get("embedId")||k.dataset.embedId;if(T){var M=j.searchParams.get("lang")||k.dataset.language,H=j.searchParams.get("drawerLang")||k.dataset.drawerLang||k.dataset.drawerLanguage||M,W=j.searchParams.get("includeLoader")||k.dataset.includeLoader,D=null==W?void 0:"false"!==W,G=j.searchParams.get("show_language_picker")||j.searchParams.get("showLanguagePicker")||k.dataset.showLanguagePicker,N=null==G?void 0:"false"!==G,U=j.searchParams.get("with_logo")||j.searchParams.get("withLogo")||k.dataset.withLogo,z=null==U?void 0:"true"===U,C=j.searchParams.get("gift")||k.dataset.gift,F=null==C?void 0:"true"===C;L.init({embedId:T,language:M,drawerLanguage:H,includeLoader:D,withLogo:z,gift:F,loaderSrc:j.searchParams.get("loaderSrc")||k.dataset.loaderSrc||void 0,embedUrl:j.searchParams.get("embedUrl")||k.dataset.embedUrl||void 0,widgetUrl:j.searchParams.get("widgetUrl")||k.dataset.widgetUrl||void 0,experiences:j.searchParams.get("experiences")||k.dataset.experiences||void 0,showLanguagePicker:N,debug:"true"===j.searchParams.get("debug")||"true"===k.dataset.debug,autoInsertIfMissing:"false"!==(j.searchParams.get("autoInsertIfMissing")||k.dataset.autoInsertIfMissing),scriptSrc:k.src,scriptElement:k})}}window.HolidoitExperienceGridDrawer=L}})(),n})());