graphdb-workbench
Version:
The web application for GraphDB APIs
2 lines • 9.49 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:()=>l,onto_cookie_policy_dialog:()=>s});var o=t(87848),i=t(79939),c=t(57154);const l=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:"aa62410b522125feeb48eaa568a78c761e6b9596"},(0,o.h)("translate-label",{key:"0696068c1aa8738bb3ddf0e548d9140ba12609e1",labelKey:"cookie.cookie_consent"}),(0,o.h)("a",{key:"efd9792a6a424b86606b3904615c53f19a2cdb6e",id:"cookie-policy-link",href:"#",onClick:this.openModal,class:"btn btn-link p-0"},(0,o.h)("translate-label",{key:"12e95d1446f81b47c973e285ee71da5fbfa4934f",labelKey:"cookie.cookie_policy_url_label"})),"."),(0,o.h)("button",{key:"a91e7d9e7eddef1b50d82570f4211a0e1e1ae7b0",id:"accept-cookie-policy",class:"onto-btn onto-btn-primary",onClick:this.handleConsentClick},(0,o.h)("translate-label",{key:"5ca81d4f299a7b7f13ed0f77ac7d1ceaeaad318a",labelKey:"common.button.ok"})))),this.showModal&&(0,o.h)("onto-cookie-policy-dialog",{key:"e54d3f134771ff5f59a288d0d6c9949c6f59567f",dialogHandler:this}))}};var n;l.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"}(n||(n={}));const s=class{constructor(e){(0,o.r)(this,e),this.logger=i.L.logger,this.user=c.ServiceProvider.get(c.SecurityContextService).getAuthenticatedUser(),this.securityService=c.ServiceProvider.get(c.SecurityService)}toggleChanged(e){this.setUserCookieConsent(this.updateCookieConsent(e.detail)),this.securityService.updateUserData(this.user).catch(this.logger.error)}render(){var e,a;const t={dialogTitle:i.T.translate("cookie.policy.title"),onClose:()=>this.dialogHandler.onDialogClose(),modalClass:"cookie-policy-modal"},l=new c.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:"5e62d3868af4012577e84bb5c1253539a673083a",config:t},(0,o.h)("div",{key:"16eca81b0a06475b144605d8e59e96451629c96f",slot:"body"},(0,o.h)("section",{key:"e80b33838e3c8d7f98aa56279b0abda6675cae3d"},(0,o.h)("h4",{key:"669acb8c03e02245e73e3e633d3c65727a06f505"},(0,o.h)("translate-label",{key:"071e342001fea0bac249c76e71925794876a4e88",labelKey:"cookie.policy.purpose_heading"})),(0,o.h)("p",{key:"264d4941a7bd54d527c9b17db0d0a277af553a60"},(0,o.h)("translate-label",{key:"e96b4a061dc7b7f35de34b425d32983ced5379e9",labelKey:"cookie.policy.purpose_text"})),(0,o.h)("p",{key:"dde91eecd6bc971a6b99adf4c5dc5db20ea895cc"},(0,o.h)("translate-label",{key:"3d63148dd9dad889b0be3e7d6c5b11872f5a659d",labelKey:"cookie.policy.purpose_enterprise_text"}))),(0,o.h)("section",{key:"2c6108c24450d655a07c4a6cdedf2ffa0b68a99b"},(0,o.h)("h4",{key:"fd11c7d881ee183427577d335b16ccb8e09d44e0"},(0,o.h)("translate-label",{key:"4fc7994e04ae0a4eb934b99d933f9976e6c8440d",labelKey:"cookie.policy.privacy_commitment_heading"})),(0,o.h)("p",{key:"c7c8c430acb67b506732f4ffdf5138582a363f53"},(0,o.h)("translate-label",{key:"c7c476ec48cfbaf842331f2ce868cf1eb7e6af69",labelKey:"cookie.policy.privacy_commitment_text"})),(0,o.h)("ul",{key:"9762f4a7ba0cb70993daaa23fa213072b7589459"},(0,o.h)("li",{key:"53f038d506a52714d2ba63c90c277986fde70e84"},(0,o.h)("translate-label",{key:"36d36a3e084e121d40e8a2c19afea11fc7384612",labelKey:"cookie.policy.privacy_commitment_1"})),(0,o.h)("li",{key:"764c43f6b844dc18aa78c3b1bb6b6ff012e56bd4"},(0,o.h)("translate-label",{key:"222eafa3af9ce55d2fea0a796197cd355289e135",labelKey:"cookie.policy.privacy_commitment_2"})))),(0,o.h)("section",{key:"4e43cd6f18738a953d52e5d249e3d0185faead7c"},(0,o.h)("h4",{key:"9af407bdd0fa5d77293a5f1d004fa109ed2b442d"},(0,o.h)("translate-label",{key:"0e656ea4576feae9a7bd0996eba3fb2d9ad1d43f",labelKey:"cookie.policy.cookies_heading"})),(0,o.h)("p",{key:"c198b97197b54ed6d8b5342b0fb616573c3dacc8"},(0,o.h)("translate-label",{key:"5b92e0bf1249378314e6e0eb2b2928d26ea6335a",labelKey:"cookie.policy.cookies_text"}))),(0,o.h)("section",{key:"2714f502c5a75d1ed1836c59bcb13b2e478777f5"},(0,o.h)("h4",{key:"0f36bdda71a975d35dcb0945e319cdbff47db95f"},(0,o.h)("translate-label",{key:"e1c41bd8de6d78f7d57463726a47cadbf80db251",labelKey:"cookie.policy.manage_cookies_heading"})),(0,o.h)("onto-toggle-switch",{key:"2d3ca12f02eb1d218619642fb007fb30df7473a5",checked:null==l?void 0:l.statistic,labelKey:"cookie.policy.statistic_cookies",tooltipTranslationKey:"cookie.policy.statistic_tooltip",context:n.STATISTIC}),(0,o.h)("p",{key:"8d4ea408a918657ba6fb173d75010dff14ab92d8"},(0,o.h)("translate-label",{key:"3cdf73f90f86c0c777aa6608bc027a66cf4357c4",labelKey:"cookie.policy.statistic_text"})),(0,o.h)("onto-toggle-switch",{key:"5496e326b60220c122d669de25da36ff580f86a3",checked:null==l?void 0:l.thirdParty,labelKey:"cookie.policy.third_party_cookies",tooltipTranslationKey:"cookie.policy.third_party_tooltip",context:n.THIRD_PARTY}),(0,o.h)("p",{key:"6e5eb57eded1cd9039137f97792f484035fd39b4"},(0,o.h)("translate-label",{key:"4f46f1391784782d133d54f48b17b93acdd5e455",labelKey:"cookie.policy.third_party_cookies_text"}))),(0,o.h)("p",{key:"7ddab24add6d05b2cddda126adb7996dfdbac970"},(0,o.h)("span",{key:"3ec5b1a68c7c9bdcc4c771c83dbf39a76f1b53b5"},(0,o.h)("translate-label",{key:"9dedef31386432411256689eff2a087c52906740",labelKey:"cookie.policy.change_cookies"}),(0,o.h)("i",{key:"147b23da37def13f0da4a8afdc04b33205e087b8"}," ",(0,o.h)("translate-label",{key:"bba53a3b3ed74a9f1922528ed9e5d86ad40379a5",labelKey:"menu.setup.label"})," > ",(0,o.h)("translate-label",{key:"3689ef4f4d6d34c9ddd45c42a02387778d87bd1f",labelKey:"menu.my.settings.label"})," > ",(0,o.h)("translate-label",{key:"e7c73135758fd1486ee7e4a3328ba261d77aaa15",labelKey:"security.user.settings"})," > ",(0,o.h)("translate-label",{key:"d248fc63637f1587a672a18a7ea08a8fb1d6b16f",labelKey:"cookie.policy.change_cookies_location4"})," ")))))}updateCookieConsent(e){var a,t;const o=new c.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}"},79939:(e,a,t)=>{t.d(a,{L:()=>c,T:()=>n,s:()=>i});var o=t(57154);function i(e){const a=document.createElement("textarea");return a.innerHTML=e,a.value}class c{static get logger(){return o.Loggers.getLoggerInstance("SharedComponents")}}class l{constructor(){this.languageContextService=o.ServiceProvider.get(o.LanguageContextService),this.translationChangedObservers={},this.logger=c.logger,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),i(t)):(this.logger.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)=>l.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 l}};
//# sourceMappingURL=60560.2ef51d3e2d9674450419.bundle.js.map