graphdb-workbench
Version:
The web application for GraphDB APIs
2 lines • 9.35 kB
JavaScript
export const __webpack_id__=60560;export const __webpack_ids__=[60560];export const __webpack_modules__={60560:(e,a,t)=>{t.r(a),t.d(a,{onto_cookie_consent:()=>n,onto_cookie_policy_dialog:()=>s});var o=t(87848),c=t(77050),i=t(57154);const n=class{constructor(e){(0,o.r)(this,e),this.consentGiven=(0,o.c)(this,"consentGiven"),this.showModal=!1,this.openModal=e=>{e.preventDefault(),this.showModal=!0},this.handleConsentClick=()=>{this.consentGiven.emit()}}onDialogClose(){this.showModal=!1}render(){return(0,o.h)(o.a,{key:"dba3fc373e9ad60ada7f86d11acbe1b1ed24a92d"},(0,o.h)("div",{key:"414c970a3a4b263e8f3f5d066dc8bb22b8194c48",class:"cookie-consent-modal"},(0,o.h)("section",{key:"6a1cccadb167b301738fb6a453b7d300e93ba18b",class:"cookie-consent-content"},(0,o.h)("span",{key:"1b60fbb2c50049e568ac0cc34875a0df388ea176"},(0,o.h)("translate-label",{key:"f64506a6ea5d01ac231a3f06377c84654cf8e0c7",labelKey:"cookie.cookie_consent"}),(0,o.h)("a",{key:"bd467bae7911ec9248f6296a655651fee07db73c",id:"cookie-policy-link",href:"#",onClick:this.openModal,class:"btn btn-link p-0"},(0,o.h)("translate-label",{key:"3c43ff2eb701200253fffb1c17f53355f52af11a",labelKey:"cookie.cookie_policy_url_label"})),"."),(0,o.h)("button",{key:"6a6c6029a325cd39fbdf0b74c3bd2ca6157f81ae",id:"accept-cookie-policy",class:"onto-btn onto-btn-primary",onClick:this.handleConsentClick},(0,o.h)("translate-label",{key:"b7dfb20b211927f2aec4199beb35e582768db96c",labelKey:"common.button.ok"})))),this.showModal&&(0,o.h)("onto-cookie-policy-dialog",{key:"b3a905894b4683b6b7b45809f1e97139cd998088",dialogHandler:this}))}};var l;n.style=".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}",function(e){e.THIRD_PARTY="thirdParty",e.STATISTIC="statistic"}(l||(l={}));const s=class{constructor(e){(0,o.r)(this,e),this.user=i.ServiceProvider.get(i.SecurityContextService).getAuthenticatedUser(),this.securityService=i.ServiceProvider.get(i.SecurityService)}toggleChanged(e){this.setUserCookieConsent(this.updateCookieConsent(e.detail)),this.securityService.updateUserData(this.user).catch(console.error)}render(){var e,a;const t={dialogTitle:c.T.translate("cookie.policy.title"),onClose:()=>this.dialogHandler.onDialogClose(),modalClass:"cookie-policy-modal"},n=new i.CookieConsent(null===(a=null===(e=this.user)||void 0===e?void 0:e.appSettings)||void 0===a?void 0:a.COOKIE_CONSENT);return(0,o.h)("onto-dialog",{key:"5c9716eebf02b30a51d90af98775d7e183618290",config:t},(0,o.h)("div",{key:"afdaebff817f24cfda4bafbcc386a741f7907674",slot:"body"},(0,o.h)("section",{key:"5387b27738aaba232f3646a1a71fbe1bc7b5332f"},(0,o.h)("h4",{key:"ab64a92c9e72bfa48868b5e8e8055eb674e40eda"},(0,o.h)("translate-label",{key:"b7f62e750e65a6d354e2f3bc9bfaf6d5eca304d4",labelKey:"cookie.policy.purpose_heading"})),(0,o.h)("p",{key:"0354cbaf054caa4680d548f33434bbee4527c40e"},(0,o.h)("translate-label",{key:"69c60946be613dea36d2690d287e645edb71483a",labelKey:"cookie.policy.purpose_text"})),(0,o.h)("p",{key:"055e50c6a516413f46a35c7b85952e4aa1a9f9df"},(0,o.h)("translate-label",{key:"70857b357e74bb7dfb8c384883668c8b2482ca4a",labelKey:"cookie.policy.purpose_enterprise_text"}))),(0,o.h)("section",{key:"6e71eb5aae17c6da27bf257cae2a0760860df5d1"},(0,o.h)("h4",{key:"83b3b663f46498e43c7ab30410de8f074243c3ae"},(0,o.h)("translate-label",{key:"2f6b5c9c10ace40140ecafbcd7d10709df14b1ab",labelKey:"cookie.policy.privacy_commitment_heading"})),(0,o.h)("p",{key:"09f6d19d59629866fa3b21842831d392b9e555ec"},(0,o.h)("translate-label",{key:"4c8f23a3c88299a4fd5d390eaa4a7afa5862d9ad",labelKey:"cookie.policy.privacy_commitment_text"})),(0,o.h)("ul",{key:"09b90acc150cf43a9e59297b34657d9c0d6f58cf"},(0,o.h)("li",{key:"703ef7e25fb39d5d42980653b1fcf86d8a94557c"},(0,o.h)("translate-label",{key:"df7d2a7233e3c18a068fa9058c3c193d3cd29aa9",labelKey:"cookie.policy.privacy_commitment_1"})),(0,o.h)("li",{key:"8d31ea369caab98410d1ca4d10ca56acbf712b4d"},(0,o.h)("translate-label",{key:"4cf9f87d207ae4a56f5ef25ad5e61ae49229a66d",labelKey:"cookie.policy.privacy_commitment_2"})))),(0,o.h)("section",{key:"11a8ff13f5ccf5ce1ee72a6ddd14f7a15aaf28a8"},(0,o.h)("h4",{key:"05c721ac41e0ce384336f36efbed649cdf3c8521"},(0,o.h)("translate-label",{key:"0311734172a238e9a34d5b646ce7226146ca4fb4",labelKey:"cookie.policy.cookies_heading"})),(0,o.h)("p",{key:"9b6348c8749b252e1308c2217753333d7f34510d"},(0,o.h)("translate-label",{key:"ec1a61b4d8c13ade4a3596818916bd4fb0ea9250",labelKey:"cookie.policy.cookies_text"}))),(0,o.h)("section",{key:"0a56afdf911e56f1e857bd9c8141214b841cfab6"},(0,o.h)("h4",{key:"1aab64214b9a77114cd6a57ad32386dcc7361f92"},(0,o.h)("translate-label",{key:"124cd6d94ab003ee056b8f57a1550604500d2af8",labelKey:"cookie.policy.manage_cookies_heading"})),(0,o.h)("onto-toggle-switch",{key:"d5e9c3008e8286bc6223fe46d955b8f40e229401",checked:null==n?void 0:n.statistic,labelKey:"cookie.policy.statistic_cookies",tooltipTranslationKey:"cookie.policy.statistic_tooltip",context:l.STATISTIC}),(0,o.h)("p",{key:"950ed4231c70d11951d75d5c7e2f4baa3b037a29"},(0,o.h)("translate-label",{key:"89d34f7bdedcb706c873f14d7cab5cc3d7c02f24",labelKey:"cookie.policy.statistic_text"})),(0,o.h)("onto-toggle-switch",{key:"ec5ad346c46f236b53738df40661b39581441c76",checked:null==n?void 0:n.thirdParty,labelKey:"cookie.policy.third_party_cookies",tooltipTranslationKey:"cookie.policy.third_party_tooltip",context:l.THIRD_PARTY}),(0,o.h)("p",{key:"dcb9444ad459d3ae88200c4d6aabb60ac32ac0b2"},(0,o.h)("translate-label",{key:"7f8f517ed2b9eb396cda52247f93e2269e081169",labelKey:"cookie.policy.third_party_cookies_text"}))),(0,o.h)("p",{key:"bd784e85cfbd3189e52ce75159a7c2727c8b71bc"},(0,o.h)("span",{key:"5cd30d116bf907e58ee72b5b9d87c46895287085"},(0,o.h)("translate-label",{key:"bc7ef9a8f755ec932c93eb6f37f47646c3d9d4db",labelKey:"cookie.policy.change_cookies"}),(0,o.h)("i",{key:"f77778f441780569f9519112b54827f64ef45c4b"}," ",(0,o.h)("translate-label",{key:"327b6accb62caf5075e2d7d5191b55a375cbd7e8",labelKey:"menu.setup.label"})," > ",(0,o.h)("translate-label",{key:"f4d1aa6a0ff386f5dcc91644c444c0cbdb31de93",labelKey:"menu.my.settings.label"})," > ",(0,o.h)("translate-label",{key:"6addb466067cca060041f13085d1bad6d8dada18",labelKey:"security.user.settings"})," > ",(0,o.h)("translate-label",{key:"40348ad073e5b407aa077a64ac19c4a4fcd5deec",labelKey:"cookie.policy.change_cookies_location4"})," ")))))}updateCookieConsent(e){var a,t;const o=new i.CookieConsent(null===(t=null===(a=this.user)||void 0===a?void 0:a.appSettings)||void 0===t?void 0:t.COOKIE_CONSENT);return o[e.context]=e.checked,o.updatedAt=(new Date).getTime(),o}setUserCookieConsent(e){this.user.appSettings||(this.user.appSettings={}),this.user.appSettings.COOKIE_CONSENT=e}};s.style="section h4{font-size:x-large;font-weight:bolder;margin-top:12px}"},77050:(e,a,t)=>{t.d(a,{T:()=>n,s:()=>c});var o=t(57154);function c(e){const a=document.createElement("textarea");return a.innerHTML=e,a.value}class i{constructor(){this.languageContextService=o.ServiceProvider.get(o.LanguageContextService),this.translationChangedObservers={},this.defaultBundle=this.languageContextService.getDefaultBundle(),this.subscribeToBundleChange()}onTranslate(e,a=[],t=()=>{}){this.translationChangedObservers[e]=this.translationChangedObservers[e]||[];const o={parameters:a,callback:t};return this.translationChangedObservers[e].push(o),t(this.translate(e,a)),()=>{const a=this.translationChangedObservers[e].indexOf(o);-1!==a&&this.translationChangedObservers[e].splice(a,1)}}translate(e,a){return this.translateInLocale(e,a)}translateInLocale(e,a){let t=this.translateFromBundle(this.currentBundle,e);return t||(t=this.translateFromBundle(this.defaultBundle,e)),t?(t=this.applyParameters(t,a),c(t)):(console.warn(`Missing translation for key: [${e}]`),e)}translateFromBundle(e,a){if(!e)return;let t=e[a];return"string"!=typeof t&&(t=this.translateAsJsonObject(e,a)),t}translateAsJsonObject(e,a){let t=a.split(".");return this.getTranslation(e,t)}getTranslation(e,a){if(!a||!e)return;const t=e[a.splice(0,1)[0]];return 0===a.length?t:"string"!=typeof t?a.length>0?this.getTranslation(t,a):t:void 0}applyParameters(e,a){return a?a.reduce((e,a)=>i.replaceAll(e,a),e):e}static replaceAll(e,a){return a?e.split(`{{${a.key}}}`).join(a.value):e}notifyTranslationsChanged(){Object.keys(this.translationChangedObservers).forEach(e=>{(this.translationChangedObservers[e]||[]).forEach(a=>a.callback(this.translate(e,a.parameters)))})}subscribeToBundleChange(){this.languageChangeSubscription=this.languageContextService.onLanguageBundleChanged(e=>{e&&(this.currentBundle=e,this.notifyTranslationsChanged())})}destroy(){this.languageChangeSubscription&&this.languageChangeSubscription()}}const n=new i}};
//# sourceMappingURL=60560.024578077d95b851beea.bundle.js.map