graphdb-workbench
Version:
The web application for GraphDB APIs
2 lines • 9.56 kB
JavaScript
export const __webpack_esm_id__=60560;export const __webpack_esm_ids__=[60560];export const __webpack_esm_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(79939),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:"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 l;n.style=".cookie-consent-modal{position:fixed;bottom:0;left:0;right:0;background-color:var(--gw-dialog-background);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.logger=c.L.logger,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.updateAuthenticatedUser(this.user.toUser()).catch(this.logger.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:"c76529daf7d24ad06970ba3b8e7f87446daeec37",config:t},(0,o.h)("div",{key:"412c71cf9a3b8e094962a4e4299679f16394869a",slot:"body"},(0,o.h)("section",{key:"0d730d3c02ab298d66de7ab56100bc1f13d989c6"},(0,o.h)("h4",{key:"4cbcc42d566ebf8e4c7507df9b367e9caa847565"},(0,o.h)("translate-label",{key:"ceed3f8d2aa7de9b614af25c6c4cb66ac1d74869",labelKey:"cookie.policy.purpose_heading"})),(0,o.h)("p",{key:"f9a72d8c3fbc9a04ea488e6045e6d8d74d8e7265"},(0,o.h)("translate-label",{key:"046cacb46e54bc228dcb7bf3a692f9fb28798de5",labelKey:"cookie.policy.purpose_text"})),(0,o.h)("p",{key:"70bbd5c2f6d30771477b3ee6e822a8def976e050"},(0,o.h)("translate-label",{key:"cc95a3b4ea1292ea33226bfb27db8fdc8a03969a",labelKey:"cookie.policy.purpose_enterprise_text"}))),(0,o.h)("section",{key:"4340f499aaa0de9b0bd7a5b089efd93a66f864bd"},(0,o.h)("h4",{key:"c31244de543a54f52382d572c203f15c9f6bc61d"},(0,o.h)("translate-label",{key:"3193fab62ec3f9132793a3100600017c12606546",labelKey:"cookie.policy.privacy_commitment_heading"})),(0,o.h)("p",{key:"ba75b0d207a6e4423ad87317abdae05a386109cd"},(0,o.h)("translate-label",{key:"8362dabe248988373af6ffe8219ddd229b585d45",labelKey:"cookie.policy.privacy_commitment_text"})),(0,o.h)("ul",{key:"ac3a59a29d8ff17f59834734e10fa38c5891024e"},(0,o.h)("li",{key:"d8cda68c7424c76138f7da948cd522d4994cbd4f"},(0,o.h)("translate-label",{key:"9f10c3678b02c7153a3aef73e86d9fe6b4fd5557",labelKey:"cookie.policy.privacy_commitment_1"})),(0,o.h)("li",{key:"623c725c85c2706425b8f5f27750393c8b88a761"},(0,o.h)("translate-label",{key:"acdbad3cc0590aa0094ae6d0e0d5a00964291c41",labelKey:"cookie.policy.privacy_commitment_2"})))),(0,o.h)("section",{key:"aecf76c57fcfce12f1f67643a587f390b975eb95"},(0,o.h)("h4",{key:"5264365da2a50c4c24cb5a8d14dd039ff7c3f5de"},(0,o.h)("translate-label",{key:"c3b7711c0959ddcce90986b2dcc5e42e2aacedcb",labelKey:"cookie.policy.cookies_heading"})),(0,o.h)("p",{key:"92b79942b35a9e6224c95c0b955505a49cc67b00"},(0,o.h)("translate-label",{key:"86822629019ad073ef2d90899da1397a87d5796f",labelKey:"cookie.policy.cookies_text"}))),(0,o.h)("section",{key:"3ea0f6201a2d78b40045adb4aa26eb8baa382adc"},(0,o.h)("h4",{key:"b96b6a082351c803d229038c2ca7acc99294ab86"},(0,o.h)("translate-label",{key:"6aab9024ff0fd8734706bd7caec59335c3ddc7ac",labelKey:"cookie.policy.manage_cookies_heading"})),(0,o.h)("onto-toggle-switch",{key:"c97358e1147cbb36d950302ee2fc29733e088ef9",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:"e6172a9fb3b8e1b0ab10609b1ebda7fcf350e93b"},(0,o.h)("translate-label",{key:"701fb389671ed440a1080e6e76fd1344cb4e5b6e",labelKey:"cookie.policy.statistic_text"})),(0,o.h)("onto-toggle-switch",{key:"e36a2699b2140e33288dd2cac9702d8fca6784db",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:"98cced78a81c9942b5f5169fee662c368192946e"},(0,o.h)("translate-label",{key:"df1ba989e1fc792fa9f56e4f9661fdb28fa55f90",labelKey:"cookie.policy.third_party_cookies_text"}))),(0,o.h)("p",{key:"a892129a7183dd84e10eb31cf5a6a1698b61b5d7"},(0,o.h)("span",{key:"c2b6a400347f2019c7647273c3d7029f0ad9b039"},(0,o.h)("translate-label",{key:"d43317f8f68615516c7a81e8aa787756bdec1205",labelKey:"cookie.policy.change_cookies"}),(0,o.h)("i",{key:"8f9efc29f7630c1d6e58fdf50241ff625fc8c7bf"}," ",(0,o.h)("translate-label",{key:"6c906a77d90237a17b5c3e1887c41b532830040d",labelKey:"menu.setup.label"})," > ",(0,o.h)("translate-label",{key:"75f59cf20cd4a1fbee4afb3388b5f341fd957613",labelKey:"menu.my.settings.label"})," > ",(0,o.h)("translate-label",{key:"352f8f0b324655e86bc9175e8c70567e34e68f2a",labelKey:"security.user.settings"})," > ",(0,o.h)("translate-label",{key:"0067f9f65859f946006115d1957337f42a805274",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=new i.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:()=>i,T:()=>l,s:()=>c});var o=t(57154);function c(e){const a=document.createElement("textarea");return a.innerHTML=e,a.value}class i{static get logger(){return o.Loggers.getLoggerInstance("SharedComponents")}}class n{constructor(){this.languageContextService=o.ServiceProvider.get(o.LanguageContextService),this.translationChangedObservers={},this.logger=i.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),c(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)=>n.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 l=new n}};
//# sourceMappingURL=60560.d0bbcbcb698f6a1aaf06.bundle.js.map