1import{a as $}from"./chunk-VYSKMO4V.js";import{a as R}from"./chunk-KNDSKMAF.js";import{a as H}from"./chunk-S67XRJJG.js";import"./chunk-2ZC4XUZM.js";import"./chunk-YCFSTH44.js";import"./chunk-SLBSIVXM.js";import{a as V}from"./chunk-6VKN7C4K.js";import"./chunk-QMBR6UZV.js";import"./chunk-Q7TQ7QQP.js";import"./chunk-AEXM3NDU.js";import"./chunk-DCVXHXDO.js";import{o as A,q as F}from"./chunk-6UV5A6H3.js";import"./chunk-3GUPYQMM.js";import{f as z,g as W}from"./chunk-7TPLKZIR.js";import"./chunk-LTO276A7.js";import{e as D}from"./chunk-U5MEUWEY.js";import"./chunk-UIQHNFDP.js";import{Ua as E,Za as B,jb as j}from"./chunk-HPHVQO5Y.js";import{Bc as f,Dc as L,Hc as T,Ic as O,Jc as I,Lb as x,Nb as _,Sb as g,Tb as r,Ub as a,Vb as d,Za as y,ac as S,cb as c,dd as U,ia as b,id as k,jd as M,kc as u,mc as C,na as h,oa as v,qb as l,wb as m,xa as P}from"./chunk-QQFLHA75.js";import{h as p}from"./chunk-MG3ERZGY.js";function J(i,t){if(i&1){let e=S();r(0,"div",0),d(1,"div",1),r(2,"div",2)(3,"mat-checkbox",3),I("ngModelChange",function(o){h(e);let w=C();return O(w.agree,o)||(w.agree=o),v(o)}),f(4),a()(),d(5,"div",4),r(6,"div",5)(7,"button",6),u("click",function(){h(e);let o=C();return v(o.continue())}),f(8),a()()()}if(i&2){let e=t,n=C();c(),g("innerHTML",n.htmlContent(),y),c(2),T("ngModel",n.agree),c(),L(" ",e.acceptText," "),c(3),g("disabled",!n.agree()),c(),L(" ",e.continueButtonText," ")}}function K(i,t){i&1&&(r(0,"div"),d(1,"br")(2,"br"),f(3,"Login notice missing"),a())}var N=class i{#e=b(D);loginNoticeContent=M.required();htmlContent=U(()=>{let t=$.sanitize(this.loginNoticeContent().htmlContent??"",{ADD_ATTR:["style"],USE_PROFILES:{html:!0}});return this.#e.bypassSecurityTrustHtml(t)});loading=M.required();acceptEvent=k();agree=P(!1);continue(){this.acceptEvent.emit()}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=m({type:i,selectors:[["pl-login-notice"]],inputs:{loginNoticeContent:[1,"loginNoticeContent"],loading:[1,"loading"]},outputs:{acceptEvent:"acceptEvent"},decls:2,vars:2,consts:[[1,"loginNotice"],[1,"htmlContent",3,"innerHTML"],[1,"check"],["checked","false",3,"ngModelChange","ngModel"],[1,"space"],[1,"button"],["plds-button","",3,"click","disabled"]],template:function(e,n){if(e&1&&(x(0,J,9,5,"div",0),x(1,K,4,0,"div")),e&2){let o;_((o=n.loginNoticeContent())?0:-1,o),c(),_(!n.loginNoticeContent()&&!n.loading()?1:-1)}},dependencies:[W,z,j,E,B,F,A],styles:[".loginNotice[_ngcontent-%COMP%]{display:flex;flex-direction:column;margin:auto}.loginNotice[_ngcontent-%COMP%] .htmlContent[_ngcontent-%COMP%]{flex:1;margin-bottom:30px;border-radius:8px;background-color:#fff;padding:30px;white-space:pre-wrap}.loginNotice[_ngcontent-%COMP%] .check[_ngcontent-%COMP%]{flex:0;margin-top:20px;display:flex;flex-direction:row}.loginNotice[_ngcontent-%COMP%] .space[_ngcontent-%COMP%]{flex:1;margin:10px}.loginNotice[_ngcontent-%COMP%] .button[_ngcontent-%COMP%]{text-align:right}.loginNotice[_ngcontent-%COMP%] .button[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{align-self:flex-end}"]})};var s=class i{constructor(t,e,n,o){this.userService=t;this.uiLanguageService=e;this.loginNoticeService=n;this.$window=o}url="/home/dashboard";currentUiLanguage;loginNotice;isPreviewMode=!1;loading=!0;loginNoticeContent;ngOnInit(){return p(this,null,function*(){try{this.loading=!0,yield this.receiveLoginNotice(),this.currentUiLanguage=yield this.uiLanguageService.getCurrentLanguage(),this.updateCurrentLoginNoticeContent()}catch(t){console.log("Error initializing LoginNoticePageComponent"),console.log(t)}this.loading=!1})}receiveLoginNotice(){return p(this,null,function*(){this.loginNotice=yield this.loginNoticeService.checkAndGetPreview(),this.loginNotice?this.isPreviewMode=!0:this.$window.history?.state?.loginNotice?(this.loginNotice=this.$window.history.state.loginNotice,this.$window.history.state.nextUrl&&(this.url=this.$window.history.state.nextUrl)):this.loginNotice=yield this.loginNoticeService.loginNoticeForUser()})}updateCurrentLoginNoticeContent(){let t;!this.loginNotice||!this.loginNotice.loginNoticeContents||this.loginNotice.loginNoticeContents.length===0?t={htmlContent:"Invalid data, no content found",acceptText:"Accept",continueButtonText:"Continue"}:(this.currentUiLanguage?t=this.loginNotice.loginNoticeContents.filter(e=>e.htmlContent&&e.htmlContent.trim()!=="").filter(e=>e.acceptText&&e.acceptText.trim()!=="").filter(e=>e.continueButtonText&&e.continueButtonText.trim()!=="").find(e=>e.languageId===this.currentUiLanguage.localeId):console.log("No UI language provided"),t||(console.log("Looking for fallback/default LoginNoticeContent"),t=this.loginNotice.loginNoticeContents.filter(e=>e.htmlContent&&e.htmlContent.trim()!=="").filter(e=>e.acceptText&&e.acceptText.trim()!=="").filter(e=>e.continueButtonText&&e.continueButtonText.trim()!=="").find(e=>e.defaultLanguage)),t||(t={htmlContent:"Invalid content, no language or fallback found",acceptText:"Accept",continueButtonText:"Continue"})),this.loginNoticeContent=t}continue(){return p(this,null,function*(){this.isPreviewMode?this.loginNoticeService.openClosePreviewWarning():yield this.userService.acceptLoginNotice(this.url)})}static \u0275fac=function(e){return new(e||i)(l(H),l(R),l(V),l(Window))};static \u0275cmp=m({type:i,selectors:[["pl-login-notice-page"]],decls:2,vars:2,consts:[[1,"loginnoticepage"],[3,"acceptEvent","loginNoticeContent","loading"]],template:function(e,n){e&1&&(r(0,"div",0)(1,"pl-login-notice",1),u("acceptEvent",function(){return n.continue()}),a()()),e&2&&(c(),g("loginNoticeContent",n.loginNoticeContent)("loading",n.loading))},dependencies:[N],styles:[".loginnoticepage[_ngcontent-%COMP%]{padding:30px 140px;width:100%}[_nghost-%COMP%]{height:100%;display:flex;overflow-y:auto}"]})};var ue=[{path:"user",component:s},{path:"preview",component:s}];export{ue as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.