"}getUiOutput(){const e=window.HotelwizeApp.Resources[this.plugin.assemblyName];return`\n
\n `}renderCookieControlSettings(){const e=window.HotelwizeApp.Resources[this.plugin.assemblyName];return` `}renderTableRows(){const e=window.HotelwizeApp.Resources[this.plugin.assemblyName];let t="";for(const[n,o]of Object.entries(this.TrackerCategories)){const i=o,r=i==a.Trackers.TrackingCategory.Required,c=i==a.Trackers.TrackingCategory.Required||this.plugin.hasConsent(i),s=this.plugin.getCookiesListByTrackingCategory(i);0!==s.length&&(t+=` `)}return t}renderSwitch(e,t=!1,n=!1){const o=n?" checked":"",i=t?" disabled":"";return``}getCookiesList(e){const t=window.HotelwizeApp.Resources[this.plugin.assemblyName];let n=' ",n}convertToTime(e){const t=window.HotelwizeApp.Resources[this.plugin.assemblyName];if(!e)return e.toString();const n=e/3600,o=e/60,i=Math.round(e/86400);if(n<1){if(o<1)return`${e}s`;if(1==o)return`${o} ${t.CookieDurationMinute}`;if(o>1)return`${o} ${t.CookieDurationMinutes}`}else if(n<=24)return`${n} ${t.CookieDurationHours}`;return`${i} ${t.CookieDurationDays}`}setupCookieControlSettingsClickEvents(){const e=document.getElementsByClassName("cookie-control-checkbox"),t=document.getElementsByClassName("view-cookies"),n=document.getElementsByClassName("cookie-control-toggle");null!=e&&Array.from(e).forEach((e=>{e.addEventListener("change",(e=>{if(null!=e.target){const t=e.target,n=this.TrackerCategories[t.name],o=t.checked;this.plugin.setStoreTrackingPreference(n,o),this.plugin.acceptRevokeTrackingCategory(n,o),this.plugin.logUserConsent(),this.setClientSettingsClose(!0),o?window.HotelwizeApp.Analytics.setConsent(n):window.HotelwizeApp.Analytics.clearConsent(n)}}))})),null!=t&&Array.from(t).forEach((e=>{e.addEventListener("click",(e=>{if(null!=e&&null!=e.target){e.preventDefault();const t=e.target,n=t.nextElementSibling.classList;n.contains("opened")?(t.classList.remove("active"),n.remove("opened")):(t.classList.add("active"),n.add("opened"))}}))})),null!=n&&Array.from(n).forEach((e=>{e.addEventListener("click",(e=>{if(null!=e.target){const t=e.target;Array.from(n).forEach((t=>{null!=t&&t!==e.target&&t.parentNode.classList.remove("active")}));const o=t.parentNode.classList;o.contains("active")?o.remove("active"):o.add("active")}}))}))}setupClickEvents(){const e=document.getElementsByClassName("cookie-control-bar-open"),t=document.getElementsByClassName("cookie-control-bar-close"),n=document.getElementById("cookie-control-bar-customize"),o=document.getElementsByClassName("cookie-control-disable-all"),i=document.getElementsByClassName("cookie-control-allow-all");null!=e&&Array.from(e).forEach((e=>{e.addEventListener("click",(()=>{this.showConsentBar(200)}))})),null!=t&&Array.from(t).forEach((e=>{e.addEventListener("click",(()=>{this.hideConsentBar(200),this.setClientSettingsClose(!0)}))})),null!=n&&n.addEventListener("click",(()=>{const e=this;e.consentBarWrapper.style.display="none",e.consentSettingsWrapper.style.display="block",""===e.consentSettingsWrapper.innerHTML.trim()&&(e.consentSettingsWrapper.innerHTML=e.renderCookieControlSettings(),setTimeout((function(){e.setupCookieControlSettingsClickEvents()}),100))})),null!=i&&Array.from(i).forEach((e=>{e.addEventListener("click",(()=>{this.toggleAllCookies(!0),this.hideConsentBar(750)}))})),null!=o&&Array.from(o).forEach((e=>{e.addEventListener("click",(()=>{this.toggleAllCookies(!1),this.hideConsentBar(750)}))}))}toggleAllCookies(e=!0){for(const[t,n]of Object.entries(this.TrackerCategories)){const o=n;if(0===this.plugin.getCookiesListByTrackingCategory(n).length||"required"===n)continue;try{document.getElementById(`cookie-control-category-switch-${o.toLowerCase()}`).checked=e}catch(e){}const i=this.TrackerCategories[t];this.plugin.setStoreTrackingPreference(i,e),this.plugin.acceptRevokeTrackingCategory(i,e),e?window.HotelwizeApp.Analytics.setConsent(i):window.HotelwizeApp.Analytics.clearConsent(i)}e?window.HotelwizeApp.Analytics.setConsent(a.Trackers.TrackingCategory.Personalization):window.HotelwizeApp.Analytics.clearConsent(a.Trackers.TrackingCategory.Personalization),this.plugin.setStoreTrackingPreference(a.Trackers.TrackingCategory.Personalization,e),this.plugin.acceptRevokeTrackingCategory(a.Trackers.TrackingCategory.Personalization,e),this.plugin.logUserConsent(),this.setClientSettingsClose(!0)}setClientSettingsClose(e=!0){this.plugin.clientSettings.cookieConsentClosed=e,this.plugin.saveClientSettings()}}},181:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CookieControlNotificationUI=void 0,t.CookieControlNotificationUI=class{constructor(e){this.plugin=e}init(){const e=this;e.renderNotificationBar();let t=e.plugin.clientSettings.CookieNotificationAccepted;void 0!==t&&!1!==t||(e.showNotificationBar(),document.getElementById("cookie-control-notification-bar__button").addEventListener("click",(function(t){e.hideNotificationBar(),e.plugin.clientSettings.CookieNotificationAccepted=!0,e.plugin.saveClientSettings()})))}showNotificationBar(e=0){try{document.getElementById("cookie-control-notification-bar").style.display="block"}catch(e){console.warn("Failed to display cookie control notification bar",e)}}hideNotificationBar(e=0){try{document.getElementById("cookie-control-notification-bar").style.display="none"}catch(e){console.warn("Failed to hide cookie control notification bar",e)}}renderNotificationBar(){const e=window.HotelwizeApp.Resources[this.plugin.assemblyName];var t=` `;document.body.insertAdjacentHTML("beforeend",t)}}},629:function(e,t,n){var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},a=this&&this.__awaiter||function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function a(e){try{s(o.next(e))}catch(e){r(e)}}function c(e){try{s(o.throw(e))}catch(e){r(e)}}function s(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,c)}s((o=o.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.CookieControl=void 0;const c=r(n(212)),s=r(n(371)),l=n(907),u=n(579),d=n(544),h=n(691),f=n(901),m=n(181);l.PluginClientSettings;class p extends s.Plugins.Plugin{constructor(e){var t,n,o;super(e),this.endPointUrl=null===(t=null==e?void 0:e.configuration)||void 0===t?void 0:t.consentLogEndpointUrl,this.uiType=null===(n=null==e?void 0:e.configuration)||void 0===n?void 0:n.uiType,this.uiPosition=null===(o=null==e?void 0:e.configuration)||void 0===o?void 0:o.uiPosition,this.trackingPreferences=new Map,this.loadTrackingPreferences();let i=new s.Trackers.Tracker;i.plugin=this,i.id="cookieControl",i.name="Cookie Control",i.isRequired=!0,i.priority=999;let r=new s.Cookies.Cookie;r.name=`${this.assemblyName}.TrackingPreferences`,r.maxLifeTime=2592e3,r.storageType=s.Cookies.CookieStorageType.LocalStorage,r.purpose=s.Trackers.TrackingCategory.Required,r.isThirdParty=!1,i.cookies.push(r),this.trackers.push(i)}initialize(){this.getUiType()}onWindowLoaded(){return a(this,void 0,void 0,(function*(){}))}getUiType(){return void 0!==this.uiType&&null!=this.uiType&&"auto"!==this.uiType||([...this.getCookiesListByTrackingCategory(s.Trackers.TrackingCategory.Functionality),...this.getCookiesListByTrackingCategory(s.Trackers.TrackingCategory.Marketing),...this.getCookiesListByTrackingCategory(s.Trackers.TrackingCategory.Performance)].length>0?(this.uiType="consent",window.cookieConsentModeEnabled=!0):(this.uiType="notification",window.cookieConsentModeEnabled=!1)),this.uiType}processPopup(){"notification"===this.uiType?new m.CookieControlNotificationUI(this).init():new f.CookieControlConsentUI(this).init()}loadTrackingPreferences(){var e=new s.Support.LocalStorage;if(e.isSupported()){let t=e.getItem(`${this.assemblyName}.TrackingPreferences`);this.trackingPreferences=null==t?new Map:t}}setStoreTrackingPreference(e,t){this.trackingPreferences.set(e,t),this.storeTrackingPreferences()}storeTrackingPreferences(){var e=new s.Support.LocalStorage;e.isSupported()&&e.setItem(`${this.assemblyName}.TrackingPreferences`,this.trackingPreferences,2592e3)}hasConsent(e){var t;return!!this.trackingPreferences.has(e)&&null!==(t=this.trackingPreferences.get(e))&&void 0!==t&&t}run(e){return a(this,void 0,void 0,(function*(){if(this.getUiType(),null===console||void 0===console||console.info(`Using Cookie Control UI in ${this.uiType} mode.`),"consent"===this.uiType){this.visitorId=yield this.getVisitorId(),this.registeredPlugins=e;let t=this.filterPurgeCookies(e);yield this.runAcceptedTrackers(t),this.processPopup()}else if("notification"==this.uiType){this.processPopup();let t=this.clientSettings.CookieNotificationAccepted;if(void 0===t||!1===t){const e=this;document.getElementById("cookie-control-notification-bar").style.display="block",document.getElementById("cookie-control-notification-bar__button").addEventListener("click",(function(t){document.getElementById("cookie-control-notification-bar").style.display="none",e.clientSettings.CookieNotificationAccepted=!0,e.saveClientSettings()}))}const n=new s.Trackers.DefaultTrackerManager;yield n.run(e)}}))}runAcceptedTrackers(e){return a(this,void 0,void 0,(function*(){e.sort(((e,t)=>e.priority>t.priority||e.priority===t.priority&&e.isRequired>t.isRequired?1:-1));let t=this.getAcceptedTrackingCategories();yield e.forEach((e=>a(this,void 0,void 0,(function*(){var n;try{(null===(n=e.plugin)||void 0===n?void 0:n.isPageActive)&&(null===console||void 0===console||console.info(`Running accepted tracker ${e.plugin.name}.`),yield e.onAccept(e.plugin,e,t))}catch(t){null===console||void 0===console||console.error(`Error thrown while running onAccept event for ${e.name}`,t)}})))),t.forEach((e=>{window.HotelwizeApp.Analytics.setConsent(e)}))}))}filterPurgeCookies(e){let t=new s.Support.CookieStorage,n=new s.Support.LocalStorage,o=new s.Support.SessionStorage,i=t.getKeys(),r=n.getKeys(),a=o.getKeys(),c=[],l=[],u=[];const d=this.getAcceptedTrackingCategories();let h=[];return window.HotelwizeApp.RegisteredThemeCookies.forEach((e=>{if(null!=e.name)switch(e.storageType){case s.Cookies.CookieStorageType.HttpCookie:c.push(e.nameRegex||e.name);break;case s.Cookies.CookieStorageType.LocalStorage:l.push(e.nameRegex||e.name);break;case s.Cookies.CookieStorageType.SessionStorage:u.push(e.nameRegex||e.name)}})),e.forEach((e=>{null!=e.cookies&&e.cookies.forEach((e=>{if(null!=e.name)switch(e.storageType){case s.Cookies.CookieStorageType.HttpCookie:c.push(e.nameRegex||e.name);break;case s.Cookies.CookieStorageType.LocalStorage:l.push(e.nameRegex||e.name);break;case s.Cookies.CookieStorageType.SessionStorage:u.push(e.nameRegex||e.name)}})),e.trackers.forEach((t=>{let n=!1;if(null!=t.cookies){const e=t.cookies.filter((e=>e.isSystemCookie));t.cookies.length==e.length?n=!0:t.cookies.forEach((e=>{if(!e.isSystemCookie&&d.includes(e.purpose)&&(n=!0,null!=e.name))switch(e.storageType){case s.Cookies.CookieStorageType.HttpCookie:c.push(e.nameRegex||e.name);break;case s.Cookies.CookieStorageType.LocalStorage:l.push(e.nameRegex||e.name);break;case s.Cookies.CookieStorageType.SessionStorage:u.push(e.nameRegex||e.name)}}))}n&&(t.plugin=e,h.push(t))}))})),i.forEach((e=>{let n=!1;""!=e&&(c.forEach((t=>{n||e!==t&&!s.Support.StringHelpers.matchRuleShort(e,t)||(n=!0)})),n||(null===console||void 0===console||console.info(`Removing http cookie: ${e}`),t.removeItem(e)))})),r.forEach((e=>{let t=!1;""!=e&&(l.forEach((n=>{t||e!==n&&!s.Support.StringHelpers.matchRuleShort(e,n)||(t=!0)})),t||(null===console||void 0===console||console.debug(`Removing local storage cookie: ${e}`),n.removeItem(e)))})),a.forEach((e=>{let t=!1;""!=e&&(u.forEach((n=>{t||e!==n&&!s.Support.StringHelpers.matchRuleShort(e,n)||(t=!0)})),t||(null===console||void 0===console||console.debug(`Removing sesion storage cookie: ${e}`),o.removeItem(e)))})),h}getTrackersOfCategory(e){let t=[];return this.registeredPlugins.forEach((n=>{n.trackers.forEach((o=>{let i=!1;o.cookies.forEach((t=>{i||t.purpose!==e||(i=!0)})),i&&(o.plugin=n,t.push(o))}))})),t}acceptRevokeTrackingCategory(e,t){return a(this,void 0,void 0,(function*(){const n=this.getTrackersOfCategory(e),o=this.getAcceptedTrackingCategories();yield n.forEach((n=>a(this,void 0,void 0,(function*(){if(void 0!==n.plugin&&null!=n.plugin&&n.plugin.isPageActive)try{if(t){try{n.plugin.analyticsService?null===console||void 0===console||console.info(`Accepting tracker ${n.plugin.analyticsService.name} for category ${e}.`):null===console||void 0===console||console.info(`Accepting tracker ${n.plugin.name} (${n.plugin.instanceId}) for category ${e}.`)}catch(e){}try{yield n.onAccept(n.plugin,n,o)}catch(t){null===console||void 0===console||console.error(`Failed while accepting tracker ${n.plugin.name} (${n.plugin.instanceId}) for category ${e}.`)}}else{try{n.plugin.analyticsService?null===console||void 0===console||console.info(`Revoking tracker ${n.plugin.analyticsService.name} for category ${e}.`):null===console||void 0===console||console.info(`Revoking tracker ${n.plugin.name} (${n.plugin.instanceId}) for category ${e}.`)}catch(t){null===console||void 0===console||console.error(`Failed while revoking tracker ${n.plugin.name} (${n.plugin.instanceId}) for category ${e}.`)}try{yield n.onRevoke(n.plugin,n,o)}catch(e){}}}catch(e){null===console||void 0===console||console.error(e)}})))),this.filterPurgeCookies(this.registeredPlugins)}))}getCookiesListByTrackingCategory(e){let t=[],n=window.HotelwizeApp.getTrackersByCategory(e);return e===s.Trackers.TrackingCategory.Required&&(window.HotelwizeApp.RegisteredThemeCookies.forEach((e=>{null!=e.name&&t.push(e)})),window.HotelwizeApp.RegisteredPlugins.forEach(((e,n)=>{e.forEach((e=>{null!=e.cookies&&e.cookies.forEach((e=>{null!=e.name&&(t.find((t=>t.name==e.name))||t.push(e))}))}))}))),n.forEach((e=>{e.cookies.forEach((n=>{n.tracker=e,t.push(n)}))})),t}getVisitorId(){return a(this,void 0,void 0,(function*(){const e=yield c.load();return(yield e.get()).visitorId}))}getAcceptedTrackingCategories(){let e=[];return this.trackingPreferences.forEach(((t,n)=>{!0===t&&e.push(n)})),e.includes(s.Trackers.TrackingCategory.Required)||e.push(s.Trackers.TrackingCategory.Required),e}getCookiePolicyPageLink(){let e=this.configuration,t="#";try{(null==e?void 0:e.cookiePolicyPageUrl)&&(t=null==e?void 0:e.cookiePolicyPageUrl)}catch(e){}return t}logUserConsent(){if(void 0===this.endPointUrl||""==this.endPointUrl)return void(null===console||void 0===console||console.error("Cookie Consent Log Endpoint URL is invalid"));const e=[],t=this.getAcceptedTrackingCategories(),n=new u.ConsentLogItem;n.siteId=window.HotelwizeApp.SiteId,n.browserUID=this.visitorId,n.referrer=document.location.href,n.preferences=t,n.trackers=[],n.cookies=[],this.registeredPlugins.forEach((o=>{let i=!1;o.trackers.forEach((n=>{let r=!1;n.cookies.forEach((e=>{!r&&t.includes(e.purpose)&&(r=!0)})),r&&(i=!0,n.plugin=o,e.push(n))})),i&&o.cookies.forEach((e=>{var t;const i=new d.ConsentLogItemCookie;i.name=e.name||"",i.owner=o.assemblyName,i.storageType=e.storageType,null===(t=n.cookies)||void 0===t||t.push(i)}))})),e.forEach((e=>{var o,i,r;const a=new h.ConsentLogItemTracker;a.id=e.id,a.name=null===(o=e.plugin)||void 0===o?void 0:o.assemblyName,a.version=null===(i=e.plugin)||void 0===i?void 0:i.assemblyVersion,a.cookies=[],e.cookies.forEach((e=>{var n;if(t.includes(e.purpose)){const t=new d.ConsentLogItemCookie;t.name=e.name||"",t.owner=void 0,t.storageType=e.storageType,null===(n=a.cookies)||void 0===n||n.push(t)}})),null===(r=n.trackers)||void 0===r||r.push(a)})),window.HotelwizeApp.RegisteredThemeCookies.forEach((e=>{var t;if(null!=e.name){const o=new d.ConsentLogItemCookie;o.name=e.name,o.owner="theme",o.storageType=e.storageType,null===(t=n.cookies)||void 0===t||t.push(o)}}));const o=new XMLHttpRequest;o.onreadystatechange=function(){4==this.readyState&&this.status},o.open("POST",this.endPointUrl,!0),o.setRequestHeader("Content-Type","application/json;charset=UTF-8"),o.send(JSON.stringify(n))}}t.CookieControl=p},371:e=>{e.exports=window.Hotelwize}},t={};function n(o){var i=t[o];if(void 0!==i)return i.exports;var r=t[o]={exports:{}};return e[o].call(r.exports,r,r.exports,n),r.exports}n.d=(e,t)=>{for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o=n(629);self["Hotelwize.Plugins.PrivacyProtection.CookieControl"]=o})(); let cookieControlPlugin = new globalThis['Hotelwize.Plugins.PrivacyProtection.CookieControl'].CookieControl({ "id": 62, "instanceId": "340a5336-6a60-4e44-95b4-e0a102a50f90", "instanceOrder": 0, "type": "privacyProtection", "isTypeDefault": false, "name": "Website Cookie Control", "assemblyName": "Hotelwize.Plugins.PrivacyProtection.CookieControl", "assemblyVersion": "1.2.14.0", "configuration": { "uiType": "auto", "uiPosition": "bottom", "notificationDoNotDisturbPeriod": 30, "notificationBgColor": "#ffffff", "notificationTextColor": "#000000", "notificationButtonBgColor": "#000000", "notificationButtonTextColor": "#ffffff", "consentLogEndpointUrl": "https://services.hotelwize.com/api/CookieConsent", "consentTextColor": "#000000", "consentBgColor": "#ffffff", "consentLinkTextColor": "#000000", "consentLinkHoverTextColor": "#000000", "consentButtonBgColor": "#000000", "consentButtonTextColor": "#ffffff", "consentButtonHoverBgColor": "#000000", "consentButtonHoverTextColor": "#ffffff", "active": true, "localeCode": "el-GR", "cookiePolicyPageUrl": "" }, "trackers": [], "clientSettings": [], "clientSettingsLifetime": 2592000, "cookies": [ { "name": "Hotelwize.User.TrackingPreferences", "nameRegex": null, "appName": "Website Cookie Control", "isSystemCookie": false, "isThirdParty": false, "domain": null, "maxLifeTime": 2592000, "description": "Περιγραφή cookie", "purpose": "required", "storageType": "localStorage" } ] }); HotelwizeApp.registerPlugin(cookieControlPlugin).registerTrackerManager(cookieControlPlugin); }