graphdb-workbench
Version:
The web application for GraphDB APIs
1 lines • 7.44 kB
JavaScript
import{r as registerInstance,c as createEvent,h,a as Host}from"./index-I_gcXFWK.js";import{T as TranslationService}from"./translation.service-Hf6024E7.js";import{ServiceProvider,SecurityContextService,SecurityService,CookieConsent}from"@ontotext/workbench-api";const ontoCookieConsentCss=".cookie-consent-modal{position:fixed;bottom:0;left:0;right:0;background-color:#fff;box-shadow:0 -2px 10px rgba(0, 0, 0, 0.1);padding:20px;z-index:1050;width:100%}.cookie-consent-content{display:flex;justify-content:center;align-items:center}.cookie-consent-content button{margin-left:12px}.cookie-policy-modal{padding:24px 40px;overflow-y:auto}.cookie-policy-modal .modal-dialog{width:60% !important;max-width:60% !important}.cookie-policy-modal .title{font-size:xx-large;font-weight:bolder}.cookie-policy-modal .heading{font-size:x-large;font-weight:bolder;margin-top:12px}.cookie-policy-modal .subheading{font-size:large;font-weight:bolder;margin-top:8px}.cookie-policy-modal .text{font-size:math}",OntoCookieConsent=class{constructor(e){registerInstance(this,e),this.consentGiven=createEvent(this,"consentGiven"),this.showModal=!1,this.openModal=e=>{e.preventDefault(),this.showModal=!0},this.handleConsentClick=()=>{this.consentGiven.emit()}}onDialogClose(){this.showModal=!1}render(){return h(Host,{key:"dba3fc373e9ad60ada7f86d11acbe1b1ed24a92d"},h("div",{key:"414c970a3a4b263e8f3f5d066dc8bb22b8194c48",class:"cookie-consent-modal"},h("section",{key:"6a1cccadb167b301738fb6a453b7d300e93ba18b",class:"cookie-consent-content"},h("span",{key:"1b60fbb2c50049e568ac0cc34875a0df388ea176"},h("translate-label",{key:"f64506a6ea5d01ac231a3f06377c84654cf8e0c7",labelKey:"cookie.cookie_consent"}),h("a",{key:"bd467bae7911ec9248f6296a655651fee07db73c",id:"cookie-policy-link",href:"#",onClick:this.openModal,class:"btn btn-link p-0"},h("translate-label",{key:"3c43ff2eb701200253fffb1c17f53355f52af11a",labelKey:"cookie.cookie_policy_url_label"})),"."),h("button",{key:"6a6c6029a325cd39fbdf0b74c3bd2ca6157f81ae",id:"accept-cookie-policy",class:"onto-btn onto-btn-primary",onClick:this.handleConsentClick},h("translate-label",{key:"b7dfb20b211927f2aec4199beb35e582768db96c",labelKey:"common.button.ok"})))),this.showModal&&h("onto-cookie-policy-dialog",{key:"b3a905894b4683b6b7b45809f1e97139cd998088",dialogHandler:this}))}};OntoCookieConsent.style=ontoCookieConsentCss;const ontoCookiePolicyDialogCss="section h4{font-size:x-large;font-weight:bolder;margin-top:12px}";var CookieType;!function(e){e.THIRD_PARTY="thirdParty",e.STATISTIC="statistic"}(CookieType||(CookieType={}));const OntoCookiePolicyDialog=class{constructor(e){registerInstance(this,e),this.user=ServiceProvider.get(SecurityContextService).getAuthenticatedUser(),this.securityService=ServiceProvider.get(SecurityService)}toggleChanged(e){this.setUserCookieConsent(this.updateCookieConsent(e.detail)),this.securityService.updateUserData(this.user).catch(console.error)}render(){var e,o;const a={dialogTitle:TranslationService.translate("cookie.policy.title"),onClose:()=>this.dialogHandler.onDialogClose(),modalClass:"cookie-policy-modal"},t=new CookieConsent(null===(o=null===(e=this.user)||void 0===e?void 0:e.appSettings)||void 0===o?void 0:o.COOKIE_CONSENT);return h("onto-dialog",{key:"5c9716eebf02b30a51d90af98775d7e183618290",config:a},h("div",{key:"afdaebff817f24cfda4bafbcc386a741f7907674",slot:"body"},h("section",{key:"5387b27738aaba232f3646a1a71fbe1bc7b5332f"},h("h4",{key:"ab64a92c9e72bfa48868b5e8e8055eb674e40eda"},h("translate-label",{key:"b7f62e750e65a6d354e2f3bc9bfaf6d5eca304d4",labelKey:"cookie.policy.purpose_heading"})),h("p",{key:"0354cbaf054caa4680d548f33434bbee4527c40e"},h("translate-label",{key:"69c60946be613dea36d2690d287e645edb71483a",labelKey:"cookie.policy.purpose_text"})),h("p",{key:"055e50c6a516413f46a35c7b85952e4aa1a9f9df"},h("translate-label",{key:"70857b357e74bb7dfb8c384883668c8b2482ca4a",labelKey:"cookie.policy.purpose_enterprise_text"}))),h("section",{key:"6e71eb5aae17c6da27bf257cae2a0760860df5d1"},h("h4",{key:"83b3b663f46498e43c7ab30410de8f074243c3ae"},h("translate-label",{key:"2f6b5c9c10ace40140ecafbcd7d10709df14b1ab",labelKey:"cookie.policy.privacy_commitment_heading"})),h("p",{key:"09f6d19d59629866fa3b21842831d392b9e555ec"},h("translate-label",{key:"4c8f23a3c88299a4fd5d390eaa4a7afa5862d9ad",labelKey:"cookie.policy.privacy_commitment_text"})),h("ul",{key:"09b90acc150cf43a9e59297b34657d9c0d6f58cf"},h("li",{key:"703ef7e25fb39d5d42980653b1fcf86d8a94557c"},h("translate-label",{key:"df7d2a7233e3c18a068fa9058c3c193d3cd29aa9",labelKey:"cookie.policy.privacy_commitment_1"})),h("li",{key:"8d31ea369caab98410d1ca4d10ca56acbf712b4d"},h("translate-label",{key:"4cf9f87d207ae4a56f5ef25ad5e61ae49229a66d",labelKey:"cookie.policy.privacy_commitment_2"})))),h("section",{key:"11a8ff13f5ccf5ce1ee72a6ddd14f7a15aaf28a8"},h("h4",{key:"05c721ac41e0ce384336f36efbed649cdf3c8521"},h("translate-label",{key:"0311734172a238e9a34d5b646ce7226146ca4fb4",labelKey:"cookie.policy.cookies_heading"})),h("p",{key:"9b6348c8749b252e1308c2217753333d7f34510d"},h("translate-label",{key:"ec1a61b4d8c13ade4a3596818916bd4fb0ea9250",labelKey:"cookie.policy.cookies_text"}))),h("section",{key:"0a56afdf911e56f1e857bd9c8141214b841cfab6"},h("h4",{key:"1aab64214b9a77114cd6a57ad32386dcc7361f92"},h("translate-label",{key:"124cd6d94ab003ee056b8f57a1550604500d2af8",labelKey:"cookie.policy.manage_cookies_heading"})),h("onto-toggle-switch",{key:"d5e9c3008e8286bc6223fe46d955b8f40e229401",checked:null==t?void 0:t.statistic,labelKey:"cookie.policy.statistic_cookies",tooltipTranslationKey:"cookie.policy.statistic_tooltip",context:CookieType.STATISTIC}),h("p",{key:"950ed4231c70d11951d75d5c7e2f4baa3b037a29"},h("translate-label",{key:"89d34f7bdedcb706c873f14d7cab5cc3d7c02f24",labelKey:"cookie.policy.statistic_text"})),h("onto-toggle-switch",{key:"ec5ad346c46f236b53738df40661b39581441c76",checked:null==t?void 0:t.thirdParty,labelKey:"cookie.policy.third_party_cookies",tooltipTranslationKey:"cookie.policy.third_party_tooltip",context:CookieType.THIRD_PARTY}),h("p",{key:"dcb9444ad459d3ae88200c4d6aabb60ac32ac0b2"},h("translate-label",{key:"7f8f517ed2b9eb396cda52247f93e2269e081169",labelKey:"cookie.policy.third_party_cookies_text"}))),h("p",{key:"bd784e85cfbd3189e52ce75159a7c2727c8b71bc"},h("span",{key:"5cd30d116bf907e58ee72b5b9d87c46895287085"},h("translate-label",{key:"bc7ef9a8f755ec932c93eb6f37f47646c3d9d4db",labelKey:"cookie.policy.change_cookies"}),h("i",{key:"f77778f441780569f9519112b54827f64ef45c4b"}," ",h("translate-label",{key:"327b6accb62caf5075e2d7d5191b55a375cbd7e8",labelKey:"menu.setup.label"})," > ",h("translate-label",{key:"f4d1aa6a0ff386f5dcc91644c444c0cbdb31de93",labelKey:"menu.my.settings.label"})," > ",h("translate-label",{key:"6addb466067cca060041f13085d1bad6d8dada18",labelKey:"security.user.settings"})," > ",h("translate-label",{key:"40348ad073e5b407aa077a64ac19c4a4fcd5deec",labelKey:"cookie.policy.change_cookies_location4"})," ")))))}updateCookieConsent(e){var o,a;const t=new CookieConsent(null===(a=null===(o=this.user)||void 0===o?void 0:o.appSettings)||void 0===a?void 0:a.COOKIE_CONSENT);return t[e.context]=e.checked,t.updatedAt=(new Date).getTime(),t}setUserCookieConsent(e){this.user.appSettings||(this.user.appSettings={}),this.user.appSettings.COOKIE_CONSENT=e}};OntoCookiePolicyDialog.style=ontoCookiePolicyDialogCss;export{OntoCookieConsent as onto_cookie_consent,OntoCookiePolicyDialog as onto_cookie_policy_dialog};